Advertisement
Guest User

Untitled

a guest
Jan 14th, 2016
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 373.54 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.  
  13. import sign.signlink;
  14.  
  15. import javax.swing.*;
  16.  
  17. public class client extends RSApplet {
  18.  
  19.  
  20. public int MapX, MapY;
  21. public static int spellID = 0;
  22. public static boolean newDamage = false;
  23.  
  24. private static String intToKOrMilLongName(int i) {
  25. String s = String.valueOf(i);
  26. for(int k = s.length() - 3; k > 0; k -= 3)
  27. s = s.substring(0, k) + "," + s.substring(k);
  28.  
  29. //if(j != 0)
  30. // aBoolean1224 = !aBoolean1224;
  31. if(s.length() > 8)
  32. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  33. else
  34. if(s.length() > 4)
  35. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  36. return " " + s;
  37. }
  38. public final String methodR(/*int i,*/ int j)
  39. {
  40. //if(i <= 0)
  41. // pktType = inStream.readUnsignedByte();
  42. if(j >= 0 && j < 10000)
  43. return String.valueOf(j);
  44. if(j >= 10000 && j < 10000000)
  45. return j / 1000 + "K";
  46. if(j >= 10000000 && j < 999999999)
  47. return j / 1000000 + "M";
  48. if(j >= 999999999)
  49. return "*";
  50. else
  51. return "?";
  52. }
  53.  
  54. public static final byte[] ReadFile(String s) {
  55. try {
  56. byte abyte0[];
  57. File file = new File(s);
  58. int i = (int)file.length();
  59. abyte0 = new byte[i];
  60. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  61. datainputstream.readFully(abyte0, 0, i);
  62. datainputstream.close();
  63. return abyte0;
  64. } catch(Exception e) {
  65. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  66. return null;
  67. }
  68. }
  69.  
  70. public void models() {
  71. for(int ModelIndex = 0; ModelIndex < 29191; ModelIndex++) {
  72. byte[] abyte0 = getModel(ModelIndex);
  73. if(abyte0 != null && abyte0.length > 0) {
  74. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  75. pushMessage("Model added successfully!", 0, "");
  76. }
  77. }
  78. }
  79. public byte[] getModel(int Index) {
  80. try {
  81. File Model = new File("./model/"+Index+".gz");
  82. byte[] aByte = new byte[(int)Model.length()];
  83. FileInputStream fis = new FileInputStream(Model);
  84. fis.read(aByte);
  85. pushMessage("aByte = ["+aByte+"]!", 0, "");
  86. fis.close();
  87. return aByte;
  88. }
  89. catch(Exception e)
  90. {return null;}
  91. }
  92.  
  93. private void stopMidi() {
  94. signlink.midifade = 0;
  95. signlink.midi = "stop";
  96. }
  97.  
  98. private boolean menuHasAddFriend(int j) {
  99. if(j < 0)
  100. return false;
  101. int k = menuActionID[j];
  102. if(k >= 2000)
  103. k -= 2000;
  104. return k == 337;
  105. }
  106.  
  107. public void drawChannelButtons() {
  108. String text[] = { "On", "Friends", "Off", "Hide" };
  109. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  110. switch(cButtonCPos) {
  111. case 0:
  112. chatButtons[1].drawSprite(5, 142);
  113. break;
  114. case 1:
  115. chatButtons[1].drawSprite(71, 142);
  116. break;
  117. case 2:
  118. chatButtons[1].drawSprite(137, 142);
  119. break;
  120. case 3:
  121. chatButtons[1].drawSprite(203, 142);
  122. break;
  123. case 4:
  124. chatButtons[1].drawSprite(269, 142);
  125. break;
  126. case 5:
  127. chatButtons[1].drawSprite(335, 142);
  128. break;
  129. }
  130. if(cButtonHPos == cButtonCPos) {
  131. switch(cButtonHPos) {
  132. case 0:
  133. chatButtons[2].drawSprite(5, 142);
  134. break;
  135. case 1:
  136. chatButtons[2].drawSprite(71, 142);
  137. break;
  138. case 2:
  139. chatButtons[2].drawSprite(137, 142);
  140. break;
  141. case 3:
  142. chatButtons[2].drawSprite(203, 142);
  143. break;
  144. case 4:
  145. chatButtons[2].drawSprite(269, 142);
  146. break;
  147. case 5:
  148. chatButtons[2].drawSprite(335, 142);
  149. break;
  150. case 6:
  151. chatButtons[3].drawSprite(404, 142);
  152. break;
  153. }
  154. } else {
  155. switch(cButtonHPos) {
  156. case 0:
  157. chatButtons[0].drawSprite(5, 142);
  158. break;
  159. case 1:
  160. chatButtons[0].drawSprite(71, 142);
  161. break;
  162. case 2:
  163. chatButtons[0].drawSprite(137, 142);
  164. break;
  165. case 3:
  166. chatButtons[0].drawSprite(203, 142);
  167. break;
  168. case 4:
  169. chatButtons[0].drawSprite(269, 142);
  170. break;
  171. case 5:
  172. chatButtons[0].drawSprite(335, 142);
  173. break;
  174. case 6:
  175. chatButtons[3].drawSprite(404, 142);
  176. break;
  177. }
  178. }
  179. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
  180. smallText.method389(true, 26, 0xffffff, "All", 157);
  181. smallText.method389(true, 86, 0xffffff, "Game", 157);
  182. smallText.method389(true, 150, 0xffffff, "Public", 152);
  183. smallText.method389(true, 212, 0xffffff, "Private", 152);
  184. smallText.method389(true, 286, 0xffffff, "Clan", 152);
  185. smallText.method389(true, 349, 0xffffff, "Trade", 152);
  186. smallText.method382(textColor[publicChatMode], 164, text[publicChatMode], 163, true);
  187. smallText.method382(textColor[privateChatMode], 230, text[privateChatMode], 163, true);
  188. smallText.method382(textColor[clanChatMode], 296, text[clanChatMode], 163, true);
  189. smallText.method382(textColor[tradeMode], 362, text[tradeMode], 163, true);
  190. }
  191.  
  192. private void drawChatArea() {
  193. aRSImageProducer_1166.initDrawingArea();
  194. Texture.anIntArray1472 = anIntArray1180;
  195. chatArea.drawSprite(0, 0);
  196. drawChannelButtons();
  197. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  198. if(messagePromptRaised) {
  199. chatTextDrawingArea.drawText(0, aString1121, 60, 259);
  200. chatTextDrawingArea.drawText(128, promptInput + "*", 80, 259);
  201. } else if(inputDialogState == 1) {
  202. chatTextDrawingArea.drawText(0, "Enter amount:", 60, 259);
  203. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  204. } else if(inputDialogState == 2) {
  205. chatTextDrawingArea.drawText(0, "Enter name:", 60, 259);
  206. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  207. } else if(aString844 != null) {
  208. chatTextDrawingArea.drawText(0, aString844, 60, 259);
  209. chatTextDrawingArea.drawText(128, "Click to continue", 80, 259);
  210. } else if(backDialogID != -1) {
  211. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  212. } else if(dialogID != -1) {
  213. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  214. } else {
  215. int j77 = -3;
  216. int j = 0;
  217. DrawingArea.setDrawingArea(122, 8, 497, 7);
  218. for(int k = 0; k < 500; k++)
  219. if(chatMessages[k] != null) {
  220. int chatType = chatTypes[k];
  221. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  222. String s1 = chatNames[k];
  223. byte byte0 = 0;
  224. if(s1 != null && s1.startsWith("@cr1@")) {
  225. s1 = s1.substring(5);
  226. byte0 = 1;
  227. } else if(s1 != null && s1.startsWith("@cr2@")) {
  228. s1 = s1.substring(5);
  229. byte0 = 2;
  230. } else if(s1 != null && s1.startsWith("@cr3@")) {
  231. s1 = s1.substring(5);
  232. byte0 = 3;
  233. }
  234. if(chatType == 0) {
  235. if (chatTypeView == 5 || chatTypeView == 0) {
  236. if(yPos > 0 && yPos < 210)
  237. textDrawingArea.method389(false, 11, 0, chatMessages[k], yPos);//chat color enabled
  238. j++;
  239. j77++;
  240. }
  241. }
  242. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  243. if (chatTypeView == 1 || chatTypeView == 0) {
  244. if(yPos > 0 && yPos < 210) {
  245. int xPos = 11;
  246. if(byte0 == 1) {
  247. modIcons[0].drawBackground(xPos + 1, yPos - 12);
  248. xPos += 14;
  249. } else if(byte0 == 2) {
  250. modIcons[1].drawBackground(xPos + 1, yPos - 12);
  251. xPos += 14;
  252. } else if(byte0 == 3) {
  253. modIcons[2].drawBackground(xPos + 1, yPos - 12);
  254. xPos += 14;
  255. }
  256. textDrawingArea.method385(0, s1 + ":", yPos, xPos);
  257. xPos += textDrawingArea.getTextWidth(s1) + 8;
  258. textDrawingArea.method389(false, xPos, 255, chatMessages[k], yPos);
  259. }
  260. j++;
  261. j77++;
  262. }
  263. }
  264. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  265. if (chatTypeView == 2 || chatTypeView == 0) {
  266. if(yPos > 0 && yPos < 210) {
  267. int k1 = 11;
  268. textDrawingArea.method385(0, "From", yPos, k1);
  269. k1 += textDrawingArea.getTextWidth("From ");
  270. if(byte0 == 1) {
  271. modIcons[0].drawBackground(k1, yPos - 12);
  272. k1 += 12;
  273. } else if(byte0 == 2) {
  274. modIcons[1].drawBackground(k1, yPos - 12);
  275. k1 += 12;
  276. } else if(byte0 == 3) {
  277. modIcons[2].drawBackground(k1, yPos - 12);
  278. k1 += 12;
  279. }
  280. textDrawingArea.method385(0, s1 + ":", yPos, k1);
  281. k1 += textDrawingArea.getTextWidth(s1) + 8;
  282. textDrawingArea.method385(0x800000, chatMessages[k], yPos, k1);
  283. }
  284. j++;
  285. j77++;
  286. }
  287. }
  288. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  289. if (chatTypeView == 3 || chatTypeView == 0) {
  290. if(yPos > 0 && yPos < 210)
  291. textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], yPos, 11);
  292. j++;
  293. j77++;
  294. }
  295. }
  296. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  297. if (chatTypeView == 2 || chatTypeView == 0) {
  298. if(yPos > 0 && yPos < 210)
  299. textDrawingArea.method385(0x800000, chatMessages[k], yPos, 11);
  300. j++;
  301. j77++;
  302. }
  303. }
  304. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  305. if (chatTypeView == 2 || chatTypeView == 0) {
  306. if(yPos > 0 && yPos < 210) {
  307. textDrawingArea.method385(0, "To " + s1 + ":", yPos, 11);
  308. textDrawingArea.method385(0x800000, chatMessages[k], yPos, 15 + textDrawingArea.getTextWidth("To :" + s1));
  309. }
  310. j++;
  311. j77++;
  312. }
  313. }
  314. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  315. if (chatTypeView == 3 || chatTypeView == 0) {
  316. if(yPos > 0 && yPos < 210)
  317. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  318. j++;
  319. j77++;
  320. }
  321. if(chatType == 11 && (clanChatMode == 0)) {
  322. if (chatTypeView == 11) {
  323. if(yPos > 0 && yPos < 210)
  324. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  325. j++;
  326. j77++;
  327. }
  328. if(chatType == 12) {
  329. if(yPos > 0 && yPos < 110)
  330. textDrawingArea.method385(0x7e3200, chatMessages[k] + " @blu@" + s1, yPos, 11);
  331. j++;
  332. }
  333. }
  334. }
  335. if(chatType == 16) {
  336. int j2 = 40;
  337. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  338. if(chatTypeView == 11 || chatTypeView == 0) {
  339. if(yPos > 3 && yPos < 130)
  340. switch(chatRights[k]) {
  341. case 1:
  342. j2 += clanNameWidth;
  343. modIcons[0].drawBackground(j2 - 18, yPos - 12);
  344. j2 += 14;
  345. break;
  346.  
  347. case 2:
  348. j2 += clanNameWidth;
  349. modIcons[1].drawBackground(j2 - 18, yPos - 12);
  350. j2 += 14;
  351. break;
  352.  
  353. case 3:
  354. j2 += clanNameWidth;
  355. modIcons[1].drawBackground(j2 - 18, yPos - 12);
  356. j2 += 14;
  357. break;
  358.  
  359. default:
  360. j2 += clanNameWidth;
  361. break;
  362. }
  363. textDrawingArea.method385(0, "[", yPos, 8);
  364. textDrawingArea.method385(255, ""+clanname+"", yPos, 14);
  365. textDrawingArea.method385(0, "]", yPos, clanNameWidth + 14);
  366.  
  367. textDrawingArea.method385(0, chatNames[k]+":", yPos, j2 - 17); //j2
  368. j2 += textDrawingArea.getTextWidth(chatNames[k]) + 7;
  369. textDrawingArea.method385(0x800000, chatMessages[k], yPos, j2 - 16);//j2
  370. j++;
  371. j77++;
  372. }
  373. }
  374. }
  375. DrawingArea.defaultDrawingAreaSize();
  376. anInt1211 = j * 14 + 7 + 5;
  377. if(anInt1211 < 111)
  378. anInt1211 = 111;
  379. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  380. /*String s;
  381. if(myPlayer != null && myPlayer.name != null)
  382. s = myPlayer.name;
  383. else
  384. s = TextClass.fixName(myUsername);
  385. textDrawingArea.method385(0, s + ":", 133, 11);
  386. textDrawingArea.drawChatInput(255, 12 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false);
  387. DrawingArea.method339(121, 0x807660, 506, 7);*/
  388. String s;
  389. if (myPlayer != null && myPlayer.name != null) {
  390. s = myPlayer.name;
  391. } else {
  392. s = TextClass.fixName(myUsername);
  393. }
  394. int xPos = 0;
  395. if (myPrivilege == 0) { // Player
  396. textDrawingArea.method385(0, s + ":", 133, 11);
  397. textDrawingArea.method385(0, ": ", 133, (xPos + 11) + textDrawingArea.getTextWidth(s));
  398. textDrawingArea.drawChatInput(255, 10 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false);
  399. DrawingArea.method339(121, 0x807660, 506, 7);
  400. } else if (myPrivilege == 1) { // Moderator
  401. modIcons[0].drawBackground(10 + xPos, 122);
  402. xPos += 14;
  403. textDrawingArea.method385(0, s + ":", 133, 23);
  404. textDrawingArea.method385(0, ": ", 133, (11) + textDrawingArea.getTextWidth(s));
  405. textDrawingArea.drawChatInput(255, 20 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false);
  406. DrawingArea.method339(121, 0x807660, 506, 7);
  407. } else if (myPrivilege == 2) { // Administrator
  408. modIcons[1].drawBackground(10 + xPos, 122);
  409. xPos += 14;
  410. textDrawingArea.method385(0, s + ":", 133, 23);
  411. textDrawingArea.method385(0, ": ", 133, (11) + textDrawingArea.getTextWidth(s));
  412. textDrawingArea.drawChatInput(255, 20 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false);
  413. DrawingArea.method339(121, 0x807660, 506, 7);
  414. } else if (myPrivilege == 3) { // Developer
  415. modIcons[2].drawBackground(10 + xPos, 121);
  416. xPos += 14;
  417. textDrawingArea.method385(0, s + ":", 133, 11);
  418. textDrawingArea.method385(11, ": ", 133, (xPos + 11) + textDrawingArea.getTextWidth(s));
  419. textDrawingArea.drawChatInput(255, 12 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false);
  420. DrawingArea.method339(121, 0x807660, 506, 7);
  421. }
  422. }
  423. if(menuOpen && menuScreenArea == 2) {
  424. drawMenu();
  425. }
  426. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  427. aRSImageProducer_1165.initDrawingArea();
  428. Texture.anIntArray1472 = anIntArray1182;
  429. }
  430.  
  431. public void init() {
  432. nodeID = 10;
  433. portOff = 0;
  434. setHighMem();
  435. isMembers = true;
  436. initClientFrame(503, 765);
  437. }
  438.  
  439. public void startRunnable(Runnable runnable, int i) {
  440. if(i > 10)
  441. i = 10;
  442. if(signlink.mainapp != null) {
  443. signlink.startthread(runnable, i);
  444. } else {
  445. super.startRunnable(runnable, i);
  446. }
  447. }
  448.  
  449. public Socket openSocket(int port) throws IOException {
  450. return new Socket(InetAddress.getByName(server), port);
  451. }
  452.  
  453. private void processMenuClick() {
  454. if(activeInterfaceType != 0)
  455. return;
  456. int j = super.clickMode3;
  457. if(spellSelected == 1 && super.saveClickX >= 516 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  458. j = 0;
  459. if(menuOpen) {
  460. if(j != 1) {
  461. int k = super.mouseX;
  462. int j1 = super.mouseY;
  463. if(menuScreenArea == 0) {
  464. k -= 4;
  465. j1 -= 4;
  466. }
  467. if(menuScreenArea == 1) {
  468. k -= 519;
  469. j1 -= 168;
  470. }
  471. if(menuScreenArea == 2) {
  472. k -= 17;
  473. j1 -= 338;
  474. }
  475. if(menuScreenArea == 3) {
  476. k -= 519;
  477. j1 -= 0;
  478. }
  479. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  480. menuOpen = false;
  481. if(menuScreenArea == 1)
  482. needDrawTabArea = true;
  483. if(menuScreenArea == 2)
  484. inputTaken = true;
  485. }
  486. }
  487. if(j == 1) {
  488. int l = menuOffsetX;
  489. int k1 = menuOffsetY;
  490. int i2 = menuWidth;
  491. int k2 = super.saveClickX;
  492. int l2 = super.saveClickY;
  493. if(menuScreenArea == 0) {
  494. k2 -= 4;
  495. l2 -= 4;
  496. }
  497. if(menuScreenArea == 1) {
  498. k2 -= 519;
  499. l2 -= 168;
  500. }
  501. if(menuScreenArea == 2) {
  502. k2 -= 17;
  503. l2 -= 338;
  504. }
  505. if(menuScreenArea == 3) {
  506. k2 -= 519;
  507. l2 -= 0;
  508. }
  509. int i3 = -1;
  510. for(int j3 = 0; j3 < menuActionRow; j3++) {
  511. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  512. if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  513. i3 = j3;
  514. }
  515. System.out.println(i3);
  516. if(i3 != -1)
  517. doAction(i3);
  518. menuOpen = false;
  519. if(menuScreenArea == 1)
  520. needDrawTabArea = true;
  521. if(menuScreenArea == 2) {
  522. inputTaken = true;
  523. }
  524. }
  525. } else {
  526. if(j == 1 && menuActionRow > 0) {
  527. int i1 = menuActionID[menuActionRow - 1];
  528. 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) {
  529. int l1 = menuActionCmd2[menuActionRow - 1];
  530. int j2 = menuActionCmd3[menuActionRow - 1];
  531. RSInterface class9 = RSInterface.interfaceCache[j2];
  532. if(class9.aBoolean259 || class9.aBoolean235) {
  533. aBoolean1242 = false;
  534. anInt989 = 0;
  535. anInt1084 = j2;
  536. anInt1085 = l1;
  537. activeInterfaceType = 2;
  538. anInt1087 = super.saveClickX;
  539. anInt1088 = super.saveClickY;
  540. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  541. activeInterfaceType = 1;
  542. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  543. activeInterfaceType = 3;
  544. return;
  545. }
  546. }
  547. }
  548. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  549. j = 2;
  550. if(j == 1 && menuActionRow > 0)
  551. doAction(menuActionRow - 1);
  552. if(j == 2 && menuActionRow > 0)
  553. determineMenuSize();
  554. }
  555. }
  556.  
  557.  
  558. public static int totalRead = 0;
  559.  
  560. public static String getFileNameWithoutExtension(String fileName) {
  561. File tmpFile = new File(fileName);
  562. tmpFile.getName();
  563. int whereDot = tmpFile.getName().lastIndexOf('.');
  564. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2 ) {
  565. return tmpFile.getName().substring(0, whereDot);
  566. }
  567. return "";
  568. }
  569.  
  570. public void preloadModels() {
  571. File file = new File("./Raw/");
  572. File[] fileArray = file.listFiles();
  573. for(int y = 0; y < fileArray.length; y++) {
  574. String s = fileArray[y].getName();
  575. byte[] buffer = ReadFile("./Raw/"+s);
  576. Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
  577. }
  578. }
  579.  
  580.  
  581.  
  582. private void saveMidi(boolean flag, byte abyte0[])
  583. {
  584. signlink.midifade = flag ? 1 : 0;
  585. signlink.midisave(abyte0, abyte0.length);
  586. }
  587.  
  588. private void method22()
  589. {
  590. try
  591. {
  592. anInt985 = -1;
  593. aClass19_1056.removeAll();
  594. aClass19_1013.removeAll();
  595. Texture.method366();
  596. unlinkMRUNodes();
  597. worldController.initToNull();
  598. System.gc();
  599. for(int i = 0; i < 4; i++)
  600. aClass11Array1230[i].method210();
  601.  
  602. for(int l = 0; l < 4; l++)
  603. {
  604. for(int k1 = 0; k1 < 104; k1++)
  605. {
  606. for(int j2 = 0; j2 < 104; j2++)
  607. byteGroundArray[l][k1][j2] = 0;
  608.  
  609. }
  610.  
  611. }
  612.  
  613. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  614. int k2 = aByteArrayArray1183.length;
  615. stream.createFrame(0);
  616. if(!aBoolean1159)
  617. {
  618. for(int i3 = 0; i3 < k2; i3++)
  619. {
  620. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  621. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  622. byte abyte0[] = aByteArrayArray1183[i3];
  623. if (FileOperations.FileExists(signlink.findcachedir()+"maps/"+anIntArray1235[i3]+".dat"))
  624. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"maps/"+anIntArray1235[i3]+".dat");
  625. if(abyte0 != null)
  626. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  627. }
  628.  
  629. for(int j4 = 0; j4 < k2; j4++)
  630. {
  631. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  632. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  633. byte abyte2[] = aByteArrayArray1183[j4];
  634. if(abyte2 == null && anInt1070 < 800)
  635. objectManager.method174(k7, 64, 64, l5);
  636. }
  637.  
  638. anInt1097++;
  639. if(anInt1097 > 160)
  640. {
  641. anInt1097 = 0;
  642. stream.createFrame(238);
  643. stream.writeWordBigEndian(96);
  644. }
  645. stream.createFrame(0);
  646. for(int i6 = 0; i6 < k2; i6++)
  647. {
  648. byte abyte1[] = aByteArrayArray1247[i6];
  649. if(abyte1 != null)
  650. {
  651. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  652. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  653. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  654. }
  655. }
  656.  
  657. }
  658. if(aBoolean1159)
  659. {
  660. for(int j3 = 0; j3 < 4; j3++)
  661. {
  662. for(int k4 = 0; k4 < 13; k4++)
  663. {
  664. for(int j6 = 0; j6 < 13; j6++)
  665. {
  666. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  667. if(l7 != -1)
  668. {
  669. int i9 = l7 >> 24 & 3;
  670. int l9 = l7 >> 1 & 3;
  671. int j10 = l7 >> 14 & 0x3ff;
  672. int l10 = l7 >> 3 & 0x7ff;
  673. int j11 = (j10 / 8 << 8) + l10 / 8;
  674. for(int l11 = 0; l11 < anIntArray1234.length; l11++)
  675. {
  676. if(anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  677. continue;
  678. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  679. break;
  680. }
  681.  
  682. }
  683. }
  684.  
  685. }
  686.  
  687. }
  688.  
  689. for(int l4 = 0; l4 < 13; l4++)
  690. {
  691. for(int k6 = 0; k6 < 13; k6++)
  692. {
  693. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  694. if(i8 == -1)
  695. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  696. }
  697.  
  698. }
  699.  
  700. stream.createFrame(0);
  701. for(int l6 = 0; l6 < 4; l6++)
  702. {
  703. for(int j8 = 0; j8 < 13; j8++)
  704. {
  705. for(int j9 = 0; j9 < 13; j9++)
  706. {
  707. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  708. if(i10 != -1)
  709. {
  710. int k10 = i10 >> 24 & 3;
  711. int i11 = i10 >> 1 & 3;
  712. int k11 = i10 >> 14 & 0x3ff;
  713. int i12 = i10 >> 3 & 0x7ff;
  714. int j12 = (k11 / 8 << 8) + i12 / 8;
  715. for(int k12 = 0; k12 < anIntArray1234.length; k12++)
  716. {
  717. if(anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  718. continue;
  719. //objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  720. byte abyte0[] = aByteArrayArray1247[k12];
  721. if (FileOperations.FileExists(signlink.findcachedir()+"maps/"+anIntArray1235[k12]+".dat"))
  722. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"maps/"+anIntArray1235[k12]+".dat");
  723. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  724. break;
  725. }
  726.  
  727. }
  728. }
  729.  
  730. }
  731.  
  732. }
  733.  
  734. }
  735. stream.createFrame(0);
  736. objectManager.method171(aClass11Array1230, worldController);
  737. aRSImageProducer_1165.initDrawingArea();
  738. stream.createFrame(0);
  739. int k3 = ObjectManager.anInt145;
  740. if(k3 > plane)
  741. k3 = plane;
  742. if(k3 < plane - 1)
  743. k3 = plane - 1;
  744. if(lowMem)
  745. worldController.method275(ObjectManager.anInt145);
  746. else
  747. worldController.method275(0);
  748. for(int i5 = 0; i5 < 104; i5++)
  749. {
  750. for(int i7 = 0; i7 < 104; i7++)
  751. spawnGroundItem(i5, i7);
  752.  
  753. }
  754.  
  755. anInt1051++;
  756. if(anInt1051 > 98)
  757. {
  758. anInt1051 = 0;
  759. stream.createFrame(150);
  760. }
  761. method63();
  762. }
  763. catch(Exception exception) { }
  764. ObjectDef.mruNodes1.unlinkAll();
  765. if(super.gameFrame != null)
  766. {
  767. stream.createFrame(210);
  768. stream.writeDWord(0x3f008edd);
  769. }
  770. if(lowMem && signlink.cache_dat != null)
  771. {
  772. int j = onDemandFetcher.getVersionCount(0);
  773. for(int i1 = 0; i1 < j; i1++)
  774. {
  775. int l1 = onDemandFetcher.getModelIndex(i1);
  776. if((l1 & 0x79) == 0)
  777. Model.method461(i1);
  778. }
  779.  
  780. }
  781. System.gc();
  782. Texture.method367();
  783. onDemandFetcher.method566();
  784. int k = (anInt1069 - 6) / 8 - 1;
  785. int j1 = (anInt1069 + 6) / 8 + 1;
  786. int i2 = (anInt1070 - 6) / 8 - 1;
  787. int l2 = (anInt1070 + 6) / 8 + 1;
  788. if(aBoolean1141)
  789. {
  790. k = 49;
  791. j1 = 50;
  792. i2 = 49;
  793. l2 = 50;
  794. }
  795. for(int l3 = k; l3 <= j1; l3++)
  796. {
  797. for(int j5 = i2; j5 <= l2; j5++)
  798. if(l3 == k || l3 == j1 || j5 == i2 || j5 == l2)
  799. {
  800. int j7 = onDemandFetcher.method562(0, j5, l3);
  801. if(j7 != -1)
  802. onDemandFetcher.method560(j7, 3);
  803. int k8 = onDemandFetcher.method562(1, j5, l3);
  804. if(k8 != -1)
  805. onDemandFetcher.method560(k8, 3);
  806. }
  807.  
  808. }
  809.  
  810. }
  811.  
  812. private void unlinkMRUNodes()
  813. {
  814. ObjectDef.mruNodes1.unlinkAll();
  815. ObjectDef.mruNodes2.unlinkAll();
  816. EntityDef.mruNodes.unlinkAll();
  817. ItemDef.mruNodes2.unlinkAll();
  818. ItemDef.mruNodes1.unlinkAll();
  819. Player.mruNodes.unlinkAll();
  820. SpotAnim.aMRUNodes_415.unlinkAll();
  821. }
  822.  
  823. private void method24(int i)
  824. {
  825. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  826. int j = ai.length;
  827. for(int k = 0; k < j; k++)
  828. ai[k] = 0;
  829.  
  830. for(int l = 1; l < 103; l++)
  831. {
  832. int i1 = 24628 + (103 - l) * 512 * 4;
  833. for(int k1 = 1; k1 < 103; k1++)
  834. {
  835. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  836. worldController.method309(ai, i1, i, k1, l);
  837. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  838. worldController.method309(ai, i1, i + 1, k1, l);
  839. i1 += 4;
  840. }
  841.  
  842. }
  843.  
  844. int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  845. int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  846. aClass30_Sub2_Sub1_Sub1_1263.method343();
  847. for(int i2 = 1; i2 < 103; i2++)
  848. {
  849. for(int j2 = 1; j2 < 103; j2++)
  850. {
  851. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  852. method50(i2, j1, j2, l1, i);
  853. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  854. method50(i2, j1, j2, l1, i + 1);
  855. }
  856.  
  857. }
  858.  
  859. aRSImageProducer_1165.initDrawingArea();
  860. anInt1071 = 0;
  861. for(int k2 = 0; k2 < 104; k2++)
  862. {
  863. for(int l2 = 0; l2 < 104; l2++)
  864. {
  865. int i3 = worldController.method303(plane, k2, l2);
  866. if(i3 != 0)
  867. {
  868. i3 = i3 >> 14 & 0x7fff;
  869. int j3 = ObjectDef.forID(i3).anInt746;
  870. if(j3 >= 0)
  871. {
  872. int k3 = k2;
  873. int l3 = l2;
  874. if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  875. {
  876. byte byte0 = 104;
  877. byte byte1 = 104;
  878. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  879. for(int i4 = 0; i4 < 10; i4++)
  880. {
  881. int j4 = (int)(Math.random() * 4D);
  882. if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  883. k3--;
  884. if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  885. k3++;
  886. if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  887. l3--;
  888. if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  889. l3++;
  890. }
  891.  
  892. }
  893. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  894. anIntArray1072[anInt1071] = k3;
  895. anIntArray1073[anInt1071] = l3;
  896. anInt1071++;
  897. }
  898. }
  899. }
  900.  
  901. }
  902.  
  903. }
  904.  
  905. private void spawnGroundItem(int i, int j)
  906. {
  907. NodeList class19 = groundArray[plane][i][j];
  908. if(class19 == null)
  909. {
  910. worldController.method295(plane, i, j);
  911. return;
  912. }
  913. int k = 0xfa0a1f01;
  914. Object obj = null;
  915. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  916. {
  917. ItemDef itemDef = ItemDef.forID(item.ID);
  918. int l = itemDef.value;
  919. if(itemDef.stackable)
  920. l *= item.anInt1559 + 1;
  921. // notifyItemSpawn(item, i + baseX, j + baseY);
  922.  
  923. if(l > k)
  924. {
  925. k = l;
  926. obj = item;
  927. }
  928. }
  929.  
  930. class19.insertTail(((Node) (obj)));
  931. Object obj1 = null;
  932. Object obj2 = null;
  933. for(Item class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetNext())
  934. {
  935. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  936. obj1 = class30_sub2_sub4_sub2_1;
  937. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  938. obj2 = class30_sub2_sub4_sub2_1;
  939. }
  940.  
  941. int i1 = i + (j << 7) + 0x60000000;
  942. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  943. }
  944.  
  945. private void method26(boolean flag)
  946. {
  947. for(int j = 0; j < npcCount; j++)
  948. {
  949. NPC npc = npcArray[npcIndices[j]];
  950. int k = 0x20000000 + (npcIndices[j] << 14);
  951. if(npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  952. continue;
  953. int l = npc.x >> 7;
  954. int i1 = npc.y >> 7;
  955. if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  956. continue;
  957. if(npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  958. {
  959. if(anIntArrayArray929[l][i1] == anInt1265)
  960. continue;
  961. anIntArrayArray929[l][i1] = anInt1265;
  962. }
  963. if(!npc.desc.aBoolean84)
  964. k += 0x80000000;
  965. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  966. }
  967. }
  968.  
  969. private boolean replayWave()
  970. {
  971. return signlink.wavereplay();
  972. }
  973.  
  974. private void loadError()
  975. {
  976. String s = "ondemand";//was a constant parameter
  977. System.out.println(s);
  978. try
  979. {
  980. getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
  981. }
  982. catch(Exception exception)
  983. {
  984. exception.printStackTrace();
  985. }
  986. do
  987. try
  988. {
  989. Thread.sleep(1000L);
  990. }
  991. catch(Exception _ex) { }
  992. while(true);
  993. }
  994.  
  995. public void drawHoverBox(int xPos, int yPos, String text) {
  996. String[] results = text.split("\n");
  997. int height = (results.length * 16) + 6;
  998. int width;
  999. width = chatTextDrawingArea.getTextWidth(results[0]) + 6;
  1000. for(int i = 1; i < results.length; i++)
  1001. if(width <= chatTextDrawingArea.getTextWidth(results[i]) + 6)
  1002. width = chatTextDrawingArea.getTextWidth(results[i]) + 6;
  1003. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  1004. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  1005. yPos += 14;
  1006. for(int i = 0; i < results.length; i++) {
  1007. chatTextDrawingArea.method389(false, xPos + 3, 0, results[i], yPos);
  1008. yPos += 16;
  1009. }
  1010. }
  1011.  
  1012. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
  1013. {
  1014. if(class9.type != 0 || class9.children == null || class9.isMouseoverTriggered)
  1015. return;
  1016. if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1017. return;
  1018. int k1 = class9.children.length;
  1019. for(int l1 = 0; l1 < k1; l1++)
  1020. {
  1021. int i2 = class9.childX[l1] + i;
  1022. int j2 = (class9.childY[l1] + l) - j1;
  1023. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1024. i2 += class9_1.anInt263;
  1025. j2 += class9_1.anInt265;
  1026. if((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1027. if(class9_1.mOverInterToTrigger >= 0)
  1028. anInt886 = class9_1.mOverInterToTrigger;
  1029. else
  1030. anInt886 = class9_1.id;
  1031. if (class9_1.type == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1032. anInt1315 = class9_1.id;
  1033. }
  1034. if(class9_1.type == 0)
  1035. {
  1036. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1037. if(class9_1.scrollMax > class9_1.height)
  1038. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1039. } else
  1040. {
  1041. if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1042. {
  1043. boolean flag = false;
  1044. if(class9_1.contentType != 0)
  1045. flag = buildFriendsListMenu(class9_1);
  1046. if(!flag)
  1047. {
  1048. //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1049. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1050. menuActionID[menuActionRow] = 315;
  1051. menuActionCmd3[menuActionRow] = class9_1.id;
  1052. menuActionRow++;
  1053. }
  1054. }
  1055. if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1056. {
  1057. String s = class9_1.selectedActionName;
  1058. if(s.indexOf(" ") != -1)
  1059. s = s.substring(0, s.indexOf(" "));
  1060. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1061. menuActionID[menuActionRow] = 626;
  1062. menuActionCmd3[menuActionRow] = class9_1.id;
  1063. menuActionRow++;
  1064. }
  1065. if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1066. {
  1067. menuActionName[menuActionRow] = "Close";
  1068. menuActionID[menuActionRow] = 200;
  1069. menuActionCmd3[menuActionRow] = class9_1.id;
  1070. menuActionRow++;
  1071. }
  1072. if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1073. {
  1074. //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1075. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1076. menuActionID[menuActionRow] = 169;
  1077. menuActionCmd3[menuActionRow] = class9_1.id;
  1078. menuActionRow++;
  1079. if (class9_1.hoverText != null) {
  1080. //drawHoverBox(k, l, class9_1.hoverText);
  1081. //System.out.println("DRAWING INTERFACE: " + class9_1.hoverText);
  1082. }
  1083. }
  1084. if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1085. {
  1086. //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1087. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1088. menuActionID[menuActionRow] = 646;
  1089. menuActionCmd3[menuActionRow] = class9_1.id;
  1090. menuActionRow++;
  1091. }
  1092. if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1093. {
  1094. //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1095. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1096. menuActionID[menuActionRow] = 679;
  1097. menuActionCmd3[menuActionRow] = class9_1.id;
  1098. menuActionRow++;
  1099. }
  1100. if(class9_1.type == 2)
  1101. {
  1102. int k2 = 0;
  1103. for(int l2 = 0; l2 < class9_1.height; l2++)
  1104. {
  1105. for(int i3 = 0; i3 < class9_1.width; i3++)
  1106. {
  1107. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1108. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1109. if(k2 < 20)
  1110. {
  1111. j3 += class9_1.spritesX[k2];
  1112. k3 += class9_1.spritesY[k2];
  1113. }
  1114. if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  1115. {
  1116. mouseInvInterfaceIndex = k2;
  1117. lastActiveInvInterface = class9_1.id;
  1118. if(class9_1.inv[k2] > 0)
  1119. {
  1120. ItemDef itemDef = ItemDef.forID(class9_1.inv[k2] - 1);
  1121. if(itemSelected == 1 && class9_1.isInventoryInterface)
  1122. {
  1123. if(class9_1.id != anInt1284 || k2 != anInt1283)
  1124. {
  1125. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  1126. menuActionID[menuActionRow] = 870;
  1127. menuActionCmd1[menuActionRow] = itemDef.id;
  1128. menuActionCmd2[menuActionRow] = k2;
  1129. menuActionCmd3[menuActionRow] = class9_1.id;
  1130. menuActionRow++;
  1131. }
  1132. } else
  1133. if(spellSelected == 1 && class9_1.isInventoryInterface)
  1134. {
  1135. if((spellUsableOn & 0x10) == 16)
  1136. {
  1137. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1138. menuActionID[menuActionRow] = 543;
  1139. menuActionCmd1[menuActionRow] = itemDef.id;
  1140. menuActionCmd2[menuActionRow] = k2;
  1141. menuActionCmd3[menuActionRow] = class9_1.id;
  1142. menuActionRow++;
  1143. }
  1144. } else
  1145. {
  1146. if(class9_1.isInventoryInterface)
  1147. {
  1148. for(int l3 = 4; l3 >= 3; l3--)
  1149. if(itemDef.actions != null && itemDef.actions[l3] != null)
  1150. {
  1151. menuActionName[menuActionRow] = itemDef.actions[l3] + " @lre@" + itemDef.name;
  1152. if(l3 == 3)
  1153. menuActionID[menuActionRow] = 493;
  1154. if(l3 == 4)
  1155. menuActionID[menuActionRow] = 847;
  1156. menuActionCmd1[menuActionRow] = itemDef.id;
  1157. menuActionCmd2[menuActionRow] = k2;
  1158. menuActionCmd3[menuActionRow] = class9_1.id;
  1159. menuActionRow++;
  1160. } else
  1161. if(l3 == 4)
  1162. {
  1163. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1164. menuActionID[menuActionRow] = 847;
  1165. menuActionCmd1[menuActionRow] = itemDef.id;
  1166. menuActionCmd2[menuActionRow] = k2;
  1167. menuActionCmd3[menuActionRow] = class9_1.id;
  1168. menuActionRow++;
  1169. }
  1170.  
  1171. }
  1172. if(class9_1.usableItemInterface)
  1173. {
  1174. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1175. menuActionID[menuActionRow] = 447;
  1176. menuActionCmd1[menuActionRow] = itemDef.id;
  1177. //k2 = inventory spot
  1178. //System.out.println(k2);
  1179. menuActionCmd2[menuActionRow] = k2;
  1180. menuActionCmd3[menuActionRow] = class9_1.id;
  1181. menuActionRow++;
  1182. }
  1183. if(class9_1.isInventoryInterface && itemDef.actions != null)
  1184. {
  1185. for(int i4 = 2; i4 >= 0; i4--)
  1186. if(itemDef.actions[i4] != null)
  1187. {
  1188. menuActionName[menuActionRow] = itemDef.actions[i4] + " @lre@" + itemDef.name;
  1189. if(i4 == 0)
  1190. menuActionID[menuActionRow] = 74;
  1191. if(i4 == 1)
  1192. menuActionID[menuActionRow] = 454;
  1193. if(i4 == 2)
  1194. menuActionID[menuActionRow] = 539;
  1195. menuActionCmd1[menuActionRow] = itemDef.id;
  1196. menuActionCmd2[menuActionRow] = k2;
  1197. menuActionCmd3[menuActionRow] = class9_1.id;
  1198. menuActionRow++;
  1199. }
  1200.  
  1201. }
  1202. if(class9_1.actions != null)
  1203. {
  1204. for(int j4 = 4; j4 >= 0; j4--)
  1205. if(class9_1.actions[j4] != null)
  1206. {
  1207. menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@" + itemDef.name;
  1208. if(j4 == 0)
  1209. menuActionID[menuActionRow] = 632;
  1210. if(j4 == 1)
  1211. menuActionID[menuActionRow] = 78;
  1212. if(j4 == 2)
  1213. menuActionID[menuActionRow] = 867;
  1214. if(j4 == 3)
  1215. menuActionID[menuActionRow] = 431;
  1216. if(j4 == 4)
  1217. menuActionID[menuActionRow] = 53;
  1218. menuActionCmd1[menuActionRow] = itemDef.id;
  1219. menuActionCmd2[menuActionRow] = k2;
  1220. menuActionCmd3[menuActionRow] = class9_1.id;
  1221. menuActionRow++;
  1222. }
  1223.  
  1224. }
  1225. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inv[k2] - 1) + "@gre@)";
  1226. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1227. menuActionID[menuActionRow] = 1125;
  1228. menuActionCmd1[menuActionRow] = itemDef.id;
  1229. menuActionCmd2[menuActionRow] = k2;
  1230. menuActionCmd3[menuActionRow] = class9_1.id;
  1231. menuActionRow++;
  1232. }
  1233. }
  1234. }
  1235. k2++;
  1236. }
  1237.  
  1238. }
  1239.  
  1240. }
  1241. }
  1242. }
  1243.  
  1244. }
  1245.  
  1246. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1247. scrollBar1.drawSprite(i1, l);
  1248. scrollBar2.drawSprite(i1, (l + j) - 16);
  1249. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1250. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1251. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1252. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1253. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1254. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1255. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1256. int k1 = ((j - 32) * j) / j1;
  1257. if(k1 < 8)
  1258. k1 = 8;
  1259. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1260. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1261. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1262. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1263. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1264. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1265. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1266. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1267. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1268. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1269. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1270. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1271. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1272. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1273. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1274. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1275. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1276. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1277. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1278. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1279. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1280. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1281. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1282. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1283. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1284. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1285. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1286. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1287. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1288. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1289. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1290. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1291. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1292. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1293. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1294. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1295. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1296. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1297. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1298. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1299. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1300. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1301. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1302. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1303. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1304. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1305. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1306. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1307. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1308. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1309. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1310. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1311. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1312. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1313. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1314. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1315. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1316. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1317. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1318. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1319. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1320. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1321. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1322. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1323. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1324. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1325. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1326. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1327. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1328. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1329. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1330. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1331. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1332. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1333. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1334. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1335. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1336. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1337. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1338. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1339. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1340. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1341. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1342. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1343. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1344. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1345. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1346. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1347. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1348. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1349. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1350. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1351. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1352. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1353. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1354. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1355. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1356. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1357. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1358. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1359. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1360. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1361. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1362. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1363. }
  1364.  
  1365. private void updateNPCs(Stream stream, int i)
  1366. {
  1367. anInt839 = 0;
  1368. anInt893 = 0;
  1369. method139(stream);
  1370. method46(i, stream);
  1371. method86(stream);
  1372. for(int k = 0; k < anInt839; k++)
  1373. {
  1374. int l = anIntArray840[k];
  1375. if(npcArray[l].anInt1537 != loopCycle)
  1376. {
  1377. npcArray[l].desc = null;
  1378. npcArray[l] = null;
  1379. }
  1380. }
  1381.  
  1382. if(stream.currentOffset != i)
  1383. {
  1384. signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1385. throw new RuntimeException("eek");
  1386. }
  1387. for(int i1 = 0; i1 < npcCount; i1++)
  1388. if(npcArray[npcIndices[i1]] == null)
  1389. {
  1390. signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1391. throw new RuntimeException("eek");
  1392. }
  1393.  
  1394. }
  1395.  
  1396. private int cButtonHPos;
  1397. private int cButtonHCPos;
  1398. private int cButtonCPos;
  1399.  
  1400. private void processChatModeClick() {
  1401. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  1402. cButtonHPos = 0;
  1403. aBoolean1233 = true;
  1404. inputTaken = true;
  1405. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  1406. cButtonHPos = 1;
  1407. aBoolean1233 = true;
  1408. inputTaken = true;
  1409. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  1410. cButtonHPos = 2;
  1411. aBoolean1233 = true;
  1412. inputTaken = true;
  1413. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  1414. cButtonHPos = 3;
  1415. aBoolean1233 = true;
  1416. inputTaken = true;
  1417. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  1418. cButtonHPos = 4;
  1419. aBoolean1233 = true;
  1420. inputTaken = true;
  1421. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  1422. cButtonHPos = 5;
  1423. aBoolean1233 = true;
  1424. inputTaken = true;
  1425. } else if(super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= 482 && super.mouseY <= 503) {
  1426. cButtonHPos = 6;
  1427. aBoolean1233 = true;
  1428. inputTaken = true;
  1429. } else {
  1430. cButtonHPos = -1;
  1431. aBoolean1233 = true;
  1432. inputTaken = true;
  1433. }
  1434. if(super.clickMode3 == 1) {
  1435. if(super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1436. cButtonCPos = 0;
  1437. chatTypeView = 0;
  1438. aBoolean1233 = true;
  1439. inputTaken = true;
  1440. } else if(super.saveClickX >= 71 && super.saveClickX <= 127 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1441. cButtonCPos = 1;
  1442. chatTypeView = 5;
  1443. aBoolean1233 = true;
  1444. inputTaken = true;
  1445. } else if(super.saveClickX >= 137 && super.saveClickX <= 193 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1446. cButtonCPos = 2;
  1447. chatTypeView = 1;
  1448. aBoolean1233 = true;
  1449. inputTaken = true;
  1450. } else if(super.saveClickX >= 203 && super.saveClickX <= 259 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1451. cButtonCPos = 3;
  1452. chatTypeView = 2;
  1453. aBoolean1233 = true;
  1454. inputTaken = true;
  1455. } else if(super.saveClickX >= 269 && super.saveClickX <= 325 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1456. cButtonCPos = 4;
  1457. chatTypeView = 11;
  1458. aBoolean1233 = true;
  1459. inputTaken = true;
  1460. } else if(super.saveClickX >= 335 && super.saveClickX <= 391 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1461. cButtonCPos = 5;
  1462. chatTypeView = 3;
  1463. aBoolean1233 = true;
  1464. inputTaken = true;
  1465. } else if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1466. if(openInterfaceID == -1) {
  1467. clearTopInterfaces();
  1468. reportAbuseInput = "";
  1469. canMute = false;
  1470. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1471. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  1472. continue;
  1473. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1474. break;
  1475. }
  1476. } else {
  1477. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1478. }
  1479. }
  1480. }
  1481. }
  1482.  
  1483. private void method33(int i)
  1484. {
  1485. int j = Varp.cache[i].anInt709;
  1486. if(j == 0)
  1487. return;
  1488. int k = variousSettings[i];
  1489. if(j == 1)
  1490. {
  1491. if(k == 1)
  1492. Texture.method372(0.90000000000000002D);
  1493. if(k == 2)
  1494. Texture.method372(0.80000000000000004D);
  1495. if(k == 3)
  1496. Texture.method372(0.69999999999999996D);
  1497. if(k == 4)
  1498. Texture.method372(0.59999999999999998D);
  1499. ItemDef.mruNodes1.unlinkAll();
  1500. welcomeScreenRaised = true;
  1501. }
  1502. if(j == 3)
  1503. {
  1504. boolean flag1 = musicEnabled;
  1505. if(k == 0)
  1506. {
  1507. adjustVolume(musicEnabled, 0);
  1508. musicEnabled = true;
  1509. }
  1510. if(k == 1)
  1511. {
  1512. adjustVolume(musicEnabled, -400);
  1513. musicEnabled = true;
  1514. }
  1515. if(k == 2)
  1516. {
  1517. adjustVolume(musicEnabled, -800);
  1518. musicEnabled = true;
  1519. }
  1520. if(k == 3)
  1521. {
  1522. adjustVolume(musicEnabled, -1200);
  1523. musicEnabled = true;
  1524. }
  1525. if(k == 4)
  1526. musicEnabled = false;
  1527. if(musicEnabled != flag1 && !lowMem)
  1528. {
  1529. if(musicEnabled)
  1530. {
  1531. nextSong = currentSong;
  1532. songChanging = true;
  1533. onDemandFetcher.method558(2, nextSong);
  1534. } else
  1535. {
  1536. stopMidi();
  1537. }
  1538. prevSong = 0;
  1539. }
  1540. }
  1541. if(j == 4)
  1542. {
  1543. if(k == 0)
  1544. {
  1545. aBoolean848 = true;
  1546. setWaveVolume(0);
  1547. }
  1548. if(k == 1)
  1549. {
  1550. aBoolean848 = true;
  1551. setWaveVolume(-400);
  1552. }
  1553. if(k == 2)
  1554. {
  1555. aBoolean848 = true;
  1556. setWaveVolume(-800);
  1557. }
  1558. if(k == 3)
  1559. {
  1560. aBoolean848 = true;
  1561. setWaveVolume(-1200);
  1562. }
  1563. if(k == 4)
  1564. aBoolean848 = false;
  1565. }
  1566. if(j == 5)
  1567. anInt1253 = k;
  1568. if(j == 6)
  1569. anInt1249 = k;
  1570. if(j == 8)
  1571. {
  1572. splitPrivateChat = k;
  1573. inputTaken = true;
  1574. }
  1575. if(j == 9)
  1576. anInt913 = k;
  1577. }
  1578.  
  1579. private void updateEntities() {
  1580. try{
  1581. int anInt974 = 0;
  1582. for(int j = -1; j < playerCount + npcCount; j++) {
  1583. Object obj;
  1584. if(j == -1)
  1585. obj = myPlayer;
  1586. else
  1587. if(j < playerCount)
  1588. obj = playerArray[playerIndices[j]];
  1589. else
  1590. obj = npcArray[npcIndices[j - playerCount]];
  1591. if(obj == null || !((Entity) (obj)).isVisible())
  1592. continue;
  1593. if(obj instanceof NPC) {
  1594. EntityDef entityDef = ((NPC)obj).desc;
  1595. if(entityDef.childrenIDs != null)
  1596. entityDef = entityDef.method161();
  1597. if(entityDef == null)
  1598. continue;
  1599. }
  1600. if(j < playerCount) {
  1601. int l = 30;
  1602. Player player = (Player)obj;
  1603. if(player.headIcon >= 0) {
  1604. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1605. if(spriteDrawX > -1) {
  1606. if (player.skullIcon < 2) {
  1607. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1608. l += 25;
  1609. }
  1610. if (player.headIcon < 7) {
  1611. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1612. l += 18;
  1613. }
  1614. }
  1615. }
  1616. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  1617. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1618. if(spriteDrawX > -1)
  1619. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1620. }
  1621. } else {
  1622. EntityDef entityDef_1 = ((NPC)obj).desc;
  1623. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  1624. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1625. if(spriteDrawX > -1)
  1626. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  1627. }
  1628. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  1629. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1630. if(spriteDrawX > -1)
  1631. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  1632. }
  1633. }
  1634. if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  1635. {
  1636. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  1637. if(spriteDrawX > -1 && anInt974 < anInt975)
  1638. {
  1639. anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
  1640. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  1641. anIntArray976[anInt974] = spriteDrawX;
  1642. anIntArray977[anInt974] = spriteDrawY;
  1643. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  1644. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  1645. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  1646. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  1647. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  1648. {
  1649. anIntArray978[anInt974] += 10;
  1650. anIntArray977[anInt974] += 5;
  1651. }
  1652. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  1653. anIntArray979[anInt974] = 60;
  1654. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  1655. anIntArray978[anInt974] += 5;
  1656. }
  1657. }
  1658. if(((Entity) (obj)).loopCycleStatus > loopCycle)
  1659. {
  1660. try{
  1661. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1662. if(spriteDrawX > -1)
  1663. {
  1664. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  1665. if(i1 > 30)
  1666. i1 = 30;
  1667. DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  1668. DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  1669. }
  1670. }catch(Exception e){ }
  1671. }
  1672. for(int j1 = 0; j1 < 4; j1++)
  1673. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  1674. {
  1675. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  1676. if(spriteDrawX > -1)
  1677. {
  1678. if(j1 == 1)
  1679. spriteDrawY -= 20;
  1680. if(j1 == 2)
  1681. {
  1682. spriteDrawX -= 15;
  1683. spriteDrawY -= 10;
  1684. }
  1685. if(j1 == 3)
  1686. {
  1687. spriteDrawX += 15;
  1688. spriteDrawY -= 10;
  1689. }
  1690. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  1691. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  1692. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  1693. }
  1694. }
  1695. }
  1696. for(int k = 0; k < anInt974; k++) {
  1697. int k1 = anIntArray976[k];
  1698. int l1 = anIntArray977[k];
  1699. int j2 = anIntArray979[k];
  1700. int k2 = anIntArray978[k];
  1701. boolean flag = true;
  1702. while(flag)
  1703. {
  1704. flag = false;
  1705. for(int l2 = 0; l2 < k; l2++)
  1706. 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)
  1707. {
  1708. l1 = anIntArray977[l2] - anIntArray978[l2];
  1709. flag = true;
  1710. }
  1711.  
  1712. }
  1713. spriteDrawX = anIntArray976[k];
  1714. spriteDrawY = anIntArray977[k] = l1;
  1715. String s = aStringArray983[k];
  1716. if(anInt1249 == 0)
  1717. {
  1718. int i3 = 0xffff00;
  1719. if(anIntArray980[k] < 6)
  1720. i3 = anIntArray965[anIntArray980[k]];
  1721. if(anIntArray980[k] == 6)
  1722. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  1723. if(anIntArray980[k] == 7)
  1724. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  1725. if(anIntArray980[k] == 8)
  1726. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  1727. if(anIntArray980[k] == 9) {
  1728. int j3 = 150 - anIntArray982[k];
  1729. if(j3 < 50)
  1730. i3 = 0xff0000 + 1280 * j3;
  1731. else
  1732. if(j3 < 100)
  1733. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  1734. else
  1735. if(j3 < 150)
  1736. i3 = 65280 + 5 * (j3 - 100);
  1737. }
  1738. if(anIntArray980[k] == 10) {
  1739. int k3 = 150 - anIntArray982[k];
  1740. if(k3 < 50)
  1741. i3 = 0xff0000 + 5 * k3;
  1742. else
  1743. if(k3 < 100)
  1744. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  1745. else
  1746. if(k3 < 150)
  1747. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  1748. }
  1749. if(anIntArray980[k] == 11) {
  1750. int l3 = 150 - anIntArray982[k];
  1751. if(l3 < 50)
  1752. i3 = 0xffffff - 0x50005 * l3;
  1753. else
  1754. if(l3 < 100)
  1755. i3 = 65280 + 0x50005 * (l3 - 50);
  1756. else
  1757. if(l3 < 150)
  1758. i3 = 0xffffff - 0x50000 * (l3 - 100);
  1759. }
  1760. if(anIntArray981[k] == 0) {
  1761. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1762. chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  1763. }
  1764. if(anIntArray981[k] == 1) {
  1765. chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  1766. chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  1767. }
  1768. if(anIntArray981[k] == 2) {
  1769. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  1770. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  1771. }
  1772. if(anIntArray981[k] == 3) {
  1773. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  1774. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  1775. }
  1776. if(anIntArray981[k] == 4) {
  1777. int i4 = chatTextDrawingArea.method384(s);
  1778. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  1779. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  1780. chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  1781. chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  1782. DrawingArea.defaultDrawingAreaSize();
  1783. }
  1784. if(anIntArray981[k] == 5) {
  1785. int j4 = 150 - anIntArray982[k];
  1786. int l4 = 0;
  1787. if(j4 < 25)
  1788. l4 = j4 - 25;
  1789. else
  1790. if(j4 > 125)
  1791. l4 = j4 - 125;
  1792. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  1793. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  1794. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  1795. DrawingArea.defaultDrawingAreaSize();
  1796. }
  1797. } else {
  1798. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1799. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  1800. }
  1801. }
  1802. } catch(Exception e){ }
  1803. }
  1804.  
  1805. private void delFriend(long l)
  1806. {
  1807. try
  1808. {
  1809. if(l == 0L)
  1810. return;
  1811. for(int i = 0; i < friendsCount; i++)
  1812. {
  1813. if(friendsListAsLongs[i] != l)
  1814. continue;
  1815. friendsCount--;
  1816. needDrawTabArea = true;
  1817. for(int j = i; j < friendsCount; j++)
  1818. {
  1819. friendsList[j] = friendsList[j + 1];
  1820. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  1821. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  1822. }
  1823.  
  1824. stream.createFrame(215);
  1825. stream.writeQWord(l);
  1826. break;
  1827. }
  1828. }
  1829. catch(RuntimeException runtimeexception)
  1830. {
  1831. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  1832. throw new RuntimeException();
  1833. }
  1834. }
  1835.  
  1836. public void drawSideIcons(){
  1837. /* Top sideIcons */
  1838. if(tabInterfaceIDs[0] != -1)//attack
  1839. sideIcons[0].drawSprite(10, 4);
  1840. if(tabInterfaceIDs[1] != -1)//stat
  1841. sideIcons[1].drawSprite(43, 4);
  1842. if(tabInterfaceIDs[2] != -1)//quest
  1843. sideIcons[2].drawSprite(76, 3);
  1844. if(tabInterfaceIDs[3] != -1)//inventory
  1845. sideIcons[3].drawSprite(111, 5);
  1846. if(tabInterfaceIDs[4] != -1)//equipment
  1847. sideIcons[4].drawSprite(140, 1);
  1848. if(tabInterfaceIDs[5] != -1)//prayer
  1849. sideIcons[5].drawSprite(174, 1);
  1850. if(tabInterfaceIDs[6] != -1)//magic
  1851. sideIcons[6].drawSprite(208, 4);
  1852. /* Bottom sideIcons */
  1853. if(tabInterfaceIDs[7] != -1)//clan
  1854. sideIcons[7].drawSprite(11, 303);
  1855. if(tabInterfaceIDs[8] != -1)//friends
  1856. sideIcons[8].drawSprite(46, 306);
  1857. if(tabInterfaceIDs[9] != -1)//ignore
  1858. sideIcons[9].drawSprite(79, 306);
  1859. if(tabInterfaceIDs[10] != -1)//options
  1860. sideIcons[10].drawSprite(113, 302);
  1861. if(tabInterfaceIDs[11] != -1)//options
  1862. sideIcons[11].drawSprite(145, 304);
  1863. if(tabInterfaceIDs[12] != -1)//emotes
  1864. sideIcons[12].drawSprite(181, 302);
  1865. if(tabInterfaceIDs[13] != -1)//music
  1866. sideIcons[13].drawSprite(213, 303);
  1867. }
  1868.  
  1869. public void drawRedStones() {
  1870. if(tabInterfaceIDs[tabID] != -1) {
  1871. switch(tabID) {
  1872. case 0:
  1873. redStones[0].drawSprite(3, 0);
  1874. break;
  1875. case 1:
  1876. redStones[4].drawSprite(41, 0);
  1877. break;
  1878. case 2:
  1879. redStones[4].drawSprite(74, 0);
  1880. break;
  1881. case 3:
  1882. redStones[4].drawSprite(107, 0);
  1883. break;
  1884. case 4:
  1885. redStones[4].drawSprite(140, 0);
  1886. break;
  1887. case 5:
  1888. redStones[4].drawSprite(173, 0);
  1889. break;
  1890. case 6:
  1891. redStones[1].drawSprite(206, 0);
  1892. break;
  1893. case 7:
  1894. redStones[2].drawSprite(3, 298);
  1895. break;
  1896. case 8:
  1897. redStones[4].drawSprite(41, 298);
  1898. break;
  1899. case 9:
  1900. redStones[4].drawSprite(74, 298);
  1901. break;
  1902. case 10:
  1903. redStones[4].drawSprite(107, 298);
  1904. break;
  1905. case 11:
  1906. redStones[4].drawSprite(140, 298);
  1907. break;
  1908. case 12:
  1909. redStones[4].drawSprite(173, 298);
  1910. break;
  1911. case 13:
  1912. redStones[3].drawSprite(206, 298);
  1913. break;
  1914. }
  1915. }
  1916. }
  1917.  
  1918. private void drawTabArea() {
  1919. aRSImageProducer_1163.initDrawingArea();
  1920. Texture.anIntArray1472 = anIntArray1181;
  1921. tabArea.drawSprite(0, 0);
  1922. if(invOverlayInterfaceID == -1) {
  1923. drawRedStones();
  1924. drawSideIcons();
  1925. }
  1926. if(invOverlayInterfaceID != -1)
  1927. drawInterface(0, 28, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  1928. else if(tabInterfaceIDs[tabID] != -1)
  1929. drawInterface(0, 28, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  1930. if(menuOpen && menuScreenArea == 1)
  1931. drawMenu();
  1932. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  1933. aRSImageProducer_1165.initDrawingArea();
  1934. Texture.anIntArray1472 = anIntArray1182;
  1935. }
  1936.  
  1937. private void method37(int j) {
  1938. if(!lowMem) {
  1939. if(Texture.anIntArray1480[17] >= j) {
  1940. Background background = Texture.aBackgroundArray1474s[17];
  1941. int k = background.anInt1452 * background.anInt1453 - 1;
  1942. //fire cape apparently?
  1943. int j1 = background.anInt1452 * anInt945 * 2;
  1944. byte abyte0[] = background.aByteArray1450;
  1945. byte abyte3[] = aByteArray912;
  1946. for(int i2 = 0; i2 <= k; i2++)
  1947. abyte3[i2] = abyte0[i2 - j1 & k];
  1948.  
  1949. background.aByteArray1450 = abyte3;
  1950. aByteArray912 = abyte0;
  1951. Texture.method370(17);
  1952. anInt854++;
  1953. if(anInt854 > 1235) {
  1954. anInt854 = 0;
  1955. stream.createFrame(226);
  1956. stream.writeWordBigEndian(0);
  1957. int l2 = stream.currentOffset;
  1958. stream.writeWord(58722);
  1959. stream.writeWordBigEndian(240);
  1960. stream.writeWord((int)(Math.random() * 65536D));
  1961. stream.writeWordBigEndian((int)(Math.random() * 256D));
  1962. if((int)(Math.random() * 2D) == 0)
  1963. stream.writeWord(51825);
  1964. stream.writeWordBigEndian((int)(Math.random() * 256D));
  1965. stream.writeWord((int)(Math.random() * 65536D));
  1966. stream.writeWord(7130);
  1967. stream.writeWord((int)(Math.random() * 65536D));
  1968. stream.writeWord(61657);
  1969. stream.writeBytes(stream.currentOffset - l2);
  1970. }
  1971. }
  1972. if(Texture.anIntArray1480[24] >= j) {
  1973. Background background_1 = Texture.aBackgroundArray1474s[24];
  1974. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  1975. int k1 = background_1.anInt1452 * anInt945 * 2;
  1976. byte abyte1[] = background_1.aByteArray1450;
  1977. byte abyte4[] = aByteArray912;
  1978. for(int j2 = 0; j2 <= l; j2++)
  1979. abyte4[j2] = abyte1[j2 - k1 & l];
  1980.  
  1981. background_1.aByteArray1450 = abyte4;
  1982. aByteArray912 = abyte1;
  1983. Texture.method370(24);
  1984. }
  1985. if(Texture.anIntArray1480[34] >= j) {
  1986. Background background_2 = Texture.aBackgroundArray1474s[34];
  1987. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  1988. int l1 = background_2.anInt1452 * anInt945 * 2;
  1989. byte abyte2[] = background_2.aByteArray1450;
  1990. byte abyte5[] = aByteArray912;
  1991. for(int k2 = 0; k2 <= i1; k2++)
  1992. abyte5[k2] = abyte2[k2 - l1 & i1];
  1993.  
  1994. background_2.aByteArray1450 = abyte5;
  1995. aByteArray912 = abyte2;
  1996. Texture.method370(34);
  1997. }
  1998. if(Texture.anIntArray1480[40] >= j)
  1999. {
  2000. Background background_2 = Texture.aBackgroundArray1474s[40];
  2001. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2002. int l1 = background_2.anInt1452 * anInt945 * 2;
  2003. byte abyte2[] = background_2.aByteArray1450;
  2004. byte abyte5[] = aByteArray912;
  2005. for(int k2 = 0; k2 <= i1; k2++)
  2006. abyte5[k2] = abyte2[k2 - l1 & i1];
  2007.  
  2008. background_2.aByteArray1450 = abyte5;
  2009. aByteArray912 = abyte2;
  2010. Texture.method370(40);
  2011. }
  2012. }
  2013. }
  2014.  
  2015. private void method38() {
  2016. for(int i = -1; i < playerCount; i++) {
  2017. int j;
  2018. if(i == -1)
  2019. j = myPlayerIndex;
  2020. else
  2021. j = playerIndices[i];
  2022. Player player = playerArray[j];
  2023. if(player != null && player.textCycle > 0) {
  2024. player.textCycle--;
  2025. if(player.textCycle == 0)
  2026. player.textSpoken = null;
  2027. }
  2028. }
  2029. for(int k = 0; k < npcCount; k++) {
  2030. int l = npcIndices[k];
  2031. NPC npc = npcArray[l];
  2032. if(npc != null && npc.textCycle > 0) {
  2033. npc.textCycle--;
  2034. if(npc.textCycle == 0)
  2035. npc.textSpoken = null;
  2036. }
  2037. }
  2038. }
  2039.  
  2040. private void calcCameraPos() {
  2041. int i = anInt1098 * 128 + 64;
  2042. int j = anInt1099 * 128 + 64;
  2043. int k = method42(plane, j, i) - anInt1100;
  2044. if(xCameraPos < i) {
  2045. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2046. if(xCameraPos > i)
  2047. xCameraPos = i;
  2048. }
  2049. if(xCameraPos > i) {
  2050. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2051. if(xCameraPos < i)
  2052. xCameraPos = i;
  2053. }
  2054. if(zCameraPos < k) {
  2055. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2056. if(zCameraPos > k)
  2057. zCameraPos = k;
  2058. }
  2059. if(zCameraPos > k) {
  2060. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2061. if(zCameraPos < k)
  2062. zCameraPos = k;
  2063. }
  2064. if(yCameraPos < j) {
  2065. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2066. if(yCameraPos > j)
  2067. yCameraPos = j;
  2068. }
  2069. if(yCameraPos > j) {
  2070. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2071. if(yCameraPos < j)
  2072. yCameraPos = j;
  2073. }
  2074. i = anInt995 * 128 + 64;
  2075. j = anInt996 * 128 + 64;
  2076. k = method42(plane, j, i) - anInt997;
  2077. int l = i - xCameraPos;
  2078. int i1 = k - zCameraPos;
  2079. int j1 = j - yCameraPos;
  2080. int k1 = (int)Math.sqrt(l * l + j1 * j1);
  2081. int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2082. int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2083. if(l1 < 128)
  2084. l1 = 128;
  2085. if(l1 > 383)
  2086. l1 = 383;
  2087. if(yCameraCurve < l1) {
  2088. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2089. if(yCameraCurve > l1)
  2090. yCameraCurve = l1;
  2091. }
  2092. if(yCameraCurve > l1) {
  2093. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2094. if(yCameraCurve < l1)
  2095. yCameraCurve = l1;
  2096. }
  2097. int j2 = i2 - xCameraCurve;
  2098. if(j2 > 1024)
  2099. j2 -= 2048;
  2100. if(j2 < -1024)
  2101. j2 += 2048;
  2102. if(j2 > 0) {
  2103. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2104. xCameraCurve &= 0x7ff;
  2105. }
  2106. if(j2 < 0) {
  2107. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2108. xCameraCurve &= 0x7ff;
  2109. }
  2110. int k2 = i2 - xCameraCurve;
  2111. if(k2 > 1024)
  2112. k2 -= 2048;
  2113. if(k2 < -1024)
  2114. k2 += 2048;
  2115. if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2116. xCameraCurve = i2;
  2117. }
  2118.  
  2119. private void drawMenu() {
  2120. int i = menuOffsetX;
  2121. int j = menuOffsetY;
  2122. int k = menuWidth;
  2123. int l = menuHeight + 1;
  2124. int i1 = 0x5d5447;
  2125. //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  2126. //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  2127. DrawingArea.drawPixels(l, j, i, i1, k);
  2128. DrawingArea.drawPixels(16, j + 1, i + 1, 0, k - 2);
  2129. DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
  2130. chatTextDrawingArea.method385(i1, "Choose Option", j + 14, i + 3);
  2131. int j1 = super.mouseX;
  2132. int k1 = super.mouseY;
  2133. if(menuScreenArea == 0) {
  2134. j1 -= 4;
  2135. k1 -= 4;
  2136. }
  2137. if(menuScreenArea == 1) {
  2138. j1 -= 519;
  2139. k1 -= 168;
  2140. }
  2141. if(menuScreenArea == 2) {
  2142. j1 -= 17;
  2143. k1 -= 338;
  2144. }
  2145. if(menuScreenArea == 3) {
  2146. j1 -= 519;
  2147. k1 -= 0;
  2148. }
  2149. for(int l1 = 0; l1 < menuActionRow; l1++) {
  2150. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2151. int j2 = 0xffffff;
  2152. if(j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  2153. j2 = 0xffff00;
  2154. chatTextDrawingArea.method389(true, i + 3, j2, menuActionName[l1], i2);
  2155. }
  2156. }
  2157.  
  2158. private void addFriend(long l) {
  2159. try {
  2160. if(l == 0L)
  2161. return;
  2162. if(friendsCount >= 100 && anInt1046 != 1) {
  2163. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2164. return;
  2165. }
  2166. if(friendsCount >= 200) {
  2167. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2168. return;
  2169. }
  2170. String s = TextClass.fixName(TextClass.nameForLong(l));
  2171. for(int i = 0; i < friendsCount; i++)
  2172. if(friendsListAsLongs[i] == l) {
  2173. pushMessage(s + " is already on your friend list", 0, "");
  2174. return;
  2175. }
  2176. for(int j = 0; j < ignoreCount; j++)
  2177. if(ignoreListAsLongs[j] == l) {
  2178. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  2179. return;
  2180. }
  2181.  
  2182. if(s.equals(myPlayer.name)) {
  2183. return;
  2184. } else {
  2185. friendsList[friendsCount] = s;
  2186. friendsListAsLongs[friendsCount] = l;
  2187. friendsNodeIDs[friendsCount] = 0;
  2188. friendsCount++;
  2189. needDrawTabArea = true;
  2190. stream.createFrame(188);
  2191. stream.writeQWord(l);
  2192. return;
  2193. }
  2194. } catch(RuntimeException runtimeexception) {
  2195. signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
  2196. }
  2197. throw new RuntimeException();
  2198. }
  2199.  
  2200. private int method42(int i, int j, int k) {
  2201. int l = k >> 7;
  2202. int i1 = j >> 7;
  2203. if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2204. return 0;
  2205. int j1 = i;
  2206. if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2207. j1++;
  2208. int k1 = k & 0x7f;
  2209. int l1 = j & 0x7f;
  2210. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2211. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2212. return i2 * (128 - l1) + j2 * l1 >> 7;
  2213. }
  2214.  
  2215. private static String intToKOrMil(int j) {
  2216. if(j < 0x186a0)
  2217. return String.valueOf(j);
  2218. if(j < 0x989680)
  2219. return j / 1000 + "K";
  2220. else
  2221. return j / 0xf4240 + "M";
  2222. }
  2223.  
  2224. private void resetLogout() {
  2225. try {
  2226. if(socketStream != null)
  2227. socketStream.close();
  2228. }
  2229. catch(Exception _ex) { }
  2230. socketStream = null;
  2231. loggedIn = false;
  2232. loginScreenState = 0;
  2233. // myUsername = "";
  2234. // myPassword = "";
  2235. unlinkMRUNodes();
  2236. worldController.initToNull();
  2237. for(int i = 0; i < 4; i++)
  2238. aClass11Array1230[i].method210();
  2239. System.gc();
  2240. stopMidi();
  2241. currentSong = -1;
  2242. nextSong = -1;
  2243. prevSong = 0;
  2244. }
  2245.  
  2246. private void method45() {
  2247. aBoolean1031 = true;
  2248. for(int j = 0; j < 7; j++) {
  2249. anIntArray1065[j] = -1;
  2250. for(int k = 0; k < IDK.length; k++) {
  2251. if(IDK.cache[k].aBoolean662 || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2252. continue;
  2253. anIntArray1065[j] = k;
  2254. break;
  2255. }
  2256. }
  2257. }
  2258.  
  2259. private void method46(int i, Stream stream) {
  2260. while(stream.bitPosition + 21 < i * 8) {
  2261. int k = stream.readBits(14);
  2262. if(k == 16383)
  2263. break;
  2264. if(npcArray[k] == null)
  2265. npcArray[k] = new NPC();
  2266. NPC npc = npcArray[k];
  2267. npcIndices[npcCount++] = k;
  2268. npc.anInt1537 = loopCycle;
  2269. int l = stream.readBits(5);
  2270. if(l > 15)
  2271. l -= 32;
  2272. int i1 = stream.readBits(5);
  2273. if(i1 > 15)
  2274. i1 -= 32;
  2275. int j1 = stream.readBits(1);
  2276. npc.desc = EntityDef.forID(stream.readBits(12));
  2277. int k1 = stream.readBits(1);
  2278. if(k1 == 1)
  2279. anIntArray894[anInt893++] = k;
  2280. npc.anInt1540 = npc.desc.aByte68;
  2281. npc.anInt1504 = npc.desc.anInt79;
  2282. npc.anInt1554 = npc.desc.walkAnim;
  2283. npc.anInt1555 = npc.desc.anInt58;
  2284. npc.anInt1556 = npc.desc.anInt83;
  2285. npc.anInt1557 = npc.desc.anInt55;
  2286. npc.anInt1511 = npc.desc.standAnim;
  2287. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2288. }
  2289. stream.finishBitAccess();
  2290. }
  2291.  
  2292. public void processGameLoop() {
  2293. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  2294. return;
  2295. loopCycle++;
  2296. if(!loggedIn)
  2297. processLoginScreenInput();
  2298. else
  2299. mainGameProcessor();
  2300. processOnDemandQueue();
  2301. }
  2302.  
  2303. private void method47(boolean flag) {
  2304. if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2305. destX = 0;
  2306. int j = playerCount;
  2307. if(flag)
  2308. j = 1;
  2309. for(int l = 0; l < j; l++) {
  2310. Player player;
  2311. int i1;
  2312. if(flag) {
  2313. player = myPlayer;
  2314. i1 = myPlayerIndex << 14;
  2315. } else {
  2316. player = playerArray[playerIndices[l]];
  2317. i1 = playerIndices[l] << 14;
  2318. }
  2319. if(player == null || !player.isVisible())
  2320. continue;
  2321. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  2322. int j1 = player.x >> 7;
  2323. int k1 = player.y >> 7;
  2324. if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2325. continue;
  2326. if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  2327. player.aBoolean1699 = false;
  2328. player.anInt1709 = method42(plane, player.y, player.x);
  2329. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  2330. continue;
  2331. }
  2332. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2333. if(anIntArrayArray929[j1][k1] == anInt1265)
  2334. continue;
  2335. anIntArrayArray929[j1][k1] = anInt1265;
  2336. }
  2337. player.anInt1709 = method42(plane, player.y, player.x);
  2338. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  2339. }
  2340. }
  2341.  
  2342. private boolean promptUserForInput(RSInterface class9) {
  2343. int j = class9.contentType;
  2344. if(anInt900 == 2) {
  2345. if(j == 201) {
  2346. inputTaken = true;
  2347. inputDialogState = 0;
  2348. messagePromptRaised = true;
  2349. promptInput = "";
  2350. friendsListAction = 1;
  2351. aString1121 = "Enter name of friend to add to list";
  2352. }
  2353. if(j == 202) {
  2354. inputTaken = true;
  2355. inputDialogState = 0;
  2356. messagePromptRaised = true;
  2357. promptInput = "";
  2358. friendsListAction = 2;
  2359. aString1121 = "Enter name of friend to delete from list";
  2360. }
  2361. }
  2362. if(j == 205) {
  2363. anInt1011 = 250;
  2364. return true;
  2365. }
  2366. if(j == 501) {
  2367. inputTaken = true;
  2368. inputDialogState = 0;
  2369. messagePromptRaised = true;
  2370. promptInput = "";
  2371. friendsListAction = 4;
  2372. aString1121 = "Enter name of player to add to list";
  2373. }
  2374. if(j == 502) {
  2375. inputTaken = true;
  2376. inputDialogState = 0;
  2377. messagePromptRaised = true;
  2378. promptInput = "";
  2379. friendsListAction = 5;
  2380. aString1121 = "Enter name of player to delete from list";
  2381. }
  2382. if(j == 550) {
  2383. inputTaken = true;
  2384. inputDialogState = 0;
  2385. messagePromptRaised = true;
  2386. promptInput = "";
  2387. friendsListAction = 6;
  2388. aString1121 = "Enter the name of the chat you wish to join";
  2389. }
  2390. if(j >= 300 && j <= 313) {
  2391. int k = (j - 300) / 2;
  2392. int j1 = j & 1;
  2393. int i2 = anIntArray1065[k];
  2394. if(i2 != -1) {
  2395. do {
  2396. if(j1 == 0 && --i2 < 0)
  2397. i2 = IDK.length - 1;
  2398. if(j1 == 1 && ++i2 >= IDK.length)
  2399. i2 = 0;
  2400. } while(IDK.cache[i2].aBoolean662 || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2401. anIntArray1065[k] = i2;
  2402. aBoolean1031 = true;
  2403. }
  2404. }
  2405. if(j >= 314 && j <= 323) {
  2406. int l = (j - 314) / 2;
  2407. int k1 = j & 1;
  2408. int j2 = anIntArray990[l];
  2409. if(k1 == 0 && --j2 < 0)
  2410. j2 = anIntArrayArray1003[l].length - 1;
  2411. if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2412. j2 = 0;
  2413. anIntArray990[l] = j2;
  2414. aBoolean1031 = true;
  2415. }
  2416. if(j == 324 && !aBoolean1047) {
  2417. aBoolean1047 = true;
  2418. method45();
  2419. }
  2420. if(j == 325 && aBoolean1047) {
  2421. aBoolean1047 = false;
  2422. method45();
  2423. }
  2424. if(j == 326) {
  2425. stream.createFrame(101);
  2426. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2427. for(int i1 = 0; i1 < 7; i1++)
  2428. stream.writeWordBigEndian(anIntArray1065[i1]);
  2429.  
  2430. for(int l1 = 0; l1 < 5; l1++)
  2431. stream.writeWordBigEndian(anIntArray990[l1]);
  2432.  
  2433. return true;
  2434. }
  2435. if(j == 613)
  2436. canMute = !canMute;
  2437. if(j >= 601 && j <= 612) {
  2438. clearTopInterfaces();
  2439. if(reportAbuseInput.length() > 0) {
  2440. stream.createFrame(218);
  2441. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2442. stream.writeWordBigEndian(j - 601);
  2443. stream.writeWordBigEndian(canMute ? 1 : 0);
  2444. }
  2445. }
  2446. return false;
  2447. }
  2448.  
  2449. private void method49(Stream stream) {
  2450. for(int j = 0; j < anInt893; j++) {
  2451. int k = anIntArray894[j];
  2452. Player player = playerArray[k];
  2453. int l = stream.readUnsignedByte();
  2454. if((l & 0x40) != 0)
  2455. l += stream.readUnsignedByte() << 8;
  2456. method107(l, k, stream, player);
  2457. }
  2458. }
  2459.  
  2460. private void method50(int i, int k, int l, int i1, int j1) {
  2461. int k1 = worldController.method300(j1, l, i);
  2462. if(k1 != 0) {
  2463. int l1 = worldController.method304(j1, l, i, k1);
  2464. int k2 = l1 >> 6 & 3;
  2465. int i3 = l1 & 0x1f;
  2466. int k3 = k;
  2467. if(k1 > 0)
  2468. k3 = i1;
  2469. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2470. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2471. int i5 = k1 >> 14 & 0x7fff;
  2472. ObjectDef class46_2 = ObjectDef.forID(i5);
  2473. if(class46_2.anInt758 != -1) {
  2474. Background background_2 = mapScenes[class46_2.anInt758];
  2475. if(background_2 != null) {
  2476. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  2477. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  2478. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  2479. }
  2480. } else {
  2481. if(i3 == 0 || i3 == 2)
  2482. if(k2 == 0) {
  2483. ai[k4] = k3;
  2484. ai[k4 + 512] = k3;
  2485. ai[k4 + 1024] = k3;
  2486. ai[k4 + 1536] = k3;
  2487. } else if(k2 == 1) {
  2488. ai[k4] = k3;
  2489. ai[k4 + 1] = k3;
  2490. ai[k4 + 2] = k3;
  2491. ai[k4 + 3] = k3;
  2492. } else if(k2 == 2) {
  2493. ai[k4 + 3] = k3;
  2494. ai[k4 + 3 + 512] = k3;
  2495. ai[k4 + 3 + 1024] = k3;
  2496. ai[k4 + 3 + 1536] = k3;
  2497. } else if(k2 == 3) {
  2498. ai[k4 + 1536] = k3;
  2499. ai[k4 + 1536 + 1] = k3;
  2500. ai[k4 + 1536 + 2] = k3;
  2501. ai[k4 + 1536 + 3] = k3;
  2502. }
  2503. if(i3 == 3)
  2504. if(k2 == 0)
  2505. ai[k4] = k3;
  2506. else if(k2 == 1)
  2507. ai[k4 + 3] = k3;
  2508. else if(k2 == 2)
  2509. ai[k4 + 3 + 1536] = k3;
  2510. else if(k2 == 3)
  2511. ai[k4 + 1536] = k3;
  2512. if(i3 == 2)
  2513. if(k2 == 3) {
  2514. ai[k4] = k3;
  2515. ai[k4 + 512] = k3;
  2516. ai[k4 + 1024] = k3;
  2517. ai[k4 + 1536] = k3;
  2518. } else if(k2 == 0) {
  2519. ai[k4] = k3;
  2520. ai[k4 + 1] = k3;
  2521. ai[k4 + 2] = k3;
  2522. ai[k4 + 3] = k3;
  2523. } else if(k2 == 1) {
  2524. ai[k4 + 3] = k3;
  2525. ai[k4 + 3 + 512] = k3;
  2526. ai[k4 + 3 + 1024] = k3;
  2527. ai[k4 + 3 + 1536] = k3;
  2528. } else if(k2 == 2) {
  2529. ai[k4 + 1536] = k3;
  2530. ai[k4 + 1536 + 1] = k3;
  2531. ai[k4 + 1536 + 2] = k3;
  2532. ai[k4 + 1536 + 3] = k3;
  2533. }
  2534. }
  2535. }
  2536. k1 = worldController.method302(j1, l, i);
  2537. if(k1 != 0) {
  2538. int i2 = worldController.method304(j1, l, i, k1);
  2539. int l2 = i2 >> 6 & 3;
  2540. int j3 = i2 & 0x1f;
  2541. int l3 = k1 >> 14 & 0x7fff;
  2542. ObjectDef class46_1 = ObjectDef.forID(l3);
  2543. if(class46_1.anInt758 != -1) {
  2544. Background background_1 = mapScenes[class46_1.anInt758];
  2545. if(background_1 != null) {
  2546. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  2547. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  2548. background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  2549. }
  2550. } else if(j3 == 9) {
  2551. int l4 = 0xeeeeee;
  2552. if(k1 > 0)
  2553. l4 = 0xee0000;
  2554. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2555. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2556. if(l2 == 0 || l2 == 2) {
  2557. ai1[l5 + 1536] = l4;
  2558. ai1[l5 + 1024 + 1] = l4;
  2559. ai1[l5 + 512 + 2] = l4;
  2560. ai1[l5 + 3] = l4;
  2561. } else {
  2562. ai1[l5] = l4;
  2563. ai1[l5 + 512 + 1] = l4;
  2564. ai1[l5 + 1024 + 2] = l4;
  2565. ai1[l5 + 1536 + 3] = l4;
  2566. }
  2567. }
  2568. }
  2569. k1 = worldController.method303(j1, l, i);
  2570. if(k1 != 0) {
  2571. int j2 = k1 >> 14 & 0x7fff;
  2572. ObjectDef class46 = ObjectDef.forID(j2);
  2573. if(class46.anInt758 != -1) {
  2574. Background background = mapScenes[class46.anInt758];
  2575. if(background != null) {
  2576. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  2577. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  2578. background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  2579. }
  2580. }
  2581. }
  2582. }
  2583.  
  2584. private void loadTitleScreen() {
  2585. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  2586. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  2587. aBackgroundArray1152s = new Background[12];
  2588. int j = 0;
  2589. try {
  2590. j = Integer.parseInt(getParameter("fl_icon"));
  2591. } catch(Exception _ex) {
  2592. }
  2593. if(j == 0) {
  2594. for(int k = 0; k < 12; k++)
  2595. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  2596.  
  2597. } else {
  2598. for(int l = 0; l < 12; l++)
  2599. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  2600.  
  2601. }
  2602. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  2603. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  2604. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  2605.  
  2606. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  2607.  
  2608. anIntArray851 = new int[256];
  2609. for(int k1 = 0; k1 < 64; k1++)
  2610. anIntArray851[k1] = k1 * 0x40000;
  2611.  
  2612. for(int l1 = 0; l1 < 64; l1++)
  2613. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  2614.  
  2615. for(int i2 = 0; i2 < 64; i2++)
  2616. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  2617.  
  2618. for(int j2 = 0; j2 < 64; j2++)
  2619. anIntArray851[j2 + 192] = 0xffffff;
  2620.  
  2621. anIntArray852 = new int[256];
  2622. for(int k2 = 0; k2 < 64; k2++)
  2623. anIntArray852[k2] = k2 * 1024;
  2624.  
  2625. for(int l2 = 0; l2 < 64; l2++)
  2626. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  2627.  
  2628. for(int i3 = 0; i3 < 64; i3++)
  2629. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  2630.  
  2631. for(int j3 = 0; j3 < 64; j3++)
  2632. anIntArray852[j3 + 192] = 0xffffff;
  2633.  
  2634. anIntArray853 = new int[256];
  2635. for(int k3 = 0; k3 < 64; k3++)
  2636. anIntArray853[k3] = k3 * 4;
  2637.  
  2638. for(int l3 = 0; l3 < 64; l3++)
  2639. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  2640.  
  2641. for(int i4 = 0; i4 < 64; i4++)
  2642. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  2643.  
  2644. for(int j4 = 0; j4 < 64; j4++)
  2645. anIntArray853[j4 + 192] = 0xffffff;
  2646.  
  2647. anIntArray850 = new int[256];
  2648. anIntArray1190 = new int[32768];
  2649. anIntArray1191 = new int[32768];
  2650. randomizeBackground(null);
  2651. anIntArray828 = new int[32768];
  2652. anIntArray829 = new int[32768];
  2653. drawLoadingText(10, "Connecting to fileserver");
  2654. if(!aBoolean831) {
  2655. drawFlames = true;
  2656. aBoolean831 = true;
  2657. startRunnable(this, 2);
  2658. }
  2659. }
  2660.  
  2661. private static void setHighMem() {
  2662. WorldController.lowMem = false;
  2663. Texture.lowMem = false;
  2664. lowMem = false;
  2665. ObjectManager.lowMem = false;
  2666. ObjectDef.lowMem = false;
  2667. }
  2668.  
  2669. public static void main(String args[]) {
  2670. try {
  2671. nodeID = 10;
  2672. portOff = 0;
  2673. setLowMem();
  2674. isMembers = true;
  2675. signlink.storeid = 32;
  2676. signlink.startpriv(InetAddress.getLocalHost());
  2677. client client1 = new client();
  2678. client1.createClientFrame(505, 767);
  2679. }
  2680. catch(Exception exception)
  2681. {
  2682. }
  2683. }
  2684.  
  2685. private void loadingStages() {
  2686. if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  2687. aRSImageProducer_1165.initDrawingArea();
  2688. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  2689. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  2690. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  2691. loadingStage = 1;
  2692. aLong824 = System.currentTimeMillis();
  2693. }
  2694. if(loadingStage == 1) {
  2695. int j = method54();
  2696. if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  2697. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  2698. aLong824 = System.currentTimeMillis();
  2699. }
  2700. }
  2701. if(loadingStage == 2 && plane != anInt985) {
  2702. anInt985 = plane;
  2703. method24(plane);
  2704. }
  2705. }
  2706.  
  2707. private int method54() {
  2708. for(int i = 0; i < aByteArrayArray1183.length; i++) {
  2709. if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  2710. return -1;
  2711. if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  2712. return -2;
  2713. }
  2714. boolean flag = true;
  2715. for(int j = 0; j < aByteArrayArray1183.length; j++) {
  2716. byte abyte0[] = aByteArrayArray1247[j];
  2717. if(abyte0 != null) {
  2718. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  2719. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  2720. if(aBoolean1159) {
  2721. k = 10;
  2722. l = 10;
  2723. }
  2724. flag &= ObjectManager.method189(k, abyte0, l);
  2725. }
  2726. }
  2727. if(!flag)
  2728. return -3;
  2729. if(aBoolean1080) {
  2730. return -4;
  2731. } else {
  2732. loadingStage = 2;
  2733. ObjectManager.anInt131 = plane;
  2734. method22();
  2735. stream.createFrame(121);
  2736. return 0;
  2737. }
  2738. }
  2739.  
  2740. private void method55()
  2741. {
  2742. 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())
  2743. if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  2744. class30_sub2_sub4_sub4.unlink();
  2745. else
  2746. if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  2747. {
  2748. if(class30_sub2_sub4_sub4.anInt1590 > 0)
  2749. {
  2750. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  2751. if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  2752. 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);
  2753. }
  2754. if(class30_sub2_sub4_sub4.anInt1590 < 0)
  2755. {
  2756. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  2757. Player player;
  2758. if(j == unknownInt10)
  2759. player = myPlayer;
  2760. else
  2761. player = playerArray[j];
  2762. if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  2763. 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);
  2764. }
  2765. class30_sub2_sub4_sub4.method456(anInt945);
  2766. 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);
  2767. }
  2768.  
  2769. }
  2770.  
  2771. public AppletContext getAppletContext()
  2772. {
  2773. if(signlink.mainapp != null)
  2774. return signlink.mainapp.getAppletContext();
  2775. else
  2776. return super.getAppletContext();
  2777. }
  2778.  
  2779. private void drawLogo() {
  2780. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  2781. Sprite sprite = new Sprite(abyte0, this);
  2782. aRSImageProducer_1110.initDrawingArea();
  2783. sprite.method346(0, 0);
  2784. aRSImageProducer_1111.initDrawingArea();
  2785. sprite.method346(-637, 0);
  2786. aRSImageProducer_1107.initDrawingArea();
  2787. sprite.method346(-128, 0);
  2788. aRSImageProducer_1108.initDrawingArea();
  2789. sprite.method346(-202, -371);
  2790. aRSImageProducer_1109.initDrawingArea();
  2791. sprite.method346(-202, -171);
  2792. aRSImageProducer_1112.initDrawingArea();
  2793. sprite.method346(0, -265);
  2794. aRSImageProducer_1113.initDrawingArea();
  2795. sprite.method346(-562, -265);
  2796. aRSImageProducer_1114.initDrawingArea();
  2797. sprite.method346(-128, -171);
  2798. aRSImageProducer_1115.initDrawingArea();
  2799. sprite.method346(-562, -171);
  2800. int ai[] = new int[sprite.myWidth];
  2801. for(int j = 0; j < sprite.myHeight; j++) {
  2802. for(int k = 0; k < sprite.myWidth; k++)
  2803. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  2804.  
  2805. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  2806. }
  2807. aRSImageProducer_1110.initDrawingArea();
  2808. sprite.method346(382, 0);
  2809. aRSImageProducer_1111.initDrawingArea();
  2810. sprite.method346(-255, 0);
  2811. aRSImageProducer_1107.initDrawingArea();
  2812. sprite.method346(254, 0);
  2813. aRSImageProducer_1108.initDrawingArea();
  2814. sprite.method346(180, -371);
  2815. aRSImageProducer_1109.initDrawingArea();
  2816. sprite.method346(180, -171);
  2817. aRSImageProducer_1112.initDrawingArea();
  2818. sprite.method346(382, -265);
  2819. aRSImageProducer_1113.initDrawingArea();
  2820. sprite.method346(-180, -265);
  2821. aRSImageProducer_1114.initDrawingArea();
  2822. sprite.method346(254, -171);
  2823. aRSImageProducer_1115.initDrawingArea();
  2824. sprite.method346(-180, -171);
  2825. sprite = new Sprite(titleStreamLoader, "logo", 0);
  2826. aRSImageProducer_1107.initDrawingArea();
  2827. sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  2828. sprite = null;
  2829. Object obj = null;
  2830. Object obj1 = null;
  2831. System.gc();
  2832. }
  2833.  
  2834. private void processOnDemandQueue()
  2835. {
  2836. do
  2837. {
  2838. OnDemandData onDemandData;
  2839. do
  2840. {
  2841. onDemandData = onDemandFetcher.getNextNode();
  2842. if(onDemandData == null)
  2843. return;
  2844. if(onDemandData.dataType == 0)
  2845. {
  2846. Model.method460(onDemandData.buffer, onDemandData.ID);
  2847. if((onDemandFetcher.getModelIndex(onDemandData.ID) & 0x62) != 0)
  2848. {
  2849. needDrawTabArea = true;
  2850. if(backDialogID != -1)
  2851. inputTaken = true;
  2852. }
  2853. }
  2854. if(onDemandData.dataType == 1 && onDemandData.buffer != null)
  2855. Class36.method529(onDemandData.buffer);
  2856. if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  2857. saveMidi(songChanging, onDemandData.buffer);
  2858. if(onDemandData.dataType == 3 && loadingStage == 1)
  2859. {
  2860. for(int i = 0; i < aByteArrayArray1183.length; i++)
  2861. {
  2862. if(anIntArray1235[i] == onDemandData.ID)
  2863. {
  2864. aByteArrayArray1183[i] = onDemandData.buffer;
  2865. if(onDemandData.buffer == null)
  2866. anIntArray1235[i] = -1;
  2867. break;
  2868. }
  2869. if(anIntArray1236[i] != onDemandData.ID)
  2870. continue;
  2871. aByteArrayArray1247[i] = onDemandData.buffer;
  2872. if(onDemandData.buffer == null)
  2873. anIntArray1236[i] = -1;
  2874. break;
  2875. }
  2876.  
  2877. }
  2878. } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  2879. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  2880. } while(true);
  2881. }
  2882.  
  2883. private void calcFlamesPosition()
  2884. {
  2885. char c = '\u0100';
  2886. for(int j = 10; j < 117; j++)
  2887. {
  2888. int k = (int)(Math.random() * 100D);
  2889. if(k < 50)
  2890. anIntArray828[j + (c - 2 << 7)] = 255;
  2891. }
  2892. for(int l = 0; l < 100; l++)
  2893. {
  2894. int i1 = (int)(Math.random() * 124D) + 2;
  2895. int k1 = (int)(Math.random() * 128D) + 128;
  2896. int k2 = i1 + (k1 << 7);
  2897. anIntArray828[k2] = 192;
  2898. }
  2899.  
  2900. for(int j1 = 1; j1 < c - 1; j1++)
  2901. {
  2902. for(int l1 = 1; l1 < 127; l1++)
  2903. {
  2904. int l2 = l1 + (j1 << 7);
  2905. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  2906. }
  2907.  
  2908. }
  2909.  
  2910. anInt1275 += 128;
  2911. if(anInt1275 > anIntArray1190.length)
  2912. {
  2913. anInt1275 -= anIntArray1190.length;
  2914. int i2 = (int)(Math.random() * 12D);
  2915. randomizeBackground(aBackgroundArray1152s[i2]);
  2916. }
  2917. for(int j2 = 1; j2 < c - 1; j2++)
  2918. {
  2919. for(int i3 = 1; i3 < 127; i3++)
  2920. {
  2921. int k3 = i3 + (j2 << 7);
  2922. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  2923. if(i4 < 0)
  2924. i4 = 0;
  2925. anIntArray828[k3] = i4;
  2926. }
  2927.  
  2928. }
  2929.  
  2930. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  2931.  
  2932. anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
  2933. if(anInt1040 > 0)
  2934. anInt1040 -= 4;
  2935. if(anInt1041 > 0)
  2936. anInt1041 -= 4;
  2937. if(anInt1040 == 0 && anInt1041 == 0)
  2938. {
  2939. int l3 = (int)(Math.random() * 2000D);
  2940. if(l3 == 0)
  2941. anInt1040 = 1024;
  2942. if(l3 == 1)
  2943. anInt1041 = 1024;
  2944. }
  2945. }
  2946.  
  2947. private boolean saveWave(byte abyte0[], int i)
  2948. {
  2949. return abyte0 == null || signlink.wavesave(abyte0, i);
  2950. }
  2951.  
  2952. private void method60(int i)
  2953. {
  2954. RSInterface class9 = RSInterface.interfaceCache[i];
  2955. for(int j = 0; j < class9.children.length; j++)
  2956. {
  2957. if(class9.children[j] == -1)
  2958. break;
  2959. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  2960. if(class9_1.type == 1)
  2961. method60(class9_1.id);
  2962. class9_1.anInt246 = 0;
  2963. class9_1.anInt208 = 0;
  2964. }
  2965. }
  2966.  
  2967. private void drawHeadIcon()
  2968. {
  2969. if(anInt855 != 2)
  2970. return;
  2971. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  2972. if(spriteDrawX > -1 && loopCycle % 20 < 10)
  2973. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  2974. }
  2975.  
  2976. private void mainGameProcessor()
  2977. {
  2978. if(anInt1104 > 1)
  2979. anInt1104--;
  2980. if(anInt1011 > 0)
  2981. anInt1011--;
  2982. for(int j = 0; j < 5; j++)
  2983. if(!parsePacket())
  2984. break;
  2985.  
  2986. if(!loggedIn)
  2987. return;
  2988. synchronized(mouseDetection.syncObject)
  2989. {
  2990. if(flagged)
  2991. {
  2992. if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
  2993. {
  2994. stream.createFrame(45);
  2995. stream.writeWordBigEndian(0);
  2996. int j2 = stream.currentOffset;
  2997. int j3 = 0;
  2998. for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
  2999. {
  3000. if(j2 - stream.currentOffset >= 240)
  3001. break;
  3002. j3++;
  3003. int l4 = mouseDetection.coordsY[j4];
  3004. if(l4 < 0)
  3005. l4 = 0;
  3006. else
  3007. if(l4 > 502)
  3008. l4 = 502;
  3009. int k5 = mouseDetection.coordsX[j4];
  3010. if(k5 < 0)
  3011. k5 = 0;
  3012. else
  3013. if(k5 > 764)
  3014. k5 = 764;
  3015. int i6 = l4 * 765 + k5;
  3016. if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  3017. {
  3018. k5 = -1;
  3019. l4 = -1;
  3020. i6 = 0x7ffff;
  3021. }
  3022. if(k5 == anInt1237 && l4 == anInt1238)
  3023. {
  3024. if(anInt1022 < 2047)
  3025. anInt1022++;
  3026. } else
  3027. {
  3028. int j6 = k5 - anInt1237;
  3029. anInt1237 = k5;
  3030. int k6 = l4 - anInt1238;
  3031. anInt1238 = l4;
  3032. if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  3033. {
  3034. j6 += 32;
  3035. k6 += 32;
  3036. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  3037. anInt1022 = 0;
  3038. } else
  3039. if(anInt1022 < 8)
  3040. {
  3041. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  3042. anInt1022 = 0;
  3043. } else
  3044. {
  3045. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  3046. anInt1022 = 0;
  3047. }
  3048. }
  3049. }
  3050.  
  3051. stream.writeBytes(stream.currentOffset - j2);
  3052. if(j3 >= mouseDetection.coordsIndex)
  3053. {
  3054. mouseDetection.coordsIndex = 0;
  3055. } else
  3056. {
  3057. mouseDetection.coordsIndex -= j3;
  3058. for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  3059. {
  3060. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  3061. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  3062. }
  3063.  
  3064. }
  3065. }
  3066. } else
  3067. {
  3068. mouseDetection.coordsIndex = 0;
  3069. }
  3070. }
  3071. if(super.clickMode3 != 0)
  3072. {
  3073. long l = (super.aLong29 - aLong1220) / 50L;
  3074. if(l > 4095L)
  3075. l = 4095L;
  3076. aLong1220 = super.aLong29;
  3077. int k2 = super.saveClickY;
  3078. if(k2 < 0)
  3079. k2 = 0;
  3080. else
  3081. if(k2 > 502)
  3082. k2 = 502;
  3083. int k3 = super.saveClickX;
  3084. if(k3 < 0)
  3085. k3 = 0;
  3086. else
  3087. if(k3 > 764)
  3088. k3 = 764;
  3089. int k4 = k2 * 765 + k3;
  3090. int j5 = 0;
  3091. if(super.clickMode3 == 2)
  3092. j5 = 1;
  3093. int l5 = (int)l;
  3094. stream.createFrame(241);
  3095. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3096. }
  3097. if(anInt1016 > 0)
  3098. anInt1016--;
  3099. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3100. aBoolean1017 = true;
  3101. if(aBoolean1017 && anInt1016 <= 0)
  3102. {
  3103. anInt1016 = 20;
  3104. aBoolean1017 = false;
  3105. stream.createFrame(86);
  3106. stream.writeWord(anInt1184);
  3107. stream.method432(minimapInt1);
  3108. }
  3109. if(super.awtFocus && !aBoolean954)
  3110. {
  3111. aBoolean954 = true;
  3112. stream.createFrame(3);
  3113. stream.writeWordBigEndian(1);
  3114. }
  3115. if(!super.awtFocus && aBoolean954)
  3116. {
  3117. aBoolean954 = false;
  3118. stream.createFrame(3);
  3119. stream.writeWordBigEndian(0);
  3120. }
  3121. loadingStages();
  3122. method115();
  3123. method90();
  3124. anInt1009++;
  3125. if(anInt1009 > 750)
  3126. dropClient();
  3127. method114();
  3128. method95();
  3129. method38();
  3130. anInt945++;
  3131. if(crossType != 0)
  3132. {
  3133. crossIndex += 20;
  3134. if(crossIndex >= 400)
  3135. crossType = 0;
  3136. }
  3137. if(atInventoryInterfaceType != 0)
  3138. {
  3139. atInventoryLoopCycle++;
  3140. if(atInventoryLoopCycle >= 15)
  3141. {
  3142. if(atInventoryInterfaceType == 2)
  3143. needDrawTabArea = true;
  3144. if(atInventoryInterfaceType == 3)
  3145. inputTaken = true;
  3146. atInventoryInterfaceType = 0;
  3147. }
  3148. }
  3149. if(activeInterfaceType != 0)
  3150. {
  3151. anInt989++;
  3152. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  3153. aBoolean1242 = true;
  3154. if(super.clickMode2 == 0)
  3155. {
  3156. if(activeInterfaceType == 2)
  3157. needDrawTabArea = true;
  3158. if(activeInterfaceType == 3)
  3159. inputTaken = true;
  3160. activeInterfaceType = 0;
  3161. if(aBoolean1242 && anInt989 >= 5)
  3162. {
  3163. lastActiveInvInterface = -1;
  3164. processRightClick();
  3165. if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  3166. {
  3167. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3168. int j1 = 0;
  3169. if(anInt913 == 1 && class9.contentType == 206)
  3170. j1 = 1;
  3171. if(class9.inv[mouseInvInterfaceIndex] <= 0)
  3172. j1 = 0;
  3173. if(class9.aBoolean235)
  3174. {
  3175. int l2 = anInt1085;
  3176. int l3 = mouseInvInterfaceIndex;
  3177. class9.inv[l3] = class9.inv[l2];
  3178. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3179. class9.inv[l2] = -1;
  3180. class9.invStackSizes[l2] = 0;
  3181. } else
  3182. if(j1 == 1)
  3183. {
  3184. int i3 = anInt1085;
  3185. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3186. if(i3 > i4)
  3187. {
  3188. class9.swapInventoryItems(i3, i3 - 1);
  3189. i3--;
  3190. } else
  3191. if(i3 < i4)
  3192. {
  3193. class9.swapInventoryItems(i3, i3 + 1);
  3194. i3++;
  3195. }
  3196.  
  3197. } else
  3198. {
  3199. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  3200. }
  3201. stream.createFrame(214);
  3202. stream.method433(anInt1084);
  3203. stream.method424(j1);
  3204. stream.method433(anInt1085);
  3205. stream.method431(mouseInvInterfaceIndex);
  3206. }
  3207. } else
  3208. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  3209. determineMenuSize();
  3210. else
  3211. if(menuActionRow > 0)
  3212. doAction(menuActionRow - 1);
  3213. atInventoryLoopCycle = 10;
  3214. super.clickMode3 = 0;
  3215. }
  3216. }
  3217. if(WorldController.anInt470 != -1)
  3218. {
  3219. int k = WorldController.anInt470;
  3220. int k1 = WorldController.anInt471;
  3221. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  3222. WorldController.anInt470 = -1;
  3223. if(flag)
  3224. {
  3225. crossX = super.saveClickX;
  3226. crossY = super.saveClickY;
  3227. crossType = 1;
  3228. crossIndex = 0;
  3229. }
  3230. }
  3231. if(super.clickMode3 == 1 && aString844 != null)
  3232. {
  3233. aString844 = null;
  3234. inputTaken = true;
  3235. super.clickMode3 = 0;
  3236. }
  3237. processMenuClick();
  3238. processMainScreenClick();
  3239. processTabClick();
  3240. processChatModeClick();
  3241. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  3242. anInt1213++;
  3243. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3244. if (anInt1501 < 100) {
  3245. anInt1501++;
  3246. if (anInt1501 == 100) {
  3247. if (anInt1500 != 0) {
  3248. inputTaken = true;
  3249. }
  3250. if (anInt1044 != 0) {
  3251. needDrawTabArea = true;
  3252. }
  3253. }
  3254. }
  3255. } else if (anInt1501 > 0) {
  3256. anInt1501--;
  3257. }
  3258. if(loadingStage == 2)
  3259. method108();
  3260. if(loadingStage == 2 && aBoolean1160)
  3261. calcCameraPos();
  3262. for(int i1 = 0; i1 < 5; i1++)
  3263. anIntArray1030[i1]++;
  3264.  
  3265. method73();
  3266. super.idleTime++;
  3267. if(super.idleTime > 4500)
  3268. {
  3269. anInt1011 = 250;
  3270. super.idleTime -= 500;
  3271. stream.createFrame(202);
  3272. }
  3273. anInt988++;
  3274. if(anInt988 > 500)
  3275. {
  3276. anInt988 = 0;
  3277. int l1 = (int)(Math.random() * 8D);
  3278. if((l1 & 1) == 1)
  3279. anInt1278 += anInt1279;
  3280. if((l1 & 2) == 2)
  3281. anInt1131 += anInt1132;
  3282. if((l1 & 4) == 4)
  3283. anInt896 += anInt897;
  3284. }
  3285. if(anInt1278 < -50)
  3286. anInt1279 = 2;
  3287. if(anInt1278 > 50)
  3288. anInt1279 = -2;
  3289. if(anInt1131 < -55)
  3290. anInt1132 = 2;
  3291. if(anInt1131 > 55)
  3292. anInt1132 = -2;
  3293. if(anInt896 < -40)
  3294. anInt897 = 1;
  3295. if(anInt896 > 40)
  3296. anInt897 = -1;
  3297. anInt1254++;
  3298. if(anInt1254 > 500)
  3299. {
  3300. anInt1254 = 0;
  3301. int i2 = (int)(Math.random() * 8D);
  3302. if((i2 & 1) == 1)
  3303. minimapInt2 += anInt1210;
  3304. if((i2 & 2) == 2)
  3305. minimapInt3 += anInt1171;
  3306. }
  3307. if(minimapInt2 < -60)
  3308. anInt1210 = 2;
  3309. if(minimapInt2 > 60)
  3310. anInt1210 = -2;
  3311. if(minimapInt3 < -20)
  3312. anInt1171 = 1;
  3313. if(minimapInt3 > 10)
  3314. anInt1171 = -1;
  3315. anInt1010++;
  3316. if(anInt1010 > 50)
  3317. stream.createFrame(0);
  3318. try
  3319. {
  3320. if(socketStream != null && stream.currentOffset > 0)
  3321. {
  3322. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3323. stream.currentOffset = 0;
  3324. anInt1010 = 0;
  3325. }
  3326. }
  3327. catch(IOException _ex)
  3328. {
  3329. dropClient();
  3330. }
  3331. catch(Exception exception)
  3332. {
  3333. resetLogout();
  3334. }
  3335. }
  3336.  
  3337. private void method63()
  3338. {
  3339. Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  3340. for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  3341. if(class30_sub1.anInt1294 == -1)
  3342. {
  3343. class30_sub1.anInt1302 = 0;
  3344. method89(class30_sub1);
  3345. } else
  3346. {
  3347. class30_sub1.unlink();
  3348. }
  3349.  
  3350. }
  3351.  
  3352. private void resetImageProducers()
  3353. {
  3354. if(aRSImageProducer_1107 != null)
  3355. return;
  3356. super.fullGameScreen = null;
  3357. aRSImageProducer_1166 = null;
  3358. aRSImageProducer_1164 = null;
  3359. aRSImageProducer_1163 = null;
  3360. aRSImageProducer_1165 = null;
  3361. aRSImageProducer_1123 = null;
  3362. aRSImageProducer_1124 = null;
  3363. aRSImageProducer_1125 = null;
  3364. aRSImageProducer_1110 = new RSImageProducer(128, 265, getGameComponent());
  3365. DrawingArea.setAllPixelsToZero();
  3366. aRSImageProducer_1111 = new RSImageProducer(128, 265, getGameComponent());
  3367. DrawingArea.setAllPixelsToZero();
  3368. aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
  3369. DrawingArea.setAllPixelsToZero();
  3370. aRSImageProducer_1108 = new RSImageProducer(360, 132, getGameComponent());
  3371. DrawingArea.setAllPixelsToZero();
  3372. aRSImageProducer_1109 = new RSImageProducer(360, 200, getGameComponent());
  3373. DrawingArea.setAllPixelsToZero();
  3374. aRSImageProducer_1112 = new RSImageProducer(202, 238, getGameComponent());
  3375. DrawingArea.setAllPixelsToZero();
  3376. aRSImageProducer_1113 = new RSImageProducer(203, 238, getGameComponent());
  3377. DrawingArea.setAllPixelsToZero();
  3378. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  3379. DrawingArea.setAllPixelsToZero();
  3380. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  3381. DrawingArea.setAllPixelsToZero();
  3382. if(titleStreamLoader != null)
  3383. {
  3384. drawLogo();
  3385. loadTitleScreen();
  3386. }
  3387. welcomeScreenRaised = true;
  3388. }
  3389.  
  3390. void drawLoadingText(int i, String s)
  3391. {
  3392. anInt1079 = i;
  3393. aString1049 = s;
  3394. resetImageProducers();
  3395. if(titleStreamLoader == null)
  3396. {
  3397. super.drawLoadingText(i, s);
  3398. return;
  3399. }
  3400. aRSImageProducer_1109.initDrawingArea();
  3401. char c = '\u0168';
  3402. char c1 = '\310';
  3403. byte byte1 = 20;
  3404. chatTextDrawingArea.drawText(0xffffff, "RuneScape is loading - please wait...", c1 / 2 - 26 - byte1, c / 2);
  3405. int j = c1 / 2 - 18 - byte1;
  3406. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  3407. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3408. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  3409. DrawingArea.drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3410. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3411. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3412. if(welcomeScreenRaised)
  3413. {
  3414. welcomeScreenRaised = false;
  3415. if(!aBoolean831)
  3416. {
  3417. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3418. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3419. }
  3420. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3421. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3422. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3423. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3424. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3425. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3426. }
  3427. }
  3428.  
  3429. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag,
  3430. int j1)
  3431. {
  3432. int anInt992;
  3433. if(aBoolean972)
  3434. anInt992 = 32;
  3435. else
  3436. anInt992 = 0;
  3437. aBoolean972 = false;
  3438. if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  3439. {
  3440. class9.scrollPosition -= anInt1213 * 4;
  3441. if(flag)
  3442. {
  3443. needDrawTabArea = true;
  3444. }
  3445. } else
  3446. if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  3447. {
  3448. class9.scrollPosition += anInt1213 * 4;
  3449. if(flag)
  3450. {
  3451. needDrawTabArea = true;
  3452. }
  3453. } else
  3454. if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  3455. {
  3456. int l1 = ((j - 32) * j) / j1;
  3457. if(l1 < 8)
  3458. l1 = 8;
  3459. int i2 = l - i1 - 16 - l1 / 2;
  3460. int j2 = j - 32 - l1;
  3461. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3462. if(flag)
  3463. needDrawTabArea = true;
  3464. aBoolean972 = true;
  3465. }
  3466. }
  3467.  
  3468. private boolean method66(int i, int j, int k)
  3469. {
  3470. int i1 = i >> 14 & 0x7fff;
  3471. int j1 = worldController.method304(plane, k, j, i);
  3472. if(j1 == -1)
  3473. return false;
  3474. int k1 = j1 & 0x1f;
  3475. int l1 = j1 >> 6 & 3;
  3476. if(k1 == 10 || k1 == 11 || k1 == 22)
  3477. {
  3478. ObjectDef class46 = ObjectDef.forID(i1);
  3479. int i2;
  3480. int j2;
  3481. if(l1 == 0 || l1 == 2)
  3482. {
  3483. i2 = class46.anInt744;
  3484. j2 = class46.anInt761;
  3485. } else
  3486. {
  3487. i2 = class46.anInt761;
  3488. j2 = class46.anInt744;
  3489. }
  3490. int k2 = class46.anInt768;
  3491. if(l1 != 0)
  3492. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3493. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3494. } else
  3495. {
  3496. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3497. }
  3498. crossX = super.saveClickX;
  3499. crossY = super.saveClickY;
  3500. crossType = 2;
  3501. crossIndex = 0;
  3502. return true;
  3503. }
  3504.  
  3505. private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k)
  3506. {
  3507. byte abyte0[] = null;
  3508. int l = 5;
  3509. try
  3510. {
  3511. if(decompressors[0] != null)
  3512. abyte0 = decompressors[0].decompress(i);
  3513. }
  3514. catch(Exception _ex) { }
  3515. if(abyte0 != null)
  3516. {
  3517. // aCRC32_930.reset();
  3518. // aCRC32_930.update(abyte0);
  3519. // int i1 = (int)aCRC32_930.getValue();
  3520. // if(i1 != j)
  3521. }
  3522. if(abyte0 != null)
  3523. {
  3524. StreamLoader streamLoader = new StreamLoader(abyte0);
  3525. return streamLoader;
  3526. }
  3527. int j1 = 0;
  3528. while(abyte0 == null)
  3529. {
  3530. String s2 = "Unknown error";
  3531. drawLoadingText(k, "Requesting " + s);
  3532. Object obj = null;
  3533. try
  3534. {
  3535. int k1 = 0;
  3536. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3537. byte abyte1[] = new byte[6];
  3538. datainputstream.readFully(abyte1, 0, 6);
  3539. Stream stream = new Stream(abyte1);
  3540. stream.currentOffset = 3;
  3541. int i2 = stream.read3Bytes() + 6;
  3542. int j2 = 6;
  3543. abyte0 = new byte[i2];
  3544. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3545.  
  3546. while(j2 < i2)
  3547. {
  3548. int l2 = i2 - j2;
  3549. if(l2 > 1000)
  3550. l2 = 1000;
  3551. int j3 = datainputstream.read(abyte0, j2, l2);
  3552. if(j3 < 0)
  3553. {
  3554. s2 = "Length error: " + j2 + "/" + i2;
  3555. throw new IOException("EOF");
  3556. }
  3557. j2 += j3;
  3558. int k3 = (j2 * 100) / i2;
  3559. if(k3 != k1)
  3560. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3561. k1 = k3;
  3562. }
  3563. datainputstream.close();
  3564. try
  3565. {
  3566. if(decompressors[0] != null)
  3567. decompressors[0].method234(abyte0.length, abyte0, i);
  3568. }
  3569. catch(Exception _ex)
  3570. {
  3571. decompressors[0] = null;
  3572. }
  3573. /* if(abyte0 != null)
  3574. {
  3575. aCRC32_930.reset();
  3576. aCRC32_930.update(abyte0);
  3577. int i3 = (int)aCRC32_930.getValue();
  3578. if(i3 != j)
  3579. {
  3580. abyte0 = null;
  3581. j1++;
  3582. s2 = "Checksum error: " + i3;
  3583. }
  3584. }
  3585. */
  3586. }
  3587. catch(IOException ioexception)
  3588. {
  3589. if(s2.equals("Unknown error"))
  3590. s2 = "Connection error";
  3591. abyte0 = null;
  3592. }
  3593. catch(NullPointerException _ex)
  3594. {
  3595. s2 = "Null error";
  3596. abyte0 = null;
  3597. if(!signlink.reporterror)
  3598. return null;
  3599. }
  3600. catch(ArrayIndexOutOfBoundsException _ex)
  3601. {
  3602. s2 = "Bounds error";
  3603. abyte0 = null;
  3604. if(!signlink.reporterror)
  3605. return null;
  3606. }
  3607. catch(Exception _ex)
  3608. {
  3609. s2 = "Unexpected error";
  3610. abyte0 = null;
  3611. if(!signlink.reporterror)
  3612. return null;
  3613. }
  3614. if(abyte0 == null)
  3615. {
  3616. for(int l1 = l; l1 > 0; l1--)
  3617. {
  3618. if(j1 >= 3)
  3619. {
  3620. drawLoadingText(k, "Game updated - please reload page");
  3621. l1 = 10;
  3622. } else
  3623. {
  3624. drawLoadingText(k, s2 + " - Retrying in " + l1);
  3625. }
  3626. try
  3627. {
  3628. Thread.sleep(1000L);
  3629. }
  3630. catch(Exception _ex) { }
  3631. }
  3632.  
  3633. l *= 2;
  3634. if(l > 60)
  3635. l = 60;
  3636. aBoolean872 = !aBoolean872;
  3637. }
  3638.  
  3639. }
  3640.  
  3641. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  3642. return streamLoader_1;
  3643. }
  3644.  
  3645. private void dropClient()
  3646. {
  3647. if(anInt1011 > 0)
  3648. {
  3649. resetLogout();
  3650. return;
  3651. }
  3652. aRSImageProducer_1165.initDrawingArea();
  3653. aTextDrawingArea_1271.drawText(0, "Connection lost", 144, 257);
  3654. aTextDrawingArea_1271.drawText(0xffffff, "Connection lost", 143, 256);
  3655. aTextDrawingArea_1271.drawText(0, "Please wait - attempting to reestablish", 159, 257);
  3656. aTextDrawingArea_1271.drawText(0xffffff, "Please wait - attempting to reestablish", 158, 256);
  3657. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3658. anInt1021 = 0;
  3659. destX = 0;
  3660. RSSocket rsSocket = socketStream;
  3661. loggedIn = false;
  3662. loginFailures = 0;
  3663. login(myUsername, myPassword, true);
  3664. if(!loggedIn)
  3665. resetLogout();
  3666. try
  3667. {
  3668. rsSocket.close();
  3669. }
  3670. catch(Exception _ex)
  3671. {
  3672. }
  3673. }
  3674.  
  3675. private void doAction(int i)
  3676. {
  3677. if(i < 0)
  3678. return;
  3679. if(inputDialogState != 0)
  3680. {
  3681. inputDialogState = 0;
  3682. inputTaken = true;
  3683. }
  3684. int j = menuActionCmd2[i];
  3685. int k = menuActionCmd3[i];
  3686. int l = menuActionID[i];
  3687. int i1 = menuActionCmd1[i];
  3688. if(l >= 2000)
  3689. l -= 2000;
  3690. if(l == 582)
  3691. {
  3692. NPC npc = npcArray[i1];
  3693. if(npc != null)
  3694. {
  3695. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  3696. crossX = super.saveClickX;
  3697. crossY = super.saveClickY;
  3698. crossType = 2;
  3699. crossIndex = 0;
  3700. stream.createFrame(57);
  3701. stream.method432(anInt1285);
  3702. stream.method432(i1);
  3703. stream.method431(anInt1283);
  3704. stream.method432(anInt1284);
  3705. }
  3706. }
  3707. if(l == 234)
  3708. {
  3709. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3710. if(!flag1)
  3711. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3712. crossX = super.saveClickX;
  3713. crossY = super.saveClickY;
  3714. crossType = 2;
  3715. crossIndex = 0;
  3716. stream.createFrame(236);
  3717. stream.method431(k + baseY);
  3718. stream.writeWord(i1);
  3719. stream.method431(j + baseX);
  3720. }
  3721. if(l == 62 && method66(i1, k, j))
  3722. {
  3723. stream.createFrame(192);
  3724. stream.writeWord(anInt1284);
  3725. stream.method431(i1 >> 14 & 0x7fff);
  3726. stream.method433(k + baseY);
  3727. stream.method431(anInt1283);
  3728. stream.method433(j + baseX);
  3729. stream.writeWord(anInt1285);
  3730. }
  3731. if(l == 511)
  3732. {
  3733. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3734. if(!flag2)
  3735. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3736. crossX = super.saveClickX;
  3737. crossY = super.saveClickY;
  3738. crossType = 2;
  3739. crossIndex = 0;
  3740. stream.createFrame(25);
  3741. stream.method431(anInt1284);
  3742. stream.method432(anInt1285);
  3743. stream.writeWord(i1);
  3744. stream.method432(k + baseY);
  3745. stream.method433(anInt1283);
  3746. stream.writeWord(j + baseX);
  3747. }
  3748. if(l == 74)
  3749. {
  3750. stream.createFrame(122);
  3751. stream.method433(k);
  3752. stream.method432(j);
  3753. stream.method431(i1);
  3754. atInventoryLoopCycle = 0;
  3755. atInventoryInterface = k;
  3756. atInventoryIndex = j;
  3757. atInventoryInterfaceType = 2;
  3758. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3759. atInventoryInterfaceType = 1;
  3760. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3761. atInventoryInterfaceType = 3;
  3762. }
  3763. if (l == 315) {
  3764. RSInterface class9 = RSInterface.interfaceCache[k];
  3765. boolean flag8 = true;
  3766. if (class9.contentType > 0)
  3767. flag8 = promptUserForInput(class9);
  3768. if (flag8) {
  3769.  
  3770. switch(k){
  3771. case 19144:
  3772. sendFrame248(15106,3213);
  3773. method60(15106);
  3774. inputTaken = true;
  3775. break;
  3776. default:
  3777. stream.createFrame(185);
  3778. stream.writeWord(k);
  3779. break;
  3780.  
  3781. }
  3782. }
  3783. }
  3784. if(l == 561)
  3785. {
  3786. Player player = playerArray[i1];
  3787. if(player != null)
  3788. {
  3789. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  3790. crossX = super.saveClickX;
  3791. crossY = super.saveClickY;
  3792. crossType = 2;
  3793. crossIndex = 0;
  3794. anInt1188 += i1;
  3795. if(anInt1188 >= 90)
  3796. {
  3797. stream.createFrame(136);
  3798. anInt1188 = 0;
  3799. }
  3800. stream.createFrame(128);
  3801. stream.writeWord(i1);
  3802. }
  3803. }
  3804. if(l == 20)
  3805. {
  3806. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  3807. if(class30_sub2_sub4_sub1_sub1_1 != null)
  3808. {
  3809. 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]);
  3810. crossX = super.saveClickX;
  3811. crossY = super.saveClickY;
  3812. crossType = 2;
  3813. crossIndex = 0;
  3814. stream.createFrame(155);
  3815. stream.method431(i1);
  3816. }
  3817. }
  3818. if(l == 779)
  3819. {
  3820. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  3821. if(class30_sub2_sub4_sub1_sub2_1 != null)
  3822. {
  3823. 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]);
  3824. crossX = super.saveClickX;
  3825. crossY = super.saveClickY;
  3826. crossType = 2;
  3827. crossIndex = 0;
  3828. stream.createFrame(153);
  3829. stream.method431(i1);
  3830. }
  3831. }
  3832. if(l == 516)
  3833. if(!menuOpen)
  3834. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  3835. else
  3836. worldController.method312(k - 4, j - 4);
  3837. if(l == 1062)
  3838. {
  3839. anInt924 += baseX;
  3840. if(anInt924 >= 113)
  3841. {
  3842. stream.createFrame(183);
  3843. stream.writeDWordBigEndian(0xe63271);
  3844. anInt924 = 0;
  3845. }
  3846. method66(i1, k, j);
  3847. stream.createFrame(228);
  3848. stream.method432(i1 >> 14 & 0x7fff);
  3849. stream.method432(k + baseY);
  3850. stream.writeWord(j + baseX);
  3851. }
  3852. if(l == 679 && !aBoolean1149)
  3853. {
  3854. stream.createFrame(40);
  3855. stream.writeWord(k);
  3856. aBoolean1149 = true;
  3857. }
  3858. if(l == 431)
  3859. {
  3860. stream.createFrame(129);
  3861. stream.method432(j);
  3862. stream.writeWord(k);
  3863. stream.method432(i1);
  3864. atInventoryLoopCycle = 0;
  3865. atInventoryInterface = k;
  3866. atInventoryIndex = j;
  3867. atInventoryInterfaceType = 2;
  3868. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3869. atInventoryInterfaceType = 1;
  3870. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3871. atInventoryInterfaceType = 3;
  3872. }
  3873. if(l == 337 || l == 42 || l == 792 || l == 322)
  3874. {
  3875. String s = menuActionName[i];
  3876. int k1 = s.indexOf("@whi@");
  3877. if(k1 != -1)
  3878. {
  3879. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  3880. if(l == 337)
  3881. addFriend(l3);
  3882. if(l == 42)
  3883. addIgnore(l3);
  3884. if(l == 792)
  3885. delFriend(l3);
  3886. if(l == 322)
  3887. delIgnore(l3);
  3888. }
  3889. }
  3890. if(l == 53)
  3891. {
  3892. stream.createFrame(135);
  3893. stream.method431(j);
  3894. stream.method432(k);
  3895. stream.method431(i1);
  3896. atInventoryLoopCycle = 0;
  3897. atInventoryInterface = k;
  3898. atInventoryIndex = j;
  3899. atInventoryInterfaceType = 2;
  3900. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3901. atInventoryInterfaceType = 1;
  3902. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3903. atInventoryInterfaceType = 3;
  3904. }
  3905. if(l == 539)
  3906. {
  3907. stream.createFrame(16);
  3908. stream.method432(i1);
  3909. stream.method433(j);
  3910. stream.method433(k);
  3911. atInventoryLoopCycle = 0;
  3912. atInventoryInterface = k;
  3913. atInventoryIndex = j;
  3914. atInventoryInterfaceType = 2;
  3915. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3916. atInventoryInterfaceType = 1;
  3917. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3918. atInventoryInterfaceType = 3;
  3919. }
  3920. if(l == 484 || l == 6)
  3921. {
  3922. String s1 = menuActionName[i];
  3923. int l1 = s1.indexOf("@whi@");
  3924. if(l1 != -1)
  3925. {
  3926. s1 = s1.substring(l1 + 5).trim();
  3927. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  3928. boolean flag9 = false;
  3929. for(int j3 = 0; j3 < playerCount; j3++)
  3930. {
  3931. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  3932. 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))
  3933. continue;
  3934. 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]);
  3935. if(l == 484)
  3936. {
  3937. stream.createFrame(139);
  3938. stream.method431(playerIndices[j3]);
  3939. }
  3940. if(l == 6)
  3941. {
  3942. anInt1188 += i1;
  3943. if(anInt1188 >= 90)
  3944. {
  3945. stream.createFrame(136);
  3946. anInt1188 = 0;
  3947. }
  3948. stream.createFrame(128);
  3949. stream.writeWord(playerIndices[j3]);
  3950. }
  3951. flag9 = true;
  3952. break;
  3953. }
  3954.  
  3955. if(!flag9)
  3956. pushMessage("Unable to find " + s7, 0, "");
  3957. }
  3958. }
  3959. if(l == 870)
  3960. {
  3961. stream.createFrame(53);
  3962. stream.writeWord(j);
  3963. stream.method432(anInt1283);
  3964. stream.method433(i1);
  3965. stream.writeWord(anInt1284);
  3966. stream.method431(anInt1285);
  3967. stream.writeWord(k);
  3968. atInventoryLoopCycle = 0;
  3969. atInventoryInterface = k;
  3970. atInventoryIndex = j;
  3971. atInventoryInterfaceType = 2;
  3972. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3973. atInventoryInterfaceType = 1;
  3974. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3975. atInventoryInterfaceType = 3;
  3976. }
  3977. if(l == 847)
  3978. {
  3979. stream.createFrame(87);
  3980. stream.method432(i1);
  3981. stream.writeWord(k);
  3982. stream.method432(j);
  3983. atInventoryLoopCycle = 0;
  3984. atInventoryInterface = k;
  3985. atInventoryIndex = j;
  3986. atInventoryInterfaceType = 2;
  3987. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3988. atInventoryInterfaceType = 1;
  3989. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3990. atInventoryInterfaceType = 3;
  3991. }
  3992. if(l == 626)
  3993. {
  3994. RSInterface class9_1 = RSInterface.interfaceCache[k];
  3995. spellSelected = 1;
  3996. spellID = class9_1.id;
  3997. anInt1137 = k;
  3998. spellUsableOn = class9_1.spellUsableOn;
  3999. itemSelected = 0;
  4000. needDrawTabArea = true;
  4001. spellID = class9_1.id;
  4002. String s4 = class9_1.selectedActionName;
  4003. if(s4.indexOf(" ") != -1)
  4004. s4 = s4.substring(0, s4.indexOf(" "));
  4005. String s8 = class9_1.selectedActionName;
  4006. if(s8.indexOf(" ") != -1)
  4007. s8 = s8.substring(s8.indexOf(" ") + 1);
  4008. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4009. //class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265, 0xffffff);
  4010. //class9_1.sprite1.drawSprite(200,200);
  4011. //System.out.println("Sprite: " + class9_1.sprite1.toString());
  4012. if(spellUsableOn == 16)
  4013. {
  4014. needDrawTabArea = true;
  4015. tabID = 3;
  4016. tabAreaAltered = true;
  4017. }
  4018. return;
  4019. }
  4020. if(l == 78)
  4021. {
  4022. stream.createFrame(117);
  4023. stream.method433(k);
  4024. stream.method433(i1);
  4025. stream.method431(j);
  4026. atInventoryLoopCycle = 0;
  4027. atInventoryInterface = k;
  4028. atInventoryIndex = j;
  4029. atInventoryInterfaceType = 2;
  4030. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4031. atInventoryInterfaceType = 1;
  4032. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4033. atInventoryInterfaceType = 3;
  4034. }
  4035. if(l == 27)
  4036. {
  4037. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4038. if(class30_sub2_sub4_sub1_sub2_2 != null)
  4039. {
  4040. 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]);
  4041. crossX = super.saveClickX;
  4042. crossY = super.saveClickY;
  4043. crossType = 2;
  4044. crossIndex = 0;
  4045. anInt986 += i1;
  4046. if(anInt986 >= 54)
  4047. {
  4048. stream.createFrame(189);
  4049. stream.writeWordBigEndian(234);
  4050. anInt986 = 0;
  4051. }
  4052. stream.createFrame(73);
  4053. stream.method431(i1);
  4054. }
  4055. }
  4056. if(l == 213)
  4057. {
  4058. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4059. if(!flag3)
  4060. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4061. crossX = super.saveClickX;
  4062. crossY = super.saveClickY;
  4063. crossType = 2;
  4064. crossIndex = 0;
  4065. stream.createFrame(79);
  4066. stream.method431(k + baseY);
  4067. stream.writeWord(i1);
  4068. stream.method432(j + baseX);
  4069. }
  4070. if(l == 632)
  4071. {
  4072. stream.createFrame(145);
  4073. stream.method432(k);
  4074. stream.method432(j);
  4075. stream.method432(i1);
  4076. atInventoryLoopCycle = 0;
  4077. atInventoryInterface = k;
  4078. atInventoryIndex = j;
  4079. atInventoryInterfaceType = 2;
  4080. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4081. atInventoryInterfaceType = 1;
  4082. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4083. atInventoryInterfaceType = 3;
  4084. }
  4085. if(l == 1004) {
  4086. if(tabInterfaceIDs[10] != -1) {
  4087. needDrawTabArea = true;
  4088. tabID = 10;
  4089. tabAreaAltered = true;
  4090. }
  4091. }
  4092. if(l == 1003) {
  4093. clanChatMode = 2;
  4094. aBoolean1233 = true;
  4095. inputTaken = true;
  4096. }
  4097. if(l == 1002) {
  4098. clanChatMode = 1;
  4099. aBoolean1233 = true;
  4100. inputTaken = true;
  4101. }
  4102. if(l == 1001) {
  4103. clanChatMode = 0;
  4104. aBoolean1233 = true;
  4105. inputTaken = true;
  4106. }
  4107. if(l == 1000) {
  4108. cButtonCPos = 4;
  4109. chatTypeView = 11;
  4110. aBoolean1233 = true;
  4111. inputTaken = true;
  4112. }
  4113. if(l == 999) {
  4114. cButtonCPos = 0;
  4115. chatTypeView = 0;
  4116. aBoolean1233 = true;
  4117. inputTaken = true;
  4118. }
  4119. if(l == 998) {
  4120. cButtonCPos = 1;
  4121. chatTypeView = 5;
  4122. aBoolean1233 = true;
  4123. inputTaken = true;
  4124. }
  4125. if(l == 997) {
  4126. publicChatMode = 3;
  4127. aBoolean1233 = true;
  4128. inputTaken = true;
  4129. }
  4130. if(l == 996) {
  4131. publicChatMode = 2;
  4132. aBoolean1233 = true;
  4133. inputTaken = true;
  4134. }
  4135. if(l == 995) {
  4136. publicChatMode = 1;
  4137. aBoolean1233 = true;
  4138. inputTaken = true;
  4139. }
  4140. if(l == 994) {
  4141. publicChatMode = 0;
  4142. aBoolean1233 = true;
  4143. inputTaken = true;
  4144. }
  4145. if(l == 993) {
  4146. cButtonCPos = 2;
  4147. chatTypeView = 1;
  4148. aBoolean1233 = true;
  4149. inputTaken = true;
  4150. }
  4151. if(l == 992) {
  4152. privateChatMode = 2;
  4153. aBoolean1233 = true;
  4154. inputTaken = true;
  4155. }
  4156. if(l == 991) {
  4157. privateChatMode = 1;
  4158. aBoolean1233 = true;
  4159. inputTaken = true;
  4160. }
  4161. if(l == 990) {
  4162. privateChatMode = 0;
  4163. aBoolean1233 = true;
  4164. inputTaken = true;
  4165. }
  4166. if(l == 989) {
  4167. cButtonCPos = 3;
  4168. chatTypeView = 2;
  4169. aBoolean1233 = true;
  4170. inputTaken = true;
  4171. }
  4172. if(l == 987) {
  4173. tradeMode = 2;
  4174. aBoolean1233 = true;
  4175. inputTaken = true;
  4176. }
  4177. if(l == 986) {
  4178. tradeMode = 1;
  4179. aBoolean1233 = true;
  4180. inputTaken = true;
  4181. }
  4182. if(l == 985) {
  4183. tradeMode = 0;
  4184. aBoolean1233 = true;
  4185. inputTaken = true;
  4186. }
  4187. if(l == 984) {
  4188. cButtonCPos = 5;
  4189. chatTypeView = 3;
  4190. aBoolean1233 = true;
  4191. inputTaken = true;
  4192. }
  4193. if(l == 983) {
  4194. duelMode = 2;
  4195. aBoolean1233 = true;
  4196. inputTaken = true;
  4197. }
  4198. if(l == 982) {
  4199. duelMode = 1;
  4200. aBoolean1233 = true;
  4201. inputTaken = true;
  4202. }
  4203. if(l == 981) {
  4204. duelMode = 0;
  4205. aBoolean1233 = true;
  4206. inputTaken = true;
  4207. }
  4208. if(l == 980) {
  4209. cButtonCPos = 6;
  4210. chatTypeView = 4;
  4211. aBoolean1233 = true;
  4212. inputTaken = true;
  4213. }
  4214. if(l == 493)
  4215. {
  4216. stream.createFrame(75);
  4217. stream.method433(k);
  4218. stream.method431(j);
  4219. stream.method432(i1);
  4220. atInventoryLoopCycle = 0;
  4221. atInventoryInterface = k;
  4222. atInventoryIndex = j;
  4223. atInventoryInterfaceType = 2;
  4224. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4225. atInventoryInterfaceType = 1;
  4226. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4227. atInventoryInterfaceType = 3;
  4228. }
  4229. if(l == 652)
  4230. {
  4231. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4232. if(!flag4)
  4233. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4234. crossX = super.saveClickX;
  4235. crossY = super.saveClickY;
  4236. crossType = 2;
  4237. crossIndex = 0;
  4238. stream.createFrame(156);
  4239. stream.method432(j + baseX);
  4240. stream.method431(k + baseY);
  4241. stream.method433(i1);
  4242. }
  4243. if(l == 94)
  4244. {
  4245. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4246. if(!flag5)
  4247. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4248. crossX = super.saveClickX;
  4249. crossY = super.saveClickY;
  4250. crossType = 2;
  4251. crossIndex = 0;
  4252. stream.createFrame(181);
  4253. stream.method431(k + baseY);
  4254. stream.writeWord(i1);
  4255. stream.method431(j + baseX);
  4256. stream.method432(anInt1137);
  4257. }
  4258. if(l == 646)
  4259. {
  4260. stream.createFrame(185);
  4261. stream.writeWord(k);
  4262. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4263. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
  4264. {
  4265. int i2 = class9_2.valueIndexArray[0][1];
  4266. if(variousSettings[i2] != class9_2.anIntArray212[0])
  4267. {
  4268. variousSettings[i2] = class9_2.anIntArray212[0];
  4269. method33(i2);
  4270. needDrawTabArea = true;
  4271. }
  4272. }
  4273. }
  4274. if(l == 225)
  4275. {
  4276. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4277. if(class30_sub2_sub4_sub1_sub1_2 != null)
  4278. {
  4279. 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]);
  4280. crossX = super.saveClickX;
  4281. crossY = super.saveClickY;
  4282. crossType = 2;
  4283. crossIndex = 0;
  4284. anInt1226 += i1;
  4285. if(anInt1226 >= 85)
  4286. {
  4287. stream.createFrame(230);
  4288. stream.writeWordBigEndian(239);
  4289. anInt1226 = 0;
  4290. }
  4291. stream.createFrame(17);
  4292. stream.method433(i1);
  4293. }
  4294. }
  4295. if(l == 965)
  4296. {
  4297. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4298. if(class30_sub2_sub4_sub1_sub1_3 != null)
  4299. {
  4300. 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]);
  4301. crossX = super.saveClickX;
  4302. crossY = super.saveClickY;
  4303. crossType = 2;
  4304. crossIndex = 0;
  4305. anInt1134++;
  4306. if(anInt1134 >= 96)
  4307. {
  4308. stream.createFrame(152);
  4309. stream.writeWordBigEndian(88);
  4310. anInt1134 = 0;
  4311. }
  4312. stream.createFrame(21);
  4313. stream.writeWord(i1);
  4314. }
  4315. }
  4316. if(l == 413)
  4317. {
  4318. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4319. if(class30_sub2_sub4_sub1_sub1_4 != null)
  4320. {
  4321. 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]);
  4322. crossX = super.saveClickX;
  4323. crossY = super.saveClickY;
  4324. crossType = 2;
  4325. crossIndex = 0;
  4326. stream.createFrame(131);
  4327. stream.method433(i1);
  4328. stream.method432(anInt1137);
  4329. }
  4330. }
  4331. if(l == 200)
  4332. clearTopInterfaces();
  4333. if(l == 1025)
  4334. {
  4335. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4336. if(class30_sub2_sub4_sub1_sub1_5 != null)
  4337. {
  4338. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4339. if(entityDef.childrenIDs != null)
  4340. entityDef = entityDef.method161();
  4341. if(entityDef != null)
  4342. {
  4343. String s9;
  4344. if(entityDef.description != null)
  4345. s9 = new String(entityDef.description);
  4346. else
  4347. s9 = "It's a " + entityDef.name + ".";
  4348. pushMessage(s9, 0, "");
  4349. }
  4350. }
  4351. }
  4352. if(l == 900)
  4353. {
  4354. method66(i1, k, j);
  4355. stream.createFrame(252);
  4356. stream.method433(i1 >> 14 & 0x7fff);
  4357. stream.method431(k + baseY);
  4358. stream.method432(j + baseX);
  4359. }
  4360. if(l == 412)
  4361. {
  4362. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4363. if(class30_sub2_sub4_sub1_sub1_6 != null)
  4364. {
  4365. 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]);
  4366. crossX = super.saveClickX;
  4367. crossY = super.saveClickY;
  4368. crossType = 2;
  4369. crossIndex = 0;
  4370. stream.createFrame(72);
  4371. stream.method432(i1);
  4372. }
  4373. }
  4374. if(l == 365)
  4375. {
  4376. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4377. if(class30_sub2_sub4_sub1_sub2_3 != null)
  4378. {
  4379. 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]);
  4380. crossX = super.saveClickX;
  4381. crossY = super.saveClickY;
  4382. crossType = 2;
  4383. crossIndex = 0;
  4384. stream.createFrame(249);
  4385. stream.method432(i1);
  4386. stream.method431(anInt1137);
  4387. }
  4388. }
  4389. if(l == 729)
  4390. {
  4391. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4392. if(class30_sub2_sub4_sub1_sub2_4 != null)
  4393. {
  4394. 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]);
  4395. crossX = super.saveClickX;
  4396. crossY = super.saveClickY;
  4397. crossType = 2;
  4398. crossIndex = 0;
  4399. stream.createFrame(39);
  4400. stream.method431(i1);
  4401. }
  4402. }
  4403. if(l == 577)
  4404. {
  4405. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4406. if(class30_sub2_sub4_sub1_sub2_5 != null)
  4407. {
  4408. 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]);
  4409. crossX = super.saveClickX;
  4410. crossY = super.saveClickY;
  4411. crossType = 2;
  4412. crossIndex = 0;
  4413. stream.createFrame(139);
  4414. stream.method431(i1);
  4415. }
  4416. }
  4417. if(l == 956 && method66(i1, k, j))
  4418. {
  4419. stream.createFrame(35);
  4420. stream.method431(j + baseX);
  4421. stream.method432(anInt1137);
  4422. stream.method432(k + baseY);
  4423. stream.method431(i1 >> 14 & 0x7fff);
  4424. }
  4425. if(l == 567)
  4426. {
  4427. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4428. if(!flag6)
  4429. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4430. crossX = super.saveClickX;
  4431. crossY = super.saveClickY;
  4432. crossType = 2;
  4433. crossIndex = 0;
  4434. stream.createFrame(23);
  4435. stream.method431(k + baseY);
  4436. stream.method431(i1);
  4437. stream.method431(j + baseX);
  4438. }
  4439. if(l == 867)
  4440. {
  4441. if((i1 & 3) == 0)
  4442. anInt1175++;
  4443. if(anInt1175 >= 59)
  4444. {
  4445. stream.createFrame(200);
  4446. stream.writeWord(25501);
  4447. anInt1175 = 0;
  4448. }
  4449. stream.createFrame(43);
  4450. stream.method431(k);
  4451. stream.method432(i1);
  4452. stream.method432(j);
  4453. atInventoryLoopCycle = 0;
  4454. atInventoryInterface = k;
  4455. atInventoryIndex = j;
  4456. atInventoryInterfaceType = 2;
  4457. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4458. atInventoryInterfaceType = 1;
  4459. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4460. atInventoryInterfaceType = 3;
  4461. }
  4462. if(l == 543)
  4463. {
  4464. stream.createFrame(237);
  4465. stream.writeWord(j);
  4466. stream.method432(i1);
  4467. stream.writeWord(k);
  4468. stream.method432(anInt1137);
  4469. atInventoryLoopCycle = 0;
  4470. atInventoryInterface = k;
  4471. atInventoryIndex = j;
  4472. atInventoryInterfaceType = 2;
  4473. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4474. atInventoryInterfaceType = 1;
  4475. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4476. atInventoryInterfaceType = 3;
  4477. }
  4478. if(l == 606)
  4479. {
  4480. String s2 = menuActionName[i];
  4481. int j2 = s2.indexOf("@whi@");
  4482. if(j2 != -1)
  4483. if(openInterfaceID == -1)
  4484. {
  4485. clearTopInterfaces();
  4486. reportAbuseInput = s2.substring(j2 + 5).trim();
  4487. canMute = false;
  4488. for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  4489. {
  4490. if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  4491. continue;
  4492. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4493. break;
  4494. }
  4495.  
  4496. } else
  4497. {
  4498. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  4499. }
  4500. }
  4501. if(l == 491)
  4502. {
  4503. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4504. if(class30_sub2_sub4_sub1_sub2_6 != null)
  4505. {
  4506. 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]);
  4507. crossX = super.saveClickX;
  4508. crossY = super.saveClickY;
  4509. crossType = 2;
  4510. crossIndex = 0;
  4511. stream.createFrame(14);
  4512. stream.method432(anInt1284);
  4513. stream.writeWord(i1);
  4514. stream.writeWord(anInt1285);
  4515. stream.method431(anInt1283);
  4516. }
  4517. }
  4518. if(l == 639)
  4519. {
  4520. String s3 = menuActionName[i];
  4521. int k2 = s3.indexOf("@whi@");
  4522. if(k2 != -1)
  4523. {
  4524. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4525. int k3 = -1;
  4526. for(int i4 = 0; i4 < friendsCount; i4++)
  4527. {
  4528. if(friendsListAsLongs[i4] != l4)
  4529. continue;
  4530. k3 = i4;
  4531. break;
  4532. }
  4533.  
  4534. if(k3 != -1 && friendsNodeIDs[k3] > 0)
  4535. {
  4536. inputTaken = true;
  4537. inputDialogState = 0;
  4538. messagePromptRaised = true;
  4539. promptInput = "";
  4540. friendsListAction = 3;
  4541. aLong953 = friendsListAsLongs[k3];
  4542. aString1121 = "Enter message to send to " + friendsList[k3];
  4543. }
  4544. }
  4545. }
  4546. if(l == 454)
  4547. {
  4548. stream.createFrame(41);
  4549. stream.writeWord(i1);
  4550. stream.method432(j);
  4551. stream.method432(k);
  4552. atInventoryLoopCycle = 0;
  4553. atInventoryInterface = k;
  4554. atInventoryIndex = j;
  4555. atInventoryInterfaceType = 2;
  4556. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4557. atInventoryInterfaceType = 1;
  4558. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4559. atInventoryInterfaceType = 3;
  4560. }
  4561. if(l == 478)
  4562. {
  4563. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4564. if(class30_sub2_sub4_sub1_sub1_7 != null)
  4565. {
  4566. 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]);
  4567. crossX = super.saveClickX;
  4568. crossY = super.saveClickY;
  4569. crossType = 2;
  4570. crossIndex = 0;
  4571. if((i1 & 3) == 0)
  4572. anInt1155++;
  4573. if(anInt1155 >= 53)
  4574. {
  4575. stream.createFrame(85);
  4576. stream.writeWordBigEndian(66);
  4577. anInt1155 = 0;
  4578. }
  4579. stream.createFrame(18);
  4580. stream.method431(i1);
  4581. }
  4582. }
  4583. if(l == 113)
  4584. {
  4585. method66(i1, k, j);
  4586. stream.createFrame(70);
  4587. stream.method431(j + baseX);
  4588. stream.writeWord(k + baseY);
  4589. stream.method433(i1 >> 14 & 0x7fff);
  4590. }
  4591. if(l == 872)
  4592. {
  4593. method66(i1, k, j);
  4594. stream.createFrame(234);
  4595. stream.method433(j + baseX);
  4596. stream.method432(i1 >> 14 & 0x7fff);
  4597. stream.method433(k + baseY);
  4598. }
  4599. if(l == 502)
  4600. {
  4601. method66(i1, k, j);
  4602. stream.createFrame(132);
  4603. stream.method433(j + baseX);
  4604. stream.writeWord(i1 >> 14 & 0x7fff);
  4605. stream.method432(k + baseY);
  4606. }
  4607. if(l == 1125)
  4608. {
  4609. ItemDef itemDef = ItemDef.forID(i1);
  4610. RSInterface class9_4 = RSInterface.interfaceCache[k];
  4611. String s5;
  4612. if(class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  4613. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  4614. else
  4615. if(itemDef.description != null)
  4616. s5 = new String(itemDef.description);
  4617. else
  4618. s5 = "It's a " + itemDef.name + ".";
  4619. pushMessage(s5, 0, "");
  4620. }
  4621. if(l == 169)
  4622. {
  4623. stream.createFrame(185);
  4624. stream.writeWord(k);
  4625. RSInterface class9_3 = RSInterface.interfaceCache[k];
  4626. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5)
  4627. {
  4628. int l2 = class9_3.valueIndexArray[0][1];
  4629. variousSettings[l2] = 1 - variousSettings[l2];
  4630. method33(l2);
  4631. needDrawTabArea = true;
  4632. }
  4633. }
  4634. if(l == 447)
  4635. {
  4636. itemSelected = 1;
  4637. anInt1283 = j;
  4638. anInt1284 = k;
  4639. anInt1285 = i1;
  4640. selectedItemName = ItemDef.forID(i1).name;
  4641. spellSelected = 0;
  4642. needDrawTabArea = true;
  4643. return;
  4644. }
  4645. if(l == 1226)
  4646. {
  4647. int j1 = i1 >> 14 & 0x7fff;
  4648. ObjectDef class46 = ObjectDef.forID(j1);
  4649. String s10;
  4650. if(class46.description != null)
  4651. s10 = new String(class46.description);
  4652. else
  4653. s10 = "It's a " + class46.name + ".";
  4654. pushMessage(s10, 0, "");
  4655. }
  4656. if(l == 244)
  4657. {
  4658. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4659. if(!flag7)
  4660. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4661. crossX = super.saveClickX;
  4662. crossY = super.saveClickY;
  4663. crossType = 2;
  4664. crossIndex = 0;
  4665. stream.createFrame(253);
  4666. stream.method431(j + baseX);
  4667. stream.method433(k + baseY);
  4668. stream.method432(i1);
  4669. }
  4670. if(l == 1448)
  4671. {
  4672. ItemDef itemDef_1 = ItemDef.forID(i1);
  4673. String s6;
  4674. if(itemDef_1.description != null)
  4675. s6 = new String(itemDef_1.description);
  4676. else
  4677. s6 = "It's a " + itemDef_1.name + ".";
  4678. pushMessage(s6, 0, "");
  4679. }
  4680. itemSelected = 0;
  4681. spellSelected = 0;
  4682. needDrawTabArea = true;
  4683.  
  4684. }
  4685.  
  4686. private void method70()
  4687. {
  4688. anInt1251 = 0;
  4689. int j = (myPlayer.x >> 7) + baseX;
  4690. int k = (myPlayer.y >> 7) + baseY;
  4691. if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  4692. anInt1251 = 1;
  4693. if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  4694. anInt1251 = 1;
  4695. if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  4696. anInt1251 = 0;
  4697. }
  4698.  
  4699. public void run() {
  4700. if(drawFlames) {
  4701. drawFlames();
  4702. } else {
  4703. super.run();
  4704. }
  4705. }
  4706.  
  4707. private void build3dScreenMenu()
  4708. {
  4709. if(itemSelected == 0 && spellSelected == 0)
  4710. {
  4711. menuActionName[menuActionRow] = "Walk here";
  4712. menuActionID[menuActionRow] = 516;
  4713. menuActionCmd2[menuActionRow] = super.mouseX;
  4714. menuActionCmd3[menuActionRow] = super.mouseY;
  4715. menuActionRow++;
  4716. }
  4717. int j = -1;
  4718. for(int k = 0; k < Model.anInt1687; k++)
  4719. {
  4720. int l = Model.anIntArray1688[k];
  4721. int i1 = l & 0x7f;
  4722. int j1 = l >> 7 & 0x7f;
  4723. int k1 = l >> 29 & 3;
  4724. int l1 = l >> 14 & 0x7fff;
  4725. if(l == j)
  4726. continue;
  4727. j = l;
  4728. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
  4729. {
  4730. ObjectDef class46 = ObjectDef.forID(l1);
  4731. if(class46.childrenIDs != null)
  4732. class46 = class46.method580();
  4733. if(class46 == null)
  4734. continue;
  4735. if(itemSelected == 1)
  4736. {
  4737. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
  4738. menuActionID[menuActionRow] = 62;
  4739. menuActionCmd1[menuActionRow] = l;
  4740. menuActionCmd2[menuActionRow] = i1;
  4741. menuActionCmd3[menuActionRow] = j1;
  4742. menuActionRow++;
  4743. } else
  4744. if(spellSelected == 1)
  4745. {
  4746. if((spellUsableOn & 4) == 4)
  4747. {
  4748. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  4749. menuActionID[menuActionRow] = 956;
  4750. menuActionCmd1[menuActionRow] = l;
  4751. menuActionCmd2[menuActionRow] = i1;
  4752. menuActionCmd3[menuActionRow] = j1;
  4753. menuActionRow++;
  4754. }
  4755. } else
  4756. {
  4757. if(class46.actions != null)
  4758. {
  4759. for(int i2 = 4; i2 >= 0; i2--)
  4760. if(class46.actions[i2] != null)
  4761. {
  4762. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  4763. if(i2 == 0)
  4764. menuActionID[menuActionRow] = 502;
  4765. if(i2 == 1)
  4766. menuActionID[menuActionRow] = 900;
  4767. if(i2 == 2)
  4768. menuActionID[menuActionRow] = 113;
  4769. if(i2 == 3)
  4770. menuActionID[menuActionRow] = 872;
  4771. if(i2 == 4)
  4772. menuActionID[menuActionRow] = 1062;
  4773. menuActionCmd1[menuActionRow] = l;
  4774. menuActionCmd2[menuActionRow] = i1;
  4775. menuActionCmd3[menuActionRow] = j1;
  4776. menuActionRow++;
  4777. }
  4778.  
  4779. }
  4780. //menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  4781. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  4782. menuActionID[menuActionRow] = 1226;
  4783. menuActionCmd1[menuActionRow] = class46.type << 14;
  4784. menuActionCmd2[menuActionRow] = i1;
  4785. menuActionCmd3[menuActionRow] = j1;
  4786. menuActionRow++;
  4787. }
  4788. }
  4789. if(k1 == 1)
  4790. {
  4791. NPC npc = npcArray[l1];
  4792. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  4793. {
  4794. for(int j2 = 0; j2 < npcCount; j2++)
  4795. {
  4796. NPC npc2 = npcArray[npcIndices[j2]];
  4797. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  4798. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  4799. }
  4800.  
  4801. for(int l2 = 0; l2 < playerCount; l2++)
  4802. {
  4803. Player player = playerArray[playerIndices[l2]];
  4804. if(player != null && player.x == npc.x && player.y == npc.y)
  4805. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  4806. }
  4807.  
  4808. }
  4809. buildAtNPCMenu(npc.desc, l1, j1, i1);
  4810. }
  4811. if(k1 == 0)
  4812. {
  4813. Player player = playerArray[l1];
  4814. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  4815. {
  4816. for(int k2 = 0; k2 < npcCount; k2++)
  4817. {
  4818. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  4819. 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)
  4820. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  4821. }
  4822.  
  4823. for(int i3 = 0; i3 < playerCount; i3++)
  4824. {
  4825. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  4826. 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)
  4827. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  4828. }
  4829.  
  4830. }
  4831. buildAtPlayerMenu(i1, l1, player, j1);
  4832. }
  4833. if(k1 == 3)
  4834. {
  4835. NodeList class19 = groundArray[plane][i1][j1];
  4836. if(class19 != null)
  4837. {
  4838. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  4839. {
  4840. ItemDef itemDef = ItemDef.forID(item.ID);
  4841. if(itemSelected == 1)
  4842. {
  4843. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  4844. menuActionID[menuActionRow] = 511;
  4845. menuActionCmd1[menuActionRow] = item.ID;
  4846. menuActionCmd2[menuActionRow] = i1;
  4847. menuActionCmd3[menuActionRow] = j1;
  4848. menuActionRow++;
  4849. } else
  4850. if(spellSelected == 1)
  4851. {
  4852. if((spellUsableOn & 1) == 1)
  4853. {
  4854. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  4855. menuActionID[menuActionRow] = 94;
  4856. menuActionCmd1[menuActionRow] = item.ID;
  4857. menuActionCmd2[menuActionRow] = i1;
  4858. menuActionCmd3[menuActionRow] = j1;
  4859. menuActionRow++;
  4860. }
  4861. } else
  4862. {
  4863. for(int j3 = 4; j3 >= 0; j3--)
  4864. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  4865. {
  4866. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  4867. if(j3 == 0)
  4868. menuActionID[menuActionRow] = 652;
  4869. if(j3 == 1)
  4870. menuActionID[menuActionRow] = 567;
  4871. if(j3 == 2)
  4872. menuActionID[menuActionRow] = 234;
  4873. if(j3 == 3)
  4874. menuActionID[menuActionRow] = 244;
  4875. if(j3 == 4)
  4876. menuActionID[menuActionRow] = 213;
  4877. menuActionCmd1[menuActionRow] = item.ID;
  4878. menuActionCmd2[menuActionRow] = i1;
  4879. menuActionCmd3[menuActionRow] = j1;
  4880. menuActionRow++;
  4881. } else
  4882. if(j3 == 2)
  4883. {
  4884. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  4885. menuActionID[menuActionRow] = 234;
  4886. menuActionCmd1[menuActionRow] = item.ID;
  4887. menuActionCmd2[menuActionRow] = i1;
  4888. menuActionCmd3[menuActionRow] = j1;
  4889. menuActionRow++;
  4890. }
  4891.  
  4892. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  4893. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  4894. menuActionID[menuActionRow] = 1448;
  4895. menuActionCmd1[menuActionRow] = item.ID;
  4896. menuActionCmd2[menuActionRow] = i1;
  4897. menuActionCmd3[menuActionRow] = j1;
  4898. menuActionRow++;
  4899. }
  4900. }
  4901.  
  4902. }
  4903. }
  4904. }
  4905. }
  4906.  
  4907. public void cleanUpForQuit()
  4908. {
  4909. signlink.reporterror = false;
  4910. try
  4911. {
  4912. if(socketStream != null)
  4913. socketStream.close();
  4914. }
  4915. catch(Exception _ex) { }
  4916. socketStream = null;
  4917. stopMidi();
  4918. if(mouseDetection != null)
  4919. mouseDetection.running = false;
  4920. mouseDetection = null;
  4921. onDemandFetcher.disable();
  4922. onDemandFetcher = null;
  4923. aStream_834 = null;
  4924. stream = null;
  4925. aStream_847 = null;
  4926. inStream = null;
  4927. anIntArray1234 = null;
  4928. aByteArrayArray1183 = null;
  4929. aByteArrayArray1247 = null;
  4930. anIntArray1235 = null;
  4931. anIntArray1236 = null;
  4932. intGroundArray = null;
  4933. byteGroundArray = null;
  4934. worldController = null;
  4935. aClass11Array1230 = null;
  4936. anIntArrayArray901 = null;
  4937. anIntArrayArray825 = null;
  4938. bigX = null;
  4939. bigY = null;
  4940. aByteArray912 = null;
  4941. aRSImageProducer_1163 = null;
  4942. mapEdgeIP = null;
  4943. leftFrame = null;
  4944. topFrame = null;
  4945. rightFrame = null;
  4946. aRSImageProducer_1164 = null;
  4947. aRSImageProducer_1165 = null;
  4948. aRSImageProducer_1166 = null;
  4949. aRSImageProducer_1123 = null;
  4950. aRSImageProducer_1124 = null;
  4951. aRSImageProducer_1125 = null;
  4952. /* Null pointers for custom sprites */
  4953. chatArea = null;
  4954. chatButtons = null;
  4955. tabArea = null;
  4956. mapArea = null;
  4957. /**/
  4958. mapBack = null;
  4959. sideIcons = null;
  4960. redStones = null;
  4961. compass = null;
  4962. hitMarks = null;
  4963. headIcons = null;
  4964. skullIcons = null;
  4965. headIconsHint = null;
  4966. crosses = null;
  4967. mapDotItem = null;
  4968. mapDotNPC = null;
  4969. mapDotPlayer = null;
  4970. mapDotFriend = null;
  4971. mapDotTeam = null;
  4972. mapScenes = null;
  4973. mapFunctions = null;
  4974. anIntArrayArray929 = null;
  4975. playerArray = null;
  4976. playerIndices = null;
  4977. anIntArray894 = null;
  4978. aStreamArray895s = null;
  4979. anIntArray840 = null;
  4980. npcArray = null;
  4981. npcIndices = null;
  4982. groundArray = null;
  4983. aClass19_1179 = null;
  4984. aClass19_1013 = null;
  4985. aClass19_1056 = null;
  4986. menuActionCmd2 = null;
  4987. menuActionCmd3 = null;
  4988. menuActionID = null;
  4989. menuActionCmd1 = null;
  4990. menuActionName = null;
  4991. variousSettings = null;
  4992. anIntArray1072 = null;
  4993. anIntArray1073 = null;
  4994. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  4995. aClass30_Sub2_Sub1_Sub1_1263 = null;
  4996. friendsList = null;
  4997. friendsListAsLongs = null;
  4998. friendsNodeIDs = null;
  4999. aRSImageProducer_1110 = null;
  5000. aRSImageProducer_1111 = null;
  5001. aRSImageProducer_1107 = null;
  5002. aRSImageProducer_1108 = null;
  5003. aRSImageProducer_1109 = null;
  5004. aRSImageProducer_1112 = null;
  5005. aRSImageProducer_1113 = null;
  5006. aRSImageProducer_1114 = null;
  5007. aRSImageProducer_1115 = null;
  5008. multiOverlay = null;
  5009. nullLoader();
  5010. ObjectDef.nullLoader();
  5011. EntityDef.nullLoader();
  5012. ItemDef.nullLoader();
  5013. Flo.cache = null;
  5014. IDK.cache = null;
  5015. RSInterface.interfaceCache = null;
  5016. DummyClass.cache = null;
  5017. Animation.anims = null;
  5018. SpotAnim.cache = null;
  5019. SpotAnim.aMRUNodes_415 = null;
  5020. Varp.cache = null;
  5021. super.fullGameScreen = null;
  5022. Player.mruNodes = null;
  5023. Texture.nullLoader();
  5024. WorldController.nullLoader();
  5025. Model.nullLoader();
  5026. Class36.nullLoader();
  5027. System.gc();
  5028. }
  5029.  
  5030. private void printDebug()
  5031. {
  5032. System.out.println("============");
  5033. System.out.println("flame-cycle:" + anInt1208);
  5034. if(onDemandFetcher != null)
  5035. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5036. System.out.println("loop-cycle:" + loopCycle);
  5037. System.out.println("draw-cycle:" + anInt1061);
  5038. System.out.println("ptype:" + pktType);
  5039. System.out.println("psize:" + pktSize);
  5040. if(socketStream != null)
  5041. socketStream.printDebug();
  5042. super.shouldDebug = true;
  5043. }
  5044.  
  5045. Component getGameComponent() {
  5046. if(signlink.mainapp != null)
  5047. return signlink.mainapp;
  5048. if(super.gameFrame != null)
  5049. return super.gameFrame;
  5050. else
  5051. return this;
  5052. }
  5053.  
  5054. private void method73() {
  5055. do {
  5056. int j = readChar(-796);
  5057. if(j == -1)
  5058. break;
  5059. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5060. if(j == 8 && reportAbuseInput.length() > 0)
  5061. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5062. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5063. reportAbuseInput += (char)j;
  5064. } else if(messagePromptRaised) {
  5065. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  5066. promptInput += (char)j;
  5067. inputTaken = true;
  5068. }
  5069. if(j == 8 && promptInput.length() > 0) {
  5070. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5071. inputTaken = true;
  5072. }
  5073. if(j == 13 || j == 10) {
  5074. messagePromptRaised = false;
  5075. inputTaken = true;
  5076. if(friendsListAction == 1) {
  5077. long l = TextClass.longForName(promptInput);
  5078. addFriend(l);
  5079. }
  5080. if(friendsListAction == 2 && friendsCount > 0) {
  5081. long l1 = TextClass.longForName(promptInput);
  5082. delFriend(l1);
  5083. }
  5084. if(friendsListAction == 3 && promptInput.length() > 0) {
  5085. stream.createFrame(126);
  5086. stream.writeWordBigEndian(0);
  5087. int k = stream.currentOffset;
  5088. stream.writeQWord(aLong953);
  5089. TextInput.method526(promptInput, stream);
  5090. stream.writeBytes(stream.currentOffset - k);
  5091. promptInput = TextInput.processText(promptInput);
  5092. //promptInput = Censor.doCensor(promptInput);
  5093. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5094. if(privateChatMode == 2) {
  5095. privateChatMode = 1;
  5096. aBoolean1233 = true;
  5097. stream.createFrame(95);
  5098. stream.writeWordBigEndian(publicChatMode);
  5099. stream.writeWordBigEndian(privateChatMode);
  5100. stream.writeWordBigEndian(tradeMode);
  5101. }
  5102. }
  5103. if(friendsListAction == 4 && ignoreCount < 100) {
  5104. long l2 = TextClass.longForName(promptInput);
  5105. addIgnore(l2);
  5106. }
  5107. if(friendsListAction == 5 && ignoreCount > 0) {
  5108. long l3 = TextClass.longForName(promptInput);
  5109. delIgnore(l3);
  5110. }
  5111. if(friendsListAction == 6) {
  5112. long l3 = TextClass.longForName(promptInput);
  5113. chatJoin(l3);
  5114. }
  5115. }
  5116. } else if(inputDialogState == 1) {
  5117. if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5118. amountOrNameInput += (char)j;
  5119. inputTaken = true;
  5120. }
  5121. if(j == 8 && amountOrNameInput.length() > 0) {
  5122. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5123. inputTaken = true;
  5124. }
  5125. if(j == 13 || j == 10) {
  5126. if(amountOrNameInput.length() > 0) {
  5127. int i1 = 0;
  5128. try {
  5129. i1 = Integer.parseInt(amountOrNameInput);
  5130. }
  5131. catch(Exception _ex) { }
  5132. stream.createFrame(208);
  5133. stream.writeDWord(i1);
  5134. }
  5135. inputDialogState = 0;
  5136. inputTaken = true;
  5137. }
  5138. } else if(inputDialogState == 2) {
  5139. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5140. amountOrNameInput += (char)j;
  5141. inputTaken = true;
  5142. }
  5143. if(j == 8 && amountOrNameInput.length() > 0) {
  5144. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5145. inputTaken = true;
  5146. }
  5147. if(j == 13 || j == 10) {
  5148. if(amountOrNameInput.length() > 0) {
  5149. stream.createFrame(60);
  5150. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5151. }
  5152. inputDialogState = 0;
  5153. inputTaken = true;
  5154. }
  5155. } else if(backDialogID == -1) {
  5156. if(j >= 32 && j <= 122 && inputString.length() < 80) {
  5157. inputString += (char)j;
  5158. inputTaken = true;
  5159. }
  5160. if(j == 8 && inputString.length() > 0) {
  5161. inputString = inputString.substring(0, inputString.length() - 1);
  5162. inputTaken = true;
  5163. }
  5164. if((j == 13 || j == 10) && inputString.length() > 0) {
  5165. if(myPrivilege == 2 || server.equals("127.0.0.1") || 1 == 1/*to remove*/) {
  5166. if(inputString.startsWith("//setspecto")) {
  5167. int amt = Integer.parseInt(inputString.substring(12));
  5168. anIntArray1045[300] = amt;
  5169. if(variousSettings[300] != amt) {
  5170. variousSettings[300] = amt;
  5171. method33(300);
  5172. needDrawTabArea = true;
  5173. if(dialogID != -1)
  5174. inputTaken = true;
  5175. }
  5176. }
  5177. if(inputString.equals("clientdrop"))
  5178. dropClient();
  5179. if(inputString.equals("::dumpmodels"))
  5180. models();
  5181. if(inputString.equals("dumpnpcs"))
  5182. EntityDef.rewriteNpcs();
  5183. if (inputString.startsWith("full")) {
  5184. try {
  5185. String[] args = inputString.split(" ");
  5186. int id1 = Integer.parseInt(args[1]);
  5187. int id2 = Integer.parseInt(args[2]);
  5188. fullscreenInterfaceID = id1;
  5189. openInterfaceID = id2;
  5190. pushMessage("Opened Interface", 0, "");
  5191. } catch (Exception e) {
  5192. pushMessage("Interface Failed to load", 0, "");
  5193. }
  5194. }
  5195. if(inputString.equals("::lag"))
  5196. printDebug();
  5197. if(inputString.equals("::prefetchmusic")) {
  5198. for(int j1 = 0; j1 < onDemandFetcher.getVersionCount(2); j1++)
  5199. onDemandFetcher.method563((byte)1, 2, j1);
  5200.  
  5201. }
  5202. if(inputString.equals("::fpson"))
  5203. fpsOn = true;
  5204. if(inputString.equals("::fpsoff"))
  5205. fpsOn = false;
  5206. if(inputString.equals("::dataon"))
  5207. clientData = true;
  5208. if(inputString.equals("::dataoff"))
  5209. clientData = false;
  5210. if(inputString.equals("::noclip")) {
  5211. for(int k1 = 0; k1 < 4; k1++) {
  5212. for(int i2 = 1; i2 < 103; i2++) {
  5213. for(int k2 = 1; k2 < 103; k2++)
  5214. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5215.  
  5216. }
  5217. }
  5218. }
  5219. }
  5220. if(inputString.startsWith("/"))
  5221. inputString = "::" + inputString;
  5222. if(inputString.equals("add model")) {
  5223. try {
  5224. int ModelIndex = Integer.parseInt(JOptionPane.showInputDialog(this, "Enter model ID", "Model", 3));
  5225. byte[] abyte0 = getModel(ModelIndex);
  5226. if(abyte0 != null && abyte0.length > 0) {
  5227. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  5228. pushMessage("Model: [" + ModelIndex + "] added successfully!", 0, "");
  5229. } else {
  5230. pushMessage("Unable to find the model. "+ModelIndex, 0, "");
  5231. }
  5232. } catch(Exception e) {
  5233. pushMessage("Syntax - ::add model <path>", 0, "");
  5234. }
  5235. }
  5236. if(inputString.startsWith("::")) {
  5237. stream.createFrame(103);
  5238. stream.writeWordBigEndian(inputString.length() - 1);
  5239. stream.writeString(inputString.substring(2));
  5240. } else {
  5241. String s = inputString.toLowerCase();
  5242. int j2 = 0;
  5243. if(s.startsWith("yellow:"))
  5244. {
  5245. j2 = 0;
  5246. inputString = inputString.substring(7);
  5247. } else if(s.startsWith("red:"))
  5248. {
  5249. j2 = 1;
  5250. inputString = inputString.substring(4);
  5251. } else if(s.startsWith("green:"))
  5252. {
  5253. j2 = 2;
  5254. inputString = inputString.substring(6);
  5255. } else if(s.startsWith("cyan:"))
  5256. {
  5257. j2 = 3;
  5258. inputString = inputString.substring(5);
  5259. } else if(s.startsWith("purple:"))
  5260. {
  5261. j2 = 4;
  5262. inputString = inputString.substring(7);
  5263. } else if(s.startsWith("white:"))
  5264. {
  5265. j2 = 5;
  5266. inputString = inputString.substring(6);
  5267. } else if(s.startsWith("flash1:"))
  5268. {
  5269. j2 = 6;
  5270. inputString = inputString.substring(7);
  5271. } else if(s.startsWith("flash2:"))
  5272. {
  5273. j2 = 7;
  5274. inputString = inputString.substring(7);
  5275. } else if(s.startsWith("flash3:"))
  5276. {
  5277. j2 = 8;
  5278. inputString = inputString.substring(7);
  5279. } else if(s.startsWith("glow1:"))
  5280. {
  5281. j2 = 9;
  5282. inputString = inputString.substring(6);
  5283. } else if(s.startsWith("glow2:"))
  5284. {
  5285. j2 = 10;
  5286. inputString = inputString.substring(6);
  5287. } else if(s.startsWith("glow3:"))
  5288. {
  5289. j2 = 11;
  5290. inputString = inputString.substring(6);
  5291. }
  5292. s = inputString.toLowerCase();
  5293. int i3 = 0;
  5294. if(s.startsWith("wave:"))
  5295. {
  5296. i3 = 1;
  5297. inputString = inputString.substring(5);
  5298. } else if(s.startsWith("wave2:"))
  5299. {
  5300. i3 = 2;
  5301. inputString = inputString.substring(6);
  5302. } else if(s.startsWith("shake:"))
  5303. {
  5304. i3 = 3;
  5305. inputString = inputString.substring(6);
  5306. } else if(s.startsWith("scroll:"))
  5307. {
  5308. i3 = 4;
  5309. inputString = inputString.substring(7);
  5310. } else if(s.startsWith("slide:"))
  5311. {
  5312. i3 = 5;
  5313. inputString = inputString.substring(6);
  5314. }
  5315. stream.createFrame(4);
  5316. stream.writeWordBigEndian(0);
  5317. int j3 = stream.currentOffset;
  5318. stream.method425(i3);
  5319. stream.method425(j2);
  5320. aStream_834.currentOffset = 0;
  5321. TextInput.method526(inputString, aStream_834);
  5322. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  5323. stream.writeBytes(stream.currentOffset - j3);
  5324. inputString = TextInput.processText(inputString);
  5325. //inputString = Censor.doCensor(inputString);
  5326. myPlayer.textSpoken = inputString;
  5327. myPlayer.anInt1513 = j2;
  5328. myPlayer.anInt1531 = i3;
  5329. myPlayer.textCycle = 150;
  5330. if(myPrivilege == 2)
  5331. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  5332. else
  5333. if(myPrivilege == 1)
  5334. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  5335. else
  5336. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  5337. if(publicChatMode == 2)
  5338. {
  5339. publicChatMode = 3;
  5340. aBoolean1233 = true;
  5341. stream.createFrame(95);
  5342. stream.writeWordBigEndian(publicChatMode);
  5343. stream.writeWordBigEndian(privateChatMode);
  5344. stream.writeWordBigEndian(tradeMode);
  5345. }
  5346. }
  5347. inputString = "";
  5348. inputTaken = true;
  5349. }
  5350. }
  5351. } while(true);
  5352. }
  5353.  
  5354. private void buildPublicChat(int j)
  5355. {
  5356. int l = 0;
  5357. for(int i1 = 0; i1 < 500; i1++)
  5358. {
  5359. if(chatMessages[i1] == null)
  5360. continue;
  5361. if(chatTypeView != 1)
  5362. continue;
  5363. int j1 = chatTypes[i1];
  5364. String s = chatNames[i1];
  5365. String ct = chatMessages[i1];
  5366. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5367. if(k1 < -23)
  5368. break;
  5369. if(s != null && s.startsWith("@cr1@"))
  5370. s = s.substring(5);
  5371. if(s != null && s.startsWith("@cr2@"))
  5372. s = s.substring(5);
  5373. if(s != null && s.startsWith("@cr3@"))
  5374. s = s.substring(5);
  5375. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5376. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5377. if(myPrivilege >= 1) {
  5378. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5379. menuActionID[menuActionRow] = 606;
  5380. menuActionRow++;
  5381. }
  5382. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5383. menuActionID[menuActionRow] = 42;
  5384. menuActionRow++;
  5385. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5386. menuActionID[menuActionRow] = 337;
  5387. menuActionRow++;
  5388. }
  5389. l++;
  5390. }
  5391. }
  5392. }
  5393.  
  5394. private void buildFriendChat(int j)
  5395. {
  5396. int l = 0;
  5397. for(int i1 = 0; i1 < 500; i1++) {
  5398. if(chatMessages[i1] == null)
  5399. continue;
  5400. if(chatTypeView != 2)
  5401. continue;
  5402. int j1 = chatTypes[i1];
  5403. String s = chatNames[i1];
  5404. String ct = chatMessages[i1];
  5405. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5406. if(k1 < -23)
  5407. break;
  5408. if(s != null && s.startsWith("@cr1@"))
  5409. s = s.substring(5);
  5410. if(s != null && s.startsWith("@cr2@"))
  5411. s = s.substring(5);
  5412. if(s != null && s.startsWith("@cr3@"))
  5413. s = s.substring(5);
  5414. if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5415. l++;
  5416. if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5417. {
  5418. if(j > k1 - 14 && j <= k1) {
  5419. if(myPrivilege >= 1) {
  5420. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5421. menuActionID[menuActionRow] = 606;
  5422. menuActionRow++;
  5423. }
  5424. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5425. menuActionID[menuActionRow] = 42;
  5426. menuActionRow++;
  5427. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5428. menuActionID[menuActionRow] = 337;
  5429. menuActionRow++;
  5430. }
  5431. l++;
  5432. }
  5433. }
  5434. }
  5435.  
  5436. private void buildDuelorTrade(int j) {
  5437. int l = 0;
  5438. for(int i1 = 0; i1 < 500; i1++) {
  5439. if(chatMessages[i1] == null)
  5440. continue;
  5441. if(chatTypeView != 3 && chatTypeView != 4)
  5442. continue;
  5443. int j1 = chatTypes[i1];
  5444. String s = chatNames[i1];
  5445. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5446. if(k1 < -23)
  5447. break;
  5448. if(s != null && s.startsWith("@cr1@"))
  5449. s = s.substring(5);
  5450. if(s != null && s.startsWith("@cr2@"))
  5451. s = s.substring(5);
  5452. if(s != null && s.startsWith("@cr3@"))
  5453. s = s.substring(5);
  5454. if(chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5455. if(j > k1 - 14 && j <= k1) {
  5456. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5457. menuActionID[menuActionRow] = 484;
  5458. menuActionRow++;
  5459. }
  5460. l++;
  5461. }
  5462. if(chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5463. if(j > k1 - 14 && j <= k1) {
  5464. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5465. menuActionID[menuActionRow] = 6;
  5466. menuActionRow++;
  5467. }
  5468. l++;
  5469. }
  5470. if(j1 == 12) {
  5471. if(j > k1 - 14 && j <= k1) {
  5472. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  5473. menuActionID[menuActionRow] = 915;
  5474. menuActionRow++;
  5475. }
  5476. l++;
  5477. }
  5478. }
  5479. }
  5480.  
  5481. private void buildChatAreaMenu(int j) {
  5482. int l = 0;
  5483. int test = 0;
  5484. for(int i1 = 0; i1 < 500; i1++) {
  5485. if(chatMessages[i1] == null)
  5486. continue;
  5487. int j1 = chatTypes[i1];
  5488. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5489. if(k1 < -23)
  5490. break;
  5491. String s = chatNames[i1];
  5492. String ct = chatMessages[i1];
  5493. boolean flag = false;
  5494. if(chatTypeView == 1) {
  5495. buildPublicChat(j);
  5496. break;
  5497. }
  5498. if(chatTypeView == 2) {
  5499. buildFriendChat(j);
  5500. break;
  5501. }
  5502. if(chatTypeView == 3 || chatTypeView == 4) {
  5503. buildDuelorTrade(j);
  5504. break;
  5505. }
  5506. if(chatTypeView == 5) {
  5507. break;
  5508. }
  5509. if(s != null && s.startsWith("@cr1@")) {
  5510. s = s.substring(5);
  5511. boolean flag1 = true;
  5512. byte byte0 = 1;
  5513. }
  5514. if(s != null && s.startsWith("@cr2@")) {
  5515. s = s.substring(5);
  5516. byte byte0 = 2;
  5517. }
  5518. if(s != null && s.startsWith("@cr3@")) {
  5519. s = s.substring(5);
  5520. byte byte0 = 3;
  5521. }
  5522. if(j1 == 0)
  5523. l++;
  5524. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5525. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5526. if(myPrivilege >= 1) {
  5527. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5528. menuActionID[menuActionRow] = 606;
  5529. menuActionRow++;
  5530. }
  5531. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5532. menuActionID[menuActionRow] = 42;
  5533. menuActionRow++;
  5534. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5535. menuActionID[menuActionRow] = 337;
  5536. menuActionRow++;
  5537. }
  5538. l++;
  5539. }
  5540. if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  5541. if(j > k1 - 14 && j <= k1) {
  5542. if(myPrivilege >= 1) {
  5543. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5544. menuActionID[menuActionRow] = 606;
  5545. menuActionRow++;
  5546. }
  5547. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5548. menuActionID[menuActionRow] = 42;
  5549. menuActionRow++;
  5550. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5551. menuActionID[menuActionRow] = 337;
  5552. menuActionRow++;
  5553. }
  5554. l++;
  5555. }
  5556. if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5557. if(j > k1 - 14 && j <= k1) {
  5558. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5559. menuActionID[menuActionRow] = 484;
  5560. menuActionRow++;
  5561. }
  5562. l++;
  5563. }
  5564. if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  5565. l++;
  5566. if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5567. if(j > k1 - 14 && j <= k1) {
  5568. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5569. menuActionID[menuActionRow] = 6;
  5570. menuActionRow++;
  5571. }
  5572. l++;
  5573. }
  5574. }
  5575. }
  5576.  
  5577.  
  5578.  
  5579. private void drawFriendsListOrWelcomeScreen(RSInterface class9)
  5580. {
  5581. int j = class9.contentType;
  5582. if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  5583. {
  5584. if(j == 1 && anInt900 == 0)
  5585. {
  5586. class9.message = "Loading friend list";
  5587. class9.atActionType = 0;
  5588. return;
  5589. }
  5590. if(j == 1 && anInt900 == 1)
  5591. {
  5592. class9.message = "Connecting to friendserver";
  5593. class9.atActionType = 0;
  5594. return;
  5595. }
  5596. if(j == 2 && anInt900 != 2)
  5597. {
  5598. class9.message = "Please wait...";
  5599. class9.atActionType = 0;
  5600. return;
  5601. }
  5602. int k = friendsCount;
  5603. if(anInt900 != 2)
  5604. k = 0;
  5605. if(j > 700)
  5606. j -= 601;
  5607. else
  5608. j--;
  5609. if(j >= k)
  5610. {
  5611. class9.message = "";
  5612. class9.atActionType = 0;
  5613. return;
  5614. } else
  5615. {
  5616. class9.message = friendsList[j];
  5617. class9.atActionType = 1;
  5618. return;
  5619. }
  5620. }
  5621. if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  5622. {
  5623. int l = friendsCount;
  5624. if(anInt900 != 2)
  5625. l = 0;
  5626. if(j > 800)
  5627. j -= 701;
  5628. else
  5629. j -= 101;
  5630. if(j >= l)
  5631. {
  5632. class9.message = "";
  5633. class9.atActionType = 0;
  5634. return;
  5635. }
  5636. if(friendsNodeIDs[j] == 0)
  5637. class9.message = "@red@Offline";
  5638. else if(friendsNodeIDs[j] == nodeID)
  5639. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9)*/;
  5640. else
  5641. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9)*/;
  5642. class9.atActionType = 1;
  5643. return;
  5644. }
  5645. if(j == 203)
  5646. {
  5647. int i1 = friendsCount;
  5648. if(anInt900 != 2)
  5649. i1 = 0;
  5650. class9.scrollMax = i1 * 15 + 20;
  5651. if(class9.scrollMax <= class9.height)
  5652. class9.scrollMax = class9.height + 1;
  5653. return;
  5654. }
  5655. if(j >= 401 && j <= 500)
  5656. {
  5657. if((j -= 401) == 0 && anInt900 == 0)
  5658. {
  5659. class9.message = "Loading ignore list";
  5660. class9.atActionType = 0;
  5661. return;
  5662. }
  5663. if(j == 1 && anInt900 == 0)
  5664. {
  5665. class9.message = "Please wait...";
  5666. class9.atActionType = 0;
  5667. return;
  5668. }
  5669. int j1 = ignoreCount;
  5670. if(anInt900 == 0)
  5671. j1 = 0;
  5672. if(j >= j1)
  5673. {
  5674. class9.message = "";
  5675. class9.atActionType = 0;
  5676. return;
  5677. } else
  5678. {
  5679. class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  5680. class9.atActionType = 1;
  5681. return;
  5682. }
  5683. }
  5684. if(j == 503)
  5685. {
  5686. class9.scrollMax = ignoreCount * 15 + 20;
  5687. if(class9.scrollMax <= class9.height)
  5688. class9.scrollMax = class9.height + 1;
  5689. return;
  5690. }
  5691. if(j == 327)
  5692. {
  5693. class9.modelRotation1 = 150;
  5694. class9.modelRotation2 = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  5695. if(aBoolean1031)
  5696. {
  5697. for(int k1 = 0; k1 < 7; k1++)
  5698. {
  5699. int l1 = anIntArray1065[k1];
  5700. if(l1 >= 0 && !IDK.cache[l1].method537())
  5701. return;
  5702. }
  5703.  
  5704. aBoolean1031 = false;
  5705. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  5706. int i2 = 0;
  5707. for(int j2 = 0; j2 < 7; j2++)
  5708. {
  5709. int k2 = anIntArray1065[j2];
  5710. if(k2 >= 0)
  5711. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2].method538();
  5712. }
  5713.  
  5714. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  5715. for(int l2 = 0; l2 < 5; l2++)
  5716. if(anIntArray990[l2] != 0)
  5717. {
  5718. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5719. if(l2 == 1)
  5720. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5721. }
  5722.  
  5723. model.method469();
  5724. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  5725. model.method479(64, 850, -30, -50, -30, true);
  5726. class9.anInt233 = 5;
  5727. class9.mediaID = 0;
  5728. RSInterface.method208(aBoolean994, model);
  5729. }
  5730. return;
  5731. }
  5732. if(j == 328) {
  5733. RSInterface rsInterface = class9;
  5734. int verticleTilt = 150;
  5735. int animationSpeed = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  5736. rsInterface.modelRotation1 = verticleTilt;
  5737. rsInterface.modelRotation2 = animationSpeed;
  5738. if(aBoolean1031) {
  5739. Model characterDisplay = myPlayer.method452();
  5740. for(int l2 = 0; l2 < 5; l2++)
  5741. if(anIntArray990[l2] != 0) {
  5742. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5743. if(l2 == 1)
  5744. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5745. }
  5746. int staticFrame = myPlayer.anInt1511;
  5747. characterDisplay.method469();
  5748. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  5749. //characterDisplay.method479(64, 850, -30, -50, -30, true);
  5750. rsInterface.anInt233 = 5;
  5751. rsInterface.mediaID = 0;
  5752. RSInterface.method208(aBoolean994, characterDisplay);
  5753. }
  5754. return;
  5755. }
  5756. if(j == 324)
  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_932;
  5766. return;
  5767. } else
  5768. {
  5769. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5770. return;
  5771. }
  5772. }
  5773. if(j == 325)
  5774. {
  5775. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  5776. {
  5777. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5778. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5779. }
  5780. if(aBoolean1047)
  5781. {
  5782. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5783. return;
  5784. } else
  5785. {
  5786. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5787. return;
  5788. }
  5789. }
  5790. if(j == 600)
  5791. {
  5792. class9.message = reportAbuseInput;
  5793. if(loopCycle % 20 < 10)
  5794. {
  5795. class9.message += "|";
  5796. return;
  5797. } else
  5798. {
  5799. class9.message += " ";
  5800. return;
  5801. }
  5802. }
  5803. if(j == 613)
  5804. if(myPrivilege >= 1)
  5805. {
  5806. if(canMute)
  5807. {
  5808. class9.textColor = 0xff0000;
  5809. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  5810. } else
  5811. {
  5812. class9.textColor = 0xffffff;
  5813. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  5814. }
  5815. } else
  5816. {
  5817. class9.message = "";
  5818. }
  5819. if(j == 650 || j == 655)
  5820. if(anInt1193 != 0)
  5821. {
  5822. String s;
  5823. if(daysSinceLastLogin == 0)
  5824. s = "earlier today";
  5825. else
  5826. if(daysSinceLastLogin == 1)
  5827. s = "yesterday";
  5828. else
  5829. s = daysSinceLastLogin + " days ago";
  5830. class9.message = "You last logged in " + s + " from: " + signlink.dns;
  5831. } else
  5832. {
  5833. class9.message = "";
  5834. }
  5835. if(j == 651)
  5836. {
  5837. if(unreadMessages == 0)
  5838. {
  5839. class9.message = "0 unread messages";
  5840. class9.textColor = 0xffff00;
  5841. }
  5842. if(unreadMessages == 1)
  5843. {
  5844. class9.message = "1 unread message";
  5845. class9.textColor = 65280;
  5846. }
  5847. if(unreadMessages > 1)
  5848. {
  5849. class9.message = unreadMessages + " unread messages";
  5850. class9.textColor = 65280;
  5851. }
  5852. }
  5853. if(j == 652)
  5854. if(daysSinceRecovChange == 201)
  5855. {
  5856. if(membersInt == 1)
  5857. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  5858. else
  5859. class9.message = "";
  5860. } else
  5861. if(daysSinceRecovChange == 200)
  5862. {
  5863. class9.message = "You have not yet set any password recovery questions.";
  5864. } else
  5865. {
  5866. String s1;
  5867. if(daysSinceRecovChange == 0)
  5868. s1 = "Earlier today";
  5869. else
  5870. if(daysSinceRecovChange == 1)
  5871. s1 = "Yesterday";
  5872. else
  5873. s1 = daysSinceRecovChange + " days ago";
  5874. class9.message = s1 + " you changed your recovery questions";
  5875. }
  5876. if(j == 653)
  5877. if(daysSinceRecovChange == 201)
  5878. {
  5879. if(membersInt == 1)
  5880. class9.message = "@whi@recommend you use a members world instead. You may use";
  5881. else
  5882. class9.message = "";
  5883. } else
  5884. if(daysSinceRecovChange == 200)
  5885. class9.message = "We strongly recommend you do so now to secure your account.";
  5886. else
  5887. class9.message = "If you do not remember making this change then cancel it immediately";
  5888. if(j == 654)
  5889. {
  5890. if(daysSinceRecovChange == 201)
  5891. if(membersInt == 1)
  5892. {
  5893. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  5894. return;
  5895. } else
  5896. {
  5897. class9.message = "";
  5898. return;
  5899. }
  5900. if(daysSinceRecovChange == 200)
  5901. {
  5902. class9.message = "Do this from the 'account management' area on our front webpage";
  5903. return;
  5904. }
  5905. class9.message = "Do this from the 'account management' area on our front webpage";
  5906. }
  5907. }
  5908.  
  5909. private void drawSplitPrivateChat()
  5910. {
  5911. if(splitPrivateChat == 0)
  5912. return;
  5913. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  5914. int i = 0;
  5915. if(anInt1104 != 0)
  5916. i = 1;
  5917. for(int j = 0; j < 100; j++)
  5918. if(chatMessages[j] != null)
  5919. {
  5920. int k = chatTypes[j];
  5921. String s = chatNames[j];
  5922. byte byte1 = 0;
  5923. if(s != null && s.startsWith("@cr1@"))
  5924. {
  5925. s = s.substring(5);
  5926. byte1 = 1;
  5927. }
  5928. if(s != null && s.startsWith("@cr2@"))
  5929. {
  5930. s = s.substring(5);
  5931. byte1 = 2;
  5932. }
  5933. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5934. {
  5935. int l = 329 - i * 13;
  5936. int k1 = 4;
  5937. textDrawingArea.method385(0, "From", l, k1);
  5938. textDrawingArea.method385(65535, "From", l - 1, k1);
  5939. k1 += textDrawingArea.getTextWidth("From ");
  5940. if(byte1 == 1)
  5941. {
  5942. modIcons[0].drawBackground(k1, l - 12);
  5943. k1 += 12;
  5944. }
  5945. if(byte1 == 2)
  5946. {
  5947. modIcons[1].drawBackground(k1, l - 12);
  5948. k1 += 12;
  5949. }
  5950. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  5951. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  5952. if(++i >= 5)
  5953. return;
  5954. }
  5955. if(k == 5 && privateChatMode < 2)
  5956. {
  5957. int i1 = 329 - i * 13;
  5958. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  5959. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  5960. if(++i >= 5)
  5961. return;
  5962. }
  5963. if(k == 6 && privateChatMode < 2)
  5964. {
  5965. int j1 = 329 - i * 13;
  5966. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  5967. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  5968. if(++i >= 5)
  5969. return;
  5970. }
  5971. }
  5972.  
  5973. }
  5974.  
  5975. public void pushMessage(String s, int i, String s1) {
  5976. if(i == 0 && dialogID != -1) {
  5977. aString844 = s;
  5978. super.clickMode3 = 0;
  5979. }
  5980. if(backDialogID == -1)
  5981. inputTaken = true;
  5982. for(int j = 499; j > 0; j--) {
  5983. chatTypes[j] = chatTypes[j - 1];
  5984. chatNames[j] = chatNames[j - 1];
  5985. chatMessages[j] = chatMessages[j - 1];
  5986. chatRights[j] = chatRights[j - 1];
  5987. }
  5988. chatTypes[0] = i;
  5989. chatNames[0] = s1;
  5990. chatMessages[0] = s;
  5991. chatRights[0] = rights;
  5992. }
  5993.  
  5994. public static void setTab(int id) {
  5995. needDrawTabArea = true;
  5996. tabID = id;
  5997. tabAreaAltered = true;
  5998. }
  5999.  
  6000. private void processTabClick() {
  6001. if(super.clickMode3 == 1) {
  6002. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  6003. {
  6004. needDrawTabArea = true;
  6005. tabID = 0;
  6006. tabAreaAltered = true;
  6007. }
  6008. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  6009. {
  6010. needDrawTabArea = true;
  6011. tabID = 1;
  6012. tabAreaAltered = true;
  6013. }
  6014. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  6015. {
  6016. needDrawTabArea = true;
  6017. tabID = 2;
  6018. tabAreaAltered = true;
  6019. }
  6020. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  6021. {
  6022. needDrawTabArea = true;
  6023. tabID = 3;
  6024. tabAreaAltered = true;
  6025. }
  6026. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  6027. {
  6028. needDrawTabArea = true;
  6029. tabID = 4;
  6030. tabAreaAltered = true;
  6031. }
  6032. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  6033. {
  6034. needDrawTabArea = true;
  6035. tabID = 5;
  6036. tabAreaAltered = true;
  6037. }
  6038. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  6039. {
  6040. needDrawTabArea = true;
  6041. tabID = 6;
  6042. tabAreaAltered = true;
  6043. }
  6044. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  6045. {
  6046. needDrawTabArea = true;
  6047. tabID = 7;
  6048. tabAreaAltered = true;
  6049. }
  6050. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  6051. {
  6052. needDrawTabArea = true;
  6053. tabID = 8;
  6054. tabAreaAltered = true;
  6055. }
  6056. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  6057. {
  6058. needDrawTabArea = true;
  6059. tabID = 9;
  6060. tabAreaAltered = true;
  6061. }
  6062. if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[10] != -1)
  6063. {
  6064. needDrawTabArea = true;
  6065. tabID = 10;
  6066. tabAreaAltered = true;
  6067. }
  6068. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  6069. {
  6070. needDrawTabArea = true;
  6071. tabID = 11;
  6072. tabAreaAltered = true;
  6073. }
  6074. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  6075. {
  6076. needDrawTabArea = true;
  6077. tabID = 12;
  6078. tabAreaAltered = true;
  6079. }
  6080. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  6081. {
  6082. needDrawTabArea = true;
  6083. tabID = 13;
  6084. tabAreaAltered = true;
  6085. }
  6086. }
  6087. }
  6088.  
  6089. private void resetImageProducers2() {
  6090. if(aRSImageProducer_1166 != null)
  6091. return;
  6092. nullLoader();
  6093. super.fullGameScreen = null;
  6094. aRSImageProducer_1107 = null;
  6095. aRSImageProducer_1108 = null;
  6096. aRSImageProducer_1109 = null;
  6097. aRSImageProducer_1110 = null;
  6098. aRSImageProducer_1111 = null;
  6099. aRSImageProducer_1112 = null;
  6100. aRSImageProducer_1113 = null;
  6101. aRSImageProducer_1114 = null;
  6102. aRSImageProducer_1115 = null;
  6103. aRSImageProducer_1166 = new RSImageProducer(519, 165, getGameComponent());
  6104. aRSImageProducer_1164 = new RSImageProducer(246, 164, getGameComponent());
  6105. DrawingArea.setAllPixelsToZero();
  6106. mapBack.drawBackground(0, 0);
  6107. aRSImageProducer_1163 = new RSImageProducer(246, 335, getGameComponent());
  6108. aRSImageProducer_1165 = new RSImageProducer(512, 334, getGameComponent());
  6109. DrawingArea.setAllPixelsToZero();
  6110. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  6111. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  6112. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  6113. welcomeScreenRaised = true;
  6114. }
  6115.  
  6116. public String getDocumentBaseHost() {
  6117. if (signlink.mainapp != null) {
  6118. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  6119. }
  6120. if (super.gameFrame != null) {
  6121. return ""; // runescape.com <- removed for Jframe to work
  6122. } else {
  6123. return ""; // super.getDocumentBase().getHost().toLowerCase() <- removed for Jframe to work
  6124. }
  6125. }
  6126.  
  6127. private void method81(Sprite sprite, int j, int k) {
  6128. int l = k * k + j * j;
  6129. if(l > 4225 && l < 0x15f90) {
  6130. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  6131. int j1 = Model.modelIntArray1[i1];
  6132. int k1 = Model.modelIntArray2[i1];
  6133. j1 = (j1 * 256) / (minimapInt3 + 256);
  6134. k1 = (k1 * 256) / (minimapInt3 + 256);
  6135. int l1 = j * j1 + k * k1 >> 16;
  6136. int i2 = j * k1 - k * j1 >> 16;
  6137. double d = Math.atan2(l1, i2);
  6138. int j2 = (int)(Math.sin(d) * 63D);
  6139. int k2 = (int)(Math.cos(d) * 57D);
  6140. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  6141. } else {
  6142. markMinimap(sprite, k, j);
  6143. }
  6144. }
  6145.  
  6146. private void rightClickChatButtons() {
  6147. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  6148. menuActionName[1] = "View All";
  6149. menuActionID[1] = 999;
  6150. menuActionRow = 2;
  6151. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  6152. menuActionName[1] = "View Game";
  6153. menuActionID[1] = 998;
  6154. menuActionRow = 2;
  6155. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  6156. menuActionName[1] = "Hide public";
  6157. menuActionID[1] = 997;
  6158. menuActionName[2] = "Off public";
  6159. menuActionID[2] = 996;
  6160. menuActionName[3] = "Friends public";
  6161. menuActionID[3] = 995;
  6162. menuActionName[4] = "On public";
  6163. menuActionID[4] = 994;
  6164. menuActionName[5] = "View public";
  6165. menuActionID[5] = 993;
  6166. menuActionRow = 6;
  6167. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  6168. menuActionName[1] = "Off private";
  6169. menuActionID[1] = 992;
  6170. menuActionName[2] = "Friends private";
  6171. menuActionID[2] = 991;
  6172. menuActionName[3] = "On private";
  6173. menuActionID[3] = 990;
  6174. menuActionName[4] = "View private";
  6175. menuActionID[4] = 989;
  6176. menuActionRow = 5;
  6177. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  6178. menuActionName[1] = "Off clan chat";
  6179. menuActionID[1] = 1003;
  6180. menuActionName[2] = "Friends clan chat";
  6181. menuActionID[2] = 1002;
  6182. menuActionName[3] = "On clan chat";
  6183. menuActionID[3] = 1001;
  6184. menuActionName[4] = "View clan chat";
  6185. menuActionID[4] = 1000;
  6186. menuActionRow = 5;
  6187. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  6188. menuActionName[1] = "Off trade";
  6189. menuActionID[1] = 987;
  6190. menuActionName[2] = "Friends trade";
  6191. menuActionID[2] = 986;
  6192. menuActionName[3] = "On trade";
  6193. menuActionID[3] = 985;
  6194. menuActionName[4] = "View trade";
  6195. menuActionID[4] = 984;
  6196. menuActionRow = 5;
  6197. }
  6198. }
  6199.  
  6200. public void processRightClick() {
  6201. if (activeInterfaceType != 0) {
  6202. return;
  6203. }
  6204. menuActionName[0] = "Cancel";
  6205. menuActionID[0] = 1107;
  6206. menuActionRow = 1;
  6207. if (fullscreenInterfaceID != -1) {
  6208. anInt886 = 0;
  6209. anInt1315 = 0;
  6210. buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  6211. if (anInt886 != anInt1026) {
  6212. anInt1026 = anInt886;
  6213. }
  6214. if (anInt1315 != anInt1129) {
  6215. anInt1129 = anInt1315;
  6216. }
  6217. return;
  6218. }
  6219. buildSplitPrivateChatMenu();
  6220. anInt886 = 0;
  6221. anInt1315 = 0;
  6222. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338) {
  6223. if (openInterfaceID != -1) {
  6224. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  6225. } else {
  6226. build3dScreenMenu();
  6227. }
  6228. }
  6229. if (anInt886 != anInt1026) {
  6230. anInt1026 = anInt886;
  6231. }
  6232. if (anInt1315 != anInt1129) {
  6233. anInt1129 = anInt1315;
  6234. }
  6235. anInt886 = 0;
  6236. anInt1315 = 0;
  6237. if(super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468) {
  6238. if(invOverlayInterfaceID != -1) {
  6239. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  6240. } else if(tabInterfaceIDs[tabID] != -1) {
  6241. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  6242. }
  6243. }
  6244. if (anInt886 != anInt1048) {
  6245. needDrawTabArea = true;
  6246. tabAreaAltered = true;
  6247. anInt1048 = anInt886;
  6248. }
  6249. if (anInt1315 != anInt1044) {
  6250. needDrawTabArea = true;
  6251. tabAreaAltered = true;
  6252. anInt1044 = anInt1315;
  6253. }
  6254. anInt886 = 0;
  6255. anInt1315 = 0;
  6256. if(super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  6257. if(backDialogID != -1) {
  6258. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  6259. } else if(super.mouseY < 463 && super.mouseX < 490) {
  6260. buildChatAreaMenu(super.mouseY - 338);
  6261. }
  6262. }
  6263. if (backDialogID != -1 && anInt886 != anInt1039) {
  6264. inputTaken = true;
  6265. anInt1039 = anInt886;
  6266. }
  6267. if (backDialogID != -1 && anInt1315 != anInt1500) {
  6268. inputTaken = true;
  6269. anInt1500 = anInt1315;
  6270. }
  6271. /* Enable custom right click areas */
  6272. if(super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 && super.mouseY < 503)
  6273. rightClickChatButtons();
  6274. /**/
  6275. boolean flag = false;
  6276. while (!flag) {
  6277. flag = true;
  6278. for (int j = 0; j < menuActionRow - 1; j++) {
  6279. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  6280. String s = menuActionName[j];
  6281. menuActionName[j] = menuActionName[j + 1];
  6282. menuActionName[j + 1] = s;
  6283. int k = menuActionID[j];
  6284. menuActionID[j] = menuActionID[j + 1];
  6285. menuActionID[j + 1] = k;
  6286. k = menuActionCmd2[j];
  6287. menuActionCmd2[j] = menuActionCmd2[j + 1];
  6288. menuActionCmd2[j + 1] = k;
  6289. k = menuActionCmd3[j];
  6290. menuActionCmd3[j] = menuActionCmd3[j + 1];
  6291. menuActionCmd3[j + 1] = k;
  6292. k = menuActionCmd1[j];
  6293. menuActionCmd1[j] = menuActionCmd1[j + 1];
  6294. menuActionCmd1[j + 1] = k;
  6295. flag = false;
  6296. }
  6297. }
  6298. }
  6299. }
  6300.  
  6301. private int method83(int i, int j, int k)
  6302. {
  6303. int l = 256 - k;
  6304. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  6305. }
  6306.  
  6307. private void login(String s, String s1, boolean flag)
  6308. {
  6309. signlink.errorname = s;
  6310. try
  6311. {
  6312. if(!flag)
  6313. {
  6314. loginMessage1 = "";
  6315. loginMessage2 = "Connecting to server...";
  6316. drawLoginScreen(true);
  6317. }
  6318. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  6319. long l = TextClass.longForName(s);
  6320. int i = (int)(l >> 16 & 31L);
  6321. stream.currentOffset = 0;
  6322. stream.writeWordBigEndian(14);
  6323. stream.writeWordBigEndian(i);
  6324. socketStream.queueBytes(2, stream.buffer);
  6325. for(int j = 0; j < 8; j++)
  6326. socketStream.read();
  6327.  
  6328. int k = socketStream.read();
  6329. int i1 = k;
  6330. if(k == 0)
  6331. {
  6332. socketStream.flushInputStream(inStream.buffer, 8);
  6333. inStream.currentOffset = 0;
  6334. aLong1215 = inStream.readQWord();
  6335. int ai[] = new int[4];
  6336. ai[0] = (int)(Math.random() * 99999999D);
  6337. ai[1] = (int)(Math.random() * 99999999D);
  6338. ai[2] = (int)(aLong1215 >> 32);
  6339. ai[3] = (int)aLong1215;
  6340. stream.currentOffset = 0;
  6341. stream.writeWordBigEndian(10);
  6342. stream.writeDWord(ai[0]);
  6343. stream.writeDWord(ai[1]);
  6344. stream.writeDWord(ai[2]);
  6345. stream.writeDWord(ai[3]);
  6346. stream.writeDWord(/*signlink.uid*/999999);
  6347. stream.writeString(s);
  6348. stream.writeString(s1);
  6349. stream.doKeys();
  6350. aStream_847.currentOffset = 0;
  6351. if(flag)
  6352. aStream_847.writeWordBigEndian(18);
  6353. else
  6354. aStream_847.writeWordBigEndian(16);
  6355. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  6356. aStream_847.writeWordBigEndian(255);
  6357. aStream_847.writeWord(317);
  6358. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  6359. for(int l1 = 0; l1 < 9; l1++)
  6360. aStream_847.writeDWord(expectedCRCs[l1]);
  6361.  
  6362. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  6363. stream.encryption = new ISAACRandomGen(ai);
  6364. for(int j2 = 0; j2 < 4; j2++)
  6365. ai[j2] += 50;
  6366.  
  6367. encryption = new ISAACRandomGen(ai);
  6368. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  6369. k = socketStream.read();
  6370. }
  6371. if(k == 1)
  6372. {
  6373. try
  6374. {
  6375. Thread.sleep(2000L);
  6376. }
  6377. catch(Exception _ex) { }
  6378. login(s, s1, flag);
  6379. return;
  6380. }
  6381. if(k == 2)
  6382. {
  6383. myPrivilege = socketStream.read();
  6384. flagged = socketStream.read() == 1;
  6385. aLong1220 = 0L;
  6386. anInt1022 = 0;
  6387. mouseDetection.coordsIndex = 0;
  6388. super.awtFocus = true;
  6389. aBoolean954 = true;
  6390. loggedIn = true;
  6391. stream.currentOffset = 0;
  6392. inStream.currentOffset = 0;
  6393. pktType = -1;
  6394. anInt841 = -1;
  6395. anInt842 = -1;
  6396. anInt843 = -1;
  6397. pktSize = 0;
  6398. anInt1009 = 0;
  6399. anInt1104 = 0;
  6400. anInt1011 = 0;
  6401. anInt855 = 0;
  6402. menuActionRow = 0;
  6403. menuOpen = false;
  6404. super.idleTime = 0;
  6405. for(int j1 = 0; j1 < 100; j1++)
  6406. chatMessages[j1] = null;
  6407.  
  6408. itemSelected = 0;
  6409. spellSelected = 0;
  6410. loadingStage = 0;
  6411. anInt1062 = 0;
  6412. anInt1278 = (int)(Math.random() * 100D) - 50;
  6413. anInt1131 = (int)(Math.random() * 110D) - 55;
  6414. anInt896 = (int)(Math.random() * 80D) - 40;
  6415. minimapInt2 = (int)(Math.random() * 120D) - 60;
  6416. minimapInt3 = (int)(Math.random() * 30D) - 20;
  6417. minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
  6418. anInt1021 = 0;
  6419. anInt985 = -1;
  6420. destX = 0;
  6421. destY = 0;
  6422. playerCount = 0;
  6423. npcCount = 0;
  6424. for(int i2 = 0; i2 < maxPlayers; i2++)
  6425. {
  6426. playerArray[i2] = null;
  6427. aStreamArray895s[i2] = null;
  6428. }
  6429.  
  6430. for(int k2 = 0; k2 < 16384; k2++)
  6431. npcArray[k2] = null;
  6432.  
  6433. myPlayer = playerArray[myPlayerIndex] = new Player();
  6434. aClass19_1013.removeAll();
  6435. aClass19_1056.removeAll();
  6436. for(int l2 = 0; l2 < 4; l2++)
  6437. {
  6438. for(int i3 = 0; i3 < 104; i3++)
  6439. {
  6440. for(int k3 = 0; k3 < 104; k3++)
  6441. groundArray[l2][i3][k3] = null;
  6442.  
  6443. }
  6444.  
  6445. }
  6446.  
  6447. aClass19_1179 = new NodeList();
  6448. fullscreenInterfaceID = -1;
  6449. anInt900 = 0;
  6450. friendsCount = 0;
  6451. dialogID = -1;
  6452. backDialogID = -1;
  6453. openInterfaceID = -1;
  6454. invOverlayInterfaceID = -1;
  6455. anInt1018 = -1;
  6456. aBoolean1149 = false;
  6457. tabID = 3;
  6458. inputDialogState = 0;
  6459. menuOpen = false;
  6460. messagePromptRaised = false;
  6461. aString844 = null;
  6462. anInt1055 = 0;
  6463. anInt1054 = -1;
  6464. aBoolean1047 = true;
  6465. method45();
  6466. for(int j3 = 0; j3 < 5; j3++)
  6467. anIntArray990[j3] = 0;
  6468.  
  6469. for(int l3 = 0; l3 < 5; l3++)
  6470. {
  6471. atPlayerActions[l3] = null;
  6472. atPlayerArray[l3] = false;
  6473. }
  6474.  
  6475. anInt1175 = 0;
  6476. anInt1134 = 0;
  6477. anInt986 = 0;
  6478. anInt1288 = 0;
  6479. anInt924 = 0;
  6480. anInt1188 = 0;
  6481. anInt1155 = 0;
  6482. anInt1226 = 0;
  6483. int anInt941 = 0;
  6484. int anInt1260 = 0;
  6485. resetImageProducers2();
  6486. return;
  6487. }
  6488. if(k == 3)
  6489. {
  6490. loginMessage1 = "";
  6491. loginMessage2 = "Invalid username or password.";
  6492. return;
  6493. }
  6494. if(k == 4)
  6495. {
  6496. loginMessage1 = "Your account has been disabled.";
  6497. loginMessage2 = "Please check your message-center for details.";
  6498. return;
  6499. }
  6500. if(k == 5)
  6501. {
  6502. loginMessage1 = "Your account is already logged in.";
  6503. loginMessage2 = "Try again in 60 secs...";
  6504. return;
  6505. }
  6506. if(k == 6)
  6507. {
  6508. loginMessage1 = "RuneScape has been updated!";
  6509. loginMessage2 = "Please reload this page.";
  6510. return;
  6511. }
  6512. if(k == 7)
  6513. {
  6514. loginMessage1 = "This world is full.";
  6515. loginMessage2 = "Please use a different world.";
  6516. return;
  6517. }
  6518. if(k == 8)
  6519. {
  6520. loginMessage1 = "Unable to connect.";
  6521. loginMessage2 = "Login server offline.";
  6522. return;
  6523. }
  6524. if(k == 9)
  6525. {
  6526. loginMessage1 = "Login limit exceeded.";
  6527. loginMessage2 = "Too many connections from your address.";
  6528. return;
  6529. }
  6530. if(k == 10)
  6531. {
  6532. loginMessage1 = "Unable to connect.";
  6533. loginMessage2 = "Bad session id.";
  6534. return;
  6535. }
  6536. if(k == 11)
  6537. {
  6538. loginMessage2 = "Login server rejected session.";
  6539. loginMessage2 = "Please try again.";
  6540. return;
  6541. }
  6542. if(k == 12)
  6543. {
  6544. loginMessage1 = "You need a members account to login to this world.";
  6545. loginMessage2 = "Please subscribe, or use a different world.";
  6546. return;
  6547. }
  6548. if(k == 13)
  6549. {
  6550. loginMessage1 = "Could not complete login.";
  6551. loginMessage2 = "Please try using a different world.";
  6552. return;
  6553. }
  6554. if(k == 14)
  6555. {
  6556. loginMessage1 = "The server is being updated.";
  6557. loginMessage2 = "Please wait 1 minute and try again.";
  6558. return;
  6559. }
  6560. if(k == 15)
  6561. {
  6562. loggedIn = true;
  6563. stream.currentOffset = 0;
  6564. inStream.currentOffset = 0;
  6565. pktType = -1;
  6566. anInt841 = -1;
  6567. anInt842 = -1;
  6568. anInt843 = -1;
  6569. pktSize = 0;
  6570. anInt1009 = 0;
  6571. anInt1104 = 0;
  6572. menuActionRow = 0;
  6573. menuOpen = false;
  6574. aLong824 = System.currentTimeMillis();
  6575. return;
  6576. }
  6577. if(k == 16)
  6578. {
  6579. loginMessage1 = "Login attempts exceeded.";
  6580. loginMessage2 = "Please wait 1 minute and try again.";
  6581. return;
  6582. }
  6583. if(k == 17)
  6584. {
  6585. loginMessage1 = "You are standing in a members-only area.";
  6586. loginMessage2 = "To play on this world move to a free area first";
  6587. return;
  6588. }
  6589. if(k == 20)
  6590. {
  6591. loginMessage1 = "Invalid loginserver requested";
  6592. loginMessage2 = "Please try using a different world.";
  6593. return;
  6594. }
  6595. if(k == 21)
  6596. {
  6597. for(int k1 = socketStream.read(); k1 >= 0; k1--)
  6598. {
  6599. loginMessage1 = "You have only just left another world";
  6600. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  6601. drawLoginScreen(true);
  6602. try
  6603. {
  6604. Thread.sleep(1000L);
  6605. }
  6606. catch(Exception _ex) { }
  6607. }
  6608.  
  6609. login(s, s1, flag);
  6610. return;
  6611. }
  6612. if(k == -1)
  6613. {
  6614. if(i1 == 0)
  6615. {
  6616. if(loginFailures < 2)
  6617. {
  6618. try
  6619. {
  6620. Thread.sleep(2000L);
  6621. }
  6622. catch(Exception _ex) { }
  6623. loginFailures++;
  6624. login(s, s1, flag);
  6625. return;
  6626. } else
  6627. {
  6628. loginMessage1 = "No response from loginserver";
  6629. loginMessage2 = "Please wait 1 minute and try again.";
  6630. return;
  6631. }
  6632. } else
  6633. {
  6634. loginMessage1 = "No response from server";
  6635. loginMessage2 = "Please try using a different world.";
  6636. return;
  6637. }
  6638. } else
  6639. {
  6640. System.out.println("response:" + k);
  6641. loginMessage1 = "Unexpected server response";
  6642. loginMessage2 = "Please try using a different world.";
  6643. return;
  6644. }
  6645. }
  6646. catch(IOException _ex)
  6647. {
  6648. loginMessage1 = "";
  6649. }
  6650. loginMessage2 = "Error connecting to server.";
  6651. }
  6652.  
  6653. 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) {
  6654. byte byte0 = 104;
  6655. byte byte1 = 104;
  6656. for(int l2 = 0; l2 < byte0; l2++) {
  6657. for(int i3 = 0; i3 < byte1; i3++) {
  6658. anIntArrayArray901[l2][i3] = 0;
  6659. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  6660. }
  6661. }
  6662. int j3 = j2;
  6663. int k3 = j1;
  6664. anIntArrayArray901[j2][j1] = 99;
  6665. anIntArrayArray825[j2][j1] = 0;
  6666. int l3 = 0;
  6667. int i4 = 0;
  6668. bigX[l3] = j2;
  6669. bigY[l3++] = j1;
  6670. boolean flag1 = false;
  6671. int j4 = bigX.length;
  6672. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  6673. while(i4 != l3)
  6674. {
  6675. j3 = bigX[i4];
  6676. k3 = bigY[i4];
  6677. i4 = (i4 + 1) % j4;
  6678. if(j3 == k2 && k3 == i2)
  6679. {
  6680. flag1 = true;
  6681. break;
  6682. }
  6683. if(i1 != 0)
  6684. {
  6685. if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  6686. {
  6687. flag1 = true;
  6688. break;
  6689. }
  6690. if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  6691. {
  6692. flag1 = true;
  6693. break;
  6694. }
  6695. }
  6696. if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  6697. {
  6698. flag1 = true;
  6699. break;
  6700. }
  6701. int l4 = anIntArrayArray825[j3][k3] + 1;
  6702. if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  6703. {
  6704. bigX[l3] = j3 - 1;
  6705. bigY[l3] = k3;
  6706. l3 = (l3 + 1) % j4;
  6707. anIntArrayArray901[j3 - 1][k3] = 2;
  6708. anIntArrayArray825[j3 - 1][k3] = l4;
  6709. }
  6710. if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  6711. {
  6712. bigX[l3] = j3 + 1;
  6713. bigY[l3] = k3;
  6714. l3 = (l3 + 1) % j4;
  6715. anIntArrayArray901[j3 + 1][k3] = 8;
  6716. anIntArrayArray825[j3 + 1][k3] = l4;
  6717. }
  6718. if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  6719. {
  6720. bigX[l3] = j3;
  6721. bigY[l3] = k3 - 1;
  6722. l3 = (l3 + 1) % j4;
  6723. anIntArrayArray901[j3][k3 - 1] = 1;
  6724. anIntArrayArray825[j3][k3 - 1] = l4;
  6725. }
  6726. if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  6727. {
  6728. bigX[l3] = j3;
  6729. bigY[l3] = k3 + 1;
  6730. l3 = (l3 + 1) % j4;
  6731. anIntArrayArray901[j3][k3 + 1] = 4;
  6732. anIntArrayArray825[j3][k3 + 1] = l4;
  6733. }
  6734. 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)
  6735. {
  6736. bigX[l3] = j3 - 1;
  6737. bigY[l3] = k3 - 1;
  6738. l3 = (l3 + 1) % j4;
  6739. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  6740. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  6741. }
  6742. 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)
  6743. {
  6744. bigX[l3] = j3 + 1;
  6745. bigY[l3] = k3 - 1;
  6746. l3 = (l3 + 1) % j4;
  6747. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  6748. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  6749. }
  6750. 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)
  6751. {
  6752. bigX[l3] = j3 - 1;
  6753. bigY[l3] = k3 + 1;
  6754. l3 = (l3 + 1) % j4;
  6755. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  6756. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  6757. }
  6758. 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)
  6759. {
  6760. bigX[l3] = j3 + 1;
  6761. bigY[l3] = k3 + 1;
  6762. l3 = (l3 + 1) % j4;
  6763. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  6764. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  6765. }
  6766. }
  6767. anInt1264 = 0;
  6768. if(!flag1)
  6769. {
  6770. if(flag)
  6771. {
  6772. int i5 = 100;
  6773. for(int k5 = 1; k5 < 2; k5++)
  6774. {
  6775. for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  6776. {
  6777. for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  6778. if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  6779. {
  6780. i5 = anIntArrayArray825[i6][l6];
  6781. j3 = i6;
  6782. k3 = l6;
  6783. anInt1264 = 1;
  6784. flag1 = true;
  6785. }
  6786.  
  6787. }
  6788.  
  6789. if(flag1)
  6790. break;
  6791. }
  6792.  
  6793. }
  6794. if(!flag1)
  6795. return false;
  6796. }
  6797. i4 = 0;
  6798. bigX[i4] = j3;
  6799. bigY[i4++] = k3;
  6800. int l5;
  6801. for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  6802. {
  6803. if(j5 != l5)
  6804. {
  6805. l5 = j5;
  6806. bigX[i4] = j3;
  6807. bigY[i4++] = k3;
  6808. }
  6809. if((j5 & 2) != 0)
  6810. j3++;
  6811. else
  6812. if((j5 & 8) != 0)
  6813. j3--;
  6814. if((j5 & 1) != 0)
  6815. k3++;
  6816. else
  6817. if((j5 & 4) != 0)
  6818. k3--;
  6819. }
  6820. // if(cancelWalk) { return i4 > 0; }
  6821.  
  6822.  
  6823. if(i4 > 0)
  6824. {
  6825. int k4 = i4;
  6826. if(k4 > 25)
  6827. k4 = 25;
  6828. i4--;
  6829. int k6 = bigX[i4];
  6830. int i7 = bigY[i4];
  6831. anInt1288 += k4;
  6832. if(anInt1288 >= 92)
  6833. {
  6834. stream.createFrame(36);
  6835. stream.writeDWord(0);
  6836. anInt1288 = 0;
  6837. }
  6838. if(i == 0)
  6839. {
  6840. stream.createFrame(164);
  6841. stream.writeWordBigEndian(k4 + k4 + 3);
  6842. }
  6843. if(i == 1)
  6844. {
  6845. stream.createFrame(248);
  6846. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  6847. }
  6848. if(i == 2)
  6849. {
  6850. stream.createFrame(98);
  6851. stream.writeWordBigEndian(k4 + k4 + 3);
  6852. }
  6853. stream.method433(k6 + baseX);
  6854. destX = bigX[0];
  6855. destY = bigY[0];
  6856. for(int j7 = 1; j7 < k4; j7++)
  6857. {
  6858. i4--;
  6859. stream.writeWordBigEndian(bigX[i4] - k6);
  6860. stream.writeWordBigEndian(bigY[i4] - i7);
  6861. }
  6862.  
  6863. stream.method431(i7 + baseY);
  6864. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  6865. return true;
  6866. }
  6867. return i != 1;
  6868. }
  6869.  
  6870. private void method86(Stream stream)
  6871. {
  6872. for(int j = 0; j < anInt893; j++)
  6873. {
  6874. int k = anIntArray894[j];
  6875. NPC npc = npcArray[k];
  6876. int l = stream.readUnsignedByte();
  6877. if((l & 0x10) != 0)
  6878. {
  6879. int i1 = stream.method434();
  6880. if(i1 == 65535)
  6881. i1 = -1;
  6882. int i2 = stream.readUnsignedByte();
  6883. if(i1 == npc.anim && i1 != -1)
  6884. {
  6885. int l2 = Animation.anims[i1].anInt365;
  6886. if(l2 == 1)
  6887. {
  6888. npc.anInt1527 = 0;
  6889. npc.anInt1528 = 0;
  6890. npc.anInt1529 = i2;
  6891. npc.anInt1530 = 0;
  6892. }
  6893. if(l2 == 2)
  6894. npc.anInt1530 = 0;
  6895. } else
  6896. if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  6897. {
  6898. npc.anim = i1;
  6899. npc.anInt1527 = 0;
  6900. npc.anInt1528 = 0;
  6901. npc.anInt1529 = i2;
  6902. npc.anInt1530 = 0;
  6903. npc.anInt1542 = npc.smallXYIndex;
  6904. }
  6905. }
  6906. if((l & 8) != 0)
  6907. {
  6908. int j1 = stream.method426();
  6909. int j2 = stream.method427();
  6910. npc.updateHitData(j2, j1, loopCycle);
  6911. npc.loopCycleStatus = loopCycle + 300;
  6912. npc.currentHealth = stream.method426();
  6913. npc.maxHealth = stream.readUnsignedByte();
  6914. }
  6915. if((l & 0x80) != 0)
  6916. {
  6917. npc.anInt1520 = stream.readUnsignedWord();
  6918. int k1 = stream.readDWord();
  6919. npc.anInt1524 = k1 >> 16;
  6920. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  6921. npc.anInt1521 = 0;
  6922. npc.anInt1522 = 0;
  6923. if(npc.anInt1523 > loopCycle)
  6924. npc.anInt1521 = -1;
  6925. if(npc.anInt1520 == 65535)
  6926. npc.anInt1520 = -1;
  6927. }
  6928. if((l & 0x20) != 0)
  6929. {
  6930. npc.interactingEntity = stream.readUnsignedWord();
  6931. if(npc.interactingEntity == 65535)
  6932. npc.interactingEntity = -1;
  6933. }
  6934. if((l & 1) != 0)
  6935. {
  6936. npc.textSpoken = stream.readString();
  6937. npc.textCycle = 100;
  6938. // entityMessage(npc);
  6939.  
  6940. }
  6941. if((l & 0x40) != 0)
  6942. {
  6943. int l1 = stream.method427();
  6944. int k2 = stream.method428();
  6945. npc.updateHitData(k2, l1, loopCycle);
  6946. npc.loopCycleStatus = loopCycle + 300;
  6947. npc.currentHealth = stream.method428();
  6948. npc.maxHealth = stream.method427();
  6949. }
  6950. if((l & 2) != 0)
  6951. {
  6952. npc.desc = EntityDef.forID(stream.method436());
  6953. npc.anInt1540 = npc.desc.aByte68;
  6954. npc.anInt1504 = npc.desc.anInt79;
  6955. npc.anInt1554 = npc.desc.walkAnim;
  6956. npc.anInt1555 = npc.desc.anInt58;
  6957. npc.anInt1556 = npc.desc.anInt83;
  6958. npc.anInt1557 = npc.desc.anInt55;
  6959. npc.anInt1511 = npc.desc.standAnim;
  6960. }
  6961. if((l & 4) != 0)
  6962. {
  6963. npc.anInt1538 = stream.method434();
  6964. npc.anInt1539 = stream.method434();
  6965. }
  6966. }
  6967. }
  6968.  
  6969. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  6970. {
  6971. if(menuActionRow >= 400)
  6972. return;
  6973. if(entityDef.childrenIDs != null)
  6974. entityDef = entityDef.method161();
  6975. if(entityDef == null)
  6976. return;
  6977. if(!entityDef.aBoolean84)
  6978. return;
  6979. String s = entityDef.name;
  6980. if(entityDef.combatLevel != 0)
  6981. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  6982. if(itemSelected == 1)
  6983. {
  6984. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  6985. menuActionID[menuActionRow] = 582;
  6986. menuActionCmd1[menuActionRow] = i;
  6987. menuActionCmd2[menuActionRow] = k;
  6988. menuActionCmd3[menuActionRow] = j;
  6989. menuActionRow++;
  6990. return;
  6991. }
  6992. if(spellSelected == 1)
  6993. {
  6994. if((spellUsableOn & 2) == 2)
  6995. {
  6996. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  6997. menuActionID[menuActionRow] = 413;
  6998. menuActionCmd1[menuActionRow] = i;
  6999. menuActionCmd2[menuActionRow] = k;
  7000. menuActionCmd3[menuActionRow] = j;
  7001. menuActionRow++;
  7002. }
  7003. } else
  7004. {
  7005. if(entityDef.actions != null)
  7006. {
  7007. for(int l = 4; l >= 0; l--)
  7008. if(entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack"))
  7009. {
  7010. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  7011. if(l == 0)
  7012. menuActionID[menuActionRow] = 20;
  7013. if(l == 1)
  7014. menuActionID[menuActionRow] = 412;
  7015. if(l == 2)
  7016. menuActionID[menuActionRow] = 225;
  7017. if(l == 3)
  7018. menuActionID[menuActionRow] = 965;
  7019. if(l == 4)
  7020. menuActionID[menuActionRow] = 478;
  7021. menuActionCmd1[menuActionRow] = i;
  7022. menuActionCmd2[menuActionRow] = k;
  7023. menuActionCmd3[menuActionRow] = j;
  7024. menuActionRow++;
  7025. }
  7026.  
  7027. }
  7028. if(entityDef.actions != null)
  7029. {
  7030. for(int i1 = 4; i1 >= 0; i1--)
  7031. if(entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack"))
  7032. {
  7033. char c = '\0';
  7034. if(entityDef.combatLevel > myPlayer.combatLevel)
  7035. c = '\u07D0';
  7036. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  7037. if(i1 == 0)
  7038. menuActionID[menuActionRow] = 20 + c;
  7039. if(i1 == 1)
  7040. menuActionID[menuActionRow] = 412 + c;
  7041. if(i1 == 2)
  7042. menuActionID[menuActionRow] = 225 + c;
  7043. if(i1 == 3)
  7044. menuActionID[menuActionRow] = 965 + c;
  7045. if(i1 == 4)
  7046. menuActionID[menuActionRow] = 478 + c;
  7047. menuActionCmd1[menuActionRow] = i;
  7048. menuActionCmd2[menuActionRow] = k;
  7049. menuActionCmd3[menuActionRow] = j;
  7050. menuActionRow++;
  7051. }
  7052.  
  7053. }
  7054. //menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.type + "@gre@)";
  7055. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7056. menuActionID[menuActionRow] = 1025;
  7057. menuActionCmd1[menuActionRow] = i;
  7058. menuActionCmd2[menuActionRow] = k;
  7059. menuActionCmd3[menuActionRow] = j;
  7060. menuActionRow++;
  7061. }
  7062. }
  7063.  
  7064. private void buildAtPlayerMenu(int i, int j, Player player, int k)
  7065. {
  7066. if(player == myPlayer)
  7067. return;
  7068. if(menuActionRow >= 400)
  7069. return;
  7070. String s;
  7071. if(player.skill == 0)
  7072. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  7073. else
  7074. s = player.name + " (skill-" + player.skill + ")";
  7075. if(itemSelected == 1)
  7076. {
  7077. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
  7078. menuActionID[menuActionRow] = 491;
  7079. menuActionCmd1[menuActionRow] = j;
  7080. menuActionCmd2[menuActionRow] = i;
  7081. menuActionCmd3[menuActionRow] = k;
  7082. menuActionRow++;
  7083. } else
  7084. if(spellSelected == 1)
  7085. {
  7086. if((spellUsableOn & 8) == 8)
  7087. {
  7088. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  7089. menuActionID[menuActionRow] = 365;
  7090. menuActionCmd1[menuActionRow] = j;
  7091. menuActionCmd2[menuActionRow] = i;
  7092. menuActionCmd3[menuActionRow] = k;
  7093. menuActionRow++;
  7094. }
  7095. } else
  7096. {
  7097. for(int l = 4; l >= 0; l--)
  7098. if(atPlayerActions[l] != null)
  7099. {
  7100. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  7101. char c = '\0';
  7102. if(atPlayerActions[l].equalsIgnoreCase("attack"))
  7103. {
  7104. if(player.combatLevel > myPlayer.combatLevel)
  7105. c = '\u07D0';
  7106. if(myPlayer.team != 0 && player.team != 0)
  7107. if(myPlayer.team == player.team)
  7108. c = '\u07D0';
  7109. else
  7110. c = '\0';
  7111. } else
  7112. if(atPlayerArray[l])
  7113. c = '\u07D0';
  7114. if(l == 0)
  7115. menuActionID[menuActionRow] = 561 + c;
  7116. if(l == 1)
  7117. menuActionID[menuActionRow] = 779 + c;
  7118. if(l == 2)
  7119. menuActionID[menuActionRow] = 27 + c;
  7120. if(l == 3)
  7121. menuActionID[menuActionRow] = 577 + c;
  7122. if(l == 4)
  7123. menuActionID[menuActionRow] = 729 + c;
  7124. menuActionCmd1[menuActionRow] = j;
  7125. menuActionCmd2[menuActionRow] = i;
  7126. menuActionCmd3[menuActionRow] = k;
  7127. menuActionRow++;
  7128. }
  7129.  
  7130. }
  7131. for(int i1 = 0; i1 < menuActionRow; i1++)
  7132. if(menuActionID[i1] == 516)
  7133. {
  7134. menuActionName[i1] = "Walk here @whi@" + s;
  7135. return;
  7136. }
  7137.  
  7138. }
  7139.  
  7140. private void method89(Class30_Sub1 class30_sub1)
  7141. {
  7142. int i = 0;
  7143. int j = -1;
  7144. int k = 0;
  7145. int l = 0;
  7146. if(class30_sub1.anInt1296 == 0)
  7147. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7148. if(class30_sub1.anInt1296 == 1)
  7149. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7150. if(class30_sub1.anInt1296 == 2)
  7151. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7152. if(class30_sub1.anInt1296 == 3)
  7153. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7154. if(i != 0)
  7155. {
  7156. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7157. j = i >> 14 & 0x7fff;
  7158. k = i1 & 0x1f;
  7159. l = i1 >> 6;
  7160. }
  7161. class30_sub1.anInt1299 = j;
  7162. class30_sub1.anInt1301 = k;
  7163. class30_sub1.anInt1300 = l;
  7164. }
  7165.  
  7166. private void method90()
  7167. {
  7168. for(int i = 0; i < anInt1062; i++)
  7169. if(anIntArray1250[i] <= 0)
  7170. {
  7171. boolean flag1 = false;
  7172. try
  7173. {
  7174. if(anIntArray1207[i] == anInt874 && anIntArray1241[i] == anInt1289)
  7175. {
  7176. if(!replayWave())
  7177. flag1 = true;
  7178. } else
  7179. {
  7180. Stream stream = Sounds.method241(anIntArray1241[i], anIntArray1207[i]);
  7181. if(System.currentTimeMillis() + (long)(stream.currentOffset / 22) > aLong1172 + (long)(anInt1257 / 22))
  7182. {
  7183. anInt1257 = stream.currentOffset;
  7184. aLong1172 = System.currentTimeMillis();
  7185. if(saveWave(stream.buffer, stream.currentOffset))
  7186. {
  7187. anInt874 = anIntArray1207[i];
  7188. anInt1289 = anIntArray1241[i];
  7189. } else
  7190. {
  7191. flag1 = true;
  7192. }
  7193. }
  7194. }
  7195. }
  7196. catch(Exception exception) { }
  7197. if(!flag1 || anIntArray1250[i] == -5)
  7198. {
  7199. anInt1062--;
  7200. for(int j = i; j < anInt1062; j++)
  7201. {
  7202. anIntArray1207[j] = anIntArray1207[j + 1];
  7203. anIntArray1241[j] = anIntArray1241[j + 1];
  7204. anIntArray1250[j] = anIntArray1250[j + 1];
  7205. }
  7206.  
  7207. i--;
  7208. } else
  7209. {
  7210. anIntArray1250[i] = -5;
  7211. }
  7212. } else
  7213. {
  7214. anIntArray1250[i]--;
  7215. }
  7216.  
  7217. if(prevSong > 0)
  7218. {
  7219. prevSong -= 20;
  7220. if(prevSong < 0)
  7221. prevSong = 0;
  7222. if(prevSong == 0 && musicEnabled && !lowMem)
  7223. {
  7224. nextSong = currentSong;
  7225. songChanging = true;
  7226. onDemandFetcher.method558(2, nextSong);
  7227. }
  7228. }
  7229. }
  7230.  
  7231. void startUp()
  7232. {
  7233. drawLoadingText(20, "Starting up");
  7234. if(signlink.sunjava)
  7235. super.minDelay = 5;
  7236. if(aBoolean993)
  7237. {
  7238. // rsAlreadyLoaded = true;
  7239. // return;
  7240. }
  7241. aBoolean993 = true;
  7242. boolean flag = true;
  7243. String s = getDocumentBaseHost();
  7244. if(signlink.cache_dat != null)
  7245. {
  7246. for(int i = 0; i < 5; i++)
  7247. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  7248. } try {
  7249. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  7250. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  7251. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  7252. chatTextDrawingArea = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  7253. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  7254. drawLogo();
  7255. loadTitleScreen();
  7256. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  7257. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  7258. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  7259. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  7260. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  7261. StreamLoader streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  7262. byteGroundArray = new byte[4][104][104];
  7263. intGroundArray = new int[4][105][105];
  7264. worldController = new WorldController(intGroundArray);
  7265. for(int j = 0; j < 4; j++)
  7266. aClass11Array1230[j] = new Class11();
  7267.  
  7268. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  7269. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  7270. drawLoadingText(60, "Connecting to update server");
  7271. onDemandFetcher = new OnDemandFetcher();
  7272. onDemandFetcher.start(streamLoader_6, this);
  7273. Class36.method528(onDemandFetcher.getAnimCount());
  7274. Model.method459(onDemandFetcher.getVersionCount(0), onDemandFetcher);
  7275. ModelDecompressor.loadModels();
  7276. //preloadModels();
  7277. if(!lowMem)
  7278. {
  7279. nextSong = 0;
  7280. try
  7281. {
  7282. nextSong = Integer.parseInt(getParameter("music"));
  7283. }
  7284. catch(Exception _ex) { }
  7285. songChanging = true;
  7286. onDemandFetcher.method558(2, nextSong);
  7287. while(onDemandFetcher.getNodeCount() > 0)
  7288. {
  7289. processOnDemandQueue();
  7290. try
  7291. {
  7292. Thread.sleep(100L);
  7293. }
  7294. catch(Exception _ex) { }
  7295. if(onDemandFetcher.anInt1349 > 3)
  7296. {
  7297. loadError();
  7298. return;
  7299. }
  7300. }
  7301. }
  7302. drawLoadingText(65, "Requesting animations");
  7303. int k = onDemandFetcher.getVersionCount(1);
  7304. for(int i1 = 0; i1 < k; i1++)
  7305. onDemandFetcher.method558(1, i1);
  7306.  
  7307. while(onDemandFetcher.getNodeCount() > 0)
  7308. {
  7309. int j1 = k - onDemandFetcher.getNodeCount();
  7310. if(j1 > 0)
  7311. drawLoadingText(65, "Loading animations - " + (j1 * 100) / k + "%");
  7312. processOnDemandQueue();
  7313. try
  7314. {
  7315. Thread.sleep(100L);
  7316. }
  7317. catch(Exception _ex) { }
  7318. if(onDemandFetcher.anInt1349 > 3)
  7319. {
  7320. loadError();
  7321. return;
  7322. }
  7323. }
  7324. drawLoadingText(70, "Requesting models");
  7325. k = onDemandFetcher.getVersionCount(0);
  7326. for(int k1 = 0; k1 < k; k1++)
  7327. {
  7328. int l1 = onDemandFetcher.getModelIndex(k1);
  7329. if((l1 & 1) != 0)
  7330. onDemandFetcher.method558(0, k1);
  7331. }
  7332.  
  7333. k = onDemandFetcher.getNodeCount();
  7334. while(onDemandFetcher.getNodeCount() > 0)
  7335. {
  7336. int i2 = k - onDemandFetcher.getNodeCount();
  7337. if(i2 > 0)
  7338. drawLoadingText(70, "Loading models - " + (i2 * 100) / k + "%");
  7339. processOnDemandQueue();
  7340. try
  7341. {
  7342. Thread.sleep(100L);
  7343. }
  7344. catch(Exception _ex) { }
  7345. }
  7346. if(decompressors[0] != null)
  7347. {
  7348. drawLoadingText(75, "Requesting maps");
  7349. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 47));
  7350. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 47));
  7351. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 48));
  7352. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 48));
  7353. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 49));
  7354. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 49));
  7355. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 47));
  7356. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 47));
  7357. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 48));
  7358. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 48));
  7359. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 148, 48));
  7360. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 148, 48));
  7361. k = onDemandFetcher.getNodeCount();
  7362. while(onDemandFetcher.getNodeCount() > 0)
  7363. {
  7364. int j2 = k - onDemandFetcher.getNodeCount();
  7365. if(j2 > 0)
  7366. drawLoadingText(75, "Loading maps - " + (j2 * 100) / k + "%");
  7367. processOnDemandQueue();
  7368. try
  7369. {
  7370. Thread.sleep(100L);
  7371. }
  7372. catch(Exception _ex) { }
  7373. }
  7374. }
  7375. k = onDemandFetcher.getVersionCount(0);
  7376. for(int k2 = 0; k2 < k; k2++)
  7377. {
  7378. int l2 = onDemandFetcher.getModelIndex(k2);
  7379. byte byte0 = 0;
  7380. if((l2 & 8) != 0)
  7381. byte0 = 10;
  7382. else
  7383. if((l2 & 0x20) != 0)
  7384. byte0 = 9;
  7385. else
  7386. if((l2 & 0x10) != 0)
  7387. byte0 = 8;
  7388. else
  7389. if((l2 & 0x40) != 0)
  7390. byte0 = 7;
  7391. else
  7392. if((l2 & 0x80) != 0)
  7393. byte0 = 6;
  7394. else
  7395. if((l2 & 2) != 0)
  7396. byte0 = 5;
  7397. else
  7398. if((l2 & 4) != 0)
  7399. byte0 = 4;
  7400. if((l2 & 1) != 0)
  7401. byte0 = 3;
  7402. if(byte0 != 0)
  7403. onDemandFetcher.method563(byte0, 0, k2);
  7404. }
  7405.  
  7406. onDemandFetcher.method554(isMembers);
  7407. if(!lowMem)
  7408. {
  7409. int l = onDemandFetcher.getVersionCount(2);
  7410. for(int i3 = 1; i3 < l; i3++)
  7411. if(onDemandFetcher.method569(i3))
  7412. onDemandFetcher.method563((byte)1, 2, i3);
  7413.  
  7414. }
  7415. drawLoadingText(80, "Unpacking media");
  7416. /* Custom sprite unpacking */
  7417. chatArea = new Sprite("chatarea");
  7418. tabArea = new Sprite("tabarea");
  7419. mapArea = new Sprite("maparea");
  7420. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  7421. /**/
  7422. mapBack = new Background(streamLoader_2, "mapback", 0);
  7423. for(int c1 = 0; c1 <= 3; c1++)
  7424. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  7425. for(int j3 = 0; j3 <= 14; j3++)
  7426. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  7427. for(int r1 = 0; r1 < 5; r1++)
  7428. redStones[r1] = new Sprite("redstones " + r1);
  7429. compass = new Sprite(streamLoader_2, "compass", 0);
  7430. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  7431. mapEdge.method345();
  7432. try
  7433. {
  7434. for(int k3 = 0; k3 < 100; k3++)
  7435. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  7436. }
  7437. catch(Exception _ex) { }
  7438. try
  7439. {
  7440. for(int l3 = 0; l3 < 100; l3++)
  7441. mapFunctions[l3] = new Sprite(streamLoader_2, "mapfunction", l3);
  7442. }
  7443. catch(Exception _ex) { }
  7444. try
  7445. {
  7446. for(int i4 = 0; i4 < 20; i4++)
  7447. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  7448. }
  7449. catch(Exception _ex) { }
  7450. try
  7451. {
  7452. for(int h1 = 0; h1 < 6; h1++)
  7453. headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
  7454. } catch(Exception _ex) { }
  7455. try {
  7456. for(int j4 = 0; j4 < 8; j4++)
  7457. headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);
  7458. for(int j45 = 0; j45 < 3; j45++)
  7459. skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45 );
  7460. }
  7461. catch(Exception _ex) { }
  7462. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  7463. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  7464. for(int k4 = 0; k4 < 8; k4++)
  7465. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  7466.  
  7467. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  7468. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  7469. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  7470. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  7471. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  7472. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  7473. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  7474. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  7475.  
  7476. for(int l4 = 0; l4 < 2; l4++)
  7477. modIcons[l4] = new Background(streamLoader_2, "mod_icons", l4);
  7478.  
  7479. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  7480. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7481. sprite.method346(0, 0);
  7482. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  7483. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7484. sprite.method346(0, 0);
  7485. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  7486. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7487. sprite.method346(0, 0);
  7488. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  7489. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7490. sprite.method346(0, 0);
  7491.  
  7492. int i5 = (int)(Math.random() * 21D) - 10;
  7493. int j5 = (int)(Math.random() * 21D) - 10;
  7494. int k5 = (int)(Math.random() * 21D) - 10;
  7495. int l5 = (int)(Math.random() * 41D) - 20;
  7496. for(int i6 = 0; i6 < 100; i6++)
  7497. {
  7498. if(mapFunctions[i6] != null)
  7499. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  7500. if(mapScenes[i6] != null)
  7501. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  7502. }
  7503.  
  7504. drawLoadingText(83, "Unpacking textures");
  7505. Texture.method368(streamLoader_3);
  7506. Texture.method372(0.80000000000000004D);
  7507. Texture.method367();
  7508. drawLoadingText(86, "Unpacking config");
  7509. Animation.unpackConfig(streamLoader);
  7510. ObjectDef.unpackConfig(streamLoader);
  7511. Flo.unpackConfig(streamLoader);
  7512. ItemDef.unpackConfig(streamLoader);
  7513. EntityDef.unpackConfig(streamLoader);
  7514. IDK.unpackConfig(streamLoader);
  7515. SpotAnim.unpackConfig(streamLoader);
  7516. Varp.unpackConfig(streamLoader);
  7517. VarBit.unpackConfig(streamLoader);
  7518. ItemDef.isMembers = isMembers;
  7519. if(!lowMem)
  7520. {
  7521. drawLoadingText(90, "Unpacking sounds");
  7522. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  7523. Stream stream = new Stream(abyte0);
  7524. Sounds.unpack(stream);
  7525. }
  7526. drawLoadingText(95, "Unpacking interfaces");
  7527. TextDrawingArea aclass30_sub2_sub1_sub4s[] = {
  7528. smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  7529. };
  7530. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  7531. drawLoadingText(100, "Preparing game engine");
  7532. for(int j6 = 0; j6 < 33; j6++)
  7533. {
  7534. int k6 = 999;
  7535. int i7 = 0;
  7536. for(int k7 = 0; k7 < 34; k7++)
  7537. {
  7538. if(mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0)
  7539. {
  7540. if(k6 == 999)
  7541. k6 = k7;
  7542. continue;
  7543. }
  7544. if(k6 == 999)
  7545. continue;
  7546. i7 = k7;
  7547. break;
  7548. }
  7549.  
  7550. anIntArray968[j6] = k6;
  7551. anIntArray1057[j6] = i7 - k6;
  7552. }
  7553.  
  7554. for(int l6 = 5; l6 < 156; l6++)
  7555. {
  7556. int j7 = 999;
  7557. int l7 = 0;
  7558. for(int j8 = 25; j8 < 172; j8++)
  7559. {
  7560. if(mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34))
  7561. {
  7562. if(j7 == 999)
  7563. j7 = j8;
  7564. continue;
  7565. }
  7566. if(j7 == 999)
  7567. continue;
  7568. l7 = j8;
  7569. break;
  7570. }
  7571.  
  7572. anIntArray1052[l6 - 5] = j7 - 25;
  7573. anIntArray1229[l6 - 5] = l7 - j7;
  7574. }
  7575.  
  7576. Texture.method365(765, 503);
  7577. fullScreenTextureArray = Texture.anIntArray1472;
  7578. Texture.method365(519, 165);
  7579. anIntArray1180 = Texture.anIntArray1472;
  7580. Texture.method365(246, 335);
  7581. anIntArray1181 = Texture.anIntArray1472;
  7582. Texture.method365(512, 334);
  7583. anIntArray1182 = Texture.anIntArray1472;
  7584. int ai[] = new int[9];
  7585. for(int i8 = 0; i8 < 9; i8++)
  7586. {
  7587. int k8 = 128 + i8 * 32 + 15;
  7588. int l8 = 600 + k8 * 3;
  7589. int i9 = Texture.anIntArray1470[k8];
  7590. ai[i8] = l8 * i9 >> 16;
  7591. }
  7592.  
  7593. WorldController.method310(500, 800, 512, 334, ai);
  7594. Censor.loadConfig(streamLoader_4);
  7595. mouseDetection = new MouseDetection(this);
  7596. startRunnable(mouseDetection, 10);
  7597. Animable_Sub5.clientInstance = this;
  7598. ObjectDef.clientInstance = this;
  7599. EntityDef.clientInstance = this;
  7600. return;
  7601. }
  7602. catch(Exception exception)
  7603. {
  7604. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  7605. }
  7606. loadingError = true;
  7607. }
  7608.  
  7609. private void method91(Stream stream, int i)
  7610. {
  7611. while(stream.bitPosition + 10 < i * 8)
  7612. {
  7613. int j = stream.readBits(11);
  7614. if(j == 2047)
  7615. break;
  7616. if(playerArray[j] == null)
  7617. {
  7618. playerArray[j] = new Player();
  7619. if(aStreamArray895s[j] != null)
  7620. playerArray[j].updatePlayer(aStreamArray895s[j]);
  7621. }
  7622. playerIndices[playerCount++] = j;
  7623. Player player = playerArray[j];
  7624. player.anInt1537 = loopCycle;
  7625. int k = stream.readBits(1);
  7626. if(k == 1)
  7627. anIntArray894[anInt893++] = j;
  7628. int l = stream.readBits(1);
  7629. int i1 = stream.readBits(5);
  7630. if(i1 > 15)
  7631. i1 -= 32;
  7632. int j1 = stream.readBits(5);
  7633. if(j1 > 15)
  7634. j1 -= 32;
  7635. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  7636. }
  7637. stream.finishBitAccess();
  7638. }
  7639.  
  7640. private void processMainScreenClick() {
  7641. if(anInt1021 != 0)
  7642. return;
  7643. if(super.clickMode3 == 1) {
  7644. int i = super.saveClickX - 25 - 545;
  7645. int j = super.saveClickY - 5 - 4;
  7646. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  7647. i -= 73;
  7648. j -= 75;
  7649. int k = minimapInt1 + minimapInt2 & 0x7ff;
  7650. int i1 = Texture.anIntArray1470[k];
  7651. int j1 = Texture.anIntArray1471[k];
  7652. i1 = i1 * (minimapInt3 + 256) >> 8;
  7653. j1 = j1 * (minimapInt3 + 256) >> 8;
  7654. int k1 = j * i1 + i * j1 >> 11;
  7655. int l1 = j * j1 - i * i1 >> 11;
  7656. int i2 = myPlayer.x + k1 >> 7;
  7657. int j2 = myPlayer.y - l1 >> 7;
  7658. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  7659. if(flag1) {
  7660. stream.writeWordBigEndian(i);
  7661. stream.writeWordBigEndian(j);
  7662. stream.writeWord(minimapInt1);
  7663. stream.writeWordBigEndian(57);
  7664. stream.writeWordBigEndian(minimapInt2);
  7665. stream.writeWordBigEndian(minimapInt3);
  7666. stream.writeWordBigEndian(89);
  7667. stream.writeWord(myPlayer.x);
  7668. stream.writeWord(myPlayer.y);
  7669. stream.writeWordBigEndian(anInt1264);
  7670. stream.writeWordBigEndian(63);
  7671. }
  7672. }
  7673. anInt1117++;
  7674. if(anInt1117 > 1151) {
  7675. anInt1117 = 0;
  7676. stream.createFrame(246);
  7677. stream.writeWordBigEndian(0);
  7678. int l = stream.currentOffset;
  7679. if((int)(Math.random() * 2D) == 0)
  7680. stream.writeWordBigEndian(101);
  7681. stream.writeWordBigEndian(197);
  7682. stream.writeWord((int)(Math.random() * 65536D));
  7683. stream.writeWordBigEndian((int)(Math.random() * 256D));
  7684. stream.writeWordBigEndian(67);
  7685. stream.writeWord(14214);
  7686. if((int)(Math.random() * 2D) == 0)
  7687. stream.writeWord(29487);
  7688. stream.writeWord((int)(Math.random() * 65536D));
  7689. if((int)(Math.random() * 2D) == 0)
  7690. stream.writeWordBigEndian(220);
  7691. stream.writeWordBigEndian(180);
  7692. stream.writeBytes(stream.currentOffset - l);
  7693. }
  7694. }
  7695. }
  7696.  
  7697. private String interfaceIntToString(int j) {
  7698. if(j < 0x3b9ac9ff)
  7699. return String.valueOf(j);
  7700. else
  7701. return "*";
  7702. }
  7703.  
  7704. private void showErrorScreen()
  7705. {
  7706. Graphics g = getGameComponent().getGraphics();
  7707. g.setColor(Color.black);
  7708. g.fillRect(0, 0, 765, 503);
  7709. method4(1);
  7710. if(loadingError)
  7711. {
  7712. aBoolean831 = false;
  7713. g.setFont(new Font("Helvetica", 1, 16));
  7714. g.setColor(Color.yellow);
  7715. int k = 35;
  7716. g.drawString("Sorry, an error has occured whilst loading RuneScape", 30, k);
  7717. k += 50;
  7718. g.setColor(Color.white);
  7719. g.drawString("To fix this try the following (in order):", 30, k);
  7720. k += 50;
  7721. g.setColor(Color.white);
  7722. g.setFont(new Font("Helvetica", 1, 12));
  7723. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  7724. k += 30;
  7725. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  7726. k += 30;
  7727. g.drawString("3: Try using a different game-world", 30, k);
  7728. k += 30;
  7729. g.drawString("4: Try rebooting your computer", 30, k);
  7730. k += 30;
  7731. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  7732. }
  7733. if(genericLoadingError)
  7734. {
  7735. aBoolean831 = false;
  7736. g.setFont(new Font("Helvetica", 1, 20));
  7737. g.setColor(Color.white);
  7738. g.drawString("Error - unable to load game!", 50, 50);
  7739. g.drawString("To play RuneScape make sure you play from", 50, 100);
  7740. g.drawString("http://www.runescape.com", 50, 150);
  7741. }
  7742. if(rsAlreadyLoaded)
  7743. {
  7744. aBoolean831 = false;
  7745. g.setColor(Color.yellow);
  7746. int l = 35;
  7747. g.drawString("Error a copy of RuneScape already appears to be loaded", 30, l);
  7748. l += 50;
  7749. g.setColor(Color.white);
  7750. g.drawString("To fix this try the following (in order):", 30, l);
  7751. l += 50;
  7752. g.setColor(Color.white);
  7753. g.setFont(new Font("Helvetica", 1, 12));
  7754. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  7755. l += 30;
  7756. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  7757. l += 30;
  7758. }
  7759. }
  7760.  
  7761. public URL getCodeBase() {
  7762. try {
  7763. return new URL(server +":" + (80 + portOff));
  7764. } catch(Exception _ex) {
  7765. }
  7766. return null;
  7767. }
  7768.  
  7769. private void method95() {
  7770. for(int j = 0; j < npcCount; j++) {
  7771. int k = npcIndices[j];
  7772. NPC npc = npcArray[k];
  7773. if(npc != null)
  7774. method96(npc);
  7775. }
  7776. }
  7777.  
  7778. private void method96(Entity entity)
  7779. {
  7780. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  7781. {
  7782. entity.anim = -1;
  7783. entity.anInt1520 = -1;
  7784. entity.anInt1547 = 0;
  7785. entity.anInt1548 = 0;
  7786. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7787. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7788. entity.method446();
  7789. }
  7790. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  7791. {
  7792. entity.anim = -1;
  7793. entity.anInt1520 = -1;
  7794. entity.anInt1547 = 0;
  7795. entity.anInt1548 = 0;
  7796. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7797. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7798. entity.method446();
  7799. }
  7800. if(entity.anInt1547 > loopCycle)
  7801. method97(entity);
  7802. else
  7803. if(entity.anInt1548 >= loopCycle)
  7804. method98(entity);
  7805. else
  7806. method99(entity);
  7807. method100(entity);
  7808. method101(entity);
  7809. }
  7810.  
  7811. private void method97(Entity entity)
  7812. {
  7813. int i = entity.anInt1547 - loopCycle;
  7814. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7815. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7816. entity.x += (j - entity.x) / i;
  7817. entity.y += (k - entity.y) / i;
  7818. entity.anInt1503 = 0;
  7819. if(entity.anInt1549 == 0)
  7820. entity.turnDirection = 1024;
  7821. if(entity.anInt1549 == 1)
  7822. entity.turnDirection = 1536;
  7823. if(entity.anInt1549 == 2)
  7824. entity.turnDirection = 0;
  7825. if(entity.anInt1549 == 3)
  7826. entity.turnDirection = 512;
  7827. }
  7828.  
  7829. private void method98(Entity entity)
  7830. {
  7831. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  7832. {
  7833. int i = entity.anInt1548 - entity.anInt1547;
  7834. int j = loopCycle - entity.anInt1547;
  7835. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7836. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7837. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  7838. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  7839. entity.x = (k * (i - j) + i1 * j) / i;
  7840. entity.y = (l * (i - j) + j1 * j) / i;
  7841. }
  7842. entity.anInt1503 = 0;
  7843. if(entity.anInt1549 == 0)
  7844. entity.turnDirection = 1024;
  7845. if(entity.anInt1549 == 1)
  7846. entity.turnDirection = 1536;
  7847. if(entity.anInt1549 == 2)
  7848. entity.turnDirection = 0;
  7849. if(entity.anInt1549 == 3)
  7850. entity.turnDirection = 512;
  7851. entity.anInt1552 = entity.turnDirection;
  7852. }
  7853.  
  7854. private void method99(Entity entity)
  7855. {
  7856. entity.anInt1517 = entity.anInt1511;
  7857. if(entity.smallXYIndex == 0)
  7858. {
  7859. entity.anInt1503 = 0;
  7860. return;
  7861. }
  7862. if(entity.anim != -1 && entity.anInt1529 == 0)
  7863. {
  7864. Animation animation = Animation.anims[entity.anim];
  7865. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  7866. {
  7867. entity.anInt1503++;
  7868. return;
  7869. }
  7870. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  7871. {
  7872. entity.anInt1503++;
  7873. return;
  7874. }
  7875. }
  7876. int i = entity.x;
  7877. int j = entity.y;
  7878. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7879. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7880. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  7881. {
  7882. entity.x = k;
  7883. entity.y = l;
  7884. return;
  7885. }
  7886. if(i < k)
  7887. {
  7888. if(j < l)
  7889. entity.turnDirection = 1280;
  7890. else
  7891. if(j > l)
  7892. entity.turnDirection = 1792;
  7893. else
  7894. entity.turnDirection = 1536;
  7895. } else
  7896. if(i > k)
  7897. {
  7898. if(j < l)
  7899. entity.turnDirection = 768;
  7900. else
  7901. if(j > l)
  7902. entity.turnDirection = 256;
  7903. else
  7904. entity.turnDirection = 512;
  7905. } else
  7906. if(j < l)
  7907. entity.turnDirection = 1024;
  7908. else
  7909. entity.turnDirection = 0;
  7910. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  7911. if(i1 > 1024)
  7912. i1 -= 2048;
  7913. int j1 = entity.anInt1555;
  7914. if(i1 >= -256 && i1 <= 256)
  7915. j1 = entity.anInt1554;
  7916. else
  7917. if(i1 >= 256 && i1 < 768)
  7918. j1 = entity.anInt1557;
  7919. else
  7920. if(i1 >= -768 && i1 <= -256)
  7921. j1 = entity.anInt1556;
  7922. if(j1 == -1)
  7923. j1 = entity.anInt1554;
  7924. entity.anInt1517 = j1;
  7925. int k1 = 4;
  7926. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  7927. k1 = 2;
  7928. if(entity.smallXYIndex > 2)
  7929. k1 = 6;
  7930. if(entity.smallXYIndex > 3)
  7931. k1 = 8;
  7932. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  7933. {
  7934. k1 = 8;
  7935. entity.anInt1503--;
  7936. }
  7937. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  7938. k1 <<= 1;
  7939. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  7940. entity.anInt1517 = entity.anInt1505;
  7941. if(i < k)
  7942. {
  7943. entity.x += k1;
  7944. if(entity.x > k)
  7945. entity.x = k;
  7946. } else
  7947. if(i > k)
  7948. {
  7949. entity.x -= k1;
  7950. if(entity.x < k)
  7951. entity.x = k;
  7952. }
  7953. if(j < l)
  7954. {
  7955. entity.y += k1;
  7956. if(entity.y > l)
  7957. entity.y = l;
  7958. } else
  7959. if(j > l)
  7960. {
  7961. entity.y -= k1;
  7962. if(entity.y < l)
  7963. entity.y = l;
  7964. }
  7965. if(entity.x == k && entity.y == l)
  7966. {
  7967. entity.smallXYIndex--;
  7968. if(entity.anInt1542 > 0)
  7969. entity.anInt1542--;
  7970. }
  7971. }
  7972.  
  7973. private void method100(Entity entity)
  7974. {
  7975. if(entity.anInt1504 == 0)
  7976. return;
  7977. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  7978. {
  7979. NPC npc = npcArray[entity.interactingEntity];
  7980. if(npc != null)
  7981. {
  7982. int i1 = entity.x - npc.x;
  7983. int k1 = entity.y - npc.y;
  7984. if(i1 != 0 || k1 != 0)
  7985. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  7986. }
  7987. }
  7988. if(entity.interactingEntity >= 32768)
  7989. {
  7990. int j = entity.interactingEntity - 32768;
  7991. if(j == unknownInt10)
  7992. j = myPlayerIndex;
  7993. Player player = playerArray[j];
  7994. if(player != null)
  7995. {
  7996. int l1 = entity.x - player.x;
  7997. int i2 = entity.y - player.y;
  7998. if(l1 != 0 || i2 != 0)
  7999. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  8000. }
  8001. }
  8002. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  8003. {
  8004. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  8005. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  8006. if(k != 0 || j1 != 0)
  8007. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  8008. entity.anInt1538 = 0;
  8009. entity.anInt1539 = 0;
  8010. }
  8011. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8012. if(l != 0)
  8013. {
  8014. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8015. entity.anInt1552 = entity.turnDirection;
  8016. else
  8017. if(l > 1024)
  8018. entity.anInt1552 -= entity.anInt1504;
  8019. else
  8020. entity.anInt1552 += entity.anInt1504;
  8021. entity.anInt1552 &= 0x7ff;
  8022. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  8023. {
  8024. if(entity.anInt1512 != -1)
  8025. {
  8026. entity.anInt1517 = entity.anInt1512;
  8027. return;
  8028. }
  8029. entity.anInt1517 = entity.anInt1554;
  8030. }
  8031. }
  8032. }
  8033.  
  8034. private void method101(Entity entity)
  8035. {
  8036. entity.aBoolean1541 = false;
  8037. if(entity.anInt1517 != -1)
  8038. {
  8039. Animation animation = Animation.anims[entity.anInt1517];
  8040. entity.anInt1519++;
  8041. if(entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518))
  8042. {
  8043. entity.anInt1519 = 0;
  8044. entity.anInt1518++;
  8045. }
  8046. if(entity.anInt1518 >= animation.anInt352)
  8047. {
  8048. entity.anInt1519 = 0;
  8049. entity.anInt1518 = 0;
  8050. }
  8051. }
  8052. if(entity.anInt1520 != -1 && loopCycle >= entity.anInt1523)
  8053. {
  8054. if(entity.anInt1521 < 0)
  8055. entity.anInt1521 = 0;
  8056. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8057. for(entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  8058. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8059.  
  8060. if(entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  8061. entity.anInt1520 = -1;
  8062. }
  8063. if(entity.anim != -1 && entity.anInt1529 <= 1)
  8064. {
  8065. Animation animation_2 = Animation.anims[entity.anim];
  8066. if(animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle)
  8067. {
  8068. entity.anInt1529 = 1;
  8069. return;
  8070. }
  8071. }
  8072. if(entity.anim != -1 && entity.anInt1529 == 0)
  8073. {
  8074. Animation animation_3 = Animation.anims[entity.anim];
  8075. for(entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  8076. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8077.  
  8078. if(entity.anInt1527 >= animation_3.anInt352)
  8079. {
  8080. entity.anInt1527 -= animation_3.anInt356;
  8081. entity.anInt1530++;
  8082. if(entity.anInt1530 >= animation_3.anInt362)
  8083. entity.anim = -1;
  8084. if(entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  8085. entity.anim = -1;
  8086. }
  8087. entity.aBoolean1541 = animation_3.aBoolean358;
  8088. }
  8089. if(entity.anInt1529 > 0)
  8090. entity.anInt1529--;
  8091. }
  8092.  
  8093. private void drawGameScreen()
  8094. {
  8095. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  8096. if (loadingStage == 2) {
  8097. method119(anInt945, fullscreenInterfaceID);
  8098. if (openInterfaceID != -1) {
  8099. method119(anInt945, openInterfaceID);
  8100. }
  8101. anInt945 = 0;
  8102. resetAllImageProducers();
  8103. super.fullGameScreen.initDrawingArea();
  8104. Texture.anIntArray1472 = fullScreenTextureArray;
  8105. DrawingArea.setAllPixelsToZero();
  8106. welcomeScreenRaised = true;
  8107. if (openInterfaceID != -1) {
  8108. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  8109. if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  8110. rsInterface_1.width = 765;
  8111. rsInterface_1.height = 503;
  8112. }
  8113. drawInterface(0, 0, rsInterface_1, 8);
  8114. }
  8115. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  8116. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  8117. rsInterface.width = 765;
  8118. rsInterface.height = 503;
  8119. }
  8120. drawInterface(0, 0, rsInterface, 8);
  8121.  
  8122. if (!menuOpen) {
  8123. processRightClick();
  8124. drawTooltip();
  8125. } else {
  8126. drawMenu();
  8127. }
  8128. }
  8129. drawCount++;
  8130. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  8131. return;
  8132. } else {
  8133. if (drawCount != 0) {
  8134. resetImageProducers2();
  8135. }
  8136. }
  8137. if(welcomeScreenRaised) {
  8138. welcomeScreenRaised = false;
  8139. topFrame.drawGraphics(0, super.graphics, 0);
  8140. leftFrame.drawGraphics(4, super.graphics, 0);
  8141. rightFrame.drawGraphics(4, super.graphics, 516);
  8142. mapEdgeIP.drawGraphics(4, super.graphics, 519);
  8143. needDrawTabArea = true;
  8144. inputTaken = true;
  8145. tabAreaAltered = true;
  8146. aBoolean1233 = true;
  8147. if(loadingStage != 2) {
  8148. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  8149. aRSImageProducer_1164.drawGraphics(4, super.graphics, 545);
  8150. }
  8151. }
  8152. if(menuOpen && menuScreenArea == 1)
  8153. needDrawTabArea = true;
  8154. if(invOverlayInterfaceID != -1)
  8155. {
  8156. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  8157. if(flag1)
  8158. needDrawTabArea = true;
  8159. }
  8160. if(atInventoryInterfaceType == 2)
  8161. needDrawTabArea = true;
  8162. if(activeInterfaceType == 2)
  8163. needDrawTabArea = true;
  8164. /*if(needDrawTabArea)
  8165. {*/
  8166. drawTabArea();
  8167. /*needDrawTabArea = false;
  8168. }*/
  8169. if(backDialogID == -1)
  8170. {
  8171. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  8172. if(super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  8173. method65(494, 110, super.mouseX - 0, super.mouseY - 348, aClass9_1059, 0, false, anInt1211);
  8174. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  8175. if(i < 0)
  8176. i = 0;
  8177. if(i > anInt1211 - 110)
  8178. i = anInt1211 - 110;
  8179. if(anInt1089 != i)
  8180. {
  8181. anInt1089 = i;
  8182. inputTaken = true;
  8183. }
  8184. }
  8185. if(backDialogID != -1) {
  8186. boolean flag2 = method119(anInt945, backDialogID);
  8187. if(flag2)
  8188. inputTaken = true;
  8189. }
  8190. if(atInventoryInterfaceType == 3)
  8191. inputTaken = true;
  8192. if(activeInterfaceType == 3)
  8193. inputTaken = true;
  8194. if(aString844 != null)
  8195. inputTaken = true;
  8196. if(menuOpen && menuScreenArea == 2)
  8197. inputTaken = true;
  8198. if(inputTaken) {
  8199. drawChatArea();
  8200. inputTaken = false;
  8201. }
  8202. if(loadingStage == 2)
  8203. method146();
  8204. if(loadingStage == 2) {
  8205. drawMinimap();
  8206. aRSImageProducer_1164.drawGraphics(4, super.graphics, 545);
  8207. }
  8208. if(anInt1054 != -1)
  8209. tabAreaAltered = true;
  8210. if(tabAreaAltered)
  8211. {
  8212. if(anInt1054 != -1 && anInt1054 == tabID)
  8213. {
  8214. anInt1054 = -1;
  8215. stream.createFrame(120);
  8216. stream.writeWordBigEndian(tabID);
  8217. }
  8218. tabAreaAltered = false;
  8219. aRSImageProducer_1125.initDrawingArea();
  8220. aRSImageProducer_1165.initDrawingArea();
  8221. }
  8222. anInt945 = 0;
  8223. }
  8224.  
  8225. private boolean buildFriendsListMenu(RSInterface class9)
  8226. {
  8227. int i = class9.contentType;
  8228. if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  8229. {
  8230. if(i >= 801)
  8231. i -= 701;
  8232. else
  8233. if(i >= 701)
  8234. i -= 601;
  8235. else
  8236. if(i >= 101)
  8237. i -= 101;
  8238. else
  8239. i--;
  8240. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  8241. menuActionID[menuActionRow] = 792;
  8242. menuActionRow++;
  8243. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  8244. menuActionID[menuActionRow] = 639;
  8245. menuActionRow++;
  8246. return true;
  8247. }
  8248. if(i >= 401 && i <= 500)
  8249. {
  8250. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  8251. menuActionID[menuActionRow] = 322;
  8252. menuActionRow++;
  8253. return true;
  8254. } else
  8255. {
  8256. return false;
  8257. }
  8258. }
  8259.  
  8260. private void method104()
  8261. {
  8262. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  8263. for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  8264. if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  8265. class30_sub2_sub4_sub3.unlink();
  8266. else
  8267. if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  8268. {
  8269. class30_sub2_sub4_sub3.method454(anInt945);
  8270. if(class30_sub2_sub4_sub3.aBoolean1567)
  8271. class30_sub2_sub4_sub3.unlink();
  8272. else
  8273. 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);
  8274. }
  8275.  
  8276. }
  8277.  
  8278. public void drawBlackBox(int xPos, int yPos) {
  8279. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  8280. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  8281. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  8282. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  8283. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  8284. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  8285. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  8286. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  8287. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  8288. }
  8289.  
  8290. private void drawInterface(int j, int k, RSInterface class9, int l) {
  8291. if(class9.type != 0 || class9.children == null)
  8292. return;
  8293. if(class9.isMouseoverTriggered && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  8294. return;
  8295. int i1 = DrawingArea.topX;
  8296. int j1 = DrawingArea.topY;
  8297. int k1 = DrawingArea.bottomX;
  8298. int l1 = DrawingArea.bottomY;
  8299. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  8300. int i2 = class9.children.length;
  8301. for(int j2 = 0; j2 < i2; j2++) {
  8302. int k2 = class9.childX[j2] + k;
  8303. int l2 = (class9.childY[j2] + l) - j;
  8304. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  8305. k2 += class9_1.anInt263;
  8306. l2 += class9_1.anInt265;
  8307. if(class9_1.contentType > 0)
  8308. drawFriendsListOrWelcomeScreen(class9_1);
  8309. //here
  8310. int[] IDs = {
  8311. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
  8312. 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
  8313. 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
  8314. 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
  8315. 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  8316. /* Ancients */
  8317. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
  8318. 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  8319. };
  8320. for(int m5 = 0; m5 < IDs.length; m5++) {
  8321. if(class9_1.id == IDs[m5] + 1) {
  8322. if(m5 > 61)
  8323. drawBlackBox(k2 + 1, l2);
  8324. else
  8325. drawBlackBox(k2, l2 + 1);
  8326. }
  8327. }
  8328. int[] runeChildren = {
  8329. 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
  8330. 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
  8331. 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
  8332. 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
  8333. 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
  8334. 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
  8335. 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
  8336. 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
  8337. 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
  8338. 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
  8339. 15885, 18474, 18475, 18478
  8340. };
  8341. for(int r = 0; r < runeChildren.length; r++)
  8342. if(class9_1.id == runeChildren[r])
  8343. class9_1.modelZoom = 775;
  8344. if(class9_1.type == 0) {
  8345. if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  8346. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  8347. if(class9_1.scrollPosition < 0)
  8348. class9_1.scrollPosition = 0;
  8349. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  8350. if(class9_1.scrollMax > class9_1.height)
  8351. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  8352. } else if(class9_1.type != 1)
  8353. if(class9_1.type == 2) {
  8354. int i3 = 0;
  8355. for(int l3 = 0; l3 < class9_1.height; l3++) {
  8356. for(int l4 = 0; l4 < class9_1.width; l4++) {
  8357. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  8358. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  8359. if(i3 < 20) {
  8360. k5 += class9_1.spritesX[i3];
  8361. j6 += class9_1.spritesY[i3];
  8362. }
  8363. if(class9_1.inv[i3] > 0) {
  8364. int k6 = 0;
  8365. int j7 = 0;
  8366. int j9 = class9_1.inv[i3] - 1;
  8367. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  8368. int l9 = 0;
  8369. if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  8370. l9 = 0xffffff;
  8371. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  8372. if(class30_sub2_sub1_sub1_2 != null) {
  8373. if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  8374. k6 = super.mouseX - anInt1087;
  8375. j7 = super.mouseY - anInt1088;
  8376. if(k6 < 5 && k6 > -5)
  8377. k6 = 0;
  8378. if(j7 < 5 && j7 > -5)
  8379. j7 = 0;
  8380. if(anInt989 < 5) {
  8381. k6 = 0;
  8382. j7 = 0;
  8383. }
  8384. class30_sub2_sub1_sub1_2.drawSprite1(k5 + k6, j6 + j7);
  8385. if(j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  8386. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  8387. if(i10 > anInt945 * 10)
  8388. i10 = anInt945 * 10;
  8389. if(i10 > class9.scrollPosition)
  8390. i10 = class9.scrollPosition;
  8391. class9.scrollPosition -= i10;
  8392. anInt1088 += i10;
  8393. }
  8394. if(j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  8395. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  8396. if(j10 > anInt945 * 10)
  8397. j10 = anInt945 * 10;
  8398. if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  8399. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  8400. class9.scrollPosition += j10;
  8401. anInt1088 -= j10;
  8402. }
  8403. } else if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  8404. class30_sub2_sub1_sub1_2.drawSprite1(k5, j6);
  8405. else
  8406. class30_sub2_sub1_sub1_2.drawSprite(k5, j6);
  8407. if(class30_sub2_sub1_sub1_2.anInt1444 == 33 || class9_1.invStackSizes[i3] != 1)
  8408. {
  8409. int k10 = class9_1.invStackSizes[i3];
  8410. if(k10 >= 1)
  8411. smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8412. if(k10 >= 100000)
  8413. smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8414. if(k10 >= 10000000)
  8415. smallText.method385(0x49E20E, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8416.  
  8417. /*smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  8418. smallText.method385(0xffff00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);*/
  8419. }
  8420. }
  8421. }
  8422. } else if(class9_1.sprites != null && i3 < 20) {
  8423. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  8424. if(class30_sub2_sub1_sub1_1 != null)
  8425. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  8426. }
  8427. i3++;
  8428. }
  8429. }
  8430. } else if(class9_1.type == 3) {
  8431. boolean flag = false;
  8432. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8433. flag = true;
  8434. int j3;
  8435. if(interfaceIsSelected(class9_1)) {
  8436. j3 = class9_1.anInt219;
  8437. if(flag && class9_1.anInt239 != 0)
  8438. j3 = class9_1.anInt239;
  8439. } else {
  8440. j3 = class9_1.textColor;
  8441. if(flag && class9_1.anInt216 != 0)
  8442. j3 = class9_1.anInt216;
  8443. }
  8444. if(class9_1.aByte254 == 0) {
  8445. if(class9_1.aBoolean227)
  8446. DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  8447. else
  8448. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  8449. } else if(class9_1.aBoolean227)
  8450. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.aByte254 & 0xff), k2);
  8451. else
  8452. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.aByte254 & 0xff), j3, class9_1.width, k2);
  8453. } else if(class9_1.type == 4) {
  8454. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  8455. String s = class9_1.message;
  8456. boolean flag1 = false;
  8457. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8458. flag1 = true;
  8459. int i4;
  8460. if(interfaceIsSelected(class9_1)) {
  8461. i4 = class9_1.anInt219;
  8462. if(flag1 && class9_1.anInt239 != 0)
  8463. i4 = class9_1.anInt239;
  8464. if(class9_1.aString228.length() > 0)
  8465. s = class9_1.aString228;
  8466. } else {
  8467. i4 = class9_1.textColor;
  8468. if(flag1 && class9_1.anInt216 != 0)
  8469. i4 = class9_1.anInt216;
  8470. }
  8471. if(class9_1.atActionType == 6 && aBoolean1149) {
  8472. s = "Please wait...";
  8473. i4 = class9_1.textColor;
  8474. }
  8475. if(DrawingArea.width == 519) {
  8476. if(i4 == 0xffff00)
  8477. i4 = 255;
  8478. if(i4 == 49152)
  8479. i4 = 0xffffff;
  8480. }
  8481. if((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  8482. switch (i4) {
  8483. case 16773120: i4 = 0xFE981F; break;
  8484. case 7040819: i4 = 0xAF6A1A; break;
  8485. }
  8486. }
  8487. for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
  8488. {
  8489. if(s.indexOf("%") != -1)
  8490. {
  8491. do
  8492. {
  8493. int k7 = s.indexOf("%1");
  8494. if(k7 == -1)
  8495. break;
  8496. 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)
  8497. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8498. else
  8499. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8500. } while(true);
  8501. do
  8502. {
  8503. int l7 = s.indexOf("%2");
  8504. if(l7 == -1)
  8505. break;
  8506. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  8507. } while(true);
  8508. do
  8509. {
  8510. int i8 = s.indexOf("%3");
  8511. if(i8 == -1)
  8512. break;
  8513. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  8514. } while(true);
  8515. do
  8516. {
  8517. int j8 = s.indexOf("%4");
  8518. if(j8 == -1)
  8519. break;
  8520. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  8521. } while(true);
  8522. do
  8523. {
  8524. int k8 = s.indexOf("%5");
  8525. if(k8 == -1)
  8526. break;
  8527. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  8528. } while(true);
  8529. }
  8530. int l8 = s.indexOf("\\n");
  8531. String s1;
  8532. if(l8 != -1)
  8533. {
  8534. s1 = s.substring(0, l8);
  8535. s = s.substring(l8 + 2);
  8536. } else
  8537. {
  8538. s1 = s;
  8539. s = "";
  8540. }
  8541. if(class9_1.centerText)
  8542. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadow);
  8543. else
  8544. textDrawingArea.method389(class9_1.textShadow, k2, i4, s1, l6);
  8545. }
  8546. } else if(class9_1.type == 5) {
  8547. //whats this?
  8548. Sprite sprite;
  8549. if(interfaceIsSelected(class9_1))
  8550. sprite = class9_1.sprite2;
  8551. else
  8552. sprite = class9_1.sprite1;
  8553. if(spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
  8554. sprite.drawSprite(k2, l2, 0xffffff);
  8555. } else {
  8556. if (sprite != null)
  8557. sprite.drawSprite(k2, l2);
  8558. }
  8559. if(sprite != null)
  8560. sprite.drawSprite(k2, l2);
  8561. } else if(class9_1.type == 6) {
  8562. int k3 = Texture.textureInt1;
  8563. int j4 = Texture.textureInt2;
  8564. Texture.textureInt1 = k2 + class9_1.width / 2;
  8565. Texture.textureInt2 = l2 + class9_1.height / 2;
  8566. int i5 = Texture.anIntArray1470[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8567. int l5 = Texture.anIntArray1471[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8568. boolean flag2 = interfaceIsSelected(class9_1);
  8569. int i7;
  8570. if(flag2)
  8571. i7 = class9_1.anInt258;
  8572. else
  8573. i7 = class9_1.anInt257;
  8574. Model model;
  8575. if(i7 == -1) {
  8576. model = class9_1.method209(-1, -1, flag2);
  8577. } else {
  8578. Animation animation = Animation.anims[i7];
  8579. model = class9_1.method209(animation.anIntArray354[class9_1.anInt246], animation.anIntArray353[class9_1.anInt246], flag2);
  8580. }
  8581. if(model != null)
  8582. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  8583. Texture.textureInt1 = k3;
  8584. Texture.textureInt2 = j4;
  8585. } else if(class9_1.type == 7) {
  8586. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  8587. int k4 = 0;
  8588. for(int j5 = 0; j5 < class9_1.height; j5++) {
  8589. for(int i6 = 0; i6 < class9_1.width; i6++) {
  8590. if(class9_1.inv[k4] > 0) {
  8591. ItemDef itemDef = ItemDef.forID(class9_1.inv[k4] - 1);
  8592. String s2 = itemDef.name;
  8593. if(itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  8594. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  8595. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  8596. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  8597. if(class9_1.centerText)
  8598. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadow);
  8599. else
  8600. textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  8601. }
  8602. k4++;
  8603. }
  8604. }
  8605. } else if (class9_1.type == 8) {
  8606. drawHoverBox(k2, l2, class9_1.popupString);
  8607. }
  8608. }
  8609. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  8610. }
  8611.  
  8612. private void randomizeBackground(Background background) {
  8613. int j = 256;
  8614. for(int k = 0; k < anIntArray1190.length; k++)
  8615. anIntArray1190[k] = 0;
  8616.  
  8617. for(int l = 0; l < 5000; l++) {
  8618. int i1 = (int)(Math.random() * 128D * (double)j);
  8619. anIntArray1190[i1] = (int)(Math.random() * 256D);
  8620. }
  8621. for(int j1 = 0; j1 < 20; j1++) {
  8622. for(int k1 = 1; k1 < j - 1; k1++) {
  8623. for(int i2 = 1; i2 < 127; i2++) {
  8624. int k2 = i2 + (k1 << 7);
  8625. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  8626. }
  8627.  
  8628. }
  8629. int ai[] = anIntArray1190;
  8630. anIntArray1190 = anIntArray1191;
  8631. anIntArray1191 = ai;
  8632. }
  8633. if(background != null) {
  8634. int l1 = 0;
  8635. for(int j2 = 0; j2 < background.anInt1453; j2++) {
  8636. for(int l2 = 0; l2 < background.anInt1452; l2++)
  8637. if(background.aByteArray1450[l1++] != 0) {
  8638. int i3 = l2 + 16 + background.anInt1454;
  8639. int j3 = j2 + 16 + background.anInt1455;
  8640. int k3 = i3 + (j3 << 7);
  8641. anIntArray1190[k3] = 0;
  8642. }
  8643. }
  8644. }
  8645. }
  8646.  
  8647. private void method107(int i, int j, Stream stream, Player player)
  8648. {
  8649. if((i & 0x400) != 0)
  8650. {
  8651. player.anInt1543 = stream.method428();
  8652. player.anInt1545 = stream.method428();
  8653. player.anInt1544 = stream.method428();
  8654. player.anInt1546 = stream.method428();
  8655. player.anInt1547 = stream.method436() + loopCycle;
  8656. player.anInt1548 = stream.method435() + loopCycle;
  8657. player.anInt1549 = stream.method428();
  8658. player.method446();
  8659. }
  8660. if((i & 0x100) != 0)
  8661. {
  8662. player.anInt1520 = stream.method434();
  8663. int k = stream.readDWord();
  8664. player.anInt1524 = k >> 16;
  8665. player.anInt1523 = loopCycle + (k & 0xffff);
  8666. player.anInt1521 = 0;
  8667. player.anInt1522 = 0;
  8668. if(player.anInt1523 > loopCycle)
  8669. player.anInt1521 = -1;
  8670. if(player.anInt1520 == 65535)
  8671. player.anInt1520 = -1;
  8672. }
  8673. if((i & 8) != 0)
  8674. {
  8675. int l = stream.method434();
  8676. if(l == 65535)
  8677. l = -1;
  8678. int i2 = stream.method427();
  8679. if(l == player.anim && l != -1)
  8680. {
  8681. int i3 = Animation.anims[l].anInt365;
  8682. if(i3 == 1)
  8683. {
  8684. player.anInt1527 = 0;
  8685. player.anInt1528 = 0;
  8686. player.anInt1529 = i2;
  8687. player.anInt1530 = 0;
  8688. }
  8689. if(i3 == 2)
  8690. player.anInt1530 = 0;
  8691. } else
  8692. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  8693. {
  8694. player.anim = l;
  8695. player.anInt1527 = 0;
  8696. player.anInt1528 = 0;
  8697. player.anInt1529 = i2;
  8698. player.anInt1530 = 0;
  8699. player.anInt1542 = player.smallXYIndex;
  8700. }
  8701. }
  8702. if((i & 4) != 0)
  8703. {
  8704. player.textSpoken = stream.readString();
  8705. if(player.textSpoken.charAt(0) == '~')
  8706. {
  8707. player.textSpoken = player.textSpoken.substring(1);
  8708. pushMessage(player.textSpoken, 2, player.name);
  8709. } else
  8710. if(player == myPlayer)
  8711. pushMessage(player.textSpoken, 2, player.name);
  8712. player.anInt1513 = 0;
  8713. player.anInt1531 = 0;
  8714. player.textCycle = 150;
  8715. }
  8716. if((i & 0x80) != 0)
  8717. {
  8718. //right fucking here
  8719. int i1 = stream.method434();
  8720. int j2 = stream.readUnsignedByte();
  8721. int j3 = stream.method427();
  8722. int k3 = stream.currentOffset;
  8723. if(player.name != null && player.visible)
  8724. {
  8725. long l3 = TextClass.longForName(player.name);
  8726. boolean flag = false;
  8727. if(j2 <= 1)
  8728. {
  8729. for(int i4 = 0; i4 < ignoreCount; i4++)
  8730. {
  8731. if(ignoreListAsLongs[i4] != l3)
  8732. continue;
  8733. flag = true;
  8734. break;
  8735. }
  8736.  
  8737. }
  8738. if(!flag && anInt1251 == 0)
  8739. try
  8740. {
  8741. aStream_834.currentOffset = 0;
  8742. stream.method442(j3, 0, aStream_834.buffer);
  8743. aStream_834.currentOffset = 0;
  8744. String s = TextInput.method525(j3, aStream_834);
  8745. //s = Censor.doCensor(s);
  8746. player.textSpoken = s;
  8747. player.anInt1513 = i1 >> 8;
  8748. player.privelage = j2;
  8749. player.anInt1531 = i1 & 0xff;
  8750. player.textCycle = 150;
  8751. if(j2 == 2 || j2 == 3)
  8752. pushMessage(s, 1, "@cr2@" + player.name);
  8753. else if(j2 == 1)
  8754. pushMessage(s, 1, "@cr1@" + player.name);
  8755. else
  8756. pushMessage(s, 2, player.name);
  8757. }
  8758. catch(Exception exception)
  8759. {
  8760. signlink.reporterror("cde2");
  8761. }
  8762. }
  8763. stream.currentOffset = k3 + j3;
  8764. }
  8765. if((i & 1) != 0)
  8766. {
  8767. player.interactingEntity = stream.method434();
  8768. if(player.interactingEntity == 65535)
  8769. player.interactingEntity = -1;
  8770. }
  8771. if((i & 0x10) != 0)
  8772. {
  8773. int j1 = stream.method427();
  8774. byte abyte0[] = new byte[j1];
  8775. Stream stream_1 = new Stream(abyte0);
  8776. stream.readBytes(j1, 0, abyte0);
  8777. aStreamArray895s[j] = stream_1;
  8778. player.updatePlayer(stream_1);
  8779. }
  8780. if((i & 2) != 0)
  8781. {
  8782. player.anInt1538 = stream.method436();
  8783. player.anInt1539 = stream.method434();
  8784. }
  8785. if((i & 0x20) != 0)
  8786. {
  8787. int k1 = stream.readUnsignedByte();
  8788. int k2 = stream.method426();
  8789. player.updateHitData(k2, k1, loopCycle);
  8790. player.loopCycleStatus = loopCycle + 300;
  8791. player.currentHealth = stream.method427();
  8792. player.maxHealth = stream.readUnsignedByte();
  8793. }
  8794. if((i & 0x200) != 0)
  8795. {
  8796. int l1 = stream.readUnsignedByte();
  8797. int l2 = stream.method428();
  8798. player.updateHitData(l2, l1, loopCycle);
  8799. player.loopCycleStatus = loopCycle + 300;
  8800. player.currentHealth = stream.readUnsignedByte();
  8801. player.maxHealth = stream.method427();
  8802. }
  8803. }
  8804.  
  8805. private void method108()
  8806. {
  8807. try
  8808. {
  8809. int j = myPlayer.x + anInt1278;
  8810. int k = myPlayer.y + anInt1131;
  8811. if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  8812. {
  8813. anInt1014 = j;
  8814. anInt1015 = k;
  8815. }
  8816. if(anInt1014 != j)
  8817. anInt1014 += (j - anInt1014) / 16;
  8818. if(anInt1015 != k)
  8819. anInt1015 += (k - anInt1015) / 16;
  8820. if(super.keyArray[1] == 1)
  8821. anInt1186 += (-24 - anInt1186) / 2;
  8822. else
  8823. if(super.keyArray[2] == 1)
  8824. anInt1186 += (24 - anInt1186) / 2;
  8825. else
  8826. anInt1186 /= 2;
  8827. if(super.keyArray[3] == 1)
  8828. anInt1187 += (12 - anInt1187) / 2;
  8829. else
  8830. if(super.keyArray[4] == 1)
  8831. anInt1187 += (-12 - anInt1187) / 2;
  8832. else
  8833. anInt1187 /= 2;
  8834. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  8835. anInt1184 += anInt1187 / 2;
  8836. if(anInt1184 < 128)
  8837. anInt1184 = 128;
  8838. if(anInt1184 > 383)
  8839. anInt1184 = 383;
  8840. int l = anInt1014 >> 7;
  8841. int i1 = anInt1015 >> 7;
  8842. int j1 = method42(plane, anInt1015, anInt1014);
  8843. int k1 = 0;
  8844. if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  8845. {
  8846. for(int l1 = l - 4; l1 <= l + 4; l1++)
  8847. {
  8848. for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  8849. {
  8850. int l2 = plane;
  8851. if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  8852. l2++;
  8853. int i3 = j1 - intGroundArray[l2][l1][k2];
  8854. if(i3 > k1)
  8855. k1 = i3;
  8856. }
  8857.  
  8858. }
  8859.  
  8860. }
  8861. anInt1005++;
  8862. if(anInt1005 > 1512)
  8863. {
  8864. anInt1005 = 0;
  8865. stream.createFrame(77);
  8866. stream.writeWordBigEndian(0);
  8867. int i2 = stream.currentOffset;
  8868. stream.writeWordBigEndian((int)(Math.random() * 256D));
  8869. stream.writeWordBigEndian(101);
  8870. stream.writeWordBigEndian(233);
  8871. stream.writeWord(45092);
  8872. if((int)(Math.random() * 2D) == 0)
  8873. stream.writeWord(35784);
  8874. stream.writeWordBigEndian((int)(Math.random() * 256D));
  8875. stream.writeWordBigEndian(64);
  8876. stream.writeWordBigEndian(38);
  8877. stream.writeWord((int)(Math.random() * 65536D));
  8878. stream.writeWord((int)(Math.random() * 65536D));
  8879. stream.writeBytes(stream.currentOffset - i2);
  8880. }
  8881. int j2 = k1 * 192;
  8882. if(j2 > 0x17f00)
  8883. j2 = 0x17f00;
  8884. if(j2 < 32768)
  8885. j2 = 32768;
  8886. if(j2 > anInt984)
  8887. {
  8888. anInt984 += (j2 - anInt984) / 24;
  8889. return;
  8890. }
  8891. if(j2 < anInt984)
  8892. {
  8893. anInt984 += (j2 - anInt984) / 80;
  8894. }
  8895. }
  8896. catch(Exception _ex)
  8897. {
  8898. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  8899. throw new RuntimeException("eek");
  8900. }
  8901. }
  8902.  
  8903. public void processDrawing()
  8904. {
  8905. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  8906. {
  8907. showErrorScreen();
  8908. return;
  8909. }
  8910. anInt1061++;
  8911. if(!loggedIn)
  8912. drawLoginScreen(false);
  8913. else
  8914. drawGameScreen();
  8915. anInt1213 = 0;
  8916. }
  8917.  
  8918. private boolean isFriendOrSelf(String s)
  8919. {
  8920. if(s == null)
  8921. return false;
  8922. for(int i = 0; i < friendsCount; i++)
  8923. if(s.equalsIgnoreCase(friendsList[i]))
  8924. return true;
  8925. return s.equalsIgnoreCase(myPlayer.name);
  8926. }
  8927.  
  8928. private static String combatDiffColor(int i, int j)
  8929. {
  8930. int k = i - j;
  8931. if(k < -9)
  8932. return "@red@";
  8933. if(k < -6)
  8934. return "@or3@";
  8935. if(k < -3)
  8936. return "@or2@";
  8937. if(k < 0)
  8938. return "@or1@";
  8939. if(k > 9)
  8940. return "@gre@";
  8941. if(k > 6)
  8942. return "@gr3@";
  8943. if(k > 3)
  8944. return "@gr2@";
  8945. if(k > 0)
  8946. return "@gr1@";
  8947. else
  8948. return "@yel@";
  8949. }
  8950.  
  8951. private void setWaveVolume(int i)
  8952. {
  8953. signlink.wavevol = i;
  8954. }
  8955.  
  8956. private void draw3dScreen()
  8957. {
  8958. drawSplitPrivateChat();
  8959. if(crossType == 1)
  8960. {
  8961. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  8962. anInt1142++;
  8963. if(anInt1142 > 67)
  8964. {
  8965. anInt1142 = 0;
  8966. stream.createFrame(78);
  8967. }
  8968. }
  8969. if(crossType == 2)
  8970. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  8971. if(anInt1018 != -1)
  8972. {
  8973. method119(anInt945, anInt1018);
  8974. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  8975. }
  8976. if(openInterfaceID != -1)
  8977. {
  8978. method119(anInt945, openInterfaceID);
  8979. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  8980. }
  8981. method70();
  8982. if(!menuOpen)
  8983. {
  8984. processRightClick();
  8985. drawTooltip();
  8986. } else
  8987. if(menuScreenArea == 0)
  8988. drawMenu();
  8989. if(anInt1055 == 1)
  8990. multiOverlay.drawSprite(472, 296);
  8991. if(fpsOn)
  8992. {
  8993. char c = '\u01FB';
  8994. int k = 20;
  8995. int i1 = 0xffff00;
  8996. if(super.fps < 15)
  8997. i1 = 0xff0000;
  8998. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  8999. k += 15;
  9000. Runtime runtime = Runtime.getRuntime();
  9001. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9002. i1 = 0xffff00;
  9003. if(j1 > 0x2000000 && lowMem)
  9004. i1 = 0xff0000;
  9005. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  9006. k += 15;
  9007. }
  9008. int i1 = 0xffff00;
  9009. int x = baseX + (myPlayer.x - 6 >> 7);
  9010. int y = baseY + (myPlayer.y - 6 >> 7);
  9011. if (clientData)
  9012. {
  9013. char c = '\u01FB';
  9014. int k = 20;
  9015. if(super.fps < 15)
  9016. i1 = 0xff0000;
  9017. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285, 5);
  9018. Runtime runtime = Runtime.getRuntime();
  9019. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9020. i1 = 0xffff00;
  9021. if(j1 > 0x2000000 && lowMem)
  9022. i1 = 0xff0000;
  9023. k += 15;
  9024. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299, 5);
  9025. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  9026. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
  9027. }
  9028. if(anInt1104 != 0)
  9029. {
  9030. int j = anInt1104 / 50;
  9031. int l = j / 60;
  9032. j %= 60;
  9033. if(j < 10)
  9034. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  9035. else
  9036. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  9037. anInt849++;
  9038. if(anInt849 > 75)
  9039. {
  9040. anInt849 = 0;
  9041. stream.createFrame(148);
  9042. }
  9043. }
  9044. }
  9045.  
  9046. private void addIgnore(long l)
  9047. {
  9048. try
  9049. {
  9050. if(l == 0L)
  9051. return;
  9052. if(ignoreCount >= 100)
  9053. {
  9054. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  9055. return;
  9056. }
  9057. String s = TextClass.fixName(TextClass.nameForLong(l));
  9058. for(int j = 0; j < ignoreCount; j++)
  9059. if(ignoreListAsLongs[j] == l)
  9060. {
  9061. pushMessage(s + " is already on your ignore list", 0, "");
  9062. return;
  9063. }
  9064. for(int k = 0; k < friendsCount; k++)
  9065. if(friendsListAsLongs[k] == l)
  9066. {
  9067. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  9068. return;
  9069. }
  9070.  
  9071. ignoreListAsLongs[ignoreCount++] = l;
  9072. needDrawTabArea = true;
  9073. stream.createFrame(133);
  9074. stream.writeQWord(l);
  9075. return;
  9076. }
  9077. catch(RuntimeException runtimeexception)
  9078. {
  9079. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  9080. }
  9081. throw new RuntimeException();
  9082. }
  9083.  
  9084. private void method114()
  9085. {
  9086. for(int i = -1; i < playerCount; i++)
  9087. {
  9088. int j;
  9089. if(i == -1)
  9090. j = myPlayerIndex;
  9091. else
  9092. j = playerIndices[i];
  9093. Player player = playerArray[j];
  9094. if(player != null)
  9095. method96(player);
  9096. }
  9097.  
  9098. }
  9099.  
  9100. private void method115()
  9101. {
  9102. if(loadingStage == 2)
  9103. {
  9104. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  9105. {
  9106. if(class30_sub1.anInt1294 > 0)
  9107. class30_sub1.anInt1294--;
  9108. if(class30_sub1.anInt1294 == 0)
  9109. {
  9110. if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  9111. {
  9112. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  9113. class30_sub1.unlink();
  9114. }
  9115. } else
  9116. {
  9117. if(class30_sub1.anInt1302 > 0)
  9118. class30_sub1.anInt1302--;
  9119. 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)))
  9120. {
  9121. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  9122. class30_sub1.anInt1302 = -1;
  9123. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  9124. class30_sub1.unlink();
  9125. else
  9126. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  9127. class30_sub1.unlink();
  9128. }
  9129. }
  9130. }
  9131.  
  9132. }
  9133. }
  9134.  
  9135.  
  9136. //stops the click from going over sprite
  9137. private void determineMenuSize()
  9138. {
  9139. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  9140. for(int j = 0; j < menuActionRow; j++)
  9141. {
  9142. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  9143. if(k > i)
  9144. i = k;
  9145. }
  9146.  
  9147. i += 8;
  9148. int l = 15 * menuActionRow + 21;
  9149. if(super.saveClickX > 4 && super.saveClickY > 4 && super.saveClickX < 516 && super.saveClickY < 338)
  9150. {
  9151. int i1 = super.saveClickX - 4 - i / 2;
  9152. if(i1 + i > 512)
  9153. i1 = 512 - i;
  9154. if(i1 < 0)
  9155. i1 = 0;
  9156. int l1 = super.saveClickY - 4;
  9157. if(l1 + l > 334)
  9158. l1 = 334 - l;
  9159. if(l1 < 0)
  9160. l1 = 0;
  9161. menuOpen = true;
  9162. menuScreenArea = 0;
  9163. menuOffsetX = i1;
  9164. menuOffsetY = l1;
  9165. menuWidth = i;
  9166. menuHeight = 15 * menuActionRow + 22;
  9167. }
  9168. if(super.saveClickX > 519 && super.saveClickY > 168 && super.saveClickX < 765 && super.saveClickY < 503)
  9169. {
  9170. int j1 = super.saveClickX - 519 - i / 2;
  9171. if(j1 < 0)
  9172. j1 = 0;
  9173. else
  9174. if(j1 + i > 245)
  9175. j1 = 245 - i;
  9176. int i2 = super.saveClickY - 168;
  9177. if(i2 < 0)
  9178. i2 = 0;
  9179. else
  9180. if(i2 + l > 333)
  9181. i2 = 333 - l;
  9182. menuOpen = true;
  9183. menuScreenArea = 1;
  9184. menuOffsetX = j1;
  9185. menuOffsetY = i2;
  9186. menuWidth = i;
  9187. menuHeight = 15 * menuActionRow + 22;
  9188. }
  9189. if(super.saveClickX > 0 && super.saveClickY > 338 && super.saveClickX < 516 && super.saveClickY < 503)
  9190. {
  9191. int k1 = super.saveClickX - 0 - i / 2;
  9192. if(k1 < 0)
  9193. k1 = 0;
  9194. else
  9195. if(k1 + i > 516)
  9196. k1 = 516 - i;
  9197. int j2 = super.saveClickY - 338;
  9198. if(j2 < 0)
  9199. j2 = 0;
  9200. else
  9201. if(j2 + l > 165)
  9202. j2 = 165 - l;
  9203. menuOpen = true;
  9204. menuScreenArea = 2;
  9205. menuOffsetX = k1;
  9206. menuOffsetY = j2;
  9207. menuWidth = i;
  9208. menuHeight = 15 * menuActionRow + 22;
  9209. }
  9210. }
  9211.  
  9212. private void method117(Stream stream)
  9213. {
  9214. stream.initBitAccess();
  9215. int j = stream.readBits(1);
  9216. if(j == 0)
  9217. return;
  9218. int k = stream.readBits(2);
  9219. if(k == 0)
  9220. {
  9221. anIntArray894[anInt893++] = myPlayerIndex;
  9222. return;
  9223. }
  9224. if(k == 1)
  9225. {
  9226. int l = stream.readBits(3);
  9227. myPlayer.moveInDir(false, l);
  9228. int k1 = stream.readBits(1);
  9229. if(k1 == 1)
  9230. anIntArray894[anInt893++] = myPlayerIndex;
  9231. return;
  9232. }
  9233. if(k == 2)
  9234. {
  9235. int i1 = stream.readBits(3);
  9236. myPlayer.moveInDir(true, i1);
  9237. int l1 = stream.readBits(3);
  9238. myPlayer.moveInDir(true, l1);
  9239. int j2 = stream.readBits(1);
  9240. if(j2 == 1)
  9241. anIntArray894[anInt893++] = myPlayerIndex;
  9242. return;
  9243. }
  9244. if(k == 3)
  9245. {
  9246. plane = stream.readBits(2);
  9247. int j1 = stream.readBits(1);
  9248. int i2 = stream.readBits(1);
  9249. if(i2 == 1)
  9250. anIntArray894[anInt893++] = myPlayerIndex;
  9251. int k2 = stream.readBits(7);
  9252. int l2 = stream.readBits(7);
  9253. myPlayer.setPos(l2, k2, j1 == 1);
  9254. }
  9255. }
  9256.  
  9257. private void nullLoader()
  9258. {
  9259. aBoolean831 = false;
  9260. while(drawingFlames)
  9261. {
  9262. aBoolean831 = false;
  9263. try
  9264. {
  9265. Thread.sleep(50L);
  9266. }
  9267. catch(Exception _ex) { }
  9268. }
  9269. aBackground_966 = null;
  9270. aBackground_967 = null;
  9271. aBackgroundArray1152s = null;
  9272. anIntArray850 = null;
  9273. anIntArray851 = null;
  9274. anIntArray852 = null;
  9275. anIntArray853 = null;
  9276. anIntArray1190 = null;
  9277. anIntArray1191 = null;
  9278. anIntArray828 = null;
  9279. anIntArray829 = null;
  9280. aClass30_Sub2_Sub1_Sub1_1201 = null;
  9281. aClass30_Sub2_Sub1_Sub1_1202 = null;
  9282. }
  9283.  
  9284. private boolean method119(int i, int j)
  9285. {
  9286. boolean flag1 = false;
  9287. RSInterface class9 = RSInterface.interfaceCache[j];
  9288. for(int k = 0; k < class9.children.length; k++)
  9289. {
  9290. if(class9.children[k] == -1)
  9291. break;
  9292. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  9293. if(class9_1.type == 1)
  9294. flag1 |= method119(i, class9_1.id);
  9295. if(class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1))
  9296. {
  9297. boolean flag2 = interfaceIsSelected(class9_1);
  9298. int l;
  9299. if(flag2)
  9300. l = class9_1.anInt258;
  9301. else
  9302. l = class9_1.anInt257;
  9303. if(l != -1)
  9304. {
  9305. Animation animation = Animation.anims[l];
  9306. for(class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);)
  9307. {
  9308. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  9309. class9_1.anInt246++;
  9310. if(class9_1.anInt246 >= animation.anInt352)
  9311. {
  9312. class9_1.anInt246 -= animation.anInt356;
  9313. if(class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  9314. class9_1.anInt246 = 0;
  9315. }
  9316. flag1 = true;
  9317. }
  9318.  
  9319. }
  9320. }
  9321. }
  9322.  
  9323. return flag1;
  9324. }
  9325.  
  9326. private int method120()
  9327. {
  9328. int j = 3;
  9329. if(yCameraCurve < 310)
  9330. {
  9331. int k = xCameraPos >> 7;
  9332. int l = yCameraPos >> 7;
  9333. int i1 = myPlayer.x >> 7;
  9334. int j1 = myPlayer.y >> 7;
  9335. if((byteGroundArray[plane][k][l] & 4) != 0)
  9336. j = plane;
  9337. int k1;
  9338. if(i1 > k)
  9339. k1 = i1 - k;
  9340. else
  9341. k1 = k - i1;
  9342. int l1;
  9343. if(j1 > l)
  9344. l1 = j1 - l;
  9345. else
  9346. l1 = l - j1;
  9347. if(k1 > l1)
  9348. {
  9349. int i2 = (l1 * 0x10000) / k1;
  9350. int k2 = 32768;
  9351. while(k != i1)
  9352. {
  9353. if(k < i1)
  9354. k++;
  9355. else
  9356. if(k > i1)
  9357. k--;
  9358. if((byteGroundArray[plane][k][l] & 4) != 0)
  9359. j = plane;
  9360. k2 += i2;
  9361. if(k2 >= 0x10000)
  9362. {
  9363. k2 -= 0x10000;
  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. }
  9372. }
  9373. } else
  9374. {
  9375. int j2 = (k1 * 0x10000) / l1;
  9376. int l2 = 32768;
  9377. while(l != j1)
  9378. {
  9379. if(l < j1)
  9380. l++;
  9381. else
  9382. if(l > j1)
  9383. l--;
  9384. if((byteGroundArray[plane][k][l] & 4) != 0)
  9385. j = plane;
  9386. l2 += j2;
  9387. if(l2 >= 0x10000)
  9388. {
  9389. l2 -= 0x10000;
  9390. if(k < i1)
  9391. k++;
  9392. else
  9393. if(k > i1)
  9394. k--;
  9395. if((byteGroundArray[plane][k][l] & 4) != 0)
  9396. j = plane;
  9397. }
  9398. }
  9399. }
  9400. }
  9401. if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  9402. j = plane;
  9403. return j;
  9404. }
  9405.  
  9406. private int method121()
  9407. {
  9408. int j = method42(plane, yCameraPos, xCameraPos);
  9409. if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  9410. return plane;
  9411. else
  9412. return 3;
  9413. }
  9414.  
  9415. private void delIgnore(long l)
  9416. {
  9417. try
  9418. {
  9419. if(l == 0L)
  9420. return;
  9421. for(int j = 0; j < ignoreCount; j++)
  9422. if(ignoreListAsLongs[j] == l)
  9423. {
  9424. ignoreCount--;
  9425. needDrawTabArea = true;
  9426. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  9427.  
  9428. stream.createFrame(74);
  9429. stream.writeQWord(l);
  9430. return;
  9431. }
  9432.  
  9433. return;
  9434. }
  9435. catch(RuntimeException runtimeexception)
  9436. {
  9437. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9438. }
  9439. throw new RuntimeException();
  9440. }
  9441.  
  9442.  
  9443. private void chatJoin(long l) {
  9444. try {
  9445. if(l == 0L)
  9446. return;
  9447. stream.createFrame(60);
  9448. stream.writeQWord(l);
  9449. return;
  9450. }
  9451. catch(RuntimeException runtimeexception)
  9452. {
  9453. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9454. }
  9455. throw new RuntimeException();
  9456.  
  9457. }
  9458.  
  9459. public String getParameter(String s)
  9460. {
  9461. if(signlink.mainapp != null)
  9462. return signlink.mainapp.getParameter(s);
  9463. else
  9464. return super.getParameter(s);
  9465. }
  9466.  
  9467. private void adjustVolume(boolean flag, int i)
  9468. {
  9469. signlink.midivol = i;
  9470. if(flag)
  9471. signlink.midi = "voladjust";
  9472. }
  9473.  
  9474. private int extractInterfaceValues(RSInterface class9, int j)
  9475. {
  9476. if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  9477. return -2;
  9478. try
  9479. {
  9480. int ai[] = class9.valueIndexArray[j];
  9481. int k = 0;
  9482. int l = 0;
  9483. int i1 = 0;
  9484. do
  9485. {
  9486. int j1 = ai[l++];
  9487. int k1 = 0;
  9488. byte byte0 = 0;
  9489. if(j1 == 0)
  9490. return k;
  9491. if(j1 == 1)
  9492. k1 = currentStats[ai[l++]];
  9493. if(j1 == 2)
  9494. k1 = maxStats[ai[l++]];
  9495. if(j1 == 3)
  9496. k1 = currentExp[ai[l++]];
  9497. if(j1 == 4)
  9498. {
  9499. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  9500. int k2 = ai[l++];
  9501. if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  9502. {
  9503. for(int j3 = 0; j3 < class9_1.inv.length; j3++)
  9504. if(class9_1.inv[j3] == k2 + 1)
  9505. k1 += class9_1.invStackSizes[j3];
  9506.  
  9507. }
  9508. }
  9509. if(j1 == 5)
  9510. k1 = variousSettings[ai[l++]];
  9511. if(j1 == 6)
  9512. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  9513. if(j1 == 7)
  9514. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  9515. if(j1 == 8)
  9516. k1 = myPlayer.combatLevel;
  9517. if(j1 == 9)
  9518. {
  9519. for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  9520. if(Skills.skillEnabled[l1])
  9521. k1 += maxStats[l1];
  9522.  
  9523. }
  9524. if(j1 == 10)
  9525. {
  9526. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  9527. int l2 = ai[l++] + 1;
  9528. if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  9529. {
  9530. for(int k3 = 0; k3 < class9_2.inv.length; k3++)
  9531. {
  9532. if(class9_2.inv[k3] != l2)
  9533. continue;
  9534. k1 = 0x3b9ac9ff;
  9535. break;
  9536. }
  9537.  
  9538. }
  9539. }
  9540. if(j1 == 11)
  9541. k1 = energy;
  9542. if(j1 == 12)
  9543. k1 = weight;
  9544. if(j1 == 13)
  9545. {
  9546. int i2 = variousSettings[ai[l++]];
  9547. int i3 = ai[l++];
  9548. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  9549. }
  9550. if(j1 == 14)
  9551. {
  9552. int j2 = ai[l++];
  9553. VarBit varBit = VarBit.cache[j2];
  9554. int l3 = varBit.anInt648;
  9555. int i4 = varBit.anInt649;
  9556. int j4 = varBit.anInt650;
  9557. int k4 = anIntArray1232[j4 - i4];
  9558. k1 = variousSettings[l3] >> i4 & k4;
  9559. }
  9560. if(j1 == 15)
  9561. byte0 = 1;
  9562. if(j1 == 16)
  9563. byte0 = 2;
  9564. if(j1 == 17)
  9565. byte0 = 3;
  9566. if(j1 == 18)
  9567. k1 = (myPlayer.x >> 7) + baseX;
  9568. if(j1 == 19)
  9569. k1 = (myPlayer.y >> 7) + baseY;
  9570. if(j1 == 20)
  9571. k1 = ai[l++];
  9572. if(byte0 == 0)
  9573. {
  9574. if(i1 == 0)
  9575. k += k1;
  9576. if(i1 == 1)
  9577. k -= k1;
  9578. if(i1 == 2 && k1 != 0)
  9579. k /= k1;
  9580. if(i1 == 3)
  9581. k *= k1;
  9582. i1 = 0;
  9583. } else
  9584. {
  9585. i1 = byte0;
  9586. }
  9587. } while(true);
  9588. }
  9589. catch(Exception _ex)
  9590. {
  9591. return -1;
  9592. }
  9593. }
  9594.  
  9595. private void drawTooltip() {
  9596. if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  9597. return;
  9598. String s;
  9599. if(itemSelected == 1 && menuActionRow < 2)
  9600. s = "Use " + selectedItemName + " with...";
  9601. else if(spellSelected == 1 && menuActionRow < 2)
  9602. s = spellTooltip + "...";
  9603. else
  9604. s = menuActionName[menuActionRow - 1];
  9605. if(menuActionRow > 2)
  9606. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  9607. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  9608. }
  9609.  
  9610. private void drawMinimap() {
  9611. aRSImageProducer_1164.initDrawingArea();
  9612. if(anInt1021 == 2) {
  9613. byte abyte0[] = mapBack.aByteArray1450;
  9614. int ai[] = DrawingArea.pixels;
  9615. int k2 = abyte0.length;
  9616. for(int i5 = 0; i5 < k2; i5++)
  9617. if(abyte0[i5] == 0)
  9618. ai[i5] = 0;
  9619. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 0, 0, 33, 25);
  9620. aRSImageProducer_1165.initDrawingArea();
  9621. return;
  9622. }
  9623. int i = minimapInt1 + minimapInt2 & 0x7ff;
  9624. int j = 48 + myPlayer.x / 32;
  9625. int l2 = 464 - myPlayer.y / 32;
  9626. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, 5, 25, 146, j);
  9627. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 0, 0, 33, 25);
  9628. for(int j5 = 0; j5 < anInt1071; j5++) {
  9629. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  9630. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  9631. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  9632. }
  9633. for(int k5 = 0; k5 < 104; k5++) {
  9634. for(int l5 = 0; l5 < 104; l5++) {
  9635. NodeList class19 = groundArray[plane][k5][l5];
  9636. if(class19 != null) {
  9637. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  9638. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  9639. markMinimap(mapDotItem, l, j3);
  9640. }
  9641. }
  9642. }
  9643. for(int i6 = 0; i6 < npcCount; i6++) {
  9644. NPC npc = npcArray[npcIndices[i6]];
  9645. if(npc != null && npc.isVisible()) {
  9646. EntityDef entityDef = npc.desc;
  9647. if(entityDef.childrenIDs != null)
  9648. entityDef = entityDef.method161();
  9649. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  9650. int i1 = npc.x / 32 - myPlayer.x / 32;
  9651. int k3 = npc.y / 32 - myPlayer.y / 32;
  9652. markMinimap(mapDotNPC, i1, k3);
  9653. }
  9654. }
  9655. }
  9656. for(int j6 = 0; j6 < playerCount; j6++) {
  9657. Player player = playerArray[playerIndices[j6]];
  9658. if(player != null && player.isVisible()) {
  9659. int j1 = player.x / 32 - myPlayer.x / 32;
  9660. int l3 = player.y / 32 - myPlayer.y / 32;
  9661. boolean flag1 = false;
  9662. boolean flag3 = false;
  9663. for (int j3 = 0; j3 < clanList.length; j3++) {
  9664. if (clanList[j3] == null)
  9665. continue;
  9666. if (!clanList[j3].equalsIgnoreCase(player.name))
  9667. continue;
  9668. flag3 = true;
  9669. break;
  9670. }
  9671. long l6 = TextClass.longForName(player.name);
  9672. for(int k6 = 0; k6 < friendsCount; k6++) {
  9673. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  9674. continue;
  9675. flag1 = true;
  9676. break;
  9677. }
  9678. boolean flag2 = false;
  9679. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  9680. flag2 = true;
  9681. if(flag1)
  9682. markMinimap(mapDotFriend, j1, l3);
  9683. else if(flag3)
  9684. markMinimap(mapDotClan, j1, l3);
  9685. else if(flag2)
  9686. markMinimap(mapDotTeam, j1, l3);
  9687. else
  9688. markMinimap(mapDotPlayer, j1, l3);
  9689. }
  9690. }
  9691. if(anInt855 != 0 && loopCycle % 20 < 10) {
  9692. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  9693. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  9694. if(class30_sub2_sub4_sub1_sub1_1 != null) {
  9695. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  9696. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  9697. method81(mapMarker, i4, k1);
  9698. }
  9699. }
  9700. if(anInt855 == 2) {
  9701. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  9702. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  9703. method81(mapMarker, j4, l1);
  9704. }
  9705. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length) {
  9706. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  9707. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  9708. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  9709. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  9710. method81(mapMarker, k4, i2);
  9711. }
  9712. }
  9713. }
  9714. if(destX != 0) {
  9715. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  9716. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  9717. markMinimap(mapFlag, j2, l4);
  9718. }
  9719. DrawingArea.drawPixels(3, 78, 97, 0xffffff, 3);
  9720. mapBack.drawBackground(0, 0);
  9721. aRSImageProducer_1165.initDrawingArea();
  9722. }
  9723.  
  9724. private void npcScreenPos(Entity entity, int i) {
  9725. calcEntityScreenPos(entity.x, i, entity.y);
  9726. }
  9727.  
  9728. private void calcEntityScreenPos(int i, int j, int l) {
  9729. if(i < 128 || l < 128 || i > 13056 || l > 13056) {
  9730. spriteDrawX = -1;
  9731. spriteDrawY = -1;
  9732. return;
  9733. }
  9734. int i1 = method42(plane, l, i) - j;
  9735. i -= xCameraPos;
  9736. i1 -= zCameraPos;
  9737. l -= yCameraPos;
  9738. int j1 = Model.modelIntArray1[yCameraCurve];
  9739. int k1 = Model.modelIntArray2[yCameraCurve];
  9740. int l1 = Model.modelIntArray1[xCameraCurve];
  9741. int i2 = Model.modelIntArray2[xCameraCurve];
  9742. int j2 = l * l1 + i * i2 >> 16;
  9743. l = l * i2 - i * l1 >> 16;
  9744. i = j2;
  9745. j2 = i1 * k1 - l * j1 >> 16;
  9746. l = i1 * j1 + l * k1 >> 16;
  9747. i1 = j2;
  9748. if(l >= 50) {
  9749. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  9750. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  9751. } else {
  9752. spriteDrawX = -1;
  9753. spriteDrawY = -1;
  9754. }
  9755. }
  9756.  
  9757. private void buildSplitPrivateChatMenu()
  9758. {
  9759. if(splitPrivateChat == 0)
  9760. return;
  9761. int i = 0;
  9762. if(anInt1104 != 0)
  9763. i = 1;
  9764. for(int j = 0; j < 100; j++)
  9765. if(chatMessages[j] != null)
  9766. {
  9767. int k = chatTypes[j];
  9768. String s = chatNames[j];
  9769. boolean flag1 = false;
  9770. if(s != null && s.startsWith("@cr1@"))
  9771. {
  9772. s = s.substring(5);
  9773. boolean flag2 = true;
  9774. }
  9775. if(s != null && s.startsWith("@cr2@"))
  9776. {
  9777. s = s.substring(5);
  9778. byte byte0 = 2;
  9779. }
  9780. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  9781. {
  9782. int l = 329 - i * 13;
  9783. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  9784. {
  9785. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  9786. if(i1 > 450)
  9787. i1 = 450;
  9788. if(super.mouseX < 4 + i1)
  9789. {
  9790. if(myPrivilege >= 1)
  9791. {
  9792. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  9793. menuActionID[menuActionRow] = 2606;
  9794. menuActionRow++;
  9795. }
  9796. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  9797. menuActionID[menuActionRow] = 2042;
  9798. menuActionRow++;
  9799. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  9800. menuActionID[menuActionRow] = 2337;
  9801. menuActionRow++;
  9802. }
  9803. }
  9804. if(++i >= 5)
  9805. return;
  9806. }
  9807. if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  9808. return;
  9809. }
  9810.  
  9811. }
  9812.  
  9813. private void method130(int j, int k, int l, int i1, int j1, int k1,
  9814. int l1, int i2, int j2)
  9815. {
  9816. Class30_Sub1 class30_sub1 = null;
  9817. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  9818. {
  9819. if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  9820. continue;
  9821. class30_sub1 = class30_sub1_1;
  9822. break;
  9823. }
  9824.  
  9825. if(class30_sub1 == null)
  9826. {
  9827. class30_sub1 = new Class30_Sub1();
  9828. class30_sub1.anInt1295 = l1;
  9829. class30_sub1.anInt1296 = i1;
  9830. class30_sub1.anInt1297 = i2;
  9831. class30_sub1.anInt1298 = j1;
  9832. method89(class30_sub1);
  9833. aClass19_1179.insertHead(class30_sub1);
  9834. }
  9835. class30_sub1.anInt1291 = k;
  9836. class30_sub1.anInt1293 = k1;
  9837. class30_sub1.anInt1292 = l;
  9838. class30_sub1.anInt1302 = j2;
  9839. class30_sub1.anInt1294 = j;
  9840. }
  9841.  
  9842. private boolean interfaceIsSelected(RSInterface class9)
  9843. {
  9844. if(class9.anIntArray245 == null)
  9845. return false;
  9846. for(int i = 0; i < class9.anIntArray245.length; i++)
  9847. {
  9848. int j = extractInterfaceValues(class9, i);
  9849. int k = class9.anIntArray212[i];
  9850. if(class9.anIntArray245[i] == 2)
  9851. {
  9852. if(j >= k)
  9853. return false;
  9854. } else
  9855. if(class9.anIntArray245[i] == 3)
  9856. {
  9857. if(j <= k)
  9858. return false;
  9859. } else
  9860. if(class9.anIntArray245[i] == 4)
  9861. {
  9862. if(j == k)
  9863. return false;
  9864. } else
  9865. if(j != k)
  9866. return false;
  9867. }
  9868.  
  9869. return true;
  9870. }
  9871.  
  9872. private DataInputStream openJagGrabInputStream(String s)
  9873. throws IOException
  9874. {
  9875. // if(!aBoolean872)
  9876. // if(signlink.mainapp != null)
  9877. // return signlink.openurl(s);
  9878. // else
  9879. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  9880. if(aSocket832 != null)
  9881. {
  9882. try
  9883. {
  9884. aSocket832.close();
  9885. }
  9886. catch(Exception _ex) { }
  9887. aSocket832 = null;
  9888. }
  9889. aSocket832 = openSocket(43595);
  9890. aSocket832.setSoTimeout(10000);
  9891. java.io.InputStream inputstream = aSocket832.getInputStream();
  9892. OutputStream outputstream = aSocket832.getOutputStream();
  9893. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  9894. return new DataInputStream(inputstream);
  9895. }
  9896.  
  9897. private void doFlamesDrawing()
  9898. {
  9899. char c = '\u0100';
  9900. if(anInt1040 > 0)
  9901. {
  9902. for(int i = 0; i < 256; i++)
  9903. if(anInt1040 > 768)
  9904. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  9905. else
  9906. if(anInt1040 > 256)
  9907. anIntArray850[i] = anIntArray852[i];
  9908. else
  9909. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  9910.  
  9911. } else
  9912. if(anInt1041 > 0)
  9913. {
  9914. for(int j = 0; j < 256; j++)
  9915. if(anInt1041 > 768)
  9916. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  9917. else
  9918. if(anInt1041 > 256)
  9919. anIntArray850[j] = anIntArray853[j];
  9920. else
  9921. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  9922.  
  9923. } else
  9924. {
  9925. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  9926.  
  9927. }
  9928. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, aRSImageProducer_1110.anIntArray315, 0, 33920);
  9929.  
  9930. int i1 = 0;
  9931. int j1 = 1152;
  9932. for(int k1 = 1; k1 < c - 1; k1++)
  9933. {
  9934. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  9935. int j2 = 22 + l1;
  9936. if(j2 < 0)
  9937. j2 = 0;
  9938. i1 += j2;
  9939. for(int l2 = j2; l2 < 128; l2++)
  9940. {
  9941. int j3 = anIntArray828[i1++];
  9942. if(j3 != 0)
  9943. {
  9944. int l3 = j3;
  9945. int j4 = 256 - j3;
  9946. j3 = anIntArray850[j3];
  9947. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  9948. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  9949. } else
  9950. {
  9951. j1++;
  9952. }
  9953. }
  9954.  
  9955. j1 += j2;
  9956. }
  9957.  
  9958. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  9959. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, aRSImageProducer_1111.anIntArray315, 0, 33920);
  9960.  
  9961. i1 = 0;
  9962. j1 = 1176;
  9963. for(int k2 = 1; k2 < c - 1; k2++)
  9964. {
  9965. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  9966. int k3 = 103 - i3;
  9967. j1 += i3;
  9968. for(int i4 = 0; i4 < k3; i4++)
  9969. {
  9970. int k4 = anIntArray828[i1++];
  9971. if(k4 != 0)
  9972. {
  9973. int i5 = k4;
  9974. int j5 = 256 - k4;
  9975. k4 = anIntArray850[k4];
  9976. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  9977. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  9978. } else
  9979. {
  9980. j1++;
  9981. }
  9982. }
  9983.  
  9984. i1 += 128 - k3;
  9985. j1 += 128 - k3 - i3;
  9986. }
  9987.  
  9988. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  9989. }
  9990.  
  9991. private void method134(Stream stream)
  9992. {
  9993. int j = stream.readBits(8);
  9994. if(j < playerCount)
  9995. {
  9996. for(int k = j; k < playerCount; k++)
  9997. anIntArray840[anInt839++] = playerIndices[k];
  9998.  
  9999. }
  10000. if(j > playerCount)
  10001. {
  10002. signlink.reporterror(myUsername + " Too many players");
  10003. throw new RuntimeException("eek");
  10004. }
  10005. playerCount = 0;
  10006. for(int l = 0; l < j; l++)
  10007. {
  10008. int i1 = playerIndices[l];
  10009. Player player = playerArray[i1];
  10010. int j1 = stream.readBits(1);
  10011. if(j1 == 0)
  10012. {
  10013. playerIndices[playerCount++] = i1;
  10014. player.anInt1537 = loopCycle;
  10015. } else
  10016. {
  10017. int k1 = stream.readBits(2);
  10018. if(k1 == 0)
  10019. {
  10020. playerIndices[playerCount++] = i1;
  10021. player.anInt1537 = loopCycle;
  10022. anIntArray894[anInt893++] = i1;
  10023. } else
  10024. if(k1 == 1)
  10025. {
  10026. playerIndices[playerCount++] = i1;
  10027. player.anInt1537 = loopCycle;
  10028. int l1 = stream.readBits(3);
  10029. player.moveInDir(false, l1);
  10030. int j2 = stream.readBits(1);
  10031. if(j2 == 1)
  10032. anIntArray894[anInt893++] = i1;
  10033. } else
  10034. if(k1 == 2)
  10035. {
  10036. playerIndices[playerCount++] = i1;
  10037. player.anInt1537 = loopCycle;
  10038. int i2 = stream.readBits(3);
  10039. player.moveInDir(true, i2);
  10040. int k2 = stream.readBits(3);
  10041. player.moveInDir(true, k2);
  10042. int l2 = stream.readBits(1);
  10043. if(l2 == 1)
  10044. anIntArray894[anInt893++] = i1;
  10045. } else
  10046. if(k1 == 3)
  10047. anIntArray840[anInt839++] = i1;
  10048. }
  10049. }
  10050. }
  10051.  
  10052. private void drawLoginScreen(boolean flag)
  10053. {
  10054. resetImageProducers();
  10055. aRSImageProducer_1109.initDrawingArea();
  10056. aBackground_966.drawBackground(0, 0);
  10057. char c = '\u0168';
  10058. char c1 = '\310';
  10059. if(loginScreenState == 0)
  10060. {
  10061. int i = c1 / 2 + 80;
  10062. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  10063. i = c1 / 2 - 20;
  10064. chatTextDrawingArea.method382(0xffff00, c / 2, "Welcome to RuneScape", i, true);
  10065. i += 30;
  10066. int l = c / 2 - 80;
  10067. int k1 = c1 / 2 + 20;
  10068. aBackground_967.drawBackground(l - 73, k1 - 20);
  10069. chatTextDrawingArea.method382(0xffffff, l, "New User", k1 + 5, true);
  10070. l = c / 2 + 80;
  10071. aBackground_967.drawBackground(l - 73, k1 - 20);
  10072. chatTextDrawingArea.method382(0xffffff, l, "Existing User", k1 + 5, true);
  10073. }
  10074. if(loginScreenState == 2)
  10075. {
  10076. int j = c1 / 2 - 40;
  10077. if(loginMessage1.length() > 0)
  10078. {
  10079. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  10080. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j, true);
  10081. j += 30;
  10082. } else
  10083. {
  10084. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  10085. j += 30;
  10086. }
  10087. chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff, "Username: " + myUsername + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10088. j += 15;
  10089. chatTextDrawingArea.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10090. j += 15;
  10091. if(!flag)
  10092. {
  10093. int i1 = c / 2 - 80;
  10094. int l1 = c1 / 2 + 50;
  10095. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10096. chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5, true);
  10097. i1 = c / 2 + 80;
  10098. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10099. chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  10100. }
  10101. }
  10102. if(loginScreenState == 3)
  10103. {
  10104. chatTextDrawingArea.method382(0xffff00, c / 2, "Create a free account", c1 / 2 - 60, true);
  10105. int k = c1 / 2 - 35;
  10106. chatTextDrawingArea.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
  10107. k += 15;
  10108. chatTextDrawingArea.method382(0xffffff, c / 2, "go back to the main RuneScape webpage", k, true);
  10109. k += 15;
  10110. chatTextDrawingArea.method382(0xffffff, c / 2, "and choose the red 'create account'", k, true);
  10111. k += 15;
  10112. chatTextDrawingArea.method382(0xffffff, c / 2, "button at the top right of that page.", k, true);
  10113. k += 15;
  10114. int j1 = c / 2;
  10115. int i2 = c1 / 2 + 50;
  10116. aBackground_967.drawBackground(j1 - 73, i2 - 20);
  10117. chatTextDrawingArea.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  10118. }
  10119. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  10120. if(welcomeScreenRaised)
  10121. {
  10122. welcomeScreenRaised = false;
  10123. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  10124. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  10125. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  10126. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  10127. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  10128. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  10129. }
  10130. }
  10131.  
  10132. private void drawFlames()
  10133. {
  10134. drawingFlames = true;
  10135. try
  10136. {
  10137. long l = System.currentTimeMillis();
  10138. int i = 0;
  10139. int j = 20;
  10140. while(aBoolean831)
  10141. {
  10142. anInt1208++;
  10143. calcFlamesPosition();
  10144. calcFlamesPosition();
  10145. doFlamesDrawing();
  10146. if(++i > 10)
  10147. {
  10148. long l1 = System.currentTimeMillis();
  10149. int k = (int)(l1 - l) / 10 - j;
  10150. j = 40 - k;
  10151. if(j < 5)
  10152. j = 5;
  10153. i = 0;
  10154. l = l1;
  10155. }
  10156. try
  10157. {
  10158. Thread.sleep(j);
  10159. }
  10160. catch(Exception _ex) { }
  10161. }
  10162. }
  10163. catch(Exception _ex) { }
  10164. drawingFlames = false;
  10165. }
  10166.  
  10167. public void raiseWelcomeScreen()
  10168. {
  10169. welcomeScreenRaised = true;
  10170. }
  10171.  
  10172. private void method137(Stream stream, int j)
  10173. {
  10174. if(j == 84)
  10175. {
  10176. int k = stream.readUnsignedByte();
  10177. int j3 = anInt1268 + (k >> 4 & 7);
  10178. int i6 = anInt1269 + (k & 7);
  10179. int l8 = stream.readUnsignedWord();
  10180. int k11 = stream.readUnsignedWord();
  10181. int l13 = stream.readUnsignedWord();
  10182. if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  10183. {
  10184. NodeList class19_1 = groundArray[plane][j3][i6];
  10185. if(class19_1 != null)
  10186. {
  10187. 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())
  10188. {
  10189. if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  10190. continue;
  10191. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  10192. break;
  10193. }
  10194.  
  10195. spawnGroundItem(j3, i6);
  10196. }
  10197. }
  10198. return;
  10199. }
  10200. if(j == 105)
  10201. {
  10202. int l = stream.readUnsignedByte();
  10203. int k3 = anInt1268 + (l >> 4 & 7);
  10204. int j6 = anInt1269 + (l & 7);
  10205. int i9 = stream.readUnsignedWord();
  10206. int l11 = stream.readUnsignedByte();
  10207. int i14 = l11 >> 4 & 0xf;
  10208. int i16 = l11 & 7;
  10209. 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)
  10210. {
  10211. anIntArray1207[anInt1062] = i9;
  10212. anIntArray1241[anInt1062] = i16;
  10213. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  10214. anInt1062++;
  10215. }
  10216. }
  10217. if(j == 215)
  10218. {
  10219. int i1 = stream.method435();
  10220. int l3 = stream.method428();
  10221. int k6 = anInt1268 + (l3 >> 4 & 7);
  10222. int j9 = anInt1269 + (l3 & 7);
  10223. int i12 = stream.method435();
  10224. int j14 = stream.readUnsignedWord();
  10225. if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  10226. {
  10227. Item class30_sub2_sub4_sub2_2 = new Item();
  10228. class30_sub2_sub4_sub2_2.ID = i1;
  10229. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  10230. if(groundArray[plane][k6][j9] == null)
  10231. groundArray[plane][k6][j9] = new NodeList();
  10232. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  10233. spawnGroundItem(k6, j9);
  10234. }
  10235. return;
  10236. }
  10237. if(j == 156)
  10238. {
  10239. int j1 = stream.method426();
  10240. int i4 = anInt1268 + (j1 >> 4 & 7);
  10241. int l6 = anInt1269 + (j1 & 7);
  10242. int k9 = stream.readUnsignedWord();
  10243. if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  10244. {
  10245. NodeList class19 = groundArray[plane][i4][l6];
  10246. if(class19 != null)
  10247. {
  10248. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  10249. {
  10250. if(item.ID != (k9 & 0x7fff))
  10251. continue;
  10252. item.unlink();
  10253. break;
  10254. }
  10255.  
  10256. if(class19.reverseGetFirst() == null)
  10257. groundArray[plane][i4][l6] = null;
  10258. spawnGroundItem(i4, l6);
  10259. }
  10260. }
  10261. return;
  10262. }
  10263. if(j == 160)
  10264. {
  10265. int k1 = stream.method428();
  10266. int j4 = anInt1268 + (k1 >> 4 & 7);
  10267. int i7 = anInt1269 + (k1 & 7);
  10268. int l9 = stream.method428();
  10269. int j12 = l9 >> 2;
  10270. int k14 = l9 & 3;
  10271. int j16 = anIntArray1177[j12];
  10272. int j17 = stream.method435();
  10273. if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  10274. {
  10275. int j18 = intGroundArray[plane][j4][i7];
  10276. int i19 = intGroundArray[plane][j4 + 1][i7];
  10277. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  10278. int k20 = intGroundArray[plane][j4][i7 + 1];
  10279. if(j16 == 0)
  10280. {
  10281. Object1 class10 = worldController.method296(plane, j4, i7);
  10282. if(class10 != null)
  10283. {
  10284. int k21 = class10.uid >> 14 & 0x7fff;
  10285. if(j12 == 2)
  10286. {
  10287. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  10288. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  10289. } else
  10290. {
  10291. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  10292. }
  10293. }
  10294. }
  10295. if(j16 == 1)
  10296. {
  10297. Object2 class26 = worldController.method297(j4, i7, plane);
  10298. if(class26 != null)
  10299. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  10300. }
  10301. if(j16 == 2)
  10302. {
  10303. Object5 class28 = worldController.method298(j4, i7, plane);
  10304. if(j12 == 11)
  10305. j12 = 10;
  10306. if(class28 != null)
  10307. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  10308. }
  10309. if(j16 == 3)
  10310. {
  10311. Object3 class49 = worldController.method299(i7, j4, plane);
  10312. if(class49 != null)
  10313. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  10314. }
  10315. }
  10316. return;
  10317. }
  10318. if(j == 147)
  10319. {
  10320. int l1 = stream.method428();
  10321. int k4 = anInt1268 + (l1 >> 4 & 7);
  10322. int j7 = anInt1269 + (l1 & 7);
  10323. int i10 = stream.readUnsignedWord();
  10324. byte byte0 = stream.method430();
  10325. int l14 = stream.method434();
  10326. byte byte1 = stream.method429();
  10327. int k17 = stream.readUnsignedWord();
  10328. int k18 = stream.method428();
  10329. int j19 = k18 >> 2;
  10330. int i20 = k18 & 3;
  10331. int l20 = anIntArray1177[j19];
  10332. byte byte2 = stream.readSignedByte();
  10333. int l21 = stream.readUnsignedWord();
  10334. byte byte3 = stream.method429();
  10335. Player player;
  10336. if(i10 == unknownInt10)
  10337. player = myPlayer;
  10338. else
  10339. player = playerArray[i10];
  10340. if(player != null)
  10341. {
  10342. ObjectDef class46 = ObjectDef.forID(l21);
  10343. int i22 = intGroundArray[plane][k4][j7];
  10344. int j22 = intGroundArray[plane][k4 + 1][j7];
  10345. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  10346. int l22 = intGroundArray[plane][k4][j7 + 1];
  10347. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  10348. if(model != null)
  10349. {
  10350. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  10351. player.anInt1707 = l14 + loopCycle;
  10352. player.anInt1708 = k17 + loopCycle;
  10353. player.aModel_1714 = model;
  10354. int i23 = class46.anInt744;
  10355. int j23 = class46.anInt761;
  10356. if(i20 == 1 || i20 == 3)
  10357. {
  10358. i23 = class46.anInt761;
  10359. j23 = class46.anInt744;
  10360. }
  10361. player.anInt1711 = k4 * 128 + i23 * 64;
  10362. player.anInt1713 = j7 * 128 + j23 * 64;
  10363. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  10364. if(byte2 > byte0)
  10365. {
  10366. byte byte4 = byte2;
  10367. byte2 = byte0;
  10368. byte0 = byte4;
  10369. }
  10370. if(byte3 > byte1)
  10371. {
  10372. byte byte5 = byte3;
  10373. byte3 = byte1;
  10374. byte1 = byte5;
  10375. }
  10376. player.anInt1719 = k4 + byte2;
  10377. player.anInt1721 = k4 + byte0;
  10378. player.anInt1720 = j7 + byte3;
  10379. player.anInt1722 = j7 + byte1;
  10380. }
  10381. }
  10382. }
  10383. if(j == 151)
  10384. {
  10385. int i2 = stream.method426();
  10386. int l4 = anInt1268 + (i2 >> 4 & 7);
  10387. int k7 = anInt1269 + (i2 & 7);
  10388. int j10 = stream.method434();
  10389. int k12 = stream.method428();
  10390. int i15 = k12 >> 2;
  10391. int k16 = k12 & 3;
  10392. int l17 = anIntArray1177[i15];
  10393. if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  10394. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  10395. return;
  10396. }
  10397. if(j == 4)
  10398. {
  10399. int j2 = stream.readUnsignedByte();
  10400. int i5 = anInt1268 + (j2 >> 4 & 7);
  10401. int l7 = anInt1269 + (j2 & 7);
  10402. int k10 = stream.readUnsignedWord();
  10403. int l12 = stream.readUnsignedByte();
  10404. int j15 = stream.readUnsignedWord();
  10405. if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  10406. {
  10407. i5 = i5 * 128 + 64;
  10408. l7 = l7 * 128 + 64;
  10409. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  10410. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  10411. }
  10412. return;
  10413. }
  10414. if(j == 44)
  10415. {
  10416. int k2 = stream.method436();
  10417. int j5 = stream.readUnsignedWord();
  10418. int i8 = stream.readUnsignedByte();
  10419. int l10 = anInt1268 + (i8 >> 4 & 7);
  10420. int i13 = anInt1269 + (i8 & 7);
  10421. if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  10422. {
  10423. Item class30_sub2_sub4_sub2_1 = new Item();
  10424. class30_sub2_sub4_sub2_1.ID = k2;
  10425. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  10426. if(groundArray[plane][l10][i13] == null)
  10427. groundArray[plane][l10][i13] = new NodeList();
  10428. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  10429. spawnGroundItem(l10, i13);
  10430. }
  10431. return;
  10432. }
  10433. if(j == 101)
  10434. {
  10435. int l2 = stream.method427();
  10436. int k5 = l2 >> 2;
  10437. int j8 = l2 & 3;
  10438. int i11 = anIntArray1177[k5];
  10439. int j13 = stream.readUnsignedByte();
  10440. int k15 = anInt1268 + (j13 >> 4 & 7);
  10441. int l16 = anInt1269 + (j13 & 7);
  10442. if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  10443. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  10444. return;
  10445. }
  10446. if(j == 117)
  10447. {
  10448. int i3 = stream.readUnsignedByte();
  10449. int l5 = anInt1268 + (i3 >> 4 & 7);
  10450. int k8 = anInt1269 + (i3 & 7);
  10451. int j11 = l5 + stream.readSignedByte();
  10452. int k13 = k8 + stream.readSignedByte();
  10453. int l15 = stream.readSignedWord();
  10454. int i17 = stream.readUnsignedWord();
  10455. int i18 = stream.readUnsignedByte() * 4;
  10456. int l18 = stream.readUnsignedByte() * 4;
  10457. int k19 = stream.readUnsignedWord();
  10458. int j20 = stream.readUnsignedWord();
  10459. int i21 = stream.readUnsignedByte();
  10460. int j21 = stream.readUnsignedByte();
  10461. if(l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535)
  10462. {
  10463. l5 = l5 * 128 + 64;
  10464. k8 = k8 * 128 + 64;
  10465. j11 = j11 * 128 + 64;
  10466. k13 = k13 * 128 + 64;
  10467. 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);
  10468. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  10469. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  10470. }
  10471. }
  10472. }
  10473.  
  10474. private static void setLowMem()
  10475. {
  10476. WorldController.lowMem = true;
  10477. Texture.lowMem = true;
  10478. lowMem = true;
  10479. ObjectManager.lowMem = true;
  10480. ObjectDef.lowMem = true;
  10481. }
  10482.  
  10483. private void method139(Stream stream)
  10484. {
  10485. stream.initBitAccess();
  10486. int k = stream.readBits(8);
  10487. if(k < npcCount)
  10488. {
  10489. for(int l = k; l < npcCount; l++)
  10490. anIntArray840[anInt839++] = npcIndices[l];
  10491.  
  10492. }
  10493. if(k > npcCount)
  10494. {
  10495. signlink.reporterror(myUsername + " Too many npcs");
  10496. throw new RuntimeException("eek");
  10497. }
  10498. npcCount = 0;
  10499. for(int i1 = 0; i1 < k; i1++)
  10500. {
  10501. int j1 = npcIndices[i1];
  10502. NPC npc = npcArray[j1];
  10503. int k1 = stream.readBits(1);
  10504. if(k1 == 0)
  10505. {
  10506. npcIndices[npcCount++] = j1;
  10507. npc.anInt1537 = loopCycle;
  10508. } else
  10509. {
  10510. int l1 = stream.readBits(2);
  10511. if(l1 == 0)
  10512. {
  10513. npcIndices[npcCount++] = j1;
  10514. npc.anInt1537 = loopCycle;
  10515. anIntArray894[anInt893++] = j1;
  10516. } else
  10517. if(l1 == 1)
  10518. {
  10519. npcIndices[npcCount++] = j1;
  10520. npc.anInt1537 = loopCycle;
  10521. int i2 = stream.readBits(3);
  10522. npc.moveInDir(false, i2);
  10523. int k2 = stream.readBits(1);
  10524. if(k2 == 1)
  10525. anIntArray894[anInt893++] = j1;
  10526. } else
  10527. if(l1 == 2)
  10528. {
  10529. npcIndices[npcCount++] = j1;
  10530. npc.anInt1537 = loopCycle;
  10531. int j2 = stream.readBits(3);
  10532. npc.moveInDir(true, j2);
  10533. int l2 = stream.readBits(3);
  10534. npc.moveInDir(true, l2);
  10535. int i3 = stream.readBits(1);
  10536. if(i3 == 1)
  10537. anIntArray894[anInt893++] = j1;
  10538. } else
  10539. if(l1 == 3)
  10540. anIntArray840[anInt839++] = j1;
  10541. }
  10542. }
  10543.  
  10544. }
  10545.  
  10546. private void processLoginScreenInput()
  10547. {
  10548. if(loginScreenState == 0)
  10549. {
  10550. int i = super.myWidth / 2 - 80;
  10551. int l = super.myHeight / 2 + 20;
  10552. l += 20;
  10553. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  10554. {
  10555. loginScreenState = 3;
  10556. loginScreenCursorPos = 0;
  10557. }
  10558. i = super.myWidth / 2 + 80;
  10559. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  10560. {
  10561. loginMessage1 = "";
  10562. loginMessage2 = "Enter your username & password.";
  10563. loginScreenState = 2;
  10564. loginScreenCursorPos = 0;
  10565. }
  10566. } else
  10567. {
  10568. if(loginScreenState == 2)
  10569. {
  10570. int j = super.myHeight / 2 - 40;
  10571. j += 30;
  10572. j += 25;
  10573. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10574. loginScreenCursorPos = 0;
  10575. j += 15;
  10576. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10577. loginScreenCursorPos = 1;
  10578. j += 15;
  10579. int i1 = super.myWidth / 2 - 80;
  10580. int k1 = super.myHeight / 2 + 50;
  10581. k1 += 20;
  10582. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  10583. {
  10584. loginFailures = 0;
  10585. login(myUsername, myPassword, false);
  10586. if(loggedIn)
  10587. return;
  10588. }
  10589. i1 = super.myWidth / 2 + 80;
  10590. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  10591. {
  10592. loginScreenState = 0;
  10593. // myUsername = "";
  10594. // myPassword = "";
  10595. }
  10596. do
  10597. {
  10598. int l1 = readChar(-796);
  10599. if(l1 == -1)
  10600. break;
  10601. boolean flag1 = false;
  10602. for(int i2 = 0; i2 < validUserPassChars.length(); i2++)
  10603. {
  10604. if(l1 != validUserPassChars.charAt(i2))
  10605. continue;
  10606. flag1 = true;
  10607. break;
  10608. }
  10609.  
  10610. if(loginScreenCursorPos == 0)
  10611. {
  10612. if(l1 == 8 && myUsername.length() > 0)
  10613. myUsername = myUsername.substring(0, myUsername.length() - 1);
  10614. if(l1 == 9 || l1 == 10 || l1 == 13)
  10615. loginScreenCursorPos = 1;
  10616. if(flag1)
  10617. myUsername += (char)l1;
  10618. if(myUsername.length() > 12)
  10619. myUsername = myUsername.substring(0, 12);
  10620. } else
  10621. if(loginScreenCursorPos == 1)
  10622. {
  10623. if(l1 == 8 && myPassword.length() > 0)
  10624. myPassword = myPassword.substring(0, myPassword.length() - 1);
  10625. if(l1 == 9 || l1 == 10 || l1 == 13)
  10626. loginScreenCursorPos = 0;
  10627. if(flag1)
  10628. myPassword += (char)l1;
  10629. if(myPassword.length() > 20)
  10630. myPassword = myPassword.substring(0, 20);
  10631. }
  10632. } while(true);
  10633. return;
  10634. }
  10635. if(loginScreenState == 3)
  10636. {
  10637. int k = super.myWidth / 2;
  10638. int j1 = super.myHeight / 2 + 50;
  10639. j1 += 20;
  10640. if(super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75 && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  10641. loginScreenState = 0;
  10642. }
  10643. }
  10644. }
  10645.  
  10646. private void markMinimap(Sprite sprite, int i, int j) {
  10647. int k = minimapInt1 + minimapInt2 & 0x7ff;
  10648. int l = i * i + j * j;
  10649. if(l > 6400)
  10650. return;
  10651. int i1 = Model.modelIntArray1[k];
  10652. int j1 = Model.modelIntArray2[k];
  10653. i1 = (i1 * 256) / (minimapInt3 + 256);
  10654. j1 = (j1 * 256) / (minimapInt3 + 256);
  10655. int k1 = j * i1 + i * j1 >> 16;
  10656. int l1 = j * j1 - i * i1 >> 16;
  10657. if(l > 2500) {
  10658. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 , 83 - l1 - sprite.anInt1445 / 2 - 4);
  10659. } else {
  10660. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4, 83 - l1 - sprite.anInt1445 / 2 - 4);
  10661. }
  10662. }
  10663.  
  10664. private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  10665. )
  10666. {
  10667. if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  10668. {
  10669. if(lowMem && j != plane)
  10670. return;
  10671. int i2 = 0;
  10672. if(j1 == 0)
  10673. i2 = worldController.method300(j, i1, i);
  10674. if(j1 == 1)
  10675. i2 = worldController.method301(j, i1, i);
  10676. if(j1 == 2)
  10677. i2 = worldController.method302(j, i1, i);
  10678. if(j1 == 3)
  10679. i2 = worldController.method303(j, i1, i);
  10680. if(i2 != 0)
  10681. {
  10682. int i3 = worldController.method304(j, i1, i, i2);
  10683. int j2 = i2 >> 14 & 0x7fff;
  10684. int k2 = i3 & 0x1f;
  10685. int l2 = i3 >> 6;
  10686. if(j1 == 0)
  10687. {
  10688. worldController.method291(i1, j, i, (byte)-119);
  10689. ObjectDef class46 = ObjectDef.forID(j2);
  10690. if(class46.aBoolean767)
  10691. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  10692. }
  10693. if(j1 == 1)
  10694. worldController.method292(i, j, i1);
  10695. if(j1 == 2)
  10696. {
  10697. worldController.method293(j, i1, i);
  10698. ObjectDef class46_1 = ObjectDef.forID(j2);
  10699. if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  10700. return;
  10701. if(class46_1.aBoolean767)
  10702. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  10703. }
  10704. if(j1 == 3)
  10705. {
  10706. worldController.method294(j, i, i1);
  10707. ObjectDef class46_2 = ObjectDef.forID(j2);
  10708. if(class46_2.aBoolean767 && class46_2.hasActions)
  10709. aClass11Array1230[j].method218(i, i1);
  10710. }
  10711. }
  10712. if(k1 >= 0)
  10713. {
  10714. int j3 = j;
  10715. if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  10716. j3++;
  10717. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  10718. }
  10719. }
  10720. }
  10721.  
  10722. private void updatePlayers(int i, Stream stream)
  10723. {
  10724. anInt839 = 0;
  10725. anInt893 = 0;
  10726. method117(stream);
  10727. method134(stream);
  10728. method91(stream, i);
  10729. method49(stream);
  10730. for(int k = 0; k < anInt839; k++)
  10731. {
  10732. int l = anIntArray840[k];
  10733. if(playerArray[l].anInt1537 != loopCycle)
  10734. playerArray[l] = null;
  10735. }
  10736.  
  10737. if(stream.currentOffset != i)
  10738. {
  10739. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  10740. throw new RuntimeException("eek");
  10741. }
  10742. for(int i1 = 0; i1 < playerCount; i1++)
  10743. if(playerArray[playerIndices[i1]] == null)
  10744. {
  10745. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  10746. throw new RuntimeException("eek");
  10747. }
  10748.  
  10749. }
  10750.  
  10751. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  10752. {
  10753. int l1 = 2048 - k & 0x7ff;
  10754. int i2 = 2048 - j1 & 0x7ff;
  10755. int j2 = 0;
  10756. int k2 = 0;
  10757. int l2 = j;
  10758. if(l1 != 0)
  10759. {
  10760. int i3 = Model.modelIntArray1[l1];
  10761. int k3 = Model.modelIntArray2[l1];
  10762. int i4 = k2 * k3 - l2 * i3 >> 16;
  10763. l2 = k2 * i3 + l2 * k3 >> 16;
  10764. k2 = i4;
  10765. }
  10766. if(i2 != 0)
  10767. {
  10768. /* xxx if(cameratoggle){
  10769. if(zoom == 0)
  10770. zoom = k2;
  10771. if(lftrit == 0)
  10772. lftrit = j2;
  10773. if(fwdbwd == 0)
  10774. fwdbwd = l2;
  10775. k2 = zoom;
  10776. j2 = lftrit;
  10777. l2 = fwdbwd;
  10778. }
  10779. */
  10780. int j3 = Model.modelIntArray1[i2];
  10781. int l3 = Model.modelIntArray2[i2];
  10782. int j4 = l2 * j3 + j2 * l3 >> 16;
  10783. l2 = l2 * l3 - j2 * j3 >> 16;
  10784. j2 = j4;
  10785. }
  10786. xCameraPos = l - j2;
  10787. zCameraPos = i1 - k2;
  10788. yCameraPos = k1 - l2;
  10789. yCameraCurve = k;
  10790. xCameraCurve = j1;
  10791. }
  10792.  
  10793. public void updateStrings(String str, int i) {
  10794. switch(i) {
  10795. case 1675: sendFrame126(str, 17508); break;//Stab
  10796. case 1676: sendFrame126(str, 17509); break;//Slash
  10797. case 1677: sendFrame126(str, 17510); break;//Cursh
  10798. case 1678: sendFrame126(str, 17511); break;//Magic
  10799. case 1679: sendFrame126(str, 17512); break;//Range
  10800. case 1680: sendFrame126(str, 17513); break;//Stab
  10801. case 1681: sendFrame126(str, 17514); break;//Slash
  10802. case 1682: sendFrame126(str, 17515); break;//Crush
  10803. case 1683: sendFrame126(str, 17516); break;//Magic
  10804. case 1684: sendFrame126(str, 17517); break;//Range
  10805. case 1686: sendFrame126(str, 17518); break;//Strength
  10806. case 1687: sendFrame126(str, 17519); break;//Prayer
  10807. }
  10808. }
  10809.  
  10810. public void sendFrame126(String str,int i) {
  10811. RSInterface.interfaceCache[i].message = str;
  10812. if(RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  10813. needDrawTabArea = true;
  10814. }
  10815.  
  10816. public void sendPacket185(int button,int toggle,int type) {
  10817. switch(type) {
  10818. case 135:
  10819. RSInterface class9 = RSInterface.interfaceCache[button];
  10820. boolean flag8 = true;
  10821. if(class9.contentType > 0)
  10822. flag8 = promptUserForInput(class9);
  10823. if(flag8) {
  10824. stream.createFrame(185);
  10825. stream.writeWord(button);
  10826. }
  10827. break;
  10828. case 646:
  10829. stream.createFrame(185);
  10830. stream.writeWord(button);
  10831. RSInterface class9_2 = RSInterface.interfaceCache[button];
  10832. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  10833. if(variousSettings[toggle] != class9_2.anIntArray212[0]) {
  10834. variousSettings[toggle] = class9_2.anIntArray212[0];
  10835. method33(toggle);
  10836. needDrawTabArea = true;
  10837. }
  10838. }
  10839. break;
  10840. case 169:
  10841. stream.createFrame(185);
  10842. stream.writeWord(button);
  10843. RSInterface class9_3 = RSInterface.interfaceCache[button];
  10844. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  10845. variousSettings[toggle] = 1 - variousSettings[toggle];
  10846. method33(toggle);
  10847. needDrawTabArea = true;
  10848. }
  10849. switch(button) {
  10850. case 19136:
  10851. System.out.println("toggle = "+toggle);
  10852. if(toggle == 0)
  10853. sendFrame36(173,toggle);
  10854. if(toggle == 1)
  10855. sendPacket185(153,173,646);
  10856. break;
  10857. }
  10858. break;
  10859. }
  10860. }
  10861.  
  10862. public void sendFrame36(int id,int state) {
  10863. anIntArray1045[id] = state;
  10864. if(variousSettings[id] != state) {
  10865. variousSettings[id] = state;
  10866. method33(id);
  10867. needDrawTabArea = true;
  10868. if(dialogID != -1)
  10869. inputTaken = true;
  10870. }
  10871. }
  10872.  
  10873. public void sendFrame219() {
  10874. if(invOverlayInterfaceID != -1) {
  10875. invOverlayInterfaceID = -1;
  10876. needDrawTabArea = true;
  10877. tabAreaAltered = true;
  10878. }
  10879. if(backDialogID != -1) {
  10880. backDialogID = -1;
  10881. inputTaken = true;
  10882. }
  10883. if(inputDialogState != 0) {
  10884. inputDialogState = 0;
  10885. inputTaken = true;
  10886. }
  10887. openInterfaceID = -1;
  10888. aBoolean1149 = false;
  10889. }
  10890.  
  10891. public void sendFrame248(int interfaceID,int sideInterfaceID) {
  10892. if(backDialogID != -1) {
  10893. backDialogID = -1;
  10894. inputTaken = true;
  10895. }
  10896. if(inputDialogState != 0) {
  10897. inputDialogState = 0;
  10898. inputTaken = true;
  10899. }
  10900. openInterfaceID = interfaceID;
  10901. invOverlayInterfaceID = sideInterfaceID;
  10902. needDrawTabArea = true;
  10903. tabAreaAltered = true;
  10904. aBoolean1149 = false;
  10905. }
  10906.  
  10907. private boolean parsePacket() {
  10908. if(socketStream == null)
  10909. return false;
  10910. try {
  10911. int i = socketStream.available();
  10912. if(i == 0)
  10913. return false;
  10914. if(pktType == -1) {
  10915. socketStream.flushInputStream(inStream.buffer, 1);
  10916. pktType = inStream.buffer[0] & 0xff;
  10917. if(encryption != null)
  10918. pktType = pktType - encryption.getNextKey() & 0xff;
  10919. pktSize = SizeConstants.packetSizes[pktType];
  10920. i--;
  10921. }
  10922. if(pktSize == -1)
  10923. if(i > 0) {
  10924. socketStream.flushInputStream(inStream.buffer, 1);
  10925. pktSize = inStream.buffer[0] & 0xff;
  10926. i--;
  10927. } else {
  10928. return false;
  10929. }
  10930. if(pktSize == -2)
  10931. if(i > 1) {
  10932. socketStream.flushInputStream(inStream.buffer, 2);
  10933. inStream.currentOffset = 0;
  10934. pktSize = inStream.readUnsignedWord();
  10935. i -= 2;
  10936. } else {
  10937. return false;
  10938. }
  10939. if(i < pktSize)
  10940. return false;
  10941. inStream.currentOffset = 0;
  10942. socketStream.flushInputStream(inStream.buffer, pktSize);
  10943. anInt1009 = 0;
  10944. anInt843 = anInt842;
  10945. anInt842 = anInt841;
  10946. anInt841 = pktType;
  10947. switch(pktType) {
  10948. case 81:
  10949. updatePlayers(pktSize, inStream);
  10950. aBoolean1080 = false;
  10951. pktType = -1;
  10952. return true;
  10953.  
  10954. case 176:
  10955. daysSinceRecovChange = inStream.method427();
  10956. unreadMessages = inStream.method435();
  10957. membersInt = inStream.readUnsignedByte();
  10958. anInt1193 = inStream.method440();
  10959. daysSinceLastLogin = inStream.readUnsignedWord();
  10960. if(anInt1193 != 0 && openInterfaceID == -1) {
  10961. signlink.dnslookup(TextClass.method586(anInt1193));
  10962. clearTopInterfaces();
  10963. char c = '\u028A';
  10964. if(daysSinceRecovChange != 201 || membersInt == 1)
  10965. c = '\u028F';
  10966. reportAbuseInput = "";
  10967. canMute = false;
  10968. for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  10969. if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  10970. continue;
  10971. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  10972.  
  10973. }
  10974. }
  10975. pktType = -1;
  10976. return true;
  10977.  
  10978. case 64:
  10979. anInt1268 = inStream.method427();
  10980. anInt1269 = inStream.method428();
  10981. for(int j = anInt1268; j < anInt1268 + 8; j++) {
  10982. for(int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  10983. if(groundArray[plane][j][l9] != null) {
  10984. groundArray[plane][j][l9] = null;
  10985. spawnGroundItem(j, l9);
  10986. }
  10987. }
  10988. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10989. if(class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  10990. class30_sub1.anInt1294 = 0;
  10991. pktType = -1;
  10992. return true;
  10993.  
  10994. case 185:
  10995. int k = inStream.method436();
  10996. RSInterface.interfaceCache[k].anInt233 = 3;
  10997. if(myPlayer.desc == null)
  10998. 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];
  10999. else
  11000. RSInterface.interfaceCache[k].mediaID = (int)(0x12345678L + myPlayer.desc.type);
  11001. pktType = -1;
  11002. return true;
  11003.  
  11004. /* Clan chat packet */
  11005. case 217:
  11006. try {
  11007. name = inStream.readString();
  11008. message = inStream.readString();
  11009. clanname = inStream.readString();
  11010. rights = inStream.readUnsignedWord();
  11011. //message = TextInput.processText(message);
  11012. //message = Censor.doCensor(message);
  11013. System.out.println(clanname);
  11014. pushMessage(message, 16, name);
  11015. } catch(Exception e) {
  11016. e.printStackTrace();
  11017. }
  11018. pktType = -1;
  11019. return true;
  11020.  
  11021. case 107:
  11022. aBoolean1160 = false;
  11023. for(int l = 0; l < 5; l++)
  11024. aBooleanArray876[l] = false;
  11025. pktType = -1;
  11026. return true;
  11027.  
  11028. case 72:
  11029. int i1 = inStream.method434();
  11030. RSInterface class9 = RSInterface.interfaceCache[i1];
  11031. for(int k15 = 0; k15 < class9.inv.length; k15++) {
  11032. class9.inv[k15] = -1;
  11033. class9.inv[k15] = 0;
  11034. }
  11035. pktType = -1;
  11036. return true;
  11037.  
  11038. case 214:
  11039. ignoreCount = pktSize / 8;
  11040. for(int j1 = 0; j1 < ignoreCount; j1++)
  11041. ignoreListAsLongs[j1] = inStream.readQWord();
  11042. pktType = -1;
  11043. return true;
  11044.  
  11045. case 166:
  11046. aBoolean1160 = true;
  11047. anInt1098 = inStream.readUnsignedByte();
  11048. anInt1099 = inStream.readUnsignedByte();
  11049. anInt1100 = inStream.readUnsignedWord();
  11050. anInt1101 = inStream.readUnsignedByte();
  11051. anInt1102 = inStream.readUnsignedByte();
  11052. if(anInt1102 >= 100) {
  11053. xCameraPos = anInt1098 * 128 + 64;
  11054. yCameraPos = anInt1099 * 128 + 64;
  11055. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  11056. }
  11057. pktType = -1;
  11058. return true;
  11059.  
  11060. case 134:
  11061. needDrawTabArea = true;
  11062. int k1 = inStream.readUnsignedByte();
  11063. int i10 = inStream.method439();
  11064. int l15 = inStream.readUnsignedByte();
  11065. currentExp[k1] = i10;
  11066. currentStats[k1] = l15;
  11067. maxStats[k1] = 1;
  11068. for(int k20 = 0; k20 < 98; k20++)
  11069. if(i10 >= anIntArray1019[k20])
  11070. maxStats[k1] = k20 + 2;
  11071. pktType = -1;
  11072. return true;
  11073.  
  11074. case 71:
  11075. int l1 = inStream.readUnsignedWord();
  11076. int j10 = inStream.method426();
  11077. if(l1 == 65535)
  11078. l1 = -1;
  11079. tabInterfaceIDs[j10] = l1;
  11080. needDrawTabArea = true;
  11081. tabAreaAltered = true;
  11082. pktType = -1;
  11083. return true;
  11084.  
  11085. case 74:
  11086. int i2 = inStream.method434();
  11087. if(i2 == 65535)
  11088. i2 = -1;
  11089. if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  11090. nextSong = i2;
  11091. songChanging = true;
  11092. onDemandFetcher.method558(2, nextSong);
  11093. }
  11094. currentSong = i2;
  11095. pktType = -1;
  11096. return true;
  11097.  
  11098. case 121:
  11099. int j2 = inStream.method436();
  11100. int k10 = inStream.method435();
  11101. if(musicEnabled && !lowMem) {
  11102. nextSong = j2;
  11103. songChanging = false;
  11104. onDemandFetcher.method558(2, nextSong);
  11105. prevSong = k10;
  11106. }
  11107. pktType = -1;
  11108. return true;
  11109.  
  11110. case 109:
  11111. resetLogout();
  11112. pktType = -1;
  11113. return false;
  11114.  
  11115. case 70:
  11116. int k2 = inStream.readSignedWord();
  11117. int l10 = inStream.method437();
  11118. int i16 = inStream.method434();
  11119. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  11120. class9_5.anInt263 = k2;
  11121. class9_5.anInt265 = l10;
  11122. pktType = -1;
  11123. return true;
  11124.  
  11125. case 73:
  11126. case 241:
  11127. int l2 = anInt1069;
  11128. int i11 = anInt1070;
  11129. if(pktType == 73) {
  11130. l2 = inStream.method435();
  11131. i11 = inStream.readUnsignedWord();
  11132. aBoolean1159 = false;
  11133. }
  11134. if(pktType == 241) {
  11135. i11 = inStream.method435();
  11136. inStream.initBitAccess();
  11137. for(int j16 = 0; j16 < 4; j16++) {
  11138. for(int l20 = 0; l20 < 13; l20++) {
  11139. for(int j23 = 0; j23 < 13; j23++) {
  11140. int i26 = inStream.readBits(1);
  11141. if(i26 == 1)
  11142. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  11143. else
  11144. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  11145. }
  11146. }
  11147. }
  11148. inStream.finishBitAccess();
  11149. l2 = inStream.readUnsignedWord();
  11150. aBoolean1159 = true;
  11151. }
  11152. if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  11153. pktType = -1;
  11154. return true;
  11155. }
  11156. anInt1069 = l2;
  11157. anInt1070 = i11;
  11158. baseX = (anInt1069 - 6) * 8;
  11159. baseY = (anInt1070 - 6) * 8;
  11160. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  11161. if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  11162. aBoolean1141 = true;
  11163. loadingStage = 1;
  11164. aLong824 = System.currentTimeMillis();
  11165. aRSImageProducer_1165.initDrawingArea();
  11166. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  11167. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  11168. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  11169. if(pktType == 73) {
  11170. int k16 = 0;
  11171. for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  11172. for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  11173. k16++;
  11174. }
  11175. aByteArrayArray1183 = new byte[k16][];
  11176. aByteArrayArray1247 = new byte[k16][];
  11177. anIntArray1234 = new int[k16];
  11178. anIntArray1235 = new int[k16];
  11179. anIntArray1236 = new int[k16];
  11180. k16 = 0;
  11181. for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  11182. for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  11183. anIntArray1234[k16] = (l23 << 8) + j26;
  11184. if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  11185. anIntArray1235[k16] = -1;
  11186. anIntArray1236[k16] = -1;
  11187. k16++;
  11188. } else {
  11189. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  11190. if(k28 != -1)
  11191. onDemandFetcher.method558(3, k28);
  11192. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  11193. if(j30 != -1)
  11194. onDemandFetcher.method558(3, j30);
  11195. k16++;
  11196. }
  11197. }
  11198. }
  11199. }
  11200. if(pktType == 241) {
  11201. int l16 = 0;
  11202. int ai[] = new int[676];
  11203. for(int i24 = 0; i24 < 4; i24++) {
  11204. for(int k26 = 0; k26 < 13; k26++) {
  11205. for(int l28 = 0; l28 < 13; l28++) {
  11206. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  11207. if(k30 != -1) {
  11208. int k31 = k30 >> 14 & 0x3ff;
  11209. int i32 = k30 >> 3 & 0x7ff;
  11210. int k32 = (k31 / 8 << 8) + i32 / 8;
  11211. for(int j33 = 0; j33 < l16; j33++) {
  11212. if(ai[j33] != k32)
  11213. continue;
  11214. k32 = -1;
  11215.  
  11216. }
  11217. if(k32 != -1)
  11218. ai[l16++] = k32;
  11219. }
  11220. }
  11221. }
  11222. }
  11223. aByteArrayArray1183 = new byte[l16][];
  11224. aByteArrayArray1247 = new byte[l16][];
  11225. anIntArray1234 = new int[l16];
  11226. anIntArray1235 = new int[l16];
  11227. anIntArray1236 = new int[l16];
  11228. for(int l26 = 0; l26 < l16; l26++) {
  11229. int i29 = anIntArray1234[l26] = ai[l26];
  11230. int l30 = i29 >> 8 & 0xff;
  11231. int l31 = i29 & 0xff;
  11232. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  11233. if(j32 != -1)
  11234. onDemandFetcher.method558(3, j32);
  11235. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  11236. if(i33 != -1)
  11237. onDemandFetcher.method558(3, i33);
  11238. }
  11239. }
  11240. int i17 = baseX - anInt1036;
  11241. int j21 = baseY - anInt1037;
  11242. anInt1036 = baseX;
  11243. anInt1037 = baseY;
  11244. for(int j24 = 0; j24 < 16384; j24++) {
  11245. NPC npc = npcArray[j24];
  11246. if(npc != null) {
  11247. for(int j29 = 0; j29 < 10; j29++) {
  11248. npc.smallX[j29] -= i17;
  11249. npc.smallY[j29] -= j21;
  11250. }
  11251. npc.x -= i17 * 128;
  11252. npc.y -= j21 * 128;
  11253. }
  11254. }
  11255. for(int i27 = 0; i27 < maxPlayers; i27++) {
  11256. Player player = playerArray[i27];
  11257. if(player != null) {
  11258. for(int i31 = 0; i31 < 10; i31++) {
  11259. player.smallX[i31] -= i17;
  11260. player.smallY[i31] -= j21;
  11261. }
  11262. player.x -= i17 * 128;
  11263. player.y -= j21 * 128;
  11264. }
  11265. }
  11266. aBoolean1080 = true;
  11267. byte byte1 = 0;
  11268. byte byte2 = 104;
  11269. byte byte3 = 1;
  11270. if(i17 < 0) {
  11271. byte1 = 103;
  11272. byte2 = -1;
  11273. byte3 = -1;
  11274. }
  11275. byte byte4 = 0;
  11276. byte byte5 = 104;
  11277. byte byte6 = 1;
  11278. if(j21 < 0) {
  11279. byte4 = 103;
  11280. byte5 = -1;
  11281. byte6 = -1;
  11282. }
  11283. for(int k33 = byte1; k33 != byte2; k33 += byte3) {
  11284. for(int l33 = byte4; l33 != byte5; l33 += byte6) {
  11285. int i34 = k33 + i17;
  11286. int j34 = l33 + j21;
  11287. for(int k34 = 0; k34 < 4; k34++)
  11288. if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  11289. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  11290. else
  11291. groundArray[k34][k33][l33] = null;
  11292. }
  11293. }
  11294. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext()) {
  11295. class30_sub1_1.anInt1297 -= i17;
  11296. class30_sub1_1.anInt1298 -= j21;
  11297. if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  11298. class30_sub1_1.unlink();
  11299. }
  11300. if(destX != 0) {
  11301. destX -= i17;
  11302. destY -= j21;
  11303. }
  11304. aBoolean1160 = false;
  11305. pktType = -1;
  11306. return true;
  11307.  
  11308. case 208:
  11309. int i3 = inStream.method437();
  11310. if(i3 >= 0)
  11311. method60(i3);
  11312. anInt1018 = i3;
  11313. pktType = -1;
  11314. return true;
  11315.  
  11316. case 99:
  11317. anInt1021 = inStream.readUnsignedByte();
  11318. pktType = -1;
  11319. return true;
  11320.  
  11321. case 75:
  11322. int j3 = inStream.method436();
  11323. int j11 = inStream.method436();
  11324. RSInterface.interfaceCache[j11].anInt233 = 2;
  11325. RSInterface.interfaceCache[j11].mediaID = j3;
  11326. pktType = -1;
  11327. return true;
  11328.  
  11329. case 114:
  11330. anInt1104 = inStream.method434() * 30;
  11331. pktType = -1;
  11332. return true;
  11333.  
  11334. case 60:
  11335. anInt1269 = inStream.readUnsignedByte();
  11336. anInt1268 = inStream.method427();
  11337. while(inStream.currentOffset < pktSize) {
  11338. int k3 = inStream.readUnsignedByte();
  11339. method137(inStream, k3);
  11340. }
  11341. pktType = -1;
  11342. return true;
  11343.  
  11344. case 35:
  11345. int l3 = inStream.readUnsignedByte();
  11346. int k11 = inStream.readUnsignedByte();
  11347. int j17 = inStream.readUnsignedByte();
  11348. int k21 = inStream.readUnsignedByte();
  11349. aBooleanArray876[l3] = true;
  11350. anIntArray873[l3] = k11;
  11351. anIntArray1203[l3] = j17;
  11352. anIntArray928[l3] = k21;
  11353. anIntArray1030[l3] = 0;
  11354. pktType = -1;
  11355. return true;
  11356.  
  11357. case 174:
  11358. int i4 = inStream.readUnsignedWord();
  11359. int l11 = inStream.readUnsignedByte();
  11360. int k17 = inStream.readUnsignedWord();
  11361. if(aBoolean848 && !lowMem && anInt1062 < 50) {
  11362. anIntArray1207[anInt1062] = i4;
  11363. anIntArray1241[anInt1062] = l11;
  11364. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  11365. anInt1062++;
  11366. }
  11367. pktType = -1;
  11368. return true;
  11369.  
  11370. case 104:
  11371. int j4 = inStream.method427();
  11372. int i12 = inStream.method426();
  11373. String s6 = inStream.readString();
  11374. if(j4 >= 1 && j4 <= 5) {
  11375. if(s6.equalsIgnoreCase("null"))
  11376. s6 = null;
  11377. atPlayerActions[j4 - 1] = s6;
  11378. atPlayerArray[j4 - 1] = i12 == 0;
  11379. }
  11380. pktType = -1;
  11381. return true;
  11382.  
  11383. case 78:
  11384. destX = 0;
  11385. pktType = -1;
  11386. return true;
  11387.  
  11388. case 253:
  11389. String s = inStream.readString();
  11390. if(s.endsWith(":tradereq:")) {
  11391. String s3 = s.substring(0, s.indexOf(":"));
  11392. long l17 = TextClass.longForName(s3);
  11393. boolean flag2 = false;
  11394. for(int j27 = 0; j27 < ignoreCount; j27++) {
  11395. if(ignoreListAsLongs[j27] != l17)
  11396. continue;
  11397. flag2 = true;
  11398.  
  11399. }
  11400. if(!flag2 && anInt1251 == 0)
  11401. pushMessage("wishes to trade with you.", 4, s3);
  11402. } else if (s.endsWith(":clan:")) {
  11403. String s4 = s.substring(0, s.indexOf(":"));
  11404. long l18 = TextClass.longForName(s4);
  11405. pushMessage("Clan: ", 8, s4);
  11406. } else if(s.endsWith("#url#")) {
  11407. String link = s.substring(0, s.indexOf("#"));
  11408. pushMessage("Join us at: ", 9, link);
  11409. } else if(s.endsWith(":duelreq:")) {
  11410. String s4 = s.substring(0, s.indexOf(":"));
  11411. long l18 = TextClass.longForName(s4);
  11412. boolean flag3 = false;
  11413. for(int k27 = 0; k27 < ignoreCount; k27++) {
  11414. if(ignoreListAsLongs[k27] != l18)
  11415. continue;
  11416. flag3 = true;
  11417.  
  11418. }
  11419. if(!flag3 && anInt1251 == 0)
  11420. pushMessage("wishes to duel with you.", 8, s4);
  11421. } else if(s.endsWith(":chalreq:")) {
  11422. String s5 = s.substring(0, s.indexOf(":"));
  11423. long l19 = TextClass.longForName(s5);
  11424. boolean flag4 = false;
  11425. for(int l27 = 0; l27 < ignoreCount; l27++) {
  11426. if(ignoreListAsLongs[l27] != l19)
  11427. continue;
  11428. flag4 = true;
  11429.  
  11430. }
  11431. if(!flag4 && anInt1251 == 0) {
  11432. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  11433. pushMessage(s8, 8, s5);
  11434. }
  11435. } else {
  11436. pushMessage(s, 0, "");
  11437. }
  11438. pktType = -1;
  11439. return true;
  11440.  
  11441. case 1:
  11442. for(int k4 = 0; k4 < playerArray.length; k4++)
  11443. if(playerArray[k4] != null)
  11444. playerArray[k4].anim = -1;
  11445. for(int j12 = 0; j12 < npcArray.length; j12++)
  11446. if(npcArray[j12] != null)
  11447. npcArray[j12].anim = -1;
  11448. pktType = -1;
  11449. return true;
  11450.  
  11451. case 50:
  11452. long l4 = inStream.readQWord();
  11453. int i18 = inStream.readUnsignedByte();
  11454. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  11455. for(int k24 = 0; k24 < friendsCount; k24++) {
  11456. if(l4 != friendsListAsLongs[k24])
  11457. continue;
  11458. if(friendsNodeIDs[k24] != i18) {
  11459. friendsNodeIDs[k24] = i18;
  11460. needDrawTabArea = true;
  11461. if(i18 >= 2) {
  11462. pushMessage(s7 + " has logged in.", 5, "");
  11463. }
  11464. if(i18 <= 1) {
  11465. pushMessage(s7 + " has logged out.", 5, "");
  11466. }
  11467. }
  11468. s7 = null;
  11469.  
  11470. }
  11471. if(s7 != null && friendsCount < 200) {
  11472. friendsListAsLongs[friendsCount] = l4;
  11473. friendsList[friendsCount] = s7;
  11474. friendsNodeIDs[friendsCount] = i18;
  11475. friendsCount++;
  11476. needDrawTabArea = true;
  11477. }
  11478. for(boolean flag6 = false; !flag6;) {
  11479. flag6 = true;
  11480. for(int k29 = 0; k29 < friendsCount - 1; k29++)
  11481. if(friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  11482. int j31 = friendsNodeIDs[k29];
  11483. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  11484. friendsNodeIDs[k29 + 1] = j31;
  11485. String s10 = friendsList[k29];
  11486. friendsList[k29] = friendsList[k29 + 1];
  11487. friendsList[k29 + 1] = s10;
  11488. long l32 = friendsListAsLongs[k29];
  11489. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  11490. friendsListAsLongs[k29 + 1] = l32;
  11491. needDrawTabArea = true;
  11492. flag6 = false;
  11493. }
  11494. }
  11495. pktType = -1;
  11496. return true;
  11497.  
  11498. case 110:
  11499. if(tabID == 12)
  11500. needDrawTabArea = true;
  11501. energy = inStream.readUnsignedByte();
  11502. pktType = -1;
  11503. return true;
  11504.  
  11505. case 254:
  11506. anInt855 = inStream.readUnsignedByte();
  11507. if(anInt855 == 1)
  11508. anInt1222 = inStream.readUnsignedWord();
  11509. if(anInt855 >= 2 && anInt855 <= 6) {
  11510. if(anInt855 == 2) {
  11511. anInt937 = 64;
  11512. anInt938 = 64;
  11513. }
  11514. if(anInt855 == 3) {
  11515. anInt937 = 0;
  11516. anInt938 = 64;
  11517. }
  11518. if(anInt855 == 4) {
  11519. anInt937 = 128;
  11520. anInt938 = 64;
  11521. }
  11522. if(anInt855 == 5) {
  11523. anInt937 = 64;
  11524. anInt938 = 0;
  11525. }
  11526. if(anInt855 == 6) {
  11527. anInt937 = 64;
  11528. anInt938 = 128;
  11529. }
  11530. anInt855 = 2;
  11531. anInt934 = inStream.readUnsignedWord();
  11532. anInt935 = inStream.readUnsignedWord();
  11533. anInt936 = inStream.readUnsignedByte();
  11534. }
  11535. if(anInt855 == 10)
  11536. anInt933 = inStream.readUnsignedWord();
  11537. pktType = -1;
  11538. return true;
  11539.  
  11540. case 248:
  11541. int i5 = inStream.method435();
  11542. int k12 = inStream.readUnsignedWord();
  11543. if(backDialogID != -1) {
  11544. backDialogID = -1;
  11545. inputTaken = true;
  11546. }
  11547. if(inputDialogState != 0) {
  11548. inputDialogState = 0;
  11549. inputTaken = true;
  11550. }
  11551. openInterfaceID = i5;
  11552. invOverlayInterfaceID = k12;
  11553. needDrawTabArea = true;
  11554. tabAreaAltered = true;
  11555. aBoolean1149 = false;
  11556. pktType = -1;
  11557. return true;
  11558.  
  11559. case 79:
  11560. int j5 = inStream.method434();
  11561. int l12 = inStream.method435();
  11562. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  11563. if(class9_3 != null && class9_3.type == 0) {
  11564. if(l12 < 0)
  11565. l12 = 0;
  11566. if(l12 > class9_3.scrollMax - class9_3.height)
  11567. l12 = class9_3.scrollMax - class9_3.height;
  11568. class9_3.scrollPosition = l12;
  11569. }
  11570. pktType = -1;
  11571. return true;
  11572.  
  11573. case 68:
  11574. for(int k5 = 0; k5 < variousSettings.length; k5++)
  11575. if(variousSettings[k5] != anIntArray1045[k5]) {
  11576. variousSettings[k5] = anIntArray1045[k5];
  11577. method33(k5);
  11578. needDrawTabArea = true;
  11579. }
  11580. pktType = -1;
  11581. return true;
  11582.  
  11583. case 196:
  11584. long l5 = inStream.readQWord();
  11585. int j18 = inStream.readDWord();
  11586. int l21 = inStream.readUnsignedByte();
  11587. boolean flag5 = false;
  11588. for(int i28 = 0; i28 < 100; i28++) {
  11589. if(anIntArray1240[i28] != j18)
  11590. continue;
  11591. flag5 = true;
  11592.  
  11593. }
  11594. if(l21 <= 1) {
  11595. for(int l29 = 0; l29 < ignoreCount; l29++) {
  11596. if(ignoreListAsLongs[l29] != l5)
  11597. continue;
  11598. flag5 = true;
  11599.  
  11600. }
  11601. }
  11602. if(!flag5 && anInt1251 == 0)
  11603. try {
  11604. anIntArray1240[anInt1169] = j18;
  11605. anInt1169 = (anInt1169 + 1) % 100;
  11606. String s9 = TextInput.method525(pktSize - 13, inStream);
  11607. //if(l21 != 3)
  11608. //s9 = Censor.doCensor(s9);
  11609. if(l21 == 2 || l21 == 3)
  11610. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11611. else
  11612. if(l21 == 1)
  11613. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11614. else
  11615. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  11616. } catch(Exception exception1) {
  11617. signlink.reporterror("cde1");
  11618. }
  11619. pktType = -1;
  11620. return true;
  11621.  
  11622. case 85:
  11623. anInt1269 = inStream.method427();
  11624. anInt1268 = inStream.method427();
  11625. pktType = -1;
  11626. return true;
  11627.  
  11628. case 24:
  11629. anInt1054 = inStream.method428();
  11630. if(anInt1054 == tabID) {
  11631. if(anInt1054 == 3)
  11632. tabID = 1;
  11633. else
  11634. tabID = 3;
  11635. needDrawTabArea = true;
  11636. }
  11637. pktType = -1;
  11638. return true;
  11639.  
  11640. case 246:
  11641. int i6 = inStream.method434();
  11642. int i13 = inStream.readUnsignedWord();
  11643. int k18 = inStream.readUnsignedWord();
  11644. if(k18 == 65535) {
  11645. RSInterface.interfaceCache[i6].anInt233 = 0;
  11646. pktType = -1;
  11647. return true;
  11648. } else {
  11649. ItemDef itemDef = ItemDef.forID(k18);
  11650. RSInterface.interfaceCache[i6].anInt233 = 4;
  11651. RSInterface.interfaceCache[i6].mediaID = k18;
  11652. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotation1;
  11653. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotation2;
  11654. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  11655. pktType = -1;
  11656. return true;
  11657. }
  11658.  
  11659. case 171:
  11660. boolean flag1 = inStream.readUnsignedByte() == 1;
  11661. int j13 = inStream.readUnsignedWord();
  11662. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  11663. pktType = -1;
  11664. return true;
  11665.  
  11666. case 142:
  11667. int j6 = inStream.method434();
  11668. method60(j6);
  11669. if(backDialogID != -1) {
  11670. backDialogID = -1;
  11671. inputTaken = true;
  11672. }
  11673. if(inputDialogState != 0) {
  11674. inputDialogState = 0;
  11675. inputTaken = true;
  11676. }
  11677. invOverlayInterfaceID = j6;
  11678. needDrawTabArea = true;
  11679. tabAreaAltered = true;
  11680. openInterfaceID = -1;
  11681. aBoolean1149 = false;
  11682. pktType = -1;
  11683. return true;
  11684.  
  11685. case 126:
  11686. String text = inStream.readString();
  11687. int frame = inStream.method435();
  11688. if (text.startsWith("www.")) {
  11689. launchURL(text);
  11690. pktType = -1;
  11691. return true;
  11692. }
  11693. updateStrings(text, frame);
  11694. sendFrame126(text, frame);
  11695. if (frame >= 18144 && frame <= 18244) {
  11696. clanList[frame - 18144] = text;
  11697. }
  11698. pktType = -1;
  11699. return true;
  11700.  
  11701. case 206:
  11702. publicChatMode = inStream.readUnsignedByte();
  11703. privateChatMode = inStream.readUnsignedByte();
  11704. tradeMode = inStream.readUnsignedByte();
  11705. aBoolean1233 = true;
  11706. inputTaken = true;
  11707. pktType = -1;
  11708. return true;
  11709.  
  11710. case 240:
  11711. if(tabID == 12)
  11712. needDrawTabArea = true;
  11713. weight = inStream.readSignedWord();
  11714. pktType = -1;
  11715. return true;
  11716.  
  11717. case 8:
  11718. int k6 = inStream.method436();
  11719. int l13 = inStream.readUnsignedWord();
  11720. RSInterface.interfaceCache[k6].anInt233 = 1;
  11721. RSInterface.interfaceCache[k6].mediaID = l13;
  11722. pktType = -1;
  11723. return true;
  11724.  
  11725. case 122:
  11726. int l6 = inStream.method436();
  11727. int i14 = inStream.method436();
  11728. int i19 = i14 >> 10 & 0x1f;
  11729. int i22 = i14 >> 5 & 0x1f;
  11730. int l24 = i14 & 0x1f;
  11731. RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  11732. pktType = -1;
  11733. return true;
  11734.  
  11735. case 53:
  11736. needDrawTabArea = true;
  11737. int i7 = inStream.readUnsignedWord();
  11738. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  11739. int j19 = inStream.readUnsignedWord();
  11740. for(int j22 = 0; j22 < j19; j22++) {
  11741. int i25 = inStream.readUnsignedByte();
  11742. if(i25 == 255)
  11743. i25 = inStream.method440();
  11744. class9_1.inv[j22] = inStream.method436();
  11745. class9_1.invStackSizes[j22] = i25;
  11746. }
  11747. for(int j25 = j19; j25 < class9_1.inv.length; j25++) {
  11748. class9_1.inv[j25] = 0;
  11749. class9_1.invStackSizes[j25] = 0;
  11750. }
  11751. pktType = -1;
  11752. return true;
  11753.  
  11754. case 230:
  11755. int j7 = inStream.method435();
  11756. int j14 = inStream.readUnsignedWord();
  11757. int k19 = inStream.readUnsignedWord();
  11758. int k22 = inStream.method436();
  11759. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  11760. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  11761. RSInterface.interfaceCache[j14].modelZoom = j7;
  11762. pktType = -1;
  11763. return true;
  11764.  
  11765. case 221:
  11766. anInt900 = inStream.readUnsignedByte();
  11767. needDrawTabArea = true;
  11768. pktType = -1;
  11769. return true;
  11770.  
  11771. case 177:
  11772. aBoolean1160 = true;
  11773. anInt995 = inStream.readUnsignedByte();
  11774. anInt996 = inStream.readUnsignedByte();
  11775. anInt997 = inStream.readUnsignedWord();
  11776. anInt998 = inStream.readUnsignedByte();
  11777. anInt999 = inStream.readUnsignedByte();
  11778. if(anInt999 >= 100) {
  11779. int k7 = anInt995 * 128 + 64;
  11780. int k14 = anInt996 * 128 + 64;
  11781. int i20 = method42(plane, k14, k7) - anInt997;
  11782. int l22 = k7 - xCameraPos;
  11783. int k25 = i20 - zCameraPos;
  11784. int j28 = k14 - yCameraPos;
  11785. int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  11786. yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  11787. xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  11788. if(yCameraCurve < 128)
  11789. yCameraCurve = 128;
  11790. if(yCameraCurve > 383)
  11791. yCameraCurve = 383;
  11792. }
  11793. pktType = -1;
  11794. return true;
  11795.  
  11796. case 249:
  11797. anInt1046 = inStream.method426();
  11798. unknownInt10 = inStream.method436();
  11799. pktType = -1;
  11800. return true;
  11801.  
  11802. case 65:
  11803. updateNPCs(inStream, pktSize);
  11804. pktType = -1;
  11805. return true;
  11806.  
  11807. case 27:
  11808. messagePromptRaised = false;
  11809. inputDialogState = 1;
  11810. amountOrNameInput = "";
  11811. inputTaken = true;
  11812. pktType = -1;
  11813. return true;
  11814.  
  11815. case 187:
  11816. messagePromptRaised = false;
  11817. inputDialogState = 2;
  11818. amountOrNameInput = "";
  11819. inputTaken = true;
  11820. pktType = -1;
  11821. return true;
  11822.  
  11823. case 97:
  11824. int l7 = inStream.readUnsignedWord();
  11825. method60(l7);
  11826. if(invOverlayInterfaceID != -1) {
  11827. invOverlayInterfaceID = -1;
  11828. needDrawTabArea = true;
  11829. tabAreaAltered = true;
  11830. }
  11831. if(backDialogID != -1) {
  11832. backDialogID = -1;
  11833. inputTaken = true;
  11834. }
  11835. if(inputDialogState != 0) {
  11836. inputDialogState = 0;
  11837. inputTaken = true;
  11838. }
  11839. openInterfaceID = l7;
  11840. aBoolean1149 = false;
  11841. pktType = -1;
  11842. return true;
  11843.  
  11844. case 218:
  11845. int i8 = inStream.method438();
  11846. dialogID = i8;
  11847. inputTaken = true;
  11848. pktType = -1;
  11849. return true;
  11850.  
  11851. case 87:
  11852. int j8 = inStream.method434();
  11853. int l14 = inStream.method439();
  11854. anIntArray1045[j8] = l14;
  11855. if(variousSettings[j8] != l14) {
  11856. variousSettings[j8] = l14;
  11857. method33(j8);
  11858. needDrawTabArea = true;
  11859. if(dialogID != -1)
  11860. inputTaken = true;
  11861. }
  11862. pktType = -1;
  11863. return true;
  11864.  
  11865. case 36:
  11866. int k8 = inStream.method434();
  11867. byte byte0 = inStream.readSignedByte();
  11868. anIntArray1045[k8] = byte0;
  11869. if(variousSettings[k8] != byte0) {
  11870. variousSettings[k8] = byte0;
  11871. method33(k8);
  11872. needDrawTabArea = true;
  11873. if(dialogID != -1)
  11874. inputTaken = true;
  11875. }
  11876. pktType = -1;
  11877. return true;
  11878.  
  11879. case 61:
  11880. anInt1055 = inStream.readUnsignedByte();
  11881. pktType = -1;
  11882. return true;
  11883.  
  11884. case 200:
  11885. int l8 = inStream.readUnsignedWord();
  11886. int i15 = inStream.readSignedWord();
  11887. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  11888. class9_4.anInt257 = i15;
  11889. if(i15 == -1) {
  11890. class9_4.anInt246 = 0;
  11891. class9_4.anInt208 = 0;
  11892. }
  11893. pktType = -1;
  11894. return true;
  11895.  
  11896. case 219:
  11897. if(invOverlayInterfaceID != -1) {
  11898. invOverlayInterfaceID = -1;
  11899. needDrawTabArea = true;
  11900. tabAreaAltered = true;
  11901. }
  11902. if(backDialogID != -1) {
  11903. backDialogID = -1;
  11904. inputTaken = true;
  11905. }
  11906. if(inputDialogState != 0) {
  11907. inputDialogState = 0;
  11908. inputTaken = true;
  11909. }
  11910. openInterfaceID = -1;
  11911. aBoolean1149 = false;
  11912. pktType = -1;
  11913. return true;
  11914.  
  11915. case 34:
  11916. needDrawTabArea = true;
  11917. int i9 = inStream.readUnsignedWord();
  11918. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  11919. while(inStream.currentOffset < pktSize) {
  11920. int j20 = inStream.method422();
  11921. int i23 = inStream.readUnsignedWord();
  11922. int l25 = inStream.readUnsignedByte();
  11923. if(l25 == 255)
  11924. l25 = inStream.readDWord();
  11925. if(j20 >= 0 && j20 < class9_2.inv.length) {
  11926. class9_2.inv[j20] = i23;
  11927. class9_2.invStackSizes[j20] = l25;
  11928. }
  11929. }
  11930. pktType = -1;
  11931. return true;
  11932.  
  11933. case 4:
  11934. case 44:
  11935. case 84:
  11936. case 101:
  11937. case 105:
  11938. case 117:
  11939. case 147:
  11940. case 151:
  11941. case 156:
  11942. case 160:
  11943. case 215:
  11944. method137(inStream, pktType);
  11945. pktType = -1;
  11946. return true;
  11947.  
  11948. case 106:
  11949. tabID = inStream.method427();
  11950. needDrawTabArea = true;
  11951. tabAreaAltered = true;
  11952. pktType = -1;
  11953. return true;
  11954.  
  11955. case 164:
  11956. int j9 = inStream.method434();
  11957. method60(j9);
  11958. if(invOverlayInterfaceID != -1) {
  11959. invOverlayInterfaceID = -1;
  11960. needDrawTabArea = true;
  11961. tabAreaAltered = true;
  11962. }
  11963. backDialogID = j9;
  11964. inputTaken = true;
  11965. openInterfaceID = -1;
  11966. aBoolean1149 = false;
  11967. pktType = -1;
  11968. return true;
  11969.  
  11970. }
  11971. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  11972. //resetLogout();
  11973. } catch(IOException _ex) {
  11974. dropClient();
  11975. } catch(Exception exception) {
  11976. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  11977. for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  11978. s2 = s2 + inStream.buffer[j15] + ",";
  11979. signlink.reporterror(s2);
  11980. //resetLogout();
  11981. }
  11982. pktType = -1;
  11983. return true;
  11984. }
  11985.  
  11986. private void method146() {
  11987. anInt1265++;
  11988. method47(true);
  11989. method26(true);
  11990. method47(false);
  11991. method26(false);
  11992. method55();
  11993. method104();
  11994. if(!aBoolean1160) {
  11995. int i = anInt1184;
  11996. if(anInt984 / 256 > i)
  11997. i = anInt984 / 256;
  11998. if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  11999. i = anIntArray1203[4] + 128;
  12000. int k = minimapInt1 + anInt896 & 0x7ff;
  12001. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  12002. }
  12003. int j;
  12004. if(!aBoolean1160)
  12005. j = method120();
  12006. else
  12007. j = method121();
  12008. int l = xCameraPos;
  12009. int i1 = zCameraPos;
  12010. int j1 = yCameraPos;
  12011. int k1 = yCameraCurve;
  12012. int l1 = xCameraCurve;
  12013. for(int i2 = 0; i2 < 5; i2++)
  12014. if(aBooleanArray876[i2]) {
  12015. 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]);
  12016. if(i2 == 0)
  12017. xCameraPos += j2;
  12018. if(i2 == 1)
  12019. zCameraPos += j2;
  12020. if(i2 == 2)
  12021. yCameraPos += j2;
  12022. if(i2 == 3)
  12023. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  12024. if(i2 == 4) {
  12025. yCameraCurve += j2;
  12026. if(yCameraCurve < 128)
  12027. yCameraCurve = 128;
  12028. if(yCameraCurve > 383)
  12029. yCameraCurve = 383;
  12030. }
  12031. }
  12032. int k2 = Texture.anInt1481;
  12033. Model.aBoolean1684 = true;
  12034. Model.anInt1687 = 0;
  12035. Model.anInt1685 = super.mouseX - 4;
  12036. Model.anInt1686 = super.mouseY - 4;
  12037. DrawingArea.setAllPixelsToZero();
  12038. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  12039. worldController.clearObj5Cache();
  12040. updateEntities();
  12041. drawHeadIcon();
  12042. method37(k2);
  12043. draw3dScreen();
  12044. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  12045. xCameraPos = l;
  12046. zCameraPos = i1;
  12047. yCameraPos = j1;
  12048. yCameraCurve = k1;
  12049. xCameraCurve = l1;
  12050. }
  12051.  
  12052. public void clearTopInterfaces() {
  12053. stream.createFrame(130);
  12054. if (invOverlayInterfaceID != -1) {
  12055. invOverlayInterfaceID = -1;
  12056. needDrawTabArea = true;
  12057. aBoolean1149 = false;
  12058. tabAreaAltered = true;
  12059. }
  12060. if (backDialogID != -1) {
  12061. backDialogID = -1;
  12062. inputTaken = true;
  12063. aBoolean1149 = false;
  12064. }
  12065. openInterfaceID = -1;
  12066. fullscreenInterfaceID = -1;
  12067. }
  12068.  
  12069. public client() {
  12070. fullscreenInterfaceID = -1;
  12071. chatRights = new int[500];
  12072. chatTypeView = 0;
  12073. clanChatMode = 0;
  12074. cButtonHPos = -1;
  12075. cButtonHCPos = -1;
  12076. cButtonCPos = 0;
  12077. server = "127.0.0.1";
  12078. anIntArrayArray825 = new int[104][104];
  12079. friendsNodeIDs = new int[200];
  12080. groundArray = new NodeList[4][104][104];
  12081. aBoolean831 = false;
  12082. aStream_834 = new Stream(new byte[5000]);
  12083. npcArray = new NPC[16384];
  12084. npcIndices = new int[16384];
  12085. anIntArray840 = new int[1000];
  12086. aStream_847 = Stream.create();
  12087. aBoolean848 = true;
  12088. openInterfaceID = -1;
  12089. currentExp = new int[Skills.skillsCount];
  12090. aBoolean872 = false;
  12091. anIntArray873 = new int[5];
  12092. anInt874 = -1;
  12093. aBooleanArray876 = new boolean[5];
  12094. drawFlames = false;
  12095. reportAbuseInput = "";
  12096. unknownInt10 = -1;
  12097. menuOpen = false;
  12098. inputString = "";
  12099. maxPlayers = 2048;
  12100. myPlayerIndex = 2047;
  12101. playerArray = new Player[maxPlayers];
  12102. playerIndices = new int[maxPlayers];
  12103. anIntArray894 = new int[maxPlayers];
  12104. aStreamArray895s = new Stream[maxPlayers];
  12105. anInt897 = 1;
  12106. anIntArrayArray901 = new int[104][104];
  12107. anInt902 = 0x766654;
  12108. aByteArray912 = new byte[16384];
  12109. currentStats = new int[Skills.skillsCount];
  12110. ignoreListAsLongs = new long[100];
  12111. loadingError = false;
  12112. anInt927 = 0x332d25;
  12113. anIntArray928 = new int[5];
  12114. anIntArrayArray929 = new int[104][104];
  12115. chatTypes = new int[500];
  12116. chatNames = new String[500];
  12117. chatMessages = new String[500];
  12118. chatButtons = new Sprite[4];
  12119. sideIcons = new Sprite[15];
  12120. redStones = new Sprite[5];
  12121. aBoolean954 = true;
  12122. friendsListAsLongs = new long[200];
  12123. currentSong = -1;
  12124. drawingFlames = false;
  12125. spriteDrawX = -1;
  12126. spriteDrawY = -1;
  12127. anIntArray968 = new int[33];
  12128. anIntArray969 = new int[256];
  12129. decompressors = new Decompressor[5];
  12130. variousSettings = new int[2000];
  12131. aBoolean972 = false;
  12132. anInt975 = 50;
  12133. anIntArray976 = new int[anInt975];
  12134. anIntArray977 = new int[anInt975];
  12135. anIntArray978 = new int[anInt975];
  12136. anIntArray979 = new int[anInt975];
  12137. anIntArray980 = new int[anInt975];
  12138. anIntArray981 = new int[anInt975];
  12139. anIntArray982 = new int[anInt975];
  12140. aStringArray983 = new String[anInt975];
  12141. anInt985 = -1;
  12142. hitMarks = new Sprite[20];
  12143. anIntArray990 = new int[5];
  12144. aBoolean994 = false;
  12145. anInt1002 = 0x23201b;
  12146. amountOrNameInput = "";
  12147. aClass19_1013 = new NodeList();
  12148. aBoolean1017 = false;
  12149. anInt1018 = -1;
  12150. anIntArray1030 = new int[5];
  12151. aBoolean1031 = false;
  12152. mapFunctions = new Sprite[100];
  12153. dialogID = -1;
  12154. maxStats = new int[Skills.skillsCount];
  12155. anIntArray1045 = new int[2000];
  12156. aBoolean1047 = true;
  12157. anIntArray1052 = new int[151];
  12158. anInt1054 = -1;
  12159. aClass19_1056 = new NodeList();
  12160. anIntArray1057 = new int[33];
  12161. aClass9_1059 = new RSInterface();
  12162. mapScenes = new Background[100];
  12163. barFillColor = 0x4d4233;
  12164. anIntArray1065 = new int[7];
  12165. anIntArray1072 = new int[1000];
  12166. anIntArray1073 = new int[1000];
  12167. aBoolean1080 = false;
  12168. friendsList = new String[200];
  12169. inStream = Stream.create();
  12170. expectedCRCs = new int[9];
  12171. menuActionCmd2 = new int[500];
  12172. menuActionCmd3 = new int[500];
  12173. menuActionID = new int[500];
  12174. menuActionCmd1 = new int[500];
  12175. headIcons = new Sprite[20];
  12176. skullIcons = new Sprite[20];
  12177. headIconsHint = new Sprite[20];
  12178. tabAreaAltered = false;
  12179. aString1121 = "";
  12180. atPlayerActions = new String[5];
  12181. atPlayerArray = new boolean[5];
  12182. anIntArrayArrayArray1129 = new int[4][13][13];
  12183. anInt1132 = 2;
  12184. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  12185. aBoolean1141 = false;
  12186. aBoolean1149 = false;
  12187. crosses = new Sprite[8];
  12188. musicEnabled = true;
  12189. needDrawTabArea = false;
  12190. loggedIn = false;
  12191. canMute = false;
  12192. aBoolean1159 = false;
  12193. aBoolean1160 = false;
  12194. anInt1171 = 1;
  12195. myUsername = "";
  12196. myPassword = "";
  12197. genericLoadingError = false;
  12198. reportAbuseInterfaceID = -1;
  12199. aClass19_1179 = new NodeList();
  12200. anInt1184 = 128;
  12201. invOverlayInterfaceID = -1;
  12202. stream = Stream.create();
  12203. menuActionName = new String[500];
  12204. anIntArray1203 = new int[5];
  12205. anIntArray1207 = new int[50];
  12206. anInt1210 = 2;
  12207. anInt1211 = 78;
  12208. promptInput = "";
  12209. modIcons = new Background[2];
  12210. tabID = 3;
  12211. inputTaken = false;
  12212. songChanging = true;
  12213. anIntArray1229 = new int[151];
  12214. aClass11Array1230 = new Class11[4];
  12215. aBoolean1233 = false;
  12216. anIntArray1240 = new int[100];
  12217. anIntArray1241 = new int[50];
  12218. aBoolean1242 = false;
  12219. anIntArray1250 = new int[50];
  12220. rsAlreadyLoaded = false;
  12221. welcomeScreenRaised = false;
  12222. messagePromptRaised = false;
  12223. loginMessage1 = "";
  12224. loginMessage2 = "";
  12225. backDialogID = -1;
  12226. anInt1279 = 2;
  12227. bigX = new int[4000];
  12228. bigY = new int[4000];
  12229. anInt1289 = -1;
  12230. }
  12231.  
  12232. public int rights;
  12233. public String name;
  12234. public String message;
  12235. public String clanname;
  12236. private final int[] chatRights;
  12237. public int chatTypeView;
  12238. public int clanChatMode;
  12239. public int duelMode;
  12240. /* Declare custom sprites */
  12241. private Sprite chatArea;
  12242. private Sprite[] chatButtons;
  12243. private Sprite tabArea;
  12244. private Sprite mapArea;
  12245. /**/
  12246. private RSImageProducer leftFrame;
  12247. private RSImageProducer topFrame;
  12248. private RSImageProducer rightFrame;
  12249. private int ignoreCount;
  12250. private long aLong824;
  12251. private int[][] anIntArrayArray825;
  12252. private int[] friendsNodeIDs;
  12253. private NodeList[][][] groundArray;
  12254. private int[] anIntArray828;
  12255. private int[] anIntArray829;
  12256. private volatile boolean aBoolean831;
  12257. private Socket aSocket832;
  12258. private int loginScreenState;
  12259. private Stream aStream_834;
  12260. private NPC[] npcArray;
  12261. private int npcCount;
  12262. private int[] npcIndices;
  12263. private int anInt839;
  12264. private int[] anIntArray840;
  12265. private int anInt841;
  12266. private int anInt842;
  12267. private int anInt843;
  12268. private String aString844;
  12269. private int privateChatMode;
  12270. private Stream aStream_847;
  12271. private boolean aBoolean848;
  12272. private static int anInt849;
  12273. private int[] anIntArray850;
  12274. private int[] anIntArray851;
  12275. private int[] anIntArray852;
  12276. private int[] anIntArray853;
  12277. private static int anInt854;
  12278. private int anInt855;
  12279. private int openInterfaceID;
  12280. private int xCameraPos;
  12281. private int zCameraPos;
  12282. private int yCameraPos;
  12283. private int yCameraCurve;
  12284. private int xCameraCurve;
  12285. private int myPrivilege;
  12286. private final int[] currentExp;
  12287. private Sprite[] redStones;
  12288. private Sprite mapFlag;
  12289. private Sprite mapMarker;
  12290. private boolean aBoolean872;
  12291. private final int[] anIntArray873;
  12292. private int anInt874;
  12293. private final boolean[] aBooleanArray876;
  12294. private int weight;
  12295. private MouseDetection mouseDetection;
  12296. private volatile boolean drawFlames;
  12297. private String reportAbuseInput;
  12298. private int unknownInt10;
  12299. private boolean menuOpen;
  12300. private int anInt886;
  12301. private String inputString;
  12302. private final int maxPlayers;
  12303. private final int myPlayerIndex;
  12304. private Player[] playerArray;
  12305. private int playerCount;
  12306. private int[] playerIndices;
  12307. private int anInt893;
  12308. private int[] anIntArray894;
  12309. private Stream[] aStreamArray895s;
  12310. private int anInt896;
  12311. private int anInt897;
  12312. private int friendsCount;
  12313. private int anInt900;
  12314. private int[][] anIntArrayArray901;
  12315. private final int anInt902;
  12316. private byte[] aByteArray912;
  12317. private int anInt913;
  12318. private int crossX;
  12319. private int crossY;
  12320. private int crossIndex;
  12321. private int crossType;
  12322. private int plane;
  12323. private final int[] currentStats;
  12324. private static int anInt924;
  12325. private final long[] ignoreListAsLongs;
  12326. private boolean loadingError;
  12327. private final int anInt927;
  12328. private final int[] anIntArray928;
  12329. private int[][] anIntArrayArray929;
  12330. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  12331. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  12332. private int anInt933;
  12333. private int anInt934;
  12334. private int anInt935;
  12335. private int anInt936;
  12336. private int anInt937;
  12337. private int anInt938;
  12338. private static int anInt940;
  12339. private final int[] chatTypes;
  12340. private final String[] chatNames;
  12341. private final String[] chatMessages;
  12342. private int anInt945;
  12343. private WorldController worldController;
  12344. private Sprite[] sideIcons;
  12345. private int menuScreenArea;
  12346. private int menuOffsetX;
  12347. private int menuOffsetY;
  12348. private int menuWidth;
  12349. private int menuHeight;
  12350. private long aLong953;
  12351. private boolean aBoolean954;
  12352. private long[] friendsListAsLongs;
  12353. private String[] clanList = new String[100];
  12354. private int currentSong;
  12355. private static int nodeID = 10;
  12356. static int portOff;
  12357. static boolean clientData;
  12358. private static boolean isMembers = true;
  12359. private static boolean lowMem;
  12360. private volatile boolean drawingFlames;
  12361. private int spriteDrawX;
  12362. private int spriteDrawY;
  12363. private final int[] anIntArray965 = {
  12364. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  12365. };
  12366. private Background aBackground_966;
  12367. private Background aBackground_967;
  12368. private final int[] anIntArray968;
  12369. private final int[] anIntArray969;
  12370. final Decompressor[] decompressors;
  12371. public int variousSettings[];
  12372. private boolean aBoolean972;
  12373. private final int anInt975;
  12374. private final int[] anIntArray976;
  12375. private final int[] anIntArray977;
  12376. private final int[] anIntArray978;
  12377. private final int[] anIntArray979;
  12378. private final int[] anIntArray980;
  12379. private final int[] anIntArray981;
  12380. private final int[] anIntArray982;
  12381. private final String[] aStringArray983;
  12382. private int anInt984;
  12383. private int anInt985;
  12384. private static int anInt986;
  12385. private Sprite[] hitMarks;
  12386. private int anInt988;
  12387. private int anInt989;
  12388. private final int[] anIntArray990;
  12389. private static boolean aBoolean993;
  12390. private final boolean aBoolean994;
  12391. private int anInt995;
  12392. private int anInt996;
  12393. private int anInt997;
  12394. private int anInt998;
  12395. private int anInt999;
  12396. private ISAACRandomGen encryption;
  12397. private Sprite mapEdge;
  12398. private Sprite multiOverlay;
  12399. private final int anInt1002;
  12400. static final int[][] anIntArrayArray1003 = {
  12401. {
  12402. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  12403. 2983, 54193
  12404. }, {
  12405. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  12406. 56621, 4783, 1341, 16578, 35003, 25239
  12407. }, {
  12408. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  12409. 10153, 56621, 4783, 1341, 16578, 35003
  12410. }, {
  12411. 4626, 11146, 6439, 12, 4758, 10270
  12412. }, {
  12413. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  12414. }
  12415. };
  12416. private String amountOrNameInput;
  12417. private static int anInt1005;
  12418. private int daysSinceLastLogin;
  12419. private int pktSize;
  12420. private int pktType;
  12421. private int anInt1009;
  12422. private int anInt1010;
  12423. private int anInt1011;
  12424. private NodeList aClass19_1013;
  12425. private int anInt1014;
  12426. private int anInt1015;
  12427. private int anInt1016;
  12428. private boolean aBoolean1017;
  12429. private int anInt1018;
  12430. private static final int[] anIntArray1019;
  12431. private int anInt1021;
  12432. private int anInt1022;
  12433. private int loadingStage;
  12434. private Sprite scrollBar1;
  12435. private Sprite scrollBar2;
  12436. private int anInt1026;
  12437. private Background backBase1;
  12438. private Background backBase2;
  12439. private Background backHmid1;
  12440. private final int[] anIntArray1030;
  12441. private boolean aBoolean1031;
  12442. private Sprite[] mapFunctions;
  12443. private int baseX;
  12444. private int baseY;
  12445. private int anInt1036;
  12446. private int anInt1037;
  12447. private int loginFailures;
  12448. private int anInt1039;
  12449. private int anInt1040;
  12450. private int anInt1041;
  12451. private int dialogID;
  12452. private final int[] maxStats;
  12453. private final int[] anIntArray1045;
  12454. private int anInt1046;
  12455. private boolean aBoolean1047;
  12456. private int anInt1048;
  12457. private String aString1049;
  12458. private static int anInt1051;
  12459. private final int[] anIntArray1052;
  12460. private StreamLoader titleStreamLoader;
  12461. private int anInt1054;
  12462. private int anInt1055;
  12463. private NodeList aClass19_1056;
  12464. private final int[] anIntArray1057;
  12465. public final RSInterface aClass9_1059;
  12466. private Background[] mapScenes;
  12467. private static int anInt1061;
  12468. private int anInt1062;
  12469. private final int barFillColor;
  12470. private int friendsListAction;
  12471. private final int[] anIntArray1065;
  12472. private int mouseInvInterfaceIndex;
  12473. private int lastActiveInvInterface;
  12474. private OnDemandFetcher onDemandFetcher;
  12475. private int anInt1069;
  12476. private int anInt1070;
  12477. private int anInt1071;
  12478. private int[] anIntArray1072;
  12479. private int[] anIntArray1073;
  12480. private Sprite mapDotItem;
  12481. private Sprite mapDotNPC;
  12482. private Sprite mapDotPlayer;
  12483. private Sprite mapDotFriend;
  12484. private Sprite mapDotTeam;
  12485. private Sprite mapDotClan;
  12486. private int anInt1079;
  12487. private boolean aBoolean1080;
  12488. private String[] friendsList;
  12489. private Stream inStream;
  12490. private int anInt1084;
  12491. private int anInt1085;
  12492. private int activeInterfaceType;
  12493. private int anInt1087;
  12494. private int anInt1088;
  12495. public static int anInt1089;
  12496. private final int[] expectedCRCs;
  12497. private int[] menuActionCmd2;
  12498. private int[] menuActionCmd3;
  12499. private int[] menuActionID;
  12500. private int[] menuActionCmd1;
  12501. private Sprite[] headIcons;
  12502. private Sprite[] skullIcons;
  12503. private Sprite[] headIconsHint;
  12504. private static int anInt1097;
  12505. private int anInt1098;
  12506. private int anInt1099;
  12507. private int anInt1100;
  12508. private int anInt1101;
  12509. private int anInt1102;
  12510. private static boolean tabAreaAltered;
  12511. private int anInt1104;
  12512. private RSImageProducer aRSImageProducer_1107;
  12513. private RSImageProducer aRSImageProducer_1108;
  12514. private RSImageProducer aRSImageProducer_1109;
  12515. private RSImageProducer aRSImageProducer_1110;
  12516. private RSImageProducer aRSImageProducer_1111;
  12517. private RSImageProducer aRSImageProducer_1112;
  12518. private RSImageProducer aRSImageProducer_1113;
  12519. private RSImageProducer aRSImageProducer_1114;
  12520. private RSImageProducer aRSImageProducer_1115;
  12521. private static int anInt1117;
  12522. private int membersInt;
  12523. private String aString1121;
  12524. private Sprite compass;
  12525. private RSImageProducer aRSImageProducer_1123;
  12526. private RSImageProducer aRSImageProducer_1124;
  12527. private RSImageProducer aRSImageProducer_1125;
  12528. public static Player myPlayer;
  12529. private final String[] atPlayerActions;
  12530. private final boolean[] atPlayerArray;
  12531. private final int[][][] anIntArrayArrayArray1129;
  12532. private final int[] tabInterfaceIDs = {
  12533. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  12534. -1, -1, -1, -1, -1
  12535. };
  12536. private int anInt1131;
  12537. private int anInt1132;
  12538. private int menuActionRow;
  12539. private static int anInt1134;
  12540. private int spellSelected;
  12541. private int anInt1137;
  12542. private int spellUsableOn;
  12543. private String spellTooltip;
  12544. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  12545. private boolean aBoolean1141;
  12546. private static int anInt1142;
  12547. private int energy;
  12548. private boolean aBoolean1149;
  12549. private Sprite[] crosses;
  12550. private boolean musicEnabled;
  12551. private Background[] aBackgroundArray1152s;
  12552. private static boolean needDrawTabArea;
  12553. private int unreadMessages;
  12554. private static int anInt1155;
  12555. private static boolean fpsOn;
  12556. public boolean loggedIn;
  12557. private boolean canMute;
  12558. private boolean aBoolean1159;
  12559. private boolean aBoolean1160;
  12560. static int loopCycle;
  12561. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  12562. private RSImageProducer aRSImageProducer_1163;
  12563. private RSImageProducer mapEdgeIP;
  12564. private RSImageProducer aRSImageProducer_1164;
  12565. private RSImageProducer aRSImageProducer_1165;
  12566. private RSImageProducer aRSImageProducer_1166;
  12567. private int daysSinceRecovChange;
  12568. private RSSocket socketStream;
  12569. private int anInt1169;
  12570. private int minimapInt3;
  12571. private int anInt1171;
  12572. private long aLong1172;
  12573. private String myUsername;
  12574. private String myPassword;
  12575. private static int anInt1175;
  12576. private boolean genericLoadingError;
  12577. private final int[] anIntArray1177 = {
  12578. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  12579. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  12580. 2, 2, 3
  12581. };
  12582. private int reportAbuseInterfaceID;
  12583. private NodeList aClass19_1179;
  12584. private int[] anIntArray1180;
  12585. private int[] anIntArray1181;
  12586. private int[] anIntArray1182;
  12587. private byte[][] aByteArrayArray1183;
  12588. private int anInt1184;
  12589. private int minimapInt1;
  12590. private int anInt1186;
  12591. private int anInt1187;
  12592. private static int anInt1188;
  12593. private int invOverlayInterfaceID;
  12594. private int[] anIntArray1190;
  12595. private int[] anIntArray1191;
  12596. private Stream stream;
  12597. private int anInt1193;
  12598. private int splitPrivateChat;
  12599. private Background mapBack;
  12600. private String[] menuActionName;
  12601. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  12602. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  12603. private final int[] anIntArray1203;
  12604. static final int[] anIntArray1204 = {
  12605. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  12606. 58654, 5027, 1457, 16565, 34991, 25486
  12607. };
  12608. private static boolean flagged;
  12609. private final int[] anIntArray1207;
  12610. private int anInt1208;
  12611. private int minimapInt2;
  12612. private int anInt1210;
  12613. private int anInt1211;
  12614. private String promptInput;
  12615. private int anInt1213;
  12616. private int[][][] intGroundArray;
  12617. private long aLong1215;
  12618. private int loginScreenCursorPos;
  12619. private final Background[] modIcons;
  12620. private long aLong1220;
  12621. private static int tabID;
  12622. private int anInt1222;
  12623. public static boolean inputTaken;
  12624. private int inputDialogState;
  12625. private static int anInt1226;
  12626. private int nextSong;
  12627. private boolean songChanging;
  12628. private final int[] anIntArray1229;
  12629. private Class11[] aClass11Array1230;
  12630. public static int anIntArray1232[];
  12631. private boolean aBoolean1233;
  12632. private int[] anIntArray1234;
  12633. private int[] anIntArray1235;
  12634. private int[] anIntArray1236;
  12635. private int anInt1237;
  12636. private int anInt1238;
  12637. public final int anInt1239 = 100;
  12638. private final int[] anIntArray1240;
  12639. private final int[] anIntArray1241;
  12640. private boolean aBoolean1242;
  12641. private int atInventoryLoopCycle;
  12642. private int atInventoryInterface;
  12643. private int atInventoryIndex;
  12644. private int atInventoryInterfaceType;
  12645. private byte[][] aByteArrayArray1247;
  12646. private int tradeMode;
  12647. private int anInt1249;
  12648. private final int[] anIntArray1250;
  12649. private int anInt1251;
  12650. private final boolean rsAlreadyLoaded;
  12651. private int anInt1253;
  12652. private int anInt1254;
  12653. private boolean welcomeScreenRaised;
  12654. private boolean messagePromptRaised;
  12655. private int anInt1257;
  12656. private byte[][][] byteGroundArray;
  12657. private int prevSong;
  12658. private int destX;
  12659. private int destY;
  12660. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  12661. private int anInt1264;
  12662. private int anInt1265;
  12663. private String loginMessage1;
  12664. private String loginMessage2;
  12665. private int anInt1268;
  12666. private int anInt1269;
  12667. private TextDrawingArea smallText;
  12668. private TextDrawingArea aTextDrawingArea_1271;
  12669. private TextDrawingArea chatTextDrawingArea;
  12670. private int anInt1275;
  12671. private int backDialogID;
  12672. private int anInt1278;
  12673. private int anInt1279;
  12674. private int[] bigX;
  12675. private int[] bigY;
  12676. private int itemSelected;
  12677. private int anInt1283;
  12678. private int anInt1284;
  12679. private int anInt1285;
  12680. private String selectedItemName;
  12681. private int publicChatMode;
  12682. private static int anInt1288;
  12683. private int anInt1289;
  12684. public static int anInt1290;
  12685. public static String server = "";
  12686. public int drawCount;
  12687. public int fullscreenInterfaceID;
  12688. public int anInt1044;//377
  12689. public int anInt1129;//377
  12690. public int anInt1315;//377
  12691. public int anInt1500;//377
  12692. public int anInt1501;//377
  12693. public int[] fullScreenTextureArray;
  12694. public void resetAllImageProducers() {
  12695. if (super.fullGameScreen != null) {
  12696. return;
  12697. }
  12698. aRSImageProducer_1166 = null;
  12699. aRSImageProducer_1164 = null;
  12700. aRSImageProducer_1163 = null;
  12701. aRSImageProducer_1165 = null;
  12702. aRSImageProducer_1123 = null;
  12703. aRSImageProducer_1124 = null;
  12704. aRSImageProducer_1125 = null;
  12705. aRSImageProducer_1107 = null;
  12706. aRSImageProducer_1108 = null;
  12707. aRSImageProducer_1109 = null;
  12708. aRSImageProducer_1110 = null;
  12709. aRSImageProducer_1111 = null;
  12710. aRSImageProducer_1112 = null;
  12711. aRSImageProducer_1113 = null;
  12712. aRSImageProducer_1114 = null;
  12713. aRSImageProducer_1115 = null;
  12714. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  12715. welcomeScreenRaised = true;
  12716. }
  12717.  
  12718.  
  12719. public void launchURL(String url) {
  12720. String osName = System.getProperty("os.name");
  12721. try {
  12722. if (osName.startsWith("Mac OS")) {
  12723. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  12724. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
  12725. openURL.invoke(null, new Object[] {url});
  12726. } else if (osName.startsWith("Windows"))
  12727. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  12728. else { //assume Unix or Linux
  12729. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  12730. String browser = null;
  12731. for (int count = 0; count < browsers.length && browser == null; count++)
  12732. if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
  12733. browser = browsers[count];
  12734. if (browser == null) {
  12735. throw new Exception("Could not find web browser");
  12736. } else
  12737. Runtime.getRuntime().exec(new String[] {browser, url});
  12738. }
  12739. } catch (Exception e) {
  12740. pushMessage("Failed to open URL.", 0, "");
  12741. }
  12742. }
  12743.  
  12744. static {
  12745. anIntArray1019 = new int[99];
  12746. int i = 0;
  12747. for(int j = 0; j < 99; j++) {
  12748. int l = j + 1;
  12749. int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  12750. i += i1;
  12751. anIntArray1019[j] = i / 4;
  12752. }
  12753. anIntArray1232 = new int[32];
  12754. i = 2;
  12755. for(int k = 0; k < 32; k++) {
  12756. anIntArray1232[k] = i - 1;
  12757. i += i;
  12758. }
  12759. }
  12760. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement