Advertisement
Guest User

client.java

a guest
Jun 27th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 373.34 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("./model/"+Index+".gz");
  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(-5, -2);
  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(0, -10);
  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(-8, -10);
  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. nodeID = 10;
  2636. portOff = 0;
  2637. setLowMem();
  2638. isMembers = true;
  2639. signlink.storeid = 32;
  2640. signlink.startpriv(InetAddress.getLocalHost());
  2641. new Jframe(args);
  2642. }
  2643. catch(Exception exception)
  2644. {
  2645. }
  2646. }
  2647.  
  2648. private void loadingStages() {
  2649. if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  2650. aRSImageProducer_1165.initDrawingArea();
  2651. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  2652. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  2653. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  2654. loadingStage = 1;
  2655. aLong824 = System.currentTimeMillis();
  2656. }
  2657. if(loadingStage == 1) {
  2658. int j = method54();
  2659. if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  2660. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  2661. aLong824 = System.currentTimeMillis();
  2662. }
  2663. }
  2664. if(loadingStage == 2 && plane != anInt985) {
  2665. anInt985 = plane;
  2666. method24(plane);
  2667. }
  2668. }
  2669.  
  2670. private int method54() {
  2671. for(int i = 0; i < aByteArrayArray1183.length; i++) {
  2672. if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  2673. return -1;
  2674. if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  2675. return -2;
  2676. }
  2677. boolean flag = true;
  2678. for(int j = 0; j < aByteArrayArray1183.length; j++) {
  2679. byte abyte0[] = aByteArrayArray1247[j];
  2680. if(abyte0 != null) {
  2681. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  2682. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  2683. if(aBoolean1159) {
  2684. k = 10;
  2685. l = 10;
  2686. }
  2687. flag &= ObjectManager.method189(k, abyte0, l);
  2688. }
  2689. }
  2690. if(!flag)
  2691. return -3;
  2692. if(aBoolean1080) {
  2693. return -4;
  2694. } else {
  2695. loadingStage = 2;
  2696. ObjectManager.anInt131 = plane;
  2697. method22();
  2698. stream.createFrame(121);
  2699. return 0;
  2700. }
  2701. }
  2702.  
  2703. private void method55()
  2704. {
  2705. 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())
  2706. if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  2707. class30_sub2_sub4_sub4.unlink();
  2708. else
  2709. if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  2710. {
  2711. if(class30_sub2_sub4_sub4.anInt1590 > 0)
  2712. {
  2713. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  2714. if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  2715. 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);
  2716. }
  2717. if(class30_sub2_sub4_sub4.anInt1590 < 0)
  2718. {
  2719. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  2720. Player player;
  2721. if(j == unknownInt10)
  2722. player = myPlayer;
  2723. else
  2724. player = playerArray[j];
  2725. if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  2726. 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);
  2727. }
  2728. class30_sub2_sub4_sub4.method456(anInt945);
  2729. 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);
  2730. }
  2731.  
  2732. }
  2733.  
  2734. public AppletContext getAppletContext()
  2735. {
  2736. if(signlink.mainapp != null)
  2737. return signlink.mainapp.getAppletContext();
  2738. else
  2739. return super.getAppletContext();
  2740. }
  2741.  
  2742. private void drawLogo() {
  2743. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  2744. Sprite sprite = new Sprite(abyte0, this);
  2745. aRSImageProducer_1110.initDrawingArea();
  2746. sprite.method346(0, 0);
  2747. aRSImageProducer_1111.initDrawingArea();
  2748. sprite.method346(-637, 0);
  2749. aRSImageProducer_1107.initDrawingArea();
  2750. sprite.method346(-128, 0);
  2751. aRSImageProducer_1108.initDrawingArea();
  2752. sprite.method346(-202, -371);
  2753. aRSImageProducer_1109.initDrawingArea();
  2754. sprite.method346(-202, -171);
  2755. aRSImageProducer_1112.initDrawingArea();
  2756. sprite.method346(0, -265);
  2757. aRSImageProducer_1113.initDrawingArea();
  2758. sprite.method346(-562, -265);
  2759. aRSImageProducer_1114.initDrawingArea();
  2760. sprite.method346(-128, -171);
  2761. aRSImageProducer_1115.initDrawingArea();
  2762. sprite.method346(-562, -171);
  2763. int ai[] = new int[sprite.myWidth];
  2764. for(int j = 0; j < sprite.myHeight; j++) {
  2765. for(int k = 0; k < sprite.myWidth; k++)
  2766. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  2767.  
  2768. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  2769. }
  2770. aRSImageProducer_1110.initDrawingArea();
  2771. sprite.method346(382, 0);
  2772. aRSImageProducer_1111.initDrawingArea();
  2773. sprite.method346(-255, 0);
  2774. aRSImageProducer_1107.initDrawingArea();
  2775. sprite.method346(254, 0);
  2776. aRSImageProducer_1108.initDrawingArea();
  2777. sprite.method346(180, -371);
  2778. aRSImageProducer_1109.initDrawingArea();
  2779. sprite.method346(180, -171);
  2780. aRSImageProducer_1112.initDrawingArea();
  2781. sprite.method346(382, -265);
  2782. aRSImageProducer_1113.initDrawingArea();
  2783. sprite.method346(-180, -265);
  2784. aRSImageProducer_1114.initDrawingArea();
  2785. sprite.method346(254, -171);
  2786. aRSImageProducer_1115.initDrawingArea();
  2787. sprite.method346(-180, -171);
  2788. sprite = new Sprite(titleStreamLoader, "logo", 0);
  2789. aRSImageProducer_1107.initDrawingArea();
  2790. //sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  2791. sprite = null;
  2792. Object obj = null;
  2793. Object obj1 = null;
  2794. System.gc();
  2795. }
  2796.  
  2797. private void processOnDemandQueue()
  2798. {
  2799. do
  2800. {
  2801. OnDemandData onDemandData;
  2802. do
  2803. {
  2804. onDemandData = onDemandFetcher.getNextNode();
  2805. if(onDemandData == null)
  2806. return;
  2807. if(onDemandData.dataType == 0)
  2808. {
  2809. Model.method460(onDemandData.buffer, onDemandData.ID);
  2810. if((onDemandFetcher.getModelIndex(onDemandData.ID) & 0x62) != 0)
  2811. {
  2812. needDrawTabArea = true;
  2813. if(backDialogID != -1)
  2814. inputTaken = true;
  2815. }
  2816. }
  2817. if(onDemandData.dataType == 1 && onDemandData.buffer != null)
  2818. Class36.method529(onDemandData.buffer);
  2819. if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  2820. saveMidi(songChanging, onDemandData.buffer);
  2821. if(onDemandData.dataType == 3 && loadingStage == 1)
  2822. {
  2823. for(int i = 0; i < aByteArrayArray1183.length; i++)
  2824. {
  2825. if(anIntArray1235[i] == onDemandData.ID)
  2826. {
  2827. aByteArrayArray1183[i] = onDemandData.buffer;
  2828. if(onDemandData.buffer == null)
  2829. anIntArray1235[i] = -1;
  2830. break;
  2831. }
  2832. if(anIntArray1236[i] != onDemandData.ID)
  2833. continue;
  2834. aByteArrayArray1247[i] = onDemandData.buffer;
  2835. if(onDemandData.buffer == null)
  2836. anIntArray1236[i] = -1;
  2837. break;
  2838. }
  2839.  
  2840. }
  2841. } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  2842. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  2843. } while(true);
  2844. }
  2845.  
  2846. private void calcFlamesPosition()
  2847. {
  2848. char c = '\u0100';
  2849. for(int j = 10; j < 117; j++)
  2850. {
  2851. int k = (int)(Math.random() * 100D);
  2852. if(k < 50)
  2853. anIntArray828[j + (c - 2 << 7)] = 255;
  2854. }
  2855. for(int l = 0; l < 100; l++)
  2856. {
  2857. int i1 = (int)(Math.random() * 124D) + 2;
  2858. int k1 = (int)(Math.random() * 128D) + 128;
  2859. int k2 = i1 + (k1 << 7);
  2860. anIntArray828[k2] = 192;
  2861. }
  2862.  
  2863. for(int j1 = 1; j1 < c - 1; j1++)
  2864. {
  2865. for(int l1 = 1; l1 < 127; l1++)
  2866. {
  2867. int l2 = l1 + (j1 << 7);
  2868. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  2869. }
  2870.  
  2871. }
  2872.  
  2873. anInt1275 += 128;
  2874. if(anInt1275 > anIntArray1190.length)
  2875. {
  2876. anInt1275 -= anIntArray1190.length;
  2877. int i2 = (int)(Math.random() * 12D);
  2878. randomizeBackground(aBackgroundArray1152s[i2]);
  2879. }
  2880. for(int j2 = 1; j2 < c - 1; j2++)
  2881. {
  2882. for(int i3 = 1; i3 < 127; i3++)
  2883. {
  2884. int k3 = i3 + (j2 << 7);
  2885. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  2886. if(i4 < 0)
  2887. i4 = 0;
  2888. anIntArray828[k3] = i4;
  2889. }
  2890.  
  2891. }
  2892.  
  2893. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  2894.  
  2895. anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
  2896. if(anInt1040 > 0)
  2897. anInt1040 -= 4;
  2898. if(anInt1041 > 0)
  2899. anInt1041 -= 4;
  2900. if(anInt1040 == 0 && anInt1041 == 0)
  2901. {
  2902. int l3 = (int)(Math.random() * 2000D);
  2903. if(l3 == 0)
  2904. anInt1040 = 1024;
  2905. if(l3 == 1)
  2906. anInt1041 = 1024;
  2907. }
  2908. }
  2909.  
  2910. private boolean saveWave(byte abyte0[], int i)
  2911. {
  2912. return abyte0 == null || signlink.wavesave(abyte0, i);
  2913. }
  2914.  
  2915. private void method60(int i)
  2916. {
  2917. RSInterface class9 = RSInterface.interfaceCache[i];
  2918. for(int j = 0; j < class9.children.length; j++)
  2919. {
  2920. if(class9.children[j] == -1)
  2921. break;
  2922. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  2923. if(class9_1.type == 1)
  2924. method60(class9_1.id);
  2925. class9_1.anInt246 = 0;
  2926. class9_1.anInt208 = 0;
  2927. }
  2928. }
  2929.  
  2930. private void drawHeadIcon()
  2931. {
  2932. if(anInt855 != 2)
  2933. return;
  2934. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  2935. if(spriteDrawX > -1 && loopCycle % 20 < 10)
  2936. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  2937. }
  2938.  
  2939. private void mainGameProcessor()
  2940. {
  2941. if(anInt1104 > 1)
  2942. anInt1104--;
  2943. if(anInt1011 > 0)
  2944. anInt1011--;
  2945. for(int j = 0; j < 5; j++)
  2946. if(!parsePacket())
  2947. break;
  2948.  
  2949. if(!loggedIn)
  2950. return;
  2951. synchronized(mouseDetection.syncObject)
  2952. {
  2953. if(flagged)
  2954. {
  2955. if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
  2956. {
  2957. stream.createFrame(45);
  2958. stream.writeWordBigEndian(0);
  2959. int j2 = stream.currentOffset;
  2960. int j3 = 0;
  2961. for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
  2962. {
  2963. if(j2 - stream.currentOffset >= 240)
  2964. break;
  2965. j3++;
  2966. int l4 = mouseDetection.coordsY[j4];
  2967. if(l4 < 0)
  2968. l4 = 0;
  2969. else
  2970. if(l4 > 502)
  2971. l4 = 502;
  2972. int k5 = mouseDetection.coordsX[j4];
  2973. if(k5 < 0)
  2974. k5 = 0;
  2975. else
  2976. if(k5 > 764)
  2977. k5 = 764;
  2978. int i6 = l4 * 765 + k5;
  2979. if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  2980. {
  2981. k5 = -1;
  2982. l4 = -1;
  2983. i6 = 0x7ffff;
  2984. }
  2985. if(k5 == anInt1237 && l4 == anInt1238)
  2986. {
  2987. if(anInt1022 < 2047)
  2988. anInt1022++;
  2989. } else
  2990. {
  2991. int j6 = k5 - anInt1237;
  2992. anInt1237 = k5;
  2993. int k6 = l4 - anInt1238;
  2994. anInt1238 = l4;
  2995. if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  2996. {
  2997. j6 += 32;
  2998. k6 += 32;
  2999. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  3000. anInt1022 = 0;
  3001. } else
  3002. if(anInt1022 < 8)
  3003. {
  3004. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  3005. anInt1022 = 0;
  3006. } else
  3007. {
  3008. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  3009. anInt1022 = 0;
  3010. }
  3011. }
  3012. }
  3013.  
  3014. stream.writeBytes(stream.currentOffset - j2);
  3015. if(j3 >= mouseDetection.coordsIndex)
  3016. {
  3017. mouseDetection.coordsIndex = 0;
  3018. } else
  3019. {
  3020. mouseDetection.coordsIndex -= j3;
  3021. for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  3022. {
  3023. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  3024. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  3025. }
  3026.  
  3027. }
  3028. }
  3029. } else
  3030. {
  3031. mouseDetection.coordsIndex = 0;
  3032. }
  3033. }
  3034. if(super.clickMode3 != 0)
  3035. {
  3036. long l = (super.aLong29 - aLong1220) / 50L;
  3037. if(l > 4095L)
  3038. l = 4095L;
  3039. aLong1220 = super.aLong29;
  3040. int k2 = super.saveClickY;
  3041. if(k2 < 0)
  3042. k2 = 0;
  3043. else
  3044. if(k2 > 502)
  3045. k2 = 502;
  3046. int k3 = super.saveClickX;
  3047. if(k3 < 0)
  3048. k3 = 0;
  3049. else
  3050. if(k3 > 764)
  3051. k3 = 764;
  3052. int k4 = k2 * 765 + k3;
  3053. int j5 = 0;
  3054. if(super.clickMode3 == 2)
  3055. j5 = 1;
  3056. int l5 = (int)l;
  3057. stream.createFrame(241);
  3058. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3059. }
  3060. if(anInt1016 > 0)
  3061. anInt1016--;
  3062. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3063. aBoolean1017 = true;
  3064. if(aBoolean1017 && anInt1016 <= 0)
  3065. {
  3066. anInt1016 = 20;
  3067. aBoolean1017 = false;
  3068. stream.createFrame(86);
  3069. stream.writeWord(anInt1184);
  3070. stream.method432(minimapInt1);
  3071. }
  3072. if(super.awtFocus && !aBoolean954)
  3073. {
  3074. aBoolean954 = true;
  3075. stream.createFrame(3);
  3076. stream.writeWordBigEndian(1);
  3077. }
  3078. if(!super.awtFocus && aBoolean954)
  3079. {
  3080. aBoolean954 = false;
  3081. stream.createFrame(3);
  3082. stream.writeWordBigEndian(0);
  3083. }
  3084. loadingStages();
  3085. method115();
  3086. method90();
  3087. anInt1009++;
  3088. if(anInt1009 > 750)
  3089. dropClient();
  3090. method114();
  3091. method95();
  3092. method38();
  3093. anInt945++;
  3094. if(crossType != 0)
  3095. {
  3096. crossIndex += 20;
  3097. if(crossIndex >= 400)
  3098. crossType = 0;
  3099. }
  3100. if(atInventoryInterfaceType != 0)
  3101. {
  3102. atInventoryLoopCycle++;
  3103. if(atInventoryLoopCycle >= 15)
  3104. {
  3105. if(atInventoryInterfaceType == 2)
  3106. needDrawTabArea = true;
  3107. if(atInventoryInterfaceType == 3)
  3108. inputTaken = true;
  3109. atInventoryInterfaceType = 0;
  3110. }
  3111. }
  3112. if(activeInterfaceType != 0)
  3113. {
  3114. anInt989++;
  3115. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  3116. aBoolean1242 = true;
  3117. if(super.clickMode2 == 0)
  3118. {
  3119. if(activeInterfaceType == 2)
  3120. needDrawTabArea = true;
  3121. if(activeInterfaceType == 3)
  3122. inputTaken = true;
  3123. activeInterfaceType = 0;
  3124. if(aBoolean1242 && anInt989 >= 5)
  3125. {
  3126. lastActiveInvInterface = -1;
  3127. processRightClick();
  3128. if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  3129. {
  3130. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3131. int j1 = 0;
  3132. if(anInt913 == 1 && class9.contentType == 206)
  3133. j1 = 1;
  3134. if(class9.inv[mouseInvInterfaceIndex] <= 0)
  3135. j1 = 0;
  3136. if(class9.aBoolean235)
  3137. {
  3138. int l2 = anInt1085;
  3139. int l3 = mouseInvInterfaceIndex;
  3140. class9.inv[l3] = class9.inv[l2];
  3141. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3142. class9.inv[l2] = -1;
  3143. class9.invStackSizes[l2] = 0;
  3144. } else
  3145. if(j1 == 1)
  3146. {
  3147. int i3 = anInt1085;
  3148. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3149. if(i3 > i4)
  3150. {
  3151. class9.swapInventoryItems(i3, i3 - 1);
  3152. i3--;
  3153. } else
  3154. if(i3 < i4)
  3155. {
  3156. class9.swapInventoryItems(i3, i3 + 1);
  3157. i3++;
  3158. }
  3159.  
  3160. } else
  3161. {
  3162. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  3163. }
  3164. stream.createFrame(214);
  3165. stream.method433(anInt1084);
  3166. stream.method424(j1);
  3167. stream.method433(anInt1085);
  3168. stream.method431(mouseInvInterfaceIndex);
  3169. }
  3170. } else
  3171. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  3172. determineMenuSize();
  3173. else
  3174. if(menuActionRow > 0)
  3175. doAction(menuActionRow - 1);
  3176. atInventoryLoopCycle = 10;
  3177. super.clickMode3 = 0;
  3178. }
  3179. }
  3180. if(WorldController.anInt470 != -1)
  3181. {
  3182. int k = WorldController.anInt470;
  3183. int k1 = WorldController.anInt471;
  3184. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  3185. WorldController.anInt470 = -1;
  3186. if(flag)
  3187. {
  3188. crossX = super.saveClickX;
  3189. crossY = super.saveClickY;
  3190. crossType = 1;
  3191. crossIndex = 0;
  3192. }
  3193. }
  3194. if(super.clickMode3 == 1 && aString844 != null)
  3195. {
  3196. aString844 = null;
  3197. inputTaken = true;
  3198. super.clickMode3 = 0;
  3199. }
  3200. processMenuClick();
  3201. processMainScreenClick();
  3202. processTabClick();
  3203. processChatModeClick();
  3204. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  3205. anInt1213++;
  3206. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3207. if (anInt1501 < 100) {
  3208. anInt1501++;
  3209. if (anInt1501 == 100) {
  3210. if (anInt1500 != 0) {
  3211. inputTaken = true;
  3212. }
  3213. if (anInt1044 != 0) {
  3214. needDrawTabArea = true;
  3215. }
  3216. }
  3217. }
  3218. } else if (anInt1501 > 0) {
  3219. anInt1501--;
  3220. }
  3221. if(loadingStage == 2)
  3222. method108();
  3223. if(loadingStage == 2 && aBoolean1160)
  3224. calcCameraPos();
  3225. for(int i1 = 0; i1 < 5; i1++)
  3226. anIntArray1030[i1]++;
  3227.  
  3228. method73();
  3229. super.idleTime++;
  3230. if(super.idleTime > 4500)
  3231. {
  3232. anInt1011 = 250;
  3233. super.idleTime -= 500;
  3234. stream.createFrame(202);
  3235. }
  3236. anInt988++;
  3237. if(anInt988 > 500)
  3238. {
  3239. anInt988 = 0;
  3240. int l1 = (int)(Math.random() * 8D);
  3241. if((l1 & 1) == 1)
  3242. anInt1278 += anInt1279;
  3243. if((l1 & 2) == 2)
  3244. anInt1131 += anInt1132;
  3245. if((l1 & 4) == 4)
  3246. anInt896 += anInt897;
  3247. }
  3248. if(anInt1278 < -50)
  3249. anInt1279 = 2;
  3250. if(anInt1278 > 50)
  3251. anInt1279 = -2;
  3252. if(anInt1131 < -55)
  3253. anInt1132 = 2;
  3254. if(anInt1131 > 55)
  3255. anInt1132 = -2;
  3256. if(anInt896 < -40)
  3257. anInt897 = 1;
  3258. if(anInt896 > 40)
  3259. anInt897 = -1;
  3260. anInt1254++;
  3261. if(anInt1254 > 500)
  3262. {
  3263. anInt1254 = 0;
  3264. int i2 = (int)(Math.random() * 8D);
  3265. if((i2 & 1) == 1)
  3266. minimapInt2 += anInt1210;
  3267. if((i2 & 2) == 2)
  3268. minimapInt3 += anInt1171;
  3269. }
  3270. if(minimapInt2 < -60)
  3271. anInt1210 = 2;
  3272. if(minimapInt2 > 60)
  3273. anInt1210 = -2;
  3274. if(minimapInt3 < -20)
  3275. anInt1171 = 1;
  3276. if(minimapInt3 > 10)
  3277. anInt1171 = -1;
  3278. anInt1010++;
  3279. if(anInt1010 > 50)
  3280. stream.createFrame(0);
  3281. try
  3282. {
  3283. if(socketStream != null && stream.currentOffset > 0)
  3284. {
  3285. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3286. stream.currentOffset = 0;
  3287. anInt1010 = 0;
  3288. }
  3289. }
  3290. catch(IOException _ex)
  3291. {
  3292. dropClient();
  3293. }
  3294. catch(Exception exception)
  3295. {
  3296. resetLogout();
  3297. }
  3298. }
  3299.  
  3300. private void method63()
  3301. {
  3302. Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  3303. for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  3304. if(class30_sub1.anInt1294 == -1)
  3305. {
  3306. class30_sub1.anInt1302 = 0;
  3307. method89(class30_sub1);
  3308. } else
  3309. {
  3310. class30_sub1.unlink();
  3311. }
  3312.  
  3313. }
  3314.  
  3315. private void resetImageProducers()
  3316. {
  3317. if(aRSImageProducer_1107 != null)
  3318. return;
  3319. super.fullGameScreen = null;
  3320. aRSImageProducer_1166 = null;
  3321. aRSImageProducer_1164 = null;
  3322. aRSImageProducer_1163 = null;
  3323. aRSImageProducer_1165 = null;
  3324. aRSImageProducer_1123 = null;
  3325. aRSImageProducer_1124 = null;
  3326. aRSImageProducer_1125 = null;
  3327. aRSImageProducer_1110 = new RSImageProducer(128, 265, getGameComponent());
  3328. DrawingArea.setAllPixelsToZero();
  3329. aRSImageProducer_1111 = new RSImageProducer(128, 265, getGameComponent());
  3330. DrawingArea.setAllPixelsToZero();
  3331. aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
  3332. DrawingArea.setAllPixelsToZero();
  3333. aRSImageProducer_1108 = new RSImageProducer(360, 132, getGameComponent());
  3334. DrawingArea.setAllPixelsToZero();
  3335. aRSImageProducer_1109 = new RSImageProducer(360, 200, getGameComponent());
  3336. DrawingArea.setAllPixelsToZero();
  3337. aRSImageProducer_1112 = new RSImageProducer(202, 238, getGameComponent());
  3338. DrawingArea.setAllPixelsToZero();
  3339. aRSImageProducer_1113 = new RSImageProducer(203, 238, getGameComponent());
  3340. DrawingArea.setAllPixelsToZero();
  3341. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  3342. DrawingArea.setAllPixelsToZero();
  3343. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  3344. DrawingArea.setAllPixelsToZero();
  3345. if(titleStreamLoader != null)
  3346. {
  3347. drawLogo();
  3348. loadTitleScreen();
  3349. }
  3350. welcomeScreenRaised = true;
  3351. }
  3352.  
  3353. void drawLoadingText(int i, String s)
  3354. {
  3355. anInt1079 = i;
  3356. aString1049 = s;
  3357. resetImageProducers();
  3358. if(titleStreamLoader == null)
  3359. {
  3360. super.drawLoadingText(i, s);
  3361. return;
  3362. }
  3363. aRSImageProducer_1109.initDrawingArea();
  3364. char c = '\u0168';
  3365. char c1 = '\310';
  3366. byte byte1 = 20;
  3367. chatTextDrawingArea.drawText(0xffffff, "RuneScape is loading - please wait...", c1 / 2 - 26 - byte1, c / 2);
  3368. int j = c1 / 2 - 18 - byte1;
  3369. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  3370. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3371. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  3372. DrawingArea.drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3373. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3374. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3375. if(welcomeScreenRaised)
  3376. {
  3377. welcomeScreenRaised = false;
  3378. if(!aBoolean831)
  3379. {
  3380. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3381. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3382. }
  3383. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3384. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3385. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3386. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3387. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3388. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3389. }
  3390. }
  3391.  
  3392. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag,
  3393. int j1)
  3394. {
  3395. int anInt992;
  3396. if(aBoolean972)
  3397. anInt992 = 32;
  3398. else
  3399. anInt992 = 0;
  3400. aBoolean972 = false;
  3401. if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  3402. {
  3403. class9.scrollPosition -= anInt1213 * 4;
  3404. if(flag)
  3405. {
  3406. needDrawTabArea = true;
  3407. }
  3408. } else
  3409. if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  3410. {
  3411. class9.scrollPosition += anInt1213 * 4;
  3412. if(flag)
  3413. {
  3414. needDrawTabArea = true;
  3415. }
  3416. } else
  3417. if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  3418. {
  3419. int l1 = ((j - 32) * j) / j1;
  3420. if(l1 < 8)
  3421. l1 = 8;
  3422. int i2 = l - i1 - 16 - l1 / 2;
  3423. int j2 = j - 32 - l1;
  3424. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3425. if(flag)
  3426. needDrawTabArea = true;
  3427. aBoolean972 = true;
  3428. }
  3429. }
  3430.  
  3431. private boolean method66(int i, int j, int k)
  3432. {
  3433. int i1 = i >> 14 & 0x7fff;
  3434. int j1 = worldController.method304(plane, k, j, i);
  3435. if(j1 == -1)
  3436. return false;
  3437. int k1 = j1 & 0x1f;
  3438. int l1 = j1 >> 6 & 3;
  3439. if(k1 == 10 || k1 == 11 || k1 == 22)
  3440. {
  3441. ObjectDef class46 = ObjectDef.forID(i1);
  3442. int i2;
  3443. int j2;
  3444. if(l1 == 0 || l1 == 2)
  3445. {
  3446. i2 = class46.anInt744;
  3447. j2 = class46.anInt761;
  3448. } else
  3449. {
  3450. i2 = class46.anInt761;
  3451. j2 = class46.anInt744;
  3452. }
  3453. int k2 = class46.anInt768;
  3454. if(l1 != 0)
  3455. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3456. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3457. } else
  3458. {
  3459. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3460. }
  3461. crossX = super.saveClickX;
  3462. crossY = super.saveClickY;
  3463. crossType = 2;
  3464. crossIndex = 0;
  3465. return true;
  3466. }
  3467.  
  3468. private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k)
  3469. {
  3470. byte abyte0[] = null;
  3471. int l = 5;
  3472. try
  3473. {
  3474. if(decompressors[0] != null)
  3475. abyte0 = decompressors[0].decompress(i);
  3476. }
  3477. catch(Exception _ex) { }
  3478. if(abyte0 != null)
  3479. {
  3480. // aCRC32_930.reset();
  3481. // aCRC32_930.update(abyte0);
  3482. // int i1 = (int)aCRC32_930.getValue();
  3483. // if(i1 != j)
  3484. }
  3485. if(abyte0 != null)
  3486. {
  3487. StreamLoader streamLoader = new StreamLoader(abyte0);
  3488. return streamLoader;
  3489. }
  3490. int j1 = 0;
  3491. while(abyte0 == null)
  3492. {
  3493. String s2 = "Unknown error";
  3494. drawLoadingText(k, "Requesting " + s);
  3495. Object obj = null;
  3496. try
  3497. {
  3498. int k1 = 0;
  3499. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3500. byte abyte1[] = new byte[6];
  3501. datainputstream.readFully(abyte1, 0, 6);
  3502. Stream stream = new Stream(abyte1);
  3503. stream.currentOffset = 3;
  3504. int i2 = stream.read3Bytes() + 6;
  3505. int j2 = 6;
  3506. abyte0 = new byte[i2];
  3507. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3508.  
  3509. while(j2 < i2)
  3510. {
  3511. int l2 = i2 - j2;
  3512. if(l2 > 1000)
  3513. l2 = 1000;
  3514. int j3 = datainputstream.read(abyte0, j2, l2);
  3515. if(j3 < 0)
  3516. {
  3517. s2 = "Length error: " + j2 + "/" + i2;
  3518. throw new IOException("EOF");
  3519. }
  3520. j2 += j3;
  3521. int k3 = (j2 * 100) / i2;
  3522. if(k3 != k1)
  3523. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3524. k1 = k3;
  3525. }
  3526. datainputstream.close();
  3527. try
  3528. {
  3529. if(decompressors[0] != null)
  3530. decompressors[0].method234(abyte0.length, abyte0, i);
  3531. }
  3532. catch(Exception _ex)
  3533. {
  3534. decompressors[0] = null;
  3535. }
  3536. /* if(abyte0 != null)
  3537. {
  3538. aCRC32_930.reset();
  3539. aCRC32_930.update(abyte0);
  3540. int i3 = (int)aCRC32_930.getValue();
  3541. if(i3 != j)
  3542. {
  3543. abyte0 = null;
  3544. j1++;
  3545. s2 = "Checksum error: " + i3;
  3546. }
  3547. }
  3548. */
  3549. }
  3550. catch(IOException ioexception)
  3551. {
  3552. if(s2.equals("Unknown error"))
  3553. s2 = "Connection error";
  3554. abyte0 = null;
  3555. }
  3556. catch(NullPointerException _ex)
  3557. {
  3558. s2 = "Null error";
  3559. abyte0 = null;
  3560. if(!signlink.reporterror)
  3561. return null;
  3562. }
  3563. catch(ArrayIndexOutOfBoundsException _ex)
  3564. {
  3565. s2 = "Bounds error";
  3566. abyte0 = null;
  3567. if(!signlink.reporterror)
  3568. return null;
  3569. }
  3570. catch(Exception _ex)
  3571. {
  3572. s2 = "Unexpected error";
  3573. abyte0 = null;
  3574. if(!signlink.reporterror)
  3575. return null;
  3576. }
  3577. if(abyte0 == null)
  3578. {
  3579. for(int l1 = l; l1 > 0; l1--)
  3580. {
  3581. if(j1 >= 3)
  3582. {
  3583. drawLoadingText(k, "Game updated - please reload page");
  3584. l1 = 10;
  3585. } else
  3586. {
  3587. drawLoadingText(k, s2 + " - Retrying in " + l1);
  3588. }
  3589. try
  3590. {
  3591. Thread.sleep(1000L);
  3592. }
  3593. catch(Exception _ex) { }
  3594. }
  3595.  
  3596. l *= 2;
  3597. if(l > 60)
  3598. l = 60;
  3599. aBoolean872 = !aBoolean872;
  3600. }
  3601.  
  3602. }
  3603.  
  3604. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  3605. return streamLoader_1;
  3606. }
  3607.  
  3608. private void dropClient()
  3609. {
  3610. if(anInt1011 > 0)
  3611. {
  3612. resetLogout();
  3613. return;
  3614. }
  3615. aRSImageProducer_1165.initDrawingArea();
  3616. aTextDrawingArea_1271.drawText(0, "Connection lost", 144, 257);
  3617. aTextDrawingArea_1271.drawText(0xffffff, "Connection lost", 143, 256);
  3618. aTextDrawingArea_1271.drawText(0, "Please wait - attempting to reestablish", 159, 257);
  3619. aTextDrawingArea_1271.drawText(0xffffff, "Please wait - attempting to reestablish", 158, 256);
  3620. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3621. anInt1021 = 0;
  3622. destX = 0;
  3623. RSSocket rsSocket = socketStream;
  3624. loggedIn = false;
  3625. loginFailures = 0;
  3626. login(myUsername, myPassword, true);
  3627. if(!loggedIn)
  3628. resetLogout();
  3629. try
  3630. {
  3631. rsSocket.close();
  3632. }
  3633. catch(Exception _ex)
  3634. {
  3635. }
  3636. }
  3637.  
  3638. private void doAction(int i)
  3639. {
  3640. if(i < 0)
  3641. return;
  3642. if(inputDialogState != 0)
  3643. {
  3644. inputDialogState = 0;
  3645. inputTaken = true;
  3646. }
  3647. int j = menuActionCmd2[i];
  3648. int k = menuActionCmd3[i];
  3649. int l = menuActionID[i];
  3650. int i1 = menuActionCmd1[i];
  3651. if(l >= 2000)
  3652. l -= 2000;
  3653. if(l == 582)
  3654. {
  3655. NPC npc = npcArray[i1];
  3656. if(npc != null)
  3657. {
  3658. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  3659. crossX = super.saveClickX;
  3660. crossY = super.saveClickY;
  3661. crossType = 2;
  3662. crossIndex = 0;
  3663. stream.createFrame(57);
  3664. stream.method432(anInt1285);
  3665. stream.method432(i1);
  3666. stream.method431(anInt1283);
  3667. stream.method432(anInt1284);
  3668. }
  3669. }
  3670. if(l == 234)
  3671. {
  3672. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3673. if(!flag1)
  3674. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3675. crossX = super.saveClickX;
  3676. crossY = super.saveClickY;
  3677. crossType = 2;
  3678. crossIndex = 0;
  3679. stream.createFrame(236);
  3680. stream.method431(k + baseY);
  3681. stream.writeWord(i1);
  3682. stream.method431(j + baseX);
  3683. }
  3684. if(l == 62 && method66(i1, k, j))
  3685. {
  3686. stream.createFrame(192);
  3687. stream.writeWord(anInt1284);
  3688. stream.method431(i1 >> 14 & 0x7fff);
  3689. stream.method433(k + baseY);
  3690. stream.method431(anInt1283);
  3691. stream.method433(j + baseX);
  3692. stream.writeWord(anInt1285);
  3693. }
  3694. if(l == 511)
  3695. {
  3696. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3697. if(!flag2)
  3698. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3699. crossX = super.saveClickX;
  3700. crossY = super.saveClickY;
  3701. crossType = 2;
  3702. crossIndex = 0;
  3703. stream.createFrame(25);
  3704. stream.method431(anInt1284);
  3705. stream.method432(anInt1285);
  3706. stream.writeWord(i1);
  3707. stream.method432(k + baseY);
  3708. stream.method433(anInt1283);
  3709. stream.writeWord(j + baseX);
  3710. }
  3711. if(l == 74)
  3712. {
  3713. stream.createFrame(122);
  3714. stream.method433(k);
  3715. stream.method432(j);
  3716. stream.method431(i1);
  3717. atInventoryLoopCycle = 0;
  3718. atInventoryInterface = k;
  3719. atInventoryIndex = j;
  3720. atInventoryInterfaceType = 2;
  3721. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3722. atInventoryInterfaceType = 1;
  3723. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3724. atInventoryInterfaceType = 3;
  3725. }
  3726. if (l == 315) {
  3727. RSInterface class9 = RSInterface.interfaceCache[k];
  3728. boolean flag8 = true;
  3729. if (class9.contentType > 0)
  3730. flag8 = promptUserForInput(class9);
  3731. if (flag8) {
  3732.  
  3733. switch(k){
  3734. case 19144:
  3735. sendFrame248(15106,3213);
  3736. method60(15106);
  3737. inputTaken = true;
  3738. break;
  3739. default:
  3740. stream.createFrame(185);
  3741. stream.writeWord(k);
  3742. break;
  3743.  
  3744. }
  3745. }
  3746. }
  3747. if(l == 561)
  3748. {
  3749. Player player = playerArray[i1];
  3750. if(player != null)
  3751. {
  3752. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  3753. crossX = super.saveClickX;
  3754. crossY = super.saveClickY;
  3755. crossType = 2;
  3756. crossIndex = 0;
  3757. anInt1188 += i1;
  3758. if(anInt1188 >= 90)
  3759. {
  3760. stream.createFrame(136);
  3761. anInt1188 = 0;
  3762. }
  3763. stream.createFrame(128);
  3764. stream.writeWord(i1);
  3765. }
  3766. }
  3767. if(l == 20)
  3768. {
  3769. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  3770. if(class30_sub2_sub4_sub1_sub1_1 != null)
  3771. {
  3772. 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]);
  3773. crossX = super.saveClickX;
  3774. crossY = super.saveClickY;
  3775. crossType = 2;
  3776. crossIndex = 0;
  3777. stream.createFrame(155);
  3778. stream.method431(i1);
  3779. }
  3780. }
  3781. if(l == 779)
  3782. {
  3783. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  3784. if(class30_sub2_sub4_sub1_sub2_1 != null)
  3785. {
  3786. 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]);
  3787. crossX = super.saveClickX;
  3788. crossY = super.saveClickY;
  3789. crossType = 2;
  3790. crossIndex = 0;
  3791. stream.createFrame(153);
  3792. stream.method431(i1);
  3793. }
  3794. }
  3795. if(l == 516)
  3796. if(!menuOpen)
  3797. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  3798. else
  3799. worldController.method312(k - 4, j - 4);
  3800. if(l == 1062)
  3801. {
  3802. anInt924 += baseX;
  3803. if(anInt924 >= 113)
  3804. {
  3805. stream.createFrame(183);
  3806. stream.writeDWordBigEndian(0xe63271);
  3807. anInt924 = 0;
  3808. }
  3809. method66(i1, k, j);
  3810. stream.createFrame(228);
  3811. stream.method432(i1 >> 14 & 0x7fff);
  3812. stream.method432(k + baseY);
  3813. stream.writeWord(j + baseX);
  3814. }
  3815. if(l == 679 && !aBoolean1149)
  3816. {
  3817. stream.createFrame(40);
  3818. stream.writeWord(k);
  3819. aBoolean1149 = true;
  3820. }
  3821. if(l == 431)
  3822. {
  3823. stream.createFrame(129);
  3824. stream.method432(j);
  3825. stream.writeWord(k);
  3826. stream.method432(i1);
  3827. atInventoryLoopCycle = 0;
  3828. atInventoryInterface = k;
  3829. atInventoryIndex = j;
  3830. atInventoryInterfaceType = 2;
  3831. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3832. atInventoryInterfaceType = 1;
  3833. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3834. atInventoryInterfaceType = 3;
  3835. }
  3836. if(l == 337 || l == 42 || l == 792 || l == 322)
  3837. {
  3838. String s = menuActionName[i];
  3839. int k1 = s.indexOf("@whi@");
  3840. if(k1 != -1)
  3841. {
  3842. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  3843. if(l == 337)
  3844. addFriend(l3);
  3845. if(l == 42)
  3846. addIgnore(l3);
  3847. if(l == 792)
  3848. delFriend(l3);
  3849. if(l == 322)
  3850. delIgnore(l3);
  3851. }
  3852. }
  3853. if(l == 53)
  3854. {
  3855. stream.createFrame(135);
  3856. stream.method431(j);
  3857. stream.method432(k);
  3858. stream.method431(i1);
  3859. atInventoryLoopCycle = 0;
  3860. atInventoryInterface = k;
  3861. atInventoryIndex = j;
  3862. atInventoryInterfaceType = 2;
  3863. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3864. atInventoryInterfaceType = 1;
  3865. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3866. atInventoryInterfaceType = 3;
  3867. }
  3868. if(l == 539)
  3869. {
  3870. stream.createFrame(16);
  3871. stream.method432(i1);
  3872. stream.method433(j);
  3873. stream.method433(k);
  3874. atInventoryLoopCycle = 0;
  3875. atInventoryInterface = k;
  3876. atInventoryIndex = j;
  3877. atInventoryInterfaceType = 2;
  3878. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3879. atInventoryInterfaceType = 1;
  3880. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3881. atInventoryInterfaceType = 3;
  3882. }
  3883. if(l == 484 || l == 6)
  3884. {
  3885. String s1 = menuActionName[i];
  3886. int l1 = s1.indexOf("@whi@");
  3887. if(l1 != -1)
  3888. {
  3889. s1 = s1.substring(l1 + 5).trim();
  3890. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  3891. boolean flag9 = false;
  3892. for(int j3 = 0; j3 < playerCount; j3++)
  3893. {
  3894. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  3895. 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))
  3896. continue;
  3897. 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]);
  3898. if(l == 484)
  3899. {
  3900. stream.createFrame(139);
  3901. stream.method431(playerIndices[j3]);
  3902. }
  3903. if(l == 6)
  3904. {
  3905. anInt1188 += i1;
  3906. if(anInt1188 >= 90)
  3907. {
  3908. stream.createFrame(136);
  3909. anInt1188 = 0;
  3910. }
  3911. stream.createFrame(128);
  3912. stream.writeWord(playerIndices[j3]);
  3913. }
  3914. flag9 = true;
  3915. break;
  3916. }
  3917.  
  3918. if(!flag9)
  3919. pushMessage("Unable to find " + s7, 0, "");
  3920. }
  3921. }
  3922. if(l == 870)
  3923. {
  3924. stream.createFrame(53);
  3925. stream.writeWord(j);
  3926. stream.method432(anInt1283);
  3927. stream.method433(i1);
  3928. stream.writeWord(anInt1284);
  3929. stream.method431(anInt1285);
  3930. stream.writeWord(k);
  3931. atInventoryLoopCycle = 0;
  3932. atInventoryInterface = k;
  3933. atInventoryIndex = j;
  3934. atInventoryInterfaceType = 2;
  3935. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3936. atInventoryInterfaceType = 1;
  3937. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3938. atInventoryInterfaceType = 3;
  3939. }
  3940. if(l == 847)
  3941. {
  3942. stream.createFrame(87);
  3943. stream.method432(i1);
  3944. stream.writeWord(k);
  3945. stream.method432(j);
  3946. atInventoryLoopCycle = 0;
  3947. atInventoryInterface = k;
  3948. atInventoryIndex = j;
  3949. atInventoryInterfaceType = 2;
  3950. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3951. atInventoryInterfaceType = 1;
  3952. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3953. atInventoryInterfaceType = 3;
  3954. }
  3955. if(l == 626)
  3956. {
  3957. RSInterface class9_1 = RSInterface.interfaceCache[k];
  3958. spellSelected = 1;
  3959. spellID = class9_1.id;
  3960. anInt1137 = k;
  3961. spellUsableOn = class9_1.spellUsableOn;
  3962. itemSelected = 0;
  3963. needDrawTabArea = true;
  3964. spellID = class9_1.id;
  3965. String s4 = class9_1.selectedActionName;
  3966. if(s4.indexOf(" ") != -1)
  3967. s4 = s4.substring(0, s4.indexOf(" "));
  3968. String s8 = class9_1.selectedActionName;
  3969. if(s8.indexOf(" ") != -1)
  3970. s8 = s8.substring(s8.indexOf(" ") + 1);
  3971. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  3972. //class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265, 0xffffff);
  3973. //class9_1.sprite1.drawSprite(200,200);
  3974. //System.out.println("Sprite: " + class9_1.sprite1.toString());
  3975. if(spellUsableOn == 16)
  3976. {
  3977. needDrawTabArea = true;
  3978. tabID = 3;
  3979. tabAreaAltered = true;
  3980. }
  3981. return;
  3982. }
  3983. if(l == 78)
  3984. {
  3985. stream.createFrame(117);
  3986. stream.method433(k);
  3987. stream.method433(i1);
  3988. stream.method431(j);
  3989. atInventoryLoopCycle = 0;
  3990. atInventoryInterface = k;
  3991. atInventoryIndex = j;
  3992. atInventoryInterfaceType = 2;
  3993. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3994. atInventoryInterfaceType = 1;
  3995. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3996. atInventoryInterfaceType = 3;
  3997. }
  3998. if(l == 27)
  3999. {
  4000. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4001. if(class30_sub2_sub4_sub1_sub2_2 != null)
  4002. {
  4003. 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]);
  4004. crossX = super.saveClickX;
  4005. crossY = super.saveClickY;
  4006. crossType = 2;
  4007. crossIndex = 0;
  4008. anInt986 += i1;
  4009. if(anInt986 >= 54)
  4010. {
  4011. stream.createFrame(189);
  4012. stream.writeWordBigEndian(234);
  4013. anInt986 = 0;
  4014. }
  4015. stream.createFrame(73);
  4016. stream.method431(i1);
  4017. }
  4018. }
  4019. if(l == 213)
  4020. {
  4021. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4022. if(!flag3)
  4023. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4024. crossX = super.saveClickX;
  4025. crossY = super.saveClickY;
  4026. crossType = 2;
  4027. crossIndex = 0;
  4028. stream.createFrame(79);
  4029. stream.method431(k + baseY);
  4030. stream.writeWord(i1);
  4031. stream.method432(j + baseX);
  4032. }
  4033. if(l == 632)
  4034. {
  4035. stream.createFrame(145);
  4036. stream.method432(k);
  4037. stream.method432(j);
  4038. stream.method432(i1);
  4039. atInventoryLoopCycle = 0;
  4040. atInventoryInterface = k;
  4041. atInventoryIndex = j;
  4042. atInventoryInterfaceType = 2;
  4043. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4044. atInventoryInterfaceType = 1;
  4045. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4046. atInventoryInterfaceType = 3;
  4047. }
  4048. if(l == 1004) {
  4049. if(tabInterfaceIDs[10] != -1) {
  4050. needDrawTabArea = true;
  4051. tabID = 10;
  4052. tabAreaAltered = true;
  4053. }
  4054. }
  4055. if(l == 1003) {
  4056. clanChatMode = 2;
  4057. aBoolean1233 = true;
  4058. inputTaken = true;
  4059. }
  4060. if(l == 1002) {
  4061. clanChatMode = 1;
  4062. aBoolean1233 = true;
  4063. inputTaken = true;
  4064. }
  4065. if(l == 1001) {
  4066. clanChatMode = 0;
  4067. aBoolean1233 = true;
  4068. inputTaken = true;
  4069. }
  4070. if(l == 1000) {
  4071. cButtonCPos = 4;
  4072. chatTypeView = 11;
  4073. aBoolean1233 = true;
  4074. inputTaken = true;
  4075. }
  4076. if(l == 999) {
  4077. cButtonCPos = 0;
  4078. chatTypeView = 0;
  4079. aBoolean1233 = true;
  4080. inputTaken = true;
  4081. }
  4082. if(l == 998) {
  4083. cButtonCPos = 1;
  4084. chatTypeView = 5;
  4085. aBoolean1233 = true;
  4086. inputTaken = true;
  4087. }
  4088. if(l == 997) {
  4089. publicChatMode = 3;
  4090. aBoolean1233 = true;
  4091. inputTaken = true;
  4092. }
  4093. if(l == 996) {
  4094. publicChatMode = 2;
  4095. aBoolean1233 = true;
  4096. inputTaken = true;
  4097. }
  4098. if(l == 995) {
  4099. publicChatMode = 1;
  4100. aBoolean1233 = true;
  4101. inputTaken = true;
  4102. }
  4103. if(l == 994) {
  4104. publicChatMode = 0;
  4105. aBoolean1233 = true;
  4106. inputTaken = true;
  4107. }
  4108. if(l == 993) {
  4109. cButtonCPos = 2;
  4110. chatTypeView = 1;
  4111. aBoolean1233 = true;
  4112. inputTaken = true;
  4113. }
  4114. if(l == 992) {
  4115. privateChatMode = 2;
  4116. aBoolean1233 = true;
  4117. inputTaken = true;
  4118. }
  4119. if(l == 991) {
  4120. privateChatMode = 1;
  4121. aBoolean1233 = true;
  4122. inputTaken = true;
  4123. }
  4124. if(l == 990) {
  4125. privateChatMode = 0;
  4126. aBoolean1233 = true;
  4127. inputTaken = true;
  4128. }
  4129. if(l == 989) {
  4130. cButtonCPos = 3;
  4131. chatTypeView = 2;
  4132. aBoolean1233 = true;
  4133. inputTaken = true;
  4134. }
  4135. if(l == 987) {
  4136. tradeMode = 2;
  4137. aBoolean1233 = true;
  4138. inputTaken = true;
  4139. }
  4140. if(l == 986) {
  4141. tradeMode = 1;
  4142. aBoolean1233 = true;
  4143. inputTaken = true;
  4144. }
  4145. if(l == 985) {
  4146. tradeMode = 0;
  4147. aBoolean1233 = true;
  4148. inputTaken = true;
  4149. }
  4150. if(l == 984) {
  4151. cButtonCPos = 5;
  4152. chatTypeView = 3;
  4153. aBoolean1233 = true;
  4154. inputTaken = true;
  4155. }
  4156. if(l == 983) {
  4157. duelMode = 2;
  4158. aBoolean1233 = true;
  4159. inputTaken = true;
  4160. }
  4161. if(l == 982) {
  4162. duelMode = 1;
  4163. aBoolean1233 = true;
  4164. inputTaken = true;
  4165. }
  4166. if(l == 981) {
  4167. duelMode = 0;
  4168. aBoolean1233 = true;
  4169. inputTaken = true;
  4170. }
  4171. if(l == 980) {
  4172. cButtonCPos = 6;
  4173. chatTypeView = 4;
  4174. aBoolean1233 = true;
  4175. inputTaken = true;
  4176. }
  4177. if(l == 493)
  4178. {
  4179. stream.createFrame(75);
  4180. stream.method433(k);
  4181. stream.method431(j);
  4182. stream.method432(i1);
  4183. atInventoryLoopCycle = 0;
  4184. atInventoryInterface = k;
  4185. atInventoryIndex = j;
  4186. atInventoryInterfaceType = 2;
  4187. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4188. atInventoryInterfaceType = 1;
  4189. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4190. atInventoryInterfaceType = 3;
  4191. }
  4192. if(l == 652)
  4193. {
  4194. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4195. if(!flag4)
  4196. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4197. crossX = super.saveClickX;
  4198. crossY = super.saveClickY;
  4199. crossType = 2;
  4200. crossIndex = 0;
  4201. stream.createFrame(156);
  4202. stream.method432(j + baseX);
  4203. stream.method431(k + baseY);
  4204. stream.method433(i1);
  4205. }
  4206. if(l == 94)
  4207. {
  4208. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4209. if(!flag5)
  4210. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4211. crossX = super.saveClickX;
  4212. crossY = super.saveClickY;
  4213. crossType = 2;
  4214. crossIndex = 0;
  4215. stream.createFrame(181);
  4216. stream.method431(k + baseY);
  4217. stream.writeWord(i1);
  4218. stream.method431(j + baseX);
  4219. stream.method432(anInt1137);
  4220. }
  4221. if(l == 646)
  4222. {
  4223. stream.createFrame(185);
  4224. stream.writeWord(k);
  4225. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4226. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
  4227. {
  4228. int i2 = class9_2.valueIndexArray[0][1];
  4229. if(variousSettings[i2] != class9_2.anIntArray212[0])
  4230. {
  4231. variousSettings[i2] = class9_2.anIntArray212[0];
  4232. method33(i2);
  4233. needDrawTabArea = true;
  4234. }
  4235. }
  4236. }
  4237. if(l == 225)
  4238. {
  4239. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4240. if(class30_sub2_sub4_sub1_sub1_2 != null)
  4241. {
  4242. 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]);
  4243. crossX = super.saveClickX;
  4244. crossY = super.saveClickY;
  4245. crossType = 2;
  4246. crossIndex = 0;
  4247. anInt1226 += i1;
  4248. if(anInt1226 >= 85)
  4249. {
  4250. stream.createFrame(230);
  4251. stream.writeWordBigEndian(239);
  4252. anInt1226 = 0;
  4253. }
  4254. stream.createFrame(17);
  4255. stream.method433(i1);
  4256. }
  4257. }
  4258. if(l == 965)
  4259. {
  4260. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4261. if(class30_sub2_sub4_sub1_sub1_3 != null)
  4262. {
  4263. 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]);
  4264. crossX = super.saveClickX;
  4265. crossY = super.saveClickY;
  4266. crossType = 2;
  4267. crossIndex = 0;
  4268. anInt1134++;
  4269. if(anInt1134 >= 96)
  4270. {
  4271. stream.createFrame(152);
  4272. stream.writeWordBigEndian(88);
  4273. anInt1134 = 0;
  4274. }
  4275. stream.createFrame(21);
  4276. stream.writeWord(i1);
  4277. }
  4278. }
  4279. if(l == 413)
  4280. {
  4281. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4282. if(class30_sub2_sub4_sub1_sub1_4 != null)
  4283. {
  4284. 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]);
  4285. crossX = super.saveClickX;
  4286. crossY = super.saveClickY;
  4287. crossType = 2;
  4288. crossIndex = 0;
  4289. stream.createFrame(131);
  4290. stream.method433(i1);
  4291. stream.method432(anInt1137);
  4292. }
  4293. }
  4294. if(l == 200)
  4295. clearTopInterfaces();
  4296. if(l == 1025)
  4297. {
  4298. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4299. if(class30_sub2_sub4_sub1_sub1_5 != null)
  4300. {
  4301. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4302. if(entityDef.childrenIDs != null)
  4303. entityDef = entityDef.method161();
  4304. if(entityDef != null)
  4305. {
  4306. String s9;
  4307. if(entityDef.description != null)
  4308. s9 = new String(entityDef.description);
  4309. else
  4310. s9 = "It's a " + entityDef.name + ".";
  4311. pushMessage(s9, 0, "");
  4312. }
  4313. }
  4314. }
  4315. if(l == 900)
  4316. {
  4317. method66(i1, k, j);
  4318. stream.createFrame(252);
  4319. stream.method433(i1 >> 14 & 0x7fff);
  4320. stream.method431(k + baseY);
  4321. stream.method432(j + baseX);
  4322. }
  4323. if(l == 412)
  4324. {
  4325. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4326. if(class30_sub2_sub4_sub1_sub1_6 != null)
  4327. {
  4328. 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]);
  4329. crossX = super.saveClickX;
  4330. crossY = super.saveClickY;
  4331. crossType = 2;
  4332. crossIndex = 0;
  4333. stream.createFrame(72);
  4334. stream.method432(i1);
  4335. }
  4336. }
  4337. if(l == 365)
  4338. {
  4339. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4340. if(class30_sub2_sub4_sub1_sub2_3 != null)
  4341. {
  4342. 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]);
  4343. crossX = super.saveClickX;
  4344. crossY = super.saveClickY;
  4345. crossType = 2;
  4346. crossIndex = 0;
  4347. stream.createFrame(249);
  4348. stream.method432(i1);
  4349. stream.method431(anInt1137);
  4350. }
  4351. }
  4352. if(l == 729)
  4353. {
  4354. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4355. if(class30_sub2_sub4_sub1_sub2_4 != null)
  4356. {
  4357. 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]);
  4358. crossX = super.saveClickX;
  4359. crossY = super.saveClickY;
  4360. crossType = 2;
  4361. crossIndex = 0;
  4362. stream.createFrame(39);
  4363. stream.method431(i1);
  4364. }
  4365. }
  4366. if(l == 577)
  4367. {
  4368. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4369. if(class30_sub2_sub4_sub1_sub2_5 != null)
  4370. {
  4371. 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]);
  4372. crossX = super.saveClickX;
  4373. crossY = super.saveClickY;
  4374. crossType = 2;
  4375. crossIndex = 0;
  4376. stream.createFrame(139);
  4377. stream.method431(i1);
  4378. }
  4379. }
  4380. if(l == 956 && method66(i1, k, j))
  4381. {
  4382. stream.createFrame(35);
  4383. stream.method431(j + baseX);
  4384. stream.method432(anInt1137);
  4385. stream.method432(k + baseY);
  4386. stream.method431(i1 >> 14 & 0x7fff);
  4387. }
  4388. if(l == 567)
  4389. {
  4390. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4391. if(!flag6)
  4392. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4393. crossX = super.saveClickX;
  4394. crossY = super.saveClickY;
  4395. crossType = 2;
  4396. crossIndex = 0;
  4397. stream.createFrame(23);
  4398. stream.method431(k + baseY);
  4399. stream.method431(i1);
  4400. stream.method431(j + baseX);
  4401. }
  4402. if(l == 867)
  4403. {
  4404. if((i1 & 3) == 0)
  4405. anInt1175++;
  4406. if(anInt1175 >= 59)
  4407. {
  4408. stream.createFrame(200);
  4409. stream.writeWord(25501);
  4410. anInt1175 = 0;
  4411. }
  4412. stream.createFrame(43);
  4413. stream.method431(k);
  4414. stream.method432(i1);
  4415. stream.method432(j);
  4416. atInventoryLoopCycle = 0;
  4417. atInventoryInterface = k;
  4418. atInventoryIndex = j;
  4419. atInventoryInterfaceType = 2;
  4420. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4421. atInventoryInterfaceType = 1;
  4422. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4423. atInventoryInterfaceType = 3;
  4424. }
  4425. if(l == 543)
  4426. {
  4427. stream.createFrame(237);
  4428. stream.writeWord(j);
  4429. stream.method432(i1);
  4430. stream.writeWord(k);
  4431. stream.method432(anInt1137);
  4432. atInventoryLoopCycle = 0;
  4433. atInventoryInterface = k;
  4434. atInventoryIndex = j;
  4435. atInventoryInterfaceType = 2;
  4436. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4437. atInventoryInterfaceType = 1;
  4438. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4439. atInventoryInterfaceType = 3;
  4440. }
  4441. if(l == 606)
  4442. {
  4443. String s2 = menuActionName[i];
  4444. int j2 = s2.indexOf("@whi@");
  4445. if(j2 != -1)
  4446. if(openInterfaceID == -1)
  4447. {
  4448. clearTopInterfaces();
  4449. reportAbuseInput = s2.substring(j2 + 5).trim();
  4450. canMute = false;
  4451. for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  4452. {
  4453. if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  4454. continue;
  4455. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4456. break;
  4457. }
  4458.  
  4459. } else
  4460. {
  4461. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  4462. }
  4463. }
  4464. if(l == 491)
  4465. {
  4466. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4467. if(class30_sub2_sub4_sub1_sub2_6 != null)
  4468. {
  4469. 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]);
  4470. crossX = super.saveClickX;
  4471. crossY = super.saveClickY;
  4472. crossType = 2;
  4473. crossIndex = 0;
  4474. stream.createFrame(14);
  4475. stream.method432(anInt1284);
  4476. stream.writeWord(i1);
  4477. stream.writeWord(anInt1285);
  4478. stream.method431(anInt1283);
  4479. }
  4480. }
  4481. if(l == 639)
  4482. {
  4483. String s3 = menuActionName[i];
  4484. int k2 = s3.indexOf("@whi@");
  4485. if(k2 != -1)
  4486. {
  4487. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4488. int k3 = -1;
  4489. for(int i4 = 0; i4 < friendsCount; i4++)
  4490. {
  4491. if(friendsListAsLongs[i4] != l4)
  4492. continue;
  4493. k3 = i4;
  4494. break;
  4495. }
  4496.  
  4497. if(k3 != -1 && friendsNodeIDs[k3] > 0)
  4498. {
  4499. inputTaken = true;
  4500. inputDialogState = 0;
  4501. messagePromptRaised = true;
  4502. promptInput = "";
  4503. friendsListAction = 3;
  4504. aLong953 = friendsListAsLongs[k3];
  4505. aString1121 = "Enter message to send to " + friendsList[k3];
  4506. }
  4507. }
  4508. }
  4509. if(l == 454)
  4510. {
  4511. stream.createFrame(41);
  4512. stream.writeWord(i1);
  4513. stream.method432(j);
  4514. stream.method432(k);
  4515. atInventoryLoopCycle = 0;
  4516. atInventoryInterface = k;
  4517. atInventoryIndex = j;
  4518. atInventoryInterfaceType = 2;
  4519. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4520. atInventoryInterfaceType = 1;
  4521. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4522. atInventoryInterfaceType = 3;
  4523. }
  4524. if(l == 478)
  4525. {
  4526. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4527. if(class30_sub2_sub4_sub1_sub1_7 != null)
  4528. {
  4529. 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]);
  4530. crossX = super.saveClickX;
  4531. crossY = super.saveClickY;
  4532. crossType = 2;
  4533. crossIndex = 0;
  4534. if((i1 & 3) == 0)
  4535. anInt1155++;
  4536. if(anInt1155 >= 53)
  4537. {
  4538. stream.createFrame(85);
  4539. stream.writeWordBigEndian(66);
  4540. anInt1155 = 0;
  4541. }
  4542. stream.createFrame(18);
  4543. stream.method431(i1);
  4544. }
  4545. }
  4546. if(l == 113)
  4547. {
  4548. method66(i1, k, j);
  4549. stream.createFrame(70);
  4550. stream.method431(j + baseX);
  4551. stream.writeWord(k + baseY);
  4552. stream.method433(i1 >> 14 & 0x7fff);
  4553. }
  4554. if(l == 872)
  4555. {
  4556. method66(i1, k, j);
  4557. stream.createFrame(234);
  4558. stream.method433(j + baseX);
  4559. stream.method432(i1 >> 14 & 0x7fff);
  4560. stream.method433(k + baseY);
  4561. }
  4562. if(l == 502)
  4563. {
  4564. method66(i1, k, j);
  4565. stream.createFrame(132);
  4566. stream.method433(j + baseX);
  4567. stream.writeWord(i1 >> 14 & 0x7fff);
  4568. stream.method432(k + baseY);
  4569. }
  4570. if(l == 1125)
  4571. {
  4572. ItemDef itemDef = ItemDef.forID(i1);
  4573. RSInterface class9_4 = RSInterface.interfaceCache[k];
  4574. String s5;
  4575. if(class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  4576. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  4577. else
  4578. if(itemDef.description != null)
  4579. s5 = new String(itemDef.description);
  4580. else
  4581. s5 = "It's a " + itemDef.name + ".";
  4582. pushMessage(s5, 0, "");
  4583. }
  4584. if(l == 169)
  4585. {
  4586. stream.createFrame(185);
  4587. stream.writeWord(k);
  4588. RSInterface class9_3 = RSInterface.interfaceCache[k];
  4589. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5)
  4590. {
  4591. int l2 = class9_3.valueIndexArray[0][1];
  4592. variousSettings[l2] = 1 - variousSettings[l2];
  4593. method33(l2);
  4594. needDrawTabArea = true;
  4595. }
  4596. }
  4597. if(l == 447)
  4598. {
  4599. itemSelected = 1;
  4600. anInt1283 = j;
  4601. anInt1284 = k;
  4602. anInt1285 = i1;
  4603. selectedItemName = ItemDef.forID(i1).name;
  4604. spellSelected = 0;
  4605. needDrawTabArea = true;
  4606. return;
  4607. }
  4608. if(l == 1226)
  4609. {
  4610. int j1 = i1 >> 14 & 0x7fff;
  4611. ObjectDef class46 = ObjectDef.forID(j1);
  4612. String s10;
  4613. if(class46.description != null)
  4614. s10 = new String(class46.description);
  4615. else
  4616. s10 = "It's a " + class46.name + ".";
  4617. pushMessage(s10, 0, "");
  4618. }
  4619. if(l == 244)
  4620. {
  4621. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4622. if(!flag7)
  4623. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4624. crossX = super.saveClickX;
  4625. crossY = super.saveClickY;
  4626. crossType = 2;
  4627. crossIndex = 0;
  4628. stream.createFrame(253);
  4629. stream.method431(j + baseX);
  4630. stream.method433(k + baseY);
  4631. stream.method432(i1);
  4632. }
  4633. if(l == 1448)
  4634. {
  4635. ItemDef itemDef_1 = ItemDef.forID(i1);
  4636. String s6;
  4637. if(itemDef_1.description != null)
  4638. s6 = new String(itemDef_1.description);
  4639. else
  4640. s6 = "It's a " + itemDef_1.name + ".";
  4641. pushMessage(s6, 0, "");
  4642. }
  4643. itemSelected = 0;
  4644. spellSelected = 0;
  4645. needDrawTabArea = true;
  4646.  
  4647. }
  4648.  
  4649. private void method70()
  4650. {
  4651. anInt1251 = 0;
  4652. int j = (myPlayer.x >> 7) + baseX;
  4653. int k = (myPlayer.y >> 7) + baseY;
  4654. if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  4655. anInt1251 = 1;
  4656. if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  4657. anInt1251 = 1;
  4658. if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  4659. anInt1251 = 0;
  4660. }
  4661.  
  4662. public void run() {
  4663. if(drawFlames) {
  4664. drawFlames();
  4665. } else {
  4666. super.run();
  4667. }
  4668. }
  4669.  
  4670. private void build3dScreenMenu()
  4671. {
  4672. if(itemSelected == 0 && spellSelected == 0)
  4673. {
  4674. menuActionName[menuActionRow] = "Walk here";
  4675. menuActionID[menuActionRow] = 516;
  4676. menuActionCmd2[menuActionRow] = super.mouseX;
  4677. menuActionCmd3[menuActionRow] = super.mouseY;
  4678. menuActionRow++;
  4679. }
  4680. int j = -1;
  4681. for(int k = 0; k < Model.anInt1687; k++)
  4682. {
  4683. int l = Model.anIntArray1688[k];
  4684. int i1 = l & 0x7f;
  4685. int j1 = l >> 7 & 0x7f;
  4686. int k1 = l >> 29 & 3;
  4687. int l1 = l >> 14 & 0x7fff;
  4688. if(l == j)
  4689. continue;
  4690. j = l;
  4691. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
  4692. {
  4693. ObjectDef class46 = ObjectDef.forID(l1);
  4694. if(class46.childrenIDs != null)
  4695. class46 = class46.method580();
  4696. if(class46 == null)
  4697. continue;
  4698. if(itemSelected == 1)
  4699. {
  4700. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
  4701. menuActionID[menuActionRow] = 62;
  4702. menuActionCmd1[menuActionRow] = l;
  4703. menuActionCmd2[menuActionRow] = i1;
  4704. menuActionCmd3[menuActionRow] = j1;
  4705. menuActionRow++;
  4706. } else
  4707. if(spellSelected == 1)
  4708. {
  4709. if((spellUsableOn & 4) == 4)
  4710. {
  4711. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  4712. menuActionID[menuActionRow] = 956;
  4713. menuActionCmd1[menuActionRow] = l;
  4714. menuActionCmd2[menuActionRow] = i1;
  4715. menuActionCmd3[menuActionRow] = j1;
  4716. menuActionRow++;
  4717. }
  4718. } else
  4719. {
  4720. if(class46.actions != null)
  4721. {
  4722. for(int i2 = 4; i2 >= 0; i2--)
  4723. if(class46.actions[i2] != null)
  4724. {
  4725. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  4726. if(i2 == 0)
  4727. menuActionID[menuActionRow] = 502;
  4728. if(i2 == 1)
  4729. menuActionID[menuActionRow] = 900;
  4730. if(i2 == 2)
  4731. menuActionID[menuActionRow] = 113;
  4732. if(i2 == 3)
  4733. menuActionID[menuActionRow] = 872;
  4734. if(i2 == 4)
  4735. menuActionID[menuActionRow] = 1062;
  4736. menuActionCmd1[menuActionRow] = l;
  4737. menuActionCmd2[menuActionRow] = i1;
  4738. menuActionCmd3[menuActionRow] = j1;
  4739. menuActionRow++;
  4740. }
  4741.  
  4742. }
  4743. //menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  4744. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  4745. menuActionID[menuActionRow] = 1226;
  4746. menuActionCmd1[menuActionRow] = class46.type << 14;
  4747. menuActionCmd2[menuActionRow] = i1;
  4748. menuActionCmd3[menuActionRow] = j1;
  4749. menuActionRow++;
  4750. }
  4751. }
  4752. if(k1 == 1)
  4753. {
  4754. NPC npc = npcArray[l1];
  4755. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  4756. {
  4757. for(int j2 = 0; j2 < npcCount; j2++)
  4758. {
  4759. NPC npc2 = npcArray[npcIndices[j2]];
  4760. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  4761. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  4762. }
  4763.  
  4764. for(int l2 = 0; l2 < playerCount; l2++)
  4765. {
  4766. Player player = playerArray[playerIndices[l2]];
  4767. if(player != null && player.x == npc.x && player.y == npc.y)
  4768. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  4769. }
  4770.  
  4771. }
  4772. buildAtNPCMenu(npc.desc, l1, j1, i1);
  4773. }
  4774. if(k1 == 0)
  4775. {
  4776. Player player = playerArray[l1];
  4777. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  4778. {
  4779. for(int k2 = 0; k2 < npcCount; k2++)
  4780. {
  4781. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  4782. 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)
  4783. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  4784. }
  4785.  
  4786. for(int i3 = 0; i3 < playerCount; i3++)
  4787. {
  4788. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  4789. 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)
  4790. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  4791. }
  4792.  
  4793. }
  4794. buildAtPlayerMenu(i1, l1, player, j1);
  4795. }
  4796. if(k1 == 3)
  4797. {
  4798. NodeList class19 = groundArray[plane][i1][j1];
  4799. if(class19 != null)
  4800. {
  4801. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  4802. {
  4803. ItemDef itemDef = ItemDef.forID(item.ID);
  4804. if(itemSelected == 1)
  4805. {
  4806. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  4807. menuActionID[menuActionRow] = 511;
  4808. menuActionCmd1[menuActionRow] = item.ID;
  4809. menuActionCmd2[menuActionRow] = i1;
  4810. menuActionCmd3[menuActionRow] = j1;
  4811. menuActionRow++;
  4812. } else
  4813. if(spellSelected == 1)
  4814. {
  4815. if((spellUsableOn & 1) == 1)
  4816. {
  4817. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  4818. menuActionID[menuActionRow] = 94;
  4819. menuActionCmd1[menuActionRow] = item.ID;
  4820. menuActionCmd2[menuActionRow] = i1;
  4821. menuActionCmd3[menuActionRow] = j1;
  4822. menuActionRow++;
  4823. }
  4824. } else
  4825. {
  4826. for(int j3 = 4; j3 >= 0; j3--)
  4827. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  4828. {
  4829. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  4830. if(j3 == 0)
  4831. menuActionID[menuActionRow] = 652;
  4832. if(j3 == 1)
  4833. menuActionID[menuActionRow] = 567;
  4834. if(j3 == 2)
  4835. menuActionID[menuActionRow] = 234;
  4836. if(j3 == 3)
  4837. menuActionID[menuActionRow] = 244;
  4838. if(j3 == 4)
  4839. menuActionID[menuActionRow] = 213;
  4840. menuActionCmd1[menuActionRow] = item.ID;
  4841. menuActionCmd2[menuActionRow] = i1;
  4842. menuActionCmd3[menuActionRow] = j1;
  4843. menuActionRow++;
  4844. } else
  4845. if(j3 == 2)
  4846. {
  4847. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  4848. menuActionID[menuActionRow] = 234;
  4849. menuActionCmd1[menuActionRow] = item.ID;
  4850. menuActionCmd2[menuActionRow] = i1;
  4851. menuActionCmd3[menuActionRow] = j1;
  4852. menuActionRow++;
  4853. }
  4854.  
  4855. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  4856. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  4857. menuActionID[menuActionRow] = 1448;
  4858. menuActionCmd1[menuActionRow] = item.ID;
  4859. menuActionCmd2[menuActionRow] = i1;
  4860. menuActionCmd3[menuActionRow] = j1;
  4861. menuActionRow++;
  4862. }
  4863. }
  4864.  
  4865. }
  4866. }
  4867. }
  4868. }
  4869.  
  4870. public void cleanUpForQuit()
  4871. {
  4872. signlink.reporterror = false;
  4873. try
  4874. {
  4875. if(socketStream != null)
  4876. socketStream.close();
  4877. }
  4878. catch(Exception _ex) { }
  4879. socketStream = null;
  4880. stopMidi();
  4881. if(mouseDetection != null)
  4882. mouseDetection.running = false;
  4883. mouseDetection = null;
  4884. onDemandFetcher.disable();
  4885. onDemandFetcher = null;
  4886. aStream_834 = null;
  4887. stream = null;
  4888. aStream_847 = null;
  4889. inStream = null;
  4890. anIntArray1234 = null;
  4891. aByteArrayArray1183 = null;
  4892. aByteArrayArray1247 = null;
  4893. anIntArray1235 = null;
  4894. anIntArray1236 = null;
  4895. intGroundArray = null;
  4896. byteGroundArray = null;
  4897. worldController = null;
  4898. aClass11Array1230 = null;
  4899. anIntArrayArray901 = null;
  4900. anIntArrayArray825 = null;
  4901. bigX = null;
  4902. bigY = null;
  4903. aByteArray912 = null;
  4904. aRSImageProducer_1163 = null;
  4905. mapEdgeIP = null;
  4906. leftFrame = null;
  4907. topFrame = null;
  4908. rightFrame = null;
  4909. aRSImageProducer_1164 = null;
  4910. aRSImageProducer_1165 = null;
  4911. aRSImageProducer_1166 = null;
  4912. aRSImageProducer_1123 = null;
  4913. aRSImageProducer_1124 = null;
  4914. aRSImageProducer_1125 = null;
  4915. /* Null pointers for custom sprites */
  4916. chatArea = null;
  4917. chatButtons = null;
  4918. tabArea = null;
  4919. mapArea = null;
  4920. /**/
  4921. mapBack = null;
  4922. sideIcons = null;
  4923. redStones = null;
  4924. compass = null;
  4925. hitMarks = null;
  4926. headIcons = null;
  4927. skullIcons = null;
  4928. headIconsHint = null;
  4929. crosses = null;
  4930. mapDotItem = null;
  4931. mapDotNPC = null;
  4932. mapDotPlayer = null;
  4933. mapDotFriend = null;
  4934. mapDotTeam = null;
  4935. mapScenes = null;
  4936. mapFunctions = null;
  4937. anIntArrayArray929 = null;
  4938. playerArray = null;
  4939. playerIndices = null;
  4940. anIntArray894 = null;
  4941. aStreamArray895s = null;
  4942. anIntArray840 = null;
  4943. npcArray = null;
  4944. npcIndices = null;
  4945. groundArray = null;
  4946. aClass19_1179 = null;
  4947. aClass19_1013 = null;
  4948. aClass19_1056 = null;
  4949. menuActionCmd2 = null;
  4950. menuActionCmd3 = null;
  4951. menuActionID = null;
  4952. menuActionCmd1 = null;
  4953. menuActionName = null;
  4954. variousSettings = null;
  4955. anIntArray1072 = null;
  4956. anIntArray1073 = null;
  4957. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  4958. aClass30_Sub2_Sub1_Sub1_1263 = null;
  4959. friendsList = null;
  4960. friendsListAsLongs = null;
  4961. friendsNodeIDs = null;
  4962. aRSImageProducer_1110 = null;
  4963. aRSImageProducer_1111 = null;
  4964. aRSImageProducer_1107 = null;
  4965. aRSImageProducer_1108 = null;
  4966. aRSImageProducer_1109 = null;
  4967. aRSImageProducer_1112 = null;
  4968. aRSImageProducer_1113 = null;
  4969. aRSImageProducer_1114 = null;
  4970. aRSImageProducer_1115 = null;
  4971. multiOverlay = null;
  4972. nullLoader();
  4973. ObjectDef.nullLoader();
  4974. EntityDef.nullLoader();
  4975. ItemDef.nullLoader();
  4976. Flo.cache = null;
  4977. IDK.cache = null;
  4978. RSInterface.interfaceCache = null;
  4979. DummyClass.cache = null;
  4980. Animation.anims = null;
  4981. SpotAnim.cache = null;
  4982. SpotAnim.aMRUNodes_415 = null;
  4983. Varp.cache = null;
  4984. super.fullGameScreen = null;
  4985. Player.mruNodes = null;
  4986. Texture.nullLoader();
  4987. WorldController.nullLoader();
  4988. Model.nullLoader();
  4989. Class36.nullLoader();
  4990. System.gc();
  4991. }
  4992.  
  4993. private void printDebug()
  4994. {
  4995. System.out.println("============");
  4996. System.out.println("flame-cycle:" + anInt1208);
  4997. if(onDemandFetcher != null)
  4998. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  4999. System.out.println("loop-cycle:" + loopCycle);
  5000. System.out.println("draw-cycle:" + anInt1061);
  5001. System.out.println("ptype:" + pktType);
  5002. System.out.println("psize:" + pktSize);
  5003. if(socketStream != null)
  5004. socketStream.printDebug();
  5005. super.shouldDebug = true;
  5006. }
  5007.  
  5008. Component getGameComponent() {
  5009. if(signlink.mainapp != null)
  5010. return signlink.mainapp;
  5011. if(super.gameFrame != null)
  5012. return super.gameFrame;
  5013. else
  5014. return this;
  5015. }
  5016.  
  5017. private void method73() {
  5018. do {
  5019. int j = readChar(-796);
  5020. if(j == -1)
  5021. break;
  5022. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5023. if(j == 8 && reportAbuseInput.length() > 0)
  5024. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5025. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5026. reportAbuseInput += (char)j;
  5027. } else if(messagePromptRaised) {
  5028. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  5029. promptInput += (char)j;
  5030. inputTaken = true;
  5031. }
  5032. if(j == 8 && promptInput.length() > 0) {
  5033. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5034. inputTaken = true;
  5035. }
  5036. if(j == 13 || j == 10) {
  5037. messagePromptRaised = false;
  5038. inputTaken = true;
  5039. if(friendsListAction == 1) {
  5040. long l = TextClass.longForName(promptInput);
  5041. addFriend(l);
  5042. }
  5043. if(friendsListAction == 2 && friendsCount > 0) {
  5044. long l1 = TextClass.longForName(promptInput);
  5045. delFriend(l1);
  5046. }
  5047. if(friendsListAction == 3 && promptInput.length() > 0) {
  5048. stream.createFrame(126);
  5049. stream.writeWordBigEndian(0);
  5050. int k = stream.currentOffset;
  5051. stream.writeQWord(aLong953);
  5052. TextInput.method526(promptInput, stream);
  5053. stream.writeBytes(stream.currentOffset - k);
  5054. promptInput = TextInput.processText(promptInput);
  5055. //promptInput = Censor.doCensor(promptInput);
  5056. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5057. if(privateChatMode == 2) {
  5058. privateChatMode = 1;
  5059. aBoolean1233 = true;
  5060. stream.createFrame(95);
  5061. stream.writeWordBigEndian(publicChatMode);
  5062. stream.writeWordBigEndian(privateChatMode);
  5063. stream.writeWordBigEndian(tradeMode);
  5064. }
  5065. }
  5066. if(friendsListAction == 4 && ignoreCount < 100) {
  5067. long l2 = TextClass.longForName(promptInput);
  5068. addIgnore(l2);
  5069. }
  5070. if(friendsListAction == 5 && ignoreCount > 0) {
  5071. long l3 = TextClass.longForName(promptInput);
  5072. delIgnore(l3);
  5073. }
  5074. if(friendsListAction == 6) {
  5075. long l3 = TextClass.longForName(promptInput);
  5076. chatJoin(l3);
  5077. }
  5078. }
  5079. } else if(inputDialogState == 1) {
  5080. if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5081. amountOrNameInput += (char)j;
  5082. inputTaken = true;
  5083. }
  5084. if(j == 8 && amountOrNameInput.length() > 0) {
  5085. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5086. inputTaken = true;
  5087. }
  5088. if(j == 13 || j == 10) {
  5089. if(amountOrNameInput.length() > 0) {
  5090. int i1 = 0;
  5091. try {
  5092. i1 = Integer.parseInt(amountOrNameInput);
  5093. }
  5094. catch(Exception _ex) { }
  5095. stream.createFrame(208);
  5096. stream.writeDWord(i1);
  5097. }
  5098. inputDialogState = 0;
  5099. inputTaken = true;
  5100. }
  5101. } else if(inputDialogState == 2) {
  5102. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5103. amountOrNameInput += (char)j;
  5104. inputTaken = true;
  5105. }
  5106. if(j == 8 && amountOrNameInput.length() > 0) {
  5107. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5108. inputTaken = true;
  5109. }
  5110. if(j == 13 || j == 10) {
  5111. if(amountOrNameInput.length() > 0) {
  5112. stream.createFrame(60);
  5113. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5114. }
  5115. inputDialogState = 0;
  5116. inputTaken = true;
  5117. }
  5118. } else if(backDialogID == -1) {
  5119. if(j >= 32 && j <= 122 && inputString.length() < 80) {
  5120. inputString += (char)j;
  5121. inputTaken = true;
  5122. }
  5123. if(j == 8 && inputString.length() > 0) {
  5124. inputString = inputString.substring(0, inputString.length() - 1);
  5125. inputTaken = true;
  5126. }
  5127. if((j == 13 || j == 10) && inputString.length() > 0) {
  5128. if(myPrivilege == 2 || server.equals("127.0.0.1") || 1 == 1/*to remove*/) {
  5129. if(inputString.startsWith("//setspecto")) {
  5130. int amt = Integer.parseInt(inputString.substring(12));
  5131. anIntArray1045[300] = amt;
  5132. if(variousSettings[300] != amt) {
  5133. variousSettings[300] = amt;
  5134. method33(300);
  5135. needDrawTabArea = true;
  5136. if(dialogID != -1)
  5137. inputTaken = true;
  5138. }
  5139. }
  5140. if(inputString.equals("clientdrop"))
  5141. dropClient();
  5142. if(inputString.equals("::dumpmodels"))
  5143. models();
  5144. if(inputString.equals("dumpnpcs"))
  5145. EntityDef.rewriteNpcs();
  5146. if (inputString.startsWith("full")) {
  5147. try {
  5148. String[] args = inputString.split(" ");
  5149. int id1 = Integer.parseInt(args[1]);
  5150. int id2 = Integer.parseInt(args[2]);
  5151. fullscreenInterfaceID = id1;
  5152. openInterfaceID = id2;
  5153. pushMessage("Opened Interface", 0, "");
  5154. } catch (Exception e) {
  5155. pushMessage("Interface Failed to load", 0, "");
  5156. }
  5157. }
  5158. if(inputString.equals("::lag"))
  5159. printDebug();
  5160. if(inputString.equals("::prefetchmusic")) {
  5161. for(int j1 = 0; j1 < onDemandFetcher.getVersionCount(2); j1++)
  5162. onDemandFetcher.method563((byte)1, 2, j1);
  5163.  
  5164. }
  5165. if(inputString.equals("::fpson"))
  5166. fpsOn = true;
  5167. if(inputString.equals("::fpsoff"))
  5168. fpsOn = false;
  5169. if(inputString.equals("::dataon"))
  5170. clientData = true;
  5171. if(inputString.equals("::dataoff"))
  5172. clientData = false;
  5173. if(inputString.equals("::noclip")) {
  5174. for(int k1 = 0; k1 < 4; k1++) {
  5175. for(int i2 = 1; i2 < 103; i2++) {
  5176. for(int k2 = 1; k2 < 103; k2++)
  5177. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5178.  
  5179. }
  5180. }
  5181. }
  5182. }
  5183. if(inputString.startsWith("/"))
  5184. inputString = "::" + inputString;
  5185. if(inputString.equals("add model")) {
  5186. try {
  5187. int ModelIndex = Integer.parseInt(JOptionPane.showInputDialog(this, "Enter model ID", "Model", 3));
  5188. byte[] abyte0 = getModel(ModelIndex);
  5189. if(abyte0 != null && abyte0.length > 0) {
  5190. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  5191. pushMessage("Model: [" + ModelIndex + "] added successfully!", 0, "");
  5192. } else {
  5193. pushMessage("Unable to find the model. "+ModelIndex, 0, "");
  5194. }
  5195. } catch(Exception e) {
  5196. pushMessage("Syntax - ::add model <path>", 0, "");
  5197. }
  5198. }
  5199. if(inputString.startsWith("::")) {
  5200. stream.createFrame(103);
  5201. stream.writeWordBigEndian(inputString.length() - 1);
  5202. stream.writeString(inputString.substring(2));
  5203. } else {
  5204. String s = inputString.toLowerCase();
  5205. int j2 = 0;
  5206. if(s.startsWith("yellow:"))
  5207. {
  5208. j2 = 0;
  5209. inputString = inputString.substring(7);
  5210. } else if(s.startsWith("red:"))
  5211. {
  5212. j2 = 1;
  5213. inputString = inputString.substring(4);
  5214. } else if(s.startsWith("green:"))
  5215. {
  5216. j2 = 2;
  5217. inputString = inputString.substring(6);
  5218. } else if(s.startsWith("cyan:"))
  5219. {
  5220. j2 = 3;
  5221. inputString = inputString.substring(5);
  5222. } else if(s.startsWith("purple:"))
  5223. {
  5224. j2 = 4;
  5225. inputString = inputString.substring(7);
  5226. } else if(s.startsWith("white:"))
  5227. {
  5228. j2 = 5;
  5229. inputString = inputString.substring(6);
  5230. } else if(s.startsWith("flash1:"))
  5231. {
  5232. j2 = 6;
  5233. inputString = inputString.substring(7);
  5234. } else if(s.startsWith("flash2:"))
  5235. {
  5236. j2 = 7;
  5237. inputString = inputString.substring(7);
  5238. } else if(s.startsWith("flash3:"))
  5239. {
  5240. j2 = 8;
  5241. inputString = inputString.substring(7);
  5242. } else if(s.startsWith("glow1:"))
  5243. {
  5244. j2 = 9;
  5245. inputString = inputString.substring(6);
  5246. } else if(s.startsWith("glow2:"))
  5247. {
  5248. j2 = 10;
  5249. inputString = inputString.substring(6);
  5250. } else if(s.startsWith("glow3:"))
  5251. {
  5252. j2 = 11;
  5253. inputString = inputString.substring(6);
  5254. }
  5255. s = inputString.toLowerCase();
  5256. int i3 = 0;
  5257. if(s.startsWith("wave:"))
  5258. {
  5259. i3 = 1;
  5260. inputString = inputString.substring(5);
  5261. } else if(s.startsWith("wave2:"))
  5262. {
  5263. i3 = 2;
  5264. inputString = inputString.substring(6);
  5265. } else if(s.startsWith("shake:"))
  5266. {
  5267. i3 = 3;
  5268. inputString = inputString.substring(6);
  5269. } else if(s.startsWith("scroll:"))
  5270. {
  5271. i3 = 4;
  5272. inputString = inputString.substring(7);
  5273. } else if(s.startsWith("slide:"))
  5274. {
  5275. i3 = 5;
  5276. inputString = inputString.substring(6);
  5277. }
  5278. stream.createFrame(4);
  5279. stream.writeWordBigEndian(0);
  5280. int j3 = stream.currentOffset;
  5281. stream.method425(i3);
  5282. stream.method425(j2);
  5283. aStream_834.currentOffset = 0;
  5284. TextInput.method526(inputString, aStream_834);
  5285. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  5286. stream.writeBytes(stream.currentOffset - j3);
  5287. inputString = TextInput.processText(inputString);
  5288. //inputString = Censor.doCensor(inputString);
  5289. myPlayer.textSpoken = inputString;
  5290. myPlayer.anInt1513 = j2;
  5291. myPlayer.anInt1531 = i3;
  5292. myPlayer.textCycle = 150;
  5293. if(myPrivilege == 2)
  5294. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  5295. else
  5296. if(myPrivilege == 1)
  5297. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  5298. else
  5299. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  5300. if(publicChatMode == 2)
  5301. {
  5302. publicChatMode = 3;
  5303. aBoolean1233 = true;
  5304. stream.createFrame(95);
  5305. stream.writeWordBigEndian(publicChatMode);
  5306. stream.writeWordBigEndian(privateChatMode);
  5307. stream.writeWordBigEndian(tradeMode);
  5308. }
  5309. }
  5310. inputString = "";
  5311. inputTaken = true;
  5312. }
  5313. }
  5314. } while(true);
  5315. }
  5316.  
  5317. private void buildPublicChat(int j)
  5318. {
  5319. int l = 0;
  5320. for(int i1 = 0; i1 < 500; i1++)
  5321. {
  5322. if(chatMessages[i1] == null)
  5323. continue;
  5324. if(chatTypeView != 1)
  5325. continue;
  5326. int j1 = chatTypes[i1];
  5327. String s = chatNames[i1];
  5328. String ct = chatMessages[i1];
  5329. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5330. if(k1 < -23)
  5331. break;
  5332. if(s != null && s.startsWith("@cr1@"))
  5333. s = s.substring(5);
  5334. if(s != null && s.startsWith("@cr2@"))
  5335. s = s.substring(5);
  5336. if(s != null && s.startsWith("@cr3@"))
  5337. s = s.substring(5);
  5338. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5339. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5340. if(myPrivilege >= 1) {
  5341. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5342. menuActionID[menuActionRow] = 606;
  5343. menuActionRow++;
  5344. }
  5345. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5346. menuActionID[menuActionRow] = 42;
  5347. menuActionRow++;
  5348. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5349. menuActionID[menuActionRow] = 337;
  5350. menuActionRow++;
  5351. }
  5352. l++;
  5353. }
  5354. }
  5355. }
  5356.  
  5357. private void buildFriendChat(int j)
  5358. {
  5359. int l = 0;
  5360. for(int i1 = 0; i1 < 500; i1++) {
  5361. if(chatMessages[i1] == null)
  5362. continue;
  5363. if(chatTypeView != 2)
  5364. continue;
  5365. int j1 = chatTypes[i1];
  5366. String s = chatNames[i1];
  5367. String ct = chatMessages[i1];
  5368. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5369. if(k1 < -23)
  5370. break;
  5371. if(s != null && s.startsWith("@cr1@"))
  5372. s = s.substring(5);
  5373. if(s != null && s.startsWith("@cr2@"))
  5374. s = s.substring(5);
  5375. if(s != null && s.startsWith("@cr3@"))
  5376. s = s.substring(5);
  5377. if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5378. l++;
  5379. if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5380. {
  5381. if(j > k1 - 14 && j <= k1) {
  5382. if(myPrivilege >= 1) {
  5383. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5384. menuActionID[menuActionRow] = 606;
  5385. menuActionRow++;
  5386. }
  5387. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5388. menuActionID[menuActionRow] = 42;
  5389. menuActionRow++;
  5390. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5391. menuActionID[menuActionRow] = 337;
  5392. menuActionRow++;
  5393. }
  5394. l++;
  5395. }
  5396. }
  5397. }
  5398.  
  5399. private void buildDuelorTrade(int j) {
  5400. int l = 0;
  5401. for(int i1 = 0; i1 < 500; i1++) {
  5402. if(chatMessages[i1] == null)
  5403. continue;
  5404. if(chatTypeView != 3 && chatTypeView != 4)
  5405. continue;
  5406. int j1 = chatTypes[i1];
  5407. String s = chatNames[i1];
  5408. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5409. if(k1 < -23)
  5410. break;
  5411. if(s != null && s.startsWith("@cr1@"))
  5412. s = s.substring(5);
  5413. if(s != null && s.startsWith("@cr2@"))
  5414. s = s.substring(5);
  5415. if(s != null && s.startsWith("@cr3@"))
  5416. s = s.substring(5);
  5417. if(chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5418. if(j > k1 - 14 && j <= k1) {
  5419. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5420. menuActionID[menuActionRow] = 484;
  5421. menuActionRow++;
  5422. }
  5423. l++;
  5424. }
  5425. if(chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5426. if(j > k1 - 14 && j <= k1) {
  5427. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5428. menuActionID[menuActionRow] = 6;
  5429. menuActionRow++;
  5430. }
  5431. l++;
  5432. }
  5433. if(j1 == 12) {
  5434. if(j > k1 - 14 && j <= k1) {
  5435. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  5436. menuActionID[menuActionRow] = 915;
  5437. menuActionRow++;
  5438. }
  5439. l++;
  5440. }
  5441. }
  5442. }
  5443.  
  5444. private void buildChatAreaMenu(int j) {
  5445. int l = 0;
  5446. int test = 0;
  5447. for(int i1 = 0; i1 < 500; i1++) {
  5448. if(chatMessages[i1] == null)
  5449. continue;
  5450. int j1 = chatTypes[i1];
  5451. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5452. if(k1 < -23)
  5453. break;
  5454. String s = chatNames[i1];
  5455. String ct = chatMessages[i1];
  5456. boolean flag = false;
  5457. if(chatTypeView == 1) {
  5458. buildPublicChat(j);
  5459. break;
  5460. }
  5461. if(chatTypeView == 2) {
  5462. buildFriendChat(j);
  5463. break;
  5464. }
  5465. if(chatTypeView == 3 || chatTypeView == 4) {
  5466. buildDuelorTrade(j);
  5467. break;
  5468. }
  5469. if(chatTypeView == 5) {
  5470. break;
  5471. }
  5472. if(s != null && s.startsWith("@cr1@")) {
  5473. s = s.substring(5);
  5474. boolean flag1 = true;
  5475. byte byte0 = 1;
  5476. }
  5477. if(s != null && s.startsWith("@cr2@")) {
  5478. s = s.substring(5);
  5479. byte byte0 = 2;
  5480. }
  5481. if(s != null && s.startsWith("@cr3@")) {
  5482. s = s.substring(5);
  5483. byte byte0 = 3;
  5484. }
  5485. if(j1 == 0)
  5486. l++;
  5487. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5488. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5489. if(myPrivilege >= 1) {
  5490. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5491. menuActionID[menuActionRow] = 606;
  5492. menuActionRow++;
  5493. }
  5494. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5495. menuActionID[menuActionRow] = 42;
  5496. menuActionRow++;
  5497. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5498. menuActionID[menuActionRow] = 337;
  5499. menuActionRow++;
  5500. }
  5501. l++;
  5502. }
  5503. if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  5504. if(j > k1 - 14 && j <= k1) {
  5505. if(myPrivilege >= 1) {
  5506. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5507. menuActionID[menuActionRow] = 606;
  5508. menuActionRow++;
  5509. }
  5510. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5511. menuActionID[menuActionRow] = 42;
  5512. menuActionRow++;
  5513. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5514. menuActionID[menuActionRow] = 337;
  5515. menuActionRow++;
  5516. }
  5517. l++;
  5518. }
  5519. if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5520. if(j > k1 - 14 && j <= k1) {
  5521. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5522. menuActionID[menuActionRow] = 484;
  5523. menuActionRow++;
  5524. }
  5525. l++;
  5526. }
  5527. if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  5528. l++;
  5529. if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5530. if(j > k1 - 14 && j <= k1) {
  5531. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5532. menuActionID[menuActionRow] = 6;
  5533. menuActionRow++;
  5534. }
  5535. l++;
  5536. }
  5537. }
  5538. }
  5539.  
  5540.  
  5541.  
  5542. private void drawFriendsListOrWelcomeScreen(RSInterface class9)
  5543. {
  5544. int j = class9.contentType;
  5545. if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  5546. {
  5547. if(j == 1 && anInt900 == 0)
  5548. {
  5549. class9.message = "Loading friend list";
  5550. class9.atActionType = 0;
  5551. return;
  5552. }
  5553. if(j == 1 && anInt900 == 1)
  5554. {
  5555. class9.message = "Connecting to friendserver";
  5556. class9.atActionType = 0;
  5557. return;
  5558. }
  5559. if(j == 2 && anInt900 != 2)
  5560. {
  5561. class9.message = "Please wait...";
  5562. class9.atActionType = 0;
  5563. return;
  5564. }
  5565. int k = friendsCount;
  5566. if(anInt900 != 2)
  5567. k = 0;
  5568. if(j > 700)
  5569. j -= 601;
  5570. else
  5571. j--;
  5572. if(j >= k)
  5573. {
  5574. class9.message = "";
  5575. class9.atActionType = 0;
  5576. return;
  5577. } else
  5578. {
  5579. class9.message = friendsList[j];
  5580. class9.atActionType = 1;
  5581. return;
  5582. }
  5583. }
  5584. if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  5585. {
  5586. int l = friendsCount;
  5587. if(anInt900 != 2)
  5588. l = 0;
  5589. if(j > 800)
  5590. j -= 701;
  5591. else
  5592. j -= 101;
  5593. if(j >= l)
  5594. {
  5595. class9.message = "";
  5596. class9.atActionType = 0;
  5597. return;
  5598. }
  5599. if(friendsNodeIDs[j] == 0)
  5600. class9.message = "@red@Offline";
  5601. else if(friendsNodeIDs[j] == nodeID)
  5602. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9)*/;
  5603. else
  5604. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9)*/;
  5605. class9.atActionType = 1;
  5606. return;
  5607. }
  5608. if(j == 203)
  5609. {
  5610. int i1 = friendsCount;
  5611. if(anInt900 != 2)
  5612. i1 = 0;
  5613. class9.scrollMax = i1 * 15 + 20;
  5614. if(class9.scrollMax <= class9.height)
  5615. class9.scrollMax = class9.height + 1;
  5616. return;
  5617. }
  5618. if(j >= 401 && j <= 500)
  5619. {
  5620. if((j -= 401) == 0 && anInt900 == 0)
  5621. {
  5622. class9.message = "Loading ignore list";
  5623. class9.atActionType = 0;
  5624. return;
  5625. }
  5626. if(j == 1 && anInt900 == 0)
  5627. {
  5628. class9.message = "Please wait...";
  5629. class9.atActionType = 0;
  5630. return;
  5631. }
  5632. int j1 = ignoreCount;
  5633. if(anInt900 == 0)
  5634. j1 = 0;
  5635. if(j >= j1)
  5636. {
  5637. class9.message = "";
  5638. class9.atActionType = 0;
  5639. return;
  5640. } else
  5641. {
  5642. class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  5643. class9.atActionType = 1;
  5644. return;
  5645. }
  5646. }
  5647. if(j == 503)
  5648. {
  5649. class9.scrollMax = ignoreCount * 15 + 20;
  5650. if(class9.scrollMax <= class9.height)
  5651. class9.scrollMax = class9.height + 1;
  5652. return;
  5653. }
  5654. if(j == 327)
  5655. {
  5656. class9.modelRotation1 = 150;
  5657. class9.modelRotation2 = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  5658. if(aBoolean1031)
  5659. {
  5660. for(int k1 = 0; k1 < 7; k1++)
  5661. {
  5662. int l1 = anIntArray1065[k1];
  5663. if(l1 >= 0 && !IDK.cache[l1].method537())
  5664. return;
  5665. }
  5666.  
  5667. aBoolean1031 = false;
  5668. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  5669. int i2 = 0;
  5670. for(int j2 = 0; j2 < 7; j2++)
  5671. {
  5672. int k2 = anIntArray1065[j2];
  5673. if(k2 >= 0)
  5674. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2].method538();
  5675. }
  5676.  
  5677. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  5678. for(int l2 = 0; l2 < 5; l2++)
  5679. if(anIntArray990[l2] != 0)
  5680. {
  5681. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5682. if(l2 == 1)
  5683. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5684. }
  5685.  
  5686. model.method469();
  5687. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  5688. model.method479(64, 850, -30, -50, -30, true);
  5689. class9.anInt233 = 5;
  5690. class9.mediaID = 0;
  5691. RSInterface.method208(aBoolean994, model);
  5692. }
  5693. return;
  5694. }
  5695. if(j == 328) {
  5696. RSInterface rsInterface = class9;
  5697. int verticleTilt = 150;
  5698. int animationSpeed = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  5699. rsInterface.modelRotation1 = verticleTilt;
  5700. rsInterface.modelRotation2 = animationSpeed;
  5701. if(aBoolean1031) {
  5702. Model characterDisplay = myPlayer.method452();
  5703. for(int l2 = 0; l2 < 5; l2++)
  5704. if(anIntArray990[l2] != 0) {
  5705. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5706. if(l2 == 1)
  5707. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5708. }
  5709. int staticFrame = myPlayer.anInt1511;
  5710. characterDisplay.method469();
  5711. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  5712. //characterDisplay.method479(64, 850, -30, -50, -30, true);
  5713. rsInterface.anInt233 = 5;
  5714. rsInterface.mediaID = 0;
  5715. RSInterface.method208(aBoolean994, characterDisplay);
  5716. }
  5717. return;
  5718. }
  5719. if(j == 324)
  5720. {
  5721. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  5722. {
  5723. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5724. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5725. }
  5726. if(aBoolean1047)
  5727. {
  5728. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5729. return;
  5730. } else
  5731. {
  5732. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5733. return;
  5734. }
  5735. }
  5736. if(j == 325)
  5737. {
  5738. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  5739. {
  5740. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5741. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5742. }
  5743. if(aBoolean1047)
  5744. {
  5745. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5746. return;
  5747. } else
  5748. {
  5749. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5750. return;
  5751. }
  5752. }
  5753. if(j == 600)
  5754. {
  5755. class9.message = reportAbuseInput;
  5756. if(loopCycle % 20 < 10)
  5757. {
  5758. class9.message += "|";
  5759. return;
  5760. } else
  5761. {
  5762. class9.message += " ";
  5763. return;
  5764. }
  5765. }
  5766. if(j == 613)
  5767. if(myPrivilege >= 1)
  5768. {
  5769. if(canMute)
  5770. {
  5771. class9.textColor = 0xff0000;
  5772. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  5773. } else
  5774. {
  5775. class9.textColor = 0xffffff;
  5776. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  5777. }
  5778. } else
  5779. {
  5780. class9.message = "";
  5781. }
  5782. if(j == 650 || j == 655)
  5783. if(anInt1193 != 0)
  5784. {
  5785. String s;
  5786. if(daysSinceLastLogin == 0)
  5787. s = "earlier today";
  5788. else
  5789. if(daysSinceLastLogin == 1)
  5790. s = "yesterday";
  5791. else
  5792. s = daysSinceLastLogin + " days ago";
  5793. class9.message = "You last logged in " + s + " from: " + signlink.dns;
  5794. } else
  5795. {
  5796. class9.message = "";
  5797. }
  5798. if(j == 651)
  5799. {
  5800. if(unreadMessages == 0)
  5801. {
  5802. class9.message = "0 unread messages";
  5803. class9.textColor = 0xffff00;
  5804. }
  5805. if(unreadMessages == 1)
  5806. {
  5807. class9.message = "1 unread message";
  5808. class9.textColor = 65280;
  5809. }
  5810. if(unreadMessages > 1)
  5811. {
  5812. class9.message = unreadMessages + " unread messages";
  5813. class9.textColor = 65280;
  5814. }
  5815. }
  5816. if(j == 652)
  5817. if(daysSinceRecovChange == 201)
  5818. {
  5819. if(membersInt == 1)
  5820. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  5821. else
  5822. class9.message = "";
  5823. } else
  5824. if(daysSinceRecovChange == 200)
  5825. {
  5826. class9.message = "You have not yet set any password recovery questions.";
  5827. } else
  5828. {
  5829. String s1;
  5830. if(daysSinceRecovChange == 0)
  5831. s1 = "Earlier today";
  5832. else
  5833. if(daysSinceRecovChange == 1)
  5834. s1 = "Yesterday";
  5835. else
  5836. s1 = daysSinceRecovChange + " days ago";
  5837. class9.message = s1 + " you changed your recovery questions";
  5838. }
  5839. if(j == 653)
  5840. if(daysSinceRecovChange == 201)
  5841. {
  5842. if(membersInt == 1)
  5843. class9.message = "@whi@recommend you use a members world instead. You may use";
  5844. else
  5845. class9.message = "";
  5846. } else
  5847. if(daysSinceRecovChange == 200)
  5848. class9.message = "We strongly recommend you do so now to secure your account.";
  5849. else
  5850. class9.message = "If you do not remember making this change then cancel it immediately";
  5851. if(j == 654)
  5852. {
  5853. if(daysSinceRecovChange == 201)
  5854. if(membersInt == 1)
  5855. {
  5856. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  5857. return;
  5858. } else
  5859. {
  5860. class9.message = "";
  5861. return;
  5862. }
  5863. if(daysSinceRecovChange == 200)
  5864. {
  5865. class9.message = "Do this from the 'account management' area on our front webpage";
  5866. return;
  5867. }
  5868. class9.message = "Do this from the 'account management' area on our front webpage";
  5869. }
  5870. }
  5871.  
  5872. private void drawSplitPrivateChat()
  5873. {
  5874. if(splitPrivateChat == 0)
  5875. return;
  5876. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  5877. int i = 0;
  5878. if(anInt1104 != 0)
  5879. i = 1;
  5880. for(int j = 0; j < 100; j++)
  5881. if(chatMessages[j] != null)
  5882. {
  5883. int k = chatTypes[j];
  5884. String s = chatNames[j];
  5885. byte byte1 = 0;
  5886. if(s != null && s.startsWith("@cr1@"))
  5887. {
  5888. s = s.substring(5);
  5889. byte1 = 1;
  5890. }
  5891. if(s != null && s.startsWith("@cr2@"))
  5892. {
  5893. s = s.substring(5);
  5894. byte1 = 2;
  5895. }
  5896. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5897. {
  5898. int l = 329 - i * 13;
  5899. int k1 = 4;
  5900. textDrawingArea.method385(0, "From", l, k1);
  5901. textDrawingArea.method385(65535, "From", l - 1, k1);
  5902. k1 += textDrawingArea.getTextWidth("From ");
  5903. if(byte1 == 1)
  5904. {
  5905. modIcons[0].drawBackground(k1, l - 12);
  5906. k1 += 12;
  5907. }
  5908. if(byte1 == 2)
  5909. {
  5910. modIcons[1].drawBackground(k1, l - 12);
  5911. k1 += 12;
  5912. }
  5913. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  5914. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  5915. if(++i >= 5)
  5916. return;
  5917. }
  5918. if(k == 5 && privateChatMode < 2)
  5919. {
  5920. int i1 = 329 - i * 13;
  5921. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  5922. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  5923. if(++i >= 5)
  5924. return;
  5925. }
  5926. if(k == 6 && privateChatMode < 2)
  5927. {
  5928. int j1 = 329 - i * 13;
  5929. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  5930. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  5931. if(++i >= 5)
  5932. return;
  5933. }
  5934. }
  5935.  
  5936. }
  5937.  
  5938. public void pushMessage(String s, int i, String s1) {
  5939. if(i == 0 && dialogID != -1) {
  5940. aString844 = s;
  5941. super.clickMode3 = 0;
  5942. }
  5943. if(backDialogID == -1)
  5944. inputTaken = true;
  5945. for(int j = 499; j > 0; j--) {
  5946. chatTypes[j] = chatTypes[j - 1];
  5947. chatNames[j] = chatNames[j - 1];
  5948. chatMessages[j] = chatMessages[j - 1];
  5949. chatRights[j] = chatRights[j - 1];
  5950. }
  5951. chatTypes[0] = i;
  5952. chatNames[0] = s1;
  5953. chatMessages[0] = s;
  5954. chatRights[0] = rights;
  5955. }
  5956.  
  5957. public static void setTab(int id) {
  5958. needDrawTabArea = true;
  5959. tabID = id;
  5960. tabAreaAltered = true;
  5961. }
  5962.  
  5963. private void processTabClick() {
  5964. if(super.clickMode3 == 1) {
  5965. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  5966. {
  5967. needDrawTabArea = true;
  5968. tabID = 0;
  5969. tabAreaAltered = true;
  5970. }
  5971. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  5972. {
  5973. needDrawTabArea = true;
  5974. tabID = 1;
  5975. tabAreaAltered = true;
  5976. }
  5977. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  5978. {
  5979. needDrawTabArea = true;
  5980. tabID = 2;
  5981. tabAreaAltered = true;
  5982. }
  5983. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  5984. {
  5985. needDrawTabArea = true;
  5986. tabID = 3;
  5987. tabAreaAltered = true;
  5988. }
  5989. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  5990. {
  5991. needDrawTabArea = true;
  5992. tabID = 4;
  5993. tabAreaAltered = true;
  5994. }
  5995. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  5996. {
  5997. needDrawTabArea = true;
  5998. tabID = 5;
  5999. tabAreaAltered = true;
  6000. }
  6001. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  6002. {
  6003. needDrawTabArea = true;
  6004. tabID = 6;
  6005. tabAreaAltered = true;
  6006. }
  6007. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  6008. {
  6009. needDrawTabArea = true;
  6010. tabID = 7;
  6011. tabAreaAltered = true;
  6012. }
  6013. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  6014. {
  6015. needDrawTabArea = true;
  6016. tabID = 8;
  6017. tabAreaAltered = true;
  6018. }
  6019. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  6020. {
  6021. needDrawTabArea = true;
  6022. tabID = 9;
  6023. tabAreaAltered = true;
  6024. }
  6025. if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[10] != -1)
  6026. {
  6027. needDrawTabArea = true;
  6028. tabID = 10;
  6029. tabAreaAltered = true;
  6030. }
  6031. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  6032. {
  6033. needDrawTabArea = true;
  6034. tabID = 11;
  6035. tabAreaAltered = true;
  6036. }
  6037. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  6038. {
  6039. needDrawTabArea = true;
  6040. tabID = 12;
  6041. tabAreaAltered = true;
  6042. }
  6043. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  6044. {
  6045. needDrawTabArea = true;
  6046. tabID = 13;
  6047. tabAreaAltered = true;
  6048. }
  6049. }
  6050. }
  6051.  
  6052. private void resetImageProducers2() {
  6053. if(aRSImageProducer_1166 != null)
  6054. return;
  6055. nullLoader();
  6056. super.fullGameScreen = null;
  6057. aRSImageProducer_1107 = null;
  6058. aRSImageProducer_1108 = null;
  6059. aRSImageProducer_1109 = null;
  6060. aRSImageProducer_1110 = null;
  6061. aRSImageProducer_1111 = null;
  6062. aRSImageProducer_1112 = null;
  6063. aRSImageProducer_1113 = null;
  6064. aRSImageProducer_1114 = null;
  6065. aRSImageProducer_1115 = null;
  6066. aRSImageProducer_1166 = new RSImageProducer(519, 165, getGameComponent());
  6067. aRSImageProducer_1164 = new RSImageProducer(246, 164, getGameComponent());
  6068. DrawingArea.setAllPixelsToZero();
  6069. mapBack.drawBackground(0, 0);
  6070. aRSImageProducer_1163 = new RSImageProducer(246, 335, getGameComponent());
  6071. aRSImageProducer_1165 = new RSImageProducer(512, 334, getGameComponent());
  6072. DrawingArea.setAllPixelsToZero();
  6073. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  6074. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  6075. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  6076. welcomeScreenRaised = true;
  6077. }
  6078.  
  6079. public String getDocumentBaseHost() {
  6080. if (signlink.mainapp != null) {
  6081. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  6082. }
  6083. if (super.gameFrame != null) {
  6084. return ""; // websitehere.com <- removed for Jframe to work
  6085. } else {
  6086. return ""; // super.getDocumentBase().getHost().toLowerCase() <- removed for Jframe to work
  6087. }
  6088. }
  6089.  
  6090. private void method81(Sprite sprite, int j, int k) {
  6091. int l = k * k + j * j;
  6092. if(l > 4225 && l < 0x15f90) {
  6093. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  6094. int j1 = Model.modelIntArray1[i1];
  6095. int k1 = Model.modelIntArray2[i1];
  6096. j1 = (j1 * 256) / (minimapInt3 + 256);
  6097. k1 = (k1 * 256) / (minimapInt3 + 256);
  6098. int l1 = j * j1 + k * k1 >> 16;
  6099. int i2 = j * k1 - k * j1 >> 16;
  6100. double d = Math.atan2(l1, i2);
  6101. int j2 = (int)(Math.sin(d) * 63D);
  6102. int k2 = (int)(Math.cos(d) * 57D);
  6103. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  6104. } else {
  6105. markMinimap(sprite, k, j);
  6106. }
  6107. }
  6108.  
  6109. private void rightClickChatButtons() {
  6110. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  6111. menuActionName[1] = "View All";
  6112. menuActionID[1] = 999;
  6113. menuActionRow = 2;
  6114. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  6115. menuActionName[1] = "View Game";
  6116. menuActionID[1] = 998;
  6117. menuActionRow = 2;
  6118. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  6119. menuActionName[1] = "Hide public";
  6120. menuActionID[1] = 997;
  6121. menuActionName[2] = "Off public";
  6122. menuActionID[2] = 996;
  6123. menuActionName[3] = "Friends public";
  6124. menuActionID[3] = 995;
  6125. menuActionName[4] = "On public";
  6126. menuActionID[4] = 994;
  6127. menuActionName[5] = "View public";
  6128. menuActionID[5] = 993;
  6129. menuActionRow = 6;
  6130. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  6131. menuActionName[1] = "Off private";
  6132. menuActionID[1] = 992;
  6133. menuActionName[2] = "Friends private";
  6134. menuActionID[2] = 991;
  6135. menuActionName[3] = "On private";
  6136. menuActionID[3] = 990;
  6137. menuActionName[4] = "View private";
  6138. menuActionID[4] = 989;
  6139. menuActionRow = 5;
  6140. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  6141. menuActionName[1] = "Off clan chat";
  6142. menuActionID[1] = 1003;
  6143. menuActionName[2] = "Friends clan chat";
  6144. menuActionID[2] = 1002;
  6145. menuActionName[3] = "On clan chat";
  6146. menuActionID[3] = 1001;
  6147. menuActionName[4] = "View clan chat";
  6148. menuActionID[4] = 1000;
  6149. menuActionRow = 5;
  6150. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  6151. menuActionName[1] = "Off trade";
  6152. menuActionID[1] = 987;
  6153. menuActionName[2] = "Friends trade";
  6154. menuActionID[2] = 986;
  6155. menuActionName[3] = "On trade";
  6156. menuActionID[3] = 985;
  6157. menuActionName[4] = "View trade";
  6158. menuActionID[4] = 984;
  6159. menuActionRow = 5;
  6160. }
  6161. }
  6162.  
  6163. public void processRightClick() {
  6164. if (activeInterfaceType != 0) {
  6165. return;
  6166. }
  6167. menuActionName[0] = "Back";
  6168. menuActionID[0] = 1107;
  6169. menuActionRow = 1;
  6170. if (fullscreenInterfaceID != -1) {
  6171. anInt886 = 0;
  6172. anInt1315 = 0;
  6173. buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  6174. if (anInt886 != anInt1026) {
  6175. anInt1026 = anInt886;
  6176. }
  6177. if (anInt1315 != anInt1129) {
  6178. anInt1129 = anInt1315;
  6179. }
  6180. return;
  6181. }
  6182. buildSplitPrivateChatMenu();
  6183. anInt886 = 0;
  6184. anInt1315 = 0;
  6185. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338) {
  6186. if (openInterfaceID != -1) {
  6187. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  6188. } else {
  6189. build3dScreenMenu();
  6190. }
  6191. }
  6192. if (anInt886 != anInt1026) {
  6193. anInt1026 = anInt886;
  6194. }
  6195. if (anInt1315 != anInt1129) {
  6196. anInt1129 = anInt1315;
  6197. }
  6198. anInt886 = 0;
  6199. anInt1315 = 0;
  6200. if(super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468) {
  6201. if(invOverlayInterfaceID != -1) {
  6202. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  6203. } else if(tabInterfaceIDs[tabID] != -1) {
  6204. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  6205. }
  6206. }
  6207. if (anInt886 != anInt1048) {
  6208. needDrawTabArea = true;
  6209. tabAreaAltered = true;
  6210. anInt1048 = anInt886;
  6211. }
  6212. if (anInt1315 != anInt1044) {
  6213. needDrawTabArea = true;
  6214. tabAreaAltered = true;
  6215. anInt1044 = anInt1315;
  6216. }
  6217. anInt886 = 0;
  6218. anInt1315 = 0;
  6219. if(super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  6220. if(backDialogID != -1) {
  6221. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  6222. } else if(super.mouseY < 463 && super.mouseX < 490) {
  6223. buildChatAreaMenu(super.mouseY - 338);
  6224. }
  6225. }
  6226. if (backDialogID != -1 && anInt886 != anInt1039) {
  6227. inputTaken = true;
  6228. anInt1039 = anInt886;
  6229. }
  6230. if (backDialogID != -1 && anInt1315 != anInt1500) {
  6231. inputTaken = true;
  6232. anInt1500 = anInt1315;
  6233. }
  6234. /* Enable custom right click areas */
  6235. if(super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 && super.mouseY < 503)
  6236. rightClickChatButtons();
  6237. /**/
  6238. boolean flag = false;
  6239. while (!flag) {
  6240. flag = true;
  6241. for (int j = 0; j < menuActionRow - 1; j++) {
  6242. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  6243. String s = menuActionName[j];
  6244. menuActionName[j] = menuActionName[j + 1];
  6245. menuActionName[j + 1] = s;
  6246. int k = menuActionID[j];
  6247. menuActionID[j] = menuActionID[j + 1];
  6248. menuActionID[j + 1] = k;
  6249. k = menuActionCmd2[j];
  6250. menuActionCmd2[j] = menuActionCmd2[j + 1];
  6251. menuActionCmd2[j + 1] = k;
  6252. k = menuActionCmd3[j];
  6253. menuActionCmd3[j] = menuActionCmd3[j + 1];
  6254. menuActionCmd3[j + 1] = k;
  6255. k = menuActionCmd1[j];
  6256. menuActionCmd1[j] = menuActionCmd1[j + 1];
  6257. menuActionCmd1[j + 1] = k;
  6258. flag = false;
  6259. }
  6260. }
  6261. }
  6262. }
  6263.  
  6264. private int method83(int i, int j, int k)
  6265. {
  6266. int l = 256 - k;
  6267. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  6268. }
  6269.  
  6270. private void login(String s, String s1, boolean flag)
  6271. {
  6272. signlink.errorname = s;
  6273. try
  6274. {
  6275. if(!flag)
  6276. {
  6277. loginMessage1 = "";
  6278. loginMessage2 = "Connecting to server...";
  6279. drawLoginScreen(true);
  6280. }
  6281. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  6282. long l = TextClass.longForName(s);
  6283. int i = (int)(l >> 16 & 31L);
  6284. stream.currentOffset = 0;
  6285. stream.writeWordBigEndian(14);
  6286. stream.writeWordBigEndian(i);
  6287. socketStream.queueBytes(2, stream.buffer);
  6288. for(int j = 0; j < 8; j++)
  6289. socketStream.read();
  6290.  
  6291. int k = socketStream.read();
  6292. int i1 = k;
  6293. if(k == 0)
  6294. {
  6295. socketStream.flushInputStream(inStream.buffer, 8);
  6296. inStream.currentOffset = 0;
  6297. aLong1215 = inStream.readQWord();
  6298. int ai[] = new int[4];
  6299. ai[0] = (int)(Math.random() * 99999999D);
  6300. ai[1] = (int)(Math.random() * 99999999D);
  6301. ai[2] = (int)(aLong1215 >> 32);
  6302. ai[3] = (int)aLong1215;
  6303. stream.currentOffset = 0;
  6304. stream.writeWordBigEndian(10);
  6305. stream.writeDWord(ai[0]);
  6306. stream.writeDWord(ai[1]);
  6307. stream.writeDWord(ai[2]);
  6308. stream.writeDWord(ai[3]);
  6309. stream.writeDWord(/*signlink.uid*/999999);
  6310. stream.writeString(s);
  6311. stream.writeString(s1);
  6312. stream.doKeys();
  6313. aStream_847.currentOffset = 0;
  6314. if(flag)
  6315. aStream_847.writeWordBigEndian(18);
  6316. else
  6317. aStream_847.writeWordBigEndian(16);
  6318. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  6319. aStream_847.writeWordBigEndian(255);
  6320. aStream_847.writeWord(317);
  6321. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  6322. for(int l1 = 0; l1 < 9; l1++)
  6323. aStream_847.writeDWord(expectedCRCs[l1]);
  6324.  
  6325. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  6326. stream.encryption = new ISAACRandomGen(ai);
  6327. for(int j2 = 0; j2 < 4; j2++)
  6328. ai[j2] += 50;
  6329.  
  6330. encryption = new ISAACRandomGen(ai);
  6331. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  6332. k = socketStream.read();
  6333. }
  6334. if(k == 1)
  6335. {
  6336. try
  6337. {
  6338. Thread.sleep(2000L);
  6339. }
  6340. catch(Exception _ex) { }
  6341. login(s, s1, flag);
  6342. return;
  6343. }
  6344. if(k == 2)
  6345. {
  6346. myPrivilege = socketStream.read();
  6347. flagged = socketStream.read() == 1;
  6348. aLong1220 = 0L;
  6349. anInt1022 = 0;
  6350. mouseDetection.coordsIndex = 0;
  6351. super.awtFocus = true;
  6352. aBoolean954 = true;
  6353. loggedIn = true;
  6354. stream.currentOffset = 0;
  6355. inStream.currentOffset = 0;
  6356. pktType = -1;
  6357. anInt841 = -1;
  6358. anInt842 = -1;
  6359. anInt843 = -1;
  6360. pktSize = 0;
  6361. anInt1009 = 0;
  6362. anInt1104 = 0;
  6363. anInt1011 = 0;
  6364. anInt855 = 0;
  6365. menuActionRow = 0;
  6366. menuOpen = false;
  6367. super.idleTime = 0;
  6368. for(int j1 = 0; j1 < 100; j1++)
  6369. chatMessages[j1] = null;
  6370.  
  6371. itemSelected = 0;
  6372. spellSelected = 0;
  6373. loadingStage = 0;
  6374. anInt1062 = 0;
  6375. anInt1278 = (int)(Math.random() * 100D) - 50;
  6376. anInt1131 = (int)(Math.random() * 110D) - 55;
  6377. anInt896 = (int)(Math.random() * 80D) - 40;
  6378. minimapInt2 = (int)(Math.random() * 120D) - 60;
  6379. minimapInt3 = (int)(Math.random() * 30D) - 20;
  6380. minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
  6381. anInt1021 = 0;
  6382. anInt985 = -1;
  6383. destX = 0;
  6384. destY = 0;
  6385. playerCount = 0;
  6386. npcCount = 0;
  6387. for(int i2 = 0; i2 < maxPlayers; i2++)
  6388. {
  6389. playerArray[i2] = null;
  6390. aStreamArray895s[i2] = null;
  6391. }
  6392.  
  6393. for(int k2 = 0; k2 < 16384; k2++)
  6394. npcArray[k2] = null;
  6395.  
  6396. myPlayer = playerArray[myPlayerIndex] = new Player();
  6397. aClass19_1013.removeAll();
  6398. aClass19_1056.removeAll();
  6399. for(int l2 = 0; l2 < 4; l2++)
  6400. {
  6401. for(int i3 = 0; i3 < 104; i3++)
  6402. {
  6403. for(int k3 = 0; k3 < 104; k3++)
  6404. groundArray[l2][i3][k3] = null;
  6405.  
  6406. }
  6407.  
  6408. }
  6409.  
  6410. aClass19_1179 = new NodeList();
  6411. fullscreenInterfaceID = -1;
  6412. anInt900 = 0;
  6413. friendsCount = 0;
  6414. dialogID = -1;
  6415. backDialogID = -1;
  6416. openInterfaceID = -1;
  6417. invOverlayInterfaceID = -1;
  6418. anInt1018 = -1;
  6419. aBoolean1149 = false;
  6420. tabID = 3;
  6421. inputDialogState = 0;
  6422. menuOpen = false;
  6423. messagePromptRaised = false;
  6424. aString844 = null;
  6425. anInt1055 = 0;
  6426. anInt1054 = -1;
  6427. aBoolean1047 = true;
  6428. method45();
  6429. for(int j3 = 0; j3 < 5; j3++)
  6430. anIntArray990[j3] = 0;
  6431.  
  6432. for(int l3 = 0; l3 < 5; l3++)
  6433. {
  6434. atPlayerActions[l3] = null;
  6435. atPlayerArray[l3] = false;
  6436. }
  6437.  
  6438. anInt1175 = 0;
  6439. anInt1134 = 0;
  6440. anInt986 = 0;
  6441. anInt1288 = 0;
  6442. anInt924 = 0;
  6443. anInt1188 = 0;
  6444. anInt1155 = 0;
  6445. anInt1226 = 0;
  6446. int anInt941 = 0;
  6447. int anInt1260 = 0;
  6448. resetImageProducers2();
  6449. return;
  6450. }
  6451. if(k == 3)
  6452. {
  6453. loginMessage1 = "";
  6454. loginMessage2 = "Invalid username or password.";
  6455. return;
  6456. }
  6457. if(k == 4)
  6458. {
  6459. loginMessage1 = "Your account has been disabled.";
  6460. loginMessage2 = "Please check your message-center for details.";
  6461. return;
  6462. }
  6463. if(k == 5)
  6464. {
  6465. loginMessage1 = "Your account is already logged in.";
  6466. loginMessage2 = "Try again in 60 secs...";
  6467. return;
  6468. }
  6469. if(k == 6)
  6470. {
  6471. loginMessage1 = "RuneScape has been updated!";
  6472. loginMessage2 = "Please reload this page.";
  6473. return;
  6474. }
  6475. if(k == 7)
  6476. {
  6477. loginMessage1 = "This world is full.";
  6478. loginMessage2 = "Please use a different world.";
  6479. return;
  6480. }
  6481. if(k == 8)
  6482. {
  6483. loginMessage1 = "Unable to connect.";
  6484. loginMessage2 = "Login server offline.";
  6485. return;
  6486. }
  6487. if(k == 9)
  6488. {
  6489. loginMessage1 = "Login limit exceeded.";
  6490. loginMessage2 = "Too many connections from your address.";
  6491. return;
  6492. }
  6493. if(k == 10)
  6494. {
  6495. loginMessage1 = "Unable to connect.";
  6496. loginMessage2 = "Bad session id.";
  6497. return;
  6498. }
  6499. if(k == 11)
  6500. {
  6501. loginMessage2 = "Login server rejected session.";
  6502. loginMessage2 = "Please try again.";
  6503. return;
  6504. }
  6505. if(k == 12)
  6506. {
  6507. loginMessage1 = "You need a members account to login to this world.";
  6508. loginMessage2 = "Please subscribe, or use a different world.";
  6509. return;
  6510. }
  6511. if(k == 13)
  6512. {
  6513. loginMessage1 = "Could not complete login.";
  6514. loginMessage2 = "Please try using a different world.";
  6515. return;
  6516. }
  6517. if(k == 14)
  6518. {
  6519. loginMessage1 = "The server is being updated.";
  6520. loginMessage2 = "Please wait 1 minute and try again.";
  6521. return;
  6522. }
  6523. if(k == 15)
  6524. {
  6525. loggedIn = true;
  6526. stream.currentOffset = 0;
  6527. inStream.currentOffset = 0;
  6528. pktType = -1;
  6529. anInt841 = -1;
  6530. anInt842 = -1;
  6531. anInt843 = -1;
  6532. pktSize = 0;
  6533. anInt1009 = 0;
  6534. anInt1104 = 0;
  6535. menuActionRow = 0;
  6536. menuOpen = false;
  6537. aLong824 = System.currentTimeMillis();
  6538. return;
  6539. }
  6540. if(k == 16)
  6541. {
  6542. loginMessage1 = "Login attempts exceeded.";
  6543. loginMessage2 = "Please wait 1 minute and try again.";
  6544. return;
  6545. }
  6546. if(k == 17)
  6547. {
  6548. loginMessage1 = "You are standing in a members-only area.";
  6549. loginMessage2 = "To play on this world move to a free area first";
  6550. return;
  6551. }
  6552. if(k == 20)
  6553. {
  6554. loginMessage1 = "Invalid loginserver requested";
  6555. loginMessage2 = "Please try using a different world.";
  6556. return;
  6557. }
  6558. if(k == 21)
  6559. {
  6560. for(int k1 = socketStream.read(); k1 >= 0; k1--)
  6561. {
  6562. loginMessage1 = "You have only just left another world";
  6563. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  6564. drawLoginScreen(true);
  6565. try
  6566. {
  6567. Thread.sleep(1000L);
  6568. }
  6569. catch(Exception _ex) { }
  6570. }
  6571.  
  6572. login(s, s1, flag);
  6573. return;
  6574. }
  6575. if(k == -1)
  6576. {
  6577. if(i1 == 0)
  6578. {
  6579. if(loginFailures < 2)
  6580. {
  6581. try
  6582. {
  6583. Thread.sleep(2000L);
  6584. }
  6585. catch(Exception _ex) { }
  6586. loginFailures++;
  6587. login(s, s1, flag);
  6588. return;
  6589. } else
  6590. {
  6591. loginMessage1 = "No response from loginserver";
  6592. loginMessage2 = "Please wait 1 minute and try again.";
  6593. return;
  6594. }
  6595. } else
  6596. {
  6597. loginMessage1 = "No response from server";
  6598. loginMessage2 = "Please try using a different world.";
  6599. return;
  6600. }
  6601. } else
  6602. {
  6603. System.out.println("response:" + k);
  6604. loginMessage1 = "Unexpected server response";
  6605. loginMessage2 = "Please try using a different world.";
  6606. return;
  6607. }
  6608. }
  6609. catch(IOException _ex)
  6610. {
  6611. loginMessage1 = "";
  6612. }
  6613. loginMessage2 = "Error connecting to server.";
  6614. }
  6615.  
  6616. 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) {
  6617. byte byte0 = 104;
  6618. byte byte1 = 104;
  6619. for(int l2 = 0; l2 < byte0; l2++) {
  6620. for(int i3 = 0; i3 < byte1; i3++) {
  6621. anIntArrayArray901[l2][i3] = 0;
  6622. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  6623. }
  6624. }
  6625. int j3 = j2;
  6626. int k3 = j1;
  6627. anIntArrayArray901[j2][j1] = 99;
  6628. anIntArrayArray825[j2][j1] = 0;
  6629. int l3 = 0;
  6630. int i4 = 0;
  6631. bigX[l3] = j2;
  6632. bigY[l3++] = j1;
  6633. boolean flag1 = false;
  6634. int j4 = bigX.length;
  6635. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  6636. while(i4 != l3)
  6637. {
  6638. j3 = bigX[i4];
  6639. k3 = bigY[i4];
  6640. i4 = (i4 + 1) % j4;
  6641. if(j3 == k2 && k3 == i2)
  6642. {
  6643. flag1 = true;
  6644. break;
  6645. }
  6646. if(i1 != 0)
  6647. {
  6648. if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  6649. {
  6650. flag1 = true;
  6651. break;
  6652. }
  6653. if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  6654. {
  6655. flag1 = true;
  6656. break;
  6657. }
  6658. }
  6659. if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  6660. {
  6661. flag1 = true;
  6662. break;
  6663. }
  6664. int l4 = anIntArrayArray825[j3][k3] + 1;
  6665. if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  6666. {
  6667. bigX[l3] = j3 - 1;
  6668. bigY[l3] = k3;
  6669. l3 = (l3 + 1) % j4;
  6670. anIntArrayArray901[j3 - 1][k3] = 2;
  6671. anIntArrayArray825[j3 - 1][k3] = l4;
  6672. }
  6673. if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  6674. {
  6675. bigX[l3] = j3 + 1;
  6676. bigY[l3] = k3;
  6677. l3 = (l3 + 1) % j4;
  6678. anIntArrayArray901[j3 + 1][k3] = 8;
  6679. anIntArrayArray825[j3 + 1][k3] = l4;
  6680. }
  6681. if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  6682. {
  6683. bigX[l3] = j3;
  6684. bigY[l3] = k3 - 1;
  6685. l3 = (l3 + 1) % j4;
  6686. anIntArrayArray901[j3][k3 - 1] = 1;
  6687. anIntArrayArray825[j3][k3 - 1] = l4;
  6688. }
  6689. if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  6690. {
  6691. bigX[l3] = j3;
  6692. bigY[l3] = k3 + 1;
  6693. l3 = (l3 + 1) % j4;
  6694. anIntArrayArray901[j3][k3 + 1] = 4;
  6695. anIntArrayArray825[j3][k3 + 1] = l4;
  6696. }
  6697. 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)
  6698. {
  6699. bigX[l3] = j3 - 1;
  6700. bigY[l3] = k3 - 1;
  6701. l3 = (l3 + 1) % j4;
  6702. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  6703. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  6704. }
  6705. 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)
  6706. {
  6707. bigX[l3] = j3 + 1;
  6708. bigY[l3] = k3 - 1;
  6709. l3 = (l3 + 1) % j4;
  6710. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  6711. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  6712. }
  6713. 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)
  6714. {
  6715. bigX[l3] = j3 - 1;
  6716. bigY[l3] = k3 + 1;
  6717. l3 = (l3 + 1) % j4;
  6718. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  6719. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  6720. }
  6721. 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)
  6722. {
  6723. bigX[l3] = j3 + 1;
  6724. bigY[l3] = k3 + 1;
  6725. l3 = (l3 + 1) % j4;
  6726. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  6727. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  6728. }
  6729. }
  6730. anInt1264 = 0;
  6731. if(!flag1)
  6732. {
  6733. if(flag)
  6734. {
  6735. int i5 = 100;
  6736. for(int k5 = 1; k5 < 2; k5++)
  6737. {
  6738. for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  6739. {
  6740. for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  6741. if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  6742. {
  6743. i5 = anIntArrayArray825[i6][l6];
  6744. j3 = i6;
  6745. k3 = l6;
  6746. anInt1264 = 1;
  6747. flag1 = true;
  6748. }
  6749.  
  6750. }
  6751.  
  6752. if(flag1)
  6753. break;
  6754. }
  6755.  
  6756. }
  6757. if(!flag1)
  6758. return false;
  6759. }
  6760. i4 = 0;
  6761. bigX[i4] = j3;
  6762. bigY[i4++] = k3;
  6763. int l5;
  6764. for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  6765. {
  6766. if(j5 != l5)
  6767. {
  6768. l5 = j5;
  6769. bigX[i4] = j3;
  6770. bigY[i4++] = k3;
  6771. }
  6772. if((j5 & 2) != 0)
  6773. j3++;
  6774. else
  6775. if((j5 & 8) != 0)
  6776. j3--;
  6777. if((j5 & 1) != 0)
  6778. k3++;
  6779. else
  6780. if((j5 & 4) != 0)
  6781. k3--;
  6782. }
  6783. // if(cancelWalk) { return i4 > 0; }
  6784.  
  6785.  
  6786. if(i4 > 0)
  6787. {
  6788. int k4 = i4;
  6789. if(k4 > 25)
  6790. k4 = 25;
  6791. i4--;
  6792. int k6 = bigX[i4];
  6793. int i7 = bigY[i4];
  6794. anInt1288 += k4;
  6795. if(anInt1288 >= 92)
  6796. {
  6797. stream.createFrame(36);
  6798. stream.writeDWord(0);
  6799. anInt1288 = 0;
  6800. }
  6801. if(i == 0)
  6802. {
  6803. stream.createFrame(164);
  6804. stream.writeWordBigEndian(k4 + k4 + 3);
  6805. }
  6806. if(i == 1)
  6807. {
  6808. stream.createFrame(248);
  6809. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  6810. }
  6811. if(i == 2)
  6812. {
  6813. stream.createFrame(98);
  6814. stream.writeWordBigEndian(k4 + k4 + 3);
  6815. }
  6816. stream.method433(k6 + baseX);
  6817. destX = bigX[0];
  6818. destY = bigY[0];
  6819. for(int j7 = 1; j7 < k4; j7++)
  6820. {
  6821. i4--;
  6822. stream.writeWordBigEndian(bigX[i4] - k6);
  6823. stream.writeWordBigEndian(bigY[i4] - i7);
  6824. }
  6825.  
  6826. stream.method431(i7 + baseY);
  6827. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  6828. return true;
  6829. }
  6830. return i != 1;
  6831. }
  6832.  
  6833. private void method86(Stream stream)
  6834. {
  6835. for(int j = 0; j < anInt893; j++)
  6836. {
  6837. int k = anIntArray894[j];
  6838. NPC npc = npcArray[k];
  6839. int l = stream.readUnsignedByte();
  6840. if((l & 0x10) != 0)
  6841. {
  6842. int i1 = stream.method434();
  6843. if(i1 == 65535)
  6844. i1 = -1;
  6845. int i2 = stream.readUnsignedByte();
  6846. if(i1 == npc.anim && i1 != -1)
  6847. {
  6848. int l2 = Animation.anims[i1].anInt365;
  6849. if(l2 == 1)
  6850. {
  6851. npc.anInt1527 = 0;
  6852. npc.anInt1528 = 0;
  6853. npc.anInt1529 = i2;
  6854. npc.anInt1530 = 0;
  6855. }
  6856. if(l2 == 2)
  6857. npc.anInt1530 = 0;
  6858. } else
  6859. if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  6860. {
  6861. npc.anim = i1;
  6862. npc.anInt1527 = 0;
  6863. npc.anInt1528 = 0;
  6864. npc.anInt1529 = i2;
  6865. npc.anInt1530 = 0;
  6866. npc.anInt1542 = npc.smallXYIndex;
  6867. }
  6868. }
  6869. if((l & 8) != 0)
  6870. {
  6871. int j1 = stream.method426();
  6872. int j2 = stream.method427();
  6873. npc.updateHitData(j2, j1, loopCycle);
  6874. npc.loopCycleStatus = loopCycle + 300;
  6875. npc.currentHealth = stream.method426();
  6876. npc.maxHealth = stream.readUnsignedByte();
  6877. }
  6878. if((l & 0x80) != 0)
  6879. {
  6880. npc.anInt1520 = stream.readUnsignedWord();
  6881. int k1 = stream.readDWord();
  6882. npc.anInt1524 = k1 >> 16;
  6883. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  6884. npc.anInt1521 = 0;
  6885. npc.anInt1522 = 0;
  6886. if(npc.anInt1523 > loopCycle)
  6887. npc.anInt1521 = -1;
  6888. if(npc.anInt1520 == 65535)
  6889. npc.anInt1520 = -1;
  6890. }
  6891. if((l & 0x20) != 0)
  6892. {
  6893. npc.interactingEntity = stream.readUnsignedWord();
  6894. if(npc.interactingEntity == 65535)
  6895. npc.interactingEntity = -1;
  6896. }
  6897. if((l & 1) != 0)
  6898. {
  6899. npc.textSpoken = stream.readString();
  6900. npc.textCycle = 100;
  6901. // entityMessage(npc);
  6902.  
  6903. }
  6904. if((l & 0x40) != 0)
  6905. {
  6906. int l1 = stream.method427();
  6907. int k2 = stream.method428();
  6908. npc.updateHitData(k2, l1, loopCycle);
  6909. npc.loopCycleStatus = loopCycle + 300;
  6910. npc.currentHealth = stream.method428();
  6911. npc.maxHealth = stream.method427();
  6912. }
  6913. if((l & 2) != 0)
  6914. {
  6915. npc.desc = EntityDef.forID(stream.method436());
  6916. npc.anInt1540 = npc.desc.aByte68;
  6917. npc.anInt1504 = npc.desc.anInt79;
  6918. npc.anInt1554 = npc.desc.walkAnim;
  6919. npc.anInt1555 = npc.desc.anInt58;
  6920. npc.anInt1556 = npc.desc.anInt83;
  6921. npc.anInt1557 = npc.desc.anInt55;
  6922. npc.anInt1511 = npc.desc.standAnim;
  6923. }
  6924. if((l & 4) != 0)
  6925. {
  6926. npc.anInt1538 = stream.method434();
  6927. npc.anInt1539 = stream.method434();
  6928. }
  6929. }
  6930. }
  6931.  
  6932. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  6933. {
  6934. if(menuActionRow >= 400)
  6935. return;
  6936. if(entityDef.childrenIDs != null)
  6937. entityDef = entityDef.method161();
  6938. if(entityDef == null)
  6939. return;
  6940. if(!entityDef.aBoolean84)
  6941. return;
  6942. String s = entityDef.name;
  6943. if(entityDef.combatLevel != 0)
  6944. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  6945. if(itemSelected == 1)
  6946. {
  6947. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  6948. menuActionID[menuActionRow] = 582;
  6949. menuActionCmd1[menuActionRow] = i;
  6950. menuActionCmd2[menuActionRow] = k;
  6951. menuActionCmd3[menuActionRow] = j;
  6952. menuActionRow++;
  6953. return;
  6954. }
  6955. if(spellSelected == 1)
  6956. {
  6957. if((spellUsableOn & 2) == 2)
  6958. {
  6959. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  6960. menuActionID[menuActionRow] = 413;
  6961. menuActionCmd1[menuActionRow] = i;
  6962. menuActionCmd2[menuActionRow] = k;
  6963. menuActionCmd3[menuActionRow] = j;
  6964. menuActionRow++;
  6965. }
  6966. } else
  6967. {
  6968. if(entityDef.actions != null)
  6969. {
  6970. for(int l = 4; l >= 0; l--)
  6971. if(entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack"))
  6972. {
  6973. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  6974. if(l == 0)
  6975. menuActionID[menuActionRow] = 20;
  6976. if(l == 1)
  6977. menuActionID[menuActionRow] = 412;
  6978. if(l == 2)
  6979. menuActionID[menuActionRow] = 225;
  6980. if(l == 3)
  6981. menuActionID[menuActionRow] = 965;
  6982. if(l == 4)
  6983. menuActionID[menuActionRow] = 478;
  6984. menuActionCmd1[menuActionRow] = i;
  6985. menuActionCmd2[menuActionRow] = k;
  6986. menuActionCmd3[menuActionRow] = j;
  6987. menuActionRow++;
  6988. }
  6989.  
  6990. }
  6991. if(entityDef.actions != null)
  6992. {
  6993. for(int i1 = 4; i1 >= 0; i1--)
  6994. if(entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack"))
  6995. {
  6996. char c = '\0';
  6997. if(entityDef.combatLevel > myPlayer.combatLevel)
  6998. c = '\u07D0';
  6999. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  7000. if(i1 == 0)
  7001. menuActionID[menuActionRow] = 20 + c;
  7002. if(i1 == 1)
  7003. menuActionID[menuActionRow] = 412 + c;
  7004. if(i1 == 2)
  7005. menuActionID[menuActionRow] = 225 + c;
  7006. if(i1 == 3)
  7007. menuActionID[menuActionRow] = 965 + c;
  7008. if(i1 == 4)
  7009. menuActionID[menuActionRow] = 478 + c;
  7010. menuActionCmd1[menuActionRow] = i;
  7011. menuActionCmd2[menuActionRow] = k;
  7012. menuActionCmd3[menuActionRow] = j;
  7013. menuActionRow++;
  7014. }
  7015.  
  7016. }
  7017. //menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.type + "@gre@)";
  7018. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7019. menuActionID[menuActionRow] = 1025;
  7020. menuActionCmd1[menuActionRow] = i;
  7021. menuActionCmd2[menuActionRow] = k;
  7022. menuActionCmd3[menuActionRow] = j;
  7023. menuActionRow++;
  7024. }
  7025. }
  7026.  
  7027. private void buildAtPlayerMenu(int i, int j, Player player, int k)
  7028. {
  7029. if(player == myPlayer)
  7030. return;
  7031. if(menuActionRow >= 400)
  7032. return;
  7033. String s;
  7034. if(player.skill == 0)
  7035. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  7036. else
  7037. s = player.name + " (skill-" + player.skill + ")";
  7038. if(itemSelected == 1)
  7039. {
  7040. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
  7041. menuActionID[menuActionRow] = 491;
  7042. menuActionCmd1[menuActionRow] = j;
  7043. menuActionCmd2[menuActionRow] = i;
  7044. menuActionCmd3[menuActionRow] = k;
  7045. menuActionRow++;
  7046. } else
  7047. if(spellSelected == 1)
  7048. {
  7049. if((spellUsableOn & 8) == 8)
  7050. {
  7051. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  7052. menuActionID[menuActionRow] = 365;
  7053. menuActionCmd1[menuActionRow] = j;
  7054. menuActionCmd2[menuActionRow] = i;
  7055. menuActionCmd3[menuActionRow] = k;
  7056. menuActionRow++;
  7057. }
  7058. } else
  7059. {
  7060. for(int l = 4; l >= 0; l--)
  7061. if(atPlayerActions[l] != null)
  7062. {
  7063. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  7064. char c = '\0';
  7065. if(atPlayerActions[l].equalsIgnoreCase("attack"))
  7066. {
  7067. if(player.combatLevel > myPlayer.combatLevel)
  7068. c = '\u07D0';
  7069. if(myPlayer.team != 0 && player.team != 0)
  7070. if(myPlayer.team == player.team)
  7071. c = '\u07D0';
  7072. else
  7073. c = '\0';
  7074. } else
  7075. if(atPlayerArray[l])
  7076. c = '\u07D0';
  7077. if(l == 0)
  7078. menuActionID[menuActionRow] = 561 + c;
  7079. if(l == 1)
  7080. menuActionID[menuActionRow] = 779 + c;
  7081. if(l == 2)
  7082. menuActionID[menuActionRow] = 27 + c;
  7083. if(l == 3)
  7084. menuActionID[menuActionRow] = 577 + c;
  7085. if(l == 4)
  7086. menuActionID[menuActionRow] = 729 + c;
  7087. menuActionCmd1[menuActionRow] = j;
  7088. menuActionCmd2[menuActionRow] = i;
  7089. menuActionCmd3[menuActionRow] = k;
  7090. menuActionRow++;
  7091. }
  7092.  
  7093. }
  7094. for(int i1 = 0; i1 < menuActionRow; i1++)
  7095. if(menuActionID[i1] == 516)
  7096. {
  7097. menuActionName[i1] = "Walk here @whi@" + s;
  7098. return;
  7099. }
  7100.  
  7101. }
  7102.  
  7103. private void method89(Class30_Sub1 class30_sub1)
  7104. {
  7105. int i = 0;
  7106. int j = -1;
  7107. int k = 0;
  7108. int l = 0;
  7109. if(class30_sub1.anInt1296 == 0)
  7110. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7111. if(class30_sub1.anInt1296 == 1)
  7112. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7113. if(class30_sub1.anInt1296 == 2)
  7114. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7115. if(class30_sub1.anInt1296 == 3)
  7116. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7117. if(i != 0)
  7118. {
  7119. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7120. j = i >> 14 & 0x7fff;
  7121. k = i1 & 0x1f;
  7122. l = i1 >> 6;
  7123. }
  7124. class30_sub1.anInt1299 = j;
  7125. class30_sub1.anInt1301 = k;
  7126. class30_sub1.anInt1300 = l;
  7127. }
  7128.  
  7129. private void method90()
  7130. {
  7131. for(int i = 0; i < anInt1062; i++)
  7132. if(anIntArray1250[i] <= 0)
  7133. {
  7134. boolean flag1 = false;
  7135. try
  7136. {
  7137. if(anIntArray1207[i] == anInt874 && anIntArray1241[i] == anInt1289)
  7138. {
  7139. if(!replayWave())
  7140. flag1 = true;
  7141. } else
  7142. {
  7143. Stream stream = Sounds.method241(anIntArray1241[i], anIntArray1207[i]);
  7144. if(System.currentTimeMillis() + (long)(stream.currentOffset / 22) > aLong1172 + (long)(anInt1257 / 22))
  7145. {
  7146. anInt1257 = stream.currentOffset;
  7147. aLong1172 = System.currentTimeMillis();
  7148. if(saveWave(stream.buffer, stream.currentOffset))
  7149. {
  7150. anInt874 = anIntArray1207[i];
  7151. anInt1289 = anIntArray1241[i];
  7152. } else
  7153. {
  7154. flag1 = true;
  7155. }
  7156. }
  7157. }
  7158. }
  7159. catch(Exception exception) { }
  7160. if(!flag1 || anIntArray1250[i] == -5)
  7161. {
  7162. anInt1062--;
  7163. for(int j = i; j < anInt1062; j++)
  7164. {
  7165. anIntArray1207[j] = anIntArray1207[j + 1];
  7166. anIntArray1241[j] = anIntArray1241[j + 1];
  7167. anIntArray1250[j] = anIntArray1250[j + 1];
  7168. }
  7169.  
  7170. i--;
  7171. } else
  7172. {
  7173. anIntArray1250[i] = -5;
  7174. }
  7175. } else
  7176. {
  7177. anIntArray1250[i]--;
  7178. }
  7179.  
  7180. if(prevSong > 0)
  7181. {
  7182. prevSong -= 20;
  7183. if(prevSong < 0)
  7184. prevSong = 0;
  7185. if(prevSong == 0 && musicEnabled && !lowMem)
  7186. {
  7187. nextSong = currentSong;
  7188. songChanging = true;
  7189. onDemandFetcher.method558(2, nextSong);
  7190. }
  7191. }
  7192. }
  7193.  
  7194. private void connectServer()
  7195. {
  7196. int j = 5;
  7197. expectedCRCs[8] = 0;
  7198. int k = 0;
  7199. while(expectedCRCs[8] == 0)
  7200. {
  7201. String s = "Unknown problem";
  7202. drawLoadingText(20, "Connecting to web server");
  7203. try
  7204. {
  7205. DataInputStream datainputstream = openJagGrabInputStream("crc" + (int)(Math.random() * 99999999D) + "-" + 317);
  7206. Stream class30_sub2_sub2 = new Stream(new byte[40]);
  7207. datainputstream.readFully(class30_sub2_sub2.buffer, 0, 40);
  7208. datainputstream.close();
  7209. for(int i1 = 0; i1 < 9; i1++)
  7210. expectedCRCs[i1] = class30_sub2_sub2.readDWord();
  7211.  
  7212. int j1 = class30_sub2_sub2.readDWord();
  7213. int k1 = 1234;
  7214. for(int l1 = 0; l1 < 9; l1++)
  7215. k1 = (k1 << 1) + expectedCRCs[l1];
  7216.  
  7217. if(j1 != k1)
  7218. {
  7219. s = "checksum problem";
  7220. expectedCRCs[8] = 0;
  7221. }
  7222. }
  7223. catch(EOFException _ex)
  7224. {
  7225. s = "EOF problem";
  7226. expectedCRCs[8] = 0;
  7227. }
  7228. catch(IOException _ex)
  7229. {
  7230. s = "Server Busy";
  7231. expectedCRCs[8] = 0;
  7232. }
  7233. catch(Exception _ex)
  7234. {
  7235. s = "logic problem";
  7236. expectedCRCs[8] = 0;
  7237. if(!signlink.reporterror)
  7238. return;
  7239. }
  7240. if(expectedCRCs[8] == 0)
  7241. {
  7242. k++;
  7243. for(int l = j; l > 0; l--)
  7244. {
  7245. if(k >= 10)
  7246. {
  7247. drawLoadingText(10, "Game updated - please reload page");
  7248. l = 10;
  7249. } else
  7250. {
  7251. drawLoadingText(10, s + " - Will retry in " + l + " secs.");
  7252. }
  7253. try
  7254. {
  7255. Thread.sleep(1000L);
  7256. }
  7257. catch(Exception _ex) { }
  7258. }
  7259.  
  7260. j *= 2;
  7261. if(j > 60)
  7262. j = 60;
  7263. aBoolean872 = !aBoolean872;
  7264. }
  7265. }
  7266. }
  7267.  
  7268. public StreamLoader mediaStreamLoader;
  7269.  
  7270. void startUp()
  7271. {
  7272. drawLoadingText(20, "Starting up");
  7273. if(signlink.sunjava)
  7274. super.minDelay = 5;
  7275. if(aBoolean993)
  7276. {
  7277. // rsAlreadyLoaded = true;
  7278. // return;
  7279. }
  7280. aBoolean993 = true;
  7281. boolean flag = true;
  7282. String s = getDocumentBaseHost();
  7283. if(signlink.cache_dat != null)
  7284. {
  7285. for(int i = 0; i < 5; i++)
  7286. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  7287. } try {
  7288. connectServer();
  7289. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  7290. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  7291. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  7292. chatTextDrawingArea = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  7293. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  7294. drawLogo();
  7295. loadTitleScreen();
  7296. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  7297. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  7298. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  7299. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  7300. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  7301. StreamLoader streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  7302. byteGroundArray = new byte[4][104][104];
  7303. intGroundArray = new int[4][105][105];
  7304. worldController = new WorldController(intGroundArray);
  7305. for(int j = 0; j < 4; j++)
  7306. aClass11Array1230[j] = new Class11();
  7307.  
  7308. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  7309. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  7310. drawLoadingText(60, "Connecting to update server");
  7311. onDemandFetcher = new OnDemandFetcher();
  7312. onDemandFetcher.start(streamLoader_6, this);
  7313. Class36.method528(onDemandFetcher.getAnimCount());
  7314. Model.method459(onDemandFetcher.getVersionCount(0), onDemandFetcher);
  7315. if(!lowMem)
  7316. {
  7317. nextSong = 0;
  7318. try
  7319. {
  7320. nextSong = Integer.parseInt(getParameter("music"));
  7321. }
  7322. catch(Exception _ex) { }
  7323. songChanging = true;
  7324. onDemandFetcher.method558(2, nextSong);
  7325. while(onDemandFetcher.getNodeCount() > 0)
  7326. {
  7327. processOnDemandQueue();
  7328. try
  7329. {
  7330. Thread.sleep(100L);
  7331. }
  7332. catch(Exception _ex) { }
  7333. if(onDemandFetcher.anInt1349 > 3)
  7334. {
  7335. loadError();
  7336. return;
  7337. }
  7338. }
  7339. }
  7340. drawLoadingText(65, "Requesting animations");
  7341. int k = onDemandFetcher.getVersionCount(1);
  7342. for(int i1 = 0; i1 < k; i1++)
  7343. onDemandFetcher.method558(1, i1);
  7344.  
  7345. while(onDemandFetcher.getNodeCount() > 0)
  7346. {
  7347. int j1 = k - onDemandFetcher.getNodeCount();
  7348. if(j1 > 0)
  7349. drawLoadingText(65, "Loading animations - " + (j1 * 100) / k + "%");
  7350. processOnDemandQueue();
  7351. try
  7352. {
  7353. Thread.sleep(100L);
  7354. }
  7355. catch(Exception _ex) { }
  7356. if(onDemandFetcher.anInt1349 > 3)
  7357. {
  7358. loadError();
  7359. return;
  7360. }
  7361. }
  7362. drawLoadingText(70, "Requesting models");
  7363. k = onDemandFetcher.getVersionCount(0);
  7364. for(int k1 = 0; k1 < k; k1++)
  7365. {
  7366. int l1 = onDemandFetcher.getModelIndex(k1);
  7367. if((l1 & 1) != 0)
  7368. onDemandFetcher.method558(0, k1);
  7369. }
  7370.  
  7371. k = onDemandFetcher.getNodeCount();
  7372. while(onDemandFetcher.getNodeCount() > 0)
  7373. {
  7374. int i2 = k - onDemandFetcher.getNodeCount();
  7375. if(i2 > 0)
  7376. drawLoadingText(70, "Loading models - " + (i2 * 100) / k + "%");
  7377. processOnDemandQueue();
  7378. try
  7379. {
  7380. Thread.sleep(100L);
  7381. }
  7382. catch(Exception _ex) { }
  7383. }
  7384. if(decompressors[0] != null)
  7385. {
  7386. drawLoadingText(75, "Requesting maps");
  7387. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 47));
  7388. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 47));
  7389. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 48));
  7390. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 48));
  7391. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 49));
  7392. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 49));
  7393. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 47));
  7394. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 47));
  7395. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 48));
  7396. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 48));
  7397. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 148, 48));
  7398. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 148, 48));
  7399. k = onDemandFetcher.getNodeCount();
  7400. while(onDemandFetcher.getNodeCount() > 0)
  7401. {
  7402. int j2 = k - onDemandFetcher.getNodeCount();
  7403. if(j2 > 0)
  7404. drawLoadingText(75, "Loading maps - " + (j2 * 100) / k + "%");
  7405. processOnDemandQueue();
  7406. try
  7407. {
  7408. Thread.sleep(100L);
  7409. }
  7410. catch(Exception _ex) { }
  7411. }
  7412. }
  7413. k = onDemandFetcher.getVersionCount(0);
  7414. for(int k2 = 0; k2 < k; k2++)
  7415. {
  7416. int l2 = onDemandFetcher.getModelIndex(k2);
  7417. byte byte0 = 0;
  7418. if((l2 & 8) != 0)
  7419. byte0 = 10;
  7420. else
  7421. if((l2 & 0x20) != 0)
  7422. byte0 = 9;
  7423. else
  7424. if((l2 & 0x10) != 0)
  7425. byte0 = 8;
  7426. else
  7427. if((l2 & 0x40) != 0)
  7428. byte0 = 7;
  7429. else
  7430. if((l2 & 0x80) != 0)
  7431. byte0 = 6;
  7432. else
  7433. if((l2 & 2) != 0)
  7434. byte0 = 5;
  7435. else
  7436. if((l2 & 4) != 0)
  7437. byte0 = 4;
  7438. if((l2 & 1) != 0)
  7439. byte0 = 3;
  7440. if(byte0 != 0)
  7441. onDemandFetcher.method563(byte0, 0, k2);
  7442. }
  7443.  
  7444. onDemandFetcher.method554(isMembers);
  7445. if(!lowMem)
  7446. {
  7447. int l = onDemandFetcher.getVersionCount(2);
  7448. for(int i3 = 1; i3 < l; i3++)
  7449. if(onDemandFetcher.method569(i3))
  7450. onDemandFetcher.method563((byte)1, 2, i3);
  7451.  
  7452. }
  7453. drawLoadingText(80, "Unpacking media");
  7454. /* Custom sprite unpacking */
  7455. chatArea = new Sprite(streamLoader_2, "keys", 0);
  7456. tabArea = new Sprite(streamLoader_2, "chest", 0);
  7457. mapArea = new Sprite(streamLoader_2, "tex_red", 0);
  7458. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  7459. /**/
  7460. mapBack = new Background(streamLoader_2, "mapback", 0);
  7461. for(int c1 = 0; c1 <= 3; c1++)
  7462. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  7463. for(int j3 = 0; j3 <= 14; j3++)
  7464. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  7465. for(int r1 = 0; r1 < 5; r1++)
  7466. redStones[r1] = new Sprite(streamLoader_2, "coins", r1);
  7467. compass = new Sprite(streamLoader_2, "compass", 0);
  7468. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  7469. mapEdge.method345();
  7470. try
  7471. {
  7472. for(int k3 = 0; k3 < 100; k3++)
  7473. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  7474. }
  7475. catch(Exception _ex) { }
  7476. try
  7477. {
  7478. for(int l3 = 0; l3 < 100; l3++)
  7479. mapFunctions[l3] = new Sprite(streamLoader_2, "mapfunction", l3);
  7480. }
  7481. catch(Exception _ex) { }
  7482. try
  7483. {
  7484. for(int i4 = 0; i4 < 20; i4++)
  7485. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  7486. }
  7487. catch(Exception _ex) { }
  7488. try
  7489. {
  7490. for(int h1 = 0; h1 < 6; h1++)
  7491. headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
  7492. } catch(Exception _ex) { }
  7493. try {
  7494. for(int j4 = 0; j4 < 8; j4++)
  7495. headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);
  7496. for(int j45 = 0; j45 < 3; j45++)
  7497. skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45 );
  7498. }
  7499. catch(Exception _ex) { }
  7500. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  7501. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  7502. for(int k4 = 0; k4 < 8; k4++)
  7503. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  7504.  
  7505. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  7506. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  7507. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  7508. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  7509. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  7510. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  7511. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  7512. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  7513.  
  7514. for(int l4 = 0; l4 < 2; l4++)
  7515. modIcons[l4] = new Background(streamLoader_2, "mod_icons", l4);
  7516.  
  7517. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  7518. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7519. sprite.method346(0, 0);
  7520. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  7521. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7522. sprite.method346(0, 0);
  7523. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  7524. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7525. sprite.method346(0, 0);
  7526. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  7527. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7528. sprite.method346(0, 0);
  7529.  
  7530. int i5 = (int)(Math.random() * 21D) - 10;
  7531. int j5 = (int)(Math.random() * 21D) - 10;
  7532. int k5 = (int)(Math.random() * 21D) - 10;
  7533. int l5 = (int)(Math.random() * 41D) - 20;
  7534. for(int i6 = 0; i6 < 100; i6++)
  7535. {
  7536. if(mapFunctions[i6] != null)
  7537. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  7538. if(mapScenes[i6] != null)
  7539. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  7540. }
  7541.  
  7542. drawLoadingText(83, "Unpacking textures");
  7543. Texture.method368(streamLoader_3);
  7544. Texture.method372(0.80000000000000004D);
  7545. Texture.method367();
  7546. drawLoadingText(86, "Unpacking config");
  7547. Animation.unpackConfig(streamLoader);
  7548. ObjectDef.unpackConfig(streamLoader);
  7549. Flo.unpackConfig(streamLoader);
  7550. ItemDef.unpackConfig(streamLoader);
  7551. EntityDef.unpackConfig(streamLoader);
  7552. IDK.unpackConfig(streamLoader);
  7553. SpotAnim.unpackConfig(streamLoader);
  7554. Varp.unpackConfig(streamLoader);
  7555. VarBit.unpackConfig(streamLoader);
  7556. ItemDef.isMembers = isMembers;
  7557. if(!lowMem)
  7558. {
  7559. drawLoadingText(90, "Unpacking sounds");
  7560. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  7561. Stream stream = new Stream(abyte0);
  7562. Sounds.unpack(stream);
  7563. }
  7564. drawLoadingText(95, "Unpacking interfaces");
  7565. TextDrawingArea aclass30_sub2_sub1_sub4s[] = {
  7566. smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  7567. };
  7568. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  7569. drawLoadingText(100, "Preparing game engine");
  7570. for(int j6 = 0; j6 < 33; j6++)
  7571. {
  7572. int k6 = 999;
  7573. int i7 = 0;
  7574. for(int k7 = 0; k7 < 34; k7++)
  7575. {
  7576. if(mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0)
  7577. {
  7578. if(k6 == 999)
  7579. k6 = k7;
  7580. continue;
  7581. }
  7582. if(k6 == 999)
  7583. continue;
  7584. i7 = k7;
  7585. break;
  7586. }
  7587.  
  7588. anIntArray968[j6] = k6;
  7589. anIntArray1057[j6] = i7 - k6;
  7590. }
  7591.  
  7592. for(int l6 = 5; l6 < 156; l6++)
  7593. {
  7594. int j7 = 999;
  7595. int l7 = 0;
  7596. for(int j8 = 25; j8 < 172; j8++)
  7597. {
  7598. if(mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34))
  7599. {
  7600. if(j7 == 999)
  7601. j7 = j8;
  7602. continue;
  7603. }
  7604. if(j7 == 999)
  7605. continue;
  7606. l7 = j8;
  7607. break;
  7608. }
  7609.  
  7610. anIntArray1052[l6 - 5] = j7 - 25;
  7611. anIntArray1229[l6 - 5] = l7 - j7;
  7612. }
  7613.  
  7614. Texture.method365(765, 503);
  7615. fullScreenTextureArray = Texture.anIntArray1472;
  7616. Texture.method365(519, 165);
  7617. anIntArray1180 = Texture.anIntArray1472;
  7618. Texture.method365(246, 335);
  7619. anIntArray1181 = Texture.anIntArray1472;
  7620. Texture.method365(512, 334);
  7621. anIntArray1182 = Texture.anIntArray1472;
  7622. int ai[] = new int[9];
  7623. for(int i8 = 0; i8 < 9; i8++)
  7624. {
  7625. int k8 = 128 + i8 * 32 + 15;
  7626. int l8 = 600 + k8 * 3;
  7627. int i9 = Texture.anIntArray1470[k8];
  7628. ai[i8] = l8 * i9 >> 16;
  7629. }
  7630.  
  7631. WorldController.method310(500, 800, 512, 334, ai);
  7632. Censor.loadConfig(streamLoader_4);
  7633. mouseDetection = new MouseDetection(this);
  7634. startRunnable(mouseDetection, 10);
  7635. Animable_Sub5.clientInstance = this;
  7636. ObjectDef.clientInstance = this;
  7637. EntityDef.clientInstance = this;
  7638. return;
  7639. }
  7640. catch(Exception exception)
  7641. {
  7642. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  7643. }
  7644. loadingError = true;
  7645. }
  7646.  
  7647. private void method91(Stream stream, int i)
  7648. {
  7649. while(stream.bitPosition + 10 < i * 8)
  7650. {
  7651. int j = stream.readBits(11);
  7652. if(j == 2047)
  7653. break;
  7654. if(playerArray[j] == null)
  7655. {
  7656. playerArray[j] = new Player();
  7657. if(aStreamArray895s[j] != null)
  7658. playerArray[j].updatePlayer(aStreamArray895s[j]);
  7659. }
  7660. playerIndices[playerCount++] = j;
  7661. Player player = playerArray[j];
  7662. player.anInt1537 = loopCycle;
  7663. int k = stream.readBits(1);
  7664. if(k == 1)
  7665. anIntArray894[anInt893++] = j;
  7666. int l = stream.readBits(1);
  7667. int i1 = stream.readBits(5);
  7668. if(i1 > 15)
  7669. i1 -= 32;
  7670. int j1 = stream.readBits(5);
  7671. if(j1 > 15)
  7672. j1 -= 32;
  7673. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  7674. }
  7675. stream.finishBitAccess();
  7676. }
  7677.  
  7678. private void processMainScreenClick() {
  7679. if(anInt1021 != 0)
  7680. return;
  7681. if(super.clickMode3 == 1) {
  7682. int i = super.saveClickX - 25 - 545;
  7683. int j = super.saveClickY - 5 - 4;
  7684. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  7685. i -= 73;
  7686. j -= 75;
  7687. int k = minimapInt1 + minimapInt2 & 0x7ff;
  7688. int i1 = Texture.anIntArray1470[k];
  7689. int j1 = Texture.anIntArray1471[k];
  7690. i1 = i1 * (minimapInt3 + 256) >> 8;
  7691. j1 = j1 * (minimapInt3 + 256) >> 8;
  7692. int k1 = j * i1 + i * j1 >> 11;
  7693. int l1 = j * j1 - i * i1 >> 11;
  7694. int i2 = myPlayer.x + k1 >> 7;
  7695. int j2 = myPlayer.y - l1 >> 7;
  7696. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  7697. if(flag1) {
  7698. stream.writeWordBigEndian(i);
  7699. stream.writeWordBigEndian(j);
  7700. stream.writeWord(minimapInt1);
  7701. stream.writeWordBigEndian(57);
  7702. stream.writeWordBigEndian(minimapInt2);
  7703. stream.writeWordBigEndian(minimapInt3);
  7704. stream.writeWordBigEndian(89);
  7705. stream.writeWord(myPlayer.x);
  7706. stream.writeWord(myPlayer.y);
  7707. stream.writeWordBigEndian(anInt1264);
  7708. stream.writeWordBigEndian(63);
  7709. }
  7710. }
  7711. anInt1117++;
  7712. if(anInt1117 > 1151) {
  7713. anInt1117 = 0;
  7714. stream.createFrame(246);
  7715. stream.writeWordBigEndian(0);
  7716. int l = stream.currentOffset;
  7717. if((int)(Math.random() * 2D) == 0)
  7718. stream.writeWordBigEndian(101);
  7719. stream.writeWordBigEndian(197);
  7720. stream.writeWord((int)(Math.random() * 65536D));
  7721. stream.writeWordBigEndian((int)(Math.random() * 256D));
  7722. stream.writeWordBigEndian(67);
  7723. stream.writeWord(14214);
  7724. if((int)(Math.random() * 2D) == 0)
  7725. stream.writeWord(29487);
  7726. stream.writeWord((int)(Math.random() * 65536D));
  7727. if((int)(Math.random() * 2D) == 0)
  7728. stream.writeWordBigEndian(220);
  7729. stream.writeWordBigEndian(180);
  7730. stream.writeBytes(stream.currentOffset - l);
  7731. }
  7732. }
  7733. }
  7734.  
  7735. private String interfaceIntToString(int j) {
  7736. if(j < 0x3b9ac9ff)
  7737. return String.valueOf(j);
  7738. else
  7739. return "*";
  7740. }
  7741.  
  7742. private void showErrorScreen()
  7743. {
  7744. Graphics g = getGameComponent().getGraphics();
  7745. g.setColor(Color.black);
  7746. g.fillRect(0, 0, 765, 503);
  7747. method4(1);
  7748. if(loadingError)
  7749. {
  7750. aBoolean831 = false;
  7751. g.setFont(new Font("Helvetica", 1, 16));
  7752. g.setColor(Color.yellow);
  7753. int k = 35;
  7754. g.drawString("Sorry, an error has occured whilst loading RuneScape", 30, k);
  7755. k += 50;
  7756. g.setColor(Color.white);
  7757. g.drawString("To fix this try the following (in order):", 30, k);
  7758. k += 50;
  7759. g.setColor(Color.white);
  7760. g.setFont(new Font("Helvetica", 1, 12));
  7761. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  7762. k += 30;
  7763. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  7764. k += 30;
  7765. g.drawString("3: Try using a different game-world", 30, k);
  7766. k += 30;
  7767. g.drawString("4: Try rebooting your computer", 30, k);
  7768. k += 30;
  7769. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  7770. }
  7771. if(genericLoadingError)
  7772. {
  7773. aBoolean831 = false;
  7774. g.setFont(new Font("Helvetica", 1, 20));
  7775. g.setColor(Color.white);
  7776. g.drawString("Error - unable to load game!", 50, 50);
  7777. g.drawString("To play RuneScape make sure you play from", 50, 100);
  7778. g.drawString("http://www.websitehere.com", 50, 150);
  7779. }
  7780. if(rsAlreadyLoaded)
  7781. {
  7782. aBoolean831 = false;
  7783. g.setColor(Color.yellow);
  7784. int l = 35;
  7785. g.drawString("Error a copy of RuneScape already appears to be loaded", 30, l);
  7786. l += 50;
  7787. g.setColor(Color.white);
  7788. g.drawString("To fix this try the following (in order):", 30, l);
  7789. l += 50;
  7790. g.setColor(Color.white);
  7791. g.setFont(new Font("Helvetica", 1, 12));
  7792. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  7793. l += 30;
  7794. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  7795. l += 30;
  7796. }
  7797. }
  7798.  
  7799. public URL getCodeBase() {
  7800. try {
  7801. return new URL(server +":" + (80 + portOff));
  7802. } catch(Exception _ex) {
  7803. }
  7804. return null;
  7805. }
  7806.  
  7807. private void method95() {
  7808. for(int j = 0; j < npcCount; j++) {
  7809. int k = npcIndices[j];
  7810. NPC npc = npcArray[k];
  7811. if(npc != null)
  7812. method96(npc);
  7813. }
  7814. }
  7815.  
  7816. private void method96(Entity entity)
  7817. {
  7818. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  7819. {
  7820. entity.anim = -1;
  7821. entity.anInt1520 = -1;
  7822. entity.anInt1547 = 0;
  7823. entity.anInt1548 = 0;
  7824. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7825. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7826. entity.method446();
  7827. }
  7828. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  7829. {
  7830. entity.anim = -1;
  7831. entity.anInt1520 = -1;
  7832. entity.anInt1547 = 0;
  7833. entity.anInt1548 = 0;
  7834. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7835. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7836. entity.method446();
  7837. }
  7838. if(entity.anInt1547 > loopCycle)
  7839. method97(entity);
  7840. else
  7841. if(entity.anInt1548 >= loopCycle)
  7842. method98(entity);
  7843. else
  7844. method99(entity);
  7845. method100(entity);
  7846. method101(entity);
  7847. }
  7848.  
  7849. private void method97(Entity entity)
  7850. {
  7851. int i = entity.anInt1547 - loopCycle;
  7852. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7853. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7854. entity.x += (j - entity.x) / i;
  7855. entity.y += (k - entity.y) / i;
  7856. entity.anInt1503 = 0;
  7857. if(entity.anInt1549 == 0)
  7858. entity.turnDirection = 1024;
  7859. if(entity.anInt1549 == 1)
  7860. entity.turnDirection = 1536;
  7861. if(entity.anInt1549 == 2)
  7862. entity.turnDirection = 0;
  7863. if(entity.anInt1549 == 3)
  7864. entity.turnDirection = 512;
  7865. }
  7866.  
  7867. private void method98(Entity entity)
  7868. {
  7869. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  7870. {
  7871. int i = entity.anInt1548 - entity.anInt1547;
  7872. int j = loopCycle - entity.anInt1547;
  7873. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7874. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7875. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  7876. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  7877. entity.x = (k * (i - j) + i1 * j) / i;
  7878. entity.y = (l * (i - j) + j1 * j) / i;
  7879. }
  7880. entity.anInt1503 = 0;
  7881. if(entity.anInt1549 == 0)
  7882. entity.turnDirection = 1024;
  7883. if(entity.anInt1549 == 1)
  7884. entity.turnDirection = 1536;
  7885. if(entity.anInt1549 == 2)
  7886. entity.turnDirection = 0;
  7887. if(entity.anInt1549 == 3)
  7888. entity.turnDirection = 512;
  7889. entity.anInt1552 = entity.turnDirection;
  7890. }
  7891.  
  7892. private void method99(Entity entity)
  7893. {
  7894. entity.anInt1517 = entity.anInt1511;
  7895. if(entity.smallXYIndex == 0)
  7896. {
  7897. entity.anInt1503 = 0;
  7898. return;
  7899. }
  7900. if(entity.anim != -1 && entity.anInt1529 == 0)
  7901. {
  7902. Animation animation = Animation.anims[entity.anim];
  7903. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  7904. {
  7905. entity.anInt1503++;
  7906. return;
  7907. }
  7908. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  7909. {
  7910. entity.anInt1503++;
  7911. return;
  7912. }
  7913. }
  7914. int i = entity.x;
  7915. int j = entity.y;
  7916. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7917. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7918. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  7919. {
  7920. entity.x = k;
  7921. entity.y = l;
  7922. return;
  7923. }
  7924. if(i < k)
  7925. {
  7926. if(j < l)
  7927. entity.turnDirection = 1280;
  7928. else
  7929. if(j > l)
  7930. entity.turnDirection = 1792;
  7931. else
  7932. entity.turnDirection = 1536;
  7933. } else
  7934. if(i > k)
  7935. {
  7936. if(j < l)
  7937. entity.turnDirection = 768;
  7938. else
  7939. if(j > l)
  7940. entity.turnDirection = 256;
  7941. else
  7942. entity.turnDirection = 512;
  7943. } else
  7944. if(j < l)
  7945. entity.turnDirection = 1024;
  7946. else
  7947. entity.turnDirection = 0;
  7948. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  7949. if(i1 > 1024)
  7950. i1 -= 2048;
  7951. int j1 = entity.anInt1555;
  7952. if(i1 >= -256 && i1 <= 256)
  7953. j1 = entity.anInt1554;
  7954. else
  7955. if(i1 >= 256 && i1 < 768)
  7956. j1 = entity.anInt1557;
  7957. else
  7958. if(i1 >= -768 && i1 <= -256)
  7959. j1 = entity.anInt1556;
  7960. if(j1 == -1)
  7961. j1 = entity.anInt1554;
  7962. entity.anInt1517 = j1;
  7963. int k1 = 4;
  7964. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  7965. k1 = 2;
  7966. if(entity.smallXYIndex > 2)
  7967. k1 = 6;
  7968. if(entity.smallXYIndex > 3)
  7969. k1 = 8;
  7970. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  7971. {
  7972. k1 = 8;
  7973. entity.anInt1503--;
  7974. }
  7975. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  7976. k1 <<= 1;
  7977. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  7978. entity.anInt1517 = entity.anInt1505;
  7979. if(i < k)
  7980. {
  7981. entity.x += k1;
  7982. if(entity.x > k)
  7983. entity.x = k;
  7984. } else
  7985. if(i > k)
  7986. {
  7987. entity.x -= k1;
  7988. if(entity.x < k)
  7989. entity.x = k;
  7990. }
  7991. if(j < l)
  7992. {
  7993. entity.y += k1;
  7994. if(entity.y > l)
  7995. entity.y = l;
  7996. } else
  7997. if(j > l)
  7998. {
  7999. entity.y -= k1;
  8000. if(entity.y < l)
  8001. entity.y = l;
  8002. }
  8003. if(entity.x == k && entity.y == l)
  8004. {
  8005. entity.smallXYIndex--;
  8006. if(entity.anInt1542 > 0)
  8007. entity.anInt1542--;
  8008. }
  8009. }
  8010.  
  8011. private void method100(Entity entity)
  8012. {
  8013. if(entity.anInt1504 == 0)
  8014. return;
  8015. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  8016. {
  8017. NPC npc = npcArray[entity.interactingEntity];
  8018. if(npc != null)
  8019. {
  8020. int i1 = entity.x - npc.x;
  8021. int k1 = entity.y - npc.y;
  8022. if(i1 != 0 || k1 != 0)
  8023. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  8024. }
  8025. }
  8026. if(entity.interactingEntity >= 32768)
  8027. {
  8028. int j = entity.interactingEntity - 32768;
  8029. if(j == unknownInt10)
  8030. j = myPlayerIndex;
  8031. Player player = playerArray[j];
  8032. if(player != null)
  8033. {
  8034. int l1 = entity.x - player.x;
  8035. int i2 = entity.y - player.y;
  8036. if(l1 != 0 || i2 != 0)
  8037. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  8038. }
  8039. }
  8040. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  8041. {
  8042. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  8043. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  8044. if(k != 0 || j1 != 0)
  8045. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  8046. entity.anInt1538 = 0;
  8047. entity.anInt1539 = 0;
  8048. }
  8049. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8050. if(l != 0)
  8051. {
  8052. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8053. entity.anInt1552 = entity.turnDirection;
  8054. else
  8055. if(l > 1024)
  8056. entity.anInt1552 -= entity.anInt1504;
  8057. else
  8058. entity.anInt1552 += entity.anInt1504;
  8059. entity.anInt1552 &= 0x7ff;
  8060. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  8061. {
  8062. if(entity.anInt1512 != -1)
  8063. {
  8064. entity.anInt1517 = entity.anInt1512;
  8065. return;
  8066. }
  8067. entity.anInt1517 = entity.anInt1554;
  8068. }
  8069. }
  8070. }
  8071.  
  8072. private void method101(Entity entity)
  8073. {
  8074. entity.aBoolean1541 = false;
  8075. if(entity.anInt1517 != -1)
  8076. {
  8077. Animation animation = Animation.anims[entity.anInt1517];
  8078. entity.anInt1519++;
  8079. if(entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518))
  8080. {
  8081. entity.anInt1519 = 0;
  8082. entity.anInt1518++;
  8083. }
  8084. if(entity.anInt1518 >= animation.anInt352)
  8085. {
  8086. entity.anInt1519 = 0;
  8087. entity.anInt1518 = 0;
  8088. }
  8089. }
  8090. if(entity.anInt1520 != -1 && loopCycle >= entity.anInt1523)
  8091. {
  8092. if(entity.anInt1521 < 0)
  8093. entity.anInt1521 = 0;
  8094. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8095. for(entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  8096. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8097.  
  8098. if(entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  8099. entity.anInt1520 = -1;
  8100. }
  8101. if(entity.anim != -1 && entity.anInt1529 <= 1)
  8102. {
  8103. Animation animation_2 = Animation.anims[entity.anim];
  8104. if(animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle)
  8105. {
  8106. entity.anInt1529 = 1;
  8107. return;
  8108. }
  8109. }
  8110. if(entity.anim != -1 && entity.anInt1529 == 0)
  8111. {
  8112. Animation animation_3 = Animation.anims[entity.anim];
  8113. for(entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  8114. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8115.  
  8116. if(entity.anInt1527 >= animation_3.anInt352)
  8117. {
  8118. entity.anInt1527 -= animation_3.anInt356;
  8119. entity.anInt1530++;
  8120. if(entity.anInt1530 >= animation_3.anInt362)
  8121. entity.anim = -1;
  8122. if(entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  8123. entity.anim = -1;
  8124. }
  8125. entity.aBoolean1541 = animation_3.aBoolean358;
  8126. }
  8127. if(entity.anInt1529 > 0)
  8128. entity.anInt1529--;
  8129. }
  8130.  
  8131. private void drawGameScreen()
  8132. {
  8133. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  8134. if (loadingStage == 2) {
  8135. method119(anInt945, fullscreenInterfaceID);
  8136. if (openInterfaceID != -1) {
  8137. method119(anInt945, openInterfaceID);
  8138. }
  8139. anInt945 = 0;
  8140. resetAllImageProducers();
  8141. super.fullGameScreen.initDrawingArea();
  8142. Texture.anIntArray1472 = fullScreenTextureArray;
  8143. DrawingArea.setAllPixelsToZero();
  8144. welcomeScreenRaised = true;
  8145. if (openInterfaceID != -1) {
  8146. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  8147. if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  8148. rsInterface_1.width = 765;
  8149. rsInterface_1.height = 503;
  8150. }
  8151. drawInterface(0, 0, rsInterface_1, 8);
  8152. }
  8153. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  8154. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  8155. rsInterface.width = 765;
  8156. rsInterface.height = 503;
  8157. }
  8158. drawInterface(0, 0, rsInterface, 8);
  8159.  
  8160. if (!menuOpen) {
  8161. processRightClick();
  8162. drawTooltip();
  8163. } else {
  8164. drawMenu();
  8165. }
  8166. }
  8167. drawCount++;
  8168. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  8169. return;
  8170. } else {
  8171. if (drawCount != 0) {
  8172. resetImageProducers2();
  8173. }
  8174. }
  8175. if(welcomeScreenRaised) {
  8176. welcomeScreenRaised = false;
  8177. topFrame.drawGraphics(0, super.graphics, 0);
  8178. leftFrame.drawGraphics(4, super.graphics, 0);
  8179. rightFrame.drawGraphics(4, super.graphics, 516);
  8180. mapEdgeIP.drawGraphics(4, super.graphics, 519);
  8181. needDrawTabArea = true;
  8182. inputTaken = true;
  8183. tabAreaAltered = true;
  8184. aBoolean1233 = true;
  8185. if(loadingStage != 2) {
  8186. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  8187. aRSImageProducer_1164.drawGraphics(4, super.graphics, 545);
  8188. }
  8189. }
  8190. if(menuOpen && menuScreenArea == 1)
  8191. needDrawTabArea = true;
  8192. if(invOverlayInterfaceID != -1)
  8193. {
  8194. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  8195. if(flag1)
  8196. needDrawTabArea = true;
  8197. }
  8198. if(atInventoryInterfaceType == 2)
  8199. needDrawTabArea = true;
  8200. if(activeInterfaceType == 2)
  8201. needDrawTabArea = true;
  8202. /*if(needDrawTabArea)
  8203. {*/
  8204. drawTabArea();
  8205. /*needDrawTabArea = false;
  8206. }*/
  8207. if(backDialogID == -1)
  8208. {
  8209. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  8210. if(super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  8211. method65(494, 110, super.mouseX - 0, super.mouseY - 348, aClass9_1059, 0, false, anInt1211);
  8212. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  8213. if(i < 0)
  8214. i = 0;
  8215. if(i > anInt1211 - 110)
  8216. i = anInt1211 - 110;
  8217. if(anInt1089 != i)
  8218. {
  8219. anInt1089 = i;
  8220. inputTaken = true;
  8221. }
  8222. }
  8223. if(backDialogID != -1) {
  8224. boolean flag2 = method119(anInt945, backDialogID);
  8225. if(flag2)
  8226. inputTaken = true;
  8227. }
  8228. if(atInventoryInterfaceType == 3)
  8229. inputTaken = true;
  8230. if(activeInterfaceType == 3)
  8231. inputTaken = true;
  8232. if(aString844 != null)
  8233. inputTaken = true;
  8234. if(menuOpen && menuScreenArea == 2)
  8235. inputTaken = true;
  8236. if(inputTaken) {
  8237. drawChatArea();
  8238. inputTaken = false;
  8239. }
  8240. if(loadingStage == 2)
  8241. method146();
  8242. if(loadingStage == 2) {
  8243. drawMinimap();
  8244. aRSImageProducer_1164.drawGraphics(4, super.graphics, 545);
  8245. }
  8246. if(anInt1054 != -1)
  8247. tabAreaAltered = true;
  8248. if(tabAreaAltered)
  8249. {
  8250. if(anInt1054 != -1 && anInt1054 == tabID)
  8251. {
  8252. anInt1054 = -1;
  8253. stream.createFrame(120);
  8254. stream.writeWordBigEndian(tabID);
  8255. }
  8256. tabAreaAltered = false;
  8257. aRSImageProducer_1125.initDrawingArea();
  8258. aRSImageProducer_1165.initDrawingArea();
  8259. }
  8260. anInt945 = 0;
  8261. }
  8262.  
  8263. private boolean buildFriendsListMenu(RSInterface class9)
  8264. {
  8265. int i = class9.contentType;
  8266. if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  8267. {
  8268. if(i >= 801)
  8269. i -= 701;
  8270. else
  8271. if(i >= 701)
  8272. i -= 601;
  8273. else
  8274. if(i >= 101)
  8275. i -= 101;
  8276. else
  8277. i--;
  8278. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  8279. menuActionID[menuActionRow] = 792;
  8280. menuActionRow++;
  8281. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  8282. menuActionID[menuActionRow] = 639;
  8283. menuActionRow++;
  8284. return true;
  8285. }
  8286. if(i >= 401 && i <= 500)
  8287. {
  8288. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  8289. menuActionID[menuActionRow] = 322;
  8290. menuActionRow++;
  8291. return true;
  8292. } else
  8293. {
  8294. return false;
  8295. }
  8296. }
  8297.  
  8298. private void method104()
  8299. {
  8300. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  8301. for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  8302. if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  8303. class30_sub2_sub4_sub3.unlink();
  8304. else
  8305. if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  8306. {
  8307. class30_sub2_sub4_sub3.method454(anInt945);
  8308. if(class30_sub2_sub4_sub3.aBoolean1567)
  8309. class30_sub2_sub4_sub3.unlink();
  8310. else
  8311. 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);
  8312. }
  8313.  
  8314. }
  8315.  
  8316. public void drawBlackBox(int xPos, int yPos) {
  8317. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  8318. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  8319. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  8320. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  8321. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  8322. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  8323. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  8324. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  8325. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  8326. }
  8327.  
  8328. private void drawInterface(int j, int k, RSInterface class9, int l) {
  8329. if(class9.type != 0 || class9.children == null)
  8330. return;
  8331. if(class9.isMouseoverTriggered && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  8332. return;
  8333. int i1 = DrawingArea.topX;
  8334. int j1 = DrawingArea.topY;
  8335. int k1 = DrawingArea.bottomX;
  8336. int l1 = DrawingArea.bottomY;
  8337. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  8338. int i2 = class9.children.length;
  8339. for(int j2 = 0; j2 < i2; j2++) {
  8340. int k2 = class9.childX[j2] + k;
  8341. int l2 = (class9.childY[j2] + l) - j;
  8342. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  8343. k2 += class9_1.anInt263;
  8344. l2 += class9_1.anInt265;
  8345. if(class9_1.contentType > 0)
  8346. drawFriendsListOrWelcomeScreen(class9_1);
  8347. //here
  8348. int[] IDs = {
  8349. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
  8350. 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
  8351. 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
  8352. 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
  8353. 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  8354. /* Ancients */
  8355. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
  8356. 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  8357. };
  8358. for(int m5 = 0; m5 < IDs.length; m5++) {
  8359. if(class9_1.id == IDs[m5] + 1) {
  8360. if(m5 > 61)
  8361. drawBlackBox(k2 + 1, l2);
  8362. else
  8363. drawBlackBox(k2, l2 + 1);
  8364. }
  8365. }
  8366. int[] runeChildren = {
  8367. 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
  8368. 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
  8369. 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
  8370. 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
  8371. 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
  8372. 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
  8373. 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
  8374. 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
  8375. 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
  8376. 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
  8377. 15885, 18474, 18475, 18478
  8378. };
  8379. for(int r = 0; r < runeChildren.length; r++)
  8380. if(class9_1.id == runeChildren[r])
  8381. class9_1.modelZoom = 775;
  8382. if(class9_1.type == 0) {
  8383. if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  8384. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  8385. if(class9_1.scrollPosition < 0)
  8386. class9_1.scrollPosition = 0;
  8387. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  8388. if(class9_1.scrollMax > class9_1.height)
  8389. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  8390. } else if(class9_1.type != 1)
  8391. if(class9_1.type == 2) {
  8392. int i3 = 0;
  8393. for(int l3 = 0; l3 < class9_1.height; l3++) {
  8394. for(int l4 = 0; l4 < class9_1.width; l4++) {
  8395. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  8396. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  8397. if(i3 < 20) {
  8398. k5 += class9_1.spritesX[i3];
  8399. j6 += class9_1.spritesY[i3];
  8400. }
  8401. if(class9_1.inv[i3] > 0) {
  8402. int k6 = 0;
  8403. int j7 = 0;
  8404. int j9 = class9_1.inv[i3] - 1;
  8405. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  8406. int l9 = 0;
  8407. if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  8408. l9 = 0xffffff;
  8409. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  8410. if(class30_sub2_sub1_sub1_2 != null) {
  8411. if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  8412. k6 = super.mouseX - anInt1087;
  8413. j7 = super.mouseY - anInt1088;
  8414. if(k6 < 5 && k6 > -5)
  8415. k6 = 0;
  8416. if(j7 < 5 && j7 > -5)
  8417. j7 = 0;
  8418. if(anInt989 < 5) {
  8419. k6 = 0;
  8420. j7 = 0;
  8421. }
  8422. class30_sub2_sub1_sub1_2.drawSprite1(k5 + k6, j6 + j7);
  8423. if(j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  8424. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  8425. if(i10 > anInt945 * 10)
  8426. i10 = anInt945 * 10;
  8427. if(i10 > class9.scrollPosition)
  8428. i10 = class9.scrollPosition;
  8429. class9.scrollPosition -= i10;
  8430. anInt1088 += i10;
  8431. }
  8432. if(j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  8433. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  8434. if(j10 > anInt945 * 10)
  8435. j10 = anInt945 * 10;
  8436. if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  8437. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  8438. class9.scrollPosition += j10;
  8439. anInt1088 -= j10;
  8440. }
  8441. } else if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  8442. class30_sub2_sub1_sub1_2.drawSprite1(k5, j6);
  8443. else
  8444. class30_sub2_sub1_sub1_2.drawSprite(k5, j6);
  8445. if(class30_sub2_sub1_sub1_2.anInt1444 == 33 || class9_1.invStackSizes[i3] != 1)
  8446. {
  8447. int k10 = class9_1.invStackSizes[i3];
  8448. if(k10 >= 1)
  8449. smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8450. if(k10 >= 100000)
  8451. smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8452. if(k10 >= 10000000)
  8453. smallText.method385(0x49E20E, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8454.  
  8455. /*smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  8456. smallText.method385(0xffff00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);*/
  8457. }
  8458. }
  8459. }
  8460. } else if(class9_1.sprites != null && i3 < 20) {
  8461. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  8462. if(class30_sub2_sub1_sub1_1 != null)
  8463. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  8464. }
  8465. i3++;
  8466. }
  8467. }
  8468. } else if(class9_1.type == 3) {
  8469. boolean flag = false;
  8470. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8471. flag = true;
  8472. int j3;
  8473. if(interfaceIsSelected(class9_1)) {
  8474. j3 = class9_1.anInt219;
  8475. if(flag && class9_1.anInt239 != 0)
  8476. j3 = class9_1.anInt239;
  8477. } else {
  8478. j3 = class9_1.textColor;
  8479. if(flag && class9_1.anInt216 != 0)
  8480. j3 = class9_1.anInt216;
  8481. }
  8482. if(class9_1.aByte254 == 0) {
  8483. if(class9_1.aBoolean227)
  8484. DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  8485. else
  8486. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  8487. } else if(class9_1.aBoolean227)
  8488. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.aByte254 & 0xff), k2);
  8489. else
  8490. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.aByte254 & 0xff), j3, class9_1.width, k2);
  8491. } else if(class9_1.type == 4) {
  8492. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  8493. String s = class9_1.message;
  8494. boolean flag1 = false;
  8495. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8496. flag1 = true;
  8497. int i4;
  8498. if(interfaceIsSelected(class9_1)) {
  8499. i4 = class9_1.anInt219;
  8500. if(flag1 && class9_1.anInt239 != 0)
  8501. i4 = class9_1.anInt239;
  8502. if(class9_1.aString228.length() > 0)
  8503. s = class9_1.aString228;
  8504. } else {
  8505. i4 = class9_1.textColor;
  8506. if(flag1 && class9_1.anInt216 != 0)
  8507. i4 = class9_1.anInt216;
  8508. }
  8509. if(class9_1.atActionType == 6 && aBoolean1149) {
  8510. s = "Please wait...";
  8511. i4 = class9_1.textColor;
  8512. }
  8513. if(DrawingArea.width == 519) {
  8514. if(i4 == 0xffff00)
  8515. i4 = 255;
  8516. if(i4 == 49152)
  8517. i4 = 0xffffff;
  8518. }
  8519. if((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  8520. switch (i4) {
  8521. case 16773120: i4 = 0xFE981F; break;
  8522. case 7040819: i4 = 0xAF6A1A; break;
  8523. }
  8524. }
  8525. for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
  8526. {
  8527. if(s.indexOf("%") != -1)
  8528. {
  8529. do
  8530. {
  8531. int k7 = s.indexOf("%1");
  8532. if(k7 == -1)
  8533. break;
  8534. 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)
  8535. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8536. else
  8537. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8538. } while(true);
  8539. do
  8540. {
  8541. int l7 = s.indexOf("%2");
  8542. if(l7 == -1)
  8543. break;
  8544. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  8545. } while(true);
  8546. do
  8547. {
  8548. int i8 = s.indexOf("%3");
  8549. if(i8 == -1)
  8550. break;
  8551. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  8552. } while(true);
  8553. do
  8554. {
  8555. int j8 = s.indexOf("%4");
  8556. if(j8 == -1)
  8557. break;
  8558. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  8559. } while(true);
  8560. do
  8561. {
  8562. int k8 = s.indexOf("%5");
  8563. if(k8 == -1)
  8564. break;
  8565. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  8566. } while(true);
  8567. }
  8568. int l8 = s.indexOf("\\n");
  8569. String s1;
  8570. if(l8 != -1)
  8571. {
  8572. s1 = s.substring(0, l8);
  8573. s = s.substring(l8 + 2);
  8574. } else
  8575. {
  8576. s1 = s;
  8577. s = "";
  8578. }
  8579. if(class9_1.centerText)
  8580. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadow);
  8581. else
  8582. textDrawingArea.method389(class9_1.textShadow, k2, i4, s1, l6);
  8583. }
  8584. } else if(class9_1.type == 5) {
  8585. //whats this?
  8586. Sprite sprite;
  8587. if(interfaceIsSelected(class9_1))
  8588. sprite = class9_1.sprite2;
  8589. else
  8590. sprite = class9_1.sprite1;
  8591. if(spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
  8592. sprite.drawSprite(k2, l2, 0xffffff);
  8593. } else {
  8594. if (sprite != null)
  8595. sprite.drawSprite(k2, l2);
  8596. }
  8597. if(sprite != null)
  8598. sprite.drawSprite(k2, l2);
  8599. } else if(class9_1.type == 6) {
  8600. int k3 = Texture.textureInt1;
  8601. int j4 = Texture.textureInt2;
  8602. Texture.textureInt1 = k2 + class9_1.width / 2;
  8603. Texture.textureInt2 = l2 + class9_1.height / 2;
  8604. int i5 = Texture.anIntArray1470[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8605. int l5 = Texture.anIntArray1471[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8606. boolean flag2 = interfaceIsSelected(class9_1);
  8607. int i7;
  8608. if(flag2)
  8609. i7 = class9_1.anInt258;
  8610. else
  8611. i7 = class9_1.anInt257;
  8612. Model model;
  8613. if(i7 == -1) {
  8614. model = class9_1.method209(-1, -1, flag2);
  8615. } else {
  8616. Animation animation = Animation.anims[i7];
  8617. model = class9_1.method209(animation.anIntArray354[class9_1.anInt246], animation.anIntArray353[class9_1.anInt246], flag2);
  8618. }
  8619. if(model != null)
  8620. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  8621. Texture.textureInt1 = k3;
  8622. Texture.textureInt2 = j4;
  8623. } else if(class9_1.type == 7) {
  8624. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  8625. int k4 = 0;
  8626. for(int j5 = 0; j5 < class9_1.height; j5++) {
  8627. for(int i6 = 0; i6 < class9_1.width; i6++) {
  8628. if(class9_1.inv[k4] > 0) {
  8629. ItemDef itemDef = ItemDef.forID(class9_1.inv[k4] - 1);
  8630. String s2 = itemDef.name;
  8631. if(itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  8632. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  8633. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  8634. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  8635. if(class9_1.centerText)
  8636. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadow);
  8637. else
  8638. textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  8639. }
  8640. k4++;
  8641. }
  8642. }
  8643. } else if (class9_1.type == 8) {
  8644. drawHoverBox(k2, l2, class9_1.popupString);
  8645. }
  8646. }
  8647. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  8648. }
  8649.  
  8650. private void randomizeBackground(Background background) {
  8651. int j = 256;
  8652. for(int k = 0; k < anIntArray1190.length; k++)
  8653. anIntArray1190[k] = 0;
  8654.  
  8655. for(int l = 0; l < 5000; l++) {
  8656. int i1 = (int)(Math.random() * 128D * (double)j);
  8657. anIntArray1190[i1] = (int)(Math.random() * 256D);
  8658. }
  8659. for(int j1 = 0; j1 < 20; j1++) {
  8660. for(int k1 = 1; k1 < j - 1; k1++) {
  8661. for(int i2 = 1; i2 < 127; i2++) {
  8662. int k2 = i2 + (k1 << 7);
  8663. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  8664. }
  8665.  
  8666. }
  8667. int ai[] = anIntArray1190;
  8668. anIntArray1190 = anIntArray1191;
  8669. anIntArray1191 = ai;
  8670. }
  8671. if(background != null) {
  8672. int l1 = 0;
  8673. for(int j2 = 0; j2 < background.anInt1453; j2++) {
  8674. for(int l2 = 0; l2 < background.anInt1452; l2++)
  8675. if(background.aByteArray1450[l1++] != 0) {
  8676. int i3 = l2 + 16 + background.anInt1454;
  8677. int j3 = j2 + 16 + background.anInt1455;
  8678. int k3 = i3 + (j3 << 7);
  8679. anIntArray1190[k3] = 0;
  8680. }
  8681. }
  8682. }
  8683. }
  8684.  
  8685. private void method107(int i, int j, Stream stream, Player player)
  8686. {
  8687. if((i & 0x400) != 0)
  8688. {
  8689. player.anInt1543 = stream.method428();
  8690. player.anInt1545 = stream.method428();
  8691. player.anInt1544 = stream.method428();
  8692. player.anInt1546 = stream.method428();
  8693. player.anInt1547 = stream.method436() + loopCycle;
  8694. player.anInt1548 = stream.method435() + loopCycle;
  8695. player.anInt1549 = stream.method428();
  8696. player.method446();
  8697. }
  8698. if((i & 0x100) != 0)
  8699. {
  8700. player.anInt1520 = stream.method434();
  8701. int k = stream.readDWord();
  8702. player.anInt1524 = k >> 16;
  8703. player.anInt1523 = loopCycle + (k & 0xffff);
  8704. player.anInt1521 = 0;
  8705. player.anInt1522 = 0;
  8706. if(player.anInt1523 > loopCycle)
  8707. player.anInt1521 = -1;
  8708. if(player.anInt1520 == 65535)
  8709. player.anInt1520 = -1;
  8710. }
  8711. if((i & 8) != 0)
  8712. {
  8713. int l = stream.method434();
  8714. if(l == 65535)
  8715. l = -1;
  8716. int i2 = stream.method427();
  8717. if(l == player.anim && l != -1)
  8718. {
  8719. int i3 = Animation.anims[l].anInt365;
  8720. if(i3 == 1)
  8721. {
  8722. player.anInt1527 = 0;
  8723. player.anInt1528 = 0;
  8724. player.anInt1529 = i2;
  8725. player.anInt1530 = 0;
  8726. }
  8727. if(i3 == 2)
  8728. player.anInt1530 = 0;
  8729. } else
  8730. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  8731. {
  8732. player.anim = l;
  8733. player.anInt1527 = 0;
  8734. player.anInt1528 = 0;
  8735. player.anInt1529 = i2;
  8736. player.anInt1530 = 0;
  8737. player.anInt1542 = player.smallXYIndex;
  8738. }
  8739. }
  8740. if((i & 4) != 0)
  8741. {
  8742. player.textSpoken = stream.readString();
  8743. if(player.textSpoken.charAt(0) == '~')
  8744. {
  8745. player.textSpoken = player.textSpoken.substring(1);
  8746. pushMessage(player.textSpoken, 2, player.name);
  8747. } else
  8748. if(player == myPlayer)
  8749. pushMessage(player.textSpoken, 2, player.name);
  8750. player.anInt1513 = 0;
  8751. player.anInt1531 = 0;
  8752. player.textCycle = 150;
  8753. }
  8754. if((i & 0x80) != 0)
  8755. {
  8756. //right fucking here
  8757. int i1 = stream.method434();
  8758. int j2 = stream.readUnsignedByte();
  8759. int j3 = stream.method427();
  8760. int k3 = stream.currentOffset;
  8761. if(player.name != null && player.visible)
  8762. {
  8763. long l3 = TextClass.longForName(player.name);
  8764. boolean flag = false;
  8765. if(j2 <= 1)
  8766. {
  8767. for(int i4 = 0; i4 < ignoreCount; i4++)
  8768. {
  8769. if(ignoreListAsLongs[i4] != l3)
  8770. continue;
  8771. flag = true;
  8772. break;
  8773. }
  8774.  
  8775. }
  8776. if(!flag && anInt1251 == 0)
  8777. try
  8778. {
  8779. aStream_834.currentOffset = 0;
  8780. stream.method442(j3, 0, aStream_834.buffer);
  8781. aStream_834.currentOffset = 0;
  8782. String s = TextInput.method525(j3, aStream_834);
  8783. //s = Censor.doCensor(s);
  8784. player.textSpoken = s;
  8785. player.anInt1513 = i1 >> 8;
  8786. player.privelage = j2;
  8787. player.anInt1531 = i1 & 0xff;
  8788. player.textCycle = 150;
  8789. if(j2 == 2 || j2 == 3)
  8790. pushMessage(s, 1, "@cr2@" + player.name);
  8791. else if(j2 == 1)
  8792. pushMessage(s, 1, "@cr1@" + player.name);
  8793. else
  8794. pushMessage(s, 2, player.name);
  8795. }
  8796. catch(Exception exception)
  8797. {
  8798. signlink.reporterror("cde2");
  8799. }
  8800. }
  8801. stream.currentOffset = k3 + j3;
  8802. }
  8803. if((i & 1) != 0)
  8804. {
  8805. player.interactingEntity = stream.method434();
  8806. if(player.interactingEntity == 65535)
  8807. player.interactingEntity = -1;
  8808. }
  8809. if((i & 0x10) != 0)
  8810. {
  8811. int j1 = stream.method427();
  8812. byte abyte0[] = new byte[j1];
  8813. Stream stream_1 = new Stream(abyte0);
  8814. stream.readBytes(j1, 0, abyte0);
  8815. aStreamArray895s[j] = stream_1;
  8816. player.updatePlayer(stream_1);
  8817. }
  8818. if((i & 2) != 0)
  8819. {
  8820. player.anInt1538 = stream.method436();
  8821. player.anInt1539 = stream.method434();
  8822. }
  8823. if((i & 0x20) != 0)
  8824. {
  8825. int k1 = stream.readUnsignedByte();
  8826. int k2 = stream.method426();
  8827. player.updateHitData(k2, k1, loopCycle);
  8828. player.loopCycleStatus = loopCycle + 300;
  8829. player.currentHealth = stream.method427();
  8830. player.maxHealth = stream.readUnsignedByte();
  8831. }
  8832. if((i & 0x200) != 0)
  8833. {
  8834. int l1 = stream.readUnsignedByte();
  8835. int l2 = stream.method428();
  8836. player.updateHitData(l2, l1, loopCycle);
  8837. player.loopCycleStatus = loopCycle + 300;
  8838. player.currentHealth = stream.readUnsignedByte();
  8839. player.maxHealth = stream.method427();
  8840. }
  8841. }
  8842.  
  8843. private void method108()
  8844. {
  8845. try
  8846. {
  8847. int j = myPlayer.x + anInt1278;
  8848. int k = myPlayer.y + anInt1131;
  8849. if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  8850. {
  8851. anInt1014 = j;
  8852. anInt1015 = k;
  8853. }
  8854. if(anInt1014 != j)
  8855. anInt1014 += (j - anInt1014) / 16;
  8856. if(anInt1015 != k)
  8857. anInt1015 += (k - anInt1015) / 16;
  8858. if(super.keyArray[1] == 1)
  8859. anInt1186 += (-24 - anInt1186) / 2;
  8860. else
  8861. if(super.keyArray[2] == 1)
  8862. anInt1186 += (24 - anInt1186) / 2;
  8863. else
  8864. anInt1186 /= 2;
  8865. if(super.keyArray[3] == 1)
  8866. anInt1187 += (12 - anInt1187) / 2;
  8867. else
  8868. if(super.keyArray[4] == 1)
  8869. anInt1187 += (-12 - anInt1187) / 2;
  8870. else
  8871. anInt1187 /= 2;
  8872. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  8873. anInt1184 += anInt1187 / 2;
  8874. if(anInt1184 < 128)
  8875. anInt1184 = 128;
  8876. if(anInt1184 > 383)
  8877. anInt1184 = 383;
  8878. int l = anInt1014 >> 7;
  8879. int i1 = anInt1015 >> 7;
  8880. int j1 = method42(plane, anInt1015, anInt1014);
  8881. int k1 = 0;
  8882. if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  8883. {
  8884. for(int l1 = l - 4; l1 <= l + 4; l1++)
  8885. {
  8886. for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  8887. {
  8888. int l2 = plane;
  8889. if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  8890. l2++;
  8891. int i3 = j1 - intGroundArray[l2][l1][k2];
  8892. if(i3 > k1)
  8893. k1 = i3;
  8894. }
  8895.  
  8896. }
  8897.  
  8898. }
  8899. anInt1005++;
  8900. if(anInt1005 > 1512)
  8901. {
  8902. anInt1005 = 0;
  8903. stream.createFrame(77);
  8904. stream.writeWordBigEndian(0);
  8905. int i2 = stream.currentOffset;
  8906. stream.writeWordBigEndian((int)(Math.random() * 256D));
  8907. stream.writeWordBigEndian(101);
  8908. stream.writeWordBigEndian(233);
  8909. stream.writeWord(45092);
  8910. if((int)(Math.random() * 2D) == 0)
  8911. stream.writeWord(35784);
  8912. stream.writeWordBigEndian((int)(Math.random() * 256D));
  8913. stream.writeWordBigEndian(64);
  8914. stream.writeWordBigEndian(38);
  8915. stream.writeWord((int)(Math.random() * 65536D));
  8916. stream.writeWord((int)(Math.random() * 65536D));
  8917. stream.writeBytes(stream.currentOffset - i2);
  8918. }
  8919. int j2 = k1 * 192;
  8920. if(j2 > 0x17f00)
  8921. j2 = 0x17f00;
  8922. if(j2 < 32768)
  8923. j2 = 32768;
  8924. if(j2 > anInt984)
  8925. {
  8926. anInt984 += (j2 - anInt984) / 24;
  8927. return;
  8928. }
  8929. if(j2 < anInt984)
  8930. {
  8931. anInt984 += (j2 - anInt984) / 80;
  8932. }
  8933. }
  8934. catch(Exception _ex)
  8935. {
  8936. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  8937. throw new RuntimeException("eek");
  8938. }
  8939. }
  8940.  
  8941. public void processDrawing()
  8942. {
  8943. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  8944. {
  8945. showErrorScreen();
  8946. return;
  8947. }
  8948. anInt1061++;
  8949. if(!loggedIn)
  8950. drawLoginScreen(false);
  8951. else
  8952. drawGameScreen();
  8953. anInt1213 = 0;
  8954. }
  8955.  
  8956. private boolean isFriendOrSelf(String s)
  8957. {
  8958. if(s == null)
  8959. return false;
  8960. for(int i = 0; i < friendsCount; i++)
  8961. if(s.equalsIgnoreCase(friendsList[i]))
  8962. return true;
  8963. return s.equalsIgnoreCase(myPlayer.name);
  8964. }
  8965.  
  8966. private static String combatDiffColor(int i, int j)
  8967. {
  8968. int k = i - j;
  8969. if(k < -9)
  8970. return "@red@";
  8971. if(k < -6)
  8972. return "@or3@";
  8973. if(k < -3)
  8974. return "@or2@";
  8975. if(k < 0)
  8976. return "@or1@";
  8977. if(k > 9)
  8978. return "@gre@";
  8979. if(k > 6)
  8980. return "@gr3@";
  8981. if(k > 3)
  8982. return "@gr2@";
  8983. if(k > 0)
  8984. return "@gr1@";
  8985. else
  8986. return "@yel@";
  8987. }
  8988.  
  8989. private void setWaveVolume(int i)
  8990. {
  8991. signlink.wavevol = i;
  8992. }
  8993.  
  8994. private void draw3dScreen()
  8995. {
  8996. drawSplitPrivateChat();
  8997. if(crossType == 1)
  8998. {
  8999. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9000. anInt1142++;
  9001. if(anInt1142 > 67)
  9002. {
  9003. anInt1142 = 0;
  9004. stream.createFrame(78);
  9005. }
  9006. }
  9007. if(crossType == 2)
  9008. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9009. if(anInt1018 != -1)
  9010. {
  9011. method119(anInt945, anInt1018);
  9012. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  9013. }
  9014. if(openInterfaceID != -1)
  9015. {
  9016. method119(anInt945, openInterfaceID);
  9017. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  9018. }
  9019. method70();
  9020. if(!menuOpen)
  9021. {
  9022. processRightClick();
  9023. drawTooltip();
  9024. } else
  9025. if(menuScreenArea == 0)
  9026. drawMenu();
  9027. if(anInt1055 == 1)
  9028. multiOverlay.drawSprite(472, 296);
  9029. if(fpsOn)
  9030. {
  9031. char c = '\u01FB';
  9032. int k = 20;
  9033. int i1 = 0xffff00;
  9034. if(super.fps < 15)
  9035. i1 = 0xff0000;
  9036. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  9037. k += 15;
  9038. Runtime runtime = Runtime.getRuntime();
  9039. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9040. i1 = 0xffff00;
  9041. if(j1 > 0x2000000 && lowMem)
  9042. i1 = 0xff0000;
  9043. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  9044. k += 15;
  9045. }
  9046. int i1 = 0xffff00;
  9047. int x = baseX + (myPlayer.x - 6 >> 7);
  9048. int y = baseY + (myPlayer.y - 6 >> 7);
  9049. if (clientData)
  9050. {
  9051. char c = '\u01FB';
  9052. int k = 20;
  9053. if(super.fps < 15)
  9054. i1 = 0xff0000;
  9055. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285, 5);
  9056. Runtime runtime = Runtime.getRuntime();
  9057. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9058. i1 = 0xffff00;
  9059. if(j1 > 0x2000000 && lowMem)
  9060. i1 = 0xff0000;
  9061. k += 15;
  9062. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299, 5);
  9063. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  9064. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
  9065. }
  9066. if(anInt1104 != 0)
  9067. {
  9068. int j = anInt1104 / 50;
  9069. int l = j / 60;
  9070. j %= 60;
  9071. if(j < 10)
  9072. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  9073. else
  9074. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  9075. anInt849++;
  9076. if(anInt849 > 75)
  9077. {
  9078. anInt849 = 0;
  9079. stream.createFrame(148);
  9080. }
  9081. }
  9082. }
  9083.  
  9084. private void addIgnore(long l)
  9085. {
  9086. try
  9087. {
  9088. if(l == 0L)
  9089. return;
  9090. if(ignoreCount >= 100)
  9091. {
  9092. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  9093. return;
  9094. }
  9095. String s = TextClass.fixName(TextClass.nameForLong(l));
  9096. for(int j = 0; j < ignoreCount; j++)
  9097. if(ignoreListAsLongs[j] == l)
  9098. {
  9099. pushMessage(s + " is already on your ignore list", 0, "");
  9100. return;
  9101. }
  9102. for(int k = 0; k < friendsCount; k++)
  9103. if(friendsListAsLongs[k] == l)
  9104. {
  9105. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  9106. return;
  9107. }
  9108.  
  9109. ignoreListAsLongs[ignoreCount++] = l;
  9110. needDrawTabArea = true;
  9111. stream.createFrame(133);
  9112. stream.writeQWord(l);
  9113. return;
  9114. }
  9115. catch(RuntimeException runtimeexception)
  9116. {
  9117. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  9118. }
  9119. throw new RuntimeException();
  9120. }
  9121.  
  9122. private void method114()
  9123. {
  9124. for(int i = -1; i < playerCount; i++)
  9125. {
  9126. int j;
  9127. if(i == -1)
  9128. j = myPlayerIndex;
  9129. else
  9130. j = playerIndices[i];
  9131. Player player = playerArray[j];
  9132. if(player != null)
  9133. method96(player);
  9134. }
  9135.  
  9136. }
  9137.  
  9138. private void method115()
  9139. {
  9140. if(loadingStage == 2)
  9141. {
  9142. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  9143. {
  9144. if(class30_sub1.anInt1294 > 0)
  9145. class30_sub1.anInt1294--;
  9146. if(class30_sub1.anInt1294 == 0)
  9147. {
  9148. if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  9149. {
  9150. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  9151. class30_sub1.unlink();
  9152. }
  9153. } else
  9154. {
  9155. if(class30_sub1.anInt1302 > 0)
  9156. class30_sub1.anInt1302--;
  9157. 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)))
  9158. {
  9159. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  9160. class30_sub1.anInt1302 = -1;
  9161. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  9162. class30_sub1.unlink();
  9163. else
  9164. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  9165. class30_sub1.unlink();
  9166. }
  9167. }
  9168. }
  9169.  
  9170. }
  9171. }
  9172.  
  9173.  
  9174. //stops the click from going over sprite
  9175. private void determineMenuSize()
  9176. {
  9177. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  9178. for(int j = 0; j < menuActionRow; j++)
  9179. {
  9180. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  9181. if(k > i)
  9182. i = k;
  9183. }
  9184.  
  9185. i += 8;
  9186. int l = 15 * menuActionRow + 21;
  9187. if(super.saveClickX > 4 && super.saveClickY > 4 && super.saveClickX < 516 && super.saveClickY < 338)
  9188. {
  9189. int i1 = super.saveClickX - 4 - i / 2;
  9190. if(i1 + i > 512)
  9191. i1 = 512 - i;
  9192. if(i1 < 0)
  9193. i1 = 0;
  9194. int l1 = super.saveClickY - 4;
  9195. if(l1 + l > 334)
  9196. l1 = 334 - l;
  9197. if(l1 < 0)
  9198. l1 = 0;
  9199. menuOpen = true;
  9200. menuScreenArea = 0;
  9201. menuOffsetX = i1;
  9202. menuOffsetY = l1;
  9203. menuWidth = i;
  9204. menuHeight = 15 * menuActionRow + 22;
  9205. }
  9206. if(super.saveClickX > 519 && super.saveClickY > 168 && super.saveClickX < 765 && super.saveClickY < 503)
  9207. {
  9208. int j1 = super.saveClickX - 519 - i / 2;
  9209. if(j1 < 0)
  9210. j1 = 0;
  9211. else
  9212. if(j1 + i > 245)
  9213. j1 = 245 - i;
  9214. int i2 = super.saveClickY - 168;
  9215. if(i2 < 0)
  9216. i2 = 0;
  9217. else
  9218. if(i2 + l > 333)
  9219. i2 = 333 - l;
  9220. menuOpen = true;
  9221. menuScreenArea = 1;
  9222. menuOffsetX = j1;
  9223. menuOffsetY = i2;
  9224. menuWidth = i;
  9225. menuHeight = 15 * menuActionRow + 22;
  9226. }
  9227. if(super.saveClickX > 0 && super.saveClickY > 338 && super.saveClickX < 516 && super.saveClickY < 503)
  9228. {
  9229. int k1 = super.saveClickX - 0 - i / 2;
  9230. if(k1 < 0)
  9231. k1 = 0;
  9232. else
  9233. if(k1 + i > 516)
  9234. k1 = 516 - i;
  9235. int j2 = super.saveClickY - 338;
  9236. if(j2 < 0)
  9237. j2 = 0;
  9238. else
  9239. if(j2 + l > 165)
  9240. j2 = 165 - l;
  9241. menuOpen = true;
  9242. menuScreenArea = 2;
  9243. menuOffsetX = k1;
  9244. menuOffsetY = j2;
  9245. menuWidth = i;
  9246. menuHeight = 15 * menuActionRow + 22;
  9247. }
  9248. }
  9249.  
  9250. private void method117(Stream stream)
  9251. {
  9252. stream.initBitAccess();
  9253. int j = stream.readBits(1);
  9254. if(j == 0)
  9255. return;
  9256. int k = stream.readBits(2);
  9257. if(k == 0)
  9258. {
  9259. anIntArray894[anInt893++] = myPlayerIndex;
  9260. return;
  9261. }
  9262. if(k == 1)
  9263. {
  9264. int l = stream.readBits(3);
  9265. myPlayer.moveInDir(false, l);
  9266. int k1 = stream.readBits(1);
  9267. if(k1 == 1)
  9268. anIntArray894[anInt893++] = myPlayerIndex;
  9269. return;
  9270. }
  9271. if(k == 2)
  9272. {
  9273. int i1 = stream.readBits(3);
  9274. myPlayer.moveInDir(true, i1);
  9275. int l1 = stream.readBits(3);
  9276. myPlayer.moveInDir(true, l1);
  9277. int j2 = stream.readBits(1);
  9278. if(j2 == 1)
  9279. anIntArray894[anInt893++] = myPlayerIndex;
  9280. return;
  9281. }
  9282. if(k == 3)
  9283. {
  9284. plane = stream.readBits(2);
  9285. int j1 = stream.readBits(1);
  9286. int i2 = stream.readBits(1);
  9287. if(i2 == 1)
  9288. anIntArray894[anInt893++] = myPlayerIndex;
  9289. int k2 = stream.readBits(7);
  9290. int l2 = stream.readBits(7);
  9291. myPlayer.setPos(l2, k2, j1 == 1);
  9292. }
  9293. }
  9294.  
  9295. private void nullLoader()
  9296. {
  9297. aBoolean831 = false;
  9298. while(drawingFlames)
  9299. {
  9300. aBoolean831 = false;
  9301. try
  9302. {
  9303. Thread.sleep(50L);
  9304. }
  9305. catch(Exception _ex) { }
  9306. }
  9307. aBackground_966 = null;
  9308. aBackground_967 = null;
  9309. aBackgroundArray1152s = null;
  9310. anIntArray850 = null;
  9311. anIntArray851 = null;
  9312. anIntArray852 = null;
  9313. anIntArray853 = null;
  9314. anIntArray1190 = null;
  9315. anIntArray1191 = null;
  9316. anIntArray828 = null;
  9317. anIntArray829 = null;
  9318. aClass30_Sub2_Sub1_Sub1_1201 = null;
  9319. aClass30_Sub2_Sub1_Sub1_1202 = null;
  9320. }
  9321.  
  9322. private boolean method119(int i, int j)
  9323. {
  9324. boolean flag1 = false;
  9325. RSInterface class9 = RSInterface.interfaceCache[j];
  9326. for(int k = 0; k < class9.children.length; k++)
  9327. {
  9328. if(class9.children[k] == -1)
  9329. break;
  9330. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  9331. if(class9_1.type == 1)
  9332. flag1 |= method119(i, class9_1.id);
  9333. if(class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1))
  9334. {
  9335. boolean flag2 = interfaceIsSelected(class9_1);
  9336. int l;
  9337. if(flag2)
  9338. l = class9_1.anInt258;
  9339. else
  9340. l = class9_1.anInt257;
  9341. if(l != -1)
  9342. {
  9343. Animation animation = Animation.anims[l];
  9344. for(class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);)
  9345. {
  9346. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  9347. class9_1.anInt246++;
  9348. if(class9_1.anInt246 >= animation.anInt352)
  9349. {
  9350. class9_1.anInt246 -= animation.anInt356;
  9351. if(class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  9352. class9_1.anInt246 = 0;
  9353. }
  9354. flag1 = true;
  9355. }
  9356.  
  9357. }
  9358. }
  9359. }
  9360.  
  9361. return flag1;
  9362. }
  9363.  
  9364. private int method120()
  9365. {
  9366. int j = 3;
  9367. if(yCameraCurve < 310)
  9368. {
  9369. int k = xCameraPos >> 7;
  9370. int l = yCameraPos >> 7;
  9371. int i1 = myPlayer.x >> 7;
  9372. int j1 = myPlayer.y >> 7;
  9373. if((byteGroundArray[plane][k][l] & 4) != 0)
  9374. j = plane;
  9375. int k1;
  9376. if(i1 > k)
  9377. k1 = i1 - k;
  9378. else
  9379. k1 = k - i1;
  9380. int l1;
  9381. if(j1 > l)
  9382. l1 = j1 - l;
  9383. else
  9384. l1 = l - j1;
  9385. if(k1 > l1)
  9386. {
  9387. int i2 = (l1 * 0x10000) / k1;
  9388. int k2 = 32768;
  9389. while(k != i1)
  9390. {
  9391. if(k < i1)
  9392. k++;
  9393. else
  9394. if(k > i1)
  9395. k--;
  9396. if((byteGroundArray[plane][k][l] & 4) != 0)
  9397. j = plane;
  9398. k2 += i2;
  9399. if(k2 >= 0x10000)
  9400. {
  9401. k2 -= 0x10000;
  9402. if(l < j1)
  9403. l++;
  9404. else
  9405. if(l > j1)
  9406. l--;
  9407. if((byteGroundArray[plane][k][l] & 4) != 0)
  9408. j = plane;
  9409. }
  9410. }
  9411. } else
  9412. {
  9413. int j2 = (k1 * 0x10000) / l1;
  9414. int l2 = 32768;
  9415. while(l != j1)
  9416. {
  9417. if(l < j1)
  9418. l++;
  9419. else
  9420. if(l > j1)
  9421. l--;
  9422. if((byteGroundArray[plane][k][l] & 4) != 0)
  9423. j = plane;
  9424. l2 += j2;
  9425. if(l2 >= 0x10000)
  9426. {
  9427. l2 -= 0x10000;
  9428. if(k < i1)
  9429. k++;
  9430. else
  9431. if(k > i1)
  9432. k--;
  9433. if((byteGroundArray[plane][k][l] & 4) != 0)
  9434. j = plane;
  9435. }
  9436. }
  9437. }
  9438. }
  9439. if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  9440. j = plane;
  9441. return j;
  9442. }
  9443.  
  9444. private int method121()
  9445. {
  9446. int j = method42(plane, yCameraPos, xCameraPos);
  9447. if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  9448. return plane;
  9449. else
  9450. return 3;
  9451. }
  9452.  
  9453. private void delIgnore(long l)
  9454. {
  9455. try
  9456. {
  9457. if(l == 0L)
  9458. return;
  9459. for(int j = 0; j < ignoreCount; j++)
  9460. if(ignoreListAsLongs[j] == l)
  9461. {
  9462. ignoreCount--;
  9463. needDrawTabArea = true;
  9464. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  9465.  
  9466. stream.createFrame(74);
  9467. stream.writeQWord(l);
  9468. return;
  9469. }
  9470.  
  9471. return;
  9472. }
  9473. catch(RuntimeException runtimeexception)
  9474. {
  9475. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9476. }
  9477. throw new RuntimeException();
  9478. }
  9479.  
  9480.  
  9481. private void chatJoin(long l) {
  9482. try {
  9483. if(l == 0L)
  9484. return;
  9485. stream.createFrame(60);
  9486. stream.writeQWord(l);
  9487. return;
  9488. }
  9489. catch(RuntimeException runtimeexception)
  9490. {
  9491. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9492. }
  9493. throw new RuntimeException();
  9494.  
  9495. }
  9496.  
  9497. public String getParameter(String s)
  9498. {
  9499. if(signlink.mainapp != null)
  9500. return signlink.mainapp.getParameter(s);
  9501. else
  9502. return super.getParameter(s);
  9503. }
  9504.  
  9505. private void adjustVolume(boolean flag, int i)
  9506. {
  9507. signlink.midivol = i;
  9508. if(flag)
  9509. signlink.midi = "voladjust";
  9510. }
  9511.  
  9512. private int extractInterfaceValues(RSInterface class9, int j)
  9513. {
  9514. if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  9515. return -2;
  9516. try
  9517. {
  9518. int ai[] = class9.valueIndexArray[j];
  9519. int k = 0;
  9520. int l = 0;
  9521. int i1 = 0;
  9522. do
  9523. {
  9524. int j1 = ai[l++];
  9525. int k1 = 0;
  9526. byte byte0 = 0;
  9527. if(j1 == 0)
  9528. return k;
  9529. if(j1 == 1)
  9530. k1 = currentStats[ai[l++]];
  9531. if(j1 == 2)
  9532. k1 = maxStats[ai[l++]];
  9533. if(j1 == 3)
  9534. k1 = currentExp[ai[l++]];
  9535. if(j1 == 4)
  9536. {
  9537. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  9538. int k2 = ai[l++];
  9539. if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  9540. {
  9541. for(int j3 = 0; j3 < class9_1.inv.length; j3++)
  9542. if(class9_1.inv[j3] == k2 + 1)
  9543. k1 += class9_1.invStackSizes[j3];
  9544.  
  9545. }
  9546. }
  9547. if(j1 == 5)
  9548. k1 = variousSettings[ai[l++]];
  9549. if(j1 == 6)
  9550. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  9551. if(j1 == 7)
  9552. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  9553. if(j1 == 8)
  9554. k1 = myPlayer.combatLevel;
  9555. if(j1 == 9)
  9556. {
  9557. for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  9558. if(Skills.skillEnabled[l1])
  9559. k1 += maxStats[l1];
  9560.  
  9561. }
  9562. if(j1 == 10)
  9563. {
  9564. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  9565. int l2 = ai[l++] + 1;
  9566. if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  9567. {
  9568. for(int k3 = 0; k3 < class9_2.inv.length; k3++)
  9569. {
  9570. if(class9_2.inv[k3] != l2)
  9571. continue;
  9572. k1 = 0x3b9ac9ff;
  9573. break;
  9574. }
  9575.  
  9576. }
  9577. }
  9578. if(j1 == 11)
  9579. k1 = energy;
  9580. if(j1 == 12)
  9581. k1 = weight;
  9582. if(j1 == 13)
  9583. {
  9584. int i2 = variousSettings[ai[l++]];
  9585. int i3 = ai[l++];
  9586. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  9587. }
  9588. if(j1 == 14)
  9589. {
  9590. int j2 = ai[l++];
  9591. VarBit varBit = VarBit.cache[j2];
  9592. int l3 = varBit.anInt648;
  9593. int i4 = varBit.anInt649;
  9594. int j4 = varBit.anInt650;
  9595. int k4 = anIntArray1232[j4 - i4];
  9596. k1 = variousSettings[l3] >> i4 & k4;
  9597. }
  9598. if(j1 == 15)
  9599. byte0 = 1;
  9600. if(j1 == 16)
  9601. byte0 = 2;
  9602. if(j1 == 17)
  9603. byte0 = 3;
  9604. if(j1 == 18)
  9605. k1 = (myPlayer.x >> 7) + baseX;
  9606. if(j1 == 19)
  9607. k1 = (myPlayer.y >> 7) + baseY;
  9608. if(j1 == 20)
  9609. k1 = ai[l++];
  9610. if(byte0 == 0)
  9611. {
  9612. if(i1 == 0)
  9613. k += k1;
  9614. if(i1 == 1)
  9615. k -= k1;
  9616. if(i1 == 2 && k1 != 0)
  9617. k /= k1;
  9618. if(i1 == 3)
  9619. k *= k1;
  9620. i1 = 0;
  9621. } else
  9622. {
  9623. i1 = byte0;
  9624. }
  9625. } while(true);
  9626. }
  9627. catch(Exception _ex)
  9628. {
  9629. return -1;
  9630. }
  9631. }
  9632.  
  9633. private void drawTooltip() {
  9634. if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  9635. return;
  9636. String s;
  9637. if(itemSelected == 1 && menuActionRow < 2)
  9638. s = "Use " + selectedItemName + " with...";
  9639. else if(spellSelected == 1 && menuActionRow < 2)
  9640. s = spellTooltip + "...";
  9641. else
  9642. s = menuActionName[menuActionRow - 1];
  9643. if(menuActionRow > 2)
  9644. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  9645. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  9646. }
  9647.  
  9648. private void drawMinimap() {
  9649. aRSImageProducer_1164.initDrawingArea();
  9650. if(anInt1021 == 2) {
  9651. byte abyte0[] = mapBack.aByteArray1450;
  9652. int ai[] = DrawingArea.pixels;
  9653. int k2 = abyte0.length;
  9654. for(int i5 = 0; i5 < k2; i5++)
  9655. if(abyte0[i5] == 0)
  9656. ai[i5] = 0;
  9657. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 0, 0, 33, 25);
  9658. aRSImageProducer_1165.initDrawingArea();
  9659. return;
  9660. }
  9661. int i = minimapInt1 + minimapInt2 & 0x7ff;
  9662. int j = 48 + myPlayer.x / 32;
  9663. int l2 = 464 - myPlayer.y / 32;
  9664. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, 5, 25, 146, j);
  9665. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 0, 0, 33, 25);
  9666. for(int j5 = 0; j5 < anInt1071; j5++) {
  9667. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  9668. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  9669. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  9670. }
  9671. for(int k5 = 0; k5 < 104; k5++) {
  9672. for(int l5 = 0; l5 < 104; l5++) {
  9673. NodeList class19 = groundArray[plane][k5][l5];
  9674. if(class19 != null) {
  9675. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  9676. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  9677. markMinimap(mapDotItem, l, j3);
  9678. }
  9679. }
  9680. }
  9681. for(int i6 = 0; i6 < npcCount; i6++) {
  9682. NPC npc = npcArray[npcIndices[i6]];
  9683. if(npc != null && npc.isVisible()) {
  9684. EntityDef entityDef = npc.desc;
  9685. if(entityDef.childrenIDs != null)
  9686. entityDef = entityDef.method161();
  9687. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  9688. int i1 = npc.x / 32 - myPlayer.x / 32;
  9689. int k3 = npc.y / 32 - myPlayer.y / 32;
  9690. markMinimap(mapDotNPC, i1, k3);
  9691. }
  9692. }
  9693. }
  9694. for(int j6 = 0; j6 < playerCount; j6++) {
  9695. Player player = playerArray[playerIndices[j6]];
  9696. if(player != null && player.isVisible()) {
  9697. int j1 = player.x / 32 - myPlayer.x / 32;
  9698. int l3 = player.y / 32 - myPlayer.y / 32;
  9699. boolean flag1 = false;
  9700. boolean flag3 = false;
  9701. for (int j3 = 0; j3 < clanList.length; j3++) {
  9702. if (clanList[j3] == null)
  9703. continue;
  9704. if (!clanList[j3].equalsIgnoreCase(player.name))
  9705. continue;
  9706. flag3 = true;
  9707. break;
  9708. }
  9709. long l6 = TextClass.longForName(player.name);
  9710. for(int k6 = 0; k6 < friendsCount; k6++) {
  9711. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  9712. continue;
  9713. flag1 = true;
  9714. break;
  9715. }
  9716. boolean flag2 = false;
  9717. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  9718. flag2 = true;
  9719. if(flag1)
  9720. markMinimap(mapDotFriend, j1, l3);
  9721. else if(flag3)
  9722. markMinimap(mapDotClan, j1, l3);
  9723. else if(flag2)
  9724. markMinimap(mapDotTeam, j1, l3);
  9725. else
  9726. markMinimap(mapDotPlayer, j1, l3);
  9727. }
  9728. }
  9729. if(anInt855 != 0 && loopCycle % 20 < 10) {
  9730. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  9731. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  9732. if(class30_sub2_sub4_sub1_sub1_1 != null) {
  9733. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  9734. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  9735. method81(mapMarker, i4, k1);
  9736. }
  9737. }
  9738. if(anInt855 == 2) {
  9739. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  9740. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  9741. method81(mapMarker, j4, l1);
  9742. }
  9743. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length) {
  9744. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  9745. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  9746. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  9747. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  9748. method81(mapMarker, k4, i2);
  9749. }
  9750. }
  9751. }
  9752. if(destX != 0) {
  9753. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  9754. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  9755. markMinimap(mapFlag, j2, l4);
  9756. }
  9757. DrawingArea.drawPixels(3, 78, 97, 0xffffff, 3);
  9758. mapBack.drawBackground(0, 0);
  9759. aRSImageProducer_1165.initDrawingArea();
  9760. }
  9761.  
  9762. private void npcScreenPos(Entity entity, int i) {
  9763. calcEntityScreenPos(entity.x, i, entity.y);
  9764. }
  9765.  
  9766. private void calcEntityScreenPos(int i, int j, int l) {
  9767. if(i < 128 || l < 128 || i > 13056 || l > 13056) {
  9768. spriteDrawX = -1;
  9769. spriteDrawY = -1;
  9770. return;
  9771. }
  9772. int i1 = method42(plane, l, i) - j;
  9773. i -= xCameraPos;
  9774. i1 -= zCameraPos;
  9775. l -= yCameraPos;
  9776. int j1 = Model.modelIntArray1[yCameraCurve];
  9777. int k1 = Model.modelIntArray2[yCameraCurve];
  9778. int l1 = Model.modelIntArray1[xCameraCurve];
  9779. int i2 = Model.modelIntArray2[xCameraCurve];
  9780. int j2 = l * l1 + i * i2 >> 16;
  9781. l = l * i2 - i * l1 >> 16;
  9782. i = j2;
  9783. j2 = i1 * k1 - l * j1 >> 16;
  9784. l = i1 * j1 + l * k1 >> 16;
  9785. i1 = j2;
  9786. if(l >= 50) {
  9787. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  9788. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  9789. } else {
  9790. spriteDrawX = -1;
  9791. spriteDrawY = -1;
  9792. }
  9793. }
  9794.  
  9795. private void buildSplitPrivateChatMenu()
  9796. {
  9797. if(splitPrivateChat == 0)
  9798. return;
  9799. int i = 0;
  9800. if(anInt1104 != 0)
  9801. i = 1;
  9802. for(int j = 0; j < 100; j++)
  9803. if(chatMessages[j] != null)
  9804. {
  9805. int k = chatTypes[j];
  9806. String s = chatNames[j];
  9807. boolean flag1 = false;
  9808. if(s != null && s.startsWith("@cr1@"))
  9809. {
  9810. s = s.substring(5);
  9811. boolean flag2 = true;
  9812. }
  9813. if(s != null && s.startsWith("@cr2@"))
  9814. {
  9815. s = s.substring(5);
  9816. byte byte0 = 2;
  9817. }
  9818. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  9819. {
  9820. int l = 329 - i * 13;
  9821. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  9822. {
  9823. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  9824. if(i1 > 450)
  9825. i1 = 450;
  9826. if(super.mouseX < 4 + i1)
  9827. {
  9828. if(myPrivilege >= 1)
  9829. {
  9830. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  9831. menuActionID[menuActionRow] = 2606;
  9832. menuActionRow++;
  9833. }
  9834. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  9835. menuActionID[menuActionRow] = 2042;
  9836. menuActionRow++;
  9837. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  9838. menuActionID[menuActionRow] = 2337;
  9839. menuActionRow++;
  9840. }
  9841. }
  9842. if(++i >= 5)
  9843. return;
  9844. }
  9845. if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  9846. return;
  9847. }
  9848.  
  9849. }
  9850.  
  9851. private void method130(int j, int k, int l, int i1, int j1, int k1,
  9852. int l1, int i2, int j2)
  9853. {
  9854. Class30_Sub1 class30_sub1 = null;
  9855. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  9856. {
  9857. if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  9858. continue;
  9859. class30_sub1 = class30_sub1_1;
  9860. break;
  9861. }
  9862.  
  9863. if(class30_sub1 == null)
  9864. {
  9865. class30_sub1 = new Class30_Sub1();
  9866. class30_sub1.anInt1295 = l1;
  9867. class30_sub1.anInt1296 = i1;
  9868. class30_sub1.anInt1297 = i2;
  9869. class30_sub1.anInt1298 = j1;
  9870. method89(class30_sub1);
  9871. aClass19_1179.insertHead(class30_sub1);
  9872. }
  9873. class30_sub1.anInt1291 = k;
  9874. class30_sub1.anInt1293 = k1;
  9875. class30_sub1.anInt1292 = l;
  9876. class30_sub1.anInt1302 = j2;
  9877. class30_sub1.anInt1294 = j;
  9878. }
  9879.  
  9880. private boolean interfaceIsSelected(RSInterface class9)
  9881. {
  9882. if(class9.anIntArray245 == null)
  9883. return false;
  9884. for(int i = 0; i < class9.anIntArray245.length; i++)
  9885. {
  9886. int j = extractInterfaceValues(class9, i);
  9887. int k = class9.anIntArray212[i];
  9888. if(class9.anIntArray245[i] == 2)
  9889. {
  9890. if(j >= k)
  9891. return false;
  9892. } else
  9893. if(class9.anIntArray245[i] == 3)
  9894. {
  9895. if(j <= k)
  9896. return false;
  9897. } else
  9898. if(class9.anIntArray245[i] == 4)
  9899. {
  9900. if(j == k)
  9901. return false;
  9902. } else
  9903. if(j != k)
  9904. return false;
  9905. }
  9906.  
  9907. return true;
  9908. }
  9909.  
  9910. private DataInputStream openJagGrabInputStream(String s)
  9911. throws IOException
  9912. {
  9913. // if(!aBoolean872)
  9914. // if(signlink.mainapp != null)
  9915. // return signlink.openurl(s);
  9916. // else
  9917. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  9918. if(aSocket832 != null)
  9919. {
  9920. try
  9921. {
  9922. aSocket832.close();
  9923. }
  9924. catch(Exception _ex) { }
  9925. aSocket832 = null;
  9926. }
  9927. aSocket832 = openSocket(43595);
  9928. aSocket832.setSoTimeout(10000);
  9929. java.io.InputStream inputstream = aSocket832.getInputStream();
  9930. OutputStream outputstream = aSocket832.getOutputStream();
  9931. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  9932. return new DataInputStream(inputstream);
  9933. }
  9934.  
  9935. private void doFlamesDrawing()
  9936. {
  9937. char c = '\u0100';
  9938. if(anInt1040 > 0)
  9939. {
  9940. for(int i = 0; i < 256; i++)
  9941. if(anInt1040 > 768)
  9942. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  9943. else
  9944. if(anInt1040 > 256)
  9945. anIntArray850[i] = anIntArray852[i];
  9946. else
  9947. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  9948.  
  9949. } else
  9950. if(anInt1041 > 0)
  9951. {
  9952. for(int j = 0; j < 256; j++)
  9953. if(anInt1041 > 768)
  9954. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  9955. else
  9956. if(anInt1041 > 256)
  9957. anIntArray850[j] = anIntArray853[j];
  9958. else
  9959. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  9960.  
  9961. } else
  9962. {
  9963. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  9964.  
  9965. }
  9966. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, aRSImageProducer_1110.anIntArray315, 0, 33920);
  9967.  
  9968. int i1 = 0;
  9969. int j1 = 1152;
  9970. for(int k1 = 1; k1 < c - 1; k1++)
  9971. {
  9972. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  9973. int j2 = 22 + l1;
  9974. if(j2 < 0)
  9975. j2 = 0;
  9976. i1 += j2;
  9977. for(int l2 = j2; l2 < 128; l2++)
  9978. {
  9979. int j3 = anIntArray828[i1++];
  9980. if(j3 != 0)
  9981. {
  9982. int l3 = j3;
  9983. int j4 = 256 - j3;
  9984. j3 = anIntArray850[j3];
  9985. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  9986. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  9987. } else
  9988. {
  9989. j1++;
  9990. }
  9991. }
  9992.  
  9993. j1 += j2;
  9994. }
  9995.  
  9996. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  9997. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, aRSImageProducer_1111.anIntArray315, 0, 33920);
  9998.  
  9999. i1 = 0;
  10000. j1 = 1176;
  10001. for(int k2 = 1; k2 < c - 1; k2++)
  10002. {
  10003. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  10004. int k3 = 103 - i3;
  10005. j1 += i3;
  10006. for(int i4 = 0; i4 < k3; i4++)
  10007. {
  10008. int k4 = anIntArray828[i1++];
  10009. if(k4 != 0)
  10010. {
  10011. int i5 = k4;
  10012. int j5 = 256 - k4;
  10013. k4 = anIntArray850[k4];
  10014. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  10015. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  10016. } else
  10017. {
  10018. j1++;
  10019. }
  10020. }
  10021.  
  10022. i1 += 128 - k3;
  10023. j1 += 128 - k3 - i3;
  10024. }
  10025.  
  10026. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  10027. }
  10028.  
  10029. private void method134(Stream stream)
  10030. {
  10031. int j = stream.readBits(8);
  10032. if(j < playerCount)
  10033. {
  10034. for(int k = j; k < playerCount; k++)
  10035. anIntArray840[anInt839++] = playerIndices[k];
  10036.  
  10037. }
  10038. if(j > playerCount)
  10039. {
  10040. signlink.reporterror(myUsername + " Too many players");
  10041. throw new RuntimeException("eek");
  10042. }
  10043. playerCount = 0;
  10044. for(int l = 0; l < j; l++)
  10045. {
  10046. int i1 = playerIndices[l];
  10047. Player player = playerArray[i1];
  10048. int j1 = stream.readBits(1);
  10049. if(j1 == 0)
  10050. {
  10051. playerIndices[playerCount++] = i1;
  10052. player.anInt1537 = loopCycle;
  10053. } else
  10054. {
  10055. int k1 = stream.readBits(2);
  10056. if(k1 == 0)
  10057. {
  10058. playerIndices[playerCount++] = i1;
  10059. player.anInt1537 = loopCycle;
  10060. anIntArray894[anInt893++] = i1;
  10061. } else
  10062. if(k1 == 1)
  10063. {
  10064. playerIndices[playerCount++] = i1;
  10065. player.anInt1537 = loopCycle;
  10066. int l1 = stream.readBits(3);
  10067. player.moveInDir(false, l1);
  10068. int j2 = stream.readBits(1);
  10069. if(j2 == 1)
  10070. anIntArray894[anInt893++] = i1;
  10071. } else
  10072. if(k1 == 2)
  10073. {
  10074. playerIndices[playerCount++] = i1;
  10075. player.anInt1537 = loopCycle;
  10076. int i2 = stream.readBits(3);
  10077. player.moveInDir(true, i2);
  10078. int k2 = stream.readBits(3);
  10079. player.moveInDir(true, k2);
  10080. int l2 = stream.readBits(1);
  10081. if(l2 == 1)
  10082. anIntArray894[anInt893++] = i1;
  10083. } else
  10084. if(k1 == 3)
  10085. anIntArray840[anInt839++] = i1;
  10086. }
  10087. }
  10088. }
  10089.  
  10090. private void drawLoginScreen(boolean flag)
  10091. {
  10092. resetImageProducers();
  10093. aRSImageProducer_1109.initDrawingArea();
  10094. aBackground_966.drawBackground(0, 0);
  10095. char c = '\u0168';
  10096. char c1 = '\310';
  10097. if(loginScreenState == 0)
  10098. {
  10099. int i = c1 / 2 + 80;
  10100. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  10101. i = c1 / 2 - 20;
  10102. chatTextDrawingArea.method382(0xffff00, c / 2, "Welcome to RuneScape", i, true);
  10103. i += 30;
  10104. int l = c / 2 - 80;
  10105. int k1 = c1 / 2 + 20;
  10106. aBackground_967.drawBackground(l - 73, k1 - 20);
  10107. chatTextDrawingArea.method382(0xffffff, l, "New User", k1 + 5, true);
  10108. l = c / 2 + 80;
  10109. aBackground_967.drawBackground(l - 73, k1 - 20);
  10110. chatTextDrawingArea.method382(0xffffff, l, "Existing User", k1 + 5, true);
  10111. }
  10112. if(loginScreenState == 2)
  10113. {
  10114. int j = c1 / 2 - 40;
  10115. if(loginMessage1.length() > 0)
  10116. {
  10117. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  10118. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j, true);
  10119. j += 30;
  10120. } else
  10121. {
  10122. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  10123. j += 30;
  10124. }
  10125. chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff, "Username: " + myUsername + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10126. j += 15;
  10127. chatTextDrawingArea.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10128. j += 15;
  10129. if(!flag)
  10130. {
  10131. int i1 = c / 2 - 80;
  10132. int l1 = c1 / 2 + 50;
  10133. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10134. chatTextDrawingArea.method382(0xffffff, i1, "Log in", l1 + 5, true);
  10135. i1 = c / 2 + 80;
  10136. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10137. chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  10138. }
  10139. }
  10140. if(loginScreenState == 3)
  10141. {
  10142. chatTextDrawingArea.method382(0xffff00, c / 2, "New User", c1 / 2 - 60, true);
  10143. int k = c1 / 2 - 35;
  10144. chatTextDrawingArea.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
  10145. k += 15;
  10146. chatTextDrawingArea.method382(0xffffff, c / 2, "go back to the main RuneScape webpage", k, true);
  10147. k += 15;
  10148. chatTextDrawingArea.method382(0xffffff, c / 2, "and choose the red 'create account'", k, true);
  10149. k += 15;
  10150. chatTextDrawingArea.method382(0xffffff, c / 2, "button at the top right of that page.", k, true);
  10151. k += 15;
  10152. int j1 = c / 2;
  10153. int i2 = c1 / 2 + 50;
  10154. aBackground_967.drawBackground(j1 - 73, i2 - 20);
  10155. chatTextDrawingArea.method382(0xffffff, j1, "Back", i2 + 5, true);
  10156. }
  10157. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  10158. if(welcomeScreenRaised)
  10159. {
  10160. welcomeScreenRaised = false;
  10161. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  10162. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  10163. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  10164. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  10165. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  10166. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  10167. }
  10168. }
  10169.  
  10170. private void drawFlames()
  10171. {
  10172. drawingFlames = true;
  10173. try
  10174. {
  10175. long l = System.currentTimeMillis();
  10176. int i = 0;
  10177. int j = 20;
  10178. while(aBoolean831)
  10179. {
  10180. anInt1208++;
  10181. calcFlamesPosition();
  10182. calcFlamesPosition();
  10183. doFlamesDrawing();
  10184. if(++i > 10)
  10185. {
  10186. long l1 = System.currentTimeMillis();
  10187. int k = (int)(l1 - l) / 10 - j;
  10188. j = 40 - k;
  10189. if(j < 5)
  10190. j = 5;
  10191. i = 0;
  10192. l = l1;
  10193. }
  10194. try
  10195. {
  10196. Thread.sleep(j);
  10197. }
  10198. catch(Exception _ex) { }
  10199. }
  10200. }
  10201. catch(Exception _ex) { }
  10202. drawingFlames = false;
  10203. }
  10204.  
  10205. public void raiseWelcomeScreen()
  10206. {
  10207. welcomeScreenRaised = true;
  10208. }
  10209.  
  10210. private void method137(Stream stream, int j)
  10211. {
  10212. if(j == 84)
  10213. {
  10214. int k = stream.readUnsignedByte();
  10215. int j3 = anInt1268 + (k >> 4 & 7);
  10216. int i6 = anInt1269 + (k & 7);
  10217. int l8 = stream.readUnsignedWord();
  10218. int k11 = stream.readUnsignedWord();
  10219. int l13 = stream.readUnsignedWord();
  10220. if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  10221. {
  10222. NodeList class19_1 = groundArray[plane][j3][i6];
  10223. if(class19_1 != null)
  10224. {
  10225. 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())
  10226. {
  10227. if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  10228. continue;
  10229. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  10230. break;
  10231. }
  10232.  
  10233. spawnGroundItem(j3, i6);
  10234. }
  10235. }
  10236. return;
  10237. }
  10238. if(j == 105)
  10239. {
  10240. int l = stream.readUnsignedByte();
  10241. int k3 = anInt1268 + (l >> 4 & 7);
  10242. int j6 = anInt1269 + (l & 7);
  10243. int i9 = stream.readUnsignedWord();
  10244. int l11 = stream.readUnsignedByte();
  10245. int i14 = l11 >> 4 & 0xf;
  10246. int i16 = l11 & 7;
  10247. 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)
  10248. {
  10249. anIntArray1207[anInt1062] = i9;
  10250. anIntArray1241[anInt1062] = i16;
  10251. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  10252. anInt1062++;
  10253. }
  10254. }
  10255. if(j == 215)
  10256. {
  10257. int i1 = stream.method435();
  10258. int l3 = stream.method428();
  10259. int k6 = anInt1268 + (l3 >> 4 & 7);
  10260. int j9 = anInt1269 + (l3 & 7);
  10261. int i12 = stream.method435();
  10262. int j14 = stream.readUnsignedWord();
  10263. if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  10264. {
  10265. Item class30_sub2_sub4_sub2_2 = new Item();
  10266. class30_sub2_sub4_sub2_2.ID = i1;
  10267. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  10268. if(groundArray[plane][k6][j9] == null)
  10269. groundArray[plane][k6][j9] = new NodeList();
  10270. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  10271. spawnGroundItem(k6, j9);
  10272. }
  10273. return;
  10274. }
  10275. if(j == 156)
  10276. {
  10277. int j1 = stream.method426();
  10278. int i4 = anInt1268 + (j1 >> 4 & 7);
  10279. int l6 = anInt1269 + (j1 & 7);
  10280. int k9 = stream.readUnsignedWord();
  10281. if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  10282. {
  10283. NodeList class19 = groundArray[plane][i4][l6];
  10284. if(class19 != null)
  10285. {
  10286. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  10287. {
  10288. if(item.ID != (k9 & 0x7fff))
  10289. continue;
  10290. item.unlink();
  10291. break;
  10292. }
  10293.  
  10294. if(class19.reverseGetFirst() == null)
  10295. groundArray[plane][i4][l6] = null;
  10296. spawnGroundItem(i4, l6);
  10297. }
  10298. }
  10299. return;
  10300. }
  10301. if(j == 160)
  10302. {
  10303. int k1 = stream.method428();
  10304. int j4 = anInt1268 + (k1 >> 4 & 7);
  10305. int i7 = anInt1269 + (k1 & 7);
  10306. int l9 = stream.method428();
  10307. int j12 = l9 >> 2;
  10308. int k14 = l9 & 3;
  10309. int j16 = anIntArray1177[j12];
  10310. int j17 = stream.method435();
  10311. if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  10312. {
  10313. int j18 = intGroundArray[plane][j4][i7];
  10314. int i19 = intGroundArray[plane][j4 + 1][i7];
  10315. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  10316. int k20 = intGroundArray[plane][j4][i7 + 1];
  10317. if(j16 == 0)
  10318. {
  10319. Object1 class10 = worldController.method296(plane, j4, i7);
  10320. if(class10 != null)
  10321. {
  10322. int k21 = class10.uid >> 14 & 0x7fff;
  10323. if(j12 == 2)
  10324. {
  10325. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  10326. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  10327. } else
  10328. {
  10329. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  10330. }
  10331. }
  10332. }
  10333. if(j16 == 1)
  10334. {
  10335. Object2 class26 = worldController.method297(j4, i7, plane);
  10336. if(class26 != null)
  10337. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  10338. }
  10339. if(j16 == 2)
  10340. {
  10341. Object5 class28 = worldController.method298(j4, i7, plane);
  10342. if(j12 == 11)
  10343. j12 = 10;
  10344. if(class28 != null)
  10345. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  10346. }
  10347. if(j16 == 3)
  10348. {
  10349. Object3 class49 = worldController.method299(i7, j4, plane);
  10350. if(class49 != null)
  10351. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  10352. }
  10353. }
  10354. return;
  10355. }
  10356. if(j == 147)
  10357. {
  10358. int l1 = stream.method428();
  10359. int k4 = anInt1268 + (l1 >> 4 & 7);
  10360. int j7 = anInt1269 + (l1 & 7);
  10361. int i10 = stream.readUnsignedWord();
  10362. byte byte0 = stream.method430();
  10363. int l14 = stream.method434();
  10364. byte byte1 = stream.method429();
  10365. int k17 = stream.readUnsignedWord();
  10366. int k18 = stream.method428();
  10367. int j19 = k18 >> 2;
  10368. int i20 = k18 & 3;
  10369. int l20 = anIntArray1177[j19];
  10370. byte byte2 = stream.readSignedByte();
  10371. int l21 = stream.readUnsignedWord();
  10372. byte byte3 = stream.method429();
  10373. Player player;
  10374. if(i10 == unknownInt10)
  10375. player = myPlayer;
  10376. else
  10377. player = playerArray[i10];
  10378. if(player != null)
  10379. {
  10380. ObjectDef class46 = ObjectDef.forID(l21);
  10381. int i22 = intGroundArray[plane][k4][j7];
  10382. int j22 = intGroundArray[plane][k4 + 1][j7];
  10383. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  10384. int l22 = intGroundArray[plane][k4][j7 + 1];
  10385. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  10386. if(model != null)
  10387. {
  10388. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  10389. player.anInt1707 = l14 + loopCycle;
  10390. player.anInt1708 = k17 + loopCycle;
  10391. player.aModel_1714 = model;
  10392. int i23 = class46.anInt744;
  10393. int j23 = class46.anInt761;
  10394. if(i20 == 1 || i20 == 3)
  10395. {
  10396. i23 = class46.anInt761;
  10397. j23 = class46.anInt744;
  10398. }
  10399. player.anInt1711 = k4 * 128 + i23 * 64;
  10400. player.anInt1713 = j7 * 128 + j23 * 64;
  10401. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  10402. if(byte2 > byte0)
  10403. {
  10404. byte byte4 = byte2;
  10405. byte2 = byte0;
  10406. byte0 = byte4;
  10407. }
  10408. if(byte3 > byte1)
  10409. {
  10410. byte byte5 = byte3;
  10411. byte3 = byte1;
  10412. byte1 = byte5;
  10413. }
  10414. player.anInt1719 = k4 + byte2;
  10415. player.anInt1721 = k4 + byte0;
  10416. player.anInt1720 = j7 + byte3;
  10417. player.anInt1722 = j7 + byte1;
  10418. }
  10419. }
  10420. }
  10421. if(j == 151)
  10422. {
  10423. int i2 = stream.method426();
  10424. int l4 = anInt1268 + (i2 >> 4 & 7);
  10425. int k7 = anInt1269 + (i2 & 7);
  10426. int j10 = stream.method434();
  10427. int k12 = stream.method428();
  10428. int i15 = k12 >> 2;
  10429. int k16 = k12 & 3;
  10430. int l17 = anIntArray1177[i15];
  10431. if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  10432. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  10433. return;
  10434. }
  10435. if(j == 4)
  10436. {
  10437. int j2 = stream.readUnsignedByte();
  10438. int i5 = anInt1268 + (j2 >> 4 & 7);
  10439. int l7 = anInt1269 + (j2 & 7);
  10440. int k10 = stream.readUnsignedWord();
  10441. int l12 = stream.readUnsignedByte();
  10442. int j15 = stream.readUnsignedWord();
  10443. if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  10444. {
  10445. i5 = i5 * 128 + 64;
  10446. l7 = l7 * 128 + 64;
  10447. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  10448. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  10449. }
  10450. return;
  10451. }
  10452. if(j == 44)
  10453. {
  10454. int k2 = stream.method436();
  10455. int j5 = stream.readUnsignedWord();
  10456. int i8 = stream.readUnsignedByte();
  10457. int l10 = anInt1268 + (i8 >> 4 & 7);
  10458. int i13 = anInt1269 + (i8 & 7);
  10459. if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  10460. {
  10461. Item class30_sub2_sub4_sub2_1 = new Item();
  10462. class30_sub2_sub4_sub2_1.ID = k2;
  10463. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  10464. if(groundArray[plane][l10][i13] == null)
  10465. groundArray[plane][l10][i13] = new NodeList();
  10466. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  10467. spawnGroundItem(l10, i13);
  10468. }
  10469. return;
  10470. }
  10471. if(j == 101)
  10472. {
  10473. int l2 = stream.method427();
  10474. int k5 = l2 >> 2;
  10475. int j8 = l2 & 3;
  10476. int i11 = anIntArray1177[k5];
  10477. int j13 = stream.readUnsignedByte();
  10478. int k15 = anInt1268 + (j13 >> 4 & 7);
  10479. int l16 = anInt1269 + (j13 & 7);
  10480. if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  10481. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  10482. return;
  10483. }
  10484. if(j == 117)
  10485. {
  10486. int i3 = stream.readUnsignedByte();
  10487. int l5 = anInt1268 + (i3 >> 4 & 7);
  10488. int k8 = anInt1269 + (i3 & 7);
  10489. int j11 = l5 + stream.readSignedByte();
  10490. int k13 = k8 + stream.readSignedByte();
  10491. int l15 = stream.readSignedWord();
  10492. int i17 = stream.readUnsignedWord();
  10493. int i18 = stream.readUnsignedByte() * 4;
  10494. int l18 = stream.readUnsignedByte() * 4;
  10495. int k19 = stream.readUnsignedWord();
  10496. int j20 = stream.readUnsignedWord();
  10497. int i21 = stream.readUnsignedByte();
  10498. int j21 = stream.readUnsignedByte();
  10499. if(l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535)
  10500. {
  10501. l5 = l5 * 128 + 64;
  10502. k8 = k8 * 128 + 64;
  10503. j11 = j11 * 128 + 64;
  10504. k13 = k13 * 128 + 64;
  10505. 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);
  10506. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  10507. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  10508. }
  10509. }
  10510. }
  10511.  
  10512. private static void setLowMem()
  10513. {
  10514. WorldController.lowMem = true;
  10515. Texture.lowMem = true;
  10516. lowMem = true;
  10517. ObjectManager.lowMem = true;
  10518. ObjectDef.lowMem = true;
  10519. }
  10520.  
  10521. private void method139(Stream stream)
  10522. {
  10523. stream.initBitAccess();
  10524. int k = stream.readBits(8);
  10525. if(k < npcCount)
  10526. {
  10527. for(int l = k; l < npcCount; l++)
  10528. anIntArray840[anInt839++] = npcIndices[l];
  10529.  
  10530. }
  10531. if(k > npcCount)
  10532. {
  10533. signlink.reporterror(myUsername + " Too many npcs");
  10534. throw new RuntimeException("eek");
  10535. }
  10536. npcCount = 0;
  10537. for(int i1 = 0; i1 < k; i1++)
  10538. {
  10539. int j1 = npcIndices[i1];
  10540. NPC npc = npcArray[j1];
  10541. int k1 = stream.readBits(1);
  10542. if(k1 == 0)
  10543. {
  10544. npcIndices[npcCount++] = j1;
  10545. npc.anInt1537 = loopCycle;
  10546. } else
  10547. {
  10548. int l1 = stream.readBits(2);
  10549. if(l1 == 0)
  10550. {
  10551. npcIndices[npcCount++] = j1;
  10552. npc.anInt1537 = loopCycle;
  10553. anIntArray894[anInt893++] = j1;
  10554. } else
  10555. if(l1 == 1)
  10556. {
  10557. npcIndices[npcCount++] = j1;
  10558. npc.anInt1537 = loopCycle;
  10559. int i2 = stream.readBits(3);
  10560. npc.moveInDir(false, i2);
  10561. int k2 = stream.readBits(1);
  10562. if(k2 == 1)
  10563. anIntArray894[anInt893++] = j1;
  10564. } else
  10565. if(l1 == 2)
  10566. {
  10567. npcIndices[npcCount++] = j1;
  10568. npc.anInt1537 = loopCycle;
  10569. int j2 = stream.readBits(3);
  10570. npc.moveInDir(true, j2);
  10571. int l2 = stream.readBits(3);
  10572. npc.moveInDir(true, l2);
  10573. int i3 = stream.readBits(1);
  10574. if(i3 == 1)
  10575. anIntArray894[anInt893++] = j1;
  10576. } else
  10577. if(l1 == 3)
  10578. anIntArray840[anInt839++] = j1;
  10579. }
  10580. }
  10581.  
  10582. }
  10583.  
  10584. private void processLoginScreenInput()
  10585. {
  10586. if(loginScreenState == 0)
  10587. {
  10588. int i = super.myWidth / 2 - 80;
  10589. int l = super.myHeight / 2 + 20;
  10590. l += 20;
  10591. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  10592. {
  10593. loginScreenState = 3;
  10594. loginScreenCursorPos = 0;
  10595. }
  10596. i = super.myWidth / 2 + 80;
  10597. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  10598. {
  10599. loginMessage1 = "";
  10600. loginMessage2 = "Enter your username & password.";
  10601. loginScreenState = 2;
  10602. loginScreenCursorPos = 0;
  10603. }
  10604. } else
  10605. {
  10606. if(loginScreenState == 2)
  10607. {
  10608. int j = super.myHeight / 2 - 40;
  10609. j += 30;
  10610. j += 25;
  10611. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10612. loginScreenCursorPos = 0;
  10613. j += 15;
  10614. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10615. loginScreenCursorPos = 1;
  10616. j += 15;
  10617. int i1 = super.myWidth / 2 - 80;
  10618. int k1 = super.myHeight / 2 + 50;
  10619. k1 += 20;
  10620. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  10621. {
  10622. loginFailures = 0;
  10623. login(myUsername, myPassword, false);
  10624. if(loggedIn)
  10625. return;
  10626. }
  10627. i1 = super.myWidth / 2 + 80;
  10628. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  10629. {
  10630. loginScreenState = 0;
  10631. // myUsername = "";
  10632. // myPassword = "";
  10633. }
  10634. do
  10635. {
  10636. int l1 = readChar(-796);
  10637. if(l1 == -1)
  10638. break;
  10639. boolean flag1 = false;
  10640. for(int i2 = 0; i2 < validUserPassChars.length(); i2++)
  10641. {
  10642. if(l1 != validUserPassChars.charAt(i2))
  10643. continue;
  10644. flag1 = true;
  10645. break;
  10646. }
  10647.  
  10648. if(loginScreenCursorPos == 0)
  10649. {
  10650. if(l1 == 8 && myUsername.length() > 0)
  10651. myUsername = myUsername.substring(0, myUsername.length() - 1);
  10652. if(l1 == 9 || l1 == 10 || l1 == 13)
  10653. loginScreenCursorPos = 1;
  10654. if(flag1)
  10655. myUsername += (char)l1;
  10656. if(myUsername.length() > 12)
  10657. myUsername = myUsername.substring(0, 12);
  10658. } else
  10659. if(loginScreenCursorPos == 1)
  10660. {
  10661. if(l1 == 8 && myPassword.length() > 0)
  10662. myPassword = myPassword.substring(0, myPassword.length() - 1);
  10663. if(l1 == 9 || l1 == 10 || l1 == 13)
  10664. loginScreenCursorPos = 0;
  10665. if(flag1)
  10666. myPassword += (char)l1;
  10667. if(myPassword.length() > 20)
  10668. myPassword = myPassword.substring(0, 20);
  10669. }
  10670. } while(true);
  10671. return;
  10672. }
  10673. if(loginScreenState == 3)
  10674. {
  10675. int k = super.myWidth / 2;
  10676. int j1 = super.myHeight / 2 + 50;
  10677. j1 += 20;
  10678. if(super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75 && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  10679. loginScreenState = 0;
  10680. }
  10681. }
  10682. }
  10683.  
  10684. private void markMinimap(Sprite sprite, int i, int j) {
  10685. int k = minimapInt1 + minimapInt2 & 0x7ff;
  10686. int l = i * i + j * j;
  10687. if(l > 6400)
  10688. return;
  10689. int i1 = Model.modelIntArray1[k];
  10690. int j1 = Model.modelIntArray2[k];
  10691. i1 = (i1 * 256) / (minimapInt3 + 256);
  10692. j1 = (j1 * 256) / (minimapInt3 + 256);
  10693. int k1 = j * i1 + i * j1 >> 16;
  10694. int l1 = j * j1 - i * i1 >> 16;
  10695. if(l > 2500) {
  10696. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 , 83 - l1 - sprite.anInt1445 / 2 - 4);
  10697. } else {
  10698. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4, 83 - l1 - sprite.anInt1445 / 2 - 4);
  10699. }
  10700. }
  10701.  
  10702. private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  10703. )
  10704. {
  10705. if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  10706. {
  10707. if(lowMem && j != plane)
  10708. return;
  10709. int i2 = 0;
  10710. if(j1 == 0)
  10711. i2 = worldController.method300(j, i1, i);
  10712. if(j1 == 1)
  10713. i2 = worldController.method301(j, i1, i);
  10714. if(j1 == 2)
  10715. i2 = worldController.method302(j, i1, i);
  10716. if(j1 == 3)
  10717. i2 = worldController.method303(j, i1, i);
  10718. if(i2 != 0)
  10719. {
  10720. int i3 = worldController.method304(j, i1, i, i2);
  10721. int j2 = i2 >> 14 & 0x7fff;
  10722. int k2 = i3 & 0x1f;
  10723. int l2 = i3 >> 6;
  10724. if(j1 == 0)
  10725. {
  10726. worldController.method291(i1, j, i, (byte)-119);
  10727. ObjectDef class46 = ObjectDef.forID(j2);
  10728. if(class46.aBoolean767)
  10729. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  10730. }
  10731. if(j1 == 1)
  10732. worldController.method292(i, j, i1);
  10733. if(j1 == 2)
  10734. {
  10735. worldController.method293(j, i1, i);
  10736. ObjectDef class46_1 = ObjectDef.forID(j2);
  10737. if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  10738. return;
  10739. if(class46_1.aBoolean767)
  10740. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  10741. }
  10742. if(j1 == 3)
  10743. {
  10744. worldController.method294(j, i, i1);
  10745. ObjectDef class46_2 = ObjectDef.forID(j2);
  10746. if(class46_2.aBoolean767 && class46_2.hasActions)
  10747. aClass11Array1230[j].method218(i, i1);
  10748. }
  10749. }
  10750. if(k1 >= 0)
  10751. {
  10752. int j3 = j;
  10753. if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  10754. j3++;
  10755. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  10756. }
  10757. }
  10758. }
  10759.  
  10760. private void updatePlayers(int i, Stream stream)
  10761. {
  10762. anInt839 = 0;
  10763. anInt893 = 0;
  10764. method117(stream);
  10765. method134(stream);
  10766. method91(stream, i);
  10767. method49(stream);
  10768. for(int k = 0; k < anInt839; k++)
  10769. {
  10770. int l = anIntArray840[k];
  10771. if(playerArray[l].anInt1537 != loopCycle)
  10772. playerArray[l] = null;
  10773. }
  10774.  
  10775. if(stream.currentOffset != i)
  10776. {
  10777. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  10778. throw new RuntimeException("eek");
  10779. }
  10780. for(int i1 = 0; i1 < playerCount; i1++)
  10781. if(playerArray[playerIndices[i1]] == null)
  10782. {
  10783. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  10784. throw new RuntimeException("eek");
  10785. }
  10786.  
  10787. }
  10788.  
  10789. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  10790. {
  10791. int l1 = 2048 - k & 0x7ff;
  10792. int i2 = 2048 - j1 & 0x7ff;
  10793. int j2 = 0;
  10794. int k2 = 0;
  10795. int l2 = j;
  10796. if(l1 != 0)
  10797. {
  10798. int i3 = Model.modelIntArray1[l1];
  10799. int k3 = Model.modelIntArray2[l1];
  10800. int i4 = k2 * k3 - l2 * i3 >> 16;
  10801. l2 = k2 * i3 + l2 * k3 >> 16;
  10802. k2 = i4;
  10803. }
  10804. if(i2 != 0)
  10805. {
  10806. /* xxx if(cameratoggle){
  10807. if(zoom == 0)
  10808. zoom = k2;
  10809. if(lftrit == 0)
  10810. lftrit = j2;
  10811. if(fwdbwd == 0)
  10812. fwdbwd = l2;
  10813. k2 = zoom;
  10814. j2 = lftrit;
  10815. l2 = fwdbwd;
  10816. }
  10817. */
  10818. int j3 = Model.modelIntArray1[i2];
  10819. int l3 = Model.modelIntArray2[i2];
  10820. int j4 = l2 * j3 + j2 * l3 >> 16;
  10821. l2 = l2 * l3 - j2 * j3 >> 16;
  10822. j2 = j4;
  10823. }
  10824. xCameraPos = l - j2;
  10825. zCameraPos = i1 - k2;
  10826. yCameraPos = k1 - l2;
  10827. yCameraCurve = k;
  10828. xCameraCurve = j1;
  10829. }
  10830.  
  10831. public void updateStrings(String str, int i) {
  10832. switch(i) {
  10833. case 1675: sendFrame126(str, 17508); break;//Stab
  10834. case 1676: sendFrame126(str, 17509); break;//Slash
  10835. case 1677: sendFrame126(str, 17510); break;//Cursh
  10836. case 1678: sendFrame126(str, 17511); break;//Magic
  10837. case 1679: sendFrame126(str, 17512); break;//Range
  10838. case 1680: sendFrame126(str, 17513); break;//Stab
  10839. case 1681: sendFrame126(str, 17514); break;//Slash
  10840. case 1682: sendFrame126(str, 17515); break;//Crush
  10841. case 1683: sendFrame126(str, 17516); break;//Magic
  10842. case 1684: sendFrame126(str, 17517); break;//Range
  10843. case 1686: sendFrame126(str, 17518); break;//Strength
  10844. case 1687: sendFrame126(str, 17519); break;//Prayer
  10845. }
  10846. }
  10847.  
  10848. public void sendFrame126(String str,int i) {
  10849. RSInterface.interfaceCache[i].message = str;
  10850. if(RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  10851. needDrawTabArea = true;
  10852. }
  10853.  
  10854. public void sendPacket185(int button,int toggle,int type) {
  10855. switch(type) {
  10856. case 135:
  10857. RSInterface class9 = RSInterface.interfaceCache[button];
  10858. boolean flag8 = true;
  10859. if(class9.contentType > 0)
  10860. flag8 = promptUserForInput(class9);
  10861. if(flag8) {
  10862. stream.createFrame(185);
  10863. stream.writeWord(button);
  10864. }
  10865. break;
  10866. case 646:
  10867. stream.createFrame(185);
  10868. stream.writeWord(button);
  10869. RSInterface class9_2 = RSInterface.interfaceCache[button];
  10870. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  10871. if(variousSettings[toggle] != class9_2.anIntArray212[0]) {
  10872. variousSettings[toggle] = class9_2.anIntArray212[0];
  10873. method33(toggle);
  10874. needDrawTabArea = true;
  10875. }
  10876. }
  10877. break;
  10878. case 169:
  10879. stream.createFrame(185);
  10880. stream.writeWord(button);
  10881. RSInterface class9_3 = RSInterface.interfaceCache[button];
  10882. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  10883. variousSettings[toggle] = 1 - variousSettings[toggle];
  10884. method33(toggle);
  10885. needDrawTabArea = true;
  10886. }
  10887. switch(button) {
  10888. case 19136:
  10889. System.out.println("toggle = "+toggle);
  10890. if(toggle == 0)
  10891. sendFrame36(173,toggle);
  10892. if(toggle == 1)
  10893. sendPacket185(153,173,646);
  10894. break;
  10895. }
  10896. break;
  10897. }
  10898. }
  10899.  
  10900. public void sendFrame36(int id,int state) {
  10901. anIntArray1045[id] = state;
  10902. if(variousSettings[id] != state) {
  10903. variousSettings[id] = state;
  10904. method33(id);
  10905. needDrawTabArea = true;
  10906. if(dialogID != -1)
  10907. inputTaken = true;
  10908. }
  10909. }
  10910.  
  10911. public void sendFrame219() {
  10912. if(invOverlayInterfaceID != -1) {
  10913. invOverlayInterfaceID = -1;
  10914. needDrawTabArea = true;
  10915. tabAreaAltered = true;
  10916. }
  10917. if(backDialogID != -1) {
  10918. backDialogID = -1;
  10919. inputTaken = true;
  10920. }
  10921. if(inputDialogState != 0) {
  10922. inputDialogState = 0;
  10923. inputTaken = true;
  10924. }
  10925. openInterfaceID = -1;
  10926. aBoolean1149 = false;
  10927. }
  10928.  
  10929. public void sendFrame248(int interfaceID,int sideInterfaceID) {
  10930. if(backDialogID != -1) {
  10931. backDialogID = -1;
  10932. inputTaken = true;
  10933. }
  10934. if(inputDialogState != 0) {
  10935. inputDialogState = 0;
  10936. inputTaken = true;
  10937. }
  10938. openInterfaceID = interfaceID;
  10939. invOverlayInterfaceID = sideInterfaceID;
  10940. needDrawTabArea = true;
  10941. tabAreaAltered = true;
  10942. aBoolean1149 = false;
  10943. }
  10944.  
  10945. private boolean parsePacket() {
  10946. if(socketStream == null)
  10947. return false;
  10948. try {
  10949. int i = socketStream.available();
  10950. if(i == 0)
  10951. return false;
  10952. if(pktType == -1) {
  10953. socketStream.flushInputStream(inStream.buffer, 1);
  10954. pktType = inStream.buffer[0] & 0xff;
  10955. if(encryption != null)
  10956. pktType = pktType - encryption.getNextKey() & 0xff;
  10957. pktSize = SizeConstants.packetSizes[pktType];
  10958. i--;
  10959. }
  10960. if(pktSize == -1)
  10961. if(i > 0) {
  10962. socketStream.flushInputStream(inStream.buffer, 1);
  10963. pktSize = inStream.buffer[0] & 0xff;
  10964. i--;
  10965. } else {
  10966. return false;
  10967. }
  10968. if(pktSize == -2)
  10969. if(i > 1) {
  10970. socketStream.flushInputStream(inStream.buffer, 2);
  10971. inStream.currentOffset = 0;
  10972. pktSize = inStream.readUnsignedWord();
  10973. i -= 2;
  10974. } else {
  10975. return false;
  10976. }
  10977. if(i < pktSize)
  10978. return false;
  10979. inStream.currentOffset = 0;
  10980. socketStream.flushInputStream(inStream.buffer, pktSize);
  10981. anInt1009 = 0;
  10982. anInt843 = anInt842;
  10983. anInt842 = anInt841;
  10984. anInt841 = pktType;
  10985. switch(pktType) {
  10986. case 81:
  10987. updatePlayers(pktSize, inStream);
  10988. aBoolean1080 = false;
  10989. pktType = -1;
  10990. return true;
  10991.  
  10992. case 176:
  10993. daysSinceRecovChange = inStream.method427();
  10994. unreadMessages = inStream.method435();
  10995. membersInt = inStream.readUnsignedByte();
  10996. anInt1193 = inStream.method440();
  10997. daysSinceLastLogin = inStream.readUnsignedWord();
  10998. if(anInt1193 != 0 && openInterfaceID == -1) {
  10999. signlink.dnslookup(TextClass.method586(anInt1193));
  11000. clearTopInterfaces();
  11001. char c = '\u028A';
  11002. if(daysSinceRecovChange != 201 || membersInt == 1)
  11003. c = '\u028F';
  11004. reportAbuseInput = "";
  11005. canMute = false;
  11006. for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  11007. if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  11008. continue;
  11009. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  11010.  
  11011. }
  11012. }
  11013. pktType = -1;
  11014. return true;
  11015.  
  11016. case 64:
  11017. anInt1268 = inStream.method427();
  11018. anInt1269 = inStream.method428();
  11019. for(int j = anInt1268; j < anInt1268 + 8; j++) {
  11020. for(int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  11021. if(groundArray[plane][j][l9] != null) {
  11022. groundArray[plane][j][l9] = null;
  11023. spawnGroundItem(j, l9);
  11024. }
  11025. }
  11026. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  11027. if(class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  11028. class30_sub1.anInt1294 = 0;
  11029. pktType = -1;
  11030. return true;
  11031.  
  11032. case 185:
  11033. int k = inStream.method436();
  11034. RSInterface.interfaceCache[k].anInt233 = 3;
  11035. if(myPlayer.desc == null)
  11036. 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];
  11037. else
  11038. RSInterface.interfaceCache[k].mediaID = (int)(0x12345678L + myPlayer.desc.type);
  11039. pktType = -1;
  11040. return true;
  11041.  
  11042. /* Clan chat packet */
  11043. case 217:
  11044. try {
  11045. name = inStream.readString();
  11046. message = inStream.readString();
  11047. clanname = inStream.readString();
  11048. rights = inStream.readUnsignedWord();
  11049. //message = TextInput.processText(message);
  11050. //message = Censor.doCensor(message);
  11051. System.out.println(clanname);
  11052. pushMessage(message, 16, name);
  11053. } catch(Exception e) {
  11054. e.printStackTrace();
  11055. }
  11056. pktType = -1;
  11057. return true;
  11058.  
  11059. case 107:
  11060. aBoolean1160 = false;
  11061. for(int l = 0; l < 5; l++)
  11062. aBooleanArray876[l] = false;
  11063. pktType = -1;
  11064. return true;
  11065.  
  11066. case 72:
  11067. int i1 = inStream.method434();
  11068. RSInterface class9 = RSInterface.interfaceCache[i1];
  11069. for(int k15 = 0; k15 < class9.inv.length; k15++) {
  11070. class9.inv[k15] = -1;
  11071. class9.inv[k15] = 0;
  11072. }
  11073. pktType = -1;
  11074. return true;
  11075.  
  11076. case 214:
  11077. ignoreCount = pktSize / 8;
  11078. for(int j1 = 0; j1 < ignoreCount; j1++)
  11079. ignoreListAsLongs[j1] = inStream.readQWord();
  11080. pktType = -1;
  11081. return true;
  11082.  
  11083. case 166:
  11084. aBoolean1160 = true;
  11085. anInt1098 = inStream.readUnsignedByte();
  11086. anInt1099 = inStream.readUnsignedByte();
  11087. anInt1100 = inStream.readUnsignedWord();
  11088. anInt1101 = inStream.readUnsignedByte();
  11089. anInt1102 = inStream.readUnsignedByte();
  11090. if(anInt1102 >= 100) {
  11091. xCameraPos = anInt1098 * 128 + 64;
  11092. yCameraPos = anInt1099 * 128 + 64;
  11093. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  11094. }
  11095. pktType = -1;
  11096. return true;
  11097.  
  11098. case 134:
  11099. needDrawTabArea = true;
  11100. int k1 = inStream.readUnsignedByte();
  11101. int i10 = inStream.method439();
  11102. int l15 = inStream.readUnsignedByte();
  11103. currentExp[k1] = i10;
  11104. currentStats[k1] = l15;
  11105. maxStats[k1] = 1;
  11106. for(int k20 = 0; k20 < 98; k20++)
  11107. if(i10 >= anIntArray1019[k20])
  11108. maxStats[k1] = k20 + 2;
  11109. pktType = -1;
  11110. return true;
  11111.  
  11112. case 71:
  11113. int l1 = inStream.readUnsignedWord();
  11114. int j10 = inStream.method426();
  11115. if(l1 == 65535)
  11116. l1 = -1;
  11117. tabInterfaceIDs[j10] = l1;
  11118. needDrawTabArea = true;
  11119. tabAreaAltered = true;
  11120. pktType = -1;
  11121. return true;
  11122.  
  11123. case 74:
  11124. int i2 = inStream.method434();
  11125. if(i2 == 65535)
  11126. i2 = -1;
  11127. if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  11128. nextSong = i2;
  11129. songChanging = true;
  11130. onDemandFetcher.method558(2, nextSong);
  11131. }
  11132. currentSong = i2;
  11133. pktType = -1;
  11134. return true;
  11135.  
  11136. case 121:
  11137. int j2 = inStream.method436();
  11138. int k10 = inStream.method435();
  11139. if(musicEnabled && !lowMem) {
  11140. nextSong = j2;
  11141. songChanging = false;
  11142. onDemandFetcher.method558(2, nextSong);
  11143. prevSong = k10;
  11144. }
  11145. pktType = -1;
  11146. return true;
  11147.  
  11148. case 109:
  11149. resetLogout();
  11150. pktType = -1;
  11151. return false;
  11152.  
  11153. case 70:
  11154. int k2 = inStream.readSignedWord();
  11155. int l10 = inStream.method437();
  11156. int i16 = inStream.method434();
  11157. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  11158. class9_5.anInt263 = k2;
  11159. class9_5.anInt265 = l10;
  11160. pktType = -1;
  11161. return true;
  11162.  
  11163. case 73:
  11164. case 241:
  11165. int l2 = anInt1069;
  11166. int i11 = anInt1070;
  11167. if(pktType == 73) {
  11168. l2 = inStream.method435();
  11169. i11 = inStream.readUnsignedWord();
  11170. aBoolean1159 = false;
  11171. }
  11172. if(pktType == 241) {
  11173. i11 = inStream.method435();
  11174. inStream.initBitAccess();
  11175. for(int j16 = 0; j16 < 4; j16++) {
  11176. for(int l20 = 0; l20 < 13; l20++) {
  11177. for(int j23 = 0; j23 < 13; j23++) {
  11178. int i26 = inStream.readBits(1);
  11179. if(i26 == 1)
  11180. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  11181. else
  11182. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  11183. }
  11184. }
  11185. }
  11186. inStream.finishBitAccess();
  11187. l2 = inStream.readUnsignedWord();
  11188. aBoolean1159 = true;
  11189. }
  11190. if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  11191. pktType = -1;
  11192. return true;
  11193. }
  11194. anInt1069 = l2;
  11195. anInt1070 = i11;
  11196. baseX = (anInt1069 - 6) * 8;
  11197. baseY = (anInt1070 - 6) * 8;
  11198. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  11199. if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  11200. aBoolean1141 = true;
  11201. loadingStage = 1;
  11202. aLong824 = System.currentTimeMillis();
  11203. aRSImageProducer_1165.initDrawingArea();
  11204. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  11205. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  11206. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  11207. if(pktType == 73) {
  11208. int k16 = 0;
  11209. for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  11210. for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  11211. k16++;
  11212. }
  11213. aByteArrayArray1183 = new byte[k16][];
  11214. aByteArrayArray1247 = new byte[k16][];
  11215. anIntArray1234 = new int[k16];
  11216. anIntArray1235 = new int[k16];
  11217. anIntArray1236 = new int[k16];
  11218. k16 = 0;
  11219. for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  11220. for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  11221. anIntArray1234[k16] = (l23 << 8) + j26;
  11222. if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  11223. anIntArray1235[k16] = -1;
  11224. anIntArray1236[k16] = -1;
  11225. k16++;
  11226. } else {
  11227. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  11228. if(k28 != -1)
  11229. onDemandFetcher.method558(3, k28);
  11230. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  11231. if(j30 != -1)
  11232. onDemandFetcher.method558(3, j30);
  11233. k16++;
  11234. }
  11235. }
  11236. }
  11237. }
  11238. if(pktType == 241) {
  11239. int l16 = 0;
  11240. int ai[] = new int[676];
  11241. for(int i24 = 0; i24 < 4; i24++) {
  11242. for(int k26 = 0; k26 < 13; k26++) {
  11243. for(int l28 = 0; l28 < 13; l28++) {
  11244. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  11245. if(k30 != -1) {
  11246. int k31 = k30 >> 14 & 0x3ff;
  11247. int i32 = k30 >> 3 & 0x7ff;
  11248. int k32 = (k31 / 8 << 8) + i32 / 8;
  11249. for(int j33 = 0; j33 < l16; j33++) {
  11250. if(ai[j33] != k32)
  11251. continue;
  11252. k32 = -1;
  11253.  
  11254. }
  11255. if(k32 != -1)
  11256. ai[l16++] = k32;
  11257. }
  11258. }
  11259. }
  11260. }
  11261. aByteArrayArray1183 = new byte[l16][];
  11262. aByteArrayArray1247 = new byte[l16][];
  11263. anIntArray1234 = new int[l16];
  11264. anIntArray1235 = new int[l16];
  11265. anIntArray1236 = new int[l16];
  11266. for(int l26 = 0; l26 < l16; l26++) {
  11267. int i29 = anIntArray1234[l26] = ai[l26];
  11268. int l30 = i29 >> 8 & 0xff;
  11269. int l31 = i29 & 0xff;
  11270. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  11271. if(j32 != -1)
  11272. onDemandFetcher.method558(3, j32);
  11273. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  11274. if(i33 != -1)
  11275. onDemandFetcher.method558(3, i33);
  11276. }
  11277. }
  11278. int i17 = baseX - anInt1036;
  11279. int j21 = baseY - anInt1037;
  11280. anInt1036 = baseX;
  11281. anInt1037 = baseY;
  11282. for(int j24 = 0; j24 < 16384; j24++) {
  11283. NPC npc = npcArray[j24];
  11284. if(npc != null) {
  11285. for(int j29 = 0; j29 < 10; j29++) {
  11286. npc.smallX[j29] -= i17;
  11287. npc.smallY[j29] -= j21;
  11288. }
  11289. npc.x -= i17 * 128;
  11290. npc.y -= j21 * 128;
  11291. }
  11292. }
  11293. for(int i27 = 0; i27 < maxPlayers; i27++) {
  11294. Player player = playerArray[i27];
  11295. if(player != null) {
  11296. for(int i31 = 0; i31 < 10; i31++) {
  11297. player.smallX[i31] -= i17;
  11298. player.smallY[i31] -= j21;
  11299. }
  11300. player.x -= i17 * 128;
  11301. player.y -= j21 * 128;
  11302. }
  11303. }
  11304. aBoolean1080 = true;
  11305. byte byte1 = 0;
  11306. byte byte2 = 104;
  11307. byte byte3 = 1;
  11308. if(i17 < 0) {
  11309. byte1 = 103;
  11310. byte2 = -1;
  11311. byte3 = -1;
  11312. }
  11313. byte byte4 = 0;
  11314. byte byte5 = 104;
  11315. byte byte6 = 1;
  11316. if(j21 < 0) {
  11317. byte4 = 103;
  11318. byte5 = -1;
  11319. byte6 = -1;
  11320. }
  11321. for(int k33 = byte1; k33 != byte2; k33 += byte3) {
  11322. for(int l33 = byte4; l33 != byte5; l33 += byte6) {
  11323. int i34 = k33 + i17;
  11324. int j34 = l33 + j21;
  11325. for(int k34 = 0; k34 < 4; k34++)
  11326. if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  11327. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  11328. else
  11329. groundArray[k34][k33][l33] = null;
  11330. }
  11331. }
  11332. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext()) {
  11333. class30_sub1_1.anInt1297 -= i17;
  11334. class30_sub1_1.anInt1298 -= j21;
  11335. if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  11336. class30_sub1_1.unlink();
  11337. }
  11338. if(destX != 0) {
  11339. destX -= i17;
  11340. destY -= j21;
  11341. }
  11342. aBoolean1160 = false;
  11343. pktType = -1;
  11344. return true;
  11345.  
  11346. case 208:
  11347. int i3 = inStream.method437();
  11348. if(i3 >= 0)
  11349. method60(i3);
  11350. anInt1018 = i3;
  11351. pktType = -1;
  11352. return true;
  11353.  
  11354. case 99:
  11355. anInt1021 = inStream.readUnsignedByte();
  11356. pktType = -1;
  11357. return true;
  11358.  
  11359. case 75:
  11360. int j3 = inStream.method436();
  11361. int j11 = inStream.method436();
  11362. RSInterface.interfaceCache[j11].anInt233 = 2;
  11363. RSInterface.interfaceCache[j11].mediaID = j3;
  11364. pktType = -1;
  11365. return true;
  11366.  
  11367. case 114:
  11368. anInt1104 = inStream.method434() * 30;
  11369. pktType = -1;
  11370. return true;
  11371.  
  11372. case 60:
  11373. anInt1269 = inStream.readUnsignedByte();
  11374. anInt1268 = inStream.method427();
  11375. while(inStream.currentOffset < pktSize) {
  11376. int k3 = inStream.readUnsignedByte();
  11377. method137(inStream, k3);
  11378. }
  11379. pktType = -1;
  11380. return true;
  11381.  
  11382. case 35:
  11383. int l3 = inStream.readUnsignedByte();
  11384. int k11 = inStream.readUnsignedByte();
  11385. int j17 = inStream.readUnsignedByte();
  11386. int k21 = inStream.readUnsignedByte();
  11387. aBooleanArray876[l3] = true;
  11388. anIntArray873[l3] = k11;
  11389. anIntArray1203[l3] = j17;
  11390. anIntArray928[l3] = k21;
  11391. anIntArray1030[l3] = 0;
  11392. pktType = -1;
  11393. return true;
  11394.  
  11395. case 174:
  11396. int i4 = inStream.readUnsignedWord();
  11397. int l11 = inStream.readUnsignedByte();
  11398. int k17 = inStream.readUnsignedWord();
  11399. if(aBoolean848 && !lowMem && anInt1062 < 50) {
  11400. anIntArray1207[anInt1062] = i4;
  11401. anIntArray1241[anInt1062] = l11;
  11402. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  11403. anInt1062++;
  11404. }
  11405. pktType = -1;
  11406. return true;
  11407.  
  11408. case 104:
  11409. int j4 = inStream.method427();
  11410. int i12 = inStream.method426();
  11411. String s6 = inStream.readString();
  11412. if(j4 >= 1 && j4 <= 5) {
  11413. if(s6.equalsIgnoreCase("null"))
  11414. s6 = null;
  11415. atPlayerActions[j4 - 1] = s6;
  11416. atPlayerArray[j4 - 1] = i12 == 0;
  11417. }
  11418. pktType = -1;
  11419. return true;
  11420.  
  11421. case 78:
  11422. destX = 0;
  11423. pktType = -1;
  11424. return true;
  11425.  
  11426. case 253:
  11427. String s = inStream.readString();
  11428. if(s.endsWith(":tradereq:")) {
  11429. String s3 = s.substring(0, s.indexOf(":"));
  11430. long l17 = TextClass.longForName(s3);
  11431. boolean flag2 = false;
  11432. for(int j27 = 0; j27 < ignoreCount; j27++) {
  11433. if(ignoreListAsLongs[j27] != l17)
  11434. continue;
  11435. flag2 = true;
  11436.  
  11437. }
  11438. if(!flag2 && anInt1251 == 0)
  11439. pushMessage("wishes to trade with you.", 4, s3);
  11440. } else if (s.endsWith(":clan:")) {
  11441. String s4 = s.substring(0, s.indexOf(":"));
  11442. long l18 = TextClass.longForName(s4);
  11443. pushMessage("Clan: ", 8, s4);
  11444. } else if(s.endsWith("#url#")) {
  11445. String link = s.substring(0, s.indexOf("#"));
  11446. pushMessage("Join us at: ", 9, link);
  11447. } else if(s.endsWith(":duelreq:")) {
  11448. String s4 = s.substring(0, s.indexOf(":"));
  11449. long l18 = TextClass.longForName(s4);
  11450. boolean flag3 = false;
  11451. for(int k27 = 0; k27 < ignoreCount; k27++) {
  11452. if(ignoreListAsLongs[k27] != l18)
  11453. continue;
  11454. flag3 = true;
  11455.  
  11456. }
  11457. if(!flag3 && anInt1251 == 0)
  11458. pushMessage("wishes to duel with you.", 8, s4);
  11459. } else if(s.endsWith(":chalreq:")) {
  11460. String s5 = s.substring(0, s.indexOf(":"));
  11461. long l19 = TextClass.longForName(s5);
  11462. boolean flag4 = false;
  11463. for(int l27 = 0; l27 < ignoreCount; l27++) {
  11464. if(ignoreListAsLongs[l27] != l19)
  11465. continue;
  11466. flag4 = true;
  11467.  
  11468. }
  11469. if(!flag4 && anInt1251 == 0) {
  11470. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  11471. pushMessage(s8, 8, s5);
  11472. }
  11473. } else {
  11474. pushMessage(s, 0, "");
  11475. }
  11476. pktType = -1;
  11477. return true;
  11478.  
  11479. case 1:
  11480. for(int k4 = 0; k4 < playerArray.length; k4++)
  11481. if(playerArray[k4] != null)
  11482. playerArray[k4].anim = -1;
  11483. for(int j12 = 0; j12 < npcArray.length; j12++)
  11484. if(npcArray[j12] != null)
  11485. npcArray[j12].anim = -1;
  11486. pktType = -1;
  11487. return true;
  11488.  
  11489. case 50:
  11490. long l4 = inStream.readQWord();
  11491. int i18 = inStream.readUnsignedByte();
  11492. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  11493. for(int k24 = 0; k24 < friendsCount; k24++) {
  11494. if(l4 != friendsListAsLongs[k24])
  11495. continue;
  11496. if(friendsNodeIDs[k24] != i18) {
  11497. friendsNodeIDs[k24] = i18;
  11498. needDrawTabArea = true;
  11499. if(i18 >= 2) {
  11500. pushMessage(s7 + " has logged in.", 5, "");
  11501. }
  11502. if(i18 <= 1) {
  11503. pushMessage(s7 + " has logged out.", 5, "");
  11504. }
  11505. }
  11506. s7 = null;
  11507.  
  11508. }
  11509. if(s7 != null && friendsCount < 200) {
  11510. friendsListAsLongs[friendsCount] = l4;
  11511. friendsList[friendsCount] = s7;
  11512. friendsNodeIDs[friendsCount] = i18;
  11513. friendsCount++;
  11514. needDrawTabArea = true;
  11515. }
  11516. for(boolean flag6 = false; !flag6;) {
  11517. flag6 = true;
  11518. for(int k29 = 0; k29 < friendsCount - 1; k29++)
  11519. if(friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  11520. int j31 = friendsNodeIDs[k29];
  11521. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  11522. friendsNodeIDs[k29 + 1] = j31;
  11523. String s10 = friendsList[k29];
  11524. friendsList[k29] = friendsList[k29 + 1];
  11525. friendsList[k29 + 1] = s10;
  11526. long l32 = friendsListAsLongs[k29];
  11527. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  11528. friendsListAsLongs[k29 + 1] = l32;
  11529. needDrawTabArea = true;
  11530. flag6 = false;
  11531. }
  11532. }
  11533. pktType = -1;
  11534. return true;
  11535.  
  11536. case 110:
  11537. if(tabID == 12)
  11538. needDrawTabArea = true;
  11539. energy = inStream.readUnsignedByte();
  11540. pktType = -1;
  11541. return true;
  11542.  
  11543. case 254:
  11544. anInt855 = inStream.readUnsignedByte();
  11545. if(anInt855 == 1)
  11546. anInt1222 = inStream.readUnsignedWord();
  11547. if(anInt855 >= 2 && anInt855 <= 6) {
  11548. if(anInt855 == 2) {
  11549. anInt937 = 64;
  11550. anInt938 = 64;
  11551. }
  11552. if(anInt855 == 3) {
  11553. anInt937 = 0;
  11554. anInt938 = 64;
  11555. }
  11556. if(anInt855 == 4) {
  11557. anInt937 = 128;
  11558. anInt938 = 64;
  11559. }
  11560. if(anInt855 == 5) {
  11561. anInt937 = 64;
  11562. anInt938 = 0;
  11563. }
  11564. if(anInt855 == 6) {
  11565. anInt937 = 64;
  11566. anInt938 = 128;
  11567. }
  11568. anInt855 = 2;
  11569. anInt934 = inStream.readUnsignedWord();
  11570. anInt935 = inStream.readUnsignedWord();
  11571. anInt936 = inStream.readUnsignedByte();
  11572. }
  11573. if(anInt855 == 10)
  11574. anInt933 = inStream.readUnsignedWord();
  11575. pktType = -1;
  11576. return true;
  11577.  
  11578. case 248:
  11579. int i5 = inStream.method435();
  11580. int k12 = inStream.readUnsignedWord();
  11581. if(backDialogID != -1) {
  11582. backDialogID = -1;
  11583. inputTaken = true;
  11584. }
  11585. if(inputDialogState != 0) {
  11586. inputDialogState = 0;
  11587. inputTaken = true;
  11588. }
  11589. openInterfaceID = i5;
  11590. invOverlayInterfaceID = k12;
  11591. needDrawTabArea = true;
  11592. tabAreaAltered = true;
  11593. aBoolean1149 = false;
  11594. pktType = -1;
  11595. return true;
  11596.  
  11597. case 79:
  11598. int j5 = inStream.method434();
  11599. int l12 = inStream.method435();
  11600. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  11601. if(class9_3 != null && class9_3.type == 0) {
  11602. if(l12 < 0)
  11603. l12 = 0;
  11604. if(l12 > class9_3.scrollMax - class9_3.height)
  11605. l12 = class9_3.scrollMax - class9_3.height;
  11606. class9_3.scrollPosition = l12;
  11607. }
  11608. pktType = -1;
  11609. return true;
  11610.  
  11611. case 68:
  11612. for(int k5 = 0; k5 < variousSettings.length; k5++)
  11613. if(variousSettings[k5] != anIntArray1045[k5]) {
  11614. variousSettings[k5] = anIntArray1045[k5];
  11615. method33(k5);
  11616. needDrawTabArea = true;
  11617. }
  11618. pktType = -1;
  11619. return true;
  11620.  
  11621. case 196:
  11622. long l5 = inStream.readQWord();
  11623. int j18 = inStream.readDWord();
  11624. int l21 = inStream.readUnsignedByte();
  11625. boolean flag5 = false;
  11626. for(int i28 = 0; i28 < 100; i28++) {
  11627. if(anIntArray1240[i28] != j18)
  11628. continue;
  11629. flag5 = true;
  11630.  
  11631. }
  11632. if(l21 <= 1) {
  11633. for(int l29 = 0; l29 < ignoreCount; l29++) {
  11634. if(ignoreListAsLongs[l29] != l5)
  11635. continue;
  11636. flag5 = true;
  11637.  
  11638. }
  11639. }
  11640. if(!flag5 && anInt1251 == 0)
  11641. try {
  11642. anIntArray1240[anInt1169] = j18;
  11643. anInt1169 = (anInt1169 + 1) % 100;
  11644. String s9 = TextInput.method525(pktSize - 13, inStream);
  11645. //if(l21 != 3)
  11646. //s9 = Censor.doCensor(s9);
  11647. if(l21 == 2 || l21 == 3)
  11648. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11649. else
  11650. if(l21 == 1)
  11651. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11652. else
  11653. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  11654. } catch(Exception exception1) {
  11655. signlink.reporterror("cde1");
  11656. }
  11657. pktType = -1;
  11658. return true;
  11659.  
  11660. case 85:
  11661. anInt1269 = inStream.method427();
  11662. anInt1268 = inStream.method427();
  11663. pktType = -1;
  11664. return true;
  11665.  
  11666. case 24:
  11667. anInt1054 = inStream.method428();
  11668. if(anInt1054 == tabID) {
  11669. if(anInt1054 == 3)
  11670. tabID = 1;
  11671. else
  11672. tabID = 3;
  11673. needDrawTabArea = true;
  11674. }
  11675. pktType = -1;
  11676. return true;
  11677.  
  11678. case 246:
  11679. int i6 = inStream.method434();
  11680. int i13 = inStream.readUnsignedWord();
  11681. int k18 = inStream.readUnsignedWord();
  11682. if(k18 == 65535) {
  11683. RSInterface.interfaceCache[i6].anInt233 = 0;
  11684. pktType = -1;
  11685. return true;
  11686. } else {
  11687. ItemDef itemDef = ItemDef.forID(k18);
  11688. RSInterface.interfaceCache[i6].anInt233 = 4;
  11689. RSInterface.interfaceCache[i6].mediaID = k18;
  11690. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotation1;
  11691. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotation2;
  11692. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  11693. pktType = -1;
  11694. return true;
  11695. }
  11696.  
  11697. case 171:
  11698. boolean flag1 = inStream.readUnsignedByte() == 1;
  11699. int j13 = inStream.readUnsignedWord();
  11700. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  11701. pktType = -1;
  11702. return true;
  11703.  
  11704. case 142:
  11705. int j6 = inStream.method434();
  11706. method60(j6);
  11707. if(backDialogID != -1) {
  11708. backDialogID = -1;
  11709. inputTaken = true;
  11710. }
  11711. if(inputDialogState != 0) {
  11712. inputDialogState = 0;
  11713. inputTaken = true;
  11714. }
  11715. invOverlayInterfaceID = j6;
  11716. needDrawTabArea = true;
  11717. tabAreaAltered = true;
  11718. openInterfaceID = -1;
  11719. aBoolean1149 = false;
  11720. pktType = -1;
  11721. return true;
  11722.  
  11723. case 126:
  11724. String text = inStream.readString();
  11725. int frame = inStream.method435();
  11726. if (text.startsWith("www.")) {
  11727. launchURL(text);
  11728. pktType = -1;
  11729. return true;
  11730. }
  11731. updateStrings(text, frame);
  11732. sendFrame126(text, frame);
  11733. if (frame >= 18144 && frame <= 18244) {
  11734. clanList[frame - 18144] = text;
  11735. }
  11736. pktType = -1;
  11737. return true;
  11738.  
  11739. case 206:
  11740. publicChatMode = inStream.readUnsignedByte();
  11741. privateChatMode = inStream.readUnsignedByte();
  11742. tradeMode = inStream.readUnsignedByte();
  11743. aBoolean1233 = true;
  11744. inputTaken = true;
  11745. pktType = -1;
  11746. return true;
  11747.  
  11748. case 240:
  11749. if(tabID == 12)
  11750. needDrawTabArea = true;
  11751. weight = inStream.readSignedWord();
  11752. pktType = -1;
  11753. return true;
  11754.  
  11755. case 8:
  11756. int k6 = inStream.method436();
  11757. int l13 = inStream.readUnsignedWord();
  11758. RSInterface.interfaceCache[k6].anInt233 = 1;
  11759. RSInterface.interfaceCache[k6].mediaID = l13;
  11760. pktType = -1;
  11761. return true;
  11762.  
  11763. case 122:
  11764. int l6 = inStream.method436();
  11765. int i14 = inStream.method436();
  11766. int i19 = i14 >> 10 & 0x1f;
  11767. int i22 = i14 >> 5 & 0x1f;
  11768. int l24 = i14 & 0x1f;
  11769. RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  11770. pktType = -1;
  11771. return true;
  11772.  
  11773. case 53:
  11774. needDrawTabArea = true;
  11775. int i7 = inStream.readUnsignedWord();
  11776. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  11777. int j19 = inStream.readUnsignedWord();
  11778. for(int j22 = 0; j22 < j19; j22++) {
  11779. int i25 = inStream.readUnsignedByte();
  11780. if(i25 == 255)
  11781. i25 = inStream.method440();
  11782. class9_1.inv[j22] = inStream.method436();
  11783. class9_1.invStackSizes[j22] = i25;
  11784. }
  11785. for(int j25 = j19; j25 < class9_1.inv.length; j25++) {
  11786. class9_1.inv[j25] = 0;
  11787. class9_1.invStackSizes[j25] = 0;
  11788. }
  11789. pktType = -1;
  11790. return true;
  11791.  
  11792. case 230:
  11793. int j7 = inStream.method435();
  11794. int j14 = inStream.readUnsignedWord();
  11795. int k19 = inStream.readUnsignedWord();
  11796. int k22 = inStream.method436();
  11797. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  11798. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  11799. RSInterface.interfaceCache[j14].modelZoom = j7;
  11800. pktType = -1;
  11801. return true;
  11802.  
  11803. case 221:
  11804. anInt900 = inStream.readUnsignedByte();
  11805. needDrawTabArea = true;
  11806. pktType = -1;
  11807. return true;
  11808.  
  11809. case 177:
  11810. aBoolean1160 = true;
  11811. anInt995 = inStream.readUnsignedByte();
  11812. anInt996 = inStream.readUnsignedByte();
  11813. anInt997 = inStream.readUnsignedWord();
  11814. anInt998 = inStream.readUnsignedByte();
  11815. anInt999 = inStream.readUnsignedByte();
  11816. if(anInt999 >= 100) {
  11817. int k7 = anInt995 * 128 + 64;
  11818. int k14 = anInt996 * 128 + 64;
  11819. int i20 = method42(plane, k14, k7) - anInt997;
  11820. int l22 = k7 - xCameraPos;
  11821. int k25 = i20 - zCameraPos;
  11822. int j28 = k14 - yCameraPos;
  11823. int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  11824. yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  11825. xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  11826. if(yCameraCurve < 128)
  11827. yCameraCurve = 128;
  11828. if(yCameraCurve > 383)
  11829. yCameraCurve = 383;
  11830. }
  11831. pktType = -1;
  11832. return true;
  11833.  
  11834. case 249:
  11835. anInt1046 = inStream.method426();
  11836. unknownInt10 = inStream.method436();
  11837. pktType = -1;
  11838. return true;
  11839.  
  11840. case 65:
  11841. updateNPCs(inStream, pktSize);
  11842. pktType = -1;
  11843. return true;
  11844.  
  11845. case 27:
  11846. messagePromptRaised = false;
  11847. inputDialogState = 1;
  11848. amountOrNameInput = "";
  11849. inputTaken = true;
  11850. pktType = -1;
  11851. return true;
  11852.  
  11853. case 187:
  11854. messagePromptRaised = false;
  11855. inputDialogState = 2;
  11856. amountOrNameInput = "";
  11857. inputTaken = true;
  11858. pktType = -1;
  11859. return true;
  11860.  
  11861. case 97:
  11862. int l7 = inStream.readUnsignedWord();
  11863. method60(l7);
  11864. if(invOverlayInterfaceID != -1) {
  11865. invOverlayInterfaceID = -1;
  11866. needDrawTabArea = true;
  11867. tabAreaAltered = true;
  11868. }
  11869. if(backDialogID != -1) {
  11870. backDialogID = -1;
  11871. inputTaken = true;
  11872. }
  11873. if(inputDialogState != 0) {
  11874. inputDialogState = 0;
  11875. inputTaken = true;
  11876. }
  11877. openInterfaceID = l7;
  11878. aBoolean1149 = false;
  11879. pktType = -1;
  11880. return true;
  11881.  
  11882. case 218:
  11883. int i8 = inStream.method438();
  11884. dialogID = i8;
  11885. inputTaken = true;
  11886. pktType = -1;
  11887. return true;
  11888.  
  11889. case 87:
  11890. int j8 = inStream.method434();
  11891. int l14 = inStream.method439();
  11892. anIntArray1045[j8] = l14;
  11893. if(variousSettings[j8] != l14) {
  11894. variousSettings[j8] = l14;
  11895. method33(j8);
  11896. needDrawTabArea = true;
  11897. if(dialogID != -1)
  11898. inputTaken = true;
  11899. }
  11900. pktType = -1;
  11901. return true;
  11902.  
  11903. case 36:
  11904. int k8 = inStream.method434();
  11905. byte byte0 = inStream.readSignedByte();
  11906. anIntArray1045[k8] = byte0;
  11907. if(variousSettings[k8] != byte0) {
  11908. variousSettings[k8] = byte0;
  11909. method33(k8);
  11910. needDrawTabArea = true;
  11911. if(dialogID != -1)
  11912. inputTaken = true;
  11913. }
  11914. pktType = -1;
  11915. return true;
  11916.  
  11917. case 61:
  11918. anInt1055 = inStream.readUnsignedByte();
  11919. pktType = -1;
  11920. return true;
  11921.  
  11922. case 200:
  11923. int l8 = inStream.readUnsignedWord();
  11924. int i15 = inStream.readSignedWord();
  11925. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  11926. class9_4.anInt257 = i15;
  11927. if(i15 == -1) {
  11928. class9_4.anInt246 = 0;
  11929. class9_4.anInt208 = 0;
  11930. }
  11931. pktType = -1;
  11932. return true;
  11933.  
  11934. case 219:
  11935. if(invOverlayInterfaceID != -1) {
  11936. invOverlayInterfaceID = -1;
  11937. needDrawTabArea = true;
  11938. tabAreaAltered = true;
  11939. }
  11940. if(backDialogID != -1) {
  11941. backDialogID = -1;
  11942. inputTaken = true;
  11943. }
  11944. if(inputDialogState != 0) {
  11945. inputDialogState = 0;
  11946. inputTaken = true;
  11947. }
  11948. openInterfaceID = -1;
  11949. aBoolean1149 = false;
  11950. pktType = -1;
  11951. return true;
  11952.  
  11953. case 34:
  11954. needDrawTabArea = true;
  11955. int i9 = inStream.readUnsignedWord();
  11956. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  11957. while(inStream.currentOffset < pktSize) {
  11958. int j20 = inStream.method422();
  11959. int i23 = inStream.readUnsignedWord();
  11960. int l25 = inStream.readUnsignedByte();
  11961. if(l25 == 255)
  11962. l25 = inStream.readDWord();
  11963. if(j20 >= 0 && j20 < class9_2.inv.length) {
  11964. class9_2.inv[j20] = i23;
  11965. class9_2.invStackSizes[j20] = l25;
  11966. }
  11967. }
  11968. pktType = -1;
  11969. return true;
  11970.  
  11971. case 4:
  11972. case 44:
  11973. case 84:
  11974. case 101:
  11975. case 105:
  11976. case 117:
  11977. case 147:
  11978. case 151:
  11979. case 156:
  11980. case 160:
  11981. case 215:
  11982. method137(inStream, pktType);
  11983. pktType = -1;
  11984. return true;
  11985.  
  11986. case 106:
  11987. tabID = inStream.method427();
  11988. needDrawTabArea = true;
  11989. tabAreaAltered = true;
  11990. pktType = -1;
  11991. return true;
  11992.  
  11993. case 164:
  11994. int j9 = inStream.method434();
  11995. method60(j9);
  11996. if(invOverlayInterfaceID != -1) {
  11997. invOverlayInterfaceID = -1;
  11998. needDrawTabArea = true;
  11999. tabAreaAltered = true;
  12000. }
  12001. backDialogID = j9;
  12002. inputTaken = true;
  12003. openInterfaceID = -1;
  12004. aBoolean1149 = false;
  12005. pktType = -1;
  12006. return true;
  12007.  
  12008. }
  12009. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  12010. //resetLogout();
  12011. } catch(IOException _ex) {
  12012. dropClient();
  12013. } catch(Exception exception) {
  12014. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  12015. for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  12016. s2 = s2 + inStream.buffer[j15] + ",";
  12017. signlink.reporterror(s2);
  12018. //resetLogout();
  12019. }
  12020. pktType = -1;
  12021. return true;
  12022. }
  12023.  
  12024. private void method146() {
  12025. anInt1265++;
  12026. method47(true);
  12027. method26(true);
  12028. method47(false);
  12029. method26(false);
  12030. method55();
  12031. method104();
  12032. if(!aBoolean1160) {
  12033. int i = anInt1184;
  12034. if(anInt984 / 256 > i)
  12035. i = anInt984 / 256;
  12036. if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  12037. i = anIntArray1203[4] + 128;
  12038. int k = minimapInt1 + anInt896 & 0x7ff;
  12039. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  12040. }
  12041. int j;
  12042. if(!aBoolean1160)
  12043. j = method120();
  12044. else
  12045. j = method121();
  12046. int l = xCameraPos;
  12047. int i1 = zCameraPos;
  12048. int j1 = yCameraPos;
  12049. int k1 = yCameraCurve;
  12050. int l1 = xCameraCurve;
  12051. for(int i2 = 0; i2 < 5; i2++)
  12052. if(aBooleanArray876[i2]) {
  12053. 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]);
  12054. if(i2 == 0)
  12055. xCameraPos += j2;
  12056. if(i2 == 1)
  12057. zCameraPos += j2;
  12058. if(i2 == 2)
  12059. yCameraPos += j2;
  12060. if(i2 == 3)
  12061. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  12062. if(i2 == 4) {
  12063. yCameraCurve += j2;
  12064. if(yCameraCurve < 128)
  12065. yCameraCurve = 128;
  12066. if(yCameraCurve > 383)
  12067. yCameraCurve = 383;
  12068. }
  12069. }
  12070. int k2 = Texture.anInt1481;
  12071. Model.aBoolean1684 = true;
  12072. Model.anInt1687 = 0;
  12073. Model.anInt1685 = super.mouseX - 4;
  12074. Model.anInt1686 = super.mouseY - 4;
  12075. DrawingArea.setAllPixelsToZero();
  12076. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  12077. worldController.clearObj5Cache();
  12078. updateEntities();
  12079. drawHeadIcon();
  12080. method37(k2);
  12081. draw3dScreen();
  12082. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  12083. xCameraPos = l;
  12084. zCameraPos = i1;
  12085. yCameraPos = j1;
  12086. yCameraCurve = k1;
  12087. xCameraCurve = l1;
  12088. }
  12089.  
  12090. public void clearTopInterfaces() {
  12091. stream.createFrame(130);
  12092. if (invOverlayInterfaceID != -1) {
  12093. invOverlayInterfaceID = -1;
  12094. needDrawTabArea = true;
  12095. aBoolean1149 = false;
  12096. tabAreaAltered = true;
  12097. }
  12098. if (backDialogID != -1) {
  12099. backDialogID = -1;
  12100. inputTaken = true;
  12101. aBoolean1149 = false;
  12102. }
  12103. openInterfaceID = -1;
  12104. fullscreenInterfaceID = -1;
  12105. }
  12106.  
  12107. public client() {
  12108. fullscreenInterfaceID = -1;
  12109. chatRights = new int[500];
  12110. chatTypeView = 0;
  12111. clanChatMode = 0;
  12112. cButtonHPos = -1;
  12113. cButtonHCPos = -1;
  12114. cButtonCPos = 0;
  12115. server = "127.0.0.1";
  12116. anIntArrayArray825 = new int[104][104];
  12117. friendsNodeIDs = new int[200];
  12118. groundArray = new NodeList[4][104][104];
  12119. aBoolean831 = false;
  12120. aStream_834 = new Stream(new byte[5000]);
  12121. npcArray = new NPC[16384];
  12122. npcIndices = new int[16384];
  12123. anIntArray840 = new int[1000];
  12124. aStream_847 = Stream.create();
  12125. aBoolean848 = true;
  12126. openInterfaceID = -1;
  12127. currentExp = new int[Skills.skillsCount];
  12128. aBoolean872 = false;
  12129. anIntArray873 = new int[5];
  12130. anInt874 = -1;
  12131. aBooleanArray876 = new boolean[5];
  12132. drawFlames = false;
  12133. reportAbuseInput = "";
  12134. unknownInt10 = -1;
  12135. menuOpen = false;
  12136. inputString = "";
  12137. maxPlayers = 2048;
  12138. myPlayerIndex = 2047;
  12139. playerArray = new Player[maxPlayers];
  12140. playerIndices = new int[maxPlayers];
  12141. anIntArray894 = new int[maxPlayers];
  12142. aStreamArray895s = new Stream[maxPlayers];
  12143. anInt897 = 1;
  12144. anIntArrayArray901 = new int[104][104];
  12145. anInt902 = 0x766654;
  12146. aByteArray912 = new byte[16384];
  12147. currentStats = new int[Skills.skillsCount];
  12148. ignoreListAsLongs = new long[100];
  12149. loadingError = false;
  12150. anInt927 = 0x332d25;
  12151. anIntArray928 = new int[5];
  12152. anIntArrayArray929 = new int[104][104];
  12153. chatTypes = new int[500];
  12154. chatNames = new String[500];
  12155. chatMessages = new String[500];
  12156. chatButtons = new Sprite[4];
  12157. sideIcons = new Sprite[15];
  12158. redStones = new Sprite[5];
  12159. aBoolean954 = true;
  12160. friendsListAsLongs = new long[200];
  12161. currentSong = -1;
  12162. drawingFlames = false;
  12163. spriteDrawX = -1;
  12164. spriteDrawY = -1;
  12165. anIntArray968 = new int[33];
  12166. anIntArray969 = new int[256];
  12167. decompressors = new Decompressor[5];
  12168. variousSettings = new int[2000];
  12169. aBoolean972 = false;
  12170. anInt975 = 50;
  12171. anIntArray976 = new int[anInt975];
  12172. anIntArray977 = new int[anInt975];
  12173. anIntArray978 = new int[anInt975];
  12174. anIntArray979 = new int[anInt975];
  12175. anIntArray980 = new int[anInt975];
  12176. anIntArray981 = new int[anInt975];
  12177. anIntArray982 = new int[anInt975];
  12178. aStringArray983 = new String[anInt975];
  12179. anInt985 = -1;
  12180. hitMarks = new Sprite[20];
  12181. anIntArray990 = new int[5];
  12182. aBoolean994 = false;
  12183. anInt1002 = 0x23201b;
  12184. amountOrNameInput = "";
  12185. aClass19_1013 = new NodeList();
  12186. aBoolean1017 = false;
  12187. anInt1018 = -1;
  12188. anIntArray1030 = new int[5];
  12189. aBoolean1031 = false;
  12190. mapFunctions = new Sprite[100];
  12191. dialogID = -1;
  12192. maxStats = new int[Skills.skillsCount];
  12193. anIntArray1045 = new int[2000];
  12194. aBoolean1047 = true;
  12195. anIntArray1052 = new int[151];
  12196. anInt1054 = -1;
  12197. aClass19_1056 = new NodeList();
  12198. anIntArray1057 = new int[33];
  12199. aClass9_1059 = new RSInterface();
  12200. mapScenes = new Background[100];
  12201. barFillColor = 0x4d4233;
  12202. anIntArray1065 = new int[7];
  12203. anIntArray1072 = new int[1000];
  12204. anIntArray1073 = new int[1000];
  12205. aBoolean1080 = false;
  12206. friendsList = new String[200];
  12207. inStream = Stream.create();
  12208. expectedCRCs = new int[9];
  12209. menuActionCmd2 = new int[500];
  12210. menuActionCmd3 = new int[500];
  12211. menuActionID = new int[500];
  12212. menuActionCmd1 = new int[500];
  12213. headIcons = new Sprite[20];
  12214. skullIcons = new Sprite[20];
  12215. headIconsHint = new Sprite[20];
  12216. tabAreaAltered = false;
  12217. aString1121 = "";
  12218. atPlayerActions = new String[5];
  12219. atPlayerArray = new boolean[5];
  12220. anIntArrayArrayArray1129 = new int[4][13][13];
  12221. anInt1132 = 2;
  12222. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  12223. aBoolean1141 = false;
  12224. aBoolean1149 = false;
  12225. crosses = new Sprite[8];
  12226. musicEnabled = true;
  12227. needDrawTabArea = false;
  12228. loggedIn = false;
  12229. canMute = false;
  12230. aBoolean1159 = false;
  12231. aBoolean1160 = false;
  12232. anInt1171 = 1;
  12233. myUsername = "";
  12234. myPassword = "";
  12235. genericLoadingError = false;
  12236. reportAbuseInterfaceID = -1;
  12237. aClass19_1179 = new NodeList();
  12238. anInt1184 = 128;
  12239. invOverlayInterfaceID = -1;
  12240. stream = Stream.create();
  12241. menuActionName = new String[500];
  12242. anIntArray1203 = new int[5];
  12243. anIntArray1207 = new int[50];
  12244. anInt1210 = 2;
  12245. anInt1211 = 78;
  12246. promptInput = "";
  12247. modIcons = new Background[2];
  12248. tabID = 3;
  12249. inputTaken = false;
  12250. songChanging = true;
  12251. anIntArray1229 = new int[151];
  12252. aClass11Array1230 = new Class11[4];
  12253. aBoolean1233 = false;
  12254. anIntArray1240 = new int[100];
  12255. anIntArray1241 = new int[50];
  12256. aBoolean1242 = false;
  12257. anIntArray1250 = new int[50];
  12258. rsAlreadyLoaded = false;
  12259. welcomeScreenRaised = false;
  12260. messagePromptRaised = false;
  12261. loginMessage1 = "";
  12262. loginMessage2 = "";
  12263. backDialogID = -1;
  12264. anInt1279 = 2;
  12265. bigX = new int[4000];
  12266. bigY = new int[4000];
  12267. anInt1289 = -1;
  12268. }
  12269.  
  12270. public int rights;
  12271. public String name;
  12272. public String message;
  12273. public String clanname;
  12274. private final int[] chatRights;
  12275. public int chatTypeView;
  12276. public int clanChatMode;
  12277. public int duelMode;
  12278. /* Declare custom sprites */
  12279. private Sprite chatArea;
  12280. private Sprite[] chatButtons;
  12281. private Sprite tabArea;
  12282. private Sprite mapArea;
  12283. /**/
  12284. private RSImageProducer leftFrame;
  12285. private RSImageProducer topFrame;
  12286. private RSImageProducer rightFrame;
  12287. private int ignoreCount;
  12288. private long aLong824;
  12289. private int[][] anIntArrayArray825;
  12290. private int[] friendsNodeIDs;
  12291. private NodeList[][][] groundArray;
  12292. private int[] anIntArray828;
  12293. private int[] anIntArray829;
  12294. private volatile boolean aBoolean831;
  12295. private Socket aSocket832;
  12296. private int loginScreenState;
  12297. private Stream aStream_834;
  12298. private NPC[] npcArray;
  12299. private int npcCount;
  12300. private int[] npcIndices;
  12301. private int anInt839;
  12302. private int[] anIntArray840;
  12303. private int anInt841;
  12304. private int anInt842;
  12305. private int anInt843;
  12306. private String aString844;
  12307. private int privateChatMode;
  12308. private Stream aStream_847;
  12309. private boolean aBoolean848;
  12310. private static int anInt849;
  12311. private int[] anIntArray850;
  12312. private int[] anIntArray851;
  12313. private int[] anIntArray852;
  12314. private int[] anIntArray853;
  12315. private static int anInt854;
  12316. private int anInt855;
  12317. private int openInterfaceID;
  12318. private int xCameraPos;
  12319. private int zCameraPos;
  12320. private int yCameraPos;
  12321. private int yCameraCurve;
  12322. private int xCameraCurve;
  12323. private int myPrivilege;
  12324. private final int[] currentExp;
  12325. private Sprite[] redStones;
  12326. private Sprite mapFlag;
  12327. private Sprite mapMarker;
  12328. private boolean aBoolean872;
  12329. private final int[] anIntArray873;
  12330. private int anInt874;
  12331. private final boolean[] aBooleanArray876;
  12332. private int weight;
  12333. private MouseDetection mouseDetection;
  12334. private volatile boolean drawFlames;
  12335. private String reportAbuseInput;
  12336. private int unknownInt10;
  12337. private boolean menuOpen;
  12338. private int anInt886;
  12339. private String inputString;
  12340. private final int maxPlayers;
  12341. private final int myPlayerIndex;
  12342. private Player[] playerArray;
  12343. private int playerCount;
  12344. private int[] playerIndices;
  12345. private int anInt893;
  12346. private int[] anIntArray894;
  12347. private Stream[] aStreamArray895s;
  12348. private int anInt896;
  12349. private int anInt897;
  12350. private int friendsCount;
  12351. private int anInt900;
  12352. private int[][] anIntArrayArray901;
  12353. private final int anInt902;
  12354. private byte[] aByteArray912;
  12355. private int anInt913;
  12356. private int crossX;
  12357. private int crossY;
  12358. private int crossIndex;
  12359. private int crossType;
  12360. private int plane;
  12361. private final int[] currentStats;
  12362. private static int anInt924;
  12363. private final long[] ignoreListAsLongs;
  12364. private boolean loadingError;
  12365. private final int anInt927;
  12366. private final int[] anIntArray928;
  12367. private int[][] anIntArrayArray929;
  12368. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  12369. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  12370. private int anInt933;
  12371. private int anInt934;
  12372. private int anInt935;
  12373. private int anInt936;
  12374. private int anInt937;
  12375. private int anInt938;
  12376. private static int anInt940;
  12377. private final int[] chatTypes;
  12378. private final String[] chatNames;
  12379. private final String[] chatMessages;
  12380. private int anInt945;
  12381. private WorldController worldController;
  12382. private Sprite[] sideIcons;
  12383. private int menuScreenArea;
  12384. private int menuOffsetX;
  12385. private int menuOffsetY;
  12386. private int menuWidth;
  12387. private int menuHeight;
  12388. private long aLong953;
  12389. private boolean aBoolean954;
  12390. private long[] friendsListAsLongs;
  12391. private String[] clanList = new String[100];
  12392. private int currentSong;
  12393. private static int nodeID = 10;
  12394. static int portOff;
  12395. static boolean clientData;
  12396. private static boolean isMembers = true;
  12397. private static boolean lowMem;
  12398. private volatile boolean drawingFlames;
  12399. private int spriteDrawX;
  12400. private int spriteDrawY;
  12401. private final int[] anIntArray965 = {
  12402. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  12403. };
  12404. private Background aBackground_966;
  12405. private Background aBackground_967;
  12406. private final int[] anIntArray968;
  12407. private final int[] anIntArray969;
  12408. final Decompressor[] decompressors;
  12409. public int variousSettings[];
  12410. private boolean aBoolean972;
  12411. private final int anInt975;
  12412. private final int[] anIntArray976;
  12413. private final int[] anIntArray977;
  12414. private final int[] anIntArray978;
  12415. private final int[] anIntArray979;
  12416. private final int[] anIntArray980;
  12417. private final int[] anIntArray981;
  12418. private final int[] anIntArray982;
  12419. private final String[] aStringArray983;
  12420. private int anInt984;
  12421. private int anInt985;
  12422. private static int anInt986;
  12423. private Sprite[] hitMarks;
  12424. private int anInt988;
  12425. private int anInt989;
  12426. private final int[] anIntArray990;
  12427. private static boolean aBoolean993;
  12428. private final boolean aBoolean994;
  12429. private int anInt995;
  12430. private int anInt996;
  12431. private int anInt997;
  12432. private int anInt998;
  12433. private int anInt999;
  12434. private ISAACRandomGen encryption;
  12435. private Sprite mapEdge;
  12436. private Sprite multiOverlay;
  12437. private final int anInt1002;
  12438. static final int[][] anIntArrayArray1003 = {
  12439. {
  12440. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  12441. 2983, 54193
  12442. }, {
  12443. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  12444. 56621, 4783, 1341, 16578, 35003, 25239
  12445. }, {
  12446. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  12447. 10153, 56621, 4783, 1341, 16578, 35003
  12448. }, {
  12449. 4626, 11146, 6439, 12, 4758, 10270
  12450. }, {
  12451. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  12452. }
  12453. };
  12454. private String amountOrNameInput;
  12455. private static int anInt1005;
  12456. private int daysSinceLastLogin;
  12457. private int pktSize;
  12458. private int pktType;
  12459. private int anInt1009;
  12460. private int anInt1010;
  12461. private int anInt1011;
  12462. private NodeList aClass19_1013;
  12463. private int anInt1014;
  12464. private int anInt1015;
  12465. private int anInt1016;
  12466. private boolean aBoolean1017;
  12467. private int anInt1018;
  12468. private static final int[] anIntArray1019;
  12469. private int anInt1021;
  12470. private int anInt1022;
  12471. private int loadingStage;
  12472. private Sprite scrollBar1;
  12473. private Sprite scrollBar2;
  12474. private int anInt1026;
  12475. private Background backBase1;
  12476. private Background backBase2;
  12477. private Background backHmid1;
  12478. private final int[] anIntArray1030;
  12479. private boolean aBoolean1031;
  12480. private Sprite[] mapFunctions;
  12481. private int baseX;
  12482. private int baseY;
  12483. private int anInt1036;
  12484. private int anInt1037;
  12485. private int loginFailures;
  12486. private int anInt1039;
  12487. private int anInt1040;
  12488. private int anInt1041;
  12489. private int dialogID;
  12490. private final int[] maxStats;
  12491. private final int[] anIntArray1045;
  12492. private int anInt1046;
  12493. private boolean aBoolean1047;
  12494. private int anInt1048;
  12495. private String aString1049;
  12496. private static int anInt1051;
  12497. private final int[] anIntArray1052;
  12498. private StreamLoader titleStreamLoader;
  12499. private int anInt1054;
  12500. private int anInt1055;
  12501. private NodeList aClass19_1056;
  12502. private final int[] anIntArray1057;
  12503. public final RSInterface aClass9_1059;
  12504. private Background[] mapScenes;
  12505. private static int anInt1061;
  12506. private int anInt1062;
  12507. private final int barFillColor;
  12508. private int friendsListAction;
  12509. private final int[] anIntArray1065;
  12510. private int mouseInvInterfaceIndex;
  12511. private int lastActiveInvInterface;
  12512. private OnDemandFetcher onDemandFetcher;
  12513. private int anInt1069;
  12514. private int anInt1070;
  12515. private int anInt1071;
  12516. private int[] anIntArray1072;
  12517. private int[] anIntArray1073;
  12518. private Sprite mapDotItem;
  12519. private Sprite mapDotNPC;
  12520. private Sprite mapDotPlayer;
  12521. private Sprite mapDotFriend;
  12522. private Sprite mapDotTeam;
  12523. private Sprite mapDotClan;
  12524. private int anInt1079;
  12525. private boolean aBoolean1080;
  12526. private String[] friendsList;
  12527. private Stream inStream;
  12528. private int anInt1084;
  12529. private int anInt1085;
  12530. private int activeInterfaceType;
  12531. private int anInt1087;
  12532. private int anInt1088;
  12533. public static int anInt1089;
  12534. private final int[] expectedCRCs;
  12535. private int[] menuActionCmd2;
  12536. private int[] menuActionCmd3;
  12537. private int[] menuActionID;
  12538. private int[] menuActionCmd1;
  12539. private Sprite[] headIcons;
  12540. private Sprite[] skullIcons;
  12541. private Sprite[] headIconsHint;
  12542. private static int anInt1097;
  12543. private int anInt1098;
  12544. private int anInt1099;
  12545. private int anInt1100;
  12546. private int anInt1101;
  12547. private int anInt1102;
  12548. private static boolean tabAreaAltered;
  12549. private int anInt1104;
  12550. private RSImageProducer aRSImageProducer_1107;
  12551. private RSImageProducer aRSImageProducer_1108;
  12552. private RSImageProducer aRSImageProducer_1109;
  12553. private RSImageProducer aRSImageProducer_1110;
  12554. private RSImageProducer aRSImageProducer_1111;
  12555. private RSImageProducer aRSImageProducer_1112;
  12556. private RSImageProducer aRSImageProducer_1113;
  12557. private RSImageProducer aRSImageProducer_1114;
  12558. private RSImageProducer aRSImageProducer_1115;
  12559. private static int anInt1117;
  12560. private int membersInt;
  12561. private String aString1121;
  12562. private Sprite compass;
  12563. private RSImageProducer aRSImageProducer_1123;
  12564. private RSImageProducer aRSImageProducer_1124;
  12565. private RSImageProducer aRSImageProducer_1125;
  12566. public static Player myPlayer;
  12567. private final String[] atPlayerActions;
  12568. private final boolean[] atPlayerArray;
  12569. private final int[][][] anIntArrayArrayArray1129;
  12570. private final int[] tabInterfaceIDs = {
  12571. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  12572. -1, -1, -1, -1, -1
  12573. };
  12574. private int anInt1131;
  12575. private int anInt1132;
  12576. private int menuActionRow;
  12577. private static int anInt1134;
  12578. private int spellSelected;
  12579. private int anInt1137;
  12580. private int spellUsableOn;
  12581. private String spellTooltip;
  12582. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  12583. private boolean aBoolean1141;
  12584. private static int anInt1142;
  12585. private int energy;
  12586. private boolean aBoolean1149;
  12587. private Sprite[] crosses;
  12588. private boolean musicEnabled;
  12589. private Background[] aBackgroundArray1152s;
  12590. private static boolean needDrawTabArea;
  12591. private int unreadMessages;
  12592. private static int anInt1155;
  12593. private static boolean fpsOn;
  12594. public boolean loggedIn;
  12595. private boolean canMute;
  12596. private boolean aBoolean1159;
  12597. private boolean aBoolean1160;
  12598. static int loopCycle;
  12599. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  12600. private RSImageProducer aRSImageProducer_1163;
  12601. private RSImageProducer mapEdgeIP;
  12602. private RSImageProducer aRSImageProducer_1164;
  12603. private RSImageProducer aRSImageProducer_1165;
  12604. private RSImageProducer aRSImageProducer_1166;
  12605. private int daysSinceRecovChange;
  12606. private RSSocket socketStream;
  12607. private int anInt1169;
  12608. private int minimapInt3;
  12609. private int anInt1171;
  12610. private long aLong1172;
  12611. private String myUsername;
  12612. private String myPassword;
  12613. private static int anInt1175;
  12614. private boolean genericLoadingError;
  12615. private final int[] anIntArray1177 = {
  12616. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  12617. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  12618. 2, 2, 3
  12619. };
  12620. private int reportAbuseInterfaceID;
  12621. private NodeList aClass19_1179;
  12622. private int[] anIntArray1180;
  12623. private int[] anIntArray1181;
  12624. private int[] anIntArray1182;
  12625. private byte[][] aByteArrayArray1183;
  12626. private int anInt1184;
  12627. private int minimapInt1;
  12628. private int anInt1186;
  12629. private int anInt1187;
  12630. private static int anInt1188;
  12631. private int invOverlayInterfaceID;
  12632. private int[] anIntArray1190;
  12633. private int[] anIntArray1191;
  12634. private Stream stream;
  12635. private int anInt1193;
  12636. private int splitPrivateChat;
  12637. private Background mapBack;
  12638. private String[] menuActionName;
  12639. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  12640. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  12641. private final int[] anIntArray1203;
  12642. static final int[] anIntArray1204 = {
  12643. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  12644. 58654, 5027, 1457, 16565, 34991, 25486
  12645. };
  12646. private static boolean flagged;
  12647. private final int[] anIntArray1207;
  12648. private int anInt1208;
  12649. private int minimapInt2;
  12650. private int anInt1210;
  12651. private int anInt1211;
  12652. private String promptInput;
  12653. private int anInt1213;
  12654. private int[][][] intGroundArray;
  12655. private long aLong1215;
  12656. private int loginScreenCursorPos;
  12657. private final Background[] modIcons;
  12658. private long aLong1220;
  12659. private static int tabID;
  12660. private int anInt1222;
  12661. public static boolean inputTaken;
  12662. private int inputDialogState;
  12663. private static int anInt1226;
  12664. private int nextSong;
  12665. private boolean songChanging;
  12666. private final int[] anIntArray1229;
  12667. private Class11[] aClass11Array1230;
  12668. public static int anIntArray1232[];
  12669. private boolean aBoolean1233;
  12670. private int[] anIntArray1234;
  12671. private int[] anIntArray1235;
  12672. private int[] anIntArray1236;
  12673. private int anInt1237;
  12674. private int anInt1238;
  12675. public final int anInt1239 = 100;
  12676. private final int[] anIntArray1240;
  12677. private final int[] anIntArray1241;
  12678. private boolean aBoolean1242;
  12679. private int atInventoryLoopCycle;
  12680. private int atInventoryInterface;
  12681. private int atInventoryIndex;
  12682. private int atInventoryInterfaceType;
  12683. private byte[][] aByteArrayArray1247;
  12684. private int tradeMode;
  12685. private int anInt1249;
  12686. private final int[] anIntArray1250;
  12687. private int anInt1251;
  12688. private final boolean rsAlreadyLoaded;
  12689. private int anInt1253;
  12690. private int anInt1254;
  12691. private boolean welcomeScreenRaised;
  12692. private boolean messagePromptRaised;
  12693. private int anInt1257;
  12694. private byte[][][] byteGroundArray;
  12695. private int prevSong;
  12696. private int destX;
  12697. private int destY;
  12698. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  12699. private int anInt1264;
  12700. private int anInt1265;
  12701. private String loginMessage1;
  12702. private String loginMessage2;
  12703. private int anInt1268;
  12704. private int anInt1269;
  12705. private TextDrawingArea smallText;
  12706. private TextDrawingArea aTextDrawingArea_1271;
  12707. private TextDrawingArea chatTextDrawingArea;
  12708. private int anInt1275;
  12709. private int backDialogID;
  12710. private int anInt1278;
  12711. private int anInt1279;
  12712. private int[] bigX;
  12713. private int[] bigY;
  12714. private int itemSelected;
  12715. private int anInt1283;
  12716. private int anInt1284;
  12717. private int anInt1285;
  12718. private String selectedItemName;
  12719. private int publicChatMode;
  12720. private static int anInt1288;
  12721. private int anInt1289;
  12722. public static int anInt1290;
  12723. public static String server = "127.0.0.1";
  12724. public int drawCount;
  12725. public int fullscreenInterfaceID;
  12726. public int anInt1044;//377
  12727. public int anInt1129;//377
  12728. public int anInt1315;//377
  12729. public int anInt1500;//377
  12730. public int anInt1501;//377
  12731. public int[] fullScreenTextureArray;
  12732. public void resetAllImageProducers() {
  12733. if (super.fullGameScreen != null) {
  12734. return;
  12735. }
  12736. aRSImageProducer_1166 = null;
  12737. aRSImageProducer_1164 = null;
  12738. aRSImageProducer_1163 = null;
  12739. aRSImageProducer_1165 = null;
  12740. aRSImageProducer_1123 = null;
  12741. aRSImageProducer_1124 = null;
  12742. aRSImageProducer_1125 = null;
  12743. aRSImageProducer_1107 = null;
  12744. aRSImageProducer_1108 = null;
  12745. aRSImageProducer_1109 = null;
  12746. aRSImageProducer_1110 = null;
  12747. aRSImageProducer_1111 = null;
  12748. aRSImageProducer_1112 = null;
  12749. aRSImageProducer_1113 = null;
  12750. aRSImageProducer_1114 = null;
  12751. aRSImageProducer_1115 = null;
  12752. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  12753. welcomeScreenRaised = true;
  12754. }
  12755.  
  12756.  
  12757. public void launchURL(String url) {
  12758. String osName = System.getProperty("os.name");
  12759. try {
  12760. if (osName.startsWith("Mac OS")) {
  12761. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  12762. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
  12763. openURL.invoke(null, new Object[] {url});
  12764. } else if (osName.startsWith("Windows"))
  12765. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  12766. else { //assume Unix or Linux
  12767. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  12768. String browser = null;
  12769. for (int count = 0; count < browsers.length && browser == null; count++)
  12770. if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
  12771. browser = browsers[count];
  12772. if (browser == null) {
  12773. throw new Exception("Could not find web browser");
  12774. } else
  12775. Runtime.getRuntime().exec(new String[] {browser, url});
  12776. }
  12777. } catch (Exception e) {
  12778. pushMessage("Failed to open URL.", 0, "");
  12779. }
  12780. }
  12781.  
  12782. static {
  12783. anIntArray1019 = new int[99];
  12784. int i = 0;
  12785. for(int j = 0; j < 99; j++) {
  12786. int l = j + 1;
  12787. int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  12788. i += i1;
  12789. anIntArray1019[j] = i / 4;
  12790. }
  12791. anIntArray1232 = new int[32];
  12792. i = 2;
  12793. for(int k = 0; k < 32; k++) {
  12794. anIntArray1232[k] = i - 1;
  12795. i += i;
  12796. }
  12797. }
  12798. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement