Advertisement
Guest User

Untitled

a guest
Feb 7th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 423.49 KB | None | 0 0
  1. // Jad home page: http://www.kpdus.com/jad.html
  2. // Decompiler options: packimports(3)
  3.  
  4. import java.applet.AppletContext;
  5. import java.awt.*;
  6. import java.io.*;
  7. import java.math.BigInteger;
  8. import java.net.*;
  9. import java.util.zip.CRC32;
  10. import java.lang.reflect.Method;
  11. import sign.signlink;
  12. import javax.swing.*;
  13. public class client extends RSApplet {
  14.  
  15. public static client instance;
  16.  
  17. private boolean counterOn = false;
  18. private boolean xpLock = false;
  19.  
  20. public void maps() {
  21. for(int MapIndex = 0; MapIndex < 3536; MapIndex++) {
  22. byte[] abyte0 = GetMap(MapIndex);
  23. if(abyte0 != null && abyte0.length > 0) {
  24. decompressors[4].method234(abyte0.length, abyte0, MapIndex);
  25. }
  26. }
  27. }
  28.  
  29. public byte[] GetMap(int Index) {
  30. try {
  31. File Map = new File("./Maps/"+Index+".gz");
  32. byte[] aByte = new byte[(int)Map.length()];
  33. FileInputStream Fis = new FileInputStream(Map);
  34. Fis.read(aByte);
  35. System.out.println(""+Index+" aByte = ["+aByte+"]!");
  36. Fis.close();
  37. return aByte;
  38. } catch(Exception e) {
  39. return null;
  40. }
  41. }
  42.  
  43. private void processXPCounterClick() {
  44. int x = super.mouseX;
  45. int y = super.mouseY;
  46. if (x >= 520 && x <= 554 && y >= 47 && y <= 81) {
  47. menuActionName[3] = counterOn ? "Off" : "On";
  48. menuActionID[3] = 474;
  49. menuActionName[2] = "Reset";
  50. menuActionID[2] = 475;
  51. menuActionName[1] = xpLock ? "Unlock XP" : "Lock XP";
  52. menuActionID[1] = 476;
  53. menuActionRow = 4;
  54. }
  55. }
  56.  
  57. private int expAdded;
  58. private int xpCounter;
  59. private int yCoordinate = 72;
  60. private void drawCounterOnScreen() {
  61. int x = 520;
  62. int y = 47;
  63. counter[2].drawSprite(x-100, y+8);
  64. int i = aTextDrawingArea_1271.getTextWidth(Integer.toString(xpCounter));
  65. aTextDrawingArea_1271.drawText(0xffffff, "XP:", y+21, x-88);
  66. aTextDrawingArea_1271.drawText(0xffffff, Integer.toString(xpCounter), y+21, x-12-i);
  67. if (expAdded != 0) {
  68. if (yCoordinate < 125) {
  69. if (yCoordinate < 100) {
  70. yCoordinate += 2;
  71. } else {
  72. yCoordinate += 1;
  73. }
  74. smallText.drawText(0xff9933, Integer.toString(expAdded)+"xp", yCoordinate + 20, 470);
  75. counter[3].drawSprite(423, yCoordinate);
  76. }
  77. if (yCoordinate >= 125) {
  78. yCoordinate = 72;
  79. expAdded = 0;
  80. }
  81. }
  82. }
  83.  
  84. Sprite[] counter;
  85. private void drawXPCounter() {
  86. int x = 1;
  87. int y = 47;
  88. int x1 = super.mouseX;
  89. int y1 = super.mouseY;
  90. counter[(counterOn || (x1 >= 520 && x1 <= 554 && y1 >= 47 && y1 <= 81) ? 1 : 0)].drawSprite(x, y);
  91. }
  92.  
  93. public int interfaceButtonAction = 0;
  94.  
  95. void sendPacket(int packet) {
  96. if (packet == 103) {
  97. stream.createFrame(103);
  98. stream.writeWordBigEndian(inputString.length() - 1);
  99. stream.writeString(inputString.substring(2));
  100. inputString = "";
  101. promptInput = "";
  102. interfaceButtonAction = 0;
  103. }
  104. }
  105.  
  106. public final String titleColor(final int i, int type) {
  107. String titleChatbox = "", titleRightclick = "";
  108. switch (i) {
  109.  
  110. case 0: //blue
  111. titleChatbox = "255";
  112. titleRightclick = "blu";
  113. break;
  114.  
  115. case 1: //purple
  116. titleChatbox = "11158698";
  117. titleRightclick = "put";
  118. break;
  119.  
  120. case 2: //red
  121. titleChatbox = "12656646";
  122. titleRightclick = "red";
  123. break;
  124.  
  125. case 3: //green
  126. titleChatbox = "26112";
  127. titleRightclick = "gre";
  128. break;
  129. case 4: //yel
  130. titleChatbox = "16776960";
  131. titleRightclick = "yel";
  132. break;
  133. case 5: //orange
  134. titleChatbox = "16495872";
  135. titleRightclick = "ort";
  136. break;
  137.  
  138. }
  139. if(type == 0)
  140. return titleChatbox;
  141. else
  142. return titleRightclick;
  143. }
  144.  
  145.  
  146.  
  147. public int MapX, MapY;
  148. public static int spellID = 0;
  149. public static boolean newDamage = false;
  150.  
  151. private static String intToKOrMilLongName(int i) {
  152. String s = String.valueOf(i);
  153. for(int k = s.length() - 3; k > 0; k -= 3)
  154. s = s.substring(0, k) + "," + s.substring(k);
  155.  
  156. //if(j != 0)
  157. // aBoolean1224 = !aBoolean1224;
  158. if(s.length() > 8)
  159. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  160. else
  161. if(s.length() > 4)
  162. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  163. return " " + s;
  164. }
  165. public final String methodR(/*int i,*/ int j)
  166. {
  167. //if(i <= 0)
  168. // pktType = inStream.readUnsignedByte();
  169. if(j >= 0 && j < 10000)
  170. return String.valueOf(j);
  171. if(j >= 10000 && j < 10000000)
  172. return j / 1000 + "K";
  173. if(j >= 10000000 && j < 999999999)
  174. return j / 1000000 + "M";
  175. if(j >= 999999999)
  176. return "*";
  177. else
  178. return "?";
  179. }
  180. public void loadExtraSprites() {
  181. for(int k = 1; k <= 17; k++)
  182. ORBS[k] = new Sprite((new StringBuilder()).append("Frame/ORBS ").append(k).append("").toString());
  183. for(int i = 0; i < 4; i++)
  184. counter[i] = new Sprite("Gameframe/XP "+i);
  185. }
  186. public void drawWorldMapButton()
  187. {
  188. worldMapIcon.drawSprite(8, 124);
  189. }
  190. private void rightClickMapArea()
  191. {
  192. if(super.clickMode3 == 1)
  193. {
  194. if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23 && tabInterfaceIDs[7] != -1)
  195. {
  196. menuActionName[1] = "Logout";
  197. menuActionID[1] = 1004;
  198. menuActionRow = 2;
  199. logC = true;
  200. drawMinimap();
  201. }
  202. } else
  203. if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23 && tabInterfaceIDs[7] != -1)
  204. {
  205. menuActionName[1] = "Logout";
  206. menuActionID[1] = 1004;
  207. menuActionRow = 2;
  208. logH = true;
  209. logHover = 1;
  210. drawMinimap();
  211. } else
  212. if(super.mouseX > 713 && super.mouseX < 765 && super.mouseY > 83 && super.mouseY < 118)
  213. {
  214. menuActionName[1] = "Run";
  215. menuActionID[1] = 1051;
  216. menuActionRow = 2;
  217. } else
  218. if (super.mouseX > (pouchToggle ? 440 : 513) && super.mouseX < 545 && super.mouseY > 84 && super.mouseY <117) {
  219. menuActionName[4] = "Toggle money pouch";
  220. menuActionID[4] = 712;
  221. menuActionName[3] = "Withdraw money pouch";
  222. menuActionID[3] = 713;
  223. menuActionName[2] = "Examine money pouch";
  224. menuActionID[2] = 714;
  225. menuActionName[1] = "Price checker";
  226. menuActionID[1] = 715;
  227. menuActionRow = 5;
  228. } else
  229. {
  230. logH = false;
  231. logHover = 0;
  232. drawMinimap();
  233. }
  234. }
  235. private int logHover = 0;
  236.  
  237. public static final byte[] ReadFile(String s) {
  238. try {
  239. byte abyte0[];
  240. File file = new File(s);
  241. int i = (int)file.length();
  242. abyte0 = new byte[i];
  243. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  244. datainputstream.readFully(abyte0, 0, i);
  245. datainputstream.close();
  246. return abyte0;
  247. } catch(Exception e) {
  248. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  249. return null;
  250. }
  251. }
  252.  
  253. public void models() {
  254. for(int ModelIndex = 0; ModelIndex < 29191; ModelIndex++) {
  255. byte[] abyte0 = getModel(ModelIndex);
  256. if(abyte0 != null && abyte0.length > 0) {
  257. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  258. pushMessage("Model added successfully!", 0, "");
  259. }
  260. }
  261. }
  262. public byte[] getModel(int Index) {
  263. try {
  264. File Model = new File("./model/"+Index+".gz");
  265. byte[] aByte = new byte[(int)Model.length()];
  266. FileInputStream fis = new FileInputStream(Model);
  267. fis.read(aByte);
  268. pushMessage("aByte = ["+aByte+"]!", 0, "");
  269. fis.close();
  270. return aByte;
  271. }
  272. catch(Exception e)
  273. {return null;}
  274. }
  275.  
  276. private void stopMidi() {
  277. signlink.midifade = 0;
  278. signlink.midi = "stop";
  279. }
  280. private boolean menuHasAddFriend(int j) {
  281. if(j < 0)
  282. return false;
  283. int k = menuActionID[j];
  284. if(k >= 2000)
  285. k -= 2000;
  286. return k == 337;
  287. }
  288.  
  289. public void drawChannelButtons() {
  290. String text[] = {
  291. "On", "Friends", "Off", "Hide"
  292. };
  293. int disabledColor[] = {
  294. 65280, 0xffff00, 0xff0000, 65535
  295. };
  296. switch (cButtonCPos) {
  297. case 0:
  298. chatButtons[1].drawSprite(5, 144);
  299. break;
  300. case 1:
  301. chatButtons[1].drawSprite(62, 144);
  302. break;
  303. case 2:
  304. chatButtons[1].drawSprite(119, 144);
  305. break;
  306. case 3:
  307. chatButtons[1].drawSprite(176, 144);
  308. break;
  309. case 4:
  310. chatButtons[1].drawSprite(233, 144);
  311. break;
  312. case 5:
  313. chatButtons[1].drawSprite(290, 144);
  314. break;
  315. case 6:
  316. chatButtons[1].drawSprite(347, 144);
  317. break;
  318. }
  319. if (cButtonHPos == cButtonCPos) {
  320. switch (cButtonHPos) {
  321. case 0:
  322. chatButtons[2].drawSprite(5, 144);
  323. break;
  324. case 1:
  325. chatButtons[2].drawSprite(62, 144);
  326. break;
  327. case 2:
  328. chatButtons[2].drawSprite(119, 144);
  329. break;
  330. case 3:
  331. chatButtons[2].drawSprite(176, 144);
  332. break;
  333. case 4:
  334. chatButtons[2].drawSprite(233, 144);
  335. break;
  336. case 5:
  337. chatButtons[2].drawSprite(290, 144);
  338. break;
  339. case 7:
  340. chatButtons[2].drawSprite(347, 144);
  341. break;
  342. case 6:
  343. chatButtons[3].drawSprite(404, 144);
  344. break;
  345. }
  346. } else {
  347. switch (cButtonHPos) {
  348. case 0:
  349. chatButtons[2].drawSprite(5, 144);
  350. break;
  351. case 1:
  352. chatButtons[2].drawSprite(62, 144);
  353. break;
  354. case 2:
  355. chatButtons[2].drawSprite(119, 144);
  356. break;
  357. case 3:
  358. chatButtons[2].drawSprite(176, 144);
  359. break;
  360. case 4:
  361. chatButtons[2].drawSprite(233, 144);
  362. break;
  363. case 5:
  364. chatButtons[2].drawSprite(290, 144);
  365. break;
  366. case 7:
  367. chatButtons[2].drawSprite(347, 144);
  368. break;
  369. case 6:
  370. chatButtons[3].drawSprite(404, 144);
  371. break;
  372. }
  373. }
  374. smallText.method389(true, 425, 0xffffff, "Report Abuse", 158);
  375. smallText.method389(true, 26, 0xffffff, "All", 158);
  376. smallText.method389(true, 76, 0xffffff, "Game", 158);
  377. smallText.method389(true, 131, 0xffffff, "Public", 154);
  378. smallText.method389(true, 184, 0xffffff, "Private", 154);
  379. smallText.method389(true, 249, 0xffffff, "Clan", 154);
  380. smallText.method389(true, 304, 0xffffff, "Trade", 154);
  381. smallText.method389(true, 304, 0xffffff, "Gamble", 154);
  382. smallText.method389(true, 359, 0xffffff, " Duel", 154);
  383. smallText.method382(disabledColor[publicChatMode], 147, text[publicChatMode], 165, true);
  384. smallText.method382(disabledColor[privateChatMode], 203, text[privateChatMode], 165, true);
  385. smallText.method382(disabledColor[clanChatMode], 261, text[clanChatMode], 165, true);
  386. smallText.method382(disabledColor[tradeMode], 318, text[tradeMode], 165, true);
  387. smallText.method382(65280, 374, "On", 165, true);
  388. }
  389.  
  390. /*private void drawChatArea() {
  391. aRSImageProducer_1166.initDrawingArea();
  392. Texture.anIntArray1472 = anIntArray1180;
  393. chatArea.drawSprite(0, 0);
  394. drawChannelButtons();
  395. FontSystem textDrawingArea = regularText;
  396. if(messagePromptRaised) {
  397. //chatTextDrawingArea.drawText(0, aString1121, 60, 259);
  398. //chatTextDrawingArea.drawText(128, promptInput + "*", 80, 259);
  399.  
  400. boldText.drawCenteredString(aString1121, 259, 60, 0, -1);
  401. boldText.drawCenteredString( promptInput + "*", 259, 80, 128, -1);
  402. } else if(inputDialogState == 1) {
  403. //chatTextDrawingArea.drawText(0, "Enter amount:", 60, 259);
  404. //chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  405.  
  406. boldText.drawCenteredString("Enter amount:", 259, 60, 0, -1);
  407. boldText.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
  408. } else if(inputDialogState == 2) {
  409. //chatTextDrawingArea.drawText(0, "Enter name:", 60, 259);
  410. //chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  411.  
  412. boldText.drawCenteredString("Enter name:", 259, 60, 0, -1);
  413. boldText.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
  414. } else if(aString844 != null) {
  415. //chatTextDrawingArea.drawText(0, aString844, 60, 259);
  416. //chatTextDrawingArea.drawText(128, "Click to continue", 80, 259);
  417.  
  418. boldText.drawCenteredString(aString844, 259, 60, 0, -1);
  419. boldText.drawCenteredString("Click to continue", 259, 80, 128, -1);
  420. } else if(backDialogID != -1) {
  421. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  422. } else if(dialogID != -1) {
  423. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  424. } else {
  425. int j77 = -3;
  426. int j = 0;
  427. DrawingArea.setDrawingArea(122, 8, 497, 7);
  428. for(int k = 0; k < 500; k++)
  429. if(chatMessages[k] != null) {
  430. int chatType = chatTypes[k];
  431. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  432. String s1 = chatNames[k];
  433. byte byte0 = 0;
  434. if(s1 != null && s1.startsWith("@cr1@")) {
  435. s1 = s1.substring(5);
  436. byte0 = 1;
  437. } else if(s1 != null && s1.startsWith("@cr2@")) {
  438. s1 = s1.substring(5);
  439. byte0 = 2;
  440. } else if(s1 != null && s1.startsWith("@cr3@")) {
  441. s1 = s1.substring(5);
  442. byte0 = 3;
  443. } else if(s1 != null && s1.startsWith("@cr4@")) {
  444. s1 = s1.substring(5);
  445. byte0 = 4;
  446. } else if(s1 != null && s1.startsWith("@cr5@")) {
  447. s1 = s1.substring(5);
  448. byte0 = 5;
  449. } else if(s1 != null && s1.startsWith("@cr6@")) {
  450. s1 = s1.substring(5);
  451. byte0 = 6;
  452. } else if(s1 != null && s1.startsWith("@cr7@")) {
  453. s1 = s1.substring(5);
  454. byte0 = 7;
  455. }
  456. if(chatType == 0) {
  457. if (chatTypeView == 5 || chatTypeView == 0) {
  458. if(yPos > 0 && yPos < 210)
  459. //textDrawingArea.method389(false, 11, 0, chatMessages[k], yPos);//chat color enabled
  460. newRegularFont.drawBasicString(chatMessages[k], 11, yPos, 0, -1);
  461. j++;
  462. j77++;
  463. }
  464. }
  465. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  466. if (chatTypeView == 1 || chatTypeView == 0) {
  467. if(yPos > 0 && yPos < 210) {
  468. int xPos = 11;
  469. if(byte0 == 1) {
  470. modIcons[0].drawSprite(xPos + 1, yPos - 12);
  471. xPos += 14;
  472. } else if(byte0 == 2) {
  473. modIcons[1].drawSprite(xPos + 1, yPos - 12);
  474. xPos += 14;
  475. } else if(byte0 == 3) {
  476. modIcons[2].drawSprite(xPos + 1, yPos - 12);
  477. xPos += 14;
  478. } else if(byte0 == 4) {
  479. modIcons[3].drawSprite(xPos + 1, yPos - 12);
  480. xPos += 14;
  481. } else if(byte0 == 5) {
  482. modIcons[4].drawSprite(xPos + 1, yPos - 12);
  483. xPos += 14;
  484. } else if(byte0 == 6) {
  485. modIcons[5].drawSprite(xPos + 1, yPos - 12);
  486. xPos += 14;
  487. } else if(byte0 == 7) {
  488. modIcons[6].drawSprite(xPos + 1, yPos - 12);
  489. xPos += 14;
  490. }
  491. //textDrawingArea.method385(0, s1 + ":", yPos, xPos);
  492. //xPos += textDrawingArea.getTextWidth(s1) + 8;
  493. //textDrawingArea.method389(false, xPos, 255, chatMessages[k], yPos);
  494.  
  495. newRegularFont.drawBasicString(s1 + ":", xPos, yPos, 0, -1);
  496. xPos += newRegularFont.getTextWidth(s1) + 8;
  497. newRegularFont.drawBasicString(chatMessages[k], xPos, yPos, 255, -1);
  498. }
  499. j++;
  500. j77++;
  501. }
  502. }
  503. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  504. if (chatTypeView == 2 || chatTypeView == 0) {
  505. if(yPos > 0 && yPos < 210) {
  506. int k1 = 11;
  507. //textDrawingArea.method385(0, "From", yPos, k1);
  508. //k1 += textDrawingArea.getTextWidth("From ");
  509.  
  510. newRegularFont.drawBasicString("From", k1, yPos, 0, -1);
  511. k1 += newRegularFont.getTextWidth("From ");
  512. if(byte0 == 1) {
  513. modIcons[0].drawSprite(k1, yPos - 12);
  514. k1 += 12;
  515. } else if(byte0 == 2) {
  516. modIcons[1].drawSprite(k1, yPos - 12);
  517. k1 += 12;
  518. } else if(byte0 == 3) {
  519. modIcons[2].drawSprite(k1, yPos - 12);
  520. k1 += 12;
  521. } else if(byte0 == 4) {
  522. modIcons[3].drawSprite(k1, yPos - 12);
  523. k1 += 12;
  524. } else if(byte0 == 5) {
  525. modIcons[4].drawSprite(k1, yPos - 12);
  526. k1 += 12;
  527. } else if(byte0 == 6) {
  528. modIcons[5].drawSprite(k1, yPos - 12);
  529. k1 += 12;
  530. } else if(byte0 == 7) {
  531. modIcons[6].drawSprite(k1, yPos - 12);
  532. k1 += 12;
  533.  
  534. }
  535. //textDrawingArea.method385(0, s1 + ":", yPos, k1);
  536. //k1 += textDrawingArea.getTextWidth(s1) + 8;
  537. //textDrawingArea.method385(0x800000, chatMessages[k], yPos, k1);
  538.  
  539. newRegularFont.drawBasicString(s1 + ":", k1, yPos, 0, -1);
  540. k1 += newRegularFont.getTextWidth(s1) + 8;
  541. newRegularFont.drawBasicString(chatMessages[k], k1, yPos, 0x800000, -1);
  542. }
  543. j++;
  544. j77++;
  545. }
  546. }
  547. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  548. if (chatTypeView == 3 || chatTypeView == 0) {
  549. if(yPos > 0 && yPos < 210)
  550. //textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], yPos, 11);
  551. newRegularFont.drawBasicString( s1 + " " + chatMessages[k], 11, yPos, 0x800080, -1);
  552. j++;
  553. j77++;
  554. }
  555. }
  556. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  557. if (chatTypeView == 2 || chatTypeView == 0) {
  558. if(yPos > 0 && yPos < 210)
  559. //textDrawingArea.method385(0x800000, chatMessages[k], yPos, 11);
  560. newRegularFont.drawBasicString(chatMessages[k], 11, yPos, 0x800000, -1);
  561. j++;
  562. j77++;
  563. }
  564. }
  565. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  566. if (chatTypeView == 2 || chatTypeView == 0) {
  567. if(yPos > 0 && yPos < 210) {
  568. //textDrawingArea.method385(0, "To " + s1 + ":", yPos, 11);
  569. //textDrawingArea.method385(0x800000, chatMessages[k], yPos, 15 + textDrawingArea.getTextWidth("To :" + s1));
  570.  
  571. newRegularFont.drawBasicString("To " + s1 + ":", 11, yPos, 0, -1);
  572. newRegularFont.drawBasicString(chatMessages[k], 15 + newRegularFont.getTextWidth("To :" + s1), yPos, 0x800000, -1);
  573. }
  574. j++;
  575. j77++;
  576. }
  577. }
  578. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  579. if (chatTypeView == 3 || chatTypeView == 0) {
  580. if(yPos > 0 && yPos < 210)
  581. //textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  582. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  583. j++;
  584. j77++;
  585. }
  586. if(chatType == 11 && (clanChatMode == 0)) {
  587. if (chatTypeView == 11) {
  588. if(yPos > 0 && yPos < 210)
  589. // textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  590. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  591. j++;
  592. j77++;
  593. }
  594. if(chatType == 12) {
  595. if(yPos > 0 && yPos < 110)
  596. newRegularFont.drawBasicString(chatMessages[k] + " <col=225>" + s1, 11, yPos, 0x7e3200, -1);
  597. //textDrawingArea.method385(0x7e3200, chatMessages[k] + " @blu@" + s1, yPos, 11);
  598. j++;
  599. }
  600. if(chatType == 16) {
  601. int j2 = 40;
  602. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  603. if(chatTypeView == 11 || chatTypeView == 0) {
  604. if(yPos > 3 && yPos < 130)
  605. switch(chatRights[k]) {
  606. case 1:
  607. case 2:
  608. case 3:
  609. case 4:
  610. case 5:
  611. case 6:
  612. case 7:
  613. j2 += clanNameWidth;
  614. modIcons[chatRights[k] - 1].drawSprite(j2 - 18, yPos - 12);
  615. j2 += 14;
  616. break;
  617.  
  618. default:
  619. j2 += clanNameWidth;
  620. break;
  621. }//string int int int int
  622. //newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  623. newRegularFont.drawBasicString("[", 8, yPos, 0, -1);//0, "[", yPos, 8);
  624. newRegularFont.drawBasicString(clanname, 14, yPos, 255, -1);//255, ""+clanname+"", yPos, 14);
  625. newRegularFont.drawBasicString("]", clanNameWidth + 14, yPos, 0, -1);//0, "]", yPos, clanNameWidth + 14);
  626.  
  627. newRegularFont.drawBasicString(chatNames[k]+":", j2-17, yPos, 0, -1);//0, chatNames[k]+":", yPos, j2 - 17); //j2
  628. j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
  629. newRegularFont.drawBasicString(chatMessages[k], j2 - 16, yPos, 0x800000, -1);//0x800000, chatMessages[k], yPos, j2 - 16);//j2
  630. j++;
  631. j77++;
  632. }
  633. }
  634. }
  635. }
  636. }
  637. DrawingArea.defaultDrawingAreaSize();
  638. anInt1211 = j * 14 + 7 + 5;
  639. if(anInt1211 < 111)
  640. anInt1211 = 111;
  641. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  642. String s;
  643. if(myPlayer != null && myPlayer.name != null)
  644. s = myPlayer.name;
  645. else
  646. s = TextClass.fixName(myUsername);
  647. //textDrawingArea.method385(0, s + ":", 133, 11);
  648. newRegularFont.drawBasicString(s + ":",11,133,0,-1);
  649. //textDrawingArea.drawChatInput(255, 12 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false); //original star
  650. //textDrawingArea.method389(false, 12 + textDrawingArea.getTextWidth(s + ": "), 255, inputString + ((loopCycle % 40 < 20) ? "@bla@|" : ""), 133); //flashing
  651. newRegularFont.drawBasicString(inputString + ((loopCycle % 40 < 20) ? "|" : ""), 12 + textDrawingArea.getTextWidth(s + ": "),133,255,-1);
  652. DrawingArea.method339(121, 0x807660, 506, 7);
  653. }
  654. if(menuOpen && menuScreenArea == 2) {
  655. drawMenu();
  656. }
  657. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  658. aRSImageProducer_1165.initDrawingArea();
  659. Texture.anIntArray1472 = anIntArray1182;
  660. }*/
  661.  
  662. private Player opponent;
  663.  
  664.  
  665.  
  666. private void drawChatArea() {
  667. int yPosOffset = 0;
  668. int xPosOffset = 0;
  669. int y = 0;
  670. aRSImageProducer_1166.initDrawingArea();
  671. Texture.anIntArray1472 = anIntArray1180;
  672. chatArea.drawSprite(0, 0);
  673. drawChannelButtons();
  674. FontSystem textDrawingArea = regularText;
  675. if(messagePromptRaised) {
  676. regularText.drawCenteredString(aString1121, 259, 60, 0, -1);
  677. //chatTextDrawingArea.drawText(0, aString1121, 60, 259);
  678. regularText.drawCenteredString(promptInput + "*", 259, 80, 128, -1);
  679. //chatTextDrawingArea.drawText(128, promptInput + "*", 80, 259);
  680. } else if(inputDialogState == 1) {
  681. regularText.drawCenteredString("Enter amount:", 259, 60, 0, -1);
  682. //chatTextDrawingArea.drawText(0, "Enter amount:", 60, 259);
  683. regularText.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
  684. //chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  685. } else if(inputDialogState == 2) {
  686. regularText.drawCenteredString("Enter name:", 259, 60, 0, -1);
  687. //chatTextDrawingArea.drawText(0, "Enter name:", 60, 259);
  688. regularText.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
  689. //chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  690. } else if(aString844 != null) {
  691. regularText.drawCenteredString(aString844, 259, 60, 0, -1);
  692. //chatTextDrawingArea.drawText(0, aString844, 60, 259);
  693. regularText.drawCenteredString("Click to continue", 259, 80, 128, -1);
  694. //chatTextDrawingArea.drawText(128, "Click to continue", 80, 259);
  695. } else if(backDialogID != -1) {
  696. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  697. } else if(dialogID != -1) {
  698. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  699. } else {
  700. int j77 = -3;
  701. int j = 0;
  702. DrawingArea.setDrawingArea(122, 8, 497, 7);
  703. for(int k = 0; k < 500; k++)
  704. if(chatMessages[k] != null) {
  705. int chatType = chatTypes[k];
  706. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  707. String s1 = chatNames[k];
  708. byte byte0 = 0;
  709.  
  710. if(s1 != null && s1.startsWith("@cr1@")) {
  711. s1 = s1.substring(5);
  712. byte0 = 1;
  713. } else if(s1 != null && s1.startsWith("@cr2@")) {
  714. s1 = s1.substring(5);
  715. byte0 = 2;
  716. } else if(s1 != null && s1.startsWith("@cr3@")) {
  717. s1 = s1.substring(5);
  718. byte0 = 3;
  719. } else if(s1 != null && s1.startsWith("@cr4@")) {
  720. s1 = s1.substring(5);
  721. byte0 = 4;
  722. } else if(s1 != null && s1.startsWith("@cr5@")) {
  723. s1 = s1.substring(5);
  724. byte0 = 5;
  725. } else if(s1 != null && s1.startsWith("@cr6@")) {
  726. s1 = s1.substring(5);
  727. byte0 = 6;
  728. } else if(s1 != null && s1.startsWith("@cr7@")) {
  729. s1 = s1.substring(5);
  730. byte0 = 7;
  731. }
  732.  
  733. if(chatType == 0) {
  734. if (chatTypeView == 5 || chatTypeView == 0) {
  735. if(yPos > 0 && yPos < 210)
  736. regularText.drawBasicString(chatMessages[k], 11, yPos, 0, -1);
  737. //textDrawingArea.method389(false, 11, 0, chatMessages[k], yPos);//chat color enabled
  738. j++;
  739. j77++;
  740. }
  741. }
  742. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  743. if (chatTypeView == 1 || chatTypeView == 0) {
  744. if(yPos > 0 && yPos < 210) {
  745. int xPos = 11;
  746. if (byte0 >= 1) {
  747. modIcons[byte0 - 1].drawSprite(xPos + 1, yPos - 12);
  748. xPos += 14;
  749. }
  750. regularText.drawBasicString(s1 + ":", xPos, yPos, 0, -1);
  751. //textDrawingArea.method385(0, s1 + ":", yPos, xPos);
  752. xPos += regularText.getTextWidth(s1) + 8;
  753. //xPos += textDrawingArea.getTextWidth(s1) + 8;
  754. regularText.drawBasicString(chatMessages[k], xPos, yPos, 255, -1);
  755. //textDrawingArea.method389(false, xPos, 255, chatMessages[k], yPos);
  756. }
  757. j++;
  758. j77++;
  759. }
  760. }
  761. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  762. if (chatTypeView == 2 || chatTypeView == 0) {
  763. if(yPos > 0 && yPos < 210) {
  764. int k1 = 11;
  765. //textDrawingArea.method385(0, "From", yPos, k1);
  766. //k1 += textDrawingArea.getTextWidth("From ");
  767.  
  768. newRegularFont.drawBasicString("From", k1, yPos, 0, -1);
  769. k1 += newRegularFont.getTextWidth("From ");
  770. if(byte0 == 1) {
  771. modIcons[0].drawSprite(k1, yPos - 12);
  772. k1 += 12;
  773. } else if(byte0 == 2) {
  774. modIcons[1].drawSprite(k1, yPos - 12);
  775. k1 += 12;
  776. } else if(byte0 == 3) {
  777. modIcons[2].drawSprite(k1, yPos - 12);
  778. k1 += 12;
  779. } else if(byte0 == 4) {
  780. modIcons[3].drawSprite(k1, yPos - 12);
  781. k1 += 12;
  782. } else if(byte0 == 5) {
  783. modIcons[4].drawSprite(k1, yPos - 12);
  784. k1 += 12;
  785. } else if(byte0 == 6) {
  786. modIcons[5].drawSprite(k1, yPos - 12);
  787. k1 += 12;
  788. } else if(byte0 == 7) {
  789. modIcons[6].drawSprite(k1, yPos - 12);
  790. k1 += 12;
  791.  
  792. }
  793. regularText.drawBasicString(s1 + ":", k1, yPos, 0, -1);
  794. //textDrawingArea.method385(0, s1 + ":", yPos, k1);
  795. k1 += regularText.getTextWidth(s1) + 8;
  796. //k1 += textDrawingArea.getTextWidth(s1) + 8;
  797. regularText.drawBasicString(chatMessages[k], k1, yPos, 0x800000, -1);
  798. //textDrawingArea.method385(0x800000, chatMessages[k], yPos, k1);
  799. }
  800. j++;
  801. j77++;
  802. }
  803. }
  804. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  805. if (chatTypeView == 3 || chatTypeView == 0) {
  806. if(yPos > 0 && yPos < 210)
  807. regularText.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x800080, -1);
  808. //textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], yPos, 11);
  809. j++;
  810. j77++;
  811. }
  812. }
  813. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  814. if (chatTypeView == 2 || chatTypeView == 0) {
  815. if(yPos > 0 && yPos < 210)
  816. regularText.drawBasicString(chatMessages[k], 11, yPos, 0x800000, -1);
  817. //textDrawingArea.method385(0x800000, chatMessages[k], yPos, 11);
  818. j++;
  819. j77++;
  820. }
  821. }
  822. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  823. if (chatTypeView == 2 || chatTypeView == 0) {
  824. if(yPos > 0 && yPos < 210) {
  825. regularText.drawBasicString("To " + s1 + ":", 11, yPos, 0, -1);
  826. //textDrawingArea.method385(0, "To " + s1 + ":", yPos, 11);
  827. regularText.drawBasicString(chatMessages[k], 15 + regularText.getTextWidth("To :" + s1), yPos, 0x800000, -1);
  828. //textDrawingArea.method385(0x800000, chatMessages[k], yPos, 15 + textDrawingArea.getTextWidth("To :" + s1));
  829. }
  830. j++;
  831. j77++;
  832. }
  833. }
  834. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  835. if (chatTypeView == 3 || chatTypeView == 0) {
  836. if(yPos > 0 && yPos < 210)
  837. regularText.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  838. //textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  839. j++;
  840. j77++;
  841. }
  842. if(chatType == 11 && (clanChatMode == 0)) {
  843. if (chatTypeView == 11) {
  844. if(yPos > 0 && yPos < 210)
  845. regularText.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  846. //textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  847. j++;
  848. j77++;
  849. }
  850. //if(chatType == 12) {
  851. // if(yPos > 0 && yPos < 110)
  852. // regularText.drawBasicString(chatMessages[k] + " <col=225>" + s1, 11, yPos, 0x7e3200, -1);
  853. //textDrawingArea.method385(0x7e3200, chatMessages[k] + " @blu@" + s1, yPos, 11);
  854. // j++;
  855. //}
  856. }
  857. }
  858. if (chatType == 16) {
  859. if (chatTypeView == 11 || chatTypeView == 0) {
  860. if (yPos > 3 && yPos < 130) {
  861. int xPos = 11;
  862. String title = "<col=225>" + TextClass.capitalize(clanname) + "</col>";
  863. String username = (chatRights[k] > 0 ? "<img=" + (chatRights[k] - 0) + ">" : "") + TextClass.fixName(chatNames[k]);
  864. String message = "<col=800000000>" + TextClass.capitalizeFirstChar(chatMessages[k]) + "</col>";
  865. regularText.drawBasicString("[" + title + "] " + username + ": " + message, xPos, yPos, 0, -1);
  866. }
  867. j++;
  868. j77++;
  869. }
  870. }
  871. /*if(chatType == 16 || chatType == 12) {
  872. int j2 = 40;
  873. int clanNameWidth = regularText.getTextWidth(clanname);
  874. if(chatTypeView == 11 || chatTypeView == 0) {
  875. if(yPos > 3 && yPos < 130)
  876. switch(chatRights[k]) {
  877. case 1:
  878. case 2:
  879. case 3:
  880. case 4:
  881. case 5:
  882. case 6:
  883. case 7:
  884. j2 += clanNameWidth;
  885. modIcons[chatRights[k] - 1].drawSprite(j2 - 18, yPos - 12);
  886. j2 += 14;
  887. break;
  888.  
  889. default:
  890. j2 += clanNameWidth;
  891. break;
  892. }
  893. regularText.drawBasicString("[", 8, yPos, 0, -1);
  894. //textDrawingArea.method385(0, "[", yPos, 8);
  895. regularText.drawBasicString(clanname, 14, yPos, 255, -1);
  896. //textDrawingArea.method385(255, ""+clanname+"", yPos, 14);
  897. regularText.drawBasicString("]", clanNameWidth + 14, yPos, 0, -1);
  898. //textDrawingArea.method385(0, "]", yPos, clanNameWidth + 14);
  899.  
  900. regularText.drawBasicString(chatNames[k]+":", j2 - 17, yPos, 0, -1);
  901. //textDrawingArea.method385(0, chatNames[k]+":", yPos, j2 - 17); //j2
  902. j2 += regularText.getTextWidth(chatNames[k]) + 7;
  903. //j2 += textDrawingArea.getTextWidth(chatNames[k]) + 7;
  904. regularText.drawBasicString(chatMessages[k], j2 - 16, yPos, 0x800000, -1);
  905. //textDrawingArea.method385(0x800000, chatMessages[k], yPos, j2 - 16);//j2
  906. j++;
  907. j77++;
  908. }
  909. }*/
  910. }
  911. DrawingArea.defaultDrawingAreaSize();
  912. anInt1211 = j * 14 + 7 + 5;
  913. if(anInt1211 < 111)
  914. anInt1211 = 111;
  915. drawScrollbar(114, anInt1211 - anInt1089 - 113, y + 7, 496, anInt1211);
  916. String s;
  917. if(myPlayer != null && myPlayer.name != null)
  918. s = "<col=" +titleColor(myPlayer.titleColor, 0)+">" + myPlayer.title + "</col>" + myPlayer.name; //myPlayer.titleColor
  919. else
  920. s = TextClass.fixName(myUsername);
  921. switch (myPrivilege) {
  922. case 1:
  923. modIcons[0].drawSprite(12 + xPosOffset, 122 + yPosOffset);
  924. xPosOffset += 16;
  925. break;
  926. case 2:
  927. modIcons[1].drawSprite(12 + xPosOffset, 122 + yPosOffset);
  928. xPosOffset += 16;
  929. break;
  930. case 3:
  931. modIcons[2].drawSprite(12 + xPosOffset, 122 + yPosOffset);
  932. xPosOffset += 16;
  933. break;
  934. case 4:
  935. modIcons[3].drawSprite(12 + xPosOffset, 122 + yPosOffset);
  936. xPosOffset += 16;
  937. break;
  938. case 5:
  939. modIcons[4].drawSprite(12 + xPosOffset, 122 + yPosOffset);
  940. xPosOffset += 16;
  941. break;
  942. case 6:
  943. modIcons[5].drawSprite(12 + xPosOffset, 122 + yPosOffset);
  944. xPosOffset += 16;
  945. break;
  946. case 7:
  947. modIcons[6].drawSprite(12 + xPosOffset, 122 + yPosOffset);
  948. xPosOffset += 16;
  949. break;
  950. }
  951. regularText.drawBasicString(s + ":", 11 + xPosOffset, 133, 0, -1);
  952. //textDrawingArea.method385(0, s + ":", 133, 11);
  953. regularText.drawBasicString(inputString + "*", 12 + textDrawingArea.getTextWidth(s + ": ")+ xPosOffset, 133, 255, -1);
  954. //textDrawingArea.drawChatInput(255, 12 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false);
  955. DrawingArea.method339(121, 0x807660, 506, 7);
  956. }
  957. if(menuOpen && menuScreenArea == 2) {
  958. drawMenu();
  959. }
  960. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  961. aRSImageProducer_1165.initDrawingArea();
  962. Texture.anIntArray1472 = anIntArray1182;
  963. }
  964.  
  965. public void init() {
  966. instance = this;
  967. nodeID = 10;
  968. portOff = 0;
  969. setHighMem();
  970. isMembers = true;
  971. initClientFrame(503, 765);
  972. }
  973.  
  974. public void startRunnable(Runnable runnable, int i) {
  975. if(i > 10)
  976. i = 10;
  977. if(signlink.mainapp != null) {
  978. signlink.startthread(runnable, i);
  979. } else {
  980. super.startRunnable(runnable, i);
  981. }
  982. }
  983.  
  984. public Socket openSocket(int port) throws IOException {
  985. return new Socket(InetAddress.getByName(server), port);
  986. }
  987.  
  988. private boolean processMenuClick() {
  989. if(activeInterfaceType != 0)
  990. return false;
  991. int j = super.clickMode3;
  992. if(spellSelected == 1 && super.saveClickX >= 516 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  993. j = 0;
  994. if(menuOpen) {
  995. if(j != 1) {
  996. int k = super.mouseX;
  997. int j1 = super.mouseY;
  998. if(menuScreenArea == 0) {
  999. k -= 4;
  1000. j1 -= 4;
  1001. }
  1002. if(menuScreenArea == 1) {
  1003. k -= 519;
  1004. j1 -= 168;
  1005. }
  1006. if(menuScreenArea == 2) {
  1007. k -= 17;
  1008. j1 -= 338;
  1009. }
  1010. if(menuScreenArea == 3) {
  1011. k -= 519;
  1012. j1 -= 0;
  1013. }
  1014. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  1015. menuOpen = false;
  1016. if(menuScreenArea == 1)
  1017. needDrawTabArea = true;
  1018. if(menuScreenArea == 2)
  1019. inputTaken = true;
  1020. }
  1021. }
  1022. if(j == 1) {
  1023. int l = menuOffsetX;
  1024. int k1 = menuOffsetY;
  1025. int i2 = menuWidth;
  1026. int k2 = super.saveClickX;
  1027. int l2 = super.saveClickY;
  1028. if(menuScreenArea == 0) {
  1029. k2 -= 4;
  1030. l2 -= 4;
  1031. }
  1032. if(menuScreenArea == 1) {
  1033. k2 -= 519;
  1034. l2 -= 168;
  1035. }
  1036. if(menuScreenArea == 2) {
  1037. k2 -= 17;
  1038. l2 -= 338;
  1039. }
  1040. if(menuScreenArea == 3) {
  1041. k2 -= 519;
  1042. l2 -= 0;
  1043. }
  1044. int i3 = -1;
  1045. for(int j3 = 0; j3 < menuActionRow; j3++) {
  1046. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  1047. if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  1048. i3 = j3;
  1049. }
  1050. System.out.println(i3);
  1051. if(i3 != -1)
  1052. doAction(i3);
  1053. menuOpen = false;
  1054. if(menuScreenArea == 1)
  1055. needDrawTabArea = true;
  1056. if(menuScreenArea == 2) {
  1057. inputTaken = true;
  1058. }
  1059. }
  1060. return true;
  1061. } else {
  1062. if(j == 1 && menuActionRow > 0) {
  1063. int i1 = menuActionID[menuActionRow - 1];
  1064. 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) {
  1065. int l1 = menuActionCmd2[menuActionRow - 1];
  1066. int j2 = menuActionCmd3[menuActionRow - 1];
  1067. RSInterface class9 = RSInterface.interfaceCache[j2];
  1068. if(class9.aBoolean259 || class9.aBoolean235) {
  1069. aBoolean1242 = false;
  1070. anInt989 = 0;
  1071. anInt1084 = j2;
  1072. anInt1085 = l1;
  1073. activeInterfaceType = 2;
  1074. anInt1087 = super.saveClickX;
  1075. anInt1088 = super.saveClickY;
  1076. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  1077. activeInterfaceType = 1;
  1078. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  1079. activeInterfaceType = 3;
  1080. return true;
  1081. }
  1082. }
  1083. }
  1084. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  1085. j = 2;
  1086. if(j == 1 && menuActionRow > 0)
  1087. doAction(menuActionRow - 1);
  1088. if(j == 2 && menuActionRow > 0)
  1089. determineMenuSize();
  1090. return false;
  1091. }
  1092. }
  1093.  
  1094.  
  1095. public static int totalRead = 0;
  1096.  
  1097. public static String getFileNameWithoutExtension(String fileName) {
  1098. File tmpFile = new File(fileName);
  1099. tmpFile.getName();
  1100. int whereDot = tmpFile.getName().lastIndexOf('.');
  1101. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2 ) {
  1102. return tmpFile.getName().substring(0, whereDot);
  1103. }
  1104. return "";
  1105. }
  1106. public void preloadModels() {
  1107. File file = new File(signlink.findcachedir() + "Raw" + File.separator);
  1108. File[] fileArray = file.listFiles();
  1109. for(int y = 0; y < fileArray.length; y++) {
  1110. String s = fileArray[y].getName();
  1111. byte[] buffer = ReadFile(signlink.findcachedir() + "Raw" + File.separator + s);
  1112. Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
  1113. }
  1114. }
  1115.  
  1116.  
  1117.  
  1118. private void saveMidi(boolean flag, byte abyte0[])
  1119. {
  1120. signlink.midifade = flag ? 1 : 0;
  1121. signlink.midisave(abyte0, abyte0.length);
  1122. }
  1123.  
  1124. private void method22()
  1125. {
  1126. try
  1127. {
  1128. anInt985 = -1;
  1129. aClass19_1056.removeAll();
  1130. aClass19_1013.removeAll();
  1131. Texture.method366();
  1132. unlinkMRUNodes();
  1133. worldController.initToNull();
  1134. System.gc();
  1135. for(int i = 0; i < 4; i++)
  1136. aClass11Array1230[i].method210();
  1137.  
  1138. for(int l = 0; l < 4; l++)
  1139. {
  1140. for(int k1 = 0; k1 < 104; k1++)
  1141. {
  1142. for(int j2 = 0; j2 < 104; j2++)
  1143. byteGroundArray[l][k1][j2] = 0;
  1144.  
  1145. }
  1146.  
  1147. }
  1148.  
  1149. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  1150. int k2 = aByteArrayArray1183.length;
  1151. stream.createFrame(0);
  1152. if(!aBoolean1159)
  1153. {
  1154. for(int i3 = 0; i3 < k2; i3++)
  1155. {
  1156. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  1157. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  1158. byte abyte0[] = aByteArrayArray1183[i3];
  1159. if (FileOperations.FileExists(signlink.findcachedir()+"maps/"+anIntArray1235[i3]+".dat"))
  1160. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"maps/"+anIntArray1235[i3]+".dat");
  1161. if(abyte0 != null)
  1162. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  1163. }
  1164.  
  1165. for(int j4 = 0; j4 < k2; j4++)
  1166. {
  1167. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  1168. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  1169. byte abyte2[] = aByteArrayArray1183[j4];
  1170. if(abyte2 == null && anInt1070 < 800)
  1171. objectManager.method174(k7, 64, 64, l5);
  1172. }
  1173.  
  1174. anInt1097++;
  1175. if(anInt1097 > 160)
  1176. {
  1177. anInt1097 = 0;
  1178. stream.createFrame(238);
  1179. stream.writeWordBigEndian(96);
  1180. }
  1181. stream.createFrame(0);
  1182. for(int i6 = 0; i6 < k2; i6++)
  1183. {
  1184. byte abyte1[] = aByteArrayArray1247[i6];
  1185. if(abyte1 != null)
  1186. {
  1187. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  1188. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  1189. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  1190. }
  1191. }
  1192.  
  1193. }
  1194. if(aBoolean1159)
  1195. {
  1196. for(int j3 = 0; j3 < 4; j3++)
  1197. {
  1198. for(int k4 = 0; k4 < 13; k4++)
  1199. {
  1200. for(int j6 = 0; j6 < 13; j6++)
  1201. {
  1202. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  1203. if(l7 != -1)
  1204. {
  1205. int i9 = l7 >> 24 & 3;
  1206. int l9 = l7 >> 1 & 3;
  1207. int j10 = l7 >> 14 & 0x3ff;
  1208. int l10 = l7 >> 3 & 0x7ff;
  1209. int j11 = (j10 / 8 << 8) + l10 / 8;
  1210. for(int l11 = 0; l11 < anIntArray1234.length; l11++)
  1211. {
  1212. if(anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  1213. continue;
  1214. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  1215. break;
  1216. }
  1217.  
  1218. }
  1219. }
  1220.  
  1221. }
  1222.  
  1223. }
  1224.  
  1225. for(int l4 = 0; l4 < 13; l4++)
  1226. {
  1227. for(int k6 = 0; k6 < 13; k6++)
  1228. {
  1229. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  1230. if(i8 == -1)
  1231. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  1232. }
  1233.  
  1234. }
  1235.  
  1236. stream.createFrame(0);
  1237. for(int l6 = 0; l6 < 4; l6++)
  1238. {
  1239. for(int j8 = 0; j8 < 13; j8++)
  1240. {
  1241. for(int j9 = 0; j9 < 13; j9++)
  1242. {
  1243. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  1244. if(i10 != -1)
  1245. {
  1246. int k10 = i10 >> 24 & 3;
  1247. int i11 = i10 >> 1 & 3;
  1248. int k11 = i10 >> 14 & 0x3ff;
  1249. int i12 = i10 >> 3 & 0x7ff;
  1250. int j12 = (k11 / 8 << 8) + i12 / 8;
  1251. for(int k12 = 0; k12 < anIntArray1234.length; k12++)
  1252. {
  1253. if(anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  1254. continue;
  1255. //objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  1256. byte abyte0[] = aByteArrayArray1247[k12];
  1257. if (FileOperations.FileExists(signlink.findcachedir()+"maps/"+anIntArray1235[k12]+".dat"))
  1258. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"maps/"+anIntArray1235[k12]+".dat");
  1259. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  1260. break;
  1261. }
  1262.  
  1263. }
  1264. }
  1265.  
  1266. }
  1267.  
  1268. }
  1269.  
  1270. }
  1271. stream.createFrame(0);
  1272. objectManager.method171(aClass11Array1230, worldController);
  1273. aRSImageProducer_1165.initDrawingArea();
  1274. stream.createFrame(0);
  1275. int k3 = ObjectManager.anInt145;
  1276. if(k3 > plane)
  1277. k3 = plane;
  1278. if(k3 < plane - 1)
  1279. k3 = plane - 1;
  1280. if(lowMem)
  1281. worldController.method275(ObjectManager.anInt145);
  1282. else
  1283. worldController.method275(0);
  1284. for(int i5 = 0; i5 < 104; i5++)
  1285. {
  1286. for(int i7 = 0; i7 < 104; i7++)
  1287. spawnGroundItem(i5, i7);
  1288.  
  1289. }
  1290.  
  1291. anInt1051++;
  1292. if(anInt1051 > 98)
  1293. {
  1294. anInt1051 = 0;
  1295. stream.createFrame(150);
  1296. }
  1297. method63();
  1298. }
  1299. catch(Exception exception) { }
  1300. ObjectDef.mruNodes1.unlinkAll();
  1301. if(super.gameFrame != null)
  1302. {
  1303. stream.createFrame(210);
  1304. stream.writeDWord(0x3f008edd);
  1305. }
  1306. if(lowMem && signlink.cache_dat != null)
  1307. {
  1308. int j = onDemandFetcher.getVersionCount(0);
  1309. for(int i1 = 0; i1 < j; i1++)
  1310. {
  1311. int l1 = onDemandFetcher.getModelIndex(i1);
  1312. if((l1 & 0x79) == 0)
  1313. Model.method461(i1);
  1314. }
  1315.  
  1316. }
  1317. System.gc();
  1318. Texture.method367();
  1319. onDemandFetcher.method566();
  1320. int k = (anInt1069 - 6) / 8 - 1;
  1321. int j1 = (anInt1069 + 6) / 8 + 1;
  1322. int i2 = (anInt1070 - 6) / 8 - 1;
  1323. int l2 = (anInt1070 + 6) / 8 + 1;
  1324. if(aBoolean1141)
  1325. {
  1326. k = 49;
  1327. j1 = 50;
  1328. i2 = 49;
  1329. l2 = 50;
  1330. }
  1331. for(int l3 = k; l3 <= j1; l3++)
  1332. {
  1333. for(int j5 = i2; j5 <= l2; j5++)
  1334. if(l3 == k || l3 == j1 || j5 == i2 || j5 == l2)
  1335. {
  1336. int j7 = onDemandFetcher.method562(0, j5, l3);
  1337. if(j7 != -1)
  1338. onDemandFetcher.method560(j7, 3);
  1339. int k8 = onDemandFetcher.method562(1, j5, l3);
  1340. if(k8 != -1)
  1341. onDemandFetcher.method560(k8, 3);
  1342. }
  1343.  
  1344. }
  1345.  
  1346. }
  1347.  
  1348. private void unlinkMRUNodes()
  1349. {
  1350. ObjectDef.mruNodes1.unlinkAll();
  1351. ObjectDef.mruNodes2.unlinkAll();
  1352. EntityDef.mruNodes.unlinkAll();
  1353. ItemDef.mruNodes2.unlinkAll();
  1354. ItemDef.mruNodes1.unlinkAll();
  1355. Player.mruNodes.unlinkAll();
  1356. SpotAnim.aMRUNodes_415.unlinkAll();
  1357. }
  1358.  
  1359. private void method24(int i)
  1360. {
  1361. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  1362. int j = ai.length;
  1363. for(int k = 0; k < j; k++)
  1364. ai[k] = 0;
  1365.  
  1366. for(int l = 1; l < 103; l++)
  1367. {
  1368. int i1 = 24628 + (103 - l) * 512 * 4;
  1369. for(int k1 = 1; k1 < 103; k1++)
  1370. {
  1371. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  1372. worldController.method309(ai, i1, i, k1, l);
  1373. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1374. worldController.method309(ai, i1, i + 1, k1, l);
  1375. i1 += 4;
  1376. }
  1377.  
  1378. }
  1379.  
  1380. int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  1381. int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  1382. aClass30_Sub2_Sub1_Sub1_1263.method343();
  1383. for(int i2 = 1; i2 < 103; i2++)
  1384. {
  1385. for(int j2 = 1; j2 < 103; j2++)
  1386. {
  1387. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1388. method50(i2, j1, j2, l1, i);
  1389. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1390. method50(i2, j1, j2, l1, i + 1);
  1391. }
  1392.  
  1393. }
  1394.  
  1395. aRSImageProducer_1165.initDrawingArea();
  1396. anInt1071 = 0;
  1397. for(int k2 = 0; k2 < 104; k2++)
  1398. {
  1399. for(int l2 = 0; l2 < 104; l2++)
  1400. {
  1401. int i3 = worldController.method303(plane, k2, l2);
  1402. if(i3 != 0)
  1403. {
  1404. i3 = i3 >> 14 & 0x7fff;
  1405. int j3 = ObjectDef.forID(i3).anInt746;
  1406. if(j3 >= 0)
  1407. {
  1408. int k3 = k2;
  1409. int l3 = l2;
  1410. if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  1411. {
  1412. byte byte0 = 104;
  1413. byte byte1 = 104;
  1414. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  1415. for(int i4 = 0; i4 < 10; i4++)
  1416. {
  1417. int j4 = (int)(Math.random() * 4D);
  1418. if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1419. k3--;
  1420. if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1421. k3++;
  1422. if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1423. l3--;
  1424. if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1425. l3++;
  1426. }
  1427.  
  1428. }
  1429. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  1430. anIntArray1072[anInt1071] = k3;
  1431. anIntArray1073[anInt1071] = l3;
  1432. anInt1071++;
  1433. }
  1434. }
  1435. }
  1436.  
  1437. }
  1438.  
  1439. }
  1440.  
  1441. private void spawnGroundItem(int i, int j)
  1442. {
  1443. NodeList class19 = groundArray[plane][i][j];
  1444. if(class19 == null)
  1445. {
  1446. worldController.method295(plane, i, j);
  1447. return;
  1448. }
  1449. int k = 0xfa0a1f01;
  1450. Object obj = null;
  1451. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  1452. {
  1453. ItemDef itemDef = ItemDef.forID(item.ID);
  1454. int l = itemDef.value;
  1455. if(itemDef.stackable)
  1456. l *= item.anInt1559 + 1;
  1457. // notifyItemSpawn(item, i + baseX, j + baseY);
  1458.  
  1459. if(l > k)
  1460. {
  1461. k = l;
  1462. obj = item;
  1463. }
  1464. }
  1465.  
  1466. class19.insertTail(((Node) (obj)));
  1467. Object obj1 = null;
  1468. Object obj2 = null;
  1469. for(Item class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetNext())
  1470. {
  1471. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  1472. obj1 = class30_sub2_sub4_sub2_1;
  1473. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  1474. obj2 = class30_sub2_sub4_sub2_1;
  1475. }
  1476.  
  1477. int i1 = i + (j << 7) + 0x60000000;
  1478. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1479. }
  1480.  
  1481. private void method26(boolean flag)
  1482. {
  1483. for(int j = 0; j < npcCount; j++)
  1484. {
  1485. NPC npc = npcArray[npcIndices[j]];
  1486. int k = 0x20000000 + (npcIndices[j] << 14);
  1487. if(npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1488. continue;
  1489. int l = npc.x >> 7;
  1490. int i1 = npc.y >> 7;
  1491. if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1492. continue;
  1493. if(npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  1494. {
  1495. if(anIntArrayArray929[l][i1] == anInt1265)
  1496. continue;
  1497. anIntArrayArray929[l][i1] = anInt1265;
  1498. }
  1499. if(!npc.desc.aBoolean84)
  1500. k += 0x80000000;
  1501. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  1502. }
  1503. }
  1504.  
  1505. private boolean replayWave()
  1506. {
  1507. return signlink.wavereplay();
  1508. }
  1509.  
  1510. private void loadError()
  1511. {
  1512. String s = "ondemand";//was a constant parameter
  1513. System.out.println(s);
  1514. try
  1515. {
  1516. getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1517. }
  1518. catch(Exception exception)
  1519. {
  1520. exception.printStackTrace();
  1521. }
  1522. do
  1523. try
  1524. {
  1525. Thread.sleep(1000L);
  1526. }
  1527. catch(Exception _ex) { }
  1528. while(true);
  1529. }
  1530.  
  1531. public void drawHoverBox(int xPos, int yPos, String text) {
  1532. String[] results = text.split("\n");
  1533. int height = (results.length * 16) + 6;
  1534. int width;
  1535. width = smallText.getTextWidth(results[0]) + 6;
  1536. for(int i = 1; i < results.length; i++)
  1537. if(width <= smallText.getTextWidth(results[i]) + 6)
  1538. width = smallText.getTextWidth(results[i]) + 6;
  1539. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  1540. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  1541. yPos += 14;
  1542. for(int i = 0; i < results.length; i++) {
  1543. smallText.method389(false, xPos + 3, 0, results[i], yPos);
  1544. yPos += 16;
  1545. }
  1546. }
  1547.  
  1548. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
  1549. {
  1550. if(class9.type != 0 || class9.children == null || class9.isMouseoverTriggered)
  1551. return;
  1552. if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1553. return;
  1554. int k1 = class9.children.length;
  1555. for(int l1 = 0; l1 < k1; l1++)
  1556. {
  1557. int i2 = class9.childX[l1] + i;
  1558. int j2 = (class9.childY[l1] + l) - j1;
  1559. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1560. i2 += class9_1.anInt263;
  1561. j2 += class9_1.anInt265;
  1562. if((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1563. if(class9_1.mOverInterToTrigger >= 0)
  1564. anInt886 = class9_1.mOverInterToTrigger;
  1565. else
  1566. anInt886 = class9_1.id;
  1567. if (class9_1.type == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1568. anInt1315 = class9_1.id;
  1569. }
  1570. if(class9_1.type == 0)
  1571. {
  1572. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1573. if(class9_1.scrollMax > class9_1.height)
  1574. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1575. } else
  1576. {
  1577. if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1578. {
  1579. boolean flag = false;
  1580. if(class9_1.contentType != 0)
  1581. flag = buildFriendsListMenu(class9_1);
  1582. if(!flag)
  1583. {
  1584. //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1585. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1586. menuActionID[menuActionRow] = 315;
  1587. menuActionCmd3[menuActionRow] = class9_1.id;
  1588. menuActionRow++;
  1589. }
  1590. }
  1591. if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1592. {
  1593. String s = class9_1.selectedActionName;
  1594. if(s.indexOf(" ") != -1)
  1595. s = s.substring(0, s.indexOf(" "));
  1596. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1597. menuActionID[menuActionRow] = 626;
  1598. menuActionCmd3[menuActionRow] = class9_1.id;
  1599. menuActionRow++;
  1600. }
  1601. if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1602. {
  1603. menuActionName[menuActionRow] = "Close";
  1604. menuActionID[menuActionRow] = 200;
  1605. menuActionCmd3[menuActionRow] = class9_1.id;
  1606. menuActionRow++;
  1607. }
  1608. if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1609. {
  1610. //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1611. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1612. menuActionID[menuActionRow] = 169;
  1613. menuActionCmd3[menuActionRow] = class9_1.id;
  1614. menuActionRow++;
  1615. if (class9_1.hoverText != null) {
  1616. //drawHoverBox(k, l, class9_1.hoverText);
  1617. //System.out.println("DRAWING INTERFACE: " + class9_1.hoverText);
  1618. }
  1619. }
  1620. if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1621. {
  1622. //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1623. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1624. menuActionID[menuActionRow] = 646;
  1625. menuActionCmd3[menuActionRow] = class9_1.id;
  1626. menuActionRow++;
  1627. }
  1628. if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1629. {
  1630. //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1631. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1632. menuActionID[menuActionRow] = 679;
  1633. menuActionCmd3[menuActionRow] = class9_1.id;
  1634. menuActionRow++;
  1635. }
  1636. if(class9_1.type == 2)
  1637. {
  1638. int k2 = 0;
  1639. for(int l2 = 0; l2 < class9_1.height; l2++)
  1640. {
  1641. for(int i3 = 0; i3 < class9_1.width; i3++)
  1642. {
  1643. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1644. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1645. if(k2 < 20)
  1646. {
  1647. j3 += class9_1.spritesX[k2];
  1648. k3 += class9_1.spritesY[k2];
  1649. }
  1650. if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  1651. {
  1652. mouseInvInterfaceIndex = k2;
  1653. lastActiveInvInterface = class9_1.id;
  1654. if(class9_1.inv[k2] > 0)
  1655. {
  1656. ItemDef itemDef = ItemDef.forID(class9_1.inv[k2] - 1);
  1657. if(itemSelected == 1 && class9_1.isInventoryInterface)
  1658. {
  1659. if(class9_1.id != anInt1284 || k2 != anInt1283)
  1660. {
  1661. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  1662. menuActionID[menuActionRow] = 870;
  1663. menuActionCmd1[menuActionRow] = itemDef.id;
  1664. menuActionCmd2[menuActionRow] = k2;
  1665. menuActionCmd3[menuActionRow] = class9_1.id;
  1666. menuActionRow++;
  1667. }
  1668. } else
  1669. if(spellSelected == 1 && class9_1.isInventoryInterface)
  1670. {
  1671. if((spellUsableOn & 0x10) == 16)
  1672. {
  1673. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1674. menuActionID[menuActionRow] = 543;
  1675. menuActionCmd1[menuActionRow] = itemDef.id;
  1676. menuActionCmd2[menuActionRow] = k2;
  1677. menuActionCmd3[menuActionRow] = class9_1.id;
  1678. menuActionRow++;
  1679. }
  1680. } else
  1681. {
  1682. if(class9_1.isInventoryInterface)
  1683. {
  1684. for(int l3 = 4; l3 >= 3; l3--)
  1685. if(itemDef.actions != null && itemDef.actions[l3] != null)
  1686. {
  1687. menuActionName[menuActionRow] = itemDef.actions[l3] + " @lre@" + itemDef.name;
  1688. if(l3 == 3)
  1689. menuActionID[menuActionRow] = 493;
  1690. if(l3 == 4)
  1691. menuActionID[menuActionRow] = 847;
  1692. menuActionCmd1[menuActionRow] = itemDef.id;
  1693. menuActionCmd2[menuActionRow] = k2;
  1694. menuActionCmd3[menuActionRow] = class9_1.id;
  1695. menuActionRow++;
  1696. } else
  1697. if(l3 == 4)
  1698. {
  1699. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1700. menuActionID[menuActionRow] = 847;
  1701. menuActionCmd1[menuActionRow] = itemDef.id;
  1702. menuActionCmd2[menuActionRow] = k2;
  1703. menuActionCmd3[menuActionRow] = class9_1.id;
  1704. menuActionRow++;
  1705. }
  1706.  
  1707. }
  1708. if(class9_1.usableItemInterface)
  1709. {
  1710. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1711. menuActionID[menuActionRow] = 447;
  1712. menuActionCmd1[menuActionRow] = itemDef.id;
  1713. //k2 = inventory spot
  1714. //System.out.println(k2);
  1715. menuActionCmd2[menuActionRow] = k2;
  1716. menuActionCmd3[menuActionRow] = class9_1.id;
  1717. menuActionRow++;
  1718. }
  1719. if(class9_1.isInventoryInterface && itemDef.actions != null)
  1720. {
  1721. for(int i4 = 2; i4 >= 0; i4--)
  1722. if(itemDef.actions[i4] != null)
  1723. {
  1724. menuActionName[menuActionRow] = itemDef.actions[i4] + " @lre@" + itemDef.name;
  1725. if(i4 == 0)
  1726. menuActionID[menuActionRow] = 74;
  1727. if(i4 == 1)
  1728. menuActionID[menuActionRow] = 454;
  1729. if(i4 == 2)
  1730. menuActionID[menuActionRow] = 539;
  1731. menuActionCmd1[menuActionRow] = itemDef.id;
  1732. menuActionCmd2[menuActionRow] = k2;
  1733. menuActionCmd3[menuActionRow] = class9_1.id;
  1734. menuActionRow++;
  1735. }
  1736.  
  1737. }
  1738. if(class9_1.actions != null)
  1739. {
  1740. for(int j4 = 4; j4 >= 0; j4--)
  1741. if(class9_1.actions[j4] != null)
  1742. {
  1743. menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@" + itemDef.name;
  1744. if(j4 == 0)
  1745. menuActionID[menuActionRow] = 632;
  1746. if(j4 == 1)
  1747. menuActionID[menuActionRow] = 78;
  1748. if(j4 == 2)
  1749. menuActionID[menuActionRow] = 867;
  1750. if(j4 == 3)
  1751. menuActionID[menuActionRow] = 431;
  1752. if(j4 == 4)
  1753. menuActionID[menuActionRow] = 53;
  1754. menuActionCmd1[menuActionRow] = itemDef.id;
  1755. menuActionCmd2[menuActionRow] = k2;
  1756. menuActionCmd3[menuActionRow] = class9_1.id;
  1757. menuActionRow++;
  1758. }
  1759.  
  1760. }
  1761. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inv[k2] - 1) + "@gre@)";
  1762. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1763. menuActionID[menuActionRow] = 1125;
  1764. menuActionCmd1[menuActionRow] = itemDef.id;
  1765. menuActionCmd2[menuActionRow] = k2;
  1766. menuActionCmd3[menuActionRow] = class9_1.id;
  1767. menuActionRow++;
  1768. }
  1769. }
  1770. }
  1771. k2++;
  1772. }
  1773.  
  1774. }
  1775.  
  1776. }
  1777. }
  1778. }
  1779.  
  1780. }
  1781.  
  1782. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1783. scrollBar1.drawSprite(i1, l);
  1784. scrollBar2.drawSprite(i1, (l + j) - 16);
  1785. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1786. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1787. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1788. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1789. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1790. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1791. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1792. int k1 = ((j - 32) * j) / j1;
  1793. if(k1 < 8)
  1794. k1 = 8;
  1795. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1796. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1797. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1798. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1799. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1800. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1801. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1802. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1803. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1804. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1805. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1806. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1807. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1808. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1809. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1810. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1811. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1812. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1813. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1814. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1815. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1816. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1817. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1818. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1819. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1820. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1821. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1822. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1823. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1824. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1825. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1826. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1827. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1828. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1829. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1830. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1831. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1832. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1833. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1834. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1835. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1836. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1837. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1838. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1839. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1840. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1841. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1842. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1843. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1844. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1845. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1846. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1847. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1848. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1849. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1850. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1851. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1852. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1853. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1854. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1855. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1856. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1857. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1858. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1859. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1860. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1861. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1862. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1863. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1864. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1865. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1866. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1867. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1868. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1869. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1870. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1871. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1872. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1873. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1874. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1875. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1876. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1877. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1878. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1879. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1880. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1881. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1882. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1883. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1884. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1885. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1886. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1887. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1888. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1889. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1890. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1891. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1892. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1893. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1894. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1895. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1896. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1897. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1898. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1899. }
  1900.  
  1901. private void updateNPCs(Stream stream, int i)
  1902. {
  1903. anInt839 = 0;
  1904. anInt893 = 0;
  1905. method139(stream);
  1906. method46(i, stream);
  1907. method86(stream);
  1908. for(int k = 0; k < anInt839; k++)
  1909. {
  1910. int l = anIntArray840[k];
  1911. if(npcArray[l].anInt1537 != loopCycle)
  1912. {
  1913. npcArray[l].desc = null;
  1914. npcArray[l] = null;
  1915. }
  1916. }
  1917.  
  1918. if(stream.currentOffset != i)
  1919. {
  1920. signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1921. throw new RuntimeException("eek");
  1922. }
  1923. for(int i1 = 0; i1 < npcCount; i1++)
  1924. if(npcArray[npcIndices[i1]] == null)
  1925. {
  1926. signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1927. throw new RuntimeException("eek");
  1928. }
  1929.  
  1930. }
  1931.  
  1932. private int cButtonHPos;
  1933. private int cButtonHCPos;
  1934. private int cButtonCPos;
  1935.  
  1936. private void processChatModeClick() {
  1937. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  1938. cButtonHPos = 0;
  1939. aBoolean1233 = true;
  1940. inputTaken = true;
  1941. } else if (super.mouseX >= 62 && super.mouseX <= 117 && super.mouseY >= 482 && super.mouseY <= 503) {
  1942. cButtonHPos = 1;
  1943. aBoolean1233 = true;
  1944. inputTaken = true;
  1945. } else if (super.mouseX >= 119 && super.mouseX <= 174 && super.mouseY >= 482 && super.mouseY <= 503) {
  1946. cButtonHPos = 2;
  1947. aBoolean1233 = true;
  1948. inputTaken = true;
  1949. } else if (super.mouseX >= 176 && super.mouseX <= 231 && super.mouseY >= 482 && super.mouseY <= 503) {
  1950. cButtonHPos = 3;
  1951. aBoolean1233 = true;
  1952. inputTaken = true;
  1953. } else if (super.mouseX >= 233 && super.mouseX <= 288 && super.mouseY >= 482 && super.mouseY <= 503) {
  1954. cButtonHPos = 4;
  1955. aBoolean1233 = true;
  1956. inputTaken = true;
  1957. } else if (super.mouseX >= 290 && super.mouseX <= 345 && super.mouseY >= 482 && super.mouseY <= 503) {
  1958. cButtonHPos = 5;
  1959. aBoolean1233 = true;
  1960. inputTaken = true;
  1961. } else if (super.mouseX >= 347 && super.mouseX <= 402 && super.mouseY >= 482 && super.mouseY <= 503) {
  1962. cButtonHPos = 7;
  1963. aBoolean1233 = true;
  1964. inputTaken = true;
  1965. } else if (super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  1966. cButtonHPos = 6;
  1967. aBoolean1233 = true;
  1968. inputTaken = true;
  1969. } else {
  1970. cButtonHPos = -1;
  1971. aBoolean1233 = true;
  1972. inputTaken = true;
  1973. }
  1974. if (super.clickMode3 == 1) {
  1975. if (super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1976. cButtonCPos = 0;
  1977. chatTypeView = 0;
  1978. aBoolean1233 = true;
  1979. inputTaken = true;
  1980. } else if (super.saveClickX >= 62 && super.saveClickX <= 117 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1981. cButtonCPos = 1;
  1982. chatTypeView = 5;
  1983. aBoolean1233 = true;
  1984. inputTaken = true;
  1985. } else if (super.saveClickX >= 119 && super.saveClickX <= 174 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1986. cButtonCPos = 2;
  1987. chatTypeView = 1;
  1988. aBoolean1233 = true;
  1989. inputTaken = true;
  1990. } else if (super.saveClickX >= 176 && super.saveClickX <= 231 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1991. cButtonCPos = 3;
  1992. chatTypeView = 2;
  1993. aBoolean1233 = true;
  1994. inputTaken = true;
  1995. } else if (super.saveClickX >= 233 && super.saveClickX <= 288 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1996. cButtonCPos = 4;
  1997. chatTypeView = 11;
  1998. aBoolean1233 = true;
  1999. inputTaken = true;
  2000. } else if (super.saveClickX >= 290 && super.saveClickX <= 345 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2001. cButtonCPos = 5;
  2002. chatTypeView = 3;
  2003. aBoolean1233 = true;
  2004. inputTaken = true;
  2005. } else if (super.saveClickX >= 347 && super.saveClickX <= 402 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2006. cButtonCPos = 6;
  2007. aBoolean1233 = true;
  2008. inputTaken = true;
  2009. } else if (super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  2010. if (openInterfaceID == -1) {
  2011. clearTopInterfaces();
  2012. reportAbuseInput = "";
  2013. canMute = false;
  2014. for (int i = 0; i < RSInterface.interfaceCache.length; i++) {
  2015. if (RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600) continue;
  2016. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  2017. break;
  2018. }
  2019. } else {
  2020. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  2021. }
  2022. }
  2023. }
  2024. }
  2025.  
  2026. private void method33(int i)
  2027. {
  2028. try {
  2029. int j = Varp.cache[i].anInt709;
  2030. if(j == 0)
  2031. return;
  2032. int k = variousSettings[i];
  2033. if(j == 1)
  2034. {
  2035. if(k == 1)
  2036. Texture.method372(0.90000000000000002D);
  2037. if(k == 2)
  2038. Texture.method372(0.80000000000000004D);
  2039. if(k == 3)
  2040. Texture.method372(0.69999999999999996D);
  2041. if(k == 4)
  2042. Texture.method372(0.59999999999999998D);
  2043. ItemDef.mruNodes1.unlinkAll();
  2044. welcomeScreenRaised = true;
  2045. }
  2046. if(j == 3)
  2047. {
  2048. boolean flag1 = musicEnabled;
  2049. if(k == 0)
  2050. {
  2051. adjustVolume(musicEnabled, 0);
  2052. musicEnabled = true;
  2053. }
  2054. if(k == 1)
  2055. {
  2056. adjustVolume(musicEnabled, -400);
  2057. musicEnabled = true;
  2058. }
  2059. if(k == 2)
  2060. {
  2061. adjustVolume(musicEnabled, -800);
  2062. musicEnabled = true;
  2063. }
  2064. if(k == 3)
  2065. {
  2066. adjustVolume(musicEnabled, -1200);
  2067. musicEnabled = true;
  2068. }
  2069. if(k == 4)
  2070. musicEnabled = false;
  2071. if(musicEnabled != flag1 && !lowMem)
  2072. {
  2073. if(musicEnabled)
  2074. {
  2075. nextSong = currentSong;
  2076. songChanging = true;
  2077. onDemandFetcher.method558(2, nextSong);
  2078. } else
  2079. {
  2080. stopMidi();
  2081. }
  2082. prevSong = 0;
  2083. }
  2084. }
  2085. if(j == 4)
  2086. {
  2087. if(k == 0)
  2088. {
  2089. aBoolean848 = true;
  2090. setWaveVolume(0);
  2091. }
  2092. if(k == 1)
  2093. {
  2094. aBoolean848 = true;
  2095. setWaveVolume(-400);
  2096. }
  2097. if(k == 2)
  2098. {
  2099. aBoolean848 = true;
  2100. setWaveVolume(-800);
  2101. }
  2102. if(k == 3)
  2103. {
  2104. aBoolean848 = true;
  2105. setWaveVolume(-1200);
  2106. }
  2107. if(k == 4)
  2108. aBoolean848 = false;
  2109. }
  2110. if(j == 5)
  2111. anInt1253 = k;
  2112. if(j == 6)
  2113. anInt1249 = k;
  2114. if(j == 8)
  2115. {
  2116. splitPrivateChat = k;
  2117. inputTaken = true;
  2118. }
  2119. if(j == 9)
  2120. anInt913 = k;
  2121. } catch (Exception _e) {
  2122.  
  2123. }
  2124. }
  2125.  
  2126. private boolean drawOverChat = false;
  2127.  
  2128. private void updateEntities() {
  2129. try{
  2130. int anInt974 = 0;
  2131. for(int j = -1; j < playerCount + npcCount; j++) {
  2132. Object obj;
  2133. if(j == -1)
  2134. obj = myPlayer;
  2135. else
  2136. if(j < playerCount)
  2137. obj = playerArray[playerIndices[j]];
  2138. else
  2139. obj = npcArray[npcIndices[j - playerCount]];
  2140. if(obj == null || !((Entity) (obj)).isVisible())
  2141. continue;
  2142. if(obj instanceof NPC) {
  2143. EntityDef entityDef = ((NPC)obj).desc;
  2144. if(entityDef.childrenIDs != null)
  2145. entityDef = entityDef.method161();
  2146. if(entityDef == null)
  2147. continue;
  2148. }
  2149. if(j < playerCount) {
  2150. int l = 30;
  2151. Player player = (Player)obj;
  2152. if(player.headIcon >= 0) {
  2153. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2154. if(spriteDrawX > -1) {
  2155. if (player.skullIcon < 2) {
  2156. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2157. l += 25;
  2158. }
  2159. /*if (player.headIcon < 12) {
  2160. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2161. l += 18;
  2162. }*/
  2163. if(player.headIcon < 18) {
  2164. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2165. l += 26;
  2166. }
  2167. }
  2168. }
  2169. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  2170. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2171. if(spriteDrawX > -1)
  2172. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2173. }
  2174. } else {
  2175. EntityDef entityDef_1 = ((NPC)obj).desc;
  2176. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  2177. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2178. if(spriteDrawX > -1)
  2179. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  2180. }
  2181. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  2182. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2183. if(spriteDrawX > -1)
  2184. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  2185. }
  2186. }
  2187. if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  2188. {
  2189. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  2190. if(spriteDrawX > -1 && anInt974 < anInt975)
  2191. {
  2192. anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
  2193. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  2194. anIntArray976[anInt974] = spriteDrawX;
  2195. anIntArray977[anInt974] = spriteDrawY;
  2196. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  2197. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  2198. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  2199. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  2200. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  2201. {
  2202. anIntArray978[anInt974] += 10;
  2203. anIntArray977[anInt974] += 5;
  2204. }
  2205. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  2206. anIntArray979[anInt974] = 60;
  2207. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  2208. anIntArray978[anInt974] += 5;
  2209. }
  2210. }
  2211. if (((Entity) (obj)).loopCycleStatus > loopCycle) {
  2212. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2213.  
  2214. Entity entity = (Entity) obj;
  2215. if (spriteDrawX >= 0) {
  2216.  
  2217. int spriteWidth = 30;
  2218.  
  2219. if (entity.maxHealth >= 300) {
  2220. spriteWidth = 105;
  2221. }
  2222.  
  2223. int width = (entity.currentHealth * spriteWidth) / entity.maxHealth;
  2224.  
  2225. if (width > spriteWidth) {
  2226. width = spriteWidth;
  2227. }
  2228. DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, width);
  2229. DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + width, 0xff0000,
  2230. spriteWidth - width);
  2231.  
  2232. // System.out.println(myPlayer.npcStatShow);
  2233. if (myPlayer.npcStatShow != -1) {
  2234. NPC npc = npcArray[myPlayer.npcStatShow];
  2235.  
  2236. if (npc != null && npc.currentHealth > 0) {
  2237. spriteWidth = 105;
  2238.  
  2239. int den = npc.maxHealth == 0 ? 1 : npc.maxHealth;
  2240.  
  2241. width = (npc.currentHealth * spriteWidth) / den;
  2242.  
  2243. if (width > spriteWidth) {
  2244. width = spriteWidth;
  2245. }
  2246.  
  2247. DrawingArea.fillRect(1, 115, 65, 0, 20);
  2248. DrawingArea.drawPixels(13, 45, 6, 0x009933, width);
  2249. DrawingArea.drawPixels(13, 45, 6 + width, 0xCC0000, (spriteWidth - width));
  2250.  
  2251. String name = npc.desc.name;
  2252.  
  2253. if (name == null) {
  2254. name = "null";
  2255. }
  2256. if (skullIcon != null) {
  2257. skullIcon.drawTransparentSprite(5, 62, 255);
  2258. }
  2259. if (entityBox != null) {
  2260. entityBox.drawTransparentSprite(0, 20, 50);
  2261. }
  2262. // System.out.println(myNPC.currentHealth + ", "
  2263. // + myNPC.maxHealth);
  2264. aTextDrawingArea_1271.method389(true, 32, 0xFFFFFD,
  2265. npc.currentHealth + " / " + npc.maxHealth, 56);
  2266. aTextDrawingArea_1271.method389(true, 30, 0xFFFFFD, name, 35);
  2267. }
  2268. } else if (entity != myPlayer && myPlayer.interactingEntity != -1) {
  2269.  
  2270. // width = (entity.currentHealth * spriteWidth) /
  2271. // entity.maxHealth;
  2272. if (entity instanceof NPC) {
  2273. if (entity.interactingEntity != -1 && myPlayer.interactingEntity < 32768) {
  2274.  
  2275. /*
  2276. * System.out
  2277. * .println(myPlayer.interactingEntity +
  2278. * ", " + entity.interactingEntity);
  2279. */
  2280. int interaction = entity.interactingEntity;
  2281. if (entity.interactingEntity >= 32768)
  2282. interaction -= 32768;
  2283. NPC npc = npcArray[npcIndices[interaction]];
  2284.  
  2285. if (npc == null) {// this gets called for
  2286. // stuff like zulrah and
  2287. // other bosses...
  2288. npc = npcArray[myPlayer.interactingEntity];
  2289. }
  2290. if (npc != null) {
  2291. int npcInteract = npc.interactingEntity;
  2292.  
  2293. if (npcInteract >= 32768) {
  2294. npcInteract -= 32768;
  2295. }
  2296.  
  2297. int myInteract = myPlayer.interactingEntity;
  2298.  
  2299. if (myInteract >= 32768) {
  2300. myInteract -= 32768;
  2301. }
  2302. NPC myNPC = npcArray[myInteract];
  2303.  
  2304. // System.out.println("Interaction: " +
  2305. // interaction+", "+npcInteract + ", " +
  2306. // myInteract +", " + myNPC.desc.name);
  2307. // if (myPlayer.interactingEntity ==
  2308. // npcArray[npcIndices[myPlayer.interactingEntity]].)
  2309. // {
  2310. // System.out.println("True");
  2311. // }
  2312. // System.out.println("Attacking, " +
  2313. // myPlayer.interactingEntity + ", " +
  2314. // );
  2315. if (myNPC != null && myPlayer.interactingEntity != npc.interactingEntity) {
  2316. spriteWidth = 105;
  2317.  
  2318. int den = myNPC.maxHealth == 0 ? 1 : myNPC.maxHealth;
  2319.  
  2320. width = (myNPC.currentHealth * spriteWidth) / den;
  2321.  
  2322. if (width > spriteWidth) {
  2323. width = spriteWidth;
  2324. }
  2325.  
  2326. DrawingArea.fillRect(1, 115, 65, 0, 20);
  2327. DrawingArea.drawPixels(13, 45, 6, 0x009933, width);
  2328. DrawingArea.drawPixels(13, 45, 6 + width, 0xCC0000, (spriteWidth - width));
  2329.  
  2330. String name = myNPC.desc.name;
  2331.  
  2332. if (name == null) {
  2333. name = "null";
  2334. }
  2335. if (skullIcon != null) {
  2336. skullIcon.drawTransparentSprite(5, 62, 255);
  2337. }
  2338. if (entityBox != null) {
  2339. entityBox.drawTransparentSprite(0, 20, 50);
  2340. }
  2341. // System.out.println(myNPC.currentHealth
  2342. // + ", " + myNPC.maxHealth);
  2343. aTextDrawingArea_1271.method389(true, 32, 0xFFFFFD,
  2344. myNPC.currentHealth + " / " + myNPC.maxHealth, 56);
  2345. int x = 30;
  2346. // System.out.println("Name Size: "
  2347. // + name.length());
  2348. if (name.length() > 12) {
  2349. x = 10;
  2350. smallText.method389(true, x, 0xFFFFFD, name, 35);
  2351. } else {
  2352. aTextDrawingArea_1271.method389(true, x, 0xFFFFFD, name, 35);
  2353. }
  2354.  
  2355. // pushMessage("Entity Name: "+ name
  2356. // +", Current Health:
  2357. // "+entity.currentHealth,
  2358. // 0, "");
  2359. // pushMessage("Entity interacting:
  2360. // "+
  2361. // entity.interactingEntity
  2362. // +", Player Interacting: " +
  2363. // myPlayer.interactingEntity, 0,
  2364. // "");
  2365. }
  2366. }
  2367. }
  2368. } else if (entity instanceof Player) {
  2369.  
  2370. int interaction = myPlayer.interactingEntity;
  2371. if (myPlayer.interactingEntity > 32768)
  2372. interaction -= 32768;
  2373. Player player = playerArray[interaction];
  2374. // Player player =
  2375. // playerArray[entity.interactingEntity -
  2376. // 32768];
  2377. // System.out.println(player.name);
  2378. if (player != null && myPlayer.interactingEntity != entity.interactingEntity
  2379. && myPlayer.interactingEntity != 0) {
  2380. spriteWidth = 105;
  2381. width = (player.currentHealth * spriteWidth) / player.maxHealth;
  2382.  
  2383. if (width > spriteWidth) {
  2384. width = spriteWidth;
  2385. }
  2386. DrawingArea.fillRect(1, 115, 65, 0, 20);
  2387. DrawingArea.drawPixels(13, 45, 6, 0x009933, width);
  2388. DrawingArea.drawPixels(13, 45, (6) + width, 0xCC0000, (spriteWidth - width));
  2389. if (skullIcon != null) {
  2390. skullIcon.drawTransparentSprite(5, 62, 255);
  2391. }
  2392. if (entityBox != null) {
  2393. entityBox.drawTransparentSprite(0, 20, 50);
  2394. }
  2395. opponent = (Player) entity;
  2396. aTextDrawingArea_1271.method389(true, 32, 0xFFFFFD,
  2397. entity.currentHealth + " / " + entity.maxHealth, 56);
  2398. aTextDrawingArea_1271.method389(true, 30, 0xFFFFFD, player.name, 35);
  2399. aTextDrawingArea_1271.method389(true, 30, 0xFFFFFD, myPlayer.name, 77);
  2400.  
  2401. /* Player Stats */
  2402. drawOverChat = true;
  2403.  
  2404. }
  2405. }
  2406. }
  2407. // drawPixelsWithOpacity(int color, int yPos, int
  2408. // pixelWidth, int pixelHeight, int opacityLevel, int
  2409. // xPos) {//method335
  2410. }
  2411. }
  2412. for(int j1 = 0; j1 < 4; j1++)
  2413. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  2414. {
  2415. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  2416. if(spriteDrawX > -1)
  2417. {
  2418. if(j1 == 1)
  2419. spriteDrawY -= 20;
  2420. if(j1 == 2)
  2421. {
  2422. spriteDrawX -= 15;
  2423. spriteDrawY -= 10;
  2424. }
  2425. if(j1 == 3)
  2426. {
  2427. spriteDrawX += 15;
  2428. spriteDrawY -= 10;
  2429. }
  2430. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  2431. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  2432. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  2433. }
  2434. }
  2435. }
  2436. for(int k = 0; k < anInt974; k++) {
  2437. int k1 = anIntArray976[k];
  2438. int l1 = anIntArray977[k];
  2439. int j2 = anIntArray979[k];
  2440. int k2 = anIntArray978[k];
  2441. boolean flag = true;
  2442. while(flag)
  2443. {
  2444. flag = false;
  2445. for(int l2 = 0; l2 < k; l2++)
  2446. 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)
  2447. {
  2448. l1 = anIntArray977[l2] - anIntArray978[l2];
  2449. flag = true;
  2450. }
  2451.  
  2452. }
  2453. spriteDrawX = anIntArray976[k];
  2454. spriteDrawY = anIntArray977[k] = l1;
  2455. String s = aStringArray983[k];
  2456. if(anInt1249 == 0)
  2457. {
  2458. int i3 = 0xffff00;
  2459. if(anIntArray980[k] < 6)
  2460. i3 = anIntArray965[anIntArray980[k]];
  2461. if(anIntArray980[k] == 6)
  2462. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  2463. if(anIntArray980[k] == 7)
  2464. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  2465. if(anIntArray980[k] == 8)
  2466. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  2467. if(anIntArray980[k] == 9) {
  2468. int j3 = 150 - anIntArray982[k];
  2469. if(j3 < 50)
  2470. i3 = 0xff0000 + 1280 * j3;
  2471. else
  2472. if(j3 < 100)
  2473. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  2474. else
  2475. if(j3 < 150)
  2476. i3 = 65280 + 5 * (j3 - 100);
  2477. }
  2478. if(anIntArray980[k] == 10) {
  2479. int k3 = 150 - anIntArray982[k];
  2480. if(k3 < 50)
  2481. i3 = 0xff0000 + 5 * k3;
  2482. else
  2483. if(k3 < 100)
  2484. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  2485. else
  2486. if(k3 < 150)
  2487. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  2488. }
  2489. if(anIntArray980[k] == 11) {
  2490. int l3 = 150 - anIntArray982[k];
  2491. if(l3 < 50)
  2492. i3 = 0xffffff - 0x50005 * l3;
  2493. else
  2494. if(l3 < 100)
  2495. i3 = 65280 + 0x50005 * (l3 - 50);
  2496. else
  2497. if(l3 < 150)
  2498. i3 = 0xffffff - 0x50000 * (l3 - 100);
  2499. }
  2500. if(anIntArray981[k] == 0) {
  2501. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2502. chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  2503. }
  2504. if(anIntArray981[k] == 1) {
  2505. chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  2506. chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  2507. }
  2508. if(anIntArray981[k] == 2) {
  2509. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  2510. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  2511. }
  2512. if(anIntArray981[k] == 3) {
  2513. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  2514. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  2515. }
  2516. if(anIntArray981[k] == 4) {
  2517. int i4 = chatTextDrawingArea.method384(s);
  2518. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  2519. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  2520. chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  2521. chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  2522. DrawingArea.defaultDrawingAreaSize();
  2523. }
  2524. if(anIntArray981[k] == 5) {
  2525. int j4 = 150 - anIntArray982[k];
  2526. int l4 = 0;
  2527. if(j4 < 25)
  2528. l4 = j4 - 25;
  2529. else
  2530. if(j4 > 125)
  2531. l4 = j4 - 125;
  2532. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  2533. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  2534. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  2535. DrawingArea.defaultDrawingAreaSize();
  2536. }
  2537. } else {
  2538. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2539. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  2540. }
  2541. }
  2542. } catch(Exception e){ }
  2543. }
  2544.  
  2545. private void delFriend(long l)
  2546. {
  2547. try
  2548. {
  2549. if(l == 0L)
  2550. return;
  2551. for(int i = 0; i < friendsCount; i++)
  2552. {
  2553. if(friendsListAsLongs[i] != l)
  2554. continue;
  2555. friendsCount--;
  2556. needDrawTabArea = true;
  2557. for(int j = i; j < friendsCount; j++)
  2558. {
  2559. friendsList[j] = friendsList[j + 1];
  2560. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2561. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2562. }
  2563.  
  2564. stream.createFrame(215);
  2565. stream.writeQWord(l);
  2566. break;
  2567. }
  2568. }
  2569. catch(RuntimeException runtimeexception)
  2570. {
  2571. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  2572. throw new RuntimeException();
  2573. }
  2574. }
  2575.  
  2576. public void drawSideIcons()
  2577. {
  2578. if(tabInterfaceIDs[0] != -1)
  2579. sideIcons[0].drawSprite(10, 4);
  2580. if(tabInterfaceIDs[1] != -1)
  2581. sideIcons[1].drawSprite(43, 4);
  2582. if(tabInterfaceIDs[2] != -1)
  2583. sideIcons[2].drawSprite(76, 3);
  2584. if(tabInterfaceIDs[3] != -1)
  2585. sideIcons[3].drawSprite(111, 5);
  2586. if(tabInterfaceIDs[4] != -1)
  2587. sideIcons[4].drawSprite(140, 1);
  2588. if(tabInterfaceIDs[5] != -1)
  2589. sideIcons[5].drawSprite(174, 1);
  2590. if(tabInterfaceIDs[6] != -1)
  2591. sideIcons[6].drawSprite(208, 4);
  2592. if(tabInterfaceIDs[7] != -1)
  2593. sideIcons[7].drawSprite(11, 303);
  2594. if(tabInterfaceIDs[8] != -1)
  2595. sideIcons[8].drawSprite(46, 306);
  2596. if(tabInterfaceIDs[9] != -1)
  2597. sideIcons[9].drawSprite(79, 306);
  2598. if(tabInterfaceIDs[10] != -1)
  2599. sideIcons[10].drawSprite(113, 302);
  2600. if(tabInterfaceIDs[11] != -1)
  2601. sideIcons[11].drawSprite(145, 304);
  2602. if(tabInterfaceIDs[12] != -1)
  2603. sideIcons[12].drawSprite(181, 302);
  2604. if(tabInterfaceIDs[13] != -1)
  2605. sideIcons[13].drawSprite(213, 303);
  2606. }
  2607.  
  2608.  
  2609. public void drawRedStones() {
  2610. if(tabInterfaceIDs[tabID] != -1) {
  2611. switch(tabID) {
  2612. case 0:
  2613. redStones[0].drawSprite(3, 0);
  2614. break;
  2615. case 1:
  2616. redStones[4].drawSprite(41, 0);
  2617. break;
  2618. case 2:
  2619. redStones[4].drawSprite(74, 0);
  2620. break;
  2621. case 3:
  2622. redStones[4].drawSprite(107, 0);
  2623. break;
  2624. case 4:
  2625. redStones[4].drawSprite(140, 0);
  2626. break;
  2627. case 5:
  2628. redStones[4].drawSprite(173, 0);
  2629. break;
  2630. case 6:
  2631. redStones[1].drawSprite(206, 0);
  2632. break;
  2633. //case 7:
  2634. // redStones[2].drawSprite(3, 298);
  2635. // break;
  2636. case 8:
  2637. redStones[4].drawSprite(41, 298);
  2638. break;
  2639. case 9:
  2640. redStones[4].drawSprite(74, 298);
  2641. break;
  2642. case 10:
  2643. redStones[4].drawSprite(107, 298);
  2644. break;
  2645. case 11:
  2646. redStones[4].drawSprite(140, 298);
  2647. break;
  2648. case 12:
  2649. redStones[4].drawSprite(173, 298);
  2650. break;
  2651. case 13:
  2652. redStones[3].drawSprite(206, 298);
  2653. break;
  2654. }
  2655. }
  2656. }
  2657.  
  2658. private void drawTabArea() {
  2659. aRSImageProducer_1163.initDrawingArea();
  2660. Texture.anIntArray1472 = anIntArray1181;
  2661. tabArea.drawSprite(0, 0);
  2662. if(invOverlayInterfaceID == -1) {
  2663. drawRedStones();
  2664. drawSideIcons();
  2665. }
  2666. if(invOverlayInterfaceID != -1)
  2667. drawInterface(0, 28, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2668. else if(tabInterfaceIDs[tabID] != -1)
  2669. drawInterface(0, 28, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2670. if(menuOpen && menuScreenArea == 1)
  2671. drawMenu();
  2672. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  2673. aRSImageProducer_1165.initDrawingArea();
  2674. Texture.anIntArray1472 = anIntArray1182;
  2675. }
  2676.  
  2677. private void method37(int j) {
  2678. if(!lowMem) {
  2679. if(Texture.anIntArray1480[17] >= j) {
  2680. Background background = Texture.aBackgroundArray1474s[17];
  2681. int k = background.anInt1452 * background.anInt1453 - 1;
  2682. //fire cape apparently?
  2683. int j1 = background.anInt1452 * anInt945 * 2;
  2684. byte abyte0[] = background.aByteArray1450;
  2685. byte abyte3[] = aByteArray912;
  2686. for(int i2 = 0; i2 <= k; i2++)
  2687. abyte3[i2] = abyte0[i2 - j1 & k];
  2688.  
  2689. background.aByteArray1450 = abyte3;
  2690. aByteArray912 = abyte0;
  2691. Texture.method370(17);
  2692. anInt854++;
  2693. if(anInt854 > 1235) {
  2694. anInt854 = 0;
  2695. stream.createFrame(226);
  2696. stream.writeWordBigEndian(0);
  2697. int l2 = stream.currentOffset;
  2698. stream.writeWord(58722);
  2699. stream.writeWordBigEndian(240);
  2700. stream.writeWord((int)(Math.random() * 65536D));
  2701. stream.writeWordBigEndian((int)(Math.random() * 256D));
  2702. if((int)(Math.random() * 2D) == 0)
  2703. stream.writeWord(51825);
  2704. stream.writeWordBigEndian((int)(Math.random() * 256D));
  2705. stream.writeWord((int)(Math.random() * 65536D));
  2706. stream.writeWord(7130);
  2707. stream.writeWord((int)(Math.random() * 65536D));
  2708. stream.writeWord(61657);
  2709. stream.writeBytes(stream.currentOffset - l2);
  2710. }
  2711. }
  2712. if(Texture.anIntArray1480[24] >= j) {
  2713. Background background_1 = Texture.aBackgroundArray1474s[24];
  2714. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  2715. int k1 = background_1.anInt1452 * anInt945 * 2;
  2716. byte abyte1[] = background_1.aByteArray1450;
  2717. byte abyte4[] = aByteArray912;
  2718. for(int j2 = 0; j2 <= l; j2++)
  2719. abyte4[j2] = abyte1[j2 - k1 & l];
  2720.  
  2721. background_1.aByteArray1450 = abyte4;
  2722. aByteArray912 = abyte1;
  2723. Texture.method370(24);
  2724. }
  2725. if(Texture.anIntArray1480[34] >= j) {
  2726. Background background_2 = Texture.aBackgroundArray1474s[34];
  2727. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2728. int l1 = background_2.anInt1452 * anInt945 * 2;
  2729. byte abyte2[] = background_2.aByteArray1450;
  2730. byte abyte5[] = aByteArray912;
  2731. for(int k2 = 0; k2 <= i1; k2++)
  2732. abyte5[k2] = abyte2[k2 - l1 & i1];
  2733.  
  2734. background_2.aByteArray1450 = abyte5;
  2735. aByteArray912 = abyte2;
  2736. Texture.method370(34);
  2737. }
  2738. if(Texture.anIntArray1480[40] >= j)
  2739. {
  2740. Background background_2 = Texture.aBackgroundArray1474s[40];
  2741. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2742. int l1 = background_2.anInt1452 * anInt945 * 2;
  2743. byte abyte2[] = background_2.aByteArray1450;
  2744. byte abyte5[] = aByteArray912;
  2745. for(int k2 = 0; k2 <= i1; k2++)
  2746. abyte5[k2] = abyte2[k2 - l1 & i1];
  2747.  
  2748. background_2.aByteArray1450 = abyte5;
  2749. aByteArray912 = abyte2;
  2750. Texture.method370(40);
  2751. }
  2752. }
  2753. }
  2754.  
  2755. private void method38() {
  2756. for(int i = -1; i < playerCount; i++) {
  2757. int j;
  2758. if(i == -1)
  2759. j = myPlayerIndex;
  2760. else
  2761. j = playerIndices[i];
  2762. Player player = playerArray[j];
  2763. if(player != null && player.textCycle > 0) {
  2764. player.textCycle--;
  2765. if(player.textCycle == 0)
  2766. player.textSpoken = null;
  2767. }
  2768. }
  2769. for(int k = 0; k < npcCount; k++) {
  2770. int l = npcIndices[k];
  2771. NPC npc = npcArray[l];
  2772. if(npc != null && npc.textCycle > 0) {
  2773. npc.textCycle--;
  2774. if(npc.textCycle == 0)
  2775. npc.textSpoken = null;
  2776. }
  2777. }
  2778. }
  2779.  
  2780. private void calcCameraPos() {
  2781. int i = anInt1098 * 128 + 64;
  2782. int j = anInt1099 * 128 + 64;
  2783. int k = method42(plane, j, i) - anInt1100;
  2784. if(xCameraPos < i) {
  2785. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2786. if(xCameraPos > i)
  2787. xCameraPos = i;
  2788. }
  2789. if(xCameraPos > i) {
  2790. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2791. if(xCameraPos < i)
  2792. xCameraPos = i;
  2793. }
  2794. if(zCameraPos < k) {
  2795. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2796. if(zCameraPos > k)
  2797. zCameraPos = k;
  2798. }
  2799. if(zCameraPos > k) {
  2800. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2801. if(zCameraPos < k)
  2802. zCameraPos = k;
  2803. }
  2804. if(yCameraPos < j) {
  2805. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2806. if(yCameraPos > j)
  2807. yCameraPos = j;
  2808. }
  2809. if(yCameraPos > j) {
  2810. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2811. if(yCameraPos < j)
  2812. yCameraPos = j;
  2813. }
  2814. i = anInt995 * 128 + 64;
  2815. j = anInt996 * 128 + 64;
  2816. k = method42(plane, j, i) - anInt997;
  2817. int l = i - xCameraPos;
  2818. int i1 = k - zCameraPos;
  2819. int j1 = j - yCameraPos;
  2820. int k1 = (int)Math.sqrt(l * l + j1 * j1);
  2821. int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2822. int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2823. if(l1 < 128)
  2824. l1 = 128;
  2825. if(l1 > 383)
  2826. l1 = 383;
  2827. if(yCameraCurve < l1) {
  2828. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2829. if(yCameraCurve > l1)
  2830. yCameraCurve = l1;
  2831. }
  2832. if(yCameraCurve > l1) {
  2833. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2834. if(yCameraCurve < l1)
  2835. yCameraCurve = l1;
  2836. }
  2837. int j2 = i2 - xCameraCurve;
  2838. if(j2 > 1024)
  2839. j2 -= 2048;
  2840. if(j2 < -1024)
  2841. j2 += 2048;
  2842. if(j2 > 0) {
  2843. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2844. xCameraCurve &= 0x7ff;
  2845. }
  2846. if(j2 < 0) {
  2847. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2848. xCameraCurve &= 0x7ff;
  2849. }
  2850. int k2 = i2 - xCameraCurve;
  2851. if(k2 > 1024)
  2852. k2 -= 2048;
  2853. if(k2 < -1024)
  2854. k2 += 2048;
  2855. if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2856. xCameraCurve = i2;
  2857. }
  2858.  
  2859. private void drawMenu() {
  2860. int i = menuOffsetX;
  2861. int j = menuOffsetY;
  2862. int k = menuWidth;
  2863. int l = menuHeight + 1;//anInt952
  2864. //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  2865. //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  2866. DrawingArea.drawPixels(l - 4, j + 2, i, 0x706a5e, k);
  2867. DrawingArea.drawPixels(l - 2, j + 1, i + 1, 0x706a5e, k - 2);
  2868. DrawingArea.drawPixels(l, j, i + 2, 0x706a5e, k - 4);
  2869. DrawingArea.drawPixels(l - 2, j + 1, i + 3, 0x2d2822, k - 6);
  2870. DrawingArea.drawPixels(l - 4, j + 2, i + 2, 0x2d2822, k - 4);
  2871. DrawingArea.drawPixels(l - 6, j + 3, i + 1, 0x2d2822, k - 2);
  2872. DrawingArea.drawPixels(l - 22, j + 19, i + 2, 0x524a3d, k - 4);
  2873. DrawingArea.drawPixels(l - 22, j + 20, i + 3, 0x524a3d, k - 6);
  2874. DrawingArea.drawPixels(l - 23, j + 20, i + 3, 0x2b271c, k - 6);
  2875. DrawingArea.fillPixels(i + 3, k - 6, 1, 0x2a291b, j + 2);
  2876. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x2a261b, j + 3);
  2877. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x252116, j + 4);
  2878. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x211e15, j + 5);
  2879. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x1e1b12, j + 6);
  2880. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x1a170e, j + 7);
  2881. DrawingArea.fillPixels(i + 2, k - 4, 2, 0x15120b, j + 8);
  2882. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x100d08, j + 10);
  2883. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 11);
  2884. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x080703, j + 12);
  2885. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 13);
  2886. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x070802, j + 14);
  2887. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 15);
  2888. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x070802, j + 16);
  2889. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 17);
  2890. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x2a291b, j + 18);
  2891. DrawingArea.fillPixels(i + 3, k - 6, 1, 0x564943, j + 19);
  2892. chatTextDrawingArea.method385(0xc6b895, "Choose Option", j + 14, i + 3);
  2893. int j1 = super.mouseX;
  2894. int k1 = super.mouseY;
  2895. if(menuScreenArea == 0) {
  2896. j1 -= 4;
  2897. k1 -= 4;
  2898. }
  2899. if(menuScreenArea == 1) {
  2900. j1 -= 519;
  2901. k1 -= 168;
  2902. }
  2903. if(menuScreenArea == 2) {
  2904. j1 -= 17;
  2905. k1 -= 338;
  2906. }
  2907. if(menuScreenArea == 3) {
  2908. j1 -= 516;
  2909. k1 -= 0;
  2910. }
  2911. for(int l1 = 0; l1 < menuActionRow; l1++) {
  2912. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2913. int j2 = 0xc6b895;
  2914. if (j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3) {
  2915. DrawingArea.drawPixels(15, i2 - 11, i + 3, 0x6f695d, menuWidth - 6);
  2916. j2 = 0xeee5c6;
  2917. }
  2918. chatTextDrawingArea.method389(true, i + 4, j2, menuActionName[l1], i2 + 1);
  2919. }
  2920. }
  2921.  
  2922. private void addFriend(long l) {
  2923. try {
  2924. if(l == 0L)
  2925. return;
  2926. if(friendsCount >= 100 && anInt1046 != 1) {
  2927. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2928. return;
  2929. }
  2930. if(friendsCount >= 200) {
  2931. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2932. return;
  2933. }
  2934. String s = TextClass.fixName(TextClass.nameForLong(l));
  2935. for(int i = 0; i < friendsCount; i++)
  2936. if(friendsListAsLongs[i] == l) {
  2937. pushMessage(s + " is already on your friend list", 0, "");
  2938. return;
  2939. }
  2940. for(int j = 0; j < ignoreCount; j++)
  2941. if(ignoreListAsLongs[j] == l) {
  2942. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  2943. return;
  2944. }
  2945.  
  2946. if(s.equals(myPlayer.name)) {
  2947. return;
  2948. } else {
  2949. friendsList[friendsCount] = s;
  2950. friendsListAsLongs[friendsCount] = l;
  2951. friendsNodeIDs[friendsCount] = 0;
  2952. friendsCount++;
  2953. needDrawTabArea = true;
  2954. stream.createFrame(188);
  2955. stream.writeQWord(l);
  2956. return;
  2957. }
  2958. } catch(RuntimeException runtimeexception) {
  2959. signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
  2960. }
  2961. throw new RuntimeException();
  2962. }
  2963.  
  2964. private int method42(int i, int j, int k) {
  2965. int l = k >> 7;
  2966. int i1 = j >> 7;
  2967. if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2968. return 0;
  2969. int j1 = i;
  2970. if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2971. j1++;
  2972. int k1 = k & 0x7f;
  2973. int l1 = j & 0x7f;
  2974. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2975. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2976. return i2 * (128 - l1) + j2 * l1 >> 7;
  2977. }
  2978.  
  2979. private static String intToKOrMil(int j) {
  2980. if(j < 0x186a0)
  2981. return String.valueOf(j);
  2982. if(j < 0x989680)
  2983. return j / 1000 + "K";
  2984. else
  2985. return j / 0xf4240 + "M";
  2986. }
  2987.  
  2988. private void resetLogout() {
  2989. try {
  2990. if(socketStream != null)
  2991. socketStream.close();
  2992. }
  2993. catch(Exception _ex) { }
  2994. socketStream = null;
  2995. loggedIn = false;
  2996. loginScreenState = 0;
  2997. // myUsername = "";
  2998. // myPassword = "";
  2999. unlinkMRUNodes();
  3000. worldController.initToNull();
  3001. for(int i = 0; i < 4; i++)
  3002. aClass11Array1230[i].method210();
  3003. System.gc();
  3004. stopMidi();
  3005. currentSong = -1;
  3006. nextSong = -1;
  3007. prevSong = 0;
  3008. pouchToggle = false;
  3009. counterOn = false;
  3010. xpLock = false;
  3011.  
  3012. }
  3013.  
  3014. private void method45() {
  3015. aBoolean1031 = true;
  3016. for(int j = 0; j < 7; j++) {
  3017. anIntArray1065[j] = -1;
  3018. for(int k = 0; k < IDK.length; k++) {
  3019. if(IDK.cache[k].aBoolean662 || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  3020. continue;
  3021. anIntArray1065[j] = k;
  3022. break;
  3023. }
  3024. }
  3025. }
  3026.  
  3027. private void method46(int i, Stream stream) {
  3028. while(stream.bitPosition + 21 < i * 8) {
  3029. int k = stream.readBits(14);
  3030. if(k == 16383)
  3031. break;
  3032. if(npcArray[k] == null)
  3033. npcArray[k] = new NPC();
  3034. NPC npc = npcArray[k];
  3035. npcIndices[npcCount++] = k;
  3036. npc.anInt1537 = loopCycle;
  3037. int l = stream.readBits(5);
  3038. if(l > 15)
  3039. l -= 32;
  3040. int i1 = stream.readBits(5);
  3041. if(i1 > 15)
  3042. i1 -= 32;
  3043. int j1 = stream.readBits(1);
  3044. npc.desc = EntityDef.forID(stream.readBits(14));
  3045. int k1 = stream.readBits(1);
  3046. if(k1 == 1)
  3047. anIntArray894[anInt893++] = k;
  3048. npc.anInt1540 = npc.desc.aByte68;
  3049. npc.anInt1504 = npc.desc.anInt79;
  3050. npc.anInt1554 = npc.desc.walkAnim;
  3051. npc.anInt1555 = npc.desc.anInt58;
  3052. npc.anInt1556 = npc.desc.anInt83;
  3053. npc.anInt1557 = npc.desc.anInt55;
  3054. npc.anInt1511 = npc.desc.standAnim;
  3055. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  3056. }
  3057. stream.finishBitAccess();
  3058. }
  3059.  
  3060. public void processGameLoop() {
  3061. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  3062. return;
  3063. loopCycle++;
  3064. if(!loggedIn)
  3065. processLoginScreenInput();
  3066. else
  3067. mainGameProcessor();
  3068. processOnDemandQueue();
  3069. }
  3070.  
  3071. private void method47(boolean flag) {
  3072. if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  3073. destX = 0;
  3074. int j = playerCount;
  3075. if(flag)
  3076. j = 1;
  3077. for(int l = 0; l < j; l++) {
  3078. Player player;
  3079. int i1;
  3080. if(flag) {
  3081. player = myPlayer;
  3082. i1 = myPlayerIndex << 14;
  3083. } else {
  3084. player = playerArray[playerIndices[l]];
  3085. i1 = playerIndices[l] << 14;
  3086. }
  3087. if(player == null || !player.isVisible())
  3088. continue;
  3089. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  3090. int j1 = player.x >> 7;
  3091. int k1 = player.y >> 7;
  3092. if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  3093. continue;
  3094. if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  3095. player.aBoolean1699 = false;
  3096. player.anInt1709 = method42(plane, player.y, player.x);
  3097. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  3098. continue;
  3099. }
  3100. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  3101. if(anIntArrayArray929[j1][k1] == anInt1265)
  3102. continue;
  3103. anIntArrayArray929[j1][k1] = anInt1265;
  3104. }
  3105. player.anInt1709 = method42(plane, player.y, player.x);
  3106. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  3107. }
  3108. }
  3109.  
  3110. private boolean promptUserForInput(RSInterface class9) {
  3111. int j = class9.contentType;
  3112. if(anInt900 == 2) {
  3113. if(j == 201) {
  3114. inputTaken = true;
  3115. inputDialogState = 0;
  3116. messagePromptRaised = true;
  3117. promptInput = "";
  3118. friendsListAction = 1;
  3119. aString1121 = "Enter name of friend to add to list";
  3120. }
  3121. if(j == 202) {
  3122. inputTaken = true;
  3123. inputDialogState = 0;
  3124. messagePromptRaised = true;
  3125. promptInput = "";
  3126. friendsListAction = 2;
  3127. aString1121 = "Enter name of friend to delete from list";
  3128. }
  3129. }
  3130. if(j == 205) {
  3131. anInt1011 = 250;
  3132. return true;
  3133. }
  3134. if(j == 501) {
  3135. inputTaken = true;
  3136. inputDialogState = 0;
  3137. messagePromptRaised = true;
  3138. promptInput = "";
  3139. friendsListAction = 4;
  3140. aString1121 = "Enter name of player to add to list";
  3141. }
  3142. if(j == 502) {
  3143. inputTaken = true;
  3144. inputDialogState = 0;
  3145. messagePromptRaised = true;
  3146. promptInput = "";
  3147. friendsListAction = 5;
  3148. aString1121 = "Enter name of player to delete from list";
  3149. }
  3150. if(j == 550) {
  3151. inputTaken = true;
  3152. inputDialogState = 0;
  3153. messagePromptRaised = true;
  3154. promptInput = "";
  3155. friendsListAction = 6;
  3156. aString1121 = "Enter the name of the chat you wish to join";
  3157. }
  3158. if(j >= 300 && j <= 313) {
  3159. int k = (j - 300) / 2;
  3160. int j1 = j & 1;
  3161. int i2 = anIntArray1065[k];
  3162. if(i2 != -1) {
  3163. do {
  3164. if(j1 == 0 && --i2 < 0)
  3165. i2 = IDK.length - 1;
  3166. if(j1 == 1 && ++i2 >= IDK.length)
  3167. i2 = 0;
  3168. } while(IDK.cache[i2].aBoolean662 || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  3169. anIntArray1065[k] = i2;
  3170. aBoolean1031 = true;
  3171. }
  3172. }
  3173. if(j >= 314 && j <= 323) {
  3174. int l = (j - 314) / 2;
  3175. int k1 = j & 1;
  3176. int j2 = anIntArray990[l];
  3177. if(k1 == 0 && --j2 < 0)
  3178. j2 = anIntArrayArray1003[l].length - 1;
  3179. if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  3180. j2 = 0;
  3181. anIntArray990[l] = j2;
  3182. aBoolean1031 = true;
  3183. }
  3184. if(j == 324 && !aBoolean1047) {
  3185. aBoolean1047 = true;
  3186. method45();
  3187. }
  3188. if(j == 325 && aBoolean1047) {
  3189. aBoolean1047 = false;
  3190. method45();
  3191. }
  3192. if(j == 326) {
  3193. stream.createFrame(101);
  3194. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  3195. for(int i1 = 0; i1 < 7; i1++)
  3196. stream.writeWordBigEndian(anIntArray1065[i1]);
  3197.  
  3198. for(int l1 = 0; l1 < 5; l1++)
  3199. stream.writeWordBigEndian(anIntArray990[l1]);
  3200.  
  3201. return true;
  3202. }
  3203. if(j == 613)
  3204. canMute = !canMute;
  3205. if(j >= 601 && j <= 612) {
  3206. clearTopInterfaces();
  3207. if(reportAbuseInput.length() > 0) {
  3208. stream.createFrame(218);
  3209. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  3210. stream.writeWordBigEndian(j - 601);
  3211. stream.writeWordBigEndian(canMute ? 1 : 0);
  3212. }
  3213. }
  3214. return false;
  3215. }
  3216.  
  3217. private void method49(Stream stream) {
  3218. for(int j = 0; j < anInt893; j++) {
  3219. int k = anIntArray894[j];
  3220. Player player = playerArray[k];
  3221. int l = stream.readUnsignedByte();
  3222. if((l & 0x40) != 0)
  3223. l += stream.readUnsignedByte() << 8;
  3224. method107(l, k, stream, player);
  3225. }
  3226. }
  3227.  
  3228. private void method50(int i, int k, int l, int i1, int j1) {
  3229. int k1 = worldController.method300(j1, l, i);
  3230. if(k1 != 0) {
  3231. int l1 = worldController.method304(j1, l, i, k1);
  3232. int k2 = l1 >> 6 & 3;
  3233. int i3 = l1 & 0x1f;
  3234. int k3 = k;
  3235. if(k1 > 0)
  3236. k3 = i1;
  3237. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  3238. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3239. int i5 = k1 >> 14 & 0x7fff;
  3240. ObjectDef class46_2 = ObjectDef.forID(i5);
  3241. if(class46_2.anInt758 != -1) {
  3242. Background background_2 = mapScenes[class46_2.anInt758];
  3243. if(background_2 != null) {
  3244. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  3245. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  3246. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  3247. }
  3248. } else {
  3249. if(i3 == 0 || i3 == 2)
  3250. if(k2 == 0) {
  3251. ai[k4] = k3;
  3252. ai[k4 + 512] = k3;
  3253. ai[k4 + 1024] = k3;
  3254. ai[k4 + 1536] = k3;
  3255. } else if(k2 == 1) {
  3256. ai[k4] = k3;
  3257. ai[k4 + 1] = k3;
  3258. ai[k4 + 2] = k3;
  3259. ai[k4 + 3] = k3;
  3260. } else if(k2 == 2) {
  3261. ai[k4 + 3] = k3;
  3262. ai[k4 + 3 + 512] = k3;
  3263. ai[k4 + 3 + 1024] = k3;
  3264. ai[k4 + 3 + 1536] = k3;
  3265. } else if(k2 == 3) {
  3266. ai[k4 + 1536] = k3;
  3267. ai[k4 + 1536 + 1] = k3;
  3268. ai[k4 + 1536 + 2] = k3;
  3269. ai[k4 + 1536 + 3] = k3;
  3270. }
  3271. if(i3 == 3)
  3272. if(k2 == 0)
  3273. ai[k4] = k3;
  3274. else if(k2 == 1)
  3275. ai[k4 + 3] = k3;
  3276. else if(k2 == 2)
  3277. ai[k4 + 3 + 1536] = k3;
  3278. else if(k2 == 3)
  3279. ai[k4 + 1536] = k3;
  3280. if(i3 == 2)
  3281. if(k2 == 3) {
  3282. ai[k4] = k3;
  3283. ai[k4 + 512] = k3;
  3284. ai[k4 + 1024] = k3;
  3285. ai[k4 + 1536] = k3;
  3286. } else if(k2 == 0) {
  3287. ai[k4] = k3;
  3288. ai[k4 + 1] = k3;
  3289. ai[k4 + 2] = k3;
  3290. ai[k4 + 3] = k3;
  3291. } else if(k2 == 1) {
  3292. ai[k4 + 3] = k3;
  3293. ai[k4 + 3 + 512] = k3;
  3294. ai[k4 + 3 + 1024] = k3;
  3295. ai[k4 + 3 + 1536] = k3;
  3296. } else if(k2 == 2) {
  3297. ai[k4 + 1536] = k3;
  3298. ai[k4 + 1536 + 1] = k3;
  3299. ai[k4 + 1536 + 2] = k3;
  3300. ai[k4 + 1536 + 3] = k3;
  3301. }
  3302. }
  3303. }
  3304. k1 = worldController.method302(j1, l, i);
  3305. if(k1 != 0) {
  3306. int i2 = worldController.method304(j1, l, i, k1);
  3307. int l2 = i2 >> 6 & 3;
  3308. int j3 = i2 & 0x1f;
  3309. int l3 = k1 >> 14 & 0x7fff;
  3310. ObjectDef class46_1 = ObjectDef.forID(l3);
  3311. if(class46_1.anInt758 != -1) {
  3312. Background background_1 = mapScenes[class46_1.anInt758];
  3313. if(background_1 != null) {
  3314. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  3315. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  3316. background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  3317. }
  3318. } else if(j3 == 9) {
  3319. int l4 = 0xeeeeee;
  3320. if(k1 > 0)
  3321. l4 = 0xee0000;
  3322. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  3323. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3324. if(l2 == 0 || l2 == 2) {
  3325. ai1[l5 + 1536] = l4;
  3326. ai1[l5 + 1024 + 1] = l4;
  3327. ai1[l5 + 512 + 2] = l4;
  3328. ai1[l5 + 3] = l4;
  3329. } else {
  3330. ai1[l5] = l4;
  3331. ai1[l5 + 512 + 1] = l4;
  3332. ai1[l5 + 1024 + 2] = l4;
  3333. ai1[l5 + 1536 + 3] = l4;
  3334. }
  3335. }
  3336. }
  3337. k1 = worldController.method303(j1, l, i);
  3338. if(k1 != 0) {
  3339. int j2 = k1 >> 14 & 0x7fff;
  3340. ObjectDef class46 = ObjectDef.forID(j2);
  3341. if(class46.anInt758 != -1) {
  3342. Background background = mapScenes[class46.anInt758];
  3343. if(background != null) {
  3344. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  3345. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  3346. background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  3347. }
  3348. }
  3349. }
  3350. }
  3351.  
  3352. private void loadTitleScreen() {
  3353. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  3354. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  3355. aBackgroundArray1152s = new Background[12];
  3356. int j = 0;
  3357. try {
  3358. j = Integer.parseInt(getParameter("fl_icon"));
  3359. } catch(Exception _ex) {
  3360. }
  3361. if(j == 0) {
  3362. for(int k = 0; k < 12; k++)
  3363. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  3364.  
  3365. } else {
  3366. for(int l = 0; l < 12; l++)
  3367. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  3368.  
  3369. }
  3370. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  3371. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  3372. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  3373.  
  3374. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  3375.  
  3376. anIntArray851 = new int[256];
  3377. for(int k1 = 0; k1 < 64; k1++)
  3378. anIntArray851[k1] = k1 * 0x40000;
  3379.  
  3380. for(int l1 = 0; l1 < 64; l1++)
  3381. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  3382.  
  3383. for(int i2 = 0; i2 < 64; i2++)
  3384. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  3385.  
  3386. for(int j2 = 0; j2 < 64; j2++)
  3387. anIntArray851[j2 + 192] = 0xffffff;
  3388.  
  3389. anIntArray852 = new int[256];
  3390. for(int k2 = 0; k2 < 64; k2++)
  3391. anIntArray852[k2] = k2 * 1024;
  3392.  
  3393. for(int l2 = 0; l2 < 64; l2++)
  3394. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  3395.  
  3396. for(int i3 = 0; i3 < 64; i3++)
  3397. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  3398.  
  3399. for(int j3 = 0; j3 < 64; j3++)
  3400. anIntArray852[j3 + 192] = 0xffffff;
  3401.  
  3402. anIntArray853 = new int[256];
  3403. for(int k3 = 0; k3 < 64; k3++)
  3404. anIntArray853[k3] = k3 * 4;
  3405.  
  3406. for(int l3 = 0; l3 < 64; l3++)
  3407. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  3408.  
  3409. for(int i4 = 0; i4 < 64; i4++)
  3410. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  3411.  
  3412. for(int j4 = 0; j4 < 64; j4++)
  3413. anIntArray853[j4 + 192] = 0xffffff;
  3414.  
  3415. anIntArray850 = new int[256];
  3416. anIntArray1190 = new int[32768];
  3417. anIntArray1191 = new int[32768];
  3418. randomizeBackground(null);
  3419. anIntArray828 = new int[32768];
  3420. anIntArray829 = new int[32768];
  3421. drawLoadingText(10, "Connecting to fileserver");
  3422. if(!aBoolean831) {
  3423. drawFlames = true;
  3424. aBoolean831 = true;
  3425. startRunnable(this, 2);
  3426. }
  3427. }
  3428.  
  3429. private static void setHighMem() {
  3430. WorldController.lowMem = false;
  3431. Texture.lowMem = false;
  3432. lowMem = false;
  3433. ObjectManager.lowMem = false;
  3434. ObjectDef.lowMem = false;
  3435. }
  3436. public String indexLocation(int cacheIndex, int index) {
  3437. return signlink.findcachedir() + "index" + cacheIndex + "/" + (index != -1 ? index + ".gz" : "");
  3438. }
  3439.  
  3440. public void repackCacheIndex(int cacheIndex) {
  3441. System.out.println("Started repacking index " + cacheIndex + ".");
  3442. int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
  3443. File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
  3444. try {
  3445. for (int index = 0; index < indexLength; index++) {
  3446. int fileIndex = Integer.parseInt(getFileNameWithoutExtension(file[index].toString()));
  3447. byte[] data = fileToByteArray(cacheIndex, fileIndex);
  3448. if(data != null && data.length > 0) {
  3449. decompressors[cacheIndex].method234(data.length, data, fileIndex);
  3450. System.out.println("Repacked " + fileIndex + ".");
  3451. } else {
  3452. System.out.println("Unable to locate index " + fileIndex + ".");
  3453. }
  3454. }
  3455. } catch(Exception e) {
  3456. System.out.println("Error packing cache index " + cacheIndex + ".");
  3457. }
  3458. System.out.println("Finished repacking " + cacheIndex + ".");
  3459. }
  3460.  
  3461.  
  3462. public byte[] fileToByteArray(int cacheIndex, int index) {
  3463. try {
  3464. if (indexLocation(cacheIndex, index).length() <= 0 || indexLocation(cacheIndex, index) == null) {
  3465. return null;
  3466. }
  3467. File file = new File(indexLocation(cacheIndex, index));
  3468. byte[] fileData = new byte[(int)file.length()];
  3469. FileInputStream fis = new FileInputStream(file);
  3470. fis.read(fileData);
  3471. fis.close();
  3472. return fileData;
  3473. } catch(Exception e) {
  3474. return null;
  3475. }
  3476. }
  3477. public static void main(String args[]) {
  3478. try {
  3479.  
  3480. Jframe j = new Jframe(args); //UNCOMMENT OUT FOR .JAR
  3481. System.out.println("NovusScape: Loading...");
  3482. if(args.length != 5) {
  3483. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  3484. return;
  3485. }
  3486. nodeID = Integer.parseInt(args[0]);
  3487. //portOff = Integer.parseInt(args[1]);
  3488. portOff = 0;
  3489. if(args[2].equals("lowmem"))
  3490. setLowMem();
  3491. else if(args[2].equals("highmem")) {
  3492. setHighMem();
  3493. } else {
  3494. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  3495. return;
  3496. }
  3497. if(args[3].equals("free"))
  3498. isMembers = false;
  3499. else if(args[3].equals("members")) {
  3500. isMembers = true;
  3501. } else {
  3502. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  3503. return;
  3504. }
  3505. signlink.storeid = Integer.parseInt(args[4]);
  3506. signlink.startpriv(InetAddress.getLocalHost());
  3507. new Jframe(args);
  3508. //client client1 = new client();
  3509. //client1.createClientFrame(503, 765);
  3510. } catch(Exception exception) {
  3511. }
  3512. }
  3513.  
  3514.  
  3515.  
  3516. private void loadingStages() {
  3517. if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  3518. aRSImageProducer_1165.initDrawingArea();
  3519. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  3520. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  3521. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3522. loadingStage = 1;
  3523. aLong824 = System.currentTimeMillis();
  3524. }
  3525. if(loadingStage == 1) {
  3526. int j = method54();
  3527. if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  3528. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  3529. aLong824 = System.currentTimeMillis();
  3530. }
  3531. }
  3532. if(loadingStage == 2 && plane != anInt985) {
  3533. anInt985 = plane;
  3534. method24(plane);
  3535. }
  3536. }
  3537.  
  3538. private int method54() {
  3539. for(int i = 0; i < aByteArrayArray1183.length; i++) {
  3540. if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  3541. return -1;
  3542. if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  3543. return -2;
  3544. }
  3545. boolean flag = true;
  3546. for(int j = 0; j < aByteArrayArray1183.length; j++) {
  3547. byte abyte0[] = aByteArrayArray1247[j];
  3548. if(abyte0 != null) {
  3549. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3550. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3551. if(aBoolean1159) {
  3552. k = 10;
  3553. l = 10;
  3554. }
  3555. flag &= ObjectManager.method189(k, abyte0, l);
  3556. }
  3557. }
  3558. if(!flag)
  3559. return -3;
  3560. if(aBoolean1080) {
  3561. return -4;
  3562. } else {
  3563. loadingStage = 2;
  3564. ObjectManager.anInt131 = plane;
  3565. method22();
  3566. stream.createFrame(121);
  3567. return 0;
  3568. }
  3569. }
  3570.  
  3571. private void method55()
  3572. {
  3573. 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())
  3574. if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3575. class30_sub2_sub4_sub4.unlink();
  3576. else
  3577. if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  3578. {
  3579. if(class30_sub2_sub4_sub4.anInt1590 > 0)
  3580. {
  3581. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3582. if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  3583. 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);
  3584. }
  3585. if(class30_sub2_sub4_sub4.anInt1590 < 0)
  3586. {
  3587. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3588. Player player;
  3589. if(j == unknownInt10)
  3590. player = myPlayer;
  3591. else
  3592. player = playerArray[j];
  3593. if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  3594. 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);
  3595. }
  3596. class30_sub2_sub4_sub4.method456(anInt945);
  3597. 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);
  3598. }
  3599.  
  3600. }
  3601.  
  3602. public AppletContext getAppletContext()
  3603. {
  3604. if(signlink.mainapp != null)
  3605. return signlink.mainapp.getAppletContext();
  3606. else
  3607. return super.getAppletContext();
  3608. }
  3609.  
  3610. private void drawLogo() {
  3611. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  3612. Sprite sprite = new Sprite(abyte0, this);
  3613. aRSImageProducer_1110.initDrawingArea();
  3614. sprite.method346(0, 0);
  3615. aRSImageProducer_1111.initDrawingArea();
  3616. sprite.method346(-637, 0);
  3617. aRSImageProducer_1107.initDrawingArea();
  3618. sprite.method346(-128, 0);
  3619. aRSImageProducer_1108.initDrawingArea();
  3620. sprite.method346(-202, -371);
  3621. aRSImageProducer_1109.initDrawingArea();
  3622. sprite.method346(-202, -171);
  3623. aRSImageProducer_1112.initDrawingArea();
  3624. sprite.method346(0, -265);
  3625. aRSImageProducer_1113.initDrawingArea();
  3626. sprite.method346(-562, -265);
  3627. aRSImageProducer_1114.initDrawingArea();
  3628. sprite.method346(-128, -171);
  3629. aRSImageProducer_1115.initDrawingArea();
  3630. sprite.method346(-562, -171);
  3631. int ai[] = new int[sprite.myWidth];
  3632. for(int j = 0; j < sprite.myHeight; j++) {
  3633. for(int k = 0; k < sprite.myWidth; k++)
  3634. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  3635.  
  3636. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  3637. }
  3638. /*aRSImageProducer_1110.initDrawingArea();
  3639. sprite.method346(382, 0);
  3640. aRSImageProducer_1111.initDrawingArea();
  3641. sprite.method346(-255, 0);
  3642. aRSImageProducer_1107.initDrawingArea();
  3643. sprite.method346(254, 0);
  3644. aRSImageProducer_1108.initDrawingArea();
  3645. sprite.method346(180, -371);
  3646. aRSImageProducer_1109.initDrawingArea();
  3647. sprite.method346(180, -171);
  3648. aRSImageProducer_1112.initDrawingArea();
  3649. sprite.method346(382, -265);
  3650. aRSImageProducer_1113.initDrawingArea();
  3651. sprite.method346(-180, -265);
  3652. aRSImageProducer_1114.initDrawingArea();
  3653. sprite.method346(254, -171);
  3654. aRSImageProducer_1115.initDrawingArea();
  3655. sprite.method346(-180, -171);
  3656. sprite = new Sprite(titleStreamLoader, "logo", 0);
  3657. aRSImageProducer_1107.initDrawingArea();
  3658. sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);*/
  3659. sprite = null;
  3660. Object obj = null;
  3661. Object obj1 = null;
  3662. System.gc();
  3663. }
  3664.  
  3665. private void processOnDemandQueue()
  3666. {
  3667. do
  3668. {
  3669. OnDemandData onDemandData;
  3670. do
  3671. {
  3672. onDemandData = onDemandFetcher.getNextNode();
  3673. if(onDemandData == null)
  3674. return;
  3675. if(onDemandData.dataType == 0)
  3676. {
  3677. Model.method460(onDemandData.buffer, onDemandData.ID);
  3678. if((onDemandFetcher.getModelIndex(onDemandData.ID) & 0x62) != 0)
  3679. {
  3680. needDrawTabArea = true;
  3681. if(backDialogID != -1)
  3682. inputTaken = true;
  3683. }
  3684. }
  3685. if(onDemandData.dataType == 1 && onDemandData.buffer != null)
  3686. Class36.load(onDemandData.ID, onDemandData.buffer);
  3687. if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  3688. saveMidi(songChanging, onDemandData.buffer);
  3689. if(onDemandData.dataType == 3 && loadingStage == 1)
  3690. {
  3691. for(int i = 0; i < aByteArrayArray1183.length; i++)
  3692. {
  3693. if(anIntArray1235[i] == onDemandData.ID)
  3694. {
  3695. aByteArrayArray1183[i] = onDemandData.buffer;
  3696. if(onDemandData.buffer == null)
  3697. anIntArray1235[i] = -1;
  3698. break;
  3699. }
  3700. if(anIntArray1236[i] != onDemandData.ID)
  3701. continue;
  3702. aByteArrayArray1247[i] = onDemandData.buffer;
  3703. if(onDemandData.buffer == null)
  3704. anIntArray1236[i] = -1;
  3705. break;
  3706. }
  3707.  
  3708. }
  3709. } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  3710. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  3711. } while(true);
  3712.  
  3713. }
  3714.  
  3715. private void calcFlamesPosition()
  3716. {
  3717. char c = '\u0100';
  3718. for(int j = 10; j < 117; j++)
  3719. {
  3720. int k = (int)(Math.random() * 100D);
  3721. if(k < 50)
  3722. anIntArray828[j + (c - 2 << 7)] = 255;
  3723. }
  3724. for(int l = 0; l < 100; l++)
  3725. {
  3726. int i1 = (int)(Math.random() * 124D) + 2;
  3727. int k1 = (int)(Math.random() * 128D) + 128;
  3728. int k2 = i1 + (k1 << 7);
  3729. anIntArray828[k2] = 192;
  3730. }
  3731.  
  3732. for(int j1 = 1; j1 < c - 1; j1++)
  3733. {
  3734. for(int l1 = 1; l1 < 127; l1++)
  3735. {
  3736. int l2 = l1 + (j1 << 7);
  3737. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  3738. }
  3739.  
  3740. }
  3741.  
  3742. anInt1275 += 128;
  3743. if(anInt1275 > anIntArray1190.length)
  3744. {
  3745. anInt1275 -= anIntArray1190.length;
  3746. int i2 = (int)(Math.random() * 12D);
  3747. randomizeBackground(aBackgroundArray1152s[i2]);
  3748. }
  3749. for(int j2 = 1; j2 < c - 1; j2++)
  3750. {
  3751. for(int i3 = 1; i3 < 127; i3++)
  3752. {
  3753. int k3 = i3 + (j2 << 7);
  3754. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  3755. if(i4 < 0)
  3756. i4 = 0;
  3757. anIntArray828[k3] = i4;
  3758. }
  3759.  
  3760. }
  3761.  
  3762. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  3763.  
  3764. anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
  3765. if(anInt1040 > 0)
  3766. anInt1040 -= 4;
  3767. if(anInt1041 > 0)
  3768. anInt1041 -= 4;
  3769. if(anInt1040 == 0 && anInt1041 == 0)
  3770. {
  3771. int l3 = (int)(Math.random() * 2000D);
  3772. if(l3 == 0)
  3773. anInt1040 = 1024;
  3774. if(l3 == 1)
  3775. anInt1041 = 1024;
  3776. }
  3777. }
  3778.  
  3779. private boolean saveWave(byte abyte0[], int i)
  3780. {
  3781. return abyte0 == null || signlink.wavesave(abyte0, i);
  3782. }
  3783.  
  3784. private void method60(int i)
  3785. {
  3786. RSInterface class9 = RSInterface.interfaceCache[i];
  3787. for(int j = 0; j < class9.children.length; j++)
  3788. {
  3789. if(class9.children[j] == -1)
  3790. break;
  3791. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  3792. if(class9_1.type == 1)
  3793. method60(class9_1.id);
  3794. class9_1.anInt246 = 0;
  3795. class9_1.anInt208 = 0;
  3796. }
  3797. }
  3798.  
  3799. private void drawHeadIcon()
  3800. {
  3801. if(anInt855 != 2)
  3802. return;
  3803. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  3804. if(spriteDrawX > -1 && loopCycle % 20 < 10)
  3805. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3806. }
  3807.  
  3808. private void mainGameProcessor()
  3809. {
  3810. if(anInt1104 > 1)
  3811. anInt1104--;
  3812. if(anInt1011 > 0)
  3813. anInt1011--;
  3814. for(int j = 0; j < 5; j++)
  3815. if(!parsePacket())
  3816. break;
  3817.  
  3818. if(!loggedIn)
  3819. return;
  3820. synchronized(mouseDetection.syncObject)
  3821. {
  3822. if(flagged)
  3823. {
  3824. if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
  3825. {
  3826. stream.createFrame(45);
  3827. stream.writeWordBigEndian(0);
  3828. int j2 = stream.currentOffset;
  3829. int j3 = 0;
  3830. for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
  3831. {
  3832. if(j2 - stream.currentOffset >= 240)
  3833. break;
  3834. j3++;
  3835. int l4 = mouseDetection.coordsY[j4];
  3836. if(l4 < 0)
  3837. l4 = 0;
  3838. else
  3839. if(l4 > 502)
  3840. l4 = 502;
  3841. int k5 = mouseDetection.coordsX[j4];
  3842. if(k5 < 0)
  3843. k5 = 0;
  3844. else
  3845. if(k5 > 764)
  3846. k5 = 764;
  3847. int i6 = l4 * 765 + k5;
  3848. if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  3849. {
  3850. k5 = -1;
  3851. l4 = -1;
  3852. i6 = 0x7ffff;
  3853. }
  3854. if(k5 == anInt1237 && l4 == anInt1238)
  3855. {
  3856. if(anInt1022 < 2047)
  3857. anInt1022++;
  3858. } else
  3859. {
  3860. int j6 = k5 - anInt1237;
  3861. anInt1237 = k5;
  3862. int k6 = l4 - anInt1238;
  3863. anInt1238 = l4;
  3864. if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  3865. {
  3866. j6 += 32;
  3867. k6 += 32;
  3868. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  3869. anInt1022 = 0;
  3870. } else
  3871. if(anInt1022 < 8)
  3872. {
  3873. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  3874. anInt1022 = 0;
  3875. } else
  3876. {
  3877. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  3878. anInt1022 = 0;
  3879. }
  3880. }
  3881. }
  3882.  
  3883. stream.writeBytes(stream.currentOffset - j2);
  3884. if(j3 >= mouseDetection.coordsIndex)
  3885. {
  3886. mouseDetection.coordsIndex = 0;
  3887. } else
  3888. {
  3889. mouseDetection.coordsIndex -= j3;
  3890. for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  3891. {
  3892. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  3893. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  3894. }
  3895.  
  3896. }
  3897. }
  3898. } else
  3899. {
  3900. mouseDetection.coordsIndex = 0;
  3901. }
  3902. }
  3903. if(super.clickMode3 != 0)
  3904. {
  3905. long l = (super.aLong29 - aLong1220) / 50L;
  3906. if(l > 4095L)
  3907. l = 4095L;
  3908. aLong1220 = super.aLong29;
  3909. int k2 = super.saveClickY;
  3910. if(k2 < 0)
  3911. k2 = 0;
  3912. else
  3913. if(k2 > 502)
  3914. k2 = 502;
  3915. int k3 = super.saveClickX;
  3916. if(k3 < 0)
  3917. k3 = 0;
  3918. else
  3919. if(k3 > 764)
  3920. k3 = 764;
  3921. int k4 = k2 * 765 + k3;
  3922. int j5 = 0;
  3923. if(super.clickMode3 == 2)
  3924. j5 = 1;
  3925. int l5 = (int)l;
  3926. stream.createFrame(241);
  3927. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3928. }
  3929. if(anInt1016 > 0)
  3930. anInt1016--;
  3931. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3932. aBoolean1017 = true;
  3933. if(aBoolean1017 && anInt1016 <= 0)
  3934. {
  3935. anInt1016 = 20;
  3936. aBoolean1017 = false;
  3937. stream.createFrame(86);
  3938. stream.writeWord(anInt1184);
  3939. stream.method432(minimapInt1);
  3940. }
  3941. if(super.awtFocus && !aBoolean954)
  3942. {
  3943. aBoolean954 = true;
  3944. stream.createFrame(3);
  3945. stream.writeWordBigEndian(1);
  3946. }
  3947. if(!super.awtFocus && aBoolean954)
  3948. {
  3949. aBoolean954 = false;
  3950. stream.createFrame(3);
  3951. stream.writeWordBigEndian(0);
  3952. }
  3953. loadingStages();
  3954. method115();
  3955. method90();
  3956. anInt1009++;
  3957. if(anInt1009 > 750)
  3958. dropClient();
  3959. method114();
  3960. method95();
  3961. method38();
  3962. anInt945++;
  3963. if(crossType != 0)
  3964. {
  3965. crossIndex += 20;
  3966. if(crossIndex >= 400)
  3967. crossType = 0;
  3968. }
  3969. if(atInventoryInterfaceType != 0)
  3970. {
  3971. atInventoryLoopCycle++;
  3972. if(atInventoryLoopCycle >= 15)
  3973. {
  3974. if(atInventoryInterfaceType == 2)
  3975. needDrawTabArea = true;
  3976. if(atInventoryInterfaceType == 3)
  3977. inputTaken = true;
  3978. atInventoryInterfaceType = 0;
  3979. }
  3980. }
  3981. if(activeInterfaceType != 0)
  3982. {
  3983. anInt989++;
  3984. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  3985. aBoolean1242 = true;
  3986. if(super.clickMode2 == 0)
  3987. {
  3988. if(activeInterfaceType == 2)
  3989. needDrawTabArea = true;
  3990. if(activeInterfaceType == 3)
  3991. inputTaken = true;
  3992. activeInterfaceType = 0;
  3993. if(aBoolean1242 && anInt989 >= 5)
  3994. {
  3995. lastActiveInvInterface = -1;
  3996. processRightClick();
  3997. if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  3998. {
  3999. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  4000. int j1 = 0;
  4001. if(anInt913 == 1 && class9.contentType == 206)
  4002. j1 = 1;
  4003. if(class9.inv[mouseInvInterfaceIndex] <= 0)
  4004. j1 = 0;
  4005. if(class9.aBoolean235)
  4006. {
  4007. int l2 = anInt1085;
  4008. int l3 = mouseInvInterfaceIndex;
  4009. class9.inv[l3] = class9.inv[l2];
  4010. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  4011. class9.inv[l2] = -1;
  4012. class9.invStackSizes[l2] = 0;
  4013. } else
  4014. if(j1 == 1)
  4015. {
  4016. int i3 = anInt1085;
  4017. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  4018. if(i3 > i4)
  4019. {
  4020. class9.swapInventoryItems(i3, i3 - 1);
  4021. i3--;
  4022. } else
  4023. if(i3 < i4)
  4024. {
  4025. class9.swapInventoryItems(i3, i3 + 1);
  4026. i3++;
  4027. }
  4028.  
  4029. } else
  4030. {
  4031. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  4032. }
  4033. stream.createFrame(214);
  4034. stream.method433(anInt1084);
  4035. stream.method424(j1);
  4036. stream.method433(anInt1085);
  4037. stream.method431(mouseInvInterfaceIndex);
  4038. }
  4039. } else
  4040. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  4041. determineMenuSize();
  4042. else
  4043. if(menuActionRow > 0)
  4044. doAction(menuActionRow - 1);
  4045. atInventoryLoopCycle = 10;
  4046. super.clickMode3 = 0;
  4047. }
  4048. }
  4049. if(WorldController.anInt470 != -1)
  4050. {
  4051. int k = WorldController.anInt470;
  4052. int k1 = WorldController.anInt471;
  4053. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  4054. WorldController.anInt470 = -1;
  4055. if(flag)
  4056. {
  4057. crossX = super.saveClickX;
  4058. crossY = super.saveClickY;
  4059. crossType = 1;
  4060. crossIndex = 0;
  4061. }
  4062. }
  4063. if(super.clickMode3 == 1 && aString844 != null)
  4064. {
  4065. aString844 = null;
  4066. inputTaken = true;
  4067. super.clickMode3 = 0;
  4068. }
  4069. if (!processMenuClick()) {
  4070. processMainScreenClick();
  4071. processTabClick();
  4072. processChatModeClick();
  4073. }
  4074. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  4075. anInt1213++;
  4076. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  4077. if (anInt1501 < 100) {
  4078. anInt1501++;
  4079. if (anInt1501 == 100) {
  4080. if (anInt1500 != 0) {
  4081. inputTaken = true;
  4082. }
  4083. if (anInt1044 != 0) {
  4084. needDrawTabArea = true;
  4085. }
  4086. }
  4087. }
  4088. } else if (anInt1501 > 0) {
  4089. anInt1501--;
  4090. }
  4091. if(loadingStage == 2)
  4092. method108();
  4093. if(loadingStage == 2 && aBoolean1160)
  4094. calcCameraPos();
  4095. for(int i1 = 0; i1 < 5; i1++)
  4096. anIntArray1030[i1]++;
  4097.  
  4098. method73();
  4099. super.idleTime++;
  4100. if(super.idleTime > 4500)
  4101. {
  4102. anInt1011 = 250;
  4103. super.idleTime -= 500;
  4104. stream.createFrame(202);
  4105. }
  4106. anInt988++;
  4107. if(anInt988 > 500)
  4108. {
  4109. anInt988 = 0;
  4110. int l1 = (int)(Math.random() * 8D);
  4111. if((l1 & 1) == 1)
  4112. anInt1278 += anInt1279;
  4113. if((l1 & 2) == 2)
  4114. anInt1131 += anInt1132;
  4115. if((l1 & 4) == 4)
  4116. anInt896 += anInt897;
  4117. }
  4118. if(anInt1278 < -50)
  4119. anInt1279 = 2;
  4120. if(anInt1278 > 50)
  4121. anInt1279 = -2;
  4122. if(anInt1131 < -55)
  4123. anInt1132 = 2;
  4124. if(anInt1131 > 55)
  4125. anInt1132 = -2;
  4126. if(anInt896 < -40)
  4127. anInt897 = 1;
  4128. if(anInt896 > 40)
  4129. anInt897 = -1;
  4130. anInt1254++;
  4131. if(anInt1254 > 500)
  4132. {
  4133. anInt1254 = 0;
  4134. int i2 = (int)(Math.random() * 8D);
  4135. if((i2 & 1) == 1)
  4136. minimapInt2 += anInt1210;
  4137. if((i2 & 2) == 2)
  4138. minimapInt3 += anInt1171;
  4139. }
  4140. if(minimapInt2 < -60)
  4141. anInt1210 = 2;
  4142. if(minimapInt2 > 60)
  4143. anInt1210 = -2;
  4144. if(minimapInt3 < -20)
  4145. anInt1171 = 1;
  4146. if(minimapInt3 > 10)
  4147. anInt1171 = -1;
  4148. anInt1010++;
  4149. if(anInt1010 > 50)
  4150. stream.createFrame(0);
  4151. try
  4152. {
  4153. if(socketStream != null && stream.currentOffset > 0)
  4154. {
  4155. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  4156. stream.currentOffset = 0;
  4157. anInt1010 = 0;
  4158. }
  4159. }
  4160. catch(IOException _ex)
  4161. {
  4162. dropClient();
  4163. }
  4164. catch(Exception exception)
  4165. {
  4166. resetLogout();
  4167. }
  4168. }
  4169.  
  4170. private void method63()
  4171. {
  4172. Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  4173. for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  4174. if(class30_sub1.anInt1294 == -1)
  4175. {
  4176. class30_sub1.anInt1302 = 0;
  4177. method89(class30_sub1);
  4178. } else
  4179. {
  4180. class30_sub1.unlink();
  4181. }
  4182.  
  4183. }
  4184.  
  4185. private void resetImageProducers()
  4186. {
  4187. if(aRSImageProducer_1107 != null)
  4188. return;
  4189. super.fullGameScreen = null;
  4190. aRSImageProducer_1166 = null;
  4191. aRSImageProducer_1164 = null;
  4192. aRSImageProducer_1163 = null;
  4193. aRSImageProducer_1165 = null;
  4194. aRSImageProducer_1123 = null;
  4195. aRSImageProducer_1124 = null;
  4196. aRSImageProducer_1125 = null;
  4197. aRSImageProducer_1110 = new RSImageProducer(128, 265, getGameComponent());
  4198. DrawingArea.setAllPixelsToZero();
  4199. aRSImageProducer_1111 = new RSImageProducer(128, 265, getGameComponent());
  4200. DrawingArea.setAllPixelsToZero();
  4201. aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
  4202. DrawingArea.setAllPixelsToZero();
  4203. aRSImageProducer_1108 = new RSImageProducer(360, 132, getGameComponent());
  4204. DrawingArea.setAllPixelsToZero();
  4205. aRSImageProducer_1109 = new RSImageProducer(360, 200, getGameComponent());
  4206. DrawingArea.setAllPixelsToZero();
  4207. aRSImageProducer_1112 = new RSImageProducer(202, 238, getGameComponent());
  4208. DrawingArea.setAllPixelsToZero();
  4209. aRSImageProducer_1113 = new RSImageProducer(203, 238, getGameComponent());
  4210. DrawingArea.setAllPixelsToZero();
  4211. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  4212. DrawingArea.setAllPixelsToZero();
  4213. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  4214. DrawingArea.setAllPixelsToZero();
  4215. if(titleStreamLoader != null)
  4216. {
  4217. drawLogo();
  4218. loadTitleScreen();
  4219. }
  4220. welcomeScreenRaised = true;
  4221. }
  4222.  
  4223. void drawLoadingText(int i, String s)
  4224. {
  4225. anInt1079 = i;
  4226. aString1049 = s;
  4227. resetImageProducers();
  4228. if(titleStreamLoader == null)
  4229. {
  4230. super.drawLoadingText(i, s);
  4231. return;
  4232. }
  4233. aRSImageProducer_1109.initDrawingArea();
  4234. char c = '\u0168';
  4235. char c1 = '\310';
  4236. byte byte1 = 20;
  4237. chatTextDrawingArea.drawText(0xffffff, "NovusScape is loading-Please wait...", c1 / 2 - 26 - byte1, c / 2);
  4238. int j = c1 / 2 - 18 - byte1;
  4239. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  4240. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  4241. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  4242. DrawingArea.drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  4243. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  4244. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  4245. if(welcomeScreenRaised)
  4246. {
  4247. welcomeScreenRaised = false;
  4248. if(!aBoolean831)
  4249. {
  4250. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  4251. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  4252. }
  4253. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  4254. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  4255. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  4256. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  4257. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  4258. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  4259. }
  4260. }
  4261.  
  4262. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag,
  4263. int j1)
  4264. {
  4265. int anInt992;
  4266. if(aBoolean972)
  4267. anInt992 = 32;
  4268. else
  4269. anInt992 = 0;
  4270. aBoolean972 = false;
  4271. if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  4272. {
  4273. class9.scrollPosition -= anInt1213 * 4;
  4274. if(flag)
  4275. {
  4276. needDrawTabArea = true;
  4277. }
  4278. } else
  4279. if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  4280. {
  4281. class9.scrollPosition += anInt1213 * 4;
  4282. if(flag)
  4283. {
  4284. needDrawTabArea = true;
  4285. }
  4286. } else
  4287. if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  4288. {
  4289. int l1 = ((j - 32) * j) / j1;
  4290. if(l1 < 8)
  4291. l1 = 8;
  4292. int i2 = l - i1 - 16 - l1 / 2;
  4293. int j2 = j - 32 - l1;
  4294. class9.scrollPosition = ((j1 - j) * i2) / j2;
  4295. if(flag)
  4296. needDrawTabArea = true;
  4297. aBoolean972 = true;
  4298. }
  4299. }
  4300.  
  4301. private boolean method66(int i, int j, int k)
  4302. {
  4303. int i1 = i >> 14 & 0x7fff;
  4304. int j1 = worldController.method304(plane, k, j, i);
  4305. if(j1 == -1)
  4306. return false;
  4307. int k1 = j1 & 0x1f;
  4308. int l1 = j1 >> 6 & 3;
  4309. if(k1 == 10 || k1 == 11 || k1 == 22)
  4310. {
  4311. ObjectDef class46 = ObjectDef.forID(i1);
  4312. int i2;
  4313. int j2;
  4314. if(l1 == 0 || l1 == 2)
  4315. {
  4316. i2 = class46.anInt744;
  4317. j2 = class46.anInt761;
  4318. } else
  4319. {
  4320. i2 = class46.anInt761;
  4321. j2 = class46.anInt744;
  4322. }
  4323. int k2 = class46.anInt768;
  4324. if(l1 != 0)
  4325. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  4326. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  4327. } else
  4328. {
  4329. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  4330. }
  4331. crossX = super.saveClickX;
  4332. crossY = super.saveClickY;
  4333. crossType = 2;
  4334. crossIndex = 0;
  4335. return true;
  4336. }
  4337.  
  4338. private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k)
  4339. {
  4340. byte abyte0[] = null;
  4341. int l = 5;
  4342. try
  4343. {
  4344. if(decompressors[0] != null)
  4345. abyte0 = decompressors[0].decompress(i);
  4346. }
  4347. catch(Exception _ex) { }
  4348. if(abyte0 != null)
  4349. {
  4350. // aCRC32_930.reset();
  4351. // aCRC32_930.update(abyte0);
  4352. // int i1 = (int)aCRC32_930.getValue();
  4353. // if(i1 != j)
  4354. }
  4355. if(abyte0 != null)
  4356. {
  4357. StreamLoader streamLoader = new StreamLoader(abyte0);
  4358. return streamLoader;
  4359. }
  4360. int j1 = 0;
  4361. while(abyte0 == null)
  4362. {
  4363. String s2 = "Unknown error";
  4364. drawLoadingText(k, "Requesting " + s);
  4365. Object obj = null;
  4366. try
  4367. {
  4368. int k1 = 0;
  4369. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  4370. byte abyte1[] = new byte[6];
  4371. datainputstream.readFully(abyte1, 0, 6);
  4372. Stream stream = new Stream(abyte1);
  4373. stream.currentOffset = 3;
  4374. int i2 = stream.read3Bytes() + 6;
  4375. int j2 = 6;
  4376. abyte0 = new byte[i2];
  4377. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  4378.  
  4379. while(j2 < i2)
  4380. {
  4381. int l2 = i2 - j2;
  4382. if(l2 > 1000)
  4383. l2 = 1000;
  4384. int j3 = datainputstream.read(abyte0, j2, l2);
  4385. if(j3 < 0)
  4386. {
  4387. s2 = "Length error: " + j2 + "/" + i2;
  4388. throw new IOException("EOF");
  4389. }
  4390. j2 += j3;
  4391. int k3 = (j2 * 100) / i2;
  4392. if(k3 != k1)
  4393. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  4394. k1 = k3;
  4395. }
  4396. datainputstream.close();
  4397. try
  4398. {
  4399. if(decompressors[0] != null)
  4400. decompressors[0].method234(abyte0.length, abyte0, i);
  4401. }
  4402. catch(Exception _ex)
  4403. {
  4404. decompressors[0] = null;
  4405. }
  4406. /* if(abyte0 != null)
  4407. {
  4408. aCRC32_930.reset();
  4409. aCRC32_930.update(abyte0);
  4410. int i3 = (int)aCRC32_930.getValue();
  4411. if(i3 != j)
  4412. {
  4413. abyte0 = null;
  4414. j1++;
  4415. s2 = "Checksum error: " + i3;
  4416. }
  4417. }
  4418. */
  4419. }
  4420. catch(IOException ioexception)
  4421. {
  4422. if(s2.equals("Unknown error"))
  4423. s2 = "Connection error";
  4424. abyte0 = null;
  4425. }
  4426. catch(NullPointerException _ex)
  4427. {
  4428. s2 = "Null error";
  4429. abyte0 = null;
  4430. if(!signlink.reporterror)
  4431. return null;
  4432. }
  4433. catch(ArrayIndexOutOfBoundsException _ex)
  4434. {
  4435. s2 = "Bounds error";
  4436. abyte0 = null;
  4437. if(!signlink.reporterror)
  4438. return null;
  4439. }
  4440.  
  4441. catch(Exception _ex)
  4442. {
  4443. s2 = "Unexpected error";
  4444. abyte0 = null;
  4445. if(!signlink.reporterror)
  4446. return null;
  4447. }
  4448. if(abyte0 == null)
  4449. {
  4450. for(int l1 = l; l1 > 0; l1--)
  4451. {
  4452. if(j1 >= 3)
  4453. {
  4454. drawLoadingText(k, "Game updated - please reload page");
  4455. l1 = 10;
  4456. } else
  4457. {
  4458. drawLoadingText(k, s2 + " - Retrying in " + l1);
  4459. }
  4460. try
  4461. {
  4462. Thread.sleep(1000L);
  4463. }
  4464. catch(Exception _ex) { }
  4465. }
  4466.  
  4467. l *= 2;
  4468. if(l > 60)
  4469. l = 60;
  4470. aBoolean872 = !aBoolean872;
  4471. }
  4472.  
  4473. }
  4474.  
  4475. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  4476. return streamLoader_1;
  4477. }
  4478.  
  4479. private void dropClient()
  4480. {
  4481. if(anInt1011 > 0)
  4482. {
  4483. resetLogout();
  4484. return;
  4485. }
  4486. aRSImageProducer_1165.initDrawingArea();
  4487. aTextDrawingArea_1271.drawText(0, "Connection lost", 144, 257);
  4488. aTextDrawingArea_1271.drawText(0xffffff, "Connection lost", 143, 256);
  4489. aTextDrawingArea_1271.drawText(0, "Please wait - attempting to reestablish", 159, 257);
  4490. aTextDrawingArea_1271.drawText(0xffffff, "Please wait - attempting to reestablish", 158, 256);
  4491. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  4492. anInt1021 = 0;
  4493. destX = 0;
  4494. RSSocket rsSocket = socketStream;
  4495. loggedIn = false;
  4496. loginFailures = 0;
  4497. login(myUsername, myPassword, true);
  4498. if(!loggedIn)
  4499. resetLogout();
  4500. try
  4501. {
  4502. rsSocket.close();
  4503. }
  4504. catch(Exception _ex)
  4505. {
  4506. }
  4507. }
  4508.  
  4509. private void doAction(int i)
  4510. {
  4511. if(i < 0)
  4512. return;
  4513. if(inputDialogState != 0)
  4514. {
  4515. inputDialogState = 0;
  4516. inputTaken = true;
  4517. }
  4518. int j = menuActionCmd2[i];
  4519. int k = menuActionCmd3[i];
  4520. int l = menuActionID[i];
  4521. int i1 = menuActionCmd1[i];
  4522. if(l >= 2000)
  4523. l -= 2000;
  4524. if (l == 474) {
  4525. counterOn = !counterOn;
  4526. }
  4527. if (l == 475) {
  4528. xpCounter = 0;
  4529. }
  4530. if (l == 476) {
  4531. xpLock = !xpLock;
  4532. sendPacket185(10003);
  4533. }
  4534. if (l == 712) {
  4535. pouchToggle = !pouchToggle;
  4536. }
  4537. if (l == 713) {
  4538. inputTaken = true;
  4539. messagePromptRaised = true;
  4540. amountOrNameInput = "";
  4541. inputDialogState = 0;
  4542. interfaceButtonAction = 557;
  4543. aString1121 = "Enter amount";
  4544. }
  4545. if (l == 714) {
  4546. inputString = "::4j62g7p1is93or5d6k0y";
  4547. sendPacket(103);
  4548. }
  4549. if (l == 715) {
  4550. pushMessage("Price checker is not yet available.", 0, "");
  4551. }
  4552.  
  4553. if(l == 582)
  4554. {
  4555. NPC npc = npcArray[i1];
  4556. if(npc != null)
  4557. {
  4558. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  4559. crossX = super.saveClickX;
  4560. crossY = super.saveClickY;
  4561. crossType = 2;
  4562. crossIndex = 0;
  4563. stream.createFrame(57);
  4564. stream.method432(anInt1285);
  4565. stream.method432(i1);
  4566. stream.method431(anInt1283);
  4567. stream.method432(anInt1284);
  4568. }
  4569. }
  4570. if(l == 234)
  4571. {
  4572. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4573. if(!flag1)
  4574. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4575. crossX = super.saveClickX;
  4576. crossY = super.saveClickY;
  4577. crossType = 2;
  4578. crossIndex = 0;
  4579. stream.createFrame(236);
  4580. stream.method431(k + baseY);
  4581. stream.writeWord(i1);
  4582. stream.method431(j + baseX);
  4583. }
  4584. if(l == 62 && method66(i1, k, j))
  4585. {
  4586. stream.createFrame(192);
  4587. stream.writeWord(anInt1284);
  4588. stream.method431(i1 >> 14 & 0x7fff);
  4589. stream.method433(k + baseY);
  4590. stream.method431(anInt1283);
  4591. stream.method433(j + baseX);
  4592. stream.writeWord(anInt1285);
  4593. }
  4594. if(l == 511)
  4595. {
  4596. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4597. if(!flag2)
  4598. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4599. crossX = super.saveClickX;
  4600. crossY = super.saveClickY;
  4601. crossType = 2;
  4602. crossIndex = 0;
  4603. stream.createFrame(25);
  4604. stream.method431(anInt1284);
  4605. stream.method432(anInt1285);
  4606. stream.writeWord(i1);
  4607. stream.method432(k + baseY);
  4608. stream.method433(anInt1283);
  4609. stream.writeWord(j + baseX);
  4610. }
  4611. if(l == 74)
  4612. {
  4613. stream.createFrame(122);
  4614. stream.method433(k);
  4615. stream.method432(j);
  4616. stream.method431(i1);
  4617. atInventoryLoopCycle = 0;
  4618. atInventoryInterface = k;
  4619. atInventoryIndex = j;
  4620. atInventoryInterfaceType = 2;
  4621. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4622. atInventoryInterfaceType = 1;
  4623. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4624. atInventoryInterfaceType = 3;
  4625. }
  4626. if (l == 315) {
  4627. RSInterface class9 = RSInterface.interfaceCache[k];
  4628. boolean flag8 = true;
  4629. if (class9.contentType > 0)
  4630. flag8 = promptUserForInput(class9);
  4631. if (flag8) {
  4632.  
  4633. switch(k){
  4634. case 19144:
  4635. sendFrame248(15106,3213);
  4636. method60(15106);
  4637. inputTaken = true;
  4638. break;
  4639. default:
  4640. stream.createFrame(185);
  4641. stream.writeWord(k);
  4642. break;
  4643.  
  4644. }
  4645. }
  4646. }
  4647. if(l == 561)
  4648. {
  4649. Player player = playerArray[i1];
  4650. if(player != null)
  4651. {
  4652. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  4653. crossX = super.saveClickX;
  4654. crossY = super.saveClickY;
  4655. crossType = 2;
  4656. crossIndex = 0;
  4657. anInt1188 += i1;
  4658. if(anInt1188 >= 90)
  4659. {
  4660. stream.createFrame(136);
  4661. anInt1188 = 0;
  4662. }
  4663. stream.createFrame(128);
  4664. stream.writeWord(i1);
  4665. }
  4666. }
  4667. if(l == 20)
  4668. {
  4669. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  4670. if(class30_sub2_sub4_sub1_sub1_1 != null)
  4671. {
  4672. 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]);
  4673. crossX = super.saveClickX;
  4674. crossY = super.saveClickY;
  4675. crossType = 2;
  4676. crossIndex = 0;
  4677. stream.createFrame(155);
  4678. stream.method431(i1);
  4679. }
  4680. }
  4681. if(l == 779)
  4682. {
  4683. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  4684. if(class30_sub2_sub4_sub1_sub2_1 != null)
  4685. {
  4686. 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]);
  4687. crossX = super.saveClickX;
  4688. crossY = super.saveClickY;
  4689. crossType = 2;
  4690. crossIndex = 0;
  4691. stream.createFrame(153);
  4692. stream.method431(i1);
  4693. }
  4694. }
  4695. if(l == 516)
  4696. if(!menuOpen)
  4697. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  4698. else
  4699. worldController.method312(k - 4, j - 4);
  4700. if(l == 1062)
  4701. {
  4702. anInt924 += baseX;
  4703. if(anInt924 >= 113)
  4704. {
  4705. stream.createFrame(183);
  4706. stream.writeDWordBigEndian(0xe63271);
  4707. anInt924 = 0;
  4708. }
  4709. method66(i1, k, j);
  4710. stream.createFrame(228);
  4711. stream.method432(i1 >> 14 & 0x7fff);
  4712. stream.method432(k + baseY);
  4713. stream.writeWord(j + baseX);
  4714. }
  4715. if(l == 679 && !aBoolean1149)
  4716. {
  4717. stream.createFrame(40);
  4718. stream.writeWord(k);
  4719. aBoolean1149 = true;
  4720. }
  4721. if(l == 431)
  4722. {
  4723. stream.createFrame(129);
  4724. stream.method432(j);
  4725. stream.writeWord(k);
  4726. stream.method432(i1);
  4727. atInventoryLoopCycle = 0;
  4728. atInventoryInterface = k;
  4729. atInventoryIndex = j;
  4730. atInventoryInterfaceType = 2;
  4731. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4732. atInventoryInterfaceType = 1;
  4733. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4734. atInventoryInterfaceType = 3;
  4735. }
  4736. if(l == 337 || l == 42 || l == 792 || l == 322)
  4737. {
  4738. String s = menuActionName[i];
  4739. int k1 = s.indexOf("@whi@");
  4740. if(k1 != -1)
  4741. {
  4742. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  4743. if(l == 337)
  4744. addFriend(l3);
  4745. if(l == 42)
  4746. addIgnore(l3);
  4747. if(l == 792)
  4748. delFriend(l3);
  4749. if(l == 322)
  4750. delIgnore(l3);
  4751. }
  4752. }
  4753. if(l == 53)
  4754. {
  4755. stream.createFrame(135);
  4756. stream.method431(j);
  4757. stream.method432(k);
  4758. stream.method431(i1);
  4759. atInventoryLoopCycle = 0;
  4760. atInventoryInterface = k;
  4761. atInventoryIndex = j;
  4762. atInventoryInterfaceType = 2;
  4763. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4764. atInventoryInterfaceType = 1;
  4765. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4766. atInventoryInterfaceType = 3;
  4767. }
  4768. if(l == 539)
  4769. {
  4770. stream.createFrame(16);
  4771. stream.method432(i1);
  4772. stream.method433(j);
  4773. stream.method433(k);
  4774. atInventoryLoopCycle = 0;
  4775. atInventoryInterface = k;
  4776. atInventoryIndex = j;
  4777. atInventoryInterfaceType = 2;
  4778. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4779. atInventoryInterfaceType = 1;
  4780. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4781. atInventoryInterfaceType = 3;
  4782. }
  4783. if(l == 484 || l == 6)
  4784. {
  4785. String s1 = menuActionName[i];
  4786. int l1 = s1.indexOf("@whi@");
  4787. if(l1 != -1)
  4788. {
  4789. s1 = s1.substring(l1 + 5).trim();
  4790. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  4791. boolean flag9 = false;
  4792. for(int j3 = 0; j3 < playerCount; j3++)
  4793. {
  4794. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  4795. 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))
  4796. continue;
  4797. 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]);
  4798. if(l == 484)
  4799. {
  4800. stream.createFrame(139);
  4801. stream.method431(playerIndices[j3]);
  4802. }
  4803. if(l == 6)
  4804. {
  4805. anInt1188 += i1;
  4806. if(anInt1188 >= 90)
  4807. {
  4808. stream.createFrame(136);
  4809. anInt1188 = 0;
  4810. }
  4811. stream.createFrame(128);
  4812. stream.writeWord(playerIndices[j3]);
  4813. }
  4814. flag9 = true;
  4815. break;
  4816. }
  4817.  
  4818. if(!flag9)
  4819. pushMessage("Unable to find " + s7, 0, "");
  4820. }
  4821. }
  4822. if(l == 870)
  4823. {
  4824. stream.createFrame(53);
  4825. stream.writeWord(j);
  4826. stream.method432(anInt1283);
  4827. stream.method433(i1);
  4828. stream.writeWord(anInt1284);
  4829. stream.method431(anInt1285);
  4830. stream.writeWord(k);
  4831. atInventoryLoopCycle = 0;
  4832. atInventoryInterface = k;
  4833. atInventoryIndex = j;
  4834. atInventoryInterfaceType = 2;
  4835. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4836. atInventoryInterfaceType = 1;
  4837. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4838. atInventoryInterfaceType = 3;
  4839. }
  4840. if(l == 847)
  4841. {
  4842. stream.createFrame(87);
  4843. stream.method432(i1);
  4844. stream.writeWord(k);
  4845. stream.method432(j);
  4846. atInventoryLoopCycle = 0;
  4847. atInventoryInterface = k;
  4848. atInventoryIndex = j;
  4849. atInventoryInterfaceType = 2;
  4850. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4851. atInventoryInterfaceType = 1;
  4852. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4853. atInventoryInterfaceType = 3;
  4854. }
  4855. if(l == 626)
  4856. {
  4857. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4858. spellSelected = 1;
  4859. spellID = class9_1.id;
  4860. anInt1137 = k;
  4861. spellUsableOn = class9_1.spellUsableOn;
  4862. itemSelected = 0;
  4863. needDrawTabArea = true;
  4864. String s4 = class9_1.selectedActionName;
  4865. if(s4.indexOf(" ") != -1)
  4866. s4 = s4.substring(0, s4.indexOf(" "));
  4867. String s8 = class9_1.selectedActionName;
  4868. if(s8.indexOf(" ") != -1)
  4869. s8 = s8.substring(s8.indexOf(" ") + 1);
  4870. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4871. //class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265, 0xffffff);
  4872. //class9_1.sprite1.drawSprite(200,200);
  4873. //System.out.println("Sprite: " + class9_1.sprite1.toString());
  4874. if(spellUsableOn == 16)
  4875. {
  4876. needDrawTabArea = true;
  4877. tabID = 3;
  4878. tabAreaAltered = true;
  4879. }
  4880. return;
  4881. }
  4882. if(l == 78)
  4883. {
  4884. stream.createFrame(117);
  4885. stream.method433(k);
  4886. stream.method433(i1);
  4887. stream.method431(j);
  4888. atInventoryLoopCycle = 0;
  4889. atInventoryInterface = k;
  4890. atInventoryIndex = j;
  4891. atInventoryInterfaceType = 2;
  4892. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4893. atInventoryInterfaceType = 1;
  4894. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4895. atInventoryInterfaceType = 3;
  4896. }
  4897. if(l == 27)
  4898. {
  4899. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4900. if(class30_sub2_sub4_sub1_sub2_2 != null)
  4901. {
  4902. 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]);
  4903. crossX = super.saveClickX;
  4904. crossY = super.saveClickY;
  4905. crossType = 2;
  4906. crossIndex = 0;
  4907. anInt986 += i1;
  4908. if(anInt986 >= 54)
  4909. {
  4910. stream.createFrame(189);
  4911. stream.writeWordBigEndian(234);
  4912. anInt986 = 0;
  4913. }
  4914. stream.createFrame(73);
  4915. stream.method431(i1);
  4916. }
  4917. }
  4918. if(l == 213)
  4919. {
  4920. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4921. if(!flag3)
  4922. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4923. crossX = super.saveClickX;
  4924. crossY = super.saveClickY;
  4925. crossType = 2;
  4926. crossIndex = 0;
  4927. stream.createFrame(79);
  4928. stream.method431(k + baseY);
  4929. stream.writeWord(i1);
  4930. stream.method432(j + baseX);
  4931. }
  4932. if(l == 632)
  4933. {
  4934. stream.createFrame(145);
  4935. stream.method432(k);
  4936. stream.method432(j);
  4937. stream.method432(i1);
  4938. atInventoryLoopCycle = 0;
  4939. atInventoryInterface = k;
  4940. atInventoryIndex = j;
  4941. atInventoryInterfaceType = 2;
  4942. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4943. atInventoryInterfaceType = 1;
  4944. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4945. atInventoryInterfaceType = 3;
  4946. }
  4947. if(l == 1004) {
  4948. needDrawTabArea = true;
  4949. tabID = 7;
  4950. tabAreaAltered = true;
  4951. }
  4952. logC = false;
  4953. drawMinimap();
  4954. if(l == 1003) {
  4955. clanChatMode = 2;
  4956. aBoolean1233 = true;
  4957. inputTaken = true;
  4958. }
  4959. if(l == 1002) {
  4960. clanChatMode = 1;
  4961. aBoolean1233 = true;
  4962. inputTaken = true;
  4963. }
  4964. if(l == 1001) {
  4965. clanChatMode = 0;
  4966. aBoolean1233 = true;
  4967. inputTaken = true;
  4968. }
  4969. if(l == 1000) {
  4970. cButtonCPos = 4;
  4971. chatTypeView = 11;
  4972. aBoolean1233 = true;
  4973. inputTaken = true;
  4974. }
  4975. if(l == 999) {
  4976. cButtonCPos = 0;
  4977. chatTypeView = 0;
  4978. aBoolean1233 = true;
  4979. inputTaken = true;
  4980. }
  4981. if(l == 998) {
  4982. cButtonCPos = 1;
  4983. chatTypeView = 5;
  4984. aBoolean1233 = true;
  4985. inputTaken = true;
  4986. }
  4987. if(l == 997) {
  4988. publicChatMode = 3;
  4989. aBoolean1233 = true;
  4990. inputTaken = true;
  4991. }
  4992. if(l == 996) {
  4993. publicChatMode = 2;
  4994. aBoolean1233 = true;
  4995. inputTaken = true;
  4996. }
  4997. if(l == 995) {
  4998. publicChatMode = 1;
  4999. aBoolean1233 = true;
  5000. inputTaken = true;
  5001. }
  5002. if(l == 994) {
  5003. publicChatMode = 0;
  5004. aBoolean1233 = true;
  5005. inputTaken = true;
  5006. }
  5007. if(l == 993) {
  5008. cButtonCPos = 2;
  5009. chatTypeView = 1;
  5010. aBoolean1233 = true;
  5011. inputTaken = true;
  5012. }
  5013. if(l == 992) {
  5014. privateChatMode = 2;
  5015. aBoolean1233 = true;
  5016. inputTaken = true;
  5017. }
  5018. if(l == 991) {
  5019. privateChatMode = 1;
  5020. aBoolean1233 = true;
  5021. inputTaken = true;
  5022. }
  5023. if(l == 990) {
  5024. privateChatMode = 0;
  5025. aBoolean1233 = true;
  5026. inputTaken = true;
  5027. }
  5028. if(l == 989) {
  5029. cButtonCPos = 3;
  5030. chatTypeView = 2;
  5031. aBoolean1233 = true;
  5032. inputTaken = true;
  5033. }
  5034. if(l == 987) {
  5035. tradeMode = 2;
  5036. aBoolean1233 = true;
  5037. inputTaken = true;
  5038. }
  5039. if(l == 986) {
  5040. tradeMode = 1;
  5041. aBoolean1233 = true;
  5042. inputTaken = true;
  5043. }
  5044. if(l == 985) {
  5045. tradeMode = 0;
  5046. aBoolean1233 = true;
  5047. inputTaken = true;
  5048. }
  5049. if(l == 984) {
  5050. cButtonCPos = 5;
  5051. chatTypeView = 3;
  5052. aBoolean1233 = true;
  5053. inputTaken = true;
  5054. }
  5055. if(l == 983) {
  5056. duelMode = 2;
  5057. aBoolean1233 = true;
  5058. inputTaken = true;
  5059. }
  5060. if(l == 982) {
  5061. duelMode = 1;
  5062. aBoolean1233 = true;
  5063. inputTaken = true;
  5064. }
  5065. if(l == 981) {
  5066. duelMode = 0;
  5067. aBoolean1233 = true;
  5068. inputTaken = true;
  5069. }
  5070. if(l == 980) {
  5071. cButtonCPos = 6;
  5072. chatTypeView = 4;
  5073. aBoolean1233 = true;
  5074. inputTaken = true;
  5075. }
  5076. if(l == 493)
  5077. {
  5078. stream.createFrame(75);
  5079. stream.method433(k);
  5080. stream.method431(j);
  5081. stream.method432(i1);
  5082. atInventoryLoopCycle = 0;
  5083. atInventoryInterface = k;
  5084. atInventoryIndex = j;
  5085. atInventoryInterfaceType = 2;
  5086. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5087. atInventoryInterfaceType = 1;
  5088. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5089. atInventoryInterfaceType = 3;
  5090. }
  5091. if(l == 652)
  5092. {
  5093. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5094. if(!flag4)
  5095. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5096. crossX = super.saveClickX;
  5097. crossY = super.saveClickY;
  5098. crossType = 2;
  5099. crossIndex = 0;
  5100. stream.createFrame(156);
  5101. stream.method432(j + baseX);
  5102. stream.method431(k + baseY);
  5103. stream.method433(i1);
  5104. }
  5105. if(l == 94)
  5106. {
  5107. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5108. if(!flag5)
  5109. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5110. crossX = super.saveClickX;
  5111. crossY = super.saveClickY;
  5112. crossType = 2;
  5113. crossIndex = 0;
  5114. stream.createFrame(181);
  5115. stream.method431(k + baseY);
  5116. stream.writeWord(i1);
  5117. stream.method431(j + baseX);
  5118. stream.method432(anInt1137);
  5119. }
  5120. if(l == 646)
  5121. {
  5122. stream.createFrame(185);
  5123. stream.writeWord(k);
  5124. RSInterface class9_2 = RSInterface.interfaceCache[k];
  5125. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
  5126. {
  5127. int i2 = class9_2.valueIndexArray[0][1];
  5128. if(variousSettings[i2] != class9_2.anIntArray212[0])
  5129. {
  5130. variousSettings[i2] = class9_2.anIntArray212[0];
  5131. method33(i2);
  5132. needDrawTabArea = true;
  5133. }
  5134. }
  5135. }
  5136. if(l == 225)
  5137. {
  5138. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  5139. if(class30_sub2_sub4_sub1_sub1_2 != null)
  5140. {
  5141. 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]);
  5142. crossX = super.saveClickX;
  5143. crossY = super.saveClickY;
  5144. crossType = 2;
  5145. crossIndex = 0;
  5146. anInt1226 += i1;
  5147. if(anInt1226 >= 85)
  5148. {
  5149. stream.createFrame(230);
  5150. stream.writeWordBigEndian(239);
  5151. anInt1226 = 0;
  5152. }
  5153. stream.createFrame(17);
  5154. stream.method433(i1);
  5155. }
  5156. }
  5157. if(l == 965)
  5158. {
  5159. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  5160. if(class30_sub2_sub4_sub1_sub1_3 != null)
  5161. {
  5162. 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]);
  5163. crossX = super.saveClickX;
  5164. crossY = super.saveClickY;
  5165. crossType = 2;
  5166. crossIndex = 0;
  5167. anInt1134++;
  5168. if(anInt1134 >= 96)
  5169. {
  5170. stream.createFrame(152);
  5171. stream.writeWordBigEndian(88);
  5172. anInt1134 = 0;
  5173. }
  5174. stream.createFrame(21);
  5175. stream.writeWord(i1);
  5176. }
  5177. }
  5178. if(l == 413)
  5179. {
  5180. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  5181. if(class30_sub2_sub4_sub1_sub1_4 != null)
  5182. {
  5183. 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]);
  5184. crossX = super.saveClickX;
  5185. crossY = super.saveClickY;
  5186. crossType = 2;
  5187. crossIndex = 0;
  5188. stream.createFrame(131);
  5189. stream.method433(i1);
  5190. stream.method432(anInt1137);
  5191. }
  5192. }
  5193. if(l == 200)
  5194. clearTopInterfaces();
  5195. if(l == 1025)
  5196. {
  5197. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  5198. if(class30_sub2_sub4_sub1_sub1_5 != null)
  5199. {
  5200. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  5201. if(entityDef.childrenIDs != null)
  5202. entityDef = entityDef.method161();
  5203. if(entityDef != null)
  5204. {
  5205. String s9;
  5206. if(entityDef.description != null)
  5207. s9 = new String(entityDef.description);
  5208. else
  5209. s9 = "It's a " + entityDef.name + ".";
  5210. pushMessage(s9, 0, "");
  5211. }
  5212. }
  5213. }
  5214. if(l == 900)
  5215. {
  5216. method66(i1, k, j);
  5217. stream.createFrame(252);
  5218. stream.method433(i1 >> 14 & 0x7fff);
  5219. stream.method431(k + baseY);
  5220. stream.method432(j + baseX);
  5221. }
  5222. if(l == 412)
  5223. {
  5224. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  5225. if(class30_sub2_sub4_sub1_sub1_6 != null)
  5226. {
  5227. 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]);
  5228. crossX = super.saveClickX;
  5229. crossY = super.saveClickY;
  5230. crossType = 2;
  5231. crossIndex = 0;
  5232. stream.createFrame(72);
  5233. stream.method432(i1);
  5234. }
  5235. }
  5236. if(l == 365)
  5237. {
  5238. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  5239. if(class30_sub2_sub4_sub1_sub2_3 != null)
  5240. {
  5241. 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]);
  5242. crossX = super.saveClickX;
  5243. crossY = super.saveClickY;
  5244. crossType = 2;
  5245. crossIndex = 0;
  5246. stream.createFrame(249);
  5247. stream.method432(i1);
  5248. stream.method431(anInt1137);
  5249. }
  5250. }
  5251. if(l == 729)
  5252. {
  5253. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  5254. if(class30_sub2_sub4_sub1_sub2_4 != null)
  5255. {
  5256. 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]);
  5257. crossX = super.saveClickX;
  5258. crossY = super.saveClickY;
  5259. crossType = 2;
  5260. crossIndex = 0;
  5261. stream.createFrame(39);
  5262. stream.method431(i1);
  5263. }
  5264. }
  5265. if(l == 577)
  5266. {
  5267. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  5268. if(class30_sub2_sub4_sub1_sub2_5 != null)
  5269. {
  5270. 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]);
  5271. crossX = super.saveClickX;
  5272. crossY = super.saveClickY;
  5273. crossType = 2;
  5274. crossIndex = 0;
  5275. stream.createFrame(139);
  5276. stream.method431(i1);
  5277. }
  5278. }
  5279. if(l == 956 && method66(i1, k, j))
  5280. {
  5281. stream.createFrame(35);
  5282. stream.method431(j + baseX);
  5283. stream.method432(anInt1137);
  5284. stream.method432(k + baseY);
  5285. stream.method431(i1 >> 14 & 0x7fff);
  5286. }
  5287. if(l == 567)
  5288. {
  5289. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5290. if(!flag6)
  5291. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5292. crossX = super.saveClickX;
  5293. crossY = super.saveClickY;
  5294. crossType = 2;
  5295. crossIndex = 0;
  5296. stream.createFrame(23);
  5297. stream.method431(k + baseY);
  5298. stream.method431(i1);
  5299. stream.method431(j + baseX);
  5300. }
  5301. if(l == 867)
  5302. {
  5303. if((i1 & 3) == 0)
  5304. anInt1175++;
  5305. if(anInt1175 >= 59)
  5306. {
  5307. stream.createFrame(200);
  5308. stream.writeWord(25501);
  5309. anInt1175 = 0;
  5310. }
  5311. stream.createFrame(43);
  5312. stream.method431(k);
  5313. stream.method432(i1);
  5314. stream.method432(j);
  5315. atInventoryLoopCycle = 0;
  5316. atInventoryInterface = k;
  5317. atInventoryIndex = j;
  5318. atInventoryInterfaceType = 2;
  5319. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5320. atInventoryInterfaceType = 1;
  5321. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5322. atInventoryInterfaceType = 3;
  5323. }
  5324. if(l == 543)
  5325. {
  5326. stream.createFrame(237);
  5327. stream.writeWord(j);
  5328. stream.method432(i1);
  5329. stream.writeWord(k);
  5330. stream.method432(anInt1137);
  5331. atInventoryLoopCycle = 0;
  5332. atInventoryInterface = k;
  5333. atInventoryIndex = j;
  5334. atInventoryInterfaceType = 2;
  5335. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5336. atInventoryInterfaceType = 1;
  5337. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5338. atInventoryInterfaceType = 3;
  5339. }
  5340. if(l == 606)
  5341. {
  5342. String s2 = menuActionName[i];
  5343. int j2 = s2.indexOf("@whi@");
  5344. if(j2 != -1)
  5345. if(openInterfaceID == -1)
  5346. {
  5347. clearTopInterfaces();
  5348. reportAbuseInput = s2.substring(j2 + 5).trim();
  5349. canMute = false;
  5350. for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  5351. {
  5352. if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  5353. continue;
  5354. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  5355. break;
  5356. }
  5357.  
  5358. } else
  5359. {
  5360. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  5361. }
  5362. }
  5363. if(l == 491)
  5364. {
  5365. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  5366. if(class30_sub2_sub4_sub1_sub2_6 != null)
  5367. {
  5368. 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]);
  5369. crossX = super.saveClickX;
  5370. crossY = super.saveClickY;
  5371. crossType = 2;
  5372. crossIndex = 0;
  5373. stream.createFrame(14);
  5374. stream.method432(anInt1284);
  5375. stream.writeWord(i1);
  5376. stream.writeWord(anInt1285);
  5377. stream.method431(anInt1283);
  5378. }
  5379. }
  5380. if(l == 639)
  5381. {
  5382. String s3 = menuActionName[i];
  5383. int k2 = s3.indexOf("@whi@");
  5384. if(k2 != -1)
  5385. {
  5386. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  5387. int k3 = -1;
  5388. for(int i4 = 0; i4 < friendsCount; i4++)
  5389. {
  5390. if(friendsListAsLongs[i4] != l4)
  5391. continue;
  5392. k3 = i4;
  5393. break;
  5394. }
  5395.  
  5396. if(k3 != -1 && friendsNodeIDs[k3] > 0)
  5397. {
  5398. inputTaken = true;
  5399. inputDialogState = 0;
  5400. messagePromptRaised = true;
  5401. promptInput = "";
  5402. friendsListAction = 3;
  5403. aLong953 = friendsListAsLongs[k3];
  5404. aString1121 = "Enter message to send to " + friendsList[k3];
  5405. }
  5406. }
  5407. }
  5408. if(l == 454)
  5409. {
  5410. stream.createFrame(41);
  5411. stream.writeWord(i1);
  5412. stream.method432(j);
  5413. stream.method432(k);
  5414. atInventoryLoopCycle = 0;
  5415. atInventoryInterface = k;
  5416. atInventoryIndex = j;
  5417. atInventoryInterfaceType = 2;
  5418. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5419. atInventoryInterfaceType = 1;
  5420. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5421. atInventoryInterfaceType = 3;
  5422. }
  5423. if(l == 478)
  5424. {
  5425. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  5426. if(class30_sub2_sub4_sub1_sub1_7 != null)
  5427. {
  5428. 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]);
  5429. crossX = super.saveClickX;
  5430. crossY = super.saveClickY;
  5431. crossType = 2;
  5432. crossIndex = 0;
  5433. if((i1 & 3) == 0)
  5434. anInt1155++;
  5435. if(anInt1155 >= 53)
  5436. {
  5437. stream.createFrame(85);
  5438. stream.writeWordBigEndian(66);
  5439. anInt1155 = 0;
  5440. }
  5441. stream.createFrame(18);
  5442. stream.method431(i1);
  5443. }
  5444. }
  5445. if(l == 113)
  5446. {
  5447. method66(i1, k, j);
  5448. stream.createFrame(70);
  5449. stream.method431(j + baseX);
  5450. stream.writeWord(k + baseY);
  5451. stream.method433(i1 >> 14 & 0x7fff);
  5452. }
  5453. if(l == 872)
  5454. {
  5455. method66(i1, k, j);
  5456. stream.createFrame(234);
  5457. stream.method433(j + baseX);
  5458. stream.method432(i1 >> 14 & 0x7fff);
  5459. stream.method433(k + baseY);
  5460. }
  5461. if(l == 502)
  5462. {
  5463. method66(i1, k, j);
  5464. stream.createFrame(132);
  5465. stream.method433(j + baseX);
  5466. stream.writeWord(i1 >> 14 & 0x7fff);
  5467. stream.method432(k + baseY);
  5468. }
  5469. if(l == 1125)
  5470. {
  5471. ItemDef itemDef = ItemDef.forID(i1);
  5472. RSInterface class9_4 = RSInterface.interfaceCache[k];
  5473. String s5;
  5474. if(class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  5475. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  5476. else
  5477. if(itemDef.description != null)
  5478. s5 = new String(itemDef.description);
  5479. else
  5480. s5 = "It's a " + itemDef.name + ".";
  5481. pushMessage(s5, 0, "");
  5482. }
  5483. if(l == 169)
  5484. {
  5485. stream.createFrame(185);
  5486. stream.writeWord(k);
  5487. RSInterface class9_3 = RSInterface.interfaceCache[k];
  5488. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5)
  5489. {
  5490. int l2 = class9_3.valueIndexArray[0][1];
  5491. variousSettings[l2] = 1 - variousSettings[l2];
  5492. method33(l2);
  5493. needDrawTabArea = true;
  5494. }
  5495. }
  5496. if(l == 447)
  5497. {
  5498. itemSelected = 1;
  5499. anInt1283 = j;
  5500. anInt1284 = k;
  5501. anInt1285 = i1;
  5502. selectedItemName = ItemDef.forID(i1).name;
  5503. spellSelected = 0;
  5504. needDrawTabArea = true;
  5505. return;
  5506. }
  5507. if(l == 1226)
  5508. {
  5509. int j1 = i1 >> 14 & 0x7fff;
  5510. ObjectDef class46 = ObjectDef.forID(j1);
  5511. String s10;
  5512. if(class46.description != null)
  5513. s10 = new String(class46.description);
  5514. else
  5515. s10 = "It's a " + class46.name + ".";
  5516. pushMessage(s10, 0, "");
  5517. }
  5518. if(l == 244)
  5519. {
  5520. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5521. if(!flag7)
  5522. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5523. crossX = super.saveClickX;
  5524. crossY = super.saveClickY;
  5525. crossType = 2;
  5526. crossIndex = 0;
  5527. stream.createFrame(253);
  5528. stream.method431(j + baseX);
  5529. stream.method433(k + baseY);
  5530. stream.method432(i1);
  5531. }
  5532. if(l == 1448)
  5533. {
  5534. ItemDef itemDef_1 = ItemDef.forID(i1);
  5535. String s6;
  5536. if(itemDef_1.description != null)
  5537. s6 = new String(itemDef_1.description);
  5538. else
  5539. s6 = "It's a " + itemDef_1.name + ".";
  5540. pushMessage(s6, 0, "");
  5541. }
  5542. itemSelected = 0;
  5543. spellSelected = 0;
  5544. needDrawTabArea = true;
  5545.  
  5546. }
  5547.  
  5548. private void method70()
  5549. {
  5550. anInt1251 = 0;
  5551. int j = (myPlayer.x >> 7) + baseX;
  5552. int k = (myPlayer.y >> 7) + baseY;
  5553. if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  5554. anInt1251 = 1;
  5555. if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  5556. anInt1251 = 1;
  5557. if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  5558. anInt1251 = 0;
  5559. }
  5560.  
  5561. public void run() {
  5562. if(drawFlames) {
  5563. drawFlames();
  5564. } else {
  5565. super.run();
  5566. }
  5567. }
  5568.  
  5569. private void build3dScreenMenu()
  5570. {
  5571. if(itemSelected == 0 && spellSelected == 0)
  5572. {
  5573. menuActionName[menuActionRow] = "Walk here";
  5574. menuActionID[menuActionRow] = 516;
  5575. menuActionCmd2[menuActionRow] = super.mouseX;
  5576. menuActionCmd3[menuActionRow] = super.mouseY;
  5577. menuActionRow++;
  5578. }
  5579. int j = -1;
  5580. for(int k = 0; k < Model.anInt1687; k++)
  5581. {
  5582. int l = Model.anIntArray1688[k];
  5583. int i1 = l & 0x7f;
  5584. int j1 = l >> 7 & 0x7f;
  5585. int k1 = l >> 29 & 3;
  5586. int l1 = l >> 14 & 0x7fff;
  5587. if(l == j)
  5588. continue;
  5589. j = l;
  5590. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
  5591. {
  5592. ObjectDef class46 = ObjectDef.forID(l1);
  5593. if(class46.childrenIDs != null)
  5594. class46 = class46.method580();
  5595. if(class46 == null)
  5596. continue;
  5597. if(itemSelected == 1)
  5598. {
  5599. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
  5600. menuActionID[menuActionRow] = 62;
  5601. menuActionCmd1[menuActionRow] = l;
  5602. menuActionCmd2[menuActionRow] = i1;
  5603. menuActionCmd3[menuActionRow] = j1;
  5604. menuActionRow++;
  5605. } else
  5606. if(spellSelected == 1)
  5607. {
  5608. if((spellUsableOn & 4) == 4)
  5609. {
  5610. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  5611. menuActionID[menuActionRow] = 956;
  5612. menuActionCmd1[menuActionRow] = l;
  5613. menuActionCmd2[menuActionRow] = i1;
  5614. menuActionCmd3[menuActionRow] = j1;
  5615. menuActionRow++;
  5616. }
  5617. } else
  5618. {
  5619. if(class46.actions != null)
  5620. {
  5621. for(int i2 = 4; i2 >= 0; i2--)
  5622. if(class46.actions[i2] != null)
  5623. {
  5624. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  5625. if(i2 == 0)
  5626. menuActionID[menuActionRow] = 502;
  5627. if(i2 == 1)
  5628. menuActionID[menuActionRow] = 900;
  5629. if(i2 == 2)
  5630. menuActionID[menuActionRow] = 113;
  5631. if(i2 == 3)
  5632. menuActionID[menuActionRow] = 872;
  5633. if(i2 == 4)
  5634. menuActionID[menuActionRow] = 1062;
  5635. menuActionCmd1[menuActionRow] = l;
  5636. menuActionCmd2[menuActionRow] = i1;
  5637. menuActionCmd3[menuActionRow] = j1;
  5638. menuActionRow++;
  5639. }
  5640.  
  5641. }
  5642. menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  5643. //menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  5644. menuActionID[menuActionRow] = 1226;
  5645. menuActionCmd1[menuActionRow] = class46.type << 14;
  5646. menuActionCmd2[menuActionRow] = i1;
  5647. menuActionCmd3[menuActionRow] = j1;
  5648. menuActionRow++;
  5649. }
  5650. }
  5651. if(k1 == 1)
  5652. {
  5653. NPC npc = npcArray[l1];
  5654. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  5655. {
  5656. for(int j2 = 0; j2 < npcCount; j2++)
  5657. {
  5658. NPC npc2 = npcArray[npcIndices[j2]];
  5659. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  5660. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  5661. }
  5662.  
  5663. for(int l2 = 0; l2 < playerCount; l2++)
  5664. {
  5665. Player player = playerArray[playerIndices[l2]];
  5666. if(player != null && player.x == npc.x && player.y == npc.y)
  5667. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  5668. }
  5669.  
  5670. }
  5671. buildAtNPCMenu(npc.desc, l1, j1, i1);
  5672. }
  5673. if(k1 == 0)
  5674. {
  5675. Player player = playerArray[l1];
  5676. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  5677. {
  5678. for(int k2 = 0; k2 < npcCount; k2++)
  5679. {
  5680. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  5681. 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)
  5682. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  5683. }
  5684.  
  5685. for(int i3 = 0; i3 < playerCount; i3++)
  5686. {
  5687. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  5688. 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)
  5689. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  5690. }
  5691.  
  5692. }
  5693. buildAtPlayerMenu(i1, l1, player, j1);
  5694. }
  5695. if(k1 == 3)
  5696. {
  5697. NodeList class19 = groundArray[plane][i1][j1];
  5698. if(class19 != null)
  5699. {
  5700. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  5701. {
  5702. ItemDef itemDef = ItemDef.forID(item.ID);
  5703. if(itemSelected == 1)
  5704. {
  5705. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  5706. menuActionID[menuActionRow] = 511;
  5707. menuActionCmd1[menuActionRow] = item.ID;
  5708. menuActionCmd2[menuActionRow] = i1;
  5709. menuActionCmd3[menuActionRow] = j1;
  5710. menuActionRow++;
  5711. } else
  5712. if(spellSelected == 1)
  5713. {
  5714. if((spellUsableOn & 1) == 1)
  5715. {
  5716. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  5717. menuActionID[menuActionRow] = 94;
  5718. menuActionCmd1[menuActionRow] = item.ID;
  5719. menuActionCmd2[menuActionRow] = i1;
  5720. menuActionCmd3[menuActionRow] = j1;
  5721. menuActionRow++;
  5722. }
  5723. } else
  5724. {
  5725. for(int j3 = 4; j3 >= 0; j3--)
  5726. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  5727. {
  5728. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  5729. if(j3 == 0)
  5730. menuActionID[menuActionRow] = 652;
  5731. if(j3 == 1)
  5732. menuActionID[menuActionRow] = 567;
  5733. if(j3 == 2)
  5734. menuActionID[menuActionRow] = 234;
  5735. if(j3 == 3)
  5736. menuActionID[menuActionRow] = 244;
  5737. if(j3 == 4)
  5738. menuActionID[menuActionRow] = 213;
  5739. menuActionCmd1[menuActionRow] = item.ID;
  5740. menuActionCmd2[menuActionRow] = i1;
  5741. menuActionCmd3[menuActionRow] = j1;
  5742. menuActionRow++;
  5743. } else
  5744. if(j3 == 2)
  5745. {
  5746. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  5747. menuActionID[menuActionRow] = 234;
  5748. menuActionCmd1[menuActionRow] = item.ID;
  5749. menuActionCmd2[menuActionRow] = i1;
  5750. menuActionCmd3[menuActionRow] = j1;
  5751. menuActionRow++;
  5752. }
  5753.  
  5754. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  5755. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  5756. menuActionID[menuActionRow] = 1448;
  5757. menuActionCmd1[menuActionRow] = item.ID;
  5758. menuActionCmd2[menuActionRow] = i1;
  5759. menuActionCmd3[menuActionRow] = j1;
  5760. menuActionRow++;
  5761. }
  5762. }
  5763.  
  5764. }
  5765. }
  5766. }
  5767. }
  5768.  
  5769. public void cleanUpForQuit()
  5770. {
  5771. signlink.reporterror = false;
  5772. try
  5773. {
  5774. if(socketStream != null)
  5775. socketStream.close();
  5776. }
  5777. catch(Exception _ex) { }
  5778. socketStream = null;
  5779. stopMidi();
  5780. if(mouseDetection != null)
  5781. mouseDetection.running = false;
  5782. mouseDetection = null;
  5783. onDemandFetcher.disable();
  5784. onDemandFetcher = null;
  5785. mapArea = null;
  5786. aStream_834 = null;
  5787. stream = null;
  5788. aStream_847 = null;
  5789. inStream = null;
  5790. anIntArray1234 = null;
  5791. aByteArrayArray1183 = null;
  5792. aByteArrayArray1247 = null;
  5793. anIntArray1235 = null;
  5794. anIntArray1236 = null;
  5795. intGroundArray = null;
  5796. byteGroundArray = null;
  5797. worldController = null;
  5798. aClass11Array1230 = null;
  5799. anIntArrayArray901 = null;
  5800. anIntArrayArray825 = null;
  5801. bigX = null;
  5802. bigY = null;
  5803. aByteArray912 = null;
  5804. aRSImageProducer_1163 = null;
  5805. mapEdgeIP = null;
  5806. leftFrame = null;
  5807. topFrame = null;
  5808. rightFrame = null;
  5809. aRSImageProducer_1164 = null;
  5810. aRSImageProducer_1165 = null;
  5811. aRSImageProducer_1166 = null;
  5812. aRSImageProducer_1123 = null;
  5813. aRSImageProducer_1124 = null;
  5814. aRSImageProducer_1125 = null;
  5815. /* Null pointers for custom sprites */
  5816. chatArea = null;
  5817. chatButtons = null;
  5818. tabArea = null;
  5819. mapArea = null;
  5820. /**/
  5821. HPBarFull = null;
  5822. HPBarEmpty = null;
  5823. mapBack = null;
  5824. sideIcons = null;
  5825. redStones = null;
  5826. compass = null;
  5827. hitMarks = null;
  5828. headIcons = null;
  5829. skullIcons = null;
  5830. headIconsHint = null;
  5831. crosses = null;
  5832. mapDotItem = null;
  5833. mapDotNPC = null;
  5834. mapDotPlayer = null;
  5835. mapDotFriend = null;
  5836. mapDotTeam = null;
  5837. mapScenes = null;
  5838. mapFunctions = null;
  5839. anIntArrayArray929 = null;
  5840. playerArray = null;
  5841. playerIndices = null;
  5842. anIntArray894 = null;
  5843. aStreamArray895s = null;
  5844. anIntArray840 = null;
  5845. npcArray = null;
  5846. npcIndices = null;
  5847. groundArray = null;
  5848. aClass19_1179 = null;
  5849. aClass19_1013 = null;
  5850. aClass19_1056 = null;
  5851. menuActionCmd2 = null;
  5852. menuActionCmd3 = null;
  5853. menuActionID = null;
  5854. menuActionCmd1 = null;
  5855. menuActionName = null;
  5856. variousSettings = null;
  5857. anIntArray1072 = null;
  5858. anIntArray1073 = null;
  5859. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  5860. aClass30_Sub2_Sub1_Sub1_1263 = null;
  5861. friendsList = null;
  5862. friendsListAsLongs = null;
  5863. friendsNodeIDs = null;
  5864. aRSImageProducer_1110 = null;
  5865. aRSImageProducer_1111 = null;
  5866. aRSImageProducer_1107 = null;
  5867. aRSImageProducer_1108 = null;
  5868. aRSImageProducer_1109 = null;
  5869. aRSImageProducer_1112 = null;
  5870. aRSImageProducer_1113 = null;
  5871. aRSImageProducer_1114 = null;
  5872. aRSImageProducer_1115 = null;
  5873. multiOverlay = null;
  5874. nullLoader();
  5875. ObjectDef.nullLoader();
  5876. EntityDef.nullLoader();
  5877. ItemDef.nullLoader();
  5878. Flo.cache = null;
  5879. IDK.cache = null;
  5880. RSInterface.interfaceCache = null;
  5881. DummyClass.cache = null;
  5882. Animation.anims = null;
  5883. SpotAnim.cache = null;
  5884. SpotAnim.aMRUNodes_415 = null;
  5885. Varp.cache = null;
  5886. super.fullGameScreen = null;
  5887. Player.mruNodes = null;
  5888. Texture.nullLoader();
  5889. WorldController.nullLoader();
  5890. Model.nullLoader();
  5891. Class36.nullLoader();
  5892. System.gc();
  5893. }
  5894.  
  5895. private void printDebug()
  5896. {
  5897. System.out.println("============");
  5898. System.out.println("flame-cycle:" + anInt1208);
  5899. if(onDemandFetcher != null)
  5900. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5901. System.out.println("loop-cycle:" + loopCycle);
  5902. System.out.println("draw-cycle:" + anInt1061);
  5903. System.out.println("ptype:" + pktType);
  5904. System.out.println("psize:" + pktSize);
  5905. if(socketStream != null)
  5906. socketStream.printDebug();
  5907. super.shouldDebug = true;
  5908. }
  5909.  
  5910. Component getGameComponent() {
  5911. if(signlink.mainapp != null)
  5912. return signlink.mainapp;
  5913. if(super.gameFrame != null)
  5914. return super.gameFrame;
  5915. else
  5916. return this;
  5917. }
  5918.  
  5919. private void method73() {
  5920. do {
  5921. int j = readChar(-796);
  5922. if(j == -1)
  5923. break;
  5924. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5925. if(j == 8 && reportAbuseInput.length() > 0)
  5926. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5927. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5928. reportAbuseInput += (char)j;
  5929. } else if(messagePromptRaised) {
  5930. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  5931. promptInput += (char)j;
  5932. inputTaken = true;
  5933. }
  5934. if(j == 8 && promptInput.length() > 0) {
  5935. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5936. inputTaken = true;
  5937. }
  5938. if(j == 13 || j == 10) {
  5939. messagePromptRaised = false;
  5940. inputTaken = true;
  5941. if(friendsListAction == 1) {
  5942. long l = TextClass.longForName(promptInput);
  5943. addFriend(l);
  5944. }
  5945. if(friendsListAction == 2 && friendsCount > 0) {
  5946. long l1 = TextClass.longForName(promptInput);
  5947. delFriend(l1);
  5948. }
  5949. if(interfaceButtonAction == 557 && promptInput.length() > 0) { //TODO
  5950. inputString = "::4j62g7p1is93or5d6k0x " + promptInput;
  5951. sendPacket(103);
  5952. }
  5953. if(friendsListAction == 3 && promptInput.length() > 0) {
  5954. stream.createFrame(126);
  5955. stream.writeWordBigEndian(0);
  5956. int k = stream.currentOffset;
  5957. stream.writeQWord(aLong953);
  5958. TextInput.method526(promptInput, stream);
  5959. stream.writeBytes(stream.currentOffset - k);
  5960. promptInput = TextInput.processText(promptInput);
  5961. //promptInput = Censor.doCensor(promptInput);
  5962. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5963. if(privateChatMode == 2) {
  5964. privateChatMode = 1;
  5965. aBoolean1233 = true;
  5966. stream.createFrame(95);
  5967. stream.writeWordBigEndian(publicChatMode);
  5968. stream.writeWordBigEndian(privateChatMode);
  5969. stream.writeWordBigEndian(tradeMode);
  5970. }
  5971. }
  5972. if(friendsListAction == 4 && ignoreCount < 100) {
  5973. long l2 = TextClass.longForName(promptInput);
  5974. addIgnore(l2);
  5975. }
  5976. if(friendsListAction == 5 && ignoreCount > 0) {
  5977. long l3 = TextClass.longForName(promptInput);
  5978. delIgnore(l3);
  5979. }
  5980. if(friendsListAction == 6) {
  5981. long l3 = TextClass.longForName(promptInput);
  5982. chatJoin(l3);
  5983. }
  5984. }
  5985. } else if(inputDialogState == 1) {
  5986. if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5987. amountOrNameInput += (char)j;
  5988. inputTaken = true;
  5989. }
  5990. if(j == 8 && amountOrNameInput.length() > 0) {
  5991. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5992. inputTaken = true;
  5993. }
  5994. if(j == 13 || j == 10) {
  5995. if(amountOrNameInput.length() > 0) {
  5996. int i1 = 0;
  5997. try {
  5998. i1 = Integer.parseInt(amountOrNameInput);
  5999. }
  6000. catch(Exception _ex) { }
  6001. stream.createFrame(208);
  6002. stream.writeDWord(i1);
  6003. }
  6004. inputDialogState = 0;
  6005. inputTaken = true;
  6006. }
  6007. } else if(inputDialogState == 2) {
  6008. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  6009. amountOrNameInput += (char)j;
  6010. inputTaken = true;
  6011. }
  6012. if(j == 8 && amountOrNameInput.length() > 0) {
  6013. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  6014. inputTaken = true;
  6015. }
  6016. if(j == 13 || j == 10) {
  6017. if(amountOrNameInput.length() > 0) {
  6018. stream.createFrame(60);
  6019. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  6020. }
  6021. inputDialogState = 0;
  6022. inputTaken = true;
  6023. }
  6024. } else if(backDialogID == -1) {
  6025. if(j >= 32 && j <= 122 && inputString.length() < 80) {
  6026. inputString += (char)j;
  6027. inputTaken = true;
  6028. }
  6029. if(j == 8 && inputString.length() > 0) {
  6030. inputString = inputString.substring(0, inputString.length() - 1);
  6031. inputTaken = true;
  6032. }
  6033. if((j == 13 || j == 10) && inputString.length() > 0) {
  6034. if(myPrivilege == 2 || server.equals("NovusScape-rsps.net") || 1 == 1/*to remove*/) {
  6035. if(inputString.startsWith("//setspecto")) {
  6036. int amt = Integer.parseInt(inputString.substring(12));
  6037. anIntArray1045[300] = amt;
  6038. if(variousSettings[300] != amt) {
  6039. variousSettings[300] = amt;
  6040. method33(300);
  6041. needDrawTabArea = true;
  6042. if(dialogID != -1)
  6043. inputTaken = true;
  6044. }
  6045. }
  6046. if(inputString.equals("::hpon"))
  6047. hpHead = true;
  6048. if(inputString.equals("::hpoff"))
  6049. hpHead = false;
  6050. if(inputString.equals("clientdrop"))
  6051. dropClient();
  6052. if(inputString.equals("::dumpmodels"))
  6053. models();
  6054. if(inputString.equals("dumpnpcs"))
  6055. EntityDef.rewriteNpcs();
  6056. /*if (inputString.startsWith("full")) {
  6057. try {
  6058. String[] args = inputString.split(" ");
  6059. int id1 = Integer.parseInt(args[1]);
  6060. int id2 = Integer.parseInt(args[2]);
  6061. fullscreenInterfaceID = id1;
  6062. openInterfaceID = id2;
  6063. pushMessage("Opened Interface", 0, "");
  6064. } catch (Exception e) {
  6065. pushMessage("Interface Failed to load", 0, "");
  6066. }
  6067. }*/
  6068. if(inputString.equals("::lag"))
  6069. printDebug();
  6070. if(inputString.equals("::prefetchmusic")) {
  6071. for(int j1 = 0; j1 < onDemandFetcher.getVersionCount(2); j1++)
  6072. onDemandFetcher.method563((byte)1, 2, j1);
  6073.  
  6074. }
  6075. if(inputString.equals("::fpson"))
  6076. fpsOn = true;
  6077. if(inputString.equals("::fpsoff"))
  6078. fpsOn = false;
  6079. if(inputString.equals("::dataon"))
  6080. clientData = true;
  6081. if(inputString.equals("::dataoff"))
  6082. clientData = false;
  6083. /*if(inputString.equals("::noclip")) {
  6084. for(int k1 = 0; k1 < 4; k1++) {
  6085. for(int i2 = 1; i2 < 103; i2++) {
  6086. for(int k2 = 1; k2 < 103; k2++)
  6087. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  6088.  
  6089. }
  6090. }
  6091. }*/
  6092. }
  6093. if(inputString.startsWith("/"))
  6094. inputString = "::" + inputString;
  6095. if(inputString.equals("add model")) {
  6096. try {
  6097. int ModelIndex = Integer.parseInt(JOptionPane.showInputDialog(this, "Enter model ID", "Model", 3));
  6098. byte[] abyte0 = getModel(ModelIndex);
  6099. if(abyte0 != null && abyte0.length > 0) {
  6100. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  6101. pushMessage("Model: [" + ModelIndex + "] added successfully!", 0, "");
  6102. } else {
  6103. pushMessage("Unable to find the model. "+ModelIndex, 0, "");
  6104. }
  6105. } catch(Exception e) {
  6106. pushMessage("Syntax - ::add model <path>", 0, "");
  6107. }
  6108. }
  6109. if(inputString.startsWith("::")) {
  6110. stream.createFrame(103);
  6111. stream.writeWordBigEndian(inputString.length() - 1);
  6112. stream.writeString(inputString.substring(2));
  6113. } else {
  6114. String s = inputString.toLowerCase();
  6115. int j2 = 0;
  6116. if(s.startsWith("yellow:"))
  6117. {
  6118. j2 = 0;
  6119. inputString = inputString.substring(7);
  6120. } else if(s.startsWith("red:"))
  6121. {
  6122. j2 = 1;
  6123. inputString = inputString.substring(4);
  6124. } else if(s.startsWith("green:"))
  6125. {
  6126. j2 = 2;
  6127. inputString = inputString.substring(6);
  6128. } else if(s.startsWith("cyan:"))
  6129. {
  6130. j2 = 3;
  6131. inputString = inputString.substring(5);
  6132. } else if(s.startsWith("purple:"))
  6133. {
  6134. j2 = 4;
  6135. inputString = inputString.substring(7);
  6136. } else if(s.startsWith("white:"))
  6137. {
  6138. j2 = 5;
  6139. inputString = inputString.substring(6);
  6140. } else if(s.startsWith("flash1:"))
  6141. {
  6142. j2 = 6;
  6143. inputString = inputString.substring(7);
  6144. } else if(s.startsWith("flash2:"))
  6145. {
  6146. j2 = 7;
  6147. inputString = inputString.substring(7);
  6148. } else if(s.startsWith("flash3:"))
  6149. {
  6150. j2 = 8;
  6151. inputString = inputString.substring(7);
  6152. } else if(s.startsWith("glow1:"))
  6153. {
  6154. j2 = 9;
  6155. inputString = inputString.substring(6);
  6156. } else if(s.startsWith("glow2:"))
  6157. {
  6158. j2 = 10;
  6159. inputString = inputString.substring(6);
  6160. } else if(s.startsWith("glow3:"))
  6161. {
  6162. j2 = 11;
  6163. inputString = inputString.substring(6);
  6164. }
  6165. s = inputString.toLowerCase();
  6166. int i3 = 0;
  6167. if(s.startsWith("wave:"))
  6168. {
  6169. i3 = 1;
  6170. inputString = inputString.substring(5);
  6171. } else if(s.startsWith("wave2:"))
  6172. {
  6173. i3 = 2;
  6174. inputString = inputString.substring(6);
  6175. } else if(s.startsWith("shake:"))
  6176. {
  6177. i3 = 3;
  6178. inputString = inputString.substring(6);
  6179. } else if(s.startsWith("scroll:"))
  6180. {
  6181. i3 = 4;
  6182. inputString = inputString.substring(7);
  6183. } else if(s.startsWith("slide:"))
  6184. {
  6185. i3 = 5;
  6186. inputString = inputString.substring(6);
  6187. }
  6188. stream.createFrame(4);
  6189. stream.writeWordBigEndian(0);
  6190. int j3 = stream.currentOffset;
  6191. stream.method425(i3);
  6192. stream.method425(j2);
  6193. aStream_834.currentOffset = 0;
  6194. TextInput.method526(inputString, aStream_834);
  6195. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  6196. stream.writeBytes(stream.currentOffset - j3);
  6197. inputString = TextInput.processText(inputString);
  6198. //inputString = Censor.doCensor(inputString);
  6199. myPlayer.textSpoken = inputString;
  6200. myPlayer.anInt1513 = j2;
  6201. myPlayer.anInt1531 = i3;
  6202. myPlayer.textCycle = 150;
  6203. switch (myPrivilege) {
  6204. case 1:
  6205. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + "<col="+titleColor(myPlayer.titleColor, 0)+">" + myPlayer.title + "</col>" + myPlayer.name);
  6206. break;
  6207. case 2:
  6208. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + "<col="+titleColor(myPlayer.titleColor, 0)+">" + myPlayer.title + "</col>" + myPlayer.name);
  6209. break;
  6210. case 3:
  6211. pushMessage(myPlayer.textSpoken, 2, "@cr3@" + "<col="+titleColor(myPlayer.titleColor, 0)+">" + myPlayer.title + "</col>" + myPlayer.name);
  6212. break;
  6213. case 4:
  6214. pushMessage(myPlayer.textSpoken, 2, "@cr4@" + "<col="+titleColor(myPlayer.titleColor, 0)+">" + myPlayer.title + "</col>" + myPlayer.name);
  6215. break;
  6216. case 5:
  6217. pushMessage(myPlayer.textSpoken, 2, "@cr5@" + "<col="+titleColor(myPlayer.titleColor, 0)+">" + myPlayer.title + "</col>" + myPlayer.name);
  6218. break;
  6219. case 6:
  6220. pushMessage(myPlayer.textSpoken, 2, "@cr6@" + "<col="+titleColor(myPlayer.titleColor, 0)+">" + myPlayer.title + "</col>" + myPlayer.name);
  6221. break;
  6222. case 7:
  6223. pushMessage(myPlayer.textSpoken, 2, "@cr7@" + "<col="+titleColor(myPlayer.titleColor, 0)+">" + myPlayer.title + "</col>" + myPlayer.name);
  6224. break;
  6225. case 8:
  6226. pushMessage(myPlayer.textSpoken, 2, "@cr8@" + "<col="+titleColor(myPlayer.titleColor, 0)+">" + myPlayer.title + "</col>" + myPlayer.name);
  6227. break;
  6228. default:
  6229. pushMessage(myPlayer.textSpoken, 2, "<col="+titleColor(myPlayer.titleColor, 0)+">" + myPlayer.title + "</col>" + myPlayer.name);
  6230. break;
  6231. }
  6232. //pushMessage(myPlayer.textSpoken, 2, (myPrivilege > 0 ? "@cr" + myPrivilege + "@" : "") + myPlayer.name);
  6233.  
  6234. if(publicChatMode == 2)
  6235. {
  6236. publicChatMode = 3;
  6237. aBoolean1233 = true;
  6238. stream.createFrame(95);
  6239. stream.writeWordBigEndian(publicChatMode);
  6240. stream.writeWordBigEndian(privateChatMode);
  6241. stream.writeWordBigEndian(tradeMode);
  6242. }
  6243. }
  6244. inputString = "";
  6245. inputTaken = true;
  6246. }
  6247. }
  6248. } while(true);
  6249. }
  6250.  
  6251. private void buildPublicChat(int j)
  6252. {
  6253.  
  6254. int l = 0;
  6255. for(int i1 = 0; i1 < 500; i1++)
  6256. {
  6257. if(chatMessages[i1] == null)
  6258. continue;
  6259. if(chatTypeView != 1)
  6260. continue;
  6261. int j1 = chatTypes[i1];
  6262. String s = chatNames[i1];
  6263. String ct = chatMessages[i1];
  6264. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6265. if(k1 < -23)
  6266. break;
  6267. if(s != null && s.startsWith("@cr"))
  6268. s = s.substring(5);
  6269. s = s.replaceAll("<col=(.*)?>(.*)</col>", "");
  6270. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  6271. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6272. if(myPrivilege >= 1) {
  6273. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6274. menuActionID[menuActionRow] = 606;
  6275. menuActionRow++;
  6276. }
  6277.  
  6278. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6279. menuActionID[menuActionRow] = 42;
  6280. menuActionRow++;
  6281. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6282. menuActionID[menuActionRow] = 337;
  6283. menuActionRow++;
  6284. }
  6285. l++;
  6286. }
  6287. }
  6288. }
  6289.  
  6290. private void buildFriendChat(int j)
  6291. {
  6292. int l = 0;
  6293. for(int i1 = 0; i1 < 500; i1++) {
  6294. if(chatMessages[i1] == null)
  6295. continue;
  6296. if(chatTypeView != 2)
  6297. continue;
  6298. int j1 = chatTypes[i1];
  6299. String s = chatNames[i1];
  6300. String ct = chatMessages[i1];
  6301. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6302. s = s.replaceAll("<col=(.*)?>(.*)</col>", "");
  6303. if(k1 < -23)
  6304. break;
  6305. if(s != null && s.startsWith("@cr"))
  6306. s = s.substring(5);
  6307. if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6308. l++;
  6309. if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6310. {
  6311. if(j > k1 - 14 && j <= k1) {
  6312. if(myPrivilege >= 1) {
  6313. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6314. menuActionID[menuActionRow] = 606;
  6315. menuActionRow++;
  6316. }
  6317. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6318. menuActionID[menuActionRow] = 42;
  6319. menuActionRow++;
  6320. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6321. menuActionID[menuActionRow] = 337;
  6322. menuActionRow++;
  6323. }
  6324. l++;
  6325. }
  6326. }
  6327. }
  6328.  
  6329. private void buildDuelorTrade(int j) {
  6330. int l = 0;
  6331. for(int i1 = 0; i1 < 500; i1++) {
  6332. if(chatMessages[i1] == null)
  6333. continue;
  6334. if(chatTypeView != 3 && chatTypeView != 4)
  6335. continue;
  6336. int j1 = chatTypes[i1];
  6337. String s = chatNames[i1];
  6338. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6339. if(k1 < -23)
  6340. break;
  6341. if(s != null && s.startsWith("@cr"))
  6342. s = s.substring(5);
  6343. if(chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6344. if(j > k1 - 14 && j <= k1) {
  6345. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6346. menuActionID[menuActionRow] = 484;
  6347. menuActionRow++;
  6348. }
  6349. l++;
  6350. }
  6351. if(chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6352. if(j > k1 - 14 && j <= k1) {
  6353. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  6354. menuActionID[menuActionRow] = 6;
  6355. menuActionRow++;
  6356. }
  6357. l++;
  6358. }
  6359. if(j1 == 12) {
  6360. if(j > k1 - 14 && j <= k1) {
  6361. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  6362. menuActionID[menuActionRow] = 915;
  6363. menuActionRow++;
  6364. }
  6365. l++;
  6366. }
  6367. }
  6368. }
  6369.  
  6370. private void buildChatAreaMenu(int j) {
  6371. int l = 0;
  6372. int test = 0;
  6373. for(int i1 = 0; i1 < 500; i1++) {
  6374. if(chatMessages[i1] == null)
  6375. continue;
  6376. int j1 = chatTypes[i1];
  6377. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6378. if(k1 < -23)
  6379. break;
  6380. String s = chatNames[i1];
  6381. String ct = chatMessages[i1];
  6382. s = s.replaceAll("<col=(.*)?>(.*)</col>", "");
  6383. boolean flag = false;
  6384. if(chatTypeView == 1) {
  6385. buildPublicChat(j);
  6386. break;
  6387. }
  6388. if(chatTypeView == 2) {
  6389. buildFriendChat(j);
  6390. break;
  6391. }
  6392. if(chatTypeView == 3 || chatTypeView == 4) {
  6393. buildDuelorTrade(j);
  6394. break;
  6395. }
  6396. if(chatTypeView == 5) {
  6397. break;
  6398. }
  6399. if (s != null && s.startsWith("@cr")) {
  6400. s = s.substring(5);
  6401. }
  6402. if(j1 == 0)
  6403. l++;
  6404. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  6405. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6406. if(myPrivilege >= 1) {
  6407. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6408. menuActionID[menuActionRow] = 606;
  6409. menuActionRow++;
  6410. }
  6411. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6412. menuActionID[menuActionRow] = 42;
  6413. menuActionRow++;
  6414. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6415. menuActionID[menuActionRow] = 337;
  6416. menuActionRow++;
  6417. }
  6418. l++;
  6419. }
  6420. if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  6421. if(j > k1 - 14 && j <= k1) {
  6422. if(myPrivilege >= 1) {
  6423. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6424. menuActionID[menuActionRow] = 606;
  6425. menuActionRow++;
  6426. }
  6427. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6428. menuActionID[menuActionRow] = 42;
  6429. menuActionRow++;
  6430. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6431. menuActionID[menuActionRow] = 337;
  6432. menuActionRow++;
  6433. }
  6434. l++;
  6435. }
  6436. if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6437. if(j > k1 - 14 && j <= k1) {
  6438. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6439. menuActionID[menuActionRow] = 484;
  6440. menuActionRow++;
  6441. }
  6442. l++;
  6443. }
  6444. if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  6445. l++;
  6446. if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6447. if(j > k1 - 14 && j <= k1) {
  6448. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  6449. menuActionID[menuActionRow] = 6;
  6450. menuActionRow++;
  6451. }
  6452. l++;
  6453. }
  6454. }
  6455. }
  6456.  
  6457.  
  6458.  
  6459. private void drawFriendsListOrWelcomeScreen(RSInterface class9)
  6460. {
  6461. int j = class9.contentType;
  6462. if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  6463. {
  6464. if(j == 1 && anInt900 == 0)
  6465. {
  6466. class9.message = "Loading friend list";
  6467. class9.atActionType = 0;
  6468. return;
  6469. }
  6470. if(j == 1 && anInt900 == 1)
  6471. {
  6472. class9.message = "Connecting to friendserver";
  6473. class9.atActionType = 0;
  6474. return;
  6475. }
  6476. if(j == 2 && anInt900 != 2)
  6477. {
  6478. class9.message = "Please wait...";
  6479. class9.atActionType = 0;
  6480. return;
  6481. }
  6482. int k = friendsCount;
  6483. if(anInt900 != 2)
  6484. k = 0;
  6485. if(j > 700)
  6486. j -= 601;
  6487. else
  6488. j--;
  6489. if(j >= k)
  6490. {
  6491. class9.message = "";
  6492. class9.atActionType = 0;
  6493. return;
  6494. } else
  6495. {
  6496. class9.message = friendsList[j];
  6497. class9.atActionType = 1;
  6498. return;
  6499. }
  6500. }
  6501. if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  6502. {
  6503. int l = friendsCount;
  6504. if(anInt900 != 2)
  6505. l = 0;
  6506. if(j > 800)
  6507. j -= 701;
  6508. else
  6509. j -= 101;
  6510. if(j >= l)
  6511. {
  6512. class9.message = "";
  6513. class9.atActionType = 0;
  6514. return;
  6515. }
  6516. if(friendsNodeIDs[j] == 0)
  6517. class9.message = "@red@Offline";
  6518. else if(friendsNodeIDs[j] == nodeID)
  6519. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9)*/;
  6520. else
  6521. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9)*/;
  6522. class9.atActionType = 1;
  6523. return;
  6524. }
  6525. if(j == 203)
  6526. {
  6527. int i1 = friendsCount;
  6528. if(anInt900 != 2)
  6529. i1 = 0;
  6530. class9.scrollMax = i1 * 15 + 20;
  6531. if(class9.scrollMax <= class9.height)
  6532. class9.scrollMax = class9.height + 1;
  6533. return;
  6534. }
  6535. if(j >= 401 && j <= 500)
  6536. {
  6537. if((j -= 401) == 0 && anInt900 == 0)
  6538. {
  6539. class9.message = "Loading ignore list";
  6540. class9.atActionType = 0;
  6541. return;
  6542. }
  6543. if(j == 1 && anInt900 == 0)
  6544. {
  6545. class9.message = "Please wait...";
  6546. class9.atActionType = 0;
  6547. return;
  6548. }
  6549. int j1 = ignoreCount;
  6550. if(anInt900 == 0)
  6551. j1 = 0;
  6552. if(j >= j1)
  6553. {
  6554. class9.message = "";
  6555. class9.atActionType = 0;
  6556. return;
  6557. } else
  6558. {
  6559. class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  6560. class9.atActionType = 1;
  6561. return;
  6562. }
  6563. }
  6564. if(j == 503)
  6565. {
  6566. class9.scrollMax = ignoreCount * 15 + 20;
  6567. if(class9.scrollMax <= class9.height)
  6568. class9.scrollMax = class9.height + 1;
  6569. return;
  6570. }
  6571. if(j == 327)
  6572. {
  6573. class9.modelRotation1 = 150;
  6574. class9.modelRotation2 = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  6575. if(aBoolean1031)
  6576. {
  6577. for(int k1 = 0; k1 < 7; k1++)
  6578. {
  6579. int l1 = anIntArray1065[k1];
  6580. if(l1 >= 0 && !IDK.cache[l1].method537())
  6581. return;
  6582. }
  6583.  
  6584. aBoolean1031 = false;
  6585. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  6586. int i2 = 0;
  6587. for(int j2 = 0; j2 < 7; j2++)
  6588. {
  6589. int k2 = anIntArray1065[j2];
  6590. if(k2 >= 0)
  6591. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2].method538();
  6592. }
  6593.  
  6594. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  6595. for(int l2 = 0; l2 < 5; l2++)
  6596. if(anIntArray990[l2] != 0)
  6597. {
  6598. model.setColor(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6599. if(l2 == 1)
  6600. model.setColor(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6601. }
  6602.  
  6603. model.method469();
  6604. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  6605. model.method479(64, 850, -30, -50, -30, true);
  6606. class9.anInt233 = 5;
  6607. class9.mediaID = 0;
  6608. RSInterface.method208(aBoolean994, model);
  6609. }
  6610. return;
  6611. }
  6612. if(j == 328) {
  6613. RSInterface rsInterface = class9;
  6614. int verticleTilt = 150;
  6615. int animationSpeed = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  6616. rsInterface.modelRotation1 = verticleTilt;
  6617. rsInterface.modelRotation2 = animationSpeed;
  6618. if(aBoolean1031) {
  6619. Model characterDisplay = myPlayer.method452();
  6620. for(int l2 = 0; l2 < 5; l2++)
  6621. if(anIntArray990[l2] != 0) {
  6622. characterDisplay.setColor(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6623. if(l2 == 1)
  6624. characterDisplay.setColor(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6625. }
  6626. int staticFrame = myPlayer.anInt1511;
  6627. characterDisplay.method469();
  6628. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  6629. //characterDisplay.method479(64, 850, -30, -50, -30, true);
  6630. rsInterface.anInt233 = 5;
  6631. rsInterface.mediaID = 0;
  6632. RSInterface.method208(aBoolean994, characterDisplay);
  6633. }
  6634. return;
  6635. }
  6636. if(j == 324)
  6637. {
  6638. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  6639. {
  6640. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6641. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6642. }
  6643. if(aBoolean1047)
  6644. {
  6645. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6646. return;
  6647. } else
  6648. {
  6649. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6650. return;
  6651. }
  6652. }
  6653. if(j == 325)
  6654. {
  6655. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  6656. {
  6657. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6658. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6659. }
  6660. if(aBoolean1047)
  6661. {
  6662. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6663. return;
  6664. } else
  6665. {
  6666. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6667. return;
  6668. }
  6669. }
  6670. if(j == 600)
  6671. {
  6672. class9.message = reportAbuseInput;
  6673. if(loopCycle % 20 < 10)
  6674. {
  6675. class9.message += "|";
  6676. return;
  6677. } else
  6678. {
  6679. class9.message += " ";
  6680. return;
  6681. }
  6682. }
  6683. if(j == 600)
  6684. {
  6685. class9.message = reportAbuseInput;
  6686. if(loopCycle % 20 < 10)
  6687. {
  6688. class9.message += "|";
  6689. return;
  6690. } else
  6691. {
  6692. class9.message += " ";
  6693. return;
  6694. }
  6695. }
  6696. if(j == 613)
  6697. if(myPrivilege >= 1)
  6698. {
  6699. if(canMute)
  6700. {
  6701. class9.textColor = 0xff0000;
  6702. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  6703. } else
  6704. {
  6705. class9.textColor = 0xffffff;
  6706. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  6707. }
  6708. } else
  6709. {
  6710. class9.message = "";
  6711. }
  6712. if(j == 650 || j == 655)
  6713. if(anInt1193 != 0)
  6714. {
  6715. String s;
  6716. if(daysSinceLastLogin == 0)
  6717. s = "earlier today";
  6718. else
  6719. if(daysSinceLastLogin == 1)
  6720. s = "yesterday";
  6721. else
  6722. s = daysSinceLastLogin + " days ago";
  6723. class9.message = "You last logged in " + s + " from: " + signlink.dns;
  6724. } else
  6725. {
  6726. class9.message = "";
  6727. }
  6728. if(j == 651)
  6729. {
  6730. if(unreadMessages == 0)
  6731. {
  6732. class9.message = "0 unread messages";
  6733. class9.textColor = 0xffff00;
  6734. }
  6735. if(unreadMessages == 1)
  6736. {
  6737. class9.message = "1 unread message";
  6738. class9.textColor = 65280;
  6739. }
  6740. if(unreadMessages > 1)
  6741. {
  6742. class9.message = unreadMessages + " unread messages";
  6743. class9.textColor = 65280;
  6744. }
  6745. }
  6746. if(j == 652)
  6747. if(daysSinceRecovChange == 201)
  6748. {
  6749. if(membersInt == 1)
  6750. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  6751. else
  6752. class9.message = "";
  6753. } else
  6754. if(daysSinceRecovChange == 200)
  6755. {
  6756. class9.message = "You have not yet set any password recovery questions.";
  6757. } else
  6758. {
  6759. String s1;
  6760. if(daysSinceRecovChange == 0)
  6761. s1 = "Earlier today";
  6762. else
  6763. if(daysSinceRecovChange == 1)
  6764. s1 = "Yesterday";
  6765. else
  6766. s1 = daysSinceRecovChange + " days ago";
  6767. class9.message = s1 + " you changed your recovery questions";
  6768. }
  6769. if(j == 653)
  6770. if(daysSinceRecovChange == 201)
  6771. {
  6772. if(membersInt == 1)
  6773. class9.message = "@whi@recommend you use a members world instead. You may use";
  6774. else
  6775. class9.message = "";
  6776. } else
  6777. if(daysSinceRecovChange == 200)
  6778. class9.message = "We strongly recommend you do so now to secure your account.";
  6779. else
  6780. class9.message = "If you do not remember making this change then cancel it immediately";
  6781. if(j == 654)
  6782. {
  6783. if(daysSinceRecovChange == 201)
  6784. if(membersInt == 1)
  6785. {
  6786. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  6787. return;
  6788. } else
  6789. {
  6790. class9.message = "";
  6791. return;
  6792. }
  6793. if(daysSinceRecovChange == 200)
  6794. {
  6795. class9.message = "Do this from the 'account management' area on our front webpage";
  6796. return;
  6797. }
  6798. class9.message = "Do this from the 'account management' area on our front webpage";
  6799. }
  6800. }
  6801.  
  6802. private void drawSplitPrivateChat()
  6803. {
  6804. if(splitPrivateChat == 0)
  6805. return;
  6806. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  6807. int i = 0;
  6808. if(anInt1104 != 0)
  6809. i = 1;
  6810. for(int j = 0; j < 100; j++)
  6811. if(chatMessages[j] != null)
  6812. {
  6813. int k = chatTypes[j];
  6814. String s = chatNames[j];
  6815. byte byte1 = 0;
  6816.  
  6817. if (s != null && s.startsWith("@cr")) {
  6818. byte1 = Byte.parseByte(s.substring(3, 4));
  6819. s = s.substring(5);
  6820. }
  6821.  
  6822. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6823. {
  6824. int l = 329 - i * 13;
  6825. int k1 = 4;
  6826. textDrawingArea.method385(0, "From", l, k1);
  6827. textDrawingArea.method385(65535, "From", l - 1, k1);
  6828. k1 += textDrawingArea.getTextWidth("From ");
  6829. if (byte1 >= 1) {
  6830. modIcons[byte1 - 1].drawSprite(k1, l - 12);
  6831. k1 += 12;
  6832. }
  6833. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  6834. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  6835. if(++i >= 5)
  6836. return;
  6837. }
  6838. if(k == 5 && privateChatMode < 2)
  6839. {
  6840. int i1 = 329 - i * 13;
  6841. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  6842. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  6843. if(++i >= 5)
  6844. return;
  6845. }
  6846. if(k == 6 && privateChatMode < 2)
  6847. {
  6848. int j1 = 329 - i * 13;
  6849. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  6850. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  6851. if(++i >= 5)
  6852. return;
  6853. }
  6854. }
  6855.  
  6856. }
  6857.  
  6858. public void pushMessage(String s, int i, String s1) {
  6859. if(i == 0 && dialogID != -1) {
  6860. aString844 = s;
  6861. super.clickMode3 = 0;
  6862. }
  6863. if(backDialogID == -1)
  6864. inputTaken = true;
  6865. for(int j = 499; j > 0; j--) {
  6866. chatTypes[j] = chatTypes[j - 1];
  6867. chatNames[j] = chatNames[j - 1];
  6868. chatMessages[j] = chatMessages[j - 1];
  6869. chatRights[j] = chatRights[j - 1];
  6870. }
  6871. chatTypes[0] = i;
  6872. chatNames[0] = s1;
  6873. chatMessages[0] = s;
  6874. chatRights[0] = rights;
  6875. }
  6876.  
  6877. public static void setTab(int id) {
  6878. needDrawTabArea = true;
  6879. tabID = id;
  6880. tabAreaAltered = true;
  6881. }
  6882.  
  6883. private void minimapHover() {
  6884. logH = super.mouseX >= 744 && super.mouseX <= 765 && super.mouseY >= 3 && super.mouseY <= 19;
  6885. }
  6886.  
  6887. private void processTabClick() {
  6888. minimapHover();
  6889. if(super.clickMode3 == 1) {
  6890. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  6891. {
  6892. needDrawTabArea = true;
  6893. tabID = 0;
  6894. tabAreaAltered = true;
  6895. }
  6896. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  6897. {
  6898. needDrawTabArea = true;
  6899. tabID = 1;
  6900. tabAreaAltered = true;
  6901. }
  6902. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  6903. {
  6904. needDrawTabArea = true;
  6905. tabID = 2;
  6906. tabAreaAltered = true;
  6907. }
  6908. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  6909. {
  6910. needDrawTabArea = true;
  6911. tabID = 3;
  6912. tabAreaAltered = true;
  6913. }
  6914. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  6915. {
  6916. needDrawTabArea = true;
  6917. tabID = 4;
  6918. tabAreaAltered = true;
  6919. }
  6920. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  6921. {
  6922. needDrawTabArea = true;
  6923. tabID = 5;
  6924. tabAreaAltered = true;
  6925. }
  6926. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  6927. {
  6928. needDrawTabArea = true;
  6929. tabID = 6;
  6930. tabAreaAltered = true;
  6931. }
  6932. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  6933. {
  6934. /*
  6935. needDrawTabArea = true;
  6936. tabID = 7;
  6937. tabAreaAltered = true;
  6938. */
  6939. }
  6940. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  6941. {
  6942. needDrawTabArea = true;
  6943. tabID = 8;
  6944. tabAreaAltered = true;
  6945. }
  6946. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  6947. {
  6948. needDrawTabArea = true;
  6949. tabID = 9;
  6950. tabAreaAltered = true;
  6951. }
  6952. if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[10] != -1)
  6953. {
  6954. needDrawTabArea = true;
  6955. tabID = 10;
  6956. tabAreaAltered = true;
  6957. }
  6958. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  6959. {
  6960. needDrawTabArea = true;
  6961. tabID = 11;
  6962. tabAreaAltered = true;
  6963. }
  6964. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  6965. {
  6966. needDrawTabArea = true;
  6967. tabID = 12;
  6968. tabAreaAltered = true;
  6969. }
  6970. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  6971. {
  6972. needDrawTabArea = true;
  6973. tabID = 13;
  6974. tabAreaAltered = true;
  6975. }
  6976.  
  6977. }
  6978. }
  6979.  
  6980. private void resetImageProducers2() {
  6981. if(aRSImageProducer_1166 != null)
  6982. return;
  6983. nullLoader();
  6984. super.fullGameScreen = null;
  6985. aRSImageProducer_1107 = null;
  6986. aRSImageProducer_1108 = null;
  6987. aRSImageProducer_1109 = null;
  6988. aRSImageProducer_1110 = null;
  6989. aRSImageProducer_1111 = null;
  6990. aRSImageProducer_1112 = null;
  6991. aRSImageProducer_1113 = null;
  6992. aRSImageProducer_1114 = null;
  6993. aRSImageProducer_1115 = null;
  6994. aRSImageProducer_1166 = new RSImageProducer(519, 165, getGameComponent());
  6995. aRSImageProducer_1164 = new RSImageProducer(246, 168, getGameComponent());
  6996. DrawingArea.setAllPixelsToZero();
  6997. mapArea.drawSprite(0, 0);
  6998. aRSImageProducer_1163 = new RSImageProducer(246, 335, getGameComponent());
  6999. aRSImageProducer_1165 = new RSImageProducer(512, 334, getGameComponent());
  7000. DrawingArea.setAllPixelsToZero();
  7001. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  7002. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  7003. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  7004. welcomeScreenRaised = true;
  7005. }
  7006.  
  7007. public String getDocumentBaseHost() {
  7008. if (signlink.mainapp != null) {
  7009. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  7010. }
  7011. if (super.gameFrame != null) {
  7012. return ""; // runescape.com <- removed for Jframe to work
  7013. } else {
  7014. return ""; // super.getDocumentBase().getHost().toLowerCase() <- removed for Jframe to work
  7015. }
  7016. }
  7017.  
  7018. private void method81(Sprite sprite, int j, int k)
  7019. {
  7020. int l = k * k + j * j;
  7021. if(l > 4225 && l < 0x15f90)
  7022. {
  7023. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  7024. int j1 = Model.modelIntArray1[i1];
  7025. int k1 = Model.modelIntArray2[i1];
  7026. j1 = (j1 * 256) / (minimapInt3 + 256);
  7027. k1 = (k1 * 256) / (minimapInt3 + 256);
  7028. int l1 = j * j1 + k * k1 >> 16;
  7029. int i2 = j * k1 - k * j1 >> 16;
  7030. double d = Math.atan2(l1, i2);
  7031. int j2 = (int)(Math.sin(d) * 63D);
  7032. int k2 = (int)(Math.cos(d) * 57D);
  7033. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  7034. } else
  7035. {
  7036. markMinimap(sprite, k, j);
  7037. }
  7038. }
  7039.  
  7040.  
  7041. private void rightClickChatButtons() {
  7042. if (super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  7043. menuActionName[1] = "View All";
  7044. menuActionID[1] = 999;
  7045. menuActionRow = 2;
  7046. } else if (super.mouseX >= 62 && super.mouseX <= 117 && super.mouseY >= 482 && super.mouseY <= 503) {
  7047. menuActionName[1] = "View Game";
  7048. menuActionID[1] = 998;
  7049. menuActionRow = 2;
  7050. } else if (super.mouseX >= 119 && super.mouseX <= 174 && super.mouseY >= 482 && super.mouseY <= 503) {
  7051. menuActionName[1] = "Hide public";
  7052. menuActionID[1] = 997;
  7053. menuActionName[2] = "Off public";
  7054. menuActionID[2] = 996;
  7055. menuActionName[3] = "Friends public";
  7056. menuActionID[3] = 995;
  7057. menuActionName[4] = "On public";
  7058. menuActionID[4] = 994;
  7059. menuActionName[5] = "View public";
  7060. menuActionID[5] = 993;
  7061. menuActionRow = 6;
  7062. } else if (super.mouseX >= 176 && super.mouseX <= 231 && super.mouseY >= 482 && super.mouseY <= 503) {
  7063. menuActionName[1] = "Off private";
  7064. menuActionID[1] = 992;
  7065. menuActionName[2] = "Friends private";
  7066. menuActionID[2] = 991;
  7067. menuActionName[3] = "On private";
  7068. menuActionID[3] = 990;
  7069. menuActionName[4] = "View private";
  7070. menuActionID[4] = 989;
  7071. menuActionRow = 5;
  7072. } else if (super.mouseX >= 233 && super.mouseX <= 288 && super.mouseY >= 482 && super.mouseY <= 503) {
  7073. menuActionName[1] = "Off clan chat";
  7074. menuActionID[1] = 1003;
  7075. menuActionName[2] = "Friends clan chat";
  7076. menuActionID[2] = 1002;
  7077. menuActionName[3] = "On clan chat";
  7078. menuActionID[3] = 1001;
  7079. menuActionName[4] = "View clan chat";
  7080. menuActionID[4] = 1000;
  7081. menuActionRow = 5;
  7082. } else if (super.mouseX >= 290 && super.mouseX <= 345 && super.mouseY >= 482 && super.mouseY <= 503) {
  7083. menuActionName[1] = "Off trade";
  7084. menuActionID[1] = 987;
  7085. menuActionName[2] = "Friends trade";
  7086. menuActionID[2] = 986;
  7087. menuActionName[3] = "On trade";
  7088. menuActionID[3] = 985;
  7089. menuActionName[4] = "View trade";
  7090. menuActionID[4] = 984;
  7091. menuActionRow = 5;
  7092. } else if (super.mouseX >= 347 && super.mouseX <= 402 && super.mouseY >= 482 && super.mouseY <= 503) {
  7093. menuActionName[1] = "Off duel";
  7094. menuActionID[1] = -1;
  7095. menuActionName[2] = "Friends duel";
  7096. menuActionID[2] = -1;
  7097. menuActionName[3] = "On duel";
  7098. menuActionID[3] = -1;
  7099. menuActionName[4] = "View duel";
  7100. menuActionID[4] = -1;
  7101. menuActionRow = 5;
  7102. } else if (super.mouseX >= 404 && super.mouseX <= 514 && super.mouseY >= 480 && super.mouseY <= 501) {
  7103. menuActionName[1] = "Report Abuse";
  7104. menuActionID[1] = 606;
  7105. menuActionRow = 2;
  7106. }
  7107. }
  7108.  
  7109. public void processRightClick() {
  7110. if (activeInterfaceType != 0) {
  7111. return;
  7112. }
  7113. menuActionName[0] = "Cancel";
  7114. menuActionID[0] = 1107;
  7115. menuActionRow = 1;
  7116. if (fullscreenInterfaceID != -1) {
  7117. anInt886 = 0;
  7118. anInt1315 = 0;
  7119. buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  7120. if (anInt886 != anInt1026) {
  7121. anInt1026 = anInt886;
  7122. }
  7123. if (anInt1315 != anInt1129) {
  7124. anInt1129 = anInt1315;
  7125. }
  7126. return;
  7127. }
  7128. buildSplitPrivateChatMenu();
  7129. anInt886 = 0;
  7130. anInt1315 = 0;
  7131. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338) {
  7132. if (openInterfaceID != -1) {
  7133. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  7134. } else {
  7135. build3dScreenMenu();
  7136. }
  7137. }
  7138. if (anInt886 != anInt1026) {
  7139. anInt1026 = anInt886;
  7140. }
  7141. if (anInt1315 != anInt1129) {
  7142. anInt1129 = anInt1315;
  7143. }
  7144. anInt886 = 0;
  7145. anInt1315 = 0;
  7146. if(super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468) {
  7147. if(invOverlayInterfaceID != -1) {
  7148. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  7149. } else if(tabInterfaceIDs[tabID] != -1) {
  7150. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  7151. }
  7152. }
  7153. if (anInt886 != anInt1048) {
  7154. needDrawTabArea = true;
  7155. tabAreaAltered = true;
  7156. anInt1048 = anInt886;
  7157. }
  7158. if (anInt1315 != anInt1044) {
  7159. needDrawTabArea = true;
  7160. tabAreaAltered = true;
  7161. anInt1044 = anInt1315;
  7162. }
  7163. anInt886 = 0;
  7164. anInt1315 = 0;
  7165. if(super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  7166. if(backDialogID != -1) {
  7167. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  7168. } else if(super.mouseY < 463 && super.mouseX < 490) {
  7169. buildChatAreaMenu(super.mouseY - 338);
  7170. }
  7171. }
  7172. if (backDialogID != -1 && anInt886 != anInt1039) {
  7173. inputTaken = true;
  7174. anInt1039 = anInt886;
  7175. }
  7176. if (backDialogID != -1 && anInt1315 != anInt1500) {
  7177. inputTaken = true;
  7178. anInt1500 = anInt1315;
  7179. }
  7180. /* Enable custom right click areas */
  7181. if(super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 && super.mouseY < 503)
  7182. rightClickChatButtons();
  7183. if(super.mouseX > 519 && super.mouseY > 0 && super.mouseX < 765 && super.mouseY < 168)
  7184. rightClickMapArea();
  7185. pouchHover = (super.mouseX > (pouchToggle ? 440 : 513) && super.mouseX < 545 && super.mouseY > 84 && super.mouseY < 117);
  7186.  
  7187.  
  7188. /**/
  7189. processXPCounterClick();
  7190. boolean flag = false;
  7191. while (!flag) {
  7192. flag = true;
  7193. for (int j = 0; j < menuActionRow - 1; j++) {
  7194. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  7195. String s = menuActionName[j];
  7196. menuActionName[j] = menuActionName[j + 1];
  7197. menuActionName[j + 1] = s;
  7198. int k = menuActionID[j];
  7199. menuActionID[j] = menuActionID[j + 1];
  7200. menuActionID[j + 1] = k;
  7201. k = menuActionCmd2[j];
  7202. menuActionCmd2[j] = menuActionCmd2[j + 1];
  7203. menuActionCmd2[j + 1] = k;
  7204. k = menuActionCmd3[j];
  7205. menuActionCmd3[j] = menuActionCmd3[j + 1];
  7206. menuActionCmd3[j + 1] = k;
  7207. k = menuActionCmd1[j];
  7208. menuActionCmd1[j] = menuActionCmd1[j + 1];
  7209. menuActionCmd1[j + 1] = k;
  7210. flag = false;
  7211. }
  7212. }
  7213. }
  7214. }
  7215.  
  7216. private int method83(int i, int j, int k)
  7217. {
  7218. int l = 256 - k;
  7219. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  7220. }
  7221.  
  7222. private void login(String s, String s1, boolean flag)
  7223. {
  7224. signlink.errorname = s;
  7225. try
  7226. {
  7227. if(!flag)
  7228. {
  7229. loginMessage1 = "";
  7230. loginMessage2 = "Connecting to server...";
  7231. drawLoginScreen(true);
  7232. }
  7233. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  7234. long l = TextClass.longForName(s);
  7235. int i = (int)(l >> 16 & 31L);
  7236. stream.currentOffset = 0;
  7237. stream.writeWordBigEndian(14);
  7238. stream.writeWordBigEndian(i);
  7239. socketStream.queueBytes(2, stream.buffer);
  7240. for(int j = 0; j < 8; j++)
  7241. socketStream.read();
  7242.  
  7243. int k = socketStream.read();
  7244. int i1 = k;
  7245. if(k == 0)
  7246. {
  7247. socketStream.flushInputStream(inStream.buffer, 8);
  7248. inStream.currentOffset = 0;
  7249. aLong1215 = inStream.readQWord();
  7250. int ai[] = new int[4];
  7251. ai[0] = (int)(Math.random() * 99999999D);
  7252. ai[1] = (int)(Math.random() * 99999999D);
  7253. ai[2] = (int)(aLong1215 >> 32);
  7254. ai[3] = (int)aLong1215;
  7255. stream.currentOffset = 0;
  7256. stream.writeWordBigEndian(10);
  7257. stream.writeDWord(ai[0]);
  7258. stream.writeDWord(ai[1]);
  7259. stream.writeDWord(ai[2]);
  7260. stream.writeDWord(ai[3]);
  7261. stream.writeDWord(/*signlink.uid*/999999);
  7262. // stream.writeString(CreateUID.generateUID());
  7263. stream.writeString(s);
  7264. stream.writeString(s1);
  7265. stream.doKeys();
  7266. aStream_847.currentOffset = 0;
  7267. if(flag)
  7268. aStream_847.writeWordBigEndian(18);
  7269. else
  7270. aStream_847.writeWordBigEndian(16);
  7271. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  7272. aStream_847.writeWordBigEndian(255);
  7273. aStream_847.writeWord(317);
  7274. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  7275. for(int l1 = 0; l1 < 9; l1++)
  7276. aStream_847.writeDWord(expectedCRCs[l1]);
  7277.  
  7278. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  7279. stream.encryption = new ISAACRandomGen(ai);
  7280. for(int j2 = 0; j2 < 4; j2++)
  7281. ai[j2] += 50;
  7282.  
  7283. encryption = new ISAACRandomGen(ai);
  7284. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  7285. k = socketStream.read();
  7286. }
  7287. if(k == 1)
  7288. {
  7289. try
  7290. {
  7291. Thread.sleep(2000L);
  7292. }
  7293. catch(Exception _ex) { }
  7294. login(s, s1, flag);
  7295. return;
  7296. }
  7297. if(k == 2)
  7298. {
  7299. myPrivilege = socketStream.read();
  7300. flagged = socketStream.read() == 1;
  7301. aLong1220 = 0L;
  7302. anInt1022 = 0;
  7303. mouseDetection.coordsIndex = 0;
  7304. super.awtFocus = true;
  7305. aBoolean954 = true;
  7306. loggedIn = true;
  7307. stream.currentOffset = 0;
  7308. inStream.currentOffset = 0;
  7309. pktType = -1;
  7310. anInt841 = -1;
  7311. anInt842 = -1;
  7312. anInt843 = -1;
  7313. pktSize = 0;
  7314. anInt1009 = 0;
  7315. anInt1104 = 0;
  7316. anInt1011 = 0;
  7317. anInt855 = 0;
  7318. menuActionRow = 0;
  7319. menuOpen = false;
  7320. super.idleTime = 0;
  7321. for(int j1 = 0; j1 < 100; j1++)
  7322. chatMessages[j1] = null;
  7323.  
  7324. itemSelected = 0;
  7325. spellSelected = 0;
  7326. loadingStage = 0;
  7327. anInt1062 = 0;
  7328. anInt1278 = (int)(Math.random() * 100D) - 50;
  7329. anInt1131 = (int)(Math.random() * 110D) - 55;
  7330. anInt896 = (int)(Math.random() * 80D) - 40;
  7331. minimapInt2 = (int)(Math.random() * 120D) - 60;
  7332. minimapInt3 = (int)(Math.random() * 30D) - 20;
  7333. minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
  7334. anInt1021 = 0;
  7335. anInt985 = -1;
  7336. destX = 0;
  7337. destY = 0;
  7338. playerCount = 0;
  7339. npcCount = 0;
  7340. for(int i2 = 0; i2 < maxPlayers; i2++)
  7341. {
  7342. playerArray[i2] = null;
  7343. aStreamArray895s[i2] = null;
  7344. }
  7345.  
  7346. for(int k2 = 0; k2 < 16384; k2++)
  7347. npcArray[k2] = null;
  7348.  
  7349. myPlayer = playerArray[myPlayerIndex] = new Player();
  7350. aClass19_1013.removeAll();
  7351. aClass19_1056.removeAll();
  7352. for(int l2 = 0; l2 < 4; l2++)
  7353. {
  7354. for(int i3 = 0; i3 < 104; i3++)
  7355. {
  7356. for(int k3 = 0; k3 < 104; k3++)
  7357. groundArray[l2][i3][k3] = null;
  7358.  
  7359. }
  7360.  
  7361. }
  7362.  
  7363. aClass19_1179 = new NodeList();
  7364. fullscreenInterfaceID = -1;
  7365. anInt900 = 0;
  7366. friendsCount = 0;
  7367. dialogID = -1;
  7368. backDialogID = -1;
  7369. openInterfaceID = -1;
  7370. invOverlayInterfaceID = -1;
  7371. anInt1018 = -1;
  7372. aBoolean1149 = false;
  7373. tabID = 3;
  7374. inputDialogState = 0;
  7375. menuOpen = false;
  7376. messagePromptRaised = false;
  7377. aString844 = null;
  7378. anInt1055 = 0;
  7379. anInt1054 = -1;
  7380. aBoolean1047 = true;
  7381. method45();
  7382. for(int j3 = 0; j3 < 5; j3++)
  7383. anIntArray990[j3] = 0;
  7384.  
  7385. for(int l3 = 0; l3 < 5; l3++)
  7386. {
  7387. atPlayerActions[l3] = null;
  7388. atPlayerArray[l3] = false;
  7389. }
  7390.  
  7391. anInt1175 = 0;
  7392. anInt1134 = 0;
  7393. anInt986 = 0;
  7394. anInt1288 = 0;
  7395. anInt924 = 0;
  7396. anInt1188 = 0;
  7397. anInt1155 = 0;
  7398. anInt1226 = 0;
  7399. int anInt941 = 0;
  7400. int anInt1260 = 0;
  7401. resetImageProducers2();
  7402. return;
  7403. }
  7404. if(k == 3)
  7405. {
  7406. loginMessage1 = "";
  7407. loginMessage2 = "Invalid username or password.";
  7408. return;
  7409. }
  7410. if(k == 4)
  7411. {
  7412. loginMessage1 = "Your account has been disabled.";
  7413. loginMessage2 = "Please make a post on forums.";
  7414. return;
  7415. }
  7416. if(k == 5)
  7417. {
  7418. loginMessage1 = "Your account is already logged in.";
  7419. loginMessage2 = "Try again in 60 secs...";
  7420. return;
  7421. }
  7422. if(k == 6)
  7423. {
  7424. loginMessage1 = "NovusScape has been updated!";
  7425. loginMessage2 = "Please reload this page.";
  7426. return;
  7427. }
  7428. if(k == 7)
  7429. {
  7430. loginMessage1 = "This world is full.";
  7431. loginMessage2 = "Please use a different world.";
  7432. return;
  7433. }
  7434. if(k == 8)
  7435. {
  7436. loginMessage1 = "Unable to connect.";
  7437. loginMessage2 = "Login server offline.";
  7438. return;
  7439. }
  7440. if(k == 9)
  7441. {
  7442. loginMessage1 = "Login limit exceeded.";
  7443. loginMessage2 = "Too many connections from your address.";
  7444. return;
  7445. }
  7446. if(k == 10)
  7447. {
  7448. loginMessage1 = "Unable to connect.";
  7449. loginMessage2 = "Bad session id.";
  7450. return;
  7451. }
  7452. if(k == 11)
  7453. {
  7454. loginMessage2 = "Login server rejected session.";
  7455. loginMessage2 = "Please try again.";
  7456. return;
  7457. }
  7458. if(k == 12)
  7459. {
  7460. loginMessage1 = "You need a members account to login to this world.";
  7461. loginMessage2 = "Please subscribe, or use a different world.";
  7462. return;
  7463. }
  7464. if(k == 13)
  7465. {
  7466. loginMessage1 = "Could not complete login.";
  7467. loginMessage2 = "Please try using a different world.";
  7468. return;
  7469. }
  7470. if(k == 14)
  7471. {
  7472. loginMessage1 = "The server is being updated.";
  7473. loginMessage2 = "Please wait 1 minute and try again.";
  7474. return;
  7475. }
  7476. if(k == 15)
  7477. {
  7478. loggedIn = true;
  7479. stream.currentOffset = 0;
  7480. inStream.currentOffset = 0;
  7481. pktType = -1;
  7482. anInt841 = -1;
  7483. anInt842 = -1;
  7484. anInt843 = -1;
  7485. pktSize = 0;
  7486. anInt1009 = 0;
  7487. anInt1104 = 0;
  7488. menuActionRow = 0;
  7489. menuOpen = false;
  7490. aLong824 = System.currentTimeMillis();
  7491. return;
  7492. }
  7493. if(k == 16)
  7494. {
  7495. loginMessage1 = "Login attempts exceeded.";
  7496. loginMessage2 = "Please wait 1 minute and try again.";
  7497. return;
  7498. }
  7499. if(k == 17)
  7500. {
  7501. loginMessage1 = "You are standing in a members-only area.";
  7502. loginMessage2 = "To play on this world move to a free area first";
  7503. return;
  7504. }
  7505. if(k == 20)
  7506. {
  7507. loginMessage1 = "Invalid loginserver requested";
  7508. loginMessage2 = "Please try using a different world.";
  7509. return;
  7510. }
  7511. if(k == 21)
  7512. {
  7513. for(int k1 = socketStream.read(); k1 >= 0; k1--)
  7514. {
  7515. loginMessage1 = "You have only just left another world";
  7516. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  7517. drawLoginScreen(true);
  7518. try
  7519. {
  7520. Thread.sleep(1000L);
  7521. }
  7522. catch(Exception _ex) { }
  7523. }
  7524.  
  7525. login(s, s1, flag);
  7526. return;
  7527. }
  7528. /*if(k == 22) {
  7529. loginMessage1 = "@red@Your computer has been UUID banned.";
  7530. loginMessage2 = "Please appeal on the forums.";
  7531. return;
  7532. }*/
  7533. if(k == -1)
  7534. {
  7535. if(i1 == 0)
  7536. {
  7537. if(loginFailures < 2)
  7538. {
  7539. try
  7540. {
  7541. Thread.sleep(2000L);
  7542. }
  7543. catch(Exception _ex) { }
  7544. loginFailures++;
  7545. login(s, s1, flag);
  7546. return;
  7547. } else
  7548. {
  7549. loginMessage1 = "No response from loginserver";
  7550. loginMessage2 = "Please wait 1 minute and try again.";
  7551. return;
  7552. }
  7553. } else
  7554. {
  7555. loginMessage1 = "Login limit exceeded.";
  7556. loginMessage2 = "Please log out before logging in.";
  7557. return;
  7558. }
  7559. } else
  7560. {
  7561. System.out.println("response:" + k);
  7562. loginMessage1 = "Unexpected server response";
  7563. loginMessage2 = "Please try using a different world.";
  7564. return;
  7565. }
  7566. }
  7567. catch(IOException _ex)
  7568. {
  7569. loginMessage1 = "";
  7570. }
  7571. loginMessage2 = "Error connecting to server.";
  7572. }
  7573.  
  7574. 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) {
  7575. byte byte0 = 104;
  7576. byte byte1 = 104;
  7577. for(int l2 = 0; l2 < byte0; l2++) {
  7578. for(int i3 = 0; i3 < byte1; i3++) {
  7579. anIntArrayArray901[l2][i3] = 0;
  7580. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  7581. }
  7582. }
  7583. int j3 = j2;
  7584. int k3 = j1;
  7585. anIntArrayArray901[j2][j1] = 99;
  7586. anIntArrayArray825[j2][j1] = 0;
  7587. int l3 = 0;
  7588. int i4 = 0;
  7589. bigX[l3] = j2;
  7590. bigY[l3++] = j1;
  7591. boolean flag1 = false;
  7592. int j4 = bigX.length;
  7593. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  7594. while(i4 != l3)
  7595. {
  7596. j3 = bigX[i4];
  7597. k3 = bigY[i4];
  7598. i4 = (i4 + 1) % j4;
  7599. if(j3 == k2 && k3 == i2)
  7600. {
  7601. flag1 = true;
  7602. break;
  7603. }
  7604. if(i1 != 0)
  7605. {
  7606. if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  7607. {
  7608. flag1 = true;
  7609. break;
  7610. }
  7611. if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  7612. {
  7613. flag1 = true;
  7614. break;
  7615. }
  7616. }
  7617. if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  7618. {
  7619. flag1 = true;
  7620. break;
  7621. }
  7622. int l4 = anIntArrayArray825[j3][k3] + 1;
  7623. if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  7624. {
  7625. bigX[l3] = j3 - 1;
  7626. bigY[l3] = k3;
  7627. l3 = (l3 + 1) % j4;
  7628. anIntArrayArray901[j3 - 1][k3] = 2;
  7629. anIntArrayArray825[j3 - 1][k3] = l4;
  7630. }
  7631. if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  7632. {
  7633. bigX[l3] = j3 + 1;
  7634. bigY[l3] = k3;
  7635. l3 = (l3 + 1) % j4;
  7636. anIntArrayArray901[j3 + 1][k3] = 8;
  7637. anIntArrayArray825[j3 + 1][k3] = l4;
  7638. }
  7639. if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  7640. {
  7641. bigX[l3] = j3;
  7642. bigY[l3] = k3 - 1;
  7643. l3 = (l3 + 1) % j4;
  7644. anIntArrayArray901[j3][k3 - 1] = 1;
  7645. anIntArrayArray825[j3][k3 - 1] = l4;
  7646. }
  7647. if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  7648. {
  7649. bigX[l3] = j3;
  7650. bigY[l3] = k3 + 1;
  7651. l3 = (l3 + 1) % j4;
  7652. anIntArrayArray901[j3][k3 + 1] = 4;
  7653. anIntArrayArray825[j3][k3 + 1] = l4;
  7654. }
  7655. 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)
  7656. {
  7657. bigX[l3] = j3 - 1;
  7658. bigY[l3] = k3 - 1;
  7659. l3 = (l3 + 1) % j4;
  7660. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  7661. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  7662. }
  7663. 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)
  7664. {
  7665. bigX[l3] = j3 + 1;
  7666. bigY[l3] = k3 - 1;
  7667. l3 = (l3 + 1) % j4;
  7668. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  7669. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  7670. }
  7671. 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)
  7672. {
  7673. bigX[l3] = j3 - 1;
  7674. bigY[l3] = k3 + 1;
  7675. l3 = (l3 + 1) % j4;
  7676. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  7677. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  7678. }
  7679. 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)
  7680. {
  7681. bigX[l3] = j3 + 1;
  7682. bigY[l3] = k3 + 1;
  7683. l3 = (l3 + 1) % j4;
  7684. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  7685. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  7686. }
  7687. }
  7688. anInt1264 = 0;
  7689. if(!flag1)
  7690. {
  7691. if(flag)
  7692. {
  7693. int i5 = 100;
  7694. for(int k5 = 1; k5 < 2; k5++)
  7695. {
  7696. for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  7697. {
  7698. for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  7699. if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  7700. {
  7701. i5 = anIntArrayArray825[i6][l6];
  7702. j3 = i6;
  7703. k3 = l6;
  7704. anInt1264 = 1;
  7705. flag1 = true;
  7706. }
  7707.  
  7708. }
  7709.  
  7710. if(flag1)
  7711. break;
  7712. }
  7713.  
  7714. }
  7715. if(!flag1)
  7716. return false;
  7717. }
  7718. i4 = 0;
  7719. bigX[i4] = j3;
  7720. bigY[i4++] = k3;
  7721. int l5;
  7722. for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  7723. {
  7724. if(j5 != l5)
  7725. {
  7726. l5 = j5;
  7727. bigX[i4] = j3;
  7728. bigY[i4++] = k3;
  7729. }
  7730. if((j5 & 2) != 0)
  7731. j3++;
  7732. else
  7733. if((j5 & 8) != 0)
  7734. j3--;
  7735. if((j5 & 1) != 0)
  7736. k3++;
  7737. else
  7738. if((j5 & 4) != 0)
  7739. k3--;
  7740. }
  7741. // if(cancelWalk) { return i4 > 0; }
  7742.  
  7743.  
  7744. if(i4 > 0)
  7745. {
  7746. int k4 = i4;
  7747. if(k4 > 25)
  7748. k4 = 25;
  7749. i4--;
  7750. int k6 = bigX[i4];
  7751. int i7 = bigY[i4];
  7752. anInt1288 += k4;
  7753. if(anInt1288 >= 92)
  7754. {
  7755. stream.createFrame(36);
  7756. stream.writeDWord(0);
  7757. anInt1288 = 0;
  7758. }
  7759. if(i == 0)
  7760. {
  7761. stream.createFrame(164);
  7762. stream.writeWordBigEndian(k4 + k4 + 3);
  7763. }
  7764. if(i == 1)
  7765. {
  7766. stream.createFrame(248);
  7767. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  7768. }
  7769. if(i == 2)
  7770. {
  7771. stream.createFrame(98);
  7772. stream.writeWordBigEndian(k4 + k4 + 3);
  7773. }
  7774. stream.method433(k6 + baseX);
  7775. destX = bigX[0];
  7776. destY = bigY[0];
  7777. for(int j7 = 1; j7 < k4; j7++)
  7778. {
  7779. i4--;
  7780. stream.writeWordBigEndian(bigX[i4] - k6);
  7781. stream.writeWordBigEndian(bigY[i4] - i7);
  7782. }
  7783.  
  7784. stream.method431(i7 + baseY);
  7785. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  7786. return true;
  7787. }
  7788. return i != 1;
  7789. }
  7790.  
  7791. private void method86(Stream stream)
  7792. {
  7793. for(int j = 0; j < anInt893; j++)
  7794. {
  7795. int k = anIntArray894[j];
  7796. NPC npc = npcArray[k];
  7797. int l = stream.readUnsignedByte();
  7798. if((l & 0x10) != 0)
  7799. {
  7800. int i1 = stream.method434();
  7801. if(i1 == 65535)
  7802. i1 = -1;
  7803. int i2 = stream.readUnsignedByte();
  7804. if(i1 == npc.anim && i1 != -1)
  7805. {
  7806. int l2 = Animation.anims[i1].anInt365;
  7807. if(l2 == 1)
  7808. {
  7809. npc.anInt1527 = 0;
  7810. npc.anInt1528 = 0;
  7811. npc.anInt1529 = i2;
  7812. npc.anInt1530 = 0;
  7813. }
  7814. if(l2 == 2)
  7815. npc.anInt1530 = 0;
  7816. } else
  7817. if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  7818. {
  7819. npc.anim = i1;
  7820. npc.anInt1527 = 0;
  7821. npc.anInt1528 = 0;
  7822. npc.anInt1529 = i2;
  7823. npc.anInt1530 = 0;
  7824. npc.anInt1542 = npc.smallXYIndex;
  7825. }
  7826. }
  7827. if((l & 8) != 0)
  7828. {
  7829. int j1 = stream.method426();
  7830. int j2 = stream.method427();
  7831. npc.updateHitData(j2, j1, loopCycle);
  7832. npc.loopCycleStatus = loopCycle + 300;
  7833. npc.currentHealth = stream.method426();
  7834. npc.maxHealth = stream.readUnsignedByte();
  7835. }
  7836. if((l & 0x80) != 0)
  7837. {
  7838. npc.anInt1520 = stream.readUnsignedWord();
  7839. int k1 = stream.readDWord();
  7840. npc.anInt1524 = k1 >> 16;
  7841. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  7842. npc.anInt1521 = 0;
  7843. npc.anInt1522 = 0;
  7844. if(npc.anInt1523 > loopCycle)
  7845. npc.anInt1521 = -1;
  7846. if(npc.anInt1520 == 65535)
  7847. npc.anInt1520 = -1;
  7848. }
  7849. if((l & 0x20) != 0)
  7850. {
  7851. npc.interactingEntity = stream.readUnsignedWord();
  7852. if(npc.interactingEntity == 65535)
  7853. npc.interactingEntity = -1;
  7854. }
  7855. if((l & 1) != 0)
  7856. {
  7857. npc.textSpoken = stream.readString();
  7858. npc.textCycle = 100;
  7859. // entityMessage(npc);
  7860.  
  7861. }
  7862. if((l & 0x40) != 0)
  7863. {
  7864. int l1 = stream.method427();
  7865. int k2 = stream.method428();
  7866. npc.updateHitData(k2, l1, loopCycle);
  7867. npc.loopCycleStatus = loopCycle + 300;
  7868. npc.currentHealth = stream.method428();
  7869. npc.maxHealth = stream.method427();
  7870. }
  7871. if((l & 2) != 0)
  7872. {
  7873. npc.desc = EntityDef.forID(stream.method436());
  7874. npc.anInt1540 = npc.desc.aByte68;
  7875. npc.anInt1504 = npc.desc.anInt79;
  7876. npc.anInt1554 = npc.desc.walkAnim;
  7877. npc.anInt1555 = npc.desc.anInt58;
  7878. npc.anInt1556 = npc.desc.anInt83;
  7879. npc.anInt1557 = npc.desc.anInt55;
  7880. npc.anInt1511 = npc.desc.standAnim;
  7881. }
  7882. if((l & 4) != 0)
  7883. {
  7884. npc.anInt1538 = stream.method434();
  7885. npc.anInt1539 = stream.method434();
  7886. }
  7887. }
  7888. }
  7889.  
  7890. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  7891. {
  7892. if(menuActionRow >= 400)
  7893. return;
  7894. if(entityDef.childrenIDs != null)
  7895. entityDef = entityDef.method161();
  7896. if(entityDef == null)
  7897. return;
  7898. if(!entityDef.aBoolean84)
  7899. return;
  7900. String s = entityDef.name;
  7901. if(entityDef.combatLevel != 0)
  7902. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  7903. if(itemSelected == 1)
  7904. {
  7905. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  7906. menuActionID[menuActionRow] = 582;
  7907. menuActionCmd1[menuActionRow] = i;
  7908. menuActionCmd2[menuActionRow] = k;
  7909. menuActionCmd3[menuActionRow] = j;
  7910. menuActionRow++;
  7911. return;
  7912. }
  7913. if(spellSelected == 1)
  7914. {
  7915. if((spellUsableOn & 2) == 2)
  7916. {
  7917. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  7918. menuActionID[menuActionRow] = 413;
  7919. menuActionCmd1[menuActionRow] = i;
  7920. menuActionCmd2[menuActionRow] = k;
  7921. menuActionCmd3[menuActionRow] = j;
  7922. menuActionRow++;
  7923. }
  7924. } else
  7925. {
  7926. if(entityDef.actions != null)
  7927. {
  7928. for(int l = 4; l >= 0; l--)
  7929. if(entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack"))
  7930. {
  7931. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  7932. if(l == 0)
  7933. menuActionID[menuActionRow] = 20;
  7934. if(l == 1)
  7935. menuActionID[menuActionRow] = 412;
  7936. if(l == 2)
  7937. menuActionID[menuActionRow] = 225;
  7938. if(l == 3)
  7939. menuActionID[menuActionRow] = 965;
  7940. if(l == 4)
  7941. menuActionID[menuActionRow] = 478;
  7942. menuActionCmd1[menuActionRow] = i;
  7943. menuActionCmd2[menuActionRow] = k;
  7944. menuActionCmd3[menuActionRow] = j;
  7945. menuActionRow++;
  7946. }
  7947.  
  7948. }
  7949. if(entityDef.actions != null)
  7950. {
  7951. for(int i1 = 4; i1 >= 0; i1--)
  7952. if(entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack"))
  7953. {
  7954. char c = '\0';
  7955. if(entityDef.combatLevel > myPlayer.combatLevel)
  7956. c = '\u07D0';
  7957. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  7958. if(i1 == 0)
  7959. menuActionID[menuActionRow] = 20 + c;
  7960. if(i1 == 1)
  7961. menuActionID[menuActionRow] = 412 + c;
  7962. if(i1 == 2)
  7963. menuActionID[menuActionRow] = 225 + c;
  7964. if(i1 == 3)
  7965. menuActionID[menuActionRow] = 965 + c;
  7966. if(i1 == 4)
  7967. menuActionID[menuActionRow] = 478 + c;
  7968. menuActionCmd1[menuActionRow] = i;
  7969. menuActionCmd2[menuActionRow] = k;
  7970. menuActionCmd3[menuActionRow] = j;
  7971. menuActionRow++;
  7972. }
  7973.  
  7974. }
  7975. //menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.type + "@gre@)";
  7976. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7977. menuActionID[menuActionRow] = 1025;
  7978. menuActionCmd1[menuActionRow] = i;
  7979. menuActionCmd2[menuActionRow] = k;
  7980. menuActionCmd3[menuActionRow] = j;
  7981. menuActionRow++;
  7982. }
  7983. }
  7984.  
  7985.  
  7986. private void buildAtPlayerMenu(int i, int j, Player player, int k)
  7987. {
  7988. if(player == myPlayer)
  7989. return;
  7990. if(menuActionRow >= 400)
  7991. return;
  7992. String s;
  7993. if (player.skill == 0) {
  7994. s = "@" + titleColor(player.titleColor, 1) + "@" + player.title + "@whi@" + player.name
  7995. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  7996. + " (level-" + player.combatLevel + ")";
  7997. // s = player.name
  7998. // + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  7999. // + " (level-" + player.combatLevel + ")";
  8000. } else {
  8001. s = "@" + titleColor(player.titleColor, 1) + "@" + player.title + "@whi@ " + player.name
  8002. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  8003. + " (level-" + player.combatLevel + ")";
  8004. }
  8005. if(itemSelected == 1)
  8006. {
  8007. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
  8008. menuActionID[menuActionRow] = 491;
  8009. menuActionCmd1[menuActionRow] = j;
  8010. menuActionCmd2[menuActionRow] = i;
  8011. menuActionCmd3[menuActionRow] = k;
  8012. menuActionRow++;
  8013. } else
  8014. if(spellSelected == 1)
  8015. {
  8016. if((spellUsableOn & 8) == 8)
  8017. {
  8018. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  8019. menuActionID[menuActionRow] = 365;
  8020. menuActionCmd1[menuActionRow] = j;
  8021. menuActionCmd2[menuActionRow] = i;
  8022. menuActionCmd3[menuActionRow] = k;
  8023. menuActionRow++;
  8024. }
  8025. } else
  8026. {
  8027. for(int l = 4; l >= 0; l--)
  8028. if(atPlayerActions[l] != null)
  8029. {
  8030. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  8031. char c = '\0';
  8032. if(atPlayerActions[l].equalsIgnoreCase("attack"))
  8033. {
  8034. if(player.combatLevel > myPlayer.combatLevel)
  8035. c = '\u07D0';
  8036. if(myPlayer.team != 0 && player.team != 0)
  8037. if(myPlayer.team == player.team)
  8038. c = '\u07D0';
  8039. else
  8040. c = '\0';
  8041. } else
  8042. if(atPlayerArray[l])
  8043. c = '\u07D0';
  8044. if(l == 0)
  8045. menuActionID[menuActionRow] = 561 + c;
  8046. if(l == 1)
  8047. menuActionID[menuActionRow] = 779 + c;
  8048. if(l == 2)
  8049. menuActionID[menuActionRow] = 27 + c;
  8050. if(l == 3)
  8051. menuActionID[menuActionRow] = 577 + c;
  8052. if(l == 4)
  8053. menuActionID[menuActionRow] = 729 + c;
  8054. menuActionCmd1[menuActionRow] = j;
  8055. menuActionCmd2[menuActionRow] = i;
  8056. menuActionCmd3[menuActionRow] = k;
  8057. menuActionRow++;
  8058. }
  8059.  
  8060. }
  8061. for(int i1 = 0; i1 < menuActionRow; i1++)
  8062. if(menuActionID[i1] == 516)
  8063. {
  8064. menuActionName[i1] = "Walk here @whi@" + s;
  8065. return;
  8066. }
  8067.  
  8068. }
  8069.  
  8070. private void method89(Class30_Sub1 class30_sub1)
  8071. {
  8072. int i = 0;
  8073. int j = -1;
  8074. int k = 0;
  8075. int l = 0;
  8076. if(class30_sub1.anInt1296 == 0)
  8077. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8078. if(class30_sub1.anInt1296 == 1)
  8079. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8080. if(class30_sub1.anInt1296 == 2)
  8081. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8082. if(class30_sub1.anInt1296 == 3)
  8083. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8084. if(i != 0)
  8085. {
  8086. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  8087. j = i >> 14 & 0x7fff;
  8088. k = i1 & 0x1f;
  8089. l = i1 >> 6;
  8090. }
  8091. class30_sub1.anInt1299 = j;
  8092. class30_sub1.anInt1301 = k;
  8093. class30_sub1.anInt1300 = l;
  8094. }
  8095.  
  8096. private void method90()
  8097. {
  8098. for(int i = 0; i < anInt1062; i++)
  8099. if(anIntArray1250[i] <= 0)
  8100. {
  8101. boolean flag1 = false;
  8102. try
  8103. {
  8104. if(anIntArray1207[i] == anInt874 && anIntArray1241[i] == anInt1289)
  8105. {
  8106. if(!replayWave())
  8107. flag1 = true;
  8108. } else
  8109. {
  8110. Stream stream = Sounds.method241(anIntArray1241[i], anIntArray1207[i]);
  8111. if(System.currentTimeMillis() + (long)(stream.currentOffset / 22) > aLong1172 + (long)(anInt1257 / 22))
  8112. {
  8113. anInt1257 = stream.currentOffset;
  8114. aLong1172 = System.currentTimeMillis();
  8115. if(saveWave(stream.buffer, stream.currentOffset))
  8116. {
  8117. anInt874 = anIntArray1207[i];
  8118. anInt1289 = anIntArray1241[i];
  8119. } else
  8120. {
  8121. flag1 = true;
  8122. }
  8123. }
  8124. }
  8125. }
  8126. catch(Exception exception) { }
  8127. if(!flag1 || anIntArray1250[i] == -5)
  8128. {
  8129. anInt1062--;
  8130. for(int j = i; j < anInt1062; j++)
  8131. {
  8132. anIntArray1207[j] = anIntArray1207[j + 1];
  8133. anIntArray1241[j] = anIntArray1241[j + 1];
  8134. anIntArray1250[j] = anIntArray1250[j + 1];
  8135. }
  8136.  
  8137. i--;
  8138. } else
  8139. {
  8140. anIntArray1250[i] = -5;
  8141. }
  8142. } else
  8143. {
  8144. anIntArray1250[i]--;
  8145. }
  8146.  
  8147. if(prevSong > 0)
  8148. {
  8149. prevSong -= 20;
  8150. if(prevSong < 0)
  8151. prevSong = 0;
  8152. if(prevSong == 0 && musicEnabled && !lowMem)
  8153. {
  8154. nextSong = currentSong;
  8155. songChanging = true;
  8156. onDemandFetcher.method558(2, nextSong);
  8157. }
  8158. }
  8159. }
  8160.  
  8161.  
  8162.  
  8163.  
  8164. public static final byte[] ReadFile(String s, boolean antiLeech) {
  8165. try {
  8166. byte abyte0[];
  8167. File file = new File(s);
  8168. int i = (int)file.length();
  8169. abyte0 = new byte[i];
  8170. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  8171. datainputstream.readFully(abyte0, 0, i);
  8172. datainputstream.close();
  8173. return abyte0;
  8174. } catch(Exception e) {
  8175. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  8176. return null;
  8177. }
  8178. }
  8179. void startUp()
  8180. {
  8181. new CacheDownloader().run();
  8182. drawLoadingText(20, "Starting up");
  8183. if(signlink.sunjava)
  8184. super.minDelay = 5;
  8185. if(aBoolean993)
  8186. {
  8187. // rsAlreadyLoaded = true;
  8188. // return;
  8189. }
  8190. aBoolean993 = true;
  8191. boolean flag = true;
  8192. String s = getDocumentBaseHost();
  8193. if(signlink.cache_dat != null)
  8194. {
  8195. for(int i = 0; i < 5; i++)
  8196. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  8197. } try {
  8198. titleStreamLoader = streamLoaderForName(1, "title screen", "title",
  8199. expectedCRCs[1], 25);
  8200. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  8201. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  8202. chatTextDrawingArea = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  8203. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  8204. newSmallFont = new RSFont(false, "p11_full", titleStreamLoader);
  8205. newRegularFont = new RSFont(false, "p12_full", titleStreamLoader);
  8206. newBoldFont = new RSFont(false, "b12_full", titleStreamLoader);
  8207. newFancyFont = new RSFont(true, "q8_full", titleStreamLoader);
  8208. newSmallText = new FontSystem(false, "p11_full", titleStreamLoader);
  8209. regularText = new FontSystem(false, "p12_full", titleStreamLoader);
  8210. boldText = new FontSystem(false, "b12_full", titleStreamLoader);
  8211. fancyText = new FontSystem(true, "q8_full", titleStreamLoader);
  8212. newSmallFont.unpackChatImages(chatImages);
  8213. newRegularFont.unpackChatImages(chatImages);
  8214. newBoldFont.unpackChatImages(chatImages);
  8215. newFancyFont.unpackChatImages(chatImages);
  8216.  
  8217. newSmallText.unpackChatImages(crownImages);
  8218. regularText.unpackChatImages(crownImages);
  8219. boldText.unpackChatImages(crownImages);
  8220. fancyText.unpackChatImages(crownImages);
  8221.  
  8222. drawLogo();
  8223. loadTitleScreen();
  8224. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  8225. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  8226. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  8227. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  8228. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  8229. StreamLoader streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  8230. byteGroundArray = new byte[4][104][104];
  8231. intGroundArray = new int[4][105][105];
  8232. worldController = new WorldController(intGroundArray);
  8233. for(int j = 0; j < 4; j++)
  8234. aClass11Array1230[j] = new Class11();
  8235.  
  8236. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  8237. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  8238. drawLoadingText(60, "Connecting to update server");
  8239. onDemandFetcher = new OnDemandFetcher();
  8240. onDemandFetcher.start(streamLoader_6, this);
  8241. Class36.method528(onDemandFetcher.getAnimCount());
  8242. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  8243. ModelDecompressor.loadModels();
  8244. ModelDecompressor.loadModels2();
  8245. preloadModels();
  8246. //repackCacheIndex(1);
  8247. //repackCacheIndex(2);
  8248. if(!lowMem)
  8249. {
  8250. nextSong = 0;
  8251. try
  8252. {
  8253. nextSong = Integer.parseInt(getParameter("music"));
  8254. }
  8255. catch(Exception _ex) { }
  8256. songChanging = true;
  8257. onDemandFetcher.method558(2, nextSong);
  8258. while(onDemandFetcher.getNodeCount() > 0)
  8259. {
  8260. processOnDemandQueue();
  8261. try
  8262. {
  8263. Thread.sleep(100L);
  8264. }
  8265. catch(Exception _ex) { }
  8266. if(onDemandFetcher.anInt1349 > 3)
  8267. {
  8268. loadError();
  8269. return;
  8270. }
  8271. }
  8272. }
  8273. drawLoadingText(70, "Requesting models");
  8274. int k = onDemandFetcher.getVersionCount(0);
  8275. for(int k1 = 0; k1 < k; k1++)
  8276. {
  8277. int l1 = onDemandFetcher.getModelIndex(k1);
  8278. if((l1 & 1) != 0)
  8279. onDemandFetcher.method558(0, k1);
  8280. }
  8281.  
  8282. k = onDemandFetcher.getNodeCount();
  8283. while(onDemandFetcher.getNodeCount() > 0)
  8284. {
  8285. int i2 = k - onDemandFetcher.getNodeCount();
  8286. if(i2 > 0)
  8287. drawLoadingText(70, "Loading models - " + (i2 * 100) / k + "%");
  8288. processOnDemandQueue();
  8289. try
  8290. {
  8291. Thread.sleep(100L);
  8292. }
  8293. catch(Exception _ex) { }
  8294. }
  8295. if(decompressors[0] != null)
  8296. {
  8297. drawLoadingText(75, "Requesting maps");
  8298. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 47));
  8299. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 47));
  8300. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 48));
  8301. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 48));
  8302. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 49));
  8303. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 49));
  8304. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 47));
  8305. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 47));
  8306. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 48));
  8307. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 48));
  8308. onDemandFetcher.method558(3, onDemandFetcher.method562(0, 148, 48));
  8309. onDemandFetcher.method558(3, onDemandFetcher.method562(1, 148, 48));
  8310. k = onDemandFetcher.getNodeCount();
  8311. while(onDemandFetcher.getNodeCount() > 0)
  8312. {
  8313. int j2 = k - onDemandFetcher.getNodeCount();
  8314. if(j2 > 0)
  8315. drawLoadingText(75, "Loading maps - " + (j2 * 100) / k + "%");
  8316. processOnDemandQueue();
  8317. try
  8318. {
  8319. Thread.sleep(100L);
  8320. }
  8321. catch(Exception _ex) { }
  8322. }
  8323. }
  8324. k = onDemandFetcher.getVersionCount(0);
  8325. for(int k2 = 0; k2 < k; k2++)
  8326. {
  8327. int l2 = onDemandFetcher.getModelIndex(k2);
  8328. byte byte0 = 0;
  8329. if((l2 & 8) != 0)
  8330. byte0 = 10;
  8331. else
  8332. if((l2 & 0x20) != 0)
  8333. byte0 = 9;
  8334. else
  8335. if((l2 & 0x10) != 0)
  8336. byte0 = 8;
  8337. else
  8338. if((l2 & 0x40) != 0)
  8339. byte0 = 7;
  8340. else
  8341. if((l2 & 0x80) != 0)
  8342. byte0 = 6;
  8343. else
  8344. if((l2 & 2) != 0)
  8345. byte0 = 5;
  8346. else
  8347. if((l2 & 4) != 0)
  8348. byte0 = 4;
  8349. if((l2 & 1) != 0)
  8350. byte0 = 3;
  8351. if(byte0 != 0)
  8352. onDemandFetcher.method563(byte0, 0, k2);
  8353. }
  8354.  
  8355. onDemandFetcher.method554(isMembers);
  8356. if(!lowMem)
  8357. {
  8358. int l = onDemandFetcher.getVersionCount(2);
  8359. for(int i3 = 1; i3 < l; i3++)
  8360. if(onDemandFetcher.method569(i3))
  8361. onDemandFetcher.method563((byte)1, 2, i3);
  8362.  
  8363. }
  8364. drawLoadingText(80, "Unpacking media");
  8365. /* Custom sprite unpacking */
  8366. loadExtraSprites();
  8367. worldMapIcon = new Sprite("mapicon");
  8368. logIcon = new Sprite("logicon");
  8369. logIconH = new Sprite("logiconh");
  8370. logIconC = new Sprite("logiconc");
  8371. for(int i = 1; i <= 17; i++) {
  8372. ORBS[i] = new Sprite("Gameframe/Orbs/ORBS "+i+"");
  8373. }
  8374. for(int i = 0; i <= 7; i++){
  8375. crownImages[i] = new Sprite("Player/"+i);
  8376. }
  8377. HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/HITPOINTS_0.PNG", 1);
  8378. HPBarEmpty = new Sprite(sign.signlink.findcachedir() + "Sprites/HITPOINTS_1.PNG", 1);
  8379. emptyOrb = new Sprite("emptyorb");
  8380. hoverOrb = new Sprite("hoverorb");
  8381. hoverorbrun2 = new Sprite("hoverorbrun2");
  8382. hoverorbrun = new Sprite("hoverorbrun");
  8383. hitPointsFill = new Sprite("hitpointsfill");
  8384. prayerFill = new Sprite("prayerfill");
  8385.  
  8386. chatArea = new Sprite("chatarea");
  8387. tabArea = new Sprite("tabarea");
  8388. mapArea = new Sprite("maparea");
  8389. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  8390. /**/
  8391. mapBack = new Background(streamLoader_2, "mapback", 0);
  8392. for(int c1 = 0; c1 <= 3; c1++)
  8393. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  8394. for(int j3 = 0; j3 <= 14; j3++)
  8395. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  8396. for(int r1 = 0; r1 < 5; r1++)
  8397. redStones[r1] = new Sprite("redstones " + r1);
  8398. compass = new Sprite(streamLoader_2, "compass", 0);
  8399. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  8400. mapEdge.method345();
  8401. try
  8402. {
  8403. for(int k3 = 0; k3 < 100; k3++)
  8404. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  8405. }
  8406. catch(Exception _ex) { }
  8407. try
  8408. {
  8409. for(int l3 = 0; l3 < 100; l3++)
  8410. mapFunctions[l3] = new Sprite(streamLoader_2, "mapfunction", l3);
  8411. }
  8412. catch(Exception _ex) { }
  8413. try
  8414. {
  8415. for(int i4 = 0; i4 < 20; i4++)
  8416. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  8417. }
  8418. catch(Exception _ex) { }
  8419. try
  8420. {
  8421. for(int h1 = 0; h1 < 6; h1++)
  8422. headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
  8423. } catch(Exception _ex) { }
  8424. try {
  8425. /*for(int j4 = 0; j4 < 12; j4++)
  8426. headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);*/
  8427. for(int idx = 0; idx < 18; idx++)
  8428. headIcons[idx] = new Sprite("Player/Prayer/Prayer " + idx) ;
  8429. for(int j45 = 0; j45 < 3; j45++)
  8430. skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45 );
  8431. }
  8432. catch(Exception _ex) { }
  8433. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  8434. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  8435. for(int k4 = 0; k4 < 8; k4++)
  8436. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  8437.  
  8438. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  8439. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  8440. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  8441. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  8442. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  8443. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  8444. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  8445. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  8446.  
  8447. for(int l4 = 1; l4 < 8; l4++)
  8448. modIcons[l4 - 1] = new Sprite("Player" + File.separator + l4);
  8449.  
  8450. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  8451. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8452. sprite.method346(0, 0);
  8453. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  8454. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8455. sprite.method346(0, 0);
  8456. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  8457. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8458. sprite.method346(0, 0);
  8459. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  8460. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8461. sprite.method346(0, 0);
  8462.  
  8463. int i5 = (int)(Math.random() * 21D) - 10;
  8464. int j5 = (int)(Math.random() * 21D) - 10;
  8465. int k5 = (int)(Math.random() * 21D) - 10;
  8466. int l5 = (int)(Math.random() * 41D) - 20;
  8467. for(int i6 = 0; i6 < 100; i6++)
  8468. {
  8469. if(mapFunctions[i6] != null)
  8470. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  8471. if(mapScenes[i6] != null)
  8472. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  8473. }
  8474.  
  8475. drawLoadingText(83, "Unpacking textures");
  8476. Texture.method368(streamLoader_3);
  8477. Texture.method372(0.80000000000000004D);
  8478. Texture.method367();
  8479. drawLoadingText(86, "Unpacking config");
  8480. Animation.unpackConfig(streamLoader);
  8481. ObjectDef.unpackConfig(streamLoader);
  8482. Flo.unpackConfig(streamLoader);
  8483. ItemDef.unpackConfig(streamLoader);
  8484. EntityDef.unpackConfig(streamLoader);
  8485. IDK.unpackConfig(streamLoader);
  8486. SpotAnim.unpackConfig(streamLoader);
  8487. Varp.unpackConfig(streamLoader);
  8488. VarBit.unpackConfig(streamLoader);
  8489. ItemDef.isMembers = isMembers;
  8490. if(!lowMem)
  8491. {
  8492. drawLoadingText(90, "Unpacking sounds");
  8493. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  8494. Stream stream = new Stream(abyte0);
  8495. Sounds.unpack(stream);
  8496. }
  8497. drawLoadingText(95, "Unpacking interfaces");
  8498. TextDrawingArea aclass30_sub2_sub1_sub4s[] = {
  8499. smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  8500. };
  8501. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  8502. drawLoadingText(100, "Preparing game engine");
  8503. for(int j6 = 0; j6 < 33; j6++)
  8504. {
  8505. int k6 = 999;
  8506. int i7 = 0;
  8507. for(int k7 = 0; k7 < 34; k7++)
  8508. {
  8509. if(mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0)
  8510. {
  8511. if(k6 == 999)
  8512. k6 = k7;
  8513. continue;
  8514. }
  8515. if(k6 == 999)
  8516. continue;
  8517. i7 = k7;
  8518. break;
  8519. }
  8520.  
  8521. anIntArray968[j6] = k6;
  8522. anIntArray1057[j6] = i7 - k6;
  8523. }
  8524.  
  8525. for(int l6 = 5; l6 < 156; l6++)
  8526. {
  8527. int j7 = 999;
  8528. int l7 = 0;
  8529. for(int j8 = 25; j8 < 172; j8++)
  8530. {
  8531. if(mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34))
  8532. {
  8533. if(j7 == 999)
  8534. j7 = j8;
  8535. continue;
  8536. }
  8537. if(j7 == 999)
  8538. continue;
  8539. l7 = j8;
  8540. break;
  8541. }
  8542.  
  8543. anIntArray1052[l6 - 5] = j7 - 25;
  8544. anIntArray1229[l6 - 5] = l7 - j7;
  8545. }
  8546.  
  8547. Texture.method365(765, 503);
  8548. fullScreenTextureArray = Texture.anIntArray1472;
  8549. Texture.method365(519, 165);
  8550. anIntArray1180 = Texture.anIntArray1472;
  8551. Texture.method365(246, 335);
  8552. anIntArray1181 = Texture.anIntArray1472;
  8553. Texture.method365(512, 334);
  8554. anIntArray1182 = Texture.anIntArray1472;
  8555. int ai[] = new int[9];
  8556. for(int i8 = 0; i8 < 9; i8++)
  8557. {
  8558. int k8 = 128 + i8 * 32 + 15;
  8559. int l8 = 600 + k8 * 3;
  8560. int i9 = Texture.anIntArray1470[k8];
  8561. ai[i8] = l8 * i9 >> 16;
  8562. }
  8563.  
  8564. WorldController.method310(500, 800, 512, 334, ai);
  8565. Censor.loadConfig(streamLoader_4);
  8566. mouseDetection = new MouseDetection(this);
  8567. startRunnable(mouseDetection, 10);
  8568. Animable_Sub5.clientInstance = this;
  8569. ObjectDef.clientInstance = this;
  8570. EntityDef.clientInstance = this;
  8571. return;
  8572. }
  8573. catch(Exception exception)
  8574. {
  8575. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  8576. }
  8577. loadingError = true;
  8578. }
  8579. public int getOrbTextColor(int statusInt){
  8580. if(statusInt >= 75 && statusInt <= 164){
  8581. return 0x00FF00;
  8582. } else if(statusInt >= 50 && statusInt <= 74){
  8583. return 0xFFFF00;
  8584. } else if(statusInt >= 25 && statusInt <= 49){
  8585. return 0xFF981F;
  8586. } else {
  8587. return 0xFF0000;
  8588. }
  8589. }
  8590.  
  8591. private void method91(Stream stream, int i)
  8592. {
  8593. while(stream.bitPosition + 10 < i * 8)
  8594. {
  8595. int j = stream.readBits(11);
  8596. if(j == 2047)
  8597. break;
  8598. if(playerArray[j] == null)
  8599. {
  8600. playerArray[j] = new Player();
  8601. if(aStreamArray895s[j] != null)
  8602. playerArray[j].updatePlayer(aStreamArray895s[j]);
  8603. }
  8604. playerIndices[playerCount++] = j;
  8605. Player player = playerArray[j];
  8606. player.anInt1537 = loopCycle;
  8607. int k = stream.readBits(1);
  8608. if(k == 1)
  8609. anIntArray894[anInt893++] = j;
  8610. int l = stream.readBits(1);
  8611. int i1 = stream.readBits(5);
  8612. if(i1 > 15)
  8613. i1 -= 32;
  8614. int j1 = stream.readBits(5);
  8615. if(j1 > 15)
  8616. j1 -= 32;
  8617. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  8618. }
  8619. stream.finishBitAccess();
  8620. }
  8621.  
  8622. private void processMainScreenClick() {
  8623. if(anInt1021 != 0)
  8624. return;
  8625. if(super.clickMode3 == 1) {
  8626. int i = super.saveClickX - 25 - 545;
  8627. int j = super.saveClickY - 5 - 4;
  8628. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  8629. i -= 73;
  8630. j -= 75;
  8631. int k = minimapInt1 + minimapInt2 & 0x7ff;
  8632. int i1 = Texture.anIntArray1470[k];
  8633. int j1 = Texture.anIntArray1471[k];
  8634. i1 = i1 * (minimapInt3 + 256) >> 8;
  8635. j1 = j1 * (minimapInt3 + 256) >> 8;
  8636. int k1 = j * i1 + i * j1 >> 11;
  8637. int l1 = j * j1 - i * i1 >> 11;
  8638. int i2 = myPlayer.x + k1 >> 7;
  8639. int j2 = myPlayer.y - l1 >> 7;
  8640. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  8641. if(flag1) {
  8642. stream.writeWordBigEndian(i);
  8643. stream.writeWordBigEndian(j);
  8644. stream.writeWord(minimapInt1);
  8645. stream.writeWordBigEndian(57);
  8646. stream.writeWordBigEndian(minimapInt2);
  8647. stream.writeWordBigEndian(minimapInt3);
  8648. stream.writeWordBigEndian(89);
  8649. stream.writeWord(myPlayer.x);
  8650. stream.writeWord(myPlayer.y);
  8651. stream.writeWordBigEndian(anInt1264);
  8652. stream.writeWordBigEndian(63);
  8653. }
  8654. }
  8655. anInt1117++;
  8656. if(anInt1117 > 1151) {
  8657. anInt1117 = 0;
  8658. stream.createFrame(246);
  8659. stream.writeWordBigEndian(0);
  8660. int l = stream.currentOffset;
  8661. if((int)(Math.random() * 2D) == 0)
  8662. stream.writeWordBigEndian(101);
  8663. stream.writeWordBigEndian(197);
  8664. stream.writeWord((int)(Math.random() * 65536D));
  8665. stream.writeWordBigEndian((int)(Math.random() * 256D));
  8666. stream.writeWordBigEndian(67);
  8667. stream.writeWord(14214);
  8668. if((int)(Math.random() * 2D) == 0)
  8669. stream.writeWord(29487);
  8670. stream.writeWord((int)(Math.random() * 65536D));
  8671. if((int)(Math.random() * 2D) == 0)
  8672. stream.writeWordBigEndian(220);
  8673. stream.writeWordBigEndian(180);
  8674. stream.writeBytes(stream.currentOffset - l);
  8675. }
  8676. }
  8677. }
  8678.  
  8679. private String interfaceIntToString(int j) {
  8680. if(j < 0x3b9ac9ff)
  8681. return String.valueOf(j);
  8682. else
  8683. return "*";
  8684. }
  8685.  
  8686. private void showErrorScreen()
  8687. {
  8688. Graphics g = getGameComponent().getGraphics();
  8689. g.setColor(Color.black);
  8690. g.fillRect(0, 0, 765, 503);
  8691. method4(1);
  8692. if(loadingError)
  8693. {
  8694. aBoolean831 = false;
  8695. g.setFont(new Font("Helvetica", 1, 16));
  8696. g.setColor(Color.yellow);
  8697. int k = 35;
  8698. g.drawString("Sorry, an error has occured whilst loading NovusScape", 30, k);
  8699. k += 50;
  8700. g.setColor(Color.white);
  8701. g.drawString("To fix this try the following (in order):", 30, k);
  8702. k += 50;
  8703. g.setColor(Color.white);
  8704. g.setFont(new Font("Helvetica", 1, 12));
  8705. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  8706. k += 30;
  8707. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  8708. k += 30;
  8709. g.drawString("3: Try using a different game-world", 30, k);
  8710. k += 30;
  8711. g.drawString("4: Try rebooting your computer", 30, k);
  8712. k += 30;
  8713. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  8714. }
  8715. if(genericLoadingError)
  8716. {
  8717. aBoolean831 = false;
  8718. g.setFont(new Font("Helvetica", 1, 20));
  8719. g.setColor(Color.white);
  8720. g.drawString("Error - unable to load game!", 50, 50);
  8721. g.drawString("To play NovusScape make sure to DL the client", 50, 100);
  8722. g.drawString("http://NovusScape-rsps.comlu.com/index.php", 50, 150);
  8723. }
  8724. if(rsAlreadyLoaded)
  8725. {
  8726. aBoolean831 = false;
  8727. g.setColor(Color.yellow);
  8728. int l = 35;
  8729. g.drawString("Error a copy of NovusScape already appears to be loaded", 30, l);
  8730. l += 50;
  8731. g.setColor(Color.white);
  8732. g.drawString("To fix this try the following (in order):", 30, l);
  8733. l += 50;
  8734. g.setColor(Color.white);
  8735. g.setFont(new Font("Helvetica", 1, 12));
  8736. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  8737. l += 30;
  8738. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  8739. l += 30;
  8740. }
  8741. }
  8742.  
  8743. public URL getCodeBase() {
  8744. try {
  8745. return new URL(server +":" + (80 + portOff));
  8746. } catch(Exception _ex) {
  8747. }
  8748. return null;
  8749. }
  8750.  
  8751. private void method95() {
  8752. for(int j = 0; j < npcCount; j++) {
  8753. int k = npcIndices[j];
  8754. NPC npc = npcArray[k];
  8755. if(npc != null)
  8756. method96(npc);
  8757. }
  8758. }
  8759.  
  8760. private void method96(Entity entity)
  8761. {
  8762. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  8763. {
  8764. entity.anim = -1;
  8765. entity.anInt1520 = -1;
  8766. entity.anInt1547 = 0;
  8767. entity.anInt1548 = 0;
  8768. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8769. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8770. entity.method446();
  8771. }
  8772. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  8773. {
  8774. entity.anim = -1;
  8775. entity.anInt1520 = -1;
  8776. entity.anInt1547 = 0;
  8777. entity.anInt1548 = 0;
  8778. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8779. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8780. entity.method446();
  8781. }
  8782. if(entity.anInt1547 > loopCycle)
  8783. method97(entity);
  8784. else
  8785. if(entity.anInt1548 >= loopCycle)
  8786. method98(entity);
  8787. else
  8788. method99(entity);
  8789. method100(entity);
  8790. method101(entity);
  8791. }
  8792.  
  8793. private void method97(Entity entity)
  8794. {
  8795. int i = entity.anInt1547 - loopCycle;
  8796. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8797. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8798. entity.x += (j - entity.x) / i;
  8799. entity.y += (k - entity.y) / i;
  8800. entity.anInt1503 = 0;
  8801. if(entity.anInt1549 == 0)
  8802. entity.turnDirection = 1024;
  8803. if(entity.anInt1549 == 1)
  8804. entity.turnDirection = 1536;
  8805. if(entity.anInt1549 == 2)
  8806. entity.turnDirection = 0;
  8807. if(entity.anInt1549 == 3)
  8808. entity.turnDirection = 512;
  8809. }
  8810.  
  8811. private void method98(Entity entity)
  8812. {
  8813. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  8814. {
  8815. int i = entity.anInt1548 - entity.anInt1547;
  8816. int j = loopCycle - entity.anInt1547;
  8817. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8818. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8819. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  8820. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  8821. entity.x = (k * (i - j) + i1 * j) / i;
  8822. entity.y = (l * (i - j) + j1 * j) / i;
  8823. }
  8824. entity.anInt1503 = 0;
  8825. if(entity.anInt1549 == 0)
  8826. entity.turnDirection = 1024;
  8827. if(entity.anInt1549 == 1)
  8828. entity.turnDirection = 1536;
  8829. if(entity.anInt1549 == 2)
  8830. entity.turnDirection = 0;
  8831. if(entity.anInt1549 == 3)
  8832. entity.turnDirection = 512;
  8833. entity.anInt1552 = entity.turnDirection;
  8834. }
  8835.  
  8836. private void method99(Entity entity)
  8837. {
  8838. entity.anInt1517 = entity.anInt1511;
  8839. if(entity.smallXYIndex == 0)
  8840. {
  8841. entity.anInt1503 = 0;
  8842. return;
  8843. }
  8844. if(entity.anim != -1 && entity.anInt1529 == 0)
  8845. {
  8846. Animation animation = Animation.anims[entity.anim];
  8847. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  8848. {
  8849. entity.anInt1503++;
  8850. return;
  8851. }
  8852. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  8853. {
  8854. entity.anInt1503++;
  8855. return;
  8856. }
  8857. }
  8858. int i = entity.x;
  8859. int j = entity.y;
  8860. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  8861. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  8862. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  8863. {
  8864. entity.x = k;
  8865. entity.y = l;
  8866. return;
  8867. }
  8868. if(i < k)
  8869. {
  8870. if(j < l)
  8871. entity.turnDirection = 1280;
  8872. else
  8873. if(j > l)
  8874. entity.turnDirection = 1792;
  8875. else
  8876. entity.turnDirection = 1536;
  8877. } else
  8878. if(i > k)
  8879. {
  8880. if(j < l)
  8881. entity.turnDirection = 768;
  8882. else
  8883. if(j > l)
  8884. entity.turnDirection = 256;
  8885. else
  8886. entity.turnDirection = 512;
  8887. } else
  8888. if(j < l)
  8889. entity.turnDirection = 1024;
  8890. else
  8891. entity.turnDirection = 0;
  8892. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8893. if(i1 > 1024)
  8894. i1 -= 2048;
  8895. int j1 = entity.anInt1555;
  8896. if(i1 >= -256 && i1 <= 256)
  8897. j1 = entity.anInt1554;
  8898. else
  8899. if(i1 >= 256 && i1 < 768)
  8900. j1 = entity.anInt1557;
  8901. else
  8902. if(i1 >= -768 && i1 <= -256)
  8903. j1 = entity.anInt1556;
  8904. if(j1 == -1)
  8905. j1 = entity.anInt1554;
  8906. entity.anInt1517 = j1;
  8907. int k1 = 4;
  8908. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  8909. k1 = 2;
  8910. if(entity.smallXYIndex > 2)
  8911. k1 = 6;
  8912. if(entity.smallXYIndex > 3)
  8913. k1 = 8;
  8914. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  8915. {
  8916. k1 = 8;
  8917. entity.anInt1503--;
  8918. }
  8919. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  8920. k1 <<= 1;
  8921. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  8922. entity.anInt1517 = entity.anInt1505;
  8923. if(i < k)
  8924. {
  8925. entity.x += k1;
  8926. if(entity.x > k)
  8927. entity.x = k;
  8928. } else
  8929. if(i > k)
  8930. {
  8931. entity.x -= k1;
  8932. if(entity.x < k)
  8933. entity.x = k;
  8934. }
  8935. if(j < l)
  8936. {
  8937. entity.y += k1;
  8938. if(entity.y > l)
  8939. entity.y = l;
  8940. } else
  8941. if(j > l)
  8942. {
  8943. entity.y -= k1;
  8944. if(entity.y < l)
  8945. entity.y = l;
  8946. }
  8947. if(entity.x == k && entity.y == l)
  8948. {
  8949. entity.smallXYIndex--;
  8950. if(entity.anInt1542 > 0)
  8951. entity.anInt1542--;
  8952. }
  8953. }
  8954.  
  8955. private void method100(Entity entity)
  8956. {
  8957. if(entity.anInt1504 == 0)
  8958. return;
  8959. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  8960. {
  8961. NPC npc = npcArray[entity.interactingEntity];
  8962. if(npc != null)
  8963. {
  8964. int i1 = entity.x - npc.x;
  8965. int k1 = entity.y - npc.y;
  8966. if(i1 != 0 || k1 != 0)
  8967. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  8968. }
  8969. }
  8970. if(entity.interactingEntity >= 32768)
  8971. {
  8972. int j = entity.interactingEntity - 32768;
  8973. if(j == unknownInt10)
  8974. j = myPlayerIndex;
  8975. Player player = playerArray[j];
  8976. if(player != null)
  8977. {
  8978. int l1 = entity.x - player.x;
  8979. int i2 = entity.y - player.y;
  8980. if(l1 != 0 || i2 != 0)
  8981. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  8982. }
  8983. }
  8984. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  8985. {
  8986. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  8987. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  8988. if(k != 0 || j1 != 0)
  8989. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  8990. entity.anInt1538 = 0;
  8991. entity.anInt1539 = 0;
  8992. }
  8993. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8994. if(l != 0)
  8995. {
  8996. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8997. entity.anInt1552 = entity.turnDirection;
  8998. else
  8999. if(l > 1024)
  9000. entity.anInt1552 -= entity.anInt1504;
  9001. else
  9002. entity.anInt1552 += entity.anInt1504;
  9003. entity.anInt1552 &= 0x7ff;
  9004. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  9005. {
  9006. if(entity.anInt1512 != -1)
  9007. {
  9008. entity.anInt1517 = entity.anInt1512;
  9009. return;
  9010. }
  9011. entity.anInt1517 = entity.anInt1554;
  9012. }
  9013. }
  9014. }
  9015.  
  9016. public void method101(Entity entity) {
  9017. entity.aBoolean1541 = false;
  9018. if (entity.anInt1517 > Animation.anims.length)
  9019. entity.anInt1517 = -1;
  9020. if (entity.anInt1517 != -1) {
  9021. Animation animation = Animation.anims[entity.anInt1517];
  9022. entity.anInt1519++;
  9023. if (animation == null)
  9024. return;
  9025. if (entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518)) {
  9026. entity.anInt1519 = 0;
  9027. entity.anInt1518++;
  9028. }
  9029. if (entity.anInt1518 >= animation.anInt352) {
  9030. entity.anInt1519 = 0;
  9031. entity.anInt1518 = 0;
  9032. }
  9033. }
  9034. if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
  9035. if (entity.anInt1521 < 0)
  9036. entity.anInt1521 = 0;
  9037. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  9038. for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  9039. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  9040.  
  9041. if (entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  9042. entity.anInt1520 = -1;
  9043. }
  9044. if (entity.anim != -1 && entity.anInt1529 <= 1) {
  9045. Animation animation_2 = Animation.anims[entity.anim];
  9046. if (animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle) {
  9047. entity.anInt1529 = 1;
  9048. return;
  9049. }
  9050. }
  9051. if (entity.anim != -1 && entity.anInt1529 == 0) {
  9052. Animation animation_3 = Animation.anims[entity.anim];
  9053. for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  9054. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  9055.  
  9056. if (entity.anInt1527 >= animation_3.anInt352) {
  9057. entity.anInt1527 -= animation_3.anInt356;
  9058. entity.anInt1530++;
  9059. if (entity.anInt1530 >= animation_3.anInt362)
  9060. entity.anim = -1;
  9061. if (entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  9062. entity.anim = -1;
  9063. }
  9064. entity.aBoolean1541 = animation_3.aBoolean358;
  9065. }
  9066. if (entity.anInt1529 > 0)
  9067. entity.anInt1529--;
  9068. }
  9069. private void drawGameScreen()
  9070. {
  9071. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  9072. if (loadingStage == 2) {
  9073. method119(anInt945, fullscreenInterfaceID);
  9074. if (openInterfaceID != -1) {
  9075. method119(anInt945, openInterfaceID);
  9076. }
  9077. anInt945 = 0;
  9078. resetAllImageProducers();
  9079. super.fullGameScreen.initDrawingArea();
  9080. Texture.anIntArray1472 = fullScreenTextureArray;
  9081. DrawingArea.setAllPixelsToZero();
  9082. welcomeScreenRaised = true;
  9083. if (openInterfaceID != -1) {
  9084. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  9085. if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  9086. rsInterface_1.width = 765;
  9087. rsInterface_1.height = 503;
  9088. }
  9089. drawInterface(0, 0, rsInterface_1, 8);
  9090. }
  9091. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  9092. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  9093. rsInterface.width = 765;
  9094. rsInterface.height = 503;
  9095. }
  9096. drawInterface(0, 0, rsInterface, 8);
  9097.  
  9098. if (!menuOpen) {
  9099. processRightClick();
  9100. drawTooltip();
  9101. } else {
  9102. drawMenu();
  9103. }
  9104. }
  9105. drawCount++;
  9106. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  9107. return;
  9108. } else {
  9109. if (drawCount != 0) {
  9110. resetImageProducers2();
  9111. }
  9112. }
  9113. if(welcomeScreenRaised) {
  9114. welcomeScreenRaised = false;
  9115. topFrame.drawGraphics(0, super.graphics, 0);
  9116. leftFrame.drawGraphics(4, super.graphics, 0);
  9117. rightFrame.drawGraphics(4, super.graphics, 516);
  9118. mapEdgeIP.drawGraphics(4, super.graphics, 519);
  9119. needDrawTabArea = true;
  9120. inputTaken = true;
  9121. tabAreaAltered = true;
  9122. aBoolean1233 = true;
  9123. if(loadingStage != 2) {
  9124. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  9125. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  9126. }
  9127. }
  9128. if(menuOpen && menuScreenArea == 1)
  9129. needDrawTabArea = true;
  9130. if(invOverlayInterfaceID != -1)
  9131. {
  9132. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  9133. if(flag1)
  9134. needDrawTabArea = true;
  9135. }
  9136. if(atInventoryInterfaceType == 2)
  9137. needDrawTabArea = true;
  9138. if(activeInterfaceType == 2)
  9139. needDrawTabArea = true;
  9140. /*if(needDrawTabArea)
  9141. {*/
  9142. drawTabArea();
  9143. /*needDrawTabArea = false;
  9144. }*/
  9145. if(backDialogID == -1)
  9146. {
  9147. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  9148. if(super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  9149. method65(494, 110, super.mouseX - 0, super.mouseY - 348, aClass9_1059, 0, false, anInt1211);
  9150. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  9151. if(i < 0)
  9152. i = 0;
  9153. if(i > anInt1211 - 110)
  9154. i = anInt1211 - 110;
  9155. if(anInt1089 != i)
  9156. {
  9157. anInt1089 = i;
  9158. inputTaken = true;
  9159. }
  9160. }
  9161. if(backDialogID != -1) {
  9162. boolean flag2 = method119(anInt945, backDialogID);
  9163. if(flag2)
  9164. inputTaken = true;
  9165. }
  9166. if(atInventoryInterfaceType == 3)
  9167. inputTaken = true;
  9168. if(activeInterfaceType == 3)
  9169. inputTaken = true;
  9170. if(aString844 != null)
  9171. inputTaken = true;
  9172. if(menuOpen && menuScreenArea == 2)
  9173. inputTaken = true;
  9174. if(inputTaken) {
  9175. drawChatArea();
  9176. inputTaken = false;
  9177. }
  9178. if(loadingStage == 2)
  9179. method146();
  9180. if(loadingStage == 2) {
  9181. drawMinimap();
  9182. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  9183. }
  9184. if(anInt1054 != -1)
  9185. tabAreaAltered = true;
  9186. if(tabAreaAltered)
  9187. {
  9188. if(anInt1054 != -1 && anInt1054 == tabID)
  9189. {
  9190. anInt1054 = -1;
  9191. stream.createFrame(120);
  9192. stream.writeWordBigEndian(tabID);
  9193. }
  9194. tabAreaAltered = false;
  9195. aRSImageProducer_1125.initDrawingArea();
  9196. aRSImageProducer_1165.initDrawingArea();
  9197. }
  9198. anInt945 = 0;
  9199. }
  9200.  
  9201. private boolean buildFriendsListMenu(RSInterface class9)
  9202. {
  9203. int i = class9.contentType;
  9204. if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  9205. {
  9206. if(i >= 801)
  9207. i -= 701;
  9208. else
  9209. if(i >= 701)
  9210. i -= 601;
  9211. else
  9212. if(i >= 101)
  9213. i -= 101;
  9214. else
  9215. i--;
  9216. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  9217. menuActionID[menuActionRow] = 792;
  9218. menuActionRow++;
  9219. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  9220. menuActionID[menuActionRow] = 639;
  9221. menuActionRow++;
  9222. return true;
  9223. }
  9224. if(i >= 401 && i <= 500)
  9225. {
  9226. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  9227. menuActionID[menuActionRow] = 322;
  9228. menuActionRow++;
  9229. return true;
  9230. } else
  9231. {
  9232. return false;
  9233. }
  9234. }
  9235.  
  9236. private void method104()
  9237. {
  9238. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  9239. for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  9240. if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  9241. class30_sub2_sub4_sub3.unlink();
  9242. else
  9243. if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  9244. {
  9245. class30_sub2_sub4_sub3.method454(anInt945);
  9246. if(class30_sub2_sub4_sub3.aBoolean1567)
  9247. class30_sub2_sub4_sub3.unlink();
  9248. else
  9249. 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);
  9250. }
  9251.  
  9252. }
  9253.  
  9254. public void drawBlackBox(int xPos, int yPos) {
  9255. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  9256. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  9257. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  9258. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  9259. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  9260. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  9261. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  9262. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  9263. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  9264. }
  9265.  
  9266. private void drawInterface(int j, int k, RSInterface class9, int l) {
  9267. if(class9.type != 0 || class9.children == null)
  9268. return;
  9269. if(class9.isMouseoverTriggered && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  9270. return;
  9271. int i1 = DrawingArea.topX;
  9272. int j1 = DrawingArea.topY;
  9273. int k1 = DrawingArea.bottomX;
  9274. int l1 = DrawingArea.bottomY;
  9275. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  9276. int i2 = class9.children.length;
  9277. for(int j2 = 0; j2 < i2; j2++) {
  9278. int k2 = class9.childX[j2] + k;
  9279. int l2 = (class9.childY[j2] + l) - j;
  9280. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  9281. k2 += class9_1.anInt263;
  9282. l2 += class9_1.anInt265;
  9283. if(class9_1.contentType > 0)
  9284. drawFriendsListOrWelcomeScreen(class9_1);
  9285. //here
  9286. int[] IDs = {
  9287. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
  9288. 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
  9289. 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
  9290. 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
  9291. 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  9292. /* Ancients */
  9293. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
  9294. 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  9295. };
  9296. for(int m5 = 0; m5 < IDs.length; m5++) {
  9297. if(class9_1.id == IDs[m5] + 1) {
  9298. if(m5 > 61)
  9299. drawBlackBox(k2 + 1, l2);
  9300. else
  9301. drawBlackBox(k2, l2 + 1);
  9302. }
  9303. }
  9304. int[] runeChildren = {
  9305. 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
  9306. 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
  9307. 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
  9308. 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
  9309. 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
  9310. 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
  9311. 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
  9312. 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
  9313. 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
  9314. 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
  9315. 15885, 18474, 18475, 18478
  9316. };
  9317. for(int r = 0; r < runeChildren.length; r++)
  9318. if(class9_1.id == runeChildren[r])
  9319. class9_1.modelZoom = 775;
  9320. if(class9_1.type == 0) {
  9321. if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  9322. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  9323. if(class9_1.scrollPosition < 0)
  9324. class9_1.scrollPosition = 0;
  9325. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  9326. if(class9_1.scrollMax > class9_1.height)
  9327. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  9328. } else if(class9_1.type != 1)
  9329. if(class9_1.type == 2) {
  9330. int i3 = 0;
  9331. for(int l3 = 0; l3 < class9_1.height; l3++) {
  9332. for(int l4 = 0; l4 < class9_1.width; l4++) {
  9333. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  9334. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  9335. if(i3 < 20) {
  9336. k5 += class9_1.spritesX[i3];
  9337. j6 += class9_1.spritesY[i3];
  9338. }
  9339. if(class9_1.inv[i3] > 0) {
  9340. int k6 = 0;
  9341. int j7 = 0;
  9342. int j9 = class9_1.inv[i3] - 1;
  9343. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  9344. int l9 = 0;
  9345. if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  9346. l9 = 0xffffff;
  9347. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  9348. if(class30_sub2_sub1_sub1_2 != null) {
  9349. if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  9350. k6 = super.mouseX - anInt1087;
  9351. j7 = super.mouseY - anInt1088;
  9352. if(k6 < 5 && k6 > -5)
  9353. k6 = 0;
  9354. if(j7 < 5 && j7 > -5)
  9355. j7 = 0;
  9356. if(anInt989 < 5) {
  9357. k6 = 0;
  9358. j7 = 0;
  9359. }
  9360. class30_sub2_sub1_sub1_2.drawSprite1(k5 + k6, j6 + j7);
  9361. if(j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  9362. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  9363. if(i10 > anInt945 * 10)
  9364. i10 = anInt945 * 10;
  9365. if(i10 > class9.scrollPosition)
  9366. i10 = class9.scrollPosition;
  9367. class9.scrollPosition -= i10;
  9368. anInt1088 += i10;
  9369. }
  9370. if(j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  9371. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  9372. if(j10 > anInt945 * 10)
  9373. j10 = anInt945 * 10;
  9374. if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  9375. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  9376. class9.scrollPosition += j10;
  9377. anInt1088 -= j10;
  9378. }
  9379. } else if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  9380. class30_sub2_sub1_sub1_2.drawSprite1(k5, j6);
  9381. else
  9382. class30_sub2_sub1_sub1_2.drawSprite(k5, j6);
  9383. if(class30_sub2_sub1_sub1_2.anInt1444 == 33 || class9_1.invStackSizes[i3] != 1)
  9384. {
  9385. int k10 = class9_1.invStackSizes[i3];
  9386. if(k10 >= 1)
  9387. smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9388. if(k10 >= 100000)
  9389. smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9390. if(k10 >= 10000000)
  9391. smallText.method385(0x00ff80, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9392.  
  9393. /*smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  9394. smallText.method385(0xffff00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);*/
  9395. }
  9396. }
  9397. }
  9398. } else if(class9_1.sprites != null && i3 < 20) {
  9399. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  9400. if(class30_sub2_sub1_sub1_1 != null)
  9401. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  9402. }
  9403. i3++;
  9404. }
  9405. }
  9406. } else if(class9_1.type == 3) {
  9407. boolean flag = false;
  9408. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  9409. flag = true;
  9410. int j3;
  9411. if(interfaceIsSelected(class9_1)) {
  9412. j3 = class9_1.anInt219;
  9413. if(flag && class9_1.anInt239 != 0)
  9414. j3 = class9_1.anInt239;
  9415. } else {
  9416. j3 = class9_1.textColor;
  9417. if(flag && class9_1.anInt216 != 0)
  9418. j3 = class9_1.anInt216;
  9419. }
  9420. if(class9_1.aByte254 == 0) {
  9421. if(class9_1.aBoolean227)
  9422. DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  9423. else
  9424. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  9425. } else if(class9_1.aBoolean227)
  9426. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.aByte254 & 0xff), k2);
  9427. else
  9428. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.aByte254 & 0xff), j3, class9_1.width, k2);
  9429. } else if(class9_1.type == 4) {
  9430. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  9431. String s = class9_1.message;
  9432. boolean flag1 = false;
  9433. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  9434. flag1 = true;
  9435. int i4;
  9436. if(interfaceIsSelected(class9_1)) {
  9437. i4 = class9_1.anInt219;
  9438. if(flag1 && class9_1.anInt239 != 0)
  9439. i4 = class9_1.anInt239;
  9440. if(class9_1.aString228.length() > 0)
  9441. s = class9_1.aString228;
  9442. } else {
  9443. i4 = class9_1.textColor;
  9444. if(flag1 && class9_1.anInt216 != 0)
  9445. i4 = class9_1.anInt216;
  9446. }
  9447. if(class9_1.atActionType == 6 && aBoolean1149) {
  9448. s = "Please wait...";
  9449. i4 = class9_1.textColor;
  9450. }
  9451. if(DrawingArea.width == 519) {
  9452. if(i4 == 0xffff00)
  9453. i4 = 255;
  9454. if(i4 == 49152)
  9455. i4 = 0xffffff;
  9456. }
  9457. if((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  9458. switch (i4) {
  9459. case 16773120: i4 = 0xFE981F; break;
  9460. case 7040819: i4 = 0xAF6A1A; break;
  9461. }
  9462. }
  9463. for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
  9464. {
  9465. if(s.indexOf("%") != -1)
  9466. {
  9467. do
  9468. {
  9469. int k7 = s.indexOf("%1");
  9470. if(k7 == -1)
  9471. break;
  9472. 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)
  9473. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  9474. else
  9475. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  9476. } while(true);
  9477. do
  9478. {
  9479. int l7 = s.indexOf("%2");
  9480. if(l7 == -1)
  9481. break;
  9482. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  9483. } while(true);
  9484. do
  9485. {
  9486. int i8 = s.indexOf("%3");
  9487. if(i8 == -1)
  9488. break;
  9489. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  9490. } while(true);
  9491. do
  9492. {
  9493. int j8 = s.indexOf("%4");
  9494. if(j8 == -1)
  9495. break;
  9496. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  9497. } while(true);
  9498. do
  9499. {
  9500. int k8 = s.indexOf("%5");
  9501. if(k8 == -1)
  9502. break;
  9503. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  9504. } while(true);
  9505. }
  9506. int l8 = s.indexOf("\\n");
  9507. String s1;
  9508. if(l8 != -1)
  9509. {
  9510. s1 = s.substring(0, l8);
  9511. s = s.substring(l8 + 2);
  9512. } else
  9513. {
  9514. s1 = s;
  9515. s = "";
  9516. }
  9517. if(class9_1.centerText)
  9518. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadow);
  9519. else
  9520. textDrawingArea.method389(class9_1.textShadow, k2, i4, s1, l6);
  9521. }
  9522. } else if(class9_1.type == 5) {
  9523. Sprite sprite;
  9524. if(interfaceIsSelected(class9_1))
  9525. sprite = class9_1.sprite2;
  9526. else
  9527. sprite = class9_1.sprite1;
  9528. if(spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
  9529. sprite.drawSprite(k2, l2, 0xffffff);
  9530. } else {
  9531. if (sprite != null)
  9532. sprite.drawSprite(k2, l2);
  9533. }
  9534. if(sprite != null)
  9535. sprite.drawSprite(k2, l2);
  9536. } else if(class9_1.type == 6) {
  9537. int k3 = Texture.textureInt1;
  9538. int j4 = Texture.textureInt2;
  9539. Texture.textureInt1 = k2 + class9_1.width / 2;
  9540. Texture.textureInt2 = l2 + class9_1.height / 2;
  9541. int i5 = Texture.anIntArray1470[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  9542. int l5 = Texture.anIntArray1471[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  9543. boolean flag2 = interfaceIsSelected(class9_1);
  9544. int i7;
  9545. if(flag2)
  9546. i7 = class9_1.anInt258;
  9547. else
  9548. i7 = class9_1.anInt257;
  9549. Model model;
  9550. if(i7 == -1) {
  9551. model = class9_1.method209(-1, -1, flag2);
  9552. } else {
  9553. Animation animation = Animation.anims[i7];
  9554. model = class9_1.method209(animation.anIntArray354[class9_1.anInt246], animation.anIntArray353[class9_1.anInt246], flag2);
  9555. }
  9556. if(model != null)
  9557. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  9558. Texture.textureInt1 = k3;
  9559. Texture.textureInt2 = j4;
  9560. } else if(class9_1.type == 7) {
  9561. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  9562. int k4 = 0;
  9563. for(int j5 = 0; j5 < class9_1.height; j5++) {
  9564. for(int i6 = 0; i6 < class9_1.width; i6++) {
  9565. if(class9_1.inv[k4] > 0) {
  9566. ItemDef itemDef = ItemDef.forID(class9_1.inv[k4] - 1);
  9567. String s2 = itemDef.name;
  9568. if(itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  9569. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  9570. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  9571. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  9572. if(class9_1.centerText)
  9573. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadow);
  9574. else
  9575. textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  9576. }
  9577. k4++;
  9578. }
  9579. }
  9580. if(class9_1.type == 8) {
  9581. String hoverText;
  9582. if (interfaceIsSelected(class9_1)){
  9583. hoverText = class9_1.aString228;
  9584. }else
  9585. hoverText = class9_1.message;
  9586. drawHoverBox(k2, l2, hoverText);
  9587. }
  9588. }
  9589. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  9590. }
  9591. }
  9592.  
  9593.  
  9594. private void randomizeBackground(Background background) {
  9595. int j = 256;
  9596. for(int k = 0; k < anIntArray1190.length; k++)
  9597. anIntArray1190[k] = 0;
  9598.  
  9599. for(int l = 0; l < 5000; l++) {
  9600. int i1 = (int)(Math.random() * 128D * (double)j);
  9601. anIntArray1190[i1] = (int)(Math.random() * 256D);
  9602. }
  9603. for(int j1 = 0; j1 < 20; j1++) {
  9604. for(int k1 = 1; k1 < j - 1; k1++) {
  9605. for(int i2 = 1; i2 < 127; i2++) {
  9606. int k2 = i2 + (k1 << 7);
  9607. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  9608. }
  9609.  
  9610. }
  9611. int ai[] = anIntArray1190;
  9612. anIntArray1190 = anIntArray1191;
  9613. anIntArray1191 = ai;
  9614. }
  9615. if(background != null) {
  9616. int l1 = 0;
  9617. for(int j2 = 0; j2 < background.anInt1453; j2++) {
  9618. for(int l2 = 0; l2 < background.anInt1452; l2++)
  9619. if(background.aByteArray1450[l1++] != 0) {
  9620. int i3 = l2 + 16 + background.anInt1454;
  9621. int j3 = j2 + 16 + background.anInt1455;
  9622. int k3 = i3 + (j3 << 7);
  9623. anIntArray1190[k3] = 0;
  9624. }
  9625. }
  9626. }
  9627. }
  9628.  
  9629. private void method107(int i, int j, Stream stream, Player player)
  9630. {
  9631. if((i & 0x400) != 0)
  9632. {
  9633. player.anInt1543 = stream.method428();
  9634. player.anInt1545 = stream.method428();
  9635. player.anInt1544 = stream.method428();
  9636. player.anInt1546 = stream.method428();
  9637. player.anInt1547 = stream.method436() + loopCycle;
  9638. player.anInt1548 = stream.method435() + loopCycle;
  9639. player.anInt1549 = stream.method428();
  9640. player.method446();
  9641. }
  9642. if((i & 0x100) != 0)
  9643. {
  9644. player.anInt1520 = stream.method434();
  9645. int k = stream.readDWord();
  9646. player.anInt1524 = k >> 16;
  9647. player.anInt1523 = loopCycle + (k & 0xffff);
  9648. player.anInt1521 = 0;
  9649. player.anInt1522 = 0;
  9650. if(player.anInt1523 > loopCycle)
  9651. player.anInt1521 = -1;
  9652. if(player.anInt1520 == 65535)
  9653. player.anInt1520 = -1;
  9654. }
  9655. if((i & 8) != 0)
  9656. {
  9657. int l = stream.method434();
  9658. if(l == 65535)
  9659. l = -1;
  9660. int i2 = stream.method427();
  9661. if(l == player.anim && l != -1)
  9662. {
  9663. int i3 = Animation.anims[l].anInt365;
  9664. if(i3 == 1)
  9665. {
  9666. player.anInt1527 = 0;
  9667. player.anInt1528 = 0;
  9668. player.anInt1529 = i2;
  9669. player.anInt1530 = 0;
  9670. }
  9671. if(i3 == 2)
  9672. player.anInt1530 = 0;
  9673. } else
  9674. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  9675. {
  9676. player.anim = l;
  9677. player.anInt1527 = 0;
  9678. player.anInt1528 = 0;
  9679. player.anInt1529 = i2;
  9680. player.anInt1530 = 0;
  9681. player.anInt1542 = player.smallXYIndex;
  9682. }
  9683. }
  9684. if((i & 4) != 0)
  9685. {
  9686. player.textSpoken = stream.readString();
  9687. if(player.textSpoken.charAt(0) == '~')
  9688. {
  9689. player.textSpoken = player.textSpoken.substring(1);
  9690. pushMessage(player.textSpoken, 2, player.name);
  9691. } else
  9692. if(player == myPlayer)
  9693. pushMessage(player.textSpoken, 2, player.name);
  9694. player.anInt1513 = 0;
  9695. player.anInt1531 = 0;
  9696. player.textCycle = 150;
  9697. }
  9698. if((i & 0x80) != 0)
  9699. {
  9700. //right fucking here
  9701. int i1 = stream.method434();
  9702. int j2 = stream.readUnsignedByte();
  9703. int j3 = stream.method427();
  9704. int k3 = stream.currentOffset;
  9705. if(player.name != null && player.visible)
  9706. {
  9707. long l3 = TextClass.longForName(player.name);
  9708. boolean flag = false;
  9709. if(j2 <= 1)
  9710. {
  9711. for(int i4 = 0; i4 < ignoreCount; i4++)
  9712. {
  9713. if(ignoreListAsLongs[i4] != l3)
  9714. continue;
  9715. flag = true;
  9716. break;
  9717. }
  9718.  
  9719. }
  9720. if(!flag && anInt1251 == 0)
  9721. try
  9722. {
  9723. aStream_834.currentOffset = 0;
  9724. stream.method442(j3, 0, aStream_834.buffer);
  9725. aStream_834.currentOffset = 0;
  9726. String s = TextInput.method525(j3, aStream_834);
  9727. //s = Censor.doCensor(s);
  9728. player.textSpoken = s;
  9729. player.anInt1513 = i1 >> 8;
  9730. player.privelage = j2;
  9731. player.anInt1531 = i1 & 0xff;
  9732. player.textCycle = 150;
  9733. switch (j2) {
  9734. case 1:
  9735. pushMessage(s, 2, "@cr1@" + "<col="+titleColor(player.titleColor, 0)+">" + player.title + "</col>" + player.name);
  9736. break;
  9737. case 2:
  9738. pushMessage(s, 2, "@cr2@" + "<col="+titleColor(player.titleColor, 0)+">" + player.title + "</col>" + player.name);
  9739. break;
  9740. case 3:
  9741. pushMessage(s, 2, "@cr3@" + "<col="+titleColor(player.titleColor, 0)+">" + player.title + "</col>" + player.name);
  9742. break;
  9743. case 4:
  9744. pushMessage(s, 2, "@cr4@" + "<col="+titleColor(player.titleColor, 0)+">" + player.title + "</col>" + player.name);
  9745. break;
  9746. case 5:
  9747. pushMessage(s, 2, "@cr5@" + "<col="+titleColor(player.titleColor, 0)+">" + player.title + "</col>" + player.name);
  9748. break;
  9749. case 6:
  9750. pushMessage(s, 2, "@cr6@" + "<col="+titleColor(player.titleColor, 0)+">" + player.title + "</col>" + player.name);
  9751. break;
  9752. case 7:
  9753. pushMessage(s, 2, "@cr7@" + "<col="+titleColor(player.titleColor, 0)+">" + player.title + "</col>" + player.name);
  9754. break;
  9755. case 8:
  9756. pushMessage(s, 2, "@cr8@" + "<col="+titleColor(player.titleColor, 0)+">" + player.title + "</col>" + player.name);
  9757. break;
  9758. default:
  9759. pushMessage(s, 1, "<col="+titleColor(player.titleColor, 0)+">" + player.title + "</col>" + player.name);
  9760. break;
  9761. }
  9762. //pushMessage(s, j2 > 0 ? 1 : 2, (j2 > 0 ? "@cr" + j2 + "@" : "") + player.name);
  9763. }
  9764. catch(Exception exception)
  9765. {
  9766. signlink.reporterror("cde2");
  9767. }
  9768. }
  9769. stream.currentOffset = k3 + j3;
  9770. }
  9771. if((i & 1) != 0)
  9772. {
  9773. player.interactingEntity = stream.method434();
  9774. if(player.interactingEntity == 65535)
  9775. player.interactingEntity = -1;
  9776. }
  9777. if((i & 0x10) != 0)
  9778. {
  9779. int j1 = stream.method427();
  9780. byte abyte0[] = new byte[j1];
  9781. Stream stream_1 = new Stream(abyte0);
  9782. stream.readBytes(j1, 0, abyte0);
  9783. aStreamArray895s[j] = stream_1;
  9784. player.updatePlayer(stream_1);
  9785. }
  9786. if((i & 2) != 0)
  9787. {
  9788. player.anInt1538 = stream.method436();
  9789. player.anInt1539 = stream.method434();
  9790. }
  9791. if((i & 0x20) != 0)
  9792. {
  9793. int k1 = stream.readUnsignedByte();
  9794. int k2 = stream.method426();
  9795. player.updateHitData(k2, k1, loopCycle);
  9796. player.loopCycleStatus = loopCycle + 300;
  9797. player.currentHealth = stream.method427();
  9798. player.maxHealth = stream.readUnsignedByte();
  9799. }
  9800. if((i & 0x200) != 0)
  9801. {
  9802. int l1 = stream.readUnsignedByte();
  9803. int l2 = stream.method428();
  9804. player.updateHitData(l2, l1, loopCycle);
  9805. player.loopCycleStatus = loopCycle + 300;
  9806. player.currentHealth = stream.readUnsignedByte();
  9807. player.maxHealth = stream.method427();
  9808. }
  9809. }
  9810.  
  9811. private void method108()
  9812. {
  9813. try
  9814. {
  9815. int j = myPlayer.x + anInt1278;
  9816. int k = myPlayer.y + anInt1131;
  9817. if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  9818. {
  9819. anInt1014 = j;
  9820. anInt1015 = k;
  9821. }
  9822. if(anInt1014 != j)
  9823. anInt1014 += (j - anInt1014) / 16;
  9824. if(anInt1015 != k)
  9825. anInt1015 += (k - anInt1015) / 16;
  9826. if(super.keyArray[1] == 1)
  9827. anInt1186 += (-24 - anInt1186) / 2;
  9828. else
  9829. if(super.keyArray[2] == 1)
  9830. anInt1186 += (24 - anInt1186) / 2;
  9831. else
  9832. anInt1186 /= 2;
  9833. if(super.keyArray[3] == 1)
  9834. anInt1187 += (12 - anInt1187) / 2;
  9835. else
  9836. if(super.keyArray[4] == 1)
  9837. anInt1187 += (-12 - anInt1187) / 2;
  9838. else
  9839. anInt1187 /= 2;
  9840. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  9841. anInt1184 += anInt1187 / 2;
  9842. if(anInt1184 < 128)
  9843. anInt1184 = 128;
  9844. if(anInt1184 > 383)
  9845. anInt1184 = 383;
  9846. int l = anInt1014 >> 7;
  9847. int i1 = anInt1015 >> 7;
  9848. int j1 = method42(plane, anInt1015, anInt1014);
  9849. int k1 = 0;
  9850. if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  9851. {
  9852. for(int l1 = l - 4; l1 <= l + 4; l1++)
  9853. {
  9854. for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  9855. {
  9856. int l2 = plane;
  9857. if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  9858. l2++;
  9859. int i3 = j1 - intGroundArray[l2][l1][k2];
  9860. if(i3 > k1)
  9861. k1 = i3;
  9862. }
  9863.  
  9864. }
  9865.  
  9866. }
  9867. anInt1005++;
  9868. if(anInt1005 > 1512)
  9869. {
  9870. anInt1005 = 0;
  9871. stream.createFrame(77);
  9872. stream.writeWordBigEndian(0);
  9873. int i2 = stream.currentOffset;
  9874. stream.writeWordBigEndian((int)(Math.random() * 256D));
  9875. stream.writeWordBigEndian(101);
  9876. stream.writeWordBigEndian(233);
  9877. stream.writeWord(45092);
  9878. if((int)(Math.random() * 2D) == 0)
  9879. stream.writeWord(35784);
  9880. stream.writeWordBigEndian((int)(Math.random() * 256D));
  9881. stream.writeWordBigEndian(64);
  9882. stream.writeWordBigEndian(38);
  9883. stream.writeWord((int)(Math.random() * 65536D));
  9884. stream.writeWord((int)(Math.random() * 65536D));
  9885. stream.writeBytes(stream.currentOffset - i2);
  9886. }
  9887. int j2 = k1 * 192;
  9888. if(j2 > 0x17f00)
  9889. j2 = 0x17f00;
  9890. if(j2 < 32768)
  9891. j2 = 32768;
  9892. if(j2 > anInt984)
  9893. {
  9894. anInt984 += (j2 - anInt984) / 24;
  9895. return;
  9896. }
  9897. if(j2 < anInt984)
  9898. {
  9899. anInt984 += (j2 - anInt984) / 80;
  9900. }
  9901. }
  9902. catch(Exception _ex)
  9903. {
  9904. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  9905. throw new RuntimeException("eek");
  9906. }
  9907. }
  9908.  
  9909. public void processDrawing()
  9910. {
  9911. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  9912. {
  9913. showErrorScreen();
  9914. return;
  9915. }
  9916. anInt1061++;
  9917. if(!loggedIn)
  9918. drawLoginScreen(false);
  9919. else
  9920. drawGameScreen();
  9921. anInt1213 = 0;
  9922. }
  9923.  
  9924. private boolean isFriendOrSelf(String s)
  9925. {
  9926. if(s == null)
  9927. return false;
  9928. for(int i = 0; i < friendsCount; i++)
  9929. if(s.equalsIgnoreCase(friendsList[i]))
  9930. return true;
  9931. return s.equalsIgnoreCase(myPlayer.name);
  9932. }
  9933.  
  9934. private static String combatDiffColor(int i, int j)
  9935. {
  9936. int k = i - j;
  9937. if(k < -9)
  9938. return "@red@";
  9939. if(k < -6)
  9940. return "@or3@";
  9941. if(k < -3)
  9942. return "@or2@";
  9943. if(k < 0)
  9944. return "@or1@";
  9945. if(k > 9)
  9946. return "@gre@";
  9947. if(k > 6)
  9948. return "@gr3@";
  9949. if(k > 3)
  9950. return "@gr2@";
  9951. if(k > 0)
  9952. return "@gr1@";
  9953. else
  9954. return "@yel@";
  9955. }
  9956.  
  9957. private void setWaveVolume(int i)
  9958. {
  9959. signlink.wavevol = i;
  9960. }
  9961.  
  9962. private void draw3dScreen()
  9963. {
  9964. drawSplitPrivateChat();
  9965. if(crossType == 1)
  9966. {
  9967. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9968. anInt1142++;
  9969. if(anInt1142 > 67)
  9970. {
  9971. anInt1142 = 0;
  9972. stream.createFrame(78);
  9973. }
  9974. }
  9975. if(crossType == 2)
  9976. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9977. if(anInt1018 != -1)
  9978. {
  9979. method119(anInt945, anInt1018);
  9980. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  9981. }
  9982. if(openInterfaceID != -1)
  9983. {
  9984. method119(anInt945, openInterfaceID);
  9985. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  9986. }
  9987. method70();
  9988. if(!menuOpen)
  9989. {
  9990. processRightClick();
  9991. drawTooltip();
  9992. } else
  9993. if(menuScreenArea == 0)
  9994. drawMenu();
  9995. if(anInt1055 == 1)
  9996. multiOverlay.drawSprite(472, 296);
  9997. if(fpsOn)
  9998. {
  9999. char c = '\u01FB';
  10000. int k = 20;
  10001. int i1 = 0xffff00;
  10002. if(super.fps < 15)
  10003. i1 = 0xff0000;
  10004. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  10005. k += 15;
  10006. Runtime runtime = Runtime.getRuntime();
  10007. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10008. i1 = 0xffff00;
  10009. if(j1 > 0x2000000 && lowMem)
  10010. i1 = 0xff0000;
  10011. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  10012. k += 15;
  10013. }
  10014. int i1 = 0xffff00;
  10015. int x = baseX + (myPlayer.x - 6 >> 7);
  10016. int y = baseY + (myPlayer.y - 6 >> 7);
  10017. if (clientData)
  10018. {
  10019. char c = '\u01FB';
  10020. int k = 20;
  10021. if(super.fps < 15)
  10022. i1 = 0xff0000;
  10023. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285, 5);
  10024. Runtime runtime = Runtime.getRuntime();
  10025. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10026. i1 = 0xffff00;
  10027. if(j1 > 0x2000000 && lowMem)
  10028. i1 = 0xff0000;
  10029. k += 15;
  10030. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299, 5);
  10031. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  10032. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
  10033. }
  10034. if(anInt1104 != 0)
  10035. {
  10036. int j = anInt1104 / 50;
  10037. int l = j / 60;
  10038. j %= 60;
  10039. if(j < 10)
  10040. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  10041. else
  10042. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  10043. anInt849++;
  10044. if(anInt849 > 75)
  10045. {
  10046. anInt849 = 0;
  10047. stream.createFrame(148);
  10048. }
  10049. }
  10050. }
  10051.  
  10052. private void addIgnore(long l)
  10053. {
  10054. try
  10055. {
  10056. if(l == 0L)
  10057. return;
  10058. if(ignoreCount >= 100)
  10059. {
  10060. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  10061. return;
  10062. }
  10063. String s = TextClass.fixName(TextClass.nameForLong(l));
  10064. for(int j = 0; j < ignoreCount; j++)
  10065. if(ignoreListAsLongs[j] == l)
  10066. {
  10067. pushMessage(s + " is already on your ignore list", 0, "");
  10068. return;
  10069. }
  10070. for(int k = 0; k < friendsCount; k++)
  10071. if(friendsListAsLongs[k] == l)
  10072. {
  10073. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  10074. return;
  10075. }
  10076.  
  10077. ignoreListAsLongs[ignoreCount++] = l;
  10078. needDrawTabArea = true;
  10079. stream.createFrame(133);
  10080. stream.writeQWord(l);
  10081. return;
  10082. }
  10083. catch(RuntimeException runtimeexception)
  10084. {
  10085. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  10086. }
  10087. throw new RuntimeException();
  10088. }
  10089.  
  10090. private void method114()
  10091. {
  10092. for(int i = -1; i < playerCount; i++)
  10093. {
  10094. int j;
  10095. if(i == -1)
  10096. j = myPlayerIndex;
  10097. else
  10098. j = playerIndices[i];
  10099. Player player = playerArray[j];
  10100. if(player != null)
  10101. method96(player);
  10102. }
  10103.  
  10104. }
  10105.  
  10106. private void method115()
  10107. {
  10108. if(loadingStage == 2)
  10109. {
  10110. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10111. {
  10112. if(class30_sub1.anInt1294 > 0)
  10113. class30_sub1.anInt1294--;
  10114. if(class30_sub1.anInt1294 == 0)
  10115. {
  10116. if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  10117. {
  10118. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  10119. class30_sub1.unlink();
  10120. }
  10121. } else
  10122. {
  10123. if(class30_sub1.anInt1302 > 0)
  10124. class30_sub1.anInt1302--;
  10125. 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)))
  10126. {
  10127. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  10128. class30_sub1.anInt1302 = -1;
  10129. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  10130. class30_sub1.unlink();
  10131. else
  10132. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  10133. class30_sub1.unlink();
  10134. }
  10135. }
  10136. }
  10137.  
  10138. }
  10139. }
  10140.  
  10141.  
  10142. //stops the click from going over sprite
  10143. private void determineMenuSize()
  10144. {
  10145. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  10146. for(int j = 0; j < menuActionRow; j++)
  10147. {
  10148. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  10149. if(k > i)
  10150. i = k;
  10151. }
  10152.  
  10153. i += 8;
  10154. int l = 15 * menuActionRow + 21;
  10155. if(super.saveClickX > 4 && super.saveClickY > 4 && super.saveClickX < 516 && super.saveClickY < 338)
  10156. {
  10157. int i1 = super.saveClickX - 4 - i / 2;
  10158. if(i1 + i > 512)
  10159. i1 = 512 - i;
  10160. if(i1 < 0)
  10161. i1 = 0;
  10162. int l1 = super.saveClickY - 4;
  10163. if(l1 + l > 334)
  10164. l1 = 334 - l;
  10165. if(l1 < 0)
  10166. l1 = 0;
  10167. menuOpen = true;
  10168. menuScreenArea = 0;
  10169. menuOffsetX = i1;
  10170. menuOffsetY = l1;
  10171. menuWidth = i;
  10172. menuHeight = 15 * menuActionRow + 22;
  10173. }
  10174. if(super.saveClickX > 519 && super.saveClickY > 168 && super.saveClickX < 765 && super.saveClickY < 503)
  10175. {
  10176. int j1 = super.saveClickX - 519 - i / 2;
  10177. if(j1 < 0)
  10178. j1 = 0;
  10179. else
  10180. if(j1 + i > 245)
  10181. j1 = 245 - i;
  10182. int i2 = super.saveClickY - 168;
  10183. if(i2 < 0)
  10184. i2 = 0;
  10185. else
  10186. if(i2 + l > 333)
  10187. i2 = 333 - l;
  10188. menuOpen = true;
  10189. menuScreenArea = 1;
  10190. menuOffsetX = j1;
  10191. menuOffsetY = i2;
  10192. menuWidth = i;
  10193. menuHeight = 15 * menuActionRow + 22;
  10194. }
  10195. if(super.saveClickX > 0 && super.saveClickY > 338 && super.saveClickX < 516 && super.saveClickY < 503)
  10196. {
  10197. int k1 = super.saveClickX - 0 - i / 2;
  10198. if(k1 < 0)
  10199. k1 = 0;
  10200. else
  10201. if(k1 + i > 516)
  10202. k1 = 516 - i;
  10203. int j2 = super.saveClickY - 338;
  10204. if(j2 < 0)
  10205. j2 = 0;
  10206. else
  10207. if(j2 + l > 165)
  10208. j2 = 165 - l;
  10209. menuOpen = true;
  10210. menuScreenArea = 2;
  10211. menuOffsetX = k1;
  10212. menuOffsetY = j2;
  10213. menuWidth = i;
  10214. menuHeight = 15 * menuActionRow + 22;
  10215. }
  10216. if (super.saveClickX >= 515 && super.saveClickY >= 0 && super.saveClickX <= 765 && super.saveClickY <= 169) {
  10217. int k1 = super.saveClickX -515- i / 2;
  10218. if (k1 < 0)
  10219. k1 = 0;
  10220. else if (k1 + i > 249)
  10221. k1 =249-i;
  10222. int j2 = super.saveClickY;
  10223. if (j2 < 0)
  10224. j2 = 0;
  10225. else if (j2 + l > 168)
  10226. j2 = 168 - l;
  10227. menuOpen = true;
  10228. menuScreenArea = 3;
  10229. menuOffsetX = k1;
  10230. menuOffsetY = j2;
  10231. menuWidth = i;
  10232. menuHeight = 15 * menuActionRow + 22;
  10233. }
  10234. }
  10235.  
  10236. private void method117(Stream stream)
  10237. {
  10238. stream.initBitAccess();
  10239. int j = stream.readBits(1);
  10240. if(j == 0)
  10241. return;
  10242. int k = stream.readBits(2);
  10243. if(k == 0)
  10244. {
  10245. anIntArray894[anInt893++] = myPlayerIndex;
  10246. return;
  10247. }
  10248. if(k == 1)
  10249. {
  10250. int l = stream.readBits(3);
  10251. myPlayer.moveInDir(false, l);
  10252. int k1 = stream.readBits(1);
  10253. if(k1 == 1)
  10254. anIntArray894[anInt893++] = myPlayerIndex;
  10255. return;
  10256. }
  10257. if(k == 2)
  10258. {
  10259. int i1 = stream.readBits(3);
  10260. myPlayer.moveInDir(true, i1);
  10261. int l1 = stream.readBits(3);
  10262. myPlayer.moveInDir(true, l1);
  10263. int j2 = stream.readBits(1);
  10264. if(j2 == 1)
  10265. anIntArray894[anInt893++] = myPlayerIndex;
  10266. return;
  10267. }
  10268. if(k == 3)
  10269. {
  10270. plane = stream.readBits(2);
  10271. int j1 = stream.readBits(1);
  10272. int i2 = stream.readBits(1);
  10273. if(i2 == 1)
  10274. anIntArray894[anInt893++] = myPlayerIndex;
  10275. int k2 = stream.readBits(7);
  10276. int l2 = stream.readBits(7);
  10277. myPlayer.setPos(l2, k2, j1 == 1);
  10278. }
  10279. }
  10280.  
  10281. private void nullLoader()
  10282. {
  10283. aBoolean831 = false;
  10284. while(drawingFlames)
  10285. {
  10286. aBoolean831 = false;
  10287. try
  10288. {
  10289. Thread.sleep(50L);
  10290. }
  10291. catch(Exception _ex) { }
  10292. }
  10293. aBackground_966 = null;
  10294. aBackground_967 = null;
  10295. aBackgroundArray1152s = null;
  10296. anIntArray850 = null;
  10297. anIntArray851 = null;
  10298. anIntArray852 = null;
  10299. anIntArray853 = null;
  10300. anIntArray1190 = null;
  10301. anIntArray1191 = null;
  10302. anIntArray828 = null;
  10303. anIntArray829 = null;
  10304. aClass30_Sub2_Sub1_Sub1_1201 = null;
  10305. aClass30_Sub2_Sub1_Sub1_1202 = null;
  10306. }
  10307.  
  10308. private boolean method119(int i, int j)
  10309. {
  10310. boolean flag1 = false;
  10311. RSInterface class9 = RSInterface.interfaceCache[j];
  10312. for(int k = 0; k < class9.children.length; k++)
  10313. {
  10314. if(class9.children[k] == -1)
  10315. break;
  10316. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  10317. if(class9_1.type == 1)
  10318. flag1 |= method119(i, class9_1.id);
  10319. if(class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1))
  10320. {
  10321. boolean flag2 = interfaceIsSelected(class9_1);
  10322. int l;
  10323. if(flag2)
  10324. l = class9_1.anInt258;
  10325. else
  10326. l = class9_1.anInt257;
  10327. if(l != -1)
  10328. {
  10329. Animation animation = Animation.anims[l];
  10330. for(class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);)
  10331. {
  10332. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  10333. class9_1.anInt246++;
  10334. if(class9_1.anInt246 >= animation.anInt352)
  10335. {
  10336. class9_1.anInt246 -= animation.anInt356;
  10337. if(class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  10338. class9_1.anInt246 = 0;
  10339. }
  10340. flag1 = true;
  10341. }
  10342.  
  10343. }
  10344. }
  10345. }
  10346.  
  10347. return flag1;
  10348. }
  10349.  
  10350. private int method120()
  10351. {
  10352. int j = 3;
  10353. if(yCameraCurve < 310)
  10354. {
  10355. int k = xCameraPos >> 7;
  10356. int l = yCameraPos >> 7;
  10357. int i1 = myPlayer.x >> 7;
  10358. int j1 = myPlayer.y >> 7;
  10359. if((byteGroundArray[plane][k][l] & 4) != 0)
  10360. j = plane;
  10361. int k1;
  10362. if(i1 > k)
  10363. k1 = i1 - k;
  10364. else
  10365. k1 = k - i1;
  10366. int l1;
  10367. if(j1 > l)
  10368. l1 = j1 - l;
  10369. else
  10370. l1 = l - j1;
  10371. if(k1 > l1)
  10372. {
  10373. int i2 = (l1 * 0x10000) / k1;
  10374. int k2 = 32768;
  10375. while(k != i1)
  10376. {
  10377. if(k < i1)
  10378. k++;
  10379. else
  10380. if(k > i1)
  10381. k--;
  10382. if((byteGroundArray[plane][k][l] & 4) != 0)
  10383. j = plane;
  10384. k2 += i2;
  10385. if(k2 >= 0x10000)
  10386. {
  10387. k2 -= 0x10000;
  10388. if(l < j1)
  10389. l++;
  10390. else
  10391. if(l > j1)
  10392. l--;
  10393. if((byteGroundArray[plane][k][l] & 4) != 0)
  10394. j = plane;
  10395. }
  10396. }
  10397. } else
  10398. {
  10399. int j2 = (k1 * 0x10000) / l1;
  10400. int l2 = 32768;
  10401. while(l != j1)
  10402. {
  10403. if(l < j1)
  10404. l++;
  10405. else
  10406. if(l > j1)
  10407. l--;
  10408. if((byteGroundArray[plane][k][l] & 4) != 0)
  10409. j = plane;
  10410. l2 += j2;
  10411. if(l2 >= 0x10000)
  10412. {
  10413. l2 -= 0x10000;
  10414. if(k < i1)
  10415. k++;
  10416. else
  10417. if(k > i1)
  10418. k--;
  10419. if((byteGroundArray[plane][k][l] & 4) != 0)
  10420. j = plane;
  10421. }
  10422. }
  10423. }
  10424. }
  10425. if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  10426. j = plane;
  10427. return j;
  10428. }
  10429.  
  10430. private int method121()
  10431. {
  10432. int j = method42(plane, yCameraPos, xCameraPos);
  10433. if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  10434. return plane;
  10435. else
  10436. return 3;
  10437. }
  10438.  
  10439. private void delIgnore(long l)
  10440. {
  10441. try
  10442. {
  10443. if(l == 0L)
  10444. return;
  10445. for(int j = 0; j < ignoreCount; j++)
  10446. if(ignoreListAsLongs[j] == l)
  10447. {
  10448. ignoreCount--;
  10449. needDrawTabArea = true;
  10450. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  10451.  
  10452. stream.createFrame(74);
  10453. stream.writeQWord(l);
  10454. return;
  10455. }
  10456.  
  10457. return;
  10458. }
  10459. catch(RuntimeException runtimeexception)
  10460. {
  10461. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  10462. }
  10463. throw new RuntimeException();
  10464. }
  10465.  
  10466.  
  10467. private void chatJoin(long l) {
  10468. try {
  10469. if(l == 0L)
  10470. return;
  10471. stream.createFrame(60);
  10472. stream.writeQWord(l);
  10473. return;
  10474. }
  10475. catch(RuntimeException runtimeexception)
  10476. {
  10477. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  10478. }
  10479. throw new RuntimeException();
  10480.  
  10481. }
  10482.  
  10483. public String getParameter(String s)
  10484. {
  10485. if(signlink.mainapp != null)
  10486. return signlink.mainapp.getParameter(s);
  10487. else
  10488. return super.getParameter(s);
  10489. }
  10490.  
  10491. private void adjustVolume(boolean flag, int i)
  10492. {
  10493. signlink.midivol = i;
  10494. if(flag)
  10495. signlink.midi = "voladjust";
  10496. }
  10497.  
  10498. private int extractInterfaceValues(RSInterface class9, int j)
  10499. {
  10500. if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  10501. return -2;
  10502. try
  10503. {
  10504. int ai[] = class9.valueIndexArray[j];
  10505. int k = 0;
  10506. int l = 0;
  10507. int i1 = 0;
  10508. do
  10509. {
  10510. int j1 = ai[l++];
  10511. int k1 = 0;
  10512. byte byte0 = 0;
  10513. if(j1 == 0)
  10514. return k;
  10515. if(j1 == 1)
  10516. k1 = currentStats[ai[l++]];
  10517. if(j1 == 2)
  10518. k1 = maxStats[ai[l++]];
  10519. if(j1 == 3)
  10520. k1 = currentExp[ai[l++]];
  10521. if(j1 == 4)
  10522. {
  10523. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  10524. int k2 = ai[l++];
  10525. if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  10526. {
  10527. for(int j3 = 0; j3 < class9_1.inv.length; j3++)
  10528. if(class9_1.inv[j3] == k2 + 1)
  10529. k1 += class9_1.invStackSizes[j3];
  10530.  
  10531. }
  10532. }
  10533. if(j1 == 5)
  10534. k1 = variousSettings[ai[l++]];
  10535. if(j1 == 6)
  10536. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  10537. if(j1 == 7)
  10538. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  10539. if(j1 == 8)
  10540. k1 = myPlayer.combatLevel;
  10541. if(j1 == 9)
  10542. {
  10543. for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  10544. if(Skills.skillEnabled[l1])
  10545. k1 += maxStats[l1];
  10546.  
  10547. }
  10548. if(j1 == 10)
  10549. {
  10550. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  10551. int l2 = ai[l++] + 1;
  10552. if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  10553. {
  10554. for(int k3 = 0; k3 < class9_2.inv.length; k3++)
  10555. {
  10556. if(class9_2.inv[k3] != l2)
  10557. continue;
  10558. k1 = 0x3b9ac9ff;
  10559. break;
  10560. }
  10561.  
  10562. }
  10563. }
  10564. if(j1 == 11)
  10565. k1 = energy;
  10566. if(j1 == 12)
  10567. k1 = weight;
  10568. if(j1 == 13)
  10569. {
  10570. int i2 = variousSettings[ai[l++]];
  10571. int i3 = ai[l++];
  10572. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  10573. }
  10574. if(j1 == 14)
  10575. {
  10576. int j2 = ai[l++];
  10577. VarBit varBit = VarBit.cache[j2];
  10578. int l3 = varBit.anInt648;
  10579. int i4 = varBit.anInt649;
  10580. int j4 = varBit.anInt650;
  10581. int k4 = anIntArray1232[j4 - i4];
  10582. k1 = variousSettings[l3] >> i4 & k4;
  10583. }
  10584. if(j1 == 15)
  10585. byte0 = 1;
  10586. if(j1 == 16)
  10587. byte0 = 2;
  10588. if(j1 == 17)
  10589. byte0 = 3;
  10590. if(j1 == 18)
  10591. k1 = (myPlayer.x >> 7) + baseX;
  10592. if(j1 == 19)
  10593. k1 = (myPlayer.y >> 7) + baseY;
  10594. if(j1 == 20)
  10595. k1 = ai[l++];
  10596. if(byte0 == 0)
  10597. {
  10598. if(i1 == 0)
  10599. k += k1;
  10600. if(i1 == 1)
  10601. k -= k1;
  10602. if(i1 == 2 && k1 != 0)
  10603. k /= k1;
  10604. if(i1 == 3)
  10605. k *= k1;
  10606. i1 = 0;
  10607. } else
  10608. {
  10609. i1 = byte0;
  10610. }
  10611. } while(true);
  10612. }
  10613. catch(Exception _ex)
  10614. {
  10615. return -1;
  10616. }
  10617. }
  10618.  
  10619. private void drawTooltip() {
  10620. if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  10621. return;
  10622. String s;
  10623. if(itemSelected == 1 && menuActionRow < 2)
  10624. s = "Use " + selectedItemName + " with...";
  10625. else if(spellSelected == 1 && menuActionRow < 2)
  10626. s = spellTooltip + "...";
  10627. else
  10628. s = menuActionName[menuActionRow - 1];
  10629. if(menuActionRow > 2)
  10630. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  10631. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  10632. }
  10633.  
  10634. private void drawMinimap() {
  10635. aRSImageProducer_1164.initDrawingArea();
  10636. if(anInt1021 == 2) {
  10637. byte abyte0[] = mapBack.aByteArray1450;
  10638. int ai[] = DrawingArea.pixels;
  10639. int k2 = abyte0.length;
  10640. for(int i5 = 0; i5 < k2; i5++)
  10641. if(abyte0[i5] == 0)
  10642. ai[i5] = 0;
  10643. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 8, 8, 33, 25);
  10644. aRSImageProducer_1165.initDrawingArea();
  10645. return;
  10646. }
  10647. int i = minimapInt1 + minimapInt2 & 0x7ff;
  10648. int j = 48 + myPlayer.x / 32;
  10649. int l2 = 464 - myPlayer.y / 32;
  10650. for (int x = 0; x < anIntArray1229.length; x++){
  10651. anIntArray1229[x] = 170;
  10652. anIntArray1052[x] = -23;
  10653. }
  10654. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, 10, 45, 146, j);
  10655. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 8, 8, 33, 25);
  10656. for(int j5 = 0; j5 < anInt1071; j5++) {
  10657. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  10658. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  10659. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  10660. }
  10661.  
  10662. for(int k5 = 0; k5 < 104; k5++) {
  10663. for(int l5 = 0; l5 < 104; l5++) {
  10664. NodeList class19 = groundArray[plane][k5][l5];
  10665. if(class19 != null) {
  10666. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  10667. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  10668. markMinimap(mapDotItem, l, j3);
  10669. }
  10670. }
  10671. }
  10672.  
  10673. for(int i6 = 0; i6 < npcCount; i6++) {
  10674. NPC npc = npcArray[npcIndices[i6]];
  10675. if(npc != null && npc.isVisible()) {
  10676. EntityDef entityDef = npc.desc;
  10677. if(entityDef.childrenIDs != null)
  10678. entityDef = entityDef.method161();
  10679. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  10680. int i1 = npc.x / 32 - myPlayer.x / 32;
  10681. int k3 = npc.y / 32 - myPlayer.y / 32;
  10682. markMinimap(mapDotNPC, i1, k3);
  10683. }
  10684. }
  10685. }
  10686.  
  10687. for(int j6 = 0; j6 < playerCount; j6++) {
  10688. Player player = playerArray[playerIndices[j6]];
  10689. if(player != null && player.isVisible()) {
  10690. int j1 = player.x / 32 - myPlayer.x / 32;
  10691. int l3 = player.y / 32 - myPlayer.y / 32;
  10692. boolean flag1 = false;
  10693. long l6 = TextClass.longForName(player.name);
  10694. for(int k6 = 0; k6 < friendsCount; k6++) {
  10695. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  10696. continue;
  10697. flag1 = true;
  10698. break;
  10699. }
  10700. boolean flag2 = false;
  10701. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  10702. flag2 = true;
  10703. if(flag1)
  10704. markMinimap(mapDotFriend, j1, l3);
  10705. else
  10706. markMinimap(mapDotPlayer, j1, l3);
  10707. }
  10708. }
  10709.  
  10710. if(anInt855 != 0 && loopCycle % 20 < 10) {
  10711. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  10712. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  10713. if(class30_sub2_sub4_sub1_sub1_1 != null)
  10714. {
  10715. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  10716. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  10717. method81(mapMarker, i4, k1);
  10718. }
  10719. }
  10720. if(anInt855 == 2) {
  10721. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  10722. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  10723. method81(mapMarker, j4, l1);
  10724. }
  10725. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length)
  10726. {
  10727. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  10728. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  10729. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  10730. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  10731. method81(mapMarker, k4, i2);
  10732. }
  10733. }
  10734. }
  10735. if(destX != 0) {
  10736. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  10737. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  10738. markMinimap(mapFlag, j2, l4);
  10739. }
  10740. DrawingArea.drawPixels(3, 78+5, 97+20, 0xffffff, 3);
  10741. logIconH.drawSprite(222, 1);
  10742. drawMapArea();
  10743. //drawLogoutButton();
  10744. /*
  10745. mapArea.drawSprite(0, 0);
  10746. drawWorldMapButton();
  10747. drawHP();
  10748. drawPrayer();
  10749. */
  10750. if (menuOpen && menuScreenArea == 3) {
  10751. drawMenu();
  10752. }
  10753. aRSImageProducer_1165.initDrawingArea();
  10754. }
  10755.  
  10756. public void loadOrbs() {
  10757. drawXPCounter();
  10758. drawMoneyPouch();
  10759. }
  10760.  
  10761. public boolean mouseInRegion(int x1, int y1, int x2, int y2) {
  10762. if (super.mouseX >= x1 && super.mouseX <= x2 && super.mouseY >= y1 && super.mouseY <= y2)
  10763. return true;
  10764. return false;
  10765. }
  10766.  
  10767. public void drawLogoutButton() {
  10768. if (mouseInRegion(742, 764, 1, 23)) {
  10769. logH = true;
  10770. } else {
  10771. logH = false;
  10772. }
  10773. if(tabInterfaceIDs[7] != -1 && anInt1054 == 9)
  10774. if(loopCycle % 20 >= 10);
  10775. if(logH){
  10776. logIcon.drawSprite(222, 1);
  10777. } else {
  10778. logIcon.drawSprite(222, 1);
  10779. }
  10780. //cacheSprite[logHover ? 89 : 88].drawSprite(clientSize == 0 ? 228 : clientWidth - 21, 0);
  10781. if(tabID == 7) {
  10782. logIconC.drawSprite(222, 1);
  10783. //cacheSprite[90].drawSprite(clientSize == 0 ? 228 : clientWidth - 21, 0);
  10784. }
  10785. }
  10786.  
  10787. public void drawLogoutButton2() {
  10788. if (tabInterfaceIDs[7] != -1 && anInt1054 == 9)
  10789. if (loopCycle % 20 >= 10)
  10790. ;
  10791. logIcon.drawSprite(222, 1);
  10792. if (logHover == 1) {
  10793. logIconH.drawSprite(222, 1);
  10794. }
  10795. if (tabID == 7)
  10796. logIconC.drawSprite(222, 1);
  10797. }
  10798.  
  10799. private void npcScreenPos(Entity entity, int i) {
  10800. calcEntityScreenPos(entity.x, i, entity.y);
  10801. }
  10802.  
  10803. public void drawMapArea(){
  10804. mapArea.drawSprite(0, 0);
  10805. drawWorldMapButton();
  10806. drawHP();
  10807. drawRunOrb();
  10808. drawPrayer();
  10809. drawLogoutButton2();
  10810. loadOrbs();
  10811. }
  10812. private void calcEntityScreenPos(int i, int j, int l) {
  10813. if(i < 128 || l < 128 || i > 13056 || l > 13056) {
  10814. spriteDrawX = -1;
  10815. spriteDrawY = -1;
  10816. return;
  10817. }
  10818. int i1 = method42(plane, l, i) - j;
  10819. i -= xCameraPos;
  10820. i1 -= zCameraPos;
  10821. l -= yCameraPos;
  10822. int j1 = Model.modelIntArray1[yCameraCurve];
  10823. int k1 = Model.modelIntArray2[yCameraCurve];
  10824. int l1 = Model.modelIntArray1[xCameraCurve];
  10825. int i2 = Model.modelIntArray2[xCameraCurve];
  10826. int j2 = l * l1 + i * i2 >> 16;
  10827. l = l * i2 - i * l1 >> 16;
  10828. i = j2;
  10829. j2 = i1 * k1 - l * j1 >> 16;
  10830. l = i1 * j1 + l * k1 >> 16;
  10831. i1 = j2;
  10832. if(l >= 50) {
  10833. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  10834. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  10835. } else {
  10836. spriteDrawX = -1;
  10837. spriteDrawY = -1;
  10838. }
  10839. }
  10840.  
  10841. private void buildSplitPrivateChatMenu()
  10842. {
  10843. if(splitPrivateChat == 0)
  10844. return;
  10845. int i = 0;
  10846. if(anInt1104 != 0)
  10847. i = 1;
  10848. for(int j = 0; j < 100; j++)
  10849. if(chatMessages[j] != null)
  10850. {
  10851. int k = chatTypes[j];
  10852. String s = chatNames[j];
  10853. boolean flag1 = false;
  10854. if(s != null && s.startsWith("@cr")) {
  10855. s = s.substring(5);
  10856. }
  10857. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  10858. {
  10859. int l = 329 - i * 13;
  10860. s = s.replaceAll("<col=(.*)?>(.*)</col>", "");
  10861. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  10862. {
  10863. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  10864. if(i1 > 450)
  10865. i1 = 450;
  10866. if(super.mouseX < 4 + i1)
  10867. {
  10868. if(myPrivilege >= 1)
  10869. {
  10870. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  10871. menuActionID[menuActionRow] = 2606;
  10872. menuActionRow++;
  10873. }
  10874. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  10875. menuActionID[menuActionRow] = 2042;
  10876. menuActionRow++;
  10877. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  10878. menuActionID[menuActionRow] = 2337;
  10879. menuActionRow++;
  10880. }
  10881. }
  10882. if(++i >= 5)
  10883. return;
  10884. }
  10885. if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  10886. return;
  10887. }
  10888.  
  10889. }
  10890.  
  10891. private void method130(int j, int k, int l, int i1, int j1, int k1,
  10892. int l1, int i2, int j2)
  10893. {
  10894. Class30_Sub1 class30_sub1 = null;
  10895. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10896. {
  10897. if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  10898. continue;
  10899. class30_sub1 = class30_sub1_1;
  10900. break;
  10901. }
  10902.  
  10903. if(class30_sub1 == null)
  10904. {
  10905. class30_sub1 = new Class30_Sub1();
  10906. class30_sub1.anInt1295 = l1;
  10907. class30_sub1.anInt1296 = i1;
  10908. class30_sub1.anInt1297 = i2;
  10909. class30_sub1.anInt1298 = j1;
  10910. method89(class30_sub1);
  10911. aClass19_1179.insertHead(class30_sub1);
  10912. }
  10913. class30_sub1.anInt1291 = k;
  10914. class30_sub1.anInt1293 = k1;
  10915. class30_sub1.anInt1292 = l;
  10916. class30_sub1.anInt1302 = j2;
  10917. class30_sub1.anInt1294 = j;
  10918. }
  10919.  
  10920. private boolean interfaceIsSelected(RSInterface class9)
  10921. {
  10922. if(class9.anIntArray245 == null)
  10923. return false;
  10924. for(int i = 0; i < class9.anIntArray245.length; i++)
  10925. {
  10926. int j = extractInterfaceValues(class9, i);
  10927. int k = class9.anIntArray212[i];
  10928. if(class9.anIntArray245[i] == 2)
  10929. {
  10930. if(j >= k)
  10931. return false;
  10932. } else
  10933. if(class9.anIntArray245[i] == 3)
  10934. {
  10935. if(j <= k)
  10936. return false;
  10937. } else
  10938. if(class9.anIntArray245[i] == 4)
  10939. {
  10940. if(j == k)
  10941. return false;
  10942. } else
  10943. if(j != k)
  10944. return false;
  10945. }
  10946.  
  10947. return true;
  10948. }
  10949.  
  10950. private DataInputStream openJagGrabInputStream(String s)
  10951. throws IOException
  10952. {
  10953. // if(!aBoolean872)
  10954. // if(signlink.mainapp != null)
  10955. // return signlink.openurl(s);
  10956. // else
  10957. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  10958. if(aSocket832 != null)
  10959. {
  10960. try
  10961. {
  10962. aSocket832.close();
  10963. }
  10964. catch(Exception _ex) { }
  10965. aSocket832 = null;
  10966. }
  10967. aSocket832 = openSocket(43595);
  10968. aSocket832.setSoTimeout(10000);
  10969. java.io.InputStream inputstream = aSocket832.getInputStream();
  10970. OutputStream outputstream = aSocket832.getOutputStream();
  10971. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  10972. return new DataInputStream(inputstream);
  10973. }
  10974.  
  10975. private void doFlamesDrawing()
  10976. {
  10977. char c = '\u0100';
  10978. if(anInt1040 > 0)
  10979. {
  10980. for(int i = 0; i < 256; i++)
  10981. if(anInt1040 > 768)
  10982. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  10983. else
  10984. if(anInt1040 > 256)
  10985. anIntArray850[i] = anIntArray852[i];
  10986. else
  10987. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  10988.  
  10989. } else
  10990. if(anInt1041 > 0)
  10991. {
  10992. for(int j = 0; j < 256; j++)
  10993. if(anInt1041 > 768)
  10994. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  10995. else
  10996. if(anInt1041 > 256)
  10997. anIntArray850[j] = anIntArray853[j];
  10998. else
  10999. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  11000.  
  11001. } else
  11002. {
  11003. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  11004.  
  11005. }
  11006. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, aRSImageProducer_1110.anIntArray315, 0, 33920);
  11007.  
  11008. int i1 = 0;
  11009. int j1 = 1152;
  11010. for(int k1 = 1; k1 < c - 1; k1++)
  11011. {
  11012. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  11013. int j2 = 22 + l1;
  11014. if(j2 < 0)
  11015. j2 = 0;
  11016. i1 += j2;
  11017. for(int l2 = j2; l2 < 128; l2++)
  11018. {
  11019. int j3 = anIntArray828[i1++];
  11020. if(j3 != 0)
  11021. {
  11022. int l3 = j3;
  11023. int j4 = 256 - j3;
  11024. j3 = anIntArray850[j3];
  11025. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  11026. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  11027. } else
  11028. {
  11029. j1++;
  11030. }
  11031. }
  11032.  
  11033. j1 += j2;
  11034. }
  11035.  
  11036. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  11037. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, aRSImageProducer_1111.anIntArray315, 0, 33920);
  11038.  
  11039. i1 = 0;
  11040. j1 = 1176;
  11041. for(int k2 = 1; k2 < c - 1; k2++)
  11042. {
  11043. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  11044. int k3 = 103 - i3;
  11045. j1 += i3;
  11046. for(int i4 = 0; i4 < k3; i4++)
  11047. {
  11048. int k4 = anIntArray828[i1++];
  11049. if(k4 != 0)
  11050. {
  11051. int i5 = k4;
  11052. int j5 = 256 - k4;
  11053. k4 = anIntArray850[k4];
  11054. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  11055. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  11056. } else
  11057. {
  11058. j1++;
  11059. }
  11060. }
  11061.  
  11062. i1 += 128 - k3;
  11063. j1 += 128 - k3 - i3;
  11064. }
  11065.  
  11066. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  11067. }
  11068.  
  11069. private void method134(Stream stream)
  11070. {
  11071. int j = stream.readBits(8);
  11072. if(j < playerCount)
  11073. {
  11074. for(int k = j; k < playerCount; k++)
  11075. anIntArray840[anInt839++] = playerIndices[k];
  11076.  
  11077. }
  11078. if(j > playerCount)
  11079. {
  11080. signlink.reporterror(myUsername + " Too many players");
  11081. throw new RuntimeException("eek");
  11082. }
  11083. playerCount = 0;
  11084. for(int l = 0; l < j; l++)
  11085. {
  11086. int i1 = playerIndices[l];
  11087. Player player = playerArray[i1];
  11088. int j1 = stream.readBits(1);
  11089. if(j1 == 0)
  11090. {
  11091. playerIndices[playerCount++] = i1;
  11092. player.anInt1537 = loopCycle;
  11093. } else
  11094. {
  11095. int k1 = stream.readBits(2);
  11096. if(k1 == 0)
  11097. {
  11098. playerIndices[playerCount++] = i1;
  11099. player.anInt1537 = loopCycle;
  11100. anIntArray894[anInt893++] = i1;
  11101. } else
  11102. if(k1 == 1)
  11103. {
  11104. playerIndices[playerCount++] = i1;
  11105. player.anInt1537 = loopCycle;
  11106. int l1 = stream.readBits(3);
  11107. player.moveInDir(false, l1);
  11108. int j2 = stream.readBits(1);
  11109. if(j2 == 1)
  11110. anIntArray894[anInt893++] = i1;
  11111. } else
  11112. if(k1 == 2)
  11113. {
  11114. playerIndices[playerCount++] = i1;
  11115. player.anInt1537 = loopCycle;
  11116. int i2 = stream.readBits(3);
  11117. player.moveInDir(true, i2);
  11118. int k2 = stream.readBits(3);
  11119. player.moveInDir(true, k2);
  11120. int l2 = stream.readBits(1);
  11121. if(l2 == 1)
  11122. anIntArray894[anInt893++] = i1;
  11123. } else
  11124. if(k1 == 3)
  11125. anIntArray840[anInt839++] = i1;
  11126. }
  11127. }
  11128. }
  11129.  
  11130. private void drawLoginScreen(boolean flag)
  11131. {
  11132. resetImageProducers();
  11133. aRSImageProducer_1109.initDrawingArea();
  11134. aBackground_966.drawBackground(0, 0);
  11135. char c = '\u0168';
  11136. char c1 = '\310';
  11137. if(loginScreenState == 0)
  11138. {
  11139. int i = c1 / 2 + 80;
  11140. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  11141. i = c1 / 2 - 20;
  11142. chatTextDrawingArea.method382(0xffff00, c / 2, "Welcome to NovusScape", i, true);
  11143. i += 30;
  11144. int l = c / 2 - 80;
  11145. int k1 = c1 / 2 + 20;
  11146. aBackground_967.drawBackground(l - 73, k1 - 20);
  11147. chatTextDrawingArea.method382(0xffffff, l, "Register", k1 + 5, true);
  11148. l = c / 2 + 80;
  11149. aBackground_967.drawBackground(l - 73, k1 - 20);
  11150. chatTextDrawingArea.method382(0xffffff, l, "Existing User", k1 + 5, true);
  11151. }
  11152. if(loginScreenState == 2)
  11153. {
  11154. int j = c1 / 2 - 40;
  11155. if(loginMessage1.length() > 0)
  11156. {
  11157. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  11158. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j, true);
  11159. j += 30;
  11160. } else
  11161. {
  11162. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  11163. j += 30;
  11164. }
  11165. chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff, "Username: " + myUsername + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  11166. j += 15;
  11167. chatTextDrawingArea.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  11168. j += 15;
  11169. if(!flag)
  11170. {
  11171. int i1 = c / 2 - 80;
  11172. int l1 = c1 / 2 + 50;
  11173. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  11174. chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5, true);
  11175. i1 = c / 2 + 80;
  11176. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  11177. chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  11178. }
  11179. }
  11180. if(loginScreenState == 3)
  11181. {
  11182. chatTextDrawingArea.method382(0xffff00, c / 2, "How to start?", c1 / 2 - 60, true);
  11183. int k = c1 / 2 - 35;
  11184. chatTextDrawingArea.method382(0xffffff, c / 2, "Click on existing user and enter a", k, true);
  11185. k += 15;
  11186. chatTextDrawingArea.method382(0xffffff, c / 2, "desirable username and password.", k, true);
  11187. k += 15;
  11188. chatTextDrawingArea.method382(0xffffff, c / 2, "Be sure to register in forums.", k, true);
  11189. k += 15;
  11190. chatTextDrawingArea.method382(0xffffff, c / 2, "Vote and try donating.", k, true);
  11191. k += 15;
  11192. int j1 = c / 2;
  11193. int i2 = c1 / 2 + 50;
  11194. aBackground_967.drawBackground(j1 - 73, i2 - 20);
  11195. chatTextDrawingArea.method382(0xffffff, j1, "Continue", i2 + 5, true);
  11196. }
  11197. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  11198. if(welcomeScreenRaised)
  11199. {
  11200. welcomeScreenRaised = false;
  11201. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  11202. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  11203. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  11204. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  11205. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  11206. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  11207. }
  11208. }
  11209.  
  11210. private void drawFlames()
  11211. {
  11212. drawingFlames = true;
  11213. try
  11214. {
  11215. long l = System.currentTimeMillis();
  11216. int i = 0;
  11217. int j = 20;
  11218. while(aBoolean831)
  11219. {
  11220. anInt1208++;
  11221. //calcFlamesPosition();
  11222. //calcFlamesPosition();
  11223. doFlamesDrawing();
  11224. if(++i > 10)
  11225. {
  11226. long l1 = System.currentTimeMillis();
  11227. int k = (int)(l1 - l) / 10 - j;
  11228. j = 40 - k;
  11229. if(j < 5)
  11230. j = 5;
  11231. i = 0;
  11232. l = l1;
  11233. }
  11234. try
  11235. {
  11236. Thread.sleep(j);
  11237. }
  11238. catch(Exception _ex) { }
  11239. }
  11240. }
  11241. catch(Exception _ex) { }
  11242. drawingFlames = false;
  11243. }
  11244.  
  11245. public void raiseWelcomeScreen()
  11246. {
  11247. welcomeScreenRaised = true;
  11248. }
  11249.  
  11250. private void method137(Stream stream, int j)
  11251. {
  11252. if(j == 84)
  11253. {
  11254. int k = stream.readUnsignedByte();
  11255. int j3 = anInt1268 + (k >> 4 & 7);
  11256. int i6 = anInt1269 + (k & 7);
  11257. int l8 = stream.readUnsignedWord();
  11258. int k11 = stream.readUnsignedWord();
  11259. int l13 = stream.readUnsignedWord();
  11260. if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  11261. {
  11262. NodeList class19_1 = groundArray[plane][j3][i6];
  11263. if(class19_1 != null)
  11264. {
  11265. 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())
  11266. {
  11267. if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  11268. continue;
  11269. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  11270. break;
  11271. }
  11272.  
  11273. spawnGroundItem(j3, i6);
  11274. }
  11275. }
  11276. return;
  11277. }
  11278. if(j == 105)
  11279. {
  11280. int l = stream.readUnsignedByte();
  11281. int k3 = anInt1268 + (l >> 4 & 7);
  11282. int j6 = anInt1269 + (l & 7);
  11283. int i9 = stream.readUnsignedWord();
  11284. int l11 = stream.readUnsignedByte();
  11285. int i14 = l11 >> 4 & 0xf;
  11286. int i16 = l11 & 7;
  11287. 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)
  11288. {
  11289. anIntArray1207[anInt1062] = i9;
  11290. anIntArray1241[anInt1062] = i16;
  11291. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  11292. anInt1062++;
  11293. }
  11294. }
  11295. if(j == 215)
  11296. {
  11297. int i1 = stream.method435();
  11298. int l3 = stream.method428();
  11299. int k6 = anInt1268 + (l3 >> 4 & 7);
  11300. int j9 = anInt1269 + (l3 & 7);
  11301. int i12 = stream.method435();
  11302. int j14 = stream.readUnsignedWord();
  11303. if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  11304. {
  11305. Item class30_sub2_sub4_sub2_2 = new Item();
  11306. class30_sub2_sub4_sub2_2.ID = i1;
  11307. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  11308. if(groundArray[plane][k6][j9] == null)
  11309. groundArray[plane][k6][j9] = new NodeList();
  11310. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  11311. spawnGroundItem(k6, j9);
  11312. }
  11313. return;
  11314. }
  11315. if(j == 156)
  11316. {
  11317. int j1 = stream.method426();
  11318. int i4 = anInt1268 + (j1 >> 4 & 7);
  11319. int l6 = anInt1269 + (j1 & 7);
  11320. int k9 = stream.readUnsignedWord();
  11321. if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  11322. {
  11323. NodeList class19 = groundArray[plane][i4][l6];
  11324. if(class19 != null)
  11325. {
  11326. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  11327. {
  11328. if(item.ID != (k9 & 0x7fff))
  11329. continue;
  11330. item.unlink();
  11331. break;
  11332. }
  11333.  
  11334. if(class19.reverseGetFirst() == null)
  11335. groundArray[plane][i4][l6] = null;
  11336. spawnGroundItem(i4, l6);
  11337. }
  11338. }
  11339. return;
  11340. }
  11341. if(j == 160)
  11342. {
  11343. int k1 = stream.method428();
  11344. int j4 = anInt1268 + (k1 >> 4 & 7);
  11345. int i7 = anInt1269 + (k1 & 7);
  11346. int l9 = stream.method428();
  11347. int j12 = l9 >> 2;
  11348. int k14 = l9 & 3;
  11349. int j16 = anIntArray1177[j12];
  11350. int j17 = stream.method435();
  11351. if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  11352. {
  11353. int j18 = intGroundArray[plane][j4][i7];
  11354. int i19 = intGroundArray[plane][j4 + 1][i7];
  11355. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  11356. int k20 = intGroundArray[plane][j4][i7 + 1];
  11357. if(j16 == 0)
  11358. {
  11359. Object1 class10 = worldController.method296(plane, j4, i7);
  11360. if(class10 != null)
  11361. {
  11362. int k21 = class10.uid >> 14 & 0x7fff;
  11363. if(j12 == 2)
  11364. {
  11365. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  11366. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  11367. } else
  11368. {
  11369. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  11370. }
  11371. }
  11372. }
  11373. if(j16 == 1)
  11374. {
  11375. Object2 class26 = worldController.method297(j4, i7, plane);
  11376. if(class26 != null)
  11377. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  11378. }
  11379. if(j16 == 2)
  11380. {
  11381. Object5 class28 = worldController.method298(j4, i7, plane);
  11382. if(j12 == 11)
  11383. j12 = 10;
  11384. if(class28 != null)
  11385. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  11386. }
  11387. if(j16 == 3)
  11388. {
  11389. Object3 class49 = worldController.method299(i7, j4, plane);
  11390. if(class49 != null)
  11391. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  11392. }
  11393. }
  11394. return;
  11395. }
  11396. if(j == 147)
  11397. {
  11398. int l1 = stream.method428();
  11399. int k4 = anInt1268 + (l1 >> 4 & 7);
  11400. int j7 = anInt1269 + (l1 & 7);
  11401. int i10 = stream.readUnsignedWord();
  11402. byte byte0 = stream.method430();
  11403. int l14 = stream.method434();
  11404. byte byte1 = stream.method429();
  11405. int k17 = stream.readUnsignedWord();
  11406. int k18 = stream.method428();
  11407. int j19 = k18 >> 2;
  11408. int i20 = k18 & 3;
  11409. int l20 = anIntArray1177[j19];
  11410. byte byte2 = stream.readSignedByte();
  11411. int l21 = stream.readUnsignedWord();
  11412. byte byte3 = stream.method429();
  11413. Player player;
  11414. if(i10 == unknownInt10)
  11415. player = myPlayer;
  11416. else
  11417. player = playerArray[i10];
  11418. if(player != null)
  11419. {
  11420. ObjectDef class46 = ObjectDef.forID(l21);
  11421. int i22 = intGroundArray[plane][k4][j7];
  11422. int j22 = intGroundArray[plane][k4 + 1][j7];
  11423. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  11424. int l22 = intGroundArray[plane][k4][j7 + 1];
  11425. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  11426. if(model != null)
  11427. {
  11428. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  11429. player.anInt1707 = l14 + loopCycle;
  11430. player.anInt1708 = k17 + loopCycle;
  11431. player.aModel_1714 = model;
  11432. int i23 = class46.anInt744;
  11433. int j23 = class46.anInt761;
  11434. if(i20 == 1 || i20 == 3)
  11435. {
  11436. i23 = class46.anInt761;
  11437. j23 = class46.anInt744;
  11438. }
  11439. player.anInt1711 = k4 * 128 + i23 * 64;
  11440. player.anInt1713 = j7 * 128 + j23 * 64;
  11441. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  11442. if(byte2 > byte0)
  11443. {
  11444. byte byte4 = byte2;
  11445. byte2 = byte0;
  11446. byte0 = byte4;
  11447. }
  11448. if(byte3 > byte1)
  11449. {
  11450. byte byte5 = byte3;
  11451. byte3 = byte1;
  11452. byte1 = byte5;
  11453. }
  11454. player.anInt1719 = k4 + byte2;
  11455. player.anInt1721 = k4 + byte0;
  11456. player.anInt1720 = j7 + byte3;
  11457. player.anInt1722 = j7 + byte1;
  11458. }
  11459. }
  11460. }
  11461. if(j == 151)
  11462. {
  11463. int i2 = stream.method426();
  11464. int l4 = anInt1268 + (i2 >> 4 & 7);
  11465. int k7 = anInt1269 + (i2 & 7);
  11466. int j10 = stream.method434();
  11467. int k12 = stream.method428();
  11468. int i15 = k12 >> 2;
  11469. int k16 = k12 & 3;
  11470. int l17 = anIntArray1177[i15];
  11471. if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  11472. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  11473. return;
  11474. }
  11475. if(j == 4)
  11476. {
  11477. int j2 = stream.readUnsignedByte();
  11478. int i5 = anInt1268 + (j2 >> 4 & 7);
  11479. int l7 = anInt1269 + (j2 & 7);
  11480. int k10 = stream.readUnsignedWord();
  11481. int l12 = stream.readUnsignedByte();
  11482. int j15 = stream.readUnsignedWord();
  11483. if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  11484. {
  11485. i5 = i5 * 128 + 64;
  11486. l7 = l7 * 128 + 64;
  11487. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  11488. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  11489. }
  11490. return;
  11491. }
  11492. if(j == 44)
  11493. {
  11494. int k2 = stream.method436();
  11495. int j5 = stream.readUnsignedWord();
  11496. int i8 = stream.readUnsignedByte();
  11497. int l10 = anInt1268 + (i8 >> 4 & 7);
  11498. int i13 = anInt1269 + (i8 & 7);
  11499. if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  11500. {
  11501. Item class30_sub2_sub4_sub2_1 = new Item();
  11502. class30_sub2_sub4_sub2_1.ID = k2;
  11503. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  11504. if(groundArray[plane][l10][i13] == null)
  11505. groundArray[plane][l10][i13] = new NodeList();
  11506. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  11507. spawnGroundItem(l10, i13);
  11508. }
  11509. return;
  11510. }
  11511. if(j == 101)
  11512. {
  11513. int l2 = stream.method427();
  11514. int k5 = l2 >> 2;
  11515. int j8 = l2 & 3;
  11516. int i11 = anIntArray1177[k5];
  11517. int j13 = stream.readUnsignedByte();
  11518. int k15 = anInt1268 + (j13 >> 4 & 7);
  11519. int l16 = anInt1269 + (j13 & 7);
  11520. if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  11521. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  11522. return;
  11523. }
  11524. if(j == 117)
  11525. {
  11526. int i3 = stream.readUnsignedByte();
  11527. int l5 = anInt1268 + (i3 >> 4 & 7);
  11528. int k8 = anInt1269 + (i3 & 7);
  11529. int j11 = l5 + stream.readSignedByte();
  11530. int k13 = k8 + stream.readSignedByte();
  11531. int l15 = stream.readSignedWord();
  11532. int i17 = stream.readUnsignedWord();
  11533. int i18 = stream.readUnsignedByte() * 4;
  11534. int l18 = stream.readUnsignedByte() * 4;
  11535. int k19 = stream.readUnsignedWord();
  11536. int j20 = stream.readUnsignedWord();
  11537. int i21 = stream.readUnsignedByte();
  11538. int j21 = stream.readUnsignedByte();
  11539. if(l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535)
  11540. {
  11541. l5 = l5 * 128 + 64;
  11542. k8 = k8 * 128 + 64;
  11543. j11 = j11 * 128 + 64;
  11544. k13 = k13 * 128 + 64;
  11545. 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);
  11546. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  11547. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  11548. }
  11549. }
  11550. }
  11551.  
  11552. private static void setLowMem()
  11553. {
  11554. WorldController.lowMem = true;
  11555. Texture.lowMem = true;
  11556. lowMem = true;
  11557. ObjectManager.lowMem = true;
  11558. ObjectDef.lowMem = true;
  11559. }
  11560.  
  11561. private void method139(Stream stream)
  11562. {
  11563. stream.initBitAccess();
  11564. int k = stream.readBits(8);
  11565. if(k < npcCount)
  11566. {
  11567. for(int l = k; l < npcCount; l++)
  11568. anIntArray840[anInt839++] = npcIndices[l];
  11569.  
  11570. }
  11571. if(k > npcCount)
  11572. {
  11573. signlink.reporterror(myUsername + " Too many npcs");
  11574. throw new RuntimeException("eek");
  11575. }
  11576. npcCount = 0;
  11577. for(int i1 = 0; i1 < k; i1++)
  11578. {
  11579. int j1 = npcIndices[i1];
  11580. NPC npc = npcArray[j1];
  11581. int k1 = stream.readBits(1);
  11582. if(k1 == 0)
  11583. {
  11584. npcIndices[npcCount++] = j1;
  11585. npc.anInt1537 = loopCycle;
  11586. } else
  11587. {
  11588. int l1 = stream.readBits(2);
  11589. if(l1 == 0)
  11590. {
  11591. npcIndices[npcCount++] = j1;
  11592. npc.anInt1537 = loopCycle;
  11593. anIntArray894[anInt893++] = j1;
  11594. } else
  11595. if(l1 == 1)
  11596. {
  11597. npcIndices[npcCount++] = j1;
  11598. npc.anInt1537 = loopCycle;
  11599. int i2 = stream.readBits(3);
  11600. npc.moveInDir(false, i2);
  11601. int k2 = stream.readBits(1);
  11602. if(k2 == 1)
  11603. anIntArray894[anInt893++] = j1;
  11604. } else
  11605. if(l1 == 2)
  11606. {
  11607. npcIndices[npcCount++] = j1;
  11608. npc.anInt1537 = loopCycle;
  11609. int j2 = stream.readBits(3);
  11610. npc.moveInDir(true, j2);
  11611. int l2 = stream.readBits(3);
  11612. npc.moveInDir(true, l2);
  11613. int i3 = stream.readBits(1);
  11614. if(i3 == 1)
  11615. anIntArray894[anInt893++] = j1;
  11616. } else
  11617. if(l1 == 3)
  11618. anIntArray840[anInt839++] = j1;
  11619. }
  11620. }
  11621.  
  11622. }
  11623.  
  11624. private void processLoginScreenInput()
  11625. {
  11626. if(loginScreenState == 0)
  11627. {
  11628. int i = super.myWidth / 2 - 80;
  11629. int l = super.myHeight / 2 + 20;
  11630. l += 20;
  11631. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  11632. {
  11633. loginScreenState = 3;
  11634. loginScreenCursorPos = 0;
  11635. }
  11636. i = super.myWidth / 2 + 80;
  11637. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  11638. {
  11639. loginMessage1 = "";
  11640. loginMessage2 = "Enter your username & password.";
  11641. loginScreenState = 2;
  11642. loginScreenCursorPos = 0;
  11643. }
  11644. } else
  11645. {
  11646. if(loginScreenState == 2)
  11647. {
  11648. int j = super.myHeight / 2 - 40;
  11649. j += 30;
  11650. j += 25;
  11651. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  11652. loginScreenCursorPos = 0;
  11653. j += 15;
  11654. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  11655. loginScreenCursorPos = 1;
  11656. j += 15;
  11657. int i1 = super.myWidth / 2 - 80;
  11658. int k1 = super.myHeight / 2 + 50;
  11659. k1 += 20;
  11660. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  11661. {
  11662. loginFailures = 0;
  11663. login(myUsername, myPassword, false);
  11664. if(loggedIn)
  11665. return;
  11666. }
  11667. i1 = super.myWidth / 2 + 80;
  11668. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  11669. {
  11670. loginScreenState = 0;
  11671. // myUsername = "";
  11672. // myPassword = "";
  11673. }
  11674. do
  11675. {
  11676. int l1 = readChar(-796);
  11677. if(l1 == -1)
  11678. break;
  11679. boolean flag1 = false;
  11680. for(int i2 = 0; i2 < validUserPassChars.length(); i2++)
  11681. {
  11682. if(l1 != validUserPassChars.charAt(i2))
  11683. continue;
  11684. flag1 = true;
  11685. break;
  11686. }
  11687.  
  11688. if(loginScreenCursorPos == 0)
  11689. {
  11690. if(l1 == 8 && myUsername.length() > 0)
  11691. myUsername = myUsername.substring(0, myUsername.length() - 1);
  11692. if (l1 == 9 || l1 == 10 || l1 == 13)
  11693. loginScreenCursorPos = 1;
  11694. if(flag1)
  11695. myUsername += (char)l1;
  11696. if(myUsername.length() > 12)
  11697. myUsername = myUsername.substring(0, 12);
  11698. } else
  11699. if(loginScreenCursorPos == 1)
  11700. {
  11701. if(l1 == 8 && myPassword.length() > 0)
  11702. myPassword = myPassword.substring(0, myPassword.length() - 1);
  11703. if (l1 == 10 || l1 == 13) //Enter to login
  11704. login(myUsername, myPassword, false);
  11705. if (l1 == 9) //Tab to switch between username and password
  11706. loginScreenCursorPos = 0;
  11707. if(flag1)
  11708. myPassword += (char)l1;
  11709. if(myPassword.length() > 20)
  11710. myPassword = myPassword.substring(0, 20);
  11711. }
  11712. } while(true);
  11713. return;
  11714. }
  11715. if(loginScreenState == 3)
  11716. {
  11717. int k = super.myWidth / 2;
  11718. int j1 = super.myHeight / 2 + 50;
  11719. j1 += 20;
  11720. if(super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75 && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  11721. loginScreenState = 0;
  11722. }
  11723. }
  11724. }
  11725.  
  11726. private void markMinimap(Sprite sprite, int i, int j)
  11727. {
  11728. int k = minimapInt1 + minimapInt2 & 0x7ff;
  11729. int l = i * i + j * j;
  11730. if(l > 6400)
  11731. return;
  11732. int i1 = Model.modelIntArray1[k];
  11733. int j1 = Model.modelIntArray2[k];
  11734. i1 = (i1 * 256) / (minimapInt3 + 256);
  11735. j1 = (j1 * 256) / (minimapInt3 + 256);
  11736. int k1 = j * i1 + i * j1 >> 16;
  11737. int l1 = j * j1 - i * i1 >> 16;
  11738. if(l > 2500) {
  11739. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 + 20, 83 - l1 - sprite.anInt1445 / 2 - 4 + 5);
  11740. } else {
  11741. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 + 20, 83 - l1 - sprite.anInt1445 / 2 - 4 + 5);
  11742. }
  11743. }
  11744.  
  11745. private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  11746. )
  11747. {
  11748. if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  11749. {
  11750. if(lowMem && j != plane)
  11751. return;
  11752. int i2 = 0;
  11753. if(j1 == 0)
  11754. i2 = worldController.method300(j, i1, i);
  11755. if(j1 == 1)
  11756. i2 = worldController.method301(j, i1, i);
  11757. if(j1 == 2)
  11758. i2 = worldController.method302(j, i1, i);
  11759. if(j1 == 3)
  11760. i2 = worldController.method303(j, i1, i);
  11761. if(i2 != 0)
  11762. {
  11763. int i3 = worldController.method304(j, i1, i, i2);
  11764. int j2 = i2 >> 14 & 0x7fff;
  11765. int k2 = i3 & 0x1f;
  11766. int l2 = i3 >> 6;
  11767. if(j1 == 0)
  11768. {
  11769. worldController.method291(i1, j, i, (byte)-119);
  11770. ObjectDef class46 = ObjectDef.forID(j2);
  11771. if(class46.aBoolean767)
  11772. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  11773. }
  11774. if(j1 == 1)
  11775. worldController.method292(i, j, i1);
  11776. if(j1 == 2)
  11777. {
  11778. worldController.method293(j, i1, i);
  11779. ObjectDef class46_1 = ObjectDef.forID(j2);
  11780. if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  11781. return;
  11782. if(class46_1.aBoolean767)
  11783. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  11784. }
  11785. if(j1 == 3)
  11786. {
  11787. worldController.method294(j, i, i1);
  11788. ObjectDef class46_2 = ObjectDef.forID(j2);
  11789. if(class46_2.aBoolean767 && class46_2.hasActions)
  11790. aClass11Array1230[j].method218(i, i1);
  11791. }
  11792. }
  11793. if(k1 >= 0)
  11794. {
  11795. int j3 = j;
  11796. if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  11797. j3++;
  11798. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  11799. }
  11800. }
  11801. }
  11802.  
  11803. private void updatePlayers(int i, Stream stream)
  11804. {
  11805. anInt839 = 0;
  11806. anInt893 = 0;
  11807. method117(stream);
  11808. method134(stream);
  11809. method91(stream, i);
  11810. method49(stream);
  11811. for(int k = 0; k < anInt839; k++)
  11812. {
  11813. int l = anIntArray840[k];
  11814. if(playerArray[l].anInt1537 != loopCycle)
  11815. playerArray[l] = null;
  11816. }
  11817.  
  11818. if(stream.currentOffset != i)
  11819. {
  11820. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  11821. throw new RuntimeException("eek");
  11822. }
  11823. for(int i1 = 0; i1 < playerCount; i1++)
  11824. if(playerArray[playerIndices[i1]] == null)
  11825. {
  11826. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  11827. throw new RuntimeException("eek");
  11828. }
  11829.  
  11830. }
  11831.  
  11832. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  11833. {
  11834. int l1 = 2048 - k & 0x7ff;
  11835. int i2 = 2048 - j1 & 0x7ff;
  11836. int j2 = 0;
  11837. int k2 = 0;
  11838. int l2 = j;
  11839. if(l1 != 0)
  11840. {
  11841. int i3 = Model.modelIntArray1[l1];
  11842. int k3 = Model.modelIntArray2[l1];
  11843. int i4 = k2 * k3 - l2 * i3 >> 16;
  11844. l2 = k2 * i3 + l2 * k3 >> 16;
  11845. k2 = i4;
  11846. }
  11847. if(i2 != 0)
  11848. {
  11849. /* xxx if(cameratoggle){
  11850. if(zoom == 0)
  11851. zoom = k2;
  11852. if(lftrit == 0)
  11853. lftrit = j2;
  11854. if(fwdbwd == 0)
  11855. fwdbwd = l2;
  11856. k2 = zoom;
  11857. j2 = lftrit;
  11858. l2 = fwdbwd;
  11859. }
  11860. */
  11861. int j3 = Model.modelIntArray1[i2];
  11862. int l3 = Model.modelIntArray2[i2];
  11863. int j4 = l2 * j3 + j2 * l3 >> 16;
  11864. l2 = l2 * l3 - j2 * j3 >> 16;
  11865. j2 = j4;
  11866. }
  11867. xCameraPos = l - j2;
  11868. zCameraPos = i1 - k2;
  11869. yCameraPos = k1 - l2;
  11870. yCameraCurve = k;
  11871. xCameraCurve = j1;
  11872. }
  11873.  
  11874. public void updateStrings(String str, int i) {
  11875. switch(i) {
  11876. case 1675: sendFrame126(str, 17508); break;//Stab
  11877. case 1676: sendFrame126(str, 17509); break;//Slash
  11878. case 1677: sendFrame126(str, 17510); break;//Cursh
  11879. case 1678: sendFrame126(str, 17511); break;//Magic
  11880. case 1679: sendFrame126(str, 17512); break;//Range
  11881. case 1680: sendFrame126(str, 17513); break;//Stab
  11882. case 1681: sendFrame126(str, 17514); break;//Slash
  11883. case 1682: sendFrame126(str, 17515); break;//Crush
  11884. case 1683: sendFrame126(str, 17516); break;//Magic
  11885. case 1684: sendFrame126(str, 17517); break;//Range
  11886. case 1686: sendFrame126(str, 17518); break;//Strength
  11887. case 1687: sendFrame126(str, 17519); break;//Prayer
  11888. }
  11889. }
  11890.  
  11891. public void sendFrame126(String str,int i) {
  11892. RSInterface.interfaceCache[i].message = str;
  11893. if(RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  11894. needDrawTabArea = true;
  11895. }
  11896.  
  11897. public void sendPacket185(int buttonID) {
  11898. stream.createFrame(185);
  11899. stream.writeWord(buttonID);
  11900. RSInterface rsi = RSInterface.interfaceCache[buttonID];
  11901. if (rsi == null)
  11902. return;
  11903. if (rsi.valueIndexArray != null && rsi.valueIndexArray[0][0] == 5) {
  11904. int configID = rsi.valueIndexArray[0][1];
  11905. variousSettings[configID] = 1 - variousSettings[configID];
  11906. method33(configID);
  11907. needDrawTabArea = true;
  11908. }
  11909. }
  11910.  
  11911. public void sendPacket185(int button,int toggle,int type) {
  11912. switch(type) {
  11913. case 135:
  11914. RSInterface class9 = RSInterface.interfaceCache[button];
  11915. boolean flag8 = true;
  11916. if(class9.contentType > 0)
  11917. flag8 = promptUserForInput(class9);
  11918. if(flag8) {
  11919. stream.createFrame(185);
  11920. stream.writeWord(button);
  11921. }
  11922. break;
  11923. case 646:
  11924. stream.createFrame(185);
  11925. stream.writeWord(button);
  11926. RSInterface class9_2 = RSInterface.interfaceCache[button];
  11927. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  11928. if(variousSettings[toggle] != class9_2.anIntArray212[0]) {
  11929. variousSettings[toggle] = class9_2.anIntArray212[0];
  11930. method33(toggle);
  11931. needDrawTabArea = true;
  11932. }
  11933. }
  11934. break;
  11935. case 169:
  11936. stream.createFrame(185);
  11937. stream.writeWord(button);
  11938. RSInterface class9_3 = RSInterface.interfaceCache[button];
  11939. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  11940. variousSettings[toggle] = 1 - variousSettings[toggle];
  11941. method33(toggle);
  11942. needDrawTabArea = true;
  11943. }
  11944. switch(button) {
  11945. case 19136:
  11946. System.out.println("toggle = "+toggle);
  11947. if(toggle == 0)
  11948. sendFrame36(173,toggle);
  11949. if(toggle == 1)
  11950. sendPacket185(153,173,646);
  11951. break;
  11952. }
  11953. break;
  11954. }
  11955. }
  11956.  
  11957. public void sendFrame36(int id,int state) {
  11958. anIntArray1045[id] = state;
  11959. if(variousSettings[id] != state) {
  11960. variousSettings[id] = state;
  11961. method33(id);
  11962. needDrawTabArea = true;
  11963. if(dialogID != -1)
  11964. inputTaken = true;
  11965. }
  11966. }
  11967.  
  11968. public void sendFrame219() {
  11969. if(invOverlayInterfaceID != -1) {
  11970. invOverlayInterfaceID = -1;
  11971. needDrawTabArea = true;
  11972. tabAreaAltered = true;
  11973. }
  11974. if(backDialogID != -1) {
  11975. backDialogID = -1;
  11976. inputTaken = true;
  11977. }
  11978. if(inputDialogState != 0) {
  11979. inputDialogState = 0;
  11980. inputTaken = true;
  11981. }
  11982. openInterfaceID = -1;
  11983. aBoolean1149 = false;
  11984. }
  11985.  
  11986. public void sendFrame248(int interfaceID,int sideInterfaceID) {
  11987. if(backDialogID != -1) {
  11988. backDialogID = -1;
  11989. inputTaken = true;
  11990. }
  11991. if(inputDialogState != 0) {
  11992. inputDialogState = 0;
  11993. inputTaken = true;
  11994. }
  11995. openInterfaceID = interfaceID;
  11996. invOverlayInterfaceID = sideInterfaceID;
  11997. needDrawTabArea = true;
  11998. tabAreaAltered = true;
  11999. aBoolean1149 = false;
  12000. }
  12001.  
  12002. private boolean parsePacket() {
  12003. if(socketStream == null)
  12004. return false;
  12005. try {
  12006. int i = socketStream.available();
  12007. if(i == 0)
  12008. return false;
  12009. if(pktType == -1) {
  12010. socketStream.flushInputStream(inStream.buffer, 1);
  12011. pktType = inStream.buffer[0] & 0xff;
  12012. if(encryption != null)
  12013. pktType = pktType - encryption.getNextKey() & 0xff;
  12014. pktSize = SizeConstants.packetSizes[pktType];
  12015. i--;
  12016. }
  12017. if(pktSize == -1)
  12018. if(i > 0) {
  12019. socketStream.flushInputStream(inStream.buffer, 1);
  12020. pktSize = inStream.buffer[0] & 0xff;
  12021. i--;
  12022. } else {
  12023. return false;
  12024. }
  12025. if(pktSize == -2)
  12026. if(i > 1) {
  12027. socketStream.flushInputStream(inStream.buffer, 2);
  12028. inStream.currentOffset = 0;
  12029. pktSize = inStream.readUnsignedWord();
  12030. i -= 2;
  12031. } else {
  12032. return false;
  12033. }
  12034. if(i < pktSize)
  12035. return false;
  12036. inStream.currentOffset = 0;
  12037. socketStream.flushInputStream(inStream.buffer, pktSize);
  12038. anInt1009 = 0;
  12039. anInt843 = anInt842;
  12040. anInt842 = anInt841;
  12041. anInt841 = pktType;
  12042. switch(pktType) {
  12043. case 81:
  12044. updatePlayers(pktSize, inStream);
  12045. aBoolean1080 = false;
  12046. pktType = -1;
  12047. return true;
  12048.  
  12049. case 176:
  12050. daysSinceRecovChange = inStream.method427();
  12051. unreadMessages = inStream.method435();
  12052. membersInt = inStream.readUnsignedByte();
  12053. anInt1193 = inStream.method440();
  12054. daysSinceLastLogin = inStream.readUnsignedWord();
  12055. if(anInt1193 != 0 && openInterfaceID == -1) {
  12056. signlink.dnslookup(TextClass.method586(anInt1193));
  12057. clearTopInterfaces();
  12058. char c = '\u028A';
  12059. if(daysSinceRecovChange != 201 || membersInt == 1)
  12060. c = '\u028F';
  12061. reportAbuseInput = "";
  12062. canMute = false;
  12063. for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  12064. if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  12065. continue;
  12066. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  12067.  
  12068. }
  12069. }
  12070. pktType = -1;
  12071. return true;
  12072.  
  12073. case 64:
  12074. anInt1268 = inStream.method427();
  12075. anInt1269 = inStream.method428();
  12076. for(int j = anInt1268; j < anInt1268 + 8; j++) {
  12077. for(int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  12078. if(groundArray[plane][j][l9] != null) {
  12079. groundArray[plane][j][l9] = null;
  12080. spawnGroundItem(j, l9);
  12081. }
  12082. }
  12083. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  12084. if(class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  12085. class30_sub1.anInt1294 = 0;
  12086. pktType = -1;
  12087. return true;
  12088.  
  12089. case 185:
  12090. int k = inStream.method436();
  12091. RSInterface.interfaceCache[k].anInt233 = 3;
  12092. if(myPlayer.desc == null)
  12093. 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];
  12094. else
  12095. RSInterface.interfaceCache[k].mediaID = (int)(0x12345678L + myPlayer.desc.type);
  12096. pktType = -1;
  12097. return true;
  12098.  
  12099. /* Clan chat packet */
  12100. case 217:
  12101. try {
  12102. name = inStream.readString();
  12103. message = inStream.readString();
  12104. clanname = inStream.readString();
  12105. rights = inStream.readUnsignedWord();
  12106. //message = TextInput.processText(message);
  12107. //message = Censor.doCensor(message);
  12108. System.out.println(clanname);
  12109. pushMessage(message, 16, name);
  12110. } catch(Exception e) {
  12111. e.printStackTrace();
  12112. }
  12113. pktType = -1;
  12114. return true;
  12115.  
  12116. case 107:
  12117. aBoolean1160 = false;
  12118. for(int l = 0; l < 5; l++)
  12119. aBooleanArray876[l] = false;
  12120. xpCounter = 0;
  12121. pktType = -1;
  12122. return true;
  12123.  
  12124. case 72:
  12125. int i1 = inStream.method434();
  12126. RSInterface class9 = RSInterface.interfaceCache[i1];
  12127. for(int k15 = 0; k15 < class9.inv.length; k15++) {
  12128. class9.inv[k15] = -1;
  12129. class9.inv[k15] = 0;
  12130. }
  12131. pktType = -1;
  12132. return true;
  12133.  
  12134. case 214:
  12135. ignoreCount = pktSize / 8;
  12136. for(int j1 = 0; j1 < ignoreCount; j1++)
  12137. ignoreListAsLongs[j1] = inStream.readQWord();
  12138. pktType = -1;
  12139. return true;
  12140.  
  12141. case 166:
  12142. aBoolean1160 = true;
  12143. anInt1098 = inStream.readUnsignedByte();
  12144. anInt1099 = inStream.readUnsignedByte();
  12145. anInt1100 = inStream.readUnsignedWord();
  12146. anInt1101 = inStream.readUnsignedByte();
  12147. anInt1102 = inStream.readUnsignedByte();
  12148. if(anInt1102 >= 100) {
  12149. xCameraPos = anInt1098 * 128 + 64;
  12150. yCameraPos = anInt1099 * 128 + 64;
  12151. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  12152. }
  12153. pktType = -1;
  12154. return true;
  12155.  
  12156. case 134:
  12157. needDrawTabArea = true;
  12158. int k1 = inStream.readUnsignedByte();
  12159. int i10 = inStream.method439();
  12160. int l15 = inStream.readUnsignedByte();
  12161. int xp = currentExp[k1];
  12162. currentExp[k1] = i10;
  12163. currentStats[k1] = l15;
  12164. maxStats[k1] = 1;
  12165. xpCounter += currentExp[k1] - xp;
  12166. expAdded = currentExp[k1] - xp;
  12167. for(int k20 = 0; k20 < 98; k20++)
  12168. if(i10 >= anIntArray1019[k20])
  12169. maxStats[k1] = k20 + 2;
  12170. pktType = -1;
  12171. return true;
  12172.  
  12173. case 71:
  12174. int l1 = inStream.readUnsignedWord();
  12175. int j10 = inStream.method426();
  12176. if(l1 == 65535)
  12177. l1 = -1;
  12178. tabInterfaceIDs[j10] = l1;
  12179. needDrawTabArea = true;
  12180. tabAreaAltered = true;
  12181. pktType = -1;
  12182. return true;
  12183.  
  12184. case 74:
  12185. int i2 = inStream.method434();
  12186. if(i2 == 65535)
  12187. i2 = -1;
  12188. if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  12189. nextSong = i2;
  12190. songChanging = true;
  12191. onDemandFetcher.method558(2, nextSong);
  12192. }
  12193. currentSong = i2;
  12194. pktType = -1;
  12195. return true;
  12196.  
  12197. case 121:
  12198. int j2 = inStream.method436();
  12199. int k10 = inStream.method435();
  12200. if(musicEnabled && !lowMem) {
  12201. nextSong = j2;
  12202. songChanging = false;
  12203. onDemandFetcher.method558(2, nextSong);
  12204. prevSong = k10;
  12205. }
  12206. pktType = -1;
  12207. return true;
  12208.  
  12209. case 109:
  12210. resetLogout();
  12211. pktType = -1;
  12212. return false;
  12213.  
  12214. case 70:
  12215. int k2 = inStream.readSignedWord();
  12216. int l10 = inStream.method437();
  12217. int i16 = inStream.method434();
  12218. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  12219. class9_5.anInt263 = k2;
  12220. class9_5.anInt265 = l10;
  12221. pktType = -1;
  12222. return true;
  12223.  
  12224. case 73:
  12225. case 241:
  12226. int l2 = anInt1069;
  12227. int i11 = anInt1070;
  12228. if(pktType == 73) {
  12229. l2 = inStream.method435();
  12230. i11 = inStream.readUnsignedWord();
  12231. aBoolean1159 = false;
  12232. }
  12233. if(pktType == 241) {
  12234. i11 = inStream.method435();
  12235. inStream.initBitAccess();
  12236. for(int j16 = 0; j16 < 4; j16++) {
  12237. for(int l20 = 0; l20 < 13; l20++) {
  12238. for(int j23 = 0; j23 < 13; j23++) {
  12239. int i26 = inStream.readBits(1);
  12240. if(i26 == 1)
  12241. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  12242. else
  12243. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  12244. }
  12245. }
  12246. }
  12247. inStream.finishBitAccess();
  12248. l2 = inStream.readUnsignedWord();
  12249. aBoolean1159 = true;
  12250. }
  12251. if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  12252. pktType = -1;
  12253. return true;
  12254. }
  12255. anInt1069 = l2;
  12256. anInt1070 = i11;
  12257. baseX = (anInt1069 - 6) * 8;
  12258. baseY = (anInt1070 - 6) * 8;
  12259. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  12260. if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  12261. aBoolean1141 = true;
  12262. loadingStage = 1;
  12263. aLong824 = System.currentTimeMillis();
  12264. aRSImageProducer_1165.initDrawingArea();
  12265. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  12266. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  12267. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  12268. if(pktType == 73) {
  12269. int k16 = 0;
  12270. for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  12271. for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  12272. k16++;
  12273. }
  12274. aByteArrayArray1183 = new byte[k16][];
  12275. aByteArrayArray1247 = new byte[k16][];
  12276. anIntArray1234 = new int[k16];
  12277. anIntArray1235 = new int[k16];
  12278. anIntArray1236 = new int[k16];
  12279. k16 = 0;
  12280. for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  12281. for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  12282. anIntArray1234[k16] = (l23 << 8) + j26;
  12283. if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  12284. anIntArray1235[k16] = -1;
  12285. anIntArray1236[k16] = -1;
  12286. k16++;
  12287. } else {
  12288. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  12289. if(k28 != -1)
  12290. onDemandFetcher.method558(3, k28);
  12291. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  12292. if(j30 != -1)
  12293. onDemandFetcher.method558(3, j30);
  12294. k16++;
  12295. }
  12296. }
  12297. }
  12298. }
  12299. if(pktType == 241) {
  12300. int l16 = 0;
  12301. int ai[] = new int[676];
  12302. for(int i24 = 0; i24 < 4; i24++) {
  12303. for(int k26 = 0; k26 < 13; k26++) {
  12304. for(int l28 = 0; l28 < 13; l28++) {
  12305. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  12306. if(k30 != -1) {
  12307. int k31 = k30 >> 14 & 0x3ff;
  12308. int i32 = k30 >> 3 & 0x7ff;
  12309. int k32 = (k31 / 8 << 8) + i32 / 8;
  12310. for(int j33 = 0; j33 < l16; j33++) {
  12311. if(ai[j33] != k32)
  12312. continue;
  12313. k32 = -1;
  12314.  
  12315. }
  12316. if(k32 != -1)
  12317. ai[l16++] = k32;
  12318. }
  12319. }
  12320. }
  12321. }
  12322. aByteArrayArray1183 = new byte[l16][];
  12323. aByteArrayArray1247 = new byte[l16][];
  12324. anIntArray1234 = new int[l16];
  12325. anIntArray1235 = new int[l16];
  12326. anIntArray1236 = new int[l16];
  12327. for(int l26 = 0; l26 < l16; l26++) {
  12328. int i29 = anIntArray1234[l26] = ai[l26];
  12329. int l30 = i29 >> 8 & 0xff;
  12330. int l31 = i29 & 0xff;
  12331. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  12332. if(j32 != -1)
  12333. onDemandFetcher.method558(3, j32);
  12334. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  12335. if(i33 != -1)
  12336. onDemandFetcher.method558(3, i33);
  12337. }
  12338. }
  12339. int i17 = baseX - anInt1036;
  12340. int j21 = baseY - anInt1037;
  12341. anInt1036 = baseX;
  12342. anInt1037 = baseY;
  12343. for(int j24 = 0; j24 < 16384; j24++) {
  12344. NPC npc = npcArray[j24];
  12345. if(npc != null) {
  12346. for(int j29 = 0; j29 < 10; j29++) {
  12347. npc.smallX[j29] -= i17;
  12348. npc.smallY[j29] -= j21;
  12349. }
  12350. npc.x -= i17 * 128;
  12351. npc.y -= j21 * 128;
  12352. }
  12353. }
  12354. for(int i27 = 0; i27 < maxPlayers; i27++) {
  12355. Player player = playerArray[i27];
  12356. if(player != null) {
  12357. for(int i31 = 0; i31 < 10; i31++) {
  12358. player.smallX[i31] -= i17;
  12359. player.smallY[i31] -= j21;
  12360. }
  12361. player.x -= i17 * 128;
  12362. player.y -= j21 * 128;
  12363. }
  12364. }
  12365. aBoolean1080 = true;
  12366. byte byte1 = 0;
  12367. byte byte2 = 104;
  12368. byte byte3 = 1;
  12369. if(i17 < 0) {
  12370. byte1 = 103;
  12371. byte2 = -1;
  12372. byte3 = -1;
  12373. }
  12374. byte byte4 = 0;
  12375. byte byte5 = 104;
  12376. byte byte6 = 1;
  12377. if(j21 < 0) {
  12378. byte4 = 103;
  12379. byte5 = -1;
  12380. byte6 = -1;
  12381. }
  12382. for(int k33 = byte1; k33 != byte2; k33 += byte3) {
  12383. for(int l33 = byte4; l33 != byte5; l33 += byte6) {
  12384. int i34 = k33 + i17;
  12385. int j34 = l33 + j21;
  12386. for(int k34 = 0; k34 < 4; k34++)
  12387. if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  12388. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  12389. else
  12390. groundArray[k34][k33][l33] = null;
  12391. }
  12392. }
  12393. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext()) {
  12394. class30_sub1_1.anInt1297 -= i17;
  12395. class30_sub1_1.anInt1298 -= j21;
  12396. if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  12397. class30_sub1_1.unlink();
  12398. }
  12399. if(destX != 0) {
  12400. destX -= i17;
  12401. destY -= j21;
  12402. }
  12403. aBoolean1160 = false;
  12404. pktType = -1;
  12405. return true;
  12406.  
  12407. case 208:
  12408. int i3 = inStream.method437();
  12409. if(i3 >= 0)
  12410. method60(i3);
  12411. anInt1018 = i3;
  12412. pktType = -1;
  12413. return true;
  12414.  
  12415. case 99:
  12416. anInt1021 = inStream.readUnsignedByte();
  12417. pktType = -1;
  12418. return true;
  12419.  
  12420. case 75:
  12421. int j3 = inStream.method436();
  12422. int j11 = inStream.method436();
  12423. RSInterface.interfaceCache[j11].anInt233 = 2;
  12424. RSInterface.interfaceCache[j11].mediaID = j3;
  12425. pktType = -1;
  12426. return true;
  12427.  
  12428. case 114:
  12429. anInt1104 = inStream.method434() * 30;
  12430. pktType = -1;
  12431. return true;
  12432.  
  12433. case 60:
  12434. anInt1269 = inStream.readUnsignedByte();
  12435. anInt1268 = inStream.method427();
  12436. while(inStream.currentOffset < pktSize) {
  12437. int k3 = inStream.readUnsignedByte();
  12438. method137(inStream, k3);
  12439. }
  12440. pktType = -1;
  12441. return true;
  12442.  
  12443. case 35:
  12444. int l3 = inStream.readUnsignedByte();
  12445. int k11 = inStream.readUnsignedByte();
  12446. int j17 = inStream.readUnsignedByte();
  12447. int k21 = inStream.readUnsignedByte();
  12448. aBooleanArray876[l3] = true;
  12449. anIntArray873[l3] = k11;
  12450. anIntArray1203[l3] = j17;
  12451. anIntArray928[l3] = k21;
  12452. anIntArray1030[l3] = 0;
  12453. pktType = -1;
  12454. return true;
  12455.  
  12456. case 174:
  12457. int i4 = inStream.readUnsignedWord();
  12458. int l11 = inStream.readUnsignedByte();
  12459. int k17 = inStream.readUnsignedWord();
  12460. if(aBoolean848 && !lowMem && anInt1062 < 50) {
  12461. anIntArray1207[anInt1062] = i4;
  12462. anIntArray1241[anInt1062] = l11;
  12463. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  12464. anInt1062++;
  12465. }
  12466. pktType = -1;
  12467. return true;
  12468.  
  12469. case 104:
  12470. int j4 = inStream.method427();
  12471. int i12 = inStream.method426();
  12472. String s6 = inStream.readString();
  12473. if(j4 >= 1 && j4 <= 5) {
  12474. if(s6.equalsIgnoreCase("null"))
  12475. s6 = null;
  12476. atPlayerActions[j4 - 1] = s6;
  12477. atPlayerArray[j4 - 1] = i12 == 0;
  12478. }
  12479. pktType = -1;
  12480. return true;
  12481.  
  12482. case 78:
  12483. destX = 0;
  12484. pktType = -1;
  12485. return true;
  12486.  
  12487. case 253:
  12488. String s = inStream.readString();
  12489. if(s.endsWith(":tradereq:")) {
  12490. String s3 = s.substring(0, s.indexOf(":"));
  12491. long l17 = TextClass.longForName(s3);
  12492. boolean flag2 = false;
  12493. for(int j27 = 0; j27 < ignoreCount; j27++) {
  12494. if(ignoreListAsLongs[j27] != l17)
  12495. continue;
  12496. flag2 = true;
  12497.  
  12498. }
  12499. if(!flag2 && anInt1251 == 0)
  12500. pushMessage("wishes to trade with you.", 4, s3);
  12501. } else if (s.endsWith(":clan:")) {
  12502. String s4 = s.substring(0, s.indexOf(":"));
  12503. long l18 = TextClass.longForName(s4);
  12504. pushMessage("Clan: ", 8, s4);
  12505. } else if(s.endsWith("#url#")) {
  12506. String link = s.substring(0, s.indexOf("#"));
  12507. pushMessage("Join us at: ", 9, link);
  12508. } else if(s.endsWith(":duelreq:")) {
  12509. String s4 = s.substring(0, s.indexOf(":"));
  12510. long l18 = TextClass.longForName(s4);
  12511. boolean flag3 = false;
  12512. for(int k27 = 0; k27 < ignoreCount; k27++) {
  12513. if(ignoreListAsLongs[k27] != l18)
  12514. continue;
  12515. flag3 = true;
  12516.  
  12517. }
  12518. if(!flag3 && anInt1251 == 0)
  12519. pushMessage("wishes to duel with you.", 8, s4);
  12520. } else if(s.endsWith(":chalreq:")) {
  12521. String s5 = s.substring(0, s.indexOf(":"));
  12522. long l19 = TextClass.longForName(s5);
  12523. boolean flag4 = false;
  12524. for(int l27 = 0; l27 < ignoreCount; l27++) {
  12525. if(ignoreListAsLongs[l27] != l19)
  12526. continue;
  12527. flag4 = true;
  12528.  
  12529. }
  12530. if(!flag4 && anInt1251 == 0) {
  12531. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  12532. pushMessage(s8, 8, s5);
  12533. }
  12534. } else {
  12535. pushMessage(s, 0, "");
  12536. }
  12537. pktType = -1;
  12538. return true;
  12539.  
  12540. case 1:
  12541. for(int k4 = 0; k4 < playerArray.length; k4++)
  12542. if(playerArray[k4] != null)
  12543. playerArray[k4].anim = -1;
  12544. for(int j12 = 0; j12 < npcArray.length; j12++)
  12545. if(npcArray[j12] != null)
  12546. npcArray[j12].anim = -1;
  12547. pktType = -1;
  12548. return true;
  12549.  
  12550. case 50:
  12551. long l4 = inStream.readQWord();
  12552. int i18 = inStream.readUnsignedByte();
  12553. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  12554. for(int k24 = 0; k24 < friendsCount; k24++) {
  12555. if(l4 != friendsListAsLongs[k24])
  12556. continue;
  12557. if(friendsNodeIDs[k24] != i18) {
  12558. friendsNodeIDs[k24] = i18;
  12559. needDrawTabArea = true;
  12560. if(i18 >= 2) {
  12561. pushMessage(s7 + " has logged in.", 5, "");
  12562. }
  12563. if(i18 <= 1) {
  12564. pushMessage(s7 + " has logged out.", 5, "");
  12565. }
  12566. }
  12567. s7 = null;
  12568.  
  12569. }
  12570. if(s7 != null && friendsCount < 200) {
  12571. friendsListAsLongs[friendsCount] = l4;
  12572. friendsList[friendsCount] = s7;
  12573. friendsNodeIDs[friendsCount] = i18;
  12574. friendsCount++;
  12575. needDrawTabArea = true;
  12576. }
  12577. for(boolean flag6 = false; !flag6;) {
  12578. flag6 = true;
  12579. for(int k29 = 0; k29 < friendsCount - 1; k29++)
  12580. if(friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  12581. int j31 = friendsNodeIDs[k29];
  12582. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  12583. friendsNodeIDs[k29 + 1] = j31;
  12584. String s10 = friendsList[k29];
  12585. friendsList[k29] = friendsList[k29 + 1];
  12586. friendsList[k29 + 1] = s10;
  12587. long l32 = friendsListAsLongs[k29];
  12588. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  12589. friendsListAsLongs[k29 + 1] = l32;
  12590. needDrawTabArea = true;
  12591. flag6 = false;
  12592. }
  12593. }
  12594. pktType = -1;
  12595. return true;
  12596.  
  12597. case 110:
  12598. if(tabID == 12)
  12599. needDrawTabArea = true;
  12600. energy = inStream.readUnsignedByte();
  12601. pktType = -1;
  12602. return true;
  12603.  
  12604. case 254:
  12605. anInt855 = inStream.readUnsignedByte();
  12606. if(anInt855 == 1)
  12607. anInt1222 = inStream.readUnsignedWord();
  12608. if(anInt855 >= 2 && anInt855 <= 6) {
  12609. if(anInt855 == 2) {
  12610. anInt937 = 64;
  12611. anInt938 = 64;
  12612. }
  12613. if(anInt855 == 3) {
  12614. anInt937 = 0;
  12615. anInt938 = 64;
  12616. }
  12617. if(anInt855 == 4) {
  12618. anInt937 = 128;
  12619. anInt938 = 64;
  12620. }
  12621. if(anInt855 == 5) {
  12622. anInt937 = 64;
  12623. anInt938 = 0;
  12624. }
  12625. if(anInt855 == 6) {
  12626. anInt937 = 64;
  12627. anInt938 = 128;
  12628. }
  12629. anInt855 = 2;
  12630. anInt934 = inStream.readUnsignedWord();
  12631. anInt935 = inStream.readUnsignedWord();
  12632. anInt936 = inStream.readUnsignedByte();
  12633. }
  12634. if(anInt855 == 10)
  12635. anInt933 = inStream.readUnsignedWord();
  12636. pktType = -1;
  12637. return true;
  12638.  
  12639. case 248:
  12640. int i5 = inStream.method435();
  12641. int k12 = inStream.readUnsignedWord();
  12642. if(backDialogID != -1) {
  12643. backDialogID = -1;
  12644. inputTaken = true;
  12645. }
  12646. if(inputDialogState != 0) {
  12647. inputDialogState = 0;
  12648. inputTaken = true;
  12649. }
  12650. openInterfaceID = i5;
  12651. invOverlayInterfaceID = k12;
  12652. needDrawTabArea = true;
  12653. tabAreaAltered = true;
  12654. aBoolean1149 = false;
  12655. pktType = -1;
  12656. return true;
  12657.  
  12658. case 79:
  12659. int j5 = inStream.method434();
  12660. int l12 = inStream.method435();
  12661. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  12662. if(class9_3 != null && class9_3.type == 0) {
  12663. if(l12 < 0)
  12664. l12 = 0;
  12665. if(l12 > class9_3.scrollMax - class9_3.height)
  12666. l12 = class9_3.scrollMax - class9_3.height;
  12667. class9_3.scrollPosition = l12;
  12668. }
  12669. pktType = -1;
  12670. return true;
  12671.  
  12672. case 68:
  12673. for(int k5 = 0; k5 < variousSettings.length; k5++)
  12674. if(variousSettings[k5] != anIntArray1045[k5]) {
  12675. variousSettings[k5] = anIntArray1045[k5];
  12676. method33(k5);
  12677. needDrawTabArea = true;
  12678. }
  12679. pktType = -1;
  12680. return true;
  12681.  
  12682. case 196:
  12683. long l5 = inStream.readQWord();
  12684. int j18 = inStream.readDWord();
  12685. int l21 = inStream.readUnsignedByte();
  12686. boolean flag5 = false;
  12687. if(l21 <= 1) {
  12688. for(int l29 = 0; l29 < ignoreCount; l29++) {
  12689. if(ignoreListAsLongs[l29] != l5)
  12690. continue;
  12691. flag5 = true;
  12692.  
  12693. }
  12694. }
  12695. if(!flag5 && anInt1251 == 0)
  12696. try {
  12697. String s9 = TextInput.method525(pktSize - 13, inStream);
  12698. //if(l21 != 3)
  12699. //s9 = Censor.doCensor(s9);
  12700. if(l21 == 2 || l21 == 3)
  12701. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12702. else
  12703. if(l21 == 1)
  12704. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12705. else
  12706. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  12707. } catch(Exception exception1) {
  12708. signlink.reporterror("cde1");
  12709. }
  12710. pktType = -1;
  12711. return true;
  12712.  
  12713. case 85:
  12714. anInt1269 = inStream.method427();
  12715. anInt1268 = inStream.method427();
  12716. pktType = -1;
  12717. return true;
  12718.  
  12719. case 24:
  12720. anInt1054 = inStream.method428();
  12721. if(anInt1054 == tabID) {
  12722. if(anInt1054 == 3)
  12723. tabID = 1;
  12724. else
  12725. tabID = 3;
  12726. needDrawTabArea = true;
  12727. }
  12728. pktType = -1;
  12729. return true;
  12730.  
  12731. case 246:
  12732. int i6 = inStream.method434();
  12733. int i13 = inStream.readUnsignedWord();
  12734. int k18 = inStream.readUnsignedWord();
  12735. if(k18 == 65535) {
  12736. RSInterface.interfaceCache[i6].anInt233 = 0;
  12737. pktType = -1;
  12738. return true;
  12739. } else {
  12740. ItemDef itemDef = ItemDef.forID(k18);
  12741. RSInterface.interfaceCache[i6].anInt233 = 4;
  12742. RSInterface.interfaceCache[i6].mediaID = k18;
  12743. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotation1;
  12744. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotation2;
  12745. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  12746. pktType = -1;
  12747. return true;
  12748. }
  12749.  
  12750. case 171:
  12751. boolean flag1 = inStream.readUnsignedByte() == 1;
  12752. int j13 = inStream.readUnsignedWord();
  12753. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  12754. pktType = -1;
  12755. return true;
  12756.  
  12757. case 142:
  12758. int j6 = inStream.method434();
  12759. method60(j6);
  12760. if(backDialogID != -1) {
  12761. backDialogID = -1;
  12762. inputTaken = true;
  12763. }
  12764. if(inputDialogState != 0) {
  12765. inputDialogState = 0;
  12766. inputTaken = true;
  12767. }
  12768. invOverlayInterfaceID = j6;
  12769. needDrawTabArea = true;
  12770. tabAreaAltered = true;
  12771. openInterfaceID = -1;
  12772. aBoolean1149 = false;
  12773. pktType = -1;
  12774. return true;
  12775.  
  12776. case 126:
  12777. String text = inStream.readString();
  12778. int frame = inStream.method435();
  12779. if (text.startsWith("www.")) {
  12780. launchURL(text);
  12781. pktType = -1;
  12782. return true;
  12783. }
  12784. updateStrings(text, frame);
  12785. sendFrame126(text, frame);
  12786. if (frame >= 18144 && frame <= 18244) {
  12787. clanList[frame - 18144] = text;
  12788. }
  12789. pktType = -1;
  12790. return true;
  12791.  
  12792. case 206:
  12793. publicChatMode = inStream.readUnsignedByte();
  12794. privateChatMode = inStream.readUnsignedByte();
  12795. tradeMode = inStream.readUnsignedByte();
  12796. aBoolean1233 = true;
  12797. inputTaken = true;
  12798. pktType = -1;
  12799. return true;
  12800.  
  12801. case 240:
  12802. if(tabID == 12)
  12803. needDrawTabArea = true;
  12804. weight = inStream.readSignedWord();
  12805. pktType = -1;
  12806. return true;
  12807.  
  12808. case 8:
  12809. int k6 = inStream.method436();
  12810. int l13 = inStream.readUnsignedWord();
  12811. RSInterface.interfaceCache[k6].anInt233 = 1;
  12812. RSInterface.interfaceCache[k6].mediaID = l13;
  12813. pktType = -1;
  12814. return true;
  12815.  
  12816. case 122:
  12817. int l6 = inStream.method436();
  12818. int i14 = inStream.method436();
  12819. int i19 = i14 >> 10 & 0x1f;
  12820. int i22 = i14 >> 5 & 0x1f;
  12821. int l24 = i14 & 0x1f;
  12822. RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  12823. pktType = -1;
  12824. return true;
  12825.  
  12826. case 53:
  12827. needDrawTabArea = true;
  12828. int i7 = inStream.readUnsignedWord();
  12829. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  12830. int j19 = inStream.readUnsignedWord();
  12831. for(int j22 = 0; j22 < j19; j22++) {
  12832. int i25 = inStream.readUnsignedByte();
  12833. if(i25 == 255)
  12834. i25 = inStream.method440();
  12835. class9_1.inv[j22] = inStream.method436();
  12836. class9_1.invStackSizes[j22] = i25;
  12837. }
  12838. for(int j25 = j19; j25 < class9_1.inv.length; j25++) {
  12839. class9_1.inv[j25] = 0;
  12840. class9_1.invStackSizes[j25] = 0;
  12841. }
  12842. pktType = -1;
  12843. return true;
  12844.  
  12845. case 230:
  12846. int j7 = inStream.method435();
  12847. int j14 = inStream.readUnsignedWord();
  12848. int k19 = inStream.readUnsignedWord();
  12849. int k22 = inStream.method436();
  12850. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  12851. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  12852. RSInterface.interfaceCache[j14].modelZoom = j7;
  12853. pktType = -1;
  12854. return true;
  12855.  
  12856. case 221:
  12857. anInt900 = inStream.readUnsignedByte();
  12858. needDrawTabArea = true;
  12859. pktType = -1;
  12860. return true;
  12861.  
  12862. case 177:
  12863. aBoolean1160 = true;
  12864. anInt995 = inStream.readUnsignedByte();
  12865. anInt996 = inStream.readUnsignedByte();
  12866. anInt997 = inStream.readUnsignedWord();
  12867. anInt998 = inStream.readUnsignedByte();
  12868. anInt999 = inStream.readUnsignedByte();
  12869. if(anInt999 >= 100) {
  12870. int k7 = anInt995 * 128 + 64;
  12871. int k14 = anInt996 * 128 + 64;
  12872. int i20 = method42(plane, k14, k7) - anInt997;
  12873. int l22 = k7 - xCameraPos;
  12874. int k25 = i20 - zCameraPos;
  12875. int j28 = k14 - yCameraPos;
  12876. int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  12877. yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  12878. xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  12879. if(yCameraCurve < 128)
  12880. yCameraCurve = 128;
  12881. if(yCameraCurve > 383)
  12882. yCameraCurve = 383;
  12883. }
  12884. pktType = -1;
  12885. return true;
  12886.  
  12887. case 249:
  12888. anInt1046 = inStream.method426();
  12889. unknownInt10 = inStream.method436();
  12890. pktType = -1;
  12891. return true;
  12892.  
  12893. case 65:
  12894. updateNPCs(inStream, pktSize);
  12895. pktType = -1;
  12896. return true;
  12897.  
  12898. case 27:
  12899. messagePromptRaised = false;
  12900. inputDialogState = 1;
  12901. amountOrNameInput = "";
  12902. inputTaken = true;
  12903. pktType = -1;
  12904. return true;
  12905.  
  12906. case 187:
  12907. messagePromptRaised = false;
  12908. inputDialogState = 2;
  12909. amountOrNameInput = "";
  12910. inputTaken = true;
  12911. pktType = -1;
  12912. return true;
  12913.  
  12914. case 97:
  12915. int l7 = inStream.readUnsignedWord();
  12916. method60(l7);
  12917. if(invOverlayInterfaceID != -1) {
  12918. invOverlayInterfaceID = -1;
  12919. needDrawTabArea = true;
  12920. tabAreaAltered = true;
  12921. }
  12922. if(backDialogID != -1) {
  12923. backDialogID = -1;
  12924. inputTaken = true;
  12925. }
  12926. if(inputDialogState != 0) {
  12927. inputDialogState = 0;
  12928. inputTaken = true;
  12929. }
  12930. openInterfaceID = l7;
  12931. aBoolean1149 = false;
  12932. pktType = -1;
  12933. return true;
  12934.  
  12935. case 218:
  12936. int i8 = inStream.method438();
  12937. dialogID = i8;
  12938. inputTaken = true;
  12939. pktType = -1;
  12940. return true;
  12941.  
  12942. case 87:
  12943. int j8 = inStream.method434();
  12944. int l14 = inStream.method439();
  12945. anIntArray1045[j8] = l14;
  12946. if(variousSettings[j8] != l14) {
  12947. variousSettings[j8] = l14;
  12948. method33(j8);
  12949. needDrawTabArea = true;
  12950. if(dialogID != -1)
  12951. inputTaken = true;
  12952. }
  12953. pktType = -1;
  12954. return true;
  12955.  
  12956. case 36:
  12957. int k8 = inStream.method434();
  12958. byte byte0 = inStream.readSignedByte();
  12959. anIntArray1045[k8] = byte0;
  12960. if(variousSettings[k8] != byte0) {
  12961. variousSettings[k8] = byte0;
  12962. method33(k8);
  12963. needDrawTabArea = true;
  12964. if(dialogID != -1)
  12965. inputTaken = true;
  12966. }
  12967. pktType = -1;
  12968. return true;
  12969.  
  12970. case 61:
  12971. anInt1055 = inStream.readUnsignedByte();
  12972. pktType = -1;
  12973. return true;
  12974.  
  12975. case 200:
  12976. int l8 = inStream.readUnsignedWord();
  12977. int i15 = inStream.readSignedWord();
  12978. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  12979. class9_4.anInt257 = i15;
  12980. if(i15 == 591 || i15 == 588) {
  12981. class9_4.modelZoom = 2000;
  12982. }
  12983. if(i15 == -1) {
  12984. class9_4.anInt246 = 0;
  12985. class9_4.anInt208 = 0;
  12986. }
  12987. pktType = -1;
  12988. return true;
  12989.  
  12990. case 219:
  12991. if(invOverlayInterfaceID != -1) {
  12992. invOverlayInterfaceID = -1;
  12993. needDrawTabArea = true;
  12994. tabAreaAltered = true;
  12995. }
  12996. if(backDialogID != -1) {
  12997. backDialogID = -1;
  12998. inputTaken = true;
  12999. }
  13000. if(inputDialogState != 0) {
  13001. inputDialogState = 0;
  13002. inputTaken = true;
  13003. }
  13004. openInterfaceID = -1;
  13005. aBoolean1149 = false;
  13006. pktType = -1;
  13007. return true;
  13008.  
  13009. case 34:
  13010. needDrawTabArea = true;
  13011. int i9 = inStream.readUnsignedWord();
  13012. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  13013. while(inStream.currentOffset < pktSize) {
  13014. int j20 = inStream.method422();
  13015. int i23 = inStream.readUnsignedWord();
  13016. int l25 = inStream.readUnsignedByte();
  13017. if(l25 == 255)
  13018. l25 = inStream.readDWord();
  13019. if(j20 >= 0 && j20 < class9_2.inv.length) {
  13020. class9_2.inv[j20] = i23;
  13021. class9_2.invStackSizes[j20] = l25;
  13022. }
  13023. }
  13024. pktType = -1;
  13025. return true;
  13026.  
  13027. case 4:
  13028. case 44:
  13029. case 84:
  13030. case 101:
  13031. case 105:
  13032. case 117:
  13033. case 147:
  13034. case 151:
  13035. case 156:
  13036. case 160:
  13037. case 215:
  13038. method137(inStream, pktType);
  13039. pktType = -1;
  13040. return true;
  13041.  
  13042. case 106:
  13043. tabID = inStream.method427();
  13044. needDrawTabArea = true;
  13045. tabAreaAltered = true;
  13046. pktType = -1;
  13047. return true;
  13048.  
  13049. case 164:
  13050. int j9 = inStream.method434();
  13051. method60(j9);
  13052. if(invOverlayInterfaceID != -1) {
  13053. invOverlayInterfaceID = -1;
  13054. needDrawTabArea = true;
  13055. tabAreaAltered = true;
  13056. }
  13057. backDialogID = j9;
  13058. inputTaken = true;
  13059. openInterfaceID = -1;
  13060. aBoolean1149 = false;
  13061. pktType = -1;
  13062. return true;
  13063.  
  13064. }
  13065. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  13066. //resetLogout();
  13067. } catch(IOException _ex) {
  13068. dropClient();
  13069. } catch(Exception exception) {
  13070. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  13071. for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  13072. s2 = s2 + inStream.buffer[j15] + ",";
  13073. signlink.reporterror(s2);
  13074. //resetLogout();
  13075. }
  13076. pktType = -1;
  13077. return true;
  13078. }
  13079.  
  13080. private void method146() {
  13081. anInt1265++;
  13082. method47(true);
  13083. method26(true);
  13084. method47(false);
  13085. method26(false);
  13086. method55();
  13087. method104();
  13088. if(!aBoolean1160) {
  13089. int i = anInt1184;
  13090. if(anInt984 / 256 > i)
  13091. i = anInt984 / 256;
  13092. if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  13093. i = anIntArray1203[4] + 128;
  13094. int k = minimapInt1 + anInt896 & 0x7ff;
  13095. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  13096. }
  13097. int j;
  13098. if(!aBoolean1160)
  13099. j = method120();
  13100. else
  13101. j = method121();
  13102. int l = xCameraPos;
  13103. int i1 = zCameraPos;
  13104. int j1 = yCameraPos;
  13105. int k1 = yCameraCurve;
  13106. int l1 = xCameraCurve;
  13107. for(int i2 = 0; i2 < 5; i2++)
  13108. if(aBooleanArray876[i2]) {
  13109. 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]);
  13110. if(i2 == 0)
  13111. xCameraPos += j2;
  13112. if(i2 == 1)
  13113. zCameraPos += j2;
  13114. if(i2 == 2)
  13115. yCameraPos += j2;
  13116. if(i2 == 3)
  13117. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  13118. if(i2 == 4) {
  13119. yCameraCurve += j2;
  13120. if(yCameraCurve < 128)
  13121. yCameraCurve = 128;
  13122. if(yCameraCurve > 383)
  13123. yCameraCurve = 383;
  13124. }
  13125. }
  13126. int k2 = Texture.anInt1481;
  13127. Model.aBoolean1684 = true;
  13128. Model.anInt1687 = 0;
  13129. Model.anInt1685 = super.mouseX - 4;
  13130. Model.anInt1686 = super.mouseY - 4;
  13131. DrawingArea.setAllPixelsToZero();
  13132. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  13133. worldController.clearObj5Cache();
  13134. updateEntities();
  13135. drawHeadIcon();
  13136. method37(k2);
  13137. drawMoneyPouchToggle();
  13138. draw3dScreen();
  13139. if (counterOn)
  13140. drawCounterOnScreen();
  13141. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  13142. xCameraPos = l;
  13143. zCameraPos = i1;
  13144. yCameraPos = j1;
  13145. yCameraCurve = k1;
  13146. xCameraCurve = l1;
  13147. }
  13148. public void drawRunOrb(){
  13149. String OD = "./Sprites/Gameframe/Orbs/";
  13150. ORBS[0] = new Sprite(OD + "ORBS 0.png", 27, getOrbFill(100));
  13151. if(energy != 100){
  13152. ORBS[0].drawSprite(193, 95);
  13153. }
  13154. runClicked = anIntArray1045[173] == 1;
  13155. Resting = anIntArray1045[174] == 1;
  13156. ORBS[runHover ? 7 : 1].drawSprite(190, 92);
  13157. ORBS[runClicked ? 11 : 10].drawSprite(193, 95);
  13158. if(!Resting)
  13159. ORBS[runClicked ? 9 : 8].drawSprite(200, 100);
  13160. else
  13161. ORBS[Resting ? 12 : 8].drawSprite(200, 100);
  13162. String currentEnergy = RSInterface.interfaceCache[149].message;
  13163. currentEnergy = currentEnergy.replaceAll("%","");
  13164. smallText.method382(getOrbTextColor(100), 232, currentEnergy, 118, true);
  13165. }
  13166. public void drawPrayer()
  13167. {
  13168. String s = "Gameframe" + File.separator + "Orbs" + File.separator;
  13169. String s1 = RSInterface.interfaceCache[4012].message;
  13170. String s2 = RSInterface.interfaceCache[4013].message;
  13171. int i = Integer.parseInt(s1);
  13172. int j = Integer.parseInt(s2);
  13173. int k = (int)(((double)i / (double)j) * 100D);
  13174. ORBS[0] = new Sprite((new StringBuilder()).append(s).append("ORBS 0.png").toString(), 27, getOrbFill(k));
  13175. ORBS[1].drawSprite(190, 53);
  13176. ORBS[4].drawSprite(193, 56);
  13177. ORBS[0].drawSprite(194, 56);
  13178. ORBS[6].drawSprite(197, 60);
  13179. smallText.method382(getOrbTextColor(k), 234, (new StringBuilder()).append("").append(i).toString(), 79, true);
  13180. }
  13181.  
  13182. public int getOrbFill(int statusInt){
  13183. if(statusInt <= Integer.MAX_VALUE && statusInt >= 97)
  13184. return 0;
  13185. else if(statusInt <= 96 && statusInt >= 93)
  13186. return 1;
  13187. else if(statusInt <= 92 && statusInt >= 89)
  13188. return 2;
  13189. else if(statusInt <= 88 && statusInt >= 85)
  13190. return 3;
  13191. else if(statusInt <= 84 && statusInt >= 81)
  13192. return 4;
  13193. else if(statusInt <= 80 && statusInt >= 77)
  13194. return 5;
  13195. else if(statusInt <= 76 && statusInt >= 73)
  13196. return 6;
  13197. else if(statusInt <= 72 && statusInt >= 69)
  13198. return 7;
  13199. else if(statusInt <= 68 && statusInt >= 65)
  13200. return 8;
  13201. else if(statusInt <= 64 && statusInt >= 61)
  13202. return 9;
  13203. else if(statusInt <= 60 && statusInt >= 57)
  13204. return 10;
  13205. else if(statusInt <= 56 && statusInt >= 53)
  13206. return 11;
  13207. else if(statusInt <= 52 && statusInt >= 49)
  13208. return 12;
  13209. else if(statusInt <= 48 && statusInt >= 45)
  13210. return 13;
  13211. else if(statusInt <= 44 && statusInt >= 41)
  13212. return 14;
  13213. else if(statusInt <= 40 && statusInt >= 37)
  13214. return 15;
  13215. else if(statusInt <= 36 && statusInt >= 33)
  13216. return 16;
  13217. else if(statusInt <= 32 && statusInt >= 29)
  13218. return 17;
  13219. else if(statusInt <= 28 && statusInt >= 25)
  13220. return 18;
  13221. else if(statusInt <= 24 && statusInt >= 21)
  13222. return 19;
  13223. else if(statusInt <= 20 && statusInt >= 17)
  13224. return 20;
  13225. else if(statusInt <= 16 && statusInt >= 13)
  13226. return 21;
  13227. else if(statusInt <= 12 && statusInt >= 9)
  13228. return 22;
  13229. else if(statusInt <= 8 && statusInt >= 7)
  13230. return 23;
  13231. else if(statusInt <= 6 && statusInt >= 5)
  13232. return 24;
  13233. else if(statusInt <= 4 && statusInt >= 3)
  13234. return 25;
  13235. else if(statusInt <= 2 && statusInt >= 1)
  13236. return 26;
  13237. else if(statusInt <= 0)
  13238. return 27;
  13239. return 0;
  13240. }
  13241.  
  13242. public void drawHP() {
  13243. int health;
  13244. String OrbDirectory = "Gameframe" + File.separator + "Orbs" + File.separator;
  13245. String cHP = RSInterface.interfaceCache[4016].message;
  13246. cHP = cHP.replaceAll("%","");
  13247. int currentHP = Integer.parseInt(cHP);
  13248. String mHP = RSInterface.interfaceCache[4017].message;
  13249. mHP = mHP.replaceAll("%","");
  13250. int maxHP2 = Integer.parseInt(mHP);
  13251. health = (int)(((double)currentHP / (double)maxHP2) * 100D);
  13252. ORBS[0] = new Sprite(OrbDirectory+"ORBS 0.png", 27, getOrbFill(health));
  13253. ORBS[1].drawSprite(174, 14);
  13254.  
  13255. ORBS[2].drawSprite(177, 17);
  13256. ORBS[0].drawSprite(177, 17);
  13257. if(health <= 20){
  13258. if(loopCycle % 20 < 10){
  13259. ORBS[3].drawSprite(183, 25);
  13260. }
  13261. } else {
  13262. ORBS[3].drawSprite(183, 25);
  13263. }
  13264. int Y = 40;
  13265. smallText.method382(getOrbTextColor(health), 218, currentHP + "", Y, true);
  13266. }
  13267.  
  13268. private Sprite coinOrb;
  13269. private Sprite coinIcon;
  13270. private Sprite coinOrbToggle;
  13271. boolean pouchToggle;
  13272. boolean pouchHover;
  13273.  
  13274. public int getMoneyOrbColor(long cashAmount){
  13275. if(cashAmount >= 100000 && cashAmount <= 999999){
  13276. return 0xffffff;
  13277. } else {
  13278. return 65280;
  13279. }
  13280. }
  13281.  
  13282.  
  13283. public void drawMoneyPouchToggle() {
  13284. if(pouchToggle){
  13285. coinOrbToggle = new Sprite(pouchHover ? "Gameframe/Money pouch/toggle hovered" : "Gameframe/Money pouch/toggle");
  13286. long cash;
  13287. String Cash = RSInterface.interfaceCache[8135].message;
  13288. cash = Long.parseLong(Cash);
  13289. coinOrbToggle.drawSprite(445, 81);
  13290. smallText.drawTextRight(getMoneyOrbColor(cash), 502, (RSInterface.interfaceCache[8134].message), 100, true);
  13291. }
  13292. }
  13293.  
  13294. public void drawMoneyPouch() {
  13295. coinOrb = new Sprite(pouchHover ? "Gameframe/Money pouch/Orb hovered" : "Gameframe/Money pouch/Orb");
  13296. coinIcon = new Sprite("Gameframe/Money pouch/icon");
  13297. coinOrb.drawSprite(0, 82);
  13298. coinIcon.drawSprite(8, 89);
  13299. }
  13300.  
  13301.  
  13302. public void clearTopInterfaces() {
  13303. stream.createFrame(130);
  13304. if (invOverlayInterfaceID != -1) {
  13305. invOverlayInterfaceID = -1;
  13306. needDrawTabArea = true;
  13307. aBoolean1149 = false;
  13308. tabAreaAltered = true;
  13309. }
  13310. if (backDialogID != -1) {
  13311. backDialogID = -1;
  13312. inputTaken = true;
  13313. aBoolean1149 = false;
  13314. }
  13315. openInterfaceID = -1;
  13316. fullscreenInterfaceID = -1;
  13317. }
  13318.  
  13319. public client() {
  13320. fullscreenInterfaceID = -1;
  13321. chatRights = new int[500];
  13322. chatTypeView = 0;
  13323. clanChatMode = 0;
  13324. cButtonHPos = -1;
  13325. cButtonHCPos = -1;
  13326. cButtonCPos = 0;
  13327. server = "0.0.0.0";
  13328. // server = "164.132.233.154";
  13329. crownImages = new Sprite[8];
  13330. anIntArrayArray825 = new int[104][104];
  13331. friendsNodeIDs = new int[200];
  13332. groundArray = new NodeList[4][104][104];
  13333. aBoolean831 = false;
  13334. aStream_834 = new Stream(new byte[5000]);
  13335. npcArray = new NPC[16384];
  13336. npcIndices = new int[16384];
  13337. anIntArray840 = new int[1000];
  13338. aStream_847 = Stream.create();
  13339. aBoolean848 = true;
  13340. openInterfaceID = -1;
  13341. currentExp = new int[Skills.skillsCount];
  13342. aBoolean872 = false;
  13343. anIntArray873 = new int[5];
  13344. anInt874 = -1;
  13345. aBooleanArray876 = new boolean[5];
  13346. drawFlames = false;
  13347. reportAbuseInput = "";
  13348. unknownInt10 = -1;
  13349. menuOpen = false;
  13350. inputString = "";
  13351. maxPlayers = 2048;
  13352. myPlayerIndex = 2047;
  13353. playerArray = new Player[maxPlayers];
  13354. playerIndices = new int[maxPlayers];
  13355. anIntArray894 = new int[maxPlayers];
  13356. aStreamArray895s = new Stream[maxPlayers];
  13357. anInt897 = 1;
  13358. anIntArrayArray901 = new int[104][104];
  13359. anInt902 = 0x766654;
  13360. aByteArray912 = new byte[16384];
  13361. currentStats = new int[Skills.skillsCount];
  13362. ignoreListAsLongs = new long[100];
  13363. loadingError = false;
  13364. anInt927 = 0x332d25;
  13365. anIntArray928 = new int[5];
  13366. anIntArrayArray929 = new int[104][104];
  13367. chatTypes = new int[500];
  13368. chatNames = new String[500];
  13369. chatMessages = new String[500];
  13370. chatButtons = new Sprite[4];
  13371. sideIcons = new Sprite[15];
  13372. redStones = new Sprite[5];
  13373. aBoolean954 = true;
  13374. friendsListAsLongs = new long[200];
  13375. currentSong = -1;
  13376. drawingFlames = false;
  13377. spriteDrawX = -1;
  13378. spriteDrawY = -1;
  13379. anIntArray968 = new int[33];
  13380. anIntArray969 = new int[256];
  13381. decompressors = new Decompressor[5];
  13382. variousSettings = new int[2000];
  13383. aBoolean972 = false;
  13384. anInt975 = 50;
  13385. anIntArray976 = new int[anInt975];
  13386. anIntArray977 = new int[anInt975];
  13387. anIntArray978 = new int[anInt975];
  13388. anIntArray979 = new int[anInt975];
  13389. anIntArray980 = new int[anInt975];
  13390. anIntArray981 = new int[anInt975];
  13391. anIntArray982 = new int[anInt975];
  13392. aStringArray983 = new String[anInt975];
  13393. anInt985 = -1;
  13394. hitMarks = new Sprite[20];
  13395. anIntArray990 = new int[5];
  13396. aBoolean994 = false;
  13397. anInt1002 = 0x23201b;
  13398. amountOrNameInput = "";
  13399. aClass19_1013 = new NodeList();
  13400. aBoolean1017 = false;
  13401. anInt1018 = -1;
  13402. anIntArray1030 = new int[5];
  13403. aBoolean1031 = false;
  13404. mapFunctions = new Sprite[100];
  13405. dialogID = -1;
  13406. maxStats = new int[Skills.skillsCount];
  13407. anIntArray1045 = new int[2000];
  13408. aBoolean1047 = true;
  13409. anIntArray1052 = new int[151];
  13410. anInt1054 = -1;
  13411. aClass19_1056 = new NodeList();
  13412. anIntArray1057 = new int[33];
  13413. aClass9_1059 = new RSInterface();
  13414. mapScenes = new Background[100];
  13415. barFillColor = 0x4d4233;
  13416. anIntArray1065 = new int[7];
  13417. anIntArray1072 = new int[1000];
  13418. anIntArray1073 = new int[1000];
  13419. aBoolean1080 = false;
  13420. friendsList = new String[200];
  13421. inStream = Stream.create();
  13422. expectedCRCs = new int[9];
  13423. menuActionCmd2 = new int[500];
  13424. menuActionCmd3 = new int[500];
  13425. menuActionID = new int[500];
  13426. menuActionCmd1 = new int[500];
  13427. headIcons = new Sprite[18];
  13428. skullIcons = new Sprite[20];
  13429. headIconsHint = new Sprite[20];
  13430. tabAreaAltered = false;
  13431. aString1121 = "";
  13432. atPlayerActions = new String[5];
  13433. atPlayerArray = new boolean[5];
  13434. anIntArrayArrayArray1129 = new int[4][13][13];
  13435. anInt1132 = 2;
  13436. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  13437. aBoolean1141 = false;
  13438. aBoolean1149 = false;
  13439. crosses = new Sprite[8];
  13440. musicEnabled = true;
  13441. needDrawTabArea = false;
  13442. loggedIn = false;
  13443. canMute = false;
  13444. aBoolean1159 = false;
  13445. aBoolean1160 = false;
  13446. anInt1171 = 1;
  13447. myUsername = "bro"; //TODO
  13448. myPassword = "123";
  13449. genericLoadingError = false;
  13450. reportAbuseInterfaceID = -1;
  13451. aClass19_1179 = new NodeList();
  13452. anInt1184 = 128;
  13453. invOverlayInterfaceID = -1;
  13454. stream = Stream.create();
  13455. menuActionName = new String[500];
  13456. anIntArray1203 = new int[5];
  13457. anIntArray1207 = new int[50];
  13458. anInt1210 = 2;
  13459. anInt1211 = 78;
  13460. promptInput = "";
  13461. modIcons = new Sprite[7];
  13462. tabID = 3;
  13463. inputTaken = false;
  13464. songChanging = true;
  13465. anIntArray1229 = new int[151];
  13466. aClass11Array1230 = new Class11[4];
  13467. aBoolean1233 = false;
  13468. anIntArray1240 = new int[100];
  13469. anIntArray1241 = new int[50];
  13470. aBoolean1242 = false;
  13471. anIntArray1250 = new int[50];
  13472. rsAlreadyLoaded = false;
  13473. welcomeScreenRaised = false;
  13474. messagePromptRaised = false;
  13475. loginMessage1 = "";
  13476. loginMessage2 = "";
  13477. backDialogID = -1;
  13478. anInt1279 = 2;
  13479. bigX = new int[4000];
  13480. bigY = new int[4000];
  13481. anInt1289 = -1;
  13482. expAdded = 0;
  13483. //xpLock = false;
  13484. xpCounter = 0;
  13485. counter = new Sprite[4];
  13486. }
  13487.  
  13488. public int rights;
  13489. public String name;
  13490. public String message;
  13491. public String clanname;
  13492. private final int[] chatRights;
  13493. public int chatTypeView;
  13494. public int clanChatMode;
  13495. public int duelMode;
  13496. /* Declare custom sprites */
  13497. private Sprite worldMapIcon;
  13498. private Sprite logIcon;
  13499. private Sprite logIconH;
  13500. private Sprite logIconC;
  13501. private Sprite[] ORBS = new Sprite[18];
  13502. private Sprite HPBarFull;
  13503. private Sprite HPBarEmpty;
  13504. private Sprite chatArea;
  13505. private Sprite skullIcon;
  13506. private Sprite entityBox, entityBox2;
  13507. public RSFont newSmallFont, newRegularFont, newBoldFont, newFancyFont;
  13508. public FontSystem newSmallText, regularText, boldText, fancyText;
  13509. public Sprite[] chatImages = new Sprite[2];
  13510. public Sprite[] crownImages;
  13511. private Sprite[] chatButtons;
  13512. private Sprite tabArea;
  13513. private Sprite mapArea;
  13514. private Sprite emptyOrb;
  13515. private Sprite hoverOrb;
  13516. private Sprite hoverorbrun;
  13517. private Sprite hoverorbrun2;
  13518. private Sprite runClick;
  13519. private Sprite runorb;
  13520. private Sprite hitPointsFill;
  13521. private Sprite prayerFill;
  13522. public boolean HPBarToggle = true;
  13523. public boolean hpHead = true;
  13524.  
  13525. /**/
  13526. private RSImageProducer leftFrame;
  13527. private RSImageProducer topFrame;
  13528. private RSImageProducer rightFrame;
  13529. private int ignoreCount;
  13530. private long aLong824;
  13531. private int[][] anIntArrayArray825;
  13532. private int[] friendsNodeIDs;
  13533. private NodeList[][][] groundArray;
  13534. private int[] anIntArray828;
  13535. private int[] anIntArray829;
  13536. private volatile boolean aBoolean831;
  13537. private Socket aSocket832;
  13538. private int loginScreenState;
  13539. private Stream aStream_834;
  13540. private NPC[] npcArray;
  13541. private int npcCount;
  13542. private int[] npcIndices;
  13543. private int anInt839;
  13544. private int[] anIntArray840;
  13545. private int anInt841;
  13546. private int anInt842;
  13547. private int anInt843;
  13548. private String aString844;
  13549. private int privateChatMode;
  13550. private Stream aStream_847;
  13551. private boolean aBoolean848;
  13552. private static int anInt849;
  13553. private int[] anIntArray850;
  13554. private int[] anIntArray851;
  13555. private int[] anIntArray852;
  13556. private int[] anIntArray853;
  13557. private static int anInt854;
  13558. private int anInt855;
  13559. private int openInterfaceID;
  13560. private int xCameraPos;
  13561. private int zCameraPos;
  13562. private int yCameraPos;
  13563. private int yCameraCurve;
  13564. private int xCameraCurve;
  13565. private int myPrivilege;
  13566. private final int[] currentExp;
  13567. private Sprite[] redStones;
  13568. private Sprite mapFlag;
  13569. private Sprite mapMarker;
  13570. private boolean aBoolean872;
  13571. private final int[] anIntArray873;
  13572. private int anInt874;
  13573. private final boolean[] aBooleanArray876;
  13574. private int weight;
  13575. private MouseDetection mouseDetection;
  13576. private volatile boolean drawFlames;
  13577. private String reportAbuseInput;
  13578. private int unknownInt10;
  13579. private boolean menuOpen;
  13580. private int anInt886;
  13581. private String inputString;
  13582. private final int maxPlayers;
  13583. private final int myPlayerIndex;
  13584. private Player[] playerArray;
  13585. private int playerCount;
  13586. private int[] playerIndices;
  13587. private int anInt893;
  13588. private int[] anIntArray894;
  13589. private Stream[] aStreamArray895s;
  13590. private int anInt896;
  13591. private int anInt897;
  13592. private int friendsCount;
  13593. private int anInt900;
  13594. private int[][] anIntArrayArray901;
  13595. private final int anInt902;
  13596. private byte[] aByteArray912;
  13597. private int anInt913;
  13598. private int crossX;
  13599. private int crossY;
  13600. private int crossIndex;
  13601. private int crossType;
  13602. private int plane;
  13603. private final int[] currentStats;
  13604. private static int anInt924;
  13605. private final long[] ignoreListAsLongs;
  13606. private boolean loadingError;
  13607. private final int anInt927;
  13608. private final int[] anIntArray928;
  13609. private int[][] anIntArrayArray929;
  13610. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  13611. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  13612. private int anInt933;
  13613. private int anInt934;
  13614. private int anInt935;
  13615. private int anInt936;
  13616. private int anInt937;
  13617. private int anInt938;
  13618. private static int anInt940;
  13619. private final int[] chatTypes;
  13620. private final String[] chatNames;
  13621. private final String[] chatMessages;
  13622. private int anInt945;
  13623. private WorldController worldController;
  13624. private Sprite[] sideIcons;
  13625. private boolean logH = false;
  13626. private boolean logC = false;
  13627. private int menuScreenArea;
  13628. private int menuOffsetX;
  13629. private int menuOffsetY;
  13630. private int menuWidth;
  13631. private int menuHeight;
  13632. private long aLong953;
  13633. private boolean aBoolean954;
  13634. private long[] friendsListAsLongs;
  13635. private String[] clanList = new String[100];
  13636. private int currentSong;
  13637. private static int nodeID = 10;
  13638. static int portOff;
  13639. static boolean clientData;
  13640. private static boolean isMembers = true;
  13641. private static boolean lowMem;
  13642. private volatile boolean drawingFlames;
  13643. private int spriteDrawX;
  13644. private int spriteDrawY;
  13645. private final int[] anIntArray965 = {
  13646. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  13647. };
  13648. private Background aBackground_966;
  13649. private Background aBackground_967;
  13650. private final int[] anIntArray968;
  13651. private final int[] anIntArray969;
  13652. final Decompressor[] decompressors;
  13653. public int variousSettings[];
  13654. private boolean aBoolean972;
  13655. private final int anInt975;
  13656. private final int[] anIntArray976;
  13657. private final int[] anIntArray977;
  13658. private final int[] anIntArray978;
  13659. private final int[] anIntArray979;
  13660. private final int[] anIntArray980;
  13661. private final int[] anIntArray981;
  13662. private final int[] anIntArray982;
  13663. private final String[] aStringArray983;
  13664. private int anInt984;
  13665. private int anInt985;
  13666. private static int anInt986;
  13667. private Sprite[] hitMarks;
  13668. private int anInt988;
  13669. private int anInt989;
  13670. private final int[] anIntArray990;
  13671. private static boolean aBoolean993;
  13672. private final boolean aBoolean994;
  13673. private int anInt995;
  13674. private int anInt996;
  13675. private int anInt997;
  13676. private int anInt998;
  13677. private int anInt999;
  13678. private ISAACRandomGen encryption;
  13679. private Sprite mapEdge;
  13680. private Sprite multiOverlay;
  13681. private final int anInt1002;
  13682. static final int[][] anIntArrayArray1003 = {
  13683. {
  13684. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  13685. 2983, 54193
  13686. }, {
  13687. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  13688. 56621, 4783, 1341, 16578, 35003, 25239
  13689. }, {
  13690. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  13691. 10153, 56621, 4783, 1341, 16578, 35003
  13692. }, {
  13693. 4626, 11146, 6439, 12, 4758, 10270
  13694. }, {
  13695. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  13696. }
  13697. };
  13698. private String amountOrNameInput;
  13699. private static int anInt1005;
  13700. private int daysSinceLastLogin;
  13701. private int pktSize;
  13702. private int pktType;
  13703. private int anInt1009;
  13704. private int anInt1010;
  13705. private int anInt1011;
  13706. private NodeList aClass19_1013;
  13707. private int anInt1014;
  13708. private int anInt1015;
  13709. private int anInt1016;
  13710. private boolean aBoolean1017;
  13711. private int anInt1018;
  13712. private static final int[] anIntArray1019;
  13713. private int anInt1021;
  13714. private int anInt1022;
  13715. private int loadingStage;
  13716. private Sprite scrollBar1;
  13717. private Sprite scrollBar2;
  13718. private int anInt1026;
  13719. private Background backBase1;
  13720. private Background backBase2;
  13721. private Background backHmid1;
  13722. private final int[] anIntArray1030;
  13723. private boolean aBoolean1031;
  13724. private Sprite[] mapFunctions;
  13725. private int baseX;
  13726. private int baseY;
  13727. private int anInt1036;
  13728. private int anInt1037;
  13729. private int loginFailures;
  13730. private int anInt1039;
  13731. private int anInt1040;
  13732. private int anInt1041;
  13733. private int dialogID;
  13734. private final int[] maxStats;
  13735. private final int[] anIntArray1045;
  13736. private int anInt1046;
  13737. private boolean aBoolean1047;
  13738. private int anInt1048;
  13739. private String aString1049;
  13740. private static int anInt1051;
  13741. private final int[] anIntArray1052;
  13742. private StreamLoader titleStreamLoader;
  13743. private int anInt1054;
  13744. private int anInt1055;
  13745. private NodeList aClass19_1056;
  13746. private final int[] anIntArray1057;
  13747. public final RSInterface aClass9_1059;
  13748. private Background[] mapScenes;
  13749. private static int anInt1061;
  13750. private int anInt1062;
  13751. private final int barFillColor;
  13752. private int friendsListAction;
  13753. private final int[] anIntArray1065;
  13754. private int mouseInvInterfaceIndex;
  13755. private int lastActiveInvInterface;
  13756. public OnDemandFetcher onDemandFetcher;
  13757. private int anInt1069;
  13758. private int anInt1070;
  13759. private int anInt1071;
  13760. private int[] anIntArray1072;
  13761. private int[] anIntArray1073;
  13762. private Sprite mapDotItem;
  13763. private Sprite mapDotNPC;
  13764. private Sprite mapDotPlayer;
  13765. private Sprite mapDotFriend;
  13766. private Sprite mapDotTeam;
  13767. private Sprite mapDotClan;
  13768. private int anInt1079;
  13769. private boolean aBoolean1080;
  13770. private String[] friendsList;
  13771. private Stream inStream;
  13772. private int anInt1084;
  13773. private int anInt1085;
  13774. private int activeInterfaceType;
  13775. private int anInt1087;
  13776. private int anInt1088;
  13777. public static int anInt1089;
  13778. private final int[] expectedCRCs;
  13779. private int[] menuActionCmd2;
  13780. private int[] menuActionCmd3;
  13781. private int[] menuActionID;
  13782. private int[] menuActionCmd1;
  13783. private Sprite[] headIcons;
  13784. private Sprite[] skullIcons;
  13785. private Sprite[] headIconsHint;
  13786. private static int anInt1097;
  13787. private int anInt1098;
  13788. private int anInt1099;
  13789. private int anInt1100;
  13790. private int anInt1101;
  13791. private int anInt1102;
  13792. private static boolean tabAreaAltered;
  13793. private int anInt1104;
  13794. private RSImageProducer aRSImageProducer_1107;
  13795. private RSImageProducer aRSImageProducer_1108;
  13796. private RSImageProducer aRSImageProducer_1109;
  13797. private RSImageProducer aRSImageProducer_1110;
  13798. private RSImageProducer aRSImageProducer_1111;
  13799. private RSImageProducer aRSImageProducer_1112;
  13800. private RSImageProducer aRSImageProducer_1113;
  13801. private RSImageProducer aRSImageProducer_1114;
  13802. private RSImageProducer aRSImageProducer_1115;
  13803. private static int anInt1117;
  13804. private int membersInt;
  13805. private String aString1121;
  13806. private Sprite compass;
  13807. private RSImageProducer aRSImageProducer_1123;
  13808. private RSImageProducer aRSImageProducer_1124;
  13809. private RSImageProducer aRSImageProducer_1125;
  13810. public static Player myPlayer;
  13811. private final String[] atPlayerActions;
  13812. private final boolean[] atPlayerArray;
  13813. private final int[][][] anIntArrayArrayArray1129;
  13814. private final int[] tabInterfaceIDs = {
  13815. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  13816. -1, -1, -1, -1, -1
  13817. };
  13818. private int anInt1131;
  13819. private int anInt1132;
  13820. private int menuActionRow;
  13821. private static int anInt1134;
  13822. private int spellSelected;
  13823. private int anInt1137;
  13824. private int spellUsableOn;
  13825. private String spellTooltip;
  13826. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  13827. private boolean aBoolean1141;
  13828. private static int anInt1142;
  13829. private int energy;
  13830. private boolean aBoolean1149;
  13831. private Sprite[] crosses;
  13832. private boolean musicEnabled;
  13833. private Background[] aBackgroundArray1152s;
  13834. private static boolean needDrawTabArea;
  13835. private int unreadMessages;
  13836. private static int anInt1155;
  13837. private static boolean fpsOn;
  13838. public boolean loggedIn;
  13839. public boolean runClicked = false;
  13840. public boolean Resting = false;
  13841. public boolean runHover;
  13842. private boolean canMute;
  13843. private boolean aBoolean1159;
  13844. private boolean aBoolean1160;
  13845. static int loopCycle;
  13846. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  13847. private RSImageProducer aRSImageProducer_1163;
  13848. private RSImageProducer mapEdgeIP;
  13849. private RSImageProducer aRSImageProducer_1164;
  13850. private RSImageProducer aRSImageProducer_1165;
  13851. private RSImageProducer aRSImageProducer_1166;
  13852. private int daysSinceRecovChange;
  13853. private RSSocket socketStream;
  13854. private int anInt1169;
  13855. private int minimapInt3;
  13856. private int anInt1171;
  13857. private long aLong1172;
  13858. private String myUsername;
  13859. private String myPassword;
  13860. private static int anInt1175;
  13861. private boolean genericLoadingError;
  13862. private final int[] anIntArray1177 = {
  13863. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  13864. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  13865. 2, 2, 3
  13866. };
  13867. private int reportAbuseInterfaceID;
  13868. private NodeList aClass19_1179;
  13869. private int[] anIntArray1180;
  13870. private int[] anIntArray1181;
  13871. private int[] anIntArray1182;
  13872. private byte[][] aByteArrayArray1183;
  13873. private int anInt1184;
  13874. private int minimapInt1;
  13875. private int anInt1186;
  13876. private int anInt1187;
  13877. private static int anInt1188;
  13878. private int invOverlayInterfaceID;
  13879. private int[] anIntArray1190;
  13880. private int[] anIntArray1191;
  13881. private Stream stream;
  13882. private int anInt1193;
  13883. private int splitPrivateChat;
  13884. private Background mapBack;
  13885. private String[] menuActionName;
  13886. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  13887. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  13888. private final int[] anIntArray1203;
  13889. static final int[] anIntArray1204 = {
  13890. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  13891. 58654, 5027, 1457, 16565, 34991, 25486
  13892. };
  13893. private static boolean flagged;
  13894. private final int[] anIntArray1207;
  13895. private int anInt1208;
  13896. private int minimapInt2;
  13897. private int anInt1210;
  13898. private int anInt1211;
  13899. private String promptInput;
  13900. private int anInt1213;
  13901. private int[][][] intGroundArray;
  13902. private long aLong1215;
  13903. private int loginScreenCursorPos;
  13904. private final Sprite[] modIcons;
  13905. private long aLong1220;
  13906. private static int tabID;
  13907. private int anInt1222;
  13908. public static boolean inputTaken;
  13909. private int inputDialogState;
  13910. private static int anInt1226;
  13911. private int nextSong;
  13912. private boolean songChanging;
  13913. private final int[] anIntArray1229;
  13914. private Class11[] aClass11Array1230;
  13915. public static int anIntArray1232[];
  13916. private boolean aBoolean1233;
  13917. private int[] anIntArray1234;
  13918. private int[] anIntArray1235;
  13919. private int[] anIntArray1236;
  13920. private int anInt1237;
  13921. private int anInt1238;
  13922. public final int anInt1239 = 100;
  13923. private final int[] anIntArray1240;
  13924. private final int[] anIntArray1241;
  13925. private boolean aBoolean1242;
  13926. private int atInventoryLoopCycle;
  13927. private int atInventoryInterface;
  13928. private int atInventoryIndex;
  13929. private int atInventoryInterfaceType;
  13930. private byte[][] aByteArrayArray1247;
  13931. private int tradeMode;
  13932. private int anInt1249;
  13933. private final int[] anIntArray1250;
  13934. private int anInt1251;
  13935. private final boolean rsAlreadyLoaded;
  13936. private int anInt1253;
  13937. private int anInt1254;
  13938. private boolean welcomeScreenRaised;
  13939. private boolean messagePromptRaised;
  13940. private int anInt1257;
  13941. private byte[][][] byteGroundArray;
  13942. private int prevSong;
  13943. private int destX;
  13944. private int destY;
  13945. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  13946. private int anInt1264;
  13947. private int anInt1265;
  13948. private String loginMessage1;
  13949. private String loginMessage2;
  13950. private int anInt1268;
  13951. private int anInt1269;
  13952. private TextDrawingArea smallText;
  13953. private TextDrawingArea aTextDrawingArea_1271;
  13954. private TextDrawingArea chatTextDrawingArea;
  13955. private int anInt1275;
  13956. private int backDialogID;
  13957. private int anInt1278;
  13958. private int anInt1279;
  13959. private int[] bigX;
  13960. private int[] bigY;
  13961. private int itemSelected;
  13962. private int anInt1283;
  13963. private int anInt1284;
  13964. private int anInt1285;
  13965. private String selectedItemName;
  13966. private int publicChatMode;
  13967. private static int anInt1288;
  13968.  
  13969. private int anInt1289;
  13970. public static int anInt1290;
  13971. public static String server = "127.0.0.1";
  13972. public int drawCount;
  13973. public int fullscreenInterfaceID;
  13974. public int anInt1044;//377
  13975. public int anInt1129;//377
  13976. public int anInt1315;//377
  13977. public int anInt1500;//377
  13978. public int anInt1501;//377
  13979. public int[] fullScreenTextureArray;
  13980. public void resetAllImageProducers() {
  13981. if (super.fullGameScreen != null) {
  13982. return;
  13983. }
  13984. aRSImageProducer_1166 = null;
  13985. aRSImageProducer_1164 = null;
  13986. aRSImageProducer_1163 = null;
  13987. aRSImageProducer_1165 = null;
  13988. aRSImageProducer_1123 = null;
  13989. aRSImageProducer_1124 = null;
  13990. aRSImageProducer_1125 = null;
  13991. aRSImageProducer_1107 = null;
  13992. aRSImageProducer_1108 = null;
  13993. aRSImageProducer_1109 = null;
  13994. aRSImageProducer_1110 = null;
  13995. aRSImageProducer_1111 = null;
  13996. aRSImageProducer_1112 = null;
  13997. aRSImageProducer_1113 = null;
  13998. aRSImageProducer_1114 = null;
  13999. aRSImageProducer_1115 = null;
  14000. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  14001. welcomeScreenRaised = true;
  14002. }
  14003.  
  14004.  
  14005. public void launchURL(String url) {
  14006. String osName = System.getProperty("os.name");
  14007. try {
  14008. if (osName.startsWith("Mac OS")) {
  14009. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  14010. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
  14011. openURL.invoke(null, new Object[] {url});
  14012. } else if (osName.startsWith("Windows"))
  14013. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  14014. else { //assume Unix or Linux
  14015. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  14016. String browser = null;
  14017. for (int count = 0; count < browsers.length && browser == null; count++)
  14018. if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
  14019. browser = browsers[count];
  14020. if (browser == null) {
  14021. throw new Exception("Could not find web browser");
  14022. } else
  14023. Runtime.getRuntime().exec(new String[] {browser, url});
  14024. }
  14025. } catch (Exception e) {
  14026. pushMessage("Failed to open URL.", 0, "");
  14027. }
  14028. }
  14029.  
  14030. static {
  14031. anIntArray1019 = new int[99];
  14032. int i = 0;
  14033. for(int j = 0; j < 99; j++) {
  14034. int l = j + 1;
  14035. int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  14036. i += i1;
  14037. anIntArray1019[j] = i / 4;
  14038. }
  14039. anIntArray1232 = new int[32];
  14040. i = 2;
  14041. for(int k = 0; k < 32; k++) {
  14042. anIntArray1232[k] = i - 1;
  14043. i += i;
  14044. }
  14045. }
  14046. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement