Advertisement
Guest User

Untitled

a guest
Feb 18th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 409.59 KB | None | 0 0
  1. // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.kpdus.com/jad.html
  3. // Decompiler options: packimports(3)
  4.  
  5. import java.applet.AppletContext;
  6. import java.awt.*;
  7. import java.io.*;
  8. import java.math.BigInteger;
  9. import java.net.*;
  10. import java.util.zip.CRC32;
  11. import java.lang.reflect.Method;
  12. import sign.signlink;
  13. import javax.swing.*;
  14.  
  15. public class client extends RSApplet {
  16. public final String titleColor(final int i, int type) {
  17. String titleChatbox = "", titleRightclick = "";
  18. switch (i) {
  19.  
  20. case 0: //blue
  21. titleChatbox = "255";
  22. titleRightclick = "blu";
  23. break;
  24.  
  25. case 1: //purple
  26. titleChatbox = "11158698";
  27. titleRightclick = "put";
  28. break;
  29.  
  30. case 2: //red
  31. titleChatbox = "12656646";
  32. titleRightclick = "red";
  33. break;
  34.  
  35. case 3: //green
  36. titleChatbox = "26112";
  37. titleRightclick = "gre";
  38. break;
  39. case 4: //yel
  40. titleChatbox = "16776960";
  41. titleRightclick = "yel";
  42. break;
  43. case 5: //orange
  44. titleChatbox = "16495872";
  45. titleRightclick = "ort";
  46. break;
  47. }
  48. if(type == 0)
  49. return titleChatbox;
  50. else
  51. return titleRightclick;
  52. }
  53.  
  54. public int MapX, MapY;
  55. public static int spellID = 0;
  56. public static boolean newDamage = false;
  57.  
  58. private static String intToKOrMilLongName(int i) {
  59. String s = String.valueOf(i);
  60. for(int k = s.length() - 3; k > 0; k -= 3)
  61. s = s.substring(0, k) + "," + s.substring(k);
  62.  
  63. //if(j != 0)
  64. // aBoolean1224 = !aBoolean1224;
  65. if(s.length() > 8)
  66. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  67. else
  68. if(s.length() > 4)
  69. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  70. return " " + s;
  71. }
  72. public final String methodR(/*int i,*/ int j)
  73. {
  74. //if(i <= 0)
  75. // pktType = inStream.readUnsignedByte();
  76. if(j >= 0 && j < 10000)
  77. return String.valueOf(j);
  78. if(j >= 10000 && j < 10000000)
  79. return j / 1000 + "K";
  80. if(j >= 10000000 && j < 999999999)
  81. return j / 1000000 + "M";
  82. if(j >= 999999999)
  83. return "*";
  84. else
  85. return "?";
  86. }
  87. public void loadExtraSprites() {
  88. for(int k = 1; k <= 15; k++)
  89. ORBS[k] = new Sprite((new StringBuilder()).append("Frame/ORBS ").append(k).append("").toString());
  90. }
  91. public void drawWorldMapButton()
  92. {
  93. worldMapIcon.drawSprite(8, 124);
  94. }
  95. private void rightClickMapArea()
  96. {
  97. if(super.clickMode3 == 1)
  98. {
  99. if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23 && tabInterfaceIDs[7] != -1)
  100. {
  101. menuActionName[1] = "Logout";
  102. menuActionID[1] = 1004;
  103. menuActionRow = 2;
  104. logC = true;
  105. drawMinimap();
  106. }
  107. } else
  108. if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23 && tabInterfaceIDs[7] != -1)
  109. {
  110. menuActionName[1] = "Logout";
  111. menuActionID[1] = 1004;
  112. menuActionRow = 2;
  113. logH = true;
  114. logHover = 1;
  115. drawMinimap();
  116. } else
  117. if(super.mouseX > 713 && super.mouseX < 765 && super.mouseY > 83 && super.mouseY < 118)
  118. {
  119. menuActionName[1] = "Run";
  120. menuActionID[1] = 1051;
  121. menuActionRow = 2;
  122. } else
  123. {
  124. logH = false;
  125. logHover = 0;
  126. drawMinimap();
  127. }
  128. }
  129. private int logHover = 0;
  130.  
  131. public static final byte[] ReadFile(String s) {
  132. try {
  133. byte abyte0[];
  134. File file = new File(s);
  135. int i = (int)file.length();
  136. abyte0 = new byte[i];
  137. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  138. datainputstream.readFully(abyte0, 0, i);
  139. datainputstream.close();
  140. return abyte0;
  141. } catch(Exception e) {
  142. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  143. return null;
  144. }
  145. }
  146.  
  147. public void models() {
  148. for(int ModelIndex = 0; ModelIndex < 29191; ModelIndex++) {
  149. byte[] abyte0 = getModel(ModelIndex);
  150. if(abyte0 != null && abyte0.length > 0) {
  151. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  152. pushMessage("Model added successfully!", 0, "");
  153. }
  154. }
  155. }
  156. public byte[] getModel(int Index) {
  157. try {
  158. File Model = new File("./model/"+Index+".gz");
  159. byte[] aByte = new byte[(int)Model.length()];
  160. FileInputStream fis = new FileInputStream(Model);
  161. fis.read(aByte);
  162. pushMessage("aByte = ["+aByte+"]!", 0, "");
  163. fis.close();
  164. return aByte;
  165. }
  166. catch(Exception e)
  167. {return null;}
  168. }
  169.  
  170. private void stopMidi() {
  171. signlink.midifade = 0;
  172. signlink.midi = "stop";
  173. }
  174. private boolean menuHasAddFriend(int j) {
  175. if(j < 0)
  176. return false;
  177. int k = menuActionID[j];
  178. if(k >= 2000)
  179. k -= 2000;
  180. return k == 337;
  181. }
  182.  
  183. public void drawChannelButtons() {
  184. String text[] = {
  185. "On", "Friends", "Off", "Hide"
  186. };
  187. int disabledColor[] = {
  188. 65280, 0xffff00, 0xff0000, 65535
  189. };
  190. switch (cButtonCPos) {
  191. case 0:
  192. chatButtons[1].drawSprite(5, 144);
  193. break;
  194. case 1:
  195. chatButtons[1].drawSprite(62, 144);
  196. break;
  197. case 2:
  198. chatButtons[1].drawSprite(119, 144);
  199. break;
  200. case 3:
  201. chatButtons[1].drawSprite(176, 144);
  202. break;
  203. case 4:
  204. chatButtons[1].drawSprite(233, 144);
  205. break;
  206. case 5:
  207. chatButtons[1].drawSprite(290, 144);
  208. break;
  209. case 6:
  210. chatButtons[1].drawSprite(347, 144);
  211. break;
  212. }
  213. if (cButtonHPos == cButtonCPos) {
  214. switch (cButtonHPos) {
  215. case 0:
  216. chatButtons[2].drawSprite(5, 144);
  217. break;
  218. case 1:
  219. chatButtons[2].drawSprite(62, 144);
  220. break;
  221. case 2:
  222. chatButtons[2].drawSprite(119, 144);
  223. break;
  224. case 3:
  225. chatButtons[2].drawSprite(176, 144);
  226. break;
  227. case 4:
  228. chatButtons[2].drawSprite(233, 144);
  229. break;
  230. case 5:
  231. chatButtons[2].drawSprite(290, 144);
  232. break;
  233. case 7:
  234. chatButtons[2].drawSprite(347, 144);
  235. break;
  236. case 6:
  237. chatButtons[3].drawSprite(404, 144);
  238. break;
  239. }
  240. } else {
  241. switch (cButtonHPos) {
  242. case 0:
  243. chatButtons[2].drawSprite(5, 144);
  244. break;
  245. case 1:
  246. chatButtons[2].drawSprite(62, 144);
  247. break;
  248. case 2:
  249. chatButtons[2].drawSprite(119, 144);
  250. break;
  251. case 3:
  252. chatButtons[2].drawSprite(176, 144);
  253. break;
  254. case 4:
  255. chatButtons[2].drawSprite(233, 144);
  256. break;
  257. case 5:
  258. chatButtons[2].drawSprite(290, 144);
  259. break;
  260. case 7:
  261. chatButtons[2].drawSprite(347, 144);
  262. break;
  263. case 6:
  264. chatButtons[3].drawSprite(404, 144);
  265. break;
  266. }
  267. }
  268. smallText.method389(true, 425, 0xffffff, "Report Abuse", 158);
  269. smallText.method389(true, 26, 0xffffff, "All", 158);
  270. smallText.method389(true, 76, 0xffffff, "Game", 158);
  271. smallText.method389(true, 131, 0xffffff, "Public", 154);
  272. smallText.method389(true, 184, 0xffffff, "Private", 154);
  273. smallText.method389(true, 249, 0xffffff, "Clan", 154);
  274. smallText.method389(true, 304, 0xffffff, "Trade", 154);
  275. smallText.method389(true, 359, 0xffffff, " Duel", 154);
  276. smallText.method382(disabledColor[publicChatMode], 147, text[publicChatMode], 165, true);
  277. smallText.method382(disabledColor[privateChatMode], 203, text[privateChatMode], 165, true);
  278. smallText.method382(disabledColor[clanChatMode], 261, text[clanChatMode], 165, true);
  279. smallText.method382(disabledColor[tradeMode], 318, text[tradeMode], 165, true);
  280. smallText.method382(65280, 374, "On", 165, true);
  281. }
  282.  
  283. /*private void drawChatArea() {
  284. aRSImageProducer_1166.initDrawingArea();
  285. Texture.anIntArray1472 = anIntArray1180;
  286. chatArea.drawSprite(0, 0);
  287. drawChannelButtons();
  288. FontSystem textDrawingArea = regularText;
  289. if(messagePromptRaised) {
  290. //chatTextDrawingArea.drawText(0, aString1121, 60, 259);
  291. //chatTextDrawingArea.drawText(128, promptInput + "*", 80, 259);
  292.  
  293. boldText.drawCenteredString(aString1121, 259, 60, 0, -1);
  294. boldText.drawCenteredString( promptInput + "*", 259, 80, 128, -1);
  295. } else if(inputDialogState == 1) {
  296. //chatTextDrawingArea.drawText(0, "Enter amount:", 60, 259);
  297. //chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  298.  
  299. boldText.drawCenteredString("Enter amount:", 259, 60, 0, -1);
  300. boldText.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
  301. } else if(inputDialogState == 2) {
  302. //chatTextDrawingArea.drawText(0, "Enter name:", 60, 259);
  303. //chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  304.  
  305. boldText.drawCenteredString("Enter name:", 259, 60, 0, -1);
  306. boldText.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
  307. } else if(aString844 != null) {
  308. //chatTextDrawingArea.drawText(0, aString844, 60, 259);
  309. //chatTextDrawingArea.drawText(128, "Click to continue", 80, 259);
  310.  
  311. boldText.drawCenteredString(aString844, 259, 60, 0, -1);
  312. boldText.drawCenteredString("Click to continue", 259, 80, 128, -1);
  313. } else if(backDialogID != -1) {
  314. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  315. } else if(dialogID != -1) {
  316. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  317. } else {
  318. int j77 = -3;
  319. int j = 0;
  320. DrawingArea.setDrawingArea(122, 8, 497, 7);
  321. for(int k = 0; k < 500; k++)
  322. if(chatMessages[k] != null) {
  323. int chatType = chatTypes[k];
  324. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  325. String s1 = chatNames[k];
  326. byte byte0 = 0;
  327. if(s1 != null && s1.startsWith("@cr1@")) {
  328. s1 = s1.substring(5);
  329. byte0 = 1;
  330. } else if(s1 != null && s1.startsWith("@cr2@")) {
  331. s1 = s1.substring(5);
  332. byte0 = 2;
  333. } else if(s1 != null && s1.startsWith("@cr3@")) {
  334. s1 = s1.substring(5);
  335. byte0 = 3;
  336. } else if(s1 != null && s1.startsWith("@cr4@")) {
  337. s1 = s1.substring(5);
  338. byte0 = 4;
  339. } else if(s1 != null && s1.startsWith("@cr5@")) {
  340. s1 = s1.substring(5);
  341. byte0 = 5;
  342. } else if(s1 != null && s1.startsWith("@cr6@")) {
  343. s1 = s1.substring(5);
  344. byte0 = 6;
  345. } else if(s1 != null && s1.startsWith("@cr7@")) {
  346. s1 = s1.substring(5);
  347. byte0 = 7;
  348. }
  349. if(chatType == 0) {
  350. if (chatTypeView == 5 || chatTypeView == 0) {
  351. if(yPos > 0 && yPos < 210)
  352. //textDrawingArea.method389(false, 11, 0, chatMessages[k], yPos);//chat color enabled
  353. newRegularFont.drawBasicString(chatMessages[k], 11, yPos, 0, -1);
  354. j++;
  355. j77++;
  356. }
  357. }
  358. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  359. if (chatTypeView == 1 || chatTypeView == 0) {
  360. if(yPos > 0 && yPos < 210) {
  361. int xPos = 11;
  362. if(byte0 == 1) {
  363. modIcons[0].drawSprite(xPos + 1, yPos - 12);
  364. xPos += 14;
  365. } else if(byte0 == 2) {
  366. modIcons[1].drawSprite(xPos + 1, yPos - 12);
  367. xPos += 14;
  368. } else if(byte0 == 3) {
  369. modIcons[2].drawSprite(xPos + 1, yPos - 12);
  370. xPos += 14;
  371. } else if(byte0 == 4) {
  372. modIcons[3].drawSprite(xPos + 1, yPos - 12);
  373. xPos += 14;
  374. } else if(byte0 == 5) {
  375. modIcons[4].drawSprite(xPos + 1, yPos - 12);
  376. xPos += 14;
  377. } else if(byte0 == 6) {
  378. modIcons[5].drawSprite(xPos + 1, yPos - 12);
  379. xPos += 14;
  380. } else if(byte0 == 7) {
  381. modIcons[6].drawSprite(xPos + 1, yPos - 12);
  382. xPos += 14;
  383. }
  384. //textDrawingArea.method385(0, s1 + ":", yPos, xPos);
  385. //xPos += textDrawingArea.getTextWidth(s1) + 8;
  386. //textDrawingArea.method389(false, xPos, 255, chatMessages[k], yPos);
  387.  
  388. newRegularFont.drawBasicString(s1 + ":", xPos, yPos, 0, -1);
  389. xPos += newRegularFont.getTextWidth(s1) + 8;
  390. newRegularFont.drawBasicString(chatMessages[k], xPos, yPos, 255, -1);
  391. }
  392. j++;
  393. j77++;
  394. }
  395. }
  396. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  397. if (chatTypeView == 2 || chatTypeView == 0) {
  398. if(yPos > 0 && yPos < 210) {
  399. int k1 = 11;
  400. //textDrawingArea.method385(0, "From", yPos, k1);
  401. //k1 += textDrawingArea.getTextWidth("From ");
  402.  
  403. newRegularFont.drawBasicString("From", k1, yPos, 0, -1);
  404. k1 += newRegularFont.getTextWidth("From ");
  405. if(byte0 == 1) {
  406. modIcons[0].drawSprite(k1, yPos - 12);
  407. k1 += 12;
  408. } else if(byte0 == 2) {
  409. modIcons[1].drawSprite(k1, yPos - 12);
  410. k1 += 12;
  411. } else if(byte0 == 3) {
  412. modIcons[2].drawSprite(k1, yPos - 12);
  413. k1 += 12;
  414. } else if(byte0 == 4) {
  415. modIcons[3].drawSprite(k1, yPos - 12);
  416. k1 += 12;
  417. } else if(byte0 == 5) {
  418. modIcons[4].drawSprite(k1, yPos - 12);
  419. k1 += 12;
  420. } else if(byte0 == 6) {
  421. modIcons[5].drawSprite(k1, yPos - 12);
  422. k1 += 12;
  423. } else if(byte0 == 7) {
  424. modIcons[6].drawSprite(k1, yPos - 12);
  425. k1 += 12;
  426.  
  427. }
  428. //textDrawingArea.method385(0, s1 + ":", yPos, k1);
  429. //k1 += textDrawingArea.getTextWidth(s1) + 8;
  430. //textDrawingArea.method385(0x800000, chatMessages[k], yPos, k1);
  431.  
  432. newRegularFont.drawBasicString(s1 + ":", k1, yPos, 0, -1);
  433. k1 += newRegularFont.getTextWidth(s1) + 8;
  434. newRegularFont.drawBasicString(chatMessages[k], k1, yPos, 0x800000, -1);
  435. }
  436. j++;
  437. j77++;
  438. }
  439. }
  440. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  441. if (chatTypeView == 3 || chatTypeView == 0) {
  442. if(yPos > 0 && yPos < 210)
  443. //textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], yPos, 11);
  444. newRegularFont.drawBasicString( s1 + " " + chatMessages[k], 11, yPos, 0x800080, -1);
  445. j++;
  446. j77++;
  447. }
  448. }
  449. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  450. if (chatTypeView == 2 || chatTypeView == 0) {
  451. if(yPos > 0 && yPos < 210)
  452. //textDrawingArea.method385(0x800000, chatMessages[k], yPos, 11);
  453. newRegularFont.drawBasicString(chatMessages[k], 11, yPos, 0x800000, -1);
  454. j++;
  455. j77++;
  456. }
  457. }
  458. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  459. if (chatTypeView == 2 || chatTypeView == 0) {
  460. if(yPos > 0 && yPos < 210) {
  461. //textDrawingArea.method385(0, "To " + s1 + ":", yPos, 11);
  462. //textDrawingArea.method385(0x800000, chatMessages[k], yPos, 15 + textDrawingArea.getTextWidth("To :" + s1));
  463.  
  464. newRegularFont.drawBasicString("To " + s1 + ":", 11, yPos, 0, -1);
  465. newRegularFont.drawBasicString(chatMessages[k], 15 + newRegularFont.getTextWidth("To :" + s1), yPos, 0x800000, -1);
  466. }
  467. j++;
  468. j77++;
  469. }
  470. }
  471. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  472. if (chatTypeView == 3 || chatTypeView == 0) {
  473. if(yPos > 0 && yPos < 210)
  474. //textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  475. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  476. j++;
  477. j77++;
  478. }
  479. if(chatType == 11 && (clanChatMode == 0)) {
  480. if (chatTypeView == 11) {
  481. if(yPos > 0 && yPos < 210)
  482. // textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  483. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  484. j++;
  485. j77++;
  486. }
  487. if(chatType == 12) {
  488. if(yPos > 0 && yPos < 110)
  489. newRegularFont.drawBasicString(chatMessages[k] + " <col=255>" + s1, 11, yPos, 0x7e3200, -1);
  490. //textDrawingArea.method385(0x7e3200, chatMessages[k] + " @blu@" + s1, yPos, 11);
  491. j++;
  492. }
  493. if(chatType == 16) {
  494. int j2 = 40;
  495. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  496. if(chatTypeView == 11 || chatTypeView == 0) {
  497. if(yPos > 3 && yPos < 130)
  498. switch(chatRights[k]) {
  499. case 1:
  500. case 2:
  501. case 3:
  502. case 4:
  503. case 5:
  504. case 6:
  505. case 7:
  506. j2 += clanNameWidth;
  507. modIcons[chatRights[k] - 1].drawSprite(j2 - 18, yPos - 12);
  508. j2 += 14;
  509. break;
  510.  
  511. default:
  512. j2 += clanNameWidth;
  513. break;
  514. }//string int int int int
  515. //newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  516. newRegularFont.drawBasicString("[", 8, yPos, 0, -1);//0, "[", yPos, 8);
  517. newRegularFont.drawBasicString(clanname, 14, yPos, 255, -1);//255, ""+clanname+"", yPos, 14);
  518. newRegularFont.drawBasicString("]", clanNameWidth + 14, yPos, 0, -1);//0, "]", yPos, clanNameWidth + 14);
  519.  
  520. newRegularFont.drawBasicString(chatNames[k]+":", j2-17, yPos, 0, -1);//0, chatNames[k]+":", yPos, j2 - 17); //j2
  521. j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
  522. newRegularFont.drawBasicString(chatMessages[k], j2 - 16, yPos, 0x800000, -1);//0x800000, chatMessages[k], yPos, j2 - 16);//j2
  523. j++;
  524. j77++;
  525. }
  526. }
  527. }
  528. }
  529. }
  530. DrawingArea.defaultDrawingAreaSize();
  531. anInt1211 = j * 14 + 7 + 5;
  532. if(anInt1211 < 111)
  533. anInt1211 = 111;
  534. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  535. String s;
  536. if(myPlayer != null && myPlayer.name != null)
  537. s = myPlayer.name;
  538. else
  539. s = TextClass.fixName(myUsername);
  540. //textDrawingArea.method385(0, s + ":", 133, 11);
  541. newRegularFont.drawBasicString(s + ":",11,133,0,-1);
  542. //textDrawingArea.drawChatInput(255, 12 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false); //original star
  543. //textDrawingArea.method389(false, 12 + textDrawingArea.getTextWidth(s + ": "), 255, inputString + ((loopCycle % 40 < 20) ? "@bla@|" : ""), 133); //flashing
  544. newRegularFont.drawBasicString(inputString + ((loopCycle % 40 < 20) ? "|" : ""), 12 + textDrawingArea.getTextWidth(s + ": "),133,255,-1);
  545. DrawingArea.method339(121, 0x807660, 506, 7);
  546. }
  547. if(menuOpen && menuScreenArea == 2) {
  548. drawMenu();
  549. }
  550. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  551. aRSImageProducer_1165.initDrawingArea();
  552. Texture.anIntArray1472 = anIntArray1182;
  553. }*/
  554.  
  555. private void drawChatArea() {
  556. aRSImageProducer_1166.initDrawingArea();
  557. Texture.anIntArray1472 = anIntArray1180;
  558. chatArea.drawSprite(0, 0);
  559. drawChannelButtons();
  560. FontSystem textDrawingArea = regularText;
  561. if(messagePromptRaised) {
  562. regularText.drawCenteredString(aString1121, 259, 60, 0, -1);
  563. //chatTextDrawingArea.drawText(0, aString1121, 60, 259);
  564. regularText.drawCenteredString(promptInput + "*", 259, 80, 128, -1);
  565. //chatTextDrawingArea.drawText(128, promptInput + "*", 80, 259);
  566. } else if(inputDialogState == 1) {
  567. regularText.drawCenteredString("Enter amount:", 259, 60, 0, -1);
  568. //chatTextDrawingArea.drawText(0, "Enter amount:", 60, 259);
  569. regularText.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
  570. //chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  571. } else if(inputDialogState == 2) {
  572. regularText.drawCenteredString("Enter name:", 259, 60, 0, -1);
  573. //chatTextDrawingArea.drawText(0, "Enter name:", 60, 259);
  574. regularText.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
  575. //chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  576. } else if(aString844 != null) {
  577. regularText.drawCenteredString(aString844, 259, 60, 0, -1);
  578. //chatTextDrawingArea.drawText(0, aString844, 60, 259);
  579. regularText.drawCenteredString("Click to continue", 259, 80, 128, -1);
  580. //chatTextDrawingArea.drawText(128, "Click to continue", 80, 259);
  581. } else if(backDialogID != -1) {
  582. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  583. } else if(dialogID != -1) {
  584. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  585. } else {
  586. int j77 = -3;
  587. int j = 0;
  588. DrawingArea.setDrawingArea(122, 8, 497, 7);
  589. for(int k = 0; k < 500; k++)
  590. if(chatMessages[k] != null) {
  591. int chatType = chatTypes[k];
  592. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  593. String s1 = chatNames[k];
  594. byte byte0 = 0;
  595.  
  596. if(s1 != null && s1.startsWith("@cr1@")) {
  597. s1 = s1.substring(5);
  598. byte0 = 1;
  599. } else if(s1 != null && s1.startsWith("@cr2@")) {
  600. s1 = s1.substring(5);
  601. byte0 = 2;
  602. } else if(s1 != null && s1.startsWith("@cr3@")) {
  603. s1 = s1.substring(5);
  604. byte0 = 3;
  605. } else if(s1 != null && s1.startsWith("@cr4@")) {
  606. s1 = s1.substring(5);
  607. byte0 = 4;
  608. } else if(s1 != null && s1.startsWith("@cr5@")) {
  609. s1 = s1.substring(5);
  610. byte0 = 5;
  611. } else if(s1 != null && s1.startsWith("@cr6@")) {
  612. s1 = s1.substring(5);
  613. byte0 = 6;
  614. } else if(s1 != null && s1.startsWith("@cr7@")) {
  615. s1 = s1.substring(5);
  616. byte0 = 7;
  617. }
  618.  
  619. if(chatType == 0) {
  620. if (chatTypeView == 5 || chatTypeView == 0) {
  621. if(yPos > 0 && yPos < 210)
  622. regularText.drawBasicString(chatMessages[k], 11, yPos, 0, -1);
  623. //textDrawingArea.method389(false, 11, 0, chatMessages[k], yPos);//chat color enabled
  624. j++;
  625. j77++;
  626. }
  627. }
  628. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  629. if (chatTypeView == 1 || chatTypeView == 0) {
  630. if(yPos > 0 && yPos < 210) {
  631. int xPos = 11;
  632. if (byte0 >= 1) {
  633. modIcons[byte0 - 1].drawSprite(xPos + 1, yPos - 12);
  634. xPos += 14;
  635. }
  636. regularText.drawBasicString(s1 + ":", xPos, yPos, 0, -1);
  637. //textDrawingArea.method385(0, s1 + ":", yPos, xPos);
  638. xPos += regularText.getTextWidth(s1) + 8;
  639. //xPos += textDrawingArea.getTextWidth(s1) + 8;
  640. regularText.drawBasicString(chatMessages[k], xPos, yPos, 255, -1);
  641. //textDrawingArea.method389(false, xPos, 255, chatMessages[k], yPos);
  642. }
  643. j++;
  644. j77++;
  645. }
  646. }
  647. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  648. if (chatTypeView == 2 || chatTypeView == 0) {
  649. if(yPos > 0 && yPos < 210) {
  650. int k1 = 11;
  651. //textDrawingArea.method385(0, "From", yPos, k1);
  652. //k1 += textDrawingArea.getTextWidth("From ");
  653.  
  654. newRegularFont.drawBasicString("From", k1, yPos, 0, -1);
  655. k1 += newRegularFont.getTextWidth("From ");
  656. if(byte0 == 1) {
  657. modIcons[0].drawSprite(k1, yPos - 12);
  658. k1 += 12;
  659. } else if(byte0 == 2) {
  660. modIcons[1].drawSprite(k1, yPos - 12);
  661. k1 += 12;
  662. } else if(byte0 == 3) {
  663. modIcons[2].drawSprite(k1, yPos - 12);
  664. k1 += 12;
  665. } else if(byte0 == 4) {
  666. modIcons[3].drawSprite(k1, yPos - 12);
  667. k1 += 12;
  668. } else if(byte0 == 5) {
  669. modIcons[4].drawSprite(k1, yPos - 12);
  670. k1 += 12;
  671. } else if(byte0 == 6) {
  672. modIcons[5].drawSprite(k1, yPos - 12);
  673. k1 += 12;
  674. } else if(byte0 == 7) {
  675. modIcons[6].drawSprite(k1, yPos - 12);
  676. k1 += 12;
  677.  
  678. }
  679. regularText.drawBasicString(s1 + ":", k1, yPos, 0, -1);
  680. //textDrawingArea.method385(0, s1 + ":", yPos, k1);
  681. k1 += regularText.getTextWidth(s1) + 8;
  682. //k1 += textDrawingArea.getTextWidth(s1) + 8;
  683. regularText.drawBasicString(chatMessages[k], k1, yPos, 0x800000, -1);
  684. //textDrawingArea.method385(0x800000, chatMessages[k], yPos, k1);
  685. }
  686. j++;
  687. j77++;
  688. }
  689. }
  690. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  691. if (chatTypeView == 3 || chatTypeView == 0) {
  692. if(yPos > 0 && yPos < 210)
  693. regularText.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x800080, -1);
  694. //textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], yPos, 11);
  695. j++;
  696. j77++;
  697. }
  698. }
  699. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  700. if (chatTypeView == 2 || chatTypeView == 0) {
  701. if(yPos > 0 && yPos < 210)
  702. regularText.drawBasicString(chatMessages[k], 11, yPos, 0x800000, -1);
  703. //textDrawingArea.method385(0x800000, chatMessages[k], yPos, 11);
  704. j++;
  705. j77++;
  706. }
  707. }
  708. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  709. if (chatTypeView == 2 || chatTypeView == 0) {
  710. if(yPos > 0 && yPos < 210) {
  711. regularText.drawBasicString("To " + s1 + ":", 11, yPos, 0, -1);
  712. //textDrawingArea.method385(0, "To " + s1 + ":", yPos, 11);
  713. regularText.drawBasicString(chatMessages[k], 15 + regularText.getTextWidth("To :" + s1), yPos, 0x800000, -1);
  714. //textDrawingArea.method385(0x800000, chatMessages[k], yPos, 15 + textDrawingArea.getTextWidth("To :" + s1));
  715. }
  716. j++;
  717. j77++;
  718. }
  719. }
  720. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  721. if (chatTypeView == 3 || chatTypeView == 0) {
  722. if(yPos > 0 && yPos < 210)
  723. regularText.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  724. //textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  725. j++;
  726. j77++;
  727. }
  728. if(chatType == 11 && (clanChatMode == 0)) {
  729. if (chatTypeView == 11) {
  730. if(yPos > 0 && yPos < 210)
  731. regularText.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  732. //textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  733. j++;
  734. j77++;
  735. }
  736. //if(chatType == 12) {
  737. // if(yPos > 0 && yPos < 110)
  738. // regularText.drawBasicString(chatMessages[k] + " <col=255>" + s1, 11, yPos, 0x7e3200, -1);
  739. //textDrawingArea.method385(0x7e3200, chatMessages[k] + " @blu@" + s1, yPos, 11);
  740. // j++;
  741. //}
  742. }
  743. }
  744. if (chatType == 16) {
  745. if (chatTypeView == 11 || chatTypeView == 0) {
  746. if (yPos > 3 && yPos < 130) {
  747. int xPos = 11;
  748. String title = "<col=255>" + TextClass.capitalize(clanname) + "</col>";
  749. String username = (chatRights[k] > 0 ? "<img=" + (chatRights[k] - 0) + ">" : "") + TextClass.fixName(chatNames[k]);
  750. String message = "<col=800000000>" + TextClass.capitalizeFirstChar(chatMessages[k]) + "</col>";
  751. regularText.drawBasicString("[" + title + "] " + username + ": " + message, xPos, yPos, 0, -1);
  752. }
  753. j++;
  754. j77++;
  755. }
  756. }
  757. /*if(chatType == 16 || chatType == 12) {
  758. int j2 = 40;
  759. int clanNameWidth = regularText.getTextWidth(clanname);
  760. if(chatTypeView == 11 || chatTypeView == 0) {
  761. if(yPos > 3 && yPos < 130)
  762. switch(chatRights[k]) {
  763. case 1:
  764. case 2:
  765. case 3:
  766. case 4:
  767. case 5:
  768. case 6:
  769. case 7:
  770. j2 += clanNameWidth;
  771. modIcons[chatRights[k] - 1].drawSprite(j2 - 18, yPos - 12);
  772. j2 += 14;
  773. break;
  774.  
  775. default:
  776. j2 += clanNameWidth;
  777. break;
  778. }
  779. regularText.drawBasicString("[", 8, yPos, 0, -1);
  780. //textDrawingArea.method385(0, "[", yPos, 8);
  781. regularText.drawBasicString(clanname, 14, yPos, 255, -1);
  782. //textDrawingArea.method385(255, ""+clanname+"", yPos, 14);
  783. regularText.drawBasicString("]", clanNameWidth + 14, yPos, 0, -1);
  784. //textDrawingArea.method385(0, "]", yPos, clanNameWidth + 14);
  785.  
  786. regularText.drawBasicString(chatNames[k]+":", j2 - 17, yPos, 0, -1);
  787. //textDrawingArea.method385(0, chatNames[k]+":", yPos, j2 - 17); //j2
  788. j2 += regularText.getTextWidth(chatNames[k]) + 7;
  789. //j2 += textDrawingArea.getTextWidth(chatNames[k]) + 7;
  790. regularText.drawBasicString(chatMessages[k], j2 - 16, yPos, 0x800000, -1);
  791. //textDrawingArea.method385(0x800000, chatMessages[k], yPos, j2 - 16);//j2
  792. j++;
  793. j77++;
  794. }
  795. }*/
  796. }
  797. DrawingArea.defaultDrawingAreaSize();
  798. anInt1211 = j * 14 + 7 + 5;
  799. if(anInt1211 < 111)
  800. anInt1211 = 111;
  801. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  802. String s;
  803. if(myPlayer != null && myPlayer.name != null)
  804. s = myPlayer.name;
  805. else
  806. s = TextClass.fixName(myUsername);
  807. regularText.drawBasicString(s + ":", 11, 133, 0, -1);
  808. //textDrawingArea.method385(0, s + ":", 133, 11);
  809. regularText.drawBasicString(inputString + "*", 12 + textDrawingArea.getTextWidth(s + ": "), 133, 255, -1);
  810. //textDrawingArea.drawChatInput(255, 12 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false);
  811. DrawingArea.method339(121, 0x807660, 506, 7);
  812. }
  813. if(menuOpen && menuScreenArea == 2) {
  814. drawMenu();
  815. }
  816. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  817. aRSImageProducer_1165.initDrawingArea();
  818. Texture.anIntArray1472 = anIntArray1182;
  819. }
  820.  
  821. public void init() {
  822. nodeID = 10;
  823. portOff = 0;
  824. setHighMem();
  825. isMembers = true;
  826. initClientFrame(503, 765);
  827. }
  828.  
  829. public void startRunnable(Runnable runnable, int i) {
  830. if(i > 10)
  831. i = 10;
  832. if(signlink.mainapp != null) {
  833. signlink.startthread(runnable, i);
  834. } else {
  835. super.startRunnable(runnable, i);
  836. }
  837. }
  838.  
  839. public Socket openSocket(int port) throws IOException {
  840. return new Socket(InetAddress.getByName(server), port);
  841. }
  842.  
  843. private void processMenuClick() {
  844. if(activeInterfaceType != 0)
  845. return;
  846. int j = super.clickMode3;
  847. if(spellSelected == 1 && super.saveClickX >= 516 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  848. j = 0;
  849. if(menuOpen) {
  850. if(j != 1) {
  851. int k = super.mouseX;
  852. int j1 = super.mouseY;
  853. if(menuScreenArea == 0) {
  854. k -= 4;
  855. j1 -= 4;
  856. }
  857. if(menuScreenArea == 1) {
  858. k -= 519;
  859. j1 -= 168;
  860. }
  861. if(menuScreenArea == 2) {
  862. k -= 17;
  863. j1 -= 338;
  864. }
  865. if(menuScreenArea == 3) {
  866. k -= 519;
  867. j1 -= 0;
  868. }
  869. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  870. menuOpen = false;
  871. if(menuScreenArea == 1)
  872. needDrawTabArea = true;
  873. if(menuScreenArea == 2)
  874. inputTaken = true;
  875. }
  876. }
  877. if(j == 1) {
  878. int l = menuOffsetX;
  879. int k1 = menuOffsetY;
  880. int i2 = menuWidth;
  881. int k2 = super.saveClickX;
  882. int l2 = super.saveClickY;
  883. if(menuScreenArea == 0) {
  884. k2 -= 4;
  885. l2 -= 4;
  886. }
  887. if(menuScreenArea == 1) {
  888. k2 -= 519;
  889. l2 -= 168;
  890. }
  891. if(menuScreenArea == 2) {
  892. k2 -= 17;
  893. l2 -= 338;
  894. }
  895. if(menuScreenArea == 3) {
  896. k2 -= 519;
  897. l2 -= 0;
  898. }
  899. int i3 = -1;
  900. for(int j3 = 0; j3 < menuActionRow; j3++) {
  901. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  902. if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  903. i3 = j3;
  904. }
  905. System.out.println(i3);
  906. if(i3 != -1)
  907. doAction(i3);
  908. menuOpen = false;
  909. if(menuScreenArea == 1)
  910. needDrawTabArea = true;
  911. if(menuScreenArea == 2) {
  912. inputTaken = true;
  913. }
  914. }
  915. } else {
  916. if(j == 1 && menuActionRow > 0) {
  917. int i1 = menuActionID[menuActionRow - 1];
  918. 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) {
  919. int l1 = menuActionCmd2[menuActionRow - 1];
  920. int j2 = menuActionCmd3[menuActionRow - 1];
  921. RSInterface class9 = RSInterface.interfaceCache[j2];
  922. if(class9.aBoolean259 || class9.aBoolean235) {
  923. aBoolean1242 = false;
  924. anInt989 = 0;
  925. anInt1084 = j2;
  926. anInt1085 = l1;
  927. activeInterfaceType = 2;
  928. anInt1087 = super.saveClickX;
  929. anInt1088 = super.saveClickY;
  930. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  931. activeInterfaceType = 1;
  932. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  933. activeInterfaceType = 3;
  934. return;
  935. }
  936. }
  937. }
  938. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  939. j = 2;
  940. if(j == 1 && menuActionRow > 0)
  941. doAction(menuActionRow - 1);
  942. if(j == 2 && menuActionRow > 0)
  943. determineMenuSize();
  944. }
  945. }
  946.  
  947.  
  948. public static int totalRead = 0;
  949.  
  950. public static String getFileNameWithoutExtension(String fileName) {
  951. File tmpFile = new File(fileName);
  952. tmpFile.getName();
  953. int whereDot = tmpFile.getName().lastIndexOf('.');
  954. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2 ) {
  955. return tmpFile.getName().substring(0, whereDot);
  956. }
  957. return "";
  958. }
  959. public void preloadModels() {
  960. File file = new File(signlink.findcachedir() + "Raw" + File.separator);
  961. File[] fileArray = file.listFiles();
  962. for(int y = 0; y < fileArray.length; y++) {
  963. String s = fileArray[y].getName();
  964. byte[] buffer = ReadFile(signlink.findcachedir() + "Raw" + File.separator + s);
  965. Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
  966. }
  967. }
  968.  
  969.  
  970.  
  971. private void saveMidi(boolean flag, byte abyte0[])
  972. {
  973. signlink.midifade = flag ? 1 : 0;
  974. signlink.midisave(abyte0, abyte0.length);
  975. }
  976.  
  977. private void method22()
  978. {
  979. try
  980. {
  981. anInt985 = -1;
  982. aClass19_1056.removeAll();
  983. aClass19_1013.removeAll();
  984. Texture.method366();
  985. unlinkMRUNodes();
  986. worldController.initToNull();
  987. System.gc();
  988. for(int i = 0; i < 4; i++)
  989. aClass11Array1230[i].method210();
  990.  
  991. for(int l = 0; l < 4; l++)
  992. {
  993. for(int k1 = 0; k1 < 104; k1++)
  994. {
  995. for(int j2 = 0; j2 < 104; j2++)
  996. byteGroundArray[l][k1][j2] = 0;
  997.  
  998. }
  999.  
  1000. }
  1001.  
  1002. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  1003. int k2 = aByteArrayArray1183.length;
  1004. stream.createFrame(0);
  1005. if(!aBoolean1159)
  1006. {
  1007. for(int i3 = 0; i3 < k2; i3++)
  1008. {
  1009. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  1010. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  1011. byte abyte0[] = aByteArrayArray1183[i3];
  1012. if (FileOperations.FileExists(signlink.findcachedir()+"maps/"+anIntArray1235[i3]+".dat"))
  1013. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"maps/"+anIntArray1235[i3]+".dat");
  1014. if(abyte0 != null)
  1015. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  1016. }
  1017.  
  1018. for(int j4 = 0; j4 < k2; j4++)
  1019. {
  1020. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  1021. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  1022. byte abyte2[] = aByteArrayArray1183[j4];
  1023. if(abyte2 == null && anInt1070 < 800)
  1024. objectManager.method174(k7, 64, 64, l5);
  1025. }
  1026.  
  1027. anInt1097++;
  1028. if(anInt1097 > 160)
  1029. {
  1030. anInt1097 = 0;
  1031. stream.createFrame(238);
  1032. stream.writeWordBigEndian(96);
  1033. }
  1034. stream.createFrame(0);
  1035. for(int i6 = 0; i6 < k2; i6++)
  1036. {
  1037. byte abyte1[] = aByteArrayArray1247[i6];
  1038. if(abyte1 != null)
  1039. {
  1040. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  1041. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  1042. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  1043. }
  1044. }
  1045.  
  1046. }
  1047. if(aBoolean1159)
  1048. {
  1049. for(int j3 = 0; j3 < 4; j3++)
  1050. {
  1051. for(int k4 = 0; k4 < 13; k4++)
  1052. {
  1053. for(int j6 = 0; j6 < 13; j6++)
  1054. {
  1055. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  1056. if(l7 != -1)
  1057. {
  1058. int i9 = l7 >> 24 & 3;
  1059. int l9 = l7 >> 1 & 3;
  1060. int j10 = l7 >> 14 & 0x3ff;
  1061. int l10 = l7 >> 3 & 0x7ff;
  1062. int j11 = (j10 / 8 << 8) + l10 / 8;
  1063. for(int l11 = 0; l11 < anIntArray1234.length; l11++)
  1064. {
  1065. if(anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  1066. continue;
  1067. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  1068. break;
  1069. }
  1070.  
  1071. }
  1072. }
  1073.  
  1074. }
  1075.  
  1076. }
  1077.  
  1078. for(int l4 = 0; l4 < 13; l4++)
  1079. {
  1080. for(int k6 = 0; k6 < 13; k6++)
  1081. {
  1082. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  1083. if(i8 == -1)
  1084. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  1085. }
  1086.  
  1087. }
  1088.  
  1089. stream.createFrame(0);
  1090. for(int l6 = 0; l6 < 4; l6++)
  1091. {
  1092. for(int j8 = 0; j8 < 13; j8++)
  1093. {
  1094. for(int j9 = 0; j9 < 13; j9++)
  1095. {
  1096. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  1097. if(i10 != -1)
  1098. {
  1099. int k10 = i10 >> 24 & 3;
  1100. int i11 = i10 >> 1 & 3;
  1101. int k11 = i10 >> 14 & 0x3ff;
  1102. int i12 = i10 >> 3 & 0x7ff;
  1103. int j12 = (k11 / 8 << 8) + i12 / 8;
  1104. for(int k12 = 0; k12 < anIntArray1234.length; k12++)
  1105. {
  1106. if(anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  1107. continue;
  1108. //objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  1109. byte abyte0[] = aByteArrayArray1247[k12];
  1110. if (FileOperations.FileExists(signlink.findcachedir()+"maps/"+anIntArray1235[k12]+".dat"))
  1111. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"maps/"+anIntArray1235[k12]+".dat");
  1112. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  1113. break;
  1114. }
  1115.  
  1116. }
  1117. }
  1118.  
  1119. }
  1120.  
  1121. }
  1122.  
  1123. }
  1124. stream.createFrame(0);
  1125. objectManager.method171(aClass11Array1230, worldController);
  1126. aRSImageProducer_1165.initDrawingArea();
  1127. stream.createFrame(0);
  1128. int k3 = ObjectManager.anInt145;
  1129. if(k3 > plane)
  1130. k3 = plane;
  1131. if(k3 < plane - 1)
  1132. k3 = plane - 1;
  1133. if(lowMem)
  1134. worldController.method275(ObjectManager.anInt145);
  1135. else
  1136. worldController.method275(0);
  1137. for(int i5 = 0; i5 < 104; i5++)
  1138. {
  1139. for(int i7 = 0; i7 < 104; i7++)
  1140. spawnGroundItem(i5, i7);
  1141.  
  1142. }
  1143.  
  1144. anInt1051++;
  1145. if(anInt1051 > 98)
  1146. {
  1147. anInt1051 = 0;
  1148. stream.createFrame(150);
  1149. }
  1150. method63();
  1151. }
  1152. catch(Exception exception) { }
  1153. ObjectDef.mruNodes1.unlinkAll();
  1154. if(super.gameFrame != null)
  1155. {
  1156. stream.createFrame(210);
  1157. stream.writeDWord(0x3f008edd);
  1158. }
  1159. if(lowMem && signlink.cache_dat != null)
  1160. {
  1161. int j = onDemandFetcher.getVersionCount(0);
  1162. for(int i1 = 0; i1 < j; i1++)
  1163. {
  1164. int l1 = onDemandFetcher.getModelIndex(i1);
  1165. if((l1 & 0x79) == 0)
  1166. Model.method461(i1);
  1167. }
  1168.  
  1169. }
  1170. System.gc();
  1171. Texture.method367();
  1172. onDemandFetcher.method566();
  1173. int k = (anInt1069 - 6) / 8 - 1;
  1174. int j1 = (anInt1069 + 6) / 8 + 1;
  1175. int i2 = (anInt1070 - 6) / 8 - 1;
  1176. int l2 = (anInt1070 + 6) / 8 + 1;
  1177. if(aBoolean1141)
  1178. {
  1179. k = 49;
  1180. j1 = 50;
  1181. i2 = 49;
  1182. l2 = 50;
  1183. }
  1184. for(int l3 = k; l3 <= j1; l3++)
  1185. {
  1186. for(int j5 = i2; j5 <= l2; j5++)
  1187. if(l3 == k || l3 == j1 || j5 == i2 || j5 == l2)
  1188. {
  1189. int j7 = onDemandFetcher.method562(0, j5, l3);
  1190. if(j7 != -1)
  1191. onDemandFetcher.method560(j7, 3);
  1192. int k8 = onDemandFetcher.method562(1, j5, l3);
  1193. if(k8 != -1)
  1194. onDemandFetcher.method560(k8, 3);
  1195. }
  1196.  
  1197. }
  1198.  
  1199. }
  1200.  
  1201. private void unlinkMRUNodes()
  1202. {
  1203. ObjectDef.mruNodes1.unlinkAll();
  1204. ObjectDef.mruNodes2.unlinkAll();
  1205. EntityDef.mruNodes.unlinkAll();
  1206. ItemDef.mruNodes2.unlinkAll();
  1207. ItemDef.mruNodes1.unlinkAll();
  1208. Player.mruNodes.unlinkAll();
  1209. SpotAnim.aMRUNodes_415.unlinkAll();
  1210. }
  1211.  
  1212. private void method24(int i)
  1213. {
  1214. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  1215. int j = ai.length;
  1216. for(int k = 0; k < j; k++)
  1217. ai[k] = 0;
  1218.  
  1219. for(int l = 1; l < 103; l++)
  1220. {
  1221. int i1 = 24628 + (103 - l) * 512 * 4;
  1222. for(int k1 = 1; k1 < 103; k1++)
  1223. {
  1224. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  1225. worldController.method309(ai, i1, i, k1, l);
  1226. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1227. worldController.method309(ai, i1, i + 1, k1, l);
  1228. i1 += 4;
  1229. }
  1230.  
  1231. }
  1232.  
  1233. int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  1234. int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  1235. aClass30_Sub2_Sub1_Sub1_1263.method343();
  1236. for(int i2 = 1; i2 < 103; i2++)
  1237. {
  1238. for(int j2 = 1; j2 < 103; j2++)
  1239. {
  1240. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1241. method50(i2, j1, j2, l1, i);
  1242. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1243. method50(i2, j1, j2, l1, i + 1);
  1244. }
  1245.  
  1246. }
  1247.  
  1248. aRSImageProducer_1165.initDrawingArea();
  1249. anInt1071 = 0;
  1250. for(int k2 = 0; k2 < 104; k2++)
  1251. {
  1252. for(int l2 = 0; l2 < 104; l2++)
  1253. {
  1254. int i3 = worldController.method303(plane, k2, l2);
  1255. if(i3 != 0)
  1256. {
  1257. i3 = i3 >> 14 & 0x7fff;
  1258. int j3 = ObjectDef.forID(i3).anInt746;
  1259. if(j3 >= 0)
  1260. {
  1261. int k3 = k2;
  1262. int l3 = l2;
  1263. if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  1264. {
  1265. byte byte0 = 104;
  1266. byte byte1 = 104;
  1267. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  1268. for(int i4 = 0; i4 < 10; i4++)
  1269. {
  1270. int j4 = (int)(Math.random() * 4D);
  1271. if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1272. k3--;
  1273. if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1274. k3++;
  1275. if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1276. l3--;
  1277. if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1278. l3++;
  1279. }
  1280.  
  1281. }
  1282. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  1283. anIntArray1072[anInt1071] = k3;
  1284. anIntArray1073[anInt1071] = l3;
  1285. anInt1071++;
  1286. }
  1287. }
  1288. }
  1289.  
  1290. }
  1291.  
  1292. }
  1293.  
  1294. private void spawnGroundItem(int i, int j)
  1295. {
  1296. NodeList class19 = groundArray[plane][i][j];
  1297. if(class19 == null)
  1298. {
  1299. worldController.method295(plane, i, j);
  1300. return;
  1301. }
  1302. int k = 0xfa0a1f01;
  1303. Object obj = null;
  1304. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  1305. {
  1306. ItemDef itemDef = ItemDef.forID(item.ID);
  1307. int l = itemDef.value;
  1308. if(itemDef.stackable)
  1309. l *= item.anInt1559 + 1;
  1310. // notifyItemSpawn(item, i + baseX, j + baseY);
  1311.  
  1312. if(l > k)
  1313. {
  1314. k = l;
  1315. obj = item;
  1316. }
  1317. }
  1318.  
  1319. class19.insertTail(((Node) (obj)));
  1320. Object obj1 = null;
  1321. Object obj2 = null;
  1322. for(Item class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetNext())
  1323. {
  1324. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  1325. obj1 = class30_sub2_sub4_sub2_1;
  1326. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  1327. obj2 = class30_sub2_sub4_sub2_1;
  1328. }
  1329.  
  1330. int i1 = i + (j << 7) + 0x60000000;
  1331. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1332. }
  1333.  
  1334. private void method26(boolean flag)
  1335. {
  1336. for(int j = 0; j < npcCount; j++)
  1337. {
  1338. NPC npc = npcArray[npcIndices[j]];
  1339. int k = 0x20000000 + (npcIndices[j] << 14);
  1340. if(npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1341. continue;
  1342. int l = npc.x >> 7;
  1343. int i1 = npc.y >> 7;
  1344. if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1345. continue;
  1346. if(npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  1347. {
  1348. if(anIntArrayArray929[l][i1] == anInt1265)
  1349. continue;
  1350. anIntArrayArray929[l][i1] = anInt1265;
  1351. }
  1352. if(!npc.desc.aBoolean84)
  1353. k += 0x80000000;
  1354. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  1355. }
  1356. }
  1357.  
  1358. private boolean replayWave()
  1359. {
  1360. return signlink.wavereplay();
  1361. }
  1362.  
  1363. private void loadError()
  1364. {
  1365. String s = "ondemand";//was a constant parameter
  1366. System.out.println(s);
  1367. try
  1368. {
  1369. getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1370. }
  1371. catch(Exception exception)
  1372. {
  1373. exception.printStackTrace();
  1374. }
  1375. do
  1376. try
  1377. {
  1378. Thread.sleep(1000L);
  1379. }
  1380. catch(Exception _ex) { }
  1381. while(true);
  1382. }
  1383.  
  1384. public void drawHoverBox(int xPos, int yPos, String text) {
  1385. String[] results = text.split("\n");
  1386. int height = (results.length * 16) + 6;
  1387. int width;
  1388. width = smallText.getTextWidth(results[0]) + 6;
  1389. for(int i = 1; i < results.length; i++)
  1390. if(width <= smallText.getTextWidth(results[i]) + 6)
  1391. width = smallText.getTextWidth(results[i]) + 6;
  1392. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  1393. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  1394. yPos += 14;
  1395. for(int i = 0; i < results.length; i++) {
  1396. smallText.method389(false, xPos + 3, 0, results[i], yPos);
  1397. yPos += 16;
  1398. }
  1399. }
  1400.  
  1401. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
  1402. {
  1403. if(class9.type != 0 || class9.children == null || class9.isMouseoverTriggered)
  1404. return;
  1405. if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1406. return;
  1407. int k1 = class9.children.length;
  1408. for(int l1 = 0; l1 < k1; l1++)
  1409. {
  1410. int i2 = class9.childX[l1] + i;
  1411. int j2 = (class9.childY[l1] + l) - j1;
  1412. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1413. i2 += class9_1.anInt263;
  1414. j2 += class9_1.anInt265;
  1415. if((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1416. if(class9_1.mOverInterToTrigger >= 0)
  1417. anInt886 = class9_1.mOverInterToTrigger;
  1418. else
  1419. anInt886 = class9_1.id;
  1420. if (class9_1.type == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1421. anInt1315 = class9_1.id;
  1422. }
  1423. if(class9_1.type == 0)
  1424. {
  1425. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1426. if(class9_1.scrollMax > class9_1.height)
  1427. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1428. } else
  1429. {
  1430. if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1431. {
  1432. boolean flag = false;
  1433. if(class9_1.contentType != 0)
  1434. flag = buildFriendsListMenu(class9_1);
  1435. if(!flag)
  1436. {
  1437. //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1438. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1439. menuActionID[menuActionRow] = 315;
  1440. menuActionCmd3[menuActionRow] = class9_1.id;
  1441. menuActionRow++;
  1442. }
  1443. }
  1444. if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1445. {
  1446. String s = class9_1.selectedActionName;
  1447. if(s.indexOf(" ") != -1)
  1448. s = s.substring(0, s.indexOf(" "));
  1449. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1450. menuActionID[menuActionRow] = 626;
  1451. menuActionCmd3[menuActionRow] = class9_1.id;
  1452. menuActionRow++;
  1453. }
  1454. if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1455. {
  1456. menuActionName[menuActionRow] = "Close";
  1457. menuActionID[menuActionRow] = 200;
  1458. menuActionCmd3[menuActionRow] = class9_1.id;
  1459. menuActionRow++;
  1460. }
  1461. if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1462. {
  1463. //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1464. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1465. menuActionID[menuActionRow] = 169;
  1466. menuActionCmd3[menuActionRow] = class9_1.id;
  1467. menuActionRow++;
  1468. if (class9_1.hoverText != null) {
  1469. //drawHoverBox(k, l, class9_1.hoverText);
  1470. //System.out.println("DRAWING INTERFACE: " + class9_1.hoverText);
  1471. }
  1472. }
  1473. if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1474. {
  1475. //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1476. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1477. menuActionID[menuActionRow] = 646;
  1478. menuActionCmd3[menuActionRow] = class9_1.id;
  1479. menuActionRow++;
  1480. }
  1481. if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1482. {
  1483. //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1484. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1485. menuActionID[menuActionRow] = 679;
  1486. menuActionCmd3[menuActionRow] = class9_1.id;
  1487. menuActionRow++;
  1488. }
  1489. if(class9_1.type == 2)
  1490. {
  1491. int k2 = 0;
  1492. for(int l2 = 0; l2 < class9_1.height; l2++)
  1493. {
  1494. for(int i3 = 0; i3 < class9_1.width; i3++)
  1495. {
  1496. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1497. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1498. if(k2 < 20)
  1499. {
  1500. j3 += class9_1.spritesX[k2];
  1501. k3 += class9_1.spritesY[k2];
  1502. }
  1503. if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  1504. {
  1505. mouseInvInterfaceIndex = k2;
  1506. lastActiveInvInterface = class9_1.id;
  1507. if(class9_1.inv[k2] > 0)
  1508. {
  1509. ItemDef itemDef = ItemDef.forID(class9_1.inv[k2] - 1);
  1510. if(itemSelected == 1 && class9_1.isInventoryInterface)
  1511. {
  1512. if(class9_1.id != anInt1284 || k2 != anInt1283)
  1513. {
  1514. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  1515. menuActionID[menuActionRow] = 870;
  1516. menuActionCmd1[menuActionRow] = itemDef.id;
  1517. menuActionCmd2[menuActionRow] = k2;
  1518. menuActionCmd3[menuActionRow] = class9_1.id;
  1519. menuActionRow++;
  1520. }
  1521. } else
  1522. if(spellSelected == 1 && class9_1.isInventoryInterface)
  1523. {
  1524. if((spellUsableOn & 0x10) == 16)
  1525. {
  1526. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1527. menuActionID[menuActionRow] = 543;
  1528. menuActionCmd1[menuActionRow] = itemDef.id;
  1529. menuActionCmd2[menuActionRow] = k2;
  1530. menuActionCmd3[menuActionRow] = class9_1.id;
  1531. menuActionRow++;
  1532. }
  1533. } else
  1534. {
  1535. if(class9_1.isInventoryInterface)
  1536. {
  1537. for(int l3 = 4; l3 >= 3; l3--)
  1538. if(itemDef.actions != null && itemDef.actions[l3] != null)
  1539. {
  1540. menuActionName[menuActionRow] = itemDef.actions[l3] + " @lre@" + itemDef.name;
  1541. if(l3 == 3)
  1542. menuActionID[menuActionRow] = 493;
  1543. if(l3 == 4)
  1544. menuActionID[menuActionRow] = 847;
  1545. menuActionCmd1[menuActionRow] = itemDef.id;
  1546. menuActionCmd2[menuActionRow] = k2;
  1547. menuActionCmd3[menuActionRow] = class9_1.id;
  1548. menuActionRow++;
  1549. } else
  1550. if(l3 == 4)
  1551. {
  1552. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1553. menuActionID[menuActionRow] = 847;
  1554. menuActionCmd1[menuActionRow] = itemDef.id;
  1555. menuActionCmd2[menuActionRow] = k2;
  1556. menuActionCmd3[menuActionRow] = class9_1.id;
  1557. menuActionRow++;
  1558. }
  1559.  
  1560. }
  1561. if(class9_1.usableItemInterface)
  1562. {
  1563. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1564. menuActionID[menuActionRow] = 447;
  1565. menuActionCmd1[menuActionRow] = itemDef.id;
  1566. //k2 = inventory spot
  1567. //System.out.println(k2);
  1568. menuActionCmd2[menuActionRow] = k2;
  1569. menuActionCmd3[menuActionRow] = class9_1.id;
  1570. menuActionRow++;
  1571. }
  1572. if(class9_1.isInventoryInterface && itemDef.actions != null)
  1573. {
  1574. for(int i4 = 2; i4 >= 0; i4--)
  1575. if(itemDef.actions[i4] != null)
  1576. {
  1577. menuActionName[menuActionRow] = itemDef.actions[i4] + " @lre@" + itemDef.name;
  1578. if(i4 == 0)
  1579. menuActionID[menuActionRow] = 74;
  1580. if(i4 == 1)
  1581. menuActionID[menuActionRow] = 454;
  1582. if(i4 == 2)
  1583. menuActionID[menuActionRow] = 539;
  1584. menuActionCmd1[menuActionRow] = itemDef.id;
  1585. menuActionCmd2[menuActionRow] = k2;
  1586. menuActionCmd3[menuActionRow] = class9_1.id;
  1587. menuActionRow++;
  1588. }
  1589.  
  1590. }
  1591. if(class9_1.actions != null)
  1592. {
  1593. for(int j4 = 4; j4 >= 0; j4--)
  1594. if(class9_1.actions[j4] != null)
  1595. {
  1596. menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@" + itemDef.name;
  1597. if(j4 == 0)
  1598. menuActionID[menuActionRow] = 632;
  1599. if(j4 == 1)
  1600. menuActionID[menuActionRow] = 78;
  1601. if(j4 == 2)
  1602. menuActionID[menuActionRow] = 867;
  1603. if(j4 == 3)
  1604. menuActionID[menuActionRow] = 431;
  1605. if(j4 == 4)
  1606. menuActionID[menuActionRow] = 53;
  1607. menuActionCmd1[menuActionRow] = itemDef.id;
  1608. menuActionCmd2[menuActionRow] = k2;
  1609. menuActionCmd3[menuActionRow] = class9_1.id;
  1610. menuActionRow++;
  1611. }
  1612.  
  1613. }
  1614. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inv[k2] - 1) + "@gre@)";
  1615. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1616. menuActionID[menuActionRow] = 1125;
  1617. menuActionCmd1[menuActionRow] = itemDef.id;
  1618. menuActionCmd2[menuActionRow] = k2;
  1619. menuActionCmd3[menuActionRow] = class9_1.id;
  1620. menuActionRow++;
  1621. }
  1622. }
  1623. }
  1624. k2++;
  1625. }
  1626.  
  1627. }
  1628.  
  1629. }
  1630. }
  1631. }
  1632.  
  1633. }
  1634.  
  1635. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1636. scrollBar1.drawSprite(i1, l);
  1637. scrollBar2.drawSprite(i1, (l + j) - 16);
  1638. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1639. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1640. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1641. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1642. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1643. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1644. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1645. int k1 = ((j - 32) * j) / j1;
  1646. if(k1 < 8)
  1647. k1 = 8;
  1648. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1649. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1650. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1651. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1652. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1653. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1654. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1655. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1656. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1657. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1658. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1659. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1660. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1661. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1662. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1663. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1664. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1665. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1666. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1667. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1668. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1669. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1670. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1671. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1672. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1673. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1674. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1675. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1676. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1677. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1678. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1679. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1680. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1681. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1682. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1683. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1684. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1685. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1686. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1687. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1688. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1689. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1690. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1691. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1692. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1693. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1694. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1695. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1696. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1697. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1698. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1699. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1700. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1701. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1702. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1703. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1704. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1705. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1706. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1707. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1708. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1709. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1710. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1711. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1712. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1713. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1714. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1715. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1716. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1717. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1718. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1719. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1720. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1721. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1722. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1723. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1724. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1725. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1726. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1727. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1728. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1729. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1730. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1731. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1732. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1733. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1734. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1735. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1736. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1737. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1738. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1739. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1740. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1741. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1742. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1743. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1744. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1745. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1746. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1747. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1748. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1749. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1750. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1751. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1752. }
  1753.  
  1754. private void updateNPCs(Stream stream, int i)
  1755. {
  1756. anInt839 = 0;
  1757. anInt893 = 0;
  1758. method139(stream);
  1759. method46(i, stream);
  1760. method86(stream);
  1761. for(int k = 0; k < anInt839; k++)
  1762. {
  1763. int l = anIntArray840[k];
  1764. if(npcArray[l].anInt1537 != loopCycle)
  1765. {
  1766. npcArray[l].desc = null;
  1767. npcArray[l] = null;
  1768. }
  1769. }
  1770.  
  1771. if(stream.currentOffset != i)
  1772. {
  1773. signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1774. throw new RuntimeException("eek");
  1775. }
  1776. for(int i1 = 0; i1 < npcCount; i1++)
  1777. if(npcArray[npcIndices[i1]] == null)
  1778. {
  1779. signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1780. throw new RuntimeException("eek");
  1781. }
  1782.  
  1783. }
  1784.  
  1785. private int cButtonHPos;
  1786. private int cButtonHCPos;
  1787. private int cButtonCPos;
  1788.  
  1789. private void processChatModeClick() {
  1790. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  1791. cButtonHPos = 0;
  1792. aBoolean1233 = true;
  1793. inputTaken = true;
  1794. } else if (super.mouseX >= 62 && super.mouseX <= 117 && super.mouseY >= 482 && super.mouseY <= 503) {
  1795. cButtonHPos = 1;
  1796. aBoolean1233 = true;
  1797. inputTaken = true;
  1798. } else if (super.mouseX >= 119 && super.mouseX <= 174 && super.mouseY >= 482 && super.mouseY <= 503) {
  1799. cButtonHPos = 2;
  1800. aBoolean1233 = true;
  1801. inputTaken = true;
  1802. } else if (super.mouseX >= 176 && super.mouseX <= 231 && super.mouseY >= 482 && super.mouseY <= 503) {
  1803. cButtonHPos = 3;
  1804. aBoolean1233 = true;
  1805. inputTaken = true;
  1806. } else if (super.mouseX >= 233 && super.mouseX <= 288 && super.mouseY >= 482 && super.mouseY <= 503) {
  1807. cButtonHPos = 4;
  1808. aBoolean1233 = true;
  1809. inputTaken = true;
  1810. } else if (super.mouseX >= 290 && super.mouseX <= 345 && super.mouseY >= 482 && super.mouseY <= 503) {
  1811. cButtonHPos = 5;
  1812. aBoolean1233 = true;
  1813. inputTaken = true;
  1814. } else if (super.mouseX >= 347 && super.mouseX <= 402 && super.mouseY >= 482 && super.mouseY <= 503) {
  1815. cButtonHPos = 7;
  1816. aBoolean1233 = true;
  1817. inputTaken = true;
  1818. } else if (super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  1819. cButtonHPos = 6;
  1820. aBoolean1233 = true;
  1821. inputTaken = true;
  1822. } else {
  1823. cButtonHPos = -1;
  1824. aBoolean1233 = true;
  1825. inputTaken = true;
  1826. }
  1827. if (super.clickMode3 == 1) {
  1828. if (super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1829. cButtonCPos = 0;
  1830. chatTypeView = 0;
  1831. aBoolean1233 = true;
  1832. inputTaken = true;
  1833. } else if (super.saveClickX >= 62 && super.saveClickX <= 117 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1834. cButtonCPos = 1;
  1835. chatTypeView = 5;
  1836. aBoolean1233 = true;
  1837. inputTaken = true;
  1838. } else if (super.saveClickX >= 119 && super.saveClickX <= 174 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1839. cButtonCPos = 2;
  1840. chatTypeView = 1;
  1841. aBoolean1233 = true;
  1842. inputTaken = true;
  1843. } else if (super.saveClickX >= 176 && super.saveClickX <= 231 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1844. cButtonCPos = 3;
  1845. chatTypeView = 2;
  1846. aBoolean1233 = true;
  1847. inputTaken = true;
  1848. } else if (super.saveClickX >= 233 && super.saveClickX <= 288 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1849. cButtonCPos = 4;
  1850. chatTypeView = 11;
  1851. aBoolean1233 = true;
  1852. inputTaken = true;
  1853. } else if (super.saveClickX >= 290 && super.saveClickX <= 345 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1854. cButtonCPos = 5;
  1855. chatTypeView = 3;
  1856. aBoolean1233 = true;
  1857. inputTaken = true;
  1858. } else if (super.saveClickX >= 347 && super.saveClickX <= 402 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1859. cButtonCPos = 6;
  1860. aBoolean1233 = true;
  1861. inputTaken = true;
  1862. } else if (super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1863. if (openInterfaceID == -1) {
  1864. clearTopInterfaces();
  1865. reportAbuseInput = "";
  1866. canMute = false;
  1867. for (int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1868. if (RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600) continue;
  1869. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1870. break;
  1871. }
  1872. } else {
  1873. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1874. }
  1875. }
  1876. }
  1877. }
  1878.  
  1879. private void method33(int i)
  1880. {
  1881. int j = Varp.cache[i].anInt709;
  1882. if(j == 0)
  1883. return;
  1884. int k = variousSettings[i];
  1885. if(j == 1)
  1886. {
  1887. if(k == 1)
  1888. Texture.method372(0.90000000000000002D);
  1889. if(k == 2)
  1890. Texture.method372(0.80000000000000004D);
  1891. if(k == 3)
  1892. Texture.method372(0.69999999999999996D);
  1893. if(k == 4)
  1894. Texture.method372(0.59999999999999998D);
  1895. ItemDef.mruNodes1.unlinkAll();
  1896. welcomeScreenRaised = true;
  1897. }
  1898. if(j == 3)
  1899. {
  1900. boolean flag1 = musicEnabled;
  1901. if(k == 0)
  1902. {
  1903. adjustVolume(musicEnabled, 0);
  1904. musicEnabled = true;
  1905. }
  1906. if(k == 1)
  1907. {
  1908. adjustVolume(musicEnabled, -400);
  1909. musicEnabled = true;
  1910. }
  1911. if(k == 2)
  1912. {
  1913. adjustVolume(musicEnabled, -800);
  1914. musicEnabled = true;
  1915. }
  1916. if(k == 3)
  1917. {
  1918. adjustVolume(musicEnabled, -1200);
  1919. musicEnabled = true;
  1920. }
  1921. if(k == 4)
  1922. musicEnabled = false;
  1923. if(musicEnabled != flag1 && !lowMem)
  1924. {
  1925. if(musicEnabled)
  1926. {
  1927. nextSong = currentSong;
  1928. songChanging = true;
  1929. onDemandFetcher.method558(2, nextSong);
  1930. } else
  1931. {
  1932. stopMidi();
  1933. }
  1934. prevSong = 0;
  1935. }
  1936. }
  1937. if(j == 4)
  1938. {
  1939. if(k == 0)
  1940. {
  1941. aBoolean848 = true;
  1942. setWaveVolume(0);
  1943. }
  1944. if(k == 1)
  1945. {
  1946. aBoolean848 = true;
  1947. setWaveVolume(-400);
  1948. }
  1949. if(k == 2)
  1950. {
  1951. aBoolean848 = true;
  1952. setWaveVolume(-800);
  1953. }
  1954. if(k == 3)
  1955. {
  1956. aBoolean848 = true;
  1957. setWaveVolume(-1200);
  1958. }
  1959. if(k == 4)
  1960. aBoolean848 = false;
  1961. }
  1962. if(j == 5)
  1963. anInt1253 = k;
  1964. if(j == 6)
  1965. anInt1249 = k;
  1966. if(j == 8)
  1967. {
  1968. splitPrivateChat = k;
  1969. inputTaken = true;
  1970. }
  1971. if(j == 9)
  1972. anInt913 = k;
  1973. }
  1974.  
  1975. private void updateEntities() {
  1976. try{
  1977. int anInt974 = 0;
  1978. for(int j = -1; j < playerCount + npcCount; j++) {
  1979. Object obj;
  1980. if(j == -1)
  1981. obj = myPlayer;
  1982. else
  1983. if(j < playerCount)
  1984. obj = playerArray[playerIndices[j]];
  1985. else
  1986. obj = npcArray[npcIndices[j - playerCount]];
  1987. if(obj == null || !((Entity) (obj)).isVisible())
  1988. continue;
  1989. if(obj instanceof NPC) {
  1990. EntityDef entityDef = ((NPC)obj).desc;
  1991. if(entityDef.childrenIDs != null)
  1992. entityDef = entityDef.method161();
  1993. if(entityDef == null)
  1994. continue;
  1995. }
  1996. if(j < playerCount) {
  1997. int l = 30;
  1998. Player player = (Player)obj;
  1999. if(player.headIcon >= 0) {
  2000. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2001. if(spriteDrawX > -1) {
  2002. if (player.skullIcon < 2) {
  2003. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2004. l += 25;
  2005. }
  2006. if (player.headIcon < 7) {
  2007. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2008. l += 18;
  2009. }
  2010. }
  2011. }
  2012. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  2013. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2014. if(spriteDrawX > -1)
  2015. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2016. }
  2017. } else {
  2018. EntityDef entityDef_1 = ((NPC)obj).desc;
  2019. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  2020. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2021. if(spriteDrawX > -1)
  2022. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  2023. }
  2024. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  2025. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2026. if(spriteDrawX > -1)
  2027. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  2028. }
  2029. }
  2030. if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  2031. {
  2032. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  2033. if(spriteDrawX > -1 && anInt974 < anInt975)
  2034. {
  2035. anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
  2036. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  2037. anIntArray976[anInt974] = spriteDrawX;
  2038. anIntArray977[anInt974] = spriteDrawY;
  2039. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  2040. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  2041. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  2042. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  2043. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  2044. {
  2045. anIntArray978[anInt974] += 10;
  2046. anIntArray977[anInt974] += 5;
  2047. }
  2048. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  2049. anIntArray979[anInt974] = 60;
  2050. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  2051. anIntArray978[anInt974] += 5;
  2052. }
  2053. }
  2054. if (((Entity) (obj)).loopCycleStatus > loopCycle) {
  2055. try {
  2056. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2057. if (spriteDrawX > -1) {
  2058. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  2059.  
  2060. if (i1 > 30) {
  2061. i1 = 30;
  2062. }
  2063. int HpPercent = (((Entity) (obj)).currentHealth * 56) / ((Entity) (obj)).maxHealth;
  2064.  
  2065. if (HpPercent > 56) {
  2066. HpPercent = 56;
  2067. }
  2068. if(hpHead)
  2069. chatTextDrawingArea.drawText(0xff0000, (new StringBuilder()).append(((Entity) (Entity) obj).currentHealth).append("/").append(((Entity) (Entity) obj).maxHealth).toString(), spriteDrawY - 9, spriteDrawX);
  2070. int j1 = (((Entity)(Entity)obj).currentHealth * 30) / ((Entity)(Entity)obj).maxHealth;
  2071. if(!HPBarToggle){
  2072. DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  2073. DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  2074. } else {
  2075. HPBarEmpty.drawSprite(spriteDrawX - 28, spriteDrawY - 3);
  2076. HPBarFull = new Sprite("HITPOINTS_0.png", HpPercent, 7);
  2077. HPBarFull.drawSprite(spriteDrawX - 28, spriteDrawY - 3);
  2078. }
  2079. }
  2080. } catch (Exception e) {}
  2081. }
  2082. for(int j1 = 0; j1 < 4; j1++)
  2083. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  2084. {
  2085. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  2086. if(spriteDrawX > -1)
  2087. {
  2088. if(j1 == 1)
  2089. spriteDrawY -= 20;
  2090. if(j1 == 2)
  2091. {
  2092. spriteDrawX -= 15;
  2093. spriteDrawY -= 10;
  2094. }
  2095. if(j1 == 3)
  2096. {
  2097. spriteDrawX += 15;
  2098. spriteDrawY -= 10;
  2099. }
  2100. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  2101. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  2102. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  2103. }
  2104. }
  2105. }
  2106. for(int k = 0; k < anInt974; k++) {
  2107. int k1 = anIntArray976[k];
  2108. int l1 = anIntArray977[k];
  2109. int j2 = anIntArray979[k];
  2110. int k2 = anIntArray978[k];
  2111. boolean flag = true;
  2112. while(flag)
  2113. {
  2114. flag = false;
  2115. for(int l2 = 0; l2 < k; l2++)
  2116. 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)
  2117. {
  2118. l1 = anIntArray977[l2] - anIntArray978[l2];
  2119. flag = true;
  2120. }
  2121.  
  2122. }
  2123. spriteDrawX = anIntArray976[k];
  2124. spriteDrawY = anIntArray977[k] = l1;
  2125. String s = aStringArray983[k];
  2126. if(anInt1249 == 0)
  2127. {
  2128. int i3 = 0xffff00;
  2129. if(anIntArray980[k] < 6)
  2130. i3 = anIntArray965[anIntArray980[k]];
  2131. if(anIntArray980[k] == 6)
  2132. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  2133. if(anIntArray980[k] == 7)
  2134. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  2135. if(anIntArray980[k] == 8)
  2136. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  2137. if(anIntArray980[k] == 9) {
  2138. int j3 = 150 - anIntArray982[k];
  2139. if(j3 < 50)
  2140. i3 = 0xff0000 + 1280 * j3;
  2141. else
  2142. if(j3 < 100)
  2143. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  2144. else
  2145. if(j3 < 150)
  2146. i3 = 65280 + 5 * (j3 - 100);
  2147. }
  2148. if(anIntArray980[k] == 10) {
  2149. int k3 = 150 - anIntArray982[k];
  2150. if(k3 < 50)
  2151. i3 = 0xff0000 + 5 * k3;
  2152. else
  2153. if(k3 < 100)
  2154. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  2155. else
  2156. if(k3 < 150)
  2157. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  2158. }
  2159. if(anIntArray980[k] == 11) {
  2160. int l3 = 150 - anIntArray982[k];
  2161. if(l3 < 50)
  2162. i3 = 0xffffff - 0x50005 * l3;
  2163. else
  2164. if(l3 < 100)
  2165. i3 = 65280 + 0x50005 * (l3 - 50);
  2166. else
  2167. if(l3 < 150)
  2168. i3 = 0xffffff - 0x50000 * (l3 - 100);
  2169. }
  2170. if(anIntArray981[k] == 0) {
  2171. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2172. chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  2173. }
  2174. if(anIntArray981[k] == 1) {
  2175. chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  2176. chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  2177. }
  2178. if(anIntArray981[k] == 2) {
  2179. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  2180. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  2181. }
  2182. if(anIntArray981[k] == 3) {
  2183. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  2184. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  2185. }
  2186. if(anIntArray981[k] == 4) {
  2187. int i4 = chatTextDrawingArea.method384(s);
  2188. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  2189. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  2190. chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  2191. chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  2192. DrawingArea.defaultDrawingAreaSize();
  2193. }
  2194. if(anIntArray981[k] == 5) {
  2195. int j4 = 150 - anIntArray982[k];
  2196. int l4 = 0;
  2197. if(j4 < 25)
  2198. l4 = j4 - 25;
  2199. else
  2200. if(j4 > 125)
  2201. l4 = j4 - 125;
  2202. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  2203. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  2204. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  2205. DrawingArea.defaultDrawingAreaSize();
  2206. }
  2207. } else {
  2208. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2209. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  2210. }
  2211. }
  2212. } catch(Exception e){ }
  2213. }
  2214.  
  2215. private void delFriend(long l)
  2216. {
  2217. try
  2218. {
  2219. if(l == 0L)
  2220. return;
  2221. for(int i = 0; i < friendsCount; i++)
  2222. {
  2223. if(friendsListAsLongs[i] != l)
  2224. continue;
  2225. friendsCount--;
  2226. needDrawTabArea = true;
  2227. for(int j = i; j < friendsCount; j++)
  2228. {
  2229. friendsList[j] = friendsList[j + 1];
  2230. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2231. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2232. }
  2233.  
  2234. stream.createFrame(215);
  2235. stream.writeQWord(l);
  2236. break;
  2237. }
  2238. }
  2239. catch(RuntimeException runtimeexception)
  2240. {
  2241. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  2242. throw new RuntimeException();
  2243. }
  2244. }
  2245.  
  2246. public void drawSideIcons()
  2247. {
  2248. if(tabInterfaceIDs[0] != -1)
  2249. sideIcons[0].drawSprite(10, 4);
  2250. if(tabInterfaceIDs[1] != -1)
  2251. sideIcons[1].drawSprite(43, 4);
  2252. if(tabInterfaceIDs[2] != -1)
  2253. sideIcons[2].drawSprite(76, 3);
  2254. if(tabInterfaceIDs[3] != -1)
  2255. sideIcons[3].drawSprite(111, 5);
  2256. if(tabInterfaceIDs[4] != -1)
  2257. sideIcons[4].drawSprite(140, 1);
  2258. if(tabInterfaceIDs[5] != -1)
  2259. sideIcons[5].drawSprite(174, 1);
  2260. if(tabInterfaceIDs[6] != -1)
  2261. sideIcons[6].drawSprite(208, 4);
  2262. if(tabInterfaceIDs[7] != -1)
  2263. sideIcons[7].drawSprite(11, 303);
  2264. if(tabInterfaceIDs[8] != -1)
  2265. sideIcons[8].drawSprite(46, 306);
  2266. if(tabInterfaceIDs[9] != -1)
  2267. sideIcons[9].drawSprite(79, 306);
  2268. if(tabInterfaceIDs[10] != -1)
  2269. sideIcons[10].drawSprite(113, 302);
  2270. if(tabInterfaceIDs[11] != -1)
  2271. sideIcons[11].drawSprite(145, 304);
  2272. if(tabInterfaceIDs[12] != -1)
  2273. sideIcons[12].drawSprite(181, 302);
  2274. if(tabInterfaceIDs[13] != -1)
  2275. sideIcons[13].drawSprite(213, 303);
  2276. }
  2277.  
  2278.  
  2279. public void drawRedStones() {
  2280. if(tabInterfaceIDs[tabID] != -1) {
  2281. switch(tabID) {
  2282. case 0:
  2283. redStones[0].drawSprite(3, 0);
  2284. break;
  2285. case 1:
  2286. redStones[4].drawSprite(41, 0);
  2287. break;
  2288. case 2:
  2289. redStones[4].drawSprite(74, 0);
  2290. break;
  2291. case 3:
  2292. redStones[4].drawSprite(107, 0);
  2293. break;
  2294. case 4:
  2295. redStones[4].drawSprite(140, 0);
  2296. break;
  2297. case 5:
  2298. redStones[4].drawSprite(173, 0);
  2299. break;
  2300. case 6:
  2301. redStones[1].drawSprite(206, 0);
  2302. break;
  2303. //case 7:
  2304. // redStones[2].drawSprite(3, 298);
  2305. // break;
  2306. case 8:
  2307. redStones[4].drawSprite(41, 298);
  2308. break;
  2309. case 9:
  2310. redStones[4].drawSprite(74, 298);
  2311. break;
  2312. case 10:
  2313. redStones[4].drawSprite(107, 298);
  2314. break;
  2315. case 11:
  2316. redStones[4].drawSprite(140, 298);
  2317. break;
  2318. case 12:
  2319. redStones[4].drawSprite(173, 298);
  2320. break;
  2321. case 13:
  2322. redStones[3].drawSprite(206, 298);
  2323. break;
  2324. }
  2325. }
  2326. }
  2327.  
  2328. private void drawTabArea() {
  2329. aRSImageProducer_1163.initDrawingArea();
  2330. Texture.anIntArray1472 = anIntArray1181;
  2331. tabArea.drawSprite(0, 0);
  2332. if(invOverlayInterfaceID == -1) {
  2333. drawRedStones();
  2334. drawSideIcons();
  2335. }
  2336. if(invOverlayInterfaceID != -1)
  2337. drawInterface(0, 28, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2338. else if(tabInterfaceIDs[tabID] != -1)
  2339. drawInterface(0, 28, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2340. if(menuOpen && menuScreenArea == 1)
  2341. drawMenu();
  2342. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  2343. aRSImageProducer_1165.initDrawingArea();
  2344. Texture.anIntArray1472 = anIntArray1182;
  2345. }
  2346.  
  2347. private void method37(int j) {
  2348. if(!lowMem) {
  2349. if(Texture.anIntArray1480[17] >= j) {
  2350. Background background = Texture.aBackgroundArray1474s[17];
  2351. int k = background.anInt1452 * background.anInt1453 - 1;
  2352. //fire cape apparently?
  2353. int j1 = background.anInt1452 * anInt945 * 2;
  2354. byte abyte0[] = background.aByteArray1450;
  2355. byte abyte3[] = aByteArray912;
  2356. for(int i2 = 0; i2 <= k; i2++)
  2357. abyte3[i2] = abyte0[i2 - j1 & k];
  2358.  
  2359. background.aByteArray1450 = abyte3;
  2360. aByteArray912 = abyte0;
  2361. Texture.method370(17);
  2362. anInt854++;
  2363. if(anInt854 > 1235) {
  2364. anInt854 = 0;
  2365. stream.createFrame(226);
  2366. stream.writeWordBigEndian(0);
  2367. int l2 = stream.currentOffset;
  2368. stream.writeWord(58722);
  2369. stream.writeWordBigEndian(240);
  2370. stream.writeWord((int)(Math.random() * 65536D));
  2371. stream.writeWordBigEndian((int)(Math.random() * 256D));
  2372. if((int)(Math.random() * 2D) == 0)
  2373. stream.writeWord(51825);
  2374. stream.writeWordBigEndian((int)(Math.random() * 256D));
  2375. stream.writeWord((int)(Math.random() * 65536D));
  2376. stream.writeWord(7130);
  2377. stream.writeWord((int)(Math.random() * 65536D));
  2378. stream.writeWord(61657);
  2379. stream.writeBytes(stream.currentOffset - l2);
  2380. }
  2381. }
  2382. if(Texture.anIntArray1480[24] >= j) {
  2383. Background background_1 = Texture.aBackgroundArray1474s[24];
  2384. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  2385. int k1 = background_1.anInt1452 * anInt945 * 2;
  2386. byte abyte1[] = background_1.aByteArray1450;
  2387. byte abyte4[] = aByteArray912;
  2388. for(int j2 = 0; j2 <= l; j2++)
  2389. abyte4[j2] = abyte1[j2 - k1 & l];
  2390.  
  2391. background_1.aByteArray1450 = abyte4;
  2392. aByteArray912 = abyte1;
  2393. Texture.method370(24);
  2394. }
  2395. if(Texture.anIntArray1480[34] >= j) {
  2396. Background background_2 = Texture.aBackgroundArray1474s[34];
  2397. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2398. int l1 = background_2.anInt1452 * anInt945 * 2;
  2399. byte abyte2[] = background_2.aByteArray1450;
  2400. byte abyte5[] = aByteArray912;
  2401. for(int k2 = 0; k2 <= i1; k2++)
  2402. abyte5[k2] = abyte2[k2 - l1 & i1];
  2403.  
  2404. background_2.aByteArray1450 = abyte5;
  2405. aByteArray912 = abyte2;
  2406. Texture.method370(34);
  2407. }
  2408. if(Texture.anIntArray1480[40] >= j)
  2409. {
  2410. Background background_2 = Texture.aBackgroundArray1474s[40];
  2411. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2412. int l1 = background_2.anInt1452 * anInt945 * 2;
  2413. byte abyte2[] = background_2.aByteArray1450;
  2414. byte abyte5[] = aByteArray912;
  2415. for(int k2 = 0; k2 <= i1; k2++)
  2416. abyte5[k2] = abyte2[k2 - l1 & i1];
  2417.  
  2418. background_2.aByteArray1450 = abyte5;
  2419. aByteArray912 = abyte2;
  2420. Texture.method370(40);
  2421. }
  2422. }
  2423. }
  2424.  
  2425. private void method38() {
  2426. for(int i = -1; i < playerCount; i++) {
  2427. int j;
  2428. if(i == -1)
  2429. j = myPlayerIndex;
  2430. else
  2431. j = playerIndices[i];
  2432. Player player = playerArray[j];
  2433. if(player != null && player.textCycle > 0) {
  2434. player.textCycle--;
  2435. if(player.textCycle == 0)
  2436. player.textSpoken = null;
  2437. }
  2438. }
  2439. for(int k = 0; k < npcCount; k++) {
  2440. int l = npcIndices[k];
  2441. NPC npc = npcArray[l];
  2442. if(npc != null && npc.textCycle > 0) {
  2443. npc.textCycle--;
  2444. if(npc.textCycle == 0)
  2445. npc.textSpoken = null;
  2446. }
  2447. }
  2448. }
  2449.  
  2450. private void calcCameraPos() {
  2451. int i = anInt1098 * 128 + 64;
  2452. int j = anInt1099 * 128 + 64;
  2453. int k = method42(plane, j, i) - anInt1100;
  2454. if(xCameraPos < i) {
  2455. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2456. if(xCameraPos > i)
  2457. xCameraPos = i;
  2458. }
  2459. if(xCameraPos > i) {
  2460. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2461. if(xCameraPos < i)
  2462. xCameraPos = i;
  2463. }
  2464. if(zCameraPos < k) {
  2465. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2466. if(zCameraPos > k)
  2467. zCameraPos = k;
  2468. }
  2469. if(zCameraPos > k) {
  2470. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2471. if(zCameraPos < k)
  2472. zCameraPos = k;
  2473. }
  2474. if(yCameraPos < j) {
  2475. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2476. if(yCameraPos > j)
  2477. yCameraPos = j;
  2478. }
  2479. if(yCameraPos > j) {
  2480. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2481. if(yCameraPos < j)
  2482. yCameraPos = j;
  2483. }
  2484. i = anInt995 * 128 + 64;
  2485. j = anInt996 * 128 + 64;
  2486. k = method42(plane, j, i) - anInt997;
  2487. int l = i - xCameraPos;
  2488. int i1 = k - zCameraPos;
  2489. int j1 = j - yCameraPos;
  2490. int k1 = (int)Math.sqrt(l * l + j1 * j1);
  2491. int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2492. int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2493. if(l1 < 128)
  2494. l1 = 128;
  2495. if(l1 > 383)
  2496. l1 = 383;
  2497. if(yCameraCurve < l1) {
  2498. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2499. if(yCameraCurve > l1)
  2500. yCameraCurve = l1;
  2501. }
  2502. if(yCameraCurve > l1) {
  2503. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2504. if(yCameraCurve < l1)
  2505. yCameraCurve = l1;
  2506. }
  2507. int j2 = i2 - xCameraCurve;
  2508. if(j2 > 1024)
  2509. j2 -= 2048;
  2510. if(j2 < -1024)
  2511. j2 += 2048;
  2512. if(j2 > 0) {
  2513. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2514. xCameraCurve &= 0x7ff;
  2515. }
  2516. if(j2 < 0) {
  2517. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2518. xCameraCurve &= 0x7ff;
  2519. }
  2520. int k2 = i2 - xCameraCurve;
  2521. if(k2 > 1024)
  2522. k2 -= 2048;
  2523. if(k2 < -1024)
  2524. k2 += 2048;
  2525. if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2526. xCameraCurve = i2;
  2527. }
  2528.  
  2529. private void drawMenu() {
  2530. int i = menuOffsetX;
  2531. int j = menuOffsetY;
  2532. int k = menuWidth;
  2533. int l = menuHeight + 1;//anInt952
  2534. //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  2535. //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  2536. DrawingArea.drawPixels(l - 4, j + 2, i, 0x706a5e, k);
  2537. DrawingArea.drawPixels(l - 2, j + 1, i + 1, 0x706a5e, k - 2);
  2538. DrawingArea.drawPixels(l, j, i + 2, 0x706a5e, k - 4);
  2539. DrawingArea.drawPixels(l - 2, j + 1, i + 3, 0x2d2822, k - 6);
  2540. DrawingArea.drawPixels(l - 4, j + 2, i + 2, 0x2d2822, k - 4);
  2541. DrawingArea.drawPixels(l - 6, j + 3, i + 1, 0x2d2822, k - 2);
  2542. DrawingArea.drawPixels(l - 22, j + 19, i + 2, 0x524a3d, k - 4);
  2543. DrawingArea.drawPixels(l - 22, j + 20, i + 3, 0x524a3d, k - 6);
  2544. DrawingArea.drawPixels(l - 23, j + 20, i + 3, 0x2b271c, k - 6);
  2545. DrawingArea.fillPixels(i + 3, k - 6, 1, 0x2a291b, j + 2);
  2546. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x2a261b, j + 3);
  2547. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x252116, j + 4);
  2548. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x211e15, j + 5);
  2549. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x1e1b12, j + 6);
  2550. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x1a170e, j + 7);
  2551. DrawingArea.fillPixels(i + 2, k - 4, 2, 0x15120b, j + 8);
  2552. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x100d08, j + 10);
  2553. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 11);
  2554. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x080703, j + 12);
  2555. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 13);
  2556. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x070802, j + 14);
  2557. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 15);
  2558. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x070802, j + 16);
  2559. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 17);
  2560. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x2a291b, j + 18);
  2561. DrawingArea.fillPixels(i + 3, k - 6, 1, 0x564943, j + 19);
  2562. chatTextDrawingArea.method385(0xc6b895, "Choose Option", j + 14, i + 3);
  2563. int j1 = super.mouseX;
  2564. int k1 = super.mouseY;
  2565. if(menuScreenArea == 0) {
  2566. j1 -= 4;
  2567. k1 -= 4;
  2568. }
  2569. if(menuScreenArea == 1) {
  2570. j1 -= 519;
  2571. k1 -= 168;
  2572. }
  2573. if(menuScreenArea == 2) {
  2574. j1 -= 17;
  2575. k1 -= 338;
  2576. }
  2577. if(menuScreenArea == 3) {
  2578. j1 -= 516;
  2579. k1 -= 0;
  2580. }
  2581. for(int l1 = 0; l1 < menuActionRow; l1++) {
  2582. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2583. int j2 = 0xc6b895;
  2584. if (j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3) {
  2585. DrawingArea.drawPixels(15, i2 - 11, i + 3, 0x6f695d, menuWidth - 6);
  2586. j2 = 0xeee5c6;
  2587. }
  2588. chatTextDrawingArea.method389(true, i + 4, j2, menuActionName[l1], i2 + 1);
  2589. }
  2590. }
  2591.  
  2592. private void addFriend(long l) {
  2593. try {
  2594. if(l == 0L)
  2595. return;
  2596. if(friendsCount >= 100 && anInt1046 != 1) {
  2597. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2598. return;
  2599. }
  2600. if(friendsCount >= 200) {
  2601. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2602. return;
  2603. }
  2604. String s = TextClass.fixName(TextClass.nameForLong(l));
  2605. for(int i = 0; i < friendsCount; i++)
  2606. if(friendsListAsLongs[i] == l) {
  2607. pushMessage(s + " is already on your friend list", 0, "");
  2608. return;
  2609. }
  2610. for(int j = 0; j < ignoreCount; j++)
  2611. if(ignoreListAsLongs[j] == l) {
  2612. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  2613. return;
  2614. }
  2615.  
  2616. if(s.equals(myPlayer.name)) {
  2617. return;
  2618. } else {
  2619. friendsList[friendsCount] = s;
  2620. friendsListAsLongs[friendsCount] = l;
  2621. friendsNodeIDs[friendsCount] = 0;
  2622. friendsCount++;
  2623. needDrawTabArea = true;
  2624. stream.createFrame(188);
  2625. stream.writeQWord(l);
  2626. return;
  2627. }
  2628. } catch(RuntimeException runtimeexception) {
  2629. signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
  2630. }
  2631. throw new RuntimeException();
  2632. }
  2633.  
  2634. private int method42(int i, int j, int k) {
  2635. int l = k >> 7;
  2636. int i1 = j >> 7;
  2637. if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2638. return 0;
  2639. int j1 = i;
  2640. if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2641. j1++;
  2642. int k1 = k & 0x7f;
  2643. int l1 = j & 0x7f;
  2644. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2645. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2646. return i2 * (128 - l1) + j2 * l1 >> 7;
  2647. }
  2648.  
  2649. private static String intToKOrMil(int j) {
  2650. if(j < 0x186a0)
  2651. return String.valueOf(j);
  2652. if(j < 0x989680)
  2653. return j / 1000 + "K";
  2654. else
  2655. return j / 0xf4240 + "M";
  2656. }
  2657.  
  2658. private void resetLogout() {
  2659. try {
  2660. if(socketStream != null)
  2661. socketStream.close();
  2662. }
  2663. catch(Exception _ex) { }
  2664. socketStream = null;
  2665. loggedIn = false;
  2666. loginScreenState = 0;
  2667. // myUsername = "";
  2668. // myPassword = "";
  2669. unlinkMRUNodes();
  2670. worldController.initToNull();
  2671. for(int i = 0; i < 4; i++)
  2672. aClass11Array1230[i].method210();
  2673. System.gc();
  2674. stopMidi();
  2675. currentSong = -1;
  2676. nextSong = -1;
  2677. prevSong = 0;
  2678. }
  2679.  
  2680. private void method45() {
  2681. aBoolean1031 = true;
  2682. for(int j = 0; j < 7; j++) {
  2683. anIntArray1065[j] = -1;
  2684. for(int k = 0; k < IDK.length; k++) {
  2685. if(IDK.cache[k].aBoolean662 || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2686. continue;
  2687. anIntArray1065[j] = k;
  2688. break;
  2689. }
  2690. }
  2691. }
  2692.  
  2693. private void method46(int i, Stream stream) {
  2694. while(stream.bitPosition + 21 < i * 8) {
  2695. int k = stream.readBits(14);
  2696. if(k == 16383)
  2697. break;
  2698. if(npcArray[k] == null)
  2699. npcArray[k] = new NPC();
  2700. NPC npc = npcArray[k];
  2701. npcIndices[npcCount++] = k;
  2702. npc.anInt1537 = loopCycle;
  2703. int l = stream.readBits(5);
  2704. if(l > 15)
  2705. l -= 32;
  2706. int i1 = stream.readBits(5);
  2707. if(i1 > 15)
  2708. i1 -= 32;
  2709. int j1 = stream.readBits(1);
  2710. npc.desc = EntityDef.forID(stream.readBits(14));
  2711. int k1 = stream.readBits(1);
  2712. if(k1 == 1)
  2713. anIntArray894[anInt893++] = k;
  2714. npc.anInt1540 = npc.desc.aByte68;
  2715. npc.anInt1504 = npc.desc.anInt79;
  2716. npc.anInt1554 = npc.desc.walkAnim;
  2717. npc.anInt1555 = npc.desc.anInt58;
  2718. npc.anInt1556 = npc.desc.anInt83;
  2719. npc.anInt1557 = npc.desc.anInt55;
  2720. npc.anInt1511 = npc.desc.standAnim;
  2721. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2722. }
  2723. stream.finishBitAccess();
  2724. }
  2725.  
  2726. public void processGameLoop() {
  2727. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  2728. return;
  2729. loopCycle++;
  2730. if(!loggedIn)
  2731. processLoginScreenInput();
  2732. else
  2733. mainGameProcessor();
  2734. processOnDemandQueue();
  2735. }
  2736.  
  2737. private void method47(boolean flag) {
  2738. if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2739. destX = 0;
  2740. int j = playerCount;
  2741. if(flag)
  2742. j = 1;
  2743. for(int l = 0; l < j; l++) {
  2744. Player player;
  2745. int i1;
  2746. if(flag) {
  2747. player = myPlayer;
  2748. i1 = myPlayerIndex << 14;
  2749. } else {
  2750. player = playerArray[playerIndices[l]];
  2751. i1 = playerIndices[l] << 14;
  2752. }
  2753. if(player == null || !player.isVisible())
  2754. continue;
  2755. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  2756. int j1 = player.x >> 7;
  2757. int k1 = player.y >> 7;
  2758. if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2759. continue;
  2760. if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  2761. player.aBoolean1699 = false;
  2762. player.anInt1709 = method42(plane, player.y, player.x);
  2763. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  2764. continue;
  2765. }
  2766. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2767. if(anIntArrayArray929[j1][k1] == anInt1265)
  2768. continue;
  2769. anIntArrayArray929[j1][k1] = anInt1265;
  2770. }
  2771. player.anInt1709 = method42(plane, player.y, player.x);
  2772. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  2773. }
  2774. }
  2775.  
  2776. private boolean promptUserForInput(RSInterface class9) {
  2777. int j = class9.contentType;
  2778. if(anInt900 == 2) {
  2779. if(j == 201) {
  2780. inputTaken = true;
  2781. inputDialogState = 0;
  2782. messagePromptRaised = true;
  2783. promptInput = "";
  2784. friendsListAction = 1;
  2785. aString1121 = "Enter name of friend to add to list";
  2786. }
  2787. if(j == 202) {
  2788. inputTaken = true;
  2789. inputDialogState = 0;
  2790. messagePromptRaised = true;
  2791. promptInput = "";
  2792. friendsListAction = 2;
  2793. aString1121 = "Enter name of friend to delete from list";
  2794. }
  2795. }
  2796. if(j == 205) {
  2797. anInt1011 = 250;
  2798. return true;
  2799. }
  2800. if(j == 501) {
  2801. inputTaken = true;
  2802. inputDialogState = 0;
  2803. messagePromptRaised = true;
  2804. promptInput = "";
  2805. friendsListAction = 4;
  2806. aString1121 = "Enter name of player to add to list";
  2807. }
  2808. if(j == 502) {
  2809. inputTaken = true;
  2810. inputDialogState = 0;
  2811. messagePromptRaised = true;
  2812. promptInput = "";
  2813. friendsListAction = 5;
  2814. aString1121 = "Enter name of player to delete from list";
  2815. }
  2816. if(j == 550) {
  2817. inputTaken = true;
  2818. inputDialogState = 0;
  2819. messagePromptRaised = true;
  2820. promptInput = "";
  2821. friendsListAction = 6;
  2822. aString1121 = "Enter the name of the chat you wish to join";
  2823. }
  2824. if(j >= 300 && j <= 313) {
  2825. int k = (j - 300) / 2;
  2826. int j1 = j & 1;
  2827. int i2 = anIntArray1065[k];
  2828. if(i2 != -1) {
  2829. do {
  2830. if(j1 == 0 && --i2 < 0)
  2831. i2 = IDK.length - 1;
  2832. if(j1 == 1 && ++i2 >= IDK.length)
  2833. i2 = 0;
  2834. } while(IDK.cache[i2].aBoolean662 || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2835. anIntArray1065[k] = i2;
  2836. aBoolean1031 = true;
  2837. }
  2838. }
  2839. if(j >= 314 && j <= 323) {
  2840. int l = (j - 314) / 2;
  2841. int k1 = j & 1;
  2842. int j2 = anIntArray990[l];
  2843. if(k1 == 0 && --j2 < 0)
  2844. j2 = anIntArrayArray1003[l].length - 1;
  2845. if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2846. j2 = 0;
  2847. anIntArray990[l] = j2;
  2848. aBoolean1031 = true;
  2849. }
  2850. if(j == 324 && !aBoolean1047) {
  2851. aBoolean1047 = true;
  2852. method45();
  2853. }
  2854. if(j == 325 && aBoolean1047) {
  2855. aBoolean1047 = false;
  2856. method45();
  2857. }
  2858. if(j == 326) {
  2859. stream.createFrame(101);
  2860. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2861. for(int i1 = 0; i1 < 7; i1++)
  2862. stream.writeWordBigEndian(anIntArray1065[i1]);
  2863.  
  2864. for(int l1 = 0; l1 < 5; l1++)
  2865. stream.writeWordBigEndian(anIntArray990[l1]);
  2866.  
  2867. return true;
  2868. }
  2869. if(j == 613)
  2870. canMute = !canMute;
  2871. if(j >= 601 && j <= 612) {
  2872. clearTopInterfaces();
  2873. if(reportAbuseInput.length() > 0) {
  2874. stream.createFrame(218);
  2875. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2876. stream.writeWordBigEndian(j - 601);
  2877. stream.writeWordBigEndian(canMute ? 1 : 0);
  2878. }
  2879. }
  2880. return false;
  2881. }
  2882.  
  2883. private void method49(Stream stream) {
  2884. for(int j = 0; j < anInt893; j++) {
  2885. int k = anIntArray894[j];
  2886. Player player = playerArray[k];
  2887. int l = stream.readUnsignedByte();
  2888. if((l & 0x40) != 0)
  2889. l += stream.readUnsignedByte() << 8;
  2890. method107(l, k, stream, player);
  2891. }
  2892. }
  2893.  
  2894. private void method50(int i, int k, int l, int i1, int j1) {
  2895. int k1 = worldController.method300(j1, l, i);
  2896. if(k1 != 0) {
  2897. int l1 = worldController.method304(j1, l, i, k1);
  2898. int k2 = l1 >> 6 & 3;
  2899. int i3 = l1 & 0x1f;
  2900. int k3 = k;
  2901. if(k1 > 0)
  2902. k3 = i1;
  2903. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2904. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2905. int i5 = k1 >> 14 & 0x7fff;
  2906. ObjectDef class46_2 = ObjectDef.forID(i5);
  2907. if(class46_2.anInt758 != -1) {
  2908. Background background_2 = mapScenes[class46_2.anInt758];
  2909. if(background_2 != null) {
  2910. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  2911. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  2912. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  2913. }
  2914. } else {
  2915. if(i3 == 0 || i3 == 2)
  2916. if(k2 == 0) {
  2917. ai[k4] = k3;
  2918. ai[k4 + 512] = k3;
  2919. ai[k4 + 1024] = k3;
  2920. ai[k4 + 1536] = k3;
  2921. } else if(k2 == 1) {
  2922. ai[k4] = k3;
  2923. ai[k4 + 1] = k3;
  2924. ai[k4 + 2] = k3;
  2925. ai[k4 + 3] = k3;
  2926. } else if(k2 == 2) {
  2927. ai[k4 + 3] = k3;
  2928. ai[k4 + 3 + 512] = k3;
  2929. ai[k4 + 3 + 1024] = k3;
  2930. ai[k4 + 3 + 1536] = k3;
  2931. } else if(k2 == 3) {
  2932. ai[k4 + 1536] = k3;
  2933. ai[k4 + 1536 + 1] = k3;
  2934. ai[k4 + 1536 + 2] = k3;
  2935. ai[k4 + 1536 + 3] = k3;
  2936. }
  2937. if(i3 == 3)
  2938. if(k2 == 0)
  2939. ai[k4] = k3;
  2940. else if(k2 == 1)
  2941. ai[k4 + 3] = k3;
  2942. else if(k2 == 2)
  2943. ai[k4 + 3 + 1536] = k3;
  2944. else if(k2 == 3)
  2945. ai[k4 + 1536] = k3;
  2946. if(i3 == 2)
  2947. if(k2 == 3) {
  2948. ai[k4] = k3;
  2949. ai[k4 + 512] = k3;
  2950. ai[k4 + 1024] = k3;
  2951. ai[k4 + 1536] = k3;
  2952. } else if(k2 == 0) {
  2953. ai[k4] = k3;
  2954. ai[k4 + 1] = k3;
  2955. ai[k4 + 2] = k3;
  2956. ai[k4 + 3] = k3;
  2957. } else if(k2 == 1) {
  2958. ai[k4 + 3] = k3;
  2959. ai[k4 + 3 + 512] = k3;
  2960. ai[k4 + 3 + 1024] = k3;
  2961. ai[k4 + 3 + 1536] = k3;
  2962. } else if(k2 == 2) {
  2963. ai[k4 + 1536] = k3;
  2964. ai[k4 + 1536 + 1] = k3;
  2965. ai[k4 + 1536 + 2] = k3;
  2966. ai[k4 + 1536 + 3] = k3;
  2967. }
  2968. }
  2969. }
  2970. k1 = worldController.method302(j1, l, i);
  2971. if(k1 != 0) {
  2972. int i2 = worldController.method304(j1, l, i, k1);
  2973. int l2 = i2 >> 6 & 3;
  2974. int j3 = i2 & 0x1f;
  2975. int l3 = k1 >> 14 & 0x7fff;
  2976. ObjectDef class46_1 = ObjectDef.forID(l3);
  2977. if(class46_1.anInt758 != -1) {
  2978. Background background_1 = mapScenes[class46_1.anInt758];
  2979. if(background_1 != null) {
  2980. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  2981. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  2982. background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  2983. }
  2984. } else if(j3 == 9) {
  2985. int l4 = 0xeeeeee;
  2986. if(k1 > 0)
  2987. l4 = 0xee0000;
  2988. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2989. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2990. if(l2 == 0 || l2 == 2) {
  2991. ai1[l5 + 1536] = l4;
  2992. ai1[l5 + 1024 + 1] = l4;
  2993. ai1[l5 + 512 + 2] = l4;
  2994. ai1[l5 + 3] = l4;
  2995. } else {
  2996. ai1[l5] = l4;
  2997. ai1[l5 + 512 + 1] = l4;
  2998. ai1[l5 + 1024 + 2] = l4;
  2999. ai1[l5 + 1536 + 3] = l4;
  3000. }
  3001. }
  3002. }
  3003. k1 = worldController.method303(j1, l, i);
  3004. if(k1 != 0) {
  3005. int j2 = k1 >> 14 & 0x7fff;
  3006. ObjectDef class46 = ObjectDef.forID(j2);
  3007. if(class46.anInt758 != -1) {
  3008. Background background = mapScenes[class46.anInt758];
  3009. if(background != null) {
  3010. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  3011. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  3012. background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  3013. }
  3014. }
  3015. }
  3016. }
  3017.  
  3018. private void loadTitleScreen() {
  3019. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  3020. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  3021. aBackgroundArray1152s = new Background[12];
  3022. int j = 0;
  3023. try {
  3024. j = Integer.parseInt(getParameter("fl_icon"));
  3025. } catch(Exception _ex) {
  3026. }
  3027. if(j == 0) {
  3028. for(int k = 0; k < 12; k++)
  3029. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  3030.  
  3031. } else {
  3032. for(int l = 0; l < 12; l++)
  3033. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  3034.  
  3035. }
  3036. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  3037. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  3038. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  3039.  
  3040. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  3041.  
  3042. anIntArray851 = new int[256];
  3043. for(int k1 = 0; k1 < 64; k1++)
  3044. anIntArray851[k1] = k1 * 0x40000;
  3045.  
  3046. for(int l1 = 0; l1 < 64; l1++)
  3047. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  3048.  
  3049. for(int i2 = 0; i2 < 64; i2++)
  3050. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  3051.  
  3052. for(int j2 = 0; j2 < 64; j2++)
  3053. anIntArray851[j2 + 192] = 0xffffff;
  3054.  
  3055. anIntArray852 = new int[256];
  3056. for(int k2 = 0; k2 < 64; k2++)
  3057. anIntArray852[k2] = k2 * 1024;
  3058.  
  3059. for(int l2 = 0; l2 < 64; l2++)
  3060. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  3061.  
  3062. for(int i3 = 0; i3 < 64; i3++)
  3063. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  3064.  
  3065. for(int j3 = 0; j3 < 64; j3++)
  3066. anIntArray852[j3 + 192] = 0xffffff;
  3067.  
  3068. anIntArray853 = new int[256];
  3069. for(int k3 = 0; k3 < 64; k3++)
  3070. anIntArray853[k3] = k3 * 4;
  3071.  
  3072. for(int l3 = 0; l3 < 64; l3++)
  3073. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  3074.  
  3075. for(int i4 = 0; i4 < 64; i4++)
  3076. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  3077.  
  3078. for(int j4 = 0; j4 < 64; j4++)
  3079. anIntArray853[j4 + 192] = 0xffffff;
  3080.  
  3081. anIntArray850 = new int[256];
  3082. anIntArray1190 = new int[32768];
  3083. anIntArray1191 = new int[32768];
  3084. randomizeBackground(null);
  3085. anIntArray828 = new int[32768];
  3086. anIntArray829 = new int[32768];
  3087. drawLoadingText(10, "Connecting to fileserver");
  3088. if(!aBoolean831) {
  3089. drawFlames = true;
  3090. aBoolean831 = true;
  3091. startRunnable(this, 2);
  3092. }
  3093. }
  3094.  
  3095. private static void setHighMem() {
  3096. WorldController.lowMem = false;
  3097. Texture.lowMem = false;
  3098. lowMem = false;
  3099. ObjectManager.lowMem = false;
  3100. ObjectDef.lowMem = false;
  3101. }
  3102. public String indexLocation(int cacheIndex, int index) {
  3103. return signlink.findcachedir() + "index" + cacheIndex + "/" + (index != -1 ? index + ".gz" : "");
  3104. }
  3105.  
  3106. public void repackCacheIndex(int cacheIndex) {
  3107. System.out.println("Started repacking index " + cacheIndex + ".");
  3108. int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
  3109. File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
  3110. try {
  3111. for (int index = 0; index < indexLength; index++) {
  3112. int fileIndex = Integer.parseInt(getFileNameWithoutExtension(file[index].toString()));
  3113. byte[] data = fileToByteArray(cacheIndex, fileIndex);
  3114. if(data != null && data.length > 0) {
  3115. decompressors[cacheIndex].method234(data.length, data, fileIndex);
  3116. System.out.println("Repacked " + fileIndex + ".");
  3117. } else {
  3118. System.out.println("Unable to locate index " + fileIndex + ".");
  3119. }
  3120. }
  3121. } catch(Exception e) {
  3122. System.out.println("Error packing cache index " + cacheIndex + ".");
  3123. }
  3124. System.out.println("Finished repacking " + cacheIndex + ".");
  3125. }
  3126.  
  3127.  
  3128. public byte[] fileToByteArray(int cacheIndex, int index) {
  3129. try {
  3130. if (indexLocation(cacheIndex, index).length() <= 0 || indexLocation(cacheIndex, index) == null) {
  3131. return null;
  3132. }
  3133. File file = new File(indexLocation(cacheIndex, index));
  3134. byte[] fileData = new byte[(int)file.length()];
  3135. FileInputStream fis = new FileInputStream(file);
  3136. fis.read(fileData);
  3137. fis.close();
  3138. return fileData;
  3139. } catch(Exception e) {
  3140. return null;
  3141. }
  3142. }
  3143. public static void main(String args[]) {
  3144. try {
  3145. //Jframe j = new Jframe(args); //UNCOMMENT OUT FOR .JAR
  3146. System.out.println("The-Genesis: Loading...");
  3147. if(args.length != 5) {
  3148. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  3149. return;
  3150. }
  3151. nodeID = Integer.parseInt(args[0]);
  3152. //portOff = Integer.parseInt(args[1]);
  3153. portOff = 0;
  3154. if(args[2].equals("lowmem"))
  3155. setLowMem();
  3156. else if(args[2].equals("highmem")) {
  3157. setHighMem();
  3158. } else {
  3159. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  3160. return;
  3161. }
  3162. if(args[3].equals("free"))
  3163. isMembers = false;
  3164. else if(args[3].equals("members")) {
  3165. isMembers = true;
  3166. } else {
  3167. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  3168. return;
  3169. }
  3170. signlink.storeid = Integer.parseInt(args[4]);
  3171. signlink.startpriv(InetAddress.getLocalHost());
  3172. new Jframe(args);
  3173. //client client1 = new client();
  3174. //client1.createClientFrame(503, 765);
  3175. } catch(Exception exception) {
  3176. }
  3177. }
  3178.  
  3179.  
  3180.  
  3181. private void loadingStages() {
  3182. if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  3183. aRSImageProducer_1165.initDrawingArea();
  3184. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  3185. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  3186. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3187. loadingStage = 1;
  3188. aLong824 = System.currentTimeMillis();
  3189. }
  3190. if(loadingStage == 1) {
  3191. int j = method54();
  3192. if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  3193. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  3194. aLong824 = System.currentTimeMillis();
  3195. }
  3196. }
  3197. if(loadingStage == 2 && plane != anInt985) {
  3198. anInt985 = plane;
  3199. method24(plane);
  3200. }
  3201. }
  3202.  
  3203. private int method54() {
  3204. for(int i = 0; i < aByteArrayArray1183.length; i++) {
  3205. if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  3206. return -1;
  3207. if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  3208. return -2;
  3209. }
  3210. boolean flag = true;
  3211. for(int j = 0; j < aByteArrayArray1183.length; j++) {
  3212. byte abyte0[] = aByteArrayArray1247[j];
  3213. if(abyte0 != null) {
  3214. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3215. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3216. if(aBoolean1159) {
  3217. k = 10;
  3218. l = 10;
  3219. }
  3220. flag &= ObjectManager.method189(k, abyte0, l);
  3221. }
  3222. }
  3223. if(!flag)
  3224. return -3;
  3225. if(aBoolean1080) {
  3226. return -4;
  3227. } else {
  3228. loadingStage = 2;
  3229. ObjectManager.anInt131 = plane;
  3230. method22();
  3231. stream.createFrame(121);
  3232. return 0;
  3233. }
  3234. }
  3235.  
  3236. private void method55()
  3237. {
  3238. 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())
  3239. if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3240. class30_sub2_sub4_sub4.unlink();
  3241. else
  3242. if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  3243. {
  3244. if(class30_sub2_sub4_sub4.anInt1590 > 0)
  3245. {
  3246. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3247. if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  3248. 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);
  3249. }
  3250. if(class30_sub2_sub4_sub4.anInt1590 < 0)
  3251. {
  3252. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3253. Player player;
  3254. if(j == unknownInt10)
  3255. player = myPlayer;
  3256. else
  3257. player = playerArray[j];
  3258. if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  3259. 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);
  3260. }
  3261. class30_sub2_sub4_sub4.method456(anInt945);
  3262. 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);
  3263. }
  3264.  
  3265. }
  3266.  
  3267. public AppletContext getAppletContext()
  3268. {
  3269. if(signlink.mainapp != null)
  3270. return signlink.mainapp.getAppletContext();
  3271. else
  3272. return super.getAppletContext();
  3273. }
  3274.  
  3275. private void drawLogo() {
  3276. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  3277. Sprite sprite = new Sprite(abyte0, this);
  3278. aRSImageProducer_1110.initDrawingArea();
  3279. sprite.method346(0, 0);
  3280. aRSImageProducer_1111.initDrawingArea();
  3281. sprite.method346(-637, 0);
  3282. aRSImageProducer_1107.initDrawingArea();
  3283. sprite.method346(-128, 0);
  3284. aRSImageProducer_1108.initDrawingArea();
  3285. sprite.method346(-202, -371);
  3286. aRSImageProducer_1109.initDrawingArea();
  3287. sprite.method346(-202, -171);
  3288. aRSImageProducer_1112.initDrawingArea();
  3289. sprite.method346(0, -265);
  3290. aRSImageProducer_1113.initDrawingArea();
  3291. sprite.method346(-562, -265);
  3292. aRSImageProducer_1114.initDrawingArea();
  3293. sprite.method346(-128, -171);
  3294. aRSImageProducer_1115.initDrawingArea();
  3295. sprite.method346(-562, -171);
  3296. int ai[] = new int[sprite.myWidth];
  3297. for(int j = 0; j < sprite.myHeight; j++) {
  3298. for(int k = 0; k < sprite.myWidth; k++)
  3299. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  3300.  
  3301. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  3302. }
  3303. /*aRSImageProducer_1110.initDrawingArea();
  3304. sprite.method346(382, 0);
  3305. aRSImageProducer_1111.initDrawingArea();
  3306. sprite.method346(-255, 0);
  3307. aRSImageProducer_1107.initDrawingArea();
  3308. sprite.method346(254, 0);
  3309. aRSImageProducer_1108.initDrawingArea();
  3310. sprite.method346(180, -371);
  3311. aRSImageProducer_1109.initDrawingArea();
  3312. sprite.method346(180, -171);
  3313. aRSImageProducer_1112.initDrawingArea();
  3314. sprite.method346(382, -265);
  3315. aRSImageProducer_1113.initDrawingArea();
  3316. sprite.method346(-180, -265);
  3317. aRSImageProducer_1114.initDrawingArea();
  3318. sprite.method346(254, -171);
  3319. aRSImageProducer_1115.initDrawingArea();
  3320. sprite.method346(-180, -171);
  3321. sprite = new Sprite(titleStreamLoader, "logo", 0);
  3322. aRSImageProducer_1107.initDrawingArea();
  3323. sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);*/
  3324. sprite = null;
  3325. Object obj = null;
  3326. Object obj1 = null;
  3327. System.gc();
  3328. }
  3329.  
  3330. private void processOnDemandQueue()
  3331. {
  3332. do
  3333. {
  3334. OnDemandData onDemandData;
  3335. do
  3336. {
  3337. onDemandData = onDemandFetcher.getNextNode();
  3338. if(onDemandData == null)
  3339. return;
  3340. if(onDemandData.dataType == 0)
  3341. {
  3342. Model.method460(onDemandData.buffer, onDemandData.ID);
  3343. if((onDemandFetcher.getModelIndex(onDemandData.ID) & 0x62) != 0)
  3344. {
  3345. needDrawTabArea = true;
  3346. if(backDialogID != -1)
  3347. inputTaken = true;
  3348. }
  3349. }
  3350. if(onDemandData.dataType == 1 && onDemandData.buffer != null)
  3351. Class36.method529(onDemandData.buffer);
  3352. if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  3353. saveMidi(songChanging, onDemandData.buffer);
  3354. if(onDemandData.dataType == 3 && loadingStage == 1)
  3355. {
  3356. for(int i = 0; i < aByteArrayArray1183.length; i++)
  3357. {
  3358. if(anIntArray1235[i] == onDemandData.ID)
  3359. {
  3360. aByteArrayArray1183[i] = onDemandData.buffer;
  3361. if(onDemandData.buffer == null)
  3362. anIntArray1235[i] = -1;
  3363. break;
  3364. }
  3365. if(anIntArray1236[i] != onDemandData.ID)
  3366. continue;
  3367. aByteArrayArray1247[i] = onDemandData.buffer;
  3368. if(onDemandData.buffer == null)
  3369. anIntArray1236[i] = -1;
  3370. break;
  3371. }
  3372.  
  3373. }
  3374. } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  3375. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  3376. } while(true);
  3377.  
  3378. }
  3379.  
  3380. private void calcFlamesPosition()
  3381. {
  3382. char c = '\u0100';
  3383. for(int j = 10; j < 117; j++)
  3384. {
  3385. int k = (int)(Math.random() * 100D);
  3386. if(k < 50)
  3387. anIntArray828[j + (c - 2 << 7)] = 255;
  3388. }
  3389. for(int l = 0; l < 100; l++)
  3390. {
  3391. int i1 = (int)(Math.random() * 124D) + 2;
  3392. int k1 = (int)(Math.random() * 128D) + 128;
  3393. int k2 = i1 + (k1 << 7);
  3394. anIntArray828[k2] = 192;
  3395. }
  3396.  
  3397. for(int j1 = 1; j1 < c - 1; j1++)
  3398. {
  3399. for(int l1 = 1; l1 < 127; l1++)
  3400. {
  3401. int l2 = l1 + (j1 << 7);
  3402. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  3403. }
  3404.  
  3405. }
  3406.  
  3407. anInt1275 += 128;
  3408. if(anInt1275 > anIntArray1190.length)
  3409. {
  3410. anInt1275 -= anIntArray1190.length;
  3411. int i2 = (int)(Math.random() * 12D);
  3412. randomizeBackground(aBackgroundArray1152s[i2]);
  3413. }
  3414. for(int j2 = 1; j2 < c - 1; j2++)
  3415. {
  3416. for(int i3 = 1; i3 < 127; i3++)
  3417. {
  3418. int k3 = i3 + (j2 << 7);
  3419. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  3420. if(i4 < 0)
  3421. i4 = 0;
  3422. anIntArray828[k3] = i4;
  3423. }
  3424.  
  3425. }
  3426.  
  3427. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  3428.  
  3429. anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
  3430. if(anInt1040 > 0)
  3431. anInt1040 -= 4;
  3432. if(anInt1041 > 0)
  3433. anInt1041 -= 4;
  3434. if(anInt1040 == 0 && anInt1041 == 0)
  3435. {
  3436. int l3 = (int)(Math.random() * 2000D);
  3437. if(l3 == 0)
  3438. anInt1040 = 1024;
  3439. if(l3 == 1)
  3440. anInt1041 = 1024;
  3441. }
  3442. }
  3443.  
  3444. private boolean saveWave(byte abyte0[], int i)
  3445. {
  3446. return abyte0 == null || signlink.wavesave(abyte0, i);
  3447. }
  3448.  
  3449. private void method60(int i)
  3450. {
  3451. RSInterface class9 = RSInterface.interfaceCache[i];
  3452. for(int j = 0; j < class9.children.length; j++)
  3453. {
  3454. if(class9.children[j] == -1)
  3455. break;
  3456. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  3457. if(class9_1.type == 1)
  3458. method60(class9_1.id);
  3459. class9_1.anInt246 = 0;
  3460. class9_1.anInt208 = 0;
  3461. }
  3462. }
  3463.  
  3464. private void drawHeadIcon()
  3465. {
  3466. if(anInt855 != 2)
  3467. return;
  3468. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  3469. if(spriteDrawX > -1 && loopCycle % 20 < 10)
  3470. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3471. }
  3472.  
  3473. private void mainGameProcessor()
  3474. {
  3475. if(anInt1104 > 1)
  3476. anInt1104--;
  3477. if(anInt1011 > 0)
  3478. anInt1011--;
  3479. for(int j = 0; j < 5; j++)
  3480. if(!parsePacket())
  3481. break;
  3482.  
  3483. if(!loggedIn)
  3484. return;
  3485. synchronized(mouseDetection.syncObject)
  3486. {
  3487. if(flagged)
  3488. {
  3489. if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
  3490. {
  3491. stream.createFrame(45);
  3492. stream.writeWordBigEndian(0);
  3493. int j2 = stream.currentOffset;
  3494. int j3 = 0;
  3495. for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
  3496. {
  3497. if(j2 - stream.currentOffset >= 240)
  3498. break;
  3499. j3++;
  3500. int l4 = mouseDetection.coordsY[j4];
  3501. if(l4 < 0)
  3502. l4 = 0;
  3503. else
  3504. if(l4 > 502)
  3505. l4 = 502;
  3506. int k5 = mouseDetection.coordsX[j4];
  3507. if(k5 < 0)
  3508. k5 = 0;
  3509. else
  3510. if(k5 > 764)
  3511. k5 = 764;
  3512. int i6 = l4 * 765 + k5;
  3513. if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  3514. {
  3515. k5 = -1;
  3516. l4 = -1;
  3517. i6 = 0x7ffff;
  3518. }
  3519. if(k5 == anInt1237 && l4 == anInt1238)
  3520. {
  3521. if(anInt1022 < 2047)
  3522. anInt1022++;
  3523. } else
  3524. {
  3525. int j6 = k5 - anInt1237;
  3526. anInt1237 = k5;
  3527. int k6 = l4 - anInt1238;
  3528. anInt1238 = l4;
  3529. if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  3530. {
  3531. j6 += 32;
  3532. k6 += 32;
  3533. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  3534. anInt1022 = 0;
  3535. } else
  3536. if(anInt1022 < 8)
  3537. {
  3538. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  3539. anInt1022 = 0;
  3540. } else
  3541. {
  3542. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  3543. anInt1022 = 0;
  3544. }
  3545. }
  3546. }
  3547.  
  3548. stream.writeBytes(stream.currentOffset - j2);
  3549. if(j3 >= mouseDetection.coordsIndex)
  3550. {
  3551. mouseDetection.coordsIndex = 0;
  3552. } else
  3553. {
  3554. mouseDetection.coordsIndex -= j3;
  3555. for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  3556. {
  3557. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  3558. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  3559. }
  3560.  
  3561. }
  3562. }
  3563. } else
  3564. {
  3565. mouseDetection.coordsIndex = 0;
  3566. }
  3567. }
  3568. if(super.clickMode3 != 0)
  3569. {
  3570. long l = (super.aLong29 - aLong1220) / 50L;
  3571. if(l > 4095L)
  3572. l = 4095L;
  3573. aLong1220 = super.aLong29;
  3574. int k2 = super.saveClickY;
  3575. if(k2 < 0)
  3576. k2 = 0;
  3577. else
  3578. if(k2 > 502)
  3579. k2 = 502;
  3580. int k3 = super.saveClickX;
  3581. if(k3 < 0)
  3582. k3 = 0;
  3583. else
  3584. if(k3 > 764)
  3585. k3 = 764;
  3586. int k4 = k2 * 765 + k3;
  3587. int j5 = 0;
  3588. if(super.clickMode3 == 2)
  3589. j5 = 1;
  3590. int l5 = (int)l;
  3591. stream.createFrame(241);
  3592. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3593. }
  3594. if(anInt1016 > 0)
  3595. anInt1016--;
  3596. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3597. aBoolean1017 = true;
  3598. if(aBoolean1017 && anInt1016 <= 0)
  3599. {
  3600. anInt1016 = 20;
  3601. aBoolean1017 = false;
  3602. stream.createFrame(86);
  3603. stream.writeWord(anInt1184);
  3604. stream.method432(minimapInt1);
  3605. }
  3606. if(super.awtFocus && !aBoolean954)
  3607. {
  3608. aBoolean954 = true;
  3609. stream.createFrame(3);
  3610. stream.writeWordBigEndian(1);
  3611. }
  3612. if(!super.awtFocus && aBoolean954)
  3613. {
  3614. aBoolean954 = false;
  3615. stream.createFrame(3);
  3616. stream.writeWordBigEndian(0);
  3617. }
  3618. loadingStages();
  3619. method115();
  3620. method90();
  3621. anInt1009++;
  3622. if(anInt1009 > 750)
  3623. dropClient();
  3624. method114();
  3625. method95();
  3626. method38();
  3627. anInt945++;
  3628. if(crossType != 0)
  3629. {
  3630. crossIndex += 20;
  3631. if(crossIndex >= 400)
  3632. crossType = 0;
  3633. }
  3634. if(atInventoryInterfaceType != 0)
  3635. {
  3636. atInventoryLoopCycle++;
  3637. if(atInventoryLoopCycle >= 15)
  3638. {
  3639. if(atInventoryInterfaceType == 2)
  3640. needDrawTabArea = true;
  3641. if(atInventoryInterfaceType == 3)
  3642. inputTaken = true;
  3643. atInventoryInterfaceType = 0;
  3644. }
  3645. }
  3646. if(activeInterfaceType != 0)
  3647. {
  3648. anInt989++;
  3649. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  3650. aBoolean1242 = true;
  3651. if(super.clickMode2 == 0)
  3652. {
  3653. if(activeInterfaceType == 2)
  3654. needDrawTabArea = true;
  3655. if(activeInterfaceType == 3)
  3656. inputTaken = true;
  3657. activeInterfaceType = 0;
  3658. if(aBoolean1242 && anInt989 >= 5)
  3659. {
  3660. lastActiveInvInterface = -1;
  3661. processRightClick();
  3662. if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  3663. {
  3664. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3665. int j1 = 0;
  3666. if(anInt913 == 1 && class9.contentType == 206)
  3667. j1 = 1;
  3668. if(class9.inv[mouseInvInterfaceIndex] <= 0)
  3669. j1 = 0;
  3670. if(class9.aBoolean235)
  3671. {
  3672. int l2 = anInt1085;
  3673. int l3 = mouseInvInterfaceIndex;
  3674. class9.inv[l3] = class9.inv[l2];
  3675. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3676. class9.inv[l2] = -1;
  3677. class9.invStackSizes[l2] = 0;
  3678. } else
  3679. if(j1 == 1)
  3680. {
  3681. int i3 = anInt1085;
  3682. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3683. if(i3 > i4)
  3684. {
  3685. class9.swapInventoryItems(i3, i3 - 1);
  3686. i3--;
  3687. } else
  3688. if(i3 < i4)
  3689. {
  3690. class9.swapInventoryItems(i3, i3 + 1);
  3691. i3++;
  3692. }
  3693.  
  3694. } else
  3695. {
  3696. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  3697. }
  3698. stream.createFrame(214);
  3699. stream.method433(anInt1084);
  3700. stream.method424(j1);
  3701. stream.method433(anInt1085);
  3702. stream.method431(mouseInvInterfaceIndex);
  3703. }
  3704. } else
  3705. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  3706. determineMenuSize();
  3707. else
  3708. if(menuActionRow > 0)
  3709. doAction(menuActionRow - 1);
  3710. atInventoryLoopCycle = 10;
  3711. super.clickMode3 = 0;
  3712. }
  3713. }
  3714. if(WorldController.anInt470 != -1)
  3715. {
  3716. int k = WorldController.anInt470;
  3717. int k1 = WorldController.anInt471;
  3718. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  3719. WorldController.anInt470 = -1;
  3720. if(flag)
  3721. {
  3722. crossX = super.saveClickX;
  3723. crossY = super.saveClickY;
  3724. crossType = 1;
  3725. crossIndex = 0;
  3726. }
  3727. }
  3728. if(super.clickMode3 == 1 && aString844 != null)
  3729. {
  3730. aString844 = null;
  3731. inputTaken = true;
  3732. super.clickMode3 = 0;
  3733. }
  3734. processMenuClick();
  3735. processMainScreenClick();
  3736. processTabClick();
  3737. processChatModeClick();
  3738. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  3739. anInt1213++;
  3740. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3741. if (anInt1501 < 100) {
  3742. anInt1501++;
  3743. if (anInt1501 == 100) {
  3744. if (anInt1500 != 0) {
  3745. inputTaken = true;
  3746. }
  3747. if (anInt1044 != 0) {
  3748. needDrawTabArea = true;
  3749. }
  3750. }
  3751. }
  3752. } else if (anInt1501 > 0) {
  3753. anInt1501--;
  3754. }
  3755. if(loadingStage == 2)
  3756. method108();
  3757. if(loadingStage == 2 && aBoolean1160)
  3758. calcCameraPos();
  3759. for(int i1 = 0; i1 < 5; i1++)
  3760. anIntArray1030[i1]++;
  3761.  
  3762. method73();
  3763. super.idleTime++;
  3764. if(super.idleTime > 4500)
  3765. {
  3766. anInt1011 = 250;
  3767. super.idleTime -= 500;
  3768. stream.createFrame(202);
  3769. }
  3770. anInt988++;
  3771. if(anInt988 > 500)
  3772. {
  3773. anInt988 = 0;
  3774. int l1 = (int)(Math.random() * 8D);
  3775. if((l1 & 1) == 1)
  3776. anInt1278 += anInt1279;
  3777. if((l1 & 2) == 2)
  3778. anInt1131 += anInt1132;
  3779. if((l1 & 4) == 4)
  3780. anInt896 += anInt897;
  3781. }
  3782. if(anInt1278 < -50)
  3783. anInt1279 = 2;
  3784. if(anInt1278 > 50)
  3785. anInt1279 = -2;
  3786. if(anInt1131 < -55)
  3787. anInt1132 = 2;
  3788. if(anInt1131 > 55)
  3789. anInt1132 = -2;
  3790. if(anInt896 < -40)
  3791. anInt897 = 1;
  3792. if(anInt896 > 40)
  3793. anInt897 = -1;
  3794. anInt1254++;
  3795. if(anInt1254 > 500)
  3796. {
  3797. anInt1254 = 0;
  3798. int i2 = (int)(Math.random() * 8D);
  3799. if((i2 & 1) == 1)
  3800. minimapInt2 += anInt1210;
  3801. if((i2 & 2) == 2)
  3802. minimapInt3 += anInt1171;
  3803. }
  3804. if(minimapInt2 < -60)
  3805. anInt1210 = 2;
  3806. if(minimapInt2 > 60)
  3807. anInt1210 = -2;
  3808. if(minimapInt3 < -20)
  3809. anInt1171 = 1;
  3810. if(minimapInt3 > 10)
  3811. anInt1171 = -1;
  3812. anInt1010++;
  3813. if(anInt1010 > 50)
  3814. stream.createFrame(0);
  3815. try
  3816. {
  3817. if(socketStream != null && stream.currentOffset > 0)
  3818. {
  3819. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3820. stream.currentOffset = 0;
  3821. anInt1010 = 0;
  3822. }
  3823. }
  3824. catch(IOException _ex)
  3825. {
  3826. dropClient();
  3827. }
  3828. catch(Exception exception)
  3829. {
  3830. resetLogout();
  3831. }
  3832. }
  3833.  
  3834. private void method63()
  3835. {
  3836. Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  3837. for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  3838. if(class30_sub1.anInt1294 == -1)
  3839. {
  3840. class30_sub1.anInt1302 = 0;
  3841. method89(class30_sub1);
  3842. } else
  3843. {
  3844. class30_sub1.unlink();
  3845. }
  3846.  
  3847. }
  3848.  
  3849. private void resetImageProducers()
  3850. {
  3851. if(aRSImageProducer_1107 != null)
  3852. return;
  3853. super.fullGameScreen = null;
  3854. aRSImageProducer_1166 = null;
  3855. aRSImageProducer_1164 = null;
  3856. aRSImageProducer_1163 = null;
  3857. aRSImageProducer_1165 = null;
  3858. aRSImageProducer_1123 = null;
  3859. aRSImageProducer_1124 = null;
  3860. aRSImageProducer_1125 = null;
  3861. aRSImageProducer_1110 = new RSImageProducer(128, 265, getGameComponent());
  3862. DrawingArea.setAllPixelsToZero();
  3863. aRSImageProducer_1111 = new RSImageProducer(128, 265, getGameComponent());
  3864. DrawingArea.setAllPixelsToZero();
  3865. aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
  3866. DrawingArea.setAllPixelsToZero();
  3867. aRSImageProducer_1108 = new RSImageProducer(360, 132, getGameComponent());
  3868. DrawingArea.setAllPixelsToZero();
  3869. aRSImageProducer_1109 = new RSImageProducer(360, 200, getGameComponent());
  3870. DrawingArea.setAllPixelsToZero();
  3871. aRSImageProducer_1112 = new RSImageProducer(202, 238, getGameComponent());
  3872. DrawingArea.setAllPixelsToZero();
  3873. aRSImageProducer_1113 = new RSImageProducer(203, 238, getGameComponent());
  3874. DrawingArea.setAllPixelsToZero();
  3875. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  3876. DrawingArea.setAllPixelsToZero();
  3877. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  3878. DrawingArea.setAllPixelsToZero();
  3879. if(titleStreamLoader != null)
  3880. {
  3881. drawLogo();
  3882. loadTitleScreen();
  3883. }
  3884. welcomeScreenRaised = true;
  3885. }
  3886.  
  3887. void drawLoadingText(int i, String s)
  3888. {
  3889. anInt1079 = i;
  3890. aString1049 = s;
  3891. resetImageProducers();
  3892. if(titleStreamLoader == null)
  3893. {
  3894. super.drawLoadingText(i, s);
  3895. return;
  3896. }
  3897. aRSImageProducer_1109.initDrawingArea();
  3898. char c = '\u0168';
  3899. char c1 = '\310';
  3900. byte byte1 = 20;
  3901. chatTextDrawingArea.drawText(0xffffff, "The-Genesis is loading-Please wait...", c1 / 2 - 26 - byte1, c / 2);
  3902. int j = c1 / 2 - 18 - byte1;
  3903. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  3904. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3905. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  3906. DrawingArea.drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3907. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3908. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3909. if(welcomeScreenRaised)
  3910. {
  3911. welcomeScreenRaised = false;
  3912. if(!aBoolean831)
  3913. {
  3914. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3915. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3916. }
  3917. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3918. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3919. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3920. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3921. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3922. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3923. }
  3924. }
  3925.  
  3926. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag,
  3927. int j1)
  3928. {
  3929. int anInt992;
  3930. if(aBoolean972)
  3931. anInt992 = 32;
  3932. else
  3933. anInt992 = 0;
  3934. aBoolean972 = false;
  3935. if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  3936. {
  3937. class9.scrollPosition -= anInt1213 * 4;
  3938. if(flag)
  3939. {
  3940. needDrawTabArea = true;
  3941. }
  3942. } else
  3943. if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  3944. {
  3945. class9.scrollPosition += anInt1213 * 4;
  3946. if(flag)
  3947. {
  3948. needDrawTabArea = true;
  3949. }
  3950. } else
  3951. if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  3952. {
  3953. int l1 = ((j - 32) * j) / j1;
  3954. if(l1 < 8)
  3955. l1 = 8;
  3956. int i2 = l - i1 - 16 - l1 / 2;
  3957. int j2 = j - 32 - l1;
  3958. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3959. if(flag)
  3960. needDrawTabArea = true;
  3961. aBoolean972 = true;
  3962. }
  3963. }
  3964.  
  3965. private boolean method66(int i, int j, int k)
  3966. {
  3967. int i1 = i >> 14 & 0x7fff;
  3968. int j1 = worldController.method304(plane, k, j, i);
  3969. if(j1 == -1)
  3970. return false;
  3971. int k1 = j1 & 0x1f;
  3972. int l1 = j1 >> 6 & 3;
  3973. if(k1 == 10 || k1 == 11 || k1 == 22)
  3974. {
  3975. ObjectDef class46 = ObjectDef.forID(i1);
  3976. int i2;
  3977. int j2;
  3978. if(l1 == 0 || l1 == 2)
  3979. {
  3980. i2 = class46.anInt744;
  3981. j2 = class46.anInt761;
  3982. } else
  3983. {
  3984. i2 = class46.anInt761;
  3985. j2 = class46.anInt744;
  3986. }
  3987. int k2 = class46.anInt768;
  3988. if(l1 != 0)
  3989. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3990. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3991. } else
  3992. {
  3993. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3994. }
  3995. crossX = super.saveClickX;
  3996. crossY = super.saveClickY;
  3997. crossType = 2;
  3998. crossIndex = 0;
  3999. return true;
  4000. }
  4001.  
  4002. private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k)
  4003. {
  4004. byte abyte0[] = null;
  4005. int l = 5;
  4006. try
  4007. {
  4008. if(decompressors[0] != null)
  4009. abyte0 = decompressors[0].decompress(i);
  4010. }
  4011. catch(Exception _ex) { }
  4012. if(abyte0 != null)
  4013. {
  4014. // aCRC32_930.reset();
  4015. // aCRC32_930.update(abyte0);
  4016. // int i1 = (int)aCRC32_930.getValue();
  4017. // if(i1 != j)
  4018. }
  4019. if(abyte0 != null)
  4020. {
  4021. StreamLoader streamLoader = new StreamLoader(abyte0);
  4022. return streamLoader;
  4023. }
  4024. int j1 = 0;
  4025. while(abyte0 == null)
  4026. {
  4027. String s2 = "Unknown error";
  4028. drawLoadingText(k, "Requesting " + s);
  4029. Object obj = null;
  4030. try
  4031. {
  4032. int k1 = 0;
  4033. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  4034. byte abyte1[] = new byte[6];
  4035. datainputstream.readFully(abyte1, 0, 6);
  4036. Stream stream = new Stream(abyte1);
  4037. stream.currentOffset = 3;
  4038. int i2 = stream.read3Bytes() + 6;
  4039. int j2 = 6;
  4040. abyte0 = new byte[i2];
  4041. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  4042.  
  4043. while(j2 < i2)
  4044. {
  4045. int l2 = i2 - j2;
  4046. if(l2 > 1000)
  4047. l2 = 1000;
  4048. int j3 = datainputstream.read(abyte0, j2, l2);
  4049. if(j3 < 0)
  4050. {
  4051. s2 = "Length error: " + j2 + "/" + i2;
  4052. throw new IOException("EOF");
  4053. }
  4054. j2 += j3;
  4055. int k3 = (j2 * 100) / i2;
  4056. if(k3 != k1)
  4057. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  4058. k1 = k3;
  4059. }
  4060. datainputstream.close();
  4061. try
  4062. {
  4063. if(decompressors[0] != null)
  4064. decompressors[0].method234(abyte0.length, abyte0, i);
  4065. }
  4066. catch(Exception _ex)
  4067. {
  4068. decompressors[0] = null;
  4069. }
  4070. /* if(abyte0 != null)
  4071. {
  4072. aCRC32_930.reset();
  4073. aCRC32_930.update(abyte0);
  4074. int i3 = (int)aCRC32_930.getValue();
  4075. if(i3 != j)
  4076. {
  4077. abyte0 = null;
  4078. j1++;
  4079. s2 = "Checksum error: " + i3;
  4080. }
  4081. }
  4082. */
  4083. }
  4084. catch(IOException ioexception)
  4085. {
  4086. if(s2.equals("Unknown error"))
  4087. s2 = "Connection error";
  4088. abyte0 = null;
  4089. }
  4090. catch(NullPointerException _ex)
  4091. {
  4092. s2 = "Null error";
  4093. abyte0 = null;
  4094. if(!signlink.reporterror)
  4095. return null;
  4096. }
  4097. catch(ArrayIndexOutOfBoundsException _ex)
  4098. {
  4099. s2 = "Bounds error";
  4100. abyte0 = null;
  4101. if(!signlink.reporterror)
  4102. return null;
  4103. }
  4104.  
  4105. catch(Exception _ex)
  4106. {
  4107. s2 = "Unexpected error";
  4108. abyte0 = null;
  4109. if(!signlink.reporterror)
  4110. return null;
  4111. }
  4112. if(abyte0 == null)
  4113. {
  4114. for(int l1 = l; l1 > 0; l1--)
  4115. {
  4116. if(j1 >= 3)
  4117. {
  4118. drawLoadingText(k, "Game updated - please reload page");
  4119. l1 = 10;
  4120. } else
  4121. {
  4122. drawLoadingText(k, s2 + " - Retrying in " + l1);
  4123. }
  4124. try
  4125. {
  4126. Thread.sleep(1000L);
  4127. }
  4128. catch(Exception _ex) { }
  4129. }
  4130.  
  4131. l *= 2;
  4132. if(l > 60)
  4133. l = 60;
  4134. aBoolean872 = !aBoolean872;
  4135. }
  4136.  
  4137. }
  4138.  
  4139. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  4140. return streamLoader_1;
  4141. }
  4142.  
  4143. private void dropClient()
  4144. {
  4145. if(anInt1011 > 0)
  4146. {
  4147. resetLogout();
  4148. return;
  4149. }
  4150. aRSImageProducer_1165.initDrawingArea();
  4151. aTextDrawingArea_1271.drawText(0, "Connection lost", 144, 257);
  4152. aTextDrawingArea_1271.drawText(0xffffff, "Connection lost", 143, 256);
  4153. aTextDrawingArea_1271.drawText(0, "Please wait - attempting to reestablish", 159, 257);
  4154. aTextDrawingArea_1271.drawText(0xffffff, "Please wait - attempting to reestablish", 158, 256);
  4155. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  4156. anInt1021 = 0;
  4157. destX = 0;
  4158. RSSocket rsSocket = socketStream;
  4159. loggedIn = false;
  4160. loginFailures = 0;
  4161. login(myUsername, myPassword, true);
  4162. if(!loggedIn)
  4163. resetLogout();
  4164. try
  4165. {
  4166. rsSocket.close();
  4167. }
  4168. catch(Exception _ex)
  4169. {
  4170. }
  4171. }
  4172.  
  4173. private void doAction(int i)
  4174. {
  4175. if(i < 0)
  4176. return;
  4177. if(inputDialogState != 0)
  4178. {
  4179. inputDialogState = 0;
  4180. inputTaken = true;
  4181. }
  4182. int j = menuActionCmd2[i];
  4183. int k = menuActionCmd3[i];
  4184. int l = menuActionID[i];
  4185. int i1 = menuActionCmd1[i];
  4186. if(l >= 2000)
  4187. l -= 2000;
  4188. if(l == 582)
  4189. {
  4190. NPC npc = npcArray[i1];
  4191. if(npc != null)
  4192. {
  4193. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  4194. crossX = super.saveClickX;
  4195. crossY = super.saveClickY;
  4196. crossType = 2;
  4197. crossIndex = 0;
  4198. stream.createFrame(57);
  4199. stream.method432(anInt1285);
  4200. stream.method432(i1);
  4201. stream.method431(anInt1283);
  4202. stream.method432(anInt1284);
  4203. }
  4204. }
  4205. if(l == 234)
  4206. {
  4207. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4208. if(!flag1)
  4209. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4210. crossX = super.saveClickX;
  4211. crossY = super.saveClickY;
  4212. crossType = 2;
  4213. crossIndex = 0;
  4214. stream.createFrame(236);
  4215. stream.method431(k + baseY);
  4216. stream.writeWord(i1);
  4217. stream.method431(j + baseX);
  4218. }
  4219. if(l == 62 && method66(i1, k, j))
  4220. {
  4221. stream.createFrame(192);
  4222. stream.writeWord(anInt1284);
  4223. stream.method431(i1 >> 14 & 0x7fff);
  4224. stream.method433(k + baseY);
  4225. stream.method431(anInt1283);
  4226. stream.method433(j + baseX);
  4227. stream.writeWord(anInt1285);
  4228. }
  4229. if(l == 511)
  4230. {
  4231. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4232. if(!flag2)
  4233. flag2 = 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(25);
  4239. stream.method431(anInt1284);
  4240. stream.method432(anInt1285);
  4241. stream.writeWord(i1);
  4242. stream.method432(k + baseY);
  4243. stream.method433(anInt1283);
  4244. stream.writeWord(j + baseX);
  4245. }
  4246. if(l == 74)
  4247. {
  4248. stream.createFrame(122);
  4249. stream.method433(k);
  4250. stream.method432(j);
  4251. stream.method431(i1);
  4252. atInventoryLoopCycle = 0;
  4253. atInventoryInterface = k;
  4254. atInventoryIndex = j;
  4255. atInventoryInterfaceType = 2;
  4256. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4257. atInventoryInterfaceType = 1;
  4258. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4259. atInventoryInterfaceType = 3;
  4260. }
  4261. if (l == 315) {
  4262. RSInterface class9 = RSInterface.interfaceCache[k];
  4263. boolean flag8 = true;
  4264. if (class9.contentType > 0)
  4265. flag8 = promptUserForInput(class9);
  4266. if (flag8) {
  4267.  
  4268. switch(k){
  4269. case 19144:
  4270. sendFrame248(15106,3213);
  4271. method60(15106);
  4272. inputTaken = true;
  4273. break;
  4274. default:
  4275. stream.createFrame(185);
  4276. stream.writeWord(k);
  4277. break;
  4278.  
  4279. }
  4280. }
  4281. }
  4282. if(l == 561)
  4283. {
  4284. Player player = playerArray[i1];
  4285. if(player != null)
  4286. {
  4287. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  4288. crossX = super.saveClickX;
  4289. crossY = super.saveClickY;
  4290. crossType = 2;
  4291. crossIndex = 0;
  4292. anInt1188 += i1;
  4293. if(anInt1188 >= 90)
  4294. {
  4295. stream.createFrame(136);
  4296. anInt1188 = 0;
  4297. }
  4298. stream.createFrame(128);
  4299. stream.writeWord(i1);
  4300. }
  4301. }
  4302. if(l == 20)
  4303. {
  4304. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  4305. if(class30_sub2_sub4_sub1_sub1_1 != null)
  4306. {
  4307. 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]);
  4308. crossX = super.saveClickX;
  4309. crossY = super.saveClickY;
  4310. crossType = 2;
  4311. crossIndex = 0;
  4312. stream.createFrame(155);
  4313. stream.method431(i1);
  4314. }
  4315. }
  4316. if(l == 779)
  4317. {
  4318. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  4319. if(class30_sub2_sub4_sub1_sub2_1 != null)
  4320. {
  4321. 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]);
  4322. crossX = super.saveClickX;
  4323. crossY = super.saveClickY;
  4324. crossType = 2;
  4325. crossIndex = 0;
  4326. stream.createFrame(153);
  4327. stream.method431(i1);
  4328. }
  4329. }
  4330. if(l == 516)
  4331. if(!menuOpen)
  4332. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  4333. else
  4334. worldController.method312(k - 4, j - 4);
  4335. if(l == 1062)
  4336. {
  4337. anInt924 += baseX;
  4338. if(anInt924 >= 113)
  4339. {
  4340. stream.createFrame(183);
  4341. stream.writeDWordBigEndian(0xe63271);
  4342. anInt924 = 0;
  4343. }
  4344. method66(i1, k, j);
  4345. stream.createFrame(228);
  4346. stream.method432(i1 >> 14 & 0x7fff);
  4347. stream.method432(k + baseY);
  4348. stream.writeWord(j + baseX);
  4349. }
  4350. if(l == 679 && !aBoolean1149)
  4351. {
  4352. stream.createFrame(40);
  4353. stream.writeWord(k);
  4354. aBoolean1149 = true;
  4355. }
  4356. if(l == 431)
  4357. {
  4358. stream.createFrame(129);
  4359. stream.method432(j);
  4360. stream.writeWord(k);
  4361. stream.method432(i1);
  4362. atInventoryLoopCycle = 0;
  4363. atInventoryInterface = k;
  4364. atInventoryIndex = j;
  4365. atInventoryInterfaceType = 2;
  4366. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4367. atInventoryInterfaceType = 1;
  4368. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4369. atInventoryInterfaceType = 3;
  4370. }
  4371. if(l == 337 || l == 42 || l == 792 || l == 322)
  4372. {
  4373. String s = menuActionName[i];
  4374. int k1 = s.indexOf("@whi@");
  4375. if(k1 != -1)
  4376. {
  4377. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  4378. if(l == 337)
  4379. addFriend(l3);
  4380. if(l == 42)
  4381. addIgnore(l3);
  4382. if(l == 792)
  4383. delFriend(l3);
  4384. if(l == 322)
  4385. delIgnore(l3);
  4386. }
  4387. }
  4388. if(l == 53)
  4389. {
  4390. stream.createFrame(135);
  4391. stream.method431(j);
  4392. stream.method432(k);
  4393. stream.method431(i1);
  4394. atInventoryLoopCycle = 0;
  4395. atInventoryInterface = k;
  4396. atInventoryIndex = j;
  4397. atInventoryInterfaceType = 2;
  4398. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4399. atInventoryInterfaceType = 1;
  4400. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4401. atInventoryInterfaceType = 3;
  4402. }
  4403. if(l == 539)
  4404. {
  4405. stream.createFrame(16);
  4406. stream.method432(i1);
  4407. stream.method433(j);
  4408. stream.method433(k);
  4409. atInventoryLoopCycle = 0;
  4410. atInventoryInterface = k;
  4411. atInventoryIndex = j;
  4412. atInventoryInterfaceType = 2;
  4413. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4414. atInventoryInterfaceType = 1;
  4415. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4416. atInventoryInterfaceType = 3;
  4417. }
  4418. if(l == 484 || l == 6)
  4419. {
  4420. String s1 = menuActionName[i];
  4421. int l1 = s1.indexOf("@whi@");
  4422. if(l1 != -1)
  4423. {
  4424. s1 = s1.substring(l1 + 5).trim();
  4425. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  4426. boolean flag9 = false;
  4427. for(int j3 = 0; j3 < playerCount; j3++)
  4428. {
  4429. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  4430. 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))
  4431. continue;
  4432. 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]);
  4433. if(l == 484)
  4434. {
  4435. stream.createFrame(139);
  4436. stream.method431(playerIndices[j3]);
  4437. }
  4438. if(l == 6)
  4439. {
  4440. anInt1188 += i1;
  4441. if(anInt1188 >= 90)
  4442. {
  4443. stream.createFrame(136);
  4444. anInt1188 = 0;
  4445. }
  4446. stream.createFrame(128);
  4447. stream.writeWord(playerIndices[j3]);
  4448. }
  4449. flag9 = true;
  4450. break;
  4451. }
  4452.  
  4453. if(!flag9)
  4454. pushMessage("Unable to find " + s7, 0, "");
  4455. }
  4456. }
  4457. if(l == 870)
  4458. {
  4459. stream.createFrame(53);
  4460. stream.writeWord(j);
  4461. stream.method432(anInt1283);
  4462. stream.method433(i1);
  4463. stream.writeWord(anInt1284);
  4464. stream.method431(anInt1285);
  4465. stream.writeWord(k);
  4466. atInventoryLoopCycle = 0;
  4467. atInventoryInterface = k;
  4468. atInventoryIndex = j;
  4469. atInventoryInterfaceType = 2;
  4470. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4471. atInventoryInterfaceType = 1;
  4472. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4473. atInventoryInterfaceType = 3;
  4474. }
  4475. if(l == 847)
  4476. {
  4477. stream.createFrame(87);
  4478. stream.method432(i1);
  4479. stream.writeWord(k);
  4480. stream.method432(j);
  4481. atInventoryLoopCycle = 0;
  4482. atInventoryInterface = k;
  4483. atInventoryIndex = j;
  4484. atInventoryInterfaceType = 2;
  4485. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4486. atInventoryInterfaceType = 1;
  4487. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4488. atInventoryInterfaceType = 3;
  4489. }
  4490. if(l == 626)
  4491. {
  4492. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4493. spellSelected = 1;
  4494. spellID = class9_1.id;
  4495. anInt1137 = k;
  4496. spellUsableOn = class9_1.spellUsableOn;
  4497. itemSelected = 0;
  4498. needDrawTabArea = true;
  4499. String s4 = class9_1.selectedActionName;
  4500. if(s4.indexOf(" ") != -1)
  4501. s4 = s4.substring(0, s4.indexOf(" "));
  4502. String s8 = class9_1.selectedActionName;
  4503. if(s8.indexOf(" ") != -1)
  4504. s8 = s8.substring(s8.indexOf(" ") + 1);
  4505. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4506. //class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265, 0xffffff);
  4507. //class9_1.sprite1.drawSprite(200,200);
  4508. //System.out.println("Sprite: " + class9_1.sprite1.toString());
  4509. if(spellUsableOn == 16)
  4510. {
  4511. needDrawTabArea = true;
  4512. tabID = 3;
  4513. tabAreaAltered = true;
  4514. }
  4515. return;
  4516. }
  4517. if(l == 78)
  4518. {
  4519. stream.createFrame(117);
  4520. stream.method433(k);
  4521. stream.method433(i1);
  4522. stream.method431(j);
  4523. atInventoryLoopCycle = 0;
  4524. atInventoryInterface = k;
  4525. atInventoryIndex = j;
  4526. atInventoryInterfaceType = 2;
  4527. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4528. atInventoryInterfaceType = 1;
  4529. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4530. atInventoryInterfaceType = 3;
  4531. }
  4532. if(l == 27)
  4533. {
  4534. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4535. if(class30_sub2_sub4_sub1_sub2_2 != null)
  4536. {
  4537. 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]);
  4538. crossX = super.saveClickX;
  4539. crossY = super.saveClickY;
  4540. crossType = 2;
  4541. crossIndex = 0;
  4542. anInt986 += i1;
  4543. if(anInt986 >= 54)
  4544. {
  4545. stream.createFrame(189);
  4546. stream.writeWordBigEndian(234);
  4547. anInt986 = 0;
  4548. }
  4549. stream.createFrame(73);
  4550. stream.method431(i1);
  4551. }
  4552. }
  4553. if(l == 213)
  4554. {
  4555. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4556. if(!flag3)
  4557. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4558. crossX = super.saveClickX;
  4559. crossY = super.saveClickY;
  4560. crossType = 2;
  4561. crossIndex = 0;
  4562. stream.createFrame(79);
  4563. stream.method431(k + baseY);
  4564. stream.writeWord(i1);
  4565. stream.method432(j + baseX);
  4566. }
  4567. if(l == 632)
  4568. {
  4569. stream.createFrame(145);
  4570. stream.method432(k);
  4571. stream.method432(j);
  4572. stream.method432(i1);
  4573. atInventoryLoopCycle = 0;
  4574. atInventoryInterface = k;
  4575. atInventoryIndex = j;
  4576. atInventoryInterfaceType = 2;
  4577. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4578. atInventoryInterfaceType = 1;
  4579. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4580. atInventoryInterfaceType = 3;
  4581. }
  4582. if(l == 1004) {
  4583. needDrawTabArea = true;
  4584. tabID = 7;
  4585. tabAreaAltered = true;
  4586. }
  4587. logC = false;
  4588. drawMinimap();
  4589. if(l == 1003) {
  4590. clanChatMode = 2;
  4591. aBoolean1233 = true;
  4592. inputTaken = true;
  4593. }
  4594. if(l == 1002) {
  4595. clanChatMode = 1;
  4596. aBoolean1233 = true;
  4597. inputTaken = true;
  4598. }
  4599. if(l == 1001) {
  4600. clanChatMode = 0;
  4601. aBoolean1233 = true;
  4602. inputTaken = true;
  4603. }
  4604. if(l == 1000) {
  4605. cButtonCPos = 4;
  4606. chatTypeView = 11;
  4607. aBoolean1233 = true;
  4608. inputTaken = true;
  4609. }
  4610. if(l == 999) {
  4611. cButtonCPos = 0;
  4612. chatTypeView = 0;
  4613. aBoolean1233 = true;
  4614. inputTaken = true;
  4615. }
  4616. if(l == 998) {
  4617. cButtonCPos = 1;
  4618. chatTypeView = 5;
  4619. aBoolean1233 = true;
  4620. inputTaken = true;
  4621. }
  4622. if(l == 997) {
  4623. publicChatMode = 3;
  4624. aBoolean1233 = true;
  4625. inputTaken = true;
  4626. }
  4627. if(l == 996) {
  4628. publicChatMode = 2;
  4629. aBoolean1233 = true;
  4630. inputTaken = true;
  4631. }
  4632. if(l == 995) {
  4633. publicChatMode = 1;
  4634. aBoolean1233 = true;
  4635. inputTaken = true;
  4636. }
  4637. if(l == 994) {
  4638. publicChatMode = 0;
  4639. aBoolean1233 = true;
  4640. inputTaken = true;
  4641. }
  4642. if(l == 993) {
  4643. cButtonCPos = 2;
  4644. chatTypeView = 1;
  4645. aBoolean1233 = true;
  4646. inputTaken = true;
  4647. }
  4648. if(l == 992) {
  4649. privateChatMode = 2;
  4650. aBoolean1233 = true;
  4651. inputTaken = true;
  4652. }
  4653. if(l == 991) {
  4654. privateChatMode = 1;
  4655. aBoolean1233 = true;
  4656. inputTaken = true;
  4657. }
  4658. if(l == 990) {
  4659. privateChatMode = 0;
  4660. aBoolean1233 = true;
  4661. inputTaken = true;
  4662. }
  4663. if(l == 989) {
  4664. cButtonCPos = 3;
  4665. chatTypeView = 2;
  4666. aBoolean1233 = true;
  4667. inputTaken = true;
  4668. }
  4669. if(l == 987) {
  4670. tradeMode = 2;
  4671. aBoolean1233 = true;
  4672. inputTaken = true;
  4673. }
  4674. if(l == 986) {
  4675. tradeMode = 1;
  4676. aBoolean1233 = true;
  4677. inputTaken = true;
  4678. }
  4679. if(l == 985) {
  4680. tradeMode = 0;
  4681. aBoolean1233 = true;
  4682. inputTaken = true;
  4683. }
  4684. if(l == 984) {
  4685. cButtonCPos = 5;
  4686. chatTypeView = 3;
  4687. aBoolean1233 = true;
  4688. inputTaken = true;
  4689. }
  4690. if(l == 983) {
  4691. duelMode = 2;
  4692. aBoolean1233 = true;
  4693. inputTaken = true;
  4694. }
  4695. if(l == 982) {
  4696. duelMode = 1;
  4697. aBoolean1233 = true;
  4698. inputTaken = true;
  4699. }
  4700. if(l == 981) {
  4701. duelMode = 0;
  4702. aBoolean1233 = true;
  4703. inputTaken = true;
  4704. }
  4705. if(l == 980) {
  4706. cButtonCPos = 6;
  4707. chatTypeView = 4;
  4708. aBoolean1233 = true;
  4709. inputTaken = true;
  4710. }
  4711. if(l == 493)
  4712. {
  4713. stream.createFrame(75);
  4714. stream.method433(k);
  4715. stream.method431(j);
  4716. stream.method432(i1);
  4717. atInventoryLoopCycle = 0;
  4718. atInventoryInterface = k;
  4719. atInventoryIndex = j;
  4720. atInventoryInterfaceType = 2;
  4721. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4722. atInventoryInterfaceType = 1;
  4723. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4724. atInventoryInterfaceType = 3;
  4725. }
  4726. if(l == 652)
  4727. {
  4728. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4729. if(!flag4)
  4730. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4731. crossX = super.saveClickX;
  4732. crossY = super.saveClickY;
  4733. crossType = 2;
  4734. crossIndex = 0;
  4735. stream.createFrame(156);
  4736. stream.method432(j + baseX);
  4737. stream.method431(k + baseY);
  4738. stream.method433(i1);
  4739. }
  4740. if(l == 94)
  4741. {
  4742. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4743. if(!flag5)
  4744. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4745. crossX = super.saveClickX;
  4746. crossY = super.saveClickY;
  4747. crossType = 2;
  4748. crossIndex = 0;
  4749. stream.createFrame(181);
  4750. stream.method431(k + baseY);
  4751. stream.writeWord(i1);
  4752. stream.method431(j + baseX);
  4753. stream.method432(anInt1137);
  4754. }
  4755. if(l == 646)
  4756. {
  4757. stream.createFrame(185);
  4758. stream.writeWord(k);
  4759. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4760. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
  4761. {
  4762. int i2 = class9_2.valueIndexArray[0][1];
  4763. if(variousSettings[i2] != class9_2.anIntArray212[0])
  4764. {
  4765. variousSettings[i2] = class9_2.anIntArray212[0];
  4766. method33(i2);
  4767. needDrawTabArea = true;
  4768. }
  4769. }
  4770. }
  4771. if(l == 225)
  4772. {
  4773. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4774. if(class30_sub2_sub4_sub1_sub1_2 != null)
  4775. {
  4776. 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]);
  4777. crossX = super.saveClickX;
  4778. crossY = super.saveClickY;
  4779. crossType = 2;
  4780. crossIndex = 0;
  4781. anInt1226 += i1;
  4782. if(anInt1226 >= 85)
  4783. {
  4784. stream.createFrame(230);
  4785. stream.writeWordBigEndian(239);
  4786. anInt1226 = 0;
  4787. }
  4788. stream.createFrame(17);
  4789. stream.method433(i1);
  4790. }
  4791. }
  4792. if(l == 965)
  4793. {
  4794. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4795. if(class30_sub2_sub4_sub1_sub1_3 != null)
  4796. {
  4797. 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]);
  4798. crossX = super.saveClickX;
  4799. crossY = super.saveClickY;
  4800. crossType = 2;
  4801. crossIndex = 0;
  4802. anInt1134++;
  4803. if(anInt1134 >= 96)
  4804. {
  4805. stream.createFrame(152);
  4806. stream.writeWordBigEndian(88);
  4807. anInt1134 = 0;
  4808. }
  4809. stream.createFrame(21);
  4810. stream.writeWord(i1);
  4811. }
  4812. }
  4813. if(l == 413)
  4814. {
  4815. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4816. if(class30_sub2_sub4_sub1_sub1_4 != null)
  4817. {
  4818. 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]);
  4819. crossX = super.saveClickX;
  4820. crossY = super.saveClickY;
  4821. crossType = 2;
  4822. crossIndex = 0;
  4823. stream.createFrame(131);
  4824. stream.method433(i1);
  4825. stream.method432(anInt1137);
  4826. }
  4827. }
  4828. if(l == 200)
  4829. clearTopInterfaces();
  4830. if(l == 1025)
  4831. {
  4832. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4833. if(class30_sub2_sub4_sub1_sub1_5 != null)
  4834. {
  4835. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4836. if(entityDef.childrenIDs != null)
  4837. entityDef = entityDef.method161();
  4838. if(entityDef != null)
  4839. {
  4840. String s9;
  4841. if(entityDef.description != null)
  4842. s9 = new String(entityDef.description);
  4843. else
  4844. s9 = "It's a " + entityDef.name + ".";
  4845. pushMessage(s9, 0, "");
  4846. }
  4847. }
  4848. }
  4849. if(l == 900)
  4850. {
  4851. method66(i1, k, j);
  4852. stream.createFrame(252);
  4853. stream.method433(i1 >> 14 & 0x7fff);
  4854. stream.method431(k + baseY);
  4855. stream.method432(j + baseX);
  4856. }
  4857. if(l == 412)
  4858. {
  4859. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4860. if(class30_sub2_sub4_sub1_sub1_6 != null)
  4861. {
  4862. 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]);
  4863. crossX = super.saveClickX;
  4864. crossY = super.saveClickY;
  4865. crossType = 2;
  4866. crossIndex = 0;
  4867. stream.createFrame(72);
  4868. stream.method432(i1);
  4869. }
  4870. }
  4871. if(l == 365)
  4872. {
  4873. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4874. if(class30_sub2_sub4_sub1_sub2_3 != null)
  4875. {
  4876. 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]);
  4877. crossX = super.saveClickX;
  4878. crossY = super.saveClickY;
  4879. crossType = 2;
  4880. crossIndex = 0;
  4881. stream.createFrame(249);
  4882. stream.method432(i1);
  4883. stream.method431(anInt1137);
  4884. }
  4885. }
  4886. if(l == 729)
  4887. {
  4888. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4889. if(class30_sub2_sub4_sub1_sub2_4 != null)
  4890. {
  4891. 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]);
  4892. crossX = super.saveClickX;
  4893. crossY = super.saveClickY;
  4894. crossType = 2;
  4895. crossIndex = 0;
  4896. stream.createFrame(39);
  4897. stream.method431(i1);
  4898. }
  4899. }
  4900. if(l == 577)
  4901. {
  4902. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4903. if(class30_sub2_sub4_sub1_sub2_5 != null)
  4904. {
  4905. 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]);
  4906. crossX = super.saveClickX;
  4907. crossY = super.saveClickY;
  4908. crossType = 2;
  4909. crossIndex = 0;
  4910. stream.createFrame(139);
  4911. stream.method431(i1);
  4912. }
  4913. }
  4914. if(l == 956 && method66(i1, k, j))
  4915. {
  4916. stream.createFrame(35);
  4917. stream.method431(j + baseX);
  4918. stream.method432(anInt1137);
  4919. stream.method432(k + baseY);
  4920. stream.method431(i1 >> 14 & 0x7fff);
  4921. }
  4922. if(l == 567)
  4923. {
  4924. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4925. if(!flag6)
  4926. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4927. crossX = super.saveClickX;
  4928. crossY = super.saveClickY;
  4929. crossType = 2;
  4930. crossIndex = 0;
  4931. stream.createFrame(23);
  4932. stream.method431(k + baseY);
  4933. stream.method431(i1);
  4934. stream.method431(j + baseX);
  4935. }
  4936. if(l == 867)
  4937. {
  4938. if((i1 & 3) == 0)
  4939. anInt1175++;
  4940. if(anInt1175 >= 59)
  4941. {
  4942. stream.createFrame(200);
  4943. stream.writeWord(25501);
  4944. anInt1175 = 0;
  4945. }
  4946. stream.createFrame(43);
  4947. stream.method431(k);
  4948. stream.method432(i1);
  4949. stream.method432(j);
  4950. atInventoryLoopCycle = 0;
  4951. atInventoryInterface = k;
  4952. atInventoryIndex = j;
  4953. atInventoryInterfaceType = 2;
  4954. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4955. atInventoryInterfaceType = 1;
  4956. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4957. atInventoryInterfaceType = 3;
  4958. }
  4959. if(l == 543)
  4960. {
  4961. stream.createFrame(237);
  4962. stream.writeWord(j);
  4963. stream.method432(i1);
  4964. stream.writeWord(k);
  4965. stream.method432(anInt1137);
  4966. atInventoryLoopCycle = 0;
  4967. atInventoryInterface = k;
  4968. atInventoryIndex = j;
  4969. atInventoryInterfaceType = 2;
  4970. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4971. atInventoryInterfaceType = 1;
  4972. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4973. atInventoryInterfaceType = 3;
  4974. }
  4975. if(l == 606)
  4976. {
  4977. String s2 = menuActionName[i];
  4978. int j2 = s2.indexOf("@whi@");
  4979. if(j2 != -1)
  4980. if(openInterfaceID == -1)
  4981. {
  4982. clearTopInterfaces();
  4983. reportAbuseInput = s2.substring(j2 + 5).trim();
  4984. canMute = false;
  4985. for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  4986. {
  4987. if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  4988. continue;
  4989. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4990. break;
  4991. }
  4992.  
  4993. } else
  4994. {
  4995. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  4996. }
  4997. }
  4998. if(l == 491)
  4999. {
  5000. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  5001. if(class30_sub2_sub4_sub1_sub2_6 != null)
  5002. {
  5003. 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]);
  5004. crossX = super.saveClickX;
  5005. crossY = super.saveClickY;
  5006. crossType = 2;
  5007. crossIndex = 0;
  5008. stream.createFrame(14);
  5009. stream.method432(anInt1284);
  5010. stream.writeWord(i1);
  5011. stream.writeWord(anInt1285);
  5012. stream.method431(anInt1283);
  5013. }
  5014. }
  5015. if(l == 639)
  5016. {
  5017. String s3 = menuActionName[i];
  5018. int k2 = s3.indexOf("@whi@");
  5019. if(k2 != -1)
  5020. {
  5021. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  5022. int k3 = -1;
  5023. for(int i4 = 0; i4 < friendsCount; i4++)
  5024. {
  5025. if(friendsListAsLongs[i4] != l4)
  5026. continue;
  5027. k3 = i4;
  5028. break;
  5029. }
  5030.  
  5031. if(k3 != -1 && friendsNodeIDs[k3] > 0)
  5032. {
  5033. inputTaken = true;
  5034. inputDialogState = 0;
  5035. messagePromptRaised = true;
  5036. promptInput = "";
  5037. friendsListAction = 3;
  5038. aLong953 = friendsListAsLongs[k3];
  5039. aString1121 = "Enter message to send to " + friendsList[k3];
  5040. }
  5041. }
  5042. }
  5043. if(l == 454)
  5044. {
  5045. stream.createFrame(41);
  5046. stream.writeWord(i1);
  5047. stream.method432(j);
  5048. stream.method432(k);
  5049. atInventoryLoopCycle = 0;
  5050. atInventoryInterface = k;
  5051. atInventoryIndex = j;
  5052. atInventoryInterfaceType = 2;
  5053. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5054. atInventoryInterfaceType = 1;
  5055. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5056. atInventoryInterfaceType = 3;
  5057. }
  5058. if(l == 478)
  5059. {
  5060. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  5061. if(class30_sub2_sub4_sub1_sub1_7 != null)
  5062. {
  5063. 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]);
  5064. crossX = super.saveClickX;
  5065. crossY = super.saveClickY;
  5066. crossType = 2;
  5067. crossIndex = 0;
  5068. if((i1 & 3) == 0)
  5069. anInt1155++;
  5070. if(anInt1155 >= 53)
  5071. {
  5072. stream.createFrame(85);
  5073. stream.writeWordBigEndian(66);
  5074. anInt1155 = 0;
  5075. }
  5076. stream.createFrame(18);
  5077. stream.method431(i1);
  5078. }
  5079. }
  5080. if(l == 113)
  5081. {
  5082. method66(i1, k, j);
  5083. stream.createFrame(70);
  5084. stream.method431(j + baseX);
  5085. stream.writeWord(k + baseY);
  5086. stream.method433(i1 >> 14 & 0x7fff);
  5087. }
  5088. if(l == 872)
  5089. {
  5090. method66(i1, k, j);
  5091. stream.createFrame(234);
  5092. stream.method433(j + baseX);
  5093. stream.method432(i1 >> 14 & 0x7fff);
  5094. stream.method433(k + baseY);
  5095. }
  5096. if(l == 502)
  5097. {
  5098. method66(i1, k, j);
  5099. stream.createFrame(132);
  5100. stream.method433(j + baseX);
  5101. stream.writeWord(i1 >> 14 & 0x7fff);
  5102. stream.method432(k + baseY);
  5103. }
  5104. if(l == 1125)
  5105. {
  5106. ItemDef itemDef = ItemDef.forID(i1);
  5107. RSInterface class9_4 = RSInterface.interfaceCache[k];
  5108. String s5;
  5109. if(class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  5110. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  5111. else
  5112. if(itemDef.description != null)
  5113. s5 = new String(itemDef.description);
  5114. else
  5115. s5 = "It's a " + itemDef.name + ".";
  5116. pushMessage(s5, 0, "");
  5117. }
  5118. if(l == 169)
  5119. {
  5120. stream.createFrame(185);
  5121. stream.writeWord(k);
  5122. RSInterface class9_3 = RSInterface.interfaceCache[k];
  5123. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5)
  5124. {
  5125. int l2 = class9_3.valueIndexArray[0][1];
  5126. variousSettings[l2] = 1 - variousSettings[l2];
  5127. method33(l2);
  5128. needDrawTabArea = true;
  5129. }
  5130. }
  5131. if(l == 447)
  5132. {
  5133. itemSelected = 1;
  5134. anInt1283 = j;
  5135. anInt1284 = k;
  5136. anInt1285 = i1;
  5137. selectedItemName = ItemDef.forID(i1).name;
  5138. spellSelected = 0;
  5139. needDrawTabArea = true;
  5140. return;
  5141. }
  5142. if(l == 1226)
  5143. {
  5144. int j1 = i1 >> 14 & 0x7fff;
  5145. ObjectDef class46 = ObjectDef.forID(j1);
  5146. String s10;
  5147. if(class46.description != null)
  5148. s10 = new String(class46.description);
  5149. else
  5150. s10 = "It's a " + class46.name + ".";
  5151. pushMessage(s10, 0, "");
  5152. }
  5153. if(l == 244)
  5154. {
  5155. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5156. if(!flag7)
  5157. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5158. crossX = super.saveClickX;
  5159. crossY = super.saveClickY;
  5160. crossType = 2;
  5161. crossIndex = 0;
  5162. stream.createFrame(253);
  5163. stream.method431(j + baseX);
  5164. stream.method433(k + baseY);
  5165. stream.method432(i1);
  5166. }
  5167. if(l == 1448)
  5168. {
  5169. ItemDef itemDef_1 = ItemDef.forID(i1);
  5170. String s6;
  5171. if(itemDef_1.description != null)
  5172. s6 = new String(itemDef_1.description);
  5173. else
  5174. s6 = "It's a " + itemDef_1.name + ".";
  5175. pushMessage(s6, 0, "");
  5176. }
  5177. itemSelected = 0;
  5178. spellSelected = 0;
  5179. needDrawTabArea = true;
  5180.  
  5181. }
  5182.  
  5183. private void method70()
  5184. {
  5185. anInt1251 = 0;
  5186. int j = (myPlayer.x >> 7) + baseX;
  5187. int k = (myPlayer.y >> 7) + baseY;
  5188. if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  5189. anInt1251 = 1;
  5190. if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  5191. anInt1251 = 1;
  5192. if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  5193. anInt1251 = 0;
  5194. }
  5195.  
  5196. public void run() {
  5197. if(drawFlames) {
  5198. drawFlames();
  5199. } else {
  5200. super.run();
  5201. }
  5202. }
  5203.  
  5204. private void build3dScreenMenu()
  5205. {
  5206. if(itemSelected == 0 && spellSelected == 0)
  5207. {
  5208. menuActionName[menuActionRow] = "Walk here";
  5209. menuActionID[menuActionRow] = 516;
  5210. menuActionCmd2[menuActionRow] = super.mouseX;
  5211. menuActionCmd3[menuActionRow] = super.mouseY;
  5212. menuActionRow++;
  5213. }
  5214. int j = -1;
  5215. for(int k = 0; k < Model.anInt1687; k++)
  5216. {
  5217. int l = Model.anIntArray1688[k];
  5218. int i1 = l & 0x7f;
  5219. int j1 = l >> 7 & 0x7f;
  5220. int k1 = l >> 29 & 3;
  5221. int l1 = l >> 14 & 0x7fff;
  5222. if(l == j)
  5223. continue;
  5224. j = l;
  5225. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
  5226. {
  5227. ObjectDef class46 = ObjectDef.forID(l1);
  5228. if(class46.childrenIDs != null)
  5229. class46 = class46.method580();
  5230. if(class46 == null)
  5231. continue;
  5232. if(itemSelected == 1)
  5233. {
  5234. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
  5235. menuActionID[menuActionRow] = 62;
  5236. menuActionCmd1[menuActionRow] = l;
  5237. menuActionCmd2[menuActionRow] = i1;
  5238. menuActionCmd3[menuActionRow] = j1;
  5239. menuActionRow++;
  5240. } else
  5241. if(spellSelected == 1)
  5242. {
  5243. if((spellUsableOn & 4) == 4)
  5244. {
  5245. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  5246. menuActionID[menuActionRow] = 956;
  5247. menuActionCmd1[menuActionRow] = l;
  5248. menuActionCmd2[menuActionRow] = i1;
  5249. menuActionCmd3[menuActionRow] = j1;
  5250. menuActionRow++;
  5251. }
  5252. } else
  5253. {
  5254. if(class46.actions != null)
  5255. {
  5256. for(int i2 = 4; i2 >= 0; i2--)
  5257. if(class46.actions[i2] != null)
  5258. {
  5259. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  5260. if(i2 == 0)
  5261. menuActionID[menuActionRow] = 502;
  5262. if(i2 == 1)
  5263. menuActionID[menuActionRow] = 900;
  5264. if(i2 == 2)
  5265. menuActionID[menuActionRow] = 113;
  5266. if(i2 == 3)
  5267. menuActionID[menuActionRow] = 872;
  5268. if(i2 == 4)
  5269. menuActionID[menuActionRow] = 1062;
  5270. menuActionCmd1[menuActionRow] = l;
  5271. menuActionCmd2[menuActionRow] = i1;
  5272. menuActionCmd3[menuActionRow] = j1;
  5273. menuActionRow++;
  5274. }
  5275.  
  5276. }
  5277. menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  5278. //menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  5279. menuActionID[menuActionRow] = 1226;
  5280. menuActionCmd1[menuActionRow] = class46.type << 14;
  5281. menuActionCmd2[menuActionRow] = i1;
  5282. menuActionCmd3[menuActionRow] = j1;
  5283. menuActionRow++;
  5284. }
  5285. }
  5286. if(k1 == 1)
  5287. {
  5288. NPC npc = npcArray[l1];
  5289. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  5290. {
  5291. for(int j2 = 0; j2 < npcCount; j2++)
  5292. {
  5293. NPC npc2 = npcArray[npcIndices[j2]];
  5294. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  5295. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  5296. }
  5297.  
  5298. for(int l2 = 0; l2 < playerCount; l2++)
  5299. {
  5300. Player player = playerArray[playerIndices[l2]];
  5301. if(player != null && player.x == npc.x && player.y == npc.y)
  5302. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  5303. }
  5304.  
  5305. }
  5306. buildAtNPCMenu(npc.desc, l1, j1, i1);
  5307. }
  5308. if(k1 == 0)
  5309. {
  5310. Player player = playerArray[l1];
  5311. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  5312. {
  5313. for(int k2 = 0; k2 < npcCount; k2++)
  5314. {
  5315. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  5316. 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)
  5317. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  5318. }
  5319.  
  5320. for(int i3 = 0; i3 < playerCount; i3++)
  5321. {
  5322. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  5323. 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)
  5324. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  5325. }
  5326.  
  5327. }
  5328. buildAtPlayerMenu(i1, l1, player, j1);
  5329. }
  5330. if(k1 == 3)
  5331. {
  5332. NodeList class19 = groundArray[plane][i1][j1];
  5333. if(class19 != null)
  5334. {
  5335. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  5336. {
  5337. ItemDef itemDef = ItemDef.forID(item.ID);
  5338. if(itemSelected == 1)
  5339. {
  5340. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  5341. menuActionID[menuActionRow] = 511;
  5342. menuActionCmd1[menuActionRow] = item.ID;
  5343. menuActionCmd2[menuActionRow] = i1;
  5344. menuActionCmd3[menuActionRow] = j1;
  5345. menuActionRow++;
  5346. } else
  5347. if(spellSelected == 1)
  5348. {
  5349. if((spellUsableOn & 1) == 1)
  5350. {
  5351. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  5352. menuActionID[menuActionRow] = 94;
  5353. menuActionCmd1[menuActionRow] = item.ID;
  5354. menuActionCmd2[menuActionRow] = i1;
  5355. menuActionCmd3[menuActionRow] = j1;
  5356. menuActionRow++;
  5357. }
  5358. } else
  5359. {
  5360. for(int j3 = 4; j3 >= 0; j3--)
  5361. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  5362. {
  5363. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  5364. if(j3 == 0)
  5365. menuActionID[menuActionRow] = 652;
  5366. if(j3 == 1)
  5367. menuActionID[menuActionRow] = 567;
  5368. if(j3 == 2)
  5369. menuActionID[menuActionRow] = 234;
  5370. if(j3 == 3)
  5371. menuActionID[menuActionRow] = 244;
  5372. if(j3 == 4)
  5373. menuActionID[menuActionRow] = 213;
  5374. menuActionCmd1[menuActionRow] = item.ID;
  5375. menuActionCmd2[menuActionRow] = i1;
  5376. menuActionCmd3[menuActionRow] = j1;
  5377. menuActionRow++;
  5378. } else
  5379. if(j3 == 2)
  5380. {
  5381. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  5382. menuActionID[menuActionRow] = 234;
  5383. menuActionCmd1[menuActionRow] = item.ID;
  5384. menuActionCmd2[menuActionRow] = i1;
  5385. menuActionCmd3[menuActionRow] = j1;
  5386. menuActionRow++;
  5387. }
  5388.  
  5389. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  5390. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  5391. menuActionID[menuActionRow] = 1448;
  5392. menuActionCmd1[menuActionRow] = item.ID;
  5393. menuActionCmd2[menuActionRow] = i1;
  5394. menuActionCmd3[menuActionRow] = j1;
  5395. menuActionRow++;
  5396. }
  5397. }
  5398.  
  5399. }
  5400. }
  5401. }
  5402. }
  5403.  
  5404. public void cleanUpForQuit()
  5405. {
  5406. signlink.reporterror = false;
  5407. try
  5408. {
  5409. if(socketStream != null)
  5410. socketStream.close();
  5411. }
  5412. catch(Exception _ex) { }
  5413. socketStream = null;
  5414. stopMidi();
  5415. if(mouseDetection != null)
  5416. mouseDetection.running = false;
  5417. mouseDetection = null;
  5418. onDemandFetcher.disable();
  5419. onDemandFetcher = null;
  5420. mapArea = null;
  5421. aStream_834 = null;
  5422. stream = null;
  5423. aStream_847 = null;
  5424. inStream = null;
  5425. anIntArray1234 = null;
  5426. aByteArrayArray1183 = null;
  5427. aByteArrayArray1247 = null;
  5428. anIntArray1235 = null;
  5429. anIntArray1236 = null;
  5430. intGroundArray = null;
  5431. byteGroundArray = null;
  5432. worldController = null;
  5433. aClass11Array1230 = null;
  5434. anIntArrayArray901 = null;
  5435. anIntArrayArray825 = null;
  5436. bigX = null;
  5437. bigY = null;
  5438. aByteArray912 = null;
  5439. aRSImageProducer_1163 = null;
  5440. mapEdgeIP = null;
  5441. leftFrame = null;
  5442. topFrame = null;
  5443. rightFrame = null;
  5444. aRSImageProducer_1164 = null;
  5445. aRSImageProducer_1165 = null;
  5446. aRSImageProducer_1166 = null;
  5447. aRSImageProducer_1123 = null;
  5448. aRSImageProducer_1124 = null;
  5449. aRSImageProducer_1125 = null;
  5450. /* Null pointers for custom sprites */
  5451. chatArea = null;
  5452. chatButtons = null;
  5453. tabArea = null;
  5454. mapArea = null;
  5455. /**/
  5456. HPBarFull = null;
  5457. HPBarEmpty = null;
  5458. mapBack = null;
  5459. sideIcons = null;
  5460. redStones = null;
  5461. compass = null;
  5462. hitMarks = null;
  5463. headIcons = null;
  5464. skullIcons = null;
  5465. headIconsHint = null;
  5466. crosses = null;
  5467. mapDotItem = null;
  5468. mapDotNPC = null;
  5469. mapDotPlayer = null;
  5470. mapDotFriend = null;
  5471. mapDotTeam = null;
  5472. mapScenes = null;
  5473. mapFunctions = null;
  5474. anIntArrayArray929 = null;
  5475. playerArray = null;
  5476. playerIndices = null;
  5477. anIntArray894 = null;
  5478. aStreamArray895s = null;
  5479. anIntArray840 = null;
  5480. npcArray = null;
  5481. npcIndices = null;
  5482. groundArray = null;
  5483. aClass19_1179 = null;
  5484. aClass19_1013 = null;
  5485. aClass19_1056 = null;
  5486. menuActionCmd2 = null;
  5487. menuActionCmd3 = null;
  5488. menuActionID = null;
  5489. menuActionCmd1 = null;
  5490. menuActionName = null;
  5491. variousSettings = null;
  5492. anIntArray1072 = null;
  5493. anIntArray1073 = null;
  5494. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  5495. aClass30_Sub2_Sub1_Sub1_1263 = null;
  5496. friendsList = null;
  5497. friendsListAsLongs = null;
  5498. friendsNodeIDs = null;
  5499. aRSImageProducer_1110 = null;
  5500. aRSImageProducer_1111 = null;
  5501. aRSImageProducer_1107 = null;
  5502. aRSImageProducer_1108 = null;
  5503. aRSImageProducer_1109 = null;
  5504. aRSImageProducer_1112 = null;
  5505. aRSImageProducer_1113 = null;
  5506. aRSImageProducer_1114 = null;
  5507. aRSImageProducer_1115 = null;
  5508. multiOverlay = null;
  5509. nullLoader();
  5510. ObjectDef.nullLoader();
  5511. EntityDef.nullLoader();
  5512. ItemDef.nullLoader();
  5513. Flo.cache = null;
  5514. IDK.cache = null;
  5515. RSInterface.interfaceCache = null;
  5516. DummyClass.cache = null;
  5517. Animation.anims = null;
  5518. SpotAnim.cache = null;
  5519. SpotAnim.aMRUNodes_415 = null;
  5520. Varp.cache = null;
  5521. super.fullGameScreen = null;
  5522. Player.mruNodes = null;
  5523. Texture.nullLoader();
  5524. WorldController.nullLoader();
  5525. Model.nullLoader();
  5526. Class36.nullLoader();
  5527. System.gc();
  5528. }
  5529.  
  5530. private void printDebug()
  5531. {
  5532. System.out.println("============");
  5533. System.out.println("flame-cycle:" + anInt1208);
  5534. if(onDemandFetcher != null)
  5535. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5536. System.out.println("loop-cycle:" + loopCycle);
  5537. System.out.println("draw-cycle:" + anInt1061);
  5538. System.out.println("ptype:" + pktType);
  5539. System.out.println("psize:" + pktSize);
  5540. if(socketStream != null)
  5541. socketStream.printDebug();
  5542. super.shouldDebug = true;
  5543. }
  5544.  
  5545. Component getGameComponent() {
  5546. if(signlink.mainapp != null)
  5547. return signlink.mainapp;
  5548. if(super.gameFrame != null)
  5549. return super.gameFrame;
  5550. else
  5551. return this;
  5552. }
  5553.  
  5554. private void method73() {
  5555. do {
  5556. int j = readChar(-796);
  5557. if(j == -1)
  5558. break;
  5559. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5560. if(j == 8 && reportAbuseInput.length() > 0)
  5561. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5562. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5563. reportAbuseInput += (char)j;
  5564. } else if(messagePromptRaised) {
  5565. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  5566. promptInput += (char)j;
  5567. inputTaken = true;
  5568. }
  5569. if(j == 8 && promptInput.length() > 0) {
  5570. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5571. inputTaken = true;
  5572. }
  5573. if(j == 13 || j == 10) {
  5574. messagePromptRaised = false;
  5575. inputTaken = true;
  5576. if(friendsListAction == 1) {
  5577. long l = TextClass.longForName(promptInput);
  5578. addFriend(l);
  5579. }
  5580. if(friendsListAction == 2 && friendsCount > 0) {
  5581. long l1 = TextClass.longForName(promptInput);
  5582. delFriend(l1);
  5583. }
  5584. if(friendsListAction == 3 && promptInput.length() > 0) {
  5585. stream.createFrame(126);
  5586. stream.writeWordBigEndian(0);
  5587. int k = stream.currentOffset;
  5588. stream.writeQWord(aLong953);
  5589. TextInput.method526(promptInput, stream);
  5590. stream.writeBytes(stream.currentOffset - k);
  5591. promptInput = TextInput.processText(promptInput);
  5592. //promptInput = Censor.doCensor(promptInput);
  5593. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5594. if(privateChatMode == 2) {
  5595. privateChatMode = 1;
  5596. aBoolean1233 = true;
  5597. stream.createFrame(95);
  5598. stream.writeWordBigEndian(publicChatMode);
  5599. stream.writeWordBigEndian(privateChatMode);
  5600. stream.writeWordBigEndian(tradeMode);
  5601. }
  5602. }
  5603. if(friendsListAction == 4 && ignoreCount < 100) {
  5604. long l2 = TextClass.longForName(promptInput);
  5605. addIgnore(l2);
  5606. }
  5607. if(friendsListAction == 5 && ignoreCount > 0) {
  5608. long l3 = TextClass.longForName(promptInput);
  5609. delIgnore(l3);
  5610. }
  5611. if(friendsListAction == 6) {
  5612. long l3 = TextClass.longForName(promptInput);
  5613. chatJoin(l3);
  5614. }
  5615. }
  5616. } else if(inputDialogState == 1) {
  5617. if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5618. amountOrNameInput += (char)j;
  5619. inputTaken = true;
  5620. }
  5621. if(j == 8 && amountOrNameInput.length() > 0) {
  5622. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5623. inputTaken = true;
  5624. }
  5625. if(j == 13 || j == 10) {
  5626. if(amountOrNameInput.length() > 0) {
  5627. int i1 = 0;
  5628. try {
  5629. i1 = Integer.parseInt(amountOrNameInput);
  5630. }
  5631. catch(Exception _ex) { }
  5632. stream.createFrame(208);
  5633. stream.writeDWord(i1);
  5634. }
  5635. inputDialogState = 0;
  5636. inputTaken = true;
  5637. }
  5638. } else if(inputDialogState == 2) {
  5639. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5640. amountOrNameInput += (char)j;
  5641. inputTaken = true;
  5642. }
  5643. if(j == 8 && amountOrNameInput.length() > 0) {
  5644. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5645. inputTaken = true;
  5646. }
  5647. if(j == 13 || j == 10) {
  5648. if(amountOrNameInput.length() > 0) {
  5649. stream.createFrame(60);
  5650. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5651. }
  5652. inputDialogState = 0;
  5653. inputTaken = true;
  5654. }
  5655. } else if(backDialogID == -1) {
  5656. if(j >= 32 && j <= 122 && inputString.length() < 80) {
  5657. inputString += (char)j;
  5658. inputTaken = true;
  5659. }
  5660. if(j == 8 && inputString.length() > 0) {
  5661. inputString = inputString.substring(0, inputString.length() - 1);
  5662. inputTaken = true;
  5663. }
  5664. if((j == 13 || j == 10) && inputString.length() > 0) {
  5665. if(myPrivilege == 2 || server.equals("genesis-rsps.net") || 1 == 1/*to remove*/) {
  5666. if(inputString.startsWith("//setspecto")) {
  5667. int amt = Integer.parseInt(inputString.substring(12));
  5668. anIntArray1045[300] = amt;
  5669. if(variousSettings[300] != amt) {
  5670. variousSettings[300] = amt;
  5671. method33(300);
  5672. needDrawTabArea = true;
  5673. if(dialogID != -1)
  5674. inputTaken = true;
  5675. }
  5676. }
  5677. if(inputString.equals("::hpon"))
  5678. hpHead = true;
  5679. if(inputString.equals("::hpoff"))
  5680. hpHead = false;
  5681. if(inputString.equals("clientdrop"))
  5682. dropClient();
  5683. if(inputString.equals("::dumpmodels"))
  5684. models();
  5685. if(inputString.equals("dumpnpcs"))
  5686. EntityDef.rewriteNpcs();
  5687. /*if (inputString.startsWith("full")) {
  5688. try {
  5689. String[] args = inputString.split(" ");
  5690. int id1 = Integer.parseInt(args[1]);
  5691. int id2 = Integer.parseInt(args[2]);
  5692. fullscreenInterfaceID = id1;
  5693. openInterfaceID = id2;
  5694. pushMessage("Opened Interface", 0, "");
  5695. } catch (Exception e) {
  5696. pushMessage("Interface Failed to load", 0, "");
  5697. }
  5698. }*/
  5699. if(inputString.equals("::lag"))
  5700. printDebug();
  5701. if(inputString.equals("::prefetchmusic")) {
  5702. for(int j1 = 0; j1 < onDemandFetcher.getVersionCount(2); j1++)
  5703. onDemandFetcher.method563((byte)1, 2, j1);
  5704.  
  5705. }
  5706. if(inputString.equals("::fpson"))
  5707. fpsOn = true;
  5708. if(inputString.equals("::fpsoff"))
  5709. fpsOn = false;
  5710. if(inputString.equals("::dataon"))
  5711. clientData = true;
  5712. if(inputString.equals("::dataoff"))
  5713. clientData = false;
  5714. /*if(inputString.equals("::noclip")) {
  5715. for(int k1 = 0; k1 < 4; k1++) {
  5716. for(int i2 = 1; i2 < 103; i2++) {
  5717. for(int k2 = 1; k2 < 103; k2++)
  5718. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5719.  
  5720. }
  5721. }
  5722. }*/
  5723. }
  5724. if(inputString.startsWith("/"))
  5725. inputString = "::" + inputString;
  5726. if(inputString.equals("add model")) {
  5727. try {
  5728. int ModelIndex = Integer.parseInt(JOptionPane.showInputDialog(this, "Enter model ID", "Model", 3));
  5729. byte[] abyte0 = getModel(ModelIndex);
  5730. if(abyte0 != null && abyte0.length > 0) {
  5731. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  5732. pushMessage("Model: [" + ModelIndex + "] added successfully!", 0, "");
  5733. } else {
  5734. pushMessage("Unable to find the model. "+ModelIndex, 0, "");
  5735. }
  5736. } catch(Exception e) {
  5737. pushMessage("Syntax - ::add model <path>", 0, "");
  5738. }
  5739. }
  5740. if(inputString.startsWith("::")) {
  5741. stream.createFrame(103);
  5742. stream.writeWordBigEndian(inputString.length() - 1);
  5743. stream.writeString(inputString.substring(2));
  5744. } else {
  5745. String s = inputString.toLowerCase();
  5746. int j2 = 0;
  5747. if(s.startsWith("yellow:"))
  5748. {
  5749. j2 = 0;
  5750. inputString = inputString.substring(7);
  5751. } else if(s.startsWith("red:"))
  5752. {
  5753. j2 = 1;
  5754. inputString = inputString.substring(4);
  5755. } else if(s.startsWith("green:"))
  5756. {
  5757. j2 = 2;
  5758. inputString = inputString.substring(6);
  5759. } else if(s.startsWith("cyan:"))
  5760. {
  5761. j2 = 3;
  5762. inputString = inputString.substring(5);
  5763. } else if(s.startsWith("purple:"))
  5764. {
  5765. j2 = 4;
  5766. inputString = inputString.substring(7);
  5767. } else if(s.startsWith("white:"))
  5768. {
  5769. j2 = 5;
  5770. inputString = inputString.substring(6);
  5771. } else if(s.startsWith("flash1:"))
  5772. {
  5773. j2 = 6;
  5774. inputString = inputString.substring(7);
  5775. } else if(s.startsWith("flash2:"))
  5776. {
  5777. j2 = 7;
  5778. inputString = inputString.substring(7);
  5779. } else if(s.startsWith("flash3:"))
  5780. {
  5781. j2 = 8;
  5782. inputString = inputString.substring(7);
  5783. } else if(s.startsWith("glow1:"))
  5784. {
  5785. j2 = 9;
  5786. inputString = inputString.substring(6);
  5787. } else if(s.startsWith("glow2:"))
  5788. {
  5789. j2 = 10;
  5790. inputString = inputString.substring(6);
  5791. } else if(s.startsWith("glow3:"))
  5792. {
  5793. j2 = 11;
  5794. inputString = inputString.substring(6);
  5795. }
  5796. s = inputString.toLowerCase();
  5797. int i3 = 0;
  5798. if(s.startsWith("wave:"))
  5799. {
  5800. i3 = 1;
  5801. inputString = inputString.substring(5);
  5802. } else if(s.startsWith("wave2:"))
  5803. {
  5804. i3 = 2;
  5805. inputString = inputString.substring(6);
  5806. } else if(s.startsWith("shake:"))
  5807. {
  5808. i3 = 3;
  5809. inputString = inputString.substring(6);
  5810. } else if(s.startsWith("scroll:"))
  5811. {
  5812. i3 = 4;
  5813. inputString = inputString.substring(7);
  5814. } else if(s.startsWith("slide:"))
  5815. {
  5816. i3 = 5;
  5817. inputString = inputString.substring(6);
  5818. }
  5819. stream.createFrame(4);
  5820. stream.writeWordBigEndian(0);
  5821. int j3 = stream.currentOffset;
  5822. stream.method425(i3);
  5823. stream.method425(j2);
  5824. aStream_834.currentOffset = 0;
  5825. TextInput.method526(inputString, aStream_834);
  5826. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  5827. stream.writeBytes(stream.currentOffset - j3);
  5828. inputString = TextInput.processText(inputString);
  5829. //inputString = Censor.doCensor(inputString);
  5830. myPlayer.textSpoken = inputString;
  5831. myPlayer.anInt1513 = j2;
  5832. myPlayer.anInt1531 = i3;
  5833. myPlayer.textCycle = 150;
  5834. switch (myPrivilege) {
  5835. case 1:
  5836. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + "<col="+titleColor(myPlayer.titleColor, 0)+">" + myPlayer.title + "</col>" + myPlayer.name);
  5837. break;
  5838. case 2:
  5839. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + "<col="+titleColor(myPlayer.titleColor, 0)+">" + myPlayer.title + "</col>" + myPlayer.name);
  5840. break;
  5841. case 3:
  5842. pushMessage(myPlayer.textSpoken, 2, "@cr3@" + "<col="+titleColor(myPlayer.titleColor, 0)+">" + myPlayer.title + "</col>" + myPlayer.name);
  5843. break;
  5844. case 4:
  5845. pushMessage(myPlayer.textSpoken, 2, "@cr4@" + "<col="+titleColor(myPlayer.titleColor, 0)+">" + myPlayer.title + "</col>" + myPlayer.name);
  5846. break;
  5847. case 5:
  5848. pushMessage(myPlayer.textSpoken, 2, "@cr5@" + "<col="+titleColor(myPlayer.titleColor, 0)+">" + myPlayer.title + "</col>" + myPlayer.name);
  5849. break;
  5850. case 6:
  5851. pushMessage(myPlayer.textSpoken, 2, "@cr6@" + "<col="+titleColor(myPlayer.titleColor, 0)+">" + myPlayer.title + "</col>" + myPlayer.name);
  5852. break;
  5853. case 7:
  5854. pushMessage(myPlayer.textSpoken, 2, "@cr7@" + "<col="+titleColor(myPlayer.titleColor, 0)+">" + myPlayer.title + "</col>" + myPlayer.name);
  5855. break;
  5856. case 8:
  5857. pushMessage(myPlayer.textSpoken, 2, "@cr8@" + "<col="+titleColor(myPlayer.titleColor, 0)+">" + myPlayer.title + "</col>" + myPlayer.name);
  5858. break;
  5859. default:
  5860. pushMessage(myPlayer.textSpoken, 2, "<col="+titleColor(myPlayer.titleColor, 0)+">" + myPlayer.title + "</col>" + myPlayer.name);
  5861. break;
  5862. }
  5863. //pushMessage(myPlayer.textSpoken, 2, (myPrivilege > 0 ? "@cr" + myPrivilege + "@" : "") + myPlayer.name);
  5864.  
  5865. if(publicChatMode == 2)
  5866. {
  5867. publicChatMode = 3;
  5868. aBoolean1233 = true;
  5869. stream.createFrame(95);
  5870. stream.writeWordBigEndian(publicChatMode);
  5871. stream.writeWordBigEndian(privateChatMode);
  5872. stream.writeWordBigEndian(tradeMode);
  5873. }
  5874. }
  5875. inputString = "";
  5876. inputTaken = true;
  5877. }
  5878. }
  5879. } while(true);
  5880. }
  5881.  
  5882. private void buildPublicChat(int j)
  5883. {
  5884. int l = 0;
  5885. for(int i1 = 0; i1 < 500; i1++)
  5886. {
  5887. if(chatMessages[i1] == null)
  5888. continue;
  5889. if(chatTypeView != 1)
  5890. continue;
  5891. int j1 = chatTypes[i1];
  5892. String s = chatNames[i1];
  5893. String ct = chatMessages[i1];
  5894. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5895. if(k1 < -23)
  5896. break;
  5897. if(s != null && s.startsWith("@cr"))
  5898. s = s.substring(5);
  5899. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5900. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5901. if(myPrivilege >= 1) {
  5902. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5903. menuActionID[menuActionRow] = 606;
  5904. menuActionRow++;
  5905. }
  5906. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5907. menuActionID[menuActionRow] = 42;
  5908. menuActionRow++;
  5909. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5910. menuActionID[menuActionRow] = 337;
  5911. menuActionRow++;
  5912. }
  5913. l++;
  5914. }
  5915. }
  5916. }
  5917.  
  5918. private void buildFriendChat(int j)
  5919. {
  5920. int l = 0;
  5921. for(int i1 = 0; i1 < 500; i1++) {
  5922. if(chatMessages[i1] == null)
  5923. continue;
  5924. if(chatTypeView != 2)
  5925. continue;
  5926. int j1 = chatTypes[i1];
  5927. String s = chatNames[i1];
  5928. String ct = chatMessages[i1];
  5929. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5930. if(k1 < -23)
  5931. break;
  5932. if(s != null && s.startsWith("@cr"))
  5933. s = s.substring(5);
  5934. if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5935. l++;
  5936. if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5937. {
  5938. if(j > k1 - 14 && j <= k1) {
  5939. if(myPrivilege >= 1) {
  5940. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5941. menuActionID[menuActionRow] = 606;
  5942. menuActionRow++;
  5943. }
  5944. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5945. menuActionID[menuActionRow] = 42;
  5946. menuActionRow++;
  5947. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5948. menuActionID[menuActionRow] = 337;
  5949. menuActionRow++;
  5950. }
  5951. l++;
  5952. }
  5953. }
  5954. }
  5955.  
  5956. private void buildDuelorTrade(int j) {
  5957. int l = 0;
  5958. for(int i1 = 0; i1 < 500; i1++) {
  5959. if(chatMessages[i1] == null)
  5960. continue;
  5961. if(chatTypeView != 3 && chatTypeView != 4)
  5962. continue;
  5963. int j1 = chatTypes[i1];
  5964. String s = chatNames[i1];
  5965. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5966. if(k1 < -23)
  5967. break;
  5968. if(s != null && s.startsWith("@cr"))
  5969. s = s.substring(5);
  5970. if(chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5971. if(j > k1 - 14 && j <= k1) {
  5972. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5973. menuActionID[menuActionRow] = 484;
  5974. menuActionRow++;
  5975. }
  5976. l++;
  5977. }
  5978. if(chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5979. if(j > k1 - 14 && j <= k1) {
  5980. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5981. menuActionID[menuActionRow] = 6;
  5982. menuActionRow++;
  5983. }
  5984. l++;
  5985. }
  5986. if(j1 == 12) {
  5987. if(j > k1 - 14 && j <= k1) {
  5988. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  5989. menuActionID[menuActionRow] = 915;
  5990. menuActionRow++;
  5991. }
  5992. l++;
  5993. }
  5994. }
  5995. }
  5996.  
  5997. private void buildChatAreaMenu(int j) {
  5998. int l = 0;
  5999. int test = 0;
  6000. for(int i1 = 0; i1 < 500; i1++) {
  6001. if(chatMessages[i1] == null)
  6002. continue;
  6003. int j1 = chatTypes[i1];
  6004. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6005. if(k1 < -23)
  6006. break;
  6007. String s = chatNames[i1];
  6008. String ct = chatMessages[i1];
  6009. boolean flag = false;
  6010. if(chatTypeView == 1) {
  6011. buildPublicChat(j);
  6012. break;
  6013. }
  6014. if(chatTypeView == 2) {
  6015. buildFriendChat(j);
  6016. break;
  6017. }
  6018. if(chatTypeView == 3 || chatTypeView == 4) {
  6019. buildDuelorTrade(j);
  6020. break;
  6021. }
  6022. if(chatTypeView == 5) {
  6023. break;
  6024. }
  6025. if (s != null && s.startsWith("@cr")) {
  6026. s = s.substring(5);
  6027. }
  6028. if(s != null && s.startsWith("<col=")) {
  6029. s = s.substring(s.indexOf("</col>")+6);
  6030. }
  6031. if(j1 == 0)
  6032. l++;
  6033. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  6034. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6035. if(myPrivilege >= 1) {
  6036. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6037. menuActionID[menuActionRow] = 606;
  6038. menuActionRow++;
  6039. }
  6040. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6041. menuActionID[menuActionRow] = 42;
  6042. menuActionRow++;
  6043. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6044. menuActionID[menuActionRow] = 337;
  6045. menuActionRow++;
  6046. }
  6047. l++;
  6048. }
  6049. if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  6050. if(j > k1 - 14 && j <= k1) {
  6051. if(myPrivilege >= 1) {
  6052. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6053. menuActionID[menuActionRow] = 606;
  6054. menuActionRow++;
  6055. }
  6056. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6057. menuActionID[menuActionRow] = 42;
  6058. menuActionRow++;
  6059. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6060. menuActionID[menuActionRow] = 337;
  6061. menuActionRow++;
  6062. }
  6063. l++;
  6064. }
  6065. if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6066. if(j > k1 - 14 && j <= k1) {
  6067. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6068. menuActionID[menuActionRow] = 484;
  6069. menuActionRow++;
  6070. }
  6071. l++;
  6072. }
  6073. if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  6074. l++;
  6075. if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6076. if(j > k1 - 14 && j <= k1) {
  6077. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  6078. menuActionID[menuActionRow] = 6;
  6079. menuActionRow++;
  6080. }
  6081. l++;
  6082. }
  6083. }
  6084. }
  6085.  
  6086.  
  6087.  
  6088. private void drawFriendsListOrWelcomeScreen(RSInterface class9)
  6089. {
  6090. int j = class9.contentType;
  6091. if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  6092. {
  6093. if(j == 1 && anInt900 == 0)
  6094. {
  6095. class9.message = "Loading friend list";
  6096. class9.atActionType = 0;
  6097. return;
  6098. }
  6099. if(j == 1 && anInt900 == 1)
  6100. {
  6101. class9.message = "Connecting to friendserver";
  6102. class9.atActionType = 0;
  6103. return;
  6104. }
  6105. if(j == 2 && anInt900 != 2)
  6106. {
  6107. class9.message = "Please wait...";
  6108. class9.atActionType = 0;
  6109. return;
  6110. }
  6111. int k = friendsCount;
  6112. if(anInt900 != 2)
  6113. k = 0;
  6114. if(j > 700)
  6115. j -= 601;
  6116. else
  6117. j--;
  6118. if(j >= k)
  6119. {
  6120. class9.message = "";
  6121. class9.atActionType = 0;
  6122. return;
  6123. } else
  6124. {
  6125. class9.message = friendsList[j];
  6126. class9.atActionType = 1;
  6127. return;
  6128. }
  6129. }
  6130. if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  6131. {
  6132. int l = friendsCount;
  6133. if(anInt900 != 2)
  6134. l = 0;
  6135. if(j > 800)
  6136. j -= 701;
  6137. else
  6138. j -= 101;
  6139. if(j >= l)
  6140. {
  6141. class9.message = "";
  6142. class9.atActionType = 0;
  6143. return;
  6144. }
  6145. if(friendsNodeIDs[j] == 0)
  6146. class9.message = "@red@Offline";
  6147. else if(friendsNodeIDs[j] == nodeID)
  6148. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9)*/;
  6149. else
  6150. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9)*/;
  6151. class9.atActionType = 1;
  6152. return;
  6153. }
  6154. if(j == 203)
  6155. {
  6156. int i1 = friendsCount;
  6157. if(anInt900 != 2)
  6158. i1 = 0;
  6159. class9.scrollMax = i1 * 15 + 20;
  6160. if(class9.scrollMax <= class9.height)
  6161. class9.scrollMax = class9.height + 1;
  6162. return;
  6163. }
  6164. if(j >= 401 && j <= 500)
  6165. {
  6166. if((j -= 401) == 0 && anInt900 == 0)
  6167. {
  6168. class9.message = "Loading ignore list";
  6169. class9.atActionType = 0;
  6170. return;
  6171. }
  6172. if(j == 1 && anInt900 == 0)
  6173. {
  6174. class9.message = "Please wait...";
  6175. class9.atActionType = 0;
  6176. return;
  6177. }
  6178. int j1 = ignoreCount;
  6179. if(anInt900 == 0)
  6180. j1 = 0;
  6181. if(j >= j1)
  6182. {
  6183. class9.message = "";
  6184. class9.atActionType = 0;
  6185. return;
  6186. } else
  6187. {
  6188. class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  6189. class9.atActionType = 1;
  6190. return;
  6191. }
  6192. }
  6193. if(j == 503)
  6194. {
  6195. class9.scrollMax = ignoreCount * 15 + 20;
  6196. if(class9.scrollMax <= class9.height)
  6197. class9.scrollMax = class9.height + 1;
  6198. return;
  6199. }
  6200. if(j == 327)
  6201. {
  6202. class9.modelRotation1 = 150;
  6203. class9.modelRotation2 = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  6204. if(aBoolean1031)
  6205. {
  6206. for(int k1 = 0; k1 < 7; k1++)
  6207. {
  6208. int l1 = anIntArray1065[k1];
  6209. if(l1 >= 0 && !IDK.cache[l1].method537())
  6210. return;
  6211. }
  6212.  
  6213. aBoolean1031 = false;
  6214. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  6215. int i2 = 0;
  6216. for(int j2 = 0; j2 < 7; j2++)
  6217. {
  6218. int k2 = anIntArray1065[j2];
  6219. if(k2 >= 0)
  6220. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2].method538();
  6221. }
  6222.  
  6223. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  6224. for(int l2 = 0; l2 < 5; l2++)
  6225. if(anIntArray990[l2] != 0)
  6226. {
  6227. model.setColor(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6228. if(l2 == 1)
  6229. model.setColor(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6230. }
  6231.  
  6232. model.method469();
  6233. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  6234. model.method479(64, 850, -30, -50, -30, true);
  6235. class9.anInt233 = 5;
  6236. class9.mediaID = 0;
  6237. RSInterface.method208(aBoolean994, model);
  6238. }
  6239. return;
  6240. }
  6241. if(j == 328) {
  6242. RSInterface rsInterface = class9;
  6243. int verticleTilt = 150;
  6244. int animationSpeed = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  6245. rsInterface.modelRotation1 = verticleTilt;
  6246. rsInterface.modelRotation2 = animationSpeed;
  6247. if(aBoolean1031) {
  6248. Model characterDisplay = myPlayer.method452();
  6249. for(int l2 = 0; l2 < 5; l2++)
  6250. if(anIntArray990[l2] != 0) {
  6251. characterDisplay.setColor(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6252. if(l2 == 1)
  6253. characterDisplay.setColor(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6254. }
  6255. int staticFrame = myPlayer.anInt1511;
  6256. characterDisplay.method469();
  6257. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  6258. //characterDisplay.method479(64, 850, -30, -50, -30, true);
  6259. rsInterface.anInt233 = 5;
  6260. rsInterface.mediaID = 0;
  6261. RSInterface.method208(aBoolean994, characterDisplay);
  6262. }
  6263. return;
  6264. }
  6265. if(j == 324)
  6266. {
  6267. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  6268. {
  6269. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6270. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6271. }
  6272. if(aBoolean1047)
  6273. {
  6274. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6275. return;
  6276. } else
  6277. {
  6278. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6279. return;
  6280. }
  6281. }
  6282. if(j == 325)
  6283. {
  6284. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  6285. {
  6286. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6287. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6288. }
  6289. if(aBoolean1047)
  6290. {
  6291. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6292. return;
  6293. } else
  6294. {
  6295. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6296. return;
  6297. }
  6298. }
  6299. if(j == 600)
  6300. {
  6301. class9.message = reportAbuseInput;
  6302. if(loopCycle % 20 < 10)
  6303. {
  6304. class9.message += "|";
  6305. return;
  6306. } else
  6307. {
  6308. class9.message += " ";
  6309. return;
  6310. }
  6311. }
  6312. if(j == 600)
  6313. {
  6314. class9.message = reportAbuseInput;
  6315. if(loopCycle % 20 < 10)
  6316. {
  6317. class9.message += "|";
  6318. return;
  6319. } else
  6320. {
  6321. class9.message += " ";
  6322. return;
  6323. }
  6324. }
  6325. if(j == 613)
  6326. if(myPrivilege >= 1)
  6327. {
  6328. if(canMute)
  6329. {
  6330. class9.textColor = 0xff0000;
  6331. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  6332. } else
  6333. {
  6334. class9.textColor = 0xffffff;
  6335. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  6336. }
  6337. } else
  6338. {
  6339. class9.message = "";
  6340. }
  6341. if(j == 650 || j == 655)
  6342. if(anInt1193 != 0)
  6343. {
  6344. String s;
  6345. if(daysSinceLastLogin == 0)
  6346. s = "earlier today";
  6347. else
  6348. if(daysSinceLastLogin == 1)
  6349. s = "yesterday";
  6350. else
  6351. s = daysSinceLastLogin + " days ago";
  6352. class9.message = "You last logged in " + s + " from: " + signlink.dns;
  6353. } else
  6354. {
  6355. class9.message = "";
  6356. }
  6357. if(j == 651)
  6358. {
  6359. if(unreadMessages == 0)
  6360. {
  6361. class9.message = "0 unread messages";
  6362. class9.textColor = 0xffff00;
  6363. }
  6364. if(unreadMessages == 1)
  6365. {
  6366. class9.message = "1 unread message";
  6367. class9.textColor = 65280;
  6368. }
  6369. if(unreadMessages > 1)
  6370. {
  6371. class9.message = unreadMessages + " unread messages";
  6372. class9.textColor = 65280;
  6373. }
  6374. }
  6375. if(j == 652)
  6376. if(daysSinceRecovChange == 201)
  6377. {
  6378. if(membersInt == 1)
  6379. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  6380. else
  6381. class9.message = "";
  6382. } else
  6383. if(daysSinceRecovChange == 200)
  6384. {
  6385. class9.message = "You have not yet set any password recovery questions.";
  6386. } else
  6387. {
  6388. String s1;
  6389. if(daysSinceRecovChange == 0)
  6390. s1 = "Earlier today";
  6391. else
  6392. if(daysSinceRecovChange == 1)
  6393. s1 = "Yesterday";
  6394. else
  6395. s1 = daysSinceRecovChange + " days ago";
  6396. class9.message = s1 + " you changed your recovery questions";
  6397. }
  6398. if(j == 653)
  6399. if(daysSinceRecovChange == 201)
  6400. {
  6401. if(membersInt == 1)
  6402. class9.message = "@whi@recommend you use a members world instead. You may use";
  6403. else
  6404. class9.message = "";
  6405. } else
  6406. if(daysSinceRecovChange == 200)
  6407. class9.message = "We strongly recommend you do so now to secure your account.";
  6408. else
  6409. class9.message = "If you do not remember making this change then cancel it immediately";
  6410. if(j == 654)
  6411. {
  6412. if(daysSinceRecovChange == 201)
  6413. if(membersInt == 1)
  6414. {
  6415. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  6416. return;
  6417. } else
  6418. {
  6419. class9.message = "";
  6420. return;
  6421. }
  6422. if(daysSinceRecovChange == 200)
  6423. {
  6424. class9.message = "Do this from the 'account management' area on our front webpage";
  6425. return;
  6426. }
  6427. class9.message = "Do this from the 'account management' area on our front webpage";
  6428. }
  6429. }
  6430.  
  6431. private void drawSplitPrivateChat()
  6432. {
  6433. if(splitPrivateChat == 0)
  6434. return;
  6435. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  6436. int i = 0;
  6437. if(anInt1104 != 0)
  6438. i = 1;
  6439. for(int j = 0; j < 100; j++)
  6440. if(chatMessages[j] != null)
  6441. {
  6442. int k = chatTypes[j];
  6443. String s = chatNames[j];
  6444. byte byte1 = 0;
  6445.  
  6446. if (s != null && s.startsWith("@cr")) {
  6447. byte1 = Byte.parseByte(s.substring(3, 4));
  6448. s = s.substring(5);
  6449. }
  6450.  
  6451. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6452. {
  6453. int l = 329 - i * 13;
  6454. int k1 = 4;
  6455. textDrawingArea.method385(0, "From", l, k1);
  6456. textDrawingArea.method385(65535, "From", l - 1, k1);
  6457. k1 += textDrawingArea.getTextWidth("From ");
  6458. if (byte1 >= 1) {
  6459. modIcons[byte1 - 1].drawSprite(k1, l - 12);
  6460. k1 += 12;
  6461. }
  6462. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  6463. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  6464. if(++i >= 5)
  6465. return;
  6466. }
  6467. if(k == 5 && privateChatMode < 2)
  6468. {
  6469. int i1 = 329 - i * 13;
  6470. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  6471. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  6472. if(++i >= 5)
  6473. return;
  6474. }
  6475. if(k == 6 && privateChatMode < 2)
  6476. {
  6477. int j1 = 329 - i * 13;
  6478. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  6479. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  6480. if(++i >= 5)
  6481. return;
  6482. }
  6483. }
  6484.  
  6485. }
  6486.  
  6487. public void pushMessage(String s, int i, String s1) {
  6488. if(i == 0 && dialogID != -1) {
  6489. aString844 = s;
  6490. super.clickMode3 = 0;
  6491. }
  6492. if(backDialogID == -1)
  6493. inputTaken = true;
  6494. for(int j = 499; j > 0; j--) {
  6495. chatTypes[j] = chatTypes[j - 1];
  6496. chatNames[j] = chatNames[j - 1];
  6497. chatMessages[j] = chatMessages[j - 1];
  6498. chatRights[j] = chatRights[j - 1];
  6499. }
  6500. chatTypes[0] = i;
  6501. chatNames[0] = s1;
  6502. chatMessages[0] = s;
  6503. chatRights[0] = rights;
  6504. }
  6505.  
  6506. public static void setTab(int id) {
  6507. needDrawTabArea = true;
  6508. tabID = id;
  6509. tabAreaAltered = true;
  6510. }
  6511.  
  6512. private void minimapHover() {
  6513. logH = super.mouseX >= 744 && super.mouseX <= 765 && super.mouseY >= 3 && super.mouseY <= 19;
  6514. }
  6515.  
  6516. private void processTabClick() {
  6517. minimapHover();
  6518. if(super.clickMode3 == 1) {
  6519. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  6520. {
  6521. needDrawTabArea = true;
  6522. tabID = 0;
  6523. tabAreaAltered = true;
  6524. }
  6525. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  6526. {
  6527. needDrawTabArea = true;
  6528. tabID = 1;
  6529. tabAreaAltered = true;
  6530. }
  6531. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  6532. {
  6533. needDrawTabArea = true;
  6534. tabID = 2;
  6535. tabAreaAltered = true;
  6536. }
  6537. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  6538. {
  6539. needDrawTabArea = true;
  6540. tabID = 3;
  6541. tabAreaAltered = true;
  6542. }
  6543. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  6544. {
  6545. needDrawTabArea = true;
  6546. tabID = 4;
  6547. tabAreaAltered = true;
  6548. }
  6549. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  6550. {
  6551. needDrawTabArea = true;
  6552. tabID = 5;
  6553. tabAreaAltered = true;
  6554. }
  6555. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  6556. {
  6557. needDrawTabArea = true;
  6558. tabID = 6;
  6559. tabAreaAltered = true;
  6560. }
  6561. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  6562. {
  6563. /*
  6564. needDrawTabArea = true;
  6565. tabID = 7;
  6566. tabAreaAltered = true;
  6567. */
  6568. }
  6569. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  6570. {
  6571. needDrawTabArea = true;
  6572. tabID = 8;
  6573. tabAreaAltered = true;
  6574. }
  6575. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  6576. {
  6577. needDrawTabArea = true;
  6578. tabID = 9;
  6579. tabAreaAltered = true;
  6580. }
  6581. if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[10] != -1)
  6582. {
  6583. needDrawTabArea = true;
  6584. tabID = 10;
  6585. tabAreaAltered = true;
  6586. }
  6587. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  6588. {
  6589. needDrawTabArea = true;
  6590. tabID = 11;
  6591. tabAreaAltered = true;
  6592. }
  6593. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  6594. {
  6595. needDrawTabArea = true;
  6596. tabID = 12;
  6597. tabAreaAltered = true;
  6598. }
  6599. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  6600. {
  6601. needDrawTabArea = true;
  6602. tabID = 13;
  6603. tabAreaAltered = true;
  6604. }
  6605.  
  6606. }
  6607. }
  6608.  
  6609. private void resetImageProducers2() {
  6610. if(aRSImageProducer_1166 != null)
  6611. return;
  6612. nullLoader();
  6613. super.fullGameScreen = null;
  6614. aRSImageProducer_1107 = null;
  6615. aRSImageProducer_1108 = null;
  6616. aRSImageProducer_1109 = null;
  6617. aRSImageProducer_1110 = null;
  6618. aRSImageProducer_1111 = null;
  6619. aRSImageProducer_1112 = null;
  6620. aRSImageProducer_1113 = null;
  6621. aRSImageProducer_1114 = null;
  6622. aRSImageProducer_1115 = null;
  6623. aRSImageProducer_1166 = new RSImageProducer(519, 165, getGameComponent());
  6624. aRSImageProducer_1164 = new RSImageProducer(246, 168, getGameComponent());
  6625. DrawingArea.setAllPixelsToZero();
  6626. mapArea.drawSprite(0, 0);
  6627. aRSImageProducer_1163 = new RSImageProducer(246, 335, getGameComponent());
  6628. aRSImageProducer_1165 = new RSImageProducer(512, 334, getGameComponent());
  6629. DrawingArea.setAllPixelsToZero();
  6630. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  6631. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  6632. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  6633. welcomeScreenRaised = true;
  6634. }
  6635.  
  6636. public String getDocumentBaseHost() {
  6637. if (signlink.mainapp != null) {
  6638. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  6639. }
  6640. if (super.gameFrame != null) {
  6641. return ""; // runescape.com <- removed for Jframe to work
  6642. } else {
  6643. return ""; // super.getDocumentBase().getHost().toLowerCase() <- removed for Jframe to work
  6644. }
  6645. }
  6646.  
  6647. private void method81(Sprite sprite, int j, int k)
  6648. {
  6649. int l = k * k + j * j;
  6650. if(l > 4225 && l < 0x15f90)
  6651. {
  6652. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  6653. int j1 = Model.modelIntArray1[i1];
  6654. int k1 = Model.modelIntArray2[i1];
  6655. j1 = (j1 * 256) / (minimapInt3 + 256);
  6656. k1 = (k1 * 256) / (minimapInt3 + 256);
  6657. int l1 = j * j1 + k * k1 >> 16;
  6658. int i2 = j * k1 - k * j1 >> 16;
  6659. double d = Math.atan2(l1, i2);
  6660. int j2 = (int)(Math.sin(d) * 63D);
  6661. int k2 = (int)(Math.cos(d) * 57D);
  6662. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  6663. } else
  6664. {
  6665. markMinimap(sprite, k, j);
  6666. }
  6667. }
  6668.  
  6669.  
  6670. private void rightClickChatButtons() {
  6671. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  6672. menuActionName[1] = "View All";
  6673. menuActionID[1] = 999;
  6674. menuActionRow = 2;
  6675. } else if (super.mouseX >= 62 && super.mouseX <= 117 && super.mouseY >= 482 && super.mouseY <= 503) {
  6676. menuActionName[1] = "View Game";
  6677. menuActionID[1] = 998;
  6678. menuActionRow = 2;
  6679. } else if (super.mouseX >= 119 && super.mouseX <= 174 && super.mouseY >= 482 && super.mouseY <= 503) {
  6680. menuActionName[1] = "Hide public";
  6681. menuActionID[1] = 997;
  6682. menuActionName[2] = "Off public";
  6683. menuActionID[2] = 996;
  6684. menuActionName[3] = "Friends public";
  6685. menuActionID[3] = 995;
  6686. menuActionName[4] = "On public";
  6687. menuActionID[4] = 994;
  6688. menuActionName[5] = "View public";
  6689. menuActionID[5] = 993;
  6690. menuActionRow = 6;
  6691. } else if (super.mouseX >= 176 && super.mouseX <= 231 && super.mouseY >= 482 && super.mouseY <= 503) {
  6692. menuActionName[1] = "Off private";
  6693. menuActionID[1] = 992;
  6694. menuActionName[2] = "Friends private";
  6695. menuActionID[2] = 991;
  6696. menuActionName[3] = "On private";
  6697. menuActionID[3] = 990;
  6698. menuActionName[4] = "View private";
  6699. menuActionID[4] = 989;
  6700. menuActionRow = 5;
  6701. } else if (super.mouseX >= 233 && super.mouseX <= 288 && super.mouseY >= 482 && super.mouseY <= 503) {
  6702. menuActionName[1] = "Off clan chat";
  6703. menuActionID[1] = 1003;
  6704. menuActionName[2] = "Friends clan chat";
  6705. menuActionID[2] = 1002;
  6706. menuActionName[3] = "On clan chat";
  6707. menuActionID[3] = 1001;
  6708. menuActionName[4] = "View clan chat";
  6709. menuActionID[4] = 1000;
  6710. menuActionRow = 5;
  6711. } else if (super.mouseX >= 290 && super.mouseX <= 345 && super.mouseY >= 482 && super.mouseY <= 503) {
  6712. menuActionName[1] = "Off trade";
  6713. menuActionID[1] = 987;
  6714. menuActionName[2] = "Friends trade";
  6715. menuActionID[2] = 986;
  6716. menuActionName[3] = "On trade";
  6717. menuActionID[3] = 985;
  6718. menuActionName[4] = "View trade";
  6719. menuActionID[4] = 984;
  6720. menuActionRow = 5;
  6721. } else if (super.mouseX >= 347 && super.mouseX <= 402 && super.mouseY >= 482 && super.mouseY <= 503) {
  6722. menuActionName[1] = "Off duel";
  6723. menuActionID[1] = -1;
  6724. menuActionName[2] = "Friends duel";
  6725. menuActionID[2] = -1;
  6726. menuActionName[3] = "On duel";
  6727. menuActionID[3] = -1;
  6728. menuActionName[4] = "View duel";
  6729. menuActionID[4] = -1;
  6730. menuActionRow = 5;
  6731. } else if (super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  6732. menuActionName[1] = "Report Abuse";
  6733. menuActionID[1] = 606;
  6734. menuActionRow = 2;
  6735. }
  6736. }
  6737.  
  6738. public void processRightClick() {
  6739. if (activeInterfaceType != 0) {
  6740. return;
  6741. }
  6742. menuActionName[0] = "Cancel";
  6743. menuActionID[0] = 1107;
  6744. menuActionRow = 1;
  6745. if (fullscreenInterfaceID != -1) {
  6746. anInt886 = 0;
  6747. anInt1315 = 0;
  6748. buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  6749. if (anInt886 != anInt1026) {
  6750. anInt1026 = anInt886;
  6751. }
  6752. if (anInt1315 != anInt1129) {
  6753. anInt1129 = anInt1315;
  6754. }
  6755. return;
  6756. }
  6757. buildSplitPrivateChatMenu();
  6758. anInt886 = 0;
  6759. anInt1315 = 0;
  6760. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338) {
  6761. if (openInterfaceID != -1) {
  6762. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  6763. } else {
  6764. build3dScreenMenu();
  6765. }
  6766. }
  6767. if (anInt886 != anInt1026) {
  6768. anInt1026 = anInt886;
  6769. }
  6770. if (anInt1315 != anInt1129) {
  6771. anInt1129 = anInt1315;
  6772. }
  6773. anInt886 = 0;
  6774. anInt1315 = 0;
  6775. if(super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468) {
  6776. if(invOverlayInterfaceID != -1) {
  6777. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  6778. } else if(tabInterfaceIDs[tabID] != -1) {
  6779. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  6780. }
  6781. }
  6782. if (anInt886 != anInt1048) {
  6783. needDrawTabArea = true;
  6784. tabAreaAltered = true;
  6785. anInt1048 = anInt886;
  6786. }
  6787. if (anInt1315 != anInt1044) {
  6788. needDrawTabArea = true;
  6789. tabAreaAltered = true;
  6790. anInt1044 = anInt1315;
  6791. }
  6792. anInt886 = 0;
  6793. anInt1315 = 0;
  6794. if(super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  6795. if(backDialogID != -1) {
  6796. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  6797. } else if(super.mouseY < 463 && super.mouseX < 490) {
  6798. buildChatAreaMenu(super.mouseY - 338);
  6799. }
  6800. }
  6801. if (backDialogID != -1 && anInt886 != anInt1039) {
  6802. inputTaken = true;
  6803. anInt1039 = anInt886;
  6804. }
  6805. if (backDialogID != -1 && anInt1315 != anInt1500) {
  6806. inputTaken = true;
  6807. anInt1500 = anInt1315;
  6808. }
  6809. /* Enable custom right click areas */
  6810. if(super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 && super.mouseY < 503)
  6811. rightClickChatButtons();
  6812. if(super.mouseX > 519 && super.mouseY > 0 && super.mouseX < 765 && super.mouseY < 168)
  6813. rightClickMapArea();
  6814.  
  6815. /**/
  6816. boolean flag = false;
  6817. while (!flag) {
  6818. flag = true;
  6819. for (int j = 0; j < menuActionRow - 1; j++) {
  6820. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  6821. String s = menuActionName[j];
  6822. menuActionName[j] = menuActionName[j + 1];
  6823. menuActionName[j + 1] = s;
  6824. int k = menuActionID[j];
  6825. menuActionID[j] = menuActionID[j + 1];
  6826. menuActionID[j + 1] = k;
  6827. k = menuActionCmd2[j];
  6828. menuActionCmd2[j] = menuActionCmd2[j + 1];
  6829. menuActionCmd2[j + 1] = k;
  6830. k = menuActionCmd3[j];
  6831. menuActionCmd3[j] = menuActionCmd3[j + 1];
  6832. menuActionCmd3[j + 1] = k;
  6833. k = menuActionCmd1[j];
  6834. menuActionCmd1[j] = menuActionCmd1[j + 1];
  6835. menuActionCmd1[j + 1] = k;
  6836. flag = false;
  6837. }
  6838. }
  6839. }
  6840. }
  6841.  
  6842. private int method83(int i, int j, int k)
  6843. {
  6844. int l = 256 - k;
  6845. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  6846. }
  6847.  
  6848. private void login(String s, String s1, boolean flag)
  6849. {
  6850. signlink.errorname = s;
  6851. try
  6852. {
  6853. if(!flag)
  6854. {
  6855. loginMessage1 = "";
  6856. loginMessage2 = "Connecting to server...";
  6857. drawLoginScreen(true);
  6858. }
  6859. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  6860. long l = TextClass.longForName(s);
  6861. int i = (int)(l >> 16 & 31L);
  6862. stream.currentOffset = 0;
  6863. stream.writeWordBigEndian(14);
  6864. stream.writeWordBigEndian(i);
  6865. socketStream.queueBytes(2, stream.buffer);
  6866. for(int j = 0; j < 8; j++)
  6867. socketStream.read();
  6868.  
  6869. int k = socketStream.read();
  6870. int i1 = k;
  6871. if(k == 0)
  6872. {
  6873. socketStream.flushInputStream(inStream.buffer, 8);
  6874. inStream.currentOffset = 0;
  6875. aLong1215 = inStream.readQWord();
  6876. int ai[] = new int[4];
  6877. ai[0] = (int)(Math.random() * 99999999D);
  6878. ai[1] = (int)(Math.random() * 99999999D);
  6879. ai[2] = (int)(aLong1215 >> 32);
  6880. ai[3] = (int)aLong1215;
  6881. stream.currentOffset = 0;
  6882. stream.writeWordBigEndian(10);
  6883. stream.writeDWord(ai[0]);
  6884. stream.writeDWord(ai[1]);
  6885. stream.writeDWord(ai[2]);
  6886. stream.writeDWord(ai[3]);
  6887. stream.writeDWord(/*signlink.uid*/999999);
  6888. // stream.writeString(CreateUID.generateUID());
  6889. stream.writeString(s);
  6890. stream.writeString(s1);
  6891. stream.doKeys();
  6892. aStream_847.currentOffset = 0;
  6893. if(flag)
  6894. aStream_847.writeWordBigEndian(18);
  6895. else
  6896. aStream_847.writeWordBigEndian(16);
  6897. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  6898. aStream_847.writeWordBigEndian(255);
  6899. aStream_847.writeWord(317);
  6900. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  6901. for(int l1 = 0; l1 < 9; l1++)
  6902. aStream_847.writeDWord(expectedCRCs[l1]);
  6903.  
  6904. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  6905. stream.encryption = new ISAACRandomGen(ai);
  6906. for(int j2 = 0; j2 < 4; j2++)
  6907. ai[j2] += 50;
  6908.  
  6909. encryption = new ISAACRandomGen(ai);
  6910. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  6911. k = socketStream.read();
  6912. }
  6913. if(k == 1)
  6914. {
  6915. try
  6916. {
  6917. Thread.sleep(2000L);
  6918. }
  6919. catch(Exception _ex) { }
  6920. login(s, s1, flag);
  6921. return;
  6922. }
  6923. if(k == 2)
  6924. {
  6925. myPrivilege = socketStream.read();
  6926. flagged = socketStream.read() == 1;
  6927. aLong1220 = 0L;
  6928. anInt1022 = 0;
  6929. mouseDetection.coordsIndex = 0;
  6930. super.awtFocus = true;
  6931. aBoolean954 = true;
  6932. loggedIn = true;
  6933. stream.currentOffset = 0;
  6934. inStream.currentOffset = 0;
  6935. pktType = -1;
  6936. anInt841 = -1;
  6937. anInt842 = -1;
  6938. anInt843 = -1;
  6939. pktSize = 0;
  6940. anInt1009 = 0;
  6941. anInt1104 = 0;
  6942. anInt1011 = 0;
  6943. anInt855 = 0;
  6944. menuActionRow = 0;
  6945. menuOpen = false;
  6946. super.idleTime = 0;
  6947. for(int j1 = 0; j1 < 100; j1++)
  6948. chatMessages[j1] = null;
  6949.  
  6950. itemSelected = 0;
  6951. spellSelected = 0;
  6952. loadingStage = 0;
  6953. anInt1062 = 0;
  6954. anInt1278 = (int)(Math.random() * 100D) - 50;
  6955. anInt1131 = (int)(Math.random() * 110D) - 55;
  6956. anInt896 = (int)(Math.random() * 80D) - 40;
  6957. minimapInt2 = (int)(Math.random() * 120D) - 60;
  6958. minimapInt3 = (int)(Math.random() * 30D) - 20;
  6959. minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
  6960. anInt1021 = 0;
  6961. anInt985 = -1;
  6962. destX = 0;
  6963. destY = 0;
  6964. playerCount = 0;
  6965. npcCount = 0;
  6966. for(int i2 = 0; i2 < maxPlayers; i2++)
  6967. {
  6968. playerArray[i2] = null;
  6969. aStreamArray895s[i2] = null;
  6970. }
  6971.  
  6972. for(int k2 = 0; k2 < 16384; k2++)
  6973. npcArray[k2] = null;
  6974.  
  6975. myPlayer = playerArray[myPlayerIndex] = new Player();
  6976. aClass19_1013.removeAll();
  6977. aClass19_1056.removeAll();
  6978. for(int l2 = 0; l2 < 4; l2++)
  6979. {
  6980. for(int i3 = 0; i3 < 104; i3++)
  6981. {
  6982. for(int k3 = 0; k3 < 104; k3++)
  6983. groundArray[l2][i3][k3] = null;
  6984.  
  6985. }
  6986.  
  6987. }
  6988.  
  6989. aClass19_1179 = new NodeList();
  6990. fullscreenInterfaceID = -1;
  6991. anInt900 = 0;
  6992. friendsCount = 0;
  6993. dialogID = -1;
  6994. backDialogID = -1;
  6995. openInterfaceID = -1;
  6996. invOverlayInterfaceID = -1;
  6997. anInt1018 = -1;
  6998. aBoolean1149 = false;
  6999. tabID = 3;
  7000. inputDialogState = 0;
  7001. menuOpen = false;
  7002. messagePromptRaised = false;
  7003. aString844 = null;
  7004. anInt1055 = 0;
  7005. anInt1054 = -1;
  7006. aBoolean1047 = true;
  7007. method45();
  7008. for(int j3 = 0; j3 < 5; j3++)
  7009. anIntArray990[j3] = 0;
  7010.  
  7011. for(int l3 = 0; l3 < 5; l3++)
  7012. {
  7013. atPlayerActions[l3] = null;
  7014. atPlayerArray[l3] = false;
  7015. }
  7016.  
  7017. anInt1175 = 0;
  7018. anInt1134 = 0;
  7019. anInt986 = 0;
  7020. anInt1288 = 0;
  7021. anInt924 = 0;
  7022. anInt1188 = 0;
  7023. anInt1155 = 0;
  7024. anInt1226 = 0;
  7025. int anInt941 = 0;
  7026. int anInt1260 = 0;
  7027. resetImageProducers2();
  7028. return;
  7029. }
  7030. if(k == 3)
  7031. {
  7032. loginMessage1 = "";
  7033. loginMessage2 = "Invalid username or password.";
  7034. return;
  7035. }
  7036. if(k == 4)
  7037. {
  7038. loginMessage1 = "Your account has been disabled.";
  7039. loginMessage2 = "Please check your message-center for details.";
  7040. return;
  7041. }
  7042. if(k == 5)
  7043. {
  7044. loginMessage1 = "Your account is already logged in.";
  7045. loginMessage2 = "Try again in 60 secs...";
  7046. return;
  7047. }
  7048. if(k == 6)
  7049. {
  7050. loginMessage1 = "The-Genesis has been updated!";
  7051. loginMessage2 = "Please reload this page.";
  7052. return;
  7053. }
  7054. if(k == 7)
  7055. {
  7056. loginMessage1 = "This world is full.";
  7057. loginMessage2 = "Please use a different world.";
  7058. return;
  7059. }
  7060. if(k == 8)
  7061. {
  7062. loginMessage1 = "Unable to connect.";
  7063. loginMessage2 = "Login server offline.";
  7064. return;
  7065. }
  7066. if(k == 9)
  7067. {
  7068. loginMessage1 = "Login limit exceeded.";
  7069. loginMessage2 = "Too many connections from your address.";
  7070. return;
  7071. }
  7072. if(k == 10)
  7073. {
  7074. loginMessage1 = "Unable to connect.";
  7075. loginMessage2 = "Bad session id.";
  7076. return;
  7077. }
  7078. if(k == 11)
  7079. {
  7080. loginMessage2 = "Login server rejected session.";
  7081. loginMessage2 = "Please try again.";
  7082. return;
  7083. }
  7084. if(k == 12)
  7085. {
  7086. loginMessage1 = "You need a members account to login to this world.";
  7087. loginMessage2 = "Please subscribe, or use a different world.";
  7088. return;
  7089. }
  7090. if(k == 13)
  7091. {
  7092. loginMessage1 = "Could not complete login.";
  7093. loginMessage2 = "Please try using a different world.";
  7094. return;
  7095. }
  7096. if(k == 14)
  7097. {
  7098. loginMessage1 = "The server is being updated.";
  7099. loginMessage2 = "Please wait 1 minute and try again.";
  7100. return;
  7101. }
  7102. if(k == 15)
  7103. {
  7104. loggedIn = true;
  7105. stream.currentOffset = 0;
  7106. inStream.currentOffset = 0;
  7107. pktType = -1;
  7108. anInt841 = -1;
  7109. anInt842 = -1;
  7110. anInt843 = -1;
  7111. pktSize = 0;
  7112. anInt1009 = 0;
  7113. anInt1104 = 0;
  7114. menuActionRow = 0;
  7115. menuOpen = false;
  7116. aLong824 = System.currentTimeMillis();
  7117. return;
  7118. }
  7119. if(k == 16)
  7120. {
  7121. loginMessage1 = "Login attempts exceeded.";
  7122. loginMessage2 = "Please wait 1 minute and try again.";
  7123. return;
  7124. }
  7125. if(k == 17)
  7126. {
  7127. loginMessage1 = "You are standing in a members-only area.";
  7128. loginMessage2 = "To play on this world move to a free area first";
  7129. return;
  7130. }
  7131. if(k == 20)
  7132. {
  7133. loginMessage1 = "Invalid loginserver requested";
  7134. loginMessage2 = "Please try using a different world.";
  7135. return;
  7136. }
  7137. if(k == 21)
  7138. {
  7139. for(int k1 = socketStream.read(); k1 >= 0; k1--)
  7140. {
  7141. loginMessage1 = "You have only just left another world";
  7142. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  7143. drawLoginScreen(true);
  7144. try
  7145. {
  7146. Thread.sleep(1000L);
  7147. }
  7148. catch(Exception _ex) { }
  7149. }
  7150.  
  7151. login(s, s1, flag);
  7152. return;
  7153. }
  7154. /*if(k == 22) {
  7155. loginMessage1 = "@red@Your computer has been UUID banned.";
  7156. loginMessage2 = "Please appeal on the forums.";
  7157. return;
  7158. }*/
  7159. if(k == -1)
  7160. {
  7161. if(i1 == 0)
  7162. {
  7163. if(loginFailures < 2)
  7164. {
  7165. try
  7166. {
  7167. Thread.sleep(2000L);
  7168. }
  7169. catch(Exception _ex) { }
  7170. loginFailures++;
  7171. login(s, s1, flag);
  7172. return;
  7173. } else
  7174. {
  7175. loginMessage1 = "No response from loginserver";
  7176. loginMessage2 = "Please wait 1 minute and try again.";
  7177. return;
  7178. }
  7179. } else
  7180. {
  7181. loginMessage1 = "No response from server";
  7182. loginMessage2 = "Please try using a different world.";
  7183. return;
  7184. }
  7185. } else
  7186. {
  7187. System.out.println("response:" + k);
  7188. loginMessage1 = "Unexpected server response";
  7189. loginMessage2 = "Please try using a different world.";
  7190. return;
  7191. }
  7192. }
  7193. catch(IOException _ex)
  7194. {
  7195. loginMessage1 = "";
  7196. }
  7197. loginMessage2 = "Error connecting to server.";
  7198. }
  7199.  
  7200. 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) {
  7201. byte byte0 = 104;
  7202. byte byte1 = 104;
  7203. for(int l2 = 0; l2 < byte0; l2++) {
  7204. for(int i3 = 0; i3 < byte1; i3++) {
  7205. anIntArrayArray901[l2][i3] = 0;
  7206. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  7207. }
  7208. }
  7209. int j3 = j2;
  7210. int k3 = j1;
  7211. anIntArrayArray901[j2][j1] = 99;
  7212. anIntArrayArray825[j2][j1] = 0;
  7213. int l3 = 0;
  7214. int i4 = 0;
  7215. bigX[l3] = j2;
  7216. bigY[l3++] = j1;
  7217. boolean flag1 = false;
  7218. int j4 = bigX.length;
  7219. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  7220. while(i4 != l3)
  7221. {
  7222. j3 = bigX[i4];
  7223. k3 = bigY[i4];
  7224. i4 = (i4 + 1) % j4;
  7225. if(j3 == k2 && k3 == i2)
  7226. {
  7227. flag1 = true;
  7228. break;
  7229. }
  7230. if(i1 != 0)
  7231. {
  7232. if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  7233. {
  7234. flag1 = true;
  7235. break;
  7236. }
  7237. if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  7238. {
  7239. flag1 = true;
  7240. break;
  7241. }
  7242. }
  7243. if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  7244. {
  7245. flag1 = true;
  7246. break;
  7247. }
  7248. int l4 = anIntArrayArray825[j3][k3] + 1;
  7249. if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  7250. {
  7251. bigX[l3] = j3 - 1;
  7252. bigY[l3] = k3;
  7253. l3 = (l3 + 1) % j4;
  7254. anIntArrayArray901[j3 - 1][k3] = 2;
  7255. anIntArrayArray825[j3 - 1][k3] = l4;
  7256. }
  7257. if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  7258. {
  7259. bigX[l3] = j3 + 1;
  7260. bigY[l3] = k3;
  7261. l3 = (l3 + 1) % j4;
  7262. anIntArrayArray901[j3 + 1][k3] = 8;
  7263. anIntArrayArray825[j3 + 1][k3] = l4;
  7264. }
  7265. if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  7266. {
  7267. bigX[l3] = j3;
  7268. bigY[l3] = k3 - 1;
  7269. l3 = (l3 + 1) % j4;
  7270. anIntArrayArray901[j3][k3 - 1] = 1;
  7271. anIntArrayArray825[j3][k3 - 1] = l4;
  7272. }
  7273. if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  7274. {
  7275. bigX[l3] = j3;
  7276. bigY[l3] = k3 + 1;
  7277. l3 = (l3 + 1) % j4;
  7278. anIntArrayArray901[j3][k3 + 1] = 4;
  7279. anIntArrayArray825[j3][k3 + 1] = l4;
  7280. }
  7281. 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)
  7282. {
  7283. bigX[l3] = j3 - 1;
  7284. bigY[l3] = k3 - 1;
  7285. l3 = (l3 + 1) % j4;
  7286. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  7287. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  7288. }
  7289. 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)
  7290. {
  7291. bigX[l3] = j3 + 1;
  7292. bigY[l3] = k3 - 1;
  7293. l3 = (l3 + 1) % j4;
  7294. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  7295. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  7296. }
  7297. 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)
  7298. {
  7299. bigX[l3] = j3 - 1;
  7300. bigY[l3] = k3 + 1;
  7301. l3 = (l3 + 1) % j4;
  7302. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  7303. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  7304. }
  7305. 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)
  7306. {
  7307. bigX[l3] = j3 + 1;
  7308. bigY[l3] = k3 + 1;
  7309. l3 = (l3 + 1) % j4;
  7310. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  7311. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  7312. }
  7313. }
  7314. anInt1264 = 0;
  7315. if(!flag1)
  7316. {
  7317. if(flag)
  7318. {
  7319. int i5 = 100;
  7320. for(int k5 = 1; k5 < 2; k5++)
  7321. {
  7322. for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  7323. {
  7324. for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  7325. if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  7326. {
  7327. i5 = anIntArrayArray825[i6][l6];
  7328. j3 = i6;
  7329. k3 = l6;
  7330. anInt1264 = 1;
  7331. flag1 = true;
  7332. }
  7333.  
  7334. }
  7335.  
  7336. if(flag1)
  7337. break;
  7338. }
  7339.  
  7340. }
  7341. if(!flag1)
  7342. return false;
  7343. }
  7344. i4 = 0;
  7345. bigX[i4] = j3;
  7346. bigY[i4++] = k3;
  7347. int l5;
  7348. for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  7349. {
  7350. if(j5 != l5)
  7351. {
  7352. l5 = j5;
  7353. bigX[i4] = j3;
  7354. bigY[i4++] = k3;
  7355. }
  7356. if((j5 & 2) != 0)
  7357. j3++;
  7358. else
  7359. if((j5 & 8) != 0)
  7360. j3--;
  7361. if((j5 & 1) != 0)
  7362. k3++;
  7363. else
  7364. if((j5 & 4) != 0)
  7365. k3--;
  7366. }
  7367. // if(cancelWalk) { return i4 > 0; }
  7368.  
  7369.  
  7370. if(i4 > 0)
  7371. {
  7372. int k4 = i4;
  7373. if(k4 > 25)
  7374. k4 = 25;
  7375. i4--;
  7376. int k6 = bigX[i4];
  7377. int i7 = bigY[i4];
  7378. anInt1288 += k4;
  7379. if(anInt1288 >= 92)
  7380. {
  7381. stream.createFrame(36);
  7382. stream.writeDWord(0);
  7383. anInt1288 = 0;
  7384. }
  7385. if(i == 0)
  7386. {
  7387. stream.createFrame(164);
  7388. stream.writeWordBigEndian(k4 + k4 + 3);
  7389. }
  7390. if(i == 1)
  7391. {
  7392. stream.createFrame(248);
  7393. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  7394. }
  7395. if(i == 2)
  7396. {
  7397. stream.createFrame(98);
  7398. stream.writeWordBigEndian(k4 + k4 + 3);
  7399. }
  7400. stream.method433(k6 + baseX);
  7401. destX = bigX[0];
  7402. destY = bigY[0];
  7403. for(int j7 = 1; j7 < k4; j7++)
  7404. {
  7405. i4--;
  7406. stream.writeWordBigEndian(bigX[i4] - k6);
  7407. stream.writeWordBigEndian(bigY[i4] - i7);
  7408. }
  7409.  
  7410. stream.method431(i7 + baseY);
  7411. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  7412. return true;
  7413. }
  7414. return i != 1;
  7415. }
  7416.  
  7417. private void method86(Stream stream)
  7418. {
  7419. for(int j = 0; j < anInt893; j++)
  7420. {
  7421. int k = anIntArray894[j];
  7422. NPC npc = npcArray[k];
  7423. int l = stream.readUnsignedByte();
  7424. if((l & 0x10) != 0)
  7425. {
  7426. int i1 = stream.method434();
  7427. if(i1 == 65535)
  7428. i1 = -1;
  7429. int i2 = stream.readUnsignedByte();
  7430. if(i1 == npc.anim && i1 != -1)
  7431. {
  7432. int l2 = Animation.anims[i1].anInt365;
  7433. if(l2 == 1)
  7434. {
  7435. npc.anInt1527 = 0;
  7436. npc.anInt1528 = 0;
  7437. npc.anInt1529 = i2;
  7438. npc.anInt1530 = 0;
  7439. }
  7440. if(l2 == 2)
  7441. npc.anInt1530 = 0;
  7442. } else
  7443. if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  7444. {
  7445. npc.anim = i1;
  7446. npc.anInt1527 = 0;
  7447. npc.anInt1528 = 0;
  7448. npc.anInt1529 = i2;
  7449. npc.anInt1530 = 0;
  7450. npc.anInt1542 = npc.smallXYIndex;
  7451. }
  7452. }
  7453. if((l & 8) != 0)
  7454. {
  7455. int j1 = stream.method426();
  7456. int j2 = stream.method427();
  7457. npc.updateHitData(j2, j1, loopCycle);
  7458. npc.loopCycleStatus = loopCycle + 300;
  7459. npc.currentHealth = stream.method426();
  7460. npc.maxHealth = stream.readUnsignedByte();
  7461. }
  7462. if((l & 0x80) != 0)
  7463. {
  7464. npc.anInt1520 = stream.readUnsignedWord();
  7465. int k1 = stream.readDWord();
  7466. npc.anInt1524 = k1 >> 16;
  7467. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  7468. npc.anInt1521 = 0;
  7469. npc.anInt1522 = 0;
  7470. if(npc.anInt1523 > loopCycle)
  7471. npc.anInt1521 = -1;
  7472. if(npc.anInt1520 == 65535)
  7473. npc.anInt1520 = -1;
  7474. }
  7475. if((l & 0x20) != 0)
  7476. {
  7477. npc.interactingEntity = stream.readUnsignedWord();
  7478. if(npc.interactingEntity == 65535)
  7479. npc.interactingEntity = -1;
  7480. }
  7481. if((l & 1) != 0)
  7482. {
  7483. npc.textSpoken = stream.readString();
  7484. npc.textCycle = 100;
  7485. // entityMessage(npc);
  7486.  
  7487. }
  7488. if((l & 0x40) != 0)
  7489. {
  7490. int l1 = stream.method427();
  7491. int k2 = stream.method428();
  7492. npc.updateHitData(k2, l1, loopCycle);
  7493. npc.loopCycleStatus = loopCycle + 300;
  7494. npc.currentHealth = stream.method428();
  7495. npc.maxHealth = stream.method427();
  7496. }
  7497. if((l & 2) != 0)
  7498. {
  7499. npc.desc = EntityDef.forID(stream.method436());
  7500. npc.anInt1540 = npc.desc.aByte68;
  7501. npc.anInt1504 = npc.desc.anInt79;
  7502. npc.anInt1554 = npc.desc.walkAnim;
  7503. npc.anInt1555 = npc.desc.anInt58;
  7504. npc.anInt1556 = npc.desc.anInt83;
  7505. npc.anInt1557 = npc.desc.anInt55;
  7506. npc.anInt1511 = npc.desc.standAnim;
  7507. }
  7508. if((l & 4) != 0)
  7509. {
  7510. npc.anInt1538 = stream.method434();
  7511. npc.anInt1539 = stream.method434();
  7512. }
  7513. }
  7514. }
  7515.  
  7516. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  7517. {
  7518. if(menuActionRow >= 400)
  7519. return;
  7520. if(entityDef.childrenIDs != null)
  7521. entityDef = entityDef.method161();
  7522. if(entityDef == null)
  7523. return;
  7524. if(!entityDef.aBoolean84)
  7525. return;
  7526. String s = entityDef.name;
  7527. if(entityDef.combatLevel != 0)
  7528. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  7529. if(itemSelected == 1)
  7530. {
  7531. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  7532. menuActionID[menuActionRow] = 582;
  7533. menuActionCmd1[menuActionRow] = i;
  7534. menuActionCmd2[menuActionRow] = k;
  7535. menuActionCmd3[menuActionRow] = j;
  7536. menuActionRow++;
  7537. return;
  7538. }
  7539. if(spellSelected == 1)
  7540. {
  7541. if((spellUsableOn & 2) == 2)
  7542. {
  7543. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  7544. menuActionID[menuActionRow] = 413;
  7545. menuActionCmd1[menuActionRow] = i;
  7546. menuActionCmd2[menuActionRow] = k;
  7547. menuActionCmd3[menuActionRow] = j;
  7548. menuActionRow++;
  7549. }
  7550. } else
  7551. {
  7552. if(entityDef.actions != null)
  7553. {
  7554. for(int l = 4; l >= 0; l--)
  7555. if(entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack"))
  7556. {
  7557. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  7558. if(l == 0)
  7559. menuActionID[menuActionRow] = 20;
  7560. if(l == 1)
  7561. menuActionID[menuActionRow] = 412;
  7562. if(l == 2)
  7563. menuActionID[menuActionRow] = 225;
  7564. if(l == 3)
  7565. menuActionID[menuActionRow] = 965;
  7566. if(l == 4)
  7567. menuActionID[menuActionRow] = 478;
  7568. menuActionCmd1[menuActionRow] = i;
  7569. menuActionCmd2[menuActionRow] = k;
  7570. menuActionCmd3[menuActionRow] = j;
  7571. menuActionRow++;
  7572. }
  7573.  
  7574. }
  7575. if(entityDef.actions != null)
  7576. {
  7577. for(int i1 = 4; i1 >= 0; i1--)
  7578. if(entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack"))
  7579. {
  7580. char c = '\0';
  7581. if(entityDef.combatLevel > myPlayer.combatLevel)
  7582. c = '\u07D0';
  7583. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  7584. if(i1 == 0)
  7585. menuActionID[menuActionRow] = 20 + c;
  7586. if(i1 == 1)
  7587. menuActionID[menuActionRow] = 412 + c;
  7588. if(i1 == 2)
  7589. menuActionID[menuActionRow] = 225 + c;
  7590. if(i1 == 3)
  7591. menuActionID[menuActionRow] = 965 + c;
  7592. if(i1 == 4)
  7593. menuActionID[menuActionRow] = 478 + c;
  7594. menuActionCmd1[menuActionRow] = i;
  7595. menuActionCmd2[menuActionRow] = k;
  7596. menuActionCmd3[menuActionRow] = j;
  7597. menuActionRow++;
  7598. }
  7599.  
  7600. }
  7601. //menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.type + "@gre@)";
  7602. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7603. menuActionID[menuActionRow] = 1025;
  7604. menuActionCmd1[menuActionRow] = i;
  7605. menuActionCmd2[menuActionRow] = k;
  7606. menuActionCmd3[menuActionRow] = j;
  7607. menuActionRow++;
  7608. }
  7609. }
  7610.  
  7611.  
  7612. private void buildAtPlayerMenu(int i, int j, Player player, int k)
  7613. {
  7614. if(player == myPlayer)
  7615. return;
  7616. if(menuActionRow >= 400)
  7617. return;
  7618. String s;
  7619. if (player.skill == 0) {
  7620. s = player.name
  7621. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  7622. + " (level-" + player.combatLevel + ")";
  7623. } else {
  7624. s = "@" + titleColor(player.titleColor, 1) + "@" + player.title + "@whi@ " + player.name
  7625. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  7626. + " (level-" + player.combatLevel + ")";
  7627. }
  7628. if(itemSelected == 1)
  7629. {
  7630. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
  7631. menuActionID[menuActionRow] = 491;
  7632. menuActionCmd1[menuActionRow] = j;
  7633. menuActionCmd2[menuActionRow] = i;
  7634. menuActionCmd3[menuActionRow] = k;
  7635. menuActionRow++;
  7636. } else
  7637. if(spellSelected == 1)
  7638. {
  7639. if((spellUsableOn & 8) == 8)
  7640. {
  7641. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  7642. menuActionID[menuActionRow] = 365;
  7643. menuActionCmd1[menuActionRow] = j;
  7644. menuActionCmd2[menuActionRow] = i;
  7645. menuActionCmd3[menuActionRow] = k;
  7646. menuActionRow++;
  7647. }
  7648. } else
  7649. {
  7650. for(int l = 4; l >= 0; l--)
  7651. if(atPlayerActions[l] != null)
  7652. {
  7653. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  7654. char c = '\0';
  7655. if(atPlayerActions[l].equalsIgnoreCase("attack"))
  7656. {
  7657. if(player.combatLevel > myPlayer.combatLevel)
  7658. c = '\u07D0';
  7659. if(myPlayer.team != 0 && player.team != 0)
  7660. if(myPlayer.team == player.team)
  7661. c = '\u07D0';
  7662. else
  7663. c = '\0';
  7664. } else
  7665. if(atPlayerArray[l])
  7666. c = '\u07D0';
  7667. if(l == 0)
  7668. menuActionID[menuActionRow] = 561 + c;
  7669. if(l == 1)
  7670. menuActionID[menuActionRow] = 779 + c;
  7671. if(l == 2)
  7672. menuActionID[menuActionRow] = 27 + c;
  7673. if(l == 3)
  7674. menuActionID[menuActionRow] = 577 + c;
  7675. if(l == 4)
  7676. menuActionID[menuActionRow] = 729 + c;
  7677. menuActionCmd1[menuActionRow] = j;
  7678. menuActionCmd2[menuActionRow] = i;
  7679. menuActionCmd3[menuActionRow] = k;
  7680. menuActionRow++;
  7681. }
  7682.  
  7683. }
  7684. for(int i1 = 0; i1 < menuActionRow; i1++)
  7685. if(menuActionID[i1] == 516)
  7686. {
  7687. menuActionName[i1] = "Walk here @whi@" + s;
  7688. return;
  7689. }
  7690.  
  7691. }
  7692.  
  7693. private void method89(Class30_Sub1 class30_sub1)
  7694. {
  7695. int i = 0;
  7696. int j = -1;
  7697. int k = 0;
  7698. int l = 0;
  7699. if(class30_sub1.anInt1296 == 0)
  7700. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7701. if(class30_sub1.anInt1296 == 1)
  7702. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7703. if(class30_sub1.anInt1296 == 2)
  7704. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7705. if(class30_sub1.anInt1296 == 3)
  7706. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7707. if(i != 0)
  7708. {
  7709. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7710. j = i >> 14 & 0x7fff;
  7711. k = i1 & 0x1f;
  7712. l = i1 >> 6;
  7713. }
  7714. class30_sub1.anInt1299 = j;
  7715. class30_sub1.anInt1301 = k;
  7716. class30_sub1.anInt1300 = l;
  7717. }
  7718.  
  7719. private void method90()
  7720. {
  7721. for(int i = 0; i < anInt1062; i++)
  7722. if(anIntArray1250[i] <= 0)
  7723. {
  7724. boolean flag1 = false;
  7725. try
  7726. {
  7727. if(anIntArray1207[i] == anInt874 && anIntArray1241[i] == anInt1289)
  7728. {
  7729. if(!replayWave())
  7730. flag1 = true;
  7731. } else
  7732. {
  7733. Stream stream = Sounds.method241(anIntArray1241[i], anIntArray1207[i]);
  7734. if(System.currentTimeMillis() + (long)(stream.currentOffset / 22) > aLong1172 + (long)(anInt1257 / 22))
  7735. {
  7736. anInt1257 = stream.currentOffset;
  7737. aLong1172 = System.currentTimeMillis();
  7738. if(saveWave(stream.buffer, stream.currentOffset))
  7739. {
  7740. anInt874 = anIntArray1207[i];
  7741. anInt1289 = anIntArray1241[i];
  7742. } else
  7743. {
  7744. flag1 = true;
  7745. }
  7746. }
  7747. }
  7748. }
  7749. catch(Exception exception) { }
  7750. if(!flag1 || anIntArray1250[i] == -5)
  7751. {
  7752. anInt1062--;
  7753. for(int j = i; j < anInt1062; j++)
  7754. {
  7755. anIntArray1207[j] = anIntArray1207[j + 1];
  7756. anIntArray1241[j] = anIntArray1241[j + 1];
  7757. anIntArray1250[j] = anIntArray1250[j + 1];
  7758. }
  7759.  
  7760. i--;
  7761. } else
  7762. {
  7763. anIntArray1250[i] = -5;
  7764. }
  7765. } else
  7766. {
  7767. anIntArray1250[i]--;
  7768. }
  7769.  
  7770. if(prevSong > 0)
  7771. {
  7772. prevSong -= 20;
  7773. if(prevSong < 0)
  7774. prevSong = 0;
  7775. if(prevSong == 0 && musicEnabled && !lowMem)
  7776. {
  7777. nextSong = currentSong;
  7778. songChanging = true;
  7779. onDemandFetcher.method558(2, nextSong);
  7780. }
  7781. }
  7782. }
  7783.  
  7784. void startUp()
  7785. {
  7786. new CacheDownloader().run();
  7787. drawLoadingText(20, "Starting up");
  7788. //repackCacheIndex(1);
  7789. //repackCacheIndex(2);
  7790. //repackCacheIndex(4);
  7791. if(signlink.sunjava)
  7792. super.minDelay = 5;
  7793. if(aBoolean993)
  7794. {
  7795. // rsAlreadyLoaded = true;
  7796. // return;
  7797. }
  7798. aBoolean993 = true;
  7799. boolean flag = true;
  7800. String s = getDocumentBaseHost();
  7801. if(signlink.cache_dat != null)
  7802. {
  7803. for(int i = 0; i < 5; i++)
  7804. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  7805. } try {
  7806. titleStreamLoader = streamLoaderForName(1, "title screen", "title",
  7807. expectedCRCs[1], 25);
  7808. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  7809. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  7810. chatTextDrawingArea = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  7811. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  7812. newSmallFont = new RSFont(false, "p11_full", titleStreamLoader);
  7813. newRegularFont = new RSFont(false, "p12_full", titleStreamLoader);
  7814. newBoldFont = new RSFont(false, "b12_full", titleStreamLoader);
  7815. newFancyFont = new RSFont(true, "q8_full", titleStreamLoader);
  7816. newSmallText = new FontSystem(false, "p11_full", titleStreamLoader);
  7817. regularText = new FontSystem(false, "p12_full", titleStreamLoader);
  7818. boldText = new FontSystem(false, "b12_full", titleStreamLoader);
  7819. fancyText = new FontSystem(true, "q8_full", titleStreamLoader);
  7820. newSmallFont.unpackChatImages(chatImages);
  7821. newRegularFont.unpackChatImages(chatImages);
  7822. newBoldFont.unpackChatImages(chatImages);
  7823. newFancyFont.unpackChatImages(chatImages);
  7824.  
  7825. newSmallText.unpackChatImages(crownImages);
  7826. regularText.unpackChatImages(crownImages);
  7827. boldText.unpackChatImages(crownImages);
  7828. fancyText.unpackChatImages(crownImages);
  7829.  
  7830. drawLogo();
  7831. loadTitleScreen();
  7832. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  7833. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  7834. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  7835. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  7836. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  7837. StreamLoader streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  7838. byteGroundArray = new byte[4][104][104];
  7839. intGroundArray = new int[4][105][105];
  7840. worldController = new WorldController(intGroundArray);
  7841. for(int j = 0; j < 4; j++)
  7842. aClass11Array1230[j] = new Class11();
  7843.  
  7844. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  7845. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  7846. drawLoadingText(60, "Connecting to update server");
  7847. onDemandFetcher = new OnDemandFetcher();
  7848. onDemandFetcher.start(streamLoader_6, this);
  7849. //Class36.animationlist = new Class36[2500][0];
  7850. Class36.method528(onDemandFetcher.getAnimCount());
  7851. Model.method459(onDemandFetcher.getVersionCount(0), onDemandFetcher);
  7852. ModelDecompressor.loadModels();
  7853. ModelDecompressor.loadModels2();
  7854. preloadModels();
  7855. if(!lowMem)
  7856. {
  7857. nextSong = 0;
  7858. try
  7859. {
  7860. nextSong = Integer.parseInt(getParameter("music"));
  7861. }
  7862. catch(Exception _ex) { }
  7863. songChanging = true;
  7864. onDemandFetcher.method558(2, nextSong);
  7865. while(onDemandFetcher.getNodeCount() > 0)
  7866. {
  7867. processOnDemandQueue();
  7868. try
  7869. {
  7870. Thread.sleep(100L);
  7871. }
  7872. catch(Exception _ex) { }
  7873. if(onDemandFetcher.anInt1349 > 3)
  7874. {
  7875. loadError();
  7876. return;
  7877. }
  7878. }
  7879. }
  7880. drawLoadingText(65, "Requesting animations");
  7881. int k = onDemandFetcher.getVersionCount(1);
  7882. for(int i1 = 0; i1 < k; i1++)
  7883. onDemandFetcher.method558(1, i1);
  7884.  
  7885. while(onDemandFetcher.getNodeCount() > 0)
  7886. {
  7887. int j1 = k - onDemandFetcher.getNodeCount();
  7888. if(j1 > 0)
  7889. drawLoadingText(65, "Loading animations - " + (j1 * 100) / k + "%");
  7890. processOnDemandQueue();
  7891. try
  7892. {
  7893. Thread.sleep(100L);
  7894. }
  7895. catch(Exception _ex) { }
  7896. if(onDemandFetcher.anInt1349 > 3)
  7897. {
  7898. loadError();
  7899. return;
  7900. }
  7901. }
  7902. drawLoadingText(70, "Requesting models");
  7903. k = onDemandFetcher.getVersionCount(0);
  7904. for(int k1 = 0; k1 < k; k1++)
  7905. {
  7906. int l1 = onDemandFetcher.getModelIndex(k1);
  7907. if((l1 & 1) != 0)
  7908. onDemandFetcher.method558(0, k1);
  7909. }
  7910.  
  7911. k = onDemandFetcher.getNodeCount();
  7912. while(onDemandFetcher.getNodeCount() > 0)
  7913. {
  7914. int i2 = k - onDemandFetcher.getNodeCount();
  7915. if(i2 > 0)
  7916. drawLoadingText(70, "Loading models - " + (i2 * 100) / k + "%");
  7917. processOnDemandQueue();
  7918. try
  7919. {
  7920. Thread.sleep(100L);
  7921. }
  7922. catch(Exception _ex) { }
  7923. }
  7924. if(decompressors[0] != null)
  7925. {
  7926. drawLoadingText(75, "Requesting maps");
  7927. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 47));
  7928. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 47));
  7929. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 48));
  7930. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 48));
  7931. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 49));
  7932. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 49));
  7933. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 47));
  7934. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 47));
  7935. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 48));
  7936. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 48));
  7937. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 148, 48));
  7938. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 148, 48));
  7939. k = onDemandFetcher.getNodeCount();
  7940. while(onDemandFetcher.getNodeCount() > 0)
  7941. {
  7942. int j2 = k - onDemandFetcher.getNodeCount();
  7943. if(j2 > 0)
  7944. drawLoadingText(75, "Loading maps - " + (j2 * 100) / k + "%");
  7945. processOnDemandQueue();
  7946. try
  7947. {
  7948. Thread.sleep(100L);
  7949. }
  7950. catch(Exception _ex) { }
  7951. }
  7952. }
  7953. k = onDemandFetcher.getVersionCount(0);
  7954. for(int k2 = 0; k2 < k; k2++)
  7955. {
  7956. int l2 = onDemandFetcher.getModelIndex(k2);
  7957. byte byte0 = 0;
  7958. if((l2 & 8) != 0)
  7959. byte0 = 10;
  7960. else
  7961. if((l2 & 0x20) != 0)
  7962. byte0 = 9;
  7963. else
  7964. if((l2 & 0x10) != 0)
  7965. byte0 = 8;
  7966. else
  7967. if((l2 & 0x40) != 0)
  7968. byte0 = 7;
  7969. else
  7970. if((l2 & 0x80) != 0)
  7971. byte0 = 6;
  7972. else
  7973. if((l2 & 2) != 0)
  7974. byte0 = 5;
  7975. else
  7976. if((l2 & 4) != 0)
  7977. byte0 = 4;
  7978. if((l2 & 1) != 0)
  7979. byte0 = 3;
  7980. if(byte0 != 0)
  7981. onDemandFetcher.method563(byte0, 0, k2);
  7982. }
  7983.  
  7984. onDemandFetcher.method554(isMembers);
  7985. if(!lowMem)
  7986. {
  7987. int l = onDemandFetcher.getVersionCount(2);
  7988. for(int i3 = 1; i3 < l; i3++)
  7989. if(onDemandFetcher.method569(i3))
  7990. onDemandFetcher.method563((byte)1, 2, i3);
  7991.  
  7992. }
  7993. drawLoadingText(80, "Unpacking media");
  7994. /* Custom sprite unpacking */
  7995. worldMapIcon = new Sprite("mapicon");
  7996. logIcon = new Sprite("logicon");
  7997. logIconH = new Sprite("logiconh");
  7998. logIconC = new Sprite("logiconc");
  7999. for(int i = 1; i <= 15; i++) {
  8000. ORBS[i] = new Sprite("Gameframe/Orbs/ORBS "+i+"");
  8001. }
  8002. for(int i = 0; i <= 7; i++){
  8003. crownImages[i] = new Sprite("Player/"+i);
  8004. }
  8005. HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/HITPOINTS_0.PNG", 1);
  8006. HPBarEmpty = new Sprite(sign.signlink.findcachedir() + "Sprites/HITPOINTS_1.PNG", 1);
  8007. emptyOrb = new Sprite("emptyorb");
  8008. hoverOrb = new Sprite("hoverorb");
  8009. hoverorbrun2 = new Sprite("hoverorbrun2");
  8010. hoverorbrun = new Sprite("hoverorbrun");
  8011. hitPointsFill = new Sprite("hitpointsfill");
  8012. prayerFill = new Sprite("prayerfill");
  8013.  
  8014. chatArea = new Sprite("chatarea");
  8015. tabArea = new Sprite("tabarea");
  8016. mapArea = new Sprite("maparea");
  8017. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  8018. /**/
  8019. mapBack = new Background(streamLoader_2, "mapback", 0);
  8020. for(int c1 = 0; c1 <= 3; c1++)
  8021. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  8022. for(int j3 = 0; j3 <= 14; j3++)
  8023. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  8024. for(int r1 = 0; r1 < 5; r1++)
  8025. redStones[r1] = new Sprite("redstones " + r1);
  8026. compass = new Sprite(streamLoader_2, "compass", 0);
  8027. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  8028. mapEdge.method345();
  8029. try
  8030. {
  8031. for(int k3 = 0; k3 < 100; k3++)
  8032. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  8033. }
  8034. catch(Exception _ex) { }
  8035. try
  8036. {
  8037. for(int l3 = 0; l3 < 100; l3++)
  8038. mapFunctions[l3] = new Sprite(streamLoader_2, "mapfunction", l3);
  8039. }
  8040. catch(Exception _ex) { }
  8041. try
  8042. {
  8043. for(int i4 = 0; i4 < 20; i4++)
  8044. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  8045. }
  8046. catch(Exception _ex) { }
  8047. try
  8048. {
  8049. for(int h1 = 0; h1 < 6; h1++)
  8050. headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
  8051. } catch(Exception _ex) { }
  8052. try {
  8053. for(int j4 = 0; j4 < 8; j4++)
  8054. headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);
  8055. for(int j45 = 0; j45 < 3; j45++)
  8056. skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45 );
  8057. }
  8058. catch(Exception _ex) { }
  8059. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  8060. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  8061. for(int k4 = 0; k4 < 8; k4++)
  8062. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  8063.  
  8064. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  8065. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  8066. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  8067. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  8068. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  8069. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  8070. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  8071. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  8072.  
  8073. for(int l4 = 1; l4 < 8; l4++)
  8074. modIcons[l4 - 1] = new Sprite("Player" + File.separator + l4);
  8075.  
  8076. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  8077. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8078. sprite.method346(0, 0);
  8079. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  8080. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8081. sprite.method346(0, 0);
  8082. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  8083. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8084. sprite.method346(0, 0);
  8085. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  8086. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8087. sprite.method346(0, 0);
  8088.  
  8089. int i5 = (int)(Math.random() * 21D) - 10;
  8090. int j5 = (int)(Math.random() * 21D) - 10;
  8091. int k5 = (int)(Math.random() * 21D) - 10;
  8092. int l5 = (int)(Math.random() * 41D) - 20;
  8093. for(int i6 = 0; i6 < 100; i6++)
  8094. {
  8095. if(mapFunctions[i6] != null)
  8096. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  8097. if(mapScenes[i6] != null)
  8098. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  8099. }
  8100.  
  8101. drawLoadingText(83, "Unpacking textures");
  8102. Texture.method368(streamLoader_3);
  8103. Texture.method372(0.80000000000000004D);
  8104. Texture.method367();
  8105. drawLoadingText(86, "Unpacking config");
  8106. Animation.unpackConfig(streamLoader);
  8107. ObjectDef.unpackConfig(streamLoader);
  8108. Flo.unpackConfig(streamLoader);
  8109. ItemDef.unpackConfig(streamLoader);
  8110. EntityDef.unpackConfig(streamLoader);
  8111. IDK.unpackConfig(streamLoader);
  8112. SpotAnim.unpackConfig(streamLoader);
  8113. Varp.unpackConfig(streamLoader);
  8114. VarBit.unpackConfig(streamLoader);
  8115. ItemDef.isMembers = isMembers;
  8116. if(!lowMem)
  8117. {
  8118. drawLoadingText(90, "Unpacking sounds");
  8119. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  8120. Stream stream = new Stream(abyte0);
  8121. Sounds.unpack(stream);
  8122. }
  8123. drawLoadingText(95, "Unpacking interfaces");
  8124. TextDrawingArea aclass30_sub2_sub1_sub4s[] = {
  8125. smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  8126. };
  8127. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  8128. drawLoadingText(100, "Preparing game engine");
  8129. for(int j6 = 0; j6 < 33; j6++)
  8130. {
  8131. int k6 = 999;
  8132. int i7 = 0;
  8133. for(int k7 = 0; k7 < 34; k7++)
  8134. {
  8135. if(mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0)
  8136. {
  8137. if(k6 == 999)
  8138. k6 = k7;
  8139. continue;
  8140. }
  8141. if(k6 == 999)
  8142. continue;
  8143. i7 = k7;
  8144. break;
  8145. }
  8146.  
  8147. anIntArray968[j6] = k6;
  8148. anIntArray1057[j6] = i7 - k6;
  8149. }
  8150.  
  8151. for(int l6 = 5; l6 < 156; l6++)
  8152. {
  8153. int j7 = 999;
  8154. int l7 = 0;
  8155. for(int j8 = 25; j8 < 172; j8++)
  8156. {
  8157. if(mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34))
  8158. {
  8159. if(j7 == 999)
  8160. j7 = j8;
  8161. continue;
  8162. }
  8163. if(j7 == 999)
  8164. continue;
  8165. l7 = j8;
  8166. break;
  8167. }
  8168.  
  8169. anIntArray1052[l6 - 5] = j7 - 25;
  8170. anIntArray1229[l6 - 5] = l7 - j7;
  8171. }
  8172.  
  8173. Texture.method365(765, 503);
  8174. fullScreenTextureArray = Texture.anIntArray1472;
  8175. Texture.method365(519, 165);
  8176. anIntArray1180 = Texture.anIntArray1472;
  8177. Texture.method365(246, 335);
  8178. anIntArray1181 = Texture.anIntArray1472;
  8179. Texture.method365(512, 334);
  8180. anIntArray1182 = Texture.anIntArray1472;
  8181. int ai[] = new int[9];
  8182. for(int i8 = 0; i8 < 9; i8++)
  8183. {
  8184. int k8 = 128 + i8 * 32 + 15;
  8185. int l8 = 600 + k8 * 3;
  8186. int i9 = Texture.anIntArray1470[k8];
  8187. ai[i8] = l8 * i9 >> 16;
  8188. }
  8189.  
  8190. WorldController.method310(500, 800, 512, 334, ai);
  8191. Censor.loadConfig(streamLoader_4);
  8192. mouseDetection = new MouseDetection(this);
  8193. startRunnable(mouseDetection, 10);
  8194. Animable_Sub5.clientInstance = this;
  8195. ObjectDef.clientInstance = this;
  8196. EntityDef.clientInstance = this;
  8197. return;
  8198. }
  8199. catch(Exception exception)
  8200. {
  8201. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  8202. }
  8203. loadingError = true;
  8204. }
  8205. public int getOrbTextColor(int statusInt){
  8206. if(statusInt >= 75 && statusInt <= 164){
  8207. return 0x00FF00;
  8208. } else if(statusInt >= 50 && statusInt <= 74){
  8209. return 0xFFFF00;
  8210. } else if(statusInt >= 25 && statusInt <= 49){
  8211. return 0xFF981F;
  8212. } else {
  8213. return 0xFF0000;
  8214. }
  8215. }
  8216.  
  8217. private void method91(Stream stream, int i)
  8218. {
  8219. while(stream.bitPosition + 10 < i * 8)
  8220. {
  8221. int j = stream.readBits(11);
  8222. if(j == 2047)
  8223. break;
  8224. if(playerArray[j] == null)
  8225. {
  8226. playerArray[j] = new Player();
  8227. if(aStreamArray895s[j] != null)
  8228. playerArray[j].updatePlayer(aStreamArray895s[j]);
  8229. }
  8230. playerIndices[playerCount++] = j;
  8231. Player player = playerArray[j];
  8232. player.anInt1537 = loopCycle;
  8233. int k = stream.readBits(1);
  8234. if(k == 1)
  8235. anIntArray894[anInt893++] = j;
  8236. int l = stream.readBits(1);
  8237. int i1 = stream.readBits(5);
  8238. if(i1 > 15)
  8239. i1 -= 32;
  8240. int j1 = stream.readBits(5);
  8241. if(j1 > 15)
  8242. j1 -= 32;
  8243. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  8244. }
  8245. stream.finishBitAccess();
  8246. }
  8247.  
  8248. private void processMainScreenClick() {
  8249. if(anInt1021 != 0)
  8250. return;
  8251. if(super.clickMode3 == 1) {
  8252. int i = super.saveClickX - 25 - 545;
  8253. int j = super.saveClickY - 5 - 4;
  8254. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  8255. i -= 73;
  8256. j -= 75;
  8257. int k = minimapInt1 + minimapInt2 & 0x7ff;
  8258. int i1 = Texture.anIntArray1470[k];
  8259. int j1 = Texture.anIntArray1471[k];
  8260. i1 = i1 * (minimapInt3 + 256) >> 8;
  8261. j1 = j1 * (minimapInt3 + 256) >> 8;
  8262. int k1 = j * i1 + i * j1 >> 11;
  8263. int l1 = j * j1 - i * i1 >> 11;
  8264. int i2 = myPlayer.x + k1 >> 7;
  8265. int j2 = myPlayer.y - l1 >> 7;
  8266. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  8267. if(flag1) {
  8268. stream.writeWordBigEndian(i);
  8269. stream.writeWordBigEndian(j);
  8270. stream.writeWord(minimapInt1);
  8271. stream.writeWordBigEndian(57);
  8272. stream.writeWordBigEndian(minimapInt2);
  8273. stream.writeWordBigEndian(minimapInt3);
  8274. stream.writeWordBigEndian(89);
  8275. stream.writeWord(myPlayer.x);
  8276. stream.writeWord(myPlayer.y);
  8277. stream.writeWordBigEndian(anInt1264);
  8278. stream.writeWordBigEndian(63);
  8279. }
  8280. }
  8281. anInt1117++;
  8282. if(anInt1117 > 1151) {
  8283. anInt1117 = 0;
  8284. stream.createFrame(246);
  8285. stream.writeWordBigEndian(0);
  8286. int l = stream.currentOffset;
  8287. if((int)(Math.random() * 2D) == 0)
  8288. stream.writeWordBigEndian(101);
  8289. stream.writeWordBigEndian(197);
  8290. stream.writeWord((int)(Math.random() * 65536D));
  8291. stream.writeWordBigEndian((int)(Math.random() * 256D));
  8292. stream.writeWordBigEndian(67);
  8293. stream.writeWord(14214);
  8294. if((int)(Math.random() * 2D) == 0)
  8295. stream.writeWord(29487);
  8296. stream.writeWord((int)(Math.random() * 65536D));
  8297. if((int)(Math.random() * 2D) == 0)
  8298. stream.writeWordBigEndian(220);
  8299. stream.writeWordBigEndian(180);
  8300. stream.writeBytes(stream.currentOffset - l);
  8301. }
  8302. }
  8303. }
  8304.  
  8305. private String interfaceIntToString(int j) {
  8306. if(j < 0x3b9ac9ff)
  8307. return String.valueOf(j);
  8308. else
  8309. return "*";
  8310. }
  8311.  
  8312. private void showErrorScreen()
  8313. {
  8314. Graphics g = getGameComponent().getGraphics();
  8315. g.setColor(Color.black);
  8316. g.fillRect(0, 0, 765, 503);
  8317. method4(1);
  8318. if(loadingError)
  8319. {
  8320. aBoolean831 = false;
  8321. g.setFont(new Font("Helvetica", 1, 16));
  8322. g.setColor(Color.yellow);
  8323. int k = 35;
  8324. g.drawString("Sorry, an error has occured whilst loading Genesis", 30, k);
  8325. k += 50;
  8326. g.setColor(Color.white);
  8327. g.drawString("To fix this try the following (in order):", 30, k);
  8328. k += 50;
  8329. g.setColor(Color.white);
  8330. g.setFont(new Font("Helvetica", 1, 12));
  8331. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  8332. k += 30;
  8333. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  8334. k += 30;
  8335. g.drawString("3: Try using a different game-world", 30, k);
  8336. k += 30;
  8337. g.drawString("4: Try rebooting your computer", 30, k);
  8338. k += 30;
  8339. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  8340. }
  8341. if(genericLoadingError)
  8342. {
  8343. aBoolean831 = false;
  8344. g.setFont(new Font("Helvetica", 1, 20));
  8345. g.setColor(Color.white);
  8346. g.drawString("Error - unable to load game!", 50, 50);
  8347. g.drawString("To play The-Genesis make sure to DL the client", 50, 100);
  8348. g.drawString("http://genesis-rsps.comlu.com/index.php", 50, 150);
  8349. }
  8350. if(rsAlreadyLoaded)
  8351. {
  8352. aBoolean831 = false;
  8353. g.setColor(Color.yellow);
  8354. int l = 35;
  8355. g.drawString("Error a copy of The-Genesis already appears to be loaded", 30, l);
  8356. l += 50;
  8357. g.setColor(Color.white);
  8358. g.drawString("To fix this try the following (in order):", 30, l);
  8359. l += 50;
  8360. g.setColor(Color.white);
  8361. g.setFont(new Font("Helvetica", 1, 12));
  8362. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  8363. l += 30;
  8364. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  8365. l += 30;
  8366. }
  8367. }
  8368.  
  8369. public URL getCodeBase() {
  8370. try {
  8371. return new URL(server +":" + (80 + portOff));
  8372. } catch(Exception _ex) {
  8373. }
  8374. return null;
  8375. }
  8376.  
  8377. private void method95() {
  8378. for(int j = 0; j < npcCount; j++) {
  8379. int k = npcIndices[j];
  8380. NPC npc = npcArray[k];
  8381. if(npc != null)
  8382. method96(npc);
  8383. }
  8384. }
  8385.  
  8386. private void method96(Entity entity)
  8387. {
  8388. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  8389. {
  8390. entity.anim = -1;
  8391. entity.anInt1520 = -1;
  8392. entity.anInt1547 = 0;
  8393. entity.anInt1548 = 0;
  8394. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8395. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8396. entity.method446();
  8397. }
  8398. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  8399. {
  8400. entity.anim = -1;
  8401. entity.anInt1520 = -1;
  8402. entity.anInt1547 = 0;
  8403. entity.anInt1548 = 0;
  8404. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8405. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8406. entity.method446();
  8407. }
  8408. if(entity.anInt1547 > loopCycle)
  8409. method97(entity);
  8410. else
  8411. if(entity.anInt1548 >= loopCycle)
  8412. method98(entity);
  8413. else
  8414. method99(entity);
  8415. method100(entity);
  8416. method101(entity);
  8417. }
  8418.  
  8419. private void method97(Entity entity)
  8420. {
  8421. int i = entity.anInt1547 - loopCycle;
  8422. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8423. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8424. entity.x += (j - entity.x) / i;
  8425. entity.y += (k - entity.y) / i;
  8426. entity.anInt1503 = 0;
  8427. if(entity.anInt1549 == 0)
  8428. entity.turnDirection = 1024;
  8429. if(entity.anInt1549 == 1)
  8430. entity.turnDirection = 1536;
  8431. if(entity.anInt1549 == 2)
  8432. entity.turnDirection = 0;
  8433. if(entity.anInt1549 == 3)
  8434. entity.turnDirection = 512;
  8435. }
  8436.  
  8437. private void method98(Entity entity)
  8438. {
  8439. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  8440. {
  8441. int i = entity.anInt1548 - entity.anInt1547;
  8442. int j = loopCycle - entity.anInt1547;
  8443. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8444. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8445. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  8446. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  8447. entity.x = (k * (i - j) + i1 * j) / i;
  8448. entity.y = (l * (i - j) + j1 * j) / i;
  8449. }
  8450. entity.anInt1503 = 0;
  8451. if(entity.anInt1549 == 0)
  8452. entity.turnDirection = 1024;
  8453. if(entity.anInt1549 == 1)
  8454. entity.turnDirection = 1536;
  8455. if(entity.anInt1549 == 2)
  8456. entity.turnDirection = 0;
  8457. if(entity.anInt1549 == 3)
  8458. entity.turnDirection = 512;
  8459. entity.anInt1552 = entity.turnDirection;
  8460. }
  8461.  
  8462. private void method99(Entity entity)
  8463. {
  8464. entity.anInt1517 = entity.anInt1511;
  8465. if(entity.smallXYIndex == 0)
  8466. {
  8467. entity.anInt1503 = 0;
  8468. return;
  8469. }
  8470. if(entity.anim != -1 && entity.anInt1529 == 0)
  8471. {
  8472. Animation animation = Animation.anims[entity.anim];
  8473. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  8474. {
  8475. entity.anInt1503++;
  8476. return;
  8477. }
  8478. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  8479. {
  8480. entity.anInt1503++;
  8481. return;
  8482. }
  8483. }
  8484. int i = entity.x;
  8485. int j = entity.y;
  8486. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  8487. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  8488. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  8489. {
  8490. entity.x = k;
  8491. entity.y = l;
  8492. return;
  8493. }
  8494. if(i < k)
  8495. {
  8496. if(j < l)
  8497. entity.turnDirection = 1280;
  8498. else
  8499. if(j > l)
  8500. entity.turnDirection = 1792;
  8501. else
  8502. entity.turnDirection = 1536;
  8503. } else
  8504. if(i > k)
  8505. {
  8506. if(j < l)
  8507. entity.turnDirection = 768;
  8508. else
  8509. if(j > l)
  8510. entity.turnDirection = 256;
  8511. else
  8512. entity.turnDirection = 512;
  8513. } else
  8514. if(j < l)
  8515. entity.turnDirection = 1024;
  8516. else
  8517. entity.turnDirection = 0;
  8518. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8519. if(i1 > 1024)
  8520. i1 -= 2048;
  8521. int j1 = entity.anInt1555;
  8522. if(i1 >= -256 && i1 <= 256)
  8523. j1 = entity.anInt1554;
  8524. else
  8525. if(i1 >= 256 && i1 < 768)
  8526. j1 = entity.anInt1557;
  8527. else
  8528. if(i1 >= -768 && i1 <= -256)
  8529. j1 = entity.anInt1556;
  8530. if(j1 == -1)
  8531. j1 = entity.anInt1554;
  8532. entity.anInt1517 = j1;
  8533. int k1 = 4;
  8534. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  8535. k1 = 2;
  8536. if(entity.smallXYIndex > 2)
  8537. k1 = 6;
  8538. if(entity.smallXYIndex > 3)
  8539. k1 = 8;
  8540. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  8541. {
  8542. k1 = 8;
  8543. entity.anInt1503--;
  8544. }
  8545. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  8546. k1 <<= 1;
  8547. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  8548. entity.anInt1517 = entity.anInt1505;
  8549. if(i < k)
  8550. {
  8551. entity.x += k1;
  8552. if(entity.x > k)
  8553. entity.x = k;
  8554. } else
  8555. if(i > k)
  8556. {
  8557. entity.x -= k1;
  8558. if(entity.x < k)
  8559. entity.x = k;
  8560. }
  8561. if(j < l)
  8562. {
  8563. entity.y += k1;
  8564. if(entity.y > l)
  8565. entity.y = l;
  8566. } else
  8567. if(j > l)
  8568. {
  8569. entity.y -= k1;
  8570. if(entity.y < l)
  8571. entity.y = l;
  8572. }
  8573. if(entity.x == k && entity.y == l)
  8574. {
  8575. entity.smallXYIndex--;
  8576. if(entity.anInt1542 > 0)
  8577. entity.anInt1542--;
  8578. }
  8579. }
  8580.  
  8581. private void method100(Entity entity)
  8582. {
  8583. if(entity.anInt1504 == 0)
  8584. return;
  8585. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  8586. {
  8587. NPC npc = npcArray[entity.interactingEntity];
  8588. if(npc != null)
  8589. {
  8590. int i1 = entity.x - npc.x;
  8591. int k1 = entity.y - npc.y;
  8592. if(i1 != 0 || k1 != 0)
  8593. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  8594. }
  8595. }
  8596. if(entity.interactingEntity >= 32768)
  8597. {
  8598. int j = entity.interactingEntity - 32768;
  8599. if(j == unknownInt10)
  8600. j = myPlayerIndex;
  8601. Player player = playerArray[j];
  8602. if(player != null)
  8603. {
  8604. int l1 = entity.x - player.x;
  8605. int i2 = entity.y - player.y;
  8606. if(l1 != 0 || i2 != 0)
  8607. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  8608. }
  8609. }
  8610. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  8611. {
  8612. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  8613. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  8614. if(k != 0 || j1 != 0)
  8615. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  8616. entity.anInt1538 = 0;
  8617. entity.anInt1539 = 0;
  8618. }
  8619. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8620. if(l != 0)
  8621. {
  8622. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8623. entity.anInt1552 = entity.turnDirection;
  8624. else
  8625. if(l > 1024)
  8626. entity.anInt1552 -= entity.anInt1504;
  8627. else
  8628. entity.anInt1552 += entity.anInt1504;
  8629. entity.anInt1552 &= 0x7ff;
  8630. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  8631. {
  8632. if(entity.anInt1512 != -1)
  8633. {
  8634. entity.anInt1517 = entity.anInt1512;
  8635. return;
  8636. }
  8637. entity.anInt1517 = entity.anInt1554;
  8638. }
  8639. }
  8640. }
  8641.  
  8642. public void method101(Entity entity) {
  8643. entity.aBoolean1541 = false;
  8644. if (entity.anInt1517 > Animation.anims.length)
  8645. entity.anInt1517 = -1;
  8646. if (entity.anInt1517 != -1) {
  8647. Animation animation = Animation.anims[entity.anInt1517];
  8648. entity.anInt1519++;
  8649. if (animation == null)
  8650. return;
  8651. if (entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518)) {
  8652. entity.anInt1519 = 0;
  8653. entity.anInt1518++;
  8654. }
  8655. if (entity.anInt1518 >= animation.anInt352) {
  8656. entity.anInt1519 = 0;
  8657. entity.anInt1518 = 0;
  8658. }
  8659. }
  8660. if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
  8661. if (entity.anInt1521 < 0)
  8662. entity.anInt1521 = 0;
  8663. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8664. for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  8665. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8666.  
  8667. if (entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  8668. entity.anInt1520 = -1;
  8669. }
  8670. if (entity.anim != -1 && entity.anInt1529 <= 1) {
  8671. Animation animation_2 = Animation.anims[entity.anim];
  8672. if (animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle) {
  8673. entity.anInt1529 = 1;
  8674. return;
  8675. }
  8676. }
  8677. if (entity.anim != -1 && entity.anInt1529 == 0) {
  8678. Animation animation_3 = Animation.anims[entity.anim];
  8679. for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  8680. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8681.  
  8682. if (entity.anInt1527 >= animation_3.anInt352) {
  8683. entity.anInt1527 -= animation_3.anInt356;
  8684. entity.anInt1530++;
  8685. if (entity.anInt1530 >= animation_3.anInt362)
  8686. entity.anim = -1;
  8687. if (entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  8688. entity.anim = -1;
  8689. }
  8690. entity.aBoolean1541 = animation_3.aBoolean358;
  8691. }
  8692. if (entity.anInt1529 > 0)
  8693. entity.anInt1529--;
  8694. }
  8695. private void drawGameScreen()
  8696. {
  8697. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  8698. if (loadingStage == 2) {
  8699. method119(anInt945, fullscreenInterfaceID);
  8700. if (openInterfaceID != -1) {
  8701. method119(anInt945, openInterfaceID);
  8702. }
  8703. anInt945 = 0;
  8704. resetAllImageProducers();
  8705. super.fullGameScreen.initDrawingArea();
  8706. Texture.anIntArray1472 = fullScreenTextureArray;
  8707. DrawingArea.setAllPixelsToZero();
  8708. welcomeScreenRaised = true;
  8709. if (openInterfaceID != -1) {
  8710. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  8711. if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  8712. rsInterface_1.width = 765;
  8713. rsInterface_1.height = 503;
  8714. }
  8715. drawInterface(0, 0, rsInterface_1, 8);
  8716. }
  8717. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  8718. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  8719. rsInterface.width = 765;
  8720. rsInterface.height = 503;
  8721. }
  8722. drawInterface(0, 0, rsInterface, 8);
  8723.  
  8724. if (!menuOpen) {
  8725. processRightClick();
  8726. drawTooltip();
  8727. } else {
  8728. drawMenu();
  8729. }
  8730. }
  8731. drawCount++;
  8732. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  8733. return;
  8734. } else {
  8735. if (drawCount != 0) {
  8736. resetImageProducers2();
  8737. }
  8738. }
  8739. if(welcomeScreenRaised) {
  8740. welcomeScreenRaised = false;
  8741. topFrame.drawGraphics(0, super.graphics, 0);
  8742. leftFrame.drawGraphics(4, super.graphics, 0);
  8743. rightFrame.drawGraphics(4, super.graphics, 516);
  8744. mapEdgeIP.drawGraphics(4, super.graphics, 519);
  8745. needDrawTabArea = true;
  8746. inputTaken = true;
  8747. tabAreaAltered = true;
  8748. aBoolean1233 = true;
  8749. if(loadingStage != 2) {
  8750. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  8751. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  8752. }
  8753. }
  8754. if(menuOpen && menuScreenArea == 1)
  8755. needDrawTabArea = true;
  8756. if(invOverlayInterfaceID != -1)
  8757. {
  8758. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  8759. if(flag1)
  8760. needDrawTabArea = true;
  8761. }
  8762. if(atInventoryInterfaceType == 2)
  8763. needDrawTabArea = true;
  8764. if(activeInterfaceType == 2)
  8765. needDrawTabArea = true;
  8766. /*if(needDrawTabArea)
  8767. {*/
  8768. drawTabArea();
  8769. /*needDrawTabArea = false;
  8770. }*/
  8771. if(backDialogID == -1)
  8772. {
  8773. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  8774. if(super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  8775. method65(494, 110, super.mouseX - 0, super.mouseY - 348, aClass9_1059, 0, false, anInt1211);
  8776. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  8777. if(i < 0)
  8778. i = 0;
  8779. if(i > anInt1211 - 110)
  8780. i = anInt1211 - 110;
  8781. if(anInt1089 != i)
  8782. {
  8783. anInt1089 = i;
  8784. inputTaken = true;
  8785. }
  8786. }
  8787. if(backDialogID != -1) {
  8788. boolean flag2 = method119(anInt945, backDialogID);
  8789. if(flag2)
  8790. inputTaken = true;
  8791. }
  8792. if(atInventoryInterfaceType == 3)
  8793. inputTaken = true;
  8794. if(activeInterfaceType == 3)
  8795. inputTaken = true;
  8796. if(aString844 != null)
  8797. inputTaken = true;
  8798. if(menuOpen && menuScreenArea == 2)
  8799. inputTaken = true;
  8800. if(inputTaken) {
  8801. drawChatArea();
  8802. inputTaken = false;
  8803. }
  8804. if(loadingStage == 2)
  8805. method146();
  8806. if(loadingStage == 2) {
  8807. drawMinimap();
  8808. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  8809. }
  8810. if(anInt1054 != -1)
  8811. tabAreaAltered = true;
  8812. if(tabAreaAltered)
  8813. {
  8814. if(anInt1054 != -1 && anInt1054 == tabID)
  8815. {
  8816. anInt1054 = -1;
  8817. stream.createFrame(120);
  8818. stream.writeWordBigEndian(tabID);
  8819. }
  8820. tabAreaAltered = false;
  8821. aRSImageProducer_1125.initDrawingArea();
  8822. aRSImageProducer_1165.initDrawingArea();
  8823. }
  8824. anInt945 = 0;
  8825. }
  8826.  
  8827. private boolean buildFriendsListMenu(RSInterface class9)
  8828. {
  8829. int i = class9.contentType;
  8830. if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  8831. {
  8832. if(i >= 801)
  8833. i -= 701;
  8834. else
  8835. if(i >= 701)
  8836. i -= 601;
  8837. else
  8838. if(i >= 101)
  8839. i -= 101;
  8840. else
  8841. i--;
  8842. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  8843. menuActionID[menuActionRow] = 792;
  8844. menuActionRow++;
  8845. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  8846. menuActionID[menuActionRow] = 639;
  8847. menuActionRow++;
  8848. return true;
  8849. }
  8850. if(i >= 401 && i <= 500)
  8851. {
  8852. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  8853. menuActionID[menuActionRow] = 322;
  8854. menuActionRow++;
  8855. return true;
  8856. } else
  8857. {
  8858. return false;
  8859. }
  8860. }
  8861.  
  8862. private void method104()
  8863. {
  8864. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  8865. for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  8866. if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  8867. class30_sub2_sub4_sub3.unlink();
  8868. else
  8869. if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  8870. {
  8871. class30_sub2_sub4_sub3.method454(anInt945);
  8872. if(class30_sub2_sub4_sub3.aBoolean1567)
  8873. class30_sub2_sub4_sub3.unlink();
  8874. else
  8875. 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);
  8876. }
  8877.  
  8878. }
  8879.  
  8880. public void drawBlackBox(int xPos, int yPos) {
  8881. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  8882. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  8883. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  8884. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  8885. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  8886. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  8887. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  8888. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  8889. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  8890. }
  8891.  
  8892. private void drawInterface(int j, int k, RSInterface class9, int l) {
  8893. if(class9.type != 0 || class9.children == null)
  8894. return;
  8895. if(class9.isMouseoverTriggered && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  8896. return;
  8897. int i1 = DrawingArea.topX;
  8898. int j1 = DrawingArea.topY;
  8899. int k1 = DrawingArea.bottomX;
  8900. int l1 = DrawingArea.bottomY;
  8901. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  8902. int i2 = class9.children.length;
  8903. for(int j2 = 0; j2 < i2; j2++) {
  8904. int k2 = class9.childX[j2] + k;
  8905. int l2 = (class9.childY[j2] + l) - j;
  8906. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  8907. k2 += class9_1.anInt263;
  8908. l2 += class9_1.anInt265;
  8909. if(class9_1.contentType > 0)
  8910. drawFriendsListOrWelcomeScreen(class9_1);
  8911. //here
  8912. int[] IDs = {
  8913. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
  8914. 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
  8915. 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
  8916. 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
  8917. 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  8918. /* Ancients */
  8919. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
  8920. 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  8921. };
  8922. for(int m5 = 0; m5 < IDs.length; m5++) {
  8923. if(class9_1.id == IDs[m5] + 1) {
  8924. if(m5 > 61)
  8925. drawBlackBox(k2 + 1, l2);
  8926. else
  8927. drawBlackBox(k2, l2 + 1);
  8928. }
  8929. }
  8930. int[] runeChildren = {
  8931. 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
  8932. 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
  8933. 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
  8934. 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
  8935. 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
  8936. 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
  8937. 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
  8938. 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
  8939. 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
  8940. 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
  8941. 15885, 18474, 18475, 18478
  8942. };
  8943. for(int r = 0; r < runeChildren.length; r++)
  8944. if(class9_1.id == runeChildren[r])
  8945. class9_1.modelZoom = 775;
  8946. if(class9_1.type == 0) {
  8947. if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  8948. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  8949. if(class9_1.scrollPosition < 0)
  8950. class9_1.scrollPosition = 0;
  8951. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  8952. if(class9_1.scrollMax > class9_1.height)
  8953. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  8954. } else if(class9_1.type != 1)
  8955. if(class9_1.type == 2) {
  8956. int i3 = 0;
  8957. for(int l3 = 0; l3 < class9_1.height; l3++) {
  8958. for(int l4 = 0; l4 < class9_1.width; l4++) {
  8959. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  8960. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  8961. if(i3 < 20) {
  8962. k5 += class9_1.spritesX[i3];
  8963. j6 += class9_1.spritesY[i3];
  8964. }
  8965. if(class9_1.inv[i3] > 0) {
  8966. int k6 = 0;
  8967. int j7 = 0;
  8968. int j9 = class9_1.inv[i3] - 1;
  8969. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  8970. int l9 = 0;
  8971. if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  8972. l9 = 0xffffff;
  8973. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  8974. if(class30_sub2_sub1_sub1_2 != null) {
  8975. if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  8976. k6 = super.mouseX - anInt1087;
  8977. j7 = super.mouseY - anInt1088;
  8978. if(k6 < 5 && k6 > -5)
  8979. k6 = 0;
  8980. if(j7 < 5 && j7 > -5)
  8981. j7 = 0;
  8982. if(anInt989 < 5) {
  8983. k6 = 0;
  8984. j7 = 0;
  8985. }
  8986. class30_sub2_sub1_sub1_2.drawSprite1(k5 + k6, j6 + j7);
  8987. if(j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  8988. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  8989. if(i10 > anInt945 * 10)
  8990. i10 = anInt945 * 10;
  8991. if(i10 > class9.scrollPosition)
  8992. i10 = class9.scrollPosition;
  8993. class9.scrollPosition -= i10;
  8994. anInt1088 += i10;
  8995. }
  8996. if(j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  8997. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  8998. if(j10 > anInt945 * 10)
  8999. j10 = anInt945 * 10;
  9000. if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  9001. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  9002. class9.scrollPosition += j10;
  9003. anInt1088 -= j10;
  9004. }
  9005. } else if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  9006. class30_sub2_sub1_sub1_2.drawSprite1(k5, j6);
  9007. else
  9008. class30_sub2_sub1_sub1_2.drawSprite(k5, j6);
  9009. if(class30_sub2_sub1_sub1_2.anInt1444 == 33 || class9_1.invStackSizes[i3] != 1)
  9010. {
  9011. int k10 = class9_1.invStackSizes[i3];
  9012. if(k10 >= 1)
  9013. smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9014. if(k10 >= 100000)
  9015. smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9016. if(k10 >= 10000000)
  9017. smallText.method385(0x00ff80, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9018.  
  9019. /*smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  9020. smallText.method385(0xffff00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);*/
  9021. }
  9022. }
  9023. }
  9024. } else if(class9_1.sprites != null && i3 < 20) {
  9025. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  9026. if(class30_sub2_sub1_sub1_1 != null)
  9027. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  9028. }
  9029. i3++;
  9030. }
  9031. }
  9032. } else if(class9_1.type == 3) {
  9033. boolean flag = false;
  9034. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  9035. flag = true;
  9036. int j3;
  9037. if(interfaceIsSelected(class9_1)) {
  9038. j3 = class9_1.anInt219;
  9039. if(flag && class9_1.anInt239 != 0)
  9040. j3 = class9_1.anInt239;
  9041. } else {
  9042. j3 = class9_1.textColor;
  9043. if(flag && class9_1.anInt216 != 0)
  9044. j3 = class9_1.anInt216;
  9045. }
  9046. if(class9_1.aByte254 == 0) {
  9047. if(class9_1.aBoolean227)
  9048. DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  9049. else
  9050. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  9051. } else if(class9_1.aBoolean227)
  9052. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.aByte254 & 0xff), k2);
  9053. else
  9054. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.aByte254 & 0xff), j3, class9_1.width, k2);
  9055. } else if(class9_1.type == 4) {
  9056. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  9057. String s = class9_1.message;
  9058. boolean flag1 = false;
  9059. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  9060. flag1 = true;
  9061. int i4;
  9062. if(interfaceIsSelected(class9_1)) {
  9063. i4 = class9_1.anInt219;
  9064. if(flag1 && class9_1.anInt239 != 0)
  9065. i4 = class9_1.anInt239;
  9066. if(class9_1.aString228.length() > 0)
  9067. s = class9_1.aString228;
  9068. } else {
  9069. i4 = class9_1.textColor;
  9070. if(flag1 && class9_1.anInt216 != 0)
  9071. i4 = class9_1.anInt216;
  9072. }
  9073. if(class9_1.atActionType == 6 && aBoolean1149) {
  9074. s = "Please wait...";
  9075. i4 = class9_1.textColor;
  9076. }
  9077. if(DrawingArea.width == 519) {
  9078. if(i4 == 0xffff00)
  9079. i4 = 255;
  9080. if(i4 == 49152)
  9081. i4 = 0xffffff;
  9082. }
  9083. if((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  9084. switch (i4) {
  9085. case 16773120: i4 = 0xFE981F; break;
  9086. case 7040819: i4 = 0xAF6A1A; break;
  9087. }
  9088. }
  9089. for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
  9090. {
  9091. if(s.indexOf("%") != -1)
  9092. {
  9093. do
  9094. {
  9095. int k7 = s.indexOf("%1");
  9096. if(k7 == -1)
  9097. break;
  9098. 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)
  9099. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  9100. else
  9101. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  9102. } while(true);
  9103. do
  9104. {
  9105. int l7 = s.indexOf("%2");
  9106. if(l7 == -1)
  9107. break;
  9108. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  9109. } while(true);
  9110. do
  9111. {
  9112. int i8 = s.indexOf("%3");
  9113. if(i8 == -1)
  9114. break;
  9115. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  9116. } while(true);
  9117. do
  9118. {
  9119. int j8 = s.indexOf("%4");
  9120. if(j8 == -1)
  9121. break;
  9122. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  9123. } while(true);
  9124. do
  9125. {
  9126. int k8 = s.indexOf("%5");
  9127. if(k8 == -1)
  9128. break;
  9129. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  9130. } while(true);
  9131. }
  9132. int l8 = s.indexOf("\\n");
  9133. String s1;
  9134. if(l8 != -1)
  9135. {
  9136. s1 = s.substring(0, l8);
  9137. s = s.substring(l8 + 2);
  9138. } else
  9139. {
  9140. s1 = s;
  9141. s = "";
  9142. }
  9143. if(class9_1.centerText)
  9144. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadow);
  9145. else
  9146. textDrawingArea.method389(class9_1.textShadow, k2, i4, s1, l6);
  9147. }
  9148. } else if(class9_1.type == 5) {
  9149. Sprite sprite;
  9150. if(interfaceIsSelected(class9_1))
  9151. sprite = class9_1.sprite2;
  9152. else
  9153. sprite = class9_1.sprite1;
  9154. if(spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
  9155. sprite.drawSprite(k2, l2, 0xffffff);
  9156. } else {
  9157. if (sprite != null)
  9158. sprite.drawSprite(k2, l2);
  9159. }
  9160. if(sprite != null)
  9161. sprite.drawSprite(k2, l2);
  9162. } else if(class9_1.type == 6) {
  9163. int k3 = Texture.textureInt1;
  9164. int j4 = Texture.textureInt2;
  9165. Texture.textureInt1 = k2 + class9_1.width / 2;
  9166. Texture.textureInt2 = l2 + class9_1.height / 2;
  9167. int i5 = Texture.anIntArray1470[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  9168. int l5 = Texture.anIntArray1471[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  9169. boolean flag2 = interfaceIsSelected(class9_1);
  9170. int i7;
  9171. if(flag2)
  9172. i7 = class9_1.anInt258;
  9173. else
  9174. i7 = class9_1.anInt257;
  9175. Model model;
  9176. if(i7 == -1) {
  9177. model = class9_1.method209(-1, -1, flag2);
  9178. } else {
  9179. Animation animation = Animation.anims[i7];
  9180. model = class9_1.method209(animation.anIntArray354[class9_1.anInt246], animation.anIntArray353[class9_1.anInt246], flag2);
  9181. }
  9182. if(model != null)
  9183. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  9184. Texture.textureInt1 = k3;
  9185. Texture.textureInt2 = j4;
  9186. } else if(class9_1.type == 7) {
  9187. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  9188. int k4 = 0;
  9189. for(int j5 = 0; j5 < class9_1.height; j5++) {
  9190. for(int i6 = 0; i6 < class9_1.width; i6++) {
  9191. if(class9_1.inv[k4] > 0) {
  9192. ItemDef itemDef = ItemDef.forID(class9_1.inv[k4] - 1);
  9193. String s2 = itemDef.name;
  9194. if(itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  9195. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  9196. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  9197. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  9198. if(class9_1.centerText)
  9199. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadow);
  9200. else
  9201. textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  9202. }
  9203. k4++;
  9204. }
  9205. }
  9206. if(class9_1.type == 8) {
  9207. String hoverText;
  9208. if (interfaceIsSelected(class9_1)){
  9209. hoverText = class9_1.aString228;
  9210. }else
  9211. hoverText = class9_1.message;
  9212. drawHoverBox(k2, l2, hoverText);
  9213. }
  9214. }
  9215. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  9216. }
  9217. }
  9218.  
  9219.  
  9220. private void randomizeBackground(Background background) {
  9221. int j = 256;
  9222. for(int k = 0; k < anIntArray1190.length; k++)
  9223. anIntArray1190[k] = 0;
  9224.  
  9225. for(int l = 0; l < 5000; l++) {
  9226. int i1 = (int)(Math.random() * 128D * (double)j);
  9227. anIntArray1190[i1] = (int)(Math.random() * 256D);
  9228. }
  9229. for(int j1 = 0; j1 < 20; j1++) {
  9230. for(int k1 = 1; k1 < j - 1; k1++) {
  9231. for(int i2 = 1; i2 < 127; i2++) {
  9232. int k2 = i2 + (k1 << 7);
  9233. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  9234. }
  9235.  
  9236. }
  9237. int ai[] = anIntArray1190;
  9238. anIntArray1190 = anIntArray1191;
  9239. anIntArray1191 = ai;
  9240. }
  9241. if(background != null) {
  9242. int l1 = 0;
  9243. for(int j2 = 0; j2 < background.anInt1453; j2++) {
  9244. for(int l2 = 0; l2 < background.anInt1452; l2++)
  9245. if(background.aByteArray1450[l1++] != 0) {
  9246. int i3 = l2 + 16 + background.anInt1454;
  9247. int j3 = j2 + 16 + background.anInt1455;
  9248. int k3 = i3 + (j3 << 7);
  9249. anIntArray1190[k3] = 0;
  9250. }
  9251. }
  9252. }
  9253. }
  9254.  
  9255. private void method107(int i, int j, Stream stream, Player player)
  9256. {
  9257. if((i & 0x400) != 0)
  9258. {
  9259. player.anInt1543 = stream.method428();
  9260. player.anInt1545 = stream.method428();
  9261. player.anInt1544 = stream.method428();
  9262. player.anInt1546 = stream.method428();
  9263. player.anInt1547 = stream.method436() + loopCycle;
  9264. player.anInt1548 = stream.method435() + loopCycle;
  9265. player.anInt1549 = stream.method428();
  9266. player.method446();
  9267. }
  9268. if((i & 0x100) != 0)
  9269. {
  9270. player.anInt1520 = stream.method434();
  9271. int k = stream.readDWord();
  9272. player.anInt1524 = k >> 16;
  9273. player.anInt1523 = loopCycle + (k & 0xffff);
  9274. player.anInt1521 = 0;
  9275. player.anInt1522 = 0;
  9276. if(player.anInt1523 > loopCycle)
  9277. player.anInt1521 = -1;
  9278. if(player.anInt1520 == 65535)
  9279. player.anInt1520 = -1;
  9280. }
  9281. if((i & 8) != 0)
  9282. {
  9283. int l = stream.method434();
  9284. if(l == 65535)
  9285. l = -1;
  9286. int i2 = stream.method427();
  9287. if(l == player.anim && l != -1)
  9288. {
  9289. int i3 = Animation.anims[l].anInt365;
  9290. if(i3 == 1)
  9291. {
  9292. player.anInt1527 = 0;
  9293. player.anInt1528 = 0;
  9294. player.anInt1529 = i2;
  9295. player.anInt1530 = 0;
  9296. }
  9297. if(i3 == 2)
  9298. player.anInt1530 = 0;
  9299. } else
  9300. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  9301. {
  9302. player.anim = l;
  9303. player.anInt1527 = 0;
  9304. player.anInt1528 = 0;
  9305. player.anInt1529 = i2;
  9306. player.anInt1530 = 0;
  9307. player.anInt1542 = player.smallXYIndex;
  9308. }
  9309. }
  9310. if((i & 4) != 0)
  9311. {
  9312. player.textSpoken = stream.readString();
  9313. if(player.textSpoken.charAt(0) == '~')
  9314. {
  9315. player.textSpoken = player.textSpoken.substring(1);
  9316. pushMessage(player.textSpoken, 2, player.name);
  9317. } else
  9318. if(player == myPlayer)
  9319. pushMessage(player.textSpoken, 2, player.name);
  9320. player.anInt1513 = 0;
  9321. player.anInt1531 = 0;
  9322. player.textCycle = 150;
  9323. }
  9324. if((i & 0x80) != 0)
  9325. {
  9326. //right fucking here
  9327. int i1 = stream.method434();
  9328. int j2 = stream.readUnsignedByte();
  9329. int j3 = stream.method427();
  9330. int k3 = stream.currentOffset;
  9331. if(player.name != null && player.visible)
  9332. {
  9333. long l3 = TextClass.longForName(player.name);
  9334. boolean flag = false;
  9335. if(j2 <= 1)
  9336. {
  9337. for(int i4 = 0; i4 < ignoreCount; i4++)
  9338. {
  9339. if(ignoreListAsLongs[i4] != l3)
  9340. continue;
  9341. flag = true;
  9342. break;
  9343. }
  9344.  
  9345. }
  9346. if(!flag && anInt1251 == 0)
  9347. try
  9348. {
  9349. aStream_834.currentOffset = 0;
  9350. stream.method442(j3, 0, aStream_834.buffer);
  9351. aStream_834.currentOffset = 0;
  9352. String s = TextInput.method525(j3, aStream_834);
  9353. //s = Censor.doCensor(s);
  9354. player.textSpoken = s;
  9355. player.anInt1513 = i1 >> 8;
  9356. player.privelage = j2;
  9357. player.anInt1531 = i1 & 0xff;
  9358. player.textCycle = 150;
  9359. switch (j2) {
  9360. case 1:
  9361. pushMessage(s, 2, "@cr1@" + "<col="+titleColor(player.titleColor, 0)+">" + player.title + "</col>" + player.name);
  9362. break;
  9363. case 2:
  9364. pushMessage(s, 2, "@cr2@" + "<col="+titleColor(player.titleColor, 0)+">" + player.title + "</col>" + player.name);
  9365. break;
  9366. case 3:
  9367. pushMessage(s, 2, "@cr3@" + "<col="+titleColor(player.titleColor, 0)+">" + player.title + "</col>" + player.name);
  9368. break;
  9369. case 4:
  9370. pushMessage(s, 2, "@cr4@" + "<col="+titleColor(player.titleColor, 0)+">" + player.title + "</col>" + player.name);
  9371. break;
  9372. case 5:
  9373. pushMessage(s, 2, "@cr5@" + "<col="+titleColor(player.titleColor, 0)+">" + player.title + "</col>" + player.name);
  9374. break;
  9375. case 6:
  9376. pushMessage(s, 2, "@cr6@" + "<col="+titleColor(player.titleColor, 0)+">" + player.title + "</col>" + player.name);
  9377. break;
  9378. case 7:
  9379. pushMessage(s, 2, "@cr7@" + "<col="+titleColor(player.titleColor, 0)+">" + player.title + "</col>" + player.name);
  9380. break;
  9381. case 8:
  9382. pushMessage(s, 2, "@cr8@" + "<col="+titleColor(player.titleColor, 0)+">" + player.title + "</col>" + player.name);
  9383. break;
  9384. default:
  9385. pushMessage(s, 1, "<col="+titleColor(player.titleColor, 0)+">" + player.title + "</col>" + player.name);
  9386. break;
  9387. }
  9388. //pushMessage(s, j2 > 0 ? 1 : 2, (j2 > 0 ? "@cr" + j2 + "@" : "") + player.name);
  9389. }
  9390. catch(Exception exception)
  9391. {
  9392. signlink.reporterror("cde2");
  9393. }
  9394. }
  9395. stream.currentOffset = k3 + j3;
  9396. }
  9397. if((i & 1) != 0)
  9398. {
  9399. player.interactingEntity = stream.method434();
  9400. if(player.interactingEntity == 65535)
  9401. player.interactingEntity = -1;
  9402. }
  9403. if((i & 0x10) != 0)
  9404. {
  9405. int j1 = stream.method427();
  9406. byte abyte0[] = new byte[j1];
  9407. Stream stream_1 = new Stream(abyte0);
  9408. stream.readBytes(j1, 0, abyte0);
  9409. aStreamArray895s[j] = stream_1;
  9410. player.updatePlayer(stream_1);
  9411. }
  9412. if((i & 2) != 0)
  9413. {
  9414. player.anInt1538 = stream.method436();
  9415. player.anInt1539 = stream.method434();
  9416. }
  9417. if((i & 0x20) != 0)
  9418. {
  9419. int k1 = stream.readUnsignedByte();
  9420. int k2 = stream.method426();
  9421. player.updateHitData(k2, k1, loopCycle);
  9422. player.loopCycleStatus = loopCycle + 300;
  9423. player.currentHealth = stream.method427();
  9424. player.maxHealth = stream.readUnsignedByte();
  9425. }
  9426. if((i & 0x200) != 0)
  9427. {
  9428. int l1 = stream.readUnsignedByte();
  9429. int l2 = stream.method428();
  9430. player.updateHitData(l2, l1, loopCycle);
  9431. player.loopCycleStatus = loopCycle + 300;
  9432. player.currentHealth = stream.readUnsignedByte();
  9433. player.maxHealth = stream.method427();
  9434. }
  9435. }
  9436.  
  9437. private void method108()
  9438. {
  9439. try
  9440. {
  9441. int j = myPlayer.x + anInt1278;
  9442. int k = myPlayer.y + anInt1131;
  9443. if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  9444. {
  9445. anInt1014 = j;
  9446. anInt1015 = k;
  9447. }
  9448. if(anInt1014 != j)
  9449. anInt1014 += (j - anInt1014) / 16;
  9450. if(anInt1015 != k)
  9451. anInt1015 += (k - anInt1015) / 16;
  9452. if(super.keyArray[1] == 1)
  9453. anInt1186 += (-24 - anInt1186) / 2;
  9454. else
  9455. if(super.keyArray[2] == 1)
  9456. anInt1186 += (24 - anInt1186) / 2;
  9457. else
  9458. anInt1186 /= 2;
  9459. if(super.keyArray[3] == 1)
  9460. anInt1187 += (12 - anInt1187) / 2;
  9461. else
  9462. if(super.keyArray[4] == 1)
  9463. anInt1187 += (-12 - anInt1187) / 2;
  9464. else
  9465. anInt1187 /= 2;
  9466. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  9467. anInt1184 += anInt1187 / 2;
  9468. if(anInt1184 < 128)
  9469. anInt1184 = 128;
  9470. if(anInt1184 > 383)
  9471. anInt1184 = 383;
  9472. int l = anInt1014 >> 7;
  9473. int i1 = anInt1015 >> 7;
  9474. int j1 = method42(plane, anInt1015, anInt1014);
  9475. int k1 = 0;
  9476. if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  9477. {
  9478. for(int l1 = l - 4; l1 <= l + 4; l1++)
  9479. {
  9480. for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  9481. {
  9482. int l2 = plane;
  9483. if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  9484. l2++;
  9485. int i3 = j1 - intGroundArray[l2][l1][k2];
  9486. if(i3 > k1)
  9487. k1 = i3;
  9488. }
  9489.  
  9490. }
  9491.  
  9492. }
  9493. anInt1005++;
  9494. if(anInt1005 > 1512)
  9495. {
  9496. anInt1005 = 0;
  9497. stream.createFrame(77);
  9498. stream.writeWordBigEndian(0);
  9499. int i2 = stream.currentOffset;
  9500. stream.writeWordBigEndian((int)(Math.random() * 256D));
  9501. stream.writeWordBigEndian(101);
  9502. stream.writeWordBigEndian(233);
  9503. stream.writeWord(45092);
  9504. if((int)(Math.random() * 2D) == 0)
  9505. stream.writeWord(35784);
  9506. stream.writeWordBigEndian((int)(Math.random() * 256D));
  9507. stream.writeWordBigEndian(64);
  9508. stream.writeWordBigEndian(38);
  9509. stream.writeWord((int)(Math.random() * 65536D));
  9510. stream.writeWord((int)(Math.random() * 65536D));
  9511. stream.writeBytes(stream.currentOffset - i2);
  9512. }
  9513. int j2 = k1 * 192;
  9514. if(j2 > 0x17f00)
  9515. j2 = 0x17f00;
  9516. if(j2 < 32768)
  9517. j2 = 32768;
  9518. if(j2 > anInt984)
  9519. {
  9520. anInt984 += (j2 - anInt984) / 24;
  9521. return;
  9522. }
  9523. if(j2 < anInt984)
  9524. {
  9525. anInt984 += (j2 - anInt984) / 80;
  9526. }
  9527. }
  9528. catch(Exception _ex)
  9529. {
  9530. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  9531. throw new RuntimeException("eek");
  9532. }
  9533. }
  9534.  
  9535. public void processDrawing()
  9536. {
  9537. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  9538. {
  9539. showErrorScreen();
  9540. return;
  9541. }
  9542. anInt1061++;
  9543. if(!loggedIn)
  9544. drawLoginScreen(false);
  9545. else
  9546. drawGameScreen();
  9547. anInt1213 = 0;
  9548. }
  9549.  
  9550. private boolean isFriendOrSelf(String s)
  9551. {
  9552. if(s == null)
  9553. return false;
  9554. for(int i = 0; i < friendsCount; i++)
  9555. if(s.equalsIgnoreCase(friendsList[i]))
  9556. return true;
  9557. return s.equalsIgnoreCase(myPlayer.name);
  9558. }
  9559.  
  9560. private static String combatDiffColor(int i, int j)
  9561. {
  9562. int k = i - j;
  9563. if(k < -9)
  9564. return "@red@";
  9565. if(k < -6)
  9566. return "@or3@";
  9567. if(k < -3)
  9568. return "@or2@";
  9569. if(k < 0)
  9570. return "@or1@";
  9571. if(k > 9)
  9572. return "@gre@";
  9573. if(k > 6)
  9574. return "@gr3@";
  9575. if(k > 3)
  9576. return "@gr2@";
  9577. if(k > 0)
  9578. return "@gr1@";
  9579. else
  9580. return "@yel@";
  9581. }
  9582.  
  9583. private void setWaveVolume(int i)
  9584. {
  9585. signlink.wavevol = i;
  9586. }
  9587.  
  9588. private void draw3dScreen()
  9589. {
  9590. drawSplitPrivateChat();
  9591. if(crossType == 1)
  9592. {
  9593. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9594. anInt1142++;
  9595. if(anInt1142 > 67)
  9596. {
  9597. anInt1142 = 0;
  9598. stream.createFrame(78);
  9599. }
  9600. }
  9601. if(crossType == 2)
  9602. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9603. if(anInt1018 != -1)
  9604. {
  9605. method119(anInt945, anInt1018);
  9606. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  9607. }
  9608. if(openInterfaceID != -1)
  9609. {
  9610. method119(anInt945, openInterfaceID);
  9611. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  9612. }
  9613. method70();
  9614. if(!menuOpen)
  9615. {
  9616. processRightClick();
  9617. drawTooltip();
  9618. } else
  9619. if(menuScreenArea == 0)
  9620. drawMenu();
  9621. if(anInt1055 == 1)
  9622. multiOverlay.drawSprite(472, 296);
  9623. if(fpsOn)
  9624. {
  9625. char c = '\u01FB';
  9626. int k = 20;
  9627. int i1 = 0xffff00;
  9628. if(super.fps < 15)
  9629. i1 = 0xff0000;
  9630. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  9631. k += 15;
  9632. Runtime runtime = Runtime.getRuntime();
  9633. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9634. i1 = 0xffff00;
  9635. if(j1 > 0x2000000 && lowMem)
  9636. i1 = 0xff0000;
  9637. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  9638. k += 15;
  9639. }
  9640. int i1 = 0xffff00;
  9641. int x = baseX + (myPlayer.x - 6 >> 7);
  9642. int y = baseY + (myPlayer.y - 6 >> 7);
  9643. if (clientData)
  9644. {
  9645. char c = '\u01FB';
  9646. int k = 20;
  9647. if(super.fps < 15)
  9648. i1 = 0xff0000;
  9649. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285, 5);
  9650. Runtime runtime = Runtime.getRuntime();
  9651. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9652. i1 = 0xffff00;
  9653. if(j1 > 0x2000000 && lowMem)
  9654. i1 = 0xff0000;
  9655. k += 15;
  9656. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299, 5);
  9657. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  9658. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
  9659. }
  9660. if(anInt1104 != 0)
  9661. {
  9662. int j = anInt1104 / 50;
  9663. int l = j / 60;
  9664. j %= 60;
  9665. if(j < 10)
  9666. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  9667. else
  9668. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  9669. anInt849++;
  9670. if(anInt849 > 75)
  9671. {
  9672. anInt849 = 0;
  9673. stream.createFrame(148);
  9674. }
  9675. }
  9676. }
  9677.  
  9678. private void addIgnore(long l)
  9679. {
  9680. try
  9681. {
  9682. if(l == 0L)
  9683. return;
  9684. if(ignoreCount >= 100)
  9685. {
  9686. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  9687. return;
  9688. }
  9689. String s = TextClass.fixName(TextClass.nameForLong(l));
  9690. for(int j = 0; j < ignoreCount; j++)
  9691. if(ignoreListAsLongs[j] == l)
  9692. {
  9693. pushMessage(s + " is already on your ignore list", 0, "");
  9694. return;
  9695. }
  9696. for(int k = 0; k < friendsCount; k++)
  9697. if(friendsListAsLongs[k] == l)
  9698. {
  9699. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  9700. return;
  9701. }
  9702.  
  9703. ignoreListAsLongs[ignoreCount++] = l;
  9704. needDrawTabArea = true;
  9705. stream.createFrame(133);
  9706. stream.writeQWord(l);
  9707. return;
  9708. }
  9709. catch(RuntimeException runtimeexception)
  9710. {
  9711. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  9712. }
  9713. throw new RuntimeException();
  9714. }
  9715.  
  9716. private void method114()
  9717. {
  9718. for(int i = -1; i < playerCount; i++)
  9719. {
  9720. int j;
  9721. if(i == -1)
  9722. j = myPlayerIndex;
  9723. else
  9724. j = playerIndices[i];
  9725. Player player = playerArray[j];
  9726. if(player != null)
  9727. method96(player);
  9728. }
  9729.  
  9730. }
  9731.  
  9732. private void method115()
  9733. {
  9734. if(loadingStage == 2)
  9735. {
  9736. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  9737. {
  9738. if(class30_sub1.anInt1294 > 0)
  9739. class30_sub1.anInt1294--;
  9740. if(class30_sub1.anInt1294 == 0)
  9741. {
  9742. if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  9743. {
  9744. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  9745. class30_sub1.unlink();
  9746. }
  9747. } else
  9748. {
  9749. if(class30_sub1.anInt1302 > 0)
  9750. class30_sub1.anInt1302--;
  9751. 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)))
  9752. {
  9753. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  9754. class30_sub1.anInt1302 = -1;
  9755. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  9756. class30_sub1.unlink();
  9757. else
  9758. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  9759. class30_sub1.unlink();
  9760. }
  9761. }
  9762. }
  9763.  
  9764. }
  9765. }
  9766.  
  9767.  
  9768. //stops the click from going over sprite
  9769. private void determineMenuSize()
  9770. {
  9771. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  9772. for(int j = 0; j < menuActionRow; j++)
  9773. {
  9774. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  9775. if(k > i)
  9776. i = k;
  9777. }
  9778.  
  9779. i += 8;
  9780. int l = 15 * menuActionRow + 21;
  9781. if(super.saveClickX > 4 && super.saveClickY > 4 && super.saveClickX < 516 && super.saveClickY < 338)
  9782. {
  9783. int i1 = super.saveClickX - 4 - i / 2;
  9784. if(i1 + i > 512)
  9785. i1 = 512 - i;
  9786. if(i1 < 0)
  9787. i1 = 0;
  9788. int l1 = super.saveClickY - 4;
  9789. if(l1 + l > 334)
  9790. l1 = 334 - l;
  9791. if(l1 < 0)
  9792. l1 = 0;
  9793. menuOpen = true;
  9794. menuScreenArea = 0;
  9795. menuOffsetX = i1;
  9796. menuOffsetY = l1;
  9797. menuWidth = i;
  9798. menuHeight = 15 * menuActionRow + 22;
  9799. }
  9800. if(super.saveClickX > 519 && super.saveClickY > 168 && super.saveClickX < 765 && super.saveClickY < 503)
  9801. {
  9802. int j1 = super.saveClickX - 519 - i / 2;
  9803. if(j1 < 0)
  9804. j1 = 0;
  9805. else
  9806. if(j1 + i > 245)
  9807. j1 = 245 - i;
  9808. int i2 = super.saveClickY - 168;
  9809. if(i2 < 0)
  9810. i2 = 0;
  9811. else
  9812. if(i2 + l > 333)
  9813. i2 = 333 - l;
  9814. menuOpen = true;
  9815. menuScreenArea = 1;
  9816. menuOffsetX = j1;
  9817. menuOffsetY = i2;
  9818. menuWidth = i;
  9819. menuHeight = 15 * menuActionRow + 22;
  9820. }
  9821. if(super.saveClickX > 0 && super.saveClickY > 338 && super.saveClickX < 516 && super.saveClickY < 503)
  9822. {
  9823. int k1 = super.saveClickX - 0 - i / 2;
  9824. if(k1 < 0)
  9825. k1 = 0;
  9826. else
  9827. if(k1 + i > 516)
  9828. k1 = 516 - i;
  9829. int j2 = super.saveClickY - 338;
  9830. if(j2 < 0)
  9831. j2 = 0;
  9832. else
  9833. if(j2 + l > 165)
  9834. j2 = 165 - l;
  9835. menuOpen = true;
  9836. menuScreenArea = 2;
  9837. menuOffsetX = k1;
  9838. menuOffsetY = j2;
  9839. menuWidth = i;
  9840. menuHeight = 15 * menuActionRow + 22;
  9841. }
  9842. }
  9843.  
  9844. private void method117(Stream stream)
  9845. {
  9846. stream.initBitAccess();
  9847. int j = stream.readBits(1);
  9848. if(j == 0)
  9849. return;
  9850. int k = stream.readBits(2);
  9851. if(k == 0)
  9852. {
  9853. anIntArray894[anInt893++] = myPlayerIndex;
  9854. return;
  9855. }
  9856. if(k == 1)
  9857. {
  9858. int l = stream.readBits(3);
  9859. myPlayer.moveInDir(false, l);
  9860. int k1 = stream.readBits(1);
  9861. if(k1 == 1)
  9862. anIntArray894[anInt893++] = myPlayerIndex;
  9863. return;
  9864. }
  9865. if(k == 2)
  9866. {
  9867. int i1 = stream.readBits(3);
  9868. myPlayer.moveInDir(true, i1);
  9869. int l1 = stream.readBits(3);
  9870. myPlayer.moveInDir(true, l1);
  9871. int j2 = stream.readBits(1);
  9872. if(j2 == 1)
  9873. anIntArray894[anInt893++] = myPlayerIndex;
  9874. return;
  9875. }
  9876. if(k == 3)
  9877. {
  9878. plane = stream.readBits(2);
  9879. int j1 = stream.readBits(1);
  9880. int i2 = stream.readBits(1);
  9881. if(i2 == 1)
  9882. anIntArray894[anInt893++] = myPlayerIndex;
  9883. int k2 = stream.readBits(7);
  9884. int l2 = stream.readBits(7);
  9885. myPlayer.setPos(l2, k2, j1 == 1);
  9886. }
  9887. }
  9888.  
  9889. private void nullLoader()
  9890. {
  9891. aBoolean831 = false;
  9892. while(drawingFlames)
  9893. {
  9894. aBoolean831 = false;
  9895. try
  9896. {
  9897. Thread.sleep(50L);
  9898. }
  9899. catch(Exception _ex) { }
  9900. }
  9901. aBackground_966 = null;
  9902. aBackground_967 = null;
  9903. aBackgroundArray1152s = null;
  9904. anIntArray850 = null;
  9905. anIntArray851 = null;
  9906. anIntArray852 = null;
  9907. anIntArray853 = null;
  9908. anIntArray1190 = null;
  9909. anIntArray1191 = null;
  9910. anIntArray828 = null;
  9911. anIntArray829 = null;
  9912. aClass30_Sub2_Sub1_Sub1_1201 = null;
  9913. aClass30_Sub2_Sub1_Sub1_1202 = null;
  9914. }
  9915.  
  9916. private boolean method119(int i, int j)
  9917. {
  9918. boolean flag1 = false;
  9919. RSInterface class9 = RSInterface.interfaceCache[j];
  9920. for(int k = 0; k < class9.children.length; k++)
  9921. {
  9922. if(class9.children[k] == -1)
  9923. break;
  9924. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  9925. if(class9_1.type == 1)
  9926. flag1 |= method119(i, class9_1.id);
  9927. if(class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1))
  9928. {
  9929. boolean flag2 = interfaceIsSelected(class9_1);
  9930. int l;
  9931. if(flag2)
  9932. l = class9_1.anInt258;
  9933. else
  9934. l = class9_1.anInt257;
  9935. if(l != -1)
  9936. {
  9937. Animation animation = Animation.anims[l];
  9938. for(class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);)
  9939. {
  9940. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  9941. class9_1.anInt246++;
  9942. if(class9_1.anInt246 >= animation.anInt352)
  9943. {
  9944. class9_1.anInt246 -= animation.anInt356;
  9945. if(class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  9946. class9_1.anInt246 = 0;
  9947. }
  9948. flag1 = true;
  9949. }
  9950.  
  9951. }
  9952. }
  9953. }
  9954.  
  9955. return flag1;
  9956. }
  9957.  
  9958. private int method120()
  9959. {
  9960. int j = 3;
  9961. if(yCameraCurve < 310)
  9962. {
  9963. int k = xCameraPos >> 7;
  9964. int l = yCameraPos >> 7;
  9965. int i1 = myPlayer.x >> 7;
  9966. int j1 = myPlayer.y >> 7;
  9967. if((byteGroundArray[plane][k][l] & 4) != 0)
  9968. j = plane;
  9969. int k1;
  9970. if(i1 > k)
  9971. k1 = i1 - k;
  9972. else
  9973. k1 = k - i1;
  9974. int l1;
  9975. if(j1 > l)
  9976. l1 = j1 - l;
  9977. else
  9978. l1 = l - j1;
  9979. if(k1 > l1)
  9980. {
  9981. int i2 = (l1 * 0x10000) / k1;
  9982. int k2 = 32768;
  9983. while(k != i1)
  9984. {
  9985. if(k < i1)
  9986. k++;
  9987. else
  9988. if(k > i1)
  9989. k--;
  9990. if((byteGroundArray[plane][k][l] & 4) != 0)
  9991. j = plane;
  9992. k2 += i2;
  9993. if(k2 >= 0x10000)
  9994. {
  9995. k2 -= 0x10000;
  9996. if(l < j1)
  9997. l++;
  9998. else
  9999. if(l > j1)
  10000. l--;
  10001. if((byteGroundArray[plane][k][l] & 4) != 0)
  10002. j = plane;
  10003. }
  10004. }
  10005. } else
  10006. {
  10007. int j2 = (k1 * 0x10000) / l1;
  10008. int l2 = 32768;
  10009. while(l != j1)
  10010. {
  10011. if(l < j1)
  10012. l++;
  10013. else
  10014. if(l > j1)
  10015. l--;
  10016. if((byteGroundArray[plane][k][l] & 4) != 0)
  10017. j = plane;
  10018. l2 += j2;
  10019. if(l2 >= 0x10000)
  10020. {
  10021. l2 -= 0x10000;
  10022. if(k < i1)
  10023. k++;
  10024. else
  10025. if(k > i1)
  10026. k--;
  10027. if((byteGroundArray[plane][k][l] & 4) != 0)
  10028. j = plane;
  10029. }
  10030. }
  10031. }
  10032. }
  10033. if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  10034. j = plane;
  10035. return j;
  10036. }
  10037.  
  10038. private int method121()
  10039. {
  10040. int j = method42(plane, yCameraPos, xCameraPos);
  10041. if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  10042. return plane;
  10043. else
  10044. return 3;
  10045. }
  10046.  
  10047. private void delIgnore(long l)
  10048. {
  10049. try
  10050. {
  10051. if(l == 0L)
  10052. return;
  10053. for(int j = 0; j < ignoreCount; j++)
  10054. if(ignoreListAsLongs[j] == l)
  10055. {
  10056. ignoreCount--;
  10057. needDrawTabArea = true;
  10058. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  10059.  
  10060. stream.createFrame(74);
  10061. stream.writeQWord(l);
  10062. return;
  10063. }
  10064.  
  10065. return;
  10066. }
  10067. catch(RuntimeException runtimeexception)
  10068. {
  10069. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  10070. }
  10071. throw new RuntimeException();
  10072. }
  10073.  
  10074.  
  10075. private void chatJoin(long l) {
  10076. try {
  10077. if(l == 0L)
  10078. return;
  10079. stream.createFrame(60);
  10080. stream.writeQWord(l);
  10081. return;
  10082. }
  10083. catch(RuntimeException runtimeexception)
  10084. {
  10085. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  10086. }
  10087. throw new RuntimeException();
  10088.  
  10089. }
  10090.  
  10091. public String getParameter(String s)
  10092. {
  10093. if(signlink.mainapp != null)
  10094. return signlink.mainapp.getParameter(s);
  10095. else
  10096. return super.getParameter(s);
  10097. }
  10098.  
  10099. private void adjustVolume(boolean flag, int i)
  10100. {
  10101. signlink.midivol = i;
  10102. if(flag)
  10103. signlink.midi = "voladjust";
  10104. }
  10105.  
  10106. private int extractInterfaceValues(RSInterface class9, int j)
  10107. {
  10108. if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  10109. return -2;
  10110. try
  10111. {
  10112. int ai[] = class9.valueIndexArray[j];
  10113. int k = 0;
  10114. int l = 0;
  10115. int i1 = 0;
  10116. do
  10117. {
  10118. int j1 = ai[l++];
  10119. int k1 = 0;
  10120. byte byte0 = 0;
  10121. if(j1 == 0)
  10122. return k;
  10123. if(j1 == 1)
  10124. k1 = currentStats[ai[l++]];
  10125. if(j1 == 2)
  10126. k1 = maxStats[ai[l++]];
  10127. if(j1 == 3)
  10128. k1 = currentExp[ai[l++]];
  10129. if(j1 == 4)
  10130. {
  10131. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  10132. int k2 = ai[l++];
  10133. if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  10134. {
  10135. for(int j3 = 0; j3 < class9_1.inv.length; j3++)
  10136. if(class9_1.inv[j3] == k2 + 1)
  10137. k1 += class9_1.invStackSizes[j3];
  10138.  
  10139. }
  10140. }
  10141. if(j1 == 5)
  10142. k1 = variousSettings[ai[l++]];
  10143. if(j1 == 6)
  10144. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  10145. if(j1 == 7)
  10146. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  10147. if(j1 == 8)
  10148. k1 = myPlayer.combatLevel;
  10149. if(j1 == 9)
  10150. {
  10151. for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  10152. if(Skills.skillEnabled[l1])
  10153. k1 += maxStats[l1];
  10154.  
  10155. }
  10156. if(j1 == 10)
  10157. {
  10158. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  10159. int l2 = ai[l++] + 1;
  10160. if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  10161. {
  10162. for(int k3 = 0; k3 < class9_2.inv.length; k3++)
  10163. {
  10164. if(class9_2.inv[k3] != l2)
  10165. continue;
  10166. k1 = 0x3b9ac9ff;
  10167. break;
  10168. }
  10169.  
  10170. }
  10171. }
  10172. if(j1 == 11)
  10173. k1 = energy;
  10174. if(j1 == 12)
  10175. k1 = weight;
  10176. if(j1 == 13)
  10177. {
  10178. int i2 = variousSettings[ai[l++]];
  10179. int i3 = ai[l++];
  10180. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  10181. }
  10182. if(j1 == 14)
  10183. {
  10184. int j2 = ai[l++];
  10185. VarBit varBit = VarBit.cache[j2];
  10186. int l3 = varBit.anInt648;
  10187. int i4 = varBit.anInt649;
  10188. int j4 = varBit.anInt650;
  10189. int k4 = anIntArray1232[j4 - i4];
  10190. k1 = variousSettings[l3] >> i4 & k4;
  10191. }
  10192. if(j1 == 15)
  10193. byte0 = 1;
  10194. if(j1 == 16)
  10195. byte0 = 2;
  10196. if(j1 == 17)
  10197. byte0 = 3;
  10198. if(j1 == 18)
  10199. k1 = (myPlayer.x >> 7) + baseX;
  10200. if(j1 == 19)
  10201. k1 = (myPlayer.y >> 7) + baseY;
  10202. if(j1 == 20)
  10203. k1 = ai[l++];
  10204. if(byte0 == 0)
  10205. {
  10206. if(i1 == 0)
  10207. k += k1;
  10208. if(i1 == 1)
  10209. k -= k1;
  10210. if(i1 == 2 && k1 != 0)
  10211. k /= k1;
  10212. if(i1 == 3)
  10213. k *= k1;
  10214. i1 = 0;
  10215. } else
  10216. {
  10217. i1 = byte0;
  10218. }
  10219. } while(true);
  10220. }
  10221. catch(Exception _ex)
  10222. {
  10223. return -1;
  10224. }
  10225. }
  10226.  
  10227. private void drawTooltip() {
  10228. if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  10229. return;
  10230. String s;
  10231. if(itemSelected == 1 && menuActionRow < 2)
  10232. s = "Use " + selectedItemName + " with...";
  10233. else if(spellSelected == 1 && menuActionRow < 2)
  10234. s = spellTooltip + "...";
  10235. else
  10236. s = menuActionName[menuActionRow - 1];
  10237. if(menuActionRow > 2)
  10238. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  10239. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  10240. }
  10241.  
  10242. private void drawMinimap() {
  10243. aRSImageProducer_1164.initDrawingArea();
  10244. if(anInt1021 == 2) {
  10245. byte abyte0[] = mapBack.aByteArray1450;
  10246. int ai[] = DrawingArea.pixels;
  10247. int k2 = abyte0.length;
  10248. for(int i5 = 0; i5 < k2; i5++)
  10249. if(abyte0[i5] == 0)
  10250. ai[i5] = 0;
  10251. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 8, 8, 33, 25);
  10252. aRSImageProducer_1165.initDrawingArea();
  10253. return;
  10254. }
  10255. int i = minimapInt1 + minimapInt2 & 0x7ff;
  10256. int j = 48 + myPlayer.x / 32;
  10257. int l2 = 464 - myPlayer.y / 32;
  10258. for (int x = 0; x < anIntArray1229.length; x++){
  10259. anIntArray1229[x] = 170;
  10260. anIntArray1052[x] = -23;
  10261. }
  10262. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, 10, 45, 146, j);
  10263. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 8, 8, 33, 25);
  10264. for(int j5 = 0; j5 < anInt1071; j5++) {
  10265. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  10266. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  10267. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  10268. }
  10269.  
  10270. for(int k5 = 0; k5 < 104; k5++) {
  10271. for(int l5 = 0; l5 < 104; l5++) {
  10272. NodeList class19 = groundArray[plane][k5][l5];
  10273. if(class19 != null) {
  10274. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  10275. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  10276. markMinimap(mapDotItem, l, j3);
  10277. }
  10278. }
  10279. }
  10280.  
  10281. for(int i6 = 0; i6 < npcCount; i6++) {
  10282. NPC npc = npcArray[npcIndices[i6]];
  10283. if(npc != null && npc.isVisible()) {
  10284. EntityDef entityDef = npc.desc;
  10285. if(entityDef.childrenIDs != null)
  10286. entityDef = entityDef.method161();
  10287. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  10288. int i1 = npc.x / 32 - myPlayer.x / 32;
  10289. int k3 = npc.y / 32 - myPlayer.y / 32;
  10290. markMinimap(mapDotNPC, i1, k3);
  10291. }
  10292. }
  10293. }
  10294.  
  10295. for(int j6 = 0; j6 < playerCount; j6++) {
  10296. Player player = playerArray[playerIndices[j6]];
  10297. if(player != null && player.isVisible()) {
  10298. int j1 = player.x / 32 - myPlayer.x / 32;
  10299. int l3 = player.y / 32 - myPlayer.y / 32;
  10300. boolean flag1 = false;
  10301. long l6 = TextClass.longForName(player.name);
  10302. for(int k6 = 0; k6 < friendsCount; k6++) {
  10303. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  10304. continue;
  10305. flag1 = true;
  10306. break;
  10307. }
  10308. boolean flag2 = false;
  10309. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  10310. flag2 = true;
  10311. if(flag1)
  10312. markMinimap(mapDotFriend, j1, l3);
  10313. else
  10314. markMinimap(mapDotPlayer, j1, l3);
  10315. }
  10316. }
  10317.  
  10318. if(anInt855 != 0 && loopCycle % 20 < 10) {
  10319. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  10320. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  10321. if(class30_sub2_sub4_sub1_sub1_1 != null)
  10322. {
  10323. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  10324. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  10325. method81(mapMarker, i4, k1);
  10326. }
  10327. }
  10328. if(anInt855 == 2) {
  10329. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  10330. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  10331. method81(mapMarker, j4, l1);
  10332. }
  10333. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length)
  10334. {
  10335. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  10336. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  10337. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  10338. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  10339. method81(mapMarker, k4, i2);
  10340. }
  10341. }
  10342. }
  10343. if(destX != 0) {
  10344. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  10345. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  10346. markMinimap(mapFlag, j2, l4);
  10347. }
  10348. DrawingArea.drawPixels(3, 78+5, 97+20, 0xffffff, 3);
  10349. logIconH.drawSprite(222, 1);
  10350. drawMapArea();
  10351. //drawLogoutButton();
  10352. /*
  10353. mapArea.drawSprite(0, 0);
  10354. drawWorldMapButton();
  10355. drawHP();
  10356. drawPrayer();
  10357. */
  10358. aRSImageProducer_1165.initDrawingArea();
  10359. }
  10360.  
  10361. public boolean mouseInRegion(int x1, int y1, int x2, int y2) {
  10362. if (super.mouseX >= x1 && super.mouseX <= x2 && super.mouseY >= y1 && super.mouseY <= y2)
  10363. return true;
  10364. return false;
  10365. }
  10366.  
  10367. public void drawLogoutButton() {
  10368. if (mouseInRegion(742, 764, 1, 23)) {
  10369. logH = true;
  10370. } else {
  10371. logH = false;
  10372. }
  10373. if(tabInterfaceIDs[7] != -1 && anInt1054 == 9)
  10374. if(loopCycle % 20 >= 10);
  10375. if(logH){
  10376. logIcon.drawSprite(222, 1);
  10377. } else {
  10378. logIcon.drawSprite(222, 1);
  10379. }
  10380. //cacheSprite[logHover ? 89 : 88].drawSprite(clientSize == 0 ? 228 : clientWidth - 21, 0);
  10381. if(tabID == 7) {
  10382. logIconC.drawSprite(222, 1);
  10383. //cacheSprite[90].drawSprite(clientSize == 0 ? 228 : clientWidth - 21, 0);
  10384. }
  10385. }
  10386.  
  10387. public void drawLogoutButton2() {
  10388. if (tabInterfaceIDs[7] != -1 && anInt1054 == 9)
  10389. if (loopCycle % 20 >= 10)
  10390. ;
  10391. logIcon.drawSprite(222, 1);
  10392. if (logHover == 1) {
  10393. logIconH.drawSprite(222, 1);
  10394. }
  10395. if (tabID == 7)
  10396. logIconC.drawSprite(222, 1);
  10397. }
  10398.  
  10399. private void npcScreenPos(Entity entity, int i) {
  10400. calcEntityScreenPos(entity.x, i, entity.y);
  10401. }
  10402.  
  10403. public void drawMapArea(){
  10404. mapArea.drawSprite(0, 0);
  10405. drawWorldMapButton();
  10406. drawHP();
  10407. drawRunOrb();
  10408. drawPrayer();
  10409. drawLogoutButton2();
  10410. }
  10411. private void calcEntityScreenPos(int i, int j, int l) {
  10412. if(i < 128 || l < 128 || i > 13056 || l > 13056) {
  10413. spriteDrawX = -1;
  10414. spriteDrawY = -1;
  10415. return;
  10416. }
  10417. int i1 = method42(plane, l, i) - j;
  10418. i -= xCameraPos;
  10419. i1 -= zCameraPos;
  10420. l -= yCameraPos;
  10421. int j1 = Model.modelIntArray1[yCameraCurve];
  10422. int k1 = Model.modelIntArray2[yCameraCurve];
  10423. int l1 = Model.modelIntArray1[xCameraCurve];
  10424. int i2 = Model.modelIntArray2[xCameraCurve];
  10425. int j2 = l * l1 + i * i2 >> 16;
  10426. l = l * i2 - i * l1 >> 16;
  10427. i = j2;
  10428. j2 = i1 * k1 - l * j1 >> 16;
  10429. l = i1 * j1 + l * k1 >> 16;
  10430. i1 = j2;
  10431. if(l >= 50) {
  10432. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  10433. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  10434. } else {
  10435. spriteDrawX = -1;
  10436. spriteDrawY = -1;
  10437. }
  10438. }
  10439.  
  10440. private void buildSplitPrivateChatMenu()
  10441. {
  10442. if(splitPrivateChat == 0)
  10443. return;
  10444. int i = 0;
  10445. if(anInt1104 != 0)
  10446. i = 1;
  10447. for(int j = 0; j < 100; j++)
  10448. if(chatMessages[j] != null)
  10449. {
  10450. int k = chatTypes[j];
  10451. String s = chatNames[j];
  10452. boolean flag1 = false;
  10453. if(s != null && s.startsWith("@cr")) {
  10454. s = s.substring(5);
  10455. }
  10456. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  10457. {
  10458. int l = 329 - i * 13;
  10459. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  10460. {
  10461. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  10462. if(i1 > 450)
  10463. i1 = 450;
  10464. if(super.mouseX < 4 + i1)
  10465. {
  10466. if(myPrivilege >= 1)
  10467. {
  10468. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  10469. menuActionID[menuActionRow] = 2606;
  10470. menuActionRow++;
  10471. }
  10472. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  10473. menuActionID[menuActionRow] = 2042;
  10474. menuActionRow++;
  10475. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  10476. menuActionID[menuActionRow] = 2337;
  10477. menuActionRow++;
  10478. }
  10479. }
  10480. if(++i >= 5)
  10481. return;
  10482. }
  10483. if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  10484. return;
  10485. }
  10486.  
  10487. }
  10488.  
  10489. private void method130(int j, int k, int l, int i1, int j1, int k1,
  10490. int l1, int i2, int j2)
  10491. {
  10492. Class30_Sub1 class30_sub1 = null;
  10493. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10494. {
  10495. if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  10496. continue;
  10497. class30_sub1 = class30_sub1_1;
  10498. break;
  10499. }
  10500.  
  10501. if(class30_sub1 == null)
  10502. {
  10503. class30_sub1 = new Class30_Sub1();
  10504. class30_sub1.anInt1295 = l1;
  10505. class30_sub1.anInt1296 = i1;
  10506. class30_sub1.anInt1297 = i2;
  10507. class30_sub1.anInt1298 = j1;
  10508. method89(class30_sub1);
  10509. aClass19_1179.insertHead(class30_sub1);
  10510. }
  10511. class30_sub1.anInt1291 = k;
  10512. class30_sub1.anInt1293 = k1;
  10513. class30_sub1.anInt1292 = l;
  10514. class30_sub1.anInt1302 = j2;
  10515. class30_sub1.anInt1294 = j;
  10516. }
  10517.  
  10518. private boolean interfaceIsSelected(RSInterface class9)
  10519. {
  10520. if(class9.anIntArray245 == null)
  10521. return false;
  10522. for(int i = 0; i < class9.anIntArray245.length; i++)
  10523. {
  10524. int j = extractInterfaceValues(class9, i);
  10525. int k = class9.anIntArray212[i];
  10526. if(class9.anIntArray245[i] == 2)
  10527. {
  10528. if(j >= k)
  10529. return false;
  10530. } else
  10531. if(class9.anIntArray245[i] == 3)
  10532. {
  10533. if(j <= k)
  10534. return false;
  10535. } else
  10536. if(class9.anIntArray245[i] == 4)
  10537. {
  10538. if(j == k)
  10539. return false;
  10540. } else
  10541. if(j != k)
  10542. return false;
  10543. }
  10544.  
  10545. return true;
  10546. }
  10547.  
  10548. private DataInputStream openJagGrabInputStream(String s)
  10549. throws IOException
  10550. {
  10551. // if(!aBoolean872)
  10552. // if(signlink.mainapp != null)
  10553. // return signlink.openurl(s);
  10554. // else
  10555. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  10556. if(aSocket832 != null)
  10557. {
  10558. try
  10559. {
  10560. aSocket832.close();
  10561. }
  10562. catch(Exception _ex) { }
  10563. aSocket832 = null;
  10564. }
  10565. aSocket832 = openSocket(43595);
  10566. aSocket832.setSoTimeout(10000);
  10567. java.io.InputStream inputstream = aSocket832.getInputStream();
  10568. OutputStream outputstream = aSocket832.getOutputStream();
  10569. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  10570. return new DataInputStream(inputstream);
  10571. }
  10572.  
  10573. private void doFlamesDrawing()
  10574. {
  10575. char c = '\u0100';
  10576. if(anInt1040 > 0)
  10577. {
  10578. for(int i = 0; i < 256; i++)
  10579. if(anInt1040 > 768)
  10580. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  10581. else
  10582. if(anInt1040 > 256)
  10583. anIntArray850[i] = anIntArray852[i];
  10584. else
  10585. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  10586.  
  10587. } else
  10588. if(anInt1041 > 0)
  10589. {
  10590. for(int j = 0; j < 256; j++)
  10591. if(anInt1041 > 768)
  10592. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  10593. else
  10594. if(anInt1041 > 256)
  10595. anIntArray850[j] = anIntArray853[j];
  10596. else
  10597. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  10598.  
  10599. } else
  10600. {
  10601. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  10602.  
  10603. }
  10604. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, aRSImageProducer_1110.anIntArray315, 0, 33920);
  10605.  
  10606. int i1 = 0;
  10607. int j1 = 1152;
  10608. for(int k1 = 1; k1 < c - 1; k1++)
  10609. {
  10610. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  10611. int j2 = 22 + l1;
  10612. if(j2 < 0)
  10613. j2 = 0;
  10614. i1 += j2;
  10615. for(int l2 = j2; l2 < 128; l2++)
  10616. {
  10617. int j3 = anIntArray828[i1++];
  10618. if(j3 != 0)
  10619. {
  10620. int l3 = j3;
  10621. int j4 = 256 - j3;
  10622. j3 = anIntArray850[j3];
  10623. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  10624. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  10625. } else
  10626. {
  10627. j1++;
  10628. }
  10629. }
  10630.  
  10631. j1 += j2;
  10632. }
  10633.  
  10634. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  10635. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, aRSImageProducer_1111.anIntArray315, 0, 33920);
  10636.  
  10637. i1 = 0;
  10638. j1 = 1176;
  10639. for(int k2 = 1; k2 < c - 1; k2++)
  10640. {
  10641. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  10642. int k3 = 103 - i3;
  10643. j1 += i3;
  10644. for(int i4 = 0; i4 < k3; i4++)
  10645. {
  10646. int k4 = anIntArray828[i1++];
  10647. if(k4 != 0)
  10648. {
  10649. int i5 = k4;
  10650. int j5 = 256 - k4;
  10651. k4 = anIntArray850[k4];
  10652. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  10653. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  10654. } else
  10655. {
  10656. j1++;
  10657. }
  10658. }
  10659.  
  10660. i1 += 128 - k3;
  10661. j1 += 128 - k3 - i3;
  10662. }
  10663.  
  10664. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  10665. }
  10666.  
  10667. private void method134(Stream stream)
  10668. {
  10669. int j = stream.readBits(8);
  10670. if(j < playerCount)
  10671. {
  10672. for(int k = j; k < playerCount; k++)
  10673. anIntArray840[anInt839++] = playerIndices[k];
  10674.  
  10675. }
  10676. if(j > playerCount)
  10677. {
  10678. signlink.reporterror(myUsername + " Too many players");
  10679. throw new RuntimeException("eek");
  10680. }
  10681. playerCount = 0;
  10682. for(int l = 0; l < j; l++)
  10683. {
  10684. int i1 = playerIndices[l];
  10685. Player player = playerArray[i1];
  10686. int j1 = stream.readBits(1);
  10687. if(j1 == 0)
  10688. {
  10689. playerIndices[playerCount++] = i1;
  10690. player.anInt1537 = loopCycle;
  10691. } else
  10692. {
  10693. int k1 = stream.readBits(2);
  10694. if(k1 == 0)
  10695. {
  10696. playerIndices[playerCount++] = i1;
  10697. player.anInt1537 = loopCycle;
  10698. anIntArray894[anInt893++] = i1;
  10699. } else
  10700. if(k1 == 1)
  10701. {
  10702. playerIndices[playerCount++] = i1;
  10703. player.anInt1537 = loopCycle;
  10704. int l1 = stream.readBits(3);
  10705. player.moveInDir(false, l1);
  10706. int j2 = stream.readBits(1);
  10707. if(j2 == 1)
  10708. anIntArray894[anInt893++] = i1;
  10709. } else
  10710. if(k1 == 2)
  10711. {
  10712. playerIndices[playerCount++] = i1;
  10713. player.anInt1537 = loopCycle;
  10714. int i2 = stream.readBits(3);
  10715. player.moveInDir(true, i2);
  10716. int k2 = stream.readBits(3);
  10717. player.moveInDir(true, k2);
  10718. int l2 = stream.readBits(1);
  10719. if(l2 == 1)
  10720. anIntArray894[anInt893++] = i1;
  10721. } else
  10722. if(k1 == 3)
  10723. anIntArray840[anInt839++] = i1;
  10724. }
  10725. }
  10726. }
  10727.  
  10728. private void drawLoginScreen(boolean flag)
  10729. {
  10730. resetImageProducers();
  10731. aRSImageProducer_1109.initDrawingArea();
  10732. aBackground_966.drawBackground(0, 0);
  10733. char c = '\u0168';
  10734. char c1 = '\310';
  10735. if(loginScreenState == 0)
  10736. {
  10737. int i = c1 / 2 + 80;
  10738. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  10739. i = c1 / 2 - 20;
  10740. chatTextDrawingArea.method382(0xffff00, c / 2, "Welcome to The-Genesis", i, true);
  10741. i += 30;
  10742. int l = c / 2 - 80;
  10743. int k1 = c1 / 2 + 20;
  10744. aBackground_967.drawBackground(l - 73, k1 - 20);
  10745. chatTextDrawingArea.method382(0xffffff, l, "Register", k1 + 5, true);
  10746. l = c / 2 + 80;
  10747. aBackground_967.drawBackground(l - 73, k1 - 20);
  10748. chatTextDrawingArea.method382(0xffffff, l, "Existing User", k1 + 5, true);
  10749. }
  10750. if(loginScreenState == 2)
  10751. {
  10752. int j = c1 / 2 - 40;
  10753. if(loginMessage1.length() > 0)
  10754. {
  10755. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  10756. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j, true);
  10757. j += 30;
  10758. } else
  10759. {
  10760. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  10761. j += 30;
  10762. }
  10763. chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff, "Username: " + myUsername + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10764. j += 15;
  10765. chatTextDrawingArea.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10766. j += 15;
  10767. if(!flag)
  10768. {
  10769. int i1 = c / 2 - 80;
  10770. int l1 = c1 / 2 + 50;
  10771. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10772. chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5, true);
  10773. i1 = c / 2 + 80;
  10774. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10775. chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  10776. }
  10777. }
  10778. if(loginScreenState == 3)
  10779. {
  10780. chatTextDrawingArea.method382(0xffff00, c / 2, "How to start?", c1 / 2 - 60, true);
  10781. int k = c1 / 2 - 35;
  10782. chatTextDrawingArea.method382(0xffffff, c / 2, "Click on existing user and enter a", k, true);
  10783. k += 15;
  10784. chatTextDrawingArea.method382(0xffffff, c / 2, "desirable username and password.", k, true);
  10785. k += 15;
  10786. chatTextDrawingArea.method382(0xffffff, c / 2, "Be sure to register in forums.", k, true);
  10787. k += 15;
  10788. chatTextDrawingArea.method382(0xffffff, c / 2, "Vote and try donating.", k, true);
  10789. k += 15;
  10790. int j1 = c / 2;
  10791. int i2 = c1 / 2 + 50;
  10792. aBackground_967.drawBackground(j1 - 73, i2 - 20);
  10793. chatTextDrawingArea.method382(0xffffff, j1, "Continue", i2 + 5, true);
  10794. }
  10795. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  10796. if(welcomeScreenRaised)
  10797. {
  10798. welcomeScreenRaised = false;
  10799. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  10800. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  10801. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  10802. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  10803. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  10804. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  10805. }
  10806. }
  10807.  
  10808. private void drawFlames()
  10809. {
  10810. drawingFlames = true;
  10811. try
  10812. {
  10813. long l = System.currentTimeMillis();
  10814. int i = 0;
  10815. int j = 20;
  10816. while(aBoolean831)
  10817. {
  10818. anInt1208++;
  10819. //calcFlamesPosition();
  10820. //calcFlamesPosition();
  10821. doFlamesDrawing();
  10822. if(++i > 10)
  10823. {
  10824. long l1 = System.currentTimeMillis();
  10825. int k = (int)(l1 - l) / 10 - j;
  10826. j = 40 - k;
  10827. if(j < 5)
  10828. j = 5;
  10829. i = 0;
  10830. l = l1;
  10831. }
  10832. try
  10833. {
  10834. Thread.sleep(j);
  10835. }
  10836. catch(Exception _ex) { }
  10837. }
  10838. }
  10839. catch(Exception _ex) { }
  10840. drawingFlames = false;
  10841. }
  10842.  
  10843. public void raiseWelcomeScreen()
  10844. {
  10845. welcomeScreenRaised = true;
  10846. }
  10847.  
  10848. private void method137(Stream stream, int j)
  10849. {
  10850. if(j == 84)
  10851. {
  10852. int k = stream.readUnsignedByte();
  10853. int j3 = anInt1268 + (k >> 4 & 7);
  10854. int i6 = anInt1269 + (k & 7);
  10855. int l8 = stream.readUnsignedWord();
  10856. int k11 = stream.readUnsignedWord();
  10857. int l13 = stream.readUnsignedWord();
  10858. if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  10859. {
  10860. NodeList class19_1 = groundArray[plane][j3][i6];
  10861. if(class19_1 != null)
  10862. {
  10863. 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())
  10864. {
  10865. if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  10866. continue;
  10867. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  10868. break;
  10869. }
  10870.  
  10871. spawnGroundItem(j3, i6);
  10872. }
  10873. }
  10874. return;
  10875. }
  10876. if(j == 105)
  10877. {
  10878. int l = stream.readUnsignedByte();
  10879. int k3 = anInt1268 + (l >> 4 & 7);
  10880. int j6 = anInt1269 + (l & 7);
  10881. int i9 = stream.readUnsignedWord();
  10882. int l11 = stream.readUnsignedByte();
  10883. int i14 = l11 >> 4 & 0xf;
  10884. int i16 = l11 & 7;
  10885. 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)
  10886. {
  10887. anIntArray1207[anInt1062] = i9;
  10888. anIntArray1241[anInt1062] = i16;
  10889. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  10890. anInt1062++;
  10891. }
  10892. }
  10893. if(j == 215)
  10894. {
  10895. int i1 = stream.method435();
  10896. int l3 = stream.method428();
  10897. int k6 = anInt1268 + (l3 >> 4 & 7);
  10898. int j9 = anInt1269 + (l3 & 7);
  10899. int i12 = stream.method435();
  10900. int j14 = stream.readUnsignedWord();
  10901. if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  10902. {
  10903. Item class30_sub2_sub4_sub2_2 = new Item();
  10904. class30_sub2_sub4_sub2_2.ID = i1;
  10905. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  10906. if(groundArray[plane][k6][j9] == null)
  10907. groundArray[plane][k6][j9] = new NodeList();
  10908. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  10909. spawnGroundItem(k6, j9);
  10910. }
  10911. return;
  10912. }
  10913. if(j == 156)
  10914. {
  10915. int j1 = stream.method426();
  10916. int i4 = anInt1268 + (j1 >> 4 & 7);
  10917. int l6 = anInt1269 + (j1 & 7);
  10918. int k9 = stream.readUnsignedWord();
  10919. if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  10920. {
  10921. NodeList class19 = groundArray[plane][i4][l6];
  10922. if(class19 != null)
  10923. {
  10924. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  10925. {
  10926. if(item.ID != (k9 & 0x7fff))
  10927. continue;
  10928. item.unlink();
  10929. break;
  10930. }
  10931.  
  10932. if(class19.reverseGetFirst() == null)
  10933. groundArray[plane][i4][l6] = null;
  10934. spawnGroundItem(i4, l6);
  10935. }
  10936. }
  10937. return;
  10938. }
  10939. if(j == 160)
  10940. {
  10941. int k1 = stream.method428();
  10942. int j4 = anInt1268 + (k1 >> 4 & 7);
  10943. int i7 = anInt1269 + (k1 & 7);
  10944. int l9 = stream.method428();
  10945. int j12 = l9 >> 2;
  10946. int k14 = l9 & 3;
  10947. int j16 = anIntArray1177[j12];
  10948. int j17 = stream.method435();
  10949. if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  10950. {
  10951. int j18 = intGroundArray[plane][j4][i7];
  10952. int i19 = intGroundArray[plane][j4 + 1][i7];
  10953. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  10954. int k20 = intGroundArray[plane][j4][i7 + 1];
  10955. if(j16 == 0)
  10956. {
  10957. Object1 class10 = worldController.method296(plane, j4, i7);
  10958. if(class10 != null)
  10959. {
  10960. int k21 = class10.uid >> 14 & 0x7fff;
  10961. if(j12 == 2)
  10962. {
  10963. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  10964. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  10965. } else
  10966. {
  10967. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  10968. }
  10969. }
  10970. }
  10971. if(j16 == 1)
  10972. {
  10973. Object2 class26 = worldController.method297(j4, i7, plane);
  10974. if(class26 != null)
  10975. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  10976. }
  10977. if(j16 == 2)
  10978. {
  10979. Object5 class28 = worldController.method298(j4, i7, plane);
  10980. if(j12 == 11)
  10981. j12 = 10;
  10982. if(class28 != null)
  10983. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  10984. }
  10985. if(j16 == 3)
  10986. {
  10987. Object3 class49 = worldController.method299(i7, j4, plane);
  10988. if(class49 != null)
  10989. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  10990. }
  10991. }
  10992. return;
  10993. }
  10994. if(j == 147)
  10995. {
  10996. int l1 = stream.method428();
  10997. int k4 = anInt1268 + (l1 >> 4 & 7);
  10998. int j7 = anInt1269 + (l1 & 7);
  10999. int i10 = stream.readUnsignedWord();
  11000. byte byte0 = stream.method430();
  11001. int l14 = stream.method434();
  11002. byte byte1 = stream.method429();
  11003. int k17 = stream.readUnsignedWord();
  11004. int k18 = stream.method428();
  11005. int j19 = k18 >> 2;
  11006. int i20 = k18 & 3;
  11007. int l20 = anIntArray1177[j19];
  11008. byte byte2 = stream.readSignedByte();
  11009. int l21 = stream.readUnsignedWord();
  11010. byte byte3 = stream.method429();
  11011. Player player;
  11012. if(i10 == unknownInt10)
  11013. player = myPlayer;
  11014. else
  11015. player = playerArray[i10];
  11016. if(player != null)
  11017. {
  11018. ObjectDef class46 = ObjectDef.forID(l21);
  11019. int i22 = intGroundArray[plane][k4][j7];
  11020. int j22 = intGroundArray[plane][k4 + 1][j7];
  11021. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  11022. int l22 = intGroundArray[plane][k4][j7 + 1];
  11023. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  11024. if(model != null)
  11025. {
  11026. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  11027. player.anInt1707 = l14 + loopCycle;
  11028. player.anInt1708 = k17 + loopCycle;
  11029. player.aModel_1714 = model;
  11030. int i23 = class46.anInt744;
  11031. int j23 = class46.anInt761;
  11032. if(i20 == 1 || i20 == 3)
  11033. {
  11034. i23 = class46.anInt761;
  11035. j23 = class46.anInt744;
  11036. }
  11037. player.anInt1711 = k4 * 128 + i23 * 64;
  11038. player.anInt1713 = j7 * 128 + j23 * 64;
  11039. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  11040. if(byte2 > byte0)
  11041. {
  11042. byte byte4 = byte2;
  11043. byte2 = byte0;
  11044. byte0 = byte4;
  11045. }
  11046. if(byte3 > byte1)
  11047. {
  11048. byte byte5 = byte3;
  11049. byte3 = byte1;
  11050. byte1 = byte5;
  11051. }
  11052. player.anInt1719 = k4 + byte2;
  11053. player.anInt1721 = k4 + byte0;
  11054. player.anInt1720 = j7 + byte3;
  11055. player.anInt1722 = j7 + byte1;
  11056. }
  11057. }
  11058. }
  11059. if(j == 151)
  11060. {
  11061. int i2 = stream.method426();
  11062. int l4 = anInt1268 + (i2 >> 4 & 7);
  11063. int k7 = anInt1269 + (i2 & 7);
  11064. int j10 = stream.method434();
  11065. int k12 = stream.method428();
  11066. int i15 = k12 >> 2;
  11067. int k16 = k12 & 3;
  11068. int l17 = anIntArray1177[i15];
  11069. if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  11070. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  11071. return;
  11072. }
  11073. if(j == 4)
  11074. {
  11075. int j2 = stream.readUnsignedByte();
  11076. int i5 = anInt1268 + (j2 >> 4 & 7);
  11077. int l7 = anInt1269 + (j2 & 7);
  11078. int k10 = stream.readUnsignedWord();
  11079. int l12 = stream.readUnsignedByte();
  11080. int j15 = stream.readUnsignedWord();
  11081. if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  11082. {
  11083. i5 = i5 * 128 + 64;
  11084. l7 = l7 * 128 + 64;
  11085. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  11086. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  11087. }
  11088. return;
  11089. }
  11090. if(j == 44)
  11091. {
  11092. int k2 = stream.method436();
  11093. int j5 = stream.readUnsignedWord();
  11094. int i8 = stream.readUnsignedByte();
  11095. int l10 = anInt1268 + (i8 >> 4 & 7);
  11096. int i13 = anInt1269 + (i8 & 7);
  11097. if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  11098. {
  11099. Item class30_sub2_sub4_sub2_1 = new Item();
  11100. class30_sub2_sub4_sub2_1.ID = k2;
  11101. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  11102. if(groundArray[plane][l10][i13] == null)
  11103. groundArray[plane][l10][i13] = new NodeList();
  11104. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  11105. spawnGroundItem(l10, i13);
  11106. }
  11107. return;
  11108. }
  11109. if(j == 101)
  11110. {
  11111. int l2 = stream.method427();
  11112. int k5 = l2 >> 2;
  11113. int j8 = l2 & 3;
  11114. int i11 = anIntArray1177[k5];
  11115. int j13 = stream.readUnsignedByte();
  11116. int k15 = anInt1268 + (j13 >> 4 & 7);
  11117. int l16 = anInt1269 + (j13 & 7);
  11118. if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  11119. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  11120. return;
  11121. }
  11122. if(j == 117)
  11123. {
  11124. int i3 = stream.readUnsignedByte();
  11125. int l5 = anInt1268 + (i3 >> 4 & 7);
  11126. int k8 = anInt1269 + (i3 & 7);
  11127. int j11 = l5 + stream.readSignedByte();
  11128. int k13 = k8 + stream.readSignedByte();
  11129. int l15 = stream.readSignedWord();
  11130. int i17 = stream.readUnsignedWord();
  11131. int i18 = stream.readUnsignedByte() * 4;
  11132. int l18 = stream.readUnsignedByte() * 4;
  11133. int k19 = stream.readUnsignedWord();
  11134. int j20 = stream.readUnsignedWord();
  11135. int i21 = stream.readUnsignedByte();
  11136. int j21 = stream.readUnsignedByte();
  11137. if(l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535)
  11138. {
  11139. l5 = l5 * 128 + 64;
  11140. k8 = k8 * 128 + 64;
  11141. j11 = j11 * 128 + 64;
  11142. k13 = k13 * 128 + 64;
  11143. 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);
  11144. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  11145. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  11146. }
  11147. }
  11148. }
  11149.  
  11150. private static void setLowMem()
  11151. {
  11152. WorldController.lowMem = true;
  11153. Texture.lowMem = true;
  11154. lowMem = true;
  11155. ObjectManager.lowMem = true;
  11156. ObjectDef.lowMem = true;
  11157. }
  11158.  
  11159. private void method139(Stream stream)
  11160. {
  11161. stream.initBitAccess();
  11162. int k = stream.readBits(8);
  11163. if(k < npcCount)
  11164. {
  11165. for(int l = k; l < npcCount; l++)
  11166. anIntArray840[anInt839++] = npcIndices[l];
  11167.  
  11168. }
  11169. if(k > npcCount)
  11170. {
  11171. signlink.reporterror(myUsername + " Too many npcs");
  11172. throw new RuntimeException("eek");
  11173. }
  11174. npcCount = 0;
  11175. for(int i1 = 0; i1 < k; i1++)
  11176. {
  11177. int j1 = npcIndices[i1];
  11178. NPC npc = npcArray[j1];
  11179. int k1 = stream.readBits(1);
  11180. if(k1 == 0)
  11181. {
  11182. npcIndices[npcCount++] = j1;
  11183. npc.anInt1537 = loopCycle;
  11184. } else
  11185. {
  11186. int l1 = stream.readBits(2);
  11187. if(l1 == 0)
  11188. {
  11189. npcIndices[npcCount++] = j1;
  11190. npc.anInt1537 = loopCycle;
  11191. anIntArray894[anInt893++] = j1;
  11192. } else
  11193. if(l1 == 1)
  11194. {
  11195. npcIndices[npcCount++] = j1;
  11196. npc.anInt1537 = loopCycle;
  11197. int i2 = stream.readBits(3);
  11198. npc.moveInDir(false, i2);
  11199. int k2 = stream.readBits(1);
  11200. if(k2 == 1)
  11201. anIntArray894[anInt893++] = j1;
  11202. } else
  11203. if(l1 == 2)
  11204. {
  11205. npcIndices[npcCount++] = j1;
  11206. npc.anInt1537 = loopCycle;
  11207. int j2 = stream.readBits(3);
  11208. npc.moveInDir(true, j2);
  11209. int l2 = stream.readBits(3);
  11210. npc.moveInDir(true, l2);
  11211. int i3 = stream.readBits(1);
  11212. if(i3 == 1)
  11213. anIntArray894[anInt893++] = j1;
  11214. } else
  11215. if(l1 == 3)
  11216. anIntArray840[anInt839++] = j1;
  11217. }
  11218. }
  11219.  
  11220. }
  11221.  
  11222. private void processLoginScreenInput()
  11223. {
  11224. if(loginScreenState == 0)
  11225. {
  11226. int i = super.myWidth / 2 - 80;
  11227. int l = super.myHeight / 2 + 20;
  11228. l += 20;
  11229. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  11230. {
  11231. loginScreenState = 3;
  11232. loginScreenCursorPos = 0;
  11233. }
  11234. i = super.myWidth / 2 + 80;
  11235. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  11236. {
  11237. loginMessage1 = "";
  11238. loginMessage2 = "Enter your username & password.";
  11239. loginScreenState = 2;
  11240. loginScreenCursorPos = 0;
  11241. }
  11242. } else
  11243. {
  11244. if(loginScreenState == 2)
  11245. {
  11246. int j = super.myHeight / 2 - 40;
  11247. j += 30;
  11248. j += 25;
  11249. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  11250. loginScreenCursorPos = 0;
  11251. j += 15;
  11252. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  11253. loginScreenCursorPos = 1;
  11254. j += 15;
  11255. int i1 = super.myWidth / 2 - 80;
  11256. int k1 = super.myHeight / 2 + 50;
  11257. k1 += 20;
  11258. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  11259. {
  11260. loginFailures = 0;
  11261. login(myUsername, myPassword, false);
  11262. if(loggedIn)
  11263. return;
  11264. }
  11265. i1 = super.myWidth / 2 + 80;
  11266. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  11267. {
  11268. loginScreenState = 0;
  11269. // myUsername = "";
  11270. // myPassword = "";
  11271. }
  11272. do
  11273. {
  11274. int l1 = readChar(-796);
  11275. if(l1 == -1)
  11276. break;
  11277. boolean flag1 = false;
  11278. for(int i2 = 0; i2 < validUserPassChars.length(); i2++)
  11279. {
  11280. if(l1 != validUserPassChars.charAt(i2))
  11281. continue;
  11282. flag1 = true;
  11283. break;
  11284. }
  11285.  
  11286. if(loginScreenCursorPos == 0)
  11287. {
  11288. if(l1 == 8 && myUsername.length() > 0)
  11289. myUsername = myUsername.substring(0, myUsername.length() - 1);
  11290. if (l1 == 9 || l1 == 10 || l1 == 13)
  11291. loginScreenCursorPos = 1;
  11292. if(flag1)
  11293. myUsername += (char)l1;
  11294. if(myUsername.length() > 12)
  11295. myUsername = myUsername.substring(0, 12);
  11296. } else
  11297. if(loginScreenCursorPos == 1)
  11298. {
  11299. if(l1 == 8 && myPassword.length() > 0)
  11300. myPassword = myPassword.substring(0, myPassword.length() - 1);
  11301. if (l1 == 10 || l1 == 13) //Enter to login
  11302. login(myUsername, myPassword, false);
  11303. if (l1 == 9) //Tab to switch between username and password
  11304. loginScreenCursorPos = 0;
  11305. if(flag1)
  11306. myPassword += (char)l1;
  11307. if(myPassword.length() > 20)
  11308. myPassword = myPassword.substring(0, 20);
  11309. }
  11310. } while(true);
  11311. return;
  11312. }
  11313. if(loginScreenState == 3)
  11314. {
  11315. int k = super.myWidth / 2;
  11316. int j1 = super.myHeight / 2 + 50;
  11317. j1 += 20;
  11318. if(super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75 && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  11319. loginScreenState = 0;
  11320. }
  11321. }
  11322. }
  11323.  
  11324. private void markMinimap(Sprite sprite, int i, int j)
  11325. {
  11326. int k = minimapInt1 + minimapInt2 & 0x7ff;
  11327. int l = i * i + j * j;
  11328. if(l > 6400)
  11329. return;
  11330. int i1 = Model.modelIntArray1[k];
  11331. int j1 = Model.modelIntArray2[k];
  11332. i1 = (i1 * 256) / (minimapInt3 + 256);
  11333. j1 = (j1 * 256) / (minimapInt3 + 256);
  11334. int k1 = j * i1 + i * j1 >> 16;
  11335. int l1 = j * j1 - i * i1 >> 16;
  11336. if(l > 2500) {
  11337. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 + 20, 83 - l1 - sprite.anInt1445 / 2 - 4 + 5);
  11338. } else {
  11339. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 + 20, 83 - l1 - sprite.anInt1445 / 2 - 4 + 5);
  11340. }
  11341. }
  11342.  
  11343. private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  11344. )
  11345. {
  11346. if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  11347. {
  11348. if(lowMem && j != plane)
  11349. return;
  11350. int i2 = 0;
  11351. if(j1 == 0)
  11352. i2 = worldController.method300(j, i1, i);
  11353. if(j1 == 1)
  11354. i2 = worldController.method301(j, i1, i);
  11355. if(j1 == 2)
  11356. i2 = worldController.method302(j, i1, i);
  11357. if(j1 == 3)
  11358. i2 = worldController.method303(j, i1, i);
  11359. if(i2 != 0)
  11360. {
  11361. int i3 = worldController.method304(j, i1, i, i2);
  11362. int j2 = i2 >> 14 & 0x7fff;
  11363. int k2 = i3 & 0x1f;
  11364. int l2 = i3 >> 6;
  11365. if(j1 == 0)
  11366. {
  11367. worldController.method291(i1, j, i, (byte)-119);
  11368. ObjectDef class46 = ObjectDef.forID(j2);
  11369. if(class46.aBoolean767)
  11370. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  11371. }
  11372. if(j1 == 1)
  11373. worldController.method292(i, j, i1);
  11374. if(j1 == 2)
  11375. {
  11376. worldController.method293(j, i1, i);
  11377. ObjectDef class46_1 = ObjectDef.forID(j2);
  11378. if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  11379. return;
  11380. if(class46_1.aBoolean767)
  11381. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  11382. }
  11383. if(j1 == 3)
  11384. {
  11385. worldController.method294(j, i, i1);
  11386. ObjectDef class46_2 = ObjectDef.forID(j2);
  11387. if(class46_2.aBoolean767 && class46_2.hasActions)
  11388. aClass11Array1230[j].method218(i, i1);
  11389. }
  11390. }
  11391. if(k1 >= 0)
  11392. {
  11393. int j3 = j;
  11394. if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  11395. j3++;
  11396. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  11397. }
  11398. }
  11399. }
  11400.  
  11401. private void updatePlayers(int i, Stream stream)
  11402. {
  11403. anInt839 = 0;
  11404. anInt893 = 0;
  11405. method117(stream);
  11406. method134(stream);
  11407. method91(stream, i);
  11408. method49(stream);
  11409. for(int k = 0; k < anInt839; k++)
  11410. {
  11411. int l = anIntArray840[k];
  11412. if(playerArray[l].anInt1537 != loopCycle)
  11413. playerArray[l] = null;
  11414. }
  11415.  
  11416. if(stream.currentOffset != i)
  11417. {
  11418. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  11419. throw new RuntimeException("eek");
  11420. }
  11421. for(int i1 = 0; i1 < playerCount; i1++)
  11422. if(playerArray[playerIndices[i1]] == null)
  11423. {
  11424. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  11425. throw new RuntimeException("eek");
  11426. }
  11427.  
  11428. }
  11429.  
  11430. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  11431. {
  11432. int l1 = 2048 - k & 0x7ff;
  11433. int i2 = 2048 - j1 & 0x7ff;
  11434. int j2 = 0;
  11435. int k2 = 0;
  11436. int l2 = j;
  11437. if(l1 != 0)
  11438. {
  11439. int i3 = Model.modelIntArray1[l1];
  11440. int k3 = Model.modelIntArray2[l1];
  11441. int i4 = k2 * k3 - l2 * i3 >> 16;
  11442. l2 = k2 * i3 + l2 * k3 >> 16;
  11443. k2 = i4;
  11444. }
  11445. if(i2 != 0)
  11446. {
  11447. /* xxx if(cameratoggle){
  11448. if(zoom == 0)
  11449. zoom = k2;
  11450. if(lftrit == 0)
  11451. lftrit = j2;
  11452. if(fwdbwd == 0)
  11453. fwdbwd = l2;
  11454. k2 = zoom;
  11455. j2 = lftrit;
  11456. l2 = fwdbwd;
  11457. }
  11458. */
  11459. int j3 = Model.modelIntArray1[i2];
  11460. int l3 = Model.modelIntArray2[i2];
  11461. int j4 = l2 * j3 + j2 * l3 >> 16;
  11462. l2 = l2 * l3 - j2 * j3 >> 16;
  11463. j2 = j4;
  11464. }
  11465. xCameraPos = l - j2;
  11466. zCameraPos = i1 - k2;
  11467. yCameraPos = k1 - l2;
  11468. yCameraCurve = k;
  11469. xCameraCurve = j1;
  11470. }
  11471.  
  11472. public void updateStrings(String str, int i) {
  11473. switch(i) {
  11474. case 1675: sendFrame126(str, 17508); break;//Stab
  11475. case 1676: sendFrame126(str, 17509); break;//Slash
  11476. case 1677: sendFrame126(str, 17510); break;//Cursh
  11477. case 1678: sendFrame126(str, 17511); break;//Magic
  11478. case 1679: sendFrame126(str, 17512); break;//Range
  11479. case 1680: sendFrame126(str, 17513); break;//Stab
  11480. case 1681: sendFrame126(str, 17514); break;//Slash
  11481. case 1682: sendFrame126(str, 17515); break;//Crush
  11482. case 1683: sendFrame126(str, 17516); break;//Magic
  11483. case 1684: sendFrame126(str, 17517); break;//Range
  11484. case 1686: sendFrame126(str, 17518); break;//Strength
  11485. case 1687: sendFrame126(str, 17519); break;//Prayer
  11486. }
  11487. }
  11488.  
  11489. public void sendFrame126(String str,int i) {
  11490. RSInterface.interfaceCache[i].message = str;
  11491. if(RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  11492. needDrawTabArea = true;
  11493. }
  11494.  
  11495. public void sendPacket185(int button,int toggle,int type) {
  11496. switch(type) {
  11497. case 135:
  11498. RSInterface class9 = RSInterface.interfaceCache[button];
  11499. boolean flag8 = true;
  11500. if(class9.contentType > 0)
  11501. flag8 = promptUserForInput(class9);
  11502. if(flag8) {
  11503. stream.createFrame(185);
  11504. stream.writeWord(button);
  11505. }
  11506. break;
  11507. case 646:
  11508. stream.createFrame(185);
  11509. stream.writeWord(button);
  11510. RSInterface class9_2 = RSInterface.interfaceCache[button];
  11511. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  11512. if(variousSettings[toggle] != class9_2.anIntArray212[0]) {
  11513. variousSettings[toggle] = class9_2.anIntArray212[0];
  11514. method33(toggle);
  11515. needDrawTabArea = true;
  11516. }
  11517. }
  11518. break;
  11519. case 169:
  11520. stream.createFrame(185);
  11521. stream.writeWord(button);
  11522. RSInterface class9_3 = RSInterface.interfaceCache[button];
  11523. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  11524. variousSettings[toggle] = 1 - variousSettings[toggle];
  11525. method33(toggle);
  11526. needDrawTabArea = true;
  11527. }
  11528. switch(button) {
  11529. case 19136:
  11530. System.out.println("toggle = "+toggle);
  11531. if(toggle == 0)
  11532. sendFrame36(173,toggle);
  11533. if(toggle == 1)
  11534. sendPacket185(153,173,646);
  11535. break;
  11536. }
  11537. break;
  11538. }
  11539. }
  11540.  
  11541. public void sendFrame36(int id,int state) {
  11542. anIntArray1045[id] = state;
  11543. if(variousSettings[id] != state) {
  11544. variousSettings[id] = state;
  11545. method33(id);
  11546. needDrawTabArea = true;
  11547. if(dialogID != -1)
  11548. inputTaken = true;
  11549. }
  11550. }
  11551.  
  11552. public void sendFrame219() {
  11553. if(invOverlayInterfaceID != -1) {
  11554. invOverlayInterfaceID = -1;
  11555. needDrawTabArea = true;
  11556. tabAreaAltered = true;
  11557. }
  11558. if(backDialogID != -1) {
  11559. backDialogID = -1;
  11560. inputTaken = true;
  11561. }
  11562. if(inputDialogState != 0) {
  11563. inputDialogState = 0;
  11564. inputTaken = true;
  11565. }
  11566. openInterfaceID = -1;
  11567. aBoolean1149 = false;
  11568. }
  11569.  
  11570. public void sendFrame248(int interfaceID,int sideInterfaceID) {
  11571. if(backDialogID != -1) {
  11572. backDialogID = -1;
  11573. inputTaken = true;
  11574. }
  11575. if(inputDialogState != 0) {
  11576. inputDialogState = 0;
  11577. inputTaken = true;
  11578. }
  11579. openInterfaceID = interfaceID;
  11580. invOverlayInterfaceID = sideInterfaceID;
  11581. needDrawTabArea = true;
  11582. tabAreaAltered = true;
  11583. aBoolean1149 = false;
  11584. }
  11585.  
  11586. private boolean parsePacket() {
  11587. if(socketStream == null)
  11588. return false;
  11589. try {
  11590. int i = socketStream.available();
  11591. if(i == 0)
  11592. return false;
  11593. if(pktType == -1) {
  11594. socketStream.flushInputStream(inStream.buffer, 1);
  11595. pktType = inStream.buffer[0] & 0xff;
  11596. if(encryption != null)
  11597. pktType = pktType - encryption.getNextKey() & 0xff;
  11598. pktSize = SizeConstants.packetSizes[pktType];
  11599. i--;
  11600. }
  11601. if(pktSize == -1)
  11602. if(i > 0) {
  11603. socketStream.flushInputStream(inStream.buffer, 1);
  11604. pktSize = inStream.buffer[0] & 0xff;
  11605. i--;
  11606. } else {
  11607. return false;
  11608. }
  11609. if(pktSize == -2)
  11610. if(i > 1) {
  11611. socketStream.flushInputStream(inStream.buffer, 2);
  11612. inStream.currentOffset = 0;
  11613. pktSize = inStream.readUnsignedWord();
  11614. i -= 2;
  11615. } else {
  11616. return false;
  11617. }
  11618. if(i < pktSize)
  11619. return false;
  11620. inStream.currentOffset = 0;
  11621. socketStream.flushInputStream(inStream.buffer, pktSize);
  11622. anInt1009 = 0;
  11623. anInt843 = anInt842;
  11624. anInt842 = anInt841;
  11625. anInt841 = pktType;
  11626. switch(pktType) {
  11627. case 81:
  11628. updatePlayers(pktSize, inStream);
  11629. aBoolean1080 = false;
  11630. pktType = -1;
  11631. return true;
  11632.  
  11633. case 176:
  11634. daysSinceRecovChange = inStream.method427();
  11635. unreadMessages = inStream.method435();
  11636. membersInt = inStream.readUnsignedByte();
  11637. anInt1193 = inStream.method440();
  11638. daysSinceLastLogin = inStream.readUnsignedWord();
  11639. if(anInt1193 != 0 && openInterfaceID == -1) {
  11640. signlink.dnslookup(TextClass.method586(anInt1193));
  11641. clearTopInterfaces();
  11642. char c = '\u028A';
  11643. if(daysSinceRecovChange != 201 || membersInt == 1)
  11644. c = '\u028F';
  11645. reportAbuseInput = "";
  11646. canMute = false;
  11647. for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  11648. if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  11649. continue;
  11650. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  11651.  
  11652. }
  11653. }
  11654. pktType = -1;
  11655. return true;
  11656.  
  11657. case 64:
  11658. anInt1268 = inStream.method427();
  11659. anInt1269 = inStream.method428();
  11660. for(int j = anInt1268; j < anInt1268 + 8; j++) {
  11661. for(int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  11662. if(groundArray[plane][j][l9] != null) {
  11663. groundArray[plane][j][l9] = null;
  11664. spawnGroundItem(j, l9);
  11665. }
  11666. }
  11667. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  11668. if(class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  11669. class30_sub1.anInt1294 = 0;
  11670. pktType = -1;
  11671. return true;
  11672.  
  11673. case 185:
  11674. int k = inStream.method436();
  11675. RSInterface.interfaceCache[k].anInt233 = 3;
  11676. if(myPlayer.desc == null)
  11677. 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];
  11678. else
  11679. RSInterface.interfaceCache[k].mediaID = (int)(0x12345678L + myPlayer.desc.type);
  11680. pktType = -1;
  11681. return true;
  11682.  
  11683. /* Clan chat packet */
  11684. case 217:
  11685. try {
  11686. name = inStream.readString();
  11687. message = inStream.readString();
  11688. clanname = inStream.readString();
  11689. rights = inStream.readUnsignedWord();
  11690. //message = TextInput.processText(message);
  11691. //message = Censor.doCensor(message);
  11692. System.out.println(clanname);
  11693. pushMessage(message, 16, name);
  11694. } catch(Exception e) {
  11695. e.printStackTrace();
  11696. }
  11697. pktType = -1;
  11698. return true;
  11699.  
  11700. case 107:
  11701. aBoolean1160 = false;
  11702. for(int l = 0; l < 5; l++)
  11703. aBooleanArray876[l] = false;
  11704.  
  11705. pktType = -1;
  11706. return true;
  11707.  
  11708. case 72:
  11709. int i1 = inStream.method434();
  11710. RSInterface class9 = RSInterface.interfaceCache[i1];
  11711. for(int k15 = 0; k15 < class9.inv.length; k15++) {
  11712. class9.inv[k15] = -1;
  11713. class9.inv[k15] = 0;
  11714. }
  11715. pktType = -1;
  11716. return true;
  11717.  
  11718. case 214:
  11719. ignoreCount = pktSize / 8;
  11720. for(int j1 = 0; j1 < ignoreCount; j1++)
  11721. ignoreListAsLongs[j1] = inStream.readQWord();
  11722. pktType = -1;
  11723. return true;
  11724.  
  11725. case 166:
  11726. aBoolean1160 = true;
  11727. anInt1098 = inStream.readUnsignedByte();
  11728. anInt1099 = inStream.readUnsignedByte();
  11729. anInt1100 = inStream.readUnsignedWord();
  11730. anInt1101 = inStream.readUnsignedByte();
  11731. anInt1102 = inStream.readUnsignedByte();
  11732. if(anInt1102 >= 100) {
  11733. xCameraPos = anInt1098 * 128 + 64;
  11734. yCameraPos = anInt1099 * 128 + 64;
  11735. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  11736. }
  11737. pktType = -1;
  11738. return true;
  11739.  
  11740. case 134:
  11741. needDrawTabArea = true;
  11742. int k1 = inStream.readUnsignedByte();
  11743. int i10 = inStream.method439();
  11744. int l15 = inStream.readUnsignedByte();
  11745. int xp = currentExp[k1];
  11746. currentExp[k1] = i10;
  11747. currentStats[k1] = l15;
  11748. maxStats[k1] = 1;
  11749. for(int k20 = 0; k20 < 98; k20++)
  11750. if(i10 >= anIntArray1019[k20])
  11751. maxStats[k1] = k20 + 2;
  11752. pktType = -1;
  11753. return true;
  11754.  
  11755. case 71:
  11756. int l1 = inStream.readUnsignedWord();
  11757. int j10 = inStream.method426();
  11758. if(l1 == 65535)
  11759. l1 = -1;
  11760. tabInterfaceIDs[j10] = l1;
  11761. needDrawTabArea = true;
  11762. tabAreaAltered = true;
  11763. pktType = -1;
  11764. return true;
  11765.  
  11766. case 74:
  11767. int i2 = inStream.method434();
  11768. if(i2 == 65535)
  11769. i2 = -1;
  11770. if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  11771. nextSong = i2;
  11772. songChanging = true;
  11773. onDemandFetcher.method558(2, nextSong);
  11774. }
  11775. currentSong = i2;
  11776. pktType = -1;
  11777. return true;
  11778.  
  11779. case 121:
  11780. int j2 = inStream.method436();
  11781. int k10 = inStream.method435();
  11782. if(musicEnabled && !lowMem) {
  11783. nextSong = j2;
  11784. songChanging = false;
  11785. onDemandFetcher.method558(2, nextSong);
  11786. prevSong = k10;
  11787. }
  11788. pktType = -1;
  11789. return true;
  11790.  
  11791. case 109:
  11792. resetLogout();
  11793. pktType = -1;
  11794. return false;
  11795.  
  11796. case 70:
  11797. int k2 = inStream.readSignedWord();
  11798. int l10 = inStream.method437();
  11799. int i16 = inStream.method434();
  11800. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  11801. class9_5.anInt263 = k2;
  11802. class9_5.anInt265 = l10;
  11803. pktType = -1;
  11804. return true;
  11805.  
  11806. case 73:
  11807. case 241:
  11808. int l2 = anInt1069;
  11809. int i11 = anInt1070;
  11810. if(pktType == 73) {
  11811. l2 = inStream.method435();
  11812. i11 = inStream.readUnsignedWord();
  11813. aBoolean1159 = false;
  11814. }
  11815. if(pktType == 241) {
  11816. i11 = inStream.method435();
  11817. inStream.initBitAccess();
  11818. for(int j16 = 0; j16 < 4; j16++) {
  11819. for(int l20 = 0; l20 < 13; l20++) {
  11820. for(int j23 = 0; j23 < 13; j23++) {
  11821. int i26 = inStream.readBits(1);
  11822. if(i26 == 1)
  11823. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  11824. else
  11825. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  11826. }
  11827. }
  11828. }
  11829. inStream.finishBitAccess();
  11830. l2 = inStream.readUnsignedWord();
  11831. aBoolean1159 = true;
  11832. }
  11833. if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  11834. pktType = -1;
  11835. return true;
  11836. }
  11837. anInt1069 = l2;
  11838. anInt1070 = i11;
  11839. baseX = (anInt1069 - 6) * 8;
  11840. baseY = (anInt1070 - 6) * 8;
  11841. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  11842. if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  11843. aBoolean1141 = true;
  11844. loadingStage = 1;
  11845. aLong824 = System.currentTimeMillis();
  11846. aRSImageProducer_1165.initDrawingArea();
  11847. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  11848. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  11849. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  11850. if(pktType == 73) {
  11851. int k16 = 0;
  11852. for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  11853. for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  11854. k16++;
  11855. }
  11856. aByteArrayArray1183 = new byte[k16][];
  11857. aByteArrayArray1247 = new byte[k16][];
  11858. anIntArray1234 = new int[k16];
  11859. anIntArray1235 = new int[k16];
  11860. anIntArray1236 = new int[k16];
  11861. k16 = 0;
  11862. for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  11863. for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  11864. anIntArray1234[k16] = (l23 << 8) + j26;
  11865. if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  11866. anIntArray1235[k16] = -1;
  11867. anIntArray1236[k16] = -1;
  11868. k16++;
  11869. } else {
  11870. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  11871. if(k28 != -1)
  11872. onDemandFetcher.method558(3, k28);
  11873. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  11874. if(j30 != -1)
  11875. onDemandFetcher.method558(3, j30);
  11876. k16++;
  11877. }
  11878. }
  11879. }
  11880. }
  11881. if(pktType == 241) {
  11882. int l16 = 0;
  11883. int ai[] = new int[676];
  11884. for(int i24 = 0; i24 < 4; i24++) {
  11885. for(int k26 = 0; k26 < 13; k26++) {
  11886. for(int l28 = 0; l28 < 13; l28++) {
  11887. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  11888. if(k30 != -1) {
  11889. int k31 = k30 >> 14 & 0x3ff;
  11890. int i32 = k30 >> 3 & 0x7ff;
  11891. int k32 = (k31 / 8 << 8) + i32 / 8;
  11892. for(int j33 = 0; j33 < l16; j33++) {
  11893. if(ai[j33] != k32)
  11894. continue;
  11895. k32 = -1;
  11896.  
  11897. }
  11898. if(k32 != -1)
  11899. ai[l16++] = k32;
  11900. }
  11901. }
  11902. }
  11903. }
  11904. aByteArrayArray1183 = new byte[l16][];
  11905. aByteArrayArray1247 = new byte[l16][];
  11906. anIntArray1234 = new int[l16];
  11907. anIntArray1235 = new int[l16];
  11908. anIntArray1236 = new int[l16];
  11909. for(int l26 = 0; l26 < l16; l26++) {
  11910. int i29 = anIntArray1234[l26] = ai[l26];
  11911. int l30 = i29 >> 8 & 0xff;
  11912. int l31 = i29 & 0xff;
  11913. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  11914. if(j32 != -1)
  11915. onDemandFetcher.method558(3, j32);
  11916. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  11917. if(i33 != -1)
  11918. onDemandFetcher.method558(3, i33);
  11919. }
  11920. }
  11921. int i17 = baseX - anInt1036;
  11922. int j21 = baseY - anInt1037;
  11923. anInt1036 = baseX;
  11924. anInt1037 = baseY;
  11925. for(int j24 = 0; j24 < 16384; j24++) {
  11926. NPC npc = npcArray[j24];
  11927. if(npc != null) {
  11928. for(int j29 = 0; j29 < 10; j29++) {
  11929. npc.smallX[j29] -= i17;
  11930. npc.smallY[j29] -= j21;
  11931. }
  11932. npc.x -= i17 * 128;
  11933. npc.y -= j21 * 128;
  11934. }
  11935. }
  11936. for(int i27 = 0; i27 < maxPlayers; i27++) {
  11937. Player player = playerArray[i27];
  11938. if(player != null) {
  11939. for(int i31 = 0; i31 < 10; i31++) {
  11940. player.smallX[i31] -= i17;
  11941. player.smallY[i31] -= j21;
  11942. }
  11943. player.x -= i17 * 128;
  11944. player.y -= j21 * 128;
  11945. }
  11946. }
  11947. aBoolean1080 = true;
  11948. byte byte1 = 0;
  11949. byte byte2 = 104;
  11950. byte byte3 = 1;
  11951. if(i17 < 0) {
  11952. byte1 = 103;
  11953. byte2 = -1;
  11954. byte3 = -1;
  11955. }
  11956. byte byte4 = 0;
  11957. byte byte5 = 104;
  11958. byte byte6 = 1;
  11959. if(j21 < 0) {
  11960. byte4 = 103;
  11961. byte5 = -1;
  11962. byte6 = -1;
  11963. }
  11964. for(int k33 = byte1; k33 != byte2; k33 += byte3) {
  11965. for(int l33 = byte4; l33 != byte5; l33 += byte6) {
  11966. int i34 = k33 + i17;
  11967. int j34 = l33 + j21;
  11968. for(int k34 = 0; k34 < 4; k34++)
  11969. if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  11970. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  11971. else
  11972. groundArray[k34][k33][l33] = null;
  11973. }
  11974. }
  11975. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext()) {
  11976. class30_sub1_1.anInt1297 -= i17;
  11977. class30_sub1_1.anInt1298 -= j21;
  11978. if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  11979. class30_sub1_1.unlink();
  11980. }
  11981. if(destX != 0) {
  11982. destX -= i17;
  11983. destY -= j21;
  11984. }
  11985. aBoolean1160 = false;
  11986. pktType = -1;
  11987. return true;
  11988.  
  11989. case 208:
  11990. int i3 = inStream.method437();
  11991. if(i3 >= 0)
  11992. method60(i3);
  11993. anInt1018 = i3;
  11994. pktType = -1;
  11995. return true;
  11996.  
  11997. case 99:
  11998. anInt1021 = inStream.readUnsignedByte();
  11999. pktType = -1;
  12000. return true;
  12001.  
  12002. case 75:
  12003. int j3 = inStream.method436();
  12004. int j11 = inStream.method436();
  12005. RSInterface.interfaceCache[j11].anInt233 = 2;
  12006. RSInterface.interfaceCache[j11].mediaID = j3;
  12007. pktType = -1;
  12008. return true;
  12009.  
  12010. case 114:
  12011. anInt1104 = inStream.method434() * 30;
  12012. pktType = -1;
  12013. return true;
  12014.  
  12015. case 60:
  12016. anInt1269 = inStream.readUnsignedByte();
  12017. anInt1268 = inStream.method427();
  12018. while(inStream.currentOffset < pktSize) {
  12019. int k3 = inStream.readUnsignedByte();
  12020. method137(inStream, k3);
  12021. }
  12022. pktType = -1;
  12023. return true;
  12024.  
  12025. case 35:
  12026. int l3 = inStream.readUnsignedByte();
  12027. int k11 = inStream.readUnsignedByte();
  12028. int j17 = inStream.readUnsignedByte();
  12029. int k21 = inStream.readUnsignedByte();
  12030. aBooleanArray876[l3] = true;
  12031. anIntArray873[l3] = k11;
  12032. anIntArray1203[l3] = j17;
  12033. anIntArray928[l3] = k21;
  12034. anIntArray1030[l3] = 0;
  12035. pktType = -1;
  12036. return true;
  12037.  
  12038. case 174:
  12039. int i4 = inStream.readUnsignedWord();
  12040. int l11 = inStream.readUnsignedByte();
  12041. int k17 = inStream.readUnsignedWord();
  12042. if(aBoolean848 && !lowMem && anInt1062 < 50) {
  12043. anIntArray1207[anInt1062] = i4;
  12044. anIntArray1241[anInt1062] = l11;
  12045. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  12046. anInt1062++;
  12047. }
  12048. pktType = -1;
  12049. return true;
  12050.  
  12051. case 104:
  12052. int j4 = inStream.method427();
  12053. int i12 = inStream.method426();
  12054. String s6 = inStream.readString();
  12055. if(j4 >= 1 && j4 <= 5) {
  12056. if(s6.equalsIgnoreCase("null"))
  12057. s6 = null;
  12058. atPlayerActions[j4 - 1] = s6;
  12059. atPlayerArray[j4 - 1] = i12 == 0;
  12060. }
  12061. pktType = -1;
  12062. return true;
  12063.  
  12064. case 78:
  12065. destX = 0;
  12066. pktType = -1;
  12067. return true;
  12068.  
  12069. case 253:
  12070. String s = inStream.readString();
  12071. if(s.endsWith(":tradereq:")) {
  12072. String s3 = s.substring(0, s.indexOf(":"));
  12073. long l17 = TextClass.longForName(s3);
  12074. boolean flag2 = false;
  12075. for(int j27 = 0; j27 < ignoreCount; j27++) {
  12076. if(ignoreListAsLongs[j27] != l17)
  12077. continue;
  12078. flag2 = true;
  12079.  
  12080. }
  12081. if(!flag2 && anInt1251 == 0)
  12082. pushMessage("wishes to trade with you.", 4, s3);
  12083. } else if (s.endsWith(":clan:")) {
  12084. String s4 = s.substring(0, s.indexOf(":"));
  12085. long l18 = TextClass.longForName(s4);
  12086. pushMessage("Clan: ", 8, s4);
  12087. } else if(s.endsWith("#url#")) {
  12088. String link = s.substring(0, s.indexOf("#"));
  12089. pushMessage("Join us at: ", 9, link);
  12090. } else if(s.endsWith(":duelreq:")) {
  12091. String s4 = s.substring(0, s.indexOf(":"));
  12092. long l18 = TextClass.longForName(s4);
  12093. boolean flag3 = false;
  12094. for(int k27 = 0; k27 < ignoreCount; k27++) {
  12095. if(ignoreListAsLongs[k27] != l18)
  12096. continue;
  12097. flag3 = true;
  12098.  
  12099. }
  12100. if(!flag3 && anInt1251 == 0)
  12101. pushMessage("wishes to duel with you.", 8, s4);
  12102. } else if(s.endsWith(":chalreq:")) {
  12103. String s5 = s.substring(0, s.indexOf(":"));
  12104. long l19 = TextClass.longForName(s5);
  12105. boolean flag4 = false;
  12106. for(int l27 = 0; l27 < ignoreCount; l27++) {
  12107. if(ignoreListAsLongs[l27] != l19)
  12108. continue;
  12109. flag4 = true;
  12110.  
  12111. }
  12112. if(!flag4 && anInt1251 == 0) {
  12113. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  12114. pushMessage(s8, 8, s5);
  12115. }
  12116. } else {
  12117. pushMessage(s, 0, "");
  12118. }
  12119. pktType = -1;
  12120. return true;
  12121.  
  12122. case 1:
  12123. for(int k4 = 0; k4 < playerArray.length; k4++)
  12124. if(playerArray[k4] != null)
  12125. playerArray[k4].anim = -1;
  12126. for(int j12 = 0; j12 < npcArray.length; j12++)
  12127. if(npcArray[j12] != null)
  12128. npcArray[j12].anim = -1;
  12129. pktType = -1;
  12130. return true;
  12131.  
  12132. case 50:
  12133. long l4 = inStream.readQWord();
  12134. int i18 = inStream.readUnsignedByte();
  12135. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  12136. for(int k24 = 0; k24 < friendsCount; k24++) {
  12137. if(l4 != friendsListAsLongs[k24])
  12138. continue;
  12139. if(friendsNodeIDs[k24] != i18) {
  12140. friendsNodeIDs[k24] = i18;
  12141. needDrawTabArea = true;
  12142. if(i18 >= 2) {
  12143. pushMessage(s7 + " has logged in.", 5, "");
  12144. }
  12145. if(i18 <= 1) {
  12146. pushMessage(s7 + " has logged out.", 5, "");
  12147. }
  12148. }
  12149. s7 = null;
  12150.  
  12151. }
  12152. if(s7 != null && friendsCount < 200) {
  12153. friendsListAsLongs[friendsCount] = l4;
  12154. friendsList[friendsCount] = s7;
  12155. friendsNodeIDs[friendsCount] = i18;
  12156. friendsCount++;
  12157. needDrawTabArea = true;
  12158. }
  12159. for(boolean flag6 = false; !flag6;) {
  12160. flag6 = true;
  12161. for(int k29 = 0; k29 < friendsCount - 1; k29++)
  12162. if(friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  12163. int j31 = friendsNodeIDs[k29];
  12164. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  12165. friendsNodeIDs[k29 + 1] = j31;
  12166. String s10 = friendsList[k29];
  12167. friendsList[k29] = friendsList[k29 + 1];
  12168. friendsList[k29 + 1] = s10;
  12169. long l32 = friendsListAsLongs[k29];
  12170. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  12171. friendsListAsLongs[k29 + 1] = l32;
  12172. needDrawTabArea = true;
  12173. flag6 = false;
  12174. }
  12175. }
  12176. pktType = -1;
  12177. return true;
  12178.  
  12179. case 110:
  12180. if(tabID == 12)
  12181. needDrawTabArea = true;
  12182. energy = inStream.readUnsignedByte();
  12183. pktType = -1;
  12184. return true;
  12185.  
  12186. case 254:
  12187. anInt855 = inStream.readUnsignedByte();
  12188. if(anInt855 == 1)
  12189. anInt1222 = inStream.readUnsignedWord();
  12190. if(anInt855 >= 2 && anInt855 <= 6) {
  12191. if(anInt855 == 2) {
  12192. anInt937 = 64;
  12193. anInt938 = 64;
  12194. }
  12195. if(anInt855 == 3) {
  12196. anInt937 = 0;
  12197. anInt938 = 64;
  12198. }
  12199. if(anInt855 == 4) {
  12200. anInt937 = 128;
  12201. anInt938 = 64;
  12202. }
  12203. if(anInt855 == 5) {
  12204. anInt937 = 64;
  12205. anInt938 = 0;
  12206. }
  12207. if(anInt855 == 6) {
  12208. anInt937 = 64;
  12209. anInt938 = 128;
  12210. }
  12211. anInt855 = 2;
  12212. anInt934 = inStream.readUnsignedWord();
  12213. anInt935 = inStream.readUnsignedWord();
  12214. anInt936 = inStream.readUnsignedByte();
  12215. }
  12216. if(anInt855 == 10)
  12217. anInt933 = inStream.readUnsignedWord();
  12218. pktType = -1;
  12219. return true;
  12220.  
  12221. case 248:
  12222. int i5 = inStream.method435();
  12223. int k12 = inStream.readUnsignedWord();
  12224. if(backDialogID != -1) {
  12225. backDialogID = -1;
  12226. inputTaken = true;
  12227. }
  12228. if(inputDialogState != 0) {
  12229. inputDialogState = 0;
  12230. inputTaken = true;
  12231. }
  12232. openInterfaceID = i5;
  12233. invOverlayInterfaceID = k12;
  12234. needDrawTabArea = true;
  12235. tabAreaAltered = true;
  12236. aBoolean1149 = false;
  12237. pktType = -1;
  12238. return true;
  12239.  
  12240. case 79:
  12241. int j5 = inStream.method434();
  12242. int l12 = inStream.method435();
  12243. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  12244. if(class9_3 != null && class9_3.type == 0) {
  12245. if(l12 < 0)
  12246. l12 = 0;
  12247. if(l12 > class9_3.scrollMax - class9_3.height)
  12248. l12 = class9_3.scrollMax - class9_3.height;
  12249. class9_3.scrollPosition = l12;
  12250. }
  12251. pktType = -1;
  12252. return true;
  12253.  
  12254. case 68:
  12255. for(int k5 = 0; k5 < variousSettings.length; k5++)
  12256. if(variousSettings[k5] != anIntArray1045[k5]) {
  12257. variousSettings[k5] = anIntArray1045[k5];
  12258. method33(k5);
  12259. needDrawTabArea = true;
  12260. }
  12261. pktType = -1;
  12262. return true;
  12263.  
  12264. case 196:
  12265. long l5 = inStream.readQWord();
  12266. int j18 = inStream.readDWord();
  12267. int l21 = inStream.readUnsignedByte();
  12268. boolean flag5 = false;
  12269. if(l21 <= 1) {
  12270. for(int l29 = 0; l29 < ignoreCount; l29++) {
  12271. if(ignoreListAsLongs[l29] != l5)
  12272. continue;
  12273. flag5 = true;
  12274.  
  12275. }
  12276. }
  12277. if(!flag5 && anInt1251 == 0)
  12278. try {
  12279. String s9 = TextInput.method525(pktSize - 13, inStream);
  12280. //if(l21 != 3)
  12281. //s9 = Censor.doCensor(s9);
  12282. if(l21 == 2 || l21 == 3)
  12283. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12284. else
  12285. if(l21 == 1)
  12286. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12287. else
  12288. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  12289. } catch(Exception exception1) {
  12290. signlink.reporterror("cde1");
  12291. }
  12292. pktType = -1;
  12293. return true;
  12294.  
  12295. case 85:
  12296. anInt1269 = inStream.method427();
  12297. anInt1268 = inStream.method427();
  12298. pktType = -1;
  12299. return true;
  12300.  
  12301. case 24:
  12302. anInt1054 = inStream.method428();
  12303. if(anInt1054 == tabID) {
  12304. if(anInt1054 == 3)
  12305. tabID = 1;
  12306. else
  12307. tabID = 3;
  12308. needDrawTabArea = true;
  12309. }
  12310. pktType = -1;
  12311. return true;
  12312.  
  12313. case 246:
  12314. int i6 = inStream.method434();
  12315. int i13 = inStream.readUnsignedWord();
  12316. int k18 = inStream.readUnsignedWord();
  12317. if(k18 == 65535) {
  12318. RSInterface.interfaceCache[i6].anInt233 = 0;
  12319. pktType = -1;
  12320. return true;
  12321. } else {
  12322. ItemDef itemDef = ItemDef.forID(k18);
  12323. RSInterface.interfaceCache[i6].anInt233 = 4;
  12324. RSInterface.interfaceCache[i6].mediaID = k18;
  12325. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotation1;
  12326. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotation2;
  12327. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  12328. pktType = -1;
  12329. return true;
  12330. }
  12331.  
  12332. case 171:
  12333. boolean flag1 = inStream.readUnsignedByte() == 1;
  12334. int j13 = inStream.readUnsignedWord();
  12335. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  12336. pktType = -1;
  12337. return true;
  12338.  
  12339. case 142:
  12340. int j6 = inStream.method434();
  12341. method60(j6);
  12342. if(backDialogID != -1) {
  12343. backDialogID = -1;
  12344. inputTaken = true;
  12345. }
  12346. if(inputDialogState != 0) {
  12347. inputDialogState = 0;
  12348. inputTaken = true;
  12349. }
  12350. invOverlayInterfaceID = j6;
  12351. needDrawTabArea = true;
  12352. tabAreaAltered = true;
  12353. openInterfaceID = -1;
  12354. aBoolean1149 = false;
  12355. pktType = -1;
  12356. return true;
  12357.  
  12358. case 126:
  12359. String text = inStream.readString();
  12360. int frame = inStream.method435();
  12361. if (text.startsWith("www.")) {
  12362. launchURL(text);
  12363. pktType = -1;
  12364. return true;
  12365. }
  12366. updateStrings(text, frame);
  12367. sendFrame126(text, frame);
  12368. if (frame >= 18144 && frame <= 18244) {
  12369. clanList[frame - 18144] = text;
  12370. }
  12371. pktType = -1;
  12372. return true;
  12373.  
  12374. case 206:
  12375. publicChatMode = inStream.readUnsignedByte();
  12376. privateChatMode = inStream.readUnsignedByte();
  12377. tradeMode = inStream.readUnsignedByte();
  12378. aBoolean1233 = true;
  12379. inputTaken = true;
  12380. pktType = -1;
  12381. return true;
  12382.  
  12383. case 240:
  12384. if(tabID == 12)
  12385. needDrawTabArea = true;
  12386. weight = inStream.readSignedWord();
  12387. pktType = -1;
  12388. return true;
  12389.  
  12390. case 8:
  12391. int k6 = inStream.method436();
  12392. int l13 = inStream.readUnsignedWord();
  12393. RSInterface.interfaceCache[k6].anInt233 = 1;
  12394. RSInterface.interfaceCache[k6].mediaID = l13;
  12395. pktType = -1;
  12396. return true;
  12397.  
  12398. case 122:
  12399. int l6 = inStream.method436();
  12400. int i14 = inStream.method436();
  12401. int i19 = i14 >> 10 & 0x1f;
  12402. int i22 = i14 >> 5 & 0x1f;
  12403. int l24 = i14 & 0x1f;
  12404. RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  12405. pktType = -1;
  12406. return true;
  12407.  
  12408. case 53:
  12409. needDrawTabArea = true;
  12410. int i7 = inStream.readUnsignedWord();
  12411. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  12412. int j19 = inStream.readUnsignedWord();
  12413. for(int j22 = 0; j22 < j19; j22++) {
  12414. int i25 = inStream.readUnsignedByte();
  12415. if(i25 == 255)
  12416. i25 = inStream.method440();
  12417. class9_1.inv[j22] = inStream.method436();
  12418. class9_1.invStackSizes[j22] = i25;
  12419. }
  12420. for(int j25 = j19; j25 < class9_1.inv.length; j25++) {
  12421. class9_1.inv[j25] = 0;
  12422. class9_1.invStackSizes[j25] = 0;
  12423. }
  12424. pktType = -1;
  12425. return true;
  12426.  
  12427. case 230:
  12428. int j7 = inStream.method435();
  12429. int j14 = inStream.readUnsignedWord();
  12430. int k19 = inStream.readUnsignedWord();
  12431. int k22 = inStream.method436();
  12432. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  12433. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  12434. RSInterface.interfaceCache[j14].modelZoom = j7;
  12435. pktType = -1;
  12436. return true;
  12437.  
  12438. case 221:
  12439. anInt900 = inStream.readUnsignedByte();
  12440. needDrawTabArea = true;
  12441. pktType = -1;
  12442. return true;
  12443.  
  12444. case 177:
  12445. aBoolean1160 = true;
  12446. anInt995 = inStream.readUnsignedByte();
  12447. anInt996 = inStream.readUnsignedByte();
  12448. anInt997 = inStream.readUnsignedWord();
  12449. anInt998 = inStream.readUnsignedByte();
  12450. anInt999 = inStream.readUnsignedByte();
  12451. if(anInt999 >= 100) {
  12452. int k7 = anInt995 * 128 + 64;
  12453. int k14 = anInt996 * 128 + 64;
  12454. int i20 = method42(plane, k14, k7) - anInt997;
  12455. int l22 = k7 - xCameraPos;
  12456. int k25 = i20 - zCameraPos;
  12457. int j28 = k14 - yCameraPos;
  12458. int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  12459. yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  12460. xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  12461. if(yCameraCurve < 128)
  12462. yCameraCurve = 128;
  12463. if(yCameraCurve > 383)
  12464. yCameraCurve = 383;
  12465. }
  12466. pktType = -1;
  12467. return true;
  12468.  
  12469. case 249:
  12470. anInt1046 = inStream.method426();
  12471. unknownInt10 = inStream.method436();
  12472. pktType = -1;
  12473. return true;
  12474.  
  12475. case 65:
  12476. updateNPCs(inStream, pktSize);
  12477. pktType = -1;
  12478. return true;
  12479.  
  12480. case 27:
  12481. messagePromptRaised = false;
  12482. inputDialogState = 1;
  12483. amountOrNameInput = "";
  12484. inputTaken = true;
  12485. pktType = -1;
  12486. return true;
  12487.  
  12488. case 187:
  12489. messagePromptRaised = false;
  12490. inputDialogState = 2;
  12491. amountOrNameInput = "";
  12492. inputTaken = true;
  12493. pktType = -1;
  12494. return true;
  12495.  
  12496. case 97:
  12497. int l7 = inStream.readUnsignedWord();
  12498. method60(l7);
  12499. if(invOverlayInterfaceID != -1) {
  12500. invOverlayInterfaceID = -1;
  12501. needDrawTabArea = true;
  12502. tabAreaAltered = true;
  12503. }
  12504. if(backDialogID != -1) {
  12505. backDialogID = -1;
  12506. inputTaken = true;
  12507. }
  12508. if(inputDialogState != 0) {
  12509. inputDialogState = 0;
  12510. inputTaken = true;
  12511. }
  12512. openInterfaceID = l7;
  12513. aBoolean1149 = false;
  12514. pktType = -1;
  12515. return true;
  12516.  
  12517. case 218:
  12518. int i8 = inStream.method438();
  12519. dialogID = i8;
  12520. inputTaken = true;
  12521. pktType = -1;
  12522. return true;
  12523.  
  12524. case 87:
  12525. int j8 = inStream.method434();
  12526. int l14 = inStream.method439();
  12527. anIntArray1045[j8] = l14;
  12528. if(variousSettings[j8] != l14) {
  12529. variousSettings[j8] = l14;
  12530. method33(j8);
  12531. needDrawTabArea = true;
  12532. if(dialogID != -1)
  12533. inputTaken = true;
  12534. }
  12535. pktType = -1;
  12536. return true;
  12537.  
  12538. case 36:
  12539. int k8 = inStream.method434();
  12540. byte byte0 = inStream.readSignedByte();
  12541. anIntArray1045[k8] = byte0;
  12542. if(variousSettings[k8] != byte0) {
  12543. variousSettings[k8] = byte0;
  12544. method33(k8);
  12545. needDrawTabArea = true;
  12546. if(dialogID != -1)
  12547. inputTaken = true;
  12548. }
  12549. pktType = -1;
  12550. return true;
  12551.  
  12552. case 61:
  12553. anInt1055 = inStream.readUnsignedByte();
  12554. pktType = -1;
  12555. return true;
  12556.  
  12557. case 200:
  12558. int l8 = inStream.readUnsignedWord();
  12559. int i15 = inStream.readSignedWord();
  12560. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  12561. class9_4.anInt257 = i15;
  12562. if(i15 == -1) {
  12563. class9_4.anInt246 = 0;
  12564. class9_4.anInt208 = 0;
  12565. }
  12566. pktType = -1;
  12567. return true;
  12568.  
  12569. case 219:
  12570. if(invOverlayInterfaceID != -1) {
  12571. invOverlayInterfaceID = -1;
  12572. needDrawTabArea = true;
  12573. tabAreaAltered = true;
  12574. }
  12575. if(backDialogID != -1) {
  12576. backDialogID = -1;
  12577. inputTaken = true;
  12578. }
  12579. if(inputDialogState != 0) {
  12580. inputDialogState = 0;
  12581. inputTaken = true;
  12582. }
  12583. openInterfaceID = -1;
  12584. aBoolean1149 = false;
  12585. pktType = -1;
  12586. return true;
  12587.  
  12588. case 34:
  12589. needDrawTabArea = true;
  12590. int i9 = inStream.readUnsignedWord();
  12591. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  12592. while(inStream.currentOffset < pktSize) {
  12593. int j20 = inStream.method422();
  12594. int i23 = inStream.readUnsignedWord();
  12595. int l25 = inStream.readUnsignedByte();
  12596. if(l25 == 255)
  12597. l25 = inStream.readDWord();
  12598. if(j20 >= 0 && j20 < class9_2.inv.length) {
  12599. class9_2.inv[j20] = i23;
  12600. class9_2.invStackSizes[j20] = l25;
  12601. }
  12602. }
  12603. pktType = -1;
  12604. return true;
  12605.  
  12606. case 4:
  12607. case 44:
  12608. case 84:
  12609. case 101:
  12610. case 105:
  12611. case 117:
  12612. case 147:
  12613. case 151:
  12614. case 156:
  12615. case 160:
  12616. case 215:
  12617. method137(inStream, pktType);
  12618. pktType = -1;
  12619. return true;
  12620.  
  12621. case 106:
  12622. tabID = inStream.method427();
  12623. needDrawTabArea = true;
  12624. tabAreaAltered = true;
  12625. pktType = -1;
  12626. return true;
  12627.  
  12628. case 164:
  12629. int j9 = inStream.method434();
  12630. method60(j9);
  12631. if(invOverlayInterfaceID != -1) {
  12632. invOverlayInterfaceID = -1;
  12633. needDrawTabArea = true;
  12634. tabAreaAltered = true;
  12635. }
  12636. backDialogID = j9;
  12637. inputTaken = true;
  12638. openInterfaceID = -1;
  12639. aBoolean1149 = false;
  12640. pktType = -1;
  12641. return true;
  12642.  
  12643. }
  12644. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  12645. //resetLogout();
  12646. } catch(IOException _ex) {
  12647. dropClient();
  12648. } catch(Exception exception) {
  12649. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  12650. for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  12651. s2 = s2 + inStream.buffer[j15] + ",";
  12652. signlink.reporterror(s2);
  12653. //resetLogout();
  12654. }
  12655. pktType = -1;
  12656. return true;
  12657. }
  12658.  
  12659. private void method146() {
  12660. anInt1265++;
  12661. method47(true);
  12662. method26(true);
  12663. method47(false);
  12664. method26(false);
  12665. method55();
  12666. method104();
  12667. if(!aBoolean1160) {
  12668. int i = anInt1184;
  12669. if(anInt984 / 256 > i)
  12670. i = anInt984 / 256;
  12671. if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  12672. i = anIntArray1203[4] + 128;
  12673. int k = minimapInt1 + anInt896 & 0x7ff;
  12674. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  12675. }
  12676. int j;
  12677. if(!aBoolean1160)
  12678. j = method120();
  12679. else
  12680. j = method121();
  12681. int l = xCameraPos;
  12682. int i1 = zCameraPos;
  12683. int j1 = yCameraPos;
  12684. int k1 = yCameraCurve;
  12685. int l1 = xCameraCurve;
  12686. for(int i2 = 0; i2 < 5; i2++)
  12687. if(aBooleanArray876[i2]) {
  12688. 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]);
  12689. if(i2 == 0)
  12690. xCameraPos += j2;
  12691. if(i2 == 1)
  12692. zCameraPos += j2;
  12693. if(i2 == 2)
  12694. yCameraPos += j2;
  12695. if(i2 == 3)
  12696. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  12697. if(i2 == 4) {
  12698. yCameraCurve += j2;
  12699. if(yCameraCurve < 128)
  12700. yCameraCurve = 128;
  12701. if(yCameraCurve > 383)
  12702. yCameraCurve = 383;
  12703. }
  12704. }
  12705. int k2 = Texture.anInt1481;
  12706. Model.aBoolean1684 = true;
  12707. Model.anInt1687 = 0;
  12708. Model.anInt1685 = super.mouseX - 4;
  12709. Model.anInt1686 = super.mouseY - 4;
  12710. DrawingArea.setAllPixelsToZero();
  12711. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  12712. worldController.clearObj5Cache();
  12713. updateEntities();
  12714. drawHeadIcon();
  12715. method37(k2);
  12716. draw3dScreen();
  12717. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  12718. xCameraPos = l;
  12719. zCameraPos = i1;
  12720. yCameraPos = j1;
  12721. yCameraCurve = k1;
  12722. xCameraCurve = l1;
  12723. }
  12724. public void drawRunOrb(){
  12725. String OD = "./Sprites/Gameframe/Orbs/";
  12726. ORBS[0] = new Sprite(OD + "ORBS 0.png", 27, getOrbFill(100));
  12727. if(energy != 100){
  12728. ORBS[0].drawSprite(193, 95);
  12729. }
  12730. runClicked = anIntArray1045[173] == 1;
  12731. Resting = anIntArray1045[174] == 1;
  12732. ORBS[runHover ? 7 : 1].drawSprite(190, 92);
  12733. ORBS[runClicked ? 11 : 10].drawSprite(193, 95);
  12734. if(!Resting)
  12735. ORBS[runClicked ? 9 : 8].drawSprite(200, 100);
  12736. else
  12737. ORBS[Resting ? 12 : 8].drawSprite(200, 100);
  12738. String currentEnergy = RSInterface.interfaceCache[149].message;
  12739. currentEnergy = currentEnergy.replaceAll("%","");
  12740. smallText.method382(getOrbTextColor(100), 232, currentEnergy, 118, true);
  12741. }
  12742. public void drawPrayer()
  12743. {
  12744. String s = "Gameframe" + File.separator + "Orbs" + File.separator;
  12745. String s1 = RSInterface.interfaceCache[4012].message;
  12746. String s2 = RSInterface.interfaceCache[4013].message;
  12747. int i = Integer.parseInt(s1);
  12748. int j = Integer.parseInt(s2);
  12749. int k = (int)(((double)i / (double)j) * 100D);
  12750. ORBS[0] = new Sprite((new StringBuilder()).append(s).append("ORBS 0.png").toString(), 27, getOrbFill(k));
  12751. ORBS[1].drawSprite(190, 53);
  12752. ORBS[4].drawSprite(193, 56);
  12753. ORBS[0].drawSprite(194, 56);
  12754. ORBS[6].drawSprite(197, 60);
  12755. smallText.method382(getOrbTextColor(k), 234, (new StringBuilder()).append("").append(i).toString(), 79, true);
  12756. }
  12757.  
  12758. public int getOrbFill(int statusInt){
  12759. if(statusInt <= Integer.MAX_VALUE && statusInt >= 97)
  12760. return 0;
  12761. else if(statusInt <= 96 && statusInt >= 93)
  12762. return 1;
  12763. else if(statusInt <= 92 && statusInt >= 89)
  12764. return 2;
  12765. else if(statusInt <= 88 && statusInt >= 85)
  12766. return 3;
  12767. else if(statusInt <= 84 && statusInt >= 81)
  12768. return 4;
  12769. else if(statusInt <= 80 && statusInt >= 77)
  12770. return 5;
  12771. else if(statusInt <= 76 && statusInt >= 73)
  12772. return 6;
  12773. else if(statusInt <= 72 && statusInt >= 69)
  12774. return 7;
  12775. else if(statusInt <= 68 && statusInt >= 65)
  12776. return 8;
  12777. else if(statusInt <= 64 && statusInt >= 61)
  12778. return 9;
  12779. else if(statusInt <= 60 && statusInt >= 57)
  12780. return 10;
  12781. else if(statusInt <= 56 && statusInt >= 53)
  12782. return 11;
  12783. else if(statusInt <= 52 && statusInt >= 49)
  12784. return 12;
  12785. else if(statusInt <= 48 && statusInt >= 45)
  12786. return 13;
  12787. else if(statusInt <= 44 && statusInt >= 41)
  12788. return 14;
  12789. else if(statusInt <= 40 && statusInt >= 37)
  12790. return 15;
  12791. else if(statusInt <= 36 && statusInt >= 33)
  12792. return 16;
  12793. else if(statusInt <= 32 && statusInt >= 29)
  12794. return 17;
  12795. else if(statusInt <= 28 && statusInt >= 25)
  12796. return 18;
  12797. else if(statusInt <= 24 && statusInt >= 21)
  12798. return 19;
  12799. else if(statusInt <= 20 && statusInt >= 17)
  12800. return 20;
  12801. else if(statusInt <= 16 && statusInt >= 13)
  12802. return 21;
  12803. else if(statusInt <= 12 && statusInt >= 9)
  12804. return 22;
  12805. else if(statusInt <= 8 && statusInt >= 7)
  12806. return 23;
  12807. else if(statusInt <= 6 && statusInt >= 5)
  12808. return 24;
  12809. else if(statusInt <= 4 && statusInt >= 3)
  12810. return 25;
  12811. else if(statusInt <= 2 && statusInt >= 1)
  12812. return 26;
  12813. else if(statusInt <= 0)
  12814. return 27;
  12815. return 0;
  12816. }
  12817.  
  12818. public void drawHP() {
  12819. int health;
  12820. String OrbDirectory = "Gameframe" + File.separator + "Orbs" + File.separator;
  12821. String cHP = RSInterface.interfaceCache[4016].message;
  12822. cHP = cHP.replaceAll("%","");
  12823. int currentHP = Integer.parseInt(cHP);
  12824. String mHP = RSInterface.interfaceCache[4017].message;
  12825. mHP = mHP.replaceAll("%","");
  12826. int maxHP2 = Integer.parseInt(mHP);
  12827. health = (int)(((double)currentHP / (double)maxHP2) * 100D);
  12828. ORBS[0] = new Sprite(OrbDirectory+"ORBS 0.png", 27, getOrbFill(health));
  12829. ORBS[1].drawSprite(174, 14);
  12830.  
  12831. ORBS[2].drawSprite(177, 17);
  12832. ORBS[0].drawSprite(177, 17);
  12833. if(health <= 20){
  12834. if(loopCycle % 20 < 10){
  12835. ORBS[3].drawSprite(183, 25);
  12836. }
  12837. } else {
  12838. ORBS[3].drawSprite(183, 25);
  12839. }
  12840. int Y = 40;
  12841. smallText.method382(getOrbTextColor(health), 218, currentHP + "", Y, true);
  12842. }
  12843.  
  12844.  
  12845. public void clearTopInterfaces() {
  12846. stream.createFrame(130);
  12847. if (invOverlayInterfaceID != -1) {
  12848. invOverlayInterfaceID = -1;
  12849. needDrawTabArea = true;
  12850. aBoolean1149 = false;
  12851. tabAreaAltered = true;
  12852. }
  12853. if (backDialogID != -1) {
  12854. backDialogID = -1;
  12855. inputTaken = true;
  12856. aBoolean1149 = false;
  12857. }
  12858. openInterfaceID = -1;
  12859. fullscreenInterfaceID = -1;
  12860. }
  12861.  
  12862. public client() {
  12863. fullscreenInterfaceID = -1;
  12864. chatRights = new int[500];
  12865. chatTypeView = 0;
  12866. clanChatMode = 0;
  12867. cButtonHPos = -1;
  12868. cButtonHCPos = -1;
  12869. cButtonCPos = 0;
  12870. server = "127.0.0.1";
  12871. crownImages = new Sprite[8];
  12872. anIntArrayArray825 = new int[104][104];
  12873. friendsNodeIDs = new int[200];
  12874. groundArray = new NodeList[4][104][104];
  12875. aBoolean831 = false;
  12876. aStream_834 = new Stream(new byte[5000]);
  12877. npcArray = new NPC[16384];
  12878. npcIndices = new int[16384];
  12879. anIntArray840 = new int[1000];
  12880. aStream_847 = Stream.create();
  12881. aBoolean848 = true;
  12882. openInterfaceID = -1;
  12883. currentExp = new int[Skills.skillsCount];
  12884. aBoolean872 = false;
  12885. anIntArray873 = new int[5];
  12886. anInt874 = -1;
  12887. aBooleanArray876 = new boolean[5];
  12888. drawFlames = false;
  12889. reportAbuseInput = "";
  12890. unknownInt10 = -1;
  12891. menuOpen = false;
  12892. inputString = "";
  12893. maxPlayers = 2048;
  12894. myPlayerIndex = 2047;
  12895. playerArray = new Player[maxPlayers];
  12896. playerIndices = new int[maxPlayers];
  12897. anIntArray894 = new int[maxPlayers];
  12898. aStreamArray895s = new Stream[maxPlayers];
  12899. anInt897 = 1;
  12900. anIntArrayArray901 = new int[104][104];
  12901. anInt902 = 0x766654;
  12902. aByteArray912 = new byte[16384];
  12903. currentStats = new int[Skills.skillsCount];
  12904. ignoreListAsLongs = new long[100];
  12905. loadingError = false;
  12906. anInt927 = 0x332d25;
  12907. anIntArray928 = new int[5];
  12908. anIntArrayArray929 = new int[104][104];
  12909. chatTypes = new int[500];
  12910. chatNames = new String[500];
  12911. chatMessages = new String[500];
  12912. chatButtons = new Sprite[4];
  12913. sideIcons = new Sprite[15];
  12914. redStones = new Sprite[5];
  12915. aBoolean954 = true;
  12916. friendsListAsLongs = new long[200];
  12917. currentSong = -1;
  12918. drawingFlames = false;
  12919. spriteDrawX = -1;
  12920. spriteDrawY = -1;
  12921. anIntArray968 = new int[33];
  12922. anIntArray969 = new int[256];
  12923. decompressors = new Decompressor[5];
  12924. variousSettings = new int[2000];
  12925. aBoolean972 = false;
  12926. anInt975 = 50;
  12927. anIntArray976 = new int[anInt975];
  12928. anIntArray977 = new int[anInt975];
  12929. anIntArray978 = new int[anInt975];
  12930. anIntArray979 = new int[anInt975];
  12931. anIntArray980 = new int[anInt975];
  12932. anIntArray981 = new int[anInt975];
  12933. anIntArray982 = new int[anInt975];
  12934. aStringArray983 = new String[anInt975];
  12935. anInt985 = -1;
  12936. hitMarks = new Sprite[20];
  12937. anIntArray990 = new int[5];
  12938. aBoolean994 = false;
  12939. anInt1002 = 0x23201b;
  12940. amountOrNameInput = "";
  12941. aClass19_1013 = new NodeList();
  12942. aBoolean1017 = false;
  12943. anInt1018 = -1;
  12944. anIntArray1030 = new int[5];
  12945. aBoolean1031 = false;
  12946. mapFunctions = new Sprite[100];
  12947. dialogID = -1;
  12948. maxStats = new int[Skills.skillsCount];
  12949. anIntArray1045 = new int[2000];
  12950. aBoolean1047 = true;
  12951. anIntArray1052 = new int[151];
  12952. anInt1054 = -1;
  12953. aClass19_1056 = new NodeList();
  12954. anIntArray1057 = new int[33];
  12955. aClass9_1059 = new RSInterface();
  12956. mapScenes = new Background[100];
  12957. barFillColor = 0x4d4233;
  12958. anIntArray1065 = new int[7];
  12959. anIntArray1072 = new int[1000];
  12960. anIntArray1073 = new int[1000];
  12961. aBoolean1080 = false;
  12962. friendsList = new String[200];
  12963. inStream = Stream.create();
  12964. expectedCRCs = new int[9];
  12965. menuActionCmd2 = new int[500];
  12966. menuActionCmd3 = new int[500];
  12967. menuActionID = new int[500];
  12968. menuActionCmd1 = new int[500];
  12969. headIcons = new Sprite[20];
  12970. skullIcons = new Sprite[20];
  12971. headIconsHint = new Sprite[20];
  12972. tabAreaAltered = false;
  12973. aString1121 = "";
  12974. atPlayerActions = new String[5];
  12975. atPlayerArray = new boolean[5];
  12976. anIntArrayArrayArray1129 = new int[4][13][13];
  12977. anInt1132 = 2;
  12978. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  12979. aBoolean1141 = false;
  12980. aBoolean1149 = false;
  12981. crosses = new Sprite[8];
  12982. musicEnabled = true;
  12983. needDrawTabArea = false;
  12984. loggedIn = false;
  12985. canMute = false;
  12986. aBoolean1159 = false;
  12987. aBoolean1160 = false;
  12988. anInt1171 = 1;
  12989. myUsername = "";
  12990. myPassword = "";
  12991. genericLoadingError = false;
  12992. reportAbuseInterfaceID = -1;
  12993. aClass19_1179 = new NodeList();
  12994. anInt1184 = 128;
  12995. invOverlayInterfaceID = -1;
  12996. stream = Stream.create();
  12997. menuActionName = new String[500];
  12998. anIntArray1203 = new int[5];
  12999. anIntArray1207 = new int[50];
  13000. anInt1210 = 2;
  13001. anInt1211 = 78;
  13002. promptInput = "";
  13003. modIcons = new Sprite[7];
  13004. tabID = 3;
  13005. inputTaken = false;
  13006. songChanging = true;
  13007. anIntArray1229 = new int[151];
  13008. aClass11Array1230 = new Class11[4];
  13009. aBoolean1233 = false;
  13010. anIntArray1240 = new int[100];
  13011. anIntArray1241 = new int[50];
  13012. aBoolean1242 = false;
  13013. anIntArray1250 = new int[50];
  13014. rsAlreadyLoaded = false;
  13015. welcomeScreenRaised = false;
  13016. messagePromptRaised = false;
  13017. loginMessage1 = "";
  13018. loginMessage2 = "";
  13019. backDialogID = -1;
  13020. anInt1279 = 2;
  13021. bigX = new int[4000];
  13022. bigY = new int[4000];
  13023. anInt1289 = -1;
  13024. }
  13025.  
  13026. public int rights;
  13027. public String name;
  13028. public String message;
  13029. public String clanname;
  13030. private final int[] chatRights;
  13031. public int chatTypeView;
  13032. public int clanChatMode;
  13033. public int duelMode;
  13034. /* Declare custom sprites */
  13035. private Sprite worldMapIcon;
  13036. private Sprite logIcon;
  13037. private Sprite logIconH;
  13038. private Sprite logIconC;
  13039. private Sprite[] ORBS = new Sprite[16];
  13040. private Sprite HPBarFull;
  13041. private Sprite HPBarEmpty;
  13042. private Sprite chatArea;
  13043. public RSFont newSmallFont, newRegularFont, newBoldFont, newFancyFont;
  13044. public FontSystem newSmallText, regularText, boldText, fancyText;
  13045. public Sprite[] chatImages = new Sprite[2];
  13046. public Sprite[] crownImages;
  13047. private Sprite[] chatButtons;
  13048. private Sprite tabArea;
  13049. private Sprite mapArea;
  13050. private Sprite emptyOrb;
  13051. private Sprite hoverOrb;
  13052. private Sprite hoverorbrun;
  13053. private Sprite hoverorbrun2;
  13054. private Sprite runClick;
  13055. private Sprite runorb;
  13056. private Sprite hitPointsFill;
  13057. private Sprite prayerFill;
  13058. public boolean HPBarToggle = true;
  13059. public boolean hpHead = true;
  13060.  
  13061. /**/
  13062. private RSImageProducer leftFrame;
  13063. private RSImageProducer topFrame;
  13064. private RSImageProducer rightFrame;
  13065. private int ignoreCount;
  13066. private long aLong824;
  13067. private int[][] anIntArrayArray825;
  13068. private int[] friendsNodeIDs;
  13069. private NodeList[][][] groundArray;
  13070. private int[] anIntArray828;
  13071. private int[] anIntArray829;
  13072. private volatile boolean aBoolean831;
  13073. private Socket aSocket832;
  13074. private int loginScreenState;
  13075. private Stream aStream_834;
  13076. private NPC[] npcArray;
  13077. private int npcCount;
  13078. private int[] npcIndices;
  13079. private int anInt839;
  13080. private int[] anIntArray840;
  13081. private int anInt841;
  13082. private int anInt842;
  13083. private int anInt843;
  13084. private String aString844;
  13085. private int privateChatMode;
  13086. private Stream aStream_847;
  13087. private boolean aBoolean848;
  13088. private static int anInt849;
  13089. private int[] anIntArray850;
  13090. private int[] anIntArray851;
  13091. private int[] anIntArray852;
  13092. private int[] anIntArray853;
  13093. private static int anInt854;
  13094. private int anInt855;
  13095. private int openInterfaceID;
  13096. private int xCameraPos;
  13097. private int zCameraPos;
  13098. private int yCameraPos;
  13099. private int yCameraCurve;
  13100. private int xCameraCurve;
  13101. private int myPrivilege;
  13102. private final int[] currentExp;
  13103. private Sprite[] redStones;
  13104. private Sprite mapFlag;
  13105. private Sprite mapMarker;
  13106. private boolean aBoolean872;
  13107. private final int[] anIntArray873;
  13108. private int anInt874;
  13109. private final boolean[] aBooleanArray876;
  13110. private int weight;
  13111. private MouseDetection mouseDetection;
  13112. private volatile boolean drawFlames;
  13113. private String reportAbuseInput;
  13114. private int unknownInt10;
  13115. private boolean menuOpen;
  13116. private int anInt886;
  13117. private String inputString;
  13118. private final int maxPlayers;
  13119. private final int myPlayerIndex;
  13120. private Player[] playerArray;
  13121. private int playerCount;
  13122. private int[] playerIndices;
  13123. private int anInt893;
  13124. private int[] anIntArray894;
  13125. private Stream[] aStreamArray895s;
  13126. private int anInt896;
  13127. private int anInt897;
  13128. private int friendsCount;
  13129. private int anInt900;
  13130. private int[][] anIntArrayArray901;
  13131. private final int anInt902;
  13132. private byte[] aByteArray912;
  13133. private int anInt913;
  13134. private int crossX;
  13135. private int crossY;
  13136. private int crossIndex;
  13137. private int crossType;
  13138. private int plane;
  13139. private final int[] currentStats;
  13140. private static int anInt924;
  13141. private final long[] ignoreListAsLongs;
  13142. private boolean loadingError;
  13143. private final int anInt927;
  13144. private final int[] anIntArray928;
  13145. private int[][] anIntArrayArray929;
  13146. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  13147. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  13148. private int anInt933;
  13149. private int anInt934;
  13150. private int anInt935;
  13151. private int anInt936;
  13152. private int anInt937;
  13153. private int anInt938;
  13154. private static int anInt940;
  13155. private final int[] chatTypes;
  13156. private final String[] chatNames;
  13157. private final String[] chatMessages;
  13158. private int anInt945;
  13159. private WorldController worldController;
  13160. private Sprite[] sideIcons;
  13161. private boolean logH = false;
  13162. private boolean logC = false;
  13163. private int menuScreenArea;
  13164. private int menuOffsetX;
  13165. private int menuOffsetY;
  13166. private int menuWidth;
  13167. private int menuHeight;
  13168. private long aLong953;
  13169. private boolean aBoolean954;
  13170. private long[] friendsListAsLongs;
  13171. private String[] clanList = new String[100];
  13172. private int currentSong;
  13173. private static int nodeID = 10;
  13174. static int portOff;
  13175. static boolean clientData;
  13176. private static boolean isMembers = true;
  13177. private static boolean lowMem;
  13178. private volatile boolean drawingFlames;
  13179. private int spriteDrawX;
  13180. private int spriteDrawY;
  13181. private final int[] anIntArray965 = {
  13182. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  13183. };
  13184. private Background aBackground_966;
  13185. private Background aBackground_967;
  13186. private final int[] anIntArray968;
  13187. private final int[] anIntArray969;
  13188. final Decompressor[] decompressors;
  13189. public int variousSettings[];
  13190. private boolean aBoolean972;
  13191. private final int anInt975;
  13192. private final int[] anIntArray976;
  13193. private final int[] anIntArray977;
  13194. private final int[] anIntArray978;
  13195. private final int[] anIntArray979;
  13196. private final int[] anIntArray980;
  13197. private final int[] anIntArray981;
  13198. private final int[] anIntArray982;
  13199. private final String[] aStringArray983;
  13200. private int anInt984;
  13201. private int anInt985;
  13202. private static int anInt986;
  13203. private Sprite[] hitMarks;
  13204. private int anInt988;
  13205. private int anInt989;
  13206. private final int[] anIntArray990;
  13207. private static boolean aBoolean993;
  13208. private final boolean aBoolean994;
  13209. private int anInt995;
  13210. private int anInt996;
  13211. private int anInt997;
  13212. private int anInt998;
  13213. private int anInt999;
  13214. private ISAACRandomGen encryption;
  13215. private Sprite mapEdge;
  13216. private Sprite multiOverlay;
  13217. private final int anInt1002;
  13218. static final int[][] anIntArrayArray1003 = {
  13219. {
  13220. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  13221. 2983, 54193
  13222. }, {
  13223. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  13224. 56621, 4783, 1341, 16578, 35003, 25239
  13225. }, {
  13226. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  13227. 10153, 56621, 4783, 1341, 16578, 35003
  13228. }, {
  13229. 4626, 11146, 6439, 12, 4758, 10270
  13230. }, {
  13231. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  13232. }
  13233. };
  13234. private String amountOrNameInput;
  13235. private static int anInt1005;
  13236. private int daysSinceLastLogin;
  13237. private int pktSize;
  13238. private int pktType;
  13239. private int anInt1009;
  13240. private int anInt1010;
  13241. private int anInt1011;
  13242. private NodeList aClass19_1013;
  13243. private int anInt1014;
  13244. private int anInt1015;
  13245. private int anInt1016;
  13246. private boolean aBoolean1017;
  13247. private int anInt1018;
  13248. private static final int[] anIntArray1019;
  13249. private int anInt1021;
  13250. private int anInt1022;
  13251. private int loadingStage;
  13252. private Sprite scrollBar1;
  13253. private Sprite scrollBar2;
  13254. private int anInt1026;
  13255. private Background backBase1;
  13256. private Background backBase2;
  13257. private Background backHmid1;
  13258. private final int[] anIntArray1030;
  13259. private boolean aBoolean1031;
  13260. private Sprite[] mapFunctions;
  13261. private int baseX;
  13262. private int baseY;
  13263. private int anInt1036;
  13264. private int anInt1037;
  13265. private int loginFailures;
  13266. private int anInt1039;
  13267. private int anInt1040;
  13268. private int anInt1041;
  13269. private int dialogID;
  13270. private final int[] maxStats;
  13271. private final int[] anIntArray1045;
  13272. private int anInt1046;
  13273. private boolean aBoolean1047;
  13274. private int anInt1048;
  13275. private String aString1049;
  13276. private static int anInt1051;
  13277. private final int[] anIntArray1052;
  13278. private StreamLoader titleStreamLoader;
  13279. private int anInt1054;
  13280. private int anInt1055;
  13281. private NodeList aClass19_1056;
  13282. private final int[] anIntArray1057;
  13283. public final RSInterface aClass9_1059;
  13284. private Background[] mapScenes;
  13285. private static int anInt1061;
  13286. private int anInt1062;
  13287. private final int barFillColor;
  13288. private int friendsListAction;
  13289. private final int[] anIntArray1065;
  13290. private int mouseInvInterfaceIndex;
  13291. private int lastActiveInvInterface;
  13292. private OnDemandFetcher onDemandFetcher;
  13293. private int anInt1069;
  13294. private int anInt1070;
  13295. private int anInt1071;
  13296. private int[] anIntArray1072;
  13297. private int[] anIntArray1073;
  13298. private Sprite mapDotItem;
  13299. private Sprite mapDotNPC;
  13300. private Sprite mapDotPlayer;
  13301. private Sprite mapDotFriend;
  13302. private Sprite mapDotTeam;
  13303. private Sprite mapDotClan;
  13304. private int anInt1079;
  13305. private boolean aBoolean1080;
  13306. private String[] friendsList;
  13307. private Stream inStream;
  13308. private int anInt1084;
  13309. private int anInt1085;
  13310. private int activeInterfaceType;
  13311. private int anInt1087;
  13312. private int anInt1088;
  13313. public static int anInt1089;
  13314. private final int[] expectedCRCs;
  13315. private int[] menuActionCmd2;
  13316. private int[] menuActionCmd3;
  13317. private int[] menuActionID;
  13318. private int[] menuActionCmd1;
  13319. private Sprite[] headIcons;
  13320. private Sprite[] skullIcons;
  13321. private Sprite[] headIconsHint;
  13322. private static int anInt1097;
  13323. private int anInt1098;
  13324. private int anInt1099;
  13325. private int anInt1100;
  13326. private int anInt1101;
  13327. private int anInt1102;
  13328. private static boolean tabAreaAltered;
  13329. private int anInt1104;
  13330. private RSImageProducer aRSImageProducer_1107;
  13331. private RSImageProducer aRSImageProducer_1108;
  13332. private RSImageProducer aRSImageProducer_1109;
  13333. private RSImageProducer aRSImageProducer_1110;
  13334. private RSImageProducer aRSImageProducer_1111;
  13335. private RSImageProducer aRSImageProducer_1112;
  13336. private RSImageProducer aRSImageProducer_1113;
  13337. private RSImageProducer aRSImageProducer_1114;
  13338. private RSImageProducer aRSImageProducer_1115;
  13339. private static int anInt1117;
  13340. private int membersInt;
  13341. private String aString1121;
  13342. private Sprite compass;
  13343. private RSImageProducer aRSImageProducer_1123;
  13344. private RSImageProducer aRSImageProducer_1124;
  13345. private RSImageProducer aRSImageProducer_1125;
  13346. public static Player myPlayer;
  13347. private final String[] atPlayerActions;
  13348. private final boolean[] atPlayerArray;
  13349. private final int[][][] anIntArrayArrayArray1129;
  13350. private final int[] tabInterfaceIDs = {
  13351. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  13352. -1, -1, -1, -1, -1
  13353. };
  13354. private int anInt1131;
  13355. private int anInt1132;
  13356. private int menuActionRow;
  13357. private static int anInt1134;
  13358. private int spellSelected;
  13359. private int anInt1137;
  13360. private int spellUsableOn;
  13361. private String spellTooltip;
  13362. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  13363. private boolean aBoolean1141;
  13364. private static int anInt1142;
  13365. private int energy;
  13366. private boolean aBoolean1149;
  13367. private Sprite[] crosses;
  13368. private boolean musicEnabled;
  13369. private Background[] aBackgroundArray1152s;
  13370. private static boolean needDrawTabArea;
  13371. private int unreadMessages;
  13372. private static int anInt1155;
  13373. private static boolean fpsOn;
  13374. public boolean loggedIn;
  13375. public boolean runClicked = false;
  13376. public boolean Resting = false;
  13377. public boolean runHover;
  13378. private boolean canMute;
  13379. private boolean aBoolean1159;
  13380. private boolean aBoolean1160;
  13381. static int loopCycle;
  13382. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  13383. private RSImageProducer aRSImageProducer_1163;
  13384. private RSImageProducer mapEdgeIP;
  13385. private RSImageProducer aRSImageProducer_1164;
  13386. private RSImageProducer aRSImageProducer_1165;
  13387. private RSImageProducer aRSImageProducer_1166;
  13388. private int daysSinceRecovChange;
  13389. private RSSocket socketStream;
  13390. private int anInt1169;
  13391. private int minimapInt3;
  13392. private int anInt1171;
  13393. private long aLong1172;
  13394. private String myUsername;
  13395. private String myPassword;
  13396. private static int anInt1175;
  13397. private boolean genericLoadingError;
  13398. private final int[] anIntArray1177 = {
  13399. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  13400. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  13401. 2, 2, 3
  13402. };
  13403. private int reportAbuseInterfaceID;
  13404. private NodeList aClass19_1179;
  13405. private int[] anIntArray1180;
  13406. private int[] anIntArray1181;
  13407. private int[] anIntArray1182;
  13408. private byte[][] aByteArrayArray1183;
  13409. private int anInt1184;
  13410. private int minimapInt1;
  13411. private int anInt1186;
  13412. private int anInt1187;
  13413. private static int anInt1188;
  13414. private int invOverlayInterfaceID;
  13415. private int[] anIntArray1190;
  13416. private int[] anIntArray1191;
  13417. private Stream stream;
  13418. private int anInt1193;
  13419. private int splitPrivateChat;
  13420. private Background mapBack;
  13421. private String[] menuActionName;
  13422. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  13423. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  13424. private final int[] anIntArray1203;
  13425. static final int[] anIntArray1204 = {
  13426. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  13427. 58654, 5027, 1457, 16565, 34991, 25486
  13428. };
  13429. private static boolean flagged;
  13430. private final int[] anIntArray1207;
  13431. private int anInt1208;
  13432. private int minimapInt2;
  13433. private int anInt1210;
  13434. private int anInt1211;
  13435. private String promptInput;
  13436. private int anInt1213;
  13437. private int[][][] intGroundArray;
  13438. private long aLong1215;
  13439. private int loginScreenCursorPos;
  13440. private final Sprite[] modIcons;
  13441. private long aLong1220;
  13442. private static int tabID;
  13443. private int anInt1222;
  13444. public static boolean inputTaken;
  13445. private int inputDialogState;
  13446. private static int anInt1226;
  13447. private int nextSong;
  13448. private boolean songChanging;
  13449. private final int[] anIntArray1229;
  13450. private Class11[] aClass11Array1230;
  13451. public static int anIntArray1232[];
  13452. private boolean aBoolean1233;
  13453. private int[] anIntArray1234;
  13454. private int[] anIntArray1235;
  13455. private int[] anIntArray1236;
  13456. private int anInt1237;
  13457. private int anInt1238;
  13458. public final int anInt1239 = 100;
  13459. private final int[] anIntArray1240;
  13460. private final int[] anIntArray1241;
  13461. private boolean aBoolean1242;
  13462. private int atInventoryLoopCycle;
  13463. private int atInventoryInterface;
  13464. private int atInventoryIndex;
  13465. private int atInventoryInterfaceType;
  13466. private byte[][] aByteArrayArray1247;
  13467. private int tradeMode;
  13468. private int anInt1249;
  13469. private final int[] anIntArray1250;
  13470. private int anInt1251;
  13471. private final boolean rsAlreadyLoaded;
  13472. private int anInt1253;
  13473. private int anInt1254;
  13474. private boolean welcomeScreenRaised;
  13475. private boolean messagePromptRaised;
  13476. private int anInt1257;
  13477. private byte[][][] byteGroundArray;
  13478. private int prevSong;
  13479. private int destX;
  13480. private int destY;
  13481. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  13482. private int anInt1264;
  13483. private int anInt1265;
  13484. private String loginMessage1;
  13485. private String loginMessage2;
  13486. private int anInt1268;
  13487. private int anInt1269;
  13488. private TextDrawingArea smallText;
  13489. private TextDrawingArea aTextDrawingArea_1271;
  13490. private TextDrawingArea chatTextDrawingArea;
  13491. private int anInt1275;
  13492. private int backDialogID;
  13493. private int anInt1278;
  13494. private int anInt1279;
  13495. private int[] bigX;
  13496. private int[] bigY;
  13497. private int itemSelected;
  13498. private int anInt1283;
  13499. private int anInt1284;
  13500. private int anInt1285;
  13501. private String selectedItemName;
  13502. private int publicChatMode;
  13503. private static int anInt1288;
  13504.  
  13505. private int anInt1289;
  13506. public static int anInt1290;
  13507. public static String server = "127.0.0.1";
  13508. public int drawCount;
  13509. public int fullscreenInterfaceID;
  13510. public int anInt1044;//377
  13511. public int anInt1129;//377
  13512. public int anInt1315;//377
  13513. public int anInt1500;//377
  13514. public int anInt1501;//377
  13515. public int[] fullScreenTextureArray;
  13516. public void resetAllImageProducers() {
  13517. if (super.fullGameScreen != null) {
  13518. return;
  13519. }
  13520. aRSImageProducer_1166 = null;
  13521. aRSImageProducer_1164 = null;
  13522. aRSImageProducer_1163 = null;
  13523. aRSImageProducer_1165 = null;
  13524. aRSImageProducer_1123 = null;
  13525. aRSImageProducer_1124 = null;
  13526. aRSImageProducer_1125 = null;
  13527. aRSImageProducer_1107 = null;
  13528. aRSImageProducer_1108 = null;
  13529. aRSImageProducer_1109 = null;
  13530. aRSImageProducer_1110 = null;
  13531. aRSImageProducer_1111 = null;
  13532. aRSImageProducer_1112 = null;
  13533. aRSImageProducer_1113 = null;
  13534. aRSImageProducer_1114 = null;
  13535. aRSImageProducer_1115 = null;
  13536. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  13537. welcomeScreenRaised = true;
  13538. }
  13539.  
  13540.  
  13541. public void launchURL(String url) {
  13542. String osName = System.getProperty("os.name");
  13543. try {
  13544. if (osName.startsWith("Mac OS")) {
  13545. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  13546. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
  13547. openURL.invoke(null, new Object[] {url});
  13548. } else if (osName.startsWith("Windows"))
  13549. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  13550. else { //assume Unix or Linux
  13551. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  13552. String browser = null;
  13553. for (int count = 0; count < browsers.length && browser == null; count++)
  13554. if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
  13555. browser = browsers[count];
  13556. if (browser == null) {
  13557. throw new Exception("Could not find web browser");
  13558. } else
  13559. Runtime.getRuntime().exec(new String[] {browser, url});
  13560. }
  13561. } catch (Exception e) {
  13562. pushMessage("Failed to open URL.", 0, "");
  13563. }
  13564. }
  13565.  
  13566. static {
  13567. anIntArray1019 = new int[99];
  13568. int i = 0;
  13569. for(int j = 0; j < 99; j++) {
  13570. int l = j + 1;
  13571. int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  13572. i += i1;
  13573. anIntArray1019[j] = i / 4;
  13574. }
  13575. anIntArray1232 = new int[32];
  13576. i = 2;
  13577. for(int k = 0; k < 32; k++) {
  13578. anIntArray1232[k] = i - 1;
  13579. i += i;
  13580. }
  13581. }
  13582. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement