Advertisement
Guest User

Untitled

a guest
May 17th, 2016
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 407.90 KB | None | 0 0
  1. import java.applet.*;
  2. import java.awt.*;
  3. import java.io.*;
  4. import java.net.*;
  5. import java.text.*;
  6. import java.lang.reflect.Method;
  7.  
  8.  
  9.  
  10. public class Client extends RSApplet {
  11.  
  12. public static boolean enableTweening = true;
  13. public enum ScreenMode {
  14. FIXED,
  15. RESIZABLE;
  16. }
  17. public static ScreenMode frameMode = ScreenMode.FIXED;
  18. public static int frameWidth = 765;
  19. public static int frameHeight = 502;
  20. public static int screenAreaWidth = 512;
  21. public static int screenAreaHeight = 334;
  22. public static int cameraZoom = 600;
  23. public static boolean showChatComponents = true;
  24. public static boolean showTabComponents = true;
  25. public static boolean changeTabArea = frameMode == ScreenMode.FIXED ? false : true;
  26. public static boolean changeChatArea = frameMode == ScreenMode.FIXED ? false : true;
  27. public static boolean transparentTabArea = false;
  28.  
  29.  
  30. private boolean drawOverChat = false;
  31.  
  32. //private Player opponent;
  33. public boolean hitmarks554 = false;
  34.  
  35.  
  36. public static void frameMode(ScreenMode screenMode) {
  37. if (frameMode != screenMode) {
  38. frameMode = screenMode;
  39. if (screenMode == ScreenMode.FIXED) {
  40. frameWidth = 765;
  41. frameHeight = 502;
  42. cameraZoom = 600;
  43. WorldController.viewDistance = 9;
  44. changeChatArea = false;
  45. changeTabArea = false;
  46. } else if (screenMode == ScreenMode.RESIZABLE) {
  47. frameWidth = 766;
  48. frameHeight = 563;
  49. cameraZoom = 850;
  50. WorldController.viewDistance = 10;
  51. }
  52. rebuildFrameSize(screenMode, frameWidth, frameHeight);
  53. setBounds();
  54. System.out.println("ScreenMode: " + screenMode.toString());
  55. }
  56. showChatComponents = screenMode == ScreenMode.FIXED ? true : showChatComponents;
  57. showTabComponents = screenMode == ScreenMode.FIXED ? true : showTabComponents;
  58. }
  59.  
  60. public static void rebuildFrameSize(ScreenMode screenMode, int screenWidth, int screenHeight) {
  61. try {
  62. screenAreaWidth = (screenMode == ScreenMode.FIXED) ? 512 : screenWidth;
  63. screenAreaHeight = (screenMode == ScreenMode.FIXED) ? 334 : screenHeight;
  64. frameWidth = screenWidth;
  65. frameHeight = screenHeight;
  66. Jframe.refreshFrameSize(screenMode == ScreenMode.FIXED, screenMode == ScreenMode.RESIZABLE);
  67. setBounds();
  68. } catch (Exception e) {
  69. e.printStackTrace();
  70. }
  71. }
  72.  
  73. public void refreshFrameSize() {
  74. if (frameMode != ScreenMode.FIXED) {
  75. if (frameWidth != getGameComponent().getWidth()) {
  76. frameWidth = getGameComponent().getWidth();
  77. screenAreaWidth = frameWidth;
  78. setBounds();
  79. }
  80. if (frameHeight != getGameComponent().getHeight()) {
  81. frameHeight = getGameComponent().getHeight();
  82. screenAreaHeight = frameHeight;
  83. setBounds();
  84. }
  85. }
  86. }
  87.  
  88. private static void setBounds() {
  89. Texture.method365(frameWidth, frameHeight);
  90. fullScreenTextureArray = Texture.anIntArray1472;
  91. Texture.method365(frameMode == ScreenMode.FIXED ? (aRSImageProducer_1166 != null ? aRSImageProducer_1166.canvasWidth : 519) : frameWidth, frameMode == ScreenMode.FIXED ? (aRSImageProducer_1166 != null ? aRSImageProducer_1166.canvasHeight : 165) : frameHeight);
  92. anIntArray1180 = Texture.anIntArray1472;
  93. Texture.method365(frameMode == ScreenMode.FIXED ? (aRSImageProducer_1163 != null ? aRSImageProducer_1163.canvasWidth : 249) : frameWidth, frameMode == ScreenMode.FIXED ? (aRSImageProducer_1163 != null ? aRSImageProducer_1163.canvasHeight : 335) : frameHeight);
  94. anIntArray1181 = Texture.anIntArray1472;
  95. Texture.method365(screenAreaWidth, screenAreaHeight);
  96. anIntArray1182 = Texture.anIntArray1472;
  97. int ai[] = new int[9];
  98. for(int i8 = 0; i8 < 9; i8++) {
  99. int k8 = 128 + i8 * 32 + 15;
  100. int l8 = cameraZoom + k8 * 3;
  101. int i9 = Texture.anIntArray1470[k8];
  102. ai[i8] = l8 * i9 >> 16;
  103. }
  104. if (frameMode == ScreenMode.RESIZABLE && (frameWidth >= 756) && (frameWidth <= 1025) && (frameHeight >= 494) && (frameHeight <= 850)) {
  105. WorldController.viewDistance = 9;
  106. cameraZoom = 575;
  107. } else if (frameMode == ScreenMode.FIXED) {
  108. cameraZoom = 600;
  109. } else if (frameMode == ScreenMode.RESIZABLE) {
  110. WorldController.viewDistance = 10;
  111. cameraZoom = 600;
  112. }
  113. WorldController.method310(500, 800, screenAreaWidth, screenAreaHeight, ai);
  114. if (loggedIn) {
  115. aRSImageProducer_1165 = new GraphicsBuffer(screenAreaWidth, screenAreaHeight);
  116. }
  117. }
  118.  
  119. public boolean getMousePositions() {
  120. if (mouseInRegion(frameWidth - (frameWidth <= 1000 ? 240 : 420), frameHeight - (frameWidth <= 1000 ? 90 : 37), frameWidth, frameHeight)) {
  121. return false;
  122. }
  123. if (showChatComponents) {
  124. if (changeChatArea) {
  125. if (super.mouseX > 0 && super.mouseX < 494 && super.mouseY > frameHeight - 175 && super.mouseY < frameHeight) {
  126. return true;
  127. } else {
  128. if (super.mouseX > 494 && super.mouseX < 515 && super.mouseY > frameHeight - 175 && super.mouseY < frameHeight) {
  129. return false;
  130. }
  131. }
  132. } else if (!changeChatArea) {
  133. if (super.mouseX > 0 && super.mouseX < 519 && super.mouseY > frameHeight - 175 && super.mouseY < frameHeight) {
  134. return false;
  135. }
  136. }
  137. }
  138. if (mouseInRegion(frameWidth - 216, 0, frameWidth, 165)) {
  139. return false;
  140. }
  141. if (!changeTabArea) {
  142. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseY < frameWidth && super.mouseY < frameHeight) {
  143. if (super.mouseX >= frameWidth - 242 && super.mouseY >= frameHeight - 335) {
  144. return false;
  145. }
  146. return true;
  147. }
  148. return false;
  149. }
  150. if (showTabComponents) {
  151. if (frameWidth > 1000) {
  152. 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) {
  153. return false;
  154. }
  155. } else {
  156. 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) {
  157. return false;
  158. }
  159. }
  160. }
  161. return true;
  162. }
  163.  
  164. public boolean mouseInRegion(int x1, int y1, int x2, int y2) {
  165. if (super.mouseX >= x1 && super.mouseX <= x2 && super.mouseY >= y1 && super.mouseY <= y2) {
  166. return true;
  167. }
  168. return false;
  169. }
  170.  
  171. public boolean mouseMapPosition() {
  172. if (super.mouseX >= frameWidth - 21 && super.mouseX <= frameWidth && super.mouseY >= 0 && super.mouseY <= 21) {
  173. return false;
  174. }
  175. return true;
  176. }
  177.  
  178. private static final long serialVersionUID = 5707517957054703648L;
  179.  
  180. private static String intToKOrMilLongName(int i) {
  181. String s = String.valueOf(i);
  182. for (int k = s.length() - 3; k > 0; k -= 3)
  183. s = s.substring(0, k) + "," + s.substring(k);
  184. if (s.length() > 8)
  185. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  186. else if (s.length() > 4)
  187. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  188. return " " + s;
  189. }
  190.  
  191. public final String methodR(int j) {
  192. if (j >= 0 && j < 10000)
  193. return String.valueOf(j);
  194. if (j >= 10000 && j < 10000000)
  195. return j / 1000 + "K";
  196. if (j >= 10000000 && j < 999999999)
  197. return j / 1000000 + "M";
  198. if (j >= 999999999)
  199. return "*";
  200. else
  201. return "?";
  202. }
  203.  
  204. public static final byte[] ReadFile(String s) {
  205. try {
  206. byte abyte0[];
  207. File file = new File(s);
  208. int i = (int) file.length();
  209. abyte0 = new byte[i];
  210. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  211. datainputstream.readFully(abyte0, 0, i);
  212. datainputstream.close();
  213. return abyte0;
  214. } catch (Exception e) {
  215. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  216. return null;
  217. }
  218. }
  219.  
  220. private void stopMidi() {
  221. Signlink.midifade = 0;
  222. Signlink.midi = "stop";
  223. }
  224.  
  225. private boolean menuHasAddFriend(int j) {
  226. if (j < 0)
  227. return false;
  228. int k = menuActionID[j];
  229. if (k >= 2000)
  230. k -= 2000;
  231. return k == 337;
  232. }
  233.  
  234. private final int[]
  235. modeX = { 164, 230, 296, 362 },
  236. modeNamesX = { 26, 86, 150, 212, 286, 349, 427 },
  237. modeNamesY = { 158, 158, 153, 153, 153, 153, 158 },
  238. channelButtonsX = { 5, 71, 137, 203, 269, 335, 404 };
  239.  
  240. private final String[] modeNames = { "All", "Game", "Public", "Private", "Clan", "Trade", "Report Abuse" };
  241.  
  242. public void drawChannelButtons() {
  243. final int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 165;
  244. cacheSprite[36].drawSprite(0, 143 + yOffset);
  245. String text[] = { "On", "Friends", "Off", "Hide" };
  246. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  247. switch (cButtonCPos) {
  248. case 0:
  249. case 1:
  250. case 2:
  251. case 3:
  252. case 4:
  253. case 5:
  254. case 6:
  255. cacheSprite[13].drawSprite(channelButtonsX[cButtonCPos], 143 + yOffset);
  256. break;
  257. }
  258. if (cButtonHPos == cButtonCPos) {
  259. switch (cButtonHPos) {
  260. case 0:
  261. case 1:
  262. case 2:
  263. case 3:
  264. case 4:
  265. case 5:
  266. case 6:
  267. case 7:
  268. cacheSprite[14].drawSprite(channelButtonsX[cButtonHPos], 143 + yOffset);
  269. break;
  270. }
  271. } else {
  272. switch (cButtonHPos) {
  273. case 0:
  274. case 1:
  275. case 2:
  276. case 3:
  277. case 4:
  278. case 5:
  279. cacheSprite[12].drawSprite(channelButtonsX[cButtonHPos], 143 + yOffset);
  280. break;
  281. case 6:
  282. cacheSprite[15].drawSprite(channelButtonsX[cButtonHPos], 143 + yOffset);
  283. break;
  284. }
  285. }
  286. int[] modes = { publicChatMode, privateChatMode, clanChatMode, tradeMode };
  287. for (int i = 0; i < modeNamesX.length; i++) {
  288. smallText.method389(true, modeNamesX[i], 0xffffff, modeNames[i], modeNamesY[i] + yOffset);
  289. }
  290. for (int i = 0; i < modeX.length; i++) {
  291. smallText.method382(textColor[modes[i]], modeX[i], text[modes[i]], 164 + yOffset, true);
  292. }
  293. }
  294.  
  295. private boolean chatStateCheck() {
  296. return messagePromptRaised || inputDialogState != 0 || aString844 != null || backDialogID != -1 || dialogID != -1;
  297. }
  298.  
  299. private void drawChatArea() {
  300. int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 165;
  301. if (frameMode == ScreenMode.FIXED) {
  302. aRSImageProducer_1166.initDrawingArea();
  303. }
  304. Texture.anIntArray1472 = anIntArray1180;
  305. if (chatStateCheck()) {
  306. showChatComponents = true;
  307. cacheSprite[17].drawSprite(0, yOffset);
  308. }
  309. if (showChatComponents) {
  310. if (changeChatArea && !chatStateCheck()) {
  311. DrawingArea.drawHorizontalLine(7, 7 + yOffset, 512, changeChatArea ? 0xFFFFFF : 0x807660, changeChatArea ? 120 : 255);
  312. DrawingArea.drawAlphaPixels(7, 7 + yOffset, 512, 135, 0, 20);
  313. } else {
  314. cacheSprite[17].drawSprite(0, yOffset);
  315. }
  316. }
  317. if (!showChatComponents || changeChatArea) {
  318. DrawingArea.drawAlphaPixels(7, frameHeight - 23, 512, 24, 0, 50);
  319. }
  320. drawChannelButtons();
  321. TextDrawingArea textDrawingArea = regularText;
  322. if (messagePromptRaised) {
  323. boldText.drawText(0, aString1121, 60 + yOffset, 259);
  324. boldText.drawText(128, promptInput + "*", 80 + yOffset, 259);
  325. } else if (inputDialogState == 1) {
  326. boldText.drawText(0, "Enter amount:", 60 + yOffset, 259);
  327. boldText.drawText(128, amountOrNameInput + "*", 80 + yOffset, 259);
  328. } else if (inputDialogState == 2) {
  329. boldText.drawText(0, "Enter name:", 60 + yOffset, 259);
  330. boldText.drawText(128, amountOrNameInput + "*", 80 + yOffset, 259);
  331. } else if (aString844 != null) {
  332. boldText.drawText(0, aString844, 60 + yOffset, 259);
  333. boldText.drawText(128, "Click to continue", 80 + yOffset, 259);
  334. } else if (backDialogID != -1) {
  335. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20 + yOffset);
  336. } else if (dialogID != -1) {
  337. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20 + yOffset);
  338. } else if (showChatComponents) {
  339. int j77 = -3;
  340. int j = 0;
  341. DrawingArea.setDrawingArea(122 + yOffset, 8, 497, 7 + yOffset);
  342. for (int k = 0; k < 500; k++) {
  343. if (chatMessages[k] != null) {
  344. int chatType = chatTypes[k];
  345. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  346. String s1 = chatNames[k];
  347. byte byte0 = 0;
  348. if (s1 != null && s1.startsWith("@cr1@")) {
  349. s1 = s1.substring(5);
  350. byte0 = 1;
  351. } else if (s1 != null && s1.startsWith("@cr2@")) {
  352. s1 = s1.substring(5);
  353. byte0 = 2;
  354. } else if (s1 != null && s1.startsWith("@cr3@")) {
  355. s1 = s1.substring(5);
  356. byte0 = 3;
  357. }
  358. if (chatType == 0) {
  359. if (chatTypeView == 5 || chatTypeView == 0) {
  360. textDrawingArea.method389(changeChatArea ? true : false, 11, changeChatArea ? 0xffffff : 0, chatMessages[k], yPos + yOffset);
  361. j++;
  362. j77++;
  363. }
  364. }
  365. if ((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  366. if (chatTypeView == 1 || chatTypeView == 0) {
  367. int xPos = 11;
  368. if (byte0 == 1) {
  369. modIcons[0].drawBackground(xPos + 1, yPos - 12 + yOffset);
  370. xPos += 14;
  371. } else if (byte0 == 2) {
  372. modIcons[1].drawBackground(xPos + 1, yPos - 12 + yOffset);
  373. xPos += 14;
  374. } else if (byte0 == 3) {
  375. modIcons[2].drawBackground(xPos + 1, yPos - 12 + yOffset);
  376. xPos += 14;
  377. }
  378. if (!changeChatArea) {
  379. textDrawingArea.method385(0, s1 + ":", yPos + yOffset, xPos);
  380. } else {
  381. textDrawingArea.drawChatInput(0xffffff, xPos, s1 + ":", yPos + yOffset, true);
  382. }
  383. xPos += textDrawingArea.getTextWidth(s1) + 8;
  384. textDrawingArea.method389(changeChatArea ? true : false, xPos, changeChatArea ? 0x7FA9FF : 255, chatMessages[k], yPos + yOffset);
  385. j++;
  386. j77++;
  387. }
  388. }
  389. if ((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  390. if (chatTypeView == 2 || chatTypeView == 0) {
  391. int k1 = 11;
  392. textDrawingArea.method385(changeChatArea ? 0xFFFFFF : 0, "From", yPos + yOffset, k1);
  393. k1 += textDrawingArea.getTextWidth("From ");
  394. if (byte0 == 1) {
  395. modIcons[0].drawBackground(k1, yPos - 12 + yOffset);
  396. k1 += 12;
  397. } else if (byte0 == 2) {
  398. modIcons[1].drawBackground(k1, yPos - 12 + yOffset);
  399. k1 += 12;
  400. } else if (byte0 == 3) {
  401. modIcons[2].drawBackground(k1, yPos - 12 + yOffset);
  402. k1 += 12;
  403. }
  404. if (!changeChatArea) {
  405. textDrawingArea.method385(0, s1 + ":", yPos + yOffset, k1);
  406. k1 += textDrawingArea.getTextWidth(s1) + 8;
  407. textDrawingArea.method385(0x800080, chatMessages[k], yPos + yOffset, k1);
  408. } else {
  409. textDrawingArea.drawChatInput(0xffffff, k1, s1 + ":", yPos + yOffset, true);
  410. k1 += textDrawingArea.getTextWidth(s1) + 8;
  411. textDrawingArea.drawChatInput(0x800080, k1, chatMessages[k], yPos + yOffset, true);
  412. }
  413. j++;
  414. j77++;
  415. }
  416. }
  417. if (chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  418. if (chatTypeView == 3 || chatTypeView == 0) {
  419. if (!changeChatArea) {
  420. textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], yPos + yOffset, 11);
  421. } else {
  422. textDrawingArea.drawChatInput(0xFF00D4, 11, s1 + " " + chatMessages[k], yPos + yOffset, true);
  423. }
  424. j++;
  425. j77++;
  426. }
  427. }
  428. if (chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  429. if (chatTypeView == 2 || chatTypeView == 0) {
  430. if (!changeChatArea) {
  431. textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], yPos + yOffset, 8);
  432. } else {
  433. textDrawingArea.drawChatInput(0xFF00D4, 8, s1 + " " + chatMessages[k], yPos + yOffset, true);
  434. }
  435. j++;
  436. j77++;
  437. }
  438. }
  439. if (chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  440. if (chatTypeView == 2 || chatTypeView == 0) {
  441. if (!changeChatArea) {
  442. textDrawingArea.method385(0, "To " + s1 + ":", yPos + yOffset, 11);
  443. textDrawingArea.method385(0x800080, chatMessages[k], yPos + yOffset, 15 + textDrawingArea.getTextWidth("To :" + s1));
  444. } else {
  445. textDrawingArea.drawChatInput(0xffffff, 11, "To " + s1 + ":", yPos + yOffset, true);
  446. textDrawingArea.drawChatInput(0xFF00D4, 15 + textDrawingArea.getTextWidth("To :" + s1), chatMessages[k], yPos + yOffset, true);
  447. }
  448. j++;
  449. j77++;
  450. }
  451. }
  452. if (chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  453. if (chatTypeView == 3 || chatTypeView == 0) {
  454. if (!changeChatArea) {
  455. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos + yOffset, 11);
  456. } else {
  457. textDrawingArea.drawChatInput(0x7e3200, 11, s1 + " " + chatMessages[k], yPos + yOffset, true);
  458. }
  459. j++;
  460. j77++;
  461. }
  462. if (chatType == 11 && (clanChatMode == 0)) {
  463. if (chatTypeView == 11) {
  464. if (!changeChatArea) {
  465. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos + yOffset, 11);
  466. } else {
  467. textDrawingArea.drawChatInput(0x7e3200, 11, s1 + " " + chatMessages[k], yPos + yOffset, true);
  468. }
  469. j++;
  470. j77++;
  471. }
  472. if (chatType == 12) {
  473. if (!changeChatArea) {
  474. textDrawingArea.method385(0x7e3200, chatMessages[k] + " @blu@" + s1, yPos + yOffset, 11);
  475. } else {
  476. textDrawingArea.drawChatInput(0x7e3200, 11, chatMessages[k] + " @blu@" + s1, yPos + yOffset, true);
  477. }
  478. j++;
  479. }
  480. }
  481. }
  482.  
  483. if (drawOverChat) {
  484. if (entityBox2 != null) {
  485. entityBox2.drawTransparentSprite(402, 14, 80);
  486. }
  487. }
  488. if (chatType == 16) {
  489. int j2 = 40;
  490. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  491. if (chatTypeView == 11 || chatTypeView == 0) {
  492. switch (chatRights[k]) {
  493. case 1:
  494. j2 += clanNameWidth;
  495. modIcons[0].drawBackground(j2 - 18, yPos - 12 + yOffset);
  496. j2 += 14;
  497. break;
  498.  
  499. case 2:
  500. j2 += clanNameWidth;
  501. modIcons[1].drawBackground(j2 - 18, yPos - 12 + yOffset);
  502. j2 += 14;
  503. break;
  504.  
  505. case 3:
  506. j2 += clanNameWidth;
  507. modIcons[1].drawBackground(j2 - 18, yPos - 12 + yOffset);
  508. j2 += 14;
  509. break;
  510.  
  511. default:
  512. j2 += clanNameWidth;
  513. break;
  514. }
  515. if(!changeChatArea) {
  516. textDrawingArea.method385(0, "[", yPos, 8);
  517. textDrawingArea.method385(255, "" + clanname + "", yPos + yOffset, 14);
  518. textDrawingArea.method385(0, "]", yPos, clanNameWidth + 14);
  519. textDrawingArea.method385(0, chatNames[k] + ":", yPos + yOffset, j2 - 17);
  520. j2 += textDrawingArea.getTextWidth(chatNames[k]) + 7;
  521. textDrawingArea.method385(0x800080, chatMessages[k], yPos + yOffset, j2 - 16);
  522. } else {
  523. textDrawingArea.drawChatInput(0xffffff, 8, "[", yPos, true);
  524. textDrawingArea.drawChatInput(0x7FA9FF, 14, "" + clanname + "", yPos + yOffset, true);
  525. textDrawingArea.drawChatInput(0xffffff, clanNameWidth + 14, "]", yPos, true);
  526. textDrawingArea.drawChatInput(0xffffff, j2 - 17, chatNames[k] + ":", yPos + yOffset, true);
  527. j2 += textDrawingArea.getTextWidth(chatNames[k]) + 7;
  528. textDrawingArea.drawChatInput(0xFF00D4, j2 - 16, chatMessages[k], yPos + yOffset, true);
  529. }
  530. j++;
  531. j77++;
  532. }
  533. }
  534. }
  535. }
  536. DrawingArea.defaultDrawingAreaSize();
  537. anInt1211 = j * 14 + 7 + 5;
  538. if (anInt1211 < 111) {
  539. anInt1211 = 111;
  540. }
  541. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7 + yOffset, 496, anInt1211, changeChatArea);
  542. String s;
  543. if (myPlayer != null && myPlayer.name != null) {
  544. s = myPlayer.name;
  545. } else {
  546. s = TextClass.fixName(myUsername);
  547. }
  548. DrawingArea.setDrawingArea(140 + yOffset, 8, 519, 120 + yOffset);
  549. int xOffset = 0;
  550. if (myPrivilege > 0) {
  551. modIcons[myPrivilege - 1].drawBackground(12, 122 + yOffset);
  552. xOffset += 14;
  553. }
  554. if (!changeChatArea) {
  555. textDrawingArea.method385(0, s + ":", 133 + yOffset, 11 + xOffset);
  556. } else {
  557. textDrawingArea.drawChatInput(0xFFFFFF, 11 + xOffset, s + ":", 133 + yOffset, true);
  558. }
  559. textDrawingArea.drawChatInput(changeChatArea ? 0x7FA9FF : 255, 12 + textDrawingArea.getTextWidth(s + ": ") + xOffset, inputString + "*", 133 + yOffset, changeChatArea ? true : false);
  560. DrawingArea.drawHorizontalLine(7, 121 + yOffset, 520, changeChatArea ? 0xFFFFFF : 0x807660, changeChatArea ? 120 : 255);
  561. DrawingArea.defaultDrawingAreaSize();
  562. }
  563. if (menuOpen) {
  564. drawMenu(0, frameMode == ScreenMode.FIXED ? 338 : 0);
  565. }
  566. if (frameMode == ScreenMode.FIXED) {
  567. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  568. }
  569. aRSImageProducer_1165.initDrawingArea();
  570. Texture.anIntArray1472 = anIntArray1182;
  571. }
  572.  
  573. public void init() {
  574. try {
  575. nodeID = 10;
  576. portOff = 0;
  577. setHighMem();
  578. isMembers = true;
  579. Signlink.storeid = 32;
  580. Signlink.startpriv(InetAddress.getLocalHost());
  581. initClientFrame(503, 765);
  582. instance = this;
  583. } catch (Exception exception) {
  584. return;
  585. }
  586. }
  587.  
  588. public void startRunnable(Runnable runnable, int i) {
  589. if (i > 10)
  590. i = 10;
  591. if (Signlink.mainapp != null) {
  592. Signlink.startthread(runnable, i);
  593. } else {
  594. super.startRunnable(runnable, i);
  595. }
  596. }
  597.  
  598. public Socket openSocket(int port) throws IOException {
  599. return new Socket(InetAddress.getByName(server), port);
  600. }
  601.  
  602. private void processMenuClick() {
  603. if (activeInterfaceType != 0)
  604. return;
  605. int j = super.clickMode3;
  606. if (spellSelected == 1 && super.saveClickX >= 516 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  607. j = 0;
  608. if (menuOpen) {
  609. if (j != 1) {
  610. int k = super.mouseX;
  611. int j1 = super.mouseY;
  612. if (menuScreenArea == 0) {
  613. k -= 4;
  614. j1 -= 4;
  615. }
  616. if (menuScreenArea == 1) {
  617. k -= 519;
  618. j1 -= 168;
  619. }
  620. if (menuScreenArea == 2) {
  621. k -= 17;
  622. j1 -= 338;
  623. }
  624. if (menuScreenArea == 3) {
  625. k -= 519;
  626. j1 -= 0;
  627. }
  628. if (k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  629. menuOpen = false;
  630. if (menuScreenArea == 1) {
  631. }
  632. if (menuScreenArea == 2)
  633. inputTaken = true;
  634. }
  635. }
  636. if (j == 1) {
  637. int l = menuOffsetX;
  638. int k1 = menuOffsetY;
  639. int i2 = menuWidth;
  640. int k2 = super.saveClickX;
  641. int l2 = super.saveClickY;
  642. switch (menuScreenArea) {
  643. case 0:
  644. k2 -= 4;
  645. l2 -= 4;
  646. break;
  647. case 1:
  648. k2 -= 519;
  649. l2 -= 168;
  650. break;
  651. case 2:
  652. k2 -= 5;
  653. l2 -= 338;
  654. break;
  655. case 3:
  656. k2 -= 519;
  657. l2 -= 0;
  658. break;
  659. }
  660. int i3 = -1;
  661. for (int j3 = 0; j3 < menuActionRow; j3++) {
  662. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  663. if (k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  664. i3 = j3;
  665. }
  666. if (i3 != -1)
  667. doAction(i3);
  668. menuOpen = false;
  669. if (menuScreenArea == 1) {
  670. }
  671. if (menuScreenArea == 2) {
  672. inputTaken = true;
  673. }
  674. }
  675. } else {
  676. if (j == 1 && menuActionRow > 0) {
  677. int i1 = menuActionID[menuActionRow - 1];
  678. 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) {
  679. int l1 = menuActionCmd2[menuActionRow - 1];
  680. int j2 = menuActionCmd3[menuActionRow - 1];
  681. RSInterface class9 = RSInterface.interfaceCache[j2];
  682. if (class9.aBoolean259 || class9.aBoolean235) {
  683. aBoolean1242 = false;
  684. anInt989 = 0;
  685. anInt1084 = j2;
  686. anInt1085 = l1;
  687. activeInterfaceType = 2;
  688. anInt1087 = super.saveClickX;
  689. anInt1088 = super.saveClickY;
  690. if (RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  691. activeInterfaceType = 1;
  692. if (RSInterface.interfaceCache[j2].parentID == backDialogID)
  693. activeInterfaceType = 3;
  694. return;
  695. }
  696. }
  697. }
  698. if (j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  699. j = 2;
  700. if (j == 1 && menuActionRow > 0)
  701. doAction(menuActionRow - 1);
  702. if (j == 2 && menuActionRow > 0)
  703. determineMenuSize();
  704. processMainScreenClick();
  705. processTabClick();
  706. processChatModeClick();
  707. minimapHovers();
  708. }
  709. }
  710.  
  711. public static String getFileNameWithoutExtension(String fileName) {
  712. File tmpFile = new File(fileName);
  713. tmpFile.getName();
  714. int whereDot = tmpFile.getName().lastIndexOf('.');
  715. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
  716. return tmpFile.getName().substring(0, whereDot);
  717. }
  718. return "";
  719. }
  720.  
  721. public void preloadModels() {
  722. File file = new File(Signlink.findcachedir() + "Raw/");
  723. File[] fileArray = file.listFiles();
  724. for (int y = 0; y < fileArray.length; y++) {
  725. String s = fileArray[y].getName();
  726. byte[] buffer = ReadFile(Signlink.findcachedir() + "Raw/" + s);
  727. Model.method460(buffer, Integer.parseInt(getFileNameWithoutExtension(s)));
  728. }
  729. }
  730.  
  731. private void saveMidi(boolean flag, byte abyte0[]) {
  732. Signlink.midifade = flag ? 1 : 0;
  733. Signlink.midisave(abyte0, abyte0.length);
  734. }
  735.  
  736. private void method22() {
  737. try {
  738. anInt985 = -1;
  739. aClass19_1056.removeAll();
  740. aClass19_1013.removeAll();
  741. Texture.method366();
  742. unlinkMRUNodes();
  743. worldController.initToNull();
  744. System.gc();
  745. for (int i = 0; i < 4; i++)
  746. aClass11Array1230[i].method210();
  747. for (int l = 0; l < 4; l++) {
  748. for (int k1 = 0; k1 < 104; k1++) {
  749. for (int j2 = 0; j2 < 104; j2++)
  750. byteGroundArray[l][k1][j2] = 0;
  751. }
  752. }
  753.  
  754. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  755. int k2 = aByteArrayArray1183.length;
  756. stream.createFrame(0);
  757. if (!aBoolean1159) {
  758. for (int i3 = 0; i3 < k2; i3++) {
  759. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  760. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  761. byte abyte0[] = aByteArrayArray1183[i3];
  762. if (FileUtility.exists(Signlink.findcachedir() + "maps/" + anIntArray1235[i3] + ".dat"))
  763. abyte0 = FileUtility.read(Signlink.findcachedir() + "maps/" + anIntArray1235[i3] + ".dat");
  764. if (abyte0 != null)
  765. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  766. }
  767. for (int j4 = 0; j4 < k2; j4++) {
  768. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  769. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  770. byte abyte2[] = aByteArrayArray1183[j4];
  771. if (abyte2 == null && anInt1070 < 800)
  772. objectManager.method174(k7, 64, 64, l5);
  773. }
  774. anInt1097++;
  775. if (anInt1097 > 160) {
  776. anInt1097 = 0;
  777. stream.createFrame(238);
  778. stream.writeWordBigEndian(96);
  779. }
  780. stream.createFrame(0);
  781. for (int i6 = 0; i6 < k2; i6++) {
  782. byte abyte1[] = aByteArrayArray1247[i6];
  783. if (abyte1 != null) {
  784. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  785. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  786. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  787. }
  788. }
  789.  
  790. }
  791. if (aBoolean1159) {
  792. for (int j3 = 0; j3 < 4; j3++) {
  793. for (int k4 = 0; k4 < 13; k4++) {
  794. for (int j6 = 0; j6 < 13; j6++) {
  795. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  796. if (l7 != -1) {
  797. int i9 = l7 >> 24 & 3;
  798. int l9 = l7 >> 1 & 3;
  799. int j10 = l7 >> 14 & 0x3ff;
  800. int l10 = l7 >> 3 & 0x7ff;
  801. int j11 = (j10 / 8 << 8) + l10 / 8;
  802. for (int l11 = 0; l11 < anIntArray1234.length; l11++) {
  803. if (anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  804. continue;
  805. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  806. break;
  807. }
  808.  
  809. }
  810. }
  811. }
  812. }
  813. for (int l4 = 0; l4 < 13; l4++) {
  814. for (int k6 = 0; k6 < 13; k6++) {
  815. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  816. if (i8 == -1)
  817. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  818. }
  819. }
  820.  
  821. stream.createFrame(0);
  822. for (int l6 = 0; l6 < 4; l6++) {
  823. for (int j8 = 0; j8 < 13; j8++) {
  824. for (int j9 = 0; j9 < 13; j9++) {
  825. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  826. if (i10 != -1) {
  827. int k10 = i10 >> 24 & 3;
  828. int i11 = i10 >> 1 & 3;
  829. int k11 = i10 >> 14 & 0x3ff;
  830. int i12 = i10 >> 3 & 0x7ff;
  831. int j12 = (k11 / 8 << 8) + i12 / 8;
  832. for (int k12 = 0; k12 < anIntArray1234.length; k12++) {
  833. if (anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  834. continue;
  835. if (FileUtility.exists(Signlink.findcachedir() + "maps/" + anIntArray1235[k12] + ".dat"))
  836. FileUtility.read(Signlink.findcachedir() + "maps/" + anIntArray1235[k12] + ".dat");
  837. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  838. break;
  839. }
  840.  
  841. }
  842. }
  843.  
  844. }
  845.  
  846. }
  847.  
  848. }
  849. stream.createFrame(0);
  850. objectManager.method171(aClass11Array1230, worldController);
  851. aRSImageProducer_1165.initDrawingArea();
  852. stream.createFrame(0);
  853. int k3 = ObjectManager.anInt145;
  854. if (k3 > plane)
  855. k3 = plane;
  856. if (k3 < plane - 1)
  857. k3 = plane - 1;
  858. if (lowMem)
  859. worldController.method275(ObjectManager.anInt145);
  860. else
  861. worldController.method275(0);
  862. for (int i5 = 0; i5 < 104; i5++) {
  863. for (int i7 = 0; i7 < 104; i7++)
  864. spawnGroundItem(i5, i7);
  865.  
  866. }
  867.  
  868. anInt1051++;
  869. if (anInt1051 > 98) {
  870. anInt1051 = 0;
  871. stream.createFrame(150);
  872. }
  873. method63();
  874. } catch (Exception exception) {
  875. }
  876. ObjectDef.mruNodes1.unlinkAll();
  877. if (super.gameFrame != null) {
  878. stream.createFrame(210);
  879. stream.writeDWord(0x3f008edd);
  880. }
  881. if (lowMem && Signlink.cache_dat != null) {
  882. int j = onDemandFetcher.getVersionCount(0);
  883. for (int i1 = 0; i1 < j; i1++) {
  884. int l1 = onDemandFetcher.getModelIndex(i1);
  885. if ((l1 & 0x79) == 0)
  886. Model.method461(i1);
  887. }
  888.  
  889. }
  890. System.gc();
  891. Texture.method367(20);
  892. onDemandFetcher.method566();
  893. int k = (anInt1069 - 6) / 8 - 1;
  894. int j1 = (anInt1069 + 6) / 8 + 1;
  895. int i2 = (anInt1070 - 6) / 8 - 1;
  896. int l2 = (anInt1070 + 6) / 8 + 1;
  897. if (aBoolean1141) {
  898. k = 49;
  899. j1 = 50;
  900. i2 = 49;
  901. l2 = 50;
  902. }
  903. for (int l3 = k; l3 <= j1; l3++) {
  904. for (int j5 = i2; j5 <= l2; j5++)
  905. if (l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  906. int j7 = onDemandFetcher.method562(0, j5, l3);
  907. if (j7 != -1)
  908. onDemandFetcher.method560(j7, 3);
  909. int k8 = onDemandFetcher.method562(1, j5, l3);
  910. if (k8 != -1)
  911. onDemandFetcher.method560(k8, 3);
  912. }
  913.  
  914. }
  915.  
  916. }
  917.  
  918. private void unlinkMRUNodes() {
  919. ObjectDef.mruNodes1.unlinkAll();
  920. ObjectDef.mruNodes2.unlinkAll();
  921. EntityDef.mruNodes.unlinkAll();
  922. ItemDef.mruNodes2.unlinkAll();
  923. ItemDef.mruNodes1.unlinkAll();
  924. Player.mruNodes.unlinkAll();
  925. SpotAnim.aMRUNodes_415.unlinkAll();
  926. }
  927.  
  928. private void method24(int i) {
  929. int ai[] = minimapImage.myPixels;
  930. int j = ai.length;
  931. for (int k = 0; k < j; k++)
  932. ai[k] = 0;
  933.  
  934. for (int l = 1; l < 103; l++) {
  935. int i1 = 24628 + (103 - l) * 512 * 4;
  936. for (int k1 = 1; k1 < 103; k1++) {
  937. if ((byteGroundArray[i][k1][l] & 0x18) == 0)
  938. worldController.method309(ai, i1, i, k1, l);
  939. if (i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  940. worldController.method309(ai, i1, i + 1, k1, l);
  941. i1 += 4;
  942. }
  943.  
  944. }
  945.  
  946. int j1 = Color.WHITE.getRGB();
  947. int l1 = Color.RED.getRGB();
  948. minimapImage.method343();
  949. for (int i2 = 1; i2 < 103; i2++) {
  950. for (int j2 = 1; j2 < 103; j2++) {
  951. if ((byteGroundArray[i][j2][i2] & 0x18) == 0)
  952. method50(i2, j1, j2, l1, i);
  953. if (i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  954. method50(i2, j1, j2, l1, i + 1);
  955. }
  956.  
  957. }
  958.  
  959. aRSImageProducer_1165.initDrawingArea();
  960. anInt1071 = 0;
  961. for (int k2 = 0; k2 < 104; k2++) {
  962. for (int l2 = 0; l2 < 104; l2++) {
  963. int i3 = worldController.method303(plane, k2, l2);
  964. if (i3 != 0) {
  965. i3 = i3 >> 14 & 0x7fff;
  966. int j3 = ObjectDef.forID(i3).anInt746;
  967. if (j3 >= 0) {
  968. int k3 = k2;
  969. int l3 = l2;
  970. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  971. anIntArray1072[anInt1071] = k3;
  972. anIntArray1073[anInt1071] = l3;
  973. anInt1071++;
  974. }
  975. }
  976. }
  977.  
  978. }
  979.  
  980. }
  981.  
  982. private void spawnGroundItem(int i, int j) {
  983. NodeList class19 = groundArray[plane][i][j];
  984. if (class19 == null) {
  985. worldController.method295(plane, i, j);
  986. return;
  987. }
  988. int k = 0xfa0a1f01;
  989. Object obj = null;
  990. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19.reverseGetNext()) {
  991. ItemDef itemDef = ItemDef.forID(item.ID);
  992. int l = itemDef.value;
  993. if (itemDef.stackable)
  994. l *= item.anInt1559 + 1;
  995. // notifyItemSpawn(item, i + baseX, j + baseY);
  996.  
  997. if (l > k) {
  998. k = l;
  999. obj = item;
  1000. }
  1001. }
  1002.  
  1003. class19.insertTail(((Node) (obj)));
  1004. Object obj1 = null;
  1005. Object obj2 = null;
  1006. for (Item class30_sub2_sub4_sub2_1 = (Item) class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item) class19.reverseGetNext()) {
  1007. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  1008. obj1 = class30_sub2_sub4_sub2_1;
  1009. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  1010. obj2 = class30_sub2_sub4_sub2_1;
  1011. }
  1012.  
  1013. int i1 = i + (j << 7) + 0x60000000;
  1014. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1015. }
  1016.  
  1017. private void method26(boolean flag) {
  1018. for (int j = 0; j < npcCount; j++) {
  1019. Npc npc = npcArray[npcIndices[j]];
  1020. int k = 0x20000000 + (npcIndices[j] << 14);
  1021. if (npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1022. continue;
  1023. int l = npc.x >> 7;
  1024. int i1 = npc.y >> 7;
  1025. if (l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1026. continue;
  1027. if (npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64) {
  1028. if (anIntArrayArray929[l][i1] == anInt1265)
  1029. continue;
  1030. anIntArrayArray929[l][i1] = anInt1265;
  1031. }
  1032. if (!npc.desc.aBoolean84)
  1033. k += 0x80000000;
  1034. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  1035. }
  1036. }
  1037.  
  1038. public void drawTooltip(int xPos, int yPos, String text) {
  1039. String[] results = text.split("\n");
  1040. int height = (results.length * 16) + 2;
  1041. int width;
  1042. width = regularText.getTextWidth(results[0]) + 6;
  1043. for (int i = 1; i < results.length; i++) {
  1044. if (width <= regularText.getTextWidth(results[i]) + 6) {
  1045. width = regularText.getTextWidth(results[i]) + 6;
  1046. }
  1047. }
  1048. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  1049. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  1050. yPos += 14;
  1051. for (int i = 0; i < results.length; i++) {
  1052. regularText.method389(false, xPos + 3, 0, results[i], yPos);
  1053. yPos += 16;
  1054. }
  1055. }
  1056.  
  1057. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1) {
  1058. if (class9 == null)
  1059. class9 = RSInterface.interfaceCache[21356];
  1060. if (class9.type != 0 || class9.children == null || class9.isMouseoverTriggered)
  1061. return;
  1062. if (k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1063. return;
  1064. int k1 = class9.children.length;
  1065. for (int l1 = 0; l1 < k1; l1++) {
  1066. int i2 = class9.childX[l1] + i;
  1067. int j2 = (class9.childY[l1] + l) - j1;
  1068. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1069. i2 += class9_1.anInt263;
  1070. j2 += class9_1.anInt265;
  1071. if ((class9_1.hoverType >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1072. if (class9_1.hoverType >= 0)
  1073. anInt886 = class9_1.hoverType;
  1074. else
  1075. anInt886 = class9_1.id;
  1076. if (class9_1.type == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1077. anInt1315 = class9_1.id;
  1078. }
  1079. if (class9_1.type == 0) {
  1080. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1081. if (class9_1.scrollMax > class9_1.height)
  1082. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1083. } else {
  1084. if (class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1085. boolean flag = false;
  1086. if (class9_1.contentType != 0)
  1087. flag = buildFriendsListMenu(class9_1);
  1088. if (!flag) {
  1089. menuActionName[menuActionRow] = class9_1.tooltip;
  1090. menuActionID[menuActionRow] = 315;
  1091. menuActionCmd3[menuActionRow] = class9_1.id;
  1092. menuActionRow++;
  1093. }
  1094. }
  1095. if (class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1096. String s = class9_1.selectedActionName;
  1097. if (s.indexOf(" ") != -1)
  1098. s = s.substring(0, s.indexOf(" "));
  1099. if (class9_1.spellName.endsWith("Rush") || class9_1.spellName.endsWith("Burst") || class9_1.spellName.endsWith("Blitz") || class9_1.spellName.endsWith("Barrage") || class9_1.spellName.endsWith("strike") || class9_1.spellName.endsWith("bolt") || class9_1.spellName.equals("Crumble undead") || class9_1.spellName.endsWith("blast") || class9_1.spellName.endsWith("wave") || class9_1.spellName.equals("Claws of Guthix") || class9_1.spellName.equals("Flames of Zamorak") || class9_1.spellName.equals("Magic Dart")) {
  1100. menuActionName[menuActionRow] = "Autocast @gre@" + class9_1.spellName;
  1101. menuActionID[menuActionRow] = 104;
  1102. menuActionCmd3[menuActionRow] = class9_1.id;
  1103. menuActionRow++;
  1104. }
  1105. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1106. menuActionID[menuActionRow] = 626;
  1107. menuActionCmd3[menuActionRow] = class9_1.id;
  1108. menuActionRow++;
  1109. }
  1110. if (class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1111. menuActionName[menuActionRow] = "Close";
  1112. menuActionID[menuActionRow] = 200;
  1113. menuActionCmd3[menuActionRow] = class9_1.id;
  1114. menuActionRow++;
  1115. }
  1116. if (class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1117. // System.out.println("2"+class9_1.tooltip + ", " +
  1118. // class9_1.interfaceID);
  1119. // menuActionName[menuActionRow] = class9_1.tooltip + ", " +
  1120. // class9_1.id;
  1121. menuActionName[menuActionRow] = class9_1.tooltip;
  1122. menuActionID[menuActionRow] = 169;
  1123. menuActionCmd3[menuActionRow] = class9_1.id;
  1124. menuActionRow++;
  1125. }
  1126. if (class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1127. // System.out.println("3"+class9_1.tooltip + ", " +
  1128. // class9_1.interfaceID);
  1129. // menuActionName[menuActionRow] = class9_1.tooltip + ", " +
  1130. // class9_1.id;
  1131. menuActionName[menuActionRow] = class9_1.tooltip;
  1132. menuActionID[menuActionRow] = 646;
  1133. menuActionCmd3[menuActionRow] = class9_1.id;
  1134. menuActionRow++;
  1135. }
  1136. if (class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1137. // System.out.println("4"+class9_1.tooltip + ", " +
  1138. // class9_1.interfaceID);
  1139. // menuActionName[menuActionRow] = class9_1.tooltip + ", " +
  1140. // class9_1.id;
  1141. menuActionName[menuActionRow] = class9_1.tooltip;
  1142. menuActionID[menuActionRow] = 679;
  1143. menuActionCmd3[menuActionRow] = class9_1.id;
  1144. menuActionRow++;
  1145. }
  1146. if (class9_1.type == 2) {
  1147. int k2 = 0;
  1148. for (int l2 = 0; l2 < class9_1.height; l2++) {
  1149. for (int i3 = 0; i3 < class9_1.width; i3++) {
  1150. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1151. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1152. if (k2 < 20) {
  1153. j3 += class9_1.spritesX[k2];
  1154. k3 += class9_1.spritesY[k2];
  1155. }
  1156. if (k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32) {
  1157. mouseInvInterfaceIndex = k2;
  1158. lastActiveInvInterface = class9_1.id;
  1159. if (class9_1.inv[k2] > 0) {
  1160. ItemDef itemDef = ItemDef.forID(class9_1.inv[k2] - 1);
  1161. if (itemSelected == 1 && class9_1.isInventoryInterface) {
  1162. if (class9_1.id != anInt1284 || k2 != anInt1283) {
  1163. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  1164. menuActionID[menuActionRow] = 870;
  1165. menuActionCmd1[menuActionRow] = itemDef.id;
  1166. menuActionCmd2[menuActionRow] = k2;
  1167. menuActionCmd3[menuActionRow] = class9_1.id;
  1168. menuActionRow++;
  1169. }
  1170. } else if (spellSelected == 1 && class9_1.isInventoryInterface) {
  1171. if ((spellUsableOn & 0x10) == 16) {
  1172. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1173. menuActionID[menuActionRow] = 543;
  1174. menuActionCmd1[menuActionRow] = itemDef.id;
  1175. menuActionCmd2[menuActionRow] = k2;
  1176. menuActionCmd3[menuActionRow] = class9_1.id;
  1177. menuActionRow++;
  1178. }
  1179. } else {
  1180. if (class9_1.isInventoryInterface) {
  1181. for (int l3 = 4; l3 >= 3; l3--)
  1182. if (itemDef.itemActions != null && itemDef.itemActions[l3] != null) {
  1183. menuActionName[menuActionRow] = itemDef.itemActions[l3] + " @lre@" + itemDef.name;
  1184. if (l3 == 3)
  1185. menuActionID[menuActionRow] = 493;
  1186. if (l3 == 4)
  1187. menuActionID[menuActionRow] = 847;
  1188. menuActionCmd1[menuActionRow] = itemDef.id;
  1189. menuActionCmd2[menuActionRow] = k2;
  1190. menuActionCmd3[menuActionRow] = class9_1.id;
  1191. menuActionRow++;
  1192. } else if (l3 == 4) {
  1193. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1194. menuActionID[menuActionRow] = 847;
  1195. menuActionCmd1[menuActionRow] = itemDef.id;
  1196. menuActionCmd2[menuActionRow] = k2;
  1197. menuActionCmd3[menuActionRow] = class9_1.id;
  1198. menuActionRow++;
  1199. }
  1200. }
  1201. if (class9_1.usableItemInterface) {
  1202. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1203. menuActionID[menuActionRow] = 447;
  1204. menuActionCmd1[menuActionRow] = itemDef.id;
  1205. menuActionCmd2[menuActionRow] = k2;
  1206. menuActionCmd3[menuActionRow] = class9_1.id;
  1207. menuActionRow++;
  1208. }
  1209. if (class9_1.isInventoryInterface && itemDef.itemActions != null) {
  1210. for (int i4 = 2; i4 >= 0; i4--)
  1211. if (itemDef.itemActions[i4] != null) {
  1212. menuActionName[menuActionRow] = itemDef.itemActions[i4] + " @lre@" + itemDef.name;
  1213. if (i4 == 0)
  1214. menuActionID[menuActionRow] = 74;
  1215. if (i4 == 1)
  1216. menuActionID[menuActionRow] = 454;
  1217. if (i4 == 2)
  1218. menuActionID[menuActionRow] = 539;
  1219. menuActionCmd1[menuActionRow] = itemDef.id;
  1220. menuActionCmd2[menuActionRow] = k2;
  1221. menuActionCmd3[menuActionRow] = class9_1.id;
  1222. menuActionRow++;
  1223. }
  1224.  
  1225. }
  1226. if (class9_1.actions != null) {
  1227. for (int j4 = 4; j4 >= 0; j4--)
  1228. if (class9_1.actions[j4] != null) {
  1229. menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@" + itemDef.name;
  1230. if (j4 == 0)
  1231. menuActionID[menuActionRow] = 632;
  1232. if (j4 == 1)
  1233. menuActionID[menuActionRow] = 78;
  1234. if (j4 == 2)
  1235. menuActionID[menuActionRow] = 867;
  1236. if (j4 == 3)
  1237. menuActionID[menuActionRow] = 431;
  1238. if (j4 == 4)
  1239. menuActionID[menuActionRow] = 53;
  1240. menuActionCmd1[menuActionRow] = itemDef.id;
  1241. menuActionCmd2[menuActionRow] = k2;
  1242. menuActionCmd3[menuActionRow] = class9_1.id;
  1243. menuActionRow++;
  1244. }
  1245.  
  1246. }
  1247. // menuActionName[menuActionRow] =
  1248. // "Examine @lre@" + itemDef.name +
  1249. // " @gre@(@whi@" + (class9_1.inv[k2] -
  1250. // 1) + "@gre@)";
  1251. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1252. menuActionID[menuActionRow] = 1125;
  1253. menuActionCmd1[menuActionRow] = itemDef.id;
  1254. menuActionCmd2[menuActionRow] = k2;
  1255. menuActionCmd3[menuActionRow] = class9_1.id;
  1256. menuActionRow++;
  1257. }
  1258. }
  1259. }
  1260. k2++;
  1261. }
  1262. }
  1263. }
  1264. }
  1265. }
  1266. }
  1267.  
  1268.  
  1269. public void drawTransparentScrollBar(int x, int y, int height, int maxScroll, int pos) {
  1270. cacheSprite[23].drawARGBSprite(x + 3, y + 3, 50);
  1271. cacheSprite[24].drawARGBSprite(x + 3, y + height - 13, 50);
  1272. DrawingArea.drawVerticalLine(x, y + 16, height - 32, 0xffffff, 30);
  1273. DrawingArea.drawVerticalLine(x + 15, y + 16, height - 32, 0xffffff, 30);
  1274. int barHeight = (height - 32) * height / maxScroll;
  1275. if(barHeight < 10) {
  1276. barHeight = 10;
  1277. }
  1278. int barPos = 0;
  1279. if(maxScroll != height) {
  1280. barPos = (height - 32 - barHeight) * pos / (maxScroll - height);
  1281. }
  1282. DrawingArea.drawAlphaPixels(x, y + 16 + barPos, 16, 5 + y + 16 + barPos + barHeight - 5 - (y + 16 + barPos), 0xffffff, 30);
  1283. }
  1284.  
  1285. public void drawScrollbar(int height, int pos, int y, int x, int maxScroll, boolean transparent) {
  1286. if (transparent) {
  1287. drawTransparentScrollBar(x, y, height, maxScroll, pos);
  1288. } else {
  1289. scrollBar1.drawSprite(x, y);
  1290. scrollBar2.drawSprite(x, (y + height) - 16);
  1291. DrawingArea.drawPixels(height - 32, y + 16, x, 0x000001, 16);
  1292. DrawingArea.drawPixels(height - 32, y + 16, x, 0x3d3426, 15);
  1293. DrawingArea.drawPixels(height - 32, y + 16, x, 0x342d21, 13);
  1294. DrawingArea.drawPixels(height - 32, y + 16, x, 0x2e281d, 11);
  1295. DrawingArea.drawPixels(height - 32, y + 16, x, 0x29241b, 10);
  1296. DrawingArea.drawPixels(height - 32, y + 16, x, 0x252019, 9);
  1297. DrawingArea.drawPixels(height - 32, y + 16, x, 0x000001, 1);
  1298. int k1 = ((height - 32) * height) / maxScroll;
  1299. if (k1 < 8) {
  1300. k1 = 8;
  1301. }
  1302. int l1 = ((height - 32 - k1) * pos) / (maxScroll - height);
  1303. DrawingArea.drawPixels(k1, y + 16 + l1, x, barFillColor, 16);
  1304. DrawingArea.method341(y + 16 + l1, 0x000001, k1, x);
  1305. DrawingArea.method341(y + 16 + l1, 0x817051, k1, x + 1);
  1306. DrawingArea.method341(y + 16 + l1, 0x73654a, k1, x + 2);
  1307. DrawingArea.method341(y + 16 + l1, 0x6a5c43, k1, x + 3);
  1308. DrawingArea.method341(y + 16 + l1, 0x6a5c43, k1, x + 4);
  1309. DrawingArea.method341(y + 16 + l1, 0x655841, k1, x + 5);
  1310. DrawingArea.method341(y + 16 + l1, 0x655841, k1, x + 6);
  1311. DrawingArea.method341(y + 16 + l1, 0x61553e, k1, x + 7);
  1312. DrawingArea.method341(y + 16 + l1, 0x61553e, k1, x + 8);
  1313. DrawingArea.method341(y + 16 + l1, 0x5d513c, k1, x + 9);
  1314. DrawingArea.method341(y + 16 + l1, 0x5d513c, k1, x + 10);
  1315. DrawingArea.method341(y + 16 + l1, 0x594e3a, k1, x + 11);
  1316. DrawingArea.method341(y + 16 + l1, 0x594e3a, k1, x + 12);
  1317. DrawingArea.method341(y + 16 + l1, 0x514635, k1, x + 13);
  1318. DrawingArea.method341(y + 16 + l1, 0x4b4131, k1, x + 14);
  1319. DrawingArea.method339(y + 16 + l1, 0x000001, 15, x);
  1320. DrawingArea.method339(y + 17 + l1, 0x000001, 15, x);
  1321. DrawingArea.method339(y + 17 + l1, 0x655841, 14, x);
  1322. DrawingArea.method339(y + 17 + l1, 0x6a5c43, 13, x);
  1323. DrawingArea.method339(y + 17 + l1, 0x6d5f48, 11, x);
  1324. DrawingArea.method339(y + 17 + l1, 0x73654a, 10, x);
  1325. DrawingArea.method339(y + 17 + l1, 0x76684b, 7, x);
  1326. DrawingArea.method339(y + 17 + l1, 0x7b6a4d, 5, x);
  1327. DrawingArea.method339(y + 17 + l1, 0x7e6e50, 4, x);
  1328. DrawingArea.method339(y + 17 + l1, 0x817051, 3, x);
  1329. DrawingArea.method339(y + 17 + l1, 0x000001, 2, x);
  1330. DrawingArea.method339(y + 18 + l1, 0x000001, 16, x);
  1331. DrawingArea.method339(y + 18 + l1, 0x564b38, 15, x);
  1332. DrawingArea.method339(y + 18 + l1, 0x5d513c, 14, x);
  1333. DrawingArea.method339(y + 18 + l1, 0x625640, 11, x);
  1334. DrawingArea.method339(y + 18 + l1, 0x655841, 10, x);
  1335. DrawingArea.method339(y + 18 + l1, 0x6a5c43, 7, x);
  1336. DrawingArea.method339(y + 18 + l1, 0x6e6046, 5, x);
  1337. DrawingArea.method339(y + 18 + l1, 0x716247, 4, x);
  1338. DrawingArea.method339(y + 18 + l1, 0x7b6a4d, 3, x);
  1339. DrawingArea.method339(y + 18 + l1, 0x817051, 2, x);
  1340. DrawingArea.method339(y + 18 + l1, 0x000001, 1, x);
  1341. DrawingArea.method339(y + 19 + l1, 0x000001, 16, x);
  1342. DrawingArea.method339(y + 19 + l1, 0x514635, 15, x);
  1343. DrawingArea.method339(y + 19 + l1, 0x564b38, 14, x);
  1344. DrawingArea.method339(y + 19 + l1, 0x5d513c, 11, x);
  1345. DrawingArea.method339(y + 19 + l1, 0x61553e, 9, x);
  1346. DrawingArea.method339(y + 19 + l1, 0x655841, 7, x);
  1347. DrawingArea.method339(y + 19 + l1, 0x6a5c43, 5, x);
  1348. DrawingArea.method339(y + 19 + l1, 0x6e6046, 4, x);
  1349. DrawingArea.method339(y + 19 + l1, 0x73654a, 3, x);
  1350. DrawingArea.method339(y + 19 + l1, 0x817051, 2, x);
  1351. DrawingArea.method339(y + 19 + l1, 0x000001, 1, x);
  1352. DrawingArea.method339(y + 20 + l1, 0x000001, 16, x);
  1353. DrawingArea.method339(y + 20 + l1, 0x4b4131, 15, x);
  1354. DrawingArea.method339(y + 20 + l1, 0x544936, 14, x);
  1355. DrawingArea.method339(y + 20 + l1, 0x594e3a, 13, x);
  1356. DrawingArea.method339(y + 20 + l1, 0x5d513c, 10, x);
  1357. DrawingArea.method339(y + 20 + l1, 0x61553e, 8, x);
  1358. DrawingArea.method339(y + 20 + l1, 0x655841, 6, x);
  1359. DrawingArea.method339(y + 20 + l1, 0x6a5c43, 4, x);
  1360. DrawingArea.method339(y + 20 + l1, 0x73654a, 3, x);
  1361. DrawingArea.method339(y + 20 + l1, 0x817051, 2, x);
  1362. DrawingArea.method339(y + 20 + l1, 0x000001, 1, x);
  1363. DrawingArea.method341(y + 16 + l1, 0x000001, k1, x + 15);
  1364. DrawingArea.method339(y + 15 + l1 + k1, 0x000001, 16, x);
  1365. DrawingArea.method339(y + 14 + l1 + k1, 0x000001, 15, x);
  1366. DrawingArea.method339(y + 14 + l1 + k1, 0x3f372a, 14, x);
  1367. DrawingArea.method339(y + 14 + l1 + k1, 0x443c2d, 10, x);
  1368. DrawingArea.method339(y + 14 + l1 + k1, 0x483e2f, 9, x);
  1369. DrawingArea.method339(y + 14 + l1 + k1, 0x4a402f, 7, x);
  1370. DrawingArea.method339(y + 14 + l1 + k1, 0x4b4131, 4, x);
  1371. DrawingArea.method339(y + 14 + l1 + k1, 0x564b38, 3, x);
  1372. DrawingArea.method339(y + 14 + l1 + k1, 0x000001, 2, x);
  1373. DrawingArea.method339(y + 13 + l1 + k1, 0x000001, 16, x);
  1374. DrawingArea.method339(y + 13 + l1 + k1, 0x443c2d, 15, x);
  1375. DrawingArea.method339(y + 13 + l1 + k1, 0x4b4131, 11, x);
  1376. DrawingArea.method339(y + 13 + l1 + k1, 0x514635, 9, x);
  1377. DrawingArea.method339(y + 13 + l1 + k1, 0x544936, 7, x);
  1378. DrawingArea.method339(y + 13 + l1 + k1, 0x564b38, 6, x);
  1379. DrawingArea.method339(y + 13 + l1 + k1, 0x594e3a, 4, x);
  1380. DrawingArea.method339(y + 13 + l1 + k1, 0x625640, 3, x);
  1381. DrawingArea.method339(y + 13 + l1 + k1, 0x6a5c43, 2, x);
  1382. DrawingArea.method339(y + 13 + l1 + k1, 0x000001, 1, x);
  1383. DrawingArea.method339(y + 12 + l1 + k1, 0x000001, 16, x);
  1384. DrawingArea.method339(y + 12 + l1 + k1, 0x443c2d, 15, x);
  1385. DrawingArea.method339(y + 12 + l1 + k1, 0x4b4131, 14, x);
  1386. DrawingArea.method339(y + 12 + l1 + k1, 0x544936, 12, x);
  1387. DrawingArea.method339(y + 12 + l1 + k1, 0x564b38, 11, x);
  1388. DrawingArea.method339(y + 12 + l1 + k1, 0x594e3a, 10, x);
  1389. DrawingArea.method339(y + 12 + l1 + k1, 0x5d513c, 7, x);
  1390. DrawingArea.method339(y + 12 + l1 + k1, 0x61553e, 4, x);
  1391. DrawingArea.method339(y + 12 + l1 + k1, 0x6e6046, 3, x);
  1392. DrawingArea.method339(y + 12 + l1 + k1, 0x7b6a4d, 2, x);
  1393. DrawingArea.method339(y + 12 + l1 + k1, 0x000001, 1, x);
  1394. DrawingArea.method339(y + 11 + l1 + k1, 0x000001, 16, x);
  1395. DrawingArea.method339(y + 11 + l1 + k1, 0x4b4131, 15, x);
  1396. DrawingArea.method339(y + 11 + l1 + k1, 0x514635, 14, x);
  1397. DrawingArea.method339(y + 11 + l1 + k1, 0x564b38, 13, x);
  1398. DrawingArea.method339(y + 11 + l1 + k1, 0x594e3a, 11, x);
  1399. DrawingArea.method339(y + 11 + l1 + k1, 0x5d513c, 9, x);
  1400. DrawingArea.method339(y + 11 + l1 + k1, 0x61553e, 7, x);
  1401. DrawingArea.method339(y + 11 + l1 + k1, 0x655841, 5, x);
  1402. DrawingArea.method339(y + 11 + l1 + k1, 0x6a5c43, 4, x);
  1403. DrawingArea.method339(y + 11 + l1 + k1, 0x73654a, 3, x);
  1404. DrawingArea.method339(y + 11 + l1 + k1, 0x7b6a4d, 2, x);
  1405. DrawingArea.method339(y + 11 + l1 + k1, 0x000001, 1, x);
  1406. }
  1407. }
  1408.  
  1409. private void updateNPCs(Stream stream, int i) {
  1410. anInt839 = 0;
  1411. anInt893 = 0;
  1412. method139(stream);
  1413. method46(i, stream);
  1414. method86(stream);
  1415. for (int k = 0; k < anInt839; k++) {
  1416. int l = anIntArray840[k];
  1417. if (npcArray[l].anInt1537 != loopCycle) {
  1418. npcArray[l].desc = null;
  1419. npcArray[l] = null;
  1420. }
  1421. }
  1422.  
  1423. if (stream.currentOffset != i) {
  1424. Signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1425. throw new RuntimeException("eek");
  1426. }
  1427. for (int i1 = 0; i1 < npcCount; i1++)
  1428. if (npcArray[npcIndices[i1]] == null) {
  1429. Signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1430. throw new RuntimeException("eek");
  1431. }
  1432.  
  1433. }
  1434.  
  1435. private int cButtonHPos;
  1436. private int cButtonCPos;
  1437. private int setChannel;
  1438.  
  1439. public void processChatModeClick() {
  1440. final int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 503;
  1441. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1442. cButtonHPos = 0;
  1443. inputTaken = true;
  1444. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1445. cButtonHPos = 1;
  1446. inputTaken = true;
  1447. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1448. cButtonHPos = 2;
  1449. inputTaken = true;
  1450. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1451. cButtonHPos = 3;
  1452. inputTaken = true;
  1453. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1454. cButtonHPos = 4;
  1455. inputTaken = true;
  1456. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1457. cButtonHPos = 5;
  1458. inputTaken = true;
  1459. } else if(super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= yOffset + 482 && super.mouseY <= yOffset + 503) {
  1460. cButtonHPos = 6;
  1461. inputTaken = true;
  1462. } else {
  1463. cButtonHPos = -1;
  1464. inputTaken = true;
  1465. }
  1466. if(super.clickMode3 == 1) {
  1467. if(super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1468. if (frameMode != ScreenMode.FIXED) {
  1469. if (setChannel != 0) {
  1470. cButtonCPos = 0;
  1471. chatTypeView = 0;
  1472. inputTaken = true;
  1473. setChannel = 0;
  1474. } else {
  1475. showChatComponents = showChatComponents ? false : true;
  1476. }
  1477. } else {
  1478. cButtonCPos = 0;
  1479. chatTypeView = 0;
  1480. inputTaken = true;
  1481. setChannel = 0;
  1482. }
  1483. } else if(super.saveClickX >= 71 && super.saveClickX <= 127 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1484. if (frameMode != ScreenMode.FIXED) {
  1485. if (setChannel != 1 && frameMode != ScreenMode.FIXED) {
  1486. cButtonCPos = 1;
  1487. chatTypeView = 5;
  1488. inputTaken = true;
  1489. setChannel = 1;
  1490. } else {
  1491. showChatComponents = showChatComponents ? false : true;
  1492. }
  1493. } else {
  1494. cButtonCPos = 1;
  1495. chatTypeView = 5;
  1496. inputTaken = true;
  1497. setChannel = 1;
  1498. }
  1499. } else if(super.saveClickX >= 137 && super.saveClickX <= 193 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1500. if (frameMode != ScreenMode.FIXED) {
  1501. if (setChannel != 2 && frameMode != ScreenMode.FIXED) {
  1502. cButtonCPos = 2;
  1503. chatTypeView = 1;
  1504. inputTaken = true;
  1505. setChannel = 2;
  1506. } else {
  1507. showChatComponents = showChatComponents ? false : true;
  1508. }
  1509. } else {
  1510. cButtonCPos = 2;
  1511. chatTypeView = 1;
  1512. inputTaken = true;
  1513. setChannel = 2;
  1514. }
  1515. } else if(super.saveClickX >= 203 && super.saveClickX <= 259 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1516. if (frameMode != ScreenMode.FIXED) {
  1517. if (setChannel != 3 && frameMode != ScreenMode.FIXED) {
  1518. cButtonCPos = 3;
  1519. chatTypeView = 2;
  1520. inputTaken = true;
  1521. setChannel = 3;
  1522. } else {
  1523. showChatComponents = showChatComponents ? false : true;
  1524. }
  1525. } else {
  1526. cButtonCPos = 3;
  1527. chatTypeView = 2;
  1528. inputTaken = true;
  1529. setChannel = 3;
  1530. }
  1531. } else if(super.saveClickX >= 269 && super.saveClickX <= 325 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1532. if (frameMode != ScreenMode.FIXED) {
  1533. if (setChannel != 4 && frameMode != ScreenMode.FIXED) {
  1534. cButtonCPos = 4;
  1535. chatTypeView = 11;
  1536. inputTaken = true;
  1537. setChannel = 4;
  1538. } else {
  1539. showChatComponents = showChatComponents ? false : true;
  1540. }
  1541. } else {
  1542. cButtonCPos = 4;
  1543. chatTypeView = 11;
  1544. inputTaken = true;
  1545. setChannel = 4;
  1546. }
  1547. } else if(super.saveClickX >= 335 && super.saveClickX <= 391 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1548. if (frameMode != ScreenMode.FIXED) {
  1549. if (setChannel != 5 && frameMode != ScreenMode.FIXED) {
  1550. cButtonCPos = 5;
  1551. chatTypeView = 3;
  1552. inputTaken = true;
  1553. setChannel = 5;
  1554. } else {
  1555. showChatComponents = showChatComponents ? false : true;
  1556. }
  1557. } else {
  1558. cButtonCPos = 5;
  1559. chatTypeView = 3;
  1560. inputTaken = true;
  1561. setChannel = 5;
  1562. }
  1563. } else if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= yOffset + 482 && super.saveClickY <= yOffset + 505) {
  1564. if(openInterfaceID == -1) {
  1565. clearTopInterfaces();
  1566. reportAbuseInput = "";
  1567. canMute = false;
  1568. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1569. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600) {
  1570. continue;
  1571. }
  1572. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1573. break;
  1574. }
  1575. } else {
  1576. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1577. }
  1578. }
  1579. }
  1580. }
  1581.  
  1582. private void method33(int i) {
  1583. try {
  1584. int j = Varp.cache[i].anInt709;
  1585. if (j == 0)
  1586. return;
  1587. int k = variousSettings[i];
  1588. if (j == 1) {
  1589. if (k == 1)
  1590. Texture.method372(0.90000000000000002D);
  1591. if (k == 2)
  1592. Texture.method372(0.80000000000000004D);
  1593. if (k == 3)
  1594. Texture.method372(0.69999999999999996D);
  1595. if (k == 4)
  1596. Texture.method372(0.59999999999999998D);
  1597. ItemDef.mruNodes1.unlinkAll();
  1598. welcomeScreenRaised = true;
  1599. }
  1600. if (j == 3) {
  1601. boolean flag1 = musicEnabled;
  1602. if (k == 0) {
  1603. adjustVolume(musicEnabled, 0);
  1604. musicEnabled = true;
  1605. }
  1606. if (k == 1) {
  1607. adjustVolume(musicEnabled, -400);
  1608. musicEnabled = true;
  1609. }
  1610. if (k == 2) {
  1611. adjustVolume(musicEnabled, -800);
  1612. musicEnabled = true;
  1613. }
  1614. if (k == 3) {
  1615. adjustVolume(musicEnabled, -1200);
  1616. musicEnabled = true;
  1617. }
  1618. if (k == 4)
  1619. musicEnabled = false;
  1620. if (musicEnabled != flag1 && !lowMem) {
  1621. if (musicEnabled) {
  1622. nextSong = currentSong;
  1623. songChanging = true;
  1624. onDemandFetcher.method558(2, nextSong);
  1625. } else {
  1626. stopMidi();
  1627. }
  1628. prevSong = 0;
  1629. }
  1630. }
  1631. if (j == 4) {
  1632. if (k == 0) {
  1633. aBoolean848 = true;
  1634. setWaveVolume(0);
  1635. }
  1636. if (k == 1) {
  1637. aBoolean848 = true;
  1638. setWaveVolume(-400);
  1639. }
  1640. if (k == 2) {
  1641. aBoolean848 = true;
  1642. setWaveVolume(-800);
  1643. }
  1644. if (k == 3) {
  1645. aBoolean848 = true;
  1646. setWaveVolume(-1200);
  1647. }
  1648. if (k == 4)
  1649. aBoolean848 = false;
  1650. }
  1651. if (j == 5)
  1652. anInt1253 = k;
  1653. if (j == 6)
  1654. anInt1249 = k;
  1655. if (j == 8) {
  1656. splitPrivateChat = k;
  1657. inputTaken = true;
  1658. }
  1659. if (j == 9)
  1660. anInt913 = k;
  1661. } catch (Exception e) {
  1662. }
  1663. }
  1664.  
  1665. public void updateEntities() {
  1666. try {
  1667. int anInt974 = 0;
  1668. for (int j = -1; j < playerCount + npcCount; j++) {
  1669. Object obj;
  1670. if (j == -1)
  1671. obj = myPlayer;
  1672. else if (j < playerCount)
  1673. obj = playerArray[playerIndices[j]];
  1674. else
  1675. obj = npcArray[npcIndices[j - playerCount]];
  1676. if (obj == null || !((Entity) (obj)).isVisible())
  1677. continue;
  1678. if (obj instanceof Npc) {
  1679. EntityDef entityDef = ((Npc) obj).desc;
  1680. if (entityDef.childrenIDs != null)
  1681. entityDef = entityDef.method161();
  1682. if (entityDef == null)
  1683. continue;
  1684. }
  1685. if (j < playerCount) {
  1686. int l = 30;
  1687. Player player = (Player) obj;
  1688. if (player.headIcon >= 0) {
  1689. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1690. if (spriteDrawX > -1) {
  1691. if (player.skullIcon < 2) {
  1692. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1693. l += 25;
  1694. }
  1695. if (player.headIcon < 13) {
  1696. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1697. l += 18;
  1698. }
  1699. }
  1700. }
  1701. if (j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  1702. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1703. if (spriteDrawX > -1)
  1704. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1705. }
  1706. } else {
  1707. EntityDef entityDef_1 = ((Npc) obj).desc;
  1708. if (entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  1709. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1710. if (spriteDrawX > -1)
  1711. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  1712. }
  1713. if (anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  1714. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1715. if (spriteDrawX > -1)
  1716. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  1717. }
  1718. }
  1719. if (((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player) obj).name))) {
  1720. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  1721. if (spriteDrawX > -1 && anInt974 < anInt975) {
  1722. anIntArray979[anInt974] = boldText.method384(((Entity) (obj)).textSpoken) / 2;
  1723. anIntArray978[anInt974] = boldText.anInt1497;
  1724. anIntArray976[anInt974] = spriteDrawX;
  1725. anIntArray977[anInt974] = spriteDrawY;
  1726. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  1727. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  1728. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  1729. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  1730. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3) {
  1731. anIntArray978[anInt974] += 10;
  1732. anIntArray977[anInt974] += 5;
  1733. }
  1734. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  1735. anIntArray979[anInt974] = 60;
  1736. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  1737. anIntArray978[anInt974] += 5;
  1738. }
  1739. }
  1740. if (((Entity) (obj)).loopCycleStatus > loopCycle) {
  1741. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1742.  
  1743. Entity entity = (Entity) obj;
  1744. if (spriteDrawX >= 0) {
  1745.  
  1746. int spriteWidth = 30;
  1747.  
  1748. if (entity.maxHealth >= 300) {
  1749. spriteWidth = 105;
  1750. }
  1751.  
  1752. int width = (entity.currentHealth * spriteWidth)
  1753. / entity.maxHealth;
  1754.  
  1755. if (width > spriteWidth) {
  1756. width = spriteWidth;
  1757. }
  1758. DrawingArea.drawPixels(5, spriteDrawY - 3,
  1759. spriteDrawX - 15, 65280, width);
  1760. DrawingArea.drawPixels(5, spriteDrawY - 3,
  1761. (spriteDrawX - 15) + width, 0xff0000,
  1762. spriteWidth - width);
  1763.  
  1764. if (myPlayer.npcStatShow != -1) {
  1765. Npc npc = npcArray[myPlayer.npcStatShow];
  1766.  
  1767. if (npc != null && npc.currentHealth > 0) {
  1768. spriteWidth = 105;
  1769.  
  1770. int den = npc.maxHealth == 0 ? 1
  1771. : npc.maxHealth;
  1772.  
  1773. width = (npc.currentHealth * spriteWidth) / den;
  1774.  
  1775. if (width > spriteWidth) {
  1776. width = spriteWidth;
  1777. }
  1778.  
  1779. DrawingArea.fillRect(1, 115, 65, 0, 20);
  1780. DrawingArea.drawPixels(13, 45, 6, 0x009933,
  1781. width);
  1782. DrawingArea.drawPixels(13, 45, 6 + width,
  1783. 0xCC0000, (spriteWidth - width));
  1784.  
  1785. String name = npc.desc.name;
  1786.  
  1787. if (name == null) {
  1788. name = "null";
  1789. }
  1790. if (entityBox != null) {
  1791. entityBox.drawTransparentSprite(0, 20, 50);
  1792. }
  1793. smallText.method389(true, 32,
  1794. 0xFFFFFD, npc.currentHealth + " / "
  1795. + npc.maxHealth, 56);
  1796. smallText.method389(true, 30,
  1797. 0xFFFFFD, name, 35);
  1798. }
  1799. } else if (entity != myPlayer
  1800. && myPlayer.interactingEntity != -1) {
  1801. if (entity instanceof Npc) {
  1802. if (entity.interactingEntity != -1
  1803. && myPlayer.interactingEntity < 32768) {
  1804.  
  1805. int interaction = entity.interactingEntity;
  1806. if (entity.interactingEntity >= 32768)
  1807. interaction -= 32768;
  1808. Npc npc = npcArray[npcIndices[interaction]];
  1809.  
  1810. if (npc == null) {// this gets called for
  1811. // stuff like zulrah and
  1812. // other bosses...
  1813. npc = npcArray[myPlayer.interactingEntity];
  1814. }
  1815. if (npc != null) {
  1816. int npcInteract = npc.interactingEntity;
  1817.  
  1818. if (npcInteract >= 32768) {
  1819. npcInteract -= 32768;
  1820. }
  1821.  
  1822. int myInteract = myPlayer.interactingEntity;
  1823.  
  1824. if (myInteract >= 32768) {
  1825. myInteract -= 32768;
  1826. }
  1827. Npc myNPC = npcArray[myInteract];
  1828. if (myNPC != null
  1829. && myPlayer.interactingEntity != npc.interactingEntity) {
  1830. spriteWidth = 105;
  1831.  
  1832. int den = myNPC.maxHealth == 0 ? 1
  1833. : myNPC.maxHealth;
  1834.  
  1835. width = (myNPC.currentHealth * spriteWidth)
  1836. / den;
  1837.  
  1838. if (width > spriteWidth) {
  1839. width = spriteWidth;
  1840. }
  1841.  
  1842. DrawingArea.fillRect(1, 115, 65, 0,
  1843. 20);
  1844. DrawingArea.drawPixels(13, 45, 6,
  1845. 0x009933, width);
  1846. DrawingArea.drawPixels(13, 45,
  1847. 6 + width, 0xCC0000,
  1848. (spriteWidth - width));
  1849.  
  1850. String name = myNPC.desc.name;
  1851.  
  1852. if (name == null) {
  1853. name = "null";
  1854. }
  1855.  
  1856. if (entityBox != null) {
  1857. entityBox
  1858. .drawTransparentSprite(
  1859. 0, 20, 50);
  1860. }
  1861. smallText.method389(
  1862. true, 32, 0xFFFFFD,
  1863. myNPC.currentHealth + " / "
  1864. + myNPC.maxHealth,
  1865. 56);
  1866. int x = 30;
  1867. if (name.length() > 12) {
  1868. x = 10;
  1869. smallText.method389(true, x,
  1870. 0xFFFFFD, name, 35);
  1871. } else {
  1872. smallText
  1873. .method389(true, x,
  1874. 0xFFFFFD, name,
  1875. 35);
  1876. }
  1877. }
  1878. }
  1879. }
  1880. } else if (entity instanceof Player) {
  1881.  
  1882. int interaction = myPlayer.interactingEntity;
  1883. if (myPlayer.interactingEntity > 32768)
  1884. interaction -= 32768;
  1885. Player player = playerArray[interaction];
  1886. if (player != null
  1887. && myPlayer.interactingEntity != entity.interactingEntity
  1888. && myPlayer.interactingEntity != 0) {
  1889. spriteWidth = 105;
  1890. width = (player.currentHealth * spriteWidth)
  1891. / player.maxHealth;
  1892.  
  1893. if (width > spriteWidth) {
  1894. width = spriteWidth;
  1895. }
  1896. DrawingArea.fillRect(1, 115, 65, 0, 20);
  1897. DrawingArea.drawPixels(13, 45, 6, 0x009933,
  1898. width);
  1899. DrawingArea.drawPixels(13, 45, (6) + width,
  1900. 0xCC0000, (spriteWidth - width));
  1901.  
  1902. if (entityBox != null) {
  1903. entityBox.drawTransparentSprite(0, 20,
  1904. 50);
  1905. }
  1906. //opponent = (Player) entity;
  1907. smallText.method389(true, 32,
  1908. 0xFFFFFD, entity.currentHealth
  1909. + " / " + entity.maxHealth,
  1910. 56);
  1911. smallText.method389(true, 30,
  1912. 0xFFFFFD, player.name, 35);
  1913. smallText.method389(true, 30,
  1914. 0xFFFFFD, myPlayer.name, 77);
  1915.  
  1916. /* Player Stats */
  1917. drawOverChat = true;
  1918.  
  1919. }
  1920. }
  1921. }
  1922. }
  1923. }
  1924. if (!hitmarks554) {
  1925. for (int j1 = 0; j1 < 4; j1++) {
  1926. if (((Entity) (obj)).hitsLoopCycle[j1] > loopCycle) {
  1927. npcScreenPos(((Entity) (obj)),
  1928. ((Entity) (obj)).height / 2);
  1929. if (spriteDrawX > -1) {
  1930. if (j1 == 1)
  1931. spriteDrawY -= 20;
  1932. if (j1 == 2) {
  1933. spriteDrawX -= 15;
  1934. spriteDrawY -= 10;
  1935. }
  1936. if (j1 == 3) {
  1937. spriteDrawX += 15;
  1938. spriteDrawY -= 10;
  1939. }
  1940. hitMarks[((Entity) (obj)).hitMarkTypes[j1]]
  1941. .drawSprite(spriteDrawX - 12,
  1942. spriteDrawY - 12);
  1943. smallText
  1944. .drawText(
  1945. 0,
  1946. String.valueOf(((Entity) (obj)).hitArray[j1]),
  1947. spriteDrawY + 4, spriteDrawX);
  1948. smallText
  1949. .drawText(
  1950. 0xffffff,
  1951. String.valueOf(((Entity) (obj)).hitArray[j1]),
  1952. spriteDrawY + 3,
  1953. spriteDrawX - 1);
  1954. }
  1955. }
  1956. }
  1957. } else {
  1958. for (int j2 = 0; j2 < 4; j2++) {
  1959. if (((Entity) (obj)).hitsLoopCycle[j2] > loopCycle) {
  1960. npcScreenPos(((Entity) (obj)),
  1961. ((Entity) (obj)).height / 2);
  1962. if (spriteDrawX > -1) {
  1963. if (j2 == 0
  1964. && ((Entity) (obj)).hitArray[j2] > 99)
  1965. ((Entity) (obj)).hitMarkTypes[j2] = 3;
  1966. else if (j2 == 1
  1967. && ((Entity) (obj)).hitArray[j2] > 99)
  1968. ((Entity) (obj)).hitMarkTypes[j2] = 3;
  1969. else if (j2 == 2
  1970. && ((Entity) (obj)).hitArray[j2] > 99)
  1971. ((Entity) (obj)).hitMarkTypes[j2] = 3;
  1972. else if (j2 == 3
  1973. && ((Entity) (obj)).hitArray[j2] > 99)
  1974. ((Entity) (obj)).hitMarkTypes[j2] = 3;
  1975. if (j2 == 1) {
  1976. spriteDrawY -= 20;
  1977. }
  1978. if (j2 == 2) {
  1979. spriteDrawX -= (((Entity) (obj)).hitArray[j2] > 99 ? 30
  1980. : 20);
  1981. spriteDrawY -= 10;
  1982. }
  1983. if (j2 == 3) {
  1984. spriteDrawX += (((Entity) (obj)).hitArray[j2] > 99 ? 30
  1985. : 20);
  1986. spriteDrawY -= 10;
  1987. }
  1988. if (((Entity) (obj)).hitMarkTypes[j2] == 3) {
  1989. spriteDrawX -= 8;
  1990. }
  1991. cacheSprite[((Entity) (obj)).hitMarkTypes[j2]]
  1992. .draw24BitSprite(spriteDrawX - 12,
  1993. spriteDrawY - 12);
  1994. smallText
  1995. .drawText(
  1996. 0xffffff,
  1997. String.valueOf(((Entity) (obj)).hitArray[j2]),
  1998. spriteDrawY + 3,
  1999. (((Entity) (obj)).hitMarkTypes[j2] == 3 ? spriteDrawX + 7
  2000. : spriteDrawX - 1));
  2001. }
  2002. }
  2003. }
  2004. }
  2005. }
  2006. for (int k = 0; k < anInt974; k++) {
  2007. int k1 = anIntArray976[k];
  2008. int l1 = anIntArray977[k];
  2009. int j2 = anIntArray979[k];
  2010. int k2 = anIntArray978[k];
  2011. boolean flag = true;
  2012. while (flag) {
  2013. flag = false;
  2014. for (int l2 = 0; l2 < k; l2++)
  2015. 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) {
  2016. l1 = anIntArray977[l2] - anIntArray978[l2];
  2017. flag = true;
  2018. }
  2019.  
  2020. }
  2021. spriteDrawX = anIntArray976[k];
  2022. spriteDrawY = anIntArray977[k] = l1;
  2023. String s = aStringArray983[k];
  2024. if (anInt1249 == 0) {
  2025. int i3 = 0xffff00;
  2026. if (anIntArray980[k] < 6)
  2027. i3 = anIntArray965[anIntArray980[k]];
  2028. if (anIntArray980[k] == 6)
  2029. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  2030. if (anIntArray980[k] == 7)
  2031. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  2032. if (anIntArray980[k] == 8)
  2033. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  2034. if (anIntArray980[k] == 9) {
  2035. int j3 = 150 - anIntArray982[k];
  2036. if (j3 < 50)
  2037. i3 = 0xff0000 + 1280 * j3;
  2038. else if (j3 < 100)
  2039. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  2040. else if (j3 < 150)
  2041. i3 = 65280 + 5 * (j3 - 100);
  2042. }
  2043. if (anIntArray980[k] == 10) {
  2044. int k3 = 150 - anIntArray982[k];
  2045. if (k3 < 50)
  2046. i3 = 0xff0000 + 5 * k3;
  2047. else if (k3 < 100)
  2048. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  2049. else if (k3 < 150)
  2050. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  2051. }
  2052. if (anIntArray980[k] == 11) {
  2053. int l3 = 150 - anIntArray982[k];
  2054. if (l3 < 50)
  2055. i3 = 0xffffff - 0x50005 * l3;
  2056. else if (l3 < 100)
  2057. i3 = 65280 + 0x50005 * (l3 - 50);
  2058. else if (l3 < 150)
  2059. i3 = 0xffffff - 0x50000 * (l3 - 100);
  2060. }
  2061. if (anIntArray981[k] == 0) {
  2062. boldText.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2063. boldText.drawText(i3, s, spriteDrawY, spriteDrawX);
  2064. }
  2065. if (anIntArray981[k] == 1) {
  2066. boldText.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  2067. boldText.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  2068. }
  2069. if (anIntArray981[k] == 2) {
  2070. boldText.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  2071. boldText.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  2072. }
  2073. if (anIntArray981[k] == 3) {
  2074. boldText.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  2075. boldText.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  2076. }
  2077. if (anIntArray981[k] == 4) {
  2078. int i4 = boldText.method384(s);
  2079. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  2080. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  2081. boldText.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  2082. boldText.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  2083. DrawingArea.defaultDrawingAreaSize();
  2084. }
  2085. if (anIntArray981[k] == 5) {
  2086. int j4 = 150 - anIntArray982[k];
  2087. int l4 = 0;
  2088. if (j4 < 25)
  2089. l4 = j4 - 25;
  2090. else if (j4 > 125)
  2091. l4 = j4 - 125;
  2092. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - boldText.anInt1497 - 1);
  2093. boldText.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  2094. boldText.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  2095. DrawingArea.defaultDrawingAreaSize();
  2096. }
  2097. } else {
  2098. boldText.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2099. boldText.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  2100. }
  2101. }
  2102. } catch (Exception e) {
  2103. }
  2104. }
  2105.  
  2106. private void delFriend(long l) {
  2107. try {
  2108. if (l == 0L)
  2109. return;
  2110. for (int i = 0; i < friendsCount; i++) {
  2111. if (friendsListAsLongs[i] != l)
  2112. continue;
  2113. friendsCount--;
  2114. for (int j = i; j < friendsCount; j++) {
  2115. friendsList[j] = friendsList[j + 1];
  2116. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2117. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2118. }
  2119.  
  2120. stream.createFrame(215);
  2121. stream.writeQWord(l);
  2122. break;
  2123. }
  2124. } catch (RuntimeException runtimeexception) {
  2125. Signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  2126. throw new RuntimeException();
  2127. }
  2128. }
  2129.  
  2130. private final int[]
  2131. sideIconsX = { 17, 49, 83, 114, 146, 180, 214, 16, 49, 82, 116, 148, 184, 216 },
  2132. sideIconsY = { 9, 7, 7, 5, 2, 3, 7, 303, 306, 306, 302, 305, 303, 303, 303 },
  2133. sideIconsId = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 },
  2134. sideIconsTab = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 };
  2135.  
  2136. public void drawSideIcons() {
  2137. int xOffset = frameMode == ScreenMode.FIXED ? 0 : frameWidth - 247;
  2138. int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 336;
  2139. if (frameMode == ScreenMode.FIXED || frameMode == ScreenMode.RESIZABLE && !changeTabArea) {
  2140. for (int i = 0; i < sideIconsTab.length; i++) {
  2141. if (tabInterfaceIDs[sideIconsTab[i]] != -1) {
  2142. if (sideIconsId[i] != -1) {
  2143. sideIcons[sideIconsId[i]].drawSprite(sideIconsX[i] + xOffset, sideIconsY[i] + yOffset);
  2144. }
  2145. }
  2146. }
  2147. } else if (changeTabArea && frameWidth < 1000) {
  2148. int[] iconId = { 0, 1, 2, 3, 4, 5, 6, -1, 8, 9, 7, 11, 12, 13 };
  2149. int[] iconX = { 219, 189, 156, 126, 93, 62, 30, 219, 189, 156, 124, 92, 59, 28};
  2150. int[] iconY = { 67, 69, 67, 69, 72, 72, 69, 32, 29, 29, 32, 30, 33, 31, 32 };
  2151. for (int i = 0; i < sideIconsTab.length; i++) {
  2152. if (tabInterfaceIDs[sideIconsTab[i]] != -1) {
  2153. if (iconId[i] != -1) {
  2154. sideIcons[iconId[i]].drawSprite(frameWidth - iconX[i], frameHeight - iconY[i]);
  2155. }
  2156. }
  2157. }
  2158. } else if (changeTabArea && frameWidth >= 1000) {
  2159. int[] iconId = { 0, 1, 2, 3, 4, 5, 6, -1, 8, 9, 7, 11, 12, 13 };
  2160. int[] iconX = { 50, 80, 114, 143, 176, 208, 240, 242, 273, 306, 338, 370, 404, 433};
  2161. int[] iconY = { 30, 32, 30, 32, 34, 34, 32, 32, 29, 29, 32, 31, 32, 32, 32 };
  2162. for (int i = 0; i < sideIconsTab.length; i++) {
  2163. if (tabInterfaceIDs[sideIconsTab[i]] != -1) {
  2164. if (iconId[i] != -1) {
  2165. sideIcons[iconId[i]].drawSprite(frameWidth - 461 + iconX[i], frameHeight - iconY[i]);
  2166. }
  2167. }
  2168. }
  2169. }
  2170. }
  2171.  
  2172. private final int[]
  2173. redStonesX = { 6, 44, 77, 110, 143, 176, 209, 6, 44, 77, 110, 143, 176, 209 },
  2174. redStonesY = { 0, 0, 0, 0, 0, 0, 0, 298, 298, 298, 298, 298, 298, 298 },
  2175. redStonesId = { 25, 29, 29, 29, 29, 29, 26, 27, 29, 29, 29, 29, 29, 28 };
  2176.  
  2177. private void drawRedStones() {
  2178. int xOffset = frameMode == ScreenMode.FIXED ? 0 : frameWidth - 247;
  2179. int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 336;
  2180. if (frameMode == ScreenMode.FIXED || frameMode == ScreenMode.RESIZABLE && !changeTabArea) {
  2181. if (tabInterfaceIDs[tabID] != -1 && tabID != 15) {
  2182. cacheSprite[redStonesId[tabID]].drawSprite(redStonesX[tabID] + xOffset, redStonesY[tabID] + yOffset);
  2183. }
  2184. } else if (changeTabArea && frameWidth < 1000) {
  2185. int[] stoneX = { 226, 194, 162, 130, 99, 65, 34, 219, 195, 161, 130, 98, 65, 33};
  2186. int[] stoneY = { 73, 73, 73, 73, 73, 73, 73, -1, 37, 37, 37, 37, 37, 37, 37 };
  2187. if (tabInterfaceIDs[tabID] != -1 && tabID != 10 && showTabComponents) {
  2188. if (tabID == 7) {
  2189. cacheSprite[29].drawSprite(frameWidth - 130, frameHeight - 37);
  2190. }
  2191. cacheSprite[29].drawSprite(frameWidth - stoneX[tabID], frameHeight - stoneY[tabID]);
  2192. }
  2193. } else if (changeTabArea && frameWidth >= 1000) {
  2194. int[] stoneX = { 417, 385, 353, 321, 289, 256, 224, 129, 193, 161, 130, 98, 65, 33};
  2195. if (tabInterfaceIDs[tabID] != -1 && tabID != 10 && showTabComponents) {
  2196. cacheSprite[29].drawSprite(frameWidth - stoneX[tabID], frameHeight - 37);
  2197. }
  2198. }
  2199. }
  2200.  
  2201. private void drawTabArea() {
  2202. final int xOffset = frameMode == ScreenMode.FIXED ? 0 : frameWidth - 241;
  2203. final int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 336;
  2204. if (frameMode == ScreenMode.FIXED) {
  2205. aRSImageProducer_1163.initDrawingArea();
  2206. }
  2207. Texture.anIntArray1472 = anIntArray1181;
  2208. final int alpha = 200;
  2209. if (frameMode == ScreenMode.FIXED) {
  2210. cacheSprite[18].drawSprite(0, 0);
  2211. } else if (frameMode != ScreenMode.FIXED && !changeTabArea){
  2212. DrawingArea.method335(0x3E3529, frameHeight - 304, 195, 270, transparentTabArea ? alpha : 256, frameWidth - 217);
  2213. cacheSprite[33].drawSprite(xOffset, yOffset);
  2214. } else {
  2215. if (frameWidth >= 1000) {
  2216. if (showTabComponents) {
  2217. DrawingArea.method335(0x3E3529, frameHeight - 304, 197, 265, transparentTabArea ? alpha : 256, frameWidth - 197);
  2218. cacheSprite[35].drawSprite(frameWidth - 204, frameHeight - 311);
  2219. }
  2220. for (int x = frameWidth - 417, y = frameHeight - 37, index = 0; x <= frameWidth - 30 && index < 13; x += 32, index++) {
  2221. cacheSprite[32].drawSprite(x, y);
  2222. }
  2223. } else if (frameWidth < 1000) {
  2224. if (showTabComponents) {
  2225. DrawingArea.method335(0x3E3529, frameHeight - 341, 195, 265, transparentTabArea ? alpha : 256, frameWidth - 197);
  2226. cacheSprite[35].drawSprite(frameWidth - 204, frameHeight - 348);
  2227. }
  2228. for (int x = frameWidth - 226, y = frameHeight - 73, index = 0; x <= frameWidth - 32 && index < 7; x += 32, index++) {
  2229. cacheSprite[32].drawSprite(x, y);
  2230. }
  2231. for (int x = frameWidth - 226, y = frameHeight - 37, index = 0; x <= frameWidth - 32 && index < 7; x += 32, index++) {
  2232. cacheSprite[32].drawSprite(x, y);
  2233. }
  2234. }
  2235. }
  2236. if (invOverlayInterfaceID == -1) {
  2237. drawRedStones();
  2238. drawSideIcons();
  2239. }
  2240. if (showTabComponents) {
  2241. int x = frameMode == ScreenMode.FIXED ? 31 : frameWidth - 215;
  2242. int y = frameMode == ScreenMode.FIXED ? 37 : frameHeight - 299;
  2243. if (changeTabArea) {
  2244. x = frameWidth - 197;
  2245. y = frameWidth >= 1000 ? frameHeight - 303 : frameHeight - 340;
  2246. }
  2247. if (invOverlayInterfaceID != -1) {
  2248. drawInterface(0, x, RSInterface.interfaceCache[invOverlayInterfaceID], y);
  2249. } else if (tabInterfaceIDs[tabID] != -1) {
  2250. drawInterface(0, x, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], y);
  2251. }
  2252. }
  2253. if (menuOpen) {
  2254. drawMenu(frameMode == ScreenMode.FIXED ? 516 : 0, frameMode == ScreenMode.FIXED ? 168 : 0);
  2255. }
  2256. if (frameMode == ScreenMode.FIXED) {
  2257. aRSImageProducer_1163.drawGraphics(168, super.graphics, 516);
  2258. aRSImageProducer_1165.initDrawingArea();
  2259. }
  2260. Texture.anIntArray1472 = anIntArray1182;
  2261. }
  2262.  
  2263. private void method37(int j) {
  2264. if (!lowMem) {
  2265. if (Texture.anIntArray1480[1] >= j) {
  2266. Background background_1 = Texture.aBackgroundArray1474s[1];
  2267. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  2268. int k1 = background_1.anInt1452 * anInt945 * 2;
  2269. byte abyte1[] = background_1.aByteArray1450;
  2270. byte abyte4[] = aByteArray912;
  2271. for (int j2 = 0; j2 <= l; j2++)
  2272. abyte4[j2] = abyte1[j2 - k1 & l];
  2273.  
  2274. background_1.aByteArray1450 = abyte4;
  2275. aByteArray912 = abyte1;
  2276. Texture.method370(1);
  2277. }
  2278. if (Texture.anIntArray1480[17] >= j) {
  2279. Background background = Texture.aBackgroundArray1474s[17];
  2280. int k = background.anInt1452 * background.anInt1453 - 1;
  2281. int j1 = background.anInt1452 * anInt945 * 2;
  2282. byte abyte0[] = background.aByteArray1450;
  2283. byte abyte3[] = aByteArray912;
  2284. for (int i2 = 0; i2 <= k; i2++)
  2285. abyte3[i2] = abyte0[i2 - j1 & k];
  2286.  
  2287. background.aByteArray1450 = abyte3;
  2288. aByteArray912 = abyte0;
  2289. Texture.method370(17);
  2290. anInt854++;
  2291. if (anInt854 > 1235) {
  2292. anInt854 = 0;
  2293. stream.createFrame(226);
  2294. stream.writeWordBigEndian(0);
  2295. int l2 = stream.currentOffset;
  2296. stream.writeWord(58722);
  2297. stream.writeWordBigEndian(240);
  2298. stream.writeWord((int) (Math.random() * 65536D));
  2299. stream.writeWordBigEndian((int) (Math.random() * 256D));
  2300. if ((int) (Math.random() * 2D) == 0)
  2301. stream.writeWord(51825);
  2302. stream.writeWordBigEndian((int) (Math.random() * 256D));
  2303. stream.writeWord((int) (Math.random() * 65536D));
  2304. stream.writeWord(7130);
  2305. stream.writeWord((int) (Math.random() * 65536D));
  2306. stream.writeWord(61657);
  2307. stream.writeBytes(stream.currentOffset - l2);
  2308. }
  2309. }
  2310. if (Texture.anIntArray1480[24] >= j) {
  2311. Background background_1 = Texture.aBackgroundArray1474s[24];
  2312. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  2313. int k1 = background_1.anInt1452 * anInt945 * 2;
  2314. byte abyte1[] = background_1.aByteArray1450;
  2315. byte abyte4[] = aByteArray912;
  2316. for (int j2 = 0; j2 <= l; j2++)
  2317. abyte4[j2] = abyte1[j2 - k1 & l];
  2318.  
  2319. background_1.aByteArray1450 = abyte4;
  2320. aByteArray912 = abyte1;
  2321. Texture.method370(24);
  2322. }
  2323. if (Texture.anIntArray1480[34] >= j) {
  2324. Background background_2 = Texture.aBackgroundArray1474s[34];
  2325. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2326. int l1 = background_2.anInt1452 * anInt945 * 2;
  2327. byte abyte2[] = background_2.aByteArray1450;
  2328. byte abyte5[] = aByteArray912;
  2329. for (int k2 = 0; k2 <= i1; k2++)
  2330. abyte5[k2] = abyte2[k2 - l1 & i1];
  2331.  
  2332. background_2.aByteArray1450 = abyte5;
  2333. aByteArray912 = abyte2;
  2334. Texture.method370(34);
  2335. }
  2336. if (Texture.anIntArray1480[40] >= j) {
  2337. Background background_2 = Texture.aBackgroundArray1474s[40];
  2338. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2339. int l1 = background_2.anInt1452 * anInt945 * 2;
  2340. byte abyte2[] = background_2.aByteArray1450;
  2341. byte abyte5[] = aByteArray912;
  2342. for (int k2 = 0; k2 <= i1; k2++)
  2343. abyte5[k2] = abyte2[k2 - l1 & i1];
  2344.  
  2345. background_2.aByteArray1450 = abyte5;
  2346. aByteArray912 = abyte2;
  2347. Texture.method370(40);
  2348. }
  2349. }
  2350. }
  2351.  
  2352. private void method38() {
  2353. for (int i = -1; i < playerCount; i++) {
  2354. int j;
  2355. if (i == -1)
  2356. j = myPlayerIndex;
  2357. else
  2358. j = playerIndices[i];
  2359. Player player = playerArray[j];
  2360. if (player != null && player.textCycle > 0) {
  2361. player.textCycle--;
  2362. if (player.textCycle == 0)
  2363. player.textSpoken = null;
  2364. }
  2365. }
  2366. for (int k = 0; k < npcCount; k++) {
  2367. int l = npcIndices[k];
  2368. Npc npc = npcArray[l];
  2369. if (npc != null && npc.textCycle > 0) {
  2370. npc.textCycle--;
  2371. if (npc.textCycle == 0)
  2372. npc.textSpoken = null;
  2373. }
  2374. }
  2375. }
  2376.  
  2377. private void calcCameraPos() {
  2378. int i = anInt1098 * 128 + 64;
  2379. int j = anInt1099 * 128 + 64;
  2380. int k = method42(plane, j, i) - anInt1100;
  2381. if (xCameraPos < i) {
  2382. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2383. if (xCameraPos > i)
  2384. xCameraPos = i;
  2385. }
  2386. if (xCameraPos > i) {
  2387. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2388. if (xCameraPos < i)
  2389. xCameraPos = i;
  2390. }
  2391. if (zCameraPos < k) {
  2392. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2393. if (zCameraPos > k)
  2394. zCameraPos = k;
  2395. }
  2396. if (zCameraPos > k) {
  2397. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2398. if (zCameraPos < k)
  2399. zCameraPos = k;
  2400. }
  2401. if (yCameraPos < j) {
  2402. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2403. if (yCameraPos > j)
  2404. yCameraPos = j;
  2405. }
  2406. if (yCameraPos > j) {
  2407. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2408. if (yCameraPos < j)
  2409. yCameraPos = j;
  2410. }
  2411. i = anInt995 * 128 + 64;
  2412. j = anInt996 * 128 + 64;
  2413. k = method42(plane, j, i) - anInt997;
  2414. int l = i - xCameraPos;
  2415. int i1 = k - zCameraPos;
  2416. int j1 = j - yCameraPos;
  2417. int k1 = (int) Math.sqrt(l * l + j1 * j1);
  2418. int l1 = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2419. int i2 = (int) (Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2420. if (l1 < 128)
  2421. l1 = 128;
  2422. if (l1 > 383)
  2423. l1 = 383;
  2424. if (yCameraCurve < l1) {
  2425. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2426. if (yCameraCurve > l1)
  2427. yCameraCurve = l1;
  2428. }
  2429. if (yCameraCurve > l1) {
  2430. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2431. if (yCameraCurve < l1)
  2432. yCameraCurve = l1;
  2433. }
  2434. int j2 = i2 - xCameraCurve;
  2435. if (j2 > 1024)
  2436. j2 -= 2048;
  2437. if (j2 < -1024)
  2438. j2 += 2048;
  2439. if (j2 > 0) {
  2440. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2441. xCameraCurve &= 0x7ff;
  2442. }
  2443. if (j2 < 0) {
  2444. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2445. xCameraCurve &= 0x7ff;
  2446. }
  2447. int k2 = i2 - xCameraCurve;
  2448. if (k2 > 1024)
  2449. k2 -= 2048;
  2450. if (k2 < -1024)
  2451. k2 += 2048;
  2452. if (k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2453. xCameraCurve = i2;
  2454. }
  2455.  
  2456. public void drawMenu(int x, int y) {
  2457. int xPos = menuOffsetX - (x - 4);
  2458. int yPos = (-y + 4) + menuOffsetY;
  2459. int w = menuWidth;
  2460. int h = menuHeight + 1;
  2461. inputTaken = true;
  2462. tabAreaAltered = true;
  2463. int menuColor = 0x5d5447;
  2464. DrawingArea.drawPixels(h, yPos, xPos, menuColor, w);
  2465. DrawingArea.drawPixels(16, yPos + 1, xPos + 1, 0, w - 2);
  2466. DrawingArea.fillPixels(xPos + 1, w - 2, h - 19, 0, yPos + 18);
  2467. boldText.method385(menuColor, "Choose Option", yPos + 14, xPos + 3);
  2468. int mouseX = super.mouseX - (x);
  2469. int mouseY = (-y) + super.mouseY;
  2470. for (int i = 0; i < menuActionRow; i++) {
  2471. int textY = yPos + 31 + (menuActionRow - 1 - i) * 15;
  2472. int textColor = 0xffffff;
  2473. if (mouseX > xPos && mouseX < xPos + w && mouseY > textY - 13 && mouseY < textY + 3) {
  2474. textColor = 0xffff00;
  2475. }
  2476. boldText.method389(true, xPos + 3, textColor, menuActionName[i], textY);
  2477. }
  2478. }
  2479.  
  2480. private void addFriend(long l) {
  2481. try {
  2482. if (l == 0L)
  2483. return;
  2484. if (friendsCount >= 100 && anInt1046 != 1) {
  2485. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2486. return;
  2487. }
  2488. if (friendsCount >= 200) {
  2489. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2490. return;
  2491. }
  2492. String s = TextClass.fixName(TextClass.nameForLong(l));
  2493. for (int i = 0; i < friendsCount; i++)
  2494. if (friendsListAsLongs[i] == l) {
  2495. pushMessage(s + " is already on your friend list", 0, "");
  2496. return;
  2497. }
  2498. for (int j = 0; j < ignoreCount; j++)
  2499. if (ignoreListAsLongs[j] == l) {
  2500. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  2501. return;
  2502. }
  2503.  
  2504. if (s.equals(myPlayer.name)) {
  2505. return;
  2506. } else {
  2507. friendsList[friendsCount] = s;
  2508. friendsListAsLongs[friendsCount] = l;
  2509. friendsNodeIDs[friendsCount] = 0;
  2510. friendsCount++;
  2511. stream.createFrame(188);
  2512. stream.writeQWord(l);
  2513. return;
  2514. }
  2515. } catch (RuntimeException runtimeexception) {
  2516. Signlink.reporterror("15283, " + (byte) 68 + ", " + l + ", " + runtimeexception.toString());
  2517. }
  2518. throw new RuntimeException();
  2519. }
  2520.  
  2521. private int method42(int i, int j, int k) {
  2522. int l = k >> 7;
  2523. int i1 = j >> 7;
  2524. if (l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2525. return 0;
  2526. int j1 = i;
  2527. if (j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2528. j1++;
  2529. int k1 = k & 0x7f;
  2530. int l1 = j & 0x7f;
  2531. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2532. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2533. return i2 * (128 - l1) + j2 * l1 >> 7;
  2534. }
  2535.  
  2536. private static String intToKOrMil(int j) {
  2537. if (j < 0x186a0)
  2538. return String.valueOf(j);
  2539. if (j < 0x989680)
  2540. return j / 1000 + "K";
  2541. else
  2542. return j / 0xf4240 + "M";
  2543. }
  2544.  
  2545. private void resetLogout() {
  2546. try {
  2547. if (socketStream != null)
  2548. socketStream.close();
  2549. } catch (Exception _ex) {
  2550. }
  2551. socketStream = null;
  2552. loggedIn = false;
  2553. loginScreenState = 0;
  2554. //myUsername = "eternal";
  2555. //myPassword = "1";
  2556. unlinkMRUNodes();
  2557. worldController.initToNull();
  2558. for (int i = 0; i < 4; i++)
  2559. aClass11Array1230[i].method210();
  2560. System.gc();
  2561. stopMidi();
  2562. currentSong = -1;
  2563. nextSong = -1;
  2564. prevSong = 0;
  2565. frameMode(ScreenMode.FIXED);
  2566. }
  2567.  
  2568. private void method45() {
  2569. aBoolean1031 = true;
  2570. for (int j = 0; j < 7; j++) {
  2571. anIntArray1065[j] = -1;
  2572. for (int k = 0; k < IdentityKit.length; k++) {
  2573. if (IdentityKit.cache[k].aBoolean662 || IdentityKit.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2574. continue;
  2575. anIntArray1065[j] = k;
  2576. break;
  2577. }
  2578. }
  2579. }
  2580.  
  2581. private void method46(int i, Stream stream) {
  2582. while (stream.bitPosition + 21 < i * 8) {
  2583. int k = stream.readBits(14);
  2584. if (k == 16383)
  2585. break;
  2586. if (npcArray[k] == null)
  2587. npcArray[k] = new Npc();
  2588. Npc npc = npcArray[k];
  2589. npcIndices[npcCount++] = k;
  2590. npc.anInt1537 = loopCycle;
  2591. int l = stream.readBits(5);
  2592. if (l > 15)
  2593. l -= 32;
  2594. int i1 = stream.readBits(5);
  2595. if (i1 > 15)
  2596. i1 -= 32;
  2597. int j1 = stream.readBits(1);
  2598. npc.desc = EntityDef.forID(stream.readBits(14));
  2599. int k1 = stream.readBits(1);
  2600. if (k1 == 1)
  2601. anIntArray894[anInt893++] = k;
  2602. npc.anInt1540 = npc.desc.aByte68;
  2603. npc.anInt1504 = npc.desc.anInt79;
  2604. npc.anInt1554 = npc.desc.walkAnim;
  2605. npc.anInt1555 = npc.desc.anInt58;
  2606. npc.anInt1556 = npc.desc.anInt83;
  2607. npc.anInt1557 = npc.desc.anInt55;
  2608. npc.anInt1511 = npc.desc.standAnim;
  2609. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2610. }
  2611. stream.finishBitAccess();
  2612. }
  2613.  
  2614. public void processGameLoop() {
  2615. if (rsAlreadyLoaded || loadingError || genericLoadingError)
  2616. return;
  2617. loopCycle++;
  2618. if (!loggedIn)
  2619. processLoginScreenInput();
  2620. else
  2621. mainGameProcessor();
  2622. processOnDemandQueue();
  2623. }
  2624.  
  2625. private void method47(boolean flag) {
  2626. if (myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2627. destX = 0;
  2628. int j = playerCount;
  2629. if (flag)
  2630. j = 1;
  2631. for (int l = 0; l < j; l++) {
  2632. Player player;
  2633. int i1;
  2634. if (flag) {
  2635. player = myPlayer;
  2636. i1 = myPlayerIndex << 14;
  2637. } else {
  2638. player = playerArray[playerIndices[l]];
  2639. i1 = playerIndices[l] << 14;
  2640. }
  2641. if (player == null || !player.isVisible())
  2642. continue;
  2643. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  2644. int j1 = player.x >> 7;
  2645. int k1 = player.y >> 7;
  2646. if (j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2647. continue;
  2648. if (player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  2649. player.aBoolean1699 = false;
  2650. player.anInt1709 = method42(plane, player.y, player.x);
  2651. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  2652. continue;
  2653. }
  2654. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2655. if (anIntArrayArray929[j1][k1] == anInt1265)
  2656. continue;
  2657. anIntArrayArray929[j1][k1] = anInt1265;
  2658. }
  2659. player.anInt1709 = method42(plane, player.y, player.x);
  2660. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  2661. }
  2662. }
  2663.  
  2664. private boolean promptUserForInput(RSInterface class9) {
  2665. int j = class9.contentType;
  2666. if (anInt900 == 2) {
  2667. if (j == 201) {
  2668. inputTaken = true;
  2669. inputDialogState = 0;
  2670. messagePromptRaised = true;
  2671. promptInput = "";
  2672. friendsListAction = 1;
  2673. aString1121 = "Enter name of friend to add to list";
  2674. }
  2675. if (j == 202) {
  2676. inputTaken = true;
  2677. inputDialogState = 0;
  2678. messagePromptRaised = true;
  2679. promptInput = "";
  2680. friendsListAction = 2;
  2681. aString1121 = "Enter name of friend to delete from list";
  2682. }
  2683. }
  2684. if (j == 205) {
  2685. anInt1011 = 250;
  2686. return true;
  2687. }
  2688. if (j == 501) {
  2689. inputTaken = true;
  2690. inputDialogState = 0;
  2691. messagePromptRaised = true;
  2692. promptInput = "";
  2693. friendsListAction = 4;
  2694. aString1121 = "Enter name of player to add to list";
  2695. }
  2696. if (j == 502) {
  2697. inputTaken = true;
  2698. inputDialogState = 0;
  2699. messagePromptRaised = true;
  2700. promptInput = "";
  2701. friendsListAction = 5;
  2702. aString1121 = "Enter name of player to delete from list";
  2703. }
  2704. if (j == 550) {
  2705. inputTaken = true;
  2706. inputDialogState = 0;
  2707. messagePromptRaised = true;
  2708. promptInput = "";
  2709. friendsListAction = 6;
  2710. aString1121 = "Enter the name of the chat you wish to join";
  2711. }
  2712. if (j >= 300 && j <= 313) {
  2713. int k = (j - 300) / 2;
  2714. int j1 = j & 1;
  2715. int i2 = anIntArray1065[k];
  2716. if (i2 != -1) {
  2717. do {
  2718. if (j1 == 0 && --i2 < 0)
  2719. i2 = IdentityKit.length - 1;
  2720. if (j1 == 1 && ++i2 >= IdentityKit.length)
  2721. i2 = 0;
  2722. } while (IdentityKit.cache[i2].aBoolean662 || IdentityKit.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2723. anIntArray1065[k] = i2;
  2724. aBoolean1031 = true;
  2725. }
  2726. }
  2727. if (j >= 314 && j <= 323) {
  2728. int l = (j - 314) / 2;
  2729. int k1 = j & 1;
  2730. int j2 = anIntArray990[l];
  2731. if (k1 == 0 && --j2 < 0)
  2732. j2 = anIntArrayArray1003[l].length - 1;
  2733. if (k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2734. j2 = 0;
  2735. anIntArray990[l] = j2;
  2736. aBoolean1031 = true;
  2737. }
  2738. if (j == 324 && !aBoolean1047) {
  2739. aBoolean1047 = true;
  2740. method45();
  2741. }
  2742. if (j == 325 && aBoolean1047) {
  2743. aBoolean1047 = false;
  2744. method45();
  2745. }
  2746. if (j == 326) {
  2747. stream.createFrame(101);
  2748. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2749. for (int i1 = 0; i1 < 7; i1++)
  2750. stream.writeWordBigEndian(anIntArray1065[i1]);
  2751.  
  2752. for (int l1 = 0; l1 < 5; l1++)
  2753. stream.writeWordBigEndian(anIntArray990[l1]);
  2754.  
  2755. return true;
  2756. }
  2757. if (j == 613)
  2758. canMute = !canMute;
  2759. if (j >= 601 && j <= 612) {
  2760. clearTopInterfaces();
  2761. if (reportAbuseInput.length() > 0) {
  2762. stream.createFrame(218);
  2763. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2764. stream.writeWordBigEndian(j - 601);
  2765. stream.writeWordBigEndian(canMute ? 1 : 0);
  2766. }
  2767. }
  2768. return false;
  2769. }
  2770.  
  2771. private void method49(Stream stream) {
  2772. for (int j = 0; j < anInt893; j++) {
  2773. int k = anIntArray894[j];
  2774. Player player = playerArray[k];
  2775. int l = stream.readUnsignedByte();
  2776. if ((l & 0x40) != 0)
  2777. l += stream.readUnsignedByte() << 8;
  2778. method107(l, k, stream, player);
  2779. }
  2780. }
  2781.  
  2782. private void method50(int i, int k, int l, int i1, int j1) {
  2783. int k1 = worldController.method300(j1, l, i);
  2784. if (k1 != 0) {
  2785. int l1 = worldController.method304(j1, l, i, k1);
  2786. int k2 = l1 >> 6 & 3;
  2787. int i3 = l1 & 0x1f;
  2788. int k3 = k;
  2789. if (k1 > 0)
  2790. k3 = i1;
  2791. int ai[] = minimapImage.myPixels;
  2792. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2793. int i5 = k1 >> 14 & 0x7fff;
  2794. ObjectDef class46_2 = ObjectDef.forID(i5);
  2795. if (class46_2.anInt758 != -1) {
  2796. Background background_2 = mapScenes[class46_2.anInt758];
  2797. if (background_2 != null) {
  2798. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  2799. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  2800. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  2801. }
  2802. } else {
  2803. if (i3 == 0 || i3 == 2)
  2804. if (k2 == 0) {
  2805. ai[k4] = k3;
  2806. ai[k4 + 512] = k3;
  2807. ai[k4 + 1024] = k3;
  2808. ai[k4 + 1536] = k3;
  2809. } else if (k2 == 1) {
  2810. ai[k4] = k3;
  2811. ai[k4 + 1] = k3;
  2812. ai[k4 + 2] = k3;
  2813. ai[k4 + 3] = k3;
  2814. } else if (k2 == 2) {
  2815. ai[k4 + 3] = k3;
  2816. ai[k4 + 3 + 512] = k3;
  2817. ai[k4 + 3 + 1024] = k3;
  2818. ai[k4 + 3 + 1536] = k3;
  2819. } else if (k2 == 3) {
  2820. ai[k4 + 1536] = k3;
  2821. ai[k4 + 1536 + 1] = k3;
  2822. ai[k4 + 1536 + 2] = k3;
  2823. ai[k4 + 1536 + 3] = k3;
  2824. }
  2825. if (i3 == 3)
  2826. if (k2 == 0)
  2827. ai[k4] = k3;
  2828. else if (k2 == 1)
  2829. ai[k4 + 3] = k3;
  2830. else if (k2 == 2)
  2831. ai[k4 + 3 + 1536] = k3;
  2832. else if (k2 == 3)
  2833. ai[k4 + 1536] = k3;
  2834. if (i3 == 2)
  2835. if (k2 == 3) {
  2836. ai[k4] = k3;
  2837. ai[k4 + 512] = k3;
  2838. ai[k4 + 1024] = k3;
  2839. ai[k4 + 1536] = k3;
  2840. } else if (k2 == 0) {
  2841. ai[k4] = k3;
  2842. ai[k4 + 1] = k3;
  2843. ai[k4 + 2] = k3;
  2844. ai[k4 + 3] = k3;
  2845. } else if (k2 == 1) {
  2846. ai[k4 + 3] = k3;
  2847. ai[k4 + 3 + 512] = k3;
  2848. ai[k4 + 3 + 1024] = k3;
  2849. ai[k4 + 3 + 1536] = k3;
  2850. } else if (k2 == 2) {
  2851. ai[k4 + 1536] = k3;
  2852. ai[k4 + 1536 + 1] = k3;
  2853. ai[k4 + 1536 + 2] = k3;
  2854. ai[k4 + 1536 + 3] = k3;
  2855. }
  2856. }
  2857. }
  2858. k1 = worldController.method302(j1, l, i);
  2859. if (k1 != 0) {
  2860. int i2 = worldController.method304(j1, l, i, k1);
  2861. int l2 = i2 >> 6 & 3;
  2862. int j3 = i2 & 0x1f;
  2863. int l3 = k1 >> 14 & 0x7fff;
  2864. ObjectDef class46_1 = ObjectDef.forID(l3);
  2865. if (class46_1.anInt758 != -1) {
  2866. Background background_1 = mapScenes[class46_1.anInt758];
  2867. if (background_1 != null) {
  2868. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  2869. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  2870. background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  2871. }
  2872. } else if (j3 == 9) {
  2873. int l4 = 0xeeeeee;
  2874. if (k1 > 0)
  2875. l4 = 0xee0000;
  2876. int ai1[] = minimapImage.myPixels;
  2877. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2878. if (l2 == 0 || l2 == 2) {
  2879. ai1[l5 + 1536] = l4;
  2880. ai1[l5 + 1024 + 1] = l4;
  2881. ai1[l5 + 512 + 2] = l4;
  2882. ai1[l5 + 3] = l4;
  2883. } else {
  2884. ai1[l5] = l4;
  2885. ai1[l5 + 512 + 1] = l4;
  2886. ai1[l5 + 1024 + 2] = l4;
  2887. ai1[l5 + 1536 + 3] = l4;
  2888. }
  2889. }
  2890. }
  2891. k1 = worldController.method303(j1, l, i);
  2892. if (k1 != 0) {
  2893. int j2 = k1 >> 14 & 0x7fff;
  2894. ObjectDef class46 = ObjectDef.forID(j2);
  2895. if (class46.anInt758 != -1) {
  2896. Background background = mapScenes[class46.anInt758];
  2897. if (background != null) {
  2898. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  2899. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  2900. background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  2901. }
  2902. }
  2903. }
  2904. }
  2905.  
  2906. private void loadTitleScreen() {
  2907. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  2908. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  2909. aBackgroundArray1152s = new Background[12];
  2910. int j = 0;
  2911. try {
  2912. j = Integer.parseInt(getParameter("fl_icon"));
  2913. } catch (Exception _ex) {
  2914. }
  2915. if (j == 0) {
  2916. for (int k = 0; k < 12; k++)
  2917. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  2918.  
  2919. } else {
  2920. for (int l = 0; l < 12; l++)
  2921. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  2922.  
  2923. }
  2924. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  2925. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  2926. System.arraycopy(aRSImageProducer_1110.canvasRaster, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  2927.  
  2928. System.arraycopy(aRSImageProducer_1111.canvasRaster, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  2929.  
  2930. anIntArray851 = new int[256];
  2931. for (int k1 = 0; k1 < 64; k1++)
  2932. anIntArray851[k1] = k1 * 0x40000;
  2933.  
  2934. for (int l1 = 0; l1 < 64; l1++)
  2935. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  2936.  
  2937. for (int i2 = 0; i2 < 64; i2++)
  2938. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  2939.  
  2940. for (int j2 = 0; j2 < 64; j2++)
  2941. anIntArray851[j2 + 192] = 0xffffff;
  2942.  
  2943. anIntArray852 = new int[256];
  2944. for (int k2 = 0; k2 < 64; k2++)
  2945. anIntArray852[k2] = k2 * 1024;
  2946.  
  2947. for (int l2 = 0; l2 < 64; l2++)
  2948. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  2949.  
  2950. for (int i3 = 0; i3 < 64; i3++)
  2951. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  2952.  
  2953. for (int j3 = 0; j3 < 64; j3++)
  2954. anIntArray852[j3 + 192] = 0xffffff;
  2955.  
  2956. anIntArray853 = new int[256];
  2957. for (int k3 = 0; k3 < 64; k3++)
  2958. anIntArray853[k3] = k3 * 4;
  2959.  
  2960. for (int l3 = 0; l3 < 64; l3++)
  2961. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  2962.  
  2963. for (int i4 = 0; i4 < 64; i4++)
  2964. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  2965.  
  2966. for (int j4 = 0; j4 < 64; j4++)
  2967. anIntArray853[j4 + 192] = 0xffffff;
  2968.  
  2969. anIntArray850 = new int[256];
  2970. anIntArray1190 = new int[32768];
  2971. anIntArray1191 = new int[32768];
  2972. randomizeBackground(null);
  2973. anIntArray828 = new int[32768];
  2974. anIntArray829 = new int[32768];
  2975. drawLoadingText(10, "Connecting to fileserver");
  2976. if (!aBoolean831) {
  2977. drawFlames = true;
  2978. aBoolean831 = true;
  2979. startRunnable(this, 2);
  2980. }
  2981. }
  2982.  
  2983. private static void setHighMem() {
  2984. WorldController.lowMem = false;
  2985. Texture.lowMem = false;
  2986. lowMem = false;
  2987. ObjectManager.lowMem = false;
  2988. ObjectDef.lowMem = false;
  2989. }
  2990.  
  2991. public static void main(String args[]) {
  2992. try {
  2993. nodeID = 10;
  2994. portOff = 0;
  2995. setHighMem();
  2996. isMembers = true;
  2997. Signlink.storeid = 32;
  2998. Signlink.startpriv(InetAddress.getLocalHost());
  2999. frameMode(ScreenMode.FIXED);
  3000. instance = new Jframe(args);
  3001. } catch (Exception e) {
  3002. e.printStackTrace();
  3003. }
  3004. }
  3005.  
  3006. public static Client instance;
  3007.  
  3008. private void loadingStages() {
  3009. if (lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  3010. aRSImageProducer_1165.initDrawingArea();
  3011. fancyText.drawChatInput(0xffffff, 5, "Loading - please wait.", 15, true);
  3012. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  3013. loadingStage = 1;
  3014. aLong824 = System.currentTimeMillis();
  3015. }
  3016. if (loadingStage == 1) {
  3017. int j = method54();
  3018. if (j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  3019. Signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  3020. aLong824 = System.currentTimeMillis();
  3021. }
  3022. }
  3023. if (loadingStage == 2 && plane != anInt985) {
  3024. anInt985 = plane;
  3025. method24(plane);
  3026. }
  3027. }
  3028.  
  3029. private int method54() {
  3030. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3031. if (aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  3032. return -1;
  3033. if (aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  3034. return -2;
  3035. }
  3036. boolean flag = true;
  3037. for (int j = 0; j < aByteArrayArray1183.length; j++) {
  3038. byte abyte0[] = aByteArrayArray1247[j];
  3039. if (abyte0 != null) {
  3040. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3041. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3042. if (aBoolean1159) {
  3043. k = 10;
  3044. l = 10;
  3045. }
  3046. flag &= ObjectManager.method189(k, abyte0, l);
  3047. }
  3048. }
  3049. if (!flag)
  3050. return -3;
  3051. if (aBoolean1080) {
  3052. return -4;
  3053. } else {
  3054. loadingStage = 2;
  3055. ObjectManager.anInt131 = plane;
  3056. method22();
  3057. stream.createFrame(121);
  3058. return 0;
  3059. }
  3060. }
  3061.  
  3062. private void method55() {
  3063. 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())
  3064. if (class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3065. class30_sub2_sub4_sub4.unlink();
  3066. else if (loopCycle >= class30_sub2_sub4_sub4.anInt1571) {
  3067. if (class30_sub2_sub4_sub4.anInt1590 > 0) {
  3068. Npc npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3069. if (npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  3070. 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);
  3071. }
  3072. if (class30_sub2_sub4_sub4.anInt1590 < 0) {
  3073. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3074. Player player;
  3075. if (j == unknownInt10)
  3076. player = myPlayer;
  3077. else
  3078. player = playerArray[j];
  3079. if (player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  3080. 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);
  3081. }
  3082. class30_sub2_sub4_sub4.method456(anInt945);
  3083. 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);
  3084. }
  3085.  
  3086. }
  3087.  
  3088. public AppletContext getAppletContext() {
  3089. if (Signlink.mainapp != null)
  3090. return Signlink.mainapp.getAppletContext();
  3091. else
  3092. return super.getAppletContext();
  3093. }
  3094.  
  3095. private void drawLogo() {
  3096. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  3097. Sprite sprite = new Sprite(abyte0, this);
  3098. aRSImageProducer_1110.initDrawingArea();
  3099. sprite.method346(0, 0);
  3100. aRSImageProducer_1111.initDrawingArea();
  3101. sprite.method346(-637, 0);
  3102. aRSImageProducer_1107.initDrawingArea();
  3103. sprite.method346(-128, 0);
  3104. aRSImageProducer_1108.initDrawingArea();
  3105. sprite.method346(-202, -371);
  3106. aRSImageProducer_1109.initDrawingArea();
  3107. sprite.method346(-202, -171);
  3108. aRSImageProducer_1112.initDrawingArea();
  3109. sprite.method346(0, -265);
  3110. aRSImageProducer_1113.initDrawingArea();
  3111. sprite.method346(-562, -265);
  3112. aRSImageProducer_1114.initDrawingArea();
  3113. sprite.method346(-128, -171);
  3114. aRSImageProducer_1115.initDrawingArea();
  3115. sprite.method346(-562, -171);
  3116. worldSelection.initDrawingArea();
  3117. sprite.method346(0, -400);
  3118. int ai[] = new int[sprite.myWidth];
  3119. for (int j = 0; j < sprite.myHeight; j++) {
  3120. for (int k = 0; k < sprite.myWidth; k++)
  3121. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  3122.  
  3123. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  3124. }
  3125. aRSImageProducer_1110.initDrawingArea();
  3126. sprite.method346(382, 0);
  3127. aRSImageProducer_1111.initDrawingArea();
  3128. sprite.method346(-255, 0);
  3129. aRSImageProducer_1107.initDrawingArea();
  3130. sprite.method346(254, 0);
  3131. aRSImageProducer_1108.initDrawingArea();
  3132. sprite.method346(180, -371);
  3133. aRSImageProducer_1109.initDrawingArea();
  3134. sprite.method346(180, -171);
  3135. aRSImageProducer_1112.initDrawingArea();
  3136. sprite.method346(382, -265);
  3137. aRSImageProducer_1113.initDrawingArea();
  3138. sprite.method346(-180, -265);
  3139. aRSImageProducer_1114.initDrawingArea();
  3140. sprite.method346(254, -171);
  3141. aRSImageProducer_1115.initDrawingArea();
  3142. sprite.method346(-180, -171);
  3143. sprite = new Sprite(titleStreamLoader, "logo", 0);
  3144. aRSImageProducer_1107.initDrawingArea();
  3145. sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  3146. sprite = null;
  3147. System.gc();
  3148. }
  3149.  
  3150. private void processOnDemandQueue() {
  3151. do {
  3152. OnDemandData onDemandData;
  3153. do {
  3154. onDemandData = onDemandFetcher.getNextNode();
  3155. if (onDemandData == null)
  3156. return;
  3157. if (onDemandData.dataType == 0) {
  3158. Model.method460(onDemandData.buffer, onDemandData.ID);
  3159. if (backDialogID != -1)
  3160. inputTaken = true;
  3161. }
  3162. if (onDemandData.dataType == 1) {
  3163. Class36.load(onDemandData.ID, onDemandData.buffer);
  3164. }
  3165. if (onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  3166. saveMidi(songChanging, onDemandData.buffer);
  3167. if (onDemandData.dataType == 3 && loadingStage == 1) {
  3168. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3169. if (anIntArray1235[i] == onDemandData.ID) {
  3170. aByteArrayArray1183[i] = onDemandData.buffer;
  3171. if (onDemandData.buffer == null)
  3172. anIntArray1235[i] = -1;
  3173. break;
  3174. }
  3175. if (anIntArray1236[i] != onDemandData.ID)
  3176. continue;
  3177. aByteArrayArray1247[i] = onDemandData.buffer;
  3178. if (onDemandData.buffer == null)
  3179. anIntArray1236[i] = -1;
  3180. break;
  3181. }
  3182.  
  3183. }
  3184. } while (onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  3185. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  3186. } while (true);
  3187. }
  3188.  
  3189. private void calcFlamesPosition() {
  3190. char c = '\u0100';
  3191. for (int j = 10; j < 117; j++) {
  3192. int k = (int) (Math.random() * 100D);
  3193. if (k < 50)
  3194. anIntArray828[j + (c - 2 << 7)] = 255;
  3195. }
  3196. for (int l = 0; l < 100; l++) {
  3197. int i1 = (int) (Math.random() * 124D) + 2;
  3198. int k1 = (int) (Math.random() * 128D) + 128;
  3199. int k2 = i1 + (k1 << 7);
  3200. anIntArray828[k2] = 192;
  3201. }
  3202.  
  3203. for (int j1 = 1; j1 < c - 1; j1++) {
  3204. for (int l1 = 1; l1 < 127; l1++) {
  3205. int l2 = l1 + (j1 << 7);
  3206. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  3207. }
  3208.  
  3209. }
  3210.  
  3211. anInt1275 += 128;
  3212. if (anInt1275 > anIntArray1190.length) {
  3213. anInt1275 -= anIntArray1190.length;
  3214. int i2 = (int) (Math.random() * 12D);
  3215. randomizeBackground(aBackgroundArray1152s[i2]);
  3216. }
  3217. for (int j2 = 1; j2 < c - 1; j2++) {
  3218. for (int i3 = 1; i3 < 127; i3++) {
  3219. int k3 = i3 + (j2 << 7);
  3220. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  3221. if (i4 < 0)
  3222. i4 = 0;
  3223. anIntArray828[k3] = i4;
  3224. }
  3225.  
  3226. }
  3227.  
  3228. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  3229.  
  3230. anIntArray969[c - 1] = (int) (Math.sin((double) loopCycle / 14D) * 16D + Math.sin((double) loopCycle / 15D) * 14D + Math.sin((double) loopCycle / 16D) * 12D);
  3231. if (anInt1040 > 0)
  3232. anInt1040 -= 4;
  3233. if (anInt1041 > 0)
  3234. anInt1041 -= 4;
  3235. if (anInt1040 == 0 && anInt1041 == 0) {
  3236. int l3 = (int) (Math.random() * 2000D);
  3237. if (l3 == 0)
  3238. anInt1040 = 1024;
  3239. if (l3 == 1)
  3240. anInt1041 = 1024;
  3241. }
  3242. }
  3243.  
  3244. private void method60(int i) {
  3245. RSInterface class9 = RSInterface.interfaceCache[i];
  3246. for (int j = 0; j < class9.children.length; j++) {
  3247. if (class9.children[j] == -1)
  3248. break;
  3249. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  3250. if (class9_1.type == 1)
  3251. method60(class9_1.id);
  3252. class9_1.anInt246 = 0;
  3253. class9_1.anInt208 = 0;
  3254. }
  3255. }
  3256.  
  3257. private void drawHeadIcon() {
  3258. if (anInt855 != 2)
  3259. return;
  3260. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  3261. if (spriteDrawX > -1 && loopCycle % 20 < 10)
  3262. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3263. }
  3264.  
  3265. private void mainGameProcessor() {
  3266. refreshFrameSize();
  3267. if (anInt1104 > 1)
  3268. anInt1104--;
  3269. if (anInt1011 > 0)
  3270. anInt1011--;
  3271. for (int j = 0; j < 5; j++)
  3272. if (!parsePacket())
  3273. break;
  3274.  
  3275. if (!loggedIn)
  3276. return;
  3277. synchronized (mouseDetection.syncObject) {
  3278. if (flagged) {
  3279. if (super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40) {
  3280. stream.createFrame(45);
  3281. stream.writeWordBigEndian(0);
  3282. int j2 = stream.currentOffset;
  3283. int j3 = 0;
  3284. for (int j4 = 0; j4 < mouseDetection.coordsIndex; j4++) {
  3285. if (j2 - stream.currentOffset >= 240)
  3286. break;
  3287. j3++;
  3288. int l4 = mouseDetection.coordsY[j4];
  3289. if (l4 < 0)
  3290. l4 = 0;
  3291. else if (l4 > 502)
  3292. l4 = 502;
  3293. int k5 = mouseDetection.coordsX[j4];
  3294. if (k5 < 0)
  3295. k5 = 0;
  3296. else if (k5 > 764)
  3297. k5 = 764;
  3298. int i6 = l4 * 765 + k5;
  3299. if (mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1) {
  3300. k5 = -1;
  3301. l4 = -1;
  3302. i6 = 0x7ffff;
  3303. }
  3304. if (k5 == anInt1237 && l4 == anInt1238) {
  3305. if (anInt1022 < 2047)
  3306. anInt1022++;
  3307. } else {
  3308. int j6 = k5 - anInt1237;
  3309. anInt1237 = k5;
  3310. int k6 = l4 - anInt1238;
  3311. anInt1238 = l4;
  3312. if (anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31) {
  3313. j6 += 32;
  3314. k6 += 32;
  3315. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  3316. anInt1022 = 0;
  3317. } else if (anInt1022 < 8) {
  3318. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  3319. anInt1022 = 0;
  3320. } else {
  3321. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  3322. anInt1022 = 0;
  3323. }
  3324. }
  3325. }
  3326.  
  3327. stream.writeBytes(stream.currentOffset - j2);
  3328. if (j3 >= mouseDetection.coordsIndex) {
  3329. mouseDetection.coordsIndex = 0;
  3330. } else {
  3331. mouseDetection.coordsIndex -= j3;
  3332. for (int i5 = 0; i5 < mouseDetection.coordsIndex; i5++) {
  3333. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  3334. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  3335. }
  3336.  
  3337. }
  3338. }
  3339. } else {
  3340. mouseDetection.coordsIndex = 0;
  3341. }
  3342. }
  3343. if (super.clickMode3 != 0) {
  3344. long l = (super.aLong29 - aLong1220) / 50L;
  3345. if (l > 4095L)
  3346. l = 4095L;
  3347. aLong1220 = super.aLong29;
  3348. int k2 = super.saveClickY;
  3349. if (k2 < 0)
  3350. k2 = 0;
  3351. else if (k2 > 502)
  3352. k2 = 502;
  3353. int k3 = super.saveClickX;
  3354. if (k3 < 0)
  3355. k3 = 0;
  3356. else if (k3 > 764)
  3357. k3 = 764;
  3358. int k4 = k2 * 765 + k3;
  3359. int j5 = 0;
  3360. if (super.clickMode3 == 2)
  3361. j5 = 1;
  3362. int l5 = (int) l;
  3363. stream.createFrame(241);
  3364. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3365. }
  3366. if (anInt1016 > 0)
  3367. anInt1016--;
  3368. if (super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3369. aBoolean1017 = true;
  3370. if (aBoolean1017 && anInt1016 <= 0) {
  3371. anInt1016 = 20;
  3372. aBoolean1017 = false;
  3373. stream.createFrame(86);
  3374. stream.writeWord(anInt1184);
  3375. stream.method432(minimapInt1);
  3376. }
  3377. if (super.awtFocus && !aBoolean954) {
  3378. aBoolean954 = true;
  3379. stream.createFrame(3);
  3380. stream.writeWordBigEndian(1);
  3381. }
  3382. if (!super.awtFocus && aBoolean954) {
  3383. aBoolean954 = false;
  3384. stream.createFrame(3);
  3385. stream.writeWordBigEndian(0);
  3386. }
  3387. loadingStages();
  3388. method115();
  3389. anInt1009++;
  3390. if (anInt1009 > 750)
  3391. dropClient();
  3392. method114();
  3393. method95();
  3394. method38();
  3395. anInt945++;
  3396. if (crossType != 0) {
  3397. crossIndex += 20;
  3398. if (crossIndex >= 400)
  3399. crossType = 0;
  3400. }
  3401. if (atInventoryInterfaceType != 0) {
  3402. atInventoryLoopCycle++;
  3403. if (atInventoryLoopCycle >= 15) {
  3404. if (atInventoryInterfaceType == 2) {
  3405. }
  3406. if (atInventoryInterfaceType == 3)
  3407. inputTaken = true;
  3408. atInventoryInterfaceType = 0;
  3409. }
  3410. }
  3411. if (activeInterfaceType != 0) {
  3412. anInt989++;
  3413. if (super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  3414. aBoolean1242 = true;
  3415. if (super.clickMode2 == 0) {
  3416. if (activeInterfaceType == 2) {
  3417. }
  3418. if (activeInterfaceType == 3)
  3419. inputTaken = true;
  3420. activeInterfaceType = 0;
  3421. if (aBoolean1242 && anInt989 >= 15) {
  3422. lastActiveInvInterface = -1;
  3423. processRightClick();
  3424. if (lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085) {
  3425. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3426. int j1 = 0;
  3427. if (anInt913 == 1 && class9.contentType == 206)
  3428. j1 = 1;
  3429. if (class9.inv[mouseInvInterfaceIndex] <= 0)
  3430. j1 = 0;
  3431. if (class9.aBoolean235) {
  3432. int l2 = anInt1085;
  3433. int l3 = mouseInvInterfaceIndex;
  3434. class9.inv[l3] = class9.inv[l2];
  3435. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3436. class9.inv[l2] = -1;
  3437. class9.invStackSizes[l2] = 0;
  3438. } else if (j1 == 1) {
  3439. int i3 = anInt1085;
  3440. for (int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3441. if (i3 > i4) {
  3442. class9.swapInventoryItems(i3, i3 - 1);
  3443. i3--;
  3444. } else if (i3 < i4) {
  3445. class9.swapInventoryItems(i3, i3 + 1);
  3446. i3++;
  3447. }
  3448.  
  3449. } else {
  3450. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  3451. }
  3452. stream.createFrame(214);
  3453. stream.method433(anInt1084);
  3454. stream.method424(j1);
  3455. stream.method433(anInt1085);
  3456. stream.method431(mouseInvInterfaceIndex);
  3457. }
  3458. } else if ((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  3459. determineMenuSize();
  3460. else if (menuActionRow > 0)
  3461. doAction(menuActionRow - 1);
  3462. atInventoryLoopCycle = 10;
  3463. super.clickMode3 = 0;
  3464. }
  3465. }
  3466. if (WorldController.anInt470 != -1) {
  3467. int k = WorldController.anInt470;
  3468. int k1 = WorldController.anInt471;
  3469. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  3470. WorldController.anInt470 = -1;
  3471. if (flag) {
  3472. crossX = super.saveClickX;
  3473. crossY = super.saveClickY;
  3474. crossType = 1;
  3475. crossIndex = 0;
  3476. }
  3477. }
  3478. if (super.clickMode3 == 1 && aString844 != null) {
  3479. aString844 = null;
  3480. inputTaken = true;
  3481. super.clickMode3 = 0;
  3482. }
  3483. processMenuClick();
  3484. if (super.clickMode2 == 1 || super.clickMode3 == 1)
  3485. anInt1213++;
  3486. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3487. if (anInt1501 < 0 && !menuOpen) {
  3488. anInt1501++;
  3489. if (anInt1501 == 0) {
  3490. if (anInt1500 != 0) {
  3491. inputTaken = true;
  3492. }
  3493. if (anInt1044 != 0) {
  3494. }
  3495. }
  3496. }
  3497. } else if (anInt1501 > 0) {
  3498. anInt1501--;
  3499. }
  3500. if (loadingStage == 2)
  3501. method108();
  3502. if (loadingStage == 2 && aBoolean1160)
  3503. calcCameraPos();
  3504. for (int i1 = 0; i1 < 5; i1++)
  3505. anIntArray1030[i1]++;
  3506.  
  3507. method73();
  3508. super.idleTime++;
  3509. if (super.idleTime > 4500) {
  3510. anInt1011 = 250;
  3511. super.idleTime -= 500;
  3512. stream.createFrame(202);
  3513. }
  3514. anInt1010++;
  3515. if (anInt1010 > 50)
  3516. stream.createFrame(0);
  3517. try {
  3518. if (socketStream != null && stream.currentOffset > 0) {
  3519. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3520. stream.currentOffset = 0;
  3521. anInt1010 = 0;
  3522. }
  3523. } catch (IOException _ex) {
  3524. dropClient();
  3525. } catch (Exception exception) {
  3526. resetLogout();
  3527. }
  3528. }
  3529.  
  3530. private void method63() {
  3531. Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetFirst();
  3532. for (; class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetNext())
  3533. if (class30_sub1.anInt1294 == -1) {
  3534. class30_sub1.anInt1302 = 0;
  3535. method89(class30_sub1);
  3536. } else {
  3537. class30_sub1.unlink();
  3538. }
  3539.  
  3540. }
  3541.  
  3542. private void resetImageProducers() {
  3543. if (aRSImageProducer_1107 != null)
  3544. return;
  3545. super.fullGameScreen = null;
  3546. aRSImageProducer_1166 = null;
  3547. aRSImageProducer_1164 = null;
  3548. aRSImageProducer_1163 = null;
  3549. aRSImageProducer_1165 = null;
  3550. aRSImageProducer_1125 = null;
  3551. aRSImageProducer_1110 = new GraphicsBuffer(128, 265);
  3552. DrawingArea.setAllPixelsToZero();
  3553. aRSImageProducer_1111 = new GraphicsBuffer(128, 265);
  3554. DrawingArea.setAllPixelsToZero();
  3555. aRSImageProducer_1107 = new GraphicsBuffer(509, 171);
  3556. DrawingArea.setAllPixelsToZero();
  3557. aRSImageProducer_1108 = new GraphicsBuffer(360, 132);
  3558. DrawingArea.setAllPixelsToZero();
  3559. aRSImageProducer_1109 = new GraphicsBuffer(360, 200);
  3560. DrawingArea.setAllPixelsToZero();
  3561. aRSImageProducer_1112 = new GraphicsBuffer(202, 238);
  3562. DrawingArea.setAllPixelsToZero();
  3563. aRSImageProducer_1113 = new GraphicsBuffer(203, 238);
  3564. DrawingArea.setAllPixelsToZero();
  3565. aRSImageProducer_1114 = new GraphicsBuffer(74, 94);
  3566. DrawingArea.setAllPixelsToZero();
  3567. aRSImageProducer_1115 = new GraphicsBuffer(75, 94);
  3568. DrawingArea.setAllPixelsToZero();
  3569. worldSelection = new GraphicsBuffer(300, 800);
  3570. DrawingArea.setAllPixelsToZero();
  3571. if (titleStreamLoader != null) {
  3572. drawLogo();
  3573. loadTitleScreen();
  3574. }
  3575. welcomeScreenRaised = true;
  3576. }
  3577.  
  3578. void drawLoadingText(int i, String s) {
  3579. anInt1079 = i;
  3580. aString1049 = s;
  3581. resetImageProducers();
  3582. if (titleStreamLoader == null) {
  3583. super.drawLoadingText(i, s);
  3584. return;
  3585. }
  3586. aRSImageProducer_1109.initDrawingArea();
  3587. char c = '\u0168';
  3588. char c1 = '\310';
  3589. byte byte1 = 20;
  3590. boldText.drawText(0xffffff, ClientConstants.CLIENT_NAME + " is loading - please wait...", c1 / 2 - 26 - byte1, c / 2);
  3591. int j = c1 / 2 - 18 - byte1;
  3592. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  3593. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3594. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  3595. DrawingArea.drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3596. boldText.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3597. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3598. if (welcomeScreenRaised) {
  3599. welcomeScreenRaised = false;
  3600. if (!aBoolean831) {
  3601. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3602. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3603. }
  3604. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3605. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3606. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3607. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3608. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3609. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3610. }
  3611. }
  3612.  
  3613. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag, int j1) {
  3614. int anInt992;
  3615. if (aBoolean972)
  3616. anInt992 = 32;
  3617. else
  3618. anInt992 = 0;
  3619. aBoolean972 = false;
  3620. if (k >= i && k < i + 16 && l >= i1 && l < i1 + 16) {
  3621. class9.scrollPosition -= anInt1213 * 4;
  3622. if (flag) {
  3623. }
  3624. } else if (k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j) {
  3625. class9.scrollPosition += anInt1213 * 4;
  3626. if (flag) {
  3627. }
  3628. } else if (k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0) {
  3629. int l1 = ((j - 32) * j) / j1;
  3630. if (l1 < 8)
  3631. l1 = 8;
  3632. int i2 = l - i1 - 16 - l1 / 2;
  3633. int j2 = j - 32 - l1;
  3634. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3635. if (flag) {
  3636. }
  3637. aBoolean972 = true;
  3638. }
  3639. }
  3640.  
  3641. private boolean method66(int i, int j, int k) {
  3642. int i1 = i >> 14 & 0x7fff;
  3643. int j1 = worldController.method304(plane, k, j, i);
  3644. if (j1 == -1)
  3645. return false;
  3646. int k1 = j1 & 0x1f;
  3647. int l1 = j1 >> 6 & 3;
  3648. if (k1 == 10 || k1 == 11 || k1 == 22) {
  3649. ObjectDef class46 = ObjectDef.forID(i1);
  3650. int i2;
  3651. int j2;
  3652. if (l1 == 0 || l1 == 2) {
  3653. i2 = class46.anInt744;
  3654. j2 = class46.anInt761;
  3655. } else {
  3656. i2 = class46.anInt761;
  3657. j2 = class46.anInt744;
  3658. }
  3659. int k2 = class46.anInt768;
  3660. if (l1 != 0)
  3661. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3662. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3663. } else {
  3664. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3665. }
  3666. crossX = super.saveClickX;
  3667. crossY = super.saveClickY;
  3668. crossType = 2;
  3669. crossIndex = 0;
  3670. return true;
  3671. }
  3672.  
  3673. private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k) {
  3674. byte abyte0[] = null;
  3675. int l = 5;
  3676. try {
  3677. if (decompressors[0] != null)
  3678. abyte0 = decompressors[0].decompress(i);
  3679. } catch (Exception _ex) {
  3680. }
  3681. if (abyte0 != null) {
  3682. // aCRC32_930.reset();
  3683. // aCRC32_930.update(abyte0);
  3684. // int i1 = (int)aCRC32_930.getValue();
  3685. // if(i1 != j)
  3686. }
  3687. if (abyte0 != null) {
  3688. StreamLoader streamLoader = new StreamLoader(abyte0);
  3689. return streamLoader;
  3690. }
  3691. int j1 = 0;
  3692. while (abyte0 == null) {
  3693. String s2 = "Unknown error";
  3694. drawLoadingText(k, "Requesting " + s);
  3695. try {
  3696. int k1 = 0;
  3697. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3698. byte abyte1[] = new byte[6];
  3699. datainputstream.readFully(abyte1, 0, 6);
  3700. Stream stream = new Stream(abyte1);
  3701. stream.currentOffset = 3;
  3702. int i2 = stream.read3Bytes() + 6;
  3703. int j2 = 6;
  3704. abyte0 = new byte[i2];
  3705. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3706.  
  3707. while (j2 < i2) {
  3708. int l2 = i2 - j2;
  3709. if (l2 > 1000)
  3710. l2 = 1000;
  3711. int j3 = datainputstream.read(abyte0, j2, l2);
  3712. if (j3 < 0) {
  3713. s2 = "Length error: " + j2 + "/" + i2;
  3714. throw new IOException("EOF");
  3715. }
  3716. j2 += j3;
  3717. int k3 = (j2 * 100) / i2;
  3718. if (k3 != k1)
  3719. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3720. k1 = k3;
  3721. }
  3722. datainputstream.close();
  3723. try {
  3724. if (decompressors[0] != null)
  3725. decompressors[0].method234(abyte0.length, abyte0, i);
  3726. } catch (Exception _ex) {
  3727. decompressors[0] = null;
  3728. }
  3729. /*
  3730. * if(abyte0 != null) { aCRC32_930.reset();
  3731. * aCRC32_930.update(abyte0); int i3 =
  3732. * (int)aCRC32_930.getValue(); if(i3 != j) { abyte0 = null;
  3733. * j1++; s2 = "Checksum error: " + i3; } }
  3734. */
  3735. } catch (IOException ioexception) {
  3736. if (s2.equals("Unknown error"))
  3737. s2 = "Connection error";
  3738. abyte0 = null;
  3739. } catch (NullPointerException _ex) {
  3740. s2 = "Null error";
  3741. abyte0 = null;
  3742. if (!Signlink.reporterror)
  3743. return null;
  3744. } catch (ArrayIndexOutOfBoundsException _ex) {
  3745. s2 = "Bounds error";
  3746. abyte0 = null;
  3747. if (!Signlink.reporterror)
  3748. return null;
  3749. } catch (Exception _ex) {
  3750. s2 = "Unexpected error";
  3751. abyte0 = null;
  3752. if (!Signlink.reporterror)
  3753. return null;
  3754. }
  3755. if (abyte0 == null) {
  3756. for (int l1 = l; l1 > 0; l1--) {
  3757. if (j1 >= 3) {
  3758. drawLoadingText(k, "Game updated - please reload page");
  3759. l1 = 10;
  3760. } else {
  3761. drawLoadingText(k, s2 + " - Retrying in " + l1);
  3762. }
  3763. try {
  3764. Thread.sleep(1000L);
  3765. } catch (Exception _ex) {
  3766. }
  3767. }
  3768.  
  3769. l *= 2;
  3770. if (l > 60)
  3771. l = 60;
  3772. aBoolean872 = !aBoolean872;
  3773. }
  3774.  
  3775. }
  3776.  
  3777. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  3778. return streamLoader_1;
  3779. }
  3780.  
  3781. private void dropClient() {
  3782. if (anInt1011 > 0) {
  3783. resetLogout();
  3784. return;
  3785. }
  3786. fancyText.drawChatInput(0xffffff, 75, "Connection lost", 15, true);
  3787. fancyText.drawChatInput(0xffffff, 5, "Please wait - attempting to reestablish", 30, true);
  3788. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  3789. anInt1021 = 0;
  3790. destX = 0;
  3791. RSSocket rsSocket = socketStream;
  3792. loggedIn = false;
  3793. loginFailures = 0;
  3794. login(myUsername, myPassword, true);
  3795. if (!loggedIn)
  3796. resetLogout();
  3797. try {
  3798. rsSocket.close();
  3799. } catch (Exception _ex) {
  3800. }
  3801. }
  3802.  
  3803. public void setNorth() {
  3804. anInt1278 = 0;
  3805. anInt1131 = 0;
  3806. anInt896 = 0;
  3807. minimapInt1 = 0;
  3808. minimapInt2 = 0;
  3809. minimapInt3 = 0;
  3810. }
  3811.  
  3812. private void doAction(int i) {
  3813. if (i < 0)
  3814. return;
  3815. if (inputDialogState != 0) {
  3816. inputDialogState = 0;
  3817. inputTaken = true;
  3818. }
  3819. int j = menuActionCmd2[i];
  3820. int k = menuActionCmd3[i];
  3821. int l = menuActionID[i];
  3822. int i1 = menuActionCmd1[i];
  3823. if (l >= 2000)
  3824. l -= 2000;
  3825. if (l == 851) {
  3826. stream.createFrame(185);
  3827. stream.writeWord(155);
  3828. }
  3829. if (l == 700) {
  3830. if (tabInterfaceIDs[10] != -1) {
  3831. if (tabID == 10) {
  3832. showTabComponents = !showTabComponents;
  3833. } else {
  3834. showTabComponents = true;
  3835. }
  3836. tabID = 10;
  3837. tabAreaAltered = true;
  3838. }
  3839. }
  3840. if (l == 696) {
  3841. setNorth();
  3842. }
  3843. if (l == 1506) { // Select quick prayers
  3844. stream.createFrame(185);
  3845. stream.writeWord(5001);
  3846. }
  3847. if (l == 1500) { // Toggle quick prayers
  3848. prayClicked = !prayClicked;
  3849. stream.createFrame(185);
  3850. stream.writeWord(5000);
  3851. }
  3852. if (l == 474) {
  3853. drawExperienceCounter = !drawExperienceCounter;
  3854. }
  3855. if (l == 475) {
  3856. xpCounter = 0;
  3857. }
  3858. if (l == 476) {
  3859. drawTotalExperience = !drawTotalExperience;
  3860. }
  3861. if (l == 104) {
  3862. RSInterface class9_1 = RSInterface.interfaceCache[k];
  3863. spellID = class9_1.id;
  3864. if (!autocast) {
  3865. autocast = true;
  3866. autoCastId = class9_1.id;
  3867. stream.createFrame(185);
  3868. stream.writeWord(class9_1.id);
  3869. } else if (autoCastId == class9_1.id) {
  3870. autocast = false;
  3871. autoCastId = 0;
  3872. stream.createFrame(185);
  3873. stream.writeWord(class9_1.id);
  3874. } else if (autoCastId != class9_1.id) {
  3875. autocast = true;
  3876. autoCastId = class9_1.id;
  3877. stream.createFrame(185);
  3878. stream.writeWord(class9_1.id);
  3879. }
  3880. }
  3881. if (l == 582) {
  3882. Npc npc = npcArray[i1];
  3883. if (npc != null) {
  3884. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  3885. crossX = super.saveClickX;
  3886. crossY = super.saveClickY;
  3887. crossType = 2;
  3888. crossIndex = 0;
  3889. stream.createFrame(57);
  3890. stream.method432(anInt1285);
  3891. stream.method432(i1);
  3892. stream.method431(anInt1283);
  3893. stream.method432(anInt1284);
  3894. }
  3895. }
  3896. if (l == 234) {
  3897. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3898. if (!flag1)
  3899. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3900. crossX = super.saveClickX;
  3901. crossY = super.saveClickY;
  3902. crossType = 2;
  3903. crossIndex = 0;
  3904. stream.createFrame(236);
  3905. stream.method431(k + baseY);
  3906. stream.writeWord(i1);
  3907. stream.method431(j + baseX);
  3908. }
  3909. if (l == 62 && method66(i1, k, j)) {
  3910. stream.createFrame(192);
  3911. stream.writeWord(anInt1284);
  3912. stream.method431(i1 >> 14 & 0x7fff);
  3913. stream.method433(k + baseY);
  3914. stream.method431(anInt1283);
  3915. stream.method433(j + baseX);
  3916. stream.writeWord(anInt1285);
  3917. }
  3918. if (l == 511) {
  3919. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3920. if (!flag2)
  3921. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3922. crossX = super.saveClickX;
  3923. crossY = super.saveClickY;
  3924. crossType = 2;
  3925. crossIndex = 0;
  3926. stream.createFrame(25);
  3927. stream.method431(anInt1284);
  3928. stream.method432(anInt1285);
  3929. stream.writeWord(i1);
  3930. stream.method432(k + baseY);
  3931. stream.method433(anInt1283);
  3932. stream.writeWord(j + baseX);
  3933. }
  3934. if (l == 74) {
  3935. stream.createFrame(122);
  3936. stream.method433(k);
  3937. stream.method432(j);
  3938. stream.method431(i1);
  3939. atInventoryLoopCycle = 0;
  3940. atInventoryInterface = k;
  3941. atInventoryIndex = j;
  3942. atInventoryInterfaceType = 2;
  3943. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3944. atInventoryInterfaceType = 1;
  3945. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  3946. atInventoryInterfaceType = 3;
  3947. }
  3948. if (l == 315) {
  3949. RSInterface class9 = RSInterface.interfaceCache[k];
  3950. boolean flag8 = true;
  3951. if (class9.contentType > 0)
  3952. flag8 = promptUserForInput(class9);
  3953. if (flag8) {
  3954.  
  3955. switch(k){
  3956. case 19144:
  3957. sendFrame248(15106,3213);//15106 is the equipment interface id, and 3123 is the inventory id.
  3958. method60(15106);
  3959. inputTaken = true;
  3960. break;
  3961. default:
  3962. stream.createFrame(185);
  3963. stream.writeWord(k);
  3964. break;
  3965.  
  3966. }
  3967. }
  3968. }
  3969. if (l == 561) {
  3970. Player player = playerArray[i1];
  3971. if (player != null) {
  3972. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  3973. crossX = super.saveClickX;
  3974. crossY = super.saveClickY;
  3975. crossType = 2;
  3976. crossIndex = 0;
  3977. anInt1188 += i1;
  3978. if (anInt1188 >= 90) {
  3979. stream.createFrame(136);
  3980. anInt1188 = 0;
  3981. }
  3982. stream.createFrame(128);
  3983. stream.writeWord(i1);
  3984. }
  3985. }
  3986. if (l == 20) {
  3987. Npc class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  3988. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  3989. 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]);
  3990. crossX = super.saveClickX;
  3991. crossY = super.saveClickY;
  3992. crossType = 2;
  3993. crossIndex = 0;
  3994. stream.createFrame(155);
  3995. stream.method431(i1);
  3996. }
  3997. }
  3998. if (l == 779) {
  3999. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  4000. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  4001. 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]);
  4002. crossX = super.saveClickX;
  4003. crossY = super.saveClickY;
  4004. crossType = 2;
  4005. crossIndex = 0;
  4006. stream.createFrame(153);
  4007. stream.method431(i1);
  4008. }
  4009. }
  4010. if (l == 519)
  4011. if (!menuOpen)
  4012. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  4013. else
  4014. worldController.method312(k - 4, j - 4);
  4015. if (l == 1062) {
  4016. anInt924 += baseX;
  4017. if (anInt924 >= 113) {
  4018. stream.createFrame(183);
  4019. stream.writeDWordBigEndian(0xe63271);
  4020. anInt924 = 0;
  4021. }
  4022. method66(i1, k, j);
  4023. stream.createFrame(228);
  4024. stream.method432(i1 >> 14 & 0x7fff);
  4025. stream.method432(k + baseY);
  4026. stream.writeWord(j + baseX);
  4027. }
  4028. if (l == 679 && !aBoolean1149) {
  4029. stream.createFrame(40);
  4030. stream.writeWord(k);
  4031. aBoolean1149 = true;
  4032. }
  4033. if (l == 431) {
  4034. stream.createFrame(129);
  4035. stream.method432(j);
  4036. stream.writeWord(k);
  4037. stream.method432(i1);
  4038. atInventoryLoopCycle = 0;
  4039. atInventoryInterface = k;
  4040. atInventoryIndex = j;
  4041. atInventoryInterfaceType = 2;
  4042. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4043. atInventoryInterfaceType = 1;
  4044. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4045. atInventoryInterfaceType = 3;
  4046. }
  4047. if (l == 337 || l == 42 || l == 792 || l == 322) {
  4048. String s = menuActionName[i];
  4049. int k1 = s.indexOf("@whi@");
  4050. if (k1 != -1) {
  4051. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  4052. if (l == 337)
  4053. addFriend(l3);
  4054. if (l == 42)
  4055. addIgnore(l3);
  4056. if (l == 792)
  4057. delFriend(l3);
  4058. if (l == 322)
  4059. delIgnore(l3);
  4060. }
  4061. }
  4062. if (l == 53) {
  4063. stream.createFrame(135);
  4064. stream.method431(j);
  4065. stream.method432(k);
  4066. stream.method431(i1);
  4067. atInventoryLoopCycle = 0;
  4068. atInventoryInterface = k;
  4069. atInventoryIndex = j;
  4070. atInventoryInterfaceType = 2;
  4071. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4072. atInventoryInterfaceType = 1;
  4073. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4074. atInventoryInterfaceType = 3;
  4075. }
  4076. if (l == 539) {
  4077. stream.createFrame(16);
  4078. stream.method432(i1);
  4079. stream.method433(j);
  4080. stream.method433(k);
  4081. atInventoryLoopCycle = 0;
  4082. atInventoryInterface = k;
  4083. atInventoryIndex = j;
  4084. atInventoryInterfaceType = 2;
  4085. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4086. atInventoryInterfaceType = 1;
  4087. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4088. atInventoryInterfaceType = 3;
  4089. }
  4090. if (l == 484 || l == 6) {
  4091. String s1 = menuActionName[i];
  4092. int l1 = s1.indexOf("@whi@");
  4093. if (l1 != -1) {
  4094. s1 = s1.substring(l1 + 5).trim();
  4095. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  4096. boolean flag9 = false;
  4097. for (int j3 = 0; j3 < playerCount; j3++) {
  4098. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  4099. 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))
  4100. continue;
  4101. 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]);
  4102. if (l == 484) {
  4103. stream.createFrame(139);
  4104. stream.method431(playerIndices[j3]);
  4105. }
  4106. if (l == 6) {
  4107. anInt1188 += i1;
  4108. if (anInt1188 >= 90) {
  4109. stream.createFrame(136);
  4110. anInt1188 = 0;
  4111. }
  4112. stream.createFrame(128);
  4113. stream.writeWord(playerIndices[j3]);
  4114. }
  4115. flag9 = true;
  4116. break;
  4117. }
  4118.  
  4119. if (!flag9)
  4120. pushMessage("Unable to find " + s7, 0, "");
  4121. }
  4122. }
  4123. if (l == 870) {
  4124. stream.createFrame(53);
  4125. stream.writeWord(j);
  4126. stream.method432(anInt1283);
  4127. stream.method433(i1);
  4128. stream.writeWord(anInt1284);
  4129. stream.method431(anInt1285);
  4130. stream.writeWord(k);
  4131. atInventoryLoopCycle = 0;
  4132. atInventoryInterface = k;
  4133. atInventoryIndex = j;
  4134. atInventoryInterfaceType = 2;
  4135. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4136. atInventoryInterfaceType = 1;
  4137. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4138. atInventoryInterfaceType = 3;
  4139. }
  4140. if (l == 847) {
  4141. stream.createFrame(87);
  4142. stream.method432(i1);
  4143. stream.writeWord(k);
  4144. stream.method432(j);
  4145. atInventoryLoopCycle = 0;
  4146. atInventoryInterface = k;
  4147. atInventoryIndex = j;
  4148. atInventoryInterfaceType = 2;
  4149. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4150. atInventoryInterfaceType = 1;
  4151. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4152. atInventoryInterfaceType = 3;
  4153. }
  4154. if (l == 626) {
  4155. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4156. spellSelected = 1;
  4157. spellID = class9_1.id;
  4158. anInt1137 = k;
  4159. spellUsableOn = class9_1.spellUsableOn;
  4160. itemSelected = 0;
  4161. String s4 = class9_1.selectedActionName;
  4162. if (s4.indexOf(" ") != -1)
  4163. s4 = s4.substring(0, s4.indexOf(" "));
  4164. String s8 = class9_1.selectedActionName;
  4165. if (s8.indexOf(" ") != -1)
  4166. s8 = s8.substring(s8.indexOf(" ") + 1);
  4167. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4168. if (spellUsableOn == 16) {
  4169. tabID = 3;
  4170. tabAreaAltered = true;
  4171. }
  4172. return;
  4173. }
  4174. if (l == 78) {
  4175. stream.createFrame(117);
  4176. stream.method433(k);
  4177. stream.method433(i1);
  4178. stream.method431(j);
  4179. atInventoryLoopCycle = 0;
  4180. atInventoryInterface = k;
  4181. atInventoryIndex = j;
  4182. atInventoryInterfaceType = 2;
  4183. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4184. atInventoryInterfaceType = 1;
  4185. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4186. atInventoryInterfaceType = 3;
  4187. }
  4188. if (l == 27) {
  4189. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4190. if (class30_sub2_sub4_sub1_sub2_2 != null) {
  4191. 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]);
  4192. crossX = super.saveClickX;
  4193. crossY = super.saveClickY;
  4194. crossType = 2;
  4195. crossIndex = 0;
  4196. anInt986 += i1;
  4197. if (anInt986 >= 54) {
  4198. stream.createFrame(189);
  4199. stream.writeWordBigEndian(234);
  4200. anInt986 = 0;
  4201. }
  4202. stream.createFrame(73);
  4203. stream.method431(i1);
  4204. }
  4205. }
  4206. if (l == 213) {
  4207. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4208. if (!flag3)
  4209. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4210. crossX = super.saveClickX;
  4211. crossY = super.saveClickY;
  4212. crossType = 2;
  4213. crossIndex = 0;
  4214. stream.createFrame(79);
  4215. stream.method431(k + baseY);
  4216. stream.writeWord(i1);
  4217. stream.method432(j + baseX);
  4218. }
  4219. if (l == 632) {
  4220. stream.createFrame(145);
  4221. stream.method432(k);
  4222. stream.method432(j);
  4223. stream.method432(i1);
  4224. atInventoryLoopCycle = 0;
  4225. atInventoryInterface = k;
  4226. atInventoryIndex = j;
  4227. atInventoryInterfaceType = 2;
  4228. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4229. atInventoryInterfaceType = 1;
  4230. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4231. atInventoryInterfaceType = 3;
  4232. }
  4233. if (l == 1003) {
  4234. clanChatMode = 2;
  4235. inputTaken = true;
  4236. }
  4237. if (l == 1002) {
  4238. clanChatMode = 1;
  4239. inputTaken = true;
  4240. }
  4241. if (l == 1001) {
  4242. clanChatMode = 0;
  4243. inputTaken = true;
  4244. }
  4245. if (l == 1000) {
  4246. cButtonCPos = 4;
  4247. chatTypeView = 11;
  4248. inputTaken = true;
  4249. }
  4250. if (l == 999) {
  4251. cButtonCPos = 0;
  4252. chatTypeView = 0;
  4253. inputTaken = true;
  4254. }
  4255. if (l == 998) {
  4256. cButtonCPos = 1;
  4257. chatTypeView = 5;
  4258. inputTaken = true;
  4259. }
  4260. if (l == 997) {
  4261. publicChatMode = 3;
  4262. inputTaken = true;
  4263. }
  4264. if (l == 996) {
  4265. publicChatMode = 2;
  4266. inputTaken = true;
  4267. }
  4268. if (l == 995) {
  4269. publicChatMode = 1;
  4270. inputTaken = true;
  4271. }
  4272. if (l == 994) {
  4273. publicChatMode = 0;
  4274. inputTaken = true;
  4275. }
  4276. if (l == 993) {
  4277. cButtonCPos = 2;
  4278. chatTypeView = 1;
  4279. inputTaken = true;
  4280. }
  4281. if (l == 992) {
  4282. privateChatMode = 2;
  4283. inputTaken = true;
  4284. }
  4285. if (l == 991) {
  4286. privateChatMode = 1;
  4287. inputTaken = true;
  4288. }
  4289. if (l == 990) {
  4290. privateChatMode = 0;
  4291. inputTaken = true;
  4292. }
  4293. if (l == 989) {
  4294. cButtonCPos = 3;
  4295. chatTypeView = 2;
  4296. inputTaken = true;
  4297. }
  4298. if (l == 987) {
  4299. tradeMode = 2;
  4300. inputTaken = true;
  4301. }
  4302. if (l == 986) {
  4303. tradeMode = 1;
  4304. inputTaken = true;
  4305. }
  4306. if (l == 985) {
  4307. tradeMode = 0;
  4308. inputTaken = true;
  4309. }
  4310. if (l == 984) {
  4311. cButtonCPos = 5;
  4312. chatTypeView = 3;
  4313. inputTaken = true;
  4314. }
  4315. if (l == 980) {
  4316. cButtonCPos = 6;
  4317. chatTypeView = 4;
  4318. inputTaken = true;
  4319. }
  4320. if (l == 493) {
  4321. stream.createFrame(75);
  4322. stream.method433(k);
  4323. stream.method431(j);
  4324. stream.method432(i1);
  4325. atInventoryLoopCycle = 0;
  4326. atInventoryInterface = k;
  4327. atInventoryIndex = j;
  4328. atInventoryInterfaceType = 2;
  4329. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4330. atInventoryInterfaceType = 1;
  4331. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4332. atInventoryInterfaceType = 3;
  4333. }
  4334. if (l == 652) {
  4335. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4336. if (!flag4)
  4337. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4338. crossX = super.saveClickX;
  4339. crossY = super.saveClickY;
  4340. crossType = 2;
  4341. crossIndex = 0;
  4342. stream.createFrame(156);
  4343. stream.method432(j + baseX);
  4344. stream.method431(k + baseY);
  4345. stream.method433(i1);
  4346. }
  4347. if (l == 94) {
  4348. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4349. if (!flag5)
  4350. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4351. crossX = super.saveClickX;
  4352. crossY = super.saveClickY;
  4353. crossType = 2;
  4354. crossIndex = 0;
  4355. stream.createFrame(181);
  4356. stream.method431(k + baseY);
  4357. stream.writeWord(i1);
  4358. stream.method431(j + baseX);
  4359. stream.method432(anInt1137);
  4360. }
  4361. if (l == 646) {
  4362. stream.createFrame(185);
  4363. stream.writeWord(k);
  4364. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4365. if (class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  4366. int i2 = class9_2.valueIndexArray[0][1];
  4367. if (variousSettings[i2] != class9_2.anIntArray212[0]) {
  4368. variousSettings[i2] = class9_2.anIntArray212[0];
  4369. method33(i2);
  4370. }
  4371. }
  4372. }
  4373. if (l == 225) {
  4374. Npc class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4375. if (class30_sub2_sub4_sub1_sub1_2 != null) {
  4376. 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]);
  4377. crossX = super.saveClickX;
  4378. crossY = super.saveClickY;
  4379. crossType = 2;
  4380. crossIndex = 0;
  4381. anInt1226 += i1;
  4382. if (anInt1226 >= 85) {
  4383. stream.createFrame(230);
  4384. stream.writeWordBigEndian(239);
  4385. anInt1226 = 0;
  4386. }
  4387. stream.createFrame(17);
  4388. stream.method433(i1);
  4389. }
  4390. }
  4391. if (l == 965) {
  4392. Npc class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4393. if (class30_sub2_sub4_sub1_sub1_3 != null) {
  4394. 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]);
  4395. crossX = super.saveClickX;
  4396. crossY = super.saveClickY;
  4397. crossType = 2;
  4398. crossIndex = 0;
  4399. anInt1134++;
  4400. if (anInt1134 >= 96) {
  4401. stream.createFrame(152);
  4402. stream.writeWordBigEndian(88);
  4403. anInt1134 = 0;
  4404. }
  4405. stream.createFrame(21);
  4406. stream.writeWord(i1);
  4407. }
  4408. }
  4409. if (l == 413) {
  4410. Npc class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4411. if (class30_sub2_sub4_sub1_sub1_4 != null) {
  4412. 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]);
  4413. crossX = super.saveClickX;
  4414. crossY = super.saveClickY;
  4415. crossType = 2;
  4416. crossIndex = 0;
  4417. stream.createFrame(131);
  4418. stream.method433(i1);
  4419. stream.method432(anInt1137);
  4420. }
  4421. }
  4422. if (l == 200)
  4423. clearTopInterfaces();
  4424. if (l == 1025) {
  4425. Npc class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4426. if (class30_sub2_sub4_sub1_sub1_5 != null) {
  4427. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4428. if (entityDef.childrenIDs != null)
  4429. entityDef = entityDef.method161();
  4430. if (entityDef != null) {
  4431. String s9;
  4432. if (entityDef.description != null)
  4433. s9 = new String(entityDef.description);
  4434. else
  4435. s9 = "It's a " + entityDef.name + ".";
  4436. pushMessage(s9, 0, "");
  4437. }
  4438. }
  4439. }
  4440. if (l == 900) {
  4441. method66(i1, k, j);
  4442. stream.createFrame(252);
  4443. stream.method433(i1 >> 14 & 0x7fff);
  4444. stream.method431(k + baseY);
  4445. stream.method432(j + baseX);
  4446. }
  4447. if (l == 412) {
  4448. Npc class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4449. if (class30_sub2_sub4_sub1_sub1_6 != null) {
  4450. 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]);
  4451. crossX = super.saveClickX;
  4452. crossY = super.saveClickY;
  4453. crossType = 2;
  4454. crossIndex = 0;
  4455. stream.createFrame(72);
  4456. stream.method432(i1);
  4457. }
  4458. }
  4459. if (l == 365) {
  4460. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4461. if (class30_sub2_sub4_sub1_sub2_3 != null) {
  4462. 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]);
  4463. crossX = super.saveClickX;
  4464. crossY = super.saveClickY;
  4465. crossType = 2;
  4466. crossIndex = 0;
  4467. stream.createFrame(249);
  4468. stream.method432(i1);
  4469. stream.method431(anInt1137);
  4470. }
  4471. }
  4472. if (l == 729) {
  4473. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4474. if (class30_sub2_sub4_sub1_sub2_4 != null) {
  4475. 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]);
  4476. crossX = super.saveClickX;
  4477. crossY = super.saveClickY;
  4478. crossType = 2;
  4479. crossIndex = 0;
  4480. stream.createFrame(39);
  4481. stream.method431(i1);
  4482. }
  4483. }
  4484. if (l == 577) {
  4485. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4486. if (class30_sub2_sub4_sub1_sub2_5 != null) {
  4487. 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]);
  4488. crossX = super.saveClickX;
  4489. crossY = super.saveClickY;
  4490. crossType = 2;
  4491. crossIndex = 0;
  4492. stream.createFrame(139);
  4493. stream.method431(i1);
  4494. }
  4495. }
  4496. if (l == 956 && method66(i1, k, j)) {
  4497. stream.createFrame(35);
  4498. stream.method431(j + baseX);
  4499. stream.method432(anInt1137);
  4500. stream.method432(k + baseY);
  4501. stream.method431(i1 >> 14 & 0x7fff);
  4502. }
  4503. if (l == 567) {
  4504. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4505. if (!flag6)
  4506. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4507. crossX = super.saveClickX;
  4508. crossY = super.saveClickY;
  4509. crossType = 2;
  4510. crossIndex = 0;
  4511. stream.createFrame(23);
  4512. stream.method431(k + baseY);
  4513. stream.method431(i1);
  4514. stream.method431(j + baseX);
  4515. }
  4516. if (l == 867) {
  4517. if ((i1 & 3) == 0)
  4518. anInt1175++;
  4519. if (anInt1175 >= 59) {
  4520. stream.createFrame(200);
  4521. stream.writeWord(25501);
  4522. anInt1175 = 0;
  4523. }
  4524. stream.createFrame(43);
  4525. stream.method431(k);
  4526. stream.method432(i1);
  4527. stream.method432(j);
  4528. atInventoryLoopCycle = 0;
  4529. atInventoryInterface = k;
  4530. atInventoryIndex = j;
  4531. atInventoryInterfaceType = 2;
  4532. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4533. atInventoryInterfaceType = 1;
  4534. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4535. atInventoryInterfaceType = 3;
  4536. }
  4537. if (l == 543) {
  4538. stream.createFrame(237);
  4539. stream.writeWord(j);
  4540. stream.method432(i1);
  4541. stream.writeWord(k);
  4542. stream.method432(anInt1137);
  4543. atInventoryLoopCycle = 0;
  4544. atInventoryInterface = k;
  4545. atInventoryIndex = j;
  4546. atInventoryInterfaceType = 2;
  4547. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4548. atInventoryInterfaceType = 1;
  4549. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4550. atInventoryInterfaceType = 3;
  4551. }
  4552. if (l == 606) {
  4553. String s2 = menuActionName[i];
  4554. int j2 = s2.indexOf("@whi@");
  4555. if (j2 != -1)
  4556. if (openInterfaceID == -1) {
  4557. clearTopInterfaces();
  4558. reportAbuseInput = s2.substring(j2 + 5).trim();
  4559. canMute = false;
  4560. for (int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++) {
  4561. if (RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  4562. continue;
  4563. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4564. break;
  4565. }
  4566.  
  4567. } else {
  4568. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  4569. }
  4570. }
  4571. if (l == 491) {
  4572. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4573. if (class30_sub2_sub4_sub1_sub2_6 != null) {
  4574. 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]);
  4575. crossX = super.saveClickX;
  4576. crossY = super.saveClickY;
  4577. crossType = 2;
  4578. crossIndex = 0;
  4579. stream.createFrame(14);
  4580. stream.method432(anInt1284);
  4581. stream.writeWord(i1);
  4582. stream.writeWord(anInt1285);
  4583. stream.method431(anInt1283);
  4584. }
  4585. }
  4586. if (l == 639) {
  4587. String s3 = menuActionName[i];
  4588. int k2 = s3.indexOf("@whi@");
  4589. if (k2 != -1) {
  4590. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4591. int k3 = -1;
  4592. for (int i4 = 0; i4 < friendsCount; i4++) {
  4593. if (friendsListAsLongs[i4] != l4)
  4594. continue;
  4595. k3 = i4;
  4596. break;
  4597. }
  4598.  
  4599. if (k3 != -1 && friendsNodeIDs[k3] > 0) {
  4600. inputTaken = true;
  4601. inputDialogState = 0;
  4602. messagePromptRaised = true;
  4603. promptInput = "";
  4604. friendsListAction = 3;
  4605. aLong953 = friendsListAsLongs[k3];
  4606. aString1121 = "Enter message to send to " + friendsList[k3];
  4607. }
  4608. }
  4609. }
  4610. if (l == 454) {
  4611. stream.createFrame(41);
  4612. stream.writeWord(i1);
  4613. stream.method432(j);
  4614. stream.method432(k);
  4615. atInventoryLoopCycle = 0;
  4616. atInventoryInterface = k;
  4617. atInventoryIndex = j;
  4618. atInventoryInterfaceType = 2;
  4619. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4620. atInventoryInterfaceType = 1;
  4621. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4622. atInventoryInterfaceType = 3;
  4623. }
  4624. if (l == 478) {
  4625. Npc class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4626. if (class30_sub2_sub4_sub1_sub1_7 != null) {
  4627. 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]);
  4628. crossX = super.saveClickX;
  4629. crossY = super.saveClickY;
  4630. crossType = 2;
  4631. crossIndex = 0;
  4632. if ((i1 & 3) == 0)
  4633. anInt1155++;
  4634. if (anInt1155 >= 53) {
  4635. stream.createFrame(85);
  4636. stream.writeWordBigEndian(66);
  4637. anInt1155 = 0;
  4638. }
  4639. stream.createFrame(18);
  4640. stream.method431(i1);
  4641. }
  4642. }
  4643. if (l == 113) {
  4644. method66(i1, k, j);
  4645. stream.createFrame(70);
  4646. stream.method431(j + baseX);
  4647. stream.writeWord(k + baseY);
  4648. stream.method433(i1 >> 14 & 0x7fff);
  4649. }
  4650. if (l == 872) {
  4651. method66(i1, k, j);
  4652. stream.createFrame(234);
  4653. stream.method433(j + baseX);
  4654. stream.method432(i1 >> 14 & 0x7fff);
  4655. stream.method433(k + baseY);
  4656. }
  4657. if (l == 502) {
  4658. method66(i1, k, j);
  4659. stream.createFrame(132);
  4660. stream.method433(j + baseX);
  4661. stream.writeWord(i1 >> 14 & 0x7fff);
  4662. stream.method432(k + baseY);
  4663. }
  4664. if (l == 1125) {
  4665. ItemDef itemDef = ItemDef.forID(i1);
  4666. RSInterface class9_4 = RSInterface.interfaceCache[k];
  4667. String s5;
  4668. if (class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0) {
  4669. s5 = NumberFormat.getIntegerInstance().format(class9_4.invStackSizes[j]) + " x " + itemDef.name;
  4670. } else if (itemDef.description != null)
  4671. s5 = new String(itemDef.description);
  4672. else
  4673. s5 = "It's a " + itemDef.name + ".";
  4674. pushMessage(s5, 0, "");
  4675. }
  4676. if (l == 169) {
  4677. stream.createFrame(185);
  4678. stream.writeWord(k);
  4679. RSInterface class9_3 = RSInterface.interfaceCache[k];
  4680. if (class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  4681. int l2 = class9_3.valueIndexArray[0][1];
  4682. variousSettings[l2] = 1 - variousSettings[l2];
  4683. method33(l2);
  4684. }
  4685. }
  4686. if (l == 447) {
  4687. itemSelected = 1;
  4688. anInt1283 = j;
  4689. anInt1284 = k;
  4690. anInt1285 = i1;
  4691. selectedItemName = ItemDef.forID(i1).name;
  4692. spellSelected = 0;
  4693. return;
  4694. }
  4695. if (l == 1226) {
  4696. int j1 = i1 >> 14 & 0x7fff;
  4697. ObjectDef class46 = ObjectDef.forID(j1);
  4698. String s10;
  4699. if (class46.description != null)
  4700. s10 = new String(class46.description);
  4701. else
  4702. s10 = "It's a " + class46.name + ".";
  4703. pushMessage(s10, 0, "");
  4704. }
  4705. if (l == 244) {
  4706. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4707. if (!flag7)
  4708. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4709. crossX = super.saveClickX;
  4710. crossY = super.saveClickY;
  4711. crossType = 2;
  4712. crossIndex = 0;
  4713. stream.createFrame(253);
  4714. stream.method431(j + baseX);
  4715. stream.method433(k + baseY);
  4716. stream.method432(i1);
  4717. }
  4718. if (l == 1448) {
  4719. ItemDef itemDef_1 = ItemDef.forID(i1);
  4720. String s6;
  4721. if (itemDef_1.description != null)
  4722. s6 = new String(itemDef_1.description);
  4723. else
  4724. s6 = "It's a " + itemDef_1.name + ".";
  4725. pushMessage(s6, 0, "");
  4726. }
  4727. itemSelected = 0;
  4728. spellSelected = 0;
  4729.  
  4730. }
  4731.  
  4732. @SuppressWarnings("unused")
  4733. private void method70() {
  4734. anInt1251 = 0;
  4735. int j = (myPlayer.x >> 7) + baseX;
  4736. int k = (myPlayer.y >> 7) + baseY;
  4737. if (j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  4738. anInt1251 = 1;
  4739. if (j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  4740. anInt1251 = 1;
  4741. if (anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  4742. anInt1251 = 0;
  4743. }
  4744.  
  4745. public void run() {
  4746. if (drawFlames) {
  4747. drawFlames();
  4748. } else {
  4749. super.run();
  4750. }
  4751. }
  4752.  
  4753. private void build3dScreenMenu() {
  4754. if (itemSelected == 0 && spellSelected == 0) {
  4755. menuActionName[menuActionRow] = "Walk here";
  4756. menuActionID[menuActionRow] = 519;
  4757. menuActionCmd2[menuActionRow] = super.mouseX;
  4758. menuActionCmd3[menuActionRow] = super.mouseY;
  4759. menuActionRow++;
  4760. }
  4761. int j = -1;
  4762. for (int k = 0; k < Model.anInt1687; k++) {
  4763. int l = Model.anIntArray1688[k];
  4764. int i1 = l & 0x7f;
  4765. int j1 = l >> 7 & 0x7f;
  4766. int k1 = l >> 29 & 3;
  4767. int l1 = l >> 14 & 0x7fff;
  4768. if (l == j)
  4769. continue;
  4770. j = l;
  4771. if (k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0) {
  4772. ObjectDef class46 = ObjectDef.forID(l1);
  4773. if (class46.childrenIDs != null)
  4774. class46 = class46.method580();
  4775. if (class46 == null)
  4776. continue;
  4777. if (itemSelected == 1) {
  4778. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
  4779. menuActionID[menuActionRow] = 62;
  4780. menuActionCmd1[menuActionRow] = l;
  4781. menuActionCmd2[menuActionRow] = i1;
  4782. menuActionCmd3[menuActionRow] = j1;
  4783. menuActionRow++;
  4784. } else if (spellSelected == 1) {
  4785. if ((spellUsableOn & 4) == 4) {
  4786. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  4787. menuActionID[menuActionRow] = 956;
  4788. menuActionCmd1[menuActionRow] = l;
  4789. menuActionCmd2[menuActionRow] = i1;
  4790. menuActionCmd3[menuActionRow] = j1;
  4791. menuActionRow++;
  4792. }
  4793. } else {
  4794. if (class46.actions != null) {
  4795. for (int i2 = 4; i2 >= 0; i2--)
  4796. if (class46.actions[i2] != null) {
  4797. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  4798. if (i2 == 0)
  4799. menuActionID[menuActionRow] = 502;
  4800. if (i2 == 1)
  4801. menuActionID[menuActionRow] = 900;
  4802. if (i2 == 2)
  4803. menuActionID[menuActionRow] = 113;
  4804. if (i2 == 3)
  4805. menuActionID[menuActionRow] = 872;
  4806. if (i2 == 4)
  4807. menuActionID[menuActionRow] = 1062;
  4808. menuActionCmd1[menuActionRow] = l;
  4809. menuActionCmd2[menuActionRow] = i1;
  4810. menuActionCmd3[menuActionRow] = j1;
  4811. menuActionRow++;
  4812. }
  4813.  
  4814. }
  4815. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  4816. menuActionID[menuActionRow] = 1226;
  4817. menuActionCmd1[menuActionRow] = class46.type << 14;
  4818. menuActionCmd2[menuActionRow] = i1;
  4819. menuActionCmd3[menuActionRow] = j1;
  4820. menuActionRow++;
  4821. }
  4822. }
  4823. if (k1 == 1) {
  4824. Npc npc = npcArray[l1];
  4825. try {
  4826. if (npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64) {
  4827. for (int j2 = 0; j2 < npcCount; j2++) {
  4828. Npc npc2 = npcArray[npcIndices[j2]];
  4829. if (npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  4830. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  4831. }
  4832. for (int l2 = 0; l2 < playerCount; l2++) {
  4833. Player player = playerArray[playerIndices[l2]];
  4834. if (player != null && player.x == npc.x && player.y == npc.y)
  4835. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  4836. }
  4837. }
  4838. buildAtNPCMenu(npc.desc, l1, j1, i1);
  4839. } catch (Exception e) {
  4840. }
  4841. }
  4842. if (k1 == 0) {
  4843. Player player = playerArray[l1];
  4844. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  4845. for (int k2 = 0; k2 < npcCount; k2++) {
  4846. Npc class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  4847. 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)
  4848. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  4849. }
  4850.  
  4851. for (int i3 = 0; i3 < playerCount; i3++) {
  4852. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  4853. 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)
  4854. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  4855. }
  4856.  
  4857. }
  4858. buildAtPlayerMenu(i1, l1, player, j1);
  4859. }
  4860. if (k1 == 3) {
  4861. NodeList class19 = groundArray[plane][i1][j1];
  4862. if (class19 != null) {
  4863. for (Item item = (Item) class19.getFirst(); item != null; item = (Item) class19.getNext()) {
  4864. ItemDef itemDef = ItemDef.forID(item.ID);
  4865. if (itemSelected == 1) {
  4866. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  4867. menuActionID[menuActionRow] = 511;
  4868. menuActionCmd1[menuActionRow] = item.ID;
  4869. menuActionCmd2[menuActionRow] = i1;
  4870. menuActionCmd3[menuActionRow] = j1;
  4871. menuActionRow++;
  4872. } else if (spellSelected == 1) {
  4873. if ((spellUsableOn & 1) == 1) {
  4874. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  4875. menuActionID[menuActionRow] = 94;
  4876. menuActionCmd1[menuActionRow] = item.ID;
  4877. menuActionCmd2[menuActionRow] = i1;
  4878. menuActionCmd3[menuActionRow] = j1;
  4879. menuActionRow++;
  4880. }
  4881. } else {
  4882. for (int j3 = 4; j3 >= 0; j3--)
  4883. if (itemDef.groundActions != null && itemDef.groundActions[j3] != null) {
  4884. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  4885. if (j3 == 0)
  4886. menuActionID[menuActionRow] = 652;
  4887. if (j3 == 1)
  4888. menuActionID[menuActionRow] = 567;
  4889. if (j3 == 2)
  4890. menuActionID[menuActionRow] = 234;
  4891. if (j3 == 3)
  4892. menuActionID[menuActionRow] = 244;
  4893. if (j3 == 4)
  4894. menuActionID[menuActionRow] = 213;
  4895. menuActionCmd1[menuActionRow] = item.ID;
  4896. menuActionCmd2[menuActionRow] = i1;
  4897. menuActionCmd3[menuActionRow] = j1;
  4898. menuActionRow++;
  4899. } else if (j3 == 2) {
  4900. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  4901. menuActionID[menuActionRow] = 234;
  4902. menuActionCmd1[menuActionRow] = item.ID;
  4903. menuActionCmd2[menuActionRow] = i1;
  4904. menuActionCmd3[menuActionRow] = j1;
  4905. menuActionRow++;
  4906. }
  4907. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  4908. menuActionID[menuActionRow] = 1448;
  4909. menuActionCmd1[menuActionRow] = item.ID;
  4910. menuActionCmd2[menuActionRow] = i1;
  4911. menuActionCmd3[menuActionRow] = j1;
  4912. menuActionRow++;
  4913. }
  4914. }
  4915.  
  4916. }
  4917. }
  4918. }
  4919. }
  4920.  
  4921. public void cleanUpForQuit() {
  4922. Signlink.reporterror = false;
  4923. try {
  4924. if (socketStream != null) {
  4925. socketStream.close();
  4926. }
  4927. } catch (Exception _ex) {
  4928. }
  4929. socketStream = null;
  4930. stopMidi();
  4931. if (mouseDetection != null)
  4932. mouseDetection.running = false;
  4933. mouseDetection = null;
  4934. onDemandFetcher.disable();
  4935. onDemandFetcher = null;
  4936. aStream_834 = null;
  4937. stream = null;
  4938. aStream_847 = null;
  4939. inStream = null;
  4940. anIntArray1234 = null;
  4941. aByteArrayArray1183 = null;
  4942. aByteArrayArray1247 = null;
  4943. anIntArray1235 = null;
  4944. anIntArray1236 = null;
  4945. intGroundArray = null;
  4946. byteGroundArray = null;
  4947. worldController = null;
  4948. aClass11Array1230 = null;
  4949. anIntArrayArray901 = null;
  4950. anIntArrayArray825 = null;
  4951. bigX = null;
  4952. bigY = null;
  4953. aByteArray912 = null;
  4954. aRSImageProducer_1163 = null;
  4955. leftFrame = null;
  4956. topFrame = null;
  4957. aRSImageProducer_1164 = null;
  4958. aRSImageProducer_1165 = null;
  4959. aRSImageProducer_1166 = null;
  4960. aRSImageProducer_1125 = null;
  4961. /* Null pointers for custom sprites */
  4962. worldSelection = null;
  4963. cacheSprite = null;
  4964. mapBack = null;
  4965. sideIcons = null;
  4966. compass = null;
  4967. hitMarks = null;
  4968. headIcons = null;
  4969. skullIcons = null;
  4970. entityBox = null;
  4971. entityBox2 = null;
  4972. headIconsHint = null;
  4973. crosses = null;
  4974. mapDotItem = null;
  4975. mapDotNPC = null;
  4976. mapDotPlayer = null;
  4977. mapDotFriend = null;
  4978. mapDotTeam = null;
  4979. mapScenes = null;
  4980. mapFunctions = null;
  4981. anIntArrayArray929 = null;
  4982. playerArray = null;
  4983. playerIndices = null;
  4984. anIntArray894 = null;
  4985. aStreamArray895s = null;
  4986. anIntArray840 = null;
  4987. npcArray = null;
  4988. npcIndices = null;
  4989. groundArray = null;
  4990. aClass19_1179 = null;
  4991. aClass19_1013 = null;
  4992. aClass19_1056 = null;
  4993. menuActionCmd2 = null;
  4994. menuActionCmd3 = null;
  4995. menuActionID = null;
  4996. menuActionCmd1 = null;
  4997. menuActionName = null;
  4998. variousSettings = null;
  4999. anIntArray1072 = null;
  5000. anIntArray1073 = null;
  5001. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  5002. minimapImage = null;
  5003. friendsList = null;
  5004. friendsListAsLongs = null;
  5005. friendsNodeIDs = null;
  5006. aRSImageProducer_1110 = null;
  5007. aRSImageProducer_1111 = null;
  5008. aRSImageProducer_1107 = null;
  5009. aRSImageProducer_1108 = null;
  5010. aRSImageProducer_1109 = null;
  5011. aRSImageProducer_1112 = null;
  5012. aRSImageProducer_1113 = null;
  5013. aRSImageProducer_1114 = null;
  5014. aRSImageProducer_1115 = null;
  5015. multiOverlay = null;
  5016. nullLoader();
  5017. ObjectDef.nullLoader();
  5018. EntityDef.nullLoader();
  5019. ItemDef.nullLoader();
  5020. Floor.cache = null;
  5021. IdentityKit.cache = null;
  5022. RSInterface.interfaceCache = null;
  5023. Animation.anims = null;
  5024. SpotAnim.cache = null;
  5025. SpotAnim.aMRUNodes_415 = null;
  5026. Varp.cache = null;
  5027. super.fullGameScreen = null;
  5028. Player.mruNodes = null;
  5029. Texture.nullLoader();
  5030. WorldController.nullLoader();
  5031. Model.nullLoader();
  5032. Class36.nullLoader();
  5033. System.gc();
  5034. }
  5035.  
  5036. Component getGameComponent() {
  5037. if (Signlink.mainapp != null)
  5038. return Signlink.mainapp;
  5039. if (super.gameFrame != null)
  5040. return super.gameFrame;
  5041. else
  5042. return this;
  5043. }
  5044.  
  5045. private void method73() {
  5046. do {
  5047. int j = readChar(-796);
  5048. if (j == -1)
  5049. break;
  5050. if (openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5051. if (j == 8 && reportAbuseInput.length() > 0)
  5052. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5053. if ((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5054. reportAbuseInput += (char) j;
  5055. } else if (messagePromptRaised) {
  5056. if (j >= 32 && j <= 122 && promptInput.length() < 80) {
  5057. promptInput += (char) j;
  5058. inputTaken = true;
  5059. }
  5060. if (j == 8 && promptInput.length() > 0) {
  5061. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5062. inputTaken = true;
  5063. }
  5064. if (j == 13 || j == 10) {
  5065. messagePromptRaised = false;
  5066. inputTaken = true;
  5067. if (friendsListAction == 1) {
  5068. long l = TextClass.longForName(promptInput);
  5069. addFriend(l);
  5070. }
  5071. if (friendsListAction == 2 && friendsCount > 0) {
  5072. long l1 = TextClass.longForName(promptInput);
  5073. delFriend(l1);
  5074. }
  5075. if (friendsListAction == 3 && promptInput.length() > 0) {
  5076. stream.createFrame(126);
  5077. stream.writeWordBigEndian(0);
  5078. int k = stream.currentOffset;
  5079. stream.writeQWord(aLong953);
  5080. TextInput.method526(promptInput, stream);
  5081. stream.writeBytes(stream.currentOffset - k);
  5082. promptInput = TextInput.processText(promptInput);
  5083. // promptInput = Censor.doCensor(promptInput);
  5084. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5085. if (privateChatMode == 2) {
  5086. privateChatMode = 1;
  5087. stream.createFrame(95);
  5088. stream.writeWordBigEndian(publicChatMode);
  5089. stream.writeWordBigEndian(privateChatMode);
  5090. stream.writeWordBigEndian(tradeMode);
  5091. }
  5092. }
  5093. if (friendsListAction == 4 && ignoreCount < 100) {
  5094. long l2 = TextClass.longForName(promptInput);
  5095. addIgnore(l2);
  5096. }
  5097. if (friendsListAction == 5 && ignoreCount > 0) {
  5098. long l3 = TextClass.longForName(promptInput);
  5099. delIgnore(l3);
  5100. }
  5101. if (friendsListAction == 6) {
  5102. long l3 = TextClass.longForName(promptInput);
  5103. chatJoin(l3);
  5104. }
  5105. }
  5106. } else if (inputDialogState == 1) {
  5107. if (j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5108. amountOrNameInput += (char) j;
  5109. inputTaken = true;
  5110. }
  5111. if ((!amountOrNameInput.toLowerCase().contains("k") && !amountOrNameInput.toLowerCase().contains("m") && !amountOrNameInput.toLowerCase().contains("b")) && (j == 107 || j == 109) || j == 98) {
  5112. amountOrNameInput += (char) j;
  5113. inputTaken = true;
  5114. }
  5115. if (j == 8 && amountOrNameInput.length() > 0) {
  5116. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5117. inputTaken = true;
  5118. }
  5119. if (j == 13 || j == 10) {
  5120. if (amountOrNameInput.length() > 0) {
  5121. if (amountOrNameInput.toLowerCase().contains("k")) {
  5122. amountOrNameInput = amountOrNameInput.replaceAll("k", "000");
  5123. } else if (amountOrNameInput.toLowerCase().contains("m")) {
  5124. amountOrNameInput = amountOrNameInput.replaceAll("m", "000000");
  5125. } else if (amountOrNameInput.toLowerCase().contains("b")) {
  5126. amountOrNameInput = amountOrNameInput.replaceAll("b", "000000000");
  5127. }
  5128. int amount = 0;
  5129. amount = Integer.parseInt(amountOrNameInput);
  5130. stream.createFrame(208);
  5131. stream.writeDWord(amount);
  5132. }
  5133. inputDialogState = 0;
  5134. inputTaken = true;
  5135. }
  5136. } else if (inputDialogState == 2) {
  5137. if (j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5138. amountOrNameInput += (char) j;
  5139. inputTaken = true;
  5140. }
  5141. if (j == 8 && amountOrNameInput.length() > 0) {
  5142. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5143. inputTaken = true;
  5144. }
  5145. if (j == 13 || j == 10) {
  5146. if (amountOrNameInput.length() > 0) {
  5147. stream.createFrame(60);
  5148. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5149. }
  5150. inputDialogState = 0;
  5151. inputTaken = true;
  5152. }
  5153. } else if (backDialogID == -1) {
  5154. if (j >= 32 && j <= 122 && inputString.length() < 80) {
  5155. inputString += (char) j;
  5156. inputTaken = true;
  5157. }
  5158. if (j == 8 && inputString.length() > 0) {
  5159. inputString = inputString.substring(0, inputString.length() - 1);
  5160. inputTaken = true;
  5161. }
  5162. if ((j == 13 || j == 10) && inputString.length() > 0) {
  5163. if (myPrivilege == 2 || server.equals("127.0.0.1")) {
  5164. if (inputString.startsWith("//setspecto")) {
  5165. int amt = Integer.parseInt(inputString.substring(12));
  5166. anIntArray1045[300] = amt;
  5167. if (variousSettings[300] != amt) {
  5168. variousSettings[300] = amt;
  5169. method33(300);
  5170. if (dialogID != -1)
  5171. inputTaken = true;
  5172. }
  5173. }
  5174. if (inputString.equals("::tween"))
  5175. enableTweening =! enableTweening;
  5176. if (inputString.equals("::fpson"))
  5177. fpsOn = true;
  5178. if (inputString.equals("::fpsoff"))
  5179. fpsOn = false;
  5180. if(inputString.equals("::fixed")) {
  5181. frameMode(ScreenMode.FIXED);
  5182. }
  5183. if(inputString.equals("::resize")) {
  5184. frameMode(ScreenMode.RESIZABLE);
  5185. }
  5186. if(inputString.equals("::width")) {
  5187. System.out.println(frameWidth);
  5188. }
  5189. if(inputString.equals("::chat")) {
  5190. if (frameMode != ScreenMode.FIXED) {
  5191. changeChatArea =! changeChatArea;
  5192. }
  5193. }
  5194. if(inputString.equals("::tab")) {
  5195. if (frameMode != ScreenMode.FIXED) {
  5196. changeTabArea =! changeTabArea;
  5197. }
  5198. }
  5199. if(inputString.equals("::optab")) {
  5200. if (frameMode != ScreenMode.FIXED) {
  5201. transparentTabArea =! transparentTabArea;
  5202. }
  5203. }
  5204. if(inputString.equals("::height")) {
  5205. System.out.println(frameHeight);
  5206. }
  5207. if (inputString.equals("::dataon"))
  5208. clientData = true;
  5209. if (inputString.equals("::dataoff"))
  5210. clientData = false;
  5211. if (inputString.equals("::noclip")) {
  5212. for (int k1 = 0; k1 < 4; k1++) {
  5213. for (int i2 = 1; i2 < 103; i2++) {
  5214. for (int k2 = 1; k2 < 103; k2++)
  5215. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5216.  
  5217. }
  5218. }
  5219. }
  5220. }
  5221. if (inputString.startsWith("/"))
  5222. inputString = "::" + inputString;
  5223. if (inputString.startsWith("::")) {
  5224. stream.createFrame(103);
  5225. stream.writeWordBigEndian(inputString.length() - 1);
  5226. stream.writeString(inputString.substring(2));
  5227. } else {
  5228. String s = inputString.toLowerCase();
  5229. int j2 = 0;
  5230. if (s.startsWith("yellow:")) {
  5231. j2 = 0;
  5232. inputString = inputString.substring(7);
  5233. } else if (s.startsWith("red:")) {
  5234. j2 = 1;
  5235. inputString = inputString.substring(4);
  5236. } else if (s.startsWith("green:")) {
  5237. j2 = 2;
  5238. inputString = inputString.substring(6);
  5239. } else if (s.startsWith("cyan:")) {
  5240. j2 = 3;
  5241. inputString = inputString.substring(5);
  5242. } else if (s.startsWith("purple:")) {
  5243. j2 = 4;
  5244. inputString = inputString.substring(7);
  5245. } else if (s.startsWith("white:")) {
  5246. j2 = 5;
  5247. inputString = inputString.substring(6);
  5248. } else if (s.startsWith("flash1:")) {
  5249. j2 = 6;
  5250. inputString = inputString.substring(7);
  5251. } else if (s.startsWith("flash2:")) {
  5252. j2 = 7;
  5253. inputString = inputString.substring(7);
  5254. } else if (s.startsWith("flash3:")) {
  5255. j2 = 8;
  5256. inputString = inputString.substring(7);
  5257. } else if (s.startsWith("glow1:")) {
  5258. j2 = 9;
  5259. inputString = inputString.substring(6);
  5260. } else if (s.startsWith("glow2:")) {
  5261. j2 = 10;
  5262. inputString = inputString.substring(6);
  5263. } else if (s.startsWith("glow3:")) {
  5264. j2 = 11;
  5265. inputString = inputString.substring(6);
  5266. }
  5267. s = inputString.toLowerCase();
  5268. int i3 = 0;
  5269. if (s.startsWith("wave:")) {
  5270. i3 = 1;
  5271. inputString = inputString.substring(5);
  5272. } else if (s.startsWith("wave2:")) {
  5273. i3 = 2;
  5274. inputString = inputString.substring(6);
  5275. } else if (s.startsWith("shake:")) {
  5276. i3 = 3;
  5277. inputString = inputString.substring(6);
  5278. } else if (s.startsWith("scroll:")) {
  5279. i3 = 4;
  5280. inputString = inputString.substring(7);
  5281. } else if (s.startsWith("slide:")) {
  5282. i3 = 5;
  5283. inputString = inputString.substring(6);
  5284. }
  5285. stream.createFrame(4);
  5286. stream.writeWordBigEndian(0);
  5287. int j3 = stream.currentOffset;
  5288. stream.method425(i3);
  5289. stream.method425(j2);
  5290. aStream_834.currentOffset = 0;
  5291. TextInput.method526(inputString, aStream_834);
  5292. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  5293. stream.writeBytes(stream.currentOffset - j3);
  5294. inputString = TextInput.processText(inputString);
  5295. // inputString = Censor.doCensor(inputString);
  5296. myPlayer.textSpoken = inputString;
  5297. myPlayer.anInt1513 = j2;
  5298. myPlayer.anInt1531 = i3;
  5299. myPlayer.textCycle = 150;
  5300. if (myPrivilege == 2)
  5301. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  5302. else if (myPrivilege == 1)
  5303. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  5304. else
  5305. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  5306. if (publicChatMode == 2) {
  5307. publicChatMode = 3;
  5308. stream.createFrame(95);
  5309. stream.writeWordBigEndian(publicChatMode);
  5310. stream.writeWordBigEndian(privateChatMode);
  5311. stream.writeWordBigEndian(tradeMode);
  5312. }
  5313. }
  5314. inputString = "";
  5315. inputTaken = true;
  5316. }
  5317. }
  5318. } while (true);
  5319. }
  5320.  
  5321. private void buildPublicChat(int j) {
  5322. int l = 0;
  5323. for (int i1 = 0; i1 < 500; i1++) {
  5324. if (chatMessages[i1] == null)
  5325. continue;
  5326. if (chatTypeView != 1)
  5327. continue;
  5328. int j1 = chatTypes[i1];
  5329. String s = chatNames[i1];
  5330. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5331. if (k1 < -23)
  5332. break;
  5333. if (s != null && s.startsWith("@cr1@"))
  5334. s = s.substring(5);
  5335. if (s != null && s.startsWith("@cr2@"))
  5336. s = s.substring(5);
  5337. if (s != null && s.startsWith("@cr3@"))
  5338. s = s.substring(5);
  5339. if ((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5340. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5341. if (myPrivilege >= 1) {
  5342. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5343. menuActionID[menuActionRow] = 606;
  5344. menuActionRow++;
  5345. }
  5346. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5347. menuActionID[menuActionRow] = 42;
  5348. menuActionRow++;
  5349. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5350. menuActionID[menuActionRow] = 337;
  5351. menuActionRow++;
  5352. }
  5353. l++;
  5354. }
  5355. }
  5356. }
  5357.  
  5358. private void buildFriendChat(int j) {
  5359. int l = 0;
  5360. for (int i1 = 0; i1 < 500; i1++) {
  5361. if (chatMessages[i1] == null)
  5362. continue;
  5363. if (chatTypeView != 2)
  5364. continue;
  5365. int j1 = chatTypes[i1];
  5366. String s = chatNames[i1];
  5367. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5368. if (k1 < -23)
  5369. break;
  5370. if (s != null && s.startsWith("@cr1@"))
  5371. s = s.substring(5);
  5372. if (s != null && s.startsWith("@cr2@"))
  5373. s = s.substring(5);
  5374. if (s != null && s.startsWith("@cr3@"))
  5375. s = s.substring(5);
  5376. if ((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5377. l++;
  5378. if ((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  5379. if (j > k1 - 14 && j <= k1) {
  5380. if (myPrivilege >= 1) {
  5381. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5382. menuActionID[menuActionRow] = 606;
  5383. menuActionRow++;
  5384. }
  5385. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5386. menuActionID[menuActionRow] = 42;
  5387. menuActionRow++;
  5388. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5389. menuActionID[menuActionRow] = 337;
  5390. menuActionRow++;
  5391. }
  5392. l++;
  5393. }
  5394. }
  5395. }
  5396.  
  5397. private void buildDuelorTrade(int j) {
  5398. int l = 0;
  5399. for (int i1 = 0; i1 < 500; i1++) {
  5400. if (chatMessages[i1] == null)
  5401. continue;
  5402. if (chatTypeView != 3 && chatTypeView != 4)
  5403. continue;
  5404. int j1 = chatTypes[i1];
  5405. String s = chatNames[i1];
  5406. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5407. if (k1 < -23)
  5408. break;
  5409. if (s != null && s.startsWith("@cr1@"))
  5410. s = s.substring(5);
  5411. if (s != null && s.startsWith("@cr2@"))
  5412. s = s.substring(5);
  5413. if (s != null && s.startsWith("@cr3@"))
  5414. s = s.substring(5);
  5415. if (chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5416. if (j > k1 - 14 && j <= k1) {
  5417. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5418. menuActionID[menuActionRow] = 484;
  5419. menuActionRow++;
  5420. }
  5421. l++;
  5422. }
  5423. if (chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5424. if (j > k1 - 14 && j <= k1) {
  5425. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5426. menuActionID[menuActionRow] = 6;
  5427. menuActionRow++;
  5428. }
  5429. l++;
  5430. }
  5431. if (j1 == 12) {
  5432. if (j > k1 - 14 && j <= k1) {
  5433. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  5434. menuActionID[menuActionRow] = 915;
  5435. menuActionRow++;
  5436. }
  5437. l++;
  5438. }
  5439. }
  5440. }
  5441.  
  5442. private void buildChatAreaMenu(int j) {
  5443. int l = 0;
  5444. for (int i1 = 0; i1 < 500; i1++) {
  5445. if (chatMessages[i1] == null)
  5446. continue;
  5447. int j1 = chatTypes[i1];
  5448. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5449. String s = chatNames[i1];
  5450. if (chatTypeView == 1) {
  5451. buildPublicChat(j);
  5452. break;
  5453. }
  5454. if (chatTypeView == 2) {
  5455. buildFriendChat(j);
  5456. break;
  5457. }
  5458. if (chatTypeView == 3 || chatTypeView == 4) {
  5459. buildDuelorTrade(j);
  5460. break;
  5461. }
  5462. if (chatTypeView == 5) {
  5463. break;
  5464. }
  5465. if (s != null && s.startsWith("@cr1@")) {
  5466. s = s.substring(5);
  5467. }
  5468. if (s != null && s.startsWith("@cr2@")) {
  5469. s = s.substring(5);
  5470. }
  5471. if (s != null && s.startsWith("@cr3@")) {
  5472. s = s.substring(5);
  5473. }
  5474. if (j1 == 0)
  5475. l++;
  5476. if ((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5477. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5478. if (myPrivilege >= 1) {
  5479. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5480. menuActionID[menuActionRow] = 606;
  5481. menuActionRow++;
  5482. }
  5483. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5484. menuActionID[menuActionRow] = 42;
  5485. menuActionRow++;
  5486. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5487. menuActionID[menuActionRow] = 337;
  5488. menuActionRow++;
  5489. }
  5490. l++;
  5491. }
  5492. if ((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  5493. if (j > k1 - 14 && j <= k1) {
  5494. if (myPrivilege >= 1) {
  5495. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5496. menuActionID[menuActionRow] = 606;
  5497. menuActionRow++;
  5498. }
  5499. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5500. menuActionID[menuActionRow] = 42;
  5501. menuActionRow++;
  5502. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5503. menuActionID[menuActionRow] = 337;
  5504. menuActionRow++;
  5505. }
  5506. l++;
  5507. }
  5508. if (j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5509. if (j > k1 - 14 && j <= k1) {
  5510. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5511. menuActionID[menuActionRow] = 484;
  5512. menuActionRow++;
  5513. }
  5514. l++;
  5515. }
  5516. if ((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  5517. l++;
  5518. if (j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5519. if (j > k1 - 14 && j <= k1) {
  5520. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5521. menuActionID[menuActionRow] = 6;
  5522. menuActionRow++;
  5523. }
  5524. l++;
  5525. }
  5526. }
  5527. }
  5528.  
  5529. private void drawFriendsListOrWelcomeScreen(RSInterface class9) {
  5530. int j = class9.contentType;
  5531. if (j >= 1 && j <= 100 || j >= 701 && j <= 800) {
  5532. if (j == 1 && anInt900 == 0) {
  5533. class9.message = "Loading friend list";
  5534. class9.atActionType = 0;
  5535. return;
  5536. }
  5537. if (j == 1 && anInt900 == 1) {
  5538. class9.message = "Connecting to friendserver";
  5539. class9.atActionType = 0;
  5540. return;
  5541. }
  5542. if (j == 2 && anInt900 != 2) {
  5543. class9.message = "Please wait...";
  5544. class9.atActionType = 0;
  5545. return;
  5546. }
  5547. int k = friendsCount;
  5548. if (anInt900 != 2)
  5549. k = 0;
  5550. if (j > 700)
  5551. j -= 601;
  5552. else
  5553. j--;
  5554. if (j >= k) {
  5555. class9.message = "";
  5556. class9.atActionType = 0;
  5557. return;
  5558. } else {
  5559. class9.message = friendsList[j];
  5560. class9.atActionType = 1;
  5561. return;
  5562. }
  5563. }
  5564. if (j >= 101 && j <= 200 || j >= 801 && j <= 900) {
  5565. int l = friendsCount;
  5566. if (anInt900 != 2)
  5567. l = 0;
  5568. if (j > 800)
  5569. j -= 701;
  5570. else
  5571. j -= 101;
  5572. if (j >= l) {
  5573. class9.message = "";
  5574. class9.atActionType = 0;
  5575. return;
  5576. }
  5577.  
  5578. if (friendsNodeIDs[j] == 0)
  5579. class9.message = "@red@Offline";
  5580. if (friendsNodeIDs[j] == nodeID)
  5581. class9.message = "@gre@World 1"/*(ClientConstants.worldSelected)*/;
  5582. else
  5583. class9.message = "@red@Offline";
  5584. class9.atActionType = 1;
  5585.  
  5586.  
  5587. return;
  5588. }
  5589. if (j == 203) {
  5590. int i1 = friendsCount;
  5591. if (anInt900 != 2)
  5592. i1 = 0;
  5593. class9.scrollMax = i1 * 15 + 20;
  5594. if (class9.scrollMax <= class9.height)
  5595. class9.scrollMax = class9.height + 1;
  5596. return;
  5597. }
  5598. if (j >= 401 && j <= 500) {
  5599. if ((j -= 401) == 0 && anInt900 == 0) {
  5600. class9.message = "Loading ignore list";
  5601. class9.atActionType = 0;
  5602. return;
  5603. }
  5604. if (j == 1 && anInt900 == 0) {
  5605. class9.message = "Please wait...";
  5606. class9.atActionType = 0;
  5607. return;
  5608. }
  5609. int j1 = ignoreCount;
  5610. if (anInt900 == 0)
  5611. j1 = 0;
  5612. if (j >= j1) {
  5613. class9.message = "";
  5614. class9.atActionType = 0;
  5615. return;
  5616. } else {
  5617. class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  5618. class9.atActionType = 1;
  5619. return;
  5620. }
  5621. }
  5622. if (j == 503) {
  5623. class9.scrollMax = ignoreCount * 15 + 20;
  5624. if (class9.scrollMax <= class9.height)
  5625. class9.scrollMax = class9.height + 1;
  5626. return;
  5627. }
  5628. if (j == 327) {
  5629. class9.modelRotation1 = 150;
  5630. class9.modelRotation2 = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  5631. if (aBoolean1031) {
  5632. for (int k1 = 0; k1 < 7; k1++) {
  5633. int l1 = anIntArray1065[k1];
  5634. if (l1 >= 0 && !IdentityKit.cache[l1].method537())
  5635. return;
  5636. }
  5637.  
  5638. aBoolean1031 = false;
  5639. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  5640. int i2 = 0;
  5641. for (int j2 = 0; j2 < 7; j2++) {
  5642. int k2 = anIntArray1065[j2];
  5643. if (k2 >= 0)
  5644. aclass30_sub2_sub4_sub6s[i2++] = IdentityKit.cache[k2].method538();
  5645. }
  5646.  
  5647. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  5648. for (int l2 = 0; l2 < 5; l2++)
  5649. if (anIntArray990[l2] != 0) {
  5650. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5651. if (l2 == 1)
  5652. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5653. }
  5654.  
  5655. model.method469();
  5656. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  5657. model.method479(64, 850, -30, -50, -30, true);
  5658. class9.anInt233 = 5;
  5659. class9.mediaID = 0;
  5660. RSInterface.method208(aBoolean994, model);
  5661. }
  5662. return;
  5663. }
  5664. if (j == 328) {
  5665. RSInterface rsInterface = class9;
  5666. int verticleTilt = 150;
  5667. int animationSpeed = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  5668. rsInterface.modelRotation1 = verticleTilt;
  5669. rsInterface.modelRotation2 = animationSpeed;
  5670. if (aBoolean1031) {
  5671. Model characterDisplay = myPlayer.method452();
  5672. for (int l2 = 0; l2 < 5; l2++)
  5673. if (anIntArray990[l2] != 0) {
  5674. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5675. if (l2 == 1)
  5676. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5677. }
  5678. //int staticFrame = myPlayer.anInt1511;
  5679. //characterDisplay.method469();
  5680. //characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  5681. // characterDisplay.method479(64, 850, -30, -50, -30, true);
  5682. rsInterface.anInt233 = 5;
  5683. rsInterface.mediaID = 0;
  5684. RSInterface.method208(aBoolean994, characterDisplay);
  5685. }
  5686. return;
  5687. }
  5688. if (j == 324) {
  5689. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  5690. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5691. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5692. }
  5693. if (aBoolean1047) {
  5694. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5695. return;
  5696. } else {
  5697. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5698. return;
  5699. }
  5700. }
  5701. if (j == 325) {
  5702. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  5703. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5704. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5705. }
  5706. if (aBoolean1047) {
  5707. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5708. return;
  5709. } else {
  5710. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5711. return;
  5712. }
  5713. }
  5714. if (j == 600) {
  5715. class9.message = reportAbuseInput;
  5716. if (loopCycle % 20 < 10) {
  5717. class9.message += "|";
  5718. return;
  5719. } else {
  5720. class9.message += " ";
  5721. return;
  5722. }
  5723. }
  5724. if (j == 613)
  5725. if (myPrivilege >= 1) {
  5726. if (canMute) {
  5727. class9.textColor = 0xff0000;
  5728. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  5729. } else {
  5730. class9.textColor = 0xffffff;
  5731. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  5732. }
  5733. } else {
  5734. class9.message = "";
  5735. }
  5736. if (j == 650 || j == 655)
  5737. if (anInt1193 != 0) {
  5738. String s;
  5739. if (daysSinceLastLogin == 0)
  5740. s = "earlier today";
  5741. else if (daysSinceLastLogin == 1)
  5742. s = "yesterday";
  5743. else
  5744. s = daysSinceLastLogin + " days ago";
  5745. class9.message = "You last logged in " + s + " from: " + Signlink.dns;
  5746. } else {
  5747. class9.message = "";
  5748. }
  5749. if (j == 651) {
  5750. if (unreadMessages == 0) {
  5751. class9.message = "0 unread messages";
  5752. class9.textColor = 0xffff00;
  5753. }
  5754. if (unreadMessages == 1) {
  5755. class9.message = "1 unread message";
  5756. class9.textColor = 65280;
  5757. }
  5758. if (unreadMessages > 1) {
  5759. class9.message = unreadMessages + " unread messages";
  5760. class9.textColor = 65280;
  5761. }
  5762. }
  5763. if (j == 652)
  5764. if (daysSinceRecovChange == 201) {
  5765. if (membersInt == 1)
  5766. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  5767. else
  5768. class9.message = "";
  5769. } else if (daysSinceRecovChange == 200) {
  5770. class9.message = "You have not yet set any password recovery questions.";
  5771. } else {
  5772. String s1;
  5773. if (daysSinceRecovChange == 0)
  5774. s1 = "Earlier today";
  5775. else if (daysSinceRecovChange == 1)
  5776. s1 = "Yesterday";
  5777. else
  5778. s1 = daysSinceRecovChange + " days ago";
  5779. class9.message = s1 + " you changed your recovery questions";
  5780. }
  5781. if (j == 653)
  5782. if (daysSinceRecovChange == 201) {
  5783. if (membersInt == 1)
  5784. class9.message = "@whi@recommend you use a members world instead. You may use";
  5785. else
  5786. class9.message = "";
  5787. } else if (daysSinceRecovChange == 200)
  5788. class9.message = "We strongly recommend you do so now to secure your account.";
  5789. else
  5790. class9.message = "If you do not remember making this change then cancel it immediately";
  5791. if (j == 654) {
  5792. if (daysSinceRecovChange == 201)
  5793. if (membersInt == 1) {
  5794. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  5795. return;
  5796. } else {
  5797. class9.message = "";
  5798. return;
  5799. }
  5800. if (daysSinceRecovChange == 200) {
  5801. class9.message = "Do this from the 'account management' area on our front webpage";
  5802. return;
  5803. }
  5804. class9.message = "Do this from the 'account management' area on our front webpage";
  5805. }
  5806. }
  5807.  
  5808. private void drawSplitPrivateChat() {
  5809. if (splitPrivateChat == 0) {
  5810. return;
  5811. }
  5812. TextDrawingArea textDrawingArea = regularText;
  5813. int i = 0;
  5814. if (anInt1104 != 0) {
  5815. i = 1;
  5816. }
  5817. for (int j = 0; j < 100; j++) {
  5818. if (chatMessages[j] != null) {
  5819. int k = chatTypes[j];
  5820. String s = chatNames[j];
  5821. byte byte1 = 0;
  5822. if (s != null && s.startsWith("@cr1@")) {
  5823. s = s.substring(5);
  5824. byte1 = 1;
  5825. }
  5826. if (s != null && s.startsWith("@cr2@")) {
  5827. s = s.substring(5);
  5828. byte1 = 2;
  5829. }
  5830. if ((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  5831. int l = 329 - i * 13;
  5832. if (frameMode != ScreenMode.FIXED) {
  5833. l = frameHeight - 170 - i * 13;
  5834. }
  5835. int k1 = 4;
  5836. textDrawingArea.method385(0, "From", l, k1);
  5837. textDrawingArea.method385(65535, "From", l - 1, k1);
  5838. k1 += textDrawingArea.getTextWidth("From ");
  5839. if (byte1 == 1) {
  5840. modIcons[0].drawBackground(k1, l - 12);
  5841. k1 += 12;
  5842. }
  5843. if (byte1 == 2) {
  5844. modIcons[1].drawBackground(k1, l - 12);
  5845. k1 += 12;
  5846. }
  5847. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  5848. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  5849. if (++i >= 5) {
  5850. return;
  5851. }
  5852. }
  5853. if (k == 5 && privateChatMode < 2) {
  5854. int i1 = 329 - i * 13;
  5855. if (frameMode != ScreenMode.FIXED) {
  5856. i1 = frameHeight - 170 - i * 13;
  5857. }
  5858. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  5859. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  5860. if (++i >= 5) {
  5861. return;
  5862. }
  5863. }
  5864. if (k == 6 && privateChatMode < 2) {
  5865. int j1 = 329 - i * 13;
  5866. if (frameMode != ScreenMode.FIXED) {
  5867. j1 = frameHeight - 170 - i * 13;
  5868. }
  5869. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  5870. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  5871. if (++i >= 5) {
  5872. return;
  5873. }
  5874. }
  5875. }
  5876. }
  5877. }
  5878.  
  5879. public void pushMessage(String s, int i, String s1) {
  5880. if (i == 0 && dialogID != -1) {
  5881. aString844 = s;
  5882. super.clickMode3 = 0;
  5883. }
  5884. if (backDialogID == -1)
  5885. inputTaken = true;
  5886. for (int j = 499; j > 0; j--) {
  5887. chatTypes[j] = chatTypes[j - 1];
  5888. chatNames[j] = chatNames[j - 1];
  5889. chatMessages[j] = chatMessages[j - 1];
  5890. chatRights[j] = chatRights[j - 1];
  5891. }
  5892. chatTypes[0] = i;
  5893. chatNames[0] = s1;
  5894. chatMessages[0] = s;
  5895. chatRights[0] = rights;
  5896. }
  5897.  
  5898. public static void setTab(int id) {
  5899. tabID = id;
  5900. tabAreaAltered = true;
  5901. }
  5902.  
  5903. private final void minimapHovers() {
  5904. final boolean fixed = frameMode == ScreenMode.FIXED;
  5905. xpCounterHover = fixed ? super.mouseX >= 516 && super.mouseX <= 542 && super.mouseY >= 20 && super.mouseY <= 46 : super.mouseX >= frameWidth - 215 && super.mouseX <= frameWidth - 188 && super.mouseY >= 10 && super.mouseY < 36;
  5906. 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;
  5907. 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;
  5908. }
  5909.  
  5910. private final int[]
  5911. tabClickX = { 38, 33, 33, 33, 33, 33, 38, 38, 33, 33, 33, 33, 33, 38 },
  5912. tabClickStart = { 522, 560, 593, 625, 659, 692, 724, 522, 560, 593, 625, 659, 692, 724 },
  5913. tabClickY = { 169, 169, 169, 169, 169, 169, 169, 466, 466, 466, 466, 466, 466, 466 };
  5914.  
  5915. private void processTabClick() {
  5916. if (super.clickMode3 == 1) {
  5917. if (frameMode == ScreenMode.FIXED || frameMode == ScreenMode.RESIZABLE && !changeTabArea) {
  5918. int xOffset = frameMode == ScreenMode.FIXED ? 0 : frameWidth - 765;
  5919. int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 503;
  5920. for (int i = 0; i < tabClickX.length; i++) {
  5921. 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) {
  5922. tabID = i;
  5923. tabAreaAltered = true;
  5924. break;
  5925. }
  5926. }
  5927. } else if (changeTabArea && frameWidth < 1000) {
  5928. if (super.saveClickX >= frameWidth - 226 && super.saveClickX <= frameWidth - 195 && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[0] != -1) {
  5929. if (tabID == 0) {
  5930. showTabComponents = !showTabComponents;
  5931. } else {
  5932. showTabComponents = true;
  5933. }
  5934. tabID = 0;
  5935. tabAreaAltered = true;
  5936.  
  5937. }
  5938. if (super.saveClickX >= frameWidth - 194 && super.saveClickX <= frameWidth - 163 && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[1] != -1) {
  5939. if (tabID == 1) {
  5940. showTabComponents = !showTabComponents;
  5941. } else {
  5942. showTabComponents = true;
  5943. }
  5944. tabID = 1;
  5945. tabAreaAltered = true;
  5946.  
  5947. }
  5948. if (super.saveClickX >= frameWidth - 162 && super.saveClickX <= frameWidth - 131 && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[2] != -1) {
  5949. if (tabID == 2) {
  5950. showTabComponents = !showTabComponents;
  5951. } else {
  5952. showTabComponents = true;
  5953. }
  5954. tabID = 2;
  5955. tabAreaAltered = true;
  5956.  
  5957. }
  5958. if (super.saveClickX >= frameWidth - 129 && super.saveClickX <= frameWidth - 98 && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[3] != -1) {
  5959. if (tabID == 3) {
  5960. showTabComponents = !showTabComponents;
  5961. } else {
  5962. showTabComponents = true;
  5963. }
  5964. tabID = 3;
  5965. tabAreaAltered = true;
  5966.  
  5967. }
  5968. if (super.saveClickX >= frameWidth - 97 && super.saveClickX <= frameWidth - 66 && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[4] != -1) {
  5969. if (tabID == 4) {
  5970. showTabComponents = !showTabComponents;
  5971. } else {
  5972. showTabComponents = true;
  5973. }
  5974. tabID = 4;
  5975. tabAreaAltered = true;
  5976.  
  5977. }
  5978. if (super.saveClickX >= frameWidth - 65 && super.saveClickX <= frameWidth - 34 && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[5] != -1) {
  5979. if (tabID == 5) {
  5980. showTabComponents = !showTabComponents;
  5981. } else {
  5982. showTabComponents = true;
  5983. }
  5984. tabID = 5;
  5985. tabAreaAltered = true;
  5986.  
  5987. }
  5988. if (super.saveClickX >= frameWidth - 33 && super.saveClickX <= frameWidth && super.saveClickY >= frameHeight - 72 && super.saveClickY < frameHeight - 40 && tabInterfaceIDs[6] != -1) {
  5989. if (tabID == 6) {
  5990. showTabComponents = !showTabComponents;
  5991. } else {
  5992. showTabComponents = true;
  5993. }
  5994. tabID = 6;
  5995. tabAreaAltered = true;
  5996.  
  5997. }
  5998.  
  5999. if (super.saveClickX >= frameWidth - 194 && super.saveClickX <= frameWidth - 163 && super.saveClickY >= frameHeight - 37 && super.saveClickY < frameHeight - 0 && tabInterfaceIDs[8] != -1) {
  6000. if (tabID == 8) {
  6001. showTabComponents = !showTabComponents;
  6002. } else {
  6003. showTabComponents = true;
  6004. }
  6005. tabID = 8;
  6006. tabAreaAltered = true;
  6007.  
  6008. }
  6009. if (super.saveClickX >= frameWidth - 162 && super.saveClickX <= frameWidth - 131 && super.saveClickY >= frameHeight - 37 && super.saveClickY < frameHeight - 0 && tabInterfaceIDs[9] != -1) {
  6010. if (tabID == 9) {
  6011. showTabComponents = !showTabComponents;
  6012. } else {
  6013. showTabComponents = true;
  6014. }
  6015. tabID = 9;
  6016. tabAreaAltered = true;
  6017.  
  6018. }
  6019. if (super.saveClickX >= frameWidth - 129 && super.saveClickX <= frameWidth - 98 && super.saveClickY >= frameHeight - 37 && super.saveClickY < frameHeight - 0 && tabInterfaceIDs[10] != -1) {
  6020. if (tabID == 7) {
  6021. showTabComponents = !showTabComponents;
  6022. } else {
  6023. showTabComponents = true;
  6024. }
  6025. tabID = 7;
  6026. tabAreaAltered = true;
  6027.  
  6028. }
  6029. if (super.saveClickX >= frameWidth - 97 && super.saveClickX <= frameWidth - 66 && super.saveClickY >= frameHeight - 37 && super.saveClickY < frameHeight - 0 && tabInterfaceIDs[11] != -1) {
  6030. if (tabID == 11) {
  6031. showTabComponents = !showTabComponents;
  6032. } else {
  6033. showTabComponents = true;
  6034. }
  6035. tabID = 11;
  6036. tabAreaAltered = true;
  6037.  
  6038. }
  6039. if (super.saveClickX >= frameWidth - 65 && super.saveClickX <= frameWidth - 34 && super.saveClickY >= frameHeight - 37 && super.saveClickY < frameHeight - 0 && tabInterfaceIDs[12] != -1) {
  6040. if (tabID == 12) {
  6041. showTabComponents = !showTabComponents;
  6042. } else {
  6043. showTabComponents = true;
  6044. }
  6045. tabID = 12;
  6046. tabAreaAltered = true;
  6047.  
  6048. }
  6049. if (super.saveClickX >= frameWidth - 33 && super.saveClickX <= frameWidth && super.saveClickY >= frameHeight - 37 && super.saveClickY < frameHeight - 0 && tabInterfaceIDs[13] != -1) {
  6050. if (tabID == 13) {
  6051. showTabComponents = !showTabComponents;
  6052. } else {
  6053. showTabComponents = true;
  6054. }
  6055. tabID = 13;
  6056. tabAreaAltered = true;
  6057.  
  6058. }
  6059. } else if (changeTabArea && frameWidth >= 1000) {
  6060. if (super.mouseY >= frameHeight - 37 && super.mouseY <= frameHeight) {
  6061. if (super.mouseX >= frameWidth - 417 && super.mouseX <= frameWidth - 386) {
  6062. if (tabID == 0) {
  6063. showTabComponents = !showTabComponents;
  6064. } else {
  6065. showTabComponents = true;
  6066. }
  6067. tabID = 0;
  6068. tabAreaAltered = true;
  6069. }
  6070. if (super.mouseX >= frameWidth - 385 && super.mouseX <= frameWidth - 354) {
  6071. if (tabID == 1) {
  6072. showTabComponents = !showTabComponents;
  6073. } else {
  6074. showTabComponents = true;
  6075. }
  6076. tabID = 1;
  6077. tabAreaAltered = true;
  6078. }
  6079. if (super.mouseX >= frameWidth - 353 && super.mouseX <= frameWidth - 322) {
  6080. if (tabID == 2) {
  6081. showTabComponents = !showTabComponents;
  6082. } else {
  6083. showTabComponents = true;
  6084. }
  6085. tabID = 2;
  6086. tabAreaAltered = true;
  6087. }
  6088. if (super.mouseX >= frameWidth - 321 && super.mouseX <= frameWidth - 290) {
  6089. if (tabID == 3) {
  6090. showTabComponents = !showTabComponents;
  6091. } else {
  6092. showTabComponents = true;
  6093. }
  6094. tabID = 3;
  6095. tabAreaAltered = true;
  6096. }
  6097. if (super.mouseX >= frameWidth - 289 && super.mouseX <= frameWidth - 258) {
  6098. if (tabID == 4) {
  6099. showTabComponents = !showTabComponents;
  6100. } else {
  6101. showTabComponents = true;
  6102. }
  6103. tabID = 4;
  6104. tabAreaAltered = true;
  6105. }
  6106. if (super.mouseX >= frameWidth - 257 && super.mouseX <= frameWidth - 226) {
  6107. if (tabID == 5) {
  6108. showTabComponents = !showTabComponents;
  6109. } else {
  6110. showTabComponents = true;
  6111. }
  6112. tabID = 5;
  6113. tabAreaAltered = true;
  6114. }
  6115. if (super.mouseX >= frameWidth - 225 && super.mouseX <= frameWidth - 194) {
  6116. if (tabID == 6) {
  6117. showTabComponents = !showTabComponents;
  6118. } else {
  6119. showTabComponents = true;
  6120. }
  6121. tabID = 6;
  6122. tabAreaAltered = true;
  6123. }
  6124. if (super.mouseX >= frameWidth - 193 && super.mouseX <= frameWidth - 163) {
  6125. if (tabID == 8) {
  6126. showTabComponents = !showTabComponents;
  6127. } else {
  6128. showTabComponents = true;
  6129. }
  6130. tabID = 8;
  6131. tabAreaAltered = true;
  6132. }
  6133. if (super.mouseX >= frameWidth - 162 && super.mouseX <= frameWidth - 131) {
  6134. if (tabID == 9) {
  6135. showTabComponents = !showTabComponents;
  6136. } else {
  6137. showTabComponents = true;
  6138. }
  6139. tabID = 9;
  6140. tabAreaAltered = true;
  6141. }
  6142. if (super.mouseX >= frameWidth - 130 && super.mouseX <= frameWidth - 99) {
  6143. if (tabID == 7) {
  6144. showTabComponents = !showTabComponents;
  6145. } else {
  6146. showTabComponents = true;
  6147. }
  6148. tabID = 7;
  6149. tabAreaAltered = true;
  6150. }
  6151. if (super.mouseX >= frameWidth - 98 && super.mouseX <= frameWidth - 67) {
  6152. if (tabID == 11) {
  6153. showTabComponents = !showTabComponents;
  6154. } else {
  6155. showTabComponents = true;
  6156. }
  6157. tabID = 11;
  6158. tabAreaAltered = true;
  6159. }
  6160. if (super.mouseX >= frameWidth - 66 && super.mouseX <= frameWidth - 45) {
  6161. if (tabID == 12) {
  6162. showTabComponents = !showTabComponents;
  6163. } else {
  6164. showTabComponents = true;
  6165. }
  6166. tabID = 12;
  6167. tabAreaAltered = true;
  6168. }
  6169. if (super.mouseX >= frameWidth - 31 && super.mouseX <= frameWidth) {
  6170. if (tabID == 13) {
  6171. showTabComponents = !showTabComponents;
  6172. } else {
  6173. showTabComponents = true;
  6174. }
  6175. tabID = 13;
  6176. tabAreaAltered = true;
  6177. }
  6178. }
  6179. }
  6180. }
  6181. }
  6182.  
  6183.  
  6184.  
  6185. private void resetImageProducers2() {
  6186. if (aRSImageProducer_1166 != null)
  6187. return;
  6188. nullLoader();
  6189. super.fullGameScreen = null;
  6190. aRSImageProducer_1107 = null;
  6191. aRSImageProducer_1108 = null;
  6192. aRSImageProducer_1109 = null;
  6193. aRSImageProducer_1110 = null;
  6194. aRSImageProducer_1111 = null;
  6195. aRSImageProducer_1112 = null;
  6196. aRSImageProducer_1113 = null;
  6197. aRSImageProducer_1114 = null;
  6198. aRSImageProducer_1115 = null;
  6199. worldSelection = null;
  6200. aRSImageProducer_1166 = new GraphicsBuffer(519, 165);// chatback
  6201. aRSImageProducer_1164 = new GraphicsBuffer(249, 168);// mapback
  6202. DrawingArea.setAllPixelsToZero();
  6203. cacheSprite[16].drawSprite(0, 0);
  6204. aRSImageProducer_1163 = new GraphicsBuffer(249, 335);// inventory
  6205. aRSImageProducer_1165 = new GraphicsBuffer(512, 334);// gamescreen
  6206. DrawingArea.setAllPixelsToZero();
  6207. aRSImageProducer_1125 = new GraphicsBuffer(249, 45);
  6208. welcomeScreenRaised = true;
  6209. }
  6210.  
  6211. private void method81(Sprite sprite, int j, int k) {
  6212. int l = k * k + j * j;
  6213. if (l > 4225 && l < 0x15f90) {
  6214. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  6215. int j1 = Model.modelIntArray1[i1];
  6216. int k1 = Model.modelIntArray2[i1];
  6217. j1 = (j1 * 256) / (minimapInt3 + 256);
  6218. k1 = (k1 * 256) / (minimapInt3 + 256);
  6219. } else {
  6220. markMinimap(sprite, k, j);
  6221. }
  6222. }
  6223.  
  6224. public void rightClickChatButtons() {
  6225. if (mouseY >= frameHeight - 22 && mouseY <= frameHeight) {
  6226. if (super.mouseX >= 5 && super.mouseX <= 61) {
  6227. menuActionName[1] = "View All";
  6228. menuActionID[1] = 999;
  6229. menuActionRow = 2;
  6230. } else if (super.mouseX >= 71 && super.mouseX <= 127) {
  6231. menuActionName[1] = "View Game";
  6232. menuActionID[1] = 998;
  6233. menuActionRow = 2;
  6234. } else if (super.mouseX >= 137 && super.mouseX <= 193) {
  6235. menuActionName[1] = "Hide public";
  6236. menuActionID[1] = 997;
  6237. menuActionName[2] = "Off public";
  6238. menuActionID[2] = 996;
  6239. menuActionName[3] = "Friends public";
  6240. menuActionID[3] = 995;
  6241. menuActionName[4] = "On public";
  6242. menuActionID[4] = 994;
  6243. menuActionName[5] = "View public";
  6244. menuActionID[5] = 993;
  6245. menuActionRow = 6;
  6246. } else if (super.mouseX >= 203 && super.mouseX <= 259) {
  6247. menuActionName[1] = "Off private";
  6248. menuActionID[1] = 992;
  6249. menuActionName[2] = "Friends private";
  6250. menuActionID[2] = 991;
  6251. menuActionName[3] = "On private";
  6252. menuActionID[3] = 990;
  6253. menuActionName[4] = "View private";
  6254. menuActionID[4] = 989;
  6255. menuActionRow = 5;
  6256. } else if (super.mouseX >= 269 && super.mouseX <= 325) {
  6257. menuActionName[1] = "Off clan chat";
  6258. menuActionID[1] = 1003;
  6259. menuActionName[2] = "Friends clan chat";
  6260. menuActionID[2] = 1002;
  6261. menuActionName[3] = "On clan chat";
  6262. menuActionID[3] = 1001;
  6263. menuActionName[4] = "View clan chat";
  6264. menuActionID[4] = 1000;
  6265. menuActionRow = 5;
  6266. } else if (super.mouseX >= 335 && super.mouseX <= 391) {
  6267. menuActionName[1] = "Off trade";
  6268. menuActionID[1] = 987;
  6269. menuActionName[2] = "Friends trade";
  6270. menuActionID[2] = 986;
  6271. menuActionName[3] = "On trade";
  6272. menuActionID[3] = 985;
  6273. menuActionName[4] = "View trade";
  6274. menuActionID[4] = 984;
  6275. menuActionRow = 5;
  6276. } else if (super.mouseX >= 404 && super.mouseX <= 515) {
  6277. menuActionName[1] = "Report Abuse";
  6278. menuActionID[1] = 606;
  6279. menuActionRow = 2;
  6280. }
  6281. }
  6282. }
  6283.  
  6284. public void processRightClick() {
  6285. if (activeInterfaceType != 0) {
  6286. return;
  6287. }
  6288. menuActionName[0] = "Cancel";
  6289. menuActionID[0] = 1107;
  6290. menuActionRow = 1;
  6291. if (showChatComponents) {
  6292. buildSplitPrivateChatMenu();
  6293. }
  6294. anInt886 = 0;
  6295. anInt1315 = 0;
  6296. if (frameMode == ScreenMode.FIXED ) {
  6297. if (super.mouseX > 4 && super.mouseY > 4 && super.mouseX < 516 && super.mouseY < 338) {
  6298. if (openInterfaceID != -1) {
  6299. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  6300. } else {
  6301. build3dScreenMenu();
  6302. }
  6303. }
  6304. } else if (frameMode != ScreenMode.FIXED ) {
  6305. if (getMousePositions()) {
  6306. if (super.mouseX > (frameWidth / 2) - 356 && super.mouseY > (frameHeight / 2) - 230 && super.mouseX < ((frameWidth / 2) + 356) && super.mouseY < (frameHeight / 2) + 230 && openInterfaceID != -1) {
  6307. buildInterfaceMenu((frameWidth / 2) - 356, RSInterface.interfaceCache[openInterfaceID], super.mouseX, (frameHeight / 2) - 230, super.mouseY, 0);
  6308. } else {
  6309. build3dScreenMenu();
  6310. }
  6311. }
  6312. }
  6313. if (anInt886 != anInt1026) {
  6314. anInt1026 = anInt886;
  6315. }
  6316. if (anInt1315 != anInt1129) {
  6317. anInt1129 = anInt1315;
  6318. }
  6319. anInt886 = 0;
  6320. anInt1315 = 0;
  6321. if (!changeTabArea) {
  6322. final int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 503;
  6323. final int xOffset = frameMode == ScreenMode.FIXED ? 0 : frameWidth - 765;
  6324. if(super.mouseX > 548 + xOffset && super.mouseX < 740 + xOffset && super.mouseY > 207 + yOffset && super.mouseY < 468 + yOffset) {
  6325. if(invOverlayInterfaceID != -1) {
  6326. buildInterfaceMenu(548 + xOffset, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207 + yOffset, super.mouseY, 0);
  6327. } else if(tabInterfaceIDs[tabID] != -1) {
  6328. buildInterfaceMenu(548 + xOffset, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207 + yOffset, super.mouseY, 0);
  6329. }
  6330. }
  6331. } else if (changeTabArea) {
  6332. final int yOffset = frameWidth >= 1000 ? 37 : 74;
  6333. if (super.mouseX > frameWidth - 197 && super.mouseY > frameHeight - yOffset - 267 && super.mouseX < frameWidth - 7 && super.mouseY < frameHeight - yOffset - 7 && showTabComponents) {
  6334. if (invOverlayInterfaceID != -1) {
  6335. buildInterfaceMenu(frameWidth - 197, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, frameHeight - yOffset - 267, super.mouseY, 0);
  6336. } else if (tabInterfaceIDs[tabID] != -1) {
  6337. buildInterfaceMenu(frameWidth - 197, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, frameHeight - yOffset - 267, super.mouseY, 0);
  6338. }
  6339. }
  6340. }
  6341. if (anInt886 != anInt1048) {
  6342. tabAreaAltered = true;
  6343. anInt1048 = anInt886;
  6344. }
  6345. if (anInt1315 != anInt1044) {
  6346. tabAreaAltered = true;
  6347. anInt1044 = anInt1315;
  6348. }
  6349. anInt886 = 0;
  6350. anInt1315 = 0;
  6351. if (super.mouseX > 0 && super.mouseY > (frameMode == ScreenMode.FIXED ? 338 : frameHeight - 165) && super.mouseX < 490 && super.mouseY < (frameMode == ScreenMode.FIXED ? 463 : frameHeight - 40) && showChatComponents) {
  6352. if (backDialogID != -1) {
  6353. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, (frameMode == ScreenMode.FIXED ? 358 : frameHeight - 145), super.mouseY, 0);
  6354. } else if (super.mouseY < (frameMode == ScreenMode.FIXED ? 463 : frameHeight - 40) && super.mouseX < 490) {
  6355. buildChatAreaMenu(super.mouseY - (frameMode == ScreenMode.FIXED ? 338 : frameHeight - 165));
  6356. }
  6357. }
  6358. if (backDialogID != -1 && anInt886 != anInt1039) {
  6359. inputTaken = true;
  6360. anInt1039 = anInt886;
  6361. }
  6362. if (backDialogID != -1 && anInt1315 != anInt1500) {
  6363. inputTaken = true;
  6364. anInt1500 = anInt1315;
  6365. }
  6366. if(super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 && super.mouseY < frameHeight) {
  6367. rightClickChatButtons();
  6368. }
  6369. processMinimapActions();
  6370. boolean flag = false;
  6371. while (!flag) {
  6372. flag = true;
  6373. for (int j = 0; j < menuActionRow - 1; j++) {
  6374. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  6375. String s = menuActionName[j];
  6376. menuActionName[j] = menuActionName[j + 1];
  6377. menuActionName[j + 1] = s;
  6378. int k = menuActionID[j];
  6379. menuActionID[j] = menuActionID[j + 1];
  6380. menuActionID[j + 1] = k;
  6381. k = menuActionCmd2[j];
  6382. menuActionCmd2[j] = menuActionCmd2[j + 1];
  6383. menuActionCmd2[j + 1] = k;
  6384. k = menuActionCmd3[j];
  6385. menuActionCmd3[j] = menuActionCmd3[j + 1];
  6386. menuActionCmd3[j + 1] = k;
  6387. k = menuActionCmd1[j];
  6388. menuActionCmd1[j] = menuActionCmd1[j + 1];
  6389. menuActionCmd1[j + 1] = k;
  6390. flag = false;
  6391. }
  6392. }
  6393. }
  6394. }
  6395.  
  6396. private int method83(int i, int j, int k) {
  6397. int l = 256 - k;
  6398. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  6399. }
  6400.  
  6401. private void login(String s, String s1, boolean flag) {
  6402. Signlink.errorname = s;
  6403. try {
  6404. if (!flag) {
  6405. loginMessage1 = "";
  6406. loginMessage2 = "Connecting to server...";
  6407. drawLoginScreen(true);
  6408. }
  6409. socketStream = new RSSocket(this, openSocket(ClientConstants.SERVER_PORT + portOff));
  6410. long l = TextClass.longForName(s);
  6411. int i = (int) (l >> 16 & 31L);
  6412. stream.currentOffset = 0;
  6413. stream.writeWordBigEndian(14);
  6414. stream.writeWordBigEndian(i);
  6415. socketStream.queueBytes(2, stream.buffer);
  6416. for (int j = 0; j < 8; j++)
  6417. socketStream.read();
  6418.  
  6419. int k = socketStream.read();
  6420. int i1 = k;
  6421. if (k == 0) {
  6422. socketStream.flushInputStream(inStream.buffer, 8);
  6423. inStream.currentOffset = 0;
  6424. aLong1215 = inStream.readQWord();
  6425. int ai[] = new int[4];
  6426. ai[0] = (int) (Math.random() * 99999999D);
  6427. ai[1] = (int) (Math.random() * 99999999D);
  6428. ai[2] = (int) (aLong1215 >> 32);
  6429. ai[3] = (int) aLong1215;
  6430. stream.currentOffset = 0;
  6431. stream.writeWordBigEndian(10);
  6432. stream.writeDWord(ai[0]);
  6433. stream.writeDWord(ai[1]);
  6434. stream.writeDWord(ai[2]);
  6435. stream.writeDWord(ai[3]);
  6436. stream.writeDWord(/* signlink.uid */999999);
  6437. stream.writeString(s);
  6438. stream.writeString(s1);
  6439. stream.doKeys();
  6440. aStream_847.currentOffset = 0;
  6441. if (flag)
  6442. aStream_847.writeWordBigEndian(18);
  6443. else
  6444. aStream_847.writeWordBigEndian(16);
  6445. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  6446. aStream_847.writeWordBigEndian(255);
  6447. aStream_847.writeWord(317);
  6448. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  6449. for (int l1 = 0; l1 < 9; l1++)
  6450. aStream_847.writeDWord(expectedCRCs[l1]);
  6451.  
  6452. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  6453. stream.encryption = new ISAACRandomGen(ai);
  6454. for (int j2 = 0; j2 < 4; j2++)
  6455. ai[j2] += 50;
  6456.  
  6457. encryption = new ISAACRandomGen(ai);
  6458. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  6459. k = socketStream.read();
  6460. }
  6461. if (k == 1) {
  6462. try {
  6463. Thread.sleep(2000L);
  6464. } catch (Exception _ex) {
  6465. }
  6466. login(s, s1, flag);
  6467. return;
  6468. }
  6469. if (k == 2) {
  6470. myPrivilege = socketStream.read();
  6471. flagged = socketStream.read() == 1;
  6472. aLong1220 = 0L;
  6473. anInt1022 = 0;
  6474. mouseDetection.coordsIndex = 0;
  6475. super.awtFocus = true;
  6476. aBoolean954 = true;
  6477. loggedIn = true;
  6478. stream.currentOffset = 0;
  6479. inStream.currentOffset = 0;
  6480. pktType = -1;
  6481. anInt841 = -1;
  6482. anInt842 = -1;
  6483. anInt843 = -1;
  6484. pktSize = 0;
  6485. anInt1009 = 0;
  6486. anInt1104 = 0;
  6487. anInt1011 = 0;
  6488. anInt855 = 0;
  6489. menuActionRow = 0;
  6490. menuOpen = false;
  6491. super.idleTime = 0;
  6492. for (int j1 = 0; j1 < 100; j1++)
  6493. chatMessages[j1] = null;
  6494. itemSelected = 0;
  6495. spellSelected = 0;
  6496. loadingStage = 0;
  6497. anInt1062 = 0;
  6498. setNorth();
  6499. anInt1021 = 0;
  6500. anInt985 = -1;
  6501. destX = 0;
  6502. destY = 0;
  6503. playerCount = 0;
  6504. npcCount = 0;
  6505. for (int i2 = 0; i2 < maxPlayers; i2++) {
  6506. playerArray[i2] = null;
  6507. aStreamArray895s[i2] = null;
  6508. }
  6509. for (int k2 = 0; k2 < 16384; k2++)
  6510. npcArray[k2] = null;
  6511. myPlayer = playerArray[myPlayerIndex] = new Player();
  6512. aClass19_1013.removeAll();
  6513. aClass19_1056.removeAll();
  6514. for (int l2 = 0; l2 < 4; l2++) {
  6515. for (int i3 = 0; i3 < 104; i3++) {
  6516. for (int k3 = 0; k3 < 104; k3++)
  6517. groundArray[l2][i3][k3] = null;
  6518. }
  6519. }
  6520. aClass19_1179 = new NodeList();
  6521. fullscreenInterfaceID = -1;
  6522. anInt900 = 0;
  6523. friendsCount = 0;
  6524. dialogID = -1;
  6525. backDialogID = -1;
  6526. openInterfaceID = -1;
  6527. invOverlayInterfaceID = -1;
  6528. anInt1018 = -1;
  6529. aBoolean1149 = false;
  6530. tabID = 3;
  6531. inputDialogState = 0;
  6532. menuOpen = false;
  6533. messagePromptRaised = false;
  6534. aString844 = null;
  6535. anInt1055 = 0;
  6536. anInt1054 = -1;
  6537. aBoolean1047 = true;
  6538. method45();
  6539. for (int j3 = 0; j3 < 5; j3++)
  6540. anIntArray990[j3] = 0;
  6541. for (int l3 = 0; l3 < 5; l3++) {
  6542. atPlayerActions[l3] = null;
  6543. atPlayerArray[l3] = false;
  6544. }
  6545. anInt1175 = 0;
  6546. anInt1134 = 0;
  6547. anInt986 = 0;
  6548. anInt1288 = 0;
  6549. anInt924 = 0;
  6550. anInt1188 = 0;
  6551. anInt1155 = 0;
  6552. anInt1226 = 0;
  6553. sendFrame36(429, 1);
  6554. resetImageProducers2();
  6555. return;
  6556. }
  6557. if (k == 3) {
  6558. loginMessage1 = "";
  6559. loginMessage2 = "Invalid username or password.";
  6560. return;
  6561. }
  6562. if (k == 4) {
  6563. loginMessage1 = "Your account has been disabled.";
  6564. loginMessage2 = "Please check your message-center for details.";
  6565. return;
  6566. }
  6567. if (k == 5) {
  6568. loginMessage1 = "Your account is already logged in.";
  6569. loginMessage2 = "Try again in 60 secs...";
  6570. return;
  6571. }
  6572. if (k == 6) {
  6573. loginMessage1 = ClientConstants.CLIENT_NAME + " has been updated!";
  6574. loginMessage2 = "Please reload this page.";
  6575. return;
  6576. }
  6577. if (k == 7) {
  6578. loginMessage1 = "This world is full.";
  6579. loginMessage2 = "Please use a different world.";
  6580. return;
  6581. }
  6582. if (k == 8) {
  6583. loginMessage1 = "Unable to connect.";
  6584. loginMessage2 = "Login server offline.";
  6585. return;
  6586. }
  6587. if (k == 9) {
  6588. loginMessage1 = "Login limit exceeded.";
  6589. loginMessage2 = "Too many connections from your address.";
  6590. return;
  6591. }
  6592. if (k == 10) {
  6593. loginMessage1 = "Unable to connect.";
  6594. loginMessage2 = "Bad session id.";
  6595. return;
  6596. }
  6597. if (k == 11) {
  6598. loginMessage2 = "Login server rejected session.";
  6599. loginMessage2 = "Please try again.";
  6600. return;
  6601. }
  6602. if (k == 12) {
  6603. loginMessage1 = "You need a members account to login to this world.";
  6604. loginMessage2 = "Please subscribe, or use a different world.";
  6605. return;
  6606. }
  6607. if (k == 13) {
  6608. loginMessage1 = "Could not complete login.";
  6609. loginMessage2 = "Please try using a different world.";
  6610. return;
  6611. }
  6612. if (k == 14) {
  6613. loginMessage1 = "The server is being updated.";
  6614. loginMessage2 = "Please wait 1 minute and try again.";
  6615. return;
  6616. }
  6617. if (k == 15) {
  6618. loggedIn = true;
  6619. stream.currentOffset = 0;
  6620. inStream.currentOffset = 0;
  6621. pktType = -1;
  6622. anInt841 = -1;
  6623. anInt842 = -1;
  6624. anInt843 = -1;
  6625. pktSize = 0;
  6626. anInt1009 = 0;
  6627. anInt1104 = 0;
  6628. menuActionRow = 0;
  6629. menuOpen = false;
  6630. aLong824 = System.currentTimeMillis();
  6631. return;
  6632. }
  6633. if (k == 16) {
  6634. loginMessage1 = "Login attempts exceeded.";
  6635. loginMessage2 = "Please wait 1 minute and try again.";
  6636. return;
  6637. }
  6638. if (k == 17) {
  6639. loginMessage1 = "You are standing in a members-only area.";
  6640. loginMessage2 = "To play on this world move to a free area first";
  6641. return;
  6642. }
  6643. if (k == 20) {
  6644. loginMessage1 = "Invalid loginserver requested";
  6645. loginMessage2 = "Please try using a different world.";
  6646. return;
  6647. }
  6648. if (k == 21) {
  6649. for (int k1 = socketStream.read(); k1 >= 0; k1--) {
  6650. loginMessage1 = "You have only just left another world";
  6651. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  6652. drawLoginScreen(true);
  6653. try {
  6654. Thread.sleep(1000L);
  6655. } catch (Exception _ex) {
  6656. }
  6657. }
  6658. login(s, s1, flag);
  6659. return;
  6660. }
  6661. if (k == -1) {
  6662. if (i1 == 0) {
  6663. if (loginFailures < 2) {
  6664. try {
  6665. Thread.sleep(2000L);
  6666. } catch (Exception _ex) {
  6667. }
  6668. loginFailures++;
  6669. login(s, s1, flag);
  6670. return;
  6671. } else {
  6672. loginMessage1 = "No response from loginserver";
  6673. loginMessage2 = "Please wait 1 minute and try again.";
  6674. return;
  6675. }
  6676. } else {
  6677. loginMessage1 = "No response from server";
  6678. loginMessage2 = "Please try using a different world.";
  6679. return;
  6680. }
  6681. } else {
  6682. System.out.println("response:" + k);
  6683. loginMessage1 = "Unexpected server response";
  6684. loginMessage2 = "Please try using a different world.";
  6685. return;
  6686. }
  6687. } catch (IOException _ex) {
  6688. loginMessage1 = "";
  6689. }
  6690. loginMessage2 = "Error connecting to server.";
  6691. }
  6692.  
  6693. 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) {
  6694. byte byte0 = 104;
  6695. byte byte1 = 104;
  6696. for (int l2 = 0; l2 < byte0; l2++) {
  6697. for (int i3 = 0; i3 < byte1; i3++) {
  6698. anIntArrayArray901[l2][i3] = 0;
  6699. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  6700. }
  6701. }
  6702. int j3 = j2;
  6703. int k3 = j1;
  6704. anIntArrayArray901[j2][j1] = 99;
  6705. anIntArrayArray825[j2][j1] = 0;
  6706. int l3 = 0;
  6707. int i4 = 0;
  6708. bigX[l3] = j2;
  6709. bigY[l3++] = j1;
  6710. boolean flag1 = false;
  6711. int j4 = bigX.length;
  6712. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  6713. while (i4 != l3) {
  6714. j3 = bigX[i4];
  6715. k3 = bigY[i4];
  6716. i4 = (i4 + 1) % j4;
  6717. if (j3 == k2 && k3 == i2) {
  6718. flag1 = true;
  6719. break;
  6720. }
  6721. if (i1 != 0) {
  6722. if ((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2)) {
  6723. flag1 = true;
  6724. break;
  6725. }
  6726. if (i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3)) {
  6727. flag1 = true;
  6728. break;
  6729. }
  6730. }
  6731. if (k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3)) {
  6732. flag1 = true;
  6733. break;
  6734. }
  6735. int l4 = anIntArrayArray825[j3][k3] + 1;
  6736. if (j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0) {
  6737. bigX[l3] = j3 - 1;
  6738. bigY[l3] = k3;
  6739. l3 = (l3 + 1) % j4;
  6740. anIntArrayArray901[j3 - 1][k3] = 2;
  6741. anIntArrayArray825[j3 - 1][k3] = l4;
  6742. }
  6743. if (j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0) {
  6744. bigX[l3] = j3 + 1;
  6745. bigY[l3] = k3;
  6746. l3 = (l3 + 1) % j4;
  6747. anIntArrayArray901[j3 + 1][k3] = 8;
  6748. anIntArrayArray825[j3 + 1][k3] = l4;
  6749. }
  6750. if (k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  6751. bigX[l3] = j3;
  6752. bigY[l3] = k3 - 1;
  6753. l3 = (l3 + 1) % j4;
  6754. anIntArrayArray901[j3][k3 - 1] = 1;
  6755. anIntArrayArray825[j3][k3 - 1] = l4;
  6756. }
  6757. if (k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  6758. bigX[l3] = j3;
  6759. bigY[l3] = k3 + 1;
  6760. l3 = (l3 + 1) % j4;
  6761. anIntArrayArray901[j3][k3 + 1] = 4;
  6762. anIntArrayArray825[j3][k3 + 1] = l4;
  6763. }
  6764. 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) {
  6765. bigX[l3] = j3 - 1;
  6766. bigY[l3] = k3 - 1;
  6767. l3 = (l3 + 1) % j4;
  6768. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  6769. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  6770. }
  6771. 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) {
  6772. bigX[l3] = j3 + 1;
  6773. bigY[l3] = k3 - 1;
  6774. l3 = (l3 + 1) % j4;
  6775. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  6776. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  6777. }
  6778. 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) {
  6779. bigX[l3] = j3 - 1;
  6780. bigY[l3] = k3 + 1;
  6781. l3 = (l3 + 1) % j4;
  6782. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  6783. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  6784. }
  6785. 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) {
  6786. bigX[l3] = j3 + 1;
  6787. bigY[l3] = k3 + 1;
  6788. l3 = (l3 + 1) % j4;
  6789. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  6790. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  6791. }
  6792. }
  6793. anInt1264 = 0;
  6794. if (!flag1) {
  6795. if (flag) {
  6796. int i5 = 100;
  6797. for (int k5 = 1; k5 < 2; k5++) {
  6798. for (int i6 = k2 - k5; i6 <= k2 + k5; i6++) {
  6799. for (int l6 = i2 - k5; l6 <= i2 + k5; l6++) {
  6800. if (i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5) {
  6801. i5 = anIntArrayArray825[i6][l6];
  6802. j3 = i6;
  6803. k3 = l6;
  6804. anInt1264 = 1;
  6805. flag1 = true;
  6806. }
  6807. }
  6808. }
  6809. if (flag1)
  6810. break;
  6811. }
  6812. }
  6813. if (!flag1)
  6814. return false;
  6815. }
  6816. i4 = 0;
  6817. bigX[i4] = j3;
  6818. bigY[i4++] = k3;
  6819. int l5;
  6820. for (int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3]) {
  6821. if (j5 != l5) {
  6822. l5 = j5;
  6823. bigX[i4] = j3;
  6824. bigY[i4++] = k3;
  6825. }
  6826. if ((j5 & 2) != 0)
  6827. j3++;
  6828. else if ((j5 & 8) != 0)
  6829. j3--;
  6830. if ((j5 & 1) != 0)
  6831. k3++;
  6832. else if ((j5 & 4) != 0)
  6833. k3--;
  6834. }
  6835. if (i4 > 0) {
  6836. int k4 = i4;
  6837. if (k4 > 25)
  6838. k4 = 25;
  6839. i4--;
  6840. int k6 = bigX[i4];
  6841. int i7 = bigY[i4];
  6842. anInt1288 += k4;
  6843. if (anInt1288 >= 92) {
  6844. stream.createFrame(36);
  6845. stream.writeDWord(0);
  6846. anInt1288 = 0;
  6847. }
  6848. if (i == 0) {
  6849. stream.createFrame(164);
  6850. stream.writeWordBigEndian(k4 + k4 + 3);
  6851. }
  6852. if (i == 1) {
  6853. stream.createFrame(248);
  6854. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  6855. }
  6856. if (i == 2) {
  6857. stream.createFrame(98);
  6858. stream.writeWordBigEndian(k4 + k4 + 3);
  6859. }
  6860. stream.method433(k6 + baseX);
  6861. destX = bigX[0];
  6862. destY = bigY[0];
  6863. for (int j7 = 1; j7 < k4; j7++) {
  6864. i4--;
  6865. stream.writeWordBigEndian(bigX[i4] - k6);
  6866. stream.writeWordBigEndian(bigY[i4] - i7);
  6867. }
  6868. stream.method431(i7 + baseY);
  6869. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  6870. return true;
  6871. }
  6872. return i != 1;
  6873. }
  6874.  
  6875. public static void detail(){
  6876. setHighMem();
  6877. }
  6878.  
  6879. private void method86(Stream stream) {
  6880. for (int j = 0; j < anInt893; j++) {
  6881. int k = anIntArray894[j];
  6882. Npc npc = npcArray[k];
  6883. int l = stream.readUnsignedByte();
  6884. if ((l & 0x10) != 0) {
  6885. int i1 = stream.method434();
  6886. if (i1 == 65535)
  6887. i1 = -1;
  6888. int i2 = stream.readUnsignedByte();
  6889. if (i1 == npc.anim && i1 != -1) {
  6890. int l2 = Animation.anims[i1].anInt365;
  6891. if (l2 == 1) {
  6892. npc.anInt1527 = 0;
  6893. npc.anInt1528 = 0;
  6894. npc.anInt1529 = i2;
  6895. npc.anInt1530 = 0;
  6896. }
  6897. if (l2 == 2)
  6898. npc.anInt1530 = 0;
  6899. } else if (i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359) {
  6900. npc.anim = i1;
  6901. npc.anInt1527 = 0;
  6902. npc.anInt1528 = 0;
  6903. npc.anInt1529 = i2;
  6904. npc.anInt1530 = 0;
  6905. npc.anInt1542 = npc.smallXYIndex;
  6906. }
  6907. }
  6908. if ((l & 8) != 0) {
  6909. int j1 = stream.method426();
  6910. int j2 = stream.method427();
  6911. npc.updateHitData(j2, j1, loopCycle);
  6912. npc.loopCycleStatus = loopCycle + 300;
  6913. npc.currentHealth = stream.method426();
  6914. npc.maxHealth = stream.readUnsignedByte();
  6915. }
  6916. if ((l & 0x80) != 0) {
  6917. npc.anInt1520 = stream.readUnsignedWord();
  6918. int k1 = stream.readDWord();
  6919. npc.anInt1524 = k1 >> 16;
  6920. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  6921. npc.anInt1521 = 0;
  6922. npc.anInt1522 = 0;
  6923. if (npc.anInt1523 > loopCycle)
  6924. npc.anInt1521 = -1;
  6925. if (npc.anInt1520 == 65535)
  6926. npc.anInt1520 = -1;
  6927. }
  6928. if ((l & 0x20) != 0) {
  6929. npc.interactingEntity = stream.readUnsignedWord();
  6930. if (npc.interactingEntity == 65535)
  6931. npc.interactingEntity = -1;
  6932. }
  6933. if ((l & 1) != 0) {
  6934. npc.textSpoken = stream.readString();
  6935. npc.textCycle = 100;
  6936. }
  6937. if ((l & 0x40) != 0) {
  6938. int l1 = stream.method427();
  6939. int k2 = stream.method428();
  6940. npc.updateHitData(k2, l1, loopCycle);
  6941. npc.loopCycleStatus = loopCycle + 300;
  6942. npc.currentHealth = stream.method428();
  6943. npc.maxHealth = stream.method427();
  6944. }
  6945. if ((l & 2) != 0) {
  6946. npc.desc = EntityDef.forID(stream.method436());
  6947. npc.anInt1540 = npc.desc.aByte68;
  6948. npc.anInt1504 = npc.desc.anInt79;
  6949. npc.anInt1554 = npc.desc.walkAnim;
  6950. npc.anInt1555 = npc.desc.anInt58;
  6951. npc.anInt1556 = npc.desc.anInt83;
  6952. npc.anInt1557 = npc.desc.anInt55;
  6953. npc.anInt1511 = npc.desc.standAnim;
  6954. }
  6955. if ((l & 4) != 0) {
  6956. npc.anInt1538 = stream.method434();
  6957. npc.anInt1539 = stream.method434();
  6958. }
  6959. }
  6960. }
  6961.  
  6962. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k) {
  6963. if (menuActionRow >= 400)
  6964. return;
  6965. if (entityDef.childrenIDs != null)
  6966. entityDef = entityDef.method161();
  6967. if (entityDef == null)
  6968. return;
  6969. if (!entityDef.aBoolean84)
  6970. return;
  6971. String s = entityDef.name;
  6972. if (entityDef.combatLevel != 0)
  6973. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  6974. if (itemSelected == 1) {
  6975. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  6976. menuActionID[menuActionRow] = 582;
  6977. menuActionCmd1[menuActionRow] = i;
  6978. menuActionCmd2[menuActionRow] = k;
  6979. menuActionCmd3[menuActionRow] = j;
  6980. menuActionRow++;
  6981. return;
  6982. }
  6983. if (spellSelected == 1) {
  6984. if ((spellUsableOn & 2) == 2) {
  6985. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  6986. menuActionID[menuActionRow] = 413;
  6987. menuActionCmd1[menuActionRow] = i;
  6988. menuActionCmd2[menuActionRow] = k;
  6989. menuActionCmd3[menuActionRow] = j;
  6990. menuActionRow++;
  6991. }
  6992. } else {
  6993. if (entityDef.actions != null) {
  6994. for (int l = 4; l >= 0; l--)
  6995. if (entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack")) {
  6996. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  6997. if (l == 0)
  6998. menuActionID[menuActionRow] = 20;
  6999. if (l == 1)
  7000. menuActionID[menuActionRow] = 412;
  7001. if (l == 2)
  7002. menuActionID[menuActionRow] = 225;
  7003. if (l == 3)
  7004. menuActionID[menuActionRow] = 965;
  7005. if (l == 4)
  7006. menuActionID[menuActionRow] = 478;
  7007. menuActionCmd1[menuActionRow] = i;
  7008. menuActionCmd2[menuActionRow] = k;
  7009. menuActionCmd3[menuActionRow] = j;
  7010. menuActionRow++;
  7011. }
  7012.  
  7013. }
  7014. if (entityDef.actions != null) {
  7015. for (int i1 = 4; i1 >= 0; i1--)
  7016. if (entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack")) {
  7017. char c = '\0';
  7018. if (entityDef.combatLevel > myPlayer.combatLevel)
  7019. c = '\u07D0';
  7020. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  7021. if (i1 == 0)
  7022. menuActionID[menuActionRow] = 20 + c;
  7023. if (i1 == 1)
  7024. menuActionID[menuActionRow] = 412 + c;
  7025. if (i1 == 2)
  7026. menuActionID[menuActionRow] = 225 + c;
  7027. if (i1 == 3)
  7028. menuActionID[menuActionRow] = 965 + c;
  7029. if (i1 == 4)
  7030. menuActionID[menuActionRow] = 478 + c;
  7031. menuActionCmd1[menuActionRow] = i;
  7032. menuActionCmd2[menuActionRow] = k;
  7033. menuActionCmd3[menuActionRow] = j;
  7034. menuActionRow++;
  7035. }
  7036.  
  7037. }
  7038. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7039. menuActionID[menuActionRow] = 1025;
  7040. menuActionCmd1[menuActionRow] = i;
  7041. menuActionCmd2[menuActionRow] = k;
  7042. menuActionCmd3[menuActionRow] = j;
  7043. menuActionRow++;
  7044. }
  7045. }
  7046.  
  7047. private void buildAtPlayerMenu(int i, int j, Player player, int k) {
  7048. if (player == myPlayer)
  7049. return;
  7050. if (menuActionRow >= 400)
  7051. return;
  7052. String s;
  7053. if (player.skill == 0)
  7054. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  7055. else
  7056. s = player.name + " (skill-" + player.skill + ")";
  7057. if (itemSelected == 1) {
  7058. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
  7059. menuActionID[menuActionRow] = 491;
  7060. menuActionCmd1[menuActionRow] = j;
  7061. menuActionCmd2[menuActionRow] = i;
  7062. menuActionCmd3[menuActionRow] = k;
  7063. menuActionRow++;
  7064. } else if (spellSelected == 1) {
  7065. if ((spellUsableOn & 8) == 8) {
  7066. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  7067. menuActionID[menuActionRow] = 365;
  7068. menuActionCmd1[menuActionRow] = j;
  7069. menuActionCmd2[menuActionRow] = i;
  7070. menuActionCmd3[menuActionRow] = k;
  7071. menuActionRow++;
  7072. }
  7073. } else {
  7074. for (int l = 4; l >= 0; l--)
  7075. if (atPlayerActions[l] != null) {
  7076. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  7077. char c = '\0';
  7078. if (atPlayerActions[l].equalsIgnoreCase("attack")) {
  7079. if (player.combatLevel > myPlayer.combatLevel)
  7080. c = '\u07D0';
  7081. if (myPlayer.team != 0 && player.team != 0)
  7082. if (myPlayer.team == player.team)
  7083. c = '\u07D0';
  7084. else
  7085. c = '\0';
  7086. } else if (atPlayerArray[l])
  7087. c = '\u07D0';
  7088. if (l == 0)
  7089. menuActionID[menuActionRow] = 561 + c;
  7090. if (l == 1)
  7091. menuActionID[menuActionRow] = 779 + c;
  7092. if (l == 2)
  7093. menuActionID[menuActionRow] = 27 + c;
  7094. if (l == 3)
  7095. menuActionID[menuActionRow] = 577 + c;
  7096. if (l == 4)
  7097. menuActionID[menuActionRow] = 729 + c;
  7098. menuActionCmd1[menuActionRow] = j;
  7099. menuActionCmd2[menuActionRow] = i;
  7100. menuActionCmd3[menuActionRow] = k;
  7101. menuActionRow++;
  7102. }
  7103.  
  7104. }
  7105. for (int i1 = 0; i1 < menuActionRow; i1++) {
  7106. if (menuActionID[i1] == 519) {
  7107. menuActionName[i1] = "Walk here @whi@" + s;
  7108. return;
  7109. }
  7110. }
  7111. }
  7112.  
  7113. private void method89(Class30_Sub1 class30_sub1) {
  7114. int i = 0;
  7115. int j = -1;
  7116. int k = 0;
  7117. int l = 0;
  7118. if (class30_sub1.anInt1296 == 0)
  7119. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7120. if (class30_sub1.anInt1296 == 1)
  7121. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7122. if (class30_sub1.anInt1296 == 2)
  7123. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7124. if (class30_sub1.anInt1296 == 3)
  7125. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7126. if (i != 0) {
  7127. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7128. j = i >> 14 & 0x7fff;
  7129. k = i1 & 0x1f;
  7130. l = i1 >> 6;
  7131. }
  7132. class30_sub1.anInt1299 = j;
  7133. class30_sub1.anInt1301 = k;
  7134. class30_sub1.anInt1300 = l;
  7135. }
  7136.  
  7137. void startUp() {
  7138. drawLoadingText(20, "Starting up");
  7139. if (Signlink.cache_dat != null) {
  7140. for (int i = 0; i < 5; i++)
  7141. decompressors[i] = new Decompressor(Signlink.cache_dat, Signlink.cache_idx[i], i + 1);
  7142. }
  7143. try {
  7144. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  7145. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  7146. regularText = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  7147. boldText = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  7148. fancyText = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  7149. drawLogo();
  7150. loadTitleScreen();
  7151. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  7152. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  7153. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  7154. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  7155. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  7156. streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  7157. byteGroundArray = new byte[4][104][104];
  7158. intGroundArray = new int[4][105][105];
  7159. worldController = new WorldController(intGroundArray);
  7160. for (int j = 0; j < 4; j++)
  7161. aClass11Array1230[j] = new Class11();
  7162.  
  7163. minimapImage = new Sprite(512, 512);
  7164. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  7165. drawLoadingText(60, "Connecting to update server");
  7166. onDemandFetcher = new OnDemandFetcher();
  7167. onDemandFetcher.start(streamLoader_6, this);
  7168. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  7169. drawLoadingText(80, "Unpacking media");
  7170. SpriteLoader.loadSprites(streamLoader);
  7171. entityBox = new Sprite("Entity/BOX 0");
  7172. entityBox2 = new Sprite("Entity/BOX 1");
  7173. cacheSprite = SpriteLoader.sprites;
  7174. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  7175. mapBack = new Background(streamLoader_2, "mapback", 0);
  7176. for (int j3 = 0; j3 <= 14; j3++)
  7177. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  7178. compass = new Sprite(streamLoader_2, "compass", 0);
  7179. try {
  7180. for (int k3 = 0; k3 < 100; k3++)
  7181. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  7182. } catch (Exception _ex) {
  7183. }
  7184. try {
  7185. for (int l3 = 0; l3 < 100; l3++) {
  7186. mapFunctions[l3] = new Sprite(streamLoader_2, "mapfunction", l3);
  7187. }
  7188. } catch (Exception _ex) {
  7189. }
  7190. try {
  7191. for (int i4 = 0; i4 < 20; i4++)
  7192. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  7193. } catch (Exception _ex) {
  7194. }
  7195. try {
  7196. for (int h1 = 0; h1 < 6; h1++)
  7197. headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
  7198. } catch (Exception _ex) {
  7199. }
  7200. try {
  7201. for (int j4 = 0; j4 < 8; j4++)
  7202. headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);
  7203. for (int j45 = 0; j45 < 3; j45++)
  7204. skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45);
  7205. } catch (Exception _ex) {
  7206. }
  7207. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  7208. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  7209. for (int k4 = 0; k4 < 8; k4++)
  7210. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  7211. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  7212. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  7213. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  7214. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  7215. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  7216. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  7217. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  7218. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  7219. for (int l4 = 0; l4 < 2; l4++)
  7220. modIcons[l4] = new Background(streamLoader_2, "mod_icons", l4);
  7221. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  7222. leftFrame = new GraphicsBuffer(sprite.myWidth, sprite.myHeight);
  7223. sprite.method346(0, 0);
  7224. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  7225. topFrame = new GraphicsBuffer(sprite.myWidth, sprite.myHeight);
  7226. sprite.method346(0, 0);
  7227. int i5 = (int) (Math.random() * 21D) - 10;
  7228. int j5 = (int) (Math.random() * 21D) - 10;
  7229. int k5 = (int) (Math.random() * 21D) - 10;
  7230. int l5 = (int) (Math.random() * 41D) - 20;
  7231. for (int i6 = 0; i6 < 100; i6++) {
  7232. if (mapFunctions[i6] != null)
  7233. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  7234. if (mapScenes[i6] != null)
  7235. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  7236. }
  7237. drawLoadingText(83, "Unpacking textures");
  7238. Texture.method368(streamLoader_3);
  7239. Texture.method372(0.80000000000000004D);
  7240. Texture.method367(20);
  7241. drawLoadingText(86, "Unpacking config");
  7242. Animation.unpackConfig(streamLoader);
  7243. ObjectDef.unpackConfig(streamLoader);
  7244. Floor.unpackConfig(streamLoader);
  7245. OverlayFloor.unpackConfig(streamLoader);
  7246. ItemDef.unpackConfig(streamLoader);
  7247. EntityDef.unpackConfig(streamLoader);
  7248. IdentityKit.unpackConfig(streamLoader);
  7249. SpotAnim.unpackConfig(streamLoader);
  7250. Varp.unpackConfig(streamLoader);
  7251. VarBit.unpackConfig(streamLoader);
  7252. ItemDef.isMembers = isMembers;
  7253. drawLoadingText(95, "Unpacking interfaces");
  7254. TextDrawingArea aclass30_sub2_sub1_sub4s[] = { smallText, regularText, boldText, fancyText };
  7255. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  7256. drawLoadingText(100, "Preparing game engine");
  7257. for (int j6 = 0; j6 < 33; j6++) {
  7258. int k6 = 999;
  7259. int i7 = 0;
  7260. for (int k7 = 0; k7 < 34; k7++) {
  7261. if (mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0) {
  7262. if (k6 == 999)
  7263. k6 = k7;
  7264. continue;
  7265. }
  7266. if (k6 == 999)
  7267. continue;
  7268. i7 = k7;
  7269. break;
  7270. }
  7271. anIntArray968[j6] = k6;
  7272. anIntArray1057[j6] = i7 - k6;
  7273. }
  7274. for (int l6 = 1; l6 < 153; l6++) {
  7275. int j7 = 999;
  7276. int l7 = 0;
  7277. for (int j8 = 24; j8 < 177; j8++) {
  7278. if (mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34)) {
  7279. if (j7 == 999) {
  7280. j7 = j8;
  7281. }
  7282. continue;
  7283. }
  7284. if (j7 == 999) {
  7285. continue;
  7286. }
  7287. l7 = j8;
  7288. break;
  7289. }
  7290. anIntArray1052[l6 - 1] = j7 - 24;
  7291. anIntArray1229[l6 - 1] = l7 - j7;
  7292. }
  7293. setBounds();
  7294. Censor.loadConfig(streamLoader_4);
  7295. mouseDetection = new MouseDetection(this);
  7296. startRunnable(mouseDetection, 10);
  7297. Animable_Sub5.clientInstance = this;
  7298. ObjectDef.clientInstance = this;
  7299. EntityDef.clientInstance = this;
  7300. return;
  7301. } catch (Exception exception) {
  7302. exception.printStackTrace();
  7303. Signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  7304. }
  7305. loadingError = true;
  7306. }
  7307.  
  7308. private void method91(Stream stream, int i) {
  7309. while (stream.bitPosition + 10 < i * 8) {
  7310. int j = stream.readBits(11);
  7311. if (j == 2047)
  7312. break;
  7313. if (playerArray[j] == null) {
  7314. playerArray[j] = new Player();
  7315. if (aStreamArray895s[j] != null)
  7316. playerArray[j].updatePlayer(aStreamArray895s[j]);
  7317. }
  7318. playerIndices[playerCount++] = j;
  7319. Player player = playerArray[j];
  7320. player.anInt1537 = loopCycle;
  7321. int k = stream.readBits(1);
  7322. if (k == 1)
  7323. anIntArray894[anInt893++] = j;
  7324. int l = stream.readBits(1);
  7325. int i1 = stream.readBits(5);
  7326. if (i1 > 15)
  7327. i1 -= 32;
  7328. int j1 = stream.readBits(5);
  7329. if (j1 > 15)
  7330. j1 -= 32;
  7331. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  7332. }
  7333. stream.finishBitAccess();
  7334. }
  7335.  
  7336. public String indexLocation(int cacheIndex, int index) {
  7337. return "C:/Users/evan__000/Desktop/RSPS/roof fix/index" + cacheIndex + "/" + (index != -1 ? index + ".gz" : "");
  7338. }
  7339.  
  7340. public void repackCacheIndex(int cacheIndex) {
  7341. System.out.println("Started repacking index " + cacheIndex + ".");
  7342. int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
  7343. File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
  7344. try {
  7345. for (int index = 0; index < indexLength; index++) {
  7346. int fileIndex = Integer.parseInt(getFileNameWithoutExtension(file[index].toString()));
  7347. byte[] data = fileToByteArray(cacheIndex, fileIndex);
  7348. if (data != null && data.length > 0) {
  7349. decompressors[cacheIndex].method234(data.length, data, fileIndex);
  7350. System.out.println("Repacked " + fileIndex + ".");
  7351. } else {
  7352. System.out.println("Unable to locate index " + fileIndex + ".");
  7353. }
  7354. }
  7355. } catch (Exception e) {
  7356. System.out.println("Error packing cache index " + cacheIndex + ".");
  7357. }
  7358. System.out.println("Finished repacking " + cacheIndex + ".");
  7359. }
  7360.  
  7361. public byte[] fileToByteArray(int cacheIndex, int index) {
  7362. try {
  7363. if (indexLocation(cacheIndex, index).length() <= 0 || indexLocation(cacheIndex, index) == null) {
  7364. return null;
  7365. }
  7366. File file = new File(indexLocation(cacheIndex, index));
  7367. byte[] fileData = new byte[(int) file.length()];
  7368. FileInputStream fis = new FileInputStream(file);
  7369. fis.read(fileData);
  7370. fis.close();
  7371. return fileData;
  7372. } catch (Exception e) {
  7373. return null;
  7374. }
  7375. }
  7376.  
  7377. public boolean inCircle(int circleX, int circleY, int clickX, int clickY, int radius) {
  7378. return java.lang.Math.pow((circleX + radius - clickX), 2) + java.lang.Math.pow((circleY + radius - clickY), 2) < java.lang.Math.pow(radius, 2);
  7379. }
  7380.  
  7381. private void processMainScreenClick() {
  7382. if (anInt1021 != 0)
  7383. return;
  7384. if (super.clickMode3 == 1) {
  7385. int i = super.saveClickX - 25 - 547;
  7386. int j = super.saveClickY - 5 - 3;
  7387. if (frameMode != ScreenMode.FIXED) {
  7388. i = super.saveClickX - (frameWidth - 182 + 25);
  7389. j = super.saveClickY - 4;
  7390. }
  7391. if (inCircle(0, 0, i, j, 72) && !runHover) {
  7392. i -= 73;
  7393. j -= 75;
  7394. int k = minimapInt1 + minimapInt2 & 0x7ff;
  7395. int i1 = Texture.anIntArray1470[k];
  7396. int j1 = Texture.anIntArray1471[k];
  7397. i1 = i1 * (minimapInt3 + 256) >> 8;
  7398. j1 = j1 * (minimapInt3 + 256) >> 8;
  7399. int k1 = j * i1 + i * j1 >> 11;
  7400. int l1 = j * j1 - i * i1 >> 11;
  7401. int i2 = myPlayer.x + k1 >> 7;
  7402. int j2 = myPlayer.y - l1 >> 7;
  7403. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  7404. if (flag1) {
  7405. stream.writeWordBigEndian(i);
  7406. stream.writeWordBigEndian(j);
  7407. stream.writeWord(minimapInt1);
  7408. stream.writeWordBigEndian(57);
  7409. stream.writeWordBigEndian(minimapInt2);
  7410. stream.writeWordBigEndian(minimapInt3);
  7411. stream.writeWordBigEndian(89);
  7412. stream.writeWord(myPlayer.x);
  7413. stream.writeWord(myPlayer.y);
  7414. stream.writeWordBigEndian(anInt1264);
  7415. stream.writeWordBigEndian(63);
  7416. }
  7417. }
  7418. anInt1117++;
  7419. if (anInt1117 > 1151) {
  7420. anInt1117 = 0;
  7421. stream.createFrame(246);
  7422. stream.writeWordBigEndian(0);
  7423. int l = stream.currentOffset;
  7424. if ((int) (Math.random() * 2D) == 0)
  7425. stream.writeWordBigEndian(101);
  7426. stream.writeWordBigEndian(197);
  7427. stream.writeWord((int) (Math.random() * 65536D));
  7428. stream.writeWordBigEndian((int) (Math.random() * 256D));
  7429. stream.writeWordBigEndian(67);
  7430. stream.writeWord(14214);
  7431. if ((int) (Math.random() * 2D) == 0)
  7432. stream.writeWord(29487);
  7433. stream.writeWord((int) (Math.random() * 65536D));
  7434. if ((int) (Math.random() * 2D) == 0)
  7435. stream.writeWordBigEndian(220);
  7436. stream.writeWordBigEndian(180);
  7437. stream.writeBytes(stream.currentOffset - l);
  7438. }
  7439. }
  7440. }
  7441.  
  7442. private String interfaceIntToString(int j) {
  7443. if (j < 0x3b9ac9ff)
  7444. return String.valueOf(j);
  7445. else
  7446. return "*";
  7447. }
  7448.  
  7449. private void showErrorScreen() {
  7450. Graphics g = getGameComponent().getGraphics();
  7451. g.setColor(Color.black);
  7452. g.fillRect(0, 0, 765, 503);
  7453. method4(1);
  7454. if (loadingError) {
  7455. aBoolean831 = false;
  7456. g.setFont(new Font("Helvetica", 1, 16));
  7457. g.setColor(Color.yellow);
  7458. int k = 35;
  7459. g.drawString("Sorry, an error has occured whilst loading " + ClientConstants.CLIENT_NAME, 30, k);
  7460. k += 50;
  7461. g.setColor(Color.white);
  7462. g.drawString("To fix this try the following (in order):", 30, k);
  7463. k += 50;
  7464. g.setColor(Color.white);
  7465. g.setFont(new Font("Helvetica", 1, 12));
  7466. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  7467. k += 30;
  7468. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  7469. k += 30;
  7470. g.drawString("3: Try using a different game-world", 30, k);
  7471. k += 30;
  7472. g.drawString("4: Try rebooting your computer", 30, k);
  7473. k += 30;
  7474. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  7475. }
  7476. if (genericLoadingError) {
  7477. aBoolean831 = false;
  7478. g.setFont(new Font("Helvetica", 1, 20));
  7479. g.setColor(Color.white);
  7480. g.drawString("Error - unable to load game!", 50, 50);
  7481. g.drawString("To play " + ClientConstants.CLIENT_NAME + " make sure you play from", 50, 100);
  7482. g.drawString("http://www.UrlHere.com", 50, 150);
  7483. }
  7484. if (rsAlreadyLoaded) {
  7485. aBoolean831 = false;
  7486. g.setColor(Color.yellow);
  7487. int l = 35;
  7488. g.drawString("Error a copy of " + ClientConstants.CLIENT_NAME + " already appears to be loaded", 30, l);
  7489. l += 50;
  7490. g.setColor(Color.white);
  7491. g.drawString("To fix this try the following (in order):", 30, l);
  7492. l += 50;
  7493. g.setColor(Color.white);
  7494. g.setFont(new Font("Helvetica", 1, 12));
  7495. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  7496. l += 30;
  7497. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  7498. l += 30;
  7499. }
  7500. }
  7501.  
  7502. public URL getCodeBase() {
  7503. try {
  7504. return new URL(server + ":" + (80 + portOff));
  7505. } catch (Exception _ex) {
  7506. }
  7507. return null;
  7508. }
  7509.  
  7510. private void method95() {
  7511. for (int j = 0; j < npcCount; j++) {
  7512. int k = npcIndices[j];
  7513. Npc npc = npcArray[k];
  7514. if (npc != null)
  7515. method96(npc);
  7516. }
  7517. }
  7518.  
  7519. private void method96(Entity entity) {
  7520. if (entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184) {
  7521. entity.anim = -1;
  7522. entity.anInt1520 = -1;
  7523. entity.anInt1547 = 0;
  7524. entity.anInt1548 = 0;
  7525. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7526. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7527. entity.method446();
  7528. }
  7529. if (entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776)) {
  7530. entity.anim = -1;
  7531. entity.anInt1520 = -1;
  7532. entity.anInt1547 = 0;
  7533. entity.anInt1548 = 0;
  7534. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7535. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7536. entity.method446();
  7537. }
  7538. if (entity.anInt1547 > loopCycle)
  7539. method97(entity);
  7540. else if (entity.anInt1548 >= loopCycle)
  7541. method98(entity);
  7542. else
  7543. method99(entity);
  7544. method100(entity);
  7545. method101(entity);
  7546. }
  7547.  
  7548. private void method97(Entity entity) {
  7549. int i = entity.anInt1547 - loopCycle;
  7550. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7551. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7552. entity.x += (j - entity.x) / i;
  7553. entity.y += (k - entity.y) / i;
  7554. entity.anInt1503 = 0;
  7555. if (entity.anInt1549 == 0)
  7556. entity.turnDirection = 1024;
  7557. if (entity.anInt1549 == 1)
  7558. entity.turnDirection = 1536;
  7559. if (entity.anInt1549 == 2)
  7560. entity.turnDirection = 0;
  7561. if (entity.anInt1549 == 3)
  7562. entity.turnDirection = 512;
  7563. }
  7564.  
  7565. private void method98(Entity entity) {
  7566. if (entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527)) {
  7567. int i = entity.anInt1548 - entity.anInt1547;
  7568. int j = loopCycle - entity.anInt1547;
  7569. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7570. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7571. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  7572. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  7573. entity.x = (k * (i - j) + i1 * j) / i;
  7574. entity.y = (l * (i - j) + j1 * j) / i;
  7575. }
  7576. entity.anInt1503 = 0;
  7577. if (entity.anInt1549 == 0)
  7578. entity.turnDirection = 1024;
  7579. if (entity.anInt1549 == 1)
  7580. entity.turnDirection = 1536;
  7581. if (entity.anInt1549 == 2)
  7582. entity.turnDirection = 0;
  7583. if (entity.anInt1549 == 3)
  7584. entity.turnDirection = 512;
  7585. entity.anInt1552 = entity.turnDirection;
  7586. }
  7587.  
  7588. private void method99(Entity entity) {
  7589. entity.anInt1517 = entity.anInt1511;
  7590. if (entity.smallXYIndex == 0) {
  7591. entity.anInt1503 = 0;
  7592. return;
  7593. }
  7594. if (entity.anim != -1 && entity.anInt1529 == 0) {
  7595. Animation animation = Animation.anims[entity.anim];
  7596. if (entity.anInt1542 > 0 && animation.anInt363 == 0) {
  7597. entity.anInt1503++;
  7598. return;
  7599. }
  7600. if (entity.anInt1542 <= 0 && animation.anInt364 == 0) {
  7601. entity.anInt1503++;
  7602. return;
  7603. }
  7604. }
  7605. int i = entity.x;
  7606. int j = entity.y;
  7607. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7608. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7609. if (k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256) {
  7610. entity.x = k;
  7611. entity.y = l;
  7612. return;
  7613. }
  7614. if (i < k) {
  7615. if (j < l)
  7616. entity.turnDirection = 1280;
  7617. else if (j > l)
  7618. entity.turnDirection = 1792;
  7619. else
  7620. entity.turnDirection = 1536;
  7621. } else if (i > k) {
  7622. if (j < l)
  7623. entity.turnDirection = 768;
  7624. else if (j > l)
  7625. entity.turnDirection = 256;
  7626. else
  7627. entity.turnDirection = 512;
  7628. } else if (j < l)
  7629. entity.turnDirection = 1024;
  7630. else
  7631. entity.turnDirection = 0;
  7632. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  7633. if (i1 > 1024)
  7634. i1 -= 2048;
  7635. int j1 = entity.anInt1555;
  7636. if (i1 >= -256 && i1 <= 256)
  7637. j1 = entity.anInt1554;
  7638. else if (i1 >= 256 && i1 < 768)
  7639. j1 = entity.anInt1557;
  7640. else if (i1 >= -768 && i1 <= -256)
  7641. j1 = entity.anInt1556;
  7642. if (j1 == -1)
  7643. j1 = entity.anInt1554;
  7644. entity.anInt1517 = j1;
  7645. int k1 = 4;
  7646. if (entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  7647. k1 = 2;
  7648. if (entity.smallXYIndex > 2)
  7649. k1 = 6;
  7650. if (entity.smallXYIndex > 3)
  7651. k1 = 8;
  7652. if (entity.anInt1503 > 0 && entity.smallXYIndex > 1) {
  7653. k1 = 8;
  7654. entity.anInt1503--;
  7655. }
  7656. if (entity.aBooleanArray1553[entity.smallXYIndex - 1])
  7657. k1 <<= 1;
  7658. if (k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  7659. entity.anInt1517 = entity.anInt1505;
  7660. if (i < k) {
  7661. entity.x += k1;
  7662. if (entity.x > k)
  7663. entity.x = k;
  7664. } else if (i > k) {
  7665. entity.x -= k1;
  7666. if (entity.x < k)
  7667. entity.x = k;
  7668. }
  7669. if (j < l) {
  7670. entity.y += k1;
  7671. if (entity.y > l)
  7672. entity.y = l;
  7673. } else if (j > l) {
  7674. entity.y -= k1;
  7675. if (entity.y < l)
  7676. entity.y = l;
  7677. }
  7678. if (entity.x == k && entity.y == l) {
  7679. entity.smallXYIndex--;
  7680. if (entity.anInt1542 > 0)
  7681. entity.anInt1542--;
  7682. }
  7683. }
  7684.  
  7685. private void method100(Entity entity) {
  7686. if (entity.anInt1504 == 0)
  7687. return;
  7688. if (entity.interactingEntity != -1 && entity.interactingEntity < 32768) {
  7689. Npc npc = npcArray[entity.interactingEntity];
  7690. if (npc != null) {
  7691. int i1 = entity.x - npc.x;
  7692. int k1 = entity.y - npc.y;
  7693. if (i1 != 0 || k1 != 0)
  7694. entity.turnDirection = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  7695. }
  7696. }
  7697. if (entity.interactingEntity >= 32768) {
  7698. int j = entity.interactingEntity - 32768;
  7699. if (j == unknownInt10)
  7700. j = myPlayerIndex;
  7701. Player player = playerArray[j];
  7702. if (player != null) {
  7703. int l1 = entity.x - player.x;
  7704. int i2 = entity.y - player.y;
  7705. if (l1 != 0 || i2 != 0)
  7706. entity.turnDirection = (int) (Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  7707. }
  7708. }
  7709. if ((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0)) {
  7710. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  7711. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  7712. if (k != 0 || j1 != 0)
  7713. entity.turnDirection = (int) (Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  7714. entity.anInt1538 = 0;
  7715. entity.anInt1539 = 0;
  7716. }
  7717. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  7718. if (l != 0) {
  7719. if (l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  7720. entity.anInt1552 = entity.turnDirection;
  7721. else if (l > 1024)
  7722. entity.anInt1552 -= entity.anInt1504;
  7723. else
  7724. entity.anInt1552 += entity.anInt1504;
  7725. entity.anInt1552 &= 0x7ff;
  7726. if (entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection) {
  7727. if (entity.anInt1512 != -1) {
  7728. entity.anInt1517 = entity.anInt1512;
  7729. return;
  7730. }
  7731. entity.anInt1517 = entity.anInt1554;
  7732. }
  7733. }
  7734. }
  7735.  
  7736. private void method101(Entity entity) {
  7737. entity.aBoolean1541 = false;
  7738. if (entity.anInt1517 != -1) {
  7739.  
  7740. Animation animation = Animation.anims[entity.anInt1517];
  7741. entity.anInt1519++;
  7742. if (entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518)) {
  7743. entity.anInt1519 = 1;
  7744. entity.anInt1518++;
  7745. entity.nextIdleFrame++;
  7746. }
  7747. if (enableTweening) {
  7748. entity.nextIdleFrame = entity.anInt1518 + 1;
  7749. }
  7750. if (entity.nextIdleFrame >= animation.anInt352) {
  7751. if (entity.nextIdleFrame >= animation.anInt352) {
  7752. entity.nextIdleFrame = 0;
  7753. }
  7754. }
  7755. if (entity.anInt1518 >= animation.anInt352) {
  7756. entity.anInt1519 = 1;
  7757. entity.anInt1518 = 0;
  7758. }
  7759. }
  7760. if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
  7761. if (entity.anInt1521 < 0)
  7762. entity.anInt1521 = 0;
  7763. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  7764. for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  7765. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  7766.  
  7767. if (entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352)) {
  7768. entity.anInt1520 = -1;
  7769. }
  7770. if (enableTweening) {
  7771. entity.nextGraphicFrame = entity.anInt1518 + 1;
  7772. }
  7773. if (entity.nextGraphicFrame >= animation_1.anInt352) {
  7774. entity.nextGraphicFrame = -1;
  7775. }
  7776. }
  7777. if (entity.anim != -1 && entity.anInt1529 <= 1) {
  7778. Animation animation_2 = Animation.anims[entity.anim];
  7779. if (animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle) {
  7780. entity.anInt1529 = 1;
  7781. return;
  7782. }
  7783. }
  7784. if (entity.anim != -1 && entity.anInt1529 == 0) {
  7785. Animation animation_3 = Animation.anims[entity.anim];
  7786. for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  7787. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  7788.  
  7789. if (entity.anInt1527 >= animation_3.anInt352) {
  7790. entity.anInt1527 -= animation_3.anInt356;
  7791. entity.anInt1530++;
  7792. if (entity.anInt1530 >= animation_3.anInt362)
  7793. entity.anim = -1;
  7794. if (entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  7795. entity.anim = -1;
  7796. }
  7797. if (enableTweening) {
  7798. entity.nextAnimFrame = entity.anInt1527 + 1;
  7799. }
  7800. if (entity.nextAnimFrame >= animation_3.anInt352) {
  7801. entity.nextAnimFrame = -1;
  7802. }
  7803. entity.aBoolean1541 = animation_3.aBoolean358;
  7804. }
  7805. if (entity.anInt1529 > 0) {
  7806. entity.anInt1529--;
  7807. }
  7808. }
  7809.  
  7810. public GraphicsBuffer worldSelection;
  7811.  
  7812. public void worldSelection() {
  7813. resetImageProducers();
  7814. worldSelection.drawGraphics(400, super.graphics, 0);
  7815. worldSelection.initDrawingArea();
  7816. Sprite Sprite1 = new Sprite("37");
  7817. Sprite1.drawSprite(6, 63);
  7818. //cacheSprite[37].drawSprite(6, 63);
  7819. if(!ClientConstants.worldSwitch) {
  7820. boldText.method382(0xffffff, 55, "World 301", 78, true);
  7821. smallText.method382(0xffffff, 55, "Click to switch", 92, true);
  7822. ClientConstants.SERVER_IP = "127.0.0.1";
  7823. ClientConstants.SERVER_PORT = 43594;
  7824. } else {
  7825. boldText.method382(0xffffff, 55, "World 302", 78, true);
  7826. smallText.method382(0xffffff, 55, "Click to switch", 92, true);
  7827. ClientConstants.SERVER_IP = "104.197.191.124";
  7828. ClientConstants.SERVER_PORT = 43595;
  7829. }
  7830. }
  7831.  
  7832. private void drawGameScreen() {
  7833. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  7834. if (loadingStage == 2) {
  7835. method119(anInt945, fullscreenInterfaceID);
  7836. if (openInterfaceID != -1) {
  7837. method119(anInt945, openInterfaceID);
  7838. }
  7839. anInt945 = 0;
  7840. resetAllImageProducers();
  7841. super.fullGameScreen.initDrawingArea();
  7842. Texture.anIntArray1472 = fullScreenTextureArray;
  7843. DrawingArea.setAllPixelsToZero();
  7844. welcomeScreenRaised = true;
  7845. if (openInterfaceID != -1) {
  7846. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  7847. if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  7848. rsInterface_1.width = 765;
  7849. rsInterface_1.height = 503;
  7850. }
  7851. drawInterface(0, 0, rsInterface_1, 8);
  7852. }
  7853. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  7854. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  7855. rsInterface.width = 765;
  7856. rsInterface.height = 503;
  7857. }
  7858. drawInterface(0, 0, rsInterface, 8);
  7859. if (!menuOpen) {
  7860. processRightClick();
  7861. drawTooltip();
  7862. } else {
  7863. drawMenu(frameMode == ScreenMode.FIXED ? 4 : 0, frameMode == ScreenMode.FIXED ? 4 : 0);
  7864. }
  7865. }
  7866. drawCount++;
  7867. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  7868. return;
  7869. } else {
  7870. if (drawCount != 0) {
  7871. resetImageProducers2();
  7872. }
  7873. }
  7874. if (welcomeScreenRaised) {
  7875. welcomeScreenRaised = false;
  7876. if (frameMode == ScreenMode.FIXED) {
  7877. topFrame.drawGraphics(0, super.graphics, 0);
  7878. leftFrame.drawGraphics(4, super.graphics, 0);
  7879. }
  7880. inputTaken = true;
  7881. tabAreaAltered = true;
  7882. if (loadingStage != 2) {
  7883. if (frameMode == ScreenMode.FIXED) {
  7884. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  7885. aRSImageProducer_1164.drawGraphics(0, super.graphics, 516);
  7886. }
  7887. }
  7888. }
  7889. if (invOverlayInterfaceID != -1) {
  7890. method119(anInt945, invOverlayInterfaceID);
  7891. }
  7892. drawTabArea();
  7893. if(backDialogID == -1) {
  7894. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  7895. if(super.mouseX >= 496 && super.mouseX <= 511 && super.mouseY > (frameMode == ScreenMode.FIXED ? 345 : frameHeight - 158))
  7896. method65(494, 110, super.mouseX, super.mouseY - (frameMode == ScreenMode.FIXED ? 345 : frameHeight - 158), aClass9_1059, 0, false, anInt1211);
  7897. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  7898. if(i < 0) {
  7899. i = 0;
  7900. }
  7901. if(i > anInt1211 - 110) {
  7902. i = anInt1211 - 110;
  7903. }
  7904. if(anInt1089 != i) {
  7905. anInt1089 = i;
  7906. inputTaken = true;
  7907. }
  7908. }
  7909. if (backDialogID != -1) {
  7910. boolean flag2 = method119(anInt945, backDialogID);
  7911. if (flag2)
  7912. inputTaken = true;
  7913. }
  7914. if (atInventoryInterfaceType == 3)
  7915. inputTaken = true;
  7916. if (activeInterfaceType == 3)
  7917. inputTaken = true;
  7918. if (aString844 != null)
  7919. inputTaken = true;
  7920. if (menuOpen && menuScreenArea == 2)
  7921. inputTaken = true;
  7922. if (inputTaken) {
  7923. drawChatArea();
  7924. inputTaken = false;
  7925. }
  7926. if (loadingStage == 2)
  7927. method146();
  7928. if (loadingStage == 2) {
  7929. if (frameMode == ScreenMode.FIXED) {
  7930. drawMinimap();
  7931. aRSImageProducer_1164.drawGraphics(0, super.graphics, 516);
  7932. }
  7933. }
  7934. if (anInt1054 != -1)
  7935. tabAreaAltered = true;
  7936. if (tabAreaAltered) {
  7937. if (anInt1054 != -1 && anInt1054 == tabID) {
  7938. anInt1054 = -1;
  7939. stream.createFrame(120);
  7940. stream.writeWordBigEndian(tabID);
  7941. }
  7942. tabAreaAltered = false;
  7943. aRSImageProducer_1125.initDrawingArea();
  7944. aRSImageProducer_1165.initDrawingArea();
  7945. }
  7946. anInt945 = 0;
  7947. }
  7948.  
  7949. private boolean buildFriendsListMenu(RSInterface class9) {
  7950. int i = class9.contentType;
  7951. if (i >= 1 && i <= 200 || i >= 701 && i <= 900) {
  7952. if (i >= 801)
  7953. i -= 701;
  7954. else if (i >= 701)
  7955. i -= 601;
  7956. else if (i >= 101)
  7957. i -= 101;
  7958. else
  7959. i--;
  7960. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  7961. menuActionID[menuActionRow] = 792;
  7962. menuActionRow++;
  7963. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  7964. menuActionID[menuActionRow] = 639;
  7965. menuActionRow++;
  7966. return true;
  7967. }
  7968. if (i >= 401 && i <= 500) {
  7969. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  7970. menuActionID[menuActionRow] = 322;
  7971. menuActionRow++;
  7972. return true;
  7973. } else {
  7974. return false;
  7975. }
  7976. }
  7977.  
  7978. private void method104() {
  7979. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056.reverseGetFirst();
  7980. for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056.reverseGetNext())
  7981. if (class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  7982. class30_sub2_sub4_sub3.unlink();
  7983. else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
  7984. class30_sub2_sub4_sub3.method454(anInt945);
  7985. if (class30_sub2_sub4_sub3.aBoolean1567)
  7986. class30_sub2_sub4_sub3.unlink();
  7987. else
  7988. 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);
  7989. }
  7990.  
  7991. }
  7992.  
  7993. public void drawBlackBox(int xPos, int yPos) {
  7994. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  7995. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  7996. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  7997. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  7998. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  7999. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  8000. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  8001. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  8002. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  8003. }
  8004.  
  8005.  
  8006.  
  8007.  
  8008.  
  8009. private void drawInterface(int j, int k, RSInterface class9, int l) {
  8010. if (class9 == null)
  8011. class9 = RSInterface.interfaceCache[21356];
  8012. if (class9.type != 0 || class9.children == null)
  8013. return;
  8014. if (class9.isMouseoverTriggered && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  8015. return;
  8016. int i1 = DrawingArea.topX;
  8017. int j1 = DrawingArea.topY;
  8018. int k1 = DrawingArea.bottomX;
  8019. int l1 = DrawingArea.bottomY;
  8020. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  8021. int i2 = class9.children.length;
  8022. int alpha = class9.transparency;
  8023. for (int j2 = 0; j2 < i2; j2++) {
  8024. int k2 = class9.childX[j2] + k;
  8025. int l2 = (class9.childY[j2] + l) - j;
  8026. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  8027. k2 += class9_1.anInt263;
  8028. l2 += class9_1.anInt265;
  8029. if (class9_1.contentType > 0)
  8030. drawFriendsListOrWelcomeScreen(class9_1);
  8031. // here
  8032. 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,
  8033. /* Ancients */
  8034. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062, 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096 };
  8035. for (int m5 = 0; m5 < IDs.length; m5++) {
  8036. if (class9_1.id == IDs[m5] + 1) {
  8037. if (m5 > 61)
  8038. drawBlackBox(k2 + 1, l2);
  8039. else
  8040. drawBlackBox(k2, l2 + 1);
  8041. }
  8042. }
  8043. int[] runeChildren = { 1202, 1203, 1209, 1210, 1211, 1218, 1219,
  8044. 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245, 1252,
  8045. 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279,
  8046. 1286, 1287, 1293, 1294, 1295, 1302, 1303, 1304, 1311, 1312,
  8047. 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344,
  8048. 1345, 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377,
  8049. 1378, 1384, 1385, 1391, 1392, 1393, 1400, 1401, 1407, 1408,
  8050. 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441,
  8051. 1442, 1449, 1450, 1456, 1457, 1463, 1464, 1465, 1472, 1473,
  8052. 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499, 1506,
  8053. 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534,
  8054. 1535, 1547, 1548, 1549, 1556, 1557, 1558, 1566, 1567, 1568,
  8055. 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605,
  8056. 1606, 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639,
  8057. 1640, 6007, 6008, 6011, 8673, 8674, 12041, 12042, 12429,
  8058. 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451,
  8059. 12459, 12460, 15881, 15882, 15885, 18474, 18475, 18478 };
  8060. for (int r = 0; r < runeChildren.length; r++)
  8061. if (class9_1.id == runeChildren[r])
  8062. class9_1.modelZoom = 775;
  8063. if (class9_1.type == 0) {
  8064. if (class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  8065. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  8066. if (class9_1.scrollPosition < 0)
  8067. class9_1.scrollPosition = 0;
  8068. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  8069. if (class9_1.scrollMax > class9_1.height)
  8070. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax, false);
  8071. } else if (class9_1.type != 1)
  8072. if (class9_1.type == 2) {
  8073. int i3 = 0;
  8074. for (int l3 = 0; l3 < class9_1.height; l3++) {
  8075. for (int l4 = 0; l4 < class9_1.width; l4++) {
  8076. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  8077. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  8078. if (i3 < 20) {
  8079. k5 += class9_1.spritesX[i3];
  8080. j6 += class9_1.spritesY[i3];
  8081. }
  8082. if (class9_1.inv[i3] > 0) {
  8083. int k6 = 0;
  8084. int j7 = 0;
  8085. int j9 = class9_1.inv[i3] - 1;
  8086. if (k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  8087. int l9 = 0;
  8088. if (itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  8089. l9 = 0xffffff;
  8090. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  8091. if (class30_sub2_sub1_sub1_2 != null) {
  8092. if (activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  8093. k6 = super.mouseX - anInt1087;
  8094. j7 = super.mouseY - anInt1088;
  8095. if (k6 < 5 && k6 > -5)
  8096. k6 = 0;
  8097. if (j7 < 5 && j7 > -5)
  8098. j7 = 0;
  8099. if (anInt989 < 10) {
  8100. k6 = 0;
  8101. j7 = 0;
  8102. }
  8103. class30_sub2_sub1_sub1_2.drawSprite1(k5 + k6, j6 + j7);
  8104. if (j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  8105. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  8106. if (i10 > anInt945 * 10)
  8107. i10 = anInt945 * 10;
  8108. if (i10 > class9.scrollPosition)
  8109. i10 = class9.scrollPosition;
  8110. class9.scrollPosition -= i10;
  8111. anInt1088 += i10;
  8112. }
  8113. if (j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  8114. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  8115. if (j10 > anInt945 * 10)
  8116. j10 = anInt945 * 10;
  8117. if (j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  8118. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  8119. class9.scrollPosition += j10;
  8120. anInt1088 -= j10;
  8121. }
  8122. } else if (atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  8123. class30_sub2_sub1_sub1_2.drawSprite1(k5, j6);
  8124. else
  8125. class30_sub2_sub1_sub1_2.drawSprite(k5, j6);
  8126. if (class30_sub2_sub1_sub1_2.anInt1444 == 33 || class9_1.invStackSizes[i3] != 1) {
  8127. int k10 = class9_1.invStackSizes[i3];
  8128.  
  8129. smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  8130. if (k10 >= 1)
  8131. smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8132. if (k10 >= 100000)
  8133. smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8134. if (k10 >= 10000000)
  8135. smallText.method385(0x00FF80, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8136. }
  8137. }
  8138. }
  8139. } else if (class9_1.sprites != null && i3 < 20) {
  8140. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  8141. if (class30_sub2_sub1_sub1_1 != null)
  8142. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  8143. }
  8144. i3++;
  8145. }
  8146. }
  8147. } else if (class9_1.type == 3) {
  8148. boolean flag = false;
  8149. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8150. flag = true;
  8151. int j3;
  8152. if (interfaceIsSelected(class9_1)) {
  8153. j3 = class9_1.anInt219;
  8154. if (flag && class9_1.anInt239 != 0)
  8155. j3 = class9_1.anInt239;
  8156. } else {
  8157. j3 = class9_1.textColor;
  8158. if (flag && class9_1.anInt216 != 0)
  8159. j3 = class9_1.anInt216;
  8160. }
  8161. if (class9_1.aByte254 == 0) {
  8162. if (class9_1.aBoolean227)
  8163. DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  8164. else
  8165. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  8166. } else if (class9_1.aBoolean227)
  8167. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.aByte254 & 0xff), k2);
  8168. else
  8169. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.aByte254 & 0xff), j3, class9_1.width, k2);
  8170. } else if (class9_1.type == 4) {
  8171. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  8172. String s = class9_1.message;
  8173. boolean flag1 = false;
  8174. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8175. flag1 = true;
  8176. int i4;
  8177. if (interfaceIsSelected(class9_1)) {
  8178. i4 = class9_1.anInt219;
  8179. if (flag1 && class9_1.anInt239 != 0)
  8180. i4 = class9_1.anInt239;
  8181. if (class9_1.aString228.length() > 0)
  8182. s = class9_1.aString228;
  8183. } else {
  8184. i4 = class9_1.textColor;
  8185. if (flag1 && class9_1.anInt216 != 0)
  8186. i4 = class9_1.anInt216;
  8187. }
  8188. if (class9_1.atActionType == 6 && aBoolean1149) {
  8189. s = "Please wait...";
  8190. i4 = class9_1.textColor;
  8191. }
  8192. if (DrawingArea.width == 516) {
  8193. if (i4 == 0xffff00)
  8194. i4 = 255;
  8195. if (i4 == 49152)
  8196. i4 = 0xffffff;
  8197. }
  8198. if (frameMode != ScreenMode.FIXED) {
  8199. if ((backDialogID != -1 || dialogID != -1 || class9_1.message.contains("Click here to continue")) && (class9.id == backDialogID || class9.id == dialogID)) {
  8200. if (i4 == 0xffff00) {
  8201. i4 = 255;
  8202. }
  8203. if (i4 == 49152) {
  8204. i4 = 0xffffff;
  8205. }
  8206. }
  8207. }
  8208. if ((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  8209. switch (i4) {
  8210. case 16773120:
  8211. i4 = 0xFE981F;
  8212. break;
  8213. case 7040819:
  8214. i4 = 0xAF6A1A;
  8215. break;
  8216. }
  8217. }
  8218. for (int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497) {
  8219. if (s.indexOf("%") != -1) {
  8220. do {
  8221. int k7 = s.indexOf("%1");
  8222. if (k7 == -1)
  8223. break;
  8224. if (class9_1.id < 4000 || class9_1.id > 5000 && class9_1.id != 13921 && class9_1.id != 13922 && class9_1.id != 12171 && class9_1.id != 12172)
  8225. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8226. else
  8227. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8228. } while (true);
  8229. do {
  8230. int l7 = s.indexOf("%2");
  8231. if (l7 == -1)
  8232. break;
  8233. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  8234. } while (true);
  8235. do {
  8236. int i8 = s.indexOf("%3");
  8237. if (i8 == -1)
  8238. break;
  8239. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  8240. } while (true);
  8241. do {
  8242. int j8 = s.indexOf("%4");
  8243. if (j8 == -1)
  8244. break;
  8245. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  8246. } while (true);
  8247. do {
  8248. int k8 = s.indexOf("%5");
  8249. if (k8 == -1)
  8250. break;
  8251. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  8252. } while (true);
  8253. }
  8254. int l8 = s.indexOf("\\n");
  8255. String s1;
  8256. if (l8 != -1) {
  8257. s1 = s.substring(0, l8);
  8258. s = s.substring(l8 + 2);
  8259. } else {
  8260. s1 = s;
  8261. s = "";
  8262. }
  8263. if (class9_1.centerText)
  8264. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadow);
  8265. else
  8266. textDrawingArea.method389(class9_1.textShadow, k2, i4, s1, l6);
  8267. }
  8268. } else if (class9_1.type == 5) {
  8269. Sprite sprite;
  8270. if (interfaceIsSelected(class9_1))
  8271. sprite = class9_1.sprite2;
  8272. else
  8273. sprite = class9_1.sprite1;
  8274. if (spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
  8275. sprite.drawSprite(k2, l2, 0xffffff);
  8276. } else {
  8277. if (sprite != null)
  8278. if (class9_1.drawsTransparent) {
  8279. sprite.drawTransparentSprite(k2, l2, alpha);
  8280. } else {
  8281. sprite.drawSprite(k2, l2);
  8282. }
  8283. }
  8284. if(autocast && class9_1.id == autoCastId)
  8285. cacheSprite[43].drawSprite(k2-3, l2-3);
  8286. if (sprite != null)
  8287. if (class9_1.drawsTransparent) {
  8288. sprite.drawSprite1(k2, l2);
  8289. } else {
  8290. sprite.drawSprite(k2, l2);
  8291. }
  8292. } else if (class9_1.type == 6) {
  8293. int k3 = Texture.textureInt1;
  8294. int j4 = Texture.textureInt2;
  8295. Texture.textureInt1 = k2 + class9_1.width / 2;
  8296. Texture.textureInt2 = l2 + class9_1.height / 2;
  8297. int i5 = Texture.anIntArray1470[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8298. int l5 = Texture.anIntArray1471[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8299. boolean flag2 = interfaceIsSelected(class9_1);
  8300. int i7;
  8301. if (flag2)
  8302. i7 = class9_1.anInt258;
  8303. else
  8304. i7 = class9_1.anInt257;
  8305. Model model;
  8306. if (i7 == -1) {
  8307. model = class9_1.method209(-1, -1, flag2);
  8308. } else {
  8309. Animation animation = Animation.anims[i7];
  8310. model = class9_1.method209(animation.anIntArray354[class9_1.anInt246], animation.anIntArray353[class9_1.anInt246], flag2);
  8311. }
  8312. if (model != null)
  8313. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  8314. Texture.textureInt1 = k3;
  8315. Texture.textureInt2 = j4;
  8316. } else if (class9_1.type == 7) {
  8317. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  8318. int k4 = 0;
  8319. for (int j5 = 0; j5 < class9_1.height; j5++) {
  8320. for (int i6 = 0; i6 < class9_1.width; i6++) {
  8321. if (class9_1.inv[k4] > 0) {
  8322. ItemDef itemDef = ItemDef.forID(class9_1.inv[k4] - 1);
  8323. String s2 = itemDef.name;
  8324. if (itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  8325. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  8326. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  8327. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  8328. if (class9_1.centerText)
  8329. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadow);
  8330. else
  8331. textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  8332. }
  8333. k4++;
  8334. }
  8335. }
  8336. } else if (class9_1.type == 9) {
  8337. drawHoverBox(k2, l2, class9_1.popupString);
  8338. } else if (class9_1.type == 8 && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id) && anInt1501 == 0 && !menuOpen) {
  8339. int boxWidth = 0;
  8340. int boxHeight = 0;
  8341. TextDrawingArea textDrawingArea_2 = regularText;
  8342. for (String s1 = class9_1.message; s1.length() > 0;) {
  8343. if (s1.indexOf("%") != -1) {
  8344. do {
  8345. int k7 = s1.indexOf("%1");
  8346. if (k7 == -1)
  8347. break;
  8348. s1 = s1.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s1.substring(k7 + 2);
  8349. } while (true);
  8350. do {
  8351. int l7 = s1.indexOf("%2");
  8352. if (l7 == -1)
  8353. break;
  8354. s1 = s1.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s1.substring(l7 + 2);
  8355. } while (true);
  8356. do {
  8357. int i8 = s1.indexOf("%3");
  8358. if (i8 == -1)
  8359. break;
  8360. s1 = s1.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s1.substring(i8 + 2);
  8361. } while (true);
  8362. do {
  8363. int j8 = s1.indexOf("%4");
  8364. if (j8 == -1)
  8365. break;
  8366. s1 = s1.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s1.substring(j8 + 2);
  8367. } while (true);
  8368. do {
  8369. int k8 = s1.indexOf("%5");
  8370. if (k8 == -1)
  8371. break;
  8372. s1 = s1.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s1.substring(k8 + 2);
  8373. } while (true);
  8374. }
  8375. int l7 = s1.indexOf("\\n");
  8376. String s4;
  8377. if (l7 != -1) {
  8378. s4 = s1.substring(0, l7);
  8379. s1 = s1.substring(l7 + 2);
  8380. } else {
  8381. s4 = s1;
  8382. s1 = "";
  8383. }
  8384. int j10 = textDrawingArea_2.getTextWidth(s4);
  8385. if (j10 > boxWidth) {
  8386. boxWidth = j10;
  8387. }
  8388. boxHeight += textDrawingArea_2.anInt1497 + 1;
  8389. }
  8390. boxWidth += 6;
  8391. boxHeight += 7;
  8392. int xPos = (k2 + class9_1.width) - 5 - boxWidth;
  8393. int yPos = l2 + class9_1.height + 5;
  8394. if (xPos < k2 + 5) {
  8395. xPos = k2 + 5;
  8396. }
  8397. if (xPos + boxWidth > k + class9.width) {
  8398. xPos = (k + class9.width) - boxWidth;
  8399. }
  8400. if (yPos + boxHeight > l + class9.height) {
  8401. yPos = (l2 - boxHeight);
  8402. }
  8403. DrawingArea.drawPixels(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  8404. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  8405. String s2 = class9_1.message;
  8406. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2.length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {// anInt1497
  8407. if (s2.indexOf("%") != -1) {
  8408. do {
  8409. int k7 = s2.indexOf("%1");
  8410. if (k7 == -1)
  8411. break;
  8412. s2 = s2.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s2.substring(k7 + 2);
  8413. } while (true);
  8414. do {
  8415. int l7 = s2.indexOf("%2");
  8416. if (l7 == -1)
  8417. break;
  8418. s2 = s2.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s2.substring(l7 + 2);
  8419. } while (true);
  8420. do {
  8421. int i8 = s2.indexOf("%3");
  8422. if (i8 == -1)
  8423. break;
  8424. s2 = s2.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s2.substring(i8 + 2);
  8425. } while (true);
  8426. do {
  8427. int j8 = s2.indexOf("%4");
  8428. if (j8 == -1)
  8429. break;
  8430. s2 = s2.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s2.substring(j8 + 2);
  8431. } while (true);
  8432. do {
  8433. int k8 = s2.indexOf("%5");
  8434. if (k8 == -1)
  8435. break;
  8436. s2 = s2.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s2.substring(k8 + 2);
  8437. } while (true);
  8438. }
  8439. int l11 = s2.indexOf("\\n");
  8440. String s5;
  8441. if (l11 != -1) {
  8442. s5 = s2.substring(0, l11);
  8443. s2 = s2.substring(l11 + 2);
  8444. } else {
  8445. s5 = s2;
  8446. s2 = "";
  8447. }
  8448. if (class9_1.centerText) {
  8449. textDrawingArea_2.method382(yPos, xPos + class9_1.width / 2, s5, j11, false);
  8450. } else {
  8451. if (s5.contains("\\r")) {
  8452. String text = s5.substring(0, s5.indexOf("\\r"));
  8453. String text2 = s5.substring(s5.indexOf("\\r") + 2);
  8454. textDrawingArea_2.method389(false, xPos + 3, 0, text, j11);
  8455. int rightX = boxWidth + xPos - textDrawingArea_2.getTextWidth(text2) - 2;
  8456. textDrawingArea_2.method389(false, rightX, 0, text2, j11);
  8457. System.out.println("Box: " + boxWidth + "");
  8458. } else
  8459. textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  8460. }
  8461. }
  8462. }
  8463. }
  8464. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  8465. }
  8466.  
  8467. public void drawHoverBox(int xPos, int yPos, String text) {
  8468. String[] results = text.split("\n");
  8469. int height = (results.length * 16) + 6;
  8470. int width;
  8471. width = smallText.getTextWidth(results[0]) + 6;
  8472. for (int i = 1; i < results.length; i++)
  8473. if (width <= smallText.getTextWidth(results[i]) + 6)
  8474. width = smallText.getTextWidth(results[i]) + 6;
  8475. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  8476. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  8477. yPos += 14;
  8478. for (int i = 0; i < results.length; i++) {
  8479. smallText.method389(false, xPos + 3, 0, results[i], yPos);
  8480. yPos += 16;
  8481. }
  8482. }
  8483.  
  8484. private void randomizeBackground(Background background) {
  8485. int j = 256;
  8486. for (int k = 0; k < anIntArray1190.length; k++)
  8487. anIntArray1190[k] = 0;
  8488.  
  8489. for (int l = 0; l < 5000; l++) {
  8490. int i1 = (int) (Math.random() * 128D * (double) j);
  8491. anIntArray1190[i1] = (int) (Math.random() * 256D);
  8492. }
  8493. for (int j1 = 0; j1 < 20; j1++) {
  8494. for (int k1 = 1; k1 < j - 1; k1++) {
  8495. for (int i2 = 1; i2 < 127; i2++) {
  8496. int k2 = i2 + (k1 << 7);
  8497. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  8498. }
  8499.  
  8500. }
  8501. int ai[] = anIntArray1190;
  8502. anIntArray1190 = anIntArray1191;
  8503. anIntArray1191 = ai;
  8504. }
  8505. if (background != null) {
  8506. int l1 = 0;
  8507. for (int j2 = 0; j2 < background.anInt1453; j2++) {
  8508. for (int l2 = 0; l2 < background.anInt1452; l2++)
  8509. if (background.aByteArray1450[l1++] != 0) {
  8510. int i3 = l2 + 16 + background.anInt1454;
  8511. int j3 = j2 + 16 + background.anInt1455;
  8512. int k3 = i3 + (j3 << 7);
  8513. anIntArray1190[k3] = 0;
  8514. }
  8515. }
  8516. }
  8517. }
  8518.  
  8519. private void method107(int i, int j, Stream stream, Player player) {
  8520. if ((i & 0x400) != 0) {
  8521. player.anInt1543 = stream.method428();
  8522. player.anInt1545 = stream.method428();
  8523. player.anInt1544 = stream.method428();
  8524. player.anInt1546 = stream.method428();
  8525. player.anInt1547 = stream.method436() + loopCycle;
  8526. player.anInt1548 = stream.method435() + loopCycle;
  8527. player.anInt1549 = stream.method428();
  8528. player.method446();
  8529. }
  8530. if ((i & 0x100) != 0) {
  8531. player.anInt1520 = stream.method434();
  8532. int k = stream.readDWord();
  8533. player.anInt1524 = k >> 16;
  8534. player.anInt1523 = loopCycle + (k & 0xffff);
  8535. player.anInt1521 = 0;
  8536. player.anInt1522 = 0;
  8537. if (player.anInt1523 > loopCycle)
  8538. player.anInt1521 = -1;
  8539. if (player.anInt1520 == 65535)
  8540. player.anInt1520 = -1;
  8541. }
  8542. if ((i & 8) != 0) {
  8543. int l = stream.method434();
  8544. if (l == 65535)
  8545. l = -1;
  8546. int i2 = stream.method427();
  8547. if (l == player.anim && l != -1) {
  8548. int i3 = Animation.anims[l].anInt365;
  8549. if (i3 == 1) {
  8550. player.anInt1527 = 0;
  8551. player.anInt1528 = 0;
  8552. player.anInt1529 = i2;
  8553. player.anInt1530 = 0;
  8554. }
  8555. if (i3 == 2)
  8556. player.anInt1530 = 0;
  8557. } else if (l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359) {
  8558. player.anim = l;
  8559. player.anInt1527 = 0;
  8560. player.anInt1528 = 0;
  8561. player.anInt1529 = i2;
  8562. player.anInt1530 = 0;
  8563. player.anInt1542 = player.smallXYIndex;
  8564. }
  8565. }
  8566. if ((i & 4) != 0) {
  8567. player.textSpoken = stream.readString();
  8568. if (player.textSpoken.charAt(0) == '~') {
  8569. player.textSpoken = player.textSpoken.substring(1);
  8570. pushMessage(player.textSpoken, 2, player.name);
  8571. } else if (player == myPlayer)
  8572. pushMessage(player.textSpoken, 2, player.name);
  8573. player.anInt1513 = 0;
  8574. player.anInt1531 = 0;
  8575. player.textCycle = 150;
  8576. }
  8577. if ((i & 0x80) != 0) {
  8578. // right fucking here
  8579. int i1 = stream.method434();
  8580. int j2 = stream.readUnsignedByte();
  8581. int j3 = stream.method427();
  8582. int k3 = stream.currentOffset;
  8583. if (player.name != null && player.visible) {
  8584. long l3 = TextClass.longForName(player.name);
  8585. boolean flag = false;
  8586. if (j2 <= 1) {
  8587. for (int i4 = 0; i4 < ignoreCount; i4++) {
  8588. if (ignoreListAsLongs[i4] != l3)
  8589. continue;
  8590. flag = true;
  8591. break;
  8592. }
  8593.  
  8594. }
  8595. if (!flag && anInt1251 == 0)
  8596. try {
  8597. aStream_834.currentOffset = 0;
  8598. stream.method442(j3, 0, aStream_834.buffer);
  8599. aStream_834.currentOffset = 0;
  8600. String s = TextInput.method525(j3, aStream_834);
  8601. // s = Censor.doCensor(s);
  8602. player.textSpoken = s;
  8603. player.anInt1513 = i1 >> 8;
  8604. player.privelage = j2;
  8605. player.anInt1531 = i1 & 0xff;
  8606. player.textCycle = 150;
  8607. if (j2 == 2 || j2 == 3)
  8608. pushMessage(s, 1, "@cr2@" + player.name);
  8609. else if (j2 == 1)
  8610. pushMessage(s, 1, "@cr1@" + player.name);
  8611. else
  8612. pushMessage(s, 2, player.name);
  8613. } catch (Exception exception) {
  8614. Signlink.reporterror("cde2");
  8615. }
  8616. }
  8617. stream.currentOffset = k3 + j3;
  8618. }
  8619. if ((i & 1) != 0) {
  8620. player.interactingEntity = stream.method434();
  8621. if (player.interactingEntity == 65535)
  8622. player.interactingEntity = -1;
  8623. }
  8624. if ((i & 0x10) != 0) {
  8625. int j1 = stream.method427();
  8626. byte abyte0[] = new byte[j1];
  8627. Stream stream_1 = new Stream(abyte0);
  8628. stream.readBytes(j1, 0, abyte0);
  8629. aStreamArray895s[j] = stream_1;
  8630. player.updatePlayer(stream_1);
  8631. }
  8632. if ((i & 2) != 0) {
  8633. player.anInt1538 = stream.method436();
  8634. player.anInt1539 = stream.method434();
  8635. }
  8636. if ((i & 0x20) != 0) {
  8637. int k1 = stream.readUnsignedByte();
  8638. int k2 = stream.method426();
  8639. player.updateHitData(k2, k1, loopCycle);
  8640. player.loopCycleStatus = loopCycle + 300;
  8641. player.currentHealth = stream.method427();
  8642. player.maxHealth = stream.readUnsignedByte();
  8643. }
  8644. if ((i & 0x200) != 0) {
  8645. int l1 = stream.readUnsignedByte();
  8646. int l2 = stream.method428();
  8647. player.updateHitData(l2, l1, loopCycle);
  8648. player.loopCycleStatus = loopCycle + 300;
  8649. player.currentHealth = stream.readUnsignedByte();
  8650. player.maxHealth = stream.method427();
  8651. }
  8652. }
  8653.  
  8654. private void method108() {
  8655. try {
  8656. int j = myPlayer.x + anInt1278;
  8657. int k = myPlayer.y + anInt1131;
  8658. if (anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500) {
  8659. anInt1014 = j;
  8660. anInt1015 = k;
  8661. }
  8662. if (anInt1014 != j)
  8663. anInt1014 += (j - anInt1014) / 16;
  8664. if (anInt1015 != k)
  8665. anInt1015 += (k - anInt1015) / 16;
  8666. if (super.keyArray[1] == 1)
  8667. anInt1186 += (-24 - anInt1186) / 2;
  8668. else if (super.keyArray[2] == 1)
  8669. anInt1186 += (24 - anInt1186) / 2;
  8670. else
  8671. anInt1186 /= 2;
  8672. if (super.keyArray[3] == 1)
  8673. anInt1187 += (12 - anInt1187) / 2;
  8674. else if (super.keyArray[4] == 1)
  8675. anInt1187 += (-12 - anInt1187) / 2;
  8676. else
  8677. anInt1187 /= 2;
  8678. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  8679. anInt1184 += anInt1187 / 2;
  8680. if (anInt1184 < 128)
  8681. anInt1184 = 128;
  8682. if (anInt1184 > 383)
  8683. anInt1184 = 383;
  8684. int l = anInt1014 >> 7;
  8685. int i1 = anInt1015 >> 7;
  8686. int j1 = method42(plane, anInt1015, anInt1014);
  8687. int k1 = 0;
  8688. if (l > 3 && i1 > 3 && l < 100 && i1 < 100) {
  8689. for (int l1 = l - 4; l1 <= l + 4; l1++) {
  8690. for (int k2 = i1 - 4; k2 <= i1 + 4; k2++) {
  8691. int l2 = plane;
  8692. if (l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  8693. l2++;
  8694. int i3 = j1 - intGroundArray[l2][l1][k2];
  8695. if (i3 > k1)
  8696. k1 = i3;
  8697. }
  8698.  
  8699. }
  8700.  
  8701. }
  8702. anInt1005++;
  8703. if (anInt1005 > 1512) {
  8704. anInt1005 = 0;
  8705. stream.createFrame(77);
  8706. stream.writeWordBigEndian(0);
  8707. int i2 = stream.currentOffset;
  8708. stream.writeWordBigEndian((int) (Math.random() * 256D));
  8709. stream.writeWordBigEndian(101);
  8710. stream.writeWordBigEndian(233);
  8711. stream.writeWord(45092);
  8712. if ((int) (Math.random() * 2D) == 0)
  8713. stream.writeWord(35784);
  8714. stream.writeWordBigEndian((int) (Math.random() * 256D));
  8715. stream.writeWordBigEndian(64);
  8716. stream.writeWordBigEndian(38);
  8717. stream.writeWord((int) (Math.random() * 65536D));
  8718. stream.writeWord((int) (Math.random() * 65536D));
  8719. stream.writeBytes(stream.currentOffset - i2);
  8720. }
  8721. int j2 = k1 * 192;
  8722. if (j2 > 0x17f00)
  8723. j2 = 0x17f00;
  8724. if (j2 < 32768)
  8725. j2 = 32768;
  8726. if (j2 > anInt984) {
  8727. anInt984 += (j2 - anInt984) / 24;
  8728. return;
  8729. }
  8730. if (j2 < anInt984) {
  8731. anInt984 += (j2 - anInt984) / 80;
  8732. }
  8733. } catch (Exception _ex) {
  8734. Signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  8735. throw new RuntimeException("eek");
  8736. }
  8737. }
  8738.  
  8739. public void processDrawing() {
  8740. if (rsAlreadyLoaded || loadingError || genericLoadingError) {
  8741. showErrorScreen();
  8742. return;
  8743. }
  8744. if (!loggedIn)
  8745. drawLoginScreen(false);
  8746. else
  8747. drawGameScreen();
  8748. anInt1213 = 0;
  8749. }
  8750.  
  8751. private boolean isFriendOrSelf(String s) {
  8752. if (s == null)
  8753. return false;
  8754. for (int i = 0; i < friendsCount; i++)
  8755. if (s.equalsIgnoreCase(friendsList[i]))
  8756. return true;
  8757. return s.equalsIgnoreCase(myPlayer.name);
  8758. }
  8759.  
  8760. private static String combatDiffColor(int playerLevel, int entityLevel) {
  8761. int level = playerLevel - entityLevel;
  8762. if (level < -9)
  8763. return "@red@";
  8764. if (level < -6)
  8765. return "@or3@";
  8766. if (level < -3)
  8767. return "@or2@";
  8768. if (level < 0)
  8769. return "@or1@";
  8770. if (level > 9)
  8771. return "@gre@";
  8772. if (level > 6)
  8773. return "@gr3@";
  8774. if (level > 3)
  8775. return "@gr2@";
  8776. if (level > 0)
  8777. return "@gr1@";
  8778. else
  8779. return "@yel@";
  8780. }
  8781.  
  8782. private void setWaveVolume(int i) {
  8783. Signlink.wavevol = i;
  8784. }
  8785.  
  8786.  
  8787.  
  8788. private void draw3dScreen() {
  8789. if (drawExperienceCounter) {
  8790. loadXPCounter();
  8791. if (drawTotalExperience) {
  8792. loadTotalXP();
  8793. }
  8794. }
  8795. if (showChatComponents) {
  8796. drawSplitPrivateChat();
  8797. }
  8798. if (crossType == 1) {
  8799. int offSet = frameMode == ScreenMode.FIXED ? 4 : 0;
  8800. crosses[crossIndex / 100].drawSprite(crossX - 8 - offSet, crossY - 8 - offSet);
  8801. anInt1142++;
  8802. if (anInt1142 > 67) {
  8803. anInt1142 = 0;
  8804. stream.createFrame(78);
  8805. }
  8806. }
  8807. if (crossType == 2) {
  8808. int offSet = frameMode == ScreenMode.FIXED ? 4 : 0;
  8809. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - offSet, crossY - 8 - offSet);
  8810. }
  8811. if (anInt1018 != -1) {
  8812. method119(anInt945, anInt1018);
  8813. if (anInt1018 == 197 && frameMode != ScreenMode.FIXED) {
  8814. skullIcons[0].drawSprite(frameWidth - 82, 168);
  8815. String text = RSInterface.interfaceCache[199].message;
  8816. regularText.drawChatInput(0xE1981D, frameWidth - 90, text, 207, true);
  8817. } else if (anInt1018 == 201 && frameMode != ScreenMode.FIXED) {
  8818. drawInterface(0, frameWidth - 560, RSInterface.interfaceCache[anInt1018], -109);
  8819. } else {
  8820. drawInterface(0, frameMode == ScreenMode.FIXED ? 0 : (frameWidth / 2) - 356, RSInterface.interfaceCache[anInt1018], frameMode == ScreenMode.FIXED ? 0 : (frameHeight / 2) - 230);
  8821. }
  8822. }
  8823. if (openInterfaceID != -1) {
  8824. method119(anInt945, openInterfaceID);
  8825. drawInterface(0, frameMode == ScreenMode.FIXED ? 0 : (frameWidth / 2) - 356, RSInterface.interfaceCache[openInterfaceID], frameMode == ScreenMode.FIXED ? 0 : (frameHeight / 2) - 230);
  8826. }
  8827. if (!menuOpen) {
  8828. processRightClick();
  8829. drawTooltip();
  8830. } else if (menuScreenArea == 0) {
  8831. drawMenu(frameMode == ScreenMode.FIXED ? 4 : 0, frameMode == ScreenMode.FIXED ? 4 : 0);
  8832. }
  8833. if (anInt1055 == 1) {
  8834. multiOverlay.drawSprite(frameMode == ScreenMode.FIXED ? 472 : frameWidth - 35, frameMode == ScreenMode.FIXED ? 296 : 155);
  8835. }
  8836. if(fpsOn) {
  8837. int color = 0xffff00;
  8838. if(super.fps < 15) {
  8839. color = 0xff0000;
  8840. }
  8841. regularText.method385(color, "Fps: " + super.fps, 15, 2);
  8842. Runtime time = Runtime.getRuntime();
  8843. int memory = (int)((time.totalMemory() - time.freeMemory()) / 1024L);
  8844. color = 0xffff00;
  8845. if(memory > 0x2000000 && lowMem) {
  8846. color = 0xff0000;
  8847. }
  8848. regularText.method385(color, "Memory Usage: " +memory+ "k", 30, 2);
  8849. }
  8850. int x = baseX + (myPlayer.x - 6 >> 7);
  8851. int y = baseY + (myPlayer.y - 6 >> 7);
  8852. final String screenMode = frameMode == ScreenMode.FIXED ? "Fixed" : "Resizable";
  8853. if (clientData){
  8854. int color = 0xffff00;
  8855. int fpsColor = 0xffff00;
  8856. if(super.fps < 15) {
  8857. fpsColor = 0xff0000;
  8858. }
  8859. regularText.method385(color, "frameWidth: " + (mouseX - frameWidth) + ", frameHeight: " + (mouseY - frameHeight), frameHeight - 271, 5);
  8860. regularText.method385(color, "Client Zoom: " + cameraZoom, frameHeight - 257, 5);
  8861. regularText.method385(fpsColor, "Fps: " + super.fps, frameHeight - 243, 5);
  8862. Runtime time = Runtime.getRuntime();
  8863. int memory = (int) ((time.totalMemory() - time.freeMemory()) / 1024L);
  8864. regularText.method385(color, "Memory Usage: " + memory + "k", frameHeight - 229, 5);
  8865. regularText.method385(color, "Mouse X: " + mouseX + ", Mouse Y: " + mouseY, frameHeight - 215, 5);
  8866. regularText.method385(color, "Coords: " + x + ", " + y, frameHeight - 201, 5);
  8867. regularText.method385(color, "Client Mode: " + screenMode + "", frameHeight - 187, 5);
  8868. regularText.method385(color, "Client Resolution: " + frameWidth + "x" + frameHeight, frameHeight - 173, 5);
  8869. }
  8870. if (anInt1104 != 0) {
  8871. int j = anInt1104 / 50;
  8872. int l = j / 60;
  8873. int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 498;
  8874. j %= 60;
  8875. if (j < 10) {
  8876. regularText.method385(0xffff00, "System update in: " + l + ":0" + j, 329 + yOffset, 4);
  8877. } else {
  8878. regularText.method385(0xffff00, "System update in: " + l + ":" + j, 329 + yOffset, 4);
  8879. }
  8880. anInt849++;
  8881. if (anInt849 > 75) {
  8882. anInt849 = 0;
  8883. stream.createFrame(148);
  8884. }
  8885. }
  8886. }
  8887.  
  8888.  
  8889.  
  8890. private void addIgnore(long l) {
  8891. try {
  8892. if (l == 0L)
  8893. return;
  8894. if (ignoreCount >= 100) {
  8895. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  8896. return;
  8897. }
  8898. String s = TextClass.fixName(TextClass.nameForLong(l));
  8899. for (int j = 0; j < ignoreCount; j++)
  8900. if (ignoreListAsLongs[j] == l) {
  8901. pushMessage(s + " is already on your ignore list", 0, "");
  8902. return;
  8903. }
  8904. for (int k = 0; k < friendsCount; k++)
  8905. if (friendsListAsLongs[k] == l) {
  8906. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  8907. return;
  8908. }
  8909.  
  8910. ignoreListAsLongs[ignoreCount++] = l;
  8911. stream.createFrame(133);
  8912. stream.writeQWord(l);
  8913. return;
  8914. } catch (RuntimeException runtimeexception) {
  8915. Signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  8916. }
  8917. throw new RuntimeException();
  8918. }
  8919.  
  8920. private void method114() {
  8921. for (int i = -1; i < playerCount; i++) {
  8922. int j;
  8923. if (i == -1)
  8924. j = myPlayerIndex;
  8925. else
  8926. j = playerIndices[i];
  8927. Player player = playerArray[j];
  8928. if (player != null)
  8929. method96(player);
  8930. }
  8931.  
  8932. }
  8933.  
  8934. private void method115() {
  8935. if (loadingStage == 2) {
  8936. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetNext()) {
  8937. if (class30_sub1.anInt1294 > 0)
  8938. class30_sub1.anInt1294--;
  8939. if (class30_sub1.anInt1294 == 0) {
  8940. if (class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301)) {
  8941. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  8942. class30_sub1.unlink();
  8943. }
  8944. } else {
  8945. if (class30_sub1.anInt1302 > 0)
  8946. class30_sub1.anInt1302--;
  8947. 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))) {
  8948. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  8949. class30_sub1.anInt1302 = -1;
  8950. if (class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  8951. class30_sub1.unlink();
  8952. else if (class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  8953. class30_sub1.unlink();
  8954. }
  8955. }
  8956. }
  8957.  
  8958. }
  8959. }
  8960.  
  8961. private void determineMenuSize() {
  8962. int boxLength = boldText.getTextWidth("Choose option");
  8963. for (int row = 0; row < menuActionRow; row++) {
  8964. int actionLength = boldText.getTextWidth(menuActionName[row]);
  8965. if (actionLength > boxLength)
  8966. boxLength = actionLength;
  8967. }
  8968. boxLength += 8;
  8969. int offset = 15 * menuActionRow + 21;
  8970. if(super.saveClickX > 0 && super.saveClickY > 0 && super.saveClickX < frameWidth && super.saveClickY < frameHeight) {
  8971. int xClick = super.saveClickX - boxLength / 2;
  8972. if (xClick + boxLength > frameWidth - 4) {
  8973. xClick = frameWidth - 4 - boxLength;
  8974. }
  8975. if (xClick < 0) {
  8976. xClick = 0;
  8977. }
  8978. int yClick = super.saveClickY - 0;
  8979. if (yClick + offset > frameHeight - 6) {
  8980. yClick = frameHeight - 6 - offset;
  8981. }
  8982. if (yClick < 0) {
  8983. yClick = 0;
  8984. }
  8985. menuOpen = true;
  8986. menuOffsetX = xClick;
  8987. menuOffsetY = yClick;
  8988. menuWidth = boxLength;
  8989. menuHeight = 15 * menuActionRow + 22;
  8990. }
  8991. }
  8992.  
  8993. private void method117(Stream stream) {
  8994. stream.initBitAccess();
  8995. int j = stream.readBits(1);
  8996. if (j == 0)
  8997. return;
  8998. int k = stream.readBits(2);
  8999. if (k == 0) {
  9000. anIntArray894[anInt893++] = myPlayerIndex;
  9001. return;
  9002. }
  9003. if (k == 1) {
  9004. int l = stream.readBits(3);
  9005. myPlayer.moveInDir(false, l);
  9006. int k1 = stream.readBits(1);
  9007. if (k1 == 1)
  9008. anIntArray894[anInt893++] = myPlayerIndex;
  9009. return;
  9010. }
  9011. if (k == 2) {
  9012. int i1 = stream.readBits(3);
  9013. myPlayer.moveInDir(true, i1);
  9014. int l1 = stream.readBits(3);
  9015. myPlayer.moveInDir(true, l1);
  9016. int j2 = stream.readBits(1);
  9017. if (j2 == 1)
  9018. anIntArray894[anInt893++] = myPlayerIndex;
  9019. return;
  9020. }
  9021. if (k == 3) {
  9022. plane = stream.readBits(2);
  9023. int j1 = stream.readBits(1);
  9024. int i2 = stream.readBits(1);
  9025. if (i2 == 1)
  9026. anIntArray894[anInt893++] = myPlayerIndex;
  9027. int k2 = stream.readBits(7);
  9028. int l2 = stream.readBits(7);
  9029. myPlayer.setPos(l2, k2, j1 == 1);
  9030. }
  9031. }
  9032.  
  9033. private void nullLoader() {
  9034. aBoolean831 = false;
  9035. while (drawingFlames) {
  9036. aBoolean831 = false;
  9037. try {
  9038. Thread.sleep(50L);
  9039. } catch (Exception _ex) {
  9040. }
  9041. }
  9042. aBackground_966 = null;
  9043. aBackground_967 = null;
  9044. aBackgroundArray1152s = null;
  9045. anIntArray850 = null;
  9046. anIntArray851 = null;
  9047. anIntArray852 = null;
  9048. anIntArray853 = null;
  9049. anIntArray1190 = null;
  9050. anIntArray1191 = null;
  9051. anIntArray828 = null;
  9052. anIntArray829 = null;
  9053. aClass30_Sub2_Sub1_Sub1_1201 = null;
  9054. aClass30_Sub2_Sub1_Sub1_1202 = null;
  9055. }
  9056.  
  9057. private boolean method119(int i, int j) {
  9058. boolean flag1 = false;
  9059. RSInterface class9 = RSInterface.interfaceCache[j];
  9060. for (int k = 0; k < class9.children.length; k++) {
  9061. if (class9.children[k] == -1)
  9062. break;
  9063. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  9064. if (class9_1.type == 1)
  9065. flag1 |= method119(i, class9_1.id);
  9066. if (class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1)) {
  9067. boolean flag2 = interfaceIsSelected(class9_1);
  9068. int l;
  9069. if (flag2)
  9070. l = class9_1.anInt258;
  9071. else
  9072. l = class9_1.anInt257;
  9073. if (l != -1) {
  9074. Animation animation = Animation.anims[l];
  9075. for (class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);) {
  9076. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  9077. class9_1.anInt246++;
  9078. if (class9_1.anInt246 >= animation.anInt352) {
  9079. class9_1.anInt246 -= animation.anInt356;
  9080. if (class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  9081. class9_1.anInt246 = 0;
  9082. }
  9083. flag1 = true;
  9084. }
  9085.  
  9086. }
  9087. }
  9088. }
  9089.  
  9090. return flag1;
  9091. }
  9092.  
  9093. private int method120() {
  9094. int j = 3;
  9095. if (yCameraCurve < 310) {
  9096. int k = xCameraPos >> 7;
  9097. int l = yCameraPos >> 7;
  9098. int i1 = myPlayer.x >> 7;
  9099. int j1 = myPlayer.y >> 7;
  9100. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9101. j = plane;
  9102. int k1;
  9103. if (i1 > k)
  9104. k1 = i1 - k;
  9105. else
  9106. k1 = k - i1;
  9107. int l1;
  9108. if (j1 > l)
  9109. l1 = j1 - l;
  9110. else
  9111. l1 = l - j1;
  9112. if (k1 > l1) {
  9113. int i2 = (l1 * 0x10000) / k1;
  9114. int k2 = 32768;
  9115. while (k != i1) {
  9116. if (k < i1)
  9117. k++;
  9118. else if (k > i1)
  9119. k--;
  9120. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9121. j = plane;
  9122. k2 += i2;
  9123. if (k2 >= 0x10000) {
  9124. k2 -= 0x10000;
  9125. if (l < j1)
  9126. l++;
  9127. else if (l > j1)
  9128. l--;
  9129. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9130. j = plane;
  9131. }
  9132. }
  9133. } else {
  9134. int j2 = (k1 * 0x10000) / l1;
  9135. int l2 = 32768;
  9136. while (l != j1) {
  9137. if (l < j1)
  9138. l++;
  9139. else if (l > j1)
  9140. l--;
  9141. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9142. j = plane;
  9143. l2 += j2;
  9144. if (l2 >= 0x10000) {
  9145. l2 -= 0x10000;
  9146. if (k < i1)
  9147. k++;
  9148. else if (k > i1)
  9149. k--;
  9150. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9151. j = plane;
  9152. }
  9153. }
  9154. }
  9155. }
  9156. if ((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  9157. j = plane;
  9158. return j;
  9159. }
  9160.  
  9161. private int method121() {
  9162. int j = method42(plane, yCameraPos, xCameraPos);
  9163. if (j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  9164. return plane;
  9165. else
  9166. return 3;
  9167. }
  9168.  
  9169. private void delIgnore(long l) {
  9170. try {
  9171. if (l == 0L)
  9172. return;
  9173. for (int j = 0; j < ignoreCount; j++)
  9174. if (ignoreListAsLongs[j] == l) {
  9175. ignoreCount--;
  9176. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  9177.  
  9178. stream.createFrame(74);
  9179. stream.writeQWord(l);
  9180. return;
  9181. }
  9182.  
  9183. return;
  9184. } catch (RuntimeException runtimeexception) {
  9185. Signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9186. }
  9187. throw new RuntimeException();
  9188. }
  9189.  
  9190. private void chatJoin(long l) {
  9191. try {
  9192. if (l == 0L)
  9193. return;
  9194. stream.createFrame(60);
  9195. stream.writeQWord(l);
  9196. return;
  9197. } catch (RuntimeException runtimeexception) {
  9198. Signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9199. }
  9200. throw new RuntimeException();
  9201.  
  9202. }
  9203.  
  9204. public String getParameter(String s) {
  9205. if (Signlink.mainapp != null)
  9206. return Signlink.mainapp.getParameter(s);
  9207. else
  9208. return super.getParameter(s);
  9209. }
  9210.  
  9211. private void adjustVolume(boolean flag, int i) {
  9212. Signlink.midivol = i;
  9213. if (flag)
  9214. Signlink.midi = "voladjust";
  9215. }
  9216.  
  9217. private int extractInterfaceValues(RSInterface class9, int j) {
  9218. if (class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  9219. return -2;
  9220. try {
  9221. int ai[] = class9.valueIndexArray[j];
  9222. int k = 0;
  9223. int l = 0;
  9224. int i1 = 0;
  9225. do {
  9226. int j1 = ai[l++];
  9227. int k1 = 0;
  9228. byte byte0 = 0;
  9229. if (j1 == 0)
  9230. return k;
  9231. if (j1 == 1)
  9232. k1 = currentStats[ai[l++]];
  9233. if (j1 == 2)
  9234. k1 = maxStats[ai[l++]];
  9235. if (j1 == 3)
  9236. k1 = currentExp[ai[l++]];
  9237. if (j1 == 4) {
  9238. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  9239. int k2 = ai[l++];
  9240. if (k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers)) {
  9241. for (int j3 = 0; j3 < class9_1.inv.length; j3++)
  9242. if (class9_1.inv[j3] == k2 + 1)
  9243. k1 += class9_1.invStackSizes[j3];
  9244.  
  9245. }
  9246. }
  9247. if (j1 == 5)
  9248. k1 = variousSettings[ai[l++]];
  9249. if (j1 == 6)
  9250. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  9251. if (j1 == 7)
  9252. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  9253. if (j1 == 8)
  9254. k1 = myPlayer.combatLevel;
  9255. if (j1 == 9) {
  9256. for (int l1 = 0; l1 < Skills.skillsCount; l1++)
  9257. if (Skills.skillEnabled[l1])
  9258. k1 += maxStats[l1];
  9259.  
  9260. }
  9261. if (j1 == 10) {
  9262. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  9263. int l2 = ai[l++] + 1;
  9264. if (l2 >= 0 && l2 < ItemDef.totalItems && isMembers) {
  9265. for (int k3 = 0; k3 < class9_2.inv.length; k3++) {
  9266. if (class9_2.inv[k3] != l2)
  9267. continue;
  9268. k1 = 0x3b9ac9ff;
  9269. break;
  9270. }
  9271.  
  9272. }
  9273. }
  9274. if (j1 == 11)
  9275. k1 = energy;
  9276. if (j1 == 12)
  9277. k1 = weight;
  9278. if (j1 == 13) {
  9279. int i2 = variousSettings[ai[l++]];
  9280. int i3 = ai[l++];
  9281. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  9282. }
  9283. if (j1 == 14) {
  9284. int j2 = ai[l++];
  9285. VarBit varBit = VarBit.cache[j2];
  9286. int l3 = varBit.anInt648;
  9287. int i4 = varBit.anInt649;
  9288. int j4 = varBit.anInt650;
  9289. int k4 = anIntArray1232[j4 - i4];
  9290. k1 = variousSettings[l3] >> i4 & k4;
  9291. }
  9292. if (j1 == 15)
  9293. byte0 = 1;
  9294. if (j1 == 16)
  9295. byte0 = 2;
  9296. if (j1 == 17)
  9297. byte0 = 3;
  9298. if (j1 == 18)
  9299. k1 = (myPlayer.x >> 7) + baseX;
  9300. if (j1 == 19)
  9301. k1 = (myPlayer.y >> 7) + baseY;
  9302. if (j1 == 20)
  9303. k1 = ai[l++];
  9304. if (byte0 == 0) {
  9305. if (i1 == 0)
  9306. k += k1;
  9307. if (i1 == 1)
  9308. k -= k1;
  9309. if (i1 == 2 && k1 != 0)
  9310. k /= k1;
  9311. if (i1 == 3)
  9312. k *= k1;
  9313. i1 = 0;
  9314. } else {
  9315. i1 = byte0;
  9316. }
  9317. } while (true);
  9318. } catch (Exception _ex) {
  9319. return -1;
  9320. }
  9321. }
  9322.  
  9323. private void drawTooltip() {
  9324. if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  9325. return;
  9326. String s;
  9327. if (itemSelected == 1 && menuActionRow < 2)
  9328. s = "Use " + selectedItemName + " with...";
  9329. else if (spellSelected == 1 && menuActionRow < 2)
  9330. s = spellTooltip + "...";
  9331. else
  9332. s = menuActionName[menuActionRow - 1];
  9333. if (menuActionRow > 2)
  9334. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  9335. boldText.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  9336. }
  9337.  
  9338. private void markMinimap(Sprite sprite, int x, int y) {
  9339. if (sprite == null)
  9340. return;
  9341. try {
  9342. int k = minimapInt1 + minimapInt2 & 0x7ff;
  9343. int l = x * x + y * y;
  9344. if (l > 6400) {
  9345. return;
  9346. }
  9347. int i1 = Model.modelIntArray1[k];
  9348. int j1 = Model.modelIntArray2[k];
  9349. i1 = (i1 * 256) / (minimapInt3 + 256);
  9350. j1 = (j1 * 256) / (minimapInt3 + 256);
  9351. int k1 = y * i1 + x * j1 >> 16;
  9352. int l1 = y * j1 - x * i1 >> 16;
  9353. if (frameMode == ScreenMode.FIXED) {
  9354. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 + 30, 83 - l1 - sprite.anInt1445 / 2 - 4 + 5);
  9355. } else {
  9356. sprite.drawSprite(((77 + k1) - sprite.anInt1444 / 2) + 4 + (frameWidth - 167), 85 - l1 - sprite.anInt1445 / 2 - 4);
  9357. }
  9358. } catch (Exception e) {
  9359.  
  9360. }
  9361. }
  9362.  
  9363. private void drawMinimap() {
  9364. for(int i = 0; i < 78; i++) {
  9365. int circle = (int) (Math.sqrt(Math.pow(79, 2) - Math.pow(77 - i, 2)));
  9366. anIntArray1229[i] = 2 * circle + 4;
  9367. anIntArray1229[151 - i] = 2 * circle + 4;
  9368. anIntArray1052[i] = -circle + 73;
  9369. anIntArray1052[151 - i] = -circle + 73;
  9370. }
  9371. if (frameMode == ScreenMode.FIXED) {
  9372. aRSImageProducer_1164.initDrawingArea();
  9373. }
  9374. if (anInt1021 == 2) {
  9375. if (frameMode == ScreenMode.FIXED) {
  9376. cacheSprite[16].drawSprite(0, 0);
  9377. } else {
  9378. cacheSprite[30].drawSprite(frameWidth - 181, 0);
  9379. cacheSprite[31].drawSprite(frameWidth - 158, 7);
  9380. }
  9381. if (frameMode != ScreenMode.FIXED && changeTabArea) {
  9382. if (super.mouseX >= frameWidth - 26 && super.mouseX <= frameWidth - 1 && super.mouseY >= 2 && super.mouseY <= 24 || tabID == 15) {
  9383. cacheSprite[22].drawSprite(frameWidth - 25, 2);
  9384. } else {
  9385. cacheSprite[22].drawARGBSprite(frameWidth - 25, 2, 165);
  9386. }
  9387. }
  9388. cacheSprite[xpCounterHover ? 20 : 19].drawSprite((frameMode == ScreenMode.FIXED ? 0 : frameWidth - 214), (frameMode == ScreenMode.FIXED ? 20 : 10));
  9389. loadAllOrbs(frameMode == ScreenMode.FIXED ? 0 : frameWidth - 212);
  9390. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, (frameMode == ScreenMode.FIXED ? 25 : 24), 4, (frameMode == ScreenMode.FIXED ? 29 : frameWidth - 176), 33, 25);
  9391. if (menuOpen) {
  9392. drawMenu(frameMode == ScreenMode.FIXED ? 516 : 0, 0);
  9393. }
  9394. if (frameMode == ScreenMode.FIXED) {
  9395. aRSImageProducer_1164.initDrawingArea();
  9396. }
  9397. return;
  9398. }
  9399. int i = minimapInt1 + minimapInt2 & 0x7ff;
  9400. int j = 48 + myPlayer.x / 32;
  9401. int l2 = 464 - myPlayer.y / 32;
  9402. minimapImage.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, (frameMode == ScreenMode.FIXED ? 9 : 7), (frameMode == ScreenMode.FIXED ? 54 : frameWidth - 157), 146, j);
  9403. for (int j5 = 0; j5 < anInt1071; j5++) {
  9404. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  9405. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  9406. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  9407. }
  9408. for (int k5 = 0; k5 < 104; k5++) {
  9409. for (int l5 = 0; l5 < 104; l5++) {
  9410. NodeList class19 = groundArray[plane][k5][l5];
  9411. if (class19 != null) {
  9412. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  9413. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  9414. markMinimap(mapDotItem, l, j3);
  9415. }
  9416. }
  9417. }
  9418. for (int i6 = 0; i6 < npcCount; i6++) {
  9419. Npc npc = npcArray[npcIndices[i6]];
  9420. if (npc != null && npc.isVisible()) {
  9421. EntityDef entityDef = npc.desc;
  9422. if (entityDef.childrenIDs != null) {
  9423. entityDef = entityDef.method161();
  9424. }
  9425. if (entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  9426. int i1 = npc.x / 32 - myPlayer.x / 32;
  9427. int k3 = npc.y / 32 - myPlayer.y / 32;
  9428. markMinimap(mapDotNPC, i1, k3);
  9429. }
  9430. }
  9431. }
  9432. for (int j6 = 0; j6 < playerCount; j6++) {
  9433. Player player = playerArray[playerIndices[j6]];
  9434. if (player != null && player.isVisible()) {
  9435. int j1 = player.x / 32 - myPlayer.x / 32;
  9436. int l3 = player.y / 32 - myPlayer.y / 32;
  9437. boolean flag1 = false;
  9438. boolean flag3 = false;
  9439. for (int j3 = 0; j3 < clanList.length; j3++) {
  9440. if (clanList[j3] == null) {
  9441. continue;
  9442. }
  9443. if (!clanList[j3].equalsIgnoreCase(player.name)) {
  9444. continue;
  9445. }
  9446. flag3 = true;
  9447. break;
  9448. }
  9449. long l6 = TextClass.longForName(player.name);
  9450. for (int k6 = 0; k6 < friendsCount; k6++) {
  9451. if (l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0) {
  9452. continue;
  9453. }
  9454. flag1 = true;
  9455. break;
  9456. }
  9457. boolean flag2 = false;
  9458. if (myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team) {
  9459. flag2 = true;
  9460. }
  9461. if (flag1) {
  9462. markMinimap(mapDotFriend, j1, l3);
  9463. } else if (flag3) {
  9464. markMinimap(mapDotClan, j1, l3);
  9465. } else if (flag2) {
  9466. markMinimap(mapDotTeam, j1, l3);
  9467. } else {
  9468. markMinimap(mapDotPlayer, j1, l3);
  9469. }
  9470. }
  9471. }
  9472. if (anInt855 != 0 && loopCycle % 20 < 10) {
  9473. if (anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  9474. Npc class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  9475. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  9476. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  9477. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  9478. method81(mapMarker, i4, k1);
  9479. }
  9480. }
  9481. if (anInt855 == 2) {
  9482. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  9483. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  9484. method81(mapMarker, j4, l1);
  9485. }
  9486. if (anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length) {
  9487. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  9488. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  9489. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  9490. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  9491. method81(mapMarker, k4, i2);
  9492. }
  9493. }
  9494. }
  9495. if (destX != 0) {
  9496. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  9497. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  9498. markMinimap(mapFlag, j2, l4);
  9499. }
  9500. DrawingArea.drawPixels(3, (frameMode == ScreenMode.FIXED ? 83 : 79), (frameMode == ScreenMode.FIXED ? 127 : frameWidth - 87), 0xffffff, 3);
  9501. if (frameMode == ScreenMode.FIXED) {
  9502. cacheSprite[16].drawSprite(0, 0);
  9503. } else {
  9504. cacheSprite[30].drawSprite(frameWidth - 181, 0);
  9505. }
  9506. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, (frameMode == ScreenMode.FIXED ? 25 : 24), 4, (frameMode == ScreenMode.FIXED ? 29 : frameWidth - 176), 33, 25);
  9507. if (frameMode != ScreenMode.FIXED && changeTabArea) {
  9508. if (super.mouseX >= frameWidth - 26 && super.mouseX <= frameWidth - 1 && super.mouseY >= 2 && super.mouseY <= 24 || tabID == 15) {
  9509. cacheSprite[22].drawSprite(frameWidth - 25, 2);
  9510. } else {
  9511. cacheSprite[22].drawARGBSprite(frameWidth - 25, 2, 165);
  9512. }
  9513. }
  9514. cacheSprite[xpCounterHover ? 20 : 19].drawSprite((frameMode == ScreenMode.FIXED ? 0 : frameWidth - 214), (frameMode == ScreenMode.FIXED ? 20 : 10));
  9515. loadAllOrbs(frameMode == ScreenMode.FIXED ? 0 : frameWidth - 212);
  9516. if (menuOpen) {
  9517. drawMenu(frameMode == ScreenMode.FIXED ? 516 : 0, 0);
  9518. }
  9519. if (frameMode == ScreenMode.FIXED) {
  9520. aRSImageProducer_1165.initDrawingArea();
  9521. }
  9522. }
  9523.  
  9524. private void npcScreenPos(Entity entity, int i) {
  9525. calcEntityScreenPos(entity.x, i, entity.y);
  9526. }
  9527.  
  9528. private void calcEntityScreenPos(int i, int j, int l) {
  9529. if (i < 128 || l < 128 || i > 13056 || l > 13056) {
  9530. spriteDrawX = -1;
  9531. spriteDrawY = -1;
  9532. return;
  9533. }
  9534. int i1 = method42(plane, l, i) - j;
  9535. i -= xCameraPos;
  9536. i1 -= zCameraPos;
  9537. l -= yCameraPos;
  9538. int j1 = Model.modelIntArray1[yCameraCurve];
  9539. int k1 = Model.modelIntArray2[yCameraCurve];
  9540. int l1 = Model.modelIntArray1[xCameraCurve];
  9541. int i2 = Model.modelIntArray2[xCameraCurve];
  9542. int j2 = l * l1 + i * i2 >> 16;
  9543. l = l * i2 - i * l1 >> 16;
  9544. i = j2;
  9545. j2 = i1 * k1 - l * j1 >> 16;
  9546. l = i1 * j1 + l * k1 >> 16;
  9547. i1 = j2;
  9548. if (l >= 50) {
  9549. spriteDrawX = Texture.textureInt1 + (i << WorldController.viewDistance) / l;
  9550. spriteDrawY = Texture.textureInt2 + (i1 << WorldController.viewDistance) / l;
  9551. } else {
  9552. spriteDrawX = -1;
  9553. spriteDrawY = -1;
  9554. }
  9555. }
  9556.  
  9557. private void buildSplitPrivateChatMenu() {
  9558. if (splitPrivateChat == 0)
  9559. return;
  9560. int i = 0;
  9561. if (anInt1104 != 0)
  9562. i = 1;
  9563. for (int j = 0; j < 100; j++)
  9564. if (chatMessages[j] != null) {
  9565. int k = chatTypes[j];
  9566. String s = chatNames[j];
  9567. if (s != null && s.startsWith("@cr1@")) {
  9568. s = s.substring(5);
  9569. }
  9570. if (s != null && s.startsWith("@cr2@")) {
  9571. s = s.substring(5);
  9572. }
  9573. if ((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  9574. int l = 329 - i * 13;
  9575. if (frameMode != ScreenMode.FIXED) {
  9576. l = frameHeight - 170 - i * 13;
  9577. }
  9578. int offSet = frameMode == ScreenMode.FIXED ? 4 : 0;
  9579. if (super.mouseX > 4 && super.mouseY - offSet > l - 10 && super.mouseY - offSet <= l + 3) {
  9580. int i1 = regularText.getTextWidth("From: " + s + chatMessages[j]) + 25;
  9581. if (i1 > 450)
  9582. i1 = 450;
  9583. if (super.mouseX < 4 + i1) {
  9584. if (myPrivilege >= 1) {
  9585. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  9586. menuActionID[menuActionRow] = 2606;
  9587. menuActionRow++;
  9588. }
  9589. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  9590. menuActionID[menuActionRow] = 2042;
  9591. menuActionRow++;
  9592. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  9593. menuActionID[menuActionRow] = 2337;
  9594. menuActionRow++;
  9595. }
  9596. }
  9597. if (++i >= 5)
  9598. return;
  9599. }
  9600. if ((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  9601. return;
  9602. }
  9603.  
  9604. }
  9605.  
  9606. private void method130(int j, int k, int l, int i1, int j1, int k1, int l1, int i2, int j2) {
  9607. Class30_Sub1 class30_sub1 = null;
  9608. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179.reverseGetNext()) {
  9609. if (class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  9610. continue;
  9611. class30_sub1 = class30_sub1_1;
  9612. break;
  9613. }
  9614.  
  9615. if (class30_sub1 == null) {
  9616. class30_sub1 = new Class30_Sub1();
  9617. class30_sub1.anInt1295 = l1;
  9618. class30_sub1.anInt1296 = i1;
  9619. class30_sub1.anInt1297 = i2;
  9620. class30_sub1.anInt1298 = j1;
  9621. method89(class30_sub1);
  9622. aClass19_1179.insertHead(class30_sub1);
  9623. }
  9624. class30_sub1.anInt1291 = k;
  9625. class30_sub1.anInt1293 = k1;
  9626. class30_sub1.anInt1292 = l;
  9627. class30_sub1.anInt1302 = j2;
  9628. class30_sub1.anInt1294 = j;
  9629. }
  9630.  
  9631. private boolean interfaceIsSelected(RSInterface class9) {
  9632. if (class9.anIntArray245 == null)
  9633. return false;
  9634. for (int i = 0; i < class9.anIntArray245.length; i++) {
  9635. int j = extractInterfaceValues(class9, i);
  9636. int k = class9.anIntArray212[i];
  9637. if (class9.anIntArray245[i] == 2) {
  9638. if (j >= k)
  9639. return false;
  9640. } else if (class9.anIntArray245[i] == 3) {
  9641. if (j <= k)
  9642. return false;
  9643. } else if (class9.anIntArray245[i] == 4) {
  9644. if (j == k)
  9645. return false;
  9646. } else if (j != k)
  9647. return false;
  9648. }
  9649.  
  9650. return true;
  9651. }
  9652.  
  9653. private DataInputStream openJagGrabInputStream(String s) throws IOException {
  9654. // if(!aBoolean872)
  9655. // if(signlink.mainapp != null)
  9656. // return signlink.openurl(s);
  9657. // else
  9658. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  9659. if (aSocket832 != null) {
  9660. try {
  9661. aSocket832.close();
  9662. } catch (Exception _ex) {
  9663. }
  9664. aSocket832 = null;
  9665. }
  9666. aSocket832 = openSocket(43595);
  9667. aSocket832.setSoTimeout(10000);
  9668. java.io.InputStream inputstream = aSocket832.getInputStream();
  9669. OutputStream outputstream = aSocket832.getOutputStream();
  9670. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  9671. return new DataInputStream(inputstream);
  9672. }
  9673.  
  9674. private void doFlamesDrawing() {
  9675. char c = '\u0100';
  9676. if (anInt1040 > 0) {
  9677. for (int i = 0; i < 256; i++)
  9678. if (anInt1040 > 768)
  9679. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  9680. else if (anInt1040 > 256)
  9681. anIntArray850[i] = anIntArray852[i];
  9682. else
  9683. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  9684.  
  9685. } else if (anInt1041 > 0) {
  9686. for (int j = 0; j < 256; j++)
  9687. if (anInt1041 > 768)
  9688. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  9689. else if (anInt1041 > 256)
  9690. anIntArray850[j] = anIntArray853[j];
  9691. else
  9692. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  9693.  
  9694. } else {
  9695. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  9696.  
  9697. }
  9698. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, aRSImageProducer_1110.canvasRaster, 0, 33920);
  9699.  
  9700. int i1 = 0;
  9701. int j1 = 1152;
  9702. for (int k1 = 1; k1 < c - 1; k1++) {
  9703. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  9704. int j2 = 22 + l1;
  9705. if (j2 < 0)
  9706. j2 = 0;
  9707. i1 += j2;
  9708. for (int l2 = j2; l2 < 128; l2++) {
  9709. int j3 = anIntArray828[i1++];
  9710. if (j3 != 0) {
  9711. int l3 = j3;
  9712. int j4 = 256 - j3;
  9713. j3 = anIntArray850[j3];
  9714. int l4 = aRSImageProducer_1110.canvasRaster[j1];
  9715. aRSImageProducer_1110.canvasRaster[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  9716. } else {
  9717. j1++;
  9718. }
  9719. }
  9720.  
  9721. j1 += j2;
  9722. }
  9723.  
  9724. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  9725. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, aRSImageProducer_1111.canvasRaster, 0, 33920);
  9726.  
  9727. i1 = 0;
  9728. j1 = 1176;
  9729. for (int k2 = 1; k2 < c - 1; k2++) {
  9730. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  9731. int k3 = 103 - i3;
  9732. j1 += i3;
  9733. for (int i4 = 0; i4 < k3; i4++) {
  9734. int k4 = anIntArray828[i1++];
  9735. if (k4 != 0) {
  9736. int i5 = k4;
  9737. int j5 = 256 - k4;
  9738. k4 = anIntArray850[k4];
  9739. int k5 = aRSImageProducer_1111.canvasRaster[j1];
  9740. aRSImageProducer_1111.canvasRaster[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  9741. } else {
  9742. j1++;
  9743. }
  9744. }
  9745.  
  9746. i1 += 128 - k3;
  9747. j1 += 128 - k3 - i3;
  9748. }
  9749.  
  9750. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  9751. }
  9752.  
  9753. private void method134(Stream stream) {
  9754. int j = stream.readBits(8);
  9755. if (j < playerCount) {
  9756. for (int k = j; k < playerCount; k++)
  9757. anIntArray840[anInt839++] = playerIndices[k];
  9758.  
  9759. }
  9760. if (j > playerCount) {
  9761. Signlink.reporterror(myUsername + " Too many players");
  9762. throw new RuntimeException("eek");
  9763. }
  9764. playerCount = 0;
  9765. for (int l = 0; l < j; l++) {
  9766. int i1 = playerIndices[l];
  9767. Player player = playerArray[i1];
  9768. int j1 = stream.readBits(1);
  9769. if (j1 == 0) {
  9770. playerIndices[playerCount++] = i1;
  9771. player.anInt1537 = loopCycle;
  9772. } else {
  9773. int k1 = stream.readBits(2);
  9774. if (k1 == 0) {
  9775. playerIndices[playerCount++] = i1;
  9776. player.anInt1537 = loopCycle;
  9777. anIntArray894[anInt893++] = i1;
  9778. } else if (k1 == 1) {
  9779. playerIndices[playerCount++] = i1;
  9780. player.anInt1537 = loopCycle;
  9781. int l1 = stream.readBits(3);
  9782. player.moveInDir(false, l1);
  9783. int j2 = stream.readBits(1);
  9784. if (j2 == 1)
  9785. anIntArray894[anInt893++] = i1;
  9786. } else if (k1 == 2) {
  9787. playerIndices[playerCount++] = i1;
  9788. player.anInt1537 = loopCycle;
  9789. int i2 = stream.readBits(3);
  9790. player.moveInDir(true, i2);
  9791. int k2 = stream.readBits(3);
  9792. player.moveInDir(true, k2);
  9793. int l2 = stream.readBits(1);
  9794. if (l2 == 1)
  9795. anIntArray894[anInt893++] = i1;
  9796. } else if (k1 == 3)
  9797. anIntArray840[anInt839++] = i1;
  9798. }
  9799. }
  9800. }
  9801.  
  9802. private void drawLoginScreen(boolean flag) {
  9803. resetImageProducers();
  9804. aRSImageProducer_1109.initDrawingArea();
  9805. aBackground_966.drawBackground(0, 0);
  9806. char c = '\u0168';
  9807. char c1 = '\310';
  9808. if (loginScreenState == 0) {
  9809. int i = c1 / 2 + 80;
  9810. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  9811. i = c1 / 2 - 20;
  9812. boldText.method382(0xffff00, c / 2, "Welcome to " + ClientConstants.CLIENT_NAME, i, true);
  9813. i += 30;
  9814. int l = c / 2 - 80;
  9815. int k1 = c1 / 2 + 20;
  9816. aBackground_967.drawBackground(l - 73, k1 - 20);
  9817. boldText.method382(0xffffff, l, "New User", k1 + 5, true);
  9818. l = c / 2 + 80;
  9819. aBackground_967.drawBackground(l - 73, k1 - 20);
  9820. boldText.method382(0xffffff, l, "Existing User", k1 + 5, true);
  9821. }
  9822. if (loginScreenState == 2) {
  9823. int j = c1 / 2 - 40;
  9824. if (loginMessage1.length() > 0) {
  9825. boldText.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  9826. boldText.method382(0xffff00, c / 2, loginMessage2, j, true);
  9827. j += 30;
  9828. } else {
  9829. boldText.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  9830. j += 30;
  9831. }
  9832. boldText.method389(true, c / 2 - 90, 0xffffff, "Username: " + myUsername + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  9833. j += 15;
  9834. boldText.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  9835. j += 15;
  9836. if (!flag) {
  9837. int i1 = c / 2 - 80;
  9838. int l1 = c1 / 2 + 50;
  9839. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  9840. boldText.method382(0xffffff, i1, "Login", l1 + 5, true);
  9841. i1 = c / 2 + 80;
  9842. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  9843. boldText.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  9844. }
  9845. }
  9846. if (loginScreenState == 3) {
  9847. boldText.method382(0xffff00, c / 2, "Create a free account", c1 / 2 - 60, true);
  9848. int k = c1 / 2 - 35;
  9849. boldText.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
  9850. k += 15;
  9851. boldText.method382(0xffffff, c / 2, "go back to the main " + ClientConstants.CLIENT_NAME + " webpage", k, true);
  9852. k += 15;
  9853. boldText.method382(0xffffff, c / 2, "and choose the red 'create account'", k, true);
  9854. k += 15;
  9855. boldText.method382(0xffffff, c / 2, "button at the top right of that page.", k, true);
  9856. k += 15;
  9857. int j1 = c / 2;
  9858. int i2 = c1 / 2 + 50;
  9859. aBackground_967.drawBackground(j1 - 73, i2 - 20);
  9860. boldText.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  9861. }
  9862. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  9863. if (welcomeScreenRaised) {
  9864. welcomeScreenRaised = false;
  9865. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  9866. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  9867. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  9868. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  9869. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  9870. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  9871. }
  9872. worldSelection();
  9873. }
  9874.  
  9875. private void drawFlames() {
  9876. drawingFlames = true;
  9877. try {
  9878. long l = System.currentTimeMillis();
  9879. int i = 0;
  9880. int j = 20;
  9881. while (aBoolean831) {
  9882. calcFlamesPosition();
  9883. calcFlamesPosition();
  9884. doFlamesDrawing();
  9885. if (++i > 10) {
  9886. long l1 = System.currentTimeMillis();
  9887. int k = (int) (l1 - l) / 10 - j;
  9888. j = 40 - k;
  9889. if (j < 5)
  9890. j = 5;
  9891. i = 0;
  9892. l = l1;
  9893. }
  9894. try {
  9895. Thread.sleep(j);
  9896. } catch (Exception _ex) {
  9897. }
  9898. }
  9899. } catch (Exception _ex) {
  9900. }
  9901. drawingFlames = false;
  9902. }
  9903.  
  9904. public void raiseWelcomeScreen() {
  9905. welcomeScreenRaised = true;
  9906. }
  9907.  
  9908. private void method137(Stream stream, int j) {
  9909. if (j == 84) {
  9910. int k = stream.readUnsignedByte();
  9911. int j3 = anInt1268 + (k >> 4 & 7);
  9912. int i6 = anInt1269 + (k & 7);
  9913. int l8 = stream.readUnsignedWord();
  9914. int k11 = stream.readUnsignedWord();
  9915. int l13 = stream.readUnsignedWord();
  9916. if (j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104) {
  9917. NodeList class19_1 = groundArray[plane][j3][i6];
  9918. if (class19_1 != null) {
  9919. 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()) {
  9920. if (class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  9921. continue;
  9922. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  9923. break;
  9924. }
  9925.  
  9926. spawnGroundItem(j3, i6);
  9927. }
  9928. }
  9929. return;
  9930. }
  9931. if (j == 105) {
  9932. int l = stream.readUnsignedByte();
  9933. int k3 = anInt1268 + (l >> 4 & 7);
  9934. int j6 = anInt1269 + (l & 7);
  9935. int i9 = stream.readUnsignedWord();
  9936. int l11 = stream.readUnsignedByte();
  9937. int i14 = l11 >> 4 & 0xf;
  9938. int i16 = l11 & 7;
  9939. 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) {
  9940. anIntArray1207[anInt1062] = i9;
  9941. anIntArray1241[anInt1062] = i16;
  9942. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  9943. anInt1062++;
  9944. }
  9945. }
  9946. if (j == 215) {
  9947. int i1 = stream.method435();
  9948. int l3 = stream.method428();
  9949. int k6 = anInt1268 + (l3 >> 4 & 7);
  9950. int j9 = anInt1269 + (l3 & 7);
  9951. int i12 = stream.method435();
  9952. int j14 = stream.readUnsignedWord();
  9953. if (k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10) {
  9954. Item class30_sub2_sub4_sub2_2 = new Item();
  9955. class30_sub2_sub4_sub2_2.ID = i1;
  9956. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  9957. if (groundArray[plane][k6][j9] == null)
  9958. groundArray[plane][k6][j9] = new NodeList();
  9959. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  9960. spawnGroundItem(k6, j9);
  9961. }
  9962. return;
  9963. }
  9964. if (j == 156) {
  9965. int j1 = stream.method426();
  9966. int i4 = anInt1268 + (j1 >> 4 & 7);
  9967. int l6 = anInt1269 + (j1 & 7);
  9968. int k9 = stream.readUnsignedWord();
  9969. if (i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104) {
  9970. NodeList class19 = groundArray[plane][i4][l6];
  9971. if (class19 != null) {
  9972. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19.reverseGetNext()) {
  9973. if (item.ID != (k9 & 0x7fff))
  9974. continue;
  9975. item.unlink();
  9976. break;
  9977. }
  9978.  
  9979. if (class19.reverseGetFirst() == null)
  9980. groundArray[plane][i4][l6] = null;
  9981. spawnGroundItem(i4, l6);
  9982. }
  9983. }
  9984. return;
  9985. }
  9986. if (j == 160) {
  9987. int k1 = stream.method428();
  9988. int j4 = anInt1268 + (k1 >> 4 & 7);
  9989. int i7 = anInt1269 + (k1 & 7);
  9990. int l9 = stream.method428();
  9991. int j12 = l9 >> 2;
  9992. int k14 = l9 & 3;
  9993. int j16 = anIntArray1177[j12];
  9994. int j17 = stream.method435();
  9995. if (j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103) {
  9996. int j18 = intGroundArray[plane][j4][i7];
  9997. int i19 = intGroundArray[plane][j4 + 1][i7];
  9998. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  9999. int k20 = intGroundArray[plane][j4][i7 + 1];
  10000. if (j16 == 0) {
  10001. Object1 class10 = worldController.method296(plane, j4, i7);
  10002. if (class10 != null) {
  10003. int k21 = class10.uid >> 14 & 0x7fff;
  10004. if (j12 == 2) {
  10005. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  10006. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  10007. } else {
  10008. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  10009. }
  10010. }
  10011. }
  10012. if (j16 == 1) {
  10013. Object2 class26 = worldController.method297(j4, i7, plane);
  10014. if (class26 != null)
  10015. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  10016. }
  10017. if (j16 == 2) {
  10018. Object5 class28 = worldController.method298(j4, i7, plane);
  10019. if (j12 == 11)
  10020. j12 = 10;
  10021. if (class28 != null)
  10022. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  10023. }
  10024. if (j16 == 3) {
  10025. Object3 class49 = worldController.method299(i7, j4, plane);
  10026. if (class49 != null)
  10027. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  10028. }
  10029. }
  10030. return;
  10031. }
  10032. if (j == 147) {
  10033. int l1 = stream.method428();
  10034. int k4 = anInt1268 + (l1 >> 4 & 7);
  10035. int j7 = anInt1269 + (l1 & 7);
  10036. int i10 = stream.readUnsignedWord();
  10037. byte byte0 = stream.method430();
  10038. int l14 = stream.method434();
  10039. byte byte1 = stream.method429();
  10040. int k17 = stream.readUnsignedWord();
  10041. int k18 = stream.method428();
  10042. int j19 = k18 >> 2;
  10043. int i20 = k18 & 3;
  10044. int l20 = anIntArray1177[j19];
  10045. byte byte2 = stream.readSignedByte();
  10046. int l21 = stream.readUnsignedWord();
  10047. byte byte3 = stream.method429();
  10048. Player player;
  10049. if (i10 == unknownInt10)
  10050. player = myPlayer;
  10051. else
  10052. player = playerArray[i10];
  10053. if (player != null) {
  10054. ObjectDef class46 = ObjectDef.forID(l21);
  10055. int i22 = intGroundArray[plane][k4][j7];
  10056. int j22 = intGroundArray[plane][k4 + 1][j7];
  10057. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  10058. int l22 = intGroundArray[plane][k4][j7 + 1];
  10059. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1, -1, -1, -1);
  10060. if (model != null) {
  10061. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  10062. player.anInt1707 = l14 + loopCycle;
  10063. player.anInt1708 = k17 + loopCycle;
  10064. player.aModel_1714 = model;
  10065. int i23 = class46.anInt744;
  10066. int j23 = class46.anInt761;
  10067. if (i20 == 1 || i20 == 3) {
  10068. i23 = class46.anInt761;
  10069. j23 = class46.anInt744;
  10070. }
  10071. player.anInt1711 = k4 * 128 + i23 * 64;
  10072. player.anInt1713 = j7 * 128 + j23 * 64;
  10073. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  10074. if (byte2 > byte0) {
  10075. byte byte4 = byte2;
  10076. byte2 = byte0;
  10077. byte0 = byte4;
  10078. }
  10079. if (byte3 > byte1) {
  10080. byte byte5 = byte3;
  10081. byte3 = byte1;
  10082. byte1 = byte5;
  10083. }
  10084. player.anInt1719 = k4 + byte2;
  10085. player.anInt1721 = k4 + byte0;
  10086. player.anInt1720 = j7 + byte3;
  10087. player.anInt1722 = j7 + byte1;
  10088. }
  10089. }
  10090. }
  10091. if (j == 151) {
  10092. int i2 = stream.method426();
  10093. int l4 = anInt1268 + (i2 >> 4 & 7);
  10094. int k7 = anInt1269 + (i2 & 7);
  10095. int j10 = stream.method434();
  10096. int k12 = stream.method428();
  10097. int i15 = k12 >> 2;
  10098. int k16 = k12 & 3;
  10099. int l17 = anIntArray1177[i15];
  10100. if (l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  10101. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  10102. return;
  10103. }
  10104. if (j == 4) {
  10105. int j2 = stream.readUnsignedByte();
  10106. int i5 = anInt1268 + (j2 >> 4 & 7);
  10107. int l7 = anInt1269 + (j2 & 7);
  10108. int k10 = stream.readUnsignedWord();
  10109. int l12 = stream.readUnsignedByte();
  10110. int j15 = stream.readUnsignedWord();
  10111. if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) {
  10112. i5 = i5 * 128 + 64;
  10113. l7 = l7 * 128 + 64;
  10114. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  10115. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  10116. }
  10117. return;
  10118. }
  10119. if (j == 44) {
  10120. int k2 = stream.method436();
  10121. int j5 = stream.readUnsignedWord();
  10122. int i8 = stream.readUnsignedByte();
  10123. int l10 = anInt1268 + (i8 >> 4 & 7);
  10124. int i13 = anInt1269 + (i8 & 7);
  10125. if (l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104) {
  10126. Item class30_sub2_sub4_sub2_1 = new Item();
  10127. class30_sub2_sub4_sub2_1.ID = k2;
  10128. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  10129. if (groundArray[plane][l10][i13] == null)
  10130. groundArray[plane][l10][i13] = new NodeList();
  10131. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  10132. spawnGroundItem(l10, i13);
  10133. }
  10134. return;
  10135. }
  10136. if (j == 101) {
  10137. int l2 = stream.method427();
  10138. int k5 = l2 >> 2;
  10139. int j8 = l2 & 3;
  10140. int i11 = anIntArray1177[k5];
  10141. int j13 = stream.readUnsignedByte();
  10142. int k15 = anInt1268 + (j13 >> 4 & 7);
  10143. int l16 = anInt1269 + (j13 & 7);
  10144. if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  10145. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  10146. return;
  10147. }
  10148. if (j == 117) {
  10149. int i3 = stream.readUnsignedByte();
  10150. int l5 = anInt1268 + (i3 >> 4 & 7);
  10151. int k8 = anInt1269 + (i3 & 7);
  10152. int j11 = l5 + stream.readSignedByte();
  10153. int k13 = k8 + stream.readSignedByte();
  10154. int l15 = stream.readSignedWord();
  10155. int i17 = stream.readUnsignedWord();
  10156. int i18 = stream.readUnsignedByte() * 4;
  10157. int l18 = stream.readUnsignedByte() * 4;
  10158. int k19 = stream.readUnsignedWord();
  10159. int j20 = stream.readUnsignedWord();
  10160. int i21 = stream.readUnsignedByte();
  10161. int j21 = stream.readUnsignedByte();
  10162. if (l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535) {
  10163. l5 = l5 * 128 + 64;
  10164. k8 = k8 * 128 + 64;
  10165. j11 = j11 * 128 + 64;
  10166. k13 = k13 * 128 + 64;
  10167. 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);
  10168. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  10169. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  10170. }
  10171. }
  10172. }
  10173.  
  10174. private void method139(Stream stream) {
  10175. stream.initBitAccess();
  10176. int k = stream.readBits(8);
  10177. if (k < npcCount) {
  10178. for (int l = k; l < npcCount; l++)
  10179. anIntArray840[anInt839++] = npcIndices[l];
  10180.  
  10181. }
  10182. if (k > npcCount) {
  10183. Signlink.reporterror(myUsername + " Too many npcs");
  10184. throw new RuntimeException("eek");
  10185. }
  10186. npcCount = 0;
  10187. for (int i1 = 0; i1 < k; i1++) {
  10188. int j1 = npcIndices[i1];
  10189. Npc npc = npcArray[j1];
  10190. int k1 = stream.readBits(1);
  10191. if (k1 == 0) {
  10192. npcIndices[npcCount++] = j1;
  10193. npc.anInt1537 = loopCycle;
  10194. } else {
  10195. int l1 = stream.readBits(2);
  10196. if (l1 == 0) {
  10197. npcIndices[npcCount++] = j1;
  10198. npc.anInt1537 = loopCycle;
  10199. anIntArray894[anInt893++] = j1;
  10200. } else if (l1 == 1) {
  10201. npcIndices[npcCount++] = j1;
  10202. npc.anInt1537 = loopCycle;
  10203. int i2 = stream.readBits(3);
  10204. npc.moveInDir(false, i2);
  10205. int k2 = stream.readBits(1);
  10206. if (k2 == 1)
  10207. anIntArray894[anInt893++] = j1;
  10208. } else if (l1 == 2) {
  10209. npcIndices[npcCount++] = j1;
  10210. npc.anInt1537 = loopCycle;
  10211. int j2 = stream.readBits(3);
  10212. npc.moveInDir(true, j2);
  10213. int l2 = stream.readBits(3);
  10214. npc.moveInDir(true, l2);
  10215. int i3 = stream.readBits(1);
  10216. if (i3 == 1)
  10217. anIntArray894[anInt893++] = j1;
  10218. } else if (l1 == 3)
  10219. anIntArray840[anInt839++] = j1;
  10220. }
  10221. }
  10222.  
  10223. }
  10224.  
  10225. private void processLoginScreenInput() {
  10226. if (loginScreenState == 0) {
  10227. if (super.clickMode3 == 1 && super.saveClickX >= 7
  10228. && super.saveClickX <= 104 && super.saveClickY >= 464
  10229. && super.saveClickY <= 493) {
  10230. ClientConstants.worldSwitch = !ClientConstants.worldSwitch;
  10231. }
  10232. int i = super.myWidth / 2 - 80;
  10233. int l = super.myHeight / 2 + 20;
  10234. l += 20;
  10235. if (super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20) {
  10236. loginScreenState = 3;
  10237. loginScreenCursorPos = 0;
  10238. }
  10239. i = super.myWidth / 2 + 80;
  10240. if (super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20) {
  10241. loginMessage1 = "";
  10242. loginMessage2 = "Enter your username & password.";
  10243. loginScreenState = 2;
  10244. loginScreenCursorPos = 0;
  10245. }
  10246. } else {
  10247. if (loginScreenState == 2) {
  10248. if (super.clickMode3 == 1 && super.saveClickX >= 7
  10249. && super.saveClickX <= 104 && super.saveClickY >= 464
  10250. && super.saveClickY <= 493) {
  10251. ClientConstants.worldSwitch = !ClientConstants.worldSwitch;
  10252. }
  10253. int j = super.myHeight / 2 - 40;
  10254. j += 30;
  10255. j += 25;
  10256. if (super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10257. loginScreenCursorPos = 0;
  10258. j += 15;
  10259. if (super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10260. loginScreenCursorPos = 1;
  10261. j += 15;
  10262. int i1 = super.myWidth / 2 - 80;
  10263. int k1 = super.myHeight / 2 + 50;
  10264. k1 += 20;
  10265. if (super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20) {
  10266. loginFailures = 0;
  10267. login(myUsername, myPassword, false);
  10268. if (loggedIn)
  10269. return;
  10270. }
  10271. i1 = super.myWidth / 2 + 80;
  10272. if (super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20) {
  10273. loginScreenState = 0;
  10274. }
  10275. do {
  10276. int l1 = readChar(-796);
  10277. if (l1 == -1)
  10278. break;
  10279. boolean flag1 = false;
  10280. for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  10281. if (l1 != validUserPassChars.charAt(i2))
  10282. continue;
  10283. flag1 = true;
  10284. break;
  10285. }
  10286.  
  10287. if (loginScreenCursorPos == 0) {
  10288. if (l1 == 8 && myUsername.length() > 0)
  10289. myUsername = myUsername.substring(0, myUsername.length() - 1);
  10290. if (l1 == 9 || l1 == 10 || l1 == 13)
  10291. loginScreenCursorPos = 1;
  10292. if (flag1)
  10293. myUsername += (char) l1;
  10294. if (myUsername.length() > 12)
  10295. myUsername = myUsername.substring(0, 12);
  10296. } else if (loginScreenCursorPos == 1) {
  10297. if (l1 == 8 && myPassword.length() > 0)
  10298. myPassword = myPassword.substring(0, myPassword.length() - 1);
  10299. if (l1 == 9 || l1 == 10 || l1 == 13)
  10300. loginScreenCursorPos = 0;
  10301. if (flag1)
  10302. myPassword += (char) l1;
  10303. if (myPassword.length() > 20)
  10304. myPassword = myPassword.substring(0, 20);
  10305. }
  10306. } while (true);
  10307. return;
  10308. }
  10309. if (loginScreenState == 3) {
  10310. int k = super.myWidth / 2;
  10311. int j1 = super.myHeight / 2 + 50;
  10312. j1 += 20;
  10313. if (super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75 && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  10314. loginScreenState = 0;
  10315. }
  10316. }
  10317. }
  10318.  
  10319. private void method142(int i, int j, int k, int l, int i1, int j1, int k1) {
  10320. if (i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102) {
  10321. if (lowMem && j != plane)
  10322. return;
  10323. int i2 = 0;
  10324. if (j1 == 0)
  10325. i2 = worldController.method300(j, i1, i);
  10326. if (j1 == 1)
  10327. i2 = worldController.method301(j, i1, i);
  10328. if (j1 == 2)
  10329. i2 = worldController.method302(j, i1, i);
  10330. if (j1 == 3)
  10331. i2 = worldController.method303(j, i1, i);
  10332. if (i2 != 0) {
  10333. int i3 = worldController.method304(j, i1, i, i2);
  10334. int j2 = i2 >> 14 & 0x7fff;
  10335. int k2 = i3 & 0x1f;
  10336. int l2 = i3 >> 6;
  10337. if (j1 == 0) {
  10338. worldController.method291(i1, j, i, (byte) -119);
  10339. ObjectDef class46 = ObjectDef.forID(j2);
  10340. if (class46.aBoolean767)
  10341. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  10342. }
  10343. if (j1 == 1)
  10344. worldController.method292(i, j, i1);
  10345. if (j1 == 2) {
  10346. worldController.method293(j, i1, i);
  10347. ObjectDef class46_1 = ObjectDef.forID(j2);
  10348. if (i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  10349. return;
  10350. if (class46_1.aBoolean767)
  10351. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  10352. }
  10353. if (j1 == 3) {
  10354. worldController.method294(j, i, i1);
  10355. ObjectDef class46_2 = ObjectDef.forID(j2);
  10356. if (class46_2.aBoolean767 && class46_2.hasActions)
  10357. aClass11Array1230[j].method218(i, i1);
  10358. }
  10359. }
  10360. if (k1 >= 0) {
  10361. int j3 = j;
  10362. if (j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  10363. j3++;
  10364. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  10365. }
  10366. }
  10367. }
  10368.  
  10369. private void updatePlayers(int i, Stream stream) {
  10370. anInt839 = 0;
  10371. anInt893 = 0;
  10372. method117(stream);
  10373. method134(stream);
  10374. method91(stream, i);
  10375. method49(stream);
  10376. for (int k = 0; k < anInt839; k++) {
  10377. int l = anIntArray840[k];
  10378. if (playerArray[l].anInt1537 != loopCycle)
  10379. playerArray[l] = null;
  10380. }
  10381.  
  10382. if (stream.currentOffset != i) {
  10383. Signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  10384. throw new RuntimeException("eek");
  10385. }
  10386. for (int i1 = 0; i1 < playerCount; i1++)
  10387. if (playerArray[playerIndices[i1]] == null) {
  10388. Signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  10389. throw new RuntimeException("eek");
  10390. }
  10391.  
  10392. }
  10393.  
  10394. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1) {
  10395. int l1 = 2048 - k & 0x7ff;
  10396. int i2 = 2048 - j1 & 0x7ff;
  10397. int j2 = 0;
  10398. int k2 = 0;
  10399. int l2 = j;
  10400. if (l1 != 0) {
  10401. int i3 = Model.modelIntArray1[l1];
  10402. int k3 = Model.modelIntArray2[l1];
  10403. int i4 = k2 * k3 - l2 * i3 >> 16;
  10404. l2 = k2 * i3 + l2 * k3 >> 16;
  10405. k2 = i4;
  10406. }
  10407. if (i2 != 0) {
  10408. int j3 = Model.modelIntArray1[i2];
  10409. int l3 = Model.modelIntArray2[i2];
  10410. int j4 = l2 * j3 + j2 * l3 >> 16;
  10411. l2 = l2 * l3 - j2 * j3 >> 16;
  10412. j2 = j4;
  10413. }
  10414. xCameraPos = l - j2;
  10415. zCameraPos = i1 - k2;
  10416. yCameraPos = k1 - l2;
  10417. yCameraCurve = k;
  10418. xCameraCurve = j1;
  10419. }
  10420.  
  10421. public void updateStrings(String str, int i) {
  10422. switch (i) {
  10423. case 1675:
  10424. sendFrame126(str, 17508);
  10425. break;// Stab
  10426. case 1676:
  10427. sendFrame126(str, 17509);
  10428. break;// Slash
  10429. case 1677:
  10430. sendFrame126(str, 17510);
  10431. break;// Cursh
  10432. case 1678:
  10433. sendFrame126(str, 17511);
  10434. break;// Magic
  10435. case 1679:
  10436. sendFrame126(str, 17512);
  10437. break;// Range
  10438. case 1680:
  10439. sendFrame126(str, 17513);
  10440. break;// Stab
  10441. case 1681:
  10442. sendFrame126(str, 17514);
  10443. break;// Slash
  10444. case 1682:
  10445. sendFrame126(str, 17515);
  10446. break;// Crush
  10447. case 1683:
  10448. sendFrame126(str, 17516);
  10449. break;// Magic
  10450. case 1684:
  10451. sendFrame126(str, 17517);
  10452. break;// Range
  10453. case 1686:
  10454. sendFrame126(str, 17518);
  10455. break;// Strength
  10456. case 1687:
  10457. sendFrame126(str, 17519);
  10458. break;// Prayer
  10459. }
  10460. }
  10461.  
  10462. public void sendFrame126(String str, int i) {
  10463. RSInterface.interfaceCache[i].message = str;
  10464. if (RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID]) {
  10465. }
  10466. }
  10467.  
  10468. public void sendPacket185(int button, int toggle, int type) {
  10469. switch (type) {
  10470. case 135:
  10471. RSInterface class9 = RSInterface.interfaceCache[button];
  10472. boolean flag8 = true;
  10473. if (class9.contentType > 0)
  10474. flag8 = promptUserForInput(class9);
  10475. if (flag8) {
  10476. stream.createFrame(185);
  10477. stream.writeWord(button);
  10478. }
  10479. break;
  10480. case 646:
  10481. stream.createFrame(185);
  10482. stream.writeWord(button);
  10483. RSInterface class9_2 = RSInterface.interfaceCache[button];
  10484. if (class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  10485. if (variousSettings[toggle] != class9_2.anIntArray212[0]) {
  10486. variousSettings[toggle] = class9_2.anIntArray212[0];
  10487. method33(toggle);
  10488. }
  10489. }
  10490. break;
  10491. case 169:
  10492. stream.createFrame(185);
  10493. stream.writeWord(button);
  10494. RSInterface class9_3 = RSInterface.interfaceCache[button];
  10495. if (class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  10496. variousSettings[toggle] = 1 - variousSettings[toggle];
  10497. method33(toggle);
  10498. }
  10499. switch (button) {
  10500. case 74214:
  10501. System.out.println("toggle = " + toggle);
  10502. if (toggle == 0)
  10503. sendFrame36(173, toggle);
  10504. if (toggle == 1)
  10505. sendPacket185(153, 173, 646);
  10506. break;
  10507. }
  10508. break;
  10509. }
  10510. }
  10511.  
  10512. public void sendFrame36(int id, int state) {
  10513. anIntArray1045[id] = state;
  10514. if (variousSettings[id] != state) {
  10515. variousSettings[id] = state;
  10516. method33(id);
  10517. if (dialogID != -1)
  10518. inputTaken = true;
  10519. }
  10520. }
  10521.  
  10522.  
  10523.  
  10524. public void sendFrame219() {
  10525. if (invOverlayInterfaceID != -1) {
  10526. invOverlayInterfaceID = -1;
  10527. tabAreaAltered = true;
  10528. }
  10529. if (backDialogID != -1) {
  10530. backDialogID = -1;
  10531. inputTaken = true;
  10532. }
  10533. if (inputDialogState != 0) {
  10534. inputDialogState = 0;
  10535. inputTaken = true;
  10536. }
  10537. openInterfaceID = -1;
  10538. aBoolean1149 = false;
  10539. }
  10540.  
  10541.  
  10542.  
  10543. public void sendFrame248(int interfaceID, int sideInterfaceID) {
  10544. if (backDialogID != -1) {
  10545. backDialogID = -1;
  10546. inputTaken = true;
  10547. }
  10548. if (inputDialogState != 0) {
  10549. inputDialogState = 0;
  10550. inputTaken = true;
  10551. }
  10552. openInterfaceID = interfaceID;
  10553. invOverlayInterfaceID = sideInterfaceID;
  10554. tabAreaAltered = true;
  10555. aBoolean1149 = false;
  10556. }
  10557.  
  10558. private boolean parsePacket() {
  10559. if (socketStream == null)
  10560. return false;
  10561. try {
  10562. int i = socketStream.available();
  10563. if (i == 0)
  10564. return false;
  10565. if (pktType == -1) {
  10566. socketStream.flushInputStream(inStream.buffer, 1);
  10567. pktType = inStream.buffer[0] & 0xff;
  10568. if (encryption != null)
  10569. pktType = pktType - encryption.getNextKey() & 0xff;
  10570. pktSize = SizeConstants.packetSizes[pktType];
  10571. i--;
  10572. }
  10573. if (pktSize == -1)
  10574. if (i > 0) {
  10575. socketStream.flushInputStream(inStream.buffer, 1);
  10576. pktSize = inStream.buffer[0] & 0xff;
  10577. i--;
  10578. } else {
  10579. return false;
  10580. }
  10581. if (pktSize == -2)
  10582. if (i > 1) {
  10583. socketStream.flushInputStream(inStream.buffer, 2);
  10584. inStream.currentOffset = 0;
  10585. pktSize = inStream.readUnsignedWord();
  10586. i -= 2;
  10587. } else {
  10588. return false;
  10589. }
  10590. if (i < pktSize)
  10591. return false;
  10592. inStream.currentOffset = 0;
  10593. socketStream.flushInputStream(inStream.buffer, pktSize);
  10594. anInt1009 = 0;
  10595. anInt843 = anInt842;
  10596. anInt842 = anInt841;
  10597. anInt841 = pktType;
  10598. switch (pktType) {
  10599. case 81:
  10600. updatePlayers(pktSize, inStream);
  10601. aBoolean1080 = false;
  10602. pktType = -1;
  10603. return true;
  10604.  
  10605. case 176:
  10606. daysSinceRecovChange = inStream.method427();
  10607. unreadMessages = inStream.method435();
  10608. membersInt = inStream.readUnsignedByte();
  10609. anInt1193 = inStream.method440();
  10610. daysSinceLastLogin = inStream.readUnsignedWord();
  10611. if (anInt1193 != 0 && openInterfaceID == -1) {
  10612. Signlink.dnslookup(TextClass.method586(anInt1193));
  10613. clearTopInterfaces();
  10614. char c = '\u028A';
  10615. if (daysSinceRecovChange != 201 || membersInt == 1)
  10616. c = '\u028F';
  10617. reportAbuseInput = "";
  10618. canMute = false;
  10619. for (int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  10620. if (RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  10621. continue;
  10622. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  10623.  
  10624. }
  10625. }
  10626. pktType = -1;
  10627. return true;
  10628.  
  10629. case 64:
  10630. anInt1268 = inStream.method427();
  10631. anInt1269 = inStream.method428();
  10632. for (int j = anInt1268; j < anInt1268 + 8; j++) {
  10633. for (int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  10634. if (groundArray[plane][j][l9] != null) {
  10635. groundArray[plane][j][l9] = null;
  10636. spawnGroundItem(j, l9);
  10637. }
  10638. }
  10639. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetNext())
  10640. if (class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  10641. class30_sub1.anInt1294 = 0;
  10642. pktType = -1;
  10643. return true;
  10644.  
  10645. case 185:
  10646. int k = inStream.method436();
  10647. RSInterface.interfaceCache[k].anInt233 = 3;
  10648. if (myPlayer.desc == null)
  10649. 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];
  10650. else
  10651. RSInterface.interfaceCache[k].mediaID = (int) (0x12345678L + myPlayer.desc.interfaceType);
  10652. pktType = -1;
  10653. return true;
  10654.  
  10655. /* Clan chat packet */
  10656. case 217:
  10657. try {
  10658. name = inStream.readString();
  10659. message = inStream.readString();
  10660. clanname = inStream.readString();
  10661. rights = inStream.readUnsignedWord();
  10662. // message = TextInput.processText(message);
  10663. // message = Censor.doCensor(message);
  10664. System.out.println(clanname);
  10665. pushMessage(message, 16, name);
  10666. } catch (Exception e) {
  10667. e.printStackTrace();
  10668. }
  10669. pktType = -1;
  10670. return true;
  10671.  
  10672. case 107:
  10673. aBoolean1160 = false;
  10674. for (int l = 0; l < 5; l++)
  10675. aBooleanArray876[l] = false;
  10676. xpCounter = 0;
  10677. pktType = -1;
  10678. return true;
  10679.  
  10680. case 72:
  10681. int i1 = inStream.method434();
  10682. RSInterface class9 = RSInterface.interfaceCache[i1];
  10683. for (int k15 = 0; k15 < class9.inv.length; k15++) {
  10684. class9.inv[k15] = -1;
  10685. class9.inv[k15] = 0;
  10686. }
  10687. pktType = -1;
  10688. return true;
  10689.  
  10690. case 214:
  10691. ignoreCount = pktSize / 8;
  10692. for (int j1 = 0; j1 < ignoreCount; j1++)
  10693. ignoreListAsLongs[j1] = inStream.readQWord();
  10694. pktType = -1;
  10695. return true;
  10696.  
  10697. case 166:
  10698. aBoolean1160 = true;
  10699. anInt1098 = inStream.readUnsignedByte();
  10700. anInt1099 = inStream.readUnsignedByte();
  10701. anInt1100 = inStream.readUnsignedWord();
  10702. anInt1101 = inStream.readUnsignedByte();
  10703. anInt1102 = inStream.readUnsignedByte();
  10704. if (anInt1102 >= 100) {
  10705. xCameraPos = anInt1098 * 128 + 64;
  10706. yCameraPos = anInt1099 * 128 + 64;
  10707. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  10708. }
  10709. pktType = -1;
  10710. return true;
  10711.  
  10712. case 134:
  10713. int k1 = inStream.readUnsignedByte();
  10714. int i10 = inStream.method439();
  10715. int l15 = inStream.readUnsignedByte();
  10716. int xp = currentExp[k1];
  10717. currentExp[k1] = i10;
  10718. currentStats[k1] = l15;
  10719. maxStats[k1] = 1;
  10720. xpCounter += currentExp[k1] - xp;
  10721. expAdded = currentExp[k1] - xp;
  10722. for (int k20 = 0; k20 < 98; k20++)
  10723. if (i10 >= anIntArray1019[k20])
  10724. maxStats[k1] = k20 + 2;
  10725. pktType = -1;
  10726. return true;
  10727.  
  10728. case 71:
  10729. int l1 = inStream.readUnsignedWord();
  10730. int j10 = inStream.method426();
  10731. if (l1 == 65535)
  10732. l1 = -1;
  10733. tabInterfaceIDs[j10] = l1;
  10734. tabAreaAltered = true;
  10735. pktType = -1;
  10736. return true;
  10737.  
  10738. case 74:
  10739. int i2 = inStream.method434();
  10740. if (i2 == 65535)
  10741. i2 = -1;
  10742. if (i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  10743. nextSong = i2;
  10744. songChanging = true;
  10745. onDemandFetcher.method558(2, nextSong);
  10746. }
  10747. currentSong = i2;
  10748. pktType = -1;
  10749. return true;
  10750.  
  10751. case 121:
  10752. int j2 = inStream.method436();
  10753. int k10 = inStream.method435();
  10754. if (musicEnabled && !lowMem) {
  10755. nextSong = j2;
  10756. songChanging = false;
  10757. onDemandFetcher.method558(2, nextSong);
  10758. prevSong = k10;
  10759. }
  10760. pktType = -1;
  10761. return true;
  10762.  
  10763. case 109:
  10764. resetLogout();
  10765. pktType = -1;
  10766. return false;
  10767.  
  10768. case 70:
  10769. int k2 = inStream.readSignedWord();
  10770. int l10 = inStream.method437();
  10771. int i16 = inStream.method434();
  10772. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  10773. class9_5.anInt263 = k2;
  10774. class9_5.anInt265 = l10;
  10775. pktType = -1;
  10776. return true;
  10777.  
  10778. case 73:
  10779. case 241:
  10780. int l2 = anInt1069;
  10781. int i11 = anInt1070;
  10782. if (pktType == 73) {
  10783. l2 = inStream.method435();
  10784. i11 = inStream.readUnsignedWord();
  10785. aBoolean1159 = false;
  10786. }
  10787. if (pktType == 241) {
  10788. i11 = inStream.method435();
  10789. inStream.initBitAccess();
  10790. for (int j16 = 0; j16 < 4; j16++) {
  10791. for (int l20 = 0; l20 < 13; l20++) {
  10792. for (int j23 = 0; j23 < 13; j23++) {
  10793. int i26 = inStream.readBits(1);
  10794. if (i26 == 1)
  10795. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  10796. else
  10797. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  10798. }
  10799. }
  10800. }
  10801. inStream.finishBitAccess();
  10802. l2 = inStream.readUnsignedWord();
  10803. aBoolean1159 = true;
  10804. }
  10805. if (anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  10806. pktType = -1;
  10807. return true;
  10808. }
  10809. anInt1069 = l2;
  10810. anInt1070 = i11;
  10811. baseX = (anInt1069 - 6) * 8;
  10812. baseY = (anInt1070 - 6) * 8;
  10813. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  10814. if (anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  10815. aBoolean1141 = true;
  10816. loadingStage = 1;
  10817. aLong824 = System.currentTimeMillis();
  10818. aRSImageProducer_1165.initDrawingArea();
  10819. fancyText.drawChatInput(0xffffff, 5, "Loading - please wait.", 15, true);
  10820. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  10821. if (pktType == 73) {
  10822. int k16 = 0;
  10823. for (int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  10824. for (int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  10825. k16++;
  10826. }
  10827. aByteArrayArray1183 = new byte[k16][];
  10828. aByteArrayArray1247 = new byte[k16][];
  10829. anIntArray1234 = new int[k16];
  10830. anIntArray1235 = new int[k16];
  10831. anIntArray1236 = new int[k16];
  10832. k16 = 0;
  10833. for (int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  10834. for (int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  10835. anIntArray1234[k16] = (l23 << 8) + j26;
  10836. if (aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  10837. anIntArray1235[k16] = -1;
  10838. anIntArray1236[k16] = -1;
  10839. k16++;
  10840. } else {
  10841. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  10842. if (k28 != -1)
  10843. onDemandFetcher.method558(3, k28);
  10844. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  10845. if (j30 != -1)
  10846. onDemandFetcher.method558(3, j30);
  10847. k16++;
  10848. }
  10849. }
  10850. }
  10851. }
  10852. if (pktType == 241) {
  10853. int l16 = 0;
  10854. int ai[] = new int[676];
  10855. for (int i24 = 0; i24 < 4; i24++) {
  10856. for (int k26 = 0; k26 < 13; k26++) {
  10857. for (int l28 = 0; l28 < 13; l28++) {
  10858. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  10859. if (k30 != -1) {
  10860. int k31 = k30 >> 14 & 0x3ff;
  10861. int i32 = k30 >> 3 & 0x7ff;
  10862. int k32 = (k31 / 8 << 8) + i32 / 8;
  10863. for (int j33 = 0; j33 < l16; j33++) {
  10864. if (ai[j33] != k32)
  10865. continue;
  10866. k32 = -1;
  10867.  
  10868. }
  10869. if (k32 != -1)
  10870. ai[l16++] = k32;
  10871. }
  10872. }
  10873. }
  10874. }
  10875. aByteArrayArray1183 = new byte[l16][];
  10876. aByteArrayArray1247 = new byte[l16][];
  10877. anIntArray1234 = new int[l16];
  10878. anIntArray1235 = new int[l16];
  10879. anIntArray1236 = new int[l16];
  10880. for (int l26 = 0; l26 < l16; l26++) {
  10881. int i29 = anIntArray1234[l26] = ai[l26];
  10882. int l30 = i29 >> 8 & 0xff;
  10883. int l31 = i29 & 0xff;
  10884. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  10885. if (j32 != -1)
  10886. onDemandFetcher.method558(3, j32);
  10887. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  10888. if (i33 != -1)
  10889. onDemandFetcher.method558(3, i33);
  10890. }
  10891. }
  10892. int i17 = baseX - anInt1036;
  10893. int j21 = baseY - anInt1037;
  10894. anInt1036 = baseX;
  10895. anInt1037 = baseY;
  10896. for (int j24 = 0; j24 < 16384; j24++) {
  10897. Npc npc = npcArray[j24];
  10898. if (npc != null) {
  10899. for (int j29 = 0; j29 < 10; j29++) {
  10900. npc.smallX[j29] -= i17;
  10901. npc.smallY[j29] -= j21;
  10902. }
  10903. npc.x -= i17 * 128;
  10904. npc.y -= j21 * 128;
  10905. }
  10906. }
  10907. for (int i27 = 0; i27 < maxPlayers; i27++) {
  10908. Player player = playerArray[i27];
  10909. if (player != null) {
  10910. for (int i31 = 0; i31 < 10; i31++) {
  10911. player.smallX[i31] -= i17;
  10912. player.smallY[i31] -= j21;
  10913. }
  10914. player.x -= i17 * 128;
  10915. player.y -= j21 * 128;
  10916. }
  10917. }
  10918. aBoolean1080 = true;
  10919. byte byte1 = 0;
  10920. byte byte2 = 104;
  10921. byte byte3 = 1;
  10922. if (i17 < 0) {
  10923. byte1 = 103;
  10924. byte2 = -1;
  10925. byte3 = -1;
  10926. }
  10927. byte byte4 = 0;
  10928. byte byte5 = 104;
  10929. byte byte6 = 1;
  10930. if (j21 < 0) {
  10931. byte4 = 103;
  10932. byte5 = -1;
  10933. byte6 = -1;
  10934. }
  10935. for (int k33 = byte1; k33 != byte2; k33 += byte3) {
  10936. for (int l33 = byte4; l33 != byte5; l33 += byte6) {
  10937. int i34 = k33 + i17;
  10938. int j34 = l33 + j21;
  10939. for (int k34 = 0; k34 < 4; k34++)
  10940. if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  10941. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  10942. else
  10943. groundArray[k34][k33][l33] = null;
  10944. }
  10945. }
  10946. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179.reverseGetNext()) {
  10947. class30_sub1_1.anInt1297 -= i17;
  10948. class30_sub1_1.anInt1298 -= j21;
  10949. if (class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  10950. class30_sub1_1.unlink();
  10951. }
  10952. if (destX != 0) {
  10953. destX -= i17;
  10954. destY -= j21;
  10955. }
  10956. aBoolean1160 = false;
  10957. pktType = -1;
  10958. return true;
  10959.  
  10960. case 208:
  10961. int i3 = inStream.method437();
  10962. if (i3 >= 0)
  10963. method60(i3);
  10964. anInt1018 = i3;
  10965. pktType = -1;
  10966. return true;
  10967.  
  10968. case 99:
  10969. anInt1021 = inStream.readUnsignedByte();
  10970. pktType = -1;
  10971. return true;
  10972.  
  10973. case 75:
  10974. int j3 = inStream.method436();
  10975. int j11 = inStream.method436();
  10976. RSInterface.interfaceCache[j11].anInt233 = 2;
  10977. RSInterface.interfaceCache[j11].mediaID = j3;
  10978. pktType = -1;
  10979. return true;
  10980.  
  10981. case 114:
  10982. anInt1104 = inStream.method434() * 30;
  10983. pktType = -1;
  10984. return true;
  10985.  
  10986. case 60:
  10987. anInt1269 = inStream.readUnsignedByte();
  10988. anInt1268 = inStream.method427();
  10989. while (inStream.currentOffset < pktSize) {
  10990. int k3 = inStream.readUnsignedByte();
  10991. method137(inStream, k3);
  10992. }
  10993. pktType = -1;
  10994. return true;
  10995.  
  10996. case 35:
  10997. int l3 = inStream.readUnsignedByte();
  10998. int k11 = inStream.readUnsignedByte();
  10999. int j17 = inStream.readUnsignedByte();
  11000. int k21 = inStream.readUnsignedByte();
  11001. aBooleanArray876[l3] = true;
  11002. anIntArray873[l3] = k11;
  11003. anIntArray1203[l3] = j17;
  11004. anIntArray928[l3] = k21;
  11005. anIntArray1030[l3] = 0;
  11006. pktType = -1;
  11007. return true;
  11008.  
  11009. case 174:
  11010. int i4 = inStream.readUnsignedWord();
  11011. int l11 = inStream.readUnsignedByte();
  11012. int k17 = inStream.readUnsignedWord();
  11013. if (aBoolean848 && !lowMem && anInt1062 < 50) {
  11014. anIntArray1207[anInt1062] = i4;
  11015. anIntArray1241[anInt1062] = l11;
  11016. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  11017. anInt1062++;
  11018. }
  11019. pktType = -1;
  11020. return true;
  11021.  
  11022. case 104:
  11023. int j4 = inStream.method427();
  11024. int i12 = inStream.method426();
  11025. String s6 = inStream.readString();
  11026. if (j4 >= 1 && j4 <= 5) {
  11027. if (s6.equalsIgnoreCase("null"))
  11028. s6 = null;
  11029. atPlayerActions[j4 - 1] = s6;
  11030. atPlayerArray[j4 - 1] = i12 == 0;
  11031. }
  11032. pktType = -1;
  11033. return true;
  11034.  
  11035. case 78:
  11036. destX = 0;
  11037. pktType = -1;
  11038. return true;
  11039.  
  11040. case 253:
  11041. String s = inStream.readString();
  11042. if (s.endsWith(":tradereq:")) {
  11043. String s3 = s.substring(0, s.indexOf(":"));
  11044. long l17 = TextClass.longForName(s3);
  11045. boolean flag2 = false;
  11046. for (int j27 = 0; j27 < ignoreCount; j27++) {
  11047. if (ignoreListAsLongs[j27] != l17)
  11048. continue;
  11049. flag2 = true;
  11050.  
  11051. }
  11052. if (!flag2 && anInt1251 == 0)
  11053. pushMessage("wishes to trade with you.", 4, s3);
  11054. } else if (s.endsWith(":clan:")) {
  11055. String s4 = s.substring(0, s.indexOf(":"));
  11056. TextClass.longForName(s4);
  11057. pushMessage("Clan: ", 8, s4);
  11058. } else if (s.endsWith("#url#")) {
  11059. String link = s.substring(0, s.indexOf("#"));
  11060. pushMessage("Join us at: ", 9, link);
  11061. } else if (s.endsWith(":duelreq:")) {
  11062. String s4 = s.substring(0, s.indexOf(":"));
  11063. long l18 = TextClass.longForName(s4);
  11064. boolean flag3 = false;
  11065. for (int k27 = 0; k27 < ignoreCount; k27++) {
  11066. if (ignoreListAsLongs[k27] != l18)
  11067. continue;
  11068. flag3 = true;
  11069.  
  11070. }
  11071. if (!flag3 && anInt1251 == 0)
  11072. pushMessage("wishes to duel with you.", 8, s4);
  11073. } else if (s.endsWith(":chalreq:")) {
  11074. String s5 = s.substring(0, s.indexOf(":"));
  11075. long l19 = TextClass.longForName(s5);
  11076. boolean flag4 = false;
  11077. for (int l27 = 0; l27 < ignoreCount; l27++) {
  11078. if (ignoreListAsLongs[l27] != l19)
  11079. continue;
  11080. flag4 = true;
  11081.  
  11082. }
  11083. if (!flag4 && anInt1251 == 0) {
  11084. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  11085. pushMessage(s8, 8, s5);
  11086. }
  11087. } else if (s.endsWith(":resetautocast:")) {
  11088. autocast = false;
  11089. autoCastId = 0;
  11090. cacheSprite[33].drawSprite(-100, -100);
  11091. } else {
  11092. pushMessage(s, 0, "");
  11093. }
  11094. pktType = -1;
  11095. return true;
  11096.  
  11097. case 1:
  11098. for (int k4 = 0; k4 < playerArray.length; k4++)
  11099. if (playerArray[k4] != null)
  11100. playerArray[k4].anim = -1;
  11101. for (int j12 = 0; j12 < npcArray.length; j12++)
  11102. if (npcArray[j12] != null)
  11103. npcArray[j12].anim = -1;
  11104. pktType = -1;
  11105. return true;
  11106.  
  11107. case 50:
  11108. long l4 = inStream.readQWord();
  11109. int world = inStream.readUnsignedByte();
  11110. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  11111. for (int k24 = 0; k24 < friendsCount; k24++) {
  11112. if (l4 != friendsListAsLongs[k24])
  11113. continue;
  11114. if (friendsNodeIDs[k24] != world) {
  11115. friendsNodeIDs[k24] = world;
  11116. if (world >= 2) {
  11117. pushMessage(s7 + " has logged in.", 5, "");
  11118. }
  11119. if (world <= 1) {
  11120. pushMessage(s7 + " has logged out.", 5, "");
  11121. }
  11122. }
  11123. s7 = null;
  11124.  
  11125. }
  11126. if (s7 != null && friendsCount < 200) {
  11127. friendsListAsLongs[friendsCount] = l4;
  11128. friendsList[friendsCount] = s7;
  11129. friendsNodeIDs[friendsCount] = world;
  11130. friendsCount++;
  11131. }
  11132. for (boolean flag6 = false; !flag6;) {
  11133. flag6 = true;
  11134. for (int k29 = 0; k29 < friendsCount - 1; k29++)
  11135. if (friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  11136. int j31 = friendsNodeIDs[k29];
  11137. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  11138. friendsNodeIDs[k29 + 1] = j31;
  11139. String s10 = friendsList[k29];
  11140. friendsList[k29] = friendsList[k29 + 1];
  11141. friendsList[k29 + 1] = s10;
  11142. long l32 = friendsListAsLongs[k29];
  11143. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  11144. friendsListAsLongs[k29 + 1] = l32;
  11145. flag6 = false;
  11146. }
  11147. }
  11148. pktType = -1;
  11149. return true;
  11150.  
  11151. case 110:
  11152. if (tabID == 12) {
  11153. }
  11154. energy = inStream.readUnsignedByte();
  11155. pktType = -1;
  11156. return true;
  11157.  
  11158. case 254:
  11159. anInt855 = inStream.readUnsignedByte();
  11160. if (anInt855 == 1)
  11161. anInt1222 = inStream.readUnsignedWord();
  11162. if (anInt855 >= 2 && anInt855 <= 6) {
  11163. if (anInt855 == 2) {
  11164. anInt937 = 64;
  11165. anInt938 = 64;
  11166. }
  11167. if (anInt855 == 3) {
  11168. anInt937 = 0;
  11169. anInt938 = 64;
  11170. }
  11171. if (anInt855 == 4) {
  11172. anInt937 = 128;
  11173. anInt938 = 64;
  11174. }
  11175. if (anInt855 == 5) {
  11176. anInt937 = 64;
  11177. anInt938 = 0;
  11178. }
  11179. if (anInt855 == 6) {
  11180. anInt937 = 64;
  11181. anInt938 = 128;
  11182. }
  11183. anInt855 = 2;
  11184. anInt934 = inStream.readUnsignedWord();
  11185. anInt935 = inStream.readUnsignedWord();
  11186. anInt936 = inStream.readUnsignedByte();
  11187. }
  11188. if (anInt855 == 10)
  11189. anInt933 = inStream.readUnsignedWord();
  11190. pktType = -1;
  11191. return true;
  11192.  
  11193. case 248:
  11194. int i5 = inStream.method435();
  11195. int k12 = inStream.readUnsignedWord();
  11196. if (backDialogID != -1) {
  11197. backDialogID = -1;
  11198. inputTaken = true;
  11199. }
  11200. if (inputDialogState != 0) {
  11201. inputDialogState = 0;
  11202. inputTaken = true;
  11203. }
  11204. openInterfaceID = i5;
  11205. invOverlayInterfaceID = k12;
  11206. tabAreaAltered = true;
  11207. aBoolean1149 = false;
  11208. pktType = -1;
  11209. return true;
  11210.  
  11211. case 79:
  11212. int j5 = inStream.method434();
  11213. int l12 = inStream.method435();
  11214. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  11215. if (class9_3 != null && class9_3.type == 0) {
  11216. if (l12 < 0)
  11217. l12 = 0;
  11218. if (l12 > class9_3.scrollMax - class9_3.height)
  11219. l12 = class9_3.scrollMax - class9_3.height;
  11220. class9_3.scrollPosition = l12;
  11221. }
  11222. pktType = -1;
  11223. return true;
  11224.  
  11225. case 68:
  11226. for (int k5 = 0; k5 < variousSettings.length; k5++)
  11227. if (variousSettings[k5] != anIntArray1045[k5]) {
  11228. variousSettings[k5] = anIntArray1045[k5];
  11229. method33(k5);
  11230. }
  11231. pktType = -1;
  11232. return true;
  11233.  
  11234. case 196:
  11235. long l5 = inStream.readQWord();
  11236. int j18 = inStream.readDWord();
  11237. int l21 = inStream.readUnsignedByte();
  11238. boolean flag5 = false;
  11239. for (int i28 = 0; i28 < 100; i28++) {
  11240. if (anIntArray1240[i28] != j18)
  11241. continue;
  11242. flag5 = true;
  11243.  
  11244. }
  11245. if (l21 <= 1) {
  11246. for (int l29 = 0; l29 < ignoreCount; l29++) {
  11247. if (ignoreListAsLongs[l29] != l5)
  11248. continue;
  11249. flag5 = true;
  11250.  
  11251. }
  11252. }
  11253. if (!flag5 && anInt1251 == 0)
  11254. try {
  11255. anIntArray1240[anInt1169] = j18;
  11256. anInt1169 = (anInt1169 + 1) % 100;
  11257. String s9 = TextInput.method525(pktSize - 13, inStream);
  11258. // if(l21 != 3)
  11259. // s9 = Censor.doCensor(s9);
  11260. if (l21 == 2 || l21 == 3)
  11261. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11262. else if (l21 == 1)
  11263. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11264. else
  11265. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  11266. } catch (Exception exception1) {
  11267. Signlink.reporterror("cde1");
  11268. }
  11269. pktType = -1;
  11270. return true;
  11271.  
  11272. case 85:
  11273. anInt1269 = inStream.method427();
  11274. anInt1268 = inStream.method427();
  11275. pktType = -1;
  11276. return true;
  11277.  
  11278. case 24:
  11279. anInt1054 = inStream.method428();
  11280. if (anInt1054 == tabID) {
  11281. if (anInt1054 == 3)
  11282. tabID = 1;
  11283. else
  11284. tabID = 3;
  11285. }
  11286. pktType = -1;
  11287. return true;
  11288.  
  11289. case 246:
  11290. int i6 = inStream.method434();
  11291. int i13 = inStream.readUnsignedWord();
  11292. int k18 = inStream.readUnsignedWord();
  11293. if (k18 == 65535) {
  11294. RSInterface.interfaceCache[i6].anInt233 = 0;
  11295. pktType = -1;
  11296. return true;
  11297. } else {
  11298. ItemDef itemDef = ItemDef.forID(k18);
  11299. RSInterface.interfaceCache[i6].anInt233 = 4;
  11300. RSInterface.interfaceCache[i6].mediaID = k18;
  11301. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotationY;
  11302. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotationX;
  11303. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  11304. pktType = -1;
  11305. return true;
  11306. }
  11307.  
  11308. case 171:
  11309. boolean flag1 = inStream.readUnsignedByte() == 1;
  11310. int j13 = inStream.readUnsignedWord();
  11311. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  11312. pktType = -1;
  11313. return true;
  11314.  
  11315. case 142:
  11316. int j6 = inStream.method434();
  11317. method60(j6);
  11318. if (backDialogID != -1) {
  11319. backDialogID = -1;
  11320. inputTaken = true;
  11321. }
  11322. if (inputDialogState != 0) {
  11323. inputDialogState = 0;
  11324. inputTaken = true;
  11325. }
  11326. invOverlayInterfaceID = j6;
  11327. tabAreaAltered = true;
  11328. openInterfaceID = -1;
  11329. aBoolean1149 = false;
  11330. pktType = -1;
  11331. return true;
  11332.  
  11333. case 126:
  11334. try {
  11335. String text = inStream.readString();
  11336. int frame = inStream.method435();
  11337. if (text.startsWith("www.")) {
  11338. launchURL(text);
  11339. }
  11340. updateStrings(text, frame);
  11341. sendFrame126(text, frame);
  11342. if (frame >= 18144 && frame <= 18244) {
  11343. clanList[frame - 18144] = text;
  11344. }
  11345. } catch (Exception e) {
  11346. }
  11347. pktType = -1;
  11348. return true;
  11349.  
  11350. case 206:
  11351. publicChatMode = inStream.readUnsignedByte();
  11352. privateChatMode = inStream.readUnsignedByte();
  11353. tradeMode = inStream.readUnsignedByte();
  11354. inputTaken = true;
  11355. pktType = -1;
  11356. return true;
  11357.  
  11358. case 240:
  11359. if (tabID == 12) {
  11360. }
  11361. weight = inStream.readSignedWord();
  11362. pktType = -1;
  11363. return true;
  11364.  
  11365. case 8:
  11366. int k6 = inStream.method436();
  11367. int l13 = inStream.readUnsignedWord();
  11368. RSInterface.interfaceCache[k6].anInt233 = 1;
  11369. RSInterface.interfaceCache[k6].mediaID = l13;
  11370. pktType = -1;
  11371. return true;
  11372.  
  11373. case 122:
  11374. int l6 = inStream.method436();
  11375. int i14 = inStream.method436();
  11376. int i19 = i14 >> 10 & 0x1f;
  11377. int i22 = i14 >> 5 & 0x1f;
  11378. int l24 = i14 & 0x1f;
  11379. RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  11380. pktType = -1;
  11381. return true;
  11382.  
  11383. case 53:
  11384. int i7 = inStream.readUnsignedWord();
  11385. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  11386. int j19 = inStream.readUnsignedWord();
  11387. for (int j22 = 0; j22 < j19; j22++) {
  11388. int i25 = inStream.readUnsignedByte();
  11389. if (i25 == 255)
  11390. i25 = inStream.method440();
  11391. class9_1.inv[j22] = inStream.method436();
  11392. class9_1.invStackSizes[j22] = i25;
  11393. }
  11394. for (int j25 = j19; j25 < class9_1.inv.length; j25++) {
  11395. class9_1.inv[j25] = 0;
  11396. class9_1.invStackSizes[j25] = 0;
  11397. }
  11398. pktType = -1;
  11399. return true;
  11400.  
  11401. case 230:
  11402. int j7 = inStream.method435();
  11403. int j14 = inStream.readUnsignedWord();
  11404. int k19 = inStream.readUnsignedWord();
  11405. int k22 = inStream.method436();
  11406. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  11407. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  11408. RSInterface.interfaceCache[j14].modelZoom = j7;
  11409. pktType = -1;
  11410. return true;
  11411.  
  11412. case 221:
  11413. anInt900 = inStream.readUnsignedByte();
  11414. pktType = -1;
  11415. return true;
  11416.  
  11417. case 177:
  11418. aBoolean1160 = true;
  11419. anInt995 = inStream.readUnsignedByte();
  11420. anInt996 = inStream.readUnsignedByte();
  11421. anInt997 = inStream.readUnsignedWord();
  11422. anInt998 = inStream.readUnsignedByte();
  11423. anInt999 = inStream.readUnsignedByte();
  11424. if (anInt999 >= 100) {
  11425. int k7 = anInt995 * 128 + 64;
  11426. int k14 = anInt996 * 128 + 64;
  11427. int i20 = method42(plane, k14, k7) - anInt997;
  11428. int l22 = k7 - xCameraPos;
  11429. int k25 = i20 - zCameraPos;
  11430. int j28 = k14 - yCameraPos;
  11431. int i30 = (int) Math.sqrt(l22 * l22 + j28 * j28);
  11432. yCameraCurve = (int) (Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  11433. xCameraCurve = (int) (Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  11434. if (yCameraCurve < 128)
  11435. yCameraCurve = 128;
  11436. if (yCameraCurve > 383)
  11437. yCameraCurve = 383;
  11438. }
  11439. pktType = -1;
  11440. return true;
  11441.  
  11442. case 249:
  11443. anInt1046 = inStream.method426();
  11444. unknownInt10 = inStream.method436();
  11445. pktType = -1;
  11446. return true;
  11447.  
  11448. case 65:
  11449. updateNPCs(inStream, pktSize);
  11450. pktType = -1;
  11451. return true;
  11452.  
  11453. case 27:
  11454. messagePromptRaised = false;
  11455. inputDialogState = 1;
  11456. amountOrNameInput = "";
  11457. inputTaken = true;
  11458. pktType = -1;
  11459. return true;
  11460.  
  11461. case 187:
  11462. messagePromptRaised = false;
  11463. inputDialogState = 2;
  11464. amountOrNameInput = "";
  11465. inputTaken = true;
  11466. pktType = -1;
  11467. return true;
  11468.  
  11469. case 97:
  11470. int l7 = inStream.readUnsignedWord();
  11471. method60(l7);
  11472. if (invOverlayInterfaceID != -1) {
  11473. invOverlayInterfaceID = -1;
  11474. tabAreaAltered = true;
  11475. }
  11476. if (backDialogID != -1) {
  11477. backDialogID = -1;
  11478. inputTaken = true;
  11479. }
  11480. if (inputDialogState != 0) {
  11481. inputDialogState = 0;
  11482. inputTaken = true;
  11483. }
  11484. openInterfaceID = l7;
  11485. aBoolean1149 = false;
  11486. pktType = -1;
  11487. return true;
  11488.  
  11489. case 218:
  11490. int i8 = inStream.method438();
  11491. dialogID = i8;
  11492. inputTaken = true;
  11493. pktType = -1;
  11494. return true;
  11495.  
  11496. case 87:
  11497. int j8 = inStream.method434();
  11498. int l14 = inStream.method439();
  11499. anIntArray1045[j8] = l14;
  11500. if (variousSettings[j8] != l14) {
  11501. variousSettings[j8] = l14;
  11502. method33(j8);
  11503. if (dialogID != -1)
  11504. inputTaken = true;
  11505. }
  11506. pktType = -1;
  11507. return true;
  11508.  
  11509. case 36:
  11510. int k8 = inStream.method434();
  11511. byte byte0 = inStream.readSignedByte();
  11512. anIntArray1045[k8] = byte0;
  11513. if (variousSettings[k8] != byte0) {
  11514. variousSettings[k8] = byte0;
  11515. method33(k8);
  11516. if (dialogID != -1)
  11517. inputTaken = true;
  11518. }
  11519. pktType = -1;
  11520. return true;
  11521.  
  11522. case 61:
  11523. anInt1055 = inStream.readUnsignedByte();
  11524. pktType = -1;
  11525. return true;
  11526.  
  11527. case 200:
  11528. int l8 = inStream.readUnsignedWord();
  11529. int i15 = inStream.readSignedWord();
  11530. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  11531. class9_4.anInt257 = i15;
  11532. pktType = -1;
  11533. return true;
  11534.  
  11535. case 219:
  11536. if (invOverlayInterfaceID != -1) {
  11537. invOverlayInterfaceID = -1;
  11538. tabAreaAltered = true;
  11539. }
  11540. if (backDialogID != -1) {
  11541. backDialogID = -1;
  11542. inputTaken = true;
  11543. }
  11544. if (inputDialogState != 0) {
  11545. inputDialogState = 0;
  11546. inputTaken = true;
  11547. }
  11548. openInterfaceID = -1;
  11549. aBoolean1149 = false;
  11550. pktType = -1;
  11551. return true;
  11552.  
  11553. case 34:
  11554. int i9 = inStream.readUnsignedWord();
  11555. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  11556. while (inStream.currentOffset < pktSize) {
  11557. int j20 = inStream.method422();
  11558. int i23 = inStream.readUnsignedWord();
  11559. int l25 = inStream.readUnsignedByte();
  11560. if (l25 == 255)
  11561. l25 = inStream.readDWord();
  11562. if (j20 >= 0 && j20 < class9_2.inv.length) {
  11563. class9_2.inv[j20] = i23;
  11564. class9_2.invStackSizes[j20] = l25;
  11565. }
  11566. }
  11567. pktType = -1;
  11568. return true;
  11569.  
  11570. case 4:
  11571. case 44:
  11572. case 84:
  11573. case 101:
  11574. case 105:
  11575. case 117:
  11576. case 147:
  11577. case 151:
  11578. case 156:
  11579. case 160:
  11580. case 215:
  11581. method137(inStream, pktType);
  11582. pktType = -1;
  11583. return true;
  11584.  
  11585. case 106:
  11586. tabID = inStream.method427();
  11587. tabAreaAltered = true;
  11588. pktType = -1;
  11589. return true;
  11590.  
  11591. case 164:
  11592. int j9 = inStream.method434();
  11593. method60(j9);
  11594. if (invOverlayInterfaceID != -1) {
  11595. invOverlayInterfaceID = -1;
  11596. tabAreaAltered = true;
  11597. }
  11598. backDialogID = j9;
  11599. inputTaken = true;
  11600. openInterfaceID = -1;
  11601. aBoolean1149 = false;
  11602. pktType = -1;
  11603. return true;
  11604.  
  11605. }
  11606. Signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  11607. // resetLogout();
  11608. } catch (IOException _ex) {
  11609. dropClient();
  11610. } catch (Exception exception) {
  11611. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  11612. for (int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  11613. s2 = s2 + inStream.buffer[j15] + ",";
  11614. Signlink.reporterror(s2);
  11615. // resetLogout();
  11616. }
  11617. pktType = -1;
  11618. return true;
  11619. }
  11620.  
  11621. private void method146() {
  11622. anInt1265++;
  11623. method47(true);
  11624. method26(true);
  11625. method47(false);
  11626. method26(false);
  11627. method55();
  11628. method104();
  11629. if (!aBoolean1160) {
  11630. int i = anInt1184;
  11631. if (anInt984 / 256 > i)
  11632. i = anInt984 / 256;
  11633. if (aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  11634. i = anIntArray1203[4] + 128;
  11635. int k = minimapInt1 + anInt896 & 0x7ff;
  11636. setCameraPos(cameraZoom + (frameWidth >= 1024 ? i + cameraZoom - frameHeight / 200 : i) * (WorldController.viewDistance == 9 && frameMode == ScreenMode.RESIZABLE ? 1 : WorldController.viewDistance == 10 ? 1 : 3), i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  11637. }
  11638. int j;
  11639. if (!aBoolean1160)
  11640. j = method120();
  11641. else
  11642. j = method121();
  11643. int l = xCameraPos;
  11644. int i1 = zCameraPos;
  11645. int j1 = yCameraPos;
  11646. int k1 = yCameraCurve;
  11647. int l1 = xCameraCurve;
  11648. for (int i2 = 0; i2 < 5; i2++)
  11649. if (aBooleanArray876[i2]) {
  11650. 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]);
  11651. if (i2 == 0)
  11652. xCameraPos += j2;
  11653. if (i2 == 1)
  11654. zCameraPos += j2;
  11655. if (i2 == 2)
  11656. yCameraPos += j2;
  11657. if (i2 == 3)
  11658. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  11659. if (i2 == 4) {
  11660. yCameraCurve += j2;
  11661. if (yCameraCurve < 128)
  11662. yCameraCurve = 128;
  11663. if (yCameraCurve > 383)
  11664. yCameraCurve = 383;
  11665. }
  11666. }
  11667. int k2 = Texture.anInt1481;
  11668. Model.aBoolean1684 = true;
  11669. Model.anInt1687 = 0;
  11670. Model.anInt1685 = super.mouseX - 4;
  11671. Model.anInt1686 = super.mouseY - 4;
  11672. DrawingArea.setAllPixelsToZero();
  11673. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  11674. worldController.clearObj5Cache();
  11675. updateEntities();
  11676. drawHeadIcon();
  11677. method37(k2);
  11678. draw3dScreen();
  11679. if (frameMode != ScreenMode.FIXED) {
  11680. drawChatArea();
  11681. drawMinimap();
  11682. drawTabArea();
  11683. }
  11684. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  11685. xCameraPos = l;
  11686. zCameraPos = i1;
  11687. yCameraPos = j1;
  11688. yCameraCurve = k1;
  11689. xCameraCurve = l1;
  11690. }
  11691.  
  11692. private void processMinimapActions() {
  11693. final boolean fixed = frameMode == ScreenMode.FIXED;
  11694. if (fixed ? super.mouseX >= 542 && super.mouseX <= 579 && super.mouseY >= 2 && super.mouseY <= 38 :
  11695. super.mouseX >= frameWidth - 180 && super.mouseX <= frameWidth - 139 && super.mouseY >= 0 && super.mouseY <= 40) {
  11696. menuActionName[1] = "Face North";
  11697. menuActionID[1] = 696;
  11698. menuActionRow = 2;
  11699. }
  11700. if (frameMode != ScreenMode.FIXED && changeTabArea) {
  11701. if (super.mouseX >= frameWidth - 26 && super.mouseX <= frameWidth - 1 && super.mouseY >= 2 && super.mouseY <= 24) {
  11702. menuActionName[1] = "Logout";
  11703. menuActionID[1] = 700;
  11704. menuActionRow = 2;
  11705. }
  11706. }
  11707. if (xpCounterHover) {
  11708. menuActionName[3] = drawExperienceCounter ? "Hide @lre@XP Counter" : "Display @lre@XP Counter";
  11709. menuActionID[3] = 474;
  11710. menuActionName[2] = "Reset @lre@XP Counter";
  11711. menuActionID[2] = 475;
  11712. menuActionName[1] = drawTotalExperience ? "Hide @lre@Total XP" : "Display @lre@Total XP";
  11713. menuActionID[1] = 476;
  11714. menuActionRow = 4;
  11715. }
  11716. if (prayHover) {
  11717. menuActionName[2] = prayClicked ? "Turn quick-prayers off" : "Turn quick-prayers on";
  11718. menuActionID[2] = 1500;
  11719. menuActionRow = 2;
  11720. menuActionName[1] = "Select quick-prayers";
  11721. menuActionID[1] = 1506;
  11722. menuActionRow = 3;
  11723. }
  11724. if (runHover) {
  11725. menuActionName[1] = !runClicked ? "Turn run mode on" : "Turn run mode off";
  11726. menuActionID[1] = 1050;
  11727. menuActionRow = 2;
  11728. }
  11729. }
  11730.  
  11731. private void loadAllOrbs(int xOffset) {
  11732. loadHpOrb(xOffset);
  11733. loadPrayerOrb(xOffset);
  11734. loadRunOrb(xOffset);
  11735. }
  11736.  
  11737. private int xpCounter, xpPos, xpAdded = 0;
  11738. private boolean drawExperienceCounter;
  11739.  
  11740. void loadTotalXP() {
  11741. long totalXP = 0;
  11742. int textWidth = regularText.getTextWidth(NumberFormat.getIntegerInstance().format(totalXP));
  11743. for (int i = 0; i < 23; i++) {
  11744. totalXP += currentExp[i];
  11745. }
  11746. if (frameMode == ScreenMode.FIXED ? super.mouseX >= 390 && super.mouseX <= 502 && super.mouseY >= 10 && super.mouseY <= 38 : super.mouseX >= frameWidth - 335 && super.mouseX <= frameWidth - 223 && super.mouseY >= 10 && super.mouseY < 40) {
  11747. drawTooltip((frameMode == ScreenMode.FIXED ? 390 : frameWidth - 330) - (textWidth - textWidth / 2), (frameMode == ScreenMode.FIXED ? 33 : 38), "Total: "+NumberFormat.getIntegerInstance().format(totalXP));
  11748. }
  11749. }
  11750.  
  11751. void loadXPCounter() {
  11752. int textWidth = smallText.getTextWidth(NumberFormat.getIntegerInstance().format(xpCounter));
  11753. int xp = textWidth - textWidth / 2;
  11754. String text = NumberFormat.getIntegerInstance().format(xpCounter);
  11755. if (xpCounter > 214_748_364) {
  11756. xpCounter = 214_748_364;
  11757. }
  11758. cacheSprite[21].drawARGBSprite((frameMode == ScreenMode.FIXED ? 386 : frameWidth - 335), (frameMode == ScreenMode.FIXED ? 5 : 10), 200);
  11759. smallText.method382(0xFFFFFF, (frameMode == ScreenMode.FIXED ? 490 : frameWidth - 230) - xp, text, (frameMode == ScreenMode.FIXED ? 25 : 30), true);
  11760. sideIcons[1].drawSprite((frameMode == ScreenMode.FIXED ? 390 : frameWidth - 332), (frameMode == ScreenMode.FIXED ? 8 : 13));
  11761. if (xpAdded != 0) {
  11762. textWidth = smallText.getTextWidth("" + NumberFormat.getIntegerInstance().format(xpAdded) + "xp");
  11763. smallText.method389(true, (frameMode == ScreenMode.FIXED ? 481 : frameWidth - 239) - xp, 0xFFFFFF, "+" + NumberFormat.getIntegerInstance().format(xpAdded), 50 - xpPos);
  11764. xpPos++;
  11765. if (xpPos >= 25) {
  11766. xpPos = xpAdded = 0;
  11767. }
  11768. } else {
  11769. xpAdded = 0;
  11770. }
  11771. }
  11772.  
  11773. public int xpAddedPos, expAdded;
  11774.  
  11775. void loadPrayerOrb(int xOffset) {
  11776. Sprite bg = cacheSprite[prayHover ? 7 : 6];
  11777. Sprite fg = cacheSprite[prayClicked ? 2 : 1];
  11778. bg.drawSprite(0 + xOffset, 85);
  11779. fg.drawSprite(27 + xOffset, 89);
  11780. int level = Integer.valueOf(RSInterface.interfaceCache[4012].message);
  11781. int max = Integer.valueOf(RSInterface.interfaceCache[4013].message);
  11782. double percent = level / (double) max;
  11783. cacheSprite[5].myHeight = (int) (26 * (1 - percent));
  11784. cacheSprite[5].drawSprite(27 + xOffset, 89);
  11785. if (percent <= .25) {
  11786. cacheSprite[9].drawARGBSprite(30 + xOffset, 92, 200 + (int) (50 * Math.sin(loopCycle / 7.0)));
  11787. } else {
  11788. cacheSprite[9].drawSprite(30 + xOffset, 92);
  11789. }
  11790. smallText.method382(getOrbTextColor((int) (percent * 100)), 16 + xOffset, String.valueOf(level), 111, true);
  11791. }
  11792.  
  11793. void loadRunOrb(int xOffset) {
  11794. Sprite bg = cacheSprite[runHover ? 7 : 6];
  11795. Sprite fg = cacheSprite[variousSettings[152] == 1 ? 4 : 3];
  11796. bg.drawSprite(24 + xOffset, 122);
  11797. fg.drawSprite(51 + xOffset, 126);
  11798. int level = energy;
  11799. double percent = level / (double) 100;
  11800. cacheSprite[5].myHeight = (int) (26 * (1 - percent));
  11801. cacheSprite[5].drawSprite(51 + xOffset, 126);
  11802. if (percent <= .25) {
  11803. cacheSprite[variousSettings[152] == 1 ? 11 : 10].drawARGBSprite(58 + xOffset, 130, 200 + (int) (50 * Math.sin(loopCycle / 7.0)));
  11804. } else {
  11805. cacheSprite[variousSettings[152] == 1 ? 11 : 10].drawSprite(58 + xOffset, 130);
  11806. }
  11807. smallText.method382(getOrbTextColor((int) (percent * 100)), 40 + xOffset, String.valueOf(level), 148, true);
  11808. }
  11809.  
  11810. void loadHpOrb(int xOffset) {
  11811. Sprite bg = cacheSprite[6];
  11812. bg.drawSprite(0 + xOffset, 41);
  11813. cacheSprite[0].drawSprite(27 + xOffset, 45);
  11814. int level = Integer.valueOf(RSInterface.interfaceCache[4016].message);
  11815. int max = Integer.valueOf(RSInterface.interfaceCache[4017].message);
  11816. double percent = level / (double) max;
  11817. cacheSprite[5].myHeight = (int) (26 * (1 - percent));
  11818. cacheSprite[5].drawSprite(27 + xOffset, 45);
  11819. if (percent <= .25) {
  11820. cacheSprite[8].drawARGBSprite(33 + xOffset, 52, 200 + (int) (50 * Math.sin(loopCycle / 7.0)));
  11821. } else {
  11822. cacheSprite[8].drawSprite(33 + xOffset, 52);
  11823. }
  11824. smallText.method382(getOrbTextColor((int) (percent * 100)), 15 + xOffset, String.valueOf(level), 67, true);
  11825. }
  11826.  
  11827. private boolean runHover, prayHover, xpCounterHover, drawTotalExperience, prayClicked, autocast, runClicked = true;
  11828.  
  11829. public int getOrbTextColor(int statusInt) {
  11830. if (statusInt >= 75 && statusInt <= Integer.MAX_VALUE)
  11831. return 0x00FF00;
  11832. else if (statusInt >= 50 && statusInt <= 74)
  11833. return 0xFFFF00;
  11834. else if (statusInt >= 25 && statusInt <= 49)
  11835. return 0xFF981F;
  11836. else
  11837. return 0xFF0000;
  11838. }
  11839.  
  11840. public int getOrbFill(int statusInt) {
  11841. if (statusInt <= Integer.MAX_VALUE && statusInt >= 97)
  11842. return 0;
  11843. else if (statusInt <= 96 && statusInt >= 93)
  11844. return 1;
  11845. else if (statusInt <= 92 && statusInt >= 89)
  11846. return 2;
  11847. else if (statusInt <= 88 && statusInt >= 85)
  11848. return 3;
  11849. else if (statusInt <= 84 && statusInt >= 81)
  11850. return 4;
  11851. else if (statusInt <= 80 && statusInt >= 77)
  11852. return 5;
  11853. else if (statusInt <= 76 && statusInt >= 73)
  11854. return 6;
  11855. else if (statusInt <= 72 && statusInt >= 69)
  11856. return 7;
  11857. else if (statusInt <= 68 && statusInt >= 65)
  11858. return 8;
  11859. else if (statusInt <= 64 && statusInt >= 61)
  11860. return 9;
  11861. else if (statusInt <= 60 && statusInt >= 57)
  11862. return 10;
  11863. else if (statusInt <= 56 && statusInt >= 53)
  11864. return 11;
  11865. else if (statusInt <= 52 && statusInt >= 49)
  11866. return 12;
  11867. else if (statusInt <= 48 && statusInt >= 45)
  11868. return 13;
  11869. else if (statusInt <= 44 && statusInt >= 41)
  11870. return 14;
  11871. else if (statusInt <= 40 && statusInt >= 37)
  11872. return 15;
  11873. else if (statusInt <= 36 && statusInt >= 33)
  11874. return 16;
  11875. else if (statusInt <= 32 && statusInt >= 29)
  11876. return 17;
  11877. else if (statusInt <= 28 && statusInt >= 25)
  11878. return 18;
  11879. else if (statusInt <= 24 && statusInt >= 21)
  11880. return 19;
  11881. else if (statusInt <= 20 && statusInt >= 17)
  11882. return 20;
  11883. else if (statusInt <= 16 && statusInt >= 13)
  11884. return 21;
  11885. else if (statusInt <= 12 && statusInt >= 9)
  11886. return 22;
  11887. else if (statusInt <= 8 && statusInt >= 7)
  11888. return 23;
  11889. else if (statusInt <= 6 && statusInt >= 5)
  11890. return 24;
  11891. else if (statusInt <= 4 && statusInt >= 3)
  11892. return 25;
  11893. else if (statusInt <= 2 && statusInt >= 1)
  11894. return 26;
  11895. else if (statusInt <= 0)
  11896. return 27;
  11897. return 0;
  11898. }
  11899.  
  11900. public void clearTopInterfaces() {
  11901. stream.createFrame(130);
  11902. if (invOverlayInterfaceID != -1) {
  11903. invOverlayInterfaceID = -1;
  11904. aBoolean1149 = false;
  11905. tabAreaAltered = true;
  11906. }
  11907. if (backDialogID != -1) {
  11908. backDialogID = -1;
  11909. inputTaken = true;
  11910. aBoolean1149 = false;
  11911. }
  11912. openInterfaceID = -1;
  11913. fullscreenInterfaceID = -1;
  11914. }
  11915.  
  11916. public Client() {
  11917. xpAdded = 0;
  11918. fullscreenInterfaceID = -1;
  11919. chatRights = new int[500];
  11920. chatTypeView = 0;
  11921. clanChatMode = 0;
  11922. cButtonHPos = -1;
  11923. cButtonCPos = 0;
  11924. server = ClientConstants.SERVER_IP;
  11925. anIntArrayArray825 = new int[104][104];
  11926. friendsNodeIDs = new int[200];
  11927. groundArray = new NodeList[4][104][104];
  11928. aBoolean831 = false;
  11929. aStream_834 = new Stream(new byte[5000]);
  11930. npcArray = new Npc[16384];
  11931. npcIndices = new int[16384];
  11932. anIntArray840 = new int[1000];
  11933. aStream_847 = Stream.create();
  11934. aBoolean848 = true;
  11935. openInterfaceID = -1;
  11936. currentExp = new int[Skills.skillsCount];
  11937. aBoolean872 = false;
  11938. anIntArray873 = new int[5];
  11939. aBooleanArray876 = new boolean[5];
  11940. drawFlames = false;
  11941. reportAbuseInput = "";
  11942. unknownInt10 = -1;
  11943. menuOpen = false;
  11944. inputString = "";
  11945. maxPlayers = 2048;
  11946. myPlayerIndex = 2047;
  11947. playerArray = new Player[maxPlayers];
  11948. playerIndices = new int[maxPlayers];
  11949. anIntArray894 = new int[maxPlayers];
  11950. aStreamArray895s = new Stream[maxPlayers];
  11951. anInt897 = 1;
  11952. anIntArrayArray901 = new int[104][104];
  11953. aByteArray912 = new byte[16384];
  11954. currentStats = new int[Skills.skillsCount];
  11955. ignoreListAsLongs = new long[100];
  11956. loadingError = false;
  11957. anIntArray928 = new int[5];
  11958. anIntArrayArray929 = new int[104][104];
  11959. chatTypes = new int[500];
  11960. chatNames = new String[500];
  11961. chatMessages = new String[500];
  11962. sideIcons = new Sprite[15];
  11963. aBoolean954 = true;
  11964. friendsListAsLongs = new long[200];
  11965. currentSong = -1;
  11966. drawingFlames = false;
  11967. spriteDrawX = -1;
  11968. spriteDrawY = -1;
  11969. anIntArray968 = new int[33];
  11970. anIntArray969 = new int[256];
  11971. decompressors = new Decompressor[5];
  11972. variousSettings = new int[2000];
  11973. aBoolean972 = false;
  11974. anInt975 = 50;
  11975. anIntArray976 = new int[anInt975];
  11976. anIntArray977 = new int[anInt975];
  11977. anIntArray978 = new int[anInt975];
  11978. anIntArray979 = new int[anInt975];
  11979. anIntArray980 = new int[anInt975];
  11980. anIntArray981 = new int[anInt975];
  11981. anIntArray982 = new int[anInt975];
  11982. aStringArray983 = new String[anInt975];
  11983. anInt985 = -1;
  11984. hitMarks = new Sprite[20];
  11985. anIntArray990 = new int[5];
  11986. aBoolean994 = false;
  11987. amountOrNameInput = "";
  11988. aClass19_1013 = new NodeList();
  11989. aBoolean1017 = false;
  11990. anInt1018 = -1;
  11991. anIntArray1030 = new int[5];
  11992. aBoolean1031 = false;
  11993. mapFunctions = new Sprite[100];
  11994. dialogID = -1;
  11995. maxStats = new int[Skills.skillsCount];
  11996. anIntArray1045 = new int[2000];
  11997. aBoolean1047 = true;
  11998. anIntArray1052 = new int[152];
  11999. anIntArray1229 = new int[152];
  12000. anInt1054 = -1;
  12001. aClass19_1056 = new NodeList();
  12002. anIntArray1057 = new int[33];
  12003. aClass9_1059 = new RSInterface();
  12004. mapScenes = new Background[100];
  12005. barFillColor = 0x4d4233;
  12006. anIntArray1065 = new int[7];
  12007. anIntArray1072 = new int[1000];
  12008. anIntArray1073 = new int[1000];
  12009. aBoolean1080 = false;
  12010. friendsList = new String[200];
  12011. inStream = Stream.create();
  12012. expectedCRCs = new int[9];
  12013. menuActionCmd2 = new int[500];
  12014. menuActionCmd3 = new int[500];
  12015. menuActionID = new int[500];
  12016. menuActionCmd1 = new int[500];
  12017. headIcons = new Sprite[20];
  12018. skullIcons = new Sprite[20];
  12019. headIconsHint = new Sprite[20];
  12020. tabAreaAltered = false;
  12021. aString1121 = "";
  12022. atPlayerActions = new String[5];
  12023. atPlayerArray = new boolean[5];
  12024. anIntArrayArrayArray1129 = new int[4][13][13];
  12025. anInt1132 = 2;
  12026. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  12027. aBoolean1141 = false;
  12028. aBoolean1149 = false;
  12029. crosses = new Sprite[8];
  12030. musicEnabled = true;
  12031. loggedIn = false;
  12032. canMute = false;
  12033. aBoolean1159 = false;
  12034. aBoolean1160 = false;
  12035. anInt1171 = 1;
  12036. myUsername = "";
  12037. myPassword = "";
  12038. genericLoadingError = false;
  12039. reportAbuseInterfaceID = -1;
  12040. aClass19_1179 = new NodeList();
  12041. anInt1184 = 128;
  12042. invOverlayInterfaceID = -1;
  12043. stream = Stream.create();
  12044. menuActionName = new String[500];
  12045. anIntArray1203 = new int[5];
  12046. anIntArray1207 = new int[50];
  12047. anInt1210 = 2;
  12048. anInt1211 = 78;
  12049. promptInput = "";
  12050. modIcons = new Background[2];
  12051. tabID = 3;
  12052. inputTaken = false;
  12053. songChanging = true;
  12054. aClass11Array1230 = new Class11[4];
  12055. anIntArray1240 = new int[100];
  12056. anIntArray1241 = new int[50];
  12057. aBoolean1242 = false;
  12058. anIntArray1250 = new int[50];
  12059. rsAlreadyLoaded = false;
  12060. welcomeScreenRaised = false;
  12061. messagePromptRaised = false;
  12062. loginMessage1 = "";
  12063. loginMessage2 = "";
  12064. backDialogID = -1;
  12065. anInt1279 = 2;
  12066. bigX = new int[4000];
  12067. bigY = new int[4000];
  12068. }
  12069.  
  12070. public int rights;
  12071. public String name;
  12072. public String message;
  12073. public String clanname;
  12074. private final int[] chatRights;
  12075. public int chatTypeView;
  12076. public int clanChatMode;
  12077. public int autoCastId = 0;
  12078. public Sprite[] cacheSprite;
  12079. private GraphicsBuffer leftFrame;
  12080. private GraphicsBuffer topFrame;
  12081. private int ignoreCount;
  12082. private long aLong824;
  12083. private int[][] anIntArrayArray825;
  12084. private int[] friendsNodeIDs;
  12085. private NodeList[][][] groundArray;
  12086. private int[] anIntArray828;
  12087. private int[] anIntArray829;
  12088. private volatile boolean aBoolean831;
  12089. private Socket aSocket832;
  12090. private int loginScreenState;
  12091. private Stream aStream_834;
  12092. private Npc[] npcArray;
  12093. private int npcCount;
  12094. private int[] npcIndices;
  12095. private int anInt839;
  12096. private int[] anIntArray840;
  12097. private int anInt841;
  12098. private int anInt842;
  12099. private int anInt843;
  12100. private String aString844;
  12101. public String prayerBook;
  12102. private int privateChatMode;
  12103. private Stream aStream_847;
  12104. private boolean aBoolean848;
  12105. private static int anInt849;
  12106. private int[] anIntArray850;
  12107. private int[] anIntArray851;
  12108. private int[] anIntArray852;
  12109. private int[] anIntArray853;
  12110. private static int anInt854;
  12111. private int anInt855;
  12112. static int openInterfaceID;
  12113. private int xCameraPos;
  12114. private int zCameraPos;
  12115. private int yCameraPos;
  12116. private int yCameraCurve;
  12117. private int xCameraCurve;
  12118. private int myPrivilege;
  12119. private final int[] currentExp;
  12120. private Sprite mapFlag;
  12121. private Sprite mapMarker;
  12122. private boolean aBoolean872;
  12123. private final int[] anIntArray873;
  12124. private final boolean[] aBooleanArray876;
  12125. private int weight;
  12126. private MouseDetection mouseDetection;
  12127. private volatile boolean drawFlames;
  12128. private String reportAbuseInput;
  12129. private int unknownInt10;
  12130. private boolean menuOpen;
  12131. private int anInt886;
  12132. private String inputString;
  12133. private final int maxPlayers;
  12134. private final int myPlayerIndex;
  12135. private Player[] playerArray;
  12136. private int playerCount;
  12137. private int[] playerIndices;
  12138. private int anInt893;
  12139. private int[] anIntArray894;
  12140. private Stream[] aStreamArray895s;
  12141. private int anInt896;
  12142. public int anInt897;
  12143. private int friendsCount;
  12144. private int anInt900;
  12145. private int[][] anIntArrayArray901;
  12146. private byte[] aByteArray912;
  12147. private int anInt913;
  12148. private int crossX;
  12149. private int crossY;
  12150. private int crossIndex;
  12151. private int crossType;
  12152. private int plane;
  12153. private final int[] currentStats;
  12154. private static int anInt924;
  12155. private final long[] ignoreListAsLongs;
  12156. private boolean loadingError;
  12157. private final int[] anIntArray928;
  12158. private int[][] anIntArrayArray929;
  12159. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  12160. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  12161. private int anInt933;
  12162. private int anInt934;
  12163. private int anInt935;
  12164. private int anInt936;
  12165. private int anInt937;
  12166. private int anInt938;
  12167. private final int[] chatTypes;
  12168. private final String[] chatNames;
  12169. private final String[] chatMessages;
  12170. private int anInt945;
  12171. private WorldController worldController;
  12172. private Sprite[] sideIcons;
  12173. private int menuScreenArea;
  12174. private int menuOffsetX;
  12175. private int menuOffsetY;
  12176. private int menuWidth;
  12177. private int menuHeight;
  12178. private long aLong953;
  12179. private boolean aBoolean954;
  12180. private long[] friendsListAsLongs;
  12181. private String[] clanList = new String[100];
  12182. private int currentSong;
  12183. private static int nodeID = 10;
  12184. static int portOff;
  12185. static boolean clientData;
  12186. private static boolean isMembers = true;
  12187. private static boolean lowMem;
  12188. private volatile boolean drawingFlames;
  12189. private int spriteDrawX;
  12190. private int spriteDrawY;
  12191. private final int[] anIntArray965 = { 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff };
  12192. private Background aBackground_966;
  12193. private Background aBackground_967;
  12194. private final int[] anIntArray968;
  12195. private final int[] anIntArray969;
  12196. final Decompressor[] decompressors;
  12197. public int variousSettings[];
  12198. private boolean aBoolean972;
  12199. private final int anInt975;
  12200. private final int[] anIntArray976;
  12201. private final int[] anIntArray977;
  12202. private final int[] anIntArray978;
  12203. private final int[] anIntArray979;
  12204. private final int[] anIntArray980;
  12205. private final int[] anIntArray981;
  12206. private final int[] anIntArray982;
  12207. private final String[] aStringArray983;
  12208. private int anInt984;
  12209. private int anInt985;
  12210. private static int anInt986;
  12211. private Sprite[] hitMarks;
  12212. public int anInt988;
  12213. private int anInt989;
  12214. private final int[] anIntArray990;
  12215. private final boolean aBoolean994;
  12216. private int anInt995;
  12217. private int anInt996;
  12218. private int anInt997;
  12219. private int anInt998;
  12220. private int anInt999;
  12221. private ISAACRandomGen encryption;
  12222. private Sprite multiOverlay;
  12223. 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 } };
  12224. private String amountOrNameInput;
  12225. private static int anInt1005;
  12226. private int daysSinceLastLogin;
  12227. private int pktSize;
  12228. private int pktType;
  12229. private int anInt1009;
  12230. private int anInt1010;
  12231. private int anInt1011;
  12232. private NodeList aClass19_1013;
  12233. private int anInt1014;
  12234. private int anInt1015;
  12235. private int anInt1016;
  12236. private boolean aBoolean1017;
  12237. private int anInt1018;
  12238. private static final int[] anIntArray1019;
  12239. private int anInt1021;
  12240. private int anInt1022;
  12241. private int loadingStage;
  12242. private Sprite scrollBar1;
  12243. private Sprite scrollBar2;
  12244. private int anInt1026;
  12245. private final int[] anIntArray1030;
  12246. private boolean aBoolean1031;
  12247. private Sprite[] mapFunctions;
  12248. private int baseX;
  12249. private int baseY;
  12250. private int anInt1036;
  12251. private int anInt1037;
  12252. private int loginFailures;
  12253. private int anInt1039;
  12254. private int anInt1040;
  12255. private int anInt1041;
  12256. private int dialogID;
  12257. private final int[] maxStats;
  12258. private final int[] anIntArray1045;
  12259. private int anInt1046;
  12260. private boolean aBoolean1047;
  12261. private int anInt1048;
  12262. private String aString1049;
  12263. private static int anInt1051;
  12264. private final int[] anIntArray1052;
  12265. private StreamLoader titleStreamLoader;
  12266. private int anInt1054;
  12267. private int anInt1055;
  12268. private NodeList aClass19_1056;
  12269. private final int[] anIntArray1057;
  12270. public final RSInterface aClass9_1059;
  12271. private Background[] mapScenes;
  12272. private int anInt1062;
  12273. private final int barFillColor;
  12274. private int friendsListAction;
  12275. private final int[] anIntArray1065;
  12276. private int mouseInvInterfaceIndex;
  12277. private int lastActiveInvInterface;
  12278. public OnDemandFetcher onDemandFetcher;
  12279. private int anInt1069;
  12280. private int anInt1070;
  12281. private int anInt1071;
  12282. private int[] anIntArray1072;
  12283. private int[] anIntArray1073;
  12284. private Sprite mapDotItem;
  12285. private Sprite mapDotNPC;
  12286. private Sprite mapDotPlayer;
  12287. private Sprite mapDotFriend;
  12288. private Sprite mapDotTeam;
  12289. private Sprite mapDotClan;
  12290. private int anInt1079;
  12291. private boolean aBoolean1080;
  12292. private String[] friendsList;
  12293. private Stream inStream;
  12294. private int anInt1084;
  12295. private int anInt1085;
  12296. private int activeInterfaceType;
  12297. private int anInt1087;
  12298. private int anInt1088;
  12299. public static int anInt1089;
  12300. public static int spellID = 0;
  12301. public static int totalRead = 0;
  12302. private final int[] expectedCRCs;
  12303. private int[] menuActionCmd2;
  12304. private int[] menuActionCmd3;
  12305. private int[] menuActionID;
  12306. private int[] menuActionCmd1;
  12307. private Sprite[] headIcons;
  12308. private Sprite[] skullIcons;
  12309. private Sprite entityBox, entityBox2;
  12310. private Sprite[] headIconsHint;
  12311. private static int anInt1097;
  12312. private int anInt1098;
  12313. private int anInt1099;
  12314. private int anInt1100;
  12315. private int anInt1101;
  12316. private int anInt1102;
  12317. private static boolean tabAreaAltered;
  12318. private int anInt1104;
  12319. private GraphicsBuffer aRSImageProducer_1107;
  12320. private GraphicsBuffer aRSImageProducer_1108;
  12321. private static GraphicsBuffer aRSImageProducer_1109;
  12322. private GraphicsBuffer aRSImageProducer_1110;
  12323. private GraphicsBuffer aRSImageProducer_1111;
  12324. private GraphicsBuffer aRSImageProducer_1112;
  12325. private GraphicsBuffer aRSImageProducer_1113;
  12326. private GraphicsBuffer aRSImageProducer_1114;
  12327. private GraphicsBuffer aRSImageProducer_1115;
  12328. private static int anInt1117;
  12329. private int membersInt;
  12330. private String aString1121;
  12331. private Sprite compass;
  12332. private GraphicsBuffer aRSImageProducer_1125;
  12333. public static Player myPlayer;
  12334. private final String[] atPlayerActions;
  12335. private final boolean[] atPlayerArray;
  12336. private final int[][][] anIntArrayArrayArray1129;
  12337. public static final int[] tabInterfaceIDs = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
  12338. private int anInt1131;
  12339. public int anInt1132;
  12340. private int menuActionRow;
  12341. private static int anInt1134;
  12342. private int spellSelected;
  12343. private int anInt1137;
  12344. private int spellUsableOn;
  12345. private String spellTooltip;
  12346. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  12347. private boolean aBoolean1141;
  12348. private static int anInt1142;
  12349. private int energy;
  12350. private boolean aBoolean1149;
  12351. private Sprite[] crosses;
  12352. private boolean musicEnabled;
  12353. private Background[] aBackgroundArray1152s;
  12354. private int unreadMessages;
  12355. private static int anInt1155;
  12356. private static boolean fpsOn;
  12357. public static boolean loggedIn;
  12358. private boolean canMute;
  12359. private boolean aBoolean1159;
  12360. private boolean aBoolean1160;
  12361. static int loopCycle;
  12362. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  12363. private static GraphicsBuffer aRSImageProducer_1163;
  12364. private GraphicsBuffer aRSImageProducer_1164;
  12365. private static GraphicsBuffer aRSImageProducer_1165;
  12366. private static GraphicsBuffer aRSImageProducer_1166;
  12367. private int daysSinceRecovChange;
  12368. private RSSocket socketStream;
  12369. private int anInt1169;
  12370. private int minimapInt3;
  12371. public int anInt1171;
  12372. public static String myUsername;
  12373. public static String myPassword;
  12374. private static int anInt1175;
  12375. private boolean genericLoadingError;
  12376. 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 };
  12377. private int reportAbuseInterfaceID;
  12378. private NodeList aClass19_1179;
  12379. private static int[] anIntArray1180;
  12380. private static int[] anIntArray1181;
  12381. private static int[] anIntArray1182;
  12382. private byte[][] aByteArrayArray1183;
  12383. private int anInt1184;
  12384. private int minimapInt1;
  12385. private int anInt1186;
  12386. private int anInt1187;
  12387. private static int anInt1188;
  12388. private int invOverlayInterfaceID;
  12389. private int[] anIntArray1190;
  12390. private int[] anIntArray1191;
  12391. private Stream stream;
  12392. private int anInt1193;
  12393. private int splitPrivateChat;
  12394. private Background mapBack;
  12395. private String[] menuActionName;
  12396. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  12397. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  12398. private final int[] anIntArray1203;
  12399. static final int[] anIntArray1204 = { 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145, 58654, 5027, 1457, 16565, 34991, 25486 };
  12400. private static boolean flagged;
  12401. private final int[] anIntArray1207;
  12402. private int minimapInt2;
  12403. public int anInt1210;
  12404. static int anInt1211;
  12405. private String promptInput;
  12406. private int anInt1213;
  12407. private int[][][] intGroundArray;
  12408. private long aLong1215;
  12409. private int loginScreenCursorPos;
  12410. private final Background[] modIcons;
  12411. private long aLong1220;
  12412. static int tabID;
  12413. private int anInt1222;
  12414. public static boolean inputTaken;
  12415. private int inputDialogState;
  12416. private static int anInt1226;
  12417. private int nextSong;
  12418. private boolean songChanging;
  12419. private final int[] anIntArray1229;
  12420. private Class11[] aClass11Array1230;
  12421. public static int anIntArray1232[];
  12422. private int[] anIntArray1234;
  12423. private int[] anIntArray1235;
  12424. private int[] anIntArray1236;
  12425. private int anInt1237;
  12426. private int anInt1238;
  12427. public final int anInt1239 = 100;
  12428. private final int[] anIntArray1240;
  12429. private final int[] anIntArray1241;
  12430. private boolean aBoolean1242;
  12431. private int atInventoryLoopCycle;
  12432. private int atInventoryInterface;
  12433. private int atInventoryIndex;
  12434. private int atInventoryInterfaceType;
  12435. private byte[][] aByteArrayArray1247;
  12436. private int tradeMode;
  12437. private int anInt1249;
  12438. private final int[] anIntArray1250;
  12439. private int anInt1251;
  12440. private final boolean rsAlreadyLoaded;
  12441. private int anInt1253;
  12442. public int anInt1254;
  12443. private boolean welcomeScreenRaised;
  12444. private boolean messagePromptRaised;
  12445. private byte[][][] byteGroundArray;
  12446. private int prevSong;
  12447. private int destX;
  12448. private int destY;
  12449. private Sprite minimapImage;
  12450. private int anInt1264;
  12451. private int anInt1265;
  12452. private String loginMessage1;
  12453. private String loginMessage2;
  12454. private int anInt1268;
  12455. private int anInt1269;
  12456. private TextDrawingArea smallText;
  12457. private TextDrawingArea regularText;
  12458. private TextDrawingArea boldText;
  12459. private TextDrawingArea fancyText;
  12460. private int anInt1275;
  12461. private int backDialogID;
  12462. private int anInt1278;
  12463. public int anInt1279;
  12464. private int[] bigX;
  12465. private int[] bigY;
  12466. private int itemSelected;
  12467. private int anInt1283;
  12468. private int anInt1284;
  12469. private int anInt1285;
  12470. private String selectedItemName;
  12471. private int publicChatMode;
  12472. private static int anInt1288;
  12473. public static int anInt1290;
  12474. public static String server = "";
  12475. public int drawCount;
  12476. public int fullscreenInterfaceID;
  12477. public int anInt1044;// 377
  12478. public int anInt1129;// 377
  12479. public int anInt1315;// 377
  12480. public int anInt1500;// 377
  12481. public int anInt1501;// 377
  12482. public static int[] fullScreenTextureArray;
  12483.  
  12484. public void resetAllImageProducers() {
  12485. if (super.fullGameScreen != null) {
  12486. return;
  12487. }
  12488. aRSImageProducer_1166 = null;
  12489. aRSImageProducer_1164 = null;
  12490. aRSImageProducer_1163 = null;
  12491. aRSImageProducer_1165 = null;
  12492. aRSImageProducer_1125 = null;
  12493. aRSImageProducer_1107 = null;
  12494. aRSImageProducer_1108 = null;
  12495. aRSImageProducer_1109 = null;
  12496. aRSImageProducer_1110 = null;
  12497. aRSImageProducer_1111 = null;
  12498. aRSImageProducer_1112 = null;
  12499. aRSImageProducer_1113 = null;
  12500. aRSImageProducer_1114 = null;
  12501. aRSImageProducer_1115 = null;
  12502. super.fullGameScreen = new GraphicsBuffer(765, 503);
  12503. welcomeScreenRaised = true;
  12504. }
  12505.  
  12506. public void mouseWheelDragged(int i, int j) {
  12507. if (!mouseWheelDown) {
  12508. return;
  12509. }
  12510. this.anInt1186 += i * 3;
  12511. this.anInt1187 += (j << 1);
  12512. }
  12513.  
  12514. public void launchURL(String url) {
  12515. String osName = System.getProperty("os.name");
  12516. try {
  12517. if (osName.startsWith("Mac OS")) {
  12518. Class<?> fileMgr = Class.forName("com.apple.eio.FileManager");
  12519. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] { String.class });
  12520. openURL.invoke(null, new Object[] { url });
  12521. } else if (osName.startsWith("Windows"))
  12522. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  12523. else { // assume Unix or Linux
  12524. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  12525. String browser = null;
  12526. for (int count = 0; count < browsers.length && browser == null; count++)
  12527. if (Runtime.getRuntime().exec(new String[] { "which", browsers[count] }).waitFor() == 0)
  12528. browser = browsers[count];
  12529. if (browser == null) {
  12530. throw new Exception("Could not find web browser");
  12531. } else
  12532. Runtime.getRuntime().exec(new String[] { browser, url });
  12533. }
  12534. } catch (Exception e) {
  12535. pushMessage("Failed to open URL.", 0, "");
  12536. }
  12537. }
  12538.  
  12539. static {
  12540. anIntArray1019 = new int[99];
  12541. int i = 0;
  12542. for (int j = 0; j < 99; j++) {
  12543. int l = j + 1;
  12544. int i1 = (int) ((double) l + 300D * Math.pow(2D, (double) l / 7D));
  12545. i += i1;
  12546. anIntArray1019[j] = i / 4;
  12547. }
  12548. anIntArray1232 = new int[32];
  12549. i = 2;
  12550. for (int k = 0; k < 32; k++) {
  12551. anIntArray1232[k] = i - 1;
  12552. i += i;
  12553. }
  12554. }
  12555. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement