Advertisement
Guest User

client.java - client sided

a guest
Jun 9th, 2013
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 372.57 KB | None | 0 0
  1. // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.kpdus.com/jad.html
  3. // Decompiler options: packimports(3)
  4.  
  5. import java.applet.AppletContext;
  6. import java.awt.*;
  7. import java.io.*;
  8. import java.math.BigInteger;
  9. import java.net.*;
  10. import java.util.zip.CRC32;
  11. import java.lang.reflect.Method;
  12. import sign.signlink;
  13. import javax.swing.*;
  14.  
  15. public class client extends RSApplet {
  16.  
  17.  
  18. public int MapX, MapY;
  19. public static int spellID = 0;
  20. public static boolean newDamage = false;
  21.  
  22. private static String intToKOrMilLongName(int i) {
  23. String s = String.valueOf(i);
  24. for(int k = s.length() - 3; k > 0; k -= 3)
  25. s = s.substring(0, k) + "," + s.substring(k);
  26.  
  27. //if(j != 0)
  28. // aBoolean1224 = !aBoolean1224;
  29. if(s.length() > 8)
  30. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  31. else
  32. if(s.length() > 4)
  33. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  34. return " " + s;
  35. }
  36. public final String methodR(/*int i,*/ int j)
  37. {
  38. //if(i <= 0)
  39. // pktType = inStream.readUnsignedByte();
  40. if(j >= 0 && j < 10000)
  41. return String.valueOf(j);
  42. if(j >= 10000 && j < 10000000)
  43. return j / 1000 + "K";
  44. if(j >= 10000000 && j < 999999999)
  45. return j / 1000000 + "M";
  46. if(j >= 999999999)
  47. return "*";
  48. else
  49. return "?";
  50. }
  51.  
  52. public static final byte[] ReadFile(String s) {
  53. try {
  54. byte abyte0[];
  55. File file = new File(s);
  56. int i = (int)file.length();
  57. abyte0 = new byte[i];
  58. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  59. datainputstream.readFully(abyte0, 0, i);
  60. datainputstream.close();
  61. return abyte0;
  62. } catch(Exception e) {
  63. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  64. return null;
  65. }
  66. }
  67.  
  68. public void models() {
  69. for(int ModelIndex = 0; ModelIndex < 29191; ModelIndex++) {
  70. byte[] abyte0 = getModel(ModelIndex);
  71. if(abyte0 != null && abyte0.length > 0) {
  72. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  73. pushMessage("Model added successfully!", 0, "");
  74. }
  75. }
  76. }
  77. public byte[] getModel(int Index) {
  78. try {
  79. File Model = new File("./Raw/"+Index+".dat");
  80. byte[] aByte = new byte[(int)Model.length()];
  81. FileInputStream fis = new FileInputStream(Model);
  82. fis.read(aByte);
  83. pushMessage("aByte = ["+aByte+"]!", 0, "");
  84. fis.close();
  85. return aByte;
  86. }
  87. catch(Exception e)
  88. {return null;}
  89. }
  90.  
  91. private void stopMidi() {
  92. signlink.midifade = 0;
  93. signlink.midi = "stop";
  94. }
  95.  
  96. private boolean menuHasAddFriend(int j) {
  97. if(j < 0)
  98. return false;
  99. int k = menuActionID[j];
  100. if(k >= 2000)
  101. k -= 2000;
  102. return k == 337;
  103. }
  104.  
  105. public void drawChannelButtons() {
  106. String text[] = { "On", "Friends", "Off", "Hide" };
  107. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  108. switch(cButtonCPos) {
  109. case 0:
  110. chatButtons[1].drawSprite(5, 142);
  111. break;
  112. case 1:
  113. chatButtons[1].drawSprite(71, 142);
  114. break;
  115. case 2:
  116. chatButtons[1].drawSprite(137, 142);
  117. break;
  118. case 3:
  119. chatButtons[1].drawSprite(203, 142);
  120. break;
  121. case 4:
  122. chatButtons[1].drawSprite(269, 142);
  123. break;
  124. case 5:
  125. chatButtons[1].drawSprite(335, 142);
  126. break;
  127. }
  128. if(cButtonHPos == cButtonCPos) {
  129. switch(cButtonHPos) {
  130. case 0:
  131. chatButtons[2].drawSprite(5, 142);
  132. break;
  133. case 1:
  134. chatButtons[2].drawSprite(71, 142);
  135. break;
  136. case 2:
  137. chatButtons[2].drawSprite(137, 142);
  138. break;
  139. case 3:
  140. chatButtons[2].drawSprite(203, 142);
  141. break;
  142. case 4:
  143. chatButtons[2].drawSprite(269, 142);
  144. break;
  145. case 5:
  146. chatButtons[2].drawSprite(335, 142);
  147. break;
  148. case 6:
  149. chatButtons[3].drawSprite(404, 142);
  150. break;
  151. }
  152. } else {
  153. switch(cButtonHPos) {
  154. case 0:
  155. chatButtons[0].drawSprite(5, 142);
  156. break;
  157. case 1:
  158. chatButtons[0].drawSprite(71, 142);
  159. break;
  160. case 2:
  161. chatButtons[0].drawSprite(137, 142);
  162. break;
  163. case 3:
  164. chatButtons[0].drawSprite(203, 142);
  165. break;
  166. case 4:
  167. chatButtons[0].drawSprite(269, 142);
  168. break;
  169. case 5:
  170. chatButtons[0].drawSprite(335, 142);
  171. break;
  172. case 6:
  173. chatButtons[3].drawSprite(404, 142);
  174. break;
  175. }
  176. }
  177. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
  178. smallText.method389(true, 26, 0xffffff, "All", 157);
  179. smallText.method389(true, 86, 0xffffff, "Game", 157);
  180. smallText.method389(true, 150, 0xffffff, "Public", 152);
  181. smallText.method389(true, 212, 0xffffff, "Private", 152);
  182. smallText.method389(true, 286, 0xffffff, "Clan", 152);
  183. smallText.method389(true, 349, 0xffffff, "Trade", 152);
  184. smallText.method382(textColor[publicChatMode], 164, text[publicChatMode], 163, true);
  185. smallText.method382(textColor[privateChatMode], 230, text[privateChatMode], 163, true);
  186. smallText.method382(textColor[clanChatMode], 296, text[clanChatMode], 163, true);
  187. smallText.method382(textColor[tradeMode], 362, text[tradeMode], 163, true);
  188. }
  189.  
  190. private void drawChatArea() {
  191. aRSImageProducer_1166.initDrawingArea();
  192. Texture.anIntArray1472 = anIntArray1180;
  193. chatArea.drawSprite(0, 0);
  194. drawChannelButtons();
  195. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  196. if(messagePromptRaised) {
  197. chatTextDrawingArea.drawText(0, aString1121, 60, 259);
  198. chatTextDrawingArea.drawText(128, promptInput + "*", 80, 259);
  199. } else if(inputDialogState == 1) {
  200. chatTextDrawingArea.drawText(0, "Enter amount:", 60, 259);
  201. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  202. } else if(inputDialogState == 2) {
  203. chatTextDrawingArea.drawText(0, "Enter name:", 60, 259);
  204. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  205. } else if(aString844 != null) {
  206. chatTextDrawingArea.drawText(0, aString844, 60, 259);
  207. chatTextDrawingArea.drawText(128, "Click to continue", 80, 259);
  208. } else if(backDialogID != -1) {
  209. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  210. } else if(dialogID != -1) {
  211. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  212. } else {
  213. int j77 = -3;
  214. int j = 0;
  215. DrawingArea.setDrawingArea(122, 8, 497, 7);
  216. for(int k = 0; k < 500; k++)
  217. if(chatMessages[k] != null) {
  218. int chatType = chatTypes[k];
  219. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  220. String s1 = chatNames[k];
  221. byte byte0 = 0;
  222. if(s1 != null && s1.startsWith("@cr1@")) {
  223. s1 = s1.substring(5);
  224. byte0 = 1;
  225. } else if(s1 != null && s1.startsWith("@cr2@")) {
  226. s1 = s1.substring(5);
  227. byte0 = 2;
  228. } else if(s1 != null && s1.startsWith("@cr3@")) {
  229. s1 = s1.substring(5);
  230. byte0 = 3;
  231. }
  232. if(chatType == 0) {
  233. if (chatTypeView == 5 || chatTypeView == 0) {
  234. if(yPos > 0 && yPos < 210)
  235. textDrawingArea.method389(false, 11, 0, chatMessages[k], yPos);//chat color enabled
  236. j++;
  237. j77++;
  238. }
  239. }
  240. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  241. if (chatTypeView == 1 || chatTypeView == 0) {
  242. if(yPos > 0 && yPos < 210) {
  243. int xPos = 11;
  244. if(byte0 == 1) {
  245. modIcons[0].drawBackground(xPos + 1, yPos - 12);
  246. xPos += 14;
  247. } else if(byte0 == 2) {
  248. modIcons[1].drawBackground(xPos + 1, yPos - 12);
  249. xPos += 14;
  250. } else if(byte0 == 3) {
  251. modIcons[2].drawBackground(xPos + 1, yPos - 12);
  252. xPos += 14;
  253. }
  254. textDrawingArea.method385(0, s1 + ":", yPos, xPos);
  255. xPos += textDrawingArea.getTextWidth(s1) + 8;
  256. textDrawingArea.method389(false, xPos, 255, chatMessages[k], yPos);
  257. }
  258. j++;
  259. j77++;
  260. }
  261. }
  262. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  263. if (chatTypeView == 2 || chatTypeView == 0) {
  264. if(yPos > 0 && yPos < 210) {
  265. int k1 = 11;
  266. textDrawingArea.method385(0, "From", yPos, k1);
  267. k1 += textDrawingArea.getTextWidth("From ");
  268. if(byte0 == 1) {
  269. modIcons[0].drawBackground(k1, yPos - 12);
  270. k1 += 12;
  271. } else if(byte0 == 2) {
  272. modIcons[1].drawBackground(k1, yPos - 12);
  273. k1 += 12;
  274. } else if(byte0 == 3) {
  275. modIcons[2].drawBackground(k1, yPos - 12);
  276. k1 += 12;
  277. }
  278. textDrawingArea.method385(0, s1 + ":", yPos, k1);
  279. k1 += textDrawingArea.getTextWidth(s1) + 8;
  280. textDrawingArea.method385(0x800000, chatMessages[k], yPos, k1);
  281. }
  282. j++;
  283. j77++;
  284. }
  285. }
  286. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  287. if (chatTypeView == 3 || chatTypeView == 0) {
  288. if(yPos > 0 && yPos < 210)
  289. textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], yPos, 11);
  290. j++;
  291. j77++;
  292. }
  293. }
  294. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  295. if (chatTypeView == 2 || chatTypeView == 0) {
  296. if(yPos > 0 && yPos < 210)
  297. textDrawingArea.method385(0x800000, chatMessages[k], yPos, 11);
  298. j++;
  299. j77++;
  300. }
  301. }
  302. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  303. if (chatTypeView == 2 || chatTypeView == 0) {
  304. if(yPos > 0 && yPos < 210) {
  305. textDrawingArea.method385(0, "To " + s1 + ":", yPos, 11);
  306. textDrawingArea.method385(0x800000, chatMessages[k], yPos, 15 + textDrawingArea.getTextWidth("To :" + s1));
  307. }
  308. j++;
  309. j77++;
  310. }
  311. }
  312. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  313. if (chatTypeView == 3 || chatTypeView == 0) {
  314. if(yPos > 0 && yPos < 210)
  315. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  316. j++;
  317. j77++;
  318. }
  319. if(chatType == 11 && (clanChatMode == 0)) {
  320. if (chatTypeView == 11) {
  321. if(yPos > 0 && yPos < 210)
  322. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  323. j++;
  324. j77++;
  325. }
  326. if(chatType == 12) {
  327. if(yPos > 0 && yPos < 110)
  328. textDrawingArea.method385(0x7e3200, chatMessages[k] + " @blu@" + s1, yPos, 11);
  329. j++;
  330. }
  331. }
  332. }
  333. if(chatType == 16) {
  334. int j2 = 40;
  335. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  336. if(chatTypeView == 11 || chatTypeView == 0) {
  337. if(yPos > 3 && yPos < 130)
  338. switch(chatRights[k]) {
  339. case 1:
  340. j2 += clanNameWidth;
  341. modIcons[0].drawBackground(j2 - 18, yPos - 12);
  342. j2 += 14;
  343. break;
  344.  
  345. case 2:
  346. j2 += clanNameWidth;
  347. modIcons[1].drawBackground(j2 - 18, yPos - 12);
  348. j2 += 14;
  349. break;
  350.  
  351. case 3:
  352. j2 += clanNameWidth;
  353. modIcons[1].drawBackground(j2 - 18, yPos - 12);
  354. j2 += 14;
  355. break;
  356.  
  357. default:
  358. j2 += clanNameWidth;
  359. break;
  360. }
  361. textDrawingArea.method385(0, "[", yPos, 8);
  362. textDrawingArea.method385(255, ""+clanname+"", yPos, 14);
  363. textDrawingArea.method385(0, "]", yPos, clanNameWidth + 14);
  364.  
  365. textDrawingArea.method385(0, chatNames[k]+":", yPos, j2 - 17); //j2
  366. j2 += textDrawingArea.getTextWidth(chatNames[k]) + 7;
  367. textDrawingArea.method385(0x800000, chatMessages[k], yPos, j2 - 16);//j2
  368. j++;
  369. j77++;
  370. }
  371. }
  372. }
  373. DrawingArea.defaultDrawingAreaSize();
  374. anInt1211 = j * 14 + 7 + 5;
  375. if(anInt1211 < 111)
  376. anInt1211 = 111;
  377. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  378. String s;
  379. if(myPlayer != null && myPlayer.name != null)
  380. s = myPlayer.name;
  381. else
  382. s = TextClass.fixName(myUsername);
  383. textDrawingArea.method385(0, s + ":", 133, 11);
  384. textDrawingArea.drawChatInput(255, 12 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false);
  385. DrawingArea.method339(121, 0x807660, 506, 7);
  386. }
  387. if(menuOpen && menuScreenArea == 2) {
  388. drawMenu();
  389. }
  390. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  391. aRSImageProducer_1165.initDrawingArea();
  392. Texture.anIntArray1472 = anIntArray1182;
  393. }
  394.  
  395. public void init() {
  396. nodeID = 10;
  397. portOff = 0;
  398. setHighMem();
  399. isMembers = true;
  400. initClientFrame(503, 765);
  401. }
  402.  
  403. public void startRunnable(Runnable runnable, int i) {
  404. if(i > 10)
  405. i = 10;
  406. if(signlink.mainapp != null) {
  407. signlink.startthread(runnable, i);
  408. } else {
  409. super.startRunnable(runnable, i);
  410. }
  411. }
  412.  
  413. public Socket openSocket(int port) throws IOException {
  414. return new Socket(InetAddress.getByName(server), port);
  415. }
  416.  
  417. private void processMenuClick() {
  418. if(activeInterfaceType != 0)
  419. return;
  420. int j = super.clickMode3;
  421. if(spellSelected == 1 && super.saveClickX >= 516 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  422. j = 0;
  423. if(menuOpen) {
  424. if(j != 1) {
  425. int k = super.mouseX;
  426. int j1 = super.mouseY;
  427. if(menuScreenArea == 0) {
  428. k -= 4;
  429. j1 -= 4;
  430. }
  431. if(menuScreenArea == 1) {
  432. k -= 519;
  433. j1 -= 168;
  434. }
  435. if(menuScreenArea == 2) {
  436. k -= 17;
  437. j1 -= 338;
  438. }
  439. if(menuScreenArea == 3) {
  440. k -= 519;
  441. j1 -= 0;
  442. }
  443. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  444. menuOpen = false;
  445. if(menuScreenArea == 1)
  446. needDrawTabArea = true;
  447. if(menuScreenArea == 2)
  448. inputTaken = true;
  449. }
  450. }
  451. if(j == 1) {
  452. int l = menuOffsetX;
  453. int k1 = menuOffsetY;
  454. int i2 = menuWidth;
  455. int k2 = super.saveClickX;
  456. int l2 = super.saveClickY;
  457. if(menuScreenArea == 0) {
  458. k2 -= 4;
  459. l2 -= 4;
  460. }
  461. if(menuScreenArea == 1) {
  462. k2 -= 519;
  463. l2 -= 168;
  464. }
  465. if(menuScreenArea == 2) {
  466. k2 -= 17;
  467. l2 -= 338;
  468. }
  469. if(menuScreenArea == 3) {
  470. k2 -= 519;
  471. l2 -= 0;
  472. }
  473. int i3 = -1;
  474. for(int j3 = 0; j3 < menuActionRow; j3++) {
  475. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  476. if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  477. i3 = j3;
  478. }
  479. System.out.println(i3);
  480. if(i3 != -1)
  481. doAction(i3);
  482. menuOpen = false;
  483. if(menuScreenArea == 1)
  484. needDrawTabArea = true;
  485. if(menuScreenArea == 2) {
  486. inputTaken = true;
  487. }
  488. }
  489. } else {
  490. if(j == 1 && menuActionRow > 0) {
  491. int i1 = menuActionID[menuActionRow - 1];
  492. if(i1 == 632 || i1 == 78 || i1 == 867 || i1 == 431 || i1 == 53 || i1 == 74 || i1 == 454 || i1 == 539 || i1 == 493 || i1 == 847 || i1 == 447 || i1 == 1125) {
  493. int l1 = menuActionCmd2[menuActionRow - 1];
  494. int j2 = menuActionCmd3[menuActionRow - 1];
  495. RSInterface class9 = RSInterface.interfaceCache[j2];
  496. if(class9.aBoolean259 || class9.aBoolean235) {
  497. aBoolean1242 = false;
  498. anInt989 = 0;
  499. anInt1084 = j2;
  500. anInt1085 = l1;
  501. activeInterfaceType = 2;
  502. anInt1087 = super.saveClickX;
  503. anInt1088 = super.saveClickY;
  504. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  505. activeInterfaceType = 1;
  506. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  507. activeInterfaceType = 3;
  508. return;
  509. }
  510. }
  511. }
  512. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  513. j = 2;
  514. if(j == 1 && menuActionRow > 0)
  515. doAction(menuActionRow - 1);
  516. if(j == 2 && menuActionRow > 0)
  517. determineMenuSize();
  518. }
  519. }
  520.  
  521.  
  522. public static int totalRead = 0;
  523.  
  524. public static String getFileNameWithoutExtension(String fileName) {
  525. File tmpFile = new File(fileName);
  526. tmpFile.getName();
  527. int whereDot = tmpFile.getName().lastIndexOf('.');
  528. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2 ) {
  529. return tmpFile.getName().substring(0, whereDot);
  530. }
  531. return "";
  532. }
  533.  
  534. public void preloadModels() {
  535. File file = new File("./Raw/");
  536. File[] fileArray = file.listFiles();
  537. for(int y = 0; y < fileArray.length; y++) {
  538. String s = fileArray[y].getName();
  539. byte[] buffer = ReadFile("./Raw/"+s);
  540. Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
  541. }
  542. }
  543.  
  544.  
  545.  
  546. private void saveMidi(boolean flag, byte abyte0[])
  547. {
  548. signlink.midifade = flag ? 1 : 0;
  549. signlink.midisave(abyte0, abyte0.length);
  550. }
  551.  
  552. private void method22()
  553. {
  554. try
  555. {
  556. anInt985 = -1;
  557. aClass19_1056.removeAll();
  558. aClass19_1013.removeAll();
  559. Texture.method366();
  560. unlinkMRUNodes();
  561. worldController.initToNull();
  562. System.gc();
  563. for(int i = 0; i < 4; i++)
  564. aClass11Array1230[i].method210();
  565.  
  566. for(int l = 0; l < 4; l++)
  567. {
  568. for(int k1 = 0; k1 < 104; k1++)
  569. {
  570. for(int j2 = 0; j2 < 104; j2++)
  571. byteGroundArray[l][k1][j2] = 0;
  572.  
  573. }
  574.  
  575. }
  576.  
  577. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  578. int k2 = aByteArrayArray1183.length;
  579. stream.createFrame(0);
  580. if(!aBoolean1159)
  581. {
  582. for(int i3 = 0; i3 < k2; i3++)
  583. {
  584. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  585. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  586. byte abyte0[] = aByteArrayArray1183[i3];
  587. if (FileOperations.FileExists(signlink.findcachedir()+"maps/"+anIntArray1235[i3]+".dat"))
  588. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"maps/"+anIntArray1235[i3]+".dat");
  589. if(abyte0 != null)
  590. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  591. }
  592.  
  593. for(int j4 = 0; j4 < k2; j4++)
  594. {
  595. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  596. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  597. byte abyte2[] = aByteArrayArray1183[j4];
  598. if(abyte2 == null && anInt1070 < 800)
  599. objectManager.method174(k7, 64, 64, l5);
  600. }
  601.  
  602. anInt1097++;
  603. if(anInt1097 > 160)
  604. {
  605. anInt1097 = 0;
  606. stream.createFrame(238);
  607. stream.writeWordBigEndian(96);
  608. }
  609. stream.createFrame(0);
  610. for(int i6 = 0; i6 < k2; i6++)
  611. {
  612. byte abyte1[] = aByteArrayArray1247[i6];
  613. if(abyte1 != null)
  614. {
  615. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  616. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  617. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  618. }
  619. }
  620.  
  621. }
  622. if(aBoolean1159)
  623. {
  624. for(int j3 = 0; j3 < 4; j3++)
  625. {
  626. for(int k4 = 0; k4 < 13; k4++)
  627. {
  628. for(int j6 = 0; j6 < 13; j6++)
  629. {
  630. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  631. if(l7 != -1)
  632. {
  633. int i9 = l7 >> 24 & 3;
  634. int l9 = l7 >> 1 & 3;
  635. int j10 = l7 >> 14 & 0x3ff;
  636. int l10 = l7 >> 3 & 0x7ff;
  637. int j11 = (j10 / 8 << 8) + l10 / 8;
  638. for(int l11 = 0; l11 < anIntArray1234.length; l11++)
  639. {
  640. if(anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  641. continue;
  642. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  643. break;
  644. }
  645.  
  646. }
  647. }
  648.  
  649. }
  650.  
  651. }
  652.  
  653. for(int l4 = 0; l4 < 13; l4++)
  654. {
  655. for(int k6 = 0; k6 < 13; k6++)
  656. {
  657. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  658. if(i8 == -1)
  659. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  660. }
  661.  
  662. }
  663.  
  664. stream.createFrame(0);
  665. for(int l6 = 0; l6 < 4; l6++)
  666. {
  667. for(int j8 = 0; j8 < 13; j8++)
  668. {
  669. for(int j9 = 0; j9 < 13; j9++)
  670. {
  671. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  672. if(i10 != -1)
  673. {
  674. int k10 = i10 >> 24 & 3;
  675. int i11 = i10 >> 1 & 3;
  676. int k11 = i10 >> 14 & 0x3ff;
  677. int i12 = i10 >> 3 & 0x7ff;
  678. int j12 = (k11 / 8 << 8) + i12 / 8;
  679. for(int k12 = 0; k12 < anIntArray1234.length; k12++)
  680. {
  681. if(anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  682. continue;
  683. //objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  684. byte abyte0[] = aByteArrayArray1247[k12];
  685. if (FileOperations.FileExists(signlink.findcachedir()+"maps/"+anIntArray1235[k12]+".dat"))
  686. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"maps/"+anIntArray1235[k12]+".dat");
  687. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  688. break;
  689. }
  690.  
  691. }
  692. }
  693.  
  694. }
  695.  
  696. }
  697.  
  698. }
  699. stream.createFrame(0);
  700. objectManager.method171(aClass11Array1230, worldController);
  701. aRSImageProducer_1165.initDrawingArea();
  702. stream.createFrame(0);
  703. int k3 = ObjectManager.anInt145;
  704. if(k3 > plane)
  705. k3 = plane;
  706. if(k3 < plane - 1)
  707. k3 = plane - 1;
  708. if(lowMem)
  709. worldController.method275(ObjectManager.anInt145);
  710. else
  711. worldController.method275(0);
  712. for(int i5 = 0; i5 < 104; i5++)
  713. {
  714. for(int i7 = 0; i7 < 104; i7++)
  715. spawnGroundItem(i5, i7);
  716.  
  717. }
  718.  
  719. anInt1051++;
  720. if(anInt1051 > 98)
  721. {
  722. anInt1051 = 0;
  723. stream.createFrame(150);
  724. }
  725. method63();
  726. }
  727. catch(Exception exception) { }
  728. ObjectDef.mruNodes1.unlinkAll();
  729. if(super.gameFrame != null)
  730. {
  731. stream.createFrame(210);
  732. stream.writeDWord(0x3f008edd);
  733. }
  734. if(lowMem && signlink.cache_dat != null)
  735. {
  736. int j = onDemandFetcher.getVersionCount(0);
  737. for(int i1 = 0; i1 < j; i1++)
  738. {
  739. int l1 = onDemandFetcher.getModelIndex(i1);
  740. if((l1 & 0x79) == 0)
  741. Model.method461(i1);
  742. }
  743.  
  744. }
  745. System.gc();
  746. Texture.method367();
  747. onDemandFetcher.method566();
  748. int k = (anInt1069 - 6) / 8 - 1;
  749. int j1 = (anInt1069 + 6) / 8 + 1;
  750. int i2 = (anInt1070 - 6) / 8 - 1;
  751. int l2 = (anInt1070 + 6) / 8 + 1;
  752. if(aBoolean1141)
  753. {
  754. k = 49;
  755. j1 = 50;
  756. i2 = 49;
  757. l2 = 50;
  758. }
  759. for(int l3 = k; l3 <= j1; l3++)
  760. {
  761. for(int j5 = i2; j5 <= l2; j5++)
  762. if(l3 == k || l3 == j1 || j5 == i2 || j5 == l2)
  763. {
  764. int j7 = onDemandFetcher.method562(0, j5, l3);
  765. if(j7 != -1)
  766. onDemandFetcher.method560(j7, 3);
  767. int k8 = onDemandFetcher.method562(1, j5, l3);
  768. if(k8 != -1)
  769. onDemandFetcher.method560(k8, 3);
  770. }
  771.  
  772. }
  773.  
  774. }
  775.  
  776. private void unlinkMRUNodes()
  777. {
  778. ObjectDef.mruNodes1.unlinkAll();
  779. ObjectDef.mruNodes2.unlinkAll();
  780. EntityDef.mruNodes.unlinkAll();
  781. ItemDef.mruNodes2.unlinkAll();
  782. ItemDef.mruNodes1.unlinkAll();
  783. Player.mruNodes.unlinkAll();
  784. SpotAnim.aMRUNodes_415.unlinkAll();
  785. }
  786.  
  787. private void method24(int i)
  788. {
  789. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  790. int j = ai.length;
  791. for(int k = 0; k < j; k++)
  792. ai[k] = 0;
  793.  
  794. for(int l = 1; l < 103; l++)
  795. {
  796. int i1 = 24628 + (103 - l) * 512 * 4;
  797. for(int k1 = 1; k1 < 103; k1++)
  798. {
  799. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  800. worldController.method309(ai, i1, i, k1, l);
  801. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  802. worldController.method309(ai, i1, i + 1, k1, l);
  803. i1 += 4;
  804. }
  805.  
  806. }
  807.  
  808. int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  809. int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  810. aClass30_Sub2_Sub1_Sub1_1263.method343();
  811. for(int i2 = 1; i2 < 103; i2++)
  812. {
  813. for(int j2 = 1; j2 < 103; j2++)
  814. {
  815. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  816. method50(i2, j1, j2, l1, i);
  817. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  818. method50(i2, j1, j2, l1, i + 1);
  819. }
  820.  
  821. }
  822.  
  823. aRSImageProducer_1165.initDrawingArea();
  824. anInt1071 = 0;
  825. for(int k2 = 0; k2 < 104; k2++)
  826. {
  827. for(int l2 = 0; l2 < 104; l2++)
  828. {
  829. int i3 = worldController.method303(plane, k2, l2);
  830. if(i3 != 0)
  831. {
  832. i3 = i3 >> 14 & 0x7fff;
  833. int j3 = ObjectDef.forID(i3).anInt746;
  834. if(j3 >= 0)
  835. {
  836. int k3 = k2;
  837. int l3 = l2;
  838. if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  839. {
  840. byte byte0 = 104;
  841. byte byte1 = 104;
  842. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  843. for(int i4 = 0; i4 < 10; i4++)
  844. {
  845. int j4 = (int)(Math.random() * 4D);
  846. if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  847. k3--;
  848. if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  849. k3++;
  850. if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  851. l3--;
  852. if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  853. l3++;
  854. }
  855.  
  856. }
  857. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  858. anIntArray1072[anInt1071] = k3;
  859. anIntArray1073[anInt1071] = l3;
  860. anInt1071++;
  861. }
  862. }
  863. }
  864.  
  865. }
  866.  
  867. }
  868.  
  869. private void spawnGroundItem(int i, int j)
  870. {
  871. NodeList class19 = groundArray[plane][i][j];
  872. if(class19 == null)
  873. {
  874. worldController.method295(plane, i, j);
  875. return;
  876. }
  877. int k = 0xfa0a1f01;
  878. Object obj = null;
  879. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  880. {
  881. ItemDef itemDef = ItemDef.forID(item.ID);
  882. int l = itemDef.value;
  883. if(itemDef.stackable)
  884. l *= item.anInt1559 + 1;
  885. // notifyItemSpawn(item, i + baseX, j + baseY);
  886.  
  887. if(l > k)
  888. {
  889. k = l;
  890. obj = item;
  891. }
  892. }
  893.  
  894. class19.insertTail(((Node) (obj)));
  895. Object obj1 = null;
  896. Object obj2 = null;
  897. for(Item class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetNext())
  898. {
  899. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  900. obj1 = class30_sub2_sub4_sub2_1;
  901. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  902. obj2 = class30_sub2_sub4_sub2_1;
  903. }
  904.  
  905. int i1 = i + (j << 7) + 0x60000000;
  906. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  907. }
  908.  
  909. private void method26(boolean flag)
  910. {
  911. for(int j = 0; j < npcCount; j++)
  912. {
  913. NPC npc = npcArray[npcIndices[j]];
  914. int k = 0x20000000 + (npcIndices[j] << 14);
  915. if(npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  916. continue;
  917. int l = npc.x >> 7;
  918. int i1 = npc.y >> 7;
  919. if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  920. continue;
  921. if(npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  922. {
  923. if(anIntArrayArray929[l][i1] == anInt1265)
  924. continue;
  925. anIntArrayArray929[l][i1] = anInt1265;
  926. }
  927. if(!npc.desc.aBoolean84)
  928. k += 0x80000000;
  929. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  930. }
  931. }
  932.  
  933. private boolean replayWave()
  934. {
  935. return signlink.wavereplay();
  936. }
  937.  
  938. private void loadError()
  939. {
  940. String s = "ondemand";//was a constant parameter
  941. System.out.println(s);
  942. try
  943. {
  944. getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
  945. }
  946. catch(Exception exception)
  947. {
  948. exception.printStackTrace();
  949. }
  950. do
  951. try
  952. {
  953. Thread.sleep(1000L);
  954. }
  955. catch(Exception _ex) { }
  956. while(true);
  957. }
  958.  
  959. public void drawHoverBox(int xPos, int yPos, String text) {
  960. String[] results = text.split("\n");
  961. int height = (results.length * 16) + 6;
  962. int width;
  963. width = chatTextDrawingArea.getTextWidth(results[0]) + 6;
  964. for(int i = 1; i < results.length; i++)
  965. if(width <= chatTextDrawingArea.getTextWidth(results[i]) + 6)
  966. width = chatTextDrawingArea.getTextWidth(results[i]) + 6;
  967. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  968. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  969. yPos += 14;
  970. for(int i = 0; i < results.length; i++) {
  971. chatTextDrawingArea.method389(false, xPos + 3, 0, results[i], yPos);
  972. yPos += 16;
  973. }
  974. }
  975.  
  976. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
  977. {
  978. if(class9.type != 0 || class9.children == null || class9.isMouseoverTriggered)
  979. return;
  980. if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  981. return;
  982. int k1 = class9.children.length;
  983. for(int l1 = 0; l1 < k1; l1++)
  984. {
  985. int i2 = class9.childX[l1] + i;
  986. int j2 = (class9.childY[l1] + l) - j1;
  987. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  988. i2 += class9_1.anInt263;
  989. j2 += class9_1.anInt265;
  990. if((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  991. if(class9_1.mOverInterToTrigger >= 0)
  992. anInt886 = class9_1.mOverInterToTrigger;
  993. else
  994. anInt886 = class9_1.id;
  995. if (class9_1.type == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  996. anInt1315 = class9_1.id;
  997. }
  998. if(class9_1.type == 0)
  999. {
  1000. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1001. if(class9_1.scrollMax > class9_1.height)
  1002. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1003. } else
  1004. {
  1005. if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1006. {
  1007. boolean flag = false;
  1008. if(class9_1.contentType != 0)
  1009. flag = buildFriendsListMenu(class9_1);
  1010. if(!flag)
  1011. {
  1012. //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1013. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1014. menuActionID[menuActionRow] = 315;
  1015. menuActionCmd3[menuActionRow] = class9_1.id;
  1016. menuActionRow++;
  1017. }
  1018. }
  1019. if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1020. {
  1021. String s = class9_1.selectedActionName;
  1022. if(s.indexOf(" ") != -1)
  1023. s = s.substring(0, s.indexOf(" "));
  1024. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1025. menuActionID[menuActionRow] = 626;
  1026. menuActionCmd3[menuActionRow] = class9_1.id;
  1027. menuActionRow++;
  1028. }
  1029. if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1030. {
  1031. menuActionName[menuActionRow] = "Close";
  1032. menuActionID[menuActionRow] = 200;
  1033. menuActionCmd3[menuActionRow] = class9_1.id;
  1034. menuActionRow++;
  1035. }
  1036. if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1037. {
  1038. //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1039. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1040. menuActionID[menuActionRow] = 169;
  1041. menuActionCmd3[menuActionRow] = class9_1.id;
  1042. menuActionRow++;
  1043. if (class9_1.hoverText != null) {
  1044. //drawHoverBox(k, l, class9_1.hoverText);
  1045. //System.out.println("DRAWING INTERFACE: " + class9_1.hoverText);
  1046. }
  1047. }
  1048. if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1049. {
  1050. //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1051. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1052. menuActionID[menuActionRow] = 646;
  1053. menuActionCmd3[menuActionRow] = class9_1.id;
  1054. menuActionRow++;
  1055. }
  1056. if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1057. {
  1058. //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1059. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1060. menuActionID[menuActionRow] = 679;
  1061. menuActionCmd3[menuActionRow] = class9_1.id;
  1062. menuActionRow++;
  1063. }
  1064. if(class9_1.type == 2)
  1065. {
  1066. int k2 = 0;
  1067. for(int l2 = 0; l2 < class9_1.height; l2++)
  1068. {
  1069. for(int i3 = 0; i3 < class9_1.width; i3++)
  1070. {
  1071. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1072. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1073. if(k2 < 20)
  1074. {
  1075. j3 += class9_1.spritesX[k2];
  1076. k3 += class9_1.spritesY[k2];
  1077. }
  1078. if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  1079. {
  1080. mouseInvInterfaceIndex = k2;
  1081. lastActiveInvInterface = class9_1.id;
  1082. if(class9_1.inv[k2] > 0)
  1083. {
  1084. ItemDef itemDef = ItemDef.forID(class9_1.inv[k2] - 1);
  1085. if(itemSelected == 1 && class9_1.isInventoryInterface)
  1086. {
  1087. if(class9_1.id != anInt1284 || k2 != anInt1283)
  1088. {
  1089. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  1090. menuActionID[menuActionRow] = 870;
  1091. menuActionCmd1[menuActionRow] = itemDef.id;
  1092. menuActionCmd2[menuActionRow] = k2;
  1093. menuActionCmd3[menuActionRow] = class9_1.id;
  1094. menuActionRow++;
  1095. }
  1096. } else
  1097. if(spellSelected == 1 && class9_1.isInventoryInterface)
  1098. {
  1099. if((spellUsableOn & 0x10) == 16)
  1100. {
  1101. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1102. menuActionID[menuActionRow] = 543;
  1103. menuActionCmd1[menuActionRow] = itemDef.id;
  1104. menuActionCmd2[menuActionRow] = k2;
  1105. menuActionCmd3[menuActionRow] = class9_1.id;
  1106. menuActionRow++;
  1107. }
  1108. } else
  1109. {
  1110. if(class9_1.isInventoryInterface)
  1111. {
  1112. for(int l3 = 4; l3 >= 3; l3--)
  1113. if(itemDef.actions != null && itemDef.actions[l3] != null)
  1114. {
  1115. menuActionName[menuActionRow] = itemDef.actions[l3] + " @lre@" + itemDef.name;
  1116. if(l3 == 3)
  1117. menuActionID[menuActionRow] = 493;
  1118. if(l3 == 4)
  1119. menuActionID[menuActionRow] = 847;
  1120. menuActionCmd1[menuActionRow] = itemDef.id;
  1121. menuActionCmd2[menuActionRow] = k2;
  1122. menuActionCmd3[menuActionRow] = class9_1.id;
  1123. menuActionRow++;
  1124. } else
  1125. if(l3 == 4)
  1126. {
  1127. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1128. menuActionID[menuActionRow] = 847;
  1129. menuActionCmd1[menuActionRow] = itemDef.id;
  1130. menuActionCmd2[menuActionRow] = k2;
  1131. menuActionCmd3[menuActionRow] = class9_1.id;
  1132. menuActionRow++;
  1133. }
  1134.  
  1135. }
  1136. if(class9_1.usableItemInterface)
  1137. {
  1138. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1139. menuActionID[menuActionRow] = 447;
  1140. menuActionCmd1[menuActionRow] = itemDef.id;
  1141. //k2 = inventory spot
  1142. //System.out.println(k2);
  1143. menuActionCmd2[menuActionRow] = k2;
  1144. menuActionCmd3[menuActionRow] = class9_1.id;
  1145. menuActionRow++;
  1146. }
  1147. if(class9_1.isInventoryInterface && itemDef.actions != null)
  1148. {
  1149. for(int i4 = 2; i4 >= 0; i4--)
  1150. if(itemDef.actions[i4] != null)
  1151. {
  1152. menuActionName[menuActionRow] = itemDef.actions[i4] + " @lre@" + itemDef.name;
  1153. if(i4 == 0)
  1154. menuActionID[menuActionRow] = 74;
  1155. if(i4 == 1)
  1156. menuActionID[menuActionRow] = 454;
  1157. if(i4 == 2)
  1158. menuActionID[menuActionRow] = 539;
  1159. menuActionCmd1[menuActionRow] = itemDef.id;
  1160. menuActionCmd2[menuActionRow] = k2;
  1161. menuActionCmd3[menuActionRow] = class9_1.id;
  1162. menuActionRow++;
  1163. }
  1164.  
  1165. }
  1166. if(class9_1.actions != null)
  1167. {
  1168. for(int j4 = 4; j4 >= 0; j4--)
  1169. if(class9_1.actions[j4] != null)
  1170. {
  1171. menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@" + itemDef.name;
  1172. if(j4 == 0)
  1173. menuActionID[menuActionRow] = 632;
  1174. if(j4 == 1)
  1175. menuActionID[menuActionRow] = 78;
  1176. if(j4 == 2)
  1177. menuActionID[menuActionRow] = 867;
  1178. if(j4 == 3)
  1179. menuActionID[menuActionRow] = 431;
  1180. if(j4 == 4)
  1181. menuActionID[menuActionRow] = 53;
  1182. menuActionCmd1[menuActionRow] = itemDef.id;
  1183. menuActionCmd2[menuActionRow] = k2;
  1184. menuActionCmd3[menuActionRow] = class9_1.id;
  1185. menuActionRow++;
  1186. }
  1187.  
  1188. }
  1189. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inv[k2] - 1) + "@gre@)";
  1190. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1191. menuActionID[menuActionRow] = 1125;
  1192. menuActionCmd1[menuActionRow] = itemDef.id;
  1193. menuActionCmd2[menuActionRow] = k2;
  1194. menuActionCmd3[menuActionRow] = class9_1.id;
  1195. menuActionRow++;
  1196. }
  1197. }
  1198. }
  1199. k2++;
  1200. }
  1201.  
  1202. }
  1203.  
  1204. }
  1205. }
  1206. }
  1207.  
  1208. }
  1209.  
  1210. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1211. scrollBar1.drawSprite(i1, l);
  1212. scrollBar2.drawSprite(i1, (l + j) - 16);
  1213. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1214. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1215. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1216. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1217. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1218. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1219. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1220. int k1 = ((j - 32) * j) / j1;
  1221. if(k1 < 8)
  1222. k1 = 8;
  1223. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1224. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1225. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1226. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1227. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1228. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1229. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1230. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1231. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1232. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1233. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1234. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1235. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1236. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1237. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1238. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1239. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1240. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1241. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1242. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1243. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1244. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1245. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1246. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1247. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1248. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1249. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1250. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1251. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1252. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1253. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1254. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1255. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1256. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1257. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1258. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1259. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1260. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1261. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1262. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1263. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1264. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1265. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1266. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1267. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1268. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1269. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1270. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1271. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1272. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1273. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1274. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1275. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1276. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1277. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1278. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1279. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1280. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1281. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1282. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1283. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1284. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1285. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1286. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1287. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1288. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1289. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1290. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1291. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1292. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1293. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1294. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1295. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1296. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1297. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1298. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1299. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1300. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1301. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1302. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1303. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1304. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1305. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1306. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1307. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1308. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1309. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1310. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1311. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1312. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1313. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1314. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1315. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1316. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1317. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1318. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1319. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1320. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1321. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1322. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1323. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1324. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1325. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1326. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1327. }
  1328.  
  1329. private void updateNPCs(Stream stream, int i)
  1330. {
  1331. anInt839 = 0;
  1332. anInt893 = 0;
  1333. method139(stream);
  1334. method46(i, stream);
  1335. method86(stream);
  1336. for(int k = 0; k < anInt839; k++)
  1337. {
  1338. int l = anIntArray840[k];
  1339. if(npcArray[l].anInt1537 != loopCycle)
  1340. {
  1341. npcArray[l].desc = null;
  1342. npcArray[l] = null;
  1343. }
  1344. }
  1345.  
  1346. if(stream.currentOffset != i)
  1347. {
  1348. signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1349. throw new RuntimeException("eek");
  1350. }
  1351. for(int i1 = 0; i1 < npcCount; i1++)
  1352. if(npcArray[npcIndices[i1]] == null)
  1353. {
  1354. signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1355. throw new RuntimeException("eek");
  1356. }
  1357.  
  1358. }
  1359.  
  1360. private int cButtonHPos;
  1361. private int cButtonHCPos;
  1362. private int cButtonCPos;
  1363.  
  1364. private void processChatModeClick() {
  1365. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  1366. cButtonHPos = 0;
  1367. aBoolean1233 = true;
  1368. inputTaken = true;
  1369. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  1370. cButtonHPos = 1;
  1371. aBoolean1233 = true;
  1372. inputTaken = true;
  1373. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  1374. cButtonHPos = 2;
  1375. aBoolean1233 = true;
  1376. inputTaken = true;
  1377. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  1378. cButtonHPos = 3;
  1379. aBoolean1233 = true;
  1380. inputTaken = true;
  1381. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  1382. cButtonHPos = 4;
  1383. aBoolean1233 = true;
  1384. inputTaken = true;
  1385. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  1386. cButtonHPos = 5;
  1387. aBoolean1233 = true;
  1388. inputTaken = true;
  1389. } else if(super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= 482 && super.mouseY <= 503) {
  1390. cButtonHPos = 6;
  1391. aBoolean1233 = true;
  1392. inputTaken = true;
  1393. } else {
  1394. cButtonHPos = -1;
  1395. aBoolean1233 = true;
  1396. inputTaken = true;
  1397. }
  1398. if(super.clickMode3 == 1) {
  1399. if(super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1400. cButtonCPos = 0;
  1401. chatTypeView = 0;
  1402. aBoolean1233 = true;
  1403. inputTaken = true;
  1404. } else if(super.saveClickX >= 71 && super.saveClickX <= 127 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1405. cButtonCPos = 1;
  1406. chatTypeView = 5;
  1407. aBoolean1233 = true;
  1408. inputTaken = true;
  1409. } else if(super.saveClickX >= 137 && super.saveClickX <= 193 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1410. cButtonCPos = 2;
  1411. chatTypeView = 1;
  1412. aBoolean1233 = true;
  1413. inputTaken = true;
  1414. } else if(super.saveClickX >= 203 && super.saveClickX <= 259 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1415. cButtonCPos = 3;
  1416. chatTypeView = 2;
  1417. aBoolean1233 = true;
  1418. inputTaken = true;
  1419. } else if(super.saveClickX >= 269 && super.saveClickX <= 325 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1420. cButtonCPos = 4;
  1421. chatTypeView = 11;
  1422. aBoolean1233 = true;
  1423. inputTaken = true;
  1424. } else if(super.saveClickX >= 335 && super.saveClickX <= 391 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1425. cButtonCPos = 5;
  1426. chatTypeView = 3;
  1427. aBoolean1233 = true;
  1428. inputTaken = true;
  1429. } else if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1430. if(openInterfaceID == -1) {
  1431. clearTopInterfaces();
  1432. reportAbuseInput = "";
  1433. canMute = false;
  1434. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1435. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  1436. continue;
  1437. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1438. break;
  1439. }
  1440. } else {
  1441. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1442. }
  1443. }
  1444. }
  1445. }
  1446.  
  1447. private void method33(int i)
  1448. {
  1449. int j = Varp.cache[i].anInt709;
  1450. if(j == 0)
  1451. return;
  1452. int k = variousSettings[i];
  1453. if(j == 1)
  1454. {
  1455. if(k == 1)
  1456. Texture.method372(0.90000000000000002D);
  1457. if(k == 2)
  1458. Texture.method372(0.80000000000000004D);
  1459. if(k == 3)
  1460. Texture.method372(0.69999999999999996D);
  1461. if(k == 4)
  1462. Texture.method372(0.59999999999999998D);
  1463. ItemDef.mruNodes1.unlinkAll();
  1464. welcomeScreenRaised = true;
  1465. }
  1466. if(j == 3)
  1467. {
  1468. boolean flag1 = musicEnabled;
  1469. if(k == 0)
  1470. {
  1471. adjustVolume(musicEnabled, 0);
  1472. musicEnabled = true;
  1473. }
  1474. if(k == 1)
  1475. {
  1476. adjustVolume(musicEnabled, -400);
  1477. musicEnabled = true;
  1478. }
  1479. if(k == 2)
  1480. {
  1481. adjustVolume(musicEnabled, -800);
  1482. musicEnabled = true;
  1483. }
  1484. if(k == 3)
  1485. {
  1486. adjustVolume(musicEnabled, -1200);
  1487. musicEnabled = true;
  1488. }
  1489. if(k == 4)
  1490. musicEnabled = false;
  1491. if(musicEnabled != flag1 && !lowMem)
  1492. {
  1493. if(musicEnabled)
  1494. {
  1495. nextSong = currentSong;
  1496. songChanging = true;
  1497. onDemandFetcher.method558(2, nextSong);
  1498. } else
  1499. {
  1500. stopMidi();
  1501. }
  1502. prevSong = 0;
  1503. }
  1504. }
  1505. if(j == 4)
  1506. {
  1507. if(k == 0)
  1508. {
  1509. aBoolean848 = true;
  1510. setWaveVolume(0);
  1511. }
  1512. if(k == 1)
  1513. {
  1514. aBoolean848 = true;
  1515. setWaveVolume(-400);
  1516. }
  1517. if(k == 2)
  1518. {
  1519. aBoolean848 = true;
  1520. setWaveVolume(-800);
  1521. }
  1522. if(k == 3)
  1523. {
  1524. aBoolean848 = true;
  1525. setWaveVolume(-1200);
  1526. }
  1527. if(k == 4)
  1528. aBoolean848 = false;
  1529. }
  1530. if(j == 5)
  1531. anInt1253 = k;
  1532. if(j == 6)
  1533. anInt1249 = k;
  1534. if(j == 8)
  1535. {
  1536. splitPrivateChat = k;
  1537. inputTaken = true;
  1538. }
  1539. if(j == 9)
  1540. anInt913 = k;
  1541. }
  1542.  
  1543. private void updateEntities() {
  1544. try{
  1545. int anInt974 = 0;
  1546. for(int j = -1; j < playerCount + npcCount; j++) {
  1547. Object obj;
  1548. if(j == -1)
  1549. obj = myPlayer;
  1550. else
  1551. if(j < playerCount)
  1552. obj = playerArray[playerIndices[j]];
  1553. else
  1554. obj = npcArray[npcIndices[j - playerCount]];
  1555. if(obj == null || !((Entity) (obj)).isVisible())
  1556. continue;
  1557. if(obj instanceof NPC) {
  1558. EntityDef entityDef = ((NPC)obj).desc;
  1559. if(entityDef.childrenIDs != null)
  1560. entityDef = entityDef.method161();
  1561. if(entityDef == null)
  1562. continue;
  1563. }
  1564. if(j < playerCount) {
  1565. int l = 30;
  1566. Player player = (Player)obj;
  1567. if(player.headIcon >= 0) {
  1568. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1569. if(spriteDrawX > -1) {
  1570. if (player.skullIcon < 2) {
  1571. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1572. l += 25;
  1573. }
  1574. if (player.headIcon < 7) {
  1575. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1576. l += 18;
  1577. }
  1578. }
  1579. }
  1580. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  1581. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1582. if(spriteDrawX > -1)
  1583. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1584. }
  1585. } else {
  1586. EntityDef entityDef_1 = ((NPC)obj).desc;
  1587. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  1588. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1589. if(spriteDrawX > -1)
  1590. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  1591. }
  1592. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  1593. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1594. if(spriteDrawX > -1)
  1595. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  1596. }
  1597. }
  1598. if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  1599. {
  1600. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  1601. if(spriteDrawX > -1 && anInt974 < anInt975)
  1602. {
  1603. anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
  1604. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  1605. anIntArray976[anInt974] = spriteDrawX;
  1606. anIntArray977[anInt974] = spriteDrawY;
  1607. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  1608. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  1609. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  1610. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  1611. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  1612. {
  1613. anIntArray978[anInt974] += 10;
  1614. anIntArray977[anInt974] += 5;
  1615. }
  1616. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  1617. anIntArray979[anInt974] = 60;
  1618. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  1619. anIntArray978[anInt974] += 5;
  1620. }
  1621. }
  1622. if(((Entity) (obj)).loopCycleStatus > loopCycle)
  1623. {
  1624. try{
  1625. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1626. if(spriteDrawX > -1)
  1627. {
  1628. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  1629. if(i1 > 30)
  1630. i1 = 30;
  1631. DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  1632. DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  1633. }
  1634. }catch(Exception e){ }
  1635. }
  1636. for(int j1 = 0; j1 < 4; j1++)
  1637. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  1638. {
  1639. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  1640. if(spriteDrawX > -1)
  1641. {
  1642. if(j1 == 1)
  1643. spriteDrawY -= 20;
  1644. if(j1 == 2)
  1645. {
  1646. spriteDrawX -= 15;
  1647. spriteDrawY -= 10;
  1648. }
  1649. if(j1 == 3)
  1650. {
  1651. spriteDrawX += 15;
  1652. spriteDrawY -= 10;
  1653. }
  1654. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  1655. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  1656. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  1657. }
  1658. }
  1659. }
  1660. for(int k = 0; k < anInt974; k++) {
  1661. int k1 = anIntArray976[k];
  1662. int l1 = anIntArray977[k];
  1663. int j2 = anIntArray979[k];
  1664. int k2 = anIntArray978[k];
  1665. boolean flag = true;
  1666. while(flag)
  1667. {
  1668. flag = false;
  1669. for(int l2 = 0; l2 < k; l2++)
  1670. if(l1 + 2 > anIntArray977[l2] - anIntArray978[l2] && l1 - k2 < anIntArray977[l2] + 2 && k1 - j2 < anIntArray976[l2] + anIntArray979[l2] && k1 + j2 > anIntArray976[l2] - anIntArray979[l2] && anIntArray977[l2] - anIntArray978[l2] < l1)
  1671. {
  1672. l1 = anIntArray977[l2] - anIntArray978[l2];
  1673. flag = true;
  1674. }
  1675.  
  1676. }
  1677. spriteDrawX = anIntArray976[k];
  1678. spriteDrawY = anIntArray977[k] = l1;
  1679. String s = aStringArray983[k];
  1680. if(anInt1249 == 0)
  1681. {
  1682. int i3 = 0xffff00;
  1683. if(anIntArray980[k] < 6)
  1684. i3 = anIntArray965[anIntArray980[k]];
  1685. if(anIntArray980[k] == 6)
  1686. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  1687. if(anIntArray980[k] == 7)
  1688. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  1689. if(anIntArray980[k] == 8)
  1690. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  1691. if(anIntArray980[k] == 9) {
  1692. int j3 = 150 - anIntArray982[k];
  1693. if(j3 < 50)
  1694. i3 = 0xff0000 + 1280 * j3;
  1695. else
  1696. if(j3 < 100)
  1697. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  1698. else
  1699. if(j3 < 150)
  1700. i3 = 65280 + 5 * (j3 - 100);
  1701. }
  1702. if(anIntArray980[k] == 10) {
  1703. int k3 = 150 - anIntArray982[k];
  1704. if(k3 < 50)
  1705. i3 = 0xff0000 + 5 * k3;
  1706. else
  1707. if(k3 < 100)
  1708. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  1709. else
  1710. if(k3 < 150)
  1711. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  1712. }
  1713. if(anIntArray980[k] == 11) {
  1714. int l3 = 150 - anIntArray982[k];
  1715. if(l3 < 50)
  1716. i3 = 0xffffff - 0x50005 * l3;
  1717. else
  1718. if(l3 < 100)
  1719. i3 = 65280 + 0x50005 * (l3 - 50);
  1720. else
  1721. if(l3 < 150)
  1722. i3 = 0xffffff - 0x50000 * (l3 - 100);
  1723. }
  1724. if(anIntArray981[k] == 0) {
  1725. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1726. chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  1727. }
  1728. if(anIntArray981[k] == 1) {
  1729. chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  1730. chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  1731. }
  1732. if(anIntArray981[k] == 2) {
  1733. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  1734. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  1735. }
  1736. if(anIntArray981[k] == 3) {
  1737. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  1738. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  1739. }
  1740. if(anIntArray981[k] == 4) {
  1741. int i4 = chatTextDrawingArea.method384(s);
  1742. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  1743. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  1744. chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  1745. chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  1746. DrawingArea.defaultDrawingAreaSize();
  1747. }
  1748. if(anIntArray981[k] == 5) {
  1749. int j4 = 150 - anIntArray982[k];
  1750. int l4 = 0;
  1751. if(j4 < 25)
  1752. l4 = j4 - 25;
  1753. else
  1754. if(j4 > 125)
  1755. l4 = j4 - 125;
  1756. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  1757. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  1758. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  1759. DrawingArea.defaultDrawingAreaSize();
  1760. }
  1761. } else {
  1762. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1763. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  1764. }
  1765. }
  1766. } catch(Exception e){ }
  1767. }
  1768.  
  1769. private void delFriend(long l)
  1770. {
  1771. try
  1772. {
  1773. if(l == 0L)
  1774. return;
  1775. for(int i = 0; i < friendsCount; i++)
  1776. {
  1777. if(friendsListAsLongs[i] != l)
  1778. continue;
  1779. friendsCount--;
  1780. needDrawTabArea = true;
  1781. for(int j = i; j < friendsCount; j++)
  1782. {
  1783. friendsList[j] = friendsList[j + 1];
  1784. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  1785. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  1786. }
  1787.  
  1788. stream.createFrame(215);
  1789. stream.writeQWord(l);
  1790. break;
  1791. }
  1792. }
  1793. catch(RuntimeException runtimeexception)
  1794. {
  1795. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  1796. throw new RuntimeException();
  1797. }
  1798. }
  1799.  
  1800. public void drawSideIcons(){
  1801. /* Top sideIcons */
  1802. if(tabInterfaceIDs[0] != -1)//attack
  1803. sideIcons[0].drawSprite(10, 4);
  1804. if(tabInterfaceIDs[1] != -1)//stat
  1805. sideIcons[1].drawSprite(43, 4);
  1806. if(tabInterfaceIDs[2] != -1)//quest
  1807. sideIcons[2].drawSprite(76, 3);
  1808. if(tabInterfaceIDs[3] != -1)//inventory
  1809. sideIcons[3].drawSprite(111, 5);
  1810. if(tabInterfaceIDs[4] != -1)//equipment
  1811. sideIcons[4].drawSprite(140, 1);
  1812. if(tabInterfaceIDs[5] != -1)//prayer
  1813. sideIcons[5].drawSprite(174, 1);
  1814. if(tabInterfaceIDs[6] != -1)//magic
  1815. sideIcons[6].drawSprite(208, 4);
  1816. /* Bottom sideIcons */
  1817. if(tabInterfaceIDs[7] != -1)//clan
  1818. sideIcons[7].drawSprite(11, 303);
  1819. if(tabInterfaceIDs[8] != -1)//friends
  1820. sideIcons[8].drawSprite(46, 306);
  1821. if(tabInterfaceIDs[9] != -1)//ignore
  1822. sideIcons[9].drawSprite(79, 306);
  1823. if(tabInterfaceIDs[10] != -1)//options
  1824. sideIcons[10].drawSprite(113, 302);
  1825. if(tabInterfaceIDs[11] != -1)//options
  1826. sideIcons[11].drawSprite(145, 304);
  1827. if(tabInterfaceIDs[12] != -1)//emotes
  1828. sideIcons[12].drawSprite(181, 302);
  1829. if(tabInterfaceIDs[13] != -1)//music
  1830. sideIcons[13].drawSprite(213, 303);
  1831. }
  1832.  
  1833. public void drawRedStones() {
  1834. if(tabInterfaceIDs[tabID] != -1) {
  1835. switch(tabID) {
  1836. case 0:
  1837. redStones[0].drawSprite(3, 0);
  1838. break;
  1839. case 1:
  1840. redStones[4].drawSprite(41, 0);
  1841. break;
  1842. case 2:
  1843. redStones[4].drawSprite(74, 0);
  1844. break;
  1845. case 3:
  1846. redStones[4].drawSprite(107, 0);
  1847. break;
  1848. case 4:
  1849. redStones[4].drawSprite(140, 0);
  1850. break;
  1851. case 5:
  1852. redStones[4].drawSprite(173, 0);
  1853. break;
  1854. case 6:
  1855. redStones[1].drawSprite(206, 0);
  1856. break;
  1857. case 7:
  1858. redStones[2].drawSprite(3, 298);
  1859. break;
  1860. case 8:
  1861. redStones[4].drawSprite(41, 298);
  1862. break;
  1863. case 9:
  1864. redStones[4].drawSprite(74, 298);
  1865. break;
  1866. case 10:
  1867. redStones[4].drawSprite(107, 298);
  1868. break;
  1869. case 11:
  1870. redStones[4].drawSprite(140, 298);
  1871. break;
  1872. case 12:
  1873. redStones[4].drawSprite(173, 298);
  1874. break;
  1875. case 13:
  1876. redStones[3].drawSprite(206, 298);
  1877. break;
  1878. }
  1879. }
  1880. }
  1881.  
  1882. private void drawTabArea() {
  1883. aRSImageProducer_1163.initDrawingArea();
  1884. Texture.anIntArray1472 = anIntArray1181;
  1885. tabArea.drawSprite(0, 0);
  1886. if(invOverlayInterfaceID == -1) {
  1887. drawRedStones();
  1888. drawSideIcons();
  1889. }
  1890. if(invOverlayInterfaceID != -1)
  1891. drawInterface(0, 28, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  1892. else if(tabInterfaceIDs[tabID] != -1)
  1893. drawInterface(0, 28, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  1894. if(menuOpen && menuScreenArea == 1)
  1895. drawMenu();
  1896. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  1897. aRSImageProducer_1165.initDrawingArea();
  1898. Texture.anIntArray1472 = anIntArray1182;
  1899. }
  1900.  
  1901. private void method37(int j) {
  1902. if(!lowMem) {
  1903. if(Texture.anIntArray1480[17] >= j) {
  1904. Background background = Texture.aBackgroundArray1474s[17];
  1905. int k = background.anInt1452 * background.anInt1453 - 1;
  1906. //fire cape apparently?
  1907. int j1 = background.anInt1452 * anInt945 * 2;
  1908. byte abyte0[] = background.aByteArray1450;
  1909. byte abyte3[] = aByteArray912;
  1910. for(int i2 = 0; i2 <= k; i2++)
  1911. abyte3[i2] = abyte0[i2 - j1 & k];
  1912.  
  1913. background.aByteArray1450 = abyte3;
  1914. aByteArray912 = abyte0;
  1915. Texture.method370(17);
  1916. anInt854++;
  1917. if(anInt854 > 1235) {
  1918. anInt854 = 0;
  1919. stream.createFrame(226);
  1920. stream.writeWordBigEndian(0);
  1921. int l2 = stream.currentOffset;
  1922. stream.writeWord(58722);
  1923. stream.writeWordBigEndian(240);
  1924. stream.writeWord((int)(Math.random() * 65536D));
  1925. stream.writeWordBigEndian((int)(Math.random() * 256D));
  1926. if((int)(Math.random() * 2D) == 0)
  1927. stream.writeWord(51825);
  1928. stream.writeWordBigEndian((int)(Math.random() * 256D));
  1929. stream.writeWord((int)(Math.random() * 65536D));
  1930. stream.writeWord(7130);
  1931. stream.writeWord((int)(Math.random() * 65536D));
  1932. stream.writeWord(61657);
  1933. stream.writeBytes(stream.currentOffset - l2);
  1934. }
  1935. }
  1936. if(Texture.anIntArray1480[24] >= j) {
  1937. Background background_1 = Texture.aBackgroundArray1474s[24];
  1938. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  1939. int k1 = background_1.anInt1452 * anInt945 * 2;
  1940. byte abyte1[] = background_1.aByteArray1450;
  1941. byte abyte4[] = aByteArray912;
  1942. for(int j2 = 0; j2 <= l; j2++)
  1943. abyte4[j2] = abyte1[j2 - k1 & l];
  1944.  
  1945. background_1.aByteArray1450 = abyte4;
  1946. aByteArray912 = abyte1;
  1947. Texture.method370(24);
  1948. }
  1949. if(Texture.anIntArray1480[34] >= j) {
  1950. Background background_2 = Texture.aBackgroundArray1474s[34];
  1951. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  1952. int l1 = background_2.anInt1452 * anInt945 * 2;
  1953. byte abyte2[] = background_2.aByteArray1450;
  1954. byte abyte5[] = aByteArray912;
  1955. for(int k2 = 0; k2 <= i1; k2++)
  1956. abyte5[k2] = abyte2[k2 - l1 & i1];
  1957.  
  1958. background_2.aByteArray1450 = abyte5;
  1959. aByteArray912 = abyte2;
  1960. Texture.method370(34);
  1961. }
  1962. if(Texture.anIntArray1480[40] >= j)
  1963. {
  1964. Background background_2 = Texture.aBackgroundArray1474s[40];
  1965. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  1966. int l1 = background_2.anInt1452 * anInt945 * 2;
  1967. byte abyte2[] = background_2.aByteArray1450;
  1968. byte abyte5[] = aByteArray912;
  1969. for(int k2 = 0; k2 <= i1; k2++)
  1970. abyte5[k2] = abyte2[k2 - l1 & i1];
  1971.  
  1972. background_2.aByteArray1450 = abyte5;
  1973. aByteArray912 = abyte2;
  1974. Texture.method370(40);
  1975. }
  1976. }
  1977. }
  1978.  
  1979. private void method38() {
  1980. for(int i = -1; i < playerCount; i++) {
  1981. int j;
  1982. if(i == -1)
  1983. j = myPlayerIndex;
  1984. else
  1985. j = playerIndices[i];
  1986. Player player = playerArray[j];
  1987. if(player != null && player.textCycle > 0) {
  1988. player.textCycle--;
  1989. if(player.textCycle == 0)
  1990. player.textSpoken = null;
  1991. }
  1992. }
  1993. for(int k = 0; k < npcCount; k++) {
  1994. int l = npcIndices[k];
  1995. NPC npc = npcArray[l];
  1996. if(npc != null && npc.textCycle > 0) {
  1997. npc.textCycle--;
  1998. if(npc.textCycle == 0)
  1999. npc.textSpoken = null;
  2000. }
  2001. }
  2002. }
  2003.  
  2004. private void calcCameraPos() {
  2005. int i = anInt1098 * 128 + 64;
  2006. int j = anInt1099 * 128 + 64;
  2007. int k = method42(plane, j, i) - anInt1100;
  2008. if(xCameraPos < i) {
  2009. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2010. if(xCameraPos > i)
  2011. xCameraPos = i;
  2012. }
  2013. if(xCameraPos > i) {
  2014. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2015. if(xCameraPos < i)
  2016. xCameraPos = i;
  2017. }
  2018. if(zCameraPos < k) {
  2019. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2020. if(zCameraPos > k)
  2021. zCameraPos = k;
  2022. }
  2023. if(zCameraPos > k) {
  2024. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2025. if(zCameraPos < k)
  2026. zCameraPos = k;
  2027. }
  2028. if(yCameraPos < j) {
  2029. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2030. if(yCameraPos > j)
  2031. yCameraPos = j;
  2032. }
  2033. if(yCameraPos > j) {
  2034. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2035. if(yCameraPos < j)
  2036. yCameraPos = j;
  2037. }
  2038. i = anInt995 * 128 + 64;
  2039. j = anInt996 * 128 + 64;
  2040. k = method42(plane, j, i) - anInt997;
  2041. int l = i - xCameraPos;
  2042. int i1 = k - zCameraPos;
  2043. int j1 = j - yCameraPos;
  2044. int k1 = (int)Math.sqrt(l * l + j1 * j1);
  2045. int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2046. int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2047. if(l1 < 128)
  2048. l1 = 128;
  2049. if(l1 > 383)
  2050. l1 = 383;
  2051. if(yCameraCurve < l1) {
  2052. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2053. if(yCameraCurve > l1)
  2054. yCameraCurve = l1;
  2055. }
  2056. if(yCameraCurve > l1) {
  2057. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2058. if(yCameraCurve < l1)
  2059. yCameraCurve = l1;
  2060. }
  2061. int j2 = i2 - xCameraCurve;
  2062. if(j2 > 1024)
  2063. j2 -= 2048;
  2064. if(j2 < -1024)
  2065. j2 += 2048;
  2066. if(j2 > 0) {
  2067. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2068. xCameraCurve &= 0x7ff;
  2069. }
  2070. if(j2 < 0) {
  2071. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2072. xCameraCurve &= 0x7ff;
  2073. }
  2074. int k2 = i2 - xCameraCurve;
  2075. if(k2 > 1024)
  2076. k2 -= 2048;
  2077. if(k2 < -1024)
  2078. k2 += 2048;
  2079. if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2080. xCameraCurve = i2;
  2081. }
  2082.  
  2083. private void drawMenu() {
  2084. int i = menuOffsetX;
  2085. int j = menuOffsetY;
  2086. int k = menuWidth;
  2087. int l = menuHeight + 1;
  2088. int i1 = 0x5d5447;
  2089. //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  2090. //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  2091. DrawingArea.drawPixels(l, j, i, i1, k);
  2092. DrawingArea.drawPixels(16, j + 1, i + 1, 0, k - 2);
  2093. DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
  2094. chatTextDrawingArea.method385(i1, "Choose Option", j + 14, i + 3);
  2095. int j1 = super.mouseX;
  2096. int k1 = super.mouseY;
  2097. if(menuScreenArea == 0) {
  2098. j1 -= 4;
  2099. k1 -= 4;
  2100. }
  2101. if(menuScreenArea == 1) {
  2102. j1 -= 519;
  2103. k1 -= 168;
  2104. }
  2105. if(menuScreenArea == 2) {
  2106. j1 -= 17;
  2107. k1 -= 338;
  2108. }
  2109. if(menuScreenArea == 3) {
  2110. j1 -= 519;
  2111. k1 -= 0;
  2112. }
  2113. for(int l1 = 0; l1 < menuActionRow; l1++) {
  2114. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2115. int j2 = 0xffffff;
  2116. if(j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  2117. j2 = 0xffff00;
  2118. chatTextDrawingArea.method389(true, i + 3, j2, menuActionName[l1], i2);
  2119. }
  2120. }
  2121.  
  2122. private void addFriend(long l) {
  2123. try {
  2124. if(l == 0L)
  2125. return;
  2126. if(friendsCount >= 100 && anInt1046 != 1) {
  2127. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2128. return;
  2129. }
  2130. if(friendsCount >= 200) {
  2131. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2132. return;
  2133. }
  2134. String s = TextClass.fixName(TextClass.nameForLong(l));
  2135. for(int i = 0; i < friendsCount; i++)
  2136. if(friendsListAsLongs[i] == l) {
  2137. pushMessage(s + " is already on your friend list", 0, "");
  2138. return;
  2139. }
  2140. for(int j = 0; j < ignoreCount; j++)
  2141. if(ignoreListAsLongs[j] == l) {
  2142. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  2143. return;
  2144. }
  2145.  
  2146. if(s.equals(myPlayer.name)) {
  2147. return;
  2148. } else {
  2149. friendsList[friendsCount] = s;
  2150. friendsListAsLongs[friendsCount] = l;
  2151. friendsNodeIDs[friendsCount] = 0;
  2152. friendsCount++;
  2153. needDrawTabArea = true;
  2154. stream.createFrame(188);
  2155. stream.writeQWord(l);
  2156. return;
  2157. }
  2158. } catch(RuntimeException runtimeexception) {
  2159. signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
  2160. }
  2161. throw new RuntimeException();
  2162. }
  2163.  
  2164. private int method42(int i, int j, int k) {
  2165. int l = k >> 7;
  2166. int i1 = j >> 7;
  2167. if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2168. return 0;
  2169. int j1 = i;
  2170. if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2171. j1++;
  2172. int k1 = k & 0x7f;
  2173. int l1 = j & 0x7f;
  2174. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2175. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2176. return i2 * (128 - l1) + j2 * l1 >> 7;
  2177. }
  2178.  
  2179. private static String intToKOrMil(int j) {
  2180. if(j < 0x186a0)
  2181. return String.valueOf(j);
  2182. if(j < 0x989680)
  2183. return j / 1000 + "K";
  2184. else
  2185. return j / 0xf4240 + "M";
  2186. }
  2187.  
  2188. private void resetLogout() {
  2189. try {
  2190. if(socketStream != null)
  2191. socketStream.close();
  2192. }
  2193. catch(Exception _ex) { }
  2194. socketStream = null;
  2195. loggedIn = false;
  2196. loginScreenState = 0;
  2197. // myUsername = "";
  2198. // myPassword = "";
  2199. unlinkMRUNodes();
  2200. worldController.initToNull();
  2201. for(int i = 0; i < 4; i++)
  2202. aClass11Array1230[i].method210();
  2203. System.gc();
  2204. stopMidi();
  2205. currentSong = -1;
  2206. nextSong = -1;
  2207. prevSong = 0;
  2208. }
  2209.  
  2210. private void method45() {
  2211. aBoolean1031 = true;
  2212. for(int j = 0; j < 7; j++) {
  2213. anIntArray1065[j] = -1;
  2214. for(int k = 0; k < IDK.length; k++) {
  2215. if(IDK.cache[k].aBoolean662 || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2216. continue;
  2217. anIntArray1065[j] = k;
  2218. break;
  2219. }
  2220. }
  2221. }
  2222.  
  2223. private void method46(int i, Stream stream) {
  2224. while(stream.bitPosition + 21 < i * 8) {
  2225. int k = stream.readBits(14);
  2226. if(k == 16383)
  2227. break;
  2228. if(npcArray[k] == null)
  2229. npcArray[k] = new NPC();
  2230. NPC npc = npcArray[k];
  2231. npcIndices[npcCount++] = k;
  2232. npc.anInt1537 = loopCycle;
  2233. int l = stream.readBits(5);
  2234. if(l > 15)
  2235. l -= 32;
  2236. int i1 = stream.readBits(5);
  2237. if(i1 > 15)
  2238. i1 -= 32;
  2239. int j1 = stream.readBits(1);
  2240. npc.desc = EntityDef.forID(stream.readBits(12));
  2241. int k1 = stream.readBits(1);
  2242. if(k1 == 1)
  2243. anIntArray894[anInt893++] = k;
  2244. npc.anInt1540 = npc.desc.aByte68;
  2245. npc.anInt1504 = npc.desc.anInt79;
  2246. npc.anInt1554 = npc.desc.walkAnim;
  2247. npc.anInt1555 = npc.desc.anInt58;
  2248. npc.anInt1556 = npc.desc.anInt83;
  2249. npc.anInt1557 = npc.desc.anInt55;
  2250. npc.anInt1511 = npc.desc.standAnim;
  2251. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2252. }
  2253. stream.finishBitAccess();
  2254. }
  2255.  
  2256. public void processGameLoop() {
  2257. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  2258. return;
  2259. loopCycle++;
  2260. if(!loggedIn)
  2261. processLoginScreenInput();
  2262. else
  2263. mainGameProcessor();
  2264. processOnDemandQueue();
  2265. }
  2266.  
  2267. private void method47(boolean flag) {
  2268. if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2269. destX = 0;
  2270. int j = playerCount;
  2271. if(flag)
  2272. j = 1;
  2273. for(int l = 0; l < j; l++) {
  2274. Player player;
  2275. int i1;
  2276. if(flag) {
  2277. player = myPlayer;
  2278. i1 = myPlayerIndex << 14;
  2279. } else {
  2280. player = playerArray[playerIndices[l]];
  2281. i1 = playerIndices[l] << 14;
  2282. }
  2283. if(player == null || !player.isVisible())
  2284. continue;
  2285. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  2286. int j1 = player.x >> 7;
  2287. int k1 = player.y >> 7;
  2288. if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2289. continue;
  2290. if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  2291. player.aBoolean1699 = false;
  2292. player.anInt1709 = method42(plane, player.y, player.x);
  2293. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  2294. continue;
  2295. }
  2296. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2297. if(anIntArrayArray929[j1][k1] == anInt1265)
  2298. continue;
  2299. anIntArrayArray929[j1][k1] = anInt1265;
  2300. }
  2301. player.anInt1709 = method42(plane, player.y, player.x);
  2302. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  2303. }
  2304. }
  2305.  
  2306. private boolean promptUserForInput(RSInterface class9) {
  2307. int j = class9.contentType;
  2308. if(anInt900 == 2) {
  2309. if(j == 201) {
  2310. inputTaken = true;
  2311. inputDialogState = 0;
  2312. messagePromptRaised = true;
  2313. promptInput = "";
  2314. friendsListAction = 1;
  2315. aString1121 = "Enter name of friend to add to list";
  2316. }
  2317. if(j == 202) {
  2318. inputTaken = true;
  2319. inputDialogState = 0;
  2320. messagePromptRaised = true;
  2321. promptInput = "";
  2322. friendsListAction = 2;
  2323. aString1121 = "Enter name of friend to delete from list";
  2324. }
  2325. }
  2326. if(j == 205) {
  2327. anInt1011 = 250;
  2328. return true;
  2329. }
  2330. if(j == 501) {
  2331. inputTaken = true;
  2332. inputDialogState = 0;
  2333. messagePromptRaised = true;
  2334. promptInput = "";
  2335. friendsListAction = 4;
  2336. aString1121 = "Enter name of player to add to list";
  2337. }
  2338. if(j == 502) {
  2339. inputTaken = true;
  2340. inputDialogState = 0;
  2341. messagePromptRaised = true;
  2342. promptInput = "";
  2343. friendsListAction = 5;
  2344. aString1121 = "Enter name of player to delete from list";
  2345. }
  2346. if(j == 550) {
  2347. inputTaken = true;
  2348. inputDialogState = 0;
  2349. messagePromptRaised = true;
  2350. promptInput = "";
  2351. friendsListAction = 6;
  2352. aString1121 = "Enter the name of the chat you wish to join";
  2353. }
  2354. if(j >= 300 && j <= 313) {
  2355. int k = (j - 300) / 2;
  2356. int j1 = j & 1;
  2357. int i2 = anIntArray1065[k];
  2358. if(i2 != -1) {
  2359. do {
  2360. if(j1 == 0 && --i2 < 0)
  2361. i2 = IDK.length - 1;
  2362. if(j1 == 1 && ++i2 >= IDK.length)
  2363. i2 = 0;
  2364. } while(IDK.cache[i2].aBoolean662 || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2365. anIntArray1065[k] = i2;
  2366. aBoolean1031 = true;
  2367. }
  2368. }
  2369. if(j >= 314 && j <= 323) {
  2370. int l = (j - 314) / 2;
  2371. int k1 = j & 1;
  2372. int j2 = anIntArray990[l];
  2373. if(k1 == 0 && --j2 < 0)
  2374. j2 = anIntArrayArray1003[l].length - 1;
  2375. if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2376. j2 = 0;
  2377. anIntArray990[l] = j2;
  2378. aBoolean1031 = true;
  2379. }
  2380. if(j == 324 && !aBoolean1047) {
  2381. aBoolean1047 = true;
  2382. method45();
  2383. }
  2384. if(j == 325 && aBoolean1047) {
  2385. aBoolean1047 = false;
  2386. method45();
  2387. }
  2388. if(j == 326) {
  2389. stream.createFrame(101);
  2390. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2391. for(int i1 = 0; i1 < 7; i1++)
  2392. stream.writeWordBigEndian(anIntArray1065[i1]);
  2393.  
  2394. for(int l1 = 0; l1 < 5; l1++)
  2395. stream.writeWordBigEndian(anIntArray990[l1]);
  2396.  
  2397. return true;
  2398. }
  2399. if(j == 613)
  2400. canMute = !canMute;
  2401. if(j >= 601 && j <= 612) {
  2402. clearTopInterfaces();
  2403. if(reportAbuseInput.length() > 0) {
  2404. stream.createFrame(218);
  2405. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2406. stream.writeWordBigEndian(j - 601);
  2407. stream.writeWordBigEndian(canMute ? 1 : 0);
  2408. }
  2409. }
  2410. return false;
  2411. }
  2412.  
  2413. private void method49(Stream stream) {
  2414. for(int j = 0; j < anInt893; j++) {
  2415. int k = anIntArray894[j];
  2416. Player player = playerArray[k];
  2417. int l = stream.readUnsignedByte();
  2418. if((l & 0x40) != 0)
  2419. l += stream.readUnsignedByte() << 8;
  2420. method107(l, k, stream, player);
  2421. }
  2422. }
  2423.  
  2424. private void method50(int i, int k, int l, int i1, int j1) {
  2425. int k1 = worldController.method300(j1, l, i);
  2426. if(k1 != 0) {
  2427. int l1 = worldController.method304(j1, l, i, k1);
  2428. int k2 = l1 >> 6 & 3;
  2429. int i3 = l1 & 0x1f;
  2430. int k3 = k;
  2431. if(k1 > 0)
  2432. k3 = i1;
  2433. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2434. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2435. int i5 = k1 >> 14 & 0x7fff;
  2436. ObjectDef class46_2 = ObjectDef.forID(i5);
  2437. if(class46_2.anInt758 != -1) {
  2438. Background background_2 = mapScenes[class46_2.anInt758];
  2439. if(background_2 != null) {
  2440. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  2441. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  2442. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  2443. }
  2444. } else {
  2445. if(i3 == 0 || i3 == 2)
  2446. if(k2 == 0) {
  2447. ai[k4] = k3;
  2448. ai[k4 + 512] = k3;
  2449. ai[k4 + 1024] = k3;
  2450. ai[k4 + 1536] = k3;
  2451. } else if(k2 == 1) {
  2452. ai[k4] = k3;
  2453. ai[k4 + 1] = k3;
  2454. ai[k4 + 2] = k3;
  2455. ai[k4 + 3] = k3;
  2456. } else if(k2 == 2) {
  2457. ai[k4 + 3] = k3;
  2458. ai[k4 + 3 + 512] = k3;
  2459. ai[k4 + 3 + 1024] = k3;
  2460. ai[k4 + 3 + 1536] = k3;
  2461. } else if(k2 == 3) {
  2462. ai[k4 + 1536] = k3;
  2463. ai[k4 + 1536 + 1] = k3;
  2464. ai[k4 + 1536 + 2] = k3;
  2465. ai[k4 + 1536 + 3] = k3;
  2466. }
  2467. if(i3 == 3)
  2468. if(k2 == 0)
  2469. ai[k4] = k3;
  2470. else if(k2 == 1)
  2471. ai[k4 + 3] = k3;
  2472. else if(k2 == 2)
  2473. ai[k4 + 3 + 1536] = k3;
  2474. else if(k2 == 3)
  2475. ai[k4 + 1536] = k3;
  2476. if(i3 == 2)
  2477. if(k2 == 3) {
  2478. ai[k4] = k3;
  2479. ai[k4 + 512] = k3;
  2480. ai[k4 + 1024] = k3;
  2481. ai[k4 + 1536] = k3;
  2482. } else if(k2 == 0) {
  2483. ai[k4] = k3;
  2484. ai[k4 + 1] = k3;
  2485. ai[k4 + 2] = k3;
  2486. ai[k4 + 3] = k3;
  2487. } else if(k2 == 1) {
  2488. ai[k4 + 3] = k3;
  2489. ai[k4 + 3 + 512] = k3;
  2490. ai[k4 + 3 + 1024] = k3;
  2491. ai[k4 + 3 + 1536] = k3;
  2492. } else if(k2 == 2) {
  2493. ai[k4 + 1536] = k3;
  2494. ai[k4 + 1536 + 1] = k3;
  2495. ai[k4 + 1536 + 2] = k3;
  2496. ai[k4 + 1536 + 3] = k3;
  2497. }
  2498. }
  2499. }
  2500. k1 = worldController.method302(j1, l, i);
  2501. if(k1 != 0) {
  2502. int i2 = worldController.method304(j1, l, i, k1);
  2503. int l2 = i2 >> 6 & 3;
  2504. int j3 = i2 & 0x1f;
  2505. int l3 = k1 >> 14 & 0x7fff;
  2506. ObjectDef class46_1 = ObjectDef.forID(l3);
  2507. if(class46_1.anInt758 != -1) {
  2508. Background background_1 = mapScenes[class46_1.anInt758];
  2509. if(background_1 != null) {
  2510. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  2511. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  2512. background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  2513. }
  2514. } else if(j3 == 9) {
  2515. int l4 = 0xeeeeee;
  2516. if(k1 > 0)
  2517. l4 = 0xee0000;
  2518. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2519. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2520. if(l2 == 0 || l2 == 2) {
  2521. ai1[l5 + 1536] = l4;
  2522. ai1[l5 + 1024 + 1] = l4;
  2523. ai1[l5 + 512 + 2] = l4;
  2524. ai1[l5 + 3] = l4;
  2525. } else {
  2526. ai1[l5] = l4;
  2527. ai1[l5 + 512 + 1] = l4;
  2528. ai1[l5 + 1024 + 2] = l4;
  2529. ai1[l5 + 1536 + 3] = l4;
  2530. }
  2531. }
  2532. }
  2533. k1 = worldController.method303(j1, l, i);
  2534. if(k1 != 0) {
  2535. int j2 = k1 >> 14 & 0x7fff;
  2536. ObjectDef class46 = ObjectDef.forID(j2);
  2537. if(class46.anInt758 != -1) {
  2538. Background background = mapScenes[class46.anInt758];
  2539. if(background != null) {
  2540. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  2541. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  2542. background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  2543. }
  2544. }
  2545. }
  2546. }
  2547.  
  2548. private void loadTitleScreen() {
  2549. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  2550. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  2551. aBackgroundArray1152s = new Background[12];
  2552. int j = 0;
  2553. try {
  2554. j = Integer.parseInt(getParameter("fl_icon"));
  2555. } catch(Exception _ex) {
  2556. }
  2557. if(j == 0) {
  2558. for(int k = 0; k < 12; k++)
  2559. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  2560.  
  2561. } else {
  2562. for(int l = 0; l < 12; l++)
  2563. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  2564.  
  2565. }
  2566. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  2567. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  2568. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  2569.  
  2570. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  2571.  
  2572. anIntArray851 = new int[256];
  2573. for(int k1 = 0; k1 < 64; k1++)
  2574. anIntArray851[k1] = k1 * 0x40000;
  2575.  
  2576. for(int l1 = 0; l1 < 64; l1++)
  2577. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  2578.  
  2579. for(int i2 = 0; i2 < 64; i2++)
  2580. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  2581.  
  2582. for(int j2 = 0; j2 < 64; j2++)
  2583. anIntArray851[j2 + 192] = 0xffffff;
  2584.  
  2585. anIntArray852 = new int[256];
  2586. for(int k2 = 0; k2 < 64; k2++)
  2587. anIntArray852[k2] = k2 * 1024;
  2588.  
  2589. for(int l2 = 0; l2 < 64; l2++)
  2590. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  2591.  
  2592. for(int i3 = 0; i3 < 64; i3++)
  2593. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  2594.  
  2595. for(int j3 = 0; j3 < 64; j3++)
  2596. anIntArray852[j3 + 192] = 0xffffff;
  2597.  
  2598. anIntArray853 = new int[256];
  2599. for(int k3 = 0; k3 < 64; k3++)
  2600. anIntArray853[k3] = k3 * 4;
  2601.  
  2602. for(int l3 = 0; l3 < 64; l3++)
  2603. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  2604.  
  2605. for(int i4 = 0; i4 < 64; i4++)
  2606. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  2607.  
  2608. for(int j4 = 0; j4 < 64; j4++)
  2609. anIntArray853[j4 + 192] = 0xffffff;
  2610.  
  2611. anIntArray850 = new int[256];
  2612. anIntArray1190 = new int[32768];
  2613. anIntArray1191 = new int[32768];
  2614. randomizeBackground(null);
  2615. anIntArray828 = new int[32768];
  2616. anIntArray829 = new int[32768];
  2617. drawLoadingText(10, "Connecting to fileserver");
  2618. if(!aBoolean831) {
  2619. drawFlames = true;
  2620. aBoolean831 = true;
  2621. startRunnable(this, 2);
  2622. }
  2623. }
  2624.  
  2625. private static void setHighMem() {
  2626. WorldController.lowMem = false;
  2627. Texture.lowMem = false;
  2628. lowMem = false;
  2629. ObjectManager.lowMem = false;
  2630. ObjectDef.lowMem = false;
  2631. }
  2632.  
  2633. public static void main(String args[]) {
  2634. try {
  2635. System.out.println("RS2 user client - release #" + 317);
  2636. if(args.length != 5) {
  2637. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2638. return;
  2639. }
  2640. nodeID = Integer.parseInt(args[0]);
  2641. //portOff = Integer.parseInt(args[1]);
  2642. portOff = 0;
  2643. if(args[2].equals("lowmem"))
  2644. setLowMem();
  2645. else if(args[2].equals("highmem")) {
  2646. setHighMem();
  2647. } else {
  2648. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2649. return;
  2650. }
  2651. if(args[3].equals("free"))
  2652. isMembers = false;
  2653. else if(args[3].equals("members")) {
  2654. isMembers = true;
  2655. } else {
  2656. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2657. return;
  2658. }
  2659. signlink.storeid = Integer.parseInt(args[4]);
  2660. signlink.startpriv(InetAddress.getLocalHost());
  2661. new Jframe(args);
  2662. //client client1 = new client();
  2663. //client1.createClientFrame(503, 765);
  2664. } catch(Exception exception) {
  2665. }
  2666. }
  2667.  
  2668. private void loadingStages() {
  2669. if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  2670. aRSImageProducer_1165.initDrawingArea();
  2671. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  2672. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  2673. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  2674. loadingStage = 1;
  2675. aLong824 = System.currentTimeMillis();
  2676. }
  2677. if(loadingStage == 1) {
  2678. int j = method54();
  2679. if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  2680. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  2681. aLong824 = System.currentTimeMillis();
  2682. }
  2683. }
  2684. if(loadingStage == 2 && plane != anInt985) {
  2685. anInt985 = plane;
  2686. method24(plane);
  2687. }
  2688. }
  2689.  
  2690. private int method54() {
  2691. for(int i = 0; i < aByteArrayArray1183.length; i++) {
  2692. if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  2693. return -1;
  2694. if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  2695. return -2;
  2696. }
  2697. boolean flag = true;
  2698. for(int j = 0; j < aByteArrayArray1183.length; j++) {
  2699. byte abyte0[] = aByteArrayArray1247[j];
  2700. if(abyte0 != null) {
  2701. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  2702. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  2703. if(aBoolean1159) {
  2704. k = 10;
  2705. l = 10;
  2706. }
  2707. flag &= ObjectManager.method189(k, abyte0, l);
  2708. }
  2709. }
  2710. if(!flag)
  2711. return -3;
  2712. if(aBoolean1080) {
  2713. return -4;
  2714. } else {
  2715. loadingStage = 2;
  2716. ObjectManager.anInt131 = plane;
  2717. method22();
  2718. stream.createFrame(121);
  2719. return 0;
  2720. }
  2721. }
  2722.  
  2723. private void method55()
  2724. {
  2725. for(Animable_Sub4 class30_sub2_sub4_sub4 = (Animable_Sub4)aClass19_1013.reverseGetFirst(); class30_sub2_sub4_sub4 != null; class30_sub2_sub4_sub4 = (Animable_Sub4)aClass19_1013.reverseGetNext())
  2726. if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  2727. class30_sub2_sub4_sub4.unlink();
  2728. else
  2729. if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  2730. {
  2731. if(class30_sub2_sub4_sub4.anInt1590 > 0)
  2732. {
  2733. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  2734. if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  2735. class30_sub2_sub4_sub4.method455(loopCycle, npc.y, method42(class30_sub2_sub4_sub4.anInt1597, npc.y, npc.x) - class30_sub2_sub4_sub4.anInt1583, npc.x);
  2736. }
  2737. if(class30_sub2_sub4_sub4.anInt1590 < 0)
  2738. {
  2739. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  2740. Player player;
  2741. if(j == unknownInt10)
  2742. player = myPlayer;
  2743. else
  2744. player = playerArray[j];
  2745. if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  2746. class30_sub2_sub4_sub4.method455(loopCycle, player.y, method42(class30_sub2_sub4_sub4.anInt1597, player.y, player.x) - class30_sub2_sub4_sub4.anInt1583, player.x);
  2747. }
  2748. class30_sub2_sub4_sub4.method456(anInt945);
  2749. worldController.method285(plane, class30_sub2_sub4_sub4.anInt1595, (int)class30_sub2_sub4_sub4.aDouble1587, -1, (int)class30_sub2_sub4_sub4.aDouble1586, 60, (int)class30_sub2_sub4_sub4.aDouble1585, class30_sub2_sub4_sub4, false);
  2750. }
  2751.  
  2752. }
  2753.  
  2754. public AppletContext getAppletContext()
  2755. {
  2756. if(signlink.mainapp != null)
  2757. return signlink.mainapp.getAppletContext();
  2758. else
  2759. return super.getAppletContext();
  2760. }
  2761.  
  2762. private void drawLogo() {
  2763. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  2764. Sprite sprite = new Sprite(abyte0, this);
  2765. aRSImageProducer_1110.initDrawingArea();
  2766. sprite.method346(0, 0);
  2767. aRSImageProducer_1111.initDrawingArea();
  2768. sprite.method346(-637, 0);
  2769. aRSImageProducer_1107.initDrawingArea();
  2770. sprite.method346(-128, 0);
  2771. aRSImageProducer_1108.initDrawingArea();
  2772. sprite.method346(-202, -371);
  2773. aRSImageProducer_1109.initDrawingArea();
  2774. sprite.method346(-202, -171);
  2775. aRSImageProducer_1112.initDrawingArea();
  2776. sprite.method346(0, -265);
  2777. aRSImageProducer_1113.initDrawingArea();
  2778. sprite.method346(-562, -265);
  2779. aRSImageProducer_1114.initDrawingArea();
  2780. sprite.method346(-128, -171);
  2781. aRSImageProducer_1115.initDrawingArea();
  2782. sprite.method346(-562, -171);
  2783. int ai[] = new int[sprite.myWidth];
  2784. for(int j = 0; j < sprite.myHeight; j++) {
  2785. for(int k = 0; k < sprite.myWidth; k++)
  2786. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  2787.  
  2788. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  2789. }
  2790. aRSImageProducer_1110.initDrawingArea();
  2791. sprite.method346(382, 0);
  2792. aRSImageProducer_1111.initDrawingArea();
  2793. sprite.method346(-255, 0);
  2794. aRSImageProducer_1107.initDrawingArea();
  2795. sprite.method346(254, 0);
  2796. aRSImageProducer_1108.initDrawingArea();
  2797. sprite.method346(180, -371);
  2798. aRSImageProducer_1109.initDrawingArea();
  2799. sprite.method346(180, -171);
  2800. aRSImageProducer_1112.initDrawingArea();
  2801. sprite.method346(382, -265);
  2802. aRSImageProducer_1113.initDrawingArea();
  2803. sprite.method346(-180, -265);
  2804. aRSImageProducer_1114.initDrawingArea();
  2805. sprite.method346(254, -171);
  2806. aRSImageProducer_1115.initDrawingArea();
  2807. sprite.method346(-180, -171);
  2808. sprite = new Sprite(titleStreamLoader, "logo", 0);
  2809. aRSImageProducer_1107.initDrawingArea();
  2810. sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  2811. sprite = null;
  2812. Object obj = null;
  2813. Object obj1 = null;
  2814. System.gc();
  2815. }
  2816.  
  2817. private void processOnDemandQueue()
  2818. {
  2819. do
  2820. {
  2821. OnDemandData onDemandData;
  2822. do
  2823. {
  2824. onDemandData = onDemandFetcher.getNextNode();
  2825. if(onDemandData == null)
  2826. return;
  2827. if(onDemandData.dataType == 0)
  2828. {
  2829. Model.method460(onDemandData.buffer, onDemandData.ID);
  2830. if((onDemandFetcher.getModelIndex(onDemandData.ID) & 0x62) != 0)
  2831. {
  2832. needDrawTabArea = true;
  2833. if(backDialogID != -1)
  2834. inputTaken = true;
  2835. }
  2836. }
  2837.  
  2838. Class36.method529(onDemandData.buffer);
  2839. if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  2840. saveMidi(songChanging, onDemandData.buffer);
  2841. if(onDemandData.dataType == 3 && loadingStage == 1)
  2842. {
  2843. for(int i = 0; i < aByteArrayArray1183.length; i++)
  2844. {
  2845. if(anIntArray1235[i] == onDemandData.ID)
  2846. {
  2847. aByteArrayArray1183[i] = onDemandData.buffer;
  2848. if(onDemandData.buffer == null)
  2849. anIntArray1235[i] = -1;
  2850. break;
  2851. }
  2852. if(anIntArray1236[i] != onDemandData.ID)
  2853. continue;
  2854. aByteArrayArray1247[i] = onDemandData.buffer;
  2855. if(onDemandData.buffer == null)
  2856. anIntArray1236[i] = -1;
  2857. break;
  2858. }
  2859.  
  2860. }
  2861. } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  2862. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  2863. } while(true);
  2864. }
  2865.  
  2866. private void calcFlamesPosition()
  2867. {
  2868. char c = '\u0100';
  2869. for(int j = 10; j < 117; j++)
  2870. {
  2871. int k = (int)(Math.random() * 100D);
  2872. if(k < 50)
  2873. anIntArray828[j + (c - 2 << 7)] = 255;
  2874. }
  2875. for(int l = 0; l < 100; l++)
  2876. {
  2877. int i1 = (int)(Math.random() * 124D) + 2;
  2878. int k1 = (int)(Math.random() * 128D) + 128;
  2879. int k2 = i1 + (k1 << 7);
  2880. anIntArray828[k2] = 192;
  2881. }
  2882.  
  2883. for(int j1 = 1; j1 < c - 1; j1++)
  2884. {
  2885. for(int l1 = 1; l1 < 127; l1++)
  2886. {
  2887. int l2 = l1 + (j1 << 7);
  2888. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  2889. }
  2890.  
  2891. }
  2892.  
  2893. anInt1275 += 128;
  2894. if(anInt1275 > anIntArray1190.length)
  2895. {
  2896. anInt1275 -= anIntArray1190.length;
  2897. int i2 = (int)(Math.random() * 12D);
  2898. randomizeBackground(aBackgroundArray1152s[i2]);
  2899. }
  2900. for(int j2 = 1; j2 < c - 1; j2++)
  2901. {
  2902. for(int i3 = 1; i3 < 127; i3++)
  2903. {
  2904. int k3 = i3 + (j2 << 7);
  2905. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  2906. if(i4 < 0)
  2907. i4 = 0;
  2908. anIntArray828[k3] = i4;
  2909. }
  2910.  
  2911. }
  2912.  
  2913. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  2914.  
  2915. anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
  2916. if(anInt1040 > 0)
  2917. anInt1040 -= 4;
  2918. if(anInt1041 > 0)
  2919. anInt1041 -= 4;
  2920. if(anInt1040 == 0 && anInt1041 == 0)
  2921. {
  2922. int l3 = (int)(Math.random() * 2000D);
  2923. if(l3 == 0)
  2924. anInt1040 = 1024;
  2925. if(l3 == 1)
  2926. anInt1041 = 1024;
  2927. }
  2928. }
  2929.  
  2930. private boolean saveWave(byte abyte0[], int i)
  2931. {
  2932. return abyte0 == null || signlink.wavesave(abyte0, i);
  2933. }
  2934.  
  2935. private void method60(int i)
  2936. {
  2937. RSInterface class9 = RSInterface.interfaceCache[i];
  2938. for(int j = 0; j < class9.children.length; j++)
  2939. {
  2940. if(class9.children[j] == -1)
  2941. break;
  2942. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  2943. if(class9_1.type == 1)
  2944. method60(class9_1.id);
  2945. class9_1.anInt246 = 0;
  2946. class9_1.anInt208 = 0;
  2947. }
  2948. }
  2949.  
  2950. private void drawHeadIcon()
  2951. {
  2952. if(anInt855 != 2)
  2953. return;
  2954. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  2955. if(spriteDrawX > -1 && loopCycle % 20 < 10)
  2956. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  2957. }
  2958.  
  2959. private void mainGameProcessor()
  2960. {
  2961. if(anInt1104 > 1)
  2962. anInt1104--;
  2963. if(anInt1011 > 0)
  2964. anInt1011--;
  2965. for(int j = 0; j < 5; j++)
  2966. if(!parsePacket())
  2967. break;
  2968.  
  2969. if(!loggedIn)
  2970. return;
  2971. synchronized(mouseDetection.syncObject)
  2972. {
  2973. if(flagged)
  2974. {
  2975. if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
  2976. {
  2977. stream.createFrame(45);
  2978. stream.writeWordBigEndian(0);
  2979. int j2 = stream.currentOffset;
  2980. int j3 = 0;
  2981. for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
  2982. {
  2983. if(j2 - stream.currentOffset >= 240)
  2984. break;
  2985. j3++;
  2986. int l4 = mouseDetection.coordsY[j4];
  2987. if(l4 < 0)
  2988. l4 = 0;
  2989. else
  2990. if(l4 > 502)
  2991. l4 = 502;
  2992. int k5 = mouseDetection.coordsX[j4];
  2993. if(k5 < 0)
  2994. k5 = 0;
  2995. else
  2996. if(k5 > 764)
  2997. k5 = 764;
  2998. int i6 = l4 * 765 + k5;
  2999. if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  3000. {
  3001. k5 = -1;
  3002. l4 = -1;
  3003. i6 = 0x7ffff;
  3004. }
  3005. if(k5 == anInt1237 && l4 == anInt1238)
  3006. {
  3007. if(anInt1022 < 2047)
  3008. anInt1022++;
  3009. } else
  3010. {
  3011. int j6 = k5 - anInt1237;
  3012. anInt1237 = k5;
  3013. int k6 = l4 - anInt1238;
  3014. anInt1238 = l4;
  3015. if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  3016. {
  3017. j6 += 32;
  3018. k6 += 32;
  3019. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  3020. anInt1022 = 0;
  3021. } else
  3022. if(anInt1022 < 8)
  3023. {
  3024. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  3025. anInt1022 = 0;
  3026. } else
  3027. {
  3028. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  3029. anInt1022 = 0;
  3030. }
  3031. }
  3032. }
  3033.  
  3034. stream.writeBytes(stream.currentOffset - j2);
  3035. if(j3 >= mouseDetection.coordsIndex)
  3036. {
  3037. mouseDetection.coordsIndex = 0;
  3038. } else
  3039. {
  3040. mouseDetection.coordsIndex -= j3;
  3041. for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  3042. {
  3043. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  3044. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  3045. }
  3046.  
  3047. }
  3048. }
  3049. } else
  3050. {
  3051. mouseDetection.coordsIndex = 0;
  3052. }
  3053. }
  3054. if(super.clickMode3 != 0)
  3055. {
  3056. long l = (super.aLong29 - aLong1220) / 50L;
  3057. if(l > 4095L)
  3058. l = 4095L;
  3059. aLong1220 = super.aLong29;
  3060. int k2 = super.saveClickY;
  3061. if(k2 < 0)
  3062. k2 = 0;
  3063. else
  3064. if(k2 > 502)
  3065. k2 = 502;
  3066. int k3 = super.saveClickX;
  3067. if(k3 < 0)
  3068. k3 = 0;
  3069. else
  3070. if(k3 > 764)
  3071. k3 = 764;
  3072. int k4 = k2 * 765 + k3;
  3073. int j5 = 0;
  3074. if(super.clickMode3 == 2)
  3075. j5 = 1;
  3076. int l5 = (int)l;
  3077. stream.createFrame(241);
  3078. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3079. }
  3080. if(anInt1016 > 0)
  3081. anInt1016--;
  3082. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3083. aBoolean1017 = true;
  3084. if(aBoolean1017 && anInt1016 <= 0)
  3085. {
  3086. anInt1016 = 20;
  3087. aBoolean1017 = false;
  3088. stream.createFrame(86);
  3089. stream.writeWord(anInt1184);
  3090. stream.method432(minimapInt1);
  3091. }
  3092. if(super.awtFocus && !aBoolean954)
  3093. {
  3094. aBoolean954 = true;
  3095. stream.createFrame(3);
  3096. stream.writeWordBigEndian(1);
  3097. }
  3098. if(!super.awtFocus && aBoolean954)
  3099. {
  3100. aBoolean954 = false;
  3101. stream.createFrame(3);
  3102. stream.writeWordBigEndian(0);
  3103. }
  3104. loadingStages();
  3105. method115();
  3106. method90();
  3107. anInt1009++;
  3108. if(anInt1009 > 750)
  3109. dropClient();
  3110. method114();
  3111. method95();
  3112. method38();
  3113. anInt945++;
  3114. if(crossType != 0)
  3115. {
  3116. crossIndex += 20;
  3117. if(crossIndex >= 400)
  3118. crossType = 0;
  3119. }
  3120. if(atInventoryInterfaceType != 0)
  3121. {
  3122. atInventoryLoopCycle++;
  3123. if(atInventoryLoopCycle >= 15)
  3124. {
  3125. if(atInventoryInterfaceType == 2)
  3126. needDrawTabArea = true;
  3127. if(atInventoryInterfaceType == 3)
  3128. inputTaken = true;
  3129. atInventoryInterfaceType = 0;
  3130. }
  3131. }
  3132. if(activeInterfaceType != 0)
  3133. {
  3134. anInt989++;
  3135. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  3136. aBoolean1242 = true;
  3137. if(super.clickMode2 == 0)
  3138. {
  3139. if(activeInterfaceType == 2)
  3140. needDrawTabArea = true;
  3141. if(activeInterfaceType == 3)
  3142. inputTaken = true;
  3143. activeInterfaceType = 0;
  3144. if(aBoolean1242 && anInt989 >= 5)
  3145. {
  3146. lastActiveInvInterface = -1;
  3147. processRightClick();
  3148. if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  3149. {
  3150. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3151. int j1 = 0;
  3152. if(anInt913 == 1 && class9.contentType == 206)
  3153. j1 = 1;
  3154. if(class9.inv[mouseInvInterfaceIndex] <= 0)
  3155. j1 = 0;
  3156. if(class9.aBoolean235)
  3157. {
  3158. int l2 = anInt1085;
  3159. int l3 = mouseInvInterfaceIndex;
  3160. class9.inv[l3] = class9.inv[l2];
  3161. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3162. class9.inv[l2] = -1;
  3163. class9.invStackSizes[l2] = 0;
  3164. } else
  3165. if(j1 == 1)
  3166. {
  3167. int i3 = anInt1085;
  3168. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3169. if(i3 > i4)
  3170. {
  3171. class9.swapInventoryItems(i3, i3 - 1);
  3172. i3--;
  3173. } else
  3174. if(i3 < i4)
  3175. {
  3176. class9.swapInventoryItems(i3, i3 + 1);
  3177. i3++;
  3178. }
  3179.  
  3180. } else
  3181. {
  3182. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  3183. }
  3184. stream.createFrame(214);
  3185. stream.method433(anInt1084);
  3186. stream.method424(j1);
  3187. stream.method433(anInt1085);
  3188. stream.method431(mouseInvInterfaceIndex);
  3189. }
  3190. } else
  3191. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  3192. determineMenuSize();
  3193. else
  3194. if(menuActionRow > 0)
  3195. doAction(menuActionRow - 1);
  3196. atInventoryLoopCycle = 10;
  3197. super.clickMode3 = 0;
  3198. }
  3199. }
  3200. if(WorldController.anInt470 != -1)
  3201. {
  3202. int k = WorldController.anInt470;
  3203. int k1 = WorldController.anInt471;
  3204. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  3205. WorldController.anInt470 = -1;
  3206. if(flag)
  3207. {
  3208. crossX = super.saveClickX;
  3209. crossY = super.saveClickY;
  3210. crossType = 1;
  3211. crossIndex = 0;
  3212. }
  3213. }
  3214. if(super.clickMode3 == 1 && aString844 != null)
  3215. {
  3216. aString844 = null;
  3217. inputTaken = true;
  3218. super.clickMode3 = 0;
  3219. }
  3220. processMenuClick();
  3221. processMainScreenClick();
  3222. processTabClick();
  3223. processChatModeClick();
  3224. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  3225. anInt1213++;
  3226. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3227. if (anInt1501 < 100) {
  3228. anInt1501++;
  3229. if (anInt1501 == 100) {
  3230. if (anInt1500 != 0) {
  3231. inputTaken = true;
  3232. }
  3233. if (anInt1044 != 0) {
  3234. needDrawTabArea = true;
  3235. }
  3236. }
  3237. }
  3238. } else if (anInt1501 > 0) {
  3239. anInt1501--;
  3240. }
  3241. if(loadingStage == 2)
  3242. method108();
  3243. if(loadingStage == 2 && aBoolean1160)
  3244. calcCameraPos();
  3245. for(int i1 = 0; i1 < 5; i1++)
  3246. anIntArray1030[i1]++;
  3247.  
  3248. method73();
  3249. super.idleTime++;
  3250. if(super.idleTime > 4500)
  3251. {
  3252. anInt1011 = 250;
  3253. super.idleTime -= 500;
  3254. stream.createFrame(202);
  3255. }
  3256. anInt988++;
  3257. if(anInt988 > 500)
  3258. {
  3259. anInt988 = 0;
  3260. int l1 = (int)(Math.random() * 8D);
  3261. if((l1 & 1) == 1)
  3262. anInt1278 += anInt1279;
  3263. if((l1 & 2) == 2)
  3264. anInt1131 += anInt1132;
  3265. if((l1 & 4) == 4)
  3266. anInt896 += anInt897;
  3267. }
  3268. if(anInt1278 < -50)
  3269. anInt1279 = 2;
  3270. if(anInt1278 > 50)
  3271. anInt1279 = -2;
  3272. if(anInt1131 < -55)
  3273. anInt1132 = 2;
  3274. if(anInt1131 > 55)
  3275. anInt1132 = -2;
  3276. if(anInt896 < -40)
  3277. anInt897 = 1;
  3278. if(anInt896 > 40)
  3279. anInt897 = -1;
  3280. anInt1254++;
  3281. if(anInt1254 > 500)
  3282. {
  3283. anInt1254 = 0;
  3284. int i2 = (int)(Math.random() * 8D);
  3285. if((i2 & 1) == 1)
  3286. minimapInt2 += anInt1210;
  3287. if((i2 & 2) == 2)
  3288. minimapInt3 += anInt1171;
  3289. }
  3290. if(minimapInt2 < -60)
  3291. anInt1210 = 2;
  3292. if(minimapInt2 > 60)
  3293. anInt1210 = -2;
  3294. if(minimapInt3 < -20)
  3295. anInt1171 = 1;
  3296. if(minimapInt3 > 10)
  3297. anInt1171 = -1;
  3298. anInt1010++;
  3299. if(anInt1010 > 50)
  3300. stream.createFrame(0);
  3301. try
  3302. {
  3303. if(socketStream != null && stream.currentOffset > 0)
  3304. {
  3305. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3306. stream.currentOffset = 0;
  3307. anInt1010 = 0;
  3308. }
  3309. }
  3310. catch(IOException _ex)
  3311. {
  3312. dropClient();
  3313. }
  3314. catch(Exception exception)
  3315. {
  3316. resetLogout();
  3317. }
  3318. }
  3319.  
  3320. private void method63()
  3321. {
  3322. Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  3323. for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  3324. if(class30_sub1.anInt1294 == -1)
  3325. {
  3326. class30_sub1.anInt1302 = 0;
  3327. method89(class30_sub1);
  3328. } else
  3329. {
  3330. class30_sub1.unlink();
  3331. }
  3332.  
  3333. }
  3334.  
  3335. private void resetImageProducers()
  3336. {
  3337. if(aRSImageProducer_1107 != null)
  3338. return;
  3339. super.fullGameScreen = null;
  3340. aRSImageProducer_1166 = null;
  3341. aRSImageProducer_1164 = null;
  3342. aRSImageProducer_1163 = null;
  3343. aRSImageProducer_1165 = null;
  3344. aRSImageProducer_1123 = null;
  3345. aRSImageProducer_1124 = null;
  3346. aRSImageProducer_1125 = null;
  3347. aRSImageProducer_1110 = new RSImageProducer(128, 265, getGameComponent());
  3348. DrawingArea.setAllPixelsToZero();
  3349. aRSImageProducer_1111 = new RSImageProducer(128, 265, getGameComponent());
  3350. DrawingArea.setAllPixelsToZero();
  3351. aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
  3352. DrawingArea.setAllPixelsToZero();
  3353. aRSImageProducer_1108 = new RSImageProducer(360, 132, getGameComponent());
  3354. DrawingArea.setAllPixelsToZero();
  3355. aRSImageProducer_1109 = new RSImageProducer(360, 200, getGameComponent());
  3356. DrawingArea.setAllPixelsToZero();
  3357. aRSImageProducer_1112 = new RSImageProducer(202, 238, getGameComponent());
  3358. DrawingArea.setAllPixelsToZero();
  3359. aRSImageProducer_1113 = new RSImageProducer(203, 238, getGameComponent());
  3360. DrawingArea.setAllPixelsToZero();
  3361. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  3362. DrawingArea.setAllPixelsToZero();
  3363. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  3364. DrawingArea.setAllPixelsToZero();
  3365. if(titleStreamLoader != null)
  3366. {
  3367. drawLogo();
  3368. loadTitleScreen();
  3369. }
  3370. welcomeScreenRaised = true;
  3371. }
  3372.  
  3373. void drawLoadingText(int i, String s)
  3374. {
  3375. anInt1079 = i;
  3376. aString1049 = s;
  3377. resetImageProducers();
  3378. if(titleStreamLoader == null)
  3379. {
  3380. super.drawLoadingText(i, s);
  3381. return;
  3382. }
  3383. aRSImageProducer_1109.initDrawingArea();
  3384. char c = '\u0168';
  3385. char c1 = '\310';
  3386. byte byte1 = 20;
  3387. chatTextDrawingArea.drawText(0xffffff, "Project Insanity is loading - please wait...", c1 / 2 - 26 - byte1, c / 2);
  3388. int j = c1 / 2 - 18 - byte1;
  3389. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  3390. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3391. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  3392. DrawingArea.drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3393. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3394. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3395. if(welcomeScreenRaised)
  3396. {
  3397. welcomeScreenRaised = false;
  3398. if(!aBoolean831)
  3399. {
  3400. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3401. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3402. }
  3403. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3404. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3405. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3406. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3407. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3408. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3409. }
  3410. }
  3411.  
  3412. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag,
  3413. int j1)
  3414. {
  3415. int anInt992;
  3416. if(aBoolean972)
  3417. anInt992 = 32;
  3418. else
  3419. anInt992 = 0;
  3420. aBoolean972 = false;
  3421. if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  3422. {
  3423. class9.scrollPosition -= anInt1213 * 4;
  3424. if(flag)
  3425. {
  3426. needDrawTabArea = true;
  3427. }
  3428. } else
  3429. if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  3430. {
  3431. class9.scrollPosition += anInt1213 * 4;
  3432. if(flag)
  3433. {
  3434. needDrawTabArea = true;
  3435. }
  3436. } else
  3437. if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  3438. {
  3439. int l1 = ((j - 32) * j) / j1;
  3440. if(l1 < 8)
  3441. l1 = 8;
  3442. int i2 = l - i1 - 16 - l1 / 2;
  3443. int j2 = j - 32 - l1;
  3444. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3445. if(flag)
  3446. needDrawTabArea = true;
  3447. aBoolean972 = true;
  3448. }
  3449. }
  3450.  
  3451. private boolean method66(int i, int j, int k)
  3452. {
  3453. int i1 = i >> 14 & 0x7fff;
  3454. int j1 = worldController.method304(plane, k, j, i);
  3455. if(j1 == -1)
  3456. return false;
  3457. int k1 = j1 & 0x1f;
  3458. int l1 = j1 >> 6 & 3;
  3459. if(k1 == 10 || k1 == 11 || k1 == 22)
  3460. {
  3461. ObjectDef class46 = ObjectDef.forID(i1);
  3462. int i2;
  3463. int j2;
  3464. if(l1 == 0 || l1 == 2)
  3465. {
  3466. i2 = class46.anInt744;
  3467. j2 = class46.anInt761;
  3468. } else
  3469. {
  3470. i2 = class46.anInt761;
  3471. j2 = class46.anInt744;
  3472. }
  3473. int k2 = class46.anInt768;
  3474. if(l1 != 0)
  3475. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3476. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3477. } else
  3478. {
  3479. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3480. }
  3481. crossX = super.saveClickX;
  3482. crossY = super.saveClickY;
  3483. crossType = 2;
  3484. crossIndex = 0;
  3485. return true;
  3486. }
  3487.  
  3488. private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k)
  3489. {
  3490. byte abyte0[] = null;
  3491. int l = 5;
  3492. try
  3493. {
  3494. if(decompressors[0] != null)
  3495. abyte0 = decompressors[0].decompress(i);
  3496. }
  3497. catch(Exception _ex) { }
  3498. if(abyte0 != null)
  3499. {
  3500. // aCRC32_930.reset();
  3501. // aCRC32_930.update(abyte0);
  3502. // int i1 = (int)aCRC32_930.getValue();
  3503. // if(i1 != j)
  3504. }
  3505. if(abyte0 != null)
  3506. {
  3507. StreamLoader streamLoader = new StreamLoader(abyte0);
  3508. return streamLoader;
  3509. }
  3510. int j1 = 0;
  3511. while(abyte0 == null)
  3512. {
  3513. String s2 = "Unknown error";
  3514. drawLoadingText(k, "Requesting " + s);
  3515. Object obj = null;
  3516. try
  3517. {
  3518. int k1 = 0;
  3519. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3520. byte abyte1[] = new byte[6];
  3521. datainputstream.readFully(abyte1, 0, 6);
  3522. Stream stream = new Stream(abyte1);
  3523. stream.currentOffset = 3;
  3524. int i2 = stream.read3Bytes() + 6;
  3525. int j2 = 6;
  3526. abyte0 = new byte[i2];
  3527. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3528.  
  3529. while(j2 < i2)
  3530. {
  3531. int l2 = i2 - j2;
  3532. if(l2 > 1000)
  3533. l2 = 1000;
  3534. int j3 = datainputstream.read(abyte0, j2, l2);
  3535. if(j3 < 0)
  3536. {
  3537. s2 = "Length error: " + j2 + "/" + i2;
  3538. throw new IOException("EOF");
  3539. }
  3540. j2 += j3;
  3541. int k3 = (j2 * 100) / i2;
  3542. if(k3 != k1)
  3543. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3544. k1 = k3;
  3545. }
  3546. datainputstream.close();
  3547. try
  3548. {
  3549. if(decompressors[0] != null)
  3550. decompressors[0].method234(abyte0.length, abyte0, i);
  3551. }
  3552. catch(Exception _ex)
  3553. {
  3554. decompressors[0] = null;
  3555. }
  3556. /* if(abyte0 != null)
  3557. {
  3558. aCRC32_930.reset();
  3559. aCRC32_930.update(abyte0);
  3560. int i3 = (int)aCRC32_930.getValue();
  3561. if(i3 != j)
  3562. {
  3563. abyte0 = null;
  3564. j1++;
  3565. s2 = "Checksum error: " + i3;
  3566. }
  3567. }
  3568. */
  3569. }
  3570. catch(IOException ioexception)
  3571. {
  3572. if(s2.equals("Unknown error"))
  3573. s2 = "Connection error";
  3574. abyte0 = null;
  3575. }
  3576. catch(NullPointerException _ex)
  3577. {
  3578. s2 = "Null error";
  3579. abyte0 = null;
  3580. if(!signlink.reporterror)
  3581. return null;
  3582. }
  3583. catch(ArrayIndexOutOfBoundsException _ex)
  3584. {
  3585. s2 = "Bounds error";
  3586. abyte0 = null;
  3587. if(!signlink.reporterror)
  3588. return null;
  3589. }
  3590. catch(Exception _ex)
  3591. {
  3592. s2 = "Unexpected error";
  3593. abyte0 = null;
  3594. if(!signlink.reporterror)
  3595. return null;
  3596. }
  3597. if(abyte0 == null)
  3598. {
  3599. for(int l1 = l; l1 > 0; l1--)
  3600. {
  3601. if(j1 >= 3)
  3602. {
  3603. drawLoadingText(k, "Game updated - please reload page");
  3604. l1 = 10;
  3605. } else
  3606. {
  3607. drawLoadingText(k, s2 + " - Retrying in " + l1);
  3608. }
  3609. try
  3610. {
  3611. Thread.sleep(1000L);
  3612. }
  3613. catch(Exception _ex) { }
  3614. }
  3615.  
  3616. l *= 2;
  3617. if(l > 60)
  3618. l = 60;
  3619. aBoolean872 = !aBoolean872;
  3620. }
  3621.  
  3622. }
  3623.  
  3624. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  3625. return streamLoader_1;
  3626. }
  3627.  
  3628. private void dropClient()
  3629. {
  3630. if(anInt1011 > 0)
  3631. {
  3632. resetLogout();
  3633. return;
  3634. }
  3635. aRSImageProducer_1165.initDrawingArea();
  3636. aTextDrawingArea_1271.drawText(0, "Connection lost", 144, 257);
  3637. aTextDrawingArea_1271.drawText(0xffffff, "Connection lost", 143, 256);
  3638. aTextDrawingArea_1271.drawText(0, "Please wait - attempting to reestablish", 159, 257);
  3639. aTextDrawingArea_1271.drawText(0xffffff, "Please wait - attempting to reestablish", 158, 256);
  3640. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3641. anInt1021 = 0;
  3642. destX = 0;
  3643. RSSocket rsSocket = socketStream;
  3644. loggedIn = false;
  3645. loginFailures = 0;
  3646. login(myUsername, myPassword, true);
  3647. if(!loggedIn)
  3648. resetLogout();
  3649. try
  3650. {
  3651. rsSocket.close();
  3652. }
  3653. catch(Exception _ex)
  3654. {
  3655. }
  3656. }
  3657.  
  3658. private void doAction(int i)
  3659. {
  3660. if(i < 0)
  3661. return;
  3662. if(inputDialogState != 0)
  3663. {
  3664. inputDialogState = 0;
  3665. inputTaken = true;
  3666. }
  3667. int j = menuActionCmd2[i];
  3668. int k = menuActionCmd3[i];
  3669. int l = menuActionID[i];
  3670. int i1 = menuActionCmd1[i];
  3671. if(l >= 2000)
  3672. l -= 2000;
  3673. if(l == 582)
  3674. {
  3675. NPC npc = npcArray[i1];
  3676. if(npc != null)
  3677. {
  3678. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  3679. crossX = super.saveClickX;
  3680. crossY = super.saveClickY;
  3681. crossType = 2;
  3682. crossIndex = 0;
  3683. stream.createFrame(57);
  3684. stream.method432(anInt1285);
  3685. stream.method432(i1);
  3686. stream.method431(anInt1283);
  3687. stream.method432(anInt1284);
  3688. }
  3689. }
  3690. if(l == 234)
  3691. {
  3692. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3693. if(!flag1)
  3694. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3695. crossX = super.saveClickX;
  3696. crossY = super.saveClickY;
  3697. crossType = 2;
  3698. crossIndex = 0;
  3699. stream.createFrame(236);
  3700. stream.method431(k + baseY);
  3701. stream.writeWord(i1);
  3702. stream.method431(j + baseX);
  3703. }
  3704. if(l == 62 && method66(i1, k, j))
  3705. {
  3706. stream.createFrame(192);
  3707. stream.writeWord(anInt1284);
  3708. stream.method431(i1 >> 14 & 0x7fff);
  3709. stream.method433(k + baseY);
  3710. stream.method431(anInt1283);
  3711. stream.method433(j + baseX);
  3712. stream.writeWord(anInt1285);
  3713. }
  3714. if(l == 511)
  3715. {
  3716. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3717. if(!flag2)
  3718. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3719. crossX = super.saveClickX;
  3720. crossY = super.saveClickY;
  3721. crossType = 2;
  3722. crossIndex = 0;
  3723. stream.createFrame(25);
  3724. stream.method431(anInt1284);
  3725. stream.method432(anInt1285);
  3726. stream.writeWord(i1);
  3727. stream.method432(k + baseY);
  3728. stream.method433(anInt1283);
  3729. stream.writeWord(j + baseX);
  3730. }
  3731. if(l == 74)
  3732. {
  3733. stream.createFrame(122);
  3734. stream.method433(k);
  3735. stream.method432(j);
  3736. stream.method431(i1);
  3737. atInventoryLoopCycle = 0;
  3738. atInventoryInterface = k;
  3739. atInventoryIndex = j;
  3740. atInventoryInterfaceType = 2;
  3741. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3742. atInventoryInterfaceType = 1;
  3743. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3744. atInventoryInterfaceType = 3;
  3745. }
  3746. if (l == 315) {
  3747. RSInterface class9 = RSInterface.interfaceCache[k];
  3748. boolean flag8 = true;
  3749. if (class9.contentType > 0)
  3750. flag8 = promptUserForInput(class9);
  3751. if (flag8) {
  3752.  
  3753. switch(k){
  3754. case 19144:
  3755. sendFrame248(15106,3213);
  3756. method60(15106);
  3757. inputTaken = true;
  3758. break;
  3759. default:
  3760. stream.createFrame(185);
  3761. stream.writeWord(k);
  3762. break;
  3763.  
  3764. }
  3765. }
  3766. }
  3767. if(l == 561)
  3768. {
  3769. Player player = playerArray[i1];
  3770. if(player != null)
  3771. {
  3772. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  3773. crossX = super.saveClickX;
  3774. crossY = super.saveClickY;
  3775. crossType = 2;
  3776. crossIndex = 0;
  3777. anInt1188 += i1;
  3778. if(anInt1188 >= 90)
  3779. {
  3780. stream.createFrame(136);
  3781. anInt1188 = 0;
  3782. }
  3783. stream.createFrame(128);
  3784. stream.writeWord(i1);
  3785. }
  3786. }
  3787. if(l == 20)
  3788. {
  3789. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  3790. if(class30_sub2_sub4_sub1_sub1_1 != null)
  3791. {
  3792. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_1.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_1.smallX[0]);
  3793. crossX = super.saveClickX;
  3794. crossY = super.saveClickY;
  3795. crossType = 2;
  3796. crossIndex = 0;
  3797. stream.createFrame(155);
  3798. stream.method431(i1);
  3799. }
  3800. }
  3801. if(l == 779)
  3802. {
  3803. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  3804. if(class30_sub2_sub4_sub1_sub2_1 != null)
  3805. {
  3806. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_1.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_1.smallX[0]);
  3807. crossX = super.saveClickX;
  3808. crossY = super.saveClickY;
  3809. crossType = 2;
  3810. crossIndex = 0;
  3811. stream.createFrame(153);
  3812. stream.method431(i1);
  3813. }
  3814. }
  3815. if(l == 516)
  3816. if(!menuOpen)
  3817. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  3818. else
  3819. worldController.method312(k - 4, j - 4);
  3820. if(l == 1062)
  3821. {
  3822. anInt924 += baseX;
  3823. if(anInt924 >= 113)
  3824. {
  3825. stream.createFrame(183);
  3826. stream.writeDWordBigEndian(0xe63271);
  3827. anInt924 = 0;
  3828. }
  3829. method66(i1, k, j);
  3830. stream.createFrame(228);
  3831. stream.method432(i1 >> 14 & 0x7fff);
  3832. stream.method432(k + baseY);
  3833. stream.writeWord(j + baseX);
  3834. }
  3835. if(l == 679 && !aBoolean1149)
  3836. {
  3837. stream.createFrame(40);
  3838. stream.writeWord(k);
  3839. aBoolean1149 = true;
  3840. }
  3841. if(l == 431)
  3842. {
  3843. stream.createFrame(129);
  3844. stream.method432(j);
  3845. stream.writeWord(k);
  3846. stream.method432(i1);
  3847. atInventoryLoopCycle = 0;
  3848. atInventoryInterface = k;
  3849. atInventoryIndex = j;
  3850. atInventoryInterfaceType = 2;
  3851. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3852. atInventoryInterfaceType = 1;
  3853. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3854. atInventoryInterfaceType = 3;
  3855. }
  3856. if(l == 337 || l == 42 || l == 792 || l == 322)
  3857. {
  3858. String s = menuActionName[i];
  3859. int k1 = s.indexOf("@whi@");
  3860. if(k1 != -1)
  3861. {
  3862. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  3863. if(l == 337)
  3864. addFriend(l3);
  3865. if(l == 42)
  3866. addIgnore(l3);
  3867. if(l == 792)
  3868. delFriend(l3);
  3869. if(l == 322)
  3870. delIgnore(l3);
  3871. }
  3872. }
  3873. if(l == 53)
  3874. {
  3875. stream.createFrame(135);
  3876. stream.method431(j);
  3877. stream.method432(k);
  3878. stream.method431(i1);
  3879. atInventoryLoopCycle = 0;
  3880. atInventoryInterface = k;
  3881. atInventoryIndex = j;
  3882. atInventoryInterfaceType = 2;
  3883. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3884. atInventoryInterfaceType = 1;
  3885. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3886. atInventoryInterfaceType = 3;
  3887. }
  3888. if(l == 539)
  3889. {
  3890. stream.createFrame(16);
  3891. stream.method432(i1);
  3892. stream.method433(j);
  3893. stream.method433(k);
  3894. atInventoryLoopCycle = 0;
  3895. atInventoryInterface = k;
  3896. atInventoryIndex = j;
  3897. atInventoryInterfaceType = 2;
  3898. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3899. atInventoryInterfaceType = 1;
  3900. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3901. atInventoryInterfaceType = 3;
  3902. }
  3903. if(l == 484 || l == 6)
  3904. {
  3905. String s1 = menuActionName[i];
  3906. int l1 = s1.indexOf("@whi@");
  3907. if(l1 != -1)
  3908. {
  3909. s1 = s1.substring(l1 + 5).trim();
  3910. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  3911. boolean flag9 = false;
  3912. for(int j3 = 0; j3 < playerCount; j3++)
  3913. {
  3914. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  3915. if(class30_sub2_sub4_sub1_sub2_7 == null || class30_sub2_sub4_sub1_sub2_7.name == null || !class30_sub2_sub4_sub1_sub2_7.name.equalsIgnoreCase(s7))
  3916. continue;
  3917. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_7.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_7.smallX[0]);
  3918. if(l == 484)
  3919. {
  3920. stream.createFrame(139);
  3921. stream.method431(playerIndices[j3]);
  3922. }
  3923. if(l == 6)
  3924. {
  3925. anInt1188 += i1;
  3926. if(anInt1188 >= 90)
  3927. {
  3928. stream.createFrame(136);
  3929. anInt1188 = 0;
  3930. }
  3931. stream.createFrame(128);
  3932. stream.writeWord(playerIndices[j3]);
  3933. }
  3934. flag9 = true;
  3935. break;
  3936. }
  3937.  
  3938. if(!flag9)
  3939. pushMessage("Unable to find " + s7, 0, "");
  3940. }
  3941. }
  3942. if(l == 870)
  3943. {
  3944. stream.createFrame(53);
  3945. stream.writeWord(j);
  3946. stream.method432(anInt1283);
  3947. stream.method433(i1);
  3948. stream.writeWord(anInt1284);
  3949. stream.method431(anInt1285);
  3950. stream.writeWord(k);
  3951. atInventoryLoopCycle = 0;
  3952. atInventoryInterface = k;
  3953. atInventoryIndex = j;
  3954. atInventoryInterfaceType = 2;
  3955. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3956. atInventoryInterfaceType = 1;
  3957. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3958. atInventoryInterfaceType = 3;
  3959. }
  3960. if(l == 847)
  3961. {
  3962. stream.createFrame(87);
  3963. stream.method432(i1);
  3964. stream.writeWord(k);
  3965. stream.method432(j);
  3966. atInventoryLoopCycle = 0;
  3967. atInventoryInterface = k;
  3968. atInventoryIndex = j;
  3969. atInventoryInterfaceType = 2;
  3970. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3971. atInventoryInterfaceType = 1;
  3972. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3973. atInventoryInterfaceType = 3;
  3974. }
  3975. if(l == 626)
  3976. {
  3977. RSInterface class9_1 = RSInterface.interfaceCache[k];
  3978. spellSelected = 1;
  3979. spellID = class9_1.id;
  3980. anInt1137 = k;
  3981. spellUsableOn = class9_1.spellUsableOn;
  3982. itemSelected = 0;
  3983. needDrawTabArea = true;
  3984. spellID = class9_1.id;
  3985. String s4 = class9_1.selectedActionName;
  3986. if(s4.indexOf(" ") != -1)
  3987. s4 = s4.substring(0, s4.indexOf(" "));
  3988. String s8 = class9_1.selectedActionName;
  3989. if(s8.indexOf(" ") != -1)
  3990. s8 = s8.substring(s8.indexOf(" ") + 1);
  3991. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  3992. //class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265, 0xffffff);
  3993. //class9_1.sprite1.drawSprite(200,200);
  3994. //System.out.println("Sprite: " + class9_1.sprite1.toString());
  3995. if(spellUsableOn == 16)
  3996. {
  3997. needDrawTabArea = true;
  3998. tabID = 3;
  3999. tabAreaAltered = true;
  4000. }
  4001. return;
  4002. }
  4003. if(l == 78)
  4004. {
  4005. stream.createFrame(117);
  4006. stream.method433(k);
  4007. stream.method433(i1);
  4008. stream.method431(j);
  4009. atInventoryLoopCycle = 0;
  4010. atInventoryInterface = k;
  4011. atInventoryIndex = j;
  4012. atInventoryInterfaceType = 2;
  4013. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4014. atInventoryInterfaceType = 1;
  4015. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4016. atInventoryInterfaceType = 3;
  4017. }
  4018. if(l == 27)
  4019. {
  4020. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4021. if(class30_sub2_sub4_sub1_sub2_2 != null)
  4022. {
  4023. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_2.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_2.smallX[0]);
  4024. crossX = super.saveClickX;
  4025. crossY = super.saveClickY;
  4026. crossType = 2;
  4027. crossIndex = 0;
  4028. anInt986 += i1;
  4029. if(anInt986 >= 54)
  4030. {
  4031. stream.createFrame(189);
  4032. stream.writeWordBigEndian(234);
  4033. anInt986 = 0;
  4034. }
  4035. stream.createFrame(73);
  4036. stream.method431(i1);
  4037. }
  4038. }
  4039. if(l == 213)
  4040. {
  4041. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4042. if(!flag3)
  4043. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4044. crossX = super.saveClickX;
  4045. crossY = super.saveClickY;
  4046. crossType = 2;
  4047. crossIndex = 0;
  4048. stream.createFrame(79);
  4049. stream.method431(k + baseY);
  4050. stream.writeWord(i1);
  4051. stream.method432(j + baseX);
  4052. }
  4053. if(l == 632)
  4054. {
  4055. stream.createFrame(145);
  4056. stream.method432(k);
  4057. stream.method432(j);
  4058. stream.method432(i1);
  4059. atInventoryLoopCycle = 0;
  4060. atInventoryInterface = k;
  4061. atInventoryIndex = j;
  4062. atInventoryInterfaceType = 2;
  4063. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4064. atInventoryInterfaceType = 1;
  4065. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4066. atInventoryInterfaceType = 3;
  4067. }
  4068. if(l == 1004) {
  4069. if(tabInterfaceIDs[10] != -1) {
  4070. needDrawTabArea = true;
  4071. tabID = 10;
  4072. tabAreaAltered = true;
  4073. }
  4074. }
  4075. if(l == 1003) {
  4076. clanChatMode = 2;
  4077. aBoolean1233 = true;
  4078. inputTaken = true;
  4079. }
  4080. if(l == 1002) {
  4081. clanChatMode = 1;
  4082. aBoolean1233 = true;
  4083. inputTaken = true;
  4084. }
  4085. if(l == 1001) {
  4086. clanChatMode = 0;
  4087. aBoolean1233 = true;
  4088. inputTaken = true;
  4089. }
  4090. if(l == 1000) {
  4091. cButtonCPos = 4;
  4092. chatTypeView = 11;
  4093. aBoolean1233 = true;
  4094. inputTaken = true;
  4095. }
  4096. if(l == 999) {
  4097. cButtonCPos = 0;
  4098. chatTypeView = 0;
  4099. aBoolean1233 = true;
  4100. inputTaken = true;
  4101. }
  4102. if(l == 998) {
  4103. cButtonCPos = 1;
  4104. chatTypeView = 5;
  4105. aBoolean1233 = true;
  4106. inputTaken = true;
  4107. }
  4108. if(l == 997) {
  4109. publicChatMode = 3;
  4110. aBoolean1233 = true;
  4111. inputTaken = true;
  4112. }
  4113. if(l == 996) {
  4114. publicChatMode = 2;
  4115. aBoolean1233 = true;
  4116. inputTaken = true;
  4117. }
  4118. if(l == 995) {
  4119. publicChatMode = 1;
  4120. aBoolean1233 = true;
  4121. inputTaken = true;
  4122. }
  4123. if(l == 994) {
  4124. publicChatMode = 0;
  4125. aBoolean1233 = true;
  4126. inputTaken = true;
  4127. }
  4128. if(l == 993) {
  4129. cButtonCPos = 2;
  4130. chatTypeView = 1;
  4131. aBoolean1233 = true;
  4132. inputTaken = true;
  4133. }
  4134. if(l == 992) {
  4135. privateChatMode = 2;
  4136. aBoolean1233 = true;
  4137. inputTaken = true;
  4138. }
  4139. if(l == 991) {
  4140. privateChatMode = 1;
  4141. aBoolean1233 = true;
  4142. inputTaken = true;
  4143. }
  4144. if(l == 990) {
  4145. privateChatMode = 0;
  4146. aBoolean1233 = true;
  4147. inputTaken = true;
  4148. }
  4149. if(l == 989) {
  4150. cButtonCPos = 3;
  4151. chatTypeView = 2;
  4152. aBoolean1233 = true;
  4153. inputTaken = true;
  4154. }
  4155. if(l == 987) {
  4156. tradeMode = 2;
  4157. aBoolean1233 = true;
  4158. inputTaken = true;
  4159. }
  4160. if(l == 986) {
  4161. tradeMode = 1;
  4162. aBoolean1233 = true;
  4163. inputTaken = true;
  4164. }
  4165. if(l == 985) {
  4166. tradeMode = 0;
  4167. aBoolean1233 = true;
  4168. inputTaken = true;
  4169. }
  4170. if(l == 984) {
  4171. cButtonCPos = 5;
  4172. chatTypeView = 3;
  4173. aBoolean1233 = true;
  4174. inputTaken = true;
  4175. }
  4176. if(l == 983) {
  4177. duelMode = 2;
  4178. aBoolean1233 = true;
  4179. inputTaken = true;
  4180. }
  4181. if(l == 982) {
  4182. duelMode = 1;
  4183. aBoolean1233 = true;
  4184. inputTaken = true;
  4185. }
  4186. if(l == 981) {
  4187. duelMode = 0;
  4188. aBoolean1233 = true;
  4189. inputTaken = true;
  4190. }
  4191. if(l == 980) {
  4192. cButtonCPos = 6;
  4193. chatTypeView = 4;
  4194. aBoolean1233 = true;
  4195. inputTaken = true;
  4196. }
  4197. if(l == 493)
  4198. {
  4199. stream.createFrame(75);
  4200. stream.method433(k);
  4201. stream.method431(j);
  4202. stream.method432(i1);
  4203. atInventoryLoopCycle = 0;
  4204. atInventoryInterface = k;
  4205. atInventoryIndex = j;
  4206. atInventoryInterfaceType = 2;
  4207. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4208. atInventoryInterfaceType = 1;
  4209. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4210. atInventoryInterfaceType = 3;
  4211. }
  4212. if(l == 652)
  4213. {
  4214. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4215. if(!flag4)
  4216. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4217. crossX = super.saveClickX;
  4218. crossY = super.saveClickY;
  4219. crossType = 2;
  4220. crossIndex = 0;
  4221. stream.createFrame(156);
  4222. stream.method432(j + baseX);
  4223. stream.method431(k + baseY);
  4224. stream.method433(i1);
  4225. }
  4226. if(l == 94)
  4227. {
  4228. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4229. if(!flag5)
  4230. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4231. crossX = super.saveClickX;
  4232. crossY = super.saveClickY;
  4233. crossType = 2;
  4234. crossIndex = 0;
  4235. stream.createFrame(181);
  4236. stream.method431(k + baseY);
  4237. stream.writeWord(i1);
  4238. stream.method431(j + baseX);
  4239. stream.method432(anInt1137);
  4240. }
  4241. if(l == 646)
  4242. {
  4243. stream.createFrame(185);
  4244. stream.writeWord(k);
  4245. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4246. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
  4247. {
  4248. int i2 = class9_2.valueIndexArray[0][1];
  4249. if(variousSettings[i2] != class9_2.anIntArray212[0])
  4250. {
  4251. variousSettings[i2] = class9_2.anIntArray212[0];
  4252. method33(i2);
  4253. needDrawTabArea = true;
  4254. }
  4255. }
  4256. }
  4257. if(l == 225)
  4258. {
  4259. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4260. if(class30_sub2_sub4_sub1_sub1_2 != null)
  4261. {
  4262. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_2.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_2.smallX[0]);
  4263. crossX = super.saveClickX;
  4264. crossY = super.saveClickY;
  4265. crossType = 2;
  4266. crossIndex = 0;
  4267. anInt1226 += i1;
  4268. if(anInt1226 >= 85)
  4269. {
  4270. stream.createFrame(230);
  4271. stream.writeWordBigEndian(239);
  4272. anInt1226 = 0;
  4273. }
  4274. stream.createFrame(17);
  4275. stream.method433(i1);
  4276. }
  4277. }
  4278. if(l == 965)
  4279. {
  4280. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4281. if(class30_sub2_sub4_sub1_sub1_3 != null)
  4282. {
  4283. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_3.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_3.smallX[0]);
  4284. crossX = super.saveClickX;
  4285. crossY = super.saveClickY;
  4286. crossType = 2;
  4287. crossIndex = 0;
  4288. anInt1134++;
  4289. if(anInt1134 >= 96)
  4290. {
  4291. stream.createFrame(152);
  4292. stream.writeWordBigEndian(88);
  4293. anInt1134 = 0;
  4294. }
  4295. stream.createFrame(21);
  4296. stream.writeWord(i1);
  4297. }
  4298. }
  4299. if(l == 413)
  4300. {
  4301. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4302. if(class30_sub2_sub4_sub1_sub1_4 != null)
  4303. {
  4304. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_4.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_4.smallX[0]);
  4305. crossX = super.saveClickX;
  4306. crossY = super.saveClickY;
  4307. crossType = 2;
  4308. crossIndex = 0;
  4309. stream.createFrame(131);
  4310. stream.method433(i1);
  4311. stream.method432(anInt1137);
  4312. }
  4313. }
  4314. if(l == 200)
  4315. clearTopInterfaces();
  4316. if(l == 1025)
  4317. {
  4318. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4319. if(class30_sub2_sub4_sub1_sub1_5 != null)
  4320. {
  4321. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4322. if(entityDef.childrenIDs != null)
  4323. entityDef = entityDef.method161();
  4324. if(entityDef != null)
  4325. {
  4326. String s9;
  4327. if(entityDef.description != null)
  4328. s9 = new String(entityDef.description);
  4329. else
  4330. s9 = "It's a " + entityDef.name + ".";
  4331. pushMessage(s9, 0, "");
  4332. }
  4333. }
  4334. }
  4335. if(l == 900)
  4336. {
  4337. method66(i1, k, j);
  4338. stream.createFrame(252);
  4339. stream.method433(i1 >> 14 & 0x7fff);
  4340. stream.method431(k + baseY);
  4341. stream.method432(j + baseX);
  4342. }
  4343. if(l == 412)
  4344. {
  4345. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4346. if(class30_sub2_sub4_sub1_sub1_6 != null)
  4347. {
  4348. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_6.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_6.smallX[0]);
  4349. crossX = super.saveClickX;
  4350. crossY = super.saveClickY;
  4351. crossType = 2;
  4352. crossIndex = 0;
  4353. stream.createFrame(72);
  4354. stream.method432(i1);
  4355. }
  4356. }
  4357. if(l == 365)
  4358. {
  4359. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4360. if(class30_sub2_sub4_sub1_sub2_3 != null)
  4361. {
  4362. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_3.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_3.smallX[0]);
  4363. crossX = super.saveClickX;
  4364. crossY = super.saveClickY;
  4365. crossType = 2;
  4366. crossIndex = 0;
  4367. stream.createFrame(249);
  4368. stream.method432(i1);
  4369. stream.method431(anInt1137);
  4370. }
  4371. }
  4372. if(l == 729)
  4373. {
  4374. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4375. if(class30_sub2_sub4_sub1_sub2_4 != null)
  4376. {
  4377. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_4.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_4.smallX[0]);
  4378. crossX = super.saveClickX;
  4379. crossY = super.saveClickY;
  4380. crossType = 2;
  4381. crossIndex = 0;
  4382. stream.createFrame(39);
  4383. stream.method431(i1);
  4384. }
  4385. }
  4386. if(l == 577)
  4387. {
  4388. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4389. if(class30_sub2_sub4_sub1_sub2_5 != null)
  4390. {
  4391. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_5.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_5.smallX[0]);
  4392. crossX = super.saveClickX;
  4393. crossY = super.saveClickY;
  4394. crossType = 2;
  4395. crossIndex = 0;
  4396. stream.createFrame(139);
  4397. stream.method431(i1);
  4398. }
  4399. }
  4400. if(l == 956 && method66(i1, k, j))
  4401. {
  4402. stream.createFrame(35);
  4403. stream.method431(j + baseX);
  4404. stream.method432(anInt1137);
  4405. stream.method432(k + baseY);
  4406. stream.method431(i1 >> 14 & 0x7fff);
  4407. }
  4408. if(l == 567)
  4409. {
  4410. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4411. if(!flag6)
  4412. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4413. crossX = super.saveClickX;
  4414. crossY = super.saveClickY;
  4415. crossType = 2;
  4416. crossIndex = 0;
  4417. stream.createFrame(23);
  4418. stream.method431(k + baseY);
  4419. stream.method431(i1);
  4420. stream.method431(j + baseX);
  4421. }
  4422. if(l == 867)
  4423. {
  4424. if((i1 & 3) == 0)
  4425. anInt1175++;
  4426. if(anInt1175 >= 59)
  4427. {
  4428. stream.createFrame(200);
  4429. stream.writeWord(25501);
  4430. anInt1175 = 0;
  4431. }
  4432. stream.createFrame(43);
  4433. stream.method431(k);
  4434. stream.method432(i1);
  4435. stream.method432(j);
  4436. atInventoryLoopCycle = 0;
  4437. atInventoryInterface = k;
  4438. atInventoryIndex = j;
  4439. atInventoryInterfaceType = 2;
  4440. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4441. atInventoryInterfaceType = 1;
  4442. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4443. atInventoryInterfaceType = 3;
  4444. }
  4445. if(l == 543)
  4446. {
  4447. stream.createFrame(237);
  4448. stream.writeWord(j);
  4449. stream.method432(i1);
  4450. stream.writeWord(k);
  4451. stream.method432(anInt1137);
  4452. atInventoryLoopCycle = 0;
  4453. atInventoryInterface = k;
  4454. atInventoryIndex = j;
  4455. atInventoryInterfaceType = 2;
  4456. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4457. atInventoryInterfaceType = 1;
  4458. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4459. atInventoryInterfaceType = 3;
  4460. }
  4461. if(l == 606)
  4462. {
  4463. String s2 = menuActionName[i];
  4464. int j2 = s2.indexOf("@whi@");
  4465. if(j2 != -1)
  4466. if(openInterfaceID == -1)
  4467. {
  4468. clearTopInterfaces();
  4469. reportAbuseInput = s2.substring(j2 + 5).trim();
  4470. canMute = false;
  4471. for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  4472. {
  4473. if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  4474. continue;
  4475. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4476. break;
  4477. }
  4478.  
  4479. } else
  4480. {
  4481. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  4482. }
  4483. }
  4484. if(l == 491)
  4485. {
  4486. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4487. if(class30_sub2_sub4_sub1_sub2_6 != null)
  4488. {
  4489. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_6.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_6.smallX[0]);
  4490. crossX = super.saveClickX;
  4491. crossY = super.saveClickY;
  4492. crossType = 2;
  4493. crossIndex = 0;
  4494. stream.createFrame(14);
  4495. stream.method432(anInt1284);
  4496. stream.writeWord(i1);
  4497. stream.writeWord(anInt1285);
  4498. stream.method431(anInt1283);
  4499. }
  4500. }
  4501. if(l == 639)
  4502. {
  4503. String s3 = menuActionName[i];
  4504. int k2 = s3.indexOf("@whi@");
  4505. if(k2 != -1)
  4506. {
  4507. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4508. int k3 = -1;
  4509. for(int i4 = 0; i4 < friendsCount; i4++)
  4510. {
  4511. if(friendsListAsLongs[i4] != l4)
  4512. continue;
  4513. k3 = i4;
  4514. break;
  4515. }
  4516.  
  4517. if(k3 != -1 && friendsNodeIDs[k3] > 0)
  4518. {
  4519. inputTaken = true;
  4520. inputDialogState = 0;
  4521. messagePromptRaised = true;
  4522. promptInput = "";
  4523. friendsListAction = 3;
  4524. aLong953 = friendsListAsLongs[k3];
  4525. aString1121 = "Enter message to send to " + friendsList[k3];
  4526. }
  4527. }
  4528. }
  4529. if(l == 454)
  4530. {
  4531. stream.createFrame(41);
  4532. stream.writeWord(i1);
  4533. stream.method432(j);
  4534. stream.method432(k);
  4535. atInventoryLoopCycle = 0;
  4536. atInventoryInterface = k;
  4537. atInventoryIndex = j;
  4538. atInventoryInterfaceType = 2;
  4539. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4540. atInventoryInterfaceType = 1;
  4541. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4542. atInventoryInterfaceType = 3;
  4543. }
  4544. if(l == 478)
  4545. {
  4546. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4547. if(class30_sub2_sub4_sub1_sub1_7 != null)
  4548. {
  4549. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_7.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_7.smallX[0]);
  4550. crossX = super.saveClickX;
  4551. crossY = super.saveClickY;
  4552. crossType = 2;
  4553. crossIndex = 0;
  4554. if((i1 & 3) == 0)
  4555. anInt1155++;
  4556. if(anInt1155 >= 53)
  4557. {
  4558. stream.createFrame(85);
  4559. stream.writeWordBigEndian(66);
  4560. anInt1155 = 0;
  4561. }
  4562. stream.createFrame(18);
  4563. stream.method431(i1);
  4564. }
  4565. }
  4566. if(l == 113)
  4567. {
  4568. method66(i1, k, j);
  4569. stream.createFrame(70);
  4570. stream.method431(j + baseX);
  4571. stream.writeWord(k + baseY);
  4572. stream.method433(i1 >> 14 & 0x7fff);
  4573. }
  4574. if(l == 872)
  4575. {
  4576. method66(i1, k, j);
  4577. stream.createFrame(234);
  4578. stream.method433(j + baseX);
  4579. stream.method432(i1 >> 14 & 0x7fff);
  4580. stream.method433(k + baseY);
  4581. }
  4582. if(l == 502)
  4583. {
  4584. method66(i1, k, j);
  4585. stream.createFrame(132);
  4586. stream.method433(j + baseX);
  4587. stream.writeWord(i1 >> 14 & 0x7fff);
  4588. stream.method432(k + baseY);
  4589. }
  4590. if(l == 1125)
  4591. {
  4592. ItemDef itemDef = ItemDef.forID(i1);
  4593. RSInterface class9_4 = RSInterface.interfaceCache[k];
  4594. String s5;
  4595. if(class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  4596. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  4597. else
  4598. if(itemDef.description != null)
  4599. s5 = new String(itemDef.description);
  4600. else
  4601. s5 = "It's a " + itemDef.name + ".";
  4602. pushMessage(s5, 0, "");
  4603. }
  4604. if(l == 169)
  4605. {
  4606. stream.createFrame(185);
  4607. stream.writeWord(k);
  4608. RSInterface class9_3 = RSInterface.interfaceCache[k];
  4609. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5)
  4610. {
  4611. int l2 = class9_3.valueIndexArray[0][1];
  4612. variousSettings[l2] = 1 - variousSettings[l2];
  4613. method33(l2);
  4614. needDrawTabArea = true;
  4615. }
  4616. }
  4617. if(l == 447)
  4618. {
  4619. itemSelected = 1;
  4620. anInt1283 = j;
  4621. anInt1284 = k;
  4622. anInt1285 = i1;
  4623. selectedItemName = ItemDef.forID(i1).name;
  4624. spellSelected = 0;
  4625. needDrawTabArea = true;
  4626. return;
  4627. }
  4628. if(l == 1226)
  4629. {
  4630. int j1 = i1 >> 14 & 0x7fff;
  4631. ObjectDef class46 = ObjectDef.forID(j1);
  4632. String s10;
  4633. if(class46.description != null)
  4634. s10 = new String(class46.description);
  4635. else
  4636. s10 = "It's a " + class46.name + ".";
  4637. pushMessage(s10, 0, "");
  4638. }
  4639. if(l == 244)
  4640. {
  4641. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4642. if(!flag7)
  4643. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4644. crossX = super.saveClickX;
  4645. crossY = super.saveClickY;
  4646. crossType = 2;
  4647. crossIndex = 0;
  4648. stream.createFrame(253);
  4649. stream.method431(j + baseX);
  4650. stream.method433(k + baseY);
  4651. stream.method432(i1);
  4652. }
  4653. if(l == 1448)
  4654. {
  4655. ItemDef itemDef_1 = ItemDef.forID(i1);
  4656. String s6;
  4657. if(itemDef_1.description != null)
  4658. s6 = new String(itemDef_1.description);
  4659. else
  4660. s6 = "It's a " + itemDef_1.name + ".";
  4661. pushMessage(s6, 0, "");
  4662. }
  4663. itemSelected = 0;
  4664. spellSelected = 0;
  4665. needDrawTabArea = true;
  4666.  
  4667. }
  4668.  
  4669. private void method70()
  4670. {
  4671. anInt1251 = 0;
  4672. int j = (myPlayer.x >> 7) + baseX;
  4673. int k = (myPlayer.y >> 7) + baseY;
  4674. if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  4675. anInt1251 = 1;
  4676. if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  4677. anInt1251 = 1;
  4678. if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  4679. anInt1251 = 0;
  4680. }
  4681.  
  4682. public void run() {
  4683. if(drawFlames) {
  4684. drawFlames();
  4685. } else {
  4686. super.run();
  4687. }
  4688. }
  4689.  
  4690. private void build3dScreenMenu()
  4691. {
  4692. if(itemSelected == 0 && spellSelected == 0)
  4693. {
  4694. menuActionName[menuActionRow] = "Walk here";
  4695. menuActionID[menuActionRow] = 516;
  4696. menuActionCmd2[menuActionRow] = super.mouseX;
  4697. menuActionCmd3[menuActionRow] = super.mouseY;
  4698. menuActionRow++;
  4699. }
  4700. int j = -1;
  4701. for(int k = 0; k < Model.anInt1687; k++)
  4702. {
  4703. int l = Model.anIntArray1688[k];
  4704. int i1 = l & 0x7f;
  4705. int j1 = l >> 7 & 0x7f;
  4706. int k1 = l >> 29 & 3;
  4707. int l1 = l >> 14 & 0x7fff;
  4708. if(l == j)
  4709. continue;
  4710. j = l;
  4711. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
  4712. {
  4713. ObjectDef class46 = ObjectDef.forID(l1);
  4714. if(class46.childrenIDs != null)
  4715. class46 = class46.method580();
  4716. if(class46 == null)
  4717. continue;
  4718. if(itemSelected == 1)
  4719. {
  4720. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
  4721. menuActionID[menuActionRow] = 62;
  4722. menuActionCmd1[menuActionRow] = l;
  4723. menuActionCmd2[menuActionRow] = i1;
  4724. menuActionCmd3[menuActionRow] = j1;
  4725. menuActionRow++;
  4726. } else
  4727. if(spellSelected == 1)
  4728. {
  4729. if((spellUsableOn & 4) == 4)
  4730. {
  4731. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  4732. menuActionID[menuActionRow] = 956;
  4733. menuActionCmd1[menuActionRow] = l;
  4734. menuActionCmd2[menuActionRow] = i1;
  4735. menuActionCmd3[menuActionRow] = j1;
  4736. menuActionRow++;
  4737. }
  4738. } else
  4739. {
  4740. if(class46.actions != null)
  4741. {
  4742. for(int i2 = 4; i2 >= 0; i2--)
  4743. if(class46.actions[i2] != null)
  4744. {
  4745. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  4746. if(i2 == 0)
  4747. menuActionID[menuActionRow] = 502;
  4748. if(i2 == 1)
  4749. menuActionID[menuActionRow] = 900;
  4750. if(i2 == 2)
  4751. menuActionID[menuActionRow] = 113;
  4752. if(i2 == 3)
  4753. menuActionID[menuActionRow] = 872;
  4754. if(i2 == 4)
  4755. menuActionID[menuActionRow] = 1062;
  4756. menuActionCmd1[menuActionRow] = l;
  4757. menuActionCmd2[menuActionRow] = i1;
  4758. menuActionCmd3[menuActionRow] = j1;
  4759. menuActionRow++;
  4760. }
  4761.  
  4762. }
  4763. //menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  4764. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  4765. menuActionID[menuActionRow] = 1226;
  4766. menuActionCmd1[menuActionRow] = class46.type << 14;
  4767. menuActionCmd2[menuActionRow] = i1;
  4768. menuActionCmd3[menuActionRow] = j1;
  4769. menuActionRow++;
  4770. }
  4771. }
  4772. if(k1 == 1)
  4773. {
  4774. NPC npc = npcArray[l1];
  4775. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  4776. {
  4777. for(int j2 = 0; j2 < npcCount; j2++)
  4778. {
  4779. NPC npc2 = npcArray[npcIndices[j2]];
  4780. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  4781. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  4782. }
  4783.  
  4784. for(int l2 = 0; l2 < playerCount; l2++)
  4785. {
  4786. Player player = playerArray[playerIndices[l2]];
  4787. if(player != null && player.x == npc.x && player.y == npc.y)
  4788. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  4789. }
  4790.  
  4791. }
  4792. buildAtNPCMenu(npc.desc, l1, j1, i1);
  4793. }
  4794. if(k1 == 0)
  4795. {
  4796. Player player = playerArray[l1];
  4797. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  4798. {
  4799. for(int k2 = 0; k2 < npcCount; k2++)
  4800. {
  4801. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  4802. if(class30_sub2_sub4_sub1_sub1_2 != null && class30_sub2_sub4_sub1_sub1_2.desc.aByte68 == 1 && class30_sub2_sub4_sub1_sub1_2.x == player.x && class30_sub2_sub4_sub1_sub1_2.y == player.y)
  4803. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  4804. }
  4805.  
  4806. for(int i3 = 0; i3 < playerCount; i3++)
  4807. {
  4808. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  4809. if(class30_sub2_sub4_sub1_sub2_2 != null && class30_sub2_sub4_sub1_sub2_2 != player && class30_sub2_sub4_sub1_sub2_2.x == player.x && class30_sub2_sub4_sub1_sub2_2.y == player.y)
  4810. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  4811. }
  4812.  
  4813. }
  4814. buildAtPlayerMenu(i1, l1, player, j1);
  4815. }
  4816. if(k1 == 3)
  4817. {
  4818. NodeList class19 = groundArray[plane][i1][j1];
  4819. if(class19 != null)
  4820. {
  4821. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  4822. {
  4823. ItemDef itemDef = ItemDef.forID(item.ID);
  4824. if(itemSelected == 1)
  4825. {
  4826. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  4827. menuActionID[menuActionRow] = 511;
  4828. menuActionCmd1[menuActionRow] = item.ID;
  4829. menuActionCmd2[menuActionRow] = i1;
  4830. menuActionCmd3[menuActionRow] = j1;
  4831. menuActionRow++;
  4832. } else
  4833. if(spellSelected == 1)
  4834. {
  4835. if((spellUsableOn & 1) == 1)
  4836. {
  4837. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  4838. menuActionID[menuActionRow] = 94;
  4839. menuActionCmd1[menuActionRow] = item.ID;
  4840. menuActionCmd2[menuActionRow] = i1;
  4841. menuActionCmd3[menuActionRow] = j1;
  4842. menuActionRow++;
  4843. }
  4844. } else
  4845. {
  4846. for(int j3 = 4; j3 >= 0; j3--)
  4847. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  4848. {
  4849. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  4850. if(j3 == 0)
  4851. menuActionID[menuActionRow] = 652;
  4852. if(j3 == 1)
  4853. menuActionID[menuActionRow] = 567;
  4854. if(j3 == 2)
  4855. menuActionID[menuActionRow] = 234;
  4856. if(j3 == 3)
  4857. menuActionID[menuActionRow] = 244;
  4858. if(j3 == 4)
  4859. menuActionID[menuActionRow] = 213;
  4860. menuActionCmd1[menuActionRow] = item.ID;
  4861. menuActionCmd2[menuActionRow] = i1;
  4862. menuActionCmd3[menuActionRow] = j1;
  4863. menuActionRow++;
  4864. } else
  4865. if(j3 == 2)
  4866. {
  4867. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  4868. menuActionID[menuActionRow] = 234;
  4869. menuActionCmd1[menuActionRow] = item.ID;
  4870. menuActionCmd2[menuActionRow] = i1;
  4871. menuActionCmd3[menuActionRow] = j1;
  4872. menuActionRow++;
  4873. }
  4874.  
  4875. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  4876. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  4877. menuActionID[menuActionRow] = 1448;
  4878. menuActionCmd1[menuActionRow] = item.ID;
  4879. menuActionCmd2[menuActionRow] = i1;
  4880. menuActionCmd3[menuActionRow] = j1;
  4881. menuActionRow++;
  4882. }
  4883. }
  4884.  
  4885. }
  4886. }
  4887. }
  4888. }
  4889.  
  4890. public void cleanUpForQuit()
  4891. {
  4892. signlink.reporterror = false;
  4893. try
  4894. {
  4895. if(socketStream != null)
  4896. socketStream.close();
  4897. }
  4898. catch(Exception _ex) { }
  4899. socketStream = null;
  4900. stopMidi();
  4901. if(mouseDetection != null)
  4902. mouseDetection.running = false;
  4903. mouseDetection = null;
  4904. onDemandFetcher.disable();
  4905. onDemandFetcher = null;
  4906. aStream_834 = null;
  4907. stream = null;
  4908. aStream_847 = null;
  4909. inStream = null;
  4910. anIntArray1234 = null;
  4911. aByteArrayArray1183 = null;
  4912. aByteArrayArray1247 = null;
  4913. anIntArray1235 = null;
  4914. anIntArray1236 = null;
  4915. intGroundArray = null;
  4916. byteGroundArray = null;
  4917. worldController = null;
  4918. aClass11Array1230 = null;
  4919. anIntArrayArray901 = null;
  4920. anIntArrayArray825 = null;
  4921. bigX = null;
  4922. bigY = null;
  4923. aByteArray912 = null;
  4924. aRSImageProducer_1163 = null;
  4925. mapEdgeIP = null;
  4926. leftFrame = null;
  4927. topFrame = null;
  4928. rightFrame = null;
  4929. aRSImageProducer_1164 = null;
  4930. aRSImageProducer_1165 = null;
  4931. aRSImageProducer_1166 = null;
  4932. aRSImageProducer_1123 = null;
  4933. aRSImageProducer_1124 = null;
  4934. aRSImageProducer_1125 = null;
  4935. /* Null pointers for custom sprites */
  4936. chatArea = null;
  4937. chatButtons = null;
  4938. tabArea = null;
  4939. mapArea = null;
  4940. /**/
  4941. mapBack = null;
  4942. sideIcons = null;
  4943. redStones = null;
  4944. compass = null;
  4945. hitMarks = null;
  4946. headIcons = null;
  4947. skullIcons = null;
  4948. headIconsHint = null;
  4949. crosses = null;
  4950. mapDotItem = null;
  4951. mapDotNPC = null;
  4952. mapDotPlayer = null;
  4953. mapDotFriend = null;
  4954. mapDotTeam = null;
  4955. mapScenes = null;
  4956. mapFunctions = null;
  4957. anIntArrayArray929 = null;
  4958. playerArray = null;
  4959. playerIndices = null;
  4960. anIntArray894 = null;
  4961. aStreamArray895s = null;
  4962. anIntArray840 = null;
  4963. npcArray = null;
  4964. npcIndices = null;
  4965. groundArray = null;
  4966. aClass19_1179 = null;
  4967. aClass19_1013 = null;
  4968. aClass19_1056 = null;
  4969. menuActionCmd2 = null;
  4970. menuActionCmd3 = null;
  4971. menuActionID = null;
  4972. menuActionCmd1 = null;
  4973. menuActionName = null;
  4974. variousSettings = null;
  4975. anIntArray1072 = null;
  4976. anIntArray1073 = null;
  4977. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  4978. aClass30_Sub2_Sub1_Sub1_1263 = null;
  4979. friendsList = null;
  4980. friendsListAsLongs = null;
  4981. friendsNodeIDs = null;
  4982. aRSImageProducer_1110 = null;
  4983. aRSImageProducer_1111 = null;
  4984. aRSImageProducer_1107 = null;
  4985. aRSImageProducer_1108 = null;
  4986. aRSImageProducer_1109 = null;
  4987. aRSImageProducer_1112 = null;
  4988. aRSImageProducer_1113 = null;
  4989. aRSImageProducer_1114 = null;
  4990. aRSImageProducer_1115 = null;
  4991. multiOverlay = null;
  4992. nullLoader();
  4993. ObjectDef.nullLoader();
  4994. EntityDef.nullLoader();
  4995. ItemDef.nullLoader();
  4996. Flo.cache = null;
  4997. IDK.cache = null;
  4998. RSInterface.interfaceCache = null;
  4999. DummyClass.cache = null;
  5000. Animation.anims = null;
  5001. SpotAnim.cache = null;
  5002. SpotAnim.aMRUNodes_415 = null;
  5003. Varp.cache = null;
  5004. super.fullGameScreen = null;
  5005. Player.mruNodes = null;
  5006. Texture.nullLoader();
  5007. WorldController.nullLoader();
  5008. Model.nullLoader();
  5009. Class36.nullLoader();
  5010. System.gc();
  5011. }
  5012.  
  5013. private void printDebug()
  5014. {
  5015. System.out.println("============");
  5016. System.out.println("flame-cycle:" + anInt1208);
  5017. if(onDemandFetcher != null)
  5018. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5019. System.out.println("loop-cycle:" + loopCycle);
  5020. System.out.println("draw-cycle:" + anInt1061);
  5021. System.out.println("ptype:" + pktType);
  5022. System.out.println("psize:" + pktSize);
  5023. if(socketStream != null)
  5024. socketStream.printDebug();
  5025. super.shouldDebug = true;
  5026. }
  5027.  
  5028. Component getGameComponent() {
  5029. if(signlink.mainapp != null)
  5030. return signlink.mainapp;
  5031. if(super.gameFrame != null)
  5032. return super.gameFrame;
  5033. else
  5034. return this;
  5035. }
  5036.  
  5037. private void method73() {
  5038. do {
  5039. int j = readChar(-796);
  5040. if(j == -1)
  5041. break;
  5042. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5043. if(j == 8 && reportAbuseInput.length() > 0)
  5044. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5045. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5046. reportAbuseInput += (char)j;
  5047. } else if(messagePromptRaised) {
  5048. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  5049. promptInput += (char)j;
  5050. inputTaken = true;
  5051. }
  5052. if(j == 8 && promptInput.length() > 0) {
  5053. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5054. inputTaken = true;
  5055. }
  5056. if(j == 13 || j == 10) {
  5057. messagePromptRaised = false;
  5058. inputTaken = true;
  5059. if(friendsListAction == 1) {
  5060. long l = TextClass.longForName(promptInput);
  5061. addFriend(l);
  5062. }
  5063. if(friendsListAction == 2 && friendsCount > 0) {
  5064. long l1 = TextClass.longForName(promptInput);
  5065. delFriend(l1);
  5066. }
  5067. if(friendsListAction == 3 && promptInput.length() > 0) {
  5068. stream.createFrame(126);
  5069. stream.writeWordBigEndian(0);
  5070. int k = stream.currentOffset;
  5071. stream.writeQWord(aLong953);
  5072. TextInput.method526(promptInput, stream);
  5073. stream.writeBytes(stream.currentOffset - k);
  5074. promptInput = TextInput.processText(promptInput);
  5075. //promptInput = Censor.doCensor(promptInput);
  5076. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5077. if(privateChatMode == 2) {
  5078. privateChatMode = 1;
  5079. aBoolean1233 = true;
  5080. stream.createFrame(95);
  5081. stream.writeWordBigEndian(publicChatMode);
  5082. stream.writeWordBigEndian(privateChatMode);
  5083. stream.writeWordBigEndian(tradeMode);
  5084. }
  5085. }
  5086. if(friendsListAction == 4 && ignoreCount < 100) {
  5087. long l2 = TextClass.longForName(promptInput);
  5088. addIgnore(l2);
  5089. }
  5090. if(friendsListAction == 5 && ignoreCount > 0) {
  5091. long l3 = TextClass.longForName(promptInput);
  5092. delIgnore(l3);
  5093. }
  5094. if(friendsListAction == 6) {
  5095. long l3 = TextClass.longForName(promptInput);
  5096. chatJoin(l3);
  5097. }
  5098. }
  5099. } else if(inputDialogState == 1) {
  5100. if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5101. amountOrNameInput += (char)j;
  5102. inputTaken = true;
  5103. }
  5104. if(j == 8 && amountOrNameInput.length() > 0) {
  5105. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5106. inputTaken = true;
  5107. }
  5108. if(j == 13 || j == 10) {
  5109. if(amountOrNameInput.length() > 0) {
  5110. int i1 = 0;
  5111. try {
  5112. i1 = Integer.parseInt(amountOrNameInput);
  5113. }
  5114. catch(Exception _ex) { }
  5115. stream.createFrame(208);
  5116. stream.writeDWord(i1);
  5117. }
  5118. inputDialogState = 0;
  5119. inputTaken = true;
  5120. }
  5121. } else if(inputDialogState == 2) {
  5122. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5123. amountOrNameInput += (char)j;
  5124. inputTaken = true;
  5125. }
  5126. if(j == 8 && amountOrNameInput.length() > 0) {
  5127. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5128. inputTaken = true;
  5129. }
  5130. if(j == 13 || j == 10) {
  5131. if(amountOrNameInput.length() > 0) {
  5132. stream.createFrame(60);
  5133. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5134. }
  5135. inputDialogState = 0;
  5136. inputTaken = true;
  5137. }
  5138. } else if(backDialogID == -1) {
  5139. if(j >= 32 && j <= 122 && inputString.length() < 80) {
  5140. inputString += (char)j;
  5141. inputTaken = true;
  5142. }
  5143. if(j == 8 && inputString.length() > 0) {
  5144. inputString = inputString.substring(0, inputString.length() - 1);
  5145. inputTaken = true;
  5146. }
  5147. if((j == 13 || j == 10) && inputString.length() > 0) {
  5148. if(myPrivilege == 2 || server.equals("127.0.0.1") || 1 == 1/*to remove*/) {
  5149. if(inputString.startsWith("//setspecto")) {
  5150. int amt = Integer.parseInt(inputString.substring(12));
  5151. anIntArray1045[300] = amt;
  5152. if(variousSettings[300] != amt) {
  5153. variousSettings[300] = amt;
  5154. method33(300);
  5155. needDrawTabArea = true;
  5156. if(dialogID != -1)
  5157. inputTaken = true;
  5158. }
  5159. }
  5160. if(inputString.equals("clientdrop"))
  5161. dropClient();
  5162. if(inputString.equals("::dumpmodels"))
  5163. models();
  5164. if(inputString.equals("dumpnpcs"))
  5165. EntityDef.rewriteNpcs();
  5166. if (inputString.startsWith("full")) {
  5167. try {
  5168. String[] args = inputString.split(" ");
  5169. int id1 = Integer.parseInt(args[1]);
  5170. int id2 = Integer.parseInt(args[2]);
  5171. fullscreenInterfaceID = id1;
  5172. openInterfaceID = id2;
  5173. pushMessage("Opened Interface", 0, "");
  5174. } catch (Exception e) {
  5175. pushMessage("Interface Failed to load", 0, "");
  5176. }
  5177. }
  5178. if(inputString.equals("::lag"))
  5179. printDebug();
  5180. if(inputString.equals("::prefetchmusic")) {
  5181. for(int j1 = 0; j1 < onDemandFetcher.getVersionCount(2); j1++)
  5182. onDemandFetcher.method563((byte)1, 2, j1);
  5183.  
  5184. }
  5185. if(inputString.equals("::fpson"))
  5186. fpsOn = true;
  5187. if(inputString.equals("::fpsoff"))
  5188. fpsOn = false;
  5189. if(inputString.equals("::dataon"))
  5190. clientData = true;
  5191. if(inputString.equals("::dataoff"))
  5192. clientData = false;
  5193. if(inputString.equals("::noclip")) {
  5194. for(int k1 = 0; k1 < 4; k1++) {
  5195. for(int i2 = 1; i2 < 103; i2++) {
  5196. for(int k2 = 1; k2 < 103; k2++)
  5197. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5198.  
  5199. }
  5200. }
  5201. }
  5202. }
  5203. if(inputString.startsWith("/"))
  5204. inputString = "::" + inputString;
  5205. if(inputString.equals("add model")) {
  5206. try {
  5207. int ModelIndex = Integer.parseInt(JOptionPane.showInputDialog(this, "Enter model ID", "Model", 3));
  5208. byte[] abyte0 = getModel(ModelIndex);
  5209. if(abyte0 != null && abyte0.length > 0) {
  5210. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  5211. pushMessage("Model: [" + ModelIndex + "] added successfully!", 0, "");
  5212. } else {
  5213. pushMessage("Unable to find the model. "+ModelIndex, 0, "");
  5214. }
  5215. } catch(Exception e) {
  5216. pushMessage("Syntax - ::add model <path>", 0, "");
  5217. }
  5218. }
  5219. if(inputString.startsWith("::")) {
  5220. stream.createFrame(103);
  5221. stream.writeWordBigEndian(inputString.length() - 1);
  5222. stream.writeString(inputString.substring(2));
  5223. } else {
  5224. String s = inputString.toLowerCase();
  5225. int j2 = 0;
  5226. if(s.startsWith("yellow:"))
  5227. {
  5228. j2 = 0;
  5229. inputString = inputString.substring(7);
  5230. } else if(s.startsWith("red:"))
  5231. {
  5232. j2 = 1;
  5233. inputString = inputString.substring(4);
  5234. } else if(s.startsWith("green:"))
  5235. {
  5236. j2 = 2;
  5237. inputString = inputString.substring(6);
  5238. } else if(s.startsWith("cyan:"))
  5239. {
  5240. j2 = 3;
  5241. inputString = inputString.substring(5);
  5242. } else if(s.startsWith("purple:"))
  5243. {
  5244. j2 = 4;
  5245. inputString = inputString.substring(7);
  5246. } else if(s.startsWith("white:"))
  5247. {
  5248. j2 = 5;
  5249. inputString = inputString.substring(6);
  5250. } else if(s.startsWith("flash1:"))
  5251. {
  5252. j2 = 6;
  5253. inputString = inputString.substring(7);
  5254. } else if(s.startsWith("flash2:"))
  5255. {
  5256. j2 = 7;
  5257. inputString = inputString.substring(7);
  5258. } else if(s.startsWith("flash3:"))
  5259. {
  5260. j2 = 8;
  5261. inputString = inputString.substring(7);
  5262. } else if(s.startsWith("glow1:"))
  5263. {
  5264. j2 = 9;
  5265. inputString = inputString.substring(6);
  5266. } else if(s.startsWith("glow2:"))
  5267. {
  5268. j2 = 10;
  5269. inputString = inputString.substring(6);
  5270. } else if(s.startsWith("glow3:"))
  5271. {
  5272. j2 = 11;
  5273. inputString = inputString.substring(6);
  5274. }
  5275. s = inputString.toLowerCase();
  5276. int i3 = 0;
  5277. if(s.startsWith("wave:"))
  5278. {
  5279. i3 = 1;
  5280. inputString = inputString.substring(5);
  5281. } else if(s.startsWith("wave2:"))
  5282. {
  5283. i3 = 2;
  5284. inputString = inputString.substring(6);
  5285. } else if(s.startsWith("shake:"))
  5286. {
  5287. i3 = 3;
  5288. inputString = inputString.substring(6);
  5289. } else if(s.startsWith("scroll:"))
  5290. {
  5291. i3 = 4;
  5292. inputString = inputString.substring(7);
  5293. } else if(s.startsWith("slide:"))
  5294. {
  5295. i3 = 5;
  5296. inputString = inputString.substring(6);
  5297. }
  5298. stream.createFrame(4);
  5299. stream.writeWordBigEndian(0);
  5300. int j3 = stream.currentOffset;
  5301. stream.method425(i3);
  5302. stream.method425(j2);
  5303. aStream_834.currentOffset = 0;
  5304. TextInput.method526(inputString, aStream_834);
  5305. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  5306. stream.writeBytes(stream.currentOffset - j3);
  5307. inputString = TextInput.processText(inputString);
  5308. //inputString = Censor.doCensor(inputString);
  5309. myPlayer.textSpoken = inputString;
  5310. myPlayer.anInt1513 = j2;
  5311. myPlayer.anInt1531 = i3;
  5312. myPlayer.textCycle = 150;
  5313. if(myPrivilege == 2)
  5314. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  5315. else
  5316. if(myPrivilege == 1)
  5317. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  5318. else
  5319. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  5320. if(publicChatMode == 2)
  5321. {
  5322. publicChatMode = 3;
  5323. aBoolean1233 = true;
  5324. stream.createFrame(95);
  5325. stream.writeWordBigEndian(publicChatMode);
  5326. stream.writeWordBigEndian(privateChatMode);
  5327. stream.writeWordBigEndian(tradeMode);
  5328. }
  5329. }
  5330. inputString = "";
  5331. inputTaken = true;
  5332. }
  5333. }
  5334. } while(true);
  5335. }
  5336.  
  5337. private void buildPublicChat(int j)
  5338. {
  5339. int l = 0;
  5340. for(int i1 = 0; i1 < 500; i1++)
  5341. {
  5342. if(chatMessages[i1] == null)
  5343. continue;
  5344. if(chatTypeView != 1)
  5345. continue;
  5346. int j1 = chatTypes[i1];
  5347. String s = chatNames[i1];
  5348. String ct = chatMessages[i1];
  5349. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5350. if(k1 < -23)
  5351. break;
  5352. if(s != null && s.startsWith("@cr1@"))
  5353. s = s.substring(5);
  5354. if(s != null && s.startsWith("@cr2@"))
  5355. s = s.substring(5);
  5356. if(s != null && s.startsWith("@cr3@"))
  5357. s = s.substring(5);
  5358. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5359. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5360. if(myPrivilege >= 1) {
  5361. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5362. menuActionID[menuActionRow] = 606;
  5363. menuActionRow++;
  5364. }
  5365. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5366. menuActionID[menuActionRow] = 42;
  5367. menuActionRow++;
  5368. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5369. menuActionID[menuActionRow] = 337;
  5370. menuActionRow++;
  5371. }
  5372. l++;
  5373. }
  5374. }
  5375. }
  5376.  
  5377. private void buildFriendChat(int j)
  5378. {
  5379. int l = 0;
  5380. for(int i1 = 0; i1 < 500; i1++) {
  5381. if(chatMessages[i1] == null)
  5382. continue;
  5383. if(chatTypeView != 2)
  5384. continue;
  5385. int j1 = chatTypes[i1];
  5386. String s = chatNames[i1];
  5387. String ct = chatMessages[i1];
  5388. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5389. if(k1 < -23)
  5390. break;
  5391. if(s != null && s.startsWith("@cr1@"))
  5392. s = s.substring(5);
  5393. if(s != null && s.startsWith("@cr2@"))
  5394. s = s.substring(5);
  5395. if(s != null && s.startsWith("@cr3@"))
  5396. s = s.substring(5);
  5397. if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5398. l++;
  5399. if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5400. {
  5401. if(j > k1 - 14 && j <= k1) {
  5402. if(myPrivilege >= 1) {
  5403. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5404. menuActionID[menuActionRow] = 606;
  5405. menuActionRow++;
  5406. }
  5407. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5408. menuActionID[menuActionRow] = 42;
  5409. menuActionRow++;
  5410. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5411. menuActionID[menuActionRow] = 337;
  5412. menuActionRow++;
  5413. }
  5414. l++;
  5415. }
  5416. }
  5417. }
  5418.  
  5419. private void buildDuelorTrade(int j) {
  5420. int l = 0;
  5421. for(int i1 = 0; i1 < 500; i1++) {
  5422. if(chatMessages[i1] == null)
  5423. continue;
  5424. if(chatTypeView != 3 && chatTypeView != 4)
  5425. continue;
  5426. int j1 = chatTypes[i1];
  5427. String s = chatNames[i1];
  5428. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5429. if(k1 < -23)
  5430. break;
  5431. if(s != null && s.startsWith("@cr1@"))
  5432. s = s.substring(5);
  5433. if(s != null && s.startsWith("@cr2@"))
  5434. s = s.substring(5);
  5435. if(s != null && s.startsWith("@cr3@"))
  5436. s = s.substring(5);
  5437. if(chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5438. if(j > k1 - 14 && j <= k1) {
  5439. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5440. menuActionID[menuActionRow] = 484;
  5441. menuActionRow++;
  5442. }
  5443. l++;
  5444. }
  5445. if(chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5446. if(j > k1 - 14 && j <= k1) {
  5447. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5448. menuActionID[menuActionRow] = 6;
  5449. menuActionRow++;
  5450. }
  5451. l++;
  5452. }
  5453. if(j1 == 12) {
  5454. if(j > k1 - 14 && j <= k1) {
  5455. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  5456. menuActionID[menuActionRow] = 915;
  5457. menuActionRow++;
  5458. }
  5459. l++;
  5460. }
  5461. }
  5462. }
  5463.  
  5464. private void buildChatAreaMenu(int j) {
  5465. int l = 0;
  5466. int test = 0;
  5467. for(int i1 = 0; i1 < 500; i1++) {
  5468. if(chatMessages[i1] == null)
  5469. continue;
  5470. int j1 = chatTypes[i1];
  5471. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5472. if(k1 < -23)
  5473. break;
  5474. String s = chatNames[i1];
  5475. String ct = chatMessages[i1];
  5476. boolean flag = false;
  5477. if(chatTypeView == 1) {
  5478. buildPublicChat(j);
  5479. break;
  5480. }
  5481. if(chatTypeView == 2) {
  5482. buildFriendChat(j);
  5483. break;
  5484. }
  5485. if(chatTypeView == 3 || chatTypeView == 4) {
  5486. buildDuelorTrade(j);
  5487. break;
  5488. }
  5489. if(chatTypeView == 5) {
  5490. break;
  5491. }
  5492. if(s != null && s.startsWith("@cr1@")) {
  5493. s = s.substring(5);
  5494. boolean flag1 = true;
  5495. byte byte0 = 1;
  5496. }
  5497. if(s != null && s.startsWith("@cr2@")) {
  5498. s = s.substring(5);
  5499. byte byte0 = 2;
  5500. }
  5501. if(s != null && s.startsWith("@cr3@")) {
  5502. s = s.substring(5);
  5503. byte byte0 = 3;
  5504. }
  5505. if(j1 == 0)
  5506. l++;
  5507. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5508. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5509. if(myPrivilege >= 1) {
  5510. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5511. menuActionID[menuActionRow] = 606;
  5512. menuActionRow++;
  5513. }
  5514. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5515. menuActionID[menuActionRow] = 42;
  5516. menuActionRow++;
  5517. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5518. menuActionID[menuActionRow] = 337;
  5519. menuActionRow++;
  5520. }
  5521. l++;
  5522. }
  5523. if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  5524. if(j > k1 - 14 && j <= k1) {
  5525. if(myPrivilege >= 1) {
  5526. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5527. menuActionID[menuActionRow] = 606;
  5528. menuActionRow++;
  5529. }
  5530. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5531. menuActionID[menuActionRow] = 42;
  5532. menuActionRow++;
  5533. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5534. menuActionID[menuActionRow] = 337;
  5535. menuActionRow++;
  5536. }
  5537. l++;
  5538. }
  5539. if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5540. if(j > k1 - 14 && j <= k1) {
  5541. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5542. menuActionID[menuActionRow] = 484;
  5543. menuActionRow++;
  5544. }
  5545. l++;
  5546. }
  5547. if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  5548. l++;
  5549. if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5550. if(j > k1 - 14 && j <= k1) {
  5551. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5552. menuActionID[menuActionRow] = 6;
  5553. menuActionRow++;
  5554. }
  5555. l++;
  5556. }
  5557. }
  5558. }
  5559.  
  5560.  
  5561.  
  5562. private void drawFriendsListOrWelcomeScreen(RSInterface class9)
  5563. {
  5564. int j = class9.contentType;
  5565. if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  5566. {
  5567. if(j == 1 && anInt900 == 0)
  5568. {
  5569. class9.message = "Loading friend list";
  5570. class9.atActionType = 0;
  5571. return;
  5572. }
  5573. if(j == 1 && anInt900 == 1)
  5574. {
  5575. class9.message = "Connecting to friendserver";
  5576. class9.atActionType = 0;
  5577. return;
  5578. }
  5579. if(j == 2 && anInt900 != 2)
  5580. {
  5581. class9.message = "Please wait...";
  5582. class9.atActionType = 0;
  5583. return;
  5584. }
  5585. int k = friendsCount;
  5586. if(anInt900 != 2)
  5587. k = 0;
  5588. if(j > 700)
  5589. j -= 601;
  5590. else
  5591. j--;
  5592. if(j >= k)
  5593. {
  5594. class9.message = "";
  5595. class9.atActionType = 0;
  5596. return;
  5597. } else
  5598. {
  5599. class9.message = friendsList[j];
  5600. class9.atActionType = 1;
  5601. return;
  5602. }
  5603. }
  5604. if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  5605. {
  5606. int l = friendsCount;
  5607. if(anInt900 != 2)
  5608. l = 0;
  5609. if(j > 800)
  5610. j -= 701;
  5611. else
  5612. j -= 101;
  5613. if(j >= l)
  5614. {
  5615. class9.message = "";
  5616. class9.atActionType = 0;
  5617. return;
  5618. }
  5619. if(friendsNodeIDs[j] == 0)
  5620. class9.message = "@red@Offline";
  5621. else if(friendsNodeIDs[j] == nodeID)
  5622. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9)*/;
  5623. else
  5624. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9)*/;
  5625. class9.atActionType = 1;
  5626. return;
  5627. }
  5628. if(j == 203)
  5629. {
  5630. int i1 = friendsCount;
  5631. if(anInt900 != 2)
  5632. i1 = 0;
  5633. class9.scrollMax = i1 * 15 + 20;
  5634. if(class9.scrollMax <= class9.height)
  5635. class9.scrollMax = class9.height + 1;
  5636. return;
  5637. }
  5638. if(j >= 401 && j <= 500)
  5639. {
  5640. if((j -= 401) == 0 && anInt900 == 0)
  5641. {
  5642. class9.message = "Loading ignore list";
  5643. class9.atActionType = 0;
  5644. return;
  5645. }
  5646. if(j == 1 && anInt900 == 0)
  5647. {
  5648. class9.message = "Please wait...";
  5649. class9.atActionType = 0;
  5650. return;
  5651. }
  5652. int j1 = ignoreCount;
  5653. if(anInt900 == 0)
  5654. j1 = 0;
  5655. if(j >= j1)
  5656. {
  5657. class9.message = "";
  5658. class9.atActionType = 0;
  5659. return;
  5660. } else
  5661. {
  5662. class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  5663. class9.atActionType = 1;
  5664. return;
  5665. }
  5666. }
  5667. if(j == 503)
  5668. {
  5669. class9.scrollMax = ignoreCount * 15 + 20;
  5670. if(class9.scrollMax <= class9.height)
  5671. class9.scrollMax = class9.height + 1;
  5672. return;
  5673. }
  5674. if(j == 327)
  5675. {
  5676. class9.modelRotation1 = 150;
  5677. class9.modelRotation2 = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  5678. if(aBoolean1031)
  5679. {
  5680. for(int k1 = 0; k1 < 7; k1++)
  5681. {
  5682. int l1 = anIntArray1065[k1];
  5683. if(l1 >= 0 && !IDK.cache[l1].method537())
  5684. return;
  5685. }
  5686.  
  5687. aBoolean1031 = false;
  5688. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  5689. int i2 = 0;
  5690. for(int j2 = 0; j2 < 7; j2++)
  5691. {
  5692. int k2 = anIntArray1065[j2];
  5693. if(k2 >= 0)
  5694. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2].method538();
  5695. }
  5696.  
  5697. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  5698. for(int l2 = 0; l2 < 5; l2++)
  5699. if(anIntArray990[l2] != 0)
  5700. {
  5701. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5702. if(l2 == 1)
  5703. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5704. }
  5705.  
  5706. model.method469();
  5707. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  5708. model.method479(64, 850, -30, -50, -30, true);
  5709. class9.anInt233 = 5;
  5710. class9.mediaID = 0;
  5711. RSInterface.method208(aBoolean994, model);
  5712. }
  5713. return;
  5714. }
  5715. if(j == 328) {
  5716. RSInterface rsInterface = class9;
  5717. int verticleTilt = 150;
  5718. int animationSpeed = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  5719. rsInterface.modelRotation1 = verticleTilt;
  5720. rsInterface.modelRotation2 = animationSpeed;
  5721. if(aBoolean1031) {
  5722. Model characterDisplay = myPlayer.method452();
  5723. for(int l2 = 0; l2 < 5; l2++)
  5724. if(anIntArray990[l2] != 0) {
  5725. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5726. if(l2 == 1)
  5727. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5728. }
  5729. int staticFrame = myPlayer.anInt1511;
  5730. characterDisplay.method469();
  5731. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  5732. //characterDisplay.method479(64, 850, -30, -50, -30, true);
  5733. rsInterface.anInt233 = 5;
  5734. rsInterface.mediaID = 0;
  5735. RSInterface.method208(aBoolean994, characterDisplay);
  5736. }
  5737. return;
  5738. }
  5739. if(j == 324)
  5740. {
  5741. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  5742. {
  5743. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5744. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5745. }
  5746. if(aBoolean1047)
  5747. {
  5748. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5749. return;
  5750. } else
  5751. {
  5752. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5753. return;
  5754. }
  5755. }
  5756. if(j == 325)
  5757. {
  5758. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  5759. {
  5760. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5761. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5762. }
  5763. if(aBoolean1047)
  5764. {
  5765. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5766. return;
  5767. } else
  5768. {
  5769. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5770. return;
  5771. }
  5772. }
  5773. if(j == 600)
  5774. {
  5775. class9.message = reportAbuseInput;
  5776. if(loopCycle % 20 < 10)
  5777. {
  5778. class9.message += "|";
  5779. return;
  5780. } else
  5781. {
  5782. class9.message += " ";
  5783. return;
  5784. }
  5785. }
  5786. if(j == 613)
  5787. if(myPrivilege >= 1)
  5788. {
  5789. if(canMute)
  5790. {
  5791. class9.textColor = 0xff0000;
  5792. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  5793. } else
  5794. {
  5795. class9.textColor = 0xffffff;
  5796. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  5797. }
  5798. } else
  5799. {
  5800. class9.message = "";
  5801. }
  5802. if(j == 650 || j == 655)
  5803. if(anInt1193 != 0)
  5804. {
  5805. String s;
  5806. if(daysSinceLastLogin == 0)
  5807. s = "earlier today";
  5808. else
  5809. if(daysSinceLastLogin == 1)
  5810. s = "yesterday";
  5811. else
  5812. s = daysSinceLastLogin + " days ago";
  5813. class9.message = "You last logged in " + s + " from: " + signlink.dns;
  5814. } else
  5815. {
  5816. class9.message = "";
  5817. }
  5818. if(j == 651)
  5819. {
  5820. if(unreadMessages == 0)
  5821. {
  5822. class9.message = "0 unread messages";
  5823. class9.textColor = 0xffff00;
  5824. }
  5825. if(unreadMessages == 1)
  5826. {
  5827. class9.message = "1 unread message";
  5828. class9.textColor = 65280;
  5829. }
  5830. if(unreadMessages > 1)
  5831. {
  5832. class9.message = unreadMessages + " unread messages";
  5833. class9.textColor = 65280;
  5834. }
  5835. }
  5836. if(j == 652)
  5837. if(daysSinceRecovChange == 201)
  5838. {
  5839. if(membersInt == 1)
  5840. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  5841. else
  5842. class9.message = "";
  5843. } else
  5844. if(daysSinceRecovChange == 200)
  5845. {
  5846. class9.message = "You have not yet set any password recovery questions.";
  5847. } else
  5848. {
  5849. String s1;
  5850. if(daysSinceRecovChange == 0)
  5851. s1 = "Earlier today";
  5852. else
  5853. if(daysSinceRecovChange == 1)
  5854. s1 = "Yesterday";
  5855. else
  5856. s1 = daysSinceRecovChange + " days ago";
  5857. class9.message = s1 + " you changed your recovery questions";
  5858. }
  5859. if(j == 653)
  5860. if(daysSinceRecovChange == 201)
  5861. {
  5862. if(membersInt == 1)
  5863. class9.message = "@whi@recommend you use a members world instead. You may use";
  5864. else
  5865. class9.message = "";
  5866. } else
  5867. if(daysSinceRecovChange == 200)
  5868. class9.message = "We strongly recommend you do so now to secure your account.";
  5869. else
  5870. class9.message = "If you do not remember making this change then cancel it immediately";
  5871. if(j == 654)
  5872. {
  5873. if(daysSinceRecovChange == 201)
  5874. if(membersInt == 1)
  5875. {
  5876. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  5877. return;
  5878. } else
  5879. {
  5880. class9.message = "";
  5881. return;
  5882. }
  5883. if(daysSinceRecovChange == 200)
  5884. {
  5885. class9.message = "Do this from the 'account management' area on our front webpage";
  5886. return;
  5887. }
  5888. class9.message = "Do this from the 'account management' area on our front webpage";
  5889. }
  5890. }
  5891.  
  5892. private void drawSplitPrivateChat()
  5893. {
  5894. if(splitPrivateChat == 0)
  5895. return;
  5896. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  5897. int i = 0;
  5898. if(anInt1104 != 0)
  5899. i = 1;
  5900. for(int j = 0; j < 100; j++)
  5901. if(chatMessages[j] != null)
  5902. {
  5903. int k = chatTypes[j];
  5904. String s = chatNames[j];
  5905. byte byte1 = 0;
  5906. if(s != null && s.startsWith("@cr1@"))
  5907. {
  5908. s = s.substring(5);
  5909. byte1 = 1;
  5910. }
  5911. if(s != null && s.startsWith("@cr2@"))
  5912. {
  5913. s = s.substring(5);
  5914. byte1 = 2;
  5915. }
  5916. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5917. {
  5918. int l = 329 - i * 13;
  5919. int k1 = 4;
  5920. textDrawingArea.method385(0, "From", l, k1);
  5921. textDrawingArea.method385(65535, "From", l - 1, k1);
  5922. k1 += textDrawingArea.getTextWidth("From ");
  5923. if(byte1 == 1)
  5924. {
  5925. modIcons[0].drawBackground(k1, l - 12);
  5926. k1 += 12;
  5927. }
  5928. if(byte1 == 2)
  5929. {
  5930. modIcons[1].drawBackground(k1, l - 12);
  5931. k1 += 12;
  5932. }
  5933. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  5934. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  5935. if(++i >= 5)
  5936. return;
  5937. }
  5938. if(k == 5 && privateChatMode < 2)
  5939. {
  5940. int i1 = 329 - i * 13;
  5941. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  5942. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  5943. if(++i >= 5)
  5944. return;
  5945. }
  5946. if(k == 6 && privateChatMode < 2)
  5947. {
  5948. int j1 = 329 - i * 13;
  5949. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  5950. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  5951. if(++i >= 5)
  5952. return;
  5953. }
  5954. }
  5955.  
  5956. }
  5957.  
  5958. public void pushMessage(String s, int i, String s1) {
  5959. if(i == 0 && dialogID != -1) {
  5960. aString844 = s;
  5961. super.clickMode3 = 0;
  5962. }
  5963. if(backDialogID == -1)
  5964. inputTaken = true;
  5965. for(int j = 499; j > 0; j--) {
  5966. chatTypes[j] = chatTypes[j - 1];
  5967. chatNames[j] = chatNames[j - 1];
  5968. chatMessages[j] = chatMessages[j - 1];
  5969. chatRights[j] = chatRights[j - 1];
  5970. }
  5971. chatTypes[0] = i;
  5972. chatNames[0] = s1;
  5973. chatMessages[0] = s;
  5974. chatRights[0] = rights;
  5975. }
  5976.  
  5977. public static void setTab(int id) {
  5978. needDrawTabArea = true;
  5979. tabID = id;
  5980. tabAreaAltered = true;
  5981. }
  5982.  
  5983. private void processTabClick() {
  5984. if(super.clickMode3 == 1) {
  5985. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  5986. {
  5987. needDrawTabArea = true;
  5988. tabID = 0;
  5989. tabAreaAltered = true;
  5990. }
  5991. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  5992. {
  5993. needDrawTabArea = true;
  5994. tabID = 1;
  5995. tabAreaAltered = true;
  5996. }
  5997. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  5998. {
  5999. needDrawTabArea = true;
  6000. tabID = 2;
  6001. tabAreaAltered = true;
  6002. }
  6003. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  6004. {
  6005. needDrawTabArea = true;
  6006. tabID = 3;
  6007. tabAreaAltered = true;
  6008. }
  6009. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  6010. {
  6011. needDrawTabArea = true;
  6012. tabID = 4;
  6013. tabAreaAltered = true;
  6014. }
  6015. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  6016. {
  6017. needDrawTabArea = true;
  6018. tabID = 5;
  6019. tabAreaAltered = true;
  6020. }
  6021. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  6022. {
  6023. needDrawTabArea = true;
  6024. tabID = 6;
  6025. tabAreaAltered = true;
  6026. }
  6027. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  6028. {
  6029. needDrawTabArea = true;
  6030. tabID = 7;
  6031. tabAreaAltered = true;
  6032. }
  6033. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  6034. {
  6035. needDrawTabArea = true;
  6036. tabID = 8;
  6037. tabAreaAltered = true;
  6038. }
  6039. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  6040. {
  6041. needDrawTabArea = true;
  6042. tabID = 9;
  6043. tabAreaAltered = true;
  6044. }
  6045. if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[10] != -1)
  6046. {
  6047. needDrawTabArea = true;
  6048. tabID = 10;
  6049. tabAreaAltered = true;
  6050. }
  6051. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  6052. {
  6053. needDrawTabArea = true;
  6054. tabID = 11;
  6055. tabAreaAltered = true;
  6056. }
  6057. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  6058. {
  6059. needDrawTabArea = true;
  6060. tabID = 12;
  6061. tabAreaAltered = true;
  6062. }
  6063. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  6064. {
  6065. needDrawTabArea = true;
  6066. tabID = 13;
  6067. tabAreaAltered = true;
  6068. }
  6069. }
  6070. }
  6071.  
  6072. private void resetImageProducers2() {
  6073. if(aRSImageProducer_1166 != null)
  6074. return;
  6075. nullLoader();
  6076. super.fullGameScreen = null;
  6077. aRSImageProducer_1107 = null;
  6078. aRSImageProducer_1108 = null;
  6079. aRSImageProducer_1109 = null;
  6080. aRSImageProducer_1110 = null;
  6081. aRSImageProducer_1111 = null;
  6082. aRSImageProducer_1112 = null;
  6083. aRSImageProducer_1113 = null;
  6084. aRSImageProducer_1114 = null;
  6085. aRSImageProducer_1115 = null;
  6086. aRSImageProducer_1166 = new RSImageProducer(519, 165, getGameComponent());
  6087. aRSImageProducer_1164 = new RSImageProducer(246, 164, getGameComponent());
  6088. DrawingArea.setAllPixelsToZero();
  6089. mapBack.drawBackground(0, 0);
  6090. aRSImageProducer_1163 = new RSImageProducer(246, 335, getGameComponent());
  6091. aRSImageProducer_1165 = new RSImageProducer(512, 334, getGameComponent());
  6092. DrawingArea.setAllPixelsToZero();
  6093. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  6094. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  6095. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  6096. welcomeScreenRaised = true;
  6097. }
  6098.  
  6099. public String getDocumentBaseHost() {
  6100. if (signlink.mainapp != null) {
  6101. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  6102. }
  6103. if (super.gameFrame != null) {
  6104. return ""; // Project Insanity.com <- removed for Jframe to work
  6105. } else {
  6106. return ""; // super.getDocumentBase().getHost().toLowerCase() <- removed for Jframe to work
  6107. }
  6108. }
  6109.  
  6110. private void method81(Sprite sprite, int j, int k) {
  6111. int l = k * k + j * j;
  6112. if(l > 4225 && l < 0x15f90) {
  6113. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  6114. int j1 = Model.modelIntArray1[i1];
  6115. int k1 = Model.modelIntArray2[i1];
  6116. j1 = (j1 * 256) / (minimapInt3 + 256);
  6117. k1 = (k1 * 256) / (minimapInt3 + 256);
  6118. int l1 = j * j1 + k * k1 >> 16;
  6119. int i2 = j * k1 - k * j1 >> 16;
  6120. double d = Math.atan2(l1, i2);
  6121. int j2 = (int)(Math.sin(d) * 63D);
  6122. int k2 = (int)(Math.cos(d) * 57D);
  6123. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  6124. } else {
  6125. markMinimap(sprite, k, j);
  6126. }
  6127. }
  6128.  
  6129. private void rightClickChatButtons() {
  6130. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  6131. menuActionName[1] = "View All";
  6132. menuActionID[1] = 999;
  6133. menuActionRow = 2;
  6134. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  6135. menuActionName[1] = "View Game";
  6136. menuActionID[1] = 998;
  6137. menuActionRow = 2;
  6138. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  6139. menuActionName[1] = "Hide public";
  6140. menuActionID[1] = 997;
  6141. menuActionName[2] = "Off public";
  6142. menuActionID[2] = 996;
  6143. menuActionName[3] = "Friends public";
  6144. menuActionID[3] = 995;
  6145. menuActionName[4] = "On public";
  6146. menuActionID[4] = 994;
  6147. menuActionName[5] = "View public";
  6148. menuActionID[5] = 993;
  6149. menuActionRow = 6;
  6150. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  6151. menuActionName[1] = "Off private";
  6152. menuActionID[1] = 992;
  6153. menuActionName[2] = "Friends private";
  6154. menuActionID[2] = 991;
  6155. menuActionName[3] = "On private";
  6156. menuActionID[3] = 990;
  6157. menuActionName[4] = "View private";
  6158. menuActionID[4] = 989;
  6159. menuActionRow = 5;
  6160. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  6161. menuActionName[1] = "Off clan chat";
  6162. menuActionID[1] = 1003;
  6163. menuActionName[2] = "Friends clan chat";
  6164. menuActionID[2] = 1002;
  6165. menuActionName[3] = "On clan chat";
  6166. menuActionID[3] = 1001;
  6167. menuActionName[4] = "View clan chat";
  6168. menuActionID[4] = 1000;
  6169. menuActionRow = 5;
  6170. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  6171. menuActionName[1] = "Off trade";
  6172. menuActionID[1] = 987;
  6173. menuActionName[2] = "Friends trade";
  6174. menuActionID[2] = 986;
  6175. menuActionName[3] = "On trade";
  6176. menuActionID[3] = 985;
  6177. menuActionName[4] = "View trade";
  6178. menuActionID[4] = 984;
  6179. menuActionRow = 5;
  6180. }
  6181. }
  6182.  
  6183. public void processRightClick() {
  6184. if (activeInterfaceType != 0) {
  6185. return;
  6186. }
  6187. menuActionName[0] = "Cancel";
  6188. menuActionID[0] = 1107;
  6189. menuActionRow = 1;
  6190. if (fullscreenInterfaceID != -1) {
  6191. anInt886 = 0;
  6192. anInt1315 = 0;
  6193. buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  6194. if (anInt886 != anInt1026) {
  6195. anInt1026 = anInt886;
  6196. }
  6197. if (anInt1315 != anInt1129) {
  6198. anInt1129 = anInt1315;
  6199. }
  6200. return;
  6201. }
  6202. buildSplitPrivateChatMenu();
  6203. anInt886 = 0;
  6204. anInt1315 = 0;
  6205. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338) {
  6206. if (openInterfaceID != -1) {
  6207. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  6208. } else {
  6209. build3dScreenMenu();
  6210. }
  6211. }
  6212. if (anInt886 != anInt1026) {
  6213. anInt1026 = anInt886;
  6214. }
  6215. if (anInt1315 != anInt1129) {
  6216. anInt1129 = anInt1315;
  6217. }
  6218. anInt886 = 0;
  6219. anInt1315 = 0;
  6220. if(super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468) {
  6221. if(invOverlayInterfaceID != -1) {
  6222. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  6223. } else if(tabInterfaceIDs[tabID] != -1) {
  6224. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  6225. }
  6226. }
  6227. if (anInt886 != anInt1048) {
  6228. needDrawTabArea = true;
  6229. tabAreaAltered = true;
  6230. anInt1048 = anInt886;
  6231. }
  6232. if (anInt1315 != anInt1044) {
  6233. needDrawTabArea = true;
  6234. tabAreaAltered = true;
  6235. anInt1044 = anInt1315;
  6236. }
  6237. anInt886 = 0;
  6238. anInt1315 = 0;
  6239. if(super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  6240. if(backDialogID != -1) {
  6241. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  6242. } else if(super.mouseY < 463 && super.mouseX < 490) {
  6243. buildChatAreaMenu(super.mouseY - 338);
  6244. }
  6245. }
  6246. if (backDialogID != -1 && anInt886 != anInt1039) {
  6247. inputTaken = true;
  6248. anInt1039 = anInt886;
  6249. }
  6250. if (backDialogID != -1 && anInt1315 != anInt1500) {
  6251. inputTaken = true;
  6252. anInt1500 = anInt1315;
  6253. }
  6254. /* Enable custom right click areas */
  6255. if(super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 && super.mouseY < 503)
  6256. rightClickChatButtons();
  6257. /**/
  6258. boolean flag = false;
  6259. while (!flag) {
  6260. flag = true;
  6261. for (int j = 0; j < menuActionRow - 1; j++) {
  6262. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  6263. String s = menuActionName[j];
  6264. menuActionName[j] = menuActionName[j + 1];
  6265. menuActionName[j + 1] = s;
  6266. int k = menuActionID[j];
  6267. menuActionID[j] = menuActionID[j + 1];
  6268. menuActionID[j + 1] = k;
  6269. k = menuActionCmd2[j];
  6270. menuActionCmd2[j] = menuActionCmd2[j + 1];
  6271. menuActionCmd2[j + 1] = k;
  6272. k = menuActionCmd3[j];
  6273. menuActionCmd3[j] = menuActionCmd3[j + 1];
  6274. menuActionCmd3[j + 1] = k;
  6275. k = menuActionCmd1[j];
  6276. menuActionCmd1[j] = menuActionCmd1[j + 1];
  6277. menuActionCmd1[j + 1] = k;
  6278. flag = false;
  6279. }
  6280. }
  6281. }
  6282. }
  6283.  
  6284. private int method83(int i, int j, int k)
  6285. {
  6286. int l = 256 - k;
  6287. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  6288. }
  6289.  
  6290. private void login(String s, String s1, boolean flag)
  6291. {
  6292. signlink.errorname = s;
  6293. try
  6294. {
  6295. if(!flag)
  6296. {
  6297. loginMessage1 = "";
  6298. loginMessage2 = "Connecting to server...";
  6299. drawLoginScreen(true);
  6300. }
  6301. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  6302. long l = TextClass.longForName(s);
  6303. int i = (int)(l >> 16 & 31L);
  6304. stream.currentOffset = 0;
  6305. stream.writeWordBigEndian(14);
  6306. stream.writeWordBigEndian(i);
  6307. socketStream.queueBytes(2, stream.buffer);
  6308. for(int j = 0; j < 8; j++)
  6309. socketStream.read();
  6310.  
  6311. int k = socketStream.read();
  6312. int i1 = k;
  6313. if(k == 0)
  6314. {
  6315. socketStream.flushInputStream(inStream.buffer, 8);
  6316. inStream.currentOffset = 0;
  6317. aLong1215 = inStream.readQWord();
  6318. int ai[] = new int[4];
  6319. ai[0] = (int)(Math.random() * 99999999D);
  6320. ai[1] = (int)(Math.random() * 99999999D);
  6321. ai[2] = (int)(aLong1215 >> 32);
  6322. ai[3] = (int)aLong1215;
  6323. stream.currentOffset = 0;
  6324. stream.writeWordBigEndian(10);
  6325. stream.writeDWord(ai[0]);
  6326. stream.writeDWord(ai[1]);
  6327. stream.writeDWord(ai[2]);
  6328. stream.writeDWord(ai[3]);
  6329. stream.writeDWord(/*signlink.uid*/999999);
  6330. stream.writeString(s);
  6331. stream.writeString(s1);
  6332. stream.doKeys();
  6333. aStream_847.currentOffset = 0;
  6334. if(flag)
  6335. aStream_847.writeWordBigEndian(18);
  6336. else
  6337. aStream_847.writeWordBigEndian(16);
  6338. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  6339. aStream_847.writeWordBigEndian(255);
  6340. aStream_847.writeWord(317);
  6341. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  6342. for(int l1 = 0; l1 < 9; l1++)
  6343. aStream_847.writeDWord(expectedCRCs[l1]);
  6344.  
  6345. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  6346. stream.encryption = new ISAACRandomGen(ai);
  6347. for(int j2 = 0; j2 < 4; j2++)
  6348. ai[j2] += 50;
  6349.  
  6350. encryption = new ISAACRandomGen(ai);
  6351. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  6352. k = socketStream.read();
  6353. }
  6354. if(k == 1)
  6355. {
  6356. try
  6357. {
  6358. Thread.sleep(2000L);
  6359. }
  6360. catch(Exception _ex) { }
  6361. login(s, s1, flag);
  6362. return;
  6363. }
  6364. if(k == 2)
  6365. {
  6366. myPrivilege = socketStream.read();
  6367. flagged = socketStream.read() == 1;
  6368. aLong1220 = 0L;
  6369. anInt1022 = 0;
  6370. mouseDetection.coordsIndex = 0;
  6371. super.awtFocus = true;
  6372. aBoolean954 = true;
  6373. loggedIn = true;
  6374. stream.currentOffset = 0;
  6375. inStream.currentOffset = 0;
  6376. pktType = -1;
  6377. anInt841 = -1;
  6378. anInt842 = -1;
  6379. anInt843 = -1;
  6380. pktSize = 0;
  6381. anInt1009 = 0;
  6382. anInt1104 = 0;
  6383. anInt1011 = 0;
  6384. anInt855 = 0;
  6385. menuActionRow = 0;
  6386. menuOpen = false;
  6387. super.idleTime = 0;
  6388. for(int j1 = 0; j1 < 100; j1++)
  6389. chatMessages[j1] = null;
  6390.  
  6391. itemSelected = 0;
  6392. spellSelected = 0;
  6393. loadingStage = 0;
  6394. anInt1062 = 0;
  6395. anInt1278 = (int)(Math.random() * 100D) - 50;
  6396. anInt1131 = (int)(Math.random() * 110D) - 55;
  6397. anInt896 = (int)(Math.random() * 80D) - 40;
  6398. minimapInt2 = (int)(Math.random() * 120D) - 60;
  6399. minimapInt3 = (int)(Math.random() * 30D) - 20;
  6400. minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
  6401. anInt1021 = 0;
  6402. anInt985 = -1;
  6403. destX = 0;
  6404. destY = 0;
  6405. playerCount = 0;
  6406. npcCount = 0;
  6407. for(int i2 = 0; i2 < maxPlayers; i2++)
  6408. {
  6409. playerArray[i2] = null;
  6410. aStreamArray895s[i2] = null;
  6411. }
  6412.  
  6413. for(int k2 = 0; k2 < 16384; k2++)
  6414. npcArray[k2] = null;
  6415.  
  6416. myPlayer = playerArray[myPlayerIndex] = new Player();
  6417. aClass19_1013.removeAll();
  6418. aClass19_1056.removeAll();
  6419. for(int l2 = 0; l2 < 4; l2++)
  6420. {
  6421. for(int i3 = 0; i3 < 104; i3++)
  6422. {
  6423. for(int k3 = 0; k3 < 104; k3++)
  6424. groundArray[l2][i3][k3] = null;
  6425.  
  6426. }
  6427.  
  6428. }
  6429.  
  6430. aClass19_1179 = new NodeList();
  6431. fullscreenInterfaceID = -1;
  6432. anInt900 = 0;
  6433. friendsCount = 0;
  6434. dialogID = -1;
  6435. backDialogID = -1;
  6436. openInterfaceID = -1;
  6437. invOverlayInterfaceID = -1;
  6438. anInt1018 = -1;
  6439. aBoolean1149 = false;
  6440. tabID = 3;
  6441. inputDialogState = 0;
  6442. menuOpen = false;
  6443. messagePromptRaised = false;
  6444. aString844 = null;
  6445. anInt1055 = 0;
  6446. anInt1054 = -1;
  6447. aBoolean1047 = true;
  6448. method45();
  6449. for(int j3 = 0; j3 < 5; j3++)
  6450. anIntArray990[j3] = 0;
  6451.  
  6452. for(int l3 = 0; l3 < 5; l3++)
  6453. {
  6454. atPlayerActions[l3] = null;
  6455. atPlayerArray[l3] = false;
  6456. }
  6457.  
  6458. anInt1175 = 0;
  6459. anInt1134 = 0;
  6460. anInt986 = 0;
  6461. anInt1288 = 0;
  6462. anInt924 = 0;
  6463. anInt1188 = 0;
  6464. anInt1155 = 0;
  6465. anInt1226 = 0;
  6466. int anInt941 = 0;
  6467. int anInt1260 = 0;
  6468. resetImageProducers2();
  6469. return;
  6470. }
  6471. if(k == 3)
  6472. {
  6473. loginMessage1 = "";
  6474. loginMessage2 = "Invalid username or password.";
  6475. return;
  6476. }
  6477. if(k == 4)
  6478. {
  6479. loginMessage1 = "Your account has been disabled.";
  6480. loginMessage2 = "Please check your message-center for details.";
  6481. return;
  6482. }
  6483. if(k == 5)
  6484. {
  6485. loginMessage1 = "Your account is already logged in.";
  6486. loginMessage2 = "Try again in 60 secs...";
  6487. return;
  6488. }
  6489. if(k == 6)
  6490. {
  6491. loginMessage1 = "Project Insanity has been updated!";
  6492. loginMessage2 = "Please reload this page.";
  6493. return;
  6494. }
  6495. if(k == 7)
  6496. {
  6497. loginMessage1 = "This world is full.";
  6498. loginMessage2 = "Please use a different world.";
  6499. return;
  6500. }
  6501. if(k == 8)
  6502. {
  6503. loginMessage1 = "Unable to connect.";
  6504. loginMessage2 = "Login server offline.";
  6505. return;
  6506. }
  6507. if(k == 9)
  6508. {
  6509. loginMessage1 = "Login limit exceeded.";
  6510. loginMessage2 = "Too many connections from your address.";
  6511. return;
  6512. }
  6513. if(k == 10)
  6514. {
  6515. loginMessage1 = "Unable to connect.";
  6516. loginMessage2 = "Bad session id.";
  6517. return;
  6518. }
  6519. if(k == 11)
  6520. {
  6521. loginMessage2 = "Login server rejected session.";
  6522. loginMessage2 = "Please try again.";
  6523. return;
  6524. }
  6525. if(k == 12)
  6526. {
  6527. loginMessage1 = "You need a members account to login to this world.";
  6528. loginMessage2 = "Please subscribe, or use a different world.";
  6529. return;
  6530. }
  6531. if(k == 13)
  6532. {
  6533. loginMessage1 = "Could not complete login.";
  6534. loginMessage2 = "Please try using a different world.";
  6535. return;
  6536. }
  6537. if(k == 14)
  6538. {
  6539. loginMessage1 = "The server is being updated.";
  6540. loginMessage2 = "Please wait 1 minute and try again.";
  6541. return;
  6542. }
  6543. if(k == 15)
  6544. {
  6545. loggedIn = true;
  6546. stream.currentOffset = 0;
  6547. inStream.currentOffset = 0;
  6548. pktType = -1;
  6549. anInt841 = -1;
  6550. anInt842 = -1;
  6551. anInt843 = -1;
  6552. pktSize = 0;
  6553. anInt1009 = 0;
  6554. anInt1104 = 0;
  6555. menuActionRow = 0;
  6556. menuOpen = false;
  6557. aLong824 = System.currentTimeMillis();
  6558. return;
  6559. }
  6560. if(k == 16)
  6561. {
  6562. loginMessage1 = "Login attempts exceeded.";
  6563. loginMessage2 = "Please wait 1 minute and try again.";
  6564. return;
  6565. }
  6566. if(k == 17)
  6567. {
  6568. loginMessage1 = "You are standing in a members-only area.";
  6569. loginMessage2 = "To play on this world move to a free area first";
  6570. return;
  6571. }
  6572. if(k == 20)
  6573. {
  6574. loginMessage1 = "Invalid loginserver requested";
  6575. loginMessage2 = "Please try using a different world.";
  6576. return;
  6577. }
  6578. if(k == 21)
  6579. {
  6580. for(int k1 = socketStream.read(); k1 >= 0; k1--)
  6581. {
  6582. loginMessage1 = "You have only just left another world";
  6583. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  6584. drawLoginScreen(true);
  6585. try
  6586. {
  6587. Thread.sleep(1000L);
  6588. }
  6589. catch(Exception _ex) { }
  6590. }
  6591.  
  6592. login(s, s1, flag);
  6593. return;
  6594. }
  6595. if(k == -1)
  6596. {
  6597. if(i1 == 0)
  6598. {
  6599. if(loginFailures < 2)
  6600. {
  6601. try
  6602. {
  6603. Thread.sleep(2000L);
  6604. }
  6605. catch(Exception _ex) { }
  6606. loginFailures++;
  6607. login(s, s1, flag);
  6608. return;
  6609. } else
  6610. {
  6611. loginMessage1 = "No response from loginserver";
  6612. loginMessage2 = "Please wait 1 minute and try again.";
  6613. return;
  6614. }
  6615. } else
  6616. {
  6617. loginMessage1 = "No response from server";
  6618. loginMessage2 = "Please try using a different world.";
  6619. return;
  6620. }
  6621. } else
  6622. {
  6623. System.out.println("response:" + k);
  6624. loginMessage1 = "Unexpected server response";
  6625. loginMessage2 = "Please try using a different world.";
  6626. return;
  6627. }
  6628. }
  6629. catch(IOException _ex)
  6630. {
  6631. loginMessage1 = "";
  6632. }
  6633. loginMessage2 = "Error connecting to server.";
  6634. }
  6635.  
  6636. private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1, int l1, int i2, int j2, boolean flag, int k2) {
  6637. byte byte0 = 104;
  6638. byte byte1 = 104;
  6639. for(int l2 = 0; l2 < byte0; l2++) {
  6640. for(int i3 = 0; i3 < byte1; i3++) {
  6641. anIntArrayArray901[l2][i3] = 0;
  6642. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  6643. }
  6644. }
  6645. int j3 = j2;
  6646. int k3 = j1;
  6647. anIntArrayArray901[j2][j1] = 99;
  6648. anIntArrayArray825[j2][j1] = 0;
  6649. int l3 = 0;
  6650. int i4 = 0;
  6651. bigX[l3] = j2;
  6652. bigY[l3++] = j1;
  6653. boolean flag1 = false;
  6654. int j4 = bigX.length;
  6655. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  6656. while(i4 != l3)
  6657. {
  6658. j3 = bigX[i4];
  6659. k3 = bigY[i4];
  6660. i4 = (i4 + 1) % j4;
  6661. if(j3 == k2 && k3 == i2)
  6662. {
  6663. flag1 = true;
  6664. break;
  6665. }
  6666. if(i1 != 0)
  6667. {
  6668. if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  6669. {
  6670. flag1 = true;
  6671. break;
  6672. }
  6673. if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  6674. {
  6675. flag1 = true;
  6676. break;
  6677. }
  6678. }
  6679. if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  6680. {
  6681. flag1 = true;
  6682. break;
  6683. }
  6684. int l4 = anIntArrayArray825[j3][k3] + 1;
  6685. if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  6686. {
  6687. bigX[l3] = j3 - 1;
  6688. bigY[l3] = k3;
  6689. l3 = (l3 + 1) % j4;
  6690. anIntArrayArray901[j3 - 1][k3] = 2;
  6691. anIntArrayArray825[j3 - 1][k3] = l4;
  6692. }
  6693. if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  6694. {
  6695. bigX[l3] = j3 + 1;
  6696. bigY[l3] = k3;
  6697. l3 = (l3 + 1) % j4;
  6698. anIntArrayArray901[j3 + 1][k3] = 8;
  6699. anIntArrayArray825[j3 + 1][k3] = l4;
  6700. }
  6701. if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  6702. {
  6703. bigX[l3] = j3;
  6704. bigY[l3] = k3 - 1;
  6705. l3 = (l3 + 1) % j4;
  6706. anIntArrayArray901[j3][k3 - 1] = 1;
  6707. anIntArrayArray825[j3][k3 - 1] = l4;
  6708. }
  6709. if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  6710. {
  6711. bigX[l3] = j3;
  6712. bigY[l3] = k3 + 1;
  6713. l3 = (l3 + 1) % j4;
  6714. anIntArrayArray901[j3][k3 + 1] = 4;
  6715. anIntArrayArray825[j3][k3 + 1] = l4;
  6716. }
  6717. if(j3 > 0 && k3 > 0 && anIntArrayArray901[j3 - 1][k3 - 1] == 0 && (ai[j3 - 1][k3 - 1] & 0x128010e) == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  6718. {
  6719. bigX[l3] = j3 - 1;
  6720. bigY[l3] = k3 - 1;
  6721. l3 = (l3 + 1) % j4;
  6722. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  6723. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  6724. }
  6725. if(j3 < byte0 - 1 && k3 > 0 && anIntArrayArray901[j3 + 1][k3 - 1] == 0 && (ai[j3 + 1][k3 - 1] & 0x1280183) == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  6726. {
  6727. bigX[l3] = j3 + 1;
  6728. bigY[l3] = k3 - 1;
  6729. l3 = (l3 + 1) % j4;
  6730. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  6731. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  6732. }
  6733. if(j3 > 0 && k3 < byte1 - 1 && anIntArrayArray901[j3 - 1][k3 + 1] == 0 && (ai[j3 - 1][k3 + 1] & 0x1280138) == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  6734. {
  6735. bigX[l3] = j3 - 1;
  6736. bigY[l3] = k3 + 1;
  6737. l3 = (l3 + 1) % j4;
  6738. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  6739. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  6740. }
  6741. if(j3 < byte0 - 1 && k3 < byte1 - 1 && anIntArrayArray901[j3 + 1][k3 + 1] == 0 && (ai[j3 + 1][k3 + 1] & 0x12801e0) == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  6742. {
  6743. bigX[l3] = j3 + 1;
  6744. bigY[l3] = k3 + 1;
  6745. l3 = (l3 + 1) % j4;
  6746. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  6747. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  6748. }
  6749. }
  6750. anInt1264 = 0;
  6751. if(!flag1)
  6752. {
  6753. if(flag)
  6754. {
  6755. int i5 = 100;
  6756. for(int k5 = 1; k5 < 2; k5++)
  6757. {
  6758. for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  6759. {
  6760. for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  6761. if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  6762. {
  6763. i5 = anIntArrayArray825[i6][l6];
  6764. j3 = i6;
  6765. k3 = l6;
  6766. anInt1264 = 1;
  6767. flag1 = true;
  6768. }
  6769.  
  6770. }
  6771.  
  6772. if(flag1)
  6773. break;
  6774. }
  6775.  
  6776. }
  6777. if(!flag1)
  6778. return false;
  6779. }
  6780. i4 = 0;
  6781. bigX[i4] = j3;
  6782. bigY[i4++] = k3;
  6783. int l5;
  6784. for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  6785. {
  6786. if(j5 != l5)
  6787. {
  6788. l5 = j5;
  6789. bigX[i4] = j3;
  6790. bigY[i4++] = k3;
  6791. }
  6792. if((j5 & 2) != 0)
  6793. j3++;
  6794. else
  6795. if((j5 & 8) != 0)
  6796. j3--;
  6797. if((j5 & 1) != 0)
  6798. k3++;
  6799. else
  6800. if((j5 & 4) != 0)
  6801. k3--;
  6802. }
  6803. // if(cancelWalk) { return i4 > 0; }
  6804.  
  6805.  
  6806. if(i4 > 0)
  6807. {
  6808. int k4 = i4;
  6809. if(k4 > 25)
  6810. k4 = 25;
  6811. i4--;
  6812. int k6 = bigX[i4];
  6813. int i7 = bigY[i4];
  6814. anInt1288 += k4;
  6815. if(anInt1288 >= 92)
  6816. {
  6817. stream.createFrame(36);
  6818. stream.writeDWord(0);
  6819. anInt1288 = 0;
  6820. }
  6821. if(i == 0)
  6822. {
  6823. stream.createFrame(164);
  6824. stream.writeWordBigEndian(k4 + k4 + 3);
  6825. }
  6826. if(i == 1)
  6827. {
  6828. stream.createFrame(248);
  6829. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  6830. }
  6831. if(i == 2)
  6832. {
  6833. stream.createFrame(98);
  6834. stream.writeWordBigEndian(k4 + k4 + 3);
  6835. }
  6836. stream.method433(k6 + baseX);
  6837. destX = bigX[0];
  6838. destY = bigY[0];
  6839. for(int j7 = 1; j7 < k4; j7++)
  6840. {
  6841. i4--;
  6842. stream.writeWordBigEndian(bigX[i4] - k6);
  6843. stream.writeWordBigEndian(bigY[i4] - i7);
  6844. }
  6845.  
  6846. stream.method431(i7 + baseY);
  6847. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  6848. return true;
  6849. }
  6850. return i != 1;
  6851. }
  6852.  
  6853. private void method86(Stream stream)
  6854. {
  6855. for(int j = 0; j < anInt893; j++)
  6856. {
  6857. int k = anIntArray894[j];
  6858. NPC npc = npcArray[k];
  6859. int l = stream.readUnsignedByte();
  6860. if((l & 0x10) != 0)
  6861. {
  6862. int i1 = stream.method434();
  6863. if(i1 == 65535)
  6864. i1 = -1;
  6865. int i2 = stream.readUnsignedByte();
  6866. if(i1 == npc.anim && i1 != -1)
  6867. {
  6868. int l2 = Animation.anims[i1].anInt365;
  6869. if(l2 == 1)
  6870. {
  6871. npc.anInt1527 = 0;
  6872. npc.anInt1528 = 0;
  6873. npc.anInt1529 = i2;
  6874. npc.anInt1530 = 0;
  6875. }
  6876. if(l2 == 2)
  6877. npc.anInt1530 = 0;
  6878. } else
  6879. if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  6880. {
  6881. npc.anim = i1;
  6882. npc.anInt1527 = 0;
  6883. npc.anInt1528 = 0;
  6884. npc.anInt1529 = i2;
  6885. npc.anInt1530 = 0;
  6886. npc.anInt1542 = npc.smallXYIndex;
  6887. }
  6888. }
  6889. if((l & 8) != 0)
  6890. {
  6891. int j1 = stream.method426();
  6892. int j2 = stream.method427();
  6893. npc.updateHitData(j2, j1, loopCycle);
  6894. npc.loopCycleStatus = loopCycle + 300;
  6895. npc.currentHealth = stream.method426();
  6896. npc.maxHealth = stream.readUnsignedByte();
  6897. }
  6898. if((l & 0x80) != 0)
  6899. {
  6900. npc.anInt1520 = stream.readUnsignedWord();
  6901. int k1 = stream.readDWord();
  6902. npc.anInt1524 = k1 >> 16;
  6903. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  6904. npc.anInt1521 = 0;
  6905. npc.anInt1522 = 0;
  6906. if(npc.anInt1523 > loopCycle)
  6907. npc.anInt1521 = -1;
  6908. if(npc.anInt1520 == 65535)
  6909. npc.anInt1520 = -1;
  6910. }
  6911. if((l & 0x20) != 0)
  6912. {
  6913. npc.interactingEntity = stream.readUnsignedWord();
  6914. if(npc.interactingEntity == 65535)
  6915. npc.interactingEntity = -1;
  6916. }
  6917. if((l & 1) != 0)
  6918. {
  6919. npc.textSpoken = stream.readString();
  6920. npc.textCycle = 100;
  6921. // entityMessage(npc);
  6922.  
  6923. }
  6924. if((l & 0x40) != 0)
  6925. {
  6926. int l1 = stream.method427();
  6927. int k2 = stream.method428();
  6928. npc.updateHitData(k2, l1, loopCycle);
  6929. npc.loopCycleStatus = loopCycle + 300;
  6930. npc.currentHealth = stream.method428();
  6931. npc.maxHealth = stream.method427();
  6932. }
  6933. if((l & 2) != 0)
  6934. {
  6935. npc.desc = EntityDef.forID(stream.method436());
  6936. npc.anInt1540 = npc.desc.aByte68;
  6937. npc.anInt1504 = npc.desc.anInt79;
  6938. npc.anInt1554 = npc.desc.walkAnim;
  6939. npc.anInt1555 = npc.desc.anInt58;
  6940. npc.anInt1556 = npc.desc.anInt83;
  6941. npc.anInt1557 = npc.desc.anInt55;
  6942. npc.anInt1511 = npc.desc.standAnim;
  6943. }
  6944. if((l & 4) != 0)
  6945. {
  6946. npc.anInt1538 = stream.method434();
  6947. npc.anInt1539 = stream.method434();
  6948. }
  6949. }
  6950. }
  6951.  
  6952. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  6953. {
  6954. if(menuActionRow >= 400)
  6955. return;
  6956. if(entityDef.childrenIDs != null)
  6957. entityDef = entityDef.method161();
  6958. if(entityDef == null)
  6959. return;
  6960. if(!entityDef.aBoolean84)
  6961. return;
  6962. String s = entityDef.name;
  6963. if(entityDef.combatLevel != 0)
  6964. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  6965. if(itemSelected == 1)
  6966. {
  6967. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  6968. menuActionID[menuActionRow] = 582;
  6969. menuActionCmd1[menuActionRow] = i;
  6970. menuActionCmd2[menuActionRow] = k;
  6971. menuActionCmd3[menuActionRow] = j;
  6972. menuActionRow++;
  6973. return;
  6974. }
  6975. if(spellSelected == 1)
  6976. {
  6977. if((spellUsableOn & 2) == 2)
  6978. {
  6979. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  6980. menuActionID[menuActionRow] = 413;
  6981. menuActionCmd1[menuActionRow] = i;
  6982. menuActionCmd2[menuActionRow] = k;
  6983. menuActionCmd3[menuActionRow] = j;
  6984. menuActionRow++;
  6985. }
  6986. } else
  6987. {
  6988. if(entityDef.actions != null)
  6989. {
  6990. for(int l = 4; l >= 0; l--)
  6991. if(entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack"))
  6992. {
  6993. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  6994. if(l == 0)
  6995. menuActionID[menuActionRow] = 20;
  6996. if(l == 1)
  6997. menuActionID[menuActionRow] = 412;
  6998. if(l == 2)
  6999. menuActionID[menuActionRow] = 225;
  7000. if(l == 3)
  7001. menuActionID[menuActionRow] = 965;
  7002. if(l == 4)
  7003. menuActionID[menuActionRow] = 478;
  7004. menuActionCmd1[menuActionRow] = i;
  7005. menuActionCmd2[menuActionRow] = k;
  7006. menuActionCmd3[menuActionRow] = j;
  7007. menuActionRow++;
  7008. }
  7009.  
  7010. }
  7011. if(entityDef.actions != null)
  7012. {
  7013. for(int i1 = 4; i1 >= 0; i1--)
  7014. if(entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack"))
  7015. {
  7016. char c = '\0';
  7017. if(entityDef.combatLevel > myPlayer.combatLevel)
  7018. c = '\u07D0';
  7019. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  7020. if(i1 == 0)
  7021. menuActionID[menuActionRow] = 20 + c;
  7022. if(i1 == 1)
  7023. menuActionID[menuActionRow] = 412 + c;
  7024. if(i1 == 2)
  7025. menuActionID[menuActionRow] = 225 + c;
  7026. if(i1 == 3)
  7027. menuActionID[menuActionRow] = 965 + c;
  7028. if(i1 == 4)
  7029. menuActionID[menuActionRow] = 478 + c;
  7030. menuActionCmd1[menuActionRow] = i;
  7031. menuActionCmd2[menuActionRow] = k;
  7032. menuActionCmd3[menuActionRow] = j;
  7033. menuActionRow++;
  7034. }
  7035.  
  7036. }
  7037. //menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.type + "@gre@)";
  7038. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7039. menuActionID[menuActionRow] = 1025;
  7040. menuActionCmd1[menuActionRow] = i;
  7041. menuActionCmd2[menuActionRow] = k;
  7042. menuActionCmd3[menuActionRow] = j;
  7043. menuActionRow++;
  7044. }
  7045. }
  7046.  
  7047. private void buildAtPlayerMenu(int i, int j, Player player, int k)
  7048. {
  7049. if(player == myPlayer)
  7050. return;
  7051. if(menuActionRow >= 400)
  7052. return;
  7053. String s;
  7054. if(player.skill == 0)
  7055. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  7056. else
  7057. s = player.name + " (skill-" + player.skill + ")";
  7058. if(itemSelected == 1)
  7059. {
  7060. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
  7061. menuActionID[menuActionRow] = 491;
  7062. menuActionCmd1[menuActionRow] = j;
  7063. menuActionCmd2[menuActionRow] = i;
  7064. menuActionCmd3[menuActionRow] = k;
  7065. menuActionRow++;
  7066. } else
  7067. if(spellSelected == 1)
  7068. {
  7069. if((spellUsableOn & 8) == 8)
  7070. {
  7071. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  7072. menuActionID[menuActionRow] = 365;
  7073. menuActionCmd1[menuActionRow] = j;
  7074. menuActionCmd2[menuActionRow] = i;
  7075. menuActionCmd3[menuActionRow] = k;
  7076. menuActionRow++;
  7077. }
  7078. } else
  7079. {
  7080. for(int l = 4; l >= 0; l--)
  7081. if(atPlayerActions[l] != null)
  7082. {
  7083. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  7084. char c = '\0';
  7085. if(atPlayerActions[l].equalsIgnoreCase("attack"))
  7086. {
  7087. if(player.combatLevel > myPlayer.combatLevel)
  7088. c = '\u07D0';
  7089. if(myPlayer.team != 0 && player.team != 0)
  7090. if(myPlayer.team == player.team)
  7091. c = '\u07D0';
  7092. else
  7093. c = '\0';
  7094. } else
  7095. if(atPlayerArray[l])
  7096. c = '\u07D0';
  7097. if(l == 0)
  7098. menuActionID[menuActionRow] = 561 + c;
  7099. if(l == 1)
  7100. menuActionID[menuActionRow] = 779 + c;
  7101. if(l == 2)
  7102. menuActionID[menuActionRow] = 27 + c;
  7103. if(l == 3)
  7104. menuActionID[menuActionRow] = 577 + c;
  7105. if(l == 4)
  7106. menuActionID[menuActionRow] = 729 + c;
  7107. menuActionCmd1[menuActionRow] = j;
  7108. menuActionCmd2[menuActionRow] = i;
  7109. menuActionCmd3[menuActionRow] = k;
  7110. menuActionRow++;
  7111. }
  7112.  
  7113. }
  7114. for(int i1 = 0; i1 < menuActionRow; i1++)
  7115. if(menuActionID[i1] == 516)
  7116. {
  7117. menuActionName[i1] = "Walk here @whi@" + s;
  7118. return;
  7119. }
  7120.  
  7121. }
  7122.  
  7123. private void method89(Class30_Sub1 class30_sub1)
  7124. {
  7125. int i = 0;
  7126. int j = -1;
  7127. int k = 0;
  7128. int l = 0;
  7129. if(class30_sub1.anInt1296 == 0)
  7130. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7131. if(class30_sub1.anInt1296 == 1)
  7132. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7133. if(class30_sub1.anInt1296 == 2)
  7134. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7135. if(class30_sub1.anInt1296 == 3)
  7136. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7137. if(i != 0)
  7138. {
  7139. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7140. j = i >> 14 & 0x7fff;
  7141. k = i1 & 0x1f;
  7142. l = i1 >> 6;
  7143. }
  7144. class30_sub1.anInt1299 = j;
  7145. class30_sub1.anInt1301 = k;
  7146. class30_sub1.anInt1300 = l;
  7147. }
  7148.  
  7149. private void method90()
  7150. {
  7151. for(int i = 0; i < anInt1062; i++)
  7152. if(anIntArray1250[i] <= 0)
  7153. {
  7154. boolean flag1 = false;
  7155. try
  7156. {
  7157. if(anIntArray1207[i] == anInt874 && anIntArray1241[i] == anInt1289)
  7158. {
  7159. if(!replayWave())
  7160. flag1 = true;
  7161. } else
  7162. {
  7163. Stream stream = Sounds.method241(anIntArray1241[i], anIntArray1207[i]);
  7164. if(System.currentTimeMillis() + (long)(stream.currentOffset / 22) > aLong1172 + (long)(anInt1257 / 22))
  7165. {
  7166. anInt1257 = stream.currentOffset;
  7167. aLong1172 = System.currentTimeMillis();
  7168. if(saveWave(stream.buffer, stream.currentOffset))
  7169. {
  7170. anInt874 = anIntArray1207[i];
  7171. anInt1289 = anIntArray1241[i];
  7172. } else
  7173. {
  7174. flag1 = true;
  7175. }
  7176. }
  7177. }
  7178. }
  7179. catch(Exception exception) { }
  7180. if(!flag1 || anIntArray1250[i] == -5)
  7181. {
  7182. anInt1062--;
  7183. for(int j = i; j < anInt1062; j++)
  7184. {
  7185. anIntArray1207[j] = anIntArray1207[j + 1];
  7186. anIntArray1241[j] = anIntArray1241[j + 1];
  7187. anIntArray1250[j] = anIntArray1250[j + 1];
  7188. }
  7189.  
  7190. i--;
  7191. } else
  7192. {
  7193. anIntArray1250[i] = -5;
  7194. }
  7195. } else
  7196. {
  7197. anIntArray1250[i]--;
  7198. }
  7199.  
  7200. if(prevSong > 0)
  7201. {
  7202. prevSong -= 20;
  7203. if(prevSong < 0)
  7204. prevSong = 0;
  7205. if(prevSong == 0 && musicEnabled && !lowMem)
  7206. {
  7207. nextSong = currentSong;
  7208. songChanging = true;
  7209. onDemandFetcher.method558(2, nextSong);
  7210. }
  7211. }
  7212. }
  7213.  
  7214. void startUp()
  7215. {
  7216. drawLoadingText(20, "Starting up");
  7217. if(signlink.sunjava)
  7218. super.minDelay = 5;
  7219. if(aBoolean993)
  7220. {
  7221. // rsAlreadyLoaded = true;
  7222. // return;
  7223. }
  7224. aBoolean993 = true;
  7225. boolean flag = true;
  7226. String s = getDocumentBaseHost();
  7227. if(signlink.cache_dat != null)
  7228. {
  7229. for(int i = 0; i < 5; i++)
  7230. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  7231. } try {
  7232. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  7233. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  7234. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  7235. chatTextDrawingArea = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  7236. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  7237. drawLogo();
  7238. loadTitleScreen();
  7239. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  7240. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  7241. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  7242. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  7243. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  7244. StreamLoader streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  7245. byteGroundArray = new byte[4][104][104];
  7246. intGroundArray = new int[4][105][105];
  7247. worldController = new WorldController(intGroundArray);
  7248. for(int j = 0; j < 4; j++)
  7249. aClass11Array1230[j] = new Class11();
  7250.  
  7251. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  7252. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  7253. drawLoadingText(60, "Connecting to update server");
  7254. onDemandFetcher = new OnDemandFetcher();
  7255. onDemandFetcher.start(streamLoader_6, this);
  7256. Class36.method528(onDemandFetcher.getAnimCount());
  7257. Model.method459(onDemandFetcher.getVersionCount(0), onDemandFetcher);
  7258. ModelDecompressor.loadModels();
  7259.  
  7260. ModelDecompressor.loadModels2();
  7261. preloadModels();
  7262. if(!lowMem)
  7263. {
  7264. nextSong = 0;
  7265. try
  7266. {
  7267. nextSong = Integer.parseInt(getParameter("music"));
  7268. }
  7269. catch(Exception _ex) { }
  7270. songChanging = true;
  7271. onDemandFetcher.method558(2, nextSong);
  7272. while(onDemandFetcher.getNodeCount() > 0)
  7273. {
  7274. processOnDemandQueue();
  7275. try
  7276. {
  7277. Thread.sleep(100L);
  7278. }
  7279. catch(Exception _ex) { }
  7280. if(onDemandFetcher.anInt1349 > 3)
  7281. {
  7282. loadError();
  7283. return;
  7284. }
  7285. }
  7286. }
  7287. drawLoadingText(65, "Requesting animations");
  7288. int k = onDemandFetcher.getVersionCount(1);
  7289. for(int i1 = 0; i1 < k; i1++)
  7290. onDemandFetcher.method558(1, i1);
  7291.  
  7292. while(onDemandFetcher.getNodeCount() > 0)
  7293. {
  7294. int j1 = k - onDemandFetcher.getNodeCount();
  7295. if(j1 > 0)
  7296. drawLoadingText(65, "Loading animations - " + (j1 * 100) / k + "%");
  7297. processOnDemandQueue();
  7298. try
  7299. {
  7300. Thread.sleep(100L);
  7301. }
  7302. catch(Exception _ex) { }
  7303. if(onDemandFetcher.anInt1349 > 3)
  7304. {
  7305. loadError();
  7306. return;
  7307. }
  7308. }
  7309. drawLoadingText(70, "Requesting models");
  7310. k = onDemandFetcher.getVersionCount(0);
  7311. for(int k1 = 0; k1 < k; k1++)
  7312. {
  7313. int l1 = onDemandFetcher.getModelIndex(k1);
  7314. if((l1 & 1) != 0)
  7315. onDemandFetcher.method558(0, k1);
  7316. }
  7317.  
  7318. k = onDemandFetcher.getNodeCount();
  7319. while(onDemandFetcher.getNodeCount() > 0)
  7320. {
  7321. int i2 = k - onDemandFetcher.getNodeCount();
  7322. if(i2 > 0)
  7323. drawLoadingText(70, "Loading models - " + (i2 * 100) / k + "%");
  7324. processOnDemandQueue();
  7325. try
  7326. {
  7327. Thread.sleep(100L);
  7328. }
  7329. catch(Exception _ex) { }
  7330. }
  7331. if(decompressors[0] != null)
  7332. {
  7333. drawLoadingText(75, "Requesting maps");
  7334. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 47));
  7335. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 47));
  7336. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 48));
  7337. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 48));
  7338. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 49));
  7339. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 49));
  7340. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 47));
  7341. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 47));
  7342. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 48));
  7343. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 48));
  7344. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 148, 48));
  7345. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 148, 48));
  7346. k = onDemandFetcher.getNodeCount();
  7347. while(onDemandFetcher.getNodeCount() > 0)
  7348. {
  7349. int j2 = k - onDemandFetcher.getNodeCount();
  7350. if(j2 > 0)
  7351. drawLoadingText(75, "Loading maps - " + (j2 * 100) / k + "%");
  7352. processOnDemandQueue();
  7353. try
  7354. {
  7355. Thread.sleep(100L);
  7356. }
  7357. catch(Exception _ex) { }
  7358. }
  7359. }
  7360. k = onDemandFetcher.getVersionCount(0);
  7361. for(int k2 = 0; k2 < k; k2++)
  7362. {
  7363. int l2 = onDemandFetcher.getModelIndex(k2);
  7364. byte byte0 = 0;
  7365. if((l2 & 8) != 0)
  7366. byte0 = 10;
  7367. else
  7368. if((l2 & 0x20) != 0)
  7369. byte0 = 9;
  7370. else
  7371. if((l2 & 0x10) != 0)
  7372. byte0 = 8;
  7373. else
  7374. if((l2 & 0x40) != 0)
  7375. byte0 = 7;
  7376. else
  7377. if((l2 & 0x80) != 0)
  7378. byte0 = 6;
  7379. else
  7380. if((l2 & 2) != 0)
  7381. byte0 = 5;
  7382. else
  7383. if((l2 & 4) != 0)
  7384. byte0 = 4;
  7385. if((l2 & 1) != 0)
  7386. byte0 = 3;
  7387. if(byte0 != 0)
  7388. onDemandFetcher.method563(byte0, 0, k2);
  7389. }
  7390.  
  7391. onDemandFetcher.method554(isMembers);
  7392. if(!lowMem)
  7393. {
  7394. int l = onDemandFetcher.getVersionCount(2);
  7395. for(int i3 = 1; i3 < l; i3++)
  7396. if(onDemandFetcher.method569(i3))
  7397. onDemandFetcher.method563((byte)1, 2, i3);
  7398.  
  7399. }
  7400. drawLoadingText(80, "Unpacking media");
  7401. /* Custom sprite unpacking */
  7402. chatArea = new Sprite("chatarea");
  7403. tabArea = new Sprite("tabarea");
  7404. mapArea = new Sprite("maparea");
  7405. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  7406. /**/
  7407. mapBack = new Background(streamLoader_2, "mapback", 0);
  7408. for(int c1 = 0; c1 <= 3; c1++)
  7409. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  7410. for(int j3 = 0; j3 <= 14; j3++)
  7411. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  7412. for(int r1 = 0; r1 < 5; r1++)
  7413. redStones[r1] = new Sprite("redstones " + r1);
  7414. compass = new Sprite(streamLoader_2, "compass", 0);
  7415. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  7416. mapEdge.method345();
  7417. try
  7418. {
  7419. for(int k3 = 0; k3 < 100; k3++)
  7420. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  7421. }
  7422. catch(Exception _ex) { }
  7423. try
  7424. {
  7425. for(int l3 = 0; l3 < 100; l3++)
  7426. mapFunctions[l3] = new Sprite(streamLoader_2, "mapfunction", l3);
  7427. }
  7428. catch(Exception _ex) { }
  7429. try
  7430. {
  7431. for(int i4 = 0; i4 < 20; i4++)
  7432. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  7433. }
  7434. catch(Exception _ex) { }
  7435. try
  7436. {
  7437. for(int h1 = 0; h1 < 6; h1++)
  7438. headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
  7439. } catch(Exception _ex) { }
  7440. try {
  7441. for(int j4 = 0; j4 < 8; j4++)
  7442. headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);
  7443. for(int j45 = 0; j45 < 3; j45++)
  7444. skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45 );
  7445. }
  7446. catch(Exception _ex) { }
  7447. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  7448. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  7449. for(int k4 = 0; k4 < 8; k4++)
  7450. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  7451.  
  7452. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  7453. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  7454. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  7455. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  7456. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  7457. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  7458. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  7459. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  7460.  
  7461. for(int l4 = 0; l4 < 2; l4++)
  7462. modIcons[l4] = new Background(streamLoader_2, "mod_icons", l4);
  7463.  
  7464. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  7465. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7466. sprite.method346(0, 0);
  7467. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  7468. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7469. sprite.method346(0, 0);
  7470. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  7471. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7472. sprite.method346(0, 0);
  7473. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  7474. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7475. sprite.method346(0, 0);
  7476.  
  7477. int i5 = (int)(Math.random() * 21D) - 10;
  7478. int j5 = (int)(Math.random() * 21D) - 10;
  7479. int k5 = (int)(Math.random() * 21D) - 10;
  7480. int l5 = (int)(Math.random() * 41D) - 20;
  7481. for(int i6 = 0; i6 < 100; i6++)
  7482. {
  7483. if(mapFunctions[i6] != null)
  7484. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  7485. if(mapScenes[i6] != null)
  7486. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  7487. }
  7488.  
  7489. drawLoadingText(83, "Unpacking textures");
  7490. Texture.method368(streamLoader_3);
  7491. Texture.method372(0.80000000000000004D);
  7492. Texture.method367();
  7493. drawLoadingText(86, "Unpacking config");
  7494. Animation.unpackConfig(streamLoader);
  7495. ObjectDef.unpackConfig(streamLoader);
  7496. Flo.unpackConfig(streamLoader);
  7497. ItemDef.unpackConfig(streamLoader);
  7498. EntityDef.unpackConfig(streamLoader);
  7499. IDK.unpackConfig(streamLoader);
  7500. SpotAnim.unpackConfig(streamLoader);
  7501. Varp.unpackConfig(streamLoader);
  7502. VarBit.unpackConfig(streamLoader);
  7503. ItemDef.isMembers = isMembers;
  7504. if(!lowMem)
  7505. {
  7506. drawLoadingText(90, "Unpacking sounds");
  7507. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  7508. Stream stream = new Stream(abyte0);
  7509. Sounds.unpack(stream);
  7510. }
  7511. drawLoadingText(95, "Unpacking interfaces");
  7512. TextDrawingArea aclass30_sub2_sub1_sub4s[] = {
  7513. smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  7514. };
  7515. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  7516. drawLoadingText(100, "Preparing game engine");
  7517. for(int j6 = 0; j6 < 33; j6++)
  7518. {
  7519. int k6 = 999;
  7520. int i7 = 0;
  7521. for(int k7 = 0; k7 < 34; k7++)
  7522. {
  7523. if(mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0)
  7524. {
  7525. if(k6 == 999)
  7526. k6 = k7;
  7527. continue;
  7528. }
  7529. if(k6 == 999)
  7530. continue;
  7531. i7 = k7;
  7532. break;
  7533. }
  7534.  
  7535. anIntArray968[j6] = k6;
  7536. anIntArray1057[j6] = i7 - k6;
  7537. }
  7538.  
  7539. for(int l6 = 5; l6 < 156; l6++)
  7540. {
  7541. int j7 = 999;
  7542. int l7 = 0;
  7543. for(int j8 = 25; j8 < 172; j8++)
  7544. {
  7545. if(mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34))
  7546. {
  7547. if(j7 == 999)
  7548. j7 = j8;
  7549. continue;
  7550. }
  7551. if(j7 == 999)
  7552. continue;
  7553. l7 = j8;
  7554. break;
  7555. }
  7556.  
  7557. anIntArray1052[l6 - 5] = j7 - 25;
  7558. anIntArray1229[l6 - 5] = l7 - j7;
  7559. }
  7560.  
  7561. Texture.method365(765, 503);
  7562. fullScreenTextureArray = Texture.anIntArray1472;
  7563. Texture.method365(519, 165);
  7564. anIntArray1180 = Texture.anIntArray1472;
  7565. Texture.method365(246, 335);
  7566. anIntArray1181 = Texture.anIntArray1472;
  7567. Texture.method365(512, 334);
  7568. anIntArray1182 = Texture.anIntArray1472;
  7569. int ai[] = new int[9];
  7570. for(int i8 = 0; i8 < 9; i8++)
  7571. {
  7572. int k8 = 128 + i8 * 32 + 15;
  7573. int l8 = 600 + k8 * 3;
  7574. int i9 = Texture.anIntArray1470[k8];
  7575. ai[i8] = l8 * i9 >> 16;
  7576. }
  7577.  
  7578. WorldController.method310(500, 800, 512, 334, ai);
  7579. Censor.loadConfig(streamLoader_4);
  7580. mouseDetection = new MouseDetection(this);
  7581. startRunnable(mouseDetection, 10);
  7582. Animable_Sub5.clientInstance = this;
  7583. ObjectDef.clientInstance = this;
  7584. EntityDef.clientInstance = this;
  7585. return;
  7586. }
  7587. catch(Exception exception)
  7588. {
  7589. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  7590. }
  7591. loadingError = true;
  7592. }
  7593.  
  7594. private void method91(Stream stream, int i)
  7595. {
  7596. while(stream.bitPosition + 10 < i * 8)
  7597. {
  7598. int j = stream.readBits(11);
  7599. if(j == 2047)
  7600. break;
  7601. if(playerArray[j] == null)
  7602. {
  7603. playerArray[j] = new Player();
  7604. if(aStreamArray895s[j] != null)
  7605. playerArray[j].updatePlayer(aStreamArray895s[j]);
  7606. }
  7607. playerIndices[playerCount++] = j;
  7608. Player player = playerArray[j];
  7609. player.anInt1537 = loopCycle;
  7610. int k = stream.readBits(1);
  7611. if(k == 1)
  7612. anIntArray894[anInt893++] = j;
  7613. int l = stream.readBits(1);
  7614. int i1 = stream.readBits(5);
  7615. if(i1 > 15)
  7616. i1 -= 32;
  7617. int j1 = stream.readBits(5);
  7618. if(j1 > 15)
  7619. j1 -= 32;
  7620. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  7621. }
  7622. stream.finishBitAccess();
  7623. }
  7624.  
  7625. private void processMainScreenClick() {
  7626. if(anInt1021 != 0)
  7627. return;
  7628. if(super.clickMode3 == 1) {
  7629. int i = super.saveClickX - 25 - 545;
  7630. int j = super.saveClickY - 5 - 4;
  7631. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  7632. i -= 73;
  7633. j -= 75;
  7634. int k = minimapInt1 + minimapInt2 & 0x7ff;
  7635. int i1 = Texture.anIntArray1470[k];
  7636. int j1 = Texture.anIntArray1471[k];
  7637. i1 = i1 * (minimapInt3 + 256) >> 8;
  7638. j1 = j1 * (minimapInt3 + 256) >> 8;
  7639. int k1 = j * i1 + i * j1 >> 11;
  7640. int l1 = j * j1 - i * i1 >> 11;
  7641. int i2 = myPlayer.x + k1 >> 7;
  7642. int j2 = myPlayer.y - l1 >> 7;
  7643. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  7644. if(flag1) {
  7645. stream.writeWordBigEndian(i);
  7646. stream.writeWordBigEndian(j);
  7647. stream.writeWord(minimapInt1);
  7648. stream.writeWordBigEndian(57);
  7649. stream.writeWordBigEndian(minimapInt2);
  7650. stream.writeWordBigEndian(minimapInt3);
  7651. stream.writeWordBigEndian(89);
  7652. stream.writeWord(myPlayer.x);
  7653. stream.writeWord(myPlayer.y);
  7654. stream.writeWordBigEndian(anInt1264);
  7655. stream.writeWordBigEndian(63);
  7656. }
  7657. }
  7658. anInt1117++;
  7659. if(anInt1117 > 1151) {
  7660. anInt1117 = 0;
  7661. stream.createFrame(246);
  7662. stream.writeWordBigEndian(0);
  7663. int l = stream.currentOffset;
  7664. if((int)(Math.random() * 2D) == 0)
  7665. stream.writeWordBigEndian(101);
  7666. stream.writeWordBigEndian(197);
  7667. stream.writeWord((int)(Math.random() * 65536D));
  7668. stream.writeWordBigEndian((int)(Math.random() * 256D));
  7669. stream.writeWordBigEndian(67);
  7670. stream.writeWord(14214);
  7671. if((int)(Math.random() * 2D) == 0)
  7672. stream.writeWord(29487);
  7673. stream.writeWord((int)(Math.random() * 65536D));
  7674. if((int)(Math.random() * 2D) == 0)
  7675. stream.writeWordBigEndian(220);
  7676. stream.writeWordBigEndian(180);
  7677. stream.writeBytes(stream.currentOffset - l);
  7678. }
  7679. }
  7680. }
  7681.  
  7682. private String interfaceIntToString(int j) {
  7683. if(j < 0x3b9ac9ff)
  7684. return String.valueOf(j);
  7685. else
  7686. return "*";
  7687. }
  7688.  
  7689. private void showErrorScreen()
  7690. {
  7691. Graphics g = getGameComponent().getGraphics();
  7692. g.setColor(Color.black);
  7693. g.fillRect(0, 0, 765, 503);
  7694. method4(1);
  7695. if(loadingError)
  7696. {
  7697. aBoolean831 = false;
  7698. g.setFont(new Font("Helvetica", 1, 16));
  7699. g.setColor(Color.yellow);
  7700. int k = 35;
  7701. g.drawString("Sorry, an error has occured whilst loading Project Insanity", 30, k);
  7702. k += 50;
  7703. g.setColor(Color.white);
  7704. g.drawString("To fix this try the following (in order):", 30, k);
  7705. k += 50;
  7706. g.setColor(Color.white);
  7707. g.setFont(new Font("Helvetica", 1, 12));
  7708. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  7709. k += 30;
  7710. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  7711. k += 30;
  7712. g.drawString("3: Try using a different game-world", 30, k);
  7713. k += 30;
  7714. g.drawString("4: Try rebooting your computer", 30, k);
  7715. k += 30;
  7716. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  7717. }
  7718. if(genericLoadingError)
  7719. {
  7720. aBoolean831 = false;
  7721. g.setFont(new Font("Helvetica", 1, 20));
  7722. g.setColor(Color.white);
  7723. g.drawString("Error - unable to load game!", 50, 50);
  7724. g.drawString("To play Project Insanity make sure you play from", 50, 100);
  7725. g.drawString("http://www.Project Insanity.com", 50, 150);
  7726. }
  7727. if(rsAlreadyLoaded)
  7728. {
  7729. aBoolean831 = false;
  7730. g.setColor(Color.yellow);
  7731. int l = 35;
  7732. g.drawString("Error a copy of Project Insanity already appears to be loaded", 30, l);
  7733. l += 50;
  7734. g.setColor(Color.white);
  7735. g.drawString("To fix this try the following (in order):", 30, l);
  7736. l += 50;
  7737. g.setColor(Color.white);
  7738. g.setFont(new Font("Helvetica", 1, 12));
  7739. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  7740. l += 30;
  7741. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  7742. l += 30;
  7743. }
  7744. }
  7745.  
  7746. public URL getCodeBase() {
  7747. try {
  7748. return new URL(server +":" + (80 + portOff));
  7749. } catch(Exception _ex) {
  7750. }
  7751. return null;
  7752. }
  7753.  
  7754. private void method95() {
  7755. for(int j = 0; j < npcCount; j++) {
  7756. int k = npcIndices[j];
  7757. NPC npc = npcArray[k];
  7758. if(npc != null)
  7759. method96(npc);
  7760. }
  7761. }
  7762.  
  7763. private void method96(Entity entity)
  7764. {
  7765. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  7766. {
  7767. entity.anim = -1;
  7768. entity.anInt1520 = -1;
  7769. entity.anInt1547 = 0;
  7770. entity.anInt1548 = 0;
  7771. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7772. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7773. entity.method446();
  7774. }
  7775. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  7776. {
  7777. entity.anim = -1;
  7778. entity.anInt1520 = -1;
  7779. entity.anInt1547 = 0;
  7780. entity.anInt1548 = 0;
  7781. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7782. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7783. entity.method446();
  7784. }
  7785. if(entity.anInt1547 > loopCycle)
  7786. method97(entity);
  7787. else
  7788. if(entity.anInt1548 >= loopCycle)
  7789. method98(entity);
  7790. else
  7791. method99(entity);
  7792. method100(entity);
  7793. method101(entity);
  7794. }
  7795.  
  7796. private void method97(Entity entity)
  7797. {
  7798. int i = entity.anInt1547 - loopCycle;
  7799. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7800. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7801. entity.x += (j - entity.x) / i;
  7802. entity.y += (k - entity.y) / i;
  7803. entity.anInt1503 = 0;
  7804. if(entity.anInt1549 == 0)
  7805. entity.turnDirection = 1024;
  7806. if(entity.anInt1549 == 1)
  7807. entity.turnDirection = 1536;
  7808. if(entity.anInt1549 == 2)
  7809. entity.turnDirection = 0;
  7810. if(entity.anInt1549 == 3)
  7811. entity.turnDirection = 512;
  7812. }
  7813.  
  7814. private void method98(Entity entity)
  7815. {
  7816. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  7817. {
  7818. int i = entity.anInt1548 - entity.anInt1547;
  7819. int j = loopCycle - entity.anInt1547;
  7820. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7821. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7822. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  7823. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  7824. entity.x = (k * (i - j) + i1 * j) / i;
  7825. entity.y = (l * (i - j) + j1 * j) / i;
  7826. }
  7827. entity.anInt1503 = 0;
  7828. if(entity.anInt1549 == 0)
  7829. entity.turnDirection = 1024;
  7830. if(entity.anInt1549 == 1)
  7831. entity.turnDirection = 1536;
  7832. if(entity.anInt1549 == 2)
  7833. entity.turnDirection = 0;
  7834. if(entity.anInt1549 == 3)
  7835. entity.turnDirection = 512;
  7836. entity.anInt1552 = entity.turnDirection;
  7837. }
  7838.  
  7839. private void method99(Entity entity)
  7840. {
  7841. entity.anInt1517 = entity.anInt1511;
  7842. if(entity.smallXYIndex == 0)
  7843. {
  7844. entity.anInt1503 = 0;
  7845. return;
  7846. }
  7847. if(entity.anim != -1 && entity.anInt1529 == 0)
  7848. {
  7849. Animation animation = Animation.anims[entity.anim];
  7850. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  7851. {
  7852. entity.anInt1503++;
  7853. return;
  7854. }
  7855. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  7856. {
  7857. entity.anInt1503++;
  7858. return;
  7859. }
  7860. }
  7861. int i = entity.x;
  7862. int j = entity.y;
  7863. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7864. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7865. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  7866. {
  7867. entity.x = k;
  7868. entity.y = l;
  7869. return;
  7870. }
  7871. if(i < k)
  7872. {
  7873. if(j < l)
  7874. entity.turnDirection = 1280;
  7875. else
  7876. if(j > l)
  7877. entity.turnDirection = 1792;
  7878. else
  7879. entity.turnDirection = 1536;
  7880. } else
  7881. if(i > k)
  7882. {
  7883. if(j < l)
  7884. entity.turnDirection = 768;
  7885. else
  7886. if(j > l)
  7887. entity.turnDirection = 256;
  7888. else
  7889. entity.turnDirection = 512;
  7890. } else
  7891. if(j < l)
  7892. entity.turnDirection = 1024;
  7893. else
  7894. entity.turnDirection = 0;
  7895. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  7896. if(i1 > 1024)
  7897. i1 -= 2048;
  7898. int j1 = entity.anInt1555;
  7899. if(i1 >= -256 && i1 <= 256)
  7900. j1 = entity.anInt1554;
  7901. else
  7902. if(i1 >= 256 && i1 < 768)
  7903. j1 = entity.anInt1557;
  7904. else
  7905. if(i1 >= -768 && i1 <= -256)
  7906. j1 = entity.anInt1556;
  7907. if(j1 == -1)
  7908. j1 = entity.anInt1554;
  7909. entity.anInt1517 = j1;
  7910. int k1 = 4;
  7911. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  7912. k1 = 2;
  7913. if(entity.smallXYIndex > 2)
  7914. k1 = 6;
  7915. if(entity.smallXYIndex > 3)
  7916. k1 = 8;
  7917. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  7918. {
  7919. k1 = 8;
  7920. entity.anInt1503--;
  7921. }
  7922. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  7923. k1 <<= 1;
  7924. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  7925. entity.anInt1517 = entity.anInt1505;
  7926. if(i < k)
  7927. {
  7928. entity.x += k1;
  7929. if(entity.x > k)
  7930. entity.x = k;
  7931. } else
  7932. if(i > k)
  7933. {
  7934. entity.x -= k1;
  7935. if(entity.x < k)
  7936. entity.x = k;
  7937. }
  7938. if(j < l)
  7939. {
  7940. entity.y += k1;
  7941. if(entity.y > l)
  7942. entity.y = l;
  7943. } else
  7944. if(j > l)
  7945. {
  7946. entity.y -= k1;
  7947. if(entity.y < l)
  7948. entity.y = l;
  7949. }
  7950. if(entity.x == k && entity.y == l)
  7951. {
  7952. entity.smallXYIndex--;
  7953. if(entity.anInt1542 > 0)
  7954. entity.anInt1542--;
  7955. }
  7956. }
  7957.  
  7958. private void method100(Entity entity)
  7959. {
  7960. if(entity.anInt1504 == 0)
  7961. return;
  7962. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  7963. {
  7964. NPC npc = npcArray[entity.interactingEntity];
  7965. if(npc != null)
  7966. {
  7967. int i1 = entity.x - npc.x;
  7968. int k1 = entity.y - npc.y;
  7969. if(i1 != 0 || k1 != 0)
  7970. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  7971. }
  7972. }
  7973. if(entity.interactingEntity >= 32768)
  7974. {
  7975. int j = entity.interactingEntity - 32768;
  7976. if(j == unknownInt10)
  7977. j = myPlayerIndex;
  7978. Player player = playerArray[j];
  7979. if(player != null)
  7980. {
  7981. int l1 = entity.x - player.x;
  7982. int i2 = entity.y - player.y;
  7983. if(l1 != 0 || i2 != 0)
  7984. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  7985. }
  7986. }
  7987. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  7988. {
  7989. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  7990. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  7991. if(k != 0 || j1 != 0)
  7992. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  7993. entity.anInt1538 = 0;
  7994. entity.anInt1539 = 0;
  7995. }
  7996. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  7997. if(l != 0)
  7998. {
  7999. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8000. entity.anInt1552 = entity.turnDirection;
  8001. else
  8002. if(l > 1024)
  8003. entity.anInt1552 -= entity.anInt1504;
  8004. else
  8005. entity.anInt1552 += entity.anInt1504;
  8006. entity.anInt1552 &= 0x7ff;
  8007. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  8008. {
  8009. if(entity.anInt1512 != -1)
  8010. {
  8011. entity.anInt1517 = entity.anInt1512;
  8012. return;
  8013. }
  8014. entity.anInt1517 = entity.anInt1554;
  8015. }
  8016. }
  8017. }
  8018.  
  8019. private void method101(Entity entity)
  8020. {
  8021. entity.aBoolean1541 = false;
  8022. if(entity.anInt1517 != -1)
  8023. {
  8024. Animation animation = Animation.anims[entity.anInt1517];
  8025. entity.anInt1519++;
  8026. if(entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518))
  8027. {
  8028. entity.anInt1519 = 0;
  8029. entity.anInt1518++;
  8030. }
  8031. if(entity.anInt1518 >= animation.anInt352)
  8032. {
  8033. entity.anInt1519 = 0;
  8034. entity.anInt1518 = 0;
  8035. }
  8036. }
  8037. if(entity.anInt1520 != -1 && loopCycle >= entity.anInt1523)
  8038. {
  8039. if(entity.anInt1521 < 0)
  8040. entity.anInt1521 = 0;
  8041. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8042. for(entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  8043. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8044.  
  8045. if(entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  8046. entity.anInt1520 = -1;
  8047. }
  8048. if(entity.anim != -1 && entity.anInt1529 <= 1)
  8049. {
  8050. Animation animation_2 = Animation.anims[entity.anim];
  8051. if(animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle)
  8052. {
  8053. entity.anInt1529 = 1;
  8054. return;
  8055. }
  8056. }
  8057. if(entity.anim != -1 && entity.anInt1529 == 0)
  8058. {
  8059. Animation animation_3 = Animation.anims[entity.anim];
  8060. for(entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  8061. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8062.  
  8063. if(entity.anInt1527 >= animation_3.anInt352)
  8064. {
  8065. entity.anInt1527 -= animation_3.anInt356;
  8066. entity.anInt1530++;
  8067. if(entity.anInt1530 >= animation_3.anInt362)
  8068. entity.anim = -1;
  8069. if(entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  8070. entity.anim = -1;
  8071. }
  8072. entity.aBoolean1541 = animation_3.aBoolean358;
  8073. }
  8074. if(entity.anInt1529 > 0)
  8075. entity.anInt1529--;
  8076. }
  8077.  
  8078. private void drawGameScreen()
  8079. {
  8080. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  8081. if (loadingStage == 2) {
  8082. method119(anInt945, fullscreenInterfaceID);
  8083. if (openInterfaceID != -1) {
  8084. method119(anInt945, openInterfaceID);
  8085. }
  8086. anInt945 = 0;
  8087. resetAllImageProducers();
  8088. super.fullGameScreen.initDrawingArea();
  8089. Texture.anIntArray1472 = fullScreenTextureArray;
  8090. DrawingArea.setAllPixelsToZero();
  8091. welcomeScreenRaised = true;
  8092. if (openInterfaceID != -1) {
  8093. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  8094. if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  8095. rsInterface_1.width = 765;
  8096. rsInterface_1.height = 503;
  8097. }
  8098. drawInterface(0, 0, rsInterface_1, 8);
  8099. }
  8100. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  8101. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  8102. rsInterface.width = 765;
  8103. rsInterface.height = 503;
  8104. }
  8105. drawInterface(0, 0, rsInterface, 8);
  8106.  
  8107. if (!menuOpen) {
  8108. processRightClick();
  8109. drawTooltip();
  8110. } else {
  8111. drawMenu();
  8112. }
  8113. }
  8114. drawCount++;
  8115. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  8116. return;
  8117. } else {
  8118. if (drawCount != 0) {
  8119. resetImageProducers2();
  8120. }
  8121. }
  8122. if(welcomeScreenRaised) {
  8123. welcomeScreenRaised = false;
  8124. topFrame.drawGraphics(0, super.graphics, 0);
  8125. leftFrame.drawGraphics(4, super.graphics, 0);
  8126. rightFrame.drawGraphics(4, super.graphics, 516);
  8127. mapEdgeIP.drawGraphics(4, super.graphics, 519);
  8128. needDrawTabArea = true;
  8129. inputTaken = true;
  8130. tabAreaAltered = true;
  8131. aBoolean1233 = true;
  8132. if(loadingStage != 2) {
  8133. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  8134. aRSImageProducer_1164.drawGraphics(4, super.graphics, 545);
  8135. }
  8136. }
  8137. if(menuOpen && menuScreenArea == 1)
  8138. needDrawTabArea = true;
  8139. if(invOverlayInterfaceID != -1)
  8140. {
  8141. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  8142. if(flag1)
  8143. needDrawTabArea = true;
  8144. }
  8145. if(atInventoryInterfaceType == 2)
  8146. needDrawTabArea = true;
  8147. if(activeInterfaceType == 2)
  8148. needDrawTabArea = true;
  8149. /*if(needDrawTabArea)
  8150. {*/
  8151. drawTabArea();
  8152. /*needDrawTabArea = false;
  8153. }*/
  8154. if(backDialogID == -1)
  8155. {
  8156. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  8157. if(super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  8158. method65(494, 110, super.mouseX - 0, super.mouseY - 348, aClass9_1059, 0, false, anInt1211);
  8159. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  8160. if(i < 0)
  8161. i = 0;
  8162. if(i > anInt1211 - 110)
  8163. i = anInt1211 - 110;
  8164. if(anInt1089 != i)
  8165. {
  8166. anInt1089 = i;
  8167. inputTaken = true;
  8168. }
  8169. }
  8170. if(backDialogID != -1) {
  8171. boolean flag2 = method119(anInt945, backDialogID);
  8172. if(flag2)
  8173. inputTaken = true;
  8174. }
  8175. if(atInventoryInterfaceType == 3)
  8176. inputTaken = true;
  8177. if(activeInterfaceType == 3)
  8178. inputTaken = true;
  8179. if(aString844 != null)
  8180. inputTaken = true;
  8181. if(menuOpen && menuScreenArea == 2)
  8182. inputTaken = true;
  8183. if(inputTaken) {
  8184. drawChatArea();
  8185. inputTaken = false;
  8186. }
  8187. if(loadingStage == 2)
  8188. method146();
  8189. if(loadingStage == 2) {
  8190. drawMinimap();
  8191. aRSImageProducer_1164.drawGraphics(4, super.graphics, 545);
  8192. }
  8193. if(anInt1054 != -1)
  8194. tabAreaAltered = true;
  8195. if(tabAreaAltered)
  8196. {
  8197. if(anInt1054 != -1 && anInt1054 == tabID)
  8198. {
  8199. anInt1054 = -1;
  8200. stream.createFrame(120);
  8201. stream.writeWordBigEndian(tabID);
  8202. }
  8203. tabAreaAltered = false;
  8204. aRSImageProducer_1125.initDrawingArea();
  8205. aRSImageProducer_1165.initDrawingArea();
  8206. }
  8207. anInt945 = 0;
  8208. }
  8209.  
  8210. private boolean buildFriendsListMenu(RSInterface class9)
  8211. {
  8212. int i = class9.contentType;
  8213. if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  8214. {
  8215. if(i >= 801)
  8216. i -= 701;
  8217. else
  8218. if(i >= 701)
  8219. i -= 601;
  8220. else
  8221. if(i >= 101)
  8222. i -= 101;
  8223. else
  8224. i--;
  8225. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  8226. menuActionID[menuActionRow] = 792;
  8227. menuActionRow++;
  8228. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  8229. menuActionID[menuActionRow] = 639;
  8230. menuActionRow++;
  8231. return true;
  8232. }
  8233. if(i >= 401 && i <= 500)
  8234. {
  8235. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  8236. menuActionID[menuActionRow] = 322;
  8237. menuActionRow++;
  8238. return true;
  8239. } else
  8240. {
  8241. return false;
  8242. }
  8243. }
  8244.  
  8245. private void method104()
  8246. {
  8247. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  8248. for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  8249. if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  8250. class30_sub2_sub4_sub3.unlink();
  8251. else
  8252. if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  8253. {
  8254. class30_sub2_sub4_sub3.method454(anInt945);
  8255. if(class30_sub2_sub4_sub3.aBoolean1567)
  8256. class30_sub2_sub4_sub3.unlink();
  8257. else
  8258. 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);
  8259. }
  8260.  
  8261. }
  8262.  
  8263. public void drawBlackBox(int xPos, int yPos) {
  8264. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  8265. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  8266. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  8267. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  8268. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  8269. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  8270. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  8271. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  8272. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  8273. }
  8274.  
  8275. private void drawInterface(int j, int k, RSInterface class9, int l) {
  8276. if(class9.type != 0 || class9.children == null)
  8277. return;
  8278. if(class9.isMouseoverTriggered && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  8279. return;
  8280. int i1 = DrawingArea.topX;
  8281. int j1 = DrawingArea.topY;
  8282. int k1 = DrawingArea.bottomX;
  8283. int l1 = DrawingArea.bottomY;
  8284. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  8285. int i2 = class9.children.length;
  8286. for(int j2 = 0; j2 < i2; j2++) {
  8287. int k2 = class9.childX[j2] + k;
  8288. int l2 = (class9.childY[j2] + l) - j;
  8289. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  8290. k2 += class9_1.anInt263;
  8291. l2 += class9_1.anInt265;
  8292. if(class9_1.contentType > 0)
  8293. drawFriendsListOrWelcomeScreen(class9_1);
  8294. //here
  8295. int[] IDs = {
  8296. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
  8297. 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
  8298. 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
  8299. 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
  8300. 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  8301. /* Ancients */
  8302. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
  8303. 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  8304. };
  8305. for(int m5 = 0; m5 < IDs.length; m5++) {
  8306. if(class9_1.id == IDs[m5] + 1) {
  8307. if(m5 > 61)
  8308. drawBlackBox(k2 + 1, l2);
  8309. else
  8310. drawBlackBox(k2, l2 + 1);
  8311. }
  8312. }
  8313. int[] runeChildren = {
  8314. 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
  8315. 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
  8316. 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
  8317. 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
  8318. 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
  8319. 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
  8320. 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
  8321. 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
  8322. 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
  8323. 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
  8324. 15885, 18474, 18475, 18478
  8325. };
  8326. for(int r = 0; r < runeChildren.length; r++)
  8327. if(class9_1.id == runeChildren[r])
  8328. class9_1.modelZoom = 775;
  8329. if(class9_1.type == 0) {
  8330. if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  8331. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  8332. if(class9_1.scrollPosition < 0)
  8333. class9_1.scrollPosition = 0;
  8334. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  8335. if(class9_1.scrollMax > class9_1.height)
  8336. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  8337. } else if(class9_1.type != 1)
  8338. if(class9_1.type == 2) {
  8339. int i3 = 0;
  8340. for(int l3 = 0; l3 < class9_1.height; l3++) {
  8341. for(int l4 = 0; l4 < class9_1.width; l4++) {
  8342. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  8343. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  8344. if(i3 < 20) {
  8345. k5 += class9_1.spritesX[i3];
  8346. j6 += class9_1.spritesY[i3];
  8347. }
  8348. if(class9_1.inv[i3] > 0) {
  8349. int k6 = 0;
  8350. int j7 = 0;
  8351. int j9 = class9_1.inv[i3] - 1;
  8352. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  8353. int l9 = 0;
  8354. if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  8355. l9 = 0xffffff;
  8356. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  8357. if(class30_sub2_sub1_sub1_2 != null) {
  8358. if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  8359. k6 = super.mouseX - anInt1087;
  8360. j7 = super.mouseY - anInt1088;
  8361. if(k6 < 5 && k6 > -5)
  8362. k6 = 0;
  8363. if(j7 < 5 && j7 > -5)
  8364. j7 = 0;
  8365. if(anInt989 < 5) {
  8366. k6 = 0;
  8367. j7 = 0;
  8368. }
  8369. class30_sub2_sub1_sub1_2.drawSprite1(k5 + k6, j6 + j7);
  8370. if(j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  8371. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  8372. if(i10 > anInt945 * 10)
  8373. i10 = anInt945 * 10;
  8374. if(i10 > class9.scrollPosition)
  8375. i10 = class9.scrollPosition;
  8376. class9.scrollPosition -= i10;
  8377. anInt1088 += i10;
  8378. }
  8379. if(j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  8380. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  8381. if(j10 > anInt945 * 10)
  8382. j10 = anInt945 * 10;
  8383. if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  8384. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  8385. class9.scrollPosition += j10;
  8386. anInt1088 -= j10;
  8387. }
  8388. } else if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  8389. class30_sub2_sub1_sub1_2.drawSprite1(k5, j6);
  8390. else
  8391. class30_sub2_sub1_sub1_2.drawSprite(k5, j6);
  8392. if(class30_sub2_sub1_sub1_2.anInt1444 == 33 || class9_1.invStackSizes[i3] != 1)
  8393. {
  8394. int k10 = class9_1.invStackSizes[i3];
  8395. if(k10 >= 1)
  8396. smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8397. if(k10 >= 100000)
  8398. smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8399. if(k10 >= 10000000)
  8400. smallText.method385(0x49E20E, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8401.  
  8402. /*smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  8403. smallText.method385(0xffff00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);*/
  8404. }
  8405. }
  8406. }
  8407. } else if(class9_1.sprites != null && i3 < 20) {
  8408. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  8409. if(class30_sub2_sub1_sub1_1 != null)
  8410. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  8411. }
  8412. i3++;
  8413. }
  8414. }
  8415. } else if(class9_1.type == 3) {
  8416. boolean flag = false;
  8417. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8418. flag = true;
  8419. int j3;
  8420. if(interfaceIsSelected(class9_1)) {
  8421. j3 = class9_1.anInt219;
  8422. if(flag && class9_1.anInt239 != 0)
  8423. j3 = class9_1.anInt239;
  8424. } else {
  8425. j3 = class9_1.textColor;
  8426. if(flag && class9_1.anInt216 != 0)
  8427. j3 = class9_1.anInt216;
  8428. }
  8429. if(class9_1.aByte254 == 0) {
  8430. if(class9_1.aBoolean227)
  8431. DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  8432. else
  8433. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  8434. } else if(class9_1.aBoolean227)
  8435. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.aByte254 & 0xff), k2);
  8436. else
  8437. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.aByte254 & 0xff), j3, class9_1.width, k2);
  8438. } else if(class9_1.type == 4) {
  8439. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  8440. String s = class9_1.message;
  8441. boolean flag1 = false;
  8442. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8443. flag1 = true;
  8444. int i4;
  8445. if(interfaceIsSelected(class9_1)) {
  8446. i4 = class9_1.anInt219;
  8447. if(flag1 && class9_1.anInt239 != 0)
  8448. i4 = class9_1.anInt239;
  8449. if(class9_1.aString228.length() > 0)
  8450. s = class9_1.aString228;
  8451. } else {
  8452. i4 = class9_1.textColor;
  8453. if(flag1 && class9_1.anInt216 != 0)
  8454. i4 = class9_1.anInt216;
  8455. }
  8456. if(class9_1.atActionType == 6 && aBoolean1149) {
  8457. s = "Please wait...";
  8458. i4 = class9_1.textColor;
  8459. }
  8460. if(DrawingArea.width == 519) {
  8461. if(i4 == 0xffff00)
  8462. i4 = 255;
  8463. if(i4 == 49152)
  8464. i4 = 0xffffff;
  8465. }
  8466. if((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  8467. switch (i4) {
  8468. case 16773120: i4 = 0xFE981F; break;
  8469. case 7040819: i4 = 0xAF6A1A; break;
  8470. }
  8471. }
  8472. for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
  8473. {
  8474. if(s.indexOf("%") != -1)
  8475. {
  8476. do
  8477. {
  8478. int k7 = s.indexOf("%1");
  8479. if(k7 == -1)
  8480. break;
  8481. 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)
  8482. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8483. else
  8484. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8485. } while(true);
  8486. do
  8487. {
  8488. int l7 = s.indexOf("%2");
  8489. if(l7 == -1)
  8490. break;
  8491. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  8492. } while(true);
  8493. do
  8494. {
  8495. int i8 = s.indexOf("%3");
  8496. if(i8 == -1)
  8497. break;
  8498. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  8499. } while(true);
  8500. do
  8501. {
  8502. int j8 = s.indexOf("%4");
  8503. if(j8 == -1)
  8504. break;
  8505. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  8506. } while(true);
  8507. do
  8508. {
  8509. int k8 = s.indexOf("%5");
  8510. if(k8 == -1)
  8511. break;
  8512. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  8513. } while(true);
  8514. }
  8515. int l8 = s.indexOf("\\n");
  8516. String s1;
  8517. if(l8 != -1)
  8518. {
  8519. s1 = s.substring(0, l8);
  8520. s = s.substring(l8 + 2);
  8521. } else
  8522. {
  8523. s1 = s;
  8524. s = "";
  8525. }
  8526. if(class9_1.centerText)
  8527. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadow);
  8528. else
  8529. textDrawingArea.method389(class9_1.textShadow, k2, i4, s1, l6);
  8530. }
  8531. } else if(class9_1.type == 5) {
  8532. //whats this?
  8533. Sprite sprite;
  8534. if(interfaceIsSelected(class9_1))
  8535. sprite = class9_1.sprite2;
  8536. else
  8537. sprite = class9_1.sprite1;
  8538. if(spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
  8539. sprite.drawSprite(k2, l2, 0xffffff);
  8540. } else {
  8541. if (sprite != null)
  8542. sprite.drawSprite(k2, l2);
  8543. }
  8544. if(sprite != null)
  8545. sprite.drawSprite(k2, l2);
  8546. } else if(class9_1.type == 6) {
  8547. int k3 = Texture.textureInt1;
  8548. int j4 = Texture.textureInt2;
  8549. Texture.textureInt1 = k2 + class9_1.width / 2;
  8550. Texture.textureInt2 = l2 + class9_1.height / 2;
  8551. int i5 = Texture.anIntArray1470[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8552. int l5 = Texture.anIntArray1471[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8553. boolean flag2 = interfaceIsSelected(class9_1);
  8554. int i7;
  8555. if(flag2)
  8556. i7 = class9_1.anInt258;
  8557. else
  8558. i7 = class9_1.anInt257;
  8559. Model model;
  8560. if(i7 == -1) {
  8561. model = class9_1.method209(-1, -1, flag2);
  8562. } else {
  8563. Animation animation = Animation.anims[i7];
  8564. model = class9_1.method209(animation.anIntArray354[class9_1.anInt246], animation.anIntArray353[class9_1.anInt246], flag2);
  8565. }
  8566. if(model != null)
  8567. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  8568. Texture.textureInt1 = k3;
  8569. Texture.textureInt2 = j4;
  8570. } else if(class9_1.type == 7) {
  8571. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  8572. int k4 = 0;
  8573. for(int j5 = 0; j5 < class9_1.height; j5++) {
  8574. for(int i6 = 0; i6 < class9_1.width; i6++) {
  8575. if(class9_1.inv[k4] > 0) {
  8576. ItemDef itemDef = ItemDef.forID(class9_1.inv[k4] - 1);
  8577. String s2 = itemDef.name;
  8578. if(itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  8579. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  8580. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  8581. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  8582. if(class9_1.centerText)
  8583. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadow);
  8584. else
  8585. textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  8586. }
  8587. k4++;
  8588. }
  8589. }
  8590. } else if (class9_1.type == 8) {
  8591. drawHoverBox(k2, l2, class9_1.popupString);
  8592. }
  8593. }
  8594. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  8595. }
  8596.  
  8597. private void randomizeBackground(Background background) {
  8598. int j = 256;
  8599. for(int k = 0; k < anIntArray1190.length; k++)
  8600. anIntArray1190[k] = 0;
  8601.  
  8602. for(int l = 0; l < 5000; l++) {
  8603. int i1 = (int)(Math.random() * 128D * (double)j);
  8604. anIntArray1190[i1] = (int)(Math.random() * 256D);
  8605. }
  8606. for(int j1 = 0; j1 < 20; j1++) {
  8607. for(int k1 = 1; k1 < j - 1; k1++) {
  8608. for(int i2 = 1; i2 < 127; i2++) {
  8609. int k2 = i2 + (k1 << 7);
  8610. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  8611. }
  8612.  
  8613. }
  8614. int ai[] = anIntArray1190;
  8615. anIntArray1190 = anIntArray1191;
  8616. anIntArray1191 = ai;
  8617. }
  8618. if(background != null) {
  8619. int l1 = 0;
  8620. for(int j2 = 0; j2 < background.anInt1453; j2++) {
  8621. for(int l2 = 0; l2 < background.anInt1452; l2++)
  8622. if(background.aByteArray1450[l1++] != 0) {
  8623. int i3 = l2 + 16 + background.anInt1454;
  8624. int j3 = j2 + 16 + background.anInt1455;
  8625. int k3 = i3 + (j3 << 7);
  8626. anIntArray1190[k3] = 0;
  8627. }
  8628. }
  8629. }
  8630. }
  8631.  
  8632. private void method107(int i, int j, Stream stream, Player player)
  8633. {
  8634. if((i & 0x400) != 0)
  8635. {
  8636. player.anInt1543 = stream.method428();
  8637. player.anInt1545 = stream.method428();
  8638. player.anInt1544 = stream.method428();
  8639. player.anInt1546 = stream.method428();
  8640. player.anInt1547 = stream.method436() + loopCycle;
  8641. player.anInt1548 = stream.method435() + loopCycle;
  8642. player.anInt1549 = stream.method428();
  8643. player.method446();
  8644. }
  8645. if((i & 0x100) != 0)
  8646. {
  8647. player.anInt1520 = stream.method434();
  8648. int k = stream.readDWord();
  8649. player.anInt1524 = k >> 16;
  8650. player.anInt1523 = loopCycle + (k & 0xffff);
  8651. player.anInt1521 = 0;
  8652. player.anInt1522 = 0;
  8653. if(player.anInt1523 > loopCycle)
  8654. player.anInt1521 = -1;
  8655. if(player.anInt1520 == 65535)
  8656. player.anInt1520 = -1;
  8657. }
  8658. if((i & 8) != 0)
  8659. {
  8660. int l = stream.method434();
  8661. if(l == 65535)
  8662. l = -1;
  8663. int i2 = stream.method427();
  8664. if(l == player.anim && l != -1)
  8665. {
  8666. int i3 = Animation.anims[l].anInt365;
  8667. if(i3 == 1)
  8668. {
  8669. player.anInt1527 = 0;
  8670. player.anInt1528 = 0;
  8671. player.anInt1529 = i2;
  8672. player.anInt1530 = 0;
  8673. }
  8674. if(i3 == 2)
  8675. player.anInt1530 = 0;
  8676. } else
  8677. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  8678. {
  8679. player.anim = l;
  8680. player.anInt1527 = 0;
  8681. player.anInt1528 = 0;
  8682. player.anInt1529 = i2;
  8683. player.anInt1530 = 0;
  8684. player.anInt1542 = player.smallXYIndex;
  8685. }
  8686. }
  8687. if((i & 4) != 0)
  8688. {
  8689. player.textSpoken = stream.readString();
  8690. if(player.textSpoken.charAt(0) == '~')
  8691. {
  8692. player.textSpoken = player.textSpoken.substring(1);
  8693. pushMessage(player.textSpoken, 2, player.name);
  8694. } else
  8695. if(player == myPlayer)
  8696. pushMessage(player.textSpoken, 2, player.name);
  8697. player.anInt1513 = 0;
  8698. player.anInt1531 = 0;
  8699. player.textCycle = 150;
  8700. }
  8701. if((i & 0x80) != 0)
  8702. {
  8703. //right fucking here
  8704. int i1 = stream.method434();
  8705. int j2 = stream.readUnsignedByte();
  8706. int j3 = stream.method427();
  8707. int k3 = stream.currentOffset;
  8708. if(player.name != null && player.visible)
  8709. {
  8710. long l3 = TextClass.longForName(player.name);
  8711. boolean flag = false;
  8712. if(j2 <= 1)
  8713. {
  8714. for(int i4 = 0; i4 < ignoreCount; i4++)
  8715. {
  8716. if(ignoreListAsLongs[i4] != l3)
  8717. continue;
  8718. flag = true;
  8719. break;
  8720. }
  8721.  
  8722. }
  8723. if(!flag && anInt1251 == 0)
  8724. try
  8725. {
  8726. aStream_834.currentOffset = 0;
  8727. stream.method442(j3, 0, aStream_834.buffer);
  8728. aStream_834.currentOffset = 0;
  8729. String s = TextInput.method525(j3, aStream_834);
  8730. //s = Censor.doCensor(s);
  8731. player.textSpoken = s;
  8732. player.anInt1513 = i1 >> 8;
  8733. player.privelage = j2;
  8734. player.anInt1531 = i1 & 0xff;
  8735. player.textCycle = 150;
  8736. if(j2 == 2 || j2 == 3)
  8737. pushMessage(s, 1, "@cr2@" + player.name);
  8738. else if(j2 == 1)
  8739. pushMessage(s, 1, "@cr1@" + player.name);
  8740. else
  8741. pushMessage(s, 2, player.name);
  8742. }
  8743. catch(Exception exception)
  8744. {
  8745. signlink.reporterror("cde2");
  8746. }
  8747. }
  8748. stream.currentOffset = k3 + j3;
  8749. }
  8750. if((i & 1) != 0)
  8751. {
  8752. player.interactingEntity = stream.method434();
  8753. if(player.interactingEntity == 65535)
  8754. player.interactingEntity = -1;
  8755. }
  8756. if((i & 0x10) != 0)
  8757. {
  8758. int j1 = stream.method427();
  8759. byte abyte0[] = new byte[j1];
  8760. Stream stream_1 = new Stream(abyte0);
  8761. stream.readBytes(j1, 0, abyte0);
  8762. aStreamArray895s[j] = stream_1;
  8763. player.updatePlayer(stream_1);
  8764. }
  8765. if((i & 2) != 0)
  8766. {
  8767. player.anInt1538 = stream.method436();
  8768. player.anInt1539 = stream.method434();
  8769. }
  8770. if((i & 0x20) != 0)
  8771. {
  8772. int k1 = stream.readUnsignedByte();
  8773. int k2 = stream.method426();
  8774. player.updateHitData(k2, k1, loopCycle);
  8775. player.loopCycleStatus = loopCycle + 300;
  8776. player.currentHealth = stream.method427();
  8777. player.maxHealth = stream.readUnsignedByte();
  8778. }
  8779. if((i & 0x200) != 0)
  8780. {
  8781. int l1 = stream.readUnsignedByte();
  8782. int l2 = stream.method428();
  8783. player.updateHitData(l2, l1, loopCycle);
  8784. player.loopCycleStatus = loopCycle + 300;
  8785. player.currentHealth = stream.readUnsignedByte();
  8786. player.maxHealth = stream.method427();
  8787. }
  8788. }
  8789.  
  8790. private void method108()
  8791. {
  8792. try
  8793. {
  8794. int j = myPlayer.x + anInt1278;
  8795. int k = myPlayer.y + anInt1131;
  8796. if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  8797. {
  8798. anInt1014 = j;
  8799. anInt1015 = k;
  8800. }
  8801. if(anInt1014 != j)
  8802. anInt1014 += (j - anInt1014) / 16;
  8803. if(anInt1015 != k)
  8804. anInt1015 += (k - anInt1015) / 16;
  8805. if(super.keyArray[1] == 1)
  8806. anInt1186 += (-24 - anInt1186) / 2;
  8807. else
  8808. if(super.keyArray[2] == 1)
  8809. anInt1186 += (24 - anInt1186) / 2;
  8810. else
  8811. anInt1186 /= 2;
  8812. if(super.keyArray[3] == 1)
  8813. anInt1187 += (12 - anInt1187) / 2;
  8814. else
  8815. if(super.keyArray[4] == 1)
  8816. anInt1187 += (-12 - anInt1187) / 2;
  8817. else
  8818. anInt1187 /= 2;
  8819. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  8820. anInt1184 += anInt1187 / 2;
  8821. if(anInt1184 < 128)
  8822. anInt1184 = 128;
  8823. if(anInt1184 > 383)
  8824. anInt1184 = 383;
  8825. int l = anInt1014 >> 7;
  8826. int i1 = anInt1015 >> 7;
  8827. int j1 = method42(plane, anInt1015, anInt1014);
  8828. int k1 = 0;
  8829. if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  8830. {
  8831. for(int l1 = l - 4; l1 <= l + 4; l1++)
  8832. {
  8833. for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  8834. {
  8835. int l2 = plane;
  8836. if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  8837. l2++;
  8838. int i3 = j1 - intGroundArray[l2][l1][k2];
  8839. if(i3 > k1)
  8840. k1 = i3;
  8841. }
  8842.  
  8843. }
  8844.  
  8845. }
  8846. anInt1005++;
  8847. if(anInt1005 > 1512)
  8848. {
  8849. anInt1005 = 0;
  8850. stream.createFrame(77);
  8851. stream.writeWordBigEndian(0);
  8852. int i2 = stream.currentOffset;
  8853. stream.writeWordBigEndian((int)(Math.random() * 256D));
  8854. stream.writeWordBigEndian(101);
  8855. stream.writeWordBigEndian(233);
  8856. stream.writeWord(45092);
  8857. if((int)(Math.random() * 2D) == 0)
  8858. stream.writeWord(35784);
  8859. stream.writeWordBigEndian((int)(Math.random() * 256D));
  8860. stream.writeWordBigEndian(64);
  8861. stream.writeWordBigEndian(38);
  8862. stream.writeWord((int)(Math.random() * 65536D));
  8863. stream.writeWord((int)(Math.random() * 65536D));
  8864. stream.writeBytes(stream.currentOffset - i2);
  8865. }
  8866. int j2 = k1 * 192;
  8867. if(j2 > 0x17f00)
  8868. j2 = 0x17f00;
  8869. if(j2 < 32768)
  8870. j2 = 32768;
  8871. if(j2 > anInt984)
  8872. {
  8873. anInt984 += (j2 - anInt984) / 24;
  8874. return;
  8875. }
  8876. if(j2 < anInt984)
  8877. {
  8878. anInt984 += (j2 - anInt984) / 80;
  8879. }
  8880. }
  8881. catch(Exception _ex)
  8882. {
  8883. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  8884. throw new RuntimeException("eek");
  8885. }
  8886. }
  8887.  
  8888. public void processDrawing()
  8889. {
  8890. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  8891. {
  8892. showErrorScreen();
  8893. return;
  8894. }
  8895. anInt1061++;
  8896. if(!loggedIn)
  8897. drawLoginScreen(false);
  8898. else
  8899. drawGameScreen();
  8900. anInt1213 = 0;
  8901. }
  8902.  
  8903. private boolean isFriendOrSelf(String s)
  8904. {
  8905. if(s == null)
  8906. return false;
  8907. for(int i = 0; i < friendsCount; i++)
  8908. if(s.equalsIgnoreCase(friendsList[i]))
  8909. return true;
  8910. return s.equalsIgnoreCase(myPlayer.name);
  8911. }
  8912.  
  8913. private static String combatDiffColor(int i, int j)
  8914. {
  8915. int k = i - j;
  8916. if(k < -9)
  8917. return "@red@";
  8918. if(k < -6)
  8919. return "@or3@";
  8920. if(k < -3)
  8921. return "@or2@";
  8922. if(k < 0)
  8923. return "@or1@";
  8924. if(k > 9)
  8925. return "@gre@";
  8926. if(k > 6)
  8927. return "@gr3@";
  8928. if(k > 3)
  8929. return "@gr2@";
  8930. if(k > 0)
  8931. return "@gr1@";
  8932. else
  8933. return "@yel@";
  8934. }
  8935.  
  8936. private void setWaveVolume(int i)
  8937. {
  8938. signlink.wavevol = i;
  8939. }
  8940.  
  8941. private void draw3dScreen()
  8942. {
  8943. drawSplitPrivateChat();
  8944. if(crossType == 1)
  8945. {
  8946. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  8947. anInt1142++;
  8948. if(anInt1142 > 67)
  8949. {
  8950. anInt1142 = 0;
  8951. stream.createFrame(78);
  8952. }
  8953. }
  8954. if(crossType == 2)
  8955. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  8956. if(anInt1018 != -1)
  8957. {
  8958. method119(anInt945, anInt1018);
  8959. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  8960. }
  8961. if(openInterfaceID != -1)
  8962. {
  8963. method119(anInt945, openInterfaceID);
  8964. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  8965. }
  8966. method70();
  8967. if(!menuOpen)
  8968. {
  8969. processRightClick();
  8970. drawTooltip();
  8971. } else
  8972. if(menuScreenArea == 0)
  8973. drawMenu();
  8974. if(anInt1055 == 1)
  8975. multiOverlay.drawSprite(472, 296);
  8976. if(fpsOn)
  8977. {
  8978. char c = '\u01FB';
  8979. int k = 20;
  8980. int i1 = 0xffff00;
  8981. if(super.fps < 15)
  8982. i1 = 0xff0000;
  8983. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  8984. k += 15;
  8985. Runtime runtime = Runtime.getRuntime();
  8986. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  8987. i1 = 0xffff00;
  8988. if(j1 > 0x2000000 && lowMem)
  8989. i1 = 0xff0000;
  8990. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  8991. k += 15;
  8992. }
  8993. int i1 = 0xffff00;
  8994. int x = baseX + (myPlayer.x - 6 >> 7);
  8995. int y = baseY + (myPlayer.y - 6 >> 7);
  8996. if (clientData)
  8997. {
  8998. char c = '\u01FB';
  8999. int k = 20;
  9000. if(super.fps < 15)
  9001. i1 = 0xff0000;
  9002. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285, 5);
  9003. Runtime runtime = Runtime.getRuntime();
  9004. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9005. i1 = 0xffff00;
  9006. if(j1 > 0x2000000 && lowMem)
  9007. i1 = 0xff0000;
  9008. k += 15;
  9009. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299, 5);
  9010. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  9011. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
  9012. }
  9013. if(anInt1104 != 0)
  9014. {
  9015. int j = anInt1104 / 50;
  9016. int l = j / 60;
  9017. j %= 60;
  9018. if(j < 10)
  9019. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  9020. else
  9021. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  9022. anInt849++;
  9023. if(anInt849 > 75)
  9024. {
  9025. anInt849 = 0;
  9026. stream.createFrame(148);
  9027. }
  9028. }
  9029. }
  9030.  
  9031. private void addIgnore(long l)
  9032. {
  9033. try
  9034. {
  9035. if(l == 0L)
  9036. return;
  9037. if(ignoreCount >= 100)
  9038. {
  9039. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  9040. return;
  9041. }
  9042. String s = TextClass.fixName(TextClass.nameForLong(l));
  9043. for(int j = 0; j < ignoreCount; j++)
  9044. if(ignoreListAsLongs[j] == l)
  9045. {
  9046. pushMessage(s + " is already on your ignore list", 0, "");
  9047. return;
  9048. }
  9049. for(int k = 0; k < friendsCount; k++)
  9050. if(friendsListAsLongs[k] == l)
  9051. {
  9052. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  9053. return;
  9054. }
  9055.  
  9056. ignoreListAsLongs[ignoreCount++] = l;
  9057. needDrawTabArea = true;
  9058. stream.createFrame(133);
  9059. stream.writeQWord(l);
  9060. return;
  9061. }
  9062. catch(RuntimeException runtimeexception)
  9063. {
  9064. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  9065. }
  9066. throw new RuntimeException();
  9067. }
  9068.  
  9069. private void method114()
  9070. {
  9071. for(int i = -1; i < playerCount; i++)
  9072. {
  9073. int j;
  9074. if(i == -1)
  9075. j = myPlayerIndex;
  9076. else
  9077. j = playerIndices[i];
  9078. Player player = playerArray[j];
  9079. if(player != null)
  9080. method96(player);
  9081. }
  9082.  
  9083. }
  9084.  
  9085. private void method115()
  9086. {
  9087. if(loadingStage == 2)
  9088. {
  9089. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  9090. {
  9091. if(class30_sub1.anInt1294 > 0)
  9092. class30_sub1.anInt1294--;
  9093. if(class30_sub1.anInt1294 == 0)
  9094. {
  9095. if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  9096. {
  9097. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  9098. class30_sub1.unlink();
  9099. }
  9100. } else
  9101. {
  9102. if(class30_sub1.anInt1302 > 0)
  9103. class30_sub1.anInt1302--;
  9104. 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)))
  9105. {
  9106. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  9107. class30_sub1.anInt1302 = -1;
  9108. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  9109. class30_sub1.unlink();
  9110. else
  9111. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  9112. class30_sub1.unlink();
  9113. }
  9114. }
  9115. }
  9116.  
  9117. }
  9118. }
  9119.  
  9120.  
  9121. //stops the click from going over sprite
  9122. private void determineMenuSize()
  9123. {
  9124. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  9125. for(int j = 0; j < menuActionRow; j++)
  9126. {
  9127. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  9128. if(k > i)
  9129. i = k;
  9130. }
  9131.  
  9132. i += 8;
  9133. int l = 15 * menuActionRow + 21;
  9134. if(super.saveClickX > 4 && super.saveClickY > 4 && super.saveClickX < 516 && super.saveClickY < 338)
  9135. {
  9136. int i1 = super.saveClickX - 4 - i / 2;
  9137. if(i1 + i > 512)
  9138. i1 = 512 - i;
  9139. if(i1 < 0)
  9140. i1 = 0;
  9141. int l1 = super.saveClickY - 4;
  9142. if(l1 + l > 334)
  9143. l1 = 334 - l;
  9144. if(l1 < 0)
  9145. l1 = 0;
  9146. menuOpen = true;
  9147. menuScreenArea = 0;
  9148. menuOffsetX = i1;
  9149. menuOffsetY = l1;
  9150. menuWidth = i;
  9151. menuHeight = 15 * menuActionRow + 22;
  9152. }
  9153. if(super.saveClickX > 519 && super.saveClickY > 168 && super.saveClickX < 765 && super.saveClickY < 503)
  9154. {
  9155. int j1 = super.saveClickX - 519 - i / 2;
  9156. if(j1 < 0)
  9157. j1 = 0;
  9158. else
  9159. if(j1 + i > 245)
  9160. j1 = 245 - i;
  9161. int i2 = super.saveClickY - 168;
  9162. if(i2 < 0)
  9163. i2 = 0;
  9164. else
  9165. if(i2 + l > 333)
  9166. i2 = 333 - l;
  9167. menuOpen = true;
  9168. menuScreenArea = 1;
  9169. menuOffsetX = j1;
  9170. menuOffsetY = i2;
  9171. menuWidth = i;
  9172. menuHeight = 15 * menuActionRow + 22;
  9173. }
  9174. if(super.saveClickX > 0 && super.saveClickY > 338 && super.saveClickX < 516 && super.saveClickY < 503)
  9175. {
  9176. int k1 = super.saveClickX - 0 - i / 2;
  9177. if(k1 < 0)
  9178. k1 = 0;
  9179. else
  9180. if(k1 + i > 516)
  9181. k1 = 516 - i;
  9182. int j2 = super.saveClickY - 338;
  9183. if(j2 < 0)
  9184. j2 = 0;
  9185. else
  9186. if(j2 + l > 165)
  9187. j2 = 165 - l;
  9188. menuOpen = true;
  9189. menuScreenArea = 2;
  9190. menuOffsetX = k1;
  9191. menuOffsetY = j2;
  9192. menuWidth = i;
  9193. menuHeight = 15 * menuActionRow + 22;
  9194. }
  9195. }
  9196.  
  9197. private void method117(Stream stream)
  9198. {
  9199. stream.initBitAccess();
  9200. int j = stream.readBits(1);
  9201. if(j == 0)
  9202. return;
  9203. int k = stream.readBits(2);
  9204. if(k == 0)
  9205. {
  9206. anIntArray894[anInt893++] = myPlayerIndex;
  9207. return;
  9208. }
  9209. if(k == 1)
  9210. {
  9211. int l = stream.readBits(3);
  9212. myPlayer.moveInDir(false, l);
  9213. int k1 = stream.readBits(1);
  9214. if(k1 == 1)
  9215. anIntArray894[anInt893++] = myPlayerIndex;
  9216. return;
  9217. }
  9218. if(k == 2)
  9219. {
  9220. int i1 = stream.readBits(3);
  9221. myPlayer.moveInDir(true, i1);
  9222. int l1 = stream.readBits(3);
  9223. myPlayer.moveInDir(true, l1);
  9224. int j2 = stream.readBits(1);
  9225. if(j2 == 1)
  9226. anIntArray894[anInt893++] = myPlayerIndex;
  9227. return;
  9228. }
  9229. if(k == 3)
  9230. {
  9231. plane = stream.readBits(2);
  9232. int j1 = stream.readBits(1);
  9233. int i2 = stream.readBits(1);
  9234. if(i2 == 1)
  9235. anIntArray894[anInt893++] = myPlayerIndex;
  9236. int k2 = stream.readBits(7);
  9237. int l2 = stream.readBits(7);
  9238. myPlayer.setPos(l2, k2, j1 == 1);
  9239. }
  9240. }
  9241.  
  9242. private void nullLoader()
  9243. {
  9244. aBoolean831 = false;
  9245. while(drawingFlames)
  9246. {
  9247. aBoolean831 = false;
  9248. try
  9249. {
  9250. Thread.sleep(50L);
  9251. }
  9252. catch(Exception _ex) { }
  9253. }
  9254. aBackground_966 = null;
  9255. aBackground_967 = null;
  9256. aBackgroundArray1152s = null;
  9257. anIntArray850 = null;
  9258. anIntArray851 = null;
  9259. anIntArray852 = null;
  9260. anIntArray853 = null;
  9261. anIntArray1190 = null;
  9262. anIntArray1191 = null;
  9263. anIntArray828 = null;
  9264. anIntArray829 = null;
  9265. aClass30_Sub2_Sub1_Sub1_1201 = null;
  9266. aClass30_Sub2_Sub1_Sub1_1202 = null;
  9267. }
  9268.  
  9269. private boolean method119(int i, int j)
  9270. {
  9271. boolean flag1 = false;
  9272. RSInterface class9 = RSInterface.interfaceCache[j];
  9273. for(int k = 0; k < class9.children.length; k++)
  9274. {
  9275. if(class9.children[k] == -1)
  9276. break;
  9277. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  9278. if(class9_1.type == 1)
  9279. flag1 |= method119(i, class9_1.id);
  9280. if(class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1))
  9281. {
  9282. boolean flag2 = interfaceIsSelected(class9_1);
  9283. int l;
  9284. if(flag2)
  9285. l = class9_1.anInt258;
  9286. else
  9287. l = class9_1.anInt257;
  9288. if(l != -1)
  9289. {
  9290. Animation animation = Animation.anims[l];
  9291. for(class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);)
  9292. {
  9293. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  9294. class9_1.anInt246++;
  9295. if(class9_1.anInt246 >= animation.anInt352)
  9296. {
  9297. class9_1.anInt246 -= animation.anInt356;
  9298. if(class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  9299. class9_1.anInt246 = 0;
  9300. }
  9301. flag1 = true;
  9302. }
  9303.  
  9304. }
  9305. }
  9306. }
  9307.  
  9308. return flag1;
  9309. }
  9310.  
  9311. private int method120()
  9312. {
  9313. int j = 3;
  9314. if(yCameraCurve < 310)
  9315. {
  9316. int k = xCameraPos >> 7;
  9317. int l = yCameraPos >> 7;
  9318. int i1 = myPlayer.x >> 7;
  9319. int j1 = myPlayer.y >> 7;
  9320. if((byteGroundArray[plane][k][l] & 4) != 0)
  9321. j = plane;
  9322. int k1;
  9323. if(i1 > k)
  9324. k1 = i1 - k;
  9325. else
  9326. k1 = k - i1;
  9327. int l1;
  9328. if(j1 > l)
  9329. l1 = j1 - l;
  9330. else
  9331. l1 = l - j1;
  9332. if(k1 > l1)
  9333. {
  9334. int i2 = (l1 * 0x10000) / k1;
  9335. int k2 = 32768;
  9336. while(k != i1)
  9337. {
  9338. if(k < i1)
  9339. k++;
  9340. else
  9341. if(k > i1)
  9342. k--;
  9343. if((byteGroundArray[plane][k][l] & 4) != 0)
  9344. j = plane;
  9345. k2 += i2;
  9346. if(k2 >= 0x10000)
  9347. {
  9348. k2 -= 0x10000;
  9349. if(l < j1)
  9350. l++;
  9351. else
  9352. if(l > j1)
  9353. l--;
  9354. if((byteGroundArray[plane][k][l] & 4) != 0)
  9355. j = plane;
  9356. }
  9357. }
  9358. } else
  9359. {
  9360. int j2 = (k1 * 0x10000) / l1;
  9361. int l2 = 32768;
  9362. while(l != j1)
  9363. {
  9364. if(l < j1)
  9365. l++;
  9366. else
  9367. if(l > j1)
  9368. l--;
  9369. if((byteGroundArray[plane][k][l] & 4) != 0)
  9370. j = plane;
  9371. l2 += j2;
  9372. if(l2 >= 0x10000)
  9373. {
  9374. l2 -= 0x10000;
  9375. if(k < i1)
  9376. k++;
  9377. else
  9378. if(k > i1)
  9379. k--;
  9380. if((byteGroundArray[plane][k][l] & 4) != 0)
  9381. j = plane;
  9382. }
  9383. }
  9384. }
  9385. }
  9386. if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  9387. j = plane;
  9388. return j;
  9389. }
  9390.  
  9391. private int method121()
  9392. {
  9393. int j = method42(plane, yCameraPos, xCameraPos);
  9394. if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  9395. return plane;
  9396. else
  9397. return 3;
  9398. }
  9399.  
  9400. private void delIgnore(long l)
  9401. {
  9402. try
  9403. {
  9404. if(l == 0L)
  9405. return;
  9406. for(int j = 0; j < ignoreCount; j++)
  9407. if(ignoreListAsLongs[j] == l)
  9408. {
  9409. ignoreCount--;
  9410. needDrawTabArea = true;
  9411. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  9412.  
  9413. stream.createFrame(74);
  9414. stream.writeQWord(l);
  9415. return;
  9416. }
  9417.  
  9418. return;
  9419. }
  9420. catch(RuntimeException runtimeexception)
  9421. {
  9422. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9423. }
  9424. throw new RuntimeException();
  9425. }
  9426.  
  9427.  
  9428. private void chatJoin(long l) {
  9429. try {
  9430. if(l == 0L)
  9431. return;
  9432. stream.createFrame(60);
  9433. stream.writeQWord(l);
  9434. return;
  9435. }
  9436. catch(RuntimeException runtimeexception)
  9437. {
  9438. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9439. }
  9440. throw new RuntimeException();
  9441.  
  9442. }
  9443.  
  9444. public String getParameter(String s)
  9445. {
  9446. if(signlink.mainapp != null)
  9447. return signlink.mainapp.getParameter(s);
  9448. else
  9449. return super.getParameter(s);
  9450. }
  9451.  
  9452. private void adjustVolume(boolean flag, int i)
  9453. {
  9454. signlink.midivol = i;
  9455. if(flag)
  9456. signlink.midi = "voladjust";
  9457. }
  9458.  
  9459. private int extractInterfaceValues(RSInterface class9, int j)
  9460. {
  9461. if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  9462. return -2;
  9463. try
  9464. {
  9465. int ai[] = class9.valueIndexArray[j];
  9466. int k = 0;
  9467. int l = 0;
  9468. int i1 = 0;
  9469. do
  9470. {
  9471. int j1 = ai[l++];
  9472. int k1 = 0;
  9473. byte byte0 = 0;
  9474. if(j1 == 0)
  9475. return k;
  9476. if(j1 == 1)
  9477. k1 = currentStats[ai[l++]];
  9478. if(j1 == 2)
  9479. k1 = maxStats[ai[l++]];
  9480. if(j1 == 3)
  9481. k1 = currentExp[ai[l++]];
  9482. if(j1 == 4)
  9483. {
  9484. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  9485. int k2 = ai[l++];
  9486. if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  9487. {
  9488. for(int j3 = 0; j3 < class9_1.inv.length; j3++)
  9489. if(class9_1.inv[j3] == k2 + 1)
  9490. k1 += class9_1.invStackSizes[j3];
  9491.  
  9492. }
  9493. }
  9494. if(j1 == 5)
  9495. k1 = variousSettings[ai[l++]];
  9496. if(j1 == 6)
  9497. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  9498. if(j1 == 7)
  9499. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  9500. if(j1 == 8)
  9501. k1 = myPlayer.combatLevel;
  9502. if(j1 == 9)
  9503. {
  9504. for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  9505. if(Skills.skillEnabled[l1])
  9506. k1 += maxStats[l1];
  9507.  
  9508. }
  9509. if(j1 == 10)
  9510. {
  9511. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  9512. int l2 = ai[l++] + 1;
  9513. if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  9514. {
  9515. for(int k3 = 0; k3 < class9_2.inv.length; k3++)
  9516. {
  9517. if(class9_2.inv[k3] != l2)
  9518. continue;
  9519. k1 = 0x3b9ac9ff;
  9520. break;
  9521. }
  9522.  
  9523. }
  9524. }
  9525. if(j1 == 11)
  9526. k1 = energy;
  9527. if(j1 == 12)
  9528. k1 = weight;
  9529. if(j1 == 13)
  9530. {
  9531. int i2 = variousSettings[ai[l++]];
  9532. int i3 = ai[l++];
  9533. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  9534. }
  9535. if(j1 == 14)
  9536. {
  9537. int j2 = ai[l++];
  9538. VarBit varBit = VarBit.cache[j2];
  9539. int l3 = varBit.anInt648;
  9540. int i4 = varBit.anInt649;
  9541. int j4 = varBit.anInt650;
  9542. int k4 = anIntArray1232[j4 - i4];
  9543. k1 = variousSettings[l3] >> i4 & k4;
  9544. }
  9545. if(j1 == 15)
  9546. byte0 = 1;
  9547. if(j1 == 16)
  9548. byte0 = 2;
  9549. if(j1 == 17)
  9550. byte0 = 3;
  9551. if(j1 == 18)
  9552. k1 = (myPlayer.x >> 7) + baseX;
  9553. if(j1 == 19)
  9554. k1 = (myPlayer.y >> 7) + baseY;
  9555. if(j1 == 20)
  9556. k1 = ai[l++];
  9557. if(byte0 == 0)
  9558. {
  9559. if(i1 == 0)
  9560. k += k1;
  9561. if(i1 == 1)
  9562. k -= k1;
  9563. if(i1 == 2 && k1 != 0)
  9564. k /= k1;
  9565. if(i1 == 3)
  9566. k *= k1;
  9567. i1 = 0;
  9568. } else
  9569. {
  9570. i1 = byte0;
  9571. }
  9572. } while(true);
  9573. }
  9574. catch(Exception _ex)
  9575. {
  9576. return -1;
  9577. }
  9578. }
  9579.  
  9580. private void drawTooltip() {
  9581. if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  9582. return;
  9583. String s;
  9584. if(itemSelected == 1 && menuActionRow < 2)
  9585. s = "Use " + selectedItemName + " with...";
  9586. else if(spellSelected == 1 && menuActionRow < 2)
  9587. s = spellTooltip + "...";
  9588. else
  9589. s = menuActionName[menuActionRow - 1];
  9590. if(menuActionRow > 2)
  9591. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  9592. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  9593. }
  9594.  
  9595. private void drawMinimap() {
  9596. aRSImageProducer_1164.initDrawingArea();
  9597. if(anInt1021 == 2) {
  9598. byte abyte0[] = mapBack.aByteArray1450;
  9599. int ai[] = DrawingArea.pixels;
  9600. int k2 = abyte0.length;
  9601. for(int i5 = 0; i5 < k2; i5++)
  9602. if(abyte0[i5] == 0)
  9603. ai[i5] = 0;
  9604. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 0, 0, 33, 25);
  9605. aRSImageProducer_1165.initDrawingArea();
  9606. return;
  9607. }
  9608. int i = minimapInt1 + minimapInt2 & 0x7ff;
  9609. int j = 48 + myPlayer.x / 32;
  9610. int l2 = 464 - myPlayer.y / 32;
  9611. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, 5, 25, 146, j);
  9612. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 0, 0, 33, 25);
  9613. for(int j5 = 0; j5 < anInt1071; j5++) {
  9614. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  9615. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  9616. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  9617. }
  9618. for(int k5 = 0; k5 < 104; k5++) {
  9619. for(int l5 = 0; l5 < 104; l5++) {
  9620. NodeList class19 = groundArray[plane][k5][l5];
  9621. if(class19 != null) {
  9622. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  9623. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  9624. markMinimap(mapDotItem, l, j3);
  9625. }
  9626. }
  9627. }
  9628. for(int i6 = 0; i6 < npcCount; i6++) {
  9629. NPC npc = npcArray[npcIndices[i6]];
  9630. if(npc != null && npc.isVisible()) {
  9631. EntityDef entityDef = npc.desc;
  9632. if(entityDef.childrenIDs != null)
  9633. entityDef = entityDef.method161();
  9634. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  9635. int i1 = npc.x / 32 - myPlayer.x / 32;
  9636. int k3 = npc.y / 32 - myPlayer.y / 32;
  9637. markMinimap(mapDotNPC, i1, k3);
  9638. }
  9639. }
  9640. }
  9641. for(int j6 = 0; j6 < playerCount; j6++) {
  9642. Player player = playerArray[playerIndices[j6]];
  9643. if(player != null && player.isVisible()) {
  9644. int j1 = player.x / 32 - myPlayer.x / 32;
  9645. int l3 = player.y / 32 - myPlayer.y / 32;
  9646. boolean flag1 = false;
  9647. boolean flag3 = false;
  9648. for (int j3 = 0; j3 < clanList.length; j3++) {
  9649. if (clanList[j3] == null)
  9650. continue;
  9651. if (!clanList[j3].equalsIgnoreCase(player.name))
  9652. continue;
  9653. flag3 = true;
  9654. break;
  9655. }
  9656. long l6 = TextClass.longForName(player.name);
  9657. for(int k6 = 0; k6 < friendsCount; k6++) {
  9658. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  9659. continue;
  9660. flag1 = true;
  9661. break;
  9662. }
  9663. boolean flag2 = false;
  9664. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  9665. flag2 = true;
  9666. if(flag1)
  9667. markMinimap(mapDotFriend, j1, l3);
  9668. else if(flag3)
  9669. markMinimap(mapDotClan, j1, l3);
  9670. else if(flag2)
  9671. markMinimap(mapDotTeam, j1, l3);
  9672. else
  9673. markMinimap(mapDotPlayer, j1, l3);
  9674. }
  9675. }
  9676. if(anInt855 != 0 && loopCycle % 20 < 10) {
  9677. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  9678. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  9679. if(class30_sub2_sub4_sub1_sub1_1 != null) {
  9680. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  9681. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  9682. method81(mapMarker, i4, k1);
  9683. }
  9684. }
  9685. if(anInt855 == 2) {
  9686. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  9687. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  9688. method81(mapMarker, j4, l1);
  9689. }
  9690. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length) {
  9691. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  9692. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  9693. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  9694. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  9695. method81(mapMarker, k4, i2);
  9696. }
  9697. }
  9698. }
  9699. if(destX != 0) {
  9700. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  9701. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  9702. markMinimap(mapFlag, j2, l4);
  9703. }
  9704. DrawingArea.drawPixels(3, 78, 97, 0xffffff, 3);
  9705. mapBack.drawBackground(0, 0);
  9706. aRSImageProducer_1165.initDrawingArea();
  9707. }
  9708.  
  9709. private void npcScreenPos(Entity entity, int i) {
  9710. calcEntityScreenPos(entity.x, i, entity.y);
  9711. }
  9712.  
  9713. private void calcEntityScreenPos(int i, int j, int l) {
  9714. if(i < 128 || l < 128 || i > 13056 || l > 13056) {
  9715. spriteDrawX = -1;
  9716. spriteDrawY = -1;
  9717. return;
  9718. }
  9719. int i1 = method42(plane, l, i) - j;
  9720. i -= xCameraPos;
  9721. i1 -= zCameraPos;
  9722. l -= yCameraPos;
  9723. int j1 = Model.modelIntArray1[yCameraCurve];
  9724. int k1 = Model.modelIntArray2[yCameraCurve];
  9725. int l1 = Model.modelIntArray1[xCameraCurve];
  9726. int i2 = Model.modelIntArray2[xCameraCurve];
  9727. int j2 = l * l1 + i * i2 >> 16;
  9728. l = l * i2 - i * l1 >> 16;
  9729. i = j2;
  9730. j2 = i1 * k1 - l * j1 >> 16;
  9731. l = i1 * j1 + l * k1 >> 16;
  9732. i1 = j2;
  9733. if(l >= 50) {
  9734. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  9735. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  9736. } else {
  9737. spriteDrawX = -1;
  9738. spriteDrawY = -1;
  9739. }
  9740. }
  9741.  
  9742. private void buildSplitPrivateChatMenu()
  9743. {
  9744. if(splitPrivateChat == 0)
  9745. return;
  9746. int i = 0;
  9747. if(anInt1104 != 0)
  9748. i = 1;
  9749. for(int j = 0; j < 100; j++)
  9750. if(chatMessages[j] != null)
  9751. {
  9752. int k = chatTypes[j];
  9753. String s = chatNames[j];
  9754. boolean flag1 = false;
  9755. if(s != null && s.startsWith("@cr1@"))
  9756. {
  9757. s = s.substring(5);
  9758. boolean flag2 = true;
  9759. }
  9760. if(s != null && s.startsWith("@cr2@"))
  9761. {
  9762. s = s.substring(5);
  9763. byte byte0 = 2;
  9764. }
  9765. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  9766. {
  9767. int l = 329 - i * 13;
  9768. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  9769. {
  9770. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  9771. if(i1 > 450)
  9772. i1 = 450;
  9773. if(super.mouseX < 4 + i1)
  9774. {
  9775. if(myPrivilege >= 1)
  9776. {
  9777. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  9778. menuActionID[menuActionRow] = 2606;
  9779. menuActionRow++;
  9780. }
  9781. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  9782. menuActionID[menuActionRow] = 2042;
  9783. menuActionRow++;
  9784. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  9785. menuActionID[menuActionRow] = 2337;
  9786. menuActionRow++;
  9787. }
  9788. }
  9789. if(++i >= 5)
  9790. return;
  9791. }
  9792. if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  9793. return;
  9794. }
  9795.  
  9796. }
  9797.  
  9798. private void method130(int j, int k, int l, int i1, int j1, int k1,
  9799. int l1, int i2, int j2)
  9800. {
  9801. Class30_Sub1 class30_sub1 = null;
  9802. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  9803. {
  9804. if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  9805. continue;
  9806. class30_sub1 = class30_sub1_1;
  9807. break;
  9808. }
  9809.  
  9810. if(class30_sub1 == null)
  9811. {
  9812. class30_sub1 = new Class30_Sub1();
  9813. class30_sub1.anInt1295 = l1;
  9814. class30_sub1.anInt1296 = i1;
  9815. class30_sub1.anInt1297 = i2;
  9816. class30_sub1.anInt1298 = j1;
  9817. method89(class30_sub1);
  9818. aClass19_1179.insertHead(class30_sub1);
  9819. }
  9820. class30_sub1.anInt1291 = k;
  9821. class30_sub1.anInt1293 = k1;
  9822. class30_sub1.anInt1292 = l;
  9823. class30_sub1.anInt1302 = j2;
  9824. class30_sub1.anInt1294 = j;
  9825. }
  9826.  
  9827. private boolean interfaceIsSelected(RSInterface class9)
  9828. {
  9829. if(class9.anIntArray245 == null)
  9830. return false;
  9831. for(int i = 0; i < class9.anIntArray245.length; i++)
  9832. {
  9833. int j = extractInterfaceValues(class9, i);
  9834. int k = class9.anIntArray212[i];
  9835. if(class9.anIntArray245[i] == 2)
  9836. {
  9837. if(j >= k)
  9838. return false;
  9839. } else
  9840. if(class9.anIntArray245[i] == 3)
  9841. {
  9842. if(j <= k)
  9843. return false;
  9844. } else
  9845. if(class9.anIntArray245[i] == 4)
  9846. {
  9847. if(j == k)
  9848. return false;
  9849. } else
  9850. if(j != k)
  9851. return false;
  9852. }
  9853.  
  9854. return true;
  9855. }
  9856.  
  9857. private DataInputStream openJagGrabInputStream(String s)
  9858. throws IOException
  9859. {
  9860. // if(!aBoolean872)
  9861. // if(signlink.mainapp != null)
  9862. // return signlink.openurl(s);
  9863. // else
  9864. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  9865. if(aSocket832 != null)
  9866. {
  9867. try
  9868. {
  9869. aSocket832.close();
  9870. }
  9871. catch(Exception _ex) { }
  9872. aSocket832 = null;
  9873. }
  9874. aSocket832 = openSocket(43595);
  9875. aSocket832.setSoTimeout(10000);
  9876. java.io.InputStream inputstream = aSocket832.getInputStream();
  9877. OutputStream outputstream = aSocket832.getOutputStream();
  9878. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  9879. return new DataInputStream(inputstream);
  9880. }
  9881.  
  9882. private void doFlamesDrawing()
  9883. {
  9884. char c = '\u0100';
  9885. if(anInt1040 > 0)
  9886. {
  9887. for(int i = 0; i < 256; i++)
  9888. if(anInt1040 > 768)
  9889. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  9890. else
  9891. if(anInt1040 > 256)
  9892. anIntArray850[i] = anIntArray852[i];
  9893. else
  9894. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  9895.  
  9896. } else
  9897. if(anInt1041 > 0)
  9898. {
  9899. for(int j = 0; j < 256; j++)
  9900. if(anInt1041 > 768)
  9901. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  9902. else
  9903. if(anInt1041 > 256)
  9904. anIntArray850[j] = anIntArray853[j];
  9905. else
  9906. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  9907.  
  9908. } else
  9909. {
  9910. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  9911.  
  9912. }
  9913. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, aRSImageProducer_1110.anIntArray315, 0, 33920);
  9914.  
  9915. int i1 = 0;
  9916. int j1 = 1152;
  9917. for(int k1 = 1; k1 < c - 1; k1++)
  9918. {
  9919. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  9920. int j2 = 22 + l1;
  9921. if(j2 < 0)
  9922. j2 = 0;
  9923. i1 += j2;
  9924. for(int l2 = j2; l2 < 128; l2++)
  9925. {
  9926. int j3 = anIntArray828[i1++];
  9927. if(j3 != 0)
  9928. {
  9929. int l3 = j3;
  9930. int j4 = 256 - j3;
  9931. j3 = anIntArray850[j3];
  9932. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  9933. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  9934. } else
  9935. {
  9936. j1++;
  9937. }
  9938. }
  9939.  
  9940. j1 += j2;
  9941. }
  9942.  
  9943. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  9944. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, aRSImageProducer_1111.anIntArray315, 0, 33920);
  9945.  
  9946. i1 = 0;
  9947. j1 = 1176;
  9948. for(int k2 = 1; k2 < c - 1; k2++)
  9949. {
  9950. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  9951. int k3 = 103 - i3;
  9952. j1 += i3;
  9953. for(int i4 = 0; i4 < k3; i4++)
  9954. {
  9955. int k4 = anIntArray828[i1++];
  9956. if(k4 != 0)
  9957. {
  9958. int i5 = k4;
  9959. int j5 = 256 - k4;
  9960. k4 = anIntArray850[k4];
  9961. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  9962. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  9963. } else
  9964. {
  9965. j1++;
  9966. }
  9967. }
  9968.  
  9969. i1 += 128 - k3;
  9970. j1 += 128 - k3 - i3;
  9971. }
  9972.  
  9973. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  9974. }
  9975.  
  9976. private void method134(Stream stream)
  9977. {
  9978. int j = stream.readBits(8);
  9979. if(j < playerCount)
  9980. {
  9981. for(int k = j; k < playerCount; k++)
  9982. anIntArray840[anInt839++] = playerIndices[k];
  9983.  
  9984. }
  9985. if(j > playerCount)
  9986. {
  9987. signlink.reporterror(myUsername + " Too many players");
  9988. throw new RuntimeException("eek");
  9989. }
  9990. playerCount = 0;
  9991. for(int l = 0; l < j; l++)
  9992. {
  9993. int i1 = playerIndices[l];
  9994. Player player = playerArray[i1];
  9995. int j1 = stream.readBits(1);
  9996. if(j1 == 0)
  9997. {
  9998. playerIndices[playerCount++] = i1;
  9999. player.anInt1537 = loopCycle;
  10000. } else
  10001. {
  10002. int k1 = stream.readBits(2);
  10003. if(k1 == 0)
  10004. {
  10005. playerIndices[playerCount++] = i1;
  10006. player.anInt1537 = loopCycle;
  10007. anIntArray894[anInt893++] = i1;
  10008. } else
  10009. if(k1 == 1)
  10010. {
  10011. playerIndices[playerCount++] = i1;
  10012. player.anInt1537 = loopCycle;
  10013. int l1 = stream.readBits(3);
  10014. player.moveInDir(false, l1);
  10015. int j2 = stream.readBits(1);
  10016. if(j2 == 1)
  10017. anIntArray894[anInt893++] = i1;
  10018. } else
  10019. if(k1 == 2)
  10020. {
  10021. playerIndices[playerCount++] = i1;
  10022. player.anInt1537 = loopCycle;
  10023. int i2 = stream.readBits(3);
  10024. player.moveInDir(true, i2);
  10025. int k2 = stream.readBits(3);
  10026. player.moveInDir(true, k2);
  10027. int l2 = stream.readBits(1);
  10028. if(l2 == 1)
  10029. anIntArray894[anInt893++] = i1;
  10030. } else
  10031. if(k1 == 3)
  10032. anIntArray840[anInt839++] = i1;
  10033. }
  10034. }
  10035. }
  10036.  
  10037. private void drawLoginScreen(boolean flag)
  10038. {
  10039. resetImageProducers();
  10040. aRSImageProducer_1109.initDrawingArea();
  10041. aBackground_966.drawBackground(0, 0);
  10042. char c = '\u0168';
  10043. char c1 = '\310';
  10044. if(loginScreenState == 0)
  10045. {
  10046. int i = c1 / 2 + 80;
  10047. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  10048. i = c1 / 2 - 20;
  10049. chatTextDrawingArea.method382(0xffff00, c / 2, "Welcome to Project Insanity", i, true);
  10050. i += 30;
  10051. int l = c / 2 - 80;
  10052. int k1 = c1 / 2 + 20;
  10053. aBackground_967.drawBackground(l - 73, k1 - 20);
  10054. chatTextDrawingArea.method382(0xffffff, l, "New User", k1 + 5, true);
  10055. l = c / 2 + 80;
  10056. aBackground_967.drawBackground(l - 73, k1 - 20);
  10057. chatTextDrawingArea.method382(0xffffff, l, "Existing User", k1 + 5, true);
  10058. }
  10059. if(loginScreenState == 2)
  10060. {
  10061. int j = c1 / 2 - 40;
  10062. if(loginMessage1.length() > 0)
  10063. {
  10064. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  10065. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j, true);
  10066. j += 30;
  10067. } else
  10068. {
  10069. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  10070. j += 30;
  10071. }
  10072. chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff, "Username: " + myUsername + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10073. j += 15;
  10074. chatTextDrawingArea.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10075. j += 15;
  10076. if(!flag)
  10077. {
  10078. int i1 = c / 2 - 80;
  10079. int l1 = c1 / 2 + 50;
  10080. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10081. chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5, true);
  10082. i1 = c / 2 + 80;
  10083. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10084. chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  10085. }
  10086. }
  10087. if(loginScreenState == 3)
  10088. {
  10089. chatTextDrawingArea.method382(0xffff00, c / 2, "Create a free account", c1 / 2 - 60, true);
  10090. int k = c1 / 2 - 35;
  10091. chatTextDrawingArea.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
  10092. k += 15;
  10093. chatTextDrawingArea.method382(0xffffff, c / 2, "go back to the main Project Insanity webpage", k, true);
  10094. k += 15;
  10095. chatTextDrawingArea.method382(0xffffff, c / 2, "and choose the red 'create account'", k, true);
  10096. k += 15;
  10097. chatTextDrawingArea.method382(0xffffff, c / 2, "button at the top right of that page.", k, true);
  10098. k += 15;
  10099. int j1 = c / 2;
  10100. int i2 = c1 / 2 + 50;
  10101. aBackground_967.drawBackground(j1 - 73, i2 - 20);
  10102. chatTextDrawingArea.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  10103. }
  10104. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  10105. if(welcomeScreenRaised)
  10106. {
  10107. welcomeScreenRaised = false;
  10108. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  10109. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  10110. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  10111. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  10112. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  10113. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  10114. }
  10115. }
  10116.  
  10117. private void drawFlames()
  10118. {
  10119. drawingFlames = true;
  10120. try
  10121. {
  10122. long l = System.currentTimeMillis();
  10123. int i = 0;
  10124. int j = 20;
  10125. while(aBoolean831)
  10126. {
  10127. anInt1208++;
  10128. calcFlamesPosition();
  10129. calcFlamesPosition();
  10130. doFlamesDrawing();
  10131. if(++i > 10)
  10132. {
  10133. long l1 = System.currentTimeMillis();
  10134. int k = (int)(l1 - l) / 10 - j;
  10135. j = 40 - k;
  10136. if(j < 5)
  10137. j = 5;
  10138. i = 0;
  10139. l = l1;
  10140. }
  10141. try
  10142. {
  10143. Thread.sleep(j);
  10144. }
  10145. catch(Exception _ex) { }
  10146. }
  10147. }
  10148. catch(Exception _ex) { }
  10149. drawingFlames = false;
  10150. }
  10151.  
  10152. public void raiseWelcomeScreen()
  10153. {
  10154. welcomeScreenRaised = true;
  10155. }
  10156.  
  10157. private void method137(Stream stream, int j)
  10158. {
  10159. if(j == 84)
  10160. {
  10161. int k = stream.readUnsignedByte();
  10162. int j3 = anInt1268 + (k >> 4 & 7);
  10163. int i6 = anInt1269 + (k & 7);
  10164. int l8 = stream.readUnsignedWord();
  10165. int k11 = stream.readUnsignedWord();
  10166. int l13 = stream.readUnsignedWord();
  10167. if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  10168. {
  10169. NodeList class19_1 = groundArray[plane][j3][i6];
  10170. if(class19_1 != null)
  10171. {
  10172. 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())
  10173. {
  10174. if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  10175. continue;
  10176. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  10177. break;
  10178. }
  10179.  
  10180. spawnGroundItem(j3, i6);
  10181. }
  10182. }
  10183. return;
  10184. }
  10185. if(j == 105)
  10186. {
  10187. int l = stream.readUnsignedByte();
  10188. int k3 = anInt1268 + (l >> 4 & 7);
  10189. int j6 = anInt1269 + (l & 7);
  10190. int i9 = stream.readUnsignedWord();
  10191. int l11 = stream.readUnsignedByte();
  10192. int i14 = l11 >> 4 & 0xf;
  10193. int i16 = l11 & 7;
  10194. 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)
  10195. {
  10196. anIntArray1207[anInt1062] = i9;
  10197. anIntArray1241[anInt1062] = i16;
  10198. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  10199. anInt1062++;
  10200. }
  10201. }
  10202. if(j == 215)
  10203. {
  10204. int i1 = stream.method435();
  10205. int l3 = stream.method428();
  10206. int k6 = anInt1268 + (l3 >> 4 & 7);
  10207. int j9 = anInt1269 + (l3 & 7);
  10208. int i12 = stream.method435();
  10209. int j14 = stream.readUnsignedWord();
  10210. if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  10211. {
  10212. Item class30_sub2_sub4_sub2_2 = new Item();
  10213. class30_sub2_sub4_sub2_2.ID = i1;
  10214. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  10215. if(groundArray[plane][k6][j9] == null)
  10216. groundArray[plane][k6][j9] = new NodeList();
  10217. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  10218. spawnGroundItem(k6, j9);
  10219. }
  10220. return;
  10221. }
  10222. if(j == 156)
  10223. {
  10224. int j1 = stream.method426();
  10225. int i4 = anInt1268 + (j1 >> 4 & 7);
  10226. int l6 = anInt1269 + (j1 & 7);
  10227. int k9 = stream.readUnsignedWord();
  10228. if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  10229. {
  10230. NodeList class19 = groundArray[plane][i4][l6];
  10231. if(class19 != null)
  10232. {
  10233. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  10234. {
  10235. if(item.ID != (k9 & 0x7fff))
  10236. continue;
  10237. item.unlink();
  10238. break;
  10239. }
  10240.  
  10241. if(class19.reverseGetFirst() == null)
  10242. groundArray[plane][i4][l6] = null;
  10243. spawnGroundItem(i4, l6);
  10244. }
  10245. }
  10246. return;
  10247. }
  10248. if(j == 160)
  10249. {
  10250. int k1 = stream.method428();
  10251. int j4 = anInt1268 + (k1 >> 4 & 7);
  10252. int i7 = anInt1269 + (k1 & 7);
  10253. int l9 = stream.method428();
  10254. int j12 = l9 >> 2;
  10255. int k14 = l9 & 3;
  10256. int j16 = anIntArray1177[j12];
  10257. int j17 = stream.method435();
  10258. if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  10259. {
  10260. int j18 = intGroundArray[plane][j4][i7];
  10261. int i19 = intGroundArray[plane][j4 + 1][i7];
  10262. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  10263. int k20 = intGroundArray[plane][j4][i7 + 1];
  10264. if(j16 == 0)
  10265. {
  10266. Object1 class10 = worldController.method296(plane, j4, i7);
  10267. if(class10 != null)
  10268. {
  10269. int k21 = class10.uid >> 14 & 0x7fff;
  10270. if(j12 == 2)
  10271. {
  10272. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  10273. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  10274. } else
  10275. {
  10276. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  10277. }
  10278. }
  10279. }
  10280. if(j16 == 1)
  10281. {
  10282. Object2 class26 = worldController.method297(j4, i7, plane);
  10283. if(class26 != null)
  10284. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  10285. }
  10286. if(j16 == 2)
  10287. {
  10288. Object5 class28 = worldController.method298(j4, i7, plane);
  10289. if(j12 == 11)
  10290. j12 = 10;
  10291. if(class28 != null)
  10292. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  10293. }
  10294. if(j16 == 3)
  10295. {
  10296. Object3 class49 = worldController.method299(i7, j4, plane);
  10297. if(class49 != null)
  10298. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  10299. }
  10300. }
  10301. return;
  10302. }
  10303. if(j == 147)
  10304. {
  10305. int l1 = stream.method428();
  10306. int k4 = anInt1268 + (l1 >> 4 & 7);
  10307. int j7 = anInt1269 + (l1 & 7);
  10308. int i10 = stream.readUnsignedWord();
  10309. byte byte0 = stream.method430();
  10310. int l14 = stream.method434();
  10311. byte byte1 = stream.method429();
  10312. int k17 = stream.readUnsignedWord();
  10313. int k18 = stream.method428();
  10314. int j19 = k18 >> 2;
  10315. int i20 = k18 & 3;
  10316. int l20 = anIntArray1177[j19];
  10317. byte byte2 = stream.readSignedByte();
  10318. int l21 = stream.readUnsignedWord();
  10319. byte byte3 = stream.method429();
  10320. Player player;
  10321. if(i10 == unknownInt10)
  10322. player = myPlayer;
  10323. else
  10324. player = playerArray[i10];
  10325. if(player != null)
  10326. {
  10327. ObjectDef class46 = ObjectDef.forID(l21);
  10328. int i22 = intGroundArray[plane][k4][j7];
  10329. int j22 = intGroundArray[plane][k4 + 1][j7];
  10330. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  10331. int l22 = intGroundArray[plane][k4][j7 + 1];
  10332. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  10333. if(model != null)
  10334. {
  10335. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  10336. player.anInt1707 = l14 + loopCycle;
  10337. player.anInt1708 = k17 + loopCycle;
  10338. player.aModel_1714 = model;
  10339. int i23 = class46.anInt744;
  10340. int j23 = class46.anInt761;
  10341. if(i20 == 1 || i20 == 3)
  10342. {
  10343. i23 = class46.anInt761;
  10344. j23 = class46.anInt744;
  10345. }
  10346. player.anInt1711 = k4 * 128 + i23 * 64;
  10347. player.anInt1713 = j7 * 128 + j23 * 64;
  10348. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  10349. if(byte2 > byte0)
  10350. {
  10351. byte byte4 = byte2;
  10352. byte2 = byte0;
  10353. byte0 = byte4;
  10354. }
  10355. if(byte3 > byte1)
  10356. {
  10357. byte byte5 = byte3;
  10358. byte3 = byte1;
  10359. byte1 = byte5;
  10360. }
  10361. player.anInt1719 = k4 + byte2;
  10362. player.anInt1721 = k4 + byte0;
  10363. player.anInt1720 = j7 + byte3;
  10364. player.anInt1722 = j7 + byte1;
  10365. }
  10366. }
  10367. }
  10368. if(j == 151)
  10369. {
  10370. int i2 = stream.method426();
  10371. int l4 = anInt1268 + (i2 >> 4 & 7);
  10372. int k7 = anInt1269 + (i2 & 7);
  10373. int j10 = stream.method434();
  10374. int k12 = stream.method428();
  10375. int i15 = k12 >> 2;
  10376. int k16 = k12 & 3;
  10377. int l17 = anIntArray1177[i15];
  10378. if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  10379. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  10380. return;
  10381. }
  10382. if(j == 4)
  10383. {
  10384. int j2 = stream.readUnsignedByte();
  10385. int i5 = anInt1268 + (j2 >> 4 & 7);
  10386. int l7 = anInt1269 + (j2 & 7);
  10387. int k10 = stream.readUnsignedWord();
  10388. int l12 = stream.readUnsignedByte();
  10389. int j15 = stream.readUnsignedWord();
  10390. if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  10391. {
  10392. i5 = i5 * 128 + 64;
  10393. l7 = l7 * 128 + 64;
  10394. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  10395. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  10396. }
  10397. return;
  10398. }
  10399. if(j == 44)
  10400. {
  10401. int k2 = stream.method436();
  10402. int j5 = stream.readUnsignedWord();
  10403. int i8 = stream.readUnsignedByte();
  10404. int l10 = anInt1268 + (i8 >> 4 & 7);
  10405. int i13 = anInt1269 + (i8 & 7);
  10406. if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  10407. {
  10408. Item class30_sub2_sub4_sub2_1 = new Item();
  10409. class30_sub2_sub4_sub2_1.ID = k2;
  10410. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  10411. if(groundArray[plane][l10][i13] == null)
  10412. groundArray[plane][l10][i13] = new NodeList();
  10413. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  10414. spawnGroundItem(l10, i13);
  10415. }
  10416. return;
  10417. }
  10418. if(j == 101)
  10419. {
  10420. int l2 = stream.method427();
  10421. int k5 = l2 >> 2;
  10422. int j8 = l2 & 3;
  10423. int i11 = anIntArray1177[k5];
  10424. int j13 = stream.readUnsignedByte();
  10425. int k15 = anInt1268 + (j13 >> 4 & 7);
  10426. int l16 = anInt1269 + (j13 & 7);
  10427. if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  10428. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  10429. return;
  10430. }
  10431. if(j == 117)
  10432. {
  10433. int i3 = stream.readUnsignedByte();
  10434. int l5 = anInt1268 + (i3 >> 4 & 7);
  10435. int k8 = anInt1269 + (i3 & 7);
  10436. int j11 = l5 + stream.readSignedByte();
  10437. int k13 = k8 + stream.readSignedByte();
  10438. int l15 = stream.readSignedWord();
  10439. int i17 = stream.readUnsignedWord();
  10440. int i18 = stream.readUnsignedByte() * 4;
  10441. int l18 = stream.readUnsignedByte() * 4;
  10442. int k19 = stream.readUnsignedWord();
  10443. int j20 = stream.readUnsignedWord();
  10444. int i21 = stream.readUnsignedByte();
  10445. int j21 = stream.readUnsignedByte();
  10446. if(l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535)
  10447. {
  10448. l5 = l5 * 128 + 64;
  10449. k8 = k8 * 128 + 64;
  10450. j11 = j11 * 128 + 64;
  10451. k13 = k13 * 128 + 64;
  10452. 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);
  10453. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  10454. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  10455. }
  10456. }
  10457. }
  10458.  
  10459. private static void setLowMem()
  10460. {
  10461. WorldController.lowMem = true;
  10462. Texture.lowMem = true;
  10463. lowMem = true;
  10464. ObjectManager.lowMem = true;
  10465. ObjectDef.lowMem = true;
  10466. }
  10467.  
  10468. private void method139(Stream stream)
  10469. {
  10470. stream.initBitAccess();
  10471. int k = stream.readBits(8);
  10472. if(k < npcCount)
  10473. {
  10474. for(int l = k; l < npcCount; l++)
  10475. anIntArray840[anInt839++] = npcIndices[l];
  10476.  
  10477. }
  10478. if(k > npcCount)
  10479. {
  10480. signlink.reporterror(myUsername + " Too many npcs");
  10481. throw new RuntimeException("eek");
  10482. }
  10483. npcCount = 0;
  10484. for(int i1 = 0; i1 < k; i1++)
  10485. {
  10486. int j1 = npcIndices[i1];
  10487. NPC npc = npcArray[j1];
  10488. int k1 = stream.readBits(1);
  10489. if(k1 == 0)
  10490. {
  10491. npcIndices[npcCount++] = j1;
  10492. npc.anInt1537 = loopCycle;
  10493. } else
  10494. {
  10495. int l1 = stream.readBits(2);
  10496. if(l1 == 0)
  10497. {
  10498. npcIndices[npcCount++] = j1;
  10499. npc.anInt1537 = loopCycle;
  10500. anIntArray894[anInt893++] = j1;
  10501. } else
  10502. if(l1 == 1)
  10503. {
  10504. npcIndices[npcCount++] = j1;
  10505. npc.anInt1537 = loopCycle;
  10506. int i2 = stream.readBits(3);
  10507. npc.moveInDir(false, i2);
  10508. int k2 = stream.readBits(1);
  10509. if(k2 == 1)
  10510. anIntArray894[anInt893++] = j1;
  10511. } else
  10512. if(l1 == 2)
  10513. {
  10514. npcIndices[npcCount++] = j1;
  10515. npc.anInt1537 = loopCycle;
  10516. int j2 = stream.readBits(3);
  10517. npc.moveInDir(true, j2);
  10518. int l2 = stream.readBits(3);
  10519. npc.moveInDir(true, l2);
  10520. int i3 = stream.readBits(1);
  10521. if(i3 == 1)
  10522. anIntArray894[anInt893++] = j1;
  10523. } else
  10524. if(l1 == 3)
  10525. anIntArray840[anInt839++] = j1;
  10526. }
  10527. }
  10528.  
  10529. }
  10530.  
  10531. private void processLoginScreenInput()
  10532. {
  10533. if(loginScreenState == 0)
  10534. {
  10535. int i = super.myWidth / 2 - 80;
  10536. int l = super.myHeight / 2 + 20;
  10537. l += 20;
  10538. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  10539. {
  10540. loginScreenState = 3;
  10541. loginScreenCursorPos = 0;
  10542. }
  10543. i = super.myWidth / 2 + 80;
  10544. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  10545. {
  10546. loginMessage1 = "";
  10547. loginMessage2 = "Enter your username & password.";
  10548. loginScreenState = 2;
  10549. loginScreenCursorPos = 0;
  10550. }
  10551. } else
  10552. {
  10553. if(loginScreenState == 2)
  10554. {
  10555. int j = super.myHeight / 2 - 40;
  10556. j += 30;
  10557. j += 25;
  10558. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10559. loginScreenCursorPos = 0;
  10560. j += 15;
  10561. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10562. loginScreenCursorPos = 1;
  10563. j += 15;
  10564. int i1 = super.myWidth / 2 - 80;
  10565. int k1 = super.myHeight / 2 + 50;
  10566. k1 += 20;
  10567. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  10568. {
  10569. loginFailures = 0;
  10570. login(myUsername, myPassword, false);
  10571. if(loggedIn)
  10572. return;
  10573. }
  10574. i1 = super.myWidth / 2 + 80;
  10575. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  10576. {
  10577. loginScreenState = 0;
  10578. // myUsername = "";
  10579. // myPassword = "";
  10580. }
  10581. do
  10582. {
  10583. int l1 = readChar(-796);
  10584. if(l1 == -1)
  10585. break;
  10586. boolean flag1 = false;
  10587. for(int i2 = 0; i2 < validUserPassChars.length(); i2++)
  10588. {
  10589. if(l1 != validUserPassChars.charAt(i2))
  10590. continue;
  10591. flag1 = true;
  10592. break;
  10593. }
  10594.  
  10595. if(loginScreenCursorPos == 0)
  10596. {
  10597. if(l1 == 8 && myUsername.length() > 0)
  10598. myUsername = myUsername.substring(0, myUsername.length() - 1);
  10599. if(l1 == 9 || l1 == 10 || l1 == 13)
  10600. loginScreenCursorPos = 1;
  10601. if(flag1)
  10602. myUsername += (char)l1;
  10603. if(myUsername.length() > 12)
  10604. myUsername = myUsername.substring(0, 12);
  10605. } else
  10606. if(loginScreenCursorPos == 1)
  10607. {
  10608. if(l1 == 8 && myPassword.length() > 0)
  10609. myPassword = myPassword.substring(0, myPassword.length() - 1);
  10610. if(l1 == 9 || l1 == 10 || l1 == 13)
  10611. loginScreenCursorPos = 0;
  10612. if(flag1)
  10613. myPassword += (char)l1;
  10614. if(myPassword.length() > 20)
  10615. myPassword = myPassword.substring(0, 20);
  10616. }
  10617. } while(true);
  10618. return;
  10619. }
  10620. if(loginScreenState == 3)
  10621. {
  10622. int k = super.myWidth / 2;
  10623. int j1 = super.myHeight / 2 + 50;
  10624. j1 += 20;
  10625. if(super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75 && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  10626. loginScreenState = 0;
  10627. }
  10628. }
  10629. }
  10630.  
  10631. private void markMinimap(Sprite sprite, int i, int j) {
  10632. int k = minimapInt1 + minimapInt2 & 0x7ff;
  10633. int l = i * i + j * j;
  10634. if(l > 6400)
  10635. return;
  10636. int i1 = Model.modelIntArray1[k];
  10637. int j1 = Model.modelIntArray2[k];
  10638. i1 = (i1 * 256) / (minimapInt3 + 256);
  10639. j1 = (j1 * 256) / (minimapInt3 + 256);
  10640. int k1 = j * i1 + i * j1 >> 16;
  10641. int l1 = j * j1 - i * i1 >> 16;
  10642. if(l > 2500) {
  10643. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 , 83 - l1 - sprite.anInt1445 / 2 - 4);
  10644. } else {
  10645. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4, 83 - l1 - sprite.anInt1445 / 2 - 4);
  10646. }
  10647. }
  10648.  
  10649. private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  10650. )
  10651. {
  10652. if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  10653. {
  10654. if(lowMem && j != plane)
  10655. return;
  10656. int i2 = 0;
  10657. if(j1 == 0)
  10658. i2 = worldController.method300(j, i1, i);
  10659. if(j1 == 1)
  10660. i2 = worldController.method301(j, i1, i);
  10661. if(j1 == 2)
  10662. i2 = worldController.method302(j, i1, i);
  10663. if(j1 == 3)
  10664. i2 = worldController.method303(j, i1, i);
  10665. if(i2 != 0)
  10666. {
  10667. int i3 = worldController.method304(j, i1, i, i2);
  10668. int j2 = i2 >> 14 & 0x7fff;
  10669. int k2 = i3 & 0x1f;
  10670. int l2 = i3 >> 6;
  10671. if(j1 == 0)
  10672. {
  10673. worldController.method291(i1, j, i, (byte)-119);
  10674. ObjectDef class46 = ObjectDef.forID(j2);
  10675. if(class46.aBoolean767)
  10676. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  10677. }
  10678. if(j1 == 1)
  10679. worldController.method292(i, j, i1);
  10680. if(j1 == 2)
  10681. {
  10682. worldController.method293(j, i1, i);
  10683. ObjectDef class46_1 = ObjectDef.forID(j2);
  10684. if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  10685. return;
  10686. if(class46_1.aBoolean767)
  10687. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  10688. }
  10689. if(j1 == 3)
  10690. {
  10691. worldController.method294(j, i, i1);
  10692. ObjectDef class46_2 = ObjectDef.forID(j2);
  10693. if(class46_2.aBoolean767 && class46_2.hasActions)
  10694. aClass11Array1230[j].method218(i, i1);
  10695. }
  10696. }
  10697. if(k1 >= 0)
  10698. {
  10699. int j3 = j;
  10700. if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  10701. j3++;
  10702. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  10703. }
  10704. }
  10705. }
  10706.  
  10707. private void updatePlayers(int i, Stream stream)
  10708. {
  10709. anInt839 = 0;
  10710. anInt893 = 0;
  10711. method117(stream);
  10712. method134(stream);
  10713. method91(stream, i);
  10714. method49(stream);
  10715. for(int k = 0; k < anInt839; k++)
  10716. {
  10717. int l = anIntArray840[k];
  10718. if(playerArray[l].anInt1537 != loopCycle)
  10719. playerArray[l] = null;
  10720. }
  10721.  
  10722. if(stream.currentOffset != i)
  10723. {
  10724. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  10725. throw new RuntimeException("eek");
  10726. }
  10727. for(int i1 = 0; i1 < playerCount; i1++)
  10728. if(playerArray[playerIndices[i1]] == null)
  10729. {
  10730. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  10731. throw new RuntimeException("eek");
  10732. }
  10733.  
  10734. }
  10735.  
  10736. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  10737. {
  10738. int l1 = 2048 - k & 0x7ff;
  10739. int i2 = 2048 - j1 & 0x7ff;
  10740. int j2 = 0;
  10741. int k2 = 0;
  10742. int l2 = j;
  10743. if(l1 != 0)
  10744. {
  10745. int i3 = Model.modelIntArray1[l1];
  10746. int k3 = Model.modelIntArray2[l1];
  10747. int i4 = k2 * k3 - l2 * i3 >> 16;
  10748. l2 = k2 * i3 + l2 * k3 >> 16;
  10749. k2 = i4;
  10750. }
  10751. if(i2 != 0)
  10752. {
  10753. /* xxx if(cameratoggle){
  10754. if(zoom == 0)
  10755. zoom = k2;
  10756. if(lftrit == 0)
  10757. lftrit = j2;
  10758. if(fwdbwd == 0)
  10759. fwdbwd = l2;
  10760. k2 = zoom;
  10761. j2 = lftrit;
  10762. l2 = fwdbwd;
  10763. }
  10764. */
  10765. int j3 = Model.modelIntArray1[i2];
  10766. int l3 = Model.modelIntArray2[i2];
  10767. int j4 = l2 * j3 + j2 * l3 >> 16;
  10768. l2 = l2 * l3 - j2 * j3 >> 16;
  10769. j2 = j4;
  10770. }
  10771. xCameraPos = l - j2;
  10772. zCameraPos = i1 - k2;
  10773. yCameraPos = k1 - l2;
  10774. yCameraCurve = k;
  10775. xCameraCurve = j1;
  10776. }
  10777.  
  10778. public void updateStrings(String str, int i) {
  10779. switch(i) {
  10780. case 1675: sendFrame126(str, 17508); break;//Stab
  10781. case 1676: sendFrame126(str, 17509); break;//Slash
  10782. case 1677: sendFrame126(str, 17510); break;//Cursh
  10783. case 1678: sendFrame126(str, 17511); break;//Magic
  10784. case 1679: sendFrame126(str, 17512); break;//Range
  10785. case 1680: sendFrame126(str, 17513); break;//Stab
  10786. case 1681: sendFrame126(str, 17514); break;//Slash
  10787. case 1682: sendFrame126(str, 17515); break;//Crush
  10788. case 1683: sendFrame126(str, 17516); break;//Magic
  10789. case 1684: sendFrame126(str, 17517); break;//Range
  10790. case 1686: sendFrame126(str, 17518); break;//Strength
  10791. case 1687: sendFrame126(str, 17519); break;//Prayer
  10792. }
  10793. }
  10794.  
  10795. public void sendFrame126(String str,int i) {
  10796. RSInterface.interfaceCache[i].message = str;
  10797. if(RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  10798. needDrawTabArea = true;
  10799. }
  10800.  
  10801. public void sendPacket185(int button,int toggle,int type) {
  10802. switch(type) {
  10803. case 135:
  10804. RSInterface class9 = RSInterface.interfaceCache[button];
  10805. boolean flag8 = true;
  10806. if(class9.contentType > 0)
  10807. flag8 = promptUserForInput(class9);
  10808. if(flag8) {
  10809. stream.createFrame(185);
  10810. stream.writeWord(button);
  10811. }
  10812. break;
  10813. case 646:
  10814. stream.createFrame(185);
  10815. stream.writeWord(button);
  10816. RSInterface class9_2 = RSInterface.interfaceCache[button];
  10817. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  10818. if(variousSettings[toggle] != class9_2.anIntArray212[0]) {
  10819. variousSettings[toggle] = class9_2.anIntArray212[0];
  10820. method33(toggle);
  10821. needDrawTabArea = true;
  10822. }
  10823. }
  10824. break;
  10825. case 169:
  10826. stream.createFrame(185);
  10827. stream.writeWord(button);
  10828. RSInterface class9_3 = RSInterface.interfaceCache[button];
  10829. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  10830. variousSettings[toggle] = 1 - variousSettings[toggle];
  10831. method33(toggle);
  10832. needDrawTabArea = true;
  10833. }
  10834. switch(button) {
  10835. case 19136:
  10836. System.out.println("toggle = "+toggle);
  10837. if(toggle == 0)
  10838. sendFrame36(173,toggle);
  10839. if(toggle == 1)
  10840. sendPacket185(153,173,646);
  10841. break;
  10842. }
  10843. break;
  10844. }
  10845. }
  10846.  
  10847. public void sendFrame36(int id,int state) {
  10848. anIntArray1045[id] = state;
  10849. if(variousSettings[id] != state) {
  10850. variousSettings[id] = state;
  10851. method33(id);
  10852. needDrawTabArea = true;
  10853. if(dialogID != -1)
  10854. inputTaken = true;
  10855. }
  10856. }
  10857.  
  10858. public void sendFrame219() {
  10859. if(invOverlayInterfaceID != -1) {
  10860. invOverlayInterfaceID = -1;
  10861. needDrawTabArea = true;
  10862. tabAreaAltered = true;
  10863. }
  10864. if(backDialogID != -1) {
  10865. backDialogID = -1;
  10866. inputTaken = true;
  10867. }
  10868. if(inputDialogState != 0) {
  10869. inputDialogState = 0;
  10870. inputTaken = true;
  10871. }
  10872. openInterfaceID = -1;
  10873. aBoolean1149 = false;
  10874. }
  10875.  
  10876. public void sendFrame248(int interfaceID,int sideInterfaceID) {
  10877. if(backDialogID != -1) {
  10878. backDialogID = -1;
  10879. inputTaken = true;
  10880. }
  10881. if(inputDialogState != 0) {
  10882. inputDialogState = 0;
  10883. inputTaken = true;
  10884. }
  10885. openInterfaceID = interfaceID;
  10886. invOverlayInterfaceID = sideInterfaceID;
  10887. needDrawTabArea = true;
  10888. tabAreaAltered = true;
  10889. aBoolean1149 = false;
  10890. }
  10891.  
  10892. private boolean parsePacket() {
  10893. if(socketStream == null)
  10894. return false;
  10895. try {
  10896. int i = socketStream.available();
  10897. if(i == 0)
  10898. return false;
  10899. if(pktType == -1) {
  10900. socketStream.flushInputStream(inStream.buffer, 1);
  10901. pktType = inStream.buffer[0] & 0xff;
  10902. if(encryption != null)
  10903. pktType = pktType - encryption.getNextKey() & 0xff;
  10904. pktSize = SizeConstants.packetSizes[pktType];
  10905. i--;
  10906. }
  10907. if(pktSize == -1)
  10908. if(i > 0) {
  10909. socketStream.flushInputStream(inStream.buffer, 1);
  10910. pktSize = inStream.buffer[0] & 0xff;
  10911. i--;
  10912. } else {
  10913. return false;
  10914. }
  10915. if(pktSize == -2)
  10916. if(i > 1) {
  10917. socketStream.flushInputStream(inStream.buffer, 2);
  10918. inStream.currentOffset = 0;
  10919. pktSize = inStream.readUnsignedWord();
  10920. i -= 2;
  10921. } else {
  10922. return false;
  10923. }
  10924. if(i < pktSize)
  10925. return false;
  10926. inStream.currentOffset = 0;
  10927. socketStream.flushInputStream(inStream.buffer, pktSize);
  10928. anInt1009 = 0;
  10929. anInt843 = anInt842;
  10930. anInt842 = anInt841;
  10931. anInt841 = pktType;
  10932. switch(pktType) {
  10933. case 81:
  10934. updatePlayers(pktSize, inStream);
  10935. aBoolean1080 = false;
  10936. pktType = -1;
  10937. return true;
  10938.  
  10939. case 176:
  10940. daysSinceRecovChange = inStream.method427();
  10941. unreadMessages = inStream.method435();
  10942. membersInt = inStream.readUnsignedByte();
  10943. anInt1193 = inStream.method440();
  10944. daysSinceLastLogin = inStream.readUnsignedWord();
  10945. if(anInt1193 != 0 && openInterfaceID == -1) {
  10946. signlink.dnslookup(TextClass.method586(anInt1193));
  10947. clearTopInterfaces();
  10948. char c = '\u028A';
  10949. if(daysSinceRecovChange != 201 || membersInt == 1)
  10950. c = '\u028F';
  10951. reportAbuseInput = "";
  10952. canMute = false;
  10953. for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  10954. if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  10955. continue;
  10956. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  10957.  
  10958. }
  10959. }
  10960. pktType = -1;
  10961. return true;
  10962.  
  10963. case 64:
  10964. anInt1268 = inStream.method427();
  10965. anInt1269 = inStream.method428();
  10966. for(int j = anInt1268; j < anInt1268 + 8; j++) {
  10967. for(int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  10968. if(groundArray[plane][j][l9] != null) {
  10969. groundArray[plane][j][l9] = null;
  10970. spawnGroundItem(j, l9);
  10971. }
  10972. }
  10973. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10974. if(class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  10975. class30_sub1.anInt1294 = 0;
  10976. pktType = -1;
  10977. return true;
  10978.  
  10979. case 185:
  10980. int k = inStream.method436();
  10981. RSInterface.interfaceCache[k].anInt233 = 3;
  10982. if(myPlayer.desc == null)
  10983. 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];
  10984. else
  10985. RSInterface.interfaceCache[k].mediaID = (int)(0x12345678L + myPlayer.desc.type);
  10986. pktType = -1;
  10987. return true;
  10988.  
  10989. /* Clan chat packet */
  10990. case 217:
  10991. try {
  10992. name = inStream.readString();
  10993. message = inStream.readString();
  10994. clanname = inStream.readString();
  10995. rights = inStream.readUnsignedWord();
  10996. //message = TextInput.processText(message);
  10997. //message = Censor.doCensor(message);
  10998. System.out.println(clanname);
  10999. pushMessage(message, 16, name);
  11000. } catch(Exception e) {
  11001. e.printStackTrace();
  11002. }
  11003. pktType = -1;
  11004. return true;
  11005.  
  11006. case 107:
  11007. aBoolean1160 = false;
  11008. for(int l = 0; l < 5; l++)
  11009. aBooleanArray876[l] = false;
  11010. pktType = -1;
  11011. return true;
  11012.  
  11013. case 72:
  11014. int i1 = inStream.method434();
  11015. RSInterface class9 = RSInterface.interfaceCache[i1];
  11016. for(int k15 = 0; k15 < class9.inv.length; k15++) {
  11017. class9.inv[k15] = -1;
  11018. class9.inv[k15] = 0;
  11019. }
  11020. pktType = -1;
  11021. return true;
  11022.  
  11023. case 214:
  11024. ignoreCount = pktSize / 8;
  11025. for(int j1 = 0; j1 < ignoreCount; j1++)
  11026. ignoreListAsLongs[j1] = inStream.readQWord();
  11027. pktType = -1;
  11028. return true;
  11029.  
  11030. case 166:
  11031. aBoolean1160 = true;
  11032. anInt1098 = inStream.readUnsignedByte();
  11033. anInt1099 = inStream.readUnsignedByte();
  11034. anInt1100 = inStream.readUnsignedWord();
  11035. anInt1101 = inStream.readUnsignedByte();
  11036. anInt1102 = inStream.readUnsignedByte();
  11037. if(anInt1102 >= 100) {
  11038. xCameraPos = anInt1098 * 128 + 64;
  11039. yCameraPos = anInt1099 * 128 + 64;
  11040. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  11041. }
  11042. pktType = -1;
  11043. return true;
  11044.  
  11045. case 134:
  11046. needDrawTabArea = true;
  11047. int k1 = inStream.readUnsignedByte();
  11048. int i10 = inStream.method439();
  11049. int l15 = inStream.readUnsignedByte();
  11050. currentExp[k1] = i10;
  11051. currentStats[k1] = l15;
  11052. maxStats[k1] = 1;
  11053. for(int k20 = 0; k20 < 98; k20++)
  11054. if(i10 >= anIntArray1019[k20])
  11055. maxStats[k1] = k20 + 2;
  11056. pktType = -1;
  11057. return true;
  11058.  
  11059. case 71:
  11060. int l1 = inStream.readUnsignedWord();
  11061. int j10 = inStream.method426();
  11062. if(l1 == 65535)
  11063. l1 = -1;
  11064. tabInterfaceIDs[j10] = l1;
  11065. needDrawTabArea = true;
  11066. tabAreaAltered = true;
  11067. pktType = -1;
  11068. return true;
  11069.  
  11070. case 74:
  11071. int i2 = inStream.method434();
  11072. if(i2 == 65535)
  11073. i2 = -1;
  11074. if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  11075. nextSong = i2;
  11076. songChanging = true;
  11077. onDemandFetcher.method558(2, nextSong);
  11078. }
  11079. currentSong = i2;
  11080. pktType = -1;
  11081. return true;
  11082.  
  11083. case 121:
  11084. int j2 = inStream.method436();
  11085. int k10 = inStream.method435();
  11086. if(musicEnabled && !lowMem) {
  11087. nextSong = j2;
  11088. songChanging = false;
  11089. onDemandFetcher.method558(2, nextSong);
  11090. prevSong = k10;
  11091. }
  11092. pktType = -1;
  11093. return true;
  11094.  
  11095. case 109:
  11096. resetLogout();
  11097. pktType = -1;
  11098. return false;
  11099.  
  11100. case 70:
  11101. int k2 = inStream.readSignedWord();
  11102. int l10 = inStream.method437();
  11103. int i16 = inStream.method434();
  11104. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  11105. class9_5.anInt263 = k2;
  11106. class9_5.anInt265 = l10;
  11107. pktType = -1;
  11108. return true;
  11109.  
  11110. case 73:
  11111. case 241:
  11112. int l2 = anInt1069;
  11113. int i11 = anInt1070;
  11114. if(pktType == 73) {
  11115. l2 = inStream.method435();
  11116. i11 = inStream.readUnsignedWord();
  11117. aBoolean1159 = false;
  11118. }
  11119. if(pktType == 241) {
  11120. i11 = inStream.method435();
  11121. inStream.initBitAccess();
  11122. for(int j16 = 0; j16 < 4; j16++) {
  11123. for(int l20 = 0; l20 < 13; l20++) {
  11124. for(int j23 = 0; j23 < 13; j23++) {
  11125. int i26 = inStream.readBits(1);
  11126. if(i26 == 1)
  11127. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  11128. else
  11129. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  11130. }
  11131. }
  11132. }
  11133. inStream.finishBitAccess();
  11134. l2 = inStream.readUnsignedWord();
  11135. aBoolean1159 = true;
  11136. }
  11137. if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  11138. pktType = -1;
  11139. return true;
  11140. }
  11141. anInt1069 = l2;
  11142. anInt1070 = i11;
  11143. baseX = (anInt1069 - 6) * 8;
  11144. baseY = (anInt1070 - 6) * 8;
  11145. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  11146. if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  11147. aBoolean1141 = true;
  11148. loadingStage = 1;
  11149. aLong824 = System.currentTimeMillis();
  11150. aRSImageProducer_1165.initDrawingArea();
  11151. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  11152. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  11153. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  11154. if(pktType == 73) {
  11155. int k16 = 0;
  11156. for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  11157. for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  11158. k16++;
  11159. }
  11160. aByteArrayArray1183 = new byte[k16][];
  11161. aByteArrayArray1247 = new byte[k16][];
  11162. anIntArray1234 = new int[k16];
  11163. anIntArray1235 = new int[k16];
  11164. anIntArray1236 = new int[k16];
  11165. k16 = 0;
  11166. for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  11167. for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  11168. anIntArray1234[k16] = (l23 << 8) + j26;
  11169. if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  11170. anIntArray1235[k16] = -1;
  11171. anIntArray1236[k16] = -1;
  11172. k16++;
  11173. } else {
  11174. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  11175. if(k28 != -1)
  11176. onDemandFetcher.method558(3, k28);
  11177. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  11178. if(j30 != -1)
  11179. onDemandFetcher.method558(3, j30);
  11180. k16++;
  11181. }
  11182. }
  11183. }
  11184. }
  11185. if(pktType == 241) {
  11186. int l16 = 0;
  11187. int ai[] = new int[676];
  11188. for(int i24 = 0; i24 < 4; i24++) {
  11189. for(int k26 = 0; k26 < 13; k26++) {
  11190. for(int l28 = 0; l28 < 13; l28++) {
  11191. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  11192. if(k30 != -1) {
  11193. int k31 = k30 >> 14 & 0x3ff;
  11194. int i32 = k30 >> 3 & 0x7ff;
  11195. int k32 = (k31 / 8 << 8) + i32 / 8;
  11196. for(int j33 = 0; j33 < l16; j33++) {
  11197. if(ai[j33] != k32)
  11198. continue;
  11199. k32 = -1;
  11200.  
  11201. }
  11202. if(k32 != -1)
  11203. ai[l16++] = k32;
  11204. }
  11205. }
  11206. }
  11207. }
  11208. aByteArrayArray1183 = new byte[l16][];
  11209. aByteArrayArray1247 = new byte[l16][];
  11210. anIntArray1234 = new int[l16];
  11211. anIntArray1235 = new int[l16];
  11212. anIntArray1236 = new int[l16];
  11213. for(int l26 = 0; l26 < l16; l26++) {
  11214. int i29 = anIntArray1234[l26] = ai[l26];
  11215. int l30 = i29 >> 8 & 0xff;
  11216. int l31 = i29 & 0xff;
  11217. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  11218. if(j32 != -1)
  11219. onDemandFetcher.method558(3, j32);
  11220. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  11221. if(i33 != -1)
  11222. onDemandFetcher.method558(3, i33);
  11223. }
  11224. }
  11225. int i17 = baseX - anInt1036;
  11226. int j21 = baseY - anInt1037;
  11227. anInt1036 = baseX;
  11228. anInt1037 = baseY;
  11229. for(int j24 = 0; j24 < 16384; j24++) {
  11230. NPC npc = npcArray[j24];
  11231. if(npc != null) {
  11232. for(int j29 = 0; j29 < 10; j29++) {
  11233. npc.smallX[j29] -= i17;
  11234. npc.smallY[j29] -= j21;
  11235. }
  11236. npc.x -= i17 * 128;
  11237. npc.y -= j21 * 128;
  11238. }
  11239. }
  11240. for(int i27 = 0; i27 < maxPlayers; i27++) {
  11241. Player player = playerArray[i27];
  11242. if(player != null) {
  11243. for(int i31 = 0; i31 < 10; i31++) {
  11244. player.smallX[i31] -= i17;
  11245. player.smallY[i31] -= j21;
  11246. }
  11247. player.x -= i17 * 128;
  11248. player.y -= j21 * 128;
  11249. }
  11250. }
  11251. aBoolean1080 = true;
  11252. byte byte1 = 0;
  11253. byte byte2 = 104;
  11254. byte byte3 = 1;
  11255. if(i17 < 0) {
  11256. byte1 = 103;
  11257. byte2 = -1;
  11258. byte3 = -1;
  11259. }
  11260. byte byte4 = 0;
  11261. byte byte5 = 104;
  11262. byte byte6 = 1;
  11263. if(j21 < 0) {
  11264. byte4 = 103;
  11265. byte5 = -1;
  11266. byte6 = -1;
  11267. }
  11268. for(int k33 = byte1; k33 != byte2; k33 += byte3) {
  11269. for(int l33 = byte4; l33 != byte5; l33 += byte6) {
  11270. int i34 = k33 + i17;
  11271. int j34 = l33 + j21;
  11272. for(int k34 = 0; k34 < 4; k34++)
  11273. if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  11274. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  11275. else
  11276. groundArray[k34][k33][l33] = null;
  11277. }
  11278. }
  11279. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext()) {
  11280. class30_sub1_1.anInt1297 -= i17;
  11281. class30_sub1_1.anInt1298 -= j21;
  11282. if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  11283. class30_sub1_1.unlink();
  11284. }
  11285. if(destX != 0) {
  11286. destX -= i17;
  11287. destY -= j21;
  11288. }
  11289. aBoolean1160 = false;
  11290. pktType = -1;
  11291. return true;
  11292.  
  11293. case 208:
  11294. int i3 = inStream.method437();
  11295. if(i3 >= 0)
  11296. method60(i3);
  11297. anInt1018 = i3;
  11298. pktType = -1;
  11299. return true;
  11300.  
  11301. case 99:
  11302. anInt1021 = inStream.readUnsignedByte();
  11303. pktType = -1;
  11304. return true;
  11305.  
  11306. case 75:
  11307. int j3 = inStream.method436();
  11308. int j11 = inStream.method436();
  11309. RSInterface.interfaceCache[j11].anInt233 = 2;
  11310. RSInterface.interfaceCache[j11].mediaID = j3;
  11311. pktType = -1;
  11312. return true;
  11313.  
  11314. case 114:
  11315. anInt1104 = inStream.method434() * 30;
  11316. pktType = -1;
  11317. return true;
  11318.  
  11319. case 60:
  11320. anInt1269 = inStream.readUnsignedByte();
  11321. anInt1268 = inStream.method427();
  11322. while(inStream.currentOffset < pktSize) {
  11323. int k3 = inStream.readUnsignedByte();
  11324. method137(inStream, k3);
  11325. }
  11326. pktType = -1;
  11327. return true;
  11328.  
  11329. case 35:
  11330. int l3 = inStream.readUnsignedByte();
  11331. int k11 = inStream.readUnsignedByte();
  11332. int j17 = inStream.readUnsignedByte();
  11333. int k21 = inStream.readUnsignedByte();
  11334. aBooleanArray876[l3] = true;
  11335. anIntArray873[l3] = k11;
  11336. anIntArray1203[l3] = j17;
  11337. anIntArray928[l3] = k21;
  11338. anIntArray1030[l3] = 0;
  11339. pktType = -1;
  11340. return true;
  11341.  
  11342. case 174:
  11343. int i4 = inStream.readUnsignedWord();
  11344. int l11 = inStream.readUnsignedByte();
  11345. int k17 = inStream.readUnsignedWord();
  11346. if(aBoolean848 && !lowMem && anInt1062 < 50) {
  11347. anIntArray1207[anInt1062] = i4;
  11348. anIntArray1241[anInt1062] = l11;
  11349. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  11350. anInt1062++;
  11351. }
  11352. pktType = -1;
  11353. return true;
  11354.  
  11355. case 104:
  11356. int j4 = inStream.method427();
  11357. int i12 = inStream.method426();
  11358. String s6 = inStream.readString();
  11359. if(j4 >= 1 && j4 <= 5) {
  11360. if(s6.equalsIgnoreCase("null"))
  11361. s6 = null;
  11362. atPlayerActions[j4 - 1] = s6;
  11363. atPlayerArray[j4 - 1] = i12 == 0;
  11364. }
  11365. pktType = -1;
  11366. return true;
  11367.  
  11368. case 78:
  11369. destX = 0;
  11370. pktType = -1;
  11371. return true;
  11372.  
  11373. case 253:
  11374. String s = inStream.readString();
  11375. if(s.endsWith(":tradereq:")) {
  11376. String s3 = s.substring(0, s.indexOf(":"));
  11377. long l17 = TextClass.longForName(s3);
  11378. boolean flag2 = false;
  11379. for(int j27 = 0; j27 < ignoreCount; j27++) {
  11380. if(ignoreListAsLongs[j27] != l17)
  11381. continue;
  11382. flag2 = true;
  11383.  
  11384. }
  11385. if(!flag2 && anInt1251 == 0)
  11386. pushMessage("wishes to trade with you.", 4, s3);
  11387. } else if (s.endsWith(":clan:")) {
  11388. String s4 = s.substring(0, s.indexOf(":"));
  11389. long l18 = TextClass.longForName(s4);
  11390. pushMessage("Clan: ", 8, s4);
  11391. } else if(s.endsWith("#url#")) {
  11392. String link = s.substring(0, s.indexOf("#"));
  11393. pushMessage("Join us at: ", 9, link);
  11394. } else if(s.endsWith(":duelreq:")) {
  11395. String s4 = s.substring(0, s.indexOf(":"));
  11396. long l18 = TextClass.longForName(s4);
  11397. boolean flag3 = false;
  11398. for(int k27 = 0; k27 < ignoreCount; k27++) {
  11399. if(ignoreListAsLongs[k27] != l18)
  11400. continue;
  11401. flag3 = true;
  11402.  
  11403. }
  11404. if(!flag3 && anInt1251 == 0)
  11405. pushMessage("wishes to duel with you.", 8, s4);
  11406. } else if(s.endsWith(":chalreq:")) {
  11407. String s5 = s.substring(0, s.indexOf(":"));
  11408. long l19 = TextClass.longForName(s5);
  11409. boolean flag4 = false;
  11410. for(int l27 = 0; l27 < ignoreCount; l27++) {
  11411. if(ignoreListAsLongs[l27] != l19)
  11412. continue;
  11413. flag4 = true;
  11414.  
  11415. }
  11416. if(!flag4 && anInt1251 == 0) {
  11417. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  11418. pushMessage(s8, 8, s5);
  11419. }
  11420. } else {
  11421. pushMessage(s, 0, "");
  11422. }
  11423. pktType = -1;
  11424. return true;
  11425.  
  11426. case 1:
  11427. for(int k4 = 0; k4 < playerArray.length; k4++)
  11428. if(playerArray[k4] != null)
  11429. playerArray[k4].anim = -1;
  11430. for(int j12 = 0; j12 < npcArray.length; j12++)
  11431. if(npcArray[j12] != null)
  11432. npcArray[j12].anim = -1;
  11433. pktType = -1;
  11434. return true;
  11435.  
  11436. case 50:
  11437. long l4 = inStream.readQWord();
  11438. int i18 = inStream.readUnsignedByte();
  11439. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  11440. for(int k24 = 0; k24 < friendsCount; k24++) {
  11441. if(l4 != friendsListAsLongs[k24])
  11442. continue;
  11443. if(friendsNodeIDs[k24] != i18) {
  11444. friendsNodeIDs[k24] = i18;
  11445. needDrawTabArea = true;
  11446. if(i18 >= 2) {
  11447. pushMessage(s7 + " has logged in.", 5, "");
  11448. }
  11449. if(i18 <= 1) {
  11450. pushMessage(s7 + " has logged out.", 5, "");
  11451. }
  11452. }
  11453. s7 = null;
  11454.  
  11455. }
  11456. if(s7 != null && friendsCount < 200) {
  11457. friendsListAsLongs[friendsCount] = l4;
  11458. friendsList[friendsCount] = s7;
  11459. friendsNodeIDs[friendsCount] = i18;
  11460. friendsCount++;
  11461. needDrawTabArea = true;
  11462. }
  11463. for(boolean flag6 = false; !flag6;) {
  11464. flag6 = true;
  11465. for(int k29 = 0; k29 < friendsCount - 1; k29++)
  11466. if(friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  11467. int j31 = friendsNodeIDs[k29];
  11468. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  11469. friendsNodeIDs[k29 + 1] = j31;
  11470. String s10 = friendsList[k29];
  11471. friendsList[k29] = friendsList[k29 + 1];
  11472. friendsList[k29 + 1] = s10;
  11473. long l32 = friendsListAsLongs[k29];
  11474. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  11475. friendsListAsLongs[k29 + 1] = l32;
  11476. needDrawTabArea = true;
  11477. flag6 = false;
  11478. }
  11479. }
  11480. pktType = -1;
  11481. return true;
  11482.  
  11483. case 110:
  11484. if(tabID == 12)
  11485. needDrawTabArea = true;
  11486. energy = inStream.readUnsignedByte();
  11487. pktType = -1;
  11488. return true;
  11489.  
  11490. case 254:
  11491. anInt855 = inStream.readUnsignedByte();
  11492. if(anInt855 == 1)
  11493. anInt1222 = inStream.readUnsignedWord();
  11494. if(anInt855 >= 2 && anInt855 <= 6) {
  11495. if(anInt855 == 2) {
  11496. anInt937 = 64;
  11497. anInt938 = 64;
  11498. }
  11499. if(anInt855 == 3) {
  11500. anInt937 = 0;
  11501. anInt938 = 64;
  11502. }
  11503. if(anInt855 == 4) {
  11504. anInt937 = 128;
  11505. anInt938 = 64;
  11506. }
  11507. if(anInt855 == 5) {
  11508. anInt937 = 64;
  11509. anInt938 = 0;
  11510. }
  11511. if(anInt855 == 6) {
  11512. anInt937 = 64;
  11513. anInt938 = 128;
  11514. }
  11515. anInt855 = 2;
  11516. anInt934 = inStream.readUnsignedWord();
  11517. anInt935 = inStream.readUnsignedWord();
  11518. anInt936 = inStream.readUnsignedByte();
  11519. }
  11520. if(anInt855 == 10)
  11521. anInt933 = inStream.readUnsignedWord();
  11522. pktType = -1;
  11523. return true;
  11524.  
  11525. case 248:
  11526. int i5 = inStream.method435();
  11527. int k12 = inStream.readUnsignedWord();
  11528. if(backDialogID != -1) {
  11529. backDialogID = -1;
  11530. inputTaken = true;
  11531. }
  11532. if(inputDialogState != 0) {
  11533. inputDialogState = 0;
  11534. inputTaken = true;
  11535. }
  11536. openInterfaceID = i5;
  11537. invOverlayInterfaceID = k12;
  11538. needDrawTabArea = true;
  11539. tabAreaAltered = true;
  11540. aBoolean1149 = false;
  11541. pktType = -1;
  11542. return true;
  11543.  
  11544. case 79:
  11545. int j5 = inStream.method434();
  11546. int l12 = inStream.method435();
  11547. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  11548. if(class9_3 != null && class9_3.type == 0) {
  11549. if(l12 < 0)
  11550. l12 = 0;
  11551. if(l12 > class9_3.scrollMax - class9_3.height)
  11552. l12 = class9_3.scrollMax - class9_3.height;
  11553. class9_3.scrollPosition = l12;
  11554. }
  11555. pktType = -1;
  11556. return true;
  11557.  
  11558. case 68:
  11559. for(int k5 = 0; k5 < variousSettings.length; k5++)
  11560. if(variousSettings[k5] != anIntArray1045[k5]) {
  11561. variousSettings[k5] = anIntArray1045[k5];
  11562. method33(k5);
  11563. needDrawTabArea = true;
  11564. }
  11565. pktType = -1;
  11566. return true;
  11567.  
  11568. case 196:
  11569. long l5 = inStream.readQWord();
  11570. int j18 = inStream.readDWord();
  11571. int l21 = inStream.readUnsignedByte();
  11572. boolean flag5 = false;
  11573. for(int i28 = 0; i28 < 100; i28++) {
  11574. if(anIntArray1240[i28] != j18)
  11575. continue;
  11576. flag5 = true;
  11577.  
  11578. }
  11579. if(l21 <= 1) {
  11580. for(int l29 = 0; l29 < ignoreCount; l29++) {
  11581. if(ignoreListAsLongs[l29] != l5)
  11582. continue;
  11583. flag5 = true;
  11584.  
  11585. }
  11586. }
  11587. if(!flag5 && anInt1251 == 0)
  11588. try {
  11589. anIntArray1240[anInt1169] = j18;
  11590. anInt1169 = (anInt1169 + 1) % 100;
  11591. String s9 = TextInput.method525(pktSize - 13, inStream);
  11592. //if(l21 != 3)
  11593. //s9 = Censor.doCensor(s9);
  11594. if(l21 == 2 || l21 == 3)
  11595. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11596. else
  11597. if(l21 == 1)
  11598. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11599. else
  11600. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  11601. } catch(Exception exception1) {
  11602. signlink.reporterror("cde1");
  11603. }
  11604. pktType = -1;
  11605. return true;
  11606.  
  11607. case 85:
  11608. anInt1269 = inStream.method427();
  11609. anInt1268 = inStream.method427();
  11610. pktType = -1;
  11611. return true;
  11612.  
  11613. case 24:
  11614. anInt1054 = inStream.method428();
  11615. if(anInt1054 == tabID) {
  11616. if(anInt1054 == 3)
  11617. tabID = 1;
  11618. else
  11619. tabID = 3;
  11620. needDrawTabArea = true;
  11621. }
  11622. pktType = -1;
  11623. return true;
  11624.  
  11625. case 246:
  11626. int i6 = inStream.method434();
  11627. int i13 = inStream.readUnsignedWord();
  11628. int k18 = inStream.readUnsignedWord();
  11629. if(k18 == 65535) {
  11630. RSInterface.interfaceCache[i6].anInt233 = 0;
  11631. pktType = -1;
  11632. return true;
  11633. } else {
  11634. ItemDef itemDef = ItemDef.forID(k18);
  11635. RSInterface.interfaceCache[i6].anInt233 = 4;
  11636. RSInterface.interfaceCache[i6].mediaID = k18;
  11637. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotation1;
  11638. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotation2;
  11639. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  11640. pktType = -1;
  11641. return true;
  11642. }
  11643.  
  11644. case 171:
  11645. boolean flag1 = inStream.readUnsignedByte() == 1;
  11646. int j13 = inStream.readUnsignedWord();
  11647. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  11648. pktType = -1;
  11649. return true;
  11650.  
  11651. case 142:
  11652. int j6 = inStream.method434();
  11653. method60(j6);
  11654. if(backDialogID != -1) {
  11655. backDialogID = -1;
  11656. inputTaken = true;
  11657. }
  11658. if(inputDialogState != 0) {
  11659. inputDialogState = 0;
  11660. inputTaken = true;
  11661. }
  11662. invOverlayInterfaceID = j6;
  11663. needDrawTabArea = true;
  11664. tabAreaAltered = true;
  11665. openInterfaceID = -1;
  11666. aBoolean1149 = false;
  11667. pktType = -1;
  11668. return true;
  11669.  
  11670. case 126:
  11671. String text = inStream.readString();
  11672. int frame = inStream.method435();
  11673. if (text.startsWith("www.")) {
  11674. launchURL(text);
  11675. pktType = -1;
  11676. return true;
  11677. }
  11678. updateStrings(text, frame);
  11679. sendFrame126(text, frame);
  11680. if (frame >= 18144 && frame <= 18244) {
  11681. clanList[frame - 18144] = text;
  11682. }
  11683. pktType = -1;
  11684. return true;
  11685.  
  11686. case 206:
  11687. publicChatMode = inStream.readUnsignedByte();
  11688. privateChatMode = inStream.readUnsignedByte();
  11689. tradeMode = inStream.readUnsignedByte();
  11690. aBoolean1233 = true;
  11691. inputTaken = true;
  11692. pktType = -1;
  11693. return true;
  11694.  
  11695. case 240:
  11696. if(tabID == 12)
  11697. needDrawTabArea = true;
  11698. weight = inStream.readSignedWord();
  11699. pktType = -1;
  11700. return true;
  11701.  
  11702. case 8:
  11703. int k6 = inStream.method436();
  11704. int l13 = inStream.readUnsignedWord();
  11705. RSInterface.interfaceCache[k6].anInt233 = 1;
  11706. RSInterface.interfaceCache[k6].mediaID = l13;
  11707. pktType = -1;
  11708. return true;
  11709.  
  11710. case 122:
  11711. int l6 = inStream.method436();
  11712. int i14 = inStream.method436();
  11713. int i19 = i14 >> 10 & 0x1f;
  11714. int i22 = i14 >> 5 & 0x1f;
  11715. int l24 = i14 & 0x1f;
  11716. RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  11717. pktType = -1;
  11718. return true;
  11719.  
  11720. case 53:
  11721. needDrawTabArea = true;
  11722. int i7 = inStream.readUnsignedWord();
  11723. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  11724. int j19 = inStream.readUnsignedWord();
  11725. for(int j22 = 0; j22 < j19; j22++) {
  11726. int i25 = inStream.readUnsignedByte();
  11727. if(i25 == 255)
  11728. i25 = inStream.method440();
  11729. class9_1.inv[j22] = inStream.method436();
  11730. class9_1.invStackSizes[j22] = i25;
  11731. }
  11732. for(int j25 = j19; j25 < class9_1.inv.length; j25++) {
  11733. class9_1.inv[j25] = 0;
  11734. class9_1.invStackSizes[j25] = 0;
  11735. }
  11736. pktType = -1;
  11737. return true;
  11738.  
  11739. case 230:
  11740. int j7 = inStream.method435();
  11741. int j14 = inStream.readUnsignedWord();
  11742. int k19 = inStream.readUnsignedWord();
  11743. int k22 = inStream.method436();
  11744. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  11745. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  11746. RSInterface.interfaceCache[j14].modelZoom = j7;
  11747. pktType = -1;
  11748. return true;
  11749.  
  11750. case 221:
  11751. anInt900 = inStream.readUnsignedByte();
  11752. needDrawTabArea = true;
  11753. pktType = -1;
  11754. return true;
  11755.  
  11756. case 177:
  11757. aBoolean1160 = true;
  11758. anInt995 = inStream.readUnsignedByte();
  11759. anInt996 = inStream.readUnsignedByte();
  11760. anInt997 = inStream.readUnsignedWord();
  11761. anInt998 = inStream.readUnsignedByte();
  11762. anInt999 = inStream.readUnsignedByte();
  11763. if(anInt999 >= 100) {
  11764. int k7 = anInt995 * 128 + 64;
  11765. int k14 = anInt996 * 128 + 64;
  11766. int i20 = method42(plane, k14, k7) - anInt997;
  11767. int l22 = k7 - xCameraPos;
  11768. int k25 = i20 - zCameraPos;
  11769. int j28 = k14 - yCameraPos;
  11770. int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  11771. yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  11772. xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  11773. if(yCameraCurve < 128)
  11774. yCameraCurve = 128;
  11775. if(yCameraCurve > 383)
  11776. yCameraCurve = 383;
  11777. }
  11778. pktType = -1;
  11779. return true;
  11780.  
  11781. case 249:
  11782. anInt1046 = inStream.method426();
  11783. unknownInt10 = inStream.method436();
  11784. pktType = -1;
  11785. return true;
  11786.  
  11787. case 65:
  11788. updateNPCs(inStream, pktSize);
  11789. pktType = -1;
  11790. return true;
  11791.  
  11792. case 27:
  11793. messagePromptRaised = false;
  11794. inputDialogState = 1;
  11795. amountOrNameInput = "";
  11796. inputTaken = true;
  11797. pktType = -1;
  11798. return true;
  11799.  
  11800. case 187:
  11801. messagePromptRaised = false;
  11802. inputDialogState = 2;
  11803. amountOrNameInput = "";
  11804. inputTaken = true;
  11805. pktType = -1;
  11806. return true;
  11807.  
  11808. case 97:
  11809. int l7 = inStream.readUnsignedWord();
  11810. method60(l7);
  11811. if(invOverlayInterfaceID != -1) {
  11812. invOverlayInterfaceID = -1;
  11813. needDrawTabArea = true;
  11814. tabAreaAltered = true;
  11815. }
  11816. if(backDialogID != -1) {
  11817. backDialogID = -1;
  11818. inputTaken = true;
  11819. }
  11820. if(inputDialogState != 0) {
  11821. inputDialogState = 0;
  11822. inputTaken = true;
  11823. }
  11824. openInterfaceID = l7;
  11825. aBoolean1149 = false;
  11826. pktType = -1;
  11827. return true;
  11828.  
  11829. case 218:
  11830. int i8 = inStream.method438();
  11831. dialogID = i8;
  11832. inputTaken = true;
  11833. pktType = -1;
  11834. return true;
  11835.  
  11836. case 87:
  11837. int j8 = inStream.method434();
  11838. int l14 = inStream.method439();
  11839. anIntArray1045[j8] = l14;
  11840. if(variousSettings[j8] != l14) {
  11841. variousSettings[j8] = l14;
  11842. method33(j8);
  11843. needDrawTabArea = true;
  11844. if(dialogID != -1)
  11845. inputTaken = true;
  11846. }
  11847. pktType = -1;
  11848. return true;
  11849.  
  11850. case 36:
  11851. int k8 = inStream.method434();
  11852. byte byte0 = inStream.readSignedByte();
  11853. anIntArray1045[k8] = byte0;
  11854. if(variousSettings[k8] != byte0) {
  11855. variousSettings[k8] = byte0;
  11856. method33(k8);
  11857. needDrawTabArea = true;
  11858. if(dialogID != -1)
  11859. inputTaken = true;
  11860. }
  11861. pktType = -1;
  11862. return true;
  11863.  
  11864. case 61:
  11865. anInt1055 = inStream.readUnsignedByte();
  11866. pktType = -1;
  11867. return true;
  11868.  
  11869. case 200:
  11870. int l8 = inStream.readUnsignedWord();
  11871. int i15 = inStream.readSignedWord();
  11872. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  11873. class9_4.anInt257 = i15;
  11874. if(i15 == -1) {
  11875. class9_4.anInt246 = 0;
  11876. class9_4.anInt208 = 0;
  11877. }
  11878. pktType = -1;
  11879. return true;
  11880.  
  11881. case 219:
  11882. if(invOverlayInterfaceID != -1) {
  11883. invOverlayInterfaceID = -1;
  11884. needDrawTabArea = true;
  11885. tabAreaAltered = true;
  11886. }
  11887. if(backDialogID != -1) {
  11888. backDialogID = -1;
  11889. inputTaken = true;
  11890. }
  11891. if(inputDialogState != 0) {
  11892. inputDialogState = 0;
  11893. inputTaken = true;
  11894. }
  11895. openInterfaceID = -1;
  11896. aBoolean1149 = false;
  11897. pktType = -1;
  11898. return true;
  11899.  
  11900. case 34:
  11901. needDrawTabArea = true;
  11902. int i9 = inStream.readUnsignedWord();
  11903. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  11904. while(inStream.currentOffset < pktSize) {
  11905. int j20 = inStream.method422();
  11906. int i23 = inStream.readUnsignedWord();
  11907. int l25 = inStream.readUnsignedByte();
  11908. if(l25 == 255)
  11909. l25 = inStream.readDWord();
  11910. if(j20 >= 0 && j20 < class9_2.inv.length) {
  11911. class9_2.inv[j20] = i23;
  11912. class9_2.invStackSizes[j20] = l25;
  11913. }
  11914. }
  11915. pktType = -1;
  11916. return true;
  11917.  
  11918. case 4:
  11919. case 44:
  11920. case 84:
  11921. case 101:
  11922. case 105:
  11923. case 117:
  11924. case 147:
  11925. case 151:
  11926. case 156:
  11927. case 160:
  11928. case 215:
  11929. method137(inStream, pktType);
  11930. pktType = -1;
  11931. return true;
  11932.  
  11933. case 106:
  11934. tabID = inStream.method427();
  11935. needDrawTabArea = true;
  11936. tabAreaAltered = true;
  11937. pktType = -1;
  11938. return true;
  11939.  
  11940. case 164:
  11941. int j9 = inStream.method434();
  11942. method60(j9);
  11943. if(invOverlayInterfaceID != -1) {
  11944. invOverlayInterfaceID = -1;
  11945. needDrawTabArea = true;
  11946. tabAreaAltered = true;
  11947. }
  11948. backDialogID = j9;
  11949. inputTaken = true;
  11950. openInterfaceID = -1;
  11951. aBoolean1149 = false;
  11952. pktType = -1;
  11953. return true;
  11954.  
  11955. }
  11956. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  11957. //resetLogout();
  11958. } catch(IOException _ex) {
  11959. dropClient();
  11960. } catch(Exception exception) {
  11961. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  11962. for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  11963. s2 = s2 + inStream.buffer[j15] + ",";
  11964. signlink.reporterror(s2);
  11965. //resetLogout();
  11966. }
  11967. pktType = -1;
  11968. return true;
  11969. }
  11970.  
  11971. private void method146() {
  11972. anInt1265++;
  11973. method47(true);
  11974. method26(true);
  11975. method47(false);
  11976. method26(false);
  11977. method55();
  11978. method104();
  11979. if(!aBoolean1160) {
  11980. int i = anInt1184;
  11981. if(anInt984 / 256 > i)
  11982. i = anInt984 / 256;
  11983. if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  11984. i = anIntArray1203[4] + 128;
  11985. int k = minimapInt1 + anInt896 & 0x7ff;
  11986. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  11987. }
  11988. int j;
  11989. if(!aBoolean1160)
  11990. j = method120();
  11991. else
  11992. j = method121();
  11993. int l = xCameraPos;
  11994. int i1 = zCameraPos;
  11995. int j1 = yCameraPos;
  11996. int k1 = yCameraCurve;
  11997. int l1 = xCameraCurve;
  11998. for(int i2 = 0; i2 < 5; i2++)
  11999. if(aBooleanArray876[i2]) {
  12000. 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]);
  12001. if(i2 == 0)
  12002. xCameraPos += j2;
  12003. if(i2 == 1)
  12004. zCameraPos += j2;
  12005. if(i2 == 2)
  12006. yCameraPos += j2;
  12007. if(i2 == 3)
  12008. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  12009. if(i2 == 4) {
  12010. yCameraCurve += j2;
  12011. if(yCameraCurve < 128)
  12012. yCameraCurve = 128;
  12013. if(yCameraCurve > 383)
  12014. yCameraCurve = 383;
  12015. }
  12016. }
  12017. int k2 = Texture.anInt1481;
  12018. Model.aBoolean1684 = true;
  12019. Model.anInt1687 = 0;
  12020. Model.anInt1685 = super.mouseX - 4;
  12021. Model.anInt1686 = super.mouseY - 4;
  12022. DrawingArea.setAllPixelsToZero();
  12023. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  12024. worldController.clearObj5Cache();
  12025. updateEntities();
  12026. drawHeadIcon();
  12027. method37(k2);
  12028. draw3dScreen();
  12029. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  12030. xCameraPos = l;
  12031. zCameraPos = i1;
  12032. yCameraPos = j1;
  12033. yCameraCurve = k1;
  12034. xCameraCurve = l1;
  12035. }
  12036.  
  12037. public void clearTopInterfaces() {
  12038. stream.createFrame(130);
  12039. if (invOverlayInterfaceID != -1) {
  12040. invOverlayInterfaceID = -1;
  12041. needDrawTabArea = true;
  12042. aBoolean1149 = false;
  12043. tabAreaAltered = true;
  12044. }
  12045. if (backDialogID != -1) {
  12046. backDialogID = -1;
  12047. inputTaken = true;
  12048. aBoolean1149 = false;
  12049. }
  12050. openInterfaceID = -1;
  12051. fullscreenInterfaceID = -1;
  12052. }
  12053.  
  12054. public client() {
  12055. fullscreenInterfaceID = -1;
  12056. chatRights = new int[500];
  12057. chatTypeView = 0;
  12058. clanChatMode = 0;
  12059. cButtonHPos = -1;
  12060. cButtonHCPos = -1;
  12061. cButtonCPos = 0;
  12062. server = "127.0.0.1";
  12063. anIntArrayArray825 = new int[104][104];
  12064. friendsNodeIDs = new int[200];
  12065. groundArray = new NodeList[4][104][104];
  12066. aBoolean831 = false;
  12067. aStream_834 = new Stream(new byte[5000]);
  12068. npcArray = new NPC[16384];
  12069. npcIndices = new int[16384];
  12070. anIntArray840 = new int[1000];
  12071. aStream_847 = Stream.create();
  12072. aBoolean848 = true;
  12073. openInterfaceID = -1;
  12074. currentExp = new int[Skills.skillsCount];
  12075. aBoolean872 = false;
  12076. anIntArray873 = new int[5];
  12077. anInt874 = -1;
  12078. aBooleanArray876 = new boolean[5];
  12079. drawFlames = false;
  12080. reportAbuseInput = "";
  12081. unknownInt10 = -1;
  12082. menuOpen = false;
  12083. inputString = "";
  12084. maxPlayers = 2048;
  12085. myPlayerIndex = 2047;
  12086. playerArray = new Player[maxPlayers];
  12087. playerIndices = new int[maxPlayers];
  12088. anIntArray894 = new int[maxPlayers];
  12089. aStreamArray895s = new Stream[maxPlayers];
  12090. anInt897 = 1;
  12091. anIntArrayArray901 = new int[104][104];
  12092. anInt902 = 0x766654;
  12093. aByteArray912 = new byte[16384];
  12094. currentStats = new int[Skills.skillsCount];
  12095. ignoreListAsLongs = new long[100];
  12096. loadingError = false;
  12097. anInt927 = 0x332d25;
  12098. anIntArray928 = new int[5];
  12099. anIntArrayArray929 = new int[104][104];
  12100. chatTypes = new int[500];
  12101. chatNames = new String[500];
  12102. chatMessages = new String[500];
  12103. chatButtons = new Sprite[4];
  12104. sideIcons = new Sprite[15];
  12105. redStones = new Sprite[5];
  12106. aBoolean954 = true;
  12107. friendsListAsLongs = new long[200];
  12108. currentSong = -1;
  12109. drawingFlames = false;
  12110. spriteDrawX = -1;
  12111. spriteDrawY = -1;
  12112. anIntArray968 = new int[33];
  12113. anIntArray969 = new int[256];
  12114. decompressors = new Decompressor[5];
  12115. variousSettings = new int[2000];
  12116. aBoolean972 = false;
  12117. anInt975 = 50;
  12118. anIntArray976 = new int[anInt975];
  12119. anIntArray977 = new int[anInt975];
  12120. anIntArray978 = new int[anInt975];
  12121. anIntArray979 = new int[anInt975];
  12122. anIntArray980 = new int[anInt975];
  12123. anIntArray981 = new int[anInt975];
  12124. anIntArray982 = new int[anInt975];
  12125. aStringArray983 = new String[anInt975];
  12126. anInt985 = -1;
  12127. hitMarks = new Sprite[20];
  12128. anIntArray990 = new int[5];
  12129. aBoolean994 = false;
  12130. anInt1002 = 0x23201b;
  12131. amountOrNameInput = "";
  12132. aClass19_1013 = new NodeList();
  12133. aBoolean1017 = false;
  12134. anInt1018 = -1;
  12135. anIntArray1030 = new int[5];
  12136. aBoolean1031 = false;
  12137. mapFunctions = new Sprite[100];
  12138. dialogID = -1;
  12139. maxStats = new int[Skills.skillsCount];
  12140. anIntArray1045 = new int[2000];
  12141. aBoolean1047 = true;
  12142. anIntArray1052 = new int[151];
  12143. anInt1054 = -1;
  12144. aClass19_1056 = new NodeList();
  12145. anIntArray1057 = new int[33];
  12146. aClass9_1059 = new RSInterface();
  12147. mapScenes = new Background[100];
  12148. barFillColor = 0x4d4233;
  12149. anIntArray1065 = new int[7];
  12150. anIntArray1072 = new int[1000];
  12151. anIntArray1073 = new int[1000];
  12152. aBoolean1080 = false;
  12153. friendsList = new String[200];
  12154. inStream = Stream.create();
  12155. expectedCRCs = new int[9];
  12156. menuActionCmd2 = new int[500];
  12157. menuActionCmd3 = new int[500];
  12158. menuActionID = new int[500];
  12159. menuActionCmd1 = new int[500];
  12160. headIcons = new Sprite[20];
  12161. skullIcons = new Sprite[20];
  12162. headIconsHint = new Sprite[20];
  12163. tabAreaAltered = false;
  12164. aString1121 = "";
  12165. atPlayerActions = new String[5];
  12166. atPlayerArray = new boolean[5];
  12167. anIntArrayArrayArray1129 = new int[4][13][13];
  12168. anInt1132 = 2;
  12169. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  12170. aBoolean1141 = false;
  12171. aBoolean1149 = false;
  12172. crosses = new Sprite[8];
  12173. musicEnabled = true;
  12174. needDrawTabArea = false;
  12175. loggedIn = false;
  12176. canMute = false;
  12177. aBoolean1159 = false;
  12178. aBoolean1160 = false;
  12179. anInt1171 = 1;
  12180. myUsername = "";
  12181. myPassword = "";
  12182. genericLoadingError = false;
  12183. reportAbuseInterfaceID = -1;
  12184. aClass19_1179 = new NodeList();
  12185. anInt1184 = 128;
  12186. invOverlayInterfaceID = -1;
  12187. stream = Stream.create();
  12188. menuActionName = new String[500];
  12189. anIntArray1203 = new int[5];
  12190. anIntArray1207 = new int[50];
  12191. anInt1210 = 2;
  12192. anInt1211 = 78;
  12193. promptInput = "";
  12194. modIcons = new Background[2];
  12195. tabID = 3;
  12196. inputTaken = false;
  12197. songChanging = true;
  12198. anIntArray1229 = new int[151];
  12199. aClass11Array1230 = new Class11[4];
  12200. aBoolean1233 = false;
  12201. anIntArray1240 = new int[100];
  12202. anIntArray1241 = new int[50];
  12203. aBoolean1242 = false;
  12204. anIntArray1250 = new int[50];
  12205. rsAlreadyLoaded = false;
  12206. welcomeScreenRaised = false;
  12207. messagePromptRaised = false;
  12208. loginMessage1 = "";
  12209. loginMessage2 = "";
  12210. backDialogID = -1;
  12211. anInt1279 = 2;
  12212. bigX = new int[4000];
  12213. bigY = new int[4000];
  12214. anInt1289 = -1;
  12215. }
  12216.  
  12217. public int rights;
  12218. public String name;
  12219. public String message;
  12220. public String clanname;
  12221. private final int[] chatRights;
  12222. public int chatTypeView;
  12223. public int clanChatMode;
  12224. public int duelMode;
  12225. /* Declare custom sprites */
  12226. private Sprite chatArea;
  12227. private Sprite[] chatButtons;
  12228. private Sprite tabArea;
  12229. private Sprite mapArea;
  12230. /**/
  12231. private RSImageProducer leftFrame;
  12232. private RSImageProducer topFrame;
  12233. private RSImageProducer rightFrame;
  12234. private int ignoreCount;
  12235. private long aLong824;
  12236. private int[][] anIntArrayArray825;
  12237. private int[] friendsNodeIDs;
  12238. private NodeList[][][] groundArray;
  12239. private int[] anIntArray828;
  12240. private int[] anIntArray829;
  12241. private volatile boolean aBoolean831;
  12242. private Socket aSocket832;
  12243. private int loginScreenState;
  12244. private Stream aStream_834;
  12245. private NPC[] npcArray;
  12246. private int npcCount;
  12247. private int[] npcIndices;
  12248. private int anInt839;
  12249. private int[] anIntArray840;
  12250. private int anInt841;
  12251. private int anInt842;
  12252. private int anInt843;
  12253. private String aString844;
  12254. private int privateChatMode;
  12255. private Stream aStream_847;
  12256. private boolean aBoolean848;
  12257. private static int anInt849;
  12258. private int[] anIntArray850;
  12259. private int[] anIntArray851;
  12260. private int[] anIntArray852;
  12261. private int[] anIntArray853;
  12262. private static int anInt854;
  12263. private int anInt855;
  12264. private int openInterfaceID;
  12265. private int xCameraPos;
  12266. private int zCameraPos;
  12267. private int yCameraPos;
  12268. private int yCameraCurve;
  12269. private int xCameraCurve;
  12270. private int myPrivilege;
  12271. private final int[] currentExp;
  12272. private Sprite[] redStones;
  12273. private Sprite mapFlag;
  12274. private Sprite mapMarker;
  12275. private boolean aBoolean872;
  12276. private final int[] anIntArray873;
  12277. private int anInt874;
  12278. private final boolean[] aBooleanArray876;
  12279. private int weight;
  12280. private MouseDetection mouseDetection;
  12281. private volatile boolean drawFlames;
  12282. private String reportAbuseInput;
  12283. private int unknownInt10;
  12284. private boolean menuOpen;
  12285. private int anInt886;
  12286. private String inputString;
  12287. private final int maxPlayers;
  12288. private final int myPlayerIndex;
  12289. private Player[] playerArray;
  12290. private int playerCount;
  12291. private int[] playerIndices;
  12292. private int anInt893;
  12293. private int[] anIntArray894;
  12294. private Stream[] aStreamArray895s;
  12295. private int anInt896;
  12296. private int anInt897;
  12297. private int friendsCount;
  12298. private int anInt900;
  12299. private int[][] anIntArrayArray901;
  12300. private final int anInt902;
  12301. private byte[] aByteArray912;
  12302. private int anInt913;
  12303. private int crossX;
  12304. private int crossY;
  12305. private int crossIndex;
  12306. private int crossType;
  12307. private int plane;
  12308. private final int[] currentStats;
  12309. private static int anInt924;
  12310. private final long[] ignoreListAsLongs;
  12311. private boolean loadingError;
  12312. private final int anInt927;
  12313. private final int[] anIntArray928;
  12314. private int[][] anIntArrayArray929;
  12315. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  12316. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  12317. private int anInt933;
  12318. private int anInt934;
  12319. private int anInt935;
  12320. private int anInt936;
  12321. private int anInt937;
  12322. private int anInt938;
  12323. private static int anInt940;
  12324. private final int[] chatTypes;
  12325. private final String[] chatNames;
  12326. private final String[] chatMessages;
  12327. private int anInt945;
  12328. private WorldController worldController;
  12329. private Sprite[] sideIcons;
  12330. private int menuScreenArea;
  12331. private int menuOffsetX;
  12332. private int menuOffsetY;
  12333. private int menuWidth;
  12334. private int menuHeight;
  12335. private long aLong953;
  12336. private boolean aBoolean954;
  12337. private long[] friendsListAsLongs;
  12338. private String[] clanList = new String[100];
  12339. private int currentSong;
  12340. private static int nodeID = 10;
  12341. static int portOff;
  12342. static boolean clientData;
  12343. private static boolean isMembers = true;
  12344. private static boolean lowMem;
  12345. private volatile boolean drawingFlames;
  12346. private int spriteDrawX;
  12347. private int spriteDrawY;
  12348. private final int[] anIntArray965 = {
  12349. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  12350. };
  12351. private Background aBackground_966;
  12352. private Background aBackground_967;
  12353. private final int[] anIntArray968;
  12354. private final int[] anIntArray969;
  12355. final Decompressor[] decompressors;
  12356. public int variousSettings[];
  12357. private boolean aBoolean972;
  12358. private final int anInt975;
  12359. private final int[] anIntArray976;
  12360. private final int[] anIntArray977;
  12361. private final int[] anIntArray978;
  12362. private final int[] anIntArray979;
  12363. private final int[] anIntArray980;
  12364. private final int[] anIntArray981;
  12365. private final int[] anIntArray982;
  12366. private final String[] aStringArray983;
  12367. private int anInt984;
  12368. private int anInt985;
  12369. private static int anInt986;
  12370. private Sprite[] hitMarks;
  12371. private int anInt988;
  12372. private int anInt989;
  12373. private final int[] anIntArray990;
  12374. private static boolean aBoolean993;
  12375. private final boolean aBoolean994;
  12376. private int anInt995;
  12377. private int anInt996;
  12378. private int anInt997;
  12379. private int anInt998;
  12380. private int anInt999;
  12381. private ISAACRandomGen encryption;
  12382. private Sprite mapEdge;
  12383. private Sprite multiOverlay;
  12384. private final int anInt1002;
  12385. static final int[][] anIntArrayArray1003 = {
  12386. {
  12387. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  12388. 2983, 54193
  12389. }, {
  12390. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  12391. 56621, 4783, 1341, 16578, 35003, 25239
  12392. }, {
  12393. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  12394. 10153, 56621, 4783, 1341, 16578, 35003
  12395. }, {
  12396. 4626, 11146, 6439, 12, 4758, 10270
  12397. }, {
  12398. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  12399. }
  12400. };
  12401. private String amountOrNameInput;
  12402. private static int anInt1005;
  12403. private int daysSinceLastLogin;
  12404. private int pktSize;
  12405. private int pktType;
  12406. private int anInt1009;
  12407. private int anInt1010;
  12408. private int anInt1011;
  12409. private NodeList aClass19_1013;
  12410. private int anInt1014;
  12411. private int anInt1015;
  12412. private int anInt1016;
  12413. private boolean aBoolean1017;
  12414. private int anInt1018;
  12415. private static final int[] anIntArray1019;
  12416. private int anInt1021;
  12417. private int anInt1022;
  12418. private int loadingStage;
  12419. private Sprite scrollBar1;
  12420. private Sprite scrollBar2;
  12421. private int anInt1026;
  12422. private Background backBase1;
  12423. private Background backBase2;
  12424. private Background backHmid1;
  12425. private final int[] anIntArray1030;
  12426. private boolean aBoolean1031;
  12427. private Sprite[] mapFunctions;
  12428. private int baseX;
  12429. private int baseY;
  12430. private int anInt1036;
  12431. private int anInt1037;
  12432. private int loginFailures;
  12433. private int anInt1039;
  12434. private int anInt1040;
  12435. private int anInt1041;
  12436. private int dialogID;
  12437. private final int[] maxStats;
  12438. private final int[] anIntArray1045;
  12439. private int anInt1046;
  12440. private boolean aBoolean1047;
  12441. private int anInt1048;
  12442. private String aString1049;
  12443. private static int anInt1051;
  12444. private final int[] anIntArray1052;
  12445. private StreamLoader titleStreamLoader;
  12446. private int anInt1054;
  12447. private int anInt1055;
  12448. private NodeList aClass19_1056;
  12449. private final int[] anIntArray1057;
  12450. public final RSInterface aClass9_1059;
  12451. private Background[] mapScenes;
  12452. private static int anInt1061;
  12453. private int anInt1062;
  12454. private final int barFillColor;
  12455. private int friendsListAction;
  12456. private final int[] anIntArray1065;
  12457. private int mouseInvInterfaceIndex;
  12458. private int lastActiveInvInterface;
  12459. private OnDemandFetcher onDemandFetcher;
  12460. private int anInt1069;
  12461. private int anInt1070;
  12462. private int anInt1071;
  12463. private int[] anIntArray1072;
  12464. private int[] anIntArray1073;
  12465. private Sprite mapDotItem;
  12466. private Sprite mapDotNPC;
  12467. private Sprite mapDotPlayer;
  12468. private Sprite mapDotFriend;
  12469. private Sprite mapDotTeam;
  12470. private Sprite mapDotClan;
  12471. private int anInt1079;
  12472. private boolean aBoolean1080;
  12473. private String[] friendsList;
  12474. private Stream inStream;
  12475. private int anInt1084;
  12476. private int anInt1085;
  12477. private int activeInterfaceType;
  12478. private int anInt1087;
  12479. private int anInt1088;
  12480. public static int anInt1089;
  12481. private final int[] expectedCRCs;
  12482. private int[] menuActionCmd2;
  12483. private int[] menuActionCmd3;
  12484. private int[] menuActionID;
  12485. private int[] menuActionCmd1;
  12486. private Sprite[] headIcons;
  12487. private Sprite[] skullIcons;
  12488. private Sprite[] headIconsHint;
  12489. private static int anInt1097;
  12490. private int anInt1098;
  12491. private int anInt1099;
  12492. private int anInt1100;
  12493. private int anInt1101;
  12494. private int anInt1102;
  12495. private static boolean tabAreaAltered;
  12496. private int anInt1104;
  12497. private RSImageProducer aRSImageProducer_1107;
  12498. private RSImageProducer aRSImageProducer_1108;
  12499. private RSImageProducer aRSImageProducer_1109;
  12500. private RSImageProducer aRSImageProducer_1110;
  12501. private RSImageProducer aRSImageProducer_1111;
  12502. private RSImageProducer aRSImageProducer_1112;
  12503. private RSImageProducer aRSImageProducer_1113;
  12504. private RSImageProducer aRSImageProducer_1114;
  12505. private RSImageProducer aRSImageProducer_1115;
  12506. private static int anInt1117;
  12507. private int membersInt;
  12508. private String aString1121;
  12509. private Sprite compass;
  12510. private RSImageProducer aRSImageProducer_1123;
  12511. private RSImageProducer aRSImageProducer_1124;
  12512. private RSImageProducer aRSImageProducer_1125;
  12513. public static Player myPlayer;
  12514. private final String[] atPlayerActions;
  12515. private final boolean[] atPlayerArray;
  12516. private final int[][][] anIntArrayArrayArray1129;
  12517. private final int[] tabInterfaceIDs = {
  12518. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  12519. -1, -1, -1, -1, -1
  12520. };
  12521. private int anInt1131;
  12522. private int anInt1132;
  12523. private int menuActionRow;
  12524. private static int anInt1134;
  12525. private int spellSelected;
  12526. private int anInt1137;
  12527. private int spellUsableOn;
  12528. private String spellTooltip;
  12529. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  12530. private boolean aBoolean1141;
  12531. private static int anInt1142;
  12532. private int energy;
  12533. private boolean aBoolean1149;
  12534. private Sprite[] crosses;
  12535. private boolean musicEnabled;
  12536. private Background[] aBackgroundArray1152s;
  12537. private static boolean needDrawTabArea;
  12538. private int unreadMessages;
  12539. private static int anInt1155;
  12540. private static boolean fpsOn;
  12541. public boolean loggedIn;
  12542. private boolean canMute;
  12543. private boolean aBoolean1159;
  12544. private boolean aBoolean1160;
  12545. static int loopCycle;
  12546. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  12547. private RSImageProducer aRSImageProducer_1163;
  12548. private RSImageProducer mapEdgeIP;
  12549. private RSImageProducer aRSImageProducer_1164;
  12550. private RSImageProducer aRSImageProducer_1165;
  12551. private RSImageProducer aRSImageProducer_1166;
  12552. private int daysSinceRecovChange;
  12553. private RSSocket socketStream;
  12554. private int anInt1169;
  12555. private int minimapInt3;
  12556. private int anInt1171;
  12557. private long aLong1172;
  12558. private String myUsername;
  12559. private String myPassword;
  12560. private static int anInt1175;
  12561. private boolean genericLoadingError;
  12562. private final int[] anIntArray1177 = {
  12563. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  12564. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  12565. 2, 2, 3
  12566. };
  12567. private int reportAbuseInterfaceID;
  12568. private NodeList aClass19_1179;
  12569. private int[] anIntArray1180;
  12570. private int[] anIntArray1181;
  12571. private int[] anIntArray1182;
  12572. private byte[][] aByteArrayArray1183;
  12573. private int anInt1184;
  12574. private int minimapInt1;
  12575. private int anInt1186;
  12576. private int anInt1187;
  12577. private static int anInt1188;
  12578. private int invOverlayInterfaceID;
  12579. private int[] anIntArray1190;
  12580. private int[] anIntArray1191;
  12581. private Stream stream;
  12582. private int anInt1193;
  12583. private int splitPrivateChat;
  12584. private Background mapBack;
  12585. private String[] menuActionName;
  12586. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  12587. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  12588. private final int[] anIntArray1203;
  12589. static final int[] anIntArray1204 = {
  12590. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  12591. 58654, 5027, 1457, 16565, 34991, 25486
  12592. };
  12593. private static boolean flagged;
  12594. private final int[] anIntArray1207;
  12595. private int anInt1208;
  12596. private int minimapInt2;
  12597. private int anInt1210;
  12598. private int anInt1211;
  12599. private String promptInput;
  12600. private int anInt1213;
  12601. private int[][][] intGroundArray;
  12602. private long aLong1215;
  12603. private int loginScreenCursorPos;
  12604. private final Background[] modIcons;
  12605. private long aLong1220;
  12606. private static int tabID;
  12607. private int anInt1222;
  12608. public static boolean inputTaken;
  12609. private int inputDialogState;
  12610. private static int anInt1226;
  12611. private int nextSong;
  12612. private boolean songChanging;
  12613. private final int[] anIntArray1229;
  12614. private Class11[] aClass11Array1230;
  12615. public static int anIntArray1232[];
  12616. private boolean aBoolean1233;
  12617. private int[] anIntArray1234;
  12618. private int[] anIntArray1235;
  12619. private int[] anIntArray1236;
  12620. private int anInt1237;
  12621. private int anInt1238;
  12622. public final int anInt1239 = 100;
  12623. private final int[] anIntArray1240;
  12624. private final int[] anIntArray1241;
  12625. private boolean aBoolean1242;
  12626. private int atInventoryLoopCycle;
  12627. private int atInventoryInterface;
  12628. private int atInventoryIndex;
  12629. private int atInventoryInterfaceType;
  12630. private byte[][] aByteArrayArray1247;
  12631. private int tradeMode;
  12632. private int anInt1249;
  12633. private final int[] anIntArray1250;
  12634. private int anInt1251;
  12635. private final boolean rsAlreadyLoaded;
  12636. private int anInt1253;
  12637. private int anInt1254;
  12638. private boolean welcomeScreenRaised;
  12639. private boolean messagePromptRaised;
  12640. private int anInt1257;
  12641. private byte[][][] byteGroundArray;
  12642. private int prevSong;
  12643. private int destX;
  12644. private int destY;
  12645. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  12646. private int anInt1264;
  12647. private int anInt1265;
  12648. private String loginMessage1;
  12649. private String loginMessage2;
  12650. private int anInt1268;
  12651. private int anInt1269;
  12652. private TextDrawingArea smallText;
  12653. private TextDrawingArea aTextDrawingArea_1271;
  12654. private TextDrawingArea chatTextDrawingArea;
  12655. private int anInt1275;
  12656. private int backDialogID;
  12657. private int anInt1278;
  12658. private int anInt1279;
  12659. private int[] bigX;
  12660. private int[] bigY;
  12661. private int itemSelected;
  12662. private int anInt1283;
  12663. private int anInt1284;
  12664. private int anInt1285;
  12665. private String selectedItemName;
  12666. private int publicChatMode;
  12667. private static int anInt1288;
  12668. private int anInt1289;
  12669. public static int anInt1290;
  12670. public static String server = "";
  12671. public int drawCount;
  12672. public int fullscreenInterfaceID;
  12673. public int anInt1044;//377
  12674. public int anInt1129;//377
  12675. public int anInt1315;//377
  12676. public int anInt1500;//377
  12677. public int anInt1501;//377
  12678. public int[] fullScreenTextureArray;
  12679. public void resetAllImageProducers() {
  12680. if (super.fullGameScreen != null) {
  12681. return;
  12682. }
  12683. aRSImageProducer_1166 = null;
  12684. aRSImageProducer_1164 = null;
  12685. aRSImageProducer_1163 = null;
  12686. aRSImageProducer_1165 = null;
  12687. aRSImageProducer_1123 = null;
  12688. aRSImageProducer_1124 = null;
  12689. aRSImageProducer_1125 = null;
  12690. aRSImageProducer_1107 = null;
  12691. aRSImageProducer_1108 = null;
  12692. aRSImageProducer_1109 = null;
  12693. aRSImageProducer_1110 = null;
  12694. aRSImageProducer_1111 = null;
  12695. aRSImageProducer_1112 = null;
  12696. aRSImageProducer_1113 = null;
  12697. aRSImageProducer_1114 = null;
  12698. aRSImageProducer_1115 = null;
  12699. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  12700. welcomeScreenRaised = true;
  12701. }
  12702.  
  12703.  
  12704. public void launchURL(String url) {
  12705. String osName = System.getProperty("os.name");
  12706. try {
  12707. if (osName.startsWith("Mac OS")) {
  12708. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  12709. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
  12710. openURL.invoke(null, new Object[] {url});
  12711. } else if (osName.startsWith("Windows"))
  12712. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  12713. else { //assume Unix or Linux
  12714. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  12715. String browser = null;
  12716. for (int count = 0; count < browsers.length && browser == null; count++)
  12717. if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
  12718. browser = browsers[count];
  12719. if (browser == null) {
  12720. throw new Exception("Could not find web browser");
  12721. } else
  12722. Runtime.getRuntime().exec(new String[] {browser, url});
  12723. }
  12724. } catch (Exception e) {
  12725. pushMessage("Failed to open URL.", 0, "");
  12726. }
  12727. }
  12728.  
  12729. static {
  12730. anIntArray1019 = new int[99];
  12731. int i = 0;
  12732. for(int j = 0; j < 99; j++) {
  12733. int l = j + 1;
  12734. int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  12735. i += i1;
  12736. anIntArray1019[j] = i / 4;
  12737. }
  12738. anIntArray1232 = new int[32];
  12739. i = 2;
  12740. for(int k = 0; k < 32; k++) {
  12741. anIntArray1232[k] = i - 1;
  12742. i += i;
  12743. }
  12744. }
  12745. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement