Advertisement
Guest User

some code

a guest
Sep 26th, 2018
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 389.63 KB | None | 0 0
  1. import java.applet.AppletContext;
  2. import java.awt.*;
  3. import java.io.*;
  4. import java.net.*;
  5. import java.lang.reflect.Method;
  6. import sign.signlink;
  7. import javax.swing.*;
  8.  
  9. public class client extends RSApplet {
  10.  
  11. public static boolean enableTweening = true;
  12.  
  13. public int MapX, MapY;
  14. public static int spellID = 0;
  15. public static boolean newDamage = false;
  16. public int followPlayer = 0;
  17. public int followNPC = 0;
  18. public int followDistance = 1;
  19.  
  20. public void drawOnBankInterface() {
  21. // try {
  22. if (openInterfaceID == 5292 && RSInterface.interfaceCache[27000].message.equals("1")) {// Sent
  23. // on
  24. // bank
  25. // opening
  26. // etc,
  27. // refresh
  28. // tabs
  29. int tabs = Integer.parseInt(RSInterface.interfaceCache[27001].message);// #
  30. // of
  31. // tabs
  32. // used
  33. int tab = Integer.parseInt(RSInterface.interfaceCache[27002].message);// current
  34. // tab
  35. // selected
  36. // System.out.println("Doing tabs up");
  37. for (int i = 0; i <= tabs; i++) {
  38. RSInterface.interfaceCache[22025 + i].sprite1 = new Sprite("Bank/TAB 3");
  39. RSInterface.interfaceCache[22025 + i].tooltip = "Click here to select tab " + (int) (i + 1);
  40. }
  41. for (int i = tabs + 1; i <= 8; i++) {
  42. RSInterface.interfaceCache[22024 + i].sprite1 = new Sprite("");
  43. RSInterface.interfaceCache[22024 + i].tooltip = "";
  44. }
  45. if (tabs != 8) {
  46. RSInterface.interfaceCache[22025 + tabs].sprite1 = new Sprite("Bank/TAB 4");
  47. RSInterface.interfaceCache[22025 + tabs].tooltip = "Drag an item here to create a new tab";
  48. }
  49. // System.out.println(tab);
  50. if (tab == -1)// searching
  51. RSInterface.interfaceCache[22024].sprite1 = new Sprite("Bank/TAB 1");
  52. else if (tab > 0) {
  53. RSInterface.interfaceCache[22024 + tab].sprite1 = new Sprite("Bank/TAB 2");
  54. RSInterface.interfaceCache[22024].sprite1 = new Sprite("Bank/TAB 1");
  55. } else
  56. RSInterface.interfaceCache[22024].sprite1 = new Sprite("Bank/TAB 0");
  57. // TODO: Highlight first item in new tab... (NOT MAIN) ADD BELOW TO
  58. // RSINTERFACE
  59. // RSInterface.interfaceCache[22043].sprite1 = new Sprite("");
  60.  
  61. RSInterface.interfaceCache[27000].message = "0";
  62. }
  63. /*
  64. * } catch (Exception e) { //do w.e }
  65. */
  66. }
  67.  
  68. private static String intToKOrMilLongName(int i) {
  69. String s = String.valueOf(i);
  70. for (int k = s.length() - 3; k > 0; k -= 3)
  71. s = s.substring(0, k) + "," + s.substring(k);
  72.  
  73. // if(j != 0)
  74. // aBoolean1224 = !aBoolean1224;
  75. if (s.length() > 8)
  76. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  77. else if (s.length() > 4)
  78. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  79. return " " + s;
  80. }
  81.  
  82. public final String methodR(/* int i, */ int j) {
  83. // if(i <= 0)
  84. // pktType = inStream.readUnsignedByte();
  85. if (j >= 0 && j < 10000)
  86. return String.valueOf(j);
  87. if (j >= 10000 && j < 10000000)
  88. return j / 1000 + "K";
  89. if (j >= 10000000 && j < 999999999)
  90. return j / 1000000 + "M";
  91. if (j >= 999999999)
  92. return "*";
  93. else
  94. return "?";
  95. }
  96.  
  97. public static final byte[] ReadFile(String s) {
  98. try {
  99. byte abyte0[];
  100. File file = new File(s);
  101. int i = (int) file.length();
  102. abyte0 = new byte[i];
  103. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  104. datainputstream.readFully(abyte0, 0, i);
  105. datainputstream.close();
  106. return abyte0;
  107. } catch (Exception e) {
  108. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  109. return null;
  110. }
  111. }
  112.  
  113. public void models() {
  114. for (int ModelIndex = 0; ModelIndex < 29191; ModelIndex++) {
  115. byte[] abyte0 = getModel(ModelIndex);
  116. if (abyte0 != null && abyte0.length > 0) {
  117. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  118. pushMessage("Model added successfully!", 0, "");
  119. }
  120. }
  121. }
  122.  
  123. public byte[] getModel(int Index) {
  124. try {
  125. File Model = new File(signlink.findcachedir() + "model/" + Index + ".gz");
  126. byte[] aByte = new byte[(int) Model.length()];
  127. FileInputStream fis = new FileInputStream(Model);
  128. fis.read(aByte);
  129. pushMessage("aByte = [" + aByte + "]!", 0, "");
  130. fis.close();
  131. return aByte;
  132. } catch (Exception e) {
  133. return null;
  134. }
  135. }
  136.  
  137. private void stopMidi() {
  138. signlink.midifade = 0;
  139. signlink.midi = "stop";
  140. }
  141.  
  142. private boolean menuHasAddFriend(int j) {
  143. if (j < 0)
  144. return false;
  145. int k = menuActionID[j];
  146. if (k >= 2000)
  147. k -= 2000;
  148. return k == 337;
  149. }
  150.  
  151. public void drawChannelButtons() {
  152. String text[] = { "On", "Friends", "Off", "Hide" };
  153. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  154. switch (cButtonCPos) {
  155. case 0:
  156. chatButtons[1].drawSprite(5, 142);
  157. break;
  158. case 1:
  159. chatButtons[1].drawSprite(71, 142);
  160. break;
  161. case 2:
  162. chatButtons[1].drawSprite(137, 142);
  163. break;
  164. case 3:
  165. chatButtons[1].drawSprite(203, 142);
  166. break;
  167. case 4:
  168. chatButtons[1].drawSprite(269, 142);
  169. break;
  170. case 5:
  171. chatButtons[1].drawSprite(335, 142);
  172. break;
  173. }
  174. if (cButtonHPos == cButtonCPos) {
  175. switch (cButtonHPos) {
  176. case 0:
  177. chatButtons[2].drawSprite(5, 142);
  178. break;
  179. case 1:
  180. chatButtons[2].drawSprite(71, 142);
  181. break;
  182. case 2:
  183. chatButtons[2].drawSprite(137, 142);
  184. break;
  185. case 3:
  186. chatButtons[2].drawSprite(203, 142);
  187. break;
  188. case 4:
  189. chatButtons[2].drawSprite(269, 142);
  190. break;
  191. case 5:
  192. chatButtons[2].drawSprite(335, 142);
  193. break;
  194. case 6:
  195. chatButtons[3].drawSprite(404, 142);
  196. break;
  197. }
  198. } else {
  199. switch (cButtonHPos) {
  200. case 0:
  201. chatButtons[0].drawSprite(5, 142);
  202. break;
  203. case 1:
  204. chatButtons[0].drawSprite(71, 142);
  205. break;
  206. case 2:
  207. chatButtons[0].drawSprite(137, 142);
  208. break;
  209. case 3:
  210. chatButtons[0].drawSprite(203, 142);
  211. break;
  212. case 4:
  213. chatButtons[0].drawSprite(269, 142);
  214. break;
  215. case 5:
  216. chatButtons[0].drawSprite(335, 142);
  217. break;
  218. case 6:
  219. chatButtons[3].drawSprite(404, 142);
  220. break;
  221. }
  222. }
  223. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
  224. smallText.method389(true, 26, 0xffffff, "All", 157);
  225. smallText.method389(true, 86, 0xffffff, "Game", 157);
  226. smallText.method389(true, 150, 0xffffff, "Public", 152);
  227. smallText.method389(true, 212, 0xffffff, "Private", 152);
  228. smallText.method389(true, 286, 0xffffff, "Clan", 152);
  229. smallText.method389(true, 349, 0xffffff, "Trade", 152);
  230. smallText.method382(textColor[publicChatMode], 164, text[publicChatMode], 163, true);
  231. smallText.method382(textColor[privateChatMode], 230, text[privateChatMode], 163, true);
  232. smallText.method382(textColor[clanChatMode], 296, text[clanChatMode], 163, true);
  233. smallText.method382(textColor[tradeMode], 362, text[tradeMode], 163, true);
  234. }
  235.  
  236. private void drawChatArea() {
  237. aGraphicsBuffer_1166.setCanvas();
  238. Texture.anIntArray1472 = anIntArray1180;
  239. chatArea.drawSprite(0, 0);
  240. drawChannelButtons();
  241. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  242. if (messagePromptRaised) {
  243. chatTextDrawingArea.drawText(0, aString1121, 60, 259);
  244. chatTextDrawingArea.drawText(128, promptInput + "*", 80, 259);
  245. } else if (inputDialogState == 1) {
  246. chatTextDrawingArea.drawText(0, "Enter amount:", 60, 259);
  247. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  248. } else if (inputDialogState == 2) {
  249. chatTextDrawingArea.drawText(0, "Enter name:", 60, 259);
  250. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  251. } else if (aString844 != null) {
  252. chatTextDrawingArea.drawText(0, aString844, 60, 259);
  253. chatTextDrawingArea.drawText(128, "Click to continue", 80, 259);
  254. } else if (backDialogID != -1) {
  255. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  256. } else if (dialogID != -1) {
  257. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  258. } else {
  259. int j77 = -3;
  260. int j = 0;
  261. DrawingArea.setDrawingArea(122, 8, 497, 7);
  262. for (int k = 0; k < 500; k++)
  263. if (chatMessages[k] != null) {
  264. int chatType = chatTypes[k];
  265. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  266. String s1 = chatNames[k];
  267. byte byte0 = 0;
  268. if (s1 != null && s1.startsWith("@cr1@")) {
  269. s1 = s1.substring(5);
  270. byte0 = 1;
  271. } else if (s1 != null && s1.startsWith("@cr2@")) {
  272. s1 = s1.substring(5);
  273. byte0 = 2;
  274. } else if (s1 != null && s1.startsWith("@cr3@")) {
  275. s1 = s1.substring(5);
  276. byte0 = 3;
  277. }
  278. if (chatType == 0) {
  279. if (chatTypeView == 5 || chatTypeView == 0) {
  280. if (yPos > 0 && yPos < 210)
  281. textDrawingArea.method389(false, 11, 0, chatMessages[k], yPos);// chat
  282. // color
  283. // enabled
  284. j++;
  285. j77++;
  286. }
  287. }
  288. if ((chatType == 1 || chatType == 2)
  289. && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  290. if (chatTypeView == 1 || chatTypeView == 0) {
  291. if (yPos > 0 && yPos < 210) {
  292. int xPos = 11;
  293. if (byte0 == 1) {
  294. modIcons[0].drawBackground(xPos + 1, yPos - 12);
  295. xPos += 14;
  296. } else if (byte0 == 2) {
  297. modIcons[1].drawBackground(xPos + 1, yPos - 12);
  298. xPos += 14;
  299. } else if (byte0 == 3) {
  300. modIcons[2].drawBackground(xPos + 1, yPos - 12);
  301. xPos += 14;
  302. }
  303. textDrawingArea.method385(0, s1 + ":", yPos, xPos);
  304. xPos += textDrawingArea.getTextWidth(s1) + 8;
  305. textDrawingArea.method389(false, xPos, 255, chatMessages[k], yPos);
  306. }
  307. j++;
  308. j77++;
  309. }
  310. }
  311. if ((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2)
  312. && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  313. if (chatTypeView == 2 || chatTypeView == 0) {
  314. if (yPos > 0 && yPos < 210) {
  315. int k1 = 11;
  316. textDrawingArea.method385(0, "From", yPos, k1);
  317. k1 += textDrawingArea.getTextWidth("From ");
  318. if (byte0 == 1) {
  319. modIcons[0].drawBackground(k1, yPos - 12);
  320. k1 += 12;
  321. } else if (byte0 == 2) {
  322. modIcons[1].drawBackground(k1, yPos - 12);
  323. k1 += 12;
  324. } else if (byte0 == 3) {
  325. modIcons[2].drawBackground(k1, yPos - 12);
  326. k1 += 12;
  327. }
  328. textDrawingArea.method385(0, s1 + ":", yPos, k1);
  329. k1 += textDrawingArea.getTextWidth(s1) + 8;
  330. textDrawingArea.method385(0x800000, chatMessages[k], yPos, k1);
  331. }
  332. j++;
  333. j77++;
  334. }
  335. }
  336. if (chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  337. if (chatTypeView == 3 || chatTypeView == 0) {
  338. if (yPos > 0 && yPos < 210)
  339. textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], yPos, 11);
  340. j++;
  341. j77++;
  342. }
  343. }
  344. if (chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  345. if (chatTypeView == 2 || chatTypeView == 0) {
  346. if (yPos > 0 && yPos < 210)
  347. textDrawingArea.method385(0x800000, chatMessages[k], yPos, 11);
  348. j++;
  349. j77++;
  350. }
  351. }
  352. if (chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  353. if (chatTypeView == 2 || chatTypeView == 0) {
  354. if (yPos > 0 && yPos < 210) {
  355. textDrawingArea.method385(0, "To " + s1 + ":", yPos, 11);
  356. textDrawingArea.method385(0x800000, chatMessages[k], yPos,
  357. 15 + textDrawingArea.getTextWidth("To :" + s1));
  358. }
  359. j++;
  360. j77++;
  361. }
  362. }
  363. if (chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  364. if (chatTypeView == 3 || chatTypeView == 0) {
  365. if (yPos > 0 && yPos < 210)
  366. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  367. j++;
  368. j77++;
  369. }
  370. if (chatType == 11 && (clanChatMode == 0)) {
  371. if (chatTypeView == 11) {
  372. if (yPos > 0 && yPos < 210)
  373. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  374. j++;
  375. j77++;
  376. }
  377. if (chatType == 12) {
  378. if (yPos > 0 && yPos < 110)
  379. textDrawingArea.method385(0x7e3200, chatMessages[k] + " @blu@" + s1, yPos, 11);
  380. j++;
  381. }
  382. }
  383. }
  384. if (chatType == 16) {
  385. int j2 = 40;
  386. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  387. if (chatTypeView == 11 || chatTypeView == 0) {
  388. if (yPos > 3 && yPos < 130)
  389. switch (chatRights[k]) {
  390. case 1:
  391. j2 += clanNameWidth;
  392. modIcons[0].drawBackground(j2 - 18, yPos - 12);
  393. j2 += 14;
  394. break;
  395.  
  396. case 2:
  397. j2 += clanNameWidth;
  398. modIcons[1].drawBackground(j2 - 18, yPos - 12);
  399. j2 += 14;
  400. break;
  401.  
  402. case 3:
  403. j2 += clanNameWidth;
  404. modIcons[1].drawBackground(j2 - 18, yPos - 12);
  405. j2 += 14;
  406. break;
  407.  
  408. default:
  409. j2 += clanNameWidth;
  410. break;
  411. }
  412. textDrawingArea.method385(0, "[", yPos, 8);
  413. textDrawingArea.method385(255, "" + clanname + "", yPos, 14);
  414. textDrawingArea.method385(0, "]", yPos, clanNameWidth + 14);
  415.  
  416. textDrawingArea.method385(0, chatNames[k] + ":", yPos, j2 - 17); // j2
  417. j2 += textDrawingArea.getTextWidth(chatNames[k]) + 7;
  418. textDrawingArea.method385(0x800000, chatMessages[k], yPos, j2 - 16);// j2
  419. j++;
  420. j77++;
  421. }
  422. }
  423. }
  424. DrawingArea.defaultDrawingAreaSize();
  425. anInt1211 = j * 14 + 7 + 5;
  426. if (anInt1211 < 111)
  427. anInt1211 = 111;
  428. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  429. String s;
  430. if (myPlayer != null && myPlayer.name != null)
  431. s = myPlayer.name;
  432. else
  433. s = TextClass.fixName(myUsername);
  434. textDrawingArea.method385(0, s + ":", 133, 11);
  435. textDrawingArea.drawChatInput(255, 12 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133,
  436. false);
  437. DrawingArea.method339(121, 0x807660, 506, 7);
  438. }
  439. if (menuOpen && menuScreenArea == 2) {
  440. drawMenu();
  441. }
  442. aGraphicsBuffer_1166.drawGraphics(338, super.graphics, 0);
  443. aGraphicsBuffer_1165.setCanvas();
  444. Texture.anIntArray1472 = anIntArray1182;
  445. }
  446.  
  447. public void init() {
  448. nodeID = 10;
  449. portOff = 0;
  450. setHighMem();
  451. isMembers = true;
  452. initClientFrame(503, 765);
  453. method458();
  454. }
  455.  
  456. public void startRunnable(Runnable runnable, int i) {
  457. if (i > 10)
  458. i = 10;
  459. if (signlink.mainapp != null) {
  460. signlink.startthread(runnable, i);
  461. } else {
  462. super.startRunnable(runnable, i);
  463. }
  464. }
  465.  
  466. public Socket openSocket(int port) throws IOException {
  467. return new Socket(InetAddress.getByName(server), port);
  468. }
  469.  
  470. private void processMenuClick() {
  471. if (activeInterfaceType != 0)
  472. return;
  473. int j = super.clickMode3;
  474. if (spellSelected == 1 && super.saveClickX >= 516 && super.saveClickY >= 160 && super.saveClickX <= 765
  475. && super.saveClickY <= 205)
  476. j = 0;
  477. if (menuOpen) {
  478. if (j != 1) {
  479. int k = super.mouseX;
  480. int j1 = super.mouseY;
  481. if (menuScreenArea == 0) {
  482. k -= 4;
  483. j1 -= 4;
  484. }
  485. if (menuScreenArea == 1) {
  486. k -= 519;
  487. j1 -= 168;
  488. }
  489. if (menuScreenArea == 2) {
  490. k -= 17;
  491. j1 -= 338;
  492. }
  493. if (menuScreenArea == 3) {
  494. k -= 519;
  495. j1 -= 0;
  496. }
  497. if (k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10
  498. || j1 > menuOffsetY + menuHeight + 10) {
  499. menuOpen = false;
  500. if (menuScreenArea == 1)
  501. needDrawTabArea = true;
  502. if (menuScreenArea == 2)
  503. inputTaken = true;
  504. }
  505. }
  506. if (j == 1) {
  507. int l = menuOffsetX;
  508. int k1 = menuOffsetY;
  509. int i2 = menuWidth;
  510. int k2 = super.saveClickX;
  511. int l2 = super.saveClickY;
  512. if (menuScreenArea == 0) {
  513. k2 -= 4;
  514. l2 -= 4;
  515. }
  516. if (menuScreenArea == 1) {
  517. k2 -= 519;
  518. l2 -= 168;
  519. }
  520. if (menuScreenArea == 2) {
  521. k2 -= 17;
  522. l2 -= 338;
  523. }
  524. if (menuScreenArea == 3) {
  525. k2 -= 519;
  526. l2 -= 0;
  527. }
  528. int i3 = -1;
  529. for (int j3 = 0; j3 < menuActionRow; j3++) {
  530. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  531. if (k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  532. i3 = j3;
  533. }
  534. System.out.println(i3);
  535. if (i3 != -1)
  536. doAction(i3);
  537. menuOpen = false;
  538. if (menuScreenArea == 1)
  539. needDrawTabArea = true;
  540. if (menuScreenArea == 2) {
  541. inputTaken = true;
  542. }
  543. }
  544. } else {
  545. if (j == 1 && menuActionRow > 0) {
  546. int i1 = menuActionID[menuActionRow - 1];
  547. if (i1 == 632 || i1 == 78 || i1 == 867 || i1 == 431 || i1 == 53 || i1 == 74 || i1 == 454 || i1 == 539
  548. || i1 == 493 || i1 == 847 || i1 == 447 || i1 == 1125) {
  549. int l1 = menuActionCmd2[menuActionRow - 1];
  550. int j2 = menuActionCmd3[menuActionRow - 1];
  551. RSInterface class9 = RSInterface.interfaceCache[j2];
  552. if (class9.aBoolean259 || class9.aBoolean235) {
  553. aBoolean1242 = false;
  554. anInt989 = 0;
  555. anInt1084 = j2;
  556. anInt1085 = l1;
  557. activeInterfaceType = 2;
  558. anInt1087 = super.saveClickX;
  559. anInt1088 = super.saveClickY;
  560. if (RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  561. activeInterfaceType = 1;
  562. if (RSInterface.interfaceCache[j2].parentID == backDialogID)
  563. activeInterfaceType = 3;
  564. return;
  565. }
  566. }
  567. }
  568. if (j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  569. j = 2;
  570. if (j == 1 && menuActionRow > 0)
  571. doAction(menuActionRow - 1);
  572. if (j == 2 && menuActionRow > 0)
  573. determineMenuSize();
  574. }
  575. }
  576.  
  577. public static int totalRead = 0;
  578.  
  579. public static String getFileNameWithoutExtension(String fileName) {
  580. File tmpFile = new File(fileName);
  581. tmpFile.getName();
  582. int whereDot = tmpFile.getName().lastIndexOf('.');
  583. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
  584. return tmpFile.getName().substring(0, whereDot);
  585. }
  586. return "";
  587. }
  588.  
  589. public void preloadModels() {
  590. File file = new File(signlink.findcachedir() + "Raw/");
  591. File[] fileArray = file.listFiles();
  592. for (int y = 0; y < fileArray.length; y++) {
  593. String s = fileArray[y].getName();
  594. byte[] buffer = ReadFile(signlink.findcachedir() + "Raw/" + s);
  595. Model.method460(buffer, Integer.parseInt(getFileNameWithoutExtension(s)));
  596. }
  597. }
  598.  
  599. private void saveMidi(boolean flag, byte abyte0[]) {
  600. signlink.midifade = flag ? 1 : 0;
  601. signlink.midisave(abyte0, abyte0.length);
  602. }
  603.  
  604. private void method22() {
  605. try {
  606. anInt985 = -1;
  607. aClass19_1056.removeAll();
  608. aClass19_1013.removeAll();
  609. Texture.method366();
  610. unlinkMRUNodes();
  611. worldController.initToNull();
  612. System.gc();
  613. for (int i = 0; i < 4; i++)
  614. aClass11Array1230[i].method210();
  615.  
  616. for (int l = 0; l < 4; l++) {
  617. for (int k1 = 0; k1 < 104; k1++) {
  618. for (int j2 = 0; j2 < 104; j2++)
  619. byteGroundArray[l][k1][j2] = 0;
  620.  
  621. }
  622.  
  623. }
  624.  
  625. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  626. int k2 = aByteArrayArray1183.length;
  627. stream.createFrame(0);
  628. if (!aBoolean1159) {
  629. for (int i3 = 0; i3 < k2; i3++) {
  630. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  631. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  632. byte abyte0[] = aByteArrayArray1183[i3];
  633. if (FileOperations.FileExists(signlink.findcachedir() + "maps/" + anIntArray1235[i3] + ".dat"))
  634. abyte0 = FileOperations
  635. .ReadFile(signlink.findcachedir() + "maps/" + anIntArray1235[i3] + ".dat");
  636. if (abyte0 != null)
  637. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8,
  638. aClass11Array1230);
  639. }
  640.  
  641. for (int j4 = 0; j4 < k2; j4++) {
  642. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  643. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  644. byte abyte2[] = aByteArrayArray1183[j4];
  645. if (abyte2 == null && anInt1070 < 800)
  646. objectManager.method174(k7, 64, 64, l5);
  647. }
  648.  
  649. anInt1097++;
  650. if (anInt1097 > 160) {
  651. anInt1097 = 0;
  652. stream.createFrame(238);
  653. stream.writeWordBigEndian(96);
  654. }
  655. stream.createFrame(0);
  656. for (int i6 = 0; i6 < k2; i6++) {
  657. byte abyte1[] = aByteArrayArray1247[i6];
  658. if (abyte1 != null) {
  659. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  660. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  661. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  662. }
  663. }
  664.  
  665. }
  666. if (aBoolean1159) {
  667. for (int j3 = 0; j3 < 4; j3++) {
  668. for (int k4 = 0; k4 < 13; k4++) {
  669. for (int j6 = 0; j6 < 13; j6++) {
  670. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  671. if (l7 != -1) {
  672. int i9 = l7 >> 24 & 3;
  673. int l9 = l7 >> 1 & 3;
  674. int j10 = l7 >> 14 & 0x3ff;
  675. int l10 = l7 >> 3 & 0x7ff;
  676. int j11 = (j10 / 8 << 8) + l10 / 8;
  677. for (int l11 = 0; l11 < anIntArray1234.length; l11++) {
  678. if (anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  679. continue;
  680. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8,
  681. aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  682. break;
  683. }
  684.  
  685. }
  686. }
  687.  
  688. }
  689.  
  690. }
  691.  
  692. for (int l4 = 0; l4 < 13; l4++) {
  693. for (int k6 = 0; k6 < 13; k6++) {
  694. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  695. if (i8 == -1)
  696. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  697. }
  698.  
  699. }
  700.  
  701. stream.createFrame(0);
  702. for (int l6 = 0; l6 < 4; l6++) {
  703. for (int j8 = 0; j8 < 13; j8++) {
  704. for (int j9 = 0; j9 < 13; j9++) {
  705. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  706. if (i10 != -1) {
  707. int k10 = i10 >> 24 & 3;
  708. int i11 = i10 >> 1 & 3;
  709. int k11 = i10 >> 14 & 0x3ff;
  710. int i12 = i10 >> 3 & 0x7ff;
  711. int j12 = (k11 / 8 << 8) + i12 / 8;
  712. for (int k12 = 0; k12 < anIntArray1234.length; k12++) {
  713. if (anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  714. continue;
  715. // objectManager.method183(aClass11Array1230,
  716. // worldController, k10, j8 * 8, (i12 & 7) *
  717. // 8, l6, aByteArrayArray1247[k12], (k11 &
  718. // 7) * 8, i11, j9 * 8);
  719. byte abyte0[] = aByteArrayArray1247[k12];
  720. if (FileOperations.FileExists(
  721. signlink.findcachedir() + "maps/" + anIntArray1235[k12] + ".dat"))
  722. abyte0 = FileOperations.ReadFile(
  723. signlink.findcachedir() + "maps/" + anIntArray1235[k12] + ".dat");
  724. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8,
  725. (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  726. break;
  727. }
  728.  
  729. }
  730. }
  731.  
  732. }
  733.  
  734. }
  735.  
  736. }
  737. stream.createFrame(0);
  738. objectManager.method171(aClass11Array1230, worldController);
  739. aGraphicsBuffer_1165.setCanvas();
  740. stream.createFrame(0);
  741. int k3 = ObjectManager.anInt145;
  742. if (k3 > plane)
  743. k3 = plane;
  744. if (k3 < plane - 1)
  745. k3 = plane - 1;
  746. if (lowMem)
  747. worldController.method275(ObjectManager.anInt145);
  748. else
  749. worldController.method275(0);
  750. for (int i5 = 0; i5 < 104; i5++) {
  751. for (int i7 = 0; i7 < 104; i7++)
  752. spawnGroundItem(i5, i7);
  753.  
  754. }
  755.  
  756. anInt1051++;
  757. if (anInt1051 > 98) {
  758. anInt1051 = 0;
  759. stream.createFrame(150);
  760. }
  761. method63();
  762. } catch (Exception exception) {
  763. }
  764. ObjectDef.mruNodes1.unlinkAll();
  765. if (super.gameFrame != null) {
  766. stream.createFrame(210);
  767. stream.writeDWord(0x3f008edd);
  768. }
  769. if (lowMem && signlink.cache_dat != null) {
  770. int j = onDemandFetcher.getVersionCount(0);
  771. for (int i1 = 0; i1 < j; i1++) {
  772. int l1 = onDemandFetcher.getModelIndex(i1);
  773. if ((l1 & 0x79) == 0)
  774. Model.method461(i1);
  775. }
  776.  
  777. }
  778. System.gc();
  779. Texture.method367();
  780. onDemandFetcher.method566();
  781. int k = (anInt1069 - 6) / 8 - 1;
  782. int j1 = (anInt1069 + 6) / 8 + 1;
  783. int i2 = (anInt1070 - 6) / 8 - 1;
  784. int l2 = (anInt1070 + 6) / 8 + 1;
  785. if (aBoolean1141) {
  786. k = 49;
  787. j1 = 50;
  788. i2 = 49;
  789. l2 = 50;
  790. }
  791. for (int l3 = k; l3 <= j1; l3++) {
  792. for (int j5 = i2; j5 <= l2; j5++)
  793. if (l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  794. int j7 = onDemandFetcher.method562(0, j5, l3);
  795. if (j7 != -1)
  796. onDemandFetcher.method560(j7, 3);
  797. int k8 = onDemandFetcher.method562(1, j5, l3);
  798. if (k8 != -1)
  799. onDemandFetcher.method560(k8, 3);
  800. }
  801.  
  802. }
  803.  
  804. }
  805.  
  806. private void unlinkMRUNodes() {
  807. ObjectDef.mruNodes1.unlinkAll();
  808. ObjectDef.mruNodes2.unlinkAll();
  809. EntityDef.mruNodes.unlinkAll();
  810. ItemDef.mruNodes2.unlinkAll();
  811. ItemDef.mruNodes1.unlinkAll();
  812. Player.mruNodes.unlinkAll();
  813. SpotAnim.aMRUNodes_415.unlinkAll();
  814. }
  815.  
  816. private void method24(int i) {
  817. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  818. int j = ai.length;
  819. for (int k = 0; k < j; k++)
  820. ai[k] = 0;
  821.  
  822. for (int l = 1; l < 103; l++) {
  823. int i1 = 24628 + (103 - l) * 512 * 4;
  824. for (int k1 = 1; k1 < 103; k1++) {
  825. if ((byteGroundArray[i][k1][l] & 0x18) == 0)
  826. worldController.method309(ai, i1, i, k1, l);
  827. if (i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  828. worldController.method309(ai, i1, i + 1, k1, l);
  829. i1 += 4;
  830. }
  831.  
  832. }
  833.  
  834. int j1 = ((238 + (int) (Math.random() * 20D)) - 10 << 16) + ((238 + (int) (Math.random() * 20D)) - 10 << 8)
  835. + ((238 + (int) (Math.random() * 20D)) - 10);
  836. int l1 = (238 + (int) (Math.random() * 20D)) - 10 << 16;
  837. aClass30_Sub2_Sub1_Sub1_1263.method343();
  838. for (int i2 = 1; i2 < 103; i2++) {
  839. for (int j2 = 1; j2 < 103; j2++) {
  840. if ((byteGroundArray[i][j2][i2] & 0x18) == 0)
  841. method50(i2, j1, j2, l1, i);
  842. if (i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  843. method50(i2, j1, j2, l1, i + 1);
  844. }
  845.  
  846. }
  847.  
  848. aGraphicsBuffer_1165.setCanvas();
  849. anInt1071 = 0;
  850. for (int k2 = 0; k2 < 104; k2++) {
  851. for (int l2 = 0; l2 < 104; l2++) {
  852. int i3 = worldController.method303(plane, k2, l2);
  853. if (i3 != 0) {
  854. i3 = i3 >> 14 & 0x7fff;
  855. int j3 = ObjectDef.forID(i3).anInt746;
  856. if (j3 >= 0) {
  857. int k3 = k2;
  858. int l3 = l2;
  859. if (j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48) {
  860. byte byte0 = 104;
  861. byte byte1 = 104;
  862. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  863. for (int i4 = 0; i4 < 10; i4++) {
  864. int j4 = (int) (Math.random() * 4D);
  865. if (j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  866. k3--;
  867. if (j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  868. k3++;
  869. if (j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  870. l3--;
  871. if (j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  872. l3++;
  873. }
  874.  
  875. }
  876. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  877. anIntArray1072[anInt1071] = k3;
  878. anIntArray1073[anInt1071] = l3;
  879. anInt1071++;
  880. }
  881. }
  882. }
  883.  
  884. }
  885.  
  886. }
  887.  
  888. private void spawnGroundItem(int i, int j) {
  889. NodeList class19 = groundArray[plane][i][j];
  890. if (class19 == null) {
  891. worldController.method295(plane, i, j);
  892. return;
  893. }
  894. int k = 0xfa0a1f01;
  895. Object obj = null;
  896. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19.reverseGetNext()) {
  897. ItemDef itemDef = ItemDef.forID(item.ID);
  898. int l = itemDef.value;
  899. if (itemDef.stackable)
  900. l *= item.anInt1559 + 1;
  901. // notifyItemSpawn(item, i + baseX, j + baseY);
  902.  
  903. if (l > k) {
  904. k = l;
  905. obj = item;
  906. }
  907. }
  908.  
  909. class19.insertTail(((Node) (obj)));
  910. Object obj1 = null;
  911. Object obj2 = null;
  912. for (Item class30_sub2_sub4_sub2_1 = (Item) class19
  913. .reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item) class19
  914. .reverseGetNext()) {
  915. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  916. obj1 = class30_sub2_sub4_sub2_1;
  917. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID
  918. && obj2 == null)
  919. obj2 = class30_sub2_sub4_sub2_1;
  920. }
  921.  
  922. int i1 = i + (j << 7) + 0x60000000;
  923. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64),
  924. ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  925. }
  926.  
  927. private void method26(boolean flag) {
  928. for (int j = 0; j < npcCount; j++) {
  929. NPC npc = npcArray[npcIndices[j]];
  930. int k = 0x20000000 + (npcIndices[j] << 14);
  931. if (npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  932. continue;
  933. int l = npc.x >> 7;
  934. int i1 = npc.y >> 7;
  935. if (l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  936. continue;
  937. if (npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64) {
  938. if (anIntArrayArray929[l][i1] == anInt1265)
  939. continue;
  940. anIntArrayArray929[l][i1] = anInt1265;
  941. }
  942. if (!npc.desc.aBoolean84)
  943. k += 0x80000000;
  944. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y,
  945. (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  946. }
  947. }
  948.  
  949. private boolean replayWave() {
  950. return signlink.wavereplay();
  951. }
  952.  
  953. private void loadError() {
  954. String s = "ondemand";// was a constant parameter
  955. System.out.println(s);
  956. try {
  957. getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
  958. } catch (Exception exception) {
  959. exception.printStackTrace();
  960. }
  961. do
  962. try {
  963. Thread.sleep(1000L);
  964. } catch (Exception _ex) {
  965. }
  966. while (true);
  967. }
  968.  
  969. public void drawHoverBox(int xPos, int yPos, String text) {
  970. String[] results = text.split("\n");
  971. int height = (results.length * 16) + 6;
  972. int width;
  973. width = smallText.getTextWidth(results[0]) + 6;
  974. for (int i = 1; i < results.length; i++)
  975. if (width <= smallText.getTextWidth(results[i]) + 6)
  976. width = smallText.getTextWidth(results[i]) + 6;
  977. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  978. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  979. yPos += 14;
  980. for (int i = 0; i < results.length; i++) {
  981. smallText.method389(false, xPos + 3, 0, results[i], yPos);
  982. yPos += 16;
  983. }
  984. }
  985.  
  986. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1) {
  987. if (class9.type != 0 || class9.children == null || class9.isMouseoverTriggered)
  988. return;
  989. if (k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  990. return;
  991. int k1 = class9.children.length;
  992. for (int l1 = 0; l1 < k1; l1++) {
  993. int i2 = class9.childX[l1] + i;
  994. int j2 = (class9.childY[l1] + l) - j1;
  995. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  996. i2 += class9_1.anInt263;
  997. j2 += class9_1.anInt265;
  998. if ((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2
  999. && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1000. if (class9_1.mOverInterToTrigger >= 0)
  1001. anInt886 = class9_1.mOverInterToTrigger;
  1002. else
  1003. anInt886 = class9_1.id;
  1004. if (class9_1.type == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1005. anInt1315 = class9_1.id;
  1006. }
  1007. if (class9_1.type == 0) {
  1008. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1009. drawOnBankInterface();
  1010. if (class9_1.scrollMax > class9_1.height)
  1011. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1012. } else {
  1013. if (class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width
  1014. && i1 < j2 + class9_1.height) {
  1015. boolean flag = false;
  1016. if (class9_1.contentType != 0)
  1017. flag = buildFriendsListMenu(class9_1);
  1018. if (!flag) {
  1019. // System.out.println("1"+class9_1.tooltip + ", " +
  1020. // class9_1.interfaceID);
  1021. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1022. menuActionID[menuActionRow] = 315;
  1023. menuActionCmd3[menuActionRow] = class9_1.id;
  1024. menuActionRow++;
  1025. }
  1026. }
  1027. if (class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width
  1028. && i1 < j2 + class9_1.height) {
  1029. String s = class9_1.selectedActionName;
  1030. if (s.indexOf(" ") != -1)
  1031. s = s.substring(0, s.indexOf(" "));
  1032. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1033. menuActionID[menuActionRow] = 626;
  1034. menuActionCmd3[menuActionRow] = class9_1.id;
  1035. menuActionRow++;
  1036. }
  1037. if (class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width
  1038. && i1 < j2 + class9_1.height) {
  1039. menuActionName[menuActionRow] = "Close";
  1040. menuActionID[menuActionRow] = 200;
  1041. menuActionCmd3[menuActionRow] = class9_1.id;
  1042. menuActionRow++;
  1043. }
  1044. if (class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width
  1045. && i1 < j2 + class9_1.height) {
  1046. // System.out.println("2"+class9_1.tooltip + ", " +
  1047. // class9_1.interfaceID);
  1048. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1049. menuActionID[menuActionRow] = 169;
  1050. menuActionCmd3[menuActionRow] = class9_1.id;
  1051. menuActionRow++;
  1052. if (class9_1.hoverText != null) {
  1053. // drawHoverBox(k, l, class9_1.hoverText);
  1054. // System.out.println("DRAWING INTERFACE: " +
  1055. // class9_1.hoverText);
  1056. }
  1057. }
  1058. if (class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width
  1059. && i1 < j2 + class9_1.height) {
  1060. // System.out.println("3"+class9_1.tooltip + ", " +
  1061. // class9_1.interfaceID);
  1062. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1063. menuActionID[menuActionRow] = 646;
  1064. menuActionCmd3[menuActionRow] = class9_1.id;
  1065. menuActionRow++;
  1066. }
  1067. if (class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width
  1068. && i1 < j2 + class9_1.height) {
  1069. // System.out.println("4"+class9_1.tooltip + ", " +
  1070. // class9_1.interfaceID);
  1071. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1072. menuActionID[menuActionRow] = 679;
  1073. menuActionCmd3[menuActionRow] = class9_1.id;
  1074. menuActionRow++;
  1075. }
  1076. if (class9_1.type == 2) {
  1077. int k2 = 0;
  1078. for (int l2 = 0; l2 < class9_1.height; l2++) {
  1079. for (int i3 = 0; i3 < class9_1.width; i3++) {
  1080. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1081. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1082. if (k2 < 20) {
  1083. j3 += class9_1.spritesX[k2];
  1084. k3 += class9_1.spritesY[k2];
  1085. }
  1086. if (k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32) {
  1087. mouseInvInterfaceIndex = k2;
  1088. lastActiveInvInterface = class9_1.id;
  1089. if (class9_1.inv[k2] > 0) {
  1090. ItemDef itemDef = ItemDef.forID(class9_1.inv[k2] - 1);
  1091. if (itemSelected == 1 && class9_1.isInventoryInterface) {
  1092. if (class9_1.id != anInt1284 || k2 != anInt1283) {
  1093. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@"
  1094. + itemDef.name;
  1095. menuActionID[menuActionRow] = 870;
  1096. menuActionCmd1[menuActionRow] = itemDef.id;
  1097. menuActionCmd2[menuActionRow] = k2;
  1098. menuActionCmd3[menuActionRow] = class9_1.id;
  1099. menuActionRow++;
  1100. }
  1101. } else if (spellSelected == 1 && class9_1.isInventoryInterface) {
  1102. if ((spellUsableOn & 0x10) == 16) {
  1103. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1104. menuActionID[menuActionRow] = 543;
  1105. menuActionCmd1[menuActionRow] = itemDef.id;
  1106. menuActionCmd2[menuActionRow] = k2;
  1107. menuActionCmd3[menuActionRow] = class9_1.id;
  1108. menuActionRow++;
  1109. }
  1110. } else {
  1111. if (class9_1.isInventoryInterface) {
  1112. for (int l3 = 4; l3 >= 3; l3--)
  1113. if (itemDef.actions != null && itemDef.actions[l3] != null) {
  1114. menuActionName[menuActionRow] = itemDef.actions[l3] + " @lre@"
  1115. + itemDef.name;
  1116. if (l3 == 3)
  1117. menuActionID[menuActionRow] = 493;
  1118. if (l3 == 4)
  1119. menuActionID[menuActionRow] = 847;
  1120. menuActionCmd1[menuActionRow] = itemDef.id;
  1121. menuActionCmd2[menuActionRow] = k2;
  1122. menuActionCmd3[menuActionRow] = class9_1.id;
  1123. menuActionRow++;
  1124. } else if (l3 == 4) {
  1125. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1126. menuActionID[menuActionRow] = 847;
  1127. menuActionCmd1[menuActionRow] = itemDef.id;
  1128. menuActionCmd2[menuActionRow] = k2;
  1129. menuActionCmd3[menuActionRow] = class9_1.id;
  1130. menuActionRow++;
  1131. }
  1132.  
  1133. }
  1134. if (class9_1.usableItemInterface) {
  1135. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1136. menuActionID[menuActionRow] = 447;
  1137. menuActionCmd1[menuActionRow] = itemDef.id;
  1138. // k2 = inventory spot
  1139. // System.out.println(k2);
  1140. menuActionCmd2[menuActionRow] = k2;
  1141. menuActionCmd3[menuActionRow] = class9_1.id;
  1142. menuActionRow++;
  1143. }
  1144. if (class9_1.isInventoryInterface && itemDef.actions != null) {
  1145. for (int i4 = 2; i4 >= 0; i4--)
  1146. if (itemDef.actions[i4] != null) {
  1147. menuActionName[menuActionRow] = itemDef.actions[i4] + " @lre@"
  1148. + itemDef.name;
  1149. if (i4 == 0)
  1150. menuActionID[menuActionRow] = 74;
  1151. if (i4 == 1)
  1152. menuActionID[menuActionRow] = 454;
  1153. if (i4 == 2)
  1154. menuActionID[menuActionRow] = 539;
  1155. menuActionCmd1[menuActionRow] = itemDef.id;
  1156. menuActionCmd2[menuActionRow] = k2;
  1157. menuActionCmd3[menuActionRow] = class9_1.id;
  1158. menuActionRow++;
  1159. }
  1160.  
  1161. }
  1162. if (class9_1.actions != null) {
  1163. for (int j4 = 4; j4 >= 0; j4--)
  1164. if (class9_1.actions[j4] != null) {
  1165. menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@"
  1166. + itemDef.name;
  1167. if (j4 == 0)
  1168. menuActionID[menuActionRow] = 632;
  1169. if (j4 == 1)
  1170. menuActionID[menuActionRow] = 78;
  1171. if (j4 == 2)
  1172. menuActionID[menuActionRow] = 867;
  1173. if (j4 == 3)
  1174. menuActionID[menuActionRow] = 431;
  1175. if (j4 == 4)
  1176. menuActionID[menuActionRow] = 53;
  1177. menuActionCmd1[menuActionRow] = itemDef.id;
  1178. menuActionCmd2[menuActionRow] = k2;
  1179. menuActionCmd3[menuActionRow] = class9_1.id;
  1180. menuActionRow++;
  1181. }
  1182.  
  1183. }
  1184. // menuActionName[menuActionRow] =
  1185. // "Examine @lre@" + itemDef.name + "
  1186. // @gre@(@whi@" + (class9_1.inv[k2] - 1)
  1187. // + "@gre@)";
  1188. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1189. menuActionID[menuActionRow] = 1125;
  1190. menuActionCmd1[menuActionRow] = itemDef.id;
  1191. menuActionCmd2[menuActionRow] = k2;
  1192. menuActionCmd3[menuActionRow] = class9_1.id;
  1193. menuActionRow++;
  1194. }
  1195. }
  1196. }
  1197. k2++;
  1198. }
  1199.  
  1200. }
  1201.  
  1202. }
  1203. }
  1204. }
  1205.  
  1206. }
  1207.  
  1208. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1209. scrollBar1.drawSprite(i1, l);
  1210. scrollBar2.drawSprite(i1, (l + j) - 16);
  1211. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1212. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1213. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1214. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1215. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1216. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1217. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1218. int k1 = ((j - 32) * j) / j1;
  1219. if (k1 < 8)
  1220. k1 = 8;
  1221. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1222. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1223. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1224. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1225. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1226. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1227. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1228. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1229. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1230. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1231. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1232. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1233. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1234. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1235. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1236. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1237. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1238. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1239. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1240. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1241. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1242. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1243. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1244. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1245. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1246. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1247. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1248. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1249. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1250. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1251. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1252. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1253. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1254. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1255. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1256. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1257. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1258. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1259. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1260. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1261. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1262. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1263. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1264. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1265. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1266. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1267. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1268. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1269. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1270. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1271. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1272. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1273. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1274. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1275. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1276. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1277. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1278. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1279. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1280. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1281. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1282. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1283. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1284. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1285. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1286. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1287. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1288. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1289. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1290. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1291. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1292. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1293. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1294. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1295. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1296. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1297. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1298. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1299. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1300. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1301. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1302. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1303. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1304. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1305. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1306. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1307. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1308. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1309. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1310. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1311. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1312. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1313. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1314. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1315. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1316. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1317. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1318. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1319. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1320. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1321. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1322. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1323. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1324. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1325. }
  1326.  
  1327. private void updateNPCs(Stream stream, int i) {
  1328. anInt839 = 0;
  1329. anInt893 = 0;
  1330. method139(stream);
  1331. method46(i, stream);
  1332. method86(stream);
  1333. for (int k = 0; k < anInt839; k++) {
  1334. int l = anIntArray840[k];
  1335. if (npcArray[l].anInt1537 != loopCycle) {
  1336. npcArray[l].desc = null;
  1337. npcArray[l] = null;
  1338. }
  1339. }
  1340.  
  1341. if (stream.currentOffset != i) {
  1342. signlink.reporterror(
  1343. myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1344. throw new RuntimeException("eek");
  1345. }
  1346. for (int i1 = 0; i1 < npcCount; i1++)
  1347. if (npcArray[npcIndices[i1]] == null) {
  1348. signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1349. throw new RuntimeException("eek");
  1350. }
  1351.  
  1352. }
  1353.  
  1354. private int cButtonHPos;
  1355. private int cButtonHCPos;
  1356. private int cButtonCPos;
  1357.  
  1358. private void processChatModeClick() {
  1359. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  1360. cButtonHPos = 0;
  1361. aBoolean1233 = true;
  1362. inputTaken = true;
  1363. } else if (super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  1364. cButtonHPos = 1;
  1365. aBoolean1233 = true;
  1366. inputTaken = true;
  1367. } else if (super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  1368. cButtonHPos = 2;
  1369. aBoolean1233 = true;
  1370. inputTaken = true;
  1371. } else if (super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  1372. cButtonHPos = 3;
  1373. aBoolean1233 = true;
  1374. inputTaken = true;
  1375. } else if (super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  1376. cButtonHPos = 4;
  1377. aBoolean1233 = true;
  1378. inputTaken = true;
  1379. } else if (super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  1380. cButtonHPos = 5;
  1381. aBoolean1233 = true;
  1382. inputTaken = true;
  1383. } else if (super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= 482 && super.mouseY <= 503) {
  1384. cButtonHPos = 6;
  1385. aBoolean1233 = true;
  1386. inputTaken = true;
  1387. } else {
  1388. cButtonHPos = -1;
  1389. aBoolean1233 = true;
  1390. inputTaken = true;
  1391. }
  1392. if (super.clickMode3 == 1) {
  1393. if (super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1394. cButtonCPos = 0;
  1395. chatTypeView = 0;
  1396. aBoolean1233 = true;
  1397. inputTaken = true;
  1398. } else if (super.saveClickX >= 71 && super.saveClickX <= 127 && super.saveClickY >= 482
  1399. && super.saveClickY <= 505) {
  1400. cButtonCPos = 1;
  1401. chatTypeView = 5;
  1402. aBoolean1233 = true;
  1403. inputTaken = true;
  1404. } else if (super.saveClickX >= 137 && super.saveClickX <= 193 && super.saveClickY >= 482
  1405. && super.saveClickY <= 505) {
  1406. cButtonCPos = 2;
  1407. chatTypeView = 1;
  1408. aBoolean1233 = true;
  1409. inputTaken = true;
  1410. } else if (super.saveClickX >= 203 && super.saveClickX <= 259 && super.saveClickY >= 482
  1411. && super.saveClickY <= 505) {
  1412. cButtonCPos = 3;
  1413. chatTypeView = 2;
  1414. aBoolean1233 = true;
  1415. inputTaken = true;
  1416. } else if (super.saveClickX >= 269 && super.saveClickX <= 325 && super.saveClickY >= 482
  1417. && super.saveClickY <= 505) {
  1418. cButtonCPos = 4;
  1419. chatTypeView = 11;
  1420. aBoolean1233 = true;
  1421. inputTaken = true;
  1422. } else if (super.saveClickX >= 335 && super.saveClickX <= 391 && super.saveClickY >= 482
  1423. && super.saveClickY <= 505) {
  1424. cButtonCPos = 5;
  1425. chatTypeView = 3;
  1426. aBoolean1233 = true;
  1427. inputTaken = true;
  1428. } else if (super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482
  1429. && super.saveClickY <= 505) {
  1430. if (openInterfaceID == -1) {
  1431. clearTopInterfaces();
  1432. reportAbuseInput = "";
  1433. canMute = false;
  1434. for (int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1435. if (RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  1436. continue;
  1437. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1438. break;
  1439. }
  1440. } else {
  1441. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1442. }
  1443. }
  1444. }
  1445. }
  1446.  
  1447. private void method33(int i) {
  1448. int j = Varp.cache[i].anInt709;
  1449. if (j == 0)
  1450. return;
  1451. int k = variousSettings[i];
  1452. if (j == 1) {
  1453. if (k == 1)
  1454. Texture.method372(0.90000000000000002D);
  1455. if (k == 2)
  1456. Texture.method372(0.80000000000000004D);
  1457. if (k == 3)
  1458. Texture.method372(0.69999999999999996D);
  1459. if (k == 4)
  1460. Texture.method372(0.59999999999999998D);
  1461. ItemDef.mruNodes1.unlinkAll();
  1462. welcomeScreenRaised = true;
  1463. }
  1464. if (j == 3) {
  1465. boolean flag1 = musicEnabled;
  1466. if (k == 0) {
  1467. adjustVolume(musicEnabled, 0);
  1468. musicEnabled = true;
  1469. }
  1470. if (k == 1) {
  1471. adjustVolume(musicEnabled, -400);
  1472. musicEnabled = true;
  1473. }
  1474. if (k == 2) {
  1475. adjustVolume(musicEnabled, -800);
  1476. musicEnabled = true;
  1477. }
  1478. if (k == 3) {
  1479. adjustVolume(musicEnabled, -1200);
  1480. musicEnabled = true;
  1481. }
  1482. if (k == 4)
  1483. musicEnabled = false;
  1484. if (musicEnabled != flag1 && !lowMem) {
  1485. if (musicEnabled) {
  1486. nextSong = currentSong;
  1487. songChanging = true;
  1488. onDemandFetcher.method558(2, nextSong);
  1489. } else {
  1490. stopMidi();
  1491. }
  1492. prevSong = 0;
  1493. }
  1494. }
  1495. if (j == 4) {
  1496. if (k == 0) {
  1497. aBoolean848 = true;
  1498. setWaveVolume(0);
  1499. }
  1500. if (k == 1) {
  1501. aBoolean848 = true;
  1502. setWaveVolume(-400);
  1503. }
  1504. if (k == 2) {
  1505. aBoolean848 = true;
  1506. setWaveVolume(-800);
  1507. }
  1508. if (k == 3) {
  1509. aBoolean848 = true;
  1510. setWaveVolume(-1200);
  1511. }
  1512. if (k == 4)
  1513. aBoolean848 = false;
  1514. }
  1515. if (j == 5)
  1516. anInt1253 = k;
  1517. if (j == 6)
  1518. anInt1249 = k;
  1519. if (j == 8) {
  1520. splitPrivateChat = k;
  1521. inputTaken = true;
  1522. }
  1523. if (j == 9)
  1524. anInt913 = k;
  1525. }
  1526.  
  1527. private Sprite HPBarFull;
  1528. private Sprite HPBarEmpty;
  1529.  
  1530. private void updateEntities() {
  1531. try {
  1532. int anInt974 = 0;
  1533. for (int j = -1; j < playerCount + npcCount; j++) {
  1534. Object obj;
  1535. if (j == -1)
  1536. obj = myPlayer;
  1537. else if (j < playerCount)
  1538. obj = playerArray[playerIndices[j]];
  1539. else
  1540. obj = npcArray[npcIndices[j - playerCount]];
  1541. if (obj == null || !((Entity) (obj)).isVisible())
  1542. continue;
  1543. if (obj instanceof NPC) {
  1544. EntityDef entityDef = ((NPC) obj).desc;
  1545. if (entityDef.childrenIDs != null)
  1546. entityDef = entityDef.method161();
  1547. if (entityDef == null)
  1548. continue;
  1549. }
  1550. if (j < playerCount) {
  1551. int l = 30;
  1552. Player player = (Player) obj;
  1553. if (player.headIcon >= 0) {
  1554. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1555. if (spriteDrawX > -1) {
  1556. if (player.skullIcon < 2) {
  1557. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1558. l += 25;
  1559. }
  1560. if (player.headIcon < 7) {
  1561. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1562. l += 18;
  1563. }
  1564. }
  1565. }
  1566. if (j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  1567. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1568. if (spriteDrawX > -1)
  1569. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1570. }
  1571. } else {
  1572. EntityDef entityDef_1 = ((NPC) obj).desc;
  1573. if (entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  1574. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1575. if (spriteDrawX > -1)
  1576. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  1577. }
  1578. if (anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  1579. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1580. if (spriteDrawX > -1)
  1581. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  1582. }
  1583. }
  1584. if (((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0
  1585. || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player) obj).name))) {
  1586. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  1587. if (spriteDrawX > -1 && anInt974 < anInt975) {
  1588. anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
  1589. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  1590. anIntArray976[anInt974] = spriteDrawX;
  1591. anIntArray977[anInt974] = spriteDrawY;
  1592. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  1593. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  1594. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  1595. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  1596. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3) {
  1597. anIntArray978[anInt974] += 10;
  1598. anIntArray977[anInt974] += 5;
  1599. }
  1600. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  1601. anIntArray979[anInt974] = 60;
  1602. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  1603. anIntArray978[anInt974] += 5;
  1604. }
  1605. }
  1606. if (((Entity) (obj)).loopCycleStatus > loopCycle) {
  1607. try {
  1608. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1609. if (spriteDrawX > -1) {
  1610. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  1611. if (i1 > 30) {
  1612. i1 = 30;
  1613. }
  1614. int HpPercent = (((Entity) (obj)).currentHealth * 56) / ((Entity) (obj)).maxHealth;
  1615. if (HpPercent > 56) {
  1616. HpPercent = 56;
  1617. }
  1618. HPBarEmpty.drawSprite(spriteDrawX - 28, spriteDrawY - 5);// 3
  1619. HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/HP 0.PNG", HpPercent,
  1620. 7);
  1621. HPBarFull.drawSprite(spriteDrawX - 28, spriteDrawY - 5);
  1622. }
  1623. } catch (Exception e) {
  1624. }
  1625. }
  1626. for (int j1 = 0; j1 < 4; j1++)
  1627. if (((Entity) (obj)).hitsLoopCycle[j1] > loopCycle) {
  1628. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  1629. if (spriteDrawX > -1) {
  1630. if (j1 == 1)
  1631. spriteDrawY -= 20;
  1632. if (j1 == 2) {
  1633. spriteDrawX -= 15;
  1634. spriteDrawY -= 10;
  1635. }
  1636. if (j1 == 3) {
  1637. spriteDrawX += 15;
  1638. spriteDrawY -= 10;
  1639. }
  1640. if (((Entity) (obj)).hitArray[j1] == 0 || ((Entity) (obj)).hitMarkTypes[j1] == 3)
  1641. hitMark[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12,
  1642. spriteDrawY - 12);
  1643. else {
  1644. hitMark[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12,
  1645. spriteDrawY - 12);
  1646. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4,
  1647. spriteDrawX);
  1648. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]),
  1649. spriteDrawY + 3, spriteDrawX - 1);
  1650. }
  1651. }
  1652. }
  1653. }
  1654. for (int k = 0; k < anInt974; k++) {
  1655. int k1 = anIntArray976[k];
  1656. int l1 = anIntArray977[k];
  1657. int j2 = anIntArray979[k];
  1658. int k2 = anIntArray978[k];
  1659. boolean flag = true;
  1660. while (flag) {
  1661. flag = false;
  1662. for (int l2 = 0; l2 < k; l2++)
  1663. if (l1 + 2 > anIntArray977[l2] - anIntArray978[l2] && l1 - k2 < anIntArray977[l2] + 2
  1664. && k1 - j2 < anIntArray976[l2] + anIntArray979[l2]
  1665. && k1 + j2 > anIntArray976[l2] - anIntArray979[l2]
  1666. && anIntArray977[l2] - anIntArray978[l2] < l1) {
  1667. l1 = anIntArray977[l2] - anIntArray978[l2];
  1668. flag = true;
  1669. }
  1670.  
  1671. }
  1672. spriteDrawX = anIntArray976[k];
  1673. spriteDrawY = anIntArray977[k] = l1;
  1674. String s = aStringArray983[k];
  1675. if (anInt1249 == 0) {
  1676. int i3 = 0xffff00;
  1677. if (anIntArray980[k] < 6)
  1678. i3 = anIntArray965[anIntArray980[k]];
  1679. if (anIntArray980[k] == 6)
  1680. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  1681. if (anIntArray980[k] == 7)
  1682. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  1683. if (anIntArray980[k] == 8)
  1684. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  1685. if (anIntArray980[k] == 9) {
  1686. int j3 = 150 - anIntArray982[k];
  1687. if (j3 < 50)
  1688. i3 = 0xff0000 + 1280 * j3;
  1689. else if (j3 < 100)
  1690. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  1691. else if (j3 < 150)
  1692. i3 = 65280 + 5 * (j3 - 100);
  1693. }
  1694. if (anIntArray980[k] == 10) {
  1695. int k3 = 150 - anIntArray982[k];
  1696. if (k3 < 50)
  1697. i3 = 0xff0000 + 5 * k3;
  1698. else if (k3 < 100)
  1699. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  1700. else if (k3 < 150)
  1701. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  1702. }
  1703. if (anIntArray980[k] == 11) {
  1704. int l3 = 150 - anIntArray982[k];
  1705. if (l3 < 50)
  1706. i3 = 0xffffff - 0x50005 * l3;
  1707. else if (l3 < 100)
  1708. i3 = 65280 + 0x50005 * (l3 - 50);
  1709. else if (l3 < 150)
  1710. i3 = 0xffffff - 0x50000 * (l3 - 100);
  1711. }
  1712. if (anIntArray981[k] == 0) {
  1713. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1714. chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  1715. }
  1716. if (anIntArray981[k] == 1) {
  1717. chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  1718. chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  1719. }
  1720. if (anIntArray981[k] == 2) {
  1721. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  1722. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  1723. }
  1724. if (anIntArray981[k] == 3) {
  1725. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1,
  1726. spriteDrawX, 0);
  1727. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX,
  1728. i3);
  1729. }
  1730. if (anIntArray981[k] == 4) {
  1731. int i4 = chatTextDrawingArea.method384(s);
  1732. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  1733. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  1734. chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  1735. chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  1736. DrawingArea.defaultDrawingAreaSize();
  1737. }
  1738. if (anIntArray981[k] == 5) {
  1739. int j4 = 150 - anIntArray982[k];
  1740. int l4 = 0;
  1741. if (j4 < 25)
  1742. l4 = j4 - 25;
  1743. else if (j4 > 125)
  1744. l4 = j4 - 125;
  1745. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512,
  1746. spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  1747. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  1748. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  1749. DrawingArea.defaultDrawingAreaSize();
  1750. }
  1751. } else {
  1752. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1753. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  1754. }
  1755. }
  1756. } catch (Exception e) {
  1757. }
  1758. }
  1759.  
  1760. private void delFriend(long l) {
  1761. try {
  1762. if (l == 0L)
  1763. return;
  1764. for (int i = 0; i < friendsCount; i++) {
  1765. if (friendsListAsLongs[i] != l)
  1766. continue;
  1767. friendsCount--;
  1768. needDrawTabArea = true;
  1769. for (int j = i; j < friendsCount; j++) {
  1770. friendsList[j] = friendsList[j + 1];
  1771. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  1772. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  1773. }
  1774.  
  1775. stream.createFrame(215);
  1776. stream.writeQWord(l);
  1777. break;
  1778. }
  1779. } catch (RuntimeException runtimeexception) {
  1780. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  1781. throw new RuntimeException();
  1782. }
  1783. }
  1784.  
  1785. public void drawSideIcons() {
  1786. /* Top sideIcons */
  1787. if (tabInterfaceIDs[0] != -1)// attack
  1788. sideIcons[0].drawSprite(10, 4);
  1789. if (tabInterfaceIDs[1] != -1)// stat
  1790. sideIcons[1].drawSprite(43, 4);
  1791. if (tabInterfaceIDs[2] != -1)// quest
  1792. sideIcons[2].drawSprite(76, 3);
  1793. if (tabInterfaceIDs[3] != -1)// inventory
  1794. sideIcons[3].drawSprite(111, 5);
  1795. if (tabInterfaceIDs[4] != -1)// equipment
  1796. sideIcons[4].drawSprite(140, 1);
  1797. if (tabInterfaceIDs[5] != -1)// prayer
  1798. sideIcons[5].drawSprite(174, 1);
  1799. if (tabInterfaceIDs[6] != -1)// magic
  1800. sideIcons[6].drawSprite(208, 4);
  1801. /* Bottom sideIcons */
  1802. if (tabInterfaceIDs[7] != -1)// clan
  1803. sideIcons[7].drawSprite(11, 303);
  1804. if (tabInterfaceIDs[8] != -1)// friends
  1805. sideIcons[8].drawSprite(46, 306);
  1806. if (tabInterfaceIDs[9] != -1)// ignore
  1807. sideIcons[9].drawSprite(79, 306);
  1808. if (tabInterfaceIDs[10] != -1)// options
  1809. sideIcons[10].drawSprite(113, 302);
  1810. if (tabInterfaceIDs[11] != -1)// options
  1811. sideIcons[11].drawSprite(145, 304);
  1812. if (tabInterfaceIDs[12] != -1)// emotes
  1813. sideIcons[12].drawSprite(181, 302);
  1814. if (tabInterfaceIDs[13] != -1)// musicL
  1815. sideIcons[13].drawSprite(213, 303);
  1816. }
  1817.  
  1818. public void drawRedStones() {
  1819. if (tabInterfaceIDs[tabID] != -1) {
  1820. switch (tabID) {
  1821. case 0:
  1822. redStones[0].drawSprite(3, 0);
  1823. break;
  1824. case 1:
  1825. redStones[4].drawSprite(41, 0);
  1826. break;
  1827. case 2:
  1828. redStones[4].drawSprite(74, 0);
  1829. break;
  1830. case 3:
  1831. redStones[4].drawSprite(107, 0);
  1832. break;
  1833. case 4:
  1834. redStones[4].drawSprite(140, 0);
  1835. break;
  1836. case 5:
  1837. redStones[4].drawSprite(173, 0);
  1838. break;
  1839. case 6:
  1840. redStones[1].drawSprite(206, 0);
  1841. break;
  1842. case 7:
  1843. redStones[2].drawSprite(3, 298);
  1844. break;
  1845. case 8:
  1846. redStones[4].drawSprite(41, 298);
  1847. break;
  1848. case 9:
  1849. redStones[4].drawSprite(74, 298);
  1850. break;
  1851. case 10:
  1852. redStones[4].drawSprite(107, 298);
  1853. break;
  1854. case 11:
  1855. redStones[4].drawSprite(140, 298);
  1856. break;
  1857. case 12:
  1858. redStones[4].drawSprite(173, 298);
  1859. break;
  1860. case 13:
  1861. redStones[4].drawSprite(206, 298);
  1862. break;
  1863. }
  1864. }
  1865. }
  1866.  
  1867. private void drawTabArea() {
  1868. aGraphicsBuffer_1163.setCanvas();
  1869. Texture.anIntArray1472 = anIntArray1181;
  1870. tabArea.drawSprite(0, 0);
  1871. if (invOverlayInterfaceID == -1) {
  1872. drawRedStones();
  1873. drawSideIcons();
  1874. }
  1875. if (invOverlayInterfaceID != -1)
  1876. drawInterface(0, 28, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  1877. else if (tabInterfaceIDs[tabID] != -1)
  1878. drawInterface(0, 28, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  1879. if (menuOpen && menuScreenArea == 1)
  1880. drawMenu();
  1881. aGraphicsBuffer_1163.drawGraphics(168, super.graphics, 519);
  1882. aGraphicsBuffer_1165.setCanvas();
  1883. Texture.anIntArray1472 = anIntArray1182;
  1884. }
  1885.  
  1886. private void method37(int j) {
  1887. if (!lowMem) {
  1888. if (Texture.anIntArray1480[17] >= j) {
  1889. Background background = Texture.aBackgroundArray1474s[17];
  1890. int k = background.anInt1452 * background.anInt1453 - 1;
  1891. // fire cape apparently?
  1892. int j1 = background.anInt1452 * anInt945 * 2;
  1893. byte abyte0[] = background.aByteArray1450;
  1894. byte abyte3[] = aByteArray912;
  1895. for (int i2 = 0; i2 <= k; i2++)
  1896. abyte3[i2] = abyte0[i2 - j1 & k];
  1897.  
  1898. background.aByteArray1450 = abyte3;
  1899. aByteArray912 = abyte0;
  1900. Texture.method370(17);
  1901. anInt854++;
  1902. if (anInt854 > 1235) {
  1903. anInt854 = 0;
  1904. stream.createFrame(226);
  1905. stream.writeWordBigEndian(0);
  1906. int l2 = stream.currentOffset;
  1907. stream.writeWord(58722);
  1908. stream.writeWordBigEndian(240);
  1909. stream.writeWord((int) (Math.random() * 65536D));
  1910. stream.writeWordBigEndian((int) (Math.random() * 256D));
  1911. if ((int) (Math.random() * 2D) == 0)
  1912. stream.writeWord(51825);
  1913. stream.writeWordBigEndian((int) (Math.random() * 256D));
  1914. stream.writeWord((int) (Math.random() * 65536D));
  1915. stream.writeWord(7130);
  1916. stream.writeWord((int) (Math.random() * 65536D));
  1917. stream.writeWord(61657);
  1918. stream.writeBytes(stream.currentOffset - l2);
  1919. }
  1920. }
  1921. if (Texture.anIntArray1480[24] >= j) {
  1922. Background background_1 = Texture.aBackgroundArray1474s[24];
  1923. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  1924. int k1 = background_1.anInt1452 * anInt945 * 2;
  1925. byte abyte1[] = background_1.aByteArray1450;
  1926. byte abyte4[] = aByteArray912;
  1927. for (int j2 = 0; j2 <= l; j2++)
  1928. abyte4[j2] = abyte1[j2 - k1 & l];
  1929.  
  1930. background_1.aByteArray1450 = abyte4;
  1931. aByteArray912 = abyte1;
  1932. Texture.method370(24);
  1933. }
  1934. if (Texture.anIntArray1480[34] >= j) {
  1935. Background background_2 = Texture.aBackgroundArray1474s[34];
  1936. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  1937. int l1 = background_2.anInt1452 * anInt945 * 2;
  1938. byte abyte2[] = background_2.aByteArray1450;
  1939. byte abyte5[] = aByteArray912;
  1940. for (int k2 = 0; k2 <= i1; k2++)
  1941. abyte5[k2] = abyte2[k2 - l1 & i1];
  1942.  
  1943. background_2.aByteArray1450 = abyte5;
  1944. aByteArray912 = abyte2;
  1945. Texture.method370(34);
  1946. }
  1947. if (Texture.anIntArray1480[40] >= j) {
  1948. Background background_2 = Texture.aBackgroundArray1474s[40];
  1949. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  1950. int l1 = background_2.anInt1452 * anInt945 * 2;
  1951. byte abyte2[] = background_2.aByteArray1450;
  1952. byte abyte5[] = aByteArray912;
  1953. for (int k2 = 0; k2 <= i1; k2++)
  1954. abyte5[k2] = abyte2[k2 - l1 & i1];
  1955.  
  1956. background_2.aByteArray1450 = abyte5;
  1957. aByteArray912 = abyte2;
  1958. Texture.method370(40);
  1959. }
  1960. }
  1961. }
  1962.  
  1963. private void method38() {
  1964. for (int i = -1; i < playerCount; i++) {
  1965. int j;
  1966. if (i == -1)
  1967. j = myPlayerIndex;
  1968. else
  1969. j = playerIndices[i];
  1970. Player player = playerArray[j];
  1971. if (player != null && player.textCycle > 0) {
  1972. player.textCycle--;
  1973. if (player.textCycle == 0)
  1974. player.textSpoken = null;
  1975. }
  1976. }
  1977. for (int k = 0; k < npcCount; k++) {
  1978. int l = npcIndices[k];
  1979. NPC npc = npcArray[l];
  1980. if (npc != null && npc.textCycle > 0) {
  1981. npc.textCycle--;
  1982. if (npc.textCycle == 0)
  1983. npc.textSpoken = null;
  1984. }
  1985. }
  1986. }
  1987.  
  1988. public void calcCameraPos() {
  1989. int i = this.anInt1098 * 128 + 64;
  1990. int j = this.anInt1099 * 128 + 64;
  1991. int k = method42(this.plane, j, i) - this.anInt1100;
  1992. if (this.xCameraPos < i) {
  1993. this.xCameraPos += this.anInt1101 + (i - this.xCameraPos) * this.anInt1102 / 1000;
  1994. if (this.xCameraPos > i) {
  1995. this.xCameraPos = i;
  1996. }
  1997. }
  1998. if (this.xCameraPos > i) {
  1999. this.xCameraPos -= this.anInt1101 + (this.xCameraPos - i) * this.anInt1102 / 1000;
  2000. if (this.xCameraPos < i) {
  2001. this.xCameraPos = i;
  2002. }
  2003. }
  2004. if (this.zCameraPos < k) {
  2005. this.zCameraPos += this.anInt1101 + (k - this.zCameraPos) * this.anInt1102 / 1000;
  2006. if (this.zCameraPos > k) {
  2007. this.zCameraPos = k;
  2008. }
  2009. }
  2010. if (this.zCameraPos > k) {
  2011. this.zCameraPos -= this.anInt1101 + (this.zCameraPos - k) * this.anInt1102 / 1000;
  2012. if (this.zCameraPos < k) {
  2013. this.zCameraPos = k;
  2014. }
  2015. }
  2016. if (this.yCameraPos < j) {
  2017. this.yCameraPos += this.anInt1101 + (j - this.yCameraPos) * this.anInt1102 / 1000;
  2018. if (this.yCameraPos > j) {
  2019. this.yCameraPos = j;
  2020. }
  2021. }
  2022. if (this.yCameraPos > j) {
  2023. this.yCameraPos -= this.anInt1101 + (this.yCameraPos - j) * this.anInt1102 / 1000;
  2024. if (this.yCameraPos < j) {
  2025. this.yCameraPos = j;
  2026. }
  2027. }
  2028. i = this.anInt995 * 128 + 64;
  2029. j = this.anInt996 * 128 + 64;
  2030. k = method42(this.plane, j, i) - this.anInt997;
  2031. int l = i - this.xCameraPos;
  2032. int i1 = k - this.zCameraPos;
  2033. int j1 = j - this.yCameraPos;
  2034. int k1 = (int) Math.sqrt(l * l + j1 * j1);
  2035. int l1 = (int) (Math.atan2(i1, k1) * 325.949D) & 0x7FF;
  2036. int i2 = (int) (Math.atan2(l, j1) * -325.949D) & 0x7FF;
  2037. if (l1 < 128) {
  2038. l1 = 128;
  2039. }
  2040. if (l1 > 383) {
  2041. l1 = 383;
  2042. }
  2043. if (this.yCameraCurve < l1) {
  2044. this.yCameraCurve += this.anInt998 + (l1 - this.yCameraCurve) * this.anInt999 / 1000;
  2045. if (this.yCameraCurve > l1) {
  2046. this.yCameraCurve = l1;
  2047. }
  2048. }
  2049. if (this.yCameraCurve > l1) {
  2050. this.yCameraCurve -= this.anInt998 + (this.yCameraCurve - l1) * this.anInt999 / 1000;
  2051. if (this.yCameraCurve < l1) {
  2052. this.yCameraCurve = l1;
  2053. }
  2054. }
  2055. int j2 = i2 - this.xCameraCurve;
  2056. if (j2 > 1024) {
  2057. j2 -= 2048;
  2058. }
  2059. if (j2 < 64512) {
  2060. j2 += 2048;
  2061. }
  2062. if (j2 > 0) {
  2063. this.xCameraCurve += this.anInt998 + j2 * this.anInt999 / 1000;
  2064. this.xCameraCurve &= 0x7FF;
  2065. }
  2066. if (j2 < 0) {
  2067. this.xCameraCurve -= this.anInt998 + -j2 * this.anInt999 / 1000;
  2068. this.xCameraCurve &= 0x7FF;
  2069. }
  2070. int k2 = i2 - this.xCameraCurve;
  2071. if (k2 > 1024) {
  2072. k2 -= 2048;
  2073. }
  2074. if (k2 < 64512) {
  2075. k2 += 2048;
  2076. }
  2077. if (((k2 < 0) && (j2 > 0)) || ((k2 > 0) && (j2 < 0))) {
  2078. this.xCameraCurve = i2;
  2079. }
  2080. }
  2081.  
  2082. private void drawMenu() {
  2083. int i = menuOffsetX;
  2084. int j = menuOffsetY;
  2085. int k = menuWidth;
  2086. int l = menuHeight + 1;
  2087. int i1 = 0x5d5447;
  2088. // DrawingArea.drawPixels(height, yPos, xPos, color, width);
  2089. // DrawingArea.fillPixels(xPos, width, height, color, yPos);
  2090. DrawingArea.drawPixels(l, j, i, i1, k);
  2091. DrawingArea.drawPixels(16, j + 1, i + 1, 0, k - 2);
  2092. DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
  2093. chatTextDrawingArea.method385(i1, "Choose Option", j + 14, i + 3);
  2094. int j1 = super.mouseX;
  2095. int k1 = super.mouseY;
  2096. if (menuScreenArea == 0) {
  2097. j1 -= 4;
  2098. k1 -= 4;
  2099. }
  2100. if (menuScreenArea == 1) {
  2101. j1 -= 519;
  2102. k1 -= 168;
  2103. }
  2104. if (menuScreenArea == 2) {
  2105. j1 -= 17;
  2106. k1 -= 338;
  2107. }
  2108. if (menuScreenArea == 3) {
  2109. j1 -= 519;
  2110. k1 -= 0;
  2111. }
  2112. for (int l1 = 0; l1 < menuActionRow; l1++) {
  2113. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2114. int j2 = 0xffffff;
  2115. if (j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  2116. j2 = 0xffff00;
  2117. chatTextDrawingArea.method389(true, i + 3, j2, menuActionName[l1], i2);
  2118. }
  2119. }
  2120.  
  2121. private void addFriend(long l) {
  2122. try {
  2123. if (l == 0L)
  2124. return;
  2125. if (friendsCount >= 100 && anInt1046 != 1) {
  2126. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2127. return;
  2128. }
  2129. if (friendsCount >= 200) {
  2130. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2131. return;
  2132. }
  2133. String s = TextClass.fixName(TextClass.nameForLong(l));
  2134. for (int i = 0; i < friendsCount; i++)
  2135. if (friendsListAsLongs[i] == l) {
  2136. pushMessage(s + " is already on your friend list", 0, "");
  2137. return;
  2138. }
  2139. for (int j = 0; j < ignoreCount; j++)
  2140. if (ignoreListAsLongs[j] == l) {
  2141. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  2142. return;
  2143. }
  2144.  
  2145. if (s.equals(myPlayer.name)) {
  2146. return;
  2147. } else {
  2148. friendsList[friendsCount] = s;
  2149. friendsListAsLongs[friendsCount] = l;
  2150. friendsNodeIDs[friendsCount] = 0;
  2151. friendsCount++;
  2152. needDrawTabArea = true;
  2153. stream.createFrame(188);
  2154. stream.writeQWord(l);
  2155. return;
  2156. }
  2157. } catch (RuntimeException runtimeexception) {
  2158. signlink.reporterror("15283, " + (byte) 68 + ", " + l + ", " + runtimeexception.toString());
  2159. }
  2160. throw new RuntimeException();
  2161. }
  2162.  
  2163. private int method42(int i, int j, int k) {
  2164. int l = k >> 7;
  2165. int i1 = j >> 7;
  2166. if (l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2167. return 0;
  2168. int j1 = i;
  2169. if (j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2170. j1++;
  2171. int k1 = k & 0x7f;
  2172. int l1 = j & 0x7f;
  2173. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2174. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2175. return i2 * (128 - l1) + j2 * l1 >> 7;
  2176. }
  2177.  
  2178. private static String intToKOrMil(int j) {
  2179. if (j < 0x186a0)
  2180. return String.valueOf(j);
  2181. if (j < 0x989680)
  2182. return j / 1000 + "K";
  2183. else
  2184. return j / 0xf4240 + "M";
  2185. }
  2186.  
  2187. public int canWalkDelay = 0;
  2188.  
  2189. public int getDis(int coordX1, int coordY1, int coordX2, int coordY2) {
  2190. int deltaX = coordX2 - coordX1;
  2191. int deltaY = coordY2 - coordY1;
  2192. return ((int) Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2)));
  2193. }
  2194.  
  2195. public int random(int range) {
  2196. return (int) (Math.random() * range);
  2197. }
  2198.  
  2199. public boolean withinDistance(int x1, int y1, int x2, int y2, int dis) {
  2200. for (int i = 0; i <= dis; i++) {
  2201. try {
  2202. if ((x1 + i) == x2 && ((y1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  2203. return true;
  2204. else if ((x1 - i) == x2 && ((x1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  2205. return true;
  2206. else if (x1 == x2 && ((x1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  2207. return true;
  2208. } catch (Exception ex) {
  2209. System.out.println("Exception in following, method : WithingDistance");
  2210. }
  2211. }
  2212. return false;
  2213. }
  2214.  
  2215. private void resetLogout() {
  2216. followPlayer = 0;
  2217. followNPC = 0;
  2218. followDistance = 1;
  2219. try {
  2220. if (socketStream != null)
  2221. socketStream.close();
  2222. } catch (Exception _ex) {
  2223. }
  2224. socketStream = null;
  2225. loggedIn = false;
  2226. loginScreenState = 0;
  2227. // myUsername = "";
  2228. // myPassword = "";
  2229. unlinkMRUNodes();
  2230. worldController.initToNull();
  2231. for (int i = 0; i < 4; i++)
  2232. aClass11Array1230[i].method210();
  2233. System.gc();
  2234. stopMidi();
  2235. currentSong = -1;
  2236. nextSong = -1;
  2237. prevSong = 0;
  2238. }
  2239.  
  2240. private void method45() {
  2241. aBoolean1031 = true;
  2242. for (int j = 0; j < 7; j++) {
  2243. anIntArray1065[j] = -1;
  2244. for (int k = 0; k < IDK.length; k++) {
  2245. if (IDK.cache[k].aBoolean662 || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2246. continue;
  2247. anIntArray1065[j] = k;
  2248. break;
  2249. }
  2250. }
  2251. }
  2252.  
  2253. private void method46(int i, Stream stream) {
  2254. while (stream.bitPosition + 21 < i * 8) {
  2255. int k = stream.readBits(14);
  2256. if (k == 16383)
  2257. break;
  2258. if (npcArray[k] == null)
  2259. npcArray[k] = new NPC();
  2260. NPC npc = npcArray[k];
  2261. npcIndices[npcCount++] = k;
  2262. npc.anInt1537 = loopCycle;
  2263. int l = stream.readBits(5);
  2264. if (l > 15)
  2265. l -= 32;
  2266. int i1 = stream.readBits(5);
  2267. if (i1 > 15)
  2268. i1 -= 32;
  2269. int j1 = stream.readBits(1);
  2270. npc.desc = EntityDef.forID(stream.readBits(14));
  2271. int k1 = stream.readBits(1);
  2272. if (k1 == 1)
  2273. anIntArray894[anInt893++] = k;
  2274. npc.anInt1540 = npc.desc.aByte68;
  2275. npc.anInt1504 = npc.desc.anInt79;
  2276. npc.anInt1554 = npc.desc.walkAnim;
  2277. npc.anInt1555 = npc.desc.anInt58;
  2278. npc.anInt1556 = npc.desc.anInt83;
  2279. npc.anInt1557 = npc.desc.anInt55;
  2280. npc.anInt1511 = npc.desc.standAnim;
  2281. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2282. }
  2283. stream.finishBitAccess();
  2284. }
  2285.  
  2286. public void processGameLoop() {
  2287. if (rsAlreadyLoaded || loadingError || genericLoadingError)
  2288. return;
  2289. loopCycle++;
  2290. if (!loggedIn)
  2291. processLoginScreenInput();
  2292. else
  2293. mainGameProcessor();
  2294. processOnDemandQueue();
  2295. }
  2296.  
  2297. private void method47(boolean flag) {
  2298. if (myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2299. destX = 0;
  2300. int j = playerCount;
  2301. if (flag)
  2302. j = 1;
  2303. for (int l = 0; l < j; l++) {
  2304. Player player;
  2305. int i1;
  2306. if (flag) {
  2307. player = myPlayer;
  2308. i1 = myPlayerIndex << 14;
  2309. } else {
  2310. player = playerArray[playerIndices[l]];
  2311. i1 = playerIndices[l] << 14;
  2312. }
  2313. if (player == null || !player.isVisible())
  2314. continue;
  2315. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag
  2316. && player.anInt1517 == player.anInt1511;
  2317. int j1 = player.x >> 7;
  2318. int k1 = player.y >> 7;
  2319. if (j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2320. continue;
  2321. if (player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  2322. player.aBoolean1699 = false;
  2323. player.anInt1709 = method42(plane, player.y, player.x);
  2324. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x,
  2325. player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  2326. continue;
  2327. }
  2328. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2329. if (anIntArrayArray929[j1][k1] == anInt1265)
  2330. continue;
  2331. anIntArrayArray929[j1][k1] = anInt1265;
  2332. }
  2333. player.anInt1709 = method42(plane, player.y, player.x);
  2334. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player,
  2335. player.aBoolean1541);
  2336. }
  2337. }
  2338.  
  2339. private boolean promptUserForInput(RSInterface class9) {
  2340. int j = class9.contentType;
  2341. if (anInt900 == 2) {
  2342. if (j == 201) {
  2343. inputTaken = true;
  2344. inputDialogState = 0;
  2345. messagePromptRaised = true;
  2346. promptInput = "";
  2347. friendsListAction = 1;
  2348. aString1121 = "Enter name of friend to add to list";
  2349. }
  2350. if (j == 202) {
  2351. inputTaken = true;
  2352. inputDialogState = 0;
  2353. messagePromptRaised = true;
  2354. promptInput = "";
  2355. friendsListAction = 2;
  2356. aString1121 = "Enter name of friend to delete from list";
  2357. }
  2358. }
  2359. if (j == 205) {
  2360. anInt1011 = 250;
  2361. return true;
  2362. }
  2363. if (j == 501) {
  2364. inputTaken = true;
  2365. inputDialogState = 0;
  2366. messagePromptRaised = true;
  2367. promptInput = "";
  2368. friendsListAction = 4;
  2369. aString1121 = "Enter name of player to add to list";
  2370. }
  2371. if (j == 502) {
  2372. inputTaken = true;
  2373. inputDialogState = 0;
  2374. messagePromptRaised = true;
  2375. promptInput = "";
  2376. friendsListAction = 5;
  2377. aString1121 = "Enter name of player to delete from list";
  2378. }
  2379. if (j == 550) {
  2380. inputTaken = true;
  2381. inputDialogState = 0;
  2382. messagePromptRaised = true;
  2383. promptInput = "";
  2384. friendsListAction = 6;
  2385. aString1121 = "Enter the name of the chat you wish to join";
  2386. }
  2387. if (j >= 300 && j <= 313) {
  2388. int k = (j - 300) / 2;
  2389. int j1 = j & 1;
  2390. int i2 = anIntArray1065[k];
  2391. if (i2 != -1) {
  2392. do {
  2393. if (j1 == 0 && --i2 < 0)
  2394. i2 = IDK.length - 1;
  2395. if (j1 == 1 && ++i2 >= IDK.length)
  2396. i2 = 0;
  2397. } while (IDK.cache[i2].aBoolean662 || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2398. anIntArray1065[k] = i2;
  2399. aBoolean1031 = true;
  2400. }
  2401. }
  2402. if (j >= 314 && j <= 323) {
  2403. int l = (j - 314) / 2;
  2404. int k1 = j & 1;
  2405. int j2 = anIntArray990[l];
  2406. if (k1 == 0 && --j2 < 0)
  2407. j2 = anIntArrayArray1003[l].length - 1;
  2408. if (k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2409. j2 = 0;
  2410. anIntArray990[l] = j2;
  2411. aBoolean1031 = true;
  2412. }
  2413. if (j == 324 && !aBoolean1047) {
  2414. aBoolean1047 = true;
  2415. method45();
  2416. }
  2417. if (j == 325 && aBoolean1047) {
  2418. aBoolean1047 = false;
  2419. method45();
  2420. }
  2421. if (j == 326) {
  2422. stream.createFrame(101);
  2423. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2424. for (int i1 = 0; i1 < 7; i1++)
  2425. stream.writeWordBigEndian(anIntArray1065[i1]);
  2426.  
  2427. for (int l1 = 0; l1 < 5; l1++)
  2428. stream.writeWordBigEndian(anIntArray990[l1]);
  2429.  
  2430. return true;
  2431. }
  2432. if (j == 613)
  2433. canMute = !canMute;
  2434. if (j >= 601 && j <= 612) {
  2435. clearTopInterfaces();
  2436. if (reportAbuseInput.length() > 0) {
  2437. stream.createFrame(218);
  2438. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2439. stream.writeWordBigEndian(j - 601);
  2440. stream.writeWordBigEndian(canMute ? 1 : 0);
  2441. }
  2442. }
  2443. return false;
  2444. }
  2445.  
  2446. private void method49(Stream stream) {
  2447. for (int j = 0; j < anInt893; j++) {
  2448. int k = anIntArray894[j];
  2449. Player player = playerArray[k];
  2450. int l = stream.readUnsignedByte();
  2451. if ((l & 0x40) != 0)
  2452. l += stream.readUnsignedByte() << 8;
  2453. method107(l, k, stream, player);
  2454. }
  2455. }
  2456.  
  2457. private void method50(int i, int k, int l, int i1, int j1) {
  2458. int k1 = worldController.method300(j1, l, i);
  2459. if (k1 != 0) {
  2460. int l1 = worldController.method304(j1, l, i, k1);
  2461. int k2 = l1 >> 6 & 3;
  2462. int i3 = l1 & 0x1f;
  2463. int k3 = k;
  2464. if (k1 > 0)
  2465. k3 = i1;
  2466. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2467. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2468. int i5 = k1 >> 14 & 0x7fff;
  2469. ObjectDef class46_2 = ObjectDef.forID(i5);
  2470. if (class46_2.anInt758 != -1) {
  2471. Background background_2 = mapScenes[class46_2.anInt758];
  2472. if (background_2 != null) {
  2473. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  2474. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  2475. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  2476. }
  2477. } else {
  2478. if (i3 == 0 || i3 == 2)
  2479. if (k2 == 0) {
  2480. ai[k4] = k3;
  2481. ai[k4 + 512] = k3;
  2482. ai[k4 + 1024] = k3;
  2483. ai[k4 + 1536] = k3;
  2484. } else if (k2 == 1) {
  2485. ai[k4] = k3;
  2486. ai[k4 + 1] = k3;
  2487. ai[k4 + 2] = k3;
  2488. ai[k4 + 3] = k3;
  2489. } else if (k2 == 2) {
  2490. ai[k4 + 3] = k3;
  2491. ai[k4 + 3 + 512] = k3;
  2492. ai[k4 + 3 + 1024] = k3;
  2493. ai[k4 + 3 + 1536] = k3;
  2494. } else if (k2 == 3) {
  2495. ai[k4 + 1536] = k3;
  2496. ai[k4 + 1536 + 1] = k3;
  2497. ai[k4 + 1536 + 2] = k3;
  2498. ai[k4 + 1536 + 3] = k3;
  2499. }
  2500. if (i3 == 3)
  2501. if (k2 == 0)
  2502. ai[k4] = k3;
  2503. else if (k2 == 1)
  2504. ai[k4 + 3] = k3;
  2505. else if (k2 == 2)
  2506. ai[k4 + 3 + 1536] = k3;
  2507. else if (k2 == 3)
  2508. ai[k4 + 1536] = k3;
  2509. if (i3 == 2)
  2510. if (k2 == 3) {
  2511. ai[k4] = k3;
  2512. ai[k4 + 512] = k3;
  2513. ai[k4 + 1024] = k3;
  2514. ai[k4 + 1536] = k3;
  2515. } else if (k2 == 0) {
  2516. ai[k4] = k3;
  2517. ai[k4 + 1] = k3;
  2518. ai[k4 + 2] = k3;
  2519. ai[k4 + 3] = k3;
  2520. } else if (k2 == 1) {
  2521. ai[k4 + 3] = k3;
  2522. ai[k4 + 3 + 512] = k3;
  2523. ai[k4 + 3 + 1024] = k3;
  2524. ai[k4 + 3 + 1536] = k3;
  2525. } else if (k2 == 2) {
  2526. ai[k4 + 1536] = k3;
  2527. ai[k4 + 1536 + 1] = k3;
  2528. ai[k4 + 1536 + 2] = k3;
  2529. ai[k4 + 1536 + 3] = k3;
  2530. }
  2531. }
  2532. }
  2533. k1 = worldController.method302(j1, l, i);
  2534. if (k1 != 0) {
  2535. int i2 = worldController.method304(j1, l, i, k1);
  2536. int l2 = i2 >> 6 & 3;
  2537. int j3 = i2 & 0x1f;
  2538. int l3 = k1 >> 14 & 0x7fff;
  2539. ObjectDef class46_1 = ObjectDef.forID(l3);
  2540. if (class46_1.anInt758 != -1) {
  2541. Background background_1 = mapScenes[class46_1.anInt758];
  2542. if (background_1 != null) {
  2543. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  2544. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  2545. background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  2546. }
  2547. } else if (j3 == 9) {
  2548. int l4 = 0xeeeeee;
  2549. if (k1 > 0)
  2550. l4 = 0xee0000;
  2551. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2552. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2553. if (l2 == 0 || l2 == 2) {
  2554. ai1[l5 + 1536] = l4;
  2555. ai1[l5 + 1024 + 1] = l4;
  2556. ai1[l5 + 512 + 2] = l4;
  2557. ai1[l5 + 3] = l4;
  2558. } else {
  2559. ai1[l5] = l4;
  2560. ai1[l5 + 512 + 1] = l4;
  2561. ai1[l5 + 1024 + 2] = l4;
  2562. ai1[l5 + 1536 + 3] = l4;
  2563. }
  2564. }
  2565. }
  2566. k1 = worldController.method303(j1, l, i);
  2567. if (k1 != 0) {
  2568. int j2 = k1 >> 14 & 0x7fff;
  2569. ObjectDef class46 = ObjectDef.forID(j2);
  2570. if (class46.anInt758 != -1) {
  2571. Background background = mapScenes[class46.anInt758];
  2572. if (background != null) {
  2573. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  2574. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  2575. background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  2576. }
  2577. }
  2578. }
  2579. }
  2580.  
  2581. private void loadTitleScreen() {
  2582. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  2583. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  2584. aBackgroundArray1152s = new Background[12];
  2585. int j = 0;
  2586. try {
  2587. j = Integer.parseInt(getParameter("fl_icon"));
  2588. } catch (Exception _ex) {
  2589. }
  2590. if (j == 0) {
  2591. for (int k = 0; k < 12; k++)
  2592. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  2593.  
  2594. } else {
  2595. for (int l = 0; l < 12; l++)
  2596. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  2597.  
  2598. }
  2599. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  2600. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  2601. System.arraycopy(aGraphicsBuffer_1110.canvasRaster, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  2602.  
  2603. System.arraycopy(aGraphicsBuffer_1111.canvasRaster, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  2604.  
  2605. anIntArray851 = new int[256];
  2606. for (int k1 = 0; k1 < 64; k1++)
  2607. anIntArray851[k1] = k1 * 0x40000;
  2608.  
  2609. for (int l1 = 0; l1 < 64; l1++)
  2610. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  2611.  
  2612. for (int i2 = 0; i2 < 64; i2++)
  2613. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  2614.  
  2615. for (int j2 = 0; j2 < 64; j2++)
  2616. anIntArray851[j2 + 192] = 0xffffff;
  2617.  
  2618. anIntArray852 = new int[256];
  2619. for (int k2 = 0; k2 < 64; k2++)
  2620. anIntArray852[k2] = k2 * 1024;
  2621.  
  2622. for (int l2 = 0; l2 < 64; l2++)
  2623. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  2624.  
  2625. for (int i3 = 0; i3 < 64; i3++)
  2626. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  2627.  
  2628. for (int j3 = 0; j3 < 64; j3++)
  2629. anIntArray852[j3 + 192] = 0xffffff;
  2630.  
  2631. anIntArray853 = new int[256];
  2632. for (int k3 = 0; k3 < 64; k3++)
  2633. anIntArray853[k3] = k3 * 4;
  2634.  
  2635. for (int l3 = 0; l3 < 64; l3++)
  2636. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  2637.  
  2638. for (int i4 = 0; i4 < 64; i4++)
  2639. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  2640.  
  2641. for (int j4 = 0; j4 < 64; j4++)
  2642. anIntArray853[j4 + 192] = 0xffffff;
  2643.  
  2644. anIntArray850 = new int[256];
  2645. anIntArray1190 = new int[32768];
  2646. anIntArray1191 = new int[32768];
  2647. randomizeBackground(null);
  2648. anIntArray828 = new int[32768];
  2649. anIntArray829 = new int[32768];
  2650. drawLoadingText(10, "Connecting to fileserver");
  2651. if (!aBoolean831) {
  2652. drawFlames = true;
  2653. aBoolean831 = true;
  2654. startRunnable(this, 2);
  2655. }
  2656. }
  2657.  
  2658. private static void setHighMem() {
  2659. WorldController.lowMem = false;
  2660. Texture.lowMem = false;
  2661. lowMem = false;
  2662. ObjectManager.lowMem = false;
  2663. ObjectDef.lowMem = false;
  2664. }
  2665.  
  2666. public static void main(String args[]) {
  2667. nodeID = 10;
  2668. portOff = 0;
  2669. setHighMem();
  2670. isMembers = true;
  2671. signlink.storeid = (32);
  2672. try {
  2673. signlink.startpriv(InetAddress.getLocalHost());
  2674. } catch (UnknownHostException e) {
  2675. // TODO Auto-generated catch block
  2676. e.printStackTrace();
  2677. }
  2678. new Jframe(args);
  2679. }
  2680.  
  2681. private void loadingStages() {
  2682. if (lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  2683. aGraphicsBuffer_1165.setCanvas();
  2684. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  2685. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  2686. aGraphicsBuffer_1165.drawGraphics(4, super.graphics, 4);
  2687. loadingStage = 1;
  2688. aLong824 = System.currentTimeMillis();
  2689. }
  2690. if (loadingStage == 1) {
  2691. int j = method54();
  2692. if (j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  2693. signlink.reporterror(
  2694. myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + ","
  2695. + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  2696. aLong824 = System.currentTimeMillis();
  2697. }
  2698. }
  2699. if (loadingStage == 2 && plane != anInt985) {
  2700. anInt985 = plane;
  2701. method24(plane);
  2702. }
  2703. }
  2704.  
  2705. private int method54() {
  2706. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  2707. if (aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  2708. return -1;
  2709. if (aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  2710. return -2;
  2711. }
  2712. boolean flag = true;
  2713. for (int j = 0; j < aByteArrayArray1183.length; j++) {
  2714. byte abyte0[] = aByteArrayArray1247[j];
  2715. if (abyte0 != null) {
  2716. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  2717. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  2718. if (aBoolean1159) {
  2719. k = 10;
  2720. l = 10;
  2721. }
  2722. flag &= ObjectManager.method189(k, abyte0, l);
  2723. }
  2724. }
  2725. if (!flag)
  2726. return -3;
  2727. if (aBoolean1080) {
  2728. return -4;
  2729. } else {
  2730. loadingStage = 2;
  2731. ObjectManager.anInt131 = plane;
  2732. method22();
  2733. stream.createFrame(121);
  2734. return 0;
  2735. }
  2736. }
  2737.  
  2738. private void method55() {
  2739. for (Animable_Sub4 class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  2740. .reverseGetFirst(); class30_sub2_sub4_sub4 != null; class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  2741. .reverseGetNext())
  2742. if (class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  2743. class30_sub2_sub4_sub4.unlink();
  2744. else if (loopCycle >= class30_sub2_sub4_sub4.anInt1571) {
  2745. if (class30_sub2_sub4_sub4.anInt1590 > 0) {
  2746. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  2747. if (npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  2748. class30_sub2_sub4_sub4.method455(loopCycle, npc.y,
  2749. method42(class30_sub2_sub4_sub4.anInt1597, npc.y, npc.x)
  2750. - class30_sub2_sub4_sub4.anInt1583,
  2751. npc.x);
  2752. }
  2753. if (class30_sub2_sub4_sub4.anInt1590 < 0) {
  2754. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  2755. Player player;
  2756. if (j == unknownInt10)
  2757. player = myPlayer;
  2758. else
  2759. player = playerArray[j];
  2760. if (player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  2761. class30_sub2_sub4_sub4.method455(loopCycle, player.y,
  2762. method42(class30_sub2_sub4_sub4.anInt1597, player.y, player.x)
  2763. - class30_sub2_sub4_sub4.anInt1583,
  2764. player.x);
  2765. }
  2766. class30_sub2_sub4_sub4.method456(anInt945);
  2767. worldController.method285(plane, class30_sub2_sub4_sub4.anInt1595,
  2768. (int) class30_sub2_sub4_sub4.aDouble1587, -1, (int) class30_sub2_sub4_sub4.aDouble1586, 60,
  2769. (int) class30_sub2_sub4_sub4.aDouble1585, class30_sub2_sub4_sub4, false);
  2770. }
  2771.  
  2772. }
  2773.  
  2774. public AppletContext getAppletContext() {
  2775. if (signlink.mainapp != null)
  2776. return signlink.mainapp.getAppletContext();
  2777. else
  2778. return super.getAppletContext();
  2779. }
  2780.  
  2781. private void drawLogo() {
  2782. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  2783. Sprite sprite = new Sprite(abyte0, this);
  2784. aGraphicsBuffer_1110.setCanvas();
  2785. sprite.method346(0, 0);
  2786. aGraphicsBuffer_1111.setCanvas();
  2787. sprite.method346(-637, 0);
  2788. aGraphicsBuffer_1107.setCanvas();
  2789. sprite.method346(-128, 0);
  2790. aGraphicsBuffer_1108.setCanvas();
  2791. sprite.method346(-202, -371);
  2792. aGraphicsBuffer_1109.setCanvas();
  2793. sprite.method346(-202, -171);
  2794. aGraphicsBuffer_1112.setCanvas();
  2795. sprite.method346(0, -265);
  2796. aGraphicsBuffer_1113.setCanvas();
  2797. sprite.method346(-562, -265);
  2798. aGraphicsBuffer_1114.setCanvas();
  2799. sprite.method346(-128, -171);
  2800. aGraphicsBuffer_1115.setCanvas();
  2801. sprite.method346(-562, -171);
  2802. int ai[] = new int[sprite.myWidth];
  2803. for (int j = 0; j < sprite.myHeight; j++) {
  2804. for (int k = 0; k < sprite.myWidth; k++)
  2805. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  2806.  
  2807. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  2808. }
  2809. aGraphicsBuffer_1110.setCanvas();
  2810. sprite.method346(382, 0);
  2811. aGraphicsBuffer_1111.setCanvas();
  2812. sprite.method346(-255, 0);
  2813. aGraphicsBuffer_1107.setCanvas();
  2814. sprite.method346(254, 0);
  2815. aGraphicsBuffer_1108.setCanvas();
  2816. sprite.method346(180, -371);
  2817. aGraphicsBuffer_1109.setCanvas();
  2818. sprite.method346(180, -171);
  2819. aGraphicsBuffer_1112.setCanvas();
  2820. sprite.method346(382, -265);
  2821. aGraphicsBuffer_1113.setCanvas();
  2822. sprite.method346(-180, -265);
  2823. aGraphicsBuffer_1114.setCanvas();
  2824. sprite.method346(254, -171);
  2825. aGraphicsBuffer_1115.setCanvas();
  2826. sprite.method346(-180, -171);
  2827. sprite = new Sprite(titleStreamLoader, "logo", 0);
  2828. aGraphicsBuffer_1107.setCanvas();
  2829. sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  2830. sprite = null;
  2831. Object obj = null;
  2832. Object obj1 = null;
  2833. System.gc();
  2834. }
  2835.  
  2836. private void processOnDemandQueue() {
  2837. do {
  2838. OnDemandData onDemandData;
  2839. do {
  2840. onDemandData = onDemandFetcher.getNextNode();
  2841. if (onDemandData == null)
  2842. return;
  2843. if (onDemandData.dataType == 0) {
  2844. Model.method460(onDemandData.buffer, onDemandData.ID);
  2845. if ((onDemandFetcher.getModelIndex(onDemandData.ID) & 0x62) != 0) {
  2846. needDrawTabArea = true;
  2847. if (backDialogID != -1)
  2848. inputTaken = true;
  2849. }
  2850. }
  2851. if (onDemandData.dataType == 1 && onDemandData.buffer != null)
  2852. Class36.method529(onDemandData.buffer);
  2853. if (onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  2854. saveMidi(songChanging, onDemandData.buffer);
  2855. if (onDemandData.dataType == 3 && loadingStage == 1) {
  2856. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  2857. if (anIntArray1235[i] == onDemandData.ID) {
  2858. aByteArrayArray1183[i] = onDemandData.buffer;
  2859. if (onDemandData.buffer == null)
  2860. anIntArray1235[i] = -1;
  2861. break;
  2862. }
  2863. if (anIntArray1236[i] != onDemandData.ID)
  2864. continue;
  2865. aByteArrayArray1247[i] = onDemandData.buffer;
  2866. if (onDemandData.buffer == null)
  2867. anIntArray1236[i] = -1;
  2868. break;
  2869. }
  2870.  
  2871. }
  2872. } while (onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  2873. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  2874. } while (true);
  2875. }
  2876.  
  2877. private void calcFlamesPosition() {
  2878. char c = '\u0100';
  2879. for (int j = 10; j < 117; j++) {
  2880. int k = (int) (Math.random() * 100D);
  2881. if (k < 50)
  2882. anIntArray828[j + (c - 2 << 7)] = 255;
  2883. }
  2884. for (int l = 0; l < 100; l++) {
  2885. int i1 = (int) (Math.random() * 124D) + 2;
  2886. int k1 = (int) (Math.random() * 128D) + 128;
  2887. int k2 = i1 + (k1 << 7);
  2888. anIntArray828[k2] = 192;
  2889. }
  2890.  
  2891. for (int j1 = 1; j1 < c - 1; j1++) {
  2892. for (int l1 = 1; l1 < 127; l1++) {
  2893. int l2 = l1 + (j1 << 7);
  2894. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128]
  2895. + anIntArray828[l2 + 128]) / 4;
  2896. }
  2897.  
  2898. }
  2899.  
  2900. anInt1275 += 128;
  2901. if (anInt1275 > anIntArray1190.length) {
  2902. anInt1275 -= anIntArray1190.length;
  2903. int i2 = (int) (Math.random() * 12D);
  2904. randomizeBackground(aBackgroundArray1152s[i2]);
  2905. }
  2906. for (int j2 = 1; j2 < c - 1; j2++) {
  2907. for (int i3 = 1; i3 < 127; i3++) {
  2908. int k3 = i3 + (j2 << 7);
  2909. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  2910. if (i4 < 0)
  2911. i4 = 0;
  2912. anIntArray828[k3] = i4;
  2913. }
  2914.  
  2915. }
  2916.  
  2917. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  2918.  
  2919. anIntArray969[c - 1] = (int) (Math.sin((double) loopCycle / 14D) * 16D
  2920. + Math.sin((double) loopCycle / 15D) * 14D + Math.sin((double) loopCycle / 16D) * 12D);
  2921. if (anInt1040 > 0)
  2922. anInt1040 -= 4;
  2923. if (anInt1041 > 0)
  2924. anInt1041 -= 4;
  2925. if (anInt1040 == 0 && anInt1041 == 0) {
  2926. int l3 = (int) (Math.random() * 2000D);
  2927. if (l3 == 0)
  2928. anInt1040 = 1024;
  2929. if (l3 == 1)
  2930. anInt1041 = 1024;
  2931. }
  2932. }
  2933.  
  2934. private boolean saveWave(byte abyte0[], int i) {
  2935. return abyte0 == null || signlink.wavesave(abyte0, i);
  2936. }
  2937.  
  2938. private void method60(int i) {
  2939. RSInterface class9 = RSInterface.interfaceCache[i];
  2940. for (int j = 0; j < class9.children.length; j++) {
  2941. if (class9.children[j] == -1)
  2942. break;
  2943. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  2944. if (class9_1.type == 1)
  2945. method60(class9_1.id);
  2946. class9_1.anInt246 = 0;
  2947. class9_1.anInt208 = 0;
  2948. }
  2949. }
  2950.  
  2951. private void drawHeadIcon() {
  2952. if (anInt855 != 2)
  2953. return;
  2954. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  2955. if (spriteDrawX > -1 && loopCycle % 20 < 10)
  2956. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  2957. }
  2958.  
  2959. private void mainGameProcessor() {
  2960. if (anInt1104 > 1)
  2961. anInt1104--;
  2962. if (anInt1011 > 0)
  2963. anInt1011--;
  2964. for (int j = 0; j < 5; j++)
  2965. if (!parsePacket())
  2966. break;
  2967.  
  2968. if (!loggedIn)
  2969. return;
  2970. try {
  2971. canWalkDelay--;
  2972. if (followNPC > 0) {
  2973. NPC n = npcArray[followNPC];
  2974. if (n != null) {
  2975. if (!withinDistance(myPlayer.smallX[0], myPlayer.smallY[0], n.smallX[0], n.smallY[0],
  2976. followDistance)) {
  2977. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, n.smallY[0], myPlayer.smallX[0], false,
  2978. n.smallX[0]);
  2979. }
  2980. }
  2981. } else if (followPlayer > 0 && canWalkDelay <= 0) {
  2982. Player p = playerArray[followPlayer];
  2983. if (p != null) {
  2984. int dis = getDis(myPlayer.smallX[0], myPlayer.smallY[0], p.smallX[0], p.smallY[0]);
  2985. if (dis > followDistance) {
  2986. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], followDistance, 0, p.smallY[0], myPlayer.smallX[0],
  2987. false, p.smallX[0]);
  2988. canWalkDelay = 30;
  2989. } else if (dis == 0) {
  2990. int rnd = random(4);
  2991. if (rnd == 0) {
  2992. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0], myPlayer.smallX[0], false,
  2993. p.smallX[0] - 2);
  2994. } else if (rnd == 1) {
  2995. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0], myPlayer.smallX[0], false,
  2996. p.smallX[0] + 2);
  2997. } else if (rnd == 2) {
  2998. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0] - 2, myPlayer.smallX[0], false,
  2999. p.smallX[0]);
  3000. } else if (rnd == 3) {
  3001. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0] + 2, myPlayer.smallX[0], false,
  3002. p.smallX[0]);
  3003. }
  3004. canWalkDelay = 60;
  3005. }
  3006. }
  3007. }
  3008. } catch (Exception ex) {
  3009. System.out.println("Exception in following, method : in process.)");
  3010. }
  3011. synchronized (mouseDetection.syncObject) {
  3012. if (flagged) {
  3013. if (super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40) {
  3014. stream.createFrame(45);
  3015. stream.writeWordBigEndian(0);
  3016. int j2 = stream.currentOffset;
  3017. int j3 = 0;
  3018. for (int j4 = 0; j4 < mouseDetection.coordsIndex; j4++) {
  3019. if (j2 - stream.currentOffset >= 240)
  3020. break;
  3021. j3++;
  3022. int l4 = mouseDetection.coordsY[j4];
  3023. if (l4 < 0)
  3024. l4 = 0;
  3025. else if (l4 > 502)
  3026. l4 = 502;
  3027. int k5 = mouseDetection.coordsX[j4];
  3028. if (k5 < 0)
  3029. k5 = 0;
  3030. else if (k5 > 764)
  3031. k5 = 764;
  3032. int i6 = l4 * 765 + k5;
  3033. if (mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1) {
  3034. k5 = -1;
  3035. l4 = -1;
  3036. i6 = 0x7ffff;
  3037. }
  3038. if (k5 == anInt1237 && l4 == anInt1238) {
  3039. if (anInt1022 < 2047)
  3040. anInt1022++;
  3041. } else {
  3042. int j6 = k5 - anInt1237;
  3043. anInt1237 = k5;
  3044. int k6 = l4 - anInt1238;
  3045. anInt1238 = l4;
  3046. if (anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31) {
  3047. j6 += 32;
  3048. k6 += 32;
  3049. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  3050. anInt1022 = 0;
  3051. } else if (anInt1022 < 8) {
  3052. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  3053. anInt1022 = 0;
  3054. } else {
  3055. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  3056. anInt1022 = 0;
  3057. }
  3058. }
  3059. }
  3060.  
  3061. stream.writeBytes(stream.currentOffset - j2);
  3062. if (j3 >= mouseDetection.coordsIndex) {
  3063. mouseDetection.coordsIndex = 0;
  3064. } else {
  3065. mouseDetection.coordsIndex -= j3;
  3066. for (int i5 = 0; i5 < mouseDetection.coordsIndex; i5++) {
  3067. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  3068. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  3069. }
  3070.  
  3071. }
  3072. }
  3073. } else {
  3074. mouseDetection.coordsIndex = 0;
  3075. }
  3076. }
  3077. if (super.clickMode3 != 0) {
  3078. long l = (super.aLong29 - aLong1220) / 50L;
  3079. if (l > 4095L)
  3080. l = 4095L;
  3081. aLong1220 = super.aLong29;
  3082. int k2 = super.saveClickY;
  3083. if (k2 < 0)
  3084. k2 = 0;
  3085. else if (k2 > 502)
  3086. k2 = 502;
  3087. int k3 = super.saveClickX;
  3088. if (k3 < 0)
  3089. k3 = 0;
  3090. else if (k3 > 764)
  3091. k3 = 764;
  3092. int k4 = k2 * 765 + k3;
  3093. int j5 = 0;
  3094. if (super.clickMode3 == 2)
  3095. j5 = 1;
  3096. int l5 = (int) l;
  3097. stream.createFrame(241);
  3098. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3099. }
  3100. if (anInt1016 > 0)
  3101. anInt1016--;
  3102. if (super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3103. aBoolean1017 = true;
  3104. if (aBoolean1017 && anInt1016 <= 0) {
  3105. anInt1016 = 20;
  3106. aBoolean1017 = false;
  3107. stream.createFrame(86);
  3108. stream.writeWord(anInt1184);
  3109. stream.method432(minimapInt1);
  3110. }
  3111. if (super.awtFocus && !aBoolean954) {
  3112. aBoolean954 = true;
  3113. stream.createFrame(3);
  3114. stream.writeWordBigEndian(1);
  3115. }
  3116. if (!super.awtFocus && aBoolean954) {
  3117. aBoolean954 = false;
  3118. stream.createFrame(3);
  3119. stream.writeWordBigEndian(0);
  3120. }
  3121. loadingStages();
  3122. method115();
  3123. method90();
  3124. anInt1009++;
  3125. if (anInt1009 > 750)
  3126. dropClient();
  3127. method114();
  3128. method95();
  3129. method38();
  3130. anInt945++;
  3131. if (crossType != 0) {
  3132. crossIndex += 20;
  3133. if (crossIndex >= 400)
  3134. crossType = 0;
  3135. }
  3136. if (atInventoryInterfaceType != 0) {
  3137. atInventoryLoopCycle++;
  3138. if (atInventoryLoopCycle >= 15) {
  3139. if (atInventoryInterfaceType == 2)
  3140. needDrawTabArea = true;
  3141. if (atInventoryInterfaceType == 3)
  3142. inputTaken = true;
  3143. atInventoryInterfaceType = 0;
  3144. }
  3145. }
  3146. if (activeInterfaceType != 0) {
  3147. anInt989++;
  3148. if (super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5
  3149. || super.mouseY < anInt1088 - 5)
  3150. aBoolean1242 = true;
  3151. if (super.clickMode2 == 0) {
  3152. if (activeInterfaceType == 2)
  3153. needDrawTabArea = true;
  3154. if (activeInterfaceType == 3)
  3155. inputTaken = true;
  3156. activeInterfaceType = 0;
  3157. if (aBoolean1242 && anInt989 >= 10) {
  3158. lastActiveInvInterface = -1;
  3159. processRightClick();
  3160. int x = 0;
  3161. int y = 40;
  3162. if (anInt1084 == 5382 && super.mouseY >= y && super.mouseY <= y + 37) {// check
  3163. // if
  3164. // bank
  3165. // interface
  3166. if (super.mouseX >= 28 + x && super.mouseX <= 74 + x) {// tab
  3167. // 1
  3168. stream.createFrame(214);
  3169. stream.method433(5);// 5 = maintab
  3170. stream.method424(0);
  3171. stream.method433(anInt1085);// Selected item slot
  3172. stream.method431(mouseInvInterfaceIndex);// unused
  3173.  
  3174. }
  3175. if (super.mouseX >= 75 + x && super.mouseX <= 121 + x) {// tab
  3176. // 1
  3177. stream.createFrame(214);
  3178. stream.method433(13);// tab # x 13 (originally
  3179. // movewindow)
  3180. stream.method424(0);
  3181. stream.method433(anInt1085);// Selected item slot
  3182. stream.method431(mouseInvInterfaceIndex);// unused
  3183.  
  3184. }
  3185. if (super.mouseX >= 122 + x && super.mouseX <= 168 + x) {// tab
  3186. // 2
  3187. stream.createFrame(214);
  3188. stream.method433(26);// tab # x 13 (originally
  3189. // movewindow)
  3190. stream.method424(0);
  3191. stream.method433(anInt1085);// Selected item slot
  3192. stream.method431(mouseInvInterfaceIndex);// unused
  3193.  
  3194. }
  3195. if (super.mouseX >= 169 + x && super.mouseX <= 215 + x) {// tab
  3196. // 3
  3197. stream.createFrame(214);
  3198. stream.method433(39);// tab # x 13 (originally
  3199. // movewindow)
  3200. stream.method424(0);
  3201. stream.method433(anInt1085);// Selected item slot
  3202. stream.method431(mouseInvInterfaceIndex);// unused
  3203.  
  3204. }
  3205. if (super.mouseX >= 216 + x && super.mouseX <= 262 + x) {// tab
  3206. // 4
  3207. stream.createFrame(214);
  3208. stream.method433(52);// tab # x 13 (originally
  3209. // movewindow)
  3210. stream.method424(0);
  3211. stream.method433(anInt1085);// Selected item slot
  3212. stream.method431(mouseInvInterfaceIndex);// unused
  3213.  
  3214. }
  3215. if (super.mouseX >= 263 + x && super.mouseX <= 309 + x) {// tab
  3216. // 5
  3217. stream.createFrame(214);
  3218. stream.method433(65);// tab # x 13 (originally
  3219. // movewindow)
  3220. stream.method424(0);
  3221. stream.method433(anInt1085);// Selected item slot
  3222. stream.method431(mouseInvInterfaceIndex);// unused
  3223.  
  3224. }
  3225. if (super.mouseX >= 310 + x && super.mouseX <= 356 + x) {// tab
  3226. // 6
  3227. stream.createFrame(214);
  3228. stream.method433(78);// tab # x 13 (originally
  3229. // movewindow)
  3230. stream.method424(0);
  3231. stream.method433(anInt1085);// Selected item slot
  3232. stream.method431(mouseInvInterfaceIndex);// unused
  3233.  
  3234. }
  3235. if (super.mouseX >= 357 + x && super.mouseX <= 403 + x) {// tab
  3236. // 7
  3237. stream.createFrame(214);
  3238. stream.method433(91);// tab # x 13 (originally
  3239. // movewindow)
  3240. stream.method424(0);
  3241. stream.method433(anInt1085);// Selected item slot
  3242. stream.method431(mouseInvInterfaceIndex);// unused
  3243.  
  3244. }
  3245. if (super.mouseX >= 404 + x && super.mouseX <= 450 + x) {// tab
  3246. // 8
  3247. stream.createFrame(214);
  3248. stream.method433(104);// tab # x 13 (originally
  3249. // movewindow)
  3250. stream.method424(0);
  3251. stream.method433(anInt1085);// Selected item slot
  3252. stream.method431(mouseInvInterfaceIndex);// unused
  3253.  
  3254. }
  3255. }
  3256. if (lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085) {
  3257. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3258. int j1 = 0;
  3259. if (anInt913 == 1 && class9.contentType == 206)
  3260. j1 = 1;
  3261. if (class9.inv[mouseInvInterfaceIndex] <= 0)
  3262. j1 = 0;
  3263. if (class9.aBoolean235) {
  3264. int l2 = anInt1085;
  3265. int l3 = mouseInvInterfaceIndex;
  3266. class9.inv[l3] = class9.inv[l2];
  3267. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3268. class9.inv[l2] = -1;
  3269. class9.invStackSizes[l2] = 0;
  3270. } else if (j1 == 1) {
  3271. int i3 = anInt1085;
  3272. for (int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3273. if (i3 > i4) {
  3274. class9.swapInventoryItems(i3, i3 - 1);
  3275. i3--;
  3276. } else if (i3 < i4) {
  3277. class9.swapInventoryItems(i3, i3 + 1);
  3278. i3++;
  3279. }
  3280.  
  3281. } else {
  3282. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  3283. }
  3284. stream.createFrame(214);
  3285. stream.method433(anInt1084);
  3286. stream.method424(j1);
  3287. stream.method433(anInt1085);
  3288. stream.method431(mouseInvInterfaceIndex);
  3289. }
  3290. } else if ((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  3291. determineMenuSize();
  3292. else if (menuActionRow > 0)
  3293. doAction(menuActionRow - 1);
  3294. atInventoryLoopCycle = 10;
  3295. super.clickMode3 = 0;
  3296. }
  3297. }
  3298. if (WorldController.anInt470 != -1) {
  3299. int k = WorldController.anInt470;
  3300. int k1 = WorldController.anInt471;
  3301. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  3302. WorldController.anInt470 = -1;
  3303. if (flag) {
  3304. crossX = super.saveClickX;
  3305. crossY = super.saveClickY;
  3306. crossType = 1;
  3307. crossIndex = 0;
  3308. }
  3309. }
  3310. if (super.clickMode3 == 1 && aString844 != null) {
  3311. aString844 = null;
  3312. inputTaken = true;
  3313. super.clickMode3 = 0;
  3314. }
  3315. processMenuClick();
  3316. processMainScreenClick();
  3317. processTabClick();
  3318. processChatModeClick();
  3319. if (super.clickMode2 == 1 || super.clickMode3 == 1)
  3320. anInt1213++;
  3321. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3322. if (anInt1501 < 100) {
  3323. anInt1501++;
  3324. if (anInt1501 == 100) {
  3325. if (anInt1500 != 0) {
  3326. inputTaken = true;
  3327. }
  3328. if (anInt1044 != 0) {
  3329. needDrawTabArea = true;
  3330. }
  3331. }
  3332. }
  3333. } else if (anInt1501 > 0) {
  3334. anInt1501--;
  3335. }
  3336. if (loadingStage == 2)
  3337. method108();
  3338. if (loadingStage == 2 && aBoolean1160)
  3339. calcCameraPos();
  3340. for (int i1 = 0; i1 < 5; i1++)
  3341. anIntArray1030[i1]++;
  3342.  
  3343. method73();
  3344. super.idleTime++;
  3345. if (super.idleTime > 4500) {
  3346. anInt1011 = 250;
  3347. super.idleTime -= 500;
  3348. stream.createFrame(202);
  3349. }
  3350. anInt988++;
  3351. if (anInt988 > 500) {
  3352. anInt988 = 0;
  3353. int l1 = (int) (Math.random() * 8D);
  3354. if ((l1 & 1) == 1)
  3355. anInt1278 += anInt1279;
  3356. if ((l1 & 2) == 2)
  3357. anInt1131 += anInt1132;
  3358. if ((l1 & 4) == 4)
  3359. anInt896 += anInt897;
  3360. }
  3361. if (anInt1278 < -50)
  3362. anInt1279 = 2;
  3363. if (anInt1278 > 50)
  3364. anInt1279 = -2;
  3365. if (anInt1131 < -55)
  3366. anInt1132 = 2;
  3367. if (anInt1131 > 55)
  3368. anInt1132 = -2;
  3369. if (anInt896 < -40)
  3370. anInt897 = 1;
  3371. if (anInt896 > 40)
  3372. anInt897 = -1;
  3373. anInt1254++;
  3374. if (anInt1254 > 500) {
  3375. anInt1254 = 0;
  3376. int i2 = (int) (Math.random() * 8D);
  3377. if ((i2 & 1) == 1)
  3378. minimapInt2 += anInt1210;
  3379. if ((i2 & 2) == 2)
  3380. minimapInt3 += anInt1171;
  3381. }
  3382. if (minimapInt2 < -60)
  3383. anInt1210 = 2;
  3384. if (minimapInt2 > 60)
  3385. anInt1210 = -2;
  3386. if (minimapInt3 < -20)
  3387. anInt1171 = 1;
  3388. if (minimapInt3 > 10)
  3389. anInt1171 = -1;
  3390. anInt1010++;
  3391. if (anInt1010 > 50)
  3392. stream.createFrame(0);
  3393. try {
  3394. if (socketStream != null && stream.currentOffset > 0) {
  3395. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3396. stream.currentOffset = 0;
  3397. anInt1010 = 0;
  3398. }
  3399. } catch (IOException _ex) {
  3400. dropClient();
  3401. } catch (Exception exception) {
  3402. resetLogout();
  3403. }
  3404. }
  3405.  
  3406. private void method63() {
  3407. Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetFirst();
  3408. for (; class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetNext())
  3409. if (class30_sub1.anInt1294 == -1) {
  3410. class30_sub1.anInt1302 = 0;
  3411. method89(class30_sub1);
  3412. } else {
  3413. class30_sub1.unlink();
  3414. }
  3415.  
  3416. }
  3417.  
  3418. private void resetImageProducers() {
  3419. if (aGraphicsBuffer_1107 != null)
  3420. return;
  3421. super.fullGameScreen = null;
  3422. aGraphicsBuffer_1166 = null;
  3423. aGraphicsBuffer_1164 = null;
  3424. aGraphicsBuffer_1163 = null;
  3425. aGraphicsBuffer_1165 = null;
  3426. aGraphicsBuffer_1123 = null;
  3427. aGraphicsBuffer_1124 = null;
  3428. aGraphicsBuffer_1125 = null;
  3429. aGraphicsBuffer_1110 = new GraphicsBuffer(128, 265);
  3430. DrawingArea.setAllPixelsToZero();
  3431. aGraphicsBuffer_1111 = new GraphicsBuffer(128, 265);
  3432. DrawingArea.setAllPixelsToZero();
  3433. aGraphicsBuffer_1107 = new GraphicsBuffer(509, 171);
  3434. DrawingArea.setAllPixelsToZero();
  3435. aGraphicsBuffer_1108 = new GraphicsBuffer(360, 132);
  3436. DrawingArea.setAllPixelsToZero();
  3437. aGraphicsBuffer_1109 = new GraphicsBuffer(360, 200);
  3438. DrawingArea.setAllPixelsToZero();
  3439. aGraphicsBuffer_1112 = new GraphicsBuffer(202, 238);
  3440. DrawingArea.setAllPixelsToZero();
  3441. aGraphicsBuffer_1113 = new GraphicsBuffer(203, 238);
  3442. DrawingArea.setAllPixelsToZero();
  3443. aGraphicsBuffer_1114 = new GraphicsBuffer(74, 94);
  3444. DrawingArea.setAllPixelsToZero();
  3445. aGraphicsBuffer_1115 = new GraphicsBuffer(75, 94);
  3446. DrawingArea.setAllPixelsToZero();
  3447. if (titleStreamLoader != null) {
  3448. drawLogo();
  3449. loadTitleScreen();
  3450. }
  3451. welcomeScreenRaised = true;
  3452. }
  3453.  
  3454. void drawLoadingText(int i, String s) {
  3455. anInt1079 = i;
  3456. aString1049 = s;
  3457. resetImageProducers();
  3458. if (titleStreamLoader == null) {
  3459. super.drawLoadingText(i, s);
  3460. return;
  3461. }
  3462. aGraphicsBuffer_1109.setCanvas();
  3463. char c = '\u0168';
  3464. char c1 = '\310';
  3465. byte byte1 = 20;
  3466. chatTextDrawingArea.drawText(0xffffff, "RuneScape is loading - please wait...", c1 / 2 - 26 - byte1, c / 2);
  3467. int j = c1 / 2 - 18 - byte1;
  3468. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  3469. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3470. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  3471. DrawingArea.drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3472. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3473. aGraphicsBuffer_1109.drawGraphics(171, super.graphics, 202);
  3474. if (welcomeScreenRaised) {
  3475. welcomeScreenRaised = false;
  3476. if (!aBoolean831) {
  3477. aGraphicsBuffer_1110.drawGraphics(0, super.graphics, 0);
  3478. aGraphicsBuffer_1111.drawGraphics(0, super.graphics, 637);
  3479. }
  3480. aGraphicsBuffer_1107.drawGraphics(0, super.graphics, 128);
  3481. aGraphicsBuffer_1108.drawGraphics(371, super.graphics, 202);
  3482. aGraphicsBuffer_1112.drawGraphics(265, super.graphics, 0);
  3483. aGraphicsBuffer_1113.drawGraphics(265, super.graphics, 562);
  3484. aGraphicsBuffer_1114.drawGraphics(171, super.graphics, 128);
  3485. aGraphicsBuffer_1115.drawGraphics(171, super.graphics, 562);
  3486. }
  3487. }
  3488.  
  3489. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag, int j1) {
  3490. int anInt992;
  3491. if (aBoolean972)
  3492. anInt992 = 32;
  3493. else
  3494. anInt992 = 0;
  3495. aBoolean972 = false;
  3496. if (k >= i && k < i + 16 && l >= i1 && l < i1 + 16) {
  3497. class9.scrollPosition -= anInt1213 * 4;
  3498. if (flag) {
  3499. needDrawTabArea = true;
  3500. }
  3501. } else if (k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j) {
  3502. class9.scrollPosition += anInt1213 * 4;
  3503. if (flag) {
  3504. needDrawTabArea = true;
  3505. }
  3506. } else if (k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0) {
  3507. int l1 = ((j - 32) * j) / j1;
  3508. if (l1 < 8)
  3509. l1 = 8;
  3510. int i2 = l - i1 - 16 - l1 / 2;
  3511. int j2 = j - 32 - l1;
  3512. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3513. if (flag)
  3514. needDrawTabArea = true;
  3515. aBoolean972 = true;
  3516. }
  3517. }
  3518.  
  3519. private boolean method66(int i, int j, int k) {
  3520. int i1 = i >> 14 & 0x7fff;
  3521. int j1 = worldController.method304(plane, k, j, i);
  3522. if (j1 == -1)
  3523. return false;
  3524. int k1 = j1 & 0x1f;
  3525. int l1 = j1 >> 6 & 3;
  3526. if (k1 == 10 || k1 == 11 || k1 == 22) {
  3527. ObjectDef class46 = ObjectDef.forID(i1);
  3528. int i2;
  3529. int j2;
  3530. if (l1 == 0 || l1 == 2) {
  3531. i2 = class46.anInt744;
  3532. j2 = class46.anInt761;
  3533. } else {
  3534. i2 = class46.anInt761;
  3535. j2 = class46.anInt744;
  3536. }
  3537. int k2 = class46.anInt768;
  3538. if (l1 != 0)
  3539. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3540. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3541. } else {
  3542. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3543. }
  3544. crossX = super.saveClickX;
  3545. crossY = super.saveClickY;
  3546. crossType = 2;
  3547. crossIndex = 0;
  3548. return true;
  3549. }
  3550.  
  3551. private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k) {
  3552. byte abyte0[] = null;
  3553. int l = 5;
  3554. try {
  3555. if (decompressors[0] != null)
  3556. abyte0 = decompressors[0].decompress(i);
  3557. } catch (Exception _ex) {
  3558. }
  3559. if (abyte0 != null) {
  3560. // aCRC32_930.reset();
  3561. // aCRC32_930.update(abyte0);
  3562. // int i1 = (int)aCRC32_930.getValue();
  3563. // if(i1 != j)
  3564. }
  3565. if (abyte0 != null) {
  3566. StreamLoader streamLoader = new StreamLoader(abyte0);
  3567. return streamLoader;
  3568. }
  3569. int j1 = 0;
  3570. while (abyte0 == null) {
  3571. String s2 = "Unknown error";
  3572. drawLoadingText(k, "Requesting " + s);
  3573. Object obj = null;
  3574. try {
  3575. int k1 = 0;
  3576. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3577. byte abyte1[] = new byte[6];
  3578. datainputstream.readFully(abyte1, 0, 6);
  3579. Stream stream = new Stream(abyte1);
  3580. stream.currentOffset = 3;
  3581. int i2 = stream.read3Bytes() + 6;
  3582. int j2 = 6;
  3583. abyte0 = new byte[i2];
  3584. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3585.  
  3586. while (j2 < i2) {
  3587. int l2 = i2 - j2;
  3588. if (l2 > 1000)
  3589. l2 = 1000;
  3590. int j3 = datainputstream.read(abyte0, j2, l2);
  3591. if (j3 < 0) {
  3592. s2 = "Length error: " + j2 + "/" + i2;
  3593. throw new IOException("EOF");
  3594. }
  3595. j2 += j3;
  3596. int k3 = (j2 * 100) / i2;
  3597. if (k3 != k1)
  3598. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3599. k1 = k3;
  3600. }
  3601. datainputstream.close();
  3602. try {
  3603. if (decompressors[0] != null)
  3604. decompressors[0].method234(abyte0.length, abyte0, i);
  3605. } catch (Exception _ex) {
  3606. decompressors[0] = null;
  3607. }
  3608. /*
  3609. * if(abyte0 != null) { aCRC32_930.reset();
  3610. * aCRC32_930.update(abyte0); int i3 =
  3611. * (int)aCRC32_930.getValue(); if(i3 != j) { abyte0 = null;
  3612. * j1++; s2 = "Checksum error: " + i3; } }
  3613. */
  3614. } catch (IOException ioexception) {
  3615. if (s2.equals("Unknown error"))
  3616. s2 = "Connection error";
  3617. abyte0 = null;
  3618. } catch (NullPointerException _ex) {
  3619. s2 = "Null error";
  3620. abyte0 = null;
  3621. if (!signlink.reporterror)
  3622. return null;
  3623. } catch (ArrayIndexOutOfBoundsException _ex) {
  3624. s2 = "Bounds error";
  3625. abyte0 = null;
  3626. if (!signlink.reporterror)
  3627. return null;
  3628. } catch (Exception _ex) {
  3629. s2 = "Unexpected error";
  3630. abyte0 = null;
  3631. if (!signlink.reporterror)
  3632. return null;
  3633. }
  3634. if (abyte0 == null) {
  3635. for (int l1 = l; l1 > 0; l1--) {
  3636. if (j1 >= 3) {
  3637. drawLoadingText(k, "Game updated - please reload page");
  3638. l1 = 10;
  3639. } else {
  3640. drawLoadingText(k, s2 + " - Retrying in " + l1);
  3641. }
  3642. try {
  3643. Thread.sleep(1000L);
  3644. } catch (Exception _ex) {
  3645. }
  3646. }
  3647.  
  3648. l *= 2;
  3649. if (l > 60)
  3650. l = 60;
  3651. aBoolean872 = !aBoolean872;
  3652. }
  3653.  
  3654. }
  3655.  
  3656. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  3657. return streamLoader_1;
  3658. }
  3659.  
  3660. private void dropClient() {
  3661. if (anInt1011 > 0) {
  3662. resetLogout();
  3663. return;
  3664. }
  3665. aGraphicsBuffer_1165.setCanvas();
  3666. aTextDrawingArea_1271.drawText(0, "Connection lost", 144, 257);
  3667. aTextDrawingArea_1271.drawText(0xffffff, "Connection lost", 143, 256);
  3668. aTextDrawingArea_1271.drawText(0, "Please wait - attempting to reestablish", 159, 257);
  3669. aTextDrawingArea_1271.drawText(0xffffff, "Please wait - attempting to reestablish", 158, 256);
  3670. aGraphicsBuffer_1165.drawGraphics(4, super.graphics, 4);
  3671. anInt1021 = 0;
  3672. destX = 0;
  3673. RSSocket rsSocket = socketStream;
  3674. loggedIn = false;
  3675. loginFailures = 0;
  3676. login(myUsername, myPassword, true);
  3677. if (!loggedIn)
  3678. resetLogout();
  3679. try {
  3680. rsSocket.close();
  3681. } catch (Exception _ex) {
  3682. }
  3683. }
  3684.  
  3685. private void doAction(int i) {
  3686. if (i < 0)
  3687. return;
  3688. if (inputDialogState != 0) {
  3689. inputDialogState = 0;
  3690. inputTaken = true;
  3691. }
  3692. int j = menuActionCmd2[i];
  3693. int k = menuActionCmd3[i];
  3694. int l = menuActionID[i];
  3695. int i1 = menuActionCmd1[i];
  3696. if (l >= 2000)
  3697. l -= 2000;
  3698. if (l == 582) {
  3699. NPC npc = npcArray[i1];
  3700. if (npc != null) {
  3701. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  3702. crossX = super.saveClickX;
  3703. crossY = super.saveClickY;
  3704. crossType = 2;
  3705. crossIndex = 0;
  3706. stream.createFrame(57);
  3707. stream.method432(anInt1285);
  3708. stream.method432(i1);
  3709. stream.method431(anInt1283);
  3710. stream.method432(anInt1284);
  3711. }
  3712. }
  3713. if (l == 234) {
  3714. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3715. if (!flag1)
  3716. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3717. crossX = super.saveClickX;
  3718. crossY = super.saveClickY;
  3719. crossType = 2;
  3720. crossIndex = 0;
  3721. stream.createFrame(236);
  3722. stream.method431(k + baseY);
  3723. stream.writeWord(i1);
  3724. stream.method431(j + baseX);
  3725. }
  3726. if (l == 62 && method66(i1, k, j)) {
  3727. stream.createFrame(192);
  3728. stream.writeWord(anInt1284);
  3729. stream.method431(i1 >> 14 & 0x7fff);
  3730. stream.method433(k + baseY);
  3731. stream.method431(anInt1283);
  3732. stream.method433(j + baseX);
  3733. stream.writeWord(anInt1285);
  3734. }
  3735. if (l == 511) {
  3736. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3737. if (!flag2)
  3738. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3739. crossX = super.saveClickX;
  3740. crossY = super.saveClickY;
  3741. crossType = 2;
  3742. crossIndex = 0;
  3743. stream.createFrame(25);
  3744. stream.method431(anInt1284);
  3745. stream.method432(anInt1285);
  3746. stream.writeWord(i1);
  3747. stream.method432(k + baseY);
  3748. stream.method433(anInt1283);
  3749. stream.writeWord(j + baseX);
  3750. }
  3751. if (l == 74) {
  3752. stream.createFrame(122);
  3753. stream.method433(k);
  3754. stream.method432(j);
  3755. stream.method431(i1);
  3756. atInventoryLoopCycle = 0;
  3757. atInventoryInterface = k;
  3758. atInventoryIndex = j;
  3759. atInventoryInterfaceType = 2;
  3760. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3761. atInventoryInterfaceType = 1;
  3762. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  3763. atInventoryInterfaceType = 3;
  3764. }
  3765. if (l == 315) {
  3766. RSInterface class9 = RSInterface.interfaceCache[k];
  3767. boolean flag8 = true;
  3768. if (class9.contentType > 0)
  3769. flag8 = promptUserForInput(class9);
  3770. if (flag8) {
  3771.  
  3772. switch (k) {
  3773. case 19144:
  3774. sendFrame248(15106, 3213);
  3775. method60(15106);
  3776. inputTaken = true;
  3777. break;
  3778. default:
  3779. stream.createFrame(185);
  3780. stream.writeWord(k);
  3781. break;
  3782.  
  3783. }
  3784. }
  3785. }
  3786. if (l == 561) {
  3787. Player player = playerArray[i1];
  3788. if (player != null) {
  3789. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false,
  3790. player.smallX[0]);
  3791. crossX = super.saveClickX;
  3792. crossY = super.saveClickY;
  3793. crossType = 2;
  3794. crossIndex = 0;
  3795. anInt1188 += i1;
  3796. if (anInt1188 >= 90) {
  3797. stream.createFrame(136);
  3798. anInt1188 = 0;
  3799. }
  3800. stream.createFrame(128);
  3801. stream.writeWord(i1);
  3802. }
  3803. }
  3804. if (l == 20) {
  3805. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  3806. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  3807. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_1.smallY[0],
  3808. myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_1.smallX[0]);
  3809. crossX = super.saveClickX;
  3810. crossY = super.saveClickY;
  3811. crossType = 2;
  3812. crossIndex = 0;
  3813. stream.createFrame(155);
  3814. stream.method431(i1);
  3815. }
  3816. }
  3817. if (l == 779) {
  3818. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  3819. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  3820. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_1.smallY[0],
  3821. myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_1.smallX[0]);
  3822. crossX = super.saveClickX;
  3823. crossY = super.saveClickY;
  3824. crossType = 2;
  3825. crossIndex = 0;
  3826. stream.createFrame(153);
  3827. stream.method431(i1);
  3828. }
  3829. }
  3830. if (l == 516) {
  3831. if (!this.menuOpen) {
  3832. anInt118 = this.saveClickX - 4;
  3833. anInt115 = this.saveClickY - 4;
  3834. } else {
  3835. anInt118 = j - 4;
  3836. anInt115 = k - 4;
  3837. }
  3838. if (aBoolean594 = true) {
  3839. anInt118 <<= 1;
  3840. anInt115 <<= 1;
  3841. }
  3842. this.worldController.method312(anInt115, anInt118);
  3843. }
  3844. if (l == 1062) {
  3845. anInt924 += baseX;
  3846. if (anInt924 >= 113) {
  3847. stream.createFrame(183);
  3848. stream.writeDWordBigEndian(0xe63271);
  3849. anInt924 = 0;
  3850. }
  3851. method66(i1, k, j);
  3852. stream.createFrame(228);
  3853. stream.method432(i1 >> 14 & 0x7fff);
  3854. stream.method432(k + baseY);
  3855. stream.writeWord(j + baseX);
  3856. }
  3857. if (l == 679 && !aBoolean1149) {
  3858. stream.createFrame(40);
  3859. stream.writeWord(k);
  3860. aBoolean1149 = true;
  3861. }
  3862. if (l == 431) {
  3863. stream.createFrame(129);
  3864. stream.method432(j);
  3865. stream.writeWord(k);
  3866. stream.method432(i1);
  3867. atInventoryLoopCycle = 0;
  3868. atInventoryInterface = k;
  3869. atInventoryIndex = j;
  3870. atInventoryInterfaceType = 2;
  3871. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3872. atInventoryInterfaceType = 1;
  3873. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  3874. atInventoryInterfaceType = 3;
  3875. }
  3876. if (l == 337 || l == 42 || l == 792 || l == 322) {
  3877. String s = menuActionName[i];
  3878. int k1 = s.indexOf("@whi@");
  3879. if (k1 != -1) {
  3880. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  3881. if (l == 337)
  3882. addFriend(l3);
  3883. if (l == 42)
  3884. addIgnore(l3);
  3885. if (l == 792)
  3886. delFriend(l3);
  3887. if (l == 322)
  3888. delIgnore(l3);
  3889. }
  3890. }
  3891. if (l == 53) {
  3892. stream.createFrame(135);
  3893. stream.method431(j);
  3894. stream.method432(k);
  3895. stream.method431(i1);
  3896. atInventoryLoopCycle = 0;
  3897. atInventoryInterface = k;
  3898. atInventoryIndex = j;
  3899. atInventoryInterfaceType = 2;
  3900. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3901. atInventoryInterfaceType = 1;
  3902. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  3903. atInventoryInterfaceType = 3;
  3904. }
  3905. if (l == 539) {
  3906. stream.createFrame(16);
  3907. stream.method432(i1);
  3908. stream.method433(j);
  3909. stream.method433(k);
  3910. atInventoryLoopCycle = 0;
  3911. atInventoryInterface = k;
  3912. atInventoryIndex = j;
  3913. atInventoryInterfaceType = 2;
  3914. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3915. atInventoryInterfaceType = 1;
  3916. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  3917. atInventoryInterfaceType = 3;
  3918. }
  3919. if (l == 484 || l == 6) {
  3920. String s1 = menuActionName[i];
  3921. int l1 = s1.indexOf("@whi@");
  3922. if (l1 != -1) {
  3923. s1 = s1.substring(l1 + 5).trim();
  3924. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  3925. boolean flag9 = false;
  3926. for (int j3 = 0; j3 < playerCount; j3++) {
  3927. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  3928. if (class30_sub2_sub4_sub1_sub2_7 == null || class30_sub2_sub4_sub1_sub2_7.name == null
  3929. || !class30_sub2_sub4_sub1_sub2_7.name.equalsIgnoreCase(s7))
  3930. continue;
  3931. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_7.smallY[0],
  3932. myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_7.smallX[0]);
  3933. if (l == 484) {
  3934. stream.createFrame(139);
  3935. stream.method431(playerIndices[j3]);
  3936. }
  3937. if (l == 6) {
  3938. anInt1188 += i1;
  3939. if (anInt1188 >= 90) {
  3940. stream.createFrame(136);
  3941. anInt1188 = 0;
  3942. }
  3943. stream.createFrame(128);
  3944. stream.writeWord(playerIndices[j3]);
  3945. }
  3946. flag9 = true;
  3947. break;
  3948. }
  3949.  
  3950. if (!flag9)
  3951. pushMessage("Unable to find " + s7, 0, "");
  3952. }
  3953. }
  3954. if (l == 870) {
  3955. stream.createFrame(53);
  3956. stream.writeWord(j);
  3957. stream.method432(anInt1283);
  3958. stream.method433(i1);
  3959. stream.writeWord(anInt1284);
  3960. stream.method431(anInt1285);
  3961. stream.writeWord(k);
  3962. atInventoryLoopCycle = 0;
  3963. atInventoryInterface = k;
  3964. atInventoryIndex = j;
  3965. atInventoryInterfaceType = 2;
  3966. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3967. atInventoryInterfaceType = 1;
  3968. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  3969. atInventoryInterfaceType = 3;
  3970. }
  3971. if (l == 847) {
  3972. stream.createFrame(87);
  3973. stream.method432(i1);
  3974. stream.writeWord(k);
  3975. stream.method432(j);
  3976. atInventoryLoopCycle = 0;
  3977. atInventoryInterface = k;
  3978. atInventoryIndex = j;
  3979. atInventoryInterfaceType = 2;
  3980. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3981. atInventoryInterfaceType = 1;
  3982. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  3983. atInventoryInterfaceType = 3;
  3984. }
  3985. if (l == 626) {
  3986. RSInterface class9_1 = RSInterface.interfaceCache[k];
  3987. spellSelected = 1;
  3988. spellID = class9_1.id;
  3989. anInt1137 = k;
  3990. spellUsableOn = class9_1.spellUsableOn;
  3991. itemSelected = 0;
  3992. needDrawTabArea = true;
  3993. String s4 = class9_1.selectedActionName;
  3994. if (s4.indexOf(" ") != -1)
  3995. s4 = s4.substring(0, s4.indexOf(" "));
  3996. String s8 = class9_1.selectedActionName;
  3997. if (s8.indexOf(" ") != -1)
  3998. s8 = s8.substring(s8.indexOf(" ") + 1);
  3999. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4000. // class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265,
  4001. // 0xffffff);
  4002. // class9_1.sprite1.drawSprite(200,200);
  4003. // System.out.println("Sprite: " + class9_1.sprite1.toString());
  4004. if (spellUsableOn == 16) {
  4005. needDrawTabArea = true;
  4006. tabID = 3;
  4007. tabAreaAltered = true;
  4008. }
  4009. return;
  4010. }
  4011. if (l == 78) {
  4012. stream.createFrame(117);
  4013. stream.method433(k);
  4014. stream.method433(i1);
  4015. stream.method431(j);
  4016. atInventoryLoopCycle = 0;
  4017. atInventoryInterface = k;
  4018. atInventoryIndex = j;
  4019. atInventoryInterfaceType = 2;
  4020. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4021. atInventoryInterfaceType = 1;
  4022. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4023. atInventoryInterfaceType = 3;
  4024. }
  4025. if (l == 27) {
  4026. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4027. if (class30_sub2_sub4_sub1_sub2_2 != null) {
  4028. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_2.smallY[0],
  4029. myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_2.smallX[0]);
  4030. crossX = super.saveClickX;
  4031. crossY = super.saveClickY;
  4032. crossType = 2;
  4033. crossIndex = 0;
  4034. anInt986 += i1;
  4035. if (anInt986 >= 54) {
  4036. stream.createFrame(189);
  4037. stream.writeWordBigEndian(234);
  4038. anInt986 = 0;
  4039. }
  4040. stream.createFrame(73);
  4041. stream.method431(i1);
  4042. }
  4043. }
  4044. if (l == 213) {
  4045. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4046. if (!flag3)
  4047. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4048. crossX = super.saveClickX;
  4049. crossY = super.saveClickY;
  4050. crossType = 2;
  4051. crossIndex = 0;
  4052. stream.createFrame(79);
  4053. stream.method431(k + baseY);
  4054. stream.writeWord(i1);
  4055. stream.method432(j + baseX);
  4056. }
  4057. if (l == 632) {
  4058. stream.createFrame(145);
  4059. stream.method432(k);
  4060. stream.method432(j);
  4061. stream.method432(i1);
  4062. atInventoryLoopCycle = 0;
  4063. atInventoryInterface = k;
  4064. atInventoryIndex = j;
  4065. atInventoryInterfaceType = 2;
  4066. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4067. atInventoryInterfaceType = 1;
  4068. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4069. atInventoryInterfaceType = 3;
  4070. }
  4071. if (l == 1004) {
  4072. if (tabInterfaceIDs[10] != -1) {
  4073. needDrawTabArea = true;
  4074. tabID = 10;
  4075. tabAreaAltered = true;
  4076. }
  4077. }
  4078. if (l == 1003) {
  4079. clanChatMode = 2;
  4080. aBoolean1233 = true;
  4081. inputTaken = true;
  4082. }
  4083. if (l == 1002) {
  4084. clanChatMode = 1;
  4085. aBoolean1233 = true;
  4086. inputTaken = true;
  4087. }
  4088. if (l == 1001) {
  4089. clanChatMode = 0;
  4090. aBoolean1233 = true;
  4091. inputTaken = true;
  4092. }
  4093. if (l == 1000) {
  4094. cButtonCPos = 4;
  4095. chatTypeView = 11;
  4096. aBoolean1233 = true;
  4097. inputTaken = true;
  4098. }
  4099. if (l == 999) {
  4100. cButtonCPos = 0;
  4101. chatTypeView = 0;
  4102. aBoolean1233 = true;
  4103. inputTaken = true;
  4104. }
  4105. if (l == 998) {
  4106. cButtonCPos = 1;
  4107. chatTypeView = 5;
  4108. aBoolean1233 = true;
  4109. inputTaken = true;
  4110. }
  4111. if (l == 997) {
  4112. publicChatMode = 3;
  4113. aBoolean1233 = true;
  4114. inputTaken = true;
  4115. }
  4116. if (l == 996) {
  4117. publicChatMode = 2;
  4118. aBoolean1233 = true;
  4119. inputTaken = true;
  4120. }
  4121. if (l == 995) {
  4122. publicChatMode = 1;
  4123. aBoolean1233 = true;
  4124. inputTaken = true;
  4125. }
  4126. if (l == 994) {
  4127. publicChatMode = 0;
  4128. aBoolean1233 = true;
  4129. inputTaken = true;
  4130. }
  4131. if (l == 993) {
  4132. cButtonCPos = 2;
  4133. chatTypeView = 1;
  4134. aBoolean1233 = true;
  4135. inputTaken = true;
  4136. }
  4137. if (l == 992) {
  4138. privateChatMode = 2;
  4139. aBoolean1233 = true;
  4140. inputTaken = true;
  4141. }
  4142. if (l == 991) {
  4143. privateChatMode = 1;
  4144. aBoolean1233 = true;
  4145. inputTaken = true;
  4146. }
  4147. if (l == 990) {
  4148. privateChatMode = 0;
  4149. aBoolean1233 = true;
  4150. inputTaken = true;
  4151. }
  4152. if (l == 989) {
  4153. cButtonCPos = 3;
  4154. chatTypeView = 2;
  4155. aBoolean1233 = true;
  4156. inputTaken = true;
  4157. }
  4158. if (l == 987) {
  4159. tradeMode = 2;
  4160. aBoolean1233 = true;
  4161. inputTaken = true;
  4162. }
  4163. if (l == 986) {
  4164. tradeMode = 1;
  4165. aBoolean1233 = true;
  4166. inputTaken = true;
  4167. }
  4168. if (l == 985) {
  4169. tradeMode = 0;
  4170. aBoolean1233 = true;
  4171. inputTaken = true;
  4172. }
  4173. if (l == 984) {
  4174. cButtonCPos = 5;
  4175. chatTypeView = 3;
  4176. aBoolean1233 = true;
  4177. inputTaken = true;
  4178. }
  4179. if (l == 983) {
  4180. duelMode = 2;
  4181. aBoolean1233 = true;
  4182. inputTaken = true;
  4183. }
  4184. if (l == 982) {
  4185. duelMode = 1;
  4186. aBoolean1233 = true;
  4187. inputTaken = true;
  4188. }
  4189. if (l == 981) {
  4190. duelMode = 0;
  4191. aBoolean1233 = true;
  4192. inputTaken = true;
  4193. }
  4194. if (l == 980) {
  4195. cButtonCPos = 6;
  4196. chatTypeView = 4;
  4197. aBoolean1233 = true;
  4198. inputTaken = true;
  4199. }
  4200. if (l == 493) {
  4201. stream.createFrame(75);
  4202. stream.method433(k);
  4203. stream.method431(j);
  4204. stream.method432(i1);
  4205. atInventoryLoopCycle = 0;
  4206. atInventoryInterface = k;
  4207. atInventoryIndex = j;
  4208. atInventoryInterfaceType = 2;
  4209. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4210. atInventoryInterfaceType = 1;
  4211. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4212. atInventoryInterfaceType = 3;
  4213. }
  4214. if (l == 652) {
  4215. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4216. if (!flag4)
  4217. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4218. crossX = super.saveClickX;
  4219. crossY = super.saveClickY;
  4220. crossType = 2;
  4221. crossIndex = 0;
  4222. stream.createFrame(156);
  4223. stream.method432(j + baseX);
  4224. stream.method431(k + baseY);
  4225. stream.method433(i1);
  4226. }
  4227. if (l == 94) {
  4228. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4229. if (!flag5)
  4230. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4231. crossX = super.saveClickX;
  4232. crossY = super.saveClickY;
  4233. crossType = 2;
  4234. crossIndex = 0;
  4235. stream.createFrame(181);
  4236. stream.method431(k + baseY);
  4237. stream.writeWord(i1);
  4238. stream.method431(j + baseX);
  4239. stream.method432(anInt1137);
  4240. }
  4241. if (l == 646) {
  4242. stream.createFrame(185);
  4243. stream.writeWord(k);
  4244. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4245. if (class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  4246. int i2 = class9_2.valueIndexArray[0][1];
  4247. if (variousSettings[i2] != class9_2.anIntArray212[0]) {
  4248. variousSettings[i2] = class9_2.anIntArray212[0];
  4249. method33(i2);
  4250. needDrawTabArea = true;
  4251. }
  4252. }
  4253. }
  4254. if (l == 225) {
  4255. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4256. if (class30_sub2_sub4_sub1_sub1_2 != null) {
  4257. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_2.smallY[0],
  4258. myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_2.smallX[0]);
  4259. crossX = super.saveClickX;
  4260. crossY = super.saveClickY;
  4261. crossType = 2;
  4262. crossIndex = 0;
  4263. anInt1226 += i1;
  4264. if (anInt1226 >= 85) {
  4265. stream.createFrame(230);
  4266. stream.writeWordBigEndian(239);
  4267. anInt1226 = 0;
  4268. }
  4269. stream.createFrame(17);
  4270. stream.method433(i1);
  4271. }
  4272. }
  4273. if (l == 965) {
  4274. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4275. if (class30_sub2_sub4_sub1_sub1_3 != null) {
  4276. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_3.smallY[0],
  4277. myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_3.smallX[0]);
  4278. crossX = super.saveClickX;
  4279. crossY = super.saveClickY;
  4280. crossType = 2;
  4281. crossIndex = 0;
  4282. anInt1134++;
  4283. if (anInt1134 >= 96) {
  4284. stream.createFrame(152);
  4285. stream.writeWordBigEndian(88);
  4286. anInt1134 = 0;
  4287. }
  4288. stream.createFrame(21);
  4289. stream.writeWord(i1);
  4290. }
  4291. }
  4292. if (l == 413) {
  4293. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4294. if (class30_sub2_sub4_sub1_sub1_4 != null) {
  4295. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_4.smallY[0],
  4296. myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_4.smallX[0]);
  4297. crossX = super.saveClickX;
  4298. crossY = super.saveClickY;
  4299. crossType = 2;
  4300. crossIndex = 0;
  4301. stream.createFrame(131);
  4302. stream.method433(i1);
  4303. stream.method432(anInt1137);
  4304. }
  4305. }
  4306. if (l == 200)
  4307. clearTopInterfaces();
  4308. if (l == 1025) {
  4309. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4310. if (class30_sub2_sub4_sub1_sub1_5 != null) {
  4311. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4312. if (entityDef.childrenIDs != null)
  4313. entityDef = entityDef.method161();
  4314. if (entityDef != null) {
  4315. String s9;
  4316. if (entityDef.description != null)
  4317. s9 = new String(entityDef.description);
  4318. else
  4319. s9 = "It's a " + entityDef.name + ".";
  4320. pushMessage(s9, 0, "");
  4321. }
  4322. }
  4323. }
  4324. if (l == 900) {
  4325. method66(i1, k, j);
  4326. stream.createFrame(252);
  4327. stream.method433(i1 >> 14 & 0x7fff);
  4328. stream.method431(k + baseY);
  4329. stream.method432(j + baseX);
  4330. }
  4331. if (l == 412) {
  4332. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4333. if (class30_sub2_sub4_sub1_sub1_6 != null) {
  4334. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_6.smallY[0],
  4335. myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_6.smallX[0]);
  4336. crossX = super.saveClickX;
  4337. crossY = super.saveClickY;
  4338. crossType = 2;
  4339. crossIndex = 0;
  4340. stream.createFrame(72);
  4341. stream.method432(i1);
  4342. }
  4343. }
  4344. if (l == 365) {
  4345. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4346. if (class30_sub2_sub4_sub1_sub2_3 != null) {
  4347. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_3.smallY[0],
  4348. myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_3.smallX[0]);
  4349. crossX = super.saveClickX;
  4350. crossY = super.saveClickY;
  4351. crossType = 2;
  4352. crossIndex = 0;
  4353. stream.createFrame(249);
  4354. stream.method432(i1);
  4355. stream.method431(anInt1137);
  4356. }
  4357. }
  4358. if (l == 729) {
  4359. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4360. if (class30_sub2_sub4_sub1_sub2_4 != null) {
  4361. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_4.smallY[0],
  4362. myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_4.smallX[0]);
  4363. crossX = super.saveClickX;
  4364. crossY = super.saveClickY;
  4365. crossType = 2;
  4366. crossIndex = 0;
  4367. stream.createFrame(39);
  4368. stream.method431(i1);
  4369. }
  4370. }
  4371. if (l == 577) {
  4372. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4373. if (class30_sub2_sub4_sub1_sub2_5 != null) {
  4374. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_5.smallY[0],
  4375. myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_5.smallX[0]);
  4376. crossX = super.saveClickX;
  4377. crossY = super.saveClickY;
  4378. crossType = 2;
  4379. crossIndex = 0;
  4380. stream.createFrame(139);
  4381. stream.method431(i1);
  4382. }
  4383. }
  4384. if (l == 956 && method66(i1, k, j)) {
  4385. stream.createFrame(35);
  4386. stream.method431(j + baseX);
  4387. stream.method432(anInt1137);
  4388. stream.method432(k + baseY);
  4389. stream.method431(i1 >> 14 & 0x7fff);
  4390. }
  4391. if (l == 567) {
  4392. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4393. if (!flag6)
  4394. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4395. crossX = super.saveClickX;
  4396. crossY = super.saveClickY;
  4397. crossType = 2;
  4398. crossIndex = 0;
  4399. stream.createFrame(23);
  4400. stream.method431(k + baseY);
  4401. stream.method431(i1);
  4402. stream.method431(j + baseX);
  4403. }
  4404. if (l == 867) {
  4405. if ((i1 & 3) == 0)
  4406. anInt1175++;
  4407. if (anInt1175 >= 59) {
  4408. stream.createFrame(200);
  4409. stream.writeWord(25501);
  4410. anInt1175 = 0;
  4411. }
  4412. stream.createFrame(43);
  4413. stream.method431(k);
  4414. stream.method432(i1);
  4415. stream.method432(j);
  4416. atInventoryLoopCycle = 0;
  4417. atInventoryInterface = k;
  4418. atInventoryIndex = j;
  4419. atInventoryInterfaceType = 2;
  4420. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4421. atInventoryInterfaceType = 1;
  4422. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4423. atInventoryInterfaceType = 3;
  4424. }
  4425. if (l == 543) {
  4426. stream.createFrame(237);
  4427. stream.writeWord(j);
  4428. stream.method432(i1);
  4429. stream.writeWord(k);
  4430. stream.method432(anInt1137);
  4431. atInventoryLoopCycle = 0;
  4432. atInventoryInterface = k;
  4433. atInventoryIndex = j;
  4434. atInventoryInterfaceType = 2;
  4435. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4436. atInventoryInterfaceType = 1;
  4437. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4438. atInventoryInterfaceType = 3;
  4439. }
  4440. if (l == 606) {
  4441. String s2 = menuActionName[i];
  4442. int j2 = s2.indexOf("@whi@");
  4443. if (j2 != -1)
  4444. if (openInterfaceID == -1) {
  4445. clearTopInterfaces();
  4446. reportAbuseInput = s2.substring(j2 + 5).trim();
  4447. canMute = false;
  4448. for (int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++) {
  4449. if (RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  4450. continue;
  4451. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4452. break;
  4453. }
  4454.  
  4455. } else {
  4456. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  4457. }
  4458. }
  4459. if (l == 491) {
  4460. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4461. if (class30_sub2_sub4_sub1_sub2_6 != null) {
  4462. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_6.smallY[0],
  4463. myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_6.smallX[0]);
  4464. crossX = super.saveClickX;
  4465. crossY = super.saveClickY;
  4466. crossType = 2;
  4467. crossIndex = 0;
  4468. stream.createFrame(14);
  4469. stream.method432(anInt1284);
  4470. stream.writeWord(i1);
  4471. stream.writeWord(anInt1285);
  4472. stream.method431(anInt1283);
  4473. }
  4474. }
  4475. if (l == 639) {
  4476. String s3 = menuActionName[i];
  4477. int k2 = s3.indexOf("@whi@");
  4478. if (k2 != -1) {
  4479. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4480. int k3 = -1;
  4481. for (int i4 = 0; i4 < friendsCount; i4++) {
  4482. if (friendsListAsLongs[i4] != l4)
  4483. continue;
  4484. k3 = i4;
  4485. break;
  4486. }
  4487.  
  4488. if (k3 != -1 && friendsNodeIDs[k3] > 0) {
  4489. inputTaken = true;
  4490. inputDialogState = 0;
  4491. messagePromptRaised = true;
  4492. promptInput = "";
  4493. friendsListAction = 3;
  4494. aLong953 = friendsListAsLongs[k3];
  4495. aString1121 = "Enter message to send to " + friendsList[k3];
  4496. }
  4497. }
  4498. }
  4499. if (l == 454) {
  4500. stream.createFrame(41);
  4501. stream.writeWord(i1);
  4502. stream.method432(j);
  4503. stream.method432(k);
  4504. atInventoryLoopCycle = 0;
  4505. atInventoryInterface = k;
  4506. atInventoryIndex = j;
  4507. atInventoryInterfaceType = 2;
  4508. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4509. atInventoryInterfaceType = 1;
  4510. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  4511. atInventoryInterfaceType = 3;
  4512. }
  4513. if (l == 478) {
  4514. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4515. if (class30_sub2_sub4_sub1_sub1_7 != null) {
  4516. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_7.smallY[0],
  4517. myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_7.smallX[0]);
  4518. crossX = super.saveClickX;
  4519. crossY = super.saveClickY;
  4520. crossType = 2;
  4521. crossIndex = 0;
  4522. if ((i1 & 3) == 0)
  4523. anInt1155++;
  4524. if (anInt1155 >= 53) {
  4525. stream.createFrame(85);
  4526. stream.writeWordBigEndian(66);
  4527. anInt1155 = 0;
  4528. }
  4529. stream.createFrame(18);
  4530. stream.method431(i1);
  4531. }
  4532. }
  4533. if (l == 113) {
  4534. method66(i1, k, j);
  4535. stream.createFrame(70);
  4536. stream.method431(j + baseX);
  4537. stream.writeWord(k + baseY);
  4538. stream.method433(i1 >> 14 & 0x7fff);
  4539. }
  4540. if (l == 872) {
  4541. method66(i1, k, j);
  4542. stream.createFrame(234);
  4543. stream.method433(j + baseX);
  4544. stream.method432(i1 >> 14 & 0x7fff);
  4545. stream.method433(k + baseY);
  4546. }
  4547. if (l == 502) {
  4548. method66(i1, k, j);
  4549. stream.createFrame(132);
  4550. stream.method433(j + baseX);
  4551. stream.writeWord(i1 >> 14 & 0x7fff);
  4552. stream.method432(k + baseY);
  4553. }
  4554. if (l == 1125) {
  4555. ItemDef itemDef = ItemDef.forID(i1);
  4556. RSInterface class9_4 = RSInterface.interfaceCache[k];
  4557. String s5;
  4558. if (class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  4559. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  4560. else if (itemDef.description != null)
  4561. s5 = new String(itemDef.description);
  4562. else
  4563. s5 = "It's a " + itemDef.name + ".";
  4564. pushMessage(s5, 0, "");
  4565. }
  4566. if (l == 169) {
  4567. stream.createFrame(185);
  4568. stream.writeWord(k);
  4569. RSInterface class9_3 = RSInterface.interfaceCache[k];
  4570. if (class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  4571. int l2 = class9_3.valueIndexArray[0][1];
  4572. variousSettings[l2] = 1 - variousSettings[l2];
  4573. method33(l2);
  4574. needDrawTabArea = true;
  4575. }
  4576. }
  4577. if (l == 447) {
  4578. itemSelected = 1;
  4579. anInt1283 = j;
  4580. anInt1284 = k;
  4581. anInt1285 = i1;
  4582. selectedItemName = ItemDef.forID(i1).name;
  4583. spellSelected = 0;
  4584. needDrawTabArea = true;
  4585. return;
  4586. }
  4587. if (l == 1226) {
  4588. int j1 = i1 >> 14 & 0x7fff;
  4589. ObjectDef class46 = ObjectDef.forID(j1);
  4590. String s10;
  4591. if (class46.description != null)
  4592. s10 = new String(class46.description);
  4593. else
  4594. s10 = "It's a " + class46.name + ".";
  4595. pushMessage(s10, 0, "");
  4596. }
  4597. if (l == 244) {
  4598. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4599. if (!flag7)
  4600. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4601. crossX = super.saveClickX;
  4602. crossY = super.saveClickY;
  4603. crossType = 2;
  4604. crossIndex = 0;
  4605. stream.createFrame(253);
  4606. stream.method431(j + baseX);
  4607. stream.method433(k + baseY);
  4608. stream.method432(i1);
  4609. }
  4610. if (l == 1448) {
  4611. ItemDef itemDef_1 = ItemDef.forID(i1);
  4612. String s6;
  4613. if (itemDef_1.description != null)
  4614. s6 = new String(itemDef_1.description);
  4615. else
  4616. s6 = "It's a " + itemDef_1.name + ".";
  4617. pushMessage(s6, 0, "");
  4618. }
  4619. itemSelected = 0;
  4620. spellSelected = 0;
  4621. needDrawTabArea = true;
  4622.  
  4623. }
  4624.  
  4625. private void method70() {
  4626. anInt1251 = 0;
  4627. int j = (myPlayer.x >> 7) + baseX;
  4628. int k = (myPlayer.y >> 7) + baseY;
  4629. if (j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  4630. anInt1251 = 1;
  4631. if (j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  4632. anInt1251 = 1;
  4633. if (anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  4634. anInt1251 = 0;
  4635. }
  4636.  
  4637. public void run() {
  4638. if (drawFlames) {
  4639. drawFlames();
  4640. } else {
  4641. super.run();
  4642. }
  4643. }
  4644.  
  4645. public void loadExtraSprites() {
  4646. for (int i4 = 0; i4 < 3; i4++) {
  4647. hitMark[i4] = new Sprite("Player/Hits " + i4 + "");
  4648. }
  4649. }
  4650.  
  4651. private void build3dScreenMenu() {
  4652. if (itemSelected == 0 && spellSelected == 0) {
  4653. menuActionName[menuActionRow] = "Walk here";
  4654. menuActionID[menuActionRow] = 516;
  4655. menuActionCmd2[menuActionRow] = super.mouseX;
  4656. menuActionCmd3[menuActionRow] = super.mouseY;
  4657. menuActionRow++;
  4658. }
  4659. int j = -1;
  4660. for (int k = 0; k < Model.anInt1687; k++) {
  4661. int l = Model.anIntArray1688[k];
  4662. int i1 = l & 0x7f;
  4663. int j1 = l >> 7 & 0x7f;
  4664. int k1 = l >> 29 & 3;
  4665. int l1 = l >> 14 & 0x7fff;
  4666. if (l == j)
  4667. continue;
  4668. j = l;
  4669. if (k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0) {
  4670. ObjectDef class46 = ObjectDef.forID(l1);
  4671. if (class46.childrenIDs != null)
  4672. class46 = class46.method580();
  4673. if (class46 == null)
  4674. continue;
  4675. if (itemSelected == 1) {
  4676. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
  4677. menuActionID[menuActionRow] = 62;
  4678. menuActionCmd1[menuActionRow] = l;
  4679. menuActionCmd2[menuActionRow] = i1;
  4680. menuActionCmd3[menuActionRow] = j1;
  4681. menuActionRow++;
  4682. } else if (spellSelected == 1) {
  4683. if ((spellUsableOn & 4) == 4) {
  4684. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  4685. menuActionID[menuActionRow] = 956;
  4686. menuActionCmd1[menuActionRow] = l;
  4687. menuActionCmd2[menuActionRow] = i1;
  4688. menuActionCmd3[menuActionRow] = j1;
  4689. menuActionRow++;
  4690. }
  4691. } else {
  4692. if (class46.actions != null) {
  4693. for (int i2 = 4; i2 >= 0; i2--)
  4694. if (class46.actions[i2] != null) {
  4695. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  4696. if (i2 == 0)
  4697. menuActionID[menuActionRow] = 502;
  4698. if (i2 == 1)
  4699. menuActionID[menuActionRow] = 900;
  4700. if (i2 == 2)
  4701. menuActionID[menuActionRow] = 113;
  4702. if (i2 == 3)
  4703. menuActionID[menuActionRow] = 872;
  4704. if (i2 == 4)
  4705. menuActionID[menuActionRow] = 1062;
  4706. menuActionCmd1[menuActionRow] = l;
  4707. menuActionCmd2[menuActionRow] = i1;
  4708. menuActionCmd3[menuActionRow] = j1;
  4709. menuActionRow++;
  4710. }
  4711.  
  4712. }
  4713. // menuActionName[menuActionRow] = "Examine @cya@" +
  4714. // class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" +
  4715. // (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  4716. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  4717. menuActionID[menuActionRow] = 1226;
  4718. menuActionCmd1[menuActionRow] = class46.type << 14;
  4719. menuActionCmd2[menuActionRow] = i1;
  4720. menuActionCmd3[menuActionRow] = j1;
  4721. menuActionRow++;
  4722. }
  4723. }
  4724. if (k1 == 1) {
  4725. NPC npc = npcArray[l1];
  4726. if (npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64) {
  4727. for (int j2 = 0; j2 < npcCount; j2++) {
  4728. NPC npc2 = npcArray[npcIndices[j2]];
  4729. if (npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  4730. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  4731. }
  4732.  
  4733. for (int l2 = 0; l2 < playerCount; l2++) {
  4734. Player player = playerArray[playerIndices[l2]];
  4735. if (player != null && player.x == npc.x && player.y == npc.y)
  4736. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  4737. }
  4738.  
  4739. }
  4740. buildAtNPCMenu(npc.desc, l1, j1, i1);
  4741. }
  4742. if (k1 == 0) {
  4743. Player player = playerArray[l1];
  4744. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  4745. for (int k2 = 0; k2 < npcCount; k2++) {
  4746. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  4747. if (class30_sub2_sub4_sub1_sub1_2 != null && class30_sub2_sub4_sub1_sub1_2.desc.aByte68 == 1
  4748. && class30_sub2_sub4_sub1_sub1_2.x == player.x
  4749. && class30_sub2_sub4_sub1_sub1_2.y == player.y)
  4750. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  4751. }
  4752.  
  4753. for (int i3 = 0; i3 < playerCount; i3++) {
  4754. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  4755. if (class30_sub2_sub4_sub1_sub2_2 != null && class30_sub2_sub4_sub1_sub2_2 != player
  4756. && class30_sub2_sub4_sub1_sub2_2.x == player.x
  4757. && class30_sub2_sub4_sub1_sub2_2.y == player.y)
  4758. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  4759. }
  4760.  
  4761. }
  4762. buildAtPlayerMenu(i1, l1, player, j1);
  4763. }
  4764. if (k1 == 3) {
  4765. NodeList class19 = groundArray[plane][i1][j1];
  4766. if (class19 != null) {
  4767. for (Item item = (Item) class19.getFirst(); item != null; item = (Item) class19.getNext()) {
  4768. ItemDef itemDef = ItemDef.forID(item.ID);
  4769. if (itemSelected == 1) {
  4770. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  4771. menuActionID[menuActionRow] = 511;
  4772. menuActionCmd1[menuActionRow] = item.ID;
  4773. menuActionCmd2[menuActionRow] = i1;
  4774. menuActionCmd3[menuActionRow] = j1;
  4775. menuActionRow++;
  4776. } else if (spellSelected == 1) {
  4777. if ((spellUsableOn & 1) == 1) {
  4778. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  4779. menuActionID[menuActionRow] = 94;
  4780. menuActionCmd1[menuActionRow] = item.ID;
  4781. menuActionCmd2[menuActionRow] = i1;
  4782. menuActionCmd3[menuActionRow] = j1;
  4783. menuActionRow++;
  4784. }
  4785. } else {
  4786. for (int j3 = 4; j3 >= 0; j3--)
  4787. if (itemDef.groundActions != null && itemDef.groundActions[j3] != null) {
  4788. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  4789. if (j3 == 0)
  4790. menuActionID[menuActionRow] = 652;
  4791. if (j3 == 1)
  4792. menuActionID[menuActionRow] = 567;
  4793. if (j3 == 2)
  4794. menuActionID[menuActionRow] = 234;
  4795. if (j3 == 3)
  4796. menuActionID[menuActionRow] = 244;
  4797. if (j3 == 4)
  4798. menuActionID[menuActionRow] = 213;
  4799. menuActionCmd1[menuActionRow] = item.ID;
  4800. menuActionCmd2[menuActionRow] = i1;
  4801. menuActionCmd3[menuActionRow] = j1;
  4802. menuActionRow++;
  4803. } else if (j3 == 2) {
  4804. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  4805. menuActionID[menuActionRow] = 234;
  4806. menuActionCmd1[menuActionRow] = item.ID;
  4807. menuActionCmd2[menuActionRow] = i1;
  4808. menuActionCmd3[menuActionRow] = j1;
  4809. menuActionRow++;
  4810. }
  4811.  
  4812. // menuActionName[menuActionRow] = "Examine @lre@" +
  4813. // itemDef.name + " @gre@(@whi@" + item.ID +
  4814. // "@gre@)";
  4815. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  4816. menuActionID[menuActionRow] = 1448;
  4817. menuActionCmd1[menuActionRow] = item.ID;
  4818. menuActionCmd2[menuActionRow] = i1;
  4819. menuActionCmd3[menuActionRow] = j1;
  4820. menuActionRow++;
  4821. }
  4822. }
  4823.  
  4824. }
  4825. }
  4826. }
  4827. }
  4828.  
  4829. public void cleanUpForQuit() {
  4830. signlink.reporterror = false;
  4831. try {
  4832. if (socketStream != null)
  4833. socketStream.close();
  4834. } catch (Exception _ex) {
  4835. }
  4836. socketStream = null;
  4837. stopMidi();
  4838. if (mouseDetection != null)
  4839. mouseDetection.running = false;
  4840. mouseDetection = null;
  4841. onDemandFetcher.disable();
  4842. onDemandFetcher = null;
  4843. aStream_834 = null;
  4844. stream = null;
  4845. aStream_847 = null;
  4846. inStream = null;
  4847. anIntArray1234 = null;
  4848. aByteArrayArray1183 = null;
  4849. aByteArrayArray1247 = null;
  4850. anIntArray1235 = null;
  4851. anIntArray1236 = null;
  4852. intGroundArray = null;
  4853. byteGroundArray = null;
  4854. worldController = null;
  4855. aClass11Array1230 = null;
  4856. anIntArrayArray901 = null;
  4857. anIntArrayArray825 = null;
  4858. bigX = null;
  4859. bigY = null;
  4860. aByteArray912 = null;
  4861. aGraphicsBuffer_1163 = null;
  4862. mapEdgeIP = null;
  4863. leftFrame = null;
  4864. topFrame = null;
  4865. rightFrame = null;
  4866. aGraphicsBuffer_1164 = null;
  4867. aGraphicsBuffer_1165 = null;
  4868. aGraphicsBuffer_1166 = null;
  4869. aGraphicsBuffer_1123 = null;
  4870. aGraphicsBuffer_1124 = null;
  4871. aGraphicsBuffer_1125 = null;
  4872. /* Null pointers for custom sprites */
  4873. chatArea = null;
  4874. chatButtons = null;
  4875. tabArea = null;
  4876. HPBarFull = null;
  4877. HPBarEmpty = null;
  4878. mapArea = null;
  4879. /**/
  4880. mapBack = null;
  4881. sideIcons = null;
  4882. redStones = null;
  4883. compass = null;
  4884. hitMarks = null;
  4885. hitMark = null;
  4886. headIcons = null;
  4887. skullIcons = null;
  4888. headIconsHint = null;
  4889. crosses = null;
  4890. mapDotItem = null;
  4891. mapDotNPC = null;
  4892. mapDotPlayer = null;
  4893. mapDotFriend = null;
  4894. mapDotTeam = null;
  4895. mapScenes = null;
  4896. mapFunctions = null;
  4897. anIntArrayArray929 = null;
  4898. playerArray = null;
  4899. playerIndices = null;
  4900. anIntArray894 = null;
  4901. aStreamArray895s = null;
  4902. anIntArray840 = null;
  4903. npcArray = null;
  4904. npcIndices = null;
  4905. groundArray = null;
  4906. aClass19_1179 = null;
  4907. aClass19_1013 = null;
  4908. aClass19_1056 = null;
  4909. menuActionCmd2 = null;
  4910. menuActionCmd3 = null;
  4911. menuActionID = null;
  4912. menuActionCmd1 = null;
  4913. menuActionName = null;
  4914. variousSettings = null;
  4915. anIntArray1072 = null;
  4916. anIntArray1073 = null;
  4917. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  4918. aClass30_Sub2_Sub1_Sub1_1263 = null;
  4919. friendsList = null;
  4920. friendsListAsLongs = null;
  4921. friendsNodeIDs = null;
  4922. aGraphicsBuffer_1110 = null;
  4923. aGraphicsBuffer_1111 = null;
  4924. aGraphicsBuffer_1107 = null;
  4925. aGraphicsBuffer_1108 = null;
  4926. aGraphicsBuffer_1109 = null;
  4927. aGraphicsBuffer_1112 = null;
  4928. aGraphicsBuffer_1113 = null;
  4929. aGraphicsBuffer_1114 = null;
  4930. aGraphicsBuffer_1115 = null;
  4931. multiOverlay = null;
  4932. nullLoader();
  4933. ObjectDef.nullLoader();
  4934. EntityDef.nullLoader();
  4935. ItemDef.nullLoader();
  4936. Flo.cache = null;
  4937. IDK.cache = null;
  4938. RSInterface.interfaceCache = null;
  4939. DummyClass.cache = null;
  4940. Animation.anims = null;
  4941. SpotAnim.cache = null;
  4942. SpotAnim.aMRUNodes_415 = null;
  4943. Varp.cache = null;
  4944. super.fullGameScreen = null;
  4945. Player.mruNodes = null;
  4946. Texture.nullLoader();
  4947. WorldController.nullLoader();
  4948. Model.nullLoader();
  4949. Class36.nullLoader();
  4950. System.gc();
  4951. }
  4952.  
  4953. private void printDebug() {
  4954. System.out.println("============");
  4955. System.out.println("flame-cycle:" + anInt1208);
  4956. if (onDemandFetcher != null)
  4957. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  4958. System.out.println("loop-cycle:" + loopCycle);
  4959. System.out.println("draw-cycle:" + anInt1061);
  4960. System.out.println("ptype:" + pktType);
  4961. System.out.println("psize:" + pktSize);
  4962. if (socketStream != null)
  4963. socketStream.printDebug();
  4964. super.shouldDebug = true;
  4965. }
  4966.  
  4967. Component getGameComponent() {
  4968. if (signlink.mainapp != null)
  4969. return signlink.mainapp;
  4970. if (super.gameFrame != null)
  4971. return super.gameFrame;
  4972. else
  4973. return this;
  4974. }
  4975.  
  4976. private void method73() {
  4977. do {
  4978. int j = readChar(-796);
  4979. if (j == -1)
  4980. break;
  4981. if (openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  4982. if (j == 8 && reportAbuseInput.length() > 0)
  4983. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  4984. if ((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32)
  4985. && reportAbuseInput.length() < 12)
  4986. reportAbuseInput += (char) j;
  4987. } else if (messagePromptRaised) {
  4988. if (j >= 32 && j <= 122 && promptInput.length() < 80) {
  4989. promptInput += (char) j;
  4990. inputTaken = true;
  4991. }
  4992. if (j == 8 && promptInput.length() > 0) {
  4993. promptInput = promptInput.substring(0, promptInput.length() - 1);
  4994. inputTaken = true;
  4995. }
  4996. if (j == 13 || j == 10) {
  4997. messagePromptRaised = false;
  4998. inputTaken = true;
  4999. if (friendsListAction == 1) {
  5000. long l = TextClass.longForName(promptInput);
  5001. addFriend(l);
  5002. }
  5003. if (friendsListAction == 2 && friendsCount > 0) {
  5004. long l1 = TextClass.longForName(promptInput);
  5005. delFriend(l1);
  5006. }
  5007. if (friendsListAction == 3 && promptInput.length() > 0) {
  5008. stream.createFrame(126);
  5009. stream.writeWordBigEndian(0);
  5010. int k = stream.currentOffset;
  5011. stream.writeQWord(aLong953);
  5012. TextInput.method526(promptInput, stream);
  5013. stream.writeBytes(stream.currentOffset - k);
  5014. promptInput = TextInput.processText(promptInput);
  5015. // promptInput = Censor.doCensor(promptInput);
  5016. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5017. if (privateChatMode == 2) {
  5018. privateChatMode = 1;
  5019. aBoolean1233 = true;
  5020. stream.createFrame(95);
  5021. stream.writeWordBigEndian(publicChatMode);
  5022. stream.writeWordBigEndian(privateChatMode);
  5023. stream.writeWordBigEndian(tradeMode);
  5024. }
  5025. }
  5026. if (friendsListAction == 4 && ignoreCount < 100) {
  5027. long l2 = TextClass.longForName(promptInput);
  5028. addIgnore(l2);
  5029. }
  5030. if (friendsListAction == 5 && ignoreCount > 0) {
  5031. long l3 = TextClass.longForName(promptInput);
  5032. delIgnore(l3);
  5033. }
  5034. if (friendsListAction == 6) {
  5035. long l3 = TextClass.longForName(promptInput);
  5036. chatJoin(l3);
  5037. }
  5038. }
  5039. } else if (inputDialogState == 1) {
  5040. if (j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5041. amountOrNameInput += (char) j;
  5042. inputTaken = true;
  5043. }
  5044. if (j == 8 && amountOrNameInput.length() > 0) {
  5045. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5046. inputTaken = true;
  5047. }
  5048. if (j == 13 || j == 10) {
  5049. if (amountOrNameInput.length() > 0) {
  5050. int i1 = 0;
  5051. try {
  5052. i1 = Integer.parseInt(amountOrNameInput);
  5053. } catch (Exception _ex) {
  5054. }
  5055. stream.createFrame(208);
  5056. stream.writeDWord(i1);
  5057. }
  5058. inputDialogState = 0;
  5059. inputTaken = true;
  5060. }
  5061. } else if (inputDialogState == 2) {
  5062. if (j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5063. amountOrNameInput += (char) j;
  5064. inputTaken = true;
  5065. }
  5066. if (j == 8 && amountOrNameInput.length() > 0) {
  5067. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5068. inputTaken = true;
  5069. }
  5070. if (j == 13 || j == 10) {
  5071. if (amountOrNameInput.length() > 0) {
  5072. stream.createFrame(60);
  5073. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5074. }
  5075. inputDialogState = 0;
  5076. inputTaken = true;
  5077. }
  5078. } else if (backDialogID == -1) {
  5079. if (j >= 32 && j <= 122 && inputString.length() < 80) {
  5080. inputString += (char) j;
  5081. inputTaken = true;
  5082. }
  5083. if (j == 8 && inputString.length() > 0) {
  5084. inputString = inputString.substring(0, inputString.length() - 1);
  5085. inputTaken = true;
  5086. }
  5087. if ((j == 13 || j == 10) && inputString.length() > 0) {
  5088. if (myPrivilege == 2 || server.equals("127.0.0.1")
  5089. || 1 == 1/* to remove */) {
  5090. if (inputString.startsWith("//setspecto")) {
  5091. int amt = Integer.parseInt(inputString.substring(12));
  5092. anIntArray1045[300] = amt;
  5093. if (variousSettings[300] != amt) {
  5094. variousSettings[300] = amt;
  5095. method33(300);
  5096. needDrawTabArea = true;
  5097. if (dialogID != -1)
  5098. inputTaken = true;
  5099. }
  5100. }
  5101. if (inputString.equals("clientdrop"))
  5102. dropClient();
  5103. if (inputString.equals("::dumpmodels"))
  5104. models();
  5105. if (inputString.equals("dumpnpcs"))
  5106. EntityDef.rewriteNpcs();
  5107. if (inputString.startsWith("full")) {
  5108. try {
  5109. String[] args = inputString.split(" ");
  5110. int id1 = Integer.parseInt(args[1]);
  5111. int id2 = Integer.parseInt(args[2]);
  5112. fullscreenInterfaceID = id1;
  5113. openInterfaceID = id2;
  5114. pushMessage("Opened Interface", 0, "");
  5115. } catch (Exception e) {
  5116. pushMessage("Interface Failed to load", 0, "");
  5117. }
  5118. }
  5119. if (inputString.equals("::lag"))
  5120. printDebug();
  5121. if (inputString.equals("::prefetchmusic")) {
  5122. for (int j1 = 0; j1 < onDemandFetcher.getVersionCount(2); j1++)
  5123. onDemandFetcher.method563((byte) 1, 2, j1);
  5124.  
  5125. }
  5126. if (inputString.equals("::tweenoff")) {
  5127. enableTweening = false;
  5128. }
  5129. if (inputString.equals("::tweenon")) {
  5130. enableTweening = true;
  5131. }
  5132. if (inputString.equals("::hd")) {
  5133. aBoolean594 = true;
  5134. aBoolean234 = true;
  5135. enableTweening = true;
  5136. }
  5137. if (inputString.equals("::ld")) {
  5138. aBoolean594 = false;
  5139. aBoolean234 = false;
  5140. enableTweening = false;
  5141. }
  5142. if (inputString.equals("::x10on"))
  5143. newDamage = true;
  5144. if (inputString.equals("::x10off"))
  5145. newDamage = false;
  5146. if (inputString.equals("::fpson"))
  5147. fpsOn = true;
  5148. if (inputString.equals("::fpsoff"))
  5149. fpsOn = false;
  5150. if (inputString.equals("::dataon"))
  5151. clientData = true;
  5152. if (inputString.equals("::dataoff"))
  5153. clientData = false;
  5154. if (inputString.equals("::noclip")) {
  5155. for (int k1 = 0; k1 < 4; k1++) {
  5156. for (int i2 = 1; i2 < 103; i2++) {
  5157. for (int k2 = 1; k2 < 103; k2++)
  5158. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5159.  
  5160. }
  5161. }
  5162. }
  5163. }
  5164. if (inputString.startsWith("/"))
  5165. inputString = "::" + inputString;
  5166. if (inputString.equals("add model")) {
  5167. try {
  5168. int ModelIndex = Integer
  5169. .parseInt(JOptionPane.showInputDialog(this, "Enter model ID", "Model", 3));
  5170. byte[] abyte0 = getModel(ModelIndex);
  5171. if (abyte0 != null && abyte0.length > 0) {
  5172. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  5173. pushMessage("Model: [" + ModelIndex + "] added successfully!", 0, "");
  5174. } else {
  5175. pushMessage("Unable to find the model. " + ModelIndex, 0, "");
  5176. }
  5177. } catch (Exception e) {
  5178. pushMessage("Syntax - ::add model <path>", 0, "");
  5179. }
  5180. }
  5181. if (inputString.startsWith("::")) {
  5182. stream.createFrame(103);
  5183. stream.writeWordBigEndian(inputString.length() - 1);
  5184. stream.writeString(inputString.substring(2));
  5185. } else {
  5186. String s = inputString.toLowerCase();
  5187. int j2 = 0;
  5188. if (s.startsWith("yellow:")) {
  5189. j2 = 0;
  5190. inputString = inputString.substring(7);
  5191. } else if (s.startsWith("red:")) {
  5192. j2 = 1;
  5193. inputString = inputString.substring(4);
  5194. } else if (s.startsWith("green:")) {
  5195. j2 = 2;
  5196. inputString = inputString.substring(6);
  5197. } else if (s.startsWith("cyan:")) {
  5198. j2 = 3;
  5199. inputString = inputString.substring(5);
  5200. } else if (s.startsWith("purple:")) {
  5201. j2 = 4;
  5202. inputString = inputString.substring(7);
  5203. } else if (s.startsWith("white:")) {
  5204. j2 = 5;
  5205. inputString = inputString.substring(6);
  5206. } else if (s.startsWith("flash1:")) {
  5207. j2 = 6;
  5208. inputString = inputString.substring(7);
  5209. } else if (s.startsWith("flash2:")) {
  5210. j2 = 7;
  5211. inputString = inputString.substring(7);
  5212. } else if (s.startsWith("flash3:")) {
  5213. j2 = 8;
  5214. inputString = inputString.substring(7);
  5215. } else if (s.startsWith("glow1:")) {
  5216. j2 = 9;
  5217. inputString = inputString.substring(6);
  5218. } else if (s.startsWith("glow2:")) {
  5219. j2 = 10;
  5220. inputString = inputString.substring(6);
  5221. } else if (s.startsWith("glow3:")) {
  5222. j2 = 11;
  5223. inputString = inputString.substring(6);
  5224. }
  5225. s = inputString.toLowerCase();
  5226. int i3 = 0;
  5227. if (s.startsWith("wave:")) {
  5228. i3 = 1;
  5229. inputString = inputString.substring(5);
  5230. } else if (s.startsWith("wave2:")) {
  5231. i3 = 2;
  5232. inputString = inputString.substring(6);
  5233. } else if (s.startsWith("shake:")) {
  5234. i3 = 3;
  5235. inputString = inputString.substring(6);
  5236. } else if (s.startsWith("scroll:")) {
  5237. i3 = 4;
  5238. inputString = inputString.substring(7);
  5239. } else if (s.startsWith("slide:")) {
  5240. i3 = 5;
  5241. inputString = inputString.substring(6);
  5242. }
  5243. stream.createFrame(4);
  5244. stream.writeWordBigEndian(0);
  5245. int j3 = stream.currentOffset;
  5246. stream.method425(i3);
  5247. stream.method425(j2);
  5248. aStream_834.currentOffset = 0;
  5249. TextInput.method526(inputString, aStream_834);
  5250. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  5251. stream.writeBytes(stream.currentOffset - j3);
  5252. inputString = TextInput.processText(inputString);
  5253. // inputString = Censor.doCensor(inputString);
  5254. myPlayer.textSpoken = inputString;
  5255. myPlayer.anInt1513 = j2;
  5256. myPlayer.anInt1531 = i3;
  5257. myPlayer.textCycle = 150;
  5258. if (myPrivilege == 2)
  5259. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  5260. else if (myPrivilege == 1)
  5261. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  5262. else
  5263. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  5264. if (publicChatMode == 2) {
  5265. publicChatMode = 3;
  5266. aBoolean1233 = true;
  5267. stream.createFrame(95);
  5268. stream.writeWordBigEndian(publicChatMode);
  5269. stream.writeWordBigEndian(privateChatMode);
  5270. stream.writeWordBigEndian(tradeMode);
  5271. }
  5272. }
  5273. inputString = "";
  5274. inputTaken = true;
  5275. }
  5276. }
  5277. } while (true);
  5278. }
  5279.  
  5280. private void buildPublicChat(int j) {
  5281. int l = 0;
  5282. for (int i1 = 0; i1 < 500; i1++) {
  5283. if (chatMessages[i1] == null)
  5284. continue;
  5285. if (chatTypeView != 1)
  5286. continue;
  5287. int j1 = chatTypes[i1];
  5288. String s = chatNames[i1];
  5289. String ct = chatMessages[i1];
  5290. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5291. if (k1 < -23)
  5292. break;
  5293. if (s != null && s.startsWith("@cr1@"))
  5294. s = s.substring(5);
  5295. if (s != null && s.startsWith("@cr2@"))
  5296. s = s.substring(5);
  5297. if (s != null && s.startsWith("@cr3@"))
  5298. s = s.substring(5);
  5299. if ((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5300. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5301. if (myPrivilege >= 1) {
  5302. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5303. menuActionID[menuActionRow] = 606;
  5304. menuActionRow++;
  5305. }
  5306. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5307. menuActionID[menuActionRow] = 42;
  5308. menuActionRow++;
  5309. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5310. menuActionID[menuActionRow] = 337;
  5311. menuActionRow++;
  5312. }
  5313. l++;
  5314. }
  5315. }
  5316. }
  5317.  
  5318. private void buildFriendChat(int j) {
  5319. int l = 0;
  5320. for (int i1 = 0; i1 < 500; i1++) {
  5321. if (chatMessages[i1] == null)
  5322. continue;
  5323. if (chatTypeView != 2)
  5324. continue;
  5325. int j1 = chatTypes[i1];
  5326. String s = chatNames[i1];
  5327. String ct = chatMessages[i1];
  5328. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5329. if (k1 < -23)
  5330. break;
  5331. if (s != null && s.startsWith("@cr1@"))
  5332. s = s.substring(5);
  5333. if (s != null && s.startsWith("@cr2@"))
  5334. s = s.substring(5);
  5335. if (s != null && s.startsWith("@cr3@"))
  5336. s = s.substring(5);
  5337. if ((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2)
  5338. && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5339. l++;
  5340. if ((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2)
  5341. && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  5342. if (j > k1 - 14 && j <= k1) {
  5343. if (myPrivilege >= 1) {
  5344. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5345. menuActionID[menuActionRow] = 606;
  5346. menuActionRow++;
  5347. }
  5348. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5349. menuActionID[menuActionRow] = 42;
  5350. menuActionRow++;
  5351. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5352. menuActionID[menuActionRow] = 337;
  5353. menuActionRow++;
  5354. }
  5355. l++;
  5356. }
  5357. }
  5358. }
  5359.  
  5360. private void buildDuelorTrade(int j) {
  5361. int l = 0;
  5362. for (int i1 = 0; i1 < 500; i1++) {
  5363. if (chatMessages[i1] == null)
  5364. continue;
  5365. if (chatTypeView != 3 && chatTypeView != 4)
  5366. continue;
  5367. int j1 = chatTypes[i1];
  5368. String s = chatNames[i1];
  5369. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5370. if (k1 < -23)
  5371. break;
  5372. if (s != null && s.startsWith("@cr1@"))
  5373. s = s.substring(5);
  5374. if (s != null && s.startsWith("@cr2@"))
  5375. s = s.substring(5);
  5376. if (s != null && s.startsWith("@cr3@"))
  5377. s = s.substring(5);
  5378. if (chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5379. if (j > k1 - 14 && j <= k1) {
  5380. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5381. menuActionID[menuActionRow] = 484;
  5382. menuActionRow++;
  5383. }
  5384. l++;
  5385. }
  5386. if (chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5387. if (j > k1 - 14 && j <= k1) {
  5388. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5389. menuActionID[menuActionRow] = 6;
  5390. menuActionRow++;
  5391. }
  5392. l++;
  5393. }
  5394. if (j1 == 12) {
  5395. if (j > k1 - 14 && j <= k1) {
  5396. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  5397. menuActionID[menuActionRow] = 915;
  5398. menuActionRow++;
  5399. }
  5400. l++;
  5401. }
  5402. }
  5403. }
  5404.  
  5405. private void buildChatAreaMenu(int j) {
  5406. int l = 0;
  5407. int test = 0;
  5408. for (int i1 = 0; i1 < 500; i1++) {
  5409. if (chatMessages[i1] == null)
  5410. continue;
  5411. int j1 = chatTypes[i1];
  5412. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5413. if (k1 < -23)
  5414. break;
  5415. String s = chatNames[i1];
  5416. String ct = chatMessages[i1];
  5417. boolean flag = false;
  5418. if (chatTypeView == 1) {
  5419. buildPublicChat(j);
  5420. break;
  5421. }
  5422. if (chatTypeView == 2) {
  5423. buildFriendChat(j);
  5424. break;
  5425. }
  5426. if (chatTypeView == 3 || chatTypeView == 4) {
  5427. buildDuelorTrade(j);
  5428. break;
  5429. }
  5430. if (chatTypeView == 5) {
  5431. break;
  5432. }
  5433. if (s != null && s.startsWith("@cr1@")) {
  5434. s = s.substring(5);
  5435. boolean flag1 = true;
  5436. byte byte0 = 1;
  5437. }
  5438. if (s != null && s.startsWith("@cr2@")) {
  5439. s = s.substring(5);
  5440. byte byte0 = 2;
  5441. }
  5442. if (s != null && s.startsWith("@cr3@")) {
  5443. s = s.substring(5);
  5444. byte byte0 = 3;
  5445. }
  5446. if (j1 == 0)
  5447. l++;
  5448. if ((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5449. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5450. if (myPrivilege >= 1) {
  5451. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5452. menuActionID[menuActionRow] = 606;
  5453. menuActionRow++;
  5454. }
  5455. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5456. menuActionID[menuActionRow] = 42;
  5457. menuActionRow++;
  5458. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5459. menuActionID[menuActionRow] = 337;
  5460. menuActionRow++;
  5461. }
  5462. l++;
  5463. }
  5464. if ((j1 == 3 || j1 == 7) && splitPrivateChat == 0
  5465. && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  5466. if (j > k1 - 14 && j <= k1) {
  5467. if (myPrivilege >= 1) {
  5468. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5469. menuActionID[menuActionRow] = 606;
  5470. menuActionRow++;
  5471. }
  5472. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5473. menuActionID[menuActionRow] = 42;
  5474. menuActionRow++;
  5475. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5476. menuActionID[menuActionRow] = 337;
  5477. menuActionRow++;
  5478. }
  5479. l++;
  5480. }
  5481. if (j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5482. if (j > k1 - 14 && j <= k1) {
  5483. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5484. menuActionID[menuActionRow] = 484;
  5485. menuActionRow++;
  5486. }
  5487. l++;
  5488. }
  5489. if ((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  5490. l++;
  5491. if (j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5492. if (j > k1 - 14 && j <= k1) {
  5493. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5494. menuActionID[menuActionRow] = 6;
  5495. menuActionRow++;
  5496. }
  5497. l++;
  5498. }
  5499. }
  5500. }
  5501.  
  5502. private void drawFriendsListOrWelcomeScreen(RSInterface class9) {
  5503. int j = class9.contentType;
  5504. if (j >= 1 && j <= 100 || j >= 701 && j <= 800) {
  5505. if (j == 1 && anInt900 == 0) {
  5506. class9.message = "Loading friend list";
  5507. class9.atActionType = 0;
  5508. return;
  5509. }
  5510. if (j == 1 && anInt900 == 1) {
  5511. class9.message = "Connecting to friendserver";
  5512. class9.atActionType = 0;
  5513. return;
  5514. }
  5515. if (j == 2 && anInt900 != 2) {
  5516. class9.message = "Please wait...";
  5517. class9.atActionType = 0;
  5518. return;
  5519. }
  5520. int k = friendsCount;
  5521. if (anInt900 != 2)
  5522. k = 0;
  5523. if (j > 700)
  5524. j -= 601;
  5525. else
  5526. j--;
  5527. if (j >= k) {
  5528. class9.message = "";
  5529. class9.atActionType = 0;
  5530. return;
  5531. } else {
  5532. class9.message = friendsList[j];
  5533. class9.atActionType = 1;
  5534. return;
  5535. }
  5536. }
  5537. if (j >= 101 && j <= 200 || j >= 801 && j <= 900) {
  5538. int l = friendsCount;
  5539. if (anInt900 != 2)
  5540. l = 0;
  5541. if (j > 800)
  5542. j -= 701;
  5543. else
  5544. j -= 101;
  5545. if (j >= l) {
  5546. class9.message = "";
  5547. class9.atActionType = 0;
  5548. return;
  5549. }
  5550. if (friendsNodeIDs[j] == 0)
  5551. class9.message = "@red@Offline";
  5552. else if (friendsNodeIDs[j] == nodeID)
  5553. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9) */;
  5554. else
  5555. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9) */;
  5556. class9.atActionType = 1;
  5557. return;
  5558. }
  5559. if (j == 203) {
  5560. int i1 = friendsCount;
  5561. if (anInt900 != 2)
  5562. i1 = 0;
  5563. class9.scrollMax = i1 * 15 + 20;
  5564. if (class9.scrollMax <= class9.height)
  5565. class9.scrollMax = class9.height + 1;
  5566. return;
  5567. }
  5568. if (j >= 401 && j <= 500) {
  5569. if ((j -= 401) == 0 && anInt900 == 0) {
  5570. class9.message = "Loading ignore list";
  5571. class9.atActionType = 0;
  5572. return;
  5573. }
  5574. if (j == 1 && anInt900 == 0) {
  5575. class9.message = "Please wait...";
  5576. class9.atActionType = 0;
  5577. return;
  5578. }
  5579. int j1 = ignoreCount;
  5580. if (anInt900 == 0)
  5581. j1 = 0;
  5582. if (j >= j1) {
  5583. class9.message = "";
  5584. class9.atActionType = 0;
  5585. return;
  5586. } else {
  5587. class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  5588. class9.atActionType = 1;
  5589. return;
  5590. }
  5591. }
  5592. if (j == 503) {
  5593. class9.scrollMax = ignoreCount * 15 + 20;
  5594. if (class9.scrollMax <= class9.height)
  5595. class9.scrollMax = class9.height + 1;
  5596. return;
  5597. }
  5598. if (j == 327) {
  5599. class9.modelRotation1 = 150;
  5600. class9.modelRotation2 = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  5601. if (aBoolean1031) {
  5602. for (int k1 = 0; k1 < 7; k1++) {
  5603. int l1 = anIntArray1065[k1];
  5604. if (l1 >= 0 && !IDK.cache[l1].method537())
  5605. return;
  5606. }
  5607.  
  5608. aBoolean1031 = false;
  5609. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  5610. int i2 = 0;
  5611. for (int j2 = 0; j2 < 7; j2++) {
  5612. int k2 = anIntArray1065[j2];
  5613. if (k2 >= 0)
  5614. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2].method538();
  5615. }
  5616.  
  5617. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  5618. for (int l2 = 0; l2 < 5; l2++)
  5619. if (anIntArray990[l2] != 0) {
  5620. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5621. if (l2 == 1)
  5622. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5623. }
  5624.  
  5625. model.method469();
  5626. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  5627. model.method479(64, 850, -30, -50, -30, true);
  5628. class9.anInt233 = 5;
  5629. class9.mediaID = 0;
  5630. RSInterface.method208(aBoolean994, model);
  5631. }
  5632. return;
  5633. }
  5634. if (j == 328) {
  5635. RSInterface rsInterface = class9;
  5636. int verticleTilt = 150;
  5637. int animationSpeed = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  5638. rsInterface.modelRotation1 = verticleTilt;
  5639. rsInterface.modelRotation2 = animationSpeed;
  5640. if (aBoolean1031) {
  5641. Model characterDisplay = myPlayer.method452();
  5642. for (int l2 = 0; l2 < 5; l2++)
  5643. if (anIntArray990[l2] != 0) {
  5644. characterDisplay.method476(anIntArrayArray1003[l2][0],
  5645. anIntArrayArray1003[l2][anIntArray990[l2]]);
  5646. if (l2 == 1)
  5647. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5648. }
  5649. int staticFrame = myPlayer.anInt1511;
  5650. characterDisplay.method469();
  5651. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  5652. // characterDisplay.method479(64, 850, -30, -50, -30, true);
  5653. rsInterface.anInt233 = 5;
  5654. rsInterface.mediaID = 0;
  5655. RSInterface.method208(aBoolean994, characterDisplay);
  5656. }
  5657. return;
  5658. }
  5659. if (j == 324) {
  5660. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  5661. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5662. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5663. }
  5664. if (aBoolean1047) {
  5665. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5666. return;
  5667. } else {
  5668. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5669. return;
  5670. }
  5671. }
  5672. if (j == 325) {
  5673. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  5674. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5675. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5676. }
  5677. if (aBoolean1047) {
  5678. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5679. return;
  5680. } else {
  5681. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5682. return;
  5683. }
  5684. }
  5685. if (j == 600) {
  5686. class9.message = reportAbuseInput;
  5687. if (loopCycle % 20 < 10) {
  5688. class9.message += "|";
  5689. return;
  5690. } else {
  5691. class9.message += " ";
  5692. return;
  5693. }
  5694. }
  5695. if (j == 613)
  5696. if (myPrivilege >= 1) {
  5697. if (canMute) {
  5698. class9.textColor = 0xff0000;
  5699. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  5700. } else {
  5701. class9.textColor = 0xffffff;
  5702. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  5703. }
  5704. } else {
  5705. class9.message = "";
  5706. }
  5707. if (j == 650 || j == 655)
  5708. if (anInt1193 != 0) {
  5709. String s;
  5710. if (daysSinceLastLogin == 0)
  5711. s = "earlier today";
  5712. else if (daysSinceLastLogin == 1)
  5713. s = "yesterday";
  5714. else
  5715. s = daysSinceLastLogin + " days ago";
  5716. class9.message = "You last logged in " + s + " from: " + signlink.dns;
  5717. } else {
  5718. class9.message = "";
  5719. }
  5720. if (j == 651) {
  5721. if (unreadMessages == 0) {
  5722. class9.message = "0 unread messages";
  5723. class9.textColor = 0xffff00;
  5724. }
  5725. if (unreadMessages == 1) {
  5726. class9.message = "1 unread message";
  5727. class9.textColor = 65280;
  5728. }
  5729. if (unreadMessages > 1) {
  5730. class9.message = unreadMessages + " unread messages";
  5731. class9.textColor = 65280;
  5732. }
  5733. }
  5734. if (j == 652)
  5735. if (daysSinceRecovChange == 201) {
  5736. if (membersInt == 1)
  5737. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  5738. else
  5739. class9.message = "";
  5740. } else if (daysSinceRecovChange == 200) {
  5741. class9.message = "You have not yet set any password recovery questions.";
  5742. } else {
  5743. String s1;
  5744. if (daysSinceRecovChange == 0)
  5745. s1 = "Earlier today";
  5746. else if (daysSinceRecovChange == 1)
  5747. s1 = "Yesterday";
  5748. else
  5749. s1 = daysSinceRecovChange + " days ago";
  5750. class9.message = s1 + " you changed your recovery questions";
  5751. }
  5752. if (j == 653)
  5753. if (daysSinceRecovChange == 201) {
  5754. if (membersInt == 1)
  5755. class9.message = "@whi@recommend you use a members world instead. You may use";
  5756. else
  5757. class9.message = "";
  5758. } else if (daysSinceRecovChange == 200)
  5759. class9.message = "We strongly recommend you do so now to secure your account.";
  5760. else
  5761. class9.message = "If you do not remember making this change then cancel it immediately";
  5762. if (j == 654) {
  5763. if (daysSinceRecovChange == 201)
  5764. if (membersInt == 1) {
  5765. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  5766. return;
  5767. } else {
  5768. class9.message = "";
  5769. return;
  5770. }
  5771. if (daysSinceRecovChange == 200) {
  5772. class9.message = "Do this from the 'account management' area on our front webpage";
  5773. return;
  5774. }
  5775. class9.message = "Do this from the 'account management' area on our front webpage";
  5776. }
  5777. }
  5778.  
  5779. private void drawSplitPrivateChat() {
  5780. if (splitPrivateChat == 0)
  5781. return;
  5782. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  5783. int i = 0;
  5784. if (anInt1104 != 0)
  5785. i = 1;
  5786. for (int j = 0; j < 100; j++)
  5787. if (chatMessages[j] != null) {
  5788. int k = chatTypes[j];
  5789. String s = chatNames[j];
  5790. byte byte1 = 0;
  5791. if (s != null && s.startsWith("@cr1@")) {
  5792. s = s.substring(5);
  5793. byte1 = 1;
  5794. }
  5795. if (s != null && s.startsWith("@cr2@")) {
  5796. s = s.substring(5);
  5797. byte1 = 2;
  5798. }
  5799. if ((k == 3 || k == 7)
  5800. && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  5801. int l = 329 - i * 13;
  5802. int k1 = 4;
  5803. textDrawingArea.method385(0, "From", l, k1);
  5804. textDrawingArea.method385(65535, "From", l - 1, k1);
  5805. k1 += textDrawingArea.getTextWidth("From ");
  5806. if (byte1 == 1) {
  5807. modIcons[0].drawBackground(k1, l - 12);
  5808. k1 += 12;
  5809. }
  5810. if (byte1 == 2) {
  5811. modIcons[1].drawBackground(k1, l - 12);
  5812. k1 += 12;
  5813. }
  5814. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  5815. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  5816. if (++i >= 5)
  5817. return;
  5818. }
  5819. if (k == 5 && privateChatMode < 2) {
  5820. int i1 = 329 - i * 13;
  5821. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  5822. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  5823. if (++i >= 5)
  5824. return;
  5825. }
  5826. if (k == 6 && privateChatMode < 2) {
  5827. int j1 = 329 - i * 13;
  5828. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  5829. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  5830. if (++i >= 5)
  5831. return;
  5832. }
  5833. }
  5834.  
  5835. }
  5836.  
  5837. public void pushMessage(String s, int i, String s1) {
  5838. if (i == 0 && dialogID != -1) {
  5839. aString844 = s;
  5840. super.clickMode3 = 0;
  5841. }
  5842. if (backDialogID == -1)
  5843. inputTaken = true;
  5844. for (int j = 499; j > 0; j--) {
  5845. chatTypes[j] = chatTypes[j - 1];
  5846. chatNames[j] = chatNames[j - 1];
  5847. chatMessages[j] = chatMessages[j - 1];
  5848. chatRights[j] = chatRights[j - 1];
  5849. }
  5850. chatTypes[0] = i;
  5851. chatNames[0] = s1;
  5852. chatMessages[0] = s;
  5853. chatRights[0] = rights;
  5854. }
  5855.  
  5856. public static void setTab(int id) {
  5857. needDrawTabArea = true;
  5858. tabID = id;
  5859. tabAreaAltered = true;
  5860. }
  5861.  
  5862. private void processTabClick() {
  5863. if (super.clickMode3 == 1) {
  5864. if (super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205
  5865. && tabInterfaceIDs[0] != -1) {
  5866. needDrawTabArea = true;
  5867. tabID = 0;
  5868. tabAreaAltered = true;
  5869. }
  5870. if (super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205
  5871. && tabInterfaceIDs[1] != -1) {
  5872. needDrawTabArea = true;
  5873. tabID = 1;
  5874. tabAreaAltered = true;
  5875. }
  5876. if (super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205
  5877. && tabInterfaceIDs[2] != -1) {
  5878. needDrawTabArea = true;
  5879. tabID = 2;
  5880. tabAreaAltered = true;
  5881. }
  5882. if (super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203
  5883. && tabInterfaceIDs[3] != -1) {
  5884. needDrawTabArea = true;
  5885. tabID = 3;
  5886. tabAreaAltered = true;
  5887. }
  5888. if (super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205
  5889. && tabInterfaceIDs[4] != -1) {
  5890. needDrawTabArea = true;
  5891. tabID = 4;
  5892. tabAreaAltered = true;
  5893. }
  5894. if (super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205
  5895. && tabInterfaceIDs[5] != -1) {
  5896. needDrawTabArea = true;
  5897. tabID = 5;
  5898. tabAreaAltered = true;
  5899. }
  5900. if (super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205
  5901. && tabInterfaceIDs[6] != -1) {
  5902. needDrawTabArea = true;
  5903. tabID = 6;
  5904. tabAreaAltered = true;
  5905. }
  5906. if (super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503
  5907. && tabInterfaceIDs[7] != -1) {
  5908. needDrawTabArea = true;
  5909. tabID = 7;
  5910. tabAreaAltered = true;
  5911. }
  5912. if (super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503
  5913. && tabInterfaceIDs[8] != -1) {
  5914. needDrawTabArea = true;
  5915. tabID = 8;
  5916. tabAreaAltered = true;
  5917. }
  5918. if (super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503
  5919. && tabInterfaceIDs[9] != -1) {
  5920. needDrawTabArea = true;
  5921. tabID = 9;
  5922. tabAreaAltered = true;
  5923. }
  5924. if (super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503
  5925. && tabInterfaceIDs[10] != -1) {
  5926. needDrawTabArea = true;
  5927. tabID = 10;
  5928. tabAreaAltered = true;
  5929. }
  5930. if (super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503
  5931. && tabInterfaceIDs[11] != -1) {
  5932. needDrawTabArea = true;
  5933. tabID = 11;
  5934. tabAreaAltered = true;
  5935. }
  5936. if (super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503
  5937. && tabInterfaceIDs[12] != -1) {
  5938. needDrawTabArea = true;
  5939. tabID = 12;
  5940. tabAreaAltered = true;
  5941. }
  5942. if (super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502
  5943. && tabInterfaceIDs[13] != -1) {
  5944. needDrawTabArea = true;
  5945. tabID = 13;
  5946. tabAreaAltered = true;
  5947. }
  5948. }
  5949. }
  5950.  
  5951. private void resetImageProducers2() {
  5952. if (aGraphicsBuffer_1166 != null)
  5953. return;
  5954. nullLoader();
  5955. super.fullGameScreen = null;
  5956. aGraphicsBuffer_1107 = null;
  5957. aGraphicsBuffer_1108 = null;
  5958. aGraphicsBuffer_1109 = null;
  5959. aGraphicsBuffer_1110 = null;
  5960. aGraphicsBuffer_1111 = null;
  5961. aGraphicsBuffer_1112 = null;
  5962. aGraphicsBuffer_1113 = null;
  5963. aGraphicsBuffer_1114 = null;
  5964. aGraphicsBuffer_1115 = null;
  5965. aGraphicsBuffer_1166 = new GraphicsBuffer(519, 165);
  5966. aGraphicsBuffer_1164 = new GraphicsBuffer(246, 164);
  5967. DrawingArea.setAllPixelsToZero();
  5968. mapBack.drawBackground(0, 0);
  5969. aGraphicsBuffer_1163 = new GraphicsBuffer(246, 335);
  5970. aGraphicsBuffer_1165 = new GraphicsBuffer(512, 334);
  5971. DrawingArea.setAllPixelsToZero();
  5972. aGraphicsBuffer_1123 = new GraphicsBuffer(496, 50);
  5973. aGraphicsBuffer_1124 = new GraphicsBuffer(269, 37);
  5974. aGraphicsBuffer_1125 = new GraphicsBuffer(249, 45);
  5975. welcomeScreenRaised = true;
  5976. }
  5977.  
  5978. public String getDocumentBaseHost() {
  5979. if (signlink.mainapp != null) {
  5980. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  5981. }
  5982. if (super.gameFrame != null) {
  5983. return ""; // runescape.com <- removed for Jframe to work
  5984. } else {
  5985. return ""; // super.getDocumentBase().getHost().toLowerCase() <-
  5986. // removed for Jframe to work
  5987. }
  5988. }
  5989.  
  5990. private void method81(Sprite sprite, int j, int k) {
  5991. int l = k * k + j * j;
  5992. if (l > 4225 && l < 0x15f90) {
  5993. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  5994. int j1 = Model.modelIntArray1[i1];
  5995. int k1 = Model.modelIntArray2[i1];
  5996. j1 = (j1 * 256) / (minimapInt3 + 256);
  5997. k1 = (k1 * 256) / (minimapInt3 + 256);
  5998. int l1 = j * j1 + k * k1 >> 16;
  5999. int i2 = j * k1 - k * j1 >> 16;
  6000. double d = Math.atan2(l1, i2);
  6001. int j2 = (int) (Math.sin(d) * 63D);
  6002. int k2 = (int) (Math.cos(d) * 57D);
  6003. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  6004. } else {
  6005. markMinimap(sprite, k, j);
  6006. }
  6007. }
  6008.  
  6009. private void rightClickMapArea() {
  6010. if (super.mouseX > 703 && super.mouseX < 755 && super.mouseY > 85 && super.mouseY < 118) {
  6011. menuActionName[1] = "Run";
  6012. menuActionID[1] = 1051;
  6013. menuActionRow = 2;
  6014. }
  6015. }
  6016.  
  6017. private void rightClickChatButtons() {
  6018. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  6019. menuActionName[1] = "View All";
  6020. menuActionID[1] = 999;
  6021. menuActionRow = 2;
  6022. } else if (super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  6023. menuActionName[1] = "View Game";
  6024. menuActionID[1] = 998;
  6025. menuActionRow = 2;
  6026. } else if (super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  6027. menuActionName[1] = "Hide public";
  6028. menuActionID[1] = 997;
  6029. menuActionName[2] = "Off public";
  6030. menuActionID[2] = 996;
  6031. menuActionName[3] = "Friends public";
  6032. menuActionID[3] = 995;
  6033. menuActionName[4] = "On public";
  6034. menuActionID[4] = 994;
  6035. menuActionName[5] = "View public";
  6036. menuActionID[5] = 993;
  6037. menuActionRow = 6;
  6038. } else if (super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  6039. menuActionName[1] = "Off private";
  6040. menuActionID[1] = 992;
  6041. menuActionName[2] = "Friends private";
  6042. menuActionID[2] = 991;
  6043. menuActionName[3] = "On private";
  6044. menuActionID[3] = 990;
  6045. menuActionName[4] = "View private";
  6046. menuActionID[4] = 989;
  6047. menuActionRow = 5;
  6048. } else if (super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  6049. menuActionName[1] = "Off clan chat";
  6050. menuActionID[1] = 1003;
  6051. menuActionName[2] = "Friends clan chat";
  6052. menuActionID[2] = 1002;
  6053. menuActionName[3] = "On clan chat";
  6054. menuActionID[3] = 1001;
  6055. menuActionName[4] = "View clan chat";
  6056. menuActionID[4] = 1000;
  6057. menuActionRow = 5;
  6058. } else if (super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  6059. menuActionName[1] = "Off trade";
  6060. menuActionID[1] = 987;
  6061. menuActionName[2] = "Friends trade";
  6062. menuActionID[2] = 986;
  6063. menuActionName[3] = "On trade";
  6064. menuActionID[3] = 985;
  6065. menuActionName[4] = "View trade";
  6066. menuActionID[4] = 984;
  6067. menuActionRow = 5;
  6068. }
  6069. }
  6070.  
  6071. public void processRightClick() {
  6072. if (activeInterfaceType != 0) {
  6073. return;
  6074. }
  6075.  
  6076. menuActionName[0] = "Cancel";
  6077. menuActionID[0] = 1107;
  6078. menuActionRow = 1;
  6079. if (fullscreenInterfaceID != -1) {
  6080. anInt886 = 0;
  6081. anInt1315 = 0;
  6082. buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  6083. if (anInt886 != anInt1026) {
  6084. anInt1026 = anInt886;
  6085. }
  6086. if (anInt1315 != anInt1129) {
  6087. anInt1129 = anInt1315;
  6088. }
  6089. return;
  6090. }
  6091. buildSplitPrivateChatMenu();
  6092. anInt886 = 0;
  6093. anInt1315 = 0;
  6094. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338) {
  6095. if (openInterfaceID != -1) {
  6096. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  6097. } else {
  6098. build3dScreenMenu();
  6099. }
  6100. }
  6101. if (anInt886 != anInt1026) {
  6102. anInt1026 = anInt886;
  6103. }
  6104. if (anInt1315 != anInt1129) {
  6105. anInt1129 = anInt1315;
  6106. }
  6107. anInt886 = 0;
  6108. anInt1315 = 0;
  6109. if (super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468) {
  6110. if (invOverlayInterfaceID != -1) {
  6111. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207,
  6112. super.mouseY, 0);
  6113. } else if (tabInterfaceIDs[tabID] != -1) {
  6114. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207,
  6115. super.mouseY, 0);
  6116. }
  6117. }
  6118. if (anInt886 != anInt1048) {
  6119. needDrawTabArea = true;
  6120. tabAreaAltered = true;
  6121. anInt1048 = anInt886;
  6122. }
  6123. if (anInt1315 != anInt1044) {
  6124. needDrawTabArea = true;
  6125. tabAreaAltered = true;
  6126. anInt1044 = anInt1315;
  6127. }
  6128. anInt886 = 0;
  6129. anInt1315 = 0;
  6130. if (super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  6131. if (backDialogID != -1) {
  6132. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  6133. } else if (super.mouseY < 463 && super.mouseX < 490) {
  6134. buildChatAreaMenu(super.mouseY - 338);
  6135. }
  6136. }
  6137. if (backDialogID != -1 && anInt886 != anInt1039) {
  6138. inputTaken = true;
  6139. anInt1039 = anInt886;
  6140. }
  6141. if (backDialogID != -1 && anInt1315 != anInt1500) {
  6142. inputTaken = true;
  6143. anInt1500 = anInt1315;
  6144. }
  6145. /* Enable custom right click areas */
  6146. if (super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 && super.mouseY < 503)
  6147. rightClickChatButtons();
  6148. if (super.mouseX > 519 && super.mouseY > 0 && super.mouseX < 765 && super.mouseY < 168)
  6149. rightClickMapArea();
  6150.  
  6151. /**/
  6152. boolean flag = false;
  6153. while (!flag) {
  6154. flag = true;
  6155. for (int j = 0; j < menuActionRow - 1; j++) {
  6156. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  6157. String s = menuActionName[j];
  6158. menuActionName[j] = menuActionName[j + 1];
  6159. menuActionName[j + 1] = s;
  6160. int k = menuActionID[j];
  6161. menuActionID[j] = menuActionID[j + 1];
  6162. menuActionID[j + 1] = k;
  6163. k = menuActionCmd2[j];
  6164. menuActionCmd2[j] = menuActionCmd2[j + 1];
  6165. menuActionCmd2[j + 1] = k;
  6166. k = menuActionCmd3[j];
  6167. menuActionCmd3[j] = menuActionCmd3[j + 1];
  6168. menuActionCmd3[j + 1] = k;
  6169. k = menuActionCmd1[j];
  6170. menuActionCmd1[j] = menuActionCmd1[j + 1];
  6171. menuActionCmd1[j + 1] = k;
  6172. flag = false;
  6173. }
  6174. }
  6175. }
  6176. }
  6177.  
  6178. private int method83(int i, int j, int k) {
  6179. int l = 256 - k;
  6180. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00)
  6181. + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  6182. }
  6183.  
  6184. private void login(String s, String s1, boolean flag) {
  6185. toggleSize(0);
  6186. signlink.errorname = s;
  6187. try {
  6188. if (!flag) {
  6189. loginMessage1 = "";
  6190. loginMessage2 = "Connecting to server...";
  6191. drawLoginScreen(true);
  6192. }
  6193. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  6194. long l = TextClass.longForName(s);
  6195. int i = (int) (l >> 16 & 31L);
  6196. stream.currentOffset = 0;
  6197. stream.writeWordBigEndian(14);
  6198. stream.writeWordBigEndian(i);
  6199. socketStream.queueBytes(2, stream.buffer);
  6200. for (int j = 0; j < 8; j++)
  6201. socketStream.read();
  6202.  
  6203. int k = socketStream.read();
  6204. int i1 = k;
  6205. if (k == 0) {
  6206. socketStream.flushInputStream(inStream.buffer, 8);
  6207. inStream.currentOffset = 0;
  6208. aLong1215 = inStream.readQWord();
  6209. int ai[] = new int[4];
  6210. ai[0] = (int) (Math.random() * 99999999D);
  6211. ai[1] = (int) (Math.random() * 99999999D);
  6212. ai[2] = (int) (aLong1215 >> 32);
  6213. ai[3] = (int) aLong1215;
  6214. stream.currentOffset = 0;
  6215. stream.writeWordBigEndian(10);
  6216. stream.writeDWord(ai[0]);
  6217. stream.writeDWord(ai[1]);
  6218. stream.writeDWord(ai[2]);
  6219. stream.writeDWord(ai[3]);
  6220. stream.writeDWord(/* signlink.uid */999999);
  6221. stream.writeString(s);
  6222. stream.writeString(s1);
  6223. stream.doKeys();
  6224. aStream_847.currentOffset = 0;
  6225. if (flag)
  6226. aStream_847.writeWordBigEndian(18);
  6227. else
  6228. aStream_847.writeWordBigEndian(16);
  6229. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  6230. aStream_847.writeWordBigEndian(255);
  6231. aStream_847.writeWord(317);
  6232. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  6233. for (int l1 = 0; l1 < 9; l1++)
  6234. aStream_847.writeDWord(expectedCRCs[l1]);
  6235.  
  6236. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  6237. stream.encryption = new ISAACRandomGen(ai);
  6238. for (int j2 = 0; j2 < 4; j2++)
  6239. ai[j2] += 50;
  6240.  
  6241. encryption = new ISAACRandomGen(ai);
  6242. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  6243. k = socketStream.read();
  6244. }
  6245. if (k == 1) {
  6246. try {
  6247. Thread.sleep(2000L);
  6248. } catch (Exception _ex) {
  6249. }
  6250. login(s, s1, flag);
  6251. return;
  6252. }
  6253. if (k == 2) {
  6254. myPrivilege = socketStream.read();
  6255. flagged = socketStream.read() == 1;
  6256. aLong1220 = 0L;
  6257. anInt1022 = 0;
  6258. mouseDetection.coordsIndex = 0;
  6259. super.awtFocus = true;
  6260. aBoolean954 = true;
  6261. loggedIn = true;
  6262. stream.currentOffset = 0;
  6263. inStream.currentOffset = 0;
  6264. pktType = -1;
  6265. anInt841 = -1;
  6266. anInt842 = -1;
  6267. anInt843 = -1;
  6268. pktSize = 0;
  6269. anInt1009 = 0;
  6270. anInt1104 = 0;
  6271. anInt1011 = 0;
  6272. anInt855 = 0;
  6273. menuActionRow = 0;
  6274. menuOpen = false;
  6275. super.idleTime = 0;
  6276. for (int j1 = 0; j1 < 100; j1++)
  6277. chatMessages[j1] = null;
  6278.  
  6279. itemSelected = 0;
  6280. spellSelected = 0;
  6281. loadingStage = 0;
  6282. anInt1062 = 0;
  6283. anInt1278 = (int) (Math.random() * 100D) - 50;
  6284. anInt1131 = (int) (Math.random() * 110D) - 55;
  6285. anInt896 = (int) (Math.random() * 80D) - 40;
  6286. minimapInt2 = (int) (Math.random() * 120D) - 60;
  6287. minimapInt3 = (int) (Math.random() * 30D) - 20;
  6288. minimapInt1 = (int) (Math.random() * 20D) - 10 & 0x7ff;
  6289. anInt1021 = 0;
  6290. anInt985 = -1;
  6291. destX = 0;
  6292. destY = 0;
  6293. playerCount = 0;
  6294. npcCount = 0;
  6295. for (int i2 = 0; i2 < maxPlayers; i2++) {
  6296. playerArray[i2] = null;
  6297. aStreamArray895s[i2] = null;
  6298. }
  6299.  
  6300. for (int k2 = 0; k2 < 16384; k2++)
  6301. npcArray[k2] = null;
  6302.  
  6303. myPlayer = playerArray[myPlayerIndex] = new Player();
  6304. aClass19_1013.removeAll();
  6305. aClass19_1056.removeAll();
  6306. for (int l2 = 0; l2 < 4; l2++) {
  6307. for (int i3 = 0; i3 < 104; i3++) {
  6308. for (int k3 = 0; k3 < 104; k3++)
  6309. groundArray[l2][i3][k3] = null;
  6310.  
  6311. }
  6312.  
  6313. }
  6314.  
  6315. aClass19_1179 = new NodeList();
  6316. fullscreenInterfaceID = -1;
  6317. anInt900 = 0;
  6318. friendsCount = 0;
  6319. dialogID = -1;
  6320. backDialogID = -1;
  6321. openInterfaceID = -1;
  6322. invOverlayInterfaceID = -1;
  6323. anInt1018 = -1;
  6324. aBoolean1149 = false;
  6325. tabID = 3;
  6326. inputDialogState = 0;
  6327. menuOpen = false;
  6328. messagePromptRaised = false;
  6329. aString844 = null;
  6330. anInt1055 = 0;
  6331. anInt1054 = -1;
  6332. aBoolean1047 = true;
  6333. method45();
  6334. for (int j3 = 0; j3 < 5; j3++)
  6335. anIntArray990[j3] = 0;
  6336.  
  6337. for (int l3 = 0; l3 < 5; l3++) {
  6338. atPlayerActions[l3] = null;
  6339. atPlayerArray[l3] = false;
  6340. }
  6341.  
  6342. anInt1175 = 0;
  6343. anInt1134 = 0;
  6344. anInt986 = 0;
  6345. anInt1288 = 0;
  6346. anInt924 = 0;
  6347. anInt1188 = 0;
  6348. anInt1155 = 0;
  6349. anInt1226 = 0;
  6350. int anInt941 = 0;
  6351. int anInt1260 = 0;
  6352. method458();
  6353. resetImageProducers2();
  6354. return;
  6355. }
  6356. if (k == 3) {
  6357. loginMessage1 = "";
  6358. loginMessage2 = "Invalid username or password.";
  6359. return;
  6360. }
  6361. if (k == 4) {
  6362. loginMessage1 = "Your account has been disabled.";
  6363. loginMessage2 = "Please check your message-center for details.";
  6364. return;
  6365. }
  6366. if (k == 5) {
  6367. loginMessage1 = "Your account is already logged in.";
  6368. loginMessage2 = "Try again in 60 secs...";
  6369. return;
  6370. }
  6371. if (k == 6) {
  6372. loginMessage1 = "RuneScape has been updated!";
  6373. loginMessage2 = "Please reload this page.";
  6374. return;
  6375. }
  6376. if (k == 7) {
  6377. loginMessage1 = "This world is full.";
  6378. loginMessage2 = "Please use a different world.";
  6379. return;
  6380. }
  6381. if (k == 8) {
  6382. loginMessage1 = "Unable to connect.";
  6383. loginMessage2 = "Login server offline.";
  6384. return;
  6385. }
  6386. if (k == 9) {
  6387. loginMessage1 = "Login limit exceeded.";
  6388. loginMessage2 = "Too many connections from your address.";
  6389. return;
  6390. }
  6391. if (k == 10) {
  6392. loginMessage1 = "Unable to connect.";
  6393. loginMessage2 = "Bad session id.";
  6394. return;
  6395. }
  6396. if (k == 11) {
  6397. loginMessage2 = "Login server rejected session.";
  6398. loginMessage2 = "Please try again.";
  6399. return;
  6400. }
  6401. if (k == 12) {
  6402. loginMessage1 = "You need a members account to login to this world.";
  6403. loginMessage2 = "Please subscribe, or use a different world.";
  6404. return;
  6405. }
  6406. if (k == 13) {
  6407. loginMessage1 = "Could not complete login.";
  6408. loginMessage2 = "Please try using a different world.";
  6409. return;
  6410. }
  6411. if (k == 14) {
  6412. loginMessage1 = "The server is being updated.";
  6413. loginMessage2 = "Please wait 1 minute and try again.";
  6414. return;
  6415. }
  6416. if (k == 15) {
  6417. loggedIn = true;
  6418. stream.currentOffset = 0;
  6419. inStream.currentOffset = 0;
  6420. pktType = -1;
  6421. anInt841 = -1;
  6422. anInt842 = -1;
  6423. anInt843 = -1;
  6424. pktSize = 0;
  6425. anInt1009 = 0;
  6426. anInt1104 = 0;
  6427. menuActionRow = 0;
  6428. menuOpen = false;
  6429. aLong824 = System.currentTimeMillis();
  6430. return;
  6431. }
  6432. if (k == 16) {
  6433. loginMessage1 = "Login attempts exceeded.";
  6434. loginMessage2 = "Please wait 1 minute and try again.";
  6435. return;
  6436. }
  6437. if (k == 17) {
  6438. loginMessage1 = "You are standing in a members-only area.";
  6439. loginMessage2 = "To play on this world move to a free area first";
  6440. return;
  6441. }
  6442. if (k == 20) {
  6443. loginMessage1 = "Invalid loginserver requested";
  6444. loginMessage2 = "Please try using a different world.";
  6445. return;
  6446. }
  6447. if (k == 21) {
  6448. for (int k1 = socketStream.read(); k1 >= 0; k1--) {
  6449. loginMessage1 = "You have only just left another world";
  6450. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  6451. drawLoginScreen(true);
  6452. try {
  6453. Thread.sleep(1000L);
  6454. } catch (Exception _ex) {
  6455. }
  6456. }
  6457.  
  6458. login(s, s1, flag);
  6459. return;
  6460. }
  6461. if (k == -1) {
  6462. if (i1 == 0) {
  6463. if (loginFailures < 2) {
  6464. try {
  6465. Thread.sleep(2000L);
  6466. } catch (Exception _ex) {
  6467. }
  6468. loginFailures++;
  6469. login(s, s1, flag);
  6470. return;
  6471. } else {
  6472. loginMessage1 = "No response from loginserver";
  6473. loginMessage2 = "Please wait 1 minute and try again.";
  6474. return;
  6475. }
  6476. } else {
  6477. loginMessage1 = "No response from server";
  6478. loginMessage2 = "Please try using a different world.";
  6479. return;
  6480. }
  6481. } else {
  6482. System.out.println("response:" + k);
  6483. loginMessage1 = "Unexpected server response";
  6484. loginMessage2 = "Please try using a different world.";
  6485. return;
  6486. }
  6487. } catch (IOException _ex) {
  6488. loginMessage1 = "";
  6489. }
  6490. loginMessage2 = "Error connecting to server.";
  6491. }
  6492.  
  6493. private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1, int l1, int i2, int j2, boolean flag,
  6494. int k2) {
  6495. byte byte0 = 104;
  6496. byte byte1 = 104;
  6497. for (int l2 = 0; l2 < byte0; l2++) {
  6498. for (int i3 = 0; i3 < byte1; i3++) {
  6499. anIntArrayArray901[l2][i3] = 0;
  6500. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  6501. }
  6502. }
  6503. int j3 = j2;
  6504. int k3 = j1;
  6505. anIntArrayArray901[j2][j1] = 99;
  6506. anIntArrayArray825[j2][j1] = 0;
  6507. int l3 = 0;
  6508. int i4 = 0;
  6509. bigX[l3] = j2;
  6510. bigY[l3++] = j1;
  6511. boolean flag1 = false;
  6512. int j4 = bigX.length;
  6513. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  6514. while (i4 != l3) {
  6515. j3 = bigX[i4];
  6516. k3 = bigY[i4];
  6517. i4 = (i4 + 1) % j4;
  6518. if (j3 == k2 && k3 == i2) {
  6519. flag1 = true;
  6520. break;
  6521. }
  6522. if (i1 != 0) {
  6523. if ((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2)) {
  6524. flag1 = true;
  6525. break;
  6526. }
  6527. if (i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3)) {
  6528. flag1 = true;
  6529. break;
  6530. }
  6531. }
  6532. if (k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3)) {
  6533. flag1 = true;
  6534. break;
  6535. }
  6536. int l4 = anIntArrayArray825[j3][k3] + 1;
  6537. if (j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0) {
  6538. bigX[l3] = j3 - 1;
  6539. bigY[l3] = k3;
  6540. l3 = (l3 + 1) % j4;
  6541. anIntArrayArray901[j3 - 1][k3] = 2;
  6542. anIntArrayArray825[j3 - 1][k3] = l4;
  6543. }
  6544. if (j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0) {
  6545. bigX[l3] = j3 + 1;
  6546. bigY[l3] = k3;
  6547. l3 = (l3 + 1) % j4;
  6548. anIntArrayArray901[j3 + 1][k3] = 8;
  6549. anIntArrayArray825[j3 + 1][k3] = l4;
  6550. }
  6551. if (k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  6552. bigX[l3] = j3;
  6553. bigY[l3] = k3 - 1;
  6554. l3 = (l3 + 1) % j4;
  6555. anIntArrayArray901[j3][k3 - 1] = 1;
  6556. anIntArrayArray825[j3][k3 - 1] = l4;
  6557. }
  6558. if (k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  6559. bigX[l3] = j3;
  6560. bigY[l3] = k3 + 1;
  6561. l3 = (l3 + 1) % j4;
  6562. anIntArrayArray901[j3][k3 + 1] = 4;
  6563. anIntArrayArray825[j3][k3 + 1] = l4;
  6564. }
  6565. if (j3 > 0 && k3 > 0 && anIntArrayArray901[j3 - 1][k3 - 1] == 0 && (ai[j3 - 1][k3 - 1] & 0x128010e) == 0
  6566. && (ai[j3 - 1][k3] & 0x1280108) == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  6567. bigX[l3] = j3 - 1;
  6568. bigY[l3] = k3 - 1;
  6569. l3 = (l3 + 1) % j4;
  6570. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  6571. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  6572. }
  6573. if (j3 < byte0 - 1 && k3 > 0 && anIntArrayArray901[j3 + 1][k3 - 1] == 0
  6574. && (ai[j3 + 1][k3 - 1] & 0x1280183) == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0
  6575. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  6576. bigX[l3] = j3 + 1;
  6577. bigY[l3] = k3 - 1;
  6578. l3 = (l3 + 1) % j4;
  6579. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  6580. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  6581. }
  6582. if (j3 > 0 && k3 < byte1 - 1 && anIntArrayArray901[j3 - 1][k3 + 1] == 0
  6583. && (ai[j3 - 1][k3 + 1] & 0x1280138) == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0
  6584. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  6585. bigX[l3] = j3 - 1;
  6586. bigY[l3] = k3 + 1;
  6587. l3 = (l3 + 1) % j4;
  6588. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  6589. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  6590. }
  6591. if (j3 < byte0 - 1 && k3 < byte1 - 1 && anIntArrayArray901[j3 + 1][k3 + 1] == 0
  6592. && (ai[j3 + 1][k3 + 1] & 0x12801e0) == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0
  6593. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  6594. bigX[l3] = j3 + 1;
  6595. bigY[l3] = k3 + 1;
  6596. l3 = (l3 + 1) % j4;
  6597. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  6598. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  6599. }
  6600. }
  6601. anInt1264 = 0;
  6602. if (!flag1) {
  6603. if (flag) {
  6604. int i5 = 100;
  6605. for (int k5 = 1; k5 < 2; k5++) {
  6606. for (int i6 = k2 - k5; i6 <= k2 + k5; i6++) {
  6607. for (int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  6608. if (i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5) {
  6609. i5 = anIntArrayArray825[i6][l6];
  6610. j3 = i6;
  6611. k3 = l6;
  6612. anInt1264 = 1;
  6613. flag1 = true;
  6614. }
  6615.  
  6616. }
  6617.  
  6618. if (flag1)
  6619. break;
  6620. }
  6621.  
  6622. }
  6623. if (!flag1)
  6624. return false;
  6625. }
  6626. i4 = 0;
  6627. bigX[i4] = j3;
  6628. bigY[i4++] = k3;
  6629. int l5;
  6630. for (int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3]) {
  6631. if (j5 != l5) {
  6632. l5 = j5;
  6633. bigX[i4] = j3;
  6634. bigY[i4++] = k3;
  6635. }
  6636. if ((j5 & 2) != 0)
  6637. j3++;
  6638. else if ((j5 & 8) != 0)
  6639. j3--;
  6640. if ((j5 & 1) != 0)
  6641. k3++;
  6642. else if ((j5 & 4) != 0)
  6643. k3--;
  6644. }
  6645. // if(cancelWalk) { return i4 > 0; }
  6646.  
  6647. if (i4 > 0) {
  6648. int k4 = i4;
  6649. if (k4 > 25)
  6650. k4 = 25;
  6651. i4--;
  6652. int k6 = bigX[i4];
  6653. int i7 = bigY[i4];
  6654. anInt1288 += k4;
  6655. if (anInt1288 >= 92) {
  6656. stream.createFrame(36);
  6657. stream.writeDWord(0);
  6658. anInt1288 = 0;
  6659. }
  6660. if (i == 0) {
  6661. stream.createFrame(164);
  6662. stream.writeWordBigEndian(k4 + k4 + 3);
  6663. }
  6664. if (i == 1) {
  6665. stream.createFrame(248);
  6666. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  6667. }
  6668. if (i == 2) {
  6669. stream.createFrame(98);
  6670. stream.writeWordBigEndian(k4 + k4 + 3);
  6671. }
  6672. stream.method433(k6 + baseX);
  6673. destX = bigX[0];
  6674. destY = bigY[0];
  6675. for (int j7 = 1; j7 < k4; j7++) {
  6676. i4--;
  6677. stream.writeWordBigEndian(bigX[i4] - k6);
  6678. stream.writeWordBigEndian(bigY[i4] - i7);
  6679. }
  6680.  
  6681. stream.method431(i7 + baseY);
  6682. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  6683. return true;
  6684. }
  6685. return i != 1;
  6686. }
  6687.  
  6688. private void method86(Stream stream) {
  6689. for (int j = 0; j < anInt893; j++) {
  6690. int k = anIntArray894[j];
  6691. NPC npc = npcArray[k];
  6692. int l = stream.readUnsignedByte();
  6693. if ((l & 0x10) != 0) {
  6694. int i1 = stream.method434();
  6695. if (i1 == 65535)
  6696. i1 = -1;
  6697. int i2 = stream.readUnsignedByte();
  6698. if (i1 == npc.anim && i1 != -1) {
  6699. int l2 = Animation.anims[i1].anInt365;
  6700. if (l2 == 1) {
  6701. npc.anInt1527 = 0;
  6702. npc.anInt1528 = 0;
  6703. npc.anInt1529 = i2;
  6704. npc.anInt1530 = 0;
  6705. }
  6706. if (l2 == 2)
  6707. npc.anInt1530 = 0;
  6708. } else if (i1 == -1 || npc.anim == -1
  6709. || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359) {
  6710. npc.anim = i1;
  6711. npc.anInt1527 = 0;
  6712. npc.anInt1528 = 0;
  6713. npc.anInt1529 = i2;
  6714. npc.anInt1530 = 0;
  6715. npc.anInt1542 = npc.smallXYIndex;
  6716. }
  6717. }
  6718. if ((l & 8) != 0) {
  6719. int j1 = stream.method426();
  6720. int j2 = stream.method427();
  6721. npc.updateHitData(j2, j1, loopCycle);
  6722. npc.loopCycleStatus = loopCycle + 300;
  6723. npc.currentHealth = stream.method426();
  6724. npc.maxHealth = stream.readUnsignedByte();
  6725. }
  6726. if ((l & 0x80) != 0) {
  6727. npc.anInt1520 = stream.readUnsignedWord();
  6728. int k1 = stream.readDWord();
  6729. npc.anInt1524 = k1 >> 16;
  6730. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  6731. npc.anInt1521 = 0;
  6732. npc.anInt1522 = 0;
  6733. if (npc.anInt1523 > loopCycle)
  6734. npc.anInt1521 = -1;
  6735. if (npc.anInt1520 == 65535)
  6736. npc.anInt1520 = -1;
  6737. }
  6738. if ((l & 0x20) != 0) {
  6739. npc.interactingEntity = stream.readUnsignedWord();
  6740. if (npc.interactingEntity == 65535)
  6741. npc.interactingEntity = -1;
  6742. }
  6743. if ((l & 1) != 0) {
  6744. npc.textSpoken = stream.readString();
  6745. npc.textCycle = 100;
  6746. // entityMessage(npc);
  6747.  
  6748. }
  6749. if ((l & 0x40) != 0) {
  6750. int l1 = stream.method427();
  6751. int k2 = stream.method428();
  6752. npc.updateHitData(k2, l1, loopCycle);
  6753. npc.loopCycleStatus = loopCycle + 300;
  6754. npc.currentHealth = stream.method428();
  6755. npc.maxHealth = stream.method427();
  6756. }
  6757. if ((l & 2) != 0) {
  6758. npc.desc = EntityDef.forID(stream.method436());
  6759. npc.anInt1540 = npc.desc.aByte68;
  6760. npc.anInt1504 = npc.desc.anInt79;
  6761. npc.anInt1554 = npc.desc.walkAnim;
  6762. npc.anInt1555 = npc.desc.anInt58;
  6763. npc.anInt1556 = npc.desc.anInt83;
  6764. npc.anInt1557 = npc.desc.anInt55;
  6765. npc.anInt1511 = npc.desc.standAnim;
  6766. }
  6767. if ((l & 4) != 0) {
  6768. npc.anInt1538 = stream.method434();
  6769. npc.anInt1539 = stream.method434();
  6770. }
  6771. }
  6772. }
  6773.  
  6774. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k) {
  6775. if (menuActionRow >= 400)
  6776. return;
  6777. if (entityDef.childrenIDs != null)
  6778. entityDef = entityDef.method161();
  6779. if (entityDef == null)
  6780. return;
  6781. if (!entityDef.aBoolean84)
  6782. return;
  6783. String s = entityDef.name;
  6784. if (entityDef.combatLevel != 0)
  6785. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel
  6786. + ")";
  6787. if (itemSelected == 1) {
  6788. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  6789. menuActionID[menuActionRow] = 582;
  6790. menuActionCmd1[menuActionRow] = i;
  6791. menuActionCmd2[menuActionRow] = k;
  6792. menuActionCmd3[menuActionRow] = j;
  6793. menuActionRow++;
  6794. return;
  6795. }
  6796. if (spellSelected == 1) {
  6797. if ((spellUsableOn & 2) == 2) {
  6798. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  6799. menuActionID[menuActionRow] = 413;
  6800. menuActionCmd1[menuActionRow] = i;
  6801. menuActionCmd2[menuActionRow] = k;
  6802. menuActionCmd3[menuActionRow] = j;
  6803. menuActionRow++;
  6804. }
  6805. } else {
  6806. if (entityDef.actions != null) {
  6807. for (int l = 4; l >= 0; l--)
  6808. if (entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack")) {
  6809. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  6810. if (l == 0)
  6811. menuActionID[menuActionRow] = 20;
  6812. if (l == 1)
  6813. menuActionID[menuActionRow] = 412;
  6814. if (l == 2)
  6815. menuActionID[menuActionRow] = 225;
  6816. if (l == 3)
  6817. menuActionID[menuActionRow] = 965;
  6818. if (l == 4)
  6819. menuActionID[menuActionRow] = 478;
  6820. menuActionCmd1[menuActionRow] = i;
  6821. menuActionCmd2[menuActionRow] = k;
  6822. menuActionCmd3[menuActionRow] = j;
  6823. menuActionRow++;
  6824. }
  6825.  
  6826. }
  6827. if (entityDef.actions != null) {
  6828. for (int i1 = 4; i1 >= 0; i1--)
  6829. if (entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack")) {
  6830. char c = '\0';
  6831. if (entityDef.combatLevel > myPlayer.combatLevel)
  6832. c = '\u07D0';
  6833. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  6834. if (i1 == 0)
  6835. menuActionID[menuActionRow] = 20 + c;
  6836. if (i1 == 1)
  6837. menuActionID[menuActionRow] = 412 + c;
  6838. if (i1 == 2)
  6839. menuActionID[menuActionRow] = 225 + c;
  6840. if (i1 == 3)
  6841. menuActionID[menuActionRow] = 965 + c;
  6842. if (i1 == 4)
  6843. menuActionID[menuActionRow] = 478 + c;
  6844. menuActionCmd1[menuActionRow] = i;
  6845. menuActionCmd2[menuActionRow] = k;
  6846. menuActionCmd3[menuActionRow] = j;
  6847. menuActionRow++;
  6848. }
  6849.  
  6850. }
  6851. // menuActionName[menuActionRow] = "Examine @yel@" + s + "
  6852. // @gre@(@whi@" + entityDef.type + "@gre@)";
  6853. menuActionName[menuActionRow] = "Examine @yel@" + s;
  6854. menuActionID[menuActionRow] = 1025;
  6855. menuActionCmd1[menuActionRow] = i;
  6856. menuActionCmd2[menuActionRow] = k;
  6857. menuActionCmd3[menuActionRow] = j;
  6858. menuActionRow++;
  6859. }
  6860. }
  6861.  
  6862. private void buildAtPlayerMenu(int i, int j, Player player, int k) {
  6863. if (player == myPlayer)
  6864. return;
  6865. if (menuActionRow >= 400)
  6866. return;
  6867. String s;
  6868. if (player.skill == 0)
  6869. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-"
  6870. + player.combatLevel + ")";
  6871. else
  6872. s = player.name + " (skill-" + player.skill + ")";
  6873. if (itemSelected == 1) {
  6874. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
  6875. menuActionID[menuActionRow] = 491;
  6876. menuActionCmd1[menuActionRow] = j;
  6877. menuActionCmd2[menuActionRow] = i;
  6878. menuActionCmd3[menuActionRow] = k;
  6879. menuActionRow++;
  6880. } else if (spellSelected == 1) {
  6881. if ((spellUsableOn & 8) == 8) {
  6882. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  6883. menuActionID[menuActionRow] = 365;
  6884. menuActionCmd1[menuActionRow] = j;
  6885. menuActionCmd2[menuActionRow] = i;
  6886. menuActionCmd3[menuActionRow] = k;
  6887. menuActionRow++;
  6888. }
  6889. } else {
  6890. for (int l = 4; l >= 0; l--)
  6891. if (atPlayerActions[l] != null) {
  6892. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  6893. char c = '\0';
  6894. if (atPlayerActions[l].equalsIgnoreCase("attack")) {
  6895. if (player.combatLevel > myPlayer.combatLevel)
  6896. c = '\u07D0';
  6897. if (myPlayer.team != 0 && player.team != 0)
  6898. if (myPlayer.team == player.team)
  6899. c = '\u07D0';
  6900. else
  6901. c = '\0';
  6902. } else if (atPlayerArray[l])
  6903. c = '\u07D0';
  6904. if (l == 0)
  6905. menuActionID[menuActionRow] = 561 + c;
  6906. if (l == 1)
  6907. menuActionID[menuActionRow] = 779 + c;
  6908. if (l == 2)
  6909. menuActionID[menuActionRow] = 27 + c;
  6910. if (l == 3)
  6911. menuActionID[menuActionRow] = 577 + c;
  6912. if (l == 4)
  6913. menuActionID[menuActionRow] = 729 + c;
  6914. menuActionCmd1[menuActionRow] = j;
  6915. menuActionCmd2[menuActionRow] = i;
  6916. menuActionCmd3[menuActionRow] = k;
  6917. menuActionRow++;
  6918. }
  6919.  
  6920. }
  6921. for (int i1 = 0; i1 < menuActionRow; i1++)
  6922. if (menuActionID[i1] == 516) {
  6923. menuActionName[i1] = "Walk here @whi@" + s;
  6924. return;
  6925. }
  6926.  
  6927. }
  6928.  
  6929. private void method89(Class30_Sub1 class30_sub1) {
  6930. int i = 0;
  6931. int j = -1;
  6932. int k = 0;
  6933. int l = 0;
  6934. if (class30_sub1.anInt1296 == 0)
  6935. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  6936. if (class30_sub1.anInt1296 == 1)
  6937. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  6938. if (class30_sub1.anInt1296 == 2)
  6939. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  6940. if (class30_sub1.anInt1296 == 3)
  6941. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  6942. if (i != 0) {
  6943. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298,
  6944. i);
  6945. j = i >> 14 & 0x7fff;
  6946. k = i1 & 0x1f;
  6947. l = i1 >> 6;
  6948. }
  6949. class30_sub1.anInt1299 = j;
  6950. class30_sub1.anInt1301 = k;
  6951. class30_sub1.anInt1300 = l;
  6952. }
  6953.  
  6954. private void method90() {
  6955. for (int i = 0; i < anInt1062; i++)
  6956. if (anIntArray1250[i] <= 0) {
  6957. boolean flag1 = false;
  6958. try {
  6959. if (anIntArray1207[i] == anInt874 && anIntArray1241[i] == anInt1289) {
  6960. if (!replayWave())
  6961. flag1 = true;
  6962. } else {
  6963. Stream stream = Sounds.method241(anIntArray1241[i], anIntArray1207[i]);
  6964. if (System.currentTimeMillis() + (long) (stream.currentOffset / 22) > aLong1172
  6965. + (long) (anInt1257 / 22)) {
  6966. anInt1257 = stream.currentOffset;
  6967. aLong1172 = System.currentTimeMillis();
  6968. if (saveWave(stream.buffer, stream.currentOffset)) {
  6969. anInt874 = anIntArray1207[i];
  6970. anInt1289 = anIntArray1241[i];
  6971. } else {
  6972. flag1 = true;
  6973. }
  6974. }
  6975. }
  6976. } catch (Exception exception) {
  6977. }
  6978. if (!flag1 || anIntArray1250[i] == -5) {
  6979. anInt1062--;
  6980. for (int j = i; j < anInt1062; j++) {
  6981. anIntArray1207[j] = anIntArray1207[j + 1];
  6982. anIntArray1241[j] = anIntArray1241[j + 1];
  6983. anIntArray1250[j] = anIntArray1250[j + 1];
  6984. }
  6985.  
  6986. i--;
  6987. } else {
  6988. anIntArray1250[i] = -5;
  6989. }
  6990. } else {
  6991. anIntArray1250[i]--;
  6992. }
  6993.  
  6994. if (prevSong > 0) {
  6995. prevSong -= 20;
  6996. if (prevSong < 0)
  6997. prevSong = 0;
  6998. if (prevSong == 0 && musicEnabled && !lowMem) {
  6999. nextSong = currentSong;
  7000. songChanging = true;
  7001. onDemandFetcher.method558(2, nextSong);
  7002. }
  7003. }
  7004. }
  7005.  
  7006. void startUp() {
  7007. drawLoadingText(20, "Starting up");
  7008. if (signlink.sunjava)
  7009. super.minDelay = 5;
  7010. if (aBoolean993) {
  7011. // rsAlreadyLoaded = true;
  7012. // return;
  7013. }
  7014. aBoolean993 = true;
  7015. boolean flag = true;
  7016. String s = getDocumentBaseHost();
  7017. if (signlink.cache_dat != null) {
  7018. for (int i = 0; i < 5; i++)
  7019. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  7020. }
  7021. try {
  7022. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  7023. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  7024. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  7025. chatTextDrawingArea = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  7026. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  7027. drawLogo();
  7028. loadTitleScreen();
  7029. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  7030. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  7031. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  7032. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  7033. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  7034. StreamLoader streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  7035. byteGroundArray = new byte[4][104][104];
  7036. intGroundArray = new int[4][105][105];
  7037. worldController = new WorldController(intGroundArray);
  7038. for (int j = 0; j < 4; j++)
  7039. aClass11Array1230[j] = new Class11();
  7040.  
  7041. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  7042. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  7043. drawLoadingText(60, "Connecting to update server");
  7044. onDemandFetcher = new OnDemandFetcher();
  7045. onDemandFetcher.start(streamLoader_6, this);
  7046. Class36.method528(onDemandFetcher.getAnimCount());
  7047. Model.method459(onDemandFetcher.getVersionCount(0), onDemandFetcher);
  7048. ModelDecompressor.loadModels();
  7049. ModelDecompressor.loadModels2();
  7050. preloadModels();
  7051. if (!lowMem) {
  7052. nextSong = 0;
  7053. try {
  7054. nextSong = Integer.parseInt(getParameter("music"));
  7055. } catch (Exception _ex) {
  7056. }
  7057. songChanging = true;
  7058. onDemandFetcher.method558(2, nextSong);
  7059. while (onDemandFetcher.getNodeCount() > 0) {
  7060. processOnDemandQueue();
  7061. try {
  7062. Thread.sleep(100L);
  7063. } catch (Exception _ex) {
  7064. }
  7065. if (onDemandFetcher.anInt1349 > 3) {
  7066. loadError();
  7067. return;
  7068. }
  7069. }
  7070. }
  7071. drawLoadingText(65, "Requesting animations");
  7072. int k = onDemandFetcher.getVersionCount(1);
  7073. for (int i1 = 0; i1 < k; i1++)
  7074. onDemandFetcher.method558(1, i1);
  7075.  
  7076. while (onDemandFetcher.getNodeCount() > 0) {
  7077. int j1 = k - onDemandFetcher.getNodeCount();
  7078. if (j1 > 0)
  7079. drawLoadingText(65, "Loading animations - " + (j1 * 100) / k + "%");
  7080. processOnDemandQueue();
  7081. try {
  7082. Thread.sleep(100L);
  7083. } catch (Exception _ex) {
  7084. }
  7085. if (onDemandFetcher.anInt1349 > 3) {
  7086. loadError();
  7087. return;
  7088. }
  7089. }
  7090. drawLoadingText(70, "Requesting models");
  7091. k = onDemandFetcher.getVersionCount(0);
  7092. for (int k1 = 0; k1 < k; k1++) {
  7093. int l1 = onDemandFetcher.getModelIndex(k1);
  7094. if ((l1 & 1) != 0)
  7095. onDemandFetcher.method558(0, k1);
  7096. }
  7097.  
  7098. k = onDemandFetcher.getNodeCount();
  7099. while (onDemandFetcher.getNodeCount() > 0) {
  7100. int i2 = k - onDemandFetcher.getNodeCount();
  7101. if (i2 > 0)
  7102. drawLoadingText(70, "Loading models - " + (i2 * 100) / k + "%");
  7103. processOnDemandQueue();
  7104. try {
  7105. Thread.sleep(100L);
  7106. } catch (Exception _ex) {
  7107. }
  7108. }
  7109. if (decompressors[0] != null) {
  7110. drawLoadingText(75, "Requesting maps");
  7111. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 47));
  7112. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 47));
  7113. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 48));
  7114. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 48));
  7115. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 49));
  7116. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 49));
  7117. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 47));
  7118. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 47));
  7119. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 48));
  7120. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 48));
  7121. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 148, 48));
  7122. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 148, 48));
  7123. k = onDemandFetcher.getNodeCount();
  7124. while (onDemandFetcher.getNodeCount() > 0) {
  7125. int j2 = k - onDemandFetcher.getNodeCount();
  7126. if (j2 > 0)
  7127. drawLoadingText(75, "Loading maps - " + (j2 * 100) / k + "%");
  7128. processOnDemandQueue();
  7129. try {
  7130. Thread.sleep(100L);
  7131. } catch (Exception _ex) {
  7132. }
  7133. }
  7134. }
  7135. k = onDemandFetcher.getVersionCount(0);
  7136. for (int k2 = 0; k2 < k; k2++) {
  7137. int l2 = onDemandFetcher.getModelIndex(k2);
  7138. byte byte0 = 0;
  7139. if ((l2 & 8) != 0)
  7140. byte0 = 10;
  7141. else if ((l2 & 0x20) != 0)
  7142. byte0 = 9;
  7143. else if ((l2 & 0x10) != 0)
  7144. byte0 = 8;
  7145. else if ((l2 & 0x40) != 0)
  7146. byte0 = 7;
  7147. else if ((l2 & 0x80) != 0)
  7148. byte0 = 6;
  7149. else if ((l2 & 2) != 0)
  7150. byte0 = 5;
  7151. else if ((l2 & 4) != 0)
  7152. byte0 = 4;
  7153. if ((l2 & 1) != 0)
  7154. byte0 = 3;
  7155. if (byte0 != 0)
  7156. onDemandFetcher.method563(byte0, 0, k2);
  7157. }
  7158.  
  7159. onDemandFetcher.method554(isMembers);
  7160. if (!lowMem) {
  7161. int l = onDemandFetcher.getVersionCount(2);
  7162. for (int i3 = 1; i3 < l; i3++)
  7163. if (onDemandFetcher.method569(i3))
  7164. onDemandFetcher.method563((byte) 1, 2, i3);
  7165.  
  7166. }
  7167. drawLoadingText(80, "Unpacking media");
  7168. /* Custom sprite unpacking */
  7169. loadExtraSprites();
  7170. emptyOrb = new Sprite("emptyorb");
  7171. hoverOrb = new Sprite("hoverorb");
  7172. hoverorbrun2 = new Sprite("hoverorbrun2");
  7173. hoverorbrun = new Sprite("hoverorbrun");
  7174. runClick = new Sprite("runclick");
  7175. runorb = new Sprite("runorb");
  7176. hitPointsFill = new Sprite("hitpointsfill");
  7177. prayerFill = new Sprite("prayerfill");
  7178.  
  7179. HPBarFull = new Sprite(signlink.findcachedir() + "Sprites/Player/HP 0.PNG", 1);
  7180. HPBarEmpty = new Sprite(signlink.findcachedir() + "Sprites/Player/HP 1.PNG", 1);
  7181.  
  7182. chatArea = new Sprite("chatarea");
  7183. tabArea = new Sprite("tabarea");
  7184. mapArea = new Sprite("maparea");
  7185. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  7186. /**/
  7187. mapBack = new Background(streamLoader_2, "mapback", 0);
  7188. for (int c1 = 0; c1 <= 3; c1++)
  7189. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  7190. for (int j3 = 0; j3 <= 14; j3++)
  7191. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  7192. for (int r1 = 0; r1 < 5; r1++)
  7193. redStones[r1] = new Sprite("redstones " + r1);
  7194. compass = new Sprite(streamLoader_2, "compass", 0);
  7195. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  7196. mapEdge.method345();
  7197. try {
  7198. for (int k3 = 0; k3 < 100; k3++)
  7199. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  7200. } catch (Exception _ex) {
  7201. }
  7202. try {
  7203. for (int l3 = 0; l3 < 100; l3++)
  7204. mapFunctions[l3] = new Sprite(streamLoader_2, "mapfunction", l3);
  7205. } catch (Exception _ex) {
  7206. }
  7207. try {
  7208. for (int i4 = 0; i4 < 20; i4++)
  7209. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  7210. } catch (Exception _ex) {
  7211. }
  7212. try {
  7213. for (int h1 = 0; h1 < 6; h1++)
  7214. headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
  7215. } catch (Exception _ex) {
  7216. }
  7217. try {
  7218. for (int j4 = 0; j4 < 8; j4++)
  7219. headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);
  7220. for (int j45 = 0; j45 < 3; j45++)
  7221. skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45);
  7222. } catch (Exception _ex) {
  7223. }
  7224. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  7225. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  7226. for (int k4 = 0; k4 < 8; k4++)
  7227. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  7228.  
  7229. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  7230. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  7231. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  7232. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  7233. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  7234. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  7235. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  7236. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  7237.  
  7238. for (int l4 = 0; l4 < 2; l4++)
  7239. modIcons[l4] = new Background(streamLoader_2, "mod_icons", l4);
  7240.  
  7241. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  7242. leftFrame = new GraphicsBuffer(sprite.myWidth, sprite.myHeight);
  7243. sprite.method346(0, 0);
  7244. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  7245. topFrame = new GraphicsBuffer(sprite.myWidth, sprite.myHeight);
  7246. sprite.method346(0, 0);
  7247. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  7248. rightFrame = new GraphicsBuffer(sprite.myWidth, sprite.myHeight);
  7249. sprite.method346(0, 0);
  7250. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  7251. mapEdgeIP = new GraphicsBuffer(sprite.myWidth, sprite.myHeight);
  7252. sprite.method346(0, 0);
  7253.  
  7254. int i5 = (int) (Math.random() * 21D) - 10;
  7255. int j5 = (int) (Math.random() * 21D) - 10;
  7256. int k5 = (int) (Math.random() * 21D) - 10;
  7257. int l5 = (int) (Math.random() * 41D) - 20;
  7258. for (int i6 = 0; i6 < 100; i6++) {
  7259. if (mapFunctions[i6] != null)
  7260. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  7261. if (mapScenes[i6] != null)
  7262. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  7263. }
  7264.  
  7265. drawLoadingText(83, "Unpacking textures");
  7266. Texture.method368(streamLoader_3);
  7267. Texture.method372(0.80000000000000004D);
  7268. Texture.method367();
  7269. drawLoadingText(86, "Unpacking config");
  7270. Animation.unpackConfig(streamLoader);
  7271. ObjectDef.unpackConfig(streamLoader);
  7272. Flo.unpackConfig(streamLoader);
  7273. ItemDef.unpackConfig(streamLoader);
  7274. EntityDef.unpackConfig(streamLoader);
  7275. IDK.unpackConfig(streamLoader);
  7276. SpotAnim.unpackConfig(streamLoader);
  7277. Varp.unpackConfig(streamLoader);
  7278. VarBit.unpackConfig(streamLoader);
  7279. ItemDef.isMembers = isMembers;
  7280. if (!lowMem) {
  7281. drawLoadingText(90, "Unpacking sounds");
  7282. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  7283. Stream stream = new Stream(abyte0);
  7284. Sounds.unpack(stream);
  7285. }
  7286. drawLoadingText(95, "Unpacking interfaces");
  7287. TextDrawingArea aclass30_sub2_sub1_sub4s[] = { smallText, aTextDrawingArea_1271, chatTextDrawingArea,
  7288. aTextDrawingArea_1273 };
  7289. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  7290. drawLoadingText(100, "Preparing game engine");
  7291. for (int j6 = 0; j6 < 33; j6++) {
  7292. int k6 = 999;
  7293. int i7 = 0;
  7294. for (int k7 = 0; k7 < 34; k7++) {
  7295. if (mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0) {
  7296. if (k6 == 999)
  7297. k6 = k7;
  7298. continue;
  7299. }
  7300. if (k6 == 999)
  7301. continue;
  7302. i7 = k7;
  7303. break;
  7304. }
  7305.  
  7306. anIntArray968[j6] = k6;
  7307. anIntArray1057[j6] = i7 - k6;
  7308. }
  7309.  
  7310. for (int l6 = 5; l6 < 156; l6++) {
  7311. int j7 = 999;
  7312. int l7 = 0;
  7313. for (int j8 = 25; j8 < 172; j8++) {
  7314. if (mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34)) {
  7315. if (j7 == 999)
  7316. j7 = j8;
  7317. continue;
  7318. }
  7319. if (j7 == 999)
  7320. continue;
  7321. l7 = j8;
  7322. break;
  7323. }
  7324.  
  7325. anIntArray1052[l6 - 5] = j7 - 25;
  7326. anIntArray1229[l6 - 5] = l7 - j7;
  7327. }
  7328.  
  7329. Texture.method365(765, 503);
  7330. fullScreenTextureArray = Texture.anIntArray1472;
  7331. Texture.method365(519, 165);
  7332. anIntArray1180 = Texture.anIntArray1472;
  7333. Texture.method365(246, 335);
  7334. anIntArray1181 = Texture.anIntArray1472;
  7335. Texture.method365(512, 334);
  7336. anIntArray1182 = Texture.anIntArray1472;
  7337. int ai[] = new int[9];
  7338. for (int i8 = 0; i8 < 9; i8++) {
  7339. int k8 = 128 + i8 * 32 + 15;
  7340. int l8 = 600 + k8 * 3;
  7341. int i9 = Texture.anIntArray1470[k8];
  7342. ai[i8] = l8 * i9 >> 16;
  7343. }
  7344.  
  7345. WorldController.method310(500, 800, 512, 334, ai);
  7346. Censor.loadConfig(streamLoader_4);
  7347. mouseDetection = new MouseDetection(this);
  7348. startRunnable(mouseDetection, 10);
  7349. Animable_Sub5.clientInstance = this;
  7350. ObjectDef.clientInstance = this;
  7351. EntityDef.clientInstance = this;
  7352. return;
  7353. } catch (Exception exception) {
  7354. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  7355. }
  7356. loadingError = true;
  7357. }
  7358.  
  7359. private void method91(Stream stream, int i) {
  7360. while (stream.bitPosition + 10 < i * 8) {
  7361. int j = stream.readBits(11);
  7362. if (j == 2047)
  7363. break;
  7364. if (playerArray[j] == null) {
  7365. playerArray[j] = new Player();
  7366. if (aStreamArray895s[j] != null)
  7367. playerArray[j].updatePlayer(aStreamArray895s[j]);
  7368. }
  7369. playerIndices[playerCount++] = j;
  7370. Player player = playerArray[j];
  7371. player.anInt1537 = loopCycle;
  7372. int k = stream.readBits(1);
  7373. if (k == 1)
  7374. anIntArray894[anInt893++] = j;
  7375. int l = stream.readBits(1);
  7376. int i1 = stream.readBits(5);
  7377. if (i1 > 15)
  7378. i1 -= 32;
  7379. int j1 = stream.readBits(5);
  7380. if (j1 > 15)
  7381. j1 -= 32;
  7382. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  7383. }
  7384. stream.finishBitAccess();
  7385. }
  7386.  
  7387. private void processMainScreenClick() {
  7388. if (anInt1021 != 0)
  7389. return;
  7390. if (super.clickMode3 == 1) {
  7391. int i = super.saveClickX - 25 - 545;
  7392. int j = super.saveClickY - 5 - 4;
  7393. if (i >= 0 && j >= 0 && i < 146 && j < 151) {
  7394. i -= 73;
  7395. j -= 75;
  7396. int k = minimapInt1 + minimapInt2 & 0x7ff;
  7397. int i1 = Texture.anIntArray1470[k];
  7398. int j1 = Texture.anIntArray1471[k];
  7399. i1 = i1 * (minimapInt3 + 256) >> 8;
  7400. j1 = j1 * (minimapInt3 + 256) >> 8;
  7401. int k1 = j * i1 + i * j1 >> 11;
  7402. int l1 = j * j1 - i * i1 >> 11;
  7403. int i2 = myPlayer.x + k1 >> 7;
  7404. int j2 = myPlayer.y - l1 >> 7;
  7405. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  7406. if (flag1) {
  7407. stream.writeWordBigEndian(i);
  7408. stream.writeWordBigEndian(j);
  7409. stream.writeWord(minimapInt1);
  7410. stream.writeWordBigEndian(57);
  7411. stream.writeWordBigEndian(minimapInt2);
  7412. stream.writeWordBigEndian(minimapInt3);
  7413. stream.writeWordBigEndian(89);
  7414. stream.writeWord(myPlayer.x);
  7415. stream.writeWord(myPlayer.y);
  7416. stream.writeWordBigEndian(anInt1264);
  7417. stream.writeWordBigEndian(63);
  7418. }
  7419. }
  7420. anInt1117++;
  7421. if (anInt1117 > 1151) {
  7422. anInt1117 = 0;
  7423. stream.createFrame(246);
  7424. stream.writeWordBigEndian(0);
  7425. int l = stream.currentOffset;
  7426. if ((int) (Math.random() * 2D) == 0)
  7427. stream.writeWordBigEndian(101);
  7428. stream.writeWordBigEndian(197);
  7429. stream.writeWord((int) (Math.random() * 65536D));
  7430. stream.writeWordBigEndian((int) (Math.random() * 256D));
  7431. stream.writeWordBigEndian(67);
  7432. stream.writeWord(14214);
  7433. if ((int) (Math.random() * 2D) == 0)
  7434. stream.writeWord(29487);
  7435. stream.writeWord((int) (Math.random() * 65536D));
  7436. if ((int) (Math.random() * 2D) == 0)
  7437. stream.writeWordBigEndian(220);
  7438. stream.writeWordBigEndian(180);
  7439. stream.writeBytes(stream.currentOffset - l);
  7440. }
  7441. }
  7442. }
  7443.  
  7444. private String interfaceIntToString(int j) {
  7445. if (j < 0x3b9ac9ff)
  7446. return String.valueOf(j);
  7447. else
  7448. return "*";
  7449. }
  7450.  
  7451. private void showErrorScreen() {
  7452. Graphics g = getGameComponent().getGraphics();
  7453. g.setColor(Color.black);
  7454. g.fillRect(0, 0, 765, 503);
  7455. method4(1);
  7456. if (loadingError) {
  7457. aBoolean831 = false;
  7458. g.setFont(new Font("Helvetica", 1, 16));
  7459. g.setColor(Color.yellow);
  7460. int k = 35;
  7461. g.drawString("Sorry, an error has occured whilst loading RuneScape", 30, k);
  7462. k += 50;
  7463. g.setColor(Color.white);
  7464. g.drawString("To fix this try the following (in order):", 30, k);
  7465. k += 50;
  7466. g.setColor(Color.white);
  7467. g.setFont(new Font("Helvetica", 1, 12));
  7468. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  7469. k += 30;
  7470. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  7471. k += 30;
  7472. g.drawString("3: Try using a different game-world", 30, k);
  7473. k += 30;
  7474. g.drawString("4: Try rebooting your computer", 30, k);
  7475. k += 30;
  7476. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  7477. }
  7478. if (genericLoadingError) {
  7479. aBoolean831 = false;
  7480. g.setFont(new Font("Helvetica", 1, 20));
  7481. g.setColor(Color.white);
  7482. g.drawString("Error - unable to load game!", 50, 50);
  7483. g.drawString("To play RuneScape make sure you play from", 50, 100);
  7484. g.drawString("http://www.runescape.com", 50, 150);
  7485. }
  7486. if (rsAlreadyLoaded) {
  7487. aBoolean831 = false;
  7488. g.setColor(Color.yellow);
  7489. int l = 35;
  7490. g.drawString("Error a copy of RuneScape already appears to be loaded", 30, l);
  7491. l += 50;
  7492. g.setColor(Color.white);
  7493. g.drawString("To fix this try the following (in order):", 30, l);
  7494. l += 50;
  7495. g.setColor(Color.white);
  7496. g.setFont(new Font("Helvetica", 1, 12));
  7497. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  7498. l += 30;
  7499. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  7500. l += 30;
  7501. }
  7502. }
  7503.  
  7504. public URL getCodeBase() {
  7505. try {
  7506. return new URL(server + ":" + (80 + portOff));
  7507. } catch (Exception _ex) {
  7508. }
  7509. return null;
  7510. }
  7511.  
  7512. private void method95() {
  7513. for (int j = 0; j < npcCount; j++) {
  7514. int k = npcIndices[j];
  7515. NPC npc = npcArray[k];
  7516. if (npc != null)
  7517. method96(npc);
  7518. }
  7519. }
  7520.  
  7521. private void method96(Entity entity) {
  7522. if (entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184) {
  7523. entity.anim = -1;
  7524. entity.anInt1520 = -1;
  7525. entity.anInt1547 = 0;
  7526. entity.anInt1548 = 0;
  7527. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7528. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7529. entity.method446();
  7530. }
  7531. if (entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776)) {
  7532. entity.anim = -1;
  7533. entity.anInt1520 = -1;
  7534. entity.anInt1547 = 0;
  7535. entity.anInt1548 = 0;
  7536. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7537. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7538. entity.method446();
  7539. }
  7540. if (entity.anInt1547 > loopCycle)
  7541. method97(entity);
  7542. else if (entity.anInt1548 >= loopCycle)
  7543. method98(entity);
  7544. else
  7545. method99(entity);
  7546. method100(entity);
  7547. method101(entity);
  7548. }
  7549.  
  7550. private void method97(Entity entity) {
  7551. int i = entity.anInt1547 - loopCycle;
  7552. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7553. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7554. entity.x += (j - entity.x) / i;
  7555. entity.y += (k - entity.y) / i;
  7556. entity.anInt1503 = 0;
  7557. if (entity.anInt1549 == 0)
  7558. entity.turnDirection = 1024;
  7559. if (entity.anInt1549 == 1)
  7560. entity.turnDirection = 1536;
  7561. if (entity.anInt1549 == 2)
  7562. entity.turnDirection = 0;
  7563. if (entity.anInt1549 == 3)
  7564. entity.turnDirection = 512;
  7565. }
  7566.  
  7567. private void method98(Entity entity) {
  7568. if (entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0
  7569. || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527)) {
  7570. int i = entity.anInt1548 - entity.anInt1547;
  7571. int j = loopCycle - entity.anInt1547;
  7572. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7573. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7574. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  7575. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  7576. entity.x = (k * (i - j) + i1 * j) / i;
  7577. entity.y = (l * (i - j) + j1 * j) / i;
  7578. }
  7579. entity.anInt1503 = 0;
  7580. if (entity.anInt1549 == 0)
  7581. entity.turnDirection = 1024;
  7582. if (entity.anInt1549 == 1)
  7583. entity.turnDirection = 1536;
  7584. if (entity.anInt1549 == 2)
  7585. entity.turnDirection = 0;
  7586. if (entity.anInt1549 == 3)
  7587. entity.turnDirection = 512;
  7588. entity.anInt1552 = entity.turnDirection;
  7589. }
  7590.  
  7591. private void method99(Entity entity) {
  7592. entity.anInt1517 = entity.anInt1511;
  7593. if (entity.smallXYIndex == 0) {
  7594. entity.anInt1503 = 0;
  7595. return;
  7596. }
  7597. if (entity.anim != -1 && entity.anInt1529 == 0) {
  7598. Animation animation = Animation.anims[entity.anim];
  7599. if (entity.anInt1542 > 0 && animation.anInt363 == 0) {
  7600. entity.anInt1503++;
  7601. return;
  7602. }
  7603. if (entity.anInt1542 <= 0 && animation.anInt364 == 0) {
  7604. entity.anInt1503++;
  7605. return;
  7606. }
  7607. }
  7608. int i = entity.x;
  7609. int j = entity.y;
  7610. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7611. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7612. if (k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256) {
  7613. entity.x = k;
  7614. entity.y = l;
  7615. return;
  7616. }
  7617. if (i < k) {
  7618. if (j < l)
  7619. entity.turnDirection = 1280;
  7620. else if (j > l)
  7621. entity.turnDirection = 1792;
  7622. else
  7623. entity.turnDirection = 1536;
  7624. } else if (i > k) {
  7625. if (j < l)
  7626. entity.turnDirection = 768;
  7627. else if (j > l)
  7628. entity.turnDirection = 256;
  7629. else
  7630. entity.turnDirection = 512;
  7631. } else if (j < l)
  7632. entity.turnDirection = 1024;
  7633. else
  7634. entity.turnDirection = 0;
  7635. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  7636. if (i1 > 1024)
  7637. i1 -= 2048;
  7638. int j1 = entity.anInt1555;
  7639. if (i1 >= -256 && i1 <= 256)
  7640. j1 = entity.anInt1554;
  7641. else if (i1 >= 256 && i1 < 768)
  7642. j1 = entity.anInt1557;
  7643. else if (i1 >= -768 && i1 <= -256)
  7644. j1 = entity.anInt1556;
  7645. if (j1 == -1)
  7646. j1 = entity.anInt1554;
  7647. entity.anInt1517 = j1;
  7648. int k1 = 4;
  7649. if (entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  7650. k1 = 2;
  7651. if (entity.smallXYIndex > 2)
  7652. k1 = 6;
  7653. if (entity.smallXYIndex > 3)
  7654. k1 = 8;
  7655. if (entity.anInt1503 > 0 && entity.smallXYIndex > 1) {
  7656. k1 = 8;
  7657. entity.anInt1503--;
  7658. }
  7659. if (entity.aBooleanArray1553[entity.smallXYIndex - 1])
  7660. k1 <<= 1;
  7661. if (k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  7662. entity.anInt1517 = entity.anInt1505;
  7663. if (i < k) {
  7664. entity.x += k1;
  7665. if (entity.x > k)
  7666. entity.x = k;
  7667. } else if (i > k) {
  7668. entity.x -= k1;
  7669. if (entity.x < k)
  7670. entity.x = k;
  7671. }
  7672. if (j < l) {
  7673. entity.y += k1;
  7674. if (entity.y > l)
  7675. entity.y = l;
  7676. } else if (j > l) {
  7677. entity.y -= k1;
  7678. if (entity.y < l)
  7679. entity.y = l;
  7680. }
  7681. if (entity.x == k && entity.y == l) {
  7682. entity.smallXYIndex--;
  7683. if (entity.anInt1542 > 0)
  7684. entity.anInt1542--;
  7685. }
  7686. }
  7687.  
  7688. private void method100(Entity entity) {
  7689. if (entity.anInt1504 == 0)
  7690. return;
  7691. if (entity.interactingEntity != -1 && entity.interactingEntity < 32768) {
  7692. NPC npc = npcArray[entity.interactingEntity];
  7693. if (npc != null) {
  7694. int i1 = entity.x - npc.x;
  7695. int k1 = entity.y - npc.y;
  7696. if (i1 != 0 || k1 != 0)
  7697. entity.turnDirection = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  7698. }
  7699. }
  7700. if (entity.interactingEntity >= 32768) {
  7701. int j = entity.interactingEntity - 32768;
  7702. if (j == unknownInt10)
  7703. j = myPlayerIndex;
  7704. Player player = playerArray[j];
  7705. if (player != null) {
  7706. int l1 = entity.x - player.x;
  7707. int i2 = entity.y - player.y;
  7708. if (l1 != 0 || i2 != 0)
  7709. entity.turnDirection = (int) (Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  7710. }
  7711. }
  7712. if ((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0)) {
  7713. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  7714. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  7715. if (k != 0 || j1 != 0)
  7716. entity.turnDirection = (int) (Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  7717. entity.anInt1538 = 0;
  7718. entity.anInt1539 = 0;
  7719. }
  7720. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  7721. if (l != 0) {
  7722. if (l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  7723. entity.anInt1552 = entity.turnDirection;
  7724. else if (l > 1024)
  7725. entity.anInt1552 -= entity.anInt1504;
  7726. else
  7727. entity.anInt1552 += entity.anInt1504;
  7728. entity.anInt1552 &= 0x7ff;
  7729. if (entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection) {
  7730. if (entity.anInt1512 != -1) {
  7731. entity.anInt1517 = entity.anInt1512;
  7732. return;
  7733. }
  7734. entity.anInt1517 = entity.anInt1554;
  7735. }
  7736. }
  7737. }
  7738.  
  7739. private void method101(Entity entity) {
  7740. try {
  7741. if (entity.anInt1517 > 13798) {
  7742. entity.anInt1517 = -1;
  7743. }
  7744. entity.aBoolean1541 = false;
  7745. if (entity.anInt1517 != -1) {
  7746. Animation animation = Animation.anims[entity.anInt1517];
  7747. entity.anInt1519++;
  7748. if (entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518)) {
  7749. entity.anInt1519 = 1;
  7750. entity.anInt1518++;
  7751. }
  7752. if (entity.anInt1518 >= animation.anInt352) {
  7753. entity.anInt1519 = 0;
  7754. entity.anInt1518 = 0;
  7755. }
  7756. if (enableTweening) {
  7757. entity.nextIdleAnimFrame = entity.anInt1518 + 1;
  7758. }
  7759. if (entity.nextIdleAnimFrame >= animation.anInt352) {
  7760. entity.nextIdleAnimFrame = -1;
  7761. }
  7762. }
  7763. if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
  7764. if (entity.anInt1521 < 0)
  7765. entity.anInt1521 = 0;
  7766. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  7767. for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352
  7768. && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  7769. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  7770.  
  7771. if (entity.anInt1521 >= animation_1.anInt352
  7772. && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352)) {
  7773. entity.anInt1520 = -1;
  7774. }
  7775. if (enableTweening) {
  7776. entity.nextIdleAnimFrame = entity.anInt1518 + 1;
  7777. }
  7778. if (entity.nextSpotAnimFrame >= animation_1.anInt352) {
  7779. entity.nextSpotAnimFrame = -1;
  7780. }
  7781. }
  7782. if (entity.anim != -1 && entity.anInt1529 <= 1) {
  7783. Animation animation_2 = Animation.anims[entity.anim];
  7784. if (animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle
  7785. && entity.anInt1548 < loopCycle) {
  7786. entity.anInt1529 = 1;
  7787. return;
  7788. }
  7789. }
  7790. if (entity.anim != -1 && entity.anInt1529 == 0) {
  7791. Animation animation_3 = Animation.anims[entity.anim];
  7792. for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352
  7793. && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  7794. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  7795.  
  7796. if (entity.anInt1527 >= animation_3.anInt352) {
  7797. entity.anInt1527 -= animation_3.anInt356;
  7798. entity.anInt1530++;
  7799. if (entity.anInt1530 >= animation_3.anInt362)
  7800. entity.anim = -1;
  7801. if (entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  7802. entity.anim = -1;
  7803. }
  7804. if (enableTweening) {
  7805. entity.nextAnimFrame = entity.anInt1527 + 1;
  7806. }
  7807. if (entity.nextAnimFrame >= animation_3.anInt352) {
  7808. entity.nextAnimFrame = -1;
  7809. }
  7810. entity.aBoolean1541 = animation_3.aBoolean358;
  7811. }
  7812. if (entity.anInt1529 > 0)
  7813. entity.anInt1529--;
  7814. } catch (Exception e) {
  7815.  
  7816. }
  7817. }
  7818.  
  7819. private void drawGameScreen() {
  7820. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  7821. if (loadingStage == 2) {
  7822. method119(anInt945, fullscreenInterfaceID);
  7823. if (openInterfaceID != -1) {
  7824. method119(anInt945, openInterfaceID);
  7825. }
  7826. anInt945 = 0;
  7827. resetAllImageProducers();
  7828. super.fullGameScreen.setCanvas();
  7829. Texture.anIntArray1472 = fullScreenTextureArray;
  7830. DrawingArea.setAllPixelsToZero();
  7831. welcomeScreenRaised = true;
  7832. if (openInterfaceID != -1) {
  7833. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  7834. if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  7835. rsInterface_1.width = 765;
  7836. rsInterface_1.height = 503;
  7837. }
  7838. drawInterface(0, 0, rsInterface_1, 8);
  7839. }
  7840. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  7841. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  7842. rsInterface.width = 765;
  7843. rsInterface.height = 503;
  7844. }
  7845. drawInterface(0, 0, rsInterface, 8);
  7846.  
  7847. if (!menuOpen) {
  7848. processRightClick();
  7849. drawTooltip();
  7850. } else {
  7851. drawMenu();
  7852. }
  7853. }
  7854. drawCount++;
  7855. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  7856. return;
  7857. } else {
  7858. if (drawCount != 0) {
  7859. resetImageProducers2();
  7860. }
  7861. }
  7862. if (welcomeScreenRaised) {
  7863. welcomeScreenRaised = false;
  7864. topFrame.drawGraphics(0, super.graphics, 0);
  7865. leftFrame.drawGraphics(4, super.graphics, 0);
  7866. rightFrame.drawGraphics(4, super.graphics, 516);
  7867. mapEdgeIP.drawGraphics(4, super.graphics, 519);
  7868. needDrawTabArea = true;
  7869. inputTaken = true;
  7870. tabAreaAltered = true;
  7871. aBoolean1233 = true;
  7872. if (loadingStage != 2) {
  7873. aGraphicsBuffer_1165.drawGraphics(4, super.graphics, 4);
  7874. aGraphicsBuffer_1164.drawGraphics(4, super.graphics, 545);
  7875. }
  7876. }
  7877. if (menuOpen && menuScreenArea == 1)
  7878. needDrawTabArea = true;
  7879. if (invOverlayInterfaceID != -1) {
  7880. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  7881. if (flag1)
  7882. needDrawTabArea = true;
  7883. }
  7884. if (atInventoryInterfaceType == 2)
  7885. needDrawTabArea = true;
  7886. if (activeInterfaceType == 2)
  7887. needDrawTabArea = true;
  7888. /*
  7889. * if(needDrawTabArea) {
  7890. */
  7891. drawTabArea();
  7892. /*
  7893. * needDrawTabArea = false; }
  7894. */
  7895. if (backDialogID == -1) {
  7896. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  7897. if (super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  7898. method65(494, 110, super.mouseX - 0, super.mouseY - 348, aClass9_1059, 0, false, anInt1211);
  7899. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  7900. if (i < 0)
  7901. i = 0;
  7902. if (i > anInt1211 - 110)
  7903. i = anInt1211 - 110;
  7904. if (anInt1089 != i) {
  7905. anInt1089 = i;
  7906. inputTaken = true;
  7907. }
  7908. }
  7909. if (backDialogID != -1) {
  7910. boolean flag2 = method119(anInt945, backDialogID);
  7911. if (flag2)
  7912. inputTaken = true;
  7913. }
  7914. if (atInventoryInterfaceType == 3)
  7915. inputTaken = true;
  7916. if (activeInterfaceType == 3)
  7917. inputTaken = true;
  7918. if (aString844 != null)
  7919. inputTaken = true;
  7920. if (menuOpen && menuScreenArea == 2)
  7921. inputTaken = true;
  7922. if (inputTaken) {
  7923. drawChatArea();
  7924. inputTaken = false;
  7925. }
  7926. if (loadingStage == 2)
  7927. method146();
  7928. if (loadingStage == 2) {
  7929. drawMinimap();
  7930. aGraphicsBuffer_1164.drawGraphics(4, super.graphics, 545);
  7931. }
  7932. if (anInt1054 != -1)
  7933. tabAreaAltered = true;
  7934. if (tabAreaAltered) {
  7935. if (anInt1054 != -1 && anInt1054 == tabID) {
  7936. anInt1054 = -1;
  7937. stream.createFrame(120);
  7938. stream.writeWordBigEndian(tabID);
  7939. }
  7940. tabAreaAltered = false;
  7941. aGraphicsBuffer_1125.setCanvas();
  7942. aGraphicsBuffer_1165.setCanvas();
  7943. }
  7944. anInt945 = 0;
  7945. }
  7946.  
  7947. private boolean buildFriendsListMenu(RSInterface class9) {
  7948. int i = class9.contentType;
  7949. if (i >= 1 && i <= 200 || i >= 701 && i <= 900) {
  7950. if (i >= 801)
  7951. i -= 701;
  7952. else if (i >= 701)
  7953. i -= 601;
  7954. else if (i >= 101)
  7955. i -= 101;
  7956. else
  7957. i--;
  7958. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  7959. menuActionID[menuActionRow] = 792;
  7960. menuActionRow++;
  7961. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  7962. menuActionID[menuActionRow] = 639;
  7963. menuActionRow++;
  7964. return true;
  7965. }
  7966. if (i >= 401 && i <= 500) {
  7967. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  7968. menuActionID[menuActionRow] = 322;
  7969. menuActionRow++;
  7970. return true;
  7971. } else {
  7972. return false;
  7973. }
  7974. }
  7975.  
  7976. private void method104() {
  7977. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056.reverseGetFirst();
  7978. for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056.reverseGetNext())
  7979. if (class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  7980. class30_sub2_sub4_sub3.unlink();
  7981. else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
  7982. class30_sub2_sub4_sub3.method454(anInt945);
  7983. if (class30_sub2_sub4_sub3.aBoolean1567)
  7984. class30_sub2_sub4_sub3.unlink();
  7985. else
  7986. worldController.method285(class30_sub2_sub4_sub3.anInt1560, 0, class30_sub2_sub4_sub3.anInt1563, -1,
  7987. class30_sub2_sub4_sub3.anInt1562, 60, class30_sub2_sub4_sub3.anInt1561,
  7988. class30_sub2_sub4_sub3, false);
  7989. }
  7990.  
  7991. }
  7992.  
  7993. public void drawBlackBox(int xPos, int yPos) {
  7994. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  7995. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  7996. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  7997. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  7998. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  7999. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  8000. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  8001. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  8002. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  8003. }
  8004.  
  8005. private void drawInterface(int j, int k, RSInterface class9, int l) {
  8006. if (class9.type != 0 || class9.children == null)
  8007. return;
  8008. if (class9.isMouseoverTriggered && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  8009. return;
  8010. int i1 = DrawingArea.topX;
  8011. int j1 = DrawingArea.topY;
  8012. int k1 = DrawingArea.bottomX;
  8013. int l1 = DrawingArea.bottomY;
  8014. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  8015. int i2 = class9.children.length;
  8016. for (int j2 = 0; j2 < i2; j2++) {
  8017. int k2 = class9.childX[j2] + k;
  8018. int l2 = (class9.childY[j2] + l) - j;
  8019. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  8020. k2 += class9_1.anInt263;
  8021. l2 += class9_1.anInt265;
  8022. if (class9_1.contentType > 0)
  8023. drawFriendsListOrWelcomeScreen(class9_1);
  8024. // here
  8025. int[] IDs = { 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573, 1290, 1299,
  8026. 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388, 1397, 1404, 1583, 12038, 1414,
  8027. 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878, 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503,
  8028. 1512, 1521, 1530, 1544, 1553, 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  8029. /* Ancients */
  8030. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062, 12952, 13000,
  8031. 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096 };
  8032. for (int m5 = 0; m5 < IDs.length; m5++) {
  8033. if (class9_1.id == IDs[m5] + 1) {
  8034. if (m5 > 61)
  8035. drawBlackBox(k2 + 1, l2);
  8036. else
  8037. drawBlackBox(k2, l2 + 1);
  8038. }
  8039. }
  8040. int[] runeChildren = { 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243,
  8041. 1244, 1245, 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293,
  8042. 1294, 1295, 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343,
  8043. 1344, 1345, 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392,
  8044. 1393, 1400, 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442,
  8045. 1449, 1450, 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497,
  8046. 1498, 1499, 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548,
  8047. 1549, 1556, 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598,
  8048. 1605, 1606, 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673,
  8049. 8674, 12041, 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460,
  8050. 15881, 15882, 15885, 18474, 18475, 18478 };
  8051. for (int r = 0; r < runeChildren.length; r++)
  8052. if (class9_1.id == runeChildren[r])
  8053. class9_1.modelZoom = 775;
  8054. if (class9_1.type == 0) {
  8055. if (class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  8056. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  8057. if (class9_1.scrollPosition < 0)
  8058. class9_1.scrollPosition = 0;
  8059. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  8060. if (class9_1.scrollMax > class9_1.height)
  8061. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width,
  8062. class9_1.scrollMax);
  8063. } else if (class9_1.type != 1)
  8064. if (class9_1.type == 2) {
  8065. int i3 = 0;
  8066. for (int l3 = 0; l3 < class9_1.height; l3++) {
  8067. for (int l4 = 0; l4 < class9_1.width; l4++) {
  8068. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  8069. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  8070. if (i3 < 20) {
  8071. k5 += class9_1.spritesX[i3];
  8072. j6 += class9_1.spritesY[i3];
  8073. }
  8074. if (class9_1.inv[i3] > 0) {
  8075. int k6 = 0;
  8076. int j7 = 0;
  8077. int j9 = class9_1.inv[i3] - 1;
  8078. if (k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32
  8079. && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  8080. int l9 = 0;
  8081. if (itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  8082. l9 = 0xffffff;
  8083. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3],
  8084. l9);
  8085. if (class30_sub2_sub1_sub1_2 != null) {
  8086. if (activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  8087. k6 = super.mouseX - anInt1087;
  8088. j7 = super.mouseY - anInt1088;
  8089. if (k6 < 5 && k6 > -5)
  8090. k6 = 0;
  8091. if (j7 < 5 && j7 > -5)
  8092. j7 = 0;
  8093. if (anInt989 < 10) {
  8094. k6 = 0;
  8095. j7 = 0;
  8096. }
  8097. class30_sub2_sub1_sub1_2.drawSprite1(k5 + k6, j6 + j7);
  8098. if (j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  8099. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  8100. if (i10 > anInt945 * 10)
  8101. i10 = anInt945 * 10;
  8102. if (i10 > class9.scrollPosition)
  8103. i10 = class9.scrollPosition;
  8104. class9.scrollPosition -= i10;
  8105. anInt1088 += i10;
  8106. }
  8107. if (j6 + j7 + 32 > DrawingArea.bottomY
  8108. && class9.scrollPosition < class9.scrollMax - class9.height) {
  8109. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  8110. if (j10 > anInt945 * 10)
  8111. j10 = anInt945 * 10;
  8112. if (j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  8113. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  8114. class9.scrollPosition += j10;
  8115. anInt1088 -= j10;
  8116. }
  8117. } else if (atInventoryInterfaceType != 0 && atInventoryIndex == i3
  8118. && atInventoryInterface == class9_1.id)
  8119. class30_sub2_sub1_sub1_2.drawSprite1(k5, j6);
  8120. else
  8121. class30_sub2_sub1_sub1_2.drawSprite(k5, j6);
  8122. if (class30_sub2_sub1_sub1_2.anInt1444 == 33
  8123. || class9_1.invStackSizes[i3] != 1) {
  8124. int k10 = class9_1.invStackSizes[i3];
  8125. if (k10 >= 1)
  8126. smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8127. if (k10 >= 100000)
  8128. smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8129. if (k10 >= 10000000)
  8130. smallText.method385(0x49E20E, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8131.  
  8132. /*
  8133. * smallText.method385(0,
  8134. * intToKOrMil(k10), j6 + 10 + j7,
  8135. * k5 + 1 + k6);
  8136. * smallText.method385(0xffff00,
  8137. * intToKOrMil(k10), j6 + 9 + j7, k5
  8138. * + k6);
  8139. */
  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),
  8172. k2);
  8173. else
  8174. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.aByte254 & 0xff), j3, class9_1.width,
  8175. k2);
  8176. } else if (class9_1.type == 4) {
  8177. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  8178. String s = class9_1.message;
  8179. boolean flag1 = false;
  8180. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8181. flag1 = true;
  8182. int i4;
  8183. if (interfaceIsSelected(class9_1)) {
  8184. i4 = class9_1.anInt219;
  8185. if (flag1 && class9_1.anInt239 != 0)
  8186. i4 = class9_1.anInt239;
  8187. if (class9_1.aString228.length() > 0)
  8188. s = class9_1.aString228;
  8189. } else {
  8190. i4 = class9_1.textColor;
  8191. if (flag1 && class9_1.anInt216 != 0)
  8192. i4 = class9_1.anInt216;
  8193. }
  8194. if (class9_1.atActionType == 6 && aBoolean1149) {
  8195. s = "Please wait...";
  8196. i4 = class9_1.textColor;
  8197. }
  8198. if (DrawingArea.width == 519) {
  8199. if (i4 == 0xffff00)
  8200. i4 = 255;
  8201. if (i4 == 49152)
  8202. i4 = 0xffffff;
  8203. }
  8204. if ((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  8205. switch (i4) {
  8206. case 16773120:
  8207. i4 = 0xFE981F;
  8208. break;
  8209. case 7040819:
  8210. i4 = 0xAF6A1A;
  8211. break;
  8212. }
  8213. }
  8214. for (int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497) {
  8215. if (s.indexOf("%") != -1) {
  8216. do {
  8217. int k7 = s.indexOf("%1");
  8218. if (k7 == -1)
  8219. break;
  8220. if (class9_1.id < 4000 || class9_1.id > 5000 && class9_1.id != 13921
  8221. && class9_1.id != 13922 && class9_1.id != 12171 && class9_1.id != 12172)
  8222. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0))
  8223. + s.substring(k7 + 2);
  8224. else
  8225. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0))
  8226. + s.substring(k7 + 2);
  8227. } while (true);
  8228. do {
  8229. int l7 = s.indexOf("%2");
  8230. if (l7 == -1)
  8231. break;
  8232. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1))
  8233. + s.substring(l7 + 2);
  8234. } while (true);
  8235. do {
  8236. int i8 = s.indexOf("%3");
  8237. if (i8 == -1)
  8238. break;
  8239. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2))
  8240. + s.substring(i8 + 2);
  8241. } while (true);
  8242. do {
  8243. int j8 = s.indexOf("%4");
  8244. if (j8 == -1)
  8245. break;
  8246. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3))
  8247. + s.substring(j8 + 2);
  8248. } while (true);
  8249. do {
  8250. int k8 = s.indexOf("%5");
  8251. if (k8 == -1)
  8252. break;
  8253. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4))
  8254. + s.substring(k8 + 2);
  8255. } while (true);
  8256. }
  8257. int l8 = s.indexOf("\\n");
  8258. String s1;
  8259. if (l8 != -1) {
  8260. s1 = s.substring(0, l8);
  8261. s = s.substring(l8 + 2);
  8262. } else {
  8263. s1 = s;
  8264. s = "";
  8265. }
  8266. if (class9_1.centerText)
  8267. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadow);
  8268. else
  8269. textDrawingArea.method389(class9_1.textShadow, k2, i4, s1, l6);
  8270. }
  8271. } else if (class9_1.type == 5) {
  8272. Sprite sprite;
  8273. if (interfaceIsSelected(class9_1))
  8274. sprite = class9_1.sprite2;
  8275. else
  8276. sprite = class9_1.sprite1;
  8277. if (spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
  8278. sprite.drawSprite(k2, l2, 0xffffff);
  8279. } else {
  8280. if (sprite != null)
  8281. sprite.drawSprite(k2, l2);
  8282. }
  8283. if (sprite != null)
  8284. sprite.drawSprite(k2, l2);
  8285. } else if (class9_1.type == 6) {
  8286. int k3 = Texture.textureInt1;
  8287. int j4 = Texture.textureInt2;
  8288. Texture.textureInt1 = k2 + class9_1.width / 2;
  8289. Texture.textureInt2 = l2 + class9_1.height / 2;
  8290. int i5 = Texture.anIntArray1470[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8291. int l5 = Texture.anIntArray1471[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8292. boolean flag2 = interfaceIsSelected(class9_1);
  8293. int i7;
  8294. if (flag2)
  8295. i7 = class9_1.anInt258;
  8296. else
  8297. i7 = class9_1.anInt257;
  8298. Model model;
  8299. if (i7 == -1) {
  8300. model = class9_1.method209(-1, -1, flag2);
  8301. } else {
  8302. Animation animation = Animation.anims[i7];
  8303. model = class9_1.method209(animation.anIntArray354[class9_1.anInt246],
  8304. animation.anIntArray353[class9_1.anInt246], flag2);
  8305. }
  8306. if (model != null)
  8307. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  8308. Texture.textureInt1 = k3;
  8309. Texture.textureInt2 = j4;
  8310. } else if (class9_1.type == 7) {
  8311. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  8312. int k4 = 0;
  8313. for (int j5 = 0; j5 < class9_1.height; j5++) {
  8314. for (int i6 = 0; i6 < class9_1.width; i6++) {
  8315. if (class9_1.inv[k4] > 0) {
  8316. ItemDef itemDef = ItemDef.forID(class9_1.inv[k4] - 1);
  8317. String s2 = itemDef.name;
  8318. if (itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  8319. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  8320. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  8321. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  8322. if (class9_1.centerText)
  8323. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9,
  8324. class9_1.textShadow);
  8325. else
  8326. textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  8327. }
  8328. k4++;
  8329. }
  8330. }
  8331. } else if (class9_1.type == 8) {
  8332. drawHoverBox(k2, l2, class9_1.popupString);
  8333. }
  8334. }
  8335. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  8336. }
  8337.  
  8338. private void randomizeBackground(Background background) {
  8339. int j = 256;
  8340. for (int k = 0; k < anIntArray1190.length; k++)
  8341. anIntArray1190[k] = 0;
  8342.  
  8343. for (int l = 0; l < 5000; l++) {
  8344. int i1 = (int) (Math.random() * 128D * (double) j);
  8345. anIntArray1190[i1] = (int) (Math.random() * 256D);
  8346. }
  8347. for (int j1 = 0; j1 < 20; j1++) {
  8348. for (int k1 = 1; k1 < j - 1; k1++) {
  8349. for (int i2 = 1; i2 < 127; i2++) {
  8350. int k2 = i2 + (k1 << 7);
  8351. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128]
  8352. + anIntArray1190[k2 + 128]) / 4;
  8353. }
  8354.  
  8355. }
  8356. int ai[] = anIntArray1190;
  8357. anIntArray1190 = anIntArray1191;
  8358. anIntArray1191 = ai;
  8359. }
  8360. if (background != null) {
  8361. int l1 = 0;
  8362. for (int j2 = 0; j2 < background.anInt1453; j2++) {
  8363. for (int l2 = 0; l2 < background.anInt1452; l2++)
  8364. if (background.aByteArray1450[l1++] != 0) {
  8365. int i3 = l2 + 16 + background.anInt1454;
  8366. int j3 = j2 + 16 + background.anInt1455;
  8367. int k3 = i3 + (j3 << 7);
  8368. anIntArray1190[k3] = 0;
  8369. }
  8370. }
  8371. }
  8372. }
  8373.  
  8374. private void method107(int i, int j, Stream stream, Player player) {
  8375. if ((i & 0x400) != 0) {
  8376. player.anInt1543 = stream.method428();
  8377. player.anInt1545 = stream.method428();
  8378. player.anInt1544 = stream.method428();
  8379. player.anInt1546 = stream.method428();
  8380. player.anInt1547 = stream.method436() + loopCycle;
  8381. player.anInt1548 = stream.method435() + loopCycle;
  8382. player.anInt1549 = stream.method428();
  8383. player.method446();
  8384. }
  8385. if ((i & 0x100) != 0) {
  8386. player.anInt1520 = stream.method434();
  8387. int k = stream.readDWord();
  8388. player.anInt1524 = k >> 16;
  8389. player.anInt1523 = loopCycle + (k & 0xffff);
  8390. player.anInt1521 = 0;
  8391. player.anInt1522 = 0;
  8392. if (player.anInt1523 > loopCycle)
  8393. player.anInt1521 = -1;
  8394. if (player.anInt1520 == 65535)
  8395. player.anInt1520 = -1;
  8396. }
  8397. if ((i & 8) != 0) {
  8398. int l = stream.method434();
  8399. if (l == 65535)
  8400. l = -1;
  8401. int i2 = stream.method427();
  8402. if (l == player.anim && l != -1) {
  8403. int i3 = Animation.anims[l].anInt365;
  8404. if (i3 == 1) {
  8405. player.anInt1527 = 0;
  8406. player.anInt1528 = 0;
  8407. player.anInt1529 = i2;
  8408. player.anInt1530 = 0;
  8409. }
  8410. if (i3 == 2)
  8411. player.anInt1530 = 0;
  8412. } else if (l == -1 || player.anim == -1
  8413. || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359) {
  8414. player.anim = l;
  8415. player.anInt1527 = 0;
  8416. player.anInt1528 = 0;
  8417. player.anInt1529 = i2;
  8418. player.anInt1530 = 0;
  8419. player.anInt1542 = player.smallXYIndex;
  8420. }
  8421. }
  8422. if ((i & 4) != 0) {
  8423. player.textSpoken = stream.readString();
  8424. if (player.textSpoken.charAt(0) == '~') {
  8425. player.textSpoken = player.textSpoken.substring(1);
  8426. pushMessage(player.textSpoken, 2, player.name);
  8427. } else if (player == myPlayer)
  8428. pushMessage(player.textSpoken, 2, player.name);
  8429. player.anInt1513 = 0;
  8430. player.anInt1531 = 0;
  8431. player.textCycle = 150;
  8432. }
  8433. if ((i & 0x80) != 0) {
  8434. // right fucking here
  8435. int i1 = stream.method434();
  8436. int j2 = stream.readUnsignedByte();
  8437. int j3 = stream.method427();
  8438. int k3 = stream.currentOffset;
  8439. if (player.name != null && player.visible) {
  8440. long l3 = TextClass.longForName(player.name);
  8441. boolean flag = false;
  8442. if (j2 <= 1) {
  8443. for (int i4 = 0; i4 < ignoreCount; i4++) {
  8444. if (ignoreListAsLongs[i4] != l3)
  8445. continue;
  8446. flag = true;
  8447. break;
  8448. }
  8449.  
  8450. }
  8451. if (!flag && anInt1251 == 0)
  8452. try {
  8453. aStream_834.currentOffset = 0;
  8454. stream.method442(j3, 0, aStream_834.buffer);
  8455. aStream_834.currentOffset = 0;
  8456. String s = TextInput.method525(j3, aStream_834);
  8457. // s = Censor.doCensor(s);
  8458. player.textSpoken = s;
  8459. player.anInt1513 = i1 >> 8;
  8460. player.privelage = j2;
  8461. player.anInt1531 = i1 & 0xff;
  8462. player.textCycle = 150;
  8463. if (j2 == 2 || j2 == 3)
  8464. pushMessage(s, 1, "@cr2@" + player.name);
  8465. else if (j2 == 1)
  8466. pushMessage(s, 1, "@cr1@" + player.name);
  8467. else
  8468. pushMessage(s, 2, player.name);
  8469. } catch (Exception exception) {
  8470. signlink.reporterror("cde2");
  8471. }
  8472. }
  8473. stream.currentOffset = k3 + j3;
  8474. }
  8475. if ((i & 1) != 0) {
  8476. player.interactingEntity = stream.method434();
  8477. if (player.interactingEntity == 65535)
  8478. player.interactingEntity = -1;
  8479. }
  8480. if ((i & 0x10) != 0) {
  8481. int j1 = stream.method427();
  8482. byte abyte0[] = new byte[j1];
  8483. Stream stream_1 = new Stream(abyte0);
  8484. stream.readBytes(j1, 0, abyte0);
  8485. aStreamArray895s[j] = stream_1;
  8486. player.updatePlayer(stream_1);
  8487. }
  8488. if ((i & 2) != 0) {
  8489. player.anInt1538 = stream.method436();
  8490. player.anInt1539 = stream.method434();
  8491. }
  8492. if ((i & 0x20) != 0) {
  8493. int k1 = stream.readUnsignedByte();
  8494. int k2 = stream.method426();
  8495. player.updateHitData(k2, k1, loopCycle);
  8496. player.loopCycleStatus = loopCycle + 300;
  8497. player.currentHealth = stream.method427();
  8498. player.maxHealth = stream.readUnsignedByte();
  8499. }
  8500. if ((i & 0x200) != 0) {
  8501. int l1 = stream.readUnsignedByte();
  8502. int l2 = stream.method428();
  8503. player.updateHitData(l2, l1, loopCycle);
  8504. player.loopCycleStatus = loopCycle + 300;
  8505. player.currentHealth = stream.readUnsignedByte();
  8506. player.maxHealth = stream.method427();
  8507. }
  8508. }
  8509.  
  8510. private void method108() {
  8511. try {
  8512. int j = myPlayer.x + anInt1278;
  8513. int k = myPlayer.y + anInt1131;
  8514. if (anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500) {
  8515. anInt1014 = j;
  8516. anInt1015 = k;
  8517. }
  8518. if (anInt1014 != j)
  8519. anInt1014 += (j - anInt1014) / 16;
  8520. if (anInt1015 != k)
  8521. anInt1015 += (k - anInt1015) / 16;
  8522. if (super.keyArray[1] == 1)
  8523. anInt1186 += (-24 - anInt1186) / 2;
  8524. else if (super.keyArray[2] == 1)
  8525. anInt1186 += (24 - anInt1186) / 2;
  8526. else
  8527. anInt1186 /= 2;
  8528. if (super.keyArray[3] == 1)
  8529. anInt1187 += (12 - anInt1187) / 2;
  8530. else if (super.keyArray[4] == 1)
  8531. anInt1187 += (-12 - anInt1187) / 2;
  8532. else
  8533. anInt1187 /= 2;
  8534. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  8535. anInt1184 += anInt1187 / 2;
  8536. if (anInt1184 < 128)
  8537. anInt1184 = 128;
  8538. if (anInt1184 > 383)
  8539. anInt1184 = 383;
  8540. int l = anInt1014 >> 7;
  8541. int i1 = anInt1015 >> 7;
  8542. int j1 = method42(plane, anInt1015, anInt1014);
  8543. int k1 = 0;
  8544. if (l > 3 && i1 > 3 && l < 100 && i1 < 100) {
  8545. for (int l1 = l - 4; l1 <= l + 4; l1++) {
  8546. for (int k2 = i1 - 4; k2 <= i1 + 4; k2++) {
  8547. int l2 = plane;
  8548. if (l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  8549. l2++;
  8550. int i3 = j1 - intGroundArray[l2][l1][k2];
  8551. if (i3 > k1)
  8552. k1 = i3;
  8553. }
  8554.  
  8555. }
  8556.  
  8557. }
  8558. anInt1005++;
  8559. if (anInt1005 > 1512) {
  8560. anInt1005 = 0;
  8561. stream.createFrame(77);
  8562. stream.writeWordBigEndian(0);
  8563. int i2 = stream.currentOffset;
  8564. stream.writeWordBigEndian((int) (Math.random() * 256D));
  8565. stream.writeWordBigEndian(101);
  8566. stream.writeWordBigEndian(233);
  8567. stream.writeWord(45092);
  8568. if ((int) (Math.random() * 2D) == 0)
  8569. stream.writeWord(35784);
  8570. stream.writeWordBigEndian((int) (Math.random() * 256D));
  8571. stream.writeWordBigEndian(64);
  8572. stream.writeWordBigEndian(38);
  8573. stream.writeWord((int) (Math.random() * 65536D));
  8574. stream.writeWord((int) (Math.random() * 65536D));
  8575. stream.writeBytes(stream.currentOffset - i2);
  8576. }
  8577. int j2 = k1 * 192;
  8578. if (j2 > 0x17f00)
  8579. j2 = 0x17f00;
  8580. if (j2 < 32768)
  8581. j2 = 32768;
  8582. if (j2 > anInt984) {
  8583. anInt984 += (j2 - anInt984) / 24;
  8584. return;
  8585. }
  8586. if (j2 < anInt984) {
  8587. anInt984 += (j2 - anInt984) / 80;
  8588. }
  8589. } catch (Exception _ex) {
  8590. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + ","
  8591. + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  8592. throw new RuntimeException("eek");
  8593. }
  8594. }
  8595.  
  8596. public void processDrawing() {
  8597. if (rsAlreadyLoaded || loadingError || genericLoadingError) {
  8598. showErrorScreen();
  8599. return;
  8600. }
  8601. anInt1061++;
  8602. if (!loggedIn)
  8603. drawLoginScreen(false);
  8604. else
  8605. drawGameScreen();
  8606. anInt1213 = 0;
  8607. }
  8608.  
  8609. private boolean isFriendOrSelf(String s) {
  8610. if (s == null)
  8611. return false;
  8612. for (int i = 0; i < friendsCount; i++)
  8613. if (s.equalsIgnoreCase(friendsList[i]))
  8614. return true;
  8615. return s.equalsIgnoreCase(myPlayer.name);
  8616. }
  8617.  
  8618. private static String combatDiffColor(int i, int j) {
  8619. int k = i - j;
  8620. if (k < -9)
  8621. return "@red@";
  8622. if (k < -6)
  8623. return "@or3@";
  8624. if (k < -3)
  8625. return "@or2@";
  8626. if (k < 0)
  8627. return "@or1@";
  8628. if (k > 9)
  8629. return "@gre@";
  8630. if (k > 6)
  8631. return "@gr3@";
  8632. if (k > 3)
  8633. return "@gr2@";
  8634. if (k > 0)
  8635. return "@gr1@";
  8636. else
  8637. return "@yel@";
  8638. }
  8639.  
  8640. private void setWaveVolume(int i) {
  8641. signlink.wavevol = i;
  8642. }
  8643.  
  8644. private void draw3dScreen() {
  8645. drawSplitPrivateChat();
  8646. if (crossType == 1) {
  8647. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  8648. anInt1142++;
  8649. if (anInt1142 > 67) {
  8650. anInt1142 = 0;
  8651. stream.createFrame(78);
  8652. }
  8653. }
  8654. if (crossType == 2)
  8655. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  8656. if (anInt1018 != -1) {
  8657. method119(anInt945, anInt1018);
  8658. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  8659. }
  8660. if (openInterfaceID != -1) {
  8661. method119(anInt945, openInterfaceID);
  8662. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  8663. }
  8664. method70();
  8665. if (!menuOpen) {
  8666. processRightClick();
  8667. drawTooltip();
  8668. } else if (menuScreenArea == 0)
  8669. drawMenu();
  8670. if (anInt1055 == 1)
  8671. multiOverlay.drawSprite(472, 296);
  8672. if (fpsOn) {
  8673. char c = '\u01FB';
  8674. int k = 20;
  8675. int i1 = 0xffff00;
  8676. if (super.fps < 15)
  8677. i1 = 0xff0000;
  8678. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  8679. k += 15;
  8680. Runtime runtime = Runtime.getRuntime();
  8681. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  8682. i1 = 0xffff00;
  8683. if (j1 > 0x2000000 && lowMem)
  8684. i1 = 0xff0000;
  8685. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  8686. k += 15;
  8687. }
  8688. int i1 = 0xffff00;
  8689. int x = baseX + (myPlayer.x - 6 >> 7);
  8690. int y = baseY + (myPlayer.y - 6 >> 7);
  8691. if (clientData) {
  8692. char c = '\u01FB';
  8693. int k = 20;
  8694. if (super.fps < 15)
  8695. i1 = 0xff0000;
  8696. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285, 5);
  8697. Runtime runtime = Runtime.getRuntime();
  8698. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  8699. i1 = 0xffff00;
  8700. if (j1 > 0x2000000 && lowMem)
  8701. i1 = 0xff0000;
  8702. k += 15;
  8703. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299, 5);
  8704. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314,
  8705. 5);
  8706. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
  8707. }
  8708. if (anInt1104 != 0) {
  8709. int j = anInt1104 / 50;
  8710. int l = j / 60;
  8711. j %= 60;
  8712. if (j < 10)
  8713. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  8714. else
  8715. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  8716. anInt849++;
  8717. if (anInt849 > 75) {
  8718. anInt849 = 0;
  8719. stream.createFrame(148);
  8720. }
  8721. }
  8722. }
  8723.  
  8724. private void addIgnore(long l) {
  8725. try {
  8726. if (l == 0L)
  8727. return;
  8728. if (ignoreCount >= 100) {
  8729. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  8730. return;
  8731. }
  8732. String s = TextClass.fixName(TextClass.nameForLong(l));
  8733. for (int j = 0; j < ignoreCount; j++)
  8734. if (ignoreListAsLongs[j] == l) {
  8735. pushMessage(s + " is already on your ignore list", 0, "");
  8736. return;
  8737. }
  8738. for (int k = 0; k < friendsCount; k++)
  8739. if (friendsListAsLongs[k] == l) {
  8740. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  8741. return;
  8742. }
  8743.  
  8744. ignoreListAsLongs[ignoreCount++] = l;
  8745. needDrawTabArea = true;
  8746. stream.createFrame(133);
  8747. stream.writeQWord(l);
  8748. return;
  8749. } catch (RuntimeException runtimeexception) {
  8750. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  8751. }
  8752. throw new RuntimeException();
  8753. }
  8754.  
  8755. private void method114() {
  8756. for (int i = -1; i < playerCount; i++) {
  8757. int j;
  8758. if (i == -1)
  8759. j = myPlayerIndex;
  8760. else
  8761. j = playerIndices[i];
  8762. Player player = playerArray[j];
  8763. if (player != null)
  8764. method96(player);
  8765. }
  8766.  
  8767. }
  8768.  
  8769. private void method115() {
  8770. if (loadingStage == 2) {
  8771. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  8772. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  8773. .reverseGetNext()) {
  8774. if (class30_sub1.anInt1294 > 0)
  8775. class30_sub1.anInt1294--;
  8776. if (class30_sub1.anInt1294 == 0) {
  8777. if (class30_sub1.anInt1299 < 0
  8778. || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301)) {
  8779. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300,
  8780. class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296,
  8781. class30_sub1.anInt1299);
  8782. class30_sub1.unlink();
  8783. }
  8784. } else {
  8785. if (class30_sub1.anInt1302 > 0)
  8786. class30_sub1.anInt1302--;
  8787. if (class30_sub1.anInt1302 == 0 && class30_sub1.anInt1297 >= 1 && class30_sub1.anInt1298 >= 1
  8788. && class30_sub1.anInt1297 <= 102 && class30_sub1.anInt1298 <= 102
  8789. && (class30_sub1.anInt1291 < 0
  8790. || ObjectManager.method178(class30_sub1.anInt1291, class30_sub1.anInt1293))) {
  8791. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292,
  8792. class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296,
  8793. class30_sub1.anInt1291);
  8794. class30_sub1.anInt1302 = -1;
  8795. if (class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  8796. class30_sub1.unlink();
  8797. else if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  8798. && class30_sub1.anInt1292 == class30_sub1.anInt1300
  8799. && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  8800. class30_sub1.unlink();
  8801. }
  8802. }
  8803. }
  8804.  
  8805. }
  8806. }
  8807.  
  8808. // stops the click from going over sprite
  8809. private void determineMenuSize() {
  8810. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  8811. for (int j = 0; j < menuActionRow; j++) {
  8812. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  8813. if (k > i)
  8814. i = k;
  8815. }
  8816.  
  8817. i += 8;
  8818. int l = 15 * menuActionRow + 21;
  8819. if (super.saveClickX > 4 && super.saveClickY > 4 && super.saveClickX < 516 && super.saveClickY < 338) {
  8820. int i1 = super.saveClickX - 4 - i / 2;
  8821. if (i1 + i > 512)
  8822. i1 = 512 - i;
  8823. if (i1 < 0)
  8824. i1 = 0;
  8825. int l1 = super.saveClickY - 4;
  8826. if (l1 + l > 334)
  8827. l1 = 334 - l;
  8828. if (l1 < 0)
  8829. l1 = 0;
  8830. menuOpen = true;
  8831. menuScreenArea = 0;
  8832. menuOffsetX = i1;
  8833. menuOffsetY = l1;
  8834. menuWidth = i;
  8835. menuHeight = 15 * menuActionRow + 22;
  8836. }
  8837. if (super.saveClickX > 519 && super.saveClickY > 168 && super.saveClickX < 765 && super.saveClickY < 503) {
  8838. int j1 = super.saveClickX - 519 - i / 2;
  8839. if (j1 < 0)
  8840. j1 = 0;
  8841. else if (j1 + i > 245)
  8842. j1 = 245 - i;
  8843. int i2 = super.saveClickY - 168;
  8844. if (i2 < 0)
  8845. i2 = 0;
  8846. else if (i2 + l > 333)
  8847. i2 = 333 - l;
  8848. menuOpen = true;
  8849. menuScreenArea = 1;
  8850. menuOffsetX = j1;
  8851. menuOffsetY = i2;
  8852. menuWidth = i;
  8853. menuHeight = 15 * menuActionRow + 22;
  8854. }
  8855. if (super.saveClickX > 0 && super.saveClickY > 338 && super.saveClickX < 516 && super.saveClickY < 503) {
  8856. int k1 = super.saveClickX - 0 - i / 2;
  8857. if (k1 < 0)
  8858. k1 = 0;
  8859. else if (k1 + i > 516)
  8860. k1 = 516 - i;
  8861. int j2 = super.saveClickY - 338;
  8862. if (j2 < 0)
  8863. j2 = 0;
  8864. else if (j2 + l > 165)
  8865. j2 = 165 - l;
  8866. menuOpen = true;
  8867. menuScreenArea = 2;
  8868. menuOffsetX = k1;
  8869. menuOffsetY = j2;
  8870. menuWidth = i;
  8871. menuHeight = 15 * menuActionRow + 22;
  8872. }
  8873. }
  8874.  
  8875. private void method117(Stream stream) {
  8876. stream.initBitAccess();
  8877. int j = stream.readBits(1);
  8878. if (j == 0)
  8879. return;
  8880. int k = stream.readBits(2);
  8881. if (k == 0) {
  8882. anIntArray894[anInt893++] = myPlayerIndex;
  8883. return;
  8884. }
  8885. if (k == 1) {
  8886. int l = stream.readBits(3);
  8887. myPlayer.moveInDir(false, l);
  8888. int k1 = stream.readBits(1);
  8889. if (k1 == 1)
  8890. anIntArray894[anInt893++] = myPlayerIndex;
  8891. return;
  8892. }
  8893. if (k == 2) {
  8894. int i1 = stream.readBits(3);
  8895. myPlayer.moveInDir(true, i1);
  8896. int l1 = stream.readBits(3);
  8897. myPlayer.moveInDir(true, l1);
  8898. int j2 = stream.readBits(1);
  8899. if (j2 == 1)
  8900. anIntArray894[anInt893++] = myPlayerIndex;
  8901. return;
  8902. }
  8903. if (k == 3) {
  8904. plane = stream.readBits(2);
  8905. int j1 = stream.readBits(1);
  8906. int i2 = stream.readBits(1);
  8907. if (i2 == 1)
  8908. anIntArray894[anInt893++] = myPlayerIndex;
  8909. int k2 = stream.readBits(7);
  8910. int l2 = stream.readBits(7);
  8911. myPlayer.setPos(l2, k2, j1 == 1);
  8912. }
  8913. }
  8914.  
  8915. private void nullLoader() {
  8916. aBoolean831 = false;
  8917. while (drawingFlames) {
  8918. aBoolean831 = false;
  8919. try {
  8920. Thread.sleep(50L);
  8921. } catch (Exception _ex) {
  8922. }
  8923. }
  8924. aBackground_966 = null;
  8925. aBackground_967 = null;
  8926. aBackgroundArray1152s = null;
  8927. anIntArray850 = null;
  8928. anIntArray851 = null;
  8929. anIntArray852 = null;
  8930. anIntArray853 = null;
  8931. anIntArray1190 = null;
  8932. anIntArray1191 = null;
  8933. anIntArray828 = null;
  8934. anIntArray829 = null;
  8935. aClass30_Sub2_Sub1_Sub1_1201 = null;
  8936. aClass30_Sub2_Sub1_Sub1_1202 = null;
  8937. }
  8938.  
  8939. private boolean method119(int i, int j) {
  8940. boolean flag1 = false;
  8941. RSInterface class9 = RSInterface.interfaceCache[j];
  8942. for (int k = 0; k < class9.children.length; k++) {
  8943. if (class9.children[k] == -1)
  8944. break;
  8945. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  8946. if (class9_1.type == 1)
  8947. flag1 |= method119(i, class9_1.id);
  8948. if (class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1)) {
  8949. boolean flag2 = interfaceIsSelected(class9_1);
  8950. int l;
  8951. if (flag2)
  8952. l = class9_1.anInt258;
  8953. else
  8954. l = class9_1.anInt257;
  8955. if (l != -1) {
  8956. Animation animation = Animation.anims[l];
  8957. for (class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);) {
  8958. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  8959. class9_1.anInt246++;
  8960. if (class9_1.anInt246 >= animation.anInt352) {
  8961. class9_1.anInt246 -= animation.anInt356;
  8962. if (class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  8963. class9_1.anInt246 = 0;
  8964. }
  8965. flag1 = true;
  8966. }
  8967.  
  8968. }
  8969. }
  8970. }
  8971.  
  8972. return flag1;
  8973. }
  8974.  
  8975. private int method120() {
  8976. int j = 3;
  8977. if (yCameraCurve < 310) {
  8978. int k = xCameraPos >> 7;
  8979. int l = yCameraPos >> 7;
  8980. int i1 = myPlayer.x >> 7;
  8981. int j1 = myPlayer.y >> 7;
  8982. if ((byteGroundArray[plane][k][l] & 4) != 0)
  8983. j = plane;
  8984. int k1;
  8985. if (i1 > k)
  8986. k1 = i1 - k;
  8987. else
  8988. k1 = k - i1;
  8989. int l1;
  8990. if (j1 > l)
  8991. l1 = j1 - l;
  8992. else
  8993. l1 = l - j1;
  8994. if (k1 > l1) {
  8995. int i2 = (l1 * 0x10000) / k1;
  8996. int k2 = 32768;
  8997. while (k != i1) {
  8998. if (k < i1)
  8999. k++;
  9000. else if (k > i1)
  9001. k--;
  9002. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9003. j = plane;
  9004. k2 += i2;
  9005. if (k2 >= 0x10000) {
  9006. k2 -= 0x10000;
  9007. if (l < j1)
  9008. l++;
  9009. else if (l > j1)
  9010. l--;
  9011. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9012. j = plane;
  9013. }
  9014. }
  9015. } else {
  9016. int j2 = (k1 * 0x10000) / l1;
  9017. int l2 = 32768;
  9018. while (l != j1) {
  9019. if (l < j1)
  9020. l++;
  9021. else if (l > j1)
  9022. l--;
  9023. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9024. j = plane;
  9025. l2 += j2;
  9026. if (l2 >= 0x10000) {
  9027. l2 -= 0x10000;
  9028. if (k < i1)
  9029. k++;
  9030. else if (k > i1)
  9031. k--;
  9032. if ((byteGroundArray[plane][k][l] & 4) != 0)
  9033. j = plane;
  9034. }
  9035. }
  9036. }
  9037. }
  9038. if ((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  9039. j = plane;
  9040. return j;
  9041. }
  9042.  
  9043. private int method121() {
  9044. int j = method42(plane, yCameraPos, xCameraPos);
  9045. if (j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  9046. return plane;
  9047. else
  9048. return 3;
  9049. }
  9050.  
  9051. private void delIgnore(long l) {
  9052. try {
  9053. if (l == 0L)
  9054. return;
  9055. for (int j = 0; j < ignoreCount; j++)
  9056. if (ignoreListAsLongs[j] == l) {
  9057. ignoreCount--;
  9058. needDrawTabArea = true;
  9059. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  9060.  
  9061. stream.createFrame(74);
  9062. stream.writeQWord(l);
  9063. return;
  9064. }
  9065.  
  9066. return;
  9067. } catch (RuntimeException runtimeexception) {
  9068. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9069. }
  9070. throw new RuntimeException();
  9071. }
  9072.  
  9073. private void chatJoin(long l) {
  9074. try {
  9075. if (l == 0L)
  9076. return;
  9077. stream.createFrame(60);
  9078. stream.writeQWord(l);
  9079. return;
  9080. } catch (RuntimeException runtimeexception) {
  9081. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9082. }
  9083. throw new RuntimeException();
  9084.  
  9085. }
  9086.  
  9087. public String getParameter(String s) {
  9088. if (signlink.mainapp != null)
  9089. return signlink.mainapp.getParameter(s);
  9090. else
  9091. return super.getParameter(s);
  9092. }
  9093.  
  9094. private void adjustVolume(boolean flag, int i) {
  9095. signlink.midivol = i;
  9096. if (flag)
  9097. signlink.midi = "voladjust";
  9098. }
  9099.  
  9100. private int extractInterfaceValues(RSInterface class9, int j) {
  9101. if (class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  9102. return -2;
  9103. try {
  9104. int ai[] = class9.valueIndexArray[j];
  9105. int k = 0;
  9106. int l = 0;
  9107. int i1 = 0;
  9108. do {
  9109. int j1 = ai[l++];
  9110. int k1 = 0;
  9111. byte byte0 = 0;
  9112. if (j1 == 0)
  9113. return k;
  9114. if (j1 == 1)
  9115. k1 = currentStats[ai[l++]];
  9116. if (j1 == 2)
  9117. k1 = maxStats[ai[l++]];
  9118. if (j1 == 3)
  9119. k1 = currentExp[ai[l++]];
  9120. if (j1 == 4) {
  9121. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  9122. int k2 = ai[l++];
  9123. if (k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers)) {
  9124. for (int j3 = 0; j3 < class9_1.inv.length; j3++)
  9125. if (class9_1.inv[j3] == k2 + 1)
  9126. k1 += class9_1.invStackSizes[j3];
  9127.  
  9128. }
  9129. }
  9130. if (j1 == 5)
  9131. k1 = variousSettings[ai[l++]];
  9132. if (j1 == 6)
  9133. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  9134. if (j1 == 7)
  9135. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  9136. if (j1 == 8)
  9137. k1 = myPlayer.combatLevel;
  9138. if (j1 == 9) {
  9139. for (int l1 = 0; l1 < Skills.skillsCount; l1++)
  9140. if (Skills.skillEnabled[l1])
  9141. k1 += maxStats[l1];
  9142.  
  9143. }
  9144. if (j1 == 10) {
  9145. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  9146. int l2 = ai[l++] + 1;
  9147. if (l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers)) {
  9148. for (int k3 = 0; k3 < class9_2.inv.length; k3++) {
  9149. if (class9_2.inv[k3] != l2)
  9150. continue;
  9151. k1 = 0x3b9ac9ff;
  9152. break;
  9153. }
  9154.  
  9155. }
  9156. }
  9157. if (j1 == 11)
  9158. k1 = energy;
  9159. if (j1 == 12)
  9160. k1 = weight;
  9161. if (j1 == 13) {
  9162. int i2 = variousSettings[ai[l++]];
  9163. int i3 = ai[l++];
  9164. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  9165. }
  9166. if (j1 == 14) {
  9167. int j2 = ai[l++];
  9168. VarBit varBit = VarBit.cache[j2];
  9169. int l3 = varBit.anInt648;
  9170. int i4 = varBit.anInt649;
  9171. int j4 = varBit.anInt650;
  9172. int k4 = anIntArray1232[j4 - i4];
  9173. k1 = variousSettings[l3] >> i4 & k4;
  9174. }
  9175. if (j1 == 15)
  9176. byte0 = 1;
  9177. if (j1 == 16)
  9178. byte0 = 2;
  9179. if (j1 == 17)
  9180. byte0 = 3;
  9181. if (j1 == 18)
  9182. k1 = (myPlayer.x >> 7) + baseX;
  9183. if (j1 == 19)
  9184. k1 = (myPlayer.y >> 7) + baseY;
  9185. if (j1 == 20)
  9186. k1 = ai[l++];
  9187. if (byte0 == 0) {
  9188. if (i1 == 0)
  9189. k += k1;
  9190. if (i1 == 1)
  9191. k -= k1;
  9192. if (i1 == 2 && k1 != 0)
  9193. k /= k1;
  9194. if (i1 == 3)
  9195. k *= k1;
  9196. i1 = 0;
  9197. } else {
  9198. i1 = byte0;
  9199. }
  9200. } while (true);
  9201. } catch (Exception _ex) {
  9202. return -1;
  9203. }
  9204. }
  9205.  
  9206. private void drawTooltip() {
  9207. if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  9208. return;
  9209. String s;
  9210. if (itemSelected == 1 && menuActionRow < 2)
  9211. s = "Use " + selectedItemName + " with...";
  9212. else if (spellSelected == 1 && menuActionRow < 2)
  9213. s = spellTooltip + "...";
  9214. else
  9215. s = menuActionName[menuActionRow - 1];
  9216. if (menuActionRow > 2)
  9217. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  9218. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  9219. }
  9220.  
  9221. private void drawMinimap() {
  9222. aGraphicsBuffer_1164.setCanvas();
  9223. if (anInt1021 == 2) {
  9224. byte abyte0[] = mapBack.aByteArray1450;
  9225. int ai[] = DrawingArea.pixels;
  9226. int k2 = abyte0.length;
  9227. for (int i5 = 0; i5 < k2; i5++)
  9228. if (abyte0[i5] == 0)
  9229. ai[i5] = 0;
  9230. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 0, 0, 33, 25);
  9231. aGraphicsBuffer_1165.setCanvas();
  9232. return;
  9233. }
  9234. int i = minimapInt1 + minimapInt2 & 0x7ff;
  9235. int j = 48 + myPlayer.x / 32;
  9236. int l2 = 464 - myPlayer.y / 32;
  9237. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, 5, 25,
  9238. 146, j);
  9239. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 0, 0, 33, 25);
  9240. for (int j5 = 0; j5 < anInt1071; j5++) {
  9241. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  9242. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  9243. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  9244. }
  9245. for (int k5 = 0; k5 < 104; k5++) {
  9246. for (int l5 = 0; l5 < 104; l5++) {
  9247. NodeList class19 = groundArray[plane][k5][l5];
  9248. if (class19 != null) {
  9249. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  9250. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  9251. markMinimap(mapDotItem, l, j3);
  9252. }
  9253. }
  9254. }
  9255. for (int i6 = 0; i6 < npcCount; i6++) {
  9256. NPC npc = npcArray[npcIndices[i6]];
  9257. if (npc != null && npc.isVisible()) {
  9258. EntityDef entityDef = npc.desc;
  9259. if (entityDef.childrenIDs != null)
  9260. entityDef = entityDef.method161();
  9261. if (entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  9262. int i1 = npc.x / 32 - myPlayer.x / 32;
  9263. int k3 = npc.y / 32 - myPlayer.y / 32;
  9264. markMinimap(mapDotNPC, i1, k3);
  9265. }
  9266. }
  9267. }
  9268. for (int j6 = 0; j6 < playerCount; j6++) {
  9269. Player player = playerArray[playerIndices[j6]];
  9270. if (player != null && player.isVisible()) {
  9271. int j1 = player.x / 32 - myPlayer.x / 32;
  9272. int l3 = player.y / 32 - myPlayer.y / 32;
  9273. boolean flag1 = false;
  9274. boolean flag3 = false;
  9275. for (int j3 = 0; j3 < clanList.length; j3++) {
  9276. if (clanList[j3] == null)
  9277. continue;
  9278. if (!clanList[j3].equalsIgnoreCase(player.name))
  9279. continue;
  9280. flag3 = true;
  9281. break;
  9282. }
  9283. long l6 = TextClass.longForName(player.name);
  9284. for (int k6 = 0; k6 < friendsCount; k6++) {
  9285. if (l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  9286. continue;
  9287. flag1 = true;
  9288. break;
  9289. }
  9290. boolean flag2 = false;
  9291. if (myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  9292. flag2 = true;
  9293. if (flag1)
  9294. markMinimap(mapDotFriend, j1, l3);
  9295. else if (flag3)
  9296. markMinimap(mapDotClan, j1, l3);
  9297. else if (flag2)
  9298. markMinimap(mapDotTeam, j1, l3);
  9299. else
  9300. markMinimap(mapDotPlayer, j1, l3);
  9301. }
  9302. }
  9303. if (anInt855 != 0 && loopCycle % 20 < 10) {
  9304. if (anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  9305. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  9306. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  9307. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  9308. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  9309. method81(mapMarker, i4, k1);
  9310. }
  9311. }
  9312. if (anInt855 == 2) {
  9313. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  9314. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  9315. method81(mapMarker, j4, l1);
  9316. }
  9317. if (anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length) {
  9318. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  9319. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  9320. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  9321. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  9322. method81(mapMarker, k4, i2);
  9323. }
  9324. }
  9325. }
  9326. if (destX != 0) {
  9327. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  9328. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  9329. markMinimap(mapFlag, j2, l4);
  9330. }
  9331. DrawingArea.drawPixels(3, 78, 97, 0xffffff, 3);
  9332. mapBack.drawBackground(0, 0);
  9333. loadOrbs();
  9334. aGraphicsBuffer_1165.setCanvas();
  9335. }
  9336.  
  9337. private void npcScreenPos(Entity entity, int i) {
  9338. calcEntityScreenPos(entity.x, i, entity.y);
  9339. }
  9340.  
  9341. private void calcEntityScreenPos(int i, int j, int l) {
  9342. WorldController.anInt543 = DrawingArea.width;
  9343. if (i < 128 || l < 128 || i > 13056 || l > 13056) {
  9344. spriteDrawX = -1;
  9345. spriteDrawY = -1;
  9346. return;
  9347. }
  9348. int i1 = method42(this.plane, l, i) - j;
  9349. i -= this.xCameraPos;
  9350. i1 -= this.zCameraPos;
  9351. l -= this.yCameraPos;
  9352. int j1 = Model.modelIntArray1[this.yCameraCurve];
  9353. int k1 = Model.modelIntArray2[this.yCameraCurve];
  9354. int l1 = Model.modelIntArray1[this.xCameraCurve];
  9355. int i2 = Model.modelIntArray2[this.xCameraCurve];
  9356. int j2 = l * l1 + i * i2 >> 16;
  9357. l = l * i2 - i * l1 >> 16;
  9358. i = j2;
  9359. j2 = i1 * k1 - l * j1 >> 16;
  9360. l = i1 * j1 + l * k1 >> 16;
  9361. i1 = j2;
  9362. if (l >= 50) {
  9363. this.spriteDrawX = (Texture.textureInt1 + i * WorldController.anInt543 / l);
  9364. this.spriteDrawY = (Texture.textureInt2 + i1 * WorldController.anInt543 / l);
  9365. } else {
  9366. spriteDrawX = -1;
  9367. spriteDrawY = -1;
  9368. }
  9369. WorldController.anInt543 = 512;
  9370. }
  9371.  
  9372. private void buildSplitPrivateChatMenu() {
  9373. if (splitPrivateChat == 0)
  9374. return;
  9375. int i = 0;
  9376. if (anInt1104 != 0)
  9377. i = 1;
  9378. for (int j = 0; j < 100; j++)
  9379. if (chatMessages[j] != null) {
  9380. int k = chatTypes[j];
  9381. String s = chatNames[j];
  9382. boolean flag1 = false;
  9383. if (s != null && s.startsWith("@cr1@")) {
  9384. s = s.substring(5);
  9385. boolean flag2 = true;
  9386. }
  9387. if (s != null && s.startsWith("@cr2@")) {
  9388. s = s.substring(5);
  9389. byte byte0 = 2;
  9390. }
  9391. if ((k == 3 || k == 7)
  9392. && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  9393. int l = 329 - i * 13;
  9394. if (super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3) {
  9395. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  9396. if (i1 > 450)
  9397. i1 = 450;
  9398. if (super.mouseX < 4 + i1) {
  9399. if (myPrivilege >= 1) {
  9400. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  9401. menuActionID[menuActionRow] = 2606;
  9402. menuActionRow++;
  9403. }
  9404. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  9405. menuActionID[menuActionRow] = 2042;
  9406. menuActionRow++;
  9407. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  9408. menuActionID[menuActionRow] = 2337;
  9409. menuActionRow++;
  9410. }
  9411. }
  9412. if (++i >= 5)
  9413. return;
  9414. }
  9415. if ((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  9416. return;
  9417. }
  9418.  
  9419. }
  9420.  
  9421. private void method130(int j, int k, int l, int i1, int j1, int k1, int l1, int i2, int j2) {
  9422. Class30_Sub1 class30_sub1 = null;
  9423. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  9424. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  9425. .reverseGetNext()) {
  9426. if (class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1
  9427. || class30_sub1_1.anInt1296 != i1)
  9428. continue;
  9429. class30_sub1 = class30_sub1_1;
  9430. break;
  9431. }
  9432.  
  9433. if (class30_sub1 == null) {
  9434. class30_sub1 = new Class30_Sub1();
  9435. class30_sub1.anInt1295 = l1;
  9436. class30_sub1.anInt1296 = i1;
  9437. class30_sub1.anInt1297 = i2;
  9438. class30_sub1.anInt1298 = j1;
  9439. method89(class30_sub1);
  9440. aClass19_1179.insertHead(class30_sub1);
  9441. }
  9442. class30_sub1.anInt1291 = k;
  9443. class30_sub1.anInt1293 = k1;
  9444. class30_sub1.anInt1292 = l;
  9445. class30_sub1.anInt1302 = j2;
  9446. class30_sub1.anInt1294 = j;
  9447. }
  9448.  
  9449. private boolean interfaceIsSelected(RSInterface class9) {
  9450. if (class9.anIntArray245 == null)
  9451. return false;
  9452. for (int i = 0; i < class9.anIntArray245.length; i++) {
  9453. int j = extractInterfaceValues(class9, i);
  9454. int k = class9.anIntArray212[i];
  9455. if (class9.anIntArray245[i] == 2) {
  9456. if (j >= k)
  9457. return false;
  9458. } else if (class9.anIntArray245[i] == 3) {
  9459. if (j <= k)
  9460. return false;
  9461. } else if (class9.anIntArray245[i] == 4) {
  9462. if (j == k)
  9463. return false;
  9464. } else if (j != k)
  9465. return false;
  9466. }
  9467.  
  9468. return true;
  9469. }
  9470.  
  9471. private DataInputStream openJagGrabInputStream(String s) throws IOException {
  9472. // if(!aBoolean872)
  9473. // if(signlink.mainapp != null)
  9474. // return signlink.openurl(s);
  9475. // else
  9476. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  9477. if (aSocket832 != null) {
  9478. try {
  9479. aSocket832.close();
  9480. } catch (Exception _ex) {
  9481. }
  9482. aSocket832 = null;
  9483. }
  9484. aSocket832 = openSocket(43595);
  9485. aSocket832.setSoTimeout(10000);
  9486. java.io.InputStream inputstream = aSocket832.getInputStream();
  9487. OutputStream outputstream = aSocket832.getOutputStream();
  9488. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  9489. return new DataInputStream(inputstream);
  9490. }
  9491.  
  9492. private void doFlamesDrawing() {
  9493. char c = '\u0100';
  9494. if (anInt1040 > 0) {
  9495. for (int i = 0; i < 256; i++)
  9496. if (anInt1040 > 768)
  9497. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  9498. else if (anInt1040 > 256)
  9499. anIntArray850[i] = anIntArray852[i];
  9500. else
  9501. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  9502.  
  9503. } else if (anInt1041 > 0) {
  9504. for (int j = 0; j < 256; j++)
  9505. if (anInt1041 > 768)
  9506. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  9507. else if (anInt1041 > 256)
  9508. anIntArray850[j] = anIntArray853[j];
  9509. else
  9510. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  9511.  
  9512. } else {
  9513. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  9514.  
  9515. }
  9516. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, aGraphicsBuffer_1110.canvasRaster, 0, 33920);
  9517.  
  9518. int i1 = 0;
  9519. int j1 = 1152;
  9520. for (int k1 = 1; k1 < c - 1; k1++) {
  9521. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  9522. int j2 = 22 + l1;
  9523. if (j2 < 0)
  9524. j2 = 0;
  9525. i1 += j2;
  9526. for (int l2 = j2; l2 < 128; l2++) {
  9527. int j3 = anIntArray828[i1++];
  9528. if (j3 != 0) {
  9529. int l3 = j3;
  9530. int j4 = 256 - j3;
  9531. j3 = anIntArray850[j3];
  9532. int l4 = aGraphicsBuffer_1110.canvasRaster[j1];
  9533. aGraphicsBuffer_1110.canvasRaster[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00)
  9534. + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  9535. } else {
  9536. j1++;
  9537. }
  9538. }
  9539.  
  9540. j1 += j2;
  9541. }
  9542.  
  9543. aGraphicsBuffer_1110.drawGraphics(0, super.graphics, 0);
  9544. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, aGraphicsBuffer_1111.canvasRaster, 0, 33920);
  9545.  
  9546. i1 = 0;
  9547. j1 = 1176;
  9548. for (int k2 = 1; k2 < c - 1; k2++) {
  9549. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  9550. int k3 = 103 - i3;
  9551. j1 += i3;
  9552. for (int i4 = 0; i4 < k3; i4++) {
  9553. int k4 = anIntArray828[i1++];
  9554. if (k4 != 0) {
  9555. int i5 = k4;
  9556. int j5 = 256 - k4;
  9557. k4 = anIntArray850[k4];
  9558. int k5 = aGraphicsBuffer_1111.canvasRaster[j1];
  9559. aGraphicsBuffer_1111.canvasRaster[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00)
  9560. + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  9561. } else {
  9562. j1++;
  9563. }
  9564. }
  9565.  
  9566. i1 += 128 - k3;
  9567. j1 += 128 - k3 - i3;
  9568. }
  9569.  
  9570. aGraphicsBuffer_1111.drawGraphics(0, super.graphics, 637);
  9571. }
  9572.  
  9573. private void method134(Stream stream) {
  9574. int j = stream.readBits(8);
  9575. if (j < playerCount) {
  9576. for (int k = j; k < playerCount; k++)
  9577. anIntArray840[anInt839++] = playerIndices[k];
  9578.  
  9579. }
  9580. if (j > playerCount) {
  9581. signlink.reporterror(myUsername + " Too many players");
  9582. throw new RuntimeException("eek");
  9583. }
  9584. playerCount = 0;
  9585. for (int l = 0; l < j; l++) {
  9586. int i1 = playerIndices[l];
  9587. Player player = playerArray[i1];
  9588. int j1 = stream.readBits(1);
  9589. if (j1 == 0) {
  9590. playerIndices[playerCount++] = i1;
  9591. player.anInt1537 = loopCycle;
  9592. } else {
  9593. int k1 = stream.readBits(2);
  9594. if (k1 == 0) {
  9595. playerIndices[playerCount++] = i1;
  9596. player.anInt1537 = loopCycle;
  9597. anIntArray894[anInt893++] = i1;
  9598. } else if (k1 == 1) {
  9599. playerIndices[playerCount++] = i1;
  9600. player.anInt1537 = loopCycle;
  9601. int l1 = stream.readBits(3);
  9602. player.moveInDir(false, l1);
  9603. int j2 = stream.readBits(1);
  9604. if (j2 == 1)
  9605. anIntArray894[anInt893++] = i1;
  9606. } else if (k1 == 2) {
  9607. playerIndices[playerCount++] = i1;
  9608. player.anInt1537 = loopCycle;
  9609. int i2 = stream.readBits(3);
  9610. player.moveInDir(true, i2);
  9611. int k2 = stream.readBits(3);
  9612. player.moveInDir(true, k2);
  9613. int l2 = stream.readBits(1);
  9614. if (l2 == 1)
  9615. anIntArray894[anInt893++] = i1;
  9616. } else if (k1 == 3)
  9617. anIntArray840[anInt839++] = i1;
  9618. }
  9619. }
  9620. }
  9621.  
  9622. private void drawLoginScreen(boolean flag) {
  9623. method458();
  9624. resetImageProducers();
  9625. aGraphicsBuffer_1109.setCanvas();
  9626. aBackground_966.drawBackground(0, 0);
  9627. char c = '\u0168';
  9628. char c1 = '\310';
  9629. if (loginScreenState == 0) {
  9630. int i = c1 / 2 + 80;
  9631. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  9632. i = c1 / 2 - 20;
  9633. chatTextDrawingArea.method382(0xffff00, c / 2, "Welcome to RuneScape", i, true);
  9634. i += 30;
  9635. int l = c / 2 - 80;
  9636. int k1 = c1 / 2 + 20;
  9637. aBackground_967.drawBackground(l - 73, k1 - 20);
  9638. chatTextDrawingArea.method382(0xffffff, l, "New User", k1 + 5, true);
  9639. l = c / 2 + 80;
  9640. aBackground_967.drawBackground(l - 73, k1 - 20);
  9641. chatTextDrawingArea.method382(0xffffff, l, "Existing User", k1 + 5, true);
  9642. }
  9643. if (loginScreenState == 2) {
  9644. int j = c1 / 2 - 40;
  9645. if (loginMessage1.length() > 0) {
  9646. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  9647. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j, true);
  9648. j += 30;
  9649. } else {
  9650. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  9651. j += 30;
  9652. }
  9653. chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff,
  9654. "Username: " + myUsername + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""),
  9655. j);
  9656. j += 15;
  9657. chatTextDrawingArea.method389(true, c / 2 - 88, 0xffffff,
  9658. "Password: " + TextClass.passwordAsterisks(myPassword)
  9659. + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""),
  9660. j);
  9661. j += 15;
  9662. if (!flag) {
  9663. int i1 = c / 2 - 80;
  9664. int l1 = c1 / 2 + 50;
  9665. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  9666. chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5, true);
  9667. i1 = c / 2 + 80;
  9668. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  9669. chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  9670. }
  9671. }
  9672. if (loginScreenState == 3) {
  9673. chatTextDrawingArea.method382(0xffff00, c / 2, "Create a free account", c1 / 2 - 60, true);
  9674. int k = c1 / 2 - 35;
  9675. chatTextDrawingArea.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
  9676. k += 15;
  9677. chatTextDrawingArea.method382(0xffffff, c / 2, "go back to the main RuneScape webpage", k, true);
  9678. k += 15;
  9679. chatTextDrawingArea.method382(0xffffff, c / 2, "and choose the red 'create account'", k, true);
  9680. k += 15;
  9681. chatTextDrawingArea.method382(0xffffff, c / 2, "button at the top right of that page.", k, true);
  9682. k += 15;
  9683. int j1 = c / 2;
  9684. int i2 = c1 / 2 + 50;
  9685. aBackground_967.drawBackground(j1 - 73, i2 - 20);
  9686. chatTextDrawingArea.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  9687. }
  9688. aGraphicsBuffer_1109.drawGraphics(171, super.graphics, 202);
  9689. if (welcomeScreenRaised) {
  9690. welcomeScreenRaised = false;
  9691. aGraphicsBuffer_1107.drawGraphics(0, super.graphics, 128);
  9692. aGraphicsBuffer_1108.drawGraphics(371, super.graphics, 202);
  9693. aGraphicsBuffer_1112.drawGraphics(265, super.graphics, 0);
  9694. aGraphicsBuffer_1113.drawGraphics(265, super.graphics, 562);
  9695. aGraphicsBuffer_1114.drawGraphics(171, super.graphics, 128);
  9696. aGraphicsBuffer_1115.drawGraphics(171, super.graphics, 562);
  9697. }
  9698. }
  9699.  
  9700. private void drawFlames() {
  9701. drawingFlames = true;
  9702. try {
  9703. long l = System.currentTimeMillis();
  9704. int i = 0;
  9705. int j = 20;
  9706. while (aBoolean831) {
  9707. anInt1208++;
  9708. calcFlamesPosition();
  9709. calcFlamesPosition();
  9710. doFlamesDrawing();
  9711. if (++i > 10) {
  9712. long l1 = System.currentTimeMillis();
  9713. int k = (int) (l1 - l) / 10 - j;
  9714. j = 40 - k;
  9715. if (j < 5)
  9716. j = 5;
  9717. i = 0;
  9718. l = l1;
  9719. }
  9720. try {
  9721. Thread.sleep(j);
  9722. } catch (Exception _ex) {
  9723. }
  9724. }
  9725. } catch (Exception _ex) {
  9726. }
  9727. drawingFlames = false;
  9728. }
  9729.  
  9730. public void raiseWelcomeScreen() {
  9731. welcomeScreenRaised = true;
  9732. }
  9733.  
  9734. private void method137(Stream stream, int j) {
  9735. if (j == 84) {
  9736. int k = stream.readUnsignedByte();
  9737. int j3 = anInt1268 + (k >> 4 & 7);
  9738. int i6 = anInt1269 + (k & 7);
  9739. int l8 = stream.readUnsignedWord();
  9740. int k11 = stream.readUnsignedWord();
  9741. int l13 = stream.readUnsignedWord();
  9742. if (j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104) {
  9743. NodeList class19_1 = groundArray[plane][j3][i6];
  9744. if (class19_1 != null) {
  9745. for (Item class30_sub2_sub4_sub2_3 = (Item) class19_1
  9746. .reverseGetFirst(); class30_sub2_sub4_sub2_3 != null; class30_sub2_sub4_sub2_3 = (Item) class19_1
  9747. .reverseGetNext()) {
  9748. if (class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  9749. continue;
  9750. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  9751. break;
  9752. }
  9753.  
  9754. spawnGroundItem(j3, i6);
  9755. }
  9756. }
  9757. return;
  9758. }
  9759. if (j == 105) {
  9760. int l = stream.readUnsignedByte();
  9761. int k3 = anInt1268 + (l >> 4 & 7);
  9762. int j6 = anInt1269 + (l & 7);
  9763. int i9 = stream.readUnsignedWord();
  9764. int l11 = stream.readUnsignedByte();
  9765. int i14 = l11 >> 4 & 0xf;
  9766. int i16 = l11 & 7;
  9767. if (myPlayer.smallX[0] >= k3 - i14 && myPlayer.smallX[0] <= k3 + i14 && myPlayer.smallY[0] >= j6 - i14
  9768. && myPlayer.smallY[0] <= j6 + i14 && aBoolean848 && !lowMem && anInt1062 < 50) {
  9769. anIntArray1207[anInt1062] = i9;
  9770. anIntArray1241[anInt1062] = i16;
  9771. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  9772. anInt1062++;
  9773. }
  9774. }
  9775. if (j == 215) {
  9776. int i1 = stream.method435();
  9777. int l3 = stream.method428();
  9778. int k6 = anInt1268 + (l3 >> 4 & 7);
  9779. int j9 = anInt1269 + (l3 & 7);
  9780. int i12 = stream.method435();
  9781. int j14 = stream.readUnsignedWord();
  9782. if (k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10) {
  9783. Item class30_sub2_sub4_sub2_2 = new Item();
  9784. class30_sub2_sub4_sub2_2.ID = i1;
  9785. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  9786. if (groundArray[plane][k6][j9] == null)
  9787. groundArray[plane][k6][j9] = new NodeList();
  9788. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  9789. spawnGroundItem(k6, j9);
  9790. }
  9791. return;
  9792. }
  9793. if (j == 156) {
  9794. int j1 = stream.method426();
  9795. int i4 = anInt1268 + (j1 >> 4 & 7);
  9796. int l6 = anInt1269 + (j1 & 7);
  9797. int k9 = stream.readUnsignedWord();
  9798. if (i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104) {
  9799. NodeList class19 = groundArray[plane][i4][l6];
  9800. if (class19 != null) {
  9801. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  9802. .reverseGetNext()) {
  9803. if (item.ID != (k9 & 0x7fff))
  9804. continue;
  9805. item.unlink();
  9806. break;
  9807. }
  9808.  
  9809. if (class19.reverseGetFirst() == null)
  9810. groundArray[plane][i4][l6] = null;
  9811. spawnGroundItem(i4, l6);
  9812. }
  9813. }
  9814. return;
  9815. }
  9816. if (j == 160) {
  9817. int k1 = stream.method428();
  9818. int j4 = anInt1268 + (k1 >> 4 & 7);
  9819. int i7 = anInt1269 + (k1 & 7);
  9820. int l9 = stream.method428();
  9821. int j12 = l9 >> 2;
  9822. int k14 = l9 & 3;
  9823. int j16 = anIntArray1177[j12];
  9824. int j17 = stream.method435();
  9825. if (j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103) {
  9826. int j18 = intGroundArray[plane][j4][i7];
  9827. int i19 = intGroundArray[plane][j4 + 1][i7];
  9828. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  9829. int k20 = intGroundArray[plane][j4][i7 + 1];
  9830. if (j16 == 0) {
  9831. Object1 class10 = worldController.method296(plane, j4, i7);
  9832. if (class10 != null) {
  9833. int k21 = class10.uid >> 14 & 0x7fff;
  9834. if (j12 == 2) {
  9835. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17,
  9836. false);
  9837. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20,
  9838. j17, false);
  9839. } else {
  9840. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17,
  9841. false);
  9842. }
  9843. }
  9844. }
  9845. if (j16 == 1) {
  9846. Object2 class26 = worldController.method297(j4, i7, plane);
  9847. if (class26 != null)
  9848. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19,
  9849. j18, k20, j17, false);
  9850. }
  9851. if (j16 == 2) {
  9852. Object5 class28 = worldController.method298(j4, i7, plane);
  9853. if (j12 == 11)
  9854. j12 = 10;
  9855. if (class28 != null)
  9856. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19,
  9857. l19, j18, k20, j17, false);
  9858. }
  9859. if (j16 == 3) {
  9860. Object3 class49 = worldController.method299(i7, j4, plane);
  9861. if (class49 != null)
  9862. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19,
  9863. l19, j18, k20, j17, false);
  9864. }
  9865. }
  9866. return;
  9867. }
  9868. if (j == 147) {
  9869. int l1 = stream.method428();
  9870. int k4 = anInt1268 + (l1 >> 4 & 7);
  9871. int j7 = anInt1269 + (l1 & 7);
  9872. int i10 = stream.readUnsignedWord();
  9873. byte byte0 = stream.method430();
  9874. int l14 = stream.method434();
  9875. byte byte1 = stream.method429();
  9876. int k17 = stream.readUnsignedWord();
  9877. int k18 = stream.method428();
  9878. int j19 = k18 >> 2;
  9879. int i20 = k18 & 3;
  9880. int l20 = anIntArray1177[j19];
  9881. byte byte2 = stream.readSignedByte();
  9882. int l21 = stream.readUnsignedWord();
  9883. byte byte3 = stream.method429();
  9884. Player player;
  9885. if (i10 == unknownInt10)
  9886. player = myPlayer;
  9887. else
  9888. player = playerArray[i10];
  9889. if (player != null) {
  9890. ObjectDef class46 = ObjectDef.forID(l21);
  9891. int i22 = intGroundArray[plane][k4][j7];
  9892. int j22 = intGroundArray[plane][k4 + 1][j7];
  9893. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  9894. int l22 = intGroundArray[plane][k4][j7 + 1];
  9895. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  9896. if (model != null) {
  9897. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  9898. player.anInt1707 = l14 + loopCycle;
  9899. player.anInt1708 = k17 + loopCycle;
  9900. player.aModel_1714 = model;
  9901. int i23 = class46.anInt744;
  9902. int j23 = class46.anInt761;
  9903. if (i20 == 1 || i20 == 3) {
  9904. i23 = class46.anInt761;
  9905. j23 = class46.anInt744;
  9906. }
  9907. player.anInt1711 = k4 * 128 + i23 * 64;
  9908. player.anInt1713 = j7 * 128 + j23 * 64;
  9909. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  9910. if (byte2 > byte0) {
  9911. byte byte4 = byte2;
  9912. byte2 = byte0;
  9913. byte0 = byte4;
  9914. }
  9915. if (byte3 > byte1) {
  9916. byte byte5 = byte3;
  9917. byte3 = byte1;
  9918. byte1 = byte5;
  9919. }
  9920. player.anInt1719 = k4 + byte2;
  9921. player.anInt1721 = k4 + byte0;
  9922. player.anInt1720 = j7 + byte3;
  9923. player.anInt1722 = j7 + byte1;
  9924. }
  9925. }
  9926. }
  9927. if (j == 151) {
  9928. int i2 = stream.method426();
  9929. int l4 = anInt1268 + (i2 >> 4 & 7);
  9930. int k7 = anInt1269 + (i2 & 7);
  9931. int j10 = stream.method434();
  9932. int k12 = stream.method428();
  9933. int i15 = k12 >> 2;
  9934. int k16 = k12 & 3;
  9935. int l17 = anIntArray1177[i15];
  9936. if (l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  9937. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  9938. return;
  9939. }
  9940. if (j == 4) {
  9941. int j2 = stream.readUnsignedByte();
  9942. int i5 = anInt1268 + (j2 >> 4 & 7);
  9943. int l7 = anInt1269 + (j2 & 7);
  9944. int k10 = stream.readUnsignedWord();
  9945. int l12 = stream.readUnsignedByte();
  9946. int j15 = stream.readUnsignedWord();
  9947. if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) {
  9948. i5 = i5 * 128 + 64;
  9949. l7 = l7 * 128 + 64;
  9950. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10,
  9951. method42(plane, l7, i5) - l12, l7, i5);
  9952. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  9953. }
  9954. return;
  9955. }
  9956. if (j == 44) {
  9957. int k2 = stream.method436();
  9958. int j5 = stream.readUnsignedWord();
  9959. int i8 = stream.readUnsignedByte();
  9960. int l10 = anInt1268 + (i8 >> 4 & 7);
  9961. int i13 = anInt1269 + (i8 & 7);
  9962. if (l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104) {
  9963. Item class30_sub2_sub4_sub2_1 = new Item();
  9964. class30_sub2_sub4_sub2_1.ID = k2;
  9965. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  9966. if (groundArray[plane][l10][i13] == null)
  9967. groundArray[plane][l10][i13] = new NodeList();
  9968. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  9969. spawnGroundItem(l10, i13);
  9970. }
  9971. return;
  9972. }
  9973. if (j == 101) {
  9974. int l2 = stream.method427();
  9975. int k5 = l2 >> 2;
  9976. int j8 = l2 & 3;
  9977. int i11 = anIntArray1177[k5];
  9978. int j13 = stream.readUnsignedByte();
  9979. int k15 = anInt1268 + (j13 >> 4 & 7);
  9980. int l16 = anInt1269 + (j13 & 7);
  9981. if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  9982. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  9983. return;
  9984. }
  9985. if (j == 117) {
  9986. int i3 = stream.readUnsignedByte();
  9987. int l5 = anInt1268 + (i3 >> 4 & 7);
  9988. int k8 = anInt1269 + (i3 & 7);
  9989. int j11 = l5 + stream.readSignedByte();
  9990. int k13 = k8 + stream.readSignedByte();
  9991. int l15 = stream.readSignedWord();
  9992. int i17 = stream.readUnsignedWord();
  9993. int i18 = stream.readUnsignedByte() * 4;
  9994. int l18 = stream.readUnsignedByte() * 4;
  9995. int k19 = stream.readUnsignedWord();
  9996. int j20 = stream.readUnsignedWord();
  9997. int i21 = stream.readUnsignedByte();
  9998. int j21 = stream.readUnsignedByte();
  9999. if (l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104
  10000. && i17 != 65535) {
  10001. l5 = l5 * 128 + 64;
  10002. k8 = k8 * 128 + 64;
  10003. j11 = j11 * 128 + 64;
  10004. k13 = k13 * 128 + 64;
  10005. Animable_Sub4 class30_sub2_sub4_sub4 = new Animable_Sub4(i21, l18, k19 + loopCycle, j20 + loopCycle,
  10006. j21, plane, method42(plane, k8, l5) - i18, k8, l5, l15, i17);
  10007. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  10008. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  10009. }
  10010. }
  10011. }
  10012.  
  10013. private static void setLowMem() {
  10014. WorldController.lowMem = true;
  10015. Texture.lowMem = true;
  10016. lowMem = true;
  10017. ObjectManager.lowMem = true;
  10018. ObjectDef.lowMem = true;
  10019. }
  10020.  
  10021. private void method139(Stream stream) {
  10022. stream.initBitAccess();
  10023. int k = stream.readBits(8);
  10024. if (k < npcCount) {
  10025. for (int l = k; l < npcCount; l++)
  10026. anIntArray840[anInt839++] = npcIndices[l];
  10027.  
  10028. }
  10029. if (k > npcCount) {
  10030. signlink.reporterror(myUsername + " Too many npcs");
  10031. throw new RuntimeException("eek");
  10032. }
  10033. npcCount = 0;
  10034. for (int i1 = 0; i1 < k; i1++) {
  10035. int j1 = npcIndices[i1];
  10036. NPC npc = npcArray[j1];
  10037. int k1 = stream.readBits(1);
  10038. if (k1 == 0) {
  10039. npcIndices[npcCount++] = j1;
  10040. npc.anInt1537 = loopCycle;
  10041. } else {
  10042. int l1 = stream.readBits(2);
  10043. if (l1 == 0) {
  10044. npcIndices[npcCount++] = j1;
  10045. npc.anInt1537 = loopCycle;
  10046. anIntArray894[anInt893++] = j1;
  10047. } else if (l1 == 1) {
  10048. npcIndices[npcCount++] = j1;
  10049. npc.anInt1537 = loopCycle;
  10050. int i2 = stream.readBits(3);
  10051. npc.moveInDir(false, i2);
  10052. int k2 = stream.readBits(1);
  10053. if (k2 == 1)
  10054. anIntArray894[anInt893++] = j1;
  10055. } else if (l1 == 2) {
  10056. npcIndices[npcCount++] = j1;
  10057. npc.anInt1537 = loopCycle;
  10058. int j2 = stream.readBits(3);
  10059. npc.moveInDir(true, j2);
  10060. int l2 = stream.readBits(3);
  10061. npc.moveInDir(true, l2);
  10062. int i3 = stream.readBits(1);
  10063. if (i3 == 1)
  10064. anIntArray894[anInt893++] = j1;
  10065. } else if (l1 == 3)
  10066. anIntArray840[anInt839++] = j1;
  10067. }
  10068. }
  10069.  
  10070. }
  10071.  
  10072. private void processLoginScreenInput() {
  10073. if (loginScreenState == 0) {
  10074. int i = super.myWidth / 2 - 80;
  10075. int l = super.myHeight / 2 + 20;
  10076. l += 20;
  10077. if (super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75
  10078. && super.saveClickY >= l - 20 && super.saveClickY <= l + 20) {
  10079. loginScreenState = 3;
  10080. loginScreenCursorPos = 0;
  10081. }
  10082. i = super.myWidth / 2 + 80;
  10083. if (super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75
  10084. && super.saveClickY >= l - 20 && super.saveClickY <= l + 20) {
  10085. loginMessage1 = "";
  10086. loginMessage2 = "Enter your username & password.";
  10087. loginScreenState = 2;
  10088. loginScreenCursorPos = 0;
  10089. }
  10090. } else {
  10091. if (loginScreenState == 2) {
  10092. int j = super.myHeight / 2 - 40;
  10093. j += 30;
  10094. j += 25;
  10095. if (super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10096. loginScreenCursorPos = 0;
  10097. j += 15;
  10098. if (super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10099. loginScreenCursorPos = 1;
  10100. j += 15;
  10101. int i1 = super.myWidth / 2 - 80;
  10102. int k1 = super.myHeight / 2 + 50;
  10103. k1 += 20;
  10104. if (super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75
  10105. && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20) {
  10106. loginFailures = 0;
  10107. login(myUsername, myPassword, false);
  10108. if (loggedIn)
  10109. return;
  10110. }
  10111. i1 = super.myWidth / 2 + 80;
  10112. if (super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75
  10113. && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20) {
  10114. loginScreenState = 0;
  10115. // myUsername = "";
  10116. // myPassword = "";
  10117. }
  10118. do {
  10119. int l1 = readChar(-796);
  10120. if (l1 == -1)
  10121. break;
  10122. boolean flag1 = false;
  10123. for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  10124. if (l1 != validUserPassChars.charAt(i2))
  10125. continue;
  10126. flag1 = true;
  10127. break;
  10128. }
  10129.  
  10130. if (loginScreenCursorPos == 0) {
  10131. if (l1 == 8 && myUsername.length() > 0)
  10132. myUsername = myUsername.substring(0, myUsername.length() - 1);
  10133. if (l1 == 9 || l1 == 10 || l1 == 13)
  10134. loginScreenCursorPos = 1;
  10135. if (flag1)
  10136. myUsername += (char) l1;
  10137. if (myUsername.length() > 12)
  10138. myUsername = myUsername.substring(0, 12);
  10139. } else if (loginScreenCursorPos == 1) {
  10140. if (l1 == 8 && myPassword.length() > 0)
  10141. myPassword = myPassword.substring(0, myPassword.length() - 1);
  10142. if (l1 == 9 || l1 == 10 || l1 == 13)
  10143. loginScreenCursorPos = 0;
  10144. if (flag1)
  10145. myPassword += (char) l1;
  10146. if (myPassword.length() > 20)
  10147. myPassword = myPassword.substring(0, 20);
  10148. }
  10149. } while (true);
  10150. return;
  10151. }
  10152. if (loginScreenState == 3) {
  10153. int k = super.myWidth / 2;
  10154. int j1 = super.myHeight / 2 + 50;
  10155. j1 += 20;
  10156. if (super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75
  10157. && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  10158. loginScreenState = 0;
  10159. }
  10160. }
  10161. }
  10162.  
  10163. private void markMinimap(Sprite sprite, int i, int j) {
  10164. int k = minimapInt1 + minimapInt2 & 0x7ff;
  10165. int l = i * i + j * j;
  10166. if (l > 6400)
  10167. return;
  10168. int i1 = Model.modelIntArray1[k];
  10169. int j1 = Model.modelIntArray2[k];
  10170. i1 = (i1 * 256) / (minimapInt3 + 256);
  10171. j1 = (j1 * 256) / (minimapInt3 + 256);
  10172. int k1 = j * i1 + i * j1 >> 16;
  10173. int l1 = j * j1 - i * i1 >> 16;
  10174. if (l > 2500) {
  10175. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4, 83 - l1 - sprite.anInt1445 / 2 - 4);
  10176. } else {
  10177. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4, 83 - l1 - sprite.anInt1445 / 2 - 4);
  10178. }
  10179. }
  10180.  
  10181. private void method142(int i, int j, int k, int l, int i1, int j1, int k1) {
  10182. if (i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102) {
  10183. if (lowMem && j != plane)
  10184. return;
  10185. int i2 = 0;
  10186. if (j1 == 0)
  10187. i2 = worldController.method300(j, i1, i);
  10188. if (j1 == 1)
  10189. i2 = worldController.method301(j, i1, i);
  10190. if (j1 == 2)
  10191. i2 = worldController.method302(j, i1, i);
  10192. if (j1 == 3)
  10193. i2 = worldController.method303(j, i1, i);
  10194. if (i2 != 0) {
  10195. int i3 = worldController.method304(j, i1, i, i2);
  10196. int j2 = i2 >> 14 & 0x7fff;
  10197. int k2 = i3 & 0x1f;
  10198. int l2 = i3 >> 6;
  10199. if (j1 == 0) {
  10200. worldController.method291(i1, j, i, (byte) -119);
  10201. ObjectDef class46 = ObjectDef.forID(j2);
  10202. if (class46.aBoolean767)
  10203. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  10204. }
  10205. if (j1 == 1)
  10206. worldController.method292(i, j, i1);
  10207. if (j1 == 2) {
  10208. worldController.method293(j, i1, i);
  10209. ObjectDef class46_1 = ObjectDef.forID(j2);
  10210. if (i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103
  10211. || i + class46_1.anInt761 > 103)
  10212. return;
  10213. if (class46_1.aBoolean767)
  10214. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761,
  10215. class46_1.aBoolean757);
  10216. }
  10217. if (j1 == 3) {
  10218. worldController.method294(j, i, i1);
  10219. ObjectDef class46_2 = ObjectDef.forID(j2);
  10220. if (class46_2.aBoolean767 && class46_2.hasActions)
  10221. aClass11Array1230[j].method218(i, i1);
  10222. }
  10223. }
  10224. if (k1 >= 0) {
  10225. int j3 = j;
  10226. if (j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  10227. j3++;
  10228. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  10229. }
  10230. }
  10231. }
  10232.  
  10233. private void updatePlayers(int i, Stream stream) {
  10234. anInt839 = 0;
  10235. anInt893 = 0;
  10236. method117(stream);
  10237. method134(stream);
  10238. method91(stream, i);
  10239. method49(stream);
  10240. for (int k = 0; k < anInt839; k++) {
  10241. int l = anIntArray840[k];
  10242. if (playerArray[l].anInt1537 != loopCycle)
  10243. playerArray[l] = null;
  10244. }
  10245.  
  10246. if (stream.currentOffset != i) {
  10247. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  10248. throw new RuntimeException("eek");
  10249. }
  10250. for (int i1 = 0; i1 < playerCount; i1++)
  10251. if (playerArray[playerIndices[i1]] == null) {
  10252. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  10253. throw new RuntimeException("eek");
  10254. }
  10255.  
  10256. }
  10257.  
  10258. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1) {
  10259. int l1 = 2048 - k & 0x7ff;
  10260. int i2 = 2048 - j1 & 0x7ff;
  10261. int j2 = 0;
  10262. int k2 = 0;
  10263. int l2 = j;
  10264. if (l1 != 0) {
  10265. int i3 = Model.modelIntArray1[l1];
  10266. int k3 = Model.modelIntArray2[l1];
  10267. int i4 = k2 * k3 - l2 * i3 >> 16;
  10268. l2 = k2 * i3 + l2 * k3 >> 16;
  10269. k2 = i4;
  10270. }
  10271. if (i2 != 0) {
  10272. /*
  10273. * xxx if(cameratoggle){ if(zoom == 0) zoom = k2; if(lftrit == 0)
  10274. * lftrit = j2; if(fwdbwd == 0) fwdbwd = l2; k2 = zoom; j2 = lftrit;
  10275. * l2 = fwdbwd; }
  10276. */
  10277. int j3 = Model.modelIntArray1[i2];
  10278. int l3 = Model.modelIntArray2[i2];
  10279. int j4 = l2 * j3 + j2 * l3 >> 16;
  10280. l2 = l2 * l3 - j2 * j3 >> 16;
  10281. j2 = j4;
  10282. }
  10283. xCameraPos = l - j2;
  10284. zCameraPos = i1 - k2;
  10285. yCameraPos = k1 - l2;
  10286. yCameraCurve = k;
  10287. xCameraCurve = j1;
  10288. }
  10289.  
  10290. public void updateStrings(String str, int i) {
  10291. switch (i) {
  10292. case 1675:
  10293. sendFrame126(str, 17508);
  10294. break;// Stab
  10295. case 1676:
  10296. sendFrame126(str, 17509);
  10297. break;// Slash
  10298. case 1677:
  10299. sendFrame126(str, 17510);
  10300. break;// Cursh
  10301. case 1678:
  10302. sendFrame126(str, 17511);
  10303. break;// Magic
  10304. case 1679:
  10305. sendFrame126(str, 17512);
  10306. break;// Range
  10307. case 1680:
  10308. sendFrame126(str, 17513);
  10309. break;// Stab
  10310. case 1681:
  10311. sendFrame126(str, 17514);
  10312. break;// Slash
  10313. case 1682:
  10314. sendFrame126(str, 17515);
  10315. break;// Crush
  10316. case 1683:
  10317. sendFrame126(str, 17516);
  10318. break;// Magic
  10319. case 1684:
  10320. sendFrame126(str, 17517);
  10321. break;// Range
  10322. case 1686:
  10323. sendFrame126(str, 17518);
  10324. break;// Strength
  10325. case 1687:
  10326. sendFrame126(str, 17519);
  10327. break;// Prayer
  10328. }
  10329. }
  10330.  
  10331. public void sendFrame126(String str, int i) {
  10332. RSInterface.interfaceCache[i].message = str;
  10333. if (RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  10334. needDrawTabArea = true;
  10335. }
  10336.  
  10337. public void sendPacket185(int button, int toggle, int type) {
  10338. switch (type) {
  10339. case 135:
  10340. RSInterface class9 = RSInterface.interfaceCache[button];
  10341. boolean flag8 = true;
  10342. if (class9.contentType > 0)
  10343. flag8 = promptUserForInput(class9);
  10344. if (flag8) {
  10345. stream.createFrame(185);
  10346. stream.writeWord(button);
  10347. }
  10348. break;
  10349. case 646:
  10350. stream.createFrame(185);
  10351. stream.writeWord(button);
  10352. RSInterface class9_2 = RSInterface.interfaceCache[button];
  10353. if (class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  10354. if (variousSettings[toggle] != class9_2.anIntArray212[0]) {
  10355. variousSettings[toggle] = class9_2.anIntArray212[0];
  10356. method33(toggle);
  10357. needDrawTabArea = true;
  10358. }
  10359. }
  10360. break;
  10361. case 169:
  10362. stream.createFrame(185);
  10363. stream.writeWord(button);
  10364. RSInterface class9_3 = RSInterface.interfaceCache[button];
  10365. if (class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  10366. variousSettings[toggle] = 1 - variousSettings[toggle];
  10367. method33(toggle);
  10368. needDrawTabArea = true;
  10369. }
  10370. switch (button) {
  10371. case 19136:
  10372. System.out.println("toggle = " + toggle);
  10373. if (toggle == 0)
  10374. sendFrame36(173, toggle);
  10375. if (toggle == 1)
  10376. sendPacket185(153, 173, 646);
  10377. break;
  10378. }
  10379. break;
  10380. }
  10381. }
  10382.  
  10383. public void sendFrame36(int id, int state) {
  10384. anIntArray1045[id] = state;
  10385. if (variousSettings[id] != state) {
  10386. variousSettings[id] = state;
  10387. method33(id);
  10388. needDrawTabArea = true;
  10389. if (dialogID != -1)
  10390. inputTaken = true;
  10391. }
  10392. }
  10393.  
  10394. public void sendFrame219() {
  10395. if (invOverlayInterfaceID != -1) {
  10396. invOverlayInterfaceID = -1;
  10397. needDrawTabArea = true;
  10398. tabAreaAltered = true;
  10399. }
  10400. if (backDialogID != -1) {
  10401. backDialogID = -1;
  10402. inputTaken = true;
  10403. }
  10404. if (inputDialogState != 0) {
  10405. inputDialogState = 0;
  10406. inputTaken = true;
  10407. }
  10408. openInterfaceID = -1;
  10409. aBoolean1149 = false;
  10410. }
  10411.  
  10412. public void sendFrame248(int interfaceID, int sideInterfaceID) {
  10413. if (backDialogID != -1) {
  10414. backDialogID = -1;
  10415. inputTaken = true;
  10416. }
  10417. if (inputDialogState != 0) {
  10418. inputDialogState = 0;
  10419. inputTaken = true;
  10420. }
  10421. openInterfaceID = interfaceID;
  10422. invOverlayInterfaceID = sideInterfaceID;
  10423. needDrawTabArea = true;
  10424. tabAreaAltered = true;
  10425. aBoolean1149 = false;
  10426. }
  10427.  
  10428. private boolean parsePacket() {
  10429. if (socketStream == null)
  10430. return false;
  10431. try {
  10432. int i = socketStream.available();
  10433. if (i == 0)
  10434. return false;
  10435. if (pktType == -1) {
  10436. socketStream.flushInputStream(inStream.buffer, 1);
  10437. pktType = inStream.buffer[0] & 0xff;
  10438. if (encryption != null)
  10439. pktType = pktType - encryption.getNextKey() & 0xff;
  10440. pktSize = SizeConstants.packetSizes[pktType];
  10441. i--;
  10442. }
  10443. if (pktSize == -1)
  10444. if (i > 0) {
  10445. socketStream.flushInputStream(inStream.buffer, 1);
  10446. pktSize = inStream.buffer[0] & 0xff;
  10447. i--;
  10448. } else {
  10449. return false;
  10450. }
  10451. if (pktSize == -2)
  10452. if (i > 1) {
  10453. socketStream.flushInputStream(inStream.buffer, 2);
  10454. inStream.currentOffset = 0;
  10455. pktSize = inStream.readUnsignedWord();
  10456. i -= 2;
  10457. } else {
  10458. return false;
  10459. }
  10460. if (i < pktSize)
  10461. return false;
  10462. inStream.currentOffset = 0;
  10463. socketStream.flushInputStream(inStream.buffer, pktSize);
  10464. anInt1009 = 0;
  10465. anInt843 = anInt842;
  10466. anInt842 = anInt841;
  10467. anInt841 = pktType;
  10468. switch (pktType) {
  10469. case 81:
  10470. updatePlayers(pktSize, inStream);
  10471. aBoolean1080 = false;
  10472. pktType = -1;
  10473. return true;
  10474.  
  10475. case 176:
  10476. daysSinceRecovChange = inStream.method427();
  10477. unreadMessages = inStream.method435();
  10478. membersInt = inStream.readUnsignedByte();
  10479. anInt1193 = inStream.method440();
  10480. daysSinceLastLogin = inStream.readUnsignedWord();
  10481. if (anInt1193 != 0 && openInterfaceID == -1) {
  10482. signlink.dnslookup(TextClass.method586(anInt1193));
  10483. clearTopInterfaces();
  10484. char c = '\u028A';
  10485. if (daysSinceRecovChange != 201 || membersInt == 1)
  10486. c = '\u028F';
  10487. reportAbuseInput = "";
  10488. canMute = false;
  10489. for (int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  10490. if (RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  10491. continue;
  10492. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  10493.  
  10494. }
  10495. }
  10496. pktType = -1;
  10497. return true;
  10498.  
  10499. case 64:
  10500. anInt1268 = inStream.method427();
  10501. anInt1269 = inStream.method428();
  10502. for (int j = anInt1268; j < anInt1268 + 8; j++) {
  10503. for (int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  10504. if (groundArray[plane][j][l9] != null) {
  10505. groundArray[plane][j][l9] = null;
  10506. spawnGroundItem(j, l9);
  10507. }
  10508. }
  10509. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  10510. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  10511. .reverseGetNext())
  10512. if (class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8
  10513. && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8
  10514. && class30_sub1.anInt1295 == plane)
  10515. class30_sub1.anInt1294 = 0;
  10516. pktType = -1;
  10517. return true;
  10518.  
  10519. case 185:
  10520. int k = inStream.method436();
  10521. RSInterface.interfaceCache[k].anInt233 = 3;
  10522. if (myPlayer.desc == null)
  10523. RSInterface.interfaceCache[k].mediaID = (myPlayer.anIntArray1700[0] << 25)
  10524. + (myPlayer.anIntArray1700[4] << 20) + (myPlayer.equipment[0] << 15)
  10525. + (myPlayer.equipment[8] << 10) + (myPlayer.equipment[11] << 5) + myPlayer.equipment[1];
  10526. else
  10527. RSInterface.interfaceCache[k].mediaID = (int) (0x12345678L + myPlayer.desc.type);
  10528. pktType = -1;
  10529. return true;
  10530.  
  10531. /* Clan chat packet */
  10532. case 217:
  10533. try {
  10534. name = inStream.readString();
  10535. message = inStream.readString();
  10536. clanname = inStream.readString();
  10537. rights = inStream.readUnsignedWord();
  10538. // message = TextInput.processText(message);
  10539. // message = Censor.doCensor(message);
  10540. System.out.println(clanname);
  10541. pushMessage(message, 16, name);
  10542. } catch (Exception e) {
  10543. e.printStackTrace();
  10544. }
  10545. pktType = -1;
  10546. return true;
  10547.  
  10548. case 107:
  10549. aBoolean1160 = false;
  10550. for (int l = 0; l < 5; l++)
  10551. aBooleanArray876[l] = false;
  10552. pktType = -1;
  10553. return true;
  10554.  
  10555. case 72:
  10556. int i1 = inStream.method434();
  10557. RSInterface class9 = RSInterface.interfaceCache[i1];
  10558. for (int k15 = 0; k15 < class9.inv.length; k15++) {
  10559. class9.inv[k15] = -1;
  10560. class9.inv[k15] = 0;
  10561. }
  10562. pktType = -1;
  10563. return true;
  10564.  
  10565. case 214:
  10566. ignoreCount = pktSize / 8;
  10567. for (int j1 = 0; j1 < ignoreCount; j1++)
  10568. ignoreListAsLongs[j1] = inStream.readQWord();
  10569. pktType = -1;
  10570. return true;
  10571.  
  10572. case 166:
  10573. aBoolean1160 = true;
  10574. anInt1098 = inStream.readUnsignedByte();
  10575. anInt1099 = inStream.readUnsignedByte();
  10576. anInt1100 = inStream.readUnsignedWord();
  10577. anInt1101 = inStream.readUnsignedByte();
  10578. anInt1102 = inStream.readUnsignedByte();
  10579. if (anInt1102 >= 100) {
  10580. xCameraPos = anInt1098 * 128 + 64;
  10581. yCameraPos = anInt1099 * 128 + 64;
  10582. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  10583. }
  10584. pktType = -1;
  10585. return true;
  10586.  
  10587. case 134:
  10588. needDrawTabArea = true;
  10589. int k1 = inStream.readUnsignedByte();
  10590. int i10 = inStream.method439();
  10591. int l15 = inStream.readUnsignedByte();
  10592. currentExp[k1] = i10;
  10593. currentStats[k1] = l15;
  10594. maxStats[k1] = 1;
  10595. for (int k20 = 0; k20 < 98; k20++)
  10596. if (i10 >= anIntArray1019[k20])
  10597. maxStats[k1] = k20 + 2;
  10598. pktType = -1;
  10599. return true;
  10600.  
  10601. case 71:
  10602. int l1 = inStream.readUnsignedWord();
  10603. int j10 = inStream.method426();
  10604. if (l1 == 65535)
  10605. l1 = -1;
  10606. tabInterfaceIDs[j10] = l1;
  10607. needDrawTabArea = true;
  10608. tabAreaAltered = true;
  10609. pktType = -1;
  10610. return true;
  10611.  
  10612. case 74:
  10613. int i2 = inStream.method434();
  10614. if (i2 == 65535)
  10615. i2 = -1;
  10616. if (i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  10617. nextSong = i2;
  10618. songChanging = true;
  10619. onDemandFetcher.method558(2, nextSong);
  10620. }
  10621. currentSong = i2;
  10622. pktType = -1;
  10623. return true;
  10624.  
  10625. case 121:
  10626. int j2 = inStream.method436();
  10627. int k10 = inStream.method435();
  10628. if (musicEnabled && !lowMem) {
  10629. nextSong = j2;
  10630. songChanging = false;
  10631. onDemandFetcher.method558(2, nextSong);
  10632. prevSong = k10;
  10633. }
  10634. pktType = -1;
  10635. return true;
  10636.  
  10637. case 109:
  10638. resetLogout();
  10639. pktType = -1;
  10640. return false;
  10641.  
  10642. case 70:
  10643. int k2 = inStream.readSignedWord();
  10644. int l10 = inStream.method437();
  10645. int i16 = inStream.method434();
  10646. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  10647. class9_5.anInt263 = k2;
  10648. class9_5.anInt265 = l10;
  10649. pktType = -1;
  10650. return true;
  10651.  
  10652. case 73:
  10653. case 241:
  10654. int l2 = anInt1069;
  10655. int i11 = anInt1070;
  10656. if (pktType == 73) {
  10657. l2 = inStream.method435();
  10658. i11 = inStream.readUnsignedWord();
  10659. aBoolean1159 = false;
  10660. }
  10661. if (pktType == 241) {
  10662. i11 = inStream.method435();
  10663. inStream.initBitAccess();
  10664. for (int j16 = 0; j16 < 4; j16++) {
  10665. for (int l20 = 0; l20 < 13; l20++) {
  10666. for (int j23 = 0; j23 < 13; j23++) {
  10667. int i26 = inStream.readBits(1);
  10668. if (i26 == 1)
  10669. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  10670. else
  10671. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  10672. }
  10673. }
  10674. }
  10675. inStream.finishBitAccess();
  10676. l2 = inStream.readUnsignedWord();
  10677. aBoolean1159 = true;
  10678. }
  10679. if (anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  10680. pktType = -1;
  10681. return true;
  10682. }
  10683. anInt1069 = l2;
  10684. anInt1070 = i11;
  10685. baseX = (anInt1069 - 6) * 8;
  10686. baseY = (anInt1070 - 6) * 8;
  10687. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  10688. if (anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  10689. aBoolean1141 = true;
  10690. loadingStage = 1;
  10691. aLong824 = System.currentTimeMillis();
  10692. aGraphicsBuffer_1165.setCanvas();
  10693. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  10694. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  10695. aGraphicsBuffer_1165.drawGraphics(4, super.graphics, 4);
  10696. if (pktType == 73) {
  10697. int k16 = 0;
  10698. for (int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  10699. for (int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  10700. k16++;
  10701. }
  10702. aByteArrayArray1183 = new byte[k16][];
  10703. aByteArrayArray1247 = new byte[k16][];
  10704. anIntArray1234 = new int[k16];
  10705. anIntArray1235 = new int[k16];
  10706. anIntArray1236 = new int[k16];
  10707. k16 = 0;
  10708. for (int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  10709. for (int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  10710. anIntArray1234[k16] = (l23 << 8) + j26;
  10711. if (aBoolean1141
  10712. && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  10713. anIntArray1235[k16] = -1;
  10714. anIntArray1236[k16] = -1;
  10715. k16++;
  10716. } else {
  10717. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  10718. if (k28 != -1)
  10719. onDemandFetcher.method558(3, k28);
  10720. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  10721. if (j30 != -1)
  10722. onDemandFetcher.method558(3, j30);
  10723. k16++;
  10724. }
  10725. }
  10726. }
  10727. }
  10728. if (pktType == 241) {
  10729. int l16 = 0;
  10730. int ai[] = new int[676];
  10731. for (int i24 = 0; i24 < 4; i24++) {
  10732. for (int k26 = 0; k26 < 13; k26++) {
  10733. for (int l28 = 0; l28 < 13; l28++) {
  10734. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  10735. if (k30 != -1) {
  10736. int k31 = k30 >> 14 & 0x3ff;
  10737. int i32 = k30 >> 3 & 0x7ff;
  10738. int k32 = (k31 / 8 << 8) + i32 / 8;
  10739. for (int j33 = 0; j33 < l16; j33++) {
  10740. if (ai[j33] != k32)
  10741. continue;
  10742. k32 = -1;
  10743.  
  10744. }
  10745. if (k32 != -1)
  10746. ai[l16++] = k32;
  10747. }
  10748. }
  10749. }
  10750. }
  10751. aByteArrayArray1183 = new byte[l16][];
  10752. aByteArrayArray1247 = new byte[l16][];
  10753. anIntArray1234 = new int[l16];
  10754. anIntArray1235 = new int[l16];
  10755. anIntArray1236 = new int[l16];
  10756. for (int l26 = 0; l26 < l16; l26++) {
  10757. int i29 = anIntArray1234[l26] = ai[l26];
  10758. int l30 = i29 >> 8 & 0xff;
  10759. int l31 = i29 & 0xff;
  10760. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  10761. if (j32 != -1)
  10762. onDemandFetcher.method558(3, j32);
  10763. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  10764. if (i33 != -1)
  10765. onDemandFetcher.method558(3, i33);
  10766. }
  10767. }
  10768. int i17 = baseX - anInt1036;
  10769. int j21 = baseY - anInt1037;
  10770. anInt1036 = baseX;
  10771. anInt1037 = baseY;
  10772. for (int j24 = 0; j24 < 16384; j24++) {
  10773. NPC npc = npcArray[j24];
  10774. if (npc != null) {
  10775. for (int j29 = 0; j29 < 10; j29++) {
  10776. npc.smallX[j29] -= i17;
  10777. npc.smallY[j29] -= j21;
  10778. }
  10779. npc.x -= i17 * 128;
  10780. npc.y -= j21 * 128;
  10781. }
  10782. }
  10783. for (int i27 = 0; i27 < maxPlayers; i27++) {
  10784. Player player = playerArray[i27];
  10785. if (player != null) {
  10786. for (int i31 = 0; i31 < 10; i31++) {
  10787. player.smallX[i31] -= i17;
  10788. player.smallY[i31] -= j21;
  10789. }
  10790. player.x -= i17 * 128;
  10791. player.y -= j21 * 128;
  10792. }
  10793. }
  10794. aBoolean1080 = true;
  10795. byte byte1 = 0;
  10796. byte byte2 = 104;
  10797. byte byte3 = 1;
  10798. if (i17 < 0) {
  10799. byte1 = 103;
  10800. byte2 = -1;
  10801. byte3 = -1;
  10802. }
  10803. byte byte4 = 0;
  10804. byte byte5 = 104;
  10805. byte byte6 = 1;
  10806. if (j21 < 0) {
  10807. byte4 = 103;
  10808. byte5 = -1;
  10809. byte6 = -1;
  10810. }
  10811. for (int k33 = byte1; k33 != byte2; k33 += byte3) {
  10812. for (int l33 = byte4; l33 != byte5; l33 += byte6) {
  10813. int i34 = k33 + i17;
  10814. int j34 = l33 + j21;
  10815. for (int k34 = 0; k34 < 4; k34++)
  10816. if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  10817. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  10818. else
  10819. groundArray[k34][k33][l33] = null;
  10820. }
  10821. }
  10822. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  10823. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  10824. .reverseGetNext()) {
  10825. class30_sub1_1.anInt1297 -= i17;
  10826. class30_sub1_1.anInt1298 -= j21;
  10827. if (class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104
  10828. || class30_sub1_1.anInt1298 >= 104)
  10829. class30_sub1_1.unlink();
  10830. }
  10831. if (destX != 0) {
  10832. destX -= i17;
  10833. destY -= j21;
  10834. }
  10835. aBoolean1160 = false;
  10836. pktType = -1;
  10837. return true;
  10838.  
  10839. case 208:
  10840. int i3 = inStream.method437();
  10841. if (i3 >= 0)
  10842. method60(i3);
  10843. anInt1018 = i3;
  10844. pktType = -1;
  10845. return true;
  10846.  
  10847. case 99:
  10848. anInt1021 = inStream.readUnsignedByte();
  10849. pktType = -1;
  10850. return true;
  10851.  
  10852. case 75:
  10853. int j3 = inStream.method436();
  10854. int j11 = inStream.method436();
  10855. RSInterface.interfaceCache[j11].anInt233 = 2;
  10856. RSInterface.interfaceCache[j11].mediaID = j3;
  10857. pktType = -1;
  10858. return true;
  10859.  
  10860. case 114:
  10861. anInt1104 = inStream.method434() * 30;
  10862. pktType = -1;
  10863. return true;
  10864.  
  10865. case 60:
  10866. anInt1269 = inStream.readUnsignedByte();
  10867. anInt1268 = inStream.method427();
  10868. while (inStream.currentOffset < pktSize) {
  10869. int k3 = inStream.readUnsignedByte();
  10870. method137(inStream, k3);
  10871. }
  10872. pktType = -1;
  10873. return true;
  10874.  
  10875. case 35:
  10876. int l3 = inStream.readUnsignedByte();
  10877. int k11 = inStream.readUnsignedByte();
  10878. int j17 = inStream.readUnsignedByte();
  10879. int k21 = inStream.readUnsignedByte();
  10880. aBooleanArray876[l3] = true;
  10881. anIntArray873[l3] = k11;
  10882. anIntArray1203[l3] = j17;
  10883. anIntArray928[l3] = k21;
  10884. anIntArray1030[l3] = 0;
  10885. pktType = -1;
  10886. return true;
  10887.  
  10888. case 174:
  10889.  
  10890. /* Empty Following Packet */
  10891.  
  10892. followPlayer = 0;
  10893.  
  10894. followNPC = 0;
  10895.  
  10896. int l11z = inStream.readUnsignedWord();
  10897.  
  10898. int iq = inStream.readUnsignedByte();
  10899.  
  10900. followDistance = inStream.readUnsignedWord();
  10901.  
  10902. if (iq == 0)
  10903.  
  10904. {
  10905.  
  10906. followNPC = l11z;
  10907.  
  10908. }
  10909.  
  10910. else if (iq == 1)
  10911.  
  10912. {
  10913.  
  10914. followPlayer = l11z;
  10915.  
  10916. }
  10917.  
  10918. pktType = -1;
  10919.  
  10920. return true;
  10921.  
  10922. case 104:
  10923. int j4 = inStream.method427();
  10924. int i12 = inStream.method426();
  10925. String s6 = inStream.readString();
  10926. if (j4 >= 1 && j4 <= 5) {
  10927. if (s6.equalsIgnoreCase("null"))
  10928. s6 = null;
  10929. atPlayerActions[j4 - 1] = s6;
  10930. atPlayerArray[j4 - 1] = i12 == 0;
  10931. }
  10932. pktType = -1;
  10933. return true;
  10934.  
  10935. case 78:
  10936. destX = 0;
  10937. pktType = -1;
  10938. return true;
  10939.  
  10940. case 253:
  10941. String s = inStream.readString();
  10942. if (s.endsWith(":tradereq:")) {
  10943. String s3 = s.substring(0, s.indexOf(":"));
  10944. long l17 = TextClass.longForName(s3);
  10945. boolean flag2 = false;
  10946. for (int j27 = 0; j27 < ignoreCount; j27++) {
  10947. if (ignoreListAsLongs[j27] != l17)
  10948. continue;
  10949. flag2 = true;
  10950.  
  10951. }
  10952. if (!flag2 && anInt1251 == 0)
  10953. pushMessage("wishes to trade with you.", 4, s3);
  10954. } else if (s.endsWith(":clan:")) {
  10955. String s4 = s.substring(0, s.indexOf(":"));
  10956. long l18 = TextClass.longForName(s4);
  10957. pushMessage("Clan: ", 8, s4);
  10958. } else if (s.endsWith("#url#")) {
  10959. String link = s.substring(0, s.indexOf("#"));
  10960. pushMessage("Join us at: ", 9, link);
  10961. } else if (s.endsWith(":duelreq:")) {
  10962. String s4 = s.substring(0, s.indexOf(":"));
  10963. long l18 = TextClass.longForName(s4);
  10964. boolean flag3 = false;
  10965. for (int k27 = 0; k27 < ignoreCount; k27++) {
  10966. if (ignoreListAsLongs[k27] != l18)
  10967. continue;
  10968. flag3 = true;
  10969.  
  10970. }
  10971. if (!flag3 && anInt1251 == 0)
  10972. pushMessage("wishes to duel with you.", 8, s4);
  10973. } else if (s.endsWith(":chalreq:")) {
  10974. String s5 = s.substring(0, s.indexOf(":"));
  10975. long l19 = TextClass.longForName(s5);
  10976. boolean flag4 = false;
  10977. for (int l27 = 0; l27 < ignoreCount; l27++) {
  10978. if (ignoreListAsLongs[l27] != l19)
  10979. continue;
  10980. flag4 = true;
  10981.  
  10982. }
  10983. if (!flag4 && anInt1251 == 0) {
  10984. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  10985. pushMessage(s8, 8, s5);
  10986. }
  10987. } else {
  10988. pushMessage(s, 0, "");
  10989. }
  10990. pktType = -1;
  10991. return true;
  10992.  
  10993. case 1:
  10994. for (int k4 = 0; k4 < playerArray.length; k4++)
  10995. if (playerArray[k4] != null)
  10996. playerArray[k4].anim = -1;
  10997. for (int j12 = 0; j12 < npcArray.length; j12++)
  10998. if (npcArray[j12] != null)
  10999. npcArray[j12].anim = -1;
  11000. pktType = -1;
  11001. return true;
  11002.  
  11003. case 50:
  11004. long l4 = inStream.readQWord();
  11005. int i18 = inStream.readUnsignedByte();
  11006. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  11007. for (int k24 = 0; k24 < friendsCount; k24++) {
  11008. if (l4 != friendsListAsLongs[k24])
  11009. continue;
  11010. if (friendsNodeIDs[k24] != i18) {
  11011. friendsNodeIDs[k24] = i18;
  11012. needDrawTabArea = true;
  11013. if (i18 >= 2) {
  11014. pushMessage(s7 + " has logged in.", 5, "");
  11015. }
  11016. if (i18 <= 1) {
  11017. pushMessage(s7 + " has logged out.", 5, "");
  11018. }
  11019. }
  11020. s7 = null;
  11021.  
  11022. }
  11023. if (s7 != null && friendsCount < 200) {
  11024. friendsListAsLongs[friendsCount] = l4;
  11025. friendsList[friendsCount] = s7;
  11026. friendsNodeIDs[friendsCount] = i18;
  11027. friendsCount++;
  11028. needDrawTabArea = true;
  11029. }
  11030. for (boolean flag6 = false; !flag6;) {
  11031. flag6 = true;
  11032. for (int k29 = 0; k29 < friendsCount - 1; k29++)
  11033. if (friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID
  11034. || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  11035. int j31 = friendsNodeIDs[k29];
  11036. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  11037. friendsNodeIDs[k29 + 1] = j31;
  11038. String s10 = friendsList[k29];
  11039. friendsList[k29] = friendsList[k29 + 1];
  11040. friendsList[k29 + 1] = s10;
  11041. long l32 = friendsListAsLongs[k29];
  11042. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  11043. friendsListAsLongs[k29 + 1] = l32;
  11044. needDrawTabArea = true;
  11045. flag6 = false;
  11046. }
  11047. }
  11048. pktType = -1;
  11049. return true;
  11050.  
  11051. case 110:
  11052. if (tabID == 12)
  11053. needDrawTabArea = true;
  11054. energy = inStream.readUnsignedByte();
  11055. pktType = -1;
  11056. return true;
  11057.  
  11058. case 254:
  11059. anInt855 = inStream.readUnsignedByte();
  11060. if (anInt855 == 1)
  11061. anInt1222 = inStream.readUnsignedWord();
  11062. if (anInt855 >= 2 && anInt855 <= 6) {
  11063. if (anInt855 == 2) {
  11064. anInt937 = 64;
  11065. anInt938 = 64;
  11066. }
  11067. if (anInt855 == 3) {
  11068. anInt937 = 0;
  11069. anInt938 = 64;
  11070. }
  11071. if (anInt855 == 4) {
  11072. anInt937 = 128;
  11073. anInt938 = 64;
  11074. }
  11075. if (anInt855 == 5) {
  11076. anInt937 = 64;
  11077. anInt938 = 0;
  11078. }
  11079. if (anInt855 == 6) {
  11080. anInt937 = 64;
  11081. anInt938 = 128;
  11082. }
  11083. anInt855 = 2;
  11084. anInt934 = inStream.readUnsignedWord();
  11085. anInt935 = inStream.readUnsignedWord();
  11086. anInt936 = inStream.readUnsignedByte();
  11087. }
  11088. if (anInt855 == 10)
  11089. anInt933 = inStream.readUnsignedWord();
  11090. pktType = -1;
  11091. return true;
  11092.  
  11093. case 248:
  11094. int i5 = inStream.method435();
  11095. int k12 = inStream.readUnsignedWord();
  11096. if (backDialogID != -1) {
  11097. backDialogID = -1;
  11098. inputTaken = true;
  11099. }
  11100. if (inputDialogState != 0) {
  11101. inputDialogState = 0;
  11102. inputTaken = true;
  11103. }
  11104. openInterfaceID = i5;
  11105. invOverlayInterfaceID = k12;
  11106. needDrawTabArea = true;
  11107. tabAreaAltered = true;
  11108. aBoolean1149 = false;
  11109. pktType = -1;
  11110. return true;
  11111.  
  11112. case 79:
  11113. int j5 = inStream.method434();
  11114. int l12 = inStream.method435();
  11115. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  11116. if (class9_3 != null && class9_3.type == 0) {
  11117. if (l12 < 0)
  11118. l12 = 0;
  11119. if (l12 > class9_3.scrollMax - class9_3.height)
  11120. l12 = class9_3.scrollMax - class9_3.height;
  11121. class9_3.scrollPosition = l12;
  11122. }
  11123. pktType = -1;
  11124. return true;
  11125.  
  11126. case 68:
  11127. for (int k5 = 0; k5 < variousSettings.length; k5++)
  11128. if (variousSettings[k5] != anIntArray1045[k5]) {
  11129. variousSettings[k5] = anIntArray1045[k5];
  11130. method33(k5);
  11131. needDrawTabArea = true;
  11132. }
  11133. pktType = -1;
  11134. return true;
  11135.  
  11136. case 196:
  11137. long l5 = inStream.readQWord();
  11138. int j18 = inStream.readDWord();
  11139. int l21 = inStream.readUnsignedByte();
  11140. boolean flag5 = false;
  11141. for (int i28 = 0; i28 < 100; i28++) {
  11142. if (anIntArray1240[i28] != j18)
  11143. continue;
  11144. flag5 = true;
  11145.  
  11146. }
  11147. if (l21 <= 1) {
  11148. for (int l29 = 0; l29 < ignoreCount; l29++) {
  11149. if (ignoreListAsLongs[l29] != l5)
  11150. continue;
  11151. flag5 = true;
  11152.  
  11153. }
  11154. }
  11155. if (!flag5 && anInt1251 == 0)
  11156. try {
  11157. anIntArray1240[anInt1169] = j18;
  11158. anInt1169 = (anInt1169 + 1) % 100;
  11159. String s9 = TextInput.method525(pktSize - 13, inStream);
  11160. // if(l21 != 3)
  11161. // s9 = Censor.doCensor(s9);
  11162. if (l21 == 2 || l21 == 3)
  11163. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11164. else if (l21 == 1)
  11165. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11166. else
  11167. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  11168. } catch (Exception exception1) {
  11169. signlink.reporterror("cde1");
  11170. }
  11171. pktType = -1;
  11172. return true;
  11173.  
  11174. case 85:
  11175. anInt1269 = inStream.method427();
  11176. anInt1268 = inStream.method427();
  11177. pktType = -1;
  11178. return true;
  11179.  
  11180. case 24:
  11181. anInt1054 = inStream.method428();
  11182. if (anInt1054 == tabID) {
  11183. if (anInt1054 == 3)
  11184. tabID = 1;
  11185. else
  11186. tabID = 3;
  11187. needDrawTabArea = true;
  11188. }
  11189. pktType = -1;
  11190. return true;
  11191.  
  11192. case 246:
  11193. int i6 = inStream.method434();
  11194. int i13 = inStream.readUnsignedWord();
  11195. int k18 = inStream.readUnsignedWord();
  11196. if (k18 == 65535) {
  11197. RSInterface.interfaceCache[i6].anInt233 = 0;
  11198. pktType = -1;
  11199. return true;
  11200. } else {
  11201. ItemDef itemDef = ItemDef.forID(k18);
  11202. RSInterface.interfaceCache[i6].anInt233 = 4;
  11203. RSInterface.interfaceCache[i6].mediaID = k18;
  11204. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotation1;
  11205. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotation2;
  11206. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  11207. pktType = -1;
  11208. return true;
  11209. }
  11210.  
  11211. case 171:
  11212. boolean flag1 = inStream.readUnsignedByte() == 1;
  11213. int j13 = inStream.readUnsignedWord();
  11214. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  11215. pktType = -1;
  11216. return true;
  11217.  
  11218. case 142:
  11219. int j6 = inStream.method434();
  11220. method60(j6);
  11221. if (backDialogID != -1) {
  11222. backDialogID = -1;
  11223. inputTaken = true;
  11224. }
  11225. if (inputDialogState != 0) {
  11226. inputDialogState = 0;
  11227. inputTaken = true;
  11228. }
  11229. invOverlayInterfaceID = j6;
  11230. needDrawTabArea = true;
  11231. tabAreaAltered = true;
  11232. openInterfaceID = -1;
  11233. aBoolean1149 = false;
  11234. pktType = -1;
  11235. return true;
  11236.  
  11237. case 126:
  11238. String text = inStream.readString();
  11239. int frame = inStream.method435();
  11240. if (text.startsWith("www.")) {
  11241. launchURL(text);
  11242. pktType = -1;
  11243. return true;
  11244. }
  11245. updateStrings(text, frame);
  11246. sendFrame126(text, frame);
  11247. if (frame >= 18144 && frame <= 18244) {
  11248. clanList[frame - 18144] = text;
  11249. }
  11250. pktType = -1;
  11251. return true;
  11252.  
  11253. case 206:
  11254. publicChatMode = inStream.readUnsignedByte();
  11255. privateChatMode = inStream.readUnsignedByte();
  11256. tradeMode = inStream.readUnsignedByte();
  11257. aBoolean1233 = true;
  11258. inputTaken = true;
  11259. pktType = -1;
  11260. return true;
  11261.  
  11262. case 240:
  11263. if (tabID == 12)
  11264. needDrawTabArea = true;
  11265. weight = inStream.readSignedWord();
  11266. pktType = -1;
  11267. return true;
  11268.  
  11269. case 8:
  11270. int k6 = inStream.method436();
  11271. int l13 = inStream.readUnsignedWord();
  11272. RSInterface.interfaceCache[k6].anInt233 = 1;
  11273. RSInterface.interfaceCache[k6].mediaID = l13;
  11274. pktType = -1;
  11275. return true;
  11276.  
  11277. case 122:
  11278. int l6 = inStream.method436();
  11279. int i14 = inStream.method436();
  11280. int i19 = i14 >> 10 & 0x1f;
  11281. int i22 = i14 >> 5 & 0x1f;
  11282. int l24 = i14 & 0x1f;
  11283. RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  11284. pktType = -1;
  11285. return true;
  11286.  
  11287. case 53:
  11288. needDrawTabArea = true;
  11289. int i7 = inStream.readUnsignedWord();
  11290. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  11291. int j19 = inStream.readUnsignedWord();
  11292. for (int j22 = 0; j22 < j19; j22++) {
  11293. int i25 = inStream.readUnsignedByte();
  11294. if (i25 == 255)
  11295. i25 = inStream.method440();
  11296. class9_1.inv[j22] = inStream.method436();
  11297. class9_1.invStackSizes[j22] = i25;
  11298. }
  11299. for (int j25 = j19; j25 < class9_1.inv.length; j25++) {
  11300. class9_1.inv[j25] = 0;
  11301. class9_1.invStackSizes[j25] = 0;
  11302. }
  11303. pktType = -1;
  11304. return true;
  11305.  
  11306. case 230:
  11307. int j7 = inStream.method435();
  11308. int j14 = inStream.readUnsignedWord();
  11309. int k19 = inStream.readUnsignedWord();
  11310. int k22 = inStream.method436();
  11311. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  11312. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  11313. RSInterface.interfaceCache[j14].modelZoom = j7;
  11314. pktType = -1;
  11315. return true;
  11316.  
  11317. case 221:
  11318. anInt900 = inStream.readUnsignedByte();
  11319. needDrawTabArea = true;
  11320. pktType = -1;
  11321. return true;
  11322.  
  11323. case 177:
  11324. aBoolean1160 = true;
  11325. anInt995 = inStream.readUnsignedByte();
  11326. anInt996 = inStream.readUnsignedByte();
  11327. anInt997 = inStream.readUnsignedWord();
  11328. anInt998 = inStream.readUnsignedByte();
  11329. anInt999 = inStream.readUnsignedByte();
  11330. if (anInt999 >= 100) {
  11331. int k7 = anInt995 * 128 + 64;
  11332. int k14 = anInt996 * 128 + 64;
  11333. int i20 = method42(plane, k14, k7) - anInt997;
  11334. int l22 = k7 - xCameraPos;
  11335. int k25 = i20 - zCameraPos;
  11336. int j28 = k14 - yCameraPos;
  11337. int i30 = (int) Math.sqrt(l22 * l22 + j28 * j28);
  11338. yCameraCurve = (int) (Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  11339. xCameraCurve = (int) (Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  11340. if (yCameraCurve < 128)
  11341. yCameraCurve = 128;
  11342. if (yCameraCurve > 383)
  11343. yCameraCurve = 383;
  11344. }
  11345. pktType = -1;
  11346. return true;
  11347.  
  11348. case 249:
  11349. anInt1046 = inStream.method426();
  11350. unknownInt10 = inStream.method436();
  11351. pktType = -1;
  11352. return true;
  11353.  
  11354. case 65:
  11355. updateNPCs(inStream, pktSize);
  11356. pktType = -1;
  11357. return true;
  11358.  
  11359. case 27:
  11360. messagePromptRaised = false;
  11361. inputDialogState = 1;
  11362. amountOrNameInput = "";
  11363. inputTaken = true;
  11364. pktType = -1;
  11365. return true;
  11366.  
  11367. case 187:
  11368. messagePromptRaised = false;
  11369. inputDialogState = 2;
  11370. amountOrNameInput = "";
  11371. inputTaken = true;
  11372. pktType = -1;
  11373. return true;
  11374.  
  11375. case 97:
  11376. int l7 = inStream.readUnsignedWord();
  11377. method60(l7);
  11378. if (invOverlayInterfaceID != -1) {
  11379. invOverlayInterfaceID = -1;
  11380. needDrawTabArea = true;
  11381. tabAreaAltered = true;
  11382. }
  11383. if (backDialogID != -1) {
  11384. backDialogID = -1;
  11385. inputTaken = true;
  11386. }
  11387. if (inputDialogState != 0) {
  11388. inputDialogState = 0;
  11389. inputTaken = true;
  11390. }
  11391. openInterfaceID = l7;
  11392. aBoolean1149 = false;
  11393. pktType = -1;
  11394. return true;
  11395.  
  11396. case 218:
  11397. int i8 = inStream.method438();
  11398. dialogID = i8;
  11399. inputTaken = true;
  11400. pktType = -1;
  11401. return true;
  11402.  
  11403. case 87:
  11404. int j8 = inStream.method434();
  11405. int l14 = inStream.method439();
  11406. anIntArray1045[j8] = l14;
  11407. if (variousSettings[j8] != l14) {
  11408. variousSettings[j8] = l14;
  11409. method33(j8);
  11410. needDrawTabArea = true;
  11411. if (dialogID != -1)
  11412. inputTaken = true;
  11413. }
  11414. pktType = -1;
  11415. return true;
  11416.  
  11417. case 36:
  11418. int k8 = inStream.method434();
  11419. byte byte0 = inStream.readSignedByte();
  11420. anIntArray1045[k8] = byte0;
  11421. if (variousSettings[k8] != byte0) {
  11422. variousSettings[k8] = byte0;
  11423. method33(k8);
  11424. needDrawTabArea = true;
  11425. if (dialogID != -1)
  11426. inputTaken = true;
  11427. }
  11428. pktType = -1;
  11429. return true;
  11430.  
  11431. case 61:
  11432. anInt1055 = inStream.readUnsignedByte();
  11433. pktType = -1;
  11434. return true;
  11435.  
  11436. case 200:
  11437. int l8 = inStream.readUnsignedWord();
  11438. int i15 = inStream.readSignedWord();
  11439. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  11440. class9_4.anInt257 = i15;
  11441. if (i15 == -1) {
  11442. class9_4.anInt246 = 0;
  11443. class9_4.anInt208 = 0;
  11444. }
  11445. pktType = -1;
  11446. return true;
  11447.  
  11448. case 219:
  11449. if (invOverlayInterfaceID != -1) {
  11450. invOverlayInterfaceID = -1;
  11451. needDrawTabArea = true;
  11452. tabAreaAltered = true;
  11453. }
  11454. if (backDialogID != -1) {
  11455. backDialogID = -1;
  11456. inputTaken = true;
  11457. }
  11458. if (inputDialogState != 0) {
  11459. inputDialogState = 0;
  11460. inputTaken = true;
  11461. }
  11462. openInterfaceID = -1;
  11463. aBoolean1149 = false;
  11464. pktType = -1;
  11465. return true;
  11466.  
  11467. case 34:
  11468. needDrawTabArea = true;
  11469. int i9 = inStream.readUnsignedWord();
  11470. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  11471. while (inStream.currentOffset < pktSize) {
  11472. int j20 = inStream.method422();
  11473. int i23 = inStream.readUnsignedWord();
  11474. int l25 = inStream.readUnsignedByte();
  11475. if (l25 == 255)
  11476. l25 = inStream.readDWord();
  11477. if (j20 >= 0 && j20 < class9_2.inv.length) {
  11478. class9_2.inv[j20] = i23;
  11479. class9_2.invStackSizes[j20] = l25;
  11480. }
  11481. }
  11482. pktType = -1;
  11483. return true;
  11484.  
  11485. case 4:
  11486. case 44:
  11487. case 84:
  11488. case 101:
  11489. case 105:
  11490. case 117:
  11491. case 147:
  11492. case 151:
  11493. case 156:
  11494. case 160:
  11495. case 215:
  11496. method137(inStream, pktType);
  11497. pktType = -1;
  11498. return true;
  11499.  
  11500. case 106:
  11501. tabID = inStream.method427();
  11502. needDrawTabArea = true;
  11503. tabAreaAltered = true;
  11504. pktType = -1;
  11505. return true;
  11506.  
  11507. case 164:
  11508. int j9 = inStream.method434();
  11509. method60(j9);
  11510. if (invOverlayInterfaceID != -1) {
  11511. invOverlayInterfaceID = -1;
  11512. needDrawTabArea = true;
  11513. tabAreaAltered = true;
  11514. }
  11515. backDialogID = j9;
  11516. inputTaken = true;
  11517. openInterfaceID = -1;
  11518. aBoolean1149 = false;
  11519. pktType = -1;
  11520. return true;
  11521.  
  11522. }
  11523. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  11524. // resetLogout();
  11525. } catch (IOException _ex) {
  11526. dropClient();
  11527. } catch (Exception exception) {
  11528. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + ","
  11529. + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  11530. for (int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  11531. s2 = s2 + inStream.buffer[j15] + ",";
  11532. signlink.reporterror(s2);
  11533. // resetLogout();
  11534. }
  11535. pktType = -1;
  11536. return true;
  11537. }
  11538.  
  11539. private void method146() {
  11540. anInt1265++;
  11541. method47(true);
  11542. method26(true);
  11543. method47(false);
  11544. method26(false);
  11545. method55();
  11546. method104();
  11547. if (!aBoolean1160) {
  11548. int i = anInt1184;
  11549. if (anInt984 / 256 > i)
  11550. i = anInt984 / 256;
  11551. if (aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  11552. i = anIntArray1203[4] + 128;
  11553. int k = minimapInt1 + anInt896 & 0x7ff;
  11554. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  11555. }
  11556. int j;
  11557. if (!aBoolean1160)
  11558. j = method120();
  11559. else
  11560. j = method121();
  11561. int l = xCameraPos;
  11562. int i1 = zCameraPos;
  11563. int j1 = yCameraPos;
  11564. int k1 = yCameraCurve;
  11565. int l1 = xCameraCurve;
  11566. for (int i2 = 0; i2 < 5; i2++)
  11567. if (aBooleanArray876[i2]) {
  11568. int j2 = (int) ((Math.random() * (double) (anIntArray873[i2] * 2 + 1) - (double) anIntArray873[i2])
  11569. + Math.sin((double) anIntArray1030[i2] * ((double) anIntArray928[i2] / 100D))
  11570. * (double) anIntArray1203[i2]);
  11571. if (i2 == 0)
  11572. xCameraPos += j2;
  11573. if (i2 == 1)
  11574. zCameraPos += j2;
  11575. if (i2 == 2)
  11576. yCameraPos += j2;
  11577. if (i2 == 3)
  11578. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  11579. if (i2 == 4) {
  11580. yCameraCurve += j2;
  11581. if (yCameraCurve < 128)
  11582. yCameraCurve = 128;
  11583. if (yCameraCurve > 383)
  11584. yCameraCurve = 383;
  11585. }
  11586. }
  11587. int k2 = Texture.anInt1481;
  11588. Model.aBoolean1684 = true;
  11589. Model.anInt1687 = 0;
  11590. Model.anInt1685 = super.mouseX - 4;
  11591. Model.anInt1686 = super.mouseY - 4;
  11592. WorldController.anInt543 = DrawingArea.width;
  11593. if (aBoolean594 == true) {
  11594. Model.anInt1685 <<= 1;
  11595. Model.anInt1686 <<= 1;
  11596. WorldController.anInt543 <<= 1;
  11597. anInt344 = Texture.pixels;
  11598. Texture.pixels = antialiasingPixels;
  11599. offsets = Texture.anIntArray1472;
  11600. Texture.anIntArray1472 = antialiasingOffsets;
  11601. Texture.bottomX <<= 1;
  11602. Texture.bottomY <<= 1;
  11603. DrawingArea.width <<= 1;
  11604. DrawingArea.height <<= 1;
  11605. DrawingArea.centerX <<= 1;
  11606. DrawingArea.centerY <<= 1;
  11607. DrawingArea.anInt1387 <<= 1;
  11608. Texture.textureInt1 <<= 1;
  11609. Texture.textureInt2 <<= 1;
  11610. }
  11611. DrawingArea.setAllPixelsToZero();
  11612. if (aBoolean234 == true) {
  11613. int x = baseX + (myPlayer.x - 5 >> 7) >> 3;
  11614. int y = baseY + (myPlayer.y - 5 >> 7) >> 3;
  11615. Texture.fogColor = (x >= 270) && (x <= 465) && (y >= 335) && (y <= 495) ? 13156520 : 0;
  11616. DrawingArea.clear(Texture.fogColor);
  11617. }
  11618. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  11619. worldController.clearObj5Cache();
  11620.  
  11621. if (aBoolean594 == true) {
  11622. Model.anInt1685 >>= 1;
  11623. Model.anInt1686 >>= 1;
  11624. WorldController.anInt543 >>= 1;
  11625. Texture.pixels = anInt344;
  11626. Texture.anIntArray1472 = offsets;
  11627. Texture.bottomX >>= 1;
  11628. Texture.bottomY >>= 1;
  11629. DrawingArea.width >>= 1;
  11630. DrawingArea.height >>= 1;
  11631. DrawingArea.centerX >>= 1;
  11632. DrawingArea.centerY >>= 1;
  11633. DrawingArea.anInt1387 >>= 1;
  11634. Texture.textureInt1 >>= 1;
  11635. Texture.textureInt2 >>= 1;
  11636. int w = DrawingArea.width;
  11637. int h = DrawingArea.height;
  11638. for (int x = 0; x < w; x++) {
  11639. for (int y = 0; y < h; y++) {
  11640. int x2 = x << 1;
  11641. int y2 = y << 1;
  11642. int w2 = w << 1;
  11643. int c1 = antialiasingPixels[(x2 + y2 * w2)];
  11644. int c2 = antialiasingPixels[(x2 + 1 + y2 * w2)];
  11645. int c3 = antialiasingPixels[(x2 + (y2 + 1) * w2)];
  11646. int c4 = antialiasingPixels[(x2 + 1 + (y2 + 1) * w2)];
  11647. int r = (c1 >> 16 & 0xFF) + (c2 >> 16 & 0xFF) + (c3 >> 16 & 0xFF) + (c4 >> 16 & 0xFF) >> 2;
  11648. int g = (c1 >> 8 & 0xFF) + (c2 >> 8 & 0xFF) + (c3 >> 8 & 0xFF) + (c4 >> 8 & 0xFF) >> 2;
  11649. int b = (c1 & 0xFF) + (c2 & 0xFF) + (c3 & 0xFF) + (c4 & 0xFF) >> 2;
  11650. DrawingArea.pixels[(x + y * DrawingArea.width)] = (r << 16 | g << 8 | b);
  11651. }
  11652. }
  11653. }
  11654. WorldController.anInt543 = 512;
  11655. updateEntities();
  11656. drawHeadIcon();
  11657. method37(k2);
  11658. draw3dScreen();
  11659. aGraphicsBuffer_1165.drawGraphics(4, super.graphics, 4);
  11660. xCameraPos = l;
  11661. zCameraPos = i1;
  11662. yCameraPos = j1;
  11663. yCameraCurve = k1;
  11664. xCameraCurve = l1;
  11665. }
  11666.  
  11667. public void drawRunOrb() {
  11668. if (!runClicked) {
  11669. if (super.mouseX > 710 && super.mouseX < 742 && super.mouseY > 88 && super.mouseY < 122) {
  11670. hoverorbrun.drawSprite(165, 85);
  11671. } else {
  11672. runorb.drawSprite(165, 85);
  11673.  
  11674. }
  11675. } else {
  11676. if (super.mouseX > 710 && super.mouseX < 742 && super.mouseY > 88 && super.mouseY < 122) {
  11677. hoverorbrun2.drawSprite(165, 85);
  11678. } else {
  11679. runClick.drawSprite(165, 85);
  11680. }
  11681. }
  11682. }
  11683.  
  11684. public void drawHPOrb() {
  11685. int health;
  11686. String cHP = RSInterface.interfaceCache[4016].message;
  11687. int currentHP = Integer.parseInt(cHP);
  11688. String mHP = RSInterface.interfaceCache[4017].message;
  11689. int maxHP2 = Integer.parseInt(mHP);
  11690. health = (int) (((double) currentHP / (double) maxHP2) * 100D);
  11691. // Draws empty orb
  11692. emptyOrb.drawSprite(160, 13);
  11693. hitPointsFill.drawSprite(163, 16);
  11694. // Draws current HP text
  11695. if (health > 100) {
  11696. smallText.method382(65280, 176, cHP, 34, true);
  11697. }
  11698. if (health <= 100 && health >= 75) {
  11699. smallText.method382(65280, 176, cHP, 34, true);
  11700. } else if (health <= 74 && health >= 50) {
  11701. smallText.method382(0xffff00, 176, cHP, 34, true);
  11702. } else if (health <= 49 && health >= 25) {
  11703. smallText.method382(0xfca607, 176, cHP, 34, true);
  11704. } else if (health <= 24 && health >= 0) {
  11705. smallText.method382(0xf50d0d, 176, cHP, 34, true);
  11706. }
  11707. // Draws inside orb sprites
  11708. }
  11709.  
  11710. public void loadOrbs() {
  11711. // drawHPOrb();
  11712. // drawPrayerOrb();
  11713. // drawRunOrb();
  11714. }
  11715.  
  11716. public void drawPrayerOrb() {
  11717. int prayer;
  11718.  
  11719. String cP = RSInterface.interfaceCache[4012].message;
  11720. int currentPrayer = Integer.parseInt(cP);
  11721. String mP = RSInterface.interfaceCache[4013].message;
  11722. int maxPrayer = Integer.parseInt(mP);
  11723. prayer = (int) (((double) currentPrayer / (double) maxPrayer) * 100D);
  11724. /* Draws empty orb */
  11725. emptyOrb.drawSprite(171, 49);
  11726. prayerFill.drawSprite(174, 52);
  11727. /* Draws current HP text */
  11728. if (prayer <= 100 && prayer >= 75) {
  11729. smallText.method382(65280, 187, cP, 71, true);
  11730. } else if (prayer <= 74 && prayer >= 50) {
  11731. smallText.method382(0xffff00, 187, cP, 71, true);
  11732. } else if (prayer <= 49 && prayer >= 25) {
  11733. smallText.method382(0xfca607, 187, cP, 71, true);
  11734. } else if (prayer <= 24 && prayer >= 0) {
  11735. smallText.method382(0xf50d0d, 187, cP, 71, true);
  11736. }
  11737. /* Draws inside orb sprites */
  11738. }
  11739.  
  11740. public void clearTopInterfaces() {
  11741. stream.createFrame(130);
  11742. if (invOverlayInterfaceID != -1) {
  11743. invOverlayInterfaceID = -1;
  11744. needDrawTabArea = true;
  11745. aBoolean1149 = false;
  11746. tabAreaAltered = true;
  11747. }
  11748. if (backDialogID != -1) {
  11749. backDialogID = -1;
  11750. inputTaken = true;
  11751. aBoolean1149 = false;
  11752. }
  11753. openInterfaceID = -1;
  11754. fullscreenInterfaceID = -1;
  11755. }
  11756.  
  11757. public client() {
  11758. fullscreenInterfaceID = -1;
  11759. chatRights = new int[500];
  11760. chatTypeView = 0;
  11761. clanChatMode = 0;
  11762. cButtonHPos = -1;
  11763. cButtonHCPos = -1;
  11764. cButtonCPos = 0;
  11765. server = "127.0.0.1";
  11766. anIntArrayArray825 = new int[104][104];
  11767. friendsNodeIDs = new int[200];
  11768. groundArray = new NodeList[4][104][104];
  11769. aBoolean831 = false;
  11770. aStream_834 = new Stream(new byte[5000]);
  11771. npcArray = new NPC[16384];
  11772. npcIndices = new int[16384];
  11773. anIntArray840 = new int[1000];
  11774. aStream_847 = Stream.create();
  11775. aBoolean848 = true;
  11776. openInterfaceID = -1;
  11777. currentExp = new int[Skills.skillsCount];
  11778. aBoolean872 = false;
  11779. anIntArray873 = new int[5];
  11780. anInt874 = -1;
  11781. aBooleanArray876 = new boolean[5];
  11782. drawFlames = false;
  11783. reportAbuseInput = "";
  11784. unknownInt10 = -1;
  11785. menuOpen = false;
  11786. inputString = "";
  11787. maxPlayers = 2048;
  11788. myPlayerIndex = 2047;
  11789. playerArray = new Player[maxPlayers];
  11790. playerIndices = new int[maxPlayers];
  11791. anIntArray894 = new int[maxPlayers];
  11792. aStreamArray895s = new Stream[maxPlayers];
  11793. anInt897 = 1;
  11794. anIntArrayArray901 = new int[104][104];
  11795. anInt902 = 0x766654;
  11796. aByteArray912 = new byte[16384];
  11797. currentStats = new int[Skills.skillsCount];
  11798. ignoreListAsLongs = new long[100];
  11799. loadingError = false;
  11800. anInt927 = 0x332d25;
  11801. anIntArray928 = new int[5];
  11802. anIntArrayArray929 = new int[104][104];
  11803. chatTypes = new int[500];
  11804. chatNames = new String[500];
  11805. chatMessages = new String[500];
  11806. chatButtons = new Sprite[4];
  11807. sideIcons = new Sprite[15];
  11808. redStones = new Sprite[5];
  11809. aBoolean954 = true;
  11810. friendsListAsLongs = new long[200];
  11811. currentSong = -1;
  11812. drawingFlames = false;
  11813. spriteDrawX = -1;
  11814. spriteDrawY = -1;
  11815. anIntArray968 = new int[33];
  11816. anIntArray969 = new int[256];
  11817. decompressors = new Decompressor[5];
  11818. variousSettings = new int[2000];
  11819. aBoolean972 = false;
  11820. anInt975 = 50;
  11821. anIntArray976 = new int[anInt975];
  11822. anIntArray977 = new int[anInt975];
  11823. anIntArray978 = new int[anInt975];
  11824. anIntArray979 = new int[anInt975];
  11825. anIntArray980 = new int[anInt975];
  11826. anIntArray981 = new int[anInt975];
  11827. anIntArray982 = new int[anInt975];
  11828. aStringArray983 = new String[anInt975];
  11829. anInt985 = -1;
  11830. hitMarks = new Sprite[20];
  11831. hitMark = new Sprite[4];
  11832. anIntArray990 = new int[5];
  11833. aBoolean994 = false;
  11834. anInt1002 = 0x23201b;
  11835. amountOrNameInput = "";
  11836. aClass19_1013 = new NodeList();
  11837. aBoolean1017 = false;
  11838. anInt1018 = -1;
  11839. anIntArray1030 = new int[5];
  11840. aBoolean1031 = false;
  11841. mapFunctions = new Sprite[100];
  11842. dialogID = -1;
  11843. maxStats = new int[Skills.skillsCount];
  11844. anIntArray1045 = new int[2000];
  11845. aBoolean1047 = true;
  11846. anIntArray1052 = new int[151];
  11847. anInt1054 = -1;
  11848. aClass19_1056 = new NodeList();
  11849. anIntArray1057 = new int[33];
  11850. aClass9_1059 = new RSInterface();
  11851. mapScenes = new Background[100];
  11852. barFillColor = 0x4d4233;
  11853. anIntArray1065 = new int[7];
  11854. anIntArray1072 = new int[1000];
  11855. anIntArray1073 = new int[1000];
  11856. aBoolean1080 = false;
  11857. friendsList = new String[200];
  11858. inStream = Stream.create();
  11859. expectedCRCs = new int[9];
  11860. menuActionCmd2 = new int[500];
  11861. menuActionCmd3 = new int[500];
  11862. menuActionID = new int[500];
  11863. menuActionCmd1 = new int[500];
  11864. headIcons = new Sprite[20];
  11865. skullIcons = new Sprite[20];
  11866. headIconsHint = new Sprite[20];
  11867. tabAreaAltered = false;
  11868. aString1121 = "";
  11869. atPlayerActions = new String[5];
  11870. atPlayerArray = new boolean[5];
  11871. anIntArrayArrayArray1129 = new int[4][13][13];
  11872. anInt1132 = 2;
  11873. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  11874. aBoolean1141 = false;
  11875. aBoolean1149 = false;
  11876. crosses = new Sprite[8];
  11877. musicEnabled = true;
  11878. needDrawTabArea = false;
  11879. loggedIn = false;
  11880. canMute = false;
  11881. aBoolean1159 = false;
  11882. aBoolean1160 = false;
  11883. anInt1171 = 1;
  11884. myUsername = "";
  11885. myPassword = "";
  11886. genericLoadingError = false;
  11887. reportAbuseInterfaceID = -1;
  11888. aClass19_1179 = new NodeList();
  11889. anInt1184 = 128;
  11890. invOverlayInterfaceID = -1;
  11891. stream = Stream.create();
  11892. menuActionName = new String[500];
  11893. anIntArray1203 = new int[5];
  11894. anIntArray1207 = new int[50];
  11895. anInt1210 = 2;
  11896. anInt1211 = 78;
  11897. promptInput = "";
  11898. modIcons = new Background[2];
  11899. tabID = 3;
  11900. inputTaken = false;
  11901. songChanging = true;
  11902. anIntArray1229 = new int[151];
  11903. aClass11Array1230 = new Class11[4];
  11904. aBoolean1233 = false;
  11905. anIntArray1240 = new int[100];
  11906. anIntArray1241 = new int[50];
  11907. aBoolean1242 = false;
  11908. anIntArray1250 = new int[50];
  11909. rsAlreadyLoaded = false;
  11910. welcomeScreenRaised = false;
  11911. messagePromptRaised = false;
  11912. loginMessage1 = "";
  11913. loginMessage2 = "";
  11914. backDialogID = -1;
  11915. anInt1279 = 2;
  11916. bigX = new int[4000];
  11917. bigY = new int[4000];
  11918. anInt1289 = -1;
  11919. }
  11920.  
  11921. public int rights;
  11922. public String name;
  11923. public String message;
  11924. public String clanname;
  11925. private final int[] chatRights;
  11926. public int chatTypeView;
  11927. public int clanChatMode;
  11928. public int duelMode;
  11929. /* Declare custom sprites */
  11930. private Sprite chatArea;
  11931. private Sprite[] chatButtons;
  11932. private Sprite tabArea;
  11933. private Sprite mapArea;
  11934. private Sprite emptyOrb;
  11935. private Sprite hoverOrb;
  11936. private Sprite hoverorbrun;
  11937. private Sprite hoverorbrun2;
  11938. private Sprite runClick;
  11939. private Sprite runorb;
  11940. private Sprite hitPointsFill;
  11941. private Sprite prayerFill;
  11942. public boolean runClicked = false;
  11943.  
  11944. /**/
  11945. private GraphicsBuffer leftFrame;
  11946. private GraphicsBuffer topFrame;
  11947. private GraphicsBuffer rightFrame;
  11948. private int ignoreCount;
  11949. private long aLong824;
  11950. private int[][] anIntArrayArray825;
  11951. private int[] friendsNodeIDs;
  11952. private NodeList[][][] groundArray;
  11953. private int[] anIntArray828;
  11954. private int[] anIntArray829;
  11955. private volatile boolean aBoolean831;
  11956. private Socket aSocket832;
  11957. private int loginScreenState;
  11958. private Stream aStream_834;
  11959. private NPC[] npcArray;
  11960. private int npcCount;
  11961. private int[] npcIndices;
  11962. private int anInt839;
  11963. private int[] anIntArray840;
  11964. private int anInt841;
  11965. private int anInt842;
  11966. private int anInt843;
  11967. private String aString844;
  11968. private int privateChatMode;
  11969. private Stream aStream_847;
  11970. private boolean aBoolean848;
  11971. private static int anInt849;
  11972. private int[] anIntArray850;
  11973. private int[] anIntArray851;
  11974. private int[] anIntArray852;
  11975. private int[] anIntArray853;
  11976. private static int anInt854;
  11977. private int anInt855;
  11978. private int openInterfaceID;
  11979. static int xCameraPos;
  11980. private int zCameraPos;
  11981. private int yCameraPos;
  11982. private int yCameraCurve;
  11983. private int xCameraCurve;
  11984. private int myPrivilege;
  11985. private final int[] currentExp;
  11986. private Sprite[] redStones;
  11987. private Sprite mapFlag;
  11988. private Sprite mapMarker;
  11989. private boolean aBoolean872;
  11990. private final int[] anIntArray873;
  11991. private int anInt874;
  11992. private final boolean[] aBooleanArray876;
  11993. private int weight;
  11994. private MouseDetection mouseDetection;
  11995. private volatile boolean drawFlames;
  11996. private String reportAbuseInput;
  11997. private int unknownInt10;
  11998. private boolean menuOpen;
  11999. private int anInt886;
  12000. private String inputString;
  12001. private final int maxPlayers;
  12002. private final int myPlayerIndex;
  12003. private Player[] playerArray;
  12004. private int playerCount;
  12005. private int[] playerIndices;
  12006. private int anInt893;
  12007. private int[] anIntArray894;
  12008. private Stream[] aStreamArray895s;
  12009. private int anInt896;
  12010. private int anInt897;
  12011. private int friendsCount;
  12012. private int anInt900;
  12013. private int[][] anIntArrayArray901;
  12014. private final int anInt902;
  12015. private byte[] aByteArray912;
  12016. private int anInt913;
  12017. private int crossX;
  12018. private int crossY;
  12019. private int crossIndex;
  12020. private int crossType;
  12021. private int plane;
  12022. private final int[] currentStats;
  12023. private static int anInt924;
  12024. private final long[] ignoreListAsLongs;
  12025. private boolean loadingError;
  12026. private final int anInt927;
  12027. private final int[] anIntArray928;
  12028. private int[][] anIntArrayArray929;
  12029. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  12030. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  12031. private int anInt933;
  12032. private int anInt934;
  12033. private int anInt935;
  12034. private int anInt936;
  12035. private int anInt937;
  12036. private int anInt938;
  12037. private static int anInt940;
  12038. private final int[] chatTypes;
  12039. private final String[] chatNames;
  12040. private final String[] chatMessages;
  12041. private int anInt945;
  12042. private WorldController worldController;
  12043. private Sprite[] sideIcons;
  12044. private int menuScreenArea;
  12045. private int menuOffsetX;
  12046. private int menuOffsetY;
  12047. private int menuWidth;
  12048. private int menuHeight;
  12049. private long aLong953;
  12050. private boolean aBoolean954;
  12051. private long[] friendsListAsLongs;
  12052. private String[] clanList = new String[100];
  12053. private int currentSong;
  12054. private static int nodeID = 10;
  12055. static int portOff;
  12056. static boolean clientData;
  12057. private static boolean isMembers = true;
  12058. private static boolean lowMem;
  12059. private volatile boolean drawingFlames;
  12060. private int spriteDrawX;
  12061. private int spriteDrawY;
  12062. private final int[] anIntArray965 = { 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff };
  12063. private Background aBackground_966;
  12064. private Background aBackground_967;
  12065. private final int[] anIntArray968;
  12066. private final int[] anIntArray969;
  12067. final Decompressor[] decompressors;
  12068. public int variousSettings[];
  12069. private boolean aBoolean972;
  12070. private final int anInt975;
  12071. private final int[] anIntArray976;
  12072. private final int[] anIntArray977;
  12073. private final int[] anIntArray978;
  12074. private final int[] anIntArray979;
  12075. private final int[] anIntArray980;
  12076. private final int[] anIntArray981;
  12077. private final int[] anIntArray982;
  12078. private final String[] aStringArray983;
  12079. private int anInt984;
  12080. private int anInt985;
  12081. private static int anInt986;
  12082. private Sprite[] hitMarks;
  12083. private Sprite[] hitMark;
  12084. private int anInt988;
  12085. private int anInt989;
  12086. private final int[] anIntArray990;
  12087. private static boolean aBoolean993;
  12088. public boolean aBoolean567;
  12089. private final boolean aBoolean994;
  12090. private int anInt995;
  12091. private int anInt996;
  12092. private int anInt997;
  12093. private int anInt998;
  12094. private int anInt999;
  12095. private ISAACRandomGen encryption;
  12096. private Sprite mapEdge;
  12097. private Sprite multiOverlay;
  12098. private final int anInt1002;
  12099. static final int[][] anIntArrayArray1003 = {
  12100. { 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433, 2983, 54193 },
  12101. { 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153, 56621, 4783, 1341, 16578, 35003, 25239 },
  12102. { 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153, 56621, 4783, 1341, 16578, 35003 },
  12103. { 4626, 11146, 6439, 12, 4758, 10270 }, { 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574 } };
  12104. private String amountOrNameInput;
  12105. private static int anInt1005;
  12106. private int daysSinceLastLogin;
  12107. private int pktSize;
  12108. private int pktType;
  12109. private int anInt1009;
  12110. private int anInt1010;
  12111. private int anInt1011;
  12112. private NodeList aClass19_1013;
  12113. private int anInt1014;
  12114. private int anInt1015;
  12115. private int anInt1016;
  12116. private boolean aBoolean1017;
  12117. private int anInt1018;
  12118. private static final int[] anIntArray1019;
  12119. private int anInt1021;
  12120. private int anInt1022;
  12121. private int loadingStage;
  12122. private Sprite scrollBar1;
  12123. private Sprite scrollBar2;
  12124. private int anInt1026;
  12125. private Background backBase1;
  12126. private Background backBase2;
  12127. private Background backHmid1;
  12128. private final int[] anIntArray1030;
  12129. private boolean aBoolean1031;
  12130. private Sprite[] mapFunctions;
  12131. private int baseX;
  12132. private int baseY;
  12133. private int anInt1036;
  12134. private int anInt1037;
  12135. private int loginFailures;
  12136. private int anInt1039;
  12137. private int anInt1040;
  12138. private int anInt1041;
  12139. private int dialogID;
  12140. private final int[] maxStats;
  12141. private final int[] anIntArray1045;
  12142. private int anInt1046;
  12143. private boolean aBoolean1047;
  12144. public boolean aBoolean594 = true;
  12145. public static boolean aBoolean234 = true;
  12146. private int anInt1048;
  12147. private String aString1049;
  12148. private static int anInt1051;
  12149. private final int[] anIntArray1052;
  12150. private StreamLoader titleStreamLoader;
  12151. private int anInt1054;
  12152. private int anInt1055;
  12153. private NodeList aClass19_1056;
  12154. private final int[] anIntArray1057;
  12155. public final RSInterface aClass9_1059;
  12156. private Background[] mapScenes;
  12157. private static int anInt1061;
  12158. private int anInt1062;
  12159. private final int barFillColor;
  12160. private int friendsListAction;
  12161. private final int[] anIntArray1065;
  12162. private int mouseInvInterfaceIndex;
  12163. private int lastActiveInvInterface;
  12164. private OnDemandFetcher onDemandFetcher;
  12165. private int anInt1069;
  12166. private int anInt1070;
  12167. private int anInt1071;
  12168. private int[] anIntArray1072;
  12169. private int[] anIntArray1073;
  12170. private Sprite mapDotItem;
  12171. private Sprite mapDotNPC;
  12172. private Sprite mapDotPlayer;
  12173. private Sprite mapDotFriend;
  12174. private Sprite mapDotTeam;
  12175. private Sprite mapDotClan;
  12176. private int anInt1079;
  12177. private boolean aBoolean1080;
  12178. private String[] friendsList;
  12179. private Stream inStream;
  12180. private int anInt1084;
  12181. private int anInt1085;
  12182. private int activeInterfaceType;
  12183. private int anInt1087;
  12184. private int anInt1088;
  12185. public static int anInt1089;
  12186. private final int[] expectedCRCs;
  12187. private int[] menuActionCmd2;
  12188. private int[] menuActionCmd3;
  12189. private int[] menuActionID;
  12190. private int[] menuActionCmd1;
  12191. private Sprite[] headIcons;
  12192. private Sprite[] skullIcons;
  12193. private Sprite[] headIconsHint;
  12194. private static int anInt1097;
  12195. private int anInt1098;
  12196. private int anInt1099;
  12197. private int anInt1100;
  12198. private int anInt1101;
  12199. private int anInt1102;
  12200. private static boolean tabAreaAltered;
  12201. private int anInt1104;
  12202. public static client instance;
  12203. public static int[] antialiasingPixels;
  12204. public static int[] antialiasingOffsets;
  12205. public int appletWidth = 765;
  12206. public int appletHeight = 503;
  12207. private int gameAreaWidth = 512;
  12208. private int gameAreaHeight = 334;
  12209. public static int clientWidth = 765;
  12210. public static int clientHeight = 503;
  12211. public static int clientSize = 0;
  12212. private GraphicsBuffer aGraphicsBuffer_1107;
  12213. private GraphicsBuffer aGraphicsBuffer_1108;
  12214. private GraphicsBuffer aGraphicsBuffer_1109;
  12215. private GraphicsBuffer aGraphicsBuffer_1110;
  12216. private GraphicsBuffer aGraphicsBuffer_1111;
  12217. private GraphicsBuffer aGraphicsBuffer_1112;
  12218. private GraphicsBuffer aGraphicsBuffer_1113;
  12219. private GraphicsBuffer aGraphicsBuffer_1114;
  12220. private GraphicsBuffer aGraphicsBuffer_1115;
  12221. private static int anInt1117;
  12222. private int membersInt;
  12223. private String aString1121;
  12224. private Sprite compass;
  12225. private GraphicsBuffer aGraphicsBuffer_1123;
  12226. private GraphicsBuffer aGraphicsBuffer_1124;
  12227. private GraphicsBuffer aGraphicsBuffer_1125;
  12228. public static Player myPlayer;
  12229. private final String[] atPlayerActions;
  12230. private final boolean[] atPlayerArray;
  12231. private final int[][][] anIntArrayArrayArray1129;
  12232. private final int[] tabInterfaceIDs = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
  12233. private int anInt1131;
  12234. private int anInt1132;
  12235. private int menuActionRow;
  12236. private static int anInt1134;
  12237. private int spellSelected;
  12238. private int anInt1137;
  12239. private int spellUsableOn;
  12240. private String spellTooltip;
  12241. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  12242. private boolean aBoolean1141;
  12243. private static int anInt1142;
  12244. private int energy;
  12245. private boolean aBoolean1149;
  12246. private Sprite[] crosses;
  12247. private boolean musicEnabled;
  12248. private Background[] aBackgroundArray1152s;
  12249. private static boolean needDrawTabArea;
  12250. private int unreadMessages;
  12251. private static int anInt1155;
  12252. private static boolean fpsOn;
  12253. private static int anInt115;
  12254. private static int anInt118;
  12255. public boolean loggedIn;
  12256. private boolean canMute;
  12257. private boolean aBoolean1159;
  12258. private boolean aBoolean1160;
  12259. static int loopCycle;
  12260. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  12261. private GraphicsBuffer aGraphicsBuffer_1163;
  12262. private GraphicsBuffer mapEdgeIP;
  12263. private GraphicsBuffer aGraphicsBuffer_1164;
  12264. private GraphicsBuffer aGraphicsBuffer_1165;
  12265. private GraphicsBuffer aGraphicsBuffer_1166;
  12266. private int daysSinceRecovChange;
  12267. private RSSocket socketStream;
  12268. private int anInt1169;
  12269. private int minimapInt3;
  12270. private int anInt1171;
  12271. private long aLong1172;
  12272. private String myUsername;
  12273. private String myPassword;
  12274. private static int anInt1175;
  12275. private boolean genericLoadingError;
  12276. 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 };
  12277. private int reportAbuseInterfaceID;
  12278. private NodeList aClass19_1179;
  12279. private int[] anIntArray1180;
  12280. private int[] anIntArray1181;
  12281. private int[] anIntArray1182;
  12282. private byte[][] aByteArrayArray1183;
  12283. private int anInt1184;
  12284. private int minimapInt1;
  12285. private int anInt1186;
  12286. private int anInt1187;
  12287. private static int anInt1188;
  12288. private int invOverlayInterfaceID;
  12289. private int[] anIntArray1190;
  12290. private int[] anIntArray1191;
  12291. private Stream stream;
  12292. private int anInt1193;
  12293. public int[] anInt344 = null;
  12294. int[] offsets = null;
  12295. private int splitPrivateChat;
  12296. private Background mapBack;
  12297. private String[] menuActionName;
  12298. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  12299. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  12300. private final int[] anIntArray1203;
  12301. static final int[] anIntArray1204 = { 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145, 58654, 5027,
  12302. 1457, 16565, 34991, 25486 };
  12303. private static boolean flagged;
  12304. private final int[] anIntArray1207;
  12305. private int anInt1208;
  12306. private int minimapInt2;
  12307. private int anInt1210;
  12308. private int anInt1211;
  12309. private String promptInput;
  12310. private int anInt1213;
  12311. private int[][][] intGroundArray;
  12312. private long aLong1215;
  12313. private int loginScreenCursorPos;
  12314. private final Background[] modIcons;
  12315. private long aLong1220;
  12316. private static int tabID;
  12317. private int anInt1222;
  12318. public static boolean inputTaken;
  12319. private int inputDialogState;
  12320. private static int anInt1226;
  12321. private int nextSong;
  12322. private boolean songChanging;
  12323. private final int[] anIntArray1229;
  12324. private Class11[] aClass11Array1230;
  12325. public static int anIntArray1232[];
  12326. private boolean aBoolean1233;
  12327. private int[] anIntArray1234;
  12328. private int[] anIntArray1235;
  12329. private int[] anIntArray1236;
  12330. private int anInt1237;
  12331. private int anInt1238;
  12332. public final int anInt1239 = 100;
  12333. private final int[] anIntArray1240;
  12334. private final int[] anIntArray1241;
  12335. private boolean aBoolean1242;
  12336. private int atInventoryLoopCycle;
  12337. private int atInventoryInterface;
  12338. private int atInventoryIndex;
  12339. private int atInventoryInterfaceType;
  12340. private byte[][] aByteArrayArray1247;
  12341. private int tradeMode;
  12342. private int anInt1249;
  12343. private final int[] anIntArray1250;
  12344. private int anInt1251;
  12345. private final boolean rsAlreadyLoaded;
  12346. private int anInt1253;
  12347. private int anInt1254;
  12348. private boolean welcomeScreenRaised;
  12349. private boolean messagePromptRaised;
  12350. private int anInt1257;
  12351. private byte[][][] byteGroundArray;
  12352. private int prevSong;
  12353. private int destX;
  12354. private int destY;
  12355. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  12356. private int anInt1264;
  12357. private int anInt1265;
  12358. private String loginMessage1;
  12359. private String loginMessage2;
  12360. private int anInt1268;
  12361. private int anInt1269;
  12362. private TextDrawingArea smallText;
  12363. private TextDrawingArea aTextDrawingArea_1271;
  12364. private TextDrawingArea chatTextDrawingArea;
  12365. private int anInt1275;
  12366. private int backDialogID;
  12367. private int anInt1278;
  12368. private int anInt1279;
  12369. private int[] bigX;
  12370. private int[] bigY;
  12371. private int itemSelected;
  12372. private int anInt1283;
  12373. private int anInt1284;
  12374. private int anInt1285;
  12375. private String selectedItemName;
  12376. private int publicChatMode;
  12377. private static int anInt1288;
  12378. private int anInt1289;
  12379. public static int anInt1290;
  12380. public static String server = "";
  12381. public int drawCount;
  12382. public int fullscreenInterfaceID;
  12383. public int anInt1044;// 377
  12384. public int anInt1129;// 377
  12385. public int anInt1315;// 377
  12386. public int anInt1500;// 377
  12387. public int anInt1501;// 377
  12388. public int[] fullScreenTextureArray;
  12389.  
  12390. public void resetAllImageProducers() {
  12391. if (super.fullGameScreen != null) {
  12392. return;
  12393. }
  12394. aGraphicsBuffer_1166 = null;
  12395. aGraphicsBuffer_1164 = null;
  12396. aGraphicsBuffer_1163 = null;
  12397. aGraphicsBuffer_1165 = null;
  12398. aGraphicsBuffer_1123 = null;
  12399. aGraphicsBuffer_1124 = null;
  12400. aGraphicsBuffer_1125 = null;
  12401. aGraphicsBuffer_1107 = null;
  12402. aGraphicsBuffer_1108 = null;
  12403. aGraphicsBuffer_1109 = null;
  12404. aGraphicsBuffer_1110 = null;
  12405. aGraphicsBuffer_1111 = null;
  12406. aGraphicsBuffer_1112 = null;
  12407. aGraphicsBuffer_1113 = null;
  12408. aGraphicsBuffer_1114 = null;
  12409. aGraphicsBuffer_1115 = null;
  12410. super.fullGameScreen = new GraphicsBuffer(765, 503);
  12411. welcomeScreenRaised = true;
  12412. }
  12413.  
  12414. public void launchURL(String url) {
  12415. String osName = System.getProperty("os.name");
  12416. try {
  12417. if (osName.startsWith("Mac OS")) {
  12418. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  12419. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] { String.class });
  12420. openURL.invoke(null, new Object[] { url });
  12421. } else if (osName.startsWith("Windows"))
  12422. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  12423. else { // assume Unix or Linux
  12424. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  12425. String browser = null;
  12426. for (int count = 0; count < browsers.length && browser == null; count++)
  12427. if (Runtime.getRuntime().exec(new String[] { "which", browsers[count] }).waitFor() == 0)
  12428. browser = browsers[count];
  12429. if (browser == null) {
  12430. throw new Exception("Could not find web browser");
  12431. } else
  12432. Runtime.getRuntime().exec(new String[] { browser, url });
  12433. }
  12434. } catch (Exception e) {
  12435. pushMessage("Failed to open URL.", 0, "");
  12436. }
  12437. }
  12438.  
  12439. static {
  12440. anIntArray1019 = new int[99];
  12441. int i = 0;
  12442. for (int j = 0; j < 99; j++) {
  12443. int l = j + 1;
  12444. int i1 = (int) ((double) l + 300D * Math.pow(2D, (double) l / 7D));
  12445. i += i1;
  12446. anIntArray1019[j] = i / 4;
  12447. }
  12448. anIntArray1232 = new int[32];
  12449. i = 2;
  12450. for (int k = 0; k < 32; k++) {
  12451. anIntArray1232[k] = i - 1;
  12452. i += i;
  12453. }
  12454. }
  12455.  
  12456. public void checkSize() {
  12457. if (clientSize == 1) {
  12458. if (clientWidth != getGameComponent().getWidth()) {
  12459. clientWidth = getGameComponent().getWidth();
  12460. gameAreaWidth = clientWidth;
  12461. method458();
  12462. }
  12463. if (clientHeight != getGameComponent().getHeight()) {
  12464. clientHeight = getGameComponent().getHeight();
  12465. gameAreaHeight = clientHeight;
  12466. method458();
  12467. }
  12468. }
  12469. }
  12470.  
  12471. public static int frameWidth = 765;
  12472. public static int frameHeight = 503;
  12473.  
  12474. private void method458() {
  12475. antialiasingPixels = new int[this.gameAreaWidth * this.gameAreaHeight << 2];
  12476. Texture.method365(this.gameAreaWidth << 1, this.gameAreaHeight << 1);
  12477. antialiasingOffsets = Texture.anIntArray1472;
  12478. Texture.method365(this.gameAreaHeight, this.gameAreaHeight);
  12479. Texture.method365(frameWidth, frameHeight);
  12480. this.fullScreenTextureArray = Texture.anIntArray1472;
  12481. Texture.method365(
  12482. clientSize == 0 ? 519
  12483. : this.aGraphicsBuffer_1166 != null ? this.aGraphicsBuffer_1166.canvasWidth : frameWidth,
  12484. clientSize == 0 ? 165
  12485. : this.aGraphicsBuffer_1166 != null ? this.aGraphicsBuffer_1166.canvasHeight : frameHeight);
  12486. anIntArray1180 = Texture.anIntArray1472;
  12487. Texture.method365(
  12488. clientSize == 0 ? 250
  12489. : this.aGraphicsBuffer_1163 != null ? this.aGraphicsBuffer_1163.canvasWidth : frameWidth,
  12490. clientSize == 0 ? 335
  12491. : this.aGraphicsBuffer_1163 != null ? this.aGraphicsBuffer_1163.canvasHeight : frameHeight);
  12492. this.anIntArray1181 = Texture.anIntArray1472;
  12493. Texture.method365(this.gameAreaWidth, this.gameAreaHeight);
  12494. this.anIntArray1182 = Texture.anIntArray1472;
  12495. method456();
  12496. }
  12497.  
  12498. public void method456() {
  12499. int[] ai = new int[9];
  12500. for (int i8 = 0; i8 < 9; i8++) {
  12501. int k8 = 128 + i8 * 32 + 15;
  12502. int l8 = 600 + k8 * 3;
  12503. int i9 = Texture.anIntArray1470[k8];
  12504. ai[i8] = (l8 * i9 >> 16);
  12505. }
  12506. if ((clientSize != 0) || (frameWidth < 766) || (frameWidth > 1025) || (frameHeight < 504)
  12507. || (frameHeight > 850)) {
  12508. if ((clientSize == 0) || (clientSize == 1)) {
  12509. }
  12510. }
  12511. WorldController.method310(500, 800, this.gameAreaWidth, this.gameAreaHeight, ai);
  12512. if (this.loggedIn) {
  12513. this.aGraphicsBuffer_1165 = new GraphicsBuffer(this.gameAreaWidth, this.gameAreaHeight);
  12514. }
  12515. }
  12516.  
  12517. public void toggleSize(int size) {
  12518. if (clientSize != size) {
  12519. if (size == 0) {
  12520. clientWidth = isWebclient() ? this.appletWidth : 765;
  12521. clientHeight = isWebclient() ? this.appletHeight : 503;
  12522. ((Jframe) this).setPreferredSize(new Dimension(clientWidth, clientHeight));
  12523. Jframe.frame.pack();
  12524. } else if (size == 1) {
  12525. clientWidth = 765;
  12526. clientHeight = 503;
  12527. ((Jframe) this).setPreferredSize(new Dimension(765, 503));
  12528. Jframe.frame.pack();
  12529. } else if (size == 2) {
  12530. clientWidth = getMaxWidth();
  12531. clientHeight = getMaxHeight() - 85;
  12532.  
  12533. Jframe.frame.setExtendedState(6);
  12534. Jframe.frame.setSize(new Dimension(getMaxWidth(), getMaxHeight()));
  12535. }
  12536. System.out.println(clientWidth + " * " + clientHeight);
  12537. rebuildFrame(size, clientWidth, clientHeight);
  12538. method458();
  12539. }
  12540. }
  12541.  
  12542. public void rebuildFrame(int size, int width, int height) {
  12543. this.gameAreaWidth = (size == 0 ? 512 : width);
  12544. this.gameAreaHeight = (size == 0 ? 334 : height);
  12545. clientWidth = width;
  12546. clientHeight = height;
  12547. instance.rebuildFrame(clientSize == 2, width, height, clientSize == 1, clientSize >= 1);
  12548. method458();
  12549. this.mouseX = (this.mouseY = -1);
  12550. }
  12551.  
  12552. public static int getMaxWidth() {
  12553. return (int) Toolkit.getDefaultToolkit().getScreenSize().getWidth();
  12554. }
  12555.  
  12556. public static int getMaxHeight() {
  12557. return (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight();
  12558. }
  12559.  
  12560. public boolean isWebclient() {
  12561. return (RSFrame == null);
  12562. }
  12563.  
  12564. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement