Advertisement
Guest User

Untitled

a guest
May 17th, 2016
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 407.97 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. try {
  7738. entity.aBoolean1541 = false;
  7739. if (entity.anInt1517 != -1) {
  7740.  
  7741. Animation animation = Animation.anims[entity.anInt1517];
  7742. entity.anInt1519++;
  7743. if (entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518)) {
  7744. entity.anInt1519 = 1;
  7745. entity.anInt1518++;
  7746. entity.nextIdleFrame++;
  7747. }
  7748. if (enableTweening) {
  7749. entity.nextIdleFrame = entity.anInt1518 + 1;
  7750. }
  7751. if (entity.nextIdleFrame >= animation.anInt352) {
  7752. if (entity.nextIdleFrame >= animation.anInt352) {
  7753. entity.nextIdleFrame = 0;
  7754. }
  7755. }
  7756. if (entity.anInt1518 >= animation.anInt352) {
  7757. entity.anInt1519 = 1;
  7758. entity.anInt1518 = 0;
  7759. }
  7760. }
  7761. if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
  7762. if (entity.anInt1521 < 0)
  7763. entity.anInt1521 = 0;
  7764. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  7765. for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  7766. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  7767.  
  7768. if (entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352)) {
  7769. entity.anInt1520 = -1;
  7770. }
  7771. if (enableTweening) {
  7772. entity.nextGraphicFrame = entity.anInt1518 + 1;
  7773. }
  7774. if (entity.nextGraphicFrame >= animation_1.anInt352) {
  7775. entity.nextGraphicFrame = -1;
  7776. }
  7777. }
  7778. if (entity.anim != -1 && entity.anInt1529 <= 1) {
  7779. Animation animation_2 = Animation.anims[entity.anim];
  7780. if (animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle) {
  7781. entity.anInt1529 = 1;
  7782. return;
  7783. }
  7784. }
  7785. if (entity.anim != -1 && entity.anInt1529 == 0) {
  7786. Animation animation_3 = Animation.anims[entity.anim];
  7787. for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  7788. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  7789.  
  7790. if (entity.anInt1527 >= animation_3.anInt352) {
  7791. entity.anInt1527 -= animation_3.anInt356;
  7792. entity.anInt1530++;
  7793. if (entity.anInt1530 >= animation_3.anInt362)
  7794. entity.anim = -1;
  7795. if (entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  7796. entity.anim = -1;
  7797. }
  7798. if (enableTweening) {
  7799. entity.nextAnimFrame = entity.anInt1527 + 1;
  7800. }
  7801. if (entity.nextAnimFrame >= animation_3.anInt352) {
  7802. entity.nextAnimFrame = -1;
  7803. }
  7804. entity.aBoolean1541 = animation_3.aBoolean358;
  7805. }
  7806. if (entity.anInt1529 > 0) {
  7807. entity.anInt1529--;
  7808. }
  7809. } catch (Exception e) {
  7810. e.printStackTrace();
  7811. }
  7812. }
  7813.  
  7814. public GraphicsBuffer worldSelection;
  7815.  
  7816. public void worldSelection() {
  7817. resetImageProducers();
  7818. worldSelection.drawGraphics(400, super.graphics, 0);
  7819. worldSelection.initDrawingArea();
  7820. Sprite Sprite1 = new Sprite("37");
  7821. Sprite1.drawSprite(6, 63);
  7822. //cacheSprite[37].drawSprite(6, 63);
  7823. if(!ClientConstants.worldSwitch) {
  7824. boldText.method382(0xffffff, 55, "World 301", 78, true);
  7825. smallText.method382(0xffffff, 55, "Click to switch", 92, true);
  7826. ClientConstants.SERVER_IP = "127.0.0.1";
  7827. ClientConstants.SERVER_PORT = 43594;
  7828. } else {
  7829. boldText.method382(0xffffff, 55, "World 302", 78, true);
  7830. smallText.method382(0xffffff, 55, "Click to switch", 92, true);
  7831. ClientConstants.SERVER_IP = "104.197.191.124";
  7832. ClientConstants.SERVER_PORT = 43595;
  7833. }
  7834. }
  7835.  
  7836. private void drawGameScreen() {
  7837. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  7838. if (loadingStage == 2) {
  7839. method119(anInt945, fullscreenInterfaceID);
  7840. if (openInterfaceID != -1) {
  7841. method119(anInt945, openInterfaceID);
  7842. }
  7843. anInt945 = 0;
  7844. resetAllImageProducers();
  7845. super.fullGameScreen.initDrawingArea();
  7846. Texture.anIntArray1472 = fullScreenTextureArray;
  7847. DrawingArea.setAllPixelsToZero();
  7848. welcomeScreenRaised = true;
  7849. if (openInterfaceID != -1) {
  7850. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  7851. if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  7852. rsInterface_1.width = 765;
  7853. rsInterface_1.height = 503;
  7854. }
  7855. drawInterface(0, 0, rsInterface_1, 8);
  7856. }
  7857. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  7858. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  7859. rsInterface.width = 765;
  7860. rsInterface.height = 503;
  7861. }
  7862. drawInterface(0, 0, rsInterface, 8);
  7863. if (!menuOpen) {
  7864. processRightClick();
  7865. drawTooltip();
  7866. } else {
  7867. drawMenu(frameMode == ScreenMode.FIXED ? 4 : 0, frameMode == ScreenMode.FIXED ? 4 : 0);
  7868. }
  7869. }
  7870. drawCount++;
  7871. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  7872. return;
  7873. } else {
  7874. if (drawCount != 0) {
  7875. resetImageProducers2();
  7876. }
  7877. }
  7878. if (welcomeScreenRaised) {
  7879. welcomeScreenRaised = false;
  7880. if (frameMode == ScreenMode.FIXED) {
  7881. topFrame.drawGraphics(0, super.graphics, 0);
  7882. leftFrame.drawGraphics(4, super.graphics, 0);
  7883. }
  7884. inputTaken = true;
  7885. tabAreaAltered = true;
  7886. if (loadingStage != 2) {
  7887. if (frameMode == ScreenMode.FIXED) {
  7888. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  7889. aRSImageProducer_1164.drawGraphics(0, super.graphics, 516);
  7890. }
  7891. }
  7892. }
  7893. if (invOverlayInterfaceID != -1) {
  7894. method119(anInt945, invOverlayInterfaceID);
  7895. }
  7896. drawTabArea();
  7897. if(backDialogID == -1) {
  7898. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  7899. if(super.mouseX >= 496 && super.mouseX <= 511 && super.mouseY > (frameMode == ScreenMode.FIXED ? 345 : frameHeight - 158))
  7900. method65(494, 110, super.mouseX, super.mouseY - (frameMode == ScreenMode.FIXED ? 345 : frameHeight - 158), aClass9_1059, 0, false, anInt1211);
  7901. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  7902. if(i < 0) {
  7903. i = 0;
  7904. }
  7905. if(i > anInt1211 - 110) {
  7906. i = anInt1211 - 110;
  7907. }
  7908. if(anInt1089 != i) {
  7909. anInt1089 = i;
  7910. inputTaken = true;
  7911. }
  7912. }
  7913. if (backDialogID != -1) {
  7914. boolean flag2 = method119(anInt945, backDialogID);
  7915. if (flag2)
  7916. inputTaken = true;
  7917. }
  7918. if (atInventoryInterfaceType == 3)
  7919. inputTaken = true;
  7920. if (activeInterfaceType == 3)
  7921. inputTaken = true;
  7922. if (aString844 != null)
  7923. inputTaken = true;
  7924. if (menuOpen && menuScreenArea == 2)
  7925. inputTaken = true;
  7926. if (inputTaken) {
  7927. drawChatArea();
  7928. inputTaken = false;
  7929. }
  7930. if (loadingStage == 2)
  7931. method146();
  7932. if (loadingStage == 2) {
  7933. if (frameMode == ScreenMode.FIXED) {
  7934. drawMinimap();
  7935. aRSImageProducer_1164.drawGraphics(0, super.graphics, 516);
  7936. }
  7937. }
  7938. if (anInt1054 != -1)
  7939. tabAreaAltered = true;
  7940. if (tabAreaAltered) {
  7941. if (anInt1054 != -1 && anInt1054 == tabID) {
  7942. anInt1054 = -1;
  7943. stream.createFrame(120);
  7944. stream.writeWordBigEndian(tabID);
  7945. }
  7946. tabAreaAltered = false;
  7947. aRSImageProducer_1125.initDrawingArea();
  7948. aRSImageProducer_1165.initDrawingArea();
  7949. }
  7950. anInt945 = 0;
  7951. }
  7952.  
  7953. private boolean buildFriendsListMenu(RSInterface class9) {
  7954. int i = class9.contentType;
  7955. if (i >= 1 && i <= 200 || i >= 701 && i <= 900) {
  7956. if (i >= 801)
  7957. i -= 701;
  7958. else if (i >= 701)
  7959. i -= 601;
  7960. else if (i >= 101)
  7961. i -= 101;
  7962. else
  7963. i--;
  7964. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  7965. menuActionID[menuActionRow] = 792;
  7966. menuActionRow++;
  7967. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  7968. menuActionID[menuActionRow] = 639;
  7969. menuActionRow++;
  7970. return true;
  7971. }
  7972. if (i >= 401 && i <= 500) {
  7973. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  7974. menuActionID[menuActionRow] = 322;
  7975. menuActionRow++;
  7976. return true;
  7977. } else {
  7978. return false;
  7979. }
  7980. }
  7981.  
  7982. private void method104() {
  7983. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056.reverseGetFirst();
  7984. for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056.reverseGetNext())
  7985. if (class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  7986. class30_sub2_sub4_sub3.unlink();
  7987. else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
  7988. class30_sub2_sub4_sub3.method454(anInt945);
  7989. if (class30_sub2_sub4_sub3.aBoolean1567)
  7990. class30_sub2_sub4_sub3.unlink();
  7991. else
  7992. 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);
  7993. }
  7994.  
  7995. }
  7996.  
  7997. public void drawBlackBox(int xPos, int yPos) {
  7998. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  7999. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  8000. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  8001. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  8002. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  8003. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  8004. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  8005. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  8006. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  8007. }
  8008.  
  8009.  
  8010.  
  8011.  
  8012.  
  8013. private void drawInterface(int j, int k, RSInterface class9, int l) {
  8014. if (class9 == null)
  8015. class9 = RSInterface.interfaceCache[21356];
  8016. if (class9.type != 0 || class9.children == null)
  8017. return;
  8018. if (class9.isMouseoverTriggered && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  8019. return;
  8020. int i1 = DrawingArea.topX;
  8021. int j1 = DrawingArea.topY;
  8022. int k1 = DrawingArea.bottomX;
  8023. int l1 = DrawingArea.bottomY;
  8024. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  8025. int i2 = class9.children.length;
  8026. int alpha = class9.transparency;
  8027. for (int j2 = 0; j2 < i2; j2++) {
  8028. int k2 = class9.childX[j2] + k;
  8029. int l2 = (class9.childY[j2] + l) - j;
  8030. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  8031. k2 += class9_1.anInt263;
  8032. l2 += class9_1.anInt265;
  8033. if (class9_1.contentType > 0)
  8034. drawFriendsListOrWelcomeScreen(class9_1);
  8035. // here
  8036. 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,
  8037. /* Ancients */
  8038. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062, 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096 };
  8039. for (int m5 = 0; m5 < IDs.length; m5++) {
  8040. if (class9_1.id == IDs[m5] + 1) {
  8041. if (m5 > 61)
  8042. drawBlackBox(k2 + 1, l2);
  8043. else
  8044. drawBlackBox(k2, l2 + 1);
  8045. }
  8046. }
  8047. int[] runeChildren = { 1202, 1203, 1209, 1210, 1211, 1218, 1219,
  8048. 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245, 1252,
  8049. 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279,
  8050. 1286, 1287, 1293, 1294, 1295, 1302, 1303, 1304, 1311, 1312,
  8051. 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344,
  8052. 1345, 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377,
  8053. 1378, 1384, 1385, 1391, 1392, 1393, 1400, 1401, 1407, 1408,
  8054. 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441,
  8055. 1442, 1449, 1450, 1456, 1457, 1463, 1464, 1465, 1472, 1473,
  8056. 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499, 1506,
  8057. 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534,
  8058. 1535, 1547, 1548, 1549, 1556, 1557, 1558, 1566, 1567, 1568,
  8059. 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605,
  8060. 1606, 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639,
  8061. 1640, 6007, 6008, 6011, 8673, 8674, 12041, 12042, 12429,
  8062. 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451,
  8063. 12459, 12460, 15881, 15882, 15885, 18474, 18475, 18478 };
  8064. for (int r = 0; r < runeChildren.length; r++)
  8065. if (class9_1.id == runeChildren[r])
  8066. class9_1.modelZoom = 775;
  8067. if (class9_1.type == 0) {
  8068. if (class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  8069. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  8070. if (class9_1.scrollPosition < 0)
  8071. class9_1.scrollPosition = 0;
  8072. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  8073. if (class9_1.scrollMax > class9_1.height)
  8074. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax, false);
  8075. } else if (class9_1.type != 1)
  8076. if (class9_1.type == 2) {
  8077. int i3 = 0;
  8078. for (int l3 = 0; l3 < class9_1.height; l3++) {
  8079. for (int l4 = 0; l4 < class9_1.width; l4++) {
  8080. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  8081. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  8082. if (i3 < 20) {
  8083. k5 += class9_1.spritesX[i3];
  8084. j6 += class9_1.spritesY[i3];
  8085. }
  8086. if (class9_1.inv[i3] > 0) {
  8087. int k6 = 0;
  8088. int j7 = 0;
  8089. int j9 = class9_1.inv[i3] - 1;
  8090. if (k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  8091. int l9 = 0;
  8092. if (itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  8093. l9 = 0xffffff;
  8094. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  8095. if (class30_sub2_sub1_sub1_2 != null) {
  8096. if (activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  8097. k6 = super.mouseX - anInt1087;
  8098. j7 = super.mouseY - anInt1088;
  8099. if (k6 < 5 && k6 > -5)
  8100. k6 = 0;
  8101. if (j7 < 5 && j7 > -5)
  8102. j7 = 0;
  8103. if (anInt989 < 10) {
  8104. k6 = 0;
  8105. j7 = 0;
  8106. }
  8107. class30_sub2_sub1_sub1_2.drawSprite1(k5 + k6, j6 + j7);
  8108. if (j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  8109. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  8110. if (i10 > anInt945 * 10)
  8111. i10 = anInt945 * 10;
  8112. if (i10 > class9.scrollPosition)
  8113. i10 = class9.scrollPosition;
  8114. class9.scrollPosition -= i10;
  8115. anInt1088 += i10;
  8116. }
  8117. if (j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  8118. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  8119. if (j10 > anInt945 * 10)
  8120. j10 = anInt945 * 10;
  8121. if (j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  8122. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  8123. class9.scrollPosition += j10;
  8124. anInt1088 -= j10;
  8125. }
  8126. } else if (atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  8127. class30_sub2_sub1_sub1_2.drawSprite1(k5, j6);
  8128. else
  8129. class30_sub2_sub1_sub1_2.drawSprite(k5, j6);
  8130. if (class30_sub2_sub1_sub1_2.anInt1444 == 33 || class9_1.invStackSizes[i3] != 1) {
  8131. int k10 = class9_1.invStackSizes[i3];
  8132.  
  8133. smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  8134. if (k10 >= 1)
  8135. smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8136. if (k10 >= 100000)
  8137. smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8138. if (k10 >= 10000000)
  8139. smallText.method385(0x00FF80, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8140. }
  8141. }
  8142. }
  8143. } else if (class9_1.sprites != null && i3 < 20) {
  8144. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  8145. if (class30_sub2_sub1_sub1_1 != null)
  8146. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  8147. }
  8148. i3++;
  8149. }
  8150. }
  8151. } else if (class9_1.type == 3) {
  8152. boolean flag = false;
  8153. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8154. flag = true;
  8155. int j3;
  8156. if (interfaceIsSelected(class9_1)) {
  8157. j3 = class9_1.anInt219;
  8158. if (flag && class9_1.anInt239 != 0)
  8159. j3 = class9_1.anInt239;
  8160. } else {
  8161. j3 = class9_1.textColor;
  8162. if (flag && class9_1.anInt216 != 0)
  8163. j3 = class9_1.anInt216;
  8164. }
  8165. if (class9_1.aByte254 == 0) {
  8166. if (class9_1.aBoolean227)
  8167. DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  8168. else
  8169. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  8170. } else if (class9_1.aBoolean227)
  8171. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.aByte254 & 0xff), k2);
  8172. else
  8173. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.aByte254 & 0xff), j3, class9_1.width, k2);
  8174. } else if (class9_1.type == 4) {
  8175. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  8176. String s = class9_1.message;
  8177. boolean flag1 = false;
  8178. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8179. flag1 = true;
  8180. int i4;
  8181. if (interfaceIsSelected(class9_1)) {
  8182. i4 = class9_1.anInt219;
  8183. if (flag1 && class9_1.anInt239 != 0)
  8184. i4 = class9_1.anInt239;
  8185. if (class9_1.aString228.length() > 0)
  8186. s = class9_1.aString228;
  8187. } else {
  8188. i4 = class9_1.textColor;
  8189. if (flag1 && class9_1.anInt216 != 0)
  8190. i4 = class9_1.anInt216;
  8191. }
  8192. if (class9_1.atActionType == 6 && aBoolean1149) {
  8193. s = "Please wait...";
  8194. i4 = class9_1.textColor;
  8195. }
  8196. if (DrawingArea.width == 516) {
  8197. if (i4 == 0xffff00)
  8198. i4 = 255;
  8199. if (i4 == 49152)
  8200. i4 = 0xffffff;
  8201. }
  8202. if (frameMode != ScreenMode.FIXED) {
  8203. if ((backDialogID != -1 || dialogID != -1 || class9_1.message.contains("Click here to continue")) && (class9.id == backDialogID || class9.id == dialogID)) {
  8204. if (i4 == 0xffff00) {
  8205. i4 = 255;
  8206. }
  8207. if (i4 == 49152) {
  8208. i4 = 0xffffff;
  8209. }
  8210. }
  8211. }
  8212. if ((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  8213. switch (i4) {
  8214. case 16773120:
  8215. i4 = 0xFE981F;
  8216. break;
  8217. case 7040819:
  8218. i4 = 0xAF6A1A;
  8219. break;
  8220. }
  8221. }
  8222. for (int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497) {
  8223. if (s.indexOf("%") != -1) {
  8224. do {
  8225. int k7 = s.indexOf("%1");
  8226. if (k7 == -1)
  8227. break;
  8228. 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)
  8229. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8230. else
  8231. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8232. } while (true);
  8233. do {
  8234. int l7 = s.indexOf("%2");
  8235. if (l7 == -1)
  8236. break;
  8237. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  8238. } while (true);
  8239. do {
  8240. int i8 = s.indexOf("%3");
  8241. if (i8 == -1)
  8242. break;
  8243. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  8244. } while (true);
  8245. do {
  8246. int j8 = s.indexOf("%4");
  8247. if (j8 == -1)
  8248. break;
  8249. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  8250. } while (true);
  8251. do {
  8252. int k8 = s.indexOf("%5");
  8253. if (k8 == -1)
  8254. break;
  8255. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  8256. } while (true);
  8257. }
  8258. int l8 = s.indexOf("\\n");
  8259. String s1;
  8260. if (l8 != -1) {
  8261. s1 = s.substring(0, l8);
  8262. s = s.substring(l8 + 2);
  8263. } else {
  8264. s1 = s;
  8265. s = "";
  8266. }
  8267. if (class9_1.centerText)
  8268. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadow);
  8269. else
  8270. textDrawingArea.method389(class9_1.textShadow, k2, i4, s1, l6);
  8271. }
  8272. } else if (class9_1.type == 5) {
  8273. Sprite sprite;
  8274. if (interfaceIsSelected(class9_1))
  8275. sprite = class9_1.sprite2;
  8276. else
  8277. sprite = class9_1.sprite1;
  8278. if (spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
  8279. sprite.drawSprite(k2, l2, 0xffffff);
  8280. } else {
  8281. if (sprite != null)
  8282. if (class9_1.drawsTransparent) {
  8283. sprite.drawTransparentSprite(k2, l2, alpha);
  8284. } else {
  8285. sprite.drawSprite(k2, l2);
  8286. }
  8287. }
  8288. if(autocast && class9_1.id == autoCastId)
  8289. cacheSprite[43].drawSprite(k2-3, l2-3);
  8290. if (sprite != null)
  8291. if (class9_1.drawsTransparent) {
  8292. sprite.drawSprite1(k2, l2);
  8293. } else {
  8294. sprite.drawSprite(k2, l2);
  8295. }
  8296. } else if (class9_1.type == 6) {
  8297. int k3 = Texture.textureInt1;
  8298. int j4 = Texture.textureInt2;
  8299. Texture.textureInt1 = k2 + class9_1.width / 2;
  8300. Texture.textureInt2 = l2 + class9_1.height / 2;
  8301. int i5 = Texture.anIntArray1470[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8302. int l5 = Texture.anIntArray1471[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8303. boolean flag2 = interfaceIsSelected(class9_1);
  8304. int i7;
  8305. if (flag2)
  8306. i7 = class9_1.anInt258;
  8307. else
  8308. i7 = class9_1.anInt257;
  8309. Model model;
  8310. if (i7 == -1) {
  8311. model = class9_1.method209(-1, -1, flag2);
  8312. } else {
  8313. Animation animation = Animation.anims[i7];
  8314. model = class9_1.method209(animation.anIntArray354[class9_1.anInt246], animation.anIntArray353[class9_1.anInt246], flag2);
  8315. }
  8316. if (model != null)
  8317. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  8318. Texture.textureInt1 = k3;
  8319. Texture.textureInt2 = j4;
  8320. } else if (class9_1.type == 7) {
  8321. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  8322. int k4 = 0;
  8323. for (int j5 = 0; j5 < class9_1.height; j5++) {
  8324. for (int i6 = 0; i6 < class9_1.width; i6++) {
  8325. if (class9_1.inv[k4] > 0) {
  8326. ItemDef itemDef = ItemDef.forID(class9_1.inv[k4] - 1);
  8327. String s2 = itemDef.name;
  8328. if (itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  8329. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  8330. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  8331. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  8332. if (class9_1.centerText)
  8333. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadow);
  8334. else
  8335. textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  8336. }
  8337. k4++;
  8338. }
  8339. }
  8340. } else if (class9_1.type == 9) {
  8341. drawHoverBox(k2, l2, class9_1.popupString);
  8342. } else if (class9_1.type == 8 && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id) && anInt1501 == 0 && !menuOpen) {
  8343. int boxWidth = 0;
  8344. int boxHeight = 0;
  8345. TextDrawingArea textDrawingArea_2 = regularText;
  8346. for (String s1 = class9_1.message; s1.length() > 0;) {
  8347. if (s1.indexOf("%") != -1) {
  8348. do {
  8349. int k7 = s1.indexOf("%1");
  8350. if (k7 == -1)
  8351. break;
  8352. s1 = s1.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s1.substring(k7 + 2);
  8353. } while (true);
  8354. do {
  8355. int l7 = s1.indexOf("%2");
  8356. if (l7 == -1)
  8357. break;
  8358. s1 = s1.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s1.substring(l7 + 2);
  8359. } while (true);
  8360. do {
  8361. int i8 = s1.indexOf("%3");
  8362. if (i8 == -1)
  8363. break;
  8364. s1 = s1.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s1.substring(i8 + 2);
  8365. } while (true);
  8366. do {
  8367. int j8 = s1.indexOf("%4");
  8368. if (j8 == -1)
  8369. break;
  8370. s1 = s1.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s1.substring(j8 + 2);
  8371. } while (true);
  8372. do {
  8373. int k8 = s1.indexOf("%5");
  8374. if (k8 == -1)
  8375. break;
  8376. s1 = s1.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s1.substring(k8 + 2);
  8377. } while (true);
  8378. }
  8379. int l7 = s1.indexOf("\\n");
  8380. String s4;
  8381. if (l7 != -1) {
  8382. s4 = s1.substring(0, l7);
  8383. s1 = s1.substring(l7 + 2);
  8384. } else {
  8385. s4 = s1;
  8386. s1 = "";
  8387. }
  8388. int j10 = textDrawingArea_2.getTextWidth(s4);
  8389. if (j10 > boxWidth) {
  8390. boxWidth = j10;
  8391. }
  8392. boxHeight += textDrawingArea_2.anInt1497 + 1;
  8393. }
  8394. boxWidth += 6;
  8395. boxHeight += 7;
  8396. int xPos = (k2 + class9_1.width) - 5 - boxWidth;
  8397. int yPos = l2 + class9_1.height + 5;
  8398. if (xPos < k2 + 5) {
  8399. xPos = k2 + 5;
  8400. }
  8401. if (xPos + boxWidth > k + class9.width) {
  8402. xPos = (k + class9.width) - boxWidth;
  8403. }
  8404. if (yPos + boxHeight > l + class9.height) {
  8405. yPos = (l2 - boxHeight);
  8406. }
  8407. DrawingArea.drawPixels(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  8408. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  8409. String s2 = class9_1.message;
  8410. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2.length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {// anInt1497
  8411. if (s2.indexOf("%") != -1) {
  8412. do {
  8413. int k7 = s2.indexOf("%1");
  8414. if (k7 == -1)
  8415. break;
  8416. s2 = s2.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s2.substring(k7 + 2);
  8417. } while (true);
  8418. do {
  8419. int l7 = s2.indexOf("%2");
  8420. if (l7 == -1)
  8421. break;
  8422. s2 = s2.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s2.substring(l7 + 2);
  8423. } while (true);
  8424. do {
  8425. int i8 = s2.indexOf("%3");
  8426. if (i8 == -1)
  8427. break;
  8428. s2 = s2.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s2.substring(i8 + 2);
  8429. } while (true);
  8430. do {
  8431. int j8 = s2.indexOf("%4");
  8432. if (j8 == -1)
  8433. break;
  8434. s2 = s2.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s2.substring(j8 + 2);
  8435. } while (true);
  8436. do {
  8437. int k8 = s2.indexOf("%5");
  8438. if (k8 == -1)
  8439. break;
  8440. s2 = s2.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s2.substring(k8 + 2);
  8441. } while (true);
  8442. }
  8443. int l11 = s2.indexOf("\\n");
  8444. String s5;
  8445. if (l11 != -1) {
  8446. s5 = s2.substring(0, l11);
  8447. s2 = s2.substring(l11 + 2);
  8448. } else {
  8449. s5 = s2;
  8450. s2 = "";
  8451. }
  8452. if (class9_1.centerText) {
  8453. textDrawingArea_2.method382(yPos, xPos + class9_1.width / 2, s5, j11, false);
  8454. } else {
  8455. if (s5.contains("\\r")) {
  8456. String text = s5.substring(0, s5.indexOf("\\r"));
  8457. String text2 = s5.substring(s5.indexOf("\\r") + 2);
  8458. textDrawingArea_2.method389(false, xPos + 3, 0, text, j11);
  8459. int rightX = boxWidth + xPos - textDrawingArea_2.getTextWidth(text2) - 2;
  8460. textDrawingArea_2.method389(false, rightX, 0, text2, j11);
  8461. System.out.println("Box: " + boxWidth + "");
  8462. } else
  8463. textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  8464. }
  8465. }
  8466. }
  8467. }
  8468. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  8469. }
  8470.  
  8471. public void drawHoverBox(int xPos, int yPos, String text) {
  8472. String[] results = text.split("\n");
  8473. int height = (results.length * 16) + 6;
  8474. int width;
  8475. width = smallText.getTextWidth(results[0]) + 6;
  8476. for (int i = 1; i < results.length; i++)
  8477. if (width <= smallText.getTextWidth(results[i]) + 6)
  8478. width = smallText.getTextWidth(results[i]) + 6;
  8479. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  8480. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  8481. yPos += 14;
  8482. for (int i = 0; i < results.length; i++) {
  8483. smallText.method389(false, xPos + 3, 0, results[i], yPos);
  8484. yPos += 16;
  8485. }
  8486. }
  8487.  
  8488. private void randomizeBackground(Background background) {
  8489. int j = 256;
  8490. for (int k = 0; k < anIntArray1190.length; k++)
  8491. anIntArray1190[k] = 0;
  8492.  
  8493. for (int l = 0; l < 5000; l++) {
  8494. int i1 = (int) (Math.random() * 128D * (double) j);
  8495. anIntArray1190[i1] = (int) (Math.random() * 256D);
  8496. }
  8497. for (int j1 = 0; j1 < 20; j1++) {
  8498. for (int k1 = 1; k1 < j - 1; k1++) {
  8499. for (int i2 = 1; i2 < 127; i2++) {
  8500. int k2 = i2 + (k1 << 7);
  8501. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  8502. }
  8503.  
  8504. }
  8505. int ai[] = anIntArray1190;
  8506. anIntArray1190 = anIntArray1191;
  8507. anIntArray1191 = ai;
  8508. }
  8509. if (background != null) {
  8510. int l1 = 0;
  8511. for (int j2 = 0; j2 < background.anInt1453; j2++) {
  8512. for (int l2 = 0; l2 < background.anInt1452; l2++)
  8513. if (background.aByteArray1450[l1++] != 0) {
  8514. int i3 = l2 + 16 + background.anInt1454;
  8515. int j3 = j2 + 16 + background.anInt1455;
  8516. int k3 = i3 + (j3 << 7);
  8517. anIntArray1190[k3] = 0;
  8518. }
  8519. }
  8520. }
  8521. }
  8522.  
  8523. private void method107(int i, int j, Stream stream, Player player) {
  8524. if ((i & 0x400) != 0) {
  8525. player.anInt1543 = stream.method428();
  8526. player.anInt1545 = stream.method428();
  8527. player.anInt1544 = stream.method428();
  8528. player.anInt1546 = stream.method428();
  8529. player.anInt1547 = stream.method436() + loopCycle;
  8530. player.anInt1548 = stream.method435() + loopCycle;
  8531. player.anInt1549 = stream.method428();
  8532. player.method446();
  8533. }
  8534. if ((i & 0x100) != 0) {
  8535. player.anInt1520 = stream.method434();
  8536. int k = stream.readDWord();
  8537. player.anInt1524 = k >> 16;
  8538. player.anInt1523 = loopCycle + (k & 0xffff);
  8539. player.anInt1521 = 0;
  8540. player.anInt1522 = 0;
  8541. if (player.anInt1523 > loopCycle)
  8542. player.anInt1521 = -1;
  8543. if (player.anInt1520 == 65535)
  8544. player.anInt1520 = -1;
  8545. }
  8546. if ((i & 8) != 0) {
  8547. int l = stream.method434();
  8548. if (l == 65535)
  8549. l = -1;
  8550. int i2 = stream.method427();
  8551. if (l == player.anim && l != -1) {
  8552. int i3 = Animation.anims[l].anInt365;
  8553. if (i3 == 1) {
  8554. player.anInt1527 = 0;
  8555. player.anInt1528 = 0;
  8556. player.anInt1529 = i2;
  8557. player.anInt1530 = 0;
  8558. }
  8559. if (i3 == 2)
  8560. player.anInt1530 = 0;
  8561. } else if (l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359) {
  8562. player.anim = l;
  8563. player.anInt1527 = 0;
  8564. player.anInt1528 = 0;
  8565. player.anInt1529 = i2;
  8566. player.anInt1530 = 0;
  8567. player.anInt1542 = player.smallXYIndex;
  8568. }
  8569. }
  8570. if ((i & 4) != 0) {
  8571. player.textSpoken = stream.readString();
  8572. if (player.textSpoken.charAt(0) == '~') {
  8573. player.textSpoken = player.textSpoken.substring(1);
  8574. pushMessage(player.textSpoken, 2, player.name);
  8575. } else if (player == myPlayer)
  8576. pushMessage(player.textSpoken, 2, player.name);
  8577. player.anInt1513 = 0;
  8578. player.anInt1531 = 0;
  8579. player.textCycle = 150;
  8580. }
  8581. if ((i & 0x80) != 0) {
  8582. // right fucking here
  8583. int i1 = stream.method434();
  8584. int j2 = stream.readUnsignedByte();
  8585. int j3 = stream.method427();
  8586. int k3 = stream.currentOffset;
  8587. if (player.name != null && player.visible) {
  8588. long l3 = TextClass.longForName(player.name);
  8589. boolean flag = false;
  8590. if (j2 <= 1) {
  8591. for (int i4 = 0; i4 < ignoreCount; i4++) {
  8592. if (ignoreListAsLongs[i4] != l3)
  8593. continue;
  8594. flag = true;
  8595. break;
  8596. }
  8597.  
  8598. }
  8599. if (!flag && anInt1251 == 0)
  8600. try {
  8601. aStream_834.currentOffset = 0;
  8602. stream.method442(j3, 0, aStream_834.buffer);
  8603. aStream_834.currentOffset = 0;
  8604. String s = TextInput.method525(j3, aStream_834);
  8605. // s = Censor.doCensor(s);
  8606. player.textSpoken = s;
  8607. player.anInt1513 = i1 >> 8;
  8608. player.privelage = j2;
  8609. player.anInt1531 = i1 & 0xff;
  8610. player.textCycle = 150;
  8611. if (j2 == 2 || j2 == 3)
  8612. pushMessage(s, 1, "@cr2@" + player.name);
  8613. else if (j2 == 1)
  8614. pushMessage(s, 1, "@cr1@" + player.name);
  8615. else
  8616. pushMessage(s, 2, player.name);
  8617. } catch (Exception exception) {
  8618. Signlink.reporterror("cde2");
  8619. }
  8620. }
  8621. stream.currentOffset = k3 + j3;
  8622. }
  8623. if ((i & 1) != 0) {
  8624. player.interactingEntity = stream.method434();
  8625. if (player.interactingEntity == 65535)
  8626. player.interactingEntity = -1;
  8627. }
  8628. if ((i & 0x10) != 0) {
  8629. int j1 = stream.method427();
  8630. byte abyte0[] = new byte[j1];
  8631. Stream stream_1 = new Stream(abyte0);
  8632. stream.readBytes(j1, 0, abyte0);
  8633. aStreamArray895s[j] = stream_1;
  8634. player.updatePlayer(stream_1);
  8635. }
  8636. if ((i & 2) != 0) {
  8637. player.anInt1538 = stream.method436();
  8638. player.anInt1539 = stream.method434();
  8639. }
  8640. if ((i & 0x20) != 0) {
  8641. int k1 = stream.readUnsignedByte();
  8642. int k2 = stream.method426();
  8643. player.updateHitData(k2, k1, loopCycle);
  8644. player.loopCycleStatus = loopCycle + 300;
  8645. player.currentHealth = stream.method427();
  8646. player.maxHealth = stream.readUnsignedByte();
  8647. }
  8648. if ((i & 0x200) != 0) {
  8649. int l1 = stream.readUnsignedByte();
  8650. int l2 = stream.method428();
  8651. player.updateHitData(l2, l1, loopCycle);
  8652. player.loopCycleStatus = loopCycle + 300;
  8653. player.currentHealth = stream.readUnsignedByte();
  8654. player.maxHealth = stream.method427();
  8655. }
  8656. }
  8657.  
  8658. private void method108() {
  8659. try {
  8660. int j = myPlayer.x + anInt1278;
  8661. int k = myPlayer.y + anInt1131;
  8662. if (anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500) {
  8663. anInt1014 = j;
  8664. anInt1015 = k;
  8665. }
  8666. if (anInt1014 != j)
  8667. anInt1014 += (j - anInt1014) / 16;
  8668. if (anInt1015 != k)
  8669. anInt1015 += (k - anInt1015) / 16;
  8670. if (super.keyArray[1] == 1)
  8671. anInt1186 += (-24 - anInt1186) / 2;
  8672. else if (super.keyArray[2] == 1)
  8673. anInt1186 += (24 - anInt1186) / 2;
  8674. else
  8675. anInt1186 /= 2;
  8676. if (super.keyArray[3] == 1)
  8677. anInt1187 += (12 - anInt1187) / 2;
  8678. else if (super.keyArray[4] == 1)
  8679. anInt1187 += (-12 - anInt1187) / 2;
  8680. else
  8681. anInt1187 /= 2;
  8682. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  8683. anInt1184 += anInt1187 / 2;
  8684. if (anInt1184 < 128)
  8685. anInt1184 = 128;
  8686. if (anInt1184 > 383)
  8687. anInt1184 = 383;
  8688. int l = anInt1014 >> 7;
  8689. int i1 = anInt1015 >> 7;
  8690. int j1 = method42(plane, anInt1015, anInt1014);
  8691. int k1 = 0;
  8692. if (l > 3 && i1 > 3 && l < 100 && i1 < 100) {
  8693. for (int l1 = l - 4; l1 <= l + 4; l1++) {
  8694. for (int k2 = i1 - 4; k2 <= i1 + 4; k2++) {
  8695. int l2 = plane;
  8696. if (l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  8697. l2++;
  8698. int i3 = j1 - intGroundArray[l2][l1][k2];
  8699. if (i3 > k1)
  8700. k1 = i3;
  8701. }
  8702.  
  8703. }
  8704.  
  8705. }
  8706. anInt1005++;
  8707. if (anInt1005 > 1512) {
  8708. anInt1005 = 0;
  8709. stream.createFrame(77);
  8710. stream.writeWordBigEndian(0);
  8711. int i2 = stream.currentOffset;
  8712. stream.writeWordBigEndian((int) (Math.random() * 256D));
  8713. stream.writeWordBigEndian(101);
  8714. stream.writeWordBigEndian(233);
  8715. stream.writeWord(45092);
  8716. if ((int) (Math.random() * 2D) == 0)
  8717. stream.writeWord(35784);
  8718. stream.writeWordBigEndian((int) (Math.random() * 256D));
  8719. stream.writeWordBigEndian(64);
  8720. stream.writeWordBigEndian(38);
  8721. stream.writeWord((int) (Math.random() * 65536D));
  8722. stream.writeWord((int) (Math.random() * 65536D));
  8723. stream.writeBytes(stream.currentOffset - i2);
  8724. }
  8725. int j2 = k1 * 192;
  8726. if (j2 > 0x17f00)
  8727. j2 = 0x17f00;
  8728. if (j2 < 32768)
  8729. j2 = 32768;
  8730. if (j2 > anInt984) {
  8731. anInt984 += (j2 - anInt984) / 24;
  8732. return;
  8733. }
  8734. if (j2 < anInt984) {
  8735. anInt984 += (j2 - anInt984) / 80;
  8736. }
  8737. } catch (Exception _ex) {
  8738. Signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  8739. throw new RuntimeException("eek");
  8740. }
  8741. }
  8742.  
  8743. public void processDrawing() {
  8744. if (rsAlreadyLoaded || loadingError || genericLoadingError) {
  8745. showErrorScreen();
  8746. return;
  8747. }
  8748. if (!loggedIn)
  8749. drawLoginScreen(false);
  8750. else
  8751. drawGameScreen();
  8752. anInt1213 = 0;
  8753. }
  8754.  
  8755. private boolean isFriendOrSelf(String s) {
  8756. if (s == null)
  8757. return false;
  8758. for (int i = 0; i < friendsCount; i++)
  8759. if (s.equalsIgnoreCase(friendsList[i]))
  8760. return true;
  8761. return s.equalsIgnoreCase(myPlayer.name);
  8762. }
  8763.  
  8764. private static String combatDiffColor(int playerLevel, int entityLevel) {
  8765. int level = playerLevel - entityLevel;
  8766. if (level < -9)
  8767. return "@red@";
  8768. if (level < -6)
  8769. return "@or3@";
  8770. if (level < -3)
  8771. return "@or2@";
  8772. if (level < 0)
  8773. return "@or1@";
  8774. if (level > 9)
  8775. return "@gre@";
  8776. if (level > 6)
  8777. return "@gr3@";
  8778. if (level > 3)
  8779. return "@gr2@";
  8780. if (level > 0)
  8781. return "@gr1@";
  8782. else
  8783. return "@yel@";
  8784. }
  8785.  
  8786. private void setWaveVolume(int i) {
  8787. Signlink.wavevol = i;
  8788. }
  8789.  
  8790.  
  8791.  
  8792. private void draw3dScreen() {
  8793. if (drawExperienceCounter) {
  8794. loadXPCounter();
  8795. if (drawTotalExperience) {
  8796. loadTotalXP();
  8797. }
  8798. }
  8799. if (showChatComponents) {
  8800. drawSplitPrivateChat();
  8801. }
  8802. if (crossType == 1) {
  8803. int offSet = frameMode == ScreenMode.FIXED ? 4 : 0;
  8804. crosses[crossIndex / 100].drawSprite(crossX - 8 - offSet, crossY - 8 - offSet);
  8805. anInt1142++;
  8806. if (anInt1142 > 67) {
  8807. anInt1142 = 0;
  8808. stream.createFrame(78);
  8809. }
  8810. }
  8811. if (crossType == 2) {
  8812. int offSet = frameMode == ScreenMode.FIXED ? 4 : 0;
  8813. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - offSet, crossY - 8 - offSet);
  8814. }
  8815. if (anInt1018 != -1) {
  8816. method119(anInt945, anInt1018);
  8817. if (anInt1018 == 197 && frameMode != ScreenMode.FIXED) {
  8818. skullIcons[0].drawSprite(frameWidth - 82, 168);
  8819. String text = RSInterface.interfaceCache[199].message;
  8820. regularText.drawChatInput(0xE1981D, frameWidth - 90, text, 207, true);
  8821. } else if (anInt1018 == 201 && frameMode != ScreenMode.FIXED) {
  8822. drawInterface(0, frameWidth - 560, RSInterface.interfaceCache[anInt1018], -109);
  8823. } else {
  8824. drawInterface(0, frameMode == ScreenMode.FIXED ? 0 : (frameWidth / 2) - 356, RSInterface.interfaceCache[anInt1018], frameMode == ScreenMode.FIXED ? 0 : (frameHeight / 2) - 230);
  8825. }
  8826. }
  8827. if (openInterfaceID != -1) {
  8828. method119(anInt945, openInterfaceID);
  8829. drawInterface(0, frameMode == ScreenMode.FIXED ? 0 : (frameWidth / 2) - 356, RSInterface.interfaceCache[openInterfaceID], frameMode == ScreenMode.FIXED ? 0 : (frameHeight / 2) - 230);
  8830. }
  8831. if (!menuOpen) {
  8832. processRightClick();
  8833. drawTooltip();
  8834. } else if (menuScreenArea == 0) {
  8835. drawMenu(frameMode == ScreenMode.FIXED ? 4 : 0, frameMode == ScreenMode.FIXED ? 4 : 0);
  8836. }
  8837. if (anInt1055 == 1) {
  8838. multiOverlay.drawSprite(frameMode == ScreenMode.FIXED ? 472 : frameWidth - 35, frameMode == ScreenMode.FIXED ? 296 : 155);
  8839. }
  8840. if(fpsOn) {
  8841. int color = 0xffff00;
  8842. if(super.fps < 15) {
  8843. color = 0xff0000;
  8844. }
  8845. regularText.method385(color, "Fps: " + super.fps, 15, 2);
  8846. Runtime time = Runtime.getRuntime();
  8847. int memory = (int)((time.totalMemory() - time.freeMemory()) / 1024L);
  8848. color = 0xffff00;
  8849. if(memory > 0x2000000 && lowMem) {
  8850. color = 0xff0000;
  8851. }
  8852. regularText.method385(color, "Memory Usage: " +memory+ "k", 30, 2);
  8853. }
  8854. int x = baseX + (myPlayer.x - 6 >> 7);
  8855. int y = baseY + (myPlayer.y - 6 >> 7);
  8856. final String screenMode = frameMode == ScreenMode.FIXED ? "Fixed" : "Resizable";
  8857. if (clientData){
  8858. int color = 0xffff00;
  8859. int fpsColor = 0xffff00;
  8860. if(super.fps < 15) {
  8861. fpsColor = 0xff0000;
  8862. }
  8863. regularText.method385(color, "frameWidth: " + (mouseX - frameWidth) + ", frameHeight: " + (mouseY - frameHeight), frameHeight - 271, 5);
  8864. regularText.method385(color, "Client Zoom: " + cameraZoom, frameHeight - 257, 5);
  8865. regularText.method385(fpsColor, "Fps: " + super.fps, frameHeight - 243, 5);
  8866. Runtime time = Runtime.getRuntime();
  8867. int memory = (int) ((time.totalMemory() - time.freeMemory()) / 1024L);
  8868. regularText.method385(color, "Memory Usage: " + memory + "k", frameHeight - 229, 5);
  8869. regularText.method385(color, "Mouse X: " + mouseX + ", Mouse Y: " + mouseY, frameHeight - 215, 5);
  8870. regularText.method385(color, "Coords: " + x + ", " + y, frameHeight - 201, 5);
  8871. regularText.method385(color, "Client Mode: " + screenMode + "", frameHeight - 187, 5);
  8872. regularText.method385(color, "Client Resolution: " + frameWidth + "x" + frameHeight, frameHeight - 173, 5);
  8873. }
  8874. if (anInt1104 != 0) {
  8875. int j = anInt1104 / 50;
  8876. int l = j / 60;
  8877. int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 498;
  8878. j %= 60;
  8879. if (j < 10) {
  8880. regularText.method385(0xffff00, "System update in: " + l + ":0" + j, 329 + yOffset, 4);
  8881. } else {
  8882. regularText.method385(0xffff00, "System update in: " + l + ":" + j, 329 + yOffset, 4);
  8883. }
  8884. anInt849++;
  8885. if (anInt849 > 75) {
  8886. anInt849 = 0;
  8887. stream.createFrame(148);
  8888. }
  8889. }
  8890. }
  8891.  
  8892.  
  8893.  
  8894. private void addIgnore(long l) {
  8895. try {
  8896. if (l == 0L)
  8897. return;
  8898. if (ignoreCount >= 100) {
  8899. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  8900. return;
  8901. }
  8902. String s = TextClass.fixName(TextClass.nameForLong(l));
  8903. for (int j = 0; j < ignoreCount; j++)
  8904. if (ignoreListAsLongs[j] == l) {
  8905. pushMessage(s + " is already on your ignore list", 0, "");
  8906. return;
  8907. }
  8908. for (int k = 0; k < friendsCount; k++)
  8909. if (friendsListAsLongs[k] == l) {
  8910. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  8911. return;
  8912. }
  8913.  
  8914. ignoreListAsLongs[ignoreCount++] = l;
  8915. stream.createFrame(133);
  8916. stream.writeQWord(l);
  8917. return;
  8918. } catch (RuntimeException runtimeexception) {
  8919. Signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  8920. }
  8921. throw new RuntimeException();
  8922. }
  8923.  
  8924. private void method114() {
  8925. for (int i = -1; i < playerCount; i++) {
  8926. int j;
  8927. if (i == -1)
  8928. j = myPlayerIndex;
  8929. else
  8930. j = playerIndices[i];
  8931. Player player = playerArray[j];
  8932. if (player != null)
  8933. method96(player);
  8934. }
  8935.  
  8936. }
  8937.  
  8938. private void method115() {
  8939. if (loadingStage == 2) {
  8940. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetNext()) {
  8941. if (class30_sub1.anInt1294 > 0)
  8942. class30_sub1.anInt1294--;
  8943. if (class30_sub1.anInt1294 == 0) {
  8944. if (class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301)) {
  8945. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  8946. class30_sub1.unlink();
  8947. }
  8948. } else {
  8949. if (class30_sub1.anInt1302 > 0)
  8950. class30_sub1.anInt1302--;
  8951. 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))) {
  8952. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  8953. class30_sub1.anInt1302 = -1;
  8954. if (class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  8955. class30_sub1.unlink();
  8956. else if (class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  8957. class30_sub1.unlink();
  8958. }
  8959. }
  8960. }
  8961.  
  8962. }
  8963. }
  8964.  
  8965. private void determineMenuSize() {
  8966. int boxLength = boldText.getTextWidth("Choose option");
  8967. for (int row = 0; row < menuActionRow; row++) {
  8968. int actionLength = boldText.getTextWidth(menuActionName[row]);
  8969. if (actionLength > boxLength)
  8970. boxLength = actionLength;
  8971. }
  8972. boxLength += 8;
  8973. int offset = 15 * menuActionRow + 21;
  8974. if(super.saveClickX > 0 && super.saveClickY > 0 && super.saveClickX < frameWidth && super.saveClickY < frameHeight) {
  8975. int xClick = super.saveClickX - boxLength / 2;
  8976. if (xClick + boxLength > frameWidth - 4) {
  8977. xClick = frameWidth - 4 - boxLength;
  8978. }
  8979. if (xClick < 0) {
  8980. xClick = 0;
  8981. }
  8982. int yClick = super.saveClickY - 0;
  8983. if (yClick + offset > frameHeight - 6) {
  8984. yClick = frameHeight - 6 - offset;
  8985. }
  8986. if (yClick < 0) {
  8987. yClick = 0;
  8988. }
  8989. menuOpen = true;
  8990. menuOffsetX = xClick;
  8991. menuOffsetY = yClick;
  8992. menuWidth = boxLength;
  8993. menuHeight = 15 * menuActionRow + 22;
  8994. }
  8995. }
  8996.  
  8997. private void method117(Stream stream) {
  8998. stream.initBitAccess();
  8999. int j = stream.readBits(1);
  9000. if (j == 0)
  9001. return;
  9002. int k = stream.readBits(2);
  9003. if (k == 0) {
  9004. anIntArray894[anInt893++] = myPlayerIndex;
  9005. return;
  9006. }
  9007. if (k == 1) {
  9008. int l = stream.readBits(3);
  9009. myPlayer.moveInDir(false, l);
  9010. int k1 = stream.readBits(1);
  9011. if (k1 == 1)
  9012. anIntArray894[anInt893++] = myPlayerIndex;
  9013. return;
  9014. }
  9015. if (k == 2) {
  9016. int i1 = stream.readBits(3);
  9017. myPlayer.moveInDir(true, i1);
  9018. int l1 = stream.readBits(3);
  9019. myPlayer.moveInDir(true, l1);
  9020. int j2 = stream.readBits(1);
  9021. if (j2 == 1)
  9022. anIntArray894[anInt893++] = myPlayerIndex;
  9023. return;
  9024. }
  9025. if (k == 3) {
  9026. plane = stream.readBits(2);
  9027. int j1 = stream.readBits(1);
  9028. int i2 = stream.readBits(1);
  9029. if (i2 == 1)
  9030. anIntArray894[anInt893++] = myPlayerIndex;
  9031. int k2 = stream.readBits(7);
  9032. int l2 = stream.readBits(7);
  9033. myPlayer.setPos(l2, k2, j1 == 1);
  9034. }
  9035. }
  9036.  
  9037. private void nullLoader() {
  9038. aBoolean831 = false;
  9039. while (drawingFlames) {
  9040. aBoolean831 = false;
  9041. try {
  9042. Thread.sleep(50L);
  9043. } catch (Exception _ex) {
  9044. }
  9045. }
  9046. aBackground_966 = null;
  9047. aBackground_967 = null;
  9048. aBackgroundArray1152s = null;
  9049. anIntArray850 = null;
  9050. anIntArray851 = null;
  9051. anIntArray852 = null;
  9052. anIntArray853 = null;
  9053. anIntArray1190 = null;
  9054. anIntArray1191 = null;
  9055. anIntArray828 = null;
  9056. anIntArray829 = null;
  9057. aClass30_Sub2_Sub1_Sub1_1201 = null;
  9058. aClass30_Sub2_Sub1_Sub1_1202 = null;
  9059. }
  9060.  
  9061. private boolean method119(int i, int j) {
  9062. boolean flag1 = false;
  9063. RSInterface class9 = RSInterface.interfaceCache[j];
  9064. for (int k = 0; k < class9.children.length; k++) {
  9065. if (class9.children[k] == -1)
  9066. break;
  9067. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  9068. if (class9_1.type == 1)
  9069. flag1 |= method119(i, class9_1.id);
  9070. if (class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1)) {
  9071. boolean flag2 = interfaceIsSelected(class9_1);
  9072. int l;
  9073. if (flag2)
  9074. l = class9_1.anInt258;
  9075. else
  9076. l = class9_1.anInt257;
  9077. if (l != -1) {
  9078. Animation animation = Animation.anims[l];
  9079. for (class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);) {
  9080. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  9081. class9_1.anInt246++;
  9082. if (class9_1.anInt246 >= animation.anInt352) {
  9083. class9_1.anInt246 -= animation.anInt356;
  9084. if (class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  9085. class9_1.anInt246 = 0;
  9086. }
  9087. flag1 = true;
  9088. }
  9089.  
  9090. }
  9091. }
  9092. }
  9093.  
  9094. return flag1;
  9095. }
  9096.  
  9097. private int method120() {
  9098. int j = 3;
  9099. if (yCameraCurve < 310) {
  9100. int k = xCameraPos >> 7;
  9101. int l = yCameraPos >> 7;
  9102. int i1 = myPlayer.x >> 7;
  9103. int j1 = myPlayer.y >> 7;
  9104. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9105. j = plane;
  9106. int k1;
  9107. if (i1 > k)
  9108. k1 = i1 - k;
  9109. else
  9110. k1 = k - i1;
  9111. int l1;
  9112. if (j1 > l)
  9113. l1 = j1 - l;
  9114. else
  9115. l1 = l - j1;
  9116. if (k1 > l1) {
  9117. int i2 = (l1 * 0x10000) / k1;
  9118. int k2 = 32768;
  9119. while (k != i1) {
  9120. if (k < i1)
  9121. k++;
  9122. else if (k > i1)
  9123. k--;
  9124. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9125. j = plane;
  9126. k2 += i2;
  9127. if (k2 >= 0x10000) {
  9128. k2 -= 0x10000;
  9129. if (l < j1)
  9130. l++;
  9131. else if (l > j1)
  9132. l--;
  9133. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9134. j = plane;
  9135. }
  9136. }
  9137. } else {
  9138. int j2 = (k1 * 0x10000) / l1;
  9139. int l2 = 32768;
  9140. while (l != j1) {
  9141. if (l < j1)
  9142. l++;
  9143. else if (l > j1)
  9144. l--;
  9145. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9146. j = plane;
  9147. l2 += j2;
  9148. if (l2 >= 0x10000) {
  9149. l2 -= 0x10000;
  9150. if (k < i1)
  9151. k++;
  9152. else if (k > i1)
  9153. k--;
  9154. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9155. j = plane;
  9156. }
  9157. }
  9158. }
  9159. }
  9160. if ((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  9161. j = plane;
  9162. return j;
  9163. }
  9164.  
  9165. private int method121() {
  9166. int j = method42(plane, yCameraPos, xCameraPos);
  9167. if (j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  9168. return plane;
  9169. else
  9170. return 3;
  9171. }
  9172.  
  9173. private void delIgnore(long l) {
  9174. try {
  9175. if (l == 0L)
  9176. return;
  9177. for (int j = 0; j < ignoreCount; j++)
  9178. if (ignoreListAsLongs[j] == l) {
  9179. ignoreCount--;
  9180. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  9181.  
  9182. stream.createFrame(74);
  9183. stream.writeQWord(l);
  9184. return;
  9185. }
  9186.  
  9187. return;
  9188. } catch (RuntimeException runtimeexception) {
  9189. Signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9190. }
  9191. throw new RuntimeException();
  9192. }
  9193.  
  9194. private void chatJoin(long l) {
  9195. try {
  9196. if (l == 0L)
  9197. return;
  9198. stream.createFrame(60);
  9199. stream.writeQWord(l);
  9200. return;
  9201. } catch (RuntimeException runtimeexception) {
  9202. Signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9203. }
  9204. throw new RuntimeException();
  9205.  
  9206. }
  9207.  
  9208. public String getParameter(String s) {
  9209. if (Signlink.mainapp != null)
  9210. return Signlink.mainapp.getParameter(s);
  9211. else
  9212. return super.getParameter(s);
  9213. }
  9214.  
  9215. private void adjustVolume(boolean flag, int i) {
  9216. Signlink.midivol = i;
  9217. if (flag)
  9218. Signlink.midi = "voladjust";
  9219. }
  9220.  
  9221. private int extractInterfaceValues(RSInterface class9, int j) {
  9222. if (class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  9223. return -2;
  9224. try {
  9225. int ai[] = class9.valueIndexArray[j];
  9226. int k = 0;
  9227. int l = 0;
  9228. int i1 = 0;
  9229. do {
  9230. int j1 = ai[l++];
  9231. int k1 = 0;
  9232. byte byte0 = 0;
  9233. if (j1 == 0)
  9234. return k;
  9235. if (j1 == 1)
  9236. k1 = currentStats[ai[l++]];
  9237. if (j1 == 2)
  9238. k1 = maxStats[ai[l++]];
  9239. if (j1 == 3)
  9240. k1 = currentExp[ai[l++]];
  9241. if (j1 == 4) {
  9242. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  9243. int k2 = ai[l++];
  9244. if (k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers)) {
  9245. for (int j3 = 0; j3 < class9_1.inv.length; j3++)
  9246. if (class9_1.inv[j3] == k2 + 1)
  9247. k1 += class9_1.invStackSizes[j3];
  9248.  
  9249. }
  9250. }
  9251. if (j1 == 5)
  9252. k1 = variousSettings[ai[l++]];
  9253. if (j1 == 6)
  9254. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  9255. if (j1 == 7)
  9256. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  9257. if (j1 == 8)
  9258. k1 = myPlayer.combatLevel;
  9259. if (j1 == 9) {
  9260. for (int l1 = 0; l1 < Skills.skillsCount; l1++)
  9261. if (Skills.skillEnabled[l1])
  9262. k1 += maxStats[l1];
  9263.  
  9264. }
  9265. if (j1 == 10) {
  9266. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  9267. int l2 = ai[l++] + 1;
  9268. if (l2 >= 0 && l2 < ItemDef.totalItems && isMembers) {
  9269. for (int k3 = 0; k3 < class9_2.inv.length; k3++) {
  9270. if (class9_2.inv[k3] != l2)
  9271. continue;
  9272. k1 = 0x3b9ac9ff;
  9273. break;
  9274. }
  9275.  
  9276. }
  9277. }
  9278. if (j1 == 11)
  9279. k1 = energy;
  9280. if (j1 == 12)
  9281. k1 = weight;
  9282. if (j1 == 13) {
  9283. int i2 = variousSettings[ai[l++]];
  9284. int i3 = ai[l++];
  9285. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  9286. }
  9287. if (j1 == 14) {
  9288. int j2 = ai[l++];
  9289. VarBit varBit = VarBit.cache[j2];
  9290. int l3 = varBit.anInt648;
  9291. int i4 = varBit.anInt649;
  9292. int j4 = varBit.anInt650;
  9293. int k4 = anIntArray1232[j4 - i4];
  9294. k1 = variousSettings[l3] >> i4 & k4;
  9295. }
  9296. if (j1 == 15)
  9297. byte0 = 1;
  9298. if (j1 == 16)
  9299. byte0 = 2;
  9300. if (j1 == 17)
  9301. byte0 = 3;
  9302. if (j1 == 18)
  9303. k1 = (myPlayer.x >> 7) + baseX;
  9304. if (j1 == 19)
  9305. k1 = (myPlayer.y >> 7) + baseY;
  9306. if (j1 == 20)
  9307. k1 = ai[l++];
  9308. if (byte0 == 0) {
  9309. if (i1 == 0)
  9310. k += k1;
  9311. if (i1 == 1)
  9312. k -= k1;
  9313. if (i1 == 2 && k1 != 0)
  9314. k /= k1;
  9315. if (i1 == 3)
  9316. k *= k1;
  9317. i1 = 0;
  9318. } else {
  9319. i1 = byte0;
  9320. }
  9321. } while (true);
  9322. } catch (Exception _ex) {
  9323. return -1;
  9324. }
  9325. }
  9326.  
  9327. private void drawTooltip() {
  9328. if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  9329. return;
  9330. String s;
  9331. if (itemSelected == 1 && menuActionRow < 2)
  9332. s = "Use " + selectedItemName + " with...";
  9333. else if (spellSelected == 1 && menuActionRow < 2)
  9334. s = spellTooltip + "...";
  9335. else
  9336. s = menuActionName[menuActionRow - 1];
  9337. if (menuActionRow > 2)
  9338. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  9339. boldText.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  9340. }
  9341.  
  9342. private void markMinimap(Sprite sprite, int x, int y) {
  9343. if (sprite == null)
  9344. return;
  9345. try {
  9346. int k = minimapInt1 + minimapInt2 & 0x7ff;
  9347. int l = x * x + y * y;
  9348. if (l > 6400) {
  9349. return;
  9350. }
  9351. int i1 = Model.modelIntArray1[k];
  9352. int j1 = Model.modelIntArray2[k];
  9353. i1 = (i1 * 256) / (minimapInt3 + 256);
  9354. j1 = (j1 * 256) / (minimapInt3 + 256);
  9355. int k1 = y * i1 + x * j1 >> 16;
  9356. int l1 = y * j1 - x * i1 >> 16;
  9357. if (frameMode == ScreenMode.FIXED) {
  9358. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 + 30, 83 - l1 - sprite.anInt1445 / 2 - 4 + 5);
  9359. } else {
  9360. sprite.drawSprite(((77 + k1) - sprite.anInt1444 / 2) + 4 + (frameWidth - 167), 85 - l1 - sprite.anInt1445 / 2 - 4);
  9361. }
  9362. } catch (Exception e) {
  9363.  
  9364. }
  9365. }
  9366.  
  9367. private void drawMinimap() {
  9368. for(int i = 0; i < 78; i++) {
  9369. int circle = (int) (Math.sqrt(Math.pow(79, 2) - Math.pow(77 - i, 2)));
  9370. anIntArray1229[i] = 2 * circle + 4;
  9371. anIntArray1229[151 - i] = 2 * circle + 4;
  9372. anIntArray1052[i] = -circle + 73;
  9373. anIntArray1052[151 - i] = -circle + 73;
  9374. }
  9375. if (frameMode == ScreenMode.FIXED) {
  9376. aRSImageProducer_1164.initDrawingArea();
  9377. }
  9378. if (anInt1021 == 2) {
  9379. if (frameMode == ScreenMode.FIXED) {
  9380. cacheSprite[16].drawSprite(0, 0);
  9381. } else {
  9382. cacheSprite[30].drawSprite(frameWidth - 181, 0);
  9383. cacheSprite[31].drawSprite(frameWidth - 158, 7);
  9384. }
  9385. if (frameMode != ScreenMode.FIXED && changeTabArea) {
  9386. if (super.mouseX >= frameWidth - 26 && super.mouseX <= frameWidth - 1 && super.mouseY >= 2 && super.mouseY <= 24 || tabID == 15) {
  9387. cacheSprite[22].drawSprite(frameWidth - 25, 2);
  9388. } else {
  9389. cacheSprite[22].drawARGBSprite(frameWidth - 25, 2, 165);
  9390. }
  9391. }
  9392. cacheSprite[xpCounterHover ? 20 : 19].drawSprite((frameMode == ScreenMode.FIXED ? 0 : frameWidth - 214), (frameMode == ScreenMode.FIXED ? 20 : 10));
  9393. loadAllOrbs(frameMode == ScreenMode.FIXED ? 0 : frameWidth - 212);
  9394. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, (frameMode == ScreenMode.FIXED ? 25 : 24), 4, (frameMode == ScreenMode.FIXED ? 29 : frameWidth - 176), 33, 25);
  9395. if (menuOpen) {
  9396. drawMenu(frameMode == ScreenMode.FIXED ? 516 : 0, 0);
  9397. }
  9398. if (frameMode == ScreenMode.FIXED) {
  9399. aRSImageProducer_1164.initDrawingArea();
  9400. }
  9401. return;
  9402. }
  9403. int i = minimapInt1 + minimapInt2 & 0x7ff;
  9404. int j = 48 + myPlayer.x / 32;
  9405. int l2 = 464 - myPlayer.y / 32;
  9406. minimapImage.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, (frameMode == ScreenMode.FIXED ? 9 : 7), (frameMode == ScreenMode.FIXED ? 54 : frameWidth - 157), 146, j);
  9407. for (int j5 = 0; j5 < anInt1071; j5++) {
  9408. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  9409. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  9410. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  9411. }
  9412. for (int k5 = 0; k5 < 104; k5++) {
  9413. for (int l5 = 0; l5 < 104; l5++) {
  9414. NodeList class19 = groundArray[plane][k5][l5];
  9415. if (class19 != null) {
  9416. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  9417. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  9418. markMinimap(mapDotItem, l, j3);
  9419. }
  9420. }
  9421. }
  9422. for (int i6 = 0; i6 < npcCount; i6++) {
  9423. Npc npc = npcArray[npcIndices[i6]];
  9424. if (npc != null && npc.isVisible()) {
  9425. EntityDef entityDef = npc.desc;
  9426. if (entityDef.childrenIDs != null) {
  9427. entityDef = entityDef.method161();
  9428. }
  9429. if (entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  9430. int i1 = npc.x / 32 - myPlayer.x / 32;
  9431. int k3 = npc.y / 32 - myPlayer.y / 32;
  9432. markMinimap(mapDotNPC, i1, k3);
  9433. }
  9434. }
  9435. }
  9436. for (int j6 = 0; j6 < playerCount; j6++) {
  9437. Player player = playerArray[playerIndices[j6]];
  9438. if (player != null && player.isVisible()) {
  9439. int j1 = player.x / 32 - myPlayer.x / 32;
  9440. int l3 = player.y / 32 - myPlayer.y / 32;
  9441. boolean flag1 = false;
  9442. boolean flag3 = false;
  9443. for (int j3 = 0; j3 < clanList.length; j3++) {
  9444. if (clanList[j3] == null) {
  9445. continue;
  9446. }
  9447. if (!clanList[j3].equalsIgnoreCase(player.name)) {
  9448. continue;
  9449. }
  9450. flag3 = true;
  9451. break;
  9452. }
  9453. long l6 = TextClass.longForName(player.name);
  9454. for (int k6 = 0; k6 < friendsCount; k6++) {
  9455. if (l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0) {
  9456. continue;
  9457. }
  9458. flag1 = true;
  9459. break;
  9460. }
  9461. boolean flag2 = false;
  9462. if (myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team) {
  9463. flag2 = true;
  9464. }
  9465. if (flag1) {
  9466. markMinimap(mapDotFriend, j1, l3);
  9467. } else if (flag3) {
  9468. markMinimap(mapDotClan, j1, l3);
  9469. } else if (flag2) {
  9470. markMinimap(mapDotTeam, j1, l3);
  9471. } else {
  9472. markMinimap(mapDotPlayer, j1, l3);
  9473. }
  9474. }
  9475. }
  9476. if (anInt855 != 0 && loopCycle % 20 < 10) {
  9477. if (anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  9478. Npc class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  9479. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  9480. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  9481. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  9482. method81(mapMarker, i4, k1);
  9483. }
  9484. }
  9485. if (anInt855 == 2) {
  9486. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  9487. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  9488. method81(mapMarker, j4, l1);
  9489. }
  9490. if (anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length) {
  9491. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  9492. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  9493. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  9494. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  9495. method81(mapMarker, k4, i2);
  9496. }
  9497. }
  9498. }
  9499. if (destX != 0) {
  9500. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  9501. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  9502. markMinimap(mapFlag, j2, l4);
  9503. }
  9504. DrawingArea.drawPixels(3, (frameMode == ScreenMode.FIXED ? 83 : 79), (frameMode == ScreenMode.FIXED ? 127 : frameWidth - 87), 0xffffff, 3);
  9505. if (frameMode == ScreenMode.FIXED) {
  9506. cacheSprite[16].drawSprite(0, 0);
  9507. } else {
  9508. cacheSprite[30].drawSprite(frameWidth - 181, 0);
  9509. }
  9510. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, (frameMode == ScreenMode.FIXED ? 25 : 24), 4, (frameMode == ScreenMode.FIXED ? 29 : frameWidth - 176), 33, 25);
  9511. if (frameMode != ScreenMode.FIXED && changeTabArea) {
  9512. if (super.mouseX >= frameWidth - 26 && super.mouseX <= frameWidth - 1 && super.mouseY >= 2 && super.mouseY <= 24 || tabID == 15) {
  9513. cacheSprite[22].drawSprite(frameWidth - 25, 2);
  9514. } else {
  9515. cacheSprite[22].drawARGBSprite(frameWidth - 25, 2, 165);
  9516. }
  9517. }
  9518. cacheSprite[xpCounterHover ? 20 : 19].drawSprite((frameMode == ScreenMode.FIXED ? 0 : frameWidth - 214), (frameMode == ScreenMode.FIXED ? 20 : 10));
  9519. loadAllOrbs(frameMode == ScreenMode.FIXED ? 0 : frameWidth - 212);
  9520. if (menuOpen) {
  9521. drawMenu(frameMode == ScreenMode.FIXED ? 516 : 0, 0);
  9522. }
  9523. if (frameMode == ScreenMode.FIXED) {
  9524. aRSImageProducer_1165.initDrawingArea();
  9525. }
  9526. }
  9527.  
  9528. private void npcScreenPos(Entity entity, int i) {
  9529. calcEntityScreenPos(entity.x, i, entity.y);
  9530. }
  9531.  
  9532. private void calcEntityScreenPos(int i, int j, int l) {
  9533. if (i < 128 || l < 128 || i > 13056 || l > 13056) {
  9534. spriteDrawX = -1;
  9535. spriteDrawY = -1;
  9536. return;
  9537. }
  9538. int i1 = method42(plane, l, i) - j;
  9539. i -= xCameraPos;
  9540. i1 -= zCameraPos;
  9541. l -= yCameraPos;
  9542. int j1 = Model.modelIntArray1[yCameraCurve];
  9543. int k1 = Model.modelIntArray2[yCameraCurve];
  9544. int l1 = Model.modelIntArray1[xCameraCurve];
  9545. int i2 = Model.modelIntArray2[xCameraCurve];
  9546. int j2 = l * l1 + i * i2 >> 16;
  9547. l = l * i2 - i * l1 >> 16;
  9548. i = j2;
  9549. j2 = i1 * k1 - l * j1 >> 16;
  9550. l = i1 * j1 + l * k1 >> 16;
  9551. i1 = j2;
  9552. if (l >= 50) {
  9553. spriteDrawX = Texture.textureInt1 + (i << WorldController.viewDistance) / l;
  9554. spriteDrawY = Texture.textureInt2 + (i1 << WorldController.viewDistance) / l;
  9555. } else {
  9556. spriteDrawX = -1;
  9557. spriteDrawY = -1;
  9558. }
  9559. }
  9560.  
  9561. private void buildSplitPrivateChatMenu() {
  9562. if (splitPrivateChat == 0)
  9563. return;
  9564. int i = 0;
  9565. if (anInt1104 != 0)
  9566. i = 1;
  9567. for (int j = 0; j < 100; j++)
  9568. if (chatMessages[j] != null) {
  9569. int k = chatTypes[j];
  9570. String s = chatNames[j];
  9571. if (s != null && s.startsWith("@cr1@")) {
  9572. s = s.substring(5);
  9573. }
  9574. if (s != null && s.startsWith("@cr2@")) {
  9575. s = s.substring(5);
  9576. }
  9577. if ((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  9578. int l = 329 - i * 13;
  9579. if (frameMode != ScreenMode.FIXED) {
  9580. l = frameHeight - 170 - i * 13;
  9581. }
  9582. int offSet = frameMode == ScreenMode.FIXED ? 4 : 0;
  9583. if (super.mouseX > 4 && super.mouseY - offSet > l - 10 && super.mouseY - offSet <= l + 3) {
  9584. int i1 = regularText.getTextWidth("From: " + s + chatMessages[j]) + 25;
  9585. if (i1 > 450)
  9586. i1 = 450;
  9587. if (super.mouseX < 4 + i1) {
  9588. if (myPrivilege >= 1) {
  9589. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  9590. menuActionID[menuActionRow] = 2606;
  9591. menuActionRow++;
  9592. }
  9593. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  9594. menuActionID[menuActionRow] = 2042;
  9595. menuActionRow++;
  9596. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  9597. menuActionID[menuActionRow] = 2337;
  9598. menuActionRow++;
  9599. }
  9600. }
  9601. if (++i >= 5)
  9602. return;
  9603. }
  9604. if ((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  9605. return;
  9606. }
  9607.  
  9608. }
  9609.  
  9610. private void method130(int j, int k, int l, int i1, int j1, int k1, int l1, int i2, int j2) {
  9611. Class30_Sub1 class30_sub1 = null;
  9612. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179.reverseGetNext()) {
  9613. if (class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  9614. continue;
  9615. class30_sub1 = class30_sub1_1;
  9616. break;
  9617. }
  9618.  
  9619. if (class30_sub1 == null) {
  9620. class30_sub1 = new Class30_Sub1();
  9621. class30_sub1.anInt1295 = l1;
  9622. class30_sub1.anInt1296 = i1;
  9623. class30_sub1.anInt1297 = i2;
  9624. class30_sub1.anInt1298 = j1;
  9625. method89(class30_sub1);
  9626. aClass19_1179.insertHead(class30_sub1);
  9627. }
  9628. class30_sub1.anInt1291 = k;
  9629. class30_sub1.anInt1293 = k1;
  9630. class30_sub1.anInt1292 = l;
  9631. class30_sub1.anInt1302 = j2;
  9632. class30_sub1.anInt1294 = j;
  9633. }
  9634.  
  9635. private boolean interfaceIsSelected(RSInterface class9) {
  9636. if (class9.anIntArray245 == null)
  9637. return false;
  9638. for (int i = 0; i < class9.anIntArray245.length; i++) {
  9639. int j = extractInterfaceValues(class9, i);
  9640. int k = class9.anIntArray212[i];
  9641. if (class9.anIntArray245[i] == 2) {
  9642. if (j >= k)
  9643. return false;
  9644. } else if (class9.anIntArray245[i] == 3) {
  9645. if (j <= k)
  9646. return false;
  9647. } else if (class9.anIntArray245[i] == 4) {
  9648. if (j == k)
  9649. return false;
  9650. } else if (j != k)
  9651. return false;
  9652. }
  9653.  
  9654. return true;
  9655. }
  9656.  
  9657. private DataInputStream openJagGrabInputStream(String s) throws IOException {
  9658. // if(!aBoolean872)
  9659. // if(signlink.mainapp != null)
  9660. // return signlink.openurl(s);
  9661. // else
  9662. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  9663. if (aSocket832 != null) {
  9664. try {
  9665. aSocket832.close();
  9666. } catch (Exception _ex) {
  9667. }
  9668. aSocket832 = null;
  9669. }
  9670. aSocket832 = openSocket(43595);
  9671. aSocket832.setSoTimeout(10000);
  9672. java.io.InputStream inputstream = aSocket832.getInputStream();
  9673. OutputStream outputstream = aSocket832.getOutputStream();
  9674. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  9675. return new DataInputStream(inputstream);
  9676. }
  9677.  
  9678. private void doFlamesDrawing() {
  9679. char c = '\u0100';
  9680. if (anInt1040 > 0) {
  9681. for (int i = 0; i < 256; i++)
  9682. if (anInt1040 > 768)
  9683. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  9684. else if (anInt1040 > 256)
  9685. anIntArray850[i] = anIntArray852[i];
  9686. else
  9687. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  9688.  
  9689. } else if (anInt1041 > 0) {
  9690. for (int j = 0; j < 256; j++)
  9691. if (anInt1041 > 768)
  9692. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  9693. else if (anInt1041 > 256)
  9694. anIntArray850[j] = anIntArray853[j];
  9695. else
  9696. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  9697.  
  9698. } else {
  9699. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  9700.  
  9701. }
  9702. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, aRSImageProducer_1110.canvasRaster, 0, 33920);
  9703.  
  9704. int i1 = 0;
  9705. int j1 = 1152;
  9706. for (int k1 = 1; k1 < c - 1; k1++) {
  9707. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  9708. int j2 = 22 + l1;
  9709. if (j2 < 0)
  9710. j2 = 0;
  9711. i1 += j2;
  9712. for (int l2 = j2; l2 < 128; l2++) {
  9713. int j3 = anIntArray828[i1++];
  9714. if (j3 != 0) {
  9715. int l3 = j3;
  9716. int j4 = 256 - j3;
  9717. j3 = anIntArray850[j3];
  9718. int l4 = aRSImageProducer_1110.canvasRaster[j1];
  9719. aRSImageProducer_1110.canvasRaster[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  9720. } else {
  9721. j1++;
  9722. }
  9723. }
  9724.  
  9725. j1 += j2;
  9726. }
  9727.  
  9728. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  9729. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, aRSImageProducer_1111.canvasRaster, 0, 33920);
  9730.  
  9731. i1 = 0;
  9732. j1 = 1176;
  9733. for (int k2 = 1; k2 < c - 1; k2++) {
  9734. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  9735. int k3 = 103 - i3;
  9736. j1 += i3;
  9737. for (int i4 = 0; i4 < k3; i4++) {
  9738. int k4 = anIntArray828[i1++];
  9739. if (k4 != 0) {
  9740. int i5 = k4;
  9741. int j5 = 256 - k4;
  9742. k4 = anIntArray850[k4];
  9743. int k5 = aRSImageProducer_1111.canvasRaster[j1];
  9744. aRSImageProducer_1111.canvasRaster[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  9745. } else {
  9746. j1++;
  9747. }
  9748. }
  9749.  
  9750. i1 += 128 - k3;
  9751. j1 += 128 - k3 - i3;
  9752. }
  9753.  
  9754. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  9755. }
  9756.  
  9757. private void method134(Stream stream) {
  9758. int j = stream.readBits(8);
  9759. if (j < playerCount) {
  9760. for (int k = j; k < playerCount; k++)
  9761. anIntArray840[anInt839++] = playerIndices[k];
  9762.  
  9763. }
  9764. if (j > playerCount) {
  9765. Signlink.reporterror(myUsername + " Too many players");
  9766. throw new RuntimeException("eek");
  9767. }
  9768. playerCount = 0;
  9769. for (int l = 0; l < j; l++) {
  9770. int i1 = playerIndices[l];
  9771. Player player = playerArray[i1];
  9772. int j1 = stream.readBits(1);
  9773. if (j1 == 0) {
  9774. playerIndices[playerCount++] = i1;
  9775. player.anInt1537 = loopCycle;
  9776. } else {
  9777. int k1 = stream.readBits(2);
  9778. if (k1 == 0) {
  9779. playerIndices[playerCount++] = i1;
  9780. player.anInt1537 = loopCycle;
  9781. anIntArray894[anInt893++] = i1;
  9782. } else if (k1 == 1) {
  9783. playerIndices[playerCount++] = i1;
  9784. player.anInt1537 = loopCycle;
  9785. int l1 = stream.readBits(3);
  9786. player.moveInDir(false, l1);
  9787. int j2 = stream.readBits(1);
  9788. if (j2 == 1)
  9789. anIntArray894[anInt893++] = i1;
  9790. } else if (k1 == 2) {
  9791. playerIndices[playerCount++] = i1;
  9792. player.anInt1537 = loopCycle;
  9793. int i2 = stream.readBits(3);
  9794. player.moveInDir(true, i2);
  9795. int k2 = stream.readBits(3);
  9796. player.moveInDir(true, k2);
  9797. int l2 = stream.readBits(1);
  9798. if (l2 == 1)
  9799. anIntArray894[anInt893++] = i1;
  9800. } else if (k1 == 3)
  9801. anIntArray840[anInt839++] = i1;
  9802. }
  9803. }
  9804. }
  9805.  
  9806. private void drawLoginScreen(boolean flag) {
  9807. resetImageProducers();
  9808. aRSImageProducer_1109.initDrawingArea();
  9809. aBackground_966.drawBackground(0, 0);
  9810. char c = '\u0168';
  9811. char c1 = '\310';
  9812. if (loginScreenState == 0) {
  9813. int i = c1 / 2 + 80;
  9814. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  9815. i = c1 / 2 - 20;
  9816. boldText.method382(0xffff00, c / 2, "Welcome to " + ClientConstants.CLIENT_NAME, i, true);
  9817. i += 30;
  9818. int l = c / 2 - 80;
  9819. int k1 = c1 / 2 + 20;
  9820. aBackground_967.drawBackground(l - 73, k1 - 20);
  9821. boldText.method382(0xffffff, l, "New User", k1 + 5, true);
  9822. l = c / 2 + 80;
  9823. aBackground_967.drawBackground(l - 73, k1 - 20);
  9824. boldText.method382(0xffffff, l, "Existing User", k1 + 5, true);
  9825. }
  9826. if (loginScreenState == 2) {
  9827. int j = c1 / 2 - 40;
  9828. if (loginMessage1.length() > 0) {
  9829. boldText.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  9830. boldText.method382(0xffff00, c / 2, loginMessage2, j, true);
  9831. j += 30;
  9832. } else {
  9833. boldText.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  9834. j += 30;
  9835. }
  9836. boldText.method389(true, c / 2 - 90, 0xffffff, "Username: " + myUsername + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  9837. j += 15;
  9838. boldText.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  9839. j += 15;
  9840. if (!flag) {
  9841. int i1 = c / 2 - 80;
  9842. int l1 = c1 / 2 + 50;
  9843. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  9844. boldText.method382(0xffffff, i1, "Login", l1 + 5, true);
  9845. i1 = c / 2 + 80;
  9846. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  9847. boldText.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  9848. }
  9849. }
  9850. if (loginScreenState == 3) {
  9851. boldText.method382(0xffff00, c / 2, "Create a free account", c1 / 2 - 60, true);
  9852. int k = c1 / 2 - 35;
  9853. boldText.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
  9854. k += 15;
  9855. boldText.method382(0xffffff, c / 2, "go back to the main " + ClientConstants.CLIENT_NAME + " webpage", k, true);
  9856. k += 15;
  9857. boldText.method382(0xffffff, c / 2, "and choose the red 'create account'", k, true);
  9858. k += 15;
  9859. boldText.method382(0xffffff, c / 2, "button at the top right of that page.", k, true);
  9860. k += 15;
  9861. int j1 = c / 2;
  9862. int i2 = c1 / 2 + 50;
  9863. aBackground_967.drawBackground(j1 - 73, i2 - 20);
  9864. boldText.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  9865. }
  9866. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  9867. if (welcomeScreenRaised) {
  9868. welcomeScreenRaised = false;
  9869. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  9870. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  9871. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  9872. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  9873. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  9874. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  9875. }
  9876. worldSelection();
  9877. }
  9878.  
  9879. private void drawFlames() {
  9880. drawingFlames = true;
  9881. try {
  9882. long l = System.currentTimeMillis();
  9883. int i = 0;
  9884. int j = 20;
  9885. while (aBoolean831) {
  9886. calcFlamesPosition();
  9887. calcFlamesPosition();
  9888. doFlamesDrawing();
  9889. if (++i > 10) {
  9890. long l1 = System.currentTimeMillis();
  9891. int k = (int) (l1 - l) / 10 - j;
  9892. j = 40 - k;
  9893. if (j < 5)
  9894. j = 5;
  9895. i = 0;
  9896. l = l1;
  9897. }
  9898. try {
  9899. Thread.sleep(j);
  9900. } catch (Exception _ex) {
  9901. }
  9902. }
  9903. } catch (Exception _ex) {
  9904. }
  9905. drawingFlames = false;
  9906. }
  9907.  
  9908. public void raiseWelcomeScreen() {
  9909. welcomeScreenRaised = true;
  9910. }
  9911.  
  9912. private void method137(Stream stream, int j) {
  9913. if (j == 84) {
  9914. int k = stream.readUnsignedByte();
  9915. int j3 = anInt1268 + (k >> 4 & 7);
  9916. int i6 = anInt1269 + (k & 7);
  9917. int l8 = stream.readUnsignedWord();
  9918. int k11 = stream.readUnsignedWord();
  9919. int l13 = stream.readUnsignedWord();
  9920. if (j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104) {
  9921. NodeList class19_1 = groundArray[plane][j3][i6];
  9922. if (class19_1 != null) {
  9923. 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()) {
  9924. if (class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  9925. continue;
  9926. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  9927. break;
  9928. }
  9929.  
  9930. spawnGroundItem(j3, i6);
  9931. }
  9932. }
  9933. return;
  9934. }
  9935. if (j == 105) {
  9936. int l = stream.readUnsignedByte();
  9937. int k3 = anInt1268 + (l >> 4 & 7);
  9938. int j6 = anInt1269 + (l & 7);
  9939. int i9 = stream.readUnsignedWord();
  9940. int l11 = stream.readUnsignedByte();
  9941. int i14 = l11 >> 4 & 0xf;
  9942. int i16 = l11 & 7;
  9943. 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) {
  9944. anIntArray1207[anInt1062] = i9;
  9945. anIntArray1241[anInt1062] = i16;
  9946. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  9947. anInt1062++;
  9948. }
  9949. }
  9950. if (j == 215) {
  9951. int i1 = stream.method435();
  9952. int l3 = stream.method428();
  9953. int k6 = anInt1268 + (l3 >> 4 & 7);
  9954. int j9 = anInt1269 + (l3 & 7);
  9955. int i12 = stream.method435();
  9956. int j14 = stream.readUnsignedWord();
  9957. if (k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10) {
  9958. Item class30_sub2_sub4_sub2_2 = new Item();
  9959. class30_sub2_sub4_sub2_2.ID = i1;
  9960. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  9961. if (groundArray[plane][k6][j9] == null)
  9962. groundArray[plane][k6][j9] = new NodeList();
  9963. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  9964. spawnGroundItem(k6, j9);
  9965. }
  9966. return;
  9967. }
  9968. if (j == 156) {
  9969. int j1 = stream.method426();
  9970. int i4 = anInt1268 + (j1 >> 4 & 7);
  9971. int l6 = anInt1269 + (j1 & 7);
  9972. int k9 = stream.readUnsignedWord();
  9973. if (i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104) {
  9974. NodeList class19 = groundArray[plane][i4][l6];
  9975. if (class19 != null) {
  9976. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19.reverseGetNext()) {
  9977. if (item.ID != (k9 & 0x7fff))
  9978. continue;
  9979. item.unlink();
  9980. break;
  9981. }
  9982.  
  9983. if (class19.reverseGetFirst() == null)
  9984. groundArray[plane][i4][l6] = null;
  9985. spawnGroundItem(i4, l6);
  9986. }
  9987. }
  9988. return;
  9989. }
  9990. if (j == 160) {
  9991. int k1 = stream.method428();
  9992. int j4 = anInt1268 + (k1 >> 4 & 7);
  9993. int i7 = anInt1269 + (k1 & 7);
  9994. int l9 = stream.method428();
  9995. int j12 = l9 >> 2;
  9996. int k14 = l9 & 3;
  9997. int j16 = anIntArray1177[j12];
  9998. int j17 = stream.method435();
  9999. if (j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103) {
  10000. int j18 = intGroundArray[plane][j4][i7];
  10001. int i19 = intGroundArray[plane][j4 + 1][i7];
  10002. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  10003. int k20 = intGroundArray[plane][j4][i7 + 1];
  10004. if (j16 == 0) {
  10005. Object1 class10 = worldController.method296(plane, j4, i7);
  10006. if (class10 != null) {
  10007. int k21 = class10.uid >> 14 & 0x7fff;
  10008. if (j12 == 2) {
  10009. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  10010. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  10011. } else {
  10012. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  10013. }
  10014. }
  10015. }
  10016. if (j16 == 1) {
  10017. Object2 class26 = worldController.method297(j4, i7, plane);
  10018. if (class26 != null)
  10019. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  10020. }
  10021. if (j16 == 2) {
  10022. Object5 class28 = worldController.method298(j4, i7, plane);
  10023. if (j12 == 11)
  10024. j12 = 10;
  10025. if (class28 != null)
  10026. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  10027. }
  10028. if (j16 == 3) {
  10029. Object3 class49 = worldController.method299(i7, j4, plane);
  10030. if (class49 != null)
  10031. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  10032. }
  10033. }
  10034. return;
  10035. }
  10036. if (j == 147) {
  10037. int l1 = stream.method428();
  10038. int k4 = anInt1268 + (l1 >> 4 & 7);
  10039. int j7 = anInt1269 + (l1 & 7);
  10040. int i10 = stream.readUnsignedWord();
  10041. byte byte0 = stream.method430();
  10042. int l14 = stream.method434();
  10043. byte byte1 = stream.method429();
  10044. int k17 = stream.readUnsignedWord();
  10045. int k18 = stream.method428();
  10046. int j19 = k18 >> 2;
  10047. int i20 = k18 & 3;
  10048. int l20 = anIntArray1177[j19];
  10049. byte byte2 = stream.readSignedByte();
  10050. int l21 = stream.readUnsignedWord();
  10051. byte byte3 = stream.method429();
  10052. Player player;
  10053. if (i10 == unknownInt10)
  10054. player = myPlayer;
  10055. else
  10056. player = playerArray[i10];
  10057. if (player != null) {
  10058. ObjectDef class46 = ObjectDef.forID(l21);
  10059. int i22 = intGroundArray[plane][k4][j7];
  10060. int j22 = intGroundArray[plane][k4 + 1][j7];
  10061. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  10062. int l22 = intGroundArray[plane][k4][j7 + 1];
  10063. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1, -1, -1, -1);
  10064. if (model != null) {
  10065. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  10066. player.anInt1707 = l14 + loopCycle;
  10067. player.anInt1708 = k17 + loopCycle;
  10068. player.aModel_1714 = model;
  10069. int i23 = class46.anInt744;
  10070. int j23 = class46.anInt761;
  10071. if (i20 == 1 || i20 == 3) {
  10072. i23 = class46.anInt761;
  10073. j23 = class46.anInt744;
  10074. }
  10075. player.anInt1711 = k4 * 128 + i23 * 64;
  10076. player.anInt1713 = j7 * 128 + j23 * 64;
  10077. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  10078. if (byte2 > byte0) {
  10079. byte byte4 = byte2;
  10080. byte2 = byte0;
  10081. byte0 = byte4;
  10082. }
  10083. if (byte3 > byte1) {
  10084. byte byte5 = byte3;
  10085. byte3 = byte1;
  10086. byte1 = byte5;
  10087. }
  10088. player.anInt1719 = k4 + byte2;
  10089. player.anInt1721 = k4 + byte0;
  10090. player.anInt1720 = j7 + byte3;
  10091. player.anInt1722 = j7 + byte1;
  10092. }
  10093. }
  10094. }
  10095. if (j == 151) {
  10096. int i2 = stream.method426();
  10097. int l4 = anInt1268 + (i2 >> 4 & 7);
  10098. int k7 = anInt1269 + (i2 & 7);
  10099. int j10 = stream.method434();
  10100. int k12 = stream.method428();
  10101. int i15 = k12 >> 2;
  10102. int k16 = k12 & 3;
  10103. int l17 = anIntArray1177[i15];
  10104. if (l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  10105. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  10106. return;
  10107. }
  10108. if (j == 4) {
  10109. int j2 = stream.readUnsignedByte();
  10110. int i5 = anInt1268 + (j2 >> 4 & 7);
  10111. int l7 = anInt1269 + (j2 & 7);
  10112. int k10 = stream.readUnsignedWord();
  10113. int l12 = stream.readUnsignedByte();
  10114. int j15 = stream.readUnsignedWord();
  10115. if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) {
  10116. i5 = i5 * 128 + 64;
  10117. l7 = l7 * 128 + 64;
  10118. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  10119. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  10120. }
  10121. return;
  10122. }
  10123. if (j == 44) {
  10124. int k2 = stream.method436();
  10125. int j5 = stream.readUnsignedWord();
  10126. int i8 = stream.readUnsignedByte();
  10127. int l10 = anInt1268 + (i8 >> 4 & 7);
  10128. int i13 = anInt1269 + (i8 & 7);
  10129. if (l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104) {
  10130. Item class30_sub2_sub4_sub2_1 = new Item();
  10131. class30_sub2_sub4_sub2_1.ID = k2;
  10132. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  10133. if (groundArray[plane][l10][i13] == null)
  10134. groundArray[plane][l10][i13] = new NodeList();
  10135. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  10136. spawnGroundItem(l10, i13);
  10137. }
  10138. return;
  10139. }
  10140. if (j == 101) {
  10141. int l2 = stream.method427();
  10142. int k5 = l2 >> 2;
  10143. int j8 = l2 & 3;
  10144. int i11 = anIntArray1177[k5];
  10145. int j13 = stream.readUnsignedByte();
  10146. int k15 = anInt1268 + (j13 >> 4 & 7);
  10147. int l16 = anInt1269 + (j13 & 7);
  10148. if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  10149. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  10150. return;
  10151. }
  10152. if (j == 117) {
  10153. int i3 = stream.readUnsignedByte();
  10154. int l5 = anInt1268 + (i3 >> 4 & 7);
  10155. int k8 = anInt1269 + (i3 & 7);
  10156. int j11 = l5 + stream.readSignedByte();
  10157. int k13 = k8 + stream.readSignedByte();
  10158. int l15 = stream.readSignedWord();
  10159. int i17 = stream.readUnsignedWord();
  10160. int i18 = stream.readUnsignedByte() * 4;
  10161. int l18 = stream.readUnsignedByte() * 4;
  10162. int k19 = stream.readUnsignedWord();
  10163. int j20 = stream.readUnsignedWord();
  10164. int i21 = stream.readUnsignedByte();
  10165. int j21 = stream.readUnsignedByte();
  10166. if (l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535) {
  10167. l5 = l5 * 128 + 64;
  10168. k8 = k8 * 128 + 64;
  10169. j11 = j11 * 128 + 64;
  10170. k13 = k13 * 128 + 64;
  10171. 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);
  10172. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  10173. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  10174. }
  10175. }
  10176. }
  10177.  
  10178. private void method139(Stream stream) {
  10179. stream.initBitAccess();
  10180. int k = stream.readBits(8);
  10181. if (k < npcCount) {
  10182. for (int l = k; l < npcCount; l++)
  10183. anIntArray840[anInt839++] = npcIndices[l];
  10184.  
  10185. }
  10186. if (k > npcCount) {
  10187. Signlink.reporterror(myUsername + " Too many npcs");
  10188. throw new RuntimeException("eek");
  10189. }
  10190. npcCount = 0;
  10191. for (int i1 = 0; i1 < k; i1++) {
  10192. int j1 = npcIndices[i1];
  10193. Npc npc = npcArray[j1];
  10194. int k1 = stream.readBits(1);
  10195. if (k1 == 0) {
  10196. npcIndices[npcCount++] = j1;
  10197. npc.anInt1537 = loopCycle;
  10198. } else {
  10199. int l1 = stream.readBits(2);
  10200. if (l1 == 0) {
  10201. npcIndices[npcCount++] = j1;
  10202. npc.anInt1537 = loopCycle;
  10203. anIntArray894[anInt893++] = j1;
  10204. } else if (l1 == 1) {
  10205. npcIndices[npcCount++] = j1;
  10206. npc.anInt1537 = loopCycle;
  10207. int i2 = stream.readBits(3);
  10208. npc.moveInDir(false, i2);
  10209. int k2 = stream.readBits(1);
  10210. if (k2 == 1)
  10211. anIntArray894[anInt893++] = j1;
  10212. } else if (l1 == 2) {
  10213. npcIndices[npcCount++] = j1;
  10214. npc.anInt1537 = loopCycle;
  10215. int j2 = stream.readBits(3);
  10216. npc.moveInDir(true, j2);
  10217. int l2 = stream.readBits(3);
  10218. npc.moveInDir(true, l2);
  10219. int i3 = stream.readBits(1);
  10220. if (i3 == 1)
  10221. anIntArray894[anInt893++] = j1;
  10222. } else if (l1 == 3)
  10223. anIntArray840[anInt839++] = j1;
  10224. }
  10225. }
  10226.  
  10227. }
  10228.  
  10229. private void processLoginScreenInput() {
  10230. if (loginScreenState == 0) {
  10231. if (super.clickMode3 == 1 && super.saveClickX >= 7
  10232. && super.saveClickX <= 104 && super.saveClickY >= 464
  10233. && super.saveClickY <= 493) {
  10234. ClientConstants.worldSwitch = !ClientConstants.worldSwitch;
  10235. }
  10236. int i = super.myWidth / 2 - 80;
  10237. int l = super.myHeight / 2 + 20;
  10238. l += 20;
  10239. if (super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20) {
  10240. loginScreenState = 3;
  10241. loginScreenCursorPos = 0;
  10242. }
  10243. i = super.myWidth / 2 + 80;
  10244. if (super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20) {
  10245. loginMessage1 = "";
  10246. loginMessage2 = "Enter your username & password.";
  10247. loginScreenState = 2;
  10248. loginScreenCursorPos = 0;
  10249. }
  10250. } else {
  10251. if (loginScreenState == 2) {
  10252. if (super.clickMode3 == 1 && super.saveClickX >= 7
  10253. && super.saveClickX <= 104 && super.saveClickY >= 464
  10254. && super.saveClickY <= 493) {
  10255. ClientConstants.worldSwitch = !ClientConstants.worldSwitch;
  10256. }
  10257. int j = super.myHeight / 2 - 40;
  10258. j += 30;
  10259. j += 25;
  10260. if (super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10261. loginScreenCursorPos = 0;
  10262. j += 15;
  10263. if (super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10264. loginScreenCursorPos = 1;
  10265. j += 15;
  10266. int i1 = super.myWidth / 2 - 80;
  10267. int k1 = super.myHeight / 2 + 50;
  10268. k1 += 20;
  10269. if (super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20) {
  10270. loginFailures = 0;
  10271. login(myUsername, myPassword, false);
  10272. if (loggedIn)
  10273. return;
  10274. }
  10275. i1 = super.myWidth / 2 + 80;
  10276. if (super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20) {
  10277. loginScreenState = 0;
  10278. }
  10279. do {
  10280. int l1 = readChar(-796);
  10281. if (l1 == -1)
  10282. break;
  10283. boolean flag1 = false;
  10284. for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  10285. if (l1 != validUserPassChars.charAt(i2))
  10286. continue;
  10287. flag1 = true;
  10288. break;
  10289. }
  10290.  
  10291. if (loginScreenCursorPos == 0) {
  10292. if (l1 == 8 && myUsername.length() > 0)
  10293. myUsername = myUsername.substring(0, myUsername.length() - 1);
  10294. if (l1 == 9 || l1 == 10 || l1 == 13)
  10295. loginScreenCursorPos = 1;
  10296. if (flag1)
  10297. myUsername += (char) l1;
  10298. if (myUsername.length() > 12)
  10299. myUsername = myUsername.substring(0, 12);
  10300. } else if (loginScreenCursorPos == 1) {
  10301. if (l1 == 8 && myPassword.length() > 0)
  10302. myPassword = myPassword.substring(0, myPassword.length() - 1);
  10303. if (l1 == 9 || l1 == 10 || l1 == 13)
  10304. loginScreenCursorPos = 0;
  10305. if (flag1)
  10306. myPassword += (char) l1;
  10307. if (myPassword.length() > 20)
  10308. myPassword = myPassword.substring(0, 20);
  10309. }
  10310. } while (true);
  10311. return;
  10312. }
  10313. if (loginScreenState == 3) {
  10314. int k = super.myWidth / 2;
  10315. int j1 = super.myHeight / 2 + 50;
  10316. j1 += 20;
  10317. if (super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75 && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  10318. loginScreenState = 0;
  10319. }
  10320. }
  10321. }
  10322.  
  10323. private void method142(int i, int j, int k, int l, int i1, int j1, int k1) {
  10324. if (i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102) {
  10325. if (lowMem && j != plane)
  10326. return;
  10327. int i2 = 0;
  10328. if (j1 == 0)
  10329. i2 = worldController.method300(j, i1, i);
  10330. if (j1 == 1)
  10331. i2 = worldController.method301(j, i1, i);
  10332. if (j1 == 2)
  10333. i2 = worldController.method302(j, i1, i);
  10334. if (j1 == 3)
  10335. i2 = worldController.method303(j, i1, i);
  10336. if (i2 != 0) {
  10337. int i3 = worldController.method304(j, i1, i, i2);
  10338. int j2 = i2 >> 14 & 0x7fff;
  10339. int k2 = i3 & 0x1f;
  10340. int l2 = i3 >> 6;
  10341. if (j1 == 0) {
  10342. worldController.method291(i1, j, i, (byte) -119);
  10343. ObjectDef class46 = ObjectDef.forID(j2);
  10344. if (class46.aBoolean767)
  10345. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  10346. }
  10347. if (j1 == 1)
  10348. worldController.method292(i, j, i1);
  10349. if (j1 == 2) {
  10350. worldController.method293(j, i1, i);
  10351. ObjectDef class46_1 = ObjectDef.forID(j2);
  10352. if (i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  10353. return;
  10354. if (class46_1.aBoolean767)
  10355. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  10356. }
  10357. if (j1 == 3) {
  10358. worldController.method294(j, i, i1);
  10359. ObjectDef class46_2 = ObjectDef.forID(j2);
  10360. if (class46_2.aBoolean767 && class46_2.hasActions)
  10361. aClass11Array1230[j].method218(i, i1);
  10362. }
  10363. }
  10364. if (k1 >= 0) {
  10365. int j3 = j;
  10366. if (j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  10367. j3++;
  10368. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  10369. }
  10370. }
  10371. }
  10372.  
  10373. private void updatePlayers(int i, Stream stream) {
  10374. anInt839 = 0;
  10375. anInt893 = 0;
  10376. method117(stream);
  10377. method134(stream);
  10378. method91(stream, i);
  10379. method49(stream);
  10380. for (int k = 0; k < anInt839; k++) {
  10381. int l = anIntArray840[k];
  10382. if (playerArray[l].anInt1537 != loopCycle)
  10383. playerArray[l] = null;
  10384. }
  10385.  
  10386. if (stream.currentOffset != i) {
  10387. Signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  10388. throw new RuntimeException("eek");
  10389. }
  10390. for (int i1 = 0; i1 < playerCount; i1++)
  10391. if (playerArray[playerIndices[i1]] == null) {
  10392. Signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  10393. throw new RuntimeException("eek");
  10394. }
  10395.  
  10396. }
  10397.  
  10398. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1) {
  10399. int l1 = 2048 - k & 0x7ff;
  10400. int i2 = 2048 - j1 & 0x7ff;
  10401. int j2 = 0;
  10402. int k2 = 0;
  10403. int l2 = j;
  10404. if (l1 != 0) {
  10405. int i3 = Model.modelIntArray1[l1];
  10406. int k3 = Model.modelIntArray2[l1];
  10407. int i4 = k2 * k3 - l2 * i3 >> 16;
  10408. l2 = k2 * i3 + l2 * k3 >> 16;
  10409. k2 = i4;
  10410. }
  10411. if (i2 != 0) {
  10412. int j3 = Model.modelIntArray1[i2];
  10413. int l3 = Model.modelIntArray2[i2];
  10414. int j4 = l2 * j3 + j2 * l3 >> 16;
  10415. l2 = l2 * l3 - j2 * j3 >> 16;
  10416. j2 = j4;
  10417. }
  10418. xCameraPos = l - j2;
  10419. zCameraPos = i1 - k2;
  10420. yCameraPos = k1 - l2;
  10421. yCameraCurve = k;
  10422. xCameraCurve = j1;
  10423. }
  10424.  
  10425. public void updateStrings(String str, int i) {
  10426. switch (i) {
  10427. case 1675:
  10428. sendFrame126(str, 17508);
  10429. break;// Stab
  10430. case 1676:
  10431. sendFrame126(str, 17509);
  10432. break;// Slash
  10433. case 1677:
  10434. sendFrame126(str, 17510);
  10435. break;// Cursh
  10436. case 1678:
  10437. sendFrame126(str, 17511);
  10438. break;// Magic
  10439. case 1679:
  10440. sendFrame126(str, 17512);
  10441. break;// Range
  10442. case 1680:
  10443. sendFrame126(str, 17513);
  10444. break;// Stab
  10445. case 1681:
  10446. sendFrame126(str, 17514);
  10447. break;// Slash
  10448. case 1682:
  10449. sendFrame126(str, 17515);
  10450. break;// Crush
  10451. case 1683:
  10452. sendFrame126(str, 17516);
  10453. break;// Magic
  10454. case 1684:
  10455. sendFrame126(str, 17517);
  10456. break;// Range
  10457. case 1686:
  10458. sendFrame126(str, 17518);
  10459. break;// Strength
  10460. case 1687:
  10461. sendFrame126(str, 17519);
  10462. break;// Prayer
  10463. }
  10464. }
  10465.  
  10466. public void sendFrame126(String str, int i) {
  10467. RSInterface.interfaceCache[i].message = str;
  10468. if (RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID]) {
  10469. }
  10470. }
  10471.  
  10472. public void sendPacket185(int button, int toggle, int type) {
  10473. switch (type) {
  10474. case 135:
  10475. RSInterface class9 = RSInterface.interfaceCache[button];
  10476. boolean flag8 = true;
  10477. if (class9.contentType > 0)
  10478. flag8 = promptUserForInput(class9);
  10479. if (flag8) {
  10480. stream.createFrame(185);
  10481. stream.writeWord(button);
  10482. }
  10483. break;
  10484. case 646:
  10485. stream.createFrame(185);
  10486. stream.writeWord(button);
  10487. RSInterface class9_2 = RSInterface.interfaceCache[button];
  10488. if (class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  10489. if (variousSettings[toggle] != class9_2.anIntArray212[0]) {
  10490. variousSettings[toggle] = class9_2.anIntArray212[0];
  10491. method33(toggle);
  10492. }
  10493. }
  10494. break;
  10495. case 169:
  10496. stream.createFrame(185);
  10497. stream.writeWord(button);
  10498. RSInterface class9_3 = RSInterface.interfaceCache[button];
  10499. if (class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  10500. variousSettings[toggle] = 1 - variousSettings[toggle];
  10501. method33(toggle);
  10502. }
  10503. switch (button) {
  10504. case 74214:
  10505. System.out.println("toggle = " + toggle);
  10506. if (toggle == 0)
  10507. sendFrame36(173, toggle);
  10508. if (toggle == 1)
  10509. sendPacket185(153, 173, 646);
  10510. break;
  10511. }
  10512. break;
  10513. }
  10514. }
  10515.  
  10516. public void sendFrame36(int id, int state) {
  10517. anIntArray1045[id] = state;
  10518. if (variousSettings[id] != state) {
  10519. variousSettings[id] = state;
  10520. method33(id);
  10521. if (dialogID != -1)
  10522. inputTaken = true;
  10523. }
  10524. }
  10525.  
  10526.  
  10527.  
  10528. public void sendFrame219() {
  10529. if (invOverlayInterfaceID != -1) {
  10530. invOverlayInterfaceID = -1;
  10531. tabAreaAltered = true;
  10532. }
  10533. if (backDialogID != -1) {
  10534. backDialogID = -1;
  10535. inputTaken = true;
  10536. }
  10537. if (inputDialogState != 0) {
  10538. inputDialogState = 0;
  10539. inputTaken = true;
  10540. }
  10541. openInterfaceID = -1;
  10542. aBoolean1149 = false;
  10543. }
  10544.  
  10545.  
  10546.  
  10547. public void sendFrame248(int interfaceID, int sideInterfaceID) {
  10548. if (backDialogID != -1) {
  10549. backDialogID = -1;
  10550. inputTaken = true;
  10551. }
  10552. if (inputDialogState != 0) {
  10553. inputDialogState = 0;
  10554. inputTaken = true;
  10555. }
  10556. openInterfaceID = interfaceID;
  10557. invOverlayInterfaceID = sideInterfaceID;
  10558. tabAreaAltered = true;
  10559. aBoolean1149 = false;
  10560. }
  10561.  
  10562. private boolean parsePacket() {
  10563. if (socketStream == null)
  10564. return false;
  10565. try {
  10566. int i = socketStream.available();
  10567. if (i == 0)
  10568. return false;
  10569. if (pktType == -1) {
  10570. socketStream.flushInputStream(inStream.buffer, 1);
  10571. pktType = inStream.buffer[0] & 0xff;
  10572. if (encryption != null)
  10573. pktType = pktType - encryption.getNextKey() & 0xff;
  10574. pktSize = SizeConstants.packetSizes[pktType];
  10575. i--;
  10576. }
  10577. if (pktSize == -1)
  10578. if (i > 0) {
  10579. socketStream.flushInputStream(inStream.buffer, 1);
  10580. pktSize = inStream.buffer[0] & 0xff;
  10581. i--;
  10582. } else {
  10583. return false;
  10584. }
  10585. if (pktSize == -2)
  10586. if (i > 1) {
  10587. socketStream.flushInputStream(inStream.buffer, 2);
  10588. inStream.currentOffset = 0;
  10589. pktSize = inStream.readUnsignedWord();
  10590. i -= 2;
  10591. } else {
  10592. return false;
  10593. }
  10594. if (i < pktSize)
  10595. return false;
  10596. inStream.currentOffset = 0;
  10597. socketStream.flushInputStream(inStream.buffer, pktSize);
  10598. anInt1009 = 0;
  10599. anInt843 = anInt842;
  10600. anInt842 = anInt841;
  10601. anInt841 = pktType;
  10602. switch (pktType) {
  10603. case 81:
  10604. updatePlayers(pktSize, inStream);
  10605. aBoolean1080 = false;
  10606. pktType = -1;
  10607. return true;
  10608.  
  10609. case 176:
  10610. daysSinceRecovChange = inStream.method427();
  10611. unreadMessages = inStream.method435();
  10612. membersInt = inStream.readUnsignedByte();
  10613. anInt1193 = inStream.method440();
  10614. daysSinceLastLogin = inStream.readUnsignedWord();
  10615. if (anInt1193 != 0 && openInterfaceID == -1) {
  10616. Signlink.dnslookup(TextClass.method586(anInt1193));
  10617. clearTopInterfaces();
  10618. char c = '\u028A';
  10619. if (daysSinceRecovChange != 201 || membersInt == 1)
  10620. c = '\u028F';
  10621. reportAbuseInput = "";
  10622. canMute = false;
  10623. for (int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  10624. if (RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  10625. continue;
  10626. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  10627.  
  10628. }
  10629. }
  10630. pktType = -1;
  10631. return true;
  10632.  
  10633. case 64:
  10634. anInt1268 = inStream.method427();
  10635. anInt1269 = inStream.method428();
  10636. for (int j = anInt1268; j < anInt1268 + 8; j++) {
  10637. for (int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  10638. if (groundArray[plane][j][l9] != null) {
  10639. groundArray[plane][j][l9] = null;
  10640. spawnGroundItem(j, l9);
  10641. }
  10642. }
  10643. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetNext())
  10644. if (class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  10645. class30_sub1.anInt1294 = 0;
  10646. pktType = -1;
  10647. return true;
  10648.  
  10649. case 185:
  10650. int k = inStream.method436();
  10651. RSInterface.interfaceCache[k].anInt233 = 3;
  10652. if (myPlayer.desc == null)
  10653. 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];
  10654. else
  10655. RSInterface.interfaceCache[k].mediaID = (int) (0x12345678L + myPlayer.desc.interfaceType);
  10656. pktType = -1;
  10657. return true;
  10658.  
  10659. /* Clan chat packet */
  10660. case 217:
  10661. try {
  10662. name = inStream.readString();
  10663. message = inStream.readString();
  10664. clanname = inStream.readString();
  10665. rights = inStream.readUnsignedWord();
  10666. // message = TextInput.processText(message);
  10667. // message = Censor.doCensor(message);
  10668. System.out.println(clanname);
  10669. pushMessage(message, 16, name);
  10670. } catch (Exception e) {
  10671. e.printStackTrace();
  10672. }
  10673. pktType = -1;
  10674. return true;
  10675.  
  10676. case 107:
  10677. aBoolean1160 = false;
  10678. for (int l = 0; l < 5; l++)
  10679. aBooleanArray876[l] = false;
  10680. xpCounter = 0;
  10681. pktType = -1;
  10682. return true;
  10683.  
  10684. case 72:
  10685. int i1 = inStream.method434();
  10686. RSInterface class9 = RSInterface.interfaceCache[i1];
  10687. for (int k15 = 0; k15 < class9.inv.length; k15++) {
  10688. class9.inv[k15] = -1;
  10689. class9.inv[k15] = 0;
  10690. }
  10691. pktType = -1;
  10692. return true;
  10693.  
  10694. case 214:
  10695. ignoreCount = pktSize / 8;
  10696. for (int j1 = 0; j1 < ignoreCount; j1++)
  10697. ignoreListAsLongs[j1] = inStream.readQWord();
  10698. pktType = -1;
  10699. return true;
  10700.  
  10701. case 166:
  10702. aBoolean1160 = true;
  10703. anInt1098 = inStream.readUnsignedByte();
  10704. anInt1099 = inStream.readUnsignedByte();
  10705. anInt1100 = inStream.readUnsignedWord();
  10706. anInt1101 = inStream.readUnsignedByte();
  10707. anInt1102 = inStream.readUnsignedByte();
  10708. if (anInt1102 >= 100) {
  10709. xCameraPos = anInt1098 * 128 + 64;
  10710. yCameraPos = anInt1099 * 128 + 64;
  10711. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  10712. }
  10713. pktType = -1;
  10714. return true;
  10715.  
  10716. case 134:
  10717. int k1 = inStream.readUnsignedByte();
  10718. int i10 = inStream.method439();
  10719. int l15 = inStream.readUnsignedByte();
  10720. int xp = currentExp[k1];
  10721. currentExp[k1] = i10;
  10722. currentStats[k1] = l15;
  10723. maxStats[k1] = 1;
  10724. xpCounter += currentExp[k1] - xp;
  10725. expAdded = currentExp[k1] - xp;
  10726. for (int k20 = 0; k20 < 98; k20++)
  10727. if (i10 >= anIntArray1019[k20])
  10728. maxStats[k1] = k20 + 2;
  10729. pktType = -1;
  10730. return true;
  10731.  
  10732. case 71:
  10733. int l1 = inStream.readUnsignedWord();
  10734. int j10 = inStream.method426();
  10735. if (l1 == 65535)
  10736. l1 = -1;
  10737. tabInterfaceIDs[j10] = l1;
  10738. tabAreaAltered = true;
  10739. pktType = -1;
  10740. return true;
  10741.  
  10742. case 74:
  10743. int i2 = inStream.method434();
  10744. if (i2 == 65535)
  10745. i2 = -1;
  10746. if (i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  10747. nextSong = i2;
  10748. songChanging = true;
  10749. onDemandFetcher.method558(2, nextSong);
  10750. }
  10751. currentSong = i2;
  10752. pktType = -1;
  10753. return true;
  10754.  
  10755. case 121:
  10756. int j2 = inStream.method436();
  10757. int k10 = inStream.method435();
  10758. if (musicEnabled && !lowMem) {
  10759. nextSong = j2;
  10760. songChanging = false;
  10761. onDemandFetcher.method558(2, nextSong);
  10762. prevSong = k10;
  10763. }
  10764. pktType = -1;
  10765. return true;
  10766.  
  10767. case 109:
  10768. resetLogout();
  10769. pktType = -1;
  10770. return false;
  10771.  
  10772. case 70:
  10773. int k2 = inStream.readSignedWord();
  10774. int l10 = inStream.method437();
  10775. int i16 = inStream.method434();
  10776. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  10777. class9_5.anInt263 = k2;
  10778. class9_5.anInt265 = l10;
  10779. pktType = -1;
  10780. return true;
  10781.  
  10782. case 73:
  10783. case 241:
  10784. int l2 = anInt1069;
  10785. int i11 = anInt1070;
  10786. if (pktType == 73) {
  10787. l2 = inStream.method435();
  10788. i11 = inStream.readUnsignedWord();
  10789. aBoolean1159 = false;
  10790. }
  10791. if (pktType == 241) {
  10792. i11 = inStream.method435();
  10793. inStream.initBitAccess();
  10794. for (int j16 = 0; j16 < 4; j16++) {
  10795. for (int l20 = 0; l20 < 13; l20++) {
  10796. for (int j23 = 0; j23 < 13; j23++) {
  10797. int i26 = inStream.readBits(1);
  10798. if (i26 == 1)
  10799. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  10800. else
  10801. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  10802. }
  10803. }
  10804. }
  10805. inStream.finishBitAccess();
  10806. l2 = inStream.readUnsignedWord();
  10807. aBoolean1159 = true;
  10808. }
  10809. if (anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  10810. pktType = -1;
  10811. return true;
  10812. }
  10813. anInt1069 = l2;
  10814. anInt1070 = i11;
  10815. baseX = (anInt1069 - 6) * 8;
  10816. baseY = (anInt1070 - 6) * 8;
  10817. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  10818. if (anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  10819. aBoolean1141 = true;
  10820. loadingStage = 1;
  10821. aLong824 = System.currentTimeMillis();
  10822. aRSImageProducer_1165.initDrawingArea();
  10823. fancyText.drawChatInput(0xffffff, 5, "Loading - please wait.", 15, true);
  10824. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  10825. if (pktType == 73) {
  10826. int k16 = 0;
  10827. for (int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  10828. for (int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  10829. k16++;
  10830. }
  10831. aByteArrayArray1183 = new byte[k16][];
  10832. aByteArrayArray1247 = new byte[k16][];
  10833. anIntArray1234 = new int[k16];
  10834. anIntArray1235 = new int[k16];
  10835. anIntArray1236 = new int[k16];
  10836. k16 = 0;
  10837. for (int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  10838. for (int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  10839. anIntArray1234[k16] = (l23 << 8) + j26;
  10840. if (aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  10841. anIntArray1235[k16] = -1;
  10842. anIntArray1236[k16] = -1;
  10843. k16++;
  10844. } else {
  10845. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  10846. if (k28 != -1)
  10847. onDemandFetcher.method558(3, k28);
  10848. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  10849. if (j30 != -1)
  10850. onDemandFetcher.method558(3, j30);
  10851. k16++;
  10852. }
  10853. }
  10854. }
  10855. }
  10856. if (pktType == 241) {
  10857. int l16 = 0;
  10858. int ai[] = new int[676];
  10859. for (int i24 = 0; i24 < 4; i24++) {
  10860. for (int k26 = 0; k26 < 13; k26++) {
  10861. for (int l28 = 0; l28 < 13; l28++) {
  10862. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  10863. if (k30 != -1) {
  10864. int k31 = k30 >> 14 & 0x3ff;
  10865. int i32 = k30 >> 3 & 0x7ff;
  10866. int k32 = (k31 / 8 << 8) + i32 / 8;
  10867. for (int j33 = 0; j33 < l16; j33++) {
  10868. if (ai[j33] != k32)
  10869. continue;
  10870. k32 = -1;
  10871.  
  10872. }
  10873. if (k32 != -1)
  10874. ai[l16++] = k32;
  10875. }
  10876. }
  10877. }
  10878. }
  10879. aByteArrayArray1183 = new byte[l16][];
  10880. aByteArrayArray1247 = new byte[l16][];
  10881. anIntArray1234 = new int[l16];
  10882. anIntArray1235 = new int[l16];
  10883. anIntArray1236 = new int[l16];
  10884. for (int l26 = 0; l26 < l16; l26++) {
  10885. int i29 = anIntArray1234[l26] = ai[l26];
  10886. int l30 = i29 >> 8 & 0xff;
  10887. int l31 = i29 & 0xff;
  10888. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  10889. if (j32 != -1)
  10890. onDemandFetcher.method558(3, j32);
  10891. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  10892. if (i33 != -1)
  10893. onDemandFetcher.method558(3, i33);
  10894. }
  10895. }
  10896. int i17 = baseX - anInt1036;
  10897. int j21 = baseY - anInt1037;
  10898. anInt1036 = baseX;
  10899. anInt1037 = baseY;
  10900. for (int j24 = 0; j24 < 16384; j24++) {
  10901. Npc npc = npcArray[j24];
  10902. if (npc != null) {
  10903. for (int j29 = 0; j29 < 10; j29++) {
  10904. npc.smallX[j29] -= i17;
  10905. npc.smallY[j29] -= j21;
  10906. }
  10907. npc.x -= i17 * 128;
  10908. npc.y -= j21 * 128;
  10909. }
  10910. }
  10911. for (int i27 = 0; i27 < maxPlayers; i27++) {
  10912. Player player = playerArray[i27];
  10913. if (player != null) {
  10914. for (int i31 = 0; i31 < 10; i31++) {
  10915. player.smallX[i31] -= i17;
  10916. player.smallY[i31] -= j21;
  10917. }
  10918. player.x -= i17 * 128;
  10919. player.y -= j21 * 128;
  10920. }
  10921. }
  10922. aBoolean1080 = true;
  10923. byte byte1 = 0;
  10924. byte byte2 = 104;
  10925. byte byte3 = 1;
  10926. if (i17 < 0) {
  10927. byte1 = 103;
  10928. byte2 = -1;
  10929. byte3 = -1;
  10930. }
  10931. byte byte4 = 0;
  10932. byte byte5 = 104;
  10933. byte byte6 = 1;
  10934. if (j21 < 0) {
  10935. byte4 = 103;
  10936. byte5 = -1;
  10937. byte6 = -1;
  10938. }
  10939. for (int k33 = byte1; k33 != byte2; k33 += byte3) {
  10940. for (int l33 = byte4; l33 != byte5; l33 += byte6) {
  10941. int i34 = k33 + i17;
  10942. int j34 = l33 + j21;
  10943. for (int k34 = 0; k34 < 4; k34++)
  10944. if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  10945. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  10946. else
  10947. groundArray[k34][k33][l33] = null;
  10948. }
  10949. }
  10950. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179.reverseGetNext()) {
  10951. class30_sub1_1.anInt1297 -= i17;
  10952. class30_sub1_1.anInt1298 -= j21;
  10953. if (class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  10954. class30_sub1_1.unlink();
  10955. }
  10956. if (destX != 0) {
  10957. destX -= i17;
  10958. destY -= j21;
  10959. }
  10960. aBoolean1160 = false;
  10961. pktType = -1;
  10962. return true;
  10963.  
  10964. case 208:
  10965. int i3 = inStream.method437();
  10966. if (i3 >= 0)
  10967. method60(i3);
  10968. anInt1018 = i3;
  10969. pktType = -1;
  10970. return true;
  10971.  
  10972. case 99:
  10973. anInt1021 = inStream.readUnsignedByte();
  10974. pktType = -1;
  10975. return true;
  10976.  
  10977. case 75:
  10978. int j3 = inStream.method436();
  10979. int j11 = inStream.method436();
  10980. RSInterface.interfaceCache[j11].anInt233 = 2;
  10981. RSInterface.interfaceCache[j11].mediaID = j3;
  10982. pktType = -1;
  10983. return true;
  10984.  
  10985. case 114:
  10986. anInt1104 = inStream.method434() * 30;
  10987. pktType = -1;
  10988. return true;
  10989.  
  10990. case 60:
  10991. anInt1269 = inStream.readUnsignedByte();
  10992. anInt1268 = inStream.method427();
  10993. while (inStream.currentOffset < pktSize) {
  10994. int k3 = inStream.readUnsignedByte();
  10995. method137(inStream, k3);
  10996. }
  10997. pktType = -1;
  10998. return true;
  10999.  
  11000. case 35:
  11001. int l3 = inStream.readUnsignedByte();
  11002. int k11 = inStream.readUnsignedByte();
  11003. int j17 = inStream.readUnsignedByte();
  11004. int k21 = inStream.readUnsignedByte();
  11005. aBooleanArray876[l3] = true;
  11006. anIntArray873[l3] = k11;
  11007. anIntArray1203[l3] = j17;
  11008. anIntArray928[l3] = k21;
  11009. anIntArray1030[l3] = 0;
  11010. pktType = -1;
  11011. return true;
  11012.  
  11013. case 174:
  11014. int i4 = inStream.readUnsignedWord();
  11015. int l11 = inStream.readUnsignedByte();
  11016. int k17 = inStream.readUnsignedWord();
  11017. if (aBoolean848 && !lowMem && anInt1062 < 50) {
  11018. anIntArray1207[anInt1062] = i4;
  11019. anIntArray1241[anInt1062] = l11;
  11020. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  11021. anInt1062++;
  11022. }
  11023. pktType = -1;
  11024. return true;
  11025.  
  11026. case 104:
  11027. int j4 = inStream.method427();
  11028. int i12 = inStream.method426();
  11029. String s6 = inStream.readString();
  11030. if (j4 >= 1 && j4 <= 5) {
  11031. if (s6.equalsIgnoreCase("null"))
  11032. s6 = null;
  11033. atPlayerActions[j4 - 1] = s6;
  11034. atPlayerArray[j4 - 1] = i12 == 0;
  11035. }
  11036. pktType = -1;
  11037. return true;
  11038.  
  11039. case 78:
  11040. destX = 0;
  11041. pktType = -1;
  11042. return true;
  11043.  
  11044. case 253:
  11045. String s = inStream.readString();
  11046. if (s.endsWith(":tradereq:")) {
  11047. String s3 = s.substring(0, s.indexOf(":"));
  11048. long l17 = TextClass.longForName(s3);
  11049. boolean flag2 = false;
  11050. for (int j27 = 0; j27 < ignoreCount; j27++) {
  11051. if (ignoreListAsLongs[j27] != l17)
  11052. continue;
  11053. flag2 = true;
  11054.  
  11055. }
  11056. if (!flag2 && anInt1251 == 0)
  11057. pushMessage("wishes to trade with you.", 4, s3);
  11058. } else if (s.endsWith(":clan:")) {
  11059. String s4 = s.substring(0, s.indexOf(":"));
  11060. TextClass.longForName(s4);
  11061. pushMessage("Clan: ", 8, s4);
  11062. } else if (s.endsWith("#url#")) {
  11063. String link = s.substring(0, s.indexOf("#"));
  11064. pushMessage("Join us at: ", 9, link);
  11065. } else if (s.endsWith(":duelreq:")) {
  11066. String s4 = s.substring(0, s.indexOf(":"));
  11067. long l18 = TextClass.longForName(s4);
  11068. boolean flag3 = false;
  11069. for (int k27 = 0; k27 < ignoreCount; k27++) {
  11070. if (ignoreListAsLongs[k27] != l18)
  11071. continue;
  11072. flag3 = true;
  11073.  
  11074. }
  11075. if (!flag3 && anInt1251 == 0)
  11076. pushMessage("wishes to duel with you.", 8, s4);
  11077. } else if (s.endsWith(":chalreq:")) {
  11078. String s5 = s.substring(0, s.indexOf(":"));
  11079. long l19 = TextClass.longForName(s5);
  11080. boolean flag4 = false;
  11081. for (int l27 = 0; l27 < ignoreCount; l27++) {
  11082. if (ignoreListAsLongs[l27] != l19)
  11083. continue;
  11084. flag4 = true;
  11085.  
  11086. }
  11087. if (!flag4 && anInt1251 == 0) {
  11088. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  11089. pushMessage(s8, 8, s5);
  11090. }
  11091. } else if (s.endsWith(":resetautocast:")) {
  11092. autocast = false;
  11093. autoCastId = 0;
  11094. cacheSprite[33].drawSprite(-100, -100);
  11095. } else {
  11096. pushMessage(s, 0, "");
  11097. }
  11098. pktType = -1;
  11099. return true;
  11100.  
  11101. case 1:
  11102. for (int k4 = 0; k4 < playerArray.length; k4++)
  11103. if (playerArray[k4] != null)
  11104. playerArray[k4].anim = -1;
  11105. for (int j12 = 0; j12 < npcArray.length; j12++)
  11106. if (npcArray[j12] != null)
  11107. npcArray[j12].anim = -1;
  11108. pktType = -1;
  11109. return true;
  11110.  
  11111. case 50:
  11112. long l4 = inStream.readQWord();
  11113. int world = inStream.readUnsignedByte();
  11114. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  11115. for (int k24 = 0; k24 < friendsCount; k24++) {
  11116. if (l4 != friendsListAsLongs[k24])
  11117. continue;
  11118. if (friendsNodeIDs[k24] != world) {
  11119. friendsNodeIDs[k24] = world;
  11120. if (world >= 2) {
  11121. pushMessage(s7 + " has logged in.", 5, "");
  11122. }
  11123. if (world <= 1) {
  11124. pushMessage(s7 + " has logged out.", 5, "");
  11125. }
  11126. }
  11127. s7 = null;
  11128.  
  11129. }
  11130. if (s7 != null && friendsCount < 200) {
  11131. friendsListAsLongs[friendsCount] = l4;
  11132. friendsList[friendsCount] = s7;
  11133. friendsNodeIDs[friendsCount] = world;
  11134. friendsCount++;
  11135. }
  11136. for (boolean flag6 = false; !flag6;) {
  11137. flag6 = true;
  11138. for (int k29 = 0; k29 < friendsCount - 1; k29++)
  11139. if (friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  11140. int j31 = friendsNodeIDs[k29];
  11141. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  11142. friendsNodeIDs[k29 + 1] = j31;
  11143. String s10 = friendsList[k29];
  11144. friendsList[k29] = friendsList[k29 + 1];
  11145. friendsList[k29 + 1] = s10;
  11146. long l32 = friendsListAsLongs[k29];
  11147. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  11148. friendsListAsLongs[k29 + 1] = l32;
  11149. flag6 = false;
  11150. }
  11151. }
  11152. pktType = -1;
  11153. return true;
  11154.  
  11155. case 110:
  11156. if (tabID == 12) {
  11157. }
  11158. energy = inStream.readUnsignedByte();
  11159. pktType = -1;
  11160. return true;
  11161.  
  11162. case 254:
  11163. anInt855 = inStream.readUnsignedByte();
  11164. if (anInt855 == 1)
  11165. anInt1222 = inStream.readUnsignedWord();
  11166. if (anInt855 >= 2 && anInt855 <= 6) {
  11167. if (anInt855 == 2) {
  11168. anInt937 = 64;
  11169. anInt938 = 64;
  11170. }
  11171. if (anInt855 == 3) {
  11172. anInt937 = 0;
  11173. anInt938 = 64;
  11174. }
  11175. if (anInt855 == 4) {
  11176. anInt937 = 128;
  11177. anInt938 = 64;
  11178. }
  11179. if (anInt855 == 5) {
  11180. anInt937 = 64;
  11181. anInt938 = 0;
  11182. }
  11183. if (anInt855 == 6) {
  11184. anInt937 = 64;
  11185. anInt938 = 128;
  11186. }
  11187. anInt855 = 2;
  11188. anInt934 = inStream.readUnsignedWord();
  11189. anInt935 = inStream.readUnsignedWord();
  11190. anInt936 = inStream.readUnsignedByte();
  11191. }
  11192. if (anInt855 == 10)
  11193. anInt933 = inStream.readUnsignedWord();
  11194. pktType = -1;
  11195. return true;
  11196.  
  11197. case 248:
  11198. int i5 = inStream.method435();
  11199. int k12 = inStream.readUnsignedWord();
  11200. if (backDialogID != -1) {
  11201. backDialogID = -1;
  11202. inputTaken = true;
  11203. }
  11204. if (inputDialogState != 0) {
  11205. inputDialogState = 0;
  11206. inputTaken = true;
  11207. }
  11208. openInterfaceID = i5;
  11209. invOverlayInterfaceID = k12;
  11210. tabAreaAltered = true;
  11211. aBoolean1149 = false;
  11212. pktType = -1;
  11213. return true;
  11214.  
  11215. case 79:
  11216. int j5 = inStream.method434();
  11217. int l12 = inStream.method435();
  11218. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  11219. if (class9_3 != null && class9_3.type == 0) {
  11220. if (l12 < 0)
  11221. l12 = 0;
  11222. if (l12 > class9_3.scrollMax - class9_3.height)
  11223. l12 = class9_3.scrollMax - class9_3.height;
  11224. class9_3.scrollPosition = l12;
  11225. }
  11226. pktType = -1;
  11227. return true;
  11228.  
  11229. case 68:
  11230. for (int k5 = 0; k5 < variousSettings.length; k5++)
  11231. if (variousSettings[k5] != anIntArray1045[k5]) {
  11232. variousSettings[k5] = anIntArray1045[k5];
  11233. method33(k5);
  11234. }
  11235. pktType = -1;
  11236. return true;
  11237.  
  11238. case 196:
  11239. long l5 = inStream.readQWord();
  11240. int j18 = inStream.readDWord();
  11241. int l21 = inStream.readUnsignedByte();
  11242. boolean flag5 = false;
  11243. for (int i28 = 0; i28 < 100; i28++) {
  11244. if (anIntArray1240[i28] != j18)
  11245. continue;
  11246. flag5 = true;
  11247.  
  11248. }
  11249. if (l21 <= 1) {
  11250. for (int l29 = 0; l29 < ignoreCount; l29++) {
  11251. if (ignoreListAsLongs[l29] != l5)
  11252. continue;
  11253. flag5 = true;
  11254.  
  11255. }
  11256. }
  11257. if (!flag5 && anInt1251 == 0)
  11258. try {
  11259. anIntArray1240[anInt1169] = j18;
  11260. anInt1169 = (anInt1169 + 1) % 100;
  11261. String s9 = TextInput.method525(pktSize - 13, inStream);
  11262. // if(l21 != 3)
  11263. // s9 = Censor.doCensor(s9);
  11264. if (l21 == 2 || l21 == 3)
  11265. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11266. else if (l21 == 1)
  11267. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11268. else
  11269. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  11270. } catch (Exception exception1) {
  11271. Signlink.reporterror("cde1");
  11272. }
  11273. pktType = -1;
  11274. return true;
  11275.  
  11276. case 85:
  11277. anInt1269 = inStream.method427();
  11278. anInt1268 = inStream.method427();
  11279. pktType = -1;
  11280. return true;
  11281.  
  11282. case 24:
  11283. anInt1054 = inStream.method428();
  11284. if (anInt1054 == tabID) {
  11285. if (anInt1054 == 3)
  11286. tabID = 1;
  11287. else
  11288. tabID = 3;
  11289. }
  11290. pktType = -1;
  11291. return true;
  11292.  
  11293. case 246:
  11294. int i6 = inStream.method434();
  11295. int i13 = inStream.readUnsignedWord();
  11296. int k18 = inStream.readUnsignedWord();
  11297. if (k18 == 65535) {
  11298. RSInterface.interfaceCache[i6].anInt233 = 0;
  11299. pktType = -1;
  11300. return true;
  11301. } else {
  11302. ItemDef itemDef = ItemDef.forID(k18);
  11303. RSInterface.interfaceCache[i6].anInt233 = 4;
  11304. RSInterface.interfaceCache[i6].mediaID = k18;
  11305. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotationY;
  11306. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotationX;
  11307. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  11308. pktType = -1;
  11309. return true;
  11310. }
  11311.  
  11312. case 171:
  11313. boolean flag1 = inStream.readUnsignedByte() == 1;
  11314. int j13 = inStream.readUnsignedWord();
  11315. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  11316. pktType = -1;
  11317. return true;
  11318.  
  11319. case 142:
  11320. int j6 = inStream.method434();
  11321. method60(j6);
  11322. if (backDialogID != -1) {
  11323. backDialogID = -1;
  11324. inputTaken = true;
  11325. }
  11326. if (inputDialogState != 0) {
  11327. inputDialogState = 0;
  11328. inputTaken = true;
  11329. }
  11330. invOverlayInterfaceID = j6;
  11331. tabAreaAltered = true;
  11332. openInterfaceID = -1;
  11333. aBoolean1149 = false;
  11334. pktType = -1;
  11335. return true;
  11336.  
  11337. case 126:
  11338. try {
  11339. String text = inStream.readString();
  11340. int frame = inStream.method435();
  11341. if (text.startsWith("www.")) {
  11342. launchURL(text);
  11343. }
  11344. updateStrings(text, frame);
  11345. sendFrame126(text, frame);
  11346. if (frame >= 18144 && frame <= 18244) {
  11347. clanList[frame - 18144] = text;
  11348. }
  11349. } catch (Exception e) {
  11350. }
  11351. pktType = -1;
  11352. return true;
  11353.  
  11354. case 206:
  11355. publicChatMode = inStream.readUnsignedByte();
  11356. privateChatMode = inStream.readUnsignedByte();
  11357. tradeMode = inStream.readUnsignedByte();
  11358. inputTaken = true;
  11359. pktType = -1;
  11360. return true;
  11361.  
  11362. case 240:
  11363. if (tabID == 12) {
  11364. }
  11365. weight = inStream.readSignedWord();
  11366. pktType = -1;
  11367. return true;
  11368.  
  11369. case 8:
  11370. int k6 = inStream.method436();
  11371. int l13 = inStream.readUnsignedWord();
  11372. RSInterface.interfaceCache[k6].anInt233 = 1;
  11373. RSInterface.interfaceCache[k6].mediaID = l13;
  11374. pktType = -1;
  11375. return true;
  11376.  
  11377. case 122:
  11378. int l6 = inStream.method436();
  11379. int i14 = inStream.method436();
  11380. int i19 = i14 >> 10 & 0x1f;
  11381. int i22 = i14 >> 5 & 0x1f;
  11382. int l24 = i14 & 0x1f;
  11383. RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  11384. pktType = -1;
  11385. return true;
  11386.  
  11387. case 53:
  11388. int i7 = inStream.readUnsignedWord();
  11389. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  11390. int j19 = inStream.readUnsignedWord();
  11391. for (int j22 = 0; j22 < j19; j22++) {
  11392. int i25 = inStream.readUnsignedByte();
  11393. if (i25 == 255)
  11394. i25 = inStream.method440();
  11395. class9_1.inv[j22] = inStream.method436();
  11396. class9_1.invStackSizes[j22] = i25;
  11397. }
  11398. for (int j25 = j19; j25 < class9_1.inv.length; j25++) {
  11399. class9_1.inv[j25] = 0;
  11400. class9_1.invStackSizes[j25] = 0;
  11401. }
  11402. pktType = -1;
  11403. return true;
  11404.  
  11405. case 230:
  11406. int j7 = inStream.method435();
  11407. int j14 = inStream.readUnsignedWord();
  11408. int k19 = inStream.readUnsignedWord();
  11409. int k22 = inStream.method436();
  11410. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  11411. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  11412. RSInterface.interfaceCache[j14].modelZoom = j7;
  11413. pktType = -1;
  11414. return true;
  11415.  
  11416. case 221:
  11417. anInt900 = inStream.readUnsignedByte();
  11418. pktType = -1;
  11419. return true;
  11420.  
  11421. case 177:
  11422. aBoolean1160 = true;
  11423. anInt995 = inStream.readUnsignedByte();
  11424. anInt996 = inStream.readUnsignedByte();
  11425. anInt997 = inStream.readUnsignedWord();
  11426. anInt998 = inStream.readUnsignedByte();
  11427. anInt999 = inStream.readUnsignedByte();
  11428. if (anInt999 >= 100) {
  11429. int k7 = anInt995 * 128 + 64;
  11430. int k14 = anInt996 * 128 + 64;
  11431. int i20 = method42(plane, k14, k7) - anInt997;
  11432. int l22 = k7 - xCameraPos;
  11433. int k25 = i20 - zCameraPos;
  11434. int j28 = k14 - yCameraPos;
  11435. int i30 = (int) Math.sqrt(l22 * l22 + j28 * j28);
  11436. yCameraCurve = (int) (Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  11437. xCameraCurve = (int) (Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  11438. if (yCameraCurve < 128)
  11439. yCameraCurve = 128;
  11440. if (yCameraCurve > 383)
  11441. yCameraCurve = 383;
  11442. }
  11443. pktType = -1;
  11444. return true;
  11445.  
  11446. case 249:
  11447. anInt1046 = inStream.method426();
  11448. unknownInt10 = inStream.method436();
  11449. pktType = -1;
  11450. return true;
  11451.  
  11452. case 65:
  11453. updateNPCs(inStream, pktSize);
  11454. pktType = -1;
  11455. return true;
  11456.  
  11457. case 27:
  11458. messagePromptRaised = false;
  11459. inputDialogState = 1;
  11460. amountOrNameInput = "";
  11461. inputTaken = true;
  11462. pktType = -1;
  11463. return true;
  11464.  
  11465. case 187:
  11466. messagePromptRaised = false;
  11467. inputDialogState = 2;
  11468. amountOrNameInput = "";
  11469. inputTaken = true;
  11470. pktType = -1;
  11471. return true;
  11472.  
  11473. case 97:
  11474. int l7 = inStream.readUnsignedWord();
  11475. method60(l7);
  11476. if (invOverlayInterfaceID != -1) {
  11477. invOverlayInterfaceID = -1;
  11478. tabAreaAltered = true;
  11479. }
  11480. if (backDialogID != -1) {
  11481. backDialogID = -1;
  11482. inputTaken = true;
  11483. }
  11484. if (inputDialogState != 0) {
  11485. inputDialogState = 0;
  11486. inputTaken = true;
  11487. }
  11488. openInterfaceID = l7;
  11489. aBoolean1149 = false;
  11490. pktType = -1;
  11491. return true;
  11492.  
  11493. case 218:
  11494. int i8 = inStream.method438();
  11495. dialogID = i8;
  11496. inputTaken = true;
  11497. pktType = -1;
  11498. return true;
  11499.  
  11500. case 87:
  11501. int j8 = inStream.method434();
  11502. int l14 = inStream.method439();
  11503. anIntArray1045[j8] = l14;
  11504. if (variousSettings[j8] != l14) {
  11505. variousSettings[j8] = l14;
  11506. method33(j8);
  11507. if (dialogID != -1)
  11508. inputTaken = true;
  11509. }
  11510. pktType = -1;
  11511. return true;
  11512.  
  11513. case 36:
  11514. int k8 = inStream.method434();
  11515. byte byte0 = inStream.readSignedByte();
  11516. anIntArray1045[k8] = byte0;
  11517. if (variousSettings[k8] != byte0) {
  11518. variousSettings[k8] = byte0;
  11519. method33(k8);
  11520. if (dialogID != -1)
  11521. inputTaken = true;
  11522. }
  11523. pktType = -1;
  11524. return true;
  11525.  
  11526. case 61:
  11527. anInt1055 = inStream.readUnsignedByte();
  11528. pktType = -1;
  11529. return true;
  11530.  
  11531. case 200:
  11532. int l8 = inStream.readUnsignedWord();
  11533. int i15 = inStream.readSignedWord();
  11534. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  11535. class9_4.anInt257 = i15;
  11536. pktType = -1;
  11537. return true;
  11538.  
  11539. case 219:
  11540. if (invOverlayInterfaceID != -1) {
  11541. invOverlayInterfaceID = -1;
  11542. tabAreaAltered = true;
  11543. }
  11544. if (backDialogID != -1) {
  11545. backDialogID = -1;
  11546. inputTaken = true;
  11547. }
  11548. if (inputDialogState != 0) {
  11549. inputDialogState = 0;
  11550. inputTaken = true;
  11551. }
  11552. openInterfaceID = -1;
  11553. aBoolean1149 = false;
  11554. pktType = -1;
  11555. return true;
  11556.  
  11557. case 34:
  11558. int i9 = inStream.readUnsignedWord();
  11559. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  11560. while (inStream.currentOffset < pktSize) {
  11561. int j20 = inStream.method422();
  11562. int i23 = inStream.readUnsignedWord();
  11563. int l25 = inStream.readUnsignedByte();
  11564. if (l25 == 255)
  11565. l25 = inStream.readDWord();
  11566. if (j20 >= 0 && j20 < class9_2.inv.length) {
  11567. class9_2.inv[j20] = i23;
  11568. class9_2.invStackSizes[j20] = l25;
  11569. }
  11570. }
  11571. pktType = -1;
  11572. return true;
  11573.  
  11574. case 4:
  11575. case 44:
  11576. case 84:
  11577. case 101:
  11578. case 105:
  11579. case 117:
  11580. case 147:
  11581. case 151:
  11582. case 156:
  11583. case 160:
  11584. case 215:
  11585. method137(inStream, pktType);
  11586. pktType = -1;
  11587. return true;
  11588.  
  11589. case 106:
  11590. tabID = inStream.method427();
  11591. tabAreaAltered = true;
  11592. pktType = -1;
  11593. return true;
  11594.  
  11595. case 164:
  11596. int j9 = inStream.method434();
  11597. method60(j9);
  11598. if (invOverlayInterfaceID != -1) {
  11599. invOverlayInterfaceID = -1;
  11600. tabAreaAltered = true;
  11601. }
  11602. backDialogID = j9;
  11603. inputTaken = true;
  11604. openInterfaceID = -1;
  11605. aBoolean1149 = false;
  11606. pktType = -1;
  11607. return true;
  11608.  
  11609. }
  11610. Signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  11611. // resetLogout();
  11612. } catch (IOException _ex) {
  11613. dropClient();
  11614. } catch (Exception exception) {
  11615. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  11616. for (int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  11617. s2 = s2 + inStream.buffer[j15] + ",";
  11618. Signlink.reporterror(s2);
  11619. // resetLogout();
  11620. }
  11621. pktType = -1;
  11622. return true;
  11623. }
  11624.  
  11625. private void method146() {
  11626. anInt1265++;
  11627. method47(true);
  11628. method26(true);
  11629. method47(false);
  11630. method26(false);
  11631. method55();
  11632. method104();
  11633. if (!aBoolean1160) {
  11634. int i = anInt1184;
  11635. if (anInt984 / 256 > i)
  11636. i = anInt984 / 256;
  11637. if (aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  11638. i = anIntArray1203[4] + 128;
  11639. int k = minimapInt1 + anInt896 & 0x7ff;
  11640. 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);
  11641. }
  11642. int j;
  11643. if (!aBoolean1160)
  11644. j = method120();
  11645. else
  11646. j = method121();
  11647. int l = xCameraPos;
  11648. int i1 = zCameraPos;
  11649. int j1 = yCameraPos;
  11650. int k1 = yCameraCurve;
  11651. int l1 = xCameraCurve;
  11652. for (int i2 = 0; i2 < 5; i2++)
  11653. if (aBooleanArray876[i2]) {
  11654. 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]);
  11655. if (i2 == 0)
  11656. xCameraPos += j2;
  11657. if (i2 == 1)
  11658. zCameraPos += j2;
  11659. if (i2 == 2)
  11660. yCameraPos += j2;
  11661. if (i2 == 3)
  11662. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  11663. if (i2 == 4) {
  11664. yCameraCurve += j2;
  11665. if (yCameraCurve < 128)
  11666. yCameraCurve = 128;
  11667. if (yCameraCurve > 383)
  11668. yCameraCurve = 383;
  11669. }
  11670. }
  11671. int k2 = Texture.anInt1481;
  11672. Model.aBoolean1684 = true;
  11673. Model.anInt1687 = 0;
  11674. Model.anInt1685 = super.mouseX - 4;
  11675. Model.anInt1686 = super.mouseY - 4;
  11676. DrawingArea.setAllPixelsToZero();
  11677. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  11678. worldController.clearObj5Cache();
  11679. updateEntities();
  11680. drawHeadIcon();
  11681. method37(k2);
  11682. draw3dScreen();
  11683. if (frameMode != ScreenMode.FIXED) {
  11684. drawChatArea();
  11685. drawMinimap();
  11686. drawTabArea();
  11687. }
  11688. aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics, frameMode == ScreenMode.FIXED ? 4 : 0);
  11689. xCameraPos = l;
  11690. zCameraPos = i1;
  11691. yCameraPos = j1;
  11692. yCameraCurve = k1;
  11693. xCameraCurve = l1;
  11694. }
  11695.  
  11696. private void processMinimapActions() {
  11697. final boolean fixed = frameMode == ScreenMode.FIXED;
  11698. if (fixed ? super.mouseX >= 542 && super.mouseX <= 579 && super.mouseY >= 2 && super.mouseY <= 38 :
  11699. super.mouseX >= frameWidth - 180 && super.mouseX <= frameWidth - 139 && super.mouseY >= 0 && super.mouseY <= 40) {
  11700. menuActionName[1] = "Face North";
  11701. menuActionID[1] = 696;
  11702. menuActionRow = 2;
  11703. }
  11704. if (frameMode != ScreenMode.FIXED && changeTabArea) {
  11705. if (super.mouseX >= frameWidth - 26 && super.mouseX <= frameWidth - 1 && super.mouseY >= 2 && super.mouseY <= 24) {
  11706. menuActionName[1] = "Logout";
  11707. menuActionID[1] = 700;
  11708. menuActionRow = 2;
  11709. }
  11710. }
  11711. if (xpCounterHover) {
  11712. menuActionName[3] = drawExperienceCounter ? "Hide @lre@XP Counter" : "Display @lre@XP Counter";
  11713. menuActionID[3] = 474;
  11714. menuActionName[2] = "Reset @lre@XP Counter";
  11715. menuActionID[2] = 475;
  11716. menuActionName[1] = drawTotalExperience ? "Hide @lre@Total XP" : "Display @lre@Total XP";
  11717. menuActionID[1] = 476;
  11718. menuActionRow = 4;
  11719. }
  11720. if (prayHover) {
  11721. menuActionName[2] = prayClicked ? "Turn quick-prayers off" : "Turn quick-prayers on";
  11722. menuActionID[2] = 1500;
  11723. menuActionRow = 2;
  11724. menuActionName[1] = "Select quick-prayers";
  11725. menuActionID[1] = 1506;
  11726. menuActionRow = 3;
  11727. }
  11728. if (runHover) {
  11729. menuActionName[1] = !runClicked ? "Turn run mode on" : "Turn run mode off";
  11730. menuActionID[1] = 1050;
  11731. menuActionRow = 2;
  11732. }
  11733. }
  11734.  
  11735. private void loadAllOrbs(int xOffset) {
  11736. loadHpOrb(xOffset);
  11737. loadPrayerOrb(xOffset);
  11738. loadRunOrb(xOffset);
  11739. }
  11740.  
  11741. private int xpCounter, xpPos, xpAdded = 0;
  11742. private boolean drawExperienceCounter;
  11743.  
  11744. void loadTotalXP() {
  11745. long totalXP = 0;
  11746. int textWidth = regularText.getTextWidth(NumberFormat.getIntegerInstance().format(totalXP));
  11747. for (int i = 0; i < 23; i++) {
  11748. totalXP += currentExp[i];
  11749. }
  11750. 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) {
  11751. drawTooltip((frameMode == ScreenMode.FIXED ? 390 : frameWidth - 330) - (textWidth - textWidth / 2), (frameMode == ScreenMode.FIXED ? 33 : 38), "Total: "+NumberFormat.getIntegerInstance().format(totalXP));
  11752. }
  11753. }
  11754.  
  11755. void loadXPCounter() {
  11756. int textWidth = smallText.getTextWidth(NumberFormat.getIntegerInstance().format(xpCounter));
  11757. int xp = textWidth - textWidth / 2;
  11758. String text = NumberFormat.getIntegerInstance().format(xpCounter);
  11759. if (xpCounter > 214_748_364) {
  11760. xpCounter = 214_748_364;
  11761. }
  11762. cacheSprite[21].drawARGBSprite((frameMode == ScreenMode.FIXED ? 386 : frameWidth - 335), (frameMode == ScreenMode.FIXED ? 5 : 10), 200);
  11763. smallText.method382(0xFFFFFF, (frameMode == ScreenMode.FIXED ? 490 : frameWidth - 230) - xp, text, (frameMode == ScreenMode.FIXED ? 25 : 30), true);
  11764. sideIcons[1].drawSprite((frameMode == ScreenMode.FIXED ? 390 : frameWidth - 332), (frameMode == ScreenMode.FIXED ? 8 : 13));
  11765. if (xpAdded != 0) {
  11766. textWidth = smallText.getTextWidth("" + NumberFormat.getIntegerInstance().format(xpAdded) + "xp");
  11767. smallText.method389(true, (frameMode == ScreenMode.FIXED ? 481 : frameWidth - 239) - xp, 0xFFFFFF, "+" + NumberFormat.getIntegerInstance().format(xpAdded), 50 - xpPos);
  11768. xpPos++;
  11769. if (xpPos >= 25) {
  11770. xpPos = xpAdded = 0;
  11771. }
  11772. } else {
  11773. xpAdded = 0;
  11774. }
  11775. }
  11776.  
  11777. public int xpAddedPos, expAdded;
  11778.  
  11779. void loadPrayerOrb(int xOffset) {
  11780. Sprite bg = cacheSprite[prayHover ? 7 : 6];
  11781. Sprite fg = cacheSprite[prayClicked ? 2 : 1];
  11782. bg.drawSprite(0 + xOffset, 85);
  11783. fg.drawSprite(27 + xOffset, 89);
  11784. int level = Integer.valueOf(RSInterface.interfaceCache[4012].message);
  11785. int max = Integer.valueOf(RSInterface.interfaceCache[4013].message);
  11786. double percent = level / (double) max;
  11787. cacheSprite[5].myHeight = (int) (26 * (1 - percent));
  11788. cacheSprite[5].drawSprite(27 + xOffset, 89);
  11789. if (percent <= .25) {
  11790. cacheSprite[9].drawARGBSprite(30 + xOffset, 92, 200 + (int) (50 * Math.sin(loopCycle / 7.0)));
  11791. } else {
  11792. cacheSprite[9].drawSprite(30 + xOffset, 92);
  11793. }
  11794. smallText.method382(getOrbTextColor((int) (percent * 100)), 16 + xOffset, String.valueOf(level), 111, true);
  11795. }
  11796.  
  11797. void loadRunOrb(int xOffset) {
  11798. Sprite bg = cacheSprite[runHover ? 7 : 6];
  11799. Sprite fg = cacheSprite[variousSettings[152] == 1 ? 4 : 3];
  11800. bg.drawSprite(24 + xOffset, 122);
  11801. fg.drawSprite(51 + xOffset, 126);
  11802. int level = energy;
  11803. double percent = level / (double) 100;
  11804. cacheSprite[5].myHeight = (int) (26 * (1 - percent));
  11805. cacheSprite[5].drawSprite(51 + xOffset, 126);
  11806. if (percent <= .25) {
  11807. cacheSprite[variousSettings[152] == 1 ? 11 : 10].drawARGBSprite(58 + xOffset, 130, 200 + (int) (50 * Math.sin(loopCycle / 7.0)));
  11808. } else {
  11809. cacheSprite[variousSettings[152] == 1 ? 11 : 10].drawSprite(58 + xOffset, 130);
  11810. }
  11811. smallText.method382(getOrbTextColor((int) (percent * 100)), 40 + xOffset, String.valueOf(level), 148, true);
  11812. }
  11813.  
  11814. void loadHpOrb(int xOffset) {
  11815. Sprite bg = cacheSprite[6];
  11816. bg.drawSprite(0 + xOffset, 41);
  11817. cacheSprite[0].drawSprite(27 + xOffset, 45);
  11818. int level = Integer.valueOf(RSInterface.interfaceCache[4016].message);
  11819. int max = Integer.valueOf(RSInterface.interfaceCache[4017].message);
  11820. double percent = level / (double) max;
  11821. cacheSprite[5].myHeight = (int) (26 * (1 - percent));
  11822. cacheSprite[5].drawSprite(27 + xOffset, 45);
  11823. if (percent <= .25) {
  11824. cacheSprite[8].drawARGBSprite(33 + xOffset, 52, 200 + (int) (50 * Math.sin(loopCycle / 7.0)));
  11825. } else {
  11826. cacheSprite[8].drawSprite(33 + xOffset, 52);
  11827. }
  11828. smallText.method382(getOrbTextColor((int) (percent * 100)), 15 + xOffset, String.valueOf(level), 67, true);
  11829. }
  11830.  
  11831. private boolean runHover, prayHover, xpCounterHover, drawTotalExperience, prayClicked, autocast, runClicked = true;
  11832.  
  11833. public int getOrbTextColor(int statusInt) {
  11834. if (statusInt >= 75 && statusInt <= Integer.MAX_VALUE)
  11835. return 0x00FF00;
  11836. else if (statusInt >= 50 && statusInt <= 74)
  11837. return 0xFFFF00;
  11838. else if (statusInt >= 25 && statusInt <= 49)
  11839. return 0xFF981F;
  11840. else
  11841. return 0xFF0000;
  11842. }
  11843.  
  11844. public int getOrbFill(int statusInt) {
  11845. if (statusInt <= Integer.MAX_VALUE && statusInt >= 97)
  11846. return 0;
  11847. else if (statusInt <= 96 && statusInt >= 93)
  11848. return 1;
  11849. else if (statusInt <= 92 && statusInt >= 89)
  11850. return 2;
  11851. else if (statusInt <= 88 && statusInt >= 85)
  11852. return 3;
  11853. else if (statusInt <= 84 && statusInt >= 81)
  11854. return 4;
  11855. else if (statusInt <= 80 && statusInt >= 77)
  11856. return 5;
  11857. else if (statusInt <= 76 && statusInt >= 73)
  11858. return 6;
  11859. else if (statusInt <= 72 && statusInt >= 69)
  11860. return 7;
  11861. else if (statusInt <= 68 && statusInt >= 65)
  11862. return 8;
  11863. else if (statusInt <= 64 && statusInt >= 61)
  11864. return 9;
  11865. else if (statusInt <= 60 && statusInt >= 57)
  11866. return 10;
  11867. else if (statusInt <= 56 && statusInt >= 53)
  11868. return 11;
  11869. else if (statusInt <= 52 && statusInt >= 49)
  11870. return 12;
  11871. else if (statusInt <= 48 && statusInt >= 45)
  11872. return 13;
  11873. else if (statusInt <= 44 && statusInt >= 41)
  11874. return 14;
  11875. else if (statusInt <= 40 && statusInt >= 37)
  11876. return 15;
  11877. else if (statusInt <= 36 && statusInt >= 33)
  11878. return 16;
  11879. else if (statusInt <= 32 && statusInt >= 29)
  11880. return 17;
  11881. else if (statusInt <= 28 && statusInt >= 25)
  11882. return 18;
  11883. else if (statusInt <= 24 && statusInt >= 21)
  11884. return 19;
  11885. else if (statusInt <= 20 && statusInt >= 17)
  11886. return 20;
  11887. else if (statusInt <= 16 && statusInt >= 13)
  11888. return 21;
  11889. else if (statusInt <= 12 && statusInt >= 9)
  11890. return 22;
  11891. else if (statusInt <= 8 && statusInt >= 7)
  11892. return 23;
  11893. else if (statusInt <= 6 && statusInt >= 5)
  11894. return 24;
  11895. else if (statusInt <= 4 && statusInt >= 3)
  11896. return 25;
  11897. else if (statusInt <= 2 && statusInt >= 1)
  11898. return 26;
  11899. else if (statusInt <= 0)
  11900. return 27;
  11901. return 0;
  11902. }
  11903.  
  11904. public void clearTopInterfaces() {
  11905. stream.createFrame(130);
  11906. if (invOverlayInterfaceID != -1) {
  11907. invOverlayInterfaceID = -1;
  11908. aBoolean1149 = false;
  11909. tabAreaAltered = true;
  11910. }
  11911. if (backDialogID != -1) {
  11912. backDialogID = -1;
  11913. inputTaken = true;
  11914. aBoolean1149 = false;
  11915. }
  11916. openInterfaceID = -1;
  11917. fullscreenInterfaceID = -1;
  11918. }
  11919.  
  11920. public Client() {
  11921. xpAdded = 0;
  11922. fullscreenInterfaceID = -1;
  11923. chatRights = new int[500];
  11924. chatTypeView = 0;
  11925. clanChatMode = 0;
  11926. cButtonHPos = -1;
  11927. cButtonCPos = 0;
  11928. server = ClientConstants.SERVER_IP;
  11929. anIntArrayArray825 = new int[104][104];
  11930. friendsNodeIDs = new int[200];
  11931. groundArray = new NodeList[4][104][104];
  11932. aBoolean831 = false;
  11933. aStream_834 = new Stream(new byte[5000]);
  11934. npcArray = new Npc[16384];
  11935. npcIndices = new int[16384];
  11936. anIntArray840 = new int[1000];
  11937. aStream_847 = Stream.create();
  11938. aBoolean848 = true;
  11939. openInterfaceID = -1;
  11940. currentExp = new int[Skills.skillsCount];
  11941. aBoolean872 = false;
  11942. anIntArray873 = new int[5];
  11943. aBooleanArray876 = new boolean[5];
  11944. drawFlames = false;
  11945. reportAbuseInput = "";
  11946. unknownInt10 = -1;
  11947. menuOpen = false;
  11948. inputString = "";
  11949. maxPlayers = 2048;
  11950. myPlayerIndex = 2047;
  11951. playerArray = new Player[maxPlayers];
  11952. playerIndices = new int[maxPlayers];
  11953. anIntArray894 = new int[maxPlayers];
  11954. aStreamArray895s = new Stream[maxPlayers];
  11955. anInt897 = 1;
  11956. anIntArrayArray901 = new int[104][104];
  11957. aByteArray912 = new byte[16384];
  11958. currentStats = new int[Skills.skillsCount];
  11959. ignoreListAsLongs = new long[100];
  11960. loadingError = false;
  11961. anIntArray928 = new int[5];
  11962. anIntArrayArray929 = new int[104][104];
  11963. chatTypes = new int[500];
  11964. chatNames = new String[500];
  11965. chatMessages = new String[500];
  11966. sideIcons = new Sprite[15];
  11967. aBoolean954 = true;
  11968. friendsListAsLongs = new long[200];
  11969. currentSong = -1;
  11970. drawingFlames = false;
  11971. spriteDrawX = -1;
  11972. spriteDrawY = -1;
  11973. anIntArray968 = new int[33];
  11974. anIntArray969 = new int[256];
  11975. decompressors = new Decompressor[5];
  11976. variousSettings = new int[2000];
  11977. aBoolean972 = false;
  11978. anInt975 = 50;
  11979. anIntArray976 = new int[anInt975];
  11980. anIntArray977 = new int[anInt975];
  11981. anIntArray978 = new int[anInt975];
  11982. anIntArray979 = new int[anInt975];
  11983. anIntArray980 = new int[anInt975];
  11984. anIntArray981 = new int[anInt975];
  11985. anIntArray982 = new int[anInt975];
  11986. aStringArray983 = new String[anInt975];
  11987. anInt985 = -1;
  11988. hitMarks = new Sprite[20];
  11989. anIntArray990 = new int[5];
  11990. aBoolean994 = false;
  11991. amountOrNameInput = "";
  11992. aClass19_1013 = new NodeList();
  11993. aBoolean1017 = false;
  11994. anInt1018 = -1;
  11995. anIntArray1030 = new int[5];
  11996. aBoolean1031 = false;
  11997. mapFunctions = new Sprite[100];
  11998. dialogID = -1;
  11999. maxStats = new int[Skills.skillsCount];
  12000. anIntArray1045 = new int[2000];
  12001. aBoolean1047 = true;
  12002. anIntArray1052 = new int[152];
  12003. anIntArray1229 = new int[152];
  12004. anInt1054 = -1;
  12005. aClass19_1056 = new NodeList();
  12006. anIntArray1057 = new int[33];
  12007. aClass9_1059 = new RSInterface();
  12008. mapScenes = new Background[100];
  12009. barFillColor = 0x4d4233;
  12010. anIntArray1065 = new int[7];
  12011. anIntArray1072 = new int[1000];
  12012. anIntArray1073 = new int[1000];
  12013. aBoolean1080 = false;
  12014. friendsList = new String[200];
  12015. inStream = Stream.create();
  12016. expectedCRCs = new int[9];
  12017. menuActionCmd2 = new int[500];
  12018. menuActionCmd3 = new int[500];
  12019. menuActionID = new int[500];
  12020. menuActionCmd1 = new int[500];
  12021. headIcons = new Sprite[20];
  12022. skullIcons = new Sprite[20];
  12023. headIconsHint = new Sprite[20];
  12024. tabAreaAltered = false;
  12025. aString1121 = "";
  12026. atPlayerActions = new String[5];
  12027. atPlayerArray = new boolean[5];
  12028. anIntArrayArrayArray1129 = new int[4][13][13];
  12029. anInt1132 = 2;
  12030. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  12031. aBoolean1141 = false;
  12032. aBoolean1149 = false;
  12033. crosses = new Sprite[8];
  12034. musicEnabled = true;
  12035. loggedIn = false;
  12036. canMute = false;
  12037. aBoolean1159 = false;
  12038. aBoolean1160 = false;
  12039. anInt1171 = 1;
  12040. myUsername = "";
  12041. myPassword = "";
  12042. genericLoadingError = false;
  12043. reportAbuseInterfaceID = -1;
  12044. aClass19_1179 = new NodeList();
  12045. anInt1184 = 128;
  12046. invOverlayInterfaceID = -1;
  12047. stream = Stream.create();
  12048. menuActionName = new String[500];
  12049. anIntArray1203 = new int[5];
  12050. anIntArray1207 = new int[50];
  12051. anInt1210 = 2;
  12052. anInt1211 = 78;
  12053. promptInput = "";
  12054. modIcons = new Background[2];
  12055. tabID = 3;
  12056. inputTaken = false;
  12057. songChanging = true;
  12058. aClass11Array1230 = new Class11[4];
  12059. anIntArray1240 = new int[100];
  12060. anIntArray1241 = new int[50];
  12061. aBoolean1242 = false;
  12062. anIntArray1250 = new int[50];
  12063. rsAlreadyLoaded = false;
  12064. welcomeScreenRaised = false;
  12065. messagePromptRaised = false;
  12066. loginMessage1 = "";
  12067. loginMessage2 = "";
  12068. backDialogID = -1;
  12069. anInt1279 = 2;
  12070. bigX = new int[4000];
  12071. bigY = new int[4000];
  12072. }
  12073.  
  12074. public int rights;
  12075. public String name;
  12076. public String message;
  12077. public String clanname;
  12078. private final int[] chatRights;
  12079. public int chatTypeView;
  12080. public int clanChatMode;
  12081. public int autoCastId = 0;
  12082. public Sprite[] cacheSprite;
  12083. private GraphicsBuffer leftFrame;
  12084. private GraphicsBuffer topFrame;
  12085. private int ignoreCount;
  12086. private long aLong824;
  12087. private int[][] anIntArrayArray825;
  12088. private int[] friendsNodeIDs;
  12089. private NodeList[][][] groundArray;
  12090. private int[] anIntArray828;
  12091. private int[] anIntArray829;
  12092. private volatile boolean aBoolean831;
  12093. private Socket aSocket832;
  12094. private int loginScreenState;
  12095. private Stream aStream_834;
  12096. private Npc[] npcArray;
  12097. private int npcCount;
  12098. private int[] npcIndices;
  12099. private int anInt839;
  12100. private int[] anIntArray840;
  12101. private int anInt841;
  12102. private int anInt842;
  12103. private int anInt843;
  12104. private String aString844;
  12105. public String prayerBook;
  12106. private int privateChatMode;
  12107. private Stream aStream_847;
  12108. private boolean aBoolean848;
  12109. private static int anInt849;
  12110. private int[] anIntArray850;
  12111. private int[] anIntArray851;
  12112. private int[] anIntArray852;
  12113. private int[] anIntArray853;
  12114. private static int anInt854;
  12115. private int anInt855;
  12116. static int openInterfaceID;
  12117. private int xCameraPos;
  12118. private int zCameraPos;
  12119. private int yCameraPos;
  12120. private int yCameraCurve;
  12121. private int xCameraCurve;
  12122. private int myPrivilege;
  12123. private final int[] currentExp;
  12124. private Sprite mapFlag;
  12125. private Sprite mapMarker;
  12126. private boolean aBoolean872;
  12127. private final int[] anIntArray873;
  12128. private final boolean[] aBooleanArray876;
  12129. private int weight;
  12130. private MouseDetection mouseDetection;
  12131. private volatile boolean drawFlames;
  12132. private String reportAbuseInput;
  12133. private int unknownInt10;
  12134. private boolean menuOpen;
  12135. private int anInt886;
  12136. private String inputString;
  12137. private final int maxPlayers;
  12138. private final int myPlayerIndex;
  12139. private Player[] playerArray;
  12140. private int playerCount;
  12141. private int[] playerIndices;
  12142. private int anInt893;
  12143. private int[] anIntArray894;
  12144. private Stream[] aStreamArray895s;
  12145. private int anInt896;
  12146. public int anInt897;
  12147. private int friendsCount;
  12148. private int anInt900;
  12149. private int[][] anIntArrayArray901;
  12150. private byte[] aByteArray912;
  12151. private int anInt913;
  12152. private int crossX;
  12153. private int crossY;
  12154. private int crossIndex;
  12155. private int crossType;
  12156. private int plane;
  12157. private final int[] currentStats;
  12158. private static int anInt924;
  12159. private final long[] ignoreListAsLongs;
  12160. private boolean loadingError;
  12161. private final int[] anIntArray928;
  12162. private int[][] anIntArrayArray929;
  12163. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  12164. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  12165. private int anInt933;
  12166. private int anInt934;
  12167. private int anInt935;
  12168. private int anInt936;
  12169. private int anInt937;
  12170. private int anInt938;
  12171. private final int[] chatTypes;
  12172. private final String[] chatNames;
  12173. private final String[] chatMessages;
  12174. private int anInt945;
  12175. private WorldController worldController;
  12176. private Sprite[] sideIcons;
  12177. private int menuScreenArea;
  12178. private int menuOffsetX;
  12179. private int menuOffsetY;
  12180. private int menuWidth;
  12181. private int menuHeight;
  12182. private long aLong953;
  12183. private boolean aBoolean954;
  12184. private long[] friendsListAsLongs;
  12185. private String[] clanList = new String[100];
  12186. private int currentSong;
  12187. private static int nodeID = 10;
  12188. static int portOff;
  12189. static boolean clientData;
  12190. private static boolean isMembers = true;
  12191. private static boolean lowMem;
  12192. private volatile boolean drawingFlames;
  12193. private int spriteDrawX;
  12194. private int spriteDrawY;
  12195. private final int[] anIntArray965 = { 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff };
  12196. private Background aBackground_966;
  12197. private Background aBackground_967;
  12198. private final int[] anIntArray968;
  12199. private final int[] anIntArray969;
  12200. final Decompressor[] decompressors;
  12201. public int variousSettings[];
  12202. private boolean aBoolean972;
  12203. private final int anInt975;
  12204. private final int[] anIntArray976;
  12205. private final int[] anIntArray977;
  12206. private final int[] anIntArray978;
  12207. private final int[] anIntArray979;
  12208. private final int[] anIntArray980;
  12209. private final int[] anIntArray981;
  12210. private final int[] anIntArray982;
  12211. private final String[] aStringArray983;
  12212. private int anInt984;
  12213. private int anInt985;
  12214. private static int anInt986;
  12215. private Sprite[] hitMarks;
  12216. public int anInt988;
  12217. private int anInt989;
  12218. private final int[] anIntArray990;
  12219. private final boolean aBoolean994;
  12220. private int anInt995;
  12221. private int anInt996;
  12222. private int anInt997;
  12223. private int anInt998;
  12224. private int anInt999;
  12225. private ISAACRandomGen encryption;
  12226. private Sprite multiOverlay;
  12227. 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 } };
  12228. private String amountOrNameInput;
  12229. private static int anInt1005;
  12230. private int daysSinceLastLogin;
  12231. private int pktSize;
  12232. private int pktType;
  12233. private int anInt1009;
  12234. private int anInt1010;
  12235. private int anInt1011;
  12236. private NodeList aClass19_1013;
  12237. private int anInt1014;
  12238. private int anInt1015;
  12239. private int anInt1016;
  12240. private boolean aBoolean1017;
  12241. private int anInt1018;
  12242. private static final int[] anIntArray1019;
  12243. private int anInt1021;
  12244. private int anInt1022;
  12245. private int loadingStage;
  12246. private Sprite scrollBar1;
  12247. private Sprite scrollBar2;
  12248. private int anInt1026;
  12249. private final int[] anIntArray1030;
  12250. private boolean aBoolean1031;
  12251. private Sprite[] mapFunctions;
  12252. private int baseX;
  12253. private int baseY;
  12254. private int anInt1036;
  12255. private int anInt1037;
  12256. private int loginFailures;
  12257. private int anInt1039;
  12258. private int anInt1040;
  12259. private int anInt1041;
  12260. private int dialogID;
  12261. private final int[] maxStats;
  12262. private final int[] anIntArray1045;
  12263. private int anInt1046;
  12264. private boolean aBoolean1047;
  12265. private int anInt1048;
  12266. private String aString1049;
  12267. private static int anInt1051;
  12268. private final int[] anIntArray1052;
  12269. private StreamLoader titleStreamLoader;
  12270. private int anInt1054;
  12271. private int anInt1055;
  12272. private NodeList aClass19_1056;
  12273. private final int[] anIntArray1057;
  12274. public final RSInterface aClass9_1059;
  12275. private Background[] mapScenes;
  12276. private int anInt1062;
  12277. private final int barFillColor;
  12278. private int friendsListAction;
  12279. private final int[] anIntArray1065;
  12280. private int mouseInvInterfaceIndex;
  12281. private int lastActiveInvInterface;
  12282. public OnDemandFetcher onDemandFetcher;
  12283. private int anInt1069;
  12284. private int anInt1070;
  12285. private int anInt1071;
  12286. private int[] anIntArray1072;
  12287. private int[] anIntArray1073;
  12288. private Sprite mapDotItem;
  12289. private Sprite mapDotNPC;
  12290. private Sprite mapDotPlayer;
  12291. private Sprite mapDotFriend;
  12292. private Sprite mapDotTeam;
  12293. private Sprite mapDotClan;
  12294. private int anInt1079;
  12295. private boolean aBoolean1080;
  12296. private String[] friendsList;
  12297. private Stream inStream;
  12298. private int anInt1084;
  12299. private int anInt1085;
  12300. private int activeInterfaceType;
  12301. private int anInt1087;
  12302. private int anInt1088;
  12303. public static int anInt1089;
  12304. public static int spellID = 0;
  12305. public static int totalRead = 0;
  12306. private final int[] expectedCRCs;
  12307. private int[] menuActionCmd2;
  12308. private int[] menuActionCmd3;
  12309. private int[] menuActionID;
  12310. private int[] menuActionCmd1;
  12311. private Sprite[] headIcons;
  12312. private Sprite[] skullIcons;
  12313. private Sprite entityBox, entityBox2;
  12314. private Sprite[] headIconsHint;
  12315. private static int anInt1097;
  12316. private int anInt1098;
  12317. private int anInt1099;
  12318. private int anInt1100;
  12319. private int anInt1101;
  12320. private int anInt1102;
  12321. private static boolean tabAreaAltered;
  12322. private int anInt1104;
  12323. private GraphicsBuffer aRSImageProducer_1107;
  12324. private GraphicsBuffer aRSImageProducer_1108;
  12325. private static GraphicsBuffer aRSImageProducer_1109;
  12326. private GraphicsBuffer aRSImageProducer_1110;
  12327. private GraphicsBuffer aRSImageProducer_1111;
  12328. private GraphicsBuffer aRSImageProducer_1112;
  12329. private GraphicsBuffer aRSImageProducer_1113;
  12330. private GraphicsBuffer aRSImageProducer_1114;
  12331. private GraphicsBuffer aRSImageProducer_1115;
  12332. private static int anInt1117;
  12333. private int membersInt;
  12334. private String aString1121;
  12335. private Sprite compass;
  12336. private GraphicsBuffer aRSImageProducer_1125;
  12337. public static Player myPlayer;
  12338. private final String[] atPlayerActions;
  12339. private final boolean[] atPlayerArray;
  12340. private final int[][][] anIntArrayArrayArray1129;
  12341. public static final int[] tabInterfaceIDs = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
  12342. private int anInt1131;
  12343. public int anInt1132;
  12344. private int menuActionRow;
  12345. private static int anInt1134;
  12346. private int spellSelected;
  12347. private int anInt1137;
  12348. private int spellUsableOn;
  12349. private String spellTooltip;
  12350. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  12351. private boolean aBoolean1141;
  12352. private static int anInt1142;
  12353. private int energy;
  12354. private boolean aBoolean1149;
  12355. private Sprite[] crosses;
  12356. private boolean musicEnabled;
  12357. private Background[] aBackgroundArray1152s;
  12358. private int unreadMessages;
  12359. private static int anInt1155;
  12360. private static boolean fpsOn;
  12361. public static boolean loggedIn;
  12362. private boolean canMute;
  12363. private boolean aBoolean1159;
  12364. private boolean aBoolean1160;
  12365. static int loopCycle;
  12366. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  12367. private static GraphicsBuffer aRSImageProducer_1163;
  12368. private GraphicsBuffer aRSImageProducer_1164;
  12369. private static GraphicsBuffer aRSImageProducer_1165;
  12370. private static GraphicsBuffer aRSImageProducer_1166;
  12371. private int daysSinceRecovChange;
  12372. private RSSocket socketStream;
  12373. private int anInt1169;
  12374. private int minimapInt3;
  12375. public int anInt1171;
  12376. public static String myUsername;
  12377. public static String myPassword;
  12378. private static int anInt1175;
  12379. private boolean genericLoadingError;
  12380. 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 };
  12381. private int reportAbuseInterfaceID;
  12382. private NodeList aClass19_1179;
  12383. private static int[] anIntArray1180;
  12384. private static int[] anIntArray1181;
  12385. private static int[] anIntArray1182;
  12386. private byte[][] aByteArrayArray1183;
  12387. private int anInt1184;
  12388. private int minimapInt1;
  12389. private int anInt1186;
  12390. private int anInt1187;
  12391. private static int anInt1188;
  12392. private int invOverlayInterfaceID;
  12393. private int[] anIntArray1190;
  12394. private int[] anIntArray1191;
  12395. private Stream stream;
  12396. private int anInt1193;
  12397. private int splitPrivateChat;
  12398. private Background mapBack;
  12399. private String[] menuActionName;
  12400. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  12401. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  12402. private final int[] anIntArray1203;
  12403. static final int[] anIntArray1204 = { 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145, 58654, 5027, 1457, 16565, 34991, 25486 };
  12404. private static boolean flagged;
  12405. private final int[] anIntArray1207;
  12406. private int minimapInt2;
  12407. public int anInt1210;
  12408. static int anInt1211;
  12409. private String promptInput;
  12410. private int anInt1213;
  12411. private int[][][] intGroundArray;
  12412. private long aLong1215;
  12413. private int loginScreenCursorPos;
  12414. private final Background[] modIcons;
  12415. private long aLong1220;
  12416. static int tabID;
  12417. private int anInt1222;
  12418. public static boolean inputTaken;
  12419. private int inputDialogState;
  12420. private static int anInt1226;
  12421. private int nextSong;
  12422. private boolean songChanging;
  12423. private final int[] anIntArray1229;
  12424. private Class11[] aClass11Array1230;
  12425. public static int anIntArray1232[];
  12426. private int[] anIntArray1234;
  12427. private int[] anIntArray1235;
  12428. private int[] anIntArray1236;
  12429. private int anInt1237;
  12430. private int anInt1238;
  12431. public final int anInt1239 = 100;
  12432. private final int[] anIntArray1240;
  12433. private final int[] anIntArray1241;
  12434. private boolean aBoolean1242;
  12435. private int atInventoryLoopCycle;
  12436. private int atInventoryInterface;
  12437. private int atInventoryIndex;
  12438. private int atInventoryInterfaceType;
  12439. private byte[][] aByteArrayArray1247;
  12440. private int tradeMode;
  12441. private int anInt1249;
  12442. private final int[] anIntArray1250;
  12443. private int anInt1251;
  12444. private final boolean rsAlreadyLoaded;
  12445. private int anInt1253;
  12446. public int anInt1254;
  12447. private boolean welcomeScreenRaised;
  12448. private boolean messagePromptRaised;
  12449. private byte[][][] byteGroundArray;
  12450. private int prevSong;
  12451. private int destX;
  12452. private int destY;
  12453. private Sprite minimapImage;
  12454. private int anInt1264;
  12455. private int anInt1265;
  12456. private String loginMessage1;
  12457. private String loginMessage2;
  12458. private int anInt1268;
  12459. private int anInt1269;
  12460. private TextDrawingArea smallText;
  12461. private TextDrawingArea regularText;
  12462. private TextDrawingArea boldText;
  12463. private TextDrawingArea fancyText;
  12464. private int anInt1275;
  12465. private int backDialogID;
  12466. private int anInt1278;
  12467. public int anInt1279;
  12468. private int[] bigX;
  12469. private int[] bigY;
  12470. private int itemSelected;
  12471. private int anInt1283;
  12472. private int anInt1284;
  12473. private int anInt1285;
  12474. private String selectedItemName;
  12475. private int publicChatMode;
  12476. private static int anInt1288;
  12477. public static int anInt1290;
  12478. public static String server = "";
  12479. public int drawCount;
  12480. public int fullscreenInterfaceID;
  12481. public int anInt1044;// 377
  12482. public int anInt1129;// 377
  12483. public int anInt1315;// 377
  12484. public int anInt1500;// 377
  12485. public int anInt1501;// 377
  12486. public static int[] fullScreenTextureArray;
  12487.  
  12488. public void resetAllImageProducers() {
  12489. if (super.fullGameScreen != null) {
  12490. return;
  12491. }
  12492. aRSImageProducer_1166 = null;
  12493. aRSImageProducer_1164 = null;
  12494. aRSImageProducer_1163 = null;
  12495. aRSImageProducer_1165 = null;
  12496. aRSImageProducer_1125 = null;
  12497. aRSImageProducer_1107 = null;
  12498. aRSImageProducer_1108 = null;
  12499. aRSImageProducer_1109 = null;
  12500. aRSImageProducer_1110 = null;
  12501. aRSImageProducer_1111 = null;
  12502. aRSImageProducer_1112 = null;
  12503. aRSImageProducer_1113 = null;
  12504. aRSImageProducer_1114 = null;
  12505. aRSImageProducer_1115 = null;
  12506. super.fullGameScreen = new GraphicsBuffer(765, 503);
  12507. welcomeScreenRaised = true;
  12508. }
  12509.  
  12510. public void mouseWheelDragged(int i, int j) {
  12511. if (!mouseWheelDown) {
  12512. return;
  12513. }
  12514. this.anInt1186 += i * 3;
  12515. this.anInt1187 += (j << 1);
  12516. }
  12517.  
  12518. public void launchURL(String url) {
  12519. String osName = System.getProperty("os.name");
  12520. try {
  12521. if (osName.startsWith("Mac OS")) {
  12522. Class<?> fileMgr = Class.forName("com.apple.eio.FileManager");
  12523. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] { String.class });
  12524. openURL.invoke(null, new Object[] { url });
  12525. } else if (osName.startsWith("Windows"))
  12526. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  12527. else { // assume Unix or Linux
  12528. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  12529. String browser = null;
  12530. for (int count = 0; count < browsers.length && browser == null; count++)
  12531. if (Runtime.getRuntime().exec(new String[] { "which", browsers[count] }).waitFor() == 0)
  12532. browser = browsers[count];
  12533. if (browser == null) {
  12534. throw new Exception("Could not find web browser");
  12535. } else
  12536. Runtime.getRuntime().exec(new String[] { browser, url });
  12537. }
  12538. } catch (Exception e) {
  12539. pushMessage("Failed to open URL.", 0, "");
  12540. }
  12541. }
  12542.  
  12543. static {
  12544. anIntArray1019 = new int[99];
  12545. int i = 0;
  12546. for (int j = 0; j < 99; j++) {
  12547. int l = j + 1;
  12548. int i1 = (int) ((double) l + 300D * Math.pow(2D, (double) l / 7D));
  12549. i += i1;
  12550. anIntArray1019[j] = i / 4;
  12551. }
  12552. anIntArray1232 = new int[32];
  12553. i = 2;
  12554. for (int k = 0; k < 32; k++) {
  12555. anIntArray1232[k] = i - 1;
  12556. i += i;
  12557. }
  12558. }
  12559. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement