trilogyreborn

client.java help find missing bracket

Jun 15th, 2015
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 385.03 KB | None | 0 0
  1. // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.kpdus.com/jad.html
  3. // Decompiler options: packimports(3)
  4.  
  5. import java.applet.AppletContext;
  6. import java.awt.*;
  7. import java.io.*;
  8. import java.math.BigInteger;
  9. import java.net.*;
  10. import java.util.zip.CRC32;
  11. import java.lang.reflect.Method;
  12. import sign.signlink;
  13. import javax.swing.*;
  14.  
  15. public class client extends RSApplet {
  16.  
  17. public int transAmount;
  18. public int MapX, MapY;
  19. public static int spellID = 0;
  20.  
  21. public boolean newHP = true;
  22. public static boolean newDamage = false, newHits = false;
  23.  
  24. private boolean safeZone = false, countToSafe = false, pvpWindow = true;
  25. private long pvpCount = 0;
  26. private int count = 10;
  27.  
  28. public void loadExtraSprites() {
  29. magicAuto = new Sprite("Misc/magicAuto");
  30. HPBarFull = new Sprite("Player/HP 0");
  31. HPBarEmpty = new Sprite("Player/HP 1");
  32. for(int i4 = 0; i4 < 4; i4++)
  33. hitMark[i4] = new Sprite("Player/Hits "+i4+"");
  34. for(int i = 0; i < 16; i++)
  35. pvpIcon[i] = new Sprite("/PvP/pvp"+i);
  36. }
  37.  
  38. public Sprite magicAuto;
  39. public boolean Autocast = false;
  40. public int autocastId = 0;
  41.  
  42. private static String intToKOrMilLongName(int i) {
  43. String s = String.valueOf(i);
  44. for(int k = s.length() - 3; k > 0; k -= 3)
  45. s = s.substring(0, k) + "," + s.substring(k);
  46. if(s.length() > 8)
  47. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  48. else
  49. if(s.length() > 4)
  50. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  51. return " " + s;
  52. }
  53.  
  54. public final String methodR(int j) {
  55. if(j >= 0 && j < 10000)
  56. return String.valueOf(j);
  57. if(j >= 10000 && j < 10000000)
  58. return j / 1000 + "K";
  59. if(j >= 10000000 && j < 999999999)
  60. return j / 1000000 + "M";
  61. if(j >= 999999999)
  62. return "*";
  63. else
  64. return "?";
  65. }
  66.  
  67. public static final byte[] ReadFile(String s) {
  68. try {
  69. byte abyte0[];
  70. File file = new File(s);
  71. int i = (int)file.length();
  72. abyte0 = new byte[i];
  73. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  74. datainputstream.readFully(abyte0, 0, i);
  75. datainputstream.close();
  76. return abyte0;
  77. } catch(Exception e) {
  78. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  79. return null;
  80. }
  81. }
  82.  
  83. public void models() {
  84. for(int ModelIndex = 13943; ModelIndex < 45446; ModelIndex++) {
  85. byte[] abyte0 = getModel(ModelIndex);
  86. if(abyte0 != null && abyte0.length > 0) {
  87. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  88. System.out.println("Added model:" + ModelIndex);
  89. //pushMessage("Model added successfully!", 0, "");
  90. }
  91. }
  92. }
  93.  
  94. public byte[] getModel(int Index) {
  95. try {
  96. File Model = new File("./model/"+Index+".dat.gz");
  97. byte[] aByte = new byte[(int)Model.length()];
  98. FileInputStream fis = new FileInputStream(Model);
  99. fis.read(aByte);
  100. //pushMessage("aByte = ["+aByte+"]!", 0, "");
  101. fis.close();
  102. return aByte;
  103. }
  104. catch(Exception e)
  105. {return null;}
  106. }
  107.  
  108. private void stopMidi() {
  109. signlink.midifade = 0;
  110. signlink.midi = "stop";
  111. }
  112.  
  113. private boolean menuHasAddFriend(int j) {
  114. if(j < 0)
  115. return false;
  116. int k = menuActionID[j];
  117. if(k >= 2000)
  118. k -= 2000;
  119. return k == 337;
  120. }
  121.  
  122. public void drawChannelButtons() {
  123. String text[] = { "On", "Friends", "Off", "Hide" };
  124. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  125. switch(cButtonCPos) {
  126. case 0:
  127. chatButtons[1].drawSprite(5, 142);
  128. break;
  129. case 1:
  130. chatButtons[1].drawSprite(71, 142);
  131. break;
  132. case 2:
  133. chatButtons[1].drawSprite(137, 142);
  134. break;
  135. case 3:
  136. chatButtons[1].drawSprite(203, 142);
  137. break;
  138. case 4:
  139. chatButtons[1].drawSprite(269, 142);
  140. break;
  141. case 5:
  142. chatButtons[1].drawSprite(335, 142);
  143. break;
  144. }
  145. if(cButtonHPos == cButtonCPos) {
  146. switch(cButtonHPos) {
  147. case 0:
  148. chatButtons[2].drawSprite(5, 142);
  149. break;
  150. case 1:
  151. chatButtons[2].drawSprite(71, 142);
  152. break;
  153. case 2:
  154. chatButtons[2].drawSprite(137, 142);
  155. break;
  156. case 3:
  157. chatButtons[2].drawSprite(203, 142);
  158. break;
  159. case 4:
  160. chatButtons[2].drawSprite(269, 142);
  161. break;
  162. case 5:
  163. chatButtons[2].drawSprite(335, 142);
  164. break;
  165. case 6:
  166. chatButtons[3].drawSprite(404, 142);
  167. break;
  168. }
  169. } else {
  170. switch(cButtonHPos) {
  171. case 0:
  172. chatButtons[0].drawSprite(5, 142);
  173. break;
  174. case 1:
  175. chatButtons[0].drawSprite(71, 142);
  176. break;
  177. case 2:
  178. chatButtons[0].drawSprite(137, 142);
  179. break;
  180. case 3:
  181. chatButtons[0].drawSprite(203, 142);
  182. break;
  183. case 4:
  184. chatButtons[0].drawSprite(269, 142);
  185. break;
  186. case 5:
  187. chatButtons[0].drawSprite(335, 142);
  188. break;
  189. case 6:
  190. chatButtons[3].drawSprite(404, 142);
  191. break;
  192. }
  193. }
  194. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
  195. smallText.method389(true, 26, 0xffffff, "All", 157);
  196. smallText.method389(true, 86, 0xffffff, "Game", 157);
  197. smallText.method389(true, 150, 0xffffff, "Public", 152);
  198. smallText.method389(true, 212, 0xffffff, "Private", 152);
  199. smallText.method389(true, 286, 0xffffff, "Clan", 152);
  200. smallText.method389(true, 349, 0xffffff, "Trade", 152);
  201. smallText.method382(textColor[publicChatMode], 164, text[publicChatMode], 163, true);
  202. smallText.method382(textColor[privateChatMode], 230, text[privateChatMode], 163, true);
  203. smallText.method382(textColor[clanChatMode], 296, text[clanChatMode], 163, true);
  204. smallText.method382(textColor[tradeMode], 362, text[tradeMode], 163, true);
  205. }
  206.  
  207. private void drawChatArea() {
  208. aRSImageProducer_1166.initDrawingArea();
  209. Texture.anIntArray1472 = anIntArray1180;
  210. chatArea.drawSprite(0, 0);
  211. drawChannelButtons();
  212. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  213. if(messagePromptRaised) {
  214. chatTextDrawingArea.drawText(0, aString1121, 60, 259);
  215. chatTextDrawingArea.drawText(128, promptInput + "*", 80, 259);
  216. } else if(inputDialogState == 1) {
  217. chatTextDrawingArea.drawText(0, "Enter amount:", 60, 259);
  218. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  219. } else if(inputDialogState == 2) {
  220. chatTextDrawingArea.drawText(0, "Enter name:", 60, 259);
  221. chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  222. } else if(aString844 != null) {
  223. chatTextDrawingArea.drawText(0, aString844, 60, 259);
  224. chatTextDrawingArea.drawText(128, "Click to continue", 80, 259);
  225. } else if(backDialogID != -1) {
  226. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  227. } else if(dialogID != -1) {
  228. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  229. } else {
  230. int j77 = -3;
  231. int j = 0;
  232. DrawingArea.setDrawingArea(122, 8, 497, 7);
  233. for(int k = 0; k < 500; k++)
  234. if(chatMessages[k] != null) {
  235. int chattype = chattypes[k];
  236. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  237. String s1 = chatNames[k];
  238. byte byte0 = 0;
  239. /*
  240. * Sprite placement while drawing sprites
  241. */
  242. if(s1 != null && s1.startsWith("@cr1@")) {
  243. s1 = s1.substring(5);
  244. byte0 = 1;
  245. } else if(s1 != null && s1.startsWith("@cr2@")) {
  246. s1 = s1.substring(5);
  247. byte0 = 2;
  248. } else if(s1 != null && s1.startsWith("@cr3@")) {
  249. s1 = s1.substring(5);
  250. byte0 = 3;
  251. } else if(s1 != null && s1.startsWith("@cr4@")) {
  252. s1 = s1.substring(5);
  253. byte0 = 4;
  254. } else if(s1 != null && s1.startsWith("@cr5@")) {
  255. s1 = s1.substring(5);
  256. byte0 = 5;
  257. } else if(s1 != null && s1.startsWith("@cr6@")) {
  258. s1 = s1.substring(5);
  259. byte0 = 6;
  260. } else if(s1 != null && s1.startsWith("@cr7@")) {
  261. s1 = s1.substring(5);
  262. byte0 = 7;
  263. } else if(s1 != null && s1.startsWith("@cr8@")) {
  264. s1 = s1.substring(5);
  265. byte0 = 8;
  266. } else if(s1 != null && s1.startsWith("@cr9@")) {
  267. s1 = s1.substring(5);
  268. byte0 = 9;
  269. }
  270. if(chattype == 0) {
  271. if (chattypeView == 5 || chattypeView == 0) {
  272. if(yPos > 0 && yPos < 210)
  273. textDrawingArea.method389(false, 11, 0, chatMessages[k], yPos);//chat color enabled
  274. j++;
  275. j77++;
  276. }
  277. }
  278. if((chattype == 1 || chattype == 2) && (chattype == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  279. if (chattypeView == 1 || chattypeView == 0) {
  280. if(yPos > 0 && yPos < 210) {
  281. int xPos = 11;
  282. if(byte0 == 1) {
  283. modIcons[0].drawBackground(xPos + 1, yPos - 12);
  284. xPos += 14;
  285. } else if(byte0 == 2) {
  286. modIcons[1].drawBackground(xPos + 1, yPos - 12);
  287. xPos += 14;
  288. } else if(byte0 == 3) {
  289. modIcons[2].drawBackground(xPos + 1, yPos - 12);
  290. xPos += 14;
  291. } else if(byte0 == 4) {
  292. modIcons[3].drawBackground(xPos + 1, yPos - 12);
  293. xPos += 14;
  294. } else if(byte0 == 5) {
  295. modIcons[4].drawBackground(xPos + 1, yPos - 12);
  296. xPos += 14;
  297. } else if(byte0 == 6) {
  298. modIcons[5].drawBackground(xPos + 1, yPos - 12);
  299. xPos += 14;
  300. } else if(byte0 == 7) {
  301. modIcons[6].drawBackground(xPos + 1, yPos - 12);
  302. xPos += 14;
  303. } else if(byte0 == 8) {
  304. modIcons[7].drawBackground(xPos + 1, yPos - 12);
  305. xPos += 14;
  306. } else if(byte0 == 9) {
  307. modIcons[8].drawBackground(xPos + 1, yPos - 12);
  308. xPos += 14;
  309. }
  310. textDrawingArea.method385(0, s1 + ":", yPos, xPos);
  311. xPos += textDrawingArea.getTextWidth(s1) + 8;
  312. textDrawingArea.method389(false, xPos, 255, chatMessages[k], yPos);
  313. }
  314. j++;
  315. j77++;
  316. }
  317. }
  318. if((chattype == 3 || chattype == 7) && (splitPrivateChat == 0 || chattypeView == 2) && (chattype == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  319. if (chattypeView == 2 || chattypeView == 0) {
  320. if(yPos > 0 && yPos < 210) {
  321. int k1 = 11;
  322. textDrawingArea.method385(0, "From", yPos, k1);
  323. k1 += textDrawingArea.getTextWidth("From ");
  324. if(byte0 == 1) {
  325. modIcons[0].drawBackground(xPos + 1, yPos - 12);
  326. xPos += 14;
  327. } else if(byte0 == 2) {
  328. modIcons[1].drawBackground(xPos + 1, yPos - 12);
  329. xPos += 14;
  330. } else if(byte0 == 3) {
  331. modIcons[2].drawBackground(xPos + 1, yPos - 12);
  332. xPos += 14;
  333. } else if(byte0 == 4) {
  334. modIcons[3].drawBackground(xPos + 1, yPos - 12);
  335. xPos += 14;
  336. } else if(byte0 == 5) {
  337. modIcons[4].drawBackground(xPos + 1, yPos - 12);
  338. xPos += 14;
  339. } else if(byte0 == 6) {
  340. modIcons[5].drawBackground(xPos + 1, yPos - 12);
  341. xPos += 14;
  342. } else if(byte0 == 7) {
  343. modIcons[6].drawBackground(xPos + 1, yPos - 12);
  344. xPos += 14;
  345. } else if(byte0 == 8) {
  346. modIcons[7].drawBackground(xPos + 1, yPos - 12);
  347. xPos += 14;
  348. } else if(byte0 == 9) {
  349. modIcons[8].drawBackground(xPos + 1, yPos - 12);
  350. xPos += 14;
  351. }
  352. textDrawingArea.method385(0, s1 + ":", yPos, k1);
  353. k1 += textDrawingArea.getTextWidth(s1) + 8;
  354. textDrawingArea.method385(0x800000, chatMessages[k], yPos, k1);
  355. }
  356. j++;
  357. j77++;
  358. }
  359. }
  360. if(chattype == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  361. if (chattypeView == 3 || chattypeView == 0) {
  362. if(yPos > 0 && yPos < 210)
  363. textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], yPos, 11);
  364. j++;
  365. j77++;
  366. }
  367. }
  368. if(chattype == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  369. if (chattypeView == 2 || chattypeView == 0) {
  370. if(yPos > 0 && yPos < 210)
  371. textDrawingArea.method385(0x800000, chatMessages[k], yPos, 11);
  372. j++;
  373. j77++;
  374. }
  375. }
  376. if(chattype == 6 && (splitPrivateChat == 0 || chattypeView == 2) && privateChatMode < 2) {
  377. if (chattypeView == 2 || chattypeView == 0) {
  378. if(yPos > 0 && yPos < 210) {
  379. textDrawingArea.method385(0, "To " + s1 + ":", yPos, 11);
  380. textDrawingArea.method385(0x800000, chatMessages[k], yPos, 15 + textDrawingArea.getTextWidth("To :" + s1));
  381. }
  382. j++;
  383. j77++;
  384. }
  385. }
  386. if(chattype == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  387. if (chattypeView == 3 || chattypeView == 0) {
  388. if(yPos > 0 && yPos < 210)
  389. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  390. j++;
  391. j77++;
  392. }
  393. if(chattype == 11 && (clanChatMode == 0)) {
  394. if (chattypeView == 11) {
  395. if(yPos > 0 && yPos < 210)
  396. textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  397. j++;
  398. j77++;
  399. }
  400. if(chattype == 12) {
  401. if(yPos > 0 && yPos < 110)
  402. textDrawingArea.method385(0x7e3200, chatMessages[k] + " @blu@" + s1, yPos, 11);
  403. j++;
  404. }
  405. }
  406. }
  407. if(chattype == 16) {
  408. int j2 = 40;
  409. int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  410. if(chattypeView == 11 || chattypeView == 0) {
  411. if(yPos > 3 && yPos < 130)
  412. switch(chatRights[k]) {
  413. case 1:
  414. j2 += clanNameWidth;
  415. modIcons[0].drawBackground(j2 - 18, yPos - 12);
  416. j2 += 14;
  417. break;
  418.  
  419. case 2:
  420. j2 += clanNameWidth;
  421. modIcons[1].drawBackground(j2 - 18, yPos - 12);
  422. j2 += 14;
  423. break;
  424.  
  425. case 3:
  426. j2 += clanNameWidth;
  427. modIcons[2].drawBackground(j2 - 18, yPos - 12);
  428. j2 += 14;
  429. break;
  430.  
  431. case 4:
  432. j2 += clanNameWidth;
  433. modIcons[3].drawBackground(j2 - 18, yPos - 12);
  434. j2 += 14;
  435. break;
  436.  
  437. case 5:
  438. j2 += clanNameWidth;
  439. modIcons[4].drawBackground(j2 - 18, yPos - 12);
  440. j2 += 14;
  441. break;
  442.  
  443. case 6:
  444. j2 += clanNameWidth;
  445. modIcons[5].drawBackground(j2 - 18, yPos - 12);
  446. j2 += 14;
  447. break;
  448.  
  449. case 7:
  450. j2 += clanNameWidth;
  451. modIcons[6].drawBackground(j2 - 18, yPos - 12);
  452. j2 += 14;
  453. break;
  454.  
  455. case 8:
  456. j2 += clanNameWidth;
  457. modIcons[7].drawBackground(j2 - 18, yPos - 12);
  458. j2 += 14;
  459. break;
  460.  
  461. case 9:
  462. j2 += clanNameWidth;
  463. modIcons[8].drawBackground(j2 - 18, yPos - 12);
  464. j2 += 14;
  465. break;
  466.  
  467. default:
  468. j2 += clanNameWidth;
  469. break;
  470. }
  471. textDrawingArea.method385(0, "[", yPos, 8);
  472. textDrawingArea.method385(255, ""+clanname+"", yPos, 14);
  473. textDrawingArea.method385(0, "]", yPos, clanNameWidth + 14);
  474.  
  475. textDrawingArea.method385(0, chatNames[k]+":", yPos, j2 - 17); //j2
  476. j2 += textDrawingArea.getTextWidth(chatNames[k]) + 7;
  477. textDrawingArea.method385(0x800000, chatMessages[k], yPos, j2 - 16);//j2
  478. j++;
  479. j77++;
  480. }
  481. }
  482. }
  483. DrawingArea.defaultDrawingAreaSize();
  484. anInt1211 = j * 14 + 7 + 5;
  485. if(anInt1211 < 111)
  486. anInt1211 = 111;
  487. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  488. String s;
  489. if(myPlayer != null && myPlayer.name != null)
  490. s = myPlayer.name;
  491. else
  492. s = TextClass.fixName(myUsername);
  493. textDrawingArea.method385(0, s + ":", 133, 11);
  494. textDrawingArea.drawChatInput(255, 12 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false);
  495. DrawingArea.method339(121, 0x807660, 506, 7);
  496. }
  497. if(menuOpen && menuScreenArea == 2) {
  498. drawMenu();
  499. }
  500. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  501. aRSImageProducer_1165.initDrawingArea();
  502. Texture.anIntArray1472 = anIntArray1182;
  503. }
  504.  
  505. public void init() {
  506. try {
  507. nodeID = 10;
  508. portOff = 0;
  509. setHighMem();
  510. isMembers = true;
  511. signlink.storeid = 32;
  512. signlink.startpriv(InetAddress.getLocalHost());
  513. initClientFrame(505,767);
  514. }
  515. catch (Exception exception) {
  516. return;
  517. }
  518. }
  519.  
  520. public void startRunnable(Runnable runnable, int i) {
  521. if(i > 10)
  522. i = 10;
  523. if(signlink.mainapp != null) {
  524. signlink.startthread(runnable, i);
  525. } else {
  526. super.startRunnable(runnable, i);
  527. }
  528. }
  529.  
  530. public Socket openSocket(int port) throws IOException {
  531. return new Socket(InetAddress.getByName(server), port);
  532. }
  533.  
  534. private void processMenuClick() {
  535. if(activeInterfacetype != 0)
  536. return;
  537. int j = super.clickMode3;
  538. if(spellSelected == 1 && super.saveClickX >= 516 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  539. j = 0;
  540. if(menuOpen) {
  541. if(j != 1) {
  542. int k = super.mouseX;
  543. int j1 = super.mouseY;
  544. if(menuScreenArea == 0) {
  545. k -= 4;
  546. j1 -= 4;
  547. }
  548. if(menuScreenArea == 1) {
  549. k -= 519;
  550. j1 -= 168;
  551. }
  552. if(menuScreenArea == 2) {
  553. k -= 17;
  554. j1 -= 338;
  555. }
  556. if(menuScreenArea == 3) {
  557. k -= 519;
  558. j1 -= 0;
  559. }
  560. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  561. menuOpen = false;
  562. if(menuScreenArea == 1)
  563. needDrawTabArea = true;
  564. if(menuScreenArea == 2)
  565. inputTaken = true;
  566. }
  567. }
  568. if(j == 1) {
  569. int l = menuOffsetX;
  570. int k1 = menuOffsetY;
  571. int i2 = menuWidth;
  572. int k2 = super.saveClickX;
  573. int l2 = super.saveClickY;
  574. if(menuScreenArea == 0) {
  575. k2 -= 4;
  576. l2 -= 4;
  577. }
  578. if(menuScreenArea == 1) {
  579. k2 -= 519;
  580. l2 -= 168;
  581. }
  582. if(menuScreenArea == 2) {
  583. k2 -= 17;
  584. l2 -= 338;
  585. }
  586. if(menuScreenArea == 3) {
  587. k2 -= 519;
  588. l2 -= 0;
  589. }
  590. int i3 = -1;
  591. for(int j3 = 0; j3 < menuActionRow; j3++) {
  592. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  593. if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  594. i3 = j3;
  595. }
  596. System.out.println(i3);
  597. if(i3 != -1)
  598. doAction(i3);
  599. menuOpen = false;
  600. if(menuScreenArea == 1)
  601. needDrawTabArea = true;
  602. if(menuScreenArea == 2) {
  603. inputTaken = true;
  604. }
  605. }
  606. } else {
  607. if(j == 1 && menuActionRow > 0) {
  608. int i1 = menuActionID[menuActionRow - 1];
  609. 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) {
  610. int l1 = menuActionCmd2[menuActionRow - 1];
  611. int j2 = menuActionCmd3[menuActionRow - 1];
  612. RSInterface class9 = RSInterface.interfaceCache[j2];
  613. if(class9.aBoolean259 || class9.aBoolean235) {
  614. aBoolean1242 = false;
  615. anInt989 = 0;
  616. anInt1084 = j2;
  617. anInt1085 = l1;
  618. activeInterfacetype = 2;
  619. anInt1087 = super.saveClickX;
  620. anInt1088 = super.saveClickY;
  621. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  622. activeInterfacetype = 1;
  623. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  624. activeInterfacetype = 3;
  625. return;
  626. }
  627. }
  628. }
  629. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  630. j = 2;
  631. if(j == 1 && menuActionRow > 0)
  632. doAction(menuActionRow - 1);
  633. if(j == 2 && menuActionRow > 0)
  634. determineMenuSize();
  635. }
  636. }
  637.  
  638.  
  639. public static int totalRead = 0;
  640.  
  641. public static String getFileNameWithoutExtension(String fileName) {
  642. File tmpFile = new File(fileName);
  643. tmpFile.getName();
  644. int whereDot = tmpFile.getName().lastIndexOf('.');
  645. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2 ) {
  646. return tmpFile.getName().substring(0, whereDot);
  647. }
  648. return "";
  649. }
  650.  
  651. public void preloadModels() {
  652. File file = new File("./cache/Raw/");
  653. File[] fileArray = file.listFiles();
  654. for(int y = 0; y < fileArray.length; y++) {
  655. String s = fileArray[y].getName();
  656. byte[] buffer = ReadFile("./cache/Raw/"+s);
  657. Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
  658. }
  659. }
  660.  
  661. public void maps() {
  662. for(int MapIndex = 0; MapIndex < 3536; MapIndex++) {
  663. byte[] abyte0 = GetMap(MapIndex);
  664. if(abyte0 != null && abyte0.length > 0) {
  665. decompressors[4].method234(abyte0.length, abyte0, MapIndex);
  666. }
  667. }
  668. }
  669.  
  670. public byte[] GetMap(int Index) {
  671. try {
  672. File Map = new File("./Maps/"+Index+".gz");
  673. byte[] aByte = new byte[(int)Map.length()];
  674. FileInputStream Fis = new FileInputStream(Map);
  675. Fis.read(aByte);
  676. System.out.println(""+Index+" aByte = ["+aByte+"]!");
  677. Fis.close();
  678. return aByte;
  679. } catch(Exception e) {
  680. return null;
  681. }
  682. }
  683.  
  684.  
  685.  
  686. private void saveMidi(boolean flag, byte abyte0[])
  687. {
  688. signlink.midifade = flag ? 1 : 0;
  689. signlink.midisave(abyte0, abyte0.length);
  690. }
  691.  
  692. private void method22()
  693. {
  694. try
  695. {
  696. anInt985 = -1;
  697. aClass19_1056.removeAll();
  698. aClass19_1013.removeAll();
  699. Texture.method366();
  700. unlinkMRUNodes();
  701. worldController.initToNull();
  702. System.gc();
  703. for(int i = 0; i < 4; i++)
  704. aClass11Array1230[i].method210();
  705.  
  706. for(int l = 0; l < 4; l++)
  707. {
  708. for(int k1 = 0; k1 < 104; k1++)
  709. {
  710. for(int j2 = 0; j2 < 104; j2++)
  711. byteGroundArray[l][k1][j2] = 0;
  712.  
  713. }
  714.  
  715. }
  716.  
  717. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  718. int k2 = aByteArrayArray1183.length;
  719. stream.createFrame(0);
  720. if(!aBoolean1159)
  721. {
  722. for(int i3 = 0; i3 < k2; i3++)
  723. {
  724. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  725. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  726. byte abyte0[] = aByteArrayArray1183[i3];
  727. if (FileOperations.FileExists(signlink.findcachedir()+"maps/"+anIntArray1235[i3]+".dat"))
  728. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"maps/"+anIntArray1235[i3]+".dat");
  729. if(abyte0 != null)
  730. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  731. }
  732.  
  733. for(int j4 = 0; j4 < k2; j4++)
  734. {
  735. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  736. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  737. byte abyte2[] = aByteArrayArray1183[j4];
  738. if(abyte2 == null && anInt1070 < 800)
  739. objectManager.method174(k7, 64, 64, l5);
  740. }
  741.  
  742. anInt1097++;
  743. if(anInt1097 > 160)
  744. {
  745. anInt1097 = 0;
  746. stream.createFrame(238);
  747. stream.writeWordBigEndian(96);
  748. }
  749. stream.createFrame(0);
  750. for(int i6 = 0; i6 < k2; i6++)
  751. {
  752. byte abyte1[] = aByteArrayArray1247[i6];
  753. if(abyte1 != null)
  754. {
  755. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  756. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  757. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  758. }
  759. }
  760.  
  761. }
  762. if(aBoolean1159)
  763. {
  764. for(int j3 = 0; j3 < 4; j3++)
  765. {
  766. for(int k4 = 0; k4 < 13; k4++)
  767. {
  768. for(int j6 = 0; j6 < 13; j6++)
  769. {
  770. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  771. if(l7 != -1)
  772. {
  773. int i9 = l7 >> 24 & 3;
  774. int l9 = l7 >> 1 & 3;
  775. int j10 = l7 >> 14 & 0x3ff;
  776. int l10 = l7 >> 3 & 0x7ff;
  777. int j11 = (j10 / 8 << 8) + l10 / 8;
  778. for(int l11 = 0; l11 < anIntArray1234.length; l11++)
  779. {
  780. if(anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  781. continue;
  782. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  783. break;
  784. }
  785.  
  786. }
  787. }
  788.  
  789. }
  790.  
  791. }
  792.  
  793. for(int l4 = 0; l4 < 13; l4++)
  794. {
  795. for(int k6 = 0; k6 < 13; k6++)
  796. {
  797. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  798. if(i8 == -1)
  799. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  800. }
  801.  
  802. }
  803.  
  804. stream.createFrame(0);
  805. for(int l6 = 0; l6 < 4; l6++)
  806. {
  807. for(int j8 = 0; j8 < 13; j8++)
  808. {
  809. for(int j9 = 0; j9 < 13; j9++)
  810. {
  811. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  812. if(i10 != -1)
  813. {
  814. int k10 = i10 >> 24 & 3;
  815. int i11 = i10 >> 1 & 3;
  816. int k11 = i10 >> 14 & 0x3ff;
  817. int i12 = i10 >> 3 & 0x7ff;
  818. int j12 = (k11 / 8 << 8) + i12 / 8;
  819. for(int k12 = 0; k12 < anIntArray1234.length; k12++)
  820. {
  821. if(anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  822. continue;
  823. //objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  824. byte abyte0[] = aByteArrayArray1247[k12];
  825. if (FileOperations.FileExists(signlink.findcachedir()+"maps/"+anIntArray1235[k12]+".dat"))
  826. abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"maps/"+anIntArray1235[k12]+".dat");
  827. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  828. break;
  829. }
  830.  
  831. }
  832. }
  833.  
  834. }
  835.  
  836. }
  837.  
  838. }
  839. stream.createFrame(0);
  840. objectManager.method171(aClass11Array1230, worldController);
  841. aRSImageProducer_1165.initDrawingArea();
  842. stream.createFrame(0);
  843. int k3 = ObjectManager.anInt145;
  844. if(k3 > plane)
  845. k3 = plane;
  846. if(k3 < plane - 1)
  847. k3 = plane - 1;
  848. if(lowMem)
  849. worldController.method275(ObjectManager.anInt145);
  850. else
  851. worldController.method275(0);
  852. for(int i5 = 0; i5 < 104; i5++)
  853. {
  854. for(int i7 = 0; i7 < 104; i7++)
  855. spawnGroundItem(i5, i7);
  856.  
  857. }
  858.  
  859. anInt1051++;
  860. if(anInt1051 > 98)
  861. {
  862. anInt1051 = 0;
  863. stream.createFrame(150);
  864. }
  865. method63();
  866. }
  867. catch(Exception exception) { }
  868. ObjectDef.mruNodes1.unlinkAll();
  869. if(super.gameFrame != null)
  870. {
  871. stream.createFrame(210);
  872. stream.writeDWord(0x3f008edd);
  873. }
  874. System.gc();
  875. Texture.method367();
  876. onDemandFetcher.method566();
  877. int k = (anInt1069 - 6) / 8 - 1;
  878. int j1 = (anInt1069 + 6) / 8 + 1;
  879. int i2 = (anInt1070 - 6) / 8 - 1;
  880. int l2 = (anInt1070 + 6) / 8 + 1;
  881. if(aBoolean1141)
  882. {
  883. k = 49;
  884. j1 = 50;
  885. i2 = 49;
  886. l2 = 50;
  887. }
  888. for(int l3 = k; l3 <= j1; l3++)
  889. {
  890. for(int j5 = i2; j5 <= l2; j5++)
  891. if(l3 == k || l3 == j1 || j5 == i2 || j5 == l2)
  892. {
  893. int j7 = onDemandFetcher.method562(0, j5, l3);
  894. if(j7 != -1)
  895. onDemandFetcher.method560(j7, 3);
  896. int k8 = onDemandFetcher.method562(1, j5, l3);
  897. if(k8 != -1)
  898. onDemandFetcher.method560(k8, 3);
  899. }
  900.  
  901. }
  902.  
  903. }
  904.  
  905. private void unlinkMRUNodes()
  906. {
  907. ObjectDef.mruNodes1.unlinkAll();
  908. ObjectDef.mruNodes2.unlinkAll();
  909. EntityDef.mruNodes.unlinkAll();
  910. ItemDef.mruNodes2.unlinkAll();
  911. ItemDef.mruNodes1.unlinkAll();
  912. Player.mruNodes.unlinkAll();
  913. SpotAnim.aMRUNodes_415.unlinkAll();
  914. }
  915.  
  916. private void method24(int i)
  917. {
  918. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  919. int j = ai.length;
  920. for(int k = 0; k < j; k++)
  921. ai[k] = 0;
  922.  
  923. for(int l = 1; l < 103; l++)
  924. {
  925. int i1 = 24628 + (103 - l) * 512 * 4;
  926. for(int k1 = 1; k1 < 103; k1++)
  927. {
  928. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  929. worldController.method309(ai, i1, i, k1, l);
  930. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  931. worldController.method309(ai, i1, i + 1, k1, l);
  932. i1 += 4;
  933. }
  934.  
  935. }
  936.  
  937. int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  938. int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  939. aClass30_Sub2_Sub1_Sub1_1263.method343();
  940. for(int i2 = 1; i2 < 103; i2++)
  941. {
  942. for(int j2 = 1; j2 < 103; j2++)
  943. {
  944. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  945. method50(i2, j1, j2, l1, i);
  946. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  947. method50(i2, j1, j2, l1, i + 1);
  948. }
  949.  
  950. }
  951.  
  952. aRSImageProducer_1165.initDrawingArea();
  953. anInt1071 = 0;
  954. for(int k2 = 0; k2 < 104; k2++)
  955. {
  956. for(int l2 = 0; l2 < 104; l2++)
  957. {
  958. int i3 = worldController.method303(plane, k2, l2);
  959. if(i3 != 0)
  960. {
  961. i3 = i3 >> 14 & 0x7fff;
  962. int j3 = ObjectDef.forID(i3).anInt746;
  963. if(j3 >= 0)
  964. {
  965. int k3 = k2;
  966. int l3 = l2;
  967. if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  968. {
  969. byte byte0 = 104;
  970. byte byte1 = 104;
  971. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  972. for(int i4 = 0; i4 < 10; i4++)
  973. {
  974. int j4 = (int)(Math.random() * 4D);
  975. if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  976. k3--;
  977. if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  978. k3++;
  979. if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  980. l3--;
  981. if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  982. l3++;
  983. }
  984.  
  985. }
  986. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  987. anIntArray1072[anInt1071] = k3;
  988. anIntArray1073[anInt1071] = l3;
  989. anInt1071++;
  990. }
  991. }
  992. }
  993.  
  994. }
  995.  
  996. }
  997.  
  998. private void spawnGroundItem(int i, int j)
  999. {
  1000. NodeList class19 = groundArray[plane][i][j];
  1001. if(class19 == null)
  1002. {
  1003. worldController.method295(plane, i, j);
  1004. return;
  1005. }
  1006. int k = 0xfa0a1f01;
  1007. Object obj = null;
  1008. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  1009. {
  1010. ItemDef itemDef = ItemDef.forID(item.ID);
  1011. int l = itemDef.value;
  1012. if(itemDef.stackable)
  1013. l *= item.anInt1559 + 1;
  1014. // notifyItemSpawn(item, i + baseX, j + baseY);
  1015.  
  1016. if(l > k)
  1017. {
  1018. k = l;
  1019. obj = item;
  1020. }
  1021. }
  1022.  
  1023. class19.insertTail(((Node) (obj)));
  1024. Object obj1 = null;
  1025. Object obj2 = null;
  1026. for(Item class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetNext())
  1027. {
  1028. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  1029. obj1 = class30_sub2_sub4_sub2_1;
  1030. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  1031. obj2 = class30_sub2_sub4_sub2_1;
  1032. }
  1033.  
  1034. int i1 = i + (j << 7) + 0x60000000;
  1035. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1036. }
  1037.  
  1038. private void method26(boolean flag)
  1039. {
  1040. for(int j = 0; j < npcCount; j++)
  1041. {
  1042. NPC npc = npcArray[npcIndices[j]];
  1043. int k = 0x20000000 + (npcIndices[j] << 14);
  1044. if(npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1045. continue;
  1046. int l = npc.x >> 7;
  1047. int i1 = npc.y >> 7;
  1048. if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1049. continue;
  1050. if(npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  1051. {
  1052. if(anIntArrayArray929[l][i1] == anInt1265)
  1053. continue;
  1054. anIntArrayArray929[l][i1] = anInt1265;
  1055. }
  1056. if(!npc.desc.aBoolean84)
  1057. k += 0x80000000;
  1058. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  1059. }
  1060. }
  1061.  
  1062. private boolean replayWave()
  1063. {
  1064. return signlink.wavereplay();
  1065. }
  1066.  
  1067. private void loadError()
  1068. {
  1069. String s = "ondemand";//was a constant parameter
  1070. System.out.println(s);
  1071. try
  1072. {
  1073. getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1074. }
  1075. catch(Exception exception)
  1076. {
  1077. exception.printStackTrace();
  1078. }
  1079. do
  1080. try
  1081. {
  1082. Thread.sleep(1000L);
  1083. }
  1084. catch(Exception _ex) { }
  1085. while(true);
  1086. }
  1087.  
  1088. public void drawHoverBox(int xPos, int yPos, String text) {
  1089. String[] results = text.split("\n");
  1090. int height = (results.length * 16) + 6;
  1091. int width;
  1092. width = smallText.getTextWidth(results[0]) + 6;
  1093. for(int i = 1; i < results.length; i++)
  1094. if(width <= smallText.getTextWidth(results[i]) + 6)
  1095. width = smallText.getTextWidth(results[i]) + 6;
  1096. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  1097. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  1098. yPos += 14;
  1099. for(int i = 0; i < results.length; i++) {
  1100. smallText.method389(false, xPos + 3, 0, results[i], yPos);
  1101. yPos += 16;
  1102. }
  1103. }
  1104.  
  1105. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
  1106. {
  1107. if(class9.type != 0 || class9.children == null || class9.interfaceShown)
  1108. return;
  1109. if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1110. return;
  1111. int k1 = class9.children.length;
  1112. for(int l1 = 0; l1 < k1; l1++)
  1113. {
  1114. int i2 = class9.childX[l1] + i;
  1115. int j2 = (class9.childY[l1] + l) - j1;
  1116. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1117. i2 += class9_1.anInt263;
  1118. j2 += class9_1.anInt265;
  1119. if((class9_1.hoverType >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1120. if(class9_1.hoverType >= 0)
  1121. anInt886 = class9_1.hoverType;
  1122. else
  1123. anInt886 = class9_1.id;
  1124. if (class9_1.type == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1125. anInt1315 = class9_1.id;
  1126. }
  1127. if (class9_1.type == 9 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1128. anInt1315 = class9_1.id;
  1129. }
  1130. if(class9_1.type == 0)
  1131. {
  1132. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1133. if(class9_1.scrollMax > class9_1.height)
  1134. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1135. } else
  1136. {
  1137. if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1138. {
  1139. boolean flag = false;
  1140. if(class9_1.contentType != 0)
  1141. flag = buildFriendsListMenu(class9_1);
  1142. if(!flag)
  1143. {
  1144. //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1145. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1146. menuActionID[menuActionRow] = 315;
  1147. menuActionCmd3[menuActionRow] = class9_1.id;
  1148. menuActionRow++;
  1149. }
  1150. }
  1151. if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1152. {
  1153. String s = class9_1.selectedActionName;
  1154. if(s.indexOf(" ") != -1)
  1155. s = s.substring(0, s.indexOf(" "));
  1156. if (class9_1.spellName.endsWith("Rush") || class9_1.spellName.endsWith("Burst") || class9_1.spellName.endsWith("Blitz") || class9_1.spellName.endsWith("Barrage") || class9_1.spellName.endsWith("strike") || class9_1.spellName.endsWith("bolt") || class9_1.spellName.equals("Crumble undead") || class9_1.spellName.endsWith("blast") || class9_1.spellName.endsWith("wave") || class9_1.spellName.equals("Claws of Guthix") || class9_1.spellName.equals("Flames of Zamorak") || class9_1.spellName.equals("Magic Dart")) {
  1157. menuActionName[menuActionRow] = "Autocast @gre@" + class9_1.spellName;
  1158. menuActionID[menuActionRow] = 104;
  1159. menuActionCmd3[menuActionRow] = class9_1.id;
  1160. menuActionRow++;
  1161. }
  1162. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1163. menuActionID[menuActionRow] = 626;
  1164. menuActionCmd3[menuActionRow] = class9_1.id;
  1165. menuActionRow++;
  1166. }
  1167. if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1168. {
  1169. menuActionName[menuActionRow] = "Close";
  1170. menuActionID[menuActionRow] = 200;
  1171. menuActionCmd3[menuActionRow] = class9_1.id;
  1172. menuActionRow++;
  1173. }
  1174. if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1175. {
  1176. //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1177. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1178. menuActionID[menuActionRow] = 169;
  1179. menuActionCmd3[menuActionRow] = class9_1.id;
  1180. menuActionRow++;
  1181. if (class9_1.hoverText != null) {
  1182. //drawHoverBox(k, l, class9_1.hoverText);
  1183. //System.out.println("DRAWING INTERFACE: " + class9_1.hoverText);
  1184. }
  1185. }
  1186. if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1187. {
  1188. //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1189. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1190. menuActionID[menuActionRow] = 646;
  1191. menuActionCmd3[menuActionRow] = class9_1.id;
  1192. menuActionRow++;
  1193. }
  1194. if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1195. {
  1196. //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1197. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1198. menuActionID[menuActionRow] = 679;
  1199. menuActionCmd3[menuActionRow] = class9_1.id;
  1200. menuActionRow++;
  1201. }
  1202. if(class9_1.type == 2)
  1203. {
  1204. int k2 = 0;
  1205. for(int l2 = 0; l2 < class9_1.height; l2++)
  1206. {
  1207. for(int i3 = 0; i3 < class9_1.width; i3++)
  1208. {
  1209. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1210. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1211. if(k2 < 20)
  1212. {
  1213. j3 += class9_1.spritesX[k2];
  1214. k3 += class9_1.spritesY[k2];
  1215. }
  1216. if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  1217. {
  1218. mouseInvInterfaceIndex = k2;
  1219. lastActiveInvInterface = class9_1.id;
  1220. if(class9_1.inv[k2] > 0)
  1221. {
  1222. ItemDef itemDef = ItemDef.forID(class9_1.inv[k2] - 1);
  1223. if(itemSelected == 1 && class9_1.isInventoryInterface)
  1224. {
  1225. if(class9_1.id != anInt1284 || k2 != anInt1283)
  1226. {
  1227. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  1228. menuActionID[menuActionRow] = 870;
  1229. menuActionCmd1[menuActionRow] = itemDef.ID;
  1230. menuActionCmd2[menuActionRow] = k2;
  1231. menuActionCmd3[menuActionRow] = class9_1.id;
  1232. menuActionRow++;
  1233. }
  1234. } else
  1235. if(spellSelected == 1 && class9_1.isInventoryInterface)
  1236. {
  1237. if((spellUsableOn & 0x10) == 16)
  1238. {
  1239. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1240. menuActionID[menuActionRow] = 543;
  1241. menuActionCmd1[menuActionRow] = itemDef.ID;
  1242. menuActionCmd2[menuActionRow] = k2;
  1243. menuActionCmd3[menuActionRow] = class9_1.id;
  1244. menuActionRow++;
  1245. }
  1246. } else
  1247. {
  1248. if(class9_1.isInventoryInterface)
  1249. {
  1250. for(int l3 = 4; l3 >= 3; l3--)
  1251. if(itemDef.actions != null && itemDef.actions[l3] != null)
  1252. {
  1253. menuActionName[menuActionRow] = itemDef.actions[l3] + " @lre@" + itemDef.name;
  1254. if(l3 == 3)
  1255. menuActionID[menuActionRow] = 493;
  1256. if(l3 == 4)
  1257. menuActionID[menuActionRow] = 847;
  1258. menuActionCmd1[menuActionRow] = itemDef.ID;
  1259. menuActionCmd2[menuActionRow] = k2;
  1260. menuActionCmd3[menuActionRow] = class9_1.id;
  1261. menuActionRow++;
  1262. } else
  1263. if(l3 == 4)
  1264. {
  1265. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1266. menuActionID[menuActionRow] = 847;
  1267. menuActionCmd1[menuActionRow] = itemDef.ID;
  1268. menuActionCmd2[menuActionRow] = k2;
  1269. menuActionCmd3[menuActionRow] = class9_1.id;
  1270. menuActionRow++;
  1271. }
  1272.  
  1273. }
  1274. if(class9_1.usableItemInterface)
  1275. {
  1276. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1277. menuActionID[menuActionRow] = 447;
  1278. menuActionCmd1[menuActionRow] = itemDef.ID;
  1279. //k2 = inventory spot
  1280. //System.out.println(k2);
  1281. menuActionCmd2[menuActionRow] = k2;
  1282. menuActionCmd3[menuActionRow] = class9_1.id;
  1283. menuActionRow++;
  1284. }
  1285. if(class9_1.isInventoryInterface && itemDef.actions != null)
  1286. {
  1287. for(int i4 = 2; i4 >= 0; i4--)
  1288. if(itemDef.actions[i4] != null)
  1289. {
  1290. menuActionName[menuActionRow] = itemDef.actions[i4] + " @lre@" + itemDef.name;
  1291. if(i4 == 0)
  1292. menuActionID[menuActionRow] = 74;
  1293. if(i4 == 1)
  1294. menuActionID[menuActionRow] = 454;
  1295. if(i4 == 2)
  1296. menuActionID[menuActionRow] = 539;
  1297. menuActionCmd1[menuActionRow] = itemDef.ID;
  1298. menuActionCmd2[menuActionRow] = k2;
  1299. menuActionCmd3[menuActionRow] = class9_1.id;
  1300. menuActionRow++;
  1301. }
  1302.  
  1303. }
  1304. if(class9_1.actions != null)
  1305. {
  1306. for(int j4 = 4; j4 >= 0; j4--)
  1307. if(class9_1.actions[j4] != null)
  1308. {
  1309. menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@" + itemDef.name;
  1310. if(j4 == 0)
  1311. menuActionID[menuActionRow] = 632;
  1312. if(j4 == 1)
  1313. menuActionID[menuActionRow] = 78;
  1314. if(j4 == 2)
  1315. menuActionID[menuActionRow] = 867;
  1316. if(j4 == 3)
  1317. menuActionID[menuActionRow] = 431;
  1318. if(j4 == 4)
  1319. menuActionID[menuActionRow] = 53;
  1320. menuActionCmd1[menuActionRow] = itemDef.ID;
  1321. menuActionCmd2[menuActionRow] = k2;
  1322. menuActionCmd3[menuActionRow] = class9_1.id;
  1323. menuActionRow++;
  1324. }
  1325.  
  1326. }
  1327. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inv[k2] - 1) + "@gre@)";
  1328. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1329. menuActionID[menuActionRow] = 1125;
  1330. menuActionCmd1[menuActionRow] = itemDef.ID;
  1331. menuActionCmd2[menuActionRow] = k2;
  1332. menuActionCmd3[menuActionRow] = class9_1.id;
  1333. menuActionRow++;
  1334. }
  1335. }
  1336. }
  1337. k2++;
  1338. }
  1339.  
  1340. }
  1341.  
  1342. }
  1343. }
  1344. }
  1345.  
  1346. }
  1347.  
  1348. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1349. scrollBar1.drawSprite(i1, l);
  1350. scrollBar2.drawSprite(i1, (l + j) - 16);
  1351. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1352. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1353. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1354. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1355. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1356. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1357. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1358. int k1 = ((j - 32) * j) / j1;
  1359. if(k1 < 8)
  1360. k1 = 8;
  1361. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1362. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1363. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1364. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1365. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1366. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1367. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1368. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1369. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1370. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1371. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1372. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1373. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1374. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1375. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1376. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1377. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1378. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1379. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1380. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1381. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1382. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1383. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1384. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1385. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1386. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1387. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1388. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1389. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1390. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1391. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1392. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1393. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1394. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1395. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1396. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1397. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1398. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1399. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1400. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1401. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1402. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1403. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1404. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1405. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1406. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1407. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1408. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1409. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1410. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1411. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1412. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1413. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1414. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1415. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1416. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1417. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1418. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1419. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1420. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1421. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1422. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1423. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1424. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1425. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1426. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1427. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1428. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1429. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1430. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1431. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1432. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1433. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1434. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1435. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1436. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1437. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1438. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1439. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1440. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1441. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1442. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1443. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1444. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1445. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1446. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1447. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1448. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1449. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1450. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1451. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1452. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1453. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1454. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1455. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1456. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1457. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1458. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1459. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1460. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1461. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1462. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1463. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1464. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1465. }
  1466.  
  1467. private void updateNPCs(Stream stream, int i)
  1468. {
  1469. anInt839 = 0;
  1470. anInt893 = 0;
  1471. method139(stream);
  1472. method46(i, stream);
  1473. method86(stream);
  1474. for(int k = 0; k < anInt839; k++)
  1475. {
  1476. int l = anIntArray840[k];
  1477. if(npcArray[l].anInt1537 != loopCycle)
  1478. {
  1479. npcArray[l].desc = null;
  1480. npcArray[l] = null;
  1481. }
  1482. }
  1483.  
  1484. if(stream.currentOffset != i)
  1485. {
  1486. signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1487. throw new RuntimeException("eek");
  1488. }
  1489. for(int i1 = 0; i1 < npcCount; i1++)
  1490. if(npcArray[npcIndices[i1]] == null)
  1491. {
  1492. signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1493. throw new RuntimeException("eek");
  1494. }
  1495.  
  1496. }
  1497.  
  1498. private int cButtonHPos;
  1499. private int cButtonHCPos;
  1500. private int cButtonCPos;
  1501.  
  1502. private void processChatModeClick() {
  1503. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  1504. cButtonHPos = 0;
  1505. aBoolean1233 = true;
  1506. inputTaken = true;
  1507. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  1508. cButtonHPos = 1;
  1509. aBoolean1233 = true;
  1510. inputTaken = true;
  1511. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  1512. cButtonHPos = 2;
  1513. aBoolean1233 = true;
  1514. inputTaken = true;
  1515. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  1516. cButtonHPos = 3;
  1517. aBoolean1233 = true;
  1518. inputTaken = true;
  1519. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  1520. cButtonHPos = 4;
  1521. aBoolean1233 = true;
  1522. inputTaken = true;
  1523. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  1524. cButtonHPos = 5;
  1525. aBoolean1233 = true;
  1526. inputTaken = true;
  1527. } else if(super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= 482 && super.mouseY <= 503) {
  1528. cButtonHPos = 6;
  1529. aBoolean1233 = true;
  1530. inputTaken = true;
  1531. } else {
  1532. cButtonHPos = -1;
  1533. aBoolean1233 = true;
  1534. inputTaken = true;
  1535. }
  1536. if(super.clickMode3 == 1) {
  1537. if(super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1538. cButtonCPos = 0;
  1539. chattypeView = 0;
  1540. aBoolean1233 = true;
  1541. inputTaken = true;
  1542. } else if(super.saveClickX >= 71 && super.saveClickX <= 127 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1543. cButtonCPos = 1;
  1544. chattypeView = 5;
  1545. aBoolean1233 = true;
  1546. inputTaken = true;
  1547. } else if(super.saveClickX >= 137 && super.saveClickX <= 193 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1548. cButtonCPos = 2;
  1549. chattypeView = 1;
  1550. aBoolean1233 = true;
  1551. inputTaken = true;
  1552. } else if(super.saveClickX >= 203 && super.saveClickX <= 259 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1553. cButtonCPos = 3;
  1554. chattypeView = 2;
  1555. aBoolean1233 = true;
  1556. inputTaken = true;
  1557. } else if(super.saveClickX >= 269 && super.saveClickX <= 325 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1558. cButtonCPos = 4;
  1559. chattypeView = 11;
  1560. aBoolean1233 = true;
  1561. inputTaken = true;
  1562. } else if(super.saveClickX >= 335 && super.saveClickX <= 391 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1563. cButtonCPos = 5;
  1564. chattypeView = 3;
  1565. aBoolean1233 = true;
  1566. inputTaken = true;
  1567. } else if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1568. if(openInterfaceID == -1) {
  1569. clearTopInterfaces();
  1570. reportAbuseInput = "";
  1571. canMute = false;
  1572. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1573. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  1574. continue;
  1575. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1576. break;
  1577. }
  1578. } else {
  1579. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1580. }
  1581. }
  1582. }
  1583. }
  1584.  
  1585. private void method33(int i)
  1586. {
  1587. int j = Varp.cache[i].anInt709;
  1588. if(j == 0)
  1589. return;
  1590. int k = variousSettings[i];
  1591. if(j == 1)
  1592. {
  1593. if(k == 1)
  1594. Texture.method372(0.90000000000000002D);
  1595. if(k == 2)
  1596. Texture.method372(0.80000000000000004D);
  1597. if(k == 3)
  1598. Texture.method372(0.69999999999999996D);
  1599. if(k == 4)
  1600. Texture.method372(0.59999999999999998D);
  1601. ItemDef.mruNodes1.unlinkAll();
  1602. welcomeScreenRaised = true;
  1603. }
  1604. if(j == 3)
  1605. {
  1606. boolean flag1 = musicEnabled;
  1607. if(k == 0)
  1608. {
  1609. adjustVolume(musicEnabled, 0);
  1610. musicEnabled = true;
  1611. }
  1612. if(k == 1)
  1613. {
  1614. adjustVolume(musicEnabled, -400);
  1615. musicEnabled = true;
  1616. }
  1617. if(k == 2)
  1618. {
  1619. adjustVolume(musicEnabled, -800);
  1620. musicEnabled = true;
  1621. }
  1622. if(k == 3)
  1623. {
  1624. adjustVolume(musicEnabled, -1200);
  1625. musicEnabled = true;
  1626. }
  1627. if(k == 4)
  1628. musicEnabled = false;
  1629. if(musicEnabled != flag1 && !lowMem)
  1630. {
  1631. if(musicEnabled)
  1632. {
  1633. nextSong = currentSong;
  1634. songChanging = true;
  1635. onDemandFetcher.method558(2, nextSong);
  1636. } else
  1637. {
  1638. stopMidi();
  1639. }
  1640. prevSong = 0;
  1641. }
  1642. }
  1643. if(j == 4)
  1644. {
  1645. if(k == 0)
  1646. {
  1647. aBoolean848 = true;
  1648. setWaveVolume(0);
  1649. }
  1650. if(k == 1)
  1651. {
  1652. aBoolean848 = true;
  1653. setWaveVolume(-400);
  1654. }
  1655. if(k == 2)
  1656. {
  1657. aBoolean848 = true;
  1658. setWaveVolume(-800);
  1659. }
  1660. if(k == 3)
  1661. {
  1662. aBoolean848 = true;
  1663. setWaveVolume(-1200);
  1664. }
  1665. if(k == 4)
  1666. aBoolean848 = false;
  1667. }
  1668. if(j == 5)
  1669. anInt1253 = k;
  1670. if(j == 6)
  1671. anInt1249 = k;
  1672. if(j == 8)
  1673. {
  1674. splitPrivateChat = k;
  1675. inputTaken = true;
  1676. }
  1677. if(j == 9)
  1678. anInt913 = k;
  1679. }
  1680.  
  1681. private void updateEntities() {
  1682. try{
  1683. int anInt974 = 0;
  1684. for(int j = -1; j < playerCount + npcCount; j++) {
  1685. Object obj;
  1686. if(j == -1)
  1687. obj = myPlayer;
  1688. else
  1689. if(j < playerCount)
  1690. obj = playerArray[playerIndices[j]];
  1691. else
  1692. obj = npcArray[npcIndices[j - playerCount]];
  1693. if(obj == null || !((Entity) (obj)).isVisible())
  1694. continue;
  1695. if(obj instanceof NPC) {
  1696. EntityDef entityDef = ((NPC)obj).desc;
  1697. if(entityDef.childrenIDs != null)
  1698. entityDef = entityDef.method161();
  1699. if(entityDef == null)
  1700. continue;
  1701. }
  1702. if(j < playerCount) {
  1703. int l = 45;
  1704. Player player = (Player)obj;
  1705. if(player.headIcon >= 0) {
  1706. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1707. if(spriteDrawX > -1) {
  1708. if (player.skullIcon < 2) {
  1709. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1710. l += 25;
  1711. }
  1712. if (player.headIcon < 18) {
  1713. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1714. l += 18;
  1715. }
  1716. }
  1717. }
  1718. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  1719. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1720. if(spriteDrawX > -1)
  1721. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1722. }
  1723. } else {
  1724. EntityDef entityDef_1 = ((NPC)obj).desc;
  1725. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  1726. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1727. if(spriteDrawX > -1)
  1728. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  1729. }
  1730. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  1731. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1732. if(spriteDrawX > -1)
  1733. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  1734. }
  1735. }
  1736. if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  1737. {
  1738. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  1739. if(spriteDrawX > -1 && anInt974 < anInt975)
  1740. {
  1741. anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
  1742. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  1743. anIntArray976[anInt974] = spriteDrawX;
  1744. anIntArray977[anInt974] = spriteDrawY;
  1745. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  1746. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  1747. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  1748. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  1749. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  1750. {
  1751. anIntArray978[anInt974] += 10;
  1752. anIntArray977[anInt974] += 5;
  1753. }
  1754. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  1755. anIntArray979[anInt974] = 60;
  1756. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  1757. anIntArray978[anInt974] += 5;
  1758. }
  1759. }
  1760. if(((Entity) (obj)).loopCycleStatus > loopCycle)
  1761. {
  1762. try{
  1763. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1764. if(spriteDrawX > -1)
  1765. {
  1766. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  1767. if(i1 > 30)
  1768. i1 = 30;
  1769. int HpPercent = (((Entity) (obj)).currentHealth * 56) / ((Entity) (obj)).maxHealth;
  1770. if (HpPercent > 56)
  1771. HpPercent = 56;
  1772. if (!newHP) {
  1773. DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  1774. DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  1775. } else {
  1776. HPBarEmpty.drawSprite(spriteDrawX - 28, spriteDrawY - 5);//3
  1777. HPBarFull = new Sprite("./cache/Sprites/Player/HP 0.png", HpPercent, 7);
  1778. HPBarFull.drawSprite(spriteDrawX - 28, spriteDrawY - 5);
  1779. }
  1780. }
  1781. }catch(Exception e){ }
  1782. }
  1783. for(int j1 = 0; j1 < 4; j1++)
  1784. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  1785. {
  1786. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  1787. if(spriteDrawX > -1)
  1788. {
  1789. if(j1 == 1)
  1790. spriteDrawY -= 20;
  1791. if(j1 == 2)
  1792. {
  1793. spriteDrawX -= 15;
  1794. spriteDrawY -= 10;
  1795. }
  1796. if(j1 == 3)
  1797. {
  1798. spriteDrawX += 15;
  1799. spriteDrawY -= 10;
  1800. }
  1801. if(newHits) {
  1802. if ((((Entity) (obj)).hitMarkTypes[j1]) < 3) {
  1803. hitMark[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  1804. } else {
  1805. hitMark[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 20, spriteDrawY - 13);
  1806. }
  1807. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  1808. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  1809. } else {
  1810. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  1811. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  1812. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  1813. }
  1814. }
  1815. }
  1816. }
  1817. for(int k = 0; k < anInt974; k++) {
  1818. int k1 = anIntArray976[k];
  1819. int l1 = anIntArray977[k];
  1820. int j2 = anIntArray979[k];
  1821. int k2 = anIntArray978[k];
  1822. boolean flag = true;
  1823. while(flag)
  1824. {
  1825. flag = false;
  1826. for(int l2 = 0; l2 < k; l2++)
  1827. 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)
  1828. {
  1829. l1 = anIntArray977[l2] - anIntArray978[l2];
  1830. flag = true;
  1831. }
  1832.  
  1833. }
  1834. spriteDrawX = anIntArray976[k];
  1835. spriteDrawY = anIntArray977[k] = l1;
  1836. String s = aStringArray983[k];
  1837. if(anInt1249 == 0)
  1838. {
  1839. int i3 = 0xffff00;
  1840. if(anIntArray980[k] < 6)
  1841. i3 = anIntArray965[anIntArray980[k]];
  1842. if(anIntArray980[k] == 6)
  1843. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  1844. if(anIntArray980[k] == 7)
  1845. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  1846. if(anIntArray980[k] == 8)
  1847. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  1848. if(anIntArray980[k] == 9) {
  1849. int j3 = 150 - anIntArray982[k];
  1850. if(j3 < 50)
  1851. i3 = 0xff0000 + 1280 * j3;
  1852. else
  1853. if(j3 < 100)
  1854. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  1855. else
  1856. if(j3 < 150)
  1857. i3 = 65280 + 5 * (j3 - 100);
  1858. }
  1859. if(anIntArray980[k] == 10) {
  1860. int k3 = 150 - anIntArray982[k];
  1861. if(k3 < 50)
  1862. i3 = 0xff0000 + 5 * k3;
  1863. else
  1864. if(k3 < 100)
  1865. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  1866. else
  1867. if(k3 < 150)
  1868. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  1869. }
  1870. if(anIntArray980[k] == 11) {
  1871. int l3 = 150 - anIntArray982[k];
  1872. if(l3 < 50)
  1873. i3 = 0xffffff - 0x50005 * l3;
  1874. else
  1875. if(l3 < 100)
  1876. i3 = 65280 + 0x50005 * (l3 - 50);
  1877. else
  1878. if(l3 < 150)
  1879. i3 = 0xffffff - 0x50000 * (l3 - 100);
  1880. }
  1881. if(anIntArray981[k] == 0) {
  1882. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1883. chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  1884. }
  1885. if(anIntArray981[k] == 1) {
  1886. chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  1887. chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  1888. }
  1889. if(anIntArray981[k] == 2) {
  1890. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  1891. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  1892. }
  1893. if(anIntArray981[k] == 3) {
  1894. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  1895. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  1896. }
  1897. if(anIntArray981[k] == 4) {
  1898. int i4 = chatTextDrawingArea.method384(s);
  1899. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  1900. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  1901. chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  1902. chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  1903. DrawingArea.defaultDrawingAreaSize();
  1904. }
  1905. if(anIntArray981[k] == 5) {
  1906. int j4 = 150 - anIntArray982[k];
  1907. int l4 = 0;
  1908. if(j4 < 25)
  1909. l4 = j4 - 25;
  1910. else
  1911. if(j4 > 125)
  1912. l4 = j4 - 125;
  1913. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  1914. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  1915. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  1916. DrawingArea.defaultDrawingAreaSize();
  1917. }
  1918. } else {
  1919. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1920. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  1921. }
  1922. }
  1923. } catch(Exception e){ }
  1924. }
  1925.  
  1926. private void delFriend(long l)
  1927. {
  1928. try
  1929. {
  1930. if(l == 0L)
  1931. return;
  1932. for(int i = 0; i < friendsCount; i++)
  1933. {
  1934. if(friendsListAsLongs[i] != l)
  1935. continue;
  1936. friendsCount--;
  1937. needDrawTabArea = true;
  1938. for(int j = i; j < friendsCount; j++)
  1939. {
  1940. friendsList[j] = friendsList[j + 1];
  1941. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  1942. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  1943. }
  1944.  
  1945. stream.createFrame(215);
  1946. stream.writeQWord(l);
  1947. break;
  1948. }
  1949. }
  1950. catch(RuntimeException runtimeexception)
  1951. {
  1952. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  1953. throw new RuntimeException();
  1954. }
  1955. }
  1956.  
  1957. public void drawSideIcons(){
  1958. /* Top sideIcons */
  1959. if(tabInterfaceIDs[0] != -1)//attack
  1960. sideIcons[0].drawSprite(10, 4);
  1961. if(tabInterfaceIDs[1] != -1)//stat
  1962. sideIcons[1].drawSprite(43, 4);
  1963. if(tabInterfaceIDs[2] != -1)//quest
  1964. sideIcons[2].drawSprite(76, 3);
  1965. if(tabInterfaceIDs[3] != -1)//inventory
  1966. sideIcons[3].drawSprite(111, 5);
  1967. if(tabInterfaceIDs[4] != -1)//equipment
  1968. sideIcons[4].drawSprite(140, 1);
  1969. if(tabInterfaceIDs[5] != -1)//prayer
  1970. sideIcons[5].drawSprite(174, 1);
  1971. if(tabInterfaceIDs[6] != -1)//magic
  1972. sideIcons[6].drawSprite(208, 4);
  1973. /* Bottom sideIcons */
  1974. if(tabInterfaceIDs[7] != -1)//clan
  1975. sideIcons[7].drawSprite(11, 303);
  1976. if(tabInterfaceIDs[8] != -1)//friends
  1977. sideIcons[8].drawSprite(46, 306);
  1978. if(tabInterfaceIDs[9] != -1)//ignore
  1979. sideIcons[9].drawSprite(79, 306);
  1980. if(tabInterfaceIDs[10] != -1)//options
  1981. sideIcons[10].drawSprite(113, 302);
  1982. if(tabInterfaceIDs[11] != -1)//options
  1983. sideIcons[11].drawSprite(145, 304);
  1984. if(tabInterfaceIDs[12] != -1)//emotes
  1985. sideIcons[12].drawSprite(181, 302);
  1986. if(tabInterfaceIDs[13] != -1)//music
  1987. sideIcons[13].drawSprite(213, 303);
  1988. }
  1989.  
  1990. public void drawRedStones() {
  1991. if(tabInterfaceIDs[tabID] != -1) {
  1992. switch(tabID) {
  1993. case 0:
  1994. redStones[0].drawSprite(3, 0);
  1995. break;
  1996. case 1:
  1997. redStones[4].drawSprite(41, 0);
  1998. break;
  1999. case 2:
  2000. redStones[4].drawSprite(74, 0);
  2001. break;
  2002. case 3:
  2003. redStones[4].drawSprite(107, 0);
  2004. break;
  2005. case 4:
  2006. redStones[4].drawSprite(140, 0);
  2007. break;
  2008. case 5:
  2009. redStones[4].drawSprite(173, 0);
  2010. break;
  2011. case 6:
  2012. redStones[1].drawSprite(206, 0);
  2013. break;
  2014. case 7:
  2015. redStones[2].drawSprite(3, 298);
  2016. break;
  2017. case 8:
  2018. redStones[4].drawSprite(41, 298);
  2019. break;
  2020. case 9:
  2021. redStones[4].drawSprite(74, 298);
  2022. break;
  2023. case 10:
  2024. redStones[4].drawSprite(107, 298);
  2025. break;
  2026. case 11:
  2027. redStones[4].drawSprite(140, 298);
  2028. break;
  2029. case 12:
  2030. redStones[4].drawSprite(173, 298);
  2031. break;
  2032. case 13:
  2033. redStones[3].drawSprite(206, 298);
  2034. break;
  2035. }
  2036. }
  2037. }
  2038.  
  2039. private void drawTabArea() {
  2040. aRSImageProducer_1163.initDrawingArea();
  2041. Texture.anIntArray1472 = anIntArray1181;
  2042. tabArea.drawSprite(0, 0);
  2043. if(invOverlayInterfaceID == -1) {
  2044. drawRedStones();
  2045. drawSideIcons();
  2046. }
  2047. if(invOverlayInterfaceID != -1)
  2048. drawInterface(0, 28, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2049. else if(tabInterfaceIDs[tabID] != -1)
  2050. drawInterface(0, 28, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2051. if(menuOpen && menuScreenArea == 1)
  2052. drawMenu();
  2053. aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  2054. aRSImageProducer_1165.initDrawingArea();
  2055. Texture.anIntArray1472 = anIntArray1182;
  2056. }
  2057.  
  2058. private void method37(int j) {
  2059. if(!lowMem) {
  2060. if(Texture.anIntArray1480[17] >= j) {
  2061. Background background = Texture.aBackgroundArray1474s[17];
  2062. int k = background.anInt1452 * background.anInt1453 - 1;
  2063. //fire cape apparently?
  2064. int j1 = background.anInt1452 * anInt945 * 2;
  2065. byte abyte0[] = background.aByteArray1450;
  2066. byte abyte3[] = aByteArray912;
  2067. for(int i2 = 0; i2 <= k; i2++)
  2068. abyte3[i2] = abyte0[i2 - j1 & k];
  2069.  
  2070. background.aByteArray1450 = abyte3;
  2071. aByteArray912 = abyte0;
  2072. Texture.method370(17);
  2073. anInt854++;
  2074. if(anInt854 > 1235) {
  2075. anInt854 = 0;
  2076. stream.createFrame(226);
  2077. stream.writeWordBigEndian(0);
  2078. int l2 = stream.currentOffset;
  2079. stream.writeWord(58722);
  2080. stream.writeWordBigEndian(240);
  2081. stream.writeWord((int)(Math.random() * 65536D));
  2082. stream.writeWordBigEndian((int)(Math.random() * 256D));
  2083. if((int)(Math.random() * 2D) == 0)
  2084. stream.writeWord(51825);
  2085. stream.writeWordBigEndian((int)(Math.random() * 256D));
  2086. stream.writeWord((int)(Math.random() * 65536D));
  2087. stream.writeWord(7130);
  2088. stream.writeWord((int)(Math.random() * 65536D));
  2089. stream.writeWord(61657);
  2090. stream.writeBytes(stream.currentOffset - l2);
  2091. }
  2092. }
  2093. if(Texture.anIntArray1480[24] >= j) {
  2094. Background background_1 = Texture.aBackgroundArray1474s[24];
  2095. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  2096. int k1 = background_1.anInt1452 * anInt945 * 2;
  2097. byte abyte1[] = background_1.aByteArray1450;
  2098. byte abyte4[] = aByteArray912;
  2099. for(int j2 = 0; j2 <= l; j2++)
  2100. abyte4[j2] = abyte1[j2 - k1 & l];
  2101.  
  2102. background_1.aByteArray1450 = abyte4;
  2103. aByteArray912 = abyte1;
  2104. Texture.method370(24);
  2105. }
  2106. if(Texture.anIntArray1480[34] >= j) {
  2107. Background background_2 = Texture.aBackgroundArray1474s[34];
  2108. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2109. int l1 = background_2.anInt1452 * anInt945 * 2;
  2110. byte abyte2[] = background_2.aByteArray1450;
  2111. byte abyte5[] = aByteArray912;
  2112. for(int k2 = 0; k2 <= i1; k2++)
  2113. abyte5[k2] = abyte2[k2 - l1 & i1];
  2114.  
  2115. background_2.aByteArray1450 = abyte5;
  2116. aByteArray912 = abyte2;
  2117. Texture.method370(34);
  2118. }
  2119. if(Texture.anIntArray1480[40] >= j)
  2120. {
  2121. Background background_2 = Texture.aBackgroundArray1474s[40];
  2122. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2123. int l1 = background_2.anInt1452 * anInt945 * 2;
  2124. byte abyte2[] = background_2.aByteArray1450;
  2125. byte abyte5[] = aByteArray912;
  2126. for(int k2 = 0; k2 <= i1; k2++)
  2127. abyte5[k2] = abyte2[k2 - l1 & i1];
  2128.  
  2129. background_2.aByteArray1450 = abyte5;
  2130. aByteArray912 = abyte2;
  2131. Texture.method370(40);
  2132. }
  2133. }
  2134. }
  2135.  
  2136. private void method38() {
  2137. for(int i = -1; i < playerCount; i++) {
  2138. int j;
  2139. if(i == -1)
  2140. j = myPlayerIndex;
  2141. else
  2142. j = playerIndices[i];
  2143. Player player = playerArray[j];
  2144. if(player != null && player.textCycle > 0) {
  2145. player.textCycle--;
  2146. if(player.textCycle == 0)
  2147. player.textSpoken = null;
  2148. }
  2149. }
  2150. for(int k = 0; k < npcCount; k++) {
  2151. int l = npcIndices[k];
  2152. NPC npc = npcArray[l];
  2153. if(npc != null && npc.textCycle > 0) {
  2154. npc.textCycle--;
  2155. if(npc.textCycle == 0)
  2156. npc.textSpoken = null;
  2157. }
  2158. }
  2159. }
  2160.  
  2161. private void calcCameraPos() {
  2162. int i = anInt1098 * 128 + 64;
  2163. int j = anInt1099 * 128 + 64;
  2164. int k = method42(plane, j, i) - anInt1100;
  2165. if(xCameraPos < i) {
  2166. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2167. if(xCameraPos > i)
  2168. xCameraPos = i;
  2169. }
  2170. if(xCameraPos > i) {
  2171. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2172. if(xCameraPos < i)
  2173. xCameraPos = i;
  2174. }
  2175. if(zCameraPos < k) {
  2176. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2177. if(zCameraPos > k)
  2178. zCameraPos = k;
  2179. }
  2180. if(zCameraPos > k) {
  2181. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2182. if(zCameraPos < k)
  2183. zCameraPos = k;
  2184. }
  2185. if(yCameraPos < j) {
  2186. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2187. if(yCameraPos > j)
  2188. yCameraPos = j;
  2189. }
  2190. if(yCameraPos > j) {
  2191. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2192. if(yCameraPos < j)
  2193. yCameraPos = j;
  2194. }
  2195. i = anInt995 * 128 + 64;
  2196. j = anInt996 * 128 + 64;
  2197. k = method42(plane, j, i) - anInt997;
  2198. int l = i - xCameraPos;
  2199. int i1 = k - zCameraPos;
  2200. int j1 = j - yCameraPos;
  2201. int k1 = (int)Math.sqrt(l * l + j1 * j1);
  2202. int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2203. int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2204. if(l1 < 128)
  2205. l1 = 128;
  2206. if(l1 > 383)
  2207. l1 = 383;
  2208. if(yCameraCurve < l1) {
  2209. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2210. if(yCameraCurve > l1)
  2211. yCameraCurve = l1;
  2212. }
  2213. if(yCameraCurve > l1) {
  2214. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2215. if(yCameraCurve < l1)
  2216. yCameraCurve = l1;
  2217. }
  2218. int j2 = i2 - xCameraCurve;
  2219. if(j2 > 1024)
  2220. j2 -= 2048;
  2221. if(j2 < -1024)
  2222. j2 += 2048;
  2223. if(j2 > 0) {
  2224. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2225. xCameraCurve &= 0x7ff;
  2226. }
  2227. if(j2 < 0) {
  2228. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2229. xCameraCurve &= 0x7ff;
  2230. }
  2231. int k2 = i2 - xCameraCurve;
  2232. if(k2 > 1024)
  2233. k2 -= 2048;
  2234. if(k2 < -1024)
  2235. k2 += 2048;
  2236. if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2237. xCameraCurve = i2;
  2238. }
  2239.  
  2240. private void drawMenu() {
  2241. int i = menuOffsetX;
  2242. int j = menuOffsetY;
  2243. int k = menuWidth;
  2244. int l = menuHeight + 1;
  2245. int i1 = 0x5d5447;
  2246. //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  2247. //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  2248. DrawingArea.drawPixels(l, j, i, i1, k);
  2249. DrawingArea.drawPixels(16, j + 1, i + 1, 0, k - 2);
  2250. DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
  2251. chatTextDrawingArea.method385(i1, "Choose Option", j + 14, i + 3);
  2252. int j1 = super.mouseX;
  2253. int k1 = super.mouseY;
  2254. if(menuScreenArea == 0) {
  2255. j1 -= 4;
  2256. k1 -= 4;
  2257. }
  2258. if(menuScreenArea == 1) {
  2259. j1 -= 519;
  2260. k1 -= 168;
  2261. }
  2262. if(menuScreenArea == 2) {
  2263. j1 -= 17;
  2264. k1 -= 338;
  2265. }
  2266. if(menuScreenArea == 3) {
  2267. j1 -= 519;
  2268. k1 -= 0;
  2269. }
  2270. for(int l1 = 0; l1 < menuActionRow; l1++) {
  2271. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2272. int j2 = 0xffffff;
  2273. if(j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  2274. j2 = 0xffff00;
  2275. chatTextDrawingArea.method389(true, i + 3, j2, menuActionName[l1], i2);
  2276. }
  2277. }
  2278.  
  2279. private void addFriend(long l) {
  2280. try {
  2281. if(l == 0L)
  2282. return;
  2283. if(friendsCount >= 100 && anInt1046 != 1) {
  2284. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2285. return;
  2286. }
  2287. if(friendsCount >= 200) {
  2288. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2289. return;
  2290. }
  2291. String s = TextClass.fixName(TextClass.nameForLong(l));
  2292. for(int i = 0; i < friendsCount; i++)
  2293. if(friendsListAsLongs[i] == l) {
  2294. pushMessage(s + " is already on your friend list", 0, "");
  2295. return;
  2296. }
  2297. for(int j = 0; j < ignoreCount; j++)
  2298. if(ignoreListAsLongs[j] == l) {
  2299. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  2300. return;
  2301. }
  2302.  
  2303. if(s.equals(myPlayer.name)) {
  2304. return;
  2305. } else {
  2306. friendsList[friendsCount] = s;
  2307. friendsListAsLongs[friendsCount] = l;
  2308. friendsNodeIDs[friendsCount] = 0;
  2309. friendsCount++;
  2310. needDrawTabArea = true;
  2311. stream.createFrame(188);
  2312. stream.writeQWord(l);
  2313. return;
  2314. }
  2315. } catch(RuntimeException runtimeexception) {
  2316. signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
  2317. }
  2318. throw new RuntimeException();
  2319. }
  2320.  
  2321. private int method42(int i, int j, int k) {
  2322. int l = k >> 7;
  2323. int i1 = j >> 7;
  2324. if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2325. return 0;
  2326. int j1 = i;
  2327. if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2328. j1++;
  2329. int k1 = k & 0x7f;
  2330. int l1 = j & 0x7f;
  2331. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2332. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2333. return i2 * (128 - l1) + j2 * l1 >> 7;
  2334. }
  2335.  
  2336. private static String intToKOrMil(int j) {
  2337. if(j < 0x186a0)
  2338. return String.valueOf(j);
  2339. if(j < 0x989680)
  2340. return j / 1000 + "K";
  2341. else
  2342. return j / 0xf4240 + "M";
  2343. }
  2344.  
  2345. private void resetLogout() {
  2346. try {
  2347. if(socketStream != null)
  2348. socketStream.close();
  2349. }
  2350. catch(Exception _ex) { }
  2351. socketStream = null;
  2352. loggedIn = false;
  2353. loginScreenState = 0;
  2354. // myUsername = "";
  2355. // myPassword = "";
  2356. unlinkMRUNodes();
  2357. worldController.initToNull();
  2358. for(int i = 0; i < 4; i++)
  2359. aClass11Array1230[i].method210();
  2360. System.gc();
  2361. stopMidi();
  2362. currentSong = -1;
  2363. nextSong = -1;
  2364. prevSong = 0;
  2365. }
  2366.  
  2367. private void method45() {
  2368. aBoolean1031 = true;
  2369. for(int j = 0; j < 7; j++) {
  2370. anIntArray1065[j] = -1;
  2371. for(int k = 0; k < IDK.length; k++) {
  2372. if(IDK.cache[k].aBoolean662 || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2373. continue;
  2374. anIntArray1065[j] = k;
  2375. break;
  2376. }
  2377. }
  2378. }
  2379.  
  2380. private void method46(int i, Stream stream) {
  2381. while(stream.bitPosition + 21 < i * 8) {
  2382. int k = stream.readBits(14);
  2383. if(k == 16383)
  2384. break;
  2385. if(npcArray[k] == null)
  2386. npcArray[k] = new NPC();
  2387. NPC npc = npcArray[k];
  2388. npcIndices[npcCount++] = k;
  2389. npc.anInt1537 = loopCycle;
  2390. int l = stream.readBits(5);
  2391. if(l > 15)
  2392. l -= 32;
  2393. int i1 = stream.readBits(5);
  2394. if(i1 > 15)
  2395. i1 -= 32;
  2396. int j1 = stream.readBits(1);
  2397. npc.desc = EntityDef.forID(stream.readBits(14));
  2398. int k1 = stream.readBits(1);
  2399. if(k1 == 1)
  2400. anIntArray894[anInt893++] = k;
  2401. npc.anInt1540 = npc.desc.aByte68;
  2402. npc.anInt1504 = npc.desc.anInt79;
  2403. npc.anInt1554 = npc.desc.walkAnim;
  2404. npc.anInt1555 = npc.desc.anInt58;
  2405. npc.anInt1556 = npc.desc.anInt83;
  2406. npc.anInt1557 = npc.desc.anInt55;
  2407. npc.anInt1511 = npc.desc.standAnim;
  2408. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2409. }
  2410. stream.finishBitAccess();
  2411. }
  2412.  
  2413. public void processGameLoop() {
  2414. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  2415. return;
  2416. loopCycle++;
  2417. if(!loggedIn)
  2418. processLoginScreenInput();
  2419. else
  2420. mainGameProcessor();
  2421. processOnDemandQueue();
  2422. }
  2423.  
  2424. private void method47(boolean flag) {
  2425. if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2426. destX = 0;
  2427. int j = playerCount;
  2428. if(flag)
  2429. j = 1;
  2430. for(int l = 0; l < j; l++) {
  2431. Player player;
  2432. int i1;
  2433. if(flag) {
  2434. player = myPlayer;
  2435. i1 = myPlayerIndex << 14;
  2436. } else {
  2437. player = playerArray[playerIndices[l]];
  2438. i1 = playerIndices[l] << 14;
  2439. }
  2440. if(player == null || !player.isVisible())
  2441. continue;
  2442. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  2443. int j1 = player.x >> 7;
  2444. int k1 = player.y >> 7;
  2445. if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2446. continue;
  2447. if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  2448. player.aBoolean1699 = false;
  2449. player.anInt1709 = method42(plane, player.y, player.x);
  2450. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  2451. continue;
  2452. }
  2453. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2454. if(anIntArrayArray929[j1][k1] == anInt1265)
  2455. continue;
  2456. anIntArrayArray929[j1][k1] = anInt1265;
  2457. }
  2458. player.anInt1709 = method42(plane, player.y, player.x);
  2459. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  2460. }
  2461. }
  2462.  
  2463. private boolean promptUserForInput(RSInterface class9) {
  2464. int j = class9.contentType;
  2465. if(anInt900 == 2) {
  2466. if(j == 201) {
  2467. inputTaken = true;
  2468. inputDialogState = 0;
  2469. messagePromptRaised = true;
  2470. promptInput = "";
  2471. friendsListAction = 1;
  2472. aString1121 = "Enter name of friend to add to list";
  2473. }
  2474. if(j == 202) {
  2475. inputTaken = true;
  2476. inputDialogState = 0;
  2477. messagePromptRaised = true;
  2478. promptInput = "";
  2479. friendsListAction = 2;
  2480. aString1121 = "Enter name of friend to delete from list";
  2481. }
  2482. }
  2483. if(j == 205) {
  2484. anInt1011 = 250;
  2485. return true;
  2486. }
  2487. if(j == 501) {
  2488. inputTaken = true;
  2489. inputDialogState = 0;
  2490. messagePromptRaised = true;
  2491. promptInput = "";
  2492. friendsListAction = 4;
  2493. aString1121 = "Enter name of player to add to list";
  2494. }
  2495. if(j == 502) {
  2496. inputTaken = true;
  2497. inputDialogState = 0;
  2498. messagePromptRaised = true;
  2499. promptInput = "";
  2500. friendsListAction = 5;
  2501. aString1121 = "Enter name of player to delete from list";
  2502. }
  2503. if(j == 550) {
  2504. inputTaken = true;
  2505. inputDialogState = 0;
  2506. messagePromptRaised = true;
  2507. promptInput = "";
  2508. friendsListAction = 6;
  2509. aString1121 = "Enter the name of the chat you wish to join";
  2510. }
  2511. if(j >= 300 && j <= 313) {
  2512. int k = (j - 300) / 2;
  2513. int j1 = j & 1;
  2514. int i2 = anIntArray1065[k];
  2515. if(i2 != -1) {
  2516. do {
  2517. if(j1 == 0 && --i2 < 0)
  2518. i2 = IDK.length - 1;
  2519. if(j1 == 1 && ++i2 >= IDK.length)
  2520. i2 = 0;
  2521. } while(IDK.cache[i2].aBoolean662 || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2522. anIntArray1065[k] = i2;
  2523. aBoolean1031 = true;
  2524. }
  2525. }
  2526. if(j >= 314 && j <= 323) {
  2527. int l = (j - 314) / 2;
  2528. int k1 = j & 1;
  2529. int j2 = anIntArray990[l];
  2530. if(k1 == 0 && --j2 < 0)
  2531. j2 = anIntArrayArray1003[l].length - 1;
  2532. if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2533. j2 = 0;
  2534. anIntArray990[l] = j2;
  2535. aBoolean1031 = true;
  2536. }
  2537. if(j == 324 && !aBoolean1047) {
  2538. aBoolean1047 = true;
  2539. method45();
  2540. }
  2541. if(j == 325 && aBoolean1047) {
  2542. aBoolean1047 = false;
  2543. method45();
  2544. }
  2545. if(j == 326) {
  2546. stream.createFrame(101);
  2547. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2548. for(int i1 = 0; i1 < 7; i1++)
  2549. stream.writeWordBigEndian(anIntArray1065[i1]);
  2550.  
  2551. for(int l1 = 0; l1 < 5; l1++)
  2552. stream.writeWordBigEndian(anIntArray990[l1]);
  2553.  
  2554. return true;
  2555. }
  2556. if(j == 613)
  2557. canMute = !canMute;
  2558. if(j >= 601 && j <= 612) {
  2559. clearTopInterfaces();
  2560. if(reportAbuseInput.length() > 0) {
  2561. stream.createFrame(218);
  2562. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2563. stream.writeWordBigEndian(j - 601);
  2564. stream.writeWordBigEndian(canMute ? 1 : 0);
  2565. }
  2566. }
  2567. return false;
  2568. }
  2569.  
  2570. private void method49(Stream stream) {
  2571. for(int j = 0; j < anInt893; j++) {
  2572. int k = anIntArray894[j];
  2573. Player player = playerArray[k];
  2574. int l = stream.readUnsignedByte();
  2575. if((l & 0x40) != 0)
  2576. l += stream.readUnsignedByte() << 8;
  2577. method107(l, k, stream, player);
  2578. }
  2579. }
  2580.  
  2581. private void method50(int i, int k, int l, int i1, int j1) {
  2582. int k1 = worldController.method300(j1, l, i);
  2583. if(k1 != 0) {
  2584. int l1 = worldController.method304(j1, l, i, k1);
  2585. int k2 = l1 >> 6 & 3;
  2586. int i3 = l1 & 0x1f;
  2587. int k3 = k;
  2588. if(k1 > 0)
  2589. k3 = i1;
  2590. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2591. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2592. int i5 = k1 >> 14 & 0x7fff;
  2593. ObjectDef class46_2 = ObjectDef.forID(i5);
  2594. if(class46_2.anInt758 != -1) {
  2595. Background background_2 = mapScenes[class46_2.anInt758];
  2596. if(background_2 != null) {
  2597. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  2598. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  2599. background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  2600. }
  2601. } else {
  2602. if(i3 == 0 || i3 == 2)
  2603. if(k2 == 0) {
  2604. ai[k4] = k3;
  2605. ai[k4 + 512] = k3;
  2606. ai[k4 + 1024] = k3;
  2607. ai[k4 + 1536] = k3;
  2608. } else if(k2 == 1) {
  2609. ai[k4] = k3;
  2610. ai[k4 + 1] = k3;
  2611. ai[k4 + 2] = k3;
  2612. ai[k4 + 3] = k3;
  2613. } else if(k2 == 2) {
  2614. ai[k4 + 3] = k3;
  2615. ai[k4 + 3 + 512] = k3;
  2616. ai[k4 + 3 + 1024] = k3;
  2617. ai[k4 + 3 + 1536] = k3;
  2618. } else if(k2 == 3) {
  2619. ai[k4 + 1536] = k3;
  2620. ai[k4 + 1536 + 1] = k3;
  2621. ai[k4 + 1536 + 2] = k3;
  2622. ai[k4 + 1536 + 3] = k3;
  2623. }
  2624. if(i3 == 3)
  2625. if(k2 == 0)
  2626. ai[k4] = k3;
  2627. else if(k2 == 1)
  2628. ai[k4 + 3] = k3;
  2629. else if(k2 == 2)
  2630. ai[k4 + 3 + 1536] = k3;
  2631. else if(k2 == 3)
  2632. ai[k4 + 1536] = k3;
  2633. if(i3 == 2)
  2634. if(k2 == 3) {
  2635. ai[k4] = k3;
  2636. ai[k4 + 512] = k3;
  2637. ai[k4 + 1024] = k3;
  2638. ai[k4 + 1536] = k3;
  2639. } else if(k2 == 0) {
  2640. ai[k4] = k3;
  2641. ai[k4 + 1] = k3;
  2642. ai[k4 + 2] = k3;
  2643. ai[k4 + 3] = k3;
  2644. } else if(k2 == 1) {
  2645. ai[k4 + 3] = k3;
  2646. ai[k4 + 3 + 512] = k3;
  2647. ai[k4 + 3 + 1024] = k3;
  2648. ai[k4 + 3 + 1536] = k3;
  2649. } else if(k2 == 2) {
  2650. ai[k4 + 1536] = k3;
  2651. ai[k4 + 1536 + 1] = k3;
  2652. ai[k4 + 1536 + 2] = k3;
  2653. ai[k4 + 1536 + 3] = k3;
  2654. }
  2655. }
  2656. }
  2657. k1 = worldController.method302(j1, l, i);
  2658. if(k1 != 0) {
  2659. int i2 = worldController.method304(j1, l, i, k1);
  2660. int l2 = i2 >> 6 & 3;
  2661. int j3 = i2 & 0x1f;
  2662. int l3 = k1 >> 14 & 0x7fff;
  2663. ObjectDef class46_1 = ObjectDef.forID(l3);
  2664. if(class46_1.anInt758 != -1) {
  2665. Background background_1 = mapScenes[class46_1.anInt758];
  2666. if(background_1 != null) {
  2667. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  2668. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  2669. background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  2670. }
  2671. } else if(j3 == 9) {
  2672. int l4 = 0xeeeeee;
  2673. if(k1 > 0)
  2674. l4 = 0xee0000;
  2675. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2676. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2677. if(l2 == 0 || l2 == 2) {
  2678. ai1[l5 + 1536] = l4;
  2679. ai1[l5 + 1024 + 1] = l4;
  2680. ai1[l5 + 512 + 2] = l4;
  2681. ai1[l5 + 3] = l4;
  2682. } else {
  2683. ai1[l5] = l4;
  2684. ai1[l5 + 512 + 1] = l4;
  2685. ai1[l5 + 1024 + 2] = l4;
  2686. ai1[l5 + 1536 + 3] = l4;
  2687. }
  2688. }
  2689. }
  2690. k1 = worldController.method303(j1, l, i);
  2691. if(k1 != 0) {
  2692. int j2 = k1 >> 14 & 0x7fff;
  2693. ObjectDef class46 = ObjectDef.forID(j2);
  2694. if(class46.anInt758 != -1) {
  2695. Background background = mapScenes[class46.anInt758];
  2696. if(background != null) {
  2697. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  2698. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  2699. background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  2700. }
  2701. }
  2702. }
  2703. }
  2704.  
  2705. private void loadTitleScreen() {
  2706. aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  2707. aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  2708. aBackgroundArray1152s = new Background[12];
  2709. int j = 0;
  2710. try {
  2711. j = Integer.parseInt(getParameter("fl_icon"));
  2712. } catch(Exception _ex) {
  2713. }
  2714. if(j == 0) {
  2715. for(int k = 0; k < 12; k++)
  2716. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  2717.  
  2718. } else {
  2719. for(int l = 0; l < 12; l++)
  2720. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  2721.  
  2722. }
  2723. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  2724. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  2725. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  2726.  
  2727. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  2728.  
  2729. anIntArray851 = new int[256];
  2730. for(int k1 = 0; k1 < 64; k1++)
  2731. anIntArray851[k1] = k1 * 0x40000;
  2732.  
  2733. for(int l1 = 0; l1 < 64; l1++)
  2734. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  2735.  
  2736. for(int i2 = 0; i2 < 64; i2++)
  2737. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  2738.  
  2739. for(int j2 = 0; j2 < 64; j2++)
  2740. anIntArray851[j2 + 192] = 0xffffff;
  2741.  
  2742. anIntArray852 = new int[256];
  2743. for(int k2 = 0; k2 < 64; k2++)
  2744. anIntArray852[k2] = k2 * 1024;
  2745.  
  2746. for(int l2 = 0; l2 < 64; l2++)
  2747. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  2748.  
  2749. for(int i3 = 0; i3 < 64; i3++)
  2750. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  2751.  
  2752. for(int j3 = 0; j3 < 64; j3++)
  2753. anIntArray852[j3 + 192] = 0xffffff;
  2754.  
  2755. anIntArray853 = new int[256];
  2756. for(int k3 = 0; k3 < 64; k3++)
  2757. anIntArray853[k3] = k3 * 4;
  2758.  
  2759. for(int l3 = 0; l3 < 64; l3++)
  2760. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  2761.  
  2762. for(int i4 = 0; i4 < 64; i4++)
  2763. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  2764.  
  2765. for(int j4 = 0; j4 < 64; j4++)
  2766. anIntArray853[j4 + 192] = 0xffffff;
  2767.  
  2768. anIntArray850 = new int[256];
  2769. anIntArray1190 = new int[32768];
  2770. anIntArray1191 = new int[32768];
  2771. randomizeBackground(null);
  2772. anIntArray828 = new int[32768];
  2773. anIntArray829 = new int[32768];
  2774. drawLoadingText(10, "Connecting to fileserver");
  2775. if(!aBoolean831) {
  2776. drawFlames = true;
  2777. aBoolean831 = true;
  2778. startRunnable(this, 2);
  2779. }
  2780. }
  2781.  
  2782. private static void setHighMem() {
  2783. WorldController.lowMem = false;
  2784. Texture.lowMem = false;
  2785. lowMem = false;
  2786. ObjectManager.lowMem = false;
  2787. ObjectDef.lowMem = false;
  2788. }
  2789.  
  2790. public static void main(String args[]) {
  2791. try {
  2792. nodeID = 10;
  2793. portOff = 0;
  2794. setHighMem();
  2795. isMembers = true;
  2796. signlink.storeid = 32;
  2797. signlink.startpriv(InetAddress.getLocalHost());
  2798. client client1 = new client();
  2799. client1.createClientFrame(505, 767);
  2800. }
  2801. catch(Exception exception)
  2802. {
  2803. }
  2804. }
  2805.  
  2806. private void loadingStages() {
  2807. if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  2808. aRSImageProducer_1165.initDrawingArea();
  2809. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  2810. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  2811. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  2812. loadingStage = 1;
  2813. aLong824 = System.currentTimeMillis();
  2814. }
  2815. if(loadingStage == 1) {
  2816. int j = method54();
  2817. if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  2818. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  2819. aLong824 = System.currentTimeMillis();
  2820. }
  2821. }
  2822. if(loadingStage == 2 && plane != anInt985) {
  2823. anInt985 = plane;
  2824. method24(plane);
  2825. }
  2826. }
  2827.  
  2828. private int method54() {
  2829. for(int i = 0; i < aByteArrayArray1183.length; i++) {
  2830. if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  2831. return -1;
  2832. if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  2833. return -2;
  2834. }
  2835. boolean flag = true;
  2836. for(int j = 0; j < aByteArrayArray1183.length; j++) {
  2837. byte abyte0[] = aByteArrayArray1247[j];
  2838. if(abyte0 != null) {
  2839. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  2840. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  2841. if(aBoolean1159) {
  2842. k = 10;
  2843. l = 10;
  2844. }
  2845. flag &= ObjectManager.method189(k, abyte0, l);
  2846. }
  2847. }
  2848. if(!flag)
  2849. return -3;
  2850. if(aBoolean1080) {
  2851. return -4;
  2852. } else {
  2853. loadingStage = 2;
  2854. ObjectManager.anInt131 = plane;
  2855. method22();
  2856. stream.createFrame(121);
  2857. return 0;
  2858. }
  2859. }
  2860.  
  2861. private void method55()
  2862. {
  2863. 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())
  2864. if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  2865. class30_sub2_sub4_sub4.unlink();
  2866. else
  2867. if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  2868. {
  2869. if(class30_sub2_sub4_sub4.anInt1590 > 0)
  2870. {
  2871. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  2872. if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  2873. 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);
  2874. }
  2875. if(class30_sub2_sub4_sub4.anInt1590 < 0)
  2876. {
  2877. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  2878. Player player;
  2879. if(j == unknownInt10)
  2880. player = myPlayer;
  2881. else
  2882. player = playerArray[j];
  2883. if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  2884. 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);
  2885. }
  2886. class30_sub2_sub4_sub4.method456(anInt945);
  2887. 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);
  2888. }
  2889.  
  2890. }
  2891.  
  2892. public AppletContext getAppletContext()
  2893. {
  2894. if(signlink.mainapp != null)
  2895. return signlink.mainapp.getAppletContext();
  2896. else
  2897. return super.getAppletContext();
  2898. }
  2899.  
  2900. private void drawLogo() {
  2901. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  2902. Sprite sprite = new Sprite(abyte0, this);
  2903. aRSImageProducer_1110.initDrawingArea();
  2904. sprite.method346(0, 0);
  2905. aRSImageProducer_1111.initDrawingArea();
  2906. sprite.method346(-637, 0);
  2907. aRSImageProducer_1107.initDrawingArea();
  2908. sprite.method346(-128, 0);
  2909. aRSImageProducer_1108.initDrawingArea();
  2910. sprite.method346(-202, -371);
  2911. aRSImageProducer_1109.initDrawingArea();
  2912. sprite.method346(-202, -171);
  2913. aRSImageProducer_1112.initDrawingArea();
  2914. sprite.method346(0, -265);
  2915. aRSImageProducer_1113.initDrawingArea();
  2916. sprite.method346(-562, -265);
  2917. aRSImageProducer_1114.initDrawingArea();
  2918. sprite.method346(-128, -171);
  2919. aRSImageProducer_1115.initDrawingArea();
  2920. sprite.method346(-562, -171);
  2921. int ai[] = new int[sprite.myWidth];
  2922. for(int j = 0; j < sprite.myHeight; j++) {
  2923. for(int k = 0; k < sprite.myWidth; k++)
  2924. ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  2925.  
  2926. System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  2927. }
  2928. /*leftSideFlame.initDrawingArea();
  2929. sprite.method346(382, 0);
  2930. rightSideFlame.initDrawingArea();
  2931. sprite.method346(-255, 0);
  2932. aRSImageProducer_1107.initDrawingArea();
  2933. sprite.method346(254, 0);
  2934. aRSImageProducer_1108.initDrawingArea();
  2935. sprite.method346(180, -371);
  2936. loginScreenArea.initDrawingArea();
  2937. sprite.method346(180, -171);
  2938. gameLogo.initDrawingArea();
  2939. sprite.method346(382, -265);
  2940. aRSImageProducer_1113.initDrawingArea();
  2941. sprite.method346(-180, -265);
  2942. aRSImageProducer_1114.initDrawingArea();
  2943. sprite.method346(254, -171);
  2944. aRSImageProducer_1115.initDrawingArea();
  2945. sprite.method346(-180, -171);*/
  2946. sprite = new Sprite(titleStreamLoader, "logo", 0);
  2947. aRSImageProducer_1107.initDrawingArea();
  2948. //sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  2949. sprite = null;
  2950. Object obj = null;
  2951. Object obj1 = null;
  2952. System.gc();
  2953. }
  2954.  
  2955. private void processOnDemandQueue()
  2956. {
  2957. do
  2958. {
  2959. OnDemandData onDemandData;
  2960. do
  2961. {
  2962. onDemandData = onDemandFetcher.getNextNode();
  2963. if(onDemandData == null)
  2964. return;
  2965. if(onDemandData.datatype == 0)
  2966. {
  2967. Model.method460(onDemandData.buffer, onDemandData.ID);
  2968. }
  2969. if(onDemandData.datatype == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  2970. saveMidi(songChanging, onDemandData.buffer);
  2971. if(onDemandData.datatype == 3 && loadingStage == 1)
  2972. {
  2973. for(int i = 0; i < aByteArrayArray1183.length; i++)
  2974. {
  2975. if(anIntArray1235[i] == onDemandData.ID)
  2976. {
  2977. aByteArrayArray1183[i] = onDemandData.buffer;
  2978. if(onDemandData.buffer == null)
  2979. anIntArray1235[i] = -1;
  2980. break;
  2981. }
  2982. if(anIntArray1236[i] != onDemandData.ID)
  2983. continue;
  2984. aByteArrayArray1247[i] = onDemandData.buffer;
  2985. if(onDemandData.buffer == null)
  2986. anIntArray1236[i] = -1;
  2987. break;
  2988. }
  2989.  
  2990. }
  2991. } while(onDemandData.datatype != 93 || !onDemandFetcher.method564(onDemandData.ID));
  2992. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  2993. } while(true);
  2994. }
  2995.  
  2996. private void calcFlamesPosition()
  2997. {
  2998. char c = '\u0100';
  2999. for(int j = 10; j < 117; j++)
  3000. {
  3001. int k = (int)(Math.random() * 100D);
  3002. if(k < 50)
  3003. anIntArray828[j + (c - 2 << 7)] = 255;
  3004. }
  3005. for(int l = 0; l < 100; l++)
  3006. {
  3007. int i1 = (int)(Math.random() * 124D) + 2;
  3008. int k1 = (int)(Math.random() * 128D) + 128;
  3009. int k2 = i1 + (k1 << 7);
  3010. anIntArray828[k2] = 192;
  3011. }
  3012.  
  3013. for(int j1 = 1; j1 < c - 1; j1++)
  3014. {
  3015. for(int l1 = 1; l1 < 127; l1++)
  3016. {
  3017. int l2 = l1 + (j1 << 7);
  3018. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  3019. }
  3020.  
  3021. }
  3022.  
  3023. anInt1275 += 128;
  3024. if(anInt1275 > anIntArray1190.length)
  3025. {
  3026. anInt1275 -= anIntArray1190.length;
  3027. int i2 = (int)(Math.random() * 12D);
  3028. randomizeBackground(aBackgroundArray1152s[i2]);
  3029. }
  3030. for(int j2 = 1; j2 < c - 1; j2++)
  3031. {
  3032. for(int i3 = 1; i3 < 127; i3++)
  3033. {
  3034. int k3 = i3 + (j2 << 7);
  3035. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  3036. if(i4 < 0)
  3037. i4 = 0;
  3038. anIntArray828[k3] = i4;
  3039. }
  3040.  
  3041. }
  3042.  
  3043. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  3044.  
  3045. anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
  3046. if(anInt1040 > 0)
  3047. anInt1040 -= 4;
  3048. if(anInt1041 > 0)
  3049. anInt1041 -= 4;
  3050. if(anInt1040 == 0 && anInt1041 == 0)
  3051. {
  3052. int l3 = (int)(Math.random() * 2000D);
  3053. if(l3 == 0)
  3054. anInt1040 = 1024;
  3055. if(l3 == 1)
  3056. anInt1041 = 1024;
  3057. }
  3058. }
  3059.  
  3060. private boolean saveWave(byte abyte0[], int i)
  3061. {
  3062. return abyte0 == null || signlink.wavesave(abyte0, i);
  3063. }
  3064.  
  3065. private void method60(int i)
  3066. {
  3067. RSInterface class9 = RSInterface.interfaceCache[i];
  3068. for(int j = 0; j < class9.children.length; j++)
  3069. {
  3070. if(class9.children[j] == -1)
  3071. break;
  3072. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  3073. if(class9_1.type == 1)
  3074. method60(class9_1.id);
  3075. class9_1.anInt246 = 0;
  3076. class9_1.anInt208 = 0;
  3077. }
  3078. }
  3079.  
  3080. private void drawHeadIcon()
  3081. {
  3082. if(anInt855 != 2)
  3083. return;
  3084. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  3085. if(spriteDrawX > -1 && loopCycle % 20 < 10)
  3086. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3087. }
  3088.  
  3089. private void mainGameProcessor()
  3090. {
  3091. if(anInt1104 > 1)
  3092. anInt1104--;
  3093. if(anInt1011 > 0)
  3094. anInt1011--;
  3095. for(int j = 0; j < 5; j++)
  3096. if(!parsePacket())
  3097. break;
  3098.  
  3099. if(!loggedIn)
  3100. return;
  3101. synchronized(mouseDetection.syncObject)
  3102. {
  3103. if(flagged)
  3104. {
  3105. if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
  3106. {
  3107. stream.createFrame(45);
  3108. stream.writeWordBigEndian(0);
  3109. int j2 = stream.currentOffset;
  3110. int j3 = 0;
  3111. for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
  3112. {
  3113. if(j2 - stream.currentOffset >= 240)
  3114. break;
  3115. j3++;
  3116. int l4 = mouseDetection.coordsY[j4];
  3117. if(l4 < 0)
  3118. l4 = 0;
  3119. else
  3120. if(l4 > 502)
  3121. l4 = 502;
  3122. int k5 = mouseDetection.coordsX[j4];
  3123. if(k5 < 0)
  3124. k5 = 0;
  3125. else
  3126. if(k5 > 764)
  3127. k5 = 764;
  3128. int i6 = l4 * 765 + k5;
  3129. if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  3130. {
  3131. k5 = -1;
  3132. l4 = -1;
  3133. i6 = 0x7ffff;
  3134. }
  3135. if(k5 == anInt1237 && l4 == anInt1238)
  3136. {
  3137. if(anInt1022 < 2047)
  3138. anInt1022++;
  3139. } else
  3140. {
  3141. int j6 = k5 - anInt1237;
  3142. anInt1237 = k5;
  3143. int k6 = l4 - anInt1238;
  3144. anInt1238 = l4;
  3145. if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  3146. {
  3147. j6 += 32;
  3148. k6 += 32;
  3149. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  3150. anInt1022 = 0;
  3151. } else
  3152. if(anInt1022 < 8)
  3153. {
  3154. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  3155. anInt1022 = 0;
  3156. } else
  3157. {
  3158. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  3159. anInt1022 = 0;
  3160. }
  3161. }
  3162. }
  3163.  
  3164. stream.writeBytes(stream.currentOffset - j2);
  3165. if(j3 >= mouseDetection.coordsIndex)
  3166. {
  3167. mouseDetection.coordsIndex = 0;
  3168. } else
  3169. {
  3170. mouseDetection.coordsIndex -= j3;
  3171. for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  3172. {
  3173. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  3174. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  3175. }
  3176.  
  3177. }
  3178. }
  3179. } else
  3180. {
  3181. mouseDetection.coordsIndex = 0;
  3182. }
  3183. }
  3184. if(super.clickMode3 != 0)
  3185. {
  3186. long l = (super.aLong29 - aLong1220) / 50L;
  3187. if(l > 4095L)
  3188. l = 4095L;
  3189. aLong1220 = super.aLong29;
  3190. int k2 = super.saveClickY;
  3191. if(k2 < 0)
  3192. k2 = 0;
  3193. else
  3194. if(k2 > 502)
  3195. k2 = 502;
  3196. int k3 = super.saveClickX;
  3197. if(k3 < 0)
  3198. k3 = 0;
  3199. else
  3200. if(k3 > 764)
  3201. k3 = 764;
  3202. int k4 = k2 * 765 + k3;
  3203. int j5 = 0;
  3204. if(super.clickMode3 == 2)
  3205. j5 = 1;
  3206. int l5 = (int)l;
  3207. stream.createFrame(241);
  3208. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3209. }
  3210. if(anInt1016 > 0)
  3211. anInt1016--;
  3212. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3213. aBoolean1017 = true;
  3214. if(aBoolean1017 && anInt1016 <= 0)
  3215. {
  3216. anInt1016 = 20;
  3217. aBoolean1017 = false;
  3218. stream.createFrame(86);
  3219. stream.writeWord(anInt1184);
  3220. stream.method432(minimapInt1);
  3221. }
  3222. if(super.awtFocus && !aBoolean954)
  3223. {
  3224. aBoolean954 = true;
  3225. stream.createFrame(3);
  3226. stream.writeWordBigEndian(1);
  3227. }
  3228. if(!super.awtFocus && aBoolean954)
  3229. {
  3230. aBoolean954 = false;
  3231. stream.createFrame(3);
  3232. stream.writeWordBigEndian(0);
  3233. }
  3234. loadingStages();
  3235. method115();
  3236. method90();
  3237. anInt1009++;
  3238. if(anInt1009 > 750)
  3239. dropClient();
  3240. method114();
  3241. method95();
  3242. method38();
  3243. anInt945++;
  3244. if(crosstype != 0)
  3245. {
  3246. crossIndex += 20;
  3247. if(crossIndex >= 400)
  3248. crosstype = 0;
  3249. }
  3250. if(atInventoryInterfacetype != 0)
  3251. {
  3252. atInventoryLoopCycle++;
  3253. if(atInventoryLoopCycle >= 15)
  3254. {
  3255. if(atInventoryInterfacetype == 2)
  3256. needDrawTabArea = true;
  3257. if(atInventoryInterfacetype == 3)
  3258. inputTaken = true;
  3259. atInventoryInterfacetype = 0;
  3260. }
  3261. }
  3262. if(activeInterfacetype != 0)
  3263. {
  3264. anInt989++;
  3265. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  3266. aBoolean1242 = true;
  3267. if(super.clickMode2 == 0)
  3268. {
  3269. if(activeInterfacetype == 2)
  3270. needDrawTabArea = true;
  3271. if(activeInterfacetype == 3)
  3272. inputTaken = true;
  3273. activeInterfacetype = 0;
  3274. if(aBoolean1242 && anInt989 >= 5)
  3275. {
  3276. lastActiveInvInterface = -1;
  3277. processRightClick();
  3278. if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  3279. {
  3280. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3281. int j1 = 0;
  3282. if(anInt913 == 1 && class9.contentType == 206)
  3283. j1 = 1;
  3284. if(class9.inv[mouseInvInterfaceIndex] <= 0)
  3285. j1 = 0;
  3286. if(class9.aBoolean235)
  3287. {
  3288. int l2 = anInt1085;
  3289. int l3 = mouseInvInterfaceIndex;
  3290. class9.inv[l3] = class9.inv[l2];
  3291. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3292. class9.inv[l2] = -1;
  3293. class9.invStackSizes[l2] = 0;
  3294. } else
  3295. if(j1 == 1)
  3296. {
  3297. int i3 = anInt1085;
  3298. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3299. if(i3 > i4)
  3300. {
  3301. class9.swapInventoryItems(i3, i3 - 1);
  3302. i3--;
  3303. } else
  3304. if(i3 < i4)
  3305. {
  3306. class9.swapInventoryItems(i3, i3 + 1);
  3307. i3++;
  3308. }
  3309.  
  3310. } else
  3311. {
  3312. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  3313. }
  3314. stream.createFrame(214);
  3315. stream.method433(anInt1084);
  3316. stream.method424(j1);
  3317. stream.method433(anInt1085);
  3318. stream.method431(mouseInvInterfaceIndex);
  3319. }
  3320. } else
  3321. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  3322. determineMenuSize();
  3323. else
  3324. if(menuActionRow > 0)
  3325. doAction(menuActionRow - 1);
  3326. atInventoryLoopCycle = 10;
  3327. super.clickMode3 = 0;
  3328. }
  3329. }
  3330. if(WorldController.anInt470 != -1)
  3331. {
  3332. int k = WorldController.anInt470;
  3333. int k1 = WorldController.anInt471;
  3334. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  3335. WorldController.anInt470 = -1;
  3336. if(flag)
  3337. {
  3338. crossX = super.saveClickX;
  3339. crossY = super.saveClickY;
  3340. crosstype = 1;
  3341. crossIndex = 0;
  3342. }
  3343. }
  3344. if(super.clickMode3 == 1 && aString844 != null)
  3345. {
  3346. aString844 = null;
  3347. inputTaken = true;
  3348. super.clickMode3 = 0;
  3349. }
  3350. processMenuClick();
  3351. processMainScreenClick();
  3352. processTabClick();
  3353. processChatModeClick();
  3354. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  3355. anInt1213++;
  3356. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3357. if (anInt1501 < 100) {
  3358. anInt1501++;
  3359. if (anInt1501 == 100) {
  3360. if (anInt1500 != 0) {
  3361. inputTaken = true;
  3362. }
  3363. if (anInt1044 != 0) {
  3364. needDrawTabArea = true;
  3365. }
  3366. }
  3367. }
  3368. } else if (anInt1501 > 0) {
  3369. anInt1501--;
  3370. }
  3371. if(loadingStage == 2)
  3372. method108();
  3373. if(loadingStage == 2 && aBoolean1160)
  3374. calcCameraPos();
  3375. for(int i1 = 0; i1 < 5; i1++)
  3376. anIntArray1030[i1]++;
  3377.  
  3378. method73();
  3379. super.idleTime++;
  3380. if(super.idleTime > 4500)
  3381. {
  3382. anInt1011 = 250;
  3383. super.idleTime -= 500;
  3384. stream.createFrame(202);
  3385. }
  3386. anInt988++;
  3387. if(anInt988 > 500)
  3388. {
  3389. anInt988 = 0;
  3390. int l1 = (int)(Math.random() * 8D);
  3391. if((l1 & 1) == 1)
  3392. anInt1278 += anInt1279;
  3393. if((l1 & 2) == 2)
  3394. anInt1131 += anInt1132;
  3395. if((l1 & 4) == 4)
  3396. anInt896 += anInt897;
  3397. }
  3398. if(anInt1278 < -50)
  3399. anInt1279 = 2;
  3400. if(anInt1278 > 50)
  3401. anInt1279 = -2;
  3402. if(anInt1131 < -55)
  3403. anInt1132 = 2;
  3404. if(anInt1131 > 55)
  3405. anInt1132 = -2;
  3406. if(anInt896 < -40)
  3407. anInt897 = 1;
  3408. if(anInt896 > 40)
  3409. anInt897 = -1;
  3410. anInt1254++;
  3411. if(anInt1254 > 500)
  3412. {
  3413. anInt1254 = 0;
  3414. int i2 = (int)(Math.random() * 8D);
  3415. if((i2 & 1) == 1)
  3416. minimapInt2 += anInt1210;
  3417. if((i2 & 2) == 2)
  3418. minimapInt3 += anInt1171;
  3419. }
  3420. if(minimapInt2 < -60)
  3421. anInt1210 = 2;
  3422. if(minimapInt2 > 60)
  3423. anInt1210 = -2;
  3424. if(minimapInt3 < -20)
  3425. anInt1171 = 1;
  3426. if(minimapInt3 > 10)
  3427. anInt1171 = -1;
  3428. anInt1010++;
  3429. if(anInt1010 > 50)
  3430. stream.createFrame(0);
  3431. try
  3432. {
  3433. if(socketStream != null && stream.currentOffset > 0)
  3434. {
  3435. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3436. stream.currentOffset = 0;
  3437. anInt1010 = 0;
  3438. }
  3439. }
  3440. catch(IOException _ex)
  3441. {
  3442. dropClient();
  3443. }
  3444. catch(Exception exception)
  3445. {
  3446. resetLogout();
  3447. }
  3448. }
  3449.  
  3450. private void method63()
  3451. {
  3452. Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  3453. for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  3454. if(class30_sub1.anInt1294 == -1)
  3455. {
  3456. class30_sub1.anInt1302 = 0;
  3457. method89(class30_sub1);
  3458. } else
  3459. {
  3460. class30_sub1.unlink();
  3461. }
  3462.  
  3463. }
  3464.  
  3465. private void resetImageProducers()
  3466. {
  3467. if(aRSImageProducer_1107 != null)
  3468. return;
  3469. super.fullGameScreen = null;
  3470. aRSImageProducer_1166 = null;
  3471. aRSImageProducer_1164 = null;
  3472. aRSImageProducer_1163 = null;
  3473. aRSImageProducer_1165 = null;
  3474. aRSImageProducer_1123 = null;
  3475. aRSImageProducer_1124 = null;
  3476. aRSImageProducer_1125 = null;
  3477. aRSImageProducer_1110 = new RSImageProducer(128, 265, getGameComponent());
  3478. DrawingArea.setAllPixelsToZero();
  3479. aRSImageProducer_1111 = new RSImageProducer(128, 265, getGameComponent());
  3480. DrawingArea.setAllPixelsToZero();
  3481. aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
  3482. DrawingArea.setAllPixelsToZero();
  3483. aRSImageProducer_1108 = new RSImageProducer(360, 132, getGameComponent());
  3484. DrawingArea.setAllPixelsToZero();
  3485. aRSImageProducer_1109 = new RSImageProducer(360, 200, getGameComponent());
  3486. DrawingArea.setAllPixelsToZero();
  3487. aRSImageProducer_1112 = new RSImageProducer(202, 238, getGameComponent());
  3488. DrawingArea.setAllPixelsToZero();
  3489. aRSImageProducer_1113 = new RSImageProducer(203, 238, getGameComponent());
  3490. DrawingArea.setAllPixelsToZero();
  3491. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  3492. DrawingArea.setAllPixelsToZero();
  3493. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  3494. DrawingArea.setAllPixelsToZero();
  3495. if(titleStreamLoader != null)
  3496. {
  3497. drawLogo();
  3498. loadTitleScreen();
  3499. }
  3500. welcomeScreenRaised = true;
  3501. }
  3502.  
  3503. void drawLoadingText(int i, String s)
  3504. {
  3505. anInt1079 = i;
  3506. aString1049 = s;
  3507. resetImageProducers();
  3508. if(titleStreamLoader == null)
  3509. {
  3510. super.drawLoadingText(i, s);
  3511. return;
  3512. }
  3513. aRSImageProducer_1109.initDrawingArea();
  3514. char c = '\u0168';
  3515. char c1 = '\310';
  3516. byte byte1 = 20;
  3517. chatTextDrawingArea.drawText(0xffffff, "HyBriD PvP is loading - please wait...", c1 / 2 - 26 - byte1, c / 2);
  3518. int j = c1 / 2 - 18 - byte1;
  3519. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  3520. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  3521. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  3522. DrawingArea.drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  3523. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  3524. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3525. if(welcomeScreenRaised)
  3526. {
  3527. welcomeScreenRaised = false;
  3528. if(!aBoolean831)
  3529. {
  3530. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3531. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3532. }
  3533. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3534. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3535. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3536. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3537. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3538. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3539. }
  3540. }
  3541.  
  3542. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag,
  3543. int j1)
  3544. {
  3545. int anInt992;
  3546. if(aBoolean972)
  3547. anInt992 = 32;
  3548. else
  3549. anInt992 = 0;
  3550. aBoolean972 = false;
  3551. if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  3552. {
  3553. class9.scrollPosition -= anInt1213 * 4;
  3554. if(flag)
  3555. {
  3556. needDrawTabArea = true;
  3557. }
  3558. } else
  3559. if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  3560. {
  3561. class9.scrollPosition += anInt1213 * 4;
  3562. if(flag)
  3563. {
  3564. needDrawTabArea = true;
  3565. }
  3566. } else
  3567. if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  3568. {
  3569. int l1 = ((j - 32) * j) / j1;
  3570. if(l1 < 8)
  3571. l1 = 8;
  3572. int i2 = l - i1 - 16 - l1 / 2;
  3573. int j2 = j - 32 - l1;
  3574. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3575. if(flag)
  3576. needDrawTabArea = true;
  3577. aBoolean972 = true;
  3578. }
  3579. }
  3580.  
  3581. private boolean method66(int i, int j, int k)
  3582. {
  3583. int i1 = i >> 14 & 0x7fff;
  3584. int j1 = worldController.method304(plane, k, j, i);
  3585. if(j1 == -1)
  3586. return false;
  3587. int k1 = j1 & 0x1f;
  3588. int l1 = j1 >> 6 & 3;
  3589. if(k1 == 10 || k1 == 11 || k1 == 22)
  3590. {
  3591. ObjectDef class46 = ObjectDef.forID(i1);
  3592. int i2;
  3593. int j2;
  3594. if(l1 == 0 || l1 == 2)
  3595. {
  3596. i2 = class46.anInt744;
  3597. j2 = class46.anInt761;
  3598. } else
  3599. {
  3600. i2 = class46.anInt761;
  3601. j2 = class46.anInt744;
  3602. }
  3603. int k2 = class46.anInt768;
  3604. if(l1 != 0)
  3605. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3606. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3607. } else
  3608. {
  3609. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3610. }
  3611. crossX = super.saveClickX;
  3612. crossY = super.saveClickY;
  3613. crosstype = 2;
  3614. crossIndex = 0;
  3615. return true;
  3616. }
  3617.  
  3618. private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k)
  3619. {
  3620. byte abyte0[] = null;
  3621. int l = 5;
  3622. try
  3623. {
  3624. if(decompressors[0] != null)
  3625. abyte0 = decompressors[0].decompress(i);
  3626. }
  3627. catch(Exception _ex) { }
  3628. if(abyte0 != null)
  3629. {
  3630. // aCRC32_930.reset();
  3631. // aCRC32_930.update(abyte0);
  3632. // int i1 = (int)aCRC32_930.getValue();
  3633. // if(i1 != j)
  3634. }
  3635. if(abyte0 != null)
  3636. {
  3637. StreamLoader streamLoader = new StreamLoader(abyte0);
  3638. return streamLoader;
  3639. }
  3640. int j1 = 0;
  3641. while(abyte0 == null)
  3642. {
  3643. String s2 = "Unknown error";
  3644. drawLoadingText(k, "Requesting " + s);
  3645. Object obj = null;
  3646. try
  3647. {
  3648. int k1 = 0;
  3649. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3650. byte abyte1[] = new byte[6];
  3651. datainputstream.readFully(abyte1, 0, 6);
  3652. Stream stream = new Stream(abyte1);
  3653. stream.currentOffset = 3;
  3654. int i2 = stream.read3Bytes() + 6;
  3655. int j2 = 6;
  3656. abyte0 = new byte[i2];
  3657. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3658.  
  3659. while(j2 < i2)
  3660. {
  3661. int l2 = i2 - j2;
  3662. if(l2 > 1000)
  3663. l2 = 1000;
  3664. int j3 = datainputstream.read(abyte0, j2, l2);
  3665. if(j3 < 0)
  3666. {
  3667. s2 = "Length error: " + j2 + "/" + i2;
  3668. throw new IOException("EOF");
  3669. }
  3670. j2 += j3;
  3671. int k3 = (j2 * 100) / i2;
  3672. if(k3 != k1)
  3673. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3674. k1 = k3;
  3675. }
  3676. datainputstream.close();
  3677. try
  3678. {
  3679. if(decompressors[0] != null)
  3680. decompressors[0].method234(abyte0.length, abyte0, i);
  3681. }
  3682. catch(Exception _ex)
  3683. {
  3684. decompressors[0] = null;
  3685. }
  3686. /* if(abyte0 != null)
  3687. {
  3688. aCRC32_930.reset();
  3689. aCRC32_930.update(abyte0);
  3690. int i3 = (int)aCRC32_930.getValue();
  3691. if(i3 != j)
  3692. {
  3693. abyte0 = null;
  3694. j1++;
  3695. s2 = "Checksum error: " + i3;
  3696. }
  3697. }
  3698. */
  3699. }
  3700. catch(IOException ioexception)
  3701. {
  3702. if(s2.equals("Unknown error"))
  3703. s2 = "Connection error";
  3704. abyte0 = null;
  3705. }
  3706. catch(NullPointerException _ex)
  3707. {
  3708. s2 = "Null error";
  3709. abyte0 = null;
  3710. if(!signlink.reporterror)
  3711. return null;
  3712. }
  3713. catch(ArrayIndexOutOfBoundsException _ex)
  3714. {
  3715. s2 = "Bounds error";
  3716. abyte0 = null;
  3717. if(!signlink.reporterror)
  3718. return null;
  3719. }
  3720. catch(Exception _ex)
  3721. {
  3722. s2 = "Unexpected error";
  3723. abyte0 = null;
  3724. if(!signlink.reporterror)
  3725. return null;
  3726. }
  3727. if(abyte0 == null)
  3728. {
  3729. for(int l1 = l; l1 > 0; l1--)
  3730. {
  3731. if(j1 >= 3)
  3732. {
  3733. drawLoadingText(k, "Game updated - please reload page");
  3734. l1 = 10;
  3735. } else
  3736. {
  3737. drawLoadingText(k, s2 + " - Retrying in " + l1);
  3738. }
  3739. try
  3740. {
  3741. Thread.sleep(1000L);
  3742. }
  3743. catch(Exception _ex) { }
  3744. }
  3745.  
  3746. l *= 2;
  3747. if(l > 60)
  3748. l = 60;
  3749. aBoolean872 = !aBoolean872;
  3750. }
  3751.  
  3752. }
  3753.  
  3754. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  3755. return streamLoader_1;
  3756. }
  3757.  
  3758. private void dropClient()
  3759. {
  3760. if(anInt1011 > 0)
  3761. {
  3762. resetLogout();
  3763. return;
  3764. }
  3765. aRSImageProducer_1165.initDrawingArea();
  3766. aTextDrawingArea_1271.drawText(0, "Connection lost", 144, 257);
  3767. aTextDrawingArea_1271.drawText(0xffffff, "Connection lost", 143, 256);
  3768. aTextDrawingArea_1271.drawText(0, "Please wait - attempting to reestablish", 159, 257);
  3769. aTextDrawingArea_1271.drawText(0xffffff, "Please wait - attempting to reestablish", 158, 256);
  3770. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3771. anInt1021 = 0;
  3772. destX = 0;
  3773. RSSocket rsSocket = socketStream;
  3774. loggedIn = false;
  3775. loginFailures = 0;
  3776. login(myUsername, myPassword, true);
  3777. if(!loggedIn)
  3778. resetLogout();
  3779. try
  3780. {
  3781. rsSocket.close();
  3782. }
  3783. catch(Exception _ex)
  3784. {
  3785. }
  3786. }
  3787.  
  3788. private void doAction(int i)
  3789. {
  3790. if(i < 0)
  3791. return;
  3792. if(inputDialogState != 0)
  3793. {
  3794. inputDialogState = 0;
  3795. inputTaken = true;
  3796. }
  3797. int j = menuActionCmd2[i];
  3798. int k = menuActionCmd3[i];
  3799. int l = menuActionID[i];
  3800. int i1 = menuActionCmd1[i];
  3801. if(l >= 2000)
  3802. l -= 2000;
  3803. if(l == 582)
  3804. {
  3805. NPC npc = npcArray[i1];
  3806. if(npc != null)
  3807. {
  3808. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  3809. crossX = super.saveClickX;
  3810. crossY = super.saveClickY;
  3811. crosstype = 2;
  3812. crossIndex = 0;
  3813. stream.createFrame(57);
  3814. stream.method432(anInt1285);
  3815. stream.method432(i1);
  3816. stream.method431(anInt1283);
  3817. stream.method432(anInt1284);
  3818. }
  3819. }
  3820. if(l == 234)
  3821. {
  3822. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3823. if(!flag1)
  3824. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3825. crossX = super.saveClickX;
  3826. crossY = super.saveClickY;
  3827. crosstype = 2;
  3828. crossIndex = 0;
  3829. stream.createFrame(236);
  3830. stream.method431(k + baseY);
  3831. stream.writeWord(i1);
  3832. stream.method431(j + baseX);
  3833. }
  3834. if(l == 62 && method66(i1, k, j))
  3835. {
  3836. stream.createFrame(192);
  3837. stream.writeWord(anInt1284);
  3838. stream.method431(i1 >> 14 & 0x7fff);
  3839. stream.method433(k + baseY);
  3840. stream.method431(anInt1283);
  3841. stream.method433(j + baseX);
  3842. stream.writeWord(anInt1285);
  3843. }
  3844. if(l == 104) {
  3845. RSInterface class9_1 = RSInterface.interfaceCache[k];
  3846. spellID = class9_1.id;
  3847. if(!Autocast) {
  3848. Autocast = true;
  3849. autocastId = class9_1.id;
  3850. stream.createFrame(185);
  3851. stream.writeWord(class9_1.id);
  3852. } else
  3853. if(autocastId == class9_1.id) {
  3854. Autocast = false;
  3855. autocastId = 0;
  3856. stream.createFrame(185);
  3857. stream.writeWord(class9_1.id);
  3858. } else
  3859. if(autocastId != class9_1.id) {
  3860. Autocast = true;
  3861. autocastId = class9_1.id;
  3862. stream.createFrame(185);
  3863. stream.writeWord(class9_1.id);
  3864. }
  3865. }
  3866. if(l == 511)
  3867. {
  3868. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3869. if(!flag2)
  3870. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3871. crossX = super.saveClickX;
  3872. crossY = super.saveClickY;
  3873. crosstype = 2;
  3874. crossIndex = 0;
  3875. stream.createFrame(25);
  3876. stream.method431(anInt1284);
  3877. stream.method432(anInt1285);
  3878. stream.writeWord(i1);
  3879. stream.method432(k + baseY);
  3880. stream.method433(anInt1283);
  3881. stream.writeWord(j + baseX);
  3882. }
  3883. if(l == 74)
  3884. {
  3885. stream.createFrame(122);
  3886. stream.method433(k);
  3887. stream.method432(j);
  3888. stream.method431(i1);
  3889. atInventoryLoopCycle = 0;
  3890. atInventoryInterface = k;
  3891. atInventoryIndex = j;
  3892. atInventoryInterfacetype = 2;
  3893. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3894. atInventoryInterfacetype = 1;
  3895. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3896. atInventoryInterfacetype = 3;
  3897. }
  3898. if (l == 315) {
  3899. RSInterface class9 = RSInterface.interfaceCache[k];
  3900. boolean flag8 = true;
  3901. if (class9.contentType > 0)
  3902. flag8 = promptUserForInput(class9);
  3903. if (flag8) {
  3904.  
  3905. switch(k){
  3906. case 31002:
  3907. chatColorHex = "00FFFF";
  3908. break;
  3909. case 31005:
  3910. chatColorHex = "00AFFF";
  3911. break;
  3912. case 31008:
  3913. chatColorHex = "0000FF";
  3914. break;
  3915. case 31011:
  3916. chatColorHex = "00FF00";
  3917. break;
  3918. case 31014:
  3919. chatColorHex = "9FFF9F";
  3920. break;
  3921. case 31017:
  3922. chatColorHex = "006F00";
  3923. break;
  3924. case 31020:
  3925. chatColorHex = "FF8F8F";
  3926. break;
  3927. case 31023:
  3928. chatColorHex = "FF981F";
  3929. break;
  3930. case 31026:
  3931. chatColorHex = "FF6F00";
  3932. break;
  3933. case 31029:
  3934. chatColorHex = "FFFF00";
  3935. break;
  3936. case 31032:
  3937. chatColorHex = "EF0000";
  3938. break;
  3939. case 31035:
  3940. chatColorHex = "EF00AF";
  3941. break;
  3942. case 31038:
  3943. chatColorHex = "FF4FFF";
  3944. break;
  3945. case 31041:
  3946. chatColorHex = "AF7FFF";
  3947. break;
  3948. case 31044:
  3949. chatColorHex = "000000";
  3950. break;
  3951. case 19144:
  3952. sendFrame248(15106,3213);
  3953. method60(15106);
  3954. inputTaken = true;
  3955. break;
  3956. default:
  3957. stream.createFrame(185);
  3958. stream.writeWord(k);
  3959. break;
  3960.  
  3961. }
  3962. }
  3963. }
  3964. if(l == 561)
  3965. {
  3966. Player player = playerArray[i1];
  3967. if(player != null)
  3968. {
  3969. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  3970. crossX = super.saveClickX;
  3971. crossY = super.saveClickY;
  3972. crosstype = 2;
  3973. crossIndex = 0;
  3974. anInt1188 += i1;
  3975. if(anInt1188 >= 90)
  3976. {
  3977. stream.createFrame(136);
  3978. anInt1188 = 0;
  3979. }
  3980. stream.createFrame(128);
  3981. stream.writeWord(i1);
  3982. }
  3983. }
  3984. if(l == 20)
  3985. {
  3986. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  3987. if(class30_sub2_sub4_sub1_sub1_1 != null)
  3988. {
  3989. 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]);
  3990. crossX = super.saveClickX;
  3991. crossY = super.saveClickY;
  3992. crosstype = 2;
  3993. crossIndex = 0;
  3994. stream.createFrame(155);
  3995. stream.method431(i1);
  3996. }
  3997. }
  3998. if(l == 779)
  3999. {
  4000. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  4001. if(class30_sub2_sub4_sub1_sub2_1 != null)
  4002. {
  4003. 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]);
  4004. crossX = super.saveClickX;
  4005. crossY = super.saveClickY;
  4006. crosstype = 2;
  4007. crossIndex = 0;
  4008. stream.createFrame(153);
  4009. stream.method431(i1);
  4010. }
  4011. }
  4012. if(l == 516)
  4013. if(!menuOpen)
  4014. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  4015. else
  4016. worldController.method312(k - 4, j - 4);
  4017. if(l == 1062)
  4018. {
  4019. anInt924 += baseX;
  4020. if(anInt924 >= 113)
  4021. {
  4022. stream.createFrame(183);
  4023. stream.writeDWordBigEndian(0xe63271);
  4024. anInt924 = 0;
  4025. }
  4026. method66(i1, k, j);
  4027. stream.createFrame(228);
  4028. stream.method432(i1 >> 14 & 0x7fff);
  4029. stream.method432(k + baseY);
  4030. stream.writeWord(j + baseX);
  4031. }
  4032. if(l == 679 && !aBoolean1149)
  4033. {
  4034. stream.createFrame(40);
  4035. stream.writeWord(k);
  4036. aBoolean1149 = true;
  4037. }
  4038. if(l == 431)
  4039. {
  4040. stream.createFrame(129);
  4041. stream.method432(j);
  4042. stream.writeWord(k);
  4043. stream.method432(i1);
  4044. atInventoryLoopCycle = 0;
  4045. atInventoryInterface = k;
  4046. atInventoryIndex = j;
  4047. atInventoryInterfacetype = 2;
  4048. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4049. atInventoryInterfacetype = 1;
  4050. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4051. atInventoryInterfacetype = 3;
  4052. }
  4053. if(l == 337 || l == 42 || l == 792 || l == 322)
  4054. {
  4055. String s = menuActionName[i];
  4056. int k1 = s.indexOf("@whi@");
  4057. if(k1 != -1)
  4058. {
  4059. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  4060. if(l == 337)
  4061. addFriend(l3);
  4062. if(l == 42)
  4063. addIgnore(l3);
  4064. if(l == 792)
  4065. delFriend(l3);
  4066. if(l == 322)
  4067. delIgnore(l3);
  4068. }
  4069. }
  4070. if(l == 53)
  4071. {
  4072. stream.createFrame(135);
  4073. stream.method431(j);
  4074. stream.method432(k);
  4075. stream.method431(i1);
  4076. atInventoryLoopCycle = 0;
  4077. atInventoryInterface = k;
  4078. atInventoryIndex = j;
  4079. atInventoryInterfacetype = 2;
  4080. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4081. atInventoryInterfacetype = 1;
  4082. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4083. atInventoryInterfacetype = 3;
  4084. }
  4085. if(l == 539)
  4086. {
  4087. stream.createFrame(16);
  4088. stream.method432(i1);
  4089. stream.method433(j);
  4090. stream.method433(k);
  4091. atInventoryLoopCycle = 0;
  4092. atInventoryInterface = k;
  4093. atInventoryIndex = j;
  4094. atInventoryInterfacetype = 2;
  4095. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4096. atInventoryInterfacetype = 1;
  4097. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4098. atInventoryInterfacetype = 3;
  4099. }
  4100. if(l == 484 || l == 6)
  4101. {
  4102. String s1 = menuActionName[i];
  4103. int l1 = s1.indexOf("@whi@");
  4104. if(l1 != -1)
  4105. {
  4106. s1 = s1.substring(l1 + 5).trim();
  4107. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  4108. boolean flag9 = false;
  4109. for(int j3 = 0; j3 < playerCount; j3++)
  4110. {
  4111. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  4112. 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))
  4113. continue;
  4114. 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]);
  4115. if(l == 484)
  4116. {
  4117. stream.createFrame(139);
  4118. stream.method431(playerIndices[j3]);
  4119. }
  4120. if(l == 6)
  4121. {
  4122. anInt1188 += i1;
  4123. if(anInt1188 >= 90)
  4124. {
  4125. stream.createFrame(136);
  4126. anInt1188 = 0;
  4127. }
  4128. stream.createFrame(128);
  4129. stream.writeWord(playerIndices[j3]);
  4130. }
  4131. flag9 = true;
  4132. break;
  4133. }
  4134.  
  4135. if(!flag9)
  4136. pushMessage("Unable to find " + s7, 0, "");
  4137. }
  4138. }
  4139. if(l == 870)
  4140. {
  4141. stream.createFrame(53);
  4142. stream.writeWord(j);
  4143. stream.method432(anInt1283);
  4144. stream.method433(i1);
  4145. stream.writeWord(anInt1284);
  4146. stream.method431(anInt1285);
  4147. stream.writeWord(k);
  4148. atInventoryLoopCycle = 0;
  4149. atInventoryInterface = k;
  4150. atInventoryIndex = j;
  4151. atInventoryInterfacetype = 2;
  4152. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4153. atInventoryInterfacetype = 1;
  4154. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4155. atInventoryInterfacetype = 3;
  4156. }
  4157. if(l == 847)
  4158. {
  4159. stream.createFrame(87);
  4160. stream.method432(i1);
  4161. stream.writeWord(k);
  4162. stream.method432(j);
  4163. atInventoryLoopCycle = 0;
  4164. atInventoryInterface = k;
  4165. atInventoryIndex = j;
  4166. atInventoryInterfacetype = 2;
  4167. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4168. atInventoryInterfacetype = 1;
  4169. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4170. atInventoryInterfacetype = 3;
  4171. }
  4172. if(l == 626)
  4173. {
  4174. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4175. spellSelected = 1;
  4176. spellID = class9_1.id;
  4177. anInt1137 = k;
  4178. spellUsableOn = class9_1.spellUsableOn;
  4179. itemSelected = 0;
  4180. needDrawTabArea = true;
  4181. spellID = class9_1.id;
  4182. String s4 = class9_1.selectedActionName;
  4183. if(s4.indexOf(" ") != -1)
  4184. s4 = s4.substring(0, s4.indexOf(" "));
  4185. String s8 = class9_1.selectedActionName;
  4186. if(s8.indexOf(" ") != -1)
  4187. s8 = s8.substring(s8.indexOf(" ") + 1);
  4188. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4189. //class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265, 0xffffff);
  4190. //class9_1.sprite1.drawSprite(200,200);
  4191. //System.out.println("Sprite: " + class9_1.sprite1.toString());
  4192. if(spellUsableOn == 16)
  4193. {
  4194. needDrawTabArea = true;
  4195. tabID = 3;
  4196. tabAreaAltered = true;
  4197. }
  4198. return;
  4199. }
  4200. if(l == 78)
  4201. {
  4202. stream.createFrame(117);
  4203. stream.method433(k);
  4204. stream.method433(i1);
  4205. stream.method431(j);
  4206. atInventoryLoopCycle = 0;
  4207. atInventoryInterface = k;
  4208. atInventoryIndex = j;
  4209. atInventoryInterfacetype = 2;
  4210. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4211. atInventoryInterfacetype = 1;
  4212. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4213. atInventoryInterfacetype = 3;
  4214. }
  4215. if(l == 27)
  4216. {
  4217. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4218. if(class30_sub2_sub4_sub1_sub2_2 != null)
  4219. {
  4220. 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]);
  4221. crossX = super.saveClickX;
  4222. crossY = super.saveClickY;
  4223. crosstype = 2;
  4224. crossIndex = 0;
  4225. anInt986 += i1;
  4226. if(anInt986 >= 54)
  4227. {
  4228. stream.createFrame(189);
  4229. stream.writeWordBigEndian(234);
  4230. anInt986 = 0;
  4231. }
  4232. stream.createFrame(73);
  4233. stream.method431(i1);
  4234. }
  4235. }
  4236. if(l == 213)
  4237. {
  4238. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4239. if(!flag3)
  4240. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4241. crossX = super.saveClickX;
  4242. crossY = super.saveClickY;
  4243. crosstype = 2;
  4244. crossIndex = 0;
  4245. stream.createFrame(79);
  4246. stream.method431(k + baseY);
  4247. stream.writeWord(i1);
  4248. stream.method432(j + baseX);
  4249. }
  4250. if(l == 632)
  4251. {
  4252. stream.createFrame(145);
  4253. stream.method432(k);
  4254. stream.method432(j);
  4255. stream.method432(i1);
  4256. atInventoryLoopCycle = 0;
  4257. atInventoryInterface = k;
  4258. atInventoryIndex = j;
  4259. atInventoryInterfacetype = 2;
  4260. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4261. atInventoryInterfacetype = 1;
  4262. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4263. atInventoryInterfacetype = 3;
  4264. }
  4265. if(l == 1004) {
  4266. if(tabInterfaceIDs[10] != -1) {
  4267. needDrawTabArea = true;
  4268. tabID = 10;
  4269. tabAreaAltered = true;
  4270. }
  4271. }
  4272. if(l == 1003) {
  4273. clanChatMode = 2;
  4274. aBoolean1233 = true;
  4275. inputTaken = true;
  4276. }
  4277. if(l == 1002) {
  4278. clanChatMode = 1;
  4279. aBoolean1233 = true;
  4280. inputTaken = true;
  4281. }
  4282. if(l == 1001) {
  4283. clanChatMode = 0;
  4284. aBoolean1233 = true;
  4285. inputTaken = true;
  4286. }
  4287. if(l == 1000) {
  4288. cButtonCPos = 4;
  4289. chattypeView = 11;
  4290. aBoolean1233 = true;
  4291. inputTaken = true;
  4292. }
  4293. if(l == 999) {
  4294. cButtonCPos = 0;
  4295. chattypeView = 0;
  4296. aBoolean1233 = true;
  4297. inputTaken = true;
  4298. }
  4299. if(l == 998) {
  4300. cButtonCPos = 1;
  4301. chattypeView = 5;
  4302. aBoolean1233 = true;
  4303. inputTaken = true;
  4304. }
  4305. if(l == 997) {
  4306. publicChatMode = 3;
  4307. aBoolean1233 = true;
  4308. inputTaken = true;
  4309. }
  4310. if(l == 996) {
  4311. publicChatMode = 2;
  4312. aBoolean1233 = true;
  4313. inputTaken = true;
  4314. }
  4315. if(l == 995) {
  4316. publicChatMode = 1;
  4317. aBoolean1233 = true;
  4318. inputTaken = true;
  4319. }
  4320. if(l == 994) {
  4321. publicChatMode = 0;
  4322. aBoolean1233 = true;
  4323. inputTaken = true;
  4324. }
  4325. if(l == 993) {
  4326. cButtonCPos = 2;
  4327. chattypeView = 1;
  4328. aBoolean1233 = true;
  4329. inputTaken = true;
  4330. }
  4331. if(l == 992) {
  4332. privateChatMode = 2;
  4333. aBoolean1233 = true;
  4334. inputTaken = true;
  4335. }
  4336. if(l == 991) {
  4337. privateChatMode = 1;
  4338. aBoolean1233 = true;
  4339. inputTaken = true;
  4340. }
  4341. if(l == 990) {
  4342. privateChatMode = 0;
  4343. aBoolean1233 = true;
  4344. inputTaken = true;
  4345. }
  4346. if(l == 989) {
  4347. cButtonCPos = 3;
  4348. chattypeView = 2;
  4349. aBoolean1233 = true;
  4350. inputTaken = true;
  4351. }
  4352. if(l == 987) {
  4353. tradeMode = 2;
  4354. aBoolean1233 = true;
  4355. inputTaken = true;
  4356. }
  4357. if(l == 986) {
  4358. tradeMode = 1;
  4359. aBoolean1233 = true;
  4360. inputTaken = true;
  4361. }
  4362. if(l == 985) {
  4363. tradeMode = 0;
  4364. aBoolean1233 = true;
  4365. inputTaken = true;
  4366. }
  4367. if(l == 984) {
  4368. cButtonCPos = 5;
  4369. chattypeView = 3;
  4370. aBoolean1233 = true;
  4371. inputTaken = true;
  4372. }
  4373. if(l == 983) {
  4374. duelMode = 2;
  4375. aBoolean1233 = true;
  4376. inputTaken = true;
  4377. }
  4378. if(l == 982) {
  4379. duelMode = 1;
  4380. aBoolean1233 = true;
  4381. inputTaken = true;
  4382. }
  4383. if(l == 981) {
  4384. duelMode = 0;
  4385. aBoolean1233 = true;
  4386. inputTaken = true;
  4387. }
  4388. if(l == 980) {
  4389. cButtonCPos = 6;
  4390. chattypeView = 4;
  4391. aBoolean1233 = true;
  4392. inputTaken = true;
  4393. }
  4394. if(l == 493)
  4395. {
  4396. stream.createFrame(75);
  4397. stream.method433(k);
  4398. stream.method431(j);
  4399. stream.method432(i1);
  4400. atInventoryLoopCycle = 0;
  4401. atInventoryInterface = k;
  4402. atInventoryIndex = j;
  4403. atInventoryInterfacetype = 2;
  4404. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4405. atInventoryInterfacetype = 1;
  4406. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4407. atInventoryInterfacetype = 3;
  4408. }
  4409. if(l == 652)
  4410. {
  4411. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4412. if(!flag4)
  4413. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4414. crossX = super.saveClickX;
  4415. crossY = super.saveClickY;
  4416. crosstype = 2;
  4417. crossIndex = 0;
  4418. stream.createFrame(156);
  4419. stream.method432(j + baseX);
  4420. stream.method431(k + baseY);
  4421. stream.method433(i1);
  4422. }
  4423. if(l == 94)
  4424. {
  4425. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4426. if(!flag5)
  4427. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4428. crossX = super.saveClickX;
  4429. crossY = super.saveClickY;
  4430. crosstype = 2;
  4431. crossIndex = 0;
  4432. stream.createFrame(181);
  4433. stream.method431(k + baseY);
  4434. stream.writeWord(i1);
  4435. stream.method431(j + baseX);
  4436. stream.method432(anInt1137);
  4437. }
  4438. if(l == 646)
  4439. {
  4440. stream.createFrame(185);
  4441. stream.writeWord(k);
  4442. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4443. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
  4444. {
  4445. int i2 = class9_2.valueIndexArray[0][1];
  4446. if(variousSettings[i2] != class9_2.requiredValues[0])
  4447. {
  4448. variousSettings[i2] = class9_2.requiredValues[0];
  4449. method33(i2);
  4450. needDrawTabArea = true;
  4451. }
  4452. }
  4453. }
  4454. if(l == 225)
  4455. {
  4456. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4457. if(class30_sub2_sub4_sub1_sub1_2 != null)
  4458. {
  4459. 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]);
  4460. crossX = super.saveClickX;
  4461. crossY = super.saveClickY;
  4462. crosstype = 2;
  4463. crossIndex = 0;
  4464. anInt1226 += i1;
  4465. if(anInt1226 >= 85)
  4466. {
  4467. stream.createFrame(230);
  4468. stream.writeWordBigEndian(239);
  4469. anInt1226 = 0;
  4470. }
  4471. stream.createFrame(17);
  4472. stream.method433(i1);
  4473. }
  4474. }
  4475. if(l == 965)
  4476. {
  4477. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4478. if(class30_sub2_sub4_sub1_sub1_3 != null)
  4479. {
  4480. 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]);
  4481. crossX = super.saveClickX;
  4482. crossY = super.saveClickY;
  4483. crosstype = 2;
  4484. crossIndex = 0;
  4485. anInt1134++;
  4486. if(anInt1134 >= 96)
  4487. {
  4488. stream.createFrame(152);
  4489. stream.writeWordBigEndian(88);
  4490. anInt1134 = 0;
  4491. }
  4492. stream.createFrame(21);
  4493. stream.writeWord(i1);
  4494. }
  4495. }
  4496. if(l == 413)
  4497. {
  4498. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4499. if(class30_sub2_sub4_sub1_sub1_4 != null)
  4500. {
  4501. 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]);
  4502. crossX = super.saveClickX;
  4503. crossY = super.saveClickY;
  4504. crosstype = 2;
  4505. crossIndex = 0;
  4506. stream.createFrame(131);
  4507. stream.method433(i1);
  4508. stream.method432(anInt1137);
  4509. }
  4510. }
  4511. if(l == 200)
  4512. clearTopInterfaces();
  4513. if(l == 1025)
  4514. {
  4515. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4516. if(class30_sub2_sub4_sub1_sub1_5 != null)
  4517. {
  4518. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4519. if(entityDef.childrenIDs != null)
  4520. entityDef = entityDef.method161();
  4521. if(entityDef != null)
  4522. {
  4523. String s9;
  4524. if(entityDef.description != null)
  4525. s9 = new String(entityDef.description);
  4526. else
  4527. s9 = "It's a " + entityDef.name + ".";
  4528. pushMessage(s9, 0, "");
  4529. }
  4530. }
  4531. }
  4532. if(l == 900)
  4533. {
  4534. method66(i1, k, j);
  4535. stream.createFrame(252);
  4536. stream.method433(i1 >> 14 & 0x7fff);
  4537. stream.method431(k + baseY);
  4538. stream.method432(j + baseX);
  4539. }
  4540. if(l == 412)
  4541. {
  4542. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4543. if(class30_sub2_sub4_sub1_sub1_6 != null)
  4544. {
  4545. 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]);
  4546. crossX = super.saveClickX;
  4547. crossY = super.saveClickY;
  4548. crosstype = 2;
  4549. crossIndex = 0;
  4550. stream.createFrame(72);
  4551. stream.method432(i1);
  4552. }
  4553. }
  4554. if(l == 365)
  4555. {
  4556. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4557. if(class30_sub2_sub4_sub1_sub2_3 != null)
  4558. {
  4559. 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]);
  4560. crossX = super.saveClickX;
  4561. crossY = super.saveClickY;
  4562. crosstype = 2;
  4563. crossIndex = 0;
  4564. stream.createFrame(249);
  4565. stream.method432(i1);
  4566. stream.method431(anInt1137);
  4567. }
  4568. }
  4569. if(l == 729)
  4570. {
  4571. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4572. if(class30_sub2_sub4_sub1_sub2_4 != null)
  4573. {
  4574. 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]);
  4575. crossX = super.saveClickX;
  4576. crossY = super.saveClickY;
  4577. crosstype = 2;
  4578. crossIndex = 0;
  4579. stream.createFrame(39);
  4580. stream.method431(i1);
  4581. }
  4582. }
  4583. if(l == 577)
  4584. {
  4585. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4586. if(class30_sub2_sub4_sub1_sub2_5 != null)
  4587. {
  4588. 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]);
  4589. crossX = super.saveClickX;
  4590. crossY = super.saveClickY;
  4591. crosstype = 2;
  4592. crossIndex = 0;
  4593. stream.createFrame(139);
  4594. stream.method431(i1);
  4595. }
  4596. }
  4597. if(l == 956 && method66(i1, k, j))
  4598. {
  4599. stream.createFrame(35);
  4600. stream.method431(j + baseX);
  4601. stream.method432(anInt1137);
  4602. stream.method432(k + baseY);
  4603. stream.method431(i1 >> 14 & 0x7fff);
  4604. }
  4605. if(l == 567)
  4606. {
  4607. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4608. if(!flag6)
  4609. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4610. crossX = super.saveClickX;
  4611. crossY = super.saveClickY;
  4612. crosstype = 2;
  4613. crossIndex = 0;
  4614. stream.createFrame(23);
  4615. stream.method431(k + baseY);
  4616. stream.method431(i1);
  4617. stream.method431(j + baseX);
  4618. }
  4619. if(l == 867)
  4620. {
  4621. if((i1 & 3) == 0)
  4622. anInt1175++;
  4623. if(anInt1175 >= 59)
  4624. {
  4625. stream.createFrame(200);
  4626. stream.writeWord(25501);
  4627. anInt1175 = 0;
  4628. }
  4629. stream.createFrame(43);
  4630. stream.method431(k);
  4631. stream.method432(i1);
  4632. stream.method432(j);
  4633. atInventoryLoopCycle = 0;
  4634. atInventoryInterface = k;
  4635. atInventoryIndex = j;
  4636. atInventoryInterfacetype = 2;
  4637. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4638. atInventoryInterfacetype = 1;
  4639. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4640. atInventoryInterfacetype = 3;
  4641. }
  4642. if(l == 543)
  4643. {
  4644. stream.createFrame(237);
  4645. stream.writeWord(j);
  4646. stream.method432(i1);
  4647. stream.writeWord(k);
  4648. stream.method432(anInt1137);
  4649. atInventoryLoopCycle = 0;
  4650. atInventoryInterface = k;
  4651. atInventoryIndex = j;
  4652. atInventoryInterfacetype = 2;
  4653. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4654. atInventoryInterfacetype = 1;
  4655. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4656. atInventoryInterfacetype = 3;
  4657. }
  4658. if(l == 606)
  4659. {
  4660. String s2 = menuActionName[i];
  4661. int j2 = s2.indexOf("@whi@");
  4662. if(j2 != -1)
  4663. if(openInterfaceID == -1)
  4664. {
  4665. clearTopInterfaces();
  4666. reportAbuseInput = s2.substring(j2 + 5).trim();
  4667. canMute = false;
  4668. for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  4669. {
  4670. if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  4671. continue;
  4672. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4673. break;
  4674. }
  4675.  
  4676. } else
  4677. {
  4678. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  4679. }
  4680. }
  4681. if(l == 491)
  4682. {
  4683. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4684. if(class30_sub2_sub4_sub1_sub2_6 != null)
  4685. {
  4686. 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]);
  4687. crossX = super.saveClickX;
  4688. crossY = super.saveClickY;
  4689. crosstype = 2;
  4690. crossIndex = 0;
  4691. stream.createFrame(14);
  4692. stream.method432(anInt1284);
  4693. stream.writeWord(i1);
  4694. stream.writeWord(anInt1285);
  4695. stream.method431(anInt1283);
  4696. }
  4697. }
  4698. if(l == 639)
  4699. {
  4700. String s3 = menuActionName[i];
  4701. int k2 = s3.indexOf("@whi@");
  4702. if(k2 != -1)
  4703. {
  4704. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4705. int k3 = -1;
  4706. for(int i4 = 0; i4 < friendsCount; i4++)
  4707. {
  4708. if(friendsListAsLongs[i4] != l4)
  4709. continue;
  4710. k3 = i4;
  4711. break;
  4712. }
  4713.  
  4714. if(k3 != -1 && friendsNodeIDs[k3] > 0)
  4715. {
  4716. inputTaken = true;
  4717. inputDialogState = 0;
  4718. messagePromptRaised = true;
  4719. promptInput = "";
  4720. friendsListAction = 3;
  4721. aLong953 = friendsListAsLongs[k3];
  4722. aString1121 = "Enter message to send to " + friendsList[k3];
  4723. }
  4724. }
  4725. }
  4726. if(l == 454)
  4727. {
  4728. stream.createFrame(41);
  4729. stream.writeWord(i1);
  4730. stream.method432(j);
  4731. stream.method432(k);
  4732. atInventoryLoopCycle = 0;
  4733. atInventoryInterface = k;
  4734. atInventoryIndex = j;
  4735. atInventoryInterfacetype = 2;
  4736. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4737. atInventoryInterfacetype = 1;
  4738. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4739. atInventoryInterfacetype = 3;
  4740. }
  4741. if(l == 478)
  4742. {
  4743. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4744. if(class30_sub2_sub4_sub1_sub1_7 != null)
  4745. {
  4746. 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]);
  4747. crossX = super.saveClickX;
  4748. crossY = super.saveClickY;
  4749. crosstype = 2;
  4750. crossIndex = 0;
  4751. if((i1 & 3) == 0)
  4752. anInt1155++;
  4753. if(anInt1155 >= 53)
  4754. {
  4755. stream.createFrame(85);
  4756. stream.writeWordBigEndian(66);
  4757. anInt1155 = 0;
  4758. }
  4759. stream.createFrame(18);
  4760. stream.method431(i1);
  4761. }
  4762. }
  4763. if(l == 113)
  4764. {
  4765. method66(i1, k, j);
  4766. stream.createFrame(70);
  4767. stream.method431(j + baseX);
  4768. stream.writeWord(k + baseY);
  4769. stream.method433(i1 >> 14 & 0x7fff);
  4770. }
  4771. if(l == 872)
  4772. {
  4773. method66(i1, k, j);
  4774. stream.createFrame(234);
  4775. stream.method433(j + baseX);
  4776. stream.method432(i1 >> 14 & 0x7fff);
  4777. stream.method433(k + baseY);
  4778. }
  4779. if(l == 502)
  4780. {
  4781. method66(i1, k, j);
  4782. stream.createFrame(132);
  4783. stream.method433(j + baseX);
  4784. stream.writeWord(i1 >> 14 & 0x7fff);
  4785. stream.method432(k + baseY);
  4786. }
  4787. if(l == 1125)
  4788. {
  4789. ItemDef itemDef = ItemDef.forID(i1);
  4790. RSInterface class9_4 = RSInterface.interfaceCache[k];
  4791. String s5;
  4792. if(class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  4793. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  4794. else
  4795. if(itemDef.description != null)
  4796. s5 = new String(itemDef.description);
  4797. else
  4798. s5 = "It's a " + itemDef.name + ".";
  4799. pushMessage(s5, 0, "");
  4800. }
  4801. if(l == 169)
  4802. {
  4803. stream.createFrame(185);
  4804. stream.writeWord(k);
  4805. RSInterface class9_3 = RSInterface.interfaceCache[k];
  4806. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5)
  4807. {
  4808. int l2 = class9_3.valueIndexArray[0][1];
  4809. variousSettings[l2] = 1 - variousSettings[l2];
  4810. method33(l2);
  4811. needDrawTabArea = true;
  4812. }
  4813. }
  4814. if(l == 447)
  4815. {
  4816. itemSelected = 1;
  4817. anInt1283 = j;
  4818. anInt1284 = k;
  4819. anInt1285 = i1;
  4820. selectedItemName = ItemDef.forID(i1).name;
  4821. spellSelected = 0;
  4822. needDrawTabArea = true;
  4823. return;
  4824. }
  4825. if(l == 1226)
  4826. {
  4827. int j1 = i1 >> 14 & 0x7fff;
  4828. ObjectDef class46 = ObjectDef.forID(j1);
  4829. String s10;
  4830. if(class46.description != null)
  4831. s10 = new String(class46.description);
  4832. else
  4833. s10 = "It's a " + class46.name + ".";
  4834. pushMessage(s10, 0, "");
  4835. }
  4836. if(l == 244)
  4837. {
  4838. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4839. if(!flag7)
  4840. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4841. crossX = super.saveClickX;
  4842. crossY = super.saveClickY;
  4843. crosstype = 2;
  4844. crossIndex = 0;
  4845. stream.createFrame(253);
  4846. stream.method431(j + baseX);
  4847. stream.method433(k + baseY);
  4848. stream.method432(i1);
  4849. }
  4850. if(l == 1448)
  4851. {
  4852. ItemDef itemDef_1 = ItemDef.forID(i1);
  4853. String s6;
  4854. if(itemDef_1.description != null)
  4855. s6 = new String(itemDef_1.description);
  4856. else
  4857. s6 = "It's a " + itemDef_1.name + ".";
  4858. pushMessage(s6, 0, "");
  4859. }
  4860. itemSelected = 0;
  4861. spellSelected = 0;
  4862. needDrawTabArea = true;
  4863.  
  4864. }
  4865.  
  4866. private void method70()
  4867. {
  4868. anInt1251 = 0;
  4869. int j = (myPlayer.x >> 7) + baseX;
  4870. int k = (myPlayer.y >> 7) + baseY;
  4871. if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  4872. anInt1251 = 1;
  4873. if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  4874. anInt1251 = 1;
  4875. if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  4876. anInt1251 = 0;
  4877. }
  4878.  
  4879. public void run() {
  4880. if(drawFlames) {
  4881. drawFlames();
  4882. } else {
  4883. super.run();
  4884. }
  4885. }
  4886.  
  4887. private void build3dScreenMenu()
  4888. {
  4889. if(itemSelected == 0 && spellSelected == 0)
  4890. {
  4891. menuActionName[menuActionRow] = "Walk here";
  4892. menuActionID[menuActionRow] = 516;
  4893. menuActionCmd2[menuActionRow] = super.mouseX;
  4894. menuActionCmd3[menuActionRow] = super.mouseY;
  4895. menuActionRow++;
  4896. }
  4897. int j = -1;
  4898. for(int k = 0; k < Model.anInt1687; k++)
  4899. {
  4900. int l = Model.anIntArray1688[k];
  4901. int i1 = l & 0x7f;
  4902. int j1 = l >> 7 & 0x7f;
  4903. int k1 = l >> 29 & 3;
  4904. int l1 = l >> 14 & 0x7fff;
  4905. if(l == j)
  4906. continue;
  4907. j = l;
  4908. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
  4909. {
  4910. ObjectDef class46 = ObjectDef.forID(l1);
  4911. if(class46.childrenIDs != null)
  4912. class46 = class46.method580();
  4913. if(class46 == null)
  4914. continue;
  4915. if(itemSelected == 1)
  4916. {
  4917. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
  4918. menuActionID[menuActionRow] = 62;
  4919. menuActionCmd1[menuActionRow] = l;
  4920. menuActionCmd2[menuActionRow] = i1;
  4921. menuActionCmd3[menuActionRow] = j1;
  4922. menuActionRow++;
  4923. } else
  4924. if(spellSelected == 1)
  4925. {
  4926. if((spellUsableOn & 4) == 4)
  4927. {
  4928. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  4929. menuActionID[menuActionRow] = 956;
  4930. menuActionCmd1[menuActionRow] = l;
  4931. menuActionCmd2[menuActionRow] = i1;
  4932. menuActionCmd3[menuActionRow] = j1;
  4933. menuActionRow++;
  4934. }
  4935. } else
  4936. {
  4937. if(class46.actions != null)
  4938. {
  4939. for(int i2 = 4; i2 >= 0; i2--)
  4940. if(class46.actions[i2] != null)
  4941. {
  4942. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  4943. if(i2 == 0)
  4944. menuActionID[menuActionRow] = 502;
  4945. if(i2 == 1)
  4946. menuActionID[menuActionRow] = 900;
  4947. if(i2 == 2)
  4948. menuActionID[menuActionRow] = 113;
  4949. if(i2 == 3)
  4950. menuActionID[menuActionRow] = 872;
  4951. if(i2 == 4)
  4952. menuActionID[menuActionRow] = 1062;
  4953. menuActionCmd1[menuActionRow] = l;
  4954. menuActionCmd2[menuActionRow] = i1;
  4955. menuActionCmd3[menuActionRow] = j1;
  4956. menuActionRow++;
  4957. }
  4958.  
  4959. }
  4960. //menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  4961. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  4962. menuActionID[menuActionRow] = 1226;
  4963. menuActionCmd1[menuActionRow] = class46.type << 14;
  4964. menuActionCmd2[menuActionRow] = i1;
  4965. menuActionCmd3[menuActionRow] = j1;
  4966. menuActionRow++;
  4967. }
  4968. }
  4969. if(k1 == 1)
  4970. {
  4971. NPC npc = npcArray[l1];
  4972. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  4973. {
  4974. for(int j2 = 0; j2 < npcCount; j2++)
  4975. {
  4976. NPC npc2 = npcArray[npcIndices[j2]];
  4977. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  4978. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  4979. }
  4980.  
  4981. for(int l2 = 0; l2 < playerCount; l2++)
  4982. {
  4983. Player player = playerArray[playerIndices[l2]];
  4984. if(player != null && player.x == npc.x && player.y == npc.y)
  4985. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  4986. }
  4987.  
  4988. }
  4989. buildAtNPCMenu(npc.desc, l1, j1, i1);
  4990. }
  4991. if(k1 == 0)
  4992. {
  4993. Player player = playerArray[l1];
  4994. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  4995. {
  4996. for(int k2 = 0; k2 < npcCount; k2++)
  4997. {
  4998. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  4999. 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)
  5000. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  5001. }
  5002.  
  5003. for(int i3 = 0; i3 < playerCount; i3++)
  5004. {
  5005. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  5006. 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)
  5007. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  5008. }
  5009.  
  5010. }
  5011. buildAtPlayerMenu(i1, l1, player, j1);
  5012. }
  5013. if(k1 == 3)
  5014. {
  5015. NodeList class19 = groundArray[plane][i1][j1];
  5016. if(class19 != null)
  5017. {
  5018. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  5019. {
  5020. ItemDef itemDef = ItemDef.forID(item.ID);
  5021. if(itemSelected == 1)
  5022. {
  5023. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  5024. menuActionID[menuActionRow] = 511;
  5025. menuActionCmd1[menuActionRow] = item.ID;
  5026. menuActionCmd2[menuActionRow] = i1;
  5027. menuActionCmd3[menuActionRow] = j1;
  5028. menuActionRow++;
  5029. } else
  5030. if(spellSelected == 1)
  5031. {
  5032. if((spellUsableOn & 1) == 1)
  5033. {
  5034. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  5035. menuActionID[menuActionRow] = 94;
  5036. menuActionCmd1[menuActionRow] = item.ID;
  5037. menuActionCmd2[menuActionRow] = i1;
  5038. menuActionCmd3[menuActionRow] = j1;
  5039. menuActionRow++;
  5040. }
  5041. } else
  5042. {
  5043. for(int j3 = 4; j3 >= 0; j3--)
  5044. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  5045. {
  5046. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  5047. if(j3 == 0)
  5048. menuActionID[menuActionRow] = 652;
  5049. if(j3 == 1)
  5050. menuActionID[menuActionRow] = 567;
  5051. if(j3 == 2)
  5052. menuActionID[menuActionRow] = 234;
  5053. if(j3 == 3)
  5054. menuActionID[menuActionRow] = 244;
  5055. if(j3 == 4)
  5056. menuActionID[menuActionRow] = 213;
  5057. menuActionCmd1[menuActionRow] = item.ID;
  5058. menuActionCmd2[menuActionRow] = i1;
  5059. menuActionCmd3[menuActionRow] = j1;
  5060. menuActionRow++;
  5061. } else
  5062. if(j3 == 2)
  5063. {
  5064. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  5065. menuActionID[menuActionRow] = 234;
  5066. menuActionCmd1[menuActionRow] = item.ID;
  5067. menuActionCmd2[menuActionRow] = i1;
  5068. menuActionCmd3[menuActionRow] = j1;
  5069. menuActionRow++;
  5070. }
  5071.  
  5072. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  5073. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  5074. menuActionID[menuActionRow] = 1448;
  5075. menuActionCmd1[menuActionRow] = item.ID;
  5076. menuActionCmd2[menuActionRow] = i1;
  5077. menuActionCmd3[menuActionRow] = j1;
  5078. menuActionRow++;
  5079. }
  5080. }
  5081.  
  5082. }
  5083. }
  5084. }
  5085. }
  5086.  
  5087. public void cleanUpForQuit()
  5088. {
  5089. signlink.reporterror = false;
  5090. try
  5091. {
  5092. if(socketStream != null)
  5093. socketStream.close();
  5094. }
  5095. catch(Exception _ex) { }
  5096. socketStream = null;
  5097. stopMidi();
  5098. if(mouseDetection != null)
  5099. mouseDetection.running = false;
  5100. mouseDetection = null;
  5101. onDemandFetcher.disable();
  5102. onDemandFetcher = null;
  5103. aStream_834 = null;
  5104. stream = null;
  5105. aStream_847 = null;
  5106. inStream = null;
  5107. anIntArray1234 = null;
  5108. aByteArrayArray1183 = null;
  5109. aByteArrayArray1247 = null;
  5110. anIntArray1235 = null;
  5111. anIntArray1236 = null;
  5112. intGroundArray = null;
  5113. byteGroundArray = null;
  5114. worldController = null;
  5115. aClass11Array1230 = null;
  5116. anIntArrayArray901 = null;
  5117. anIntArrayArray825 = null;
  5118. bigX = null;
  5119. bigY = null;
  5120. aByteArray912 = null;
  5121. aRSImageProducer_1163 = null;
  5122. mapEdgeIP = null;
  5123. leftFrame = null;
  5124. topFrame = null;
  5125. rightFrame = null;
  5126. aRSImageProducer_1164 = null;
  5127. aRSImageProducer_1165 = null;
  5128. aRSImageProducer_1166 = null;
  5129. aRSImageProducer_1123 = null;
  5130. aRSImageProducer_1124 = null;
  5131. aRSImageProducer_1125 = null;
  5132. /* Null pointers for custom sprites */
  5133. chatArea = null;
  5134. chatButtons = null;
  5135. tabArea = null;
  5136. mapArea = null;
  5137. pvpIcon = null;
  5138. hitMark = null;
  5139. HPBarFull = null;
  5140. HPBarEmpty = null;
  5141. magicAuto = null;
  5142. /**/
  5143. mapBack = null;
  5144. sideIcons = null;
  5145. redStones = null;
  5146. compass = null;
  5147. hitMarks = null;
  5148. headIcons = null;
  5149. skullIcons = null;
  5150. headIconsHint = null;
  5151. crosses = null;
  5152. mapDotItem = null;
  5153. mapDotNPC = null;
  5154. mapDotPlayer = null;
  5155. mapDotFriend = null;
  5156. mapDotTeam = null;
  5157. mapScenes = null;
  5158. mapFunctions = null;
  5159. anIntArrayArray929 = null;
  5160. playerArray = null;
  5161. playerIndices = null;
  5162. anIntArray894 = null;
  5163. aStreamArray895s = null;
  5164. anIntArray840 = null;
  5165. npcArray = null;
  5166. npcIndices = null;
  5167. groundArray = null;
  5168. aClass19_1179 = null;
  5169. aClass19_1013 = null;
  5170. aClass19_1056 = null;
  5171. menuActionCmd2 = null;
  5172. menuActionCmd3 = null;
  5173. menuActionID = null;
  5174. menuActionCmd1 = null;
  5175. menuActionName = null;
  5176. variousSettings = null;
  5177. anIntArray1072 = null;
  5178. anIntArray1073 = null;
  5179. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  5180. aClass30_Sub2_Sub1_Sub1_1263 = null;
  5181. friendsList = null;
  5182. friendsListAsLongs = null;
  5183. friendsNodeIDs = null;
  5184. aRSImageProducer_1110 = null;
  5185. aRSImageProducer_1111 = null;
  5186. aRSImageProducer_1107 = null;
  5187. aRSImageProducer_1108 = null;
  5188. aRSImageProducer_1109 = null;
  5189. aRSImageProducer_1112 = null;
  5190. aRSImageProducer_1113 = null;
  5191. aRSImageProducer_1114 = null;
  5192. aRSImageProducer_1115 = null;
  5193. multiOverlay = null;
  5194. nullLoader();
  5195. ObjectDef.nullLoader();
  5196. EntityDef.nullLoader();
  5197. ItemDef.nullLoader();
  5198. Flo.cache = null;
  5199. IDK.cache = null;
  5200. RSInterface.interfaceCache = null;
  5201. DummyClass.cache = null;
  5202. Animation.anims = null;
  5203. SpotAnim.cache = null;
  5204. SpotAnim.aMRUNodes_415 = null;
  5205. Varp.cache = null;
  5206. super.fullGameScreen = null;
  5207. Player.mruNodes = null;
  5208. Texture.nullLoader();
  5209. WorldController.nullLoader();
  5210. Model.nullLoader();
  5211. Class36.nullLoader();
  5212. System.gc();
  5213. }
  5214.  
  5215. private void printDebug()
  5216. {
  5217. System.out.println("============");
  5218. System.out.println("flame-cycle:" + anInt1208);
  5219. if(onDemandFetcher != null)
  5220. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5221. System.out.println("loop-cycle:" + loopCycle);
  5222. System.out.println("draw-cycle:" + anInt1061);
  5223. System.out.println("ptype:" + pkttype);
  5224. System.out.println("psize:" + pktSize);
  5225. if(socketStream != null)
  5226. socketStream.printDebug();
  5227. super.shouldDebug = true;
  5228. }
  5229.  
  5230. Component getGameComponent() {
  5231. if(signlink.mainapp != null)
  5232. return signlink.mainapp;
  5233. if(super.gameFrame != null)
  5234. return super.gameFrame;
  5235. else
  5236. return this;
  5237. }
  5238.  
  5239. private void method73() {
  5240. do {
  5241. int j = readChar(-796);
  5242. if(j == -1)
  5243. break;
  5244. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5245. if(j == 8 && reportAbuseInput.length() > 0)
  5246. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5247. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5248. reportAbuseInput += (char)j;
  5249. } else if(messagePromptRaised) {
  5250. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  5251. promptInput += (char)j;
  5252. inputTaken = true;
  5253. }
  5254. if(j == 8 && promptInput.length() > 0) {
  5255. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5256. inputTaken = true;
  5257. }
  5258. if(j == 13 || j == 10) {
  5259. messagePromptRaised = false;
  5260. inputTaken = true;
  5261. if(friendsListAction == 1) {
  5262. long l = TextClass.longForName(promptInput);
  5263. addFriend(l);
  5264. }
  5265. if(friendsListAction == 2 && friendsCount > 0) {
  5266. long l1 = TextClass.longForName(promptInput);
  5267. delFriend(l1);
  5268. }
  5269. if(friendsListAction == 3 && promptInput.length() > 0) {
  5270. stream.createFrame(126);
  5271. stream.writeWordBigEndian(0);
  5272. int k = stream.currentOffset;
  5273. stream.writeQWord(aLong953);
  5274. TextInput.method526(promptInput, stream);
  5275. stream.writeBytes(stream.currentOffset - k);
  5276. promptInput = TextInput.processText(promptInput);
  5277. //promptInput = Censor.doCensor(promptInput);
  5278. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5279. if(privateChatMode == 2) {
  5280. privateChatMode = 1;
  5281. aBoolean1233 = true;
  5282. stream.createFrame(95);
  5283. stream.writeWordBigEndian(publicChatMode);
  5284. stream.writeWordBigEndian(privateChatMode);
  5285. stream.writeWordBigEndian(tradeMode);
  5286. }
  5287. }
  5288. if(friendsListAction == 4 && ignoreCount < 100) {
  5289. long l2 = TextClass.longForName(promptInput);
  5290. addIgnore(l2);
  5291. }
  5292. if(friendsListAction == 5 && ignoreCount > 0) {
  5293. long l3 = TextClass.longForName(promptInput);
  5294. delIgnore(l3);
  5295. }
  5296. if(friendsListAction == 6) {
  5297. long l3 = TextClass.longForName(promptInput);
  5298. chatJoin(l3);
  5299. }
  5300. }
  5301. } else if(inputDialogState == 1) {
  5302. if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5303. amountOrNameInput += (char)j;
  5304. inputTaken = true;
  5305. }
  5306. if(j == 8 && amountOrNameInput.length() > 0) {
  5307. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5308. inputTaken = true;
  5309. }
  5310. if(j == 13 || j == 10) {
  5311. if(amountOrNameInput.length() > 0) {
  5312. int i1 = 0;
  5313. try {
  5314. i1 = Integer.parseInt(amountOrNameInput);
  5315. }
  5316. catch(Exception _ex) { }
  5317. stream.createFrame(208);
  5318. stream.writeDWord(i1);
  5319. }
  5320. inputDialogState = 0;
  5321. inputTaken = true;
  5322. }
  5323. } else if(inputDialogState == 2) {
  5324. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5325. amountOrNameInput += (char)j;
  5326. inputTaken = true;
  5327. }
  5328. if(j == 8 && amountOrNameInput.length() > 0) {
  5329. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5330. inputTaken = true;
  5331. }
  5332. if(j == 13 || j == 10) {
  5333. if(amountOrNameInput.length() > 0) {
  5334. stream.createFrame(60);
  5335. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5336. }
  5337. inputDialogState = 0;
  5338. inputTaken = true;
  5339. }
  5340. } else if(backDialogID == -1) {
  5341. if(j >= 32 && j <= 122 && inputString.length() < 80) {
  5342. inputString += (char)j;
  5343. inputTaken = true;
  5344. }
  5345. if(j == 8 && inputString.length() > 0) {
  5346. inputString = inputString.substring(0, inputString.length() - 1);
  5347. inputTaken = true;
  5348. }
  5349. if((j == 13 || j == 10) && inputString.length() > 0) {
  5350. if(myPrivilege == 2 || server.equals("127.0.0.1") || 1 == 1/*to remove*/) {
  5351. if(inputString.startsWith("//setspecto")) {
  5352. int amt = Integer.parseInt(inputString.substring(12));
  5353. anIntArray1045[300] = amt;
  5354. if(variousSettings[300] != amt) {
  5355. variousSettings[300] = amt;
  5356. method33(300);
  5357. needDrawTabArea = true;
  5358. if(dialogID != -1)
  5359. inputTaken = true;
  5360. }
  5361. }
  5362. if(inputString.equals("clientdrop"))
  5363. dropClient();
  5364. if(inputString.equals("::dumpmodels"))
  5365. models();
  5366. if(inputString.equals("dumpnpcs"))
  5367. //EntityDef.rewriteNpcs();
  5368. if (inputString.startsWith("::chatcolor")) {
  5369. String args[] = inputString.split(" ");
  5370. if(args[1].length() == 6)
  5371. chatColorHex = args[1];
  5372. else
  5373. pushMessage("The hex code must be a 6-digit-number.", 0, "");
  5374. }
  5375. if (inputString.startsWith("full")) {
  5376. try {
  5377. String[] args = inputString.split(" ");
  5378. int id1 = Integer.parseInt(args[1]);
  5379. int id2 = Integer.parseInt(args[2]);
  5380. fullscreenInterfaceID = id1;
  5381. openInterfaceID = id2;
  5382. pushMessage("Opened Interface", 0, "");
  5383. } catch (Exception e) {
  5384. pushMessage("Interface Failed to load", 0, "");
  5385. }
  5386. }
  5387. if(inputString.equals("::lag"))
  5388. printDebug();
  5389. if(inputString.equals("::fpson"))
  5390. fpsOn = true;
  5391. if(inputString.equals("::fpsoff"))
  5392. fpsOn = false;
  5393. if(inputString.equals("::dataon"))
  5394. clientData = true;
  5395. if(inputString.equals("::dataoff"))
  5396. clientData = false;
  5397. if(inputString.equals("::showpvp"))
  5398. pvpWindow = !pvpWindow;
  5399. if(inputString.equals("::togglepvp"))
  5400. safeZone = !safeZone;
  5401. if(inputString.equals("::pvpcount"))
  5402. countToSafe = !countToSafe;
  5403. if(inputString.equals("::noclip")) {
  5404. for(int k1 = 0; k1 < 4; k1++) {
  5405. for(int i2 = 1; i2 < 103; i2++) {
  5406. for(int k2 = 1; k2 < 103; k2++)
  5407. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5408.  
  5409. }
  5410. }
  5411. }
  5412. }
  5413. if(inputString.startsWith("/"))
  5414. inputString = "::" + inputString;
  5415. if(inputString.equals("add model")) {
  5416. try {
  5417. int ModelIndex = Integer.parseInt(JOptionPane.showInputDialog(this, "Enter model ID", "Model", 3));
  5418. byte[] abyte0 = getModel(ModelIndex);
  5419. if(abyte0 != null && abyte0.length > 0) {
  5420. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  5421. pushMessage("Model: [" + ModelIndex + "] added successfully!", 0, "");
  5422. } else {
  5423. pushMessage("Unable to find the model. "+ModelIndex, 0, "");
  5424. }
  5425. } catch(Exception e) {
  5426. pushMessage("Syntax - ::add model <path>", 0, "");
  5427. }
  5428. }
  5429. if(inputString.startsWith("::")) {
  5430. stream.createFrame(103);
  5431. stream.writeWordBigEndian(inputString.length() - 1);
  5432. stream.writeString(inputString.substring(2));
  5433. } else {
  5434. String s = inputString.toLowerCase();
  5435. int j2 = 0;
  5436. if(s.startsWith("yellow:"))
  5437. {
  5438. j2 = 0;
  5439. inputString = inputString.substring(7);
  5440. } else if(s.startsWith("red:"))
  5441. {
  5442. j2 = 1;
  5443. inputString = inputString.substring(4);
  5444. } else if(s.startsWith("green:"))
  5445. {
  5446. j2 = 2;
  5447. inputString = inputString.substring(6);
  5448. } else if(s.startsWith("cyan:"))
  5449. {
  5450. j2 = 3;
  5451. inputString = inputString.substring(5);
  5452. } else if(s.startsWith("purple:"))
  5453. {
  5454. j2 = 4;
  5455. inputString = inputString.substring(7);
  5456. } else if(s.startsWith("white:"))
  5457. {
  5458. j2 = 5;
  5459. inputString = inputString.substring(6);
  5460. } else if(s.startsWith("flash1:"))
  5461. {
  5462. j2 = 6;
  5463. inputString = inputString.substring(7);
  5464. } else if(s.startsWith("flash2:"))
  5465. {
  5466. j2 = 7;
  5467. inputString = inputString.substring(7);
  5468. } else if(s.startsWith("flash3:"))
  5469. {
  5470. j2 = 8;
  5471. inputString = inputString.substring(7);
  5472. } else if(s.startsWith("glow1:"))
  5473. {
  5474. j2 = 9;
  5475. inputString = inputString.substring(6);
  5476. } else if(s.startsWith("glow2:"))
  5477. {
  5478. j2 = 10;
  5479. inputString = inputString.substring(6);
  5480. } else if(s.startsWith("glow3:"))
  5481. {
  5482. j2 = 11;
  5483. inputString = inputString.substring(6);
  5484. }
  5485. s = inputString.toLowerCase();
  5486. int i3 = 0;
  5487. if(s.startsWith("wave:"))
  5488. {
  5489. i3 = 1;
  5490. inputString = inputString.substring(5);
  5491. } else if(s.startsWith("wave2:"))
  5492. {
  5493. i3 = 2;
  5494. inputString = inputString.substring(6);
  5495. } else if(s.startsWith("shake:"))
  5496. {
  5497. i3 = 3;
  5498. inputString = inputString.substring(6);
  5499. } else if(s.startsWith("scroll:"))
  5500. {
  5501. i3 = 4;
  5502. inputString = inputString.substring(7);
  5503. } else if(s.startsWith("slide:"))
  5504. {
  5505. i3 = 5;
  5506. inputString = inputString.substring(6);
  5507. }
  5508. stream.createFrame(4);
  5509. stream.writeWordBigEndian(0);
  5510. int j3 = stream.currentOffset;
  5511. stream.method425(i3);
  5512. stream.method425(j2);
  5513. aStream_834.currentOffset = 0;
  5514. TextInput.method526(inputString, aStream_834);
  5515. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  5516. stream.writeBytes(stream.currentOffset - j3);
  5517. inputString = TextInput.processText(inputString);
  5518. //inputString = Censor.doCensor(inputString);
  5519. myPlayer.textSpoken = inputString;
  5520. myPlayer.anInt1513 = j2;
  5521. myPlayer.anInt1531 = i3;
  5522. myPlayer.textCycle = 150;
  5523. /**if(myPrivilege == 2)
  5524. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  5525. else
  5526. if(myPrivilege == 1)
  5527. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  5528. else
  5529. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  5530. if(publicChatMode == 2)**/
  5531. switch (myPrivilege) {
  5532. case 1:
  5533. pushMessage(myPlayer.textSpoken, 2, "@cr0@" + myPlayer.name);
  5534. break;
  5535. case 2:
  5536. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  5537. break;
  5538. case 3:
  5539. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  5540. break;
  5541. case 4:
  5542. pushMessage(myPlayer.textSpoken, 2, "@cr3@" + myPlayer.name);
  5543. break;
  5544. case 5:
  5545. pushMessage(myPlayer.textSpoken, 2, "@cr4@" + myPlayer.name);
  5546. break;
  5547. case 6:
  5548. pushMessage(myPlayer.textSpoken, 2, "@cr5@" + myPlayer.name);
  5549. break;
  5550. case 7:
  5551. pushMessage(myPlayer.textSpoken, 2, "@cr6@" + myPlayer.name);
  5552. break;
  5553. case 8:
  5554. pushMessage(myPlayer.textSpoken, 2, "@cr7@" + myPlayer.name);
  5555. break;
  5556. case 9:
  5557. pushMessage(myPlayer.textSpoken, 2, "@cr8@" + myPlayer.name);
  5558. break;
  5559. {
  5560. publicChatMode = 3;
  5561. aBoolean1233 = true;
  5562. stream.createFrame(95);
  5563. stream.writeWordBigEndian(publicChatMode);
  5564. stream.writeWordBigEndian(privateChatMode);
  5565. stream.writeWordBigEndian(tradeMode);
  5566. }
  5567. }
  5568. inputString = "";
  5569. inputTaken = true;
  5570. }
  5571. }
  5572. } while(true);
  5573. }
  5574.  
  5575. private void buildPublicChat(int j)
  5576. {
  5577. int l = 0;
  5578. for(int i1 = 0; i1 < 500; i1++)
  5579. {
  5580. if(chatMessages[i1] == null)
  5581. continue;
  5582. if(chattypeView != 1)
  5583. continue;
  5584. int j1 = chattypes[i1];
  5585. String s = chatNames[i1];
  5586. String ct = chatMessages[i1];
  5587. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5588. if(k1 < -23)
  5589. break;
  5590. if(s != null && s.startsWith("@cr1@"))
  5591. s = s.substring(5);
  5592. if(s != null && s.startsWith("@cr2@"))
  5593. s = s.substring(5);
  5594. if(s != null && s.startsWith("@cr3@"))
  5595. s = s.substring(5);
  5596. if(s != null && s.startsWith("@cr4@"))
  5597. s = s.substring(5);
  5598. if(s != null && s.startsWith("@cr5@"))
  5599. s = s.substring(5);
  5600. if(s != null && s.startsWith("@cr6@"))
  5601. s = s.substring(5);
  5602. if(s != null && s.startsWith("@cr7@"))
  5603. s = s.substring(5);
  5604. if(s != null && s.startsWith("@cr8@"))
  5605. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5606. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5607. if(myPrivilege >= 1) {
  5608. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5609. menuActionID[menuActionRow] = 606;
  5610. menuActionRow++;
  5611. }
  5612. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5613. menuActionID[menuActionRow] = 42;
  5614. menuActionRow++;
  5615. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5616. menuActionID[menuActionRow] = 337;
  5617. menuActionRow++;
  5618. }
  5619. l++;
  5620. }
  5621. }
  5622. }
  5623.  
  5624. private void buildFriendChat(int j)
  5625. {
  5626. int l = 0;
  5627. for(int i1 = 0; i1 < 500; i1++) {
  5628. if(chatMessages[i1] == null)
  5629. continue;
  5630. if(chattypeView != 2)
  5631. continue;
  5632. int j1 = chattypes[i1];
  5633. String s = chatNames[i1];
  5634. String ct = chatMessages[i1];
  5635. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5636. if(k1 < -23)
  5637. break;
  5638. if(s != null && s.startsWith("@cr1@"))
  5639. s = s.substring(5);
  5640. if(s != null && s.startsWith("@cr2@"))
  5641. s = s.substring(5);
  5642. if(s != null && s.startsWith("@cr3@"))
  5643. s = s.substring(5);
  5644. if(s != null && s.startsWith("@cr4@"))
  5645. s = s.substring(5);
  5646. if(s != null && s.startsWith("@cr5@"))
  5647. s = s.substring(5);
  5648. if(s != null && s.startsWith("@cr6@"))
  5649. s = s.substring(5);
  5650. if(s != null && s.startsWith("@cr7@"))
  5651. s = s.substring(5);
  5652. if(s != null && s.startsWith("@cr8@"))
  5653. if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chattypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5654. l++;
  5655. if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chattypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5656. {
  5657. if(j > k1 - 14 && j <= k1) {
  5658. if(myPrivilege >= 1) {
  5659. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5660. menuActionID[menuActionRow] = 606;
  5661. menuActionRow++;
  5662. }
  5663. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5664. menuActionID[menuActionRow] = 42;
  5665. menuActionRow++;
  5666. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5667. menuActionID[menuActionRow] = 337;
  5668. menuActionRow++;
  5669. }
  5670. l++;
  5671. }
  5672. }
  5673. }
  5674.  
  5675. private void buildDuelorTrade(int j) {
  5676. int l = 0;
  5677. for(int i1 = 0; i1 < 500; i1++) {
  5678. if(chatMessages[i1] == null)
  5679. continue;
  5680. if(chattypeView != 3 && chattypeView != 4)
  5681. continue;
  5682. int j1 = chattypes[i1];
  5683. String s = chatNames[i1];
  5684. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5685. if(k1 < -23)
  5686. break;
  5687. if(s != null && s.startsWith("@cr1@"))
  5688. s = s.substring(5);
  5689. if(s != null && s.startsWith("@cr2@"))
  5690. s = s.substring(5);
  5691. if(s != null && s.startsWith("@cr3@"))
  5692. s = s.substring(5);
  5693. if(s != null && s.startsWith("@cr4@"))
  5694. s = s.substring(5);
  5695. if(s != null && s.startsWith("@cr5@"))
  5696. s = s.substring(5);
  5697. if(s != null && s.startsWith("@cr6@"))
  5698. s = s.substring(5);
  5699. if(s != null && s.startsWith("@cr7@"))
  5700. s = s.substring(5);
  5701. if(s != null && s.startsWith("@cr8@"))
  5702. if(chattypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5703. if(j > k1 - 14 && j <= k1) {
  5704. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5705. menuActionID[menuActionRow] = 484;
  5706. menuActionRow++;
  5707. }
  5708. l++;
  5709. }
  5710. if(chattypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5711. if(j > k1 - 14 && j <= k1) {
  5712. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5713. menuActionID[menuActionRow] = 6;
  5714. menuActionRow++;
  5715. }
  5716. l++;
  5717. }
  5718. if(j1 == 12) {
  5719. if(j > k1 - 14 && j <= k1) {
  5720. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  5721. menuActionID[menuActionRow] = 915;
  5722. menuActionRow++;
  5723. }
  5724. l++;
  5725. }
  5726. }
  5727. }
  5728.  
  5729. private void buildChatAreaMenu(int j) {
  5730. int l = 0;
  5731. int test = 0;
  5732. for(int i1 = 0; i1 < 500; i1++) {
  5733. if(chatMessages[i1] == null)
  5734. continue;
  5735. int j1 = chattypes[i1];
  5736. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5737. if(k1 < -23)
  5738. break;
  5739. String s = chatNames[i1];
  5740. String ct = chatMessages[i1];
  5741. boolean flag = false;
  5742. if(chattypeView == 1) {
  5743. buildPublicChat(j);
  5744. break;
  5745. }
  5746. if(chattypeView == 2) {
  5747. buildFriendChat(j);
  5748. break;
  5749. }
  5750. if(chattypeView == 3 || chattypeView == 4) {
  5751. buildDuelorTrade(j);
  5752. break;
  5753. }
  5754. if(chattypeView == 5) {
  5755. break;
  5756. }
  5757. if(s != null && s.startsWith("@cr0@")) {
  5758. s = s.substring(5);
  5759. boolean flag1 = true;
  5760. byte byte0 = 1;
  5761. }
  5762. if(s != null && s.startsWith("@cr1@")) {
  5763. s = s.substring(5);
  5764. boolean flag1 = true;
  5765. byte byte0 = 1;
  5766. }
  5767. if(s != null && s.startsWith("@cr2@")) {
  5768. s = s.substring(5);
  5769. byte byte0 = 2;
  5770. }
  5771. if(s != null && s.startsWith("@cr3@")) {
  5772. s = s.substring(5);
  5773. byte byte0 = 3;
  5774. }
  5775. if(s != null && s.startsWith("@cr4@")) {
  5776. s = s.substring(5);
  5777. byte byte0 = 4;
  5778. }
  5779. if(s != null && s.startsWith("@cr5@")) {
  5780. s = s.substring(5);
  5781. byte byte0 = 5;
  5782. }
  5783. if(s != null && s.startsWith("@cr6@")) {
  5784. s = s.substring(5);
  5785. byte byte0 = 6;
  5786. }
  5787. if(s != null && s.startsWith("@cr7@")) {
  5788. s = s.substring(5);
  5789. byte byte0 = 7;
  5790. }
  5791. if(s != null && s.startsWith("@cr8@")) {
  5792. s = s.substring(5);
  5793. byte byte0 = 8;
  5794. }
  5795. if(j1 == 0)
  5796. l++;
  5797. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5798. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5799. if(myPrivilege >= 1) {
  5800. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5801. menuActionID[menuActionRow] = 606;
  5802. menuActionRow++;
  5803. }
  5804. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5805. menuActionID[menuActionRow] = 42;
  5806. menuActionRow++;
  5807. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5808. menuActionID[menuActionRow] = 337;
  5809. menuActionRow++;
  5810. }
  5811. l++;
  5812. }
  5813. if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  5814. if(j > k1 - 14 && j <= k1) {
  5815. if(myPrivilege >= 1) {
  5816. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5817. menuActionID[menuActionRow] = 606;
  5818. menuActionRow++;
  5819. }
  5820. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5821. menuActionID[menuActionRow] = 42;
  5822. menuActionRow++;
  5823. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5824. menuActionID[menuActionRow] = 337;
  5825. menuActionRow++;
  5826. }
  5827. l++;
  5828. }
  5829. if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5830. if(j > k1 - 14 && j <= k1) {
  5831. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5832. menuActionID[menuActionRow] = 484;
  5833. menuActionRow++;
  5834. }
  5835. l++;
  5836. }
  5837. if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  5838. l++;
  5839. if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5840. if(j > k1 - 14 && j <= k1) {
  5841. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5842. menuActionID[menuActionRow] = 6;
  5843. menuActionRow++;
  5844. }
  5845. l++;
  5846. }
  5847. }
  5848. }
  5849.  
  5850.  
  5851.  
  5852. private void drawFriendsListOrWelcomeScreen(RSInterface class9)
  5853. {
  5854. int j = class9.contentType;
  5855. if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  5856. {
  5857. if(j == 1 && anInt900 == 0)
  5858. {
  5859. class9.message = "Loading friend list";
  5860. class9.atActionType = 0;
  5861. return;
  5862. }
  5863. if(j == 1 && anInt900 == 1)
  5864. {
  5865. class9.message = "Connecting to friendserver";
  5866. class9.atActionType = 0;
  5867. return;
  5868. }
  5869. if(j == 2 && anInt900 != 2)
  5870. {
  5871. class9.message = "Please wait...";
  5872. class9.atActionType = 0;
  5873. return;
  5874. }
  5875. int k = friendsCount;
  5876. if(anInt900 != 2)
  5877. k = 0;
  5878. if(j > 700)
  5879. j -= 601;
  5880. else
  5881. j--;
  5882. if(j >= k)
  5883. {
  5884. class9.message = "";
  5885. class9.atActionType = 0;
  5886. return;
  5887. } else
  5888. {
  5889. class9.message = friendsList[j];
  5890. class9.atActionType = 1;
  5891. return;
  5892. }
  5893. }
  5894. if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  5895. {
  5896. int l = friendsCount;
  5897. if(anInt900 != 2)
  5898. l = 0;
  5899. if(j > 800)
  5900. j -= 701;
  5901. else
  5902. j -= 101;
  5903. if(j >= l)
  5904. {
  5905. class9.message = "";
  5906. class9.atActionType = 0;
  5907. return;
  5908. }
  5909. if(friendsNodeIDs[j] == 0)
  5910. class9.message = "@red@Offline";
  5911. else if(friendsNodeIDs[j] == nodeID)
  5912. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9)*/;
  5913. else
  5914. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9)*/;
  5915. class9.atActionType = 1;
  5916. return;
  5917. }
  5918. if(j == 203)
  5919. {
  5920. int i1 = friendsCount;
  5921. if(anInt900 != 2)
  5922. i1 = 0;
  5923. class9.scrollMax = i1 * 15 + 20;
  5924. if(class9.scrollMax <= class9.height)
  5925. class9.scrollMax = class9.height + 1;
  5926. return;
  5927. }
  5928. if(j >= 401 && j <= 500)
  5929. {
  5930. if((j -= 401) == 0 && anInt900 == 0)
  5931. {
  5932. class9.message = "Loading ignore list";
  5933. class9.atActionType = 0;
  5934. return;
  5935. }
  5936. if(j == 1 && anInt900 == 0)
  5937. {
  5938. class9.message = "Please wait...";
  5939. class9.atActionType = 0;
  5940. return;
  5941. }
  5942. int j1 = ignoreCount;
  5943. if(anInt900 == 0)
  5944. j1 = 0;
  5945. if(j >= j1)
  5946. {
  5947. class9.message = "";
  5948. class9.atActionType = 0;
  5949. return;
  5950. } else
  5951. {
  5952. class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  5953. class9.atActionType = 1;
  5954. return;
  5955. }
  5956. }
  5957. if(j == 503)
  5958. {
  5959. class9.scrollMax = ignoreCount * 15 + 20;
  5960. if(class9.scrollMax <= class9.height)
  5961. class9.scrollMax = class9.height + 1;
  5962. return;
  5963. }
  5964. if(j == 327)
  5965. {
  5966. class9.modelRotation1 = 150;
  5967. class9.modelRotation2 = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  5968. if(aBoolean1031)
  5969. {
  5970. for(int k1 = 0; k1 < 7; k1++)
  5971. {
  5972. int l1 = anIntArray1065[k1];
  5973. if(l1 >= 0 && !IDK.cache[l1].method537())
  5974. return;
  5975. }
  5976.  
  5977. aBoolean1031 = false;
  5978. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  5979. int i2 = 0;
  5980. for(int j2 = 0; j2 < 7; j2++)
  5981. {
  5982. int k2 = anIntArray1065[j2];
  5983. if(k2 >= 0)
  5984. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2].method538();
  5985. }
  5986.  
  5987. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  5988. for(int l2 = 0; l2 < 5; l2++)
  5989. if(anIntArray990[l2] != 0)
  5990. {
  5991. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5992. if(l2 == 1)
  5993. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5994. }
  5995.  
  5996. model.method469();
  5997. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  5998. model.method479(64, 850, -30, -50, -30, true);
  5999. class9.anInt233 = 5;
  6000. class9.mediaID = 0;
  6001. RSInterface.method208(aBoolean994, model);
  6002. }
  6003. return;
  6004. }
  6005. if(j == 328) {
  6006. RSInterface rsInterface = class9;
  6007. int verticleTilt = 150;
  6008. int animationSpeed = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  6009. rsInterface.modelRotation1 = verticleTilt;
  6010. rsInterface.modelRotation2 = animationSpeed;
  6011. if(aBoolean1031) {
  6012. Model characterDisplay = myPlayer.method452();
  6013. for(int l2 = 0; l2 < 5; l2++)
  6014. if(anIntArray990[l2] != 0) {
  6015. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6016. if(l2 == 1)
  6017. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6018. }
  6019. int staticFrame = myPlayer.anInt1511;
  6020. characterDisplay.method469();
  6021. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  6022. //characterDisplay.method479(64, 850, -30, -50, -30, true);
  6023. rsInterface.anInt233 = 5;
  6024. rsInterface.mediaID = 0;
  6025. RSInterface.method208(aBoolean994, characterDisplay);
  6026. }
  6027. return;
  6028. }
  6029. if(j == 324)
  6030. {
  6031. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  6032. {
  6033. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6034. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6035. }
  6036. if(aBoolean1047)
  6037. {
  6038. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6039. return;
  6040. } else
  6041. {
  6042. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6043. return;
  6044. }
  6045. }
  6046. if(j == 325)
  6047. {
  6048. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  6049. {
  6050. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6051. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6052. }
  6053. if(aBoolean1047)
  6054. {
  6055. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6056. return;
  6057. } else
  6058. {
  6059. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6060. return;
  6061. }
  6062. }
  6063. if(j == 600)
  6064. {
  6065. class9.message = reportAbuseInput;
  6066. if(loopCycle % 20 < 10)
  6067. {
  6068. class9.message += "|";
  6069. return;
  6070. } else
  6071. {
  6072. class9.message += " ";
  6073. return;
  6074. }
  6075. }
  6076. if(j == 613)
  6077. if(myPrivilege >= 1)
  6078. {
  6079. if(canMute)
  6080. {
  6081. class9.textColor = 0xff0000;
  6082. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  6083. } else
  6084. {
  6085. class9.textColor = 0xffffff;
  6086. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  6087. }
  6088. } else
  6089. {
  6090. class9.message = "";
  6091. }
  6092. if(j == 650 || j == 655)
  6093. if(anInt1193 != 0)
  6094. {
  6095. String s;
  6096. if(daysSinceLastLogin == 0)
  6097. s = "earlier today";
  6098. else
  6099. if(daysSinceLastLogin == 1)
  6100. s = "yesterday";
  6101. else
  6102. s = daysSinceLastLogin + " days ago";
  6103. class9.message = "You last logged in " + s + " from: " + signlink.dns;
  6104. } else
  6105. {
  6106. class9.message = "";
  6107. }
  6108. if(j == 651)
  6109. {
  6110. if(unreadMessages == 0)
  6111. {
  6112. class9.message = "0 unread messages";
  6113. class9.textColor = 0xffff00;
  6114. }
  6115. if(unreadMessages == 1)
  6116. {
  6117. class9.message = "1 unread message";
  6118. class9.textColor = 65280;
  6119. }
  6120. if(unreadMessages > 1)
  6121. {
  6122. class9.message = unreadMessages + " unread messages";
  6123. class9.textColor = 65280;
  6124. }
  6125. }
  6126. if(j == 652)
  6127. if(daysSinceRecovChange == 201)
  6128. {
  6129. if(membersInt == 1)
  6130. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  6131. else
  6132. class9.message = "";
  6133. } else
  6134. if(daysSinceRecovChange == 200)
  6135. {
  6136. class9.message = "You have not yet set any password recovery questions.";
  6137. } else
  6138. {
  6139. String s1;
  6140. if(daysSinceRecovChange == 0)
  6141. s1 = "Earlier today";
  6142. else
  6143. if(daysSinceRecovChange == 1)
  6144. s1 = "Yesterday";
  6145. else
  6146. s1 = daysSinceRecovChange + " days ago";
  6147. class9.message = s1 + " you changed your recovery questions";
  6148. }
  6149. if(j == 653)
  6150. if(daysSinceRecovChange == 201)
  6151. {
  6152. if(membersInt == 1)
  6153. class9.message = "@whi@recommend you use a members world instead. You may use";
  6154. else
  6155. class9.message = "";
  6156. } else
  6157. if(daysSinceRecovChange == 200)
  6158. class9.message = "We strongly recommend you do so now to secure your account.";
  6159. else
  6160. class9.message = "If you do not remember making this change then cancel it immediately";
  6161. if(j == 654)
  6162. {
  6163. if(daysSinceRecovChange == 201)
  6164. if(membersInt == 1)
  6165. {
  6166. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  6167. return;
  6168. } else
  6169. {
  6170. class9.message = "";
  6171. return;
  6172. }
  6173. if(daysSinceRecovChange == 200)
  6174. {
  6175. class9.message = "Do this from the 'account management' area on our front webpage";
  6176. return;
  6177. }
  6178. class9.message = "Do this from the 'account management' area on our front webpage";
  6179. }
  6180. }
  6181.  
  6182. private void drawSplitPrivateChat()
  6183. {
  6184. if(splitPrivateChat == 0)
  6185. return;
  6186. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  6187. int i = 0;
  6188. if(anInt1104 != 0)
  6189. i = 1;
  6190. for(int j = 0; j < 100; j++)
  6191. if(chatMessages[j] != null)
  6192. {
  6193. int k = chattypes[j];
  6194. String s = chatNames[j];
  6195. byte byte1 = 0;
  6196. if(s != null && s.startsWith("@cr0@")) {
  6197. s = s.substring(5);
  6198. byte1 = 1;
  6199. }
  6200. if(s != null && s.startsWith("@cr1@")) {
  6201. s = s.substring(5);
  6202. byte1 = 1;
  6203. }
  6204. if(s != null && s.startsWith("@cr2@")) {
  6205. s = s.substring(5);
  6206. byte1 = 2;
  6207. }
  6208. if(s != null && s.startsWith("@cr3@")) {
  6209. s = s.substring(5);
  6210. byte1 = 3;
  6211. }
  6212. if(s != null && s.startsWith("@cr4@")) {
  6213. s = s.substring(5);
  6214. byte1 = 4;
  6215. }
  6216. if(s != null && s.startsWith("@cr5@")) {
  6217. s = s.substring(5);
  6218. byte1 = 5;
  6219. }
  6220. if(s != null && s.startsWith("@cr6@")) {
  6221. s = s.substring(5);
  6222. byte1 = 6;
  6223. }
  6224. if(s != null && s.startsWith("@cr7@")) {
  6225. s = s.substring(5);
  6226. byte1 = 7;
  6227. }
  6228. if(s != null && s.startsWith("@cr8@")) {
  6229. s = s.substring(5);
  6230. byte1 = 8;
  6231. }
  6232. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6233. {
  6234. int l = 329 - i * 13;
  6235. int k1 = 4;
  6236. textDrawingArea.method385(0, "From", l, k1);
  6237. textDrawingArea.method385(getChatColor(), "From", l - 1, k1);
  6238. k1 += textDrawingArea.getTextWidth("From ");
  6239. if(byte1 == 1)
  6240. {
  6241. modIcons[0].drawbackground(k1, l - 12);
  6242. k1 += 12;
  6243. }
  6244. if(byte1 == 2) {
  6245. modIcons[1].drawbackground(k1, l - 12);
  6246. k1 += 12;
  6247. }
  6248. if(byte1 == 3) {
  6249. modIcons[2].drawbackground(k1, l - 12);
  6250. k1 += 12;
  6251. }
  6252. if(byte1 == 4) {
  6253. modIcons[3].drawbackground(k1, l - 12);
  6254. k1 += 12;
  6255. }
  6256. if(byte1 == 5) {
  6257. modIcons[4].drawbackground(k1, l - 12);
  6258. k1 += 12;
  6259. }
  6260. if(byte1 == 6) {
  6261. modIcons[5].drawbackground(k1, l - 12);
  6262. k1 += 12;
  6263. }
  6264. if(byte1 == 7) {
  6265. modIcons[6].drawbackground(k1, l - 12);
  6266. k1 += 12;
  6267. }
  6268. if(byte1 == 8) {
  6269. modIcons[7].drawbackground(k1, l - 12);
  6270. k1 += 12;
  6271. }
  6272. if(byte1 == 9) {
  6273. modIcons[8].drawbackground(k1, l - 12);
  6274. k1 += 12;
  6275. }
  6276. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  6277. textDrawingArea.method385(getChatColor(), s + ": " + chatMessages[j], l - 1, k1);
  6278. if(++i >= 5)
  6279. return;
  6280. }
  6281. if(k == 5 && privateChatMode < 2)
  6282. {
  6283. int i1 = 329 - i * 13;
  6284. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  6285. textDrawingArea.method385(getChatColor(), chatMessages[j], i1 - 1, 4);
  6286. if(++i >= 5)
  6287. return;
  6288. }
  6289. if(k == 6 && privateChatMode < 2)
  6290. {
  6291. int j1 = 329 - i * 13;
  6292. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  6293. textDrawingArea.method385(getChatColor(), "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  6294. if(++i >= 5)
  6295. return;
  6296. }
  6297. }
  6298.  
  6299. }
  6300.  
  6301. public void pushMessage(String s, int i, String s1) {
  6302. if(i == 0 && dialogID != -1) {
  6303. aString844 = s;
  6304. super.clickMode3 = 0;
  6305. }
  6306. if(backDialogID == -1)
  6307. inputTaken = true;
  6308. for(int j = 499; j > 0; j--) {
  6309. chattypes[j] = chattypes[j - 1];
  6310. chatNames[j] = chatNames[j - 1];
  6311. chatMessages[j] = chatMessages[j - 1];
  6312. chatRights[j] = chatRights[j - 1];
  6313. }
  6314. chattypes[0] = i;
  6315. chatNames[0] = s1;
  6316. chatMessages[0] = s;
  6317. chatRights[0] = rights;
  6318. }
  6319.  
  6320. public static void setTab(int id) {
  6321. needDrawTabArea = true;
  6322. tabID = id;
  6323. tabAreaAltered = true;
  6324. }
  6325.  
  6326. private void processTabClick() {
  6327. if(super.clickMode3 == 1) {
  6328. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  6329. {
  6330. needDrawTabArea = true;
  6331. tabID = 0;
  6332. tabAreaAltered = true;
  6333. }
  6334. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  6335. {
  6336. needDrawTabArea = true;
  6337. tabID = 1;
  6338. tabAreaAltered = true;
  6339. }
  6340. if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  6341. {
  6342. needDrawTabArea = true;
  6343. tabID = 2;
  6344. tabAreaAltered = true;
  6345. }
  6346. if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  6347. {
  6348. needDrawTabArea = true;
  6349. tabID = 3;
  6350. tabAreaAltered = true;
  6351. }
  6352. if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  6353. {
  6354. needDrawTabArea = true;
  6355. tabID = 4;
  6356. tabAreaAltered = true;
  6357. }
  6358. if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  6359. {
  6360. needDrawTabArea = true;
  6361. tabID = 5;
  6362. tabAreaAltered = true;
  6363. }
  6364. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  6365. {
  6366. needDrawTabArea = true;
  6367. tabID = 6;
  6368. tabAreaAltered = true;
  6369. }
  6370. if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  6371. {
  6372. needDrawTabArea = true;
  6373. tabID = 7;
  6374. tabAreaAltered = true;
  6375. }
  6376. if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  6377. {
  6378. needDrawTabArea = true;
  6379. tabID = 8;
  6380. tabAreaAltered = true;
  6381. }
  6382. if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  6383. {
  6384. needDrawTabArea = true;
  6385. tabID = 9;
  6386. tabAreaAltered = true;
  6387. }
  6388. if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[10] != -1)
  6389. {
  6390. needDrawTabArea = true;
  6391. tabID = 10;
  6392. tabAreaAltered = true;
  6393. }
  6394. if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  6395. {
  6396. needDrawTabArea = true;
  6397. tabID = 11;
  6398. tabAreaAltered = true;
  6399. }
  6400. if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  6401. {
  6402. needDrawTabArea = true;
  6403. tabID = 12;
  6404. tabAreaAltered = true;
  6405. }
  6406. if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  6407. {
  6408. needDrawTabArea = true;
  6409. tabID = 13;
  6410. tabAreaAltered = true;
  6411. }
  6412. }
  6413. }
  6414.  
  6415. private void resetImageProducers2() {
  6416. if(aRSImageProducer_1166 != null)
  6417. return;
  6418. nullLoader();
  6419. super.fullGameScreen = null;
  6420. aRSImageProducer_1107 = null;
  6421. aRSImageProducer_1108 = null;
  6422. aRSImageProducer_1109 = null;
  6423. aRSImageProducer_1110 = null;
  6424. aRSImageProducer_1111 = null;
  6425. aRSImageProducer_1112 = null;
  6426. aRSImageProducer_1113 = null;
  6427. aRSImageProducer_1114 = null;
  6428. aRSImageProducer_1115 = null;
  6429. aRSImageProducer_1166 = new RSImageProducer(519, 165, getGameComponent());
  6430. aRSImageProducer_1164 = new RSImageProducer(246, 164, getGameComponent());
  6431. DrawingArea.setAllPixelsToZero();
  6432. mapBack.drawBackground(0, 0);
  6433. aRSImageProducer_1163 = new RSImageProducer(246, 335, getGameComponent());
  6434. aRSImageProducer_1165 = new RSImageProducer(512, 334, getGameComponent());
  6435. DrawingArea.setAllPixelsToZero();
  6436. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  6437. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  6438. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  6439. welcomeScreenRaised = true;
  6440. }
  6441.  
  6442. public String getDocumentBaseHost() {
  6443. if (signlink.mainapp != null) {
  6444. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  6445. }
  6446. if (super.gameFrame != null) {
  6447. return ""; // runescape.com <- removed for Jframe to work
  6448. } else {
  6449. return ""; // super.getDocumentBase().getHost().toLowerCase() <- removed for Jframe to work
  6450. }
  6451. }
  6452.  
  6453. private void method81(Sprite sprite, int j, int k) {
  6454. int l = k * k + j * j;
  6455. if(l > 4225 && l < 0x15f90) {
  6456. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  6457. int j1 = Model.modelIntArray1[i1];
  6458. int k1 = Model.modelIntArray2[i1];
  6459. j1 = (j1 * 256) / (minimapInt3 + 256);
  6460. k1 = (k1 * 256) / (minimapInt3 + 256);
  6461. int l1 = j * j1 + k * k1 >> 16;
  6462. int i2 = j * k1 - k * j1 >> 16;
  6463. double d = Math.atan2(l1, i2);
  6464. int j2 = (int)(Math.sin(d) * 63D);
  6465. int k2 = (int)(Math.cos(d) * 57D);
  6466. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  6467. } else {
  6468. markMinimap(sprite, k, j);
  6469. }
  6470. }
  6471.  
  6472. private void rightClickChatButtons() {
  6473. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  6474. menuActionName[1] = "View All";
  6475. menuActionID[1] = 999;
  6476. menuActionRow = 2;
  6477. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  6478. menuActionName[1] = "View Game";
  6479. menuActionID[1] = 998;
  6480. menuActionRow = 2;
  6481. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  6482. menuActionName[1] = "Hide public";
  6483. menuActionID[1] = 997;
  6484. menuActionName[2] = "Off public";
  6485. menuActionID[2] = 996;
  6486. menuActionName[3] = "Friends public";
  6487. menuActionID[3] = 995;
  6488. menuActionName[4] = "On public";
  6489. menuActionID[4] = 994;
  6490. menuActionName[5] = "View public";
  6491. menuActionID[5] = 993;
  6492. menuActionRow = 6;
  6493. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  6494. menuActionName[1] = "Off private";
  6495. menuActionID[1] = 992;
  6496. menuActionName[2] = "Friends private";
  6497. menuActionID[2] = 991;
  6498. menuActionName[3] = "On private";
  6499. menuActionID[3] = 990;
  6500. menuActionName[4] = "View private";
  6501. menuActionID[4] = 989;
  6502. menuActionRow = 5;
  6503. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  6504. menuActionName[1] = "Off clan chat";
  6505. menuActionID[1] = 1003;
  6506. menuActionName[2] = "Friends clan chat";
  6507. menuActionID[2] = 1002;
  6508. menuActionName[3] = "On clan chat";
  6509. menuActionID[3] = 1001;
  6510. menuActionName[4] = "View clan chat";
  6511. menuActionID[4] = 1000;
  6512. menuActionRow = 5;
  6513. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  6514. menuActionName[1] = "Off trade";
  6515. menuActionID[1] = 987;
  6516. menuActionName[2] = "Friends trade";
  6517. menuActionID[2] = 986;
  6518. menuActionName[3] = "On trade";
  6519. menuActionID[3] = 985;
  6520. menuActionName[4] = "View trade";
  6521. menuActionID[4] = 984;
  6522. menuActionRow = 5;
  6523. }
  6524. }
  6525.  
  6526. public void processRightClick() {
  6527. if (activeInterfacetype != 0) {
  6528. return;
  6529. }
  6530. menuActionName[0] = "Cancel";
  6531. menuActionID[0] = 1107;
  6532. menuActionRow = 1;
  6533. if (fullscreenInterfaceID != -1) {
  6534. anInt886 = 0;
  6535. anInt1315 = 0;
  6536. buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  6537. if (anInt886 != anInt1026) {
  6538. anInt1026 = anInt886;
  6539. }
  6540. if (anInt1315 != anInt1129) {
  6541. anInt1129 = anInt1315;
  6542. }
  6543. return;
  6544. }
  6545. buildSplitPrivateChatMenu();
  6546. anInt886 = 0;
  6547. anInt1315 = 0;
  6548. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338) {
  6549. if (openInterfaceID != -1) {
  6550. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  6551. } else {
  6552. build3dScreenMenu();
  6553. }
  6554. }
  6555. if (anInt886 != anInt1026) {
  6556. anInt1026 = anInt886;
  6557. }
  6558. if (anInt1315 != anInt1129) {
  6559. anInt1129 = anInt1315;
  6560. }
  6561. anInt886 = 0;
  6562. anInt1315 = 0;
  6563. if(super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468) {
  6564. if(invOverlayInterfaceID != -1) {
  6565. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  6566. } else if(tabInterfaceIDs[tabID] != -1) {
  6567. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  6568. }
  6569. }
  6570. if (anInt886 != anInt1048) {
  6571. needDrawTabArea = true;
  6572. tabAreaAltered = true;
  6573. anInt1048 = anInt886;
  6574. }
  6575. if (anInt1315 != anInt1044) {
  6576. needDrawTabArea = true;
  6577. tabAreaAltered = true;
  6578. anInt1044 = anInt1315;
  6579. }
  6580. anInt886 = 0;
  6581. anInt1315 = 0;
  6582. if(super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  6583. if(backDialogID != -1) {
  6584. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  6585. } else if(super.mouseY < 463 && super.mouseX < 490) {
  6586. buildChatAreaMenu(super.mouseY - 338);
  6587. }
  6588. }
  6589. if (backDialogID != -1 && anInt886 != anInt1039) {
  6590. inputTaken = true;
  6591. anInt1039 = anInt886;
  6592. }
  6593. if (backDialogID != -1 && anInt1315 != anInt1500) {
  6594. inputTaken = true;
  6595. anInt1500 = anInt1315;
  6596. }
  6597. /* Enable custom right click areas */
  6598. if(super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 && super.mouseY < 503)
  6599. rightClickChatButtons();
  6600. /**/
  6601. boolean flag = false;
  6602. while (!flag) {
  6603. flag = true;
  6604. for (int j = 0; j < menuActionRow - 1; j++) {
  6605. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  6606. String s = menuActionName[j];
  6607. menuActionName[j] = menuActionName[j + 1];
  6608. menuActionName[j + 1] = s;
  6609. int k = menuActionID[j];
  6610. menuActionID[j] = menuActionID[j + 1];
  6611. menuActionID[j + 1] = k;
  6612. k = menuActionCmd2[j];
  6613. menuActionCmd2[j] = menuActionCmd2[j + 1];
  6614. menuActionCmd2[j + 1] = k;
  6615. k = menuActionCmd3[j];
  6616. menuActionCmd3[j] = menuActionCmd3[j + 1];
  6617. menuActionCmd3[j + 1] = k;
  6618. k = menuActionCmd1[j];
  6619. menuActionCmd1[j] = menuActionCmd1[j + 1];
  6620. menuActionCmd1[j + 1] = k;
  6621. flag = false;
  6622. }
  6623. }
  6624. }
  6625. }
  6626.  
  6627. private int method83(int i, int j, int k)
  6628. {
  6629. int l = 256 - k;
  6630. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  6631. }
  6632.  
  6633. private void login(String s, String s1, boolean flag)
  6634. {
  6635. signlink.errorname = s;
  6636. try
  6637. {
  6638. if(!flag)
  6639. {
  6640. loginMessage1 = "";
  6641. loginMessage2 = "Connecting to server...";
  6642. drawLoginScreen(true);
  6643. }
  6644. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  6645. long l = TextClass.longForName(s);
  6646. int i = (int)(l >> 16 & 31L);
  6647. stream.currentOffset = 0;
  6648. stream.writeWordBigEndian(14);
  6649. stream.writeWordBigEndian(i);
  6650. socketStream.queueBytes(2, stream.buffer);
  6651. for(int j = 0; j < 8; j++)
  6652. socketStream.read();
  6653.  
  6654. int k = socketStream.read();
  6655. int i1 = k;
  6656. if(k == 0)
  6657. {
  6658. socketStream.flushInputStream(inStream.buffer, 8);
  6659. inStream.currentOffset = 0;
  6660. aLong1215 = inStream.readQWord();
  6661. int ai[] = new int[4];
  6662. ai[0] = (int)(Math.random() * 99999999D);
  6663. ai[1] = (int)(Math.random() * 99999999D);
  6664. ai[2] = (int)(aLong1215 >> 32);
  6665. ai[3] = (int)aLong1215;
  6666. stream.currentOffset = 0;
  6667. stream.writeWordBigEndian(10);
  6668. stream.writeDWord(ai[0]);
  6669. stream.writeDWord(ai[1]);
  6670. stream.writeDWord(ai[2]);
  6671. stream.writeDWord(ai[3]);
  6672. stream.writeDWord(/*signlink.uid*/999999);
  6673. stream.writeString(s);
  6674. stream.writeString(s1);
  6675. stream.doKeys();
  6676. aStream_847.currentOffset = 0;
  6677. if(flag)
  6678. aStream_847.writeWordBigEndian(18);
  6679. else
  6680. aStream_847.writeWordBigEndian(16);
  6681. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  6682. aStream_847.writeWordBigEndian(255);
  6683. aStream_847.writeWord(317);
  6684. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  6685. for(int l1 = 0; l1 < 9; l1++)
  6686. aStream_847.writeDWord(expectedCRCs[l1]);
  6687.  
  6688. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  6689. stream.encryption = new ISAACRandomGen(ai);
  6690. for(int j2 = 0; j2 < 4; j2++)
  6691. ai[j2] += 50;
  6692.  
  6693. encryption = new ISAACRandomGen(ai);
  6694. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  6695. k = socketStream.read();
  6696. }
  6697. if(k == 1)
  6698. {
  6699. try
  6700. {
  6701. Thread.sleep(2000L);
  6702. }
  6703. catch(Exception _ex) { }
  6704. login(s, s1, flag);
  6705. return;
  6706. }
  6707. if(k == 2)
  6708. {
  6709. myPrivilege = socketStream.read();
  6710. flagged = socketStream.read() == 1;
  6711. aLong1220 = 0L;
  6712. anInt1022 = 0;
  6713. mouseDetection.coordsIndex = 0;
  6714. super.awtFocus = true;
  6715. aBoolean954 = true;
  6716. loggedIn = true;
  6717. stream.currentOffset = 0;
  6718. inStream.currentOffset = 0;
  6719. pkttype = -1;
  6720. anInt841 = -1;
  6721. anInt842 = -1;
  6722. anInt843 = -1;
  6723. pktSize = 0;
  6724. anInt1009 = 0;
  6725. anInt1104 = 0;
  6726. anInt1011 = 0;
  6727. anInt855 = 0;
  6728. menuActionRow = 0;
  6729. menuOpen = false;
  6730. super.idleTime = 0;
  6731. for(int j1 = 0; j1 < 100; j1++)
  6732. chatMessages[j1] = null;
  6733.  
  6734. itemSelected = 0;
  6735. spellSelected = 0;
  6736. loadingStage = 0;
  6737. anInt1062 = 0;
  6738. anInt1278 = (int)(Math.random() * 100D) - 50;
  6739. anInt1131 = (int)(Math.random() * 110D) - 55;
  6740. anInt896 = (int)(Math.random() * 80D) - 40;
  6741. minimapInt2 = (int)(Math.random() * 120D) - 60;
  6742. minimapInt3 = (int)(Math.random() * 30D) - 20;
  6743. minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
  6744. anInt1021 = 0;
  6745. anInt985 = -1;
  6746. destX = 0;
  6747. destY = 0;
  6748. playerCount = 0;
  6749. npcCount = 0;
  6750. for(int i2 = 0; i2 < maxPlayers; i2++)
  6751. {
  6752. playerArray[i2] = null;
  6753. aStreamArray895s[i2] = null;
  6754. }
  6755.  
  6756. for(int k2 = 0; k2 < 16384; k2++)
  6757. npcArray[k2] = null;
  6758.  
  6759. myPlayer = playerArray[myPlayerIndex] = new Player();
  6760. aClass19_1013.removeAll();
  6761. aClass19_1056.removeAll();
  6762. for(int l2 = 0; l2 < 4; l2++)
  6763. {
  6764. for(int i3 = 0; i3 < 104; i3++)
  6765. {
  6766. for(int k3 = 0; k3 < 104; k3++)
  6767. groundArray[l2][i3][k3] = null;
  6768.  
  6769. }
  6770.  
  6771. }
  6772.  
  6773. aClass19_1179 = new NodeList();
  6774. fullscreenInterfaceID = -1;
  6775. anInt900 = 0;
  6776. friendsCount = 0;
  6777. dialogID = -1;
  6778. backDialogID = -1;
  6779. openInterfaceID = -1;
  6780. invOverlayInterfaceID = -1;
  6781. anInt1018 = -1;
  6782. aBoolean1149 = false;
  6783. tabID = 3;
  6784. inputDialogState = 0;
  6785. menuOpen = false;
  6786. messagePromptRaised = false;
  6787. aString844 = null;
  6788. anInt1055 = 0;
  6789. anInt1054 = -1;
  6790. aBoolean1047 = true;
  6791. method45();
  6792. for(int j3 = 0; j3 < 5; j3++)
  6793. anIntArray990[j3] = 0;
  6794.  
  6795. for(int l3 = 0; l3 < 5; l3++)
  6796. {
  6797. atPlayerActions[l3] = null;
  6798. atPlayerArray[l3] = false;
  6799. }
  6800.  
  6801. anInt1175 = 0;
  6802. anInt1134 = 0;
  6803. anInt986 = 0;
  6804. anInt1288 = 0;
  6805. anInt924 = 0;
  6806. anInt1188 = 0;
  6807. anInt1155 = 0;
  6808. anInt1226 = 0;
  6809. int anInt941 = 0;
  6810. int anInt1260 = 0;
  6811. resetImageProducers2();
  6812. return;
  6813. }
  6814. if(k == 3)
  6815. {
  6816. loginMessage1 = "";
  6817. loginMessage2 = "Invalid username or password.";
  6818. return;
  6819. }
  6820. if(k == 4)
  6821. {
  6822. loginMessage1 = "Your account has been disabled.";
  6823. loginMessage2 = "Please check your message-center for details.";
  6824. return;
  6825. }
  6826. if(k == 5)
  6827. {
  6828. loginMessage1 = "Your account is already logged in.";
  6829. loginMessage2 = "Try again in 60 secs...";
  6830. return;
  6831. }
  6832. if(k == 6)
  6833. {
  6834. loginMessage1 = "HyBriD PvP has been updated!";
  6835. loginMessage2 = "Please reload this page.";
  6836. return;
  6837. }
  6838. if(k == 7)
  6839. {
  6840. loginMessage1 = "This world is full.";
  6841. loginMessage2 = "Please use a different world.";
  6842. return;
  6843. }
  6844. if(k == 8)
  6845. {
  6846. loginMessage1 = "Unable to connect.";
  6847. loginMessage2 = "Login server offline.";
  6848. return;
  6849. }
  6850. if(k == 9)
  6851. {
  6852. loginMessage1 = "Login limit exceeded.";
  6853. loginMessage2 = "Too many connections from your address.";
  6854. return;
  6855. }
  6856. if(k == 10)
  6857. {
  6858. loginMessage1 = "Unable to connect.";
  6859. loginMessage2 = "Bad session id.";
  6860. return;
  6861. }
  6862. if(k == 11)
  6863. {
  6864. loginMessage2 = "Login server rejected session.";
  6865. loginMessage2 = "Please try again.";
  6866. return;
  6867. }
  6868. if(k == 12)
  6869. {
  6870. loginMessage1 = "You need a members account to login to this world.";
  6871. loginMessage2 = "Please subscribe, or use a different world.";
  6872. return;
  6873. }
  6874. if(k == 13)
  6875. {
  6876. loginMessage1 = "Could not complete login.";
  6877. loginMessage2 = "Please try using a different world.";
  6878. return;
  6879. }
  6880. if(k == 14)
  6881. {
  6882. loginMessage1 = "The server is being updated.";
  6883. loginMessage2 = "Please wait 1 minute and try again.";
  6884. return;
  6885. }
  6886. if(k == 15)
  6887. {
  6888. loggedIn = true;
  6889. stream.currentOffset = 0;
  6890. inStream.currentOffset = 0;
  6891. pkttype = -1;
  6892. anInt841 = -1;
  6893. anInt842 = -1;
  6894. anInt843 = -1;
  6895. pktSize = 0;
  6896. anInt1009 = 0;
  6897. anInt1104 = 0;
  6898. menuActionRow = 0;
  6899. menuOpen = false;
  6900. aLong824 = System.currentTimeMillis();
  6901. return;
  6902. }
  6903. if(k == 16)
  6904. {
  6905. loginMessage1 = "Login attempts exceeded.";
  6906. loginMessage2 = "Please wait 1 minute and try again.";
  6907. return;
  6908. }
  6909. if(k == 17)
  6910. {
  6911. loginMessage1 = "You are standing in a members-only area.";
  6912. loginMessage2 = "To play on this world move to a free area first";
  6913. return;
  6914. }
  6915. if(k == 20)
  6916. {
  6917. loginMessage1 = "Invalid loginserver requested";
  6918. loginMessage2 = "Please try using a different world.";
  6919. return;
  6920. }
  6921. if(k == 21)
  6922. {
  6923. for(int k1 = socketStream.read(); k1 >= 0; k1--)
  6924. {
  6925. loginMessage1 = "You have only just left another world";
  6926. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  6927. drawLoginScreen(true);
  6928. try
  6929. {
  6930. Thread.sleep(1000L);
  6931. }
  6932. catch(Exception _ex) { }
  6933. }
  6934.  
  6935. login(s, s1, flag);
  6936. return;
  6937. }
  6938. if(k == -1)
  6939. {
  6940. if(i1 == 0)
  6941. {
  6942. if(loginFailures < 2)
  6943. {
  6944. try
  6945. {
  6946. Thread.sleep(2000L);
  6947. }
  6948. catch(Exception _ex) { }
  6949. loginFailures++;
  6950. login(s, s1, flag);
  6951. return;
  6952. } else
  6953. {
  6954. loginMessage1 = "No response from loginserver";
  6955. loginMessage2 = "Please wait 1 minute and try again.";
  6956. return;
  6957. }
  6958. } else
  6959. {
  6960. loginMessage1 = "No response from server";
  6961. loginMessage2 = "Please try using a different world.";
  6962. return;
  6963. }
  6964. } else
  6965. {
  6966. System.out.println("response:" + k);
  6967. loginMessage1 = "Unexpected server response";
  6968. loginMessage2 = "Please try using a different world.";
  6969. return;
  6970. }
  6971. }
  6972. catch(IOException _ex)
  6973. {
  6974. loginMessage1 = "";
  6975. }
  6976. loginMessage2 = "Error connecting to server.";
  6977. }
  6978.  
  6979. 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) {
  6980. byte byte0 = 104;
  6981. byte byte1 = 104;
  6982. for(int l2 = 0; l2 < byte0; l2++) {
  6983. for(int i3 = 0; i3 < byte1; i3++) {
  6984. anIntArrayArray901[l2][i3] = 0;
  6985. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  6986. }
  6987. }
  6988. int j3 = j2;
  6989. int k3 = j1;
  6990. anIntArrayArray901[j2][j1] = 99;
  6991. anIntArrayArray825[j2][j1] = 0;
  6992. int l3 = 0;
  6993. int i4 = 0;
  6994. bigX[l3] = j2;
  6995. bigY[l3++] = j1;
  6996. boolean flag1 = false;
  6997. int j4 = bigX.length;
  6998. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  6999. while(i4 != l3)
  7000. {
  7001. j3 = bigX[i4];
  7002. k3 = bigY[i4];
  7003. i4 = (i4 + 1) % j4;
  7004. if(j3 == k2 && k3 == i2)
  7005. {
  7006. flag1 = true;
  7007. break;
  7008. }
  7009. if(i1 != 0)
  7010. {
  7011. if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  7012. {
  7013. flag1 = true;
  7014. break;
  7015. }
  7016. if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  7017. {
  7018. flag1 = true;
  7019. break;
  7020. }
  7021. }
  7022. if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  7023. {
  7024. flag1 = true;
  7025. break;
  7026. }
  7027. int l4 = anIntArrayArray825[j3][k3] + 1;
  7028. if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  7029. {
  7030. bigX[l3] = j3 - 1;
  7031. bigY[l3] = k3;
  7032. l3 = (l3 + 1) % j4;
  7033. anIntArrayArray901[j3 - 1][k3] = 2;
  7034. anIntArrayArray825[j3 - 1][k3] = l4;
  7035. }
  7036. if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  7037. {
  7038. bigX[l3] = j3 + 1;
  7039. bigY[l3] = k3;
  7040. l3 = (l3 + 1) % j4;
  7041. anIntArrayArray901[j3 + 1][k3] = 8;
  7042. anIntArrayArray825[j3 + 1][k3] = l4;
  7043. }
  7044. if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  7045. {
  7046. bigX[l3] = j3;
  7047. bigY[l3] = k3 - 1;
  7048. l3 = (l3 + 1) % j4;
  7049. anIntArrayArray901[j3][k3 - 1] = 1;
  7050. anIntArrayArray825[j3][k3 - 1] = l4;
  7051. }
  7052. if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  7053. {
  7054. bigX[l3] = j3;
  7055. bigY[l3] = k3 + 1;
  7056. l3 = (l3 + 1) % j4;
  7057. anIntArrayArray901[j3][k3 + 1] = 4;
  7058. anIntArrayArray825[j3][k3 + 1] = l4;
  7059. }
  7060. 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)
  7061. {
  7062. bigX[l3] = j3 - 1;
  7063. bigY[l3] = k3 - 1;
  7064. l3 = (l3 + 1) % j4;
  7065. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  7066. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  7067. }
  7068. 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)
  7069. {
  7070. bigX[l3] = j3 + 1;
  7071. bigY[l3] = k3 - 1;
  7072. l3 = (l3 + 1) % j4;
  7073. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  7074. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  7075. }
  7076. 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)
  7077. {
  7078. bigX[l3] = j3 - 1;
  7079. bigY[l3] = k3 + 1;
  7080. l3 = (l3 + 1) % j4;
  7081. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  7082. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  7083. }
  7084. 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)
  7085. {
  7086. bigX[l3] = j3 + 1;
  7087. bigY[l3] = k3 + 1;
  7088. l3 = (l3 + 1) % j4;
  7089. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  7090. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  7091. }
  7092. }
  7093. anInt1264 = 0;
  7094. if(!flag1)
  7095. {
  7096. if(flag)
  7097. {
  7098. int i5 = 100;
  7099. for(int k5 = 1; k5 < 2; k5++)
  7100. {
  7101. for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  7102. {
  7103. for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  7104. if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  7105. {
  7106. i5 = anIntArrayArray825[i6][l6];
  7107. j3 = i6;
  7108. k3 = l6;
  7109. anInt1264 = 1;
  7110. flag1 = true;
  7111. }
  7112.  
  7113. }
  7114.  
  7115. if(flag1)
  7116. break;
  7117. }
  7118.  
  7119. }
  7120. if(!flag1)
  7121. return false;
  7122. }
  7123. i4 = 0;
  7124. bigX[i4] = j3;
  7125. bigY[i4++] = k3;
  7126. int l5;
  7127. for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  7128. {
  7129. if(j5 != l5)
  7130. {
  7131. l5 = j5;
  7132. bigX[i4] = j3;
  7133. bigY[i4++] = k3;
  7134. }
  7135. if((j5 & 2) != 0)
  7136. j3++;
  7137. else
  7138. if((j5 & 8) != 0)
  7139. j3--;
  7140. if((j5 & 1) != 0)
  7141. k3++;
  7142. else
  7143. if((j5 & 4) != 0)
  7144. k3--;
  7145. }
  7146. // if(cancelWalk) { return i4 > 0; }
  7147.  
  7148.  
  7149. if(i4 > 0)
  7150. {
  7151. int k4 = i4;
  7152. if(k4 > 25)
  7153. k4 = 25;
  7154. i4--;
  7155. int k6 = bigX[i4];
  7156. int i7 = bigY[i4];
  7157. anInt1288 += k4;
  7158. if(anInt1288 >= 92)
  7159. {
  7160. stream.createFrame(36);
  7161. stream.writeDWord(0);
  7162. anInt1288 = 0;
  7163. }
  7164. if(i == 0)
  7165. {
  7166. stream.createFrame(164);
  7167. stream.writeWordBigEndian(k4 + k4 + 3);
  7168. }
  7169. if(i == 1)
  7170. {
  7171. stream.createFrame(248);
  7172. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  7173. }
  7174. if(i == 2)
  7175. {
  7176. stream.createFrame(98);
  7177. stream.writeWordBigEndian(k4 + k4 + 3);
  7178. }
  7179. stream.method433(k6 + baseX);
  7180. destX = bigX[0];
  7181. destY = bigY[0];
  7182. for(int j7 = 1; j7 < k4; j7++)
  7183. {
  7184. i4--;
  7185. stream.writeWordBigEndian(bigX[i4] - k6);
  7186. stream.writeWordBigEndian(bigY[i4] - i7);
  7187. }
  7188.  
  7189. stream.method431(i7 + baseY);
  7190. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  7191. return true;
  7192. }
  7193. return i != 1;
  7194. }
  7195.  
  7196. private void method86(Stream stream)
  7197. {
  7198. for(int j = 0; j < anInt893; j++)
  7199. {
  7200. int k = anIntArray894[j];
  7201. NPC npc = npcArray[k];
  7202. int l = stream.readUnsignedByte();
  7203. if((l & 0x10) != 0)
  7204. {
  7205. int i1 = stream.method434();
  7206. if(i1 == 65535)
  7207. i1 = -1;
  7208. int i2 = stream.readUnsignedByte();
  7209. if(i1 == npc.anim && i1 != -1)
  7210. {
  7211. int l2 = Animation.anims[i1].anInt365;
  7212. if(l2 == 1)
  7213. {
  7214. npc.anInt1527 = 0;
  7215. npc.anInt1528 = 0;
  7216. npc.anInt1529 = i2;
  7217. npc.anInt1530 = 0;
  7218. }
  7219. if(l2 == 2)
  7220. npc.anInt1530 = 0;
  7221. } else
  7222. if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  7223. {
  7224. npc.anim = i1;
  7225. npc.anInt1527 = 0;
  7226. npc.anInt1528 = 0;
  7227. npc.anInt1529 = i2;
  7228. npc.anInt1530 = 0;
  7229. npc.anInt1542 = npc.smallXYIndex;
  7230. }
  7231. }
  7232. if((l & 8) != 0)
  7233. {
  7234. int j1 = stream.method426();
  7235. int j2 = stream.method427();
  7236. npc.updateHitData(j2, j1, loopCycle);
  7237. npc.loopCycleStatus = loopCycle + 300;
  7238. npc.currentHealth = stream.method426();
  7239. npc.maxHealth = stream.readUnsignedByte();
  7240. }
  7241. if((l & 0x80) != 0)
  7242. {
  7243. npc.anInt1520 = stream.readUnsignedWord();
  7244. int k1 = stream.readDWord();
  7245. npc.anInt1524 = k1 >> 16;
  7246. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  7247. npc.anInt1521 = 0;
  7248. npc.anInt1522 = 0;
  7249. if(npc.anInt1523 > loopCycle)
  7250. npc.anInt1521 = -1;
  7251. if(npc.anInt1520 == 65535)
  7252. npc.anInt1520 = -1;
  7253. }
  7254. if((l & 0x20) != 0)
  7255. {
  7256. npc.interactingEntity = stream.readUnsignedWord();
  7257. if(npc.interactingEntity == 65535)
  7258. npc.interactingEntity = -1;
  7259. }
  7260. if((l & 1) != 0)
  7261. {
  7262. npc.textSpoken = stream.readString();
  7263. npc.textCycle = 100;
  7264. // entityMessage(npc);
  7265.  
  7266. }
  7267. if((l & 0x40) != 0)
  7268. {
  7269. int l1 = stream.method427();
  7270. int k2 = stream.method428();
  7271. npc.updateHitData(k2, l1, loopCycle);
  7272. npc.loopCycleStatus = loopCycle + 300;
  7273. npc.currentHealth = stream.method428();
  7274. npc.maxHealth = stream.method427();
  7275. }
  7276. if((l & 2) != 0)
  7277. {
  7278. npc.desc = EntityDef.forID(stream.method436());
  7279. npc.anInt1540 = npc.desc.aByte68;
  7280. npc.anInt1504 = npc.desc.anInt79;
  7281. npc.anInt1554 = npc.desc.walkAnim;
  7282. npc.anInt1555 = npc.desc.anInt58;
  7283. npc.anInt1556 = npc.desc.anInt83;
  7284. npc.anInt1557 = npc.desc.anInt55;
  7285. npc.anInt1511 = npc.desc.standAnim;
  7286. }
  7287. if((l & 4) != 0)
  7288. {
  7289. npc.anInt1538 = stream.method434();
  7290. npc.anInt1539 = stream.method434();
  7291. }
  7292. }
  7293. }
  7294.  
  7295. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  7296. {
  7297. if(menuActionRow >= 400)
  7298. return;
  7299. if(entityDef.childrenIDs != null)
  7300. entityDef = entityDef.method161();
  7301. if(entityDef == null)
  7302. return;
  7303. if(!entityDef.aBoolean84)
  7304. return;
  7305. String s = entityDef.name;
  7306. if(entityDef.combatLevel != 0)
  7307. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  7308. if(itemSelected == 1)
  7309. {
  7310. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  7311. menuActionID[menuActionRow] = 582;
  7312. menuActionCmd1[menuActionRow] = i;
  7313. menuActionCmd2[menuActionRow] = k;
  7314. menuActionCmd3[menuActionRow] = j;
  7315. menuActionRow++;
  7316. return;
  7317. }
  7318. if(spellSelected == 1)
  7319. {
  7320. if((spellUsableOn & 2) == 2)
  7321. {
  7322. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  7323. menuActionID[menuActionRow] = 413;
  7324. menuActionCmd1[menuActionRow] = i;
  7325. menuActionCmd2[menuActionRow] = k;
  7326. menuActionCmd3[menuActionRow] = j;
  7327. menuActionRow++;
  7328. }
  7329. } else
  7330. {
  7331. if(entityDef.actions != null)
  7332. {
  7333. for(int l = 4; l >= 0; l--)
  7334. if(entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack"))
  7335. {
  7336. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  7337. if(l == 0)
  7338. menuActionID[menuActionRow] = 20;
  7339. if(l == 1)
  7340. menuActionID[menuActionRow] = 412;
  7341. if(l == 2)
  7342. menuActionID[menuActionRow] = 225;
  7343. if(l == 3)
  7344. menuActionID[menuActionRow] = 965;
  7345. if(l == 4)
  7346. menuActionID[menuActionRow] = 478;
  7347. menuActionCmd1[menuActionRow] = i;
  7348. menuActionCmd2[menuActionRow] = k;
  7349. menuActionCmd3[menuActionRow] = j;
  7350. menuActionRow++;
  7351. }
  7352.  
  7353. }
  7354. if(entityDef.actions != null)
  7355. {
  7356. for(int i1 = 4; i1 >= 0; i1--)
  7357. if(entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack"))
  7358. {
  7359. char c = '\0';
  7360. if(entityDef.combatLevel > myPlayer.combatLevel)
  7361. c = '\u07D0';
  7362. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  7363. if(i1 == 0)
  7364. menuActionID[menuActionRow] = 20 + c;
  7365. if(i1 == 1)
  7366. menuActionID[menuActionRow] = 412 + c;
  7367. if(i1 == 2)
  7368. menuActionID[menuActionRow] = 225 + c;
  7369. if(i1 == 3)
  7370. menuActionID[menuActionRow] = 965 + c;
  7371. if(i1 == 4)
  7372. menuActionID[menuActionRow] = 478 + c;
  7373. menuActionCmd1[menuActionRow] = i;
  7374. menuActionCmd2[menuActionRow] = k;
  7375. menuActionCmd3[menuActionRow] = j;
  7376. menuActionRow++;
  7377. }
  7378.  
  7379. }
  7380. //menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.type + "@gre@)";
  7381. menuActionName[menuActionRow] = "Examine @yel@" + s;
  7382. menuActionID[menuActionRow] = 1025;
  7383. menuActionCmd1[menuActionRow] = i;
  7384. menuActionCmd2[menuActionRow] = k;
  7385. menuActionCmd3[menuActionRow] = j;
  7386. menuActionRow++;
  7387. }
  7388. }
  7389.  
  7390. private void buildAtPlayerMenu(int i, int j, Player player, int k)
  7391. {
  7392. if(player == myPlayer)
  7393. return;
  7394. if(menuActionRow >= 400)
  7395. return;
  7396. String s;
  7397. if(player.skill == 0)
  7398. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level: " + player.combatLevel + ")";
  7399. else
  7400. s = player.name + " (skill-" + player.skill + ")";
  7401. if(itemSelected == 1)
  7402. {
  7403. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
  7404. menuActionID[menuActionRow] = 491;
  7405. menuActionCmd1[menuActionRow] = j;
  7406. menuActionCmd2[menuActionRow] = i;
  7407. menuActionCmd3[menuActionRow] = k;
  7408. menuActionRow++;
  7409. } else
  7410. if(spellSelected == 1)
  7411. {
  7412. if((spellUsableOn & 8) == 8)
  7413. {
  7414. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  7415. menuActionID[menuActionRow] = 365;
  7416. menuActionCmd1[menuActionRow] = j;
  7417. menuActionCmd2[menuActionRow] = i;
  7418. menuActionCmd3[menuActionRow] = k;
  7419. menuActionRow++;
  7420. }
  7421. } else
  7422. {
  7423. for(int l = 4; l >= 0; l--)
  7424. if(atPlayerActions[l] != null)
  7425. {
  7426. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  7427. char c = '\0';
  7428. if(atPlayerActions[l].equalsIgnoreCase("attack"))
  7429. {
  7430. if(player.combatLevel > myPlayer.combatLevel)
  7431. c = '\u07D0';
  7432. if(myPlayer.team != 0 && player.team != 0)
  7433. if(myPlayer.team == player.team)
  7434. c = '\u07D0';
  7435. else
  7436. c = '\0';
  7437. } else
  7438. if(atPlayerArray[l])
  7439. c = '\u07D0';
  7440. if(l == 0)
  7441. menuActionID[menuActionRow] = 561 + c;
  7442. if(l == 1)
  7443. menuActionID[menuActionRow] = 779 + c;
  7444. if(l == 2)
  7445. menuActionID[menuActionRow] = 27 + c;
  7446. if(l == 3)
  7447. menuActionID[menuActionRow] = 577 + c;
  7448. if(l == 4)
  7449. menuActionID[menuActionRow] = 729 + c;
  7450. menuActionCmd1[menuActionRow] = j;
  7451. menuActionCmd2[menuActionRow] = i;
  7452. menuActionCmd3[menuActionRow] = k;
  7453. menuActionRow++;
  7454. }
  7455.  
  7456. }
  7457. for(int i1 = 0; i1 < menuActionRow; i1++)
  7458. if(menuActionID[i1] == 516)
  7459. {
  7460. menuActionName[i1] = "Walk here @whi@" + s;
  7461. return;
  7462. }
  7463.  
  7464. }
  7465.  
  7466. private void method89(Class30_Sub1 class30_sub1)
  7467. {
  7468. int i = 0;
  7469. int j = -1;
  7470. int k = 0;
  7471. int l = 0;
  7472. if(class30_sub1.anInt1296 == 0)
  7473. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7474. if(class30_sub1.anInt1296 == 1)
  7475. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7476. if(class30_sub1.anInt1296 == 2)
  7477. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7478. if(class30_sub1.anInt1296 == 3)
  7479. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7480. if(i != 0)
  7481. {
  7482. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7483. j = i >> 14 & 0x7fff;
  7484. k = i1 & 0x1f;
  7485. l = i1 >> 6;
  7486. }
  7487. class30_sub1.anInt1299 = j;
  7488. class30_sub1.anInt1301 = k;
  7489. class30_sub1.anInt1300 = l;
  7490. }
  7491.  
  7492. private void method90()
  7493. {
  7494. for(int i = 0; i < anInt1062; i++)
  7495. if(anIntArray1250[i] <= 0)
  7496. {
  7497. boolean flag1 = false;
  7498. try
  7499. {
  7500. if(anIntArray1207[i] == anInt874 && anIntArray1241[i] == anInt1289)
  7501. {
  7502. if(!replayWave())
  7503. flag1 = true;
  7504. } else
  7505. {
  7506. Stream stream = Sounds.method241(anIntArray1241[i], anIntArray1207[i]);
  7507. if(System.currentTimeMillis() + (long)(stream.currentOffset / 22) > aLong1172 + (long)(anInt1257 / 22))
  7508. {
  7509. anInt1257 = stream.currentOffset;
  7510. aLong1172 = System.currentTimeMillis();
  7511. if(saveWave(stream.buffer, stream.currentOffset))
  7512. {
  7513. anInt874 = anIntArray1207[i];
  7514. anInt1289 = anIntArray1241[i];
  7515. } else
  7516. {
  7517. flag1 = true;
  7518. }
  7519. }
  7520. }
  7521. }
  7522. catch(Exception exception) { }
  7523. if(!flag1 || anIntArray1250[i] == -5)
  7524. {
  7525. anInt1062--;
  7526. for(int j = i; j < anInt1062; j++)
  7527. {
  7528. anIntArray1207[j] = anIntArray1207[j + 1];
  7529. anIntArray1241[j] = anIntArray1241[j + 1];
  7530. anIntArray1250[j] = anIntArray1250[j + 1];
  7531. }
  7532.  
  7533. i--;
  7534. } else
  7535. {
  7536. anIntArray1250[i] = -5;
  7537. }
  7538. } else
  7539. {
  7540. anIntArray1250[i]--;
  7541. }
  7542.  
  7543. if(prevSong > 0)
  7544. {
  7545. prevSong -= 20;
  7546. if(prevSong < 0)
  7547. prevSong = 0;
  7548. if(prevSong == 0 && musicEnabled && !lowMem)
  7549. {
  7550. nextSong = currentSong;
  7551. songChanging = true;
  7552. onDemandFetcher.method558(2, nextSong);
  7553. }
  7554. }
  7555. }
  7556.  
  7557. void startUp()
  7558. {
  7559. drawLoadingText(20, "Starting up");
  7560. new CacheDownloader(this).downloadCache();
  7561. if(signlink.sunjava)
  7562. super.minDelay = 5;
  7563. aBoolean993 = true;
  7564. boolean flag = true;
  7565. String s = getDocumentBaseHost();
  7566. if(signlink.cache_dat != null)
  7567. {
  7568. for(int i = 0; i < 5; i++)
  7569. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  7570. } try {
  7571. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  7572. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  7573. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  7574. chatTextDrawingArea = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  7575. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  7576. drawLogo();
  7577. loadTitleScreen();
  7578. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  7579. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  7580. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  7581. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  7582. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  7583. StreamLoader streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  7584. byteGroundArray = new byte[4][104][104];
  7585. intGroundArray = new int[4][105][105];
  7586. worldController = new WorldController(intGroundArray);
  7587. for(int j = 0; j < 4; j++)
  7588. aClass11Array1230[j] = new Class11();
  7589.  
  7590. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  7591. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  7592. drawLoadingText(60, "Connecting to update server");
  7593. onDemandFetcher = new OnDemandFetcher();
  7594. onDemandFetcher.start(streamLoader_6, this);
  7595. Class36.method528(onDemandFetcher.getAnimCount());
  7596. //models();
  7597. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  7598. ModelDecompressor.loadModels();
  7599. preloadModels();
  7600. //maps();
  7601. if(!lowMem)
  7602. {
  7603. nextSong = 0;
  7604. try
  7605. {
  7606. nextSong = Integer.parseInt(getParameter("music"));
  7607. }
  7608. catch(Exception _ex) { }
  7609. songChanging = true;
  7610. onDemandFetcher.method558(2, nextSong);
  7611. while(onDemandFetcher.getNodeCount() > 0)
  7612. {
  7613. processOnDemandQueue();
  7614. try
  7615. {
  7616. Thread.sleep(100L);
  7617. }
  7618. catch(Exception _ex) { }
  7619. if(onDemandFetcher.anInt1349 > 3)
  7620. {
  7621. loadError();
  7622. return;
  7623. }
  7624. }
  7625. }
  7626. drawLoadingText(65, "Requesting animations");
  7627. drawLoadingText(80, "Unpacking media");
  7628. /* Custom sprite unpacking */
  7629. loadExtraSprites();
  7630. chatArea = new Sprite("chatarea");
  7631. tabArea = new Sprite("tabarea");
  7632. mapArea = new Sprite("maparea");
  7633. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  7634. /**/
  7635. mapBack = new Background(streamLoader_2, "mapback", 0);
  7636. for(int c1 = 0; c1 <= 3; c1++)
  7637. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  7638. for(int j3 = 0; j3 <= 14; j3++)
  7639. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  7640. for(int r1 = 0; r1 < 5; r1++)
  7641. redStones[r1] = new Sprite("redstones " + r1);
  7642. compass = new Sprite(streamLoader_2, "compass", 0);
  7643. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  7644. mapEdge.method345();
  7645. try
  7646. {
  7647. for(int k3 = 0; k3 < 100; k3++)
  7648. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  7649. }
  7650. catch(Exception _ex) { }
  7651. try
  7652. {
  7653. for(int l3 = 0; l3 < 100; l3++)
  7654. if(l3 < 75)
  7655. mapFunctions[l3] = new Sprite(streamLoader_2,"mapfunction", l3);
  7656. else
  7657. mapFunctions[l3] = new Sprite(streamLoader_2,"mapfunctions2", (l3-76));
  7658. }
  7659. catch(Exception _ex) { }
  7660. try
  7661. {
  7662. for(int i4 = 0; i4 < 20; i4++)
  7663. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  7664. }
  7665. catch(Exception _ex) { }
  7666. try
  7667. {
  7668. for(int h1 = 0; h1 < 6; h1++)
  7669. headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
  7670. } catch(Exception _ex) { }
  7671. try {
  7672. for(int j4 = 0; j4 < 17; j4++) {
  7673. headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);
  7674. }
  7675. } catch(Exception _ex) { }
  7676. for(int j45 = 0; j45 < 3; j45++) {
  7677. skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45);
  7678. }
  7679.  
  7680. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  7681. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  7682. for(int k4 = 0; k4 < 8; k4++)
  7683. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  7684.  
  7685. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  7686. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  7687. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  7688. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  7689. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  7690. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  7691. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  7692. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  7693.  
  7694. for(int l4 = 0; l4 < 2; l4++)
  7695. modIcons[l4] = new Background(streamLoader_2, "mod_icons", l4);
  7696.  
  7697. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  7698. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7699. sprite.method346(0, 0);
  7700. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  7701. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7702. sprite.method346(0, 0);
  7703. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  7704. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7705. sprite.method346(0, 0);
  7706. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  7707. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7708. sprite.method346(0, 0);
  7709.  
  7710. int i5 = (int)(Math.random() * 21D) - 10;
  7711. int j5 = (int)(Math.random() * 21D) - 10;
  7712. int k5 = (int)(Math.random() * 21D) - 10;
  7713. int l5 = (int)(Math.random() * 41D) - 20;
  7714. for(int i6 = 0; i6 < 100; i6++)
  7715. {
  7716. if(mapFunctions[i6] != null)
  7717. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  7718. if(mapScenes[i6] != null)
  7719. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  7720. }
  7721. drawLoadingText(83, "Unpacking textures");
  7722. Texture.method368(streamLoader_3);
  7723. Texture.method372(0.80000000000000004D);
  7724. Texture.method367();
  7725. drawLoadingText(86, "Unpacking config");
  7726. Animation.unpackConfig(streamLoader);
  7727. ObjectDef.unpackConfig(streamLoader);
  7728. Flo.unpackConfig(streamLoader);
  7729. ItemDef.unpackConfig(streamLoader);
  7730. EntityDef.unpackConfig(streamLoader);
  7731. IDK.unpackConfig(streamLoader);
  7732. SpotAnim.unpackConfig(streamLoader);
  7733. Varp.unpackConfig(streamLoader);
  7734. VarBit.unpackConfig(streamLoader);
  7735. ItemDef.isMembers = isMembers;
  7736. if(!lowMem)
  7737. {
  7738. drawLoadingText(90, "Unpacking sounds");
  7739. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  7740. Stream stream = new Stream(abyte0);
  7741. Sounds.unpack(stream);
  7742. }
  7743. drawLoadingText(95, "Unpacking interfaces");
  7744. TextDrawingArea aclass30_sub2_sub1_sub4s[] = {
  7745. smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  7746. };
  7747. RSInterface.fonts = aclass30_sub2_sub1_sub4s;
  7748. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  7749. drawLoadingText(100, "Preparing game engine");
  7750. for(int j6 = 0; j6 < 33; j6++)
  7751. {
  7752. int k6 = 999;
  7753. int i7 = 0;
  7754. for(int k7 = 0; k7 < 34; k7++)
  7755. {
  7756. if(mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0)
  7757. {
  7758. if(k6 == 999)
  7759. k6 = k7;
  7760. continue;
  7761. }
  7762. if(k6 == 999)
  7763. continue;
  7764. i7 = k7;
  7765. break;
  7766. }
  7767.  
  7768. anIntArray968[j6] = k6;
  7769. anIntArray1057[j6] = i7 - k6;
  7770. }
  7771.  
  7772. for(int l6 = 5; l6 < 156; l6++)
  7773. {
  7774. int j7 = 999;
  7775. int l7 = 0;
  7776. for(int j8 = 25; j8 < 172; j8++)
  7777. {
  7778. if(mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34))
  7779. {
  7780. if(j7 == 999)
  7781. j7 = j8;
  7782. continue;
  7783. }
  7784. if(j7 == 999)
  7785. continue;
  7786. l7 = j8;
  7787. break;
  7788. }
  7789.  
  7790. anIntArray1052[l6 - 5] = j7 - 25;
  7791. anIntArray1229[l6 - 5] = l7 - j7;
  7792. }
  7793.  
  7794. Texture.method365(765, 503);
  7795. fullScreenTextureArray = Texture.anIntArray1472;
  7796. Texture.method365(519, 165);
  7797. anIntArray1180 = Texture.anIntArray1472;
  7798. Texture.method365(246, 335);
  7799. anIntArray1181 = Texture.anIntArray1472;
  7800. Texture.method365(512, 334);
  7801. anIntArray1182 = Texture.anIntArray1472;
  7802. int ai[] = new int[9];
  7803. for(int i8 = 0; i8 < 9; i8++)
  7804. {
  7805. int k8 = 128 + i8 * 32 + 15;
  7806. int l8 = 600 + k8 * 3;
  7807. int i9 = Texture.anIntArray1470[k8];
  7808. ai[i8] = l8 * i9 >> 16;
  7809. }
  7810.  
  7811. WorldController.method310(500, 800, 512, 334, ai);
  7812. Censor.loadConfig(streamLoader_4);
  7813. mouseDetection = new MouseDetection(this);
  7814. startRunnable(mouseDetection, 10);
  7815. Animable_Sub5.clientInstance = this;
  7816. ObjectDef.clientInstance = this;
  7817. EntityDef.clientInstance = this;
  7818. return;
  7819. }
  7820. catch(Exception exception)
  7821. {
  7822. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  7823. }
  7824. loadingError = true;
  7825. }
  7826.  
  7827. private void method91(Stream stream, int i)
  7828. {
  7829. while(stream.bitPosition + 10 < i * 8)
  7830. {
  7831. int j = stream.readBits(11);
  7832. if(j == 2047)
  7833. break;
  7834. if(playerArray[j] == null)
  7835. {
  7836. playerArray[j] = new Player();
  7837. if(aStreamArray895s[j] != null)
  7838. playerArray[j].updatePlayer(aStreamArray895s[j]);
  7839. }
  7840. playerIndices[playerCount++] = j;
  7841. Player player = playerArray[j];
  7842. player.anInt1537 = loopCycle;
  7843. int k = stream.readBits(1);
  7844. if(k == 1)
  7845. anIntArray894[anInt893++] = j;
  7846. int l = stream.readBits(1);
  7847. int i1 = stream.readBits(5);
  7848. if(i1 > 15)
  7849. i1 -= 32;
  7850. int j1 = stream.readBits(5);
  7851. if(j1 > 15)
  7852. j1 -= 32;
  7853. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  7854. }
  7855. stream.finishBitAccess();
  7856. }
  7857.  
  7858. private void processMainScreenClick() {
  7859. if(anInt1021 != 0)
  7860. return;
  7861. if(super.clickMode3 == 1) {
  7862. int i = super.saveClickX - 25 - 545;
  7863. int j = super.saveClickY - 5 - 4;
  7864. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  7865. i -= 73;
  7866. j -= 75;
  7867. int k = minimapInt1 + minimapInt2 & 0x7ff;
  7868. int i1 = Texture.anIntArray1470[k];
  7869. int j1 = Texture.anIntArray1471[k];
  7870. i1 = i1 * (minimapInt3 + 256) >> 8;
  7871. j1 = j1 * (minimapInt3 + 256) >> 8;
  7872. int k1 = j * i1 + i * j1 >> 11;
  7873. int l1 = j * j1 - i * i1 >> 11;
  7874. int i2 = myPlayer.x + k1 >> 7;
  7875. int j2 = myPlayer.y - l1 >> 7;
  7876. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  7877. if(flag1) {
  7878. stream.writeWordBigEndian(i);
  7879. stream.writeWordBigEndian(j);
  7880. stream.writeWord(minimapInt1);
  7881. stream.writeWordBigEndian(57);
  7882. stream.writeWordBigEndian(minimapInt2);
  7883. stream.writeWordBigEndian(minimapInt3);
  7884. stream.writeWordBigEndian(89);
  7885. stream.writeWord(myPlayer.x);
  7886. stream.writeWord(myPlayer.y);
  7887. stream.writeWordBigEndian(anInt1264);
  7888. stream.writeWordBigEndian(63);
  7889. }
  7890. }
  7891. anInt1117++;
  7892. if(anInt1117 > 1151) {
  7893. anInt1117 = 0;
  7894. stream.createFrame(246);
  7895. stream.writeWordBigEndian(0);
  7896. int l = stream.currentOffset;
  7897. if((int)(Math.random() * 2D) == 0)
  7898. stream.writeWordBigEndian(101);
  7899. stream.writeWordBigEndian(197);
  7900. stream.writeWord((int)(Math.random() * 65536D));
  7901. stream.writeWordBigEndian((int)(Math.random() * 256D));
  7902. stream.writeWordBigEndian(67);
  7903. stream.writeWord(14214);
  7904. if((int)(Math.random() * 2D) == 0)
  7905. stream.writeWord(29487);
  7906. stream.writeWord((int)(Math.random() * 65536D));
  7907. if((int)(Math.random() * 2D) == 0)
  7908. stream.writeWordBigEndian(220);
  7909. stream.writeWordBigEndian(180);
  7910. stream.writeBytes(stream.currentOffset - l);
  7911. }
  7912. }
  7913. }
  7914.  
  7915. private String interfaceIntToString(int j) {
  7916. if(j < 0x3b9ac9ff)
  7917. return String.valueOf(j);
  7918. else
  7919. return "*";
  7920. }
  7921.  
  7922. private void showErrorScreen()
  7923. {
  7924. Graphics g = getGameComponent().getGraphics();
  7925. g.setColor(Color.black);
  7926. g.fillRect(0, 0, 765, 503);
  7927. method4(1);
  7928. if(loadingError)
  7929. {
  7930. aBoolean831 = false;
  7931. g.setFont(new Font("Helvetica", 1, 16));
  7932. g.setColor(Color.yellow);
  7933. int k = 35;
  7934. g.drawString("Sorry, an error has occured whilst loading HyBriD PvP", 30, k);
  7935. k += 50;
  7936. g.setColor(Color.white);
  7937. g.drawString("To fix this try the following (in order):", 30, k);
  7938. k += 50;
  7939. g.setColor(Color.white);
  7940. g.setFont(new Font("Helvetica", 1, 12));
  7941. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  7942. k += 30;
  7943. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  7944. k += 30;
  7945. g.drawString("3: Try using a different game-world", 30, k);
  7946. k += 30;
  7947. g.drawString("4: Try rebooting your computer", 30, k);
  7948. k += 30;
  7949. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  7950. }
  7951. if(genericLoadingError)
  7952. {
  7953. aBoolean831 = false;
  7954. g.setFont(new Font("Helvetica", 1, 20));
  7955. g.setColor(Color.white);
  7956. g.drawString("Error - unable to load game!", 50, 50);
  7957. g.drawString("To play HyBriD PvP make sure you play from", 50, 100);
  7958. g.drawString("http://www.hybridpvp.net", 50, 150);
  7959. }
  7960. if(rsAlreadyLoaded)
  7961. {
  7962. aBoolean831 = false;
  7963. g.setColor(Color.yellow);
  7964. int l = 35;
  7965. g.drawString("Error a copy of HyBriD PvP already appears to be loaded", 30, l);
  7966. l += 50;
  7967. g.setColor(Color.white);
  7968. g.drawString("To fix this try the following (in order):", 30, l);
  7969. l += 50;
  7970. g.setColor(Color.white);
  7971. g.setFont(new Font("Helvetica", 1, 12));
  7972. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  7973. l += 30;
  7974. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  7975. l += 30;
  7976. }
  7977. }
  7978.  
  7979. public URL getCodeBase() {
  7980. try {
  7981. return new URL(server +":" + (80 + portOff));
  7982. } catch(Exception _ex) {
  7983. }
  7984. return null;
  7985. }
  7986.  
  7987. private void method95() {
  7988. for(int j = 0; j < npcCount; j++) {
  7989. int k = npcIndices[j];
  7990. NPC npc = npcArray[k];
  7991. if(npc != null)
  7992. method96(npc);
  7993. }
  7994. }
  7995.  
  7996. private void method96(Entity entity)
  7997. {
  7998. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  7999. {
  8000. entity.anim = -1;
  8001. entity.anInt1520 = -1;
  8002. entity.anInt1547 = 0;
  8003. entity.anInt1548 = 0;
  8004. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8005. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8006. entity.method446();
  8007. }
  8008. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  8009. {
  8010. entity.anim = -1;
  8011. entity.anInt1520 = -1;
  8012. entity.anInt1547 = 0;
  8013. entity.anInt1548 = 0;
  8014. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8015. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8016. entity.method446();
  8017. }
  8018. if(entity.anInt1547 > loopCycle)
  8019. method97(entity);
  8020. else
  8021. if(entity.anInt1548 >= loopCycle)
  8022. method98(entity);
  8023. else
  8024. method99(entity);
  8025. method100(entity);
  8026. method101(entity);
  8027. }
  8028.  
  8029. private void method97(Entity entity)
  8030. {
  8031. int i = entity.anInt1547 - loopCycle;
  8032. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8033. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8034. entity.x += (j - entity.x) / i;
  8035. entity.y += (k - entity.y) / i;
  8036. entity.anInt1503 = 0;
  8037. if(entity.anInt1549 == 0)
  8038. entity.turnDirection = 1024;
  8039. if(entity.anInt1549 == 1)
  8040. entity.turnDirection = 1536;
  8041. if(entity.anInt1549 == 2)
  8042. entity.turnDirection = 0;
  8043. if(entity.anInt1549 == 3)
  8044. entity.turnDirection = 512;
  8045. }
  8046.  
  8047. private void method98(Entity entity)
  8048. {
  8049. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  8050. {
  8051. int i = entity.anInt1548 - entity.anInt1547;
  8052. int j = loopCycle - entity.anInt1547;
  8053. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8054. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8055. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  8056. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  8057. entity.x = (k * (i - j) + i1 * j) / i;
  8058. entity.y = (l * (i - j) + j1 * j) / i;
  8059. }
  8060. entity.anInt1503 = 0;
  8061. if(entity.anInt1549 == 0)
  8062. entity.turnDirection = 1024;
  8063. if(entity.anInt1549 == 1)
  8064. entity.turnDirection = 1536;
  8065. if(entity.anInt1549 == 2)
  8066. entity.turnDirection = 0;
  8067. if(entity.anInt1549 == 3)
  8068. entity.turnDirection = 512;
  8069. entity.anInt1552 = entity.turnDirection;
  8070. }
  8071.  
  8072. private void method99(Entity entity)
  8073. {
  8074. entity.anInt1517 = entity.anInt1511;
  8075. if(entity.smallXYIndex == 0)
  8076. {
  8077. entity.anInt1503 = 0;
  8078. return;
  8079. }
  8080. if(entity.anim != -1 && entity.anInt1529 == 0)
  8081. {
  8082. Animation animation = Animation.anims[entity.anim];
  8083. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  8084. {
  8085. entity.anInt1503++;
  8086. return;
  8087. }
  8088. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  8089. {
  8090. entity.anInt1503++;
  8091. return;
  8092. }
  8093. }
  8094. int i = entity.x;
  8095. int j = entity.y;
  8096. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  8097. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  8098. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  8099. {
  8100. entity.x = k;
  8101. entity.y = l;
  8102. return;
  8103. }
  8104. if(i < k)
  8105. {
  8106. if(j < l)
  8107. entity.turnDirection = 1280;
  8108. else
  8109. if(j > l)
  8110. entity.turnDirection = 1792;
  8111. else
  8112. entity.turnDirection = 1536;
  8113. } else
  8114. if(i > k)
  8115. {
  8116. if(j < l)
  8117. entity.turnDirection = 768;
  8118. else
  8119. if(j > l)
  8120. entity.turnDirection = 256;
  8121. else
  8122. entity.turnDirection = 512;
  8123. } else
  8124. if(j < l)
  8125. entity.turnDirection = 1024;
  8126. else
  8127. entity.turnDirection = 0;
  8128. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8129. if(i1 > 1024)
  8130. i1 -= 2048;
  8131. int j1 = entity.anInt1555;
  8132. if(i1 >= -256 && i1 <= 256)
  8133. j1 = entity.anInt1554;
  8134. else
  8135. if(i1 >= 256 && i1 < 768)
  8136. j1 = entity.anInt1557;
  8137. else
  8138. if(i1 >= -768 && i1 <= -256)
  8139. j1 = entity.anInt1556;
  8140. if(j1 == -1)
  8141. j1 = entity.anInt1554;
  8142. entity.anInt1517 = j1;
  8143. int k1 = 4;
  8144. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  8145. k1 = 2;
  8146. if(entity.smallXYIndex > 2)
  8147. k1 = 6;
  8148. if(entity.smallXYIndex > 3)
  8149. k1 = 8;
  8150. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  8151. {
  8152. k1 = 8;
  8153. entity.anInt1503--;
  8154. }
  8155. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  8156. k1 <<= 1;
  8157. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  8158. entity.anInt1517 = entity.anInt1505;
  8159. if(i < k)
  8160. {
  8161. entity.x += k1;
  8162. if(entity.x > k)
  8163. entity.x = k;
  8164. } else
  8165. if(i > k)
  8166. {
  8167. entity.x -= k1;
  8168. if(entity.x < k)
  8169. entity.x = k;
  8170. }
  8171. if(j < l)
  8172. {
  8173. entity.y += k1;
  8174. if(entity.y > l)
  8175. entity.y = l;
  8176. } else
  8177. if(j > l)
  8178. {
  8179. entity.y -= k1;
  8180. if(entity.y < l)
  8181. entity.y = l;
  8182. }
  8183. if(entity.x == k && entity.y == l)
  8184. {
  8185. entity.smallXYIndex--;
  8186. if(entity.anInt1542 > 0)
  8187. entity.anInt1542--;
  8188. }
  8189. }
  8190.  
  8191. private void method100(Entity entity)
  8192. {
  8193. if(entity.anInt1504 == 0)
  8194. return;
  8195. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  8196. {
  8197. NPC npc = npcArray[entity.interactingEntity];
  8198. if(npc != null)
  8199. {
  8200. int i1 = entity.x - npc.x;
  8201. int k1 = entity.y - npc.y;
  8202. if(i1 != 0 || k1 != 0)
  8203. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  8204. }
  8205. }
  8206. if(entity.interactingEntity >= 32768)
  8207. {
  8208. int j = entity.interactingEntity - 32768;
  8209. if(j == unknownInt10)
  8210. j = myPlayerIndex;
  8211. Player player = playerArray[j];
  8212. if(player != null)
  8213. {
  8214. int l1 = entity.x - player.x;
  8215. int i2 = entity.y - player.y;
  8216. if(l1 != 0 || i2 != 0)
  8217. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  8218. }
  8219. }
  8220. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  8221. {
  8222. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  8223. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  8224. if(k != 0 || j1 != 0)
  8225. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  8226. entity.anInt1538 = 0;
  8227. entity.anInt1539 = 0;
  8228. }
  8229. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8230. if(l != 0)
  8231. {
  8232. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8233. entity.anInt1552 = entity.turnDirection;
  8234. else
  8235. if(l > 1024)
  8236. entity.anInt1552 -= entity.anInt1504;
  8237. else
  8238. entity.anInt1552 += entity.anInt1504;
  8239. entity.anInt1552 &= 0x7ff;
  8240. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  8241. {
  8242. if(entity.anInt1512 != -1)
  8243. {
  8244. entity.anInt1517 = entity.anInt1512;
  8245. return;
  8246. }
  8247. entity.anInt1517 = entity.anInt1554;
  8248. }
  8249. }
  8250. }
  8251.  
  8252. private void method101(Entity entity)
  8253. {
  8254. entity.aBoolean1541 = false;
  8255. if(entity.anInt1517 != -1)
  8256. {
  8257. Animation animation = Animation.anims[entity.anInt1517];
  8258. entity.anInt1519++;
  8259. if(entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518))
  8260. {
  8261. entity.anInt1519 = 0;
  8262. entity.anInt1518++;
  8263. }
  8264. if(entity.anInt1518 >= animation.anInt352)
  8265. {
  8266. entity.anInt1519 = 0;
  8267. entity.anInt1518 = 0;
  8268. }
  8269. }
  8270. if(entity.anInt1520 != -1 && loopCycle >= entity.anInt1523)
  8271. {
  8272. if(entity.anInt1521 < 0)
  8273. entity.anInt1521 = 0;
  8274. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8275. for(entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  8276. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8277.  
  8278. if(entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  8279. entity.anInt1520 = -1;
  8280. }
  8281. if(entity.anim != -1 && entity.anInt1529 <= 1)
  8282. {
  8283. Animation animation_2 = Animation.anims[entity.anim];
  8284. if(animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle)
  8285. {
  8286. entity.anInt1529 = 1;
  8287. return;
  8288. }
  8289. }
  8290. if(entity.anim != -1 && entity.anInt1529 == 0)
  8291. {
  8292. Animation animation_3 = Animation.anims[entity.anim];
  8293. for(entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  8294. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8295.  
  8296. if(entity.anInt1527 >= animation_3.anInt352)
  8297. {
  8298. entity.anInt1527 -= animation_3.anInt356;
  8299. entity.anInt1530++;
  8300. if(entity.anInt1530 >= animation_3.anInt362)
  8301. entity.anim = -1;
  8302. if(entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  8303. entity.anim = -1;
  8304. }
  8305. entity.aBoolean1541 = animation_3.aBoolean358;
  8306. }
  8307. if(entity.anInt1529 > 0)
  8308. entity.anInt1529--;
  8309. }
  8310.  
  8311. private void drawGameScreen()
  8312. {
  8313. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  8314. if (loadingStage == 2) {
  8315. method119(anInt945, fullscreenInterfaceID);
  8316. if (openInterfaceID != -1) {
  8317. method119(anInt945, openInterfaceID);
  8318. }
  8319. anInt945 = 0;
  8320. resetAllImageProducers();
  8321. super.fullGameScreen.initDrawingArea();
  8322. Texture.anIntArray1472 = fullScreenTextureArray;
  8323. DrawingArea.setAllPixelsToZero();
  8324. welcomeScreenRaised = true;
  8325. if (openInterfaceID != -1) {
  8326. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  8327. if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  8328. rsInterface_1.width = 765;
  8329. rsInterface_1.height = 503;
  8330. }
  8331. drawInterface(0, 0, rsInterface_1, 8);
  8332. }
  8333. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  8334. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  8335. rsInterface.width = 765;
  8336. rsInterface.height = 503;
  8337. }
  8338. drawInterface(0, 0, rsInterface, 8);
  8339.  
  8340. if (!menuOpen) {
  8341. processRightClick();
  8342. drawTooltip();
  8343. } else {
  8344. drawMenu();
  8345. }
  8346. }
  8347. drawCount++;
  8348. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  8349. return;
  8350. } else {
  8351. if (drawCount != 0) {
  8352. resetImageProducers2();
  8353. }
  8354. }
  8355. if(welcomeScreenRaised) {
  8356. welcomeScreenRaised = false;
  8357. topFrame.drawGraphics(0, super.graphics, 0);
  8358. leftFrame.drawGraphics(4, super.graphics, 0);
  8359. rightFrame.drawGraphics(4, super.graphics, 516);
  8360. mapEdgeIP.drawGraphics(4, super.graphics, 519);
  8361. needDrawTabArea = true;
  8362. inputTaken = true;
  8363. tabAreaAltered = true;
  8364. aBoolean1233 = true;
  8365. if(loadingStage != 2) {
  8366. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  8367. aRSImageProducer_1164.drawGraphics(4, super.graphics, 545);
  8368. }
  8369. }
  8370. if(menuOpen && menuScreenArea == 1)
  8371. needDrawTabArea = true;
  8372. if(invOverlayInterfaceID != -1)
  8373. {
  8374. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  8375. if(flag1)
  8376. needDrawTabArea = true;
  8377. }
  8378. if(atInventoryInterfacetype == 2)
  8379. needDrawTabArea = true;
  8380. if(activeInterfacetype == 2)
  8381. needDrawTabArea = true;
  8382. /*if(needDrawTabArea)
  8383. {*/
  8384. drawTabArea();
  8385. /*needDrawTabArea = false;
  8386. }*/
  8387. if(backDialogID == -1)
  8388. {
  8389. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  8390. if(super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  8391. method65(494, 110, super.mouseX - 0, super.mouseY - 348, aClass9_1059, 0, false, anInt1211);
  8392. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  8393. if(i < 0)
  8394. i = 0;
  8395. if(i > anInt1211 - 110)
  8396. i = anInt1211 - 110;
  8397. if(anInt1089 != i)
  8398. {
  8399. anInt1089 = i;
  8400. inputTaken = true;
  8401. }
  8402. }
  8403. if(backDialogID != -1) {
  8404. boolean flag2 = method119(anInt945, backDialogID);
  8405. if(flag2)
  8406. inputTaken = true;
  8407. }
  8408. if(atInventoryInterfacetype == 3)
  8409. inputTaken = true;
  8410. if(activeInterfacetype == 3)
  8411. inputTaken = true;
  8412. if(aString844 != null)
  8413. inputTaken = true;
  8414. if(menuOpen && menuScreenArea == 2)
  8415. inputTaken = true;
  8416. if(inputTaken) {
  8417. drawChatArea();
  8418. inputTaken = false;
  8419. }
  8420. if(loadingStage == 2)
  8421. method146();
  8422. if(loadingStage == 2) {
  8423. drawMinimap();
  8424. aRSImageProducer_1164.drawGraphics(4, super.graphics, 545);
  8425. }
  8426. if(anInt1054 != -1)
  8427. tabAreaAltered = true;
  8428. if(tabAreaAltered)
  8429. {
  8430. if(anInt1054 != -1 && anInt1054 == tabID)
  8431. {
  8432. anInt1054 = -1;
  8433. stream.createFrame(120);
  8434. stream.writeWordBigEndian(tabID);
  8435. }
  8436. tabAreaAltered = false;
  8437. aRSImageProducer_1125.initDrawingArea();
  8438. aRSImageProducer_1165.initDrawingArea();
  8439. }
  8440. anInt945 = 0;
  8441. }
  8442.  
  8443. private boolean buildFriendsListMenu(RSInterface class9)
  8444. {
  8445. int i = class9.contentType;
  8446. if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  8447. {
  8448. if(i >= 801)
  8449. i -= 701;
  8450. else
  8451. if(i >= 701)
  8452. i -= 601;
  8453. else
  8454. if(i >= 101)
  8455. i -= 101;
  8456. else
  8457. i--;
  8458. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  8459. menuActionID[menuActionRow] = 792;
  8460. menuActionRow++;
  8461. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  8462. menuActionID[menuActionRow] = 639;
  8463. menuActionRow++;
  8464. return true;
  8465. }
  8466. if(i >= 401 && i <= 500)
  8467. {
  8468. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  8469. menuActionID[menuActionRow] = 322;
  8470. menuActionRow++;
  8471. return true;
  8472. } else
  8473. {
  8474. return false;
  8475. }
  8476. }
  8477.  
  8478. private void method104()
  8479. {
  8480. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  8481. for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  8482. if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  8483. class30_sub2_sub4_sub3.unlink();
  8484. else
  8485. if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  8486. {
  8487. class30_sub2_sub4_sub3.method454(anInt945);
  8488. if(class30_sub2_sub4_sub3.aBoolean1567)
  8489. class30_sub2_sub4_sub3.unlink();
  8490. else
  8491. 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);
  8492. }
  8493.  
  8494. }
  8495.  
  8496. public void drawBlackBox(int xPos, int yPos) {
  8497. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  8498. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  8499. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  8500. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  8501. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  8502. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  8503. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  8504. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  8505. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  8506. }
  8507.  
  8508. private void drawInterface(int j, int k, RSInterface class9, int l) {
  8509. if(class9.type != 0 || class9.children == null)
  8510. return;
  8511. if(class9.interfaceShown && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  8512. return;
  8513. int i1 = DrawingArea.topX;
  8514. int j1 = DrawingArea.topY;
  8515. int k1 = DrawingArea.bottomX;
  8516. int l1 = DrawingArea.bottomY;
  8517. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  8518. int i2 = class9.children.length;
  8519. for(int j2 = 0; j2 < i2; j2++) {
  8520. int k2 = class9.childX[j2] + k;
  8521. int l2 = (class9.childY[j2] + l) - j;
  8522. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  8523. k2 += class9_1.anInt263;
  8524. l2 += class9_1.anInt265;
  8525. if(class9_1.contentType > 0)
  8526. drawFriendsListOrWelcomeScreen(class9_1);
  8527. //here
  8528. int[] IDs = {
  8529. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
  8530. 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
  8531. 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
  8532. 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
  8533. 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  8534. /* Ancients */
  8535. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
  8536. 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  8537. };
  8538. for(int m5 = 0; m5 < IDs.length; m5++) {
  8539. if(class9_1.id == IDs[m5] + 1) {
  8540. if(m5 > 61)
  8541. drawBlackBox(k2 + 1, l2);
  8542. else
  8543. drawBlackBox(k2, l2 + 1);
  8544. }
  8545. }
  8546. int[] runeChildren = {
  8547. 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
  8548. 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
  8549. 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
  8550. 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
  8551. 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
  8552. 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
  8553. 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
  8554. 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
  8555. 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
  8556. 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
  8557. 15885, 18474, 18475, 18478
  8558. };
  8559. for(int r = 0; r < runeChildren.length; r++)
  8560. if(class9_1.id == runeChildren[r])
  8561. class9_1.modelZoom = 775;
  8562. if(class9_1.type == 0) {
  8563. if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  8564. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  8565. if(class9_1.scrollPosition < 0)
  8566. class9_1.scrollPosition = 0;
  8567. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  8568. if(class9_1.scrollMax > class9_1.height)
  8569. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  8570. } else if(class9_1.type != 1)
  8571. if(class9_1.type == 2) {
  8572. int i3 = 0;
  8573. for(int l3 = 0; l3 < class9_1.height; l3++) {
  8574. for(int l4 = 0; l4 < class9_1.width; l4++) {
  8575. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  8576. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  8577. if(i3 < 20) {
  8578. k5 += class9_1.spritesX[i3];
  8579. j6 += class9_1.spritesY[i3];
  8580. }
  8581. if(class9_1.inv[i3] > 0) {
  8582. int k6 = 0;
  8583. int j7 = 0;
  8584. int j9 = class9_1.inv[i3] - 1;
  8585. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfacetype != 0 && anInt1085 == i3) {
  8586. int l9 = 0;
  8587. if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  8588. l9 = 0xffffff;
  8589. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  8590. if(class30_sub2_sub1_sub1_2 != null) {
  8591. if(activeInterfacetype != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  8592. k6 = super.mouseX - anInt1087;
  8593. j7 = super.mouseY - anInt1088;
  8594. if(k6 < 5 && k6 > -5)
  8595. k6 = 0;
  8596. if(j7 < 5 && j7 > -5)
  8597. j7 = 0;
  8598. if(anInt989 < 5) {
  8599. k6 = 0;
  8600. j7 = 0;
  8601. }
  8602. class30_sub2_sub1_sub1_2.drawSprite1(k5 + k6, j6 + j7);
  8603. if(j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  8604. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  8605. if(i10 > anInt945 * 10)
  8606. i10 = anInt945 * 10;
  8607. if(i10 > class9.scrollPosition)
  8608. i10 = class9.scrollPosition;
  8609. class9.scrollPosition -= i10;
  8610. anInt1088 += i10;
  8611. }
  8612. if(j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  8613. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  8614. if(j10 > anInt945 * 10)
  8615. j10 = anInt945 * 10;
  8616. if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  8617. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  8618. class9.scrollPosition += j10;
  8619. anInt1088 -= j10;
  8620. }
  8621. } else if(atInventoryInterfacetype != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  8622. class30_sub2_sub1_sub1_2.drawSprite1(k5, j6);
  8623. else
  8624. class30_sub2_sub1_sub1_2.drawSprite(k5, j6);
  8625. if(class30_sub2_sub1_sub1_2.anInt1444 == 33 || class9_1.invStackSizes[i3] != 1)
  8626. {
  8627. int k10 = class9_1.invStackSizes[i3];
  8628. if(k10 >= 1)
  8629. smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8630. if(k10 >= 100000)
  8631. smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8632. if(k10 >= 10000000)
  8633. smallText.method385(0x49E20E, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8634.  
  8635. /*smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  8636. smallText.method385(0xffff00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);*/
  8637. }
  8638. }
  8639. }
  8640. } else if(class9_1.sprites != null && i3 < 20) {
  8641. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  8642. if(class30_sub2_sub1_sub1_1 != null)
  8643. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  8644. }
  8645. i3++;
  8646. }
  8647. }
  8648. } else if(class9_1.type == 3) {
  8649. boolean flag = false;
  8650. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8651. flag = true;
  8652. int j3;
  8653. if(interfaceIsSelected(class9_1)) {
  8654. j3 = class9_1.anInt219;
  8655. if(flag && class9_1.anInt239 != 0)
  8656. j3 = class9_1.anInt239;
  8657. } else {
  8658. j3 = class9_1.textColor;
  8659. if(flag && class9_1.anInt216 != 0)
  8660. j3 = class9_1.anInt216;
  8661. }
  8662. if(class9_1.opacity == 0) {
  8663. if(class9_1.aBoolean227)
  8664. DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  8665. else
  8666. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  8667. } else if(class9_1.aBoolean227)
  8668. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.opacity & 0xff), k2);
  8669. else
  8670. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.opacity & 0xff), j3, class9_1.width, k2);
  8671. } else if(class9_1.type == 4) {
  8672. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  8673. String s = class9_1.message;
  8674. boolean flag1 = false;
  8675. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8676. flag1 = true;
  8677. int i4;
  8678. if(interfaceIsSelected(class9_1)) {
  8679. i4 = class9_1.anInt219;
  8680. if(flag1 && class9_1.anInt239 != 0)
  8681. i4 = class9_1.anInt239;
  8682. if(class9_1.aString228.length() > 0)
  8683. s = class9_1.aString228;
  8684. } else {
  8685. i4 = class9_1.textColor;
  8686. if(flag1 && class9_1.anInt216 != 0)
  8687. i4 = class9_1.anInt216;
  8688. }
  8689. if(class9_1.atActionType == 6 && aBoolean1149) {
  8690. s = "Please wait...";
  8691. i4 = class9_1.textColor;
  8692. }
  8693. if(DrawingArea.width == 519) {
  8694. if(i4 == 0xffff00)
  8695. i4 = 255;
  8696. if(i4 == 49152)
  8697. i4 = 0xffffff;
  8698. }
  8699. if((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  8700. switch (i4) {
  8701. case 16773120: i4 = 0xFE981F; break;
  8702. case 7040819: i4 = 0xAF6A1A; break;
  8703. }
  8704. }
  8705. for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
  8706. {
  8707. if(s.indexOf("%") != -1)
  8708. {
  8709. do
  8710. {
  8711. int k7 = s.indexOf("%1");
  8712. if(k7 == -1)
  8713. break;
  8714. 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)
  8715. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8716. else
  8717. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8718. } while(true);
  8719. do
  8720. {
  8721. int l7 = s.indexOf("%2");
  8722. if(l7 == -1)
  8723. break;
  8724. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  8725. } while(true);
  8726. do
  8727. {
  8728. int i8 = s.indexOf("%3");
  8729. if(i8 == -1)
  8730. break;
  8731. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  8732. } while(true);
  8733. do
  8734. {
  8735. int j8 = s.indexOf("%4");
  8736. if(j8 == -1)
  8737. break;
  8738. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  8739. } while(true);
  8740. do
  8741. {
  8742. int k8 = s.indexOf("%5");
  8743. if(k8 == -1)
  8744. break;
  8745. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  8746. } while(true);
  8747. }
  8748. int l8 = s.indexOf("\\n");
  8749. String s1;
  8750. if(l8 != -1)
  8751. {
  8752. s1 = s.substring(0, l8);
  8753. s = s.substring(l8 + 2);
  8754. } else
  8755. {
  8756. s1 = s;
  8757. s = "";
  8758. }
  8759. if(class9_1.centerText)
  8760. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadow);
  8761. else
  8762. textDrawingArea.method389(class9_1.textShadow, k2, i4, s1, l6);
  8763. }
  8764. } else if(class9_1.type == 5) {
  8765. //whats this?
  8766. Sprite sprite;
  8767. if(interfaceIsSelected(class9_1))
  8768. sprite = class9_1.sprite2;
  8769. else
  8770. sprite = class9_1.sprite1;
  8771. if(spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
  8772. sprite.drawSprite(k2, l2, 0xffffff);
  8773. } else {
  8774. if (sprite != null)
  8775. sprite.drawSprite(k2, l2);
  8776. }
  8777. if(Autocast && class9_1.id == autocastId)
  8778. magicAuto.drawSprite(k2-3, l2-3);
  8779. if(sprite != null)
  8780. sprite.drawSprite(k2, l2);
  8781. } else if(class9_1.type == 6) {
  8782. int k3 = Texture.textureInt1;
  8783. int j4 = Texture.textureInt2;
  8784. Texture.textureInt1 = k2 + class9_1.width / 2;
  8785. Texture.textureInt2 = l2 + class9_1.height / 2;
  8786. int i5 = Texture.anIntArray1470[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8787. int l5 = Texture.anIntArray1471[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8788. boolean flag2 = interfaceIsSelected(class9_1);
  8789. int i7;
  8790. if(flag2)
  8791. i7 = class9_1.anInt258;
  8792. else
  8793. i7 = class9_1.anInt257;
  8794. Model model;
  8795. if(i7 == -1) {
  8796. model = class9_1.method209(-1, -1, flag2);
  8797. } else {
  8798. Animation animation = Animation.anims[i7];
  8799. model = class9_1.method209(animation.anIntArray354[class9_1.anInt246], animation.anIntArray353[class9_1.anInt246], flag2);
  8800. }
  8801. if(model != null)
  8802. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  8803. Texture.textureInt1 = k3;
  8804. Texture.textureInt2 = j4;
  8805. } else if(class9_1.type == 7) {
  8806. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  8807. int k4 = 0;
  8808. for(int j5 = 0; j5 < class9_1.height; j5++) {
  8809. for(int i6 = 0; i6 < class9_1.width; i6++) {
  8810. if (class9_1.type == 9) {
  8811. drawHoverBox(k2, l2, class9_1.popupString);
  8812. }
  8813. if(class9_1.inv[k4] > 0) {
  8814. ItemDef itemDef = ItemDef.forID(class9_1.inv[k4] - 1);
  8815. String s2 = itemDef.name;
  8816. if(itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  8817. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  8818. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  8819. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  8820. if(class9_1.centerText)
  8821. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadow);
  8822. else
  8823. textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  8824. }
  8825. k4++;
  8826. }
  8827. }
  8828. } else if (class9_1.type == 8) {
  8829. drawHoverBox(k2, l2, class9_1.popupString);
  8830. }
  8831. }
  8832. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  8833. }
  8834.  
  8835. private void randomizeBackground(Background background) {
  8836. int j = 256;
  8837. for(int k = 0; k < anIntArray1190.length; k++)
  8838. anIntArray1190[k] = 0;
  8839.  
  8840. for(int l = 0; l < 5000; l++) {
  8841. int i1 = (int)(Math.random() * 128D * (double)j);
  8842. anIntArray1190[i1] = (int)(Math.random() * 256D);
  8843. }
  8844. for(int j1 = 0; j1 < 20; j1++) {
  8845. for(int k1 = 1; k1 < j - 1; k1++) {
  8846. for(int i2 = 1; i2 < 127; i2++) {
  8847. int k2 = i2 + (k1 << 7);
  8848. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  8849. }
  8850.  
  8851. }
  8852. int ai[] = anIntArray1190;
  8853. anIntArray1190 = anIntArray1191;
  8854. anIntArray1191 = ai;
  8855. }
  8856. if(background != null) {
  8857. int l1 = 0;
  8858. for(int j2 = 0; j2 < background.anInt1453; j2++) {
  8859. for(int l2 = 0; l2 < background.anInt1452; l2++)
  8860. if(background.aByteArray1450[l1++] != 0) {
  8861. int i3 = l2 + 16 + background.anInt1454;
  8862. int j3 = j2 + 16 + background.anInt1455;
  8863. int k3 = i3 + (j3 << 7);
  8864. anIntArray1190[k3] = 0;
  8865. }
  8866. }
  8867. }
  8868. }
  8869.  
  8870. private void method107(int i, int j, Stream stream, Player player)
  8871. {
  8872. if((i & 0x400) != 0)
  8873. {
  8874. player.anInt1543 = stream.method428();
  8875. player.anInt1545 = stream.method428();
  8876. player.anInt1544 = stream.method428();
  8877. player.anInt1546 = stream.method428();
  8878. player.anInt1547 = stream.method436() + loopCycle;
  8879. player.anInt1548 = stream.method435() + loopCycle;
  8880. player.anInt1549 = stream.method428();
  8881. player.method446();
  8882. }
  8883. if((i & 0x100) != 0)
  8884. {
  8885. player.anInt1520 = stream.method434();
  8886. int k = stream.readDWord();
  8887. player.anInt1524 = k >> 16;
  8888. player.anInt1523 = loopCycle + (k & 0xffff);
  8889. player.anInt1521 = 0;
  8890. player.anInt1522 = 0;
  8891. if(player.anInt1523 > loopCycle)
  8892. player.anInt1521 = -1;
  8893. if(player.anInt1520 == 65535)
  8894. player.anInt1520 = -1;
  8895. }
  8896. if((i & 8) != 0)
  8897. {
  8898. int l = stream.method434();
  8899. if(l == 65535)
  8900. l = -1;
  8901. int i2 = stream.method427();
  8902. if(l == player.anim && l != -1)
  8903. {
  8904. int i3 = Animation.anims[l].anInt365;
  8905. if(i3 == 1)
  8906. {
  8907. player.anInt1527 = 0;
  8908. player.anInt1528 = 0;
  8909. player.anInt1529 = i2;
  8910. player.anInt1530 = 0;
  8911. }
  8912. if(i3 == 2)
  8913. player.anInt1530 = 0;
  8914. } else
  8915. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  8916. {
  8917. player.anim = l;
  8918. player.anInt1527 = 0;
  8919. player.anInt1528 = 0;
  8920. player.anInt1529 = i2;
  8921. player.anInt1530 = 0;
  8922. player.anInt1542 = player.smallXYIndex;
  8923. }
  8924. }
  8925. if((i & 4) != 0)
  8926. {
  8927. player.textSpoken = stream.readString();
  8928. if(player.textSpoken.charAt(0) == '~')
  8929. {
  8930. player.textSpoken = player.textSpoken.substring(1);
  8931. pushMessage(player.textSpoken, 2, player.name);
  8932. } else
  8933. if(player == myPlayer)
  8934. pushMessage(player.textSpoken, 2, player.name);
  8935. player.anInt1513 = 0;
  8936. player.anInt1531 = 0;
  8937. player.textCycle = 150;
  8938. }
  8939. if((i & 0x80) != 0)
  8940. {
  8941. //right fucking here
  8942. int i1 = stream.method434();
  8943. int j2 = stream.readUnsignedByte();
  8944. int j3 = stream.method427();
  8945. int k3 = stream.currentOffset;
  8946. if(player.name != null && player.visible)
  8947. {
  8948. long l3 = TextClass.longForName(player.name);
  8949. boolean flag = false;
  8950. if(j2 <= 1)
  8951. {
  8952. for(int i4 = 0; i4 < ignoreCount; i4++)
  8953. {
  8954. if(ignoreListAsLongs[i4] != l3)
  8955. continue;
  8956. flag = true;
  8957. break;
  8958. }
  8959.  
  8960. }
  8961. if(!flag && anInt1251 == 0)
  8962. try
  8963. {
  8964. aStream_834.currentOffset = 0;
  8965. stream.method442(j3, 0, aStream_834.buffer);
  8966. aStream_834.currentOffset = 0;
  8967. String s = TextInput.method525(j3, aStream_834);
  8968. //s = Censor.doCensor(s);
  8969. player.textSpoken = s;
  8970. player.anInt1513 = i1 >> 8;
  8971. player.privelage = j2;
  8972. player.anInt1531 = i1 & 0xff;
  8973. player.textCycle = 150;
  8974. switch (j2) {
  8975. case 1:
  8976. pushMessage(s, 1, "@cr0@" + player.name);
  8977. break;
  8978. case 2:
  8979. pushMessage(s, 1, "@cr1@" + player.name);
  8980. break;
  8981. case 3:
  8982. pushMessage(s, 1, "@cr2@" + player.name);
  8983. break;
  8984. case 4:
  8985. pushMessage(s, 1, "@cr3@" + player.name);
  8986. break;
  8987. case 5:
  8988. pushMessage(s, 1, "@cr4@" + player.name);
  8989. break;
  8990. case 6:
  8991. pushMessage(s, 1, "@cr5@" + player.name);
  8992. break;
  8993. case 7:
  8994. pushMessage(s, 1, "@cr6@" + player.name);
  8995. break;
  8996. case 8:
  8997. pushMessage(s, 1, "@cr7@" + player.name);
  8998. break;
  8999. case 9:
  9000. pushMessage(s, 1, "@cr8@" + player.name);
  9001. break;
  9002. }
  9003. /**if(j2 == 2 || j2 == 3)
  9004. pushMessage(s, 1, "@cr2@" + player.name);
  9005. else if(j2 == 1)
  9006. pushMessage(s, 1, "@cr1@" + player.name);
  9007. else
  9008. pushMessage(s, 2, player.name);
  9009. }**/
  9010. catch(Exception exception)
  9011. {
  9012. signlink.reporterror("cde2");
  9013. }
  9014. }
  9015. stream.currentOffset = k3 + j3;
  9016. }
  9017. if((i & 1) != 0)
  9018. {
  9019. player.interactingEntity = stream.method434();
  9020. if(player.interactingEntity == 65535)
  9021. player.interactingEntity = -1;
  9022. }
  9023. if((i & 0x10) != 0)
  9024. {
  9025. int j1 = stream.method427();
  9026. byte abyte0[] = new byte[j1];
  9027. Stream stream_1 = new Stream(abyte0);
  9028. stream.readBytes(j1, 0, abyte0);
  9029. aStreamArray895s[j] = stream_1;
  9030. player.updatePlayer(stream_1);
  9031. }
  9032. if((i & 2) != 0)
  9033. {
  9034. player.anInt1538 = stream.method436();
  9035. player.anInt1539 = stream.method434();
  9036. }
  9037. if((i & 0x20) != 0)
  9038. {
  9039. int k1 = stream.readUnsignedByte();
  9040. int k2 = stream.method426();
  9041. player.updateHitData(k2, k1, loopCycle);
  9042. player.loopCycleStatus = loopCycle + 300;
  9043. player.currentHealth = stream.method427();
  9044. player.maxHealth = stream.readUnsignedByte();
  9045. }
  9046. if((i & 0x200) != 0)
  9047. {
  9048. int l1 = stream.readUnsignedByte();
  9049. int l2 = stream.method428();
  9050. player.updateHitData(l2, l1, loopCycle);
  9051. player.loopCycleStatus = loopCycle + 300;
  9052. player.currentHealth = stream.readUnsignedByte();
  9053. player.maxHealth = stream.method427();
  9054. }
  9055. }
  9056.  
  9057. private void method108()
  9058. {
  9059. try
  9060. {
  9061. int j = myPlayer.x + anInt1278;
  9062. int k = myPlayer.y + anInt1131;
  9063. if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  9064. {
  9065. anInt1014 = j;
  9066. anInt1015 = k;
  9067. }
  9068. if(anInt1014 != j)
  9069. anInt1014 += (j - anInt1014) / 16;
  9070. if(anInt1015 != k)
  9071. anInt1015 += (k - anInt1015) / 16;
  9072. if(super.keyArray[1] == 1)
  9073. anInt1186 += (-24 - anInt1186) / 2;
  9074. else
  9075. if(super.keyArray[2] == 1)
  9076. anInt1186 += (24 - anInt1186) / 2;
  9077. else
  9078. anInt1186 /= 2;
  9079. if(super.keyArray[3] == 1)
  9080. anInt1187 += (12 - anInt1187) / 2;
  9081. else
  9082. if(super.keyArray[4] == 1)
  9083. anInt1187 += (-12 - anInt1187) / 2;
  9084. else
  9085. anInt1187 /= 2;
  9086. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  9087. anInt1184 += anInt1187 / 2;
  9088. if(anInt1184 < 128)
  9089. anInt1184 = 128;
  9090. if(anInt1184 > 383)
  9091. anInt1184 = 383;
  9092. int l = anInt1014 >> 7;
  9093. int i1 = anInt1015 >> 7;
  9094. int j1 = method42(plane, anInt1015, anInt1014);
  9095. int k1 = 0;
  9096. if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  9097. {
  9098. for(int l1 = l - 4; l1 <= l + 4; l1++)
  9099. {
  9100. for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  9101. {
  9102. int l2 = plane;
  9103. if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  9104. l2++;
  9105. int i3 = j1 - intGroundArray[l2][l1][k2];
  9106. if(i3 > k1)
  9107. k1 = i3;
  9108. }
  9109.  
  9110. }
  9111.  
  9112. }
  9113. anInt1005++;
  9114. if(anInt1005 > 1512)
  9115. {
  9116. anInt1005 = 0;
  9117. stream.createFrame(77);
  9118. stream.writeWordBigEndian(0);
  9119. int i2 = stream.currentOffset;
  9120. stream.writeWordBigEndian((int)(Math.random() * 256D));
  9121. stream.writeWordBigEndian(101);
  9122. stream.writeWordBigEndian(233);
  9123. stream.writeWord(45092);
  9124. if((int)(Math.random() * 2D) == 0)
  9125. stream.writeWord(35784);
  9126. stream.writeWordBigEndian((int)(Math.random() * 256D));
  9127. stream.writeWordBigEndian(64);
  9128. stream.writeWordBigEndian(38);
  9129. stream.writeWord((int)(Math.random() * 65536D));
  9130. stream.writeWord((int)(Math.random() * 65536D));
  9131. stream.writeBytes(stream.currentOffset - i2);
  9132. }
  9133. int j2 = k1 * 192;
  9134. if(j2 > 0x17f00)
  9135. j2 = 0x17f00;
  9136. if(j2 < 32768)
  9137. j2 = 32768;
  9138. if(j2 > anInt984)
  9139. {
  9140. anInt984 += (j2 - anInt984) / 24;
  9141. return;
  9142. }
  9143. if(j2 < anInt984)
  9144. {
  9145. anInt984 += (j2 - anInt984) / 80;
  9146. }
  9147. }
  9148. catch(Exception _ex)
  9149. {
  9150. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  9151. throw new RuntimeException("eek");
  9152. }
  9153. }
  9154.  
  9155. public void processDrawing()
  9156. {
  9157. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  9158. {
  9159. showErrorScreen();
  9160. return;
  9161. }
  9162. anInt1061++;
  9163. if(!loggedIn)
  9164. drawLoginScreen(false);
  9165. else
  9166. drawGameScreen();
  9167. anInt1213 = 0;
  9168. }
  9169.  
  9170. private boolean isFriendOrSelf(String s)
  9171. {
  9172. if(s == null)
  9173. return false;
  9174. for(int i = 0; i < friendsCount; i++)
  9175. if(s.equalsIgnoreCase(friendsList[i]))
  9176. return true;
  9177. return s.equalsIgnoreCase(myPlayer.name);
  9178. }
  9179.  
  9180. private static String combatDiffColor(int i, int j)
  9181. {
  9182. int k = i - j;
  9183. if(k < -9)
  9184. return "@red@";
  9185. if(k < -6)
  9186. return "@or3@";
  9187. if(k < -3)
  9188. return "@or2@";
  9189. if(k < 0)
  9190. return "@or1@";
  9191. if(k > 9)
  9192. return "@gre@";
  9193. if(k > 6)
  9194. return "@gr3@";
  9195. if(k > 3)
  9196. return "@gr2@";
  9197. if(k > 0)
  9198. return "@gr1@";
  9199. else
  9200. return "@yel@";
  9201. }
  9202.  
  9203. private void setWaveVolume(int i)
  9204. {
  9205. signlink.wavevol = i;
  9206. }
  9207.  
  9208. private void draw3dScreen()
  9209. {
  9210. drawSplitPrivateChat();
  9211. if(crosstype == 1)
  9212. {
  9213. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9214. anInt1142++;
  9215. if(anInt1142 > 67)
  9216. {
  9217. anInt1142 = 0;
  9218. stream.createFrame(78);
  9219. }
  9220. }
  9221. if(crosstype == 2)
  9222. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9223. if(anInt1018 != -1)
  9224. {
  9225. method119(anInt945, anInt1018);
  9226. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  9227. }
  9228. if(openInterfaceID != -1)
  9229. {
  9230. method119(anInt945, openInterfaceID);
  9231. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  9232. }
  9233. method70();
  9234. if(!menuOpen)
  9235. {
  9236. processRightClick();
  9237. drawTooltip();
  9238. } else
  9239. if(menuScreenArea == 0)
  9240. drawMenu();
  9241. if(anInt1055 == 1)
  9242. multiOverlay.drawSprite(472, 296);
  9243. if(pvpWindow) {
  9244. if(safeZone && !countToSafe) {
  9245. pvpIcon[0].drawSprite(414,295-18);
  9246. if((super.mouseX >= 420 && super.mouseX <= 445) && (super.mouseY >= 300-18 && super.mouseY <= 325-18))
  9247. pvpIcon[1].drawSprite((super.mouseX-89),(super.mouseY-18));
  9248. } else if(!safeZone && !countToSafe){
  9249. pvpIcon[2].drawSprite(414,295-18);
  9250. if((super.mouseX >= 420 && super.mouseX <= 445) && (super.mouseY >= 300-18 && super.mouseY <= 325-18))
  9251. pvpIcon[3].drawSprite((super.mouseX-89),(super.mouseY-18));
  9252. } else if(countToSafe) {
  9253. pvpIcon[4].drawSprite(414,295-18);
  9254. if(((System.currentTimeMillis() - pvpCount) >= 1000)) {
  9255. if(count > 0)
  9256. count--;
  9257. else if(count == 0) {
  9258. countToSafe = false;
  9259. safeZone = true;
  9260. count = 10;
  9261. }
  9262. pvpCount = System.currentTimeMillis();
  9263. }
  9264. chatTextDrawingArea.method385(0xffffff, ""+count, 311-18, 426-4);
  9265. if((System.currentTimeMillis() - pvpCount) >= 11000) {
  9266. countToSafe = false;
  9267. safeZone = true;
  9268. }
  9269. if((super.mouseX >= 420 && super.mouseX <= 445) && (super.mouseY >= 300-18 && super.mouseY <= 325-18))
  9270. pvpIcon[5].drawSprite((super.mouseX-89),(super.mouseY-18));
  9271. }
  9272. if(!countToSafe)
  9273. count = 10;
  9274. }
  9275. if(fpsOn)
  9276. {
  9277. char c = '\u01FB';
  9278. int k = 20;
  9279. int i1 = 0xffff00;
  9280. if(super.fps < 15)
  9281. i1 = 0xff0000;
  9282. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  9283. k += 15;
  9284. Runtime runtime = Runtime.getRuntime();
  9285. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9286. i1 = 0xffff00;
  9287. if(j1 > 0x2000000 && lowMem)
  9288. i1 = 0xff0000;
  9289. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  9290. k += 15;
  9291. }
  9292. int i1 = 0xffff00;
  9293. int x = baseX + (myPlayer.x - 6 >> 7);
  9294. int y = baseY + (myPlayer.y - 6 >> 7);
  9295. if (clientData)
  9296. {
  9297. char c = '\u01FB';
  9298. int k = 20;
  9299. if(super.fps < 15)
  9300. i1 = 0xff0000;
  9301. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285, 5);
  9302. Runtime runtime = Runtime.getRuntime();
  9303. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9304. i1 = 0xffff00;
  9305. if(j1 > 0x2000000 && lowMem)
  9306. i1 = 0xff0000;
  9307. k += 15;
  9308. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299, 5);
  9309. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  9310. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
  9311. }
  9312. if(anInt1104 != 0)
  9313. {
  9314. int j = anInt1104 / 50;
  9315. int l = j / 60;
  9316. j %= 60;
  9317. if(j < 10)
  9318. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  9319. else
  9320. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  9321. anInt849++;
  9322. if(anInt849 > 75)
  9323. {
  9324. anInt849 = 0;
  9325. stream.createFrame(148);
  9326. }
  9327. }
  9328. }
  9329.  
  9330. private void addIgnore(long l)
  9331. {
  9332. try
  9333. {
  9334. if(l == 0L)
  9335. return;
  9336. if(ignoreCount >= 100)
  9337. {
  9338. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  9339. return;
  9340. }
  9341. String s = TextClass.fixName(TextClass.nameForLong(l));
  9342. for(int j = 0; j < ignoreCount; j++)
  9343. if(ignoreListAsLongs[j] == l)
  9344. {
  9345. pushMessage(s + " is already on your ignore list", 0, "");
  9346. return;
  9347. }
  9348. for(int k = 0; k < friendsCount; k++)
  9349. if(friendsListAsLongs[k] == l)
  9350. {
  9351. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  9352. return;
  9353. }
  9354.  
  9355. ignoreListAsLongs[ignoreCount++] = l;
  9356. needDrawTabArea = true;
  9357. stream.createFrame(133);
  9358. stream.writeQWord(l);
  9359. return;
  9360. }
  9361. catch(RuntimeException runtimeexception)
  9362. {
  9363. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  9364. }
  9365. throw new RuntimeException();
  9366. }
  9367.  
  9368. private void method114()
  9369. {
  9370. for(int i = -1; i < playerCount; i++)
  9371. {
  9372. int j;
  9373. if(i == -1)
  9374. j = myPlayerIndex;
  9375. else
  9376. j = playerIndices[i];
  9377. Player player = playerArray[j];
  9378. if(player != null)
  9379. method96(player);
  9380. }
  9381.  
  9382. }
  9383.  
  9384. private void method115()
  9385. {
  9386. if(loadingStage == 2)
  9387. {
  9388. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  9389. {
  9390. if(class30_sub1.anInt1294 > 0)
  9391. class30_sub1.anInt1294--;
  9392. if(class30_sub1.anInt1294 == 0)
  9393. {
  9394. if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  9395. {
  9396. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  9397. class30_sub1.unlink();
  9398. }
  9399. } else
  9400. {
  9401. if(class30_sub1.anInt1302 > 0)
  9402. class30_sub1.anInt1302--;
  9403. 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)))
  9404. {
  9405. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  9406. class30_sub1.anInt1302 = -1;
  9407. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  9408. class30_sub1.unlink();
  9409. else
  9410. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  9411. class30_sub1.unlink();
  9412. }
  9413. }
  9414. }
  9415.  
  9416. }
  9417. }
  9418.  
  9419.  
  9420. //stops the click from going over sprite
  9421. private void determineMenuSize()
  9422. {
  9423. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  9424. for(int j = 0; j < menuActionRow; j++)
  9425. {
  9426. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  9427. if(k > i)
  9428. i = k;
  9429. }
  9430.  
  9431. i += 8;
  9432. int l = 15 * menuActionRow + 21;
  9433. if(super.saveClickX > 4 && super.saveClickY > 4 && super.saveClickX < 516 && super.saveClickY < 338)
  9434. {
  9435. int i1 = super.saveClickX - 4 - i / 2;
  9436. if(i1 + i > 512)
  9437. i1 = 512 - i;
  9438. if(i1 < 0)
  9439. i1 = 0;
  9440. int l1 = super.saveClickY - 4;
  9441. if(l1 + l > 334)
  9442. l1 = 334 - l;
  9443. if(l1 < 0)
  9444. l1 = 0;
  9445. menuOpen = true;
  9446. menuScreenArea = 0;
  9447. menuOffsetX = i1;
  9448. menuOffsetY = l1;
  9449. menuWidth = i;
  9450. menuHeight = 15 * menuActionRow + 22;
  9451. }
  9452. if(super.saveClickX > 519 && super.saveClickY > 168 && super.saveClickX < 765 && super.saveClickY < 503)
  9453. {
  9454. int j1 = super.saveClickX - 519 - i / 2;
  9455. if(j1 < 0)
  9456. j1 = 0;
  9457. else
  9458. if(j1 + i > 245)
  9459. j1 = 245 - i;
  9460. int i2 = super.saveClickY - 168;
  9461. if(i2 < 0)
  9462. i2 = 0;
  9463. else
  9464. if(i2 + l > 333)
  9465. i2 = 333 - l;
  9466. menuOpen = true;
  9467. menuScreenArea = 1;
  9468. menuOffsetX = j1;
  9469. menuOffsetY = i2;
  9470. menuWidth = i;
  9471. menuHeight = 15 * menuActionRow + 22;
  9472. }
  9473. if(super.saveClickX > 0 && super.saveClickY > 338 && super.saveClickX < 516 && super.saveClickY < 503)
  9474. {
  9475. int k1 = super.saveClickX - 0 - i / 2;
  9476. if(k1 < 0)
  9477. k1 = 0;
  9478. else
  9479. if(k1 + i > 516)
  9480. k1 = 516 - i;
  9481. int j2 = super.saveClickY - 338;
  9482. if(j2 < 0)
  9483. j2 = 0;
  9484. else
  9485. if(j2 + l > 165)
  9486. j2 = 165 - l;
  9487. menuOpen = true;
  9488. menuScreenArea = 2;
  9489. menuOffsetX = k1;
  9490. menuOffsetY = j2;
  9491. menuWidth = i;
  9492. menuHeight = 15 * menuActionRow + 22;
  9493. }
  9494. }
  9495.  
  9496. private void method117(Stream stream)
  9497. {
  9498. stream.initBitAccess();
  9499. int j = stream.readBits(1);
  9500. if(j == 0)
  9501. return;
  9502. int k = stream.readBits(2);
  9503. if(k == 0)
  9504. {
  9505. anIntArray894[anInt893++] = myPlayerIndex;
  9506. return;
  9507. }
  9508. if(k == 1)
  9509. {
  9510. int l = stream.readBits(3);
  9511. myPlayer.moveInDir(false, l);
  9512. int k1 = stream.readBits(1);
  9513. if(k1 == 1)
  9514. anIntArray894[anInt893++] = myPlayerIndex;
  9515. return;
  9516. }
  9517. if(k == 2)
  9518. {
  9519. int i1 = stream.readBits(3);
  9520. myPlayer.moveInDir(true, i1);
  9521. int l1 = stream.readBits(3);
  9522. myPlayer.moveInDir(true, l1);
  9523. int j2 = stream.readBits(1);
  9524. if(j2 == 1)
  9525. anIntArray894[anInt893++] = myPlayerIndex;
  9526. return;
  9527. }
  9528. if(k == 3)
  9529. {
  9530. plane = stream.readBits(2);
  9531. int j1 = stream.readBits(1);
  9532. int i2 = stream.readBits(1);
  9533. if(i2 == 1)
  9534. anIntArray894[anInt893++] = myPlayerIndex;
  9535. int k2 = stream.readBits(7);
  9536. int l2 = stream.readBits(7);
  9537. myPlayer.setPos(l2, k2, j1 == 1);
  9538. }
  9539. }
  9540.  
  9541. private void nullLoader()
  9542. {
  9543. aBoolean831 = false;
  9544. while(drawingFlames)
  9545. {
  9546. aBoolean831 = false;
  9547. try
  9548. {
  9549. Thread.sleep(50L);
  9550. }
  9551. catch(Exception _ex) { }
  9552. }
  9553. aBackground_966 = null;
  9554. aBackground_967 = null;
  9555. aBackgroundArray1152s = null;
  9556. anIntArray850 = null;
  9557. anIntArray851 = null;
  9558. anIntArray852 = null;
  9559. anIntArray853 = null;
  9560. anIntArray1190 = null;
  9561. anIntArray1191 = null;
  9562. anIntArray828 = null;
  9563. anIntArray829 = null;
  9564. aClass30_Sub2_Sub1_Sub1_1201 = null;
  9565. aClass30_Sub2_Sub1_Sub1_1202 = null;
  9566. }
  9567.  
  9568. private boolean method119(int i, int j)
  9569. {
  9570. boolean flag1 = false;
  9571. RSInterface class9 = RSInterface.interfaceCache[j];
  9572. for(int k = 0; k < class9.children.length; k++)
  9573. {
  9574. if(class9.children[k] == -1)
  9575. break;
  9576. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  9577. if(class9_1.type == 1)
  9578. flag1 |= method119(i, class9_1.id);
  9579. if(class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1))
  9580. {
  9581. boolean flag2 = interfaceIsSelected(class9_1);
  9582. int l;
  9583. if(flag2)
  9584. l = class9_1.anInt258;
  9585. else
  9586. l = class9_1.anInt257;
  9587. if(l != -1)
  9588. {
  9589. Animation animation = Animation.anims[l];
  9590. for(class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);)
  9591. {
  9592. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  9593. class9_1.anInt246++;
  9594. if(class9_1.anInt246 >= animation.anInt352)
  9595. {
  9596. class9_1.anInt246 -= animation.anInt356;
  9597. if(class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  9598. class9_1.anInt246 = 0;
  9599. }
  9600. flag1 = true;
  9601. }
  9602.  
  9603. }
  9604. }
  9605. }
  9606.  
  9607. return flag1;
  9608. }
  9609.  
  9610. private int method120()
  9611. {
  9612. int j = 3;
  9613. if(yCameraCurve < 310)
  9614. {
  9615. int k = xCameraPos >> 7;
  9616. int l = yCameraPos >> 7;
  9617. int i1 = myPlayer.x >> 7;
  9618. int j1 = myPlayer.y >> 7;
  9619. if((byteGroundArray[plane][k][l] & 4) != 0)
  9620. j = plane;
  9621. int k1;
  9622. if(i1 > k)
  9623. k1 = i1 - k;
  9624. else
  9625. k1 = k - i1;
  9626. int l1;
  9627. if(j1 > l)
  9628. l1 = j1 - l;
  9629. else
  9630. l1 = l - j1;
  9631. if(k1 > l1)
  9632. {
  9633. int i2 = (l1 * 0x10000) / k1;
  9634. int k2 = 32768;
  9635. while(k != i1)
  9636. {
  9637. if(k < i1)
  9638. k++;
  9639. else
  9640. if(k > i1)
  9641. k--;
  9642. if((byteGroundArray[plane][k][l] & 4) != 0)
  9643. j = plane;
  9644. k2 += i2;
  9645. if(k2 >= 0x10000)
  9646. {
  9647. k2 -= 0x10000;
  9648. if(l < j1)
  9649. l++;
  9650. else
  9651. if(l > j1)
  9652. l--;
  9653. if((byteGroundArray[plane][k][l] & 4) != 0)
  9654. j = plane;
  9655. }
  9656. }
  9657. } else
  9658. {
  9659. int j2 = (k1 * 0x10000) / l1;
  9660. int l2 = 32768;
  9661. while(l != j1)
  9662. {
  9663. if(l < j1)
  9664. l++;
  9665. else
  9666. if(l > j1)
  9667. l--;
  9668. if((byteGroundArray[plane][k][l] & 4) != 0)
  9669. j = plane;
  9670. l2 += j2;
  9671. if(l2 >= 0x10000)
  9672. {
  9673. l2 -= 0x10000;
  9674. if(k < i1)
  9675. k++;
  9676. else
  9677. if(k > i1)
  9678. k--;
  9679. if((byteGroundArray[plane][k][l] & 4) != 0)
  9680. j = plane;
  9681. }
  9682. }
  9683. }
  9684. }
  9685. if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  9686. j = plane;
  9687. return j;
  9688. }
  9689.  
  9690. private int method121()
  9691. {
  9692. int j = method42(plane, yCameraPos, xCameraPos);
  9693. if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  9694. return plane;
  9695. else
  9696. return 3;
  9697. }
  9698.  
  9699. private void delIgnore(long l)
  9700. {
  9701. try
  9702. {
  9703. if(l == 0L)
  9704. return;
  9705. for(int j = 0; j < ignoreCount; j++)
  9706. if(ignoreListAsLongs[j] == l)
  9707. {
  9708. ignoreCount--;
  9709. needDrawTabArea = true;
  9710. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  9711.  
  9712. stream.createFrame(74);
  9713. stream.writeQWord(l);
  9714. return;
  9715. }
  9716.  
  9717. return;
  9718. }
  9719. catch(RuntimeException runtimeexception)
  9720. {
  9721. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9722. }
  9723. throw new RuntimeException();
  9724. }
  9725.  
  9726.  
  9727. private void chatJoin(long l) {
  9728. try {
  9729. if(l == 0L)
  9730. return;
  9731. stream.createFrame(60);
  9732. stream.writeQWord(l);
  9733. return;
  9734. }
  9735. catch(RuntimeException runtimeexception)
  9736. {
  9737. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9738. }
  9739. throw new RuntimeException();
  9740.  
  9741. }
  9742.  
  9743. public String getParameter(String s)
  9744. {
  9745. if(signlink.mainapp != null)
  9746. return signlink.mainapp.getParameter(s);
  9747. else
  9748. return super.getParameter(s);
  9749. }
  9750.  
  9751. private void adjustVolume(boolean flag, int i)
  9752. {
  9753. signlink.midivol = i;
  9754. if(flag)
  9755. signlink.midi = "voladjust";
  9756. }
  9757.  
  9758. private int extractInterfaceValues(RSInterface class9, int j)
  9759. {
  9760. if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  9761. return -2;
  9762. try
  9763. {
  9764. int ai[] = class9.valueIndexArray[j];
  9765. int k = 0;
  9766. int l = 0;
  9767. int i1 = 0;
  9768. do
  9769. {
  9770. int j1 = ai[l++];
  9771. int k1 = 0;
  9772. byte byte0 = 0;
  9773. if(j1 == 0)
  9774. return k;
  9775. if(j1 == 1)
  9776. k1 = currentStats[ai[l++]];
  9777. if(j1 == 2)
  9778. k1 = maxStats[ai[l++]];
  9779. if(j1 == 3)
  9780. k1 = currentExp[ai[l++]];
  9781. if(j1 == 4)
  9782. {
  9783. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  9784. int k2 = ai[l++];
  9785. if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  9786. {
  9787. for(int j3 = 0; j3 < class9_1.inv.length; j3++)
  9788. if(class9_1.inv[j3] == k2 + 1)
  9789. k1 += class9_1.invStackSizes[j3];
  9790.  
  9791. }
  9792. }
  9793. if(j1 == 5)
  9794. k1 = variousSettings[ai[l++]];
  9795. if(j1 == 6)
  9796. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  9797. if(j1 == 7)
  9798. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  9799. if(j1 == 8)
  9800. k1 = myPlayer.combatLevel;
  9801. if(j1 == 9)
  9802. {
  9803. for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  9804. if(Skills.skillEnabled[l1])
  9805. k1 += maxStats[l1];
  9806.  
  9807. }
  9808. if(j1 == 10)
  9809. {
  9810. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  9811. int l2 = ai[l++] + 1;
  9812. if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  9813. {
  9814. for(int k3 = 0; k3 < class9_2.inv.length; k3++)
  9815. {
  9816. if(class9_2.inv[k3] != l2)
  9817. continue;
  9818. k1 = 0x3b9ac9ff;
  9819. break;
  9820. }
  9821.  
  9822. }
  9823. }
  9824. if(j1 == 11)
  9825. k1 = energy;
  9826. if(j1 == 12)
  9827. k1 = weight;
  9828. if(j1 == 13)
  9829. {
  9830. int i2 = variousSettings[ai[l++]];
  9831. int i3 = ai[l++];
  9832. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  9833. }
  9834. if(j1 == 14)
  9835. {
  9836. int j2 = ai[l++];
  9837. VarBit varBit = VarBit.cache[j2];
  9838. int l3 = varBit.anInt648;
  9839. int i4 = varBit.anInt649;
  9840. int j4 = varBit.anInt650;
  9841. int k4 = anIntArray1232[j4 - i4];
  9842. k1 = variousSettings[l3] >> i4 & k4;
  9843. }
  9844. if(j1 == 15)
  9845. byte0 = 1;
  9846. if(j1 == 16)
  9847. byte0 = 2;
  9848. if(j1 == 17)
  9849. byte0 = 3;
  9850. if(j1 == 18)
  9851. k1 = (myPlayer.x >> 7) + baseX;
  9852. if(j1 == 19)
  9853. k1 = (myPlayer.y >> 7) + baseY;
  9854. if(j1 == 20)
  9855. k1 = ai[l++];
  9856. if(byte0 == 0)
  9857. {
  9858. if(i1 == 0)
  9859. k += k1;
  9860. if(i1 == 1)
  9861. k -= k1;
  9862. if(i1 == 2 && k1 != 0)
  9863. k /= k1;
  9864. if(i1 == 3)
  9865. k *= k1;
  9866. i1 = 0;
  9867. } else
  9868. {
  9869. i1 = byte0;
  9870. }
  9871. } while(true);
  9872. }
  9873. catch(Exception _ex)
  9874. {
  9875. return -1;
  9876. }
  9877. }
  9878.  
  9879. private void drawTooltip() {
  9880. if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  9881. return;
  9882. String s;
  9883. if(itemSelected == 1 && menuActionRow < 2)
  9884. s = "Use " + selectedItemName + " with...";
  9885. else if(spellSelected == 1 && menuActionRow < 2)
  9886. s = spellTooltip + "...";
  9887. else
  9888. s = menuActionName[menuActionRow - 1];
  9889. if(menuActionRow > 2)
  9890. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  9891. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  9892. }
  9893.  
  9894. private void drawMinimap() {
  9895. aRSImageProducer_1164.initDrawingArea();
  9896. if(anInt1021 == 2) {
  9897. byte abyte0[] = mapBack.aByteArray1450;
  9898. int ai[] = DrawingArea.pixels;
  9899. int k2 = abyte0.length;
  9900. for(int i5 = 0; i5 < k2; i5++)
  9901. if(abyte0[i5] == 0)
  9902. ai[i5] = 0;
  9903. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 0, 0, 33, 25);
  9904. aRSImageProducer_1165.initDrawingArea();
  9905. return;
  9906. }
  9907. int i = minimapInt1 + minimapInt2 & 0x7ff;
  9908. int j = 48 + myPlayer.x / 32;
  9909. int l2 = 464 - myPlayer.y / 32;
  9910. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, 5, 25, 146, j);
  9911. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 0, 0, 33, 25);
  9912. for(int j5 = 0; j5 < anInt1071; j5++) {
  9913. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  9914. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  9915. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  9916. }
  9917. for(int k5 = 0; k5 < 104; k5++) {
  9918. for(int l5 = 0; l5 < 104; l5++) {
  9919. NodeList class19 = groundArray[plane][k5][l5];
  9920. if(class19 != null) {
  9921. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  9922. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  9923. markMinimap(mapDotItem, l, j3);
  9924. }
  9925. }
  9926. }
  9927. for(int i6 = 0; i6 < npcCount; i6++) {
  9928. NPC npc = npcArray[npcIndices[i6]];
  9929. if(npc != null && npc.isVisible()) {
  9930. EntityDef entityDef = npc.desc;
  9931. if(entityDef.childrenIDs != null)
  9932. entityDef = entityDef.method161();
  9933. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  9934. int i1 = npc.x / 32 - myPlayer.x / 32;
  9935. int k3 = npc.y / 32 - myPlayer.y / 32;
  9936. markMinimap(mapDotNPC, i1, k3);
  9937. }
  9938. }
  9939. }
  9940. for(int j6 = 0; j6 < playerCount; j6++) {
  9941. Player player = playerArray[playerIndices[j6]];
  9942. if(player != null && player.isVisible()) {
  9943. int j1 = player.x / 32 - myPlayer.x / 32;
  9944. int l3 = player.y / 32 - myPlayer.y / 32;
  9945. boolean flag1 = false;
  9946. boolean flag3 = false;
  9947. for (int j3 = 0; j3 < clanList.length; j3++) {
  9948. if (clanList[j3] == null)
  9949. continue;
  9950. if (!clanList[j3].equalsIgnoreCase(player.name))
  9951. continue;
  9952. flag3 = true;
  9953. break;
  9954. }
  9955. long l6 = TextClass.longForName(player.name);
  9956. for(int k6 = 0; k6 < friendsCount; k6++) {
  9957. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  9958. continue;
  9959. flag1 = true;
  9960. break;
  9961. }
  9962. boolean flag2 = false;
  9963. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  9964. flag2 = true;
  9965. if(flag1)
  9966. markMinimap(mapDotFriend, j1, l3);
  9967. else if(flag3)
  9968. markMinimap(mapDotClan, j1, l3);
  9969. else if(flag2)
  9970. markMinimap(mapDotTeam, j1, l3);
  9971. else
  9972. markMinimap(mapDotPlayer, j1, l3);
  9973. }
  9974. }
  9975. if(anInt855 != 0 && loopCycle % 20 < 10) {
  9976. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  9977. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  9978. if(class30_sub2_sub4_sub1_sub1_1 != null) {
  9979. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  9980. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  9981. method81(mapMarker, i4, k1);
  9982. }
  9983. }
  9984. if(anInt855 == 2) {
  9985. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  9986. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  9987. method81(mapMarker, j4, l1);
  9988. }
  9989. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length) {
  9990. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  9991. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  9992. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  9993. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  9994. method81(mapMarker, k4, i2);
  9995. }
  9996. }
  9997. }
  9998. if(destX != 0) {
  9999. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  10000. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  10001. markMinimap(mapFlag, j2, l4);
  10002. }
  10003. DrawingArea.drawPixels(3, 78, 97, 0xffffff, 3);
  10004. mapBack.drawBackground(0, 0);
  10005. aRSImageProducer_1165.initDrawingArea();
  10006. }
  10007.  
  10008. private void npcScreenPos(Entity entity, int i) {
  10009. calcEntityScreenPos(entity.x, i, entity.y);
  10010. }
  10011.  
  10012. private void calcEntityScreenPos(int i, int j, int l) {
  10013. if(i < 128 || l < 128 || i > 13056 || l > 13056) {
  10014. spriteDrawX = -1;
  10015. spriteDrawY = -1;
  10016. return;
  10017. }
  10018. int i1 = method42(plane, l, i) - j;
  10019. i -= xCameraPos;
  10020. i1 -= zCameraPos;
  10021. l -= yCameraPos;
  10022. int j1 = Model.modelIntArray1[yCameraCurve];
  10023. int k1 = Model.modelIntArray2[yCameraCurve];
  10024. int l1 = Model.modelIntArray1[xCameraCurve];
  10025. int i2 = Model.modelIntArray2[xCameraCurve];
  10026. int j2 = l * l1 + i * i2 >> 16;
  10027. l = l * i2 - i * l1 >> 16;
  10028. i = j2;
  10029. j2 = i1 * k1 - l * j1 >> 16;
  10030. l = i1 * j1 + l * k1 >> 16;
  10031. i1 = j2;
  10032. if(l >= 50) {
  10033. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  10034. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  10035. } else {
  10036. spriteDrawX = -1;
  10037. spriteDrawY = -1;
  10038. }
  10039. }
  10040.  
  10041. private void buildSplitPrivateChatMenu()
  10042. {
  10043. if(splitPrivateChat == 0)
  10044. return;
  10045. int i = 0;
  10046. if(anInt1104 != 0)
  10047. i = 1;
  10048. for(int j = 0; j < 100; j++)
  10049. if(chatMessages[j] != null)
  10050. {
  10051. int k = chattypes[j];
  10052. String s = chatNames[j];
  10053. boolean flag1 = false;
  10054. if(s != null && s.startsWith("@cr0@")) {
  10055. s = s.substring(5);
  10056. boolean flag2 = true;
  10057. byte byte0 = 1;
  10058. }
  10059. if(s != null && s.startsWith("@cr1@")) {
  10060. s = s.substring(5);
  10061. byte byte0 = 2;
  10062. }
  10063. if(s != null && s.startsWith("@cr2@")) {
  10064. s = s.substring(5);
  10065. byte byte0 = 3;
  10066. }
  10067. if(s != null && s.startsWith("@cr3@")) {
  10068. s = s.substring(5);
  10069. byte byte0 = 4;
  10070. }
  10071. if(s != null && s.startsWith("@cr4@")) {
  10072. s = s.substring(5);
  10073. byte byte0 = 5;
  10074. }
  10075. if(s != null && s.startsWith("@cr5@")) {
  10076. s = s.substring(5);
  10077. byte byte0 = 6;
  10078. }
  10079. if(s != null && s.startsWith("@cr6@")) {
  10080. s = s.substring(5);
  10081. byte byte0 = 7;
  10082. }
  10083. if(s != null && s.startsWith("@cr7@")) {
  10084. s = s.substring(5);
  10085. byte byte0 = 8;
  10086. }
  10087. if(s != null && s.startsWith("@cr8@")) {
  10088. s = s.substring(5);
  10089. byte byte0 = 9;
  10090. }
  10091. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  10092. {
  10093. int l = 329 - i * 13;
  10094. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  10095. {
  10096. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  10097. if(i1 > 450)
  10098. i1 = 450;
  10099. if(super.mouseX < 4 + i1)
  10100. {
  10101. if(myPrivilege >= 1)
  10102. {
  10103. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  10104. menuActionID[menuActionRow] = 2606;
  10105. menuActionRow++;
  10106. }
  10107. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  10108. menuActionID[menuActionRow] = 2042;
  10109. menuActionRow++;
  10110. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  10111. menuActionID[menuActionRow] = 2337;
  10112. menuActionRow++;
  10113. }
  10114. }
  10115. if(++i >= 5)
  10116. return;
  10117. }
  10118. if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  10119. return;
  10120. }
  10121.  
  10122. }
  10123.  
  10124. private void method130(int j, int k, int l, int i1, int j1, int k1,
  10125. int l1, int i2, int j2)
  10126. {
  10127. Class30_Sub1 class30_sub1 = null;
  10128. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10129. {
  10130. if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  10131. continue;
  10132. class30_sub1 = class30_sub1_1;
  10133. break;
  10134. }
  10135.  
  10136. if(class30_sub1 == null)
  10137. {
  10138. class30_sub1 = new Class30_Sub1();
  10139. class30_sub1.anInt1295 = l1;
  10140. class30_sub1.anInt1296 = i1;
  10141. class30_sub1.anInt1297 = i2;
  10142. class30_sub1.anInt1298 = j1;
  10143. method89(class30_sub1);
  10144. aClass19_1179.insertHead(class30_sub1);
  10145. }
  10146. class30_sub1.anInt1291 = k;
  10147. class30_sub1.anInt1293 = k1;
  10148. class30_sub1.anInt1292 = l;
  10149. class30_sub1.anInt1302 = j2;
  10150. class30_sub1.anInt1294 = j;
  10151. }
  10152.  
  10153. private boolean interfaceIsSelected(RSInterface class9)
  10154. {
  10155. if(class9.valueCompareType == null)
  10156. return false;
  10157. for(int i = 0; i < class9.valueCompareType.length; i++)
  10158. {
  10159. int j = extractInterfaceValues(class9, i);
  10160. int k = class9.requiredValues[i];
  10161. if(class9.valueCompareType[i] == 2)
  10162. {
  10163. if(j >= k)
  10164. return false;
  10165. } else
  10166. if(class9.valueCompareType[i] == 3)
  10167. {
  10168. if(j <= k)
  10169. return false;
  10170. } else
  10171. if(class9.valueCompareType[i] == 4)
  10172. {
  10173. if(j == k)
  10174. return false;
  10175. } else
  10176. if(j != k)
  10177. return false;
  10178. }
  10179.  
  10180. return true;
  10181. }
  10182.  
  10183. private DataInputStream openJagGrabInputStream(String s)
  10184. throws IOException
  10185. {
  10186. // if(!aBoolean872)
  10187. // if(signlink.mainapp != null)
  10188. // return signlink.openurl(s);
  10189. // else
  10190. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  10191. if(aSocket832 != null)
  10192. {
  10193. try
  10194. {
  10195. aSocket832.close();
  10196. }
  10197. catch(Exception _ex) { }
  10198. aSocket832 = null;
  10199. }
  10200. aSocket832 = openSocket(43595);
  10201. aSocket832.setSoTimeout(10000);
  10202. java.io.InputStream inputstream = aSocket832.getInputStream();
  10203. OutputStream outputstream = aSocket832.getOutputStream();
  10204. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  10205. return new DataInputStream(inputstream);
  10206. }
  10207.  
  10208. private void doFlamesDrawing()
  10209. {
  10210. char c = '\u0100';
  10211. if(anInt1040 > 0)
  10212. {
  10213. for(int i = 0; i < 256; i++)
  10214. if(anInt1040 > 768)
  10215. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  10216. else
  10217. if(anInt1040 > 256)
  10218. anIntArray850[i] = anIntArray852[i];
  10219. else
  10220. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  10221.  
  10222. } else
  10223. if(anInt1041 > 0)
  10224. {
  10225. for(int j = 0; j < 256; j++)
  10226. if(anInt1041 > 768)
  10227. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  10228. else
  10229. if(anInt1041 > 256)
  10230. anIntArray850[j] = anIntArray853[j];
  10231. else
  10232. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  10233.  
  10234. } else
  10235. {
  10236. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  10237.  
  10238. }
  10239. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, aRSImageProducer_1110.anIntArray315, 0, 33920);
  10240.  
  10241. int i1 = 0;
  10242. int j1 = 1152;
  10243. for(int k1 = 1; k1 < c - 1; k1++)
  10244. {
  10245. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  10246. int j2 = 22 + l1;
  10247. if(j2 < 0)
  10248. j2 = 0;
  10249. i1 += j2;
  10250. for(int l2 = j2; l2 < 128; l2++)
  10251. {
  10252. int j3 = anIntArray828[i1++];
  10253. if(j3 != 0)
  10254. {
  10255. int l3 = j3;
  10256. int j4 = 256 - j3;
  10257. j3 = anIntArray850[j3];
  10258. int l4 = aRSImageProducer_1110.anIntArray315[j1];
  10259. aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  10260. } else
  10261. {
  10262. j1++;
  10263. }
  10264. }
  10265.  
  10266. j1 += j2;
  10267. }
  10268.  
  10269. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  10270. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, aRSImageProducer_1111.anIntArray315, 0, 33920);
  10271.  
  10272. i1 = 0;
  10273. j1 = 1176;
  10274. for(int k2 = 1; k2 < c - 1; k2++)
  10275. {
  10276. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  10277. int k3 = 103 - i3;
  10278. j1 += i3;
  10279. for(int i4 = 0; i4 < k3; i4++)
  10280. {
  10281. int k4 = anIntArray828[i1++];
  10282. if(k4 != 0)
  10283. {
  10284. int i5 = k4;
  10285. int j5 = 256 - k4;
  10286. k4 = anIntArray850[k4];
  10287. int k5 = aRSImageProducer_1111.anIntArray315[j1];
  10288. aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  10289. } else
  10290. {
  10291. j1++;
  10292. }
  10293. }
  10294.  
  10295. i1 += 128 - k3;
  10296. j1 += 128 - k3 - i3;
  10297. }
  10298.  
  10299. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  10300. }
  10301.  
  10302. private void method134(Stream stream)
  10303. {
  10304. int j = stream.readBits(8);
  10305. if(j < playerCount)
  10306. {
  10307. for(int k = j; k < playerCount; k++)
  10308. anIntArray840[anInt839++] = playerIndices[k];
  10309.  
  10310. }
  10311. if(j > playerCount)
  10312. {
  10313. signlink.reporterror(myUsername + " Too many players");
  10314. throw new RuntimeException("eek");
  10315. }
  10316. playerCount = 0;
  10317. for(int l = 0; l < j; l++)
  10318. {
  10319. int i1 = playerIndices[l];
  10320. Player player = playerArray[i1];
  10321. int j1 = stream.readBits(1);
  10322. if(j1 == 0)
  10323. {
  10324. playerIndices[playerCount++] = i1;
  10325. player.anInt1537 = loopCycle;
  10326. } else
  10327. {
  10328. int k1 = stream.readBits(2);
  10329. if(k1 == 0)
  10330. {
  10331. playerIndices[playerCount++] = i1;
  10332. player.anInt1537 = loopCycle;
  10333. anIntArray894[anInt893++] = i1;
  10334. } else
  10335. if(k1 == 1)
  10336. {
  10337. playerIndices[playerCount++] = i1;
  10338. player.anInt1537 = loopCycle;
  10339. int l1 = stream.readBits(3);
  10340. player.moveInDir(false, l1);
  10341. int j2 = stream.readBits(1);
  10342. if(j2 == 1)
  10343. anIntArray894[anInt893++] = i1;
  10344. } else
  10345. if(k1 == 2)
  10346. {
  10347. playerIndices[playerCount++] = i1;
  10348. player.anInt1537 = loopCycle;
  10349. int i2 = stream.readBits(3);
  10350. player.moveInDir(true, i2);
  10351. int k2 = stream.readBits(3);
  10352. player.moveInDir(true, k2);
  10353. int l2 = stream.readBits(1);
  10354. if(l2 == 1)
  10355. anIntArray894[anInt893++] = i1;
  10356. } else
  10357. if(k1 == 3)
  10358. anIntArray840[anInt839++] = i1;
  10359. }
  10360. }
  10361. }
  10362.  
  10363. private void drawLoginScreen(boolean flag)
  10364. {
  10365. resetImageProducers();
  10366. aRSImageProducer_1109.initDrawingArea();
  10367. aBackground_966.drawBackground(0, 0);
  10368. char c = '\u0168';
  10369. char c1 = '\310';
  10370. if(loginScreenState == 0)
  10371. {
  10372. int i = c1 / 2 + 80;
  10373. smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  10374. i = c1 / 2 - 20;
  10375. chatTextDrawingArea.method382(0xffff00, c / 2, "Welcome to HyBriD PvP", i, true);
  10376. i += 30;
  10377. int l = c / 2 - 80;
  10378. int k1 = c1 / 2 + 20;
  10379. aBackground_967.drawBackground(l - 73, k1 - 20);
  10380. chatTextDrawingArea.method382(0xffffff, l, "New User", k1 + 5, true);
  10381. l = c / 2 + 80;
  10382. aBackground_967.drawBackground(l - 73, k1 - 20);
  10383. chatTextDrawingArea.method382(0xffffff, l, "Existing User", k1 + 5, true);
  10384. }
  10385. if(loginScreenState == 2)
  10386. {
  10387. int j = c1 / 2 - 40;
  10388. if(loginMessage1.length() > 0)
  10389. {
  10390. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  10391. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j, true);
  10392. j += 30;
  10393. } else
  10394. {
  10395. chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  10396. j += 30;
  10397. }
  10398. chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff, "Username: " + myUsername + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10399. j += 15;
  10400. chatTextDrawingArea.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10401. j += 15;
  10402. if(!flag)
  10403. {
  10404. int i1 = c / 2 - 80;
  10405. int l1 = c1 / 2 + 50;
  10406. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10407. chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5, true);
  10408. i1 = c / 2 + 80;
  10409. aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10410. chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  10411. }
  10412. }
  10413. if(loginScreenState == 3)
  10414. {
  10415. chatTextDrawingArea.method382(0xffff00, c / 2, "Create a free account", c1 / 2 - 60, true);
  10416. int k = c1 / 2 - 35;
  10417. chatTextDrawingArea.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
  10418. k += 15;
  10419. chatTextDrawingArea.method382(0xffffff, c / 2, "go back to the main HyBriD PvP webpage", k, true);
  10420. k += 15;
  10421. chatTextDrawingArea.method382(0xffffff, c / 2, "and choose the red 'create account'", k, true);
  10422. k += 15;
  10423. chatTextDrawingArea.method382(0xffffff, c / 2, "button at the top right of that page.", k, true);
  10424. k += 15;
  10425. int j1 = c / 2;
  10426. int i2 = c1 / 2 + 50;
  10427. aBackground_967.drawBackground(j1 - 73, i2 - 20);
  10428. chatTextDrawingArea.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  10429. }
  10430. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  10431. if(welcomeScreenRaised)
  10432. {
  10433. welcomeScreenRaised = false;
  10434. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  10435. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  10436. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  10437. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  10438. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  10439. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  10440. }
  10441. }
  10442.  
  10443. private void drawFlames()
  10444. {
  10445. drawingFlames = true;
  10446. try
  10447. {
  10448. long l = System.currentTimeMillis();
  10449. int i = 0;
  10450. int j = 20;
  10451. while(aBoolean831)
  10452. {
  10453. anInt1208++;
  10454. //calcFlamesPosition();
  10455. //calcFlamesPosition();
  10456. doFlamesDrawing();
  10457. if(++i > 10)
  10458. {
  10459. long l1 = System.currentTimeMillis();
  10460. int k = (int)(l1 - l) / 10 - j;
  10461. j = 40 - k;
  10462. if(j < 5)
  10463. j = 5;
  10464. i = 0;
  10465. l = l1;
  10466. }
  10467. try
  10468. {
  10469. Thread.sleep(j);
  10470. }
  10471. catch(Exception _ex) { }
  10472. }
  10473. }
  10474. catch(Exception _ex) { }
  10475. drawingFlames = false;
  10476. }
  10477.  
  10478. public void raiseWelcomeScreen()
  10479. {
  10480. welcomeScreenRaised = true;
  10481. }
  10482.  
  10483. private void method137(Stream stream, int j)
  10484. {
  10485. if(j == 84)
  10486. {
  10487. int k = stream.readUnsignedByte();
  10488. int j3 = anInt1268 + (k >> 4 & 7);
  10489. int i6 = anInt1269 + (k & 7);
  10490. int l8 = stream.readUnsignedWord();
  10491. int k11 = stream.readUnsignedWord();
  10492. int l13 = stream.readUnsignedWord();
  10493. if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  10494. {
  10495. NodeList class19_1 = groundArray[plane][j3][i6];
  10496. if(class19_1 != null)
  10497. {
  10498. 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())
  10499. {
  10500. if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  10501. continue;
  10502. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  10503. break;
  10504. }
  10505.  
  10506. spawnGroundItem(j3, i6);
  10507. }
  10508. }
  10509. return;
  10510. }
  10511. if(j == 105)
  10512. {
  10513. int l = stream.readUnsignedByte();
  10514. int k3 = anInt1268 + (l >> 4 & 7);
  10515. int j6 = anInt1269 + (l & 7);
  10516. int i9 = stream.readUnsignedWord();
  10517. int l11 = stream.readUnsignedByte();
  10518. int i14 = l11 >> 4 & 0xf;
  10519. int i16 = l11 & 7;
  10520. 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)
  10521. {
  10522. anIntArray1207[anInt1062] = i9;
  10523. anIntArray1241[anInt1062] = i16;
  10524. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  10525. anInt1062++;
  10526. }
  10527. }
  10528. if(j == 215)
  10529. {
  10530. int i1 = stream.method435();
  10531. int l3 = stream.method428();
  10532. int k6 = anInt1268 + (l3 >> 4 & 7);
  10533. int j9 = anInt1269 + (l3 & 7);
  10534. int i12 = stream.method435();
  10535. int j14 = stream.readUnsignedWord();
  10536. if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  10537. {
  10538. Item class30_sub2_sub4_sub2_2 = new Item();
  10539. class30_sub2_sub4_sub2_2.ID = i1;
  10540. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  10541. if(groundArray[plane][k6][j9] == null)
  10542. groundArray[plane][k6][j9] = new NodeList();
  10543. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  10544. spawnGroundItem(k6, j9);
  10545. }
  10546. return;
  10547. }
  10548. if(j == 156)
  10549. {
  10550. int j1 = stream.method426();
  10551. int i4 = anInt1268 + (j1 >> 4 & 7);
  10552. int l6 = anInt1269 + (j1 & 7);
  10553. int k9 = stream.readUnsignedWord();
  10554. if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  10555. {
  10556. NodeList class19 = groundArray[plane][i4][l6];
  10557. if(class19 != null)
  10558. {
  10559. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  10560. {
  10561. if(item.ID != (k9 & 0x7fff))
  10562. continue;
  10563. item.unlink();
  10564. break;
  10565. }
  10566.  
  10567. if(class19.reverseGetFirst() == null)
  10568. groundArray[plane][i4][l6] = null;
  10569. spawnGroundItem(i4, l6);
  10570. }
  10571. }
  10572. return;
  10573. }
  10574. if(j == 160)
  10575. {
  10576. int k1 = stream.method428();
  10577. int j4 = anInt1268 + (k1 >> 4 & 7);
  10578. int i7 = anInt1269 + (k1 & 7);
  10579. int l9 = stream.method428();
  10580. int j12 = l9 >> 2;
  10581. int k14 = l9 & 3;
  10582. int j16 = anIntArray1177[j12];
  10583. int j17 = stream.method435();
  10584. if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  10585. {
  10586. int j18 = intGroundArray[plane][j4][i7];
  10587. int i19 = intGroundArray[plane][j4 + 1][i7];
  10588. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  10589. int k20 = intGroundArray[plane][j4][i7 + 1];
  10590. if(j16 == 0)
  10591. {
  10592. Object1 class10 = worldController.method296(plane, j4, i7);
  10593. if(class10 != null)
  10594. {
  10595. int k21 = class10.uid >> 14 & 0x7fff;
  10596. if(j12 == 2)
  10597. {
  10598. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  10599. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  10600. } else
  10601. {
  10602. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  10603. }
  10604. }
  10605. }
  10606. if(j16 == 1)
  10607. {
  10608. Object2 class26 = worldController.method297(j4, i7, plane);
  10609. if(class26 != null)
  10610. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  10611. }
  10612. if(j16 == 2)
  10613. {
  10614. Object5 class28 = worldController.method298(j4, i7, plane);
  10615. if(j12 == 11)
  10616. j12 = 10;
  10617. if(class28 != null)
  10618. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  10619. }
  10620. if(j16 == 3)
  10621. {
  10622. Object3 class49 = worldController.method299(i7, j4, plane);
  10623. if(class49 != null)
  10624. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  10625. }
  10626. }
  10627. return;
  10628. }
  10629. if(j == 147)
  10630. {
  10631. int l1 = stream.method428();
  10632. int k4 = anInt1268 + (l1 >> 4 & 7);
  10633. int j7 = anInt1269 + (l1 & 7);
  10634. int i10 = stream.readUnsignedWord();
  10635. byte byte0 = stream.method430();
  10636. int l14 = stream.method434();
  10637. byte byte1 = stream.method429();
  10638. int k17 = stream.readUnsignedWord();
  10639. int k18 = stream.method428();
  10640. int j19 = k18 >> 2;
  10641. int i20 = k18 & 3;
  10642. int l20 = anIntArray1177[j19];
  10643. byte byte2 = stream.readSignedByte();
  10644. int l21 = stream.readUnsignedWord();
  10645. byte byte3 = stream.method429();
  10646. Player player;
  10647. if(i10 == unknownInt10)
  10648. player = myPlayer;
  10649. else
  10650. player = playerArray[i10];
  10651. if(player != null)
  10652. {
  10653. ObjectDef class46 = ObjectDef.forID(l21);
  10654. int i22 = intGroundArray[plane][k4][j7];
  10655. int j22 = intGroundArray[plane][k4 + 1][j7];
  10656. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  10657. int l22 = intGroundArray[plane][k4][j7 + 1];
  10658. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  10659. if(model != null)
  10660. {
  10661. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  10662. player.anInt1707 = l14 + loopCycle;
  10663. player.anInt1708 = k17 + loopCycle;
  10664. player.aModel_1714 = model;
  10665. int i23 = class46.anInt744;
  10666. int j23 = class46.anInt761;
  10667. if(i20 == 1 || i20 == 3)
  10668. {
  10669. i23 = class46.anInt761;
  10670. j23 = class46.anInt744;
  10671. }
  10672. player.anInt1711 = k4 * 128 + i23 * 64;
  10673. player.anInt1713 = j7 * 128 + j23 * 64;
  10674. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  10675. if(byte2 > byte0)
  10676. {
  10677. byte byte4 = byte2;
  10678. byte2 = byte0;
  10679. byte0 = byte4;
  10680. }
  10681. if(byte3 > byte1)
  10682. {
  10683. byte byte5 = byte3;
  10684. byte3 = byte1;
  10685. byte1 = byte5;
  10686. }
  10687. player.anInt1719 = k4 + byte2;
  10688. player.anInt1721 = k4 + byte0;
  10689. player.anInt1720 = j7 + byte3;
  10690. player.anInt1722 = j7 + byte1;
  10691. }
  10692. }
  10693. }
  10694. if(j == 151)
  10695. {
  10696. int i2 = stream.method426();
  10697. int l4 = anInt1268 + (i2 >> 4 & 7);
  10698. int k7 = anInt1269 + (i2 & 7);
  10699. int j10 = stream.method434();
  10700. int k12 = stream.method428();
  10701. int i15 = k12 >> 2;
  10702. int k16 = k12 & 3;
  10703. int l17 = anIntArray1177[i15];
  10704. if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  10705. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  10706. return;
  10707. }
  10708. if(j == 4)
  10709. {
  10710. int j2 = stream.readUnsignedByte();
  10711. int i5 = anInt1268 + (j2 >> 4 & 7);
  10712. int l7 = anInt1269 + (j2 & 7);
  10713. int k10 = stream.readUnsignedWord();
  10714. int l12 = stream.readUnsignedByte();
  10715. int j15 = stream.readUnsignedWord();
  10716. if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  10717. {
  10718. i5 = i5 * 128 + 64;
  10719. l7 = l7 * 128 + 64;
  10720. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  10721. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  10722. }
  10723. return;
  10724. }
  10725. if(j == 44)
  10726. {
  10727. int k2 = stream.method436();
  10728. int j5 = stream.readUnsignedWord();
  10729. int i8 = stream.readUnsignedByte();
  10730. int l10 = anInt1268 + (i8 >> 4 & 7);
  10731. int i13 = anInt1269 + (i8 & 7);
  10732. if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  10733. {
  10734. Item class30_sub2_sub4_sub2_1 = new Item();
  10735. class30_sub2_sub4_sub2_1.ID = k2;
  10736. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  10737. if(groundArray[plane][l10][i13] == null)
  10738. groundArray[plane][l10][i13] = new NodeList();
  10739. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  10740. spawnGroundItem(l10, i13);
  10741. }
  10742. return;
  10743. }
  10744. if(j == 101)
  10745. {
  10746. int l2 = stream.method427();
  10747. int k5 = l2 >> 2;
  10748. int j8 = l2 & 3;
  10749. int i11 = anIntArray1177[k5];
  10750. int j13 = stream.readUnsignedByte();
  10751. int k15 = anInt1268 + (j13 >> 4 & 7);
  10752. int l16 = anInt1269 + (j13 & 7);
  10753. if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  10754. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  10755. return;
  10756. }
  10757. if(j == 117)
  10758. {
  10759. int i3 = stream.readUnsignedByte();
  10760. int l5 = anInt1268 + (i3 >> 4 & 7);
  10761. int k8 = anInt1269 + (i3 & 7);
  10762. int j11 = l5 + stream.readSignedByte();
  10763. int k13 = k8 + stream.readSignedByte();
  10764. int l15 = stream.readSignedWord();
  10765. int i17 = stream.readUnsignedWord();
  10766. int i18 = stream.readUnsignedByte() * 4;
  10767. int l18 = stream.readUnsignedByte() * 4;
  10768. int k19 = stream.readUnsignedWord();
  10769. int j20 = stream.readUnsignedWord();
  10770. int i21 = stream.readUnsignedByte();
  10771. int j21 = stream.readUnsignedByte();
  10772. if(l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535)
  10773. {
  10774. l5 = l5 * 128 + 64;
  10775. k8 = k8 * 128 + 64;
  10776. j11 = j11 * 128 + 64;
  10777. k13 = k13 * 128 + 64;
  10778. 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);
  10779. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  10780. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  10781. }
  10782. }
  10783. }
  10784.  
  10785. private static void setLowMem()
  10786. {
  10787. WorldController.lowMem = true;
  10788. Texture.lowMem = true;
  10789. lowMem = true;
  10790. ObjectManager.lowMem = true;
  10791. ObjectDef.lowMem = true;
  10792. }
  10793.  
  10794. private void method139(Stream stream)
  10795. {
  10796. stream.initBitAccess();
  10797. int k = stream.readBits(8);
  10798. if(k < npcCount)
  10799. {
  10800. for(int l = k; l < npcCount; l++)
  10801. anIntArray840[anInt839++] = npcIndices[l];
  10802.  
  10803. }
  10804. if(k > npcCount)
  10805. {
  10806. signlink.reporterror(myUsername + " Too many npcs");
  10807. throw new RuntimeException("eek");
  10808. }
  10809. npcCount = 0;
  10810. for(int i1 = 0; i1 < k; i1++)
  10811. {
  10812. int j1 = npcIndices[i1];
  10813. NPC npc = npcArray[j1];
  10814. int k1 = stream.readBits(1);
  10815. if(k1 == 0)
  10816. {
  10817. npcIndices[npcCount++] = j1;
  10818. npc.anInt1537 = loopCycle;
  10819. } else
  10820. {
  10821. int l1 = stream.readBits(2);
  10822. if(l1 == 0)
  10823. {
  10824. npcIndices[npcCount++] = j1;
  10825. npc.anInt1537 = loopCycle;
  10826. anIntArray894[anInt893++] = j1;
  10827. } else
  10828. if(l1 == 1)
  10829. {
  10830. npcIndices[npcCount++] = j1;
  10831. npc.anInt1537 = loopCycle;
  10832. int i2 = stream.readBits(3);
  10833. npc.moveInDir(false, i2);
  10834. int k2 = stream.readBits(1);
  10835. if(k2 == 1)
  10836. anIntArray894[anInt893++] = j1;
  10837. } else
  10838. if(l1 == 2)
  10839. {
  10840. npcIndices[npcCount++] = j1;
  10841. npc.anInt1537 = loopCycle;
  10842. int j2 = stream.readBits(3);
  10843. npc.moveInDir(true, j2);
  10844. int l2 = stream.readBits(3);
  10845. npc.moveInDir(true, l2);
  10846. int i3 = stream.readBits(1);
  10847. if(i3 == 1)
  10848. anIntArray894[anInt893++] = j1;
  10849. } else
  10850. if(l1 == 3)
  10851. anIntArray840[anInt839++] = j1;
  10852. }
  10853. }
  10854.  
  10855. }
  10856.  
  10857. private void processLoginScreenInput()
  10858. {
  10859. if(loginScreenState == 0)
  10860. {
  10861. int i = super.myWidth / 2 - 80;
  10862. int l = super.myHeight / 2 + 20;
  10863. l += 20;
  10864. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  10865. {
  10866. loginScreenState = 3;
  10867. loginScreenCursorPos = 0;
  10868. }
  10869. i = super.myWidth / 2 + 80;
  10870. if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  10871. {
  10872. loginMessage1 = "";
  10873. loginMessage2 = "Enter your username & password.";
  10874. loginScreenState = 2;
  10875. loginScreenCursorPos = 0;
  10876. }
  10877. } else
  10878. {
  10879. if(loginScreenState == 2)
  10880. {
  10881. int j = super.myHeight / 2 - 40;
  10882. j += 30;
  10883. j += 25;
  10884. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10885. loginScreenCursorPos = 0;
  10886. j += 15;
  10887. if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10888. loginScreenCursorPos = 1;
  10889. j += 15;
  10890. int i1 = super.myWidth / 2 - 80;
  10891. int k1 = super.myHeight / 2 + 50;
  10892. k1 += 20;
  10893. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  10894. {
  10895. loginFailures = 0;
  10896. login(myUsername, myPassword, false);
  10897. if(loggedIn)
  10898. return;
  10899. }
  10900. i1 = super.myWidth / 2 + 80;
  10901. if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  10902. {
  10903. loginScreenState = 0;
  10904. // myUsername = "";
  10905. // myPassword = "";
  10906. }
  10907. do
  10908. {
  10909. int l1 = readChar(-796);
  10910. if(l1 == -1)
  10911. break;
  10912. boolean flag1 = false;
  10913. for(int i2 = 0; i2 < validUserPassChars.length(); i2++)
  10914. {
  10915. if(l1 != validUserPassChars.charAt(i2))
  10916. continue;
  10917. flag1 = true;
  10918. break;
  10919. }
  10920.  
  10921. if(loginScreenCursorPos == 0)
  10922. {
  10923. if(l1 == 8 && myUsername.length() > 0)
  10924. myUsername = myUsername.substring(0, myUsername.length() - 1);
  10925. if(l1 == 9 || l1 == 10 || l1 == 13)
  10926. loginScreenCursorPos = 1;
  10927. if(flag1)
  10928. myUsername += (char)l1;
  10929. if(myUsername.length() > 12)
  10930. myUsername = myUsername.substring(0, 12);
  10931. } else
  10932. if(loginScreenCursorPos == 1)
  10933. {
  10934. if(l1 == 8 && myPassword.length() > 0)
  10935. myPassword = myPassword.substring(0, myPassword.length() - 1);
  10936. if(l1 == 9 || l1 == 10 || l1 == 13)
  10937. loginScreenCursorPos = 0;
  10938. if(flag1)
  10939. myPassword += (char)l1;
  10940. if(myPassword.length() > 20)
  10941. myPassword = myPassword.substring(0, 20);
  10942. }
  10943. } while(true);
  10944. return;
  10945. }
  10946. if(loginScreenState == 3)
  10947. {
  10948. int k = super.myWidth / 2;
  10949. int j1 = super.myHeight / 2 + 50;
  10950. j1 += 20;
  10951. if(super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75 && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  10952. loginScreenState = 0;
  10953. }
  10954. }
  10955. }
  10956.  
  10957. private void markMinimap(Sprite sprite, int i, int j) {
  10958. try {
  10959. int k = minimapInt1 + minimapInt2 & 0x7ff;
  10960. int l = i * i + j * j;
  10961. if(l > 6400)
  10962. return;
  10963. int i1 = Model.modelIntArray1[k];
  10964. int j1 = Model.modelIntArray2[k];
  10965. i1 = (i1 * 256) / (minimapInt3 + 256);
  10966. j1 = (j1 * 256) / (minimapInt3 + 256);
  10967. int k1 = j * i1 + i * j1 >> 16;
  10968. int l1 = j * j1 - i * i1 >> 16;
  10969. if(l > 2500) {
  10970. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 , 83 - l1 - sprite.anInt1445 / 2 - 4);
  10971. } else {
  10972. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4, 83 - l1 - sprite.anInt1445 / 2 - 4);
  10973. }
  10974. } catch (Exception _ex) {}
  10975. }
  10976.  
  10977. private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  10978. )
  10979. {
  10980. if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  10981. {
  10982. if(lowMem && j != plane)
  10983. return;
  10984. int i2 = 0;
  10985. if(j1 == 0)
  10986. i2 = worldController.method300(j, i1, i);
  10987. if(j1 == 1)
  10988. i2 = worldController.method301(j, i1, i);
  10989. if(j1 == 2)
  10990. i2 = worldController.method302(j, i1, i);
  10991. if(j1 == 3)
  10992. i2 = worldController.method303(j, i1, i);
  10993. if(i2 != 0)
  10994. {
  10995. int i3 = worldController.method304(j, i1, i, i2);
  10996. int j2 = i2 >> 14 & 0x7fff;
  10997. int k2 = i3 & 0x1f;
  10998. int l2 = i3 >> 6;
  10999. if(j1 == 0)
  11000. {
  11001. worldController.method291(i1, j, i, (byte)-119);
  11002. ObjectDef class46 = ObjectDef.forID(j2);
  11003. if(class46.aBoolean767)
  11004. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  11005. }
  11006. if(j1 == 1)
  11007. worldController.method292(i, j, i1);
  11008. if(j1 == 2)
  11009. {
  11010. worldController.method293(j, i1, i);
  11011. ObjectDef class46_1 = ObjectDef.forID(j2);
  11012. if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  11013. return;
  11014. if(class46_1.aBoolean767)
  11015. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  11016. }
  11017. if(j1 == 3)
  11018. {
  11019. worldController.method294(j, i, i1);
  11020. ObjectDef class46_2 = ObjectDef.forID(j2);
  11021. if(class46_2.aBoolean767 && class46_2.hasActions)
  11022. aClass11Array1230[j].method218(i, i1);
  11023. }
  11024. }
  11025. if(k1 >= 0)
  11026. {
  11027. int j3 = j;
  11028. if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  11029. j3++;
  11030. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  11031. }
  11032. }
  11033. }
  11034.  
  11035. private void updatePlayers(int i, Stream stream)
  11036. {
  11037. anInt839 = 0;
  11038. anInt893 = 0;
  11039. method117(stream);
  11040. method134(stream);
  11041. method91(stream, i);
  11042. method49(stream);
  11043. for(int k = 0; k < anInt839; k++)
  11044. {
  11045. int l = anIntArray840[k];
  11046. if(playerArray[l].anInt1537 != loopCycle)
  11047. playerArray[l] = null;
  11048. }
  11049.  
  11050. if(stream.currentOffset != i)
  11051. {
  11052. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  11053. throw new RuntimeException("eek");
  11054. }
  11055. for(int i1 = 0; i1 < playerCount; i1++)
  11056. if(playerArray[playerIndices[i1]] == null)
  11057. {
  11058. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  11059. throw new RuntimeException("eek");
  11060. }
  11061.  
  11062. }
  11063.  
  11064. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  11065. {
  11066. int l1 = 2048 - k & 0x7ff;
  11067. int i2 = 2048 - j1 & 0x7ff;
  11068. int j2 = 0;
  11069. int k2 = 0;
  11070. int l2 = j;
  11071. if(l1 != 0)
  11072. {
  11073. int i3 = Model.modelIntArray1[l1];
  11074. int k3 = Model.modelIntArray2[l1];
  11075. int i4 = k2 * k3 - l2 * i3 >> 16;
  11076. l2 = k2 * i3 + l2 * k3 >> 16;
  11077. k2 = i4;
  11078. }
  11079. if(i2 != 0)
  11080. {
  11081. /* xxx if(cameratoggle){
  11082. if(zoom == 0)
  11083. zoom = k2;
  11084. if(lftrit == 0)
  11085. lftrit = j2;
  11086. if(fwdbwd == 0)
  11087. fwdbwd = l2;
  11088. k2 = zoom;
  11089. j2 = lftrit;
  11090. l2 = fwdbwd;
  11091. }
  11092. */
  11093. int j3 = Model.modelIntArray1[i2];
  11094. int l3 = Model.modelIntArray2[i2];
  11095. int j4 = l2 * j3 + j2 * l3 >> 16;
  11096. l2 = l2 * l3 - j2 * j3 >> 16;
  11097. j2 = j4;
  11098. }
  11099. xCameraPos = l - j2;
  11100. zCameraPos = i1 - k2;
  11101. yCameraPos = k1 - l2;
  11102. yCameraCurve = k;
  11103. xCameraCurve = j1;
  11104. }
  11105.  
  11106. public void updateStrings(String str, int i) {
  11107. switch(i) {
  11108. case 1675: sendFrame126(str, 17508); break;//Stab
  11109. case 1676: sendFrame126(str, 17509); break;//Slash
  11110. case 1677: sendFrame126(str, 17510); break;//Cursh
  11111. case 1678: sendFrame126(str, 17511); break;//Magic
  11112. case 1679: sendFrame126(str, 17512); break;//Range
  11113. case 1680: sendFrame126(str, 17513); break;//Stab
  11114. case 1681: sendFrame126(str, 17514); break;//Slash
  11115. case 1682: sendFrame126(str, 17515); break;//Crush
  11116. case 1683: sendFrame126(str, 17516); break;//Magic
  11117. case 1684: sendFrame126(str, 17517); break;//Range
  11118. case 1686: sendFrame126(str, 17518); break;//Strength
  11119. case 1687: sendFrame126(str, 17519); break;//Prayer
  11120. }
  11121. }
  11122.  
  11123. public void sendFrame126(String str,int i) {
  11124. RSInterface.interfaceCache[i].message = str;
  11125. if(RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  11126. needDrawTabArea = true;
  11127. }
  11128.  
  11129. public void sendPacket185(int button,int toggle,int type) {
  11130. switch(type) {
  11131. case 135:
  11132. RSInterface class9 = RSInterface.interfaceCache[button];
  11133. boolean flag8 = true;
  11134. if(class9.contentType > 0)
  11135. flag8 = promptUserForInput(class9);
  11136. if(flag8) {
  11137. stream.createFrame(185);
  11138. stream.writeWord(button);
  11139. }
  11140. break;
  11141. case 646:
  11142. stream.createFrame(185);
  11143. stream.writeWord(button);
  11144. RSInterface class9_2 = RSInterface.interfaceCache[button];
  11145. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  11146. if(variousSettings[toggle] != class9_2.requiredValues[0]) {
  11147. variousSettings[toggle] = class9_2.requiredValues[0];
  11148. method33(toggle);
  11149. needDrawTabArea = true;
  11150. }
  11151. }
  11152. break;
  11153. case 169:
  11154. stream.createFrame(185);
  11155. stream.writeWord(button);
  11156. RSInterface class9_3 = RSInterface.interfaceCache[button];
  11157. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  11158. variousSettings[toggle] = 1 - variousSettings[toggle];
  11159. method33(toggle);
  11160. needDrawTabArea = true;
  11161. }
  11162. switch(button) {
  11163. case 19136:
  11164. System.out.println("toggle = "+toggle);
  11165. if(toggle == 0)
  11166. sendFrame36(173,toggle);
  11167. if(toggle == 1)
  11168. sendPacket185(153,173,646);
  11169. break;
  11170. }
  11171. break;
  11172. }
  11173. }
  11174.  
  11175. public void sendFrame36(int id,int state) {
  11176. anIntArray1045[id] = state;
  11177. if(variousSettings[id] != state) {
  11178. variousSettings[id] = state;
  11179. method33(id);
  11180. needDrawTabArea = true;
  11181. if(dialogID != -1)
  11182. inputTaken = true;
  11183. }
  11184. }
  11185.  
  11186. public void sendFrame219() {
  11187. if(invOverlayInterfaceID != -1) {
  11188. invOverlayInterfaceID = -1;
  11189. needDrawTabArea = true;
  11190. tabAreaAltered = true;
  11191. }
  11192. if(backDialogID != -1) {
  11193. backDialogID = -1;
  11194. inputTaken = true;
  11195. }
  11196. if(inputDialogState != 0) {
  11197. inputDialogState = 0;
  11198. inputTaken = true;
  11199. }
  11200. openInterfaceID = -1;
  11201. aBoolean1149 = false;
  11202. }
  11203.  
  11204. public void sendFrame248(int interfaceID,int sideInterfaceID) {
  11205. if(backDialogID != -1) {
  11206. backDialogID = -1;
  11207. inputTaken = true;
  11208. }
  11209. if(inputDialogState != 0) {
  11210. inputDialogState = 0;
  11211. inputTaken = true;
  11212. }
  11213. openInterfaceID = interfaceID;
  11214. invOverlayInterfaceID = sideInterfaceID;
  11215. needDrawTabArea = true;
  11216. tabAreaAltered = true;
  11217. aBoolean1149 = false;
  11218. }
  11219.  
  11220. private boolean parsePacket() {
  11221. if(socketStream == null)
  11222. return false;
  11223. try {
  11224. int i = socketStream.available();
  11225. if(i == 0)
  11226. return false;
  11227. if(pkttype == -1) {
  11228. socketStream.flushInputStream(inStream.buffer, 1);
  11229. pkttype = inStream.buffer[0] & 0xff;
  11230. if(encryption != null)
  11231. pkttype = pkttype - encryption.getNextKey() & 0xff;
  11232. pktSize = SizeConstants.packetSizes[pkttype];
  11233. i--;
  11234. }
  11235. if(pktSize == -1)
  11236. if(i > 0) {
  11237. socketStream.flushInputStream(inStream.buffer, 1);
  11238. pktSize = inStream.buffer[0] & 0xff;
  11239. i--;
  11240. } else {
  11241. return false;
  11242. }
  11243. if(pktSize == -2)
  11244. if(i > 1) {
  11245. socketStream.flushInputStream(inStream.buffer, 2);
  11246. inStream.currentOffset = 0;
  11247. pktSize = inStream.readUnsignedWord();
  11248. i -= 2;
  11249. } else {
  11250. return false;
  11251. }
  11252. if(i < pktSize)
  11253. return false;
  11254. inStream.currentOffset = 0;
  11255. socketStream.flushInputStream(inStream.buffer, pktSize);
  11256. anInt1009 = 0;
  11257. anInt843 = anInt842;
  11258. anInt842 = anInt841;
  11259. anInt841 = pkttype;
  11260. switch(pkttype) {
  11261. case 81:
  11262. updatePlayers(pktSize, inStream);
  11263. aBoolean1080 = false;
  11264. pkttype = -1;
  11265. return true;
  11266.  
  11267. case 176:
  11268. daysSinceRecovChange = inStream.method427();
  11269. unreadMessages = inStream.method435();
  11270. membersInt = inStream.readUnsignedByte();
  11271. anInt1193 = inStream.method440();
  11272. daysSinceLastLogin = inStream.readUnsignedWord();
  11273. if(anInt1193 != 0 && openInterfaceID == -1) {
  11274. signlink.dnslookup(TextClass.method586(anInt1193));
  11275. clearTopInterfaces();
  11276. char c = '\u028A';
  11277. if(daysSinceRecovChange != 201 || membersInt == 1)
  11278. c = '\u028F';
  11279. reportAbuseInput = "";
  11280. canMute = false;
  11281. for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  11282. if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  11283. continue;
  11284. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  11285.  
  11286. }
  11287. }
  11288. pkttype = -1;
  11289. return true;
  11290.  
  11291. case 64:
  11292. anInt1268 = inStream.method427();
  11293. anInt1269 = inStream.method428();
  11294. for(int j = anInt1268; j < anInt1268 + 8; j++) {
  11295. for(int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  11296. if(groundArray[plane][j][l9] != null) {
  11297. groundArray[plane][j][l9] = null;
  11298. spawnGroundItem(j, l9);
  11299. }
  11300. }
  11301. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  11302. if(class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  11303. class30_sub1.anInt1294 = 0;
  11304. pkttype = -1;
  11305. return true;
  11306.  
  11307. case 185:
  11308. int k = inStream.method436();
  11309. RSInterface.interfaceCache[k].anInt233 = 3;
  11310. if(myPlayer.desc == null)
  11311. 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];
  11312. else
  11313. RSInterface.interfaceCache[k].mediaID = (int)(0x12345678L + myPlayer.desc.type);
  11314. pkttype = -1;
  11315. return true;
  11316.  
  11317. /* Clan chat packet */
  11318. case 217:
  11319. try {
  11320. name = inStream.readString();
  11321. message = inStream.readString();
  11322. clanname = inStream.readString();
  11323. rights = inStream.readUnsignedWord();
  11324. //message = TextInput.processText(message);
  11325. //message = Censor.doCensor(message);
  11326. System.out.println(clanname);
  11327. pushMessage(message, 16, name);
  11328. } catch(Exception e) {
  11329. e.printStackTrace();
  11330. }
  11331. pkttype = -1;
  11332. return true;
  11333.  
  11334. case 107:
  11335. aBoolean1160 = false;
  11336. for(int l = 0; l < 5; l++)
  11337. aBooleanArray876[l] = false;
  11338. pkttype = -1;
  11339. return true;
  11340.  
  11341. case 72:
  11342. int i1 = inStream.method434();
  11343. RSInterface class9 = RSInterface.interfaceCache[i1];
  11344. for(int k15 = 0; k15 < class9.inv.length; k15++) {
  11345. class9.inv[k15] = -1;
  11346. class9.inv[k15] = 0;
  11347. }
  11348. pkttype = -1;
  11349. return true;
  11350.  
  11351. case 214:
  11352. ignoreCount = pktSize / 8;
  11353. for(int j1 = 0; j1 < ignoreCount; j1++)
  11354. ignoreListAsLongs[j1] = inStream.readQWord();
  11355. pkttype = -1;
  11356. return true;
  11357.  
  11358. case 166:
  11359. aBoolean1160 = true;
  11360. anInt1098 = inStream.readUnsignedByte();
  11361. anInt1099 = inStream.readUnsignedByte();
  11362. anInt1100 = inStream.readUnsignedWord();
  11363. anInt1101 = inStream.readUnsignedByte();
  11364. anInt1102 = inStream.readUnsignedByte();
  11365. if(anInt1102 >= 100) {
  11366. xCameraPos = anInt1098 * 128 + 64;
  11367. yCameraPos = anInt1099 * 128 + 64;
  11368. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  11369. }
  11370. pkttype = -1;
  11371. return true;
  11372.  
  11373. case 134:
  11374. needDrawTabArea = true;
  11375. int k1 = inStream.readUnsignedByte();
  11376. int i10 = inStream.method439();
  11377. int l15 = inStream.readUnsignedByte();
  11378. currentExp[k1] = i10;
  11379. currentStats[k1] = l15;
  11380. maxStats[k1] = 1;
  11381. for(int k20 = 0; k20 < 98; k20++)
  11382. if(i10 >= anIntArray1019[k20])
  11383. maxStats[k1] = k20 + 2;
  11384. pkttype = -1;
  11385. return true;
  11386.  
  11387. case 71:
  11388. int l1 = inStream.readUnsignedWord();
  11389. int j10 = inStream.method426();
  11390. if(l1 == 65535)
  11391. l1 = -1;
  11392. tabInterfaceIDs[j10] = l1;
  11393. needDrawTabArea = true;
  11394. tabAreaAltered = true;
  11395. pkttype = -1;
  11396. return true;
  11397.  
  11398. case 74:
  11399. int i2 = inStream.method434();
  11400. if(i2 == 65535)
  11401. i2 = -1;
  11402. if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  11403. nextSong = i2;
  11404. songChanging = true;
  11405. onDemandFetcher.method558(2, nextSong);
  11406. }
  11407. currentSong = i2;
  11408. pkttype = -1;
  11409. return true;
  11410.  
  11411. case 121:
  11412. int j2 = inStream.method436();
  11413. int k10 = inStream.method435();
  11414. if(musicEnabled && !lowMem) {
  11415. nextSong = j2;
  11416. songChanging = false;
  11417. onDemandFetcher.method558(2, nextSong);
  11418. prevSong = k10;
  11419. }
  11420. pkttype = -1;
  11421. return true;
  11422.  
  11423. case 109:
  11424. resetLogout();
  11425. pkttype = -1;
  11426. return false;
  11427.  
  11428. case 70:
  11429. int k2 = inStream.readSignedWord();
  11430. int l10 = inStream.method437();
  11431. int i16 = inStream.method434();
  11432. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  11433. class9_5.anInt263 = k2;
  11434. class9_5.anInt265 = l10;
  11435. pkttype = -1;
  11436. return true;
  11437.  
  11438. case 73:
  11439. case 241:
  11440. int l2 = anInt1069;
  11441. int i11 = anInt1070;
  11442. if(pkttype == 73) {
  11443. l2 = inStream.method435();
  11444. i11 = inStream.readUnsignedWord();
  11445. aBoolean1159 = false;
  11446. }
  11447. if(pkttype == 241) {
  11448. i11 = inStream.method435();
  11449. inStream.initBitAccess();
  11450. for(int j16 = 0; j16 < 4; j16++) {
  11451. for(int l20 = 0; l20 < 13; l20++) {
  11452. for(int j23 = 0; j23 < 13; j23++) {
  11453. int i26 = inStream.readBits(1);
  11454. if(i26 == 1)
  11455. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  11456. else
  11457. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  11458. }
  11459. }
  11460. }
  11461. inStream.finishBitAccess();
  11462. l2 = inStream.readUnsignedWord();
  11463. aBoolean1159 = true;
  11464. }
  11465. if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  11466. pkttype = -1;
  11467. return true;
  11468. }
  11469. anInt1069 = l2;
  11470. anInt1070 = i11;
  11471. baseX = (anInt1069 - 6) * 8;
  11472. baseY = (anInt1070 - 6) * 8;
  11473. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  11474. if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  11475. aBoolean1141 = true;
  11476. loadingStage = 1;
  11477. aLong824 = System.currentTimeMillis();
  11478. aRSImageProducer_1165.initDrawingArea();
  11479. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  11480. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  11481. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  11482. if(pkttype == 73) {
  11483. int k16 = 0;
  11484. for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  11485. for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  11486. k16++;
  11487. }
  11488. aByteArrayArray1183 = new byte[k16][];
  11489. aByteArrayArray1247 = new byte[k16][];
  11490. anIntArray1234 = new int[k16];
  11491. anIntArray1235 = new int[k16];
  11492. anIntArray1236 = new int[k16];
  11493. k16 = 0;
  11494. for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  11495. for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  11496. anIntArray1234[k16] = (l23 << 8) + j26;
  11497. if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  11498. anIntArray1235[k16] = -1;
  11499. anIntArray1236[k16] = -1;
  11500. k16++;
  11501. } else {
  11502. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  11503. if(k28 != -1)
  11504. onDemandFetcher.method558(3, k28);
  11505. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  11506. if(j30 != -1)
  11507. onDemandFetcher.method558(3, j30);
  11508. k16++;
  11509. }
  11510. }
  11511. }
  11512. }
  11513. if(pkttype == 241) {
  11514. int l16 = 0;
  11515. int ai[] = new int[676];
  11516. for(int i24 = 0; i24 < 4; i24++) {
  11517. for(int k26 = 0; k26 < 13; k26++) {
  11518. for(int l28 = 0; l28 < 13; l28++) {
  11519. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  11520. if(k30 != -1) {
  11521. int k31 = k30 >> 14 & 0x3ff;
  11522. int i32 = k30 >> 3 & 0x7ff;
  11523. int k32 = (k31 / 8 << 8) + i32 / 8;
  11524. for(int j33 = 0; j33 < l16; j33++) {
  11525. if(ai[j33] != k32)
  11526. continue;
  11527. k32 = -1;
  11528.  
  11529. }
  11530. if(k32 != -1)
  11531. ai[l16++] = k32;
  11532. }
  11533. }
  11534. }
  11535. }
  11536. aByteArrayArray1183 = new byte[l16][];
  11537. aByteArrayArray1247 = new byte[l16][];
  11538. anIntArray1234 = new int[l16];
  11539. anIntArray1235 = new int[l16];
  11540. anIntArray1236 = new int[l16];
  11541. for(int l26 = 0; l26 < l16; l26++) {
  11542. int i29 = anIntArray1234[l26] = ai[l26];
  11543. int l30 = i29 >> 8 & 0xff;
  11544. int l31 = i29 & 0xff;
  11545. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  11546. if(j32 != -1)
  11547. onDemandFetcher.method558(3, j32);
  11548. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  11549. if(i33 != -1)
  11550. onDemandFetcher.method558(3, i33);
  11551. }
  11552. }
  11553. int i17 = baseX - anInt1036;
  11554. int j21 = baseY - anInt1037;
  11555. anInt1036 = baseX;
  11556. anInt1037 = baseY;
  11557. for(int j24 = 0; j24 < 16384; j24++) {
  11558. NPC npc = npcArray[j24];
  11559. if(npc != null) {
  11560. for(int j29 = 0; j29 < 10; j29++) {
  11561. npc.smallX[j29] -= i17;
  11562. npc.smallY[j29] -= j21;
  11563. }
  11564. npc.x -= i17 * 128;
  11565. npc.y -= j21 * 128;
  11566. }
  11567. }
  11568. for(int i27 = 0; i27 < maxPlayers; i27++) {
  11569. Player player = playerArray[i27];
  11570. if(player != null) {
  11571. for(int i31 = 0; i31 < 10; i31++) {
  11572. player.smallX[i31] -= i17;
  11573. player.smallY[i31] -= j21;
  11574. }
  11575. player.x -= i17 * 128;
  11576. player.y -= j21 * 128;
  11577. }
  11578. }
  11579. aBoolean1080 = true;
  11580. byte byte1 = 0;
  11581. byte byte2 = 104;
  11582. byte byte3 = 1;
  11583. if(i17 < 0) {
  11584. byte1 = 103;
  11585. byte2 = -1;
  11586. byte3 = -1;
  11587. }
  11588. byte byte4 = 0;
  11589. byte byte5 = 104;
  11590. byte byte6 = 1;
  11591. if(j21 < 0) {
  11592. byte4 = 103;
  11593. byte5 = -1;
  11594. byte6 = -1;
  11595. }
  11596. for(int k33 = byte1; k33 != byte2; k33 += byte3) {
  11597. for(int l33 = byte4; l33 != byte5; l33 += byte6) {
  11598. int i34 = k33 + i17;
  11599. int j34 = l33 + j21;
  11600. for(int k34 = 0; k34 < 4; k34++)
  11601. if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  11602. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  11603. else
  11604. groundArray[k34][k33][l33] = null;
  11605. }
  11606. }
  11607. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext()) {
  11608. class30_sub1_1.anInt1297 -= i17;
  11609. class30_sub1_1.anInt1298 -= j21;
  11610. if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  11611. class30_sub1_1.unlink();
  11612. }
  11613. if(destX != 0) {
  11614. destX -= i17;
  11615. destY -= j21;
  11616. }
  11617. aBoolean1160 = false;
  11618. pkttype = -1;
  11619. return true;
  11620.  
  11621. case 208:
  11622. int i3 = inStream.method437();
  11623. if(i3 >= 0)
  11624. method60(i3);
  11625. anInt1018 = i3;
  11626. pkttype = -1;
  11627. return true;
  11628.  
  11629. case 99:
  11630. anInt1021 = inStream.readUnsignedByte();
  11631. pkttype = -1;
  11632. return true;
  11633.  
  11634. case 75:
  11635. int j3 = inStream.method436();
  11636. int j11 = inStream.method436();
  11637. RSInterface.interfaceCache[j11].anInt233 = 2;
  11638. RSInterface.interfaceCache[j11].mediaID = j3;
  11639. pkttype = -1;
  11640. return true;
  11641.  
  11642. case 114:
  11643. anInt1104 = inStream.method434() * 30;
  11644. pkttype = -1;
  11645. return true;
  11646.  
  11647. case 60:
  11648. anInt1269 = inStream.readUnsignedByte();
  11649. anInt1268 = inStream.method427();
  11650. while(inStream.currentOffset < pktSize) {
  11651. int k3 = inStream.readUnsignedByte();
  11652. method137(inStream, k3);
  11653. }
  11654. pkttype = -1;
  11655. return true;
  11656.  
  11657. case 35:
  11658. int l3 = inStream.readUnsignedByte();
  11659. int k11 = inStream.readUnsignedByte();
  11660. int j17 = inStream.readUnsignedByte();
  11661. int k21 = inStream.readUnsignedByte();
  11662. aBooleanArray876[l3] = true;
  11663. anIntArray873[l3] = k11;
  11664. anIntArray1203[l3] = j17;
  11665. anIntArray928[l3] = k21;
  11666. anIntArray1030[l3] = 0;
  11667. pkttype = -1;
  11668. return true;
  11669.  
  11670. case 174:
  11671. int i4 = inStream.readUnsignedWord();
  11672. int l11 = inStream.readUnsignedByte();
  11673. int k17 = inStream.readUnsignedWord();
  11674. if(aBoolean848 && !lowMem && anInt1062 < 50) {
  11675. anIntArray1207[anInt1062] = i4;
  11676. anIntArray1241[anInt1062] = l11;
  11677. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  11678. anInt1062++;
  11679. }
  11680. pkttype = -1;
  11681. return true;
  11682.  
  11683. case 104:
  11684. int j4 = inStream.method427();
  11685. int i12 = inStream.method426();
  11686. String s6 = inStream.readString();
  11687. if(j4 >= 1 && j4 <= 5) {
  11688. if(s6.equalsIgnoreCase("null"))
  11689. s6 = null;
  11690. atPlayerActions[j4 - 1] = s6;
  11691. atPlayerArray[j4 - 1] = i12 == 0;
  11692. }
  11693. pkttype = -1;
  11694. return true;
  11695.  
  11696. case 78:
  11697. destX = 0;
  11698. pkttype = -1;
  11699. return true;
  11700.  
  11701. case 253:
  11702. String s = inStream.readString();
  11703. if(s.endsWith(":tradereq:")) {
  11704. String s3 = s.substring(0, s.indexOf(":"));
  11705. long l17 = TextClass.longForName(s3);
  11706. boolean flag2 = false;
  11707. for(int j27 = 0; j27 < ignoreCount; j27++) {
  11708. if(ignoreListAsLongs[j27] != l17)
  11709. continue;
  11710. flag2 = true;
  11711.  
  11712. }
  11713. if(!flag2 && anInt1251 == 0)
  11714. pushMessage("wishes to trade with you.", 4, s3);
  11715. } else if (s.endsWith(":clan:")) {
  11716. String s4 = s.substring(0, s.indexOf(":"));
  11717. long l18 = TextClass.longForName(s4);
  11718. pushMessage("Clan: ", 8, s4);
  11719. } else if(s.endsWith("#url#")) {
  11720. String link = s.substring(0, s.indexOf("#"));
  11721. pushMessage("Join us at: ", 9, link);
  11722. } else if(s.endsWith(":duelreq:")) {
  11723. String s4 = s.substring(0, s.indexOf(":"));
  11724. long l18 = TextClass.longForName(s4);
  11725. boolean flag3 = false;
  11726. for(int k27 = 0; k27 < ignoreCount; k27++) {
  11727. if(ignoreListAsLongs[k27] != l18)
  11728. continue;
  11729. flag3 = true;
  11730.  
  11731. }
  11732. if(!flag3 && anInt1251 == 0)
  11733. pushMessage("wishes to duel with you.", 8, s4);
  11734. } else if(s.endsWith(":showpvp:")) {
  11735. if(pvpWindow)
  11736. pvpWindow = false;
  11737. else
  11738. pvpWindow = true;
  11739. } else if(s.endsWith(":pvpsafe:")) {
  11740. if(safeZone)
  11741. safeZone = false;
  11742. else
  11743. safeZone = true;
  11744. } else if(s.endsWith(":resetpvp:")) {
  11745. safeZone = false;
  11746. countToSafe = false;
  11747. } else if(s.endsWith(":pvpcount:")) {
  11748. if(countToSafe)
  11749. countToSafe = false;
  11750. else
  11751. countToSafe = true;
  11752. } else if(s.endsWith(":resetautocast:")) {
  11753. Autocast = false;
  11754. autocastId = 0;
  11755. magicAuto.drawSprite(1000, 1000);
  11756. } else if(s.endsWith(":chalreq:")) {
  11757. String s5 = s.substring(0, s.indexOf(":"));
  11758. long l19 = TextClass.longForName(s5);
  11759. boolean flag4 = false;
  11760. for(int l27 = 0; l27 < ignoreCount; l27++) {
  11761. if(ignoreListAsLongs[l27] != l19)
  11762. continue;
  11763. flag4 = true;
  11764.  
  11765. }
  11766. if(!flag4 && anInt1251 == 0) {
  11767. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  11768. pushMessage(s8, 8, s5);
  11769. }
  11770. } else {
  11771. pushMessage(s, 0, "");
  11772. }
  11773. pkttype = -1;
  11774. return true;
  11775.  
  11776. case 1:
  11777. for(int k4 = 0; k4 < playerArray.length; k4++)
  11778. if(playerArray[k4] != null)
  11779. playerArray[k4].anim = -1;
  11780. for(int j12 = 0; j12 < npcArray.length; j12++)
  11781. if(npcArray[j12] != null)
  11782. npcArray[j12].anim = -1;
  11783. pkttype = -1;
  11784. return true;
  11785.  
  11786. case 50:
  11787. long l4 = inStream.readQWord();
  11788. int i18 = inStream.readUnsignedByte();
  11789. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  11790. for(int k24 = 0; k24 < friendsCount; k24++) {
  11791. if(l4 != friendsListAsLongs[k24])
  11792. continue;
  11793. if(friendsNodeIDs[k24] != i18) {
  11794. friendsNodeIDs[k24] = i18;
  11795. needDrawTabArea = true;
  11796. if(i18 >= 2) {
  11797. pushMessage(s7 + " has logged in.", 5, "");
  11798. }
  11799. if(i18 <= 1) {
  11800. pushMessage(s7 + " has logged out.", 5, "");
  11801. }
  11802. }
  11803. s7 = null;
  11804.  
  11805. }
  11806. if(s7 != null && friendsCount < 200) {
  11807. friendsListAsLongs[friendsCount] = l4;
  11808. friendsList[friendsCount] = s7;
  11809. friendsNodeIDs[friendsCount] = i18;
  11810. friendsCount++;
  11811. needDrawTabArea = true;
  11812. }
  11813. for(boolean flag6 = false; !flag6;) {
  11814. flag6 = true;
  11815. for(int k29 = 0; k29 < friendsCount - 1; k29++)
  11816. if(friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  11817. int j31 = friendsNodeIDs[k29];
  11818. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  11819. friendsNodeIDs[k29 + 1] = j31;
  11820. String s10 = friendsList[k29];
  11821. friendsList[k29] = friendsList[k29 + 1];
  11822. friendsList[k29 + 1] = s10;
  11823. long l32 = friendsListAsLongs[k29];
  11824. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  11825. friendsListAsLongs[k29 + 1] = l32;
  11826. needDrawTabArea = true;
  11827. flag6 = false;
  11828. }
  11829. }
  11830. pkttype = -1;
  11831. return true;
  11832.  
  11833. case 110:
  11834. if(tabID == 12)
  11835. needDrawTabArea = true;
  11836. energy = inStream.readUnsignedByte();
  11837. pkttype = -1;
  11838. return true;
  11839.  
  11840. case 254:
  11841. anInt855 = inStream.readUnsignedByte();
  11842. if(anInt855 == 1)
  11843. anInt1222 = inStream.readUnsignedWord();
  11844. if(anInt855 >= 2 && anInt855 <= 6) {
  11845. if(anInt855 == 2) {
  11846. anInt937 = 64;
  11847. anInt938 = 64;
  11848. }
  11849. if(anInt855 == 3) {
  11850. anInt937 = 0;
  11851. anInt938 = 64;
  11852. }
  11853. if(anInt855 == 4) {
  11854. anInt937 = 128;
  11855. anInt938 = 64;
  11856. }
  11857. if(anInt855 == 5) {
  11858. anInt937 = 64;
  11859. anInt938 = 0;
  11860. }
  11861. if(anInt855 == 6) {
  11862. anInt937 = 64;
  11863. anInt938 = 128;
  11864. }
  11865. anInt855 = 2;
  11866. anInt934 = inStream.readUnsignedWord();
  11867. anInt935 = inStream.readUnsignedWord();
  11868. anInt936 = inStream.readUnsignedByte();
  11869. }
  11870. if(anInt855 == 10)
  11871. anInt933 = inStream.readUnsignedWord();
  11872. pkttype = -1;
  11873. return true;
  11874.  
  11875. case 248:
  11876. int i5 = inStream.method435();
  11877. int k12 = inStream.readUnsignedWord();
  11878. if(backDialogID != -1) {
  11879. backDialogID = -1;
  11880. inputTaken = true;
  11881. }
  11882. if(inputDialogState != 0) {
  11883. inputDialogState = 0;
  11884. inputTaken = true;
  11885. }
  11886. openInterfaceID = i5;
  11887. invOverlayInterfaceID = k12;
  11888. needDrawTabArea = true;
  11889. tabAreaAltered = true;
  11890. aBoolean1149 = false;
  11891. pkttype = -1;
  11892. return true;
  11893.  
  11894. case 79:
  11895. int j5 = inStream.method434();
  11896. int l12 = inStream.method435();
  11897. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  11898. if(class9_3 != null && class9_3.type == 0) {
  11899. if(l12 < 0)
  11900. l12 = 0;
  11901. if(l12 > class9_3.scrollMax - class9_3.height)
  11902. l12 = class9_3.scrollMax - class9_3.height;
  11903. class9_3.scrollPosition = l12;
  11904. }
  11905. pkttype = -1;
  11906. return true;
  11907.  
  11908. case 68:
  11909. for(int k5 = 0; k5 < variousSettings.length; k5++)
  11910. if(variousSettings[k5] != anIntArray1045[k5]) {
  11911. variousSettings[k5] = anIntArray1045[k5];
  11912. method33(k5);
  11913. needDrawTabArea = true;
  11914. }
  11915. pkttype = -1;
  11916. return true;
  11917.  
  11918. case 196:
  11919. long l5 = inStream.readQWord();
  11920. int j18 = inStream.readDWord();
  11921. int l21 = inStream.readUnsignedByte();
  11922. boolean flag5 = false;
  11923. for(int i28 = 0; i28 < 100; i28++) {
  11924. if(anIntArray1240[i28] != j18)
  11925. continue;
  11926. flag5 = true;
  11927.  
  11928. }
  11929. if(l21 <= 1) {
  11930. for(int l29 = 0; l29 < ignoreCount; l29++) {
  11931. if(ignoreListAsLongs[l29] != l5)
  11932. continue;
  11933. flag5 = true;
  11934.  
  11935. }
  11936. }
  11937. if(!flag5 && anInt1251 == 0)
  11938. try {
  11939. anIntArray1240[anInt1169] = j18;
  11940. anInt1169 = (anInt1169 + 1) % 100;
  11941. String s9 = TextInput.method525(pktSize - 13, inStream);
  11942. switch (l21) {
  11943. case 1:
  11944. pushMessage(s9, 7, "@cr0@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11945. break;
  11946. case 2:
  11947. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11948. break;
  11949. case 3:
  11950. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11951. break;
  11952. case 4:
  11953. pushMessage(s9, 7, "@cr3@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11954. break;
  11955. case 5:
  11956. pushMessage(s9, 7, "@cr4@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11957. break;
  11958. case 6:
  11959. pushMessage(s9, 7, "@cr5@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11960. break;
  11961. case 7:
  11962. pushMessage(s9, 7, "@cr6@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11963. break;
  11964. case 8:
  11965. pushMessage(s9, 7, "@cr7@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11966. break;
  11967. case 9:
  11968. pushMessage(s9, 7, "@cr8@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11969. break;
  11970. default:
  11971. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  11972. break;
  11973. }
  11974. /**if(l21 != 3)
  11975. s9 = Censor.doCensor(s9);
  11976. if(l21 == 2 || l21 == 3)
  11977. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11978. else
  11979. if(l21 == 1)
  11980. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11981. else
  11982. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  11983. }**/
  11984. catch(Exception exception1) {
  11985. signlink.reporterror("cde1");
  11986. }
  11987. pkttype = -1;
  11988. return true;
  11989.  
  11990. case 85:
  11991. anInt1269 = inStream.method427();
  11992. anInt1268 = inStream.method427();
  11993. pkttype = -1;
  11994. return true;
  11995.  
  11996. case 24:
  11997. anInt1054 = inStream.method428();
  11998. if(anInt1054 == tabID) {
  11999. if(anInt1054 == 3)
  12000. tabID = 1;
  12001. else
  12002. tabID = 3;
  12003. needDrawTabArea = true;
  12004. }
  12005. pkttype = -1;
  12006. return true;
  12007.  
  12008. case 246:
  12009. int i6 = inStream.method434();
  12010. int i13 = inStream.readUnsignedWord();
  12011. int k18 = inStream.readUnsignedWord();
  12012. if(k18 == 65535) {
  12013. RSInterface.interfaceCache[i6].anInt233 = 0;
  12014. pkttype = -1;
  12015. return true;
  12016. } else {
  12017. ItemDef itemDef = ItemDef.forID(k18);
  12018. RSInterface.interfaceCache[i6].anInt233 = 4;
  12019. RSInterface.interfaceCache[i6].mediaID = k18;
  12020. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotation1;
  12021. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotation2;
  12022. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  12023. pkttype = -1;
  12024. return true;
  12025. }
  12026.  
  12027. case 171:
  12028. boolean flag1 = inStream.readUnsignedByte() == 1;
  12029. int j13 = inStream.readUnsignedWord();
  12030. RSInterface.interfaceCache[j13].interfaceShown = flag1;
  12031. pkttype = -1;
  12032. return true;
  12033.  
  12034. case 142:
  12035. int j6 = inStream.method434();
  12036. method60(j6);
  12037. if(backDialogID != -1) {
  12038. backDialogID = -1;
  12039. inputTaken = true;
  12040. }
  12041. if(inputDialogState != 0) {
  12042. inputDialogState = 0;
  12043. inputTaken = true;
  12044. }
  12045. invOverlayInterfaceID = j6;
  12046. needDrawTabArea = true;
  12047. tabAreaAltered = true;
  12048. openInterfaceID = -1;
  12049. aBoolean1149 = false;
  12050. pkttype = -1;
  12051. return true;
  12052.  
  12053. case 126:
  12054. String text = inStream.readString();
  12055. int frame = inStream.method435();
  12056. if (text.startsWith("www.")) {
  12057. launchURL(text);
  12058. pkttype = -1;
  12059. return true;
  12060. }
  12061. updateStrings(text, frame);
  12062. sendFrame126(text, frame);
  12063. if (frame >= 18144 && frame <= 18244) {
  12064. clanList[frame - 18144] = text;
  12065. }
  12066. pkttype = -1;
  12067. return true;
  12068.  
  12069. case 206:
  12070. publicChatMode = inStream.readUnsignedByte();
  12071. privateChatMode = inStream.readUnsignedByte();
  12072. tradeMode = inStream.readUnsignedByte();
  12073. aBoolean1233 = true;
  12074. inputTaken = true;
  12075. pkttype = -1;
  12076. return true;
  12077.  
  12078. case 240:
  12079. if(tabID == 12)
  12080. needDrawTabArea = true;
  12081. weight = inStream.readSignedWord();
  12082. pkttype = -1;
  12083. return true;
  12084.  
  12085. case 8:
  12086. int k6 = inStream.method436();
  12087. int l13 = inStream.readUnsignedWord();
  12088. RSInterface.interfaceCache[k6].anInt233 = 1;
  12089. RSInterface.interfaceCache[k6].mediaID = l13;
  12090. pkttype = -1;
  12091. return true;
  12092.  
  12093. case 122:
  12094. int l6 = inStream.method436();
  12095. int i14 = inStream.method436();
  12096. int i19 = i14 >> 10 & 0x1f;
  12097. int i22 = i14 >> 5 & 0x1f;
  12098. int l24 = i14 & 0x1f;
  12099. RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  12100. pkttype = -1;
  12101. return true;
  12102.  
  12103. case 53:
  12104. needDrawTabArea = true;
  12105. int i7 = inStream.readUnsignedWord();
  12106. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  12107. int j19 = inStream.readUnsignedWord();
  12108. for(int j22 = 0; j22 < j19; j22++) {
  12109. int i25 = inStream.readUnsignedByte();
  12110. if(i25 == 255)
  12111. i25 = inStream.method440();
  12112. class9_1.inv[j22] = inStream.method436();
  12113. class9_1.invStackSizes[j22] = i25;
  12114. }
  12115. for(int j25 = j19; j25 < class9_1.inv.length; j25++) {
  12116. class9_1.inv[j25] = 0;
  12117. class9_1.invStackSizes[j25] = 0;
  12118. }
  12119. pkttype = -1;
  12120. return true;
  12121.  
  12122. case 230:
  12123. int j7 = inStream.method435();
  12124. int j14 = inStream.readUnsignedWord();
  12125. int k19 = inStream.readUnsignedWord();
  12126. int k22 = inStream.method436();
  12127. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  12128. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  12129. RSInterface.interfaceCache[j14].modelZoom = j7;
  12130. pkttype = -1;
  12131. return true;
  12132.  
  12133. case 221:
  12134. anInt900 = inStream.readUnsignedByte();
  12135. needDrawTabArea = true;
  12136. pkttype = -1;
  12137. return true;
  12138.  
  12139. case 177:
  12140. aBoolean1160 = true;
  12141. anInt995 = inStream.readUnsignedByte();
  12142. anInt996 = inStream.readUnsignedByte();
  12143. anInt997 = inStream.readUnsignedWord();
  12144. anInt998 = inStream.readUnsignedByte();
  12145. anInt999 = inStream.readUnsignedByte();
  12146. if(anInt999 >= 100) {
  12147. int k7 = anInt995 * 128 + 64;
  12148. int k14 = anInt996 * 128 + 64;
  12149. int i20 = method42(plane, k14, k7) - anInt997;
  12150. int l22 = k7 - xCameraPos;
  12151. int k25 = i20 - zCameraPos;
  12152. int j28 = k14 - yCameraPos;
  12153. int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  12154. yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  12155. xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  12156. if(yCameraCurve < 128)
  12157. yCameraCurve = 128;
  12158. if(yCameraCurve > 383)
  12159. yCameraCurve = 383;
  12160. }
  12161. pkttype = -1;
  12162. return true;
  12163.  
  12164. case 249:
  12165. anInt1046 = inStream.method426();
  12166. unknownInt10 = inStream.method436();
  12167. pkttype = -1;
  12168. return true;
  12169.  
  12170. case 65:
  12171. updateNPCs(inStream, pktSize);
  12172. pkttype = -1;
  12173. return true;
  12174.  
  12175. case 27:
  12176. messagePromptRaised = false;
  12177. inputDialogState = 1;
  12178. amountOrNameInput = "";
  12179. inputTaken = true;
  12180. pkttype = -1;
  12181. return true;
  12182.  
  12183. case 187:
  12184. messagePromptRaised = false;
  12185. inputDialogState = 2;
  12186. amountOrNameInput = "";
  12187. inputTaken = true;
  12188. pkttype = -1;
  12189. return true;
  12190.  
  12191. case 97:
  12192. int l7 = inStream.readUnsignedWord();
  12193. method60(l7);
  12194. if(invOverlayInterfaceID != -1) {
  12195. invOverlayInterfaceID = -1;
  12196. needDrawTabArea = true;
  12197. tabAreaAltered = true;
  12198. }
  12199. if(backDialogID != -1) {
  12200. backDialogID = -1;
  12201. inputTaken = true;
  12202. }
  12203. if(inputDialogState != 0) {
  12204. inputDialogState = 0;
  12205. inputTaken = true;
  12206. }
  12207. openInterfaceID = l7;
  12208. aBoolean1149 = false;
  12209. pkttype = -1;
  12210. return true;
  12211.  
  12212. case 218:
  12213. int i8 = inStream.method438();
  12214. dialogID = i8;
  12215. inputTaken = true;
  12216. pkttype = -1;
  12217. return true;
  12218.  
  12219. case 87:
  12220. int j8 = inStream.method434();
  12221. int l14 = inStream.method439();
  12222. anIntArray1045[j8] = l14;
  12223. if(variousSettings[j8] != l14) {
  12224. variousSettings[j8] = l14;
  12225. method33(j8);
  12226. needDrawTabArea = true;
  12227. if(dialogID != -1)
  12228. inputTaken = true;
  12229. }
  12230. pkttype = -1;
  12231. return true;
  12232.  
  12233. case 36:
  12234. int k8 = inStream.method434();
  12235. byte byte0 = inStream.readSignedByte();
  12236. anIntArray1045[k8] = byte0;
  12237. if(variousSettings[k8] != byte0) {
  12238. variousSettings[k8] = byte0;
  12239. method33(k8);
  12240. needDrawTabArea = true;
  12241. if(dialogID != -1)
  12242. inputTaken = true;
  12243. }
  12244. pkttype = -1;
  12245. return true;
  12246.  
  12247. case 61:
  12248. anInt1055 = inStream.readUnsignedByte();
  12249. pkttype = -1;
  12250. return true;
  12251.  
  12252. case 200:
  12253. int l8 = inStream.readUnsignedWord();
  12254. int i15 = inStream.readSignedWord();
  12255. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  12256. class9_4.anInt257 = i15;
  12257. if(i15 == -1) {
  12258. class9_4.anInt246 = 9846;
  12259. class9_4.anInt208 = 9846;
  12260. }
  12261. pkttype = -1;
  12262. return true;
  12263.  
  12264. case 219:
  12265. if(invOverlayInterfaceID != -1) {
  12266. invOverlayInterfaceID = -1;
  12267. needDrawTabArea = true;
  12268. tabAreaAltered = true;
  12269. }
  12270. if(backDialogID != -1) {
  12271. backDialogID = -1;
  12272. inputTaken = true;
  12273. }
  12274. if(inputDialogState != 0) {
  12275. inputDialogState = 0;
  12276. inputTaken = true;
  12277. }
  12278. openInterfaceID = -1;
  12279. aBoolean1149 = false;
  12280. pkttype = -1;
  12281. return true;
  12282.  
  12283. case 34:
  12284. needDrawTabArea = true;
  12285. int i9 = inStream.readUnsignedWord();
  12286. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  12287. while(inStream.currentOffset < pktSize) {
  12288. int j20 = inStream.method422();
  12289. int i23 = inStream.readUnsignedWord();
  12290. int l25 = inStream.readUnsignedByte();
  12291. if(l25 == 255)
  12292. l25 = inStream.readDWord();
  12293. if(j20 >= 0 && j20 < class9_2.inv.length) {
  12294. class9_2.inv[j20] = i23;
  12295. class9_2.invStackSizes[j20] = l25;
  12296. }
  12297. }
  12298. pkttype = -1;
  12299. return true;
  12300.  
  12301. case 4:
  12302. case 44:
  12303. case 84:
  12304. case 101:
  12305. case 105:
  12306. case 117:
  12307. case 147:
  12308. case 151:
  12309. case 156:
  12310. case 160:
  12311. case 215:
  12312. method137(inStream, pkttype);
  12313. pkttype = -1;
  12314. return true;
  12315.  
  12316. case 106:
  12317. tabID = inStream.method427();
  12318. needDrawTabArea = true;
  12319. tabAreaAltered = true;
  12320. pkttype = -1;
  12321. return true;
  12322.  
  12323. case 164:
  12324. int j9 = inStream.method434();
  12325. method60(j9);
  12326. if(invOverlayInterfaceID != -1) {
  12327. invOverlayInterfaceID = -1;
  12328. needDrawTabArea = true;
  12329. tabAreaAltered = true;
  12330. }
  12331. backDialogID = j9;
  12332. inputTaken = true;
  12333. openInterfaceID = -1;
  12334. aBoolean1149 = false;
  12335. pkttype = -1;
  12336. return true;
  12337.  
  12338. }
  12339. signlink.reporterror("T1 - " + pkttype + "," + pktSize + " - " + anInt842 + "," + anInt843);
  12340. //resetLogout();
  12341. } catch(IOException _ex) {
  12342. dropClient();
  12343. } catch(Exception exception) {
  12344. String s2 = "T2 - " + pkttype + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  12345. for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  12346. s2 = s2 + inStream.buffer[j15] + ",";
  12347. signlink.reporterror(s2);
  12348. //resetLogout();
  12349. }
  12350. pkttype = -1;
  12351. return true;
  12352. }
  12353.  
  12354. private void method146() {
  12355. anInt1265++;
  12356. method47(true);
  12357. method26(true);
  12358. method47(false);
  12359. method26(false);
  12360. method55();
  12361. method104();
  12362. if(!aBoolean1160) {
  12363. int i = anInt1184;
  12364. if(anInt984 / 256 > i)
  12365. i = anInt984 / 256;
  12366. if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  12367. i = anIntArray1203[4] + 128;
  12368. int k = minimapInt1 + anInt896 & 0x7ff;
  12369. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  12370. }
  12371. int j;
  12372. if(!aBoolean1160)
  12373. j = method120();
  12374. else
  12375. j = method121();
  12376. int l = xCameraPos;
  12377. int i1 = zCameraPos;
  12378. int j1 = yCameraPos;
  12379. int k1 = yCameraCurve;
  12380. int l1 = xCameraCurve;
  12381. for(int i2 = 0; i2 < 5; i2++)
  12382. if(aBooleanArray876[i2]) {
  12383. 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]);
  12384. if(i2 == 0)
  12385. xCameraPos += j2;
  12386. if(i2 == 1)
  12387. zCameraPos += j2;
  12388. if(i2 == 2)
  12389. yCameraPos += j2;
  12390. if(i2 == 3)
  12391. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  12392. if(i2 == 4) {
  12393. yCameraCurve += j2;
  12394. if(yCameraCurve < 128)
  12395. yCameraCurve = 128;
  12396. if(yCameraCurve > 383)
  12397. yCameraCurve = 383;
  12398. }
  12399. }
  12400. int k2 = Texture.anInt1481;
  12401. Model.aBoolean1684 = true;
  12402. Model.anInt1687 = 0;
  12403. Model.anInt1685 = super.mouseX - 4;
  12404. Model.anInt1686 = super.mouseY - 4;
  12405. DrawingArea.setAllPixelsToZero();
  12406. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  12407. worldController.clearObj5Cache();
  12408. updateEntities();
  12409. drawHeadIcon();
  12410. method37(k2);
  12411. draw3dScreen();
  12412. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  12413. xCameraPos = l;
  12414. zCameraPos = i1;
  12415. yCameraPos = j1;
  12416. yCameraCurve = k1;
  12417. xCameraCurve = l1;
  12418. }
  12419.  
  12420. public void clearTopInterfaces() {
  12421. stream.createFrame(130);
  12422. if (invOverlayInterfaceID != -1) {
  12423. invOverlayInterfaceID = -1;
  12424. needDrawTabArea = true;
  12425. aBoolean1149 = false;
  12426. tabAreaAltered = true;
  12427. }
  12428. if (backDialogID != -1) {
  12429. backDialogID = -1;
  12430. inputTaken = true;
  12431. aBoolean1149 = false;
  12432. }
  12433. openInterfaceID = -1;
  12434. fullscreenInterfaceID = -1;
  12435. }
  12436.  
  12437. public client() {
  12438. fullscreenInterfaceID = -1;
  12439. chatRights = new int[500];
  12440. chattypeView = 0;
  12441. clanChatMode = 0;
  12442. cButtonHPos = -1;
  12443. cButtonHCPos = -1;
  12444. cButtonCPos = 0;
  12445. server = "127.0.0.1";
  12446. anIntArrayArray825 = new int[104][104];
  12447. friendsNodeIDs = new int[200];
  12448. groundArray = new NodeList[4][104][104];
  12449. aBoolean831 = false;
  12450. aStream_834 = new Stream(new byte[5000]);
  12451. npcArray = new NPC[16384];
  12452. npcIndices = new int[16384];
  12453. anIntArray840 = new int[1000];
  12454. aStream_847 = Stream.create();
  12455. aBoolean848 = true;
  12456. openInterfaceID = -1;
  12457. currentExp = new int[Skills.skillsCount];
  12458. aBoolean872 = false;
  12459. anIntArray873 = new int[5];
  12460. anInt874 = -1;
  12461. aBooleanArray876 = new boolean[5];
  12462. drawFlames = false;
  12463. reportAbuseInput = "";
  12464. unknownInt10 = -1;
  12465. menuOpen = false;
  12466. inputString = "";
  12467. maxPlayers = 2048;
  12468. myPlayerIndex = 2047;
  12469. playerArray = new Player[maxPlayers];
  12470. playerIndices = new int[maxPlayers];
  12471. anIntArray894 = new int[maxPlayers];
  12472. aStreamArray895s = new Stream[maxPlayers];
  12473. anInt897 = 1;
  12474. anIntArrayArray901 = new int[104][104];
  12475. anInt902 = 0x766654;
  12476. aByteArray912 = new byte[16384];
  12477. currentStats = new int[Skills.skillsCount];
  12478. ignoreListAsLongs = new long[100];
  12479. loadingError = false;
  12480. anInt927 = 0x332d25;
  12481. anIntArray928 = new int[5];
  12482. anIntArrayArray929 = new int[104][104];
  12483. chattypes = new int[500];
  12484. chatNames = new String[500];
  12485. chatMessages = new String[500];
  12486. chatButtons = new Sprite[4];
  12487. modIcons = new Sprite[9];
  12488. chatImages = new Sprite[9];
  12489. sideIcons = new Sprite[15];
  12490. redStones = new Sprite[5];
  12491. aBoolean954 = true;
  12492. friendsListAsLongs = new long[200];
  12493. currentSong = -1;
  12494. drawingFlames = false;
  12495. spriteDrawX = -1;
  12496. spriteDrawY = -1;
  12497. anIntArray968 = new int[33];
  12498. anIntArray969 = new int[256];
  12499. decompressors = new Decompressor[5];
  12500. variousSettings = new int[2000];
  12501. aBoolean972 = false;
  12502. anInt975 = 50;
  12503. anIntArray976 = new int[anInt975];
  12504. anIntArray977 = new int[anInt975];
  12505. anIntArray978 = new int[anInt975];
  12506. anIntArray979 = new int[anInt975];
  12507. anIntArray980 = new int[anInt975];
  12508. anIntArray981 = new int[anInt975];
  12509. anIntArray982 = new int[anInt975];
  12510. aStringArray983 = new String[anInt975];
  12511. anInt985 = -1;
  12512. hitMarks = new Sprite[20];
  12513. hitMark = new Sprite[5];
  12514. anIntArray990 = new int[5];
  12515. aBoolean994 = false;
  12516. anInt1002 = 0x23201b;
  12517. amountOrNameInput = "";
  12518. aClass19_1013 = new NodeList();
  12519. aBoolean1017 = false;
  12520. anInt1018 = -1;
  12521. anIntArray1030 = new int[5];
  12522. aBoolean1031 = false;
  12523. mapFunctions = new Sprite[100];
  12524. dialogID = -1;
  12525. maxStats = new int[Skills.skillsCount];
  12526. anIntArray1045 = new int[2000];
  12527. aBoolean1047 = true;
  12528. anIntArray1052 = new int[151];
  12529. anInt1054 = -1;
  12530. aClass19_1056 = new NodeList();
  12531. anIntArray1057 = new int[33];
  12532. aClass9_1059 = new RSInterface();
  12533. mapScenes = new Background[100];
  12534. barFillColor = 0x4d4233;
  12535. anIntArray1065 = new int[7];
  12536. anIntArray1072 = new int[1000];
  12537. anIntArray1073 = new int[1000];
  12538. aBoolean1080 = false;
  12539. friendsList = new String[200];
  12540. inStream = Stream.create();
  12541. expectedCRCs = new int[9];
  12542. menuActionCmd2 = new int[500];
  12543. menuActionCmd3 = new int[500];
  12544. menuActionID = new int[500];
  12545. menuActionCmd1 = new int[500];
  12546. headIcons = new Sprite[20];
  12547. skullIcons = new Sprite[20];
  12548. headIconsHint = new Sprite[20];
  12549. tabAreaAltered = false;
  12550. aString1121 = "";
  12551. atPlayerActions = new String[5];
  12552. atPlayerArray = new boolean[5];
  12553. anIntArrayArrayArray1129 = new int[4][13][13];
  12554. anInt1132 = 2;
  12555. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  12556. aBoolean1141 = false;
  12557. aBoolean1149 = false;
  12558. crosses = new Sprite[8];
  12559. musicEnabled = true;
  12560. needDrawTabArea = false;
  12561. loggedIn = false;
  12562. canMute = false;
  12563. aBoolean1159 = false;
  12564. aBoolean1160 = false;
  12565. anInt1171 = 1;
  12566. myUsername = "";
  12567. myPassword = "";
  12568. genericLoadingError = false;
  12569. reportAbuseInterfaceID = -1;
  12570. aClass19_1179 = new NodeList();
  12571. anInt1184 = 128;
  12572. invOverlayInterfaceID = -1;
  12573. stream = Stream.create();
  12574. menuActionName = new String[500];
  12575. anIntArray1203 = new int[5];
  12576. anIntArray1207 = new int[50];
  12577. anInt1210 = 2;
  12578. anInt1211 = 78;
  12579. promptInput = "";
  12580. modIcons = new Background[2];
  12581. tabID = 3;
  12582. pvpIcon = new Sprite[16];
  12583. inputTaken = false;
  12584. songChanging = true;
  12585. anIntArray1229 = new int[151];
  12586. aClass11Array1230 = new Class11[4];
  12587. aBoolean1233 = false;
  12588. anIntArray1240 = new int[100];
  12589. anIntArray1241 = new int[50];
  12590. aBoolean1242 = false;
  12591. anIntArray1250 = new int[50];
  12592. rsAlreadyLoaded = false;
  12593. welcomeScreenRaised = false;
  12594. messagePromptRaised = false;
  12595. loginMessage1 = "";
  12596. loginMessage2 = "";
  12597. backDialogID = -1;
  12598. anInt1279 = 2;
  12599. bigX = new int[4000];
  12600. bigY = new int[4000];
  12601. anInt1289 = -1;
  12602. }
  12603.  
  12604. public int rights;
  12605. public String name;
  12606. public String message;
  12607. public String clanname;
  12608. private final int[] chatRights;
  12609. public int chattypeView;
  12610. public int clanChatMode;
  12611. public int duelMode;
  12612. /* Declare custom sprites */
  12613. private Sprite chatArea;
  12614. private Sprite[] chatButtons;
  12615. private Sprite tabArea;
  12616. private Sprite mapArea;
  12617. /**/
  12618. private RSImageProducer leftFrame;
  12619. private RSImageProducer topFrame;
  12620. private RSImageProducer rightFrame;
  12621. private int ignoreCount;
  12622. private long aLong824;
  12623. private int[][] anIntArrayArray825;
  12624. private int[] friendsNodeIDs;
  12625. private NodeList[][][] groundArray;
  12626. private int[] anIntArray828;
  12627. private int[] anIntArray829;
  12628. private volatile boolean aBoolean831;
  12629. private Socket aSocket832;
  12630. private int loginScreenState;
  12631. private Stream aStream_834;
  12632. private NPC[] npcArray;
  12633. private int npcCount;
  12634. private int[] npcIndices;
  12635. private int anInt839;
  12636. private int[] anIntArray840;
  12637. private int anInt841;
  12638. private int anInt842;
  12639. private int anInt843;
  12640. private String aString844;
  12641. private int privateChatMode;
  12642. private Stream aStream_847;
  12643. private boolean aBoolean848;
  12644. private static int anInt849;
  12645. private int[] anIntArray850;
  12646. private int[] anIntArray851;
  12647. private int[] anIntArray852;
  12648. private int[] anIntArray853;
  12649. private static int anInt854;
  12650. private int anInt855;
  12651. private int openInterfaceID;
  12652. private int xCameraPos;
  12653. private int zCameraPos;
  12654. private int yCameraPos;
  12655. private int yCameraCurve;
  12656. private int xCameraCurve;
  12657. private int myPrivilege;
  12658. private final int[] currentExp;
  12659. private Sprite[] redStones;
  12660. private Sprite mapFlag;
  12661. private Sprite mapMarker;
  12662. private boolean aBoolean872;
  12663. private final int[] anIntArray873;
  12664. private int anInt874;
  12665. private final boolean[] aBooleanArray876;
  12666. private int weight;
  12667. private MouseDetection mouseDetection;
  12668. private volatile boolean drawFlames;
  12669. private String reportAbuseInput;
  12670. private int unknownInt10;
  12671. private boolean menuOpen;
  12672. private int anInt886;
  12673. private String inputString;
  12674. private final int maxPlayers;
  12675. private final int myPlayerIndex;
  12676. private Player[] playerArray;
  12677. private int playerCount;
  12678. private int[] playerIndices;
  12679. private int anInt893;
  12680. private int[] anIntArray894;
  12681. private Stream[] aStreamArray895s;
  12682. private int anInt896;
  12683. private int anInt897;
  12684. private int friendsCount;
  12685. private int anInt900;
  12686. private int[][] anIntArrayArray901;
  12687. private final int anInt902;
  12688. private byte[] aByteArray912;
  12689. private int anInt913;
  12690. private int crossX;
  12691. private int crossY;
  12692. private int crossIndex;
  12693. private int crosstype;
  12694. private int plane;
  12695. private final int[] currentStats;
  12696. private static int anInt924;
  12697. private final long[] ignoreListAsLongs;
  12698. private boolean loadingError;
  12699. private final int anInt927;
  12700. private final int[] anIntArray928;
  12701. private int[][] anIntArrayArray929;
  12702. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  12703. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  12704. private int anInt933;
  12705. private int anInt934;
  12706. private int anInt935;
  12707. private int anInt936;
  12708. private int anInt937;
  12709. private int anInt938;
  12710. private static int anInt940;
  12711. private final int[] chattypes;
  12712. private final String[] chatNames;
  12713. private final String[] chatMessages;
  12714. private int anInt945;
  12715. private WorldController worldController;
  12716. private Sprite[] sideIcons;
  12717. private int menuScreenArea;
  12718. private int menuOffsetX;
  12719. private int menuOffsetY;
  12720. private int menuWidth;
  12721. private int menuHeight;
  12722. private long aLong953;
  12723. private boolean aBoolean954;
  12724. private long[] friendsListAsLongs;
  12725. private String[] clanList = new String[100];
  12726. private int currentSong;
  12727. private static int nodeID = 10;
  12728. static int portOff;
  12729. static boolean clientData;
  12730. private static boolean isMembers = true;
  12731. private static boolean lowMem;
  12732. private volatile boolean drawingFlames;
  12733. private int spriteDrawX;
  12734. private int spriteDrawY;
  12735. private final int[] anIntArray965 = {
  12736. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  12737. };
  12738. private Background aBackground_966;
  12739. private Background aBackground_967;
  12740. private final int[] anIntArray968;
  12741. private final int[] anIntArray969;
  12742. final Decompressor[] decompressors;
  12743. public int variousSettings[];
  12744. private boolean aBoolean972;
  12745. private final int anInt975;
  12746. private final int[] anIntArray976;
  12747. private final int[] anIntArray977;
  12748. private final int[] anIntArray978;
  12749. private final int[] anIntArray979;
  12750. private final int[] anIntArray980;
  12751. private final int[] anIntArray981;
  12752. private final int[] anIntArray982;
  12753. private final String[] aStringArray983;
  12754. private int anInt984;
  12755. private int anInt985;
  12756. private static int anInt986;
  12757. private Sprite HPBarFull;
  12758. private Sprite HPBarEmpty;
  12759. private Sprite[] hitMarks;
  12760. private Sprite[] hitMark;
  12761. private int anInt988;
  12762. private int anInt989;
  12763. private final int[] anIntArray990;
  12764. private static boolean aBoolean993;
  12765. private final boolean aBoolean994;
  12766. private int anInt995;
  12767. private int anInt996;
  12768. private int anInt997;
  12769. private int anInt998;
  12770. private int anInt999;
  12771. private ISAACRandomGen encryption;
  12772. private Sprite mapEdge;
  12773. private Sprite multiOverlay;
  12774. private final int anInt1002;
  12775. static final int[][] anIntArrayArray1003 = {
  12776. {
  12777. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  12778. 2983, 54193
  12779. }, {
  12780. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  12781. 56621, 4783, 1341, 16578, 35003, 25239
  12782. }, {
  12783. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  12784. 10153, 56621, 4783, 1341, 16578, 35003
  12785. }, {
  12786. 4626, 11146, 6439, 12, 4758, 10270
  12787. }, {
  12788. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  12789. }
  12790. };
  12791. private String amountOrNameInput;
  12792. private static int anInt1005;
  12793. private int daysSinceLastLogin;
  12794. private int pktSize;
  12795. private int pkttype;
  12796. private int anInt1009;
  12797. private int anInt1010;
  12798. private int anInt1011;
  12799. private NodeList aClass19_1013;
  12800. private int anInt1014;
  12801. private int anInt1015;
  12802. private int anInt1016;
  12803. private boolean aBoolean1017;
  12804. private int anInt1018;
  12805. private static final int[] anIntArray1019;
  12806. private int anInt1021;
  12807. private int anInt1022;
  12808. private int loadingStage;
  12809. private Sprite scrollBar1;
  12810. private Sprite scrollBar2;
  12811. private int anInt1026;
  12812. private Background backBase1;
  12813. private Background backBase2;
  12814. private Background backHmid1;
  12815. private final int[] anIntArray1030;
  12816. private boolean aBoolean1031;
  12817. private Sprite[] mapFunctions;
  12818. private int baseX;
  12819. private int baseY;
  12820. private int anInt1036;
  12821. private int anInt1037;
  12822. private int loginFailures;
  12823. private int anInt1039;
  12824. private int anInt1040;
  12825. private int anInt1041;
  12826. private int dialogID;
  12827. private final int[] maxStats;
  12828. private final int[] anIntArray1045;
  12829. private int anInt1046;
  12830. private boolean aBoolean1047;
  12831. private int anInt1048;
  12832. private String aString1049;
  12833. private static int anInt1051;
  12834. private final int[] anIntArray1052;
  12835. private StreamLoader titleStreamLoader;
  12836. private int anInt1054;
  12837. private int anInt1055;
  12838. private NodeList aClass19_1056;
  12839. private final int[] anIntArray1057;
  12840. public final RSInterface aClass9_1059;
  12841. private Background[] mapScenes;
  12842. private static int anInt1061;
  12843. private int anInt1062;
  12844. private final int barFillColor;
  12845. private int friendsListAction;
  12846. private final int[] anIntArray1065;
  12847. private int mouseInvInterfaceIndex;
  12848. private int lastActiveInvInterface;
  12849. private OnDemandFetcher onDemandFetcher;
  12850. private int anInt1069;
  12851. private int anInt1070;
  12852. private int anInt1071;
  12853. private int[] anIntArray1072;
  12854. private int[] anIntArray1073;
  12855. private Sprite mapDotItem;
  12856. private Sprite mapDotNPC;
  12857. private Sprite mapDotPlayer;
  12858. private Sprite mapDotFriend;
  12859. private Sprite mapDotTeam;
  12860. private Sprite mapDotClan;
  12861. private int anInt1079;
  12862. private boolean aBoolean1080;
  12863. private String[] friendsList;
  12864. private Stream inStream;
  12865. private int anInt1084;
  12866. private int anInt1085;
  12867. private int activeInterfacetype;
  12868. private int anInt1087;
  12869. private int anInt1088;
  12870. public static int anInt1089;
  12871. private final int[] expectedCRCs;
  12872. private int[] menuActionCmd2;
  12873. private int[] menuActionCmd3;
  12874. private int[] menuActionID;
  12875. private int[] menuActionCmd1;
  12876. private Sprite[] headIcons;
  12877. private Sprite[] skullIcons;
  12878. private Sprite[] headIconsHint;
  12879. private static int anInt1097;
  12880. private int anInt1098;
  12881. private int anInt1099;
  12882. private int anInt1100;
  12883. private int anInt1101;
  12884. private int anInt1102;
  12885. private static boolean tabAreaAltered;
  12886. private int anInt1104;
  12887. private RSImageProducer aRSImageProducer_1107;
  12888. private RSImageProducer aRSImageProducer_1108;
  12889. private RSImageProducer aRSImageProducer_1109;
  12890. private RSImageProducer aRSImageProducer_1110;
  12891. private RSImageProducer aRSImageProducer_1111;
  12892. private RSImageProducer aRSImageProducer_1112;
  12893. private RSImageProducer aRSImageProducer_1113;
  12894. private RSImageProducer aRSImageProducer_1114;
  12895. private RSImageProducer aRSImageProducer_1115;
  12896. private static int anInt1117;
  12897. private int membersInt;
  12898. private String aString1121;
  12899. private Sprite compass;
  12900. private RSImageProducer aRSImageProducer_1123;
  12901. private RSImageProducer aRSImageProducer_1124;
  12902. private RSImageProducer aRSImageProducer_1125;
  12903. public static Player myPlayer;
  12904. private final String[] atPlayerActions;
  12905. private final boolean[] atPlayerArray;
  12906. private final int[][][] anIntArrayArrayArray1129;
  12907. private final int[] tabInterfaceIDs = {
  12908. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  12909. -1, -1, -1, -1, -1
  12910. };
  12911. private int anInt1131;
  12912. private int anInt1132;
  12913. private int menuActionRow;
  12914. private static int anInt1134;
  12915. private int spellSelected;
  12916. private int anInt1137;
  12917. private int spellUsableOn;
  12918. private String spellTooltip;
  12919. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  12920. private boolean aBoolean1141;
  12921. private static int anInt1142;
  12922. private int energy;
  12923. private boolean aBoolean1149;
  12924. private Sprite[] crosses;
  12925. private boolean musicEnabled;
  12926. private Background[] aBackgroundArray1152s;
  12927. private static boolean needDrawTabArea;
  12928. private int unreadMessages;
  12929. private static int anInt1155;
  12930. private static boolean fpsOn;
  12931. public boolean loggedIn;
  12932. private boolean canMute;
  12933. private boolean aBoolean1159;
  12934. private boolean aBoolean1160;
  12935. static int loopCycle;
  12936. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  12937. private RSImageProducer aRSImageProducer_1163;
  12938. private RSImageProducer mapEdgeIP;
  12939. private RSImageProducer aRSImageProducer_1164;
  12940. private RSImageProducer aRSImageProducer_1165;
  12941. private RSImageProducer aRSImageProducer_1166;
  12942. private int daysSinceRecovChange;
  12943. private RSSocket socketStream;
  12944. private int anInt1169;
  12945. private int minimapInt3;
  12946. private int anInt1171;
  12947. private long aLong1172;
  12948. private String myUsername;
  12949. private String myPassword;
  12950. private static int anInt1175;
  12951. private boolean genericLoadingError;
  12952. private final int[] anIntArray1177 = {
  12953. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  12954. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  12955. 2, 2, 3
  12956. };
  12957. private int reportAbuseInterfaceID;
  12958. private NodeList aClass19_1179;
  12959. private int[] anIntArray1180;
  12960. private int[] anIntArray1181;
  12961. private int[] anIntArray1182;
  12962. private byte[][] aByteArrayArray1183;
  12963. private int anInt1184;
  12964. private int minimapInt1;
  12965. private int anInt1186;
  12966. private int anInt1187;
  12967. private static int anInt1188;
  12968. private int invOverlayInterfaceID;
  12969. private int[] anIntArray1190;
  12970. private int[] anIntArray1191;
  12971. private Stream stream;
  12972. private int anInt1193;
  12973. private int splitPrivateChat;
  12974. private Background mapBack;
  12975. private Sprite[] pvpIcon;
  12976. private String[] menuActionName;
  12977. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  12978. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  12979. private final int[] anIntArray1203;
  12980. static final int[] anIntArray1204 = {
  12981. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  12982. 58654, 5027, 1457, 16565, 34991, 25486
  12983. };
  12984. private static boolean flagged;
  12985. private final int[] anIntArray1207;
  12986. private int anInt1208;
  12987. private int minimapInt2;
  12988. private int anInt1210;
  12989. private int anInt1211;
  12990. private String promptInput;
  12991. private int anInt1213;
  12992. private int[][][] intGroundArray;
  12993. private long aLong1215;
  12994. private int loginScreenCursorPos;
  12995. private final Background[] modIcons;
  12996. private long aLong1220;
  12997. private static int tabID;
  12998. private int anInt1222;
  12999. public static boolean inputTaken;
  13000. private int inputDialogState;
  13001. private static int anInt1226;
  13002. private int nextSong;
  13003. private boolean songChanging;
  13004. private final int[] anIntArray1229;
  13005. private Class11[] aClass11Array1230;
  13006. public static int anIntArray1232[];
  13007. private boolean aBoolean1233;
  13008. private int[] anIntArray1234;
  13009. private int[] anIntArray1235;
  13010. private int[] anIntArray1236;
  13011. private int anInt1237;
  13012. private int anInt1238;
  13013. public final int anInt1239 = 100;
  13014. private final int[] anIntArray1240;
  13015. private final int[] anIntArray1241;
  13016. private boolean aBoolean1242;
  13017. private int atInventoryLoopCycle;
  13018. private int atInventoryInterface;
  13019. private int atInventoryIndex;
  13020. private int atInventoryInterfacetype;
  13021. private byte[][] aByteArrayArray1247;
  13022. private int tradeMode;
  13023. private int anInt1249;
  13024. private final int[] anIntArray1250;
  13025. private int anInt1251;
  13026. private final boolean rsAlreadyLoaded;
  13027. private int anInt1253;
  13028. private int anInt1254;
  13029. private boolean welcomeScreenRaised;
  13030. private boolean messagePromptRaised;
  13031. private int anInt1257;
  13032. private byte[][][] byteGroundArray;
  13033. private int prevSong;
  13034. private int destX;
  13035. private int destY;
  13036. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  13037. private int anInt1264;
  13038. private int anInt1265;
  13039. private String loginMessage1;
  13040. private String loginMessage2;
  13041. private int anInt1268;
  13042. private int anInt1269;
  13043. private TextDrawingArea smallText;
  13044. private TextDrawingArea aTextDrawingArea_1271;
  13045. private TextDrawingArea chatTextDrawingArea;
  13046. private int anInt1275;
  13047. private int backDialogID;
  13048. private int anInt1278;
  13049. private int anInt1279;
  13050. private int[] bigX;
  13051. private int[] bigY;
  13052. private int itemSelected;
  13053. private int anInt1283;
  13054. private int anInt1284;
  13055. private int anInt1285;
  13056. public static String chatColorHex = "00FFFF";
  13057. public static int getChatColor() {
  13058. int convertHexCode = Integer.parseInt(chatColorHex, 16);
  13059. return convertHexCode;
  13060.  
  13061. }
  13062. private String selectedItemName;
  13063. private int publicChatMode;
  13064. private static int anInt1288;
  13065. private int anInt1289;
  13066. public static int anInt1290;
  13067. public static String server = "";
  13068. public int drawCount;
  13069. public int fullscreenInterfaceID;
  13070. public int anInt1044;//377
  13071. public int anInt1129;//377
  13072. public int anInt1315;//377
  13073. public int anInt1500;//377
  13074. public int anInt1501;//377
  13075. public int[] fullScreenTextureArray;
  13076. public void resetAllImageProducers() {
  13077. if (super.fullGameScreen != null) {
  13078. return;
  13079. }
  13080. aRSImageProducer_1166 = null;
  13081. aRSImageProducer_1164 = null;
  13082. aRSImageProducer_1163 = null;
  13083. aRSImageProducer_1165 = null;
  13084. aRSImageProducer_1123 = null;
  13085. aRSImageProducer_1124 = null;
  13086. aRSImageProducer_1125 = null;
  13087. aRSImageProducer_1107 = null;
  13088. aRSImageProducer_1108 = null;
  13089. aRSImageProducer_1109 = null;
  13090. aRSImageProducer_1110 = null;
  13091. aRSImageProducer_1111 = null;
  13092. aRSImageProducer_1112 = null;
  13093. aRSImageProducer_1113 = null;
  13094. aRSImageProducer_1114 = null;
  13095. aRSImageProducer_1115 = null;
  13096. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  13097. welcomeScreenRaised = true;
  13098. }
  13099.  
  13100.  
  13101. public void launchURL(String url) {
  13102. String osName = System.getProperty("os.name");
  13103. try {
  13104. if (osName.startsWith("Mac OS")) {
  13105. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  13106. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
  13107. openURL.invoke(null, new Object[] {url});
  13108. } else if (osName.startsWith("Windows"))
  13109. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  13110. else { //assume Unix or Linux
  13111. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  13112. String browser = null;
  13113. for (int count = 0; count < browsers.length && browser == null; count++)
  13114. if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
  13115. browser = browsers[count];
  13116. if (browser == null) {
  13117. throw new Exception("Could not find web browser");
  13118. } else
  13119. Runtime.getRuntime().exec(new String[] {browser, url});
  13120. }
  13121. } catch (Exception e) {
  13122. pushMessage("Failed to open URL.", 0, "");
  13123. }
  13124. }
  13125.  
  13126. static {
  13127. anIntArray1019 = new int[99];
  13128. int i = 0;
  13129. for(int j = 0; j < 99; j++) {
  13130. int l = j + 1;
  13131. int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  13132. i += i1;
  13133. anIntArray1019[j] = i / 4;
  13134. }
  13135. anIntArray1232 = new int[32];
  13136. i = 2;
  13137. for(int k = 0; k < 32; k++) {
  13138. anIntArray1232[k] = i - 1;
  13139. i += i;
  13140. }
  13141. }
  13142. }
Advertisement
Add Comment
Please, Sign In to add comment