Guest User

client.java

a guest
Jul 4th, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 378.13 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(0, 0);
  194. drawChannelButtons();
  195. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  196. if(messagePromptRaised) {
  197. chatTextDrawingArea.drawText(0, aString1121, 60, 259);
  198. chatTextDrawingArea.drawText(128, promptInput + "*", 80, 259);
  199. } else if(inputDialogState == 1) {
  200. chatTextDrawingArea.drawText(0, "Enter amount:", 60, 259);
  201. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  202. } else if(inputDialogState == 2) {
  203. chatTextDrawingArea.drawText(0, "Enter name:", 60, 259);
  204. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  205. } else if(aString844 != null) {
  206. chatTextDrawingArea.drawText(0, aString844, 60, 259);
  207. chatTextDrawingArea.drawText(128, "Click to continue", 80, 259);
  208. } else if(backDialogID != -1) {
  209. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  210. } else if(dialogID != -1) {
  211. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  212. } else {
  213. int j77 = -3;
  214. int j = 0;
  215. DrawingArea.setDrawingArea(122, 8, 497, 7);
  216. for(int k = 0; k < 500; k++)
  217. if(chatMessages[k] != null) {
  218. int chatType = chatTypes[k];
  219. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  220. String s1 = chatNames[k];
  221. byte byte0 = 0;
  222. if(s1 != null && s1.startsWith("@cr1@")) {
  223. s1 = s1.substring(5);
  224. byte0 = 1;
  225. } else if(s1 != null && s1.startsWith("@cr2@")) {
  226. s1 = s1.substring(5);
  227. byte0 = 2;
  228. } else if(s1 != null && s1.startsWith("@cr3@")) {
  229. s1 = s1.substring(5);
  230. byte0 = 3;
  231. }
  232. if(chatType == 0) {
  233. if (chatTypeView == 5 || chatTypeView == 0) {
  234. if(yPos > 0 && yPos < 210)
  235. textDrawingArea.method389(false, 11, 0, chatMessages[k], yPos);//chat color enabled
  236. j++;
  237. j77++;
  238. }
  239. }
  240. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  241. if (chatTypeView == 1 || chatTypeView == 0) {
  242. if(yPos > 0 && yPos < 210) {
  243. int xPos = 11;
  244. if(byte0 == 1) {
  245. modIcons[0].drawBackground(xPos + 1, yPos - 12);
  246. xPos += 14;
  247. } else if(byte0 == 2) {
  248. modIcons[1].drawBackground(xPos + 1, yPos - 12);
  249. xPos += 14;
  250. } else if(byte0 == 3) {
  251. modIcons[2].drawBackground(xPos + 1, yPos - 12);
  252. xPos += 14;
  253. }
  254. textDrawingArea.method385(0, s1 + ":", yPos, xPos);
  255. xPos += textDrawingArea.getTextWidth(s1) + 8;
  256. textDrawingArea.method389(false, xPos, 255, chatMessages[k], yPos);
  257. }
  258. j++;
  259. j77++;
  260. }
  261. }
  262. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  263. if (chatTypeView == 2 || chatTypeView == 0) {
  264. if(yPos > 0 && yPos < 210) {
  265. int k1 = 11;
  266. textDrawingArea.method385(0, "From", yPos, k1);
  267. k1 += textDrawingArea.getTextWidth("From ");
  268. if(byte0 == 1) {
  269. modIcons[0].drawBackground(k1, yPos - 12);
  270. k1 += 12;
  271. } else if(byte0 == 2) {
  272. modIcons[1].drawBackground(k1, yPos - 12);
  273. k1 += 12;
  274. } else if(byte0 == 3) {
  275. modIcons[2].drawBackground(k1, yPos - 12);
  276. k1 += 12;
  277. }
  278. textDrawingArea.method385(0, s1 + ":", yPos, k1);
  279. k1 += textDrawingArea.getTextWidth(s1) + 8;
  280. textDrawingArea.method385(0x800000, chatMessages[k], yPos, k1);
  281. }
  282. j++;
  283. j77++;
  284. }
  285. }
  286. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  287. if (chatTypeView == 3 || chatTypeView == 0) {
  288. if(yPos > 0 && yPos < 210)
  289. textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], yPos, 11);
  290. j++;
  291. j77++;
  292. }
  293. }
  294. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  295. if (chatTypeView == 2 || chatTypeView == 0) {
  296. if(yPos > 0 && yPos < 210)
  297. textDrawingArea.method385(0x800000, chatMessages[k], yPos, 11);
  298. j++;
  299. j77++;
  300. }
  301. }
  302. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  303. if (chatTypeView == 2 || chatTypeView == 0) {
  304. if(yPos > 0 && yPos < 210) {
  305. textDrawingArea.method385(0, "To " + s1 + ":", yPos, 11);
  306. textDrawingArea.method385(0x800000, chatMessages[k], yPos, 15 + textDrawingArea.getTextWidth("To :" + s1));
  307. }
  308. j++;
  309. j77++;
  310. }
  311. }
  312. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  313. if (chatTypeView == 3 || chatTypeView == 0) {
  314. if(yPos > 0 && yPos < 210)
  315. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  316. j++;
  317. j77++;
  318. }
  319. if(chatType == 11 && (clanChatMode == 0)) {
  320. if (chatTypeView == 11) {
  321. if(yPos > 0 && yPos < 210)
  322. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  323. j++;
  324. j77++;
  325. }
  326. if(chatType == 12) {
  327. if(yPos > 0 && yPos < 110)
  328. textDrawingArea.method385(0x7e3200, chatMessages[k] + " @blu@" + s1, yPos, 11);
  329. j++;
  330. }
  331. }
  332. }
  333. if(chatType == 16) {
  334. int j2 = 40;
  335. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  336. if(chatTypeView == 11 || chatTypeView == 0) {
  337. if(yPos > 3 && yPos < 130)
  338. switch(chatRights[k]) {
  339. case 1:
  340. j2 += clanNameWidth;
  341. modIcons[0].drawBackground(j2 - 18, yPos - 12);
  342. j2 += 14;
  343. break;
  344.  
  345. case 2:
  346. j2 += clanNameWidth;
  347. modIcons[1].drawBackground(j2 - 18, yPos - 12);
  348. j2 += 14;
  349. break;
  350.  
  351. case 3:
  352. j2 += clanNameWidth;
  353. modIcons[1].drawBackground(j2 - 18, yPos - 12);
  354. j2 += 14;
  355. break;
  356.  
  357. default:
  358. j2 += clanNameWidth;
  359. break;
  360. }
  361. textDrawingArea.method385(0, "[", yPos, 8);
  362. textDrawingArea.method385(255, ""+clanname+"", yPos, 14);
  363. textDrawingArea.method385(0, "]", yPos, clanNameWidth + 14);
  364.  
  365. textDrawingArea.method385(0, chatNames[k]+":", yPos, j2 - 17); //j2
  366. j2 += textDrawingArea.getTextWidth(chatNames[k]) + 7;
  367. textDrawingArea.method385(0x800000, chatMessages[k], yPos, j2 - 16);//j2
  368. j++;
  369. j77++;
  370. }
  371. }
  372. }
  373. DrawingArea.defaultDrawingAreaSize();
  374. anInt1211 = j * 14 + 7 + 5;
  375. if(anInt1211 < 111)
  376. anInt1211 = 111;
  377. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  378. String s;
  379. if(myPlayer != null && myPlayer.name != null)
  380. s = myPlayer.name;
  381. else
  382. s = TextClass.fixName(myUsername);
  383. textDrawingArea.method385(0, s + ":", 133, 11);
  384. textDrawingArea.drawChatInput(255, 12 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false);
  385. DrawingArea.method339(121, 0x807660, 506, 7);
  386. }
  387. if(menuOpen && menuScreenArea == 2) {
  388. drawMenu();
  389. }
  390. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  391. aRSImageProducer_1165.initDrawingArea();
  392. Texture.anIntArray1472 = anIntArray1182;
  393. }
  394.  
  395. public void init() {
  396. nodeID = 10;
  397. portOff = 0;
  398. setHighMem();
  399. isMembers = true;
  400. initClientFrame(503, 765);
  401. }
  402.  
  403. public void startRunnable(Runnable runnable, int i) {
  404. if(i > 10)
  405. i = 10;
  406. if(signlink.mainapp != null) {
  407. signlink.startthread(runnable, i);
  408. } else {
  409. super.startRunnable(runnable, i);
  410. }
  411. }
  412.  
  413. public Socket openSocket(int port) throws IOException {
  414. return new Socket(InetAddress.getByName(server), port);
  415. }
  416.  
  417. private void processMenuClick() {
  418. if(activeInterfaceType != 0)
  419. return;
  420. int j = super.clickMode3;
  421. if(spellSelected == 1 && super.saveClickX >= 516 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  422. j = 0;
  423. if(menuOpen) {
  424. if(j != 1) {
  425. int k = super.mouseX;
  426. int j1 = super.mouseY;
  427. if(menuScreenArea == 0) {
  428. k -= 4;
  429. j1 -= 4;
  430. }
  431. if(menuScreenArea == 1) {
  432. k -= 519;
  433. j1 -= 168;
  434. }
  435. if(menuScreenArea == 2) {
  436. k -= 17;
  437. j1 -= 338;
  438. }
  439. if(menuScreenArea == 3) {
  440. k -= 519;
  441. j1 -= 0;
  442. }
  443. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  444. menuOpen = false;
  445. if(menuScreenArea == 1)
  446. needDrawTabArea = true;
  447. if(menuScreenArea == 2)
  448. inputTaken = true;
  449. }
  450. }
  451. if(j == 1) {
  452. int l = menuOffsetX;
  453. int k1 = menuOffsetY;
  454. int i2 = menuWidth;
  455. int k2 = super.saveClickX;
  456. int l2 = super.saveClickY;
  457. if(menuScreenArea == 0) {
  458. k2 -= 4;
  459. l2 -= 4;
  460. }
  461. if(menuScreenArea == 1) {
  462. k2 -= 519;
  463. l2 -= 168;
  464. }
  465. if(menuScreenArea == 2) {
  466. k2 -= 17;
  467. l2 -= 338;
  468. }
  469. if(menuScreenArea == 3) {
  470. k2 -= 519;
  471. l2 -= 0;
  472. }
  473. int i3 = -1;
  474. for(int j3 = 0; j3 < menuActionRow; j3++) {
  475. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  476. if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  477. i3 = j3;
  478. }
  479. System.out.println(i3);
  480. if(i3 != -1)
  481. doAction(i3);
  482. menuOpen = false;
  483. if(menuScreenArea == 1)
  484. needDrawTabArea = true;
  485. if(menuScreenArea == 2) {
  486. inputTaken = true;
  487. }
  488. }
  489. } else {
  490. if(j == 1 && menuActionRow > 0) {
  491. int i1 = menuActionID[menuActionRow - 1];
  492. if(i1 == 632 || i1 == 78 || i1 == 867 || i1 == 431 || i1 == 53 || i1 == 74 || i1 == 454 || i1 == 539 || i1 == 493 || i1 == 847 || i1 == 447 || i1 == 1125) {
  493. int l1 = menuActionCmd2[menuActionRow - 1];
  494. int j2 = menuActionCmd3[menuActionRow - 1];
  495. RSInterface class9 = RSInterface.interfaceCache[j2];
  496. if(class9.aBoolean259 || class9.aBoolean235) {
  497. aBoolean1242 = false;
  498. anInt989 = 0;
  499. anInt1084 = j2;
  500. anInt1085 = l1;
  501. activeInterfaceType = 2;
  502. anInt1087 = super.saveClickX;
  503. anInt1088 = super.saveClickY;
  504. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  505. activeInterfaceType = 1;
  506. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  507. activeInterfaceType = 3;
  508. return;
  509. }
  510. }
  511. }
  512. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  513. j = 2;
  514. if(j == 1 && menuActionRow > 0)
  515. doAction(menuActionRow - 1);
  516. if(j == 2 && menuActionRow > 0)
  517. determineMenuSize();
  518. }
  519. }
  520.  
  521.  
  522. public static int totalRead = 0;
  523.  
  524. public static String getFileNameWithoutExtension(String fileName) {
  525. File tmpFile = new File(fileName);
  526. tmpFile.getName();
  527. int whereDot = tmpFile.getName().lastIndexOf('.');
  528. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2 ) {
  529. return tmpFile.getName().substring(0, whereDot);
  530. }
  531. return "";
  532. }
  533.  
  534. public void preloadModels() {
  535. File file = new File("./Raw/");
  536. File[] fileArray = file.listFiles();
  537. for(int y = 0; y < fileArray.length; y++) {
  538. String s = fileArray[y].getName();
  539. byte[] buffer = ReadFile("./Raw/"+s);
  540. Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
  541. }
  542. }
  543.  
  544.  
  545.  
  546. private void saveMidi(boolean flag, byte abyte0[])
  547. {
  548. signlink.midifade = flag ? 1 : 0;
  549. signlink.midisave(abyte0, abyte0.length);
  550. }
  551.  
  552. private void method22()
  553. {
  554. try
  555. {
  556. anInt985 = -1;
  557. aClass19_1056.removeAll();
  558. aClass19_1013.removeAll();
  559. Texture.method366();
  560. unlinkMRUNodes();
  561. worldController.initToNull();
  562. System.gc();
  563. for(int i = 0; i < 4; i++)
  564. aClass11Array1230[i].method210();
  565.  
  566. for(int l = 0; l < 4; l++)
  567. {
  568. for(int k1 = 0; k1 < 104; k1++)
  569. {
  570. for(int j2 = 0; j2 < 104; j2++)
  571. byteGroundArray[l][k1][j2] = 0;
  572.  
  573. }
  574.  
  575. }
  576.  
  577. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  578. int k2 = aByteArrayArray1183.length;
  579. stream.createFrame(0);
  580. if(!aBoolean1159)
  581. {
  582. for(int i3 = 0; i3 < k2; i3++)
  583. {
  584. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  585. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  586. byte abyte0[] = aByteArrayArray1183[i3];
  587. if (FileOperations.FileExists(signlink.findcachedir()+"maps/"+anIntArray1235[i3]+".dat"))
  588. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"maps/"+anIntArray1235[i3]+".dat");
  589. if(abyte0 != null)
  590. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  591. }
  592.  
  593. for(int j4 = 0; j4 < k2; j4++)
  594. {
  595. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  596. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  597. byte abyte2[] = aByteArrayArray1183[j4];
  598. if(abyte2 == null && anInt1070 < 800)
  599. objectManager.method174(k7, 64, 64, l5);
  600. }
  601.  
  602. anInt1097++;
  603. if(anInt1097 > 160)
  604. {
  605. anInt1097 = 0;
  606. stream.createFrame(238);
  607. stream.writeWordBigEndian(96);
  608. }
  609. stream.createFrame(0);
  610. for(int i6 = 0; i6 < k2; i6++)
  611. {
  612. byte abyte1[] = aByteArrayArray1247[i6];
  613. if(abyte1 != null)
  614. {
  615. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  616. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  617. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  618. }
  619. }
  620.  
  621. }
  622. if(aBoolean1159)
  623. {
  624. for(int j3 = 0; j3 < 4; j3++)
  625. {
  626. for(int k4 = 0; k4 < 13; k4++)
  627. {
  628. for(int j6 = 0; j6 < 13; j6++)
  629. {
  630. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  631. if(l7 != -1)
  632. {
  633. int i9 = l7 >> 24 & 3;
  634. int l9 = l7 >> 1 & 3;
  635. int j10 = l7 >> 14 & 0x3ff;
  636. int l10 = l7 >> 3 & 0x7ff;
  637. int j11 = (j10 / 8 << 8) + l10 / 8;
  638. for(int l11 = 0; l11 < anIntArray1234.length; l11++)
  639. {
  640. if(anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  641. continue;
  642. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  643. break;
  644. }
  645.  
  646. }
  647. }
  648.  
  649. }
  650.  
  651. }
  652.  
  653. for(int l4 = 0; l4 < 13; l4++)
  654. {
  655. for(int k6 = 0; k6 < 13; k6++)
  656. {
  657. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  658. if(i8 == -1)
  659. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  660. }
  661.  
  662. }
  663.  
  664. stream.createFrame(0);
  665. for(int l6 = 0; l6 < 4; l6++)
  666. {
  667. for(int j8 = 0; j8 < 13; j8++)
  668. {
  669. for(int j9 = 0; j9 < 13; j9++)
  670. {
  671. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  672. if(i10 != -1)
  673. {
  674. int k10 = i10 >> 24 & 3;
  675. int i11 = i10 >> 1 & 3;
  676. int k11 = i10 >> 14 & 0x3ff;
  677. int i12 = i10 >> 3 & 0x7ff;
  678. int j12 = (k11 / 8 << 8) + i12 / 8;
  679. for(int k12 = 0; k12 < anIntArray1234.length; k12++)
  680. {
  681. if(anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  682. continue;
  683. //objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  684. byte abyte0[] = aByteArrayArray1247[k12];
  685. if (FileOperations.FileExists(signlink.findcachedir()+"maps/"+anIntArray1235[k12]+".dat"))
  686. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"maps/"+anIntArray1235[k12]+".dat");
  687. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  688. break;
  689. }
  690.  
  691. }
  692. }
  693.  
  694. }
  695.  
  696. }
  697.  
  698. }
  699. stream.createFrame(0);
  700. objectManager.method171(aClass11Array1230, worldController);
  701. aRSImageProducer_1165.initDrawingArea();
  702. stream.createFrame(0);
  703. int k3 = ObjectManager.anInt145;
  704. if(k3 > plane)
  705. k3 = plane;
  706. if(k3 < plane - 1)
  707. k3 = plane - 1;
  708. if(lowMem)
  709. worldController.method275(ObjectManager.anInt145);
  710. else
  711. worldController.method275(0);
  712. for(int i5 = 0; i5 < 104; i5++)
  713. {
  714. for(int i7 = 0; i7 < 104; i7++)
  715. spawnGroundItem(i5, i7);
  716.  
  717. }
  718.  
  719. anInt1051++;
  720. if(anInt1051 > 98)
  721. {
  722. anInt1051 = 0;
  723. stream.createFrame(150);
  724. }
  725. method63();
  726. }
  727. catch(Exception exception) { }
  728. ObjectDef.mruNodes1.unlinkAll();
  729. if(super.gameFrame != null)
  730. {
  731. stream.createFrame(210);
  732. stream.writeDWord(0x3f008edd);
  733. }
  734. if(lowMem && signlink.cache_dat != null)
  735. {
  736. int j = onDemandFetcher.getVersionCount(0);
  737. for(int i1 = 0; i1 < j; i1++)
  738. {
  739. int l1 = onDemandFetcher.getModelIndex(i1);
  740. if((l1 & 0x79) == 0)
  741. Model.method461(i1);
  742. }
  743.  
  744. }
  745. System.gc();
  746. Texture.method367();
  747. onDemandFetcher.method566();
  748. int k = (anInt1069 - 6) / 8 - 1;
  749. int j1 = (anInt1069 + 6) / 8 + 1;
  750. int i2 = (anInt1070 - 6) / 8 - 1;
  751. int l2 = (anInt1070 + 6) / 8 + 1;
  752. if(aBoolean1141)
  753. {
  754. k = 49;
  755. j1 = 50;
  756. i2 = 49;
  757. l2 = 50;
  758. }
  759. for(int l3 = k; l3 <= j1; l3++)
  760. {
  761. for(int j5 = i2; j5 <= l2; j5++)
  762. if(l3 == k || l3 == j1 || j5 == i2 || j5 == l2)
  763. {
  764. int j7 = onDemandFetcher.method562(0, j5, l3);
  765. if(j7 != -1)
  766. onDemandFetcher.method560(j7, 3);
  767. int k8 = onDemandFetcher.method562(1, j5, l3);
  768. if(k8 != -1)
  769. onDemandFetcher.method560(k8, 3);
  770. }
  771.  
  772. }
  773.  
  774. }
  775.  
  776. private void unlinkMRUNodes()
  777. {
  778. ObjectDef.mruNodes1.unlinkAll();
  779. ObjectDef.mruNodes2.unlinkAll();
  780. EntityDef.mruNodes.unlinkAll();
  781. ItemDef.mruNodes2.unlinkAll();
  782. ItemDef.mruNodes1.unlinkAll();
  783. Player.mruNodes.unlinkAll();
  784. SpotAnim.aMRUNodes_415.unlinkAll();
  785. }
  786.  
  787. private void method24(int i)
  788. {
  789. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  790. int j = ai.length;
  791. for(int k = 0; k < j; k++)
  792. ai[k] = 0;
  793.  
  794. for(int l = 1; l < 103; l++)
  795. {
  796. int i1 = 24628 + (103 - l) * 512 * 4;
  797. for(int k1 = 1; k1 < 103; k1++)
  798. {
  799. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  800. worldController.method309(ai, i1, i, k1, l);
  801. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  802. worldController.method309(ai, i1, i + 1, k1, l);
  803. i1 += 4;
  804. }
  805.  
  806. }
  807.  
  808. int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  809. int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  810. aClass30_Sub2_Sub1_Sub1_1263.method343();
  811. for(int i2 = 1; i2 < 103; i2++)
  812. {
  813. for(int j2 = 1; j2 < 103; j2++)
  814. {
  815. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  816. method50(i2, j1, j2, l1, i);
  817. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  818. method50(i2, j1, j2, l1, i + 1);
  819. }
  820.  
  821. }
  822.  
  823. aRSImageProducer_1165.initDrawingArea();
  824. anInt1071 = 0;
  825. for(int k2 = 0; k2 < 104; k2++)
  826. {
  827. for(int l2 = 0; l2 < 104; l2++)
  828. {
  829. int i3 = worldController.method303(plane, k2, l2);
  830. if(i3 != 0)
  831. {
  832. i3 = i3 >> 14 & 0x7fff;
  833. int j3 = ObjectDef.forID(i3).anInt746;
  834. if(j3 >= 0)
  835. {
  836. int k3 = k2;
  837. int l3 = l2; //dont move it
  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 = smallText.getTextWidth(results[0]) + 6;
  964. for(int i = 1; i < results.length; i++)
  965. if(width <= smallText.getTextWidth(results[i]) + 6)
  966. width = smallText.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. smallText.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. try {
  1624. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1625. if (spriteDrawX > -1) {
  1626. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  1627.  
  1628. if (i1 > 30) {
  1629. i1 = 30;
  1630. }
  1631. int HpPercent = (((Entity) (obj)).currentHealth * 56) / ((Entity) (obj)).maxHealth;
  1632.  
  1633. if (HpPercent > 56) {
  1634. HpPercent = 56;
  1635. }
  1636. if(!HPBarToggle){
  1637. DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  1638. DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  1639. } else {
  1640. HPBarEmpty.drawSprite(spriteDrawX - 28, spriteDrawY - 3);
  1641. HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/HITPOINTS_0.PNG", HpPercent, 7);
  1642. HPBarFull.drawSprite(spriteDrawX - 28, spriteDrawY - 3);
  1643. }
  1644. }
  1645. } catch (Exception e) {}
  1646. }
  1647. for(int j1 = 0; j1 < 4; j1++)
  1648. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  1649. {
  1650. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  1651. if(spriteDrawX > -1)
  1652. {
  1653. if(j1 == 1)
  1654. spriteDrawY -= 20;
  1655. if(j1 == 2)
  1656. {
  1657. spriteDrawX -= 15;
  1658. spriteDrawY -= 10;
  1659. }
  1660. if(j1 == 3)
  1661. {
  1662. spriteDrawX += 15;
  1663. spriteDrawY -= 10;
  1664. }
  1665. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  1666. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  1667. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  1668. }
  1669. }
  1670. }
  1671. for(int k = 0; k < anInt974; k++) {
  1672. int k1 = anIntArray976[k];
  1673. int l1 = anIntArray977[k];
  1674. int j2 = anIntArray979[k];
  1675. int k2 = anIntArray978[k];
  1676. boolean flag = true;
  1677. while(flag)
  1678. {
  1679. flag = false;
  1680. for(int l2 = 0; l2 < k; l2++)
  1681. 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)
  1682. {
  1683. l1 = anIntArray977[l2] - anIntArray978[l2];
  1684. flag = true;
  1685. }
  1686.  
  1687. }
  1688. spriteDrawX = anIntArray976[k];
  1689. spriteDrawY = anIntArray977[k] = l1;
  1690. String s = aStringArray983[k];
  1691. if(anInt1249 == 0)
  1692. {
  1693. int i3 = 0xffff00;
  1694. if(anIntArray980[k] < 6)
  1695. i3 = anIntArray965[anIntArray980[k]];
  1696. if(anIntArray980[k] == 6)
  1697. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  1698. if(anIntArray980[k] == 7)
  1699. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  1700. if(anIntArray980[k] == 8)
  1701. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  1702. if(anIntArray980[k] == 9) {
  1703. int j3 = 150 - anIntArray982[k];
  1704. if(j3 < 50)
  1705. i3 = 0xff0000 + 1280 * j3;
  1706. else
  1707. if(j3 < 100)
  1708. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  1709. else
  1710. if(j3 < 150)
  1711. i3 = 65280 + 5 * (j3 - 100);
  1712. }
  1713. if(anIntArray980[k] == 10) {
  1714. int k3 = 150 - anIntArray982[k];
  1715. if(k3 < 50)
  1716. i3 = 0xff0000 + 5 * k3;
  1717. else
  1718. if(k3 < 100)
  1719. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  1720. else
  1721. if(k3 < 150)
  1722. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  1723. }
  1724. if(anIntArray980[k] == 11) {
  1725. int l3 = 150 - anIntArray982[k];
  1726. if(l3 < 50)
  1727. i3 = 0xffffff - 0x50005 * l3;
  1728. else
  1729. if(l3 < 100)
  1730. i3 = 65280 + 0x50005 * (l3 - 50);
  1731. else
  1732. if(l3 < 150)
  1733. i3 = 0xffffff - 0x50000 * (l3 - 100);
  1734. }
  1735. if(anIntArray981[k] == 0) {
  1736. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1737. chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  1738. }
  1739. if(anIntArray981[k] == 1) {
  1740. chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  1741. chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  1742. }
  1743. if(anIntArray981[k] == 2) {
  1744. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  1745. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  1746. }
  1747. if(anIntArray981[k] == 3) {
  1748. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  1749. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  1750. }
  1751. if(anIntArray981[k] == 4) {
  1752. int i4 = chatTextDrawingArea.method384(s);
  1753. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  1754. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  1755. chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  1756. chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  1757. DrawingArea.defaultDrawingAreaSize();
  1758. }
  1759. if(anIntArray981[k] == 5) {
  1760. int j4 = 150 - anIntArray982[k];
  1761. int l4 = 0;
  1762. if(j4 < 25)
  1763. l4 = j4 - 25;
  1764. else
  1765. if(j4 > 125)
  1766. l4 = j4 - 125;
  1767. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  1768. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  1769. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  1770. DrawingArea.defaultDrawingAreaSize();
  1771. }
  1772. } else {
  1773. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1774. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  1775. }
  1776. }
  1777. } catch(Exception e){ }
  1778. }
  1779.  
  1780. private void delFriend(long l)
  1781. {
  1782. try
  1783. {
  1784. if(l == 0L)
  1785. return;
  1786. for(int i = 0; i < friendsCount; i++)
  1787. {
  1788. if(friendsListAsLongs[i] != l)
  1789. continue;
  1790. friendsCount--;
  1791. needDrawTabArea = true;
  1792. for(int j = i; j < friendsCount; j++)
  1793. {
  1794. friendsList[j] = friendsList[j + 1];
  1795. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  1796. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  1797. }
  1798.  
  1799. stream.createFrame(215);
  1800. stream.writeQWord(l);
  1801. break;
  1802. }
  1803. }
  1804. catch(RuntimeException runtimeexception)
  1805. {
  1806. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  1807. throw new RuntimeException();
  1808. }
  1809. }
  1810.  
  1811. public void drawSideIcons(){
  1812. /* Top sideIcons */
  1813. if(tabInterfaceIDs[0] != -1)//attack
  1814. sideIcons[0].drawSprite(10, 4);
  1815. if(tabInterfaceIDs[1] != -1)//stat
  1816. sideIcons[1].drawSprite(43, 4);
  1817. if(tabInterfaceIDs[2] != -1)//quest
  1818. sideIcons[2].drawSprite(76, 3);
  1819. if(tabInterfaceIDs[3] != -1)//inventory
  1820. sideIcons[3].drawSprite(111, 5);
  1821. if(tabInterfaceIDs[4] != -1)//equipment
  1822. sideIcons[4].drawSprite(140, 1);
  1823. if(tabInterfaceIDs[5] != -1)//prayer
  1824. sideIcons[5].drawSprite(174, 1);
  1825. if(tabInterfaceIDs[6] != -1)//magic
  1826. sideIcons[6].drawSprite(208, 4);
  1827. /* Bottom sideIcons */
  1828. if(tabInterfaceIDs[7] != -1)//clan
  1829. sideIcons[7].drawSprite(11, 303);
  1830. if(tabInterfaceIDs[8] != -1)//friends
  1831. sideIcons[8].drawSprite(46, 306);
  1832. if(tabInterfaceIDs[9] != -1)//ignore
  1833. sideIcons[9].drawSprite(79, 306);
  1834. if(tabInterfaceIDs[10] != -1)//options
  1835. sideIcons[10].drawSprite(113, 302);
  1836. if(tabInterfaceIDs[11] != -1)//options
  1837. sideIcons[11].drawSprite(145, 304);
  1838. if(tabInterfaceIDs[12] != -1)//emotes
  1839. sideIcons[12].drawSprite(181, 302);
  1840. if(tabInterfaceIDs[13] != -1)//music
  1841. sideIcons[13].drawSprite(213, 303);
  1842. }
  1843.  
  1844. public void drawRedStones() {
  1845. if(tabInterfaceIDs[tabID] != -1) {
  1846. switch(tabID) {
  1847. case 0:
  1848. redStones[0].drawSprite(3, 0);
  1849. break;
  1850. case 1:
  1851. redStones[4].drawSprite(41, 0);
  1852. break;
  1853. case 2:
  1854. redStones[4].drawSprite(74, 0);
  1855. break;
  1856. case 3:
  1857. redStones[4].drawSprite(107, 0);
  1858. break;
  1859. case 4:
  1860. redStones[4].drawSprite(140, 0);
  1861. break;
  1862. case 5:
  1863. redStones[4].drawSprite(173, 0);
  1864. break;
  1865. case 6:
  1866. redStones[1].drawSprite(206, 0);
  1867. break;
  1868. case 7:
  1869. redStones[2].drawSprite(3, 298);
  1870. break;
  1871. case 8:
  1872. redStones[4].drawSprite(41, 298);
  1873. break;
  1874. case 9:
  1875. redStones[4].drawSprite(74, 298);
  1876. break;
  1877. case 10:
  1878. redStones[4].drawSprite(107, 298);
  1879. break;
  1880. case 11:
  1881. redStones[4].drawSprite(140, 298);
  1882. break;
  1883. case 12:
  1884. redStones[4].drawSprite(173, 298);
  1885. break;
  1886. case 13:
  1887. redStones[3].drawSprite(206, 298);
  1888. break;
  1889. }
  1890. }
  1891. }
  1892.  
  1893. private void drawTabArea() {
  1894. aRSImageProducer_1163.initDrawingArea();
  1895. Texture.anIntArray1472 = anIntArray1181;
  1896. tabArea.drawSprite(0, 0);
  1897. if(invOverlayInterfaceID == -1) {
  1898. drawRedStones();
  1899. drawSideIcons();
  1900. }
  1901. if(invOverlayInterfaceID != -1)
  1902. drawInterface(0, 28, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  1903. else if(tabInterfaceIDs[tabID] != -1)
  1904. drawInterface(0, 28, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  1905. if(menuOpen && menuScreenArea == 1)
  1906. drawMenu();
  1907. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  1908. aRSImageProducer_1165.initDrawingArea();
  1909. Texture.anIntArray1472 = anIntArray1182;
  1910. }
  1911.  
  1912. private void method37(int j) {
  1913. if(!lowMem) {
  1914. if(Texture.anIntArray1480[17] >= j) {
  1915. Background background = Texture.aBackgroundArray1474s[17];
  1916. int k = background.anInt1452 * background.anInt1453 - 1;
  1917. //fire cape apparently?
  1918. int j1 = background.anInt1452 * anInt945 * 2;
  1919. byte abyte0[] = background.aByteArray1450;
  1920. byte abyte3[] = aByteArray912;
  1921. for(int i2 = 0; i2 <= k; i2++)
  1922. abyte3[i2] = abyte0[i2 - j1 & k];
  1923.  
  1924. background.aByteArray1450 = abyte3;
  1925. aByteArray912 = abyte0;
  1926. Texture.method370(17);
  1927. anInt854++;
  1928. if(anInt854 > 1235) {
  1929. anInt854 = 0;
  1930. stream.createFrame(226);
  1931. stream.writeWordBigEndian(0);
  1932. int l2 = stream.currentOffset;
  1933. stream.writeWord(58722);
  1934. stream.writeWordBigEndian(240);
  1935. stream.writeWord((int)(Math.random() * 65536D));
  1936. stream.writeWordBigEndian((int)(Math.random() * 256D));
  1937. if((int)(Math.random() * 2D) == 0)
  1938. stream.writeWord(51825);
  1939. stream.writeWordBigEndian((int)(Math.random() * 256D));
  1940. stream.writeWord((int)(Math.random() * 65536D));
  1941. stream.writeWord(7130);
  1942. stream.writeWord((int)(Math.random() * 65536D));
  1943. stream.writeWord(61657);
  1944. stream.writeBytes(stream.currentOffset - l2);
  1945. }
  1946. }
  1947. if(Texture.anIntArray1480[24] >= j) {
  1948. Background background_1 = Texture.aBackgroundArray1474s[24];
  1949. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  1950. int k1 = background_1.anInt1452 * anInt945 * 2;
  1951. byte abyte1[] = background_1.aByteArray1450;
  1952. byte abyte4[] = aByteArray912;
  1953. for(int j2 = 0; j2 <= l; j2++)
  1954. abyte4[j2] = abyte1[j2 - k1 & l];
  1955.  
  1956. background_1.aByteArray1450 = abyte4;
  1957. aByteArray912 = abyte1;
  1958. Texture.method370(24);
  1959. }
  1960. if(Texture.anIntArray1480[34] >= j) {
  1961. Background background_2 = Texture.aBackgroundArray1474s[34];
  1962. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  1963. int l1 = background_2.anInt1452 * anInt945 * 2;
  1964. byte abyte2[] = background_2.aByteArray1450;
  1965. byte abyte5[] = aByteArray912;
  1966. for(int k2 = 0; k2 <= i1; k2++)
  1967. abyte5[k2] = abyte2[k2 - l1 & i1];
  1968.  
  1969. background_2.aByteArray1450 = abyte5;
  1970. aByteArray912 = abyte2;
  1971. Texture.method370(34);
  1972. }
  1973. if(Texture.anIntArray1480[40] >= j)
  1974. {
  1975. Background background_2 = Texture.aBackgroundArray1474s[40];
  1976. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  1977. int l1 = background_2.anInt1452 * anInt945 * 2;
  1978. byte abyte2[] = background_2.aByteArray1450;
  1979. byte abyte5[] = aByteArray912;
  1980. for(int k2 = 0; k2 <= i1; k2++)
  1981. abyte5[k2] = abyte2[k2 - l1 & i1];
  1982.  
  1983. background_2.aByteArray1450 = abyte5;
  1984. aByteArray912 = abyte2;
  1985. Texture.method370(40);
  1986. }
  1987. }
  1988. }
  1989.  
  1990. private void method38() {
  1991. for(int i = -1; i < playerCount; i++) {
  1992. int j;
  1993. if(i == -1)
  1994. j = myPlayerIndex;
  1995. else
  1996. j = playerIndices[i];
  1997. Player player = playerArray[j];
  1998. if(player != null && player.textCycle > 0) {
  1999. player.textCycle--;
  2000. if(player.textCycle == 0)
  2001. player.textSpoken = null;
  2002. }
  2003. }
  2004. for(int k = 0; k < npcCount; k++) {
  2005. int l = npcIndices[k];
  2006. NPC npc = npcArray[l];
  2007. if(npc != null && npc.textCycle > 0) {
  2008. npc.textCycle--;
  2009. if(npc.textCycle == 0)
  2010. npc.textSpoken = null;
  2011. }
  2012. }
  2013. }
  2014.  
  2015. private void calcCameraPos() {
  2016. int i = anInt1098 * 128 + 64;
  2017. int j = anInt1099 * 128 + 64;
  2018. int k = method42(plane, j, i) - anInt1100;
  2019. if(xCameraPos < i) {
  2020. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2021. if(xCameraPos > i)
  2022. xCameraPos = i;
  2023. }
  2024. if(xCameraPos > i) {
  2025. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2026. if(xCameraPos < i)
  2027. xCameraPos = i;
  2028. }
  2029. if(zCameraPos < k) {
  2030. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2031. if(zCameraPos > k)
  2032. zCameraPos = k;
  2033. }
  2034. if(zCameraPos > k) {
  2035. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2036. if(zCameraPos < k)
  2037. zCameraPos = k;
  2038. }
  2039. if(yCameraPos < j) {
  2040. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2041. if(yCameraPos > j)
  2042. yCameraPos = j;
  2043. }
  2044. if(yCameraPos > j) {
  2045. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2046. if(yCameraPos < j)
  2047. yCameraPos = j;
  2048. }
  2049. i = anInt995 * 128 + 64;
  2050. j = anInt996 * 128 + 64;
  2051. k = method42(plane, j, i) - anInt997;
  2052. int l = i - xCameraPos;
  2053. int i1 = k - zCameraPos;
  2054. int j1 = j - yCameraPos;
  2055. int k1 = (int)Math.sqrt(l * l + j1 * j1);
  2056. int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2057. int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2058. if(l1 < 128)
  2059. l1 = 128;
  2060. if(l1 > 383)
  2061. l1 = 383;
  2062. if(yCameraCurve < l1) {
  2063. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2064. if(yCameraCurve > l1)
  2065. yCameraCurve = l1;
  2066. }
  2067. if(yCameraCurve > l1) {
  2068. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2069. if(yCameraCurve < l1)
  2070. yCameraCurve = l1;
  2071. }
  2072. int j2 = i2 - xCameraCurve;
  2073. if(j2 > 1024)
  2074. j2 -= 2048;
  2075. if(j2 < -1024)
  2076. j2 += 2048;
  2077. if(j2 > 0) {
  2078. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2079. xCameraCurve &= 0x7ff;
  2080. }
  2081. if(j2 < 0) {
  2082. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2083. xCameraCurve &= 0x7ff;
  2084. }
  2085. int k2 = i2 - xCameraCurve;
  2086. if(k2 > 1024)
  2087. k2 -= 2048;
  2088. if(k2 < -1024)
  2089. k2 += 2048;
  2090. if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2091. xCameraCurve = i2;
  2092. }
  2093.  
  2094. private void drawMenu() {
  2095. int i = menuOffsetX;
  2096. int j = menuOffsetY;
  2097. int k = menuWidth;
  2098. int l = menuHeight + 1;
  2099. int i1 = 0x5d5447;
  2100. //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  2101. //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  2102. DrawingArea.drawPixels(l, j, i, i1, k);
  2103. DrawingArea.drawPixels(16, j + 1, i + 1, 0, k - 2);
  2104. DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
  2105. chatTextDrawingArea.method385(i1, "Choose Option", j + 14, i + 3);
  2106. int j1 = super.mouseX;
  2107. int k1 = super.mouseY;
  2108. if(menuScreenArea == 0) {
  2109. j1 -= 4;
  2110. k1 -= 4;
  2111. }
  2112. if(menuScreenArea == 1) {
  2113. j1 -= 519;
  2114. k1 -= 168;
  2115. }
  2116. if(menuScreenArea == 2) {
  2117. j1 -= 17;
  2118. k1 -= 338;
  2119. }
  2120. if(menuScreenArea == 3) {
  2121. j1 -= 519;
  2122. k1 -= 0;
  2123. }
  2124. for(int l1 = 0; l1 < menuActionRow; l1++) {
  2125. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2126. int j2 = 0xffffff;
  2127. if(j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  2128. j2 = 0xffff00;
  2129. chatTextDrawingArea.method389(true, i + 3, j2, menuActionName[l1], i2);
  2130. }
  2131. }
  2132.  
  2133. private void addFriend(long l) {
  2134. try {
  2135. if(l == 0L)
  2136. return;
  2137. if(friendsCount >= 100 && anInt1046 != 1) {
  2138. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2139. return;
  2140. }
  2141. if(friendsCount >= 200) {
  2142. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2143. return;
  2144. }
  2145. String s = TextClass.fixName(TextClass.nameForLong(l));
  2146. for(int i = 0; i < friendsCount; i++)
  2147. if(friendsListAsLongs[i] == l) {
  2148. pushMessage(s + " is already on your friend list", 0, "");
  2149. return;
  2150. }
  2151. for(int j = 0; j < ignoreCount; j++)
  2152. if(ignoreListAsLongs[j] == l) {
  2153. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  2154. return;
  2155. }
  2156.  
  2157. if(s.equals(myPlayer.name)) {
  2158. return;
  2159. } else {
  2160. friendsList[friendsCount] = s;
  2161. friendsListAsLongs[friendsCount] = l;
  2162. friendsNodeIDs[friendsCount] = 0;
  2163. friendsCount++;
  2164. needDrawTabArea = true;
  2165. stream.createFrame(188);
  2166. stream.writeQWord(l);
  2167. return;
  2168. }
  2169. } catch(RuntimeException runtimeexception) {
  2170. signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
  2171. }
  2172. throw new RuntimeException();
  2173. }
  2174.  
  2175. private int method42(int i, int j, int k) {
  2176. int l = k >> 7;
  2177. int i1 = j >> 7;
  2178. if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2179. return 0;
  2180. int j1 = i;
  2181. if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2182. j1++;
  2183. int k1 = k & 0x7f;
  2184. int l1 = j & 0x7f;
  2185. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2186. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2187. return i2 * (128 - l1) + j2 * l1 >> 7;
  2188. }
  2189.  
  2190. private static String intToKOrMil(int j) {
  2191. if(j < 0x186a0)
  2192. return String.valueOf(j);
  2193. if(j < 0x989680)
  2194. return j / 1000 + "K";
  2195. else
  2196. return j / 0xf4240 + "M";
  2197. }
  2198.  
  2199. private void resetLogout() {
  2200. alertHandler.alert = null;
  2201. try {
  2202. if(socketStream != null)
  2203. socketStream.close();
  2204. }
  2205. catch(Exception _ex) { }
  2206. socketStream = null;
  2207. loggedIn = false;
  2208. loginScreenState = 0;
  2209. // myUsername = "";
  2210. // myPassword = "";
  2211. unlinkMRUNodes();
  2212. worldController.initToNull();
  2213. for(int i = 0; i < 4; i++)
  2214. aClass11Array1230[i].method210();
  2215. System.gc();
  2216. stopMidi();
  2217. currentSong = -1;
  2218. nextSong = -1;
  2219. prevSong = 0;
  2220. }
  2221.  
  2222. private void method45() {
  2223. aBoolean1031 = true;
  2224. for(int j = 0; j < 7; j++) {
  2225. anIntArray1065[j] = -1;
  2226. for(int k = 0; k < IDK.length; k++) {
  2227. if(IDK.cache[k].aBoolean662 || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2228. continue;
  2229. anIntArray1065[j] = k;
  2230. break;
  2231. }
  2232. }
  2233. }
  2234.  
  2235. private void method46(int i, Stream stream) {
  2236. while(stream.bitPosition + 21 < i * 8) {
  2237. int k = stream.readBits(14);
  2238. if(k == 16383)
  2239. break;
  2240. if(npcArray[k] == null)
  2241. npcArray[k] = new NPC();
  2242. NPC npc = npcArray[k];
  2243. npcIndices[npcCount++] = k;
  2244. npc.anInt1537 = loopCycle;
  2245. int l = stream.readBits(5);
  2246. if(l > 15)
  2247. l -= 32;
  2248. int i1 = stream.readBits(5);
  2249. if(i1 > 15)
  2250. i1 -= 32;
  2251. int j1 = stream.readBits(1);
  2252. npc.desc = EntityDef.forID(stream.readBits(14));
  2253. int k1 = stream.readBits(1);
  2254. if(k1 == 1)
  2255. anIntArray894[anInt893++] = k;
  2256. npc.anInt1540 = npc.desc.aByte68;
  2257. npc.anInt1504 = npc.desc.anInt79;
  2258. npc.anInt1554 = npc.desc.walkAnim;
  2259. npc.anInt1555 = npc.desc.anInt58;
  2260. npc.anInt1556 = npc.desc.anInt83;
  2261. npc.anInt1557 = npc.desc.anInt55;
  2262. npc.anInt1511 = npc.desc.standAnim;
  2263. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2264. }
  2265. stream.finishBitAccess();
  2266. }
  2267.  
  2268. public void processGameLoop() {
  2269. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  2270. return;
  2271. loopCycle++;
  2272. if(!loggedIn)
  2273. processLoginScreenInput();
  2274. else
  2275. mainGameProcessor();
  2276. processOnDemandQueue();
  2277. }
  2278.  
  2279. private void method47(boolean flag) {
  2280. if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2281. destX = 0;
  2282. int j = playerCount;
  2283. if(flag)
  2284. j = 1;
  2285. for(int l = 0; l < j; l++) {
  2286. Player player;
  2287. int i1;
  2288. if(flag) {
  2289. player = myPlayer;
  2290. i1 = myPlayerIndex << 14;
  2291. } else {
  2292. player = playerArray[playerIndices[l]];
  2293. i1 = playerIndices[l] << 14;
  2294. }
  2295. if(player == null || !player.isVisible())
  2296. continue;
  2297. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  2298. int j1 = player.x >> 7;
  2299. int k1 = player.y >> 7;
  2300. if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2301. continue;
  2302. if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  2303. player.aBoolean1699 = false;
  2304. player.anInt1709 = method42(plane, player.y, player.x);
  2305. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  2306. continue;
  2307. }
  2308. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2309. if(anIntArrayArray929[j1][k1] == anInt1265)
  2310. continue;
  2311. anIntArrayArray929[j1][k1] = anInt1265;
  2312. }
  2313. player.anInt1709 = method42(plane, player.y, player.x);
  2314. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  2315. }
  2316. }
  2317.  
  2318. private boolean promptUserForInput(RSInterface class9) {
  2319. int j = class9.contentType;
  2320. if(anInt900 == 2) {
  2321. if(j == 201) {
  2322. inputTaken = true;
  2323. inputDialogState = 0;
  2324. messagePromptRaised = true;
  2325. promptInput = "";
  2326. friendsListAction = 1;
  2327. aString1121 = "Enter name of friend to add to list";
  2328. }
  2329. if(j == 202) {
  2330. inputTaken = true;
  2331. inputDialogState = 0;
  2332. messagePromptRaised = true;
  2333. promptInput = "";
  2334. friendsListAction = 2;
  2335. aString1121 = "Enter name of friend to delete from list";
  2336. }
  2337. }
  2338. if(j == 205) {
  2339. anInt1011 = 250;
  2340. return true;
  2341. }
  2342. if(j == 501) {
  2343. inputTaken = true;
  2344. inputDialogState = 0;
  2345. messagePromptRaised = true;
  2346. promptInput = "";
  2347. friendsListAction = 4;
  2348. aString1121 = "Enter name of player to add to list";
  2349. }
  2350. if(j == 502) {
  2351. inputTaken = true;
  2352. inputDialogState = 0;
  2353. messagePromptRaised = true;
  2354. promptInput = "";
  2355. friendsListAction = 5;
  2356. aString1121 = "Enter name of player to delete from list";
  2357. }
  2358. if(j == 550) {
  2359. inputTaken = true;
  2360. inputDialogState = 0;
  2361. messagePromptRaised = true;
  2362. promptInput = "";
  2363. friendsListAction = 6;
  2364. aString1121 = "Enter the name of the chat you wish to join";
  2365. }
  2366. if(j >= 300 && j <= 313) {
  2367. int k = (j - 300) / 2;
  2368. int j1 = j & 1;
  2369. int i2 = anIntArray1065[k];
  2370. if(i2 != -1) {
  2371. do {
  2372. if(j1 == 0 && --i2 < 0)
  2373. i2 = IDK.length - 1;
  2374. if(j1 == 1 && ++i2 >= IDK.length)
  2375. i2 = 0;
  2376. } while(IDK.cache[i2].aBoolean662 || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2377. anIntArray1065[k] = i2;
  2378. aBoolean1031 = true;
  2379. }
  2380. }
  2381. if(j >= 314 && j <= 323) {
  2382. int l = (j - 314) / 2;
  2383. int k1 = j & 1;
  2384. int j2 = anIntArray990[l];
  2385. if(k1 == 0 && --j2 < 0)
  2386. j2 = anIntArrayArray1003[l].length - 1;
  2387. if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2388. j2 = 0;
  2389. anIntArray990[l] = j2;
  2390. aBoolean1031 = true;
  2391. }
  2392. if(j == 324 && !aBoolean1047) {
  2393. aBoolean1047 = true;
  2394. method45();
  2395. }
  2396. if(j == 325 && aBoolean1047) {
  2397. aBoolean1047 = false;
  2398. method45();
  2399. }
  2400. if(j == 326) {
  2401. stream.createFrame(101);
  2402. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2403. for(int i1 = 0; i1 < 7; i1++)
  2404. stream.writeWordBigEndian(anIntArray1065[i1]);
  2405.  
  2406. for(int l1 = 0; l1 < 5; l1++)
  2407. stream.writeWordBigEndian(anIntArray990[l1]);
  2408.  
  2409. return true;
  2410. }
  2411. if(j == 613)
  2412. canMute = !canMute;
  2413. if(j >= 601 && j <= 612) {
  2414. clearTopInterfaces();
  2415. if(reportAbuseInput.length() > 0) {
  2416. stream.createFrame(218);
  2417. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2418. stream.writeWordBigEndian(j - 601);
  2419. stream.writeWordBigEndian(canMute ? 1 : 0);
  2420. }
  2421. }
  2422. return false;
  2423. }
  2424.  
  2425. private void method49(Stream stream) {
  2426. for(int j = 0; j < anInt893; j++) {
  2427. int k = anIntArray894[j];
  2428. Player player = playerArray[k];
  2429. int l = stream.readUnsignedByte();
  2430. if((l & 0x40) != 0)
  2431. l += stream.readUnsignedByte() << 8;
  2432. method107(l, k, stream, player);
  2433. }
  2434. }
  2435.  
  2436. private void method50(int i, int k, int l, int i1, int j1) {
  2437. int k1 = worldController.method300(j1, l, i);
  2438. if(k1 != 0) {
  2439. int l1 = worldController.method304(j1, l, i, k1);
  2440. int k2 = l1 >> 6 & 3;
  2441. int i3 = l1 & 0x1f;
  2442. int k3 = k;
  2443. if(k1 > 0)
  2444. k3 = i1;
  2445. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2446. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2447. int i5 = k1 >> 14 & 0x7fff;
  2448. ObjectDef class46_2 = ObjectDef.forID(i5);
  2449. if(class46_2.anInt758 != -1) {
  2450. Background background_2 = mapScenes[class46_2.anInt758];
  2451. if(background_2 != null) {
  2452. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  2453. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  2454. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  2455. }
  2456. } else {
  2457. if(i3 == 0 || i3 == 2)
  2458. if(k2 == 0) {
  2459. ai[k4] = k3;
  2460. ai[k4 + 512] = k3;
  2461. ai[k4 + 1024] = k3;
  2462. ai[k4 + 1536] = k3;
  2463. } else if(k2 == 1) {
  2464. ai[k4] = k3;
  2465. ai[k4 + 1] = k3;
  2466. ai[k4 + 2] = k3;
  2467. ai[k4 + 3] = k3;
  2468. } else if(k2 == 2) {
  2469. ai[k4 + 3] = k3;
  2470. ai[k4 + 3 + 512] = k3;
  2471. ai[k4 + 3 + 1024] = k3;
  2472. ai[k4 + 3 + 1536] = k3;
  2473. } else if(k2 == 3) {
  2474. ai[k4 + 1536] = k3;
  2475. ai[k4 + 1536 + 1] = k3;
  2476. ai[k4 + 1536 + 2] = k3;
  2477. ai[k4 + 1536 + 3] = k3;
  2478. }
  2479. if(i3 == 3)
  2480. if(k2 == 0)
  2481. ai[k4] = k3;
  2482. else if(k2 == 1)
  2483. ai[k4 + 3] = k3;
  2484. else if(k2 == 2)
  2485. ai[k4 + 3 + 1536] = k3;
  2486. else if(k2 == 3)
  2487. ai[k4 + 1536] = k3;
  2488. if(i3 == 2)
  2489. if(k2 == 3) {
  2490. ai[k4] = k3;
  2491. ai[k4 + 512] = k3;
  2492. ai[k4 + 1024] = k3;
  2493. ai[k4 + 1536] = k3;
  2494. } else if(k2 == 0) {
  2495. ai[k4] = k3;
  2496. ai[k4 + 1] = k3;
  2497. ai[k4 + 2] = k3;
  2498. ai[k4 + 3] = k3;
  2499. } else if(k2 == 1) {
  2500. ai[k4 + 3] = k3;
  2501. ai[k4 + 3 + 512] = k3;
  2502. ai[k4 + 3 + 1024] = k3;
  2503. ai[k4 + 3 + 1536] = k3;
  2504. } else if(k2 == 2) {
  2505. ai[k4 + 1536] = k3;
  2506. ai[k4 + 1536 + 1] = k3;
  2507. ai[k4 + 1536 + 2] = k3;
  2508. ai[k4 + 1536 + 3] = k3;
  2509. }
  2510. }
  2511. }
  2512. k1 = worldController.method302(j1, l, i);
  2513. if(k1 != 0) {
  2514. int i2 = worldController.method304(j1, l, i, k1);
  2515. int l2 = i2 >> 6 & 3;
  2516. int j3 = i2 & 0x1f;
  2517. int l3 = k1 >> 14 & 0x7fff;
  2518. ObjectDef class46_1 = ObjectDef.forID(l3);
  2519. if(class46_1.anInt758 != -1) {
  2520. Background background_1 = mapScenes[class46_1.anInt758];
  2521. if(background_1 != null) {
  2522. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  2523. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  2524. background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  2525. }
  2526. } else if(j3 == 9) {
  2527. int l4 = 0xeeeeee;
  2528. if(k1 > 0)
  2529. l4 = 0xee0000;
  2530. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2531. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2532. if(l2 == 0 || l2 == 2) {
  2533. ai1[l5 + 1536] = l4;
  2534. ai1[l5 + 1024 + 1] = l4;
  2535. ai1[l5 + 512 + 2] = l4;
  2536. ai1[l5 + 3] = l4;
  2537. } else {
  2538. ai1[l5] = l4;
  2539. ai1[l5 + 512 + 1] = l4;
  2540. ai1[l5 + 1024 + 2] = l4;
  2541. ai1[l5 + 1536 + 3] = l4;
  2542. }
  2543. }
  2544. }
  2545. k1 = worldController.method303(j1, l, i);
  2546. if(k1 != 0) {
  2547. int j2 = k1 >> 14 & 0x7fff;
  2548. ObjectDef class46 = ObjectDef.forID(j2);
  2549. if(class46.anInt758 != -1) {
  2550. Background background = mapScenes[class46.anInt758];
  2551. if(background != null) {
  2552. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  2553. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  2554. background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  2555. }
  2556. }
  2557. }
  2558. }
  2559.  
  2560. private void loadTitleScreen() {
  2561. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  2562. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  2563. aBackgroundArray1152s = new Background[12];
  2564. int j = 0;
  2565. try {
  2566. j = Integer.parseInt(getParameter("fl_icon"));
  2567. } catch(Exception _ex) {
  2568. }
  2569. if(j == 0) {
  2570. for(int k = 0; k < 12; k++)
  2571. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  2572.  
  2573. } else {
  2574. for(int l = 0; l < 12; l++)
  2575. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  2576.  
  2577. }
  2578. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  2579. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  2580. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  2581.  
  2582. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  2583.  
  2584. anIntArray851 = new int[256];
  2585. for(int k1 = 0; k1 < 64; k1++)
  2586. anIntArray851[k1] = k1 * 0x40000;
  2587.  
  2588. for(int l1 = 0; l1 < 64; l1++)
  2589. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  2590.  
  2591. for(int i2 = 0; i2 < 64; i2++)
  2592. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  2593.  
  2594. for(int j2 = 0; j2 < 64; j2++)
  2595. anIntArray851[j2 + 192] = 0xffffff;
  2596.  
  2597. anIntArray852 = new int[256];
  2598. for(int k2 = 0; k2 < 64; k2++)
  2599. anIntArray852[k2] = k2 * 1024;
  2600.  
  2601. for(int l2 = 0; l2 < 64; l2++)
  2602. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  2603.  
  2604. for(int i3 = 0; i3 < 64; i3++)
  2605. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  2606.  
  2607. for(int j3 = 0; j3 < 64; j3++)
  2608. anIntArray852[j3 + 192] = 0xffffff;
  2609.  
  2610. anIntArray853 = new int[256];
  2611. for(int k3 = 0; k3 < 64; k3++)
  2612. anIntArray853[k3] = k3 * 4;
  2613.  
  2614. for(int l3 = 0; l3 < 64; l3++)
  2615. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  2616.  
  2617. for(int i4 = 0; i4 < 64; i4++)
  2618. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  2619.  
  2620. for(int j4 = 0; j4 < 64; j4++)
  2621. anIntArray853[j4 + 192] = 0xffffff;
  2622.  
  2623. anIntArray850 = new int[256];
  2624. anIntArray1190 = new int[32768];
  2625. anIntArray1191 = new int[32768];
  2626. randomizeBackground(null);
  2627. anIntArray828 = new int[32768];
  2628. anIntArray829 = new int[32768];
  2629. drawLoadingText(10, "Connecting to fileserver");
  2630. if(!aBoolean831) {
  2631. drawFlames = true;
  2632. aBoolean831 = true;
  2633. startRunnable(this, 2);
  2634. }
  2635. }
  2636.  
  2637. private static void setHighMem() {
  2638. WorldController.lowMem = false;
  2639. Texture.lowMem = false;
  2640. lowMem = false;
  2641. ObjectManager.lowMem = false;
  2642. ObjectDef.lowMem = false;
  2643. }
  2644.  
  2645. public static void main(String args[]) {
  2646. try {
  2647. System.out.println("Diversity");
  2648. if(args.length != 5) {
  2649. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2650. return;
  2651. }
  2652. nodeID = Integer.parseInt(args[0]);
  2653. //portOff = Integer.parseInt(args[1]);
  2654. portOff = 0;
  2655. if(args[2].equals("lowmem"))
  2656. setLowMem();
  2657. else if(args[2].equals("highmem")) {
  2658. setHighMem();
  2659. } else {
  2660. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2661. return;
  2662. }
  2663. if(args[3].equals("free"))
  2664. isMembers = false;
  2665. else if(args[3].equals("members")) {
  2666. isMembers = true;
  2667. } else {
  2668. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2669. return;
  2670. }
  2671. signlink.storeid = Integer.parseInt(args[4]);
  2672. signlink.startpriv(InetAddress.getLocalHost());
  2673. new Jframe(args);
  2674. //client client1 = new client();
  2675. //client1.createClientFrame(503, 765);
  2676. } catch(Exception exception) {
  2677. }
  2678. }
  2679.  
  2680. private void loadingStages() {
  2681. if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  2682. aRSImageProducer_1165.initDrawingArea();
  2683. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  2684. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  2685. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  2686. loadingStage = 1;
  2687. aLong824 = System.currentTimeMillis();
  2688. }
  2689. if(loadingStage == 1) {
  2690. int j = method54();
  2691. if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  2692. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  2693. aLong824 = System.currentTimeMillis();
  2694. }
  2695. }
  2696. if(loadingStage == 2 && plane != anInt985) {
  2697. anInt985 = plane;
  2698. method24(plane);
  2699. }
  2700. }
  2701.  
  2702. private int method54() {
  2703. for(int i = 0; i < aByteArrayArray1183.length; i++) {
  2704. if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  2705. return -1;
  2706. if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  2707. return -2;
  2708. }
  2709. boolean flag = true;
  2710. for(int j = 0; j < aByteArrayArray1183.length; j++) {
  2711. byte abyte0[] = aByteArrayArray1247[j];
  2712. if(abyte0 != null) {
  2713. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  2714. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  2715. if(aBoolean1159) {
  2716. k = 10;
  2717. l = 10;
  2718. }
  2719. flag &= ObjectManager.method189(k, abyte0, l);
  2720. }
  2721. }
  2722. if(!flag)
  2723. return -3;
  2724. if(aBoolean1080) {
  2725. return -4;
  2726. } else {
  2727. loadingStage = 2;
  2728. ObjectManager.anInt131 = plane;
  2729. method22();
  2730. stream.createFrame(121);
  2731. return 0;
  2732. }
  2733. }
  2734.  
  2735. private void method55()
  2736. {
  2737. 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())
  2738. if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  2739. class30_sub2_sub4_sub4.unlink();
  2740. else
  2741. if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  2742. {
  2743. if(class30_sub2_sub4_sub4.anInt1590 > 0)
  2744. {
  2745. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  2746. if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  2747. 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);
  2748. }
  2749. if(class30_sub2_sub4_sub4.anInt1590 < 0)
  2750. {
  2751. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  2752. Player player;
  2753. if(j == unknownInt10)
  2754. player = myPlayer;
  2755. else
  2756. player = playerArray[j];
  2757. if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  2758. 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);
  2759. }
  2760. class30_sub2_sub4_sub4.method456(anInt945);
  2761. 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);
  2762. }
  2763.  
  2764. }
  2765.  
  2766. public AppletContext getAppletContext()
  2767. {
  2768. if(signlink.mainapp != null)
  2769. return signlink.mainapp.getAppletContext();
  2770. else
  2771. return super.getAppletContext();
  2772. }
  2773.  
  2774. private void drawLogo() {
  2775. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  2776. Sprite sprite = new Sprite(abyte0, this);
  2777. aRSImageProducer_1110.initDrawingArea();
  2778. sprite.method346(0, 0);
  2779. aRSImageProducer_1111.initDrawingArea();
  2780. sprite.method346(-637, 0);
  2781. aRSImageProducer_1107.initDrawingArea();
  2782. sprite.method346(-128, 0);
  2783. aRSImageProducer_1108.initDrawingArea();
  2784. sprite.method346(-202, -371);
  2785. aRSImageProducer_1109.initDrawingArea();
  2786. sprite.method346(-202, -171);
  2787. aRSImageProducer_1112.initDrawingArea();
  2788. sprite.method346(0, -265);
  2789. aRSImageProducer_1113.initDrawingArea();
  2790. sprite.method346(-562, -265);
  2791. aRSImageProducer_1114.initDrawingArea();
  2792. sprite.method346(-128, -171);
  2793. aRSImageProducer_1115.initDrawingArea();
  2794. sprite.method346(-562, -171);
  2795. int ai[] = new int[sprite.myWidth];
  2796. for(int j = 0; j < sprite.myHeight; j++) {
  2797. for(int k = 0; k < sprite.myWidth; k++)
  2798. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  2799.  
  2800. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  2801. }/*
  2802. aRSImageProducer_1110.initDrawingArea();
  2803. sprite.method346(382, 0);
  2804. aRSImageProducer_1111.initDrawingArea();
  2805. sprite.method346(-255, 0);
  2806. aRSImageProducer_1107.initDrawingArea();
  2807. sprite.method346(254, 0);
  2808. aRSImageProducer_1108.initDrawingArea();
  2809. sprite.method346(180, -371);
  2810. aRSImageProducer_1109.initDrawingArea();
  2811. sprite.method346(180, -171);
  2812. aRSImageProducer_1112.initDrawingArea();
  2813. sprite.method346(382, -265);
  2814. aRSImageProducer_1113.initDrawingArea();
  2815. sprite.method346(-180, -265);
  2816. aRSImageProducer_1114.initDrawingArea();
  2817. sprite.method346(254, -171);
  2818. aRSImageProducer_1115.initDrawingArea();
  2819. sprite.method346(-180, -171);
  2820. sprite = new Sprite(titleStreamLoader, "logo", 0);
  2821. aRSImageProducer_1107.initDrawingArea();
  2822. sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  2823. sprite = null;
  2824. Object obj = null;
  2825. Object obj1 = null;
  2826. System.gc();*/
  2827. }
  2828.  
  2829. private void processOnDemandQueue()
  2830. {
  2831. do
  2832. {
  2833. OnDemandData onDemandData;
  2834. do
  2835. {
  2836. onDemandData = onDemandFetcher.getNextNode();
  2837. if(onDemandData == null)
  2838. return;
  2839. if(onDemandData.dataType == 0)
  2840. {
  2841. Model.method460(onDemandData.buffer, onDemandData.ID);
  2842. if((onDemandFetcher.getModelIndex(onDemandData.ID) & 0x62) != 0)
  2843. {
  2844. needDrawTabArea = true;
  2845. if(backDialogID != -1)
  2846. inputTaken = true;
  2847. }
  2848. }
  2849. if(onDemandData.dataType == 1 && onDemandData.buffer != null)
  2850. Class36.method529(onDemandData.buffer);
  2851. if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  2852. saveMidi(songChanging, onDemandData.buffer);
  2853. if(onDemandData.dataType == 3 && loadingStage == 1)
  2854. {
  2855. for(int i = 0; i < aByteArrayArray1183.length; i++)
  2856. {
  2857. if(anIntArray1235[i] == onDemandData.ID)
  2858. {
  2859. aByteArrayArray1183[i] = onDemandData.buffer;
  2860. if(onDemandData.buffer == null)
  2861. anIntArray1235[i] = -1;
  2862. break;
  2863. }
  2864. if(anIntArray1236[i] != onDemandData.ID)
  2865. continue;
  2866. aByteArrayArray1247[i] = onDemandData.buffer;
  2867. if(onDemandData.buffer == null)
  2868. anIntArray1236[i] = -1;
  2869. break;
  2870. }
  2871.  
  2872. }
  2873. } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  2874. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  2875. } while(true);
  2876. }
  2877.  
  2878. private void calcFlamesPosition()
  2879. {
  2880. char c = '\u0100';
  2881. for(int j = 10; j < 117; j++)
  2882. {
  2883. int k = (int)(Math.random() * 100D);
  2884. if(k < 50)
  2885. anIntArray828[j + (c - 2 << 7)] = 255;
  2886. }
  2887. for(int l = 0; l < 100; l++)
  2888. {
  2889. int i1 = (int)(Math.random() * 124D) + 2;
  2890. int k1 = (int)(Math.random() * 128D) + 128;
  2891. int k2 = i1 + (k1 << 7);
  2892. anIntArray828[k2] = 192;
  2893. }
  2894.  
  2895. for(int j1 = 1; j1 < c - 1; j1++)
  2896. {
  2897. for(int l1 = 1; l1 < 127; l1++)
  2898. {
  2899. int l2 = l1 + (j1 << 7);
  2900. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  2901. }
  2902.  
  2903. }
  2904.  
  2905. anInt1275 += 128;
  2906. if(anInt1275 > anIntArray1190.length)
  2907. {
  2908. anInt1275 -= anIntArray1190.length;
  2909. int i2 = (int)(Math.random() * 12D);
  2910. randomizeBackground(aBackgroundArray1152s[i2]);
  2911. }
  2912. for(int j2 = 1; j2 < c - 1; j2++)
  2913. {
  2914. for(int i3 = 1; i3 < 127; i3++)
  2915. {
  2916. int k3 = i3 + (j2 << 7);
  2917. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  2918. if(i4 < 0)
  2919. i4 = 0;
  2920. anIntArray828[k3] = i4;
  2921. }
  2922.  
  2923. }
  2924.  
  2925. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  2926.  
  2927. anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
  2928. if(anInt1040 > 0)
  2929. anInt1040 -= 4;
  2930. if(anInt1041 > 0)
  2931. anInt1041 -= 4;
  2932. if(anInt1040 == 0 && anInt1041 == 0)
  2933. {
  2934. int l3 = (int)(Math.random() * 2000D);
  2935. if(l3 == 0)
  2936. anInt1040 = 1024;
  2937. if(l3 == 1)
  2938. anInt1041 = 1024;
  2939. }
  2940. }
  2941.  
  2942. private boolean saveWave(byte abyte0[], int i)
  2943. {
  2944. return abyte0 == null || signlink.wavesave(abyte0, i);
  2945. }
  2946.  
  2947. private void method60(int i)
  2948. {
  2949. RSInterface class9 = RSInterface.interfaceCache[i];
  2950. for(int j = 0; j < class9.children.length; j++)
  2951. {
  2952. if(class9.children[j] == -1)
  2953. break;
  2954. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  2955. if(class9_1.type == 1)
  2956. method60(class9_1.id);
  2957. class9_1.anInt246 = 0;
  2958. class9_1.anInt208 = 0;
  2959. }
  2960. }
  2961.  
  2962. private void drawHeadIcon()
  2963. {
  2964. if(anInt855 != 2)
  2965. return;
  2966. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  2967. if(spriteDrawX > -1 && loopCycle % 20 < 10)
  2968. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  2969. }
  2970.  
  2971. private void mainGameProcessor()
  2972. {
  2973. if(anInt1104 > 1)
  2974. anInt1104--;
  2975. if(anInt1011 > 0)
  2976. anInt1011--;
  2977. for(int j = 0; j < 5; j++)
  2978. if(!parsePacket())
  2979. break;
  2980.  
  2981. if(!loggedIn)
  2982. return;
  2983. synchronized(mouseDetection.syncObject)
  2984. {
  2985. if(flagged)
  2986. {
  2987. if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
  2988. {
  2989. stream.createFrame(45);
  2990. stream.writeWordBigEndian(0);
  2991. int j2 = stream.currentOffset;
  2992. int j3 = 0;
  2993. for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
  2994. {
  2995. if(j2 - stream.currentOffset >= 240)
  2996. break;
  2997. j3++;
  2998. int l4 = mouseDetection.coordsY[j4];
  2999. if(l4 < 0)
  3000. l4 = 0;
  3001. else
  3002. if(l4 > 502)
  3003. l4 = 502;
  3004. int k5 = mouseDetection.coordsX[j4];
  3005. if(k5 < 0)
  3006. k5 = 0;
  3007. else
  3008. if(k5 > 764)
  3009. k5 = 764;
  3010. int i6 = l4 * 765 + k5;
  3011. if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  3012. {
  3013. k5 = -1;
  3014. l4 = -1;
  3015. i6 = 0x7ffff;
  3016. }
  3017. if(k5 == anInt1237 && l4 == anInt1238)
  3018. {
  3019. if(anInt1022 < 2047)
  3020. anInt1022++;
  3021. } else
  3022. {
  3023. int j6 = k5 - anInt1237;
  3024. anInt1237 = k5;
  3025. int k6 = l4 - anInt1238;
  3026. anInt1238 = l4;
  3027. if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  3028. {
  3029. j6 += 32;
  3030. k6 += 32;
  3031. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  3032. anInt1022 = 0;
  3033. } else
  3034. if(anInt1022 < 8)
  3035. {
  3036. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  3037. anInt1022 = 0;
  3038. } else
  3039. {
  3040. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  3041. anInt1022 = 0;
  3042. }
  3043. }
  3044. }
  3045.  
  3046. stream.writeBytes(stream.currentOffset - j2);
  3047. if(j3 >= mouseDetection.coordsIndex)
  3048. {
  3049. mouseDetection.coordsIndex = 0;
  3050. } else
  3051. {
  3052. mouseDetection.coordsIndex -= j3;
  3053. for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  3054. {
  3055. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  3056. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  3057. }
  3058.  
  3059. }
  3060. }
  3061. } else
  3062. {
  3063. mouseDetection.coordsIndex = 0;
  3064. }
  3065. }
  3066. if(super.clickMode3 != 0)
  3067. {
  3068. long l = (super.aLong29 - aLong1220) / 50L;
  3069. if(l > 4095L)
  3070. l = 4095L;
  3071. aLong1220 = super.aLong29;
  3072. int k2 = super.saveClickY;
  3073. if(k2 < 0)
  3074. k2 = 0;
  3075. else
  3076. if(k2 > 502)
  3077. k2 = 502;
  3078. int k3 = super.saveClickX;
  3079. if(k3 < 0)
  3080. k3 = 0;
  3081. else
  3082. if(k3 > 764)
  3083. k3 = 764;
  3084. int k4 = k2 * 765 + k3;
  3085. int j5 = 0;
  3086. if(super.clickMode3 == 2)
  3087. j5 = 1;
  3088. int l5 = (int)l;
  3089. stream.createFrame(241);
  3090. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3091. }
  3092. if(anInt1016 > 0)
  3093. anInt1016--;
  3094. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3095. aBoolean1017 = true;
  3096. if(aBoolean1017 && anInt1016 <= 0)
  3097. {
  3098. anInt1016 = 20;
  3099. aBoolean1017 = false;
  3100. stream.createFrame(86);
  3101. stream.writeWord(anInt1184);
  3102. stream.method432(minimapInt1);
  3103. }
  3104. if(super.awtFocus && !aBoolean954)
  3105. {
  3106. aBoolean954 = true;
  3107. stream.createFrame(3);
  3108. stream.writeWordBigEndian(1);
  3109. }
  3110. if(!super.awtFocus && aBoolean954)
  3111. {
  3112. aBoolean954 = false;
  3113. stream.createFrame(3);
  3114. stream.writeWordBigEndian(0);
  3115. }
  3116. loadingStages();
  3117. method115();
  3118. method90();
  3119. anInt1009++;
  3120. if(anInt1009 > 750)
  3121. dropClient();
  3122. method114();
  3123. method95();
  3124. method38();
  3125. anInt945++;
  3126. if(crossType != 0)
  3127. {
  3128. crossIndex += 20;
  3129. if(crossIndex >= 400)
  3130. crossType = 0;
  3131. }
  3132. if(atInventoryInterfaceType != 0)
  3133. {
  3134. atInventoryLoopCycle++;
  3135. if(atInventoryLoopCycle >= 15)
  3136. {
  3137. if(atInventoryInterfaceType == 2)
  3138. needDrawTabArea = true;
  3139. if(atInventoryInterfaceType == 3)
  3140. inputTaken = true;
  3141. atInventoryInterfaceType = 0;
  3142. }
  3143. }
  3144. if(activeInterfaceType != 0)
  3145. {
  3146. anInt989++;
  3147. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  3148. aBoolean1242 = true;
  3149. if(super.clickMode2 == 0)
  3150. {
  3151. if(activeInterfaceType == 2)
  3152. needDrawTabArea = true;
  3153. if(activeInterfaceType == 3)
  3154. inputTaken = true;
  3155. activeInterfaceType = 0;
  3156. if(aBoolean1242 && anInt989 >= 5)
  3157. {
  3158. lastActiveInvInterface = -1;
  3159. processRightClick();
  3160. if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  3161. {
  3162. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3163. int j1 = 0;
  3164. if(anInt913 == 1 && class9.contentType == 206)
  3165. j1 = 1;
  3166. if(class9.inv[mouseInvInterfaceIndex] <= 0)
  3167. j1 = 0;
  3168. if(class9.aBoolean235)
  3169. {
  3170. int l2 = anInt1085;
  3171. int l3 = mouseInvInterfaceIndex;
  3172. class9.inv[l3] = class9.inv[l2];
  3173. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3174. class9.inv[l2] = -1;
  3175. class9.invStackSizes[l2] = 0;
  3176. } else
  3177. if(j1 == 1)
  3178. {
  3179. int i3 = anInt1085;
  3180. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3181. if(i3 > i4)
  3182. {
  3183. class9.swapInventoryItems(i3, i3 - 1);
  3184. i3--;
  3185. } else
  3186. if(i3 < i4)
  3187. {
  3188. class9.swapInventoryItems(i3, i3 + 1);
  3189. i3++;
  3190. }
  3191.  
  3192. } else
  3193. {
  3194. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  3195. }
  3196. stream.createFrame(214);
  3197. stream.method433(anInt1084);
  3198. stream.method424(j1);
  3199. stream.method433(anInt1085);
  3200. stream.method431(mouseInvInterfaceIndex);
  3201. }
  3202. } else
  3203. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  3204. determineMenuSize();
  3205. else
  3206. if(menuActionRow > 0)
  3207. doAction(menuActionRow - 1);
  3208. atInventoryLoopCycle = 10;
  3209. super.clickMode3 = 0;
  3210. }
  3211. }
  3212. if(WorldController.anInt470 != -1)
  3213. {
  3214. int k = WorldController.anInt470;
  3215. int k1 = WorldController.anInt471;
  3216. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  3217. WorldController.anInt470 = -1;
  3218. if(flag)
  3219. {
  3220. crossX = super.saveClickX;
  3221. crossY = super.saveClickY;
  3222. crossType = 1;
  3223. crossIndex = 0;
  3224. }
  3225. }
  3226. if(super.clickMode3 == 1 && aString844 != null)
  3227. {
  3228. aString844 = null;
  3229. inputTaken = true;
  3230. super.clickMode3 = 0;
  3231. }
  3232. processMenuClick();
  3233. processMainScreenClick();
  3234. processTabClick();
  3235. processChatModeClick();
  3236. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  3237. anInt1213++;
  3238. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3239. if (anInt1501 < 100) {
  3240. anInt1501++;
  3241. if (anInt1501 == 100) {
  3242. if (anInt1500 != 0) {
  3243. inputTaken = true;
  3244. }
  3245. if (anInt1044 != 0) {
  3246. needDrawTabArea = true;
  3247. }
  3248. }
  3249. }
  3250. } else if (anInt1501 > 0) {
  3251. anInt1501--;
  3252. }
  3253. if(loadingStage == 2)
  3254. method108();
  3255. if(loadingStage == 2 && aBoolean1160)
  3256. calcCameraPos();
  3257. for(int i1 = 0; i1 < 5; i1++)
  3258. anIntArray1030[i1]++;
  3259.  
  3260. method73();
  3261. super.idleTime++;
  3262. if(super.idleTime > 4500)
  3263. {
  3264. anInt1011 = 250;
  3265. super.idleTime -= 500;
  3266. stream.createFrame(202);
  3267. }
  3268. anInt988++;
  3269. if(anInt988 > 500)
  3270. {
  3271. anInt988 = 0;
  3272. int l1 = (int)(Math.random() * 8D);
  3273. if((l1 & 1) == 1)
  3274. anInt1278 += anInt1279;
  3275. if((l1 & 2) == 2)
  3276. anInt1131 += anInt1132;
  3277. if((l1 & 4) == 4)
  3278. anInt896 += anInt897;
  3279. }
  3280. if(anInt1278 < -50)
  3281. anInt1279 = 2;
  3282. if(anInt1278 > 50)
  3283. anInt1279 = -2;
  3284. if(anInt1131 < -55)
  3285. anInt1132 = 2;
  3286. if(anInt1131 > 55)
  3287. anInt1132 = -2;
  3288. if(anInt896 < -40)
  3289. anInt897 = 1;
  3290. if(anInt896 > 40)
  3291. anInt897 = -1;
  3292. anInt1254++;
  3293. if(anInt1254 > 500)
  3294. {
  3295. anInt1254 = 0;
  3296. int i2 = (int)(Math.random() * 8D);
  3297. if((i2 & 1) == 1)
  3298. minimapInt2 += anInt1210;
  3299. if((i2 & 2) == 2)
  3300. minimapInt3 += anInt1171;
  3301. }
  3302. if(minimapInt2 < -60)
  3303. anInt1210 = 2;
  3304. if(minimapInt2 > 60)
  3305. anInt1210 = -2;
  3306. if(minimapInt3 < -20)
  3307. anInt1171 = 1;
  3308. if(minimapInt3 > 10)
  3309. anInt1171 = -1;
  3310. anInt1010++;
  3311. if(anInt1010 > 50)
  3312. stream.createFrame(0);
  3313. try
  3314. {
  3315. if(socketStream != null && stream.currentOffset > 0)
  3316. {
  3317. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3318. stream.currentOffset = 0;
  3319. anInt1010 = 0;
  3320. }
  3321. }
  3322. catch(IOException _ex)
  3323. {
  3324. dropClient();
  3325. }
  3326. catch(Exception exception)
  3327. {
  3328. resetLogout();
  3329. }
  3330. }
  3331.  
  3332. private void method63()
  3333. {
  3334. Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  3335. for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  3336. if(class30_sub1.anInt1294 == -1)
  3337. {
  3338. class30_sub1.anInt1302 = 0;
  3339. method89(class30_sub1);
  3340. } else
  3341. {
  3342. class30_sub1.unlink();
  3343. }
  3344.  
  3345. }
  3346.  
  3347. private void resetImageProducers()
  3348. {
  3349. if(aRSImageProducer_1107 != null)
  3350. return;
  3351. super.fullGameScreen = null;
  3352. aRSImageProducer_1166 = null;
  3353. aRSImageProducer_1164 = null;
  3354. aRSImageProducer_1163 = null;
  3355. aRSImageProducer_1165 = null;
  3356. aRSImageProducer_1123 = null;
  3357. aRSImageProducer_1124 = null;
  3358. aRSImageProducer_1125 = null;
  3359. aRSImageProducer_1110 = new RSImageProducer(128, 265, getGameComponent());
  3360. DrawingArea.setAllPixelsToZero();
  3361. aRSImageProducer_1111 = new RSImageProducer(128, 265, getGameComponent());
  3362. DrawingArea.setAllPixelsToZero();
  3363. aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
  3364. DrawingArea.setAllPixelsToZero();
  3365. aRSImageProducer_1108 = new RSImageProducer(360, 132, getGameComponent());
  3366. DrawingArea.setAllPixelsToZero();
  3367. aRSImageProducer_1109 = new RSImageProducer(360, 200, getGameComponent());
  3368. DrawingArea.setAllPixelsToZero();
  3369. aRSImageProducer_1112 = new RSImageProducer(202, 238, getGameComponent());
  3370. DrawingArea.setAllPixelsToZero();
  3371. aRSImageProducer_1113 = new RSImageProducer(203, 238, getGameComponent());
  3372. DrawingArea.setAllPixelsToZero();
  3373. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  3374. DrawingArea.setAllPixelsToZero();
  3375. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  3376. DrawingArea.setAllPixelsToZero();
  3377. if(titleStreamLoader != null)
  3378. {
  3379. drawLogo();
  3380. loadTitleScreen();
  3381. }
  3382. welcomeScreenRaised = true;
  3383. }
  3384.  
  3385. void drawLoadingText(int i, String s)
  3386. {
  3387. anInt1079 = i;
  3388. aString1049 = s;
  3389. resetImageProducers();
  3390. if(titleStreamLoader == null)
  3391. {
  3392. super.drawLoadingText(i, s);
  3393. return;
  3394. }
  3395. aRSImageProducer_1109.initDrawingArea();
  3396. char c = '\u0168';
  3397. char c1 = '\310';
  3398. byte byte1 = 20;
  3399. chatTextDrawingArea.drawText(0xffffff, "Diversity", c1 / 2 - 26 - byte1, c / 2);
  3400. int j = c1 / 2 - 18 - byte1;
  3401. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  3402. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3403. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  3404. DrawingArea.drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3405. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3406. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3407. if(welcomeScreenRaised)
  3408. {
  3409. welcomeScreenRaised = false;
  3410. if(!aBoolean831)
  3411. {
  3412. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3413. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3414. }
  3415. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3416. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3417. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3418. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3419. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3420. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3421. }
  3422. }
  3423.  
  3424. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag,
  3425. int j1)
  3426. {
  3427. int anInt992;
  3428. if(aBoolean972)
  3429. anInt992 = 32;
  3430. else
  3431. anInt992 = 0;
  3432. aBoolean972 = false;
  3433. if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  3434. {
  3435. class9.scrollPosition -= anInt1213 * 4;
  3436. if(flag)
  3437. {
  3438. needDrawTabArea = true;
  3439. }
  3440. } else
  3441. if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  3442. {
  3443. class9.scrollPosition += anInt1213 * 4;
  3444. if(flag)
  3445. {
  3446. needDrawTabArea = true;
  3447. }
  3448. } else
  3449. if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  3450. {
  3451. int l1 = ((j - 32) * j) / j1;
  3452. if(l1 < 8)
  3453. l1 = 8;
  3454. int i2 = l - i1 - 16 - l1 / 2;
  3455. int j2 = j - 32 - l1;
  3456. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3457. if(flag)
  3458. needDrawTabArea = true;
  3459. aBoolean972 = true;
  3460. }
  3461. }
  3462.  
  3463. private boolean method66(int i, int j, int k)
  3464. {
  3465. int i1 = i >> 14 & 0x7fff;
  3466. int j1 = worldController.method304(plane, k, j, i);
  3467. if(j1 == -1)
  3468. return false;
  3469. int k1 = j1 & 0x1f;
  3470. int l1 = j1 >> 6 & 3;
  3471. if(k1 == 10 || k1 == 11 || k1 == 22)
  3472. {
  3473. ObjectDef class46 = ObjectDef.forID(i1);
  3474. int i2;
  3475. int j2;
  3476. if(l1 == 0 || l1 == 2)
  3477. {
  3478. i2 = class46.anInt744;
  3479. j2 = class46.anInt761;
  3480. } else
  3481. {
  3482. i2 = class46.anInt761;
  3483. j2 = class46.anInt744;
  3484. }
  3485. int k2 = class46.anInt768;
  3486. if(l1 != 0)
  3487. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3488. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3489. } else
  3490. {
  3491. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3492. }
  3493. crossX = super.saveClickX;
  3494. crossY = super.saveClickY;
  3495. crossType = 2;
  3496. crossIndex = 0;
  3497. return true;
  3498. }
  3499.  
  3500. private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k)
  3501. {
  3502. byte abyte0[] = null;
  3503. int l = 5;
  3504. try
  3505. {
  3506. if(decompressors[0] != null)
  3507. abyte0 = decompressors[0].decompress(i);
  3508. }
  3509. catch(Exception _ex) { }
  3510. if(abyte0 != null)
  3511. {
  3512. // aCRC32_930.reset();
  3513. // aCRC32_930.update(abyte0);
  3514. // int i1 = (int)aCRC32_930.getValue();
  3515. // if(i1 != j)
  3516. }
  3517. if(abyte0 != null)
  3518. {
  3519. StreamLoader streamLoader = new StreamLoader(abyte0);
  3520. return streamLoader;
  3521. }
  3522. int j1 = 0;
  3523. while(abyte0 == null)
  3524. {
  3525. String s2 = "Unknown error";
  3526. drawLoadingText(k, "Requesting " + s);
  3527. Object obj = null;
  3528. try
  3529. {
  3530. int k1 = 0;
  3531. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3532. byte abyte1[] = new byte[6];
  3533. datainputstream.readFully(abyte1, 0, 6);
  3534. Stream stream = new Stream(abyte1);
  3535. stream.currentOffset = 3;
  3536. int i2 = stream.read3Bytes() + 6;
  3537. int j2 = 6;
  3538. abyte0 = new byte[i2];
  3539. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3540.  
  3541. while(j2 < i2)
  3542. {
  3543. int l2 = i2 - j2;
  3544. if(l2 > 1000)
  3545. l2 = 1000;
  3546. int j3 = datainputstream.read(abyte0, j2, l2);
  3547. if(j3 < 0)
  3548. {
  3549. s2 = "Length error: " + j2 + "/" + i2;
  3550. throw new IOException("EOF");
  3551. }
  3552. j2 += j3;
  3553. int k3 = (j2 * 100) / i2;
  3554. if(k3 != k1)
  3555. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3556. k1 = k3;
  3557. }
  3558. datainputstream.close();
  3559. try
  3560. {
  3561. if(decompressors[0] != null)
  3562. decompressors[0].method234(abyte0.length, abyte0, i);
  3563. }
  3564. catch(Exception _ex)
  3565. {
  3566. decompressors[0] = null;
  3567. }
  3568. /* if(abyte0 != null)
  3569. {
  3570. aCRC32_930.reset();
  3571. aCRC32_930.update(abyte0);
  3572. int i3 = (int)aCRC32_930.getValue();
  3573. if(i3 != j)
  3574. {
  3575. abyte0 = null;
  3576. j1++;
  3577. s2 = "Checksum error: " + i3;
  3578. }
  3579. }
  3580. */
  3581. }
  3582. catch(IOException ioexception)
  3583. {
  3584. if(s2.equals("Unknown error"))
  3585. s2 = "Connection error";
  3586. abyte0 = null;
  3587. }
  3588. catch(NullPointerException _ex)
  3589. {
  3590. s2 = "Null error";
  3591. abyte0 = null;
  3592. if(!signlink.reporterror)
  3593. return null;
  3594. }
  3595. catch(ArrayIndexOutOfBoundsException _ex)
  3596. {
  3597. s2 = "Bounds error";
  3598. abyte0 = null;
  3599. if(!signlink.reporterror)
  3600. return null;
  3601. }
  3602. catch(Exception _ex)
  3603. {
  3604. s2 = "Unexpected error";
  3605. abyte0 = null;
  3606. if(!signlink.reporterror)
  3607. return null;
  3608. }
  3609. if(abyte0 == null)
  3610. {
  3611. for(int l1 = l; l1 > 0; l1--)
  3612. {
  3613. if(j1 >= 3)
  3614. {
  3615. drawLoadingText(k, "Game updated - please reload page");
  3616. l1 = 10;
  3617. } else
  3618. {
  3619. drawLoadingText(k, s2 + " - Retrying in " + l1);
  3620. }
  3621. try
  3622. {
  3623. Thread.sleep(1000L);
  3624. }
  3625. catch(Exception _ex) { }
  3626. }
  3627.  
  3628. l *= 2;
  3629. if(l > 60)
  3630. l = 60;
  3631. aBoolean872 = !aBoolean872;
  3632. }
  3633.  
  3634. }
  3635.  
  3636. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  3637. return streamLoader_1;
  3638. }
  3639.  
  3640. private void dropClient()
  3641. {
  3642. if(anInt1011 > 0)
  3643. {
  3644. resetLogout();
  3645. return;
  3646. }
  3647. aRSImageProducer_1165.initDrawingArea();
  3648. aTextDrawingArea_1271.drawText(0, "Connection lost", 144, 257);
  3649. aTextDrawingArea_1271.drawText(0xffffff, "Connection lost", 143, 256);
  3650. aTextDrawingArea_1271.drawText(0, "Please wait - attempting to reestablish", 159, 257);
  3651. aTextDrawingArea_1271.drawText(0xffffff, "Please wait - attempting to reestablish", 158, 256);
  3652. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3653. anInt1021 = 0;
  3654. destX = 0;
  3655. RSSocket rsSocket = socketStream;
  3656. loggedIn = false;
  3657. loginFailures = 0;
  3658. login(myUsername, myPassword, true);
  3659. if(!loggedIn)
  3660. resetLogout();
  3661. try
  3662. {
  3663. rsSocket.close();
  3664. }
  3665. catch(Exception _ex)
  3666. {
  3667. }
  3668. }
  3669.  
  3670. private void doAction(int i)
  3671. {
  3672. //if (l == 476) {
  3673. // alertHandler.close();
  3674. //}
  3675. if(i < 0)
  3676. return;
  3677. if(inputDialogState != 0)
  3678. {
  3679. inputDialogState = 0;
  3680. inputTaken = true;
  3681. }
  3682. int j = menuActionCmd2[i];
  3683. int k = menuActionCmd3[i];
  3684. int l = menuActionID[i];
  3685. int i1 = menuActionCmd1[i];
  3686. if(l >= 2000)
  3687. l -= 2000;
  3688. if(l == 582)
  3689. {
  3690. NPC npc = npcArray[i1];
  3691. if(npc != null)
  3692. {
  3693. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  3694. crossX = super.saveClickX;
  3695. crossY = super.saveClickY;
  3696. crossType = 2;
  3697. crossIndex = 0;
  3698. stream.createFrame(57);
  3699. stream.method432(anInt1285);
  3700. stream.method432(i1);
  3701. stream.method431(anInt1283);
  3702. stream.method432(anInt1284);
  3703. }
  3704. }
  3705. if(l == 234)
  3706. {
  3707. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3708. if(!flag1)
  3709. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3710. crossX = super.saveClickX;
  3711. crossY = super.saveClickY;
  3712. crossType = 2;
  3713. crossIndex = 0;
  3714. stream.createFrame(236);
  3715. stream.method431(k + baseY);
  3716. stream.writeWord(i1);
  3717. stream.method431(j + baseX);
  3718. }
  3719. if(l == 62 && method66(i1, k, j))
  3720. {
  3721. stream.createFrame(192);
  3722. stream.writeWord(anInt1284);
  3723. stream.method431(i1 >> 14 & 0x7fff);
  3724. stream.method433(k + baseY);
  3725. stream.method431(anInt1283);
  3726. stream.method433(j + baseX);
  3727. stream.writeWord(anInt1285);
  3728. }
  3729. if(l == 511)
  3730. {
  3731. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3732. if(!flag2)
  3733. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3734. crossX = super.saveClickX;
  3735. crossY = super.saveClickY;
  3736. crossType = 2;
  3737. crossIndex = 0;
  3738. stream.createFrame(25);
  3739. stream.method431(anInt1284);
  3740. stream.method432(anInt1285);
  3741. stream.writeWord(i1);
  3742. stream.method432(k + baseY);
  3743. stream.method433(anInt1283);
  3744. stream.writeWord(j + baseX);
  3745. }
  3746. if(l == 74)
  3747. {
  3748. stream.createFrame(122);
  3749. stream.method433(k);
  3750. stream.method432(j);
  3751. stream.method431(i1);
  3752. atInventoryLoopCycle = 0;
  3753. atInventoryInterface = k;
  3754. atInventoryIndex = j;
  3755. atInventoryInterfaceType = 2;
  3756. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3757. atInventoryInterfaceType = 1;
  3758. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3759. atInventoryInterfaceType = 3;
  3760. }
  3761. if (l == 315) {
  3762. RSInterface class9 = RSInterface.interfaceCache[k];
  3763. boolean flag8 = true;
  3764. if (class9.contentType > 0)
  3765. flag8 = promptUserForInput(class9);
  3766. if (flag8) {
  3767.  
  3768. switch(k){
  3769. case 19144:
  3770. sendFrame248(15106,3213);
  3771. method60(15106);
  3772. inputTaken = true;
  3773. break;
  3774. default:
  3775. stream.createFrame(185);
  3776. stream.writeWord(k);
  3777. break;
  3778.  
  3779. }
  3780. }
  3781. }
  3782. if(l == 561)
  3783. {
  3784. Player player = playerArray[i1];
  3785. if(player != null)
  3786. {
  3787. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  3788. crossX = super.saveClickX;
  3789. crossY = super.saveClickY;
  3790. crossType = 2;
  3791. crossIndex = 0;
  3792. anInt1188 += i1;
  3793. if(anInt1188 >= 90)
  3794. {
  3795. stream.createFrame(136);
  3796. anInt1188 = 0;
  3797. }
  3798. stream.createFrame(128);
  3799. stream.writeWord(i1);
  3800. }
  3801. }
  3802. if(l == 20)
  3803. {
  3804. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  3805. if(class30_sub2_sub4_sub1_sub1_1 != null)
  3806. {
  3807. 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]);
  3808. crossX = super.saveClickX;
  3809. crossY = super.saveClickY;
  3810. crossType = 2;
  3811. crossIndex = 0;
  3812. stream.createFrame(155);
  3813. stream.method431(i1);
  3814. }
  3815. }
  3816. if(l == 779)
  3817. {
  3818. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  3819. if(class30_sub2_sub4_sub1_sub2_1 != null)
  3820. {
  3821. 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]);
  3822. crossX = super.saveClickX;
  3823. crossY = super.saveClickY;
  3824. crossType = 2;
  3825. crossIndex = 0;
  3826. stream.createFrame(153);
  3827. stream.method431(i1);
  3828. }
  3829. }
  3830. if(l == 516)
  3831. if(!menuOpen)
  3832. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  3833. else
  3834. worldController.method312(k - 4, j - 4);
  3835. if(l == 1062)
  3836. {
  3837. anInt924 += baseX;
  3838. if(anInt924 >= 113)
  3839. {
  3840. stream.createFrame(183);
  3841. stream.writeDWordBigEndian(0xe63271);
  3842. anInt924 = 0;
  3843. }
  3844. method66(i1, k, j);
  3845. stream.createFrame(228);
  3846. stream.method432(i1 >> 14 & 0x7fff);
  3847. stream.method432(k + baseY);
  3848. stream.writeWord(j + baseX);
  3849. }
  3850. if(l == 679 && !aBoolean1149)
  3851. {
  3852. stream.createFrame(40);
  3853. stream.writeWord(k);
  3854. aBoolean1149 = true;
  3855. }
  3856. if(l == 431)
  3857. {
  3858. stream.createFrame(129);
  3859. stream.method432(j);
  3860. stream.writeWord(k);
  3861. stream.method432(i1);
  3862. atInventoryLoopCycle = 0;
  3863. atInventoryInterface = k;
  3864. atInventoryIndex = j;
  3865. atInventoryInterfaceType = 2;
  3866. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3867. atInventoryInterfaceType = 1;
  3868. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3869. atInventoryInterfaceType = 3;
  3870. }
  3871. if(l == 337 || l == 42 || l == 792 || l == 322)
  3872. {
  3873. String s = menuActionName[i];
  3874. int k1 = s.indexOf("@whi@");
  3875. if(k1 != -1)
  3876. {
  3877. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  3878. if(l == 337)
  3879. addFriend(l3);
  3880. if(l == 42)
  3881. addIgnore(l3);
  3882. if(l == 792)
  3883. delFriend(l3);
  3884. if(l == 322)
  3885. delIgnore(l3);
  3886. }
  3887. }
  3888. if(l == 53)
  3889. {
  3890. stream.createFrame(135);
  3891. stream.method431(j);
  3892. stream.method432(k);
  3893. stream.method431(i1);
  3894. atInventoryLoopCycle = 0;
  3895. atInventoryInterface = k;
  3896. atInventoryIndex = j;
  3897. atInventoryInterfaceType = 2;
  3898. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3899. atInventoryInterfaceType = 1;
  3900. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3901. atInventoryInterfaceType = 3;
  3902. }
  3903. if(l == 539)
  3904. {
  3905. stream.createFrame(16);
  3906. stream.method432(i1);
  3907. stream.method433(j);
  3908. stream.method433(k);
  3909. atInventoryLoopCycle = 0;
  3910. atInventoryInterface = k;
  3911. atInventoryIndex = j;
  3912. atInventoryInterfaceType = 2;
  3913. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3914. atInventoryInterfaceType = 1;
  3915. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3916. atInventoryInterfaceType = 3;
  3917. }
  3918. if(l == 484 || l == 6)
  3919. {
  3920. String s1 = menuActionName[i];
  3921. int l1 = s1.indexOf("@whi@");
  3922. if(l1 != -1)
  3923. {
  3924. s1 = s1.substring(l1 + 5).trim();
  3925. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  3926. boolean flag9 = false;
  3927. for(int j3 = 0; j3 < playerCount; j3++)
  3928. {
  3929. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  3930. 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))
  3931. continue;
  3932. 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]);
  3933. if(l == 484)
  3934. {
  3935. stream.createFrame(139);
  3936. stream.method431(playerIndices[j3]);
  3937. }
  3938. if(l == 6)
  3939. {
  3940. anInt1188 += i1;
  3941. if(anInt1188 >= 90)
  3942. {
  3943. stream.createFrame(136);
  3944. anInt1188 = 0;
  3945. }
  3946. stream.createFrame(128);
  3947. stream.writeWord(playerIndices[j3]);
  3948. }
  3949. flag9 = true;
  3950. break;
  3951. }
  3952.  
  3953. if(!flag9)
  3954. pushMessage("Unable to find " + s7, 0, "");
  3955. }
  3956. }
  3957. if(l == 870)
  3958. {
  3959. stream.createFrame(53);
  3960. stream.writeWord(j);
  3961. stream.method432(anInt1283);
  3962. stream.method433(i1);
  3963. stream.writeWord(anInt1284);
  3964. stream.method431(anInt1285);
  3965. stream.writeWord(k);
  3966. atInventoryLoopCycle = 0;
  3967. atInventoryInterface = k;
  3968. atInventoryIndex = j;
  3969. atInventoryInterfaceType = 2;
  3970. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3971. atInventoryInterfaceType = 1;
  3972. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3973. atInventoryInterfaceType = 3;
  3974. }
  3975. if(l == 847)
  3976. {
  3977. stream.createFrame(87);
  3978. stream.method432(i1);
  3979. stream.writeWord(k);
  3980. stream.method432(j);
  3981. atInventoryLoopCycle = 0;
  3982. atInventoryInterface = k;
  3983. atInventoryIndex = j;
  3984. atInventoryInterfaceType = 2;
  3985. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3986. atInventoryInterfaceType = 1;
  3987. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3988. atInventoryInterfaceType = 3;
  3989. }
  3990. if(l == 626)
  3991. {
  3992. RSInterface class9_1 = RSInterface.interfaceCache[k];
  3993. spellSelected = 1;
  3994. spellID = class9_1.id;
  3995. anInt1137 = k;
  3996. spellUsableOn = class9_1.spellUsableOn;
  3997. itemSelected = 0;
  3998. needDrawTabArea = true;
  3999. String s4 = class9_1.selectedActionName;
  4000. if(s4.indexOf(" ") != -1)
  4001. s4 = s4.substring(0, s4.indexOf(" "));
  4002. String s8 = class9_1.selectedActionName;
  4003. if(s8.indexOf(" ") != -1)
  4004. s8 = s8.substring(s8.indexOf(" ") + 1);
  4005. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4006. //class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265, 0xffffff);
  4007. //class9_1.sprite1.drawSprite(200,200);
  4008. //System.out.println("Sprite: " + class9_1.sprite1.toString());
  4009. if(spellUsableOn == 16)
  4010. {
  4011. needDrawTabArea = true;
  4012. tabID = 3;
  4013. tabAreaAltered = true;
  4014. }
  4015. return;
  4016. }
  4017. if(l == 78)
  4018. {
  4019. stream.createFrame(117);
  4020. stream.method433(k);
  4021. stream.method433(i1);
  4022. stream.method431(j);
  4023. atInventoryLoopCycle = 0;
  4024. atInventoryInterface = k;
  4025. atInventoryIndex = j;
  4026. atInventoryInterfaceType = 2;
  4027. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4028. atInventoryInterfaceType = 1;
  4029. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4030. atInventoryInterfaceType = 3;
  4031. }
  4032. if(l == 27)
  4033. {
  4034. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4035. if(class30_sub2_sub4_sub1_sub2_2 != null)
  4036. {
  4037. 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]);
  4038. crossX = super.saveClickX;
  4039. crossY = super.saveClickY;
  4040. crossType = 2;
  4041. crossIndex = 0;
  4042. anInt986 += i1;
  4043. if(anInt986 >= 54)
  4044. {
  4045. stream.createFrame(189);
  4046. stream.writeWordBigEndian(234);
  4047. anInt986 = 0;
  4048. }
  4049. stream.createFrame(73);
  4050. stream.method431(i1);
  4051. }
  4052. }
  4053. if(l == 213)
  4054. {
  4055. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4056. if(!flag3)
  4057. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4058. crossX = super.saveClickX;
  4059. crossY = super.saveClickY;
  4060. crossType = 2;
  4061. crossIndex = 0;
  4062. stream.createFrame(79);
  4063. stream.method431(k + baseY);
  4064. stream.writeWord(i1);
  4065. stream.method432(j + baseX);
  4066. }
  4067. if(l == 632)
  4068. {
  4069. stream.createFrame(145);
  4070. stream.method432(k);
  4071. stream.method432(j);
  4072. stream.method432(i1);
  4073. atInventoryLoopCycle = 0;
  4074. atInventoryInterface = k;
  4075. atInventoryIndex = j;
  4076. atInventoryInterfaceType = 2;
  4077. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4078. atInventoryInterfaceType = 1;
  4079. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4080. atInventoryInterfaceType = 3;
  4081. }
  4082. if(l == 1004) {
  4083. if(tabInterfaceIDs[10] != -1) {
  4084. needDrawTabArea = true;
  4085. tabID = 10;
  4086. tabAreaAltered = true;
  4087. }
  4088. }
  4089. if(l == 1003) {
  4090. clanChatMode = 2;
  4091. aBoolean1233 = true;
  4092. inputTaken = true;
  4093. }
  4094. if(l == 1002) {
  4095. clanChatMode = 1;
  4096. aBoolean1233 = true;
  4097. inputTaken = true;
  4098. }
  4099. if(l == 1001) {
  4100. clanChatMode = 0;
  4101. aBoolean1233 = true;
  4102. inputTaken = true;
  4103. }
  4104. if(l == 1000) {
  4105. cButtonCPos = 4;
  4106. chatTypeView = 11;
  4107. aBoolean1233 = true;
  4108. inputTaken = true;
  4109. }
  4110. if(l == 999) {
  4111. cButtonCPos = 0;
  4112. chatTypeView = 0;
  4113. aBoolean1233 = true;
  4114. inputTaken = true;
  4115. }
  4116. if(l == 998) {
  4117. cButtonCPos = 1;
  4118. chatTypeView = 5;
  4119. aBoolean1233 = true;
  4120. inputTaken = true;
  4121. }
  4122. if(l == 997) {
  4123. publicChatMode = 3;
  4124. aBoolean1233 = true;
  4125. inputTaken = true;
  4126. }
  4127. if(l == 996) {
  4128. publicChatMode = 2;
  4129. aBoolean1233 = true;
  4130. inputTaken = true;
  4131. }
  4132. if(l == 995) {
  4133. publicChatMode = 1;
  4134. aBoolean1233 = true;
  4135. inputTaken = true;
  4136. }
  4137. if(l == 994) {
  4138. publicChatMode = 0;
  4139. aBoolean1233 = true;
  4140. inputTaken = true;
  4141. }
  4142. if(l == 993) {
  4143. cButtonCPos = 2;
  4144. chatTypeView = 1;
  4145. aBoolean1233 = true;
  4146. inputTaken = true;
  4147. }
  4148. if(l == 992) {
  4149. privateChatMode = 2;
  4150. aBoolean1233 = true;
  4151. inputTaken = true;
  4152. }
  4153. if(l == 991) {
  4154. privateChatMode = 1;
  4155. aBoolean1233 = true;
  4156. inputTaken = true;
  4157. }
  4158. if(l == 990) {
  4159. privateChatMode = 0;
  4160. aBoolean1233 = true;
  4161. inputTaken = true;
  4162. }
  4163. if(l == 989) {
  4164. cButtonCPos = 3;
  4165. chatTypeView = 2;
  4166. aBoolean1233 = true;
  4167. inputTaken = true;
  4168. }
  4169. if(l == 987) {
  4170. tradeMode = 2;
  4171. aBoolean1233 = true;
  4172. inputTaken = true;
  4173. }
  4174. if(l == 986) {
  4175. tradeMode = 1;
  4176. aBoolean1233 = true;
  4177. inputTaken = true;
  4178. }
  4179. if(l == 985) {
  4180. tradeMode = 0;
  4181. aBoolean1233 = true;
  4182. inputTaken = true;
  4183. }
  4184. if(l == 984) {
  4185. cButtonCPos = 5;
  4186. chatTypeView = 3;
  4187. aBoolean1233 = true;
  4188. inputTaken = true;
  4189. }
  4190. if(l == 983) {
  4191. duelMode = 2;
  4192. aBoolean1233 = true;
  4193. inputTaken = true;
  4194. }
  4195. if(l == 982) {
  4196. duelMode = 1;
  4197. aBoolean1233 = true;
  4198. inputTaken = true;
  4199. }
  4200. if(l == 981) {
  4201. duelMode = 0;
  4202. aBoolean1233 = true;
  4203. inputTaken = true;
  4204. }
  4205. if(l == 980) {
  4206. cButtonCPos = 6;
  4207. chatTypeView = 4;
  4208. aBoolean1233 = true;
  4209. inputTaken = true;
  4210. }
  4211. if(l == 493)
  4212. {
  4213. stream.createFrame(75);
  4214. stream.method433(k);
  4215. stream.method431(j);
  4216. stream.method432(i1);
  4217. atInventoryLoopCycle = 0;
  4218. atInventoryInterface = k;
  4219. atInventoryIndex = j;
  4220. atInventoryInterfaceType = 2;
  4221. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4222. atInventoryInterfaceType = 1;
  4223. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4224. atInventoryInterfaceType = 3;
  4225. }
  4226. if(l == 652)
  4227. {
  4228. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4229. if(!flag4)
  4230. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4231. crossX = super.saveClickX;
  4232. crossY = super.saveClickY;
  4233. crossType = 2;
  4234. crossIndex = 0;
  4235. stream.createFrame(156);
  4236. stream.method432(j + baseX);
  4237. stream.method431(k + baseY);
  4238. stream.method433(i1);
  4239. }
  4240. if(l == 94)
  4241. {
  4242. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4243. if(!flag5)
  4244. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4245. crossX = super.saveClickX;
  4246. crossY = super.saveClickY;
  4247. crossType = 2;
  4248. crossIndex = 0;
  4249. stream.createFrame(181);
  4250. stream.method431(k + baseY);
  4251. stream.writeWord(i1);
  4252. stream.method431(j + baseX);
  4253. stream.method432(anInt1137);
  4254. }
  4255. if(l == 646)
  4256. {
  4257. stream.createFrame(185);
  4258. stream.writeWord(k);
  4259. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4260. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
  4261. {
  4262. int i2 = class9_2.valueIndexArray[0][1];
  4263. if(variousSettings[i2] != class9_2.anIntArray212[0])
  4264. {
  4265. variousSettings[i2] = class9_2.anIntArray212[0];
  4266. method33(i2);
  4267. needDrawTabArea = true;
  4268. }
  4269. }
  4270. }
  4271. if(l == 225)
  4272. {
  4273. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4274. if(class30_sub2_sub4_sub1_sub1_2 != null)
  4275. {
  4276. 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]);
  4277. crossX = super.saveClickX;
  4278. crossY = super.saveClickY;
  4279. crossType = 2;
  4280. crossIndex = 0;
  4281. anInt1226 += i1;
  4282. if(anInt1226 >= 85)
  4283. {
  4284. stream.createFrame(230);
  4285. stream.writeWordBigEndian(239);
  4286. anInt1226 = 0;
  4287. }
  4288. stream.createFrame(17);
  4289. stream.method433(i1);
  4290. }
  4291. }
  4292. if(l == 965)
  4293. {
  4294. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4295. if(class30_sub2_sub4_sub1_sub1_3 != null)
  4296. {
  4297. 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]);
  4298. crossX = super.saveClickX;
  4299. crossY = super.saveClickY;
  4300. crossType = 2;
  4301. crossIndex = 0;
  4302. anInt1134++;
  4303. if(anInt1134 >= 96)
  4304. {
  4305. stream.createFrame(152);
  4306. stream.writeWordBigEndian(88);
  4307. anInt1134 = 0;
  4308. }
  4309. stream.createFrame(21);
  4310. stream.writeWord(i1);
  4311. }
  4312. }
  4313. if(l == 413)
  4314. {
  4315. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4316. if(class30_sub2_sub4_sub1_sub1_4 != null)
  4317. {
  4318. 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]);
  4319. crossX = super.saveClickX;
  4320. crossY = super.saveClickY;
  4321. crossType = 2;
  4322. crossIndex = 0;
  4323. stream.createFrame(131);
  4324. stream.method433(i1);
  4325. stream.method432(anInt1137);
  4326. }
  4327. }
  4328. if(l == 200)
  4329. clearTopInterfaces();
  4330. if(l == 1025)
  4331. {
  4332. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4333. if(class30_sub2_sub4_sub1_sub1_5 != null)
  4334. {
  4335. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4336. if(entityDef.childrenIDs != null)
  4337. entityDef = entityDef.method161();
  4338. if(entityDef != null)
  4339. {
  4340. String s9;
  4341. if(entityDef.description != null)
  4342. s9 = new String(entityDef.description);
  4343. else
  4344. s9 = "It's a " + entityDef.name + ".";
  4345. pushMessage(s9, 0, "");
  4346. }
  4347. }
  4348. }
  4349. if(l == 900)
  4350. {
  4351. method66(i1, k, j);
  4352. stream.createFrame(252);
  4353. stream.method433(i1 >> 14 & 0x7fff);
  4354. stream.method431(k + baseY);
  4355. stream.method432(j + baseX);
  4356. }
  4357. if(l == 412)
  4358. {
  4359. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4360. if(class30_sub2_sub4_sub1_sub1_6 != null)
  4361. {
  4362. 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]);
  4363. crossX = super.saveClickX;
  4364. crossY = super.saveClickY;
  4365. crossType = 2;
  4366. crossIndex = 0;
  4367. stream.createFrame(72);
  4368. stream.method432(i1);
  4369. }
  4370. }
  4371. if(l == 365)
  4372. {
  4373. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4374. if(class30_sub2_sub4_sub1_sub2_3 != null)
  4375. {
  4376. 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]);
  4377. crossX = super.saveClickX;
  4378. crossY = super.saveClickY;
  4379. crossType = 2;
  4380. crossIndex = 0;
  4381. stream.createFrame(249);
  4382. stream.method432(i1);
  4383. stream.method431(anInt1137);
  4384. }
  4385. }
  4386. if(l == 729)
  4387. {
  4388. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4389. if(class30_sub2_sub4_sub1_sub2_4 != null)
  4390. {
  4391. 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]);
  4392. crossX = super.saveClickX;
  4393. crossY = super.saveClickY;
  4394. crossType = 2;
  4395. crossIndex = 0;
  4396. stream.createFrame(39);
  4397. stream.method431(i1);
  4398. }
  4399. }
  4400. if(l == 577)
  4401. {
  4402. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4403. if(class30_sub2_sub4_sub1_sub2_5 != null)
  4404. {
  4405. 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]);
  4406. crossX = super.saveClickX;
  4407. crossY = super.saveClickY;
  4408. crossType = 2;
  4409. crossIndex = 0;
  4410. stream.createFrame(139);
  4411. stream.method431(i1);
  4412. }
  4413. }
  4414. if(l == 956 && method66(i1, k, j))
  4415. {
  4416. stream.createFrame(35);
  4417. stream.method431(j + baseX);
  4418. stream.method432(anInt1137);
  4419. stream.method432(k + baseY);
  4420. stream.method431(i1 >> 14 & 0x7fff);
  4421. }
  4422. if(l == 567)
  4423. {
  4424. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4425. if(!flag6)
  4426. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4427. crossX = super.saveClickX;
  4428. crossY = super.saveClickY;
  4429. crossType = 2;
  4430. crossIndex = 0;
  4431. stream.createFrame(23);
  4432. stream.method431(k + baseY);
  4433. stream.method431(i1);
  4434. stream.method431(j + baseX);
  4435. }
  4436. if(l == 867)
  4437. {
  4438. if((i1 & 3) == 0)
  4439. anInt1175++;
  4440. if(anInt1175 >= 59)
  4441. {
  4442. stream.createFrame(200);
  4443. stream.writeWord(25501);
  4444. anInt1175 = 0;
  4445. }
  4446. stream.createFrame(43);
  4447. stream.method431(k);
  4448. stream.method432(i1);
  4449. stream.method432(j);
  4450. atInventoryLoopCycle = 0;
  4451. atInventoryInterface = k;
  4452. atInventoryIndex = j;
  4453. atInventoryInterfaceType = 2;
  4454. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4455. atInventoryInterfaceType = 1;
  4456. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4457. atInventoryInterfaceType = 3;
  4458. }
  4459. if(l == 543)
  4460. {
  4461. stream.createFrame(237);
  4462. stream.writeWord(j);
  4463. stream.method432(i1);
  4464. stream.writeWord(k);
  4465. stream.method432(anInt1137);
  4466. atInventoryLoopCycle = 0;
  4467. atInventoryInterface = k;
  4468. atInventoryIndex = j;
  4469. atInventoryInterfaceType = 2;
  4470. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4471. atInventoryInterfaceType = 1;
  4472. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4473. atInventoryInterfaceType = 3;
  4474. }
  4475. if(l == 606)
  4476. {
  4477. String s2 = menuActionName[i];
  4478. int j2 = s2.indexOf("@whi@");
  4479. if(j2 != -1)
  4480. if(openInterfaceID == -1)
  4481. {
  4482. clearTopInterfaces();
  4483. reportAbuseInput = s2.substring(j2 + 5).trim();
  4484. canMute = false;
  4485. for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  4486. {
  4487. if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  4488. continue;
  4489. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4490. break;
  4491. }
  4492.  
  4493. } else
  4494. {
  4495. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  4496. }
  4497. }
  4498. if(l == 491)
  4499. {
  4500. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4501. if(class30_sub2_sub4_sub1_sub2_6 != null)
  4502. {
  4503. 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]);
  4504. crossX = super.saveClickX;
  4505. crossY = super.saveClickY;
  4506. crossType = 2;
  4507. crossIndex = 0;
  4508. stream.createFrame(14);
  4509. stream.method432(anInt1284);
  4510. stream.writeWord(i1);
  4511. stream.writeWord(anInt1285);
  4512. stream.method431(anInt1283);
  4513. }
  4514. }
  4515. if(l == 639)
  4516. {
  4517. String s3 = menuActionName[i];
  4518. int k2 = s3.indexOf("@whi@");
  4519. if(k2 != -1)
  4520. {
  4521. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4522. int k3 = -1;
  4523. for(int i4 = 0; i4 < friendsCount; i4++)
  4524. {
  4525. if(friendsListAsLongs[i4] != l4)
  4526. continue;
  4527. k3 = i4;
  4528. break;
  4529. }
  4530.  
  4531. if(k3 != -1 && friendsNodeIDs[k3] > 0)
  4532. {
  4533. inputTaken = true;
  4534. inputDialogState = 0;
  4535. messagePromptRaised = true;
  4536. promptInput = "";
  4537. friendsListAction = 3;
  4538. aLong953 = friendsListAsLongs[k3];
  4539. aString1121 = "Enter message to send to " + friendsList[k3];
  4540. }
  4541. }
  4542. }
  4543. if(l == 454)
  4544. {
  4545. stream.createFrame(41);
  4546. stream.writeWord(i1);
  4547. stream.method432(j);
  4548. stream.method432(k);
  4549. atInventoryLoopCycle = 0;
  4550. atInventoryInterface = k;
  4551. atInventoryIndex = j;
  4552. atInventoryInterfaceType = 2;
  4553. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4554. atInventoryInterfaceType = 1;
  4555. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4556. atInventoryInterfaceType = 3;
  4557. }
  4558. if(l == 478)
  4559. {
  4560. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4561. if(class30_sub2_sub4_sub1_sub1_7 != null)
  4562. {
  4563. 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]);
  4564. crossX = super.saveClickX;
  4565. crossY = super.saveClickY;
  4566. crossType = 2;
  4567. crossIndex = 0;
  4568. if((i1 & 3) == 0)
  4569. anInt1155++;
  4570. if(anInt1155 >= 53)
  4571. {
  4572. stream.createFrame(85);
  4573. stream.writeWordBigEndian(66);
  4574. anInt1155 = 0;
  4575. }
  4576. stream.createFrame(18);
  4577. stream.method431(i1);
  4578. }
  4579. }
  4580. if(l == 113)
  4581. {
  4582. method66(i1, k, j);
  4583. stream.createFrame(70);
  4584. stream.method431(j + baseX);
  4585. stream.writeWord(k + baseY);
  4586. stream.method433(i1 >> 14 & 0x7fff);
  4587. }
  4588. if(l == 872)
  4589. {
  4590. method66(i1, k, j);
  4591. stream.createFrame(234);
  4592. stream.method433(j + baseX);
  4593. stream.method432(i1 >> 14 & 0x7fff);
  4594. stream.method433(k + baseY);
  4595. }
  4596. if(l == 502)
  4597. {
  4598. method66(i1, k, j);
  4599. stream.createFrame(132);
  4600. stream.method433(j + baseX);
  4601. stream.writeWord(i1 >> 14 & 0x7fff);
  4602. stream.method432(k + baseY);
  4603. }
  4604. if(l == 1125)
  4605. {
  4606. ItemDef itemDef = ItemDef.forID(i1);
  4607. RSInterface class9_4 = RSInterface.interfaceCache[k];
  4608. String s5;
  4609. if(class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  4610. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  4611. else
  4612. if(itemDef.description != null)
  4613. s5 = new String(itemDef.description);
  4614. else
  4615. s5 = "It's a " + itemDef.name + ".";
  4616. pushMessage(s5, 0, "");
  4617. }
  4618. if(l == 169)
  4619. {
  4620. stream.createFrame(185);
  4621. stream.writeWord(k);
  4622. RSInterface class9_3 = RSInterface.interfaceCache[k];
  4623. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5)
  4624. {
  4625. int l2 = class9_3.valueIndexArray[0][1];
  4626. variousSettings[l2] = 1 - variousSettings[l2];
  4627. method33(l2);
  4628. needDrawTabArea = true;
  4629. }
  4630. }
  4631. if(l == 447)
  4632. {
  4633. itemSelected = 1;
  4634. anInt1283 = j;
  4635. anInt1284 = k;
  4636. anInt1285 = i1;
  4637. selectedItemName = ItemDef.forID(i1).name;
  4638. spellSelected = 0;
  4639. needDrawTabArea = true;
  4640. return;
  4641. }
  4642. if(l == 1226)
  4643. {
  4644. int j1 = i1 >> 14 & 0x7fff;
  4645. ObjectDef class46 = ObjectDef.forID(j1);
  4646. String s10;
  4647. if(class46.description != null)
  4648. s10 = new String(class46.description);
  4649. else
  4650. s10 = "It's a " + class46.name + ".";
  4651. pushMessage(s10, 0, "");
  4652. }
  4653. if(l == 244)
  4654. {
  4655. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4656. if(!flag7)
  4657. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4658. crossX = super.saveClickX;
  4659. crossY = super.saveClickY;
  4660. crossType = 2;
  4661. crossIndex = 0;
  4662. stream.createFrame(253);
  4663. stream.method431(j + baseX);
  4664. stream.method433(k + baseY);
  4665. stream.method432(i1);
  4666. }
  4667. if(l == 1448)
  4668. {
  4669. ItemDef itemDef_1 = ItemDef.forID(i1);
  4670. String s6;
  4671. if(itemDef_1.description != null)
  4672. s6 = new String(itemDef_1.description);
  4673. else
  4674. s6 = "It's a " + itemDef_1.name + ".";
  4675. pushMessage(s6, 0, "");
  4676. }
  4677. itemSelected = 0;
  4678. spellSelected = 0;
  4679. needDrawTabArea = true;
  4680.  
  4681. }
  4682.  
  4683. private void method70()
  4684. {
  4685. anInt1251 = 0;
  4686. int j = (myPlayer.x >> 7) + baseX;
  4687. int k = (myPlayer.y >> 7) + baseY;
  4688. if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  4689. anInt1251 = 1;
  4690. if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  4691. anInt1251 = 1;
  4692. if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  4693. anInt1251 = 0;
  4694. }
  4695.  
  4696. public void run() {
  4697. if(drawFlames) {
  4698. drawFlames();
  4699. } else {
  4700. super.run();
  4701. }
  4702. }
  4703.  
  4704. private void build3dScreenMenu()
  4705. {
  4706. if(itemSelected == 0 && spellSelected == 0)
  4707. {
  4708. menuActionName[menuActionRow] = "Walk here";
  4709. menuActionID[menuActionRow] = 516;
  4710. menuActionCmd2[menuActionRow] = super.mouseX;
  4711. menuActionCmd3[menuActionRow] = super.mouseY;
  4712. menuActionRow++;
  4713. }
  4714. int j = -1;
  4715. for(int k = 0; k < Model.anInt1687; k++)
  4716. {
  4717. int l = Model.anIntArray1688[k];
  4718. int i1 = l & 0x7f;
  4719. int j1 = l >> 7 & 0x7f;
  4720. int k1 = l >> 29 & 3;
  4721. int l1 = l >> 14 & 0x7fff;
  4722. if(l == j)
  4723. continue;
  4724. j = l;
  4725. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
  4726. {
  4727. ObjectDef class46 = ObjectDef.forID(l1);
  4728. if(class46.childrenIDs != null)
  4729. class46 = class46.method580();
  4730. if(class46 == null)
  4731. continue;
  4732. if(itemSelected == 1)
  4733. {
  4734. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
  4735. menuActionID[menuActionRow] = 62;
  4736. menuActionCmd1[menuActionRow] = l;
  4737. menuActionCmd2[menuActionRow] = i1;
  4738. menuActionCmd3[menuActionRow] = j1;
  4739. menuActionRow++;
  4740. } else
  4741. if(spellSelected == 1)
  4742. {
  4743. if((spellUsableOn & 4) == 4)
  4744. {
  4745. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  4746. menuActionID[menuActionRow] = 956;
  4747. menuActionCmd1[menuActionRow] = l;
  4748. menuActionCmd2[menuActionRow] = i1;
  4749. menuActionCmd3[menuActionRow] = j1;
  4750. menuActionRow++;
  4751. }
  4752. } else
  4753. {
  4754. if(class46.actions != null)
  4755. {
  4756. for(int i2 = 4; i2 >= 0; i2--)
  4757. if(class46.actions[i2] != null)
  4758. {
  4759. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  4760. if(i2 == 0)
  4761. menuActionID[menuActionRow] = 502;
  4762. if(i2 == 1)
  4763. menuActionID[menuActionRow] = 900;
  4764. if(i2 == 2)
  4765. menuActionID[menuActionRow] = 113;
  4766. if(i2 == 3)
  4767. menuActionID[menuActionRow] = 872;
  4768. if(i2 == 4)
  4769. menuActionID[menuActionRow] = 1062;
  4770. menuActionCmd1[menuActionRow] = l;
  4771. menuActionCmd2[menuActionRow] = i1;
  4772. menuActionCmd3[menuActionRow] = j1;
  4773. menuActionRow++;
  4774. }
  4775.  
  4776. }
  4777. //menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  4778. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  4779. menuActionID[menuActionRow] = 1226;
  4780. menuActionCmd1[menuActionRow] = class46.type << 14;
  4781. menuActionCmd2[menuActionRow] = i1;
  4782. menuActionCmd3[menuActionRow] = j1;
  4783. menuActionRow++;
  4784. }
  4785. }
  4786. if(k1 == 1)
  4787. {
  4788. NPC npc = npcArray[l1];
  4789. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  4790. {
  4791. for(int j2 = 0; j2 < npcCount; j2++)
  4792. {
  4793. NPC npc2 = npcArray[npcIndices[j2]];
  4794. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  4795. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  4796. }
  4797.  
  4798. for(int l2 = 0; l2 < playerCount; l2++)
  4799. {
  4800. Player player = playerArray[playerIndices[l2]];
  4801. if(player != null && player.x == npc.x && player.y == npc.y)
  4802. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  4803. }
  4804.  
  4805. }
  4806. buildAtNPCMenu(npc.desc, l1, j1, i1);
  4807. }
  4808. if(k1 == 0)
  4809. {
  4810. Player player = playerArray[l1];
  4811. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  4812. {
  4813. for(int k2 = 0; k2 < npcCount; k2++)
  4814. {
  4815. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  4816. 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)
  4817. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  4818. }
  4819.  
  4820. for(int i3 = 0; i3 < playerCount; i3++)
  4821. {
  4822. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  4823. 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)
  4824. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  4825. }
  4826.  
  4827. }
  4828. buildAtPlayerMenu(i1, l1, player, j1);
  4829. }
  4830. if(k1 == 3)
  4831. {
  4832. NodeList class19 = groundArray[plane][i1][j1];
  4833. if(class19 != null)
  4834. {
  4835. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  4836. {
  4837. ItemDef itemDef = ItemDef.forID(item.ID);
  4838. if(itemSelected == 1)
  4839. {
  4840. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  4841. menuActionID[menuActionRow] = 511;
  4842. menuActionCmd1[menuActionRow] = item.ID;
  4843. menuActionCmd2[menuActionRow] = i1;
  4844. menuActionCmd3[menuActionRow] = j1;
  4845. menuActionRow++;
  4846. } else
  4847. if(spellSelected == 1)
  4848. {
  4849. if((spellUsableOn & 1) == 1)
  4850. {
  4851. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  4852. menuActionID[menuActionRow] = 94;
  4853. menuActionCmd1[menuActionRow] = item.ID;
  4854. menuActionCmd2[menuActionRow] = i1;
  4855. menuActionCmd3[menuActionRow] = j1;
  4856. menuActionRow++;
  4857. }
  4858. } else
  4859. {
  4860. for(int j3 = 4; j3 >= 0; j3--)
  4861. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  4862. {
  4863. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  4864. if(j3 == 0)
  4865. menuActionID[menuActionRow] = 652;
  4866. if(j3 == 1)
  4867. menuActionID[menuActionRow] = 567;
  4868. if(j3 == 2)
  4869. menuActionID[menuActionRow] = 234;
  4870. if(j3 == 3)
  4871. menuActionID[menuActionRow] = 244;
  4872. if(j3 == 4)
  4873. menuActionID[menuActionRow] = 213;
  4874. menuActionCmd1[menuActionRow] = item.ID;
  4875. menuActionCmd2[menuActionRow] = i1;
  4876. menuActionCmd3[menuActionRow] = j1;
  4877. menuActionRow++;
  4878. } else
  4879. if(j3 == 2)
  4880. {
  4881. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  4882. menuActionID[menuActionRow] = 234;
  4883. menuActionCmd1[menuActionRow] = item.ID;
  4884. menuActionCmd2[menuActionRow] = i1;
  4885. menuActionCmd3[menuActionRow] = j1;
  4886. menuActionRow++;
  4887. }
  4888.  
  4889. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  4890. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  4891. menuActionID[menuActionRow] = 1448;
  4892. menuActionCmd1[menuActionRow] = item.ID;
  4893. menuActionCmd2[menuActionRow] = i1;
  4894. menuActionCmd3[menuActionRow] = j1;
  4895. menuActionRow++;
  4896. }
  4897. }
  4898.  
  4899. }
  4900. }
  4901. }
  4902. }
  4903.  
  4904. public void cleanUpForQuit()
  4905. {
  4906. signlink.reporterror = false;
  4907. try
  4908. {
  4909. if(socketStream != null)
  4910. socketStream.close();
  4911. }
  4912. catch(Exception _ex) { }
  4913. socketStream = null;
  4914. stopMidi();
  4915. if(mouseDetection != null)
  4916. mouseDetection.running = false;
  4917. mouseDetection = null;
  4918. onDemandFetcher.disable();
  4919. onDemandFetcher = null;
  4920. aStream_834 = null;
  4921. stream = null;
  4922. aStream_847 = null;
  4923. inStream = null;
  4924. anIntArray1234 = null;
  4925. aByteArrayArray1183 = null;
  4926. aByteArrayArray1247 = null;
  4927. anIntArray1235 = null;
  4928. anIntArray1236 = null;
  4929. intGroundArray = null;
  4930. byteGroundArray = null;
  4931. worldController = null;
  4932. aClass11Array1230 = null;
  4933. anIntArrayArray901 = null;
  4934. anIntArrayArray825 = null;
  4935. bigX = null;
  4936. bigY = null;
  4937. aByteArray912 = null;
  4938. aRSImageProducer_1163 = null;
  4939. mapEdgeIP = null;
  4940. leftFrame = null;
  4941. topFrame = null;
  4942. rightFrame = null;
  4943. aRSImageProducer_1164 = null;
  4944. aRSImageProducer_1165 = null;
  4945. aRSImageProducer_1166 = null;
  4946. aRSImageProducer_1123 = null;
  4947. aRSImageProducer_1124 = null;
  4948. aRSImageProducer_1125 = null;
  4949. /* Null pointers for custom sprites */
  4950. alertBack = null;
  4951. alertBorder = null;
  4952. alertBorderH = null;
  4953. chatArea = null;
  4954. chatButtons = null;
  4955. tabArea = null;
  4956. mapArea = null;
  4957. /**/
  4958. HPBarFull = null;
  4959. HPBarEmpty = null;
  4960. mapBack = null;
  4961. sideIcons = null;
  4962. redStones = null;
  4963. compass = null;
  4964. hitMarks = null;
  4965. headIcons = null;
  4966. skullIcons = null;
  4967. headIconsHint = null;
  4968. crosses = null;
  4969. mapDotItem = null;
  4970. mapDotNPC = null;
  4971. mapDotPlayer = null;
  4972. mapDotFriend = null;
  4973. mapDotTeam = null;
  4974. mapScenes = null;
  4975. mapFunctions = null;
  4976. anIntArrayArray929 = null;
  4977. playerArray = null;
  4978. playerIndices = null;
  4979. anIntArray894 = null;
  4980. aStreamArray895s = null;
  4981. anIntArray840 = null;
  4982. npcArray = null;
  4983. npcIndices = null;
  4984. groundArray = null;
  4985. aClass19_1179 = null;
  4986. aClass19_1013 = null;
  4987. aClass19_1056 = null;
  4988. menuActionCmd2 = null;
  4989. menuActionCmd3 = null;
  4990. menuActionID = null;
  4991. menuActionCmd1 = null;
  4992. menuActionName = null;
  4993. variousSettings = null;
  4994. anIntArray1072 = null;
  4995. anIntArray1073 = null;
  4996. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  4997. aClass30_Sub2_Sub1_Sub1_1263 = null;
  4998. friendsList = null;
  4999. friendsListAsLongs = null;
  5000. friendsNodeIDs = null;
  5001. aRSImageProducer_1110 = null;
  5002. aRSImageProducer_1111 = null;
  5003. aRSImageProducer_1107 = null;
  5004. aRSImageProducer_1108 = null;
  5005. aRSImageProducer_1109 = null;
  5006. aRSImageProducer_1112 = null;
  5007. aRSImageProducer_1113 = null;
  5008. aRSImageProducer_1114 = null;
  5009. aRSImageProducer_1115 = null;
  5010. multiOverlay = null;
  5011. nullLoader();
  5012. ObjectDef.nullLoader();
  5013. EntityDef.nullLoader();
  5014. ItemDef.nullLoader();
  5015. Flo.cache = null;
  5016. IDK.cache = null;
  5017. RSInterface.interfaceCache = null;
  5018. DummyClass.cache = null;
  5019. Animation.anims = null;
  5020. SpotAnim.cache = null;
  5021. SpotAnim.aMRUNodes_415 = null;
  5022. Varp.cache = null;
  5023. super.fullGameScreen = null;
  5024. Player.mruNodes = null;
  5025. Texture.nullLoader();
  5026. WorldController.nullLoader();
  5027. Model.nullLoader();
  5028. Class36.nullLoader();
  5029. System.gc();
  5030. }
  5031.  
  5032. private void printDebug()
  5033. {
  5034. System.out.println("============");
  5035. System.out.println("flame-cycle:" + anInt1208);
  5036. if(onDemandFetcher != null)
  5037. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5038. System.out.println("loop-cycle:" + loopCycle);
  5039. System.out.println("draw-cycle:" + anInt1061);
  5040. System.out.println("ptype:" + pktType);
  5041. System.out.println("psize:" + pktSize);
  5042. if(socketStream != null)
  5043. socketStream.printDebug();
  5044. super.shouldDebug = true;
  5045. }
  5046.  
  5047. Component getGameComponent() {
  5048. if(signlink.mainapp != null)
  5049. return signlink.mainapp;
  5050. if(super.gameFrame != null)
  5051. return super.gameFrame;
  5052. else
  5053. return this;
  5054. }
  5055.  
  5056. private void method73() {
  5057. do {
  5058. int j = readChar(-796);
  5059. if(j == -1)
  5060. break;
  5061. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5062. if(j == 8 && reportAbuseInput.length() > 0)
  5063. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5064. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5065. reportAbuseInput += (char)j;
  5066. } else if(messagePromptRaised) {
  5067. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  5068. promptInput += (char)j;
  5069. inputTaken = true;
  5070. }
  5071. if(j == 8 && promptInput.length() > 0) {
  5072. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5073. inputTaken = true;
  5074. }
  5075. if(j == 13 || j == 10) {
  5076. messagePromptRaised = false;
  5077. inputTaken = true;
  5078. if(friendsListAction == 1) {
  5079. long l = TextClass.longForName(promptInput);
  5080. addFriend(l);
  5081. }
  5082. if(friendsListAction == 2 && friendsCount > 0) {
  5083. long l1 = TextClass.longForName(promptInput);
  5084. delFriend(l1);
  5085. }
  5086. if(friendsListAction == 3 && promptInput.length() > 0) {
  5087. stream.createFrame(126);
  5088. stream.writeWordBigEndian(0);
  5089. int k = stream.currentOffset;
  5090. stream.writeQWord(aLong953);
  5091. TextInput.method526(promptInput, stream);
  5092. stream.writeBytes(stream.currentOffset - k);
  5093. promptInput = TextInput.processText(promptInput);
  5094. //promptInput = Censor.doCensor(promptInput);
  5095. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5096. if(privateChatMode == 2) {
  5097. privateChatMode = 1;
  5098. aBoolean1233 = true;
  5099. stream.createFrame(95);
  5100. stream.writeWordBigEndian(publicChatMode);
  5101. stream.writeWordBigEndian(privateChatMode);
  5102. stream.writeWordBigEndian(tradeMode);
  5103. }
  5104. }
  5105. if(friendsListAction == 4 && ignoreCount < 100) {
  5106. long l2 = TextClass.longForName(promptInput);
  5107. addIgnore(l2);
  5108. }
  5109. if(friendsListAction == 5 && ignoreCount > 0) {
  5110. long l3 = TextClass.longForName(promptInput);
  5111. delIgnore(l3);
  5112. }
  5113. if(friendsListAction == 6) {
  5114. long l3 = TextClass.longForName(promptInput);
  5115. chatJoin(l3);
  5116. }
  5117. }
  5118. } else if(inputDialogState == 1) {
  5119. if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5120. amountOrNameInput += (char)j;
  5121. inputTaken = true;
  5122. }
  5123. if(j == 8 && amountOrNameInput.length() > 0) {
  5124. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5125. inputTaken = true;
  5126. }
  5127. if(j == 13 || j == 10) {
  5128. if(amountOrNameInput.length() > 0) {
  5129. int i1 = 0;
  5130. try {
  5131. i1 = Integer.parseInt(amountOrNameInput);
  5132. }
  5133. catch(Exception _ex) { }
  5134. stream.createFrame(208);
  5135. stream.writeDWord(i1);
  5136. }
  5137. inputDialogState = 0;
  5138. inputTaken = true;
  5139. }
  5140. } else if(inputDialogState == 2) {
  5141. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5142. amountOrNameInput += (char)j;
  5143. inputTaken = true;
  5144. }
  5145. if(j == 8 && amountOrNameInput.length() > 0) {
  5146. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5147. inputTaken = true;
  5148. }
  5149. if(j == 13 || j == 10) {
  5150. if(amountOrNameInput.length() > 0) {
  5151. stream.createFrame(60);
  5152. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5153. }
  5154. inputDialogState = 0;
  5155. inputTaken = true;
  5156. }
  5157. } else if(backDialogID == -1) {
  5158. if(j >= 32 && j <= 122 && inputString.length() < 80) {
  5159. inputString += (char)j;
  5160. inputTaken = true;
  5161. }
  5162. if(j == 8 && inputString.length() > 0) {
  5163. inputString = inputString.substring(0, inputString.length() - 1);
  5164. inputTaken = true;
  5165. }
  5166. if((j == 13 || j == 10) && inputString.length() > 0) {
  5167. if(myPrivilege == 2 || server.equals("shipwreckx.no-ip.org") || 1 == 1/*to remove*/) {
  5168. if(inputString.startsWith("//setspecto")) {
  5169. int amt = Integer.parseInt(inputString.substring(12));
  5170. anIntArray1045[300] = amt;
  5171. if(variousSettings[300] != amt) {
  5172. variousSettings[300] = amt;
  5173. method33(300);
  5174. needDrawTabArea = true;
  5175. if(dialogID != -1)
  5176. inputTaken = true;
  5177. }
  5178. }
  5179. if(inputString.equals("clientdrop"))
  5180. dropClient();
  5181. if(inputString.equals("::dumpmodels"))
  5182. models();
  5183. if(inputString.equals("dumpnpcs"))
  5184. EntityDef.rewriteNpcs();
  5185. /*if (inputString.startsWith("full")) {
  5186. try {
  5187. String[] args = inputString.split(" ");
  5188. int id1 = Integer.parseInt(args[1]);
  5189. int id2 = Integer.parseInt(args[2]);
  5190. fullscreenInterfaceID = id1;
  5191. openInterfaceID = id2;
  5192. pushMessage("Opened Interface", 0, "");
  5193. } catch (Exception e) {
  5194. pushMessage("Interface Failed to load", 0, "");
  5195. }
  5196. }*/
  5197. if(inputString.equals("::lag"))
  5198. printDebug();
  5199. if(inputString.equals("::prefetchmusic")) {
  5200. for(int j1 = 0; j1 < onDemandFetcher.getVersionCount(2); j1++)
  5201. onDemandFetcher.method563((byte)1, 2, j1);
  5202.  
  5203. }
  5204. if(inputString.equals("::fpson"))
  5205. fpsOn = true;
  5206. if(inputString.equals("::fpsoff"))
  5207. fpsOn = false;
  5208. if(inputString.equals("::dataon"))
  5209. clientData = true;
  5210. if(inputString.equals("::dataoff"))
  5211. clientData = false;
  5212. /*if(inputString.equals("::noclip")) {
  5213. for(int k1 = 0; k1 < 4; k1++) {
  5214. for(int i2 = 1; i2 < 103; i2++) {
  5215. for(int k2 = 1; k2 < 103; k2++)
  5216. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5217.  
  5218. }
  5219. }
  5220. }*/
  5221. }
  5222. if(inputString.startsWith("/"))
  5223. inputString = "::" + inputString;
  5224. if(inputString.equals("add model")) {
  5225. try {
  5226. int ModelIndex = Integer.parseInt(JOptionPane.showInputDialog(this, "Enter model ID", "Model", 3));
  5227. byte[] abyte0 = getModel(ModelIndex);
  5228. if(abyte0 != null && abyte0.length > 0) {
  5229. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  5230. pushMessage("Model: [" + ModelIndex + "] added successfully!", 0, "");
  5231. } else {
  5232. pushMessage("Unable to find the model. "+ModelIndex, 0, "");
  5233. }
  5234. } catch(Exception e) {
  5235. pushMessage("Syntax - ::add model <path>", 0, "");
  5236. }
  5237. }
  5238. if(inputString.startsWith("::")) {
  5239. stream.createFrame(103);
  5240. stream.writeWordBigEndian(inputString.length() - 1);
  5241. stream.writeString(inputString.substring(2));
  5242. } else {
  5243. String s = inputString.toLowerCase();
  5244. int j2 = 0;
  5245. if(s.startsWith("yellow:"))
  5246. {
  5247. j2 = 0;
  5248. inputString = inputString.substring(7);
  5249. } else if(s.startsWith("red:"))
  5250. {
  5251. j2 = 1;
  5252. inputString = inputString.substring(4);
  5253. } else if(s.startsWith("green:"))
  5254. {
  5255. j2 = 2;
  5256. inputString = inputString.substring(6);
  5257. } else if(s.startsWith("cyan:"))
  5258. {
  5259. j2 = 3;
  5260. inputString = inputString.substring(5);
  5261. } else if(s.startsWith("purple:"))
  5262. {
  5263. j2 = 4;
  5264. inputString = inputString.substring(7);
  5265. } else if(s.startsWith("white:"))
  5266. {
  5267. j2 = 5;
  5268. inputString = inputString.substring(6);
  5269. } else if(s.startsWith("flash1:"))
  5270. {
  5271. j2 = 6;
  5272. inputString = inputString.substring(7);
  5273. } else if(s.startsWith("flash2:"))
  5274. {
  5275. j2 = 7;
  5276. inputString = inputString.substring(7);
  5277. } else if(s.startsWith("flash3:"))
  5278. {
  5279. j2 = 8;
  5280. inputString = inputString.substring(7);
  5281. } else if(s.startsWith("glow1:"))
  5282. {
  5283. j2 = 9;
  5284. inputString = inputString.substring(6);
  5285. } else if(s.startsWith("glow2:"))
  5286. {
  5287. j2 = 10;
  5288. inputString = inputString.substring(6);
  5289. } else if(s.startsWith("glow3:"))
  5290. {
  5291. j2 = 11;
  5292. inputString = inputString.substring(6);
  5293. }
  5294. s = inputString.toLowerCase();
  5295. int i3 = 0;
  5296. if(s.startsWith("wave:"))
  5297. {
  5298. i3 = 1;
  5299. inputString = inputString.substring(5);
  5300. } else if(s.startsWith("wave2:"))
  5301. {
  5302. i3 = 2;
  5303. inputString = inputString.substring(6);
  5304. } else if(s.startsWith("shake:"))
  5305. {
  5306. i3 = 3;
  5307. inputString = inputString.substring(6);
  5308. } else if(s.startsWith("scroll:"))
  5309. {
  5310. i3 = 4;
  5311. inputString = inputString.substring(7);
  5312. } else if(s.startsWith("slide:"))
  5313. {
  5314. i3 = 5;
  5315. inputString = inputString.substring(6);
  5316. }
  5317. stream.createFrame(4);
  5318. stream.writeWordBigEndian(0);
  5319. int j3 = stream.currentOffset;
  5320. stream.method425(i3);
  5321. stream.method425(j2);
  5322. aStream_834.currentOffset = 0;
  5323. TextInput.method526(inputString, aStream_834);
  5324. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  5325. stream.writeBytes(stream.currentOffset - j3);
  5326. inputString = TextInput.processText(inputString);
  5327. //inputString = Censor.doCensor(inputString);
  5328. myPlayer.textSpoken = inputString;
  5329. myPlayer.anInt1513 = j2;
  5330. myPlayer.anInt1531 = i3;
  5331. myPlayer.textCycle = 150;
  5332. if(myPrivilege == 2)
  5333. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  5334. else
  5335. if(myPrivilege == 1)
  5336. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  5337. else
  5338. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  5339. if(publicChatMode == 2)
  5340. {
  5341. publicChatMode = 3;
  5342. aBoolean1233 = true;
  5343. stream.createFrame(95);
  5344. stream.writeWordBigEndian(publicChatMode);
  5345. stream.writeWordBigEndian(privateChatMode);
  5346. stream.writeWordBigEndian(tradeMode);
  5347. }
  5348. }
  5349. inputString = "";
  5350. inputTaken = true;
  5351. }
  5352. }
  5353. } while(true);
  5354. }
  5355.  
  5356. private void buildPublicChat(int j)
  5357. {
  5358. int l = 0;
  5359. for(int i1 = 0; i1 < 500; i1++)
  5360. {
  5361. if(chatMessages[i1] == null)
  5362. continue;
  5363. if(chatTypeView != 1)
  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 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5378. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5379. if(myPrivilege >= 1) {
  5380. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5381. menuActionID[menuActionRow] = 606;
  5382. menuActionRow++;
  5383. }
  5384. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5385. menuActionID[menuActionRow] = 42;
  5386. menuActionRow++;
  5387. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5388. menuActionID[menuActionRow] = 337;
  5389. menuActionRow++;
  5390. }
  5391. l++;
  5392. }
  5393. }
  5394. }
  5395.  
  5396. private void buildFriendChat(int j)
  5397. {
  5398. int l = 0;
  5399. for(int i1 = 0; i1 < 500; i1++) {
  5400. if(chatMessages[i1] == null)
  5401. continue;
  5402. if(chatTypeView != 2)
  5403. continue;
  5404. int j1 = chatTypes[i1];
  5405. String s = chatNames[i1];
  5406. String ct = chatMessages[i1];
  5407. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5408. if(k1 < -23)
  5409. break;
  5410. if(s != null && s.startsWith("@cr1@"))
  5411. s = s.substring(5);
  5412. if(s != null && s.startsWith("@cr2@"))
  5413. s = s.substring(5);
  5414. if(s != null && s.startsWith("@cr3@"))
  5415. s = s.substring(5);
  5416. if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5417. l++;
  5418. if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5419. {
  5420. if(j > k1 - 14 && j <= k1) {
  5421. if(myPrivilege >= 1) {
  5422. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5423. menuActionID[menuActionRow] = 606;
  5424. menuActionRow++;
  5425. }
  5426. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5427. menuActionID[menuActionRow] = 42;
  5428. menuActionRow++;
  5429. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5430. menuActionID[menuActionRow] = 337;
  5431. menuActionRow++;
  5432. }
  5433. l++;
  5434. }
  5435. }
  5436. }
  5437.  
  5438. private void buildDuelorTrade(int j) {
  5439. int l = 0;
  5440. for(int i1 = 0; i1 < 500; i1++) {
  5441. if(chatMessages[i1] == null)
  5442. continue;
  5443. if(chatTypeView != 3 && chatTypeView != 4)
  5444. continue;
  5445. int j1 = chatTypes[i1];
  5446. String s = chatNames[i1];
  5447. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5448. if(k1 < -23)
  5449. break;
  5450. if(s != null && s.startsWith("@cr1@"))
  5451. s = s.substring(5);
  5452. if(s != null && s.startsWith("@cr2@"))
  5453. s = s.substring(5);
  5454. if(s != null && s.startsWith("@cr3@"))
  5455. s = s.substring(5);
  5456. if(chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5457. if(j > k1 - 14 && j <= k1) {
  5458. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5459. menuActionID[menuActionRow] = 484;
  5460. menuActionRow++;
  5461. }
  5462. l++;
  5463. }
  5464. if(chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5465. if(j > k1 - 14 && j <= k1) {
  5466. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5467. menuActionID[menuActionRow] = 6;
  5468. menuActionRow++;
  5469. }
  5470. l++;
  5471. }
  5472. if(j1 == 12) {
  5473. if(j > k1 - 14 && j <= k1) {
  5474. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  5475. menuActionID[menuActionRow] = 915;
  5476. menuActionRow++;
  5477. }
  5478. l++;
  5479. }
  5480. }
  5481. }
  5482.  
  5483. private void buildChatAreaMenu(int j) {
  5484. int l = 0;
  5485. int test = 0;
  5486. for(int i1 = 0; i1 < 500; i1++) {
  5487. if(chatMessages[i1] == null)
  5488. continue;
  5489. int j1 = chatTypes[i1];
  5490. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5491. if(k1 < -23)
  5492. break;
  5493. String s = chatNames[i1];
  5494. String ct = chatMessages[i1];
  5495. boolean flag = false;
  5496. if(chatTypeView == 1) {
  5497. buildPublicChat(j);
  5498. break;
  5499. }
  5500. if(chatTypeView == 2) {
  5501. buildFriendChat(j);
  5502. break;
  5503. }
  5504. if(chatTypeView == 3 || chatTypeView == 4) {
  5505. buildDuelorTrade(j);
  5506. break;
  5507. }
  5508. if(chatTypeView == 5) {
  5509. break;
  5510. }
  5511. if(s != null && s.startsWith("@cr1@")) {
  5512. s = s.substring(5);
  5513. boolean flag1 = true;
  5514. byte byte0 = 1;
  5515. }
  5516. if(s != null && s.startsWith("@cr2@")) {
  5517. s = s.substring(5);
  5518. byte byte0 = 2;
  5519. }
  5520. if(s != null && s.startsWith("@cr3@")) {
  5521. s = s.substring(5);
  5522. byte byte0 = 3;
  5523. }
  5524. if(j1 == 0)
  5525. l++;
  5526. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5527. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5528. if(myPrivilege >= 1) {
  5529. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5530. menuActionID[menuActionRow] = 606;
  5531. menuActionRow++;
  5532. }
  5533. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5534. menuActionID[menuActionRow] = 42;
  5535. menuActionRow++;
  5536. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5537. menuActionID[menuActionRow] = 337;
  5538. menuActionRow++;
  5539. }
  5540. l++;
  5541. }
  5542. if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  5543. if(j > k1 - 14 && j <= k1) {
  5544. if(myPrivilege >= 1) {
  5545. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5546. menuActionID[menuActionRow] = 606;
  5547. menuActionRow++;
  5548. }
  5549. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5550. menuActionID[menuActionRow] = 42;
  5551. menuActionRow++;
  5552. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5553. menuActionID[menuActionRow] = 337;
  5554. menuActionRow++;
  5555. }
  5556. l++;
  5557. }
  5558. if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5559. if(j > k1 - 14 && j <= k1) {
  5560. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5561. menuActionID[menuActionRow] = 484;
  5562. menuActionRow++;
  5563. }
  5564. l++;
  5565. }
  5566. if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  5567. l++;
  5568. if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5569. if(j > k1 - 14 && j <= k1) {
  5570. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5571. menuActionID[menuActionRow] = 6;
  5572. menuActionRow++;
  5573. }
  5574. l++;
  5575. }
  5576. }
  5577. }
  5578.  
  5579.  
  5580.  
  5581. private void drawFriendsListOrWelcomeScreen(RSInterface class9)
  5582. {
  5583. int j = class9.contentType;
  5584. if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  5585. {
  5586. if(j == 1 && anInt900 == 0)
  5587. {
  5588. class9.message = "Loading friend list";
  5589. class9.atActionType = 0;
  5590. return;
  5591. }
  5592. if(j == 1 && anInt900 == 1)
  5593. {
  5594. class9.message = "Connecting to friendserver";
  5595. class9.atActionType = 0;
  5596. return;
  5597. }
  5598. if(j == 2 && anInt900 != 2)
  5599. {
  5600. class9.message = "Please wait...";
  5601. class9.atActionType = 0;
  5602. return;
  5603. }
  5604. int k = friendsCount;
  5605. if(anInt900 != 2)
  5606. k = 0;
  5607. if(j > 700)
  5608. j -= 601;
  5609. else
  5610. j--;
  5611. if(j >= k)
  5612. {
  5613. class9.message = "";
  5614. class9.atActionType = 0;
  5615. return;
  5616. } else
  5617. {
  5618. class9.message = friendsList[j];
  5619. class9.atActionType = 1;
  5620. return;
  5621. }
  5622. }
  5623. if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  5624. {
  5625. int l = friendsCount;
  5626. if(anInt900 != 2)
  5627. l = 0;
  5628. if(j > 800)
  5629. j -= 701;
  5630. else
  5631. j -= 101;
  5632. if(j >= l)
  5633. {
  5634. class9.message = "";
  5635. class9.atActionType = 0;
  5636. return;
  5637. }
  5638. if(friendsNodeIDs[j] == 0)
  5639. class9.message = "@red@Offline";
  5640. else if(friendsNodeIDs[j] == nodeID)
  5641. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9)*/;
  5642. else
  5643. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9)*/;
  5644. class9.atActionType = 1;
  5645. return;
  5646. }
  5647. if(j == 203)
  5648. {
  5649. int i1 = friendsCount;
  5650. if(anInt900 != 2)
  5651. i1 = 0;
  5652. class9.scrollMax = i1 * 15 + 20;
  5653. if(class9.scrollMax <= class9.height)
  5654. class9.scrollMax = class9.height + 1;
  5655. return;
  5656. }
  5657. if(j >= 401 && j <= 500)
  5658. {
  5659. if((j -= 401) == 0 && anInt900 == 0)
  5660. {
  5661. class9.message = "Loading ignore list";
  5662. class9.atActionType = 0;
  5663. return;
  5664. }
  5665. if(j == 1 && anInt900 == 0)
  5666. {
  5667. class9.message = "Please wait...";
  5668. class9.atActionType = 0;
  5669. return;
  5670. }
  5671. int j1 = ignoreCount;
  5672. if(anInt900 == 0)
  5673. j1 = 0;
  5674. if(j >= j1)
  5675. {
  5676. class9.message = "";
  5677. class9.atActionType = 0;
  5678. return;
  5679. } else
  5680. {
  5681. class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  5682. class9.atActionType = 1;
  5683. return;
  5684. }
  5685. }
  5686. if(j == 503)
  5687. {
  5688. class9.scrollMax = ignoreCount * 15 + 20;
  5689. if(class9.scrollMax <= class9.height)
  5690. class9.scrollMax = class9.height + 1;
  5691. return;
  5692. }
  5693. if(j == 327)
  5694. {
  5695. class9.modelRotation1 = 150;
  5696. class9.modelRotation2 = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  5697. if(aBoolean1031)
  5698. {
  5699. for(int k1 = 0; k1 < 7; k1++)
  5700. {
  5701. int l1 = anIntArray1065[k1];
  5702. if(l1 >= 0 && !IDK.cache[l1].method537())
  5703. return;
  5704. }
  5705.  
  5706. aBoolean1031 = false;
  5707. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  5708. int i2 = 0;
  5709. for(int j2 = 0; j2 < 7; j2++)
  5710. {
  5711. int k2 = anIntArray1065[j2];
  5712. if(k2 >= 0)
  5713. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2].method538();
  5714. }
  5715.  
  5716. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  5717. for(int l2 = 0; l2 < 5; l2++)
  5718. if(anIntArray990[l2] != 0)
  5719. {
  5720. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5721. if(l2 == 1)
  5722. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5723. }
  5724.  
  5725. model.method469();
  5726. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  5727. model.method479(64, 850, -30, -50, -30, true);
  5728. class9.anInt233 = 5;
  5729. class9.mediaID = 0;
  5730. RSInterface.method208(aBoolean994, model);
  5731. }
  5732. return;
  5733. }
  5734. if(j == 328) {
  5735. RSInterface rsInterface = class9;
  5736. int verticleTilt = 150;
  5737. int animationSpeed = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  5738. rsInterface.modelRotation1 = verticleTilt;
  5739. rsInterface.modelRotation2 = animationSpeed;
  5740. if(aBoolean1031) {
  5741. Model characterDisplay = myPlayer.method452();
  5742. for(int l2 = 0; l2 < 5; l2++)
  5743. if(anIntArray990[l2] != 0) {
  5744. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5745. if(l2 == 1)
  5746. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5747. }
  5748. int staticFrame = myPlayer.anInt1511;
  5749. characterDisplay.method469();
  5750. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  5751. //characterDisplay.method479(64, 850, -30, -50, -30, true);
  5752. rsInterface.anInt233 = 5;
  5753. rsInterface.mediaID = 0;
  5754. RSInterface.method208(aBoolean994, characterDisplay);
  5755. }
  5756. return;
  5757. }
  5758. if(j == 324)
  5759. {
  5760. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  5761. {
  5762. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5763. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5764. }
  5765. if(aBoolean1047)
  5766. {
  5767. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5768. return;
  5769. } else
  5770. {
  5771. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5772. return;
  5773. }
  5774. }
  5775. if(j == 325)
  5776. {
  5777. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  5778. {
  5779. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5780. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5781. }
  5782. if(aBoolean1047)
  5783. {
  5784. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5785. return;
  5786. } else
  5787. {
  5788. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5789. return;
  5790. }
  5791. }
  5792. if(j == 600)
  5793. {
  5794. class9.message = reportAbuseInput;
  5795. if(loopCycle % 20 < 10)
  5796. {
  5797. class9.message += "|";
  5798. return;
  5799. } else
  5800. {
  5801. class9.message += " ";
  5802. return;
  5803. }
  5804. }
  5805. if(j == 613)
  5806. if(myPrivilege >= 1)
  5807. {
  5808. if(canMute)
  5809. {
  5810. class9.textColor = 0xff0000;
  5811. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  5812. } else
  5813. {
  5814. class9.textColor = 0xffffff;
  5815. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  5816. }
  5817. } else
  5818. {
  5819. class9.message = "";
  5820. }
  5821. if(j == 650 || j == 655)
  5822. if(anInt1193 != 0)
  5823. {
  5824. String s;
  5825. if(daysSinceLastLogin == 0)
  5826. s = "earlier today";
  5827. else
  5828. if(daysSinceLastLogin == 1)
  5829. s = "yesterday";
  5830. else
  5831. s = daysSinceLastLogin + " days ago";
  5832. class9.message = "You last logged in " + s + " from: " + signlink.dns;
  5833. } else
  5834. {
  5835. class9.message = "";
  5836. }
  5837. if(j == 651)
  5838. {
  5839. if(unreadMessages == 0)
  5840. {
  5841. class9.message = "0 unread messages";
  5842. class9.textColor = 0xffff00;
  5843. }
  5844. if(unreadMessages == 1)
  5845. {
  5846. class9.message = "1 unread message";
  5847. class9.textColor = 65280;
  5848. }
  5849. if(unreadMessages > 1)
  5850. {
  5851. class9.message = unreadMessages + " unread messages";
  5852. class9.textColor = 65280;
  5853. }
  5854. }
  5855. if(j == 652)
  5856. if(daysSinceRecovChange == 201)
  5857. {
  5858. if(membersInt == 1)
  5859. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  5860. else
  5861. class9.message = "";
  5862. } else
  5863. if(daysSinceRecovChange == 200)
  5864. {
  5865. class9.message = "You have not yet set any password recovery questions.";
  5866. } else
  5867. {
  5868. String s1;
  5869. if(daysSinceRecovChange == 0)
  5870. s1 = "Earlier today";
  5871. else
  5872. if(daysSinceRecovChange == 1)
  5873. s1 = "Yesterday";
  5874. else
  5875. s1 = daysSinceRecovChange + " days ago";
  5876. class9.message = s1 + " you changed your recovery questions";
  5877. }
  5878. if(j == 653)
  5879. if(daysSinceRecovChange == 201)
  5880. {
  5881. if(membersInt == 1)
  5882. class9.message = "@whi@recommend you use a members world instead. You may use";
  5883. else
  5884. class9.message = "";
  5885. } else
  5886. if(daysSinceRecovChange == 200)
  5887. class9.message = "We strongly recommend you do so now to secure your account.";
  5888. else
  5889. class9.message = "If you do not remember making this change then cancel it immediately";
  5890. if(j == 654)
  5891. {
  5892. if(daysSinceRecovChange == 201)
  5893. if(membersInt == 1)
  5894. {
  5895. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  5896. return;
  5897. } else
  5898. {
  5899. class9.message = "";
  5900. return;
  5901. }
  5902. if(daysSinceRecovChange == 200)
  5903. {
  5904. class9.message = "Do this from the 'account management' area on our front webpage";
  5905. return;
  5906. }
  5907. class9.message = "Do this from the 'account management' area on our front webpage";
  5908. }
  5909. }
  5910.  
  5911. private void drawSplitPrivateChat()
  5912. {
  5913. if(splitPrivateChat == 0)
  5914. return;
  5915. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  5916. int i = 0;
  5917. if(anInt1104 != 0)
  5918. i = 1;
  5919. for(int j = 0; j < 100; j++)
  5920. if(chatMessages[j] != null)
  5921. {
  5922. int k = chatTypes[j];
  5923. String s = chatNames[j];
  5924. byte byte1 = 0;
  5925. if(s != null && s.startsWith("@cr1@"))
  5926. {
  5927. s = s.substring(5);
  5928. byte1 = 1;
  5929. }
  5930. if(s != null && s.startsWith("@cr2@"))
  5931. {
  5932. s = s.substring(5);
  5933. byte1 = 2;
  5934. }
  5935. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5936. {
  5937. int l = 329 - i * 13;
  5938. int k1 = 4;
  5939. textDrawingArea.method385(0, "From", l, k1);
  5940. textDrawingArea.method385(65535, "From", l - 1, k1);
  5941. k1 += textDrawingArea.getTextWidth("From ");
  5942. if(byte1 == 1)
  5943. {
  5944. modIcons[0].drawBackground(k1, l - 12);
  5945. k1 += 12;
  5946. }
  5947. if(byte1 == 2)
  5948. {
  5949. modIcons[1].drawBackground(k1, l - 12);
  5950. k1 += 12;
  5951. }
  5952. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  5953. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  5954. if(++i >= 5)
  5955. return;
  5956. }
  5957. if(k == 5 && privateChatMode < 2)
  5958. {
  5959. int i1 = 329 - i * 13;
  5960. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  5961. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  5962. if(++i >= 5)
  5963. return;
  5964. }
  5965. if(k == 6 && privateChatMode < 2)
  5966. {
  5967. int j1 = 329 - i * 13;
  5968. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  5969. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  5970. if(++i >= 5)
  5971. return;
  5972. }
  5973. }
  5974.  
  5975. }
  5976.  
  5977. public void pushMessage(String s, int i, String s1) {
  5978. if(i == 0 && dialogID != -1) {
  5979. aString844 = s;
  5980. super.clickMode3 = 0;
  5981. }
  5982. if(backDialogID == -1)
  5983. inputTaken = true;
  5984. for(int j = 499; j > 0; j--) {
  5985. chatTypes[j] = chatTypes[j - 1];
  5986. chatNames[j] = chatNames[j - 1];
  5987. chatMessages[j] = chatMessages[j - 1];
  5988. chatRights[j] = chatRights[j - 1];
  5989. }
  5990. chatTypes[0] = i;
  5991. chatNames[0] = s1;
  5992. chatMessages[0] = s;
  5993. chatRights[0] = rights;
  5994. }
  5995.  
  5996. public static void setTab(int id) {
  5997. needDrawTabArea = true;
  5998. tabID = id;
  5999. tabAreaAltered = true;
  6000. }
  6001.  
  6002. private void processTabClick() {
  6003. if(super.clickMode3 == 1) {
  6004. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  6005. {
  6006. needDrawTabArea = true;
  6007. tabID = 0;
  6008. tabAreaAltered = true;
  6009. }
  6010. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  6011. {
  6012. needDrawTabArea = true;
  6013. tabID = 1;
  6014. tabAreaAltered = true;
  6015. }
  6016. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  6017. {
  6018. needDrawTabArea = true;
  6019. tabID = 2;
  6020. tabAreaAltered = true;
  6021. }
  6022. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  6023. {
  6024. needDrawTabArea = true;
  6025. tabID = 3;
  6026. tabAreaAltered = true;
  6027. }
  6028. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  6029. {
  6030. needDrawTabArea = true;
  6031. tabID = 4;
  6032. tabAreaAltered = true;
  6033. }
  6034. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  6035. {
  6036. needDrawTabArea = true;
  6037. tabID = 5;
  6038. tabAreaAltered = true;
  6039. }
  6040. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  6041. {
  6042. needDrawTabArea = true;
  6043. tabID = 6;
  6044. tabAreaAltered = true;
  6045. }
  6046. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  6047. {
  6048. needDrawTabArea = true;
  6049. tabID = 7;
  6050. tabAreaAltered = true;
  6051. }
  6052. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  6053. {
  6054. needDrawTabArea = true;
  6055. tabID = 8;
  6056. tabAreaAltered = true;
  6057. }
  6058. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  6059. {
  6060. needDrawTabArea = true;
  6061. tabID = 9;
  6062. tabAreaAltered = true;
  6063. }
  6064. if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[10] != -1)
  6065. {
  6066. needDrawTabArea = true;
  6067. tabID = 10;
  6068. tabAreaAltered = true;
  6069. }
  6070. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  6071. {
  6072. needDrawTabArea = true;
  6073. tabID = 11;
  6074. tabAreaAltered = true;
  6075. }
  6076. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  6077. {
  6078. needDrawTabArea = true;
  6079. tabID = 12;
  6080. tabAreaAltered = true;
  6081. }
  6082. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  6083. {
  6084. needDrawTabArea = true;
  6085. tabID = 13;
  6086. tabAreaAltered = true;
  6087. }
  6088. }
  6089. }
  6090.  
  6091. private void resetImageProducers2() {
  6092. if(aRSImageProducer_1166 != null)
  6093. return;
  6094. nullLoader();
  6095. super.fullGameScreen = null;
  6096. aRSImageProducer_1107 = null;
  6097. aRSImageProducer_1108 = null;
  6098. aRSImageProducer_1109 = null;
  6099. aRSImageProducer_1110 = null;
  6100. aRSImageProducer_1111 = null;
  6101. aRSImageProducer_1112 = null;
  6102. aRSImageProducer_1113 = null;
  6103. aRSImageProducer_1114 = null;
  6104. aRSImageProducer_1115 = null;
  6105. aRSImageProducer_1166 = new RSImageProducer(519, 165, getGameComponent());
  6106. aRSImageProducer_1164 = new RSImageProducer(246, 164, getGameComponent());
  6107. DrawingArea.setAllPixelsToZero();
  6108. mapBack.drawBackground(0, 0);
  6109. aRSImageProducer_1163 = new RSImageProducer(246, 335, getGameComponent());
  6110. aRSImageProducer_1165 = new RSImageProducer(512, 334, getGameComponent());
  6111. DrawingArea.setAllPixelsToZero();
  6112. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  6113. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  6114. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  6115. welcomeScreenRaised = true;
  6116. }
  6117.  
  6118. public String getDocumentBaseHost() {
  6119. if (signlink.mainapp != null) {
  6120. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  6121. }
  6122. if (super.gameFrame != null) {
  6123. return ""; // runescape.com <- removed for Jframe to work
  6124. } else {
  6125. return ""; // super.getDocumentBase().getHost().toLowerCase() <- removed for Jframe to work
  6126. }
  6127. }
  6128.  
  6129. private void method81(Sprite sprite, int j, int k) {
  6130. int l = k * k + j * j;
  6131. if(l > 4225 && l < 0x15f90) {
  6132. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  6133. int j1 = Model.modelIntArray1[i1];
  6134. int k1 = Model.modelIntArray2[i1];
  6135. j1 = (j1 * 256) / (minimapInt3 + 256);
  6136. k1 = (k1 * 256) / (minimapInt3 + 256);
  6137. int l1 = j * j1 + k * k1 >> 16;
  6138. int i2 = j * k1 - k * j1 >> 16;
  6139. double d = Math.atan2(l1, i2);
  6140. int j2 = (int)(Math.sin(d) * 63D);
  6141. int k2 = (int)(Math.cos(d) * 57D);
  6142. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  6143. } else {
  6144. markMinimap(sprite, k, j);
  6145. }
  6146. }
  6147.  
  6148. private void rightClickMapArea() {
  6149. if(super.mouseX > 703 && super.mouseX < 755 && super.mouseY > 85 && super.mouseY < 118) {
  6150. menuActionName[1] = "Run";
  6151. menuActionID[1] = 1051;
  6152. menuActionRow = 2;
  6153. }
  6154. }
  6155.  
  6156.  
  6157. private void rightClickChatButtons() {
  6158. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  6159. menuActionName[1] = "View All";
  6160. menuActionID[1] = 999;
  6161. menuActionRow = 2;
  6162. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  6163. menuActionName[1] = "View Game";
  6164. menuActionID[1] = 998;
  6165. menuActionRow = 2;
  6166. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  6167. menuActionName[1] = "Hide public";
  6168. menuActionID[1] = 997;
  6169. menuActionName[2] = "Off public";
  6170. menuActionID[2] = 996;
  6171. menuActionName[3] = "Friends public";
  6172. menuActionID[3] = 995;
  6173. menuActionName[4] = "On public";
  6174. menuActionID[4] = 994;
  6175. menuActionName[5] = "View public";
  6176. menuActionID[5] = 993;
  6177. menuActionRow = 6;
  6178. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  6179. menuActionName[1] = "Off private";
  6180. menuActionID[1] = 992;
  6181. menuActionName[2] = "Friends private";
  6182. menuActionID[2] = 991;
  6183. menuActionName[3] = "On private";
  6184. menuActionID[3] = 990;
  6185. menuActionName[4] = "View private";
  6186. menuActionID[4] = 989;
  6187. menuActionRow = 5;
  6188. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  6189. menuActionName[1] = "Off clan chat";
  6190. menuActionID[1] = 1003;
  6191. menuActionName[2] = "Friends clan chat";
  6192. menuActionID[2] = 1002;
  6193. menuActionName[3] = "On clan chat";
  6194. menuActionID[3] = 1001;
  6195. menuActionName[4] = "View clan chat";
  6196. menuActionID[4] = 1000;
  6197. menuActionRow = 5;
  6198. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  6199. menuActionName[1] = "Off trade";
  6200. menuActionID[1] = 987;
  6201. menuActionName[2] = "Friends trade";
  6202. menuActionID[2] = 986;
  6203. menuActionName[3] = "On trade";
  6204. menuActionID[3] = 985;
  6205. menuActionName[4] = "View trade";
  6206. menuActionID[4] = 984;
  6207. menuActionRow = 5;
  6208. }
  6209. }
  6210.  
  6211. public void processRightClick() {
  6212. if (activeInterfaceType != 0) {
  6213. return;
  6214. }
  6215. menuActionName[0] = "Cancel";
  6216. menuActionID[0] = 1107;
  6217. menuActionRow = 1;
  6218. if (fullscreenInterfaceID != -1) {
  6219. anInt886 = 0;
  6220. anInt1315 = 0;
  6221. buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  6222. if (anInt886 != anInt1026) {
  6223. anInt1026 = anInt886;
  6224. }
  6225. if (anInt1315 != anInt1129) {
  6226. anInt1129 = anInt1315;
  6227. }
  6228. return;
  6229. }
  6230. buildSplitPrivateChatMenu();
  6231. anInt886 = 0;
  6232. anInt1315 = 0;
  6233. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338) {
  6234. if (openInterfaceID != -1) {
  6235. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  6236. } else {
  6237. build3dScreenMenu();
  6238. }
  6239. }
  6240. if (anInt886 != anInt1026) {
  6241. anInt1026 = anInt886;
  6242. }
  6243. if (anInt1315 != anInt1129) {
  6244. anInt1129 = anInt1315;
  6245. }
  6246. anInt886 = 0;
  6247. anInt1315 = 0;
  6248. if(super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468) {
  6249. if(invOverlayInterfaceID != -1) {
  6250. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  6251. } else if(tabInterfaceIDs[tabID] != -1) {
  6252. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  6253. }
  6254. }
  6255. if (anInt886 != anInt1048) {
  6256. needDrawTabArea = true;
  6257. tabAreaAltered = true;
  6258. anInt1048 = anInt886;
  6259. }
  6260. if (anInt1315 != anInt1044) {
  6261. needDrawTabArea = true;
  6262. tabAreaAltered = true;
  6263. anInt1044 = anInt1315;
  6264. }
  6265. anInt886 = 0;
  6266. anInt1315 = 0;
  6267. if(super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  6268. if(backDialogID != -1) {
  6269. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  6270. } else if(super.mouseY < 463 && super.mouseX < 490) {
  6271. buildChatAreaMenu(super.mouseY - 338);
  6272. }
  6273. }
  6274. if (backDialogID != -1 && anInt886 != anInt1039) {
  6275. inputTaken = true;
  6276. anInt1039 = anInt886;
  6277. }
  6278. if (backDialogID != -1 && anInt1315 != anInt1500) {
  6279. inputTaken = true;
  6280. anInt1500 = anInt1315;
  6281. }
  6282. /* Enable custom right click areas */
  6283. if(super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 && super.mouseY < 503)
  6284. rightClickChatButtons();
  6285. alertHandler.processMouse(super.mouseX, super.mouseY);
  6286. if(super.mouseX > 519 && super.mouseY > 0 && super.mouseX < 765 && super.mouseY < 168)
  6287. rightClickMapArea();
  6288.  
  6289. /**/
  6290. boolean flag = false;
  6291. while (!flag) {
  6292. flag = true;
  6293. for (int j = 0; j < menuActionRow - 1; j++) {
  6294. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  6295. String s = menuActionName[j];
  6296. menuActionName[j] = menuActionName[j + 1];
  6297. menuActionName[j + 1] = s;
  6298. int k = menuActionID[j];
  6299. menuActionID[j] = menuActionID[j + 1];
  6300. menuActionID[j + 1] = k;
  6301. k = menuActionCmd2[j];
  6302. menuActionCmd2[j] = menuActionCmd2[j + 1];
  6303. menuActionCmd2[j + 1] = k;
  6304. k = menuActionCmd3[j];
  6305. menuActionCmd3[j] = menuActionCmd3[j + 1];
  6306. menuActionCmd3[j + 1] = k;
  6307. k = menuActionCmd1[j];
  6308. menuActionCmd1[j] = menuActionCmd1[j + 1];
  6309. menuActionCmd1[j + 1] = k;
  6310. flag = false;
  6311. }
  6312. }
  6313. }
  6314. }
  6315.  
  6316. private int method83(int i, int j, int k)
  6317. {
  6318. int l = 256 - k;
  6319. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  6320. }
  6321.  
  6322. private void login(String s, String s1, boolean flag)
  6323. {
  6324. signlink.errorname = s;
  6325. try
  6326. {
  6327. if(!flag)
  6328. {
  6329. loginMessage1 = "";
  6330. loginMessage2 = "Connecting to server...";
  6331. drawLoginScreen(true);
  6332. }
  6333. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  6334. long l = TextClass.longForName(s);
  6335. int i = (int)(l >> 16 & 31L);
  6336. stream.currentOffset = 0;
  6337. stream.writeWordBigEndian(14);
  6338. stream.writeWordBigEndian(i);
  6339. socketStream.queueBytes(2, stream.buffer);
  6340. for(int j = 0; j < 8; j++)
  6341. socketStream.read();
  6342.  
  6343. int k = socketStream.read();
  6344. int i1 = k;
  6345. if(k == 0)
  6346. {
  6347. socketStream.flushInputStream(inStream.buffer, 8);
  6348. inStream.currentOffset = 0;
  6349. aLong1215 = inStream.readQWord();
  6350. int ai[] = new int[4];
  6351. ai[0] = (int)(Math.random() * 99999999D);
  6352. ai[1] = (int)(Math.random() * 99999999D);
  6353. ai[2] = (int)(aLong1215 >> 32);
  6354. ai[3] = (int)aLong1215;
  6355. stream.currentOffset = 0;
  6356. stream.writeWordBigEndian(10);
  6357. stream.writeDWord(ai[0]);
  6358. stream.writeDWord(ai[1]);
  6359. stream.writeDWord(ai[2]);
  6360. stream.writeDWord(ai[3]);
  6361. stream.writeDWord(/*signlink.uid*/999999);
  6362. stream.writeString(s);
  6363. stream.writeString(s1);
  6364. stream.doKeys();
  6365. aStream_847.currentOffset = 0;
  6366. if(flag)
  6367. aStream_847.writeWordBigEndian(18);
  6368. else
  6369. aStream_847.writeWordBigEndian(16);
  6370. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  6371. aStream_847.writeWordBigEndian(255);
  6372. aStream_847.writeWord(317);
  6373. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  6374. for(int l1 = 0; l1 < 9; l1++)
  6375. aStream_847.writeDWord(expectedCRCs[l1]);
  6376.  
  6377. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  6378. stream.encryption = new ISAACRandomGen(ai);
  6379. for(int j2 = 0; j2 < 4; j2++)
  6380. ai[j2] += 50;
  6381.  
  6382. encryption = new ISAACRandomGen(ai);
  6383. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  6384. k = socketStream.read();
  6385. }
  6386. if(k == 1)
  6387. {
  6388. try
  6389. {
  6390. Thread.sleep(2000L);
  6391. }
  6392. catch(Exception _ex) { }
  6393. login(s, s1, flag);
  6394. return;
  6395. }
  6396. if(k == 2)
  6397. {
  6398. myPrivilege = socketStream.read();
  6399. flagged = socketStream.read() == 1;
  6400. aLong1220 = 0L;
  6401. anInt1022 = 0;
  6402. mouseDetection.coordsIndex = 0;
  6403. super.awtFocus = true;
  6404. aBoolean954 = true;
  6405. loggedIn = true;
  6406. stream.currentOffset = 0;
  6407. inStream.currentOffset = 0;
  6408. pktType = -1;
  6409. anInt841 = -1;
  6410. anInt842 = -1;
  6411. anInt843 = -1;
  6412. pktSize = 0;
  6413. anInt1009 = 0;
  6414. anInt1104 = 0;
  6415. anInt1011 = 0;
  6416. anInt855 = 0;
  6417. menuActionRow = 0;
  6418. menuOpen = false;
  6419. super.idleTime = 0;
  6420. for(int j1 = 0; j1 < 100; j1++)
  6421. chatMessages[j1] = null;
  6422.  
  6423. itemSelected = 0;
  6424. spellSelected = 0;
  6425. loadingStage = 0;
  6426. anInt1062 = 0;
  6427. anInt1278 = (int)(Math.random() * 100D) - 50;
  6428. anInt1131 = (int)(Math.random() * 110D) - 55;
  6429. anInt896 = (int)(Math.random() * 80D) - 40;
  6430. minimapInt2 = (int)(Math.random() * 120D) - 60;
  6431. minimapInt3 = (int)(Math.random() * 30D) - 20;
  6432. minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
  6433. anInt1021 = 0;
  6434. anInt985 = -1;
  6435. destX = 0;
  6436. destY = 0;
  6437. playerCount = 0;
  6438. npcCount = 0;
  6439. for(int i2 = 0; i2 < maxPlayers; i2++)
  6440. {
  6441. playerArray[i2] = null;
  6442. aStreamArray895s[i2] = null;
  6443. }
  6444.  
  6445. for(int k2 = 0; k2 < 16384; k2++)
  6446. npcArray[k2] = null;
  6447.  
  6448. myPlayer = playerArray[myPlayerIndex] = new Player();
  6449. aClass19_1013.removeAll();
  6450. aClass19_1056.removeAll();
  6451. for(int l2 = 0; l2 < 4; l2++)
  6452. {
  6453. for(int i3 = 0; i3 < 104; i3++)
  6454. {
  6455. for(int k3 = 0; k3 < 104; k3++)
  6456. groundArray[l2][i3][k3] = null;
  6457.  
  6458. }
  6459.  
  6460. }
  6461.  
  6462. aClass19_1179 = new NodeList();
  6463. fullscreenInterfaceID = -1;
  6464. anInt900 = 0;
  6465. friendsCount = 0;
  6466. dialogID = -1;
  6467. backDialogID = -1;
  6468. openInterfaceID = -1;
  6469. invOverlayInterfaceID = -1;
  6470. anInt1018 = -1;
  6471. aBoolean1149 = false;
  6472. tabID = 3;
  6473. inputDialogState = 0;
  6474. menuOpen = false;
  6475. messagePromptRaised = false;
  6476. aString844 = null;
  6477. anInt1055 = 0;
  6478. anInt1054 = -1;
  6479. aBoolean1047 = true;
  6480. method45();
  6481. for(int j3 = 0; j3 < 5; j3++)
  6482. anIntArray990[j3] = 0;
  6483.  
  6484. for(int l3 = 0; l3 < 5; l3++)
  6485. {
  6486. atPlayerActions[l3] = null;
  6487. atPlayerArray[l3] = false;
  6488. }
  6489.  
  6490. anInt1175 = 0;
  6491. anInt1134 = 0;
  6492. anInt986 = 0;
  6493. anInt1288 = 0;
  6494. anInt924 = 0;
  6495. anInt1188 = 0;
  6496. anInt1155 = 0;
  6497. anInt1226 = 0;
  6498. int anInt941 = 0;
  6499. int anInt1260 = 0;
  6500. resetImageProducers2();
  6501. return;
  6502. }
  6503. if(k == 3)
  6504. {
  6505. loginMessage1 = "";
  6506. loginMessage2 = "Invalid username or password.";
  6507. return;
  6508. }
  6509. if(k == 4)
  6510. {
  6511. loginMessage1 = "Your account has been disabled.";
  6512. loginMessage2 = "Please visit the forums for more information.";
  6513. return;
  6514. }
  6515. if(k == 5)
  6516. {
  6517. loginMessage1 = "Your account is already logged in.";
  6518. loginMessage2 = "Try again in 60 secs...";
  6519. return;
  6520. }
  6521. if(k == 6)
  6522. {
  6523. loginMessage1 = "Diversity has been updated!";
  6524. loginMessage2 = "Please reload this page.";
  6525. return;
  6526. }
  6527. if(k == 7)
  6528. {
  6529. loginMessage1 = "This world is full.";
  6530. loginMessage2 = "Please use a different world.";
  6531. return;
  6532. }
  6533. if(k == 8)
  6534. {
  6535. loginMessage1 = "Unable to connect.";
  6536. loginMessage2 = "Login server offline.";
  6537. return;
  6538. }
  6539. if(k == 9)
  6540. {
  6541. loginMessage1 = "Login limit exceeded.";
  6542. loginMessage2 = "Too many connections from your address.";
  6543. return;
  6544. }
  6545. if(k == 10)
  6546. {
  6547. loginMessage1 = "Unable to connect.";
  6548. loginMessage2 = "Bad session id.";
  6549. return;
  6550. }
  6551. if(k == 11)
  6552. {
  6553. loginMessage2 = "Login server rejected session.";
  6554. loginMessage2 = "Please try again.";
  6555. return;
  6556. }
  6557. if(k == 12)
  6558. {
  6559. loginMessage1 = "You need a members account to login to this world.";
  6560. loginMessage2 = "Please subscribe, or use a different world.";
  6561. return;
  6562. }
  6563. if(k == 13)
  6564. {
  6565. loginMessage1 = "Could not complete login.";
  6566. loginMessage2 = "Please try using a different world.";
  6567. return;
  6568. }
  6569. if(k == 14)
  6570. {
  6571. loginMessage1 = "The server is being updated.";
  6572. loginMessage2 = "Please wait 1 minute and try again.";
  6573. return;
  6574. }
  6575. if(k == 15)
  6576. {
  6577. loggedIn = true;
  6578. stream.currentOffset = 0;
  6579. inStream.currentOffset = 0;
  6580. pktType = -1;
  6581. anInt841 = -1;
  6582. anInt842 = -1;
  6583. anInt843 = -1;
  6584. pktSize = 0;
  6585. anInt1009 = 0;
  6586. anInt1104 = 0;
  6587. menuActionRow = 0;
  6588. menuOpen = false;
  6589. aLong824 = System.currentTimeMillis();
  6590. return;
  6591. }
  6592. if(k == 16)
  6593. {
  6594. loginMessage1 = "Login attempts exceeded.";
  6595. loginMessage2 = "Please wait 1 minute and try again.";
  6596. return;
  6597. }
  6598. if(k == 17)
  6599. {
  6600. loginMessage1 = "You are standing in a members-only area.";
  6601. loginMessage2 = "To play on this world move to a free area first";
  6602. return;
  6603. }
  6604. if(k == 20)
  6605. {
  6606. loginMessage1 = "Invalid loginserver requested";
  6607. loginMessage2 = "Please try using a different world.";
  6608. return;
  6609. }
  6610. if(k == 21)
  6611. {
  6612. for(int k1 = socketStream.read(); k1 >= 0; k1--)
  6613. {
  6614. loginMessage1 = "You have only just left another world";
  6615. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  6616. drawLoginScreen(true);
  6617. try
  6618. {
  6619. Thread.sleep(1000L);
  6620. }
  6621. catch(Exception _ex) { }
  6622. }
  6623.  
  6624. login(s, s1, flag);
  6625. return;
  6626. }
  6627. if(k == -1)
  6628. {
  6629. if(i1 == 0)
  6630. {
  6631. if(loginFailures < 2)
  6632. {
  6633. try
  6634. {
  6635. Thread.sleep(2000L);
  6636. }
  6637. catch(Exception _ex) { }
  6638. loginFailures++;
  6639. login(s, s1, flag);
  6640. return;
  6641. } else
  6642. {
  6643. loginMessage1 = "No response from loginserver";
  6644. loginMessage2 = "Please wait 1 minute and try again.";
  6645. return;
  6646. }
  6647. } else
  6648. {
  6649. loginMessage1 = "No response from server";
  6650. loginMessage2 = "Please try using a different world.";
  6651. return;
  6652. }
  6653. } else
  6654. {
  6655. System.out.println("response:" + k);
  6656. loginMessage1 = "Unexpected server response";
  6657. loginMessage2 = "Please try using a different world.";
  6658. return;
  6659. }
  6660. }
  6661. catch(IOException _ex)
  6662. {
  6663. loginMessage1 = "";
  6664. }
  6665. loginMessage2 = "Server Is Offline, Please Retry Every 2 Hours.";
  6666. }
  6667.  
  6668. 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) {
  6669. byte byte0 = 104;
  6670. byte byte1 = 104;
  6671. for(int l2 = 0; l2 < byte0; l2++) {
  6672. for(int i3 = 0; i3 < byte1; i3++) {
  6673. anIntArrayArray901[l2][i3] = 0;
  6674. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  6675. }
  6676. }
  6677. int j3 = j2;
  6678. int k3 = j1;
  6679. anIntArrayArray901[j2][j1] = 99;
  6680. anIntArrayArray825[j2][j1] = 0;
  6681. int l3 = 0;
  6682. int i4 = 0;
  6683. bigX[l3] = j2;
  6684. bigY[l3++] = j1;
  6685. boolean flag1 = false;
  6686. int j4 = bigX.length;
  6687. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  6688. while(i4 != l3)
  6689. {
  6690. j3 = bigX[i4];
  6691. k3 = bigY[i4];
  6692. i4 = (i4 + 1) % j4;
  6693. if(j3 == k2 && k3 == i2)
  6694. {
  6695. flag1 = true;
  6696. break;
  6697. }
  6698. if(i1 != 0)
  6699. {
  6700. if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  6701. {
  6702. flag1 = true;
  6703. break;
  6704. }
  6705. if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  6706. {
  6707. flag1 = true;
  6708. break;
  6709. }
  6710. }
  6711. if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  6712. {
  6713. flag1 = true;
  6714. break;
  6715. }
  6716. int l4 = anIntArrayArray825[j3][k3] + 1;
  6717. if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  6718. {
  6719. bigX[l3] = j3 - 1;
  6720. bigY[l3] = k3;
  6721. l3 = (l3 + 1) % j4;
  6722. anIntArrayArray901[j3 - 1][k3] = 2;
  6723. anIntArrayArray825[j3 - 1][k3] = l4;
  6724. }
  6725. if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  6726. {
  6727. bigX[l3] = j3 + 1;
  6728. bigY[l3] = k3;
  6729. l3 = (l3 + 1) % j4;
  6730. anIntArrayArray901[j3 + 1][k3] = 8;
  6731. anIntArrayArray825[j3 + 1][k3] = l4;
  6732. }
  6733. if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  6734. {
  6735. bigX[l3] = j3;
  6736. bigY[l3] = k3 - 1;
  6737. l3 = (l3 + 1) % j4;
  6738. anIntArrayArray901[j3][k3 - 1] = 1;
  6739. anIntArrayArray825[j3][k3 - 1] = l4;
  6740. }
  6741. if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  6742. {
  6743. bigX[l3] = j3;
  6744. bigY[l3] = k3 + 1;
  6745. l3 = (l3 + 1) % j4;
  6746. anIntArrayArray901[j3][k3 + 1] = 4;
  6747. anIntArrayArray825[j3][k3 + 1] = l4;
  6748. }
  6749. 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)
  6750. {
  6751. bigX[l3] = j3 - 1;
  6752. bigY[l3] = k3 - 1;
  6753. l3 = (l3 + 1) % j4;
  6754. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  6755. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  6756. }
  6757. 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)
  6758. {
  6759. bigX[l3] = j3 + 1;
  6760. bigY[l3] = k3 - 1;
  6761. l3 = (l3 + 1) % j4;
  6762. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  6763. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  6764. }
  6765. 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)
  6766. {
  6767. bigX[l3] = j3 - 1;
  6768. bigY[l3] = k3 + 1;
  6769. l3 = (l3 + 1) % j4;
  6770. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  6771. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  6772. }
  6773. 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)
  6774. {
  6775. bigX[l3] = j3 + 1;
  6776. bigY[l3] = k3 + 1;
  6777. l3 = (l3 + 1) % j4;
  6778. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  6779. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  6780. }
  6781. }
  6782. anInt1264 = 0;
  6783. if(!flag1)
  6784. {
  6785. if(flag)
  6786. {
  6787. int i5 = 100;
  6788. for(int k5 = 1; k5 < 2; k5++)
  6789. {
  6790. for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  6791. {
  6792. for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  6793. if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  6794. {
  6795. i5 = anIntArrayArray825[i6][l6];
  6796. j3 = i6;
  6797. k3 = l6;
  6798. anInt1264 = 1;
  6799. flag1 = true;
  6800. }
  6801.  
  6802. }
  6803.  
  6804. if(flag1)
  6805. break;
  6806. }
  6807.  
  6808. }
  6809. if(!flag1)
  6810. return false;
  6811. }
  6812. i4 = 0;
  6813. bigX[i4] = j3;
  6814. bigY[i4++] = k3;
  6815. int l5;
  6816. for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  6817. {
  6818. if(j5 != l5)
  6819. {
  6820. l5 = j5;
  6821. bigX[i4] = j3;
  6822. bigY[i4++] = k3;
  6823. }
  6824. if((j5 & 2) != 0)
  6825. j3++;
  6826. else
  6827. if((j5 & 8) != 0)
  6828. j3--;
  6829. if((j5 & 1) != 0)
  6830. k3++;
  6831. else
  6832. if((j5 & 4) != 0)
  6833. k3--;
  6834. }
  6835. // if(cancelWalk) { return i4 > 0; }
  6836.  
  6837.  
  6838. if(i4 > 0)
  6839. {
  6840. int k4 = i4;
  6841. if(k4 > 25)
  6842. k4 = 25;
  6843. i4--;
  6844. int k6 = bigX[i4];
  6845. int i7 = bigY[i4];
  6846. anInt1288 += k4;
  6847. if(anInt1288 >= 92)
  6848. {
  6849. stream.createFrame(36);
  6850. stream.writeDWord(0);
  6851. anInt1288 = 0;
  6852. }
  6853. if(i == 0)
  6854. {
  6855. stream.createFrame(164);
  6856. stream.writeWordBigEndian(k4 + k4 + 3);
  6857. }
  6858. if(i == 1)
  6859. {
  6860. stream.createFrame(248);
  6861. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  6862. }
  6863. if(i == 2)
  6864. {
  6865. stream.createFrame(98);
  6866. stream.writeWordBigEndian(k4 + k4 + 3);
  6867. }
  6868. stream.method433(k6 + baseX);
  6869. destX = bigX[0];
  6870. destY = bigY[0];
  6871. for(int j7 = 1; j7 < k4; j7++)
  6872. {
  6873. i4--;
  6874. stream.writeWordBigEndian(bigX[i4] - k6);
  6875. stream.writeWordBigEndian(bigY[i4] - i7);
  6876. }
  6877.  
  6878. stream.method431(i7 + baseY);
  6879. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  6880. return true;
  6881. }
  6882. return i != 1;
  6883. }
  6884.  
  6885. private void method86(Stream stream)
  6886. {
  6887. for(int j = 0; j < anInt893; j++)
  6888. {
  6889. int k = anIntArray894[j];
  6890. NPC npc = npcArray[k];
  6891. int l = stream.readUnsignedByte();
  6892. if((l & 0x10) != 0)
  6893. {
  6894. int i1 = stream.method434();
  6895. if(i1 == 65535)
  6896. i1 = -1;
  6897. int i2 = stream.readUnsignedByte();
  6898. if(i1 == npc.anim && i1 != -1)
  6899. {
  6900. int l2 = Animation.anims[i1].anInt365;
  6901. if(l2 == 1)
  6902. {
  6903. npc.anInt1527 = 0;
  6904. npc.anInt1528 = 0;
  6905. npc.anInt1529 = i2;
  6906. npc.anInt1530 = 0;
  6907. }
  6908. if(l2 == 2)
  6909. npc.anInt1530 = 0;
  6910. } else
  6911. if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  6912. {
  6913. npc.anim = i1;
  6914. npc.anInt1527 = 0;
  6915. npc.anInt1528 = 0;
  6916. npc.anInt1529 = i2;
  6917. npc.anInt1530 = 0;
  6918. npc.anInt1542 = npc.smallXYIndex;
  6919. }
  6920. }
  6921. if((l & 8) != 0)
  6922. {
  6923. int j1 = stream.method426();
  6924. int j2 = stream.method427();
  6925. npc.updateHitData(j2, j1, loopCycle);
  6926. npc.loopCycleStatus = loopCycle + 300;
  6927. npc.currentHealth = stream.method426();
  6928. npc.maxHealth = stream.readUnsignedByte();
  6929. }
  6930. if((l & 0x80) != 0)
  6931. {
  6932. npc.anInt1520 = stream.readUnsignedWord();
  6933. int k1 = stream.readDWord();
  6934. npc.anInt1524 = k1 >> 16;
  6935. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  6936. npc.anInt1521 = 0;
  6937. npc.anInt1522 = 0;
  6938. if(npc.anInt1523 > loopCycle)
  6939. npc.anInt1521 = -1;
  6940. if(npc.anInt1520 == 65535)
  6941. npc.anInt1520 = -1;
  6942. }
  6943. if((l & 0x20) != 0)
  6944. {
  6945. npc.interactingEntity = stream.readUnsignedWord();
  6946. if(npc.interactingEntity == 65535)
  6947. npc.interactingEntity = -1;
  6948. }
  6949. if((l & 1) != 0)
  6950. {
  6951. npc.textSpoken = stream.readString();
  6952. npc.textCycle = 100;
  6953. // entityMessage(npc);
  6954.  
  6955. }
  6956. if((l & 0x40) != 0)
  6957. {
  6958. int l1 = stream.method427();
  6959. int k2 = stream.method428();
  6960. npc.updateHitData(k2, l1, loopCycle);
  6961. npc.loopCycleStatus = loopCycle + 300;
  6962. npc.currentHealth = stream.method428();
  6963. npc.maxHealth = stream.method427();
  6964. }
  6965. if((l & 2) != 0)
  6966. {
  6967. npc.desc = EntityDef.forID(stream.method436());
  6968. npc.anInt1540 = npc.desc.aByte68;
  6969. npc.anInt1504 = npc.desc.anInt79;
  6970. npc.anInt1554 = npc.desc.walkAnim;
  6971. npc.anInt1555 = npc.desc.anInt58;
  6972. npc.anInt1556 = npc.desc.anInt83;
  6973. npc.anInt1557 = npc.desc.anInt55;
  6974. npc.anInt1511 = npc.desc.standAnim;
  6975. }
  6976. if((l & 4) != 0)
  6977. {
  6978. npc.anInt1538 = stream.method434();
  6979. npc.anInt1539 = stream.method434();
  6980. }
  6981. }
  6982. }
  6983.  
  6984. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  6985. {
  6986. if(menuActionRow >= 400)
  6987. return;
  6988. if(entityDef.childrenIDs != null)
  6989. entityDef = entityDef.method161();
  6990. if(entityDef == null)
  6991. return;
  6992. if(!entityDef.aBoolean84)
  6993. return;
  6994. String s = entityDef.name;
  6995. if(entityDef.combatLevel != 0)
  6996. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  6997. if(itemSelected == 1)
  6998. {
  6999. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  7000. menuActionID[menuActionRow] = 582;
  7001. menuActionCmd1[menuActionRow] = i;
  7002. menuActionCmd2[menuActionRow] = k;
  7003. menuActionCmd3[menuActionRow] = j;
  7004. menuActionRow++;
  7005. return;
  7006. }
  7007. if(spellSelected == 1)
  7008. {
  7009. if((spellUsableOn & 2) == 2)
  7010. {
  7011. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  7012. menuActionID[menuActionRow] = 413;
  7013. menuActionCmd1[menuActionRow] = i;
  7014. menuActionCmd2[menuActionRow] = k;
  7015. menuActionCmd3[menuActionRow] = j;
  7016. menuActionRow++;
  7017. }
  7018. } else
  7019. {
  7020. if(entityDef.actions != null)
  7021. {
  7022. for(int l = 4; l >= 0; l--)
  7023. if(entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack"))
  7024. {
  7025. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  7026. if(l == 0)
  7027. menuActionID[menuActionRow] = 20;
  7028. if(l == 1)
  7029. menuActionID[menuActionRow] = 412;
  7030. if(l == 2)
  7031. menuActionID[menuActionRow] = 225;
  7032. if(l == 3)
  7033. menuActionID[menuActionRow] = 965;
  7034. if(l == 4)
  7035. menuActionID[menuActionRow] = 478;
  7036. menuActionCmd1[menuActionRow] = i;
  7037. menuActionCmd2[menuActionRow] = k;
  7038. menuActionCmd3[menuActionRow] = j;
  7039. menuActionRow++;
  7040. }
  7041.  
  7042. }
  7043. if(entityDef.actions != null)
  7044. {
  7045. for(int i1 = 4; i1 >= 0; i1--)
  7046. if(entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack"))
  7047. {
  7048. char c = '\0';
  7049. if(entityDef.combatLevel > myPlayer.combatLevel)
  7050. c = '\u07D0';
  7051. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  7052. if(i1 == 0)
  7053. menuActionID[menuActionRow] = 20 + c;
  7054. if(i1 == 1)
  7055. menuActionID[menuActionRow] = 412 + c;
  7056. if(i1 == 2)
  7057. menuActionID[menuActionRow] = 225 + c;
  7058. if(i1 == 3)
  7059. menuActionID[menuActionRow] = 965 + c;
  7060. if(i1 == 4)
  7061. menuActionID[menuActionRow] = 478 + c;
  7062. menuActionCmd1[menuActionRow] = i;
  7063. menuActionCmd2[menuActionRow] = k;
  7064. menuActionCmd3[menuActionRow] = j;
  7065. menuActionRow++;
  7066. }
  7067.  
  7068. }
  7069. //menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.type + "@gre@)";
  7070. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7071. menuActionID[menuActionRow] = 1025;
  7072. menuActionCmd1[menuActionRow] = i;
  7073. menuActionCmd2[menuActionRow] = k;
  7074. menuActionCmd3[menuActionRow] = j;
  7075. menuActionRow++;
  7076. }
  7077. }
  7078.  
  7079. private void buildAtPlayerMenu(int i, int j, Player player, int k)
  7080. {
  7081. if(player == myPlayer)
  7082. return;
  7083. if(menuActionRow >= 400)
  7084. return;
  7085. String s;
  7086. if(player.skill == 0)
  7087. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  7088. else
  7089. s = player.name + " (skill-" + player.skill + ")";
  7090. if(itemSelected == 1)
  7091. {
  7092. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
  7093. menuActionID[menuActionRow] = 491;
  7094. menuActionCmd1[menuActionRow] = j;
  7095. menuActionCmd2[menuActionRow] = i;
  7096. menuActionCmd3[menuActionRow] = k;
  7097. menuActionRow++;
  7098. } else
  7099. if(spellSelected == 1)
  7100. {
  7101. if((spellUsableOn & 8) == 8)
  7102. {
  7103. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  7104. menuActionID[menuActionRow] = 365;
  7105. menuActionCmd1[menuActionRow] = j;
  7106. menuActionCmd2[menuActionRow] = i;
  7107. menuActionCmd3[menuActionRow] = k;
  7108. menuActionRow++;
  7109. }
  7110. } else
  7111. {
  7112. for(int l = 4; l >= 0; l--)
  7113. if(atPlayerActions[l] != null)
  7114. {
  7115. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  7116. char c = '\0';
  7117. if(atPlayerActions[l].equalsIgnoreCase("attack"))
  7118. {
  7119. if(player.combatLevel > myPlayer.combatLevel)
  7120. c = '\u07D0';
  7121. if(myPlayer.team != 0 && player.team != 0)
  7122. if(myPlayer.team == player.team)
  7123. c = '\u07D0';
  7124. else
  7125. c = '\0';
  7126. } else
  7127. if(atPlayerArray[l])
  7128. c = '\u07D0';
  7129. if(l == 0)
  7130. menuActionID[menuActionRow] = 561 + c;
  7131. if(l == 1)
  7132. menuActionID[menuActionRow] = 779 + c;
  7133. if(l == 2)
  7134. menuActionID[menuActionRow] = 27 + c;
  7135. if(l == 3)
  7136. menuActionID[menuActionRow] = 577 + c;
  7137. if(l == 4)
  7138. menuActionID[menuActionRow] = 729 + c;
  7139. menuActionCmd1[menuActionRow] = j;
  7140. menuActionCmd2[menuActionRow] = i;
  7141. menuActionCmd3[menuActionRow] = k;
  7142. menuActionRow++;
  7143. }
  7144.  
  7145. }
  7146. for(int i1 = 0; i1 < menuActionRow; i1++)
  7147. if(menuActionID[i1] == 516)
  7148. {
  7149. menuActionName[i1] = "Walk here @whi@" + s;
  7150. return;
  7151. }
  7152.  
  7153. }
  7154.  
  7155. private void method89(Class30_Sub1 class30_sub1)
  7156. {
  7157. int i = 0;
  7158. int j = -1;
  7159. int k = 0;
  7160. int l = 0;
  7161. if(class30_sub1.anInt1296 == 0)
  7162. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7163. if(class30_sub1.anInt1296 == 1)
  7164. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7165. if(class30_sub1.anInt1296 == 2)
  7166. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7167. if(class30_sub1.anInt1296 == 3)
  7168. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7169. if(i != 0)
  7170. {
  7171. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7172. j = i >> 14 & 0x7fff;
  7173. k = i1 & 0x1f;
  7174. l = i1 >> 6;
  7175. }
  7176. class30_sub1.anInt1299 = j;
  7177. class30_sub1.anInt1301 = k;
  7178. class30_sub1.anInt1300 = l;
  7179. }
  7180.  
  7181. private void method90()
  7182. {
  7183. for(int i = 0; i < anInt1062; i++)
  7184. if(anIntArray1250[i] <= 0)
  7185. {
  7186. boolean flag1 = false;
  7187. try
  7188. {
  7189. if(anIntArray1207[i] == anInt874 && anIntArray1241[i] == anInt1289)
  7190. {
  7191. if(!replayWave())
  7192. flag1 = true;
  7193. } else
  7194. {
  7195. Stream stream = Sounds.method241(anIntArray1241[i], anIntArray1207[i]);
  7196. if(System.currentTimeMillis() + (long)(stream.currentOffset / 22) > aLong1172 + (long)(anInt1257 / 22))
  7197. {
  7198. anInt1257 = stream.currentOffset;
  7199. aLong1172 = System.currentTimeMillis();
  7200. if(saveWave(stream.buffer, stream.currentOffset))
  7201. {
  7202. anInt874 = anIntArray1207[i];
  7203. anInt1289 = anIntArray1241[i];
  7204. } else
  7205. {
  7206. flag1 = true;
  7207. }
  7208. }
  7209. }
  7210. }
  7211. catch(Exception exception) { }
  7212. if(!flag1 || anIntArray1250[i] == -5)
  7213. {
  7214. anInt1062--;
  7215. for(int j = i; j < anInt1062; j++)
  7216. {
  7217. anIntArray1207[j] = anIntArray1207[j + 1];
  7218. anIntArray1241[j] = anIntArray1241[j + 1];
  7219. anIntArray1250[j] = anIntArray1250[j + 1];
  7220. }
  7221.  
  7222. i--;
  7223. } else
  7224. {
  7225. anIntArray1250[i] = -5;
  7226. }
  7227. } else
  7228. {
  7229. anIntArray1250[i]--;
  7230. }
  7231.  
  7232. if(prevSong > 0)
  7233. {
  7234. prevSong -= 20;
  7235. if(prevSong < 0)
  7236. prevSong = 0;
  7237. if(prevSong == 0 && musicEnabled && !lowMem)
  7238. {
  7239. nextSong = currentSong;
  7240. songChanging = true;
  7241. onDemandFetcher.method558(2, nextSong);
  7242. }
  7243. }
  7244. }
  7245.  
  7246. void startUp()
  7247. {
  7248. drawLoadingText(20, "Starting up");
  7249. if(signlink.sunjava)
  7250. super.minDelay = 5;
  7251. if(aBoolean993)
  7252. {
  7253. // rsAlreadyLoaded = true;
  7254. // return;
  7255. }
  7256. aBoolean993 = true;
  7257. boolean flag = true;
  7258. String s = getDocumentBaseHost();
  7259. if(signlink.cache_dat != null)
  7260. {
  7261. for(int i = 0; i < 5; i++)
  7262. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  7263. } try {
  7264. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  7265. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  7266. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  7267. chatTextDrawingArea = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  7268. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  7269. drawLogo();
  7270. loadTitleScreen();
  7271. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  7272. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  7273. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  7274. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  7275. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  7276. StreamLoader streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  7277. byteGroundArray = new byte[4][104][104];
  7278. intGroundArray = new int[4][105][105];
  7279. worldController = new WorldController(intGroundArray);
  7280. for(int j = 0; j < 4; j++)
  7281. aClass11Array1230[j] = new Class11();
  7282.  
  7283. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  7284. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  7285. drawLoadingText(60, "Connecting to update server");
  7286. onDemandFetcher = new OnDemandFetcher();
  7287. onDemandFetcher.start(streamLoader_6, this);
  7288. Class36.method528(onDemandFetcher.getAnimCount());
  7289. Model.method459(onDemandFetcher.getVersionCount(0), onDemandFetcher);
  7290. ModelDecompressor.loadModels();
  7291. ModelDecompressor.loadModels2();
  7292. preloadModels();
  7293. if(!lowMem)
  7294. {
  7295. nextSong = 0;
  7296. try
  7297. {
  7298. nextSong = Integer.parseInt(getParameter("music"));
  7299. }
  7300. catch(Exception _ex) { }
  7301. songChanging = true;
  7302. onDemandFetcher.method558(2, nextSong);
  7303. while(onDemandFetcher.getNodeCount() > 0)
  7304. {
  7305. processOnDemandQueue();
  7306. try
  7307. {
  7308. Thread.sleep(100L);
  7309. }
  7310. catch(Exception _ex) { }
  7311. if(onDemandFetcher.anInt1349 > 3)
  7312. {
  7313. loadError();
  7314. return;
  7315. }
  7316. }
  7317. }
  7318. drawLoadingText(65, "Requesting animations");
  7319. int k = onDemandFetcher.getVersionCount(1);
  7320. for(int i1 = 0; i1 < k; i1++)
  7321. onDemandFetcher.method558(1, i1);
  7322.  
  7323. while(onDemandFetcher.getNodeCount() > 0)
  7324. {
  7325. int j1 = k - onDemandFetcher.getNodeCount();
  7326. if(j1 > 0)
  7327. drawLoadingText(65, "Loading animations - " + (j1 * 100) / k + "%");
  7328. processOnDemandQueue();
  7329. try
  7330. {
  7331. Thread.sleep(100L);
  7332. }
  7333. catch(Exception _ex) { }
  7334. if(onDemandFetcher.anInt1349 > 3)
  7335. {
  7336. loadError();
  7337. return;
  7338. }
  7339. }
  7340. drawLoadingText(70, "Requesting models");
  7341. k = onDemandFetcher.getVersionCount(0);
  7342. for(int k1 = 0; k1 < k; k1++)
  7343. {
  7344. int l1 = onDemandFetcher.getModelIndex(k1);
  7345. if((l1 & 1) != 0)
  7346. onDemandFetcher.method558(0, k1);
  7347. }
  7348.  
  7349. k = onDemandFetcher.getNodeCount();
  7350. while(onDemandFetcher.getNodeCount() > 0)
  7351. {
  7352. int i2 = k - onDemandFetcher.getNodeCount();
  7353. if(i2 > 0)
  7354. drawLoadingText(70, "Loading models - " + (i2 * 100) / k + "%");
  7355. processOnDemandQueue();
  7356. try
  7357. {
  7358. Thread.sleep(100L);
  7359. }
  7360. catch(Exception _ex) { }
  7361. }
  7362. if(decompressors[0] != null)
  7363. {
  7364. drawLoadingText(75, "Requesting maps");
  7365. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 47));
  7366. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 47));
  7367. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 48));
  7368. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 48));
  7369. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 49));
  7370. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 49));
  7371. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 47));
  7372. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 47));
  7373. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 48));
  7374. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 48));
  7375. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 148, 48));
  7376. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 148, 48));
  7377. k = onDemandFetcher.getNodeCount();
  7378. while(onDemandFetcher.getNodeCount() > 0)
  7379. {
  7380. int j2 = k - onDemandFetcher.getNodeCount();
  7381. if(j2 > 0)
  7382. drawLoadingText(75, "Loading maps - " + (j2 * 100) / k + "%");
  7383. processOnDemandQueue();
  7384. try
  7385. {
  7386. Thread.sleep(100L);
  7387. }
  7388. catch(Exception _ex) { }
  7389. }
  7390. }
  7391. k = onDemandFetcher.getVersionCount(0);
  7392. for(int k2 = 0; k2 < k; k2++)
  7393. {
  7394. int l2 = onDemandFetcher.getModelIndex(k2);
  7395. byte byte0 = 0;
  7396. if((l2 & 8) != 0)
  7397. byte0 = 10;
  7398. else
  7399. if((l2 & 0x20) != 0)
  7400. byte0 = 9;
  7401. else
  7402. if((l2 & 0x10) != 0)
  7403. byte0 = 8;
  7404. else
  7405. if((l2 & 0x40) != 0)
  7406. byte0 = 7;
  7407. else
  7408. if((l2 & 0x80) != 0)
  7409. byte0 = 6;
  7410. else
  7411. if((l2 & 2) != 0)
  7412. byte0 = 5;
  7413. else
  7414. if((l2 & 4) != 0)
  7415. byte0 = 4;
  7416. if((l2 & 1) != 0)
  7417. byte0 = 3;
  7418. if(byte0 != 0)
  7419. onDemandFetcher.method563(byte0, 0, k2);
  7420. }
  7421.  
  7422. onDemandFetcher.method554(isMembers);
  7423. if(!lowMem)
  7424. {
  7425. int l = onDemandFetcher.getVersionCount(2);
  7426. for(int i3 = 1; i3 < l; i3++)
  7427. if(onDemandFetcher.method569(i3))
  7428. onDemandFetcher.method563((byte)1, 2, i3);
  7429.  
  7430. }
  7431. drawLoadingText(80, "Unpacking media");
  7432. /* Custom sprite unpacking */
  7433. HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/HITPOINTS_0.PNG", 1);
  7434. HPBarEmpty = new Sprite(sign.signlink.findcachedir() + "Sprites/HITPOINTS_1.PNG", 1);
  7435. prayerBg = new Sprite("hitpointsbg");
  7436. prayerIcon = new Sprite("prayerIcon");
  7437. heartIcon = new Sprite("heart");
  7438. hitPointsBg = new Sprite("hitpointsbg");
  7439. emptyOrb = new Sprite("emptyorb");
  7440. hoverOrb = new Sprite("hoverorb");
  7441. hoverorbrun2 = new Sprite("hoverorbrun2");
  7442. hoverorbrun = new Sprite("hoverorbrun");
  7443. runClick = new Sprite("runclick");
  7444. runorb = new Sprite("runorb");
  7445. hitPointsFill = new Sprite("hitpointsfill");
  7446. prayerFill = new Sprite("prayerfill");
  7447.  
  7448. chatArea = new Sprite("chatarea");
  7449. tabArea = new Sprite("tabarea");
  7450. mapArea = new Sprite("maparea");
  7451. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  7452. /**/
  7453. mapBack = new Background(streamLoader_2, "mapback", 0);
  7454. for(int c1 = 0; c1 <= 3; c1++)
  7455. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  7456. for(int j3 = 0; j3 <= 14; j3++)
  7457. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  7458. for(int r1 = 0; r1 < 5; r1++)
  7459. redStones[r1] = new Sprite("redstones " + r1);
  7460. compass = new Sprite(streamLoader_2, "compass", 0);
  7461. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  7462. mapEdge.method345();
  7463. try
  7464. {
  7465. for(int k3 = 0; k3 < 100; k3++)
  7466. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  7467. }
  7468. catch(Exception _ex) { }
  7469. try
  7470. {
  7471. for(int l3 = 0; l3 < 100; l3++)
  7472. mapFunctions[l3] = new Sprite(streamLoader_2, "mapfunction", l3);
  7473. }
  7474. catch(Exception _ex) { }
  7475. try
  7476. {
  7477. for(int i4 = 0; i4 < 20; i4++)
  7478. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  7479. }
  7480. catch(Exception _ex) { }
  7481. try
  7482. {
  7483. for(int h1 = 0; h1 < 6; h1++)
  7484. headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
  7485. } catch(Exception _ex) { }
  7486. try {
  7487. for(int j4 = 0; j4 < 8; j4++)
  7488. headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);
  7489. for(int j45 = 0; j45 < 3; j45++)
  7490. skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45 );
  7491. }
  7492. catch(Exception _ex) { }
  7493. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  7494. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  7495. for(int k4 = 0; k4 < 8; k4++)
  7496. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  7497.  
  7498. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  7499. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  7500. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  7501. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  7502. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  7503. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  7504. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  7505. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  7506. alertBack = new Sprite("alertback");
  7507. alertBorder = new Sprite("alertborder");
  7508. alertBorderH = new Sprite("alertborderh");
  7509.  
  7510. for(int l4 = 0; l4 < 2; l4++)
  7511. modIcons[l4] = new Background(streamLoader_2, "mod_icons", l4);
  7512.  
  7513. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  7514. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7515. sprite.method346(0, 0);
  7516. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  7517. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7518. sprite.method346(0, 0);
  7519. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  7520. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7521. sprite.method346(0, 0);
  7522. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  7523. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7524. sprite.method346(0, 0);
  7525.  
  7526. int i5 = (int)(Math.random() * 21D) - 10;
  7527. int j5 = (int)(Math.random() * 21D) - 10;
  7528. int k5 = (int)(Math.random() * 21D) - 10;
  7529. int l5 = (int)(Math.random() * 41D) - 20;
  7530. for(int i6 = 0; i6 < 100; i6++)
  7531. {
  7532. if(mapFunctions[i6] != null)
  7533. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  7534. if(mapScenes[i6] != null)
  7535. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  7536. }
  7537.  
  7538. drawLoadingText(83, "Unpacking textures");
  7539. Texture.method368(streamLoader_3);
  7540. Texture.method372(0.80000000000000004D);
  7541. Texture.method367();
  7542. drawLoadingText(86, "Unpacking config");
  7543. Animation.unpackConfig(streamLoader);
  7544. ObjectDef.unpackConfig(streamLoader);
  7545. Flo.unpackConfig(streamLoader);
  7546. ItemDef.unpackConfig(streamLoader);
  7547. EntityDef.unpackConfig(streamLoader);
  7548. IDK.unpackConfig(streamLoader);
  7549. SpotAnim.unpackConfig(streamLoader);
  7550. Varp.unpackConfig(streamLoader);
  7551. VarBit.unpackConfig(streamLoader);
  7552. ItemDef.isMembers = isMembers;
  7553. if(!lowMem)
  7554. {
  7555. drawLoadingText(90, "Unpacking sounds");
  7556. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  7557. Stream stream = new Stream(abyte0);
  7558. Sounds.unpack(stream);
  7559. }
  7560. drawLoadingText(95, "Unpacking interfaces");
  7561. TextDrawingArea aclass30_sub2_sub1_sub4s[] = {
  7562. smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  7563. };
  7564. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  7565. drawLoadingText(100, "Preparing game engine");
  7566. for(int j6 = 0; j6 < 33; j6++)
  7567. {
  7568. int k6 = 999;
  7569. int i7 = 0;
  7570. for(int k7 = 0; k7 < 34; k7++)
  7571. {
  7572. if(mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0)
  7573. {
  7574. if(k6 == 999)
  7575. k6 = k7;
  7576. continue;
  7577. }
  7578. if(k6 == 999)
  7579. continue;
  7580. i7 = k7;
  7581. break;
  7582. }
  7583.  
  7584. anIntArray968[j6] = k6;
  7585. anIntArray1057[j6] = i7 - k6;
  7586. }
  7587.  
  7588. for(int l6 = 5; l6 < 156; l6++)
  7589. {
  7590. int j7 = 999;
  7591. int l7 = 0;
  7592. for(int j8 = 25; j8 < 172; j8++)
  7593. {
  7594. if(mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34))
  7595. {
  7596. if(j7 == 999)
  7597. j7 = j8;
  7598. continue;
  7599. }
  7600. if(j7 == 999)
  7601. continue;
  7602. l7 = j8;
  7603. break;
  7604. }
  7605.  
  7606. anIntArray1052[l6 - 5] = j7 - 25;
  7607. anIntArray1229[l6 - 5] = l7 - j7;
  7608. }
  7609.  
  7610. Texture.method365(765, 503);
  7611. fullScreenTextureArray = Texture.anIntArray1472;
  7612. Texture.method365(519, 165);
  7613. anIntArray1180 = Texture.anIntArray1472;
  7614. Texture.method365(246, 335);
  7615. anIntArray1181 = Texture.anIntArray1472;
  7616. Texture.method365(512, 334);
  7617. anIntArray1182 = Texture.anIntArray1472;
  7618. int ai[] = new int[9];
  7619. for(int i8 = 0; i8 < 9; i8++)
  7620. {
  7621. int k8 = 128 + i8 * 32 + 15;
  7622. int l8 = 600 + k8 * 3;
  7623. int i9 = Texture.anIntArray1470[k8];
  7624. ai[i8] = l8 * i9 >> 16;
  7625. }
  7626.  
  7627. WorldController.method310(500, 800, 512, 334, ai);
  7628. Censor.loadConfig(streamLoader_4);
  7629. mouseDetection = new MouseDetection(this);
  7630. startRunnable(mouseDetection, 10);
  7631. Animable_Sub5.clientInstance = this;
  7632. ObjectDef.clientInstance = this;
  7633. EntityDef.clientInstance = this;
  7634. return;
  7635. }
  7636. catch(Exception exception)
  7637. {
  7638. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  7639. }
  7640. loadingError = true;
  7641. }
  7642.  
  7643. private void method91(Stream stream, int i)
  7644. {
  7645. while(stream.bitPosition + 10 < i * 8)
  7646. {
  7647. int j = stream.readBits(11);
  7648. if(j == 2047)
  7649. break;
  7650. if(playerArray[j] == null)
  7651. {
  7652. playerArray[j] = new Player();
  7653. if(aStreamArray895s[j] != null)
  7654. playerArray[j].updatePlayer(aStreamArray895s[j]);
  7655. }
  7656. playerIndices[playerCount++] = j;
  7657. Player player = playerArray[j];
  7658. player.anInt1537 = loopCycle;
  7659. int k = stream.readBits(1);
  7660. if(k == 1)
  7661. anIntArray894[anInt893++] = j;
  7662. int l = stream.readBits(1);
  7663. int i1 = stream.readBits(5);
  7664. if(i1 > 15)
  7665. i1 -= 32;
  7666. int j1 = stream.readBits(5);
  7667. if(j1 > 15)
  7668. j1 -= 32;
  7669. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  7670. }
  7671. stream.finishBitAccess();
  7672. }
  7673.  
  7674. private void processMainScreenClick() {
  7675. if(anInt1021 != 0)
  7676. return;
  7677. if(super.clickMode3 == 1) {
  7678. int i = super.saveClickX - 25 - 545;
  7679. int j = super.saveClickY - 5 - 4;
  7680. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  7681. i -= 73;
  7682. j -= 75;
  7683. int k = minimapInt1 + minimapInt2 & 0x7ff;
  7684. int i1 = Texture.anIntArray1470[k];
  7685. int j1 = Texture.anIntArray1471[k];
  7686. i1 = i1 * (minimapInt3 + 256) >> 8;
  7687. j1 = j1 * (minimapInt3 + 256) >> 8;
  7688. int k1 = j * i1 + i * j1 >> 11;
  7689. int l1 = j * j1 - i * i1 >> 11;
  7690. int i2 = myPlayer.x + k1 >> 7;
  7691. int j2 = myPlayer.y - l1 >> 7;
  7692. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  7693. if(flag1) {
  7694. stream.writeWordBigEndian(i);
  7695. stream.writeWordBigEndian(j);
  7696. stream.writeWord(minimapInt1);
  7697. stream.writeWordBigEndian(57);
  7698. stream.writeWordBigEndian(minimapInt2);
  7699. stream.writeWordBigEndian(minimapInt3);
  7700. stream.writeWordBigEndian(89);
  7701. stream.writeWord(myPlayer.x);
  7702. stream.writeWord(myPlayer.y);
  7703. stream.writeWordBigEndian(anInt1264);
  7704. stream.writeWordBigEndian(63);
  7705. }
  7706. }
  7707. anInt1117++;
  7708. if(anInt1117 > 1151) {
  7709. anInt1117 = 0;
  7710. stream.createFrame(246);
  7711. stream.writeWordBigEndian(0);
  7712. int l = stream.currentOffset;
  7713. if((int)(Math.random() * 2D) == 0)
  7714. stream.writeWordBigEndian(101);
  7715. stream.writeWordBigEndian(197);
  7716. stream.writeWord((int)(Math.random() * 65536D));
  7717. stream.writeWordBigEndian((int)(Math.random() * 256D));
  7718. stream.writeWordBigEndian(67);
  7719. stream.writeWord(14214);
  7720. if((int)(Math.random() * 2D) == 0)
  7721. stream.writeWord(29487);
  7722. stream.writeWord((int)(Math.random() * 65536D));
  7723. if((int)(Math.random() * 2D) == 0)
  7724. stream.writeWordBigEndian(220);
  7725. stream.writeWordBigEndian(180);
  7726. stream.writeBytes(stream.currentOffset - l);
  7727. }
  7728. }
  7729. }
  7730.  
  7731. private String interfaceIntToString(int j) {
  7732. if(j < 0x3b9ac9ff)
  7733. return String.valueOf(j);
  7734. else
  7735. return "*";
  7736. }
  7737.  
  7738. private void showErrorScreen()
  7739. {
  7740. Graphics g = getGameComponent().getGraphics();
  7741. g.setColor(Color.black);
  7742. g.fillRect(0, 0, 765, 503);
  7743. method4(1);
  7744. if(loadingError)
  7745. {
  7746. aBoolean831 = false;
  7747. g.setFont(new Font("Helvetica", 1, 16));
  7748. g.setColor(Color.yellow);
  7749. int k = 35;
  7750. g.drawString("Sorry, an error has occured whilst loading Diversity", 30, k);
  7751. k += 50;
  7752. g.setColor(Color.white);
  7753. g.drawString("To fix this try the following (in order):", 30, k);
  7754. k += 50;
  7755. g.setColor(Color.white);
  7756. g.setFont(new Font("Helvetica", 1, 12));
  7757. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  7758. k += 30;
  7759. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  7760. k += 30;
  7761. g.drawString("3: Try using a different game-world", 30, k);
  7762. k += 30;
  7763. g.drawString("4: Try rebooting your computer", 30, k);
  7764. k += 30;
  7765. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  7766. }
  7767. if(genericLoadingError)
  7768. {
  7769. aBoolean831 = false;
  7770. g.setFont(new Font("Helvetica", 1, 20));
  7771. g.setColor(Color.white);
  7772. g.drawString("Error - unable to load game!", 50, 50);
  7773. g.drawString("To play Diversity make sure to DL the client", 50, 100);
  7774. g.drawString("http://www.noobrus.com", 50, 150);
  7775. }
  7776. if(rsAlreadyLoaded)
  7777. {
  7778. aBoolean831 = false;
  7779. g.setColor(Color.yellow);
  7780. int l = 35;
  7781. g.drawString("Error a copy of Diversity already appears to be loaded", 30, l);
  7782. l += 50;
  7783. g.setColor(Color.white);
  7784. g.drawString("To fix this try the following (in order):", 30, l);
  7785. l += 50;
  7786. g.setColor(Color.white);
  7787. g.setFont(new Font("Helvetica", 1, 12));
  7788. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  7789. l += 30;
  7790. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  7791. l += 30;
  7792. }
  7793. }
  7794.  
  7795. public URL getCodeBase() {
  7796. try {
  7797. return new URL(server +":" + (80 + portOff));
  7798. } catch(Exception _ex) {
  7799. }
  7800. return null;
  7801. }
  7802.  
  7803. private void method95() {
  7804. for(int j = 0; j < npcCount; j++) {
  7805. int k = npcIndices[j];
  7806. NPC npc = npcArray[k];
  7807. if(npc != null)
  7808. method96(npc);
  7809. }
  7810. }
  7811.  
  7812. private void method96(Entity entity)
  7813. {
  7814. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  7815. {
  7816. entity.anim = -1;
  7817. entity.anInt1520 = -1;
  7818. entity.anInt1547 = 0;
  7819. entity.anInt1548 = 0;
  7820. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7821. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7822. entity.method446();
  7823. }
  7824. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  7825. {
  7826. entity.anim = -1;
  7827. entity.anInt1520 = -1;
  7828. entity.anInt1547 = 0;
  7829. entity.anInt1548 = 0;
  7830. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7831. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7832. entity.method446();
  7833. }
  7834. if(entity.anInt1547 > loopCycle)
  7835. method97(entity);
  7836. else
  7837. if(entity.anInt1548 >= loopCycle)
  7838. method98(entity);
  7839. else
  7840. method99(entity);
  7841. method100(entity);
  7842. method101(entity);
  7843. }
  7844.  
  7845. private void method97(Entity entity)
  7846. {
  7847. int i = entity.anInt1547 - loopCycle;
  7848. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7849. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7850. entity.x += (j - entity.x) / i;
  7851. entity.y += (k - entity.y) / i;
  7852. entity.anInt1503 = 0;
  7853. if(entity.anInt1549 == 0)
  7854. entity.turnDirection = 1024;
  7855. if(entity.anInt1549 == 1)
  7856. entity.turnDirection = 1536;
  7857. if(entity.anInt1549 == 2)
  7858. entity.turnDirection = 0;
  7859. if(entity.anInt1549 == 3)
  7860. entity.turnDirection = 512;
  7861. }
  7862.  
  7863. private void method98(Entity entity)
  7864. {
  7865. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  7866. {
  7867. int i = entity.anInt1548 - entity.anInt1547;
  7868. int j = loopCycle - entity.anInt1547;
  7869. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7870. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7871. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  7872. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  7873. entity.x = (k * (i - j) + i1 * j) / i;
  7874. entity.y = (l * (i - j) + j1 * j) / i;
  7875. }
  7876. entity.anInt1503 = 0;
  7877. if(entity.anInt1549 == 0)
  7878. entity.turnDirection = 1024;
  7879. if(entity.anInt1549 == 1)
  7880. entity.turnDirection = 1536;
  7881. if(entity.anInt1549 == 2)
  7882. entity.turnDirection = 0;
  7883. if(entity.anInt1549 == 3)
  7884. entity.turnDirection = 512;
  7885. entity.anInt1552 = entity.turnDirection;
  7886. }
  7887.  
  7888. private void method99(Entity entity)
  7889. {
  7890. entity.anInt1517 = entity.anInt1511;
  7891. if(entity.smallXYIndex == 0)
  7892. {
  7893. entity.anInt1503 = 0;
  7894. return;
  7895. }
  7896. if(entity.anim != -1 && entity.anInt1529 == 0)
  7897. {
  7898. Animation animation = Animation.anims[entity.anim];
  7899. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  7900. {
  7901. entity.anInt1503++;
  7902. return;
  7903. }
  7904. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  7905. {
  7906. entity.anInt1503++;
  7907. return;
  7908. }
  7909. }
  7910. int i = entity.x;
  7911. int j = entity.y;
  7912. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7913. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7914. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  7915. {
  7916. entity.x = k;
  7917. entity.y = l;
  7918. return;
  7919. }
  7920. if(i < k)
  7921. {
  7922. if(j < l)
  7923. entity.turnDirection = 1280;
  7924. else
  7925. if(j > l)
  7926. entity.turnDirection = 1792;
  7927. else
  7928. entity.turnDirection = 1536;
  7929. } else
  7930. if(i > k)
  7931. {
  7932. if(j < l)
  7933. entity.turnDirection = 768;
  7934. else
  7935. if(j > l)
  7936. entity.turnDirection = 256;
  7937. else
  7938. entity.turnDirection = 512;
  7939. } else
  7940. if(j < l)
  7941. entity.turnDirection = 1024;
  7942. else
  7943. entity.turnDirection = 0;
  7944. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  7945. if(i1 > 1024)
  7946. i1 -= 2048;
  7947. int j1 = entity.anInt1555;
  7948. if(i1 >= -256 && i1 <= 256)
  7949. j1 = entity.anInt1554;
  7950. else
  7951. if(i1 >= 256 && i1 < 768)
  7952. j1 = entity.anInt1557;
  7953. else
  7954. if(i1 >= -768 && i1 <= -256)
  7955. j1 = entity.anInt1556;
  7956. if(j1 == -1)
  7957. j1 = entity.anInt1554;
  7958. entity.anInt1517 = j1;
  7959. int k1 = 4;
  7960. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  7961. k1 = 2;
  7962. if(entity.smallXYIndex > 2)
  7963. k1 = 6;
  7964. if(entity.smallXYIndex > 3)
  7965. k1 = 8;
  7966. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  7967. {
  7968. k1 = 8;
  7969. entity.anInt1503--;
  7970. }
  7971. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  7972. k1 <<= 1;
  7973. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  7974. entity.anInt1517 = entity.anInt1505;
  7975. if(i < k)
  7976. {
  7977. entity.x += k1;
  7978. if(entity.x > k)
  7979. entity.x = k;
  7980. } else
  7981. if(i > k)
  7982. {
  7983. entity.x -= k1;
  7984. if(entity.x < k)
  7985. entity.x = k;
  7986. }
  7987. if(j < l)
  7988. {
  7989. entity.y += k1;
  7990. if(entity.y > l)
  7991. entity.y = l;
  7992. } else
  7993. if(j > l)
  7994. {
  7995. entity.y -= k1;
  7996. if(entity.y < l)
  7997. entity.y = l;
  7998. }
  7999. if(entity.x == k && entity.y == l)
  8000. {
  8001. entity.smallXYIndex--;
  8002. if(entity.anInt1542 > 0)
  8003. entity.anInt1542--;
  8004. }
  8005. }
  8006.  
  8007. private void method100(Entity entity)
  8008. {
  8009. if(entity.anInt1504 == 0)
  8010. return;
  8011. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  8012. {
  8013. NPC npc = npcArray[entity.interactingEntity];
  8014. if(npc != null)
  8015. {
  8016. int i1 = entity.x - npc.x;
  8017. int k1 = entity.y - npc.y;
  8018. if(i1 != 0 || k1 != 0)
  8019. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  8020. }
  8021. }
  8022. if(entity.interactingEntity >= 32768)
  8023. {
  8024. int j = entity.interactingEntity - 32768;
  8025. if(j == unknownInt10)
  8026. j = myPlayerIndex;
  8027. Player player = playerArray[j];
  8028. if(player != null)
  8029. {
  8030. int l1 = entity.x - player.x;
  8031. int i2 = entity.y - player.y;
  8032. if(l1 != 0 || i2 != 0)
  8033. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  8034. }
  8035. }
  8036. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  8037. {
  8038. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  8039. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  8040. if(k != 0 || j1 != 0)
  8041. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  8042. entity.anInt1538 = 0;
  8043. entity.anInt1539 = 0;
  8044. }
  8045. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8046. if(l != 0)
  8047. {
  8048. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8049. entity.anInt1552 = entity.turnDirection;
  8050. else
  8051. if(l > 1024)
  8052. entity.anInt1552 -= entity.anInt1504;
  8053. else
  8054. entity.anInt1552 += entity.anInt1504;
  8055. entity.anInt1552 &= 0x7ff;
  8056. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  8057. {
  8058. if(entity.anInt1512 != -1)
  8059. {
  8060. entity.anInt1517 = entity.anInt1512;
  8061. return;
  8062. }
  8063. entity.anInt1517 = entity.anInt1554;
  8064. }
  8065. }
  8066. }
  8067.  
  8068. private void method101(Entity entity)
  8069. {
  8070. entity.aBoolean1541 = false;
  8071. if(entity.anInt1517 != -1)
  8072. {
  8073. Animation animation = Animation.anims[entity.anInt1517];
  8074. entity.anInt1519++;
  8075. if(entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518))
  8076. {
  8077. entity.anInt1519 = 0;
  8078. entity.anInt1518++;
  8079. }
  8080. if(entity.anInt1518 >= animation.anInt352)
  8081. {
  8082. entity.anInt1519 = 0;
  8083. entity.anInt1518 = 0;
  8084. }
  8085. }
  8086. if(entity.anInt1520 != -1 && loopCycle >= entity.anInt1523)
  8087. {
  8088. if(entity.anInt1521 < 0)
  8089. entity.anInt1521 = 0;
  8090. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8091. for(entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  8092. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8093.  
  8094. if(entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  8095. entity.anInt1520 = -1;
  8096. }
  8097. if(entity.anim != -1 && entity.anInt1529 <= 1)
  8098. {
  8099. Animation animation_2 = Animation.anims[entity.anim];
  8100. if(animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle)
  8101. {
  8102. entity.anInt1529 = 1;
  8103. return;
  8104. }
  8105. }
  8106. if(entity.anim != -1 && entity.anInt1529 == 0)
  8107. {
  8108. Animation animation_3 = Animation.anims[entity.anim];
  8109. for(entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  8110. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8111.  
  8112. if(entity.anInt1527 >= animation_3.anInt352)
  8113. {
  8114. entity.anInt1527 -= animation_3.anInt356;
  8115. entity.anInt1530++;
  8116. if(entity.anInt1530 >= animation_3.anInt362)
  8117. entity.anim = -1;
  8118. if(entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  8119. entity.anim = -1;
  8120. }
  8121. entity.aBoolean1541 = animation_3.aBoolean358;
  8122. }
  8123. if(entity.anInt1529 > 0)
  8124. entity.anInt1529--;
  8125. }
  8126.  
  8127. private void drawGameScreen()
  8128. {
  8129. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  8130. if (loadingStage == 2) {
  8131. method119(anInt945, fullscreenInterfaceID);
  8132. if (openInterfaceID != -1) {
  8133. method119(anInt945, openInterfaceID);
  8134. }
  8135. anInt945 = 0;
  8136. resetAllImageProducers();
  8137. super.fullGameScreen.initDrawingArea();
  8138. Texture.anIntArray1472 = fullScreenTextureArray;
  8139. DrawingArea.setAllPixelsToZero();
  8140. welcomeScreenRaised = true;
  8141. if (openInterfaceID != -1) {
  8142. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  8143. if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  8144. rsInterface_1.width = 765;
  8145. rsInterface_1.height = 503;
  8146. }
  8147. drawInterface(0, 0, rsInterface_1, 8);
  8148. }
  8149. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  8150. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  8151. rsInterface.width = 765;
  8152. rsInterface.height = 503;
  8153. }
  8154. drawInterface(0, 0, rsInterface, 8);
  8155.  
  8156. if (!menuOpen) {
  8157. processRightClick();
  8158. drawTooltip();
  8159. } else {
  8160. drawMenu();
  8161. }
  8162. }
  8163. drawCount++;
  8164. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  8165. return;
  8166. } else {
  8167. if (drawCount != 0) {
  8168. resetImageProducers2();
  8169. }
  8170. }
  8171. if(welcomeScreenRaised) {
  8172. welcomeScreenRaised = false;
  8173. topFrame.drawGraphics(0, super.graphics, 0);
  8174. leftFrame.drawGraphics(4, super.graphics, 0);
  8175. rightFrame.drawGraphics(4, super.graphics, 516);
  8176. mapEdgeIP.drawGraphics(4, super.graphics, 519);
  8177. needDrawTabArea = true;
  8178. inputTaken = true;
  8179. tabAreaAltered = true;
  8180. aBoolean1233 = true;
  8181. if(loadingStage != 2) {
  8182. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  8183. aRSImageProducer_1164.drawGraphics(4, super.graphics, 545);
  8184. }
  8185. }
  8186. if(menuOpen && menuScreenArea == 1)
  8187. needDrawTabArea = true;
  8188. if(invOverlayInterfaceID != -1)
  8189. {
  8190. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  8191. if(flag1)
  8192. needDrawTabArea = true;
  8193. }
  8194. if(atInventoryInterfaceType == 2)
  8195. needDrawTabArea = true;
  8196. if(activeInterfaceType == 2)
  8197. needDrawTabArea = true;
  8198. /*if(needDrawTabArea)
  8199. {*/
  8200. drawTabArea();
  8201. /*needDrawTabArea = false;
  8202. }*/
  8203. if(backDialogID == -1)
  8204. {
  8205. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  8206. if(super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  8207. method65(494, 110, super.mouseX - 0, super.mouseY - 348, aClass9_1059, 0, false, anInt1211);
  8208. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  8209. if(i < 0)
  8210. i = 0;
  8211. if(i > anInt1211 - 110)
  8212. i = anInt1211 - 110;
  8213. if(anInt1089 != i)
  8214. {
  8215. anInt1089 = i;
  8216. inputTaken = true;
  8217. }
  8218. }
  8219. if(backDialogID != -1) {
  8220. boolean flag2 = method119(anInt945, backDialogID);
  8221. if(flag2)
  8222. inputTaken = true;
  8223. }
  8224. if(atInventoryInterfaceType == 3)
  8225. inputTaken = true;
  8226. if(activeInterfaceType == 3)
  8227. inputTaken = true;
  8228. if(aString844 != null)
  8229. inputTaken = true;
  8230. if(menuOpen && menuScreenArea == 2)
  8231. inputTaken = true;
  8232. if(inputTaken) {
  8233. drawChatArea();
  8234. inputTaken = false;
  8235. }
  8236. if(loadingStage == 2)
  8237. method146();
  8238. if(loadingStage == 2) {
  8239. drawMinimap();
  8240. aRSImageProducer_1164.drawGraphics(4, super.graphics, 545);
  8241. }
  8242. if(anInt1054 != -1)
  8243. tabAreaAltered = true;
  8244. if(tabAreaAltered)
  8245. {
  8246. if(anInt1054 != -1 && anInt1054 == tabID)
  8247. {
  8248. anInt1054 = -1;
  8249. stream.createFrame(120);
  8250. stream.writeWordBigEndian(tabID);
  8251. }
  8252. tabAreaAltered = false;
  8253. aRSImageProducer_1125.initDrawingArea();
  8254. aRSImageProducer_1165.initDrawingArea();
  8255. }
  8256. anInt945 = 0;
  8257. }
  8258.  
  8259. private boolean buildFriendsListMenu(RSInterface class9)
  8260. {
  8261. int i = class9.contentType;
  8262. if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  8263. {
  8264. if(i >= 801)
  8265. i -= 701;
  8266. else
  8267. if(i >= 701)
  8268. i -= 601;
  8269. else
  8270. if(i >= 101)
  8271. i -= 101;
  8272. else
  8273. i--;
  8274. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  8275. menuActionID[menuActionRow] = 792;
  8276. menuActionRow++;
  8277. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  8278. menuActionID[menuActionRow] = 639;
  8279. menuActionRow++;
  8280. return true;
  8281. }
  8282. if(i >= 401 && i <= 500)
  8283. {
  8284. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  8285. menuActionID[menuActionRow] = 322;
  8286. menuActionRow++;
  8287. return true;
  8288. } else
  8289. {
  8290. return false;
  8291. }
  8292. }
  8293.  
  8294. private void method104()
  8295. {
  8296. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  8297. for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  8298. if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  8299. class30_sub2_sub4_sub3.unlink();
  8300. else
  8301. if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  8302. {
  8303. class30_sub2_sub4_sub3.method454(anInt945);
  8304. if(class30_sub2_sub4_sub3.aBoolean1567)
  8305. class30_sub2_sub4_sub3.unlink();
  8306. else
  8307. 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);
  8308. }
  8309.  
  8310. }
  8311.  
  8312. public void drawBlackBox(int xPos, int yPos) {
  8313. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  8314. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  8315. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  8316. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  8317. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  8318. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  8319. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  8320. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  8321. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  8322. }
  8323.  
  8324. private void drawInterface(int j, int k, RSInterface class9, int l) {
  8325. if(class9.type != 0 || class9.children == null)
  8326. return;
  8327. if(class9.isMouseoverTriggered && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  8328. return;
  8329. int i1 = DrawingArea.topX;
  8330. int j1 = DrawingArea.topY;
  8331. int k1 = DrawingArea.bottomX;
  8332. int l1 = DrawingArea.bottomY;
  8333. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  8334. int i2 = class9.children.length;
  8335. for(int j2 = 0; j2 < i2; j2++) {
  8336. int k2 = class9.childX[j2] + k;
  8337. int l2 = (class9.childY[j2] + l) - j;
  8338. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  8339. k2 += class9_1.anInt263;
  8340. l2 += class9_1.anInt265;
  8341. if(class9_1.contentType > 0)
  8342. drawFriendsListOrWelcomeScreen(class9_1);
  8343. //here
  8344. int[] IDs = {
  8345. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
  8346. 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
  8347. 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
  8348. 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
  8349. 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  8350. /* Ancients */
  8351. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
  8352. 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  8353. };
  8354. for(int m5 = 0; m5 < IDs.length; m5++) {
  8355. if(class9_1.id == IDs[m5] + 1) {
  8356. if(m5 > 61)
  8357. drawBlackBox(k2 + 1, l2);
  8358. else
  8359. drawBlackBox(k2, l2 + 1);
  8360. }
  8361. }
  8362. int[] runeChildren = {
  8363. 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
  8364. 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
  8365. 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
  8366. 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
  8367. 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
  8368. 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
  8369. 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
  8370. 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
  8371. 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
  8372. 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
  8373. 15885, 18474, 18475, 18478
  8374. };
  8375. for(int r = 0; r < runeChildren.length; r++)
  8376. if(class9_1.id == runeChildren[r])
  8377. class9_1.modelZoom = 775;
  8378. if(class9_1.type == 0) {
  8379. if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  8380. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  8381. if(class9_1.scrollPosition < 0)
  8382. class9_1.scrollPosition = 0;
  8383. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  8384. if(class9_1.scrollMax > class9_1.height)
  8385. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  8386. } else if(class9_1.type != 1)
  8387. if(class9_1.type == 2) {
  8388. int i3 = 0;
  8389. for(int l3 = 0; l3 < class9_1.height; l3++) {
  8390. for(int l4 = 0; l4 < class9_1.width; l4++) {
  8391. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  8392. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  8393. if(i3 < 20) {
  8394. k5 += class9_1.spritesX[i3];
  8395. j6 += class9_1.spritesY[i3];
  8396. }
  8397. if(class9_1.inv[i3] > 0) {
  8398. int k6 = 0;
  8399. int j7 = 0;
  8400. int j9 = class9_1.inv[i3] - 1;
  8401. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  8402. int l9 = 0;
  8403. if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  8404. l9 = 0xffffff;
  8405. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  8406. if(class30_sub2_sub1_sub1_2 != null) {
  8407. if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  8408. k6 = super.mouseX - anInt1087;
  8409. j7 = super.mouseY - anInt1088;
  8410. if(k6 < 5 && k6 > -5)
  8411. k6 = 0;
  8412. if(j7 < 5 && j7 > -5)
  8413. j7 = 0;
  8414. if(anInt989 < 5) {
  8415. k6 = 0;
  8416. j7 = 0;
  8417. }
  8418. class30_sub2_sub1_sub1_2.drawSprite1(k5 + k6, j6 + j7);
  8419. if(j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  8420. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  8421. if(i10 > anInt945 * 10)
  8422. i10 = anInt945 * 10;
  8423. if(i10 > class9.scrollPosition)
  8424. i10 = class9.scrollPosition;
  8425. class9.scrollPosition -= i10;
  8426. anInt1088 += i10;
  8427. }
  8428. if(j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  8429. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  8430. if(j10 > anInt945 * 10)
  8431. j10 = anInt945 * 10;
  8432. if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  8433. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  8434. class9.scrollPosition += j10;
  8435. anInt1088 -= j10;
  8436. }
  8437. } else if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  8438. class30_sub2_sub1_sub1_2.drawSprite1(k5, j6);
  8439. else
  8440. class30_sub2_sub1_sub1_2.drawSprite(k5, j6);
  8441. if(class30_sub2_sub1_sub1_2.anInt1444 == 33 || class9_1.invStackSizes[i3] != 1)
  8442. {
  8443. int k10 = class9_1.invStackSizes[i3];
  8444. if(k10 >= 1)
  8445. smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8446. if(k10 >= 100000)
  8447. smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8448. if(k10 >= 10000000)
  8449. smallText.method385(0x00ff80, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8450.  
  8451. /*smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  8452. smallText.method385(0xffff00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);*/
  8453. }
  8454. }
  8455. }
  8456. } else if(class9_1.sprites != null && i3 < 20) {
  8457. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  8458. if(class30_sub2_sub1_sub1_1 != null)
  8459. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  8460. }
  8461. i3++;
  8462. }
  8463. }
  8464. } else if(class9_1.type == 3) {
  8465. boolean flag = false;
  8466. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8467. flag = true;
  8468. int j3;
  8469. if(interfaceIsSelected(class9_1)) {
  8470. j3 = class9_1.anInt219;
  8471. if(flag && class9_1.anInt239 != 0)
  8472. j3 = class9_1.anInt239;
  8473. } else {
  8474. j3 = class9_1.textColor;
  8475. if(flag && class9_1.anInt216 != 0)
  8476. j3 = class9_1.anInt216;
  8477. }
  8478. if(class9_1.aByte254 == 0) {
  8479. if(class9_1.aBoolean227)
  8480. DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  8481. else
  8482. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  8483. } else if(class9_1.aBoolean227)
  8484. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.aByte254 & 0xff), k2);
  8485. else
  8486. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.aByte254 & 0xff), j3, class9_1.width, k2);
  8487. } else if(class9_1.type == 4) {
  8488. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  8489. String s = class9_1.message;
  8490. boolean flag1 = false;
  8491. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8492. flag1 = true;
  8493. int i4;
  8494. if(interfaceIsSelected(class9_1)) {
  8495. i4 = class9_1.anInt219;
  8496. if(flag1 && class9_1.anInt239 != 0)
  8497. i4 = class9_1.anInt239;
  8498. if(class9_1.aString228.length() > 0)
  8499. s = class9_1.aString228;
  8500. } else {
  8501. i4 = class9_1.textColor;
  8502. if(flag1 && class9_1.anInt216 != 0)
  8503. i4 = class9_1.anInt216;
  8504. }
  8505. if(class9_1.atActionType == 6 && aBoolean1149) {
  8506. s = "Please wait...";
  8507. i4 = class9_1.textColor;
  8508. }
  8509. if(DrawingArea.width == 519) {
  8510. if(i4 == 0xffff00)
  8511. i4 = 255;
  8512. if(i4 == 49152)
  8513. i4 = 0xffffff;
  8514. }
  8515. if((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  8516. switch (i4) {
  8517. case 16773120: i4 = 0xFE981F; break;
  8518. case 7040819: i4 = 0xAF6A1A; break;
  8519. }
  8520. }
  8521. for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
  8522. {
  8523. if(s.indexOf("%") != -1)
  8524. {
  8525. do
  8526. {
  8527. int k7 = s.indexOf("%1");
  8528. if(k7 == -1)
  8529. break;
  8530. 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)
  8531. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8532. else
  8533. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8534. } while(true);
  8535. do
  8536. {
  8537. int l7 = s.indexOf("%2");
  8538. if(l7 == -1)
  8539. break;
  8540. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  8541. } while(true);
  8542. do
  8543. {
  8544. int i8 = s.indexOf("%3");
  8545. if(i8 == -1)
  8546. break;
  8547. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  8548. } while(true);
  8549. do
  8550. {
  8551. int j8 = s.indexOf("%4");
  8552. if(j8 == -1)
  8553. break;
  8554. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  8555. } while(true);
  8556. do
  8557. {
  8558. int k8 = s.indexOf("%5");
  8559. if(k8 == -1)
  8560. break;
  8561. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  8562. } while(true);
  8563. }
  8564. int l8 = s.indexOf("\\n");
  8565. String s1;
  8566. if(l8 != -1)
  8567. {
  8568. s1 = s.substring(0, l8);
  8569. s = s.substring(l8 + 2);
  8570. } else
  8571. {
  8572. s1 = s;
  8573. s = "";
  8574. }
  8575. if(class9_1.centerText)
  8576. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadow);
  8577. else
  8578. textDrawingArea.method389(class9_1.textShadow, k2, i4, s1, l6);
  8579. }
  8580. } else if(class9_1.type == 5) {
  8581. Sprite sprite;
  8582. if(interfaceIsSelected(class9_1))
  8583. sprite = class9_1.sprite2;
  8584. else
  8585. sprite = class9_1.sprite1;
  8586. if(spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
  8587. sprite.drawSprite(k2, l2, 0xffffff);
  8588. } else {
  8589. if (sprite != null)
  8590. sprite.drawSprite(k2, l2);
  8591. }
  8592. if(sprite != null)
  8593. sprite.drawSprite(k2, l2);
  8594. } else if(class9_1.type == 6) {
  8595. int k3 = Texture.textureInt1;
  8596. int j4 = Texture.textureInt2;
  8597. Texture.textureInt1 = k2 + class9_1.width / 2;
  8598. Texture.textureInt2 = l2 + class9_1.height / 2;
  8599. int i5 = Texture.anIntArray1470[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8600. int l5 = Texture.anIntArray1471[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8601. boolean flag2 = interfaceIsSelected(class9_1);
  8602. int i7;
  8603. if(flag2)
  8604. i7 = class9_1.anInt258;
  8605. else
  8606. i7 = class9_1.anInt257;
  8607. Model model;
  8608. if(i7 == -1) {
  8609. model = class9_1.method209(-1, -1, flag2);
  8610. } else {
  8611. Animation animation = Animation.anims[i7];
  8612. model = class9_1.method209(animation.anIntArray354[class9_1.anInt246], animation.anIntArray353[class9_1.anInt246], flag2);
  8613. }
  8614. if(model != null)
  8615. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  8616. Texture.textureInt1 = k3;
  8617. Texture.textureInt2 = j4;
  8618. } else if(class9_1.type == 7) {
  8619. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  8620. int k4 = 0;
  8621. for(int j5 = 0; j5 < class9_1.height; j5++) {
  8622. for(int i6 = 0; i6 < class9_1.width; i6++) {
  8623. if(class9_1.inv[k4] > 0) {
  8624. ItemDef itemDef = ItemDef.forID(class9_1.inv[k4] - 1);
  8625. String s2 = itemDef.name;
  8626. if(itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  8627. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  8628. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  8629. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  8630. if(class9_1.centerText)
  8631. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadow);
  8632. else
  8633. textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  8634. }
  8635. k4++;
  8636. }
  8637. }
  8638. } else if (class9_1.type == 8) {
  8639. drawHoverBox(k2, l2, class9_1.popupString);
  8640. }
  8641. }
  8642. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  8643. }
  8644.  
  8645. private void randomizeBackground(Background background) {
  8646. int j = 256;
  8647. for(int k = 0; k < anIntArray1190.length; k++)
  8648. anIntArray1190[k] = 0;
  8649.  
  8650. for(int l = 0; l < 5000; l++) {
  8651. int i1 = (int)(Math.random() * 128D * (double)j);
  8652. anIntArray1190[i1] = (int)(Math.random() * 256D);
  8653. }
  8654. for(int j1 = 0; j1 < 20; j1++) {
  8655. for(int k1 = 1; k1 < j - 1; k1++) {
  8656. for(int i2 = 1; i2 < 127; i2++) {
  8657. int k2 = i2 + (k1 << 7);
  8658. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  8659. }
  8660.  
  8661. }
  8662. int ai[] = anIntArray1190;
  8663. anIntArray1190 = anIntArray1191;
  8664. anIntArray1191 = ai;
  8665. }
  8666. if(background != null) {
  8667. int l1 = 0;
  8668. for(int j2 = 0; j2 < background.anInt1453; j2++) {
  8669. for(int l2 = 0; l2 < background.anInt1452; l2++)
  8670. if(background.aByteArray1450[l1++] != 0) {
  8671. int i3 = l2 + 16 + background.anInt1454;
  8672. int j3 = j2 + 16 + background.anInt1455;
  8673. int k3 = i3 + (j3 << 7);
  8674. anIntArray1190[k3] = 0;
  8675. }
  8676. }
  8677. }
  8678. }
  8679.  
  8680. private void method107(int i, int j, Stream stream, Player player)
  8681. {
  8682. if((i & 0x400) != 0)
  8683. {
  8684. player.anInt1543 = stream.method428();
  8685. player.anInt1545 = stream.method428();
  8686. player.anInt1544 = stream.method428();
  8687. player.anInt1546 = stream.method428();
  8688. player.anInt1547 = stream.method436() + loopCycle;
  8689. player.anInt1548 = stream.method435() + loopCycle;
  8690. player.anInt1549 = stream.method428();
  8691. player.method446();
  8692. }
  8693. if((i & 0x100) != 0)
  8694. {
  8695. player.anInt1520 = stream.method434();
  8696. int k = stream.readDWord();
  8697. player.anInt1524 = k >> 16;
  8698. player.anInt1523 = loopCycle + (k & 0xffff);
  8699. player.anInt1521 = 0;
  8700. player.anInt1522 = 0;
  8701. if(player.anInt1523 > loopCycle)
  8702. player.anInt1521 = -1;
  8703. if(player.anInt1520 == 65535)
  8704. player.anInt1520 = -1;
  8705. }
  8706. if((i & 8) != 0)
  8707. {
  8708. int l = stream.method434();
  8709. if(l == 65535)
  8710. l = -1;
  8711. int i2 = stream.method427();
  8712. if(l == player.anim && l != -1)
  8713. {
  8714. int i3 = Animation.anims[l].anInt365;
  8715. if(i3 == 1)
  8716. {
  8717. player.anInt1527 = 0;
  8718. player.anInt1528 = 0;
  8719. player.anInt1529 = i2;
  8720. player.anInt1530 = 0;
  8721. }
  8722. if(i3 == 2)
  8723. player.anInt1530 = 0;
  8724. } else
  8725. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  8726. {
  8727. player.anim = l;
  8728. player.anInt1527 = 0;
  8729. player.anInt1528 = 0;
  8730. player.anInt1529 = i2;
  8731. player.anInt1530 = 0;
  8732. player.anInt1542 = player.smallXYIndex;
  8733. }
  8734. }
  8735. if((i & 4) != 0)
  8736. {
  8737. player.textSpoken = stream.readString();
  8738. if(player.textSpoken.charAt(0) == '~')
  8739. {
  8740. player.textSpoken = player.textSpoken.substring(1);
  8741. pushMessage(player.textSpoken, 2, player.name);
  8742. } else
  8743. if(player == myPlayer)
  8744. pushMessage(player.textSpoken, 2, player.name);
  8745. player.anInt1513 = 0;
  8746. player.anInt1531 = 0;
  8747. player.textCycle = 150;
  8748. }
  8749. if((i & 0x80) != 0)
  8750. {
  8751. //right fucking here
  8752. int i1 = stream.method434();
  8753. int j2 = stream.readUnsignedByte();
  8754. int j3 = stream.method427();
  8755. int k3 = stream.currentOffset;
  8756. if(player.name != null && player.visible)
  8757. {
  8758. long l3 = TextClass.longForName(player.name);
  8759. boolean flag = false;
  8760. if(j2 <= 1)
  8761. {
  8762. for(int i4 = 0; i4 < ignoreCount; i4++)
  8763. {
  8764. if(ignoreListAsLongs[i4] != l3)
  8765. continue;
  8766. flag = true;
  8767. break;
  8768. }
  8769.  
  8770. }
  8771. if(!flag && anInt1251 == 0)
  8772. try
  8773. {
  8774. aStream_834.currentOffset = 0;
  8775. stream.method442(j3, 0, aStream_834.buffer);
  8776. aStream_834.currentOffset = 0;
  8777. String s = TextInput.method525(j3, aStream_834);
  8778. //s = Censor.doCensor(s);
  8779. player.textSpoken = s;
  8780. player.anInt1513 = i1 >> 8;
  8781. player.privelage = j2;
  8782. player.anInt1531 = i1 & 0xff;
  8783. player.textCycle = 150;
  8784. if(j2 == 2 || j2 == 3)
  8785. pushMessage(s, 1, "@cr2@" + player.name);
  8786. else if(j2 == 1)
  8787. pushMessage(s, 1, "@cr1@" + player.name);
  8788. else
  8789. pushMessage(s, 2, player.name);
  8790. }
  8791. catch(Exception exception)
  8792. {
  8793. signlink.reporterror("cde2");
  8794. }
  8795. }
  8796. stream.currentOffset = k3 + j3;
  8797. }
  8798. if((i & 1) != 0)
  8799. {
  8800. player.interactingEntity = stream.method434();
  8801. if(player.interactingEntity == 65535)
  8802. player.interactingEntity = -1;
  8803. }
  8804. if((i & 0x10) != 0)
  8805. {
  8806. int j1 = stream.method427();
  8807. byte abyte0[] = new byte[j1];
  8808. Stream stream_1 = new Stream(abyte0);
  8809. stream.readBytes(j1, 0, abyte0);
  8810. aStreamArray895s[j] = stream_1;
  8811. player.updatePlayer(stream_1);
  8812. }
  8813. if((i & 2) != 0)
  8814. {
  8815. player.anInt1538 = stream.method436();
  8816. player.anInt1539 = stream.method434();
  8817. }
  8818. if((i & 0x20) != 0)
  8819. {
  8820. int k1 = stream.readUnsignedByte();
  8821. int k2 = stream.method426();
  8822. player.updateHitData(k2, k1, loopCycle);
  8823. player.loopCycleStatus = loopCycle + 300;
  8824. player.currentHealth = stream.method427();
  8825. player.maxHealth = stream.readUnsignedByte();
  8826. }
  8827. if((i & 0x200) != 0)
  8828. {
  8829. int l1 = stream.readUnsignedByte();
  8830. int l2 = stream.method428();
  8831. player.updateHitData(l2, l1, loopCycle);
  8832. player.loopCycleStatus = loopCycle + 300;
  8833. player.currentHealth = stream.readUnsignedByte();
  8834. player.maxHealth = stream.method427();
  8835. }
  8836. }
  8837.  
  8838. private void method108()
  8839. {
  8840. try
  8841. {
  8842. int j = myPlayer.x + anInt1278;
  8843. int k = myPlayer.y + anInt1131;
  8844. if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  8845. {
  8846. anInt1014 = j;
  8847. anInt1015 = k;
  8848. }
  8849. if(anInt1014 != j)
  8850. anInt1014 += (j - anInt1014) / 16;
  8851. if(anInt1015 != k)
  8852. anInt1015 += (k - anInt1015) / 16;
  8853. if(super.keyArray[1] == 1)
  8854. anInt1186 += (-24 - anInt1186) / 2;
  8855. else
  8856. if(super.keyArray[2] == 1)
  8857. anInt1186 += (24 - anInt1186) / 2;
  8858. else
  8859. anInt1186 /= 2;
  8860. if(super.keyArray[3] == 1)
  8861. anInt1187 += (12 - anInt1187) / 2;
  8862. else
  8863. if(super.keyArray[4] == 1)
  8864. anInt1187 += (-12 - anInt1187) / 2;
  8865. else
  8866. anInt1187 /= 2;
  8867. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  8868. anInt1184 += anInt1187 / 2;
  8869. if(anInt1184 < 128)
  8870. anInt1184 = 128;
  8871. if(anInt1184 > 383)
  8872. anInt1184 = 383;
  8873. int l = anInt1014 >> 7;
  8874. int i1 = anInt1015 >> 7;
  8875. int j1 = method42(plane, anInt1015, anInt1014);
  8876. int k1 = 0;
  8877. if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  8878. {
  8879. for(int l1 = l - 4; l1 <= l + 4; l1++)
  8880. {
  8881. for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  8882. {
  8883. int l2 = plane;
  8884. if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  8885. l2++;
  8886. int i3 = j1 - intGroundArray[l2][l1][k2];
  8887. if(i3 > k1)
  8888. k1 = i3;
  8889. }
  8890.  
  8891. }
  8892.  
  8893. }
  8894. anInt1005++;
  8895. if(anInt1005 > 1512)
  8896. {
  8897. anInt1005 = 0;
  8898. stream.createFrame(77);
  8899. stream.writeWordBigEndian(0);
  8900. int i2 = stream.currentOffset;
  8901. stream.writeWordBigEndian((int)(Math.random() * 256D));
  8902. stream.writeWordBigEndian(101);
  8903. stream.writeWordBigEndian(233);
  8904. stream.writeWord(45092);
  8905. if((int)(Math.random() * 2D) == 0)
  8906. stream.writeWord(35784);
  8907. stream.writeWordBigEndian((int)(Math.random() * 256D));
  8908. stream.writeWordBigEndian(64);
  8909. stream.writeWordBigEndian(38);
  8910. stream.writeWord((int)(Math.random() * 65536D));
  8911. stream.writeWord((int)(Math.random() * 65536D));
  8912. stream.writeBytes(stream.currentOffset - i2);
  8913. }
  8914. int j2 = k1 * 192;
  8915. if(j2 > 0x17f00)
  8916. j2 = 0x17f00;
  8917. if(j2 < 32768)
  8918. j2 = 32768;
  8919. if(j2 > anInt984)
  8920. {
  8921. anInt984 += (j2 - anInt984) / 24;
  8922. return;
  8923. }
  8924. if(j2 < anInt984)
  8925. {
  8926. anInt984 += (j2 - anInt984) / 80;
  8927. }
  8928. }
  8929. catch(Exception _ex)
  8930. {
  8931. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  8932. throw new RuntimeException("eek");
  8933. }
  8934. }
  8935.  
  8936. public void processDrawing()
  8937. {
  8938. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  8939. {
  8940. showErrorScreen();
  8941. return;
  8942. }
  8943. anInt1061++;
  8944. if(!loggedIn)
  8945. drawLoginScreen(false);
  8946. else
  8947. drawGameScreen();
  8948. anInt1213 = 0;
  8949. }
  8950.  
  8951. private boolean isFriendOrSelf(String s)
  8952. {
  8953. if(s == null)
  8954. return false;
  8955. for(int i = 0; i < friendsCount; i++)
  8956. if(s.equalsIgnoreCase(friendsList[i]))
  8957. return true;
  8958. return s.equalsIgnoreCase(myPlayer.name);
  8959. }
  8960.  
  8961. private static String combatDiffColor(int i, int j)
  8962. {
  8963. int k = i - j;
  8964. if(k < -9)
  8965. return "@red@";
  8966. if(k < -6)
  8967. return "@or3@";
  8968. if(k < -3)
  8969. return "@or2@";
  8970. if(k < 0)
  8971. return "@or1@";
  8972. if(k > 9)
  8973. return "@gre@";
  8974. if(k > 6)
  8975. return "@gr3@";
  8976. if(k > 3)
  8977. return "@gr2@";
  8978. if(k > 0)
  8979. return "@gr1@";
  8980. else
  8981. return "@yel@";
  8982. }
  8983.  
  8984. private void setWaveVolume(int i)
  8985. {
  8986. signlink.wavevol = i;
  8987. }
  8988.  
  8989. private void draw3dScreen()
  8990. {
  8991. alertHandler.processAlerts();
  8992. drawSplitPrivateChat();
  8993. if(crossType == 1)
  8994. {
  8995. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  8996. anInt1142++;
  8997. if(anInt1142 > 67)
  8998. {
  8999. anInt1142 = 0;
  9000. stream.createFrame(78);
  9001. }
  9002. }
  9003. if(crossType == 2)
  9004. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9005. if(anInt1018 != -1)
  9006. {
  9007. method119(anInt945, anInt1018);
  9008. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  9009. }
  9010. if(openInterfaceID != -1)
  9011. {
  9012. method119(anInt945, openInterfaceID);
  9013. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  9014. }
  9015. method70();
  9016. if(!menuOpen)
  9017. {
  9018. processRightClick();
  9019. drawTooltip();
  9020. } else
  9021. if(menuScreenArea == 0)
  9022. drawMenu();
  9023. if(anInt1055 == 1)
  9024. multiOverlay.drawSprite(472, 296);
  9025. if(fpsOn)
  9026. {
  9027. char c = '\u01FB';
  9028. int k = 20;
  9029. int i1 = 0xffff00;
  9030. if(super.fps < 15)
  9031. i1 = 0xff0000;
  9032. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  9033. k += 15;
  9034. Runtime runtime = Runtime.getRuntime();
  9035. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9036. i1 = 0xffff00;
  9037. if(j1 > 0x2000000 && lowMem)
  9038. i1 = 0xff0000;
  9039. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  9040. k += 15;
  9041. }
  9042. int i1 = 0xffff00;
  9043. int x = baseX + (myPlayer.x - 6 >> 7);
  9044. int y = baseY + (myPlayer.y - 6 >> 7);
  9045. if (clientData)
  9046. {
  9047. char c = '\u01FB';
  9048. int k = 20;
  9049. if(super.fps < 15)
  9050. i1 = 0xff0000;
  9051. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285, 5);
  9052. Runtime runtime = Runtime.getRuntime();
  9053. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9054. i1 = 0xffff00;
  9055. if(j1 > 0x2000000 && lowMem)
  9056. i1 = 0xff0000;
  9057. k += 15;
  9058. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299, 5);
  9059. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  9060. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
  9061. }
  9062. if(anInt1104 != 0)
  9063. {
  9064. int j = anInt1104 / 50;
  9065. int l = j / 60;
  9066. j %= 60;
  9067. if(j < 10)
  9068. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  9069. else
  9070. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  9071. anInt849++;
  9072. if(anInt849 > 75)
  9073. {
  9074. anInt849 = 0;
  9075. stream.createFrame(148);
  9076. }
  9077. }
  9078. }
  9079.  
  9080. private void addIgnore(long l)
  9081. {
  9082. try
  9083. {
  9084. if(l == 0L)
  9085. return;
  9086. if(ignoreCount >= 100)
  9087. {
  9088. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  9089. return;
  9090. }
  9091. String s = TextClass.fixName(TextClass.nameForLong(l));
  9092. for(int j = 0; j < ignoreCount; j++)
  9093. if(ignoreListAsLongs[j] == l)
  9094. {
  9095. pushMessage(s + " is already on your ignore list", 0, "");
  9096. return;
  9097. }
  9098. for(int k = 0; k < friendsCount; k++)
  9099. if(friendsListAsLongs[k] == l)
  9100. {
  9101. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  9102. return;
  9103. }
  9104.  
  9105. ignoreListAsLongs[ignoreCount++] = l;
  9106. needDrawTabArea = true;
  9107. stream.createFrame(133);
  9108. stream.writeQWord(l);
  9109. return;
  9110. }
  9111. catch(RuntimeException runtimeexception)
  9112. {
  9113. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  9114. }
  9115. throw new RuntimeException();
  9116. }
  9117.  
  9118. private void method114()
  9119. {
  9120. for(int i = -1; i < playerCount; i++)
  9121. {
  9122. int j;
  9123. if(i == -1)
  9124. j = myPlayerIndex;
  9125. else
  9126. j = playerIndices[i];
  9127. Player player = playerArray[j];
  9128. if(player != null)
  9129. method96(player);
  9130. }
  9131.  
  9132. }
  9133.  
  9134. private void method115()
  9135. {
  9136. if(loadingStage == 2)
  9137. {
  9138. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  9139. {
  9140. if(class30_sub1.anInt1294 > 0)
  9141. class30_sub1.anInt1294--;
  9142. if(class30_sub1.anInt1294 == 0)
  9143. {
  9144. if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  9145. {
  9146. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  9147. class30_sub1.unlink();
  9148. }
  9149. } else
  9150. {
  9151. if(class30_sub1.anInt1302 > 0)
  9152. class30_sub1.anInt1302--;
  9153. 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)))
  9154. {
  9155. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  9156. class30_sub1.anInt1302 = -1;
  9157. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  9158. class30_sub1.unlink();
  9159. else
  9160. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  9161. class30_sub1.unlink();
  9162. }
  9163. }
  9164. }
  9165.  
  9166. }
  9167. }
  9168.  
  9169.  
  9170. //stops the click from going over sprite
  9171. private void determineMenuSize()
  9172. {
  9173. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  9174. for(int j = 0; j < menuActionRow; j++)
  9175. {
  9176. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  9177. if(k > i)
  9178. i = k;
  9179. }
  9180.  
  9181. i += 8;
  9182. int l = 15 * menuActionRow + 21;
  9183. if(super.saveClickX > 4 && super.saveClickY > 4 && super.saveClickX < 516 && super.saveClickY < 338)
  9184. {
  9185. int i1 = super.saveClickX - 4 - i / 2;
  9186. if(i1 + i > 512)
  9187. i1 = 512 - i;
  9188. if(i1 < 0)
  9189. i1 = 0;
  9190. int l1 = super.saveClickY - 4;
  9191. if(l1 + l > 334)
  9192. l1 = 334 - l;
  9193. if(l1 < 0)
  9194. l1 = 0;
  9195. menuOpen = true;
  9196. menuScreenArea = 0;
  9197. menuOffsetX = i1;
  9198. menuOffsetY = l1;
  9199. menuWidth = i;
  9200. menuHeight = 15 * menuActionRow + 22;
  9201. }
  9202. if(super.saveClickX > 519 && super.saveClickY > 168 && super.saveClickX < 765 && super.saveClickY < 503)
  9203. {
  9204. int j1 = super.saveClickX - 519 - i / 2;
  9205. if(j1 < 0)
  9206. j1 = 0;
  9207. else
  9208. if(j1 + i > 245)
  9209. j1 = 245 - i;
  9210. int i2 = super.saveClickY - 168;
  9211. if(i2 < 0)
  9212. i2 = 0;
  9213. else
  9214. if(i2 + l > 333)
  9215. i2 = 333 - l;
  9216. menuOpen = true;
  9217. menuScreenArea = 1;
  9218. menuOffsetX = j1;
  9219. menuOffsetY = i2;
  9220. menuWidth = i;
  9221. menuHeight = 15 * menuActionRow + 22;
  9222. }
  9223. if(super.saveClickX > 0 && super.saveClickY > 338 && super.saveClickX < 516 && super.saveClickY < 503)
  9224. {
  9225. int k1 = super.saveClickX - 0 - i / 2;
  9226. if(k1 < 0)
  9227. k1 = 0;
  9228. else
  9229. if(k1 + i > 516)
  9230. k1 = 516 - i;
  9231. int j2 = super.saveClickY - 338;
  9232. if(j2 < 0)
  9233. j2 = 0;
  9234. else
  9235. if(j2 + l > 165)
  9236. j2 = 165 - l;
  9237. menuOpen = true;
  9238. menuScreenArea = 2;
  9239. menuOffsetX = k1;
  9240. menuOffsetY = j2;
  9241. menuWidth = i;
  9242. menuHeight = 15 * menuActionRow + 22;
  9243. }
  9244. }
  9245.  
  9246. private void method117(Stream stream)
  9247. {
  9248. stream.initBitAccess();
  9249. int j = stream.readBits(1);
  9250. if(j == 0)
  9251. return;
  9252. int k = stream.readBits(2);
  9253. if(k == 0)
  9254. {
  9255. anIntArray894[anInt893++] = myPlayerIndex;
  9256. return;
  9257. }
  9258. if(k == 1)
  9259. {
  9260. int l = stream.readBits(3);
  9261. myPlayer.moveInDir(false, l);
  9262. int k1 = stream.readBits(1);
  9263. if(k1 == 1)
  9264. anIntArray894[anInt893++] = myPlayerIndex;
  9265. return;
  9266. }
  9267. if(k == 2)
  9268. {
  9269. int i1 = stream.readBits(3);
  9270. myPlayer.moveInDir(true, i1);
  9271. int l1 = stream.readBits(3);
  9272. myPlayer.moveInDir(true, l1);
  9273. int j2 = stream.readBits(1);
  9274. if(j2 == 1)
  9275. anIntArray894[anInt893++] = myPlayerIndex;
  9276. return;
  9277. }
  9278. if(k == 3)
  9279. {
  9280. plane = stream.readBits(2);
  9281. int j1 = stream.readBits(1);
  9282. int i2 = stream.readBits(1);
  9283. if(i2 == 1)
  9284. anIntArray894[anInt893++] = myPlayerIndex;
  9285. int k2 = stream.readBits(7);
  9286. int l2 = stream.readBits(7);
  9287. myPlayer.setPos(l2, k2, j1 == 1);
  9288. }
  9289. }
  9290.  
  9291. private void nullLoader()
  9292. {
  9293. aBoolean831 = false;
  9294. while(drawingFlames)
  9295. {
  9296. aBoolean831 = false;
  9297. try
  9298. {
  9299. Thread.sleep(50L);
  9300. }
  9301. catch(Exception _ex) { }
  9302. }
  9303. aBackground_966 = null;
  9304. aBackground_967 = null;
  9305. aBackgroundArray1152s = null;
  9306. anIntArray850 = null;
  9307. anIntArray851 = null;
  9308. anIntArray852 = null;
  9309. anIntArray853 = null;
  9310. anIntArray1190 = null;
  9311. anIntArray1191 = null;
  9312. anIntArray828 = null;
  9313. anIntArray829 = null;
  9314. aClass30_Sub2_Sub1_Sub1_1201 = null;
  9315. aClass30_Sub2_Sub1_Sub1_1202 = null;
  9316. }
  9317.  
  9318. private boolean method119(int i, int j)
  9319. {
  9320. boolean flag1 = false;
  9321. RSInterface class9 = RSInterface.interfaceCache[j];
  9322. for(int k = 0; k < class9.children.length; k++)
  9323. {
  9324. if(class9.children[k] == -1)
  9325. break;
  9326. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  9327. if(class9_1.type == 1)
  9328. flag1 |= method119(i, class9_1.id);
  9329. if(class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1))
  9330. {
  9331. boolean flag2 = interfaceIsSelected(class9_1);
  9332. int l;
  9333. if(flag2)
  9334. l = class9_1.anInt258;
  9335. else
  9336. l = class9_1.anInt257;
  9337. if(l != -1)
  9338. {
  9339. Animation animation = Animation.anims[l];
  9340. for(class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);)
  9341. {
  9342. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  9343. class9_1.anInt246++;
  9344. if(class9_1.anInt246 >= animation.anInt352)
  9345. {
  9346. class9_1.anInt246 -= animation.anInt356;
  9347. if(class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  9348. class9_1.anInt246 = 0;
  9349. }
  9350. flag1 = true;
  9351. }
  9352.  
  9353. }
  9354. }
  9355. }
  9356.  
  9357. return flag1;
  9358. }
  9359.  
  9360. private int method120()
  9361. {
  9362. int j = 3;
  9363. if(yCameraCurve < 310)
  9364. {
  9365. int k = xCameraPos >> 7;
  9366. int l = yCameraPos >> 7;
  9367. int i1 = myPlayer.x >> 7;
  9368. int j1 = myPlayer.y >> 7;
  9369. if((byteGroundArray[plane][k][l] & 4) != 0)
  9370. j = plane;
  9371. int k1;
  9372. if(i1 > k)
  9373. k1 = i1 - k;
  9374. else
  9375. k1 = k - i1;
  9376. int l1;
  9377. if(j1 > l)
  9378. l1 = j1 - l;
  9379. else
  9380. l1 = l - j1;
  9381. if(k1 > l1)
  9382. {
  9383. int i2 = (l1 * 0x10000) / k1;
  9384. int k2 = 32768;
  9385. while(k != i1)
  9386. {
  9387. if(k < i1)
  9388. k++;
  9389. else
  9390. if(k > i1)
  9391. k--;
  9392. if((byteGroundArray[plane][k][l] & 4) != 0)
  9393. j = plane;
  9394. k2 += i2;
  9395. if(k2 >= 0x10000)
  9396. {
  9397. k2 -= 0x10000;
  9398. if(l < j1)
  9399. l++;
  9400. else
  9401. if(l > j1)
  9402. l--;
  9403. if((byteGroundArray[plane][k][l] & 4) != 0)
  9404. j = plane;
  9405. }
  9406. }
  9407. } else
  9408. {
  9409. int j2 = (k1 * 0x10000) / l1;
  9410. int l2 = 32768;
  9411. while(l != j1)
  9412. {
  9413. if(l < j1)
  9414. l++;
  9415. else
  9416. if(l > j1)
  9417. l--;
  9418. if((byteGroundArray[plane][k][l] & 4) != 0)
  9419. j = plane;
  9420. l2 += j2;
  9421. if(l2 >= 0x10000)
  9422. {
  9423. l2 -= 0x10000;
  9424. if(k < i1)
  9425. k++;
  9426. else
  9427. if(k > i1)
  9428. k--;
  9429. if((byteGroundArray[plane][k][l] & 4) != 0)
  9430. j = plane;
  9431. }
  9432. }
  9433. }
  9434. }
  9435. if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  9436. j = plane;
  9437. return j;
  9438. }
  9439.  
  9440. private int method121()
  9441. {
  9442. int j = method42(plane, yCameraPos, xCameraPos);
  9443. if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  9444. return plane;
  9445. else
  9446. return 3;
  9447. }
  9448.  
  9449. private void delIgnore(long l)
  9450. {
  9451. try
  9452. {
  9453. if(l == 0L)
  9454. return;
  9455. for(int j = 0; j < ignoreCount; j++)
  9456. if(ignoreListAsLongs[j] == l)
  9457. {
  9458. ignoreCount--;
  9459. needDrawTabArea = true;
  9460. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  9461.  
  9462. stream.createFrame(74);
  9463. stream.writeQWord(l);
  9464. return;
  9465. }
  9466.  
  9467. return;
  9468. }
  9469. catch(RuntimeException runtimeexception)
  9470. {
  9471. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9472. }
  9473. throw new RuntimeException();
  9474. }
  9475.  
  9476.  
  9477. private void chatJoin(long l) {
  9478. try {
  9479. if(l == 0L)
  9480. return;
  9481. stream.createFrame(60);
  9482. stream.writeQWord(l);
  9483. return;
  9484. }
  9485. catch(RuntimeException runtimeexception)
  9486. {
  9487. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9488. }
  9489. throw new RuntimeException();
  9490.  
  9491. }
  9492.  
  9493. public String getParameter(String s)
  9494. {
  9495. if(signlink.mainapp != null)
  9496. return signlink.mainapp.getParameter(s);
  9497. else
  9498. return super.getParameter(s);
  9499. }
  9500.  
  9501. private void adjustVolume(boolean flag, int i)
  9502. {
  9503. signlink.midivol = i;
  9504. if(flag)
  9505. signlink.midi = "voladjust";
  9506. }
  9507.  
  9508. private int extractInterfaceValues(RSInterface class9, int j)
  9509. {
  9510. if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  9511. return -2;
  9512. try
  9513. {
  9514. int ai[] = class9.valueIndexArray[j];
  9515. int k = 0;
  9516. int l = 0;
  9517. int i1 = 0;
  9518. do
  9519. {
  9520. int j1 = ai[l++];
  9521. int k1 = 0;
  9522. byte byte0 = 0;
  9523. if(j1 == 0)
  9524. return k;
  9525. if(j1 == 1)
  9526. k1 = currentStats[ai[l++]];
  9527. if(j1 == 2)
  9528. k1 = maxStats[ai[l++]];
  9529. if(j1 == 3)
  9530. k1 = currentExp[ai[l++]];
  9531. if(j1 == 4)
  9532. {
  9533. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  9534. int k2 = ai[l++];
  9535. if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  9536. {
  9537. for(int j3 = 0; j3 < class9_1.inv.length; j3++)
  9538. if(class9_1.inv[j3] == k2 + 1)
  9539. k1 += class9_1.invStackSizes[j3];
  9540.  
  9541. }
  9542. }
  9543. if(j1 == 5)
  9544. k1 = variousSettings[ai[l++]];
  9545. if(j1 == 6)
  9546. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  9547. if(j1 == 7)
  9548. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  9549. if(j1 == 8)
  9550. k1 = myPlayer.combatLevel;
  9551. if(j1 == 9)
  9552. {
  9553. for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  9554. if(Skills.skillEnabled[l1])
  9555. k1 += maxStats[l1];
  9556.  
  9557. }
  9558. if(j1 == 10)
  9559. {
  9560. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  9561. int l2 = ai[l++] + 1;
  9562. if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  9563. {
  9564. for(int k3 = 0; k3 < class9_2.inv.length; k3++)
  9565. {
  9566. if(class9_2.inv[k3] != l2)
  9567. continue;
  9568. k1 = 0x3b9ac9ff;
  9569. break;
  9570. }
  9571.  
  9572. }
  9573. }
  9574. if(j1 == 11)
  9575. k1 = energy;
  9576. if(j1 == 12)
  9577. k1 = weight;
  9578. if(j1 == 13)
  9579. {
  9580. int i2 = variousSettings[ai[l++]];
  9581. int i3 = ai[l++];
  9582. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  9583. }
  9584. if(j1 == 14)
  9585. {
  9586. int j2 = ai[l++];
  9587. VarBit varBit = VarBit.cache[j2];
  9588. int l3 = varBit.anInt648;
  9589. int i4 = varBit.anInt649;
  9590. int j4 = varBit.anInt650;
  9591. int k4 = anIntArray1232[j4 - i4];
  9592. k1 = variousSettings[l3] >> i4 & k4;
  9593. }
  9594. if(j1 == 15)
  9595. byte0 = 1;
  9596. if(j1 == 16)
  9597. byte0 = 2;
  9598. if(j1 == 17)
  9599. byte0 = 3;
  9600. if(j1 == 18)
  9601. k1 = (myPlayer.x >> 7) + baseX;
  9602. if(j1 == 19)
  9603. k1 = (myPlayer.y >> 7) + baseY;
  9604. if(j1 == 20)
  9605. k1 = ai[l++];
  9606. if(byte0 == 0)
  9607. {
  9608. if(i1 == 0)
  9609. k += k1;
  9610. if(i1 == 1)
  9611. k -= k1;
  9612. if(i1 == 2 && k1 != 0)
  9613. k /= k1;
  9614. if(i1 == 3)
  9615. k *= k1;
  9616. i1 = 0;
  9617. } else
  9618. {
  9619. i1 = byte0;
  9620. }
  9621. } while(true);
  9622. }
  9623. catch(Exception _ex)
  9624. {
  9625. return -1;
  9626. }
  9627. }
  9628.  
  9629. private void drawTooltip() {
  9630. if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  9631. return;
  9632. String s;
  9633. if(itemSelected == 1 && menuActionRow < 2)
  9634. s = "Use " + selectedItemName + " with...";
  9635. else if(spellSelected == 1 && menuActionRow < 2)
  9636. s = spellTooltip + "...";
  9637. else
  9638. s = menuActionName[menuActionRow - 1];
  9639. if(menuActionRow > 2)
  9640. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  9641. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  9642. }
  9643.  
  9644. private void drawMinimap() {
  9645. aRSImageProducer_1164.initDrawingArea();
  9646. if(anInt1021 == 2) {
  9647. byte abyte0[] = mapBack.aByteArray1450;
  9648. int ai[] = DrawingArea.pixels;
  9649. int k2 = abyte0.length;
  9650. for(int i5 = 0; i5 < k2; i5++)
  9651. if(abyte0[i5] == 0)
  9652. ai[i5] = 0;
  9653. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 0, 0, 33, 25);
  9654. aRSImageProducer_1165.initDrawingArea();
  9655. return;
  9656. }
  9657. int i = minimapInt1 + minimapInt2 & 0x7ff;
  9658. int j = 48 + myPlayer.x / 32;
  9659. int l2 = 464 - myPlayer.y / 32;
  9660. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, 5, 25, 146, j);
  9661. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 0, 0, 33, 25);
  9662. for(int j5 = 0; j5 < anInt1071; j5++) {
  9663. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  9664. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  9665. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  9666. }
  9667. for(int k5 = 0; k5 < 104; k5++) {
  9668. for(int l5 = 0; l5 < 104; l5++) {
  9669. NodeList class19 = groundArray[plane][k5][l5];
  9670. if(class19 != null) {
  9671. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  9672. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  9673. markMinimap(mapDotItem, l, j3);
  9674. }
  9675. }
  9676. }
  9677. for(int i6 = 0; i6 < npcCount; i6++) {
  9678. NPC npc = npcArray[npcIndices[i6]];
  9679. if(npc != null && npc.isVisible()) {
  9680. EntityDef entityDef = npc.desc;
  9681. if(entityDef.childrenIDs != null)
  9682. entityDef = entityDef.method161();
  9683. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  9684. int i1 = npc.x / 32 - myPlayer.x / 32;
  9685. int k3 = npc.y / 32 - myPlayer.y / 32;
  9686. markMinimap(mapDotNPC, i1, k3);
  9687. }
  9688. }
  9689. }
  9690. for(int j6 = 0; j6 < playerCount; j6++) {
  9691. Player player = playerArray[playerIndices[j6]];
  9692. if(player != null && player.isVisible()) {
  9693. int j1 = player.x / 32 - myPlayer.x / 32;
  9694. int l3 = player.y / 32 - myPlayer.y / 32;
  9695. boolean flag1 = false;
  9696. boolean flag3 = false;
  9697. for (int j3 = 0; j3 < clanList.length; j3++) {
  9698. if (clanList[j3] == null)
  9699. continue;
  9700. if (!clanList[j3].equalsIgnoreCase(player.name))
  9701. continue;
  9702. flag3 = true;
  9703. break;
  9704. }
  9705. long l6 = TextClass.longForName(player.name);
  9706. for(int k6 = 0; k6 < friendsCount; k6++) {
  9707. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  9708. continue;
  9709. flag1 = true;
  9710. break;
  9711. }
  9712. boolean flag2 = false;
  9713. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  9714. flag2 = true;
  9715. if(flag1)
  9716. markMinimap(mapDotFriend, j1, l3);
  9717. else if(flag3)
  9718. markMinimap(mapDotClan, j1, l3);
  9719. else if(flag2)
  9720. markMinimap(mapDotTeam, j1, l3);
  9721. else
  9722. markMinimap(mapDotPlayer, j1, l3);
  9723. }
  9724. }
  9725. if(anInt855 != 0 && loopCycle % 20 < 10) {
  9726. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  9727. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  9728. if(class30_sub2_sub4_sub1_sub1_1 != null) {
  9729. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  9730. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  9731. method81(mapMarker, i4, k1);
  9732. }
  9733. }
  9734. if(anInt855 == 2) {
  9735. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  9736. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  9737. method81(mapMarker, j4, l1);
  9738. }
  9739. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length) {
  9740. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  9741. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  9742. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  9743. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  9744. method81(mapMarker, k4, i2);
  9745. }
  9746. }
  9747. }
  9748. if(destX != 0) {
  9749. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  9750. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  9751. markMinimap(mapFlag, j2, l4);
  9752. }
  9753. DrawingArea.drawPixels(3, 78, 97, 0xffffff, 3);
  9754. mapBack.drawBackground(0, 0);
  9755. loadOrbs();
  9756. aRSImageProducer_1165.initDrawingArea();
  9757. }
  9758.  
  9759. private void npcScreenPos(Entity entity, int i) {
  9760. calcEntityScreenPos(entity.x, i, entity.y);
  9761. }
  9762.  
  9763. private void calcEntityScreenPos(int i, int j, int l) {
  9764. if(i < 128 || l < 128 || i > 13056 || l > 13056) {
  9765. spriteDrawX = -1;
  9766. spriteDrawY = -1;
  9767. return;
  9768. }
  9769. int i1 = method42(plane, l, i) - j;
  9770. i -= xCameraPos;
  9771. i1 -= zCameraPos;
  9772. l -= yCameraPos;
  9773. int j1 = Model.modelIntArray1[yCameraCurve];
  9774. int k1 = Model.modelIntArray2[yCameraCurve];
  9775. int l1 = Model.modelIntArray1[xCameraCurve];
  9776. int i2 = Model.modelIntArray2[xCameraCurve];
  9777. int j2 = l * l1 + i * i2 >> 16;
  9778. l = l * i2 - i * l1 >> 16;
  9779. i = j2;
  9780. j2 = i1 * k1 - l * j1 >> 16;
  9781. l = i1 * j1 + l * k1 >> 16;
  9782. i1 = j2;
  9783. if(l >= 50) {
  9784. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  9785. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  9786. } else {
  9787. spriteDrawX = -1;
  9788. spriteDrawY = -1;
  9789. }
  9790. }
  9791.  
  9792. private void buildSplitPrivateChatMenu()
  9793. {
  9794. if(splitPrivateChat == 0)
  9795. return;
  9796. int i = 0;
  9797. if(anInt1104 != 0)
  9798. i = 1;
  9799. for(int j = 0; j < 100; j++)
  9800. if(chatMessages[j] != null)
  9801. {
  9802. int k = chatTypes[j];
  9803. String s = chatNames[j];
  9804. boolean flag1 = false;
  9805. if(s != null && s.startsWith("@cr1@"))
  9806. {
  9807. s = s.substring(5);
  9808. boolean flag2 = true;
  9809. }
  9810. if(s != null && s.startsWith("@cr2@"))
  9811. {
  9812. s = s.substring(5);
  9813. byte byte0 = 2;
  9814. }
  9815. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  9816. {
  9817. int l = 329 - i * 13;
  9818. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  9819. {
  9820. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  9821. if(i1 > 450)
  9822. i1 = 450;
  9823. if(super.mouseX < 4 + i1)
  9824. {
  9825. if(myPrivilege >= 1)
  9826. {
  9827. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  9828. menuActionID[menuActionRow] = 2606;
  9829. menuActionRow++;
  9830. }
  9831. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  9832. menuActionID[menuActionRow] = 2042;
  9833. menuActionRow++;
  9834. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  9835. menuActionID[menuActionRow] = 2337;
  9836. menuActionRow++;
  9837. }
  9838. }
  9839. if(++i >= 5)
  9840. return;
  9841. }
  9842. if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  9843. return;
  9844. }
  9845.  
  9846. }
  9847.  
  9848. private void method130(int j, int k, int l, int i1, int j1, int k1,
  9849. int l1, int i2, int j2)
  9850. {
  9851. Class30_Sub1 class30_sub1 = null;
  9852. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  9853. {
  9854. if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  9855. continue;
  9856. class30_sub1 = class30_sub1_1;
  9857. break;
  9858. }
  9859.  
  9860. if(class30_sub1 == null)
  9861. {
  9862. class30_sub1 = new Class30_Sub1();
  9863. class30_sub1.anInt1295 = l1;
  9864. class30_sub1.anInt1296 = i1;
  9865. class30_sub1.anInt1297 = i2;
  9866. class30_sub1.anInt1298 = j1;
  9867. method89(class30_sub1);
  9868. aClass19_1179.insertHead(class30_sub1);
  9869. }
  9870. class30_sub1.anInt1291 = k;
  9871. class30_sub1.anInt1293 = k1;
  9872. class30_sub1.anInt1292 = l;
  9873. class30_sub1.anInt1302 = j2;
  9874. class30_sub1.anInt1294 = j;
  9875. }
  9876.  
  9877. private boolean interfaceIsSelected(RSInterface class9)
  9878. {
  9879. if(class9.anIntArray245 == null)
  9880. return false;
  9881. for(int i = 0; i < class9.anIntArray245.length; i++)
  9882. {
  9883. int j = extractInterfaceValues(class9, i);
  9884. int k = class9.anIntArray212[i];
  9885. if(class9.anIntArray245[i] == 2)
  9886. {
  9887. if(j >= k)
  9888. return false;
  9889. } else
  9890. if(class9.anIntArray245[i] == 3)
  9891. {
  9892. if(j <= k)
  9893. return false;
  9894. } else
  9895. if(class9.anIntArray245[i] == 4)
  9896. {
  9897. if(j == k)
  9898. return false;
  9899. } else
  9900. if(j != k)
  9901. return false;
  9902. }
  9903.  
  9904. return true;
  9905. }
  9906.  
  9907. private DataInputStream openJagGrabInputStream(String s)
  9908. throws IOException
  9909. {
  9910. // if(!aBoolean872)
  9911. // if(signlink.mainapp != null)
  9912. // return signlink.openurl(s);
  9913. // else
  9914. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  9915. if(aSocket832 != null)
  9916. {
  9917. try
  9918. {
  9919. aSocket832.close();
  9920. }
  9921. catch(Exception _ex) { }
  9922. aSocket832 = null;
  9923. }
  9924. aSocket832 = openSocket(43595);
  9925. aSocket832.setSoTimeout(10000);
  9926. java.io.InputStream inputstream = aSocket832.getInputStream();
  9927. OutputStream outputstream = aSocket832.getOutputStream();
  9928. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  9929. return new DataInputStream(inputstream);
  9930. }
  9931.  
  9932. private void doFlamesDrawing()
  9933. {
  9934. char c = '\u0100';
  9935. if(anInt1040 > 0)
  9936. {
  9937. for(int i = 0; i < 256; i++)
  9938. if(anInt1040 > 768)
  9939. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  9940. else
  9941. if(anInt1040 > 256)
  9942. anIntArray850[i] = anIntArray852[i];
  9943. else
  9944. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  9945.  
  9946. } else
  9947. if(anInt1041 > 0)
  9948. {
  9949. for(int j = 0; j < 256; j++)
  9950. if(anInt1041 > 768)
  9951. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  9952. else
  9953. if(anInt1041 > 256)
  9954. anIntArray850[j] = anIntArray853[j];
  9955. else
  9956. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  9957.  
  9958. } else
  9959. {
  9960. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  9961.  
  9962. }
  9963. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, aRSImageProducer_1110.anIntArray315, 0, 33920);
  9964.  
  9965. int i1 = 0;
  9966. int j1 = 1152;
  9967. for(int k1 = 1; k1 < c - 1; k1++)
  9968. {
  9969. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  9970. int j2 = 22 + l1;
  9971. if(j2 < 0)
  9972. j2 = 0;
  9973. i1 += j2;
  9974. for(int l2 = j2; l2 < 128; l2++)
  9975. {
  9976. int j3 = anIntArray828[i1++];
  9977. if(j3 != 0)
  9978. {
  9979. int l3 = j3;
  9980. int j4 = 256 - j3;
  9981. j3 = anIntArray850[j3];
  9982. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  9983. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  9984. } else
  9985. {
  9986. j1++;
  9987. }
  9988. }
  9989.  
  9990. j1 += j2;
  9991. }
  9992.  
  9993. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  9994. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, aRSImageProducer_1111.anIntArray315, 0, 33920);
  9995.  
  9996. i1 = 0;
  9997. j1 = 1176;
  9998. for(int k2 = 1; k2 < c - 1; k2++)
  9999. {
  10000. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  10001. int k3 = 103 - i3;
  10002. j1 += i3;
  10003. for(int i4 = 0; i4 < k3; i4++)
  10004. {
  10005. int k4 = anIntArray828[i1++];
  10006. if(k4 != 0)
  10007. {
  10008. int i5 = k4;
  10009. int j5 = 256 - k4;
  10010. k4 = anIntArray850[k4];
  10011. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  10012. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  10013. } else
  10014. {
  10015. j1++;
  10016. }
  10017. }
  10018.  
  10019. i1 += 128 - k3;
  10020. j1 += 128 - k3 - i3;
  10021. }
  10022.  
  10023. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  10024. }
  10025.  
  10026. private void method134(Stream stream)
  10027. {
  10028. int j = stream.readBits(8);
  10029. if(j < playerCount)
  10030. {
  10031. for(int k = j; k < playerCount; k++)
  10032. anIntArray840[anInt839++] = playerIndices[k];
  10033.  
  10034. }
  10035. if(j > playerCount)
  10036. {
  10037. signlink.reporterror(myUsername + " Too many players");
  10038. throw new RuntimeException("eek");
  10039. }
  10040. playerCount = 0;
  10041. for(int l = 0; l < j; l++)
  10042. {
  10043. int i1 = playerIndices[l];
  10044. Player player = playerArray[i1];
  10045. int j1 = stream.readBits(1);
  10046. if(j1 == 0)
  10047. {
  10048. playerIndices[playerCount++] = i1;
  10049. player.anInt1537 = loopCycle;
  10050. } else
  10051. {
  10052. int k1 = stream.readBits(2);
  10053. if(k1 == 0)
  10054. {
  10055. playerIndices[playerCount++] = i1;
  10056. player.anInt1537 = loopCycle;
  10057. anIntArray894[anInt893++] = i1;
  10058. } else
  10059. if(k1 == 1)
  10060. {
  10061. playerIndices[playerCount++] = i1;
  10062. player.anInt1537 = loopCycle;
  10063. int l1 = stream.readBits(3);
  10064. player.moveInDir(false, l1);
  10065. int j2 = stream.readBits(1);
  10066. if(j2 == 1)
  10067. anIntArray894[anInt893++] = i1;
  10068. } else
  10069. if(k1 == 2)
  10070. {
  10071. playerIndices[playerCount++] = i1;
  10072. player.anInt1537 = loopCycle;
  10073. int i2 = stream.readBits(3);
  10074. player.moveInDir(true, i2);
  10075. int k2 = stream.readBits(3);
  10076. player.moveInDir(true, k2);
  10077. int l2 = stream.readBits(1);
  10078. if(l2 == 1)
  10079. anIntArray894[anInt893++] = i1;
  10080. } else
  10081. if(k1 == 3)
  10082. anIntArray840[anInt839++] = i1;
  10083. }
  10084. }
  10085. }
  10086.  
  10087. private void drawLoginScreen(boolean flag)
  10088. {
  10089. resetImageProducers();
  10090. aRSImageProducer_1109.initDrawingArea();
  10091. aBackground_966.drawBackground(0, 0);
  10092. char c = '\u0168';
  10093. char c1 = '\310';
  10094. if(loginScreenState == 0)
  10095. {
  10096. int i = c1 / 2 + 80;
  10097. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  10098. i = c1 / 2 - 20;
  10099. chatTextDrawingArea.method382(0xffff00, c / 2, "Welcome to Diversity", i, true);
  10100. i += 30;
  10101. int l = c / 2 - 80;
  10102. int k1 = c1 / 2 + 20;
  10103. aBackground_967.drawBackground(l - 73, k1 - 20);
  10104. chatTextDrawingArea.method382(0xffffff, l, "More Info", k1 + 5, true);
  10105. l = c / 2 + 80;
  10106. aBackground_967.drawBackground(l - 73, k1 - 20);
  10107. chatTextDrawingArea.method382(0xffffff, l, "Play now", k1 + 5, true);
  10108. }
  10109. if(loginScreenState == 2)
  10110. {
  10111. int j = c1 / 2 - 40;
  10112. if(loginMessage1.length() > 0)
  10113. {
  10114. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  10115. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j, true);
  10116. j += 30;
  10117. } else
  10118. {
  10119. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  10120. j += 30;
  10121. }
  10122. chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff, "Username: " + myUsername + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10123. j += 15;
  10124. chatTextDrawingArea.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10125. j += 15;
  10126. if(!flag)
  10127. {
  10128. int i1 = c / 2 - 80;
  10129. int l1 = c1 / 2 + 50;
  10130. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10131. chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5, true);
  10132. i1 = c / 2 + 80;
  10133. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10134. chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  10135. }
  10136. }
  10137. if(loginScreenState == 3)
  10138. {
  10139. chatTextDrawingArea.method382(0xffff00, c / 2, "How to start?", c1 / 2 - 60, true);
  10140. int k = c1 / 2 - 35;
  10141. chatTextDrawingArea.method382(0xffffff, c / 2, "Thanks For Trying Diversity!", k, true);
  10142. k += 15;
  10143. chatTextDrawingArea.method382(0xffffff, c / 2, "Make sure to sign up on the forums.", k, true);
  10144. k += 15;
  10145. chatTextDrawingArea.method382(0xffffff, c / 2, "Please Report all abuse,bugs.", k, true);
  10146. k += 15;
  10147. chatTextDrawingArea.method382(0xffffff, c / 2, "Have Fun!", k, true);
  10148. k += 15;
  10149. int j1 = c / 2;
  10150. int i2 = c1 / 2 + 50;
  10151. aBackground_967.drawBackground(j1 - 73, i2 - 20);
  10152. chatTextDrawingArea.method382(0xffffff, j1, "Continue", i2 + 5, true);
  10153. }
  10154. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  10155. if(welcomeScreenRaised)
  10156. {
  10157. welcomeScreenRaised = false;
  10158. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  10159. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  10160. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  10161. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  10162. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  10163. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  10164. }
  10165. }
  10166.  
  10167. private void drawFlames()
  10168. {
  10169. drawingFlames = true;
  10170. try
  10171. {
  10172. long l = System.currentTimeMillis();
  10173. int i = 0;
  10174. int j = 20;
  10175. while(aBoolean831)
  10176. {
  10177. anInt1208++;
  10178. //calcFlamesPosition();
  10179. //calcFlamesPosition();
  10180. doFlamesDrawing();
  10181. if(++i > 10)
  10182. {
  10183. long l1 = System.currentTimeMillis();
  10184. int k = (int)(l1 - l) / 10 - j;
  10185. j = 40 - k;
  10186. if(j < 5)
  10187. j = 5;
  10188. i = 0;
  10189. l = l1;
  10190. }
  10191. try
  10192. {
  10193. Thread.sleep(j);
  10194. }
  10195. catch(Exception _ex) { }
  10196. }
  10197. }
  10198. catch(Exception _ex) { }
  10199. drawingFlames = false;
  10200. }
  10201.  
  10202. public void raiseWelcomeScreen()
  10203. {
  10204. welcomeScreenRaised = true;
  10205. }
  10206.  
  10207. private void method137(Stream stream, int j)
  10208. {
  10209. if(j == 84)
  10210. {
  10211. int k = stream.readUnsignedByte();
  10212. int j3 = anInt1268 + (k >> 4 & 7);
  10213. int i6 = anInt1269 + (k & 7);
  10214. int l8 = stream.readUnsignedWord();
  10215. int k11 = stream.readUnsignedWord();
  10216. int l13 = stream.readUnsignedWord();
  10217. if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  10218. {
  10219. NodeList class19_1 = groundArray[plane][j3][i6];
  10220. if(class19_1 != null)
  10221. {
  10222. 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())
  10223. {
  10224. if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  10225. continue;
  10226. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  10227. break;
  10228. }
  10229.  
  10230. spawnGroundItem(j3, i6);
  10231. }
  10232. }
  10233. return;
  10234. }
  10235. if(j == 105)
  10236. {
  10237. int l = stream.readUnsignedByte();
  10238. int k3 = anInt1268 + (l >> 4 & 7);
  10239. int j6 = anInt1269 + (l & 7);
  10240. int i9 = stream.readUnsignedWord();
  10241. int l11 = stream.readUnsignedByte();
  10242. int i14 = l11 >> 4 & 0xf;
  10243. int i16 = l11 & 7;
  10244. 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)
  10245. {
  10246. anIntArray1207[anInt1062] = i9;
  10247. anIntArray1241[anInt1062] = i16;
  10248. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  10249. anInt1062++;
  10250. }
  10251. }
  10252. if(j == 215)
  10253. {
  10254. int i1 = stream.method435();
  10255. int l3 = stream.method428();
  10256. int k6 = anInt1268 + (l3 >> 4 & 7);
  10257. int j9 = anInt1269 + (l3 & 7);
  10258. int i12 = stream.method435();
  10259. int j14 = stream.readUnsignedWord();
  10260. if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  10261. {
  10262. Item class30_sub2_sub4_sub2_2 = new Item();
  10263. class30_sub2_sub4_sub2_2.ID = i1;
  10264. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  10265. if(groundArray[plane][k6][j9] == null)
  10266. groundArray[plane][k6][j9] = new NodeList();
  10267. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  10268. spawnGroundItem(k6, j9);
  10269. }
  10270. return;
  10271. }
  10272. if(j == 156)
  10273. {
  10274. int j1 = stream.method426();
  10275. int i4 = anInt1268 + (j1 >> 4 & 7);
  10276. int l6 = anInt1269 + (j1 & 7);
  10277. int k9 = stream.readUnsignedWord();
  10278. if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  10279. {
  10280. NodeList class19 = groundArray[plane][i4][l6];
  10281. if(class19 != null)
  10282. {
  10283. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  10284. {
  10285. if(item.ID != (k9 & 0x7fff))
  10286. continue;
  10287. item.unlink();
  10288. break;
  10289. }
  10290.  
  10291. if(class19.reverseGetFirst() == null)
  10292. groundArray[plane][i4][l6] = null;
  10293. spawnGroundItem(i4, l6);
  10294. }
  10295. }
  10296. return;
  10297. }
  10298. if(j == 160)
  10299. {
  10300. int k1 = stream.method428();
  10301. int j4 = anInt1268 + (k1 >> 4 & 7);
  10302. int i7 = anInt1269 + (k1 & 7);
  10303. int l9 = stream.method428();
  10304. int j12 = l9 >> 2;
  10305. int k14 = l9 & 3;
  10306. int j16 = anIntArray1177[j12];
  10307. int j17 = stream.method435();
  10308. if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  10309. {
  10310. int j18 = intGroundArray[plane][j4][i7];
  10311. int i19 = intGroundArray[plane][j4 + 1][i7];
  10312. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  10313. int k20 = intGroundArray[plane][j4][i7 + 1];
  10314. if(j16 == 0)
  10315. {
  10316. Object1 class10 = worldController.method296(plane, j4, i7);
  10317. if(class10 != null)
  10318. {
  10319. int k21 = class10.uid >> 14 & 0x7fff;
  10320. if(j12 == 2)
  10321. {
  10322. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  10323. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  10324. } else
  10325. {
  10326. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  10327. }
  10328. }
  10329. }
  10330. if(j16 == 1)
  10331. {
  10332. Object2 class26 = worldController.method297(j4, i7, plane);
  10333. if(class26 != null)
  10334. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  10335. }
  10336. if(j16 == 2)
  10337. {
  10338. Object5 class28 = worldController.method298(j4, i7, plane);
  10339. if(j12 == 11)
  10340. j12 = 10;
  10341. if(class28 != null)
  10342. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  10343. }
  10344. if(j16 == 3)
  10345. {
  10346. Object3 class49 = worldController.method299(i7, j4, plane);
  10347. if(class49 != null)
  10348. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  10349. }
  10350. }
  10351. return;
  10352. }
  10353. if(j == 147)
  10354. {
  10355. int l1 = stream.method428();
  10356. int k4 = anInt1268 + (l1 >> 4 & 7);
  10357. int j7 = anInt1269 + (l1 & 7);
  10358. int i10 = stream.readUnsignedWord();
  10359. byte byte0 = stream.method430();
  10360. int l14 = stream.method434();
  10361. byte byte1 = stream.method429();
  10362. int k17 = stream.readUnsignedWord();
  10363. int k18 = stream.method428();
  10364. int j19 = k18 >> 2;
  10365. int i20 = k18 & 3;
  10366. int l20 = anIntArray1177[j19];
  10367. byte byte2 = stream.readSignedByte();
  10368. int l21 = stream.readUnsignedWord();
  10369. byte byte3 = stream.method429();
  10370. Player player;
  10371. if(i10 == unknownInt10)
  10372. player = myPlayer;
  10373. else
  10374. player = playerArray[i10];
  10375. if(player != null)
  10376. {
  10377. ObjectDef class46 = ObjectDef.forID(l21);
  10378. int i22 = intGroundArray[plane][k4][j7];
  10379. int j22 = intGroundArray[plane][k4 + 1][j7];
  10380. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  10381. int l22 = intGroundArray[plane][k4][j7 + 1];
  10382. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  10383. if(model != null)
  10384. {
  10385. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  10386. player.anInt1707 = l14 + loopCycle;
  10387. player.anInt1708 = k17 + loopCycle;
  10388. player.aModel_1714 = model;
  10389. int i23 = class46.anInt744;
  10390. int j23 = class46.anInt761;
  10391. if(i20 == 1 || i20 == 3)
  10392. {
  10393. i23 = class46.anInt761;
  10394. j23 = class46.anInt744;
  10395. }
  10396. player.anInt1711 = k4 * 128 + i23 * 64;
  10397. player.anInt1713 = j7 * 128 + j23 * 64;
  10398. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  10399. if(byte2 > byte0)
  10400. {
  10401. byte byte4 = byte2;
  10402. byte2 = byte0;
  10403. byte0 = byte4;
  10404. }
  10405. if(byte3 > byte1)
  10406. {
  10407. byte byte5 = byte3;
  10408. byte3 = byte1;
  10409. byte1 = byte5;
  10410. }
  10411. player.anInt1719 = k4 + byte2;
  10412. player.anInt1721 = k4 + byte0;
  10413. player.anInt1720 = j7 + byte3;
  10414. player.anInt1722 = j7 + byte1;
  10415. }
  10416. }
  10417. }
  10418. if(j == 151)
  10419. {
  10420. int i2 = stream.method426();
  10421. int l4 = anInt1268 + (i2 >> 4 & 7);
  10422. int k7 = anInt1269 + (i2 & 7);
  10423. int j10 = stream.method434();
  10424. int k12 = stream.method428();
  10425. int i15 = k12 >> 2;
  10426. int k16 = k12 & 3;
  10427. int l17 = anIntArray1177[i15];
  10428. if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  10429. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  10430. return;
  10431. }
  10432. if(j == 4)
  10433. {
  10434. int j2 = stream.readUnsignedByte();
  10435. int i5 = anInt1268 + (j2 >> 4 & 7);
  10436. int l7 = anInt1269 + (j2 & 7);
  10437. int k10 = stream.readUnsignedWord();
  10438. int l12 = stream.readUnsignedByte();
  10439. int j15 = stream.readUnsignedWord();
  10440. if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  10441. {
  10442. i5 = i5 * 128 + 64;
  10443. l7 = l7 * 128 + 64;
  10444. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  10445. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  10446. }
  10447. return;
  10448. }
  10449. if(j == 44)
  10450. {
  10451. int k2 = stream.method436();
  10452. int j5 = stream.readUnsignedWord();
  10453. int i8 = stream.readUnsignedByte();
  10454. int l10 = anInt1268 + (i8 >> 4 & 7);
  10455. int i13 = anInt1269 + (i8 & 7);
  10456. if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  10457. {
  10458. Item class30_sub2_sub4_sub2_1 = new Item();
  10459. class30_sub2_sub4_sub2_1.ID = k2;
  10460. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  10461. if(groundArray[plane][l10][i13] == null)
  10462. groundArray[plane][l10][i13] = new NodeList();
  10463. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  10464. spawnGroundItem(l10, i13);
  10465. }
  10466. return;
  10467. }
  10468. if(j == 101)
  10469. {
  10470. int l2 = stream.method427();
  10471. int k5 = l2 >> 2;
  10472. int j8 = l2 & 3;
  10473. int i11 = anIntArray1177[k5];
  10474. int j13 = stream.readUnsignedByte();
  10475. int k15 = anInt1268 + (j13 >> 4 & 7);
  10476. int l16 = anInt1269 + (j13 & 7);
  10477. if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  10478. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  10479. return;
  10480. }
  10481. if(j == 117)
  10482. {
  10483. int i3 = stream.readUnsignedByte();
  10484. int l5 = anInt1268 + (i3 >> 4 & 7);
  10485. int k8 = anInt1269 + (i3 & 7);
  10486. int j11 = l5 + stream.readSignedByte();
  10487. int k13 = k8 + stream.readSignedByte();
  10488. int l15 = stream.readSignedWord();
  10489. int i17 = stream.readUnsignedWord();
  10490. int i18 = stream.readUnsignedByte() * 4;
  10491. int l18 = stream.readUnsignedByte() * 4;
  10492. int k19 = stream.readUnsignedWord();
  10493. int j20 = stream.readUnsignedWord();
  10494. int i21 = stream.readUnsignedByte();
  10495. int j21 = stream.readUnsignedByte();
  10496. if(l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535)
  10497. {
  10498. l5 = l5 * 128 + 64;
  10499. k8 = k8 * 128 + 64;
  10500. j11 = j11 * 128 + 64;
  10501. k13 = k13 * 128 + 64;
  10502. 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);
  10503. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  10504. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  10505. }
  10506. }
  10507. }
  10508.  
  10509. private static void setLowMem()
  10510. {
  10511. WorldController.lowMem = true;
  10512. Texture.lowMem = true;
  10513. lowMem = true;
  10514. ObjectManager.lowMem = true;
  10515. ObjectDef.lowMem = true;
  10516. }
  10517.  
  10518. private void method139(Stream stream)
  10519. {
  10520. stream.initBitAccess();
  10521. int k = stream.readBits(8);
  10522. if(k < npcCount)
  10523. {
  10524. for(int l = k; l < npcCount; l++)
  10525. anIntArray840[anInt839++] = npcIndices[l];
  10526.  
  10527. }
  10528. if(k > npcCount)
  10529. {
  10530. signlink.reporterror(myUsername + " Too many npcs");
  10531. throw new RuntimeException("eek");
  10532. }
  10533. npcCount = 0;
  10534. for(int i1 = 0; i1 < k; i1++)
  10535. {
  10536. int j1 = npcIndices[i1];
  10537. NPC npc = npcArray[j1];
  10538. int k1 = stream.readBits(1);
  10539. if(k1 == 0)
  10540. {
  10541. npcIndices[npcCount++] = j1;
  10542. npc.anInt1537 = loopCycle;
  10543. } else
  10544. {
  10545. int l1 = stream.readBits(2);
  10546. if(l1 == 0)
  10547. {
  10548. npcIndices[npcCount++] = j1;
  10549. npc.anInt1537 = loopCycle;
  10550. anIntArray894[anInt893++] = j1;
  10551. } else
  10552. if(l1 == 1)
  10553. {
  10554. npcIndices[npcCount++] = j1;
  10555. npc.anInt1537 = loopCycle;
  10556. int i2 = stream.readBits(3);
  10557. npc.moveInDir(false, i2);
  10558. int k2 = stream.readBits(1);
  10559. if(k2 == 1)
  10560. anIntArray894[anInt893++] = j1;
  10561. } else
  10562. if(l1 == 2)
  10563. {
  10564. npcIndices[npcCount++] = j1;
  10565. npc.anInt1537 = loopCycle;
  10566. int j2 = stream.readBits(3);
  10567. npc.moveInDir(true, j2);
  10568. int l2 = stream.readBits(3);
  10569. npc.moveInDir(true, l2);
  10570. int i3 = stream.readBits(1);
  10571. if(i3 == 1)
  10572. anIntArray894[anInt893++] = j1;
  10573. } else
  10574. if(l1 == 3)
  10575. anIntArray840[anInt839++] = j1;
  10576. }
  10577. }
  10578.  
  10579. }
  10580.  
  10581. private void processLoginScreenInput()
  10582. {
  10583. if(loginScreenState == 0)
  10584. {
  10585. int i = super.myWidth / 2 - 80;
  10586. int l = super.myHeight / 2 + 20;
  10587. l += 20;
  10588. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  10589. {
  10590. loginScreenState = 3;
  10591. loginScreenCursorPos = 0;
  10592. }
  10593. i = super.myWidth / 2 + 80;
  10594. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  10595. {
  10596. loginMessage1 = "";
  10597. loginMessage2 = "Enter your username & password.";
  10598. loginScreenState = 2;
  10599. loginScreenCursorPos = 0;
  10600. }
  10601. } else
  10602. {
  10603. if(loginScreenState == 2)
  10604. {
  10605. int j = super.myHeight / 2 - 40;
  10606. j += 30;
  10607. j += 25;
  10608. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10609. loginScreenCursorPos = 0;
  10610. j += 15;
  10611. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10612. loginScreenCursorPos = 1;
  10613. j += 15;
  10614. int i1 = super.myWidth / 2 - 80;
  10615. int k1 = super.myHeight / 2 + 50;
  10616. k1 += 20;
  10617. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  10618. {
  10619. loginFailures = 0;
  10620. login(myUsername, myPassword, false);
  10621. if(loggedIn)
  10622. return;
  10623. }
  10624. i1 = super.myWidth / 2 + 80;
  10625. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  10626. {
  10627. loginScreenState = 0;
  10628. // myUsername = "";
  10629. // myPassword = "";
  10630. }
  10631. do
  10632. {
  10633. int l1 = readChar(-796);
  10634. if(l1 == -1)
  10635. break;
  10636. boolean flag1 = false;
  10637. for(int i2 = 0; i2 < validUserPassChars.length(); i2++)
  10638. {
  10639. if(l1 != validUserPassChars.charAt(i2))
  10640. continue;
  10641. flag1 = true;
  10642. break;
  10643. }
  10644.  
  10645. if(loginScreenCursorPos == 0)
  10646. {
  10647. if(l1 == 8 && myUsername.length() > 0)
  10648. myUsername = myUsername.substring(0, myUsername.length() - 1);
  10649. if(l1 == 9 || l1 == 10 || l1 == 13)
  10650. loginScreenCursorPos = 1;
  10651. if(flag1)
  10652. myUsername += (char)l1;
  10653. if(myUsername.length() > 12)
  10654. myUsername = myUsername.substring(0, 12);
  10655. } else
  10656. if(loginScreenCursorPos == 1)
  10657. {
  10658. if(l1 == 8 && myPassword.length() > 0)
  10659. myPassword = myPassword.substring(0, myPassword.length() - 1);
  10660. if(l1 == 9 || l1 == 10 || l1 == 13)
  10661. loginScreenCursorPos = 0;
  10662. if(flag1)
  10663. myPassword += (char)l1;
  10664. if(myPassword.length() > 20)
  10665. myPassword = myPassword.substring(0, 20);
  10666. }
  10667. } while(true);
  10668. return;
  10669. }
  10670. if(loginScreenState == 3)
  10671. {
  10672. int k = super.myWidth / 2;
  10673. int j1 = super.myHeight / 2 + 50;
  10674. j1 += 20;
  10675. if(super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75 && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  10676. loginScreenState = 0;
  10677. }
  10678. }
  10679. }
  10680.  
  10681. private void markMinimap(Sprite sprite, int i, int j) {
  10682. int k = minimapInt1 + minimapInt2 & 0x7ff;
  10683. int l = i * i + j * j;
  10684. if(l > 6400)
  10685. return;
  10686. int i1 = Model.modelIntArray1[k];
  10687. int j1 = Model.modelIntArray2[k];
  10688. i1 = (i1 * 256) / (minimapInt3 + 256);
  10689. j1 = (j1 * 256) / (minimapInt3 + 256);
  10690. int k1 = j * i1 + i * j1 >> 16;
  10691. int l1 = j * j1 - i * i1 >> 16;
  10692. if(l > 2500) {
  10693. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 , 83 - l1 - sprite.anInt1445 / 2 - 4);
  10694. } else {
  10695. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4, 83 - l1 - sprite.anInt1445 / 2 - 4);
  10696. }
  10697. }
  10698.  
  10699. private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  10700. )
  10701. {
  10702. if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  10703. {
  10704. if(lowMem && j != plane)
  10705. return;
  10706. int i2 = 0;
  10707. if(j1 == 0)
  10708. i2 = worldController.method300(j, i1, i);
  10709. if(j1 == 1)
  10710. i2 = worldController.method301(j, i1, i);
  10711. if(j1 == 2)
  10712. i2 = worldController.method302(j, i1, i);
  10713. if(j1 == 3)
  10714. i2 = worldController.method303(j, i1, i);
  10715. if(i2 != 0)
  10716. {
  10717. int i3 = worldController.method304(j, i1, i, i2);
  10718. int j2 = i2 >> 14 & 0x7fff;
  10719. int k2 = i3 & 0x1f;
  10720. int l2 = i3 >> 6;
  10721. if(j1 == 0)
  10722. {
  10723. worldController.method291(i1, j, i, (byte)-119);
  10724. ObjectDef class46 = ObjectDef.forID(j2);
  10725. if(class46.aBoolean767)
  10726. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  10727. }
  10728. if(j1 == 1)
  10729. worldController.method292(i, j, i1);
  10730. if(j1 == 2)
  10731. {
  10732. worldController.method293(j, i1, i);
  10733. ObjectDef class46_1 = ObjectDef.forID(j2);
  10734. if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  10735. return;
  10736. if(class46_1.aBoolean767)
  10737. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  10738. }
  10739. if(j1 == 3)
  10740. {
  10741. worldController.method294(j, i, i1);
  10742. ObjectDef class46_2 = ObjectDef.forID(j2);
  10743. if(class46_2.aBoolean767 && class46_2.hasActions)
  10744. aClass11Array1230[j].method218(i, i1);
  10745. }
  10746. }
  10747. if(k1 >= 0)
  10748. {
  10749. int j3 = j;
  10750. if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  10751. j3++;
  10752. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  10753. }
  10754. }
  10755. }
  10756.  
  10757. private void updatePlayers(int i, Stream stream)
  10758. {
  10759. anInt839 = 0;
  10760. anInt893 = 0;
  10761. method117(stream);
  10762. method134(stream);
  10763. method91(stream, i);
  10764. method49(stream);
  10765. for(int k = 0; k < anInt839; k++)
  10766. {
  10767. int l = anIntArray840[k];
  10768. if(playerArray[l].anInt1537 != loopCycle)
  10769. playerArray[l] = null;
  10770. }
  10771.  
  10772. if(stream.currentOffset != i)
  10773. {
  10774. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  10775. throw new RuntimeException("eek");
  10776. }
  10777. for(int i1 = 0; i1 < playerCount; i1++)
  10778. if(playerArray[playerIndices[i1]] == null)
  10779. {
  10780. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  10781. throw new RuntimeException("eek");
  10782. }
  10783.  
  10784. }
  10785.  
  10786. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  10787. {
  10788. int l1 = 2048 - k & 0x7ff;
  10789. int i2 = 2048 - j1 & 0x7ff;
  10790. int j2 = 0;
  10791. int k2 = 0;
  10792. int l2 = j;
  10793. if(l1 != 0)
  10794. {
  10795. int i3 = Model.modelIntArray1[l1];
  10796. int k3 = Model.modelIntArray2[l1];
  10797. int i4 = k2 * k3 - l2 * i3 >> 16;
  10798. l2 = k2 * i3 + l2 * k3 >> 16;
  10799. k2 = i4;
  10800. }
  10801. if(i2 != 0)
  10802. {
  10803. /* xxx if(cameratoggle){
  10804. if(zoom == 0)
  10805. zoom = k2;
  10806. if(lftrit == 0)
  10807. lftrit = j2;
  10808. if(fwdbwd == 0)
  10809. fwdbwd = l2;
  10810. k2 = zoom;
  10811. j2 = lftrit;
  10812. l2 = fwdbwd;
  10813. }
  10814. */
  10815. int j3 = Model.modelIntArray1[i2];
  10816. int l3 = Model.modelIntArray2[i2];
  10817. int j4 = l2 * j3 + j2 * l3 >> 16;
  10818. l2 = l2 * l3 - j2 * j3 >> 16;
  10819. j2 = j4;
  10820. }
  10821. xCameraPos = l - j2;
  10822. zCameraPos = i1 - k2;
  10823. yCameraPos = k1 - l2;
  10824. yCameraCurve = k;
  10825. xCameraCurve = j1;
  10826. }
  10827.  
  10828. public void updateStrings(String str, int i) {
  10829. switch(i) {
  10830. case 1675: sendFrame126(str, 17508); break;//Stab
  10831. case 1676: sendFrame126(str, 17509); break;//Slash
  10832. case 1677: sendFrame126(str, 17510); break;//Cursh
  10833. case 1678: sendFrame126(str, 17511); break;//Magic
  10834. case 1679: sendFrame126(str, 17512); break;//Range
  10835. case 1680: sendFrame126(str, 17513); break;//Stab
  10836. case 1681: sendFrame126(str, 17514); break;//Slash
  10837. case 1682: sendFrame126(str, 17515); break;//Crush
  10838. case 1683: sendFrame126(str, 17516); break;//Magic
  10839. case 1684: sendFrame126(str, 17517); break;//Range
  10840. case 1686: sendFrame126(str, 17518); break;//Strength
  10841. case 1687: sendFrame126(str, 17519); break;//Prayer
  10842. }
  10843. }
  10844.  
  10845. public void sendFrame126(String str,int i) {
  10846. RSInterface.interfaceCache[i].message = str;
  10847. if(RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  10848. needDrawTabArea = true;
  10849. }
  10850.  
  10851. public void sendPacket185(int button,int toggle,int type) {
  10852. switch(type) {
  10853. case 135:
  10854. RSInterface class9 = RSInterface.interfaceCache[button];
  10855. boolean flag8 = true;
  10856. if(class9.contentType > 0)
  10857. flag8 = promptUserForInput(class9);
  10858. if(flag8) {
  10859. stream.createFrame(185);
  10860. stream.writeWord(button);
  10861. }
  10862. break;
  10863. case 646:
  10864. stream.createFrame(185);
  10865. stream.writeWord(button);
  10866. RSInterface class9_2 = RSInterface.interfaceCache[button];
  10867. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  10868. if(variousSettings[toggle] != class9_2.anIntArray212[0]) {
  10869. variousSettings[toggle] = class9_2.anIntArray212[0];
  10870. method33(toggle);
  10871. needDrawTabArea = true;
  10872. }
  10873. }
  10874. break;
  10875. case 169:
  10876. stream.createFrame(185);
  10877. stream.writeWord(button);
  10878. RSInterface class9_3 = RSInterface.interfaceCache[button];
  10879. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  10880. variousSettings[toggle] = 1 - variousSettings[toggle];
  10881. method33(toggle);
  10882. needDrawTabArea = true;
  10883. }
  10884. switch(button) {
  10885. case 19136:
  10886. System.out.println("toggle = "+toggle);
  10887. if(toggle == 0)
  10888. sendFrame36(173,toggle);
  10889. if(toggle == 1)
  10890. sendPacket185(153,173,646);
  10891. break;
  10892. }
  10893. break;
  10894. }
  10895. }
  10896.  
  10897. public void sendFrame36(int id,int state) {
  10898. anIntArray1045[id] = state;
  10899. if(variousSettings[id] != state) {
  10900. variousSettings[id] = state;
  10901. method33(id);
  10902. needDrawTabArea = true;
  10903. if(dialogID != -1)
  10904. inputTaken = true;
  10905. }
  10906. }
  10907.  
  10908. public void sendFrame219() {
  10909. if(invOverlayInterfaceID != -1) {
  10910. invOverlayInterfaceID = -1;
  10911. needDrawTabArea = true;
  10912. tabAreaAltered = true;
  10913. }
  10914. if(backDialogID != -1) {
  10915. backDialogID = -1;
  10916. inputTaken = true;
  10917. }
  10918. if(inputDialogState != 0) {
  10919. inputDialogState = 0;
  10920. inputTaken = true;
  10921. }
  10922. openInterfaceID = -1;
  10923. aBoolean1149 = false;
  10924. }
  10925.  
  10926. public void sendFrame248(int interfaceID,int sideInterfaceID) {
  10927. if(backDialogID != -1) {
  10928. backDialogID = -1;
  10929. inputTaken = true;
  10930. }
  10931. if(inputDialogState != 0) {
  10932. inputDialogState = 0;
  10933. inputTaken = true;
  10934. }
  10935. openInterfaceID = interfaceID;
  10936. invOverlayInterfaceID = sideInterfaceID;
  10937. needDrawTabArea = true;
  10938. tabAreaAltered = true;
  10939. aBoolean1149 = false;
  10940. }
  10941.  
  10942. private boolean parsePacket() {
  10943. if(socketStream == null)
  10944. return false;
  10945. try {
  10946. int i = socketStream.available();
  10947. if(i == 0)
  10948. return false;
  10949. if(pktType == -1) {
  10950. socketStream.flushInputStream(inStream.buffer, 1);
  10951. pktType = inStream.buffer[0] & 0xff;
  10952. if(encryption != null)
  10953. pktType = pktType - encryption.getNextKey() & 0xff;
  10954. pktSize = SizeConstants.packetSizes[pktType];
  10955. i--;
  10956. }
  10957. if(pktSize == -1)
  10958. if(i > 0) {
  10959. socketStream.flushInputStream(inStream.buffer, 1);
  10960. pktSize = inStream.buffer[0] & 0xff;
  10961. i--;
  10962. } else {
  10963. return false;
  10964. }
  10965. if(pktSize == -2)
  10966. if(i > 1) {
  10967. socketStream.flushInputStream(inStream.buffer, 2);
  10968. inStream.currentOffset = 0;
  10969. pktSize = inStream.readUnsignedWord();
  10970. i -= 2;
  10971. } else {
  10972. return false;
  10973. }
  10974. if(i < pktSize)
  10975. return false;
  10976. inStream.currentOffset = 0;
  10977. socketStream.flushInputStream(inStream.buffer, pktSize);
  10978. anInt1009 = 0;
  10979. anInt843 = anInt842;
  10980. anInt842 = anInt841;
  10981. anInt841 = pktType;
  10982. switch(pktType) {
  10983. case 81:
  10984. updatePlayers(pktSize, inStream);
  10985. aBoolean1080 = false;
  10986. pktType = -1;
  10987. return true;
  10988.  
  10989. case 176:
  10990. daysSinceRecovChange = inStream.method427();
  10991. unreadMessages = inStream.method435();
  10992. membersInt = inStream.readUnsignedByte();
  10993. anInt1193 = inStream.method440();
  10994. daysSinceLastLogin = inStream.readUnsignedWord();
  10995. if(anInt1193 != 0 && openInterfaceID == -1) {
  10996. signlink.dnslookup(TextClass.method586(anInt1193));
  10997. clearTopInterfaces();
  10998. char c = '\u028A';
  10999. if(daysSinceRecovChange != 201 || membersInt == 1)
  11000. c = '\u028F';
  11001. reportAbuseInput = "";
  11002. canMute = false;
  11003. for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  11004. if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  11005. continue;
  11006. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  11007.  
  11008. }
  11009. }
  11010. pktType = -1;
  11011. return true;
  11012.  
  11013. case 64:
  11014. anInt1268 = inStream.method427();
  11015. anInt1269 = inStream.method428();
  11016. for(int j = anInt1268; j < anInt1268 + 8; j++) {
  11017. for(int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  11018. if(groundArray[plane][j][l9] != null) {
  11019. groundArray[plane][j][l9] = null;
  11020. spawnGroundItem(j, l9);
  11021. }
  11022. }
  11023. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  11024. if(class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  11025. class30_sub1.anInt1294 = 0;
  11026. pktType = -1;
  11027. return true;
  11028.  
  11029. case 185:
  11030. int k = inStream.method436();
  11031. RSInterface.interfaceCache[k].anInt233 = 3;
  11032. if(myPlayer.desc == null)
  11033. 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];
  11034. else
  11035. RSInterface.interfaceCache[k].mediaID = (int)(0x12345678L + myPlayer.desc.type);
  11036. pktType = -1;
  11037. return true;
  11038.  
  11039. /* Clan chat packet */
  11040. case 217:
  11041. try {
  11042. name = inStream.readString();
  11043. message = inStream.readString();
  11044. clanname = inStream.readString();
  11045. rights = inStream.readUnsignedWord();
  11046. //message = TextInput.processText(message);
  11047. //message = Censor.doCensor(message);
  11048. System.out.println(clanname);
  11049. pushMessage(message, 16, name);
  11050. } catch(Exception e) {
  11051. e.printStackTrace();
  11052. }
  11053. pktType = -1;
  11054. return true;
  11055.  
  11056. case 107:
  11057. aBoolean1160 = false;
  11058. for(int l = 0; l < 5; l++)
  11059. aBooleanArray876[l] = false;
  11060. pktType = -1;
  11061. return true;
  11062.  
  11063. case 72:
  11064. int i1 = inStream.method434();
  11065. RSInterface class9 = RSInterface.interfaceCache[i1];
  11066. for(int k15 = 0; k15 < class9.inv.length; k15++) {
  11067. class9.inv[k15] = -1;
  11068. class9.inv[k15] = 0;
  11069. }
  11070. pktType = -1;
  11071. return true;
  11072.  
  11073. case 214:
  11074. ignoreCount = pktSize / 8;
  11075. for(int j1 = 0; j1 < ignoreCount; j1++)
  11076. ignoreListAsLongs[j1] = inStream.readQWord();
  11077. pktType = -1;
  11078. return true;
  11079.  
  11080. case 166:
  11081. aBoolean1160 = true;
  11082. anInt1098 = inStream.readUnsignedByte();
  11083. anInt1099 = inStream.readUnsignedByte();
  11084. anInt1100 = inStream.readUnsignedWord();
  11085. anInt1101 = inStream.readUnsignedByte();
  11086. anInt1102 = inStream.readUnsignedByte();
  11087. if(anInt1102 >= 100) {
  11088. xCameraPos = anInt1098 * 128 + 64;
  11089. yCameraPos = anInt1099 * 128 + 64;
  11090. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  11091. }
  11092. pktType = -1;
  11093. return true;
  11094.  
  11095. case 134:
  11096. needDrawTabArea = true;
  11097. int k1 = inStream.readUnsignedByte();
  11098. int i10 = inStream.method439();
  11099. int l15 = inStream.readUnsignedByte();
  11100. currentExp[k1] = i10;
  11101. currentStats[k1] = l15;
  11102. maxStats[k1] = 1;
  11103. for(int k20 = 0; k20 < 98; k20++)
  11104. if(i10 >= anIntArray1019[k20])
  11105. maxStats[k1] = k20 + 2;
  11106. pktType = -1;
  11107. return true;
  11108.  
  11109. case 71:
  11110. int l1 = inStream.readUnsignedWord();
  11111. int j10 = inStream.method426();
  11112. if(l1 == 65535)
  11113. l1 = -1;
  11114. tabInterfaceIDs[j10] = l1;
  11115. needDrawTabArea = true;
  11116. tabAreaAltered = true;
  11117. pktType = -1;
  11118. return true;
  11119.  
  11120. case 74:
  11121. int i2 = inStream.method434();
  11122. if(i2 == 65535)
  11123. i2 = -1;
  11124. if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  11125. nextSong = i2;
  11126. songChanging = true;
  11127. onDemandFetcher.method558(2, nextSong);
  11128. }
  11129. currentSong = i2;
  11130. pktType = -1;
  11131. return true;
  11132.  
  11133. case 121:
  11134. int j2 = inStream.method436();
  11135. int k10 = inStream.method435();
  11136. if(musicEnabled && !lowMem) {
  11137. nextSong = j2;
  11138. songChanging = false;
  11139. onDemandFetcher.method558(2, nextSong);
  11140. prevSong = k10;
  11141. }
  11142. pktType = -1;
  11143. return true;
  11144.  
  11145. case 109:
  11146. resetLogout();
  11147. pktType = -1;
  11148. return false;
  11149.  
  11150. case 70:
  11151. int k2 = inStream.readSignedWord();
  11152. int l10 = inStream.method437();
  11153. int i16 = inStream.method434();
  11154. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  11155. class9_5.anInt263 = k2;
  11156. class9_5.anInt265 = l10;
  11157. pktType = -1;
  11158. return true;
  11159.  
  11160. case 73:
  11161. case 241:
  11162. int l2 = anInt1069;
  11163. int i11 = anInt1070;
  11164. if(pktType == 73) {
  11165. l2 = inStream.method435();
  11166. i11 = inStream.readUnsignedWord();
  11167. aBoolean1159 = false;
  11168. }
  11169. if(pktType == 241) {
  11170. i11 = inStream.method435();
  11171. inStream.initBitAccess();
  11172. for(int j16 = 0; j16 < 4; j16++) {
  11173. for(int l20 = 0; l20 < 13; l20++) {
  11174. for(int j23 = 0; j23 < 13; j23++) {
  11175. int i26 = inStream.readBits(1);
  11176. if(i26 == 1)
  11177. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  11178. else
  11179. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  11180. }
  11181. }
  11182. }
  11183. inStream.finishBitAccess();
  11184. l2 = inStream.readUnsignedWord();
  11185. aBoolean1159 = true;
  11186. }
  11187. if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  11188. pktType = -1;
  11189. return true;
  11190. }
  11191. anInt1069 = l2;
  11192. anInt1070 = i11;
  11193. baseX = (anInt1069 - 6) * 8;
  11194. baseY = (anInt1070 - 6) * 8;
  11195. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  11196. if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  11197. aBoolean1141 = true;
  11198. loadingStage = 1;
  11199. aLong824 = System.currentTimeMillis();
  11200. aRSImageProducer_1165.initDrawingArea();
  11201. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  11202. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  11203. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  11204. if(pktType == 73) {
  11205. int k16 = 0;
  11206. for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  11207. for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  11208. k16++;
  11209. }
  11210. aByteArrayArray1183 = new byte[k16][];
  11211. aByteArrayArray1247 = new byte[k16][];
  11212. anIntArray1234 = new int[k16];
  11213. anIntArray1235 = new int[k16];
  11214. anIntArray1236 = new int[k16];
  11215. k16 = 0;
  11216. for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  11217. for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  11218. anIntArray1234[k16] = (l23 << 8) + j26;
  11219. if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  11220. anIntArray1235[k16] = -1;
  11221. anIntArray1236[k16] = -1;
  11222. k16++;
  11223. } else {
  11224. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  11225. if(k28 != -1)
  11226. onDemandFetcher.method558(3, k28);
  11227. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  11228. if(j30 != -1)
  11229. onDemandFetcher.method558(3, j30);
  11230. k16++;
  11231. }
  11232. }
  11233. }
  11234. }
  11235. if(pktType == 241) {
  11236. int l16 = 0;
  11237. int ai[] = new int[676];
  11238. for(int i24 = 0; i24 < 4; i24++) {
  11239. for(int k26 = 0; k26 < 13; k26++) {
  11240. for(int l28 = 0; l28 < 13; l28++) {
  11241. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  11242. if(k30 != -1) {
  11243. int k31 = k30 >> 14 & 0x3ff;
  11244. int i32 = k30 >> 3 & 0x7ff;
  11245. int k32 = (k31 / 8 << 8) + i32 / 8;
  11246. for(int j33 = 0; j33 < l16; j33++) {
  11247. if(ai[j33] != k32)
  11248. continue;
  11249. k32 = -1;
  11250.  
  11251. }
  11252. if(k32 != -1)
  11253. ai[l16++] = k32;
  11254. }
  11255. }
  11256. }
  11257. }
  11258. aByteArrayArray1183 = new byte[l16][];
  11259. aByteArrayArray1247 = new byte[l16][];
  11260. anIntArray1234 = new int[l16];
  11261. anIntArray1235 = new int[l16];
  11262. anIntArray1236 = new int[l16];
  11263. for(int l26 = 0; l26 < l16; l26++) {
  11264. int i29 = anIntArray1234[l26] = ai[l26];
  11265. int l30 = i29 >> 8 & 0xff;
  11266. int l31 = i29 & 0xff;
  11267. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  11268. if(j32 != -1)
  11269. onDemandFetcher.method558(3, j32);
  11270. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  11271. if(i33 != -1)
  11272. onDemandFetcher.method558(3, i33);
  11273. }
  11274. }
  11275. int i17 = baseX - anInt1036;
  11276. int j21 = baseY - anInt1037;
  11277. anInt1036 = baseX;
  11278. anInt1037 = baseY;
  11279. for(int j24 = 0; j24 < 16384; j24++) {
  11280. NPC npc = npcArray[j24];
  11281. if(npc != null) {
  11282. for(int j29 = 0; j29 < 10; j29++) {
  11283. npc.smallX[j29] -= i17;
  11284. npc.smallY[j29] -= j21;
  11285. }
  11286. npc.x -= i17 * 128;
  11287. npc.y -= j21 * 128;
  11288. }
  11289. }
  11290. for(int i27 = 0; i27 < maxPlayers; i27++) {
  11291. Player player = playerArray[i27];
  11292. if(player != null) {
  11293. for(int i31 = 0; i31 < 10; i31++) {
  11294. player.smallX[i31] -= i17;
  11295. player.smallY[i31] -= j21;
  11296. }
  11297. player.x -= i17 * 128;
  11298. player.y -= j21 * 128;
  11299. }
  11300. }
  11301. aBoolean1080 = true;
  11302. byte byte1 = 0;
  11303. byte byte2 = 104;
  11304. byte byte3 = 1;
  11305. if(i17 < 0) {
  11306. byte1 = 103;
  11307. byte2 = -1;
  11308. byte3 = -1;
  11309. }
  11310. byte byte4 = 0;
  11311. byte byte5 = 104;
  11312. byte byte6 = 1;
  11313. if(j21 < 0) {
  11314. byte4 = 103;
  11315. byte5 = -1;
  11316. byte6 = -1;
  11317. }
  11318. for(int k33 = byte1; k33 != byte2; k33 += byte3) {
  11319. for(int l33 = byte4; l33 != byte5; l33 += byte6) {
  11320. int i34 = k33 + i17;
  11321. int j34 = l33 + j21;
  11322. for(int k34 = 0; k34 < 4; k34++)
  11323. if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  11324. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  11325. else
  11326. groundArray[k34][k33][l33] = null;
  11327. }
  11328. }
  11329. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext()) {
  11330. class30_sub1_1.anInt1297 -= i17;
  11331. class30_sub1_1.anInt1298 -= j21;
  11332. if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  11333. class30_sub1_1.unlink();
  11334. }
  11335. if(destX != 0) {
  11336. destX -= i17;
  11337. destY -= j21;
  11338. }
  11339. aBoolean1160 = false;
  11340. pktType = -1;
  11341. return true;
  11342.  
  11343. case 208:
  11344. int i3 = inStream.method437();
  11345. if(i3 >= 0)
  11346. method60(i3);
  11347. anInt1018 = i3;
  11348. pktType = -1;
  11349. return true;
  11350.  
  11351. case 99:
  11352. anInt1021 = inStream.readUnsignedByte();
  11353. pktType = -1;
  11354. return true;
  11355.  
  11356. case 75:
  11357. int j3 = inStream.method436();
  11358. int j11 = inStream.method436();
  11359. RSInterface.interfaceCache[j11].anInt233 = 2;
  11360. RSInterface.interfaceCache[j11].mediaID = j3;
  11361. pktType = -1;
  11362. return true;
  11363.  
  11364. case 114:
  11365. anInt1104 = inStream.method434() * 30;
  11366. pktType = -1;
  11367. return true;
  11368.  
  11369. case 60:
  11370. anInt1269 = inStream.readUnsignedByte();
  11371. anInt1268 = inStream.method427();
  11372. while(inStream.currentOffset < pktSize) {
  11373. int k3 = inStream.readUnsignedByte();
  11374. method137(inStream, k3);
  11375. }
  11376. pktType = -1;
  11377. return true;
  11378.  
  11379. case 35:
  11380. int l3 = inStream.readUnsignedByte();
  11381. int k11 = inStream.readUnsignedByte();
  11382. int j17 = inStream.readUnsignedByte();
  11383. int k21 = inStream.readUnsignedByte();
  11384. aBooleanArray876[l3] = true;
  11385. anIntArray873[l3] = k11;
  11386. anIntArray1203[l3] = j17;
  11387. anIntArray928[l3] = k21;
  11388. anIntArray1030[l3] = 0;
  11389. pktType = -1;
  11390. return true;
  11391.  
  11392. case 174:
  11393. int i4 = inStream.readUnsignedWord();
  11394. int l11 = inStream.readUnsignedByte();
  11395. int k17 = inStream.readUnsignedWord();
  11396. if(aBoolean848 && !lowMem && anInt1062 < 50) {
  11397. anIntArray1207[anInt1062] = i4;
  11398. anIntArray1241[anInt1062] = l11;
  11399. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  11400. anInt1062++;
  11401. }
  11402. pktType = -1;
  11403. return true;
  11404.  
  11405. case 104:
  11406. int j4 = inStream.method427();
  11407. int i12 = inStream.method426();
  11408. String s6 = inStream.readString();
  11409. if(j4 >= 1 && j4 <= 5) {
  11410. if(s6.equalsIgnoreCase("null"))
  11411. s6 = null;
  11412. atPlayerActions[j4 - 1] = s6;
  11413. atPlayerArray[j4 - 1] = i12 == 0;
  11414. }
  11415. pktType = -1;
  11416. return true;
  11417.  
  11418. case 78:
  11419. destX = 0;
  11420. pktType = -1;
  11421. return true;
  11422.  
  11423. case 253:
  11424. String s = inStream.readString();
  11425. if(s.startsWith("Alert##")) {
  11426. String[] args = s.split("##");
  11427. if (args.length == 3) {
  11428. alertHandler.alert = new Alert("Notification", args[1], args[2]);
  11429. } else if (args.length == 4) {
  11430. alertHandler.alert = new Alert(args[1], args[2], args[3]);
  11431. }
  11432. pktType = -1;
  11433. return true;
  11434. }
  11435. if(s.endsWith(":tradereq:")) {
  11436. String s3 = s.substring(0, s.indexOf(":"));
  11437. long l17 = TextClass.longForName(s3);
  11438. boolean flag2 = false;
  11439. for(int j27 = 0; j27 < ignoreCount; j27++) {
  11440. if(ignoreListAsLongs[j27] != l17)
  11441. continue;
  11442. flag2 = true;
  11443.  
  11444. }
  11445. if(!flag2 && anInt1251 == 0)
  11446. pushMessage("wishes to trade with you.", 4, s3);
  11447. } else if (s.endsWith(":clan:")) {
  11448. String s4 = s.substring(0, s.indexOf(":"));
  11449. long l18 = TextClass.longForName(s4);
  11450. pushMessage("Clan: ", 8, s4);
  11451. } else if(s.endsWith("#url#")) {
  11452. String link = s.substring(0, s.indexOf("#"));
  11453. pushMessage("Join us at: ", 9, link);
  11454. } else if(s.endsWith(":duelreq:")) {
  11455. String s4 = s.substring(0, s.indexOf(":"));
  11456. long l18 = TextClass.longForName(s4);
  11457. boolean flag3 = false;
  11458. for(int k27 = 0; k27 < ignoreCount; k27++) {
  11459. if(ignoreListAsLongs[k27] != l18)
  11460. continue;
  11461. flag3 = true;
  11462.  
  11463. }
  11464. if(!flag3 && anInt1251 == 0)
  11465. pushMessage("wishes to duel with you.", 8, s4);
  11466. } else if(s.endsWith(":chalreq:")) {
  11467. String s5 = s.substring(0, s.indexOf(":"));
  11468. long l19 = TextClass.longForName(s5);
  11469. boolean flag4 = false;
  11470. for(int l27 = 0; l27 < ignoreCount; l27++) {
  11471. if(ignoreListAsLongs[l27] != l19)
  11472. continue;
  11473. flag4 = true;
  11474.  
  11475. }
  11476. if(!flag4 && anInt1251 == 0) {
  11477. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  11478. pushMessage(s8, 8, s5);
  11479. }
  11480. } else {
  11481. pushMessage(s, 0, "");
  11482. }
  11483. pktType = -1;
  11484. return true;
  11485.  
  11486. case 1:
  11487. for(int k4 = 0; k4 < playerArray.length; k4++)
  11488. if(playerArray[k4] != null)
  11489. playerArray[k4].anim = -1;
  11490. for(int j12 = 0; j12 < npcArray.length; j12++)
  11491. if(npcArray[j12] != null)
  11492. npcArray[j12].anim = -1;
  11493. pktType = -1;
  11494. return true;
  11495.  
  11496. case 50:
  11497. long l4 = inStream.readQWord();
  11498. int i18 = inStream.readUnsignedByte();
  11499. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  11500. for(int k24 = 0; k24 < friendsCount; k24++) {
  11501. if(l4 != friendsListAsLongs[k24])
  11502. continue;
  11503. if(friendsNodeIDs[k24] != i18) {
  11504. friendsNodeIDs[k24] = i18;
  11505. needDrawTabArea = true;
  11506. if(i18 >= 2) {
  11507. pushMessage(s7 + " has logged in.", 5, "");
  11508. }
  11509. if(i18 <= 1) {
  11510. pushMessage(s7 + " has logged out.", 5, "");
  11511. }
  11512. }
  11513. s7 = null;
  11514.  
  11515. }
  11516. if(s7 != null && friendsCount < 200) {
  11517. friendsListAsLongs[friendsCount] = l4;
  11518. friendsList[friendsCount] = s7;
  11519. friendsNodeIDs[friendsCount] = i18;
  11520. friendsCount++;
  11521. needDrawTabArea = true;
  11522. }
  11523. for(boolean flag6 = false; !flag6;) {
  11524. flag6 = true;
  11525. for(int k29 = 0; k29 < friendsCount - 1; k29++)
  11526. if(friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  11527. int j31 = friendsNodeIDs[k29];
  11528. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  11529. friendsNodeIDs[k29 + 1] = j31;
  11530. String s10 = friendsList[k29];
  11531. friendsList[k29] = friendsList[k29 + 1];
  11532. friendsList[k29 + 1] = s10;
  11533. long l32 = friendsListAsLongs[k29];
  11534. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  11535. friendsListAsLongs[k29 + 1] = l32;
  11536. needDrawTabArea = true;
  11537. flag6 = false;
  11538. }
  11539. }
  11540. pktType = -1;
  11541. return true;
  11542.  
  11543. case 110:
  11544. if(tabID == 12)
  11545. needDrawTabArea = true;
  11546. energy = inStream.readUnsignedByte();
  11547. pktType = -1;
  11548. return true;
  11549.  
  11550. case 254:
  11551. anInt855 = inStream.readUnsignedByte();
  11552. if(anInt855 == 1)
  11553. anInt1222 = inStream.readUnsignedWord();
  11554. if(anInt855 >= 2 && anInt855 <= 6) {
  11555. if(anInt855 == 2) {
  11556. anInt937 = 64;
  11557. anInt938 = 64;
  11558. }
  11559. if(anInt855 == 3) {
  11560. anInt937 = 0;
  11561. anInt938 = 64;
  11562. }
  11563. if(anInt855 == 4) {
  11564. anInt937 = 128;
  11565. anInt938 = 64;
  11566. }
  11567. if(anInt855 == 5) {
  11568. anInt937 = 64;
  11569. anInt938 = 0;
  11570. }
  11571. if(anInt855 == 6) {
  11572. anInt937 = 64;
  11573. anInt938 = 128;
  11574. }
  11575. anInt855 = 2;
  11576. anInt934 = inStream.readUnsignedWord();
  11577. anInt935 = inStream.readUnsignedWord();
  11578. anInt936 = inStream.readUnsignedByte();
  11579. }
  11580. if(anInt855 == 10)
  11581. anInt933 = inStream.readUnsignedWord();
  11582. pktType = -1;
  11583. return true;
  11584.  
  11585. case 248:
  11586. int i5 = inStream.method435();
  11587. int k12 = inStream.readUnsignedWord();
  11588. if(backDialogID != -1) {
  11589. backDialogID = -1;
  11590. inputTaken = true;
  11591. }
  11592. if(inputDialogState != 0) {
  11593. inputDialogState = 0;
  11594. inputTaken = true;
  11595. }
  11596. openInterfaceID = i5;
  11597. invOverlayInterfaceID = k12;
  11598. needDrawTabArea = true;
  11599. tabAreaAltered = true;
  11600. aBoolean1149 = false;
  11601. pktType = -1;
  11602. return true;
  11603.  
  11604. case 79:
  11605. int j5 = inStream.method434();
  11606. int l12 = inStream.method435();
  11607. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  11608. if(class9_3 != null && class9_3.type == 0) {
  11609. if(l12 < 0)
  11610. l12 = 0;
  11611. if(l12 > class9_3.scrollMax - class9_3.height)
  11612. l12 = class9_3.scrollMax - class9_3.height;
  11613. class9_3.scrollPosition = l12;
  11614. }
  11615. pktType = -1;
  11616. return true;
  11617.  
  11618. case 68:
  11619. for(int k5 = 0; k5 < variousSettings.length; k5++)
  11620. if(variousSettings[k5] != anIntArray1045[k5]) {
  11621. variousSettings[k5] = anIntArray1045[k5];
  11622. method33(k5);
  11623. needDrawTabArea = true;
  11624. }
  11625. pktType = -1;
  11626. return true;
  11627.  
  11628. case 196:
  11629. long l5 = inStream.readQWord();
  11630. int j18 = inStream.readDWord();
  11631. int l21 = inStream.readUnsignedByte();
  11632. boolean flag5 = false;
  11633. for(int i28 = 0; i28 < 100; i28++) {
  11634. if(anIntArray1240[i28] != j18)
  11635. continue;
  11636. flag5 = true;
  11637.  
  11638. }
  11639. if(l21 <= 1) {
  11640. for(int l29 = 0; l29 < ignoreCount; l29++) {
  11641. if(ignoreListAsLongs[l29] != l5)
  11642. continue;
  11643. flag5 = true;
  11644.  
  11645. }
  11646. }
  11647. if(!flag5 && anInt1251 == 0)
  11648. try {
  11649. anIntArray1240[anInt1169] = j18;
  11650. anInt1169 = (anInt1169 + 1) % 100;
  11651. String s9 = TextInput.method525(pktSize - 13, inStream);
  11652. //if(l21 != 3)
  11653. //s9 = Censor.doCensor(s9);
  11654. if(l21 == 2 || l21 == 3)
  11655. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11656. else
  11657. if(l21 == 1)
  11658. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11659. else
  11660. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  11661. } catch(Exception exception1) {
  11662. signlink.reporterror("cde1");
  11663. }
  11664. pktType = -1;
  11665. return true;
  11666.  
  11667. case 85:
  11668. anInt1269 = inStream.method427();
  11669. anInt1268 = inStream.method427();
  11670. pktType = -1;
  11671. return true;
  11672.  
  11673. case 24:
  11674. anInt1054 = inStream.method428();
  11675. if(anInt1054 == tabID) {
  11676. if(anInt1054 == 3)
  11677. tabID = 1;
  11678. else
  11679. tabID = 3;
  11680. needDrawTabArea = true;
  11681. }
  11682. pktType = -1;
  11683. return true;
  11684.  
  11685. case 246:
  11686. int i6 = inStream.method434();
  11687. int i13 = inStream.readUnsignedWord();
  11688. int k18 = inStream.readUnsignedWord();
  11689. if(k18 == 65535) {
  11690. RSInterface.interfaceCache[i6].anInt233 = 0;
  11691. pktType = -1;
  11692. return true;
  11693. } else {
  11694. ItemDef itemDef = ItemDef.forID(k18);
  11695. RSInterface.interfaceCache[i6].anInt233 = 4;
  11696. RSInterface.interfaceCache[i6].mediaID = k18;
  11697. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotation1;
  11698. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotation2;
  11699. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  11700. pktType = -1;
  11701. return true;
  11702. }
  11703.  
  11704. case 171:
  11705. boolean flag1 = inStream.readUnsignedByte() == 1;
  11706. int j13 = inStream.readUnsignedWord();
  11707. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  11708. pktType = -1;
  11709. return true;
  11710.  
  11711. case 142:
  11712. int j6 = inStream.method434();
  11713. method60(j6);
  11714. if(backDialogID != -1) {
  11715. backDialogID = -1;
  11716. inputTaken = true;
  11717. }
  11718. if(inputDialogState != 0) {
  11719. inputDialogState = 0;
  11720. inputTaken = true;
  11721. }
  11722. invOverlayInterfaceID = j6;
  11723. needDrawTabArea = true;
  11724. tabAreaAltered = true;
  11725. openInterfaceID = -1;
  11726. aBoolean1149 = false;
  11727. pktType = -1;
  11728. return true;
  11729.  
  11730. case 126:
  11731. String text = inStream.readString();
  11732. int frame = inStream.method435();
  11733. if (text.startsWith("www.")) {
  11734. launchURL(text);
  11735. pktType = -1;
  11736. return true;
  11737. }
  11738. updateStrings(text, frame);
  11739. sendFrame126(text, frame);
  11740. if (frame >= 18144 && frame <= 18244) {
  11741. clanList[frame - 18144] = text;
  11742. }
  11743. pktType = -1;
  11744. return true;
  11745.  
  11746. case 206:
  11747. publicChatMode = inStream.readUnsignedByte();
  11748. privateChatMode = inStream.readUnsignedByte();
  11749. tradeMode = inStream.readUnsignedByte();
  11750. aBoolean1233 = true;
  11751. inputTaken = true;
  11752. pktType = -1;
  11753. return true;
  11754.  
  11755. case 240:
  11756. if(tabID == 12)
  11757. needDrawTabArea = true;
  11758. weight = inStream.readSignedWord();
  11759. pktType = -1;
  11760. return true;
  11761.  
  11762. case 8:
  11763. int k6 = inStream.method436();
  11764. int l13 = inStream.readUnsignedWord();
  11765. RSInterface.interfaceCache[k6].anInt233 = 1;
  11766. RSInterface.interfaceCache[k6].mediaID = l13;
  11767. pktType = -1;
  11768. return true;
  11769.  
  11770. case 122:
  11771. int l6 = inStream.method436();
  11772. int i14 = inStream.method436();
  11773. int i19 = i14 >> 10 & 0x1f;
  11774. int i22 = i14 >> 5 & 0x1f;
  11775. int l24 = i14 & 0x1f;
  11776. RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  11777. pktType = -1;
  11778. return true;
  11779.  
  11780. case 53:
  11781. needDrawTabArea = true;
  11782. int i7 = inStream.readUnsignedWord();
  11783. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  11784. int j19 = inStream.readUnsignedWord();
  11785. for(int j22 = 0; j22 < j19; j22++) {
  11786. int i25 = inStream.readUnsignedByte();
  11787. if(i25 == 255)
  11788. i25 = inStream.method440();
  11789. class9_1.inv[j22] = inStream.method436();
  11790. class9_1.invStackSizes[j22] = i25;
  11791. }
  11792. for(int j25 = j19; j25 < class9_1.inv.length; j25++) {
  11793. class9_1.inv[j25] = 0;
  11794. class9_1.invStackSizes[j25] = 0;
  11795. }
  11796. pktType = -1;
  11797. return true;
  11798.  
  11799. case 230:
  11800. int j7 = inStream.method435();
  11801. int j14 = inStream.readUnsignedWord();
  11802. int k19 = inStream.readUnsignedWord();
  11803. int k22 = inStream.method436();
  11804. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  11805. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  11806. RSInterface.interfaceCache[j14].modelZoom = j7;
  11807. pktType = -1;
  11808. return true;
  11809.  
  11810. case 221:
  11811. anInt900 = inStream.readUnsignedByte();
  11812. needDrawTabArea = true;
  11813. pktType = -1;
  11814. return true;
  11815.  
  11816. case 177:
  11817. aBoolean1160 = true;
  11818. anInt995 = inStream.readUnsignedByte();
  11819. anInt996 = inStream.readUnsignedByte();
  11820. anInt997 = inStream.readUnsignedWord();
  11821. anInt998 = inStream.readUnsignedByte();
  11822. anInt999 = inStream.readUnsignedByte();
  11823. if(anInt999 >= 100) {
  11824. int k7 = anInt995 * 128 + 64;
  11825. int k14 = anInt996 * 128 + 64;
  11826. int i20 = method42(plane, k14, k7) - anInt997;
  11827. int l22 = k7 - xCameraPos;
  11828. int k25 = i20 - zCameraPos;
  11829. int j28 = k14 - yCameraPos;
  11830. int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  11831. yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  11832. xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  11833. if(yCameraCurve < 128)
  11834. yCameraCurve = 128;
  11835. if(yCameraCurve > 383)
  11836. yCameraCurve = 383;
  11837. }
  11838. pktType = -1;
  11839. return true;
  11840.  
  11841. case 249:
  11842. anInt1046 = inStream.method426();
  11843. unknownInt10 = inStream.method436();
  11844. pktType = -1;
  11845. return true;
  11846.  
  11847. case 65:
  11848. updateNPCs(inStream, pktSize);
  11849. pktType = -1;
  11850. return true;
  11851.  
  11852. case 27:
  11853. messagePromptRaised = false;
  11854. inputDialogState = 1;
  11855. amountOrNameInput = "";
  11856. inputTaken = true;
  11857. pktType = -1;
  11858. return true;
  11859.  
  11860. case 187:
  11861. messagePromptRaised = false;
  11862. inputDialogState = 2;
  11863. amountOrNameInput = "";
  11864. inputTaken = true;
  11865. pktType = -1;
  11866. return true;
  11867.  
  11868. case 97:
  11869. int l7 = inStream.readUnsignedWord();
  11870. method60(l7);
  11871. if(invOverlayInterfaceID != -1) {
  11872. invOverlayInterfaceID = -1;
  11873. needDrawTabArea = true;
  11874. tabAreaAltered = true;
  11875. }
  11876. if(backDialogID != -1) {
  11877. backDialogID = -1;
  11878. inputTaken = true;
  11879. }
  11880. if(inputDialogState != 0) {
  11881. inputDialogState = 0;
  11882. inputTaken = true;
  11883. }
  11884. openInterfaceID = l7;
  11885. aBoolean1149 = false;
  11886. pktType = -1;
  11887. return true;
  11888.  
  11889. case 218:
  11890. int i8 = inStream.method438();
  11891. dialogID = i8;
  11892. inputTaken = true;
  11893. pktType = -1;
  11894. return true;
  11895.  
  11896. case 87:
  11897. int j8 = inStream.method434();
  11898. int l14 = inStream.method439();
  11899. anIntArray1045[j8] = l14;
  11900. if(variousSettings[j8] != l14) {
  11901. variousSettings[j8] = l14;
  11902. method33(j8);
  11903. needDrawTabArea = true;
  11904. if(dialogID != -1)
  11905. inputTaken = true;
  11906. }
  11907. pktType = -1;
  11908. return true;
  11909.  
  11910. case 36:
  11911. int k8 = inStream.method434();
  11912. byte byte0 = inStream.readSignedByte();
  11913. anIntArray1045[k8] = byte0;
  11914. if(variousSettings[k8] != byte0) {
  11915. variousSettings[k8] = byte0;
  11916. method33(k8);
  11917. needDrawTabArea = true;
  11918. if(dialogID != -1)
  11919. inputTaken = true;
  11920. }
  11921. pktType = -1;
  11922. return true;
  11923.  
  11924. case 61:
  11925. anInt1055 = inStream.readUnsignedByte();
  11926. pktType = -1;
  11927. return true;
  11928.  
  11929. case 200:
  11930. int l8 = inStream.readUnsignedWord();
  11931. int i15 = inStream.readSignedWord();
  11932. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  11933. class9_4.anInt257 = i15;
  11934. if(i15 == -1) {
  11935. class9_4.anInt246 = 0;
  11936. class9_4.anInt208 = 0;
  11937. }
  11938. pktType = -1;
  11939. return true;
  11940.  
  11941. case 219:
  11942. if(invOverlayInterfaceID != -1) {
  11943. invOverlayInterfaceID = -1;
  11944. needDrawTabArea = true;
  11945. tabAreaAltered = true;
  11946. }
  11947. if(backDialogID != -1) {
  11948. backDialogID = -1;
  11949. inputTaken = true;
  11950. }
  11951. if(inputDialogState != 0) {
  11952. inputDialogState = 0;
  11953. inputTaken = true;
  11954. }
  11955. openInterfaceID = -1;
  11956. aBoolean1149 = false;
  11957. pktType = -1;
  11958. return true;
  11959.  
  11960. case 34:
  11961. needDrawTabArea = true;
  11962. int i9 = inStream.readUnsignedWord();
  11963. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  11964. while(inStream.currentOffset < pktSize) {
  11965. int j20 = inStream.method422();
  11966. int i23 = inStream.readUnsignedWord();
  11967. int l25 = inStream.readUnsignedByte();
  11968. if(l25 == 255)
  11969. l25 = inStream.readDWord();
  11970. if(j20 >= 0 && j20 < class9_2.inv.length) {
  11971. class9_2.inv[j20] = i23;
  11972. class9_2.invStackSizes[j20] = l25;
  11973. }
  11974. }
  11975. pktType = -1;
  11976. return true;
  11977.  
  11978. case 4:
  11979. case 44:
  11980. case 84:
  11981. case 101:
  11982. case 105:
  11983. case 117:
  11984. case 147:
  11985. case 151:
  11986. case 156:
  11987. case 160:
  11988. case 215:
  11989. method137(inStream, pktType);
  11990. pktType = -1;
  11991. return true;
  11992.  
  11993. case 106:
  11994. tabID = inStream.method427();
  11995. needDrawTabArea = true;
  11996. tabAreaAltered = true;
  11997. pktType = -1;
  11998. return true;
  11999.  
  12000. case 164:
  12001. int j9 = inStream.method434();
  12002. method60(j9);
  12003. if(invOverlayInterfaceID != -1) {
  12004. invOverlayInterfaceID = -1;
  12005. needDrawTabArea = true;
  12006. tabAreaAltered = true;
  12007. }
  12008. backDialogID = j9;
  12009. inputTaken = true;
  12010. openInterfaceID = -1;
  12011. aBoolean1149 = false;
  12012. pktType = -1;
  12013. return true;
  12014.  
  12015. }
  12016. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  12017. //resetLogout();
  12018. } catch(IOException _ex) {
  12019. dropClient();
  12020. } catch(Exception exception) {
  12021. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  12022. for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  12023. s2 = s2 + inStream.buffer[j15] + ",";
  12024. signlink.reporterror(s2);
  12025. //resetLogout();
  12026. }
  12027. pktType = -1;
  12028. return true;
  12029. }
  12030.  
  12031. private void method146() {
  12032. anInt1265++;
  12033. method47(true);
  12034. method26(true);
  12035. method47(false);
  12036. method26(false);
  12037. method55();
  12038. method104();
  12039. if(!aBoolean1160) {
  12040. int i = anInt1184;
  12041. if(anInt984 / 256 > i)
  12042. i = anInt984 / 256;
  12043. if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  12044. i = anIntArray1203[4] + 128;
  12045. int k = minimapInt1 + anInt896 & 0x7ff;
  12046. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  12047. }
  12048. int j;
  12049. if(!aBoolean1160)
  12050. j = method120();
  12051. else
  12052. j = method121();
  12053. int l = xCameraPos;
  12054. int i1 = zCameraPos;
  12055. int j1 = yCameraPos;
  12056. int k1 = yCameraCurve;
  12057. int l1 = xCameraCurve;
  12058. for(int i2 = 0; i2 < 5; i2++)
  12059. if(aBooleanArray876[i2]) {
  12060. 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]);
  12061. if(i2 == 0)
  12062. xCameraPos += j2;
  12063. if(i2 == 1)
  12064. zCameraPos += j2;
  12065. if(i2 == 2)
  12066. yCameraPos += j2;
  12067. if(i2 == 3)
  12068. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  12069. if(i2 == 4) {
  12070. yCameraCurve += j2;
  12071. if(yCameraCurve < 128)
  12072. yCameraCurve = 128;
  12073. if(yCameraCurve > 383)
  12074. yCameraCurve = 383;
  12075. }
  12076. }
  12077. int k2 = Texture.anInt1481;
  12078. Model.aBoolean1684 = true;
  12079. Model.anInt1687 = 0;
  12080. Model.anInt1685 = super.mouseX - 4;
  12081. Model.anInt1686 = super.mouseY - 4;
  12082. DrawingArea.setAllPixelsToZero();
  12083. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  12084. worldController.clearObj5Cache();
  12085. updateEntities();
  12086. drawHeadIcon();
  12087. method37(k2);
  12088. draw3dScreen();
  12089. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  12090. xCameraPos = l;
  12091. zCameraPos = i1;
  12092. yCameraPos = j1;
  12093. yCameraCurve = k1;
  12094. xCameraCurve = l1;
  12095. }
  12096. public void drawRunOrb() {
  12097. if (!runClicked) {
  12098. if (super.mouseX > 710 && super.mouseX < 742 && super.mouseY > 88 && super.mouseY < 122) {
  12099. hoverorbrun.drawSprite(165, 85);
  12100. } else {
  12101. runorb.drawSprite(165, 85);
  12102.  
  12103. }
  12104. } else {
  12105. if (super.mouseX > 710 && super.mouseX < 742 && super.mouseY > 88 && super.mouseY < 122) {
  12106. hoverorbrun2.drawSprite(165, 85);
  12107. } else {
  12108. runClick.drawSprite(165, 85);
  12109. }
  12110. }
  12111. }
  12112. public void drawHPOrb() {
  12113. int health;
  12114. String cHP = RSInterface.interfaceCache[4016].message;
  12115. int currentHP = Integer.parseInt(cHP);
  12116. String mHP = RSInterface.interfaceCache[4017].message;
  12117. int maxHP2 = Integer.parseInt(mHP);
  12118. health = (int)(((double)currentHP / (double)maxHP2) * 100D);
  12119. /* Draws empty orb */
  12120. hitPointsBg.drawSprite(160, 12);
  12121. emptyOrb.drawSprite(160, 13);
  12122. hitPointsFill.drawSprite(163, 16);
  12123. heartIcon.drawSprite(169, 23);
  12124. /* Draws current HP text */
  12125. if(health > 100) {
  12126. smallText.method382(65280, 199, cHP, 38, true);
  12127. }
  12128. if(health <= 100 && health >= 75) {
  12129. smallText.method382(65280, 199, cHP, 38, true);
  12130. }
  12131. else if(health <= 74 && health >= 50) {
  12132. smallText.method382(0xffff00, 199, cHP, 38, true);
  12133. }
  12134. else if(health <= 49 && health >= 25) {
  12135. smallText.method382(0xfca607, 199, cHP, 38, true);
  12136. }
  12137. else if(health <= 24 && health >= 0) {
  12138. smallText.method382(0xf50d0d, 199, cHP, 38, true);
  12139. }
  12140. /* Draws inside orb sprites */
  12141. }
  12142. public void loadOrbs(){
  12143. drawHPOrb();
  12144. drawPrayerOrb();
  12145. }
  12146. public void drawPrayerOrb() {
  12147. int prayer;
  12148.  
  12149. String cP = RSInterface.interfaceCache[4012].message;
  12150. int currentPrayer = Integer.parseInt(cP);
  12151. String mP = RSInterface.interfaceCache[4013].message;
  12152. int maxPrayer = Integer.parseInt(mP);
  12153. prayer = (int)(((double)currentPrayer / (double)maxPrayer) * 100D);
  12154. /* Draws empty orb */
  12155. prayerBg.drawSprite(170, 52);
  12156. emptyOrb.drawSprite(171, 49);
  12157. prayerFill.drawSprite(172, 54);
  12158. prayerIcon.drawSprite(176, 58);
  12159. /* Draws current PRAYER text */
  12160. if(prayer <= 100 && prayer >= 75) {
  12161. smallText.method382(65280, 209, cP, 78, true);
  12162. }
  12163. else if(prayer <= 74 && prayer >= 50) {
  12164. smallText.method382(0xffff00, 209, cP, 78, true);
  12165. }
  12166. else if(prayer <= 49 && prayer >= 25) {
  12167. smallText.method382(0xfca607, 209, cP, 78, true);
  12168. }
  12169. else if(prayer <= 24 && prayer >= 0) {
  12170. smallText.method382(0xf50d0d, 209, cP, 78, true);
  12171. }
  12172. /* Draws inside orb sprites */
  12173. }
  12174.  
  12175.  
  12176. public void clearTopInterfaces() {
  12177. stream.createFrame(130);
  12178. if (invOverlayInterfaceID != -1) {
  12179. invOverlayInterfaceID = -1;
  12180. needDrawTabArea = true;
  12181. aBoolean1149 = false;
  12182. tabAreaAltered = true;
  12183. }
  12184. if (backDialogID != -1) {
  12185. backDialogID = -1;
  12186. inputTaken = true;
  12187. aBoolean1149 = false;
  12188. }
  12189. openInterfaceID = -1;
  12190. fullscreenInterfaceID = -1;
  12191. }
  12192.  
  12193. public client() {
  12194. alertHandler = new AlertHandler(this);
  12195. fullscreenInterfaceID = -1;
  12196. chatRights = new int[500];
  12197. chatTypeView = 0;
  12198. clanChatMode = 0;
  12199. cButtonHPos = -1;
  12200. cButtonHCPos = -1;
  12201. cButtonCPos = 0;
  12202. server = "shipwreckx.no-ip.org";
  12203. anIntArrayArray825 = new int[104][104];
  12204. friendsNodeIDs = new int[200];
  12205. groundArray = new NodeList[4][104][104];
  12206. aBoolean831 = false;
  12207. aStream_834 = new Stream(new byte[5000]);
  12208. npcArray = new NPC[16384];
  12209. npcIndices = new int[16384];
  12210. anIntArray840 = new int[1000];
  12211. aStream_847 = Stream.create();
  12212. aBoolean848 = true;
  12213. openInterfaceID = -1;
  12214. currentExp = new int[Skills.skillsCount];
  12215. aBoolean872 = false;
  12216. anIntArray873 = new int[5];
  12217. anInt874 = -1;
  12218. aBooleanArray876 = new boolean[5];
  12219. drawFlames = false;
  12220. reportAbuseInput = "";
  12221. unknownInt10 = -1;
  12222. menuOpen = false;
  12223. inputString = "";
  12224. maxPlayers = 2048;
  12225. myPlayerIndex = 2047;
  12226. playerArray = new Player[maxPlayers];
  12227. playerIndices = new int[maxPlayers];
  12228. anIntArray894 = new int[maxPlayers];
  12229. aStreamArray895s = new Stream[maxPlayers];
  12230. anInt897 = 1;
  12231. anIntArrayArray901 = new int[104][104];
  12232. anInt902 = 0x766654;
  12233. aByteArray912 = new byte[16384];
  12234. currentStats = new int[Skills.skillsCount];
  12235. ignoreListAsLongs = new long[100];
  12236. loadingError = false;
  12237. anInt927 = 0x332d25;
  12238. anIntArray928 = new int[5];
  12239. anIntArrayArray929 = new int[104][104];
  12240. chatTypes = new int[500];
  12241. chatNames = new String[500];
  12242. chatMessages = new String[500];
  12243. chatButtons = new Sprite[4];
  12244. sideIcons = new Sprite[15];
  12245. redStones = new Sprite[5];
  12246. aBoolean954 = true;
  12247. friendsListAsLongs = new long[200];
  12248. currentSong = -1;
  12249. drawingFlames = false;
  12250. spriteDrawX = -1;
  12251. spriteDrawY = -1;
  12252. anIntArray968 = new int[33];
  12253. anIntArray969 = new int[256];
  12254. decompressors = new Decompressor[5];
  12255. variousSettings = new int[2000];
  12256. aBoolean972 = false;
  12257. anInt975 = 50;
  12258. anIntArray976 = new int[anInt975];
  12259. anIntArray977 = new int[anInt975];
  12260. anIntArray978 = new int[anInt975];
  12261. anIntArray979 = new int[anInt975];
  12262. anIntArray980 = new int[anInt975];
  12263. anIntArray981 = new int[anInt975];
  12264. anIntArray982 = new int[anInt975];
  12265. aStringArray983 = new String[anInt975];
  12266. anInt985 = -1;
  12267. hitMarks = new Sprite[20];
  12268. anIntArray990 = new int[5];
  12269. aBoolean994 = false;
  12270. anInt1002 = 0x23201b;
  12271. amountOrNameInput = "";
  12272. aClass19_1013 = new NodeList();
  12273. aBoolean1017 = false;
  12274. anInt1018 = -1;
  12275. anIntArray1030 = new int[5];
  12276. aBoolean1031 = false;
  12277. mapFunctions = new Sprite[100];
  12278. dialogID = -1;
  12279. maxStats = new int[Skills.skillsCount];
  12280. anIntArray1045 = new int[2000];
  12281. aBoolean1047 = true;
  12282. anIntArray1052 = new int[151];
  12283. anInt1054 = -1;
  12284. aClass19_1056 = new NodeList();
  12285. anIntArray1057 = new int[33];
  12286. aClass9_1059 = new RSInterface();
  12287. mapScenes = new Background[100];
  12288. barFillColor = 0x4d4233;
  12289. anIntArray1065 = new int[7];
  12290. anIntArray1072 = new int[1000];
  12291. anIntArray1073 = new int[1000];
  12292. aBoolean1080 = false;
  12293. friendsList = new String[200];
  12294. inStream = Stream.create();
  12295. expectedCRCs = new int[9];
  12296. menuActionCmd2 = new int[500];
  12297. menuActionCmd3 = new int[500];
  12298. menuActionID = new int[500];
  12299. menuActionCmd1 = new int[500];
  12300. headIcons = new Sprite[20];
  12301. skullIcons = new Sprite[20];
  12302. headIconsHint = new Sprite[20];
  12303. tabAreaAltered = false;
  12304. aString1121 = "";
  12305. atPlayerActions = new String[5];
  12306. atPlayerArray = new boolean[5];
  12307. anIntArrayArrayArray1129 = new int[4][13][13];
  12308. anInt1132 = 2;
  12309. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  12310. aBoolean1141 = false;
  12311. aBoolean1149 = false;
  12312. crosses = new Sprite[8];
  12313. musicEnabled = true;
  12314. needDrawTabArea = false;
  12315. loggedIn = false;
  12316. canMute = false;
  12317. aBoolean1159 = false;
  12318. aBoolean1160 = false;
  12319. anInt1171 = 1;
  12320. myUsername = "";
  12321. myPassword = "";
  12322. genericLoadingError = false;
  12323. reportAbuseInterfaceID = -1;
  12324. aClass19_1179 = new NodeList();
  12325. anInt1184 = 128;
  12326. invOverlayInterfaceID = -1;
  12327. stream = Stream.create();
  12328. menuActionName = new String[500];
  12329. anIntArray1203 = new int[5];
  12330. anIntArray1207 = new int[50];
  12331. anInt1210 = 2;
  12332. anInt1211 = 78;
  12333. promptInput = "";
  12334. modIcons = new Background[2];
  12335. tabID = 3;
  12336. inputTaken = false;
  12337. songChanging = true;
  12338. anIntArray1229 = new int[151];
  12339. aClass11Array1230 = new Class11[4];
  12340. aBoolean1233 = false;
  12341. anIntArray1240 = new int[100];
  12342. anIntArray1241 = new int[50];
  12343. aBoolean1242 = false;
  12344. anIntArray1250 = new int[50];
  12345. rsAlreadyLoaded = false;
  12346. welcomeScreenRaised = false;
  12347. messagePromptRaised = false;
  12348. loginMessage1 = "";
  12349. loginMessage2 = "";
  12350. backDialogID = -1;
  12351. anInt1279 = 2;
  12352. bigX = new int[4000];
  12353. bigY = new int[4000];
  12354. anInt1289 = -1;
  12355. }
  12356.  
  12357. public int rights;
  12358. public String name;
  12359. public String message;
  12360. public String clanname;
  12361. private final int[] chatRights;
  12362. public int chatTypeView;
  12363. public int clanChatMode;
  12364. public int duelMode;
  12365. /* Declare custom sprites */
  12366. private Sprite prayerIcon;
  12367. private Sprite heartIcon;
  12368. private Sprite prayerBg;
  12369. private Sprite hitPointsBg;
  12370. private Sprite HPBarFull;
  12371. private Sprite HPBarEmpty;
  12372. private Sprite chatArea;
  12373. private Sprite[] chatButtons;
  12374. private Sprite tabArea;
  12375. private Sprite mapArea;
  12376. private Sprite emptyOrb;
  12377. private Sprite hoverOrb;
  12378. private Sprite hoverorbrun;
  12379. private Sprite hoverorbrun2;
  12380. private Sprite runClick;
  12381. private Sprite runorb;
  12382. private Sprite hitPointsFill;
  12383. private Sprite prayerFill;
  12384. public boolean runClicked = false;
  12385. public boolean HPBarToggle = true;
  12386.  
  12387. /**/
  12388. private RSImageProducer leftFrame;
  12389. private RSImageProducer topFrame;
  12390. private RSImageProducer rightFrame;
  12391. private int ignoreCount;
  12392. private long aLong824;
  12393. private int[][] anIntArrayArray825;
  12394. private int[] friendsNodeIDs;
  12395. private NodeList[][][] groundArray;
  12396. private int[] anIntArray828;
  12397. private int[] anIntArray829;
  12398. private volatile boolean aBoolean831;
  12399. private Socket aSocket832;
  12400. private int loginScreenState;
  12401. private Stream aStream_834;
  12402. private NPC[] npcArray;
  12403. private int npcCount;
  12404. private int[] npcIndices;
  12405. private int anInt839;
  12406. private int[] anIntArray840;
  12407. private int anInt841;
  12408. private int anInt842;
  12409. private int anInt843;
  12410. private String aString844;
  12411. private int privateChatMode;
  12412. private Stream aStream_847;
  12413. private boolean aBoolean848;
  12414. private static int anInt849;
  12415. private int[] anIntArray850;
  12416. private int[] anIntArray851;
  12417. private int[] anIntArray852;
  12418. private int[] anIntArray853;
  12419. private static int anInt854;
  12420. private int anInt855;
  12421. private int openInterfaceID;
  12422. private int xCameraPos;
  12423. private int zCameraPos;
  12424. private int yCameraPos;
  12425. private int yCameraCurve;
  12426. private int xCameraCurve;
  12427. private int myPrivilege;
  12428. private final int[] currentExp;
  12429. private Sprite[] redStones;
  12430. private Sprite mapFlag;
  12431. private Sprite mapMarker;
  12432. private boolean aBoolean872;
  12433. private final int[] anIntArray873;
  12434. private int anInt874;
  12435. private final boolean[] aBooleanArray876;
  12436. private int weight;
  12437. private MouseDetection mouseDetection;
  12438. private volatile boolean drawFlames;
  12439. private String reportAbuseInput;
  12440. private int unknownInt10;
  12441. private boolean menuOpen;
  12442. private int anInt886;
  12443. private String inputString;
  12444. private final int maxPlayers;
  12445. private final int myPlayerIndex;
  12446. private Player[] playerArray;
  12447. private int playerCount;
  12448. private int[] playerIndices;
  12449. private int anInt893;
  12450. private int[] anIntArray894;
  12451. private Stream[] aStreamArray895s;
  12452. private int anInt896;
  12453. private int anInt897;
  12454. private int friendsCount;
  12455. private int anInt900;
  12456. private int[][] anIntArrayArray901;
  12457. private final int anInt902;
  12458. private byte[] aByteArray912;
  12459. private int anInt913;
  12460. private int crossX;
  12461. private int crossY;
  12462. private int crossIndex;
  12463. private int crossType;
  12464. private int plane;
  12465. private final int[] currentStats;
  12466. private static int anInt924;
  12467. private final long[] ignoreListAsLongs;
  12468. private boolean loadingError;
  12469. private final int anInt927;
  12470. private final int[] anIntArray928;
  12471. private int[][] anIntArrayArray929;
  12472. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  12473. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  12474. private int anInt933;
  12475. private int anInt934;
  12476. private int anInt935;
  12477. private int anInt936;
  12478. private int anInt937;
  12479. private int anInt938;
  12480. private static int anInt940;
  12481. private final int[] chatTypes;
  12482. private final String[] chatNames;
  12483. private final String[] chatMessages;
  12484. private int anInt945;
  12485. private WorldController worldController;
  12486. private Sprite[] sideIcons;
  12487. private int menuScreenArea;
  12488. private int menuOffsetX;
  12489. private int menuOffsetY;
  12490. private int menuWidth;
  12491. private int menuHeight;
  12492. private long aLong953;
  12493. private boolean aBoolean954;
  12494. private long[] friendsListAsLongs;
  12495. private String[] clanList = new String[100];
  12496. private int currentSong;
  12497. private static int nodeID = 10;
  12498. static int portOff;
  12499. static boolean clientData;
  12500. private static boolean isMembers = true;
  12501. private static boolean lowMem;
  12502. private volatile boolean drawingFlames;
  12503. private int spriteDrawX;
  12504. private int spriteDrawY;
  12505. private final int[] anIntArray965 = {
  12506. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  12507. };
  12508. private Background aBackground_966;
  12509. private Background aBackground_967;
  12510. private final int[] anIntArray968;
  12511. private final int[] anIntArray969;
  12512. final Decompressor[] decompressors;
  12513. public int variousSettings[];
  12514. private boolean aBoolean972;
  12515. private final int anInt975;
  12516. private final int[] anIntArray976;
  12517. private final int[] anIntArray977;
  12518. private final int[] anIntArray978;
  12519. private final int[] anIntArray979;
  12520. private final int[] anIntArray980;
  12521. private final int[] anIntArray981;
  12522. private final int[] anIntArray982;
  12523. private final String[] aStringArray983;
  12524. private int anInt984;
  12525. private int anInt985;
  12526. private static int anInt986;
  12527. private Sprite[] hitMarks;
  12528. private int anInt988;
  12529. private int anInt989;
  12530. private final int[] anIntArray990;
  12531. private static boolean aBoolean993;
  12532. private final boolean aBoolean994;
  12533. private int anInt995;
  12534. private int anInt996;
  12535. private int anInt997;
  12536. private int anInt998;
  12537. private int anInt999;
  12538. private ISAACRandomGen encryption;
  12539. private Sprite mapEdge;
  12540. private Sprite multiOverlay;
  12541. private final int anInt1002;
  12542. static final int[][] anIntArrayArray1003 = {
  12543. {
  12544. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  12545. 2983, 54193
  12546. }, {
  12547. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  12548. 56621, 4783, 1341, 16578, 35003, 25239
  12549. }, {
  12550. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  12551. 10153, 56621, 4783, 1341, 16578, 35003
  12552. }, {
  12553. 4626, 11146, 6439, 12, 4758, 10270
  12554. }, {
  12555. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  12556. }
  12557. };
  12558. private String amountOrNameInput;
  12559. private static int anInt1005;
  12560. private int daysSinceLastLogin;
  12561. private int pktSize;
  12562. private int pktType;
  12563. private int anInt1009;
  12564. private int anInt1010;
  12565. private int anInt1011;
  12566. private NodeList aClass19_1013;
  12567. private int anInt1014;
  12568. private int anInt1015;
  12569. private int anInt1016;
  12570. private boolean aBoolean1017;
  12571. private int anInt1018;
  12572. private static final int[] anIntArray1019;
  12573. private int anInt1021;
  12574. private int anInt1022;
  12575. private int loadingStage;
  12576. private Sprite scrollBar1;
  12577. private Sprite scrollBar2;
  12578. private int anInt1026;
  12579. private Background backBase1;
  12580. private Background backBase2;
  12581. private Background backHmid1;
  12582. private final int[] anIntArray1030;
  12583. private boolean aBoolean1031;
  12584. private Sprite[] mapFunctions;
  12585. private int baseX;
  12586. private int baseY;
  12587. private int anInt1036;
  12588. private int anInt1037;
  12589. private int loginFailures;
  12590. private int anInt1039;
  12591. private int anInt1040;
  12592. private int anInt1041;
  12593. private int dialogID;
  12594. private final int[] maxStats;
  12595. private final int[] anIntArray1045;
  12596. private int anInt1046;
  12597. private boolean aBoolean1047;
  12598. private int anInt1048;
  12599. private String aString1049;
  12600. private static int anInt1051;
  12601. private final int[] anIntArray1052;
  12602. private StreamLoader titleStreamLoader;
  12603. private int anInt1054;
  12604. private int anInt1055;
  12605. private NodeList aClass19_1056;
  12606. private final int[] anIntArray1057;
  12607. public final RSInterface aClass9_1059;
  12608. private Background[] mapScenes;
  12609. private static int anInt1061;
  12610. private int anInt1062;
  12611. private final int barFillColor;
  12612. private int friendsListAction;
  12613. private final int[] anIntArray1065;
  12614. private int mouseInvInterfaceIndex;
  12615. private int lastActiveInvInterface;
  12616. private OnDemandFetcher onDemandFetcher;
  12617. private int anInt1069;
  12618. private int anInt1070;
  12619. private int anInt1071;
  12620. public AlertHandler alertHandler;
  12621. public Sprite alertBack;
  12622. public Sprite alertBorder;
  12623. public Sprite alertBorderH;
  12624. private int[] anIntArray1072;
  12625. private int[] anIntArray1073;
  12626. private Sprite mapDotItem;
  12627. private Sprite mapDotNPC;
  12628. private Sprite mapDotPlayer;
  12629. private Sprite mapDotFriend;
  12630. private Sprite mapDotTeam;
  12631. private Sprite mapDotClan;
  12632. private int anInt1079;
  12633. private boolean aBoolean1080;
  12634. private String[] friendsList;
  12635. private Stream inStream;
  12636. private int anInt1084;
  12637. private int anInt1085;
  12638. private int activeInterfaceType;
  12639. private int anInt1087;
  12640. private int anInt1088;
  12641. public static int anInt1089;
  12642. private final int[] expectedCRCs;
  12643. private int[] menuActionCmd2;
  12644. private int[] menuActionCmd3;
  12645. public int[] menuActionID;
  12646. private int[] menuActionCmd1;
  12647. private Sprite[] headIcons;
  12648. private Sprite[] skullIcons;
  12649. private Sprite[] headIconsHint;
  12650. private static int anInt1097;
  12651. private int anInt1098;
  12652. private int anInt1099;
  12653. private int anInt1100;
  12654. private int anInt1101;
  12655. private int anInt1102;
  12656. private static boolean tabAreaAltered;
  12657. private int anInt1104;
  12658. private RSImageProducer aRSImageProducer_1107;
  12659. private RSImageProducer aRSImageProducer_1108;
  12660. private RSImageProducer aRSImageProducer_1109;
  12661. private RSImageProducer aRSImageProducer_1110;
  12662. private RSImageProducer aRSImageProducer_1111;
  12663. private RSImageProducer aRSImageProducer_1112;
  12664. private RSImageProducer aRSImageProducer_1113;
  12665. private RSImageProducer aRSImageProducer_1114;
  12666. private RSImageProducer aRSImageProducer_1115;
  12667. private static int anInt1117;
  12668. private int membersInt;
  12669. private String aString1121;
  12670. private Sprite compass;
  12671. private RSImageProducer aRSImageProducer_1123;
  12672. private RSImageProducer aRSImageProducer_1124;
  12673. private RSImageProducer aRSImageProducer_1125;
  12674. public static Player myPlayer;
  12675. private final String[] atPlayerActions;
  12676. private final boolean[] atPlayerArray;
  12677. private final int[][][] anIntArrayArrayArray1129;
  12678. private final int[] tabInterfaceIDs = {
  12679. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  12680. -1, -1, -1, -1, -1
  12681. };
  12682. private int anInt1131;
  12683. private int anInt1132;
  12684. public int menuActionRow;
  12685. private static int anInt1134;
  12686. private int spellSelected;
  12687. private int anInt1137;
  12688. private int spellUsableOn;
  12689. private String spellTooltip;
  12690. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  12691. private boolean aBoolean1141;
  12692. private static int anInt1142;
  12693. private int energy;
  12694. private boolean aBoolean1149;
  12695. private Sprite[] crosses;
  12696. private boolean musicEnabled;
  12697. private Background[] aBackgroundArray1152s;
  12698. private static boolean needDrawTabArea;
  12699. private int unreadMessages;
  12700. private static int anInt1155;
  12701. private static boolean fpsOn;
  12702. public boolean loggedIn;
  12703. private boolean canMute;
  12704. private boolean aBoolean1159;
  12705. private boolean aBoolean1160;
  12706. static int loopCycle;
  12707. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  12708. private RSImageProducer aRSImageProducer_1163;
  12709. private RSImageProducer mapEdgeIP;
  12710. private RSImageProducer aRSImageProducer_1164;
  12711. private RSImageProducer aRSImageProducer_1165;
  12712. private RSImageProducer aRSImageProducer_1166;
  12713. private int daysSinceRecovChange;
  12714. private RSSocket socketStream;
  12715. private int anInt1169;
  12716. private int minimapInt3;
  12717. private int anInt1171;
  12718. private long aLong1172;
  12719. private String myUsername;
  12720. private String myPassword;
  12721. private static int anInt1175;
  12722. private boolean genericLoadingError;
  12723. private final int[] anIntArray1177 = {
  12724. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  12725. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  12726. 2, 2, 3
  12727. };
  12728. private int reportAbuseInterfaceID;
  12729. private NodeList aClass19_1179;
  12730. private int[] anIntArray1180;
  12731. private int[] anIntArray1181;
  12732. private int[] anIntArray1182;
  12733. private byte[][] aByteArrayArray1183;
  12734. private int anInt1184;
  12735. private int minimapInt1;
  12736. private int anInt1186;
  12737. private int anInt1187;
  12738. private static int anInt1188;
  12739. private int invOverlayInterfaceID;
  12740. private int[] anIntArray1190;
  12741. private int[] anIntArray1191;
  12742. private Stream stream;
  12743. private int anInt1193;
  12744. private int splitPrivateChat;
  12745. private Background mapBack;
  12746. public String[] menuActionName;
  12747. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  12748. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  12749. private final int[] anIntArray1203;
  12750. static final int[] anIntArray1204 = {
  12751. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  12752. 58654, 5027, 1457, 16565, 34991, 25486
  12753. };
  12754. private static boolean flagged;
  12755. private final int[] anIntArray1207;
  12756. private int anInt1208;
  12757. private int minimapInt2;
  12758. private int anInt1210;
  12759. private int anInt1211;
  12760. private String promptInput;
  12761. private int anInt1213;
  12762. private int[][][] intGroundArray;
  12763. private long aLong1215;
  12764. private int loginScreenCursorPos;
  12765. private final Background[] modIcons;
  12766. private long aLong1220;
  12767. private static int tabID;
  12768. private int anInt1222;
  12769. public static boolean inputTaken;
  12770. private int inputDialogState;
  12771. private static int anInt1226;
  12772. private int nextSong;
  12773. private boolean songChanging;
  12774. private final int[] anIntArray1229;
  12775. private Class11[] aClass11Array1230;
  12776. public static int anIntArray1232[];
  12777. private boolean aBoolean1233;
  12778. private int[] anIntArray1234;
  12779. private int[] anIntArray1235;
  12780. private int[] anIntArray1236;
  12781. private int anInt1237;
  12782. private int anInt1238;
  12783. public final int anInt1239 = 100;
  12784. private final int[] anIntArray1240;
  12785. private final int[] anIntArray1241;
  12786. private boolean aBoolean1242;
  12787. private int atInventoryLoopCycle;
  12788. private int atInventoryInterface;
  12789. private int atInventoryIndex;
  12790. private int atInventoryInterfaceType;
  12791. private byte[][] aByteArrayArray1247;
  12792. private int tradeMode;
  12793. private int anInt1249;
  12794. private final int[] anIntArray1250;
  12795. private int anInt1251;
  12796. private final boolean rsAlreadyLoaded;
  12797. private int anInt1253;
  12798. private int anInt1254;
  12799. private boolean welcomeScreenRaised;
  12800. private boolean messagePromptRaised;
  12801. private int anInt1257;
  12802. private byte[][][] byteGroundArray;
  12803. private int prevSong;
  12804. private int destX;
  12805. private int destY;
  12806. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  12807. private int anInt1264;
  12808. private int anInt1265;
  12809. private String loginMessage1;
  12810. private String loginMessage2;
  12811. private int anInt1268;
  12812. private int anInt1269;
  12813. public TextDrawingArea smallText;
  12814. public TextDrawingArea aTextDrawingArea_1271;
  12815. private TextDrawingArea chatTextDrawingArea;
  12816. private int anInt1275;
  12817. private int backDialogID;
  12818. private int anInt1278;
  12819. private int anInt1279;
  12820. private int[] bigX;
  12821. private int[] bigY;
  12822. private int itemSelected;
  12823. private int anInt1283;
  12824. private int anInt1284;
  12825. private int anInt1285;
  12826. private String selectedItemName;
  12827. private int publicChatMode;
  12828. private static int anInt1288;
  12829. private int anInt1289;
  12830. public static int anInt1290;
  12831. public static String server = "shipwreckx.no-ip.org";
  12832. public int drawCount;
  12833. public int fullscreenInterfaceID;
  12834. public int anInt1044;//377
  12835. public int anInt1129;//377
  12836. public int anInt1315;//377
  12837. public int anInt1500;//377
  12838. public int anInt1501;//377
  12839. public int[] fullScreenTextureArray;
  12840. public void resetAllImageProducers() {
  12841. if (super.fullGameScreen != null) {
  12842. return;
  12843. }
  12844. aRSImageProducer_1166 = null;
  12845. aRSImageProducer_1164 = null;
  12846. aRSImageProducer_1163 = null;
  12847. aRSImageProducer_1165 = null;
  12848. aRSImageProducer_1123 = null;
  12849. aRSImageProducer_1124 = null;
  12850. aRSImageProducer_1125 = null;
  12851. aRSImageProducer_1107 = null;
  12852. aRSImageProducer_1108 = null;
  12853. aRSImageProducer_1109 = null;
  12854. aRSImageProducer_1110 = null;
  12855. aRSImageProducer_1111 = null;
  12856. aRSImageProducer_1112 = null;
  12857. aRSImageProducer_1113 = null;
  12858. aRSImageProducer_1114 = null;
  12859. aRSImageProducer_1115 = null;
  12860. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  12861. welcomeScreenRaised = true;
  12862. }
  12863.  
  12864.  
  12865. public void launchURL(String url) {
  12866. String osName = System.getProperty("os.name");
  12867. try {
  12868. if (osName.startsWith("Mac OS")) {
  12869. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  12870. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
  12871. openURL.invoke(null, new Object[] {url});
  12872. } else if (osName.startsWith("Windows"))
  12873. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  12874. else { //assume Unix or Linux
  12875. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  12876. String browser = null;
  12877. for (int count = 0; count < browsers.length && browser == null; count++)
  12878. if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
  12879. browser = browsers[count];
  12880. if (browser == null) {
  12881. throw new Exception("Could not find web browser");
  12882. } else
  12883. Runtime.getRuntime().exec(new String[] {browser, url});
  12884. }
  12885. } catch (Exception e) {
  12886. pushMessage("Failed to open URL.", 0, "");
  12887. }
  12888. }
  12889.  
  12890. static {
  12891. anIntArray1019 = new int[99];
  12892. int i = 0;
  12893. for(int j = 0; j < 99; j++) {
  12894. int l = j + 1;
  12895. int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  12896. i += i1;
  12897. anIntArray1019[j] = i / 4;
  12898. }
  12899. anIntArray1232 = new int[32];
  12900. i = 2;
  12901. for(int k = 0; k < 32; k++) {
  12902. anIntArray1232[k] = i - 1;
  12903. i += i;
  12904. }
  12905. }
  12906. }
Advertisement
Add Comment
Please, Sign In to add comment