Guest User

Client

a guest
Dec 31st, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 372.40 KB | None | 0 0
  1. // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.kpdus.com/jad.html
  3. // Decompiler options: packimports(3)
  4.  
  5. import java.applet.AppletContext;
  6. import java.awt.*;
  7. import java.io.*;
  8. import java.math.BigInteger;
  9. import java.net.*;
  10. import java.util.zip.CRC32;
  11. import java.lang.reflect.Method;
  12. import sign.signlink;
  13. import javax.swing.*;
  14.  
  15. public class client extends RSApplet {
  16.  
  17.  
  18. public int MapX, MapY;
  19. public static int spellID = 0;
  20. public static boolean newDamage = false;
  21.  
  22. private static String intToKOrMilLongName(int i) {
  23. String s = String.valueOf(i);
  24. for(int k = s.length() - 3; k > 0; k -= 3)
  25. s = s.substring(0, k) + "," + s.substring(k);
  26.  
  27. //if(j != 0)
  28. // aBoolean1224 = !aBoolean1224;
  29. if(s.length() > 8)
  30. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  31. else
  32. if(s.length() > 4)
  33. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  34. return " " + s;
  35. }
  36. public final String methodR(/*int i,*/ int j)
  37. {
  38. //if(i <= 0)
  39. // pktType = inStream.readUnsignedByte();
  40. if(j >= 0 && j < 10000)
  41. return String.valueOf(j);
  42. if(j >= 10000 && j < 10000000)
  43. return j / 1000 + "K";
  44. if(j >= 10000000 && j < 999999999)
  45. return j / 1000000 + "M";
  46. if(j >= 999999999)
  47. return "*";
  48. else
  49. return "?";
  50. }
  51.  
  52. public static final byte[] ReadFile(String s) {
  53. try {
  54. byte abyte0[];
  55. File file = new File(s);
  56. int i = (int)file.length();
  57. abyte0 = new byte[i];
  58. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  59. datainputstream.readFully(abyte0, 0, i);
  60. datainputstream.close();
  61. return abyte0;
  62. } catch(Exception e) {
  63. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  64. return null;
  65. }
  66. }
  67.  
  68. public void models() {
  69. for(int ModelIndex = 0; ModelIndex < 29191; ModelIndex++) {
  70. byte[] abyte0 = getModel(ModelIndex);
  71. if(abyte0 != null && abyte0.length > 0) {
  72. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  73. pushMessage("Model added successfully!", 0, "");
  74. }
  75. }
  76. }
  77. public byte[] getModel(int Index) {
  78. try {
  79. File Model = new File("./Raw/"+Index+".dat");
  80. byte[] aByte = new byte[(int)Model.length()];
  81. FileInputStream fis = new FileInputStream(Model);
  82. fis.read(aByte);
  83. pushMessage("aByte = ["+aByte+"]!", 0, "");
  84. fis.close();
  85. return aByte;
  86. }
  87. catch(Exception e)
  88. {return null;}
  89. }
  90.  
  91. private void stopMidi() {
  92. signlink.midifade = 0;
  93. signlink.midi = "stop";
  94. }
  95.  
  96. private boolean menuHasAddFriend(int j) {
  97. if(j < 0)
  98. return false;
  99. int k = menuActionID[j];
  100. if(k >= 2000)
  101. k -= 2000;
  102. return k == 337;
  103. }
  104.  
  105. public void drawChannelButtons() {
  106. String text[] = { "On", "Friends", "Off", "Hide" };
  107. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  108. switch(cButtonCPos) {
  109. case 0:
  110. chatButtons[1].drawSprite(5, 142);
  111. break;
  112. case 1:
  113. chatButtons[1].drawSprite(71, 142);
  114. break;
  115. case 2:
  116. chatButtons[1].drawSprite(137, 142);
  117. break;
  118. case 3:
  119. chatButtons[1].drawSprite(203, 142);
  120. break;
  121. case 4:
  122. chatButtons[1].drawSprite(269, 142);
  123. break;
  124. case 5:
  125. chatButtons[1].drawSprite(335, 142);
  126. break;
  127. }
  128. if(cButtonHPos == cButtonCPos) {
  129. switch(cButtonHPos) {
  130. case 0:
  131. chatButtons[2].drawSprite(5, 142);
  132. break;
  133. case 1:
  134. chatButtons[2].drawSprite(71, 142);
  135. break;
  136. case 2:
  137. chatButtons[2].drawSprite(137, 142);
  138. break;
  139. case 3:
  140. chatButtons[2].drawSprite(203, 142);
  141. break;
  142. case 4:
  143. chatButtons[2].drawSprite(269, 142);
  144. break;
  145. case 5:
  146. chatButtons[2].drawSprite(335, 142);
  147. break;
  148. case 6:
  149. chatButtons[3].drawSprite(404, 142);
  150. break;
  151. }
  152. } else {
  153. switch(cButtonHPos) {
  154. case 0:
  155. chatButtons[0].drawSprite(5, 142);
  156. break;
  157. case 1:
  158. chatButtons[0].drawSprite(71, 142);
  159. break;
  160. case 2:
  161. chatButtons[0].drawSprite(137, 142);
  162. break;
  163. case 3:
  164. chatButtons[0].drawSprite(203, 142);
  165. break;
  166. case 4:
  167. chatButtons[0].drawSprite(269, 142);
  168. break;
  169. case 5:
  170. chatButtons[0].drawSprite(335, 142);
  171. break;
  172. case 6:
  173. chatButtons[3].drawSprite(404, 142);
  174. break;
  175. }
  176. }
  177. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
  178. smallText.method389(true, 26, 0xffffff, "All", 157);
  179. smallText.method389(true, 86, 0xffffff, "Game", 157);
  180. smallText.method389(true, 150, 0xffffff, "Public", 152);
  181. smallText.method389(true, 212, 0xffffff, "Private", 152);
  182. smallText.method389(true, 286, 0xffffff, "Clan", 152);
  183. smallText.method389(true, 349, 0xffffff, "Trade", 152);
  184. smallText.method382(textColor[publicChatMode], 164, text[publicChatMode], 163, true);
  185. smallText.method382(textColor[privateChatMode], 230, text[privateChatMode], 163, true);
  186. smallText.method382(textColor[clanChatMode], 296, text[clanChatMode], 163, true);
  187. smallText.method382(textColor[tradeMode], 362, text[tradeMode], 163, true);
  188. }
  189.  
  190. private void drawChatArea() {
  191. aRSImageProducer_1166.initDrawingArea();
  192. Texture.anIntArray1472 = anIntArray1180;
  193. chatArea.drawSprite(0, 0);
  194. drawChannelButtons();
  195. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  196. if(messagePromptRaised) {
  197. chatTextDrawingArea.drawText(0, aString1121, 60, 259);
  198. chatTextDrawingArea.drawText(128, promptInput + "*", 80, 259);
  199. } else if(inputDialogState == 1) {
  200. chatTextDrawingArea.drawText(0, "Enter amount:", 60, 259);
  201. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  202. } else if(inputDialogState == 2) {
  203. chatTextDrawingArea.drawText(0, "Enter name:", 60, 259);
  204. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  205. } else if(aString844 != null) {
  206. chatTextDrawingArea.drawText(0, aString844, 60, 259);
  207. chatTextDrawingArea.drawText(128, "Click to continue", 80, 259);
  208. } else if(backDialogID != -1) {
  209. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  210. } else if(dialogID != -1) {
  211. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  212. } else {
  213. int j77 = -3;
  214. int j = 0;
  215. DrawingArea.setDrawingArea(122, 8, 497, 7);
  216. for(int k = 0; k < 500; k++)
  217. if(chatMessages[k] != null) {
  218. int chatType = chatTypes[k];
  219. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  220. String s1 = chatNames[k];
  221. byte byte0 = 0;
  222. if(s1 != null && s1.startsWith("@cr1@")) {
  223. s1 = s1.substring(5);
  224. byte0 = 1;
  225. } else if(s1 != null && s1.startsWith("@cr2@")) {
  226. s1 = s1.substring(5);
  227. byte0 = 2;
  228. } else if(s1 != null && s1.startsWith("@cr3@")) {
  229. s1 = s1.substring(5);
  230. byte0 = 3;
  231. }
  232. if(chatType == 0) {
  233. if (chatTypeView == 5 || chatTypeView == 0) {
  234. if(yPos > 0 && yPos < 210)
  235. textDrawingArea.method389(false, 11, 0, chatMessages[k], yPos);//chat color enabled
  236. j++;
  237. j77++;
  238. }
  239. }
  240. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  241. if (chatTypeView == 1 || chatTypeView == 0) {
  242. if(yPos > 0 && yPos < 210) {
  243. int xPos = 11;
  244. if(byte0 == 1) {
  245. modIcons[0].drawBackground(xPos + 1, yPos - 12);
  246. xPos += 14;
  247. } else if(byte0 == 2) {
  248. modIcons[1].drawBackground(xPos + 1, yPos - 12);
  249. xPos += 14;
  250. } else if(byte0 == 3) {
  251. modIcons[2].drawBackground(xPos + 1, yPos - 12);
  252. xPos += 14;
  253. }
  254. textDrawingArea.method385(0, s1 + ":", yPos, xPos);
  255. xPos += textDrawingArea.getTextWidth(s1) + 8;
  256. textDrawingArea.method389(false, xPos, 255, chatMessages[k], yPos);
  257. }
  258. j++;
  259. j77++;
  260. }
  261. }
  262. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  263. if (chatTypeView == 2 || chatTypeView == 0) {
  264. if(yPos > 0 && yPos < 210) {
  265. int k1 = 11;
  266. textDrawingArea.method385(0, "From", yPos, k1);
  267. k1 += textDrawingArea.getTextWidth("From ");
  268. if(byte0 == 1) {
  269. modIcons[0].drawBackground(k1, yPos - 12);
  270. k1 += 12;
  271. } else if(byte0 == 2) {
  272. modIcons[1].drawBackground(k1, yPos - 12);
  273. k1 += 12;
  274. } else if(byte0 == 3) {
  275. modIcons[2].drawBackground(k1, yPos - 12);
  276. k1 += 12;
  277. }
  278. textDrawingArea.method385(0, s1 + ":", yPos, k1);
  279. k1 += textDrawingArea.getTextWidth(s1) + 8;
  280. textDrawingArea.method385(0x800000, chatMessages[k], yPos, k1);
  281. }
  282. j++;
  283. j77++;
  284. }
  285. }
  286. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  287. if (chatTypeView == 3 || chatTypeView == 0) {
  288. if(yPos > 0 && yPos < 210)
  289. textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], yPos, 11);
  290. j++;
  291. j77++;
  292. }
  293. }
  294. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  295. if (chatTypeView == 2 || chatTypeView == 0) {
  296. if(yPos > 0 && yPos < 210)
  297. textDrawingArea.method385(0x800000, chatMessages[k], yPos, 11);
  298. j++;
  299. j77++;
  300. }
  301. }
  302. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  303. if (chatTypeView == 2 || chatTypeView == 0) {
  304. if(yPos > 0 && yPos < 210) {
  305. textDrawingArea.method385(0, "To " + s1 + ":", yPos, 11);
  306. textDrawingArea.method385(0x800000, chatMessages[k], yPos, 15 + textDrawingArea.getTextWidth("To :" + s1));
  307. }
  308. j++;
  309. j77++;
  310. }
  311. }
  312. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  313. if (chatTypeView == 3 || chatTypeView == 0) {
  314. if(yPos > 0 && yPos < 210)
  315. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  316. j++;
  317. j77++;
  318. }
  319. if(chatType == 11 && (clanChatMode == 0)) {
  320. if (chatTypeView == 11) {
  321. if(yPos > 0 && yPos < 210)
  322. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  323. j++;
  324. j77++;
  325. }
  326. if(chatType == 12) {
  327. if(yPos > 0 && yPos < 110)
  328. textDrawingArea.method385(0x7e3200, chatMessages[k] + " @blu@" + s1, yPos, 11);
  329. j++;
  330. }
  331. }
  332. }
  333. if(chatType == 16) {
  334. int j2 = 40;
  335. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  336. if(chatTypeView == 11 || chatTypeView == 0) {
  337. if(yPos > 3 && yPos < 130)
  338. switch(chatRights[k]) {
  339. case 1:
  340. j2 += clanNameWidth;
  341. modIcons[0].drawBackground(j2 - 18, yPos - 12);
  342. j2 += 14;
  343. break;
  344.  
  345. case 2:
  346. j2 += clanNameWidth;
  347. modIcons[1].drawBackground(j2 - 18, yPos - 12);
  348. j2 += 14;
  349. break;
  350.  
  351. case 3:
  352. j2 += clanNameWidth;
  353. modIcons[1].drawBackground(j2 - 18, yPos - 12);
  354. j2 += 14;
  355. break;
  356.  
  357. default:
  358. j2 += clanNameWidth;
  359. break;
  360. }
  361. textDrawingArea.method385(0, "[", yPos, 8);
  362. textDrawingArea.method385(255, ""+clanname+"", yPos, 14);
  363. textDrawingArea.method385(0, "]", yPos, clanNameWidth + 14);
  364.  
  365. textDrawingArea.method385(0, chatNames[k]+":", yPos, j2 - 17); //j2
  366. j2 += textDrawingArea.getTextWidth(chatNames[k]) + 7;
  367. textDrawingArea.method385(0x800000, chatMessages[k], yPos, j2 - 16);//j2
  368. j++;
  369. j77++;
  370. }
  371. }
  372. }
  373. DrawingArea.defaultDrawingAreaSize();
  374. anInt1211 = j * 14 + 7 + 5;
  375. if(anInt1211 < 111)
  376. anInt1211 = 111;
  377. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  378. String s;
  379. if(myPlayer != null && myPlayer.name != null)
  380. s = myPlayer.name;
  381. else
  382. s = TextClass.fixName(myUsername);
  383. textDrawingArea.method385(0, s + ":", 133, 11);
  384. textDrawingArea.drawChatInput(255, 12 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false);
  385. DrawingArea.method339(121, 0x807660, 506, 7);
  386. }
  387. if(menuOpen && menuScreenArea == 2) {
  388. drawMenu();
  389. }
  390. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  391. aRSImageProducer_1165.initDrawingArea();
  392. Texture.anIntArray1472 = anIntArray1182;
  393. }
  394.  
  395. public void init() {
  396. nodeID = 10;
  397. portOff = 0;
  398. setHighMem();
  399. isMembers = true;
  400. initClientFrame(503, 765);
  401. }
  402.  
  403. public void startRunnable(Runnable runnable, int i) {
  404. if(i > 10)
  405. i = 10;
  406. if(signlink.mainapp != null) {
  407. signlink.startthread(runnable, i);
  408. } else {
  409. super.startRunnable(runnable, i);
  410. }
  411. }
  412.  
  413. public Socket openSocket(int port) throws IOException {
  414. return new Socket(InetAddress.getByName(server), port);
  415. }
  416.  
  417. private void processMenuClick() {
  418. if(activeInterfaceType != 0)
  419. return;
  420. int j = super.clickMode3;
  421. if(spellSelected == 1 && super.saveClickX >= 516 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  422. j = 0;
  423. if(menuOpen) {
  424. if(j != 1) {
  425. int k = super.mouseX;
  426. int j1 = super.mouseY;
  427. if(menuScreenArea == 0) {
  428. k -= 4;
  429. j1 -= 4;
  430. }
  431. if(menuScreenArea == 1) {
  432. k -= 519;
  433. j1 -= 168;
  434. }
  435. if(menuScreenArea == 2) {
  436. k -= 17;
  437. j1 -= 338;
  438. }
  439. if(menuScreenArea == 3) {
  440. k -= 519;
  441. j1 -= 0;
  442. }
  443. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  444. menuOpen = false;
  445. if(menuScreenArea == 1)
  446. needDrawTabArea = true;
  447. if(menuScreenArea == 2)
  448. inputTaken = true;
  449. }
  450. }
  451. if(j == 1) {
  452. int l = menuOffsetX;
  453. int k1 = menuOffsetY;
  454. int i2 = menuWidth;
  455. int k2 = super.saveClickX;
  456. int l2 = super.saveClickY;
  457. if(menuScreenArea == 0) {
  458. k2 -= 4;
  459. l2 -= 4;
  460. }
  461. if(menuScreenArea == 1) {
  462. k2 -= 519;
  463. l2 -= 168;
  464. }
  465. if(menuScreenArea == 2) {
  466. k2 -= 17;
  467. l2 -= 338;
  468. }
  469. if(menuScreenArea == 3) {
  470. k2 -= 519;
  471. l2 -= 0;
  472. }
  473. int i3 = -1;
  474. for(int j3 = 0; j3 < menuActionRow; j3++) {
  475. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  476. if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  477. i3 = j3;
  478. }
  479. System.out.println(i3);
  480. if(i3 != -1)
  481. doAction(i3);
  482. menuOpen = false;
  483. if(menuScreenArea == 1)
  484. needDrawTabArea = true;
  485. if(menuScreenArea == 2) {
  486. inputTaken = true;
  487. }
  488. }
  489. } else {
  490. if(j == 1 && menuActionRow > 0) {
  491. int i1 = menuActionID[menuActionRow - 1];
  492. if(i1 == 632 || i1 == 78 || i1 == 867 || i1 == 431 || i1 == 53 || i1 == 74 || i1 == 454 || i1 == 539 || i1 == 493 || i1 == 847 || i1 == 447 || i1 == 1125) {
  493. int l1 = menuActionCmd2[menuActionRow - 1];
  494. int j2 = menuActionCmd3[menuActionRow - 1];
  495. RSInterface class9 = RSInterface.interfaceCache[j2];
  496. if(class9.aBoolean259 || class9.aBoolean235) {
  497. aBoolean1242 = false;
  498. anInt989 = 0;
  499. anInt1084 = j2;
  500. anInt1085 = l1;
  501. activeInterfaceType = 2;
  502. anInt1087 = super.saveClickX;
  503. anInt1088 = super.saveClickY;
  504. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  505. activeInterfaceType = 1;
  506. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  507. activeInterfaceType = 3;
  508. return;
  509. }
  510. }
  511. }
  512. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  513. j = 2;
  514. if(j == 1 && menuActionRow > 0)
  515. doAction(menuActionRow - 1);
  516. if(j == 2 && menuActionRow > 0)
  517. determineMenuSize();
  518. }
  519. }
  520.  
  521.  
  522. public static int totalRead = 0;
  523.  
  524. public static String getFileNameWithoutExtension(String fileName) {
  525. File tmpFile = new File(fileName);
  526. tmpFile.getName();
  527. int whereDot = tmpFile.getName().lastIndexOf('.');
  528. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2 ) {
  529. return tmpFile.getName().substring(0, whereDot);
  530. }
  531. return "";
  532. }
  533.  
  534. public void preloadModels() {
  535. File file = new File("./Raw/");
  536. File[] fileArray = file.listFiles();
  537. for(int y = 0; y < fileArray.length; y++) {
  538. String s = fileArray[y].getName();
  539. byte[] buffer = ReadFile("./Raw/"+s);
  540. Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
  541. }
  542. }
  543.  
  544.  
  545.  
  546. private void saveMidi(boolean flag, byte abyte0[])
  547. {
  548. signlink.midifade = flag ? 1 : 0;
  549. signlink.midisave(abyte0, abyte0.length);
  550. }
  551.  
  552. private void method22()
  553. {
  554. try
  555. {
  556. anInt985 = -1;
  557. aClass19_1056.removeAll();
  558. aClass19_1013.removeAll();
  559. Texture.method366();
  560. unlinkMRUNodes();
  561. worldController.initToNull();
  562. System.gc();
  563. for(int i = 0; i < 4; i++)
  564. aClass11Array1230[i].method210();
  565.  
  566. for(int l = 0; l < 4; l++)
  567. {
  568. for(int k1 = 0; k1 < 104; k1++)
  569. {
  570. for(int j2 = 0; j2 < 104; j2++)
  571. byteGroundArray[l][k1][j2] = 0;
  572.  
  573. }
  574.  
  575. }
  576.  
  577. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  578. int k2 = aByteArrayArray1183.length;
  579. stream.createFrame(0);
  580. if(!aBoolean1159)
  581. {
  582. for(int i3 = 0; i3 < k2; i3++)
  583. {
  584. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  585. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  586. byte abyte0[] = aByteArrayArray1183[i3];
  587. if (FileOperations.FileExists(signlink.findcachedir()+"maps/"+anIntArray1235[i3]+".dat"))
  588. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"maps/"+anIntArray1235[i3]+".dat");
  589. if(abyte0 != null)
  590. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  591. }
  592.  
  593. for(int j4 = 0; j4 < k2; j4++)
  594. {
  595. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  596. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  597. byte abyte2[] = aByteArrayArray1183[j4];
  598. if(abyte2 == null && anInt1070 < 800)
  599. objectManager.method174(k7, 64, 64, l5);
  600. }
  601.  
  602. anInt1097++;
  603. if(anInt1097 > 160)
  604. {
  605. anInt1097 = 0;
  606. stream.createFrame(238);
  607. stream.writeWordBigEndian(96);
  608. }
  609. stream.createFrame(0);
  610. for(int i6 = 0; i6 < k2; i6++)
  611. {
  612. byte abyte1[] = aByteArrayArray1247[i6];
  613. if(abyte1 != null)
  614. {
  615. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  616. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  617. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  618. }
  619. }
  620.  
  621. }
  622. if(aBoolean1159)
  623. {
  624. for(int j3 = 0; j3 < 4; j3++)
  625. {
  626. for(int k4 = 0; k4 < 13; k4++)
  627. {
  628. for(int j6 = 0; j6 < 13; j6++)
  629. {
  630. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  631. if(l7 != -1)
  632. {
  633. int i9 = l7 >> 24 & 3;
  634. int l9 = l7 >> 1 & 3;
  635. int j10 = l7 >> 14 & 0x3ff;
  636. int l10 = l7 >> 3 & 0x7ff;
  637. int j11 = (j10 / 8 << 8) + l10 / 8;
  638. for(int l11 = 0; l11 < anIntArray1234.length; l11++)
  639. {
  640. if(anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  641. continue;
  642. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  643. break;
  644. }
  645.  
  646. }
  647. }
  648.  
  649. }
  650.  
  651. }
  652.  
  653. for(int l4 = 0; l4 < 13; l4++)
  654. {
  655. for(int k6 = 0; k6 < 13; k6++)
  656. {
  657. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  658. if(i8 == -1)
  659. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  660. }
  661.  
  662. }
  663.  
  664. stream.createFrame(0);
  665. for(int l6 = 0; l6 < 4; l6++)
  666. {
  667. for(int j8 = 0; j8 < 13; j8++)
  668. {
  669. for(int j9 = 0; j9 < 13; j9++)
  670. {
  671. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  672. if(i10 != -1)
  673. {
  674. int k10 = i10 >> 24 & 3;
  675. int i11 = i10 >> 1 & 3;
  676. int k11 = i10 >> 14 & 0x3ff;
  677. int i12 = i10 >> 3 & 0x7ff;
  678. int j12 = (k11 / 8 << 8) + i12 / 8;
  679. for(int k12 = 0; k12 < anIntArray1234.length; k12++)
  680. {
  681. if(anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  682. continue;
  683. //objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  684. byte abyte0[] = aByteArrayArray1247[k12];
  685. if (FileOperations.FileExists(signlink.findcachedir()+"maps/"+anIntArray1235[k12]+".dat"))
  686. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"maps/"+anIntArray1235[k12]+".dat");
  687. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  688. break;
  689. }
  690.  
  691. }
  692. }
  693.  
  694. }
  695.  
  696. }
  697.  
  698. }
  699. stream.createFrame(0);
  700. objectManager.method171(aClass11Array1230, worldController);
  701. aRSImageProducer_1165.initDrawingArea();
  702. stream.createFrame(0);
  703. int k3 = ObjectManager.anInt145;
  704. if(k3 > plane)
  705. k3 = plane;
  706. if(k3 < plane - 1)
  707. k3 = plane - 1;
  708. if(lowMem)
  709. worldController.method275(ObjectManager.anInt145);
  710. else
  711. worldController.method275(0);
  712. for(int i5 = 0; i5 < 104; i5++)
  713. {
  714. for(int i7 = 0; i7 < 104; i7++)
  715. spawnGroundItem(i5, i7);
  716.  
  717. }
  718.  
  719. anInt1051++;
  720. if(anInt1051 > 98)
  721. {
  722. anInt1051 = 0;
  723. stream.createFrame(150);
  724. }
  725. method63();
  726. }
  727. catch(Exception exception) { }
  728. ObjectDef.mruNodes1.unlinkAll();
  729. if(super.gameFrame != null)
  730. {
  731. stream.createFrame(210);
  732. stream.writeDWord(0x3f008edd);
  733. }
  734. if(lowMem && signlink.cache_dat != null)
  735. {
  736. int j = onDemandFetcher.getVersionCount(0);
  737. for(int i1 = 0; i1 < j; i1++)
  738. {
  739. int l1 = onDemandFetcher.getModelIndex(i1);
  740. if((l1 & 0x79) == 0)
  741. Model.method461(i1);
  742. }
  743.  
  744. }
  745. System.gc();
  746. Texture.method367();
  747. onDemandFetcher.method566();
  748. int k = (anInt1069 - 6) / 8 - 1;
  749. int j1 = (anInt1069 + 6) / 8 + 1;
  750. int i2 = (anInt1070 - 6) / 8 - 1;
  751. int l2 = (anInt1070 + 6) / 8 + 1;
  752. if(aBoolean1141)
  753. {
  754. k = 49;
  755. j1 = 50;
  756. i2 = 49;
  757. l2 = 50;
  758. }
  759. for(int l3 = k; l3 <= j1; l3++)
  760. {
  761. for(int j5 = i2; j5 <= l2; j5++)
  762. if(l3 == k || l3 == j1 || j5 == i2 || j5 == l2)
  763. {
  764. int j7 = onDemandFetcher.method562(0, j5, l3);
  765. if(j7 != -1)
  766. onDemandFetcher.method560(j7, 3);
  767. int k8 = onDemandFetcher.method562(1, j5, l3);
  768. if(k8 != -1)
  769. onDemandFetcher.method560(k8, 3);
  770. }
  771.  
  772. }
  773.  
  774. }
  775.  
  776. private void unlinkMRUNodes()
  777. {
  778. ObjectDef.mruNodes1.unlinkAll();
  779. ObjectDef.mruNodes2.unlinkAll();
  780. EntityDef.mruNodes.unlinkAll();
  781. ItemDef.mruNodes2.unlinkAll();
  782. ItemDef.mruNodes1.unlinkAll();
  783. Player.mruNodes.unlinkAll();
  784. SpotAnim.aMRUNodes_415.unlinkAll();
  785. }
  786.  
  787. private void method24(int i)
  788. {
  789. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  790. int j = ai.length;
  791. for(int k = 0; k < j; k++)
  792. ai[k] = 0;
  793.  
  794. for(int l = 1; l < 103; l++)
  795. {
  796. int i1 = 24628 + (103 - l) * 512 * 4;
  797. for(int k1 = 1; k1 < 103; k1++)
  798. {
  799. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  800. worldController.method309(ai, i1, i, k1, l);
  801. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  802. worldController.method309(ai, i1, i + 1, k1, l);
  803. i1 += 4;
  804. }
  805.  
  806. }
  807.  
  808. int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  809. int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  810. aClass30_Sub2_Sub1_Sub1_1263.method343();
  811. for(int i2 = 1; i2 < 103; i2++)
  812. {
  813. for(int j2 = 1; j2 < 103; j2++)
  814. {
  815. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  816. method50(i2, j1, j2, l1, i);
  817. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  818. method50(i2, j1, j2, l1, i + 1);
  819. }
  820.  
  821. }
  822.  
  823. aRSImageProducer_1165.initDrawingArea();
  824. anInt1071 = 0;
  825. for(int k2 = 0; k2 < 104; k2++)
  826. {
  827. for(int l2 = 0; l2 < 104; l2++)
  828. {
  829. int i3 = worldController.method303(plane, k2, l2);
  830. if(i3 != 0)
  831. {
  832. i3 = i3 >> 14 & 0x7fff;
  833. int j3 = ObjectDef.forID(i3).anInt746;
  834. if(j3 >= 0)
  835. {
  836. int k3 = k2;
  837. int l3 = l2;
  838. if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  839. {
  840. byte byte0 = 104;
  841. byte byte1 = 104;
  842. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  843. for(int i4 = 0; i4 < 10; i4++)
  844. {
  845. int j4 = (int)(Math.random() * 4D);
  846. if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  847. k3--;
  848. if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  849. k3++;
  850. if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  851. l3--;
  852. if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  853. l3++;
  854. }
  855.  
  856. }
  857. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  858. anIntArray1072[anInt1071] = k3;
  859. anIntArray1073[anInt1071] = l3;
  860. anInt1071++;
  861. }
  862. }
  863. }
  864.  
  865. }
  866.  
  867. }
  868.  
  869. private void spawnGroundItem(int i, int j)
  870. {
  871. NodeList class19 = groundArray[plane][i][j];
  872. if(class19 == null)
  873. {
  874. worldController.method295(plane, i, j);
  875. return;
  876. }
  877. int k = 0xfa0a1f01;
  878. Object obj = null;
  879. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  880. {
  881. ItemDef itemDef = ItemDef.forID(item.ID);
  882. int l = itemDef.value;
  883. if(itemDef.stackable)
  884. l *= item.anInt1559 + 1;
  885. // notifyItemSpawn(item, i + baseX, j + baseY);
  886.  
  887. if(l > k)
  888. {
  889. k = l;
  890. obj = item;
  891. }
  892. }
  893.  
  894. class19.insertTail(((Node) (obj)));
  895. Object obj1 = null;
  896. Object obj2 = null;
  897. for(Item class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetNext())
  898. {
  899. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  900. obj1 = class30_sub2_sub4_sub2_1;
  901. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  902. obj2 = class30_sub2_sub4_sub2_1;
  903. }
  904.  
  905. int i1 = i + (j << 7) + 0x60000000;
  906. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  907. }
  908.  
  909. private void method26(boolean flag)
  910. {
  911. for(int j = 0; j < npcCount; j++)
  912. {
  913. NPC npc = npcArray[npcIndices[j]];
  914. int k = 0x20000000 + (npcIndices[j] << 14);
  915. if(npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  916. continue;
  917. int l = npc.x >> 7;
  918. int i1 = npc.y >> 7;
  919. if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  920. continue;
  921. if(npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  922. {
  923. if(anIntArrayArray929[l][i1] == anInt1265)
  924. continue;
  925. anIntArrayArray929[l][i1] = anInt1265;
  926. }
  927. if(!npc.desc.aBoolean84)
  928. k += 0x80000000;
  929. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  930. }
  931. }
  932.  
  933. private boolean replayWave()
  934. {
  935. return signlink.wavereplay();
  936. }
  937.  
  938. private void loadError()
  939. {
  940. String s = "ondemand";//was a constant parameter
  941. System.out.println(s);
  942. try
  943. {
  944. getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
  945. }
  946. catch(Exception exception)
  947. {
  948. exception.printStackTrace();
  949. }
  950. do
  951. try
  952. {
  953. Thread.sleep(1000L);
  954. }
  955. catch(Exception _ex) { }
  956. while(true);
  957. }
  958.  
  959. public void drawHoverBox(int xPos, int yPos, String text) {
  960. String[] results = text.split("\n");
  961. int height = (results.length * 16) + 6;
  962. int width;
  963. width = chatTextDrawingArea.getTextWidth(results[0]) + 6;
  964. for(int i = 1; i < results.length; i++)
  965. if(width <= chatTextDrawingArea.getTextWidth(results[i]) + 6)
  966. width = chatTextDrawingArea.getTextWidth(results[i]) + 6;
  967. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  968. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  969. yPos += 14;
  970. for(int i = 0; i < results.length; i++) {
  971. chatTextDrawingArea.method389(false, xPos + 3, 0, results[i], yPos);
  972. yPos += 16;
  973. }
  974. }
  975.  
  976. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
  977. {
  978. if(class9.type != 0 || class9.children == null || class9.isMouseoverTriggered)
  979. return;
  980. if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  981. return;
  982. int k1 = class9.children.length;
  983. for(int l1 = 0; l1 < k1; l1++)
  984. {
  985. int i2 = class9.childX[l1] + i;
  986. int j2 = (class9.childY[l1] + l) - j1;
  987. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  988. i2 += class9_1.anInt263;
  989. j2 += class9_1.anInt265;
  990. if((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  991. if(class9_1.mOverInterToTrigger >= 0)
  992. anInt886 = class9_1.mOverInterToTrigger;
  993. else
  994. anInt886 = class9_1.id;
  995. if (class9_1.type == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  996. anInt1315 = class9_1.id;
  997. }
  998. if(class9_1.type == 0)
  999. {
  1000. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1001. if(class9_1.scrollMax > class9_1.height)
  1002. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1003. } else
  1004. {
  1005. if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1006. {
  1007. boolean flag = false;
  1008. if(class9_1.contentType != 0)
  1009. flag = buildFriendsListMenu(class9_1);
  1010. if(!flag)
  1011. {
  1012. //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1013. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1014. menuActionID[menuActionRow] = 315;
  1015. menuActionCmd3[menuActionRow] = class9_1.id;
  1016. menuActionRow++;
  1017. }
  1018. }
  1019. if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1020. {
  1021. String s = class9_1.selectedActionName;
  1022. if(s.indexOf(" ") != -1)
  1023. s = s.substring(0, s.indexOf(" "));
  1024. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1025. menuActionID[menuActionRow] = 626;
  1026. menuActionCmd3[menuActionRow] = class9_1.id;
  1027. menuActionRow++;
  1028. }
  1029. if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1030. {
  1031. menuActionName[menuActionRow] = "Close";
  1032. menuActionID[menuActionRow] = 200;
  1033. menuActionCmd3[menuActionRow] = class9_1.id;
  1034. menuActionRow++;
  1035. }
  1036. if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1037. {
  1038. //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1039. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1040. menuActionID[menuActionRow] = 169;
  1041. menuActionCmd3[menuActionRow] = class9_1.id;
  1042. menuActionRow++;
  1043. if (class9_1.hoverText != null) {
  1044. //drawHoverBox(k, l, class9_1.hoverText);
  1045. //System.out.println("DRAWING INTERFACE: " + class9_1.hoverText);
  1046. }
  1047. }
  1048. if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1049. {
  1050. //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1051. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1052. menuActionID[menuActionRow] = 646;
  1053. menuActionCmd3[menuActionRow] = class9_1.id;
  1054. menuActionRow++;
  1055. }
  1056. if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1057. {
  1058. //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1059. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1060. menuActionID[menuActionRow] = 679;
  1061. menuActionCmd3[menuActionRow] = class9_1.id;
  1062. menuActionRow++;
  1063. }
  1064. if(class9_1.type == 2)
  1065. {
  1066. int k2 = 0;
  1067. for(int l2 = 0; l2 < class9_1.height; l2++)
  1068. {
  1069. for(int i3 = 0; i3 < class9_1.width; i3++)
  1070. {
  1071. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1072. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1073. if(k2 < 20)
  1074. {
  1075. j3 += class9_1.spritesX[k2];
  1076. k3 += class9_1.spritesY[k2];
  1077. }
  1078. if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  1079. {
  1080. mouseInvInterfaceIndex = k2;
  1081. lastActiveInvInterface = class9_1.id;
  1082. if(class9_1.inv[k2] > 0)
  1083. {
  1084. ItemDef itemDef = ItemDef.forID(class9_1.inv[k2] - 1);
  1085. if(itemSelected == 1 && class9_1.isInventoryInterface)
  1086. {
  1087. if(class9_1.id != anInt1284 || k2 != anInt1283)
  1088. {
  1089. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  1090. menuActionID[menuActionRow] = 870;
  1091. menuActionCmd1[menuActionRow] = itemDef.id;
  1092. menuActionCmd2[menuActionRow] = k2;
  1093. menuActionCmd3[menuActionRow] = class9_1.id;
  1094. menuActionRow++;
  1095. }
  1096. } else
  1097. if(spellSelected == 1 && class9_1.isInventoryInterface)
  1098. {
  1099. if((spellUsableOn & 0x10) == 16)
  1100. {
  1101. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1102. menuActionID[menuActionRow] = 543;
  1103. menuActionCmd1[menuActionRow] = itemDef.id;
  1104. menuActionCmd2[menuActionRow] = k2;
  1105. menuActionCmd3[menuActionRow] = class9_1.id;
  1106. menuActionRow++;
  1107. }
  1108. } else
  1109. {
  1110. if(class9_1.isInventoryInterface)
  1111. {
  1112. for(int l3 = 4; l3 >= 3; l3--)
  1113. if(itemDef.actions != null && itemDef.actions[l3] != null)
  1114. {
  1115. menuActionName[menuActionRow] = itemDef.actions[l3] + " @lre@" + 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
  1125. if(l3 == 4)
  1126. {
  1127. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1128. menuActionID[menuActionRow] = 847;
  1129. menuActionCmd1[menuActionRow] = itemDef.id;
  1130. menuActionCmd2[menuActionRow] = k2;
  1131. menuActionCmd3[menuActionRow] = class9_1.id;
  1132. menuActionRow++;
  1133. }
  1134.  
  1135. }
  1136. if(class9_1.usableItemInterface)
  1137. {
  1138. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1139. menuActionID[menuActionRow] = 447;
  1140. menuActionCmd1[menuActionRow] = itemDef.id;
  1141. //k2 = inventory spot
  1142. //System.out.println(k2);
  1143. menuActionCmd2[menuActionRow] = k2;
  1144. menuActionCmd3[menuActionRow] = class9_1.id;
  1145. menuActionRow++;
  1146. }
  1147. if(class9_1.isInventoryInterface && itemDef.actions != null)
  1148. {
  1149. for(int i4 = 2; i4 >= 0; i4--)
  1150. if(itemDef.actions[i4] != null)
  1151. {
  1152. menuActionName[menuActionRow] = itemDef.actions[i4] + " @lre@" + itemDef.name;
  1153. if(i4 == 0)
  1154. menuActionID[menuActionRow] = 74;
  1155. if(i4 == 1)
  1156. menuActionID[menuActionRow] = 454;
  1157. if(i4 == 2)
  1158. menuActionID[menuActionRow] = 539;
  1159. menuActionCmd1[menuActionRow] = itemDef.id;
  1160. menuActionCmd2[menuActionRow] = k2;
  1161. menuActionCmd3[menuActionRow] = class9_1.id;
  1162. menuActionRow++;
  1163. }
  1164.  
  1165. }
  1166. if(class9_1.actions != null)
  1167. {
  1168. for(int j4 = 4; j4 >= 0; j4--)
  1169. if(class9_1.actions[j4] != null)
  1170. {
  1171. menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@" + itemDef.name;
  1172. if(j4 == 0)
  1173. menuActionID[menuActionRow] = 632;
  1174. if(j4 == 1)
  1175. menuActionID[menuActionRow] = 78;
  1176. if(j4 == 2)
  1177. menuActionID[menuActionRow] = 867;
  1178. if(j4 == 3)
  1179. menuActionID[menuActionRow] = 431;
  1180. if(j4 == 4)
  1181. menuActionID[menuActionRow] = 53;
  1182. menuActionCmd1[menuActionRow] = itemDef.id;
  1183. menuActionCmd2[menuActionRow] = k2;
  1184. menuActionCmd3[menuActionRow] = class9_1.id;
  1185. menuActionRow++;
  1186. }
  1187.  
  1188. }
  1189. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inv[k2] - 1) + "@gre@)";
  1190. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1191. menuActionID[menuActionRow] = 1125;
  1192. menuActionCmd1[menuActionRow] = itemDef.id;
  1193. menuActionCmd2[menuActionRow] = k2;
  1194. menuActionCmd3[menuActionRow] = class9_1.id;
  1195. menuActionRow++;
  1196. }
  1197. }
  1198. }
  1199. k2++;
  1200. }
  1201.  
  1202. }
  1203.  
  1204. }
  1205. }
  1206. }
  1207.  
  1208. }
  1209.  
  1210. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1211. scrollBar1.drawSprite(i1, l);
  1212. scrollBar2.drawSprite(i1, (l + j) - 16);
  1213. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1214. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1215. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1216. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1217. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1218. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1219. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1220. int k1 = ((j - 32) * j) / j1;
  1221. if(k1 < 8)
  1222. k1 = 8;
  1223. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1224. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1225. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1226. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1227. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1228. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1229. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1230. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1231. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1232. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1233. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1234. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1235. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1236. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1237. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1238. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1239. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1240. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1241. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1242. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1243. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1244. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1245. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1246. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1247. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1248. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1249. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1250. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1251. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1252. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1253. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1254. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1255. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1256. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1257. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1258. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1259. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1260. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1261. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1262. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1263. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1264. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1265. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1266. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1267. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1268. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1269. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1270. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1271. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1272. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1273. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1274. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1275. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1276. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1277. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1278. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1279. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1280. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1281. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1282. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1283. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1284. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1285. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1286. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1287. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1288. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1289. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1290. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1291. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1292. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1293. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1294. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1295. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1296. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1297. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1298. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1299. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1300. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1301. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1302. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1303. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1304. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1305. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1306. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1307. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1308. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1309. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1310. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1311. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1312. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1313. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1314. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1315. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1316. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1317. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1318. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1319. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1320. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1321. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1322. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1323. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1324. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1325. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1326. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1327. }
  1328.  
  1329. private void updateNPCs(Stream stream, int i)
  1330. {
  1331. anInt839 = 0;
  1332. anInt893 = 0;
  1333. method139(stream);
  1334. method46(i, stream);
  1335. method86(stream);
  1336. for(int k = 0; k < anInt839; k++)
  1337. {
  1338. int l = anIntArray840[k];
  1339. if(npcArray[l].anInt1537 != loopCycle)
  1340. {
  1341. npcArray[l].desc = null;
  1342. npcArray[l] = null;
  1343. }
  1344. }
  1345.  
  1346. if(stream.currentOffset != i)
  1347. {
  1348. signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1349. throw new RuntimeException("eek");
  1350. }
  1351. for(int i1 = 0; i1 < npcCount; i1++)
  1352. if(npcArray[npcIndices[i1]] == null)
  1353. {
  1354. signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1355. throw new RuntimeException("eek");
  1356. }
  1357.  
  1358. }
  1359.  
  1360. private int cButtonHPos;
  1361. private int cButtonHCPos;
  1362. private int cButtonCPos;
  1363.  
  1364. private void processChatModeClick() {
  1365. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  1366. cButtonHPos = 0;
  1367. aBoolean1233 = true;
  1368. inputTaken = true;
  1369. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  1370. cButtonHPos = 1;
  1371. aBoolean1233 = true;
  1372. inputTaken = true;
  1373. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  1374. cButtonHPos = 2;
  1375. aBoolean1233 = true;
  1376. inputTaken = true;
  1377. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  1378. cButtonHPos = 3;
  1379. aBoolean1233 = true;
  1380. inputTaken = true;
  1381. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  1382. cButtonHPos = 4;
  1383. aBoolean1233 = true;
  1384. inputTaken = true;
  1385. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  1386. cButtonHPos = 5;
  1387. aBoolean1233 = true;
  1388. inputTaken = true;
  1389. } else if(super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= 482 && super.mouseY <= 503) {
  1390. cButtonHPos = 6;
  1391. aBoolean1233 = true;
  1392. inputTaken = true;
  1393. } else {
  1394. cButtonHPos = -1;
  1395. aBoolean1233 = true;
  1396. inputTaken = true;
  1397. }
  1398. if(super.clickMode3 == 1) {
  1399. if(super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1400. cButtonCPos = 0;
  1401. chatTypeView = 0;
  1402. aBoolean1233 = true;
  1403. inputTaken = true;
  1404. } else if(super.saveClickX >= 71 && super.saveClickX <= 127 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1405. cButtonCPos = 1;
  1406. chatTypeView = 5;
  1407. aBoolean1233 = true;
  1408. inputTaken = true;
  1409. } else if(super.saveClickX >= 137 && super.saveClickX <= 193 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1410. cButtonCPos = 2;
  1411. chatTypeView = 1;
  1412. aBoolean1233 = true;
  1413. inputTaken = true;
  1414. } else if(super.saveClickX >= 203 && super.saveClickX <= 259 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1415. cButtonCPos = 3;
  1416. chatTypeView = 2;
  1417. aBoolean1233 = true;
  1418. inputTaken = true;
  1419. } else if(super.saveClickX >= 269 && super.saveClickX <= 325 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1420. cButtonCPos = 4;
  1421. chatTypeView = 11;
  1422. aBoolean1233 = true;
  1423. inputTaken = true;
  1424. } else if(super.saveClickX >= 335 && super.saveClickX <= 391 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1425. cButtonCPos = 5;
  1426. chatTypeView = 3;
  1427. aBoolean1233 = true;
  1428. inputTaken = true;
  1429. } else if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && 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. {
  1449. int j = Varp.cache[i].anInt709;
  1450. if(j == 0)
  1451. return;
  1452. int k = variousSettings[i];
  1453. if(j == 1)
  1454. {
  1455. if(k == 1)
  1456. Texture.method372(0.90000000000000002D);
  1457. if(k == 2)
  1458. Texture.method372(0.80000000000000004D);
  1459. if(k == 3)
  1460. Texture.method372(0.69999999999999996D);
  1461. if(k == 4)
  1462. Texture.method372(0.59999999999999998D);
  1463. ItemDef.mruNodes1.unlinkAll();
  1464. welcomeScreenRaised = true;
  1465. }
  1466. if(j == 3)
  1467. {
  1468. boolean flag1 = musicEnabled;
  1469. if(k == 0)
  1470. {
  1471. adjustVolume(musicEnabled, 0);
  1472. musicEnabled = true;
  1473. }
  1474. if(k == 1)
  1475. {
  1476. adjustVolume(musicEnabled, -400);
  1477. musicEnabled = true;
  1478. }
  1479. if(k == 2)
  1480. {
  1481. adjustVolume(musicEnabled, -800);
  1482. musicEnabled = true;
  1483. }
  1484. if(k == 3)
  1485. {
  1486. adjustVolume(musicEnabled, -1200);
  1487. musicEnabled = true;
  1488. }
  1489. if(k == 4)
  1490. musicEnabled = false;
  1491. if(musicEnabled != flag1 && !lowMem)
  1492. {
  1493. if(musicEnabled)
  1494. {
  1495. nextSong = currentSong;
  1496. songChanging = true;
  1497. onDemandFetcher.method558(2, nextSong);
  1498. } else
  1499. {
  1500. stopMidi();
  1501. }
  1502. prevSong = 0;
  1503. }
  1504. }
  1505. if(j == 4)
  1506. {
  1507. if(k == 0)
  1508. {
  1509. aBoolean848 = true;
  1510. setWaveVolume(0);
  1511. }
  1512. if(k == 1)
  1513. {
  1514. aBoolean848 = true;
  1515. setWaveVolume(-400);
  1516. }
  1517. if(k == 2)
  1518. {
  1519. aBoolean848 = true;
  1520. setWaveVolume(-800);
  1521. }
  1522. if(k == 3)
  1523. {
  1524. aBoolean848 = true;
  1525. setWaveVolume(-1200);
  1526. }
  1527. if(k == 4)
  1528. aBoolean848 = false;
  1529. }
  1530. if(j == 5)
  1531. anInt1253 = k;
  1532. if(j == 6)
  1533. anInt1249 = k;
  1534. if(j == 8)
  1535. {
  1536. splitPrivateChat = k;
  1537. inputTaken = true;
  1538. }
  1539. if(j == 9)
  1540. anInt913 = k;
  1541. }
  1542.  
  1543. private void updateEntities() {
  1544. try{
  1545. int anInt974 = 0;
  1546. for(int j = -1; j < playerCount + npcCount; j++) {
  1547. Object obj;
  1548. if(j == -1)
  1549. obj = myPlayer;
  1550. else
  1551. if(j < playerCount)
  1552. obj = playerArray[playerIndices[j]];
  1553. else
  1554. obj = npcArray[npcIndices[j - playerCount]];
  1555. if(obj == null || !((Entity) (obj)).isVisible())
  1556. continue;
  1557. if(obj instanceof NPC) {
  1558. EntityDef entityDef = ((NPC)obj).desc;
  1559. if(entityDef.childrenIDs != null)
  1560. entityDef = entityDef.method161();
  1561. if(entityDef == null)
  1562. continue;
  1563. }
  1564. if(j < playerCount) {
  1565. int l = 30;
  1566. Player player = (Player)obj;
  1567. if(player.headIcon >= 0) {
  1568. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1569. if(spriteDrawX > -1) {
  1570. if (player.skullIcon < 2) {
  1571. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1572. l += 25;
  1573. }
  1574. if (player.headIcon < 7) {
  1575. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1576. l += 18;
  1577. }
  1578. }
  1579. }
  1580. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  1581. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1582. if(spriteDrawX > -1)
  1583. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1584. }
  1585. } else {
  1586. EntityDef entityDef_1 = ((NPC)obj).desc;
  1587. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  1588. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1589. if(spriteDrawX > -1)
  1590. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  1591. }
  1592. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  1593. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1594. if(spriteDrawX > -1)
  1595. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  1596. }
  1597. }
  1598. if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  1599. {
  1600. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  1601. if(spriteDrawX > -1 && anInt974 < anInt975)
  1602. {
  1603. anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
  1604. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  1605. anIntArray976[anInt974] = spriteDrawX;
  1606. anIntArray977[anInt974] = spriteDrawY;
  1607. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  1608. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  1609. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  1610. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  1611. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  1612. {
  1613. anIntArray978[anInt974] += 10;
  1614. anIntArray977[anInt974] += 5;
  1615. }
  1616. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  1617. anIntArray979[anInt974] = 60;
  1618. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  1619. anIntArray978[anInt974] += 5;
  1620. }
  1621. }
  1622. if(((Entity) (obj)).loopCycleStatus > loopCycle)
  1623. {
  1624. try{
  1625. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1626. if(spriteDrawX > -1)
  1627. {
  1628. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  1629. if(i1 > 30)
  1630. i1 = 30;
  1631. DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  1632. DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  1633. }
  1634. }catch(Exception e){ }
  1635. }
  1636. for(int j1 = 0; j1 < 4; j1++)
  1637. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  1638. {
  1639. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  1640. if(spriteDrawX > -1)
  1641. {
  1642. if(j1 == 1)
  1643. spriteDrawY -= 20;
  1644. if(j1 == 2)
  1645. {
  1646. spriteDrawX -= 15;
  1647. spriteDrawY -= 10;
  1648. }
  1649. if(j1 == 3)
  1650. {
  1651. spriteDrawX += 15;
  1652. spriteDrawY -= 10;
  1653. }
  1654. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  1655. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  1656. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  1657. }
  1658. }
  1659. }
  1660. for(int k = 0; k < anInt974; k++) {
  1661. int k1 = anIntArray976[k];
  1662. int l1 = anIntArray977[k];
  1663. int j2 = anIntArray979[k];
  1664. int k2 = anIntArray978[k];
  1665. boolean flag = true;
  1666. while(flag)
  1667. {
  1668. flag = false;
  1669. for(int l2 = 0; l2 < k; l2++)
  1670. if(l1 + 2 > anIntArray977[l2] - anIntArray978[l2] && l1 - k2 < anIntArray977[l2] + 2 && k1 - j2 < anIntArray976[l2] + anIntArray979[l2] && k1 + j2 > anIntArray976[l2] - anIntArray979[l2] && anIntArray977[l2] - anIntArray978[l2] < l1)
  1671. {
  1672. l1 = anIntArray977[l2] - anIntArray978[l2];
  1673. flag = true;
  1674. }
  1675.  
  1676. }
  1677. spriteDrawX = anIntArray976[k];
  1678. spriteDrawY = anIntArray977[k] = l1;
  1679. String s = aStringArray983[k];
  1680. if(anInt1249 == 0)
  1681. {
  1682. int i3 = 0xffff00;
  1683. if(anIntArray980[k] < 6)
  1684. i3 = anIntArray965[anIntArray980[k]];
  1685. if(anIntArray980[k] == 6)
  1686. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  1687. if(anIntArray980[k] == 7)
  1688. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  1689. if(anIntArray980[k] == 8)
  1690. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  1691. if(anIntArray980[k] == 9) {
  1692. int j3 = 150 - anIntArray982[k];
  1693. if(j3 < 50)
  1694. i3 = 0xff0000 + 1280 * j3;
  1695. else
  1696. if(j3 < 100)
  1697. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  1698. else
  1699. if(j3 < 150)
  1700. i3 = 65280 + 5 * (j3 - 100);
  1701. }
  1702. if(anIntArray980[k] == 10) {
  1703. int k3 = 150 - anIntArray982[k];
  1704. if(k3 < 50)
  1705. i3 = 0xff0000 + 5 * k3;
  1706. else
  1707. if(k3 < 100)
  1708. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  1709. else
  1710. if(k3 < 150)
  1711. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  1712. }
  1713. if(anIntArray980[k] == 11) {
  1714. int l3 = 150 - anIntArray982[k];
  1715. if(l3 < 50)
  1716. i3 = 0xffffff - 0x50005 * l3;
  1717. else
  1718. if(l3 < 100)
  1719. i3 = 65280 + 0x50005 * (l3 - 50);
  1720. else
  1721. if(l3 < 150)
  1722. i3 = 0xffffff - 0x50000 * (l3 - 100);
  1723. }
  1724. if(anIntArray981[k] == 0) {
  1725. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1726. chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  1727. }
  1728. if(anIntArray981[k] == 1) {
  1729. chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  1730. chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  1731. }
  1732. if(anIntArray981[k] == 2) {
  1733. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  1734. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  1735. }
  1736. if(anIntArray981[k] == 3) {
  1737. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  1738. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  1739. }
  1740. if(anIntArray981[k] == 4) {
  1741. int i4 = chatTextDrawingArea.method384(s);
  1742. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  1743. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  1744. chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  1745. chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  1746. DrawingArea.defaultDrawingAreaSize();
  1747. }
  1748. if(anIntArray981[k] == 5) {
  1749. int j4 = 150 - anIntArray982[k];
  1750. int l4 = 0;
  1751. if(j4 < 25)
  1752. l4 = j4 - 25;
  1753. else
  1754. if(j4 > 125)
  1755. l4 = j4 - 125;
  1756. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  1757. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  1758. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  1759. DrawingArea.defaultDrawingAreaSize();
  1760. }
  1761. } else {
  1762. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1763. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  1764. }
  1765. }
  1766. } catch(Exception e){ }
  1767. }
  1768.  
  1769. private void delFriend(long l)
  1770. {
  1771. try
  1772. {
  1773. if(l == 0L)
  1774. return;
  1775. for(int i = 0; i < friendsCount; i++)
  1776. {
  1777. if(friendsListAsLongs[i] != l)
  1778. continue;
  1779. friendsCount--;
  1780. needDrawTabArea = true;
  1781. for(int j = i; j < friendsCount; j++)
  1782. {
  1783. friendsList[j] = friendsList[j + 1];
  1784. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  1785. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  1786. }
  1787.  
  1788. stream.createFrame(215);
  1789. stream.writeQWord(l);
  1790. break;
  1791. }
  1792. }
  1793. catch(RuntimeException runtimeexception)
  1794. {
  1795. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  1796. throw new RuntimeException();
  1797. }
  1798. }
  1799.  
  1800. public void drawSideIcons(){
  1801. /* Top sideIcons */
  1802. if(tabInterfaceIDs[0] != -1)//attack
  1803. sideIcons[0].drawSprite(10, 4);
  1804. if(tabInterfaceIDs[1] != -1)//stat
  1805. sideIcons[1].drawSprite(43, 4);
  1806. if(tabInterfaceIDs[2] != -1)//quest
  1807. sideIcons[2].drawSprite(76, 3);
  1808. if(tabInterfaceIDs[3] != -1)//inventory
  1809. sideIcons[3].drawSprite(111, 5);
  1810. if(tabInterfaceIDs[4] != -1)//equipment
  1811. sideIcons[4].drawSprite(140, 1);
  1812. if(tabInterfaceIDs[5] != -1)//prayer
  1813. sideIcons[5].drawSprite(174, 1);
  1814. if(tabInterfaceIDs[6] != -1)//magic
  1815. sideIcons[6].drawSprite(208, 4);
  1816. /* Bottom sideIcons */
  1817. if(tabInterfaceIDs[7] != -1)//clan
  1818. sideIcons[7].drawSprite(11, 303);
  1819. if(tabInterfaceIDs[8] != -1)//friends
  1820. sideIcons[8].drawSprite(46, 306);
  1821. if(tabInterfaceIDs[9] != -1)//ignore
  1822. sideIcons[9].drawSprite(79, 306);
  1823. if(tabInterfaceIDs[10] != -1)//options
  1824. sideIcons[10].drawSprite(113, 302);
  1825. if(tabInterfaceIDs[11] != -1)//options
  1826. sideIcons[11].drawSprite(145, 304);
  1827. if(tabInterfaceIDs[12] != -1)//emotes
  1828. sideIcons[12].drawSprite(181, 302);
  1829. if(tabInterfaceIDs[13] != -1)//music
  1830. sideIcons[13].drawSprite(213, 303);
  1831. }
  1832.  
  1833. public void drawRedStones() {
  1834. if(tabInterfaceIDs[tabID] != -1) {
  1835. switch(tabID) {
  1836. case 0:
  1837. redStones[0].drawSprite(3, 0);
  1838. break;
  1839. case 1:
  1840. redStones[4].drawSprite(41, 0);
  1841. break;
  1842. case 2:
  1843. redStones[4].drawSprite(74, 0);
  1844. break;
  1845. case 3:
  1846. redStones[4].drawSprite(107, 0);
  1847. break;
  1848. case 4:
  1849. redStones[4].drawSprite(140, 0);
  1850. break;
  1851. case 5:
  1852. redStones[4].drawSprite(173, 0);
  1853. break;
  1854. case 6:
  1855. redStones[1].drawSprite(206, 0);
  1856. break;
  1857. case 7:
  1858. redStones[2].drawSprite(3, 298);
  1859. break;
  1860. case 8:
  1861. redStones[4].drawSprite(41, 298);
  1862. break;
  1863. case 9:
  1864. redStones[4].drawSprite(74, 298);
  1865. break;
  1866. case 10:
  1867. redStones[4].drawSprite(107, 298);
  1868. break;
  1869. case 11:
  1870. redStones[4].drawSprite(140, 298);
  1871. break;
  1872. case 12:
  1873. redStones[4].drawSprite(173, 298);
  1874. break;
  1875. case 13:
  1876. redStones[3].drawSprite(206, 298);
  1877. break;
  1878. }
  1879. }
  1880. }
  1881.  
  1882. private void drawTabArea() {
  1883. aRSImageProducer_1163.initDrawingArea();
  1884. Texture.anIntArray1472 = anIntArray1181;
  1885. tabArea.drawSprite(0, 0);
  1886. if(invOverlayInterfaceID == -1) {
  1887. drawRedStones();
  1888. drawSideIcons();
  1889. }
  1890. if(invOverlayInterfaceID != -1)
  1891. drawInterface(0, 28, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  1892. else if(tabInterfaceIDs[tabID] != -1)
  1893. drawInterface(0, 28, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  1894. if(menuOpen && menuScreenArea == 1)
  1895. drawMenu();
  1896. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  1897. aRSImageProducer_1165.initDrawingArea();
  1898. Texture.anIntArray1472 = anIntArray1182;
  1899. }
  1900.  
  1901. private void method37(int j) {
  1902. if(!lowMem) {
  1903. if(Texture.anIntArray1480[17] >= j) {
  1904. Background background = Texture.aBackgroundArray1474s[17];
  1905. int k = background.anInt1452 * background.anInt1453 - 1;
  1906. //fire cape apparently?
  1907. int j1 = background.anInt1452 * anInt945 * 2;
  1908. byte abyte0[] = background.aByteArray1450;
  1909. byte abyte3[] = aByteArray912;
  1910. for(int i2 = 0; i2 <= k; i2++)
  1911. abyte3[i2] = abyte0[i2 - j1 & k];
  1912.  
  1913. background.aByteArray1450 = abyte3;
  1914. aByteArray912 = abyte0;
  1915. Texture.method370(17);
  1916. anInt854++;
  1917. if(anInt854 > 1235) {
  1918. anInt854 = 0;
  1919. stream.createFrame(226);
  1920. stream.writeWordBigEndian(0);
  1921. int l2 = stream.currentOffset;
  1922. stream.writeWord(58722);
  1923. stream.writeWordBigEndian(240);
  1924. stream.writeWord((int)(Math.random() * 65536D));
  1925. stream.writeWordBigEndian((int)(Math.random() * 256D));
  1926. if((int)(Math.random() * 2D) == 0)
  1927. stream.writeWord(51825);
  1928. stream.writeWordBigEndian((int)(Math.random() * 256D));
  1929. stream.writeWord((int)(Math.random() * 65536D));
  1930. stream.writeWord(7130);
  1931. stream.writeWord((int)(Math.random() * 65536D));
  1932. stream.writeWord(61657);
  1933. stream.writeBytes(stream.currentOffset - l2);
  1934. }
  1935. }
  1936. if(Texture.anIntArray1480[24] >= j) {
  1937. Background background_1 = Texture.aBackgroundArray1474s[24];
  1938. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  1939. int k1 = background_1.anInt1452 * anInt945 * 2;
  1940. byte abyte1[] = background_1.aByteArray1450;
  1941. byte abyte4[] = aByteArray912;
  1942. for(int j2 = 0; j2 <= l; j2++)
  1943. abyte4[j2] = abyte1[j2 - k1 & l];
  1944.  
  1945. background_1.aByteArray1450 = abyte4;
  1946. aByteArray912 = abyte1;
  1947. Texture.method370(24);
  1948. }
  1949. if(Texture.anIntArray1480[34] >= j) {
  1950. Background background_2 = Texture.aBackgroundArray1474s[34];
  1951. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  1952. int l1 = background_2.anInt1452 * anInt945 * 2;
  1953. byte abyte2[] = background_2.aByteArray1450;
  1954. byte abyte5[] = aByteArray912;
  1955. for(int k2 = 0; k2 <= i1; k2++)
  1956. abyte5[k2] = abyte2[k2 - l1 & i1];
  1957.  
  1958. background_2.aByteArray1450 = abyte5;
  1959. aByteArray912 = abyte2;
  1960. Texture.method370(34);
  1961. }
  1962. if(Texture.anIntArray1480[40] >= j)
  1963. {
  1964. Background background_2 = Texture.aBackgroundArray1474s[40];
  1965. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  1966. int l1 = background_2.anInt1452 * anInt945 * 2;
  1967. byte abyte2[] = background_2.aByteArray1450;
  1968. byte abyte5[] = aByteArray912;
  1969. for(int k2 = 0; k2 <= i1; k2++)
  1970. abyte5[k2] = abyte2[k2 - l1 & i1];
  1971.  
  1972. background_2.aByteArray1450 = abyte5;
  1973. aByteArray912 = abyte2;
  1974. Texture.method370(40);
  1975. }
  1976. }
  1977. }
  1978.  
  1979. private void method38() {
  1980. for(int i = -1; i < playerCount; i++) {
  1981. int j;
  1982. if(i == -1)
  1983. j = myPlayerIndex;
  1984. else
  1985. j = playerIndices[i];
  1986. Player player = playerArray[j];
  1987. if(player != null && player.textCycle > 0) {
  1988. player.textCycle--;
  1989. if(player.textCycle == 0)
  1990. player.textSpoken = null;
  1991. }
  1992. }
  1993. for(int k = 0; k < npcCount; k++) {
  1994. int l = npcIndices[k];
  1995. NPC npc = npcArray[l];
  1996. if(npc != null && npc.textCycle > 0) {
  1997. npc.textCycle--;
  1998. if(npc.textCycle == 0)
  1999. npc.textSpoken = null;
  2000. }
  2001. }
  2002. }
  2003.  
  2004. private void calcCameraPos() {
  2005. int i = anInt1098 * 128 + 64;
  2006. int j = anInt1099 * 128 + 64;
  2007. int k = method42(plane, j, i) - anInt1100;
  2008. if(xCameraPos < i) {
  2009. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2010. if(xCameraPos > i)
  2011. xCameraPos = i;
  2012. }
  2013. if(xCameraPos > i) {
  2014. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2015. if(xCameraPos < i)
  2016. xCameraPos = i;
  2017. }
  2018. if(zCameraPos < k) {
  2019. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2020. if(zCameraPos > k)
  2021. zCameraPos = k;
  2022. }
  2023. if(zCameraPos > k) {
  2024. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2025. if(zCameraPos < k)
  2026. zCameraPos = k;
  2027. }
  2028. if(yCameraPos < j) {
  2029. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2030. if(yCameraPos > j)
  2031. yCameraPos = j;
  2032. }
  2033. if(yCameraPos > j) {
  2034. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2035. if(yCameraPos < j)
  2036. yCameraPos = j;
  2037. }
  2038. i = anInt995 * 128 + 64;
  2039. j = anInt996 * 128 + 64;
  2040. k = method42(plane, j, i) - anInt997;
  2041. int l = i - xCameraPos;
  2042. int i1 = k - zCameraPos;
  2043. int j1 = j - yCameraPos;
  2044. int k1 = (int)Math.sqrt(l * l + j1 * j1);
  2045. int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2046. int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2047. if(l1 < 128)
  2048. l1 = 128;
  2049. if(l1 > 383)
  2050. l1 = 383;
  2051. if(yCameraCurve < l1) {
  2052. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2053. if(yCameraCurve > l1)
  2054. yCameraCurve = l1;
  2055. }
  2056. if(yCameraCurve > l1) {
  2057. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2058. if(yCameraCurve < l1)
  2059. yCameraCurve = l1;
  2060. }
  2061. int j2 = i2 - xCameraCurve;
  2062. if(j2 > 1024)
  2063. j2 -= 2048;
  2064. if(j2 < -1024)
  2065. j2 += 2048;
  2066. if(j2 > 0) {
  2067. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2068. xCameraCurve &= 0x7ff;
  2069. }
  2070. if(j2 < 0) {
  2071. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2072. xCameraCurve &= 0x7ff;
  2073. }
  2074. int k2 = i2 - xCameraCurve;
  2075. if(k2 > 1024)
  2076. k2 -= 2048;
  2077. if(k2 < -1024)
  2078. k2 += 2048;
  2079. if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2080. xCameraCurve = i2;
  2081. }
  2082.  
  2083. private void drawMenu() {
  2084. int i = menuOffsetX;
  2085. int j = menuOffsetY;
  2086. int k = menuWidth;
  2087. int l = menuHeight + 1;
  2088. int i1 = 0x5d5447;
  2089. //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  2090. //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  2091. DrawingArea.drawPixels(l, j, i, i1, k);
  2092. DrawingArea.drawPixels(16, j + 1, i + 1, 0, k - 2);
  2093. DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
  2094. chatTextDrawingArea.method385(i1, "Choose Option", j + 14, i + 3);
  2095. int j1 = super.mouseX;
  2096. int k1 = super.mouseY;
  2097. if(menuScreenArea == 0) {
  2098. j1 -= 4;
  2099. k1 -= 4;
  2100. }
  2101. if(menuScreenArea == 1) {
  2102. j1 -= 519;
  2103. k1 -= 168;
  2104. }
  2105. if(menuScreenArea == 2) {
  2106. j1 -= 17;
  2107. k1 -= 338;
  2108. }
  2109. if(menuScreenArea == 3) {
  2110. j1 -= 519;
  2111. k1 -= 0;
  2112. }
  2113. for(int l1 = 0; l1 < menuActionRow; l1++) {
  2114. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2115. int j2 = 0xffffff;
  2116. if(j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  2117. j2 = 0xffff00;
  2118. chatTextDrawingArea.method389(true, i + 3, j2, menuActionName[l1], i2);
  2119. }
  2120. }
  2121.  
  2122. private void addFriend(long l) {
  2123. try {
  2124. if(l == 0L)
  2125. return;
  2126. if(friendsCount >= 100 && anInt1046 != 1) {
  2127. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2128. return;
  2129. }
  2130. if(friendsCount >= 200) {
  2131. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2132. return;
  2133. }
  2134. String s = TextClass.fixName(TextClass.nameForLong(l));
  2135. for(int i = 0; i < friendsCount; i++)
  2136. if(friendsListAsLongs[i] == l) {
  2137. pushMessage(s + " is already on your friend list", 0, "");
  2138. return;
  2139. }
  2140. for(int j = 0; j < ignoreCount; j++)
  2141. if(ignoreListAsLongs[j] == l) {
  2142. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  2143. return;
  2144. }
  2145.  
  2146. if(s.equals(myPlayer.name)) {
  2147. return;
  2148. } else {
  2149. friendsList[friendsCount] = s;
  2150. friendsListAsLongs[friendsCount] = l;
  2151. friendsNodeIDs[friendsCount] = 0;
  2152. friendsCount++;
  2153. needDrawTabArea = true;
  2154. stream.createFrame(188);
  2155. stream.writeQWord(l);
  2156. return;
  2157. }
  2158. } catch(RuntimeException runtimeexception) {
  2159. signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
  2160. }
  2161. throw new RuntimeException();
  2162. }
  2163.  
  2164. private int method42(int i, int j, int k) {
  2165. int l = k >> 7;
  2166. int i1 = j >> 7;
  2167. if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2168. return 0;
  2169. int j1 = i;
  2170. if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2171. j1++;
  2172. int k1 = k & 0x7f;
  2173. int l1 = j & 0x7f;
  2174. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2175. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2176. return i2 * (128 - l1) + j2 * l1 >> 7;
  2177. }
  2178.  
  2179. private static String intToKOrMil(int j) {
  2180. if(j < 0x186a0)
  2181. return String.valueOf(j);
  2182. if(j < 0x989680)
  2183. return j / 1000 + "K";
  2184. else
  2185. return j / 0xf4240 + "M";
  2186. }
  2187.  
  2188. private void resetLogout() {
  2189. try {
  2190. if(socketStream != null)
  2191. socketStream.close();
  2192. }
  2193. catch(Exception _ex) { }
  2194. socketStream = null;
  2195. loggedIn = false;
  2196. loginScreenState = 0;
  2197. // myUsername = "";
  2198. // myPassword = "";
  2199. unlinkMRUNodes();
  2200. worldController.initToNull();
  2201. for(int i = 0; i < 4; i++)
  2202. aClass11Array1230[i].method210();
  2203. System.gc();
  2204. stopMidi();
  2205. currentSong = -1;
  2206. nextSong = -1;
  2207. prevSong = 0;
  2208. }
  2209.  
  2210. private void method45() {
  2211. aBoolean1031 = true;
  2212. for(int j = 0; j < 7; j++) {
  2213. anIntArray1065[j] = -1;
  2214. for(int k = 0; k < IDK.length; k++) {
  2215. if(IDK.cache[k].aBoolean662 || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2216. continue;
  2217. anIntArray1065[j] = k;
  2218. break;
  2219. }
  2220. }
  2221. }
  2222.  
  2223. private void method46(int i, Stream stream) {
  2224. while(stream.bitPosition + 21 < i * 8) {
  2225. int k = stream.readBits(14);
  2226. if(k == 16383)
  2227. break;
  2228. if(npcArray[k] == null)
  2229. npcArray[k] = new NPC();
  2230. NPC npc = npcArray[k];
  2231. npcIndices[npcCount++] = k;
  2232. npc.anInt1537 = loopCycle;
  2233. int l = stream.readBits(5);
  2234. if(l > 15)
  2235. l -= 32;
  2236. int i1 = stream.readBits(5);
  2237. if(i1 > 15)
  2238. i1 -= 32;
  2239. int j1 = stream.readBits(1);
  2240. npc.desc = EntityDef.forID(stream.readBits(12));
  2241. int k1 = stream.readBits(1);
  2242. if(k1 == 1)
  2243. anIntArray894[anInt893++] = k;
  2244. npc.anInt1540 = npc.desc.aByte68;
  2245. npc.anInt1504 = npc.desc.anInt79;
  2246. npc.anInt1554 = npc.desc.walkAnim;
  2247. npc.anInt1555 = npc.desc.anInt58;
  2248. npc.anInt1556 = npc.desc.anInt83;
  2249. npc.anInt1557 = npc.desc.anInt55;
  2250. npc.anInt1511 = npc.desc.standAnim;
  2251. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2252. }
  2253. stream.finishBitAccess();
  2254. }
  2255.  
  2256. public void processGameLoop() {
  2257. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  2258. return;
  2259. loopCycle++;
  2260. if(!loggedIn)
  2261. processLoginScreenInput();
  2262. else
  2263. mainGameProcessor();
  2264. processOnDemandQueue();
  2265. }
  2266.  
  2267. private void method47(boolean flag) {
  2268. if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2269. destX = 0;
  2270. int j = playerCount;
  2271. if(flag)
  2272. j = 1;
  2273. for(int l = 0; l < j; l++) {
  2274. Player player;
  2275. int i1;
  2276. if(flag) {
  2277. player = myPlayer;
  2278. i1 = myPlayerIndex << 14;
  2279. } else {
  2280. player = playerArray[playerIndices[l]];
  2281. i1 = playerIndices[l] << 14;
  2282. }
  2283. if(player == null || !player.isVisible())
  2284. continue;
  2285. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  2286. int j1 = player.x >> 7;
  2287. int k1 = player.y >> 7;
  2288. if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2289. continue;
  2290. if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  2291. player.aBoolean1699 = false;
  2292. player.anInt1709 = method42(plane, player.y, player.x);
  2293. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  2294. continue;
  2295. }
  2296. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2297. if(anIntArrayArray929[j1][k1] == anInt1265)
  2298. continue;
  2299. anIntArrayArray929[j1][k1] = anInt1265;
  2300. }
  2301. player.anInt1709 = method42(plane, player.y, player.x);
  2302. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  2303. }
  2304. }
  2305.  
  2306. private boolean promptUserForInput(RSInterface class9) {
  2307. int j = class9.contentType;
  2308. if(anInt900 == 2) {
  2309. if(j == 201) {
  2310. inputTaken = true;
  2311. inputDialogState = 0;
  2312. messagePromptRaised = true;
  2313. promptInput = "";
  2314. friendsListAction = 1;
  2315. aString1121 = "Enter name of friend to add to list";
  2316. }
  2317. if(j == 202) {
  2318. inputTaken = true;
  2319. inputDialogState = 0;
  2320. messagePromptRaised = true;
  2321. promptInput = "";
  2322. friendsListAction = 2;
  2323. aString1121 = "Enter name of friend to delete from list";
  2324. }
  2325. }
  2326. if(j == 205) {
  2327. anInt1011 = 250;
  2328. return true;
  2329. }
  2330. if(j == 501) {
  2331. inputTaken = true;
  2332. inputDialogState = 0;
  2333. messagePromptRaised = true;
  2334. promptInput = "";
  2335. friendsListAction = 4;
  2336. aString1121 = "Enter name of player to add to list";
  2337. }
  2338. if(j == 502) {
  2339. inputTaken = true;
  2340. inputDialogState = 0;
  2341. messagePromptRaised = true;
  2342. promptInput = "";
  2343. friendsListAction = 5;
  2344. aString1121 = "Enter name of player to delete from list";
  2345. }
  2346. if(j == 550) {
  2347. inputTaken = true;
  2348. inputDialogState = 0;
  2349. messagePromptRaised = true;
  2350. promptInput = "";
  2351. friendsListAction = 6;
  2352. aString1121 = "Enter the name of the chat you wish to join";
  2353. }
  2354. if(j >= 300 && j <= 313) {
  2355. int k = (j - 300) / 2;
  2356. int j1 = j & 1;
  2357. int i2 = anIntArray1065[k];
  2358. if(i2 != -1) {
  2359. do {
  2360. if(j1 == 0 && --i2 < 0)
  2361. i2 = IDK.length - 1;
  2362. if(j1 == 1 && ++i2 >= IDK.length)
  2363. i2 = 0;
  2364. } while(IDK.cache[i2].aBoolean662 || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2365. anIntArray1065[k] = i2;
  2366. aBoolean1031 = true;
  2367. }
  2368. }
  2369. if(j >= 314 && j <= 323) {
  2370. int l = (j - 314) / 2;
  2371. int k1 = j & 1;
  2372. int j2 = anIntArray990[l];
  2373. if(k1 == 0 && --j2 < 0)
  2374. j2 = anIntArrayArray1003[l].length - 1;
  2375. if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2376. j2 = 0;
  2377. anIntArray990[l] = j2;
  2378. aBoolean1031 = true;
  2379. }
  2380. if(j == 324 && !aBoolean1047) {
  2381. aBoolean1047 = true;
  2382. method45();
  2383. }
  2384. if(j == 325 && aBoolean1047) {
  2385. aBoolean1047 = false;
  2386. method45();
  2387. }
  2388. if(j == 326) {
  2389. stream.createFrame(101);
  2390. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2391. for(int i1 = 0; i1 < 7; i1++)
  2392. stream.writeWordBigEndian(anIntArray1065[i1]);
  2393.  
  2394. for(int l1 = 0; l1 < 5; l1++)
  2395. stream.writeWordBigEndian(anIntArray990[l1]);
  2396.  
  2397. return true;
  2398. }
  2399. if(j == 613)
  2400. canMute = !canMute;
  2401. if(j >= 601 && j <= 612) {
  2402. clearTopInterfaces();
  2403. if(reportAbuseInput.length() > 0) {
  2404. stream.createFrame(218);
  2405. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2406. stream.writeWordBigEndian(j - 601);
  2407. stream.writeWordBigEndian(canMute ? 1 : 0);
  2408. }
  2409. }
  2410. return false;
  2411. }
  2412.  
  2413. private void method49(Stream stream) {
  2414. for(int j = 0; j < anInt893; j++) {
  2415. int k = anIntArray894[j];
  2416. Player player = playerArray[k];
  2417. int l = stream.readUnsignedByte();
  2418. if((l & 0x40) != 0)
  2419. l += stream.readUnsignedByte() << 8;
  2420. method107(l, k, stream, player);
  2421. }
  2422. }
  2423.  
  2424. private void method50(int i, int k, int l, int i1, int j1) {
  2425. int k1 = worldController.method300(j1, l, i);
  2426. if(k1 != 0) {
  2427. int l1 = worldController.method304(j1, l, i, k1);
  2428. int k2 = l1 >> 6 & 3;
  2429. int i3 = l1 & 0x1f;
  2430. int k3 = k;
  2431. if(k1 > 0)
  2432. k3 = i1;
  2433. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2434. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2435. int i5 = k1 >> 14 & 0x7fff;
  2436. ObjectDef class46_2 = ObjectDef.forID(i5);
  2437. if(class46_2.anInt758 != -1) {
  2438. Background background_2 = mapScenes[class46_2.anInt758];
  2439. if(background_2 != null) {
  2440. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  2441. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  2442. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  2443. }
  2444. } else {
  2445. if(i3 == 0 || i3 == 2)
  2446. if(k2 == 0) {
  2447. ai[k4] = k3;
  2448. ai[k4 + 512] = k3;
  2449. ai[k4 + 1024] = k3;
  2450. ai[k4 + 1536] = k3;
  2451. } else if(k2 == 1) {
  2452. ai[k4] = k3;
  2453. ai[k4 + 1] = k3;
  2454. ai[k4 + 2] = k3;
  2455. ai[k4 + 3] = k3;
  2456. } else if(k2 == 2) {
  2457. ai[k4 + 3] = k3;
  2458. ai[k4 + 3 + 512] = k3;
  2459. ai[k4 + 3 + 1024] = k3;
  2460. ai[k4 + 3 + 1536] = k3;
  2461. } else if(k2 == 3) {
  2462. ai[k4 + 1536] = k3;
  2463. ai[k4 + 1536 + 1] = k3;
  2464. ai[k4 + 1536 + 2] = k3;
  2465. ai[k4 + 1536 + 3] = k3;
  2466. }
  2467. if(i3 == 3)
  2468. if(k2 == 0)
  2469. ai[k4] = k3;
  2470. else if(k2 == 1)
  2471. ai[k4 + 3] = k3;
  2472. else if(k2 == 2)
  2473. ai[k4 + 3 + 1536] = k3;
  2474. else if(k2 == 3)
  2475. ai[k4 + 1536] = k3;
  2476. if(i3 == 2)
  2477. if(k2 == 3) {
  2478. ai[k4] = k3;
  2479. ai[k4 + 512] = k3;
  2480. ai[k4 + 1024] = k3;
  2481. ai[k4 + 1536] = k3;
  2482. } else if(k2 == 0) {
  2483. ai[k4] = k3;
  2484. ai[k4 + 1] = k3;
  2485. ai[k4 + 2] = k3;
  2486. ai[k4 + 3] = k3;
  2487. } else if(k2 == 1) {
  2488. ai[k4 + 3] = k3;
  2489. ai[k4 + 3 + 512] = k3;
  2490. ai[k4 + 3 + 1024] = k3;
  2491. ai[k4 + 3 + 1536] = k3;
  2492. } else if(k2 == 2) {
  2493. ai[k4 + 1536] = k3;
  2494. ai[k4 + 1536 + 1] = k3;
  2495. ai[k4 + 1536 + 2] = k3;
  2496. ai[k4 + 1536 + 3] = k3;
  2497. }
  2498. }
  2499. }
  2500. k1 = worldController.method302(j1, l, i);
  2501. if(k1 != 0) {
  2502. int i2 = worldController.method304(j1, l, i, k1);
  2503. int l2 = i2 >> 6 & 3;
  2504. int j3 = i2 & 0x1f;
  2505. int l3 = k1 >> 14 & 0x7fff;
  2506. ObjectDef class46_1 = ObjectDef.forID(l3);
  2507. if(class46_1.anInt758 != -1) {
  2508. Background background_1 = mapScenes[class46_1.anInt758];
  2509. if(background_1 != null) {
  2510. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  2511. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  2512. background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  2513. }
  2514. } else if(j3 == 9) {
  2515. int l4 = 0xeeeeee;
  2516. if(k1 > 0)
  2517. l4 = 0xee0000;
  2518. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2519. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2520. if(l2 == 0 || l2 == 2) {
  2521. ai1[l5 + 1536] = l4;
  2522. ai1[l5 + 1024 + 1] = l4;
  2523. ai1[l5 + 512 + 2] = l4;
  2524. ai1[l5 + 3] = l4;
  2525. } else {
  2526. ai1[l5] = l4;
  2527. ai1[l5 + 512 + 1] = l4;
  2528. ai1[l5 + 1024 + 2] = l4;
  2529. ai1[l5 + 1536 + 3] = l4;
  2530. }
  2531. }
  2532. }
  2533. k1 = worldController.method303(j1, l, i);
  2534. if(k1 != 0) {
  2535. int j2 = k1 >> 14 & 0x7fff;
  2536. ObjectDef class46 = ObjectDef.forID(j2);
  2537. if(class46.anInt758 != -1) {
  2538. Background background = mapScenes[class46.anInt758];
  2539. if(background != null) {
  2540. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  2541. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  2542. background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  2543. }
  2544. }
  2545. }
  2546. }
  2547.  
  2548. private void loadTitleScreen() {
  2549. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  2550. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  2551. aBackgroundArray1152s = new Background[12];
  2552. int j = 0;
  2553. try {
  2554. j = Integer.parseInt(getParameter("fl_icon"));
  2555. } catch(Exception _ex) {
  2556. }
  2557. if(j == 0) {
  2558. for(int k = 0; k < 12; k++)
  2559. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  2560.  
  2561. } else {
  2562. for(int l = 0; l < 12; l++)
  2563. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  2564.  
  2565. }
  2566. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  2567. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  2568. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  2569.  
  2570. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  2571.  
  2572. anIntArray851 = new int[256];
  2573. for(int k1 = 0; k1 < 64; k1++)
  2574. anIntArray851[k1] = k1 * 0x40000;
  2575.  
  2576. for(int l1 = 0; l1 < 64; l1++)
  2577. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  2578.  
  2579. for(int i2 = 0; i2 < 64; i2++)
  2580. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  2581.  
  2582. for(int j2 = 0; j2 < 64; j2++)
  2583. anIntArray851[j2 + 192] = 0xffffff;
  2584.  
  2585. anIntArray852 = new int[256];
  2586. for(int k2 = 0; k2 < 64; k2++)
  2587. anIntArray852[k2] = k2 * 1024;
  2588.  
  2589. for(int l2 = 0; l2 < 64; l2++)
  2590. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  2591.  
  2592. for(int i3 = 0; i3 < 64; i3++)
  2593. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  2594.  
  2595. for(int j3 = 0; j3 < 64; j3++)
  2596. anIntArray852[j3 + 192] = 0xffffff;
  2597.  
  2598. anIntArray853 = new int[256];
  2599. for(int k3 = 0; k3 < 64; k3++)
  2600. anIntArray853[k3] = k3 * 4;
  2601.  
  2602. for(int l3 = 0; l3 < 64; l3++)
  2603. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  2604.  
  2605. for(int i4 = 0; i4 < 64; i4++)
  2606. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  2607.  
  2608. for(int j4 = 0; j4 < 64; j4++)
  2609. anIntArray853[j4 + 192] = 0xffffff;
  2610.  
  2611. anIntArray850 = new int[256];
  2612. anIntArray1190 = new int[32768];
  2613. anIntArray1191 = new int[32768];
  2614. randomizeBackground(null);
  2615. anIntArray828 = new int[32768];
  2616. anIntArray829 = new int[32768];
  2617. drawLoadingText(10, "Connecting to fileserver");
  2618. if(!aBoolean831) {
  2619. drawFlames = true;
  2620. aBoolean831 = true;
  2621. startRunnable(this, 2);
  2622. }
  2623. }
  2624.  
  2625. private static void setHighMem() {
  2626. WorldController.lowMem = false;
  2627. Texture.lowMem = false;
  2628. lowMem = false;
  2629. ObjectManager.lowMem = false;
  2630. ObjectDef.lowMem = false;
  2631. }
  2632.  
  2633. public static void main(String args[]) {
  2634. try {
  2635. System.out.println("RS2 user client - release #" + 317);
  2636. if(args.length != 5) {
  2637. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2638. return;
  2639. }
  2640. nodeID = Integer.parseInt(args[0]);
  2641. //portOff = Integer.parseInt(args[1]);
  2642. portOff = 0;
  2643. if(args[2].equals("lowmem"))
  2644. setLowMem();
  2645. else if(args[2].equals("highmem")) {
  2646. setHighMem();
  2647. } else {
  2648. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2649. return;
  2650. }
  2651. if(args[3].equals("free"))
  2652. isMembers = false;
  2653. else if(args[3].equals("members")) {
  2654. isMembers = true;
  2655. } else {
  2656. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2657. return;
  2658. }
  2659. signlink.storeid = Integer.parseInt(args[4]);
  2660. signlink.startpriv(InetAddress.getLocalHost());
  2661. new Jframe(args);
  2662. //client client1 = new client();
  2663. //client1.createClientFrame(503, 765);
  2664. } catch(Exception exception) {
  2665. }
  2666. }
  2667.  
  2668. private void loadingStages() {
  2669. if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  2670. aRSImageProducer_1165.initDrawingArea();
  2671. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  2672. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  2673. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  2674. loadingStage = 1;
  2675. aLong824 = System.currentTimeMillis();
  2676. }
  2677. if(loadingStage == 1) {
  2678. int j = method54();
  2679. if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  2680. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  2681. aLong824 = System.currentTimeMillis();
  2682. }
  2683. }
  2684. if(loadingStage == 2 && plane != anInt985) {
  2685. anInt985 = plane;
  2686. method24(plane);
  2687. }
  2688. }
  2689.  
  2690. private int method54() {
  2691. for(int i = 0; i < aByteArrayArray1183.length; i++) {
  2692. if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  2693. return -1;
  2694. if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  2695. return -2;
  2696. }
  2697. boolean flag = true;
  2698. for(int j = 0; j < aByteArrayArray1183.length; j++) {
  2699. byte abyte0[] = aByteArrayArray1247[j];
  2700. if(abyte0 != null) {
  2701. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  2702. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  2703. if(aBoolean1159) {
  2704. k = 10;
  2705. l = 10;
  2706. }
  2707. flag &= ObjectManager.method189(k, abyte0, l);
  2708. }
  2709. }
  2710. if(!flag)
  2711. return -3;
  2712. if(aBoolean1080) {
  2713. return -4;
  2714. } else {
  2715. loadingStage = 2;
  2716. ObjectManager.anInt131 = plane;
  2717. method22();
  2718. stream.createFrame(121);
  2719. return 0;
  2720. }
  2721. }
  2722.  
  2723. private void method55()
  2724. {
  2725. for(Animable_Sub4 class30_sub2_sub4_sub4 = (Animable_Sub4)aClass19_1013.reverseGetFirst(); class30_sub2_sub4_sub4 != null; class30_sub2_sub4_sub4 = (Animable_Sub4)aClass19_1013.reverseGetNext())
  2726. if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  2727. class30_sub2_sub4_sub4.unlink();
  2728. else
  2729. if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  2730. {
  2731. if(class30_sub2_sub4_sub4.anInt1590 > 0)
  2732. {
  2733. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  2734. if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  2735. class30_sub2_sub4_sub4.method455(loopCycle, npc.y, method42(class30_sub2_sub4_sub4.anInt1597, npc.y, npc.x) - class30_sub2_sub4_sub4.anInt1583, npc.x);
  2736. }
  2737. if(class30_sub2_sub4_sub4.anInt1590 < 0)
  2738. {
  2739. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  2740. Player player;
  2741. if(j == unknownInt10)
  2742. player = myPlayer;
  2743. else
  2744. player = playerArray[j];
  2745. if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  2746. class30_sub2_sub4_sub4.method455(loopCycle, player.y, method42(class30_sub2_sub4_sub4.anInt1597, player.y, player.x) - class30_sub2_sub4_sub4.anInt1583, player.x);
  2747. }
  2748. class30_sub2_sub4_sub4.method456(anInt945);
  2749. worldController.method285(plane, class30_sub2_sub4_sub4.anInt1595, (int)class30_sub2_sub4_sub4.aDouble1587, -1, (int)class30_sub2_sub4_sub4.aDouble1586, 60, (int)class30_sub2_sub4_sub4.aDouble1585, class30_sub2_sub4_sub4, false);
  2750. }
  2751.  
  2752. }
  2753.  
  2754. public AppletContext getAppletContext()
  2755. {
  2756. if(signlink.mainapp != null)
  2757. return signlink.mainapp.getAppletContext();
  2758. else
  2759. return super.getAppletContext();
  2760. }
  2761.  
  2762. private void drawLogo() {
  2763. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  2764. Sprite sprite = new Sprite(abyte0, this);
  2765. aRSImageProducer_1110.initDrawingArea();
  2766. sprite.method346(0, 0);
  2767. aRSImageProducer_1111.initDrawingArea();
  2768. sprite.method346(-637, 0);
  2769. aRSImageProducer_1107.initDrawingArea();
  2770. sprite.method346(-128, 0);
  2771. aRSImageProducer_1108.initDrawingArea();
  2772. sprite.method346(-202, -371);
  2773. aRSImageProducer_1109.initDrawingArea();
  2774. sprite.method346(-202, -171);
  2775. aRSImageProducer_1112.initDrawingArea();
  2776. sprite.method346(0, -265);
  2777. aRSImageProducer_1113.initDrawingArea();
  2778. sprite.method346(-562, -265);
  2779. aRSImageProducer_1114.initDrawingArea();
  2780. sprite.method346(-128, -171);
  2781. aRSImageProducer_1115.initDrawingArea();
  2782. sprite.method346(-562, -171);
  2783. int ai[] = new int[sprite.myWidth];
  2784. for(int j = 0; j < sprite.myHeight; j++) {
  2785. for(int k = 0; k < sprite.myWidth; k++)
  2786. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  2787.  
  2788. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  2789. }
  2790. aRSImageProducer_1110.initDrawingArea();
  2791. sprite.method346(382, 0);
  2792. aRSImageProducer_1111.initDrawingArea();
  2793. sprite.method346(-255, 0);
  2794. aRSImageProducer_1107.initDrawingArea();
  2795. sprite.method346(254, 0);
  2796. aRSImageProducer_1108.initDrawingArea();
  2797. sprite.method346(180, -371);
  2798. aRSImageProducer_1109.initDrawingArea();
  2799. sprite.method346(180, -171);
  2800. aRSImageProducer_1112.initDrawingArea();
  2801. sprite.method346(382, -265);
  2802. aRSImageProducer_1113.initDrawingArea();
  2803. sprite.method346(-180, -265);
  2804. aRSImageProducer_1114.initDrawingArea();
  2805. sprite.method346(254, -171);
  2806. aRSImageProducer_1115.initDrawingArea();
  2807. sprite.method346(-180, -171);
  2808. sprite = new Sprite(titleStreamLoader, "logo", 0);
  2809. aRSImageProducer_1107.initDrawingArea();
  2810. sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  2811. sprite = null;
  2812. Object obj = null;
  2813. Object obj1 = null;
  2814. System.gc();
  2815. }
  2816.  
  2817. private void processOnDemandQueue()
  2818. {
  2819. do
  2820. {
  2821. OnDemandData onDemandData;
  2822. do
  2823. {
  2824. onDemandData = onDemandFetcher.getNextNode();
  2825. if(onDemandData == null)
  2826. return;
  2827. if(onDemandData.dataType == 0)
  2828. {
  2829. Model.method460(onDemandData.buffer, onDemandData.ID);
  2830. if((onDemandFetcher.getModelIndex(onDemandData.ID) & 0x62) != 0)
  2831. {
  2832. needDrawTabArea = true;
  2833. if(backDialogID != -1)
  2834. inputTaken = true;
  2835. }
  2836. }
  2837. if(onDemandData.dataType == 1 && onDemandData.buffer != null)
  2838. Class36.method529(onDemandData.buffer);
  2839. if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  2840. saveMidi(songChanging, onDemandData.buffer);
  2841. if(onDemandData.dataType == 3 && loadingStage == 1)
  2842. {
  2843. for(int i = 0; i < aByteArrayArray1183.length; i++)
  2844. {
  2845. if(anIntArray1235[i] == onDemandData.ID)
  2846. {
  2847. aByteArrayArray1183[i] = onDemandData.buffer;
  2848. if(onDemandData.buffer == null)
  2849. anIntArray1235[i] = -1;
  2850. break;
  2851. }
  2852. if(anIntArray1236[i] != onDemandData.ID)
  2853. continue;
  2854. aByteArrayArray1247[i] = onDemandData.buffer;
  2855. if(onDemandData.buffer == null)
  2856. anIntArray1236[i] = -1;
  2857. break;
  2858. }
  2859.  
  2860. }
  2861. } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  2862. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  2863. } while(true);
  2864. }
  2865.  
  2866. private void calcFlamesPosition()
  2867. {
  2868. char c = '\u0100';
  2869. for(int j = 10; j < 117; j++)
  2870. {
  2871. int k = (int)(Math.random() * 100D);
  2872. if(k < 50)
  2873. anIntArray828[j + (c - 2 << 7)] = 255;
  2874. }
  2875. for(int l = 0; l < 100; l++)
  2876. {
  2877. int i1 = (int)(Math.random() * 124D) + 2;
  2878. int k1 = (int)(Math.random() * 128D) + 128;
  2879. int k2 = i1 + (k1 << 7);
  2880. anIntArray828[k2] = 192;
  2881. }
  2882.  
  2883. for(int j1 = 1; j1 < c - 1; j1++)
  2884. {
  2885. for(int l1 = 1; l1 < 127; l1++)
  2886. {
  2887. int l2 = l1 + (j1 << 7);
  2888. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  2889. }
  2890.  
  2891. }
  2892.  
  2893. anInt1275 += 128;
  2894. if(anInt1275 > anIntArray1190.length)
  2895. {
  2896. anInt1275 -= anIntArray1190.length;
  2897. int i2 = (int)(Math.random() * 12D);
  2898. randomizeBackground(aBackgroundArray1152s[i2]);
  2899. }
  2900. for(int j2 = 1; j2 < c - 1; j2++)
  2901. {
  2902. for(int i3 = 1; i3 < 127; i3++)
  2903. {
  2904. int k3 = i3 + (j2 << 7);
  2905. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  2906. if(i4 < 0)
  2907. i4 = 0;
  2908. anIntArray828[k3] = i4;
  2909. }
  2910.  
  2911. }
  2912.  
  2913. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  2914.  
  2915. anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
  2916. if(anInt1040 > 0)
  2917. anInt1040 -= 4;
  2918. if(anInt1041 > 0)
  2919. anInt1041 -= 4;
  2920. if(anInt1040 == 0 && anInt1041 == 0)
  2921. {
  2922. int l3 = (int)(Math.random() * 2000D);
  2923. if(l3 == 0)
  2924. anInt1040 = 1024;
  2925. if(l3 == 1)
  2926. anInt1041 = 1024;
  2927. }
  2928. }
  2929.  
  2930. private boolean saveWave(byte abyte0[], int i)
  2931. {
  2932. return abyte0 == null || signlink.wavesave(abyte0, i);
  2933. }
  2934.  
  2935. private void method60(int i)
  2936. {
  2937. RSInterface class9 = RSInterface.interfaceCache[i];
  2938. for(int j = 0; j < class9.children.length; j++)
  2939. {
  2940. if(class9.children[j] == -1)
  2941. break;
  2942. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  2943. if(class9_1.type == 1)
  2944. method60(class9_1.id);
  2945. class9_1.anInt246 = 0;
  2946. class9_1.anInt208 = 0;
  2947. }
  2948. }
  2949.  
  2950. private void drawHeadIcon()
  2951. {
  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. {
  2961. if(anInt1104 > 1)
  2962. anInt1104--;
  2963. if(anInt1011 > 0)
  2964. anInt1011--;
  2965. for(int j = 0; j < 5; j++)
  2966. if(!parsePacket())
  2967. break;
  2968.  
  2969. if(!loggedIn)
  2970. return;
  2971. synchronized(mouseDetection.syncObject)
  2972. {
  2973. if(flagged)
  2974. {
  2975. if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
  2976. {
  2977. stream.createFrame(45);
  2978. stream.writeWordBigEndian(0);
  2979. int j2 = stream.currentOffset;
  2980. int j3 = 0;
  2981. for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
  2982. {
  2983. if(j2 - stream.currentOffset >= 240)
  2984. break;
  2985. j3++;
  2986. int l4 = mouseDetection.coordsY[j4];
  2987. if(l4 < 0)
  2988. l4 = 0;
  2989. else
  2990. if(l4 > 502)
  2991. l4 = 502;
  2992. int k5 = mouseDetection.coordsX[j4];
  2993. if(k5 < 0)
  2994. k5 = 0;
  2995. else
  2996. if(k5 > 764)
  2997. k5 = 764;
  2998. int i6 = l4 * 765 + k5;
  2999. if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  3000. {
  3001. k5 = -1;
  3002. l4 = -1;
  3003. i6 = 0x7ffff;
  3004. }
  3005. if(k5 == anInt1237 && l4 == anInt1238)
  3006. {
  3007. if(anInt1022 < 2047)
  3008. anInt1022++;
  3009. } else
  3010. {
  3011. int j6 = k5 - anInt1237;
  3012. anInt1237 = k5;
  3013. int k6 = l4 - anInt1238;
  3014. anInt1238 = l4;
  3015. if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  3016. {
  3017. j6 += 32;
  3018. k6 += 32;
  3019. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  3020. anInt1022 = 0;
  3021. } else
  3022. if(anInt1022 < 8)
  3023. {
  3024. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  3025. anInt1022 = 0;
  3026. } else
  3027. {
  3028. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  3029. anInt1022 = 0;
  3030. }
  3031. }
  3032. }
  3033.  
  3034. stream.writeBytes(stream.currentOffset - j2);
  3035. if(j3 >= mouseDetection.coordsIndex)
  3036. {
  3037. mouseDetection.coordsIndex = 0;
  3038. } else
  3039. {
  3040. mouseDetection.coordsIndex -= j3;
  3041. for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  3042. {
  3043. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  3044. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  3045. }
  3046.  
  3047. }
  3048. }
  3049. } else
  3050. {
  3051. mouseDetection.coordsIndex = 0;
  3052. }
  3053. }
  3054. if(super.clickMode3 != 0)
  3055. {
  3056. long l = (super.aLong29 - aLong1220) / 50L;
  3057. if(l > 4095L)
  3058. l = 4095L;
  3059. aLong1220 = super.aLong29;
  3060. int k2 = super.saveClickY;
  3061. if(k2 < 0)
  3062. k2 = 0;
  3063. else
  3064. if(k2 > 502)
  3065. k2 = 502;
  3066. int k3 = super.saveClickX;
  3067. if(k3 < 0)
  3068. k3 = 0;
  3069. else
  3070. if(k3 > 764)
  3071. k3 = 764;
  3072. int k4 = k2 * 765 + k3;
  3073. int j5 = 0;
  3074. if(super.clickMode3 == 2)
  3075. j5 = 1;
  3076. int l5 = (int)l;
  3077. stream.createFrame(241);
  3078. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3079. }
  3080. if(anInt1016 > 0)
  3081. anInt1016--;
  3082. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3083. aBoolean1017 = true;
  3084. if(aBoolean1017 && anInt1016 <= 0)
  3085. {
  3086. anInt1016 = 20;
  3087. aBoolean1017 = false;
  3088. stream.createFrame(86);
  3089. stream.writeWord(anInt1184);
  3090. stream.method432(minimapInt1);
  3091. }
  3092. if(super.awtFocus && !aBoolean954)
  3093. {
  3094. aBoolean954 = true;
  3095. stream.createFrame(3);
  3096. stream.writeWordBigEndian(1);
  3097. }
  3098. if(!super.awtFocus && aBoolean954)
  3099. {
  3100. aBoolean954 = false;
  3101. stream.createFrame(3);
  3102. stream.writeWordBigEndian(0);
  3103. }
  3104. loadingStages();
  3105. method115();
  3106. method90();
  3107. anInt1009++;
  3108. if(anInt1009 > 750)
  3109. dropClient();
  3110. method114();
  3111. method95();
  3112. method38();
  3113. anInt945++;
  3114. if(crossType != 0)
  3115. {
  3116. crossIndex += 20;
  3117. if(crossIndex >= 400)
  3118. crossType = 0;
  3119. }
  3120. if(atInventoryInterfaceType != 0)
  3121. {
  3122. atInventoryLoopCycle++;
  3123. if(atInventoryLoopCycle >= 15)
  3124. {
  3125. if(atInventoryInterfaceType == 2)
  3126. needDrawTabArea = true;
  3127. if(atInventoryInterfaceType == 3)
  3128. inputTaken = true;
  3129. atInventoryInterfaceType = 0;
  3130. }
  3131. }
  3132. if(activeInterfaceType != 0)
  3133. {
  3134. anInt989++;
  3135. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  3136. aBoolean1242 = true;
  3137. if(super.clickMode2 == 0)
  3138. {
  3139. if(activeInterfaceType == 2)
  3140. needDrawTabArea = true;
  3141. if(activeInterfaceType == 3)
  3142. inputTaken = true;
  3143. activeInterfaceType = 0;
  3144. if(aBoolean1242 && anInt989 >= 5)
  3145. {
  3146. lastActiveInvInterface = -1;
  3147. processRightClick();
  3148. if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  3149. {
  3150. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3151. int j1 = 0;
  3152. if(anInt913 == 1 && class9.contentType == 206)
  3153. j1 = 1;
  3154. if(class9.inv[mouseInvInterfaceIndex] <= 0)
  3155. j1 = 0;
  3156. if(class9.aBoolean235)
  3157. {
  3158. int l2 = anInt1085;
  3159. int l3 = mouseInvInterfaceIndex;
  3160. class9.inv[l3] = class9.inv[l2];
  3161. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3162. class9.inv[l2] = -1;
  3163. class9.invStackSizes[l2] = 0;
  3164. } else
  3165. if(j1 == 1)
  3166. {
  3167. int i3 = anInt1085;
  3168. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3169. if(i3 > i4)
  3170. {
  3171. class9.swapInventoryItems(i3, i3 - 1);
  3172. i3--;
  3173. } else
  3174. if(i3 < i4)
  3175. {
  3176. class9.swapInventoryItems(i3, i3 + 1);
  3177. i3++;
  3178. }
  3179.  
  3180. } else
  3181. {
  3182. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  3183. }
  3184. stream.createFrame(214);
  3185. stream.method433(anInt1084);
  3186. stream.method424(j1);
  3187. stream.method433(anInt1085);
  3188. stream.method431(mouseInvInterfaceIndex);
  3189. }
  3190. } else
  3191. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  3192. determineMenuSize();
  3193. else
  3194. if(menuActionRow > 0)
  3195. doAction(menuActionRow - 1);
  3196. atInventoryLoopCycle = 10;
  3197. super.clickMode3 = 0;
  3198. }
  3199. }
  3200. if(WorldController.anInt470 != -1)
  3201. {
  3202. int k = WorldController.anInt470;
  3203. int k1 = WorldController.anInt471;
  3204. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  3205. WorldController.anInt470 = -1;
  3206. if(flag)
  3207. {
  3208. crossX = super.saveClickX;
  3209. crossY = super.saveClickY;
  3210. crossType = 1;
  3211. crossIndex = 0;
  3212. }
  3213. }
  3214. if(super.clickMode3 == 1 && aString844 != null)
  3215. {
  3216. aString844 = null;
  3217. inputTaken = true;
  3218. super.clickMode3 = 0;
  3219. }
  3220. processMenuClick();
  3221. processMainScreenClick();
  3222. processTabClick();
  3223. processChatModeClick();
  3224. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  3225. anInt1213++;
  3226. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3227. if (anInt1501 < 100) {
  3228. anInt1501++;
  3229. if (anInt1501 == 100) {
  3230. if (anInt1500 != 0) {
  3231. inputTaken = true;
  3232. }
  3233. if (anInt1044 != 0) {
  3234. needDrawTabArea = true;
  3235. }
  3236. }
  3237. }
  3238. } else if (anInt1501 > 0) {
  3239. anInt1501--;
  3240. }
  3241. if(loadingStage == 2)
  3242. method108();
  3243. if(loadingStage == 2 && aBoolean1160)
  3244. calcCameraPos();
  3245. for(int i1 = 0; i1 < 5; i1++)
  3246. anIntArray1030[i1]++;
  3247.  
  3248. method73();
  3249. super.idleTime++;
  3250. if(super.idleTime > 4500)
  3251. {
  3252. anInt1011 = 250;
  3253. super.idleTime -= 500;
  3254. stream.createFrame(202);
  3255. }
  3256. anInt988++;
  3257. if(anInt988 > 500)
  3258. {
  3259. anInt988 = 0;
  3260. int l1 = (int)(Math.random() * 8D);
  3261. if((l1 & 1) == 1)
  3262. anInt1278 += anInt1279;
  3263. if((l1 & 2) == 2)
  3264. anInt1131 += anInt1132;
  3265. if((l1 & 4) == 4)
  3266. anInt896 += anInt897;
  3267. }
  3268. if(anInt1278 < -50)
  3269. anInt1279 = 2;
  3270. if(anInt1278 > 50)
  3271. anInt1279 = -2;
  3272. if(anInt1131 < -55)
  3273. anInt1132 = 2;
  3274. if(anInt1131 > 55)
  3275. anInt1132 = -2;
  3276. if(anInt896 < -40)
  3277. anInt897 = 1;
  3278. if(anInt896 > 40)
  3279. anInt897 = -1;
  3280. anInt1254++;
  3281. if(anInt1254 > 500)
  3282. {
  3283. anInt1254 = 0;
  3284. int i2 = (int)(Math.random() * 8D);
  3285. if((i2 & 1) == 1)
  3286. minimapInt2 += anInt1210;
  3287. if((i2 & 2) == 2)
  3288. minimapInt3 += anInt1171;
  3289. }
  3290. if(minimapInt2 < -60)
  3291. anInt1210 = 2;
  3292. if(minimapInt2 > 60)
  3293. anInt1210 = -2;
  3294. if(minimapInt3 < -20)
  3295. anInt1171 = 1;
  3296. if(minimapInt3 > 10)
  3297. anInt1171 = -1;
  3298. anInt1010++;
  3299. if(anInt1010 > 50)
  3300. stream.createFrame(0);
  3301. try
  3302. {
  3303. if(socketStream != null && stream.currentOffset > 0)
  3304. {
  3305. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3306. stream.currentOffset = 0;
  3307. anInt1010 = 0;
  3308. }
  3309. }
  3310. catch(IOException _ex)
  3311. {
  3312. dropClient();
  3313. }
  3314. catch(Exception exception)
  3315. {
  3316. resetLogout();
  3317. }
  3318. }
  3319.  
  3320. private void method63()
  3321. {
  3322. Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  3323. for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  3324. if(class30_sub1.anInt1294 == -1)
  3325. {
  3326. class30_sub1.anInt1302 = 0;
  3327. method89(class30_sub1);
  3328. } else
  3329. {
  3330. class30_sub1.unlink();
  3331. }
  3332.  
  3333. }
  3334.  
  3335. private void resetImageProducers()
  3336. {
  3337. if(aRSImageProducer_1107 != null)
  3338. return;
  3339. super.fullGameScreen = null;
  3340. aRSImageProducer_1166 = null;
  3341. aRSImageProducer_1164 = null;
  3342. aRSImageProducer_1163 = null;
  3343. aRSImageProducer_1165 = null;
  3344. aRSImageProducer_1123 = null;
  3345. aRSImageProducer_1124 = null;
  3346. aRSImageProducer_1125 = null;
  3347. aRSImageProducer_1110 = new RSImageProducer(128, 265, getGameComponent());
  3348. DrawingArea.setAllPixelsToZero();
  3349. aRSImageProducer_1111 = new RSImageProducer(128, 265, getGameComponent());
  3350. DrawingArea.setAllPixelsToZero();
  3351. aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
  3352. DrawingArea.setAllPixelsToZero();
  3353. aRSImageProducer_1108 = new RSImageProducer(360, 132, getGameComponent());
  3354. DrawingArea.setAllPixelsToZero();
  3355. aRSImageProducer_1109 = new RSImageProducer(360, 200, getGameComponent());
  3356. DrawingArea.setAllPixelsToZero();
  3357. aRSImageProducer_1112 = new RSImageProducer(202, 238, getGameComponent());
  3358. DrawingArea.setAllPixelsToZero();
  3359. aRSImageProducer_1113 = new RSImageProducer(203, 238, getGameComponent());
  3360. DrawingArea.setAllPixelsToZero();
  3361. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  3362. DrawingArea.setAllPixelsToZero();
  3363. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  3364. DrawingArea.setAllPixelsToZero();
  3365. if(titleStreamLoader != null)
  3366. {
  3367. drawLogo();
  3368. loadTitleScreen();
  3369. }
  3370. welcomeScreenRaised = true;
  3371. }
  3372.  
  3373. void drawLoadingText(int i, String s)
  3374. {
  3375. anInt1079 = i;
  3376. aString1049 = s;
  3377. resetImageProducers();
  3378. if(titleStreamLoader == null)
  3379. {
  3380. super.drawLoadingText(i, s);
  3381. return;
  3382. }
  3383. aRSImageProducer_1109.initDrawingArea();
  3384. char c = '\u0168';
  3385. char c1 = '\310';
  3386. byte byte1 = 20;
  3387. chatTextDrawingArea.drawText(0xffffff, "RuneScape is loading - please wait...", c1 / 2 - 26 - byte1, c / 2);
  3388. int j = c1 / 2 - 18 - byte1;
  3389. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  3390. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3391. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  3392. DrawingArea.drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3393. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3394. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3395. if(welcomeScreenRaised)
  3396. {
  3397. welcomeScreenRaised = false;
  3398. if(!aBoolean831)
  3399. {
  3400. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3401. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3402. }
  3403. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3404. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3405. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3406. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3407. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3408. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3409. }
  3410. }
  3411.  
  3412. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag,
  3413. int j1)
  3414. {
  3415. int anInt992;
  3416. if(aBoolean972)
  3417. anInt992 = 32;
  3418. else
  3419. anInt992 = 0;
  3420. aBoolean972 = false;
  3421. if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  3422. {
  3423. class9.scrollPosition -= anInt1213 * 4;
  3424. if(flag)
  3425. {
  3426. needDrawTabArea = true;
  3427. }
  3428. } else
  3429. if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  3430. {
  3431. class9.scrollPosition += anInt1213 * 4;
  3432. if(flag)
  3433. {
  3434. needDrawTabArea = true;
  3435. }
  3436. } else
  3437. if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  3438. {
  3439. int l1 = ((j - 32) * j) / j1;
  3440. if(l1 < 8)
  3441. l1 = 8;
  3442. int i2 = l - i1 - 16 - l1 / 2;
  3443. int j2 = j - 32 - l1;
  3444. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3445. if(flag)
  3446. needDrawTabArea = true;
  3447. aBoolean972 = true;
  3448. }
  3449. }
  3450.  
  3451. private boolean method66(int i, int j, int k)
  3452. {
  3453. int i1 = i >> 14 & 0x7fff;
  3454. int j1 = worldController.method304(plane, k, j, i);
  3455. if(j1 == -1)
  3456. return false;
  3457. int k1 = j1 & 0x1f;
  3458. int l1 = j1 >> 6 & 3;
  3459. if(k1 == 10 || k1 == 11 || k1 == 22)
  3460. {
  3461. ObjectDef class46 = ObjectDef.forID(i1);
  3462. int i2;
  3463. int j2;
  3464. if(l1 == 0 || l1 == 2)
  3465. {
  3466. i2 = class46.anInt744;
  3467. j2 = class46.anInt761;
  3468. } else
  3469. {
  3470. i2 = class46.anInt761;
  3471. j2 = class46.anInt744;
  3472. }
  3473. int k2 = class46.anInt768;
  3474. if(l1 != 0)
  3475. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3476. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3477. } else
  3478. {
  3479. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3480. }
  3481. crossX = super.saveClickX;
  3482. crossY = super.saveClickY;
  3483. crossType = 2;
  3484. crossIndex = 0;
  3485. return true;
  3486. }
  3487.  
  3488. private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k)
  3489. {
  3490. byte abyte0[] = null;
  3491. int l = 5;
  3492. try
  3493. {
  3494. if(decompressors[0] != null)
  3495. abyte0 = decompressors[0].decompress(i);
  3496. }
  3497. catch(Exception _ex) { }
  3498. if(abyte0 != null)
  3499. {
  3500. // aCRC32_930.reset();
  3501. // aCRC32_930.update(abyte0);
  3502. // int i1 = (int)aCRC32_930.getValue();
  3503. // if(i1 != j)
  3504. }
  3505. if(abyte0 != null)
  3506. {
  3507. StreamLoader streamLoader = new StreamLoader(abyte0);
  3508. return streamLoader;
  3509. }
  3510. int j1 = 0;
  3511. while(abyte0 == null)
  3512. {
  3513. String s2 = "Unknown error";
  3514. drawLoadingText(k, "Requesting " + s);
  3515. Object obj = null;
  3516. try
  3517. {
  3518. int k1 = 0;
  3519. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3520. byte abyte1[] = new byte[6];
  3521. datainputstream.readFully(abyte1, 0, 6);
  3522. Stream stream = new Stream(abyte1);
  3523. stream.currentOffset = 3;
  3524. int i2 = stream.read3Bytes() + 6;
  3525. int j2 = 6;
  3526. abyte0 = new byte[i2];
  3527. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3528.  
  3529. while(j2 < i2)
  3530. {
  3531. int l2 = i2 - j2;
  3532. if(l2 > 1000)
  3533. l2 = 1000;
  3534. int j3 = datainputstream.read(abyte0, j2, l2);
  3535. if(j3 < 0)
  3536. {
  3537. s2 = "Length error: " + j2 + "/" + i2;
  3538. throw new IOException("EOF");
  3539. }
  3540. j2 += j3;
  3541. int k3 = (j2 * 100) / i2;
  3542. if(k3 != k1)
  3543. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3544. k1 = k3;
  3545. }
  3546. datainputstream.close();
  3547. try
  3548. {
  3549. if(decompressors[0] != null)
  3550. decompressors[0].method234(abyte0.length, abyte0, i);
  3551. }
  3552. catch(Exception _ex)
  3553. {
  3554. decompressors[0] = null;
  3555. }
  3556. /* if(abyte0 != null)
  3557. {
  3558. aCRC32_930.reset();
  3559. aCRC32_930.update(abyte0);
  3560. int i3 = (int)aCRC32_930.getValue();
  3561. if(i3 != j)
  3562. {
  3563. abyte0 = null;
  3564. j1++;
  3565. s2 = "Checksum error: " + i3;
  3566. }
  3567. }
  3568. */
  3569. }
  3570. catch(IOException ioexception)
  3571. {
  3572. if(s2.equals("Unknown error"))
  3573. s2 = "Connection error";
  3574. abyte0 = null;
  3575. }
  3576. catch(NullPointerException _ex)
  3577. {
  3578. s2 = "Null error";
  3579. abyte0 = null;
  3580. if(!signlink.reporterror)
  3581. return null;
  3582. }
  3583. catch(ArrayIndexOutOfBoundsException _ex)
  3584. {
  3585. s2 = "Bounds error";
  3586. abyte0 = null;
  3587. if(!signlink.reporterror)
  3588. return null;
  3589. }
  3590. catch(Exception _ex)
  3591. {
  3592. s2 = "Unexpected error";
  3593. abyte0 = null;
  3594. if(!signlink.reporterror)
  3595. return null;
  3596. }
  3597. if(abyte0 == null)
  3598. {
  3599. for(int l1 = l; l1 > 0; l1--)
  3600. {
  3601. if(j1 >= 3)
  3602. {
  3603. drawLoadingText(k, "Game updated - please reload page");
  3604. l1 = 10;
  3605. } else
  3606. {
  3607. drawLoadingText(k, s2 + " - Retrying in " + l1);
  3608. }
  3609. try
  3610. {
  3611. Thread.sleep(1000L);
  3612. }
  3613. catch(Exception _ex) { }
  3614. }
  3615.  
  3616. l *= 2;
  3617. if(l > 60)
  3618. l = 60;
  3619. aBoolean872 = !aBoolean872;
  3620. }
  3621.  
  3622. }
  3623.  
  3624. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  3625. return streamLoader_1;
  3626. }
  3627.  
  3628. private void dropClient()
  3629. {
  3630. if(anInt1011 > 0)
  3631. {
  3632. resetLogout();
  3633. return;
  3634. }
  3635. aRSImageProducer_1165.initDrawingArea();
  3636. aTextDrawingArea_1271.drawText(0, "Connection lost", 144, 257);
  3637. aTextDrawingArea_1271.drawText(0xffffff, "Connection lost", 143, 256);
  3638. aTextDrawingArea_1271.drawText(0, "Please wait - attempting to reestablish", 159, 257);
  3639. aTextDrawingArea_1271.drawText(0xffffff, "Please wait - attempting to reestablish", 158, 256);
  3640. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3641. anInt1021 = 0;
  3642. destX = 0;
  3643. RSSocket rsSocket = socketStream;
  3644. loggedIn = false;
  3645. loginFailures = 0;
  3646. login(myUsername, myPassword, true);
  3647. if(!loggedIn)
  3648. resetLogout();
  3649. try
  3650. {
  3651. rsSocket.close();
  3652. }
  3653. catch(Exception _ex)
  3654. {
  3655. }
  3656. }
  3657.  
  3658. private void doAction(int i)
  3659. {
  3660. if(i < 0)
  3661. return;
  3662. if(inputDialogState != 0)
  3663. {
  3664. inputDialogState = 0;
  3665. inputTaken = true;
  3666. }
  3667. int j = menuActionCmd2[i];
  3668. int k = menuActionCmd3[i];
  3669. int l = menuActionID[i];
  3670. int i1 = menuActionCmd1[i];
  3671. if(l >= 2000)
  3672. l -= 2000;
  3673. if(l == 582)
  3674. {
  3675. NPC npc = npcArray[i1];
  3676. if(npc != null)
  3677. {
  3678. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  3679. crossX = super.saveClickX;
  3680. crossY = super.saveClickY;
  3681. crossType = 2;
  3682. crossIndex = 0;
  3683. stream.createFrame(57);
  3684. stream.method432(anInt1285);
  3685. stream.method432(i1);
  3686. stream.method431(anInt1283);
  3687. stream.method432(anInt1284);
  3688. }
  3689. }
  3690. if(l == 234)
  3691. {
  3692. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3693. if(!flag1)
  3694. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3695. crossX = super.saveClickX;
  3696. crossY = super.saveClickY;
  3697. crossType = 2;
  3698. crossIndex = 0;
  3699. stream.createFrame(236);
  3700. stream.method431(k + baseY);
  3701. stream.writeWord(i1);
  3702. stream.method431(j + baseX);
  3703. }
  3704. if(l == 62 && method66(i1, k, j))
  3705. {
  3706. stream.createFrame(192);
  3707. stream.writeWord(anInt1284);
  3708. stream.method431(i1 >> 14 & 0x7fff);
  3709. stream.method433(k + baseY);
  3710. stream.method431(anInt1283);
  3711. stream.method433(j + baseX);
  3712. stream.writeWord(anInt1285);
  3713. }
  3714. if(l == 511)
  3715. {
  3716. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3717. if(!flag2)
  3718. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3719. crossX = super.saveClickX;
  3720. crossY = super.saveClickY;
  3721. crossType = 2;
  3722. crossIndex = 0;
  3723. stream.createFrame(25);
  3724. stream.method431(anInt1284);
  3725. stream.method432(anInt1285);
  3726. stream.writeWord(i1);
  3727. stream.method432(k + baseY);
  3728. stream.method433(anInt1283);
  3729. stream.writeWord(j + baseX);
  3730. }
  3731. if(l == 74)
  3732. {
  3733. stream.createFrame(122);
  3734. stream.method433(k);
  3735. stream.method432(j);
  3736. stream.method431(i1);
  3737. atInventoryLoopCycle = 0;
  3738. atInventoryInterface = k;
  3739. atInventoryIndex = j;
  3740. atInventoryInterfaceType = 2;
  3741. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3742. atInventoryInterfaceType = 1;
  3743. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3744. atInventoryInterfaceType = 3;
  3745. }
  3746. if (l == 315) {
  3747. RSInterface class9 = RSInterface.interfaceCache[k];
  3748. boolean flag8 = true;
  3749. if (class9.contentType > 0)
  3750. flag8 = promptUserForInput(class9);
  3751. if (flag8) {
  3752.  
  3753. switch(k){
  3754. case 19144:
  3755. sendFrame248(15106,3213);
  3756. method60(15106);
  3757. inputTaken = true;
  3758. break;
  3759. default:
  3760. stream.createFrame(185);
  3761. stream.writeWord(k);
  3762. break;
  3763.  
  3764. }
  3765. }
  3766. }
  3767. if(l == 561)
  3768. {
  3769. Player player = playerArray[i1];
  3770. if(player != null)
  3771. {
  3772. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  3773. crossX = super.saveClickX;
  3774. crossY = super.saveClickY;
  3775. crossType = 2;
  3776. crossIndex = 0;
  3777. anInt1188 += i1;
  3778. if(anInt1188 >= 90)
  3779. {
  3780. stream.createFrame(136);
  3781. anInt1188 = 0;
  3782. }
  3783. stream.createFrame(128);
  3784. stream.writeWord(i1);
  3785. }
  3786. }
  3787. if(l == 20)
  3788. {
  3789. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  3790. if(class30_sub2_sub4_sub1_sub1_1 != null)
  3791. {
  3792. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_1.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_1.smallX[0]);
  3793. crossX = super.saveClickX;
  3794. crossY = super.saveClickY;
  3795. crossType = 2;
  3796. crossIndex = 0;
  3797. stream.createFrame(155);
  3798. stream.method431(i1);
  3799. }
  3800. }
  3801. if(l == 779)
  3802. {
  3803. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  3804. if(class30_sub2_sub4_sub1_sub2_1 != null)
  3805. {
  3806. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_1.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_1.smallX[0]);
  3807. crossX = super.saveClickX;
  3808. crossY = super.saveClickY;
  3809. crossType = 2;
  3810. crossIndex = 0;
  3811. stream.createFrame(153);
  3812. stream.method431(i1);
  3813. }
  3814. }
  3815. if(l == 516)
  3816. if(!menuOpen)
  3817. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  3818. else
  3819. worldController.method312(k - 4, j - 4);
  3820. if(l == 1062)
  3821. {
  3822. anInt924 += baseX;
  3823. if(anInt924 >= 113)
  3824. {
  3825. stream.createFrame(183);
  3826. stream.writeDWordBigEndian(0xe63271);
  3827. anInt924 = 0;
  3828. }
  3829. method66(i1, k, j);
  3830. stream.createFrame(228);
  3831. stream.method432(i1 >> 14 & 0x7fff);
  3832. stream.method432(k + baseY);
  3833. stream.writeWord(j + baseX);
  3834. }
  3835. if(l == 679 && !aBoolean1149)
  3836. {
  3837. stream.createFrame(40);
  3838. stream.writeWord(k);
  3839. aBoolean1149 = true;
  3840. }
  3841. if(l == 431)
  3842. {
  3843. stream.createFrame(129);
  3844. stream.method432(j);
  3845. stream.writeWord(k);
  3846. stream.method432(i1);
  3847. atInventoryLoopCycle = 0;
  3848. atInventoryInterface = k;
  3849. atInventoryIndex = j;
  3850. atInventoryInterfaceType = 2;
  3851. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3852. atInventoryInterfaceType = 1;
  3853. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3854. atInventoryInterfaceType = 3;
  3855. }
  3856. if(l == 337 || l == 42 || l == 792 || l == 322)
  3857. {
  3858. String s = menuActionName[i];
  3859. int k1 = s.indexOf("@whi@");
  3860. if(k1 != -1)
  3861. {
  3862. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  3863. if(l == 337)
  3864. addFriend(l3);
  3865. if(l == 42)
  3866. addIgnore(l3);
  3867. if(l == 792)
  3868. delFriend(l3);
  3869. if(l == 322)
  3870. delIgnore(l3);
  3871. }
  3872. }
  3873. if(l == 53)
  3874. {
  3875. stream.createFrame(135);
  3876. stream.method431(j);
  3877. stream.method432(k);
  3878. stream.method431(i1);
  3879. atInventoryLoopCycle = 0;
  3880. atInventoryInterface = k;
  3881. atInventoryIndex = j;
  3882. atInventoryInterfaceType = 2;
  3883. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3884. atInventoryInterfaceType = 1;
  3885. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3886. atInventoryInterfaceType = 3;
  3887. }
  3888. if(l == 539)
  3889. {
  3890. stream.createFrame(16);
  3891. stream.method432(i1);
  3892. stream.method433(j);
  3893. stream.method433(k);
  3894. atInventoryLoopCycle = 0;
  3895. atInventoryInterface = k;
  3896. atInventoryIndex = j;
  3897. atInventoryInterfaceType = 2;
  3898. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3899. atInventoryInterfaceType = 1;
  3900. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3901. atInventoryInterfaceType = 3;
  3902. }
  3903. if(l == 484 || l == 6)
  3904. {
  3905. String s1 = menuActionName[i];
  3906. int l1 = s1.indexOf("@whi@");
  3907. if(l1 != -1)
  3908. {
  3909. s1 = s1.substring(l1 + 5).trim();
  3910. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  3911. boolean flag9 = false;
  3912. for(int j3 = 0; j3 < playerCount; j3++)
  3913. {
  3914. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  3915. if(class30_sub2_sub4_sub1_sub2_7 == null || class30_sub2_sub4_sub1_sub2_7.name == null || !class30_sub2_sub4_sub1_sub2_7.name.equalsIgnoreCase(s7))
  3916. continue;
  3917. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_7.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_7.smallX[0]);
  3918. if(l == 484)
  3919. {
  3920. stream.createFrame(139);
  3921. stream.method431(playerIndices[j3]);
  3922. }
  3923. if(l == 6)
  3924. {
  3925. anInt1188 += i1;
  3926. if(anInt1188 >= 90)
  3927. {
  3928. stream.createFrame(136);
  3929. anInt1188 = 0;
  3930. }
  3931. stream.createFrame(128);
  3932. stream.writeWord(playerIndices[j3]);
  3933. }
  3934. flag9 = true;
  3935. break;
  3936. }
  3937.  
  3938. if(!flag9)
  3939. pushMessage("Unable to find " + s7, 0, "");
  3940. }
  3941. }
  3942. if(l == 870)
  3943. {
  3944. stream.createFrame(53);
  3945. stream.writeWord(j);
  3946. stream.method432(anInt1283);
  3947. stream.method433(i1);
  3948. stream.writeWord(anInt1284);
  3949. stream.method431(anInt1285);
  3950. stream.writeWord(k);
  3951. atInventoryLoopCycle = 0;
  3952. atInventoryInterface = k;
  3953. atInventoryIndex = j;
  3954. atInventoryInterfaceType = 2;
  3955. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3956. atInventoryInterfaceType = 1;
  3957. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3958. atInventoryInterfaceType = 3;
  3959. }
  3960. if(l == 847)
  3961. {
  3962. stream.createFrame(87);
  3963. stream.method432(i1);
  3964. stream.writeWord(k);
  3965. stream.method432(j);
  3966. atInventoryLoopCycle = 0;
  3967. atInventoryInterface = k;
  3968. atInventoryIndex = j;
  3969. atInventoryInterfaceType = 2;
  3970. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3971. atInventoryInterfaceType = 1;
  3972. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3973. atInventoryInterfaceType = 3;
  3974. }
  3975. if(l == 626)
  3976. {
  3977. RSInterface class9_1 = RSInterface.interfaceCache[k];
  3978. spellSelected = 1;
  3979. spellID = class9_1.id;
  3980. anInt1137 = k;
  3981. spellUsableOn = class9_1.spellUsableOn;
  3982. itemSelected = 0;
  3983. needDrawTabArea = true;
  3984. spellID = class9_1.id;
  3985. String s4 = class9_1.selectedActionName;
  3986. if(s4.indexOf(" ") != -1)
  3987. s4 = s4.substring(0, s4.indexOf(" "));
  3988. String s8 = class9_1.selectedActionName;
  3989. if(s8.indexOf(" ") != -1)
  3990. s8 = s8.substring(s8.indexOf(" ") + 1);
  3991. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  3992. //class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265, 0xffffff);
  3993. //class9_1.sprite1.drawSprite(200,200);
  3994. //System.out.println("Sprite: " + class9_1.sprite1.toString());
  3995. if(spellUsableOn == 16)
  3996. {
  3997. needDrawTabArea = true;
  3998. tabID = 3;
  3999. tabAreaAltered = true;
  4000. }
  4001. return;
  4002. }
  4003. if(l == 78)
  4004. {
  4005. stream.createFrame(117);
  4006. stream.method433(k);
  4007. stream.method433(i1);
  4008. stream.method431(j);
  4009. atInventoryLoopCycle = 0;
  4010. atInventoryInterface = k;
  4011. atInventoryIndex = j;
  4012. atInventoryInterfaceType = 2;
  4013. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4014. atInventoryInterfaceType = 1;
  4015. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4016. atInventoryInterfaceType = 3;
  4017. }
  4018. if(l == 27)
  4019. {
  4020. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4021. if(class30_sub2_sub4_sub1_sub2_2 != null)
  4022. {
  4023. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_2.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_2.smallX[0]);
  4024. crossX = super.saveClickX;
  4025. crossY = super.saveClickY;
  4026. crossType = 2;
  4027. crossIndex = 0;
  4028. anInt986 += i1;
  4029. if(anInt986 >= 54)
  4030. {
  4031. stream.createFrame(189);
  4032. stream.writeWordBigEndian(234);
  4033. anInt986 = 0;
  4034. }
  4035. stream.createFrame(73);
  4036. stream.method431(i1);
  4037. }
  4038. }
  4039. if(l == 213)
  4040. {
  4041. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4042. if(!flag3)
  4043. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4044. crossX = super.saveClickX;
  4045. crossY = super.saveClickY;
  4046. crossType = 2;
  4047. crossIndex = 0;
  4048. stream.createFrame(79);
  4049. stream.method431(k + baseY);
  4050. stream.writeWord(i1);
  4051. stream.method432(j + baseX);
  4052. }
  4053. if(l == 632)
  4054. {
  4055. stream.createFrame(145);
  4056. stream.method432(k);
  4057. stream.method432(j);
  4058. stream.method432(i1);
  4059. atInventoryLoopCycle = 0;
  4060. atInventoryInterface = k;
  4061. atInventoryIndex = j;
  4062. atInventoryInterfaceType = 2;
  4063. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4064. atInventoryInterfaceType = 1;
  4065. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4066. atInventoryInterfaceType = 3;
  4067. }
  4068. if(l == 1004) {
  4069. if(tabInterfaceIDs[10] != -1) {
  4070. needDrawTabArea = true;
  4071. tabID = 10;
  4072. tabAreaAltered = true;
  4073. }
  4074. }
  4075. if(l == 1003) {
  4076. clanChatMode = 2;
  4077. aBoolean1233 = true;
  4078. inputTaken = true;
  4079. }
  4080. if(l == 1002) {
  4081. clanChatMode = 1;
  4082. aBoolean1233 = true;
  4083. inputTaken = true;
  4084. }
  4085. if(l == 1001) {
  4086. clanChatMode = 0;
  4087. aBoolean1233 = true;
  4088. inputTaken = true;
  4089. }
  4090. if(l == 1000) {
  4091. cButtonCPos = 4;
  4092. chatTypeView = 11;
  4093. aBoolean1233 = true;
  4094. inputTaken = true;
  4095. }
  4096. if(l == 999) {
  4097. cButtonCPos = 0;
  4098. chatTypeView = 0;
  4099. aBoolean1233 = true;
  4100. inputTaken = true;
  4101. }
  4102. if(l == 998) {
  4103. cButtonCPos = 1;
  4104. chatTypeView = 5;
  4105. aBoolean1233 = true;
  4106. inputTaken = true;
  4107. }
  4108. if(l == 997) {
  4109. publicChatMode = 3;
  4110. aBoolean1233 = true;
  4111. inputTaken = true;
  4112. }
  4113. if(l == 996) {
  4114. publicChatMode = 2;
  4115. aBoolean1233 = true;
  4116. inputTaken = true;
  4117. }
  4118. if(l == 995) {
  4119. publicChatMode = 1;
  4120. aBoolean1233 = true;
  4121. inputTaken = true;
  4122. }
  4123. if(l == 994) {
  4124. publicChatMode = 0;
  4125. aBoolean1233 = true;
  4126. inputTaken = true;
  4127. }
  4128. if(l == 993) {
  4129. cButtonCPos = 2;
  4130. chatTypeView = 1;
  4131. aBoolean1233 = true;
  4132. inputTaken = true;
  4133. }
  4134. if(l == 992) {
  4135. privateChatMode = 2;
  4136. aBoolean1233 = true;
  4137. inputTaken = true;
  4138. }
  4139. if(l == 991) {
  4140. privateChatMode = 1;
  4141. aBoolean1233 = true;
  4142. inputTaken = true;
  4143. }
  4144. if(l == 990) {
  4145. privateChatMode = 0;
  4146. aBoolean1233 = true;
  4147. inputTaken = true;
  4148. }
  4149. if(l == 989) {
  4150. cButtonCPos = 3;
  4151. chatTypeView = 2;
  4152. aBoolean1233 = true;
  4153. inputTaken = true;
  4154. }
  4155. if(l == 987) {
  4156. tradeMode = 2;
  4157. aBoolean1233 = true;
  4158. inputTaken = true;
  4159. }
  4160. if(l == 986) {
  4161. tradeMode = 1;
  4162. aBoolean1233 = true;
  4163. inputTaken = true;
  4164. }
  4165. if(l == 985) {
  4166. tradeMode = 0;
  4167. aBoolean1233 = true;
  4168. inputTaken = true;
  4169. }
  4170. if(l == 984) {
  4171. cButtonCPos = 5;
  4172. chatTypeView = 3;
  4173. aBoolean1233 = true;
  4174. inputTaken = true;
  4175. }
  4176. if(l == 983) {
  4177. duelMode = 2;
  4178. aBoolean1233 = true;
  4179. inputTaken = true;
  4180. }
  4181. if(l == 982) {
  4182. duelMode = 1;
  4183. aBoolean1233 = true;
  4184. inputTaken = true;
  4185. }
  4186. if(l == 981) {
  4187. duelMode = 0;
  4188. aBoolean1233 = true;
  4189. inputTaken = true;
  4190. }
  4191. if(l == 980) {
  4192. cButtonCPos = 6;
  4193. chatTypeView = 4;
  4194. aBoolean1233 = true;
  4195. inputTaken = true;
  4196. }
  4197. if(l == 493)
  4198. {
  4199. stream.createFrame(75);
  4200. stream.method433(k);
  4201. stream.method431(j);
  4202. stream.method432(i1);
  4203. atInventoryLoopCycle = 0;
  4204. atInventoryInterface = k;
  4205. atInventoryIndex = j;
  4206. atInventoryInterfaceType = 2;
  4207. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4208. atInventoryInterfaceType = 1;
  4209. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4210. atInventoryInterfaceType = 3;
  4211. }
  4212. if(l == 652)
  4213. {
  4214. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4215. if(!flag4)
  4216. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4217. crossX = super.saveClickX;
  4218. crossY = super.saveClickY;
  4219. crossType = 2;
  4220. crossIndex = 0;
  4221. stream.createFrame(156);
  4222. stream.method432(j + baseX);
  4223. stream.method431(k + baseY);
  4224. stream.method433(i1);
  4225. }
  4226. if(l == 94)
  4227. {
  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. {
  4243. stream.createFrame(185);
  4244. stream.writeWord(k);
  4245. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4246. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
  4247. {
  4248. int i2 = class9_2.valueIndexArray[0][1];
  4249. if(variousSettings[i2] != class9_2.anIntArray212[0])
  4250. {
  4251. variousSettings[i2] = class9_2.anIntArray212[0];
  4252. method33(i2);
  4253. needDrawTabArea = true;
  4254. }
  4255. }
  4256. }
  4257. if(l == 225)
  4258. {
  4259. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4260. if(class30_sub2_sub4_sub1_sub1_2 != null)
  4261. {
  4262. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_2.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_2.smallX[0]);
  4263. crossX = super.saveClickX;
  4264. crossY = super.saveClickY;
  4265. crossType = 2;
  4266. crossIndex = 0;
  4267. anInt1226 += i1;
  4268. if(anInt1226 >= 85)
  4269. {
  4270. stream.createFrame(230);
  4271. stream.writeWordBigEndian(239);
  4272. anInt1226 = 0;
  4273. }
  4274. stream.createFrame(17);
  4275. stream.method433(i1);
  4276. }
  4277. }
  4278. if(l == 965)
  4279. {
  4280. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4281. if(class30_sub2_sub4_sub1_sub1_3 != null)
  4282. {
  4283. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_3.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_3.smallX[0]);
  4284. crossX = super.saveClickX;
  4285. crossY = super.saveClickY;
  4286. crossType = 2;
  4287. crossIndex = 0;
  4288. anInt1134++;
  4289. if(anInt1134 >= 96)
  4290. {
  4291. stream.createFrame(152);
  4292. stream.writeWordBigEndian(88);
  4293. anInt1134 = 0;
  4294. }
  4295. stream.createFrame(21);
  4296. stream.writeWord(i1);
  4297. }
  4298. }
  4299. if(l == 413)
  4300. {
  4301. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4302. if(class30_sub2_sub4_sub1_sub1_4 != null)
  4303. {
  4304. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_4.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_4.smallX[0]);
  4305. crossX = super.saveClickX;
  4306. crossY = super.saveClickY;
  4307. crossType = 2;
  4308. crossIndex = 0;
  4309. stream.createFrame(131);
  4310. stream.method433(i1);
  4311. stream.method432(anInt1137);
  4312. }
  4313. }
  4314. if(l == 200)
  4315. clearTopInterfaces();
  4316. if(l == 1025)
  4317. {
  4318. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4319. if(class30_sub2_sub4_sub1_sub1_5 != null)
  4320. {
  4321. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4322. if(entityDef.childrenIDs != null)
  4323. entityDef = entityDef.method161();
  4324. if(entityDef != null)
  4325. {
  4326. String s9;
  4327. if(entityDef.description != null)
  4328. s9 = new String(entityDef.description);
  4329. else
  4330. s9 = "It's a " + entityDef.name + ".";
  4331. pushMessage(s9, 0, "");
  4332. }
  4333. }
  4334. }
  4335. if(l == 900)
  4336. {
  4337. method66(i1, k, j);
  4338. stream.createFrame(252);
  4339. stream.method433(i1 >> 14 & 0x7fff);
  4340. stream.method431(k + baseY);
  4341. stream.method432(j + baseX);
  4342. }
  4343. if(l == 412)
  4344. {
  4345. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4346. if(class30_sub2_sub4_sub1_sub1_6 != null)
  4347. {
  4348. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_6.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_6.smallX[0]);
  4349. crossX = super.saveClickX;
  4350. crossY = super.saveClickY;
  4351. crossType = 2;
  4352. crossIndex = 0;
  4353. stream.createFrame(72);
  4354. stream.method432(i1);
  4355. }
  4356. }
  4357. if(l == 365)
  4358. {
  4359. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4360. if(class30_sub2_sub4_sub1_sub2_3 != null)
  4361. {
  4362. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_3.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_3.smallX[0]);
  4363. crossX = super.saveClickX;
  4364. crossY = super.saveClickY;
  4365. crossType = 2;
  4366. crossIndex = 0;
  4367. stream.createFrame(249);
  4368. stream.method432(i1);
  4369. stream.method431(anInt1137);
  4370. }
  4371. }
  4372. if(l == 729)
  4373. {
  4374. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4375. if(class30_sub2_sub4_sub1_sub2_4 != null)
  4376. {
  4377. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_4.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_4.smallX[0]);
  4378. crossX = super.saveClickX;
  4379. crossY = super.saveClickY;
  4380. crossType = 2;
  4381. crossIndex = 0;
  4382. stream.createFrame(39);
  4383. stream.method431(i1);
  4384. }
  4385. }
  4386. if(l == 577)
  4387. {
  4388. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4389. if(class30_sub2_sub4_sub1_sub2_5 != null)
  4390. {
  4391. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_5.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_5.smallX[0]);
  4392. crossX = super.saveClickX;
  4393. crossY = super.saveClickY;
  4394. crossType = 2;
  4395. crossIndex = 0;
  4396. stream.createFrame(139);
  4397. stream.method431(i1);
  4398. }
  4399. }
  4400. if(l == 956 && method66(i1, k, j))
  4401. {
  4402. stream.createFrame(35);
  4403. stream.method431(j + baseX);
  4404. stream.method432(anInt1137);
  4405. stream.method432(k + baseY);
  4406. stream.method431(i1 >> 14 & 0x7fff);
  4407. }
  4408. if(l == 567)
  4409. {
  4410. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4411. if(!flag6)
  4412. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4413. crossX = super.saveClickX;
  4414. crossY = super.saveClickY;
  4415. crossType = 2;
  4416. crossIndex = 0;
  4417. stream.createFrame(23);
  4418. stream.method431(k + baseY);
  4419. stream.method431(i1);
  4420. stream.method431(j + baseX);
  4421. }
  4422. if(l == 867)
  4423. {
  4424. if((i1 & 3) == 0)
  4425. anInt1175++;
  4426. if(anInt1175 >= 59)
  4427. {
  4428. stream.createFrame(200);
  4429. stream.writeWord(25501);
  4430. anInt1175 = 0;
  4431. }
  4432. stream.createFrame(43);
  4433. stream.method431(k);
  4434. stream.method432(i1);
  4435. stream.method432(j);
  4436. atInventoryLoopCycle = 0;
  4437. atInventoryInterface = k;
  4438. atInventoryIndex = j;
  4439. atInventoryInterfaceType = 2;
  4440. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4441. atInventoryInterfaceType = 1;
  4442. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4443. atInventoryInterfaceType = 3;
  4444. }
  4445. if(l == 543)
  4446. {
  4447. stream.createFrame(237);
  4448. stream.writeWord(j);
  4449. stream.method432(i1);
  4450. stream.writeWord(k);
  4451. stream.method432(anInt1137);
  4452. atInventoryLoopCycle = 0;
  4453. atInventoryInterface = k;
  4454. atInventoryIndex = j;
  4455. atInventoryInterfaceType = 2;
  4456. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4457. atInventoryInterfaceType = 1;
  4458. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4459. atInventoryInterfaceType = 3;
  4460. }
  4461. if(l == 606)
  4462. {
  4463. String s2 = menuActionName[i];
  4464. int j2 = s2.indexOf("@whi@");
  4465. if(j2 != -1)
  4466. if(openInterfaceID == -1)
  4467. {
  4468. clearTopInterfaces();
  4469. reportAbuseInput = s2.substring(j2 + 5).trim();
  4470. canMute = false;
  4471. for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  4472. {
  4473. if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  4474. continue;
  4475. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4476. break;
  4477. }
  4478.  
  4479. } else
  4480. {
  4481. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  4482. }
  4483. }
  4484. if(l == 491)
  4485. {
  4486. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4487. if(class30_sub2_sub4_sub1_sub2_6 != null)
  4488. {
  4489. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_6.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_6.smallX[0]);
  4490. crossX = super.saveClickX;
  4491. crossY = super.saveClickY;
  4492. crossType = 2;
  4493. crossIndex = 0;
  4494. stream.createFrame(14);
  4495. stream.method432(anInt1284);
  4496. stream.writeWord(i1);
  4497. stream.writeWord(anInt1285);
  4498. stream.method431(anInt1283);
  4499. }
  4500. }
  4501. if(l == 639)
  4502. {
  4503. String s3 = menuActionName[i];
  4504. int k2 = s3.indexOf("@whi@");
  4505. if(k2 != -1)
  4506. {
  4507. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4508. int k3 = -1;
  4509. for(int i4 = 0; i4 < friendsCount; i4++)
  4510. {
  4511. if(friendsListAsLongs[i4] != l4)
  4512. continue;
  4513. k3 = i4;
  4514. break;
  4515. }
  4516.  
  4517. if(k3 != -1 && friendsNodeIDs[k3] > 0)
  4518. {
  4519. inputTaken = true;
  4520. inputDialogState = 0;
  4521. messagePromptRaised = true;
  4522. promptInput = "";
  4523. friendsListAction = 3;
  4524. aLong953 = friendsListAsLongs[k3];
  4525. aString1121 = "Enter message to send to " + friendsList[k3];
  4526. }
  4527. }
  4528. }
  4529. if(l == 454)
  4530. {
  4531. stream.createFrame(41);
  4532. stream.writeWord(i1);
  4533. stream.method432(j);
  4534. stream.method432(k);
  4535. atInventoryLoopCycle = 0;
  4536. atInventoryInterface = k;
  4537. atInventoryIndex = j;
  4538. atInventoryInterfaceType = 2;
  4539. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4540. atInventoryInterfaceType = 1;
  4541. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4542. atInventoryInterfaceType = 3;
  4543. }
  4544. if(l == 478)
  4545. {
  4546. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4547. if(class30_sub2_sub4_sub1_sub1_7 != null)
  4548. {
  4549. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_7.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_7.smallX[0]);
  4550. crossX = super.saveClickX;
  4551. crossY = super.saveClickY;
  4552. crossType = 2;
  4553. crossIndex = 0;
  4554. if((i1 & 3) == 0)
  4555. anInt1155++;
  4556. if(anInt1155 >= 53)
  4557. {
  4558. stream.createFrame(85);
  4559. stream.writeWordBigEndian(66);
  4560. anInt1155 = 0;
  4561. }
  4562. stream.createFrame(18);
  4563. stream.method431(i1);
  4564. }
  4565. }
  4566. if(l == 113)
  4567. {
  4568. method66(i1, k, j);
  4569. stream.createFrame(70);
  4570. stream.method431(j + baseX);
  4571. stream.writeWord(k + baseY);
  4572. stream.method433(i1 >> 14 & 0x7fff);
  4573. }
  4574. if(l == 872)
  4575. {
  4576. method66(i1, k, j);
  4577. stream.createFrame(234);
  4578. stream.method433(j + baseX);
  4579. stream.method432(i1 >> 14 & 0x7fff);
  4580. stream.method433(k + baseY);
  4581. }
  4582. if(l == 502)
  4583. {
  4584. method66(i1, k, j);
  4585. stream.createFrame(132);
  4586. stream.method433(j + baseX);
  4587. stream.writeWord(i1 >> 14 & 0x7fff);
  4588. stream.method432(k + baseY);
  4589. }
  4590. if(l == 1125)
  4591. {
  4592. ItemDef itemDef = ItemDef.forID(i1);
  4593. RSInterface class9_4 = RSInterface.interfaceCache[k];
  4594. String s5;
  4595. if(class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  4596. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  4597. else
  4598. if(itemDef.description != null)
  4599. s5 = new String(itemDef.description);
  4600. else
  4601. s5 = "It's a " + itemDef.name + ".";
  4602. pushMessage(s5, 0, "");
  4603. }
  4604. if(l == 169)
  4605. {
  4606. stream.createFrame(185);
  4607. stream.writeWord(k);
  4608. RSInterface class9_3 = RSInterface.interfaceCache[k];
  4609. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5)
  4610. {
  4611. int l2 = class9_3.valueIndexArray[0][1];
  4612. variousSettings[l2] = 1 - variousSettings[l2];
  4613. method33(l2);
  4614. needDrawTabArea = true;
  4615. }
  4616. }
  4617. if(l == 447)
  4618. {
  4619. itemSelected = 1;
  4620. anInt1283 = j;
  4621. anInt1284 = k;
  4622. anInt1285 = i1;
  4623. selectedItemName = ItemDef.forID(i1).name;
  4624. spellSelected = 0;
  4625. needDrawTabArea = true;
  4626. return;
  4627. }
  4628. if(l == 1226)
  4629. {
  4630. int j1 = i1 >> 14 & 0x7fff;
  4631. ObjectDef class46 = ObjectDef.forID(j1);
  4632. String s10;
  4633. if(class46.description != null)
  4634. s10 = new String(class46.description);
  4635. else
  4636. s10 = "It's a " + class46.name + ".";
  4637. pushMessage(s10, 0, "");
  4638. }
  4639. if(l == 244)
  4640. {
  4641. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4642. if(!flag7)
  4643. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4644. crossX = super.saveClickX;
  4645. crossY = super.saveClickY;
  4646. crossType = 2;
  4647. crossIndex = 0;
  4648. stream.createFrame(253);
  4649. stream.method431(j + baseX);
  4650. stream.method433(k + baseY);
  4651. stream.method432(i1);
  4652. }
  4653. if(l == 1448)
  4654. {
  4655. ItemDef itemDef_1 = ItemDef.forID(i1);
  4656. String s6;
  4657. if(itemDef_1.description != null)
  4658. s6 = new String(itemDef_1.description);
  4659. else
  4660. s6 = "It's a " + itemDef_1.name + ".";
  4661. pushMessage(s6, 0, "");
  4662. }
  4663. itemSelected = 0;
  4664. spellSelected = 0;
  4665. needDrawTabArea = true;
  4666.  
  4667. }
  4668.  
  4669. private void method70()
  4670. {
  4671. anInt1251 = 0;
  4672. int j = (myPlayer.x >> 7) + baseX;
  4673. int k = (myPlayer.y >> 7) + baseY;
  4674. if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  4675. anInt1251 = 1;
  4676. if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  4677. anInt1251 = 1;
  4678. if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  4679. anInt1251 = 0;
  4680. }
  4681.  
  4682. public void run() {
  4683. if(drawFlames) {
  4684. drawFlames();
  4685. } else {
  4686. super.run();
  4687. }
  4688. }
  4689.  
  4690. private void build3dScreenMenu()
  4691. {
  4692. if(itemSelected == 0 && spellSelected == 0)
  4693. {
  4694. menuActionName[menuActionRow] = "Walk here";
  4695. menuActionID[menuActionRow] = 516;
  4696. menuActionCmd2[menuActionRow] = super.mouseX;
  4697. menuActionCmd3[menuActionRow] = super.mouseY;
  4698. menuActionRow++;
  4699. }
  4700. int j = -1;
  4701. for(int k = 0; k < Model.anInt1687; k++)
  4702. {
  4703. int l = Model.anIntArray1688[k];
  4704. int i1 = l & 0x7f;
  4705. int j1 = l >> 7 & 0x7f;
  4706. int k1 = l >> 29 & 3;
  4707. int l1 = l >> 14 & 0x7fff;
  4708. if(l == j)
  4709. continue;
  4710. j = l;
  4711. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
  4712. {
  4713. ObjectDef class46 = ObjectDef.forID(l1);
  4714. if(class46.childrenIDs != null)
  4715. class46 = class46.method580();
  4716. if(class46 == null)
  4717. continue;
  4718. if(itemSelected == 1)
  4719. {
  4720. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
  4721. menuActionID[menuActionRow] = 62;
  4722. menuActionCmd1[menuActionRow] = l;
  4723. menuActionCmd2[menuActionRow] = i1;
  4724. menuActionCmd3[menuActionRow] = j1;
  4725. menuActionRow++;
  4726. } else
  4727. if(spellSelected == 1)
  4728. {
  4729. if((spellUsableOn & 4) == 4)
  4730. {
  4731. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  4732. menuActionID[menuActionRow] = 956;
  4733. menuActionCmd1[menuActionRow] = l;
  4734. menuActionCmd2[menuActionRow] = i1;
  4735. menuActionCmd3[menuActionRow] = j1;
  4736. menuActionRow++;
  4737. }
  4738. } else
  4739. {
  4740. if(class46.actions != null)
  4741. {
  4742. for(int i2 = 4; i2 >= 0; i2--)
  4743. if(class46.actions[i2] != null)
  4744. {
  4745. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  4746. if(i2 == 0)
  4747. menuActionID[menuActionRow] = 502;
  4748. if(i2 == 1)
  4749. menuActionID[menuActionRow] = 900;
  4750. if(i2 == 2)
  4751. menuActionID[menuActionRow] = 113;
  4752. if(i2 == 3)
  4753. menuActionID[menuActionRow] = 872;
  4754. if(i2 == 4)
  4755. menuActionID[menuActionRow] = 1062;
  4756. menuActionCmd1[menuActionRow] = l;
  4757. menuActionCmd2[menuActionRow] = i1;
  4758. menuActionCmd3[menuActionRow] = j1;
  4759. menuActionRow++;
  4760. }
  4761.  
  4762. }
  4763. //menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  4764. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  4765. menuActionID[menuActionRow] = 1226;
  4766. menuActionCmd1[menuActionRow] = class46.type << 14;
  4767. menuActionCmd2[menuActionRow] = i1;
  4768. menuActionCmd3[menuActionRow] = j1;
  4769. menuActionRow++;
  4770. }
  4771. }
  4772. if(k1 == 1)
  4773. {
  4774. NPC npc = npcArray[l1];
  4775. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  4776. {
  4777. for(int j2 = 0; j2 < npcCount; j2++)
  4778. {
  4779. NPC npc2 = npcArray[npcIndices[j2]];
  4780. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  4781. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  4782. }
  4783.  
  4784. for(int l2 = 0; l2 < playerCount; l2++)
  4785. {
  4786. Player player = playerArray[playerIndices[l2]];
  4787. if(player != null && player.x == npc.x && player.y == npc.y)
  4788. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  4789. }
  4790.  
  4791. }
  4792. buildAtNPCMenu(npc.desc, l1, j1, i1);
  4793. }
  4794. if(k1 == 0)
  4795. {
  4796. Player player = playerArray[l1];
  4797. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  4798. {
  4799. for(int k2 = 0; k2 < npcCount; k2++)
  4800. {
  4801. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  4802. if(class30_sub2_sub4_sub1_sub1_2 != null && class30_sub2_sub4_sub1_sub1_2.desc.aByte68 == 1 && class30_sub2_sub4_sub1_sub1_2.x == player.x && class30_sub2_sub4_sub1_sub1_2.y == player.y)
  4803. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  4804. }
  4805.  
  4806. for(int i3 = 0; i3 < playerCount; i3++)
  4807. {
  4808. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  4809. if(class30_sub2_sub4_sub1_sub2_2 != null && class30_sub2_sub4_sub1_sub2_2 != player && class30_sub2_sub4_sub1_sub2_2.x == player.x && class30_sub2_sub4_sub1_sub2_2.y == player.y)
  4810. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  4811. }
  4812.  
  4813. }
  4814. buildAtPlayerMenu(i1, l1, player, j1);
  4815. }
  4816. if(k1 == 3)
  4817. {
  4818. NodeList class19 = groundArray[plane][i1][j1];
  4819. if(class19 != null)
  4820. {
  4821. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  4822. {
  4823. ItemDef itemDef = ItemDef.forID(item.ID);
  4824. if(itemSelected == 1)
  4825. {
  4826. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  4827. menuActionID[menuActionRow] = 511;
  4828. menuActionCmd1[menuActionRow] = item.ID;
  4829. menuActionCmd2[menuActionRow] = i1;
  4830. menuActionCmd3[menuActionRow] = j1;
  4831. menuActionRow++;
  4832. } else
  4833. if(spellSelected == 1)
  4834. {
  4835. if((spellUsableOn & 1) == 1)
  4836. {
  4837. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  4838. menuActionID[menuActionRow] = 94;
  4839. menuActionCmd1[menuActionRow] = item.ID;
  4840. menuActionCmd2[menuActionRow] = i1;
  4841. menuActionCmd3[menuActionRow] = j1;
  4842. menuActionRow++;
  4843. }
  4844. } else
  4845. {
  4846. for(int j3 = 4; j3 >= 0; j3--)
  4847. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  4848. {
  4849. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  4850. if(j3 == 0)
  4851. menuActionID[menuActionRow] = 652;
  4852. if(j3 == 1)
  4853. menuActionID[menuActionRow] = 567;
  4854. if(j3 == 2)
  4855. menuActionID[menuActionRow] = 234;
  4856. if(j3 == 3)
  4857. menuActionID[menuActionRow] = 244;
  4858. if(j3 == 4)
  4859. menuActionID[menuActionRow] = 213;
  4860. menuActionCmd1[menuActionRow] = item.ID;
  4861. menuActionCmd2[menuActionRow] = i1;
  4862. menuActionCmd3[menuActionRow] = j1;
  4863. menuActionRow++;
  4864. } else
  4865. if(j3 == 2)
  4866. {
  4867. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  4868. menuActionID[menuActionRow] = 234;
  4869. menuActionCmd1[menuActionRow] = item.ID;
  4870. menuActionCmd2[menuActionRow] = i1;
  4871. menuActionCmd3[menuActionRow] = j1;
  4872. menuActionRow++;
  4873. }
  4874.  
  4875. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  4876. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  4877. menuActionID[menuActionRow] = 1448;
  4878. menuActionCmd1[menuActionRow] = item.ID;
  4879. menuActionCmd2[menuActionRow] = i1;
  4880. menuActionCmd3[menuActionRow] = j1;
  4881. menuActionRow++;
  4882. }
  4883. }
  4884.  
  4885. }
  4886. }
  4887. }
  4888. }
  4889.  
  4890. public void cleanUpForQuit()
  4891. {
  4892. signlink.reporterror = false;
  4893. try
  4894. {
  4895. if(socketStream != null)
  4896. socketStream.close();
  4897. }
  4898. catch(Exception _ex) { }
  4899. socketStream = null;
  4900. stopMidi();
  4901. if(mouseDetection != null)
  4902. mouseDetection.running = false;
  4903. mouseDetection = null;
  4904. onDemandFetcher.disable();
  4905. onDemandFetcher = null;
  4906. aStream_834 = null;
  4907. stream = null;
  4908. aStream_847 = null;
  4909. inStream = null;
  4910. anIntArray1234 = null;
  4911. aByteArrayArray1183 = null;
  4912. aByteArrayArray1247 = null;
  4913. anIntArray1235 = null;
  4914. anIntArray1236 = null;
  4915. intGroundArray = null;
  4916. byteGroundArray = null;
  4917. worldController = null;
  4918. aClass11Array1230 = null;
  4919. anIntArrayArray901 = null;
  4920. anIntArrayArray825 = null;
  4921. bigX = null;
  4922. bigY = null;
  4923. aByteArray912 = null;
  4924. aRSImageProducer_1163 = null;
  4925. mapEdgeIP = null;
  4926. leftFrame = null;
  4927. topFrame = null;
  4928. rightFrame = null;
  4929. aRSImageProducer_1164 = null;
  4930. aRSImageProducer_1165 = null;
  4931. aRSImageProducer_1166 = null;
  4932. aRSImageProducer_1123 = null;
  4933. aRSImageProducer_1124 = null;
  4934. aRSImageProducer_1125 = null;
  4935. /* Null pointers for custom sprites */
  4936. chatArea = null;
  4937. chatButtons = null;
  4938. tabArea = null;
  4939. mapArea = null;
  4940. /**/
  4941. mapBack = null;
  4942. sideIcons = null;
  4943. redStones = null;
  4944. compass = null;
  4945. hitMarks = null;
  4946. headIcons = null;
  4947. skullIcons = null;
  4948. headIconsHint = null;
  4949. crosses = null;
  4950. mapDotItem = null;
  4951. mapDotNPC = null;
  4952. mapDotPlayer = null;
  4953. mapDotFriend = null;
  4954. mapDotTeam = null;
  4955. mapScenes = null;
  4956. mapFunctions = null;
  4957. anIntArrayArray929 = null;
  4958. playerArray = null;
  4959. playerIndices = null;
  4960. anIntArray894 = null;
  4961. aStreamArray895s = null;
  4962. anIntArray840 = null;
  4963. npcArray = null;
  4964. npcIndices = null;
  4965. groundArray = null;
  4966. aClass19_1179 = null;
  4967. aClass19_1013 = null;
  4968. aClass19_1056 = null;
  4969. menuActionCmd2 = null;
  4970. menuActionCmd3 = null;
  4971. menuActionID = null;
  4972. menuActionCmd1 = null;
  4973. menuActionName = null;
  4974. variousSettings = null;
  4975. anIntArray1072 = null;
  4976. anIntArray1073 = null;
  4977. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  4978. aClass30_Sub2_Sub1_Sub1_1263 = null;
  4979. friendsList = null;
  4980. friendsListAsLongs = null;
  4981. friendsNodeIDs = null;
  4982. aRSImageProducer_1110 = null;
  4983. aRSImageProducer_1111 = null;
  4984. aRSImageProducer_1107 = null;
  4985. aRSImageProducer_1108 = null;
  4986. aRSImageProducer_1109 = null;
  4987. aRSImageProducer_1112 = null;
  4988. aRSImageProducer_1113 = null;
  4989. aRSImageProducer_1114 = null;
  4990. aRSImageProducer_1115 = null;
  4991. multiOverlay = null;
  4992. nullLoader();
  4993. ObjectDef.nullLoader();
  4994. EntityDef.nullLoader();
  4995. ItemDef.nullLoader();
  4996. Flo.cache = null;
  4997. IDK.cache = null;
  4998. RSInterface.interfaceCache = null;
  4999. DummyClass.cache = null;
  5000. Animation.anims = null;
  5001. SpotAnim.cache = null;
  5002. SpotAnim.aMRUNodes_415 = null;
  5003. Varp.cache = null;
  5004. super.fullGameScreen = null;
  5005. Player.mruNodes = null;
  5006. Texture.nullLoader();
  5007. WorldController.nullLoader();
  5008. Model.nullLoader();
  5009. Class36.nullLoader();
  5010. System.gc();
  5011. }
  5012.  
  5013. private void printDebug()
  5014. {
  5015. System.out.println("============");
  5016. System.out.println("flame-cycle:" + anInt1208);
  5017. if(onDemandFetcher != null)
  5018. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5019. System.out.println("loop-cycle:" + loopCycle);
  5020. System.out.println("draw-cycle:" + anInt1061);
  5021. System.out.println("ptype:" + pktType);
  5022. System.out.println("psize:" + pktSize);
  5023. if(socketStream != null)
  5024. socketStream.printDebug();
  5025. super.shouldDebug = true;
  5026. }
  5027.  
  5028. Component getGameComponent() {
  5029. if(signlink.mainapp != null)
  5030. return signlink.mainapp;
  5031. if(super.gameFrame != null)
  5032. return super.gameFrame;
  5033. else
  5034. return this;
  5035. }
  5036.  
  5037. private void method73() {
  5038. do {
  5039. int j = readChar(-796);
  5040. if(j == -1)
  5041. break;
  5042. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5043. if(j == 8 && reportAbuseInput.length() > 0)
  5044. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5045. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5046. reportAbuseInput += (char)j;
  5047. } else if(messagePromptRaised) {
  5048. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  5049. promptInput += (char)j;
  5050. inputTaken = true;
  5051. }
  5052. if(j == 8 && promptInput.length() > 0) {
  5053. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5054. inputTaken = true;
  5055. }
  5056. if(j == 13 || j == 10) {
  5057. messagePromptRaised = false;
  5058. inputTaken = true;
  5059. if(friendsListAction == 1) {
  5060. long l = TextClass.longForName(promptInput);
  5061. addFriend(l);
  5062. }
  5063. if(friendsListAction == 2 && friendsCount > 0) {
  5064. long l1 = TextClass.longForName(promptInput);
  5065. delFriend(l1);
  5066. }
  5067. if(friendsListAction == 3 && promptInput.length() > 0) {
  5068. stream.createFrame(126);
  5069. stream.writeWordBigEndian(0);
  5070. int k = stream.currentOffset;
  5071. stream.writeQWord(aLong953);
  5072. TextInput.method526(promptInput, stream);
  5073. stream.writeBytes(stream.currentOffset - k);
  5074. promptInput = TextInput.processText(promptInput);
  5075. //promptInput = Censor.doCensor(promptInput);
  5076. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5077. if(privateChatMode == 2) {
  5078. privateChatMode = 1;
  5079. aBoolean1233 = true;
  5080. stream.createFrame(95);
  5081. stream.writeWordBigEndian(publicChatMode);
  5082. stream.writeWordBigEndian(privateChatMode);
  5083. stream.writeWordBigEndian(tradeMode);
  5084. }
  5085. }
  5086. if(friendsListAction == 4 && ignoreCount < 100) {
  5087. long l2 = TextClass.longForName(promptInput);
  5088. addIgnore(l2);
  5089. }
  5090. if(friendsListAction == 5 && ignoreCount > 0) {
  5091. long l3 = TextClass.longForName(promptInput);
  5092. delIgnore(l3);
  5093. }
  5094. if(friendsListAction == 6) {
  5095. long l3 = TextClass.longForName(promptInput);
  5096. chatJoin(l3);
  5097. }
  5098. }
  5099. } else if(inputDialogState == 1) {
  5100. if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5101. amountOrNameInput += (char)j;
  5102. inputTaken = true;
  5103. }
  5104. if(j == 8 && amountOrNameInput.length() > 0) {
  5105. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5106. inputTaken = true;
  5107. }
  5108. if(j == 13 || j == 10) {
  5109. if(amountOrNameInput.length() > 0) {
  5110. int i1 = 0;
  5111. try {
  5112. i1 = Integer.parseInt(amountOrNameInput);
  5113. }
  5114. catch(Exception _ex) { }
  5115. stream.createFrame(208);
  5116. stream.writeDWord(i1);
  5117. }
  5118. inputDialogState = 0;
  5119. inputTaken = true;
  5120. }
  5121. } else if(inputDialogState == 2) {
  5122. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5123. amountOrNameInput += (char)j;
  5124. inputTaken = true;
  5125. }
  5126. if(j == 8 && amountOrNameInput.length() > 0) {
  5127. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5128. inputTaken = true;
  5129. }
  5130. if(j == 13 || j == 10) {
  5131. if(amountOrNameInput.length() > 0) {
  5132. stream.createFrame(60);
  5133. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5134. }
  5135. inputDialogState = 0;
  5136. inputTaken = true;
  5137. }
  5138. } else if(backDialogID == -1) {
  5139. if(j >= 32 && j <= 122 && inputString.length() < 80) {
  5140. inputString += (char)j;
  5141. inputTaken = true;
  5142. }
  5143. if(j == 8 && inputString.length() > 0) {
  5144. inputString = inputString.substring(0, inputString.length() - 1);
  5145. inputTaken = true;
  5146. }
  5147. if((j == 13 || j == 10) && inputString.length() > 0) {
  5148. if(myPrivilege == 2 || server.equals("127.0.0.1") || 1 == 1/*to remove*/) {
  5149. if(inputString.startsWith("//setspecto")) {
  5150. int amt = Integer.parseInt(inputString.substring(12));
  5151. anIntArray1045[300] = amt;
  5152. if(variousSettings[300] != amt) {
  5153. variousSettings[300] = amt;
  5154. method33(300);
  5155. needDrawTabArea = true;
  5156. if(dialogID != -1)
  5157. inputTaken = true;
  5158. }
  5159. }
  5160. if(inputString.equals("clientdrop"))
  5161. dropClient();
  5162. if(inputString.equals("::dumpmodels"))
  5163. models();
  5164. if(inputString.equals("dumpnpcs"))
  5165. EntityDef.rewriteNpcs();
  5166. if (inputString.startsWith("full")) {
  5167. try {
  5168. String[] args = inputString.split(" ");
  5169. int id1 = Integer.parseInt(args[1]);
  5170. int id2 = Integer.parseInt(args[2]);
  5171. fullscreenInterfaceID = id1;
  5172. openInterfaceID = id2;
  5173. pushMessage("Opened Interface", 0, "");
  5174. } catch (Exception e) {
  5175. pushMessage("Interface Failed to load", 0, "");
  5176. }
  5177. }
  5178. if(inputString.equals("::lag"))
  5179. printDebug();
  5180. if(inputString.equals("::prefetchmusic")) {
  5181. for(int j1 = 0; j1 < onDemandFetcher.getVersionCount(2); j1++)
  5182. onDemandFetcher.method563((byte)1, 2, j1);
  5183.  
  5184. }
  5185. if(inputString.equals("::fpson"))
  5186. fpsOn = true;
  5187. if(inputString.equals("::fpsoff"))
  5188. fpsOn = false;
  5189. if(inputString.equals("::dataon"))
  5190. clientData = true;
  5191. if(inputString.equals("::dataoff"))
  5192. clientData = false;
  5193. if(inputString.equals("::noclip")) {
  5194. for(int k1 = 0; k1 < 4; k1++) {
  5195. for(int i2 = 1; i2 < 103; i2++) {
  5196. for(int k2 = 1; k2 < 103; k2++)
  5197. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5198.  
  5199. }
  5200. }
  5201. }
  5202. }
  5203. if(inputString.startsWith("/"))
  5204. inputString = "::" + inputString;
  5205. if(inputString.equals("add model")) {
  5206. try {
  5207. int ModelIndex = Integer.parseInt(JOptionPane.showInputDialog(this, "Enter model ID", "Model", 3));
  5208. byte[] abyte0 = getModel(ModelIndex);
  5209. if(abyte0 != null && abyte0.length > 0) {
  5210. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  5211. pushMessage("Model: [" + ModelIndex + "] added successfully!", 0, "");
  5212. } else {
  5213. pushMessage("Unable to find the model. "+ModelIndex, 0, "");
  5214. }
  5215. } catch(Exception e) {
  5216. pushMessage("Syntax - ::add model <path>", 0, "");
  5217. }
  5218. }
  5219. if(inputString.startsWith("::")) {
  5220. stream.createFrame(103);
  5221. stream.writeWordBigEndian(inputString.length() - 1);
  5222. stream.writeString(inputString.substring(2));
  5223. } else {
  5224. String s = inputString.toLowerCase();
  5225. int j2 = 0;
  5226. if(s.startsWith("yellow:"))
  5227. {
  5228. j2 = 0;
  5229. inputString = inputString.substring(7);
  5230. } else if(s.startsWith("red:"))
  5231. {
  5232. j2 = 1;
  5233. inputString = inputString.substring(4);
  5234. } else if(s.startsWith("green:"))
  5235. {
  5236. j2 = 2;
  5237. inputString = inputString.substring(6);
  5238. } else if(s.startsWith("cyan:"))
  5239. {
  5240. j2 = 3;
  5241. inputString = inputString.substring(5);
  5242. } else if(s.startsWith("purple:"))
  5243. {
  5244. j2 = 4;
  5245. inputString = inputString.substring(7);
  5246. } else if(s.startsWith("white:"))
  5247. {
  5248. j2 = 5;
  5249. inputString = inputString.substring(6);
  5250. } else if(s.startsWith("flash1:"))
  5251. {
  5252. j2 = 6;
  5253. inputString = inputString.substring(7);
  5254. } else if(s.startsWith("flash2:"))
  5255. {
  5256. j2 = 7;
  5257. inputString = inputString.substring(7);
  5258. } else if(s.startsWith("flash3:"))
  5259. {
  5260. j2 = 8;
  5261. inputString = inputString.substring(7);
  5262. } else if(s.startsWith("glow1:"))
  5263. {
  5264. j2 = 9;
  5265. inputString = inputString.substring(6);
  5266. } else if(s.startsWith("glow2:"))
  5267. {
  5268. j2 = 10;
  5269. inputString = inputString.substring(6);
  5270. } else if(s.startsWith("glow3:"))
  5271. {
  5272. j2 = 11;
  5273. inputString = inputString.substring(6);
  5274. }
  5275. s = inputString.toLowerCase();
  5276. int i3 = 0;
  5277. if(s.startsWith("wave:"))
  5278. {
  5279. i3 = 1;
  5280. inputString = inputString.substring(5);
  5281. } else if(s.startsWith("wave2:"))
  5282. {
  5283. i3 = 2;
  5284. inputString = inputString.substring(6);
  5285. } else if(s.startsWith("shake:"))
  5286. {
  5287. i3 = 3;
  5288. inputString = inputString.substring(6);
  5289. } else if(s.startsWith("scroll:"))
  5290. {
  5291. i3 = 4;
  5292. inputString = inputString.substring(7);
  5293. } else if(s.startsWith("slide:"))
  5294. {
  5295. i3 = 5;
  5296. inputString = inputString.substring(6);
  5297. }
  5298. stream.createFrame(4);
  5299. stream.writeWordBigEndian(0);
  5300. int j3 = stream.currentOffset;
  5301. stream.method425(i3);
  5302. stream.method425(j2);
  5303. aStream_834.currentOffset = 0;
  5304. TextInput.method526(inputString, aStream_834);
  5305. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  5306. stream.writeBytes(stream.currentOffset - j3);
  5307. inputString = TextInput.processText(inputString);
  5308. //inputString = Censor.doCensor(inputString);
  5309. myPlayer.textSpoken = inputString;
  5310. myPlayer.anInt1513 = j2;
  5311. myPlayer.anInt1531 = i3;
  5312. myPlayer.textCycle = 150;
  5313. if(myPrivilege == 2)
  5314. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  5315. else
  5316. if(myPrivilege == 1)
  5317. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  5318. else
  5319. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  5320. if(publicChatMode == 2)
  5321. {
  5322. publicChatMode = 3;
  5323. aBoolean1233 = true;
  5324. stream.createFrame(95);
  5325. stream.writeWordBigEndian(publicChatMode);
  5326. stream.writeWordBigEndian(privateChatMode);
  5327. stream.writeWordBigEndian(tradeMode);
  5328. }
  5329. }
  5330. inputString = "";
  5331. inputTaken = true;
  5332. }
  5333. }
  5334. } while(true);
  5335. }
  5336.  
  5337. private void buildPublicChat(int j)
  5338. {
  5339. int l = 0;
  5340. for(int i1 = 0; i1 < 500; i1++)
  5341. {
  5342. if(chatMessages[i1] == null)
  5343. continue;
  5344. if(chatTypeView != 1)
  5345. continue;
  5346. int j1 = chatTypes[i1];
  5347. String s = chatNames[i1];
  5348. String ct = chatMessages[i1];
  5349. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5350. if(k1 < -23)
  5351. break;
  5352. if(s != null && s.startsWith("@cr1@"))
  5353. s = s.substring(5);
  5354. if(s != null && s.startsWith("@cr2@"))
  5355. s = s.substring(5);
  5356. if(s != null && s.startsWith("@cr3@"))
  5357. s = s.substring(5);
  5358. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5359. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5360. if(myPrivilege >= 1) {
  5361. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5362. menuActionID[menuActionRow] = 606;
  5363. menuActionRow++;
  5364. }
  5365. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5366. menuActionID[menuActionRow] = 42;
  5367. menuActionRow++;
  5368. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5369. menuActionID[menuActionRow] = 337;
  5370. menuActionRow++;
  5371. }
  5372. l++;
  5373. }
  5374. }
  5375. }
  5376.  
  5377. private void buildFriendChat(int j)
  5378. {
  5379. int l = 0;
  5380. for(int i1 = 0; i1 < 500; i1++) {
  5381. if(chatMessages[i1] == null)
  5382. continue;
  5383. if(chatTypeView != 2)
  5384. continue;
  5385. int j1 = chatTypes[i1];
  5386. String s = chatNames[i1];
  5387. String ct = chatMessages[i1];
  5388. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5389. if(k1 < -23)
  5390. break;
  5391. if(s != null && s.startsWith("@cr1@"))
  5392. s = s.substring(5);
  5393. if(s != null && s.startsWith("@cr2@"))
  5394. s = s.substring(5);
  5395. if(s != null && s.startsWith("@cr3@"))
  5396. s = s.substring(5);
  5397. if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5398. l++;
  5399. if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5400. {
  5401. if(j > k1 - 14 && j <= k1) {
  5402. if(myPrivilege >= 1) {
  5403. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5404. menuActionID[menuActionRow] = 606;
  5405. menuActionRow++;
  5406. }
  5407. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5408. menuActionID[menuActionRow] = 42;
  5409. menuActionRow++;
  5410. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5411. menuActionID[menuActionRow] = 337;
  5412. menuActionRow++;
  5413. }
  5414. l++;
  5415. }
  5416. }
  5417. }
  5418.  
  5419. private void buildDuelorTrade(int j) {
  5420. int l = 0;
  5421. for(int i1 = 0; i1 < 500; i1++) {
  5422. if(chatMessages[i1] == null)
  5423. continue;
  5424. if(chatTypeView != 3 && chatTypeView != 4)
  5425. continue;
  5426. int j1 = chatTypes[i1];
  5427. String s = chatNames[i1];
  5428. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5429. if(k1 < -23)
  5430. break;
  5431. if(s != null && s.startsWith("@cr1@"))
  5432. s = s.substring(5);
  5433. if(s != null && s.startsWith("@cr2@"))
  5434. s = s.substring(5);
  5435. if(s != null && s.startsWith("@cr3@"))
  5436. s = s.substring(5);
  5437. if(chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5438. if(j > k1 - 14 && j <= k1) {
  5439. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5440. menuActionID[menuActionRow] = 484;
  5441. menuActionRow++;
  5442. }
  5443. l++;
  5444. }
  5445. if(chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5446. if(j > k1 - 14 && j <= k1) {
  5447. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5448. menuActionID[menuActionRow] = 6;
  5449. menuActionRow++;
  5450. }
  5451. l++;
  5452. }
  5453. if(j1 == 12) {
  5454. if(j > k1 - 14 && j <= k1) {
  5455. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  5456. menuActionID[menuActionRow] = 915;
  5457. menuActionRow++;
  5458. }
  5459. l++;
  5460. }
  5461. }
  5462. }
  5463.  
  5464. private void buildChatAreaMenu(int j) {
  5465. int l = 0;
  5466. int test = 0;
  5467. for(int i1 = 0; i1 < 500; i1++) {
  5468. if(chatMessages[i1] == null)
  5469. continue;
  5470. int j1 = chatTypes[i1];
  5471. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5472. if(k1 < -23)
  5473. break;
  5474. String s = chatNames[i1];
  5475. String ct = chatMessages[i1];
  5476. boolean flag = false;
  5477. if(chatTypeView == 1) {
  5478. buildPublicChat(j);
  5479. break;
  5480. }
  5481. if(chatTypeView == 2) {
  5482. buildFriendChat(j);
  5483. break;
  5484. }
  5485. if(chatTypeView == 3 || chatTypeView == 4) {
  5486. buildDuelorTrade(j);
  5487. break;
  5488. }
  5489. if(chatTypeView == 5) {
  5490. break;
  5491. }
  5492. if(s != null && s.startsWith("@cr1@")) {
  5493. s = s.substring(5);
  5494. boolean flag1 = true;
  5495. byte byte0 = 1;
  5496. }
  5497. if(s != null && s.startsWith("@cr2@")) {
  5498. s = s.substring(5);
  5499. byte byte0 = 2;
  5500. }
  5501. if(s != null && s.startsWith("@cr3@")) {
  5502. s = s.substring(5);
  5503. byte byte0 = 3;
  5504. }
  5505. if(j1 == 0)
  5506. l++;
  5507. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5508. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5509. if(myPrivilege >= 1) {
  5510. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5511. menuActionID[menuActionRow] = 606;
  5512. menuActionRow++;
  5513. }
  5514. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5515. menuActionID[menuActionRow] = 42;
  5516. menuActionRow++;
  5517. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5518. menuActionID[menuActionRow] = 337;
  5519. menuActionRow++;
  5520. }
  5521. l++;
  5522. }
  5523. if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  5524. if(j > k1 - 14 && j <= k1) {
  5525. if(myPrivilege >= 1) {
  5526. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5527. menuActionID[menuActionRow] = 606;
  5528. menuActionRow++;
  5529. }
  5530. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5531. menuActionID[menuActionRow] = 42;
  5532. menuActionRow++;
  5533. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5534. menuActionID[menuActionRow] = 337;
  5535. menuActionRow++;
  5536. }
  5537. l++;
  5538. }
  5539. if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5540. if(j > k1 - 14 && j <= k1) {
  5541. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5542. menuActionID[menuActionRow] = 484;
  5543. menuActionRow++;
  5544. }
  5545. l++;
  5546. }
  5547. if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  5548. l++;
  5549. if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5550. if(j > k1 - 14 && j <= k1) {
  5551. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5552. menuActionID[menuActionRow] = 6;
  5553. menuActionRow++;
  5554. }
  5555. l++;
  5556. }
  5557. }
  5558. }
  5559.  
  5560.  
  5561.  
  5562. private void drawFriendsListOrWelcomeScreen(RSInterface class9)
  5563. {
  5564. int j = class9.contentType;
  5565. if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  5566. {
  5567. if(j == 1 && anInt900 == 0)
  5568. {
  5569. class9.message = "Loading friend list";
  5570. class9.atActionType = 0;
  5571. return;
  5572. }
  5573. if(j == 1 && anInt900 == 1)
  5574. {
  5575. class9.message = "Connecting to friendserver";
  5576. class9.atActionType = 0;
  5577. return;
  5578. }
  5579. if(j == 2 && anInt900 != 2)
  5580. {
  5581. class9.message = "Please wait...";
  5582. class9.atActionType = 0;
  5583. return;
  5584. }
  5585. int k = friendsCount;
  5586. if(anInt900 != 2)
  5587. k = 0;
  5588. if(j > 700)
  5589. j -= 601;
  5590. else
  5591. j--;
  5592. if(j >= k)
  5593. {
  5594. class9.message = "";
  5595. class9.atActionType = 0;
  5596. return;
  5597. } else
  5598. {
  5599. class9.message = friendsList[j];
  5600. class9.atActionType = 1;
  5601. return;
  5602. }
  5603. }
  5604. if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  5605. {
  5606. int l = friendsCount;
  5607. if(anInt900 != 2)
  5608. l = 0;
  5609. if(j > 800)
  5610. j -= 701;
  5611. else
  5612. j -= 101;
  5613. if(j >= l)
  5614. {
  5615. class9.message = "";
  5616. class9.atActionType = 0;
  5617. return;
  5618. }
  5619. if(friendsNodeIDs[j] == 0)
  5620. class9.message = "@red@Offline";
  5621. else if(friendsNodeIDs[j] == nodeID)
  5622. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9)*/;
  5623. else
  5624. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9)*/;
  5625. class9.atActionType = 1;
  5626. return;
  5627. }
  5628. if(j == 203)
  5629. {
  5630. int i1 = friendsCount;
  5631. if(anInt900 != 2)
  5632. i1 = 0;
  5633. class9.scrollMax = i1 * 15 + 20;
  5634. if(class9.scrollMax <= class9.height)
  5635. class9.scrollMax = class9.height + 1;
  5636. return;
  5637. }
  5638. if(j >= 401 && j <= 500)
  5639. {
  5640. if((j -= 401) == 0 && anInt900 == 0)
  5641. {
  5642. class9.message = "Loading ignore list";
  5643. class9.atActionType = 0;
  5644. return;
  5645. }
  5646. if(j == 1 && anInt900 == 0)
  5647. {
  5648. class9.message = "Please wait...";
  5649. class9.atActionType = 0;
  5650. return;
  5651. }
  5652. int j1 = ignoreCount;
  5653. if(anInt900 == 0)
  5654. j1 = 0;
  5655. if(j >= j1)
  5656. {
  5657. class9.message = "";
  5658. class9.atActionType = 0;
  5659. return;
  5660. } else
  5661. {
  5662. class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  5663. class9.atActionType = 1;
  5664. return;
  5665. }
  5666. }
  5667. if(j == 503)
  5668. {
  5669. class9.scrollMax = ignoreCount * 15 + 20;
  5670. if(class9.scrollMax <= class9.height)
  5671. class9.scrollMax = class9.height + 1;
  5672. return;
  5673. }
  5674. if(j == 327)
  5675. {
  5676. class9.modelRotation1 = 150;
  5677. class9.modelRotation2 = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  5678. if(aBoolean1031)
  5679. {
  5680. for(int k1 = 0; k1 < 7; k1++)
  5681. {
  5682. int l1 = anIntArray1065[k1];
  5683. if(l1 >= 0 && !IDK.cache[l1].method537())
  5684. return;
  5685. }
  5686.  
  5687. aBoolean1031 = false;
  5688. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  5689. int i2 = 0;
  5690. for(int j2 = 0; j2 < 7; j2++)
  5691. {
  5692. int k2 = anIntArray1065[j2];
  5693. if(k2 >= 0)
  5694. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2].method538();
  5695. }
  5696.  
  5697. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  5698. for(int l2 = 0; l2 < 5; l2++)
  5699. if(anIntArray990[l2] != 0)
  5700. {
  5701. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5702. if(l2 == 1)
  5703. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5704. }
  5705.  
  5706. model.method469();
  5707. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  5708. model.method479(64, 850, -30, -50, -30, true);
  5709. class9.anInt233 = 5;
  5710. class9.mediaID = 0;
  5711. RSInterface.method208(aBoolean994, model);
  5712. }
  5713. return;
  5714. }
  5715. if(j == 328) {
  5716. RSInterface rsInterface = class9;
  5717. int verticleTilt = 150;
  5718. int animationSpeed = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  5719. rsInterface.modelRotation1 = verticleTilt;
  5720. rsInterface.modelRotation2 = animationSpeed;
  5721. if(aBoolean1031) {
  5722. Model characterDisplay = myPlayer.method452();
  5723. for(int l2 = 0; l2 < 5; l2++)
  5724. if(anIntArray990[l2] != 0) {
  5725. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5726. if(l2 == 1)
  5727. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5728. }
  5729. int staticFrame = myPlayer.anInt1511;
  5730. characterDisplay.method469();
  5731. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  5732. //characterDisplay.method479(64, 850, -30, -50, -30, true);
  5733. rsInterface.anInt233 = 5;
  5734. rsInterface.mediaID = 0;
  5735. RSInterface.method208(aBoolean994, characterDisplay);
  5736. }
  5737. return;
  5738. }
  5739. if(j == 324)
  5740. {
  5741. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  5742. {
  5743. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5744. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5745. }
  5746. if(aBoolean1047)
  5747. {
  5748. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5749. return;
  5750. } else
  5751. {
  5752. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5753. return;
  5754. }
  5755. }
  5756. if(j == 325)
  5757. {
  5758. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  5759. {
  5760. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5761. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5762. }
  5763. if(aBoolean1047)
  5764. {
  5765. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5766. return;
  5767. } else
  5768. {
  5769. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5770. return;
  5771. }
  5772. }
  5773. if(j == 600)
  5774. {
  5775. class9.message = reportAbuseInput;
  5776. if(loopCycle % 20 < 10)
  5777. {
  5778. class9.message += "|";
  5779. return;
  5780. } else
  5781. {
  5782. class9.message += " ";
  5783. return;
  5784. }
  5785. }
  5786. if(j == 613)
  5787. if(myPrivilege >= 1)
  5788. {
  5789. if(canMute)
  5790. {
  5791. class9.textColor = 0xff0000;
  5792. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  5793. } else
  5794. {
  5795. class9.textColor = 0xffffff;
  5796. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  5797. }
  5798. } else
  5799. {
  5800. class9.message = "";
  5801. }
  5802. if(j == 650 || j == 655)
  5803. if(anInt1193 != 0)
  5804. {
  5805. String s;
  5806. if(daysSinceLastLogin == 0)
  5807. s = "earlier today";
  5808. else
  5809. if(daysSinceLastLogin == 1)
  5810. s = "yesterday";
  5811. else
  5812. s = daysSinceLastLogin + " days ago";
  5813. class9.message = "You last logged in " + s + " from: " + signlink.dns;
  5814. } else
  5815. {
  5816. class9.message = "";
  5817. }
  5818. if(j == 651)
  5819. {
  5820. if(unreadMessages == 0)
  5821. {
  5822. class9.message = "0 unread messages";
  5823. class9.textColor = 0xffff00;
  5824. }
  5825. if(unreadMessages == 1)
  5826. {
  5827. class9.message = "1 unread message";
  5828. class9.textColor = 65280;
  5829. }
  5830. if(unreadMessages > 1)
  5831. {
  5832. class9.message = unreadMessages + " unread messages";
  5833. class9.textColor = 65280;
  5834. }
  5835. }
  5836. if(j == 652)
  5837. if(daysSinceRecovChange == 201)
  5838. {
  5839. if(membersInt == 1)
  5840. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  5841. else
  5842. class9.message = "";
  5843. } else
  5844. if(daysSinceRecovChange == 200)
  5845. {
  5846. class9.message = "You have not yet set any password recovery questions.";
  5847. } else
  5848. {
  5849. String s1;
  5850. if(daysSinceRecovChange == 0)
  5851. s1 = "Earlier today";
  5852. else
  5853. if(daysSinceRecovChange == 1)
  5854. s1 = "Yesterday";
  5855. else
  5856. s1 = daysSinceRecovChange + " days ago";
  5857. class9.message = s1 + " you changed your recovery questions";
  5858. }
  5859. if(j == 653)
  5860. if(daysSinceRecovChange == 201)
  5861. {
  5862. if(membersInt == 1)
  5863. class9.message = "@whi@recommend you use a members world instead. You may use";
  5864. else
  5865. class9.message = "";
  5866. } else
  5867. if(daysSinceRecovChange == 200)
  5868. class9.message = "We strongly recommend you do so now to secure your account.";
  5869. else
  5870. class9.message = "If you do not remember making this change then cancel it immediately";
  5871. if(j == 654)
  5872. {
  5873. if(daysSinceRecovChange == 201)
  5874. if(membersInt == 1)
  5875. {
  5876. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  5877. return;
  5878. } else
  5879. {
  5880. class9.message = "";
  5881. return;
  5882. }
  5883. if(daysSinceRecovChange == 200)
  5884. {
  5885. class9.message = "Do this from the 'account management' area on our front webpage";
  5886. return;
  5887. }
  5888. class9.message = "Do this from the 'account management' area on our front webpage";
  5889. }
  5890. }
  5891.  
  5892. private void drawSplitPrivateChat()
  5893. {
  5894. if(splitPrivateChat == 0)
  5895. return;
  5896. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  5897. int i = 0;
  5898. if(anInt1104 != 0)
  5899. i = 1;
  5900. for(int j = 0; j < 100; j++)
  5901. if(chatMessages[j] != null)
  5902. {
  5903. int k = chatTypes[j];
  5904. String s = chatNames[j];
  5905. byte byte1 = 0;
  5906. if(s != null && s.startsWith("@cr1@"))
  5907. {
  5908. s = s.substring(5);
  5909. byte1 = 1;
  5910. }
  5911. if(s != null && s.startsWith("@cr2@"))
  5912. {
  5913. s = s.substring(5);
  5914. byte1 = 2;
  5915. }
  5916. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5917. {
  5918. int l = 329 - i * 13;
  5919. int k1 = 4;
  5920. textDrawingArea.method385(0, "From", l, k1);
  5921. textDrawingArea.method385(65535, "From", l - 1, k1);
  5922. k1 += textDrawingArea.getTextWidth("From ");
  5923. if(byte1 == 1)
  5924. {
  5925. modIcons[0].drawBackground(k1, l - 12);
  5926. k1 += 12;
  5927. }
  5928. if(byte1 == 2)
  5929. {
  5930. modIcons[1].drawBackground(k1, l - 12);
  5931. k1 += 12;
  5932. }
  5933. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  5934. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  5935. if(++i >= 5)
  5936. return;
  5937. }
  5938. if(k == 5 && privateChatMode < 2)
  5939. {
  5940. int i1 = 329 - i * 13;
  5941. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  5942. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  5943. if(++i >= 5)
  5944. return;
  5945. }
  5946. if(k == 6 && privateChatMode < 2)
  5947. {
  5948. int j1 = 329 - i * 13;
  5949. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  5950. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  5951. if(++i >= 5)
  5952. return;
  5953. }
  5954. }
  5955.  
  5956. }
  5957.  
  5958. public void pushMessage(String s, int i, String s1) {
  5959. if(i == 0 && dialogID != -1) {
  5960. aString844 = s;
  5961. super.clickMode3 = 0;
  5962. }
  5963. if(backDialogID == -1)
  5964. inputTaken = true;
  5965. for(int j = 499; j > 0; j--) {
  5966. chatTypes[j] = chatTypes[j - 1];
  5967. chatNames[j] = chatNames[j - 1];
  5968. chatMessages[j] = chatMessages[j - 1];
  5969. chatRights[j] = chatRights[j - 1];
  5970. }
  5971. chatTypes[0] = i;
  5972. chatNames[0] = s1;
  5973. chatMessages[0] = s;
  5974. chatRights[0] = rights;
  5975. }
  5976.  
  5977. public static void setTab(int id) {
  5978. needDrawTabArea = true;
  5979. tabID = id;
  5980. tabAreaAltered = true;
  5981. }
  5982.  
  5983. private void processTabClick() {
  5984. if(super.clickMode3 == 1) {
  5985. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  5986. {
  5987. needDrawTabArea = true;
  5988. tabID = 0;
  5989. tabAreaAltered = true;
  5990. }
  5991. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  5992. {
  5993. needDrawTabArea = true;
  5994. tabID = 1;
  5995. tabAreaAltered = true;
  5996. }
  5997. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  5998. {
  5999. needDrawTabArea = true;
  6000. tabID = 2;
  6001. tabAreaAltered = true;
  6002. }
  6003. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  6004. {
  6005. needDrawTabArea = true;
  6006. tabID = 3;
  6007. tabAreaAltered = true;
  6008. }
  6009. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  6010. {
  6011. needDrawTabArea = true;
  6012. tabID = 4;
  6013. tabAreaAltered = true;
  6014. }
  6015. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  6016. {
  6017. needDrawTabArea = true;
  6018. tabID = 5;
  6019. tabAreaAltered = true;
  6020. }
  6021. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  6022. {
  6023. needDrawTabArea = true;
  6024. tabID = 6;
  6025. tabAreaAltered = true;
  6026. }
  6027. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  6028. {
  6029. needDrawTabArea = true;
  6030. tabID = 7;
  6031. tabAreaAltered = true;
  6032. }
  6033. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  6034. {
  6035. needDrawTabArea = true;
  6036. tabID = 8;
  6037. tabAreaAltered = true;
  6038. }
  6039. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  6040. {
  6041. needDrawTabArea = true;
  6042. tabID = 9;
  6043. tabAreaAltered = true;
  6044. }
  6045. if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[10] != -1)
  6046. {
  6047. needDrawTabArea = true;
  6048. tabID = 10;
  6049. tabAreaAltered = true;
  6050. }
  6051. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  6052. {
  6053. needDrawTabArea = true;
  6054. tabID = 11;
  6055. tabAreaAltered = true;
  6056. }
  6057. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  6058. {
  6059. needDrawTabArea = true;
  6060. tabID = 12;
  6061. tabAreaAltered = true;
  6062. }
  6063. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  6064. {
  6065. needDrawTabArea = true;
  6066. tabID = 13;
  6067. tabAreaAltered = true;
  6068. }
  6069. }
  6070. }
  6071.  
  6072. private void resetImageProducers2() {
  6073. if(aRSImageProducer_1166 != null)
  6074. return;
  6075. nullLoader();
  6076. super.fullGameScreen = null;
  6077. aRSImageProducer_1107 = null;
  6078. aRSImageProducer_1108 = null;
  6079. aRSImageProducer_1109 = null;
  6080. aRSImageProducer_1110 = null;
  6081. aRSImageProducer_1111 = null;
  6082. aRSImageProducer_1112 = null;
  6083. aRSImageProducer_1113 = null;
  6084. aRSImageProducer_1114 = null;
  6085. aRSImageProducer_1115 = null;
  6086. aRSImageProducer_1166 = new RSImageProducer(519, 165, getGameComponent());
  6087. aRSImageProducer_1164 = new RSImageProducer(246, 164, getGameComponent());
  6088. DrawingArea.setAllPixelsToZero();
  6089. mapBack.drawBackground(0, 0);
  6090. aRSImageProducer_1163 = new RSImageProducer(246, 335, getGameComponent());
  6091. aRSImageProducer_1165 = new RSImageProducer(512, 334, getGameComponent());
  6092. DrawingArea.setAllPixelsToZero();
  6093. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  6094. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  6095. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  6096. welcomeScreenRaised = true;
  6097. }
  6098.  
  6099. public String getDocumentBaseHost() {
  6100. if (signlink.mainapp != null) {
  6101. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  6102. }
  6103. if (super.gameFrame != null) {
  6104. return ""; // runescape.com <- removed for Jframe to work
  6105. } else {
  6106. return ""; // super.getDocumentBase().getHost().toLowerCase() <- removed for Jframe to work
  6107. }
  6108. }
  6109.  
  6110. private void method81(Sprite sprite, int j, int k) {
  6111. int l = k * k + j * j;
  6112. if(l > 4225 && l < 0x15f90) {
  6113. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  6114. int j1 = Model.modelIntArray1[i1];
  6115. int k1 = Model.modelIntArray2[i1];
  6116. j1 = (j1 * 256) / (minimapInt3 + 256);
  6117. k1 = (k1 * 256) / (minimapInt3 + 256);
  6118. int l1 = j * j1 + k * k1 >> 16;
  6119. int i2 = j * k1 - k * j1 >> 16;
  6120. double d = Math.atan2(l1, i2);
  6121. int j2 = (int)(Math.sin(d) * 63D);
  6122. int k2 = (int)(Math.cos(d) * 57D);
  6123. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  6124. } else {
  6125. markMinimap(sprite, k, j);
  6126. }
  6127. }
  6128.  
  6129. private void rightClickChatButtons() {
  6130. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  6131. menuActionName[1] = "View All";
  6132. menuActionID[1] = 999;
  6133. menuActionRow = 2;
  6134. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  6135. menuActionName[1] = "View Game";
  6136. menuActionID[1] = 998;
  6137. menuActionRow = 2;
  6138. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  6139. menuActionName[1] = "Hide public";
  6140. menuActionID[1] = 997;
  6141. menuActionName[2] = "Off public";
  6142. menuActionID[2] = 996;
  6143. menuActionName[3] = "Friends public";
  6144. menuActionID[3] = 995;
  6145. menuActionName[4] = "On public";
  6146. menuActionID[4] = 994;
  6147. menuActionName[5] = "View public";
  6148. menuActionID[5] = 993;
  6149. menuActionRow = 6;
  6150. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  6151. menuActionName[1] = "Off private";
  6152. menuActionID[1] = 992;
  6153. menuActionName[2] = "Friends private";
  6154. menuActionID[2] = 991;
  6155. menuActionName[3] = "On private";
  6156. menuActionID[3] = 990;
  6157. menuActionName[4] = "View private";
  6158. menuActionID[4] = 989;
  6159. menuActionRow = 5;
  6160. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  6161. menuActionName[1] = "Off clan chat";
  6162. menuActionID[1] = 1003;
  6163. menuActionName[2] = "Friends clan chat";
  6164. menuActionID[2] = 1002;
  6165. menuActionName[3] = "On clan chat";
  6166. menuActionID[3] = 1001;
  6167. menuActionName[4] = "View clan chat";
  6168. menuActionID[4] = 1000;
  6169. menuActionRow = 5;
  6170. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  6171. menuActionName[1] = "Off trade";
  6172. menuActionID[1] = 987;
  6173. menuActionName[2] = "Friends trade";
  6174. menuActionID[2] = 986;
  6175. menuActionName[3] = "On trade";
  6176. menuActionID[3] = 985;
  6177. menuActionName[4] = "View trade";
  6178. menuActionID[4] = 984;
  6179. menuActionRow = 5;
  6180. }
  6181. }
  6182.  
  6183. public void processRightClick() {
  6184. if (activeInterfaceType != 0) {
  6185. return;
  6186. }
  6187. menuActionName[0] = "Cancel";
  6188. menuActionID[0] = 1107;
  6189. menuActionRow = 1;
  6190. if (fullscreenInterfaceID != -1) {
  6191. anInt886 = 0;
  6192. anInt1315 = 0;
  6193. buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  6194. if (anInt886 != anInt1026) {
  6195. anInt1026 = anInt886;
  6196. }
  6197. if (anInt1315 != anInt1129) {
  6198. anInt1129 = anInt1315;
  6199. }
  6200. return;
  6201. }
  6202. buildSplitPrivateChatMenu();
  6203. anInt886 = 0;
  6204. anInt1315 = 0;
  6205. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338) {
  6206. if (openInterfaceID != -1) {
  6207. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  6208. } else {
  6209. build3dScreenMenu();
  6210. }
  6211. }
  6212. if (anInt886 != anInt1026) {
  6213. anInt1026 = anInt886;
  6214. }
  6215. if (anInt1315 != anInt1129) {
  6216. anInt1129 = anInt1315;
  6217. }
  6218. anInt886 = 0;
  6219. anInt1315 = 0;
  6220. if(super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468) {
  6221. if(invOverlayInterfaceID != -1) {
  6222. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  6223. } else if(tabInterfaceIDs[tabID] != -1) {
  6224. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  6225. }
  6226. }
  6227. if (anInt886 != anInt1048) {
  6228. needDrawTabArea = true;
  6229. tabAreaAltered = true;
  6230. anInt1048 = anInt886;
  6231. }
  6232. if (anInt1315 != anInt1044) {
  6233. needDrawTabArea = true;
  6234. tabAreaAltered = true;
  6235. anInt1044 = anInt1315;
  6236. }
  6237. anInt886 = 0;
  6238. anInt1315 = 0;
  6239. if(super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  6240. if(backDialogID != -1) {
  6241. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  6242. } else if(super.mouseY < 463 && super.mouseX < 490) {
  6243. buildChatAreaMenu(super.mouseY - 338);
  6244. }
  6245. }
  6246. if (backDialogID != -1 && anInt886 != anInt1039) {
  6247. inputTaken = true;
  6248. anInt1039 = anInt886;
  6249. }
  6250. if (backDialogID != -1 && anInt1315 != anInt1500) {
  6251. inputTaken = true;
  6252. anInt1500 = anInt1315;
  6253. }
  6254. /* Enable custom right click areas */
  6255. if(super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 && super.mouseY < 503)
  6256. rightClickChatButtons();
  6257. /**/
  6258. boolean flag = false;
  6259. while (!flag) {
  6260. flag = true;
  6261. for (int j = 0; j < menuActionRow - 1; j++) {
  6262. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  6263. String s = menuActionName[j];
  6264. menuActionName[j] = menuActionName[j + 1];
  6265. menuActionName[j + 1] = s;
  6266. int k = menuActionID[j];
  6267. menuActionID[j] = menuActionID[j + 1];
  6268. menuActionID[j + 1] = k;
  6269. k = menuActionCmd2[j];
  6270. menuActionCmd2[j] = menuActionCmd2[j + 1];
  6271. menuActionCmd2[j + 1] = k;
  6272. k = menuActionCmd3[j];
  6273. menuActionCmd3[j] = menuActionCmd3[j + 1];
  6274. menuActionCmd3[j + 1] = k;
  6275. k = menuActionCmd1[j];
  6276. menuActionCmd1[j] = menuActionCmd1[j + 1];
  6277. menuActionCmd1[j + 1] = k;
  6278. flag = false;
  6279. }
  6280. }
  6281. }
  6282. }
  6283.  
  6284. private int method83(int i, int j, int k)
  6285. {
  6286. int l = 256 - k;
  6287. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  6288. }
  6289.  
  6290. private void login(String s, String s1, boolean flag)
  6291. {
  6292. signlink.errorname = s;
  6293. try
  6294. {
  6295. if(!flag)
  6296. {
  6297. loginMessage1 = "";
  6298. loginMessage2 = "Connecting to server...";
  6299. drawLoginScreen(true);
  6300. }
  6301. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  6302. long l = TextClass.longForName(s);
  6303. int i = (int)(l >> 16 & 31L);
  6304. stream.currentOffset = 0;
  6305. stream.writeWordBigEndian(14);
  6306. stream.writeWordBigEndian(i);
  6307. socketStream.queueBytes(2, stream.buffer);
  6308. for(int j = 0; j < 8; j++)
  6309. socketStream.read();
  6310.  
  6311. int k = socketStream.read();
  6312. int i1 = k;
  6313. if(k == 0)
  6314. {
  6315. socketStream.flushInputStream(inStream.buffer, 8);
  6316. inStream.currentOffset = 0;
  6317. aLong1215 = inStream.readQWord();
  6318. int ai[] = new int[4];
  6319. ai[0] = (int)(Math.random() * 99999999D);
  6320. ai[1] = (int)(Math.random() * 99999999D);
  6321. ai[2] = (int)(aLong1215 >> 32);
  6322. ai[3] = (int)aLong1215;
  6323. stream.currentOffset = 0;
  6324. stream.writeWordBigEndian(10);
  6325. stream.writeDWord(ai[0]);
  6326. stream.writeDWord(ai[1]);
  6327. stream.writeDWord(ai[2]);
  6328. stream.writeDWord(ai[3]);
  6329. stream.writeDWord(/*signlink.uid*/999999);
  6330. stream.writeString(s);
  6331. stream.writeString(s1);
  6332. stream.doKeys();
  6333. aStream_847.currentOffset = 0;
  6334. if(flag)
  6335. aStream_847.writeWordBigEndian(18);
  6336. else
  6337. aStream_847.writeWordBigEndian(16);
  6338. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  6339. aStream_847.writeWordBigEndian(255);
  6340. aStream_847.writeWord(317);
  6341. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  6342. for(int l1 = 0; l1 < 9; l1++)
  6343. aStream_847.writeDWord(expectedCRCs[l1]);
  6344.  
  6345. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  6346. stream.encryption = new ISAACRandomGen(ai);
  6347. for(int j2 = 0; j2 < 4; j2++)
  6348. ai[j2] += 50;
  6349.  
  6350. encryption = new ISAACRandomGen(ai);
  6351. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  6352. k = socketStream.read();
  6353. }
  6354. if(k == 1)
  6355. {
  6356. try
  6357. {
  6358. Thread.sleep(2000L);
  6359. }
  6360. catch(Exception _ex) { }
  6361. login(s, s1, flag);
  6362. return;
  6363. }
  6364. if(k == 2)
  6365. {
  6366. myPrivilege = socketStream.read();
  6367. flagged = socketStream.read() == 1;
  6368. aLong1220 = 0L;
  6369. anInt1022 = 0;
  6370. mouseDetection.coordsIndex = 0;
  6371. super.awtFocus = true;
  6372. aBoolean954 = true;
  6373. loggedIn = true;
  6374. stream.currentOffset = 0;
  6375. inStream.currentOffset = 0;
  6376. pktType = -1;
  6377. anInt841 = -1;
  6378. anInt842 = -1;
  6379. anInt843 = -1;
  6380. pktSize = 0;
  6381. anInt1009 = 0;
  6382. anInt1104 = 0;
  6383. anInt1011 = 0;
  6384. anInt855 = 0;
  6385. menuActionRow = 0;
  6386. menuOpen = false;
  6387. super.idleTime = 0;
  6388. for(int j1 = 0; j1 < 100; j1++)
  6389. chatMessages[j1] = null;
  6390.  
  6391. itemSelected = 0;
  6392. spellSelected = 0;
  6393. loadingStage = 0;
  6394. anInt1062 = 0;
  6395. anInt1278 = (int)(Math.random() * 100D) - 50;
  6396. anInt1131 = (int)(Math.random() * 110D) - 55;
  6397. anInt896 = (int)(Math.random() * 80D) - 40;
  6398. minimapInt2 = (int)(Math.random() * 120D) - 60;
  6399. minimapInt3 = (int)(Math.random() * 30D) - 20;
  6400. minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
  6401. anInt1021 = 0;
  6402. anInt985 = -1;
  6403. destX = 0;
  6404. destY = 0;
  6405. playerCount = 0;
  6406. npcCount = 0;
  6407. for(int i2 = 0; i2 < maxPlayers; i2++)
  6408. {
  6409. playerArray[i2] = null;
  6410. aStreamArray895s[i2] = null;
  6411. }
  6412.  
  6413. for(int k2 = 0; k2 < 16384; k2++)
  6414. npcArray[k2] = null;
  6415.  
  6416. myPlayer = playerArray[myPlayerIndex] = new Player();
  6417. aClass19_1013.removeAll();
  6418. aClass19_1056.removeAll();
  6419. for(int l2 = 0; l2 < 4; l2++)
  6420. {
  6421. for(int i3 = 0; i3 < 104; i3++)
  6422. {
  6423. for(int k3 = 0; k3 < 104; k3++)
  6424. groundArray[l2][i3][k3] = null;
  6425.  
  6426. }
  6427.  
  6428. }
  6429.  
  6430. aClass19_1179 = new NodeList();
  6431. fullscreenInterfaceID = -1;
  6432. anInt900 = 0;
  6433. friendsCount = 0;
  6434. dialogID = -1;
  6435. backDialogID = -1;
  6436. openInterfaceID = -1;
  6437. invOverlayInterfaceID = -1;
  6438. anInt1018 = -1;
  6439. aBoolean1149 = false;
  6440. tabID = 3;
  6441. inputDialogState = 0;
  6442. menuOpen = false;
  6443. messagePromptRaised = false;
  6444. aString844 = null;
  6445. anInt1055 = 0;
  6446. anInt1054 = -1;
  6447. aBoolean1047 = true;
  6448. method45();
  6449. for(int j3 = 0; j3 < 5; j3++)
  6450. anIntArray990[j3] = 0;
  6451.  
  6452. for(int l3 = 0; l3 < 5; l3++)
  6453. {
  6454. atPlayerActions[l3] = null;
  6455. atPlayerArray[l3] = false;
  6456. }
  6457.  
  6458. anInt1175 = 0;
  6459. anInt1134 = 0;
  6460. anInt986 = 0;
  6461. anInt1288 = 0;
  6462. anInt924 = 0;
  6463. anInt1188 = 0;
  6464. anInt1155 = 0;
  6465. anInt1226 = 0;
  6466. int anInt941 = 0;
  6467. int anInt1260 = 0;
  6468. resetImageProducers2();
  6469. return;
  6470. }
  6471. if(k == 3)
  6472. {
  6473. loginMessage1 = "";
  6474. loginMessage2 = "Invalid username or password.";
  6475. return;
  6476. }
  6477. if(k == 4)
  6478. {
  6479. loginMessage1 = "Your account has been disabled.";
  6480. loginMessage2 = "Please check your message-center for details.";
  6481. return;
  6482. }
  6483. if(k == 5)
  6484. {
  6485. loginMessage1 = "Your account is already logged in.";
  6486. loginMessage2 = "Try again in 60 secs...";
  6487. return;
  6488. }
  6489. if(k == 6)
  6490. {
  6491. loginMessage1 = "RuneScape has been updated!";
  6492. loginMessage2 = "Please reload this page.";
  6493. return;
  6494. }
  6495. if(k == 7)
  6496. {
  6497. loginMessage1 = "This world is full.";
  6498. loginMessage2 = "Please use a different world.";
  6499. return;
  6500. }
  6501. if(k == 8)
  6502. {
  6503. loginMessage1 = "Unable to connect.";
  6504. loginMessage2 = "Login server offline.";
  6505. return;
  6506. }
  6507. if(k == 9)
  6508. {
  6509. loginMessage1 = "Login limit exceeded.";
  6510. loginMessage2 = "Too many connections from your address.";
  6511. return;
  6512. }
  6513. if(k == 10)
  6514. {
  6515. loginMessage1 = "Unable to connect.";
  6516. loginMessage2 = "Bad session id.";
  6517. return;
  6518. }
  6519. if(k == 11)
  6520. {
  6521. loginMessage2 = "Login server rejected session.";
  6522. loginMessage2 = "Please try again.";
  6523. return;
  6524. }
  6525. if(k == 12)
  6526. {
  6527. loginMessage1 = "You need a members account to login to this world.";
  6528. loginMessage2 = "Please subscribe, or use a different world.";
  6529. return;
  6530. }
  6531. if(k == 13)
  6532. {
  6533. loginMessage1 = "Could not complete login.";
  6534. loginMessage2 = "Please try using a different world.";
  6535. return;
  6536. }
  6537. if(k == 14)
  6538. {
  6539. loginMessage1 = "The server is being updated.";
  6540. loginMessage2 = "Please wait 1 minute and try again.";
  6541. return;
  6542. }
  6543. if(k == 15)
  6544. {
  6545. loggedIn = true;
  6546. stream.currentOffset = 0;
  6547. inStream.currentOffset = 0;
  6548. pktType = -1;
  6549. anInt841 = -1;
  6550. anInt842 = -1;
  6551. anInt843 = -1;
  6552. pktSize = 0;
  6553. anInt1009 = 0;
  6554. anInt1104 = 0;
  6555. menuActionRow = 0;
  6556. menuOpen = false;
  6557. aLong824 = System.currentTimeMillis();
  6558. return;
  6559. }
  6560. if(k == 16)
  6561. {
  6562. loginMessage1 = "Login attempts exceeded.";
  6563. loginMessage2 = "Please wait 1 minute and try again.";
  6564. return;
  6565. }
  6566. if(k == 17)
  6567. {
  6568. loginMessage1 = "You are standing in a members-only area.";
  6569. loginMessage2 = "To play on this world move to a free area first";
  6570. return;
  6571. }
  6572. if(k == 20)
  6573. {
  6574. loginMessage1 = "Invalid loginserver requested";
  6575. loginMessage2 = "Please try using a different world.";
  6576. return;
  6577. }
  6578. if(k == 21)
  6579. {
  6580. for(int k1 = socketStream.read(); k1 >= 0; k1--)
  6581. {
  6582. loginMessage1 = "You have only just left another world";
  6583. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  6584. drawLoginScreen(true);
  6585. try
  6586. {
  6587. Thread.sleep(1000L);
  6588. }
  6589. catch(Exception _ex) { }
  6590. }
  6591.  
  6592. login(s, s1, flag);
  6593. return;
  6594. }
  6595. if(k == -1)
  6596. {
  6597. if(i1 == 0)
  6598. {
  6599. if(loginFailures < 2)
  6600. {
  6601. try
  6602. {
  6603. Thread.sleep(2000L);
  6604. }
  6605. catch(Exception _ex) { }
  6606. loginFailures++;
  6607. login(s, s1, flag);
  6608. return;
  6609. } else
  6610. {
  6611. loginMessage1 = "No response from loginserver";
  6612. loginMessage2 = "Please wait 1 minute and try again.";
  6613. return;
  6614. }
  6615. } else
  6616. {
  6617. loginMessage1 = "No response from server";
  6618. loginMessage2 = "Please try using a different world.";
  6619. return;
  6620. }
  6621. } else
  6622. {
  6623. System.out.println("response:" + k);
  6624. loginMessage1 = "Unexpected server response";
  6625. loginMessage2 = "Please try using a different world.";
  6626. return;
  6627. }
  6628. }
  6629. catch(IOException _ex)
  6630. {
  6631. loginMessage1 = "";
  6632. }
  6633. loginMessage2 = "Error connecting to server.";
  6634. }
  6635.  
  6636. private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1, int l1, int i2, int j2, boolean flag, int k2) {
  6637. byte byte0 = 104;
  6638. byte byte1 = 104;
  6639. for(int l2 = 0; l2 < byte0; l2++) {
  6640. for(int i3 = 0; i3 < byte1; i3++) {
  6641. anIntArrayArray901[l2][i3] = 0;
  6642. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  6643. }
  6644. }
  6645. int j3 = j2;
  6646. int k3 = j1;
  6647. anIntArrayArray901[j2][j1] = 99;
  6648. anIntArrayArray825[j2][j1] = 0;
  6649. int l3 = 0;
  6650. int i4 = 0;
  6651. bigX[l3] = j2;
  6652. bigY[l3++] = j1;
  6653. boolean flag1 = false;
  6654. int j4 = bigX.length;
  6655. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  6656. while(i4 != l3)
  6657. {
  6658. j3 = bigX[i4];
  6659. k3 = bigY[i4];
  6660. i4 = (i4 + 1) % j4;
  6661. if(j3 == k2 && k3 == i2)
  6662. {
  6663. flag1 = true;
  6664. break;
  6665. }
  6666. if(i1 != 0)
  6667. {
  6668. if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  6669. {
  6670. flag1 = true;
  6671. break;
  6672. }
  6673. if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  6674. {
  6675. flag1 = true;
  6676. break;
  6677. }
  6678. }
  6679. if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  6680. {
  6681. flag1 = true;
  6682. break;
  6683. }
  6684. int l4 = anIntArrayArray825[j3][k3] + 1;
  6685. if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  6686. {
  6687. bigX[l3] = j3 - 1;
  6688. bigY[l3] = k3;
  6689. l3 = (l3 + 1) % j4;
  6690. anIntArrayArray901[j3 - 1][k3] = 2;
  6691. anIntArrayArray825[j3 - 1][k3] = l4;
  6692. }
  6693. if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  6694. {
  6695. bigX[l3] = j3 + 1;
  6696. bigY[l3] = k3;
  6697. l3 = (l3 + 1) % j4;
  6698. anIntArrayArray901[j3 + 1][k3] = 8;
  6699. anIntArrayArray825[j3 + 1][k3] = l4;
  6700. }
  6701. if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  6702. {
  6703. bigX[l3] = j3;
  6704. bigY[l3] = k3 - 1;
  6705. l3 = (l3 + 1) % j4;
  6706. anIntArrayArray901[j3][k3 - 1] = 1;
  6707. anIntArrayArray825[j3][k3 - 1] = l4;
  6708. }
  6709. if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  6710. {
  6711. bigX[l3] = j3;
  6712. bigY[l3] = k3 + 1;
  6713. l3 = (l3 + 1) % j4;
  6714. anIntArrayArray901[j3][k3 + 1] = 4;
  6715. anIntArrayArray825[j3][k3 + 1] = l4;
  6716. }
  6717. if(j3 > 0 && k3 > 0 && anIntArrayArray901[j3 - 1][k3 - 1] == 0 && (ai[j3 - 1][k3 - 1] & 0x128010e) == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  6718. {
  6719. bigX[l3] = j3 - 1;
  6720. bigY[l3] = k3 - 1;
  6721. l3 = (l3 + 1) % j4;
  6722. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  6723. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  6724. }
  6725. if(j3 < byte0 - 1 && k3 > 0 && anIntArrayArray901[j3 + 1][k3 - 1] == 0 && (ai[j3 + 1][k3 - 1] & 0x1280183) == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  6726. {
  6727. bigX[l3] = j3 + 1;
  6728. bigY[l3] = k3 - 1;
  6729. l3 = (l3 + 1) % j4;
  6730. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  6731. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  6732. }
  6733. if(j3 > 0 && k3 < byte1 - 1 && anIntArrayArray901[j3 - 1][k3 + 1] == 0 && (ai[j3 - 1][k3 + 1] & 0x1280138) == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  6734. {
  6735. bigX[l3] = j3 - 1;
  6736. bigY[l3] = k3 + 1;
  6737. l3 = (l3 + 1) % j4;
  6738. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  6739. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  6740. }
  6741. if(j3 < byte0 - 1 && k3 < byte1 - 1 && anIntArrayArray901[j3 + 1][k3 + 1] == 0 && (ai[j3 + 1][k3 + 1] & 0x12801e0) == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  6742. {
  6743. bigX[l3] = j3 + 1;
  6744. bigY[l3] = k3 + 1;
  6745. l3 = (l3 + 1) % j4;
  6746. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  6747. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  6748. }
  6749. }
  6750. anInt1264 = 0;
  6751. if(!flag1)
  6752. {
  6753. if(flag)
  6754. {
  6755. int i5 = 100;
  6756. for(int k5 = 1; k5 < 2; k5++)
  6757. {
  6758. for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  6759. {
  6760. for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  6761. if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  6762. {
  6763. i5 = anIntArrayArray825[i6][l6];
  6764. j3 = i6;
  6765. k3 = l6;
  6766. anInt1264 = 1;
  6767. flag1 = true;
  6768. }
  6769.  
  6770. }
  6771.  
  6772. if(flag1)
  6773. break;
  6774. }
  6775.  
  6776. }
  6777. if(!flag1)
  6778. return false;
  6779. }
  6780. i4 = 0;
  6781. bigX[i4] = j3;
  6782. bigY[i4++] = k3;
  6783. int l5;
  6784. for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  6785. {
  6786. if(j5 != l5)
  6787. {
  6788. l5 = j5;
  6789. bigX[i4] = j3;
  6790. bigY[i4++] = k3;
  6791. }
  6792. if((j5 & 2) != 0)
  6793. j3++;
  6794. else
  6795. if((j5 & 8) != 0)
  6796. j3--;
  6797. if((j5 & 1) != 0)
  6798. k3++;
  6799. else
  6800. if((j5 & 4) != 0)
  6801. k3--;
  6802. }
  6803. // if(cancelWalk) { return i4 > 0; }
  6804.  
  6805.  
  6806. if(i4 > 0)
  6807. {
  6808. int k4 = i4;
  6809. if(k4 > 25)
  6810. k4 = 25;
  6811. i4--;
  6812. int k6 = bigX[i4];
  6813. int i7 = bigY[i4];
  6814. anInt1288 += k4;
  6815. if(anInt1288 >= 92)
  6816. {
  6817. stream.createFrame(36);
  6818. stream.writeDWord(0);
  6819. anInt1288 = 0;
  6820. }
  6821. if(i == 0)
  6822. {
  6823. stream.createFrame(164);
  6824. stream.writeWordBigEndian(k4 + k4 + 3);
  6825. }
  6826. if(i == 1)
  6827. {
  6828. stream.createFrame(248);
  6829. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  6830. }
  6831. if(i == 2)
  6832. {
  6833. stream.createFrame(98);
  6834. stream.writeWordBigEndian(k4 + k4 + 3);
  6835. }
  6836. stream.method433(k6 + baseX);
  6837. destX = bigX[0];
  6838. destY = bigY[0];
  6839. for(int j7 = 1; j7 < k4; j7++)
  6840. {
  6841. i4--;
  6842. stream.writeWordBigEndian(bigX[i4] - k6);
  6843. stream.writeWordBigEndian(bigY[i4] - i7);
  6844. }
  6845.  
  6846. stream.method431(i7 + baseY);
  6847. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  6848. return true;
  6849. }
  6850. return i != 1;
  6851. }
  6852.  
  6853. private void method86(Stream stream)
  6854. {
  6855. for(int j = 0; j < anInt893; j++)
  6856. {
  6857. int k = anIntArray894[j];
  6858. NPC npc = npcArray[k];
  6859. int l = stream.readUnsignedByte();
  6860. if((l & 0x10) != 0)
  6861. {
  6862. int i1 = stream.method434();
  6863. if(i1 == 65535)
  6864. i1 = -1;
  6865. int i2 = stream.readUnsignedByte();
  6866. if(i1 == npc.anim && i1 != -1)
  6867. {
  6868. int l2 = Animation.anims[i1].anInt365;
  6869. if(l2 == 1)
  6870. {
  6871. npc.anInt1527 = 0;
  6872. npc.anInt1528 = 0;
  6873. npc.anInt1529 = i2;
  6874. npc.anInt1530 = 0;
  6875. }
  6876. if(l2 == 2)
  6877. npc.anInt1530 = 0;
  6878. } else
  6879. if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  6880. {
  6881. npc.anim = i1;
  6882. npc.anInt1527 = 0;
  6883. npc.anInt1528 = 0;
  6884. npc.anInt1529 = i2;
  6885. npc.anInt1530 = 0;
  6886. npc.anInt1542 = npc.smallXYIndex;
  6887. }
  6888. }
  6889. if((l & 8) != 0)
  6890. {
  6891. int j1 = stream.method426();
  6892. int j2 = stream.method427();
  6893. npc.updateHitData(j2, j1, loopCycle);
  6894. npc.loopCycleStatus = loopCycle + 300;
  6895. npc.currentHealth = stream.method426();
  6896. npc.maxHealth = stream.readUnsignedByte();
  6897. }
  6898. if((l & 0x80) != 0)
  6899. {
  6900. npc.anInt1520 = stream.readUnsignedWord();
  6901. int k1 = stream.readDWord();
  6902. npc.anInt1524 = k1 >> 16;
  6903. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  6904. npc.anInt1521 = 0;
  6905. npc.anInt1522 = 0;
  6906. if(npc.anInt1523 > loopCycle)
  6907. npc.anInt1521 = -1;
  6908. if(npc.anInt1520 == 65535)
  6909. npc.anInt1520 = -1;
  6910. }
  6911. if((l & 0x20) != 0)
  6912. {
  6913. npc.interactingEntity = stream.readUnsignedWord();
  6914. if(npc.interactingEntity == 65535)
  6915. npc.interactingEntity = -1;
  6916. }
  6917. if((l & 1) != 0)
  6918. {
  6919. npc.textSpoken = stream.readString();
  6920. npc.textCycle = 100;
  6921. // entityMessage(npc);
  6922.  
  6923. }
  6924. if((l & 0x40) != 0)
  6925. {
  6926. int l1 = stream.method427();
  6927. int k2 = stream.method428();
  6928. npc.updateHitData(k2, l1, loopCycle);
  6929. npc.loopCycleStatus = loopCycle + 300;
  6930. npc.currentHealth = stream.method428();
  6931. npc.maxHealth = stream.method427();
  6932. }
  6933. if((l & 2) != 0)
  6934. {
  6935. npc.desc = EntityDef.forID(stream.method436());
  6936. npc.anInt1540 = npc.desc.aByte68;
  6937. npc.anInt1504 = npc.desc.anInt79;
  6938. npc.anInt1554 = npc.desc.walkAnim;
  6939. npc.anInt1555 = npc.desc.anInt58;
  6940. npc.anInt1556 = npc.desc.anInt83;
  6941. npc.anInt1557 = npc.desc.anInt55;
  6942. npc.anInt1511 = npc.desc.standAnim;
  6943. }
  6944. if((l & 4) != 0)
  6945. {
  6946. npc.anInt1538 = stream.method434();
  6947. npc.anInt1539 = stream.method434();
  6948. }
  6949. }
  6950. }
  6951.  
  6952. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  6953. {
  6954. if(menuActionRow >= 400)
  6955. return;
  6956. if(entityDef.childrenIDs != null)
  6957. entityDef = entityDef.method161();
  6958. if(entityDef == null)
  6959. return;
  6960. if(!entityDef.aBoolean84)
  6961. return;
  6962. String s = entityDef.name;
  6963. if(entityDef.combatLevel != 0)
  6964. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  6965. if(itemSelected == 1)
  6966. {
  6967. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  6968. menuActionID[menuActionRow] = 582;
  6969. menuActionCmd1[menuActionRow] = i;
  6970. menuActionCmd2[menuActionRow] = k;
  6971. menuActionCmd3[menuActionRow] = j;
  6972. menuActionRow++;
  6973. return;
  6974. }
  6975. if(spellSelected == 1)
  6976. {
  6977. if((spellUsableOn & 2) == 2)
  6978. {
  6979. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  6980. menuActionID[menuActionRow] = 413;
  6981. menuActionCmd1[menuActionRow] = i;
  6982. menuActionCmd2[menuActionRow] = k;
  6983. menuActionCmd3[menuActionRow] = j;
  6984. menuActionRow++;
  6985. }
  6986. } else
  6987. {
  6988. if(entityDef.actions != null)
  6989. {
  6990. for(int l = 4; l >= 0; l--)
  6991. if(entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack"))
  6992. {
  6993. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  6994. if(l == 0)
  6995. menuActionID[menuActionRow] = 20;
  6996. if(l == 1)
  6997. menuActionID[menuActionRow] = 412;
  6998. if(l == 2)
  6999. menuActionID[menuActionRow] = 225;
  7000. if(l == 3)
  7001. menuActionID[menuActionRow] = 965;
  7002. if(l == 4)
  7003. menuActionID[menuActionRow] = 478;
  7004. menuActionCmd1[menuActionRow] = i;
  7005. menuActionCmd2[menuActionRow] = k;
  7006. menuActionCmd3[menuActionRow] = j;
  7007. menuActionRow++;
  7008. }
  7009.  
  7010. }
  7011. if(entityDef.actions != null)
  7012. {
  7013. for(int i1 = 4; i1 >= 0; i1--)
  7014. if(entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack"))
  7015. {
  7016. char c = '\0';
  7017. if(entityDef.combatLevel > myPlayer.combatLevel)
  7018. c = '\u07D0';
  7019. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  7020. if(i1 == 0)
  7021. menuActionID[menuActionRow] = 20 + c;
  7022. if(i1 == 1)
  7023. menuActionID[menuActionRow] = 412 + c;
  7024. if(i1 == 2)
  7025. menuActionID[menuActionRow] = 225 + c;
  7026. if(i1 == 3)
  7027. menuActionID[menuActionRow] = 965 + c;
  7028. if(i1 == 4)
  7029. menuActionID[menuActionRow] = 478 + c;
  7030. menuActionCmd1[menuActionRow] = i;
  7031. menuActionCmd2[menuActionRow] = k;
  7032. menuActionCmd3[menuActionRow] = j;
  7033. menuActionRow++;
  7034. }
  7035.  
  7036. }
  7037. //menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.type + "@gre@)";
  7038. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7039. menuActionID[menuActionRow] = 1025;
  7040. menuActionCmd1[menuActionRow] = i;
  7041. menuActionCmd2[menuActionRow] = k;
  7042. menuActionCmd3[menuActionRow] = j;
  7043. menuActionRow++;
  7044. }
  7045. }
  7046.  
  7047. private void buildAtPlayerMenu(int i, int j, Player player, int k)
  7048. {
  7049. if(player == myPlayer)
  7050. return;
  7051. if(menuActionRow >= 400)
  7052. return;
  7053. String s;
  7054. if(player.skill == 0)
  7055. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  7056. else
  7057. s = player.name + " (skill-" + player.skill + ")";
  7058. if(itemSelected == 1)
  7059. {
  7060. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
  7061. menuActionID[menuActionRow] = 491;
  7062. menuActionCmd1[menuActionRow] = j;
  7063. menuActionCmd2[menuActionRow] = i;
  7064. menuActionCmd3[menuActionRow] = k;
  7065. menuActionRow++;
  7066. } else
  7067. if(spellSelected == 1)
  7068. {
  7069. if((spellUsableOn & 8) == 8)
  7070. {
  7071. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  7072. menuActionID[menuActionRow] = 365;
  7073. menuActionCmd1[menuActionRow] = j;
  7074. menuActionCmd2[menuActionRow] = i;
  7075. menuActionCmd3[menuActionRow] = k;
  7076. menuActionRow++;
  7077. }
  7078. } else
  7079. {
  7080. for(int l = 4; l >= 0; l--)
  7081. if(atPlayerActions[l] != null)
  7082. {
  7083. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  7084. char c = '\0';
  7085. if(atPlayerActions[l].equalsIgnoreCase("attack"))
  7086. {
  7087. if(player.combatLevel > myPlayer.combatLevel)
  7088. c = '\u07D0';
  7089. if(myPlayer.team != 0 && player.team != 0)
  7090. if(myPlayer.team == player.team)
  7091. c = '\u07D0';
  7092. else
  7093. c = '\0';
  7094. } else
  7095. if(atPlayerArray[l])
  7096. c = '\u07D0';
  7097. if(l == 0)
  7098. menuActionID[menuActionRow] = 561 + c;
  7099. if(l == 1)
  7100. menuActionID[menuActionRow] = 779 + c;
  7101. if(l == 2)
  7102. menuActionID[menuActionRow] = 27 + c;
  7103. if(l == 3)
  7104. menuActionID[menuActionRow] = 577 + c;
  7105. if(l == 4)
  7106. menuActionID[menuActionRow] = 729 + c;
  7107. menuActionCmd1[menuActionRow] = j;
  7108. menuActionCmd2[menuActionRow] = i;
  7109. menuActionCmd3[menuActionRow] = k;
  7110. menuActionRow++;
  7111. }
  7112.  
  7113. }
  7114. for(int i1 = 0; i1 < menuActionRow; i1++)
  7115. if(menuActionID[i1] == 516)
  7116. {
  7117. menuActionName[i1] = "Walk here @whi@" + s;
  7118. return;
  7119. }
  7120.  
  7121. }
  7122.  
  7123. private void method89(Class30_Sub1 class30_sub1)
  7124. {
  7125. int i = 0;
  7126. int j = -1;
  7127. int k = 0;
  7128. int l = 0;
  7129. if(class30_sub1.anInt1296 == 0)
  7130. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7131. if(class30_sub1.anInt1296 == 1)
  7132. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7133. if(class30_sub1.anInt1296 == 2)
  7134. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7135. if(class30_sub1.anInt1296 == 3)
  7136. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7137. if(i != 0)
  7138. {
  7139. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7140. j = i >> 14 & 0x7fff;
  7141. k = i1 & 0x1f;
  7142. l = i1 >> 6;
  7143. }
  7144. class30_sub1.anInt1299 = j;
  7145. class30_sub1.anInt1301 = k;
  7146. class30_sub1.anInt1300 = l;
  7147. }
  7148.  
  7149. private void method90()
  7150. {
  7151. for(int i = 0; i < anInt1062; i++)
  7152. if(anIntArray1250[i] <= 0)
  7153. {
  7154. boolean flag1 = false;
  7155. try
  7156. {
  7157. if(anIntArray1207[i] == anInt874 && anIntArray1241[i] == anInt1289)
  7158. {
  7159. if(!replayWave())
  7160. flag1 = true;
  7161. } else
  7162. {
  7163. Stream stream = Sounds.method241(anIntArray1241[i], anIntArray1207[i]);
  7164. if(System.currentTimeMillis() + (long)(stream.currentOffset / 22) > aLong1172 + (long)(anInt1257 / 22))
  7165. {
  7166. anInt1257 = stream.currentOffset;
  7167. aLong1172 = System.currentTimeMillis();
  7168. if(saveWave(stream.buffer, stream.currentOffset))
  7169. {
  7170. anInt874 = anIntArray1207[i];
  7171. anInt1289 = anIntArray1241[i];
  7172. } else
  7173. {
  7174. flag1 = true;
  7175. }
  7176. }
  7177. }
  7178. }
  7179. catch(Exception exception) { }
  7180. if(!flag1 || anIntArray1250[i] == -5)
  7181. {
  7182. anInt1062--;
  7183. for(int j = i; j < anInt1062; j++)
  7184. {
  7185. anIntArray1207[j] = anIntArray1207[j + 1];
  7186. anIntArray1241[j] = anIntArray1241[j + 1];
  7187. anIntArray1250[j] = anIntArray1250[j + 1];
  7188. }
  7189.  
  7190. i--;
  7191. } else
  7192. {
  7193. anIntArray1250[i] = -5;
  7194. }
  7195. } else
  7196. {
  7197. anIntArray1250[i]--;
  7198. }
  7199.  
  7200. if(prevSong > 0)
  7201. {
  7202. prevSong -= 20;
  7203. if(prevSong < 0)
  7204. prevSong = 0;
  7205. if(prevSong == 0 && musicEnabled && !lowMem)
  7206. {
  7207. nextSong = currentSong;
  7208. songChanging = true;
  7209. onDemandFetcher.method558(2, nextSong);
  7210. }
  7211. }
  7212. }
  7213.  
  7214. void startUp()
  7215. {
  7216. drawLoadingText(20, "Starting up");
  7217. if(signlink.sunjava)
  7218. super.minDelay = 5;
  7219. if(aBoolean993)
  7220. {
  7221. // rsAlreadyLoaded = true;
  7222. // return;
  7223. }
  7224. aBoolean993 = true;
  7225. boolean flag = true;
  7226. String s = getDocumentBaseHost();
  7227. if(signlink.cache_dat != null)
  7228. {
  7229. for(int i = 0; i < 5; i++)
  7230. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  7231. } try {
  7232. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  7233. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  7234. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  7235. chatTextDrawingArea = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  7236. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  7237. drawLogo();
  7238. loadTitleScreen();
  7239. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  7240. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  7241. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  7242. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  7243. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  7244. StreamLoader streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  7245. byteGroundArray = new byte[4][104][104];
  7246. intGroundArray = new int[4][105][105];
  7247. worldController = new WorldController(intGroundArray);
  7248. for(int j = 0; j < 4; j++)
  7249. aClass11Array1230[j] = new Class11();
  7250.  
  7251. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  7252. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  7253. drawLoadingText(60, "Connecting to update server");
  7254. onDemandFetcher = new OnDemandFetcher();
  7255. onDemandFetcher.start(streamLoader_6, this);
  7256. Class36.method528(onDemandFetcher.getAnimCount());
  7257. Model.method459(onDemandFetcher.getVersionCount(0), onDemandFetcher);
  7258. ModelDecompressor.loadModels();
  7259. preloadModels();
  7260. if(!lowMem)
  7261. {
  7262. nextSong = 0;
  7263. try
  7264. {
  7265. nextSong = Integer.parseInt(getParameter("music"));
  7266. }
  7267. catch(Exception _ex) { }
  7268. songChanging = true;
  7269. onDemandFetcher.method558(2, nextSong);
  7270. while(onDemandFetcher.getNodeCount() > 0)
  7271. {
  7272. processOnDemandQueue();
  7273. try
  7274. {
  7275. Thread.sleep(100L);
  7276. }
  7277. catch(Exception _ex) { }
  7278. if(onDemandFetcher.anInt1349 > 3)
  7279. {
  7280. loadError();
  7281. return;
  7282. }
  7283. }
  7284. }
  7285. drawLoadingText(65, "Requesting animations");
  7286. int k = onDemandFetcher.getVersionCount(1);
  7287. for(int i1 = 0; i1 < k; i1++)
  7288. onDemandFetcher.method558(1, i1);
  7289.  
  7290. while(onDemandFetcher.getNodeCount() > 0)
  7291. {
  7292. int j1 = k - onDemandFetcher.getNodeCount();
  7293. if(j1 > 0)
  7294. drawLoadingText(65, "Loading animations - " + (j1 * 100) / k + "%");
  7295. processOnDemandQueue();
  7296. try
  7297. {
  7298. Thread.sleep(100L);
  7299. }
  7300. catch(Exception _ex) { }
  7301. if(onDemandFetcher.anInt1349 > 3)
  7302. {
  7303. loadError();
  7304. return;
  7305. }
  7306. }
  7307. drawLoadingText(70, "Requesting models");
  7308. k = onDemandFetcher.getVersionCount(0);
  7309. for(int k1 = 0; k1 < k; k1++)
  7310. {
  7311. int l1 = onDemandFetcher.getModelIndex(k1);
  7312. if((l1 & 1) != 0)
  7313. onDemandFetcher.method558(0, k1);
  7314. }
  7315.  
  7316. k = onDemandFetcher.getNodeCount();
  7317. while(onDemandFetcher.getNodeCount() > 0)
  7318. {
  7319. int i2 = k - onDemandFetcher.getNodeCount();
  7320. if(i2 > 0)
  7321. drawLoadingText(70, "Loading models - " + (i2 * 100) / k + "%");
  7322. processOnDemandQueue();
  7323. try
  7324. {
  7325. Thread.sleep(100L);
  7326. }
  7327. catch(Exception _ex) { }
  7328. }
  7329. if(decompressors[0] != null)
  7330. {
  7331. drawLoadingText(75, "Requesting maps");
  7332. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 47));
  7333. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 47));
  7334. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 48));
  7335. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 48));
  7336. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 49));
  7337. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 49));
  7338. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 47));
  7339. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 47));
  7340. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 48));
  7341. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 48));
  7342. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 148, 48));
  7343. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 148, 48));
  7344. k = onDemandFetcher.getNodeCount();
  7345. while(onDemandFetcher.getNodeCount() > 0)
  7346. {
  7347. int j2 = k - onDemandFetcher.getNodeCount();
  7348. if(j2 > 0)
  7349. drawLoadingText(75, "Loading maps - " + (j2 * 100) / k + "%");
  7350. processOnDemandQueue();
  7351. try
  7352. {
  7353. Thread.sleep(100L);
  7354. }
  7355. catch(Exception _ex) { }
  7356. }
  7357. }
  7358. k = onDemandFetcher.getVersionCount(0);
  7359. for(int k2 = 0; k2 < k; k2++)
  7360. {
  7361. int l2 = onDemandFetcher.getModelIndex(k2);
  7362. byte byte0 = 0;
  7363. if((l2 & 8) != 0)
  7364. byte0 = 10;
  7365. else
  7366. if((l2 & 0x20) != 0)
  7367. byte0 = 9;
  7368. else
  7369. if((l2 & 0x10) != 0)
  7370. byte0 = 8;
  7371. else
  7372. if((l2 & 0x40) != 0)
  7373. byte0 = 7;
  7374. else
  7375. if((l2 & 0x80) != 0)
  7376. byte0 = 6;
  7377. else
  7378. if((l2 & 2) != 0)
  7379. byte0 = 5;
  7380. else
  7381. if((l2 & 4) != 0)
  7382. byte0 = 4;
  7383. if((l2 & 1) != 0)
  7384. byte0 = 3;
  7385. if(byte0 != 0)
  7386. onDemandFetcher.method563(byte0, 0, k2);
  7387. }
  7388.  
  7389. onDemandFetcher.method554(isMembers);
  7390. if(!lowMem)
  7391. {
  7392. int l = onDemandFetcher.getVersionCount(2);
  7393. for(int i3 = 1; i3 < l; i3++)
  7394. if(onDemandFetcher.method569(i3))
  7395. onDemandFetcher.method563((byte)1, 2, i3);
  7396.  
  7397. }
  7398. drawLoadingText(80, "Unpacking media");
  7399. /* Custom sprite unpacking */
  7400. chatArea = new Sprite("chatarea");
  7401. tabArea = new Sprite("tabarea");
  7402. mapArea = new Sprite("maparea");
  7403. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  7404. /**/
  7405. mapBack = new Background(streamLoader_2, "mapback", 0);
  7406. for(int c1 = 0; c1 <= 3; c1++)
  7407. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  7408. for(int j3 = 0; j3 <= 14; j3++)
  7409. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  7410. for(int r1 = 0; r1 < 5; r1++)
  7411. redStones[r1] = new Sprite("redstones " + r1);
  7412. compass = new Sprite(streamLoader_2, "compass", 0);
  7413. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  7414. mapEdge.method345();
  7415. try
  7416. {
  7417. for(int k3 = 0; k3 < 100; k3++)
  7418. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  7419. }
  7420. catch(Exception _ex) { }
  7421. try
  7422. {
  7423. for(int l3 = 0; l3 < 100; l3++)
  7424. mapFunctions[l3] = new Sprite(streamLoader_2, "mapfunction", l3);
  7425. }
  7426. catch(Exception _ex) { }
  7427. try
  7428. {
  7429. for(int i4 = 0; i4 < 20; i4++)
  7430. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  7431. }
  7432. catch(Exception _ex) { }
  7433. try
  7434. {
  7435. for(int h1 = 0; h1 < 6; h1++)
  7436. headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
  7437. } catch(Exception _ex) { }
  7438. try {
  7439. for(int j4 = 0; j4 < 8; j4++)
  7440. headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);
  7441. for(int j45 = 0; j45 < 3; j45++)
  7442. skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45 );
  7443. }
  7444. catch(Exception _ex) { }
  7445. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  7446. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  7447. for(int k4 = 0; k4 < 8; k4++)
  7448. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  7449.  
  7450. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  7451. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  7452. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  7453. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  7454. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  7455. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  7456. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  7457. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  7458.  
  7459. for(int l4 = 0; l4 < 2; l4++)
  7460. modIcons[l4] = new Background(streamLoader_2, "mod_icons", l4);
  7461.  
  7462. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  7463. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7464. sprite.method346(0, 0);
  7465. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  7466. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7467. sprite.method346(0, 0);
  7468. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  7469. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7470. sprite.method346(0, 0);
  7471. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  7472. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7473. sprite.method346(0, 0);
  7474.  
  7475. int i5 = (int)(Math.random() * 21D) - 10;
  7476. int j5 = (int)(Math.random() * 21D) - 10;
  7477. int k5 = (int)(Math.random() * 21D) - 10;
  7478. int l5 = (int)(Math.random() * 41D) - 20;
  7479. for(int i6 = 0; i6 < 100; i6++)
  7480. {
  7481. if(mapFunctions[i6] != null)
  7482. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  7483. if(mapScenes[i6] != null)
  7484. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  7485. }
  7486.  
  7487. drawLoadingText(83, "Unpacking textures");
  7488. Texture.method368(streamLoader_3);
  7489. Texture.method372(0.80000000000000004D);
  7490. Texture.method367();
  7491. drawLoadingText(86, "Unpacking config");
  7492. Animation.unpackConfig(streamLoader);
  7493. ObjectDef.unpackConfig(streamLoader);
  7494. Flo.unpackConfig(streamLoader);
  7495. ItemDef.unpackConfig(streamLoader);
  7496. EntityDef.unpackConfig(streamLoader);
  7497. IDK.unpackConfig(streamLoader);
  7498. SpotAnim.unpackConfig(streamLoader);
  7499. Varp.unpackConfig(streamLoader);
  7500. VarBit.unpackConfig(streamLoader);
  7501. ItemDef.isMembers = isMembers;
  7502. if(!lowMem)
  7503. {
  7504. drawLoadingText(90, "Unpacking sounds");
  7505. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  7506. Stream stream = new Stream(abyte0);
  7507. Sounds.unpack(stream);
  7508. }
  7509. drawLoadingText(95, "Unpacking interfaces");
  7510. TextDrawingArea aclass30_sub2_sub1_sub4s[] = {
  7511. smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  7512. };
  7513. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  7514. drawLoadingText(100, "Preparing game engine");
  7515. for(int j6 = 0; j6 < 33; j6++)
  7516. {
  7517. int k6 = 999;
  7518. int i7 = 0;
  7519. for(int k7 = 0; k7 < 34; k7++)
  7520. {
  7521. if(mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0)
  7522. {
  7523. if(k6 == 999)
  7524. k6 = k7;
  7525. continue;
  7526. }
  7527. if(k6 == 999)
  7528. continue;
  7529. i7 = k7;
  7530. break;
  7531. }
  7532.  
  7533. anIntArray968[j6] = k6;
  7534. anIntArray1057[j6] = i7 - k6;
  7535. }
  7536.  
  7537. for(int l6 = 5; l6 < 156; l6++)
  7538. {
  7539. int j7 = 999;
  7540. int l7 = 0;
  7541. for(int j8 = 25; j8 < 172; j8++)
  7542. {
  7543. if(mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34))
  7544. {
  7545. if(j7 == 999)
  7546. j7 = j8;
  7547. continue;
  7548. }
  7549. if(j7 == 999)
  7550. continue;
  7551. l7 = j8;
  7552. break;
  7553. }
  7554.  
  7555. anIntArray1052[l6 - 5] = j7 - 25;
  7556. anIntArray1229[l6 - 5] = l7 - j7;
  7557. }
  7558.  
  7559. Texture.method365(765, 503);
  7560. fullScreenTextureArray = Texture.anIntArray1472;
  7561. Texture.method365(519, 165);
  7562. anIntArray1180 = Texture.anIntArray1472;
  7563. Texture.method365(246, 335);
  7564. anIntArray1181 = Texture.anIntArray1472;
  7565. Texture.method365(512, 334);
  7566. anIntArray1182 = Texture.anIntArray1472;
  7567. int ai[] = new int[9];
  7568. for(int i8 = 0; i8 < 9; i8++)
  7569. {
  7570. int k8 = 128 + i8 * 32 + 15;
  7571. int l8 = 600 + k8 * 3;
  7572. int i9 = Texture.anIntArray1470[k8];
  7573. ai[i8] = l8 * i9 >> 16;
  7574. }
  7575.  
  7576. WorldController.method310(500, 800, 512, 334, ai);
  7577. Censor.loadConfig(streamLoader_4);
  7578. mouseDetection = new MouseDetection(this);
  7579. startRunnable(mouseDetection, 10);
  7580. Animable_Sub5.clientInstance = this;
  7581. ObjectDef.clientInstance = this;
  7582. EntityDef.clientInstance = this;
  7583. return;
  7584. }
  7585. catch(Exception exception)
  7586. {
  7587. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  7588. }
  7589. loadingError = true;
  7590. }
  7591.  
  7592. private void method91(Stream stream, int i)
  7593. {
  7594. while(stream.bitPosition + 10 < i * 8)
  7595. {
  7596. int j = stream.readBits(11);
  7597. if(j == 2047)
  7598. break;
  7599. if(playerArray[j] == null)
  7600. {
  7601. playerArray[j] = new Player();
  7602. if(aStreamArray895s[j] != null)
  7603. playerArray[j].updatePlayer(aStreamArray895s[j]);
  7604. }
  7605. playerIndices[playerCount++] = j;
  7606. Player player = playerArray[j];
  7607. player.anInt1537 = loopCycle;
  7608. int k = stream.readBits(1);
  7609. if(k == 1)
  7610. anIntArray894[anInt893++] = j;
  7611. int l = stream.readBits(1);
  7612. int i1 = stream.readBits(5);
  7613. if(i1 > 15)
  7614. i1 -= 32;
  7615. int j1 = stream.readBits(5);
  7616. if(j1 > 15)
  7617. j1 -= 32;
  7618. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  7619. }
  7620. stream.finishBitAccess();
  7621. }
  7622.  
  7623. private void processMainScreenClick() {
  7624. if(anInt1021 != 0)
  7625. return;
  7626. if(super.clickMode3 == 1) {
  7627. int i = super.saveClickX - 25 - 545;
  7628. int j = super.saveClickY - 5 - 4;
  7629. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  7630. i -= 73;
  7631. j -= 75;
  7632. int k = minimapInt1 + minimapInt2 & 0x7ff;
  7633. int i1 = Texture.anIntArray1470[k];
  7634. int j1 = Texture.anIntArray1471[k];
  7635. i1 = i1 * (minimapInt3 + 256) >> 8;
  7636. j1 = j1 * (minimapInt3 + 256) >> 8;
  7637. int k1 = j * i1 + i * j1 >> 11;
  7638. int l1 = j * j1 - i * i1 >> 11;
  7639. int i2 = myPlayer.x + k1 >> 7;
  7640. int j2 = myPlayer.y - l1 >> 7;
  7641. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  7642. if(flag1) {
  7643. stream.writeWordBigEndian(i);
  7644. stream.writeWordBigEndian(j);
  7645. stream.writeWord(minimapInt1);
  7646. stream.writeWordBigEndian(57);
  7647. stream.writeWordBigEndian(minimapInt2);
  7648. stream.writeWordBigEndian(minimapInt3);
  7649. stream.writeWordBigEndian(89);
  7650. stream.writeWord(myPlayer.x);
  7651. stream.writeWord(myPlayer.y);
  7652. stream.writeWordBigEndian(anInt1264);
  7653. stream.writeWordBigEndian(63);
  7654. }
  7655. }
  7656. anInt1117++;
  7657. if(anInt1117 > 1151) {
  7658. anInt1117 = 0;
  7659. stream.createFrame(246);
  7660. stream.writeWordBigEndian(0);
  7661. int l = stream.currentOffset;
  7662. if((int)(Math.random() * 2D) == 0)
  7663. stream.writeWordBigEndian(101);
  7664. stream.writeWordBigEndian(197);
  7665. stream.writeWord((int)(Math.random() * 65536D));
  7666. stream.writeWordBigEndian((int)(Math.random() * 256D));
  7667. stream.writeWordBigEndian(67);
  7668. stream.writeWord(14214);
  7669. if((int)(Math.random() * 2D) == 0)
  7670. stream.writeWord(29487);
  7671. stream.writeWord((int)(Math.random() * 65536D));
  7672. if((int)(Math.random() * 2D) == 0)
  7673. stream.writeWordBigEndian(220);
  7674. stream.writeWordBigEndian(180);
  7675. stream.writeBytes(stream.currentOffset - l);
  7676. }
  7677. }
  7678. }
  7679.  
  7680. private String interfaceIntToString(int j) {
  7681. if(j < 0x3b9ac9ff)
  7682. return String.valueOf(j);
  7683. else
  7684. return "*";
  7685. }
  7686.  
  7687. private void showErrorScreen()
  7688. {
  7689. Graphics g = getGameComponent().getGraphics();
  7690. g.setColor(Color.black);
  7691. g.fillRect(0, 0, 765, 503);
  7692. method4(1);
  7693. if(loadingError)
  7694. {
  7695. aBoolean831 = false;
  7696. g.setFont(new Font("Helvetica", 1, 16));
  7697. g.setColor(Color.yellow);
  7698. int k = 35;
  7699. g.drawString("Sorry, an error has occured whilst loading RuneScape", 30, k);
  7700. k += 50;
  7701. g.setColor(Color.white);
  7702. g.drawString("To fix this try the following (in order):", 30, k);
  7703. k += 50;
  7704. g.setColor(Color.white);
  7705. g.setFont(new Font("Helvetica", 1, 12));
  7706. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  7707. k += 30;
  7708. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  7709. k += 30;
  7710. g.drawString("3: Try using a different game-world", 30, k);
  7711. k += 30;
  7712. g.drawString("4: Try rebooting your computer", 30, k);
  7713. k += 30;
  7714. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  7715. }
  7716. if(genericLoadingError)
  7717. {
  7718. aBoolean831 = false;
  7719. g.setFont(new Font("Helvetica", 1, 20));
  7720. g.setColor(Color.white);
  7721. g.drawString("Error - unable to load game!", 50, 50);
  7722. g.drawString("To play RuneScape make sure you play from", 50, 100);
  7723. g.drawString("http://www.runescape.com", 50, 150);
  7724. }
  7725. if(rsAlreadyLoaded)
  7726. {
  7727. aBoolean831 = false;
  7728. g.setColor(Color.yellow);
  7729. int l = 35;
  7730. g.drawString("Error a copy of RuneScape already appears to be loaded", 30, l);
  7731. l += 50;
  7732. g.setColor(Color.white);
  7733. g.drawString("To fix this try the following (in order):", 30, l);
  7734. l += 50;
  7735. g.setColor(Color.white);
  7736. g.setFont(new Font("Helvetica", 1, 12));
  7737. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  7738. l += 30;
  7739. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  7740. l += 30;
  7741. }
  7742. }
  7743.  
  7744. public URL getCodeBase() {
  7745. try {
  7746. return new URL(server +":" + (80 + portOff));
  7747. } catch(Exception _ex) {
  7748. }
  7749. return null;
  7750. }
  7751.  
  7752. private void method95() {
  7753. for(int j = 0; j < npcCount; j++) {
  7754. int k = npcIndices[j];
  7755. NPC npc = npcArray[k];
  7756. if(npc != null)
  7757. method96(npc);
  7758. }
  7759. }
  7760.  
  7761. private void method96(Entity entity)
  7762. {
  7763. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  7764. {
  7765. entity.anim = -1;
  7766. entity.anInt1520 = -1;
  7767. entity.anInt1547 = 0;
  7768. entity.anInt1548 = 0;
  7769. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7770. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7771. entity.method446();
  7772. }
  7773. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  7774. {
  7775. entity.anim = -1;
  7776. entity.anInt1520 = -1;
  7777. entity.anInt1547 = 0;
  7778. entity.anInt1548 = 0;
  7779. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7780. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7781. entity.method446();
  7782. }
  7783. if(entity.anInt1547 > loopCycle)
  7784. method97(entity);
  7785. else
  7786. if(entity.anInt1548 >= loopCycle)
  7787. method98(entity);
  7788. else
  7789. method99(entity);
  7790. method100(entity);
  7791. method101(entity);
  7792. }
  7793.  
  7794. private void method97(Entity entity)
  7795. {
  7796. int i = entity.anInt1547 - loopCycle;
  7797. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7798. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7799. entity.x += (j - entity.x) / i;
  7800. entity.y += (k - entity.y) / i;
  7801. entity.anInt1503 = 0;
  7802. if(entity.anInt1549 == 0)
  7803. entity.turnDirection = 1024;
  7804. if(entity.anInt1549 == 1)
  7805. entity.turnDirection = 1536;
  7806. if(entity.anInt1549 == 2)
  7807. entity.turnDirection = 0;
  7808. if(entity.anInt1549 == 3)
  7809. entity.turnDirection = 512;
  7810. }
  7811.  
  7812. private void method98(Entity entity)
  7813. {
  7814. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  7815. {
  7816. int i = entity.anInt1548 - entity.anInt1547;
  7817. int j = loopCycle - entity.anInt1547;
  7818. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7819. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7820. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  7821. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  7822. entity.x = (k * (i - j) + i1 * j) / i;
  7823. entity.y = (l * (i - j) + j1 * j) / i;
  7824. }
  7825. entity.anInt1503 = 0;
  7826. if(entity.anInt1549 == 0)
  7827. entity.turnDirection = 1024;
  7828. if(entity.anInt1549 == 1)
  7829. entity.turnDirection = 1536;
  7830. if(entity.anInt1549 == 2)
  7831. entity.turnDirection = 0;
  7832. if(entity.anInt1549 == 3)
  7833. entity.turnDirection = 512;
  7834. entity.anInt1552 = entity.turnDirection;
  7835. }
  7836.  
  7837. private void method99(Entity entity)
  7838. {
  7839. entity.anInt1517 = entity.anInt1511;
  7840. if(entity.smallXYIndex == 0)
  7841. {
  7842. entity.anInt1503 = 0;
  7843. return;
  7844. }
  7845. if(entity.anim != -1 && entity.anInt1529 == 0)
  7846. {
  7847. Animation animation = Animation.anims[entity.anim];
  7848. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  7849. {
  7850. entity.anInt1503++;
  7851. return;
  7852. }
  7853. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  7854. {
  7855. entity.anInt1503++;
  7856. return;
  7857. }
  7858. }
  7859. int i = entity.x;
  7860. int j = entity.y;
  7861. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7862. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7863. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  7864. {
  7865. entity.x = k;
  7866. entity.y = l;
  7867. return;
  7868. }
  7869. if(i < k)
  7870. {
  7871. if(j < l)
  7872. entity.turnDirection = 1280;
  7873. else
  7874. if(j > l)
  7875. entity.turnDirection = 1792;
  7876. else
  7877. entity.turnDirection = 1536;
  7878. } else
  7879. if(i > k)
  7880. {
  7881. if(j < l)
  7882. entity.turnDirection = 768;
  7883. else
  7884. if(j > l)
  7885. entity.turnDirection = 256;
  7886. else
  7887. entity.turnDirection = 512;
  7888. } else
  7889. if(j < l)
  7890. entity.turnDirection = 1024;
  7891. else
  7892. entity.turnDirection = 0;
  7893. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  7894. if(i1 > 1024)
  7895. i1 -= 2048;
  7896. int j1 = entity.anInt1555;
  7897. if(i1 >= -256 && i1 <= 256)
  7898. j1 = entity.anInt1554;
  7899. else
  7900. if(i1 >= 256 && i1 < 768)
  7901. j1 = entity.anInt1557;
  7902. else
  7903. if(i1 >= -768 && i1 <= -256)
  7904. j1 = entity.anInt1556;
  7905. if(j1 == -1)
  7906. j1 = entity.anInt1554;
  7907. entity.anInt1517 = j1;
  7908. int k1 = 4;
  7909. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  7910. k1 = 2;
  7911. if(entity.smallXYIndex > 2)
  7912. k1 = 6;
  7913. if(entity.smallXYIndex > 3)
  7914. k1 = 8;
  7915. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  7916. {
  7917. k1 = 8;
  7918. entity.anInt1503--;
  7919. }
  7920. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  7921. k1 <<= 1;
  7922. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  7923. entity.anInt1517 = entity.anInt1505;
  7924. if(i < k)
  7925. {
  7926. entity.x += k1;
  7927. if(entity.x > k)
  7928. entity.x = k;
  7929. } else
  7930. if(i > k)
  7931. {
  7932. entity.x -= k1;
  7933. if(entity.x < k)
  7934. entity.x = k;
  7935. }
  7936. if(j < l)
  7937. {
  7938. entity.y += k1;
  7939. if(entity.y > l)
  7940. entity.y = l;
  7941. } else
  7942. if(j > l)
  7943. {
  7944. entity.y -= k1;
  7945. if(entity.y < l)
  7946. entity.y = l;
  7947. }
  7948. if(entity.x == k && entity.y == l)
  7949. {
  7950. entity.smallXYIndex--;
  7951. if(entity.anInt1542 > 0)
  7952. entity.anInt1542--;
  7953. }
  7954. }
  7955.  
  7956. private void method100(Entity entity)
  7957. {
  7958. if(entity.anInt1504 == 0)
  7959. return;
  7960. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  7961. {
  7962. NPC npc = npcArray[entity.interactingEntity];
  7963. if(npc != null)
  7964. {
  7965. int i1 = entity.x - npc.x;
  7966. int k1 = entity.y - npc.y;
  7967. if(i1 != 0 || k1 != 0)
  7968. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  7969. }
  7970. }
  7971. if(entity.interactingEntity >= 32768)
  7972. {
  7973. int j = entity.interactingEntity - 32768;
  7974. if(j == unknownInt10)
  7975. j = myPlayerIndex;
  7976. Player player = playerArray[j];
  7977. if(player != null)
  7978. {
  7979. int l1 = entity.x - player.x;
  7980. int i2 = entity.y - player.y;
  7981. if(l1 != 0 || i2 != 0)
  7982. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  7983. }
  7984. }
  7985. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  7986. {
  7987. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  7988. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  7989. if(k != 0 || j1 != 0)
  7990. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  7991. entity.anInt1538 = 0;
  7992. entity.anInt1539 = 0;
  7993. }
  7994. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  7995. if(l != 0)
  7996. {
  7997. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  7998. entity.anInt1552 = entity.turnDirection;
  7999. else
  8000. if(l > 1024)
  8001. entity.anInt1552 -= entity.anInt1504;
  8002. else
  8003. entity.anInt1552 += entity.anInt1504;
  8004. entity.anInt1552 &= 0x7ff;
  8005. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  8006. {
  8007. if(entity.anInt1512 != -1)
  8008. {
  8009. entity.anInt1517 = entity.anInt1512;
  8010. return;
  8011. }
  8012. entity.anInt1517 = entity.anInt1554;
  8013. }
  8014. }
  8015. }
  8016.  
  8017. private void method101(Entity entity)
  8018. {
  8019. entity.aBoolean1541 = false;
  8020. if(entity.anInt1517 != -1)
  8021. {
  8022. Animation animation = Animation.anims[entity.anInt1517];
  8023. entity.anInt1519++;
  8024. if(entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518))
  8025. {
  8026. entity.anInt1519 = 0;
  8027. entity.anInt1518++;
  8028. }
  8029. if(entity.anInt1518 >= animation.anInt352)
  8030. {
  8031. entity.anInt1519 = 0;
  8032. entity.anInt1518 = 0;
  8033. }
  8034. }
  8035. if(entity.anInt1520 != -1 && loopCycle >= entity.anInt1523)
  8036. {
  8037. if(entity.anInt1521 < 0)
  8038. entity.anInt1521 = 0;
  8039. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8040. for(entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  8041. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8042.  
  8043. if(entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  8044. entity.anInt1520 = -1;
  8045. }
  8046. if(entity.anim != -1 && entity.anInt1529 <= 1)
  8047. {
  8048. Animation animation_2 = Animation.anims[entity.anim];
  8049. if(animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle)
  8050. {
  8051. entity.anInt1529 = 1;
  8052. return;
  8053. }
  8054. }
  8055. if(entity.anim != -1 && entity.anInt1529 == 0)
  8056. {
  8057. Animation animation_3 = Animation.anims[entity.anim];
  8058. for(entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  8059. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8060.  
  8061. if(entity.anInt1527 >= animation_3.anInt352)
  8062. {
  8063. entity.anInt1527 -= animation_3.anInt356;
  8064. entity.anInt1530++;
  8065. if(entity.anInt1530 >= animation_3.anInt362)
  8066. entity.anim = -1;
  8067. if(entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  8068. entity.anim = -1;
  8069. }
  8070. entity.aBoolean1541 = animation_3.aBoolean358;
  8071. }
  8072. if(entity.anInt1529 > 0)
  8073. entity.anInt1529--;
  8074. }
  8075.  
  8076. private void drawGameScreen()
  8077. {
  8078. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  8079. if (loadingStage == 2) {
  8080. method119(anInt945, fullscreenInterfaceID);
  8081. if (openInterfaceID != -1) {
  8082. method119(anInt945, openInterfaceID);
  8083. }
  8084. anInt945 = 0;
  8085. resetAllImageProducers();
  8086. super.fullGameScreen.initDrawingArea();
  8087. Texture.anIntArray1472 = fullScreenTextureArray;
  8088. DrawingArea.setAllPixelsToZero();
  8089. welcomeScreenRaised = true;
  8090. if (openInterfaceID != -1) {
  8091. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  8092. if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  8093. rsInterface_1.width = 765;
  8094. rsInterface_1.height = 503;
  8095. }
  8096. drawInterface(0, 0, rsInterface_1, 8);
  8097. }
  8098. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  8099. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  8100. rsInterface.width = 765;
  8101. rsInterface.height = 503;
  8102. }
  8103. drawInterface(0, 0, rsInterface, 8);
  8104.  
  8105. if (!menuOpen) {
  8106. processRightClick();
  8107. drawTooltip();
  8108. } else {
  8109. drawMenu();
  8110. }
  8111. }
  8112. drawCount++;
  8113. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  8114. return;
  8115. } else {
  8116. if (drawCount != 0) {
  8117. resetImageProducers2();
  8118. }
  8119. }
  8120. if(welcomeScreenRaised) {
  8121. welcomeScreenRaised = false;
  8122. topFrame.drawGraphics(0, super.graphics, 0);
  8123. leftFrame.drawGraphics(4, super.graphics, 0);
  8124. rightFrame.drawGraphics(4, super.graphics, 516);
  8125. mapEdgeIP.drawGraphics(4, super.graphics, 519);
  8126. needDrawTabArea = true;
  8127. inputTaken = true;
  8128. tabAreaAltered = true;
  8129. aBoolean1233 = true;
  8130. if(loadingStage != 2) {
  8131. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  8132. aRSImageProducer_1164.drawGraphics(4, super.graphics, 545);
  8133. }
  8134. }
  8135. if(menuOpen && menuScreenArea == 1)
  8136. needDrawTabArea = true;
  8137. if(invOverlayInterfaceID != -1)
  8138. {
  8139. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  8140. if(flag1)
  8141. needDrawTabArea = true;
  8142. }
  8143. if(atInventoryInterfaceType == 2)
  8144. needDrawTabArea = true;
  8145. if(activeInterfaceType == 2)
  8146. needDrawTabArea = true;
  8147. /*if(needDrawTabArea)
  8148. {*/
  8149. drawTabArea();
  8150. /*needDrawTabArea = false;
  8151. }*/
  8152. if(backDialogID == -1)
  8153. {
  8154. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  8155. if(super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  8156. method65(494, 110, super.mouseX - 0, super.mouseY - 348, aClass9_1059, 0, false, anInt1211);
  8157. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  8158. if(i < 0)
  8159. i = 0;
  8160. if(i > anInt1211 - 110)
  8161. i = anInt1211 - 110;
  8162. if(anInt1089 != i)
  8163. {
  8164. anInt1089 = i;
  8165. inputTaken = true;
  8166. }
  8167. }
  8168. if(backDialogID != -1) {
  8169. boolean flag2 = method119(anInt945, backDialogID);
  8170. if(flag2)
  8171. inputTaken = true;
  8172. }
  8173. if(atInventoryInterfaceType == 3)
  8174. inputTaken = true;
  8175. if(activeInterfaceType == 3)
  8176. inputTaken = true;
  8177. if(aString844 != null)
  8178. inputTaken = true;
  8179. if(menuOpen && menuScreenArea == 2)
  8180. inputTaken = true;
  8181. if(inputTaken) {
  8182. drawChatArea();
  8183. inputTaken = false;
  8184. }
  8185. if(loadingStage == 2)
  8186. method146();
  8187. if(loadingStage == 2) {
  8188. drawMinimap();
  8189. aRSImageProducer_1164.drawGraphics(4, super.graphics, 545);
  8190. }
  8191. if(anInt1054 != -1)
  8192. tabAreaAltered = true;
  8193. if(tabAreaAltered)
  8194. {
  8195. if(anInt1054 != -1 && anInt1054 == tabID)
  8196. {
  8197. anInt1054 = -1;
  8198. stream.createFrame(120);
  8199. stream.writeWordBigEndian(tabID);
  8200. }
  8201. tabAreaAltered = false;
  8202. aRSImageProducer_1125.initDrawingArea();
  8203. aRSImageProducer_1165.initDrawingArea();
  8204. }
  8205. anInt945 = 0;
  8206. }
  8207.  
  8208. private boolean buildFriendsListMenu(RSInterface class9)
  8209. {
  8210. int i = class9.contentType;
  8211. if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  8212. {
  8213. if(i >= 801)
  8214. i -= 701;
  8215. else
  8216. if(i >= 701)
  8217. i -= 601;
  8218. else
  8219. if(i >= 101)
  8220. i -= 101;
  8221. else
  8222. i--;
  8223. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  8224. menuActionID[menuActionRow] = 792;
  8225. menuActionRow++;
  8226. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  8227. menuActionID[menuActionRow] = 639;
  8228. menuActionRow++;
  8229. return true;
  8230. }
  8231. if(i >= 401 && i <= 500)
  8232. {
  8233. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  8234. menuActionID[menuActionRow] = 322;
  8235. menuActionRow++;
  8236. return true;
  8237. } else
  8238. {
  8239. return false;
  8240. }
  8241. }
  8242.  
  8243. private void method104()
  8244. {
  8245. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  8246. for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  8247. if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  8248. class30_sub2_sub4_sub3.unlink();
  8249. else
  8250. if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  8251. {
  8252. class30_sub2_sub4_sub3.method454(anInt945);
  8253. if(class30_sub2_sub4_sub3.aBoolean1567)
  8254. class30_sub2_sub4_sub3.unlink();
  8255. else
  8256. worldController.method285(class30_sub2_sub4_sub3.anInt1560, 0, class30_sub2_sub4_sub3.anInt1563, -1, class30_sub2_sub4_sub3.anInt1562, 60, class30_sub2_sub4_sub3.anInt1561, class30_sub2_sub4_sub3, false);
  8257. }
  8258.  
  8259. }
  8260.  
  8261. public void drawBlackBox(int xPos, int yPos) {
  8262. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  8263. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  8264. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  8265. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  8266. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  8267. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  8268. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  8269. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  8270. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  8271. }
  8272.  
  8273. private void drawInterface(int j, int k, RSInterface class9, int l) {
  8274. if(class9.type != 0 || class9.children == null)
  8275. return;
  8276. if(class9.isMouseoverTriggered && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  8277. return;
  8278. int i1 = DrawingArea.topX;
  8279. int j1 = DrawingArea.topY;
  8280. int k1 = DrawingArea.bottomX;
  8281. int l1 = DrawingArea.bottomY;
  8282. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  8283. int i2 = class9.children.length;
  8284. for(int j2 = 0; j2 < i2; j2++) {
  8285. int k2 = class9.childX[j2] + k;
  8286. int l2 = (class9.childY[j2] + l) - j;
  8287. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  8288. k2 += class9_1.anInt263;
  8289. l2 += class9_1.anInt265;
  8290. if(class9_1.contentType > 0)
  8291. drawFriendsListOrWelcomeScreen(class9_1);
  8292. //here
  8293. int[] IDs = {
  8294. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
  8295. 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
  8296. 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
  8297. 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
  8298. 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  8299. /* Ancients */
  8300. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
  8301. 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  8302. };
  8303. for(int m5 = 0; m5 < IDs.length; m5++) {
  8304. if(class9_1.id == IDs[m5] + 1) {
  8305. if(m5 > 61)
  8306. drawBlackBox(k2 + 1, l2);
  8307. else
  8308. drawBlackBox(k2, l2 + 1);
  8309. }
  8310. }
  8311. int[] runeChildren = {
  8312. 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
  8313. 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
  8314. 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
  8315. 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
  8316. 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
  8317. 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
  8318. 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
  8319. 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
  8320. 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
  8321. 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
  8322. 15885, 18474, 18475, 18478
  8323. };
  8324. for(int r = 0; r < runeChildren.length; r++)
  8325. if(class9_1.id == runeChildren[r])
  8326. class9_1.modelZoom = 775;
  8327. if(class9_1.type == 0) {
  8328. if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  8329. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  8330. if(class9_1.scrollPosition < 0)
  8331. class9_1.scrollPosition = 0;
  8332. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  8333. if(class9_1.scrollMax > class9_1.height)
  8334. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  8335. } else if(class9_1.type != 1)
  8336. if(class9_1.type == 2) {
  8337. int i3 = 0;
  8338. for(int l3 = 0; l3 < class9_1.height; l3++) {
  8339. for(int l4 = 0; l4 < class9_1.width; l4++) {
  8340. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  8341. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  8342. if(i3 < 20) {
  8343. k5 += class9_1.spritesX[i3];
  8344. j6 += class9_1.spritesY[i3];
  8345. }
  8346. if(class9_1.inv[i3] > 0) {
  8347. int k6 = 0;
  8348. int j7 = 0;
  8349. int j9 = class9_1.inv[i3] - 1;
  8350. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  8351. int l9 = 0;
  8352. if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  8353. l9 = 0xffffff;
  8354. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  8355. if(class30_sub2_sub1_sub1_2 != null) {
  8356. if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  8357. k6 = super.mouseX - anInt1087;
  8358. j7 = super.mouseY - anInt1088;
  8359. if(k6 < 5 && k6 > -5)
  8360. k6 = 0;
  8361. if(j7 < 5 && j7 > -5)
  8362. j7 = 0;
  8363. if(anInt989 < 5) {
  8364. k6 = 0;
  8365. j7 = 0;
  8366. }
  8367. class30_sub2_sub1_sub1_2.drawSprite1(k5 + k6, j6 + j7);
  8368. if(j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  8369. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  8370. if(i10 > anInt945 * 10)
  8371. i10 = anInt945 * 10;
  8372. if(i10 > class9.scrollPosition)
  8373. i10 = class9.scrollPosition;
  8374. class9.scrollPosition -= i10;
  8375. anInt1088 += i10;
  8376. }
  8377. if(j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  8378. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  8379. if(j10 > anInt945 * 10)
  8380. j10 = anInt945 * 10;
  8381. if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  8382. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  8383. class9.scrollPosition += j10;
  8384. anInt1088 -= j10;
  8385. }
  8386. } else if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  8387. class30_sub2_sub1_sub1_2.drawSprite1(k5, j6);
  8388. else
  8389. class30_sub2_sub1_sub1_2.drawSprite(k5, j6);
  8390. if(class30_sub2_sub1_sub1_2.anInt1444 == 33 || class9_1.invStackSizes[i3] != 1)
  8391. {
  8392. int k10 = class9_1.invStackSizes[i3];
  8393. if(k10 >= 1)
  8394. smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8395. if(k10 >= 100000)
  8396. smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8397. if(k10 >= 10000000)
  8398. smallText.method385(0x49E20E, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8399.  
  8400. /*smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  8401. smallText.method385(0xffff00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);*/
  8402. }
  8403. }
  8404. }
  8405. } else if(class9_1.sprites != null && i3 < 20) {
  8406. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  8407. if(class30_sub2_sub1_sub1_1 != null)
  8408. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  8409. }
  8410. i3++;
  8411. }
  8412. }
  8413. } else if(class9_1.type == 3) {
  8414. boolean flag = false;
  8415. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8416. flag = true;
  8417. int j3;
  8418. if(interfaceIsSelected(class9_1)) {
  8419. j3 = class9_1.anInt219;
  8420. if(flag && class9_1.anInt239 != 0)
  8421. j3 = class9_1.anInt239;
  8422. } else {
  8423. j3 = class9_1.textColor;
  8424. if(flag && class9_1.anInt216 != 0)
  8425. j3 = class9_1.anInt216;
  8426. }
  8427. if(class9_1.aByte254 == 0) {
  8428. if(class9_1.aBoolean227)
  8429. DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  8430. else
  8431. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  8432. } else if(class9_1.aBoolean227)
  8433. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.aByte254 & 0xff), k2);
  8434. else
  8435. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.aByte254 & 0xff), j3, class9_1.width, k2);
  8436. } else if(class9_1.type == 4) {
  8437. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  8438. String s = class9_1.message;
  8439. boolean flag1 = false;
  8440. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8441. flag1 = true;
  8442. int i4;
  8443. if(interfaceIsSelected(class9_1)) {
  8444. i4 = class9_1.anInt219;
  8445. if(flag1 && class9_1.anInt239 != 0)
  8446. i4 = class9_1.anInt239;
  8447. if(class9_1.aString228.length() > 0)
  8448. s = class9_1.aString228;
  8449. } else {
  8450. i4 = class9_1.textColor;
  8451. if(flag1 && class9_1.anInt216 != 0)
  8452. i4 = class9_1.anInt216;
  8453. }
  8454. if(class9_1.atActionType == 6 && aBoolean1149) {
  8455. s = "Please wait...";
  8456. i4 = class9_1.textColor;
  8457. }
  8458. if(DrawingArea.width == 519) {
  8459. if(i4 == 0xffff00)
  8460. i4 = 255;
  8461. if(i4 == 49152)
  8462. i4 = 0xffffff;
  8463. }
  8464. if((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  8465. switch (i4) {
  8466. case 16773120: i4 = 0xFE981F; break;
  8467. case 7040819: i4 = 0xAF6A1A; break;
  8468. }
  8469. }
  8470. for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
  8471. {
  8472. if(s.indexOf("%") != -1)
  8473. {
  8474. do
  8475. {
  8476. int k7 = s.indexOf("%1");
  8477. if(k7 == -1)
  8478. break;
  8479. if(class9_1.id < 4000 || class9_1.id > 5000 && class9_1.id !=13921 && class9_1.id !=13922 && class9_1.id !=12171 && class9_1.id !=12172)
  8480. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8481. else
  8482. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8483. } while(true);
  8484. do
  8485. {
  8486. int l7 = s.indexOf("%2");
  8487. if(l7 == -1)
  8488. break;
  8489. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  8490. } while(true);
  8491. do
  8492. {
  8493. int i8 = s.indexOf("%3");
  8494. if(i8 == -1)
  8495. break;
  8496. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  8497. } while(true);
  8498. do
  8499. {
  8500. int j8 = s.indexOf("%4");
  8501. if(j8 == -1)
  8502. break;
  8503. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  8504. } while(true);
  8505. do
  8506. {
  8507. int k8 = s.indexOf("%5");
  8508. if(k8 == -1)
  8509. break;
  8510. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  8511. } while(true);
  8512. }
  8513. int l8 = s.indexOf("\\n");
  8514. String s1;
  8515. if(l8 != -1)
  8516. {
  8517. s1 = s.substring(0, l8);
  8518. s = s.substring(l8 + 2);
  8519. } else
  8520. {
  8521. s1 = s;
  8522. s = "";
  8523. }
  8524. if(class9_1.centerText)
  8525. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadow);
  8526. else
  8527. textDrawingArea.method389(class9_1.textShadow, k2, i4, s1, l6);
  8528. }
  8529. } else if(class9_1.type == 5) {
  8530. //whats this?
  8531. Sprite sprite;
  8532. if(interfaceIsSelected(class9_1))
  8533. sprite = class9_1.sprite2;
  8534. else
  8535. sprite = class9_1.sprite1;
  8536. if(spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
  8537. sprite.drawSprite(k2, l2, 0xffffff);
  8538. } else {
  8539. if (sprite != null)
  8540. sprite.drawSprite(k2, l2);
  8541. }
  8542. if(sprite != null)
  8543. sprite.drawSprite(k2, l2);
  8544. } else if(class9_1.type == 6) {
  8545. int k3 = Texture.textureInt1;
  8546. int j4 = Texture.textureInt2;
  8547. Texture.textureInt1 = k2 + class9_1.width / 2;
  8548. Texture.textureInt2 = l2 + class9_1.height / 2;
  8549. int i5 = Texture.anIntArray1470[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8550. int l5 = Texture.anIntArray1471[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8551. boolean flag2 = interfaceIsSelected(class9_1);
  8552. int i7;
  8553. if(flag2)
  8554. i7 = class9_1.anInt258;
  8555. else
  8556. i7 = class9_1.anInt257;
  8557. Model model;
  8558. if(i7 == -1) {
  8559. model = class9_1.method209(-1, -1, flag2);
  8560. } else {
  8561. Animation animation = Animation.anims[i7];
  8562. model = class9_1.method209(animation.anIntArray354[class9_1.anInt246], animation.anIntArray353[class9_1.anInt246], flag2);
  8563. }
  8564. if(model != null)
  8565. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  8566. Texture.textureInt1 = k3;
  8567. Texture.textureInt2 = j4;
  8568. } else if(class9_1.type == 7) {
  8569. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  8570. int k4 = 0;
  8571. for(int j5 = 0; j5 < class9_1.height; j5++) {
  8572. for(int i6 = 0; i6 < class9_1.width; i6++) {
  8573. if(class9_1.inv[k4] > 0) {
  8574. ItemDef itemDef = ItemDef.forID(class9_1.inv[k4] - 1);
  8575. String s2 = itemDef.name;
  8576. if(itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  8577. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  8578. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  8579. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  8580. if(class9_1.centerText)
  8581. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadow);
  8582. else
  8583. textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  8584. }
  8585. k4++;
  8586. }
  8587. }
  8588. } else if (class9_1.type == 8) {
  8589. drawHoverBox(k2, l2, class9_1.popupString);
  8590. }
  8591. }
  8592. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  8593. }
  8594.  
  8595. private void randomizeBackground(Background background) {
  8596. int j = 256;
  8597. for(int k = 0; k < anIntArray1190.length; k++)
  8598. anIntArray1190[k] = 0;
  8599.  
  8600. for(int l = 0; l < 5000; l++) {
  8601. int i1 = (int)(Math.random() * 128D * (double)j);
  8602. anIntArray1190[i1] = (int)(Math.random() * 256D);
  8603. }
  8604. for(int j1 = 0; j1 < 20; j1++) {
  8605. for(int k1 = 1; k1 < j - 1; k1++) {
  8606. for(int i2 = 1; i2 < 127; i2++) {
  8607. int k2 = i2 + (k1 << 7);
  8608. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  8609. }
  8610.  
  8611. }
  8612. int ai[] = anIntArray1190;
  8613. anIntArray1190 = anIntArray1191;
  8614. anIntArray1191 = ai;
  8615. }
  8616. if(background != null) {
  8617. int l1 = 0;
  8618. for(int j2 = 0; j2 < background.anInt1453; j2++) {
  8619. for(int l2 = 0; l2 < background.anInt1452; l2++)
  8620. if(background.aByteArray1450[l1++] != 0) {
  8621. int i3 = l2 + 16 + background.anInt1454;
  8622. int j3 = j2 + 16 + background.anInt1455;
  8623. int k3 = i3 + (j3 << 7);
  8624. anIntArray1190[k3] = 0;
  8625. }
  8626. }
  8627. }
  8628. }
  8629.  
  8630. private void method107(int i, int j, Stream stream, Player player)
  8631. {
  8632. if((i & 0x400) != 0)
  8633. {
  8634. player.anInt1543 = stream.method428();
  8635. player.anInt1545 = stream.method428();
  8636. player.anInt1544 = stream.method428();
  8637. player.anInt1546 = stream.method428();
  8638. player.anInt1547 = stream.method436() + loopCycle;
  8639. player.anInt1548 = stream.method435() + loopCycle;
  8640. player.anInt1549 = stream.method428();
  8641. player.method446();
  8642. }
  8643. if((i & 0x100) != 0)
  8644. {
  8645. player.anInt1520 = stream.method434();
  8646. int k = stream.readDWord();
  8647. player.anInt1524 = k >> 16;
  8648. player.anInt1523 = loopCycle + (k & 0xffff);
  8649. player.anInt1521 = 0;
  8650. player.anInt1522 = 0;
  8651. if(player.anInt1523 > loopCycle)
  8652. player.anInt1521 = -1;
  8653. if(player.anInt1520 == 65535)
  8654. player.anInt1520 = -1;
  8655. }
  8656. if((i & 8) != 0)
  8657. {
  8658. int l = stream.method434();
  8659. if(l == 65535)
  8660. l = -1;
  8661. int i2 = stream.method427();
  8662. if(l == player.anim && l != -1)
  8663. {
  8664. int i3 = Animation.anims[l].anInt365;
  8665. if(i3 == 1)
  8666. {
  8667. player.anInt1527 = 0;
  8668. player.anInt1528 = 0;
  8669. player.anInt1529 = i2;
  8670. player.anInt1530 = 0;
  8671. }
  8672. if(i3 == 2)
  8673. player.anInt1530 = 0;
  8674. } else
  8675. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  8676. {
  8677. player.anim = l;
  8678. player.anInt1527 = 0;
  8679. player.anInt1528 = 0;
  8680. player.anInt1529 = i2;
  8681. player.anInt1530 = 0;
  8682. player.anInt1542 = player.smallXYIndex;
  8683. }
  8684. }
  8685. if((i & 4) != 0)
  8686. {
  8687. player.textSpoken = stream.readString();
  8688. if(player.textSpoken.charAt(0) == '~')
  8689. {
  8690. player.textSpoken = player.textSpoken.substring(1);
  8691. pushMessage(player.textSpoken, 2, player.name);
  8692. } else
  8693. if(player == myPlayer)
  8694. pushMessage(player.textSpoken, 2, player.name);
  8695. player.anInt1513 = 0;
  8696. player.anInt1531 = 0;
  8697. player.textCycle = 150;
  8698. }
  8699. if((i & 0x80) != 0)
  8700. {
  8701. //right fucking here
  8702. int i1 = stream.method434();
  8703. int j2 = stream.readUnsignedByte();
  8704. int j3 = stream.method427();
  8705. int k3 = stream.currentOffset;
  8706. if(player.name != null && player.visible)
  8707. {
  8708. long l3 = TextClass.longForName(player.name);
  8709. boolean flag = false;
  8710. if(j2 <= 1)
  8711. {
  8712. for(int i4 = 0; i4 < ignoreCount; i4++)
  8713. {
  8714. if(ignoreListAsLongs[i4] != l3)
  8715. continue;
  8716. flag = true;
  8717. break;
  8718. }
  8719.  
  8720. }
  8721. if(!flag && anInt1251 == 0)
  8722. try
  8723. {
  8724. aStream_834.currentOffset = 0;
  8725. stream.method442(j3, 0, aStream_834.buffer);
  8726. aStream_834.currentOffset = 0;
  8727. String s = TextInput.method525(j3, aStream_834);
  8728. //s = Censor.doCensor(s);
  8729. player.textSpoken = s;
  8730. player.anInt1513 = i1 >> 8;
  8731. player.privelage = j2;
  8732. player.anInt1531 = i1 & 0xff;
  8733. player.textCycle = 150;
  8734. if(j2 == 2 || j2 == 3)
  8735. pushMessage(s, 1, "@cr2@" + player.name);
  8736. else if(j2 == 1)
  8737. pushMessage(s, 1, "@cr1@" + player.name);
  8738. else
  8739. pushMessage(s, 2, player.name);
  8740. }
  8741. catch(Exception exception)
  8742. {
  8743. signlink.reporterror("cde2");
  8744. }
  8745. }
  8746. stream.currentOffset = k3 + j3;
  8747. }
  8748. if((i & 1) != 0)
  8749. {
  8750. player.interactingEntity = stream.method434();
  8751. if(player.interactingEntity == 65535)
  8752. player.interactingEntity = -1;
  8753. }
  8754. if((i & 0x10) != 0)
  8755. {
  8756. int j1 = stream.method427();
  8757. byte abyte0[] = new byte[j1];
  8758. Stream stream_1 = new Stream(abyte0);
  8759. stream.readBytes(j1, 0, abyte0);
  8760. aStreamArray895s[j] = stream_1;
  8761. player.updatePlayer(stream_1);
  8762. }
  8763. if((i & 2) != 0)
  8764. {
  8765. player.anInt1538 = stream.method436();
  8766. player.anInt1539 = stream.method434();
  8767. }
  8768. if((i & 0x20) != 0)
  8769. {
  8770. int k1 = stream.readUnsignedByte();
  8771. int k2 = stream.method426();
  8772. player.updateHitData(k2, k1, loopCycle);
  8773. player.loopCycleStatus = loopCycle + 300;
  8774. player.currentHealth = stream.method427();
  8775. player.maxHealth = stream.readUnsignedByte();
  8776. }
  8777. if((i & 0x200) != 0)
  8778. {
  8779. int l1 = stream.readUnsignedByte();
  8780. int l2 = stream.method428();
  8781. player.updateHitData(l2, l1, loopCycle);
  8782. player.loopCycleStatus = loopCycle + 300;
  8783. player.currentHealth = stream.readUnsignedByte();
  8784. player.maxHealth = stream.method427();
  8785. }
  8786. }
  8787.  
  8788. private void method108()
  8789. {
  8790. try
  8791. {
  8792. int j = myPlayer.x + anInt1278;
  8793. int k = myPlayer.y + anInt1131;
  8794. if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  8795. {
  8796. anInt1014 = j;
  8797. anInt1015 = k;
  8798. }
  8799. if(anInt1014 != j)
  8800. anInt1014 += (j - anInt1014) / 16;
  8801. if(anInt1015 != k)
  8802. anInt1015 += (k - anInt1015) / 16;
  8803. if(super.keyArray[1] == 1)
  8804. anInt1186 += (-24 - anInt1186) / 2;
  8805. else
  8806. if(super.keyArray[2] == 1)
  8807. anInt1186 += (24 - anInt1186) / 2;
  8808. else
  8809. anInt1186 /= 2;
  8810. if(super.keyArray[3] == 1)
  8811. anInt1187 += (12 - anInt1187) / 2;
  8812. else
  8813. if(super.keyArray[4] == 1)
  8814. anInt1187 += (-12 - anInt1187) / 2;
  8815. else
  8816. anInt1187 /= 2;
  8817. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  8818. anInt1184 += anInt1187 / 2;
  8819. if(anInt1184 < 128)
  8820. anInt1184 = 128;
  8821. if(anInt1184 > 383)
  8822. anInt1184 = 383;
  8823. int l = anInt1014 >> 7;
  8824. int i1 = anInt1015 >> 7;
  8825. int j1 = method42(plane, anInt1015, anInt1014);
  8826. int k1 = 0;
  8827. if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  8828. {
  8829. for(int l1 = l - 4; l1 <= l + 4; l1++)
  8830. {
  8831. for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  8832. {
  8833. int l2 = plane;
  8834. if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  8835. l2++;
  8836. int i3 = j1 - intGroundArray[l2][l1][k2];
  8837. if(i3 > k1)
  8838. k1 = i3;
  8839. }
  8840.  
  8841. }
  8842.  
  8843. }
  8844. anInt1005++;
  8845. if(anInt1005 > 1512)
  8846. {
  8847. anInt1005 = 0;
  8848. stream.createFrame(77);
  8849. stream.writeWordBigEndian(0);
  8850. int i2 = stream.currentOffset;
  8851. stream.writeWordBigEndian((int)(Math.random() * 256D));
  8852. stream.writeWordBigEndian(101);
  8853. stream.writeWordBigEndian(233);
  8854. stream.writeWord(45092);
  8855. if((int)(Math.random() * 2D) == 0)
  8856. stream.writeWord(35784);
  8857. stream.writeWordBigEndian((int)(Math.random() * 256D));
  8858. stream.writeWordBigEndian(64);
  8859. stream.writeWordBigEndian(38);
  8860. stream.writeWord((int)(Math.random() * 65536D));
  8861. stream.writeWord((int)(Math.random() * 65536D));
  8862. stream.writeBytes(stream.currentOffset - i2);
  8863. }
  8864. int j2 = k1 * 192;
  8865. if(j2 > 0x17f00)
  8866. j2 = 0x17f00;
  8867. if(j2 < 32768)
  8868. j2 = 32768;
  8869. if(j2 > anInt984)
  8870. {
  8871. anInt984 += (j2 - anInt984) / 24;
  8872. return;
  8873. }
  8874. if(j2 < anInt984)
  8875. {
  8876. anInt984 += (j2 - anInt984) / 80;
  8877. }
  8878. }
  8879. catch(Exception _ex)
  8880. {
  8881. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  8882. throw new RuntimeException("eek");
  8883. }
  8884. }
  8885.  
  8886. public void processDrawing()
  8887. {
  8888. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  8889. {
  8890. showErrorScreen();
  8891. return;
  8892. }
  8893. anInt1061++;
  8894. if(!loggedIn)
  8895. drawLoginScreen(false);
  8896. else
  8897. drawGameScreen();
  8898. anInt1213 = 0;
  8899. }
  8900.  
  8901. private boolean isFriendOrSelf(String s)
  8902. {
  8903. if(s == null)
  8904. return false;
  8905. for(int i = 0; i < friendsCount; i++)
  8906. if(s.equalsIgnoreCase(friendsList[i]))
  8907. return true;
  8908. return s.equalsIgnoreCase(myPlayer.name);
  8909. }
  8910.  
  8911. private static String combatDiffColor(int i, int j)
  8912. {
  8913. int k = i - j;
  8914. if(k < -9)
  8915. return "@red@";
  8916. if(k < -6)
  8917. return "@or3@";
  8918. if(k < -3)
  8919. return "@or2@";
  8920. if(k < 0)
  8921. return "@or1@";
  8922. if(k > 9)
  8923. return "@gre@";
  8924. if(k > 6)
  8925. return "@gr3@";
  8926. if(k > 3)
  8927. return "@gr2@";
  8928. if(k > 0)
  8929. return "@gr1@";
  8930. else
  8931. return "@yel@";
  8932. }
  8933.  
  8934. private void setWaveVolume(int i)
  8935. {
  8936. signlink.wavevol = i;
  8937. }
  8938.  
  8939. private void draw3dScreen()
  8940. {
  8941. drawSplitPrivateChat();
  8942. if(crossType == 1)
  8943. {
  8944. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  8945. anInt1142++;
  8946. if(anInt1142 > 67)
  8947. {
  8948. anInt1142 = 0;
  8949. stream.createFrame(78);
  8950. }
  8951. }
  8952. if(crossType == 2)
  8953. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  8954. if(anInt1018 != -1)
  8955. {
  8956. method119(anInt945, anInt1018);
  8957. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  8958. }
  8959. if(openInterfaceID != -1)
  8960. {
  8961. method119(anInt945, openInterfaceID);
  8962. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  8963. }
  8964. method70();
  8965. if(!menuOpen)
  8966. {
  8967. processRightClick();
  8968. drawTooltip();
  8969. } else
  8970. if(menuScreenArea == 0)
  8971. drawMenu();
  8972. if(anInt1055 == 1)
  8973. multiOverlay.drawSprite(472, 296);
  8974. if(fpsOn)
  8975. {
  8976. char c = '\u01FB';
  8977. int k = 20;
  8978. int i1 = 0xffff00;
  8979. if(super.fps < 15)
  8980. i1 = 0xff0000;
  8981. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  8982. k += 15;
  8983. Runtime runtime = Runtime.getRuntime();
  8984. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  8985. i1 = 0xffff00;
  8986. if(j1 > 0x2000000 && lowMem)
  8987. i1 = 0xff0000;
  8988. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  8989. k += 15;
  8990. }
  8991. int i1 = 0xffff00;
  8992. int x = baseX + (myPlayer.x - 6 >> 7);
  8993. int y = baseY + (myPlayer.y - 6 >> 7);
  8994. if (clientData)
  8995. {
  8996. char c = '\u01FB';
  8997. int k = 20;
  8998. if(super.fps < 15)
  8999. i1 = 0xff0000;
  9000. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285, 5);
  9001. Runtime runtime = Runtime.getRuntime();
  9002. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9003. i1 = 0xffff00;
  9004. if(j1 > 0x2000000 && lowMem)
  9005. i1 = 0xff0000;
  9006. k += 15;
  9007. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299, 5);
  9008. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  9009. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
  9010. }
  9011. if(anInt1104 != 0)
  9012. {
  9013. int j = anInt1104 / 50;
  9014. int l = j / 60;
  9015. j %= 60;
  9016. if(j < 10)
  9017. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  9018. else
  9019. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  9020. anInt849++;
  9021. if(anInt849 > 75)
  9022. {
  9023. anInt849 = 0;
  9024. stream.createFrame(148);
  9025. }
  9026. }
  9027. }
  9028.  
  9029. private void addIgnore(long l)
  9030. {
  9031. try
  9032. {
  9033. if(l == 0L)
  9034. return;
  9035. if(ignoreCount >= 100)
  9036. {
  9037. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  9038. return;
  9039. }
  9040. String s = TextClass.fixName(TextClass.nameForLong(l));
  9041. for(int j = 0; j < ignoreCount; j++)
  9042. if(ignoreListAsLongs[j] == l)
  9043. {
  9044. pushMessage(s + " is already on your ignore list", 0, "");
  9045. return;
  9046. }
  9047. for(int k = 0; k < friendsCount; k++)
  9048. if(friendsListAsLongs[k] == l)
  9049. {
  9050. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  9051. return;
  9052. }
  9053.  
  9054. ignoreListAsLongs[ignoreCount++] = l;
  9055. needDrawTabArea = true;
  9056. stream.createFrame(133);
  9057. stream.writeQWord(l);
  9058. return;
  9059. }
  9060. catch(RuntimeException runtimeexception)
  9061. {
  9062. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  9063. }
  9064. throw new RuntimeException();
  9065. }
  9066.  
  9067. private void method114()
  9068. {
  9069. for(int i = -1; i < playerCount; i++)
  9070. {
  9071. int j;
  9072. if(i == -1)
  9073. j = myPlayerIndex;
  9074. else
  9075. j = playerIndices[i];
  9076. Player player = playerArray[j];
  9077. if(player != null)
  9078. method96(player);
  9079. }
  9080.  
  9081. }
  9082.  
  9083. private void method115()
  9084. {
  9085. if(loadingStage == 2)
  9086. {
  9087. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  9088. {
  9089. if(class30_sub1.anInt1294 > 0)
  9090. class30_sub1.anInt1294--;
  9091. if(class30_sub1.anInt1294 == 0)
  9092. {
  9093. if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  9094. {
  9095. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  9096. class30_sub1.unlink();
  9097. }
  9098. } else
  9099. {
  9100. if(class30_sub1.anInt1302 > 0)
  9101. class30_sub1.anInt1302--;
  9102. if(class30_sub1.anInt1302 == 0 && class30_sub1.anInt1297 >= 1 && class30_sub1.anInt1298 >= 1 && class30_sub1.anInt1297 <= 102 && class30_sub1.anInt1298 <= 102 && (class30_sub1.anInt1291 < 0 || ObjectManager.method178(class30_sub1.anInt1291, class30_sub1.anInt1293)))
  9103. {
  9104. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  9105. class30_sub1.anInt1302 = -1;
  9106. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  9107. class30_sub1.unlink();
  9108. else
  9109. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  9110. class30_sub1.unlink();
  9111. }
  9112. }
  9113. }
  9114.  
  9115. }
  9116. }
  9117.  
  9118.  
  9119. //stops the click from going over sprite
  9120. private void determineMenuSize()
  9121. {
  9122. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  9123. for(int j = 0; j < menuActionRow; j++)
  9124. {
  9125. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  9126. if(k > i)
  9127. i = k;
  9128. }
  9129.  
  9130. i += 8;
  9131. int l = 15 * menuActionRow + 21;
  9132. if(super.saveClickX > 4 && super.saveClickY > 4 && super.saveClickX < 516 && super.saveClickY < 338)
  9133. {
  9134. int i1 = super.saveClickX - 4 - i / 2;
  9135. if(i1 + i > 512)
  9136. i1 = 512 - i;
  9137. if(i1 < 0)
  9138. i1 = 0;
  9139. int l1 = super.saveClickY - 4;
  9140. if(l1 + l > 334)
  9141. l1 = 334 - l;
  9142. if(l1 < 0)
  9143. l1 = 0;
  9144. menuOpen = true;
  9145. menuScreenArea = 0;
  9146. menuOffsetX = i1;
  9147. menuOffsetY = l1;
  9148. menuWidth = i;
  9149. menuHeight = 15 * menuActionRow + 22;
  9150. }
  9151. if(super.saveClickX > 519 && super.saveClickY > 168 && super.saveClickX < 765 && super.saveClickY < 503)
  9152. {
  9153. int j1 = super.saveClickX - 519 - i / 2;
  9154. if(j1 < 0)
  9155. j1 = 0;
  9156. else
  9157. if(j1 + i > 245)
  9158. j1 = 245 - i;
  9159. int i2 = super.saveClickY - 168;
  9160. if(i2 < 0)
  9161. i2 = 0;
  9162. else
  9163. if(i2 + l > 333)
  9164. i2 = 333 - l;
  9165. menuOpen = true;
  9166. menuScreenArea = 1;
  9167. menuOffsetX = j1;
  9168. menuOffsetY = i2;
  9169. menuWidth = i;
  9170. menuHeight = 15 * menuActionRow + 22;
  9171. }
  9172. if(super.saveClickX > 0 && super.saveClickY > 338 && super.saveClickX < 516 && super.saveClickY < 503)
  9173. {
  9174. int k1 = super.saveClickX - 0 - i / 2;
  9175. if(k1 < 0)
  9176. k1 = 0;
  9177. else
  9178. if(k1 + i > 516)
  9179. k1 = 516 - i;
  9180. int j2 = super.saveClickY - 338;
  9181. if(j2 < 0)
  9182. j2 = 0;
  9183. else
  9184. if(j2 + l > 165)
  9185. j2 = 165 - l;
  9186. menuOpen = true;
  9187. menuScreenArea = 2;
  9188. menuOffsetX = k1;
  9189. menuOffsetY = j2;
  9190. menuWidth = i;
  9191. menuHeight = 15 * menuActionRow + 22;
  9192. }
  9193. }
  9194.  
  9195. private void method117(Stream stream)
  9196. {
  9197. stream.initBitAccess();
  9198. int j = stream.readBits(1);
  9199. if(j == 0)
  9200. return;
  9201. int k = stream.readBits(2);
  9202. if(k == 0)
  9203. {
  9204. anIntArray894[anInt893++] = myPlayerIndex;
  9205. return;
  9206. }
  9207. if(k == 1)
  9208. {
  9209. int l = stream.readBits(3);
  9210. myPlayer.moveInDir(false, l);
  9211. int k1 = stream.readBits(1);
  9212. if(k1 == 1)
  9213. anIntArray894[anInt893++] = myPlayerIndex;
  9214. return;
  9215. }
  9216. if(k == 2)
  9217. {
  9218. int i1 = stream.readBits(3);
  9219. myPlayer.moveInDir(true, i1);
  9220. int l1 = stream.readBits(3);
  9221. myPlayer.moveInDir(true, l1);
  9222. int j2 = stream.readBits(1);
  9223. if(j2 == 1)
  9224. anIntArray894[anInt893++] = myPlayerIndex;
  9225. return;
  9226. }
  9227. if(k == 3)
  9228. {
  9229. plane = stream.readBits(2);
  9230. int j1 = stream.readBits(1);
  9231. int i2 = stream.readBits(1);
  9232. if(i2 == 1)
  9233. anIntArray894[anInt893++] = myPlayerIndex;
  9234. int k2 = stream.readBits(7);
  9235. int l2 = stream.readBits(7);
  9236. myPlayer.setPos(l2, k2, j1 == 1);
  9237. }
  9238. }
  9239.  
  9240. private void nullLoader()
  9241. {
  9242. aBoolean831 = false;
  9243. while(drawingFlames)
  9244. {
  9245. aBoolean831 = false;
  9246. try
  9247. {
  9248. Thread.sleep(50L);
  9249. }
  9250. catch(Exception _ex) { }
  9251. }
  9252. aBackground_966 = null;
  9253. aBackground_967 = null;
  9254. aBackgroundArray1152s = null;
  9255. anIntArray850 = null;
  9256. anIntArray851 = null;
  9257. anIntArray852 = null;
  9258. anIntArray853 = null;
  9259. anIntArray1190 = null;
  9260. anIntArray1191 = null;
  9261. anIntArray828 = null;
  9262. anIntArray829 = null;
  9263. aClass30_Sub2_Sub1_Sub1_1201 = null;
  9264. aClass30_Sub2_Sub1_Sub1_1202 = null;
  9265. }
  9266.  
  9267. private boolean method119(int i, int j)
  9268. {
  9269. boolean flag1 = false;
  9270. RSInterface class9 = RSInterface.interfaceCache[j];
  9271. for(int k = 0; k < class9.children.length; k++)
  9272. {
  9273. if(class9.children[k] == -1)
  9274. break;
  9275. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  9276. if(class9_1.type == 1)
  9277. flag1 |= method119(i, class9_1.id);
  9278. if(class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1))
  9279. {
  9280. boolean flag2 = interfaceIsSelected(class9_1);
  9281. int l;
  9282. if(flag2)
  9283. l = class9_1.anInt258;
  9284. else
  9285. l = class9_1.anInt257;
  9286. if(l != -1)
  9287. {
  9288. Animation animation = Animation.anims[l];
  9289. for(class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);)
  9290. {
  9291. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  9292. class9_1.anInt246++;
  9293. if(class9_1.anInt246 >= animation.anInt352)
  9294. {
  9295. class9_1.anInt246 -= animation.anInt356;
  9296. if(class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  9297. class9_1.anInt246 = 0;
  9298. }
  9299. flag1 = true;
  9300. }
  9301.  
  9302. }
  9303. }
  9304. }
  9305.  
  9306. return flag1;
  9307. }
  9308.  
  9309. private int method120()
  9310. {
  9311. int j = 3;
  9312. if(yCameraCurve < 310)
  9313. {
  9314. int k = xCameraPos >> 7;
  9315. int l = yCameraPos >> 7;
  9316. int i1 = myPlayer.x >> 7;
  9317. int j1 = myPlayer.y >> 7;
  9318. if((byteGroundArray[plane][k][l] & 4) != 0)
  9319. j = plane;
  9320. int k1;
  9321. if(i1 > k)
  9322. k1 = i1 - k;
  9323. else
  9324. k1 = k - i1;
  9325. int l1;
  9326. if(j1 > l)
  9327. l1 = j1 - l;
  9328. else
  9329. l1 = l - j1;
  9330. if(k1 > l1)
  9331. {
  9332. int i2 = (l1 * 0x10000) / k1;
  9333. int k2 = 32768;
  9334. while(k != i1)
  9335. {
  9336. if(k < i1)
  9337. k++;
  9338. else
  9339. if(k > i1)
  9340. k--;
  9341. if((byteGroundArray[plane][k][l] & 4) != 0)
  9342. j = plane;
  9343. k2 += i2;
  9344. if(k2 >= 0x10000)
  9345. {
  9346. k2 -= 0x10000;
  9347. if(l < j1)
  9348. l++;
  9349. else
  9350. if(l > j1)
  9351. l--;
  9352. if((byteGroundArray[plane][k][l] & 4) != 0)
  9353. j = plane;
  9354. }
  9355. }
  9356. } else
  9357. {
  9358. int j2 = (k1 * 0x10000) / l1;
  9359. int l2 = 32768;
  9360. while(l != j1)
  9361. {
  9362. if(l < j1)
  9363. l++;
  9364. else
  9365. if(l > j1)
  9366. l--;
  9367. if((byteGroundArray[plane][k][l] & 4) != 0)
  9368. j = plane;
  9369. l2 += j2;
  9370. if(l2 >= 0x10000)
  9371. {
  9372. l2 -= 0x10000;
  9373. if(k < i1)
  9374. k++;
  9375. else
  9376. if(k > i1)
  9377. k--;
  9378. if((byteGroundArray[plane][k][l] & 4) != 0)
  9379. j = plane;
  9380. }
  9381. }
  9382. }
  9383. }
  9384. if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  9385. j = plane;
  9386. return j;
  9387. }
  9388.  
  9389. private int method121()
  9390. {
  9391. int j = method42(plane, yCameraPos, xCameraPos);
  9392. if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  9393. return plane;
  9394. else
  9395. return 3;
  9396. }
  9397.  
  9398. private void delIgnore(long l)
  9399. {
  9400. try
  9401. {
  9402. if(l == 0L)
  9403. return;
  9404. for(int j = 0; j < ignoreCount; j++)
  9405. if(ignoreListAsLongs[j] == l)
  9406. {
  9407. ignoreCount--;
  9408. needDrawTabArea = true;
  9409. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  9410.  
  9411. stream.createFrame(74);
  9412. stream.writeQWord(l);
  9413. return;
  9414. }
  9415.  
  9416. return;
  9417. }
  9418. catch(RuntimeException runtimeexception)
  9419. {
  9420. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9421. }
  9422. throw new RuntimeException();
  9423. }
  9424.  
  9425.  
  9426. private void chatJoin(long l) {
  9427. try {
  9428. if(l == 0L)
  9429. return;
  9430. stream.createFrame(60);
  9431. stream.writeQWord(l);
  9432. return;
  9433. }
  9434. catch(RuntimeException runtimeexception)
  9435. {
  9436. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9437. }
  9438. throw new RuntimeException();
  9439.  
  9440. }
  9441.  
  9442. public String getParameter(String s)
  9443. {
  9444. if(signlink.mainapp != null)
  9445. return signlink.mainapp.getParameter(s);
  9446. else
  9447. return super.getParameter(s);
  9448. }
  9449.  
  9450. private void adjustVolume(boolean flag, int i)
  9451. {
  9452. signlink.midivol = i;
  9453. if(flag)
  9454. signlink.midi = "voladjust";
  9455. }
  9456.  
  9457. private int extractInterfaceValues(RSInterface class9, int j)
  9458. {
  9459. if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  9460. return -2;
  9461. try
  9462. {
  9463. int ai[] = class9.valueIndexArray[j];
  9464. int k = 0;
  9465. int l = 0;
  9466. int i1 = 0;
  9467. do
  9468. {
  9469. int j1 = ai[l++];
  9470. int k1 = 0;
  9471. byte byte0 = 0;
  9472. if(j1 == 0)
  9473. return k;
  9474. if(j1 == 1)
  9475. k1 = currentStats[ai[l++]];
  9476. if(j1 == 2)
  9477. k1 = maxStats[ai[l++]];
  9478. if(j1 == 3)
  9479. k1 = currentExp[ai[l++]];
  9480. if(j1 == 4)
  9481. {
  9482. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  9483. int k2 = ai[l++];
  9484. if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  9485. {
  9486. for(int j3 = 0; j3 < class9_1.inv.length; j3++)
  9487. if(class9_1.inv[j3] == k2 + 1)
  9488. k1 += class9_1.invStackSizes[j3];
  9489.  
  9490. }
  9491. }
  9492. if(j1 == 5)
  9493. k1 = variousSettings[ai[l++]];
  9494. if(j1 == 6)
  9495. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  9496. if(j1 == 7)
  9497. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  9498. if(j1 == 8)
  9499. k1 = myPlayer.combatLevel;
  9500. if(j1 == 9)
  9501. {
  9502. for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  9503. if(Skills.skillEnabled[l1])
  9504. k1 += maxStats[l1];
  9505.  
  9506. }
  9507. if(j1 == 10)
  9508. {
  9509. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  9510. int l2 = ai[l++] + 1;
  9511. if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  9512. {
  9513. for(int k3 = 0; k3 < class9_2.inv.length; k3++)
  9514. {
  9515. if(class9_2.inv[k3] != l2)
  9516. continue;
  9517. k1 = 0x3b9ac9ff;
  9518. break;
  9519. }
  9520.  
  9521. }
  9522. }
  9523. if(j1 == 11)
  9524. k1 = energy;
  9525. if(j1 == 12)
  9526. k1 = weight;
  9527. if(j1 == 13)
  9528. {
  9529. int i2 = variousSettings[ai[l++]];
  9530. int i3 = ai[l++];
  9531. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  9532. }
  9533. if(j1 == 14)
  9534. {
  9535. int j2 = ai[l++];
  9536. VarBit varBit = VarBit.cache[j2];
  9537. int l3 = varBit.anInt648;
  9538. int i4 = varBit.anInt649;
  9539. int j4 = varBit.anInt650;
  9540. int k4 = anIntArray1232[j4 - i4];
  9541. k1 = variousSettings[l3] >> i4 & k4;
  9542. }
  9543. if(j1 == 15)
  9544. byte0 = 1;
  9545. if(j1 == 16)
  9546. byte0 = 2;
  9547. if(j1 == 17)
  9548. byte0 = 3;
  9549. if(j1 == 18)
  9550. k1 = (myPlayer.x >> 7) + baseX;
  9551. if(j1 == 19)
  9552. k1 = (myPlayer.y >> 7) + baseY;
  9553. if(j1 == 20)
  9554. k1 = ai[l++];
  9555. if(byte0 == 0)
  9556. {
  9557. if(i1 == 0)
  9558. k += k1;
  9559. if(i1 == 1)
  9560. k -= k1;
  9561. if(i1 == 2 && k1 != 0)
  9562. k /= k1;
  9563. if(i1 == 3)
  9564. k *= k1;
  9565. i1 = 0;
  9566. } else
  9567. {
  9568. i1 = byte0;
  9569. }
  9570. } while(true);
  9571. }
  9572. catch(Exception _ex)
  9573. {
  9574. return -1;
  9575. }
  9576. }
  9577.  
  9578. private void drawTooltip() {
  9579. if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  9580. return;
  9581. String s;
  9582. if(itemSelected == 1 && menuActionRow < 2)
  9583. s = "Use " + selectedItemName + " with...";
  9584. else if(spellSelected == 1 && menuActionRow < 2)
  9585. s = spellTooltip + "...";
  9586. else
  9587. s = menuActionName[menuActionRow - 1];
  9588. if(menuActionRow > 2)
  9589. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  9590. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  9591. }
  9592.  
  9593. private void drawMinimap() {
  9594. aRSImageProducer_1164.initDrawingArea();
  9595. if(anInt1021 == 2) {
  9596. byte abyte0[] = mapBack.aByteArray1450;
  9597. int ai[] = DrawingArea.pixels;
  9598. int k2 = abyte0.length;
  9599. for(int i5 = 0; i5 < k2; i5++)
  9600. if(abyte0[i5] == 0)
  9601. ai[i5] = 0;
  9602. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 0, 0, 33, 25);
  9603. aRSImageProducer_1165.initDrawingArea();
  9604. return;
  9605. }
  9606. int i = minimapInt1 + minimapInt2 & 0x7ff;
  9607. int j = 48 + myPlayer.x / 32;
  9608. int l2 = 464 - myPlayer.y / 32;
  9609. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, 5, 25, 146, j);
  9610. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 0, 0, 33, 25);
  9611. for(int j5 = 0; j5 < anInt1071; j5++) {
  9612. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  9613. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  9614. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  9615. }
  9616. for(int k5 = 0; k5 < 104; k5++) {
  9617. for(int l5 = 0; l5 < 104; l5++) {
  9618. NodeList class19 = groundArray[plane][k5][l5];
  9619. if(class19 != null) {
  9620. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  9621. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  9622. markMinimap(mapDotItem, l, j3);
  9623. }
  9624. }
  9625. }
  9626. for(int i6 = 0; i6 < npcCount; i6++) {
  9627. NPC npc = npcArray[npcIndices[i6]];
  9628. if(npc != null && npc.isVisible()) {
  9629. EntityDef entityDef = npc.desc;
  9630. if(entityDef.childrenIDs != null)
  9631. entityDef = entityDef.method161();
  9632. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  9633. int i1 = npc.x / 32 - myPlayer.x / 32;
  9634. int k3 = npc.y / 32 - myPlayer.y / 32;
  9635. markMinimap(mapDotNPC, i1, k3);
  9636. }
  9637. }
  9638. }
  9639. for(int j6 = 0; j6 < playerCount; j6++) {
  9640. Player player = playerArray[playerIndices[j6]];
  9641. if(player != null && player.isVisible()) {
  9642. int j1 = player.x / 32 - myPlayer.x / 32;
  9643. int l3 = player.y / 32 - myPlayer.y / 32;
  9644. boolean flag1 = false;
  9645. boolean flag3 = false;
  9646. for (int j3 = 0; j3 < clanList.length; j3++) {
  9647. if (clanList[j3] == null)
  9648. continue;
  9649. if (!clanList[j3].equalsIgnoreCase(player.name))
  9650. continue;
  9651. flag3 = true;
  9652. break;
  9653. }
  9654. long l6 = TextClass.longForName(player.name);
  9655. for(int k6 = 0; k6 < friendsCount; k6++) {
  9656. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  9657. continue;
  9658. flag1 = true;
  9659. break;
  9660. }
  9661. boolean flag2 = false;
  9662. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  9663. flag2 = true;
  9664. if(flag1)
  9665. markMinimap(mapDotFriend, j1, l3);
  9666. else if(flag3)
  9667. markMinimap(mapDotClan, j1, l3);
  9668. else if(flag2)
  9669. markMinimap(mapDotTeam, j1, l3);
  9670. else
  9671. markMinimap(mapDotPlayer, j1, l3);
  9672. }
  9673. }
  9674. if(anInt855 != 0 && loopCycle % 20 < 10) {
  9675. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  9676. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  9677. if(class30_sub2_sub4_sub1_sub1_1 != null) {
  9678. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  9679. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  9680. method81(mapMarker, i4, k1);
  9681. }
  9682. }
  9683. if(anInt855 == 2) {
  9684. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  9685. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  9686. method81(mapMarker, j4, l1);
  9687. }
  9688. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length) {
  9689. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  9690. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  9691. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  9692. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  9693. method81(mapMarker, k4, i2);
  9694. }
  9695. }
  9696. }
  9697. if(destX != 0) {
  9698. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  9699. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  9700. markMinimap(mapFlag, j2, l4);
  9701. }
  9702. DrawingArea.drawPixels(3, 78, 97, 0xffffff, 3);
  9703. mapBack.drawBackground(0, 0);
  9704. aRSImageProducer_1165.initDrawingArea();
  9705. }
  9706.  
  9707. private void npcScreenPos(Entity entity, int i) {
  9708. calcEntityScreenPos(entity.x, i, entity.y);
  9709. }
  9710.  
  9711. private void calcEntityScreenPos(int i, int j, int l) {
  9712. if(i < 128 || l < 128 || i > 13056 || l > 13056) {
  9713. spriteDrawX = -1;
  9714. spriteDrawY = -1;
  9715. return;
  9716. }
  9717. int i1 = method42(plane, l, i) - j;
  9718. i -= xCameraPos;
  9719. i1 -= zCameraPos;
  9720. l -= yCameraPos;
  9721. int j1 = Model.modelIntArray1[yCameraCurve];
  9722. int k1 = Model.modelIntArray2[yCameraCurve];
  9723. int l1 = Model.modelIntArray1[xCameraCurve];
  9724. int i2 = Model.modelIntArray2[xCameraCurve];
  9725. int j2 = l * l1 + i * i2 >> 16;
  9726. l = l * i2 - i * l1 >> 16;
  9727. i = j2;
  9728. j2 = i1 * k1 - l * j1 >> 16;
  9729. l = i1 * j1 + l * k1 >> 16;
  9730. i1 = j2;
  9731. if(l >= 50) {
  9732. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  9733. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  9734. } else {
  9735. spriteDrawX = -1;
  9736. spriteDrawY = -1;
  9737. }
  9738. }
  9739.  
  9740. private void buildSplitPrivateChatMenu()
  9741. {
  9742. if(splitPrivateChat == 0)
  9743. return;
  9744. int i = 0;
  9745. if(anInt1104 != 0)
  9746. i = 1;
  9747. for(int j = 0; j < 100; j++)
  9748. if(chatMessages[j] != null)
  9749. {
  9750. int k = chatTypes[j];
  9751. String s = chatNames[j];
  9752. boolean flag1 = false;
  9753. if(s != null && s.startsWith("@cr1@"))
  9754. {
  9755. s = s.substring(5);
  9756. boolean flag2 = true;
  9757. }
  9758. if(s != null && s.startsWith("@cr2@"))
  9759. {
  9760. s = s.substring(5);
  9761. byte byte0 = 2;
  9762. }
  9763. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  9764. {
  9765. int l = 329 - i * 13;
  9766. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  9767. {
  9768. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  9769. if(i1 > 450)
  9770. i1 = 450;
  9771. if(super.mouseX < 4 + i1)
  9772. {
  9773. if(myPrivilege >= 1)
  9774. {
  9775. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  9776. menuActionID[menuActionRow] = 2606;
  9777. menuActionRow++;
  9778. }
  9779. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  9780. menuActionID[menuActionRow] = 2042;
  9781. menuActionRow++;
  9782. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  9783. menuActionID[menuActionRow] = 2337;
  9784. menuActionRow++;
  9785. }
  9786. }
  9787. if(++i >= 5)
  9788. return;
  9789. }
  9790. if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  9791. return;
  9792. }
  9793.  
  9794. }
  9795.  
  9796. private void method130(int j, int k, int l, int i1, int j1, int k1,
  9797. int l1, int i2, int j2)
  9798. {
  9799. Class30_Sub1 class30_sub1 = null;
  9800. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  9801. {
  9802. if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  9803. continue;
  9804. class30_sub1 = class30_sub1_1;
  9805. break;
  9806. }
  9807.  
  9808. if(class30_sub1 == null)
  9809. {
  9810. class30_sub1 = new Class30_Sub1();
  9811. class30_sub1.anInt1295 = l1;
  9812. class30_sub1.anInt1296 = i1;
  9813. class30_sub1.anInt1297 = i2;
  9814. class30_sub1.anInt1298 = j1;
  9815. method89(class30_sub1);
  9816. aClass19_1179.insertHead(class30_sub1);
  9817. }
  9818. class30_sub1.anInt1291 = k;
  9819. class30_sub1.anInt1293 = k1;
  9820. class30_sub1.anInt1292 = l;
  9821. class30_sub1.anInt1302 = j2;
  9822. class30_sub1.anInt1294 = j;
  9823. }
  9824.  
  9825. private boolean interfaceIsSelected(RSInterface class9)
  9826. {
  9827. if(class9.anIntArray245 == null)
  9828. return false;
  9829. for(int i = 0; i < class9.anIntArray245.length; i++)
  9830. {
  9831. int j = extractInterfaceValues(class9, i);
  9832. int k = class9.anIntArray212[i];
  9833. if(class9.anIntArray245[i] == 2)
  9834. {
  9835. if(j >= k)
  9836. return false;
  9837. } else
  9838. if(class9.anIntArray245[i] == 3)
  9839. {
  9840. if(j <= k)
  9841. return false;
  9842. } else
  9843. if(class9.anIntArray245[i] == 4)
  9844. {
  9845. if(j == k)
  9846. return false;
  9847. } else
  9848. if(j != k)
  9849. return false;
  9850. }
  9851.  
  9852. return true;
  9853. }
  9854.  
  9855. private DataInputStream openJagGrabInputStream(String s)
  9856. throws IOException
  9857. {
  9858. // if(!aBoolean872)
  9859. // if(signlink.mainapp != null)
  9860. // return signlink.openurl(s);
  9861. // else
  9862. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  9863. if(aSocket832 != null)
  9864. {
  9865. try
  9866. {
  9867. aSocket832.close();
  9868. }
  9869. catch(Exception _ex) { }
  9870. aSocket832 = null;
  9871. }
  9872. aSocket832 = openSocket(43595);
  9873. aSocket832.setSoTimeout(10000);
  9874. java.io.InputStream inputstream = aSocket832.getInputStream();
  9875. OutputStream outputstream = aSocket832.getOutputStream();
  9876. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  9877. return new DataInputStream(inputstream);
  9878. }
  9879.  
  9880. private void doFlamesDrawing()
  9881. {
  9882. char c = '\u0100';
  9883. if(anInt1040 > 0)
  9884. {
  9885. for(int i = 0; i < 256; i++)
  9886. if(anInt1040 > 768)
  9887. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  9888. else
  9889. if(anInt1040 > 256)
  9890. anIntArray850[i] = anIntArray852[i];
  9891. else
  9892. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  9893.  
  9894. } else
  9895. if(anInt1041 > 0)
  9896. {
  9897. for(int j = 0; j < 256; j++)
  9898. if(anInt1041 > 768)
  9899. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  9900. else
  9901. if(anInt1041 > 256)
  9902. anIntArray850[j] = anIntArray853[j];
  9903. else
  9904. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  9905.  
  9906. } else
  9907. {
  9908. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  9909.  
  9910. }
  9911. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, aRSImageProducer_1110.anIntArray315, 0, 33920);
  9912.  
  9913. int i1 = 0;
  9914. int j1 = 1152;
  9915. for(int k1 = 1; k1 < c - 1; k1++)
  9916. {
  9917. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  9918. int j2 = 22 + l1;
  9919. if(j2 < 0)
  9920. j2 = 0;
  9921. i1 += j2;
  9922. for(int l2 = j2; l2 < 128; l2++)
  9923. {
  9924. int j3 = anIntArray828[i1++];
  9925. if(j3 != 0)
  9926. {
  9927. int l3 = j3;
  9928. int j4 = 256 - j3;
  9929. j3 = anIntArray850[j3];
  9930. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  9931. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  9932. } else
  9933. {
  9934. j1++;
  9935. }
  9936. }
  9937.  
  9938. j1 += j2;
  9939. }
  9940.  
  9941. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  9942. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, aRSImageProducer_1111.anIntArray315, 0, 33920);
  9943.  
  9944. i1 = 0;
  9945. j1 = 1176;
  9946. for(int k2 = 1; k2 < c - 1; k2++)
  9947. {
  9948. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  9949. int k3 = 103 - i3;
  9950. j1 += i3;
  9951. for(int i4 = 0; i4 < k3; i4++)
  9952. {
  9953. int k4 = anIntArray828[i1++];
  9954. if(k4 != 0)
  9955. {
  9956. int i5 = k4;
  9957. int j5 = 256 - k4;
  9958. k4 = anIntArray850[k4];
  9959. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  9960. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  9961. } else
  9962. {
  9963. j1++;
  9964. }
  9965. }
  9966.  
  9967. i1 += 128 - k3;
  9968. j1 += 128 - k3 - i3;
  9969. }
  9970.  
  9971. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  9972. }
  9973.  
  9974. private void method134(Stream stream)
  9975. {
  9976. int j = stream.readBits(8);
  9977. if(j < playerCount)
  9978. {
  9979. for(int k = j; k < playerCount; k++)
  9980. anIntArray840[anInt839++] = playerIndices[k];
  9981.  
  9982. }
  9983. if(j > playerCount)
  9984. {
  9985. signlink.reporterror(myUsername + " Too many players");
  9986. throw new RuntimeException("eek");
  9987. }
  9988. playerCount = 0;
  9989. for(int l = 0; l < j; l++)
  9990. {
  9991. int i1 = playerIndices[l];
  9992. Player player = playerArray[i1];
  9993. int j1 = stream.readBits(1);
  9994. if(j1 == 0)
  9995. {
  9996. playerIndices[playerCount++] = i1;
  9997. player.anInt1537 = loopCycle;
  9998. } else
  9999. {
  10000. int k1 = stream.readBits(2);
  10001. if(k1 == 0)
  10002. {
  10003. playerIndices[playerCount++] = i1;
  10004. player.anInt1537 = loopCycle;
  10005. anIntArray894[anInt893++] = i1;
  10006. } else
  10007. if(k1 == 1)
  10008. {
  10009. playerIndices[playerCount++] = i1;
  10010. player.anInt1537 = loopCycle;
  10011. int l1 = stream.readBits(3);
  10012. player.moveInDir(false, l1);
  10013. int j2 = stream.readBits(1);
  10014. if(j2 == 1)
  10015. anIntArray894[anInt893++] = i1;
  10016. } else
  10017. if(k1 == 2)
  10018. {
  10019. playerIndices[playerCount++] = i1;
  10020. player.anInt1537 = loopCycle;
  10021. int i2 = stream.readBits(3);
  10022. player.moveInDir(true, i2);
  10023. int k2 = stream.readBits(3);
  10024. player.moveInDir(true, k2);
  10025. int l2 = stream.readBits(1);
  10026. if(l2 == 1)
  10027. anIntArray894[anInt893++] = i1;
  10028. } else
  10029. if(k1 == 3)
  10030. anIntArray840[anInt839++] = i1;
  10031. }
  10032. }
  10033. }
  10034.  
  10035. private void drawLoginScreen(boolean flag)
  10036. {
  10037. resetImageProducers();
  10038. aRSImageProducer_1109.initDrawingArea();
  10039. aBackground_966.drawBackground(0, 0);
  10040. char c = '\u0168';
  10041. char c1 = '\310';
  10042. if(loginScreenState == 0)
  10043. {
  10044. int i = c1 / 2 + 80;
  10045. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  10046. i = c1 / 2 - 20;
  10047. chatTextDrawingArea.method382(0xffff00, c / 2, "Welcome to RuneScape", i, true);
  10048. i += 30;
  10049. int l = c / 2 - 80;
  10050. int k1 = c1 / 2 + 20;
  10051. aBackground_967.drawBackground(l - 73, k1 - 20);
  10052. chatTextDrawingArea.method382(0xffffff, l, "New User", k1 + 5, true);
  10053. l = c / 2 + 80;
  10054. aBackground_967.drawBackground(l - 73, k1 - 20);
  10055. chatTextDrawingArea.method382(0xffffff, l, "Existing User", k1 + 5, true);
  10056. }
  10057. if(loginScreenState == 2)
  10058. {
  10059. int j = c1 / 2 - 40;
  10060. if(loginMessage1.length() > 0)
  10061. {
  10062. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  10063. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j, true);
  10064. j += 30;
  10065. } else
  10066. {
  10067. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  10068. j += 30;
  10069. }
  10070. chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff, "Username: " + myUsername + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10071. j += 15;
  10072. chatTextDrawingArea.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10073. j += 15;
  10074. if(!flag)
  10075. {
  10076. int i1 = c / 2 - 80;
  10077. int l1 = c1 / 2 + 50;
  10078. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10079. chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5, true);
  10080. i1 = c / 2 + 80;
  10081. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10082. chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  10083. }
  10084. }
  10085. if(loginScreenState == 3)
  10086. {
  10087. chatTextDrawingArea.method382(0xffff00, c / 2, "Create a free account", c1 / 2 - 60, true);
  10088. int k = c1 / 2 - 35;
  10089. chatTextDrawingArea.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
  10090. k += 15;
  10091. chatTextDrawingArea.method382(0xffffff, c / 2, "go back to the main RuneScape webpage", k, true);
  10092. k += 15;
  10093. chatTextDrawingArea.method382(0xffffff, c / 2, "and choose the red 'create account'", k, true);
  10094. k += 15;
  10095. chatTextDrawingArea.method382(0xffffff, c / 2, "button at the top right of that page.", k, true);
  10096. k += 15;
  10097. int j1 = c / 2;
  10098. int i2 = c1 / 2 + 50;
  10099. aBackground_967.drawBackground(j1 - 73, i2 - 20);
  10100. chatTextDrawingArea.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  10101. }
  10102. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  10103. if(welcomeScreenRaised)
  10104. {
  10105. welcomeScreenRaised = false;
  10106. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  10107. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  10108. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  10109. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  10110. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  10111. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  10112. }
  10113. }
  10114.  
  10115. private void drawFlames()
  10116. {
  10117. drawingFlames = true;
  10118. try
  10119. {
  10120. long l = System.currentTimeMillis();
  10121. int i = 0;
  10122. int j = 20;
  10123. while(aBoolean831)
  10124. {
  10125. anInt1208++;
  10126. calcFlamesPosition();
  10127. calcFlamesPosition();
  10128. doFlamesDrawing();
  10129. if(++i > 10)
  10130. {
  10131. long l1 = System.currentTimeMillis();
  10132. int k = (int)(l1 - l) / 10 - j;
  10133. j = 40 - k;
  10134. if(j < 5)
  10135. j = 5;
  10136. i = 0;
  10137. l = l1;
  10138. }
  10139. try
  10140. {
  10141. Thread.sleep(j);
  10142. }
  10143. catch(Exception _ex) { }
  10144. }
  10145. }
  10146. catch(Exception _ex) { }
  10147. drawingFlames = false;
  10148. }
  10149.  
  10150. public void raiseWelcomeScreen()
  10151. {
  10152. welcomeScreenRaised = true;
  10153. }
  10154.  
  10155. private void method137(Stream stream, int j)
  10156. {
  10157. if(j == 84)
  10158. {
  10159. int k = stream.readUnsignedByte();
  10160. int j3 = anInt1268 + (k >> 4 & 7);
  10161. int i6 = anInt1269 + (k & 7);
  10162. int l8 = stream.readUnsignedWord();
  10163. int k11 = stream.readUnsignedWord();
  10164. int l13 = stream.readUnsignedWord();
  10165. if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  10166. {
  10167. NodeList class19_1 = groundArray[plane][j3][i6];
  10168. if(class19_1 != null)
  10169. {
  10170. for(Item class30_sub2_sub4_sub2_3 = (Item)class19_1.reverseGetFirst(); class30_sub2_sub4_sub2_3 != null; class30_sub2_sub4_sub2_3 = (Item)class19_1.reverseGetNext())
  10171. {
  10172. if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  10173. continue;
  10174. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  10175. break;
  10176. }
  10177.  
  10178. spawnGroundItem(j3, i6);
  10179. }
  10180. }
  10181. return;
  10182. }
  10183. if(j == 105)
  10184. {
  10185. int l = stream.readUnsignedByte();
  10186. int k3 = anInt1268 + (l >> 4 & 7);
  10187. int j6 = anInt1269 + (l & 7);
  10188. int i9 = stream.readUnsignedWord();
  10189. int l11 = stream.readUnsignedByte();
  10190. int i14 = l11 >> 4 & 0xf;
  10191. int i16 = l11 & 7;
  10192. if(myPlayer.smallX[0] >= k3 - i14 && myPlayer.smallX[0] <= k3 + i14 && myPlayer.smallY[0] >= j6 - i14 && myPlayer.smallY[0] <= j6 + i14 && aBoolean848 && !lowMem && anInt1062 < 50)
  10193. {
  10194. anIntArray1207[anInt1062] = i9;
  10195. anIntArray1241[anInt1062] = i16;
  10196. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  10197. anInt1062++;
  10198. }
  10199. }
  10200. if(j == 215)
  10201. {
  10202. int i1 = stream.method435();
  10203. int l3 = stream.method428();
  10204. int k6 = anInt1268 + (l3 >> 4 & 7);
  10205. int j9 = anInt1269 + (l3 & 7);
  10206. int i12 = stream.method435();
  10207. int j14 = stream.readUnsignedWord();
  10208. if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  10209. {
  10210. Item class30_sub2_sub4_sub2_2 = new Item();
  10211. class30_sub2_sub4_sub2_2.ID = i1;
  10212. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  10213. if(groundArray[plane][k6][j9] == null)
  10214. groundArray[plane][k6][j9] = new NodeList();
  10215. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  10216. spawnGroundItem(k6, j9);
  10217. }
  10218. return;
  10219. }
  10220. if(j == 156)
  10221. {
  10222. int j1 = stream.method426();
  10223. int i4 = anInt1268 + (j1 >> 4 & 7);
  10224. int l6 = anInt1269 + (j1 & 7);
  10225. int k9 = stream.readUnsignedWord();
  10226. if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  10227. {
  10228. NodeList class19 = groundArray[plane][i4][l6];
  10229. if(class19 != null)
  10230. {
  10231. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  10232. {
  10233. if(item.ID != (k9 & 0x7fff))
  10234. continue;
  10235. item.unlink();
  10236. break;
  10237. }
  10238.  
  10239. if(class19.reverseGetFirst() == null)
  10240. groundArray[plane][i4][l6] = null;
  10241. spawnGroundItem(i4, l6);
  10242. }
  10243. }
  10244. return;
  10245. }
  10246. if(j == 160)
  10247. {
  10248. int k1 = stream.method428();
  10249. int j4 = anInt1268 + (k1 >> 4 & 7);
  10250. int i7 = anInt1269 + (k1 & 7);
  10251. int l9 = stream.method428();
  10252. int j12 = l9 >> 2;
  10253. int k14 = l9 & 3;
  10254. int j16 = anIntArray1177[j12];
  10255. int j17 = stream.method435();
  10256. if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  10257. {
  10258. int j18 = intGroundArray[plane][j4][i7];
  10259. int i19 = intGroundArray[plane][j4 + 1][i7];
  10260. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  10261. int k20 = intGroundArray[plane][j4][i7 + 1];
  10262. if(j16 == 0)
  10263. {
  10264. Object1 class10 = worldController.method296(plane, j4, i7);
  10265. if(class10 != null)
  10266. {
  10267. int k21 = class10.uid >> 14 & 0x7fff;
  10268. if(j12 == 2)
  10269. {
  10270. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  10271. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  10272. } else
  10273. {
  10274. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  10275. }
  10276. }
  10277. }
  10278. if(j16 == 1)
  10279. {
  10280. Object2 class26 = worldController.method297(j4, i7, plane);
  10281. if(class26 != null)
  10282. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  10283. }
  10284. if(j16 == 2)
  10285. {
  10286. Object5 class28 = worldController.method298(j4, i7, plane);
  10287. if(j12 == 11)
  10288. j12 = 10;
  10289. if(class28 != null)
  10290. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  10291. }
  10292. if(j16 == 3)
  10293. {
  10294. Object3 class49 = worldController.method299(i7, j4, plane);
  10295. if(class49 != null)
  10296. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  10297. }
  10298. }
  10299. return;
  10300. }
  10301. if(j == 147)
  10302. {
  10303. int l1 = stream.method428();
  10304. int k4 = anInt1268 + (l1 >> 4 & 7);
  10305. int j7 = anInt1269 + (l1 & 7);
  10306. int i10 = stream.readUnsignedWord();
  10307. byte byte0 = stream.method430();
  10308. int l14 = stream.method434();
  10309. byte byte1 = stream.method429();
  10310. int k17 = stream.readUnsignedWord();
  10311. int k18 = stream.method428();
  10312. int j19 = k18 >> 2;
  10313. int i20 = k18 & 3;
  10314. int l20 = anIntArray1177[j19];
  10315. byte byte2 = stream.readSignedByte();
  10316. int l21 = stream.readUnsignedWord();
  10317. byte byte3 = stream.method429();
  10318. Player player;
  10319. if(i10 == unknownInt10)
  10320. player = myPlayer;
  10321. else
  10322. player = playerArray[i10];
  10323. if(player != null)
  10324. {
  10325. ObjectDef class46 = ObjectDef.forID(l21);
  10326. int i22 = intGroundArray[plane][k4][j7];
  10327. int j22 = intGroundArray[plane][k4 + 1][j7];
  10328. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  10329. int l22 = intGroundArray[plane][k4][j7 + 1];
  10330. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  10331. if(model != null)
  10332. {
  10333. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  10334. player.anInt1707 = l14 + loopCycle;
  10335. player.anInt1708 = k17 + loopCycle;
  10336. player.aModel_1714 = model;
  10337. int i23 = class46.anInt744;
  10338. int j23 = class46.anInt761;
  10339. if(i20 == 1 || i20 == 3)
  10340. {
  10341. i23 = class46.anInt761;
  10342. j23 = class46.anInt744;
  10343. }
  10344. player.anInt1711 = k4 * 128 + i23 * 64;
  10345. player.anInt1713 = j7 * 128 + j23 * 64;
  10346. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  10347. if(byte2 > byte0)
  10348. {
  10349. byte byte4 = byte2;
  10350. byte2 = byte0;
  10351. byte0 = byte4;
  10352. }
  10353. if(byte3 > byte1)
  10354. {
  10355. byte byte5 = byte3;
  10356. byte3 = byte1;
  10357. byte1 = byte5;
  10358. }
  10359. player.anInt1719 = k4 + byte2;
  10360. player.anInt1721 = k4 + byte0;
  10361. player.anInt1720 = j7 + byte3;
  10362. player.anInt1722 = j7 + byte1;
  10363. }
  10364. }
  10365. }
  10366. if(j == 151)
  10367. {
  10368. int i2 = stream.method426();
  10369. int l4 = anInt1268 + (i2 >> 4 & 7);
  10370. int k7 = anInt1269 + (i2 & 7);
  10371. int j10 = stream.method434();
  10372. int k12 = stream.method428();
  10373. int i15 = k12 >> 2;
  10374. int k16 = k12 & 3;
  10375. int l17 = anIntArray1177[i15];
  10376. if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  10377. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  10378. return;
  10379. }
  10380. if(j == 4)
  10381. {
  10382. int j2 = stream.readUnsignedByte();
  10383. int i5 = anInt1268 + (j2 >> 4 & 7);
  10384. int l7 = anInt1269 + (j2 & 7);
  10385. int k10 = stream.readUnsignedWord();
  10386. int l12 = stream.readUnsignedByte();
  10387. int j15 = stream.readUnsignedWord();
  10388. if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  10389. {
  10390. i5 = i5 * 128 + 64;
  10391. l7 = l7 * 128 + 64;
  10392. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  10393. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  10394. }
  10395. return;
  10396. }
  10397. if(j == 44)
  10398. {
  10399. int k2 = stream.method436();
  10400. int j5 = stream.readUnsignedWord();
  10401. int i8 = stream.readUnsignedByte();
  10402. int l10 = anInt1268 + (i8 >> 4 & 7);
  10403. int i13 = anInt1269 + (i8 & 7);
  10404. if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  10405. {
  10406. Item class30_sub2_sub4_sub2_1 = new Item();
  10407. class30_sub2_sub4_sub2_1.ID = k2;
  10408. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  10409. if(groundArray[plane][l10][i13] == null)
  10410. groundArray[plane][l10][i13] = new NodeList();
  10411. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  10412. spawnGroundItem(l10, i13);
  10413. }
  10414. return;
  10415. }
  10416. if(j == 101)
  10417. {
  10418. int l2 = stream.method427();
  10419. int k5 = l2 >> 2;
  10420. int j8 = l2 & 3;
  10421. int i11 = anIntArray1177[k5];
  10422. int j13 = stream.readUnsignedByte();
  10423. int k15 = anInt1268 + (j13 >> 4 & 7);
  10424. int l16 = anInt1269 + (j13 & 7);
  10425. if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  10426. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  10427. return;
  10428. }
  10429. if(j == 117)
  10430. {
  10431. int i3 = stream.readUnsignedByte();
  10432. int l5 = anInt1268 + (i3 >> 4 & 7);
  10433. int k8 = anInt1269 + (i3 & 7);
  10434. int j11 = l5 + stream.readSignedByte();
  10435. int k13 = k8 + stream.readSignedByte();
  10436. int l15 = stream.readSignedWord();
  10437. int i17 = stream.readUnsignedWord();
  10438. int i18 = stream.readUnsignedByte() * 4;
  10439. int l18 = stream.readUnsignedByte() * 4;
  10440. int k19 = stream.readUnsignedWord();
  10441. int j20 = stream.readUnsignedWord();
  10442. int i21 = stream.readUnsignedByte();
  10443. int j21 = stream.readUnsignedByte();
  10444. if(l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535)
  10445. {
  10446. l5 = l5 * 128 + 64;
  10447. k8 = k8 * 128 + 64;
  10448. j11 = j11 * 128 + 64;
  10449. k13 = k13 * 128 + 64;
  10450. Animable_Sub4 class30_sub2_sub4_sub4 = new Animable_Sub4(i21, l18, k19 + loopCycle, j20 + loopCycle, j21, plane, method42(plane, k8, l5) - i18, k8, l5, l15, i17);
  10451. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  10452. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  10453. }
  10454. }
  10455. }
  10456.  
  10457. private static void setLowMem()
  10458. {
  10459. WorldController.lowMem = true;
  10460. Texture.lowMem = true;
  10461. lowMem = true;
  10462. ObjectManager.lowMem = true;
  10463. ObjectDef.lowMem = true;
  10464. }
  10465.  
  10466. private void method139(Stream stream)
  10467. {
  10468. stream.initBitAccess();
  10469. int k = stream.readBits(8);
  10470. if(k < npcCount)
  10471. {
  10472. for(int l = k; l < npcCount; l++)
  10473. anIntArray840[anInt839++] = npcIndices[l];
  10474.  
  10475. }
  10476. if(k > npcCount)
  10477. {
  10478. signlink.reporterror(myUsername + " Too many npcs");
  10479. throw new RuntimeException("eek");
  10480. }
  10481. npcCount = 0;
  10482. for(int i1 = 0; i1 < k; i1++)
  10483. {
  10484. int j1 = npcIndices[i1];
  10485. NPC npc = npcArray[j1];
  10486. int k1 = stream.readBits(1);
  10487. if(k1 == 0)
  10488. {
  10489. npcIndices[npcCount++] = j1;
  10490. npc.anInt1537 = loopCycle;
  10491. } else
  10492. {
  10493. int l1 = stream.readBits(2);
  10494. if(l1 == 0)
  10495. {
  10496. npcIndices[npcCount++] = j1;
  10497. npc.anInt1537 = loopCycle;
  10498. anIntArray894[anInt893++] = j1;
  10499. } else
  10500. if(l1 == 1)
  10501. {
  10502. npcIndices[npcCount++] = j1;
  10503. npc.anInt1537 = loopCycle;
  10504. int i2 = stream.readBits(3);
  10505. npc.moveInDir(false, i2);
  10506. int k2 = stream.readBits(1);
  10507. if(k2 == 1)
  10508. anIntArray894[anInt893++] = j1;
  10509. } else
  10510. if(l1 == 2)
  10511. {
  10512. npcIndices[npcCount++] = j1;
  10513. npc.anInt1537 = loopCycle;
  10514. int j2 = stream.readBits(3);
  10515. npc.moveInDir(true, j2);
  10516. int l2 = stream.readBits(3);
  10517. npc.moveInDir(true, l2);
  10518. int i3 = stream.readBits(1);
  10519. if(i3 == 1)
  10520. anIntArray894[anInt893++] = j1;
  10521. } else
  10522. if(l1 == 3)
  10523. anIntArray840[anInt839++] = j1;
  10524. }
  10525. }
  10526.  
  10527. }
  10528.  
  10529. private void processLoginScreenInput()
  10530. {
  10531. if(loginScreenState == 0)
  10532. {
  10533. int i = super.myWidth / 2 - 80;
  10534. int l = super.myHeight / 2 + 20;
  10535. l += 20;
  10536. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  10537. {
  10538. loginScreenState = 3;
  10539. loginScreenCursorPos = 0;
  10540. }
  10541. i = super.myWidth / 2 + 80;
  10542. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  10543. {
  10544. loginMessage1 = "";
  10545. loginMessage2 = "Enter your username & password.";
  10546. loginScreenState = 2;
  10547. loginScreenCursorPos = 0;
  10548. }
  10549. } else
  10550. {
  10551. if(loginScreenState == 2)
  10552. {
  10553. int j = super.myHeight / 2 - 40;
  10554. j += 30;
  10555. j += 25;
  10556. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10557. loginScreenCursorPos = 0;
  10558. j += 15;
  10559. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10560. loginScreenCursorPos = 1;
  10561. j += 15;
  10562. int i1 = super.myWidth / 2 - 80;
  10563. int k1 = super.myHeight / 2 + 50;
  10564. k1 += 20;
  10565. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  10566. {
  10567. loginFailures = 0;
  10568. login(myUsername, myPassword, false);
  10569. if(loggedIn)
  10570. return;
  10571. }
  10572. i1 = super.myWidth / 2 + 80;
  10573. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  10574. {
  10575. loginScreenState = 0;
  10576. // myUsername = "";
  10577. // myPassword = "";
  10578. }
  10579. do
  10580. {
  10581. int l1 = readChar(-796);
  10582. if(l1 == -1)
  10583. break;
  10584. boolean flag1 = false;
  10585. for(int i2 = 0; i2 < validUserPassChars.length(); i2++)
  10586. {
  10587. if(l1 != validUserPassChars.charAt(i2))
  10588. continue;
  10589. flag1 = true;
  10590. break;
  10591. }
  10592.  
  10593. if(loginScreenCursorPos == 0)
  10594. {
  10595. if(l1 == 8 && myUsername.length() > 0)
  10596. myUsername = myUsername.substring(0, myUsername.length() - 1);
  10597. if(l1 == 9 || l1 == 10 || l1 == 13)
  10598. loginScreenCursorPos = 1;
  10599. if(flag1)
  10600. myUsername += (char)l1;
  10601. if(myUsername.length() > 12)
  10602. myUsername = myUsername.substring(0, 12);
  10603. } else
  10604. if(loginScreenCursorPos == 1)
  10605. {
  10606. if(l1 == 8 && myPassword.length() > 0)
  10607. myPassword = myPassword.substring(0, myPassword.length() - 1);
  10608. if(l1 == 9 || l1 == 10 || l1 == 13)
  10609. loginScreenCursorPos = 0;
  10610. if(flag1)
  10611. myPassword += (char)l1;
  10612. if(myPassword.length() > 20)
  10613. myPassword = myPassword.substring(0, 20);
  10614. }
  10615. } while(true);
  10616. return;
  10617. }
  10618. if(loginScreenState == 3)
  10619. {
  10620. int k = super.myWidth / 2;
  10621. int j1 = super.myHeight / 2 + 50;
  10622. j1 += 20;
  10623. if(super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75 && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  10624. loginScreenState = 0;
  10625. }
  10626. }
  10627. }
  10628.  
  10629. private void markMinimap(Sprite sprite, int i, int j) {
  10630. int k = minimapInt1 + minimapInt2 & 0x7ff;
  10631. int l = i * i + j * j;
  10632. if(l > 6400)
  10633. return;
  10634. int i1 = Model.modelIntArray1[k];
  10635. int j1 = Model.modelIntArray2[k];
  10636. i1 = (i1 * 256) / (minimapInt3 + 256);
  10637. j1 = (j1 * 256) / (minimapInt3 + 256);
  10638. int k1 = j * i1 + i * j1 >> 16;
  10639. int l1 = j * j1 - i * i1 >> 16;
  10640. if(l > 2500) {
  10641. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 , 83 - l1 - sprite.anInt1445 / 2 - 4);
  10642. } else {
  10643. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4, 83 - l1 - sprite.anInt1445 / 2 - 4);
  10644. }
  10645. }
  10646.  
  10647. private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  10648. )
  10649. {
  10650. if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  10651. {
  10652. if(lowMem && j != plane)
  10653. return;
  10654. int i2 = 0;
  10655. if(j1 == 0)
  10656. i2 = worldController.method300(j, i1, i);
  10657. if(j1 == 1)
  10658. i2 = worldController.method301(j, i1, i);
  10659. if(j1 == 2)
  10660. i2 = worldController.method302(j, i1, i);
  10661. if(j1 == 3)
  10662. i2 = worldController.method303(j, i1, i);
  10663. if(i2 != 0)
  10664. {
  10665. int i3 = worldController.method304(j, i1, i, i2);
  10666. int j2 = i2 >> 14 & 0x7fff;
  10667. int k2 = i3 & 0x1f;
  10668. int l2 = i3 >> 6;
  10669. if(j1 == 0)
  10670. {
  10671. worldController.method291(i1, j, i, (byte)-119);
  10672. ObjectDef class46 = ObjectDef.forID(j2);
  10673. if(class46.aBoolean767)
  10674. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  10675. }
  10676. if(j1 == 1)
  10677. worldController.method292(i, j, i1);
  10678. if(j1 == 2)
  10679. {
  10680. worldController.method293(j, i1, i);
  10681. ObjectDef class46_1 = ObjectDef.forID(j2);
  10682. if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  10683. return;
  10684. if(class46_1.aBoolean767)
  10685. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  10686. }
  10687. if(j1 == 3)
  10688. {
  10689. worldController.method294(j, i, i1);
  10690. ObjectDef class46_2 = ObjectDef.forID(j2);
  10691. if(class46_2.aBoolean767 && class46_2.hasActions)
  10692. aClass11Array1230[j].method218(i, i1);
  10693. }
  10694. }
  10695. if(k1 >= 0)
  10696. {
  10697. int j3 = j;
  10698. if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  10699. j3++;
  10700. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  10701. }
  10702. }
  10703. }
  10704.  
  10705. private void updatePlayers(int i, Stream stream)
  10706. {
  10707. anInt839 = 0;
  10708. anInt893 = 0;
  10709. method117(stream);
  10710. method134(stream);
  10711. method91(stream, i);
  10712. method49(stream);
  10713. for(int k = 0; k < anInt839; k++)
  10714. {
  10715. int l = anIntArray840[k];
  10716. if(playerArray[l].anInt1537 != loopCycle)
  10717. playerArray[l] = null;
  10718. }
  10719.  
  10720. if(stream.currentOffset != i)
  10721. {
  10722. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  10723. throw new RuntimeException("eek");
  10724. }
  10725. for(int i1 = 0; i1 < playerCount; i1++)
  10726. if(playerArray[playerIndices[i1]] == null)
  10727. {
  10728. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  10729. throw new RuntimeException("eek");
  10730. }
  10731.  
  10732. }
  10733.  
  10734. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  10735. {
  10736. int l1 = 2048 - k & 0x7ff;
  10737. int i2 = 2048 - j1 & 0x7ff;
  10738. int j2 = 0;
  10739. int k2 = 0;
  10740. int l2 = j;
  10741. if(l1 != 0)
  10742. {
  10743. int i3 = Model.modelIntArray1[l1];
  10744. int k3 = Model.modelIntArray2[l1];
  10745. int i4 = k2 * k3 - l2 * i3 >> 16;
  10746. l2 = k2 * i3 + l2 * k3 >> 16;
  10747. k2 = i4;
  10748. }
  10749. if(i2 != 0)
  10750. {
  10751. /* xxx if(cameratoggle){
  10752. if(zoom == 0)
  10753. zoom = k2;
  10754. if(lftrit == 0)
  10755. lftrit = j2;
  10756. if(fwdbwd == 0)
  10757. fwdbwd = l2;
  10758. k2 = zoom;
  10759. j2 = lftrit;
  10760. l2 = fwdbwd;
  10761. }
  10762. */
  10763. int j3 = Model.modelIntArray1[i2];
  10764. int l3 = Model.modelIntArray2[i2];
  10765. int j4 = l2 * j3 + j2 * l3 >> 16;
  10766. l2 = l2 * l3 - j2 * j3 >> 16;
  10767. j2 = j4;
  10768. }
  10769. xCameraPos = l - j2;
  10770. zCameraPos = i1 - k2;
  10771. yCameraPos = k1 - l2;
  10772. yCameraCurve = k;
  10773. xCameraCurve = j1;
  10774. }
  10775.  
  10776. public void updateStrings(String str, int i) {
  10777. switch(i) {
  10778. case 1675: sendFrame126(str, 17508); break;//Stab
  10779. case 1676: sendFrame126(str, 17509); break;//Slash
  10780. case 1677: sendFrame126(str, 17510); break;//Cursh
  10781. case 1678: sendFrame126(str, 17511); break;//Magic
  10782. case 1679: sendFrame126(str, 17512); break;//Range
  10783. case 1680: sendFrame126(str, 17513); break;//Stab
  10784. case 1681: sendFrame126(str, 17514); break;//Slash
  10785. case 1682: sendFrame126(str, 17515); break;//Crush
  10786. case 1683: sendFrame126(str, 17516); break;//Magic
  10787. case 1684: sendFrame126(str, 17517); break;//Range
  10788. case 1686: sendFrame126(str, 17518); break;//Strength
  10789. case 1687: sendFrame126(str, 17519); break;//Prayer
  10790. }
  10791. }
  10792.  
  10793. public void sendFrame126(String str,int i) {
  10794. RSInterface.interfaceCache[i].message = str;
  10795. if(RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  10796. needDrawTabArea = true;
  10797. }
  10798.  
  10799. public void sendPacket185(int button,int toggle,int type) {
  10800. switch(type) {
  10801. case 135:
  10802. RSInterface class9 = RSInterface.interfaceCache[button];
  10803. boolean flag8 = true;
  10804. if(class9.contentType > 0)
  10805. flag8 = promptUserForInput(class9);
  10806. if(flag8) {
  10807. stream.createFrame(185);
  10808. stream.writeWord(button);
  10809. }
  10810. break;
  10811. case 646:
  10812. stream.createFrame(185);
  10813. stream.writeWord(button);
  10814. RSInterface class9_2 = RSInterface.interfaceCache[button];
  10815. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  10816. if(variousSettings[toggle] != class9_2.anIntArray212[0]) {
  10817. variousSettings[toggle] = class9_2.anIntArray212[0];
  10818. method33(toggle);
  10819. needDrawTabArea = true;
  10820. }
  10821. }
  10822. break;
  10823. case 169:
  10824. stream.createFrame(185);
  10825. stream.writeWord(button);
  10826. RSInterface class9_3 = RSInterface.interfaceCache[button];
  10827. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  10828. variousSettings[toggle] = 1 - variousSettings[toggle];
  10829. method33(toggle);
  10830. needDrawTabArea = true;
  10831. }
  10832. switch(button) {
  10833. case 19136:
  10834. System.out.println("toggle = "+toggle);
  10835. if(toggle == 0)
  10836. sendFrame36(173,toggle);
  10837. if(toggle == 1)
  10838. sendPacket185(153,173,646);
  10839. break;
  10840. }
  10841. break;
  10842. }
  10843. }
  10844.  
  10845. public void sendFrame36(int id,int state) {
  10846. anIntArray1045[id] = state;
  10847. if(variousSettings[id] != state) {
  10848. variousSettings[id] = state;
  10849. method33(id);
  10850. needDrawTabArea = true;
  10851. if(dialogID != -1)
  10852. inputTaken = true;
  10853. }
  10854. }
  10855.  
  10856. public void sendFrame219() {
  10857. if(invOverlayInterfaceID != -1) {
  10858. invOverlayInterfaceID = -1;
  10859. needDrawTabArea = true;
  10860. tabAreaAltered = true;
  10861. }
  10862. if(backDialogID != -1) {
  10863. backDialogID = -1;
  10864. inputTaken = true;
  10865. }
  10866. if(inputDialogState != 0) {
  10867. inputDialogState = 0;
  10868. inputTaken = true;
  10869. }
  10870. openInterfaceID = -1;
  10871. aBoolean1149 = false;
  10872. }
  10873.  
  10874. public void sendFrame248(int interfaceID,int sideInterfaceID) {
  10875. if(backDialogID != -1) {
  10876. backDialogID = -1;
  10877. inputTaken = true;
  10878. }
  10879. if(inputDialogState != 0) {
  10880. inputDialogState = 0;
  10881. inputTaken = true;
  10882. }
  10883. openInterfaceID = interfaceID;
  10884. invOverlayInterfaceID = sideInterfaceID;
  10885. needDrawTabArea = true;
  10886. tabAreaAltered = true;
  10887. aBoolean1149 = false;
  10888. }
  10889.  
  10890. private boolean parsePacket() {
  10891. if(socketStream == null)
  10892. return false;
  10893. try {
  10894. int i = socketStream.available();
  10895. if(i == 0)
  10896. return false;
  10897. if(pktType == -1) {
  10898. socketStream.flushInputStream(inStream.buffer, 1);
  10899. pktType = inStream.buffer[0] & 0xff;
  10900. if(encryption != null)
  10901. pktType = pktType - encryption.getNextKey() & 0xff;
  10902. pktSize = SizeConstants.packetSizes[pktType];
  10903. i--;
  10904. }
  10905. if(pktSize == -1)
  10906. if(i > 0) {
  10907. socketStream.flushInputStream(inStream.buffer, 1);
  10908. pktSize = inStream.buffer[0] & 0xff;
  10909. i--;
  10910. } else {
  10911. return false;
  10912. }
  10913. if(pktSize == -2)
  10914. if(i > 1) {
  10915. socketStream.flushInputStream(inStream.buffer, 2);
  10916. inStream.currentOffset = 0;
  10917. pktSize = inStream.readUnsignedWord();
  10918. i -= 2;
  10919. } else {
  10920. return false;
  10921. }
  10922. if(i < pktSize)
  10923. return false;
  10924. inStream.currentOffset = 0;
  10925. socketStream.flushInputStream(inStream.buffer, pktSize);
  10926. anInt1009 = 0;
  10927. anInt843 = anInt842;
  10928. anInt842 = anInt841;
  10929. anInt841 = pktType;
  10930. switch(pktType) {
  10931. case 81:
  10932. updatePlayers(pktSize, inStream);
  10933. aBoolean1080 = false;
  10934. pktType = -1;
  10935. return true;
  10936.  
  10937. case 176:
  10938. daysSinceRecovChange = inStream.method427();
  10939. unreadMessages = inStream.method435();
  10940. membersInt = inStream.readUnsignedByte();
  10941. anInt1193 = inStream.method440();
  10942. daysSinceLastLogin = inStream.readUnsignedWord();
  10943. if(anInt1193 != 0 && openInterfaceID == -1) {
  10944. signlink.dnslookup(TextClass.method586(anInt1193));
  10945. clearTopInterfaces();
  10946. char c = '\u028A';
  10947. if(daysSinceRecovChange != 201 || membersInt == 1)
  10948. c = '\u028F';
  10949. reportAbuseInput = "";
  10950. canMute = false;
  10951. for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  10952. if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  10953. continue;
  10954. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  10955.  
  10956. }
  10957. }
  10958. pktType = -1;
  10959. return true;
  10960.  
  10961. case 64:
  10962. anInt1268 = inStream.method427();
  10963. anInt1269 = inStream.method428();
  10964. for(int j = anInt1268; j < anInt1268 + 8; j++) {
  10965. for(int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  10966. if(groundArray[plane][j][l9] != null) {
  10967. groundArray[plane][j][l9] = null;
  10968. spawnGroundItem(j, l9);
  10969. }
  10970. }
  10971. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10972. if(class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  10973. class30_sub1.anInt1294 = 0;
  10974. pktType = -1;
  10975. return true;
  10976.  
  10977. case 185:
  10978. int k = inStream.method436();
  10979. RSInterface.interfaceCache[k].anInt233 = 3;
  10980. if(myPlayer.desc == null)
  10981. RSInterface.interfaceCache[k].mediaID = (myPlayer.anIntArray1700[0] << 25) + (myPlayer.anIntArray1700[4] << 20) + (myPlayer.equipment[0] << 15) + (myPlayer.equipment[8] << 10) + (myPlayer.equipment[11] << 5) + myPlayer.equipment[1];
  10982. else
  10983. RSInterface.interfaceCache[k].mediaID = (int)(0x12345678L + myPlayer.desc.type);
  10984. pktType = -1;
  10985. return true;
  10986.  
  10987. /* Clan chat packet */
  10988. case 217:
  10989. try {
  10990. name = inStream.readString();
  10991. message = inStream.readString();
  10992. clanname = inStream.readString();
  10993. rights = inStream.readUnsignedWord();
  10994. //message = TextInput.processText(message);
  10995. //message = Censor.doCensor(message);
  10996. System.out.println(clanname);
  10997. pushMessage(message, 16, name);
  10998. } catch(Exception e) {
  10999. e.printStackTrace();
  11000. }
  11001. pktType = -1;
  11002. return true;
  11003.  
  11004. case 107:
  11005. aBoolean1160 = false;
  11006. for(int l = 0; l < 5; l++)
  11007. aBooleanArray876[l] = false;
  11008. pktType = -1;
  11009. return true;
  11010.  
  11011. case 72:
  11012. int i1 = inStream.method434();
  11013. RSInterface class9 = RSInterface.interfaceCache[i1];
  11014. for(int k15 = 0; k15 < class9.inv.length; k15++) {
  11015. class9.inv[k15] = -1;
  11016. class9.inv[k15] = 0;
  11017. }
  11018. pktType = -1;
  11019. return true;
  11020.  
  11021. case 214:
  11022. ignoreCount = pktSize / 8;
  11023. for(int j1 = 0; j1 < ignoreCount; j1++)
  11024. ignoreListAsLongs[j1] = inStream.readQWord();
  11025. pktType = -1;
  11026. return true;
  11027.  
  11028. case 166:
  11029. aBoolean1160 = true;
  11030. anInt1098 = inStream.readUnsignedByte();
  11031. anInt1099 = inStream.readUnsignedByte();
  11032. anInt1100 = inStream.readUnsignedWord();
  11033. anInt1101 = inStream.readUnsignedByte();
  11034. anInt1102 = inStream.readUnsignedByte();
  11035. if(anInt1102 >= 100) {
  11036. xCameraPos = anInt1098 * 128 + 64;
  11037. yCameraPos = anInt1099 * 128 + 64;
  11038. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  11039. }
  11040. pktType = -1;
  11041. return true;
  11042.  
  11043. case 134:
  11044. needDrawTabArea = true;
  11045. int k1 = inStream.readUnsignedByte();
  11046. int i10 = inStream.method439();
  11047. int l15 = inStream.readUnsignedByte();
  11048. currentExp[k1] = i10;
  11049. currentStats[k1] = l15;
  11050. maxStats[k1] = 1;
  11051. for(int k20 = 0; k20 < 98; k20++)
  11052. if(i10 >= anIntArray1019[k20])
  11053. maxStats[k1] = k20 + 2;
  11054. pktType = -1;
  11055. return true;
  11056.  
  11057. case 71:
  11058. int l1 = inStream.readUnsignedWord();
  11059. int j10 = inStream.method426();
  11060. if(l1 == 65535)
  11061. l1 = -1;
  11062. tabInterfaceIDs[j10] = l1;
  11063. needDrawTabArea = true;
  11064. tabAreaAltered = true;
  11065. pktType = -1;
  11066. return true;
  11067.  
  11068. case 74:
  11069. int i2 = inStream.method434();
  11070. if(i2 == 65535)
  11071. i2 = -1;
  11072. if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  11073. nextSong = i2;
  11074. songChanging = true;
  11075. onDemandFetcher.method558(2, nextSong);
  11076. }
  11077. currentSong = i2;
  11078. pktType = -1;
  11079. return true;
  11080.  
  11081. case 121:
  11082. int j2 = inStream.method436();
  11083. int k10 = inStream.method435();
  11084. if(musicEnabled && !lowMem) {
  11085. nextSong = j2;
  11086. songChanging = false;
  11087. onDemandFetcher.method558(2, nextSong);
  11088. prevSong = k10;
  11089. }
  11090. pktType = -1;
  11091. return true;
  11092.  
  11093. case 109:
  11094. resetLogout();
  11095. pktType = -1;
  11096. return false;
  11097.  
  11098. case 70:
  11099. int k2 = inStream.readSignedWord();
  11100. int l10 = inStream.method437();
  11101. int i16 = inStream.method434();
  11102. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  11103. class9_5.anInt263 = k2;
  11104. class9_5.anInt265 = l10;
  11105. pktType = -1;
  11106. return true;
  11107.  
  11108. case 73:
  11109. case 241:
  11110. int l2 = anInt1069;
  11111. int i11 = anInt1070;
  11112. if(pktType == 73) {
  11113. l2 = inStream.method435();
  11114. i11 = inStream.readUnsignedWord();
  11115. aBoolean1159 = false;
  11116. }
  11117. if(pktType == 241) {
  11118. i11 = inStream.method435();
  11119. inStream.initBitAccess();
  11120. for(int j16 = 0; j16 < 4; j16++) {
  11121. for(int l20 = 0; l20 < 13; l20++) {
  11122. for(int j23 = 0; j23 < 13; j23++) {
  11123. int i26 = inStream.readBits(1);
  11124. if(i26 == 1)
  11125. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  11126. else
  11127. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  11128. }
  11129. }
  11130. }
  11131. inStream.finishBitAccess();
  11132. l2 = inStream.readUnsignedWord();
  11133. aBoolean1159 = true;
  11134. }
  11135. if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  11136. pktType = -1;
  11137. return true;
  11138. }
  11139. anInt1069 = l2;
  11140. anInt1070 = i11;
  11141. baseX = (anInt1069 - 6) * 8;
  11142. baseY = (anInt1070 - 6) * 8;
  11143. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  11144. if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  11145. aBoolean1141 = true;
  11146. loadingStage = 1;
  11147. aLong824 = System.currentTimeMillis();
  11148. aRSImageProducer_1165.initDrawingArea();
  11149. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  11150. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  11151. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  11152. if(pktType == 73) {
  11153. int k16 = 0;
  11154. for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  11155. for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  11156. k16++;
  11157. }
  11158. aByteArrayArray1183 = new byte[k16][];
  11159. aByteArrayArray1247 = new byte[k16][];
  11160. anIntArray1234 = new int[k16];
  11161. anIntArray1235 = new int[k16];
  11162. anIntArray1236 = new int[k16];
  11163. k16 = 0;
  11164. for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  11165. for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  11166. anIntArray1234[k16] = (l23 << 8) + j26;
  11167. if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  11168. anIntArray1235[k16] = -1;
  11169. anIntArray1236[k16] = -1;
  11170. k16++;
  11171. } else {
  11172. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  11173. if(k28 != -1)
  11174. onDemandFetcher.method558(3, k28);
  11175. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  11176. if(j30 != -1)
  11177. onDemandFetcher.method558(3, j30);
  11178. k16++;
  11179. }
  11180. }
  11181. }
  11182. }
  11183. if(pktType == 241) {
  11184. int l16 = 0;
  11185. int ai[] = new int[676];
  11186. for(int i24 = 0; i24 < 4; i24++) {
  11187. for(int k26 = 0; k26 < 13; k26++) {
  11188. for(int l28 = 0; l28 < 13; l28++) {
  11189. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  11190. if(k30 != -1) {
  11191. int k31 = k30 >> 14 & 0x3ff;
  11192. int i32 = k30 >> 3 & 0x7ff;
  11193. int k32 = (k31 / 8 << 8) + i32 / 8;
  11194. for(int j33 = 0; j33 < l16; j33++) {
  11195. if(ai[j33] != k32)
  11196. continue;
  11197. k32 = -1;
  11198.  
  11199. }
  11200. if(k32 != -1)
  11201. ai[l16++] = k32;
  11202. }
  11203. }
  11204. }
  11205. }
  11206. aByteArrayArray1183 = new byte[l16][];
  11207. aByteArrayArray1247 = new byte[l16][];
  11208. anIntArray1234 = new int[l16];
  11209. anIntArray1235 = new int[l16];
  11210. anIntArray1236 = new int[l16];
  11211. for(int l26 = 0; l26 < l16; l26++) {
  11212. int i29 = anIntArray1234[l26] = ai[l26];
  11213. int l30 = i29 >> 8 & 0xff;
  11214. int l31 = i29 & 0xff;
  11215. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  11216. if(j32 != -1)
  11217. onDemandFetcher.method558(3, j32);
  11218. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  11219. if(i33 != -1)
  11220. onDemandFetcher.method558(3, i33);
  11221. }
  11222. }
  11223. int i17 = baseX - anInt1036;
  11224. int j21 = baseY - anInt1037;
  11225. anInt1036 = baseX;
  11226. anInt1037 = baseY;
  11227. for(int j24 = 0; j24 < 16384; j24++) {
  11228. NPC npc = npcArray[j24];
  11229. if(npc != null) {
  11230. for(int j29 = 0; j29 < 10; j29++) {
  11231. npc.smallX[j29] -= i17;
  11232. npc.smallY[j29] -= j21;
  11233. }
  11234. npc.x -= i17 * 128;
  11235. npc.y -= j21 * 128;
  11236. }
  11237. }
  11238. for(int i27 = 0; i27 < maxPlayers; i27++) {
  11239. Player player = playerArray[i27];
  11240. if(player != null) {
  11241. for(int i31 = 0; i31 < 10; i31++) {
  11242. player.smallX[i31] -= i17;
  11243. player.smallY[i31] -= j21;
  11244. }
  11245. player.x -= i17 * 128;
  11246. player.y -= j21 * 128;
  11247. }
  11248. }
  11249. aBoolean1080 = true;
  11250. byte byte1 = 0;
  11251. byte byte2 = 104;
  11252. byte byte3 = 1;
  11253. if(i17 < 0) {
  11254. byte1 = 103;
  11255. byte2 = -1;
  11256. byte3 = -1;
  11257. }
  11258. byte byte4 = 0;
  11259. byte byte5 = 104;
  11260. byte byte6 = 1;
  11261. if(j21 < 0) {
  11262. byte4 = 103;
  11263. byte5 = -1;
  11264. byte6 = -1;
  11265. }
  11266. for(int k33 = byte1; k33 != byte2; k33 += byte3) {
  11267. for(int l33 = byte4; l33 != byte5; l33 += byte6) {
  11268. int i34 = k33 + i17;
  11269. int j34 = l33 + j21;
  11270. for(int k34 = 0; k34 < 4; k34++)
  11271. if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  11272. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  11273. else
  11274. groundArray[k34][k33][l33] = null;
  11275. }
  11276. }
  11277. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext()) {
  11278. class30_sub1_1.anInt1297 -= i17;
  11279. class30_sub1_1.anInt1298 -= j21;
  11280. if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  11281. class30_sub1_1.unlink();
  11282. }
  11283. if(destX != 0) {
  11284. destX -= i17;
  11285. destY -= j21;
  11286. }
  11287. aBoolean1160 = false;
  11288. pktType = -1;
  11289. return true;
  11290.  
  11291. case 208:
  11292. int i3 = inStream.method437();
  11293. if(i3 >= 0)
  11294. method60(i3);
  11295. anInt1018 = i3;
  11296. pktType = -1;
  11297. return true;
  11298.  
  11299. case 99:
  11300. anInt1021 = inStream.readUnsignedByte();
  11301. pktType = -1;
  11302. return true;
  11303.  
  11304. case 75:
  11305. int j3 = inStream.method436();
  11306. int j11 = inStream.method436();
  11307. RSInterface.interfaceCache[j11].anInt233 = 2;
  11308. RSInterface.interfaceCache[j11].mediaID = j3;
  11309. pktType = -1;
  11310. return true;
  11311.  
  11312. case 114:
  11313. anInt1104 = inStream.method434() * 30;
  11314. pktType = -1;
  11315. return true;
  11316.  
  11317. case 60:
  11318. anInt1269 = inStream.readUnsignedByte();
  11319. anInt1268 = inStream.method427();
  11320. while(inStream.currentOffset < pktSize) {
  11321. int k3 = inStream.readUnsignedByte();
  11322. method137(inStream, k3);
  11323. }
  11324. pktType = -1;
  11325. return true;
  11326.  
  11327. case 35:
  11328. int l3 = inStream.readUnsignedByte();
  11329. int k11 = inStream.readUnsignedByte();
  11330. int j17 = inStream.readUnsignedByte();
  11331. int k21 = inStream.readUnsignedByte();
  11332. aBooleanArray876[l3] = true;
  11333. anIntArray873[l3] = k11;
  11334. anIntArray1203[l3] = j17;
  11335. anIntArray928[l3] = k21;
  11336. anIntArray1030[l3] = 0;
  11337. pktType = -1;
  11338. return true;
  11339.  
  11340. case 174:
  11341. int i4 = inStream.readUnsignedWord();
  11342. int l11 = inStream.readUnsignedByte();
  11343. int k17 = inStream.readUnsignedWord();
  11344. if(aBoolean848 && !lowMem && anInt1062 < 50) {
  11345. anIntArray1207[anInt1062] = i4;
  11346. anIntArray1241[anInt1062] = l11;
  11347. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  11348. anInt1062++;
  11349. }
  11350. pktType = -1;
  11351. return true;
  11352.  
  11353. case 104:
  11354. int j4 = inStream.method427();
  11355. int i12 = inStream.method426();
  11356. String s6 = inStream.readString();
  11357. if(j4 >= 1 && j4 <= 5) {
  11358. if(s6.equalsIgnoreCase("null"))
  11359. s6 = null;
  11360. atPlayerActions[j4 - 1] = s6;
  11361. atPlayerArray[j4 - 1] = i12 == 0;
  11362. }
  11363. pktType = -1;
  11364. return true;
  11365.  
  11366. case 78:
  11367. destX = 0;
  11368. pktType = -1;
  11369. return true;
  11370.  
  11371. case 253:
  11372. String s = inStream.readString();
  11373. if(s.endsWith(":tradereq:")) {
  11374. String s3 = s.substring(0, s.indexOf(":"));
  11375. long l17 = TextClass.longForName(s3);
  11376. boolean flag2 = false;
  11377. for(int j27 = 0; j27 < ignoreCount; j27++) {
  11378. if(ignoreListAsLongs[j27] != l17)
  11379. continue;
  11380. flag2 = true;
  11381.  
  11382. }
  11383. if(!flag2 && anInt1251 == 0)
  11384. pushMessage("wishes to trade with you.", 4, s3);
  11385. } else if (s.endsWith(":clan:")) {
  11386. String s4 = s.substring(0, s.indexOf(":"));
  11387. long l18 = TextClass.longForName(s4);
  11388. pushMessage("Clan: ", 8, s4);
  11389. } else if(s.endsWith("#url#")) {
  11390. String link = s.substring(0, s.indexOf("#"));
  11391. pushMessage("Join us at: ", 9, link);
  11392. } else if(s.endsWith(":duelreq:")) {
  11393. String s4 = s.substring(0, s.indexOf(":"));
  11394. long l18 = TextClass.longForName(s4);
  11395. boolean flag3 = false;
  11396. for(int k27 = 0; k27 < ignoreCount; k27++) {
  11397. if(ignoreListAsLongs[k27] != l18)
  11398. continue;
  11399. flag3 = true;
  11400.  
  11401. }
  11402. if(!flag3 && anInt1251 == 0)
  11403. pushMessage("wishes to duel with you.", 8, s4);
  11404. } else if(s.endsWith(":chalreq:")) {
  11405. String s5 = s.substring(0, s.indexOf(":"));
  11406. long l19 = TextClass.longForName(s5);
  11407. boolean flag4 = false;
  11408. for(int l27 = 0; l27 < ignoreCount; l27++) {
  11409. if(ignoreListAsLongs[l27] != l19)
  11410. continue;
  11411. flag4 = true;
  11412.  
  11413. }
  11414. if(!flag4 && anInt1251 == 0) {
  11415. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  11416. pushMessage(s8, 8, s5);
  11417. }
  11418. } else {
  11419. pushMessage(s, 0, "");
  11420. }
  11421. pktType = -1;
  11422. return true;
  11423.  
  11424. case 1:
  11425. for(int k4 = 0; k4 < playerArray.length; k4++)
  11426. if(playerArray[k4] != null)
  11427. playerArray[k4].anim = -1;
  11428. for(int j12 = 0; j12 < npcArray.length; j12++)
  11429. if(npcArray[j12] != null)
  11430. npcArray[j12].anim = -1;
  11431. pktType = -1;
  11432. return true;
  11433.  
  11434. case 50:
  11435. long l4 = inStream.readQWord();
  11436. int i18 = inStream.readUnsignedByte();
  11437. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  11438. for(int k24 = 0; k24 < friendsCount; k24++) {
  11439. if(l4 != friendsListAsLongs[k24])
  11440. continue;
  11441. if(friendsNodeIDs[k24] != i18) {
  11442. friendsNodeIDs[k24] = i18;
  11443. needDrawTabArea = true;
  11444. if(i18 >= 2) {
  11445. pushMessage(s7 + " has logged in.", 5, "");
  11446. }
  11447. if(i18 <= 1) {
  11448. pushMessage(s7 + " has logged out.", 5, "");
  11449. }
  11450. }
  11451. s7 = null;
  11452.  
  11453. }
  11454. if(s7 != null && friendsCount < 200) {
  11455. friendsListAsLongs[friendsCount] = l4;
  11456. friendsList[friendsCount] = s7;
  11457. friendsNodeIDs[friendsCount] = i18;
  11458. friendsCount++;
  11459. needDrawTabArea = true;
  11460. }
  11461. for(boolean flag6 = false; !flag6;) {
  11462. flag6 = true;
  11463. for(int k29 = 0; k29 < friendsCount - 1; k29++)
  11464. if(friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  11465. int j31 = friendsNodeIDs[k29];
  11466. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  11467. friendsNodeIDs[k29 + 1] = j31;
  11468. String s10 = friendsList[k29];
  11469. friendsList[k29] = friendsList[k29 + 1];
  11470. friendsList[k29 + 1] = s10;
  11471. long l32 = friendsListAsLongs[k29];
  11472. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  11473. friendsListAsLongs[k29 + 1] = l32;
  11474. needDrawTabArea = true;
  11475. flag6 = false;
  11476. }
  11477. }
  11478. pktType = -1;
  11479. return true;
  11480.  
  11481. case 110:
  11482. if(tabID == 12)
  11483. needDrawTabArea = true;
  11484. energy = inStream.readUnsignedByte();
  11485. pktType = -1;
  11486. return true;
  11487.  
  11488. case 254:
  11489. anInt855 = inStream.readUnsignedByte();
  11490. if(anInt855 == 1)
  11491. anInt1222 = inStream.readUnsignedWord();
  11492. if(anInt855 >= 2 && anInt855 <= 6) {
  11493. if(anInt855 == 2) {
  11494. anInt937 = 64;
  11495. anInt938 = 64;
  11496. }
  11497. if(anInt855 == 3) {
  11498. anInt937 = 0;
  11499. anInt938 = 64;
  11500. }
  11501. if(anInt855 == 4) {
  11502. anInt937 = 128;
  11503. anInt938 = 64;
  11504. }
  11505. if(anInt855 == 5) {
  11506. anInt937 = 64;
  11507. anInt938 = 0;
  11508. }
  11509. if(anInt855 == 6) {
  11510. anInt937 = 64;
  11511. anInt938 = 128;
  11512. }
  11513. anInt855 = 2;
  11514. anInt934 = inStream.readUnsignedWord();
  11515. anInt935 = inStream.readUnsignedWord();
  11516. anInt936 = inStream.readUnsignedByte();
  11517. }
  11518. if(anInt855 == 10)
  11519. anInt933 = inStream.readUnsignedWord();
  11520. pktType = -1;
  11521. return true;
  11522.  
  11523. case 248:
  11524. int i5 = inStream.method435();
  11525. int k12 = inStream.readUnsignedWord();
  11526. if(backDialogID != -1) {
  11527. backDialogID = -1;
  11528. inputTaken = true;
  11529. }
  11530. if(inputDialogState != 0) {
  11531. inputDialogState = 0;
  11532. inputTaken = true;
  11533. }
  11534. openInterfaceID = i5;
  11535. invOverlayInterfaceID = k12;
  11536. needDrawTabArea = true;
  11537. tabAreaAltered = true;
  11538. aBoolean1149 = false;
  11539. pktType = -1;
  11540. return true;
  11541.  
  11542. case 79:
  11543. int j5 = inStream.method434();
  11544. int l12 = inStream.method435();
  11545. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  11546. if(class9_3 != null && class9_3.type == 0) {
  11547. if(l12 < 0)
  11548. l12 = 0;
  11549. if(l12 > class9_3.scrollMax - class9_3.height)
  11550. l12 = class9_3.scrollMax - class9_3.height;
  11551. class9_3.scrollPosition = l12;
  11552. }
  11553. pktType = -1;
  11554. return true;
  11555.  
  11556. case 68:
  11557. for(int k5 = 0; k5 < variousSettings.length; k5++)
  11558. if(variousSettings[k5] != anIntArray1045[k5]) {
  11559. variousSettings[k5] = anIntArray1045[k5];
  11560. method33(k5);
  11561. needDrawTabArea = true;
  11562. }
  11563. pktType = -1;
  11564. return true;
  11565.  
  11566. case 196:
  11567. long l5 = inStream.readQWord();
  11568. int j18 = inStream.readDWord();
  11569. int l21 = inStream.readUnsignedByte();
  11570. boolean flag5 = false;
  11571. for(int i28 = 0; i28 < 100; i28++) {
  11572. if(anIntArray1240[i28] != j18)
  11573. continue;
  11574. flag5 = true;
  11575.  
  11576. }
  11577. if(l21 <= 1) {
  11578. for(int l29 = 0; l29 < ignoreCount; l29++) {
  11579. if(ignoreListAsLongs[l29] != l5)
  11580. continue;
  11581. flag5 = true;
  11582.  
  11583. }
  11584. }
  11585. if(!flag5 && anInt1251 == 0)
  11586. try {
  11587. anIntArray1240[anInt1169] = j18;
  11588. anInt1169 = (anInt1169 + 1) % 100;
  11589. String s9 = TextInput.method525(pktSize - 13, inStream);
  11590. //if(l21 != 3)
  11591. //s9 = Censor.doCensor(s9);
  11592. if(l21 == 2 || l21 == 3)
  11593. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11594. else
  11595. if(l21 == 1)
  11596. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11597. else
  11598. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  11599. } catch(Exception exception1) {
  11600. signlink.reporterror("cde1");
  11601. }
  11602. pktType = -1;
  11603. return true;
  11604.  
  11605. case 85:
  11606. anInt1269 = inStream.method427();
  11607. anInt1268 = inStream.method427();
  11608. pktType = -1;
  11609. return true;
  11610.  
  11611. case 24:
  11612. anInt1054 = inStream.method428();
  11613. if(anInt1054 == tabID) {
  11614. if(anInt1054 == 3)
  11615. tabID = 1;
  11616. else
  11617. tabID = 3;
  11618. needDrawTabArea = true;
  11619. }
  11620. pktType = -1;
  11621. return true;
  11622.  
  11623. case 246:
  11624. int i6 = inStream.method434();
  11625. int i13 = inStream.readUnsignedWord();
  11626. int k18 = inStream.readUnsignedWord();
  11627. if(k18 == 65535) {
  11628. RSInterface.interfaceCache[i6].anInt233 = 0;
  11629. pktType = -1;
  11630. return true;
  11631. } else {
  11632. ItemDef itemDef = ItemDef.forID(k18);
  11633. RSInterface.interfaceCache[i6].anInt233 = 4;
  11634. RSInterface.interfaceCache[i6].mediaID = k18;
  11635. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotation1;
  11636. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotation2;
  11637. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  11638. pktType = -1;
  11639. return true;
  11640. }
  11641.  
  11642. case 171:
  11643. boolean flag1 = inStream.readUnsignedByte() == 1;
  11644. int j13 = inStream.readUnsignedWord();
  11645. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  11646. pktType = -1;
  11647. return true;
  11648.  
  11649. case 142:
  11650. int j6 = inStream.method434();
  11651. method60(j6);
  11652. if(backDialogID != -1) {
  11653. backDialogID = -1;
  11654. inputTaken = true;
  11655. }
  11656. if(inputDialogState != 0) {
  11657. inputDialogState = 0;
  11658. inputTaken = true;
  11659. }
  11660. invOverlayInterfaceID = j6;
  11661. needDrawTabArea = true;
  11662. tabAreaAltered = true;
  11663. openInterfaceID = -1;
  11664. aBoolean1149 = false;
  11665. pktType = -1;
  11666. return true;
  11667.  
  11668. case 126:
  11669. String text = inStream.readString();
  11670. int frame = inStream.method435();
  11671. if (text.startsWith("www.")) {
  11672. launchURL(text);
  11673. pktType = -1;
  11674. return true;
  11675. }
  11676. updateStrings(text, frame);
  11677. sendFrame126(text, frame);
  11678. if (frame >= 18144 && frame <= 18244) {
  11679. clanList[frame - 18144] = text;
  11680. }
  11681. pktType = -1;
  11682. return true;
  11683.  
  11684. case 206:
  11685. publicChatMode = inStream.readUnsignedByte();
  11686. privateChatMode = inStream.readUnsignedByte();
  11687. tradeMode = inStream.readUnsignedByte();
  11688. aBoolean1233 = true;
  11689. inputTaken = true;
  11690. pktType = -1;
  11691. return true;
  11692.  
  11693. case 240:
  11694. if(tabID == 12)
  11695. needDrawTabArea = true;
  11696. weight = inStream.readSignedWord();
  11697. pktType = -1;
  11698. return true;
  11699.  
  11700. case 8:
  11701. int k6 = inStream.method436();
  11702. int l13 = inStream.readUnsignedWord();
  11703. RSInterface.interfaceCache[k6].anInt233 = 1;
  11704. RSInterface.interfaceCache[k6].mediaID = l13;
  11705. pktType = -1;
  11706. return true;
  11707.  
  11708. case 122:
  11709. int l6 = inStream.method436();
  11710. int i14 = inStream.method436();
  11711. int i19 = i14 >> 10 & 0x1f;
  11712. int i22 = i14 >> 5 & 0x1f;
  11713. int l24 = i14 & 0x1f;
  11714. RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  11715. pktType = -1;
  11716. return true;
  11717.  
  11718. case 53:
  11719. needDrawTabArea = true;
  11720. int i7 = inStream.readUnsignedWord();
  11721. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  11722. int j19 = inStream.readUnsignedWord();
  11723. for(int j22 = 0; j22 < j19; j22++) {
  11724. int i25 = inStream.readUnsignedByte();
  11725. if(i25 == 255)
  11726. i25 = inStream.method440();
  11727. class9_1.inv[j22] = inStream.method436();
  11728. class9_1.invStackSizes[j22] = i25;
  11729. }
  11730. for(int j25 = j19; j25 < class9_1.inv.length; j25++) {
  11731. class9_1.inv[j25] = 0;
  11732. class9_1.invStackSizes[j25] = 0;
  11733. }
  11734. pktType = -1;
  11735. return true;
  11736.  
  11737. case 230:
  11738. int j7 = inStream.method435();
  11739. int j14 = inStream.readUnsignedWord();
  11740. int k19 = inStream.readUnsignedWord();
  11741. int k22 = inStream.method436();
  11742. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  11743. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  11744. RSInterface.interfaceCache[j14].modelZoom = j7;
  11745. pktType = -1;
  11746. return true;
  11747.  
  11748. case 221:
  11749. anInt900 = inStream.readUnsignedByte();
  11750. needDrawTabArea = true;
  11751. pktType = -1;
  11752. return true;
  11753.  
  11754. case 177:
  11755. aBoolean1160 = true;
  11756. anInt995 = inStream.readUnsignedByte();
  11757. anInt996 = inStream.readUnsignedByte();
  11758. anInt997 = inStream.readUnsignedWord();
  11759. anInt998 = inStream.readUnsignedByte();
  11760. anInt999 = inStream.readUnsignedByte();
  11761. if(anInt999 >= 100) {
  11762. int k7 = anInt995 * 128 + 64;
  11763. int k14 = anInt996 * 128 + 64;
  11764. int i20 = method42(plane, k14, k7) - anInt997;
  11765. int l22 = k7 - xCameraPos;
  11766. int k25 = i20 - zCameraPos;
  11767. int j28 = k14 - yCameraPos;
  11768. int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  11769. yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  11770. xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  11771. if(yCameraCurve < 128)
  11772. yCameraCurve = 128;
  11773. if(yCameraCurve > 383)
  11774. yCameraCurve = 383;
  11775. }
  11776. pktType = -1;
  11777. return true;
  11778.  
  11779. case 249:
  11780. anInt1046 = inStream.method426();
  11781. unknownInt10 = inStream.method436();
  11782. pktType = -1;
  11783. return true;
  11784.  
  11785. case 65:
  11786. updateNPCs(inStream, pktSize);
  11787. pktType = -1;
  11788. return true;
  11789.  
  11790. case 27:
  11791. messagePromptRaised = false;
  11792. inputDialogState = 1;
  11793. amountOrNameInput = "";
  11794. inputTaken = true;
  11795. pktType = -1;
  11796. return true;
  11797.  
  11798. case 187:
  11799. messagePromptRaised = false;
  11800. inputDialogState = 2;
  11801. amountOrNameInput = "";
  11802. inputTaken = true;
  11803. pktType = -1;
  11804. return true;
  11805.  
  11806. case 97:
  11807. int l7 = inStream.readUnsignedWord();
  11808. method60(l7);
  11809. if(invOverlayInterfaceID != -1) {
  11810. invOverlayInterfaceID = -1;
  11811. needDrawTabArea = true;
  11812. tabAreaAltered = true;
  11813. }
  11814. if(backDialogID != -1) {
  11815. backDialogID = -1;
  11816. inputTaken = true;
  11817. }
  11818. if(inputDialogState != 0) {
  11819. inputDialogState = 0;
  11820. inputTaken = true;
  11821. }
  11822. openInterfaceID = l7;
  11823. aBoolean1149 = false;
  11824. pktType = -1;
  11825. return true;
  11826.  
  11827. case 218:
  11828. int i8 = inStream.method438();
  11829. dialogID = i8;
  11830. inputTaken = true;
  11831. pktType = -1;
  11832. return true;
  11833.  
  11834. case 87:
  11835. int j8 = inStream.method434();
  11836. int l14 = inStream.method439();
  11837. anIntArray1045[j8] = l14;
  11838. if(variousSettings[j8] != l14) {
  11839. variousSettings[j8] = l14;
  11840. method33(j8);
  11841. needDrawTabArea = true;
  11842. if(dialogID != -1)
  11843. inputTaken = true;
  11844. }
  11845. pktType = -1;
  11846. return true;
  11847.  
  11848. case 36:
  11849. int k8 = inStream.method434();
  11850. byte byte0 = inStream.readSignedByte();
  11851. anIntArray1045[k8] = byte0;
  11852. if(variousSettings[k8] != byte0) {
  11853. variousSettings[k8] = byte0;
  11854. method33(k8);
  11855. needDrawTabArea = true;
  11856. if(dialogID != -1)
  11857. inputTaken = true;
  11858. }
  11859. pktType = -1;
  11860. return true;
  11861.  
  11862. case 61:
  11863. anInt1055 = inStream.readUnsignedByte();
  11864. pktType = -1;
  11865. return true;
  11866.  
  11867. case 200:
  11868. int l8 = inStream.readUnsignedWord();
  11869. int i15 = inStream.readSignedWord();
  11870. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  11871. class9_4.anInt257 = i15;
  11872. if(i15 == -1) {
  11873. class9_4.anInt246 = 0;
  11874. class9_4.anInt208 = 0;
  11875. }
  11876. pktType = -1;
  11877. return true;
  11878.  
  11879. case 219:
  11880. if(invOverlayInterfaceID != -1) {
  11881. invOverlayInterfaceID = -1;
  11882. needDrawTabArea = true;
  11883. tabAreaAltered = true;
  11884. }
  11885. if(backDialogID != -1) {
  11886. backDialogID = -1;
  11887. inputTaken = true;
  11888. }
  11889. if(inputDialogState != 0) {
  11890. inputDialogState = 0;
  11891. inputTaken = true;
  11892. }
  11893. openInterfaceID = -1;
  11894. aBoolean1149 = false;
  11895. pktType = -1;
  11896. return true;
  11897.  
  11898. case 34:
  11899. needDrawTabArea = true;
  11900. int i9 = inStream.readUnsignedWord();
  11901. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  11902. while(inStream.currentOffset < pktSize) {
  11903. int j20 = inStream.method422();
  11904. int i23 = inStream.readUnsignedWord();
  11905. int l25 = inStream.readUnsignedByte();
  11906. if(l25 == 255)
  11907. l25 = inStream.readDWord();
  11908. if(j20 >= 0 && j20 < class9_2.inv.length) {
  11909. class9_2.inv[j20] = i23;
  11910. class9_2.invStackSizes[j20] = l25;
  11911. }
  11912. }
  11913. pktType = -1;
  11914. return true;
  11915.  
  11916. case 4:
  11917. case 44:
  11918. case 84:
  11919. case 101:
  11920. case 105:
  11921. case 117:
  11922. case 147:
  11923. case 151:
  11924. case 156:
  11925. case 160:
  11926. case 215:
  11927. method137(inStream, pktType);
  11928. pktType = -1;
  11929. return true;
  11930.  
  11931. case 106:
  11932. tabID = inStream.method427();
  11933. needDrawTabArea = true;
  11934. tabAreaAltered = true;
  11935. pktType = -1;
  11936. return true;
  11937.  
  11938. case 164:
  11939. int j9 = inStream.method434();
  11940. method60(j9);
  11941. if(invOverlayInterfaceID != -1) {
  11942. invOverlayInterfaceID = -1;
  11943. needDrawTabArea = true;
  11944. tabAreaAltered = true;
  11945. }
  11946. backDialogID = j9;
  11947. inputTaken = true;
  11948. openInterfaceID = -1;
  11949. aBoolean1149 = false;
  11950. pktType = -1;
  11951. return true;
  11952.  
  11953. }
  11954. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  11955. //resetLogout();
  11956. } catch(IOException _ex) {
  11957. dropClient();
  11958. } catch(Exception exception) {
  11959. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  11960. for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  11961. s2 = s2 + inStream.buffer[j15] + ",";
  11962. signlink.reporterror(s2);
  11963. //resetLogout();
  11964. }
  11965. pktType = -1;
  11966. return true;
  11967. }
  11968.  
  11969. private void method146() {
  11970. anInt1265++;
  11971. method47(true);
  11972. method26(true);
  11973. method47(false);
  11974. method26(false);
  11975. method55();
  11976. method104();
  11977. if(!aBoolean1160) {
  11978. int i = anInt1184;
  11979. if(anInt984 / 256 > i)
  11980. i = anInt984 / 256;
  11981. if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  11982. i = anIntArray1203[4] + 128;
  11983. int k = minimapInt1 + anInt896 & 0x7ff;
  11984. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  11985. }
  11986. int j;
  11987. if(!aBoolean1160)
  11988. j = method120();
  11989. else
  11990. j = method121();
  11991. int l = xCameraPos;
  11992. int i1 = zCameraPos;
  11993. int j1 = yCameraPos;
  11994. int k1 = yCameraCurve;
  11995. int l1 = xCameraCurve;
  11996. for(int i2 = 0; i2 < 5; i2++)
  11997. if(aBooleanArray876[i2]) {
  11998. int j2 = (int)((Math.random() * (double)(anIntArray873[i2] * 2 + 1) - (double)anIntArray873[i2]) + Math.sin((double)anIntArray1030[i2] * ((double)anIntArray928[i2] / 100D)) * (double)anIntArray1203[i2]);
  11999. if(i2 == 0)
  12000. xCameraPos += j2;
  12001. if(i2 == 1)
  12002. zCameraPos += j2;
  12003. if(i2 == 2)
  12004. yCameraPos += j2;
  12005. if(i2 == 3)
  12006. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  12007. if(i2 == 4) {
  12008. yCameraCurve += j2;
  12009. if(yCameraCurve < 128)
  12010. yCameraCurve = 128;
  12011. if(yCameraCurve > 383)
  12012. yCameraCurve = 383;
  12013. }
  12014. }
  12015. int k2 = Texture.anInt1481;
  12016. Model.aBoolean1684 = true;
  12017. Model.anInt1687 = 0;
  12018. Model.anInt1685 = super.mouseX - 4;
  12019. Model.anInt1686 = super.mouseY - 4;
  12020. DrawingArea.setAllPixelsToZero();
  12021. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  12022. worldController.clearObj5Cache();
  12023. updateEntities();
  12024. drawHeadIcon();
  12025. method37(k2);
  12026. draw3dScreen();
  12027. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  12028. xCameraPos = l;
  12029. zCameraPos = i1;
  12030. yCameraPos = j1;
  12031. yCameraCurve = k1;
  12032. xCameraCurve = l1;
  12033. }
  12034.  
  12035. public void clearTopInterfaces() {
  12036. stream.createFrame(130);
  12037. if (invOverlayInterfaceID != -1) {
  12038. invOverlayInterfaceID = -1;
  12039. needDrawTabArea = true;
  12040. aBoolean1149 = false;
  12041. tabAreaAltered = true;
  12042. }
  12043. if (backDialogID != -1) {
  12044. backDialogID = -1;
  12045. inputTaken = true;
  12046. aBoolean1149 = false;
  12047. }
  12048. openInterfaceID = -1;
  12049. fullscreenInterfaceID = -1;
  12050. }
  12051.  
  12052. public client() {
  12053. fullscreenInterfaceID = -1;
  12054. chatRights = new int[500];
  12055. chatTypeView = 0;
  12056. clanChatMode = 0;
  12057. cButtonHPos = -1;
  12058. cButtonHCPos = -1;
  12059. cButtonCPos = 0;
  12060. server = "127.0.0.1";
  12061. anIntArrayArray825 = new int[104][104];
  12062. friendsNodeIDs = new int[200];
  12063. groundArray = new NodeList[4][104][104];
  12064. aBoolean831 = false;
  12065. aStream_834 = new Stream(new byte[5000]);
  12066. npcArray = new NPC[16384];
  12067. npcIndices = new int[16384];
  12068. anIntArray840 = new int[1000];
  12069. aStream_847 = Stream.create();
  12070. aBoolean848 = true;
  12071. openInterfaceID = -1;
  12072. currentExp = new int[Skills.skillsCount];
  12073. aBoolean872 = false;
  12074. anIntArray873 = new int[5];
  12075. anInt874 = -1;
  12076. aBooleanArray876 = new boolean[5];
  12077. drawFlames = false;
  12078. reportAbuseInput = "";
  12079. unknownInt10 = -1;
  12080. menuOpen = false;
  12081. inputString = "";
  12082. maxPlayers = 2048;
  12083. myPlayerIndex = 2047;
  12084. playerArray = new Player[maxPlayers];
  12085. playerIndices = new int[maxPlayers];
  12086. anIntArray894 = new int[maxPlayers];
  12087. aStreamArray895s = new Stream[maxPlayers];
  12088. anInt897 = 1;
  12089. anIntArrayArray901 = new int[104][104];
  12090. anInt902 = 0x766654;
  12091. aByteArray912 = new byte[16384];
  12092. currentStats = new int[Skills.skillsCount];
  12093. ignoreListAsLongs = new long[100];
  12094. loadingError = false;
  12095. anInt927 = 0x332d25;
  12096. anIntArray928 = new int[5];
  12097. anIntArrayArray929 = new int[104][104];
  12098. chatTypes = new int[500];
  12099. chatNames = new String[500];
  12100. chatMessages = new String[500];
  12101. chatButtons = new Sprite[4];
  12102. sideIcons = new Sprite[15];
  12103. redStones = new Sprite[5];
  12104. aBoolean954 = true;
  12105. friendsListAsLongs = new long[200];
  12106. currentSong = -1;
  12107. drawingFlames = false;
  12108. spriteDrawX = -1;
  12109. spriteDrawY = -1;
  12110. anIntArray968 = new int[33];
  12111. anIntArray969 = new int[256];
  12112. decompressors = new Decompressor[5];
  12113. variousSettings = new int[2000];
  12114. aBoolean972 = false;
  12115. anInt975 = 50;
  12116. anIntArray976 = new int[anInt975];
  12117. anIntArray977 = new int[anInt975];
  12118. anIntArray978 = new int[anInt975];
  12119. anIntArray979 = new int[anInt975];
  12120. anIntArray980 = new int[anInt975];
  12121. anIntArray981 = new int[anInt975];
  12122. anIntArray982 = new int[anInt975];
  12123. aStringArray983 = new String[anInt975];
  12124. anInt985 = -1;
  12125. hitMarks = new Sprite[20];
  12126. anIntArray990 = new int[5];
  12127. aBoolean994 = false;
  12128. anInt1002 = 0x23201b;
  12129. amountOrNameInput = "";
  12130. aClass19_1013 = new NodeList();
  12131. aBoolean1017 = false;
  12132. anInt1018 = -1;
  12133. anIntArray1030 = new int[5];
  12134. aBoolean1031 = false;
  12135. mapFunctions = new Sprite[100];
  12136. dialogID = -1;
  12137. maxStats = new int[Skills.skillsCount];
  12138. anIntArray1045 = new int[2000];
  12139. aBoolean1047 = true;
  12140. anIntArray1052 = new int[151];
  12141. anInt1054 = -1;
  12142. aClass19_1056 = new NodeList();
  12143. anIntArray1057 = new int[33];
  12144. aClass9_1059 = new RSInterface();
  12145. mapScenes = new Background[100];
  12146. barFillColor = 0x4d4233;
  12147. anIntArray1065 = new int[7];
  12148. anIntArray1072 = new int[1000];
  12149. anIntArray1073 = new int[1000];
  12150. aBoolean1080 = false;
  12151. friendsList = new String[200];
  12152. inStream = Stream.create();
  12153. expectedCRCs = new int[9];
  12154. menuActionCmd2 = new int[500];
  12155. menuActionCmd3 = new int[500];
  12156. menuActionID = new int[500];
  12157. menuActionCmd1 = new int[500];
  12158. headIcons = new Sprite[20];
  12159. skullIcons = new Sprite[20];
  12160. headIconsHint = new Sprite[20];
  12161. tabAreaAltered = false;
  12162. aString1121 = "";
  12163. atPlayerActions = new String[5];
  12164. atPlayerArray = new boolean[5];
  12165. anIntArrayArrayArray1129 = new int[4][13][13];
  12166. anInt1132 = 2;
  12167. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  12168. aBoolean1141 = false;
  12169. aBoolean1149 = false;
  12170. crosses = new Sprite[8];
  12171. musicEnabled = true;
  12172. needDrawTabArea = false;
  12173. loggedIn = false;
  12174. canMute = false;
  12175. aBoolean1159 = false;
  12176. aBoolean1160 = false;
  12177. anInt1171 = 1;
  12178. myUsername = "";
  12179. myPassword = "";
  12180. genericLoadingError = false;
  12181. reportAbuseInterfaceID = -1;
  12182. aClass19_1179 = new NodeList();
  12183. anInt1184 = 128;
  12184. invOverlayInterfaceID = -1;
  12185. stream = Stream.create();
  12186. menuActionName = new String[500];
  12187. anIntArray1203 = new int[5];
  12188. anIntArray1207 = new int[50];
  12189. anInt1210 = 2;
  12190. anInt1211 = 78;
  12191. promptInput = "";
  12192. modIcons = new Background[2];
  12193. tabID = 3;
  12194. inputTaken = false;
  12195. songChanging = true;
  12196. anIntArray1229 = new int[151];
  12197. aClass11Array1230 = new Class11[4];
  12198. aBoolean1233 = false;
  12199. anIntArray1240 = new int[100];
  12200. anIntArray1241 = new int[50];
  12201. aBoolean1242 = false;
  12202. anIntArray1250 = new int[50];
  12203. rsAlreadyLoaded = false;
  12204. welcomeScreenRaised = false;
  12205. messagePromptRaised = false;
  12206. loginMessage1 = "";
  12207. loginMessage2 = "";
  12208. backDialogID = -1;
  12209. anInt1279 = 2;
  12210. bigX = new int[4000];
  12211. bigY = new int[4000];
  12212. anInt1289 = -1;
  12213. }
  12214.  
  12215. public int rights;
  12216. public String name;
  12217. public String message;
  12218. public String clanname;
  12219. private final int[] chatRights;
  12220. public int chatTypeView;
  12221. public int clanChatMode;
  12222. public int duelMode;
  12223. /* Declare custom sprites */
  12224. private Sprite chatArea;
  12225. private Sprite[] chatButtons;
  12226. private Sprite tabArea;
  12227. private Sprite mapArea;
  12228. /**/
  12229. private RSImageProducer leftFrame;
  12230. private RSImageProducer topFrame;
  12231. private RSImageProducer rightFrame;
  12232. private int ignoreCount;
  12233. private long aLong824;
  12234. private int[][] anIntArrayArray825;
  12235. private int[] friendsNodeIDs;
  12236. private NodeList[][][] groundArray;
  12237. private int[] anIntArray828;
  12238. private int[] anIntArray829;
  12239. private volatile boolean aBoolean831;
  12240. private Socket aSocket832;
  12241. private int loginScreenState;
  12242. private Stream aStream_834;
  12243. private NPC[] npcArray;
  12244. private int npcCount;
  12245. private int[] npcIndices;
  12246. private int anInt839;
  12247. private int[] anIntArray840;
  12248. private int anInt841;
  12249. private int anInt842;
  12250. private int anInt843;
  12251. private String aString844;
  12252. private int privateChatMode;
  12253. private Stream aStream_847;
  12254. private boolean aBoolean848;
  12255. private static int anInt849;
  12256. private int[] anIntArray850;
  12257. private int[] anIntArray851;
  12258. private int[] anIntArray852;
  12259. private int[] anIntArray853;
  12260. private static int anInt854;
  12261. private int anInt855;
  12262. private int openInterfaceID;
  12263. private int xCameraPos;
  12264. private int zCameraPos;
  12265. private int yCameraPos;
  12266. private int yCameraCurve;
  12267. private int xCameraCurve;
  12268. private int myPrivilege;
  12269. private final int[] currentExp;
  12270. private Sprite[] redStones;
  12271. private Sprite mapFlag;
  12272. private Sprite mapMarker;
  12273. private boolean aBoolean872;
  12274. private final int[] anIntArray873;
  12275. private int anInt874;
  12276. private final boolean[] aBooleanArray876;
  12277. private int weight;
  12278. private MouseDetection mouseDetection;
  12279. private volatile boolean drawFlames;
  12280. private String reportAbuseInput;
  12281. private int unknownInt10;
  12282. private boolean menuOpen;
  12283. private int anInt886;
  12284. private String inputString;
  12285. private final int maxPlayers;
  12286. private final int myPlayerIndex;
  12287. private Player[] playerArray;
  12288. private int playerCount;
  12289. private int[] playerIndices;
  12290. private int anInt893;
  12291. private int[] anIntArray894;
  12292. private Stream[] aStreamArray895s;
  12293. private int anInt896;
  12294. private int anInt897;
  12295. private int friendsCount;
  12296. private int anInt900;
  12297. private int[][] anIntArrayArray901;
  12298. private final int anInt902;
  12299. private byte[] aByteArray912;
  12300. private int anInt913;
  12301. private int crossX;
  12302. private int crossY;
  12303. private int crossIndex;
  12304. private int crossType;
  12305. private int plane;
  12306. private final int[] currentStats;
  12307. private static int anInt924;
  12308. private final long[] ignoreListAsLongs;
  12309. private boolean loadingError;
  12310. private final int anInt927;
  12311. private final int[] anIntArray928;
  12312. private int[][] anIntArrayArray929;
  12313. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  12314. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  12315. private int anInt933;
  12316. private int anInt934;
  12317. private int anInt935;
  12318. private int anInt936;
  12319. private int anInt937;
  12320. private int anInt938;
  12321. private static int anInt940;
  12322. private final int[] chatTypes;
  12323. private final String[] chatNames;
  12324. private final String[] chatMessages;
  12325. private int anInt945;
  12326. private WorldController worldController;
  12327. private Sprite[] sideIcons;
  12328. private int menuScreenArea;
  12329. private int menuOffsetX;
  12330. private int menuOffsetY;
  12331. private int menuWidth;
  12332. private int menuHeight;
  12333. private long aLong953;
  12334. private boolean aBoolean954;
  12335. private long[] friendsListAsLongs;
  12336. private String[] clanList = new String[100];
  12337. private int currentSong;
  12338. private static int nodeID = 10;
  12339. static int portOff;
  12340. static boolean clientData;
  12341. private static boolean isMembers = true;
  12342. private static boolean lowMem;
  12343. private volatile boolean drawingFlames;
  12344. private int spriteDrawX;
  12345. private int spriteDrawY;
  12346. private final int[] anIntArray965 = {
  12347. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  12348. };
  12349. private Background aBackground_966;
  12350. private Background aBackground_967;
  12351. private final int[] anIntArray968;
  12352. private final int[] anIntArray969;
  12353. final Decompressor[] decompressors;
  12354. public int variousSettings[];
  12355. private boolean aBoolean972;
  12356. private final int anInt975;
  12357. private final int[] anIntArray976;
  12358. private final int[] anIntArray977;
  12359. private final int[] anIntArray978;
  12360. private final int[] anIntArray979;
  12361. private final int[] anIntArray980;
  12362. private final int[] anIntArray981;
  12363. private final int[] anIntArray982;
  12364. private final String[] aStringArray983;
  12365. private int anInt984;
  12366. private int anInt985;
  12367. private static int anInt986;
  12368. private Sprite[] hitMarks;
  12369. private int anInt988;
  12370. private int anInt989;
  12371. private final int[] anIntArray990;
  12372. private static boolean aBoolean993;
  12373. private final boolean aBoolean994;
  12374. private int anInt995;
  12375. private int anInt996;
  12376. private int anInt997;
  12377. private int anInt998;
  12378. private int anInt999;
  12379. private ISAACRandomGen encryption;
  12380. private Sprite mapEdge;
  12381. private Sprite multiOverlay;
  12382. private final int anInt1002;
  12383. static final int[][] anIntArrayArray1003 = {
  12384. {
  12385. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  12386. 2983, 54193
  12387. }, {
  12388. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  12389. 56621, 4783, 1341, 16578, 35003, 25239
  12390. }, {
  12391. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  12392. 10153, 56621, 4783, 1341, 16578, 35003
  12393. }, {
  12394. 4626, 11146, 6439, 12, 4758, 10270
  12395. }, {
  12396. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  12397. }
  12398. };
  12399. private String amountOrNameInput;
  12400. private static int anInt1005;
  12401. private int daysSinceLastLogin;
  12402. private int pktSize;
  12403. private int pktType;
  12404. private int anInt1009;
  12405. private int anInt1010;
  12406. private int anInt1011;
  12407. private NodeList aClass19_1013;
  12408. private int anInt1014;
  12409. private int anInt1015;
  12410. private int anInt1016;
  12411. private boolean aBoolean1017;
  12412. private int anInt1018;
  12413. private static final int[] anIntArray1019;
  12414. private int anInt1021;
  12415. private int anInt1022;
  12416. private int loadingStage;
  12417. private Sprite scrollBar1;
  12418. private Sprite scrollBar2;
  12419. private int anInt1026;
  12420. private Background backBase1;
  12421. private Background backBase2;
  12422. private Background backHmid1;
  12423. private final int[] anIntArray1030;
  12424. private boolean aBoolean1031;
  12425. private Sprite[] mapFunctions;
  12426. private int baseX;
  12427. private int baseY;
  12428. private int anInt1036;
  12429. private int anInt1037;
  12430. private int loginFailures;
  12431. private int anInt1039;
  12432. private int anInt1040;
  12433. private int anInt1041;
  12434. private int dialogID;
  12435. private final int[] maxStats;
  12436. private final int[] anIntArray1045;
  12437. private int anInt1046;
  12438. private boolean aBoolean1047;
  12439. private int anInt1048;
  12440. private String aString1049;
  12441. private static int anInt1051;
  12442. private final int[] anIntArray1052;
  12443. private StreamLoader titleStreamLoader;
  12444. private int anInt1054;
  12445. private int anInt1055;
  12446. private NodeList aClass19_1056;
  12447. private final int[] anIntArray1057;
  12448. public final RSInterface aClass9_1059;
  12449. private Background[] mapScenes;
  12450. private static int anInt1061;
  12451. private int anInt1062;
  12452. private final int barFillColor;
  12453. private int friendsListAction;
  12454. private final int[] anIntArray1065;
  12455. private int mouseInvInterfaceIndex;
  12456. private int lastActiveInvInterface;
  12457. private OnDemandFetcher onDemandFetcher;
  12458. private int anInt1069;
  12459. private int anInt1070;
  12460. private int anInt1071;
  12461. private int[] anIntArray1072;
  12462. private int[] anIntArray1073;
  12463. private Sprite mapDotItem;
  12464. private Sprite mapDotNPC;
  12465. private Sprite mapDotPlayer;
  12466. private Sprite mapDotFriend;
  12467. private Sprite mapDotTeam;
  12468. private Sprite mapDotClan;
  12469. private int anInt1079;
  12470. private boolean aBoolean1080;
  12471. private String[] friendsList;
  12472. private Stream inStream;
  12473. private int anInt1084;
  12474. private int anInt1085;
  12475. private int activeInterfaceType;
  12476. private int anInt1087;
  12477. private int anInt1088;
  12478. public static int anInt1089;
  12479. private final int[] expectedCRCs;
  12480. private int[] menuActionCmd2;
  12481. private int[] menuActionCmd3;
  12482. private int[] menuActionID;
  12483. private int[] menuActionCmd1;
  12484. private Sprite[] headIcons;
  12485. private Sprite[] skullIcons;
  12486. private Sprite[] headIconsHint;
  12487. private static int anInt1097;
  12488. private int anInt1098;
  12489. private int anInt1099;
  12490. private int anInt1100;
  12491. private int anInt1101;
  12492. private int anInt1102;
  12493. private static boolean tabAreaAltered;
  12494. private int anInt1104;
  12495. private RSImageProducer aRSImageProducer_1107;
  12496. private RSImageProducer aRSImageProducer_1108;
  12497. private RSImageProducer aRSImageProducer_1109;
  12498. private RSImageProducer aRSImageProducer_1110;
  12499. private RSImageProducer aRSImageProducer_1111;
  12500. private RSImageProducer aRSImageProducer_1112;
  12501. private RSImageProducer aRSImageProducer_1113;
  12502. private RSImageProducer aRSImageProducer_1114;
  12503. private RSImageProducer aRSImageProducer_1115;
  12504. private static int anInt1117;
  12505. private int membersInt;
  12506. private String aString1121;
  12507. private Sprite compass;
  12508. private RSImageProducer aRSImageProducer_1123;
  12509. private RSImageProducer aRSImageProducer_1124;
  12510. private RSImageProducer aRSImageProducer_1125;
  12511. public static Player myPlayer;
  12512. private final String[] atPlayerActions;
  12513. private final boolean[] atPlayerArray;
  12514. private final int[][][] anIntArrayArrayArray1129;
  12515. private final int[] tabInterfaceIDs = {
  12516. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  12517. -1, -1, -1, -1, -1
  12518. };
  12519. private int anInt1131;
  12520. private int anInt1132;
  12521. private int menuActionRow;
  12522. private static int anInt1134;
  12523. private int spellSelected;
  12524. private int anInt1137;
  12525. private int spellUsableOn;
  12526. private String spellTooltip;
  12527. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  12528. private boolean aBoolean1141;
  12529. private static int anInt1142;
  12530. private int energy;
  12531. private boolean aBoolean1149;
  12532. private Sprite[] crosses;
  12533. private boolean musicEnabled;
  12534. private Background[] aBackgroundArray1152s;
  12535. private static boolean needDrawTabArea;
  12536. private int unreadMessages;
  12537. private static int anInt1155;
  12538. private static boolean fpsOn;
  12539. public boolean loggedIn;
  12540. private boolean canMute;
  12541. private boolean aBoolean1159;
  12542. private boolean aBoolean1160;
  12543. static int loopCycle;
  12544. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  12545. private RSImageProducer aRSImageProducer_1163;
  12546. private RSImageProducer mapEdgeIP;
  12547. private RSImageProducer aRSImageProducer_1164;
  12548. private RSImageProducer aRSImageProducer_1165;
  12549. private RSImageProducer aRSImageProducer_1166;
  12550. private int daysSinceRecovChange;
  12551. private RSSocket socketStream;
  12552. private int anInt1169;
  12553. private int minimapInt3;
  12554. private int anInt1171;
  12555. private long aLong1172;
  12556. private String myUsername;
  12557. private String myPassword;
  12558. private static int anInt1175;
  12559. private boolean genericLoadingError;
  12560. private final int[] anIntArray1177 = {
  12561. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  12562. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  12563. 2, 2, 3
  12564. };
  12565. private int reportAbuseInterfaceID;
  12566. private NodeList aClass19_1179;
  12567. private int[] anIntArray1180;
  12568. private int[] anIntArray1181;
  12569. private int[] anIntArray1182;
  12570. private byte[][] aByteArrayArray1183;
  12571. private int anInt1184;
  12572. private int minimapInt1;
  12573. private int anInt1186;
  12574. private int anInt1187;
  12575. private static int anInt1188;
  12576. private int invOverlayInterfaceID;
  12577. private int[] anIntArray1190;
  12578. private int[] anIntArray1191;
  12579. private Stream stream;
  12580. private int anInt1193;
  12581. private int splitPrivateChat;
  12582. private Background mapBack;
  12583. private String[] menuActionName;
  12584. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  12585. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  12586. private final int[] anIntArray1203;
  12587. static final int[] anIntArray1204 = {
  12588. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  12589. 58654, 5027, 1457, 16565, 34991, 25486
  12590. };
  12591. private static boolean flagged;
  12592. private final int[] anIntArray1207;
  12593. private int anInt1208;
  12594. private int minimapInt2;
  12595. private int anInt1210;
  12596. private int anInt1211;
  12597. private String promptInput;
  12598. private int anInt1213;
  12599. private int[][][] intGroundArray;
  12600. private long aLong1215;
  12601. private int loginScreenCursorPos;
  12602. private final Background[] modIcons;
  12603. private long aLong1220;
  12604. private static int tabID;
  12605. private int anInt1222;
  12606. public static boolean inputTaken;
  12607. private int inputDialogState;
  12608. private static int anInt1226;
  12609. private int nextSong;
  12610. private boolean songChanging;
  12611. private final int[] anIntArray1229;
  12612. private Class11[] aClass11Array1230;
  12613. public static int anIntArray1232[];
  12614. private boolean aBoolean1233;
  12615. private int[] anIntArray1234;
  12616. private int[] anIntArray1235;
  12617. private int[] anIntArray1236;
  12618. private int anInt1237;
  12619. private int anInt1238;
  12620. public final int anInt1239 = 100;
  12621. private final int[] anIntArray1240;
  12622. private final int[] anIntArray1241;
  12623. private boolean aBoolean1242;
  12624. private int atInventoryLoopCycle;
  12625. private int atInventoryInterface;
  12626. private int atInventoryIndex;
  12627. private int atInventoryInterfaceType;
  12628. private byte[][] aByteArrayArray1247;
  12629. private int tradeMode;
  12630. private int anInt1249;
  12631. private final int[] anIntArray1250;
  12632. private int anInt1251;
  12633. private final boolean rsAlreadyLoaded;
  12634. private int anInt1253;
  12635. private int anInt1254;
  12636. private boolean welcomeScreenRaised;
  12637. private boolean messagePromptRaised;
  12638. private int anInt1257;
  12639. private byte[][][] byteGroundArray;
  12640. private int prevSong;
  12641. private int destX;
  12642. private int destY;
  12643. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  12644. private int anInt1264;
  12645. private int anInt1265;
  12646. private String loginMessage1;
  12647. private String loginMessage2;
  12648. private int anInt1268;
  12649. private int anInt1269;
  12650. private TextDrawingArea smallText;
  12651. private TextDrawingArea aTextDrawingArea_1271;
  12652. private TextDrawingArea chatTextDrawingArea;
  12653. private int anInt1275;
  12654. private int backDialogID;
  12655. private int anInt1278;
  12656. private int anInt1279;
  12657. private int[] bigX;
  12658. private int[] bigY;
  12659. private int itemSelected;
  12660. private int anInt1283;
  12661. private int anInt1284;
  12662. private int anInt1285;
  12663. private String selectedItemName;
  12664. private int publicChatMode;
  12665. private static int anInt1288;
  12666. private int anInt1289;
  12667. public static int anInt1290;
  12668. public static String server = "";
  12669. public int drawCount;
  12670. public int fullscreenInterfaceID;
  12671. public int anInt1044;//377
  12672. public int anInt1129;//377
  12673. public int anInt1315;//377
  12674. public int anInt1500;//377
  12675. public int anInt1501;//377
  12676. public int[] fullScreenTextureArray;
  12677. public void resetAllImageProducers() {
  12678. if (super.fullGameScreen != null) {
  12679. return;
  12680. }
  12681. aRSImageProducer_1166 = null;
  12682. aRSImageProducer_1164 = null;
  12683. aRSImageProducer_1163 = null;
  12684. aRSImageProducer_1165 = null;
  12685. aRSImageProducer_1123 = null;
  12686. aRSImageProducer_1124 = null;
  12687. aRSImageProducer_1125 = null;
  12688. aRSImageProducer_1107 = null;
  12689. aRSImageProducer_1108 = null;
  12690. aRSImageProducer_1109 = null;
  12691. aRSImageProducer_1110 = null;
  12692. aRSImageProducer_1111 = null;
  12693. aRSImageProducer_1112 = null;
  12694. aRSImageProducer_1113 = null;
  12695. aRSImageProducer_1114 = null;
  12696. aRSImageProducer_1115 = null;
  12697. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  12698. welcomeScreenRaised = true;
  12699. }
  12700.  
  12701.  
  12702. public void launchURL(String url) {
  12703. String osName = System.getProperty("os.name");
  12704. try {
  12705. if (osName.startsWith("Mac OS")) {
  12706. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  12707. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
  12708. openURL.invoke(null, new Object[] {url});
  12709. } else if (osName.startsWith("Windows"))
  12710. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  12711. else { //assume Unix or Linux
  12712. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  12713. String browser = null;
  12714. for (int count = 0; count < browsers.length && browser == null; count++)
  12715. if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
  12716. browser = browsers[count];
  12717. if (browser == null) {
  12718. throw new Exception("Could not find web browser");
  12719. } else
  12720. Runtime.getRuntime().exec(new String[] {browser, url});
  12721. }
  12722. } catch (Exception e) {
  12723. pushMessage("Failed to open URL.", 0, "");
  12724. }
  12725. }
  12726.  
  12727. static {
  12728. anIntArray1019 = new int[99];
  12729. int i = 0;
  12730. for(int j = 0; j < 99; j++) {
  12731. int l = j + 1;
  12732. int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  12733. i += i1;
  12734. anIntArray1019[j] = i / 4;
  12735. }
  12736. anIntArray1232 = new int[32];
  12737. i = 2;
  12738. for(int k = 0; k < 32; k++) {
  12739. anIntArray1232[k] = i - 1;
  12740. i += i;
  12741. }
  12742. }
  12743. }
Advertisement
Add Comment
Please, Sign In to add comment