Advertisement
Guest User

Untitled

a guest
Nov 13th, 2012
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 424.59 KB | None | 0 0
  1. // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.kpdus.com/jad.html
  3. // Decompiler options: packimports(3)
  4.  
  5. import java.applet.AppletContext;
  6. import java.awt.*;
  7. import java.io.*;
  8. import java.math.BigInteger;
  9. import java.net.*;
  10. import java.util.zip.CRC32;
  11. import java.lang.reflect.Method;
  12. import sign.signlink;
  13. import javax.swing.*;
  14.  
  15. public class client extends RSApplet {
  16.  
  17.  
  18. public int MapX, MapY;
  19. public float LP;
  20. public static int spellID = 0;
  21. public static boolean newDamage = false;
  22. public boolean ToggleMinimap = false;
  23. public boolean hitbarToggle = true;
  24. public boolean restOrb = false;
  25. public boolean musicOrb = false;
  26. public boolean prayClicked = false;
  27. public boolean prayHover = false;
  28. public boolean curseSelected = false;
  29. public boolean praySelected = false;
  30. public boolean runClicked = false;
  31. public boolean runHover = false;
  32. public int runState = 1;
  33. public boolean counterOn = false;
  34. public boolean idToggle = false;
  35. public boolean hitmarks = false;
  36. public boolean isTextCursor = false;
  37. public Sprite counter;
  38. public Sprite counter2;
  39. public Sprite counter3;
  40. public Sprite counter4;
  41. public Sprite xpOrb;
  42. public Sprite sprite1;
  43. public Sprite xpFlag;
  44. public Sprite XPcounter;
  45. public Sprite XPcounterhover;
  46. public boolean xpHover = false;
  47. public int flagPos = 72;
  48. public boolean xpClicked = false;
  49. public int xpToDraw = 0;
  50. public int testXp = 0;
  51. public boolean drawXpBar = false;
  52. public boolean drawFlag = false;
  53. public int followPlayer = 0;
  54. public TextDrawingArea newFancyFont2;
  55. public int followNPC = 0;
  56. public int followDistance = 1;
  57. public Sprite magicAuto;
  58. public boolean Autocast = false;
  59. public int autocastId = 0;
  60. public int hitmarkWait = 0;
  61. public Sprite[] combatIcons = new Sprite[6];
  62. public static client instance;
  63.  
  64.  
  65. public TextDrawingArea newRegularFont2;
  66. public RSFont newSmallFont, newRegularFont, newBoldFont, newFancyFont;
  67. public Sprite[] chatImages = new Sprite[2];
  68.  
  69. private static String intToKOrMilLongName(int i) {
  70. String s = String.valueOf(i);
  71. for(int k = s.length() - 3; k > 0; k -= 3)
  72. s = s.substring(0, k) + "," + s.substring(k);
  73.  
  74. //if(j != 0)
  75. // aBoolean1224 = !aBoolean1224;
  76. if(s.length() > 8)
  77. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  78. else
  79. if(s.length() > 4)
  80. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  81. return " " + s;
  82. }
  83. public final String methodR(/*int i,*/ int j)
  84. {
  85. //if(i <= 0)
  86. // pktType = inStream.readUnsignedByte();
  87. if(j >= 0 && j < 10000)
  88. return String.valueOf(j);
  89. if(j >= 10000 && j < 10000000)
  90. return j / 1000 + "K";
  91. if(j >= 10000000 && j < 999999999)
  92. return j / 1000000 + "M";
  93. if(j >= 999999999)
  94. return "*";
  95. else
  96. return "?";
  97. }
  98.  
  99. static final GraphicsBuffer constructGraphicsBuffer(int x, int y, Component component) {
  100. GraphicsBuffer graphicClass;
  101. try {
  102. Class var_class = Class.forName("BasicGraphicsBuffer");
  103. GraphicsBuffer instance = (GraphicsBuffer) var_class.newInstance();
  104. instance.init(component, x, y, false);
  105. graphicClass = instance;
  106. } catch (Throwable throwable) {
  107. ProducingGraphicsBuffer graphicInstance = new ProducingGraphicsBuffer();
  108. graphicInstance.init(component, x, y, false);
  109. return graphicInstance;
  110. }
  111. return graphicClass;
  112. }
  113.  
  114. public String indexLocation(int cacheIndex, int index) {
  115. return signlink.findcachedir() + "index" + cacheIndex + "/" + (index != -1 ? index + ".gz" : "");
  116. }
  117.  
  118. public void repackCacheIndex(int cacheIndex) {
  119. System.out.println("Started repacking index " + cacheIndex + ".");
  120. int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
  121. File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
  122. try {
  123. for (int index = 0; index < indexLength; index++) {
  124. int fileIndex = Integer.parseInt(getFileNameWithoutExtension(file[index].toString()));
  125. byte[] data = fileToByteArray(cacheIndex, fileIndex);
  126. if(data != null && data.length > 0) {
  127. decompressors[cacheIndex].method234(data.length, data, fileIndex);
  128. System.out.println("Repacked " + fileIndex + ".");
  129. } else {
  130. System.out.println("Unable to locate index " + fileIndex + ".");
  131. }
  132. }
  133. } catch(Exception e) {
  134. System.out.println("Error packing cache index " + cacheIndex + ".");
  135. }
  136. System.out.println("Finished repacking " + cacheIndex + ".");
  137. }
  138.  
  139. public byte[] fileToByteArray(int cacheIndex, int index) {
  140. try {
  141. if (indexLocation(cacheIndex, index).length() <= 0 || indexLocation(cacheIndex, index) == null) {
  142. return null;
  143. }
  144. File file = new File(indexLocation(cacheIndex, index));
  145. byte[] fileData = new byte[(int)file.length()];
  146. FileInputStream fis = new FileInputStream(file);
  147. fis.read(fileData);
  148. fis.close();
  149. return fileData;
  150. } catch(Exception e) {
  151. return null;
  152. }
  153. }
  154.  
  155. public static final byte[] ReadFile(String s) {
  156. try {
  157. byte abyte0[];
  158. File file = new File(s);
  159. int i = (int)file.length();
  160. abyte0 = new byte[i];
  161. DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  162. datainputstream.readFully(abyte0, 0, i);
  163. datainputstream.close();
  164. return abyte0;
  165. } catch(Exception e) {
  166. System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  167. return null;
  168. }
  169. }
  170.  
  171. public void setDefaultCursor() {
  172. this.isTextCursor = false;
  173. Toolkit localToolkit = Toolkit.getDefaultToolkit();
  174. Cursor localCursor = localToolkit.createCustomCursor(localToolkit.getImage("Cache/Data/Icons/Arrow.png"), new Point(0, 0), "Cache/Data/Icons/Arrow.png");
  175. getGameComponent().setCursor(localCursor);
  176. }
  177.  
  178. public int getXPForLevel(int level) {
  179. int points = 0;
  180. int output = 0;
  181. for (int lvl = 1; lvl <= level; lvl++) {
  182. points += Math.floor((double) lvl + 300.0 * Math.pow(2.0, (double) lvl / 7.0));
  183. if (lvl >= level) {
  184. return output;
  185. }
  186. output = (int) Math.floor(points / 4);
  187. }
  188. return 0;
  189. }
  190.  
  191. public int positions[] = new int[2000];
  192. public int landScapes[] = new int[2000];
  193. public int objects[] = new int[2000];
  194.  
  195. public void setNewMaps() {
  196. try {
  197. BufferedReader in = new BufferedReader(new FileReader(signlink.findcachedir()+"Maps/mapConfig.txt"));
  198. String s;
  199. int D = 0;
  200. while ((s = in.readLine()) != null) {
  201. positions[D] = Integer.parseInt(s.substring(s.indexOf("=")+1,s.indexOf("(")));
  202. landScapes[D] = Integer.parseInt(s.substring(s.indexOf("(")+1,s.indexOf(")")));
  203. objects[D] = Integer.parseInt(s.substring(s.indexOf("[")+1,s.indexOf("]")));
  204. D++;
  205. }
  206. } catch (IOException e) {
  207. e.printStackTrace();
  208. }
  209. }
  210.  
  211. void block(int cycle, int x, int y) {
  212. if (cycle > loopCycle) {
  213. y -= 30;
  214. int difference = (cycle - loopCycle);
  215. int trans = (int) Math.round((double) difference * 3.5);
  216. int height = (int) Math.round(difference / 6);
  217. combatIcons[3].drawTransparent((x - 12), (y - 12 + height), trans);
  218. }
  219. }
  220.  
  221.  
  222. void hit10(int cycle, int x, int y, int type, int type2, String damage) {
  223. if (cycle > loopCycle) {
  224. y -= 30;
  225. int difference = (cycle - loopCycle);
  226. int trans = (int) Math.round((double) difference * 3.5);
  227. int height = (int) Math.round(difference / 6);
  228. combatIcons[type2].drawTransparent((x - 30), (y - 12 + height), trans);
  229. hitMark[type].drawTransparent((x - 12), (y - 12 + height), trans);
  230. aTextDrawingArea_1271.drawText(0, damage, (y + 4 + height), x);
  231. aTextDrawingArea_1271.drawText(0xffffff, damage, (y + 3 + height), (x - 1));
  232. }
  233. }
  234.  
  235. void hit100(int cycle, int x, int y, int type, int type2, String damage) {
  236. if (cycle > loopCycle) {
  237. y -= 30;
  238. int difference = (cycle - loopCycle);
  239. int trans = (int) Math.round((double) difference * 3.5);
  240. int height = (int) Math.round(difference / 6);
  241. combatIcons[type2].drawTransparent((x - 35), (y - 11 + height), trans);
  242. BigCritHit.drawTransparent((x - 20), (y - 13 + height), trans);
  243. newFancyFont2.drawText(0, damage, (y + 4 + height), x);
  244. newFancyFont2.drawText(0xffffff, damage, (y + 3 + height), (x - 1));
  245. }
  246. }
  247.  
  248. void hit70(int cycle, int x, int y, int type, int type2, String damage) {
  249. if (cycle > loopCycle) {
  250. y -= 30;
  251. int difference = (cycle - loopCycle);
  252. int trans = (int) Math.round((double) difference * 3.5);
  253. int height = (int) Math.round(difference / 6);
  254. combatIcons[type2].drawTransparent((x - 35), (y - 11 + height), trans);
  255. SmallCritHit.drawTransparent((x - 15), (y - 13 + height), trans);
  256. newFancyFont2.drawText(0, damage, (y + 4 + height), x);
  257. newFancyFont2.drawText(0xffffff, damage, (y + 3 + height), (x - 1));
  258. }
  259. }
  260.  
  261. public static String capitalize(String s) {
  262. for (int i = 0; i < s.length(); i++) {
  263. if (i == 0) {
  264. s = String.format( "%s%s",
  265. Character.toUpperCase(s.charAt(0)),
  266. s.substring(1) );
  267. }
  268. if (!Character.isLetterOrDigit(s.charAt(i))) {
  269. if (i + 1 < s.length()) {
  270. s = String.format( "%s%s%s",
  271. s.subSequence(0, i+1),
  272. Character.toUpperCase(s.charAt(i + 1)),
  273. s.substring(i+2) );
  274. }
  275. }
  276. }
  277. return s;
  278. }
  279.  
  280. public void models() {
  281. for(int ModelIndex = 0; ModelIndex < 29191; ModelIndex++) {
  282. byte[] abyte0 = getModel(ModelIndex);
  283. if(abyte0 != null && abyte0.length > 0) {
  284. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  285. pushMessage("Model added successfully!", 0, "");
  286. }
  287. }
  288. }
  289. public byte[] getModel(int Index) {
  290. try {
  291. File Model = new File("./model/"+Index+".gz");
  292. byte[] aByte = new byte[(int)Model.length()];
  293. FileInputStream fis = new FileInputStream(Model);
  294. fis.read(aByte);
  295. pushMessage("aByte = ["+aByte+"]!", 0, "");
  296. fis.close();
  297. return aByte;
  298. }
  299. catch(Exception e)
  300. {return null;}
  301. }
  302.  
  303. private void stopMidi() {
  304. signlink.midifade = 0;
  305. signlink.midi = "stop";
  306. }
  307.  
  308. private boolean menuHasAddFriend(int j) {
  309. if(j < 0)
  310. return false;
  311. int k = menuActionID[j];
  312. if(k >= 2000)
  313. k -= 2000;
  314. return k == 337;
  315. }
  316.  
  317. public void drawChannelButtons() {
  318. String text[] = { "On", "Friends", "Off", "Hide" };
  319. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  320. switch(cButtonCPos) {
  321. case 0:
  322. chatButtons[1].drawSprite(5, 142);
  323. break;
  324. case 1:
  325. chatButtons[1].drawSprite(71, 142);
  326. break;
  327. case 2:
  328. chatButtons[1].drawSprite(137, 142);
  329. break;
  330. case 3:
  331. chatButtons[1].drawSprite(203, 142);
  332. break;
  333. case 4:
  334. chatButtons[1].drawSprite(269, 142);
  335. break;
  336. case 5:
  337. chatButtons[1].drawSprite(335, 142);
  338. break;
  339. }
  340. if(cButtonHPos == cButtonCPos) {
  341. switch(cButtonHPos) {
  342. case 0:
  343. chatButtons[2].drawSprite(5, 142);
  344. break;
  345. case 1:
  346. chatButtons[2].drawSprite(71, 142);
  347. break;
  348. case 2:
  349. chatButtons[2].drawSprite(137, 142);
  350. break;
  351. case 3:
  352. chatButtons[2].drawSprite(203, 142);
  353. break;
  354. case 4:
  355. chatButtons[2].drawSprite(269, 142);
  356. break;
  357. case 5:
  358. chatButtons[2].drawSprite(335, 142);
  359. break;
  360. case 6:
  361. chatButtons[3].drawSprite(404, 142);
  362. break;
  363. }
  364. } else {
  365. switch(cButtonHPos) {
  366. case 0:
  367. chatButtons[0].drawSprite(5, 142);
  368. break;
  369. case 1:
  370. chatButtons[0].drawSprite(71, 142);
  371. break;
  372. case 2:
  373. chatButtons[0].drawSprite(137, 142);
  374. break;
  375. case 3:
  376. chatButtons[0].drawSprite(203, 142);
  377. break;
  378. case 4:
  379. chatButtons[0].drawSprite(269, 142);
  380. break;
  381. case 5:
  382. chatButtons[0].drawSprite(335, 142);
  383. break;
  384. case 6:
  385. chatButtons[3].drawSprite(404, 142);
  386. break;
  387. }
  388. }
  389. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
  390. smallText.method389(true, 26, 0xffffff, "All", 157);
  391. smallText.method389(true, 86, 0xffffff, "Game", 157);
  392. smallText.method389(true, 150, 0xffffff, "Public", 152);
  393. smallText.method389(true, 212, 0xffffff, "Private", 152);
  394. smallText.method389(true, 286, 0xffffff, "Clan", 152);
  395. smallText.method389(true, 349, 0xffffff, "Trade", 152);
  396. smallText.method382(textColor[publicChatMode], 164, text[publicChatMode], 163, true);
  397. smallText.method382(textColor[privateChatMode], 230, text[privateChatMode], 163, true);
  398. smallText.method382(textColor[clanChatMode], 296, text[clanChatMode], 163, true);
  399. smallText.method382(textColor[tradeMode], 362, text[tradeMode], 163, true);
  400. }
  401.  
  402. private void drawChatArea() {
  403. aRSImageProducer_1166.initDrawingArea();
  404. Texture.anIntArray1472 = anIntArray1180;
  405. chatArea.drawSprite(0, 0);
  406. drawChannelButtons();
  407. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  408. if(messagePromptRaised) {
  409. //chatTextDrawingArea.drawText(0, aString1121, 60, 259);
  410. //chatTextDrawingArea.drawText(128, promptInput + "*", 80, 259);
  411.  
  412. newBoldFont.drawCenteredString(aString1121, 259, 60, 0, -1);
  413. newBoldFont.drawCenteredString( promptInput + "*", 259, 80, 128, -1);
  414. } else if(inputDialogState == 1) {
  415. //chatTextDrawingArea.drawText(0, "Enter amount:", 60, 259);
  416. //chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  417.  
  418. newBoldFont.drawCenteredString("Enter amount:", 259, 60, 0, -1);
  419. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
  420. } else if(inputDialogState == 2) {
  421. //chatTextDrawingArea.drawText(0, "Enter name:", 60, 259);
  422. //chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  423.  
  424. newBoldFont.drawCenteredString("Enter name:", 259, 60, 0, -1);
  425. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
  426. } else if(aString844 != null) {
  427. //chatTextDrawingArea.drawText(0, aString844, 60, 259);
  428. //chatTextDrawingArea.drawText(128, "Click to continue", 80, 259);
  429.  
  430. newBoldFont.drawCenteredString(aString844, 259, 60, 0, -1);
  431. newBoldFont.drawCenteredString("Click to continue", 259, 80, 128, -1);
  432. } else if(backDialogID != -1) {
  433. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  434. } else if(dialogID != -1) {
  435. drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  436. } else {
  437. int j77 = -3;
  438. int j = 0;
  439. DrawingArea.setDrawingArea(122, 8, 497, 7);
  440. for(int k = 0; k < 500; k++)
  441. if(chatMessages[k] != null) {
  442. int chatType = chatTypes[k];
  443. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  444. String s1 = chatNames[k];
  445. byte byte0 = 0;
  446. if(s1 != null && s1.startsWith("@cr1@")) {
  447. s1 = s1.substring(5);
  448. byte0 = 1;
  449. } else if(s1 != null && s1.startsWith("@cr2@")) {
  450. s1 = s1.substring(5);
  451. byte0 = 2;
  452. } else if(s1 != null && s1.startsWith("@cr3@")) {
  453. s1 = s1.substring(5);
  454. byte0 = 3;
  455. } else if(s1 != null && s1.startsWith("@cr4@")) {
  456. s1 = s1.substring(5);
  457. byte0 = 4;
  458. } else if(s1 != null && s1.startsWith("@cr5@")) {
  459. s1 = s1.substring(5);
  460. byte0 = 5;
  461. } else if(s1 != null && s1.startsWith("@cr6@")) {
  462. s1 = s1.substring(5);
  463. byte0 = 6;
  464. }
  465. if(chatType == 0) {
  466. if (chatTypeView == 5 || chatTypeView == 0) {
  467. if(yPos > 0 && yPos < 210)
  468. //textDrawingArea.method389(false, 11, 0, chatMessages[k], yPos);//chat color enabled
  469. newRegularFont.drawBasicString(chatMessages[k], 11, yPos, 0, -1);
  470. j++;
  471. j77++;
  472. }
  473. }
  474. if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  475. if (chatTypeView == 1 || chatTypeView == 0) {
  476. if(yPos > 0 && yPos < 210) {
  477. int xPos = 11;
  478. if(byte0 == 1) {
  479. modIcons[0].drawBackground(xPos + 1, yPos - 12);
  480. xPos += 14;
  481. } else if(byte0 == 2) {
  482. modIcons[1].drawBackground(xPos + 1, yPos - 12);
  483. xPos += 14;
  484. } else if(byte0 == 3) {
  485. modIcons[1].drawBackground(xPos + 1, yPos - 12);
  486. xPos += 14;
  487. } else if(byte0 == 4) {
  488. modIcons[2].drawBackground(xPos + 1, yPos - 12);
  489. xPos += 14;
  490. } else if(byte0 == 5) {
  491. modIcons[3].drawBackground(xPos + 1, yPos - 12);
  492. xPos += 14;
  493. } else if(byte0 == 6) {
  494. modIcons[4].drawBackground(xPos + 1, yPos - 12);
  495. xPos += 14;
  496. }
  497. //textDrawingArea.method385(0, s1 + ":", yPos, xPos);
  498. //xPos += textDrawingArea.getTextWidth(s1) + 8;
  499. //textDrawingArea.method389(false, xPos, 255, chatMessages[k], yPos);
  500.  
  501. newRegularFont.drawBasicString(s1 + ":", xPos, yPos, 0, -1);
  502. xPos += newRegularFont.getTextWidth(s1) + 8;
  503. newRegularFont.drawBasicString(chatMessages[k], xPos, yPos, 255, -1);
  504. }
  505. j++;
  506. j77++;
  507. }
  508. }
  509. if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  510. if (chatTypeView == 2 || chatTypeView == 0) {
  511. if(yPos > 0 && yPos < 210) {
  512. int k1 = 11;
  513. //textDrawingArea.method385(0, "From", yPos, k1);
  514. //k1 += textDrawingArea.getTextWidth("From ");
  515.  
  516. newRegularFont.drawBasicString("From", k1, yPos, 0, -1);
  517. k1 += newRegularFont.getTextWidth("From ");
  518. if(byte0 == 1) {
  519. modIcons[0].drawBackground(k1, yPos - 12);
  520. k1 += 12;
  521. } else if(byte0 == 2) {
  522. modIcons[1].drawBackground(k1, yPos - 12);
  523. k1 += 12;
  524. } else if(byte0 == 3) {
  525. modIcons[1].drawBackground(k1, yPos - 12);
  526. k1 += 12;
  527. } else if(byte0 == 4) {
  528. modIcons[2].drawBackground(k1, yPos - 12);
  529. k1 += 12;
  530. } else if(byte0 == 5) {
  531. modIcons[3].drawBackground(k1, yPos - 12);
  532. k1 += 12;
  533. } else if(byte0 == 6) {
  534. modIcons[4].drawBackground(k1, yPos - 12);
  535. k1 += 12;
  536. }
  537. //textDrawingArea.method385(0, s1 + ":", yPos, k1);
  538. //k1 += textDrawingArea.getTextWidth(s1) + 8;
  539. //textDrawingArea.method385(0x800000, chatMessages[k], yPos, k1);
  540.  
  541. newRegularFont.drawBasicString(s1 + ":", k1, yPos, 0, -1);
  542. k1 += newRegularFont.getTextWidth(s1) + 8;
  543. newRegularFont.drawBasicString(chatMessages[k], k1, yPos, 0x800000, -1);
  544. }
  545. j++;
  546. j77++;
  547. }
  548. }
  549. if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  550. if (chatTypeView == 3 || chatTypeView == 0) {
  551. if(yPos > 0 && yPos < 210)
  552. //textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], yPos, 11);
  553. newRegularFont.drawBasicString( s1 + " " + chatMessages[k], 11, yPos, 0x800080, -1);
  554. j++;
  555. j77++;
  556. }
  557. }
  558. if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  559. if (chatTypeView == 2 || chatTypeView == 0) {
  560. if(yPos > 0 && yPos < 210)
  561. //textDrawingArea.method385(0x800000, chatMessages[k], yPos, 11);
  562. newRegularFont.drawBasicString(chatMessages[k], 11, yPos, 0x800000, -1);
  563. j++;
  564. j77++;
  565. }
  566. }
  567. if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  568. if (chatTypeView == 2 || chatTypeView == 0) {
  569. if(yPos > 0 && yPos < 210) {
  570. //textDrawingArea.method385(0, "To " + s1 + ":", yPos, 11);
  571. //textDrawingArea.method385(0x800000, chatMessages[k], yPos, 15 + textDrawingArea.getTextWidth("To :" + s1));
  572.  
  573. newRegularFont.drawBasicString("To " + s1 + ":", 11, yPos, 0, -1);
  574. newRegularFont.drawBasicString(chatMessages[k], 15 + newRegularFont.getTextWidth("To :" + s1), yPos, 0x800000, -1);
  575. }
  576. j++;
  577. j77++;
  578. }
  579. }
  580. if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  581. if (chatTypeView == 3 || chatTypeView == 0) {
  582. if(yPos > 0 && yPos < 210)
  583. //textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  584. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  585. j++;
  586. j77++;
  587. }
  588. if(chatType == 11 && (clanChatMode == 0)) {
  589. if (chatTypeView == 11) {
  590. if(yPos > 0 && yPos < 210)
  591. //textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  592. newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
  593. j++;
  594. j77++;
  595. }
  596. if(chatType == 12) {
  597. if(yPos > 0 && yPos < 110)
  598. //textDrawingArea.method385(0x7e3200, chatMessages[k] + " @blu@" + s1, yPos, 11);
  599. newRegularFont.drawBasicString(chatMessages[k] + " <col=255>" + s1, 11, yPos, 0x7e3200, -1);
  600. j++;
  601. }
  602. }
  603. }
  604. }
  605. DrawingArea.defaultDrawingAreaSize();
  606. anInt1211 = j * 14 + 7 + 5;
  607. if(anInt1211 < 111)
  608. anInt1211 = 111;
  609. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  610. String s;
  611. if(myPlayer != null && myPlayer.name != null)
  612. s = myPlayer.name;
  613. else
  614. s = TextClass.fixName(myUsername);
  615. //textDrawingArea.method385(0, s + ":", 133, 11);
  616. newRegularFont.drawBasicString(s + ":",11,133,0,-1);
  617. //textDrawingArea.drawChatInput(255, 12 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false); //original star
  618. //textDrawingArea.method389(false, 12 + textDrawingArea.getTextWidth(s + ": "), 255, inputString + ((loopCycle % 40 < 20) ? "<col = 0>|</col>" : ""), 133); //flashing
  619. newRegularFont.drawBasicString(inputString + ((loopCycle % 40 < 20) ? "<col = 0>|</col>" : ""), 12 + textDrawingArea.getTextWidth(s + ": "),133,255,-1);
  620. DrawingArea.method339(121, 0x807660, 506, 7);
  621. }
  622. if(menuOpen) {
  623. drawMenu(0, 338);
  624. }
  625. aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  626. aRSImageProducer_1165.initDrawingArea();
  627. Texture.anIntArray1472 = anIntArray1182;
  628. }
  629.  
  630. public void init() {
  631. instance = this;
  632. nodeID = 10;
  633. portOff = 0;
  634. setHighMem();
  635. isMembers = true;
  636. initClientFrame(503, 765);
  637. }
  638.  
  639. public void startRunnable(Runnable runnable, int i) {
  640. if(i > 10)
  641. i = 10;
  642. if(signlink.mainapp != null) {
  643. signlink.startthread(runnable, i);
  644. } else {
  645. super.startRunnable(runnable, i);
  646. }
  647. }
  648.  
  649. public Socket openSocket(int port) throws IOException {
  650. return new Socket(InetAddress.getByName(server), port);
  651. }
  652.  
  653. private boolean processMenuClick() {
  654. if(activeInterfaceType != 0)
  655. return false;
  656. int j = super.clickMode3;
  657. if(spellSelected == 1 && super.saveClickX >= 503 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  658. j = 0;
  659. if(menuOpen) {
  660. if(j != 1) {
  661. int k = super.mouseX;
  662. int j1 = super.mouseY;
  663. if(menuScreenArea == 0) {
  664. k -= 4;
  665. j1 -= 4;
  666. }
  667. if(menuScreenArea == 1) {
  668. k -= 516;
  669. j1 -= 168;
  670. }
  671. if(menuScreenArea == 2) {
  672. k -= 5;
  673. j1 -= 338;
  674. }
  675. if(menuScreenArea == 3) {
  676. k -= 516;
  677. j1 -= 0;
  678. }
  679. if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  680. menuOpen = false;
  681. if(menuScreenArea == 1)
  682. needDrawTabArea = true;
  683. if(menuScreenArea == 2)
  684. inputTaken = true;
  685. }
  686. }
  687. if(j == 1) {
  688. int l = menuOffsetX;
  689. int k1 = menuOffsetY;
  690. int i2 = menuWidth;
  691. int k2 = super.saveClickX;
  692. int l2 = super.saveClickY;
  693. if(menuScreenArea == 0) {
  694. k2 -= 4;
  695. l2 -= 4;
  696. }
  697. if(menuScreenArea == 1) {
  698. k2 -= 516;//519
  699. l2 -= 168;
  700. }
  701. if(menuScreenArea == 2) {
  702. k2 -= 5;//17
  703. l2 -= 338;
  704. }
  705. if(menuScreenArea == 3) {
  706. k2 -= 516;//519
  707. l2 -= 0;
  708. }
  709. int i3 = -1;
  710. for(int j3 = 0; j3 < menuActionRow; j3++) {
  711. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  712. if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  713. i3 = j3;
  714. }
  715. System.out.println(i3);
  716. if(i3 != -1)
  717. doAction(i3);
  718. menuOpen = false;
  719. if(menuScreenArea == 1)
  720. needDrawTabArea = true;
  721. if(menuScreenArea == 2) {
  722. inputTaken = true;
  723. }
  724. }
  725. return true;
  726. } else {
  727. if(j == 1 && menuActionRow > 0) {
  728. int i1 = menuActionID[menuActionRow - 1];
  729. 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) {
  730. int l1 = menuActionCmd2[menuActionRow - 1];
  731. int j2 = menuActionCmd3[menuActionRow - 1];
  732. RSInterface class9 = RSInterface.interfaceCache[j2];
  733. if(class9.aBoolean259 || class9.aBoolean235) {
  734. aBoolean1242 = false;
  735. anInt989 = 0;
  736. anInt1084 = j2;
  737. anInt1085 = l1;
  738. activeInterfaceType = 2;
  739. anInt1087 = super.saveClickX;
  740. anInt1088 = super.saveClickY;
  741. if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  742. activeInterfaceType = 1;
  743. if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  744. activeInterfaceType = 3;
  745. return true;
  746. }
  747. }
  748. }
  749. if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  750. j = 2;
  751. if(j == 1 && menuActionRow > 0)
  752. doAction(menuActionRow - 1);
  753. if(j == 2 && menuActionRow > 0)
  754. determineMenuSize();
  755. return false;
  756. }
  757.  
  758. }
  759.  
  760.  
  761. public static int totalRead = 0;
  762.  
  763. public static String getFileNameWithoutExtension(String fileName) {
  764. File tmpFile = new File(fileName);
  765. tmpFile.getName();
  766. int whereDot = tmpFile.getName().lastIndexOf('.');
  767. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
  768. return tmpFile.getName().substring(0, whereDot);
  769. }
  770. return "";
  771. }
  772.  
  773. public void preloadModels() {
  774. File file = new File(signlink.findcachedir()+"Raw/");
  775. File[] fileArray = file.listFiles();
  776. for(int y = 0; y < fileArray.length; y++) {
  777. String s = fileArray[y].getName();
  778. byte[] buffer = ReadFile(signlink.findcachedir()+"Raw/"+s);
  779. Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
  780. }
  781. }
  782.  
  783.  
  784.  
  785. private void saveMidi(boolean flag, byte abyte0[])
  786. {
  787. signlink.midifade = flag ? 1 : 0;
  788. signlink.midisave(abyte0, abyte0.length);
  789. }
  790.  
  791. private final void method22() {
  792. try {
  793. anInt985 = -1;
  794. aClass19_1056.removeAll();
  795. aClass19_1013.removeAll();
  796. Texture.method366();
  797. unlinkMRUNodes();
  798. worldController.initToNull();
  799. System.gc();
  800. for(int i = 0; i < 4; i++)
  801. aClass11Array1230[i].method210();
  802. for(int l = 0; l < 4; l++) {
  803. for(int k1 = 0; k1 < 104; k1++) {
  804. for(int j2 = 0; j2 < 104; j2++)
  805. byteGroundArray[l][k1][j2] = 0;
  806. }
  807. }
  808. ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  809. int k2 = aByteArrayArray1183.length;
  810. stream.createFrame(0);
  811. if(!aBoolean1159) {
  812. for(int i3 = 0; i3 < k2; i3++) {
  813. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  814. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  815. byte abyte0[] = aByteArrayArray1183[i3];
  816. //System.out.println("Floormaps: "+anIntArray1235[i3]);
  817. if(abyte0 != null) {
  818. objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  819. }
  820. }
  821. for(int j4 = 0; j4 < k2; j4++) {
  822. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  823. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  824. byte abyte2[] = aByteArrayArray1183[j4];
  825. if(abyte2 == null && anInt1070 < 800)
  826. objectManager.method174(k7, 64, 64, l5);
  827. }
  828. anInt1097++;
  829. if(anInt1097 > 160) {
  830. anInt1097 = 0;
  831. stream.createFrame(238);
  832. stream.writeByte(96);
  833. }
  834. stream.createFrame(0);
  835. for(int i6 = 0; i6 < k2; i6++) {
  836. byte abyte1[] = aByteArrayArray1247[i6];
  837. //System.out.println("Object Maps: "+anIntArray1236[i6]);
  838. if(abyte1 != null) {
  839. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  840. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  841. objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  842. }
  843. }
  844. }
  845. if(aBoolean1159) {
  846. for(int j3 = 0; j3 < 4; j3++) {
  847. for(int k4 = 0; k4 < 13; k4++) {
  848. for(int j6 = 0; j6 < 13; j6++) {
  849. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  850. if(l7 != -1) {
  851. int i9 = l7 >> 24 & 3;
  852. int l9 = l7 >> 1 & 3;
  853. int j10 = l7 >> 14 & 0x3ff;
  854. int l10 = l7 >> 3 & 0x7ff;
  855. int j11 = (j10 / 8 << 8) + l10 / 8;
  856. for(int l11 = 0; l11 < anIntArray1234.length; l11++) {
  857. if(anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  858. continue;
  859. objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  860. break;
  861. }
  862. }
  863. }
  864. }
  865. }
  866. for(int l4 = 0; l4 < 13; l4++) {
  867. for(int k6 = 0; k6 < 13; k6++) {
  868. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  869. if(i8 == -1)
  870. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  871. }
  872. }
  873. stream.createFrame(0);
  874. for(int l6 = 0; l6 < 4; l6++) {
  875. for(int j8 = 0; j8 < 13; j8++) {
  876. for(int j9 = 0; j9 < 13; j9++) {
  877. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  878. if(i10 != -1) {
  879. int k10 = i10 >> 24 & 3;
  880. int i11 = i10 >> 1 & 3;
  881. int k11 = i10 >> 14 & 0x3ff;
  882. int i12 = i10 >> 3 & 0x7ff;
  883. int j12 = (k11 / 8 << 8) + i12 / 8;
  884. for(int k12 = 0; k12 < anIntArray1234.length; k12++) {
  885. if(anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  886. continue;
  887. objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  888. }
  889. }
  890. }
  891. }
  892. }
  893. }
  894. stream.createFrame(0);
  895. objectManager.method171(aClass11Array1230, worldController);
  896. aRSImageProducer_1165.initDrawingArea();
  897. stream.createFrame(0);
  898. int k3 = ObjectManager.anInt145;
  899. if(k3 > plane)
  900. k3 = plane;
  901. if(k3 < plane - 1)
  902. k3 = plane - 1;
  903. if(lowMem)
  904. worldController.method275(ObjectManager.anInt145);
  905. else
  906. worldController.method275(0);
  907. for(int i5 = 0; i5 < 104; i5++) {
  908. for(int i7 = 0; i7 < 104; i7++)
  909. spawnGroundItem(i5, i7);
  910. }
  911. anInt1051++;
  912. if(anInt1051 > 98) {
  913. anInt1051 = 0;
  914. stream.createFrame(150);
  915. }
  916. method63();
  917. } catch(Exception e) {
  918. e.printStackTrace();
  919. }
  920. ObjectDef.mruNodes1.unlinkAll();
  921. if(super.gameFrame != null) {
  922. stream.createFrame(210);
  923. stream.writeDWord(0x3f008edd);
  924. }
  925. System.gc();
  926. Texture.method367();
  927. onDemandFetcher.method566();
  928. int k = (anInt1069 - 6) / 8 - 1;
  929. int j1 = (anInt1069 + 6) / 8 + 1;
  930. int i2 = (anInt1070 - 6) / 8 - 1;
  931. int l2 = (anInt1070 + 6) / 8 + 1;
  932. if(aBoolean1141) {
  933. k = 49;
  934. j1 = 50;
  935. i2 = 49;
  936. l2 = 50;
  937. }
  938. for(int l3 = k; l3 <= j1; l3++) {
  939. for(int j5 = i2; j5 <= l2; j5++)
  940. if(l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  941. int j7 = onDemandFetcher.method562(0, j5, l3);
  942. if(j7 != -1)
  943. onDemandFetcher.method560(j7, 3);
  944. int k8 = onDemandFetcher.method562(1, j5, l3);
  945. if(k8 != -1)
  946. onDemandFetcher.method560(k8, 3);
  947. }
  948. }
  949. }
  950.  
  951. private void unlinkMRUNodes()
  952. {
  953. ObjectDef.mruNodes1.unlinkAll();
  954. ObjectDef.mruNodes2.unlinkAll();
  955. EntityDef.mruNodes.unlinkAll();
  956. ItemDef.mruNodes2.unlinkAll();
  957. ItemDef.mruNodes1.unlinkAll();
  958. Player.mruNodes.unlinkAll();
  959. SpotAnim.aMRUNodes_415.unlinkAll();
  960. }
  961.  
  962. private void method24(int i)
  963. {
  964. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  965. int j = ai.length;
  966. for(int k = 0; k < j; k++)
  967. ai[k] = 0;
  968.  
  969. for(int l = 1; l < 103; l++)
  970. {
  971. int i1 = 24628 + (103 - l) * 512 * 4;
  972. for(int k1 = 1; k1 < 103; k1++)
  973. {
  974. if((byteGroundArray[i][k1][l] & 0x18) == 0)
  975. worldController.method309(ai, i1, i, k1, l);
  976. if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  977. worldController.method309(ai, i1, i + 1, k1, l);
  978. i1 += 4;
  979. }
  980.  
  981. }
  982.  
  983. int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  984. int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  985. aClass30_Sub2_Sub1_Sub1_1263.method343();
  986. for(int i2 = 1; i2 < 103; i2++)
  987. {
  988. for(int j2 = 1; j2 < 103; j2++)
  989. {
  990. if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  991. method50(i2, j1, j2, l1, i);
  992. if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  993. method50(i2, j1, j2, l1, i + 1);
  994. }
  995.  
  996. }
  997.  
  998. aRSImageProducer_1165.initDrawingArea();
  999. anInt1071 = 0;
  1000. for(int k2 = 0; k2 < 104; k2++)
  1001. {
  1002. for(int l2 = 0; l2 < 104; l2++)
  1003. {
  1004. int i3 = worldController.fetchGroundDecorationNewUID(plane, k2, l2);
  1005. if(i3 >= 0) {
  1006. int j3 = ObjectDef.forID(i3).anInt746;
  1007. if(j3 >= 0) {
  1008. int k3 = k2;
  1009. int l3 = l2;
  1010. if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  1011. {
  1012. byte byte0 = 104;
  1013. byte byte1 = 104;
  1014. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  1015. for(int i4 = 0; i4 < 10; i4++)
  1016. {
  1017. int j4 = (int)(Math.random() * 4D);
  1018. if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1019. k3--;
  1020. if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1021. k3++;
  1022. if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1023. l3--;
  1024. if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1025. l3++;
  1026. }
  1027.  
  1028. }
  1029. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  1030. anIntArray1072[anInt1071] = k3;
  1031. anIntArray1073[anInt1071] = l3;
  1032. anInt1071++;
  1033. }
  1034. }
  1035. }
  1036.  
  1037. }
  1038.  
  1039. }
  1040.  
  1041. private void spawnGroundItem(int i, int j)
  1042. {
  1043. NodeList class19 = groundArray[plane][i][j];
  1044. if(class19 == null)
  1045. {
  1046. worldController.method295(plane, i, j);
  1047. return;
  1048. }
  1049. int k = 0xfa0a1f01;
  1050. Object obj = null;
  1051. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  1052. {
  1053. ItemDef itemDef = ItemDef.forID(item.ID);
  1054. int l = itemDef.value;
  1055. if(itemDef.stackable)
  1056. l *= item.anInt1559 + 1;
  1057. // notifyItemSpawn(item, i + baseX, j + baseY);
  1058.  
  1059. if(l > k)
  1060. {
  1061. k = l;
  1062. obj = item;
  1063. }
  1064. }
  1065.  
  1066. class19.insertTail(((Node) (obj)));
  1067. Object obj1 = null;
  1068. Object obj2 = null;
  1069. for(Item class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetNext())
  1070. {
  1071. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  1072. obj1 = class30_sub2_sub4_sub2_1;
  1073. if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  1074. obj2 = class30_sub2_sub4_sub2_1;
  1075. }
  1076.  
  1077. int i1 = i + (j << 7) + 0x60000000;
  1078. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1079. }
  1080.  
  1081. private void method26(boolean flag)
  1082. {
  1083. for(int j = 0; j < npcCount; j++)
  1084. {
  1085. NPC npc = npcArray[npcIndices[j]];
  1086. int k = 0x20000000 + (npcIndices[j] << 14);
  1087. if(npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1088. continue;
  1089. int l = npc.x >> 7;
  1090. int i1 = npc.y >> 7;
  1091. if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1092. continue;
  1093. if(npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  1094. {
  1095. if(anIntArrayArray929[l][i1] == anInt1265)
  1096. continue;
  1097. anIntArrayArray929[l][i1] = anInt1265;
  1098. }
  1099. if(!npc.desc.aBoolean84)
  1100. k += 0x80000000;
  1101. worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  1102. }
  1103. }
  1104.  
  1105. private boolean replayWave()
  1106. {
  1107. return signlink.wavereplay();
  1108. }
  1109.  
  1110. private void loadError()
  1111. {
  1112. String s = "ondemand";//was a constant parameter
  1113. System.out.println(s);
  1114. try
  1115. {
  1116. getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1117. }
  1118. catch(Exception exception)
  1119. {
  1120. exception.printStackTrace();
  1121. }
  1122. do
  1123. try
  1124. {
  1125. Thread.sleep(1000L);
  1126. }
  1127. catch(Exception _ex) { }
  1128. while(true);
  1129. }
  1130.  
  1131. public static String chatColorHex = "00FFFF";
  1132. public static int getChatColor() {
  1133. int convertHexCode = Integer.parseInt(chatColorHex, 16);
  1134. return convertHexCode;
  1135.  
  1136. }
  1137.  
  1138. public void drawHoverBox(int xPos, int yPos, String text) {
  1139. String[] results = text.split("\n");
  1140. int height = (results.length * 16) + 6;
  1141. int width;
  1142. width = smallText.getTextWidth(results[0]) + 6;
  1143. for(int i = 1; i < results.length; i++)
  1144. if(width <= smallText.getTextWidth(results[i]) + 6)
  1145. width = smallText.getTextWidth(results[i]) + 6;
  1146. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  1147. DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  1148. yPos += 14;
  1149. for(int i = 0; i < results.length; i++) {
  1150. smallText.method389(false, xPos + 3, 0, results[i], yPos);
  1151. yPos += 16;
  1152. }
  1153. }
  1154.  
  1155. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
  1156. {
  1157. if(class9.type != 0 || class9.children == null || class9.isMouseoverTriggered)
  1158. return;
  1159. if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1160. return;
  1161. int k1 = class9.children.length;
  1162. for(int l1 = 0; l1 < k1; l1++)
  1163. {
  1164. int i2 = class9.childX[l1] + i;
  1165. int j2 = (class9.childY[l1] + l) - j1;
  1166. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1167. i2 += class9_1.anInt263;
  1168. j2 += class9_1.anInt265;
  1169. if((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1170. if(class9_1.mOverInterToTrigger >= 0)
  1171. anInt886 = class9_1.mOverInterToTrigger;
  1172. else
  1173. anInt886 = class9_1.id;
  1174. if (class9_1.type == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1175. anInt1315 = class9_1.id;
  1176. }
  1177. if (class9_1.type == 9 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1178. anInt1315 = class9_1.id;
  1179. }
  1180. if(class9_1.type == 0)
  1181. {
  1182. buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1183. if(class9_1.scrollMax > class9_1.height)
  1184. method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1185. } else
  1186. {
  1187. if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1188. {
  1189. boolean flag = false;
  1190. if(class9_1.contentType != 0)
  1191. flag = buildFriendsListMenu(class9_1);
  1192. if(!flag)
  1193. {
  1194. //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1195. if(idToggle == true) {
  1196. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1197. menuActionID[menuActionRow] = 315;
  1198. menuActionCmd3[menuActionRow] = class9_1.id;
  1199. menuActionRow++;
  1200. } else {
  1201. menuActionName[menuActionRow] = class9_1.tooltip;
  1202. menuActionID[menuActionRow] = 315;
  1203. menuActionCmd3[menuActionRow] = class9_1.id;
  1204. menuActionRow++;
  1205. }
  1206. }
  1207. }
  1208. if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1209. {
  1210. String s = class9_1.selectedActionName;
  1211. if(s.indexOf(" ") != -1)
  1212. s = s.substring(0, s.indexOf(" "));
  1213. 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")) {
  1214. menuActionName[menuActionRow] = "Autocast @gre@" + class9_1.spellName;
  1215. menuActionID[menuActionRow] = 104;
  1216. menuActionCmd3[menuActionRow] = class9_1.id;
  1217. menuActionRow++;
  1218. }
  1219. menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1220. menuActionID[menuActionRow] = 626;
  1221. menuActionCmd3[menuActionRow] = class9_1.id;
  1222. menuActionRow++;
  1223. }
  1224. if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1225. {
  1226. menuActionName[menuActionRow] = "Close";
  1227. menuActionID[menuActionRow] = 200;
  1228. menuActionCmd3[menuActionRow] = class9_1.id;
  1229. menuActionRow++;
  1230. }
  1231. if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1232. {
  1233. //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1234. if(idToggle == true) {
  1235. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1236. menuActionID[menuActionRow] = 169;
  1237. menuActionCmd3[menuActionRow] = class9_1.id;
  1238. menuActionRow++;
  1239. } else {
  1240. menuActionName[menuActionRow] = class9_1.tooltip;
  1241. menuActionID[menuActionRow] = 169;
  1242. menuActionCmd3[menuActionRow] = class9_1.id;
  1243. menuActionRow++;
  1244. }
  1245. if (class9_1.hoverText != null) {
  1246. //drawHoverBox(k, l, class9_1.hoverText);
  1247. //System.out.println("DRAWING INTERFACE: " + class9_1.hoverText);
  1248. }
  1249. }
  1250. if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1251. {
  1252. //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1253. if(idToggle == true) {
  1254. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1255. menuActionID[menuActionRow] = 646;
  1256. menuActionCmd3[menuActionRow] = class9_1.id;
  1257. menuActionRow++;
  1258. } else {
  1259. menuActionName[menuActionRow] = class9_1.tooltip;
  1260. menuActionID[menuActionRow] = 646;
  1261. menuActionCmd3[menuActionRow] = class9_1.id;
  1262. menuActionRow++;
  1263. }
  1264. }
  1265. if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1266. {
  1267. //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1268. if(idToggle == true) {
  1269. menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1270. menuActionID[menuActionRow] = 679;
  1271. menuActionCmd3[menuActionRow] = class9_1.id;
  1272. menuActionRow++;
  1273. } else {
  1274. menuActionName[menuActionRow] = class9_1.tooltip;
  1275. menuActionID[menuActionRow] = 679;
  1276. menuActionCmd3[menuActionRow] = class9_1.id;
  1277. menuActionRow++;
  1278. }
  1279. }
  1280. if(class9_1.type == 2)
  1281. {
  1282. int k2 = 0;
  1283. for(int l2 = 0; l2 < class9_1.height; l2++)
  1284. {
  1285. for(int i3 = 0; i3 < class9_1.width; i3++)
  1286. {
  1287. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1288. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1289. if(k2 < 20)
  1290. {
  1291. j3 += class9_1.spritesX[k2];
  1292. k3 += class9_1.spritesY[k2];
  1293. }
  1294. if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  1295. {
  1296. mouseInvInterfaceIndex = k2;
  1297. lastActiveInvInterface = class9_1.id;
  1298. if(class9_1.inv[k2] > 0)
  1299. {
  1300. ItemDef itemDef = ItemDef.forID(class9_1.inv[k2] - 1);
  1301. if(itemSelected == 1 && class9_1.isInventoryInterface)
  1302. {
  1303. if(class9_1.id != anInt1284 || k2 != anInt1283)
  1304. {
  1305. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  1306. menuActionID[menuActionRow] = 870;
  1307. menuActionCmd1[menuActionRow] = itemDef.id;
  1308. menuActionCmd2[menuActionRow] = k2;
  1309. menuActionCmd3[menuActionRow] = class9_1.id;
  1310. menuActionRow++;
  1311. }
  1312. } else
  1313. if(spellSelected == 1 && class9_1.isInventoryInterface)
  1314. {
  1315. if((spellUsableOn & 0x10) == 16)
  1316. {
  1317. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1318. menuActionID[menuActionRow] = 543;
  1319. menuActionCmd1[menuActionRow] = itemDef.id;
  1320. menuActionCmd2[menuActionRow] = k2;
  1321. menuActionCmd3[menuActionRow] = class9_1.id;
  1322. menuActionRow++;
  1323. }
  1324. } else
  1325. {
  1326. if(class9_1.isInventoryInterface)
  1327. {
  1328. for(int l3 = 4; l3 >= 3; l3--)
  1329. if(itemDef.actions != null && itemDef.actions[l3] != null)
  1330. {
  1331. menuActionName[menuActionRow] = itemDef.actions[l3] + " @lre@" + itemDef.name;
  1332. if(l3 == 3)
  1333. menuActionID[menuActionRow] = 493;
  1334. if(l3 == 4)
  1335. menuActionID[menuActionRow] = 847;
  1336. menuActionCmd1[menuActionRow] = itemDef.id;
  1337. menuActionCmd2[menuActionRow] = k2;
  1338. menuActionCmd3[menuActionRow] = class9_1.id;
  1339. menuActionRow++;
  1340. } else
  1341. if(l3 == 4)
  1342. {
  1343. menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1344. menuActionID[menuActionRow] = 847;
  1345. menuActionCmd1[menuActionRow] = itemDef.id;
  1346. menuActionCmd2[menuActionRow] = k2;
  1347. menuActionCmd3[menuActionRow] = class9_1.id;
  1348. menuActionRow++;
  1349. }
  1350.  
  1351. }
  1352. if(class9_1.usableItemInterface)
  1353. {
  1354. menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1355. menuActionID[menuActionRow] = 447;
  1356. menuActionCmd1[menuActionRow] = itemDef.id;
  1357. //k2 = inventory spot
  1358. //System.out.println(k2);
  1359. menuActionCmd2[menuActionRow] = k2;
  1360. menuActionCmd3[menuActionRow] = class9_1.id;
  1361. menuActionRow++;
  1362. }
  1363. if(class9_1.isInventoryInterface && itemDef.actions != null)
  1364. {
  1365. for(int i4 = 2; i4 >= 0; i4--)
  1366. if(itemDef.actions[i4] != null)
  1367. {
  1368. menuActionName[menuActionRow] = itemDef.actions[i4] + " @lre@" + itemDef.name;
  1369. if(i4 == 0)
  1370. menuActionID[menuActionRow] = 74;
  1371. if(i4 == 1)
  1372. menuActionID[menuActionRow] = 454;
  1373. if(i4 == 2)
  1374. menuActionID[menuActionRow] = 539;
  1375. menuActionCmd1[menuActionRow] = itemDef.id;
  1376. menuActionCmd2[menuActionRow] = k2;
  1377. menuActionCmd3[menuActionRow] = class9_1.id;
  1378. menuActionRow++;
  1379. }
  1380.  
  1381. }
  1382. if(class9_1.actions != null)
  1383. {
  1384. for(int j4 = 4; j4 >= 0; j4--)
  1385. if(class9_1.actions[j4] != null)
  1386. {
  1387. menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@" + itemDef.name;
  1388. if(j4 == 0)
  1389. menuActionID[menuActionRow] = 632;
  1390. if(j4 == 1)
  1391. menuActionID[menuActionRow] = 78;
  1392. if(j4 == 2)
  1393. menuActionID[menuActionRow] = 867;
  1394. if(j4 == 3)
  1395. menuActionID[menuActionRow] = 431;
  1396. if(j4 == 4)
  1397. menuActionID[menuActionRow] = 53;
  1398. menuActionCmd1[menuActionRow] = itemDef.id;
  1399. menuActionCmd2[menuActionRow] = k2;
  1400. menuActionCmd3[menuActionRow] = class9_1.id;
  1401. menuActionRow++;
  1402. }
  1403.  
  1404. }
  1405. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inv[k2] - 1) + "@gre@)";
  1406. if(idToggle == true) {
  1407. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inv[k2] - 1) + "@gre@)";
  1408. } else {
  1409. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1410. }
  1411. menuActionID[menuActionRow] = 1125;
  1412. menuActionCmd1[menuActionRow] = itemDef.id;
  1413. menuActionCmd2[menuActionRow] = k2;
  1414. menuActionCmd3[menuActionRow] = class9_1.id;
  1415. menuActionRow++;
  1416. }
  1417. }
  1418. }
  1419. k2++;
  1420. }
  1421.  
  1422. }
  1423.  
  1424. }
  1425. }
  1426. }
  1427.  
  1428. }
  1429.  
  1430. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1431. scrollBar1.drawSprite(i1, l);
  1432. scrollBar2.drawSprite(i1, (l + j) - 16);
  1433. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1434. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1435. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1436. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1437. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1438. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1439. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1440. int k1 = ((j - 32) * j) / j1;
  1441. if(k1 < 8)
  1442. k1 = 8;
  1443. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1444. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1445. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1446. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1447. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1448. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1449. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1450. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1451. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1452. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1453. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1454. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1455. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1456. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1457. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1458. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1459. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1460. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1461. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1462. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1463. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1464. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1465. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1466. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1467. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1468. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1469. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1470. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1471. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1472. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1473. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1474. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1475. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1476. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1477. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1478. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1479. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1480. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1481. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1482. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1483. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1484. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1485. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1486. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1487. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1488. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1489. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1490. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1491. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1492. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1493. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1494. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1495. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1496. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1497. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1498. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1499. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1500. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1501. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1502. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1503. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1504. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1505. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1506. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1507. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1508. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1509. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1510. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1511. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1512. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1513. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1514. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1515. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1516. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1517. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1518. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1519. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1520. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1521. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1522. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1523. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1524. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1525. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1526. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1527. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1528. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1529. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1530. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1531. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1532. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1533. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1534. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1535. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1536. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1537. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1538. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1539. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1540. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1541. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1542. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1543. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1544. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1545. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1546. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1547. }
  1548.  
  1549. private void updateNPCs(Stream stream, int i)
  1550. {
  1551. anInt839 = 0;
  1552. anInt893 = 0;
  1553. method139(stream);
  1554. method46(i, stream);
  1555. method86(stream);
  1556. for(int k = 0; k < anInt839; k++)
  1557. {
  1558. int l = anIntArray840[k];
  1559. if(npcArray[l].anInt1537 != loopCycle)
  1560. {
  1561. npcArray[l].desc = null;
  1562. npcArray[l] = null;
  1563. }
  1564. }
  1565.  
  1566. if(stream.currentOffset != i)
  1567. {
  1568. signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1569. throw new RuntimeException("eek");
  1570. }
  1571. for(int i1 = 0; i1 < npcCount; i1++)
  1572. if(npcArray[npcIndices[i1]] == null)
  1573. {
  1574. signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1575. throw new RuntimeException("eek");
  1576. }
  1577.  
  1578. }
  1579.  
  1580. private int cButtonHPos;
  1581. private int cButtonHCPos;
  1582. private int cButtonCPos;
  1583.  
  1584. private void processChatModeClick() {
  1585. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  1586. cButtonHPos = 0;
  1587. aBoolean1233 = true;
  1588. inputTaken = true;
  1589. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  1590. cButtonHPos = 1;
  1591. aBoolean1233 = true;
  1592. inputTaken = true;
  1593. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  1594. cButtonHPos = 2;
  1595. aBoolean1233 = true;
  1596. inputTaken = true;
  1597. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  1598. cButtonHPos = 3;
  1599. aBoolean1233 = true;
  1600. inputTaken = true;
  1601. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  1602. cButtonHPos = 4;
  1603. aBoolean1233 = true;
  1604. inputTaken = true;
  1605. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  1606. cButtonHPos = 5;
  1607. aBoolean1233 = true;
  1608. inputTaken = true;
  1609. } else if(super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= 482 && super.mouseY <= 503) {
  1610. cButtonHPos = 6;
  1611. aBoolean1233 = true;
  1612. inputTaken = true;
  1613. } else {
  1614. cButtonHPos = -1;
  1615. aBoolean1233 = true;
  1616. inputTaken = true;
  1617. }
  1618. if(super.clickMode3 == 1) {
  1619. if(super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1620. cButtonCPos = 0;
  1621. chatTypeView = 0;
  1622. aBoolean1233 = true;
  1623. inputTaken = true;
  1624. } else if(super.saveClickX >= 71 && super.saveClickX <= 127 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1625. cButtonCPos = 1;
  1626. chatTypeView = 5;
  1627. aBoolean1233 = true;
  1628. inputTaken = true;
  1629. } else if(super.saveClickX >= 137 && super.saveClickX <= 193 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1630. cButtonCPos = 2;
  1631. chatTypeView = 1;
  1632. aBoolean1233 = true;
  1633. inputTaken = true;
  1634. } else if(super.saveClickX >= 203 && super.saveClickX <= 259 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1635. cButtonCPos = 3;
  1636. chatTypeView = 2;
  1637. aBoolean1233 = true;
  1638. inputTaken = true;
  1639. } else if(super.saveClickX >= 269 && super.saveClickX <= 325 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1640. cButtonCPos = 4;
  1641. chatTypeView = 11;
  1642. aBoolean1233 = true;
  1643. inputTaken = true;
  1644. } else if(super.saveClickX >= 335 && super.saveClickX <= 391 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1645. cButtonCPos = 5;
  1646. chatTypeView = 3;
  1647. aBoolean1233 = true;
  1648. inputTaken = true;
  1649. } else if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1650. if(openInterfaceID == -1) {
  1651. clearTopInterfaces();
  1652. reportAbuseInput = "";
  1653. canMute = false;
  1654. for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1655. if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  1656. continue;
  1657. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1658. break;
  1659. }
  1660. } else {
  1661. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1662. }
  1663. }
  1664. }
  1665. }
  1666.  
  1667. public void method33(int i)
  1668. {
  1669. try {
  1670. int j = Varp.cache[i].anInt709;
  1671. if(j == 0)
  1672. return;
  1673. int k = variousSettings[i];
  1674. if(j == 1)
  1675. {
  1676. if(k == 1)
  1677. Texture.method372(0.90000000000000002D);
  1678. if(k == 2)
  1679. Texture.method372(0.80000000000000004D);
  1680. if(k == 3)
  1681. Texture.method372(0.69999999999999996D);
  1682. if(k == 4)
  1683. Texture.method372(0.59999999999999998D);
  1684. ItemDef.mruNodes1.unlinkAll();
  1685. welcomeScreenRaised = true;
  1686. }
  1687. if(j == 3)
  1688. {
  1689. boolean flag1 = musicEnabled;
  1690. if(k == 0)
  1691. {
  1692. adjustVolume(musicEnabled, 0);
  1693. musicEnabled = true;
  1694. }
  1695. if(k == 1)
  1696. {
  1697. adjustVolume(musicEnabled, -400);
  1698. musicEnabled = true;
  1699. }
  1700. if(k == 2)
  1701. {
  1702. adjustVolume(musicEnabled, -800);
  1703. musicEnabled = true;
  1704. }
  1705. if(k == 3)
  1706. {
  1707. adjustVolume(musicEnabled, -1200);
  1708. musicEnabled = true;
  1709. }
  1710. if(k == 4)
  1711. musicEnabled = false;
  1712. if(musicEnabled != flag1 && !lowMem)
  1713. {
  1714. if(musicEnabled)
  1715. {
  1716. nextSong = currentSong;
  1717. songChanging = true;
  1718. onDemandFetcher.method558(2, nextSong);
  1719. } else
  1720. {
  1721. stopMidi();
  1722. }
  1723. prevSong = 0;
  1724. }
  1725. }
  1726. if(j == 4)
  1727. {
  1728. if(k == 0)
  1729. {
  1730. aBoolean848 = true;
  1731. setWaveVolume(0);
  1732. }
  1733. if(k == 1)
  1734. {
  1735. aBoolean848 = true;
  1736. setWaveVolume(-400);
  1737. }
  1738. if(k == 2)
  1739. {
  1740. aBoolean848 = true;
  1741. setWaveVolume(-800);
  1742. }
  1743. if(k == 3)
  1744. {
  1745. aBoolean848 = true;
  1746. setWaveVolume(-1200);
  1747. }
  1748. if(k == 4)
  1749. aBoolean848 = false;
  1750. }
  1751. if(j == 5)
  1752. anInt1253 = k;
  1753. if(j == 6)
  1754. anInt1249 = k;
  1755. if(j == 8)
  1756. {
  1757. splitPrivateChat = k;
  1758. inputTaken = true;
  1759. }
  1760. if(j == 9)
  1761. anInt913 = k;
  1762. } catch (Exception _e) {
  1763. }
  1764. }
  1765.  
  1766. private Sprite HPBarFull;
  1767. private Sprite HPBarEmpty;
  1768.  
  1769. private void updateEntities() {
  1770. try{
  1771. int anInt974 = 0;
  1772. for(int j = -1; j < playerCount + npcCount; j++) {
  1773. Object obj;
  1774. if(j == -1)
  1775. obj = myPlayer;
  1776. else
  1777. if(j < playerCount)
  1778. obj = playerArray[playerIndices[j]];
  1779. else
  1780. obj = npcArray[npcIndices[j - playerCount]];
  1781. if(obj == null || !((Entity) (obj)).isVisible())
  1782. continue;
  1783. if(obj instanceof NPC) {
  1784. EntityDef entityDef = ((NPC)obj).desc;
  1785. if(entityDef.childrenIDs != null)
  1786. entityDef = entityDef.method161();
  1787. if(entityDef == null)
  1788. continue;
  1789. }
  1790. if(j < playerCount) {
  1791. int l = 30;
  1792. Player player = (Player)obj;
  1793. if(player.headIcon >= 0) {
  1794. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1795. if(spriteDrawX > -1) {
  1796. if (player.skullIcon < 2) {
  1797. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1798. l += 25;
  1799. }
  1800. if (player.headIcon < 18) {
  1801. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1802. l += 18;
  1803. }
  1804. }
  1805. }
  1806. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  1807. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1808. if(spriteDrawX > -1)
  1809. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1810. }
  1811. } else {
  1812. EntityDef entityDef_1 = ((NPC)obj).desc;
  1813. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  1814. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1815. if(spriteDrawX > -1)
  1816. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  1817. }
  1818. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  1819. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1820. if(spriteDrawX > -1)
  1821. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  1822. }
  1823. }
  1824. if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  1825. {
  1826. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  1827. if(spriteDrawX > -1 && anInt974 < anInt975)
  1828. {
  1829. anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
  1830. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  1831. anIntArray976[anInt974] = spriteDrawX;
  1832. anIntArray977[anInt974] = spriteDrawY;
  1833. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  1834. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  1835. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  1836. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  1837. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  1838. {
  1839. anIntArray978[anInt974] += 10;
  1840. anIntArray977[anInt974] += 5;
  1841. }
  1842. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  1843. anIntArray979[anInt974] = 60;
  1844. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  1845. anIntArray978[anInt974] += 5;
  1846. }
  1847. }
  1848. if (((Entity) (obj)).loopCycleStatus > loopCycle) {
  1849. try {
  1850. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1851. if (spriteDrawX > -1) {
  1852. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  1853. if (i1 > 30) {
  1854. i1 = 30;
  1855. }
  1856. int HpPercent = (((Entity) (obj)).currentHealth * 56) / ((Entity) (obj)).maxHealth;
  1857. if (HpPercent > 56) {
  1858. HpPercent = 56;
  1859. }
  1860. if(!hitbarToggle){
  1861. DrawingArea.method336(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  1862. DrawingArea.method336(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  1863. } else {
  1864. HPBarEmpty.drawSprite(spriteDrawX - 28, spriteDrawY - 3);
  1865. HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/HITPOINTS_0.PNG", HpPercent, 7);
  1866. HPBarFull.drawSprite(spriteDrawX - 28, spriteDrawY - 3);
  1867. }
  1868. }
  1869. } catch (Exception e) {}
  1870. }
  1871. applyTrans = 0;
  1872. for (int j1 = 0; j1 < 4; j1++) {
  1873. if (((Entity) (obj)).hitsLoopCycle[j1] > loopCycle) {
  1874. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  1875. applyTrans = 200;
  1876. if (spriteDrawX > -1) {
  1877.  
  1878. if (j1 > 0) {
  1879. spriteDrawY += (19 * j1);
  1880. }
  1881. if (((Entity) (obj)).hitArray[j1] == 0 || ((Entity) (obj)).hitType[j1] == 3) {
  1882. block(((Entity) (obj)).hitsLoopCycle[j1], spriteDrawX, spriteDrawY);
  1883. } else {
  1884. if (hitmarks) {
  1885. if (((Entity) (obj)).hitArray[j1] > 69 && ((Entity) (obj)).hitArray[j1] < 100) {
  1886. hit70(((Entity) (obj)).hitsLoopCycle[j1], spriteDrawX, spriteDrawY, ((Entity) (obj)).hitMarkTypes[j1], ((Entity) (obj)).hitType[j1], String.valueOf(((Entity) (obj)).hitArray[j1]));
  1887. } else if (((Entity) (obj)).hitArray[j1] < 70) {
  1888. hit10(((Entity) (obj)).hitsLoopCycle[j1], spriteDrawX, spriteDrawY, ((Entity) (obj)).hitMarkTypes[j1], ((Entity) (obj)).hitType[j1], String.valueOf(((Entity) (obj)).hitArray[j1]));
  1889. } else {
  1890. hit100(((Entity) (obj)).hitsLoopCycle[j1], spriteDrawX, spriteDrawY, ((Entity) (obj)).hitMarkTypes[j1], ((Entity) (obj)).hitType[j1], String.valueOf(((Entity) (obj)).hitArray[j1]));
  1891. }
  1892. } else {
  1893. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawTranSprite(spriteDrawX - 12, spriteDrawY - 12, 0);
  1894. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  1895. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  1896. }
  1897. }
  1898. }
  1899. }
  1900. }
  1901. }
  1902. for(int k = 0; k < anInt974; k++) {
  1903. int k1 = anIntArray976[k];
  1904. int l1 = anIntArray977[k];
  1905. int j2 = anIntArray979[k];
  1906. int k2 = anIntArray978[k];
  1907. boolean flag = true;
  1908. while(flag)
  1909. {
  1910. flag = false;
  1911. for(int l2 = 0; l2 < k; l2++)
  1912. 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)
  1913. {
  1914. l1 = anIntArray977[l2] - anIntArray978[l2];
  1915. flag = true;
  1916. }
  1917.  
  1918. }
  1919. spriteDrawX = anIntArray976[k];
  1920. spriteDrawY = anIntArray977[k] = l1;
  1921. String s = aStringArray983[k];
  1922. if(anInt1249 == 0)
  1923. {
  1924. int i3 = 0xffff00;
  1925. if(anIntArray980[k] < 6)
  1926. i3 = anIntArray965[anIntArray980[k]];
  1927. if(anIntArray980[k] == 6)
  1928. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  1929. if(anIntArray980[k] == 7)
  1930. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  1931. if(anIntArray980[k] == 8)
  1932. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  1933. if(anIntArray980[k] == 9) {
  1934. int j3 = 150 - anIntArray982[k];
  1935. if(j3 < 50)
  1936. i3 = 0xff0000 + 1280 * j3;
  1937. else
  1938. if(j3 < 100)
  1939. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  1940. else
  1941. if(j3 < 150)
  1942. i3 = 65280 + 5 * (j3 - 100);
  1943. }
  1944. if(anIntArray980[k] == 10) {
  1945. int k3 = 150 - anIntArray982[k];
  1946. if(k3 < 50)
  1947. i3 = 0xff0000 + 5 * k3;
  1948. else
  1949. if(k3 < 100)
  1950. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  1951. else
  1952. if(k3 < 150)
  1953. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  1954. }
  1955. if(anIntArray980[k] == 11) {
  1956. int l3 = 150 - anIntArray982[k];
  1957. if(l3 < 50)
  1958. i3 = 0xffffff - 0x50005 * l3;
  1959. else
  1960. if(l3 < 100)
  1961. i3 = 65280 + 0x50005 * (l3 - 50);
  1962. else
  1963. if(l3 < 150)
  1964. i3 = 0xffffff - 0x50000 * (l3 - 100);
  1965. }
  1966. if(anIntArray981[k] == 0) {
  1967. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1968. chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  1969. }
  1970. if(anIntArray981[k] == 1) {
  1971. chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  1972. chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  1973. }
  1974. if(anIntArray981[k] == 2) {
  1975. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  1976. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  1977. }
  1978. if(anIntArray981[k] == 3) {
  1979. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  1980. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  1981. }
  1982. if(anIntArray981[k] == 4) {
  1983. int i4 = chatTextDrawingArea.method384(s);
  1984. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  1985. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  1986. chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  1987. chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  1988. DrawingArea.defaultDrawingAreaSize();
  1989. }
  1990. if(anIntArray981[k] == 5) {
  1991. int j4 = 150 - anIntArray982[k];
  1992. int l4 = 0;
  1993. if(j4 < 25)
  1994. l4 = j4 - 25;
  1995. else
  1996. if(j4 > 125)
  1997. l4 = j4 - 125;
  1998. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  1999. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  2000. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  2001. DrawingArea.defaultDrawingAreaSize();
  2002. }
  2003. } else {
  2004. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2005. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  2006. }
  2007. }
  2008. } catch(Exception e){ }
  2009. }
  2010.  
  2011. private void delFriend(long l)
  2012. {
  2013. try
  2014. {
  2015. if(l == 0L)
  2016. return;
  2017. for(int i = 0; i < friendsCount; i++)
  2018. {
  2019. if(friendsListAsLongs[i] != l)
  2020. continue;
  2021. friendsCount--;
  2022. needDrawTabArea = true;
  2023. for(int j = i; j < friendsCount; j++)
  2024. {
  2025. friendsList[j] = friendsList[j + 1];
  2026. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2027. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2028. }
  2029.  
  2030. stream.createFrame(215);
  2031. stream.writeQWord(l);
  2032. break;
  2033. }
  2034. }
  2035. catch(RuntimeException runtimeexception)
  2036. {
  2037. signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  2038. throw new RuntimeException();
  2039. }
  2040. }
  2041.  
  2042. public void drawSideIcons(){
  2043. /* Top sideIcons */
  2044. if(tabInterfaceIDs[0] != -1)
  2045. newSideIcons[0].drawSprite(8, 8);
  2046. if(tabInterfaceIDs[1] != -1)
  2047. newSideIcons[1].drawSprite(37, 8);
  2048. if(tabInterfaceIDs[2] != -1)
  2049. newSideIcons[2].drawSprite(67, 8);
  2050. if(tabInterfaceIDs[14] != -1)
  2051. newSideIcons[3].drawSprite(97, 8);
  2052. if(tabInterfaceIDs[3] != -1)
  2053. newSideIcons[4].drawSprite(127, 8);
  2054. if(tabInterfaceIDs[4] != -1)
  2055. newSideIcons[5].drawSprite(159, 8);
  2056. if(tabInterfaceIDs[5] != -1)
  2057. newSideIcons[6].drawSprite(187, 8);
  2058. if(tabInterfaceIDs[6] != -1)
  2059. newSideIcons[7].drawSprite(217, 8);
  2060. /* Bottom sideIcons */
  2061. if(tabInterfaceIDs[9] != -1)
  2062. newSideIcons[8].drawSprite(38, 306);
  2063. if(tabInterfaceIDs[8] != -1)
  2064. newSideIcons[9].drawSprite(70, 306);
  2065. if(tabInterfaceIDs[7] != -1)
  2066. newSideIcons[13].drawSprite(97, 306);
  2067. if(tabInterfaceIDs[11] != -1)
  2068. newSideIcons[10].drawSprite(127, 306);
  2069. if(tabInterfaceIDs[12] != -1)
  2070. newSideIcons[11].drawSprite(157, 306);
  2071. if(tabInterfaceIDs[13] != -1)
  2072. newSideIcons[12].drawSprite(187, 306);
  2073. if(tabInterfaceIDs[15] != -1)
  2074. newSideIcons[14].drawSprite(216, 307);
  2075. }
  2076.  
  2077. public void drawRedStones() {
  2078. if(tabInterfaceIDs[tabID] != -1)
  2079. {
  2080. if(tabID == 0)
  2081. tabClicked.drawSprite(2, 0);
  2082. if(tabID == 1)
  2083. tabClicked.drawSprite(32, 0);
  2084. if(tabID == 2)
  2085. tabClicked.drawSprite(62, 0);
  2086. if(tabID == 14)
  2087. tabClicked.drawSprite(92, 0);
  2088. if(tabID == 3)
  2089. tabClicked.drawSprite(122, 0);
  2090. if(tabID == 4)
  2091. tabClicked.drawSprite(152, 0);
  2092. if(tabID == 5)
  2093. tabClicked.drawSprite(182, 0);
  2094. if(tabID == 6)
  2095. tabClicked.drawSprite(212, 0);
  2096. if(tabID == 16)
  2097. tabClicked.drawSprite(2, 298);
  2098. if(tabID == 8)
  2099. tabClicked.drawSprite(32, 298);
  2100. if(tabID == 9)
  2101. tabClicked.drawSprite(62, 298);
  2102. if(tabID == 7)
  2103. tabClicked.drawSprite(92, 298);
  2104. if(tabID == 11)
  2105. tabClicked.drawSprite(122, 298);
  2106. if(tabID == 12)
  2107. tabClicked.drawSprite(152, 298);
  2108. if(tabID == 13)
  2109. tabClicked.drawSprite(182, 298);
  2110. if(tabID == 15)
  2111. tabClicked.drawSprite(212, 298);
  2112. }
  2113. }
  2114.  
  2115. public void drawTabHover() {
  2116. if(tabHPos == 0 && tabInterfaceIDs[0] != -1)
  2117. tabHover.drawSprite(3, 0);
  2118. else if(tabHPos == 1 && tabInterfaceIDs[1] != -1)
  2119. tabHover.drawSprite(33, 0);
  2120. else if(tabHPos == 2 && tabInterfaceIDs[2] != -1)
  2121. tabHover.drawSprite(63, 0);
  2122. else if(tabHPos == 3 && tabInterfaceIDs[14] != -1)
  2123. tabHover.drawSprite(93, 0);
  2124. else if(tabHPos == 4 && tabInterfaceIDs[3] != -1)
  2125. tabHover.drawSprite(123, 0);
  2126. else if(tabHPos == 5 && tabInterfaceIDs[4] != -1)
  2127. tabHover.drawSprite(153, 0);
  2128. else if(tabHPos == 6 && tabInterfaceIDs[5] != -1)
  2129. tabHover.drawSprite(183, 0);
  2130. else if(tabHPos == 7 && tabInterfaceIDs[6] != -1)
  2131. tabHover.drawSprite(213, 0);
  2132. else if(tabHPos == 15 && tabInterfaceIDs[16] != -1)
  2133. tabHover.drawSprite(3, 298);
  2134. else if(tabHPos == 8 && tabInterfaceIDs[9] != -1)
  2135. tabHover.drawSprite(33, 298);
  2136. else if(tabHPos == 9 && tabInterfaceIDs[8] != -1)
  2137. tabHover.drawSprite(63, 298);
  2138. else if(tabHPos == 10 && tabInterfaceIDs[7] != -1)
  2139. tabHover.drawSprite(93, 298);
  2140. else if(tabHPos == 11 && tabInterfaceIDs[11] != -1)
  2141. tabHover.drawSprite(123, 298);
  2142. else if(tabHPos == 12 && tabInterfaceIDs[12] != -1)
  2143. tabHover.drawSprite(153, 298);
  2144. else if(tabHPos == 13 && tabInterfaceIDs[13] != -1)
  2145. tabHover.drawSprite(183,298);
  2146. else if(tabHPos == 14 && tabInterfaceIDs[15] != -1)
  2147. tabHover.drawSprite(213, 298);
  2148. }
  2149.  
  2150. private void drawTabArea() {
  2151. aRSImageProducer_1163.initDrawingArea();
  2152. Texture.anIntArray1472 = anIntArray1181;
  2153. tabArea.drawSprite(0, 0);
  2154. if(invOverlayInterfaceID == -1) {
  2155. drawTabHover();
  2156. drawRedStones();
  2157. drawSideIcons();
  2158. }
  2159. if(invOverlayInterfaceID != -1)
  2160. drawInterface(0, 28, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  2161. else if(tabInterfaceIDs[tabID] != -1)
  2162. drawInterface(0, 28, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  2163. if(menuOpen)
  2164. drawMenu(516, 168);
  2165. aRSImageProducer_1163.drawGraphics(168, super.graphics, 516);
  2166. aRSImageProducer_1165.initDrawingArea();
  2167. Texture.anIntArray1472 = anIntArray1182;
  2168. }
  2169.  
  2170. private void method37(int j) {
  2171. if(!lowMem) {
  2172. if(Texture.anIntArray1480[17] >= j) {
  2173. Background background = Texture.aBackgroundArray1474s[17];
  2174. int k = background.anInt1452 * background.anInt1453 - 1;
  2175. //fire cape apparently?
  2176. int j1 = background.anInt1452 * anInt945 * 2;
  2177. byte abyte0[] = background.aByteArray1450;
  2178. byte abyte3[] = aByteArray912;
  2179. for(int i2 = 0; i2 <= k; i2++)
  2180. abyte3[i2] = abyte0[i2 - j1 & k];
  2181.  
  2182. background.aByteArray1450 = abyte3;
  2183. aByteArray912 = abyte0;
  2184. Texture.method370(17);
  2185. anInt854++;
  2186. if(anInt854 > 1235) {
  2187. anInt854 = 0;
  2188. stream.createFrame(226);
  2189. stream.writeWordBigEndian(0);
  2190. int l2 = stream.currentOffset;
  2191. stream.writeWord(58722);
  2192. stream.writeWordBigEndian(240);
  2193. stream.writeWord((int)(Math.random() * 65536D));
  2194. stream.writeWordBigEndian((int)(Math.random() * 256D));
  2195. if((int)(Math.random() * 2D) == 0)
  2196. stream.writeWord(51825);
  2197. stream.writeWordBigEndian((int)(Math.random() * 256D));
  2198. stream.writeWord((int)(Math.random() * 65536D));
  2199. stream.writeWord(7130);
  2200. stream.writeWord((int)(Math.random() * 65536D));
  2201. stream.writeWord(61657);
  2202. stream.writeBytes(stream.currentOffset - l2);
  2203. }
  2204. }
  2205. if(Texture.anIntArray1480[24] >= j) {
  2206. Background background_1 = Texture.aBackgroundArray1474s[24];
  2207. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  2208. int k1 = background_1.anInt1452 * anInt945 * 2;
  2209. byte abyte1[] = background_1.aByteArray1450;
  2210. byte abyte4[] = aByteArray912;
  2211. for(int j2 = 0; j2 <= l; j2++)
  2212. abyte4[j2] = abyte1[j2 - k1 & l];
  2213.  
  2214. background_1.aByteArray1450 = abyte4;
  2215. aByteArray912 = abyte1;
  2216. Texture.method370(24);
  2217. }
  2218. if(Texture.anIntArray1480[34] >= j) {
  2219. Background background_2 = Texture.aBackgroundArray1474s[34];
  2220. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2221. int l1 = background_2.anInt1452 * anInt945 * 2;
  2222. byte abyte2[] = background_2.aByteArray1450;
  2223. byte abyte5[] = aByteArray912;
  2224. for(int k2 = 0; k2 <= i1; k2++)
  2225. abyte5[k2] = abyte2[k2 - l1 & i1];
  2226.  
  2227. background_2.aByteArray1450 = abyte5;
  2228. aByteArray912 = abyte2;
  2229. Texture.method370(34);
  2230. }
  2231. if(Texture.anIntArray1480[40] >= j) {
  2232. Background background_2 = Texture.aBackgroundArray1474s[40];
  2233. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2234. int l1 = background_2.anInt1452 * anInt945 * 2;
  2235. byte abyte2[] = background_2.aByteArray1450;
  2236. byte abyte5[] = aByteArray912;
  2237. for(int k2 = 0; k2 <= i1; k2++)
  2238. abyte5[k2] = abyte2[k2 - l1 & i1];
  2239.  
  2240. background_2.aByteArray1450 = abyte5;
  2241. aByteArray912 = abyte2;
  2242. Texture.method370(40);
  2243. }
  2244. }
  2245. }
  2246.  
  2247. private void method38() {
  2248. for(int i = -1; i < playerCount; i++) {
  2249. int j;
  2250. if(i == -1)
  2251. j = myPlayerIndex;
  2252. else
  2253. j = playerIndices[i];
  2254. Player player = playerArray[j];
  2255. if(player != null && player.textCycle > 0) {
  2256. player.textCycle--;
  2257. if(player.textCycle == 0)
  2258. player.textSpoken = null;
  2259. }
  2260. }
  2261. for(int k = 0; k < npcCount; k++) {
  2262. int l = npcIndices[k];
  2263. NPC npc = npcArray[l];
  2264. if(npc != null && npc.textCycle > 0) {
  2265. npc.textCycle--;
  2266. if(npc.textCycle == 0)
  2267. npc.textSpoken = null;
  2268. }
  2269. }
  2270. }
  2271.  
  2272. private void calcCameraPos() {
  2273. int i = anInt1098 * 128 + 64;
  2274. int j = anInt1099 * 128 + 64;
  2275. int k = method42(plane, j, i) - anInt1100;
  2276. if(xCameraPos < i) {
  2277. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2278. if(xCameraPos > i)
  2279. xCameraPos = i;
  2280. }
  2281. if(xCameraPos > i) {
  2282. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2283. if(xCameraPos < i)
  2284. xCameraPos = i;
  2285. }
  2286. if(zCameraPos < k) {
  2287. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2288. if(zCameraPos > k)
  2289. zCameraPos = k;
  2290. }
  2291. if(zCameraPos > k) {
  2292. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2293. if(zCameraPos < k)
  2294. zCameraPos = k;
  2295. }
  2296. if(yCameraPos < j) {
  2297. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2298. if(yCameraPos > j)
  2299. yCameraPos = j;
  2300. }
  2301. if(yCameraPos > j) {
  2302. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2303. if(yCameraPos < j)
  2304. yCameraPos = j;
  2305. }
  2306. i = anInt995 * 128 + 64;
  2307. j = anInt996 * 128 + 64;
  2308. k = method42(plane, j, i) - anInt997;
  2309. int l = i - xCameraPos;
  2310. int i1 = k - zCameraPos;
  2311. int j1 = j - yCameraPos;
  2312. int k1 = (int)Math.sqrt(l * l + j1 * j1);
  2313. int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2314. int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2315. if(l1 < 128)
  2316. l1 = 128;
  2317. if(l1 > 383)
  2318. l1 = 383;
  2319. if(yCameraCurve < l1) {
  2320. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2321. if(yCameraCurve > l1)
  2322. yCameraCurve = l1;
  2323. }
  2324. if(yCameraCurve > l1) {
  2325. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2326. if(yCameraCurve < l1)
  2327. yCameraCurve = l1;
  2328. }
  2329. int j2 = i2 - xCameraCurve;
  2330. if(j2 > 1024)
  2331. j2 -= 2048;
  2332. if(j2 < -1024)
  2333. j2 += 2048;
  2334. if(j2 > 0) {
  2335. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2336. xCameraCurve &= 0x7ff;
  2337. }
  2338. if(j2 < 0) {
  2339. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2340. xCameraCurve &= 0x7ff;
  2341. }
  2342. int k2 = i2 - xCameraCurve;
  2343. if(k2 > 1024)
  2344. k2 -= 2048;
  2345. if(k2 < -1024)
  2346. k2 += 2048;
  2347. if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2348. xCameraCurve = i2;
  2349. }
  2350.  
  2351. private void drawMenu(int xOffSet, int yOffSet) {
  2352. int xPos = menuOffsetX - (xOffSet - 4);
  2353. int yPos = (-yOffSet + 4) + menuOffsetY;
  2354. int menuW = menuWidth;
  2355. int menuH = menuHeight + 1;
  2356. needDrawTabArea = true;
  2357. inputTaken = true;
  2358. tabAreaAltered = true;
  2359. //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  2360. //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  2361. DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos, 0x706a5e, menuW);
  2362. DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 1, 0x706a5e, menuW - 2);
  2363. DrawingArea.drawPixels(menuH, yPos, xPos + 2, 0x706a5e, menuW - 4);
  2364. DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 3, 0x2d2822, menuW - 6);
  2365. DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos + 2, 0x2d2822, menuW - 4);
  2366. DrawingArea.drawPixels(menuH - 6, yPos + 3, xPos + 1, 0x2d2822, menuW - 2);
  2367. DrawingArea.drawPixels(menuH - 22, yPos + 19, xPos + 2, 0x524a3d, menuW - 4);
  2368. DrawingArea.drawPixels(menuH - 22, yPos + 20, xPos + 3, 0x524a3d, menuW - 6);
  2369. DrawingArea.drawPixels(menuH - 23, yPos + 20, xPos + 3, 0x2b271c, menuW - 6);
  2370. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x2a291b, yPos + 2);
  2371. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a261b, yPos + 3);
  2372. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x252116, yPos + 4);
  2373. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x211e15, yPos + 5);
  2374. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1e1b12, yPos + 6);
  2375. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1a170e, yPos + 7);
  2376. DrawingArea.fillPixels(xPos + 2, menuW - 4, 2, 0x15120b, yPos + 8);
  2377. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x100d08, yPos + 10);
  2378. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 11);
  2379. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x080703, yPos + 12);
  2380. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 13);
  2381. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 14);
  2382. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 15);
  2383. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 16);
  2384. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 17);
  2385. DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a291b, yPos + 18);
  2386. DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x564943, yPos + 19);
  2387. chatTextDrawingArea.method385(0xc6b895, "Choose Option", yPos + 14, xPos + 3);
  2388. int j1 = super.mouseX;
  2389. int k1 = super.mouseY;
  2390. int mouseX = super.mouseX - (xOffSet);
  2391. int mouseY = (-yOffSet) + super.mouseY;
  2392. for(int l1 = 0; l1 < menuActionRow; l1++) {
  2393. int textY = yPos + 31 + (menuActionRow - 1 - l1) * 15;
  2394. int disColor = 0xc6b895;
  2395. if(mouseX > xPos && mouseX < xPos + menuW && mouseY > textY - 13 && mouseY < textY + 3) {
  2396. DrawingArea.drawPixels(15, textY - 11, xPos + 3, 0x6f695d, menuWidth - 6);
  2397. disColor = 0xeee5c6;
  2398. }
  2399. chatTextDrawingArea.method389(true, xPos + 3, disColor, menuActionName[l1], textY);
  2400. }
  2401. }
  2402.  
  2403. private void addFriend(long l) {
  2404. try {
  2405. if(l == 0L)
  2406. return;
  2407. if(friendsCount >= 100 && anInt1046 != 1) {
  2408. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2409. return;
  2410. }
  2411. if(friendsCount >= 200) {
  2412. pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2413. return;
  2414. }
  2415. String s = TextClass.fixName(TextClass.nameForLong(l));
  2416. for(int i = 0; i < friendsCount; i++)
  2417. if(friendsListAsLongs[i] == l) {
  2418. pushMessage(s + " is already on your friend list", 0, "");
  2419. return;
  2420. }
  2421. for(int j = 0; j < ignoreCount; j++)
  2422. if(ignoreListAsLongs[j] == l) {
  2423. pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  2424. return;
  2425. }
  2426.  
  2427. if(s.equals(myPlayer.name)) {
  2428. return;
  2429. } else {
  2430. friendsList[friendsCount] = s;
  2431. friendsListAsLongs[friendsCount] = l;
  2432. friendsNodeIDs[friendsCount] = 0;
  2433. friendsCount++;
  2434. needDrawTabArea = true;
  2435. stream.createFrame(188);
  2436. stream.writeQWord(l);
  2437. return;
  2438. }
  2439. } catch(RuntimeException runtimeexception) {
  2440. signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
  2441. }
  2442. throw new RuntimeException();
  2443. }
  2444.  
  2445. private int method42(int i, int j, int k) {
  2446. int l = k >> 7;
  2447. int i1 = j >> 7;
  2448. if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2449. return 0;
  2450. int j1 = i;
  2451. if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2452. j1++;
  2453. int k1 = k & 0x7f;
  2454. int l1 = j & 0x7f;
  2455. int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2456. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2457. return i2 * (128 - l1) + j2 * l1 >> 7;
  2458. }
  2459.  
  2460. private static String intToKOrMil(int j) {
  2461. if(j < 0x186a0)
  2462. return String.valueOf(j);
  2463. if(j < 0x989680)
  2464. return j / 1000 + "K";
  2465. else
  2466. return j / 0xf4240 + "M";
  2467. }
  2468.  
  2469. private void resetLogout() {
  2470. try {
  2471. if(socketStream != null)
  2472. socketStream.close();
  2473. }
  2474. catch(Exception _ex) { }
  2475. socketStream = null;
  2476. loggedIn = false;
  2477. loginScreenState = 0;
  2478. xpClicked = false;
  2479. drawXpBar = false;
  2480. followPlayer = 0;
  2481. followNPC = 0;
  2482. followDistance = 1;
  2483. unlinkMRUNodes();
  2484. worldController.initToNull();
  2485. for(int i = 0; i < 4; i++)
  2486. aClass11Array1230[i].method210();
  2487. System.gc();
  2488. stopMidi();
  2489. currentSong = -1;
  2490. nextSong = -1;
  2491. prevSong = 0;
  2492. }
  2493.  
  2494. private void method45() {
  2495. aBoolean1031 = true;
  2496. for(int j = 0; j < 7; j++) {
  2497. anIntArray1065[j] = -1;
  2498. for(int k = 0; k < IDK.length; k++) {
  2499. if(IDK.cache[k].aBoolean662 || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2500. continue;
  2501. anIntArray1065[j] = k;
  2502. break;
  2503. }
  2504. }
  2505. }
  2506.  
  2507. private void method46(int i, Stream stream) {
  2508. while(stream.bitPosition + 21 < i * 8) {
  2509. int k = stream.readBits(14);
  2510. if(k == 16383)
  2511. break;
  2512. if(npcArray[k] == null)
  2513. npcArray[k] = new NPC();
  2514. NPC npc = npcArray[k];
  2515. npcIndices[npcCount++] = k;
  2516. npc.anInt1537 = loopCycle;
  2517. int l = stream.readBits(5);
  2518. if(l > 15)
  2519. l -= 32;
  2520. int i1 = stream.readBits(5);
  2521. if(i1 > 15)
  2522. i1 -= 32;
  2523. int j1 = stream.readBits(1);
  2524. npc.desc = EntityDef.forID(stream.readBits(14));
  2525. int k1 = stream.readBits(1);
  2526. if(k1 == 1)
  2527. anIntArray894[anInt893++] = k;
  2528. npc.anInt1540 = npc.desc.aByte68;
  2529. npc.anInt1504 = npc.desc.anInt79;
  2530. npc.anInt1554 = npc.desc.walkAnim;
  2531. npc.anInt1555 = npc.desc.anInt58;
  2532. npc.anInt1556 = npc.desc.anInt83;
  2533. npc.anInt1557 = npc.desc.anInt55;
  2534. npc.anInt1511 = npc.desc.standAnim;
  2535. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2536. }
  2537. stream.finishBitAccess();
  2538. }
  2539.  
  2540. public void processGameLoop() {
  2541. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  2542. return;
  2543. loopCycle++;
  2544. if(!loggedIn)
  2545. processLoginScreenInput();
  2546. else
  2547. mainGameProcessor();
  2548. processOnDemandQueue();
  2549. }
  2550.  
  2551. private void method47(boolean flag) {
  2552. if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2553. destX = 0;
  2554. int j = playerCount;
  2555. if(flag)
  2556. j = 1;
  2557. for(int l = 0; l < j; l++) {
  2558. Player player;
  2559. int i1;
  2560. if(flag) {
  2561. player = myPlayer;
  2562. i1 = myPlayerIndex << 14;
  2563. } else {
  2564. player = playerArray[playerIndices[l]];
  2565. i1 = playerIndices[l] << 14;
  2566. }
  2567. if(player == null || !player.isVisible())
  2568. continue;
  2569. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  2570. int j1 = player.x >> 7;
  2571. int k1 = player.y >> 7;
  2572. if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2573. continue;
  2574. if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  2575. player.aBoolean1699 = false;
  2576. player.anInt1709 = method42(plane, player.y, player.x);
  2577. worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  2578. continue;
  2579. }
  2580. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2581. if(anIntArrayArray929[j1][k1] == anInt1265)
  2582. continue;
  2583. anIntArrayArray929[j1][k1] = anInt1265;
  2584. }
  2585. player.anInt1709 = method42(plane, player.y, player.x);
  2586. worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  2587. }
  2588. }
  2589.  
  2590. private boolean promptUserForInput(RSInterface class9) {
  2591. int j = class9.contentType;
  2592. if(anInt900 == 2) {
  2593. if(j == 201) {
  2594. inputTaken = true;
  2595. inputDialogState = 0;
  2596. messagePromptRaised = true;
  2597. promptInput = "";
  2598. friendsListAction = 1;
  2599. aString1121 = "Enter name of friend to add to list";
  2600. }
  2601. if(j == 202) {
  2602. inputTaken = true;
  2603. inputDialogState = 0;
  2604. messagePromptRaised = true;
  2605. promptInput = "";
  2606. friendsListAction = 2;
  2607. aString1121 = "Enter name of friend to delete from list";
  2608. }
  2609. }
  2610. if(j == 205) {
  2611. anInt1011 = 250;
  2612. return true;
  2613. }
  2614. if(j == 501) {
  2615. inputTaken = true;
  2616. inputDialogState = 0;
  2617. messagePromptRaised = true;
  2618. promptInput = "";
  2619. friendsListAction = 4;
  2620. aString1121 = "Enter name of player to add to list";
  2621. }
  2622. if(j == 502) {
  2623. inputTaken = true;
  2624. inputDialogState = 0;
  2625. messagePromptRaised = true;
  2626. promptInput = "";
  2627. friendsListAction = 5;
  2628. aString1121 = "Enter name of player to delete from list";
  2629. }
  2630. if(j == 550) {
  2631. inputTaken = true;
  2632. inputDialogState = 0;
  2633. messagePromptRaised = true;
  2634. promptInput = "";
  2635. friendsListAction = 6;
  2636. aString1121 = "Enter the name of the chat you wish to join";
  2637. }
  2638. if(j >= 300 && j <= 313) {
  2639. int k = (j - 300) / 2;
  2640. int j1 = j & 1;
  2641. int i2 = anIntArray1065[k];
  2642. if(i2 != -1) {
  2643. do {
  2644. if(j1 == 0 && --i2 < 0)
  2645. i2 = IDK.length - 1;
  2646. if(j1 == 1 && ++i2 >= IDK.length)
  2647. i2 = 0;
  2648. } while(IDK.cache[i2].aBoolean662 || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2649. anIntArray1065[k] = i2;
  2650. aBoolean1031 = true;
  2651. }
  2652. }
  2653. if(j >= 314 && j <= 323) {
  2654. int l = (j - 314) / 2;
  2655. int k1 = j & 1;
  2656. int j2 = anIntArray990[l];
  2657. if(k1 == 0 && --j2 < 0)
  2658. j2 = anIntArrayArray1003[l].length - 1;
  2659. if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2660. j2 = 0;
  2661. anIntArray990[l] = j2;
  2662. aBoolean1031 = true;
  2663. }
  2664. if(j == 324 && !aBoolean1047) {
  2665. aBoolean1047 = true;
  2666. method45();
  2667. }
  2668. if(j == 325 && aBoolean1047) {
  2669. aBoolean1047 = false;
  2670. method45();
  2671. }
  2672. if(j == 326) {
  2673. stream.createFrame(101);
  2674. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2675. for(int i1 = 0; i1 < 7; i1++)
  2676. stream.writeWordBigEndian(anIntArray1065[i1]);
  2677.  
  2678. for(int l1 = 0; l1 < 5; l1++)
  2679. stream.writeWordBigEndian(anIntArray990[l1]);
  2680.  
  2681. return true;
  2682. }
  2683. if(j == 613)
  2684. canMute = !canMute;
  2685. if(j >= 601 && j <= 612) {
  2686. clearTopInterfaces();
  2687. if(reportAbuseInput.length() > 0) {
  2688. stream.createFrame(218);
  2689. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2690. stream.writeWordBigEndian(j - 601);
  2691. stream.writeWordBigEndian(canMute ? 1 : 0);
  2692. }
  2693. }
  2694. return false;
  2695. }
  2696.  
  2697. private void method49(Stream stream) {
  2698. for(int j = 0; j < anInt893; j++) {
  2699. int k = anIntArray894[j];
  2700. Player player = playerArray[k];
  2701. int l = stream.readUnsignedByte();
  2702. if((l & 0x40) != 0)
  2703. l += stream.readUnsignedByte() << 8;
  2704. method107(l, k, stream, player);
  2705. }
  2706. }
  2707.  
  2708. public void method50(int y, int primaryColor, int x, int secondaryColor, int z) {
  2709. int uid = worldController.method300(z, x, y);
  2710. if((uid ^ 0xffffffffffffffffL) != -1L) {
  2711. int resourceTag = worldController.method304(z, x, y, uid);
  2712. int direction = resourceTag >> 6 & 3;//direction
  2713. int type = resourceTag & 0x1f;//type
  2714. int color = primaryColor;//color
  2715. if(uid > 0)
  2716. color = secondaryColor;
  2717. int mapPixels[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2718. int pixel = 24624 + x * 4 + (103 - y) * 512 * 4;
  2719. int objectId = worldController.fetchWallDecorationNewUID(z, x, y);//uid >> 14 & 0x7fff;
  2720. ObjectDef objDef = ObjectDef.forID(objectId);
  2721. if ((objDef.anInt758 ^ 0xffffffff) == 0) {
  2722. if (type == 0 || type == 2)
  2723. if (direction == 0) {
  2724. mapPixels[pixel] = color;
  2725. mapPixels[pixel + 512] = color;
  2726. mapPixels[1024 + pixel] = color;
  2727. mapPixels[1536 + pixel] = color;
  2728. } else if ((direction ^ 0xffffffff) == -2) {
  2729. mapPixels[pixel] = color;
  2730. mapPixels[pixel + 1] = color;
  2731. mapPixels[pixel + 2] = color;
  2732. mapPixels[3 + pixel] = color;
  2733. } else if (direction == 2) {
  2734. mapPixels[pixel - -3] = color;
  2735. mapPixels[3 + (pixel + 512)] = color;
  2736. mapPixels[3 + (pixel + 1024)] = color;
  2737. mapPixels[1536 + (pixel - -3)] = color;
  2738. } else if (direction == 3) {
  2739. mapPixels[pixel + 1536] = color;
  2740. mapPixels[pixel + 1536 + 1] = color;
  2741. mapPixels[2 + pixel + 1536] = color;
  2742. mapPixels[pixel + 1539] = color;
  2743. }
  2744. if(type == 3)
  2745. if(direction == 0)
  2746. mapPixels[pixel] = color;
  2747. else if(direction == 1)
  2748. mapPixels[pixel + 3] = color;
  2749. else if(direction == 2)
  2750. mapPixels[pixel + 3 + 1536] = color;
  2751. else if(direction == 3)
  2752. mapPixels[pixel + 1536] = color;
  2753. if(type == 2)
  2754. if(direction == 3) {
  2755. mapPixels[pixel] = color;
  2756. mapPixels[pixel + 512] = color;
  2757. mapPixels[pixel + 1024] = color;
  2758. mapPixels[pixel + 1536] = color;
  2759. } else if(direction == 0) {
  2760. mapPixels[pixel] = color;
  2761. mapPixels[pixel + 1] = color;
  2762. mapPixels[pixel + 2] = color;
  2763. mapPixels[pixel + 3] = color;
  2764. } else if(direction == 1) {
  2765. mapPixels[pixel + 3] = color;
  2766. mapPixels[pixel + 3 + 512] = color;
  2767. mapPixels[pixel + 3 + 1024] = color;
  2768. mapPixels[pixel + 3 + 1536] = color;
  2769. } else if(direction == 2) {
  2770. mapPixels[pixel + 1536] = color;
  2771. mapPixels[pixel + 1536 + 1] = color;
  2772. mapPixels[pixel + 1536 + 2] = color;
  2773. mapPixels[pixel + 1536 + 3] = color;
  2774. }
  2775. }
  2776. }
  2777. uid = worldController.method302(z, x, y);
  2778. if(uid != 0) {
  2779. int resourceTag = worldController.method304(z, x, y, uid);
  2780. int direction = resourceTag >> 6 & 3;
  2781. int type = resourceTag & 0x1f;
  2782. int objectId = worldController.fetchObjectMeshNewUID(z, x, y);//uid >> 14 & 0x7fff;
  2783. ObjectDef objDef = ObjectDef.forID(objectId);
  2784. if(objDef.anInt758 != -1) {
  2785. Background scene = mapScenes[objDef.anInt758];
  2786. if(scene != null) {
  2787. int sceneX = (objDef.anInt744 * 4 - scene.anInt1452) / 2;
  2788. int sceneY = (objDef.anInt761 * 4 - scene.anInt1453) / 2;
  2789. scene.drawBackground(48 + x * 4 + sceneX, 48 + (104 - y - objDef.anInt761) * 4 + sceneY);
  2790. }
  2791. } else if(type == 9) {
  2792. int color = 0xeeeeee;
  2793. if(uid > 0)
  2794. color = 0xee0000;
  2795. int mapPixels[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2796. int pixel = 24624 + x * 4 + (103 - y) * 512 * 4;
  2797. if(direction == 0 || direction == 2) {
  2798. mapPixels[pixel + 1536] = color;
  2799. mapPixels[pixel + 1024 + 1] = color;
  2800. mapPixels[pixel + 512 + 2] = color;
  2801. mapPixels[pixel + 3] = color;
  2802. } else {
  2803. mapPixels[pixel] = color;
  2804. mapPixels[pixel + 512 + 1] = color;
  2805. mapPixels[pixel + 1024 + 2] = color;
  2806. mapPixels[pixel + 1536 + 3] = color;
  2807. }
  2808. }
  2809. }
  2810. uid = worldController.fetchGroundDecorationNewUID(z, x, y);
  2811. if(uid > 0) {
  2812. ObjectDef objDef = ObjectDef.forID(uid);
  2813. if(objDef.anInt758 != -1) {
  2814. Background scene = mapScenes[objDef.anInt758];
  2815. if(scene != null) {
  2816. int sceneX = (objDef.anInt744 * 4 - scene.anInt1452) / 2;
  2817. int sceneY = (objDef.anInt761 * 4 - scene.anInt1453) / 2;
  2818. scene.drawBackground(48 + x * 4 + sceneX, 48 + (104 - y - objDef.anInt761) * 4 + sceneY);
  2819. }
  2820. }
  2821. }
  2822. }
  2823.  
  2824. private void loadTitleScreen() {
  2825. titleBox = new Background(titleStreamLoader, "titlebox", 0);
  2826. boxHover = new Sprite(titleStreamLoader, "titlebox", 1);
  2827. titleButton = new Background(titleStreamLoader, "titlebutton", 0);
  2828. loginHover = new Sprite(titleStreamLoader, "titlebutton", 1);
  2829. aBackgroundArray1152s = new Background[12];
  2830. int j = 0;
  2831. try {
  2832. j = Integer.parseInt(getParameter("fl_icon"));
  2833. } catch(Exception _ex) {
  2834. }
  2835. if(j == 0) {
  2836. for(int k = 0; k < 12; k++)
  2837. aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  2838.  
  2839. } else {
  2840. for(int l = 0; l < 12; l++)
  2841. aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  2842.  
  2843. }
  2844. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  2845. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  2846. System.arraycopy(aRSImageProducer_1110.pixels, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  2847.  
  2848. System.arraycopy(aRSImageProducer_1111.pixels, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  2849.  
  2850. anIntArray851 = new int[256];
  2851. for(int k1 = 0; k1 < 64; k1++)
  2852. anIntArray851[k1] = k1 * 0x40000;
  2853.  
  2854. for(int l1 = 0; l1 < 64; l1++)
  2855. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  2856.  
  2857. for(int i2 = 0; i2 < 64; i2++)
  2858. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  2859.  
  2860. for(int j2 = 0; j2 < 64; j2++)
  2861. anIntArray851[j2 + 192] = 0xffffff;
  2862.  
  2863. anIntArray852 = new int[256];
  2864. for(int k2 = 0; k2 < 64; k2++)
  2865. anIntArray852[k2] = k2 * 1024;
  2866.  
  2867. for(int l2 = 0; l2 < 64; l2++)
  2868. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  2869.  
  2870. for(int i3 = 0; i3 < 64; i3++)
  2871. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  2872.  
  2873. for(int j3 = 0; j3 < 64; j3++)
  2874. anIntArray852[j3 + 192] = 0xffffff;
  2875.  
  2876. anIntArray853 = new int[256];
  2877. for(int k3 = 0; k3 < 64; k3++)
  2878. anIntArray853[k3] = k3 * 4;
  2879.  
  2880. for(int l3 = 0; l3 < 64; l3++)
  2881. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  2882.  
  2883. for(int i4 = 0; i4 < 64; i4++)
  2884. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  2885.  
  2886. for(int j4 = 0; j4 < 64; j4++)
  2887. anIntArray853[j4 + 192] = 0xffffff;
  2888.  
  2889. anIntArray850 = new int[256];
  2890. anIntArray1190 = new int[32768];
  2891. anIntArray1191 = new int[32768];
  2892. randomizeBackground(null);
  2893. anIntArray828 = new int[32768];
  2894. anIntArray829 = new int[32768];
  2895. drawSmoothLoading(20, "Connecting to fileserver");
  2896. if(!aBoolean831) {
  2897. drawFlames = true;
  2898. aBoolean831 = true;
  2899. startRunnable(this, 2);
  2900. }
  2901. }
  2902.  
  2903. private static void setHighMem() {
  2904. WorldController.lowMem = false;
  2905. Texture.lowMem = false;
  2906. lowMem = false;
  2907. ObjectManager.lowMem = false;
  2908. ObjectDef.lowMem = false;
  2909. }
  2910.  
  2911. public static void main(String args[]) {
  2912. try {
  2913. System.out.println("RS2 user client - release #" + 317);
  2914. if(args.length != 5) {
  2915. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2916. return;
  2917. }
  2918. nodeID = Integer.parseInt(args[0]);
  2919. //portOff = Integer.parseInt(args[1]);
  2920. portOff = 0;
  2921. if(args[2].equals("lowmem"))
  2922. setLowMem();
  2923. else if(args[2].equals("highmem")) {
  2924. setHighMem();
  2925. } else {
  2926. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2927. return;
  2928. }
  2929. if(args[3].equals("free"))
  2930. isMembers = false;
  2931. else if(args[3].equals("members")) {
  2932. isMembers = true;
  2933. } else {
  2934. System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2935. return;
  2936. }
  2937. signlink.storeid = Integer.parseInt(args[4]);
  2938. signlink.startpriv(InetAddress.getLocalHost());
  2939. new Jframe(args);
  2940. //client client1 = new client();
  2941. //client1.createClientFrame(503, 765);
  2942. } catch(Exception exception) {
  2943. }
  2944. }
  2945.  
  2946. private void loadingStages() {
  2947. if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  2948. aRSImageProducer_1165.initDrawingArea();
  2949. loadingPleaseWait.drawSprite(8,9);;
  2950. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  2951. loadingStage = 1;
  2952. aLong824 = System.currentTimeMillis();
  2953. }
  2954. if(loadingStage == 1) {
  2955. int j = method54();
  2956. if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  2957. signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  2958. aLong824 = System.currentTimeMillis();
  2959. }
  2960. }
  2961. if(loadingStage == 2 && plane != anInt985) {
  2962. anInt985 = plane;
  2963. method24(plane);
  2964. }
  2965. }
  2966.  
  2967. private int method54() {
  2968. for(int i = 0; i < aByteArrayArray1183.length; i++) {
  2969. if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  2970. return -1;
  2971. if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  2972. return -2;
  2973. }
  2974. boolean flag = true;
  2975. try {
  2976. for(int j = 0; j < aByteArrayArray1183.length; j++) {
  2977. byte abyte0[] = aByteArrayArray1247[j];
  2978. if(abyte0 != null) {
  2979. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  2980. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  2981. if(aBoolean1159) {
  2982. k = 10;
  2983. l = 10;
  2984. }
  2985. flag &= ObjectManager.method189(k, abyte0, l);
  2986. }
  2987. }
  2988. } catch (Exception e) {
  2989. e.printStackTrace();
  2990. }
  2991. if(!flag)
  2992. return -3;
  2993. if(aBoolean1080) {
  2994. return -4;
  2995. } else {
  2996. loadingStage = 2;
  2997. ObjectManager.anInt131 = plane;
  2998. method22();
  2999. stream.createFrame(121);
  3000. return 0;
  3001. }
  3002. }
  3003.  
  3004. private void method55()
  3005. {
  3006. 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())
  3007. if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3008. class30_sub2_sub4_sub4.unlink();
  3009. else
  3010. if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  3011. {
  3012. if(class30_sub2_sub4_sub4.anInt1590 > 0)
  3013. {
  3014. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3015. if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  3016. 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);
  3017. }
  3018. if(class30_sub2_sub4_sub4.anInt1590 < 0)
  3019. {
  3020. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3021. Player player;
  3022. if(j == unknownInt10)
  3023. player = myPlayer;
  3024. else
  3025. player = playerArray[j];
  3026. if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  3027. 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);
  3028. }
  3029. class30_sub2_sub4_sub4.method456(anInt945);
  3030. 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);
  3031. }
  3032.  
  3033. }
  3034.  
  3035. public AppletContext getAppletContext()
  3036. {
  3037. if(signlink.mainapp != null)
  3038. return signlink.mainapp.getAppletContext();
  3039. else
  3040. return super.getAppletContext();
  3041. }
  3042.  
  3043. private void drawLogo() {
  3044. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  3045. Sprite sprite = new Sprite(abyte0, this);
  3046. aRSImageProducer_1110.initDrawingArea();
  3047. sprite.method346(0, 0);
  3048. aRSImageProducer_1111.initDrawingArea();
  3049. sprite.method346(-637, 0);
  3050. aRSImageProducer_1107.initDrawingArea();
  3051. sprite.method346(-128, 0);
  3052. aRSImageProducer_1108.initDrawingArea();
  3053. sprite.method346(-202, -371);
  3054. aRSImageProducer_1109.initDrawingArea();
  3055. sprite.method346(0, 0);
  3056. aRSImageProducer_1112.initDrawingArea();
  3057. sprite.method346(0, -265);
  3058. aRSImageProducer_1113.initDrawingArea();
  3059. sprite.method346(-562, -265);
  3060. aRSImageProducer_1114.initDrawingArea();
  3061. sprite.method346(-128, -171);
  3062. aRSImageProducer_1115.initDrawingArea();
  3063. sprite.method346(-562, -171);
  3064.  
  3065. int backgroundPixels[] = new int[sprite.myWidth];
  3066. for (int j = 0; j < sprite.myHeight; j++) {
  3067. for (int k = 0; k < sprite.myWidth; k++)
  3068. backgroundPixels[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  3069.  
  3070. System.arraycopy(backgroundPixels, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  3071.  
  3072. }
  3073. sprite = null;
  3074. Object obj = null;
  3075. Object obj1 = null;
  3076. System.gc();
  3077. }
  3078.  
  3079. private void processOnDemandQueue()
  3080. {
  3081. do
  3082. {
  3083. OnDemandData onDemandData;
  3084. do
  3085. {
  3086. onDemandData = onDemandFetcher.getNextNode();
  3087. if(onDemandData == null)
  3088. return;
  3089. if(onDemandData.dataType == 0)
  3090. {
  3091. Model.method460(onDemandData.buffer, onDemandData.ID);
  3092. needDrawTabArea = true;
  3093. if(backDialogID != -1)
  3094. inputTaken = true;
  3095. }
  3096. if(onDemandData.dataType == 1) {
  3097. Class36.load(onDemandData.ID, onDemandData.buffer);
  3098. }
  3099. if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  3100. saveMidi(songChanging, onDemandData.buffer);
  3101. if(onDemandData.dataType == 3 && loadingStage == 1)
  3102. {
  3103. for(int i = 0; i < aByteArrayArray1183.length; i++)
  3104. {
  3105. if(anIntArray1235[i] == onDemandData.ID)
  3106. {
  3107. aByteArrayArray1183[i] = onDemandData.buffer;
  3108. if(onDemandData.buffer == null)
  3109. anIntArray1235[i] = -1;
  3110. break;
  3111. }
  3112. if(anIntArray1236[i] != onDemandData.ID)
  3113. continue;
  3114. aByteArrayArray1247[i] = onDemandData.buffer;
  3115. if(onDemandData.buffer == null)
  3116. anIntArray1236[i] = -1;
  3117. break;
  3118. }
  3119.  
  3120. }
  3121. } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  3122. ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  3123. } while(true);
  3124. }
  3125.  
  3126. private void calcFlamesPosition()
  3127. {
  3128. char c = '\u0100';
  3129. for(int j = 10; j < 117; j++)
  3130. {
  3131. int k = (int)(Math.random() * 100D);
  3132. if(k < 50)
  3133. anIntArray828[j + (c - 2 << 7)] = 255;
  3134. }
  3135. for(int l = 0; l < 100; l++)
  3136. {
  3137. int i1 = (int)(Math.random() * 124D) + 2;
  3138. int k1 = (int)(Math.random() * 128D) + 128;
  3139. int k2 = i1 + (k1 << 7);
  3140. anIntArray828[k2] = 192;
  3141. }
  3142.  
  3143. for(int j1 = 1; j1 < c - 1; j1++)
  3144. {
  3145. for(int l1 = 1; l1 < 127; l1++)
  3146. {
  3147. int l2 = l1 + (j1 << 7);
  3148. anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  3149. }
  3150.  
  3151. }
  3152.  
  3153. anInt1275 += 128;
  3154. if(anInt1275 > anIntArray1190.length)
  3155. {
  3156. anInt1275 -= anIntArray1190.length;
  3157. int i2 = (int)(Math.random() * 12D);
  3158. randomizeBackground(aBackgroundArray1152s[i2]);
  3159. }
  3160. for(int j2 = 1; j2 < c - 1; j2++)
  3161. {
  3162. for(int i3 = 1; i3 < 127; i3++)
  3163. {
  3164. int k3 = i3 + (j2 << 7);
  3165. int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  3166. if(i4 < 0)
  3167. i4 = 0;
  3168. anIntArray828[k3] = i4;
  3169. }
  3170.  
  3171. }
  3172.  
  3173. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  3174.  
  3175. anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
  3176. if(anInt1040 > 0)
  3177. anInt1040 -= 4;
  3178. if(anInt1041 > 0)
  3179. anInt1041 -= 4;
  3180. if(anInt1040 == 0 && anInt1041 == 0)
  3181. {
  3182. int l3 = (int)(Math.random() * 2000D);
  3183. if(l3 == 0)
  3184. anInt1040 = 1024;
  3185. if(l3 == 1)
  3186. anInt1041 = 1024;
  3187. }
  3188. }
  3189.  
  3190. private boolean saveWave(byte abyte0[], int i)
  3191. {
  3192. return abyte0 == null || signlink.wavesave(abyte0, i);
  3193. }
  3194.  
  3195. private void method60(int i)
  3196. {
  3197. RSInterface class9 = RSInterface.interfaceCache[i];
  3198. for(int j = 0; j < class9.children.length; j++)
  3199. {
  3200. if(class9.children[j] == -1)
  3201. break;
  3202. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  3203. if(class9_1.type == 1)
  3204. method60(class9_1.id);
  3205. class9_1.anInt246 = 0;
  3206. class9_1.anInt208 = 0;
  3207. }
  3208. }
  3209.  
  3210. private void drawHeadIcon()
  3211. {
  3212. if(anInt855 != 2)
  3213. return;
  3214. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  3215. if(spriteDrawX > -1 && loopCycle % 20 < 10)
  3216. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  3217. }
  3218.  
  3219. public int canWalkDelay = 0;
  3220. public int getDis(int coordX1, int coordY1, int coordX2, int coordY2)
  3221. {
  3222. int deltaX = coordX2 - coordX1;
  3223. int deltaY = coordY2 - coordY1;
  3224. return ((int)Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2)));
  3225. }
  3226. public int random(int range)
  3227. {
  3228. return (int)(Math.random() * range);
  3229. }
  3230. public boolean withinDistance(int x1, int y1, int x2, int y2, int dis)
  3231. {
  3232. for (int i = 0; i <= dis; i++)
  3233. {
  3234. try{
  3235. if ((x1 + i) == x2 && ((y1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  3236. return true;
  3237. else
  3238. if ((x1 - i) == x2 && ((x1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  3239. return true;
  3240. else
  3241. if (x1 == x2 && ((x1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  3242. return true;
  3243. } catch(Exception ex){
  3244. System.out.println("Exception in following, method : WithingDistance");
  3245. }
  3246. }
  3247. return false;
  3248. }
  3249.  
  3250. private void mainGameProcessor()
  3251. {
  3252. if(anInt1104 > 1)
  3253. anInt1104--;
  3254. if(anInt1011 > 0)
  3255. anInt1011--;
  3256. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3257. if (anInt1501 < 100) {
  3258. anInt1501++;
  3259. if (anInt1501 == 100) {
  3260. if (anInt1500 != 0) {
  3261. inputTaken = true;
  3262. }
  3263. if (anInt1044 != 0) {
  3264. needDrawTabArea = true;
  3265. }
  3266. }
  3267. }
  3268. } else if (anInt1501 > 0) {
  3269. anInt1501--;
  3270. }
  3271. for(int j = 0; j < 5; j++)
  3272. if(!parsePacket())
  3273. break;
  3274. if(!loggedIn)
  3275. return;
  3276. try{
  3277. canWalkDelay--;
  3278. if (followNPC > 0)
  3279. {
  3280. NPC n = npcArray[followNPC];
  3281. if (n != null)
  3282. {
  3283. if (!withinDistance(myPlayer.smallX[0], myPlayer.smallY[0], n.smallX[0], n.smallY[0], followDistance))
  3284. {
  3285. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, n.smallY[0], myPlayer.smallX[0], false, n.smallX[0]);
  3286. }
  3287. }
  3288. }
  3289. else if (followPlayer > 0 && canWalkDelay <= 0)
  3290. {
  3291. Player p = playerArray[followPlayer];
  3292. if (p != null)
  3293. {
  3294. int dis = getDis(myPlayer.smallX[0], myPlayer.smallY[0], p.smallX[0], p.smallY[0]);
  3295. if (dis > followDistance)
  3296. {
  3297. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], followDistance, 0, p.smallY[0], myPlayer.smallX[0], false, p.smallX[0]);
  3298. canWalkDelay = 30;
  3299. }
  3300. else if (dis == 0)
  3301. {
  3302. int rnd = random(4);
  3303. if (rnd == 0)
  3304. {
  3305. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0], myPlayer.smallX[0], false, p.smallX[0] - 2);
  3306. }
  3307. else if (rnd == 1)
  3308. {
  3309. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0], myPlayer.smallX[0], false, p.smallX[0] + 2);
  3310. }
  3311. else if (rnd == 2)
  3312. {
  3313. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0] - 2, myPlayer.smallX[0], false, p.smallX[0]);
  3314. }
  3315. else if (rnd == 3)
  3316. {
  3317. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0] + 2, myPlayer.smallX[0], false, p.smallX[0]);
  3318. }
  3319. canWalkDelay = 60;
  3320. }
  3321. }
  3322. }
  3323. } catch(Exception ex){
  3324. System.out.println("Exception in following, method : in process.)");
  3325. }
  3326. synchronized(mouseDetection.syncObject)
  3327. {
  3328. if(flagged)
  3329. {
  3330. if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
  3331. {
  3332. stream.createFrame(45);
  3333. stream.writeWordBigEndian(0);
  3334. int j2 = stream.currentOffset;
  3335. int j3 = 0;
  3336. for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
  3337. {
  3338. if(j2 - stream.currentOffset >= 240)
  3339. break;
  3340. j3++;
  3341. int l4 = mouseDetection.coordsY[j4];
  3342. if(l4 < 0)
  3343. l4 = 0;
  3344. else
  3345. if(l4 > 502)
  3346. l4 = 502;
  3347. int k5 = mouseDetection.coordsX[j4];
  3348. if(k5 < 0)
  3349. k5 = 0;
  3350. else
  3351. if(k5 > 764)
  3352. k5 = 764;
  3353. int i6 = l4 * 765 + k5;
  3354. if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  3355. {
  3356. k5 = -1;
  3357. l4 = -1;
  3358. i6 = 0x7ffff;
  3359. }
  3360. if(k5 == anInt1237 && l4 == anInt1238)
  3361. {
  3362. if(anInt1022 < 2047)
  3363. anInt1022++;
  3364. } else
  3365. {
  3366. int j6 = k5 - anInt1237;
  3367. anInt1237 = k5;
  3368. int k6 = l4 - anInt1238;
  3369. anInt1238 = l4;
  3370. if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  3371. {
  3372. j6 += 32;
  3373. k6 += 32;
  3374. stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  3375. anInt1022 = 0;
  3376. } else
  3377. if(anInt1022 < 8)
  3378. {
  3379. stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  3380. anInt1022 = 0;
  3381. } else
  3382. {
  3383. stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  3384. anInt1022 = 0;
  3385. }
  3386. }
  3387. }
  3388.  
  3389. stream.writeBytes(stream.currentOffset - j2);
  3390. if(j3 >= mouseDetection.coordsIndex)
  3391. {
  3392. mouseDetection.coordsIndex = 0;
  3393. } else
  3394. {
  3395. mouseDetection.coordsIndex -= j3;
  3396. for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  3397. {
  3398. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  3399. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  3400. }
  3401.  
  3402. }
  3403. }
  3404. } else
  3405. {
  3406. mouseDetection.coordsIndex = 0;
  3407. }
  3408. }
  3409. if(super.clickMode3 != 0)
  3410. {
  3411. long l = (super.aLong29 - aLong1220) / 50L;
  3412. if(l > 4095L)
  3413. l = 4095L;
  3414. aLong1220 = super.aLong29;
  3415. int k2 = super.saveClickY;
  3416. if(k2 < 0)
  3417. k2 = 0;
  3418. else
  3419. if(k2 > 502)
  3420. k2 = 502;
  3421. int k3 = super.saveClickX;
  3422. if(k3 < 0)
  3423. k3 = 0;
  3424. else
  3425. if(k3 > 764)
  3426. k3 = 764;
  3427. int k4 = k2 * 765 + k3;
  3428. int j5 = 0;
  3429. if(super.clickMode3 == 2)
  3430. j5 = 1;
  3431. int l5 = (int)l;
  3432. stream.createFrame(241);
  3433. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3434. }
  3435. if(anInt1016 > 0)
  3436. anInt1016--;
  3437. if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3438. aBoolean1017 = true;
  3439. if(aBoolean1017 && anInt1016 <= 0)
  3440. {
  3441. anInt1016 = 20;
  3442. aBoolean1017 = false;
  3443. stream.createFrame(86);
  3444. stream.writeWord(anInt1184);
  3445. stream.method432(minimapInt1);
  3446. }
  3447. if(super.awtFocus && !aBoolean954)
  3448. {
  3449. aBoolean954 = true;
  3450. stream.createFrame(3);
  3451. stream.writeWordBigEndian(1);
  3452. }
  3453. if(!super.awtFocus && aBoolean954)
  3454. {
  3455. aBoolean954 = false;
  3456. stream.createFrame(3);
  3457. stream.writeWordBigEndian(0);
  3458. }
  3459. loadingStages();
  3460. method115();
  3461. method90();
  3462. anInt1009++;
  3463. if(anInt1009 > 750)
  3464. dropClient();
  3465. method114();
  3466. method95();
  3467. method38();
  3468. anInt945++;
  3469. if(crossType != 0)
  3470. {
  3471. crossIndex += 20;
  3472. if(crossIndex >= 400)
  3473. crossType = 0;
  3474. }
  3475. if(atInventoryInterfaceType != 0)
  3476. {
  3477. atInventoryLoopCycle++;
  3478. if(atInventoryLoopCycle >= 15)
  3479. {
  3480. if(atInventoryInterfaceType == 2)
  3481. needDrawTabArea = true;
  3482. if(atInventoryInterfaceType == 3)
  3483. inputTaken = true;
  3484. atInventoryInterfaceType = 0;
  3485. }
  3486. }
  3487. if(activeInterfaceType != 0)
  3488. {
  3489. anInt989++;
  3490. if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  3491. aBoolean1242 = true;
  3492. if(super.clickMode2 == 0)
  3493. {
  3494. if(activeInterfaceType == 2)
  3495. needDrawTabArea = true;
  3496. if(activeInterfaceType == 3)
  3497. inputTaken = true;
  3498. activeInterfaceType = 0;
  3499. if(aBoolean1242 && anInt989 >= 10)
  3500. {
  3501. lastActiveInvInterface = -1;
  3502. processRightClick();
  3503. if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  3504. {
  3505. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3506. int j1 = 0;
  3507. if(anInt913 == 1 && class9.contentType == 206)
  3508. j1 = 1;
  3509. if(class9.inv[mouseInvInterfaceIndex] <= 0)
  3510. j1 = 0;
  3511. if(class9.aBoolean235)
  3512. {
  3513. int l2 = anInt1085;
  3514. int l3 = mouseInvInterfaceIndex;
  3515. class9.inv[l3] = class9.inv[l2];
  3516. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3517. class9.inv[l2] = -1;
  3518. class9.invStackSizes[l2] = 0;
  3519. } else
  3520. if(j1 == 1)
  3521. {
  3522. int i3 = anInt1085;
  3523. for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3524. if(i3 > i4)
  3525. {
  3526. class9.swapInventoryItems(i3, i3 - 1);
  3527. i3--;
  3528. } else
  3529. if(i3 < i4)
  3530. {
  3531. class9.swapInventoryItems(i3, i3 + 1);
  3532. i3++;
  3533. }
  3534.  
  3535. } else
  3536. {
  3537. class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  3538. }
  3539. stream.createFrame(214);
  3540. stream.method433(anInt1084);
  3541. stream.method424(j1);
  3542. stream.method433(anInt1085);
  3543. stream.method431(mouseInvInterfaceIndex);
  3544. }
  3545. } else
  3546. if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  3547. determineMenuSize();
  3548. else
  3549. if(menuActionRow > 0)
  3550. doAction(menuActionRow - 1);
  3551. atInventoryLoopCycle = 10;
  3552. super.clickMode3 = 0;
  3553. }
  3554. }
  3555. if(WorldController.anInt470 != -1)
  3556. {
  3557. int k = WorldController.anInt470;
  3558. int k1 = WorldController.anInt471;
  3559. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  3560. WorldController.anInt470 = -1;
  3561. if(flag)
  3562. {
  3563. crossX = super.saveClickX;
  3564. crossY = super.saveClickY;
  3565. crossType = 1;
  3566. crossIndex = 0;
  3567. }
  3568. }
  3569. if(super.clickMode3 == 1 && aString844 != null)
  3570. {
  3571. aString844 = null;
  3572. inputTaken = true;
  3573. super.clickMode3 = 0;
  3574. }
  3575. if(!processMenuClick()) {
  3576. processMainScreenClick();
  3577. processTabClick();
  3578. processChatModeClick();
  3579. }
  3580. if(super.clickMode2 == 1 || super.clickMode3 == 1)
  3581. anInt1213++;
  3582. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3583. if (anInt1501 < 100) {
  3584. anInt1501++;
  3585. if (anInt1501 == 100) {
  3586. if (anInt1500 != 0) {
  3587. inputTaken = true;
  3588. }
  3589. if (anInt1044 != 0) {
  3590. needDrawTabArea = true;
  3591. }
  3592. }
  3593. }
  3594. } else if (anInt1501 > 0) {
  3595. anInt1501--;
  3596. }
  3597. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3598. if (anInt1501 < 50) {
  3599. anInt1501++;
  3600. if (anInt1501 == 50) {
  3601. if (anInt1500 != 0) {
  3602. inputTaken = true;
  3603. }
  3604. if (anInt1044 != 0) {
  3605. needDrawTabArea = true;
  3606. }
  3607. }
  3608. }
  3609. } else if (anInt1501 > 0) {
  3610. anInt1501--;
  3611. }
  3612. if(loadingStage == 2)
  3613. method108();
  3614. if(loadingStage == 2 && aBoolean1160)
  3615. calcCameraPos();
  3616. for(int i1 = 0; i1 < 5; i1++)
  3617. anIntArray1030[i1]++;
  3618.  
  3619. method73();
  3620. super.idleTime++;
  3621. if(super.idleTime > 4500)
  3622. {
  3623. anInt1011 = 250;
  3624. super.idleTime -= 500;
  3625. stream.createFrame(202);
  3626. }
  3627. anInt988++;
  3628. if(anInt988 > 500)
  3629. {
  3630. anInt988 = 0;
  3631. int l1 = (int)(Math.random() * 8D);
  3632. if((l1 & 1) == 1)
  3633. anInt1278 += anInt1279;
  3634. if((l1 & 2) == 2)
  3635. anInt1131 += anInt1132;
  3636. if((l1 & 4) == 4)
  3637. anInt896 += anInt897;
  3638. }
  3639. if(anInt1278 < -50)
  3640. anInt1279 = 2;
  3641. if(anInt1278 > 50)
  3642. anInt1279 = -2;
  3643. if(anInt1131 < -55)
  3644. anInt1132 = 2;
  3645. if(anInt1131 > 55)
  3646. anInt1132 = -2;
  3647. if(anInt896 < -40)
  3648. anInt897 = 1;
  3649. if(anInt896 > 40)
  3650. anInt897 = -1;
  3651. anInt1254++;
  3652. if(anInt1254 > 500)
  3653. {
  3654. anInt1254 = 0;
  3655. int i2 = (int)(Math.random() * 8D);
  3656. if((i2 & 1) == 1)
  3657. minimapInt2 += anInt1210;
  3658. if((i2 & 2) == 2)
  3659. minimapInt3 += anInt1171;
  3660. }
  3661. if(minimapInt2 < -60)
  3662. anInt1210 = 2;
  3663. if(minimapInt2 > 60)
  3664. anInt1210 = -2;
  3665. if(minimapInt3 < -20)
  3666. anInt1171 = 1;
  3667. if(minimapInt3 > 10)
  3668. anInt1171 = -1;
  3669. anInt1010++;
  3670. if(anInt1010 > 50)
  3671. stream.createFrame(0);
  3672. try
  3673. {
  3674. if(socketStream != null && stream.currentOffset > 0)
  3675. {
  3676. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3677. stream.currentOffset = 0;
  3678. anInt1010 = 0;
  3679. }
  3680. }
  3681. catch(IOException _ex)
  3682. {
  3683. dropClient();
  3684. }
  3685. catch(Exception exception)
  3686. {
  3687. resetLogout();
  3688. }
  3689. }
  3690.  
  3691. private void method63()
  3692. {
  3693. Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  3694. for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  3695. if(class30_sub1.anInt1294 == -1)
  3696. {
  3697. class30_sub1.anInt1302 = 0;
  3698. method89(class30_sub1);
  3699. } else
  3700. {
  3701. class30_sub1.unlink();
  3702. }
  3703.  
  3704. }
  3705.  
  3706. public void resetImageProducers()
  3707. {
  3708. if(aRSImageProducer_1107 != null)
  3709. return;
  3710. super.fullGameScreen = null;
  3711. aRSImageProducer_1166 = null;
  3712. aRSImageProducer_1164 = null;
  3713. aRSImageProducer_1163 = null;
  3714. aRSImageProducer_1165 = null;
  3715. aRSImageProducer_1123 = null;
  3716. aRSImageProducer_1124 = null;
  3717. aRSImageProducer_1125 = null;
  3718. aRSImageProducer_1110 = constructGraphicsBuffer(128, 265, getGameComponent());
  3719. DrawingArea.setAllPixelsToZero();
  3720. aRSImageProducer_1111 = constructGraphicsBuffer(128, 265, getGameComponent());
  3721. DrawingArea.setAllPixelsToZero();
  3722. aRSImageProducer_1107 = constructGraphicsBuffer(509, 171, getGameComponent());
  3723. DrawingArea.setAllPixelsToZero();
  3724. aRSImageProducer_1108 = constructGraphicsBuffer(360, 132, getGameComponent());
  3725. DrawingArea.setAllPixelsToZero();
  3726. aRSImageProducer_1109 = constructGraphicsBuffer(765, 503, getGameComponent());
  3727. DrawingArea.setAllPixelsToZero();
  3728. aRSImageProducer_1112 = constructGraphicsBuffer(202, 238, getGameComponent());
  3729. DrawingArea.setAllPixelsToZero();
  3730. aRSImageProducer_1113 = constructGraphicsBuffer(203, 238, getGameComponent());
  3731. DrawingArea.setAllPixelsToZero();
  3732. aRSImageProducer_1114 = constructGraphicsBuffer(74, 94, getGameComponent());
  3733. DrawingArea.setAllPixelsToZero();
  3734. aRSImageProducer_1115 = constructGraphicsBuffer(75, 94, getGameComponent());
  3735. DrawingArea.setAllPixelsToZero();
  3736. if(titleStreamLoader != null)
  3737. {
  3738. drawLogo();
  3739. loadTitleScreen();
  3740. }
  3741. welcomeScreenRaised = true;
  3742. }
  3743.  
  3744. public void drawSmoothLoading(int i, String s) {
  3745. for(float f = LP; f < (float)i; f = (float)((double)f + 0.29999999999999999D))
  3746. drawLoadingText((int)f, s);
  3747. LP = i;
  3748. }
  3749.  
  3750. void drawLoadingText(int i, String s) {
  3751. anInt1079 = i;
  3752. aString1049 = s;
  3753. resetImageProducers();
  3754. if(titleStreamLoader == null) {
  3755. super.drawLoadingText(i, s);
  3756. return;
  3757. }
  3758. aRSImageProducer_1109.initDrawingArea();
  3759. loadingBarEmpty = new Sprite("Configuration/empty");
  3760. loadingBarFull = new Sprite("Configuration/Full");
  3761. char c = '\u0168';
  3762. char c1 = '\310';
  3763. byte byte1 = 20;
  3764. int j = c1 / 2 - 18 - byte1;
  3765. loadingBarEmpty.drawSprite(205, 9);
  3766. loadingBarFull.drawSprite(287, 35);
  3767. DrawingArea.drawPixels(10, 35, (287 + i), 0x302e2c, (194 - i));
  3768. if (i == 194) {
  3769. smallText.drawText(0xffffff, s + " - 100%", 28, 387);
  3770. } else {
  3771. smallText.drawText(0xffffff, s + " - " + (i/2) + "%", 28, 387);
  3772. }
  3773. aRSImageProducer_1109.drawGraphics(0, super.graphics, 0);
  3774. if(welcomeScreenRaised) {
  3775. welcomeScreenRaised = false;
  3776. }
  3777. }
  3778.  
  3779. private void resetImage() {
  3780. DrawingArea.setAllPixelsToZero();
  3781. }
  3782.  
  3783. private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag,
  3784. int j1)
  3785. {
  3786. int anInt992;
  3787. if(aBoolean972)
  3788. anInt992 = 32;
  3789. else
  3790. anInt992 = 0;
  3791. aBoolean972 = false;
  3792. if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  3793. {
  3794. class9.scrollPosition -= anInt1213 * 4;
  3795. if(flag)
  3796. {
  3797. needDrawTabArea = true;
  3798. }
  3799. } else
  3800. if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  3801. {
  3802. class9.scrollPosition += anInt1213 * 4;
  3803. if(flag)
  3804. {
  3805. needDrawTabArea = true;
  3806. }
  3807. } else
  3808. if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  3809. {
  3810. int l1 = ((j - 32) * j) / j1;
  3811. if(l1 < 8)
  3812. l1 = 8;
  3813. int i2 = l - i1 - 16 - l1 / 2;
  3814. int j2 = j - 32 - l1;
  3815. class9.scrollPosition = ((j1 - j) * i2) / j2;
  3816. if(flag)
  3817. needDrawTabArea = true;
  3818. aBoolean972 = true;
  3819. }
  3820. }
  3821.  
  3822. private boolean method66(int i, int j, int k, int id) {
  3823. int j1 = worldController.method304(plane, k, j, i);
  3824. if(i == -1)
  3825. return false;
  3826. int k1 = j1 & 0x1f;
  3827. int l1 = j1 >> 6 & 3;
  3828. if(k1 == 10 || k1 == 11 || k1 == 22) {
  3829. ObjectDef class46 = ObjectDef.forID(id);
  3830. int i2;
  3831. int j2;
  3832. if(l1 == 0 || l1 == 2) {
  3833. i2 = class46.anInt744;
  3834. j2 = class46.anInt761;
  3835. } else {
  3836. i2 = class46.anInt761;
  3837. j2 = class46.anInt744;
  3838. }
  3839. int k2 = class46.anInt768;
  3840. if(l1 != 0)
  3841. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3842. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3843. } else {
  3844. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3845. }
  3846. crossX = super.saveClickX;
  3847. crossY = super.saveClickY;
  3848. crossType = 2;
  3849. crossIndex = 0;
  3850. return true;
  3851. }
  3852.  
  3853. private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k)
  3854. {
  3855. byte abyte0[] = null;
  3856. int l = 5;
  3857. try
  3858. {
  3859. if(decompressors[0] != null)
  3860. abyte0 = decompressors[0].decompress(i);
  3861. }
  3862. catch(Exception _ex) { }
  3863. if(abyte0 != null)
  3864. {
  3865. // aCRC32_930.reset();
  3866. // aCRC32_930.update(abyte0);
  3867. // int i1 = (int)aCRC32_930.getValue();
  3868. // if(i1 != j)
  3869. }
  3870. if(abyte0 != null)
  3871. {
  3872. StreamLoader streamLoader = new StreamLoader(abyte0);
  3873. return streamLoader;
  3874. }
  3875. int j1 = 0;
  3876. while(abyte0 == null)
  3877. {
  3878. String s2 = "Unknown error";
  3879. drawLoadingText(k, "Requesting " + s);
  3880. Object obj = null;
  3881. try
  3882. {
  3883. int k1 = 0;
  3884. DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3885. byte abyte1[] = new byte[6];
  3886. datainputstream.readFully(abyte1, 0, 6);
  3887. Stream stream = new Stream(abyte1);
  3888. stream.currentOffset = 3;
  3889. int i2 = stream.read3Bytes() + 6;
  3890. int j2 = 6;
  3891. abyte0 = new byte[i2];
  3892. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3893.  
  3894. while(j2 < i2)
  3895. {
  3896. int l2 = i2 - j2;
  3897. if(l2 > 1000)
  3898. l2 = 1000;
  3899. int j3 = datainputstream.read(abyte0, j2, l2);
  3900. if(j3 < 0)
  3901. {
  3902. s2 = "Length error: " + j2 + "/" + i2;
  3903. throw new IOException("EOF");
  3904. }
  3905. j2 += j3;
  3906. int k3 = (j2 * 100) / i2;
  3907. if(k3 != k1)
  3908. drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3909. k1 = k3;
  3910. }
  3911. datainputstream.close();
  3912. try
  3913. {
  3914. if(decompressors[0] != null)
  3915. decompressors[0].method234(abyte0.length, abyte0, i);
  3916. }
  3917. catch(Exception _ex)
  3918. {
  3919. decompressors[0] = null;
  3920. }
  3921. /* if(abyte0 != null)
  3922. {
  3923. aCRC32_930.reset();
  3924. aCRC32_930.update(abyte0);
  3925. int i3 = (int)aCRC32_930.getValue();
  3926. if(i3 != j)
  3927. {
  3928. abyte0 = null;
  3929. j1++;
  3930. s2 = "Checksum error: " + i3;
  3931. }
  3932. }
  3933. */
  3934. }
  3935. catch(IOException ioexception)
  3936. {
  3937. if(s2.equals("Unknown error"))
  3938. s2 = "Connection error";
  3939. abyte0 = null;
  3940. }
  3941. catch(NullPointerException _ex)
  3942. {
  3943. s2 = "Null error";
  3944. abyte0 = null;
  3945. if(!signlink.reporterror)
  3946. return null;
  3947. }
  3948. catch(ArrayIndexOutOfBoundsException _ex)
  3949. {
  3950. s2 = "Bounds error";
  3951. abyte0 = null;
  3952. if(!signlink.reporterror)
  3953. return null;
  3954. }
  3955. catch(Exception _ex)
  3956. {
  3957. s2 = "Unexpected error";
  3958. abyte0 = null;
  3959. if(!signlink.reporterror)
  3960. return null;
  3961. }
  3962. if(abyte0 == null)
  3963. {
  3964. for(int l1 = l; l1 > 0; l1--)
  3965. {
  3966. if(j1 >= 3)
  3967. {
  3968. drawLoadingText(k, "Game updated - please reload page");
  3969. l1 = 10;
  3970. } else
  3971. {
  3972. drawLoadingText(k, s2 + " - Retrying in " + l1);
  3973. }
  3974. try
  3975. {
  3976. Thread.sleep(1000L);
  3977. }
  3978. catch(Exception _ex) { }
  3979. }
  3980.  
  3981. l *= 2;
  3982. if(l > 60)
  3983. l = 60;
  3984. aBoolean872 = !aBoolean872;
  3985. }
  3986.  
  3987. }
  3988.  
  3989. StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  3990. return streamLoader_1;
  3991. }
  3992.  
  3993. private void dropClient() {
  3994. if(anInt1011 > 0) {
  3995. resetLogout();
  3996. return;
  3997. }
  3998. aRSImageProducer_1165.initDrawingArea();
  3999. reestablish.drawSprite(8,9);
  4000. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  4001. anInt1021 = 0;
  4002. destX = 0;
  4003. RSSocket rsSocket = socketStream;
  4004. loggedIn = false;
  4005. loginFailures = 0;
  4006. login(myUsername, myPassword, true);
  4007. if(!loggedIn)
  4008. resetLogout();
  4009. try {
  4010. rsSocket.close();
  4011. }
  4012. catch(Exception _ex) {
  4013. }
  4014. }
  4015.  
  4016. private void processMinimapActions() {
  4017. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 95 && super.mouseY < 128){
  4018. if(!runClicked){
  4019. menuActionName[2] = "Toggle Run-Mode On";
  4020. } else if(runClicked){
  4021. menuActionName[2] = "Toggle Run-Mode Off";
  4022. }
  4023. menuActionID[2] = 1050;
  4024. menuActionRow = 2;
  4025. menuActionName[1] = "Rest";
  4026. menuActionID[1] = 1501;
  4027. menuActionRow = 3;
  4028. }
  4029. if(super.mouseX >= 516 && super.mouseX <= 550 && super.mouseY >= 46 && super.mouseY < 80){
  4030. menuActionName[2] = "Toggle XP Total";
  4031. menuActionID[2] = 1503;
  4032. menuActionRow = 2;
  4033. menuActionName[1] = "Reset XP Total";
  4034. menuActionID[1] = 1504;
  4035. menuActionRow = 3;
  4036. }
  4037. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 52 && super.mouseY < 87){
  4038. if(!prayClicked){
  4039. menuActionName[2] = "Toggle Quick-Prayers on";
  4040. } else if(prayClicked){
  4041. menuActionName[2] = "Toggle Quick-Prayers off";
  4042. }
  4043. menuActionID[2] = 1500;
  4044. menuActionRow = 2;
  4045. menuActionName[1] = "Select Quick-Prayers";
  4046. menuActionID[1] = 1506;
  4047. menuActionRow = 3;
  4048. }
  4049. if(super.mouseX >= 706 && super.mouseX <= 762 && super.mouseY >= 52 && super.mouseY < 87){
  4050. menuActionName[1] = "Toggle Quick-Prayers";
  4051. menuActionID[1] = 1500;
  4052. menuActionRow = 2;
  4053. }
  4054. }
  4055.  
  4056. private void doAction(int i)
  4057. {
  4058. if(i < 0)
  4059. return;
  4060. if(inputDialogState != 0)
  4061. {
  4062. inputDialogState = 0;
  4063. inputTaken = true;
  4064. }
  4065. int j = menuActionCmd2[i];
  4066. int k = menuActionCmd3[i];
  4067. int cmd4 = menuActionCmd4[i];
  4068. int l = menuActionID[i];
  4069. int i1 = menuActionCmd1[i];
  4070. int x = j;
  4071. int y = k;
  4072. int id = (i1 > 32767 ? cmd4 : i1 >> 14 & 0x7fff);
  4073. if(l >= 2000)
  4074. l -= 2000;
  4075. if(l == 582)
  4076. {
  4077. NPC npc = npcArray[i1];
  4078. if(npc != null)
  4079. {
  4080. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  4081. crossX = super.saveClickX;
  4082. crossY = super.saveClickY;
  4083. crossType = 2;
  4084. crossIndex = 0;
  4085. stream.createFrame(57);
  4086. stream.method432(anInt1285);
  4087. stream.method432(i1);
  4088. stream.method431(anInt1283);
  4089. stream.method432(anInt1284);
  4090. }
  4091. }
  4092. if(l == 234)
  4093. {
  4094. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4095. if(!flag1)
  4096. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4097. crossX = super.saveClickX;
  4098. crossY = super.saveClickY;
  4099. crossType = 2;
  4100. crossIndex = 0;
  4101. stream.createFrame(236);
  4102. stream.method431(k + baseY);
  4103. stream.writeWord(i1);
  4104. stream.method431(j + baseX);
  4105. }
  4106. if(l == 62 && method66(i1, y, x, id)) {
  4107. stream.createFrame(192);
  4108. stream.writeWord(anInt1284);
  4109. stream.method431(id);
  4110. stream.method433(y + baseY);
  4111. stream.method431(anInt1283);
  4112. stream.method433(x + baseX);
  4113. stream.writeWord(anInt1285);
  4114. }
  4115. if(l == 511)
  4116. {
  4117. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4118. if(!flag2)
  4119. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4120. crossX = super.saveClickX;
  4121. crossY = super.saveClickY;
  4122. crossType = 2;
  4123. crossIndex = 0;
  4124. stream.createFrame(25);
  4125. stream.method431(anInt1284);
  4126. stream.method432(anInt1285);
  4127. stream.writeWord(i1);
  4128. stream.method432(k + baseY);
  4129. stream.method433(anInt1283);
  4130. stream.writeWord(j + baseX);
  4131. }
  4132. if (l == 474) {//On / Off
  4133. counterOn = !counterOn == true;
  4134. }
  4135. if (l == 475) {//Reset
  4136. xpCounter = 0;
  4137. }
  4138. if(l == 74)
  4139. {
  4140. stream.createFrame(122);
  4141. stream.method433(k);
  4142. stream.method432(j);
  4143. stream.method431(i1);
  4144. atInventoryLoopCycle = 0;
  4145. atInventoryInterface = k;
  4146. atInventoryIndex = j;
  4147. atInventoryInterfaceType = 2;
  4148. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4149. atInventoryInterfaceType = 1;
  4150. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4151. atInventoryInterfaceType = 3;
  4152. }
  4153. if (l == 315) {
  4154. RSInterface class9 = RSInterface.interfaceCache[k];
  4155. boolean flag8 = true;
  4156. if (class9.contentType > 0)
  4157. flag8 = promptUserForInput(class9);
  4158. if (flag8) {
  4159. switch(k){
  4160. case 19144:
  4161. sendFrame248(15106,3213);
  4162. method60(15106);
  4163. inputTaken = true;
  4164. break;
  4165. case 31002:
  4166. chatColorHex = "00FFFF";
  4167. break;
  4168. case 31005:
  4169. chatColorHex = "00AFFF";
  4170. break;
  4171. case 31008:
  4172. chatColorHex = "0000FF";
  4173. break;
  4174. case 31011:
  4175. chatColorHex = "00FF00";
  4176. break;
  4177. case 31014:
  4178. chatColorHex = "9FFF9F";
  4179. break;
  4180. case 31017:
  4181. chatColorHex = "006F00";
  4182. break;
  4183. case 31020:
  4184. chatColorHex = "FF8F8F";
  4185. break;
  4186. case 31023:
  4187. chatColorHex = "FF981F";
  4188. break;
  4189. case 31026:
  4190. chatColorHex = "FF6F00";
  4191. break;
  4192. case 31029:
  4193. chatColorHex = "FFFF00";
  4194. break;
  4195. case 31032:
  4196. chatColorHex = "EF0000";
  4197. break;
  4198. case 31035:
  4199. chatColorHex = "EF00AF";
  4200. break;
  4201. case 31038:
  4202. chatColorHex = "FF4FFF";
  4203. break;
  4204. case 31041:
  4205. chatColorHex = "AF7FFF";
  4206. break;
  4207. case 31044:
  4208. chatColorHex = "000000";
  4209. break;
  4210. default:
  4211. stream.createFrame(185);
  4212. stream.writeWord(k);
  4213. break;
  4214.  
  4215. }
  4216. }
  4217. }
  4218. switch(l){
  4219. case 1050:
  4220. runState = 1;
  4221. if(!runClicked) {
  4222. runClicked = true;
  4223. musicOrb = false;
  4224. restOrb = false;
  4225. stream.createFrame(185);
  4226. stream.writeWord(153);
  4227. } else {
  4228. runClicked = false;
  4229. stream.createFrame(185);
  4230. stream.writeWord(152);
  4231. }
  4232. break;
  4233. case 1501:
  4234. runState = 2;
  4235. if(!musicOrb && restOrb){
  4236. musicOrb = true;
  4237. restOrb = false;
  4238. } else if(musicOrb && !restOrb){
  4239. musicOrb = false;
  4240. restOrb = true;
  4241. } else if(!musicOrb && !restOrb){
  4242. musicOrb =false;
  4243. restOrb = true;
  4244. }
  4245. break;
  4246. case 1500:
  4247. if(!prayClicked){
  4248. prayClicked = true;
  4249. } else {
  4250. prayClicked = false;
  4251. }
  4252. break;
  4253. case 1506:
  4254. stream.createFrame(185);
  4255. stream.writeWord(18002);
  4256. break;
  4257. case 18026:
  4258. if(!praySelected){
  4259. praySelected = true;
  4260. stream.createFrame(185);
  4261. stream.writeWord(1337);
  4262. } else {
  4263. praySelected = false;
  4264. stream.createFrame(185);
  4265. stream.writeWord(1338);
  4266. }
  4267. break;
  4268. case 1503:
  4269. if(!drawXpBar) {
  4270. drawXpBar = true;
  4271. } else {
  4272. drawXpBar = false;
  4273. }
  4274. break;
  4275. case 1504:
  4276. testXp = 0;
  4277. break;
  4278. }
  4279. if(l == 561)
  4280. {
  4281. Player player = playerArray[i1];
  4282. if(player != null)
  4283. {
  4284. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  4285. crossX = super.saveClickX;
  4286. crossY = super.saveClickY;
  4287. crossType = 2;
  4288. crossIndex = 0;
  4289. anInt1188 += i1;
  4290. if(anInt1188 >= 90)
  4291. {
  4292. stream.createFrame(136);
  4293. anInt1188 = 0;
  4294. }
  4295. stream.createFrame(128);
  4296. stream.writeWord(i1);
  4297. }
  4298. }
  4299. if(l == 20)
  4300. {
  4301. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  4302. if(class30_sub2_sub4_sub1_sub1_1 != null)
  4303. {
  4304. 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]);
  4305. crossX = super.saveClickX;
  4306. crossY = super.saveClickY;
  4307. crossType = 2;
  4308. crossIndex = 0;
  4309. stream.createFrame(155);
  4310. stream.method431(i1);
  4311. }
  4312. }
  4313. if(l == 779)
  4314. {
  4315. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  4316. if(class30_sub2_sub4_sub1_sub2_1 != null)
  4317. {
  4318. 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]);
  4319. crossX = super.saveClickX;
  4320. crossY = super.saveClickY;
  4321. crossType = 2;
  4322. crossIndex = 0;
  4323. stream.createFrame(153);
  4324. stream.method431(i1);
  4325. }
  4326. }
  4327. if(l == 516)
  4328. if(!menuOpen)
  4329. worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  4330. else
  4331. worldController.method312(k - 4, j - 4);
  4332. if(l == 1062) {
  4333. anInt924 += baseX;
  4334. if(anInt924 >= 113) {
  4335. stream.createFrame(183);
  4336. stream.writeDWordBigEndian(0xe63271);
  4337. anInt924 = 0;
  4338. }
  4339. method66(i1, y, x, id);
  4340. stream.createFrame(228);
  4341. stream.method432(id);
  4342. stream.method432(y + baseY);
  4343. stream.writeWord(x + baseX);
  4344. }
  4345. if(l == 679 && !aBoolean1149)
  4346. {
  4347. stream.createFrame(40);
  4348. stream.writeWord(k);
  4349. aBoolean1149 = true;
  4350. }
  4351. if(l == 431)
  4352. {
  4353. stream.createFrame(129);
  4354. stream.method432(j);
  4355. stream.writeWord(k);
  4356. stream.method432(i1);
  4357. atInventoryLoopCycle = 0;
  4358. atInventoryInterface = k;
  4359. atInventoryIndex = j;
  4360. atInventoryInterfaceType = 2;
  4361. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4362. atInventoryInterfaceType = 1;
  4363. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4364. atInventoryInterfaceType = 3;
  4365. }
  4366. if(l == 337 || l == 42 || l == 792 || l == 322)
  4367. {
  4368. String s = menuActionName[i];
  4369. int k1 = s.indexOf("@whi@");
  4370. if(k1 != -1)
  4371. {
  4372. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  4373. if(l == 337)
  4374. addFriend(l3);
  4375. if(l == 42)
  4376. addIgnore(l3);
  4377. if(l == 792)
  4378. delFriend(l3);
  4379. if(l == 322)
  4380. delIgnore(l3);
  4381. }
  4382. }
  4383. if(l == 53)
  4384. {
  4385. stream.createFrame(135);
  4386. stream.method431(j);
  4387. stream.method432(k);
  4388. stream.method431(i1);
  4389. atInventoryLoopCycle = 0;
  4390. atInventoryInterface = k;
  4391. atInventoryIndex = j;
  4392. atInventoryInterfaceType = 2;
  4393. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4394. atInventoryInterfaceType = 1;
  4395. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4396. atInventoryInterfaceType = 3;
  4397. }
  4398. if(l == 539)
  4399. {
  4400. stream.createFrame(16);
  4401. stream.method432(i1);
  4402. stream.method433(j);
  4403. stream.method433(k);
  4404. atInventoryLoopCycle = 0;
  4405. atInventoryInterface = k;
  4406. atInventoryIndex = j;
  4407. atInventoryInterfaceType = 2;
  4408. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4409. atInventoryInterfaceType = 1;
  4410. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4411. atInventoryInterfaceType = 3;
  4412. }
  4413. if(l == 484 || l == 6)
  4414. {
  4415. String s1 = menuActionName[i];
  4416. int l1 = s1.indexOf("@whi@");
  4417. if(l1 != -1)
  4418. {
  4419. s1 = s1.substring(l1 + 5).trim();
  4420. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  4421. boolean flag9 = false;
  4422. for(int j3 = 0; j3 < playerCount; j3++)
  4423. {
  4424. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  4425. 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))
  4426. continue;
  4427. 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]);
  4428. if(l == 484)
  4429. {
  4430. stream.createFrame(139);
  4431. stream.method431(playerIndices[j3]);
  4432. }
  4433. if(l == 6)
  4434. {
  4435. anInt1188 += i1;
  4436. if(anInt1188 >= 90)
  4437. {
  4438. stream.createFrame(136);
  4439. anInt1188 = 0;
  4440. }
  4441. stream.createFrame(128);
  4442. stream.writeWord(playerIndices[j3]);
  4443. }
  4444. flag9 = true;
  4445. break;
  4446. }
  4447.  
  4448. if(!flag9)
  4449. pushMessage("Unable to find " + s7, 0, "");
  4450. }
  4451. }
  4452. if(l == 870)
  4453. {
  4454. stream.createFrame(53);
  4455. stream.writeWord(j);
  4456. stream.method432(anInt1283);
  4457. stream.method433(i1);
  4458. stream.writeWord(anInt1284);
  4459. stream.method431(anInt1285);
  4460. stream.writeWord(k);
  4461. atInventoryLoopCycle = 0;
  4462. atInventoryInterface = k;
  4463. atInventoryIndex = j;
  4464. atInventoryInterfaceType = 2;
  4465. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4466. atInventoryInterfaceType = 1;
  4467. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4468. atInventoryInterfaceType = 3;
  4469. }
  4470. if(l == 847)
  4471. {
  4472. stream.createFrame(87);
  4473. stream.method432(i1);
  4474. stream.writeWord(k);
  4475. stream.method432(j);
  4476. atInventoryLoopCycle = 0;
  4477. atInventoryInterface = k;
  4478. atInventoryIndex = j;
  4479. atInventoryInterfaceType = 2;
  4480. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4481. atInventoryInterfaceType = 1;
  4482. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4483. atInventoryInterfaceType = 3;
  4484. }
  4485. if(l == 626)
  4486. {
  4487. RSInterface class9_1 = RSInterface.interfaceCache[k];
  4488. spellSelected = 1;
  4489. spellID = class9_1.id;
  4490. anInt1137 = k;
  4491. spellUsableOn = class9_1.spellUsableOn;
  4492. itemSelected = 0;
  4493. needDrawTabArea = true;
  4494. spellID = class9_1.id;
  4495. String s4 = class9_1.selectedActionName;
  4496. if(s4.indexOf(" ") != -1)
  4497. s4 = s4.substring(0, s4.indexOf(" "));
  4498. String s8 = class9_1.selectedActionName;
  4499. if(s8.indexOf(" ") != -1)
  4500. s8 = s8.substring(s8.indexOf(" ") + 1);
  4501. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  4502. //class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265, 0xffffff);
  4503. //class9_1.sprite1.drawSprite(200,200);
  4504. //System.out.println("Sprite: " + class9_1.sprite1.toString());
  4505. if(spellUsableOn == 16)
  4506. {
  4507. needDrawTabArea = true;
  4508. tabID = 3;
  4509. tabAreaAltered = true;
  4510. }
  4511. return;
  4512. }
  4513. if(l == 78)
  4514. {
  4515. stream.createFrame(117);
  4516. stream.method433(k);
  4517. stream.method433(i1);
  4518. stream.method431(j);
  4519. atInventoryLoopCycle = 0;
  4520. atInventoryInterface = k;
  4521. atInventoryIndex = j;
  4522. atInventoryInterfaceType = 2;
  4523. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4524. atInventoryInterfaceType = 1;
  4525. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4526. atInventoryInterfaceType = 3;
  4527. }
  4528. if(l == 27)
  4529. {
  4530. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4531. if(class30_sub2_sub4_sub1_sub2_2 != null)
  4532. {
  4533. 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]);
  4534. crossX = super.saveClickX;
  4535. crossY = super.saveClickY;
  4536. crossType = 2;
  4537. crossIndex = 0;
  4538. anInt986 += i1;
  4539. if(anInt986 >= 54)
  4540. {
  4541. stream.createFrame(189);
  4542. stream.writeWordBigEndian(234);
  4543. anInt986 = 0;
  4544. }
  4545. stream.createFrame(73);
  4546. stream.method431(i1);
  4547. }
  4548. }
  4549. if(l == 213)
  4550. {
  4551. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4552. if(!flag3)
  4553. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4554. crossX = super.saveClickX;
  4555. crossY = super.saveClickY;
  4556. crossType = 2;
  4557. crossIndex = 0;
  4558. stream.createFrame(79);
  4559. stream.method431(k + baseY);
  4560. stream.writeWord(i1);
  4561. stream.method432(j + baseX);
  4562. }
  4563. if(l == 632)
  4564. {
  4565. stream.createFrame(145);
  4566. stream.method432(k);
  4567. stream.method432(j);
  4568. stream.method432(i1);
  4569. atInventoryLoopCycle = 0;
  4570. atInventoryInterface = k;
  4571. atInventoryIndex = j;
  4572. atInventoryInterfaceType = 2;
  4573. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4574. atInventoryInterfaceType = 1;
  4575. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4576. atInventoryInterfaceType = 3;
  4577. }
  4578. if(l == 1004) {
  4579. if(tabInterfaceIDs[10] != -1) {
  4580. needDrawTabArea = true;
  4581. tabID = 10;
  4582. tabAreaAltered = true;
  4583. }
  4584. }
  4585. if(l == 1003) {
  4586. clanChatMode = 2;
  4587. aBoolean1233 = true;
  4588. inputTaken = true;
  4589. }
  4590. if(l == 1002) {
  4591. clanChatMode = 1;
  4592. aBoolean1233 = true;
  4593. inputTaken = true;
  4594. }
  4595. if(l == 1001) {
  4596. clanChatMode = 0;
  4597. aBoolean1233 = true;
  4598. inputTaken = true;
  4599. }
  4600. if(l == 1000) {
  4601. cButtonCPos = 4;
  4602. chatTypeView = 11;
  4603. aBoolean1233 = true;
  4604. inputTaken = true;
  4605. }
  4606. if(l == 999) {
  4607. cButtonCPos = 0;
  4608. chatTypeView = 0;
  4609. aBoolean1233 = true;
  4610. inputTaken = true;
  4611. }
  4612. if(l == 998) {
  4613. cButtonCPos = 1;
  4614. chatTypeView = 5;
  4615. aBoolean1233 = true;
  4616. inputTaken = true;
  4617. }
  4618. if(l == 997) {
  4619. publicChatMode = 3;
  4620. aBoolean1233 = true;
  4621. inputTaken = true;
  4622. }
  4623. if(l == 996) {
  4624. publicChatMode = 2;
  4625. aBoolean1233 = true;
  4626. inputTaken = true;
  4627. }
  4628. if(l == 995) {
  4629. publicChatMode = 1;
  4630. aBoolean1233 = true;
  4631. inputTaken = true;
  4632. }
  4633. if(l == 994) {
  4634. publicChatMode = 0;
  4635. aBoolean1233 = true;
  4636. inputTaken = true;
  4637. }
  4638. if(l == 993) {
  4639. cButtonCPos = 2;
  4640. chatTypeView = 1;
  4641. aBoolean1233 = true;
  4642. inputTaken = true;
  4643. }
  4644. if(l == 992) {
  4645. privateChatMode = 2;
  4646. aBoolean1233 = true;
  4647. inputTaken = true;
  4648. }
  4649. if(l == 991) {
  4650. privateChatMode = 1;
  4651. aBoolean1233 = true;
  4652. inputTaken = true;
  4653. }
  4654. if(l == 990) {
  4655. privateChatMode = 0;
  4656. aBoolean1233 = true;
  4657. inputTaken = true;
  4658. }
  4659. if(l == 989) {
  4660. cButtonCPos = 3;
  4661. chatTypeView = 2;
  4662. aBoolean1233 = true;
  4663. inputTaken = true;
  4664. }
  4665. if(l == 987) {
  4666. tradeMode = 2;
  4667. aBoolean1233 = true;
  4668. inputTaken = true;
  4669. }
  4670. if(l == 986) {
  4671. tradeMode = 1;
  4672. aBoolean1233 = true;
  4673. inputTaken = true;
  4674. }
  4675. if(l == 985) {
  4676. tradeMode = 0;
  4677. aBoolean1233 = true;
  4678. inputTaken = true;
  4679. }
  4680. if(l == 984) {
  4681. cButtonCPos = 5;
  4682. chatTypeView = 3;
  4683. aBoolean1233 = true;
  4684. inputTaken = true;
  4685. }
  4686. if(l == 983) {
  4687. duelMode = 2;
  4688. aBoolean1233 = true;
  4689. inputTaken = true;
  4690. }
  4691. if(l == 982) {
  4692. duelMode = 1;
  4693. aBoolean1233 = true;
  4694. inputTaken = true;
  4695. }
  4696. if(l == 981) {
  4697. duelMode = 0;
  4698. aBoolean1233 = true;
  4699. inputTaken = true;
  4700. }
  4701. if(l == 980) {
  4702. cButtonCPos = 6;
  4703. chatTypeView = 4;
  4704. aBoolean1233 = true;
  4705. inputTaken = true;
  4706. }
  4707. if(l == 493)
  4708. {
  4709. stream.createFrame(75);
  4710. stream.method433(k);
  4711. stream.method431(j);
  4712. stream.method432(i1);
  4713. atInventoryLoopCycle = 0;
  4714. atInventoryInterface = k;
  4715. atInventoryIndex = j;
  4716. atInventoryInterfaceType = 2;
  4717. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4718. atInventoryInterfaceType = 1;
  4719. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4720. atInventoryInterfaceType = 3;
  4721. }
  4722. if(l == 652)
  4723. {
  4724. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4725. if(!flag4)
  4726. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4727. crossX = super.saveClickX;
  4728. crossY = super.saveClickY;
  4729. crossType = 2;
  4730. crossIndex = 0;
  4731. stream.createFrame(156);
  4732. stream.method432(j + baseX);
  4733. stream.method431(k + baseY);
  4734. stream.method433(i1);
  4735. }
  4736. if(l == 94)
  4737. {
  4738. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4739. if(!flag5)
  4740. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4741. crossX = super.saveClickX;
  4742. crossY = super.saveClickY;
  4743. crossType = 2;
  4744. crossIndex = 0;
  4745. stream.createFrame(181);
  4746. stream.method431(k + baseY);
  4747. stream.writeWord(i1);
  4748. stream.method431(j + baseX);
  4749. stream.method432(anInt1137);
  4750. }
  4751. if(l == 646)
  4752. {
  4753. stream.createFrame(185);
  4754. stream.writeWord(k);
  4755. RSInterface class9_2 = RSInterface.interfaceCache[k];
  4756. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
  4757. {
  4758. int i2 = class9_2.valueIndexArray[0][1];
  4759. if(variousSettings[i2] != class9_2.anIntArray212[0])
  4760. {
  4761. variousSettings[i2] = class9_2.anIntArray212[0];
  4762. method33(i2);
  4763. needDrawTabArea = true;
  4764. }
  4765. }
  4766. }
  4767. if(l == 225)
  4768. {
  4769. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4770. if(class30_sub2_sub4_sub1_sub1_2 != null)
  4771. {
  4772. 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]);
  4773. crossX = super.saveClickX;
  4774. crossY = super.saveClickY;
  4775. crossType = 2;
  4776. crossIndex = 0;
  4777. anInt1226 += i1;
  4778. if(anInt1226 >= 85)
  4779. {
  4780. stream.createFrame(230);
  4781. stream.writeWordBigEndian(239);
  4782. anInt1226 = 0;
  4783. }
  4784. stream.createFrame(17);
  4785. stream.method433(i1);
  4786. }
  4787. }
  4788. if(l == 965)
  4789. {
  4790. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4791. if(class30_sub2_sub4_sub1_sub1_3 != null)
  4792. {
  4793. 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]);
  4794. crossX = super.saveClickX;
  4795. crossY = super.saveClickY;
  4796. crossType = 2;
  4797. crossIndex = 0;
  4798. anInt1134++;
  4799. if(anInt1134 >= 96)
  4800. {
  4801. stream.createFrame(152);
  4802. stream.writeWordBigEndian(88);
  4803. anInt1134 = 0;
  4804. }
  4805. stream.createFrame(21);
  4806. stream.writeWord(i1);
  4807. }
  4808. }
  4809. if(l == 413)
  4810. {
  4811. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4812. if(class30_sub2_sub4_sub1_sub1_4 != null)
  4813. {
  4814. 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]);
  4815. crossX = super.saveClickX;
  4816. crossY = super.saveClickY;
  4817. crossType = 2;
  4818. crossIndex = 0;
  4819. stream.createFrame(131);
  4820. stream.method433(i1);
  4821. stream.method432(anInt1137);
  4822. }
  4823. }
  4824. if(l == 200)
  4825. clearTopInterfaces();
  4826. if(l == 1025)
  4827. {
  4828. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4829. if(class30_sub2_sub4_sub1_sub1_5 != null)
  4830. {
  4831. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4832. if(entityDef.childrenIDs != null)
  4833. entityDef = entityDef.method161();
  4834. if(entityDef != null)
  4835. {
  4836. String s9;
  4837. if(entityDef.description != null)
  4838. s9 = new String(entityDef.description);
  4839. else
  4840. s9 = "It's a " + entityDef.name + ".";
  4841. pushMessage(s9, 0, "");
  4842. }
  4843. }
  4844. }
  4845. if(l == 900) {
  4846. method66(i1, y, x, id);
  4847. stream.createFrame(252);
  4848. stream.method433(id);
  4849. stream.method431(y + baseY);
  4850. stream.method432(x + baseX);
  4851. }
  4852. if(l == 412)
  4853. {
  4854. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4855. if(class30_sub2_sub4_sub1_sub1_6 != null)
  4856. {
  4857. 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]);
  4858. crossX = super.saveClickX;
  4859. crossY = super.saveClickY;
  4860. crossType = 2;
  4861. crossIndex = 0;
  4862. stream.createFrame(72);
  4863. stream.method432(i1);
  4864. }
  4865. }
  4866. if(l == 365)
  4867. {
  4868. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4869. if(class30_sub2_sub4_sub1_sub2_3 != null)
  4870. {
  4871. 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]);
  4872. crossX = super.saveClickX;
  4873. crossY = super.saveClickY;
  4874. crossType = 2;
  4875. crossIndex = 0;
  4876. stream.createFrame(249);
  4877. stream.method432(i1);
  4878. stream.method431(anInt1137);
  4879. }
  4880. }
  4881. if(l == 729)
  4882. {
  4883. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4884. if(class30_sub2_sub4_sub1_sub2_4 != null)
  4885. {
  4886. 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]);
  4887. crossX = super.saveClickX;
  4888. crossY = super.saveClickY;
  4889. crossType = 2;
  4890. crossIndex = 0;
  4891. stream.createFrame(39);
  4892. stream.method431(i1);
  4893. }
  4894. }
  4895. if(l == 577)
  4896. {
  4897. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4898. if(class30_sub2_sub4_sub1_sub2_5 != null)
  4899. {
  4900. 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]);
  4901. crossX = super.saveClickX;
  4902. crossY = super.saveClickY;
  4903. crossType = 2;
  4904. crossIndex = 0;
  4905. stream.createFrame(139);
  4906. stream.method431(i1);
  4907. }
  4908. }
  4909. if(l == 956 && method66(i1, y, x, id)) {
  4910. stream.createFrame(35);
  4911. stream.method431(x + baseX);
  4912. stream.method432(anInt1137);
  4913. stream.method432(y + baseY);
  4914. stream.method431(id);
  4915. }
  4916. if(l == 567)
  4917. {
  4918. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4919. if(!flag6)
  4920. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4921. crossX = super.saveClickX;
  4922. crossY = super.saveClickY;
  4923. crossType = 2;
  4924. crossIndex = 0;
  4925. stream.createFrame(23);
  4926. stream.method431(k + baseY);
  4927. stream.method431(i1);
  4928. stream.method431(j + baseX);
  4929. }
  4930. if(l == 867)
  4931. {
  4932. if((i1 & 3) == 0)
  4933. anInt1175++;
  4934. if(anInt1175 >= 59)
  4935. {
  4936. stream.createFrame(200);
  4937. stream.writeWord(25501);
  4938. anInt1175 = 0;
  4939. }
  4940. stream.createFrame(43);
  4941. stream.method431(k);
  4942. stream.method432(i1);
  4943. stream.method432(j);
  4944. atInventoryLoopCycle = 0;
  4945. atInventoryInterface = k;
  4946. atInventoryIndex = j;
  4947. atInventoryInterfaceType = 2;
  4948. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4949. atInventoryInterfaceType = 1;
  4950. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4951. atInventoryInterfaceType = 3;
  4952. }
  4953. if(l == 543)
  4954. {
  4955. stream.createFrame(237);
  4956. stream.writeWord(j);
  4957. stream.method432(i1);
  4958. stream.writeWord(k);
  4959. stream.method432(anInt1137);
  4960. atInventoryLoopCycle = 0;
  4961. atInventoryInterface = k;
  4962. atInventoryIndex = j;
  4963. atInventoryInterfaceType = 2;
  4964. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4965. atInventoryInterfaceType = 1;
  4966. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4967. atInventoryInterfaceType = 3;
  4968. }
  4969. if(l == 606)
  4970. {
  4971. String s2 = menuActionName[i];
  4972. int j2 = s2.indexOf("@whi@");
  4973. if(j2 != -1)
  4974. if(openInterfaceID == -1)
  4975. {
  4976. clearTopInterfaces();
  4977. reportAbuseInput = s2.substring(j2 + 5).trim();
  4978. canMute = false;
  4979. for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  4980. {
  4981. if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  4982. continue;
  4983. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4984. break;
  4985. }
  4986.  
  4987. } else
  4988. {
  4989. pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  4990. }
  4991. }
  4992. if(l == 491)
  4993. {
  4994. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4995. if(class30_sub2_sub4_sub1_sub2_6 != null)
  4996. {
  4997. 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]);
  4998. crossX = super.saveClickX;
  4999. crossY = super.saveClickY;
  5000. crossType = 2;
  5001. crossIndex = 0;
  5002. stream.createFrame(14);
  5003. stream.method432(anInt1284);
  5004. stream.writeWord(i1);
  5005. stream.writeWord(anInt1285);
  5006. stream.method431(anInt1283);
  5007. }
  5008. }
  5009. if(l == 639)
  5010. {
  5011. String s3 = menuActionName[i];
  5012. int k2 = s3.indexOf("@whi@");
  5013. if(k2 != -1)
  5014. {
  5015. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  5016. int k3 = -1;
  5017. for(int i4 = 0; i4 < friendsCount; i4++)
  5018. {
  5019. if(friendsListAsLongs[i4] != l4)
  5020. continue;
  5021. k3 = i4;
  5022. break;
  5023. }
  5024.  
  5025. if(k3 != -1 && friendsNodeIDs[k3] > 0)
  5026. {
  5027. inputTaken = true;
  5028. inputDialogState = 0;
  5029. messagePromptRaised = true;
  5030. promptInput = "";
  5031. friendsListAction = 3;
  5032. aLong953 = friendsListAsLongs[k3];
  5033. aString1121 = "Enter message to send to " + friendsList[k3];
  5034. }
  5035. }
  5036. }
  5037. if(l == 104) {
  5038. RSInterface class9_1 = RSInterface.interfaceCache[k];
  5039. spellID = class9_1.id;
  5040. if(!Autocast) {
  5041. Autocast = true;
  5042. autocastId = class9_1.id;
  5043. stream.createFrame(185);
  5044. stream.writeWord(class9_1.id);
  5045. } else
  5046. if(autocastId == class9_1.id) {
  5047. Autocast = false;
  5048. autocastId = 0;
  5049. stream.createFrame(185);
  5050. stream.writeWord(class9_1.id);
  5051. } else
  5052. if(autocastId != class9_1.id) {
  5053. Autocast = true;
  5054. autocastId = class9_1.id;
  5055. stream.createFrame(185);
  5056. stream.writeWord(class9_1.id);
  5057. }
  5058. }
  5059. if(l == 454)
  5060. {
  5061. stream.createFrame(41);
  5062. stream.writeWord(i1);
  5063. stream.method432(j);
  5064. stream.method432(k);
  5065. atInventoryLoopCycle = 0;
  5066. atInventoryInterface = k;
  5067. atInventoryIndex = j;
  5068. atInventoryInterfaceType = 2;
  5069. if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5070. atInventoryInterfaceType = 1;
  5071. if(RSInterface.interfaceCache[k].parentID == backDialogID)
  5072. atInventoryInterfaceType = 3;
  5073. }
  5074. if(l == 478)
  5075. {
  5076. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  5077. if(class30_sub2_sub4_sub1_sub1_7 != null)
  5078. {
  5079. 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]);
  5080. crossX = super.saveClickX;
  5081. crossY = super.saveClickY;
  5082. crossType = 2;
  5083. crossIndex = 0;
  5084. if((i1 & 3) == 0)
  5085. anInt1155++;
  5086. if(anInt1155 >= 53)
  5087. {
  5088. stream.createFrame(85);
  5089. stream.writeWordBigEndian(66);
  5090. anInt1155 = 0;
  5091. }
  5092. stream.createFrame(18);
  5093. stream.method431(i1);
  5094. }
  5095. }
  5096. if(l == 113) {
  5097. method66(i1, y, x, id);
  5098. stream.createFrame(70);
  5099. stream.method431(x + baseX);
  5100. stream.writeWord(y + baseY);
  5101. stream.method433(id);
  5102. }
  5103. if(l == 872) {
  5104. method66(i1, y, x, id);
  5105. stream.createFrame(234);
  5106. stream.method433(x + baseX);
  5107. stream.method432(id);
  5108. stream.method433(y + baseY);
  5109. }
  5110. if(l == 502) {
  5111. method66(i1, y, x, id);
  5112. stream.createFrame(132);
  5113. stream.method433(x + baseX);
  5114. stream.writeWord(id);
  5115. stream.method432(y + baseY);
  5116. }
  5117. if(l == 1125)
  5118. {
  5119. ItemDef itemDef = ItemDef.forID(i1);
  5120. RSInterface class9_4 = RSInterface.interfaceCache[k];
  5121. String s5;
  5122. if(class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  5123. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  5124. else
  5125. if(itemDef.description != null)
  5126. s5 = new String(itemDef.description);
  5127. else
  5128. s5 = "It's a " + itemDef.name + ".";
  5129. pushMessage(s5, 0, "");
  5130. }
  5131. if(l == 169)
  5132. {
  5133. stream.createFrame(185);
  5134. stream.writeWord(k);
  5135. RSInterface class9_3 = RSInterface.interfaceCache[k];
  5136. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5)
  5137. {
  5138. int l2 = class9_3.valueIndexArray[0][1];
  5139. variousSettings[l2] = 1 - variousSettings[l2];
  5140. method33(l2);
  5141. needDrawTabArea = true;
  5142. }
  5143. }
  5144. if(l == 447)
  5145. {
  5146. itemSelected = 1;
  5147. anInt1283 = j;
  5148. anInt1284 = k;
  5149. anInt1285 = i1;
  5150. selectedItemName = ItemDef.forID(i1).name;
  5151. spellSelected = 0;
  5152. needDrawTabArea = true;
  5153. return;
  5154. }
  5155. if(l == 1226)
  5156. {
  5157. int j1 = i1 >> 14 & 0x7fff;
  5158. ObjectDef class46 = ObjectDef.forID(j1);
  5159. String s10;
  5160. if(class46.description != null)
  5161. s10 = new String(class46.description);
  5162. else
  5163. s10 = "It's a " + class46.name + ".";
  5164. pushMessage(s10, 0, "");
  5165. }
  5166. if(l == 244)
  5167. {
  5168. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  5169. if(!flag7)
  5170. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  5171. crossX = super.saveClickX;
  5172. crossY = super.saveClickY;
  5173. crossType = 2;
  5174. crossIndex = 0;
  5175. stream.createFrame(253);
  5176. stream.method431(j + baseX);
  5177. stream.method433(k + baseY);
  5178. stream.method432(i1);
  5179. }
  5180. if(l == 1448)
  5181. {
  5182. ItemDef itemDef_1 = ItemDef.forID(i1);
  5183. String s6;
  5184. if(itemDef_1.description != null)
  5185. s6 = new String(itemDef_1.description);
  5186. else
  5187. s6 = "It's a " + itemDef_1.name + ".";
  5188. pushMessage(s6, 0, "");
  5189. }
  5190. itemSelected = 0;
  5191. spellSelected = 0;
  5192. needDrawTabArea = true;
  5193.  
  5194. }
  5195.  
  5196. private void method70()
  5197. {
  5198. anInt1251 = 0;
  5199. int j = (myPlayer.x >> 7) + baseX;
  5200. int k = (myPlayer.y >> 7) + baseY;
  5201. if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  5202. anInt1251 = 1;
  5203. if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  5204. anInt1251 = 1;
  5205. if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  5206. anInt1251 = 0;
  5207. }
  5208.  
  5209. public void run() {
  5210. if(drawFlames) {
  5211. drawFlames();
  5212. } else {
  5213. super.run();
  5214. }
  5215. }
  5216.  
  5217. private void build3dScreenMenu()
  5218. {
  5219. if(itemSelected == 0 && spellSelected == 0)
  5220. {
  5221. menuActionName[menuActionRow] = "Walk here";
  5222. menuActionID[menuActionRow] = 516;
  5223. menuActionCmd2[menuActionRow] = super.mouseX;
  5224. menuActionCmd3[menuActionRow] = super.mouseY;
  5225. menuActionRow++;
  5226. }
  5227. int j = -1;
  5228. for(int k = 0; k < Model.anInt1687; k++) {
  5229. int l = Model.anIntArray1688[k];
  5230. int i1 = l & 0x7f;
  5231. int j1 = l >> 7 & 0x7f;
  5232. int k1 = l >> 29 & 3;
  5233. int l1 = l >> 14 & 0x7fff;
  5234. if(l == j)
  5235. continue;
  5236. j = l;
  5237. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0) {
  5238. l1 = Model.mapObjIds[k];
  5239. ObjectDef class46 = ObjectDef.forID(l1);
  5240. if(class46.childrenIDs != null)
  5241. class46 = class46.method580();
  5242. if(class46 == null || class46.name == null || class46.name == "null")
  5243. continue;
  5244. if(itemSelected == 1) {
  5245. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @cya@" + class46.name;
  5246. menuActionID[menuActionRow] = 62;
  5247. menuActionCmd1[menuActionRow] = l;
  5248. menuActionCmd2[menuActionRow] = i1;
  5249. menuActionCmd3[menuActionRow] = j1;
  5250. menuActionCmd4[menuActionRow] = l1;
  5251. menuActionRow++;
  5252. } else
  5253. if(spellSelected == 1) {
  5254. if((spellUsableOn & 4) == 4) {
  5255. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  5256. menuActionID[menuActionRow] = 956;
  5257. menuActionCmd1[menuActionRow] = l;
  5258. menuActionCmd2[menuActionRow] = i1;
  5259. menuActionCmd3[menuActionRow] = j1;
  5260. menuActionCmd4[menuActionRow] = l1;
  5261. menuActionRow++;
  5262. }
  5263. } else {
  5264. if(class46.actions != null) {
  5265. for(int i2 = 4; i2 >= 0; i2--)
  5266. if(class46.actions[i2] != null) {
  5267. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  5268. if(i2 == 0)
  5269. menuActionID[menuActionRow] = 502;
  5270. if(i2 == 1)
  5271. menuActionID[menuActionRow] = 900;
  5272. if(i2 == 2)
  5273. menuActionID[menuActionRow] = 113;
  5274. if(i2 == 3)
  5275. menuActionID[menuActionRow] = 872;
  5276. if(i2 == 4)
  5277. menuActionID[menuActionRow] = 1062;
  5278. menuActionCmd1[menuActionRow] = l;
  5279. menuActionCmd2[menuActionRow] = i1;
  5280. menuActionCmd3[menuActionRow] = j1;
  5281. menuActionCmd4[menuActionRow] = l1;
  5282. menuActionRow++;
  5283. }
  5284. }
  5285. if(idToggle == true) {
  5286. menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " (Anim: "+class46.anInt781+") (ID: "+ l1 + " / Models: " + class46.anIntArray773[0] +") ";
  5287. } else {
  5288. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  5289. }
  5290. menuActionID[menuActionRow] = 1226;
  5291. menuActionCmd1[menuActionRow] = class46.type << 14;
  5292. menuActionCmd2[menuActionRow] = i1;
  5293. menuActionCmd3[menuActionRow] = j1;
  5294. menuActionCmd4[menuActionRow] = l1;
  5295. menuActionRow++;
  5296. }
  5297. }
  5298. if(k1 == 1)
  5299. {
  5300. NPC npc = npcArray[l1];
  5301. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  5302. {
  5303. for(int j2 = 0; j2 < npcCount; j2++)
  5304. {
  5305. NPC npc2 = npcArray[npcIndices[j2]];
  5306. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  5307. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  5308. }
  5309.  
  5310. for(int l2 = 0; l2 < playerCount; l2++)
  5311. {
  5312. Player player = playerArray[playerIndices[l2]];
  5313. if(player != null && player.x == npc.x && player.y == npc.y)
  5314. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  5315. }
  5316.  
  5317. }
  5318. buildAtNPCMenu(npc.desc, l1, j1, i1);
  5319. }
  5320. if(k1 == 0)
  5321. {
  5322. Player player = playerArray[l1];
  5323. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  5324. {
  5325. for(int k2 = 0; k2 < npcCount; k2++)
  5326. {
  5327. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  5328. 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)
  5329. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  5330. }
  5331.  
  5332. for(int i3 = 0; i3 < playerCount; i3++)
  5333. {
  5334. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  5335. 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)
  5336. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  5337. }
  5338.  
  5339. }
  5340. buildAtPlayerMenu(i1, l1, player, j1);
  5341. }
  5342. if(k1 == 3)
  5343. {
  5344. NodeList class19 = groundArray[plane][i1][j1];
  5345. if(class19 != null)
  5346. {
  5347. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  5348. {
  5349. ItemDef itemDef = ItemDef.forID(item.ID);
  5350. if(itemSelected == 1)
  5351. {
  5352. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  5353. menuActionID[menuActionRow] = 511;
  5354. menuActionCmd1[menuActionRow] = item.ID;
  5355. menuActionCmd2[menuActionRow] = i1;
  5356. menuActionCmd3[menuActionRow] = j1;
  5357. menuActionRow++;
  5358. } else
  5359. if(spellSelected == 1)
  5360. {
  5361. if((spellUsableOn & 1) == 1)
  5362. {
  5363. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  5364. menuActionID[menuActionRow] = 94;
  5365. menuActionCmd1[menuActionRow] = item.ID;
  5366. menuActionCmd2[menuActionRow] = i1;
  5367. menuActionCmd3[menuActionRow] = j1;
  5368. menuActionRow++;
  5369. }
  5370. } else
  5371. {
  5372. for(int j3 = 4; j3 >= 0; j3--)
  5373. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  5374. {
  5375. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  5376. if(j3 == 0)
  5377. menuActionID[menuActionRow] = 652;
  5378. if(j3 == 1)
  5379. menuActionID[menuActionRow] = 567;
  5380. if(j3 == 2)
  5381. menuActionID[menuActionRow] = 234;
  5382. if(j3 == 3)
  5383. menuActionID[menuActionRow] = 244;
  5384. if(j3 == 4)
  5385. menuActionID[menuActionRow] = 213;
  5386. menuActionCmd1[menuActionRow] = item.ID;
  5387. menuActionCmd2[menuActionRow] = i1;
  5388. menuActionCmd3[menuActionRow] = j1;
  5389. menuActionRow++;
  5390. } else
  5391. if(j3 == 2)
  5392. {
  5393. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  5394. menuActionID[menuActionRow] = 234;
  5395. menuActionCmd1[menuActionRow] = item.ID;
  5396. menuActionCmd2[menuActionRow] = i1;
  5397. menuActionCmd3[menuActionRow] = j1;
  5398. menuActionRow++;
  5399. }
  5400.  
  5401. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  5402. if(idToggle == true) {
  5403. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  5404. } else {
  5405. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  5406. }
  5407. menuActionID[menuActionRow] = 1448;
  5408. menuActionCmd1[menuActionRow] = item.ID;
  5409. menuActionCmd2[menuActionRow] = i1;
  5410. menuActionCmd3[menuActionRow] = j1;
  5411. menuActionRow++;
  5412. }
  5413. }
  5414.  
  5415. }
  5416. }
  5417. }
  5418. }
  5419.  
  5420. public void cleanUpForQuit()
  5421. {
  5422. signlink.reporterror = false;
  5423. try
  5424. {
  5425. if(socketStream != null)
  5426. socketStream.close();
  5427. }
  5428. catch(Exception _ex) { }
  5429. socketStream = null;
  5430. stopMidi();
  5431. if(mouseDetection != null)
  5432. mouseDetection.running = false;
  5433. mouseDetection = null;
  5434. onDemandFetcher.disable();
  5435. onDemandFetcher = null;
  5436. aStream_834 = null;
  5437. stream = null;
  5438. aStream_847 = null;
  5439. inStream = null;
  5440. anIntArray1234 = null;
  5441. aByteArrayArray1183 = null;
  5442. aByteArrayArray1247 = null;
  5443. anIntArray1235 = null;
  5444. anIntArray1236 = null;
  5445. intGroundArray = null;
  5446. byteGroundArray = null;
  5447. worldController = null;
  5448. aClass11Array1230 = null;
  5449. anIntArrayArray901 = null;
  5450. anIntArrayArray825 = null;
  5451. bigX = null;
  5452. bigY = null;
  5453. aByteArray912 = null;
  5454. aRSImageProducer_1163 = null;
  5455. mapEdgeIP = null;
  5456. leftFrame = null;
  5457. topFrame = null;
  5458. rightFrame = null;
  5459. aRSImageProducer_1164 = null;
  5460. aRSImageProducer_1165 = null;
  5461. aRSImageProducer_1166 = null;
  5462. aRSImageProducer_1123 = null;
  5463. aRSImageProducer_1124 = null;
  5464. aRSImageProducer_1125 = null;
  5465. /* Null pointers for custom sprites */
  5466. backgroundFix = null;
  5467. loadingBarFull = null;
  5468. loadingBarEmpty = null;
  5469. SummIcon = null;
  5470. SummOrb = null;
  5471. SummOrbFill = null;
  5472. chatArea = null;
  5473. loadingPleaseWait = null;
  5474. reestablish = null;
  5475. chatButtons = null;
  5476. tabArea = null;
  5477. tabHover = null;
  5478. tabClicked = null;
  5479. newSideIcons = null;
  5480. mapArea = null;
  5481. HPBarFull = null;
  5482. HPBarEmpty = null;
  5483. /**/
  5484. mapBack = null;
  5485. sideIcons = null;
  5486. redStones = null;
  5487. compass = null;
  5488. hitMarks = null;
  5489. headIcons = null;
  5490. skullIcons = null;
  5491. headIconsHint = null;
  5492. crosses = null;
  5493. mapDotItem = null;
  5494. mapDotNPC = null;
  5495. mapDotPlayer = null;
  5496. mapDotFriend = null;
  5497. mapDotTeam = null;
  5498. mapScenes = null;
  5499. mapFunctions = null;
  5500. anIntArrayArray929 = null;
  5501. playerArray = null;
  5502. playerIndices = null;
  5503. anIntArray894 = null;
  5504. aStreamArray895s = null;
  5505. anIntArray840 = null;
  5506. npcArray = null;
  5507. npcIndices = null;
  5508. groundArray = null;
  5509. aClass19_1179 = null;
  5510. aClass19_1013 = null;
  5511. aClass19_1056 = null;
  5512. menuActionCmd2 = null;
  5513. menuActionCmd3 = null;
  5514. menuActionCmd4 = null;
  5515. menuActionID = null;
  5516. menuActionCmd1 = null;
  5517. menuActionName = null;
  5518. variousSettings = null;
  5519. anIntArray1072 = null;
  5520. anIntArray1073 = null;
  5521. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  5522. aClass30_Sub2_Sub1_Sub1_1263 = null;
  5523. friendsList = null;
  5524. friendsListAsLongs = null;
  5525. friendsNodeIDs = null;
  5526. aRSImageProducer_1110 = null;
  5527. aRSImageProducer_1111 = null;
  5528. aRSImageProducer_1107 = null;
  5529. aRSImageProducer_1108 = null;
  5530. aRSImageProducer_1109 = null;
  5531. aRSImageProducer_1112 = null;
  5532. aRSImageProducer_1113 = null;
  5533. aRSImageProducer_1114 = null;
  5534. aRSImageProducer_1115 = null;
  5535. multiOverlay = null;
  5536. nullLoader();
  5537. ObjectDef.nullLoader();
  5538. EntityDef.nullLoader();
  5539. ItemDef.nullLoader();
  5540. Flo.cache = null;
  5541. IDK.cache = null;
  5542. RSInterface.interfaceCache = null;
  5543. DummyClass.cache = null;
  5544. Animation.anims = null;
  5545. SpotAnim.cache = null;
  5546. SpotAnim.aMRUNodes_415 = null;
  5547. Varp.cache = null;
  5548. super.fullGameScreen = null;
  5549. Player.mruNodes = null;
  5550. Texture.nullLoader();
  5551. WorldController.nullLoader();
  5552. Model.nullLoader();
  5553. Class36.nullLoader();
  5554. System.gc();
  5555. }
  5556.  
  5557. private void printDebug()
  5558. {
  5559. System.out.println("============");
  5560. System.out.println("flame-cycle:" + anInt1208);
  5561. if(onDemandFetcher != null)
  5562. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5563. System.out.println("loop-cycle:" + loopCycle);
  5564. System.out.println("draw-cycle:" + anInt1061);
  5565. System.out.println("ptype:" + pktType);
  5566. System.out.println("psize:" + pktSize);
  5567. if(socketStream != null)
  5568. socketStream.printDebug();
  5569. super.shouldDebug = true;
  5570. }
  5571.  
  5572. Component getGameComponent() {
  5573. if(signlink.mainapp != null)
  5574. return signlink.mainapp;
  5575. if(super.gameFrame != null)
  5576. return super.gameFrame;
  5577. else
  5578. return this;
  5579. }
  5580.  
  5581. private void method73() {
  5582. do {
  5583. int j = readChar(-796);
  5584. if(j == -1)
  5585. break;
  5586. if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5587. if(j == 8 && reportAbuseInput.length() > 0)
  5588. reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5589. if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5590. reportAbuseInput += (char)j;
  5591. } else if(messagePromptRaised) {
  5592. if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  5593. promptInput += (char)j;
  5594. inputTaken = true;
  5595. }
  5596. if(j == 8 && promptInput.length() > 0) {
  5597. promptInput = promptInput.substring(0, promptInput.length() - 1);
  5598. inputTaken = true;
  5599. }
  5600. if(j == 13 || j == 10) {
  5601. messagePromptRaised = false;
  5602. inputTaken = true;
  5603. if(friendsListAction == 1) {
  5604. long l = TextClass.longForName(promptInput);
  5605. addFriend(l);
  5606. }
  5607. if(friendsListAction == 2 && friendsCount > 0) {
  5608. long l1 = TextClass.longForName(promptInput);
  5609. delFriend(l1);
  5610. }
  5611. if(friendsListAction == 3 && promptInput.length() > 0) {
  5612. stream.createFrame(126);
  5613. stream.writeWordBigEndian(0);
  5614. int k = stream.currentOffset;
  5615. stream.writeQWord(aLong953);
  5616. TextInput.method526(promptInput, stream);
  5617. stream.writeBytes(stream.currentOffset - k);
  5618. promptInput = TextInput.processText(promptInput);
  5619. //promptInput = Censor.doCensor(promptInput);
  5620. pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5621. if(privateChatMode == 2) {
  5622. privateChatMode = 1;
  5623. aBoolean1233 = true;
  5624. stream.createFrame(95);
  5625. stream.writeWordBigEndian(publicChatMode);
  5626. stream.writeWordBigEndian(privateChatMode);
  5627. stream.writeWordBigEndian(tradeMode);
  5628. }
  5629. }
  5630. if(friendsListAction == 4 && ignoreCount < 100) {
  5631. long l2 = TextClass.longForName(promptInput);
  5632. addIgnore(l2);
  5633. }
  5634. if(friendsListAction == 5 && ignoreCount > 0) {
  5635. long l3 = TextClass.longForName(promptInput);
  5636. delIgnore(l3);
  5637. }
  5638. if(friendsListAction == 6) {
  5639. long l3 = TextClass.longForName(promptInput);
  5640. chatJoin(l3);
  5641. }
  5642. }
  5643. } else if (inputDialogState == 1) {
  5644. if (j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5645. amountOrNameInput += (char) j;
  5646. inputTaken = true;
  5647. }
  5648. if ((!amountOrNameInput.toLowerCase().contains("k") && !amountOrNameInput.toLowerCase().contains("m") && !amountOrNameInput.toLowerCase().contains("b")) && (j == 107 || j == 109) || j == 98) {
  5649. amountOrNameInput += (char) j;
  5650. inputTaken = true;
  5651. }
  5652. if (j == 8 && amountOrNameInput.length() > 0) {
  5653. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5654. inputTaken = true;
  5655. }
  5656. if (j == 13 || j == 10) {
  5657. if (amountOrNameInput.length() > 0) {
  5658. if (amountOrNameInput.toLowerCase().contains("k")) {
  5659. amountOrNameInput = amountOrNameInput.replaceAll("k", "000");
  5660. } else if (amountOrNameInput.toLowerCase().contains("m")) {
  5661. amountOrNameInput = amountOrNameInput.replaceAll("m", "000000");
  5662. } else if (amountOrNameInput.toLowerCase().contains("b")) {
  5663. amountOrNameInput = amountOrNameInput.replaceAll("b", "000000000");
  5664. }
  5665. int amount = 0;
  5666. amount = Integer.parseInt(amountOrNameInput);
  5667. stream.createFrame(208);
  5668. stream.writeDWord(amount);
  5669. }
  5670. inputDialogState = 0;
  5671. inputTaken = true;
  5672. }
  5673. } else if(inputDialogState == 2) {
  5674. if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5675. amountOrNameInput += (char)j;
  5676. inputTaken = true;
  5677. }
  5678. if(j == 8 && amountOrNameInput.length() > 0) {
  5679. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5680. inputTaken = true;
  5681. }
  5682. if(j == 13 || j == 10) {
  5683. if(amountOrNameInput.length() > 0) {
  5684. stream.createFrame(60);
  5685. stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5686. }
  5687. inputDialogState = 0;
  5688. inputTaken = true;
  5689. }
  5690. } else if(backDialogID == -1) {
  5691. if(j >= 32 && j <= 122 && inputString.length() < 80) {
  5692. inputString += (char)j;
  5693. inputTaken = true;
  5694. }
  5695. if(j == 8 && inputString.length() > 0) {
  5696. inputString = inputString.substring(0, inputString.length() - 1);
  5697. inputTaken = true;
  5698. }
  5699. if((j == 13 || j == 10) && inputString.length() > 0) {
  5700. if(myPrivilege == 2 || server.equals("127.0.0.1") || 1 == 1/*to remove*/) {
  5701. if(inputString.startsWith("//setspecto")) {
  5702. int amt = Integer.parseInt(inputString.substring(12));
  5703. anIntArray1045[300] = amt;
  5704. if(variousSettings[300] != amt) {
  5705. variousSettings[300] = amt;
  5706. method33(300);
  5707. needDrawTabArea = true;
  5708. if(dialogID != -1)
  5709. inputTaken = true;
  5710. }
  5711. }
  5712. if(inputString.equals("::idtoggle")){
  5713. if(idToggle) {
  5714. idToggle = false;
  5715. } else {
  5716. idToggle = true;
  5717. }
  5718. }
  5719. if (inputString.startsWith("full")) {
  5720. try {
  5721. String[] args = inputString.split(" ");
  5722. int id1 = Integer.parseInt(args[1]);
  5723. int id2 = Integer.parseInt(args[2]);
  5724. fullscreenInterfaceID = id1;
  5725. openInterfaceID = id2;
  5726. pushMessage("Opened Interface", 0, "");
  5727. } catch (Exception e) {
  5728. pushMessage("Interface Failed to load", 0, "");
  5729. }
  5730. }
  5731. if(inputString.equals("::lag"))
  5732. printDebug();
  5733. if(inputString.equals("::fpson"))
  5734. fpsOn = true;
  5735. if(inputString.equals("::fpsoff"))
  5736. fpsOn = false;
  5737. if(inputString.equals("::dataon"))
  5738. clientData = true;
  5739. if(inputString.equals("::dataoff"))
  5740. clientData = false;
  5741. if(inputString.equals("::newbar"))
  5742. hitbarToggle = true;
  5743. if(inputString.equals("::oldbar"))
  5744. hitbarToggle = false;
  5745. if(inputString.equals("::minimapon"))
  5746. ToggleMinimap = true;
  5747. if(inputString.equals("::minimapoff"))
  5748. ToggleMinimap = false;
  5749. if (inputString.startsWith("::chatcolor")) {
  5750. String args[] = inputString.split(" ");
  5751. if(args[1].length() == 6)
  5752. chatColorHex = args[1];
  5753. else
  5754. pushMessage("The hex code must be a 6-digit-number.", 0, "");
  5755. }
  5756. if(inputString.equals("::noclip")) {
  5757. for(int k1 = 0; k1 < 4; k1++) {
  5758. for(int i2 = 1; i2 < 103; i2++) {
  5759. for(int k2 = 1; k2 < 103; k2++)
  5760. aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5761.  
  5762. }
  5763. }
  5764. }
  5765. }
  5766. if(inputString.startsWith("/"))
  5767. inputString = "::" + inputString;
  5768. if(inputString.equals("add model")) {
  5769. try {
  5770. int ModelIndex = Integer.parseInt(JOptionPane.showInputDialog(this, "Enter model ID", "Model", 3));
  5771. byte[] abyte0 = getModel(ModelIndex);
  5772. if(abyte0 != null && abyte0.length > 0) {
  5773. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  5774. pushMessage("Model: [" + ModelIndex + "] added successfully!", 0, "");
  5775. } else {
  5776. pushMessage("Unable to find the model. "+ModelIndex, 0, "");
  5777. }
  5778. } catch(Exception e) {
  5779. pushMessage("Syntax - ::add model <path>", 0, "");
  5780. }
  5781. }
  5782. if(inputString.startsWith("::")) {
  5783. stream.createFrame(103);
  5784. stream.writeWordBigEndian(inputString.length() - 1);
  5785. stream.writeString(inputString.substring(2));
  5786. } else {
  5787. String s = inputString.toLowerCase();
  5788. int j2 = 0;
  5789. if(s.startsWith("yellow:"))
  5790. {
  5791. j2 = 0;
  5792. inputString = inputString.substring(7);
  5793. } else if(s.startsWith("red:"))
  5794. {
  5795. j2 = 1;
  5796. inputString = inputString.substring(4);
  5797. } else if(s.startsWith("green:"))
  5798. {
  5799. j2 = 2;
  5800. inputString = inputString.substring(6);
  5801. } else if(s.startsWith("cyan:"))
  5802. {
  5803. j2 = 3;
  5804. inputString = inputString.substring(5);
  5805. } else if(s.startsWith("purple:"))
  5806. {
  5807. j2 = 4;
  5808. inputString = inputString.substring(7);
  5809. } else if(s.startsWith("white:"))
  5810. {
  5811. j2 = 5;
  5812. inputString = inputString.substring(6);
  5813. } else if(s.startsWith("flash1:"))
  5814. {
  5815. j2 = 6;
  5816. inputString = inputString.substring(7);
  5817. } else if(s.startsWith("flash2:"))
  5818. {
  5819. j2 = 7;
  5820. inputString = inputString.substring(7);
  5821. } else if(s.startsWith("flash3:"))
  5822. {
  5823. j2 = 8;
  5824. inputString = inputString.substring(7);
  5825. } else if(s.startsWith("glow1:"))
  5826. {
  5827. j2 = 9;
  5828. inputString = inputString.substring(6);
  5829. } else if(s.startsWith("glow2:"))
  5830. {
  5831. j2 = 10;
  5832. inputString = inputString.substring(6);
  5833. } else if(s.startsWith("glow3:"))
  5834. {
  5835. j2 = 11;
  5836. inputString = inputString.substring(6);
  5837. }
  5838. s = inputString.toLowerCase();
  5839. int i3 = 0;
  5840. if(s.startsWith("wave:"))
  5841. {
  5842. i3 = 1;
  5843. inputString = inputString.substring(5);
  5844. } else if(s.startsWith("wave2:"))
  5845. {
  5846. i3 = 2;
  5847. inputString = inputString.substring(6);
  5848. } else if(s.startsWith("shake:"))
  5849. {
  5850. i3 = 3;
  5851. inputString = inputString.substring(6);
  5852. } else if(s.startsWith("scroll:"))
  5853. {
  5854. i3 = 4;
  5855. inputString = inputString.substring(7);
  5856. } else if(s.startsWith("slide:"))
  5857. {
  5858. i3 = 5;
  5859. inputString = inputString.substring(6);
  5860. }
  5861. stream.createFrame(4);
  5862. stream.writeWordBigEndian(0);
  5863. int j3 = stream.currentOffset;
  5864. stream.method425(i3);
  5865. stream.method425(j2);
  5866. aStream_834.currentOffset = 0;
  5867. TextInput.method526(inputString, aStream_834);
  5868. stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  5869. stream.writeBytes(stream.currentOffset - j3);
  5870. inputString = TextInput.processText(inputString);
  5871. //inputString = Censor.doCensor(inputString);
  5872. myPlayer.textSpoken = inputString;
  5873. myPlayer.anInt1513 = j2;
  5874. myPlayer.anInt1531 = i3;
  5875. myPlayer.textCycle = 150;
  5876. if(myPrivilege == 2)
  5877. pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  5878. else
  5879. if(myPrivilege == 1)
  5880. pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  5881. else
  5882. if(myPrivilege == 4)
  5883. pushMessage(myPlayer.textSpoken, 2, "@cr4@" + myPlayer.name);
  5884. else
  5885. if(myPrivilege == 5)
  5886. pushMessage(myPlayer.textSpoken, 2, "@cr5@" + myPlayer.name);
  5887. else
  5888. if(myPrivilege == 6)
  5889. pushMessage(myPlayer.textSpoken, 2, "@cr6@" + myPlayer.name);
  5890. else
  5891. pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  5892. if(publicChatMode == 2)
  5893. {
  5894. publicChatMode = 3;
  5895. aBoolean1233 = true;
  5896. stream.createFrame(95);
  5897. stream.writeWordBigEndian(publicChatMode);
  5898. stream.writeWordBigEndian(privateChatMode);
  5899. stream.writeWordBigEndian(tradeMode);
  5900. }
  5901. }
  5902. inputString = "";
  5903. inputTaken = true;
  5904. }
  5905. }
  5906. } while(true);
  5907. }
  5908.  
  5909. private void buildPublicChat(int j)
  5910. {
  5911. int l = 0;
  5912. for(int i1 = 0; i1 < 500; i1++)
  5913. {
  5914. if(chatMessages[i1] == null)
  5915. continue;
  5916. if(chatTypeView != 1)
  5917. continue;
  5918. int j1 = chatTypes[i1];
  5919. String s = chatNames[i1];
  5920. String ct = chatMessages[i1];
  5921. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5922. if(k1 < -23)
  5923. break;
  5924. if(s != null && s.startsWith("@cr1@"))
  5925. s = s.substring(5);
  5926. if(s != null && s.startsWith("@cr2@"))
  5927. s = s.substring(5);
  5928. if(s != null && s.startsWith("@cr3@"))
  5929. s = s.substring(5);
  5930. if(s != null && s.startsWith("@cr4@"))
  5931. s = s.substring(5);
  5932. if(s != null && s.startsWith("@cr5@"))
  5933. s = s.substring(5);
  5934. if(s != null && s.startsWith("@cr6@"))
  5935. s = s.substring(5);
  5936. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5937. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5938. if(myPrivilege >= 1) {
  5939. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5940. menuActionID[menuActionRow] = 606;
  5941. menuActionRow++;
  5942. }
  5943. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5944. menuActionID[menuActionRow] = 42;
  5945. menuActionRow++;
  5946. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5947. menuActionID[menuActionRow] = 337;
  5948. menuActionRow++;
  5949. }
  5950. l++;
  5951. }
  5952. }
  5953. }
  5954.  
  5955. private void buildFriendChat(int j)
  5956. {
  5957. int l = 0;
  5958. for(int i1 = 0; i1 < 500; i1++) {
  5959. if(chatMessages[i1] == null)
  5960. continue;
  5961. if(chatTypeView != 2)
  5962. continue;
  5963. int j1 = chatTypes[i1];
  5964. String s = chatNames[i1];
  5965. String ct = chatMessages[i1];
  5966. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5967. if(k1 < -23)
  5968. break;
  5969. if(s != null && s.startsWith("@cr1@"))
  5970. s = s.substring(5);
  5971. if(s != null && s.startsWith("@cr2@"))
  5972. s = s.substring(5);
  5973. if(s != null && s.startsWith("@cr3@"))
  5974. s = s.substring(5);
  5975. if(s != null && s.startsWith("@cr4@"))
  5976. s = s.substring(5);
  5977. if(s != null && s.startsWith("@cr5@"))
  5978. s = s.substring(5);
  5979. if(s != null && s.startsWith("@cr6@"))
  5980. s = s.substring(5);
  5981. if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5982. l++;
  5983. if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5984. {
  5985. if(j > k1 - 14 && j <= k1) {
  5986. if(myPrivilege >= 1) {
  5987. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5988. menuActionID[menuActionRow] = 606;
  5989. menuActionRow++;
  5990. }
  5991. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5992. menuActionID[menuActionRow] = 42;
  5993. menuActionRow++;
  5994. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5995. menuActionID[menuActionRow] = 337;
  5996. menuActionRow++;
  5997. }
  5998. l++;
  5999. }
  6000. }
  6001. }
  6002.  
  6003. private void buildDuelorTrade(int j) {
  6004. int l = 0;
  6005. for(int i1 = 0; i1 < 500; i1++) {
  6006. if(chatMessages[i1] == null)
  6007. continue;
  6008. if(chatTypeView != 3 && chatTypeView != 4)
  6009. continue;
  6010. int j1 = chatTypes[i1];
  6011. String s = chatNames[i1];
  6012. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6013. if(k1 < -23)
  6014. break;
  6015. if(s != null && s.startsWith("@cr1@"))
  6016. s = s.substring(5);
  6017. if(s != null && s.startsWith("@cr2@"))
  6018. s = s.substring(5);
  6019. if(s != null && s.startsWith("@cr3@"))
  6020. s = s.substring(5);
  6021. if(s != null && s.startsWith("@cr4@"))
  6022. s = s.substring(5);
  6023. if(s != null && s.startsWith("@cr5@"))
  6024. s = s.substring(5);
  6025. if(s != null && s.startsWith("@cr6@"))
  6026. s = s.substring(5);
  6027. if(chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6028. if(j > k1 - 14 && j <= k1) {
  6029. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6030. menuActionID[menuActionRow] = 484;
  6031. menuActionRow++;
  6032. }
  6033. l++;
  6034. }
  6035. if(chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6036. if(j > k1 - 14 && j <= k1) {
  6037. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  6038. menuActionID[menuActionRow] = 6;
  6039. menuActionRow++;
  6040. }
  6041. l++;
  6042. }
  6043. if(j1 == 12) {
  6044. if(j > k1 - 14 && j <= k1) {
  6045. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  6046. menuActionID[menuActionRow] = 915;
  6047. menuActionRow++;
  6048. }
  6049. l++;
  6050. }
  6051. }
  6052. }
  6053.  
  6054. private void buildChatAreaMenu(int j) {
  6055. int l = 0;
  6056. int test = 0;
  6057. for(int i1 = 0; i1 < 500; i1++) {
  6058. if(chatMessages[i1] == null)
  6059. continue;
  6060. int j1 = chatTypes[i1];
  6061. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  6062. if(k1 < -23)
  6063. break;
  6064. String s = chatNames[i1];
  6065. String ct = chatMessages[i1];
  6066. boolean flag = false;
  6067. if(chatTypeView == 1) {
  6068. buildPublicChat(j);
  6069. break;
  6070. }
  6071. if(chatTypeView == 2) {
  6072. buildFriendChat(j);
  6073. break;
  6074. }
  6075. if(chatTypeView == 3 || chatTypeView == 4) {
  6076. buildDuelorTrade(j);
  6077. break;
  6078. }
  6079. if(chatTypeView == 5) {
  6080. break;
  6081. }
  6082. if(s != null && s.startsWith("@cr1@")) {
  6083. s = s.substring(5);
  6084. boolean flag1 = true;
  6085. byte byte0 = 1;
  6086. }
  6087. if(s != null && s.startsWith("@cr2@")) {
  6088. s = s.substring(5);
  6089. byte byte0 = 2;
  6090. }
  6091. if(s != null && s.startsWith("@cr3@")) {
  6092. s = s.substring(5);
  6093. byte byte0 = 3;
  6094. }
  6095. if(s != null && s.startsWith("@cr4@")) {
  6096. s = s.substring(5);
  6097. byte byte0 = 4;
  6098. }
  6099. if(s != null && s.startsWith("@cr5@")) {
  6100. s = s.substring(5);
  6101. byte byte0 = 5;
  6102. }
  6103. if(s != null && s.startsWith("@cr6@")) {
  6104. s = s.substring(5);
  6105. byte byte0 = 6;
  6106. }
  6107. if(j1 == 0)
  6108. l++;
  6109. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  6110. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  6111. if(myPrivilege >= 1) {
  6112. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6113. menuActionID[menuActionRow] = 606;
  6114. menuActionRow++;
  6115. }
  6116. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6117. menuActionID[menuActionRow] = 42;
  6118. menuActionRow++;
  6119. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6120. menuActionID[menuActionRow] = 337;
  6121. menuActionRow++;
  6122. }
  6123. l++;
  6124. }
  6125. if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  6126. if(j > k1 - 14 && j <= k1) {
  6127. if(myPrivilege >= 1) {
  6128. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  6129. menuActionID[menuActionRow] = 606;
  6130. menuActionRow++;
  6131. }
  6132. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  6133. menuActionID[menuActionRow] = 42;
  6134. menuActionRow++;
  6135. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  6136. menuActionID[menuActionRow] = 337;
  6137. menuActionRow++;
  6138. }
  6139. l++;
  6140. }
  6141. if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6142. if(j > k1 - 14 && j <= k1) {
  6143. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  6144. menuActionID[menuActionRow] = 484;
  6145. menuActionRow++;
  6146. }
  6147. l++;
  6148. }
  6149. if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  6150. l++;
  6151. if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  6152. if(j > k1 - 14 && j <= k1) {
  6153. menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  6154. menuActionID[menuActionRow] = 6;
  6155. menuActionRow++;
  6156. }
  6157. l++;
  6158. }
  6159. }
  6160. }
  6161.  
  6162.  
  6163.  
  6164. private void drawFriendsListOrWelcomeScreen(RSInterface class9)
  6165. {
  6166. int j = class9.contentType;
  6167. String[] skillNames = {
  6168. "Attack", "Hitpoints", "Mining", "Strength", "Agility", "Smithing", "Defence", "Herblore", "Fishing",
  6169. "Ranged", "Thieving", "Cooking", "Prayer", "Crafting", "Firemaking", "Magic", "Fletching", "Woodcutting",
  6170. "Runecrafting", "Slayer", "Farming", "Construction", "Hunter", "Summoning"
  6171. };
  6172. int[] skillIds = { 0, 3, 14, 2, 16, 13, 1, 15, 10, 4, 17, 7, 5, 12, 11, 6, 9, 8, 20, 18, 19, 21, 22, 23 };
  6173. int skillNumber = 0;
  6174. int skillsIdx = skillIds[skillNumber];
  6175. for (int X = 0; X < 24; X++) {
  6176. if (j == 1004+X) {
  6177. if (maxStats[skillNumber] < 99) {
  6178. class9.message = skillNames[skillNumber] + ": " + currentStats[skillsIdx] + "/" + maxStats[skillsIdx] + "\\nCurrent XP: " + currentExp[skillsIdx] + "\\nNext level: " + getXPForLevel(maxStats[skillsIdx] + 1) + "\\nRemainder: " + (getXPForLevel(maxStats[skillsIdx] + 1) - currentExp[skillsIdx]);
  6179. } else {
  6180. class9.message = skillNames[skillNumber] + ": " + currentStats[skillsIdx] + "/" + maxStats[skillsIdx] + "\\nCurrent XP: " + currentExp[skillsIdx];
  6181. }
  6182. }
  6183. skillNumber++;
  6184. if(skillsIdx < 23)
  6185. skillsIdx = skillIds[skillNumber];
  6186. }
  6187. if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  6188. {
  6189. if(j == 1 && anInt900 == 0)
  6190. {
  6191. class9.message = "Loading friend list";
  6192. class9.atActionType = 0;
  6193. return;
  6194. }
  6195. if(j == 1 && anInt900 == 1)
  6196. {
  6197. class9.message = "Connecting to friendserver";
  6198. class9.atActionType = 0;
  6199. return;
  6200. }
  6201. if(j == 2 && anInt900 != 2)
  6202. {
  6203. class9.message = "Please wait...";
  6204. class9.atActionType = 0;
  6205. return;
  6206. }
  6207. int k = friendsCount;
  6208. if(anInt900 != 2)
  6209. k = 0;
  6210. if(j > 700)
  6211. j -= 601;
  6212. else
  6213. j--;
  6214. if(j >= k)
  6215. {
  6216. class9.message = "";
  6217. class9.atActionType = 0;
  6218. return;
  6219. } else
  6220. {
  6221. class9.message = friendsList[j];
  6222. class9.atActionType = 1;
  6223. return;
  6224. }
  6225. }
  6226. if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  6227. {
  6228. int l = friendsCount;
  6229. if(anInt900 != 2)
  6230. l = 0;
  6231. if(j > 800)
  6232. j -= 701;
  6233. else
  6234. j -= 101;
  6235. if(j >= l)
  6236. {
  6237. class9.message = "";
  6238. class9.atActionType = 0;
  6239. return;
  6240. }
  6241. if(friendsNodeIDs[j] == 0)
  6242. class9.message = "@red@Offline";
  6243. else if(friendsNodeIDs[j] == nodeID)
  6244. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9)*/;
  6245. else
  6246. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9)*/;
  6247. class9.atActionType = 1;
  6248. return;
  6249. }
  6250. if(j == 203)
  6251. {
  6252. int i1 = friendsCount;
  6253. if(anInt900 != 2)
  6254. i1 = 0;
  6255. class9.scrollMax = i1 * 15 + 20;
  6256. if(class9.scrollMax <= class9.height)
  6257. class9.scrollMax = class9.height + 1;
  6258. return;
  6259. }
  6260. if(j >= 401 && j <= 500)
  6261. {
  6262. if((j -= 401) == 0 && anInt900 == 0)
  6263. {
  6264. class9.message = "Loading ignore list";
  6265. class9.atActionType = 0;
  6266. return;
  6267. }
  6268. if(j == 1 && anInt900 == 0)
  6269. {
  6270. class9.message = "Please wait...";
  6271. class9.atActionType = 0;
  6272. return;
  6273. }
  6274. int j1 = ignoreCount;
  6275. if(anInt900 == 0)
  6276. j1 = 0;
  6277. if(j >= j1)
  6278. {
  6279. class9.message = "";
  6280. class9.atActionType = 0;
  6281. return;
  6282. } else
  6283. {
  6284. class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  6285. class9.atActionType = 1;
  6286. return;
  6287. }
  6288. }
  6289. if(j == 503)
  6290. {
  6291. class9.scrollMax = ignoreCount * 15 + 20;
  6292. if(class9.scrollMax <= class9.height)
  6293. class9.scrollMax = class9.height + 1;
  6294. return;
  6295. }
  6296. if(j == 327)
  6297. {
  6298. class9.modelRotation1 = 150;
  6299. class9.modelRotation2 = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  6300. if(aBoolean1031)
  6301. {
  6302. for(int k1 = 0; k1 < 7; k1++)
  6303. {
  6304. int l1 = anIntArray1065[k1];
  6305. if(l1 >= 0 && !IDK.cache[l1].method537())
  6306. return;
  6307. }
  6308.  
  6309. aBoolean1031 = false;
  6310. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  6311. int i2 = 0;
  6312. for(int j2 = 0; j2 < 7; j2++)
  6313. {
  6314. int k2 = anIntArray1065[j2];
  6315. if(k2 >= 0)
  6316. aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2].method538();
  6317. }
  6318.  
  6319. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  6320. for(int l2 = 0; l2 < 5; l2++)
  6321. if(anIntArray990[l2] != 0)
  6322. {
  6323. model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6324. if(l2 == 1)
  6325. model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6326. }
  6327.  
  6328. model.method469();
  6329. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  6330. model.method479(64, 850, -30, -50, -30, true);
  6331. class9.anInt233 = 5;
  6332. class9.mediaID = 0;
  6333. RSInterface.method208(aBoolean994, model);
  6334. }
  6335. return;
  6336. }
  6337. if(j == 328) {
  6338. RSInterface rsInterface = class9;
  6339. int verticleTilt = 150;
  6340. int animationSpeed = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  6341. rsInterface.modelRotation1 = verticleTilt;
  6342. rsInterface.modelRotation2 = animationSpeed;
  6343. if(aBoolean1031) {
  6344. Model characterDisplay = myPlayer.method452();
  6345. for(int l2 = 0; l2 < 5; l2++)
  6346. if(anIntArray990[l2] != 0) {
  6347. characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  6348. if(l2 == 1)
  6349. characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  6350. }
  6351. int staticFrame = myPlayer.anInt1511;
  6352. characterDisplay.method469();
  6353. characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  6354. //characterDisplay.method479(64, 850, -30, -50, -30, true);
  6355. rsInterface.anInt233 = 5;
  6356. rsInterface.mediaID = 0;
  6357. RSInterface.method208(aBoolean994, characterDisplay);
  6358. }
  6359. return;
  6360. }
  6361. if(j == 324)
  6362. {
  6363. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  6364. {
  6365. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6366. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6367. }
  6368. if(aBoolean1047)
  6369. {
  6370. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6371. return;
  6372. } else
  6373. {
  6374. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6375. return;
  6376. }
  6377. }
  6378. if(j == 325)
  6379. {
  6380. if(aClass30_Sub2_Sub1_Sub1_931 == null)
  6381. {
  6382. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  6383. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  6384. }
  6385. if(aBoolean1047)
  6386. {
  6387. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  6388. return;
  6389. } else
  6390. {
  6391. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  6392. return;
  6393. }
  6394. }
  6395. if(j == 600)
  6396. {
  6397. class9.message = reportAbuseInput;
  6398. if(loopCycle % 20 < 10)
  6399. {
  6400. class9.message += "|";
  6401. return;
  6402. } else
  6403. {
  6404. class9.message += " ";
  6405. return;
  6406. }
  6407. }
  6408. if(j == 613)
  6409. if(myPrivilege >= 1)
  6410. {
  6411. if(canMute)
  6412. {
  6413. class9.textColor = 0xff0000;
  6414. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  6415. } else
  6416. {
  6417. class9.textColor = 0xffffff;
  6418. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  6419. }
  6420. } else
  6421. {
  6422. class9.message = "";
  6423. }
  6424. if(j == 650 || j == 655)
  6425. if(anInt1193 != 0)
  6426. {
  6427. String s;
  6428. if(daysSinceLastLogin == 0)
  6429. s = "earlier today";
  6430. else
  6431. if(daysSinceLastLogin == 1)
  6432. s = "yesterday";
  6433. else
  6434. s = daysSinceLastLogin + " days ago";
  6435. class9.message = "You last logged in " + s + " from: " + signlink.dns;
  6436. } else
  6437. {
  6438. class9.message = "";
  6439. }
  6440. if(j == 651)
  6441. {
  6442. if(unreadMessages == 0)
  6443. {
  6444. class9.message = "0 unread messages";
  6445. class9.textColor = 0xffff00;
  6446. }
  6447. if(unreadMessages == 1)
  6448. {
  6449. class9.message = "1 unread message";
  6450. class9.textColor = 65280;
  6451. }
  6452. if(unreadMessages > 1)
  6453. {
  6454. class9.message = unreadMessages + " unread messages";
  6455. class9.textColor = 65280;
  6456. }
  6457. }
  6458. if(j == 652)
  6459. if(daysSinceRecovChange == 201)
  6460. {
  6461. if(membersInt == 1)
  6462. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  6463. else
  6464. class9.message = "";
  6465. } else
  6466. if(daysSinceRecovChange == 200)
  6467. {
  6468. class9.message = "You have not yet set any password recovery questions.";
  6469. } else
  6470. {
  6471. String s1;
  6472. if(daysSinceRecovChange == 0)
  6473. s1 = "Earlier today";
  6474. else
  6475. if(daysSinceRecovChange == 1)
  6476. s1 = "Yesterday";
  6477. else
  6478. s1 = daysSinceRecovChange + " days ago";
  6479. class9.message = s1 + " you changed your recovery questions";
  6480. }
  6481. if(j == 653)
  6482. if(daysSinceRecovChange == 201)
  6483. {
  6484. if(membersInt == 1)
  6485. class9.message = "@whi@recommend you use a members world instead. You may use";
  6486. else
  6487. class9.message = "";
  6488. } else
  6489. if(daysSinceRecovChange == 200)
  6490. class9.message = "We strongly recommend you do so now to secure your account.";
  6491. else
  6492. class9.message = "If you do not remember making this change then cancel it immediately";
  6493. if(j == 654)
  6494. {
  6495. if(daysSinceRecovChange == 201)
  6496. if(membersInt == 1)
  6497. {
  6498. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  6499. return;
  6500. } else
  6501. {
  6502. class9.message = "";
  6503. return;
  6504. }
  6505. if(daysSinceRecovChange == 200)
  6506. {
  6507. class9.message = "Do this from the 'account management' area on our front webpage";
  6508. return;
  6509. }
  6510. class9.message = "Do this from the 'account management' area on our front webpage";
  6511. }
  6512. }
  6513.  
  6514. private void drawSplitPrivateChat()
  6515. {
  6516. if(splitPrivateChat == 0)
  6517. return;
  6518. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  6519. int i = 0;
  6520. if(anInt1104 != 0)
  6521. i = 1;
  6522. for(int j = 0; j < 100; j++)
  6523. if(chatMessages[j] != null)
  6524. {
  6525. int k = chatTypes[j];
  6526. String s = chatNames[j];
  6527. byte byte1 = 0;
  6528. if(s != null && s.startsWith("@cr1@"))
  6529. {
  6530. s = s.substring(5);
  6531. byte1 = 1;
  6532. }
  6533. if(s != null && s.startsWith("@cr2@"))
  6534. {
  6535. s = s.substring(5);
  6536. byte1 = 2;
  6537. }
  6538. if(s != null && s.startsWith("@cr4@"))
  6539. {
  6540. s = s.substring(5);
  6541. byte1 = 4;
  6542. }
  6543. if(s != null && s.startsWith("@cr5@"))
  6544. {
  6545. s = s.substring(5);
  6546. byte1 = 5;
  6547. }
  6548. if(s != null && s.startsWith("@cr6@"))
  6549. {
  6550. s = s.substring(5);
  6551. byte1 = 6;
  6552. }
  6553. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  6554. {
  6555. int l = 329 - i * 13;
  6556. int k1 = 4;
  6557. textDrawingArea.method385(0, "From", l, k1);
  6558. textDrawingArea.method385(65535, "From", l - 1, k1);
  6559. k1 += textDrawingArea.getTextWidth("From ");
  6560. if(byte1 == 1)
  6561. {
  6562. modIcons[0].drawBackground(k1, l - 12);
  6563. k1 += 12;
  6564. }
  6565. if(byte1 == 2)
  6566. {
  6567. modIcons[1].drawBackground(k1, l - 12);
  6568. k1 += 12;
  6569. }
  6570. if(byte1 == 3)
  6571. {
  6572. modIcons[1].drawBackground(k1, l - 12);
  6573. k1 += 12;
  6574. }
  6575. if(byte1 == 4)
  6576. {
  6577. modIcons[2].drawBackground(k1, l - 12);
  6578. k1 += 12;
  6579. }
  6580. if(byte1 == 5)
  6581. {
  6582. modIcons[3].drawBackground(k1, l - 12);
  6583. k1 += 12;
  6584. }
  6585. if(byte1 == 6)
  6586. {
  6587. modIcons[3].drawBackground(k1, l - 12);
  6588. k1 += 12;
  6589. }
  6590. textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  6591. textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  6592. if(++i >= 5)
  6593. return;
  6594. }
  6595. if(k == 5 && privateChatMode < 2)
  6596. {
  6597. int i1 = 329 - i * 13;
  6598. textDrawingArea.method385(0, chatMessages[j], i1, 4);
  6599. textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  6600. if(++i >= 5)
  6601. return;
  6602. }
  6603. if(k == 6 && privateChatMode < 2)
  6604. {
  6605. int j1 = 329 - i * 13;
  6606. textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  6607. textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  6608. if(++i >= 5)
  6609. return;
  6610. }
  6611. }
  6612.  
  6613. }
  6614.  
  6615. public void pushMessage(String s, int i, String s1) {
  6616. if(i == 0 && dialogID != -1) {
  6617. aString844 = s;
  6618. super.clickMode3 = 0;
  6619. }
  6620. if(backDialogID == -1)
  6621. inputTaken = true;
  6622. for(int j = 499; j > 0; j--) {
  6623. chatTypes[j] = chatTypes[j - 1];
  6624. chatNames[j] = chatNames[j - 1];
  6625. chatMessages[j] = chatMessages[j - 1];
  6626. chatRights[j] = chatRights[j - 1];
  6627. }
  6628. chatTypes[0] = i;
  6629. chatNames[0] = s1;
  6630. chatMessages[0] = s;
  6631. chatRights[0] = rights;
  6632. }
  6633.  
  6634. public static void setTab(int id) {
  6635. needDrawTabArea = true;
  6636. tabID = id;
  6637. tabAreaAltered = true;
  6638. }
  6639.  
  6640. public int tabHPos;
  6641. public void processTabClick() {
  6642. if(super.mouseX >= 745-24 && super.mouseX <= 745 && super.mouseY >= 3 && super.mouseY <= 25){
  6643. logHover = true;
  6644. } else {
  6645. logHover = false;
  6646. }
  6647. if(super.mouseX >= 521 && super.mouseX <= 550 && super.mouseY >= 169 && super.mouseY < 205) {
  6648. tabHPos = 0;
  6649. needDrawTabArea = true;
  6650. tabAreaAltered = true;
  6651. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 168 && super.mouseY < 205) {
  6652. tabHPos = 1;
  6653. needDrawTabArea = true;
  6654. tabAreaAltered = true;
  6655. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 168 && super.mouseY < 205) {
  6656. tabHPos = 2;
  6657. needDrawTabArea = true;
  6658. tabAreaAltered = true;
  6659. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 168 && super.mouseY < 203) {
  6660. tabHPos = 3;
  6661. needDrawTabArea = true;
  6662. tabAreaAltered = true;
  6663. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 168 && super.mouseY < 205) {
  6664. tabHPos = 4;
  6665. needDrawTabArea = true;
  6666. tabAreaAltered = true;
  6667. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 168 && super.mouseY < 205) {
  6668. tabHPos = 5;
  6669. needDrawTabArea = true;
  6670. tabAreaAltered = true;
  6671. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 169 && super.mouseY < 205) {
  6672. tabHPos = 6;
  6673. needDrawTabArea = true;
  6674. tabAreaAltered = true;
  6675. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 169 && super.mouseY < 205) {
  6676. tabHPos = 7;
  6677. needDrawTabArea = true;
  6678. tabAreaAltered = true;
  6679. } else if(super.mouseX >= 522 && super.mouseX <= 551 && super.mouseY >= 466 && super.mouseY < 503) {
  6680. tabHPos = 15;
  6681. needDrawTabArea = true;
  6682. tabAreaAltered = true;
  6683. } else if(super.mouseX >= 552 && super.mouseX <= 581 && super.mouseY >= 466 && super.mouseY < 503) {
  6684. tabHPos = 8;
  6685. needDrawTabArea = true;
  6686. tabAreaAltered = true;
  6687. } else if(super.mouseX >= 582 && super.mouseX <= 611 && super.mouseY >= 466 && super.mouseY < 503) {
  6688. tabHPos = 9;
  6689. needDrawTabArea = true;
  6690. tabAreaAltered = true;
  6691. } else if(super.mouseX >= 612 && super.mouseX <= 641 && super.mouseY >= 466 && super.mouseY < 503) {
  6692. tabHPos = 10;
  6693. needDrawTabArea = true;
  6694. tabAreaAltered = true;
  6695. } else if(super.mouseX >= 642 && super.mouseX <= 671 && super.mouseY >= 466 && super.mouseY < 503) {
  6696. tabHPos = 11;
  6697. needDrawTabArea = true;
  6698. tabAreaAltered = true;
  6699. } else if(super.mouseX >= 672 && super.mouseX <= 701 && super.mouseY >= 466 && super.mouseY < 503) {
  6700. tabHPos = 12;
  6701. needDrawTabArea = true;
  6702. tabAreaAltered = true;
  6703. } else if(super.mouseX >= 702 && super.mouseX <= 731 && super.mouseY >= 466 && super.mouseY < 502) {
  6704. tabHPos = 13;
  6705. needDrawTabArea = true;
  6706. tabAreaAltered = true;
  6707. } else if(super.mouseX >= 732 && super.mouseX <= 761 && super.mouseY >= 466 && super.mouseY < 502) {
  6708. tabHPos = 14;
  6709. needDrawTabArea = true;
  6710. tabAreaAltered = true;
  6711. } else {
  6712. tabHPos = -1;
  6713. needDrawTabArea = true;
  6714. tabAreaAltered = true;
  6715. }
  6716. if(super.clickMode3 == 1) {
  6717. if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1) {
  6718. needDrawTabArea = true;
  6719. tabID = 0;
  6720. tabAreaAltered = true;
  6721. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1) {
  6722. needDrawTabArea = true;
  6723. tabID = 1;
  6724. tabAreaAltered = true;
  6725. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1) {
  6726. needDrawTabArea = true;
  6727. tabID = 2;
  6728. tabAreaAltered = true;
  6729. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[14] != -1) {
  6730. needDrawTabArea = true;
  6731. tabID = 14;
  6732. tabAreaAltered = true;
  6733. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[3] != -1) {
  6734. needDrawTabArea = true;
  6735. tabID = 3;
  6736. tabAreaAltered = true;
  6737. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1) {
  6738. needDrawTabArea = true;
  6739. tabID = 4;
  6740. tabAreaAltered = true;
  6741. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1) {
  6742. needDrawTabArea = true;
  6743. tabID = 5;
  6744. tabAreaAltered = true;
  6745. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1) {
  6746. needDrawTabArea = true;
  6747. tabID = 6;
  6748. tabAreaAltered = true;
  6749. } else if(super.saveClickX >= 522 && super.saveClickX <= 551 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[16] != -1) {
  6750. needDrawTabArea = true;
  6751. tabID = 16;
  6752. tabAreaAltered = true;
  6753. } else if(super.saveClickX >= 552 && super.saveClickX <= 581 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1) {
  6754. needDrawTabArea = true;
  6755. tabID = 8;
  6756. tabAreaAltered = true;
  6757. } else if(super.saveClickX >= 582 && super.saveClickX <= 611 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1) {
  6758. needDrawTabArea = true;
  6759. tabID = 9;
  6760. tabAreaAltered = true;
  6761. } else if(super.saveClickX >= 612 && super.saveClickX <= 641 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1) {
  6762. needDrawTabArea = true;
  6763. tabID = 7;
  6764. tabAreaAltered = true;
  6765. } else if(super.saveClickX >= 642 && super.saveClickX <= 671 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1) {
  6766. needDrawTabArea = true;
  6767. tabID = 11;
  6768. tabAreaAltered = true;
  6769. } else if(super.saveClickX >= 672 && super.saveClickX <= 701 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1) {
  6770. needDrawTabArea = true;
  6771. tabID = 12;
  6772. tabAreaAltered = true;
  6773. } else if(super.saveClickX >= 702 && super.saveClickX <= 731 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1) {
  6774. needDrawTabArea = true;
  6775. tabID = 13;
  6776. tabAreaAltered = true;
  6777. } else if(super.saveClickX >= 732 && super.saveClickX <= 761 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[15] != -1) {
  6778. needDrawTabArea = true;
  6779. tabID = 15;
  6780. tabAreaAltered = true;
  6781. }
  6782. /* Logout X */
  6783. else if(super.saveClickX >= 728 && super.saveClickX <= 751 && super.saveClickY >= 3 && super.saveClickY < 27 && tabInterfaceIDs[10] != -1) {
  6784. needDrawTabArea = true;
  6785. tabID = 10;
  6786. tabAreaAltered = true;
  6787. }
  6788. }
  6789. }
  6790.  
  6791.  
  6792. public Sprite[] LOGOUT = new Sprite[5];
  6793. public Sprite[] ORBS = new Sprite[17];
  6794.  
  6795. public boolean logHover = false;
  6796. public void drawLogout(){
  6797. if(!logHover){
  6798. LOGOUT[0].drawSprite(212, 3);
  6799. } else {
  6800. LOGOUT[1].drawSprite(212, 3);
  6801. }
  6802. if(super.clickMode2 == 1 && super.mouseX >= 751-24 && super.mouseX <= 751 && super.mouseY >= 3 && super.mouseY <= 27){
  6803. LOGOUT[2].drawSprite(212, 3);
  6804. }
  6805. }
  6806.  
  6807. public int getOrbTextColor(int statusInt){
  6808. if(statusInt >= 75){
  6809. return 0x00FF00;
  6810. } else if(statusInt >= 50 && statusInt <= 74){
  6811. return 0xFFFF00;
  6812. } else if(statusInt >= 25 && statusInt <= 49){
  6813. return 0xFF981F;
  6814. } else {
  6815. return 0xFF0000;
  6816. }
  6817. }
  6818.  
  6819. public int getOrbFill(int statusInt){
  6820. if(statusInt <= 100 && statusInt >= 97) {
  6821. return 0;
  6822. } else if(statusInt <= 96 && statusInt >= 93) {
  6823. return 1;
  6824. } else if(statusInt <= 92 && statusInt >= 89) {
  6825. return 2;
  6826. } else if(statusInt <= 88 && statusInt >= 85) {
  6827. return 3;
  6828. } else if(statusInt <= 84 && statusInt >= 81) {
  6829. return 4;
  6830. } else if(statusInt <= 80 && statusInt >= 77) {
  6831. return 5;
  6832. } else if(statusInt <= 76 && statusInt >= 73) {
  6833. return 6;
  6834. } else if(statusInt <= 72 && statusInt >= 69) {
  6835. return 7;
  6836. } else if(statusInt <= 68 && statusInt >= 65) {
  6837. return 8;
  6838. } else if(statusInt <= 64 && statusInt >= 61) {
  6839. return 9;
  6840. } else if(statusInt <= 60 && statusInt >= 57) {
  6841. return 10;
  6842. } else if(statusInt <= 56 && statusInt >= 53) {
  6843. return 11;
  6844. } else if(statusInt <= 52 && statusInt >= 49) {
  6845. return 12;
  6846. } else if(statusInt <= 48 && statusInt >= 45) {
  6847. return 13;
  6848. } else if(statusInt <= 44 && statusInt >= 41) {
  6849. return 14;
  6850. } else if(statusInt <= 40 && statusInt >= 37) {
  6851. return 15;
  6852. } else if(statusInt <= 36 && statusInt >= 33) {
  6853. return 16;
  6854. } else if(statusInt <= 32 && statusInt >= 29) {
  6855. return 17;
  6856. } else if(statusInt <= 28 && statusInt >= 25) {
  6857. return 18;
  6858. } else if(statusInt <= 24 && statusInt >= 21) {
  6859. return 19;
  6860. } else if(statusInt <= 20 && statusInt >= 17) {
  6861. return 20;
  6862. } else if(statusInt <= 16 && statusInt >= 13) {
  6863. return 21;
  6864. } else if(statusInt <= 12 && statusInt >= 9) {
  6865. return 22;
  6866. } else if(statusInt <= 8 && statusInt >= 7) {
  6867. return 23;
  6868. } else if(statusInt <= 6 && statusInt >= 5) {
  6869. return 24;
  6870. } else if(statusInt <= 4 && statusInt >= 3) {
  6871. return 25;
  6872. } else if(statusInt <= 2 && statusInt >= 1) {
  6873. return 26;
  6874. } else if(statusInt <= 0) {
  6875. return 27;
  6876. }
  6877. return 0;
  6878. }
  6879.  
  6880. public void drawHP() {
  6881. int health;
  6882. String OrbDirectory = signlink.findcachedir()+"/Sprites/Gameframe/Orbs/";
  6883. String cHP = RSInterface.interfaceCache[4016].message; cHP = cHP.replaceAll("%","");
  6884. int currentHP = Integer.parseInt(cHP);
  6885. String mHP = RSInterface.interfaceCache[4017].message; mHP = mHP.replaceAll("%","");
  6886. int maxHP2 = Integer.parseInt(mHP);
  6887. health = (int)(((double)currentHP / (double)maxHP2) * 100D);
  6888. ORBS[0] = new Sprite(OrbDirectory+"ORBS 0.PNG", 27, getOrbFill(health));
  6889. ORBS[1].drawSprite(174, 14);
  6890. ORBS[2].drawSprite(177, 17);
  6891. ORBS[0].drawSprite(177, 17);
  6892. if(health <= 20){
  6893. if(loopCycle % 20 < 10){
  6894. ORBS[3].drawSprite(183, 25);
  6895. }
  6896. } else {
  6897. ORBS[3].drawSprite(183, 25);
  6898. }
  6899. int Y = 40;
  6900. smallText.method382(getOrbTextColor(health), 218, RSInterface.interfaceCache[4016].message, Y, true);
  6901. }
  6902.  
  6903. public void drawPrayer() {
  6904. int prayer;
  6905. String OD = signlink.findcachedir()+"/Sprites/Gameframe/Orbs/";
  6906. String cPR = RSInterface.interfaceCache[4012].message;
  6907. int currentPR = Integer.parseInt(cPR);
  6908. String mPR = RSInterface.interfaceCache[4013].message;
  6909. int maxPR2 = Integer.parseInt(mPR);
  6910. prayer = (int)(((double)currentPR / (double)maxPR2) * 100D);
  6911. ORBS[0] = new Sprite(OD+"ORBS 0.PNG", 27, getOrbFill(prayer));
  6912. if(!prayClicked){
  6913. if(prayHover){
  6914. ORBS[7].drawSprite(190, 53);
  6915. }else if(!prayHover){
  6916. ORBS[1].drawSprite(190, 53);
  6917. }
  6918. ORBS[4].drawSprite(193, 56);
  6919. } else if(prayClicked){
  6920. if(prayHover){
  6921. ORBS[7].drawSprite(190, 53);
  6922. } else if(!prayHover){
  6923. ORBS[1].drawSprite(190, 53);
  6924. }
  6925. ORBS[5].drawSprite(193, 56);
  6926. }
  6927. ORBS[0].drawSprite(194, 56);
  6928. if(prayer <= 25) {
  6929. if(loopCycle % 20 < 10) {
  6930. ORBS[6].drawSprite(197, 60);
  6931. }
  6932. } else {
  6933. ORBS[6].drawSprite(197, 60);
  6934. }
  6935. int Y = 79;
  6936. smallText.method382(getOrbTextColor(prayer), 234, RSInterface.interfaceCache[4012].message, Y, true);
  6937. }
  6938.  
  6939. public void drawRunOrb(){
  6940. String OD = signlink.findcachedir()+"/Sprites/Gameframe/Orbs/";
  6941. String cEn = RSInterface.interfaceCache[149].message; cEn = cEn.replaceAll("%","");
  6942. int currentEner = Integer.parseInt(cEn);
  6943. energy = (int)(((double)currentEner / 100) * 100D);
  6944. ORBS[0] = new Sprite(OD+"ORBS 0.PNG", 27, getOrbFill(energy));
  6945. if(!runClicked){
  6946. if(runHover){
  6947. ORBS[7].drawSprite(190, 92);
  6948. } else{
  6949. ORBS[1].drawSprite(190, 92);
  6950. }
  6951. ORBS[10].drawSprite(193, 95);
  6952. if(energy != 100){
  6953. ORBS[0].drawSprite(193, 95);
  6954. }
  6955. ORBS[8].drawSprite(199, 100);
  6956. } else {
  6957. if(runHover){
  6958. ORBS[7].drawSprite(190, 92);
  6959. } else {
  6960. ORBS[1].drawSprite(190, 92);
  6961. }
  6962. ORBS[11].drawSprite(193, 95);
  6963. if(energy != 100){
  6964. ORBS[0].drawSprite(193, 95);
  6965. }
  6966. ORBS[9].drawSprite(199, 100);
  6967. }
  6968. int Y = 117;
  6969. smallText.method382(getOrbTextColor(energy), 234, ""+energy, Y, true);
  6970. }
  6971.  
  6972.  
  6973. private void processXPCounterClick() {
  6974. int x = super.mouseX;
  6975. int y = super.mouseY;
  6976. if (xpCounterOn()) {
  6977. menuActionName[menuActionRow] = "Reset XP Total";
  6978. menuActionID[menuActionRow] = 475;
  6979. menuActionRow++;
  6980. menuActionName[menuActionRow] = "Toggle XP Total";
  6981. menuActionID[menuActionRow] = 474;
  6982. menuActionRow++;
  6983. }
  6984. }
  6985. public boolean xpCounterOn() {
  6986. if(super.clickMode3 == 1 && super.saveClickX >= 516 && super.saveClickX <= 550 && super.saveClickY >= 46 && super.saveClickY <= 80) {
  6987. if(!counterOn) {
  6988. counterOn = true;
  6989. drawCounterOnScreen();
  6990. } else {
  6991. counterOn = false;
  6992. }
  6993. }
  6994. if ((this.mouseX >= 516) && (this.mouseX <= 550) && (this.mouseY >= 50) && (this.mouseY < 85)) {
  6995. menuActionName[menuActionRow] = "Reset XP Total";
  6996. menuActionID[menuActionRow] = 475;
  6997. menuActionRow++;
  6998. menuActionName[menuActionRow] = "Toggle XP Total";
  6999. menuActionID[menuActionRow] = 474;
  7000. menuActionRow++;
  7001. }
  7002. return false;
  7003. }
  7004. public int xpAddedPos;
  7005. public int expAdded;
  7006. private void drawXPCounter()
  7007. {
  7008. int i = 1;
  7009. int j = 47;
  7010. int k = this.mouseX;
  7011. int m = this.mouseY;
  7012. if ((this.mouseX >= 516) && (this.mouseX <= 550) && (this.mouseY >= 50) && (this.mouseY < 85)) {
  7013. this.counter2.drawSprite(1, 50);
  7014. } else {
  7015. this.counter.drawSprite(1, 50);
  7016. }
  7017. }
  7018.  
  7019. private void drawCounterOnScreen()
  7020. {
  7021. int i = 520;
  7022. int j = 47;
  7023. this.counter3.drawSprite(387, 52);
  7024. int k = this.aTextDrawingArea_1271.getTextWidth(Integer.toString(this.xpCounter));
  7025. this.aTextDrawingArea_1271.drawText(16777215, "XP:", j + 18, i - 123);
  7026. this.aTextDrawingArea_1271.method385(16777215, Integer.toString(this.xpCounter), j + 18, i - 21 - k);
  7027. if (this.expAdded != 0) {
  7028. k = this.smallText.getTextWidth(new StringBuilder().append(Integer.toString(this.expAdded)).append("xp").toString());
  7029. counter4.drawSprite(i-12-k -50, j+18+xpAddedPos);
  7030. this.smallText.drawText(0xff9933, new StringBuilder().append(Integer.toString(this.expAdded)).append("xp").toString(), j + 21 + 18 + this.xpAddedPos, i - 12 - k);
  7031. this.xpAddedPos += 2;
  7032. if (this.xpAddedPos >= 50) {
  7033. this.xpAddedPos = 0;
  7034. this.expAdded = 0;
  7035. }
  7036. }
  7037. }
  7038. public void dontDrawCounterOnScreen() {
  7039. if((super.saveClickX >= 516 && super.saveClickX <= 550 && super.saveClickY >= 46 && super.saveClickY < 80)) {
  7040. counterOn = !counterOn == true;
  7041. }
  7042. }
  7043.  
  7044. public void drawXpOrb() {
  7045. if(super.mouseX >= 516 && super.mouseX <= 550 && super.mouseY >= 46 && super.mouseY <= 80){
  7046. xpHover = true;
  7047. } else {
  7048. xpHover = false;
  7049. }
  7050. if(super.clickMode3 == 1 && super.saveClickX >= 516 && super.saveClickX <= 550 && super.saveClickY >= 46 && super.saveClickY <= 80) {
  7051. if(!xpClicked) {
  7052. xpClicked = true;
  7053. drawXpBar = true;
  7054. } else {
  7055. xpClicked = false;
  7056. drawXpBar = false;
  7057. }
  7058. }
  7059. if(!xpClicked) {
  7060. if(!xpHover) {
  7061. XPcounterhover.drawSprite(0, 46);
  7062. } else {
  7063. XPcounter.drawSprite(0, 46);
  7064. }
  7065. } else {
  7066. if(!xpHover) {
  7067. XPcounterhover.drawSprite(0, 46);
  7068. } else {
  7069. XPcounter.drawSprite(0, 46);
  7070. }
  7071. }
  7072. }
  7073.  
  7074. private void resetImageProducers2() {
  7075. if(aRSImageProducer_1166 != null)
  7076. return;
  7077. nullLoader();
  7078. super.fullGameScreen = null;
  7079. aRSImageProducer_1107 = null;
  7080. aRSImageProducer_1108 = null;
  7081. aRSImageProducer_1109 = null;
  7082. aRSImageProducer_1110 = null;
  7083. aRSImageProducer_1111 = null;
  7084. aRSImageProducer_1112 = null;
  7085. aRSImageProducer_1113 = null;
  7086. aRSImageProducer_1114 = null;
  7087. aRSImageProducer_1115 = null;
  7088. aRSImageProducer_1166 = constructGraphicsBuffer(516, 165, getGameComponent());
  7089. aRSImageProducer_1164 = constructGraphicsBuffer(246, 168, getGameComponent());
  7090. DrawingArea.setAllPixelsToZero();
  7091. mapArea.drawSprite(0, 0);
  7092. aRSImageProducer_1163 = constructGraphicsBuffer(246, 335, getGameComponent());
  7093. aRSImageProducer_1165 = constructGraphicsBuffer(512, 334, getGameComponent());
  7094. DrawingArea.setAllPixelsToZero();
  7095. aRSImageProducer_1123 = constructGraphicsBuffer(496, 50, getGameComponent());
  7096. aRSImageProducer_1124 = constructGraphicsBuffer(269, 37, getGameComponent());
  7097. aRSImageProducer_1125 = constructGraphicsBuffer(249, 45, getGameComponent());
  7098. welcomeScreenRaised = true;
  7099. }
  7100.  
  7101. public String getDocumentBaseHost() {
  7102. if (signlink.mainapp != null) {
  7103. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  7104. }
  7105. if (super.gameFrame != null) {
  7106. return ""; // websitehere.com <- removed for Jframe to work
  7107. } else {
  7108. return ""; // super.getDocumentBase().getHost().toLowerCase() <- removed for Jframe to work
  7109. }
  7110. }
  7111.  
  7112. private void method81(Sprite sprite, int j, int k) {
  7113. int l = k * k + j * j;
  7114. if(l > 4225 && l < 0x15f90)
  7115. {
  7116. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  7117. int j1 = Model.modelIntArray1[i1];
  7118. int k1 = Model.modelIntArray2[i1];
  7119. j1 = (j1 * 256) / (minimapInt3 + 256);
  7120. k1 = (k1 * 256) / (minimapInt3 + 256);
  7121. int l1 = j * j1 + k * k1 >> 16;
  7122. int i2 = j * k1 - k * j1 >> 16;
  7123. double d = Math.atan2(l1, i2);
  7124. int j2 = (int)(Math.sin(d) * 63D);
  7125. int k2 = (int)(Math.cos(d) * 57D);
  7126. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  7127. } else
  7128. {
  7129. markMinimap(sprite, k, j);
  7130. }
  7131. }
  7132.  
  7133. private void rightClickChatButtons() {
  7134. if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  7135. menuActionName[1] = "View All";
  7136. menuActionID[1] = 999;
  7137. menuActionRow = 2;
  7138. } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  7139. menuActionName[1] = "View Game";
  7140. menuActionID[1] = 998;
  7141. menuActionRow = 2;
  7142. } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  7143. menuActionName[1] = "Hide public";
  7144. menuActionID[1] = 997;
  7145. menuActionName[2] = "Off public";
  7146. menuActionID[2] = 996;
  7147. menuActionName[3] = "Friends public";
  7148. menuActionID[3] = 995;
  7149. menuActionName[4] = "On public";
  7150. menuActionID[4] = 994;
  7151. menuActionName[5] = "View public";
  7152. menuActionID[5] = 993;
  7153. menuActionRow = 6;
  7154. } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  7155. menuActionName[1] = "Off private";
  7156. menuActionID[1] = 992;
  7157. menuActionName[2] = "Friends private";
  7158. menuActionID[2] = 991;
  7159. menuActionName[3] = "On private";
  7160. menuActionID[3] = 990;
  7161. menuActionName[4] = "View private";
  7162. menuActionID[4] = 989;
  7163. menuActionRow = 5;
  7164. } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  7165. menuActionName[1] = "Off clan chat";
  7166. menuActionID[1] = 1003;
  7167. menuActionName[2] = "Friends clan chat";
  7168. menuActionID[2] = 1002;
  7169. menuActionName[3] = "On clan chat";
  7170. menuActionID[3] = 1001;
  7171. menuActionName[4] = "View clan chat";
  7172. menuActionID[4] = 1000;
  7173. menuActionRow = 5;
  7174. } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  7175. menuActionName[1] = "Off trade";
  7176. menuActionID[1] = 987;
  7177. menuActionName[2] = "Friends trade";
  7178. menuActionID[2] = 986;
  7179. menuActionName[3] = "On trade";
  7180. menuActionID[3] = 985;
  7181. menuActionName[4] = "View trade";
  7182. menuActionID[4] = 984;
  7183. menuActionRow = 5;
  7184. }
  7185. }
  7186.  
  7187. public void processRightClick() {
  7188. if (activeInterfaceType != 0) {
  7189. return;
  7190. }
  7191. menuActionName[0] = "Back";
  7192. menuActionID[0] = 1107;
  7193. menuActionRow = 1;
  7194. if (fullscreenInterfaceID != -1) {
  7195. anInt886 = 0;
  7196. anInt1315 = 0;
  7197. buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  7198. if (anInt886 != anInt1026) {
  7199. anInt1026 = anInt886;
  7200. }
  7201. if (anInt1315 != anInt1129) {
  7202. anInt1129 = anInt1315;
  7203. }
  7204. return;
  7205. }
  7206. buildSplitPrivateChatMenu();
  7207. anInt886 = 0;
  7208. anInt1315 = 0;
  7209. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338) {
  7210. if (openInterfaceID != -1) {
  7211. buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  7212. } else {
  7213. build3dScreenMenu();
  7214. }
  7215. }
  7216. if (anInt886 != anInt1026) {
  7217. anInt1026 = anInt886;
  7218. }
  7219. if (anInt1315 != anInt1129) {
  7220. anInt1129 = anInt1315;
  7221. }
  7222. anInt886 = 0;
  7223. anInt1315 = 0;
  7224. if(super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468) {
  7225. if(invOverlayInterfaceID != -1) {
  7226. buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  7227. } else if(tabInterfaceIDs[tabID] != -1) {
  7228. buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  7229. }
  7230. }
  7231. if (anInt886 != anInt1048) {
  7232. needDrawTabArea = true;
  7233. tabAreaAltered = true;
  7234. anInt1048 = anInt886;
  7235. }
  7236. if (anInt1315 != anInt1044) {
  7237. needDrawTabArea = true;
  7238. tabAreaAltered = true;
  7239. anInt1044 = anInt1315;
  7240. }
  7241. processMinimapActions();
  7242. anInt886 = 0;
  7243. anInt1315 = 0;
  7244. if(super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  7245. if(backDialogID != -1) {
  7246. buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  7247. } else if(super.mouseY < 463 && super.mouseX < 490) {
  7248. buildChatAreaMenu(super.mouseY - 338);
  7249. }
  7250. }
  7251. if (backDialogID != -1 && anInt886 != anInt1039) {
  7252. inputTaken = true;
  7253. anInt1039 = anInt886;
  7254. }
  7255. if (backDialogID != -1 && anInt1315 != anInt1500) {
  7256. inputTaken = true;
  7257. anInt1500 = anInt1315;
  7258. }
  7259. /* Enable custom right click areas */
  7260. if(super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 && super.mouseY < 503)
  7261. rightClickChatButtons();
  7262. /**/
  7263. boolean flag = false;
  7264. while (!flag) {
  7265. flag = true;
  7266. for (int j = 0; j < menuActionRow - 1; j++) {
  7267. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  7268. String s = menuActionName[j];
  7269. menuActionName[j] = menuActionName[j + 1];
  7270. menuActionName[j + 1] = s;
  7271. int k = menuActionID[j];
  7272. menuActionID[j] = menuActionID[j + 1];
  7273. menuActionID[j + 1] = k;
  7274. k = menuActionCmd2[j];
  7275. menuActionCmd2[j] = menuActionCmd2[j + 1];
  7276. menuActionCmd2[j + 1] = k;
  7277. k = menuActionCmd3[j];
  7278. menuActionCmd3[j] = menuActionCmd3[j + 1];
  7279. menuActionCmd3[j + 1] = k;
  7280. k = menuActionCmd4[j];
  7281. menuActionCmd4[j] = menuActionCmd4[j + 1];
  7282. menuActionCmd4[j + 1] = k;
  7283. k = menuActionCmd1[j];
  7284. menuActionCmd1[j] = menuActionCmd1[j + 1];
  7285. menuActionCmd1[j + 1] = k;
  7286. flag = false;
  7287. }
  7288. }
  7289. }
  7290. }
  7291.  
  7292. private int method83(int i, int j, int k)
  7293. {
  7294. int l = 256 - k;
  7295. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  7296. }
  7297.  
  7298. private void login(String s, String s1, boolean flag)
  7299. {
  7300. signlink.errorname = s;
  7301. try
  7302. {
  7303. if(!flag)
  7304. {
  7305. loginMessage1 = "";
  7306. loginMessage2 = "Connecting to server...";
  7307. drawLoginScreen(true);
  7308. }
  7309. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  7310. long l = TextClass.longForName(s);
  7311. int i = (int)(l >> 16 & 31L);
  7312. stream.currentOffset = 0;
  7313. stream.writeWordBigEndian(14);
  7314. stream.writeWordBigEndian(i);
  7315. socketStream.queueBytes(2, stream.buffer);
  7316. for(int j = 0; j < 8; j++)
  7317. socketStream.read();
  7318.  
  7319. int k = socketStream.read();
  7320. int i1 = k;
  7321. if(k == 0)
  7322. {
  7323. socketStream.flushInputStream(inStream.buffer, 8);
  7324. inStream.currentOffset = 0;
  7325. aLong1215 = inStream.readQWord();
  7326. int ai[] = new int[4];
  7327. ai[0] = (int)(Math.random() * 99999999D);
  7328. ai[1] = (int)(Math.random() * 99999999D);
  7329. ai[2] = (int)(aLong1215 >> 32);
  7330. ai[3] = (int)aLong1215;
  7331. stream.currentOffset = 0;
  7332. stream.writeWordBigEndian(10);
  7333. stream.writeDWord(ai[0]);
  7334. stream.writeDWord(ai[1]);
  7335. stream.writeDWord(ai[2]);
  7336. stream.writeDWord(ai[3]);
  7337. stream.writeDWord(/*signlink.uid*/999999);
  7338. stream.writeString(s);
  7339. stream.writeString(s1);
  7340. stream.doKeys();
  7341. aStream_847.currentOffset = 0;
  7342. if(flag)
  7343. aStream_847.writeWordBigEndian(18);
  7344. else
  7345. aStream_847.writeWordBigEndian(16);
  7346. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  7347. aStream_847.writeWordBigEndian(255);
  7348. aStream_847.writeWord(317);
  7349. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  7350. for(int l1 = 0; l1 < 9; l1++)
  7351. aStream_847.writeDWord(expectedCRCs[l1]);
  7352.  
  7353. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  7354. stream.encryption = new ISAACRandomGen(ai);
  7355. for(int j2 = 0; j2 < 4; j2++)
  7356. ai[j2] += 50;
  7357.  
  7358. encryption = new ISAACRandomGen(ai);
  7359. socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  7360. k = socketStream.read();
  7361. }
  7362. if(k == 1)
  7363. {
  7364. try
  7365. {
  7366. Thread.sleep(2000L);
  7367. }
  7368. catch(Exception _ex) { }
  7369. login(s, s1, flag);
  7370. return;
  7371. }
  7372. if(k == 2)
  7373. {
  7374. myPrivilege = socketStream.read();
  7375. flagged = socketStream.read() == 1;
  7376. aLong1220 = 0L;
  7377. anInt1022 = 0;
  7378. mouseDetection.coordsIndex = 0;
  7379. super.awtFocus = true;
  7380. aBoolean954 = true;
  7381. loggedIn = true;
  7382. stream.currentOffset = 0;
  7383. inStream.currentOffset = 0;
  7384. pktType = -1;
  7385. anInt841 = -1;
  7386. anInt842 = -1;
  7387. anInt843 = -1;
  7388. pktSize = 0;
  7389. anInt1009 = 0;
  7390. anInt1104 = 0;
  7391. anInt1011 = 0;
  7392. anInt855 = 0;
  7393. menuActionRow = 0;
  7394. menuOpen = false;
  7395. super.idleTime = 0;
  7396. for(int j1 = 0; j1 < 100; j1++)
  7397. chatMessages[j1] = null;
  7398.  
  7399. itemSelected = 0;
  7400. spellSelected = 0;
  7401. loadingStage = 0;
  7402. anInt1062 = 0;
  7403. anInt1278 = (int)(Math.random() * 100D) - 50;
  7404. anInt1131 = (int)(Math.random() * 110D) - 55;
  7405. anInt896 = (int)(Math.random() * 80D) - 40;
  7406. minimapInt2 = (int)(Math.random() * 120D) - 60;
  7407. minimapInt3 = (int)(Math.random() * 30D) - 20;
  7408. minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
  7409. anInt1021 = 0;
  7410. anInt985 = -1;
  7411. destX = 0;
  7412. destY = 0;
  7413. playerCount = 0;
  7414. npcCount = 0;
  7415. for(int i2 = 0; i2 < maxPlayers; i2++)
  7416. {
  7417. playerArray[i2] = null;
  7418. aStreamArray895s[i2] = null;
  7419. }
  7420.  
  7421. for(int k2 = 0; k2 < 16384; k2++)
  7422. npcArray[k2] = null;
  7423.  
  7424. myPlayer = playerArray[myPlayerIndex] = new Player();
  7425. aClass19_1013.removeAll();
  7426. aClass19_1056.removeAll();
  7427. for(int l2 = 0; l2 < 4; l2++)
  7428. {
  7429. for(int i3 = 0; i3 < 104; i3++)
  7430. {
  7431. for(int k3 = 0; k3 < 104; k3++)
  7432. groundArray[l2][i3][k3] = null;
  7433.  
  7434. }
  7435.  
  7436. }
  7437.  
  7438. aClass19_1179 = new NodeList();
  7439. fullscreenInterfaceID = -1;
  7440. anInt900 = 0;
  7441. friendsCount = 0;
  7442. dialogID = -1;
  7443. backDialogID = -1;
  7444. openInterfaceID = -1;
  7445. invOverlayInterfaceID = -1;
  7446. anInt1018 = -1;
  7447. aBoolean1149 = false;
  7448. tabID = 3;
  7449. inputDialogState = 0;
  7450. menuOpen = false;
  7451. messagePromptRaised = false;
  7452. aString844 = null;
  7453. anInt1055 = 0;
  7454. anInt1054 = -1;
  7455. aBoolean1047 = true;
  7456. method45();
  7457. for(int j3 = 0; j3 < 5; j3++)
  7458. anIntArray990[j3] = 0;
  7459.  
  7460. for(int l3 = 0; l3 < 5; l3++)
  7461. {
  7462. atPlayerActions[l3] = null;
  7463. atPlayerArray[l3] = false;
  7464. }
  7465.  
  7466. anInt1175 = 0;
  7467. anInt1134 = 0;
  7468. anInt986 = 0;
  7469. anInt1288 = 0;
  7470. anInt924 = 0;
  7471. anInt1188 = 0;
  7472. anInt1155 = 0;
  7473. anInt1226 = 0;
  7474. int anInt941 = 0;
  7475. int anInt1260 = 0;
  7476. resetImageProducers2();
  7477. return;
  7478. }
  7479. if(k == 3)
  7480. {
  7481. loginMessage1 = "";
  7482. loginMessage2 = "Invalid username or password.";
  7483. return;
  7484. }
  7485. if(k == 4)
  7486. {
  7487. loginMessage1 = "Your account has been disabled.";
  7488. loginMessage2 = "Please check your message-center for details.";
  7489. return;
  7490. }
  7491. if(k == 5)
  7492. {
  7493. loginMessage1 = "Your account is already logged in.";
  7494. loginMessage2 = "Try again in 60 secs...";
  7495. return;
  7496. }
  7497. if(k == 6)
  7498. {
  7499. loginMessage1 = "Project Insanity has been updated!";
  7500. loginMessage2 = "Please reload this page.";
  7501. return;
  7502. }
  7503. if(k == 7)
  7504. {
  7505. loginMessage1 = "This world is full.";
  7506. loginMessage2 = "Please use a different world.";
  7507. return;
  7508. }
  7509. if(k == 8)
  7510. {
  7511. loginMessage1 = "Unable to connect.";
  7512. loginMessage2 = "Login server offline.";
  7513. return;
  7514. }
  7515. if(k == 9)
  7516. {
  7517. loginMessage1 = "Login limit exceeded.";
  7518. loginMessage2 = "Too many connections from your address.";
  7519. return;
  7520. }
  7521. if(k == 10)
  7522. {
  7523. loginMessage1 = "Unable to connect.";
  7524. loginMessage2 = "Bad session id.";
  7525. return;
  7526. }
  7527. if(k == 11)
  7528. {
  7529. loginMessage2 = "Login server rejected session.";
  7530. loginMessage2 = "Please try again.";
  7531. return;
  7532. }
  7533. if(k == 12)
  7534. {
  7535. loginMessage1 = "You need a members account to login to this world.";
  7536. loginMessage2 = "Please subscribe, or use a different world.";
  7537. return;
  7538. }
  7539. if(k == 13)
  7540. {
  7541. loginMessage1 = "Could not complete login.";
  7542. loginMessage2 = "Please try using a different world.";
  7543. return;
  7544. }
  7545. if(k == 14)
  7546. {
  7547. loginMessage1 = "The server is being updated.";
  7548. loginMessage2 = "Please wait 1 minute and try again.";
  7549. return;
  7550. }
  7551. if(k == 15)
  7552. {
  7553. loggedIn = true;
  7554. stream.currentOffset = 0;
  7555. inStream.currentOffset = 0;
  7556. pktType = -1;
  7557. anInt841 = -1;
  7558. anInt842 = -1;
  7559. anInt843 = -1;
  7560. pktSize = 0;
  7561. anInt1009 = 0;
  7562. anInt1104 = 0;
  7563. menuActionRow = 0;
  7564. menuOpen = false;
  7565. aLong824 = System.currentTimeMillis();
  7566. return;
  7567. }
  7568. if(k == 16)
  7569. {
  7570. loginMessage1 = "Login attempts exceeded.";
  7571. loginMessage2 = "Please wait 1 minute and try again.";
  7572. return;
  7573. }
  7574. if(k == 17)
  7575. {
  7576. loginMessage1 = "You are standing in a members-only area.";
  7577. loginMessage2 = "To play on this world move to a free area first";
  7578. return;
  7579. }
  7580. if(k == 20)
  7581. {
  7582. loginMessage1 = "Invalid loginserver requested";
  7583. loginMessage2 = "Please try using a different world.";
  7584. return;
  7585. }
  7586. if(k == 21)
  7587. {
  7588. for(int k1 = socketStream.read(); k1 >= 0; k1--)
  7589. {
  7590. loginMessage1 = "You have only just left another world";
  7591. loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  7592. drawLoginScreen(true);
  7593. try
  7594. {
  7595. Thread.sleep(1000L);
  7596. }
  7597. catch(Exception _ex) { }
  7598. }
  7599.  
  7600. login(s, s1, flag);
  7601. return;
  7602. }
  7603. if (myUsername.length() < 1) {
  7604. loginMessage2 = "Please enter a valid username";
  7605. return;
  7606. } else if (myPassword.length() < 1) {
  7607. loginMessage2 = "Please enter a valid password";
  7608. return;
  7609. }
  7610. if(k == -1)
  7611. {
  7612. if(i1 == 0)
  7613. {
  7614. if(loginFailures < 2)
  7615. {
  7616. try
  7617. {
  7618. Thread.sleep(2000L);
  7619. }
  7620. catch(Exception _ex) { }
  7621. loginFailures++;
  7622. login(s, s1, flag);
  7623. return;
  7624. } else
  7625. {
  7626. loginMessage1 = "No response from loginserver";
  7627. loginMessage2 = "Please wait 1 minute and try again.";
  7628. return;
  7629. }
  7630. } else
  7631. {
  7632. loginMessage1 = "No response from server";
  7633. loginMessage2 = "Please try using a different world.";
  7634. return;
  7635. }
  7636. } else
  7637. {
  7638. System.out.println("response:" + k);
  7639. loginMessage1 = "Unexpected server response";
  7640. loginMessage2 = "Please try using a different world.";
  7641. return;
  7642. }
  7643. }
  7644. catch(IOException _ex)
  7645. {
  7646. loginMessage1 = "";
  7647. }
  7648. loginMessage2 = "Error connecting to server.";
  7649. }
  7650.  
  7651. 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) {
  7652. byte byte0 = 104;
  7653. byte byte1 = 104;
  7654. for(int l2 = 0; l2 < byte0; l2++) {
  7655. for(int i3 = 0; i3 < byte1; i3++) {
  7656. anIntArrayArray901[l2][i3] = 0;
  7657. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  7658. }
  7659. }
  7660. int j3 = j2;
  7661. int k3 = j1;
  7662. anIntArrayArray901[j2][j1] = 99;
  7663. anIntArrayArray825[j2][j1] = 0;
  7664. int l3 = 0;
  7665. int i4 = 0;
  7666. bigX[l3] = j2;
  7667. bigY[l3++] = j1;
  7668. boolean flag1 = false;
  7669. int j4 = bigX.length;
  7670. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  7671. while(i4 != l3)
  7672. {
  7673. j3 = bigX[i4];
  7674. k3 = bigY[i4];
  7675. i4 = (i4 + 1) % j4;
  7676. if(j3 == k2 && k3 == i2)
  7677. {
  7678. flag1 = true;
  7679. break;
  7680. }
  7681. if(i1 != 0)
  7682. {
  7683. if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  7684. {
  7685. flag1 = true;
  7686. break;
  7687. }
  7688. if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  7689. {
  7690. flag1 = true;
  7691. break;
  7692. }
  7693. }
  7694. if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  7695. {
  7696. flag1 = true;
  7697. break;
  7698. }
  7699. int l4 = anIntArrayArray825[j3][k3] + 1;
  7700. if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  7701. {
  7702. bigX[l3] = j3 - 1;
  7703. bigY[l3] = k3;
  7704. l3 = (l3 + 1) % j4;
  7705. anIntArrayArray901[j3 - 1][k3] = 2;
  7706. anIntArrayArray825[j3 - 1][k3] = l4;
  7707. }
  7708. if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  7709. {
  7710. bigX[l3] = j3 + 1;
  7711. bigY[l3] = k3;
  7712. l3 = (l3 + 1) % j4;
  7713. anIntArrayArray901[j3 + 1][k3] = 8;
  7714. anIntArrayArray825[j3 + 1][k3] = l4;
  7715. }
  7716. if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  7717. {
  7718. bigX[l3] = j3;
  7719. bigY[l3] = k3 - 1;
  7720. l3 = (l3 + 1) % j4;
  7721. anIntArrayArray901[j3][k3 - 1] = 1;
  7722. anIntArrayArray825[j3][k3 - 1] = l4;
  7723. }
  7724. if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  7725. {
  7726. bigX[l3] = j3;
  7727. bigY[l3] = k3 + 1;
  7728. l3 = (l3 + 1) % j4;
  7729. anIntArrayArray901[j3][k3 + 1] = 4;
  7730. anIntArrayArray825[j3][k3 + 1] = l4;
  7731. }
  7732. 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)
  7733. {
  7734. bigX[l3] = j3 - 1;
  7735. bigY[l3] = k3 - 1;
  7736. l3 = (l3 + 1) % j4;
  7737. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  7738. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  7739. }
  7740. 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)
  7741. {
  7742. bigX[l3] = j3 + 1;
  7743. bigY[l3] = k3 - 1;
  7744. l3 = (l3 + 1) % j4;
  7745. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  7746. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  7747. }
  7748. 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)
  7749. {
  7750. bigX[l3] = j3 - 1;
  7751. bigY[l3] = k3 + 1;
  7752. l3 = (l3 + 1) % j4;
  7753. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  7754. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  7755. }
  7756. 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)
  7757. {
  7758. bigX[l3] = j3 + 1;
  7759. bigY[l3] = k3 + 1;
  7760. l3 = (l3 + 1) % j4;
  7761. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  7762. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  7763. }
  7764. }
  7765. anInt1264 = 0;
  7766. if(!flag1)
  7767. {
  7768. if(flag)
  7769. {
  7770. int i5 = 100;
  7771. for(int k5 = 1; k5 < 2; k5++)
  7772. {
  7773. for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  7774. {
  7775. for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  7776. if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  7777. {
  7778. i5 = anIntArrayArray825[i6][l6];
  7779. j3 = i6;
  7780. k3 = l6;
  7781. anInt1264 = 1;
  7782. flag1 = true;
  7783. }
  7784.  
  7785. }
  7786.  
  7787. if(flag1)
  7788. break;
  7789. }
  7790.  
  7791. }
  7792. if(!flag1)
  7793. return false;
  7794. }
  7795. i4 = 0;
  7796. bigX[i4] = j3;
  7797. bigY[i4++] = k3;
  7798. int l5;
  7799. for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  7800. {
  7801. if(j5 != l5)
  7802. {
  7803. l5 = j5;
  7804. bigX[i4] = j3;
  7805. bigY[i4++] = k3;
  7806. }
  7807. if((j5 & 2) != 0)
  7808. j3++;
  7809. else
  7810. if((j5 & 8) != 0)
  7811. j3--;
  7812. if((j5 & 1) != 0)
  7813. k3++;
  7814. else
  7815. if((j5 & 4) != 0)
  7816. k3--;
  7817. }
  7818. // if(cancelWalk) { return i4 > 0; }
  7819.  
  7820.  
  7821. if(i4 > 0)
  7822. {
  7823. int k4 = i4;
  7824. if(k4 > 25)
  7825. k4 = 25;
  7826. i4--;
  7827. int k6 = bigX[i4];
  7828. int i7 = bigY[i4];
  7829. anInt1288 += k4;
  7830. if(anInt1288 >= 92)
  7831. {
  7832. stream.createFrame(36);
  7833. stream.writeDWord(0);
  7834. anInt1288 = 0;
  7835. }
  7836. if(i == 0)
  7837. {
  7838. stream.createFrame(164);
  7839. stream.writeWordBigEndian(k4 + k4 + 3);
  7840. }
  7841. if(i == 1)
  7842. {
  7843. stream.createFrame(248);
  7844. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  7845. }
  7846. if(i == 2)
  7847. {
  7848. stream.createFrame(98);
  7849. stream.writeWordBigEndian(k4 + k4 + 3);
  7850. }
  7851. stream.method433(k6 + baseX);
  7852. destX = bigX[0];
  7853. destY = bigY[0];
  7854. for(int j7 = 1; j7 < k4; j7++)
  7855. {
  7856. i4--;
  7857. stream.writeWordBigEndian(bigX[i4] - k6);
  7858. stream.writeWordBigEndian(bigY[i4] - i7);
  7859. }
  7860.  
  7861. stream.method431(i7 + baseY);
  7862. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  7863. return true;
  7864. }
  7865. return i != 1;
  7866. }
  7867.  
  7868. private void method86(Stream stream)
  7869. {
  7870. for(int j = 0; j < anInt893; j++)
  7871. {
  7872. int k = anIntArray894[j];
  7873. NPC npc = npcArray[k];
  7874. int l = stream.readUnsignedByte();
  7875. if((l & 0x10) != 0)
  7876. {
  7877. int i1 = stream.method434();
  7878. if(i1 == 65535)
  7879. i1 = -1;
  7880. int i2 = stream.readUnsignedByte();
  7881. if(i1 == npc.anim && i1 != -1)
  7882. {
  7883. int l2 = Animation.anims[i1].anInt365;
  7884. if(l2 == 1)
  7885. {
  7886. npc.anInt1527 = 0;
  7887. npc.anInt1528 = 0;
  7888. npc.anInt1529 = i2;
  7889. npc.anInt1530 = 0;
  7890. }
  7891. if(l2 == 2)
  7892. npc.anInt1530 = 0;
  7893. } else
  7894. if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  7895. {
  7896. npc.anim = i1;
  7897. npc.anInt1527 = 0;
  7898. npc.anInt1528 = 0;
  7899. npc.anInt1529 = i2;
  7900. npc.anInt1530 = 0;
  7901. npc.anInt1542 = npc.smallXYIndex;
  7902. }
  7903. }
  7904. if ((l & 8) != 0)
  7905. {
  7906. int j1 = stream.method426();
  7907. int j2 = stream.method427();
  7908. int type1 = stream.readUnsignedByte();
  7909. npc.updateHitData(j2, j1, type1, loopCycle);
  7910. npc.loopCycleStatus = loopCycle + 300;
  7911. npc.currentHealth = stream.method426();
  7912. npc.maxHealth = stream.readUnsignedByte();
  7913. }
  7914. if((l & 0x80) != 0)
  7915. {
  7916. npc.anInt1520 = stream.readUnsignedWord();
  7917. int k1 = stream.readDWord();
  7918. npc.anInt1524 = k1 >> 16;
  7919. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  7920. npc.anInt1521 = 0;
  7921. npc.anInt1522 = 0;
  7922. if(npc.anInt1523 > loopCycle)
  7923. npc.anInt1521 = -1;
  7924. if(npc.anInt1520 == 65535)
  7925. npc.anInt1520 = -1;
  7926. }
  7927. if((l & 0x20) != 0)
  7928. {
  7929. npc.interactingEntity = stream.readUnsignedWord();
  7930. if(npc.interactingEntity == 65535)
  7931. npc.interactingEntity = -1;
  7932. }
  7933. if((l & 1) != 0)
  7934. {
  7935. npc.textSpoken = stream.readString();
  7936. npc.textCycle = 100;
  7937. // entityMessage(npc);
  7938.  
  7939. }
  7940. if ((l & 0x40) != 0) {
  7941. int l1 = stream.method427();
  7942. int k2 = stream.method428();
  7943. int type2 = stream.readUnsignedByte();
  7944. npc.updateHitData(k2, l1, type2, loopCycle);
  7945. npc.loopCycleStatus = loopCycle + 300;
  7946. npc.currentHealth = stream.method428();
  7947. npc.maxHealth = stream.method427();
  7948. }
  7949. if((l & 2) != 0)
  7950. {
  7951. npc.desc = EntityDef.forID(stream.method436());
  7952. npc.anInt1540 = npc.desc.aByte68;
  7953. npc.anInt1504 = npc.desc.anInt79;
  7954. npc.anInt1554 = npc.desc.walkAnim;
  7955. npc.anInt1555 = npc.desc.anInt58;
  7956. npc.anInt1556 = npc.desc.anInt83;
  7957. npc.anInt1557 = npc.desc.anInt55;
  7958. npc.anInt1511 = npc.desc.standAnim;
  7959. }
  7960. if((l & 4) != 0)
  7961. {
  7962. npc.anInt1538 = stream.method434();
  7963. npc.anInt1539 = stream.method434();
  7964. }
  7965. }
  7966. }
  7967.  
  7968. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  7969. {
  7970. if(menuActionRow >= 400)
  7971. return;
  7972. if(entityDef.childrenIDs != null)
  7973. entityDef = entityDef.method161();
  7974. if(entityDef == null)
  7975. return;
  7976. if(!entityDef.aBoolean84)
  7977. return;
  7978. String s = entityDef.name;
  7979. if(entityDef.combatLevel != 0)
  7980. s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  7981. if(itemSelected == 1)
  7982. {
  7983. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  7984. menuActionID[menuActionRow] = 582;
  7985. menuActionCmd1[menuActionRow] = i;
  7986. menuActionCmd2[menuActionRow] = k;
  7987. menuActionCmd3[menuActionRow] = j;
  7988. menuActionRow++;
  7989. return;
  7990. }
  7991. if(spellSelected == 1)
  7992. {
  7993. if((spellUsableOn & 2) == 2)
  7994. {
  7995. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  7996. menuActionID[menuActionRow] = 413;
  7997. menuActionCmd1[menuActionRow] = i;
  7998. menuActionCmd2[menuActionRow] = k;
  7999. menuActionCmd3[menuActionRow] = j;
  8000. menuActionRow++;
  8001. }
  8002. } else
  8003. {
  8004. if(entityDef.actions != null)
  8005. {
  8006. for(int l = 4; l >= 0; l--)
  8007. if(entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack"))
  8008. {
  8009. menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  8010. if(l == 0)
  8011. menuActionID[menuActionRow] = 20;
  8012. if(l == 1)
  8013. menuActionID[menuActionRow] = 412;
  8014. if(l == 2)
  8015. menuActionID[menuActionRow] = 225;
  8016. if(l == 3)
  8017. menuActionID[menuActionRow] = 965;
  8018. if(l == 4)
  8019. menuActionID[menuActionRow] = 478;
  8020. menuActionCmd1[menuActionRow] = i;
  8021. menuActionCmd2[menuActionRow] = k;
  8022. menuActionCmd3[menuActionRow] = j;
  8023. menuActionRow++;
  8024. }
  8025.  
  8026. }
  8027. if(entityDef.actions != null)
  8028. {
  8029. for(int i1 = 4; i1 >= 0; i1--)
  8030. if(entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack"))
  8031. {
  8032. char c = '\0';
  8033. if(entityDef.combatLevel > myPlayer.combatLevel)
  8034. c = '\u07D0';
  8035. menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  8036. if(i1 == 0)
  8037. menuActionID[menuActionRow] = 20 + c;
  8038. if(i1 == 1)
  8039. menuActionID[menuActionRow] = 412 + c;
  8040. if(i1 == 2)
  8041. menuActionID[menuActionRow] = 225 + c;
  8042. if(i1 == 3)
  8043. menuActionID[menuActionRow] = 965 + c;
  8044. if(i1 == 4)
  8045. menuActionID[menuActionRow] = 478 + c;
  8046. menuActionCmd1[menuActionRow] = i;
  8047. menuActionCmd2[menuActionRow] = k;
  8048. menuActionCmd3[menuActionRow] = j;
  8049. menuActionRow++;
  8050. }
  8051.  
  8052. }
  8053. //menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.type + "@gre@)";
  8054. if(idToggle == true) {
  8055. menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.type + "@gre@)";
  8056. } else {
  8057. menuActionName[menuActionRow] = "Examine @yel@" + s;
  8058. }
  8059. menuActionID[menuActionRow] = 1025;
  8060. menuActionCmd1[menuActionRow] = i;
  8061. menuActionCmd2[menuActionRow] = k;
  8062. menuActionCmd3[menuActionRow] = j;
  8063. menuActionRow++;
  8064. }
  8065. }
  8066.  
  8067. private void buildAtPlayerMenu(int i, int j, Player player, int k)
  8068. {
  8069. if(player == myPlayer)
  8070. return;
  8071. if(menuActionRow >= 400)
  8072. return;
  8073. String s;
  8074. if(player.skill == 0)
  8075. s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  8076. else
  8077. s = player.name + " (skill-" + player.skill + ")";
  8078. if(itemSelected == 1)
  8079. {
  8080. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
  8081. menuActionID[menuActionRow] = 491;
  8082. menuActionCmd1[menuActionRow] = j;
  8083. menuActionCmd2[menuActionRow] = i;
  8084. menuActionCmd3[menuActionRow] = k;
  8085. menuActionRow++;
  8086. } else
  8087. if(spellSelected == 1)
  8088. {
  8089. if((spellUsableOn & 8) == 8)
  8090. {
  8091. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  8092. menuActionID[menuActionRow] = 365;
  8093. menuActionCmd1[menuActionRow] = j;
  8094. menuActionCmd2[menuActionRow] = i;
  8095. menuActionCmd3[menuActionRow] = k;
  8096. menuActionRow++;
  8097. }
  8098. } else
  8099. {
  8100. for(int l = 4; l >= 0; l--)
  8101. if(atPlayerActions[l] != null)
  8102. {
  8103. menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  8104. char c = '\0';
  8105. if(atPlayerActions[l].equalsIgnoreCase("attack"))
  8106. {
  8107. if(player.combatLevel > myPlayer.combatLevel)
  8108. c = '\u07D0';
  8109. if(myPlayer.team != 0 && player.team != 0)
  8110. if(myPlayer.team == player.team)
  8111. c = '\u07D0';
  8112. else
  8113. c = '\0';
  8114. } else
  8115. if(atPlayerArray[l])
  8116. c = '\u07D0';
  8117. if(l == 0)
  8118. menuActionID[menuActionRow] = 561 + c;
  8119. if(l == 1)
  8120. menuActionID[menuActionRow] = 779 + c;
  8121. if(l == 2)
  8122. menuActionID[menuActionRow] = 27 + c;
  8123. if(l == 3)
  8124. menuActionID[menuActionRow] = 577 + c;
  8125. if(l == 4)
  8126. menuActionID[menuActionRow] = 729 + c;
  8127. menuActionCmd1[menuActionRow] = j;
  8128. menuActionCmd2[menuActionRow] = i;
  8129. menuActionCmd3[menuActionRow] = k;
  8130. menuActionRow++;
  8131. }
  8132.  
  8133. }
  8134. for(int i1 = 0; i1 < menuActionRow; i1++)
  8135. if(menuActionID[i1] == 516)
  8136. {
  8137. menuActionName[i1] = "Walk here @whi@" + s;
  8138. return;
  8139. }
  8140.  
  8141. }
  8142.  
  8143. private void method89(Class30_Sub1 class30_sub1)
  8144. {
  8145. int i = 0;
  8146. int j = -1;
  8147. int k = 0;
  8148. int l = 0;
  8149. if(class30_sub1.anInt1296 == 0)
  8150. i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8151. if(class30_sub1.anInt1296 == 1)
  8152. i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8153. if(class30_sub1.anInt1296 == 2)
  8154. i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8155. if(class30_sub1.anInt1296 == 3)
  8156. i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  8157. if(i != 0)
  8158. {
  8159. int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  8160. j = i >> 14 & 0x7fff;
  8161. k = i1 & 0x1f;
  8162. l = i1 >> 6;
  8163. }
  8164. class30_sub1.anInt1299 = j;
  8165. class30_sub1.anInt1301 = k;
  8166. class30_sub1.anInt1300 = l;
  8167. }
  8168.  
  8169. private void method90()
  8170. {
  8171. for(int i = 0; i < anInt1062; i++)
  8172. if(anIntArray1250[i] <= 0)
  8173. {
  8174. boolean flag1 = false;
  8175. try
  8176. {
  8177. if(anIntArray1207[i] == anInt874 && anIntArray1241[i] == anInt1289)
  8178. {
  8179. if(!replayWave())
  8180. flag1 = true;
  8181. } else
  8182. {
  8183. Stream stream = Sounds.method241(anIntArray1241[i], anIntArray1207[i]);
  8184. if(System.currentTimeMillis() + (long)(stream.currentOffset / 22) > aLong1172 + (long)(anInt1257 / 22))
  8185. {
  8186. anInt1257 = stream.currentOffset;
  8187. aLong1172 = System.currentTimeMillis();
  8188. if(saveWave(stream.buffer, stream.currentOffset))
  8189. {
  8190. anInt874 = anIntArray1207[i];
  8191. anInt1289 = anIntArray1241[i];
  8192. } else
  8193. {
  8194. flag1 = true;
  8195. }
  8196. }
  8197. }
  8198. }
  8199. catch(Exception exception) { }
  8200. if(!flag1 || anIntArray1250[i] == -5)
  8201. {
  8202. anInt1062--;
  8203. for(int j = i; j < anInt1062; j++)
  8204. {
  8205. anIntArray1207[j] = anIntArray1207[j + 1];
  8206. anIntArray1241[j] = anIntArray1241[j + 1];
  8207. anIntArray1250[j] = anIntArray1250[j + 1];
  8208. }
  8209.  
  8210. i--;
  8211. } else
  8212. {
  8213. anIntArray1250[i] = -5;
  8214. }
  8215. } else
  8216. {
  8217. anIntArray1250[i]--;
  8218. }
  8219.  
  8220. if(prevSong > 0)
  8221. {
  8222. prevSong -= 20;
  8223. if(prevSong < 0)
  8224. prevSong = 0;
  8225. if(prevSong == 0 && musicEnabled && !lowMem)
  8226. {
  8227. nextSong = currentSong;
  8228. songChanging = true;
  8229. onDemandFetcher.method558(2, nextSong);
  8230. }
  8231. }
  8232. }
  8233.  
  8234. void startUp()
  8235. {
  8236. drawSmoothLoading(40, "Starting up");
  8237. new Thread(new MemoryMonitor()).start();
  8238. if(signlink.sunjava)
  8239. super.minDelay = 5;
  8240. if(aBoolean993)
  8241. {
  8242. // rsAlreadyLoaded = true;
  8243. // return;
  8244. }
  8245. aBoolean993 = true;
  8246. boolean flag = true;
  8247. String s = getDocumentBaseHost();
  8248. if(signlink.cache_dat != null)
  8249. {
  8250. for(int i = 0; i < 5; i++)
  8251. decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  8252. } try {
  8253. titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  8254. newRegularFont2 = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  8255. smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  8256. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  8257. chatTextDrawingArea = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  8258. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  8259. newSmallFont = new RSFont(false, "p11_full", titleStreamLoader);
  8260. newRegularFont = new RSFont(false, "p12_full", titleStreamLoader);
  8261. newBoldFont = new RSFont(false, "b12_full", titleStreamLoader);
  8262. newFancyFont = new RSFont(true, "q8_full", titleStreamLoader);
  8263. newFancyFont2 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  8264. newSmallFont.unpackChatImages(chatImages);
  8265. newRegularFont.unpackChatImages(chatImages);
  8266. newBoldFont.unpackChatImages(chatImages);
  8267. newFancyFont.unpackChatImages(chatImages);
  8268. drawLogo();
  8269. loadTitleScreen();
  8270. StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  8271. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  8272. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  8273. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  8274. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  8275. StreamLoader streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  8276. byteGroundArray = new byte[4][104][104];
  8277. intGroundArray = new int[4][105][105];
  8278. worldController = new WorldController(intGroundArray);
  8279. for(int j = 0; j < 4; j++)
  8280. aClass11Array1230[j] = new Class11();
  8281.  
  8282. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  8283. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  8284. drawSmoothLoading(120, "Connecting to update server");
  8285. onDemandFetcher = new OnDemandFetcher();
  8286. onDemandFetcher.start(streamLoader_6, this);
  8287. Class36.method528(onDemandFetcher.getAnimCount());
  8288. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  8289. preloadModels();
  8290. //repackCacheIndex(4);
  8291. drawSmoothLoading(160, "Unpacking media");
  8292. /* Custom sprite unpacking */
  8293. magicAuto = new Sprite("Misc/magicAuto");
  8294. SummIcon = new Sprite("Gameframe/Orbs/SummIcon");
  8295. SummOrb = new Sprite("Gameframe/Orbs/SummOrb");
  8296. SummOrbFill = new Sprite("Gameframe/Orbs/SummOrbFill");
  8297. XPcounter = new Sprite("Gameframe/Counters/XPcounter");
  8298. XPcounterhover = new Sprite("Gameframe/Counters/XPcounterhover");
  8299. sprite1 = new Sprite("Gameframe/sprite1");
  8300. xpFlag = new Sprite("Gameframe/xpFlag");
  8301. chatArea = new Sprite("chatarea");
  8302. tabArea = new Sprite("tabarea");
  8303. mapArea = new Sprite("maparea");
  8304. loadingPleaseWait = new Sprite("loadingPleaseWait");
  8305. reestablish = new Sprite("reestablish");
  8306. backgroundFix = new Sprite("Backgrounds/BG 1");
  8307. SmallCritHit = new Sprite("Player/SmallCritHit");
  8308. BigCritHit = new Sprite("Player/BigCritHit");
  8309. HPBarFull = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/HITPOINTS_0.PNG", 1);
  8310. HPBarEmpty = new Sprite(sign.signlink.findcachedir() + "Sprites/Player/HITPOINTS_1.PNG", 1);
  8311. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  8312. tabHover = new Sprite("Tabarea/tabhover");
  8313. tabClicked = new Sprite("Tabarea/tabclicked");
  8314. mapBack = new Background(streamLoader_2, "mapback", 0);
  8315. for(int nSI = 0; nSI <= 14; nSI++)
  8316. newSideIcons[nSI] = new Sprite("Tabarea/icon "+nSI);
  8317. for(int c1 = 0; c1 <= 3; c1++)
  8318. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  8319. for(int j3 = 0; j3 <= 14; j3++)
  8320. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  8321. for(int r1 = 0; r1 < 5; r1++)
  8322. redStones[r1] = new Sprite("redstones " + r1);
  8323. for(int i = 0; i <= 4;i++) {
  8324. LOGOUT[i] = new Sprite("Gameframe/Orbs/X "+i+"");
  8325. }
  8326. for(int i = 1; i <= 15; i++) {
  8327. ORBS[i] = new Sprite("Gameframe/Orbs/ORBS "+i+"");
  8328. }
  8329. for(int i4 = 0; i4 < 3; i4++) {
  8330. hitMark[i4] = new Sprite("Player/Hits "+i4+"");
  8331. }
  8332. for(int i = 0; i <= 5; i++) {
  8333. combatIcons[i] = new Sprite("Player/combatIcon "+i+"");
  8334. }
  8335. compass = new Sprite(streamLoader_2, "compass", 0);
  8336. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  8337. mapEdge.method345();
  8338. try
  8339. {
  8340. for(int k3 = 0; k3 < 100; k3++)
  8341. mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  8342. }
  8343. catch(Exception _ex) { }
  8344. try
  8345. {
  8346. for (int l3 = 0; l3 < 100; l3++)
  8347. if(l3 < 75 ) {
  8348. mapFunctions[l3] = new Sprite(streamLoader_2,"mapfunction", l3);
  8349. } else {
  8350. mapFunctions[l3] = new Sprite(streamLoader_2,"mapfunctions2", (l3-76));
  8351. }
  8352. }
  8353. catch(Exception _ex) { }
  8354. try
  8355. {
  8356. for(int i4 = 0; i4 < 20; i4++)
  8357. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  8358. }
  8359. catch(Exception _ex) { }
  8360. try
  8361. {
  8362. for(int h1 = 0; h1 < 6; h1++)
  8363. headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
  8364. } catch(Exception _ex) { }
  8365. try {
  8366. for(int j4 = 0; j4 < 18; j4++)
  8367. headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);
  8368. for(int j45 = 0; j45 < 3; j45++)
  8369. skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45 );
  8370. }
  8371. catch(Exception _ex) { }
  8372. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  8373. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  8374. for(int k4 = 0; k4 < 8; k4++)
  8375. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  8376.  
  8377. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  8378. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  8379. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  8380. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  8381. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  8382. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  8383. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  8384. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  8385.  
  8386. for(int l4 = 0; l4 < 5; l4++)
  8387. modIcons[l4] = new Background(streamLoader_2, "mod_icons", l4);
  8388.  
  8389. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  8390. leftFrame = constructGraphicsBuffer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8391. sprite.method346(0, 0);
  8392. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  8393. topFrame = constructGraphicsBuffer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8394. sprite.method346(0, 0);
  8395. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  8396. rightFrame = constructGraphicsBuffer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8397. sprite.method346(0, 0);
  8398. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  8399. mapEdgeIP = constructGraphicsBuffer(sprite.myWidth, sprite.myHeight, getGameComponent());
  8400. sprite.method346(0, 0);
  8401.  
  8402. int i5 = (int)(Math.random() * 21D) - 10;
  8403. int j5 = (int)(Math.random() * 21D) - 10;
  8404. int k5 = (int)(Math.random() * 21D) - 10;
  8405. int l5 = (int)(Math.random() * 41D) - 20;
  8406. for(int i6 = 0; i6 < 100; i6++)
  8407. {
  8408. if(mapFunctions[i6] != null)
  8409. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  8410. if(mapScenes[i6] != null)
  8411. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  8412. }
  8413.  
  8414. drawSmoothLoading(166, "Unpacking textures");
  8415. Texture.method368(streamLoader_3);
  8416. Texture.method372(0.80000000000000004D);
  8417. Texture.method367();
  8418. drawSmoothLoading(172, "Unpacking config");
  8419. Animation.unpackConfig(streamLoader);
  8420. ObjectDef.unpackConfig(streamLoader);
  8421. Flo.unpackConfig(streamLoader);
  8422. OverLayFlo317.unpackConfig(streamLoader);
  8423. ItemDef.unpackConfig(streamLoader);
  8424. EntityDef.unpackConfig(streamLoader);
  8425. IDK.unpackConfig(streamLoader);
  8426. SpotAnim.unpackConfig(streamLoader);
  8427. Varp.unpackConfig(streamLoader);
  8428. VarBit.unpackConfig(streamLoader);
  8429. ItemDef.isMembers = isMembers;
  8430. if(!lowMem)
  8431. {
  8432. drawSmoothLoading(180, "Unpacking sounds");
  8433. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  8434. Stream stream = new Stream(abyte0);
  8435. Sounds.unpack(stream);
  8436. }
  8437. drawSmoothLoading(190, "Unpacking interfaces");
  8438. TextDrawingArea aclass30_sub2_sub1_sub4s[] = {
  8439. smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  8440. };
  8441. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  8442. drawSmoothLoading(200, "Preparing game engine");
  8443. for(int j6 = 0; j6 < 33; j6++)
  8444. {
  8445. int k6 = 999;
  8446. int i7 = 0;
  8447. for(int k7 = 0; k7 < 34; k7++)
  8448. {
  8449. if(mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0)
  8450. {
  8451. if(k6 == 999)
  8452. k6 = k7;
  8453. continue;
  8454. }
  8455. if(k6 == 999)
  8456. continue;
  8457. i7 = k7;
  8458. break;
  8459. }
  8460.  
  8461. anIntArray968[j6] = k6;
  8462. anIntArray1057[j6] = i7 - k6;
  8463. }
  8464.  
  8465. for(int l6 = 5; l6 < 156; l6++)
  8466. {
  8467. int j7 = 999;
  8468. int l7 = 0;
  8469. for(int j8 = 25; j8 < 172; j8++)
  8470. {
  8471. if(mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34))
  8472. {
  8473. if(j7 == 999)
  8474. j7 = j8;
  8475. continue;
  8476. }
  8477. if(j7 == 999)
  8478. continue;
  8479. l7 = j8;
  8480. break;
  8481. }
  8482.  
  8483. anIntArray1052[l6 - 5] = j7 - 25;
  8484. anIntArray1229[l6 - 5] = l7 - j7;
  8485. }
  8486.  
  8487. Texture.method365(765, 503);
  8488. fullScreenTextureArray = Texture.anIntArray1472;
  8489. Texture.method365(516, 165);
  8490. anIntArray1180 = Texture.anIntArray1472;
  8491. Texture.method365(246, 335);
  8492. anIntArray1181 = Texture.anIntArray1472;
  8493. Texture.method365(512, 334);
  8494. anIntArray1182 = Texture.anIntArray1472;
  8495. int ai[] = new int[9];
  8496. for(int i8 = 0; i8 < 9; i8++)
  8497. {
  8498. int k8 = 128 + i8 * 32 + 15;
  8499. int l8 = 600 + k8 * 3;
  8500. int i9 = Texture.anIntArray1470[k8];
  8501. ai[i8] = l8 * i9 >> 16;
  8502. }
  8503.  
  8504. WorldController.method310(500, 800, 512, 334, ai);
  8505. Censor.loadConfig(streamLoader_4);
  8506. mouseDetection = new MouseDetection(this);
  8507. startRunnable(mouseDetection, 10);
  8508. Animable_Sub5.clientInstance = this;
  8509. ObjectDef.clientInstance = this;
  8510. EntityDef.clientInstance = this;
  8511. return;
  8512. }
  8513. catch(Exception exception)
  8514. {
  8515. signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  8516. }
  8517. loadingError = true;
  8518. }
  8519.  
  8520. private void method91(Stream stream, int i)
  8521. {
  8522. while(stream.bitPosition + 10 < i * 8)
  8523. {
  8524. int j = stream.readBits(11);
  8525. if(j == 2047)
  8526. break;
  8527. if(playerArray[j] == null)
  8528. {
  8529. playerArray[j] = new Player();
  8530. if(aStreamArray895s[j] != null)
  8531. playerArray[j].updatePlayer(aStreamArray895s[j]);
  8532. }
  8533. playerIndices[playerCount++] = j;
  8534. Player player = playerArray[j];
  8535. player.anInt1537 = loopCycle;
  8536. int k = stream.readBits(1);
  8537. if(k == 1)
  8538. anIntArray894[anInt893++] = j;
  8539. int l = stream.readBits(1);
  8540. int i1 = stream.readBits(5);
  8541. if(i1 > 15)
  8542. i1 -= 32;
  8543. int j1 = stream.readBits(5);
  8544. if(j1 > 15)
  8545. j1 -= 32;
  8546. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  8547. }
  8548. stream.finishBitAccess();
  8549. }
  8550.  
  8551. private void processMainScreenClick() {
  8552. if(anInt1021 != 0)
  8553. return;
  8554. if(super.clickMode3 == 1) {
  8555. int i = super.saveClickX - 25 - 545;
  8556. int j = super.saveClickY - 5 - 4;
  8557. if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  8558. i -= 73;
  8559. j -= 75;
  8560. int k = minimapInt1 + minimapInt2 & 0x7ff;
  8561. int i1 = Texture.anIntArray1470[k];
  8562. int j1 = Texture.anIntArray1471[k];
  8563. i1 = i1 * (minimapInt3 + 256) >> 8;
  8564. j1 = j1 * (minimapInt3 + 256) >> 8;
  8565. int k1 = j * i1 + i * j1 >> 11;
  8566. int l1 = j * j1 - i * i1 >> 11;
  8567. int i2 = myPlayer.x + k1 >> 7;
  8568. int j2 = myPlayer.y - l1 >> 7;
  8569. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  8570. if(flag1) {
  8571. stream.writeWordBigEndian(i);
  8572. stream.writeWordBigEndian(j);
  8573. stream.writeWord(minimapInt1);
  8574. stream.writeWordBigEndian(57);
  8575. stream.writeWordBigEndian(minimapInt2);
  8576. stream.writeWordBigEndian(minimapInt3);
  8577. stream.writeWordBigEndian(89);
  8578. stream.writeWord(myPlayer.x);
  8579. stream.writeWord(myPlayer.y);
  8580. stream.writeWordBigEndian(anInt1264);
  8581. stream.writeWordBigEndian(63);
  8582. }
  8583. }
  8584. anInt1117++;
  8585. if(anInt1117 > 1151) {
  8586. anInt1117 = 0;
  8587. stream.createFrame(246);
  8588. stream.writeWordBigEndian(0);
  8589. int l = stream.currentOffset;
  8590. if((int)(Math.random() * 2D) == 0)
  8591. stream.writeWordBigEndian(101);
  8592. stream.writeWordBigEndian(197);
  8593. stream.writeWord((int)(Math.random() * 65536D));
  8594. stream.writeWordBigEndian((int)(Math.random() * 256D));
  8595. stream.writeWordBigEndian(67);
  8596. stream.writeWord(14214);
  8597. if((int)(Math.random() * 2D) == 0)
  8598. stream.writeWord(29487);
  8599. stream.writeWord((int)(Math.random() * 65536D));
  8600. if((int)(Math.random() * 2D) == 0)
  8601. stream.writeWordBigEndian(220);
  8602. stream.writeWordBigEndian(180);
  8603. stream.writeBytes(stream.currentOffset - l);
  8604. }
  8605. }
  8606. }
  8607.  
  8608. private String interfaceIntToString(int j) {
  8609. if(j < 0x3b9ac9ff)
  8610. return String.valueOf(j);
  8611. else
  8612. return "*";
  8613. }
  8614.  
  8615. private void showErrorScreen()
  8616. {
  8617. Graphics g = getGameComponent().getGraphics();
  8618. g.setColor(Color.black);
  8619. g.fillRect(0, 0, 765, 503);
  8620. method4(1);
  8621. if(loadingError)
  8622. {
  8623. aBoolean831 = false;
  8624. g.setFont(new Font("Helvetica", 1, 16));
  8625. g.setColor(Color.yellow);
  8626. int k = 35;
  8627. g.drawString("Sorry, an error has occured whilst loading Project Insanity", 30, k);
  8628. k += 50;
  8629. g.setColor(Color.white);
  8630. g.drawString("To fix this try the following (in order):", 30, k);
  8631. k += 50;
  8632. g.setColor(Color.white);
  8633. g.setFont(new Font("Helvetica", 1, 12));
  8634. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  8635. k += 30;
  8636. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  8637. k += 30;
  8638. g.drawString("3: Try using a different game-world", 30, k);
  8639. k += 30;
  8640. g.drawString("4: Try rebooting your computer", 30, k);
  8641. k += 30;
  8642. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  8643. }
  8644. if(genericLoadingError)
  8645. {
  8646. aBoolean831 = false;
  8647. g.setFont(new Font("Helvetica", 1, 20));
  8648. g.setColor(Color.white);
  8649. g.drawString("Error - unable to load game!", 50, 50);
  8650. g.drawString("To play RuneScape make sure you play from", 50, 100);
  8651. g.drawString("http://www.websitehere.com", 50, 150);
  8652. }
  8653. if(rsAlreadyLoaded)
  8654. {
  8655. aBoolean831 = false;
  8656. g.setColor(Color.yellow);
  8657. int l = 35;
  8658. g.drawString("Error a copy of Project Insanity already appears to be loaded", 30, l);
  8659. l += 50;
  8660. g.setColor(Color.white);
  8661. g.drawString("To fix this try the following (in order):", 30, l);
  8662. l += 50;
  8663. g.setColor(Color.white);
  8664. g.setFont(new Font("Helvetica", 1, 12));
  8665. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  8666. l += 30;
  8667. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  8668. l += 30;
  8669. }
  8670. }
  8671.  
  8672. public URL getCodeBase() {
  8673. try {
  8674. return new URL(server +":" + (80 + portOff));
  8675. } catch(Exception _ex) {
  8676. }
  8677. return null;
  8678. }
  8679.  
  8680. private void method95() {
  8681. for(int j = 0; j < npcCount; j++) {
  8682. int k = npcIndices[j];
  8683. NPC npc = npcArray[k];
  8684. if(npc != null)
  8685. method96(npc);
  8686. }
  8687. }
  8688.  
  8689. private void method96(Entity entity)
  8690. {
  8691. if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  8692. {
  8693. entity.anim = -1;
  8694. entity.anInt1520 = -1;
  8695. entity.anInt1547 = 0;
  8696. entity.anInt1548 = 0;
  8697. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8698. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8699. entity.method446();
  8700. }
  8701. if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  8702. {
  8703. entity.anim = -1;
  8704. entity.anInt1520 = -1;
  8705. entity.anInt1547 = 0;
  8706. entity.anInt1548 = 0;
  8707. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  8708. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  8709. entity.method446();
  8710. }
  8711. if(entity.anInt1547 > loopCycle)
  8712. method97(entity);
  8713. else
  8714. if(entity.anInt1548 >= loopCycle)
  8715. method98(entity);
  8716. else
  8717. method99(entity);
  8718. method100(entity);
  8719. method101(entity);
  8720. }
  8721.  
  8722. private void method97(Entity entity)
  8723. {
  8724. int i = entity.anInt1547 - loopCycle;
  8725. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8726. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8727. entity.x += (j - entity.x) / i;
  8728. entity.y += (k - entity.y) / i;
  8729. entity.anInt1503 = 0;
  8730. if(entity.anInt1549 == 0)
  8731. entity.turnDirection = 1024;
  8732. if(entity.anInt1549 == 1)
  8733. entity.turnDirection = 1536;
  8734. if(entity.anInt1549 == 2)
  8735. entity.turnDirection = 0;
  8736. if(entity.anInt1549 == 3)
  8737. entity.turnDirection = 512;
  8738. }
  8739.  
  8740. private void method98(Entity entity)
  8741. {
  8742. if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  8743. {
  8744. int i = entity.anInt1548 - entity.anInt1547;
  8745. int j = loopCycle - entity.anInt1547;
  8746. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  8747. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  8748. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  8749. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  8750. entity.x = (k * (i - j) + i1 * j) / i;
  8751. entity.y = (l * (i - j) + j1 * j) / i;
  8752. }
  8753. entity.anInt1503 = 0;
  8754. if(entity.anInt1549 == 0)
  8755. entity.turnDirection = 1024;
  8756. if(entity.anInt1549 == 1)
  8757. entity.turnDirection = 1536;
  8758. if(entity.anInt1549 == 2)
  8759. entity.turnDirection = 0;
  8760. if(entity.anInt1549 == 3)
  8761. entity.turnDirection = 512;
  8762. entity.anInt1552 = entity.turnDirection;
  8763. }
  8764.  
  8765. private void method99(Entity entity)
  8766. {
  8767. entity.anInt1517 = entity.anInt1511;
  8768. if(entity.smallXYIndex == 0)
  8769. {
  8770. entity.anInt1503 = 0;
  8771. return;
  8772. }
  8773. if(entity.anim != -1 && entity.anInt1529 == 0)
  8774. {
  8775. Animation animation = Animation.anims[entity.anim];
  8776. if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  8777. {
  8778. entity.anInt1503++;
  8779. return;
  8780. }
  8781. if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  8782. {
  8783. entity.anInt1503++;
  8784. return;
  8785. }
  8786. }
  8787. int i = entity.x;
  8788. int j = entity.y;
  8789. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  8790. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  8791. if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  8792. {
  8793. entity.x = k;
  8794. entity.y = l;
  8795. return;
  8796. }
  8797. if(i < k)
  8798. {
  8799. if(j < l)
  8800. entity.turnDirection = 1280;
  8801. else
  8802. if(j > l)
  8803. entity.turnDirection = 1792;
  8804. else
  8805. entity.turnDirection = 1536;
  8806. } else
  8807. if(i > k)
  8808. {
  8809. if(j < l)
  8810. entity.turnDirection = 768;
  8811. else
  8812. if(j > l)
  8813. entity.turnDirection = 256;
  8814. else
  8815. entity.turnDirection = 512;
  8816. } else
  8817. if(j < l)
  8818. entity.turnDirection = 1024;
  8819. else
  8820. entity.turnDirection = 0;
  8821. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8822. if(i1 > 1024)
  8823. i1 -= 2048;
  8824. int j1 = entity.anInt1555;
  8825. if(i1 >= -256 && i1 <= 256)
  8826. j1 = entity.anInt1554;
  8827. else
  8828. if(i1 >= 256 && i1 < 768)
  8829. j1 = entity.anInt1557;
  8830. else
  8831. if(i1 >= -768 && i1 <= -256)
  8832. j1 = entity.anInt1556;
  8833. if(j1 == -1)
  8834. j1 = entity.anInt1554;
  8835. entity.anInt1517 = j1;
  8836. int k1 = 4;
  8837. if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  8838. k1 = 2;
  8839. if(entity.smallXYIndex > 2)
  8840. k1 = 6;
  8841. if(entity.smallXYIndex > 3)
  8842. k1 = 8;
  8843. if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  8844. {
  8845. k1 = 8;
  8846. entity.anInt1503--;
  8847. }
  8848. if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  8849. k1 <<= 1;
  8850. if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  8851. entity.anInt1517 = entity.anInt1505;
  8852. if(i < k)
  8853. {
  8854. entity.x += k1;
  8855. if(entity.x > k)
  8856. entity.x = k;
  8857. } else
  8858. if(i > k)
  8859. {
  8860. entity.x -= k1;
  8861. if(entity.x < k)
  8862. entity.x = k;
  8863. }
  8864. if(j < l)
  8865. {
  8866. entity.y += k1;
  8867. if(entity.y > l)
  8868. entity.y = l;
  8869. } else
  8870. if(j > l)
  8871. {
  8872. entity.y -= k1;
  8873. if(entity.y < l)
  8874. entity.y = l;
  8875. }
  8876. if(entity.x == k && entity.y == l)
  8877. {
  8878. entity.smallXYIndex--;
  8879. if(entity.anInt1542 > 0)
  8880. entity.anInt1542--;
  8881. }
  8882. }
  8883.  
  8884. private void method100(Entity entity)
  8885. {
  8886. if(entity.anInt1504 == 0)
  8887. return;
  8888. if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  8889. {
  8890. NPC npc = npcArray[entity.interactingEntity];
  8891. if(npc != null)
  8892. {
  8893. int i1 = entity.x - npc.x;
  8894. int k1 = entity.y - npc.y;
  8895. if(i1 != 0 || k1 != 0)
  8896. entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  8897. }
  8898. }
  8899. if(entity.interactingEntity >= 32768)
  8900. {
  8901. int j = entity.interactingEntity - 32768;
  8902. if(j == unknownInt10)
  8903. j = myPlayerIndex;
  8904. Player player = playerArray[j];
  8905. if(player != null)
  8906. {
  8907. int l1 = entity.x - player.x;
  8908. int i2 = entity.y - player.y;
  8909. if(l1 != 0 || i2 != 0)
  8910. entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  8911. }
  8912. }
  8913. if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  8914. {
  8915. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  8916. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  8917. if(k != 0 || j1 != 0)
  8918. entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  8919. entity.anInt1538 = 0;
  8920. entity.anInt1539 = 0;
  8921. }
  8922. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  8923. if(l != 0)
  8924. {
  8925. if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8926. entity.anInt1552 = entity.turnDirection;
  8927. else
  8928. if(l > 1024)
  8929. entity.anInt1552 -= entity.anInt1504;
  8930. else
  8931. entity.anInt1552 += entity.anInt1504;
  8932. entity.anInt1552 &= 0x7ff;
  8933. if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  8934. {
  8935. if(entity.anInt1512 != -1)
  8936. {
  8937. entity.anInt1517 = entity.anInt1512;
  8938. return;
  8939. }
  8940. entity.anInt1517 = entity.anInt1554;
  8941. }
  8942. }
  8943. }
  8944.  
  8945. private void method101(Entity entity)
  8946. {
  8947. entity.aBoolean1541 = false;
  8948. if(entity.anInt1517 != -1)
  8949. {
  8950. Animation animation = Animation.anims[entity.anInt1517];
  8951. entity.anInt1519++;
  8952. if(entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518))
  8953. {
  8954. entity.anInt1519 = 0;
  8955. entity.anInt1518++;
  8956. }
  8957. if(entity.anInt1518 >= animation.anInt352)
  8958. {
  8959. entity.anInt1519 = 0;
  8960. entity.anInt1518 = 0;
  8961. }
  8962. }
  8963. if(entity.anInt1520 != -1 && loopCycle >= entity.anInt1523)
  8964. {
  8965. if(entity.anInt1521 < 0)
  8966. entity.anInt1521 = 0;
  8967. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8968. for(entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  8969. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8970.  
  8971. if(entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  8972. entity.anInt1520 = -1;
  8973. }
  8974. if(entity.anim != -1 && entity.anInt1529 <= 1)
  8975. {
  8976. Animation animation_2 = Animation.anims[entity.anim];
  8977. if(animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle)
  8978. {
  8979. entity.anInt1529 = 1;
  8980. return;
  8981. }
  8982. }
  8983. if(entity.anim != -1 && entity.anInt1529 == 0)
  8984. {
  8985. Animation animation_3 = Animation.anims[entity.anim];
  8986. for(entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  8987. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8988.  
  8989. if(entity.anInt1527 >= animation_3.anInt352)
  8990. {
  8991. entity.anInt1527 -= animation_3.anInt356;
  8992. entity.anInt1530++;
  8993. if(entity.anInt1530 >= animation_3.anInt362)
  8994. entity.anim = -1;
  8995. if(entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  8996. entity.anim = -1;
  8997. }
  8998. entity.aBoolean1541 = animation_3.aBoolean358;
  8999. }
  9000. if(entity.anInt1529 > 0)
  9001. entity.anInt1529--;
  9002. }
  9003.  
  9004. private void drawGameScreen()
  9005. {
  9006. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  9007. if (loadingStage == 2) {
  9008. method119(anInt945, fullscreenInterfaceID);
  9009. if (openInterfaceID != -1) {
  9010. method119(anInt945, openInterfaceID);
  9011. }
  9012. anInt945 = 0;
  9013. resetAllImageProducers();
  9014. super.fullGameScreen.initDrawingArea();
  9015. Texture.anIntArray1472 = fullScreenTextureArray;
  9016. DrawingArea.setAllPixelsToZero();
  9017. welcomeScreenRaised = true;
  9018. if (openInterfaceID != -1) {
  9019. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  9020. if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  9021. rsInterface_1.width = 765;
  9022. rsInterface_1.height = 503;
  9023. }
  9024. drawInterface(0, 0, rsInterface_1, 8);
  9025. }
  9026. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  9027. if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  9028. rsInterface.width = 765;
  9029. rsInterface.height = 503;
  9030. }
  9031. drawInterface(0, 0, rsInterface, 8);
  9032.  
  9033. if (!menuOpen) {
  9034. processRightClick();
  9035. drawTooltip();
  9036. } else {
  9037. drawMenu(0, 0);
  9038. }
  9039. }
  9040. drawCount++;
  9041. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  9042. return;
  9043. } else {
  9044. if (drawCount != 0) {
  9045. resetImageProducers2();
  9046. }
  9047. }
  9048. if(welcomeScreenRaised) {
  9049. welcomeScreenRaised = false;
  9050. topFrame.drawGraphics(0, super.graphics, 0);
  9051. leftFrame.drawGraphics(4, super.graphics, 0);
  9052. //rightFrame.drawGraphics(4, super.graphics, 516);
  9053. //mapEdgeIP.drawGraphics(4, super.graphics, 516);
  9054. needDrawTabArea = true;
  9055. inputTaken = true;
  9056. tabAreaAltered = true;
  9057. aBoolean1233 = true;
  9058. if(loadingStage != 2) {
  9059. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  9060. aRSImageProducer_1164.drawGraphics(0, super.graphics, 516);
  9061. }
  9062. }
  9063. if(menuOpen)
  9064. needDrawTabArea = true;
  9065. if(invOverlayInterfaceID != -1)
  9066. {
  9067. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  9068. if(flag1)
  9069. needDrawTabArea = true;
  9070. }
  9071. if(atInventoryInterfaceType == 2)
  9072. needDrawTabArea = true;
  9073. if(activeInterfaceType == 2)
  9074. needDrawTabArea = true;
  9075. /*if(needDrawTabArea)
  9076. {*/
  9077. drawTabArea();
  9078. /*needDrawTabArea = false;
  9079. }*/
  9080. if(backDialogID == -1)
  9081. {
  9082. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  9083. if(super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  9084. method65(494, 110, super.mouseX - 0, super.mouseY - 348, aClass9_1059, 0, false, anInt1211);
  9085. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  9086. if(i < 0)
  9087. i = 0;
  9088. if(i > anInt1211 - 110)
  9089. i = anInt1211 - 110;
  9090. if(anInt1089 != i)
  9091. {
  9092. anInt1089 = i;
  9093. inputTaken = true;
  9094. }
  9095. }
  9096. if(backDialogID != -1) {
  9097. boolean flag2 = method119(anInt945, backDialogID);
  9098. if(flag2)
  9099. inputTaken = true;
  9100. }
  9101. if(atInventoryInterfaceType == 3)
  9102. inputTaken = true;
  9103. if(activeInterfaceType == 3)
  9104. inputTaken = true;
  9105. if(aString844 != null)
  9106. inputTaken = true;
  9107. if(menuOpen && menuScreenArea == 2)
  9108. inputTaken = true;
  9109. if(inputTaken) {
  9110. drawChatArea();
  9111. inputTaken = false;
  9112. }
  9113. if(loadingStage == 2)
  9114. method146();
  9115. if(loadingStage == 2) {
  9116. drawMinimap();
  9117. aRSImageProducer_1164.drawGraphics(0, super.graphics, 516);
  9118. }
  9119. if(anInt1054 != -1)
  9120. tabAreaAltered = true;
  9121. if(tabAreaAltered)
  9122. {
  9123. if(anInt1054 != -1 && anInt1054 == tabID)
  9124. {
  9125. anInt1054 = -1;
  9126. stream.createFrame(120);
  9127. stream.writeWordBigEndian(tabID);
  9128. }
  9129. tabAreaAltered = false;
  9130. aRSImageProducer_1125.initDrawingArea();
  9131. aRSImageProducer_1165.initDrawingArea();
  9132. }
  9133. if (!menuOpen) {
  9134. drawMenu(4,4);
  9135. }
  9136. anInt945 = 0;
  9137. }
  9138.  
  9139. private boolean buildFriendsListMenu(RSInterface class9)
  9140. {
  9141. int i = class9.contentType;
  9142. if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  9143. {
  9144. if(i >= 801)
  9145. i -= 701;
  9146. else
  9147. if(i >= 701)
  9148. i -= 601;
  9149. else
  9150. if(i >= 101)
  9151. i -= 101;
  9152. else
  9153. i--;
  9154. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  9155. menuActionID[menuActionRow] = 792;
  9156. menuActionRow++;
  9157. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  9158. menuActionID[menuActionRow] = 639;
  9159. menuActionRow++;
  9160. return true;
  9161. }
  9162. if(i >= 401 && i <= 500)
  9163. {
  9164. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  9165. menuActionID[menuActionRow] = 322;
  9166. menuActionRow++;
  9167. return true;
  9168. } else
  9169. {
  9170. return false;
  9171. }
  9172. }
  9173.  
  9174. private void method104()
  9175. {
  9176. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  9177. for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  9178. if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  9179. class30_sub2_sub4_sub3.unlink();
  9180. else
  9181. if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  9182. {
  9183. class30_sub2_sub4_sub3.method454(anInt945);
  9184. if(class30_sub2_sub4_sub3.aBoolean1567)
  9185. class30_sub2_sub4_sub3.unlink();
  9186. else
  9187. 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);
  9188. }
  9189.  
  9190. }
  9191.  
  9192. public void drawBlackBox(int xPos, int yPos) {
  9193. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  9194. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  9195. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  9196. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  9197. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  9198. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  9199. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  9200. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  9201. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  9202. }
  9203.  
  9204. private void drawInterface(int j, int k, RSInterface class9, int l) {
  9205. if(class9.type != 0 || class9.children == null)
  9206. return;
  9207. if(class9.isMouseoverTriggered && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  9208. return;
  9209. int i1 = DrawingArea.topX;
  9210. int j1 = DrawingArea.topY;
  9211. int k1 = DrawingArea.bottomX;
  9212. int l1 = DrawingArea.bottomY;
  9213. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  9214. int i2 = class9.children.length;
  9215. for(int j2 = 0; j2 < i2; j2++) {
  9216. int k2 = class9.childX[j2] + k;
  9217. int l2 = (class9.childY[j2] + l) - j;
  9218. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  9219. k2 += class9_1.anInt263;
  9220. l2 += class9_1.anInt265;
  9221. if(class9_1.contentType > 0)
  9222. drawFriendsListOrWelcomeScreen(class9_1);
  9223. //here
  9224. int[] IDs = {
  9225. 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
  9226. 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
  9227. 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
  9228. 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
  9229. 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  9230. /* Ancients */
  9231. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
  9232. 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  9233. };
  9234. for(int m5 = 0; m5 < IDs.length; m5++) {
  9235. if(class9_1.id == IDs[m5] + 1) {
  9236. if(m5 > 61)
  9237. drawBlackBox(k2 + 1, l2);
  9238. else
  9239. drawBlackBox(k2, l2 + 1);
  9240. }
  9241. }
  9242. int[] runeChildren = {
  9243. 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
  9244. 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
  9245. 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
  9246. 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
  9247. 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
  9248. 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
  9249. 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
  9250. 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
  9251. 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
  9252. 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
  9253. 15885, 18474, 18475, 18478
  9254. };
  9255. for(int r = 0; r < runeChildren.length; r++)
  9256. if(class9_1.id == runeChildren[r])
  9257. class9_1.modelZoom = 775;
  9258. if(class9_1.type == 0) {
  9259. if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  9260. class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  9261. if(class9_1.scrollPosition < 0)
  9262. class9_1.scrollPosition = 0;
  9263. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  9264. if(class9_1.scrollMax > class9_1.height)
  9265. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  9266. } else if(class9_1.type != 1)
  9267. if(class9_1.type == 2) {
  9268. int i3 = 0;
  9269. for(int l3 = 0; l3 < class9_1.height; l3++) {
  9270. for(int l4 = 0; l4 < class9_1.width; l4++) {
  9271. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  9272. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  9273. if(i3 < 20) {
  9274. k5 += class9_1.spritesX[i3];
  9275. j6 += class9_1.spritesY[i3];
  9276. }
  9277. if(class9_1.inv[i3] > 0) {
  9278. int k6 = 0;
  9279. int j7 = 0;
  9280. int j9 = class9_1.inv[i3] - 1;
  9281. if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  9282. int l9 = 0;
  9283. if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  9284. l9 = 0xffffff;
  9285. Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  9286. if(class30_sub2_sub1_sub1_2 != null) {
  9287. if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  9288. k6 = super.mouseX - anInt1087;
  9289. j7 = super.mouseY - anInt1088;
  9290. if(k6 < 5 && k6 > -5)
  9291. k6 = 0;
  9292. if(j7 < 5 && j7 > -5)
  9293. j7 = 0;
  9294. if(anInt989 < 10) {
  9295. k6 = 0;
  9296. j7 = 0;
  9297. }
  9298. class30_sub2_sub1_sub1_2.drawSprite1(k5 + k6, j6 + j7);
  9299. if(j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  9300. int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  9301. if(i10 > anInt945 * 10)
  9302. i10 = anInt945 * 10;
  9303. if(i10 > class9.scrollPosition)
  9304. i10 = class9.scrollPosition;
  9305. class9.scrollPosition -= i10;
  9306. anInt1088 += i10;
  9307. }
  9308. if(j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  9309. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  9310. if(j10 > anInt945 * 10)
  9311. j10 = anInt945 * 10;
  9312. if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  9313. j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  9314. class9.scrollPosition += j10;
  9315. anInt1088 -= j10;
  9316. }
  9317. } else if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  9318. class30_sub2_sub1_sub1_2.drawSprite1(k5, j6);
  9319. else
  9320. class30_sub2_sub1_sub1_2.drawSprite(k5, j6);
  9321. if(class30_sub2_sub1_sub1_2.anInt1444 == 33 || class9_1.invStackSizes[i3] != 1)
  9322. {
  9323. int k10 = class9_1.invStackSizes[i3];
  9324. if(k10 >= 1)
  9325. smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9326. if(k10 >= 100000)
  9327. smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9328. if(k10 >= 10000000)
  9329. smallText.method385(0x49E20E, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  9330.  
  9331. /*smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  9332. smallText.method385(0xffff00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);*/
  9333. }
  9334. }
  9335. }
  9336. } else if(class9_1.sprites != null && i3 < 20) {
  9337. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  9338. if(class30_sub2_sub1_sub1_1 != null)
  9339. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  9340. }
  9341. i3++;
  9342. }
  9343. }
  9344. } else if(class9_1.type == 3) {
  9345. boolean flag = false;
  9346. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  9347. flag = true;
  9348. int j3;
  9349. if(interfaceIsSelected(class9_1)) {
  9350. j3 = class9_1.anInt219;
  9351. if(flag && class9_1.anInt239 != 0)
  9352. j3 = class9_1.anInt239;
  9353. } else {
  9354. j3 = class9_1.textColor;
  9355. if(flag && class9_1.anInt216 != 0)
  9356. j3 = class9_1.anInt216;
  9357. }
  9358. if(class9_1.aByte254 == 0) {
  9359. if(class9_1.aBoolean227)
  9360. DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  9361. else
  9362. DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  9363. } else if(class9_1.aBoolean227)
  9364. DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.aByte254 & 0xff), k2);
  9365. else
  9366. DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.aByte254 & 0xff), j3, class9_1.width, k2);
  9367. } else if(class9_1.type == 4) {
  9368. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  9369. String s = class9_1.message;
  9370. boolean flag1 = false;
  9371. if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  9372. flag1 = true;
  9373. int i4;
  9374. if(interfaceIsSelected(class9_1)) {
  9375. i4 = class9_1.anInt219;
  9376. if(flag1 && class9_1.anInt239 != 0)
  9377. i4 = class9_1.anInt239;
  9378. if(class9_1.aString228.length() > 0)
  9379. s = class9_1.aString228;
  9380. } else {
  9381. i4 = class9_1.textColor;
  9382. if(flag1 && class9_1.anInt216 != 0)
  9383. i4 = class9_1.anInt216;
  9384. }
  9385. if(class9_1.atActionType == 6 && aBoolean1149) {
  9386. s = "Please wait...";
  9387. i4 = class9_1.textColor;
  9388. }
  9389. if(DrawingArea.width == 516) {
  9390. if(i4 == 0xffff00)
  9391. i4 = 255;
  9392. if(i4 == 49152)
  9393. i4 = 0xffffff;
  9394. }
  9395. if((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  9396. switch (i4) {
  9397. case 16773120: i4 = 0xFE981F; break;
  9398. case 7040819: i4 = 0xAF6A1A; break;
  9399. }
  9400. }
  9401. for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
  9402. {
  9403. if(s.indexOf("%") != -1)
  9404. {
  9405. do
  9406. {
  9407. int k7 = s.indexOf("%1");
  9408. if(k7 == -1)
  9409. break;
  9410. 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)
  9411. s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  9412. else
  9413. s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  9414. } while(true);
  9415. do
  9416. {
  9417. int l7 = s.indexOf("%2");
  9418. if(l7 == -1)
  9419. break;
  9420. s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  9421. } while(true);
  9422. do
  9423. {
  9424. int i8 = s.indexOf("%3");
  9425. if(i8 == -1)
  9426. break;
  9427. s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  9428. } while(true);
  9429. do
  9430. {
  9431. int j8 = s.indexOf("%4");
  9432. if(j8 == -1)
  9433. break;
  9434. s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  9435. } while(true);
  9436. do
  9437. {
  9438. int k8 = s.indexOf("%5");
  9439. if(k8 == -1)
  9440. break;
  9441. s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  9442. } while(true);
  9443. }
  9444. int l8 = s.indexOf("\\n");
  9445. String s1;
  9446. if(l8 != -1)
  9447. {
  9448. s1 = s.substring(0, l8);
  9449. s = s.substring(l8 + 2);
  9450. } else
  9451. {
  9452. s1 = s;
  9453. s = "";
  9454. }
  9455. if(class9_1.centerText)
  9456. textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadow);
  9457. else
  9458. textDrawingArea.method389(class9_1.textShadow, k2, i4, s1, l6);
  9459. }
  9460. } else if(class9_1.type == 5) {
  9461. //whats this?
  9462.  
  9463. Sprite sprite;
  9464. if(interfaceIsSelected(class9_1))
  9465. sprite = class9_1.sprite2;
  9466. else
  9467. sprite = class9_1.sprite1;
  9468. if(spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
  9469. sprite.drawSprite(k2, l2, 0xffffff);
  9470. } else {
  9471. if(Autocast && class9_1.id == autocastId)
  9472. magicAuto.drawSprite(k2-3, l2-3);
  9473. if (sprite != null)
  9474. sprite.drawSprite(k2, l2);
  9475. }
  9476. if(sprite != null)
  9477. sprite.drawSprite(k2, l2);
  9478. } else if(class9_1.type == 6) {
  9479. int k3 = Texture.textureInt1;
  9480. int j4 = Texture.textureInt2;
  9481. Texture.textureInt1 = k2 + class9_1.width / 2;
  9482. Texture.textureInt2 = l2 + class9_1.height / 2;
  9483. int i5 = Texture.anIntArray1470[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  9484. int l5 = Texture.anIntArray1471[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  9485. boolean flag2 = interfaceIsSelected(class9_1);
  9486. int i7;
  9487. if(flag2)
  9488. i7 = class9_1.anInt258;
  9489. else
  9490. i7 = class9_1.anInt257;
  9491. Model model;
  9492. if(i7 == -1) {
  9493. model = class9_1.method209(-1, -1, flag2);
  9494. } else {
  9495. Animation animation = Animation.anims[i7];
  9496. model = class9_1.method209(animation.anIntArray354[class9_1.anInt246], animation.anIntArray353[class9_1.anInt246], flag2);
  9497. }
  9498. if(model != null)
  9499. model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  9500. Texture.textureInt1 = k3;
  9501. Texture.textureInt2 = j4;
  9502. } else if(class9_1.type == 7) {
  9503. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  9504. int k4 = 0;
  9505. for(int j5 = 0; j5 < class9_1.height; j5++) {
  9506. for(int i6 = 0; i6 < class9_1.width; i6++) {
  9507. if(class9_1.inv[k4] > 0) {
  9508. ItemDef itemDef = ItemDef.forID(class9_1.inv[k4] - 1);
  9509. String s2 = itemDef.name;
  9510. if(itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  9511. s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  9512. int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  9513. int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  9514. if(class9_1.centerText)
  9515. textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadow);
  9516. else
  9517. textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  9518. }
  9519. k4++;
  9520. }
  9521. }
  9522. } if (class9_1.type == 8 && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id) && anInt1501 == 100) {
  9523.  
  9524. int boxWidth = 0;
  9525. int boxHeight = 0;
  9526. TextDrawingArea textDrawingArea_2 = aTextDrawingArea_1271;
  9527. for (String s1 = class9_1.message; s1.length() > 0;) {
  9528. int l7 = s1.indexOf("\\n");
  9529. String s4;
  9530. if (l7 != -1) {
  9531. s4 = s1.substring(0, l7);
  9532. s1 = s1.substring(l7 + 2);
  9533. } else {
  9534. s4 = s1;
  9535. s1 = "";
  9536. }
  9537. int j10 = textDrawingArea_2.getTextWidth(s4);
  9538. if (j10 > boxWidth) {
  9539. boxWidth = j10;
  9540. }
  9541. boxHeight += textDrawingArea_2.anInt1497 + 1;
  9542. }
  9543. boxWidth += 6;
  9544. boxHeight += 7;
  9545. int xPos = (k2 + class9_1.width) - 5 - boxWidth;
  9546. int yPos = l2 + class9_1.height + 5;
  9547. if (xPos < k2 + 5) {
  9548. xPos = k2 + 5;
  9549. }
  9550. if (xPos + boxWidth > k + class9.width) {
  9551. xPos = (k + class9.width) - boxWidth;
  9552. }
  9553. if (yPos + boxHeight > l + class9.height) {
  9554. yPos = (l + class9.height) - boxHeight;
  9555. }
  9556. if(class9_1.inventoryhover){
  9557. if(xPos + boxWidth+k > 249){
  9558. xPos = 251 - boxWidth-k;
  9559. }
  9560. if(yPos+boxHeight+l >261 ){
  9561. yPos = 245 - boxHeight - l;
  9562. }
  9563. }
  9564. switch (class9_1.id) {
  9565. case 9217:
  9566. case 9220:
  9567. case 9223:
  9568. case 9226:
  9569. case 9229:
  9570. case 9232:
  9571. case 9235:
  9572. case 9238:
  9573. xPos -= 80;
  9574. break;
  9575. case 9239:
  9576. yPos -= 100;
  9577. break;
  9578. }
  9579. DrawingArea.method336(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
  9580. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  9581. String s2 = class9_1.message;
  9582. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2.length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {//anInt1497
  9583. int l11 = s2.indexOf("\\n");
  9584. String s5;
  9585. if (l11 != -1) {
  9586. s5 = s2.substring(0, l11);
  9587. s2 = s2.substring(l11 + 2);
  9588. } else {
  9589. s5 = s2;
  9590. s2 = "";
  9591. }
  9592. textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
  9593. }
  9594. //}
  9595. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  9596. }
  9597. if(class9_1.type == 12) {
  9598. Sprite sprite;
  9599. if(interfaceIsSelected(class9_1))
  9600. sprite = class9_1.sprite2;
  9601. else
  9602. sprite = class9_1.sprite1;
  9603. if(sprite != null)
  9604. sprite.drawAdvancedSprite(k2, l2);
  9605. } else if (class9_1.type == 9) {
  9606. drawHoverBox(k2, l2, class9_1.popupString);
  9607. }
  9608. }
  9609. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  9610. }
  9611.  
  9612. private void randomizeBackground(Background background) {
  9613. int j = 256;
  9614. for(int k = 0; k < anIntArray1190.length; k++)
  9615. anIntArray1190[k] = 0;
  9616.  
  9617. for(int l = 0; l < 5000; l++) {
  9618. int i1 = (int)(Math.random() * 128D * (double)j);
  9619. anIntArray1190[i1] = (int)(Math.random() * 256D);
  9620. }
  9621. for(int j1 = 0; j1 < 20; j1++) {
  9622. for(int k1 = 1; k1 < j - 1; k1++) {
  9623. for(int i2 = 1; i2 < 127; i2++) {
  9624. int k2 = i2 + (k1 << 7);
  9625. anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  9626. }
  9627.  
  9628. }
  9629. int ai[] = anIntArray1190;
  9630. anIntArray1190 = anIntArray1191;
  9631. anIntArray1191 = ai;
  9632. }
  9633. if(background != null) {
  9634. int l1 = 0;
  9635. for(int j2 = 0; j2 < background.anInt1453; j2++) {
  9636. for(int l2 = 0; l2 < background.anInt1452; l2++)
  9637. if(background.aByteArray1450[l1++] != 0) {
  9638. int i3 = l2 + 16 + background.anInt1454;
  9639. int j3 = j2 + 16 + background.anInt1455;
  9640. int k3 = i3 + (j3 << 7);
  9641. anIntArray1190[k3] = 0;
  9642. }
  9643. }
  9644. }
  9645. }
  9646.  
  9647. private void method107(int i, int j, Stream stream, Player player)
  9648. {
  9649. if((i & 0x400) != 0)
  9650. {
  9651. player.anInt1543 = stream.method428();
  9652. player.anInt1545 = stream.method428();
  9653. player.anInt1544 = stream.method428();
  9654. player.anInt1546 = stream.method428();
  9655. player.anInt1547 = stream.method436() + loopCycle;
  9656. player.anInt1548 = stream.method435() + loopCycle;
  9657. player.anInt1549 = stream.method428();
  9658. player.method446();
  9659. }
  9660. if((i & 0x100) != 0)
  9661. {
  9662. player.anInt1520 = stream.method434();
  9663. int k = stream.readDWord();
  9664. player.anInt1524 = k >> 16;
  9665. player.anInt1523 = loopCycle + (k & 0xffff);
  9666. player.anInt1521 = 0;
  9667. player.anInt1522 = 0;
  9668. if(player.anInt1523 > loopCycle)
  9669. player.anInt1521 = -1;
  9670. if(player.anInt1520 == 65535)
  9671. player.anInt1520 = -1;
  9672. }
  9673. if((i & 8) != 0)
  9674. {
  9675. int l = stream.method434();
  9676. if(l == 65535)
  9677. l = -1;
  9678. int i2 = stream.method427();
  9679. if(l == player.anim && l != -1)
  9680. {
  9681. int i3 = Animation.anims[l].anInt365;
  9682. if(i3 == 1)
  9683. {
  9684. player.anInt1527 = 0;
  9685. player.anInt1528 = 0;
  9686. player.anInt1529 = i2;
  9687. player.anInt1530 = 0;
  9688. }
  9689. if(i3 == 2)
  9690. player.anInt1530 = 0;
  9691. } else
  9692. if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  9693. {
  9694. player.anim = l;
  9695. player.anInt1527 = 0;
  9696. player.anInt1528 = 0;
  9697. player.anInt1529 = i2;
  9698. player.anInt1530 = 0;
  9699. player.anInt1542 = player.smallXYIndex;
  9700. }
  9701. }
  9702. if((i & 4) != 0)
  9703. {
  9704. player.textSpoken = stream.readString();
  9705. if(player.textSpoken.charAt(0) == '~')
  9706. {
  9707. player.textSpoken = player.textSpoken.substring(1);
  9708. pushMessage(player.textSpoken, 2, player.name);
  9709. } else
  9710. if(player == myPlayer)
  9711. pushMessage(player.textSpoken, 2, player.name);
  9712. player.anInt1513 = 0;
  9713. player.anInt1531 = 0;
  9714. player.textCycle = 150;
  9715. }
  9716. if((i & 0x80) != 0)
  9717. {
  9718. //right fucking here
  9719. int i1 = stream.method434();
  9720. int j2 = stream.readUnsignedByte();
  9721. int j3 = stream.method427();
  9722. int k3 = stream.currentOffset;
  9723. if(player.name != null && player.visible)
  9724. {
  9725. long l3 = TextClass.longForName(player.name);
  9726. boolean flag = false;
  9727. if(j2 <= 1)
  9728. {
  9729. for(int i4 = 0; i4 < ignoreCount; i4++)
  9730. {
  9731. if(ignoreListAsLongs[i4] != l3)
  9732. continue;
  9733. flag = true;
  9734. break;
  9735. }
  9736.  
  9737. }
  9738. if(!flag && anInt1251 == 0)
  9739. try
  9740. {
  9741. aStream_834.currentOffset = 0;
  9742. stream.method442(j3, 0, aStream_834.buffer);
  9743. aStream_834.currentOffset = 0;
  9744. String s = TextInput.method525(j3, aStream_834);
  9745. //s = Censor.doCensor(s);
  9746. player.textSpoken = s;
  9747. player.anInt1513 = i1 >> 8;
  9748. player.privelage = j2;
  9749. player.anInt1531 = i1 & 0xff;
  9750. player.textCycle = 150;
  9751. if(j2 == 2 || j2 == 3)
  9752. pushMessage(s, 1, "@cr2@" + player.name);
  9753. else if(j2 == 1)
  9754. pushMessage(s, 1, "@cr1@" + player.name);
  9755. else if(j2 == 4)
  9756. pushMessage(s, 1, "@cr4@" + player.name);
  9757. else if(j2 == 5)
  9758. pushMessage(s, 1, "@cr5@" + player.name);
  9759. else if(j2 == 6)
  9760. pushMessage(s, 1, "@cr6@" + player.name);
  9761. else
  9762. pushMessage(s, 2, player.name);
  9763. }
  9764. catch(Exception exception)
  9765. {
  9766. signlink.reporterror("cde2");
  9767. }
  9768. }
  9769. stream.currentOffset = k3 + j3;
  9770. }
  9771. if((i & 1) != 0)
  9772. {
  9773. player.interactingEntity = stream.method434();
  9774. if(player.interactingEntity == 65535)
  9775. player.interactingEntity = -1;
  9776. }
  9777. if((i & 0x10) != 0)
  9778. {
  9779. int j1 = stream.method427();
  9780. byte abyte0[] = new byte[j1];
  9781. Stream stream_1 = new Stream(abyte0);
  9782. stream.readBytes(j1, 0, abyte0);
  9783. aStreamArray895s[j] = stream_1;
  9784. player.updatePlayer(stream_1);
  9785. }
  9786. if((i & 2) != 0)
  9787. {
  9788. player.anInt1538 = stream.method436();
  9789. player.anInt1539 = stream.method434();
  9790. }
  9791. if ((i & 0x20) != 0)
  9792. {
  9793. int k1 = stream.readUnsignedByte();
  9794. int k2 = stream.method426();
  9795. int type1 = stream.readUnsignedByte();
  9796. player.updateHitData(k2, k1, type1, loopCycle);
  9797. player.loopCycleStatus = loopCycle + 300;
  9798. player.currentHealth = stream.method427();
  9799. player.maxHealth = stream.readUnsignedByte();
  9800. }
  9801. if ((i & 0x200) != 0)
  9802. {
  9803. int l1 = stream.readUnsignedByte();
  9804. int l2 = stream.method428();
  9805. int type2 = stream.readUnsignedByte();
  9806. player.updateHitData(l2, l1, type2, loopCycle);
  9807. player.loopCycleStatus = loopCycle + 300;
  9808. player.currentHealth = stream.readUnsignedByte();
  9809. player.maxHealth = stream.method427();
  9810. }
  9811. }
  9812.  
  9813. private void method108()
  9814. {
  9815. try
  9816. {
  9817. int j = myPlayer.x + anInt1278;
  9818. int k = myPlayer.y + anInt1131;
  9819. if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  9820. {
  9821. anInt1014 = j;
  9822. anInt1015 = k;
  9823. }
  9824. if(anInt1014 != j)
  9825. anInt1014 += (j - anInt1014) / 16;
  9826. if(anInt1015 != k)
  9827. anInt1015 += (k - anInt1015) / 16;
  9828. if(super.keyArray[1] == 1)
  9829. anInt1186 += (-24 - anInt1186) / 2;
  9830. else
  9831. if(super.keyArray[2] == 1)
  9832. anInt1186 += (24 - anInt1186) / 2;
  9833. else
  9834. anInt1186 /= 2;
  9835. if(super.keyArray[3] == 1)
  9836. anInt1187 += (12 - anInt1187) / 2;
  9837. else
  9838. if(super.keyArray[4] == 1)
  9839. anInt1187 += (-12 - anInt1187) / 2;
  9840. else
  9841. anInt1187 /= 2;
  9842. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  9843. anInt1184 += anInt1187 / 2;
  9844. if(anInt1184 < 128)
  9845. anInt1184 = 128;
  9846. if(anInt1184 > 383)
  9847. anInt1184 = 383;
  9848. int l = anInt1014 >> 7;
  9849. int i1 = anInt1015 >> 7;
  9850. int j1 = method42(plane, anInt1015, anInt1014);
  9851. int k1 = 0;
  9852. if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  9853. {
  9854. for(int l1 = l - 4; l1 <= l + 4; l1++)
  9855. {
  9856. for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  9857. {
  9858. int l2 = plane;
  9859. if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  9860. l2++;
  9861. int i3 = j1 - intGroundArray[l2][l1][k2];
  9862. if(i3 > k1)
  9863. k1 = i3;
  9864. }
  9865.  
  9866. }
  9867.  
  9868. }
  9869. anInt1005++;
  9870. if(anInt1005 > 1512)
  9871. {
  9872. anInt1005 = 0;
  9873. stream.createFrame(77);
  9874. stream.writeWordBigEndian(0);
  9875. int i2 = stream.currentOffset;
  9876. stream.writeWordBigEndian((int)(Math.random() * 256D));
  9877. stream.writeWordBigEndian(101);
  9878. stream.writeWordBigEndian(233);
  9879. stream.writeWord(45092);
  9880. if((int)(Math.random() * 2D) == 0)
  9881. stream.writeWord(35784);
  9882. stream.writeWordBigEndian((int)(Math.random() * 256D));
  9883. stream.writeWordBigEndian(64);
  9884. stream.writeWordBigEndian(38);
  9885. stream.writeWord((int)(Math.random() * 65536D));
  9886. stream.writeWord((int)(Math.random() * 65536D));
  9887. stream.writeBytes(stream.currentOffset - i2);
  9888. }
  9889. int j2 = k1 * 192;
  9890. if(j2 > 0x17f00)
  9891. j2 = 0x17f00;
  9892. if(j2 < 32768)
  9893. j2 = 32768;
  9894. if(j2 > anInt984)
  9895. {
  9896. anInt984 += (j2 - anInt984) / 24;
  9897. return;
  9898. }
  9899. if(j2 < anInt984)
  9900. {
  9901. anInt984 += (j2 - anInt984) / 80;
  9902. }
  9903. }
  9904. catch(Exception _ex)
  9905. {
  9906. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  9907. throw new RuntimeException("eek");
  9908. }
  9909. }
  9910.  
  9911. public void processDrawing()
  9912. {
  9913. if(rsAlreadyLoaded || loadingError || genericLoadingError)
  9914. {
  9915. showErrorScreen();
  9916. return;
  9917. }
  9918. anInt1061++;
  9919. if(!loggedIn)
  9920. drawLoginScreen(false);
  9921. else
  9922. drawGameScreen();
  9923. anInt1213 = 0;
  9924. }
  9925.  
  9926. private boolean isFriendOrSelf(String s)
  9927. {
  9928. if(s == null)
  9929. return false;
  9930. for(int i = 0; i < friendsCount; i++)
  9931. if(s.equalsIgnoreCase(friendsList[i]))
  9932. return true;
  9933. return s.equalsIgnoreCase(myPlayer.name);
  9934. }
  9935.  
  9936. private static String combatDiffColor(int i, int j)
  9937. {
  9938. int k = i - j;
  9939. if(k < -9)
  9940. return "@red@";
  9941. if(k < -6)
  9942. return "@or3@";
  9943. if(k < -3)
  9944. return "@or2@";
  9945. if(k < 0)
  9946. return "@or1@";
  9947. if(k > 9)
  9948. return "@gre@";
  9949. if(k > 6)
  9950. return "@gr3@";
  9951. if(k > 3)
  9952. return "@gr2@";
  9953. if(k > 0)
  9954. return "@gr1@";
  9955. else
  9956. return "@yel@";
  9957. }
  9958.  
  9959. private void setWaveVolume(int i)
  9960. {
  9961. signlink.wavevol = i;
  9962. }
  9963.  
  9964. private void draw3dScreen()
  9965. {
  9966. drawSplitPrivateChat();
  9967. if(crossType == 1)
  9968. {
  9969. crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9970. anInt1142++;
  9971. if(anInt1142 > 67)
  9972. {
  9973. anInt1142 = 0;
  9974. stream.createFrame(78);
  9975. }
  9976. }
  9977. if(crossType == 2)
  9978. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  9979. if(anInt1018 != -1)
  9980. {
  9981. method119(anInt945, anInt1018);
  9982. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  9983. }
  9984. if(openInterfaceID != -1)
  9985. {
  9986. method119(anInt945, openInterfaceID);
  9987. drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  9988. }
  9989. method70();
  9990. if(!menuOpen)
  9991. {
  9992. processRightClick();
  9993. drawTooltip();
  9994. } else
  9995. drawMenu(4, 4);
  9996. if(anInt1055 == 1)
  9997. multiOverlay.drawSprite(472, 296);
  9998. if(fpsOn)
  9999. {
  10000. char c = '\u01FB';
  10001. int k = 20;
  10002. int i1 = 0xffff00;
  10003. if(super.fps < 15)
  10004. i1 = 0xff0000;
  10005. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  10006. k += 15;
  10007. Runtime runtime = Runtime.getRuntime();
  10008. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10009. i1 = 0xffff00;
  10010. if(j1 > 0x2000000 && lowMem)
  10011. i1 = 0xff0000;
  10012. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  10013. k += 15;
  10014. }
  10015. int i1 = 0xffff00;
  10016. int x = baseX + (myPlayer.x - 6 >> 7);
  10017. int y = baseY + (myPlayer.y - 6 >> 7);
  10018. if (clientData)
  10019. {
  10020. char c = '\u01FB';
  10021. int k = 20;
  10022. if(super.fps < 15)
  10023. i1 = 0xff0000;
  10024. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285, 5);
  10025. Runtime runtime = Runtime.getRuntime();
  10026. int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  10027. i1 = 0xffff00;
  10028. if(j1 > 0x2000000 && lowMem)
  10029. i1 = 0xff0000;
  10030. k += 15;
  10031. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299, 5);
  10032. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  10033. aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
  10034. }
  10035. if(anInt1104 != 0)
  10036. {
  10037. int j = anInt1104 / 50;
  10038. int l = j / 60;
  10039. j %= 60;
  10040. if(j < 10)
  10041. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  10042. else
  10043. aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  10044. anInt849++;
  10045. if(anInt849 > 75)
  10046. {
  10047. anInt849 = 0;
  10048. stream.createFrame(148);
  10049. }
  10050. }
  10051. if(!menuOpen) {
  10052. processRightClick();
  10053. drawTooltip();
  10054. }
  10055. }
  10056.  
  10057. private void addIgnore(long l)
  10058. {
  10059. try
  10060. {
  10061. if(l == 0L)
  10062. return;
  10063. if(ignoreCount >= 100)
  10064. {
  10065. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  10066. return;
  10067. }
  10068. String s = TextClass.fixName(TextClass.nameForLong(l));
  10069. for(int j = 0; j < ignoreCount; j++)
  10070. if(ignoreListAsLongs[j] == l)
  10071. {
  10072. pushMessage(s + " is already on your ignore list", 0, "");
  10073. return;
  10074. }
  10075. for(int k = 0; k < friendsCount; k++)
  10076. if(friendsListAsLongs[k] == l)
  10077. {
  10078. pushMessage("Please remove " + s + " from your friend list first", 0, "");
  10079. return;
  10080. }
  10081.  
  10082. ignoreListAsLongs[ignoreCount++] = l;
  10083. needDrawTabArea = true;
  10084. stream.createFrame(133);
  10085. stream.writeQWord(l);
  10086. return;
  10087. }
  10088. catch(RuntimeException runtimeexception)
  10089. {
  10090. signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  10091. }
  10092. throw new RuntimeException();
  10093. }
  10094.  
  10095. private void method114()
  10096. {
  10097. for(int i = -1; i < playerCount; i++)
  10098. {
  10099. int j;
  10100. if(i == -1)
  10101. j = myPlayerIndex;
  10102. else
  10103. j = playerIndices[i];
  10104. Player player = playerArray[j];
  10105. if(player != null)
  10106. method96(player);
  10107. }
  10108.  
  10109. }
  10110.  
  10111. private void method115()
  10112. {
  10113. if(loadingStage == 2)
  10114. {
  10115. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10116. {
  10117. if(class30_sub1.anInt1294 > 0)
  10118. class30_sub1.anInt1294--;
  10119. if(class30_sub1.anInt1294 == 0)
  10120. {
  10121. if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  10122. {
  10123. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  10124. class30_sub1.unlink();
  10125. }
  10126. } else
  10127. {
  10128. if(class30_sub1.anInt1302 > 0)
  10129. class30_sub1.anInt1302--;
  10130. 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)))
  10131. {
  10132. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  10133. class30_sub1.anInt1302 = -1;
  10134. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  10135. class30_sub1.unlink();
  10136. else
  10137. if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  10138. class30_sub1.unlink();
  10139. }
  10140. }
  10141. }
  10142.  
  10143. }
  10144. }
  10145.  
  10146.  
  10147. private void determineMenuSize() {
  10148. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  10149. for(int j = 0; j < menuActionRow; j++)
  10150. {
  10151. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  10152. if(k > i)
  10153. i = k;
  10154. }
  10155.  
  10156. i += 8;
  10157. int l = 15 * menuActionRow + 21;
  10158. int i1 = super.saveClickX - i / 2;
  10159. if(i1 + i > 760)
  10160. i1 = 760 - i;
  10161. if(i1 < 0)
  10162. i1 = 0;
  10163. int l1 = super.saveClickY;
  10164. if(l1 + l > 497)
  10165. l1 = 497 - l;
  10166. if(l1 < 0)
  10167. l1 = 0;
  10168. menuOpen = true;
  10169. menuScreenArea = 0;
  10170. menuOffsetX = i1;
  10171. menuOffsetY = l1;
  10172. menuWidth = i;
  10173. menuHeight = 15 * menuActionRow + 22;
  10174. }
  10175.  
  10176. private void method117(Stream stream)
  10177. {
  10178. stream.initBitAccess();
  10179. int j = stream.readBits(1);
  10180. if(j == 0)
  10181. return;
  10182. int k = stream.readBits(2);
  10183. if(k == 0)
  10184. {
  10185. anIntArray894[anInt893++] = myPlayerIndex;
  10186. return;
  10187. }
  10188. if(k == 1)
  10189. {
  10190. int l = stream.readBits(3);
  10191. myPlayer.moveInDir(false, l);
  10192. int k1 = stream.readBits(1);
  10193. if(k1 == 1)
  10194. anIntArray894[anInt893++] = myPlayerIndex;
  10195. return;
  10196. }
  10197. if(k == 2)
  10198. {
  10199. int i1 = stream.readBits(3);
  10200. myPlayer.moveInDir(true, i1);
  10201. int l1 = stream.readBits(3);
  10202. myPlayer.moveInDir(true, l1);
  10203. int j2 = stream.readBits(1);
  10204. if(j2 == 1)
  10205. anIntArray894[anInt893++] = myPlayerIndex;
  10206. return;
  10207. }
  10208. if(k == 3)
  10209. {
  10210. plane = stream.readBits(2);
  10211. int j1 = stream.readBits(1);
  10212. int i2 = stream.readBits(1);
  10213. if(i2 == 1)
  10214. anIntArray894[anInt893++] = myPlayerIndex;
  10215. int k2 = stream.readBits(7);
  10216. int l2 = stream.readBits(7);
  10217. myPlayer.setPos(l2, k2, j1 == 1);
  10218. }
  10219. }
  10220.  
  10221. private void nullLoader()
  10222. {
  10223. aBoolean831 = false;
  10224. while(drawingFlames)
  10225. {
  10226. aBoolean831 = false;
  10227. try
  10228. {
  10229. Thread.sleep(50L);
  10230. }
  10231. catch(Exception _ex) { }
  10232. }
  10233. aBackground_966 = null;
  10234. aBackground_967 = null;
  10235. aBackgroundArray1152s = null;
  10236. anIntArray850 = null;
  10237. anIntArray851 = null;
  10238. anIntArray852 = null;
  10239. anIntArray853 = null;
  10240. anIntArray1190 = null;
  10241. anIntArray1191 = null;
  10242. anIntArray828 = null;
  10243. anIntArray829 = null;
  10244. aClass30_Sub2_Sub1_Sub1_1201 = null;
  10245. aClass30_Sub2_Sub1_Sub1_1202 = null;
  10246. }
  10247.  
  10248. private boolean method119(int i, int j)
  10249. {
  10250. boolean flag1 = false;
  10251. RSInterface class9 = RSInterface.interfaceCache[j];
  10252. for(int k = 0; k < class9.children.length; k++)
  10253. {
  10254. if(class9.children[k] == -1)
  10255. break;
  10256. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  10257. if(class9_1.type == 1)
  10258. flag1 |= method119(i, class9_1.id);
  10259. if(class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1))
  10260. {
  10261. boolean flag2 = interfaceIsSelected(class9_1);
  10262. int l;
  10263. if(flag2)
  10264. l = class9_1.anInt258;
  10265. else
  10266. l = class9_1.anInt257;
  10267. if(l != -1)
  10268. {
  10269. Animation animation = Animation.anims[l];
  10270. for(class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);)
  10271. {
  10272. class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  10273. class9_1.anInt246++;
  10274. if(class9_1.anInt246 >= animation.anInt352)
  10275. {
  10276. class9_1.anInt246 -= animation.anInt356;
  10277. if(class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  10278. class9_1.anInt246 = 0;
  10279. }
  10280. flag1 = true;
  10281. }
  10282.  
  10283. }
  10284. }
  10285. }
  10286.  
  10287. return flag1;
  10288. }
  10289.  
  10290. private int method120()
  10291. {
  10292. int j = 3;
  10293. if(yCameraCurve < 310)
  10294. {
  10295. int k = xCameraPos >> 7;
  10296. int l = yCameraPos >> 7;
  10297. int i1 = myPlayer.x >> 7;
  10298. int j1 = myPlayer.y >> 7;
  10299. if((byteGroundArray[plane][k][l] & 4) != 0)
  10300. j = plane;
  10301. int k1;
  10302. if(i1 > k)
  10303. k1 = i1 - k;
  10304. else
  10305. k1 = k - i1;
  10306. int l1;
  10307. if(j1 > l)
  10308. l1 = j1 - l;
  10309. else
  10310. l1 = l - j1;
  10311. if(k1 > l1)
  10312. {
  10313. int i2 = (l1 * 0x10000) / k1;
  10314. int k2 = 32768;
  10315. while(k != i1)
  10316. {
  10317. if(k < i1)
  10318. k++;
  10319. else
  10320. if(k > i1)
  10321. k--;
  10322. if((byteGroundArray[plane][k][l] & 4) != 0)
  10323. j = plane;
  10324. k2 += i2;
  10325. if(k2 >= 0x10000)
  10326. {
  10327. k2 -= 0x10000;
  10328. if(l < j1)
  10329. l++;
  10330. else
  10331. if(l > j1)
  10332. l--;
  10333. if((byteGroundArray[plane][k][l] & 4) != 0)
  10334. j = plane;
  10335. }
  10336. }
  10337. } else
  10338. {
  10339. int j2 = (k1 * 0x10000) / l1;
  10340. int l2 = 32768;
  10341. while(l != j1)
  10342. {
  10343. if(l < j1)
  10344. l++;
  10345. else
  10346. if(l > j1)
  10347. l--;
  10348. if((byteGroundArray[plane][k][l] & 4) != 0)
  10349. j = plane;
  10350. l2 += j2;
  10351. if(l2 >= 0x10000)
  10352. {
  10353. l2 -= 0x10000;
  10354. if(k < i1)
  10355. k++;
  10356. else
  10357. if(k > i1)
  10358. k--;
  10359. if((byteGroundArray[plane][k][l] & 4) != 0)
  10360. j = plane;
  10361. }
  10362. }
  10363. }
  10364. }
  10365. if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  10366. j = plane;
  10367. return j;
  10368. }
  10369.  
  10370. private int method121()
  10371. {
  10372. int j = method42(plane, yCameraPos, xCameraPos);
  10373. if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  10374. return plane;
  10375. else
  10376. return 3;
  10377. }
  10378.  
  10379. private void delIgnore(long l)
  10380. {
  10381. try
  10382. {
  10383. if(l == 0L)
  10384. return;
  10385. for(int j = 0; j < ignoreCount; j++)
  10386. if(ignoreListAsLongs[j] == l)
  10387. {
  10388. ignoreCount--;
  10389. needDrawTabArea = true;
  10390. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  10391.  
  10392. stream.createFrame(74);
  10393. stream.writeQWord(l);
  10394. return;
  10395. }
  10396.  
  10397. return;
  10398. }
  10399. catch(RuntimeException runtimeexception)
  10400. {
  10401. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  10402. }
  10403. throw new RuntimeException();
  10404. }
  10405.  
  10406.  
  10407. private void chatJoin(long l) {
  10408. try {
  10409. if(l == 0L)
  10410. return;
  10411. stream.createFrame(60);
  10412. stream.writeQWord(l);
  10413. return;
  10414. }
  10415. catch(RuntimeException runtimeexception)
  10416. {
  10417. signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  10418. }
  10419. throw new RuntimeException();
  10420.  
  10421. }
  10422.  
  10423. public String getParameter(String s)
  10424. {
  10425. if(signlink.mainapp != null)
  10426. return signlink.mainapp.getParameter(s);
  10427. else
  10428. return super.getParameter(s);
  10429. }
  10430.  
  10431. private void adjustVolume(boolean flag, int i)
  10432. {
  10433. signlink.midivol = i;
  10434. if(flag)
  10435. signlink.midi = "voladjust";
  10436. }
  10437.  
  10438. private int extractInterfaceValues(RSInterface class9, int j)
  10439. {
  10440. if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  10441. return -2;
  10442. try
  10443. {
  10444. int ai[] = class9.valueIndexArray[j];
  10445. int k = 0;
  10446. int l = 0;
  10447. int i1 = 0;
  10448. do
  10449. {
  10450. int j1 = ai[l++];
  10451. int k1 = 0;
  10452. byte byte0 = 0;
  10453. if(j1 == 0)
  10454. return k;
  10455. if(j1 == 1)
  10456. k1 = currentStats[ai[l++]];
  10457. if(j1 == 2)
  10458. k1 = maxStats[ai[l++]];
  10459. if(j1 == 3)
  10460. k1 = currentExp[ai[l++]];
  10461. if(j1 == 4)
  10462. {
  10463. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  10464. int k2 = ai[l++];
  10465. if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  10466. {
  10467. for(int j3 = 0; j3 < class9_1.inv.length; j3++)
  10468. if(class9_1.inv[j3] == k2 + 1)
  10469. k1 += class9_1.invStackSizes[j3];
  10470.  
  10471. }
  10472. }
  10473. if(j1 == 5)
  10474. k1 = variousSettings[ai[l++]];
  10475. if(j1 == 6)
  10476. k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  10477. if(j1 == 7)
  10478. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  10479. if(j1 == 8)
  10480. k1 = myPlayer.combatLevel;
  10481. if(j1 == 9)
  10482. {
  10483. for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  10484. if(Skills.skillEnabled[l1])
  10485. k1 += maxStats[l1];
  10486.  
  10487. }
  10488. if(j1 == 10)
  10489. {
  10490. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  10491. int l2 = ai[l++] + 1;
  10492. if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  10493. {
  10494. for(int k3 = 0; k3 < class9_2.inv.length; k3++)
  10495. {
  10496. if(class9_2.inv[k3] != l2)
  10497. continue;
  10498. k1 = 0x3b9ac9ff;
  10499. break;
  10500. }
  10501.  
  10502. }
  10503. }
  10504. if(j1 == 11)
  10505. k1 = energy;
  10506. if(j1 == 12)
  10507. k1 = weight;
  10508. if(j1 == 13)
  10509. {
  10510. int i2 = variousSettings[ai[l++]];
  10511. int i3 = ai[l++];
  10512. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  10513. }
  10514. if(j1 == 14)
  10515. {
  10516. int j2 = ai[l++];
  10517. VarBit varBit = VarBit.cache[j2];
  10518. int l3 = varBit.anInt648;
  10519. int i4 = varBit.anInt649;
  10520. int j4 = varBit.anInt650;
  10521. int k4 = anIntArray1232[j4 - i4];
  10522. k1 = variousSettings[l3] >> i4 & k4;
  10523. }
  10524. if(j1 == 15)
  10525. byte0 = 1;
  10526. if(j1 == 16)
  10527. byte0 = 2;
  10528. if(j1 == 17)
  10529. byte0 = 3;
  10530. if(j1 == 18)
  10531. k1 = (myPlayer.x >> 7) + baseX;
  10532. if(j1 == 19)
  10533. k1 = (myPlayer.y >> 7) + baseY;
  10534. if(j1 == 20)
  10535. k1 = ai[l++];
  10536. if(byte0 == 0)
  10537. {
  10538. if(i1 == 0)
  10539. k += k1;
  10540. if(i1 == 1)
  10541. k -= k1;
  10542. if(i1 == 2 && k1 != 0)
  10543. k /= k1;
  10544. if(i1 == 3)
  10545. k *= k1;
  10546. i1 = 0;
  10547. } else
  10548. {
  10549. i1 = byte0;
  10550. }
  10551. } while(true);
  10552. }
  10553. catch(Exception _ex)
  10554. {
  10555. return -1;
  10556. }
  10557. }
  10558.  
  10559. private void drawTooltip() {
  10560. if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  10561. return;
  10562. String s;
  10563. if(itemSelected == 1 && menuActionRow < 2)
  10564. s = "Use " + selectedItemName + " with...";
  10565. else if(spellSelected == 1 && menuActionRow < 2)
  10566. s = spellTooltip + "...";
  10567. else
  10568. s = menuActionName[menuActionRow - 1];
  10569. if(menuActionRow > 2)
  10570. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  10571. newRegularFont2.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  10572. }
  10573.  
  10574. private void drawMinimap() {
  10575. aRSImageProducer_1164.initDrawingArea();
  10576. if(anInt1021 == 2) {
  10577. drawLogout();
  10578. drawHP();
  10579. drawPrayer();
  10580. drawRunOrb();
  10581. drawXPCounter();
  10582. byte abyte0[] = mapBack.aByteArray1450;
  10583. int ai[] = DrawingArea.pixels;
  10584. int k2 = abyte0.length;
  10585. for(int i5 = 0; i5 < k2; i5++)
  10586. if(abyte0[i5] == 0)
  10587. ai[i5] = 0;
  10588. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 8, 8, 33, 25);
  10589. if(menuOpen){
  10590. drawMenu(516, 0);
  10591. }
  10592. aRSImageProducer_1165.initDrawingArea();
  10593. return;
  10594. }
  10595. int i = minimapInt1 + minimapInt2 & 0x7ff;
  10596. int j = 48 + myPlayer.x / 32;
  10597. int l2 = 464 - myPlayer.y / 32;
  10598. for (int x = 0; x < anIntArray1229.length; x++){
  10599. anIntArray1229[x] = 170;
  10600. anIntArray1052[x] = -23;
  10601. }
  10602. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, 10, 45, 146, j);
  10603. compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 8, 10, 33, 25);
  10604. for(int j5 = 0; j5 < anInt1071; j5++) {
  10605. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  10606. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  10607. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  10608. }
  10609. for(int k5 = 0; k5 < 104; k5++) {
  10610. for(int l5 = 0; l5 < 104; l5++) {
  10611. NodeList class19 = groundArray[plane][k5][l5];
  10612. if(class19 != null) {
  10613. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  10614. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  10615. markMinimap(mapDotItem, l, j3);
  10616. }
  10617. }
  10618. }
  10619. for(int i6 = 0; i6 < npcCount; i6++) {
  10620. NPC npc = npcArray[npcIndices[i6]];
  10621. if(npc != null && npc.isVisible()) {
  10622. EntityDef entityDef = npc.desc;
  10623. if(entityDef.childrenIDs != null)
  10624. entityDef = entityDef.method161();
  10625. if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  10626. int i1 = npc.x / 32 - myPlayer.x / 32;
  10627. int k3 = npc.y / 32 - myPlayer.y / 32;
  10628. markMinimap(mapDotNPC, i1, k3);
  10629. }
  10630. }
  10631. }
  10632. for(int j6 = 0; j6 < playerCount; j6++) {
  10633. Player player = playerArray[playerIndices[j6]];
  10634. if(player != null && player.isVisible()) {
  10635. int j1 = player.x / 32 - myPlayer.x / 32;
  10636. int l3 = player.y / 32 - myPlayer.y / 32;
  10637. boolean flag1 = false;
  10638. long l6 = TextClass.longForName(player.name);
  10639. for(int k6 = 0; k6 < friendsCount; k6++) {
  10640. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  10641. continue;
  10642. flag1 = true;
  10643. break;
  10644. }
  10645. boolean flag2 = false;
  10646. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  10647. flag2 = true;
  10648. if(flag1)
  10649. markMinimap(mapDotFriend, j1, l3);
  10650. else if(flag2)
  10651. markMinimap(mapDotTeam, j1, l3);
  10652. else
  10653. markMinimap(mapDotPlayer, j1, l3);
  10654. }
  10655. }
  10656. if(anInt855 != 0 && loopCycle % 20 < 10) {
  10657. if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  10658. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  10659. if(class30_sub2_sub4_sub1_sub1_1 != null) {
  10660. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  10661. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  10662. method81(mapMarker, i4, k1);
  10663. }
  10664. }
  10665. if(anInt855 == 2) {
  10666. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  10667. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  10668. method81(mapMarker, j4, l1);
  10669. }
  10670. if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length) {
  10671. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  10672. if(class30_sub2_sub4_sub1_sub2_1 != null) {
  10673. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  10674. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  10675. method81(mapMarker, k4, i2);
  10676. }
  10677. }
  10678. }
  10679. if(destX != 0) {
  10680. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  10681. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  10682. markMinimap(mapFlag, j2, l4);
  10683. }
  10684. if(ToggleMinimap) {
  10685. for(int j6 = 0; j6 < playerCount; j6++)
  10686. {
  10687. Player player = playerArray[playerIndices[j6]];
  10688. if(player != null && player.isVisible())
  10689. {
  10690. int j1 = player.x / 32 - myPlayer.x / 32;
  10691. int l3 = player.y / 32 - myPlayer.y / 32;
  10692. boolean flag1 = false;
  10693. long l6 = TextClass.longForName(player.name);
  10694.  
  10695. int k = minimapInt1 + minimapInt2 & 0x7ff;
  10696. int l = j1 * j1 + l3 * l3;
  10697. int i1 = Model.modelIntArray1[k];
  10698. int j12 = Model.modelIntArray2[k];
  10699. i1 = (i1 * 256) / (minimapInt3 + 256);
  10700. j12 = (j12 * 256) / (minimapInt3 + 256);
  10701. int k1 = l3 * i1 + j1 * j12 >> 16;
  10702. int l1 = l3 * j12 - j1 * i1 >> 16;
  10703.  
  10704. for(int k6 = 0; k6 < friendsCount; k6++)
  10705. {
  10706. if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  10707. continue;
  10708. flag1 = true;
  10709. break;
  10710. }
  10711.  
  10712. boolean flag2 = false;
  10713. if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  10714. flag2 = true;
  10715. if(flag1){//Friend
  10716. smallText.method382(65280, (105 + k1),player.name, (88 - l1)-10, true);
  10717. }else
  10718. if(flag2){//Team
  10719. }
  10720. else{//Player
  10721. smallText.method382(65280, (105 + k1),""+player.combatLevel, (88 - l1)-10, true);
  10722. }
  10723. }
  10724. }
  10725. }
  10726. DrawingArea.drawPixels(3, 84, 115, 0xffffff, 3);
  10727. mapArea.drawSprite(0, 0);
  10728. drawLogout();
  10729. drawHP();
  10730. drawPrayer();
  10731. drawRunOrb();
  10732. drawXPCounter();
  10733. if(menuOpen)
  10734. drawMenu(516, 0);
  10735. aRSImageProducer_1165.initDrawingArea();
  10736. }
  10737.  
  10738. private void npcScreenPos(Entity entity, int i) {
  10739. calcEntityScreenPos(entity.x, i, entity.y);
  10740. }
  10741.  
  10742. private void calcEntityScreenPos(int i, int j, int l) {
  10743. if(i < 128 || l < 128 || i > 13056 || l > 13056) {
  10744. spriteDrawX = -1;
  10745. spriteDrawY = -1;
  10746. return;
  10747. }
  10748. int i1 = method42(plane, l, i) - j;
  10749. i -= xCameraPos;
  10750. i1 -= zCameraPos;
  10751. l -= yCameraPos;
  10752. int j1 = Model.modelIntArray1[yCameraCurve];
  10753. int k1 = Model.modelIntArray2[yCameraCurve];
  10754. int l1 = Model.modelIntArray1[xCameraCurve];
  10755. int i2 = Model.modelIntArray2[xCameraCurve];
  10756. int j2 = l * l1 + i * i2 >> 16;
  10757. l = l * i2 - i * l1 >> 16;
  10758. i = j2;
  10759. j2 = i1 * k1 - l * j1 >> 16;
  10760. l = i1 * j1 + l * k1 >> 16;
  10761. i1 = j2;
  10762. if(l >= 50) {
  10763. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  10764. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  10765. } else {
  10766. spriteDrawX = -1;
  10767. spriteDrawY = -1;
  10768. }
  10769. }
  10770.  
  10771. private void buildSplitPrivateChatMenu()
  10772. {
  10773. if(splitPrivateChat == 0)
  10774. return;
  10775. int i = 0;
  10776. if(anInt1104 != 0)
  10777. i = 1;
  10778. for(int j = 0; j < 100; j++)
  10779. if(chatMessages[j] != null)
  10780. {
  10781. int k = chatTypes[j];
  10782. String s = chatNames[j];
  10783. boolean flag1 = false;
  10784. if(s != null && s.startsWith("@cr1@"))
  10785. {
  10786. s = s.substring(5);
  10787. boolean flag2 = true;
  10788. }
  10789. if(s != null && s.startsWith("@cr2@"))
  10790. {
  10791. s = s.substring(5);
  10792. byte byte0 = 2;
  10793. }
  10794. if(s != null && s.startsWith("@cr4@"))
  10795. {
  10796. s = s.substring(5);
  10797. byte byte0 = 4;
  10798. }
  10799. if(s != null && s.startsWith("@cr5@"))
  10800. {
  10801. s = s.substring(5);
  10802. byte byte0 = 5;
  10803. }
  10804. if(s != null && s.startsWith("@cr6@"))
  10805. {
  10806. s = s.substring(5);
  10807. byte byte0 = 6;
  10808. }
  10809. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  10810. {
  10811. int l = 329 - i * 13;
  10812. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  10813. {
  10814. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  10815. if(i1 > 450)
  10816. i1 = 450;
  10817. if(super.mouseX < 4 + i1)
  10818. {
  10819. if(myPrivilege >= 1)
  10820. {
  10821. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  10822. menuActionID[menuActionRow] = 2606;
  10823. menuActionRow++;
  10824. }
  10825. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  10826. menuActionID[menuActionRow] = 2042;
  10827. menuActionRow++;
  10828. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  10829. menuActionID[menuActionRow] = 2337;
  10830. menuActionRow++;
  10831. }
  10832. }
  10833. if(++i >= 5)
  10834. return;
  10835. }
  10836. if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  10837. return;
  10838. }
  10839.  
  10840. }
  10841.  
  10842. private void method130(int j, int k, int l, int i1, int j1, int k1,
  10843. int l1, int i2, int j2)
  10844. {
  10845. Class30_Sub1 class30_sub1 = null;
  10846. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10847. {
  10848. if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  10849. continue;
  10850. class30_sub1 = class30_sub1_1;
  10851. break;
  10852. }
  10853.  
  10854. if(class30_sub1 == null)
  10855. {
  10856. class30_sub1 = new Class30_Sub1();
  10857. class30_sub1.anInt1295 = l1;
  10858. class30_sub1.anInt1296 = i1;
  10859. class30_sub1.anInt1297 = i2;
  10860. class30_sub1.anInt1298 = j1;
  10861. method89(class30_sub1);
  10862. aClass19_1179.insertHead(class30_sub1);
  10863. }
  10864. class30_sub1.anInt1291 = k;
  10865. class30_sub1.anInt1293 = k1;
  10866. class30_sub1.anInt1292 = l;
  10867. class30_sub1.anInt1302 = j2;
  10868. class30_sub1.anInt1294 = j;
  10869. }
  10870.  
  10871. private boolean interfaceIsSelected(RSInterface class9)
  10872. {
  10873. if(class9.anIntArray245 == null)
  10874. return false;
  10875. for(int i = 0; i < class9.anIntArray245.length; i++)
  10876. {
  10877. int j = extractInterfaceValues(class9, i);
  10878. int k = class9.anIntArray212[i];
  10879. if(class9.anIntArray245[i] == 2)
  10880. {
  10881. if(j >= k)
  10882. return false;
  10883. } else
  10884. if(class9.anIntArray245[i] == 3)
  10885. {
  10886. if(j <= k)
  10887. return false;
  10888. } else
  10889. if(class9.anIntArray245[i] == 4)
  10890. {
  10891. if(j == k)
  10892. return false;
  10893. } else
  10894. if(j != k)
  10895. return false;
  10896. }
  10897.  
  10898. return true;
  10899. }
  10900.  
  10901. private DataInputStream openJagGrabInputStream(String s)
  10902. throws IOException
  10903. {
  10904. // if(!aBoolean872)
  10905. // if(signlink.mainapp != null)
  10906. // return signlink.openurl(s);
  10907. // else
  10908. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  10909. if(aSocket832 != null)
  10910. {
  10911. try
  10912. {
  10913. aSocket832.close();
  10914. }
  10915. catch(Exception _ex) { }
  10916. aSocket832 = null;
  10917. }
  10918. aSocket832 = openSocket(43595);
  10919. aSocket832.setSoTimeout(10000);
  10920. java.io.InputStream inputstream = aSocket832.getInputStream();
  10921. OutputStream outputstream = aSocket832.getOutputStream();
  10922. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  10923. return new DataInputStream(inputstream);
  10924. }
  10925.  
  10926. private void doFlamesDrawing()
  10927. {
  10928. char c = '\u0100';
  10929. if(anInt1040 > 0)
  10930. {
  10931. for(int i = 0; i < 256; i++)
  10932. if(anInt1040 > 768)
  10933. anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  10934. else
  10935. if(anInt1040 > 256)
  10936. anIntArray850[i] = anIntArray852[i];
  10937. else
  10938. anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  10939.  
  10940. } else
  10941. if(anInt1041 > 0)
  10942. {
  10943. for(int j = 0; j < 256; j++)
  10944. if(anInt1041 > 768)
  10945. anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  10946. else
  10947. if(anInt1041 > 256)
  10948. anIntArray850[j] = anIntArray853[j];
  10949. else
  10950. anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  10951.  
  10952. } else
  10953. {
  10954. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  10955.  
  10956. }
  10957. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, aRSImageProducer_1110.pixels, 0, 33920);
  10958.  
  10959. int i1 = 0;
  10960. int j1 = 1152;
  10961. for(int k1 = 1; k1 < c - 1; k1++)
  10962. {
  10963. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  10964. int j2 = 22 + l1;
  10965. if(j2 < 0)
  10966. j2 = 0;
  10967. i1 += j2;
  10968. for(int l2 = j2; l2 < 128; l2++)
  10969. {
  10970. int j3 = anIntArray828[i1++];
  10971. if(j3 != 0)
  10972. {
  10973. int l3 = j3;
  10974. int j4 = 256 - j3;
  10975. j3 = anIntArray850[j3];
  10976. int l4 = aRSImageProducer_1110.pixels[j1];
  10977. aRSImageProducer_1110.pixels[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  10978. } else
  10979. {
  10980. j1++;
  10981. }
  10982. }
  10983.  
  10984. j1 += j2;
  10985. }
  10986.  
  10987. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  10988. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, aRSImageProducer_1111.pixels, 0, 33920);
  10989.  
  10990. i1 = 0;
  10991. j1 = 1176;
  10992. for(int k2 = 1; k2 < c - 1; k2++)
  10993. {
  10994. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  10995. int k3 = 103 - i3;
  10996. j1 += i3;
  10997. for(int i4 = 0; i4 < k3; i4++)
  10998. {
  10999. int k4 = anIntArray828[i1++];
  11000. if(k4 != 0)
  11001. {
  11002. int i5 = k4;
  11003. int j5 = 256 - k4;
  11004. k4 = anIntArray850[k4];
  11005. int k5 = aRSImageProducer_1111.pixels[j1];
  11006. aRSImageProducer_1111.pixels[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  11007. } else
  11008. {
  11009. j1++;
  11010. }
  11011. }
  11012.  
  11013. i1 += 128 - k3;
  11014. j1 += 128 - k3 - i3;
  11015. }
  11016.  
  11017. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  11018. }
  11019.  
  11020. private void method134(Stream stream)
  11021. {
  11022. int j = stream.readBits(8);
  11023. if(j < playerCount)
  11024. {
  11025. for(int k = j; k < playerCount; k++)
  11026. anIntArray840[anInt839++] = playerIndices[k];
  11027.  
  11028. }
  11029. if(j > playerCount)
  11030. {
  11031. signlink.reporterror(myUsername + " Too many players");
  11032. throw new RuntimeException("eek");
  11033. }
  11034. playerCount = 0;
  11035. for(int l = 0; l < j; l++)
  11036. {
  11037. int i1 = playerIndices[l];
  11038. Player player = playerArray[i1];
  11039. int j1 = stream.readBits(1);
  11040. if(j1 == 0)
  11041. {
  11042. playerIndices[playerCount++] = i1;
  11043. player.anInt1537 = loopCycle;
  11044. } else
  11045. {
  11046. int k1 = stream.readBits(2);
  11047. if(k1 == 0)
  11048. {
  11049. playerIndices[playerCount++] = i1;
  11050. player.anInt1537 = loopCycle;
  11051. anIntArray894[anInt893++] = i1;
  11052. } else
  11053. if(k1 == 1)
  11054. {
  11055. playerIndices[playerCount++] = i1;
  11056. player.anInt1537 = loopCycle;
  11057. int l1 = stream.readBits(3);
  11058. player.moveInDir(false, l1);
  11059. int j2 = stream.readBits(1);
  11060. if(j2 == 1)
  11061. anIntArray894[anInt893++] = i1;
  11062. } else
  11063. if(k1 == 2)
  11064. {
  11065. playerIndices[playerCount++] = i1;
  11066. player.anInt1537 = loopCycle;
  11067. int i2 = stream.readBits(3);
  11068. player.moveInDir(true, i2);
  11069. int k2 = stream.readBits(3);
  11070. player.moveInDir(true, k2);
  11071. int l2 = stream.readBits(1);
  11072. if(l2 == 1)
  11073. anIntArray894[anInt893++] = i1;
  11074. } else
  11075. if(k1 == 3)
  11076. anIntArray840[anInt839++] = i1;
  11077. }
  11078. }
  11079. }
  11080.  
  11081. public void drawLoginScreen(boolean flag) {
  11082. setDefaultCursor();
  11083. resetImageProducers();
  11084. backgroundFix.drawAdvancedSprite(0, 0);
  11085. aRSImageProducer_1109.initDrawingArea();
  11086. titleBox.drawBackground(254, 140);
  11087. char c = '\u0168';
  11088. char c1 = '\310';
  11089. if (loginScreenState == 0) {
  11090. int i = 100;
  11091. aTextDrawingArea_1271.method382(0x75a9a9, c / 190,
  11092. onDemandFetcher.statusString, i, true);
  11093. int l = 275;
  11094. int k1 = 300;
  11095. if ((this.mouseX >= 276) && (this.mouseX <= 493) && (this.mouseY >= 199) && (this.mouseY <= 224)) {
  11096. this.boxHover.drawSprite(276, 198);
  11097. }
  11098. else if ((this.mouseX >= 276) && (this.mouseX <= 492) && (this.mouseY >= 245) && (this.mouseY <= 272)) {
  11099. this.boxHover.drawSprite(276, 244);
  11100. }
  11101. this.smallText.method382(16777215, 385, this.loginMessage1, 283, true);
  11102. this.smallText.method382(16777215, 385, this.loginMessage2, 297, true);
  11103. this.aTextDrawingArea_1271.method389(false, 281, 16777215, new StringBuilder().append("").append(capitalize(myUsername)).append(((this.loginScreenCursorPos == 0 ? 1 : 0) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 ? "|" : "").toString(), 217);
  11104. this.aTextDrawingArea_1271.method389(true, 281, 16777215, new StringBuilder().append("").append(TextClass.passwordAsterisks(myPassword)).append(((this.loginScreenCursorPos == 1 ? 1 : 0) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 ? "|" : "").toString(), 263);
  11105. if ((this.mouseX >= 293) && (this.mouseX <= 474) && (this.mouseY >= 302) && (this.mouseY <= 327))
  11106. this.loginHover.drawSprite(296, 301);
  11107. int j = 277;
  11108. }
  11109. aRSImageProducer_1109.drawGraphics(0, super.graphics, 0);
  11110. if (welcomeScreenRaised) {
  11111. }
  11112. }
  11113.  
  11114. private void drawFlames()
  11115. {
  11116. }
  11117.  
  11118. public void raiseWelcomeScreen()
  11119. {
  11120. welcomeScreenRaised = true;
  11121. }
  11122.  
  11123. private void method137(Stream stream, int j)
  11124. {
  11125. if(j == 84)
  11126. {
  11127. int k = stream.readUnsignedByte();
  11128. int j3 = anInt1268 + (k >> 4 & 7);
  11129. int i6 = anInt1269 + (k & 7);
  11130. int l8 = stream.readUnsignedWord();
  11131. int k11 = stream.readUnsignedWord();
  11132. int l13 = stream.readUnsignedWord();
  11133. if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  11134. {
  11135. NodeList class19_1 = groundArray[plane][j3][i6];
  11136. if(class19_1 != null)
  11137. {
  11138. 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())
  11139. {
  11140. if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  11141. continue;
  11142. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  11143. break;
  11144. }
  11145.  
  11146. spawnGroundItem(j3, i6);
  11147. }
  11148. }
  11149. return;
  11150. }
  11151. if(j == 105)
  11152. {
  11153. int l = stream.readUnsignedByte();
  11154. int k3 = anInt1268 + (l >> 4 & 7);
  11155. int j6 = anInt1269 + (l & 7);
  11156. int i9 = stream.readUnsignedWord();
  11157. int l11 = stream.readUnsignedByte();
  11158. int i14 = l11 >> 4 & 0xf;
  11159. int i16 = l11 & 7;
  11160. 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)
  11161. {
  11162. anIntArray1207[anInt1062] = i9;
  11163. anIntArray1241[anInt1062] = i16;
  11164. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  11165. anInt1062++;
  11166. }
  11167. }
  11168. if(j == 215)
  11169. {
  11170. int i1 = stream.method435();
  11171. int l3 = stream.method428();
  11172. int k6 = anInt1268 + (l3 >> 4 & 7);
  11173. int j9 = anInt1269 + (l3 & 7);
  11174. int i12 = stream.method435();
  11175. int j14 = stream.readUnsignedWord();
  11176. if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  11177. {
  11178. Item class30_sub2_sub4_sub2_2 = new Item();
  11179. class30_sub2_sub4_sub2_2.ID = i1;
  11180. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  11181. if(groundArray[plane][k6][j9] == null)
  11182. groundArray[plane][k6][j9] = new NodeList();
  11183. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  11184. spawnGroundItem(k6, j9);
  11185. }
  11186. return;
  11187. }
  11188. if(j == 156)
  11189. {
  11190. int j1 = stream.method426();
  11191. int i4 = anInt1268 + (j1 >> 4 & 7);
  11192. int l6 = anInt1269 + (j1 & 7);
  11193. int k9 = stream.readUnsignedWord();
  11194. if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  11195. {
  11196. NodeList class19 = groundArray[plane][i4][l6];
  11197. if(class19 != null)
  11198. {
  11199. for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  11200. {
  11201. if(item.ID != (k9 & 0x7fff))
  11202. continue;
  11203. item.unlink();
  11204. break;
  11205. }
  11206.  
  11207. if(class19.reverseGetFirst() == null)
  11208. groundArray[plane][i4][l6] = null;
  11209. spawnGroundItem(i4, l6);
  11210. }
  11211. }
  11212. return;
  11213. }
  11214. if(j == 160)
  11215. {
  11216. int k1 = stream.method428();
  11217. int j4 = anInt1268 + (k1 >> 4 & 7);
  11218. int i7 = anInt1269 + (k1 & 7);
  11219. int l9 = stream.method428();
  11220. int j12 = l9 >> 2;
  11221. int k14 = l9 & 3;
  11222. int j16 = anIntArray1177[j12];
  11223. int j17 = stream.method435();
  11224. if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  11225. {
  11226. int j18 = intGroundArray[plane][j4][i7];
  11227. int i19 = intGroundArray[plane][j4 + 1][i7];
  11228. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  11229. int k20 = intGroundArray[plane][j4][i7 + 1];
  11230. if(j16 == 0)
  11231. {
  11232. Object1 class10 = worldController.method296(plane, j4, i7);
  11233. if(class10 != null)
  11234. {
  11235. int k21 = class10.uid >> 14 & 0x7fff;
  11236. if(j12 == 2)
  11237. {
  11238. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  11239. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  11240. } else
  11241. {
  11242. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  11243. }
  11244. }
  11245. }
  11246. if(j16 == 1)
  11247. {
  11248. Object2 class26 = worldController.method297(j4, i7, plane);
  11249. if(class26 != null)
  11250. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  11251. }
  11252. if(j16 == 2)
  11253. {
  11254. Object5 class28 = worldController.method298(j4, i7, plane);
  11255. if(j12 == 11)
  11256. j12 = 10;
  11257. if(class28 != null)
  11258. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  11259. }
  11260. if(j16 == 3)
  11261. {
  11262. Object3 class49 = worldController.method299(i7, j4, plane);
  11263. if(class49 != null)
  11264. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  11265. }
  11266. }
  11267. return;
  11268. }
  11269. if(j == 147)
  11270. {
  11271. int l1 = stream.method428();
  11272. int k4 = anInt1268 + (l1 >> 4 & 7);
  11273. int j7 = anInt1269 + (l1 & 7);
  11274. int i10 = stream.readUnsignedWord();
  11275. byte byte0 = stream.method430();
  11276. int l14 = stream.method434();
  11277. byte byte1 = stream.method429();
  11278. int k17 = stream.readUnsignedWord();
  11279. int k18 = stream.method428();
  11280. int j19 = k18 >> 2;
  11281. int i20 = k18 & 3;
  11282. int l20 = anIntArray1177[j19];
  11283. byte byte2 = stream.readSignedByte();
  11284. int l21 = stream.readUnsignedWord();
  11285. byte byte3 = stream.method429();
  11286. Player player;
  11287. if(i10 == unknownInt10)
  11288. player = myPlayer;
  11289. else
  11290. player = playerArray[i10];
  11291. if(player != null)
  11292. {
  11293. ObjectDef class46 = ObjectDef.forID(l21);
  11294. int i22 = intGroundArray[plane][k4][j7];
  11295. int j22 = intGroundArray[plane][k4 + 1][j7];
  11296. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  11297. int l22 = intGroundArray[plane][k4][j7 + 1];
  11298. Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  11299. if(model != null)
  11300. {
  11301. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  11302. player.anInt1707 = l14 + loopCycle;
  11303. player.anInt1708 = k17 + loopCycle;
  11304. player.aModel_1714 = model;
  11305. int i23 = class46.anInt744;
  11306. int j23 = class46.anInt761;
  11307. if(i20 == 1 || i20 == 3)
  11308. {
  11309. i23 = class46.anInt761;
  11310. j23 = class46.anInt744;
  11311. }
  11312. player.anInt1711 = k4 * 128 + i23 * 64;
  11313. player.anInt1713 = j7 * 128 + j23 * 64;
  11314. player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  11315. if(byte2 > byte0)
  11316. {
  11317. byte byte4 = byte2;
  11318. byte2 = byte0;
  11319. byte0 = byte4;
  11320. }
  11321. if(byte3 > byte1)
  11322. {
  11323. byte byte5 = byte3;
  11324. byte3 = byte1;
  11325. byte1 = byte5;
  11326. }
  11327. player.anInt1719 = k4 + byte2;
  11328. player.anInt1721 = k4 + byte0;
  11329. player.anInt1720 = j7 + byte3;
  11330. player.anInt1722 = j7 + byte1;
  11331. }
  11332. }
  11333. }
  11334. if(j == 151)
  11335. {
  11336. int i2 = stream.method426();
  11337. int l4 = anInt1268 + (i2 >> 4 & 7);
  11338. int k7 = anInt1269 + (i2 & 7);
  11339. int j10 = stream.method434();
  11340. int k12 = stream.method428();
  11341. int i15 = k12 >> 2;
  11342. int k16 = k12 & 3;
  11343. int l17 = anIntArray1177[i15];
  11344. if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  11345. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  11346. return;
  11347. }
  11348. if(j == 4)
  11349. {
  11350. int j2 = stream.readUnsignedByte();
  11351. int i5 = anInt1268 + (j2 >> 4 & 7);
  11352. int l7 = anInt1269 + (j2 & 7);
  11353. int k10 = stream.readUnsignedWord();
  11354. int l12 = stream.readUnsignedByte();
  11355. int j15 = stream.readUnsignedWord();
  11356. if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  11357. {
  11358. i5 = i5 * 128 + 64;
  11359. l7 = l7 * 128 + 64;
  11360. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  11361. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  11362. }
  11363. return;
  11364. }
  11365. if(j == 44)
  11366. {
  11367. int k2 = stream.method436();
  11368. int j5 = stream.readUnsignedWord();
  11369. int i8 = stream.readUnsignedByte();
  11370. int l10 = anInt1268 + (i8 >> 4 & 7);
  11371. int i13 = anInt1269 + (i8 & 7);
  11372. if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  11373. {
  11374. Item class30_sub2_sub4_sub2_1 = new Item();
  11375. class30_sub2_sub4_sub2_1.ID = k2;
  11376. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  11377. if(groundArray[plane][l10][i13] == null)
  11378. groundArray[plane][l10][i13] = new NodeList();
  11379. groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  11380. spawnGroundItem(l10, i13);
  11381. }
  11382. return;
  11383. }
  11384. if(j == 101)
  11385. {
  11386. int l2 = stream.method427();
  11387. int k5 = l2 >> 2;
  11388. int j8 = l2 & 3;
  11389. int i11 = anIntArray1177[k5];
  11390. int j13 = stream.readUnsignedByte();
  11391. int k15 = anInt1268 + (j13 >> 4 & 7);
  11392. int l16 = anInt1269 + (j13 & 7);
  11393. if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  11394. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  11395. return;
  11396. }
  11397. if(j == 117)
  11398. {
  11399. int i3 = stream.readUnsignedByte();
  11400. int l5 = anInt1268 + (i3 >> 4 & 7);
  11401. int k8 = anInt1269 + (i3 & 7);
  11402. int j11 = l5 + stream.readSignedByte();
  11403. int k13 = k8 + stream.readSignedByte();
  11404. int l15 = stream.readSignedWord();
  11405. int i17 = stream.readUnsignedWord();
  11406. int i18 = stream.readUnsignedByte() * 4;
  11407. int l18 = stream.readUnsignedByte() * 4;
  11408. int k19 = stream.readUnsignedWord();
  11409. int j20 = stream.readUnsignedWord();
  11410. int i21 = stream.readUnsignedByte();
  11411. int j21 = stream.readUnsignedByte();
  11412. if(l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535)
  11413. {
  11414. l5 = l5 * 128 + 64;
  11415. k8 = k8 * 128 + 64;
  11416. j11 = j11 * 128 + 64;
  11417. k13 = k13 * 128 + 64;
  11418. 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);
  11419. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  11420. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  11421. }
  11422. }
  11423. }
  11424.  
  11425. private static void setLowMem()
  11426. {
  11427. WorldController.lowMem = true;
  11428. Texture.lowMem = true;
  11429. lowMem = true;
  11430. ObjectManager.lowMem = true;
  11431. ObjectDef.lowMem = true;
  11432. }
  11433.  
  11434. private void method139(Stream stream)
  11435. {
  11436. stream.initBitAccess();
  11437. int k = stream.readBits(8);
  11438. if(k < npcCount)
  11439. {
  11440. for(int l = k; l < npcCount; l++)
  11441. anIntArray840[anInt839++] = npcIndices[l];
  11442.  
  11443. }
  11444. if(k > npcCount)
  11445. {
  11446. signlink.reporterror(myUsername + " Too many npcs");
  11447. throw new RuntimeException("eek");
  11448. }
  11449. npcCount = 0;
  11450. for(int i1 = 0; i1 < k; i1++)
  11451. {
  11452. int j1 = npcIndices[i1];
  11453. NPC npc = npcArray[j1];
  11454. int k1 = stream.readBits(1);
  11455. if(k1 == 0)
  11456. {
  11457. npcIndices[npcCount++] = j1;
  11458. npc.anInt1537 = loopCycle;
  11459. } else
  11460. {
  11461. int l1 = stream.readBits(2);
  11462. if(l1 == 0)
  11463. {
  11464. npcIndices[npcCount++] = j1;
  11465. npc.anInt1537 = loopCycle;
  11466. anIntArray894[anInt893++] = j1;
  11467. } else
  11468. if(l1 == 1)
  11469. {
  11470. npcIndices[npcCount++] = j1;
  11471. npc.anInt1537 = loopCycle;
  11472. int i2 = stream.readBits(3);
  11473. npc.moveInDir(false, i2);
  11474. int k2 = stream.readBits(1);
  11475. if(k2 == 1)
  11476. anIntArray894[anInt893++] = j1;
  11477. } else
  11478. if(l1 == 2)
  11479. {
  11480. npcIndices[npcCount++] = j1;
  11481. npc.anInt1537 = loopCycle;
  11482. int j2 = stream.readBits(3);
  11483. npc.moveInDir(true, j2);
  11484. int l2 = stream.readBits(3);
  11485. npc.moveInDir(true, l2);
  11486. int i3 = stream.readBits(1);
  11487. if(i3 == 1)
  11488. anIntArray894[anInt893++] = j1;
  11489. } else
  11490. if(l1 == 3)
  11491. anIntArray840[anInt839++] = j1;
  11492. }
  11493. }
  11494.  
  11495. }
  11496.  
  11497. private void processLoginScreenInput() {
  11498. if (this.loginScreenState == 0) {
  11499. int l = super.myHeight / 2 + 20;
  11500. l += 20;
  11501. int i = this.myHeight / 2 - 40;
  11502. i += 30;
  11503. i += 25;
  11504. resetImage();
  11505. if (super.clickMode3 == 1 && super.saveClickX >= 276
  11506. && super.saveClickX <= 490 && super.saveClickY >= 194
  11507. && super.saveClickY <= 223)
  11508. loginScreenCursorPos = 0;
  11509. if (super.clickMode3 == 1 && super.mouseX >= 276
  11510. && super.mouseX <= 490 && super.mouseY >= 240
  11511. && super.mouseY <= 270)
  11512. loginScreenCursorPos = 1;
  11513. if (super.clickMode3 == 1 && super.saveClickX >= 295
  11514. && super.saveClickX <= 474 && super.saveClickY >= 301
  11515. && super.saveClickY <= 325) {
  11516. loginFailures = 0;
  11517. if ((myUsername.length() > 0) && (myPassword.length() > 0)) {
  11518. login(myUsername, myPassword, false);
  11519. } else {
  11520. this.loginScreenCursorPos = 0;
  11521. this.loginMessage1 = "Username & Password";
  11522. this.loginMessage2 = "Must be more than 1 character";
  11523. }
  11524. if (this.loggedIn)
  11525. return;
  11526. }
  11527. do {
  11528. int l1 = readChar(-796);
  11529. if (l1 == -1)
  11530. break;
  11531. boolean flag1 = false;
  11532. for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  11533. if (l1 != validUserPassChars.charAt(i2))
  11534. continue;
  11535. flag1 = true;
  11536. break;
  11537. }
  11538.  
  11539. if (loginScreenCursorPos == 0) {
  11540. if (l1 == 8 && myUsername.length() > 0)
  11541. myUsername = myUsername.substring(0,
  11542. myUsername.length() - 1);
  11543. if (l1 == 9 || l1 == 10 || l1 == 13)
  11544. loginScreenCursorPos = 1;
  11545. if (flag1)
  11546. myUsername += (char) l1;
  11547. if (myUsername.length() > 12)
  11548. myUsername = myUsername.substring(0, 12);
  11549. } else if (loginScreenCursorPos == 1) {
  11550. if (l1 == 8 && myPassword.length() > 0)
  11551. myPassword = myPassword.substring(0,
  11552. myPassword.length() - 1);
  11553. if (l1 == 9 || l1 == 10 || l1 == 13)
  11554. loginScreenCursorPos = 0;
  11555. if (flag1)
  11556. myPassword += (char) l1;
  11557. if (myPassword.length() > 20)
  11558. myPassword = myPassword.substring(0, 20);
  11559. }
  11560. } while (true);
  11561. return;
  11562. }
  11563. if (loginScreenState == 3) {
  11564. int k = super.myWidth / 2;
  11565. int j1 = super.myHeight / 2 + 50;
  11566. j1 += 20;
  11567. if (super.clickMode3 == 1 && super.saveClickX >= k - 75
  11568. && super.saveClickX <= k + 75
  11569. && super.saveClickY >= j1 - 20
  11570. && super.saveClickY <= j1 + 20)
  11571. loginScreenState = 0;
  11572. }
  11573. }
  11574.  
  11575. private void markMinimap(Sprite sprite, int i, int j) {
  11576. int k = minimapInt1 + minimapInt2 & 0x7ff;
  11577. int l = i * i + j * j;
  11578. if(l > 6400)
  11579. return;
  11580. int i1 = Model.modelIntArray1[k];
  11581. int j1 = Model.modelIntArray2[k];
  11582. i1 = (i1 * 256) / (minimapInt3 + 256);
  11583. j1 = (j1 * 256) / (minimapInt3 + 256);
  11584. int k1 = j * i1 + i * j1 >> 16;
  11585. int l1 = j * j1 - i * i1 >> 16;
  11586. if(l > 2500) {
  11587. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 + 20, 83 - l1 - sprite.anInt1445 / 2 - 4 + 5);
  11588. } else {
  11589. sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 + 20, 83 - l1 - sprite.anInt1445 / 2 - 4 + 5);
  11590. }
  11591. }
  11592.  
  11593. private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  11594. )
  11595. {
  11596. if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  11597. {
  11598. if(lowMem && j != plane)
  11599. return;
  11600. int i2 = 0;
  11601. if(j1 == 0)
  11602. i2 = worldController.method300(j, i1, i);
  11603. if(j1 == 1)
  11604. i2 = worldController.method301(j, i1, i);
  11605. if(j1 == 2)
  11606. i2 = worldController.method302(j, i1, i);
  11607. if(j1 == 3)
  11608. i2 = worldController.method303(j, i1, i);
  11609. if(i2 != 0)
  11610. {
  11611. int i3 = worldController.method304(j, i1, i, i2);
  11612. int j2 = i2 >> 14 & 0x7fff;
  11613. int k2 = i3 & 0x1f;
  11614. int l2 = i3 >> 6;
  11615. if(j1 == 0)
  11616. {
  11617. worldController.method291(i1, j, i, (byte)-119);
  11618. ObjectDef class46 = ObjectDef.forID(j2);
  11619. if(class46.aBoolean767)
  11620. aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  11621. }
  11622. if(j1 == 1)
  11623. worldController.method292(i, j, i1);
  11624. if(j1 == 2)
  11625. {
  11626. worldController.method293(j, i1, i);
  11627. ObjectDef class46_1 = ObjectDef.forID(j2);
  11628. if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  11629. return;
  11630. if(class46_1.aBoolean767)
  11631. aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  11632. }
  11633. if(j1 == 3)
  11634. {
  11635. worldController.method294(j, i, i1);
  11636. ObjectDef class46_2 = ObjectDef.forID(j2);
  11637. if(class46_2.aBoolean767 && class46_2.hasActions)
  11638. aClass11Array1230[j].method218(i, i1);
  11639. }
  11640. }
  11641. if(k1 >= 0)
  11642. {
  11643. int j3 = j;
  11644. if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  11645. j3++;
  11646. ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  11647. }
  11648. }
  11649. }
  11650.  
  11651. private void updatePlayers(int i, Stream stream)
  11652. {
  11653. anInt839 = 0;
  11654. anInt893 = 0;
  11655. method117(stream);
  11656. method134(stream);
  11657. method91(stream, i);
  11658. method49(stream);
  11659. for(int k = 0; k < anInt839; k++)
  11660. {
  11661. int l = anIntArray840[k];
  11662. if(playerArray[l].anInt1537 != loopCycle)
  11663. playerArray[l] = null;
  11664. }
  11665.  
  11666. if(stream.currentOffset != i)
  11667. {
  11668. signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  11669. throw new RuntimeException("eek");
  11670. }
  11671. for(int i1 = 0; i1 < playerCount; i1++)
  11672. if(playerArray[playerIndices[i1]] == null)
  11673. {
  11674. signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  11675. throw new RuntimeException("eek");
  11676. }
  11677.  
  11678. }
  11679.  
  11680. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  11681. {
  11682. int l1 = 2048 - k & 0x7ff;
  11683. int i2 = 2048 - j1 & 0x7ff;
  11684. int j2 = 0;
  11685. int k2 = 0;
  11686. int l2 = j;
  11687. if(l1 != 0)
  11688. {
  11689. int i3 = Model.modelIntArray1[l1];
  11690. int k3 = Model.modelIntArray2[l1];
  11691. int i4 = k2 * k3 - l2 * i3 >> 16;
  11692. l2 = k2 * i3 + l2 * k3 >> 16;
  11693. k2 = i4;
  11694. }
  11695. if(i2 != 0)
  11696. {
  11697. /* xxx if(cameratoggle){
  11698. if(zoom == 0)
  11699. zoom = k2;
  11700. if(lftrit == 0)
  11701. lftrit = j2;
  11702. if(fwdbwd == 0)
  11703. fwdbwd = l2;
  11704. k2 = zoom;
  11705. j2 = lftrit;
  11706. l2 = fwdbwd;
  11707. }
  11708. */
  11709. int j3 = Model.modelIntArray1[i2];
  11710. int l3 = Model.modelIntArray2[i2];
  11711. int j4 = l2 * j3 + j2 * l3 >> 16;
  11712. l2 = l2 * l3 - j2 * j3 >> 16;
  11713. j2 = j4;
  11714. }
  11715. xCameraPos = l - j2;
  11716. zCameraPos = i1 - k2;
  11717. yCameraPos = k1 - l2;
  11718. yCameraCurve = k;
  11719. xCameraCurve = j1;
  11720. }
  11721.  
  11722. public void updateStrings(String str, int i) {
  11723. switch(i) {
  11724. case 1675: sendFrame126(str, 17508); break;//Stab
  11725. case 1676: sendFrame126(str, 17509); break;//Slash
  11726. case 1677: sendFrame126(str, 17510); break;//Cursh
  11727. case 1678: sendFrame126(str, 17511); break;//Magic
  11728. case 1679: sendFrame126(str, 17512); break;//Range
  11729. case 1680: sendFrame126(str, 17513); break;//Stab
  11730. case 1681: sendFrame126(str, 17514); break;//Slash
  11731. case 1682: sendFrame126(str, 17515); break;//Crush
  11732. case 1683: sendFrame126(str, 17516); break;//Magic
  11733. case 1684: sendFrame126(str, 17517); break;//Range
  11734. case 1686: sendFrame126(str, 17518); break;//Strength
  11735. case 1687: sendFrame126(str, 17519); break;//Prayer
  11736. }
  11737. }
  11738.  
  11739. public void sendFrame126(String str,int i) {
  11740. RSInterface.interfaceCache[i].message = str;
  11741. if(RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  11742. needDrawTabArea = true;
  11743. }
  11744.  
  11745. public void sendPacket185(int button,int toggle,int type) {
  11746. switch(type) {
  11747. case 135:
  11748. RSInterface class9 = RSInterface.interfaceCache[button];
  11749. boolean flag8 = true;
  11750. if(class9.contentType > 0)
  11751. flag8 = promptUserForInput(class9);
  11752. if(flag8) {
  11753. stream.createFrame(185);
  11754. stream.writeWord(button);
  11755. }
  11756. break;
  11757. case 646:
  11758. stream.createFrame(185);
  11759. stream.writeWord(button);
  11760. RSInterface class9_2 = RSInterface.interfaceCache[button];
  11761. if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  11762. if(variousSettings[toggle] != class9_2.anIntArray212[0]) {
  11763. variousSettings[toggle] = class9_2.anIntArray212[0];
  11764. method33(toggle);
  11765. needDrawTabArea = true;
  11766. }
  11767. }
  11768. break;
  11769. case 169:
  11770. stream.createFrame(185);
  11771. stream.writeWord(button);
  11772. RSInterface class9_3 = RSInterface.interfaceCache[button];
  11773. if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  11774. variousSettings[toggle] = 1 - variousSettings[toggle];
  11775. method33(toggle);
  11776. needDrawTabArea = true;
  11777. }
  11778. switch(button) {
  11779. case 19136:
  11780. System.out.println("toggle = "+toggle);
  11781. if(toggle == 0)
  11782. sendFrame36(173,toggle);
  11783. if(toggle == 1)
  11784. sendPacket185(153,173,646);
  11785. break;
  11786. }
  11787. break;
  11788. }
  11789. }
  11790.  
  11791. public void sendFrame36(int id,int state) {
  11792. anIntArray1045[id] = state;
  11793. if(variousSettings[id] != state) {
  11794. variousSettings[id] = state;
  11795. method33(id);
  11796. needDrawTabArea = true;
  11797. if(dialogID != -1)
  11798. inputTaken = true;
  11799. }
  11800. }
  11801.  
  11802. public void sendFrame219() {
  11803. if(invOverlayInterfaceID != -1) {
  11804. invOverlayInterfaceID = -1;
  11805. needDrawTabArea = true;
  11806. tabAreaAltered = true;
  11807. }
  11808. if(backDialogID != -1) {
  11809. backDialogID = -1;
  11810. inputTaken = true;
  11811. }
  11812. if(inputDialogState != 0) {
  11813. inputDialogState = 0;
  11814. inputTaken = true;
  11815. }
  11816. openInterfaceID = -1;
  11817. aBoolean1149 = false;
  11818. }
  11819.  
  11820. public void sendFrame248(int interfaceID,int sideInterfaceID) {
  11821. if(backDialogID != -1) {
  11822. backDialogID = -1;
  11823. inputTaken = true;
  11824. }
  11825. if(inputDialogState != 0) {
  11826. inputDialogState = 0;
  11827. inputTaken = true;
  11828. }
  11829. openInterfaceID = interfaceID;
  11830. invOverlayInterfaceID = sideInterfaceID;
  11831. needDrawTabArea = true;
  11832. tabAreaAltered = true;
  11833. aBoolean1149 = false;
  11834. }
  11835.  
  11836. private boolean parsePacket() {
  11837. if(socketStream == null)
  11838. return false;
  11839. try {
  11840. int i = socketStream.available();
  11841. if(i == 0)
  11842. return false;
  11843. if(pktType == -1) {
  11844. socketStream.flushInputStream(inStream.buffer, 1);
  11845. pktType = inStream.buffer[0] & 0xff;
  11846. if(encryption != null)
  11847. pktType = pktType - encryption.getNextKey() & 0xff;
  11848. pktSize = SizeConstants.packetSizes[pktType];
  11849. i--;
  11850. }
  11851. if(pktSize == -1)
  11852. if(i > 0) {
  11853. socketStream.flushInputStream(inStream.buffer, 1);
  11854. pktSize = inStream.buffer[0] & 0xff;
  11855. i--;
  11856. } else {
  11857. return false;
  11858. }
  11859. if(pktSize == -2)
  11860. if(i > 1) {
  11861. socketStream.flushInputStream(inStream.buffer, 2);
  11862. inStream.currentOffset = 0;
  11863. pktSize = inStream.readUnsignedWord();
  11864. i -= 2;
  11865. } else {
  11866. return false;
  11867. }
  11868. if(i < pktSize)
  11869. return false;
  11870. inStream.currentOffset = 0;
  11871. socketStream.flushInputStream(inStream.buffer, pktSize);
  11872. anInt1009 = 0;
  11873. anInt843 = anInt842;
  11874. anInt842 = anInt841;
  11875. anInt841 = pktType;
  11876. switch(pktType) {
  11877. case 81:
  11878. updatePlayers(pktSize, inStream);
  11879. aBoolean1080 = false;
  11880. pktType = -1;
  11881. return true;
  11882.  
  11883. case 176:
  11884. daysSinceRecovChange = inStream.method427();
  11885. unreadMessages = inStream.method435();
  11886. membersInt = inStream.readUnsignedByte();
  11887. anInt1193 = inStream.method440();
  11888. daysSinceLastLogin = inStream.readUnsignedWord();
  11889. if(anInt1193 != 0 && openInterfaceID == -1) {
  11890. signlink.dnslookup(TextClass.method586(anInt1193));
  11891. clearTopInterfaces();
  11892. char c = '\u028A';
  11893. if(daysSinceRecovChange != 201 || membersInt == 1)
  11894. c = '\u028F';
  11895. reportAbuseInput = "";
  11896. canMute = false;
  11897. for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  11898. if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  11899. continue;
  11900. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  11901.  
  11902. }
  11903. }
  11904. pktType = -1;
  11905. return true;
  11906.  
  11907. case 64:
  11908. anInt1268 = inStream.method427();
  11909. anInt1269 = inStream.method428();
  11910. for(int j = anInt1268; j < anInt1268 + 8; j++) {
  11911. for(int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  11912. if(groundArray[plane][j][l9] != null) {
  11913. groundArray[plane][j][l9] = null;
  11914. spawnGroundItem(j, l9);
  11915. }
  11916. }
  11917. for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  11918. if(class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  11919. class30_sub1.anInt1294 = 0;
  11920. pktType = -1;
  11921. return true;
  11922.  
  11923. case 185:
  11924. int k = inStream.method436();
  11925. RSInterface.interfaceCache[k].anInt233 = 3;
  11926. if(myPlayer.desc == null)
  11927. 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];
  11928. else
  11929. RSInterface.interfaceCache[k].mediaID = (int)(0x12345678L + myPlayer.desc.type);
  11930. pktType = -1;
  11931. return true;
  11932.  
  11933. /* Clan chat packet */
  11934. case 217:
  11935. try {
  11936. name = inStream.readString();
  11937. message = inStream.readString();
  11938. clanname = inStream.readString();
  11939. rights = inStream.readUnsignedWord();
  11940. //message = TextInput.processText(message);
  11941. //message = Censor.doCensor(message);
  11942. System.out.println(clanname);
  11943. pushMessage(message, 16, name);
  11944. } catch(Exception e) {
  11945. e.printStackTrace();
  11946. }
  11947. pktType = -1;
  11948. return true;
  11949.  
  11950. case 107:
  11951. aBoolean1160 = false;
  11952. for(int l = 0; l < 5; l++)
  11953. aBooleanArray876[l] = false;
  11954. xpCounter = 0;
  11955. pktType = -1;
  11956. return true;
  11957.  
  11958. case 72:
  11959. int i1 = inStream.method434();
  11960. RSInterface class9 = RSInterface.interfaceCache[i1];
  11961. for(int k15 = 0; k15 < class9.inv.length; k15++) {
  11962. class9.inv[k15] = -1;
  11963. class9.inv[k15] = 0;
  11964. }
  11965. pktType = -1;
  11966. return true;
  11967.  
  11968. case 214:
  11969. ignoreCount = pktSize / 8;
  11970. for(int j1 = 0; j1 < ignoreCount; j1++)
  11971. ignoreListAsLongs[j1] = inStream.readQWord();
  11972. pktType = -1;
  11973. return true;
  11974.  
  11975. case 166:
  11976. aBoolean1160 = true;
  11977. anInt1098 = inStream.readUnsignedByte();
  11978. anInt1099 = inStream.readUnsignedByte();
  11979. anInt1100 = inStream.readUnsignedWord();
  11980. anInt1101 = inStream.readUnsignedByte();
  11981. anInt1102 = inStream.readUnsignedByte();
  11982. if(anInt1102 >= 100) {
  11983. xCameraPos = anInt1098 * 128 + 64;
  11984. yCameraPos = anInt1099 * 128 + 64;
  11985. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  11986. }
  11987. pktType = -1;
  11988. return true;
  11989.  
  11990. case 134:
  11991. needDrawTabArea = true;
  11992. int k1 = inStream.readUnsignedByte();
  11993. int i10 = inStream.method439();
  11994. int l15 = inStream.readUnsignedByte();
  11995. int oldXp = currentExp[k1];
  11996. if(drawXpBar) {
  11997. drawFlag = true;
  11998. }
  11999. currentExp[k1] = i10;
  12000. currentStats[k1] = l15;
  12001. maxStats[k1] = 1;
  12002. testXp += i10-oldXp;
  12003. xpToDraw += i10-oldXp;
  12004. if(testXp == currentExp[k1]) {
  12005. testXp = 0;
  12006. xpToDraw = 0;
  12007. }
  12008. for(int k20 = 0; k20 < 98; k20++)
  12009. if(i10 >= anIntArray1019[k20])
  12010. maxStats[k1] = k20 + 2;
  12011. pktType = -1;
  12012. return true;
  12013.  
  12014. case 71:
  12015. int l1 = inStream.readUnsignedWord();
  12016. int j10 = inStream.method426();
  12017. if(l1 == 65535)
  12018. l1 = -1;
  12019. tabInterfaceIDs[j10] = l1;
  12020. needDrawTabArea = true;
  12021. tabAreaAltered = true;
  12022. pktType = -1;
  12023. return true;
  12024.  
  12025. case 74:
  12026. int i2 = inStream.method434();
  12027. if(i2 == 65535)
  12028. i2 = -1;
  12029. if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  12030. nextSong = i2;
  12031. songChanging = true;
  12032. onDemandFetcher.method558(2, nextSong);
  12033. }
  12034. currentSong = i2;
  12035. pktType = -1;
  12036. return true;
  12037.  
  12038. case 121:
  12039. int j2 = inStream.method436();
  12040. int k10 = inStream.method435();
  12041. if(musicEnabled && !lowMem) {
  12042. nextSong = j2;
  12043. songChanging = false;
  12044. onDemandFetcher.method558(2, nextSong);
  12045. prevSong = k10;
  12046. }
  12047. pktType = -1;
  12048. return true;
  12049.  
  12050. case 109:
  12051. resetLogout();
  12052. pktType = -1;
  12053. return false;
  12054.  
  12055. case 70:
  12056. int k2 = inStream.readSignedWord();
  12057. int l10 = inStream.method437();
  12058. int i16 = inStream.method434();
  12059. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  12060. class9_5.anInt263 = k2;
  12061. class9_5.anInt265 = l10;
  12062. pktType = -1;
  12063. return true;
  12064.  
  12065. case 73:
  12066. case 241:
  12067. int l2 = anInt1069;
  12068. int i11 = anInt1070;
  12069. if(pktType == 73) {
  12070. l2 = inStream.method435();
  12071. i11 = inStream.readUnsignedWord();
  12072. aBoolean1159 = false;
  12073. }
  12074. if(pktType == 241) {
  12075. i11 = inStream.method435();
  12076. inStream.initBitAccess();
  12077. for(int j16 = 0; j16 < 4; j16++) {
  12078. for(int l20 = 0; l20 < 13; l20++) {
  12079. for(int j23 = 0; j23 < 13; j23++) {
  12080. int i26 = inStream.readBits(1);
  12081. if(i26 == 1)
  12082. anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  12083. else
  12084. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  12085. }
  12086. }
  12087. }
  12088. inStream.finishBitAccess();
  12089. l2 = inStream.readUnsignedWord();
  12090. aBoolean1159 = true;
  12091. }
  12092. if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  12093. pktType = -1;
  12094. return true;
  12095. }
  12096. anInt1069 = l2;
  12097. anInt1070 = i11;
  12098. baseX = (anInt1069 - 6) * 8;
  12099. baseY = (anInt1070 - 6) * 8;
  12100. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  12101. if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  12102. aBoolean1141 = true;
  12103. loadingStage = 1;
  12104. aLong824 = System.currentTimeMillis();
  12105. aRSImageProducer_1165.initDrawingArea();
  12106. loadingPleaseWait.drawSprite(8,9);;
  12107. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  12108. if(pktType == 73) {
  12109. int k16 = 0;
  12110. for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  12111. for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  12112. k16++;
  12113. }
  12114. aByteArrayArray1183 = new byte[k16][];
  12115. aByteArrayArray1247 = new byte[k16][];
  12116. anIntArray1234 = new int[k16];
  12117. anIntArray1235 = new int[k16];
  12118. anIntArray1236 = new int[k16];
  12119. k16 = 0;
  12120. for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  12121. for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  12122. anIntArray1234[k16] = (l23 << 8) + j26;
  12123. if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  12124. anIntArray1235[k16] = -1;
  12125. anIntArray1236[k16] = -1;
  12126. k16++;
  12127. } else {
  12128. int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  12129. if(k28 != -1)
  12130. onDemandFetcher.method558(3, k28);
  12131. int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  12132. if(j30 != -1)
  12133. onDemandFetcher.method558(3, j30);
  12134. k16++;
  12135. }
  12136. }
  12137. }
  12138. }
  12139. if(pktType == 241) {
  12140. int l16 = 0;
  12141. int ai[] = new int[676];
  12142. for(int i24 = 0; i24 < 4; i24++) {
  12143. for(int k26 = 0; k26 < 13; k26++) {
  12144. for(int l28 = 0; l28 < 13; l28++) {
  12145. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  12146. if(k30 != -1) {
  12147. int k31 = k30 >> 14 & 0x3ff;
  12148. int i32 = k30 >> 3 & 0x7ff;
  12149. int k32 = (k31 / 8 << 8) + i32 / 8;
  12150. for(int j33 = 0; j33 < l16; j33++) {
  12151. if(ai[j33] != k32)
  12152. continue;
  12153. k32 = -1;
  12154.  
  12155. }
  12156. if(k32 != -1)
  12157. ai[l16++] = k32;
  12158. }
  12159. }
  12160. }
  12161. }
  12162. aByteArrayArray1183 = new byte[l16][];
  12163. aByteArrayArray1247 = new byte[l16][];
  12164. anIntArray1234 = new int[l16];
  12165. anIntArray1235 = new int[l16];
  12166. anIntArray1236 = new int[l16];
  12167. for(int l26 = 0; l26 < l16; l26++) {
  12168. int i29 = anIntArray1234[l26] = ai[l26];
  12169. int l30 = i29 >> 8 & 0xff;
  12170. int l31 = i29 & 0xff;
  12171. int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  12172. if(j32 != -1)
  12173. onDemandFetcher.method558(3, j32);
  12174. int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  12175. if(i33 != -1)
  12176. onDemandFetcher.method558(3, i33);
  12177. }
  12178. }
  12179. int i17 = baseX - anInt1036;
  12180. int j21 = baseY - anInt1037;
  12181. anInt1036 = baseX;
  12182. anInt1037 = baseY;
  12183. for(int j24 = 0; j24 < 16384; j24++) {
  12184. NPC npc = npcArray[j24];
  12185. if(npc != null) {
  12186. for(int j29 = 0; j29 < 10; j29++) {
  12187. npc.smallX[j29] -= i17;
  12188. npc.smallY[j29] -= j21;
  12189. }
  12190. npc.x -= i17 * 128;
  12191. npc.y -= j21 * 128;
  12192. }
  12193. }
  12194. for(int i27 = 0; i27 < maxPlayers; i27++) {
  12195. Player player = playerArray[i27];
  12196. if(player != null) {
  12197. for(int i31 = 0; i31 < 10; i31++) {
  12198. player.smallX[i31] -= i17;
  12199. player.smallY[i31] -= j21;
  12200. }
  12201. player.x -= i17 * 128;
  12202. player.y -= j21 * 128;
  12203. }
  12204. }
  12205. aBoolean1080 = true;
  12206. byte byte1 = 0;
  12207. byte byte2 = 104;
  12208. byte byte3 = 1;
  12209. if(i17 < 0) {
  12210. byte1 = 103;
  12211. byte2 = -1;
  12212. byte3 = -1;
  12213. }
  12214. byte byte4 = 0;
  12215. byte byte5 = 104;
  12216. byte byte6 = 1;
  12217. if(j21 < 0) {
  12218. byte4 = 103;
  12219. byte5 = -1;
  12220. byte6 = -1;
  12221. }
  12222. for(int k33 = byte1; k33 != byte2; k33 += byte3) {
  12223. for(int l33 = byte4; l33 != byte5; l33 += byte6) {
  12224. int i34 = k33 + i17;
  12225. int j34 = l33 + j21;
  12226. for(int k34 = 0; k34 < 4; k34++)
  12227. if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  12228. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  12229. else
  12230. groundArray[k34][k33][l33] = null;
  12231. }
  12232. }
  12233. for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext()) {
  12234. class30_sub1_1.anInt1297 -= i17;
  12235. class30_sub1_1.anInt1298 -= j21;
  12236. if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  12237. class30_sub1_1.unlink();
  12238. }
  12239. if(destX != 0) {
  12240. destX -= i17;
  12241. destY -= j21;
  12242. }
  12243. aBoolean1160 = false;
  12244. pktType = -1;
  12245. return true;
  12246.  
  12247. case 208:
  12248. int i3 = inStream.method437();
  12249. if(i3 >= 0)
  12250. method60(i3);
  12251. anInt1018 = i3;
  12252. pktType = -1;
  12253. return true;
  12254.  
  12255. case 99:
  12256. anInt1021 = inStream.readUnsignedByte();
  12257. pktType = -1;
  12258. return true;
  12259.  
  12260. case 75:
  12261. int j3 = inStream.method436();
  12262. int j11 = inStream.method436();
  12263. RSInterface.interfaceCache[j11].anInt233 = 2;
  12264. RSInterface.interfaceCache[j11].mediaID = j3;
  12265. pktType = -1;
  12266. return true;
  12267.  
  12268. case 114:
  12269. anInt1104 = inStream.method434() * 30;
  12270. pktType = -1;
  12271. return true;
  12272.  
  12273. case 60:
  12274. anInt1269 = inStream.readUnsignedByte();
  12275. anInt1268 = inStream.method427();
  12276. while(inStream.currentOffset < pktSize) {
  12277. int k3 = inStream.readUnsignedByte();
  12278. method137(inStream, k3);
  12279. }
  12280. pktType = -1;
  12281. return true;
  12282.  
  12283. case 35:
  12284. int l3 = inStream.readUnsignedByte();
  12285. int k11 = inStream.readUnsignedByte();
  12286. int j17 = inStream.readUnsignedByte();
  12287. int k21 = inStream.readUnsignedByte();
  12288. aBooleanArray876[l3] = true;
  12289. anIntArray873[l3] = k11;
  12290. anIntArray1203[l3] = j17;
  12291. anIntArray928[l3] = k21;
  12292. anIntArray1030[l3] = 0;
  12293. pktType = -1;
  12294. return true;
  12295.  
  12296. case 174:
  12297. /*Empty Following Packet*/
  12298. followPlayer = 0;
  12299. followNPC = 0;
  12300. int l11z = inStream.readUnsignedWord();
  12301. int iq = inStream.readUnsignedByte();
  12302. followDistance = inStream.readUnsignedWord();
  12303. if (iq == 0)
  12304. {
  12305. followNPC = l11z;
  12306. }
  12307. else if (iq == 1)
  12308. {
  12309. followPlayer = l11z;
  12310. }
  12311. pktType = -1;
  12312. return true;
  12313.  
  12314. case 104:
  12315. int j4 = inStream.method427();
  12316. int i12 = inStream.method426();
  12317. String s6 = inStream.readString();
  12318. if(j4 >= 1 && j4 <= 5) {
  12319. if(s6.equalsIgnoreCase("null"))
  12320. s6 = null;
  12321. atPlayerActions[j4 - 1] = s6;
  12322. atPlayerArray[j4 - 1] = i12 == 0;
  12323. }
  12324. pktType = -1;
  12325. return true;
  12326.  
  12327. case 78:
  12328. destX = 0;
  12329. pktType = -1;
  12330. return true;
  12331.  
  12332. case 253:
  12333. String s = inStream.readString();
  12334. if(s.endsWith(":tradereq:")) {
  12335. String s3 = s.substring(0, s.indexOf(":"));
  12336. long l17 = TextClass.longForName(s3);
  12337. boolean flag2 = false;
  12338. for(int j27 = 0; j27 < ignoreCount; j27++) {
  12339. if(ignoreListAsLongs[j27] != l17)
  12340. continue;
  12341. flag2 = true;
  12342.  
  12343. }
  12344. if(!flag2 && anInt1251 == 0)
  12345. pushMessage("wishes to trade with you.", 4, s3);
  12346. } else if (s.endsWith(":clan:")) {
  12347. String s4 = s.substring(0, s.indexOf(":"));
  12348. long l18 = TextClass.longForName(s4);
  12349. pushMessage("Clan: ", 8, s4);
  12350. } else if(s.endsWith("#url#")) {
  12351. String link = s.substring(0, s.indexOf("#"));
  12352. pushMessage("Join us at: ", 9, link);
  12353. } else if(s.endsWith(":resetautocast:")) {
  12354. Autocast = false;
  12355. autocastId = 0;
  12356. magicAuto.drawSprite(1000, 1000);
  12357. } else if(s.endsWith(":duelreq:")) {
  12358. String s4 = s.substring(0, s.indexOf(":"));
  12359. long l18 = TextClass.longForName(s4);
  12360. boolean flag3 = false;
  12361. for(int k27 = 0; k27 < ignoreCount; k27++) {
  12362. if(ignoreListAsLongs[k27] != l18)
  12363. continue;
  12364. flag3 = true;
  12365.  
  12366. }
  12367. if(!flag3 && anInt1251 == 0)
  12368. pushMessage("wishes to duel with you.", 8, s4);
  12369. } else if(s.endsWith(":chalreq:")) {
  12370. String s5 = s.substring(0, s.indexOf(":"));
  12371. long l19 = TextClass.longForName(s5);
  12372. boolean flag4 = false;
  12373. for(int l27 = 0; l27 < ignoreCount; l27++) {
  12374. if(ignoreListAsLongs[l27] != l19)
  12375. continue;
  12376. flag4 = true;
  12377.  
  12378. }
  12379. if(!flag4 && anInt1251 == 0) {
  12380. String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  12381. pushMessage(s8, 8, s5);
  12382. }
  12383. } else {
  12384. pushMessage(s, 0, "");
  12385. }
  12386. pktType = -1;
  12387. return true;
  12388.  
  12389. case 1:
  12390. for(int k4 = 0; k4 < playerArray.length; k4++)
  12391. if(playerArray[k4] != null)
  12392. playerArray[k4].anim = -1;
  12393. for(int j12 = 0; j12 < npcArray.length; j12++)
  12394. if(npcArray[j12] != null)
  12395. npcArray[j12].anim = -1;
  12396. pktType = -1;
  12397. return true;
  12398.  
  12399. case 50:
  12400. long l4 = inStream.readQWord();
  12401. int i18 = inStream.readUnsignedByte();
  12402. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  12403. for(int k24 = 0; k24 < friendsCount; k24++) {
  12404. if(l4 != friendsListAsLongs[k24])
  12405. continue;
  12406. if(friendsNodeIDs[k24] != i18) {
  12407. friendsNodeIDs[k24] = i18;
  12408. needDrawTabArea = true;
  12409. if(i18 >= 2) {
  12410. pushMessage(s7 + " has logged in.", 5, "");
  12411. }
  12412. if(i18 <= 1) {
  12413. pushMessage(s7 + " has logged out.", 5, "");
  12414. }
  12415. }
  12416. s7 = null;
  12417.  
  12418. }
  12419. if(s7 != null && friendsCount < 200) {
  12420. friendsListAsLongs[friendsCount] = l4;
  12421. friendsList[friendsCount] = s7;
  12422. friendsNodeIDs[friendsCount] = i18;
  12423. friendsCount++;
  12424. needDrawTabArea = true;
  12425. }
  12426. for(boolean flag6 = false; !flag6;) {
  12427. flag6 = true;
  12428. for(int k29 = 0; k29 < friendsCount - 1; k29++)
  12429. if(friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  12430. int j31 = friendsNodeIDs[k29];
  12431. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  12432. friendsNodeIDs[k29 + 1] = j31;
  12433. String s10 = friendsList[k29];
  12434. friendsList[k29] = friendsList[k29 + 1];
  12435. friendsList[k29 + 1] = s10;
  12436. long l32 = friendsListAsLongs[k29];
  12437. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  12438. friendsListAsLongs[k29 + 1] = l32;
  12439. needDrawTabArea = true;
  12440. flag6 = false;
  12441. }
  12442. }
  12443. pktType = -1;
  12444. return true;
  12445.  
  12446. case 110:
  12447. if(tabID == 12)
  12448. needDrawTabArea = true;
  12449. energy = inStream.readUnsignedByte();
  12450. pktType = -1;
  12451. return true;
  12452.  
  12453. case 254:
  12454. anInt855 = inStream.readUnsignedByte();
  12455. if(anInt855 == 1)
  12456. anInt1222 = inStream.readUnsignedWord();
  12457. if(anInt855 >= 2 && anInt855 <= 6) {
  12458. if(anInt855 == 2) {
  12459. anInt937 = 64;
  12460. anInt938 = 64;
  12461. }
  12462. if(anInt855 == 3) {
  12463. anInt937 = 0;
  12464. anInt938 = 64;
  12465. }
  12466. if(anInt855 == 4) {
  12467. anInt937 = 128;
  12468. anInt938 = 64;
  12469. }
  12470. if(anInt855 == 5) {
  12471. anInt937 = 64;
  12472. anInt938 = 0;
  12473. }
  12474. if(anInt855 == 6) {
  12475. anInt937 = 64;
  12476. anInt938 = 128;
  12477. }
  12478. anInt855 = 2;
  12479. anInt934 = inStream.readUnsignedWord();
  12480. anInt935 = inStream.readUnsignedWord();
  12481. anInt936 = inStream.readUnsignedByte();
  12482. }
  12483. if(anInt855 == 10)
  12484. anInt933 = inStream.readUnsignedWord();
  12485. pktType = -1;
  12486. return true;
  12487.  
  12488. case 248:
  12489. int i5 = inStream.method435();
  12490. int k12 = inStream.readUnsignedWord();
  12491. if(backDialogID != -1) {
  12492. backDialogID = -1;
  12493. inputTaken = true;
  12494. }
  12495. if(inputDialogState != 0) {
  12496. inputDialogState = 0;
  12497. inputTaken = true;
  12498. }
  12499. openInterfaceID = i5;
  12500. invOverlayInterfaceID = k12;
  12501. needDrawTabArea = true;
  12502. tabAreaAltered = true;
  12503. aBoolean1149 = false;
  12504. pktType = -1;
  12505. return true;
  12506.  
  12507. case 79:
  12508. int j5 = inStream.method434();
  12509. int l12 = inStream.method435();
  12510. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  12511. if(class9_3 != null && class9_3.type == 0) {
  12512. if(l12 < 0)
  12513. l12 = 0;
  12514. if(l12 > class9_3.scrollMax - class9_3.height)
  12515. l12 = class9_3.scrollMax - class9_3.height;
  12516. class9_3.scrollPosition = l12;
  12517. }
  12518. pktType = -1;
  12519. return true;
  12520.  
  12521. case 68:
  12522. for(int k5 = 0; k5 < variousSettings.length; k5++)
  12523. if(variousSettings[k5] != anIntArray1045[k5]) {
  12524. variousSettings[k5] = anIntArray1045[k5];
  12525. method33(k5);
  12526. needDrawTabArea = true;
  12527. }
  12528. pktType = -1;
  12529. return true;
  12530.  
  12531. case 196:
  12532. long l5 = inStream.readQWord();
  12533. int j18 = inStream.readDWord();
  12534. int l21 = inStream.readUnsignedByte();
  12535. boolean flag5 = false;
  12536. if(l21 <= 1) {
  12537. for(int l29 = 0; l29 < ignoreCount; l29++) {
  12538. if(ignoreListAsLongs[l29] != l5)
  12539. continue;
  12540. flag5 = true;
  12541.  
  12542. }
  12543. }
  12544. if(!flag5 && anInt1251 == 0)
  12545. try {
  12546. String s9 = TextInput.method525(pktSize - 13, inStream);
  12547. if(l21 == 2 || l21 == 3)
  12548. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12549. else
  12550. if(l21 == 1)
  12551. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12552. else
  12553. if(l21 == 4)
  12554. pushMessage(s9, 7, "@cr4@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12555. else
  12556. if(l21 == 5)
  12557. pushMessage(s9, 7, "@cr5@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12558. else
  12559. if(l21 == 6)
  12560. pushMessage(s9, 7, "@cr6@" + TextClass.fixName(TextClass.nameForLong(l5)));
  12561. else
  12562. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  12563. } catch(Exception exception1) {
  12564. signlink.reporterror("cde1");
  12565. }
  12566. pktType = -1;
  12567. return true;
  12568.  
  12569. case 85:
  12570. anInt1269 = inStream.method427();
  12571. anInt1268 = inStream.method427();
  12572. pktType = -1;
  12573. return true;
  12574.  
  12575. case 24:
  12576. anInt1054 = inStream.method428();
  12577. if(anInt1054 == tabID) {
  12578. if(anInt1054 == 3)
  12579. tabID = 1;
  12580. else
  12581. tabID = 3;
  12582. needDrawTabArea = true;
  12583. }
  12584. pktType = -1;
  12585. return true;
  12586.  
  12587. case 246:
  12588. int i6 = inStream.method434();
  12589. int i13 = inStream.readUnsignedWord();
  12590. int k18 = inStream.readUnsignedWord();
  12591. if(k18 == 65535) {
  12592. RSInterface.interfaceCache[i6].anInt233 = 0;
  12593. pktType = -1;
  12594. return true;
  12595. } else {
  12596. ItemDef itemDef = ItemDef.forID(k18);
  12597. RSInterface.interfaceCache[i6].anInt233 = 4;
  12598. RSInterface.interfaceCache[i6].mediaID = k18;
  12599. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotation1;
  12600. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotation2;
  12601. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  12602. pktType = -1;
  12603. return true;
  12604. }
  12605.  
  12606. case 171:
  12607. boolean flag1 = inStream.readUnsignedByte() == 1;
  12608. int j13 = inStream.readUnsignedWord();
  12609. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  12610. pktType = -1;
  12611. return true;
  12612.  
  12613. case 142:
  12614. int j6 = inStream.method434();
  12615. method60(j6);
  12616. if(backDialogID != -1) {
  12617. backDialogID = -1;
  12618. inputTaken = true;
  12619. }
  12620. if(inputDialogState != 0) {
  12621. inputDialogState = 0;
  12622. inputTaken = true;
  12623. }
  12624. invOverlayInterfaceID = j6;
  12625. needDrawTabArea = true;
  12626. tabAreaAltered = true;
  12627. openInterfaceID = -1;
  12628. aBoolean1149 = false;
  12629. pktType = -1;
  12630. return true;
  12631.  
  12632. case 126:
  12633. String text = inStream.readString();
  12634. int frame = inStream.method435();
  12635. if (text.startsWith("www.")) {
  12636. launchURL(text);
  12637. pktType = -1;
  12638. return true;
  12639. }
  12640. updateStrings(text, frame);
  12641. sendFrame126(text, frame);
  12642. if (frame >= 18144 && frame <= 18244) {
  12643. clanList[frame - 18144] = text;
  12644. }
  12645. pktType = -1;
  12646. return true;
  12647.  
  12648. case 206:
  12649. publicChatMode = inStream.readUnsignedByte();
  12650. privateChatMode = inStream.readUnsignedByte();
  12651. tradeMode = inStream.readUnsignedByte();
  12652. aBoolean1233 = true;
  12653. inputTaken = true;
  12654. pktType = -1;
  12655. return true;
  12656.  
  12657. case 240:
  12658. if(tabID == 12)
  12659. needDrawTabArea = true;
  12660. weight = inStream.readSignedWord();
  12661. pktType = -1;
  12662. return true;
  12663.  
  12664. case 8:
  12665. int k6 = inStream.method436();
  12666. int l13 = inStream.readUnsignedWord();
  12667. RSInterface.interfaceCache[k6].anInt233 = 1;
  12668. RSInterface.interfaceCache[k6].mediaID = l13;
  12669. pktType = -1;
  12670. return true;
  12671.  
  12672. case 122:
  12673. int l6 = inStream.method436();
  12674. int i14 = inStream.method436();
  12675. int i19 = i14 >> 10 & 0x1f;
  12676. int i22 = i14 >> 5 & 0x1f;
  12677. int l24 = i14 & 0x1f;
  12678. RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  12679. pktType = -1;
  12680. return true;
  12681.  
  12682. case 53:
  12683. needDrawTabArea = true;
  12684. int i7 = inStream.readUnsignedWord();
  12685. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  12686. int j19 = inStream.readUnsignedWord();
  12687. for(int j22 = 0; j22 < j19; j22++) {
  12688. int i25 = inStream.readUnsignedByte();
  12689. if(i25 == 255)
  12690. i25 = inStream.method440();
  12691. class9_1.inv[j22] = inStream.method436();
  12692. class9_1.invStackSizes[j22] = i25;
  12693. }
  12694. for(int j25 = j19; j25 < class9_1.inv.length; j25++) {
  12695. class9_1.inv[j25] = 0;
  12696. class9_1.invStackSizes[j25] = 0;
  12697. }
  12698. pktType = -1;
  12699. return true;
  12700.  
  12701. case 230:
  12702. int j7 = inStream.method435();
  12703. int j14 = inStream.readUnsignedWord();
  12704. int k19 = inStream.readUnsignedWord();
  12705. int k22 = inStream.method436();
  12706. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  12707. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  12708. RSInterface.interfaceCache[j14].modelZoom = j7;
  12709. pktType = -1;
  12710. return true;
  12711.  
  12712. case 221:
  12713. anInt900 = inStream.readUnsignedByte();
  12714. needDrawTabArea = true;
  12715. pktType = -1;
  12716. return true;
  12717.  
  12718. case 177:
  12719. aBoolean1160 = true;
  12720. anInt995 = inStream.readUnsignedByte();
  12721. anInt996 = inStream.readUnsignedByte();
  12722. anInt997 = inStream.readUnsignedWord();
  12723. anInt998 = inStream.readUnsignedByte();
  12724. anInt999 = inStream.readUnsignedByte();
  12725. if(anInt999 >= 100) {
  12726. int k7 = anInt995 * 128 + 64;
  12727. int k14 = anInt996 * 128 + 64;
  12728. int i20 = method42(plane, k14, k7) - anInt997;
  12729. int l22 = k7 - xCameraPos;
  12730. int k25 = i20 - zCameraPos;
  12731. int j28 = k14 - yCameraPos;
  12732. int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  12733. yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  12734. xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  12735. if(yCameraCurve < 128)
  12736. yCameraCurve = 128;
  12737. if(yCameraCurve > 383)
  12738. yCameraCurve = 383;
  12739. }
  12740. pktType = -1;
  12741. return true;
  12742.  
  12743. case 249:
  12744. anInt1046 = inStream.method426();
  12745. unknownInt10 = inStream.method436();
  12746. pktType = -1;
  12747. return true;
  12748.  
  12749. case 65:
  12750. updateNPCs(inStream, pktSize);
  12751. pktType = -1;
  12752. return true;
  12753.  
  12754. case 27:
  12755. messagePromptRaised = false;
  12756. inputDialogState = 1;
  12757. amountOrNameInput = "";
  12758. inputTaken = true;
  12759. pktType = -1;
  12760. return true;
  12761.  
  12762. case 187:
  12763. messagePromptRaised = false;
  12764. inputDialogState = 2;
  12765. amountOrNameInput = "";
  12766. inputTaken = true;
  12767. pktType = -1;
  12768. return true;
  12769.  
  12770. case 97:
  12771. int l7 = inStream.readUnsignedWord();
  12772. method60(l7);
  12773. if(invOverlayInterfaceID != -1) {
  12774. invOverlayInterfaceID = -1;
  12775. needDrawTabArea = true;
  12776. tabAreaAltered = true;
  12777. }
  12778. if(backDialogID != -1) {
  12779. backDialogID = -1;
  12780. inputTaken = true;
  12781. }
  12782. if(inputDialogState != 0) {
  12783. inputDialogState = 0;
  12784. inputTaken = true;
  12785. }
  12786. openInterfaceID = l7;
  12787. aBoolean1149 = false;
  12788. pktType = -1;
  12789. return true;
  12790.  
  12791. case 218:
  12792. int i8 = inStream.method438();
  12793. dialogID = i8;
  12794. inputTaken = true;
  12795. pktType = -1;
  12796. return true;
  12797.  
  12798. case 87:
  12799. int j8 = inStream.method434();
  12800. int l14 = inStream.method439();
  12801. anIntArray1045[j8] = l14;
  12802. if(variousSettings[j8] != l14) {
  12803. variousSettings[j8] = l14;
  12804. method33(j8);
  12805. needDrawTabArea = true;
  12806. if(dialogID != -1)
  12807. inputTaken = true;
  12808. }
  12809. pktType = -1;
  12810. return true;
  12811.  
  12812. case 36:
  12813. int k8 = inStream.method434();
  12814. byte byte0 = inStream.readSignedByte();
  12815. anIntArray1045[k8] = byte0;
  12816. if(variousSettings[k8] != byte0) {
  12817. variousSettings[k8] = byte0;
  12818. method33(k8);
  12819. needDrawTabArea = true;
  12820. if(dialogID != -1)
  12821. inputTaken = true;
  12822. }
  12823. pktType = -1;
  12824. return true;
  12825.  
  12826. case 61:
  12827. anInt1055 = inStream.readUnsignedByte();
  12828. pktType = -1;
  12829. return true;
  12830.  
  12831. case 200:
  12832. int l8 = inStream.readUnsignedWord();
  12833. int i15 = inStream.readSignedWord();
  12834. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  12835. class9_4.anInt257 = i15;
  12836. class9_4.modelZoom = 1600;
  12837. if(i15 == -1) {
  12838. class9_4.anInt246 = 0;
  12839. class9_4.anInt208 = 0;
  12840. }
  12841. pktType = -1;
  12842. return true;
  12843.  
  12844. case 219:
  12845. if(invOverlayInterfaceID != -1) {
  12846. invOverlayInterfaceID = -1;
  12847. needDrawTabArea = true;
  12848. tabAreaAltered = true;
  12849. }
  12850. if(backDialogID != -1) {
  12851. backDialogID = -1;
  12852. inputTaken = true;
  12853. }
  12854. if(inputDialogState != 0) {
  12855. inputDialogState = 0;
  12856. inputTaken = true;
  12857. }
  12858. openInterfaceID = -1;
  12859. aBoolean1149 = false;
  12860. pktType = -1;
  12861. return true;
  12862.  
  12863. case 34:
  12864. needDrawTabArea = true;
  12865. int i9 = inStream.readUnsignedWord();
  12866. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  12867. while(inStream.currentOffset < pktSize) {
  12868. int j20 = inStream.method422();
  12869. int i23 = inStream.readUnsignedWord();
  12870. int l25 = inStream.readUnsignedByte();
  12871. if(l25 == 255)
  12872. l25 = inStream.readDWord();
  12873. if(j20 >= 0 && j20 < class9_2.inv.length) {
  12874. class9_2.inv[j20] = i23;
  12875. class9_2.invStackSizes[j20] = l25;
  12876. }
  12877. }
  12878. pktType = -1;
  12879. return true;
  12880.  
  12881. case 4:
  12882. case 44:
  12883. case 84:
  12884. case 101:
  12885. case 105:
  12886. case 117:
  12887. case 147:
  12888. case 151:
  12889. case 156:
  12890. case 160:
  12891. case 215:
  12892. method137(inStream, pktType);
  12893. pktType = -1;
  12894. return true;
  12895.  
  12896. case 106:
  12897. tabID = inStream.method427();
  12898. needDrawTabArea = true;
  12899. tabAreaAltered = true;
  12900. pktType = -1;
  12901. return true;
  12902.  
  12903. case 164:
  12904. int j9 = inStream.method434();
  12905. method60(j9);
  12906. if(invOverlayInterfaceID != -1) {
  12907. invOverlayInterfaceID = -1;
  12908. needDrawTabArea = true;
  12909. tabAreaAltered = true;
  12910. }
  12911. backDialogID = j9;
  12912. inputTaken = true;
  12913. openInterfaceID = -1;
  12914. aBoolean1149 = false;
  12915. pktType = -1;
  12916. return true;
  12917.  
  12918. }
  12919. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  12920. //resetLogout();
  12921. } catch(IOException _ex) {
  12922. dropClient();
  12923. } catch(Exception exception) {
  12924. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  12925. for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  12926. s2 = s2 + inStream.buffer[j15] + ",";
  12927. signlink.reporterror(s2);
  12928. //resetLogout();
  12929. }
  12930. pktType = -1;
  12931. return true;
  12932. }
  12933.  
  12934. private void method146() {
  12935. anInt1265++;
  12936. method47(true);
  12937. method26(true);
  12938. method47(false);
  12939. method26(false);
  12940. method55();
  12941. method104();
  12942. if(!aBoolean1160) {
  12943. int i = anInt1184;
  12944. if(anInt984 / 256 > i)
  12945. i = anInt984 / 256;
  12946. if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  12947. i = anIntArray1203[4] + 128;
  12948. int k = minimapInt1 + anInt896 & 0x7ff;
  12949. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  12950. }
  12951. int j;
  12952. if(!aBoolean1160)
  12953. j = method120();
  12954. else
  12955. j = method121();
  12956. int l = xCameraPos;
  12957. int i1 = zCameraPos;
  12958. int j1 = yCameraPos;
  12959. int k1 = yCameraCurve;
  12960. int l1 = xCameraCurve;
  12961. for(int i2 = 0; i2 < 5; i2++)
  12962. if(aBooleanArray876[i2]) {
  12963. 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]);
  12964. if(i2 == 0)
  12965. xCameraPos += j2;
  12966. if(i2 == 1)
  12967. zCameraPos += j2;
  12968. if(i2 == 2)
  12969. yCameraPos += j2;
  12970. if(i2 == 3)
  12971. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  12972. if(i2 == 4) {
  12973. yCameraCurve += j2;
  12974. if(yCameraCurve < 128)
  12975. yCameraCurve = 128;
  12976. if(yCameraCurve > 383)
  12977. yCameraCurve = 383;
  12978. }
  12979. }
  12980. int k2 = Texture.anInt1481;
  12981. Model.aBoolean1684 = true;
  12982. Model.anInt1687 = 0;
  12983. Model.anInt1685 = super.mouseX - 4;
  12984. Model.anInt1686 = super.mouseY - 4;
  12985. DrawingArea.setAllPixelsToZero();
  12986. worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  12987. worldController.clearObj5Cache();
  12988. updateEntities();
  12989. drawHeadIcon();
  12990. method37(k2);
  12991. draw3dScreen();
  12992. if (counterOn)
  12993. drawCounterOnScreen();
  12994. if(drawFlag) {
  12995. if(xpToDraw != 0) {
  12996. if(flagPos < 125) {
  12997. if(flagPos < 100) {
  12998. flagPos += 2;
  12999. } else {
  13000. flagPos += 1;
  13001. }
  13002. xpFlag.drawSprite(423, flagPos);
  13003. newSmallFont.drawBasicString(""+xpToDraw+"xp", 470, flagPos+20, 0xCC6600, 1);
  13004. } else { }
  13005. if(flagPos >= 125) {
  13006. drawFlag = false;
  13007. flagPos = 72;
  13008. xpToDraw = 0;
  13009. }
  13010. }
  13011. }
  13012. if(drawXpBar) {
  13013. String text = ""+testXp;
  13014. int txtWidth = aTextDrawingArea_1271.getTextWidth(text);
  13015. int drawX = 505-txtWidth;
  13016. sprite1.drawSprite(419, 51);
  13017. newSmallFont.drawBasicString("XP:", 421, 64, 0xFFFFFD, 0);
  13018. newSmallFont.drawBasicString(text, drawX, 64, 0xFFFFFD, 0);
  13019. }
  13020. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  13021. xCameraPos = l;
  13022. zCameraPos = i1;
  13023. yCameraPos = j1;
  13024. yCameraCurve = k1;
  13025. xCameraCurve = l1;
  13026. }
  13027.  
  13028. public void clearTopInterfaces() {
  13029. stream.createFrame(130);
  13030. if (invOverlayInterfaceID != -1) {
  13031. invOverlayInterfaceID = -1;
  13032. needDrawTabArea = true;
  13033. aBoolean1149 = false;
  13034. tabAreaAltered = true;
  13035. }
  13036. if (backDialogID != -1) {
  13037. backDialogID = -1;
  13038. inputTaken = true;
  13039. aBoolean1149 = false;
  13040. }
  13041. openInterfaceID = -1;
  13042. fullscreenInterfaceID = -1;
  13043. }
  13044.  
  13045. public client() {
  13046. LP = 0.0F;
  13047. this.xpCounter = 0;
  13048. this.counter = new Sprite("Gameframe/XP 0");
  13049. this.counter2 = new Sprite("Gameframe/XP 1");
  13050. this.counter3 = new Sprite("Gameframe/XP 2");
  13051. this.counter4 = new Sprite("Gameframe/XP 3");
  13052. tabHPos = -1;
  13053. fullscreenInterfaceID = -1;
  13054. chatRights = new int[500];
  13055. chatTypeView = 0;
  13056. clanChatMode = 0;
  13057. cButtonHPos = -1;
  13058. cButtonHCPos = -1;
  13059. cButtonCPos = 0;
  13060. server = "127.0.0.1";
  13061. anIntArrayArray825 = new int[104][104];
  13062. friendsNodeIDs = new int[200];
  13063. groundArray = new NodeList[4][104][104];
  13064. aBoolean831 = false;
  13065. aStream_834 = new Stream(new byte[5000]);
  13066. npcArray = new NPC[16384];
  13067. npcIndices = new int[16384];
  13068. anIntArray840 = new int[1000];
  13069. aStream_847 = Stream.create();
  13070. aBoolean848 = true;
  13071. openInterfaceID = -1;
  13072. currentExp = new int[Skills.skillsCount];
  13073. aBoolean872 = false;
  13074. anIntArray873 = new int[5];
  13075. anInt874 = -1;
  13076. aBooleanArray876 = new boolean[5];
  13077. drawFlames = false;
  13078. reportAbuseInput = "";
  13079. unknownInt10 = -1;
  13080. menuOpen = false;
  13081. inputString = "";
  13082. maxPlayers = 2048;
  13083. myPlayerIndex = 2047;
  13084. playerArray = new Player[maxPlayers];
  13085. playerIndices = new int[maxPlayers];
  13086. anIntArray894 = new int[maxPlayers];
  13087. aStreamArray895s = new Stream[maxPlayers];
  13088. anInt897 = 1;
  13089. anIntArrayArray901 = new int[104][104];
  13090. anInt902 = 0x766654;
  13091. aByteArray912 = new byte[16384];
  13092. currentStats = new int[Skills.skillsCount];
  13093. ignoreListAsLongs = new long[100];
  13094. loadingError = false;
  13095. anInt927 = 0x332d25;
  13096. anIntArray928 = new int[5];
  13097. anIntArrayArray929 = new int[104][104];
  13098. chatTypes = new int[500];
  13099. chatNames = new String[500];
  13100. chatMessages = new String[500];
  13101. chatButtons = new Sprite[4];
  13102. sideIcons = new Sprite[15];
  13103. newSideIcons = new Sprite[16];
  13104. redStones = new Sprite[5];
  13105. aBoolean954 = true;
  13106. friendsListAsLongs = new long[200];
  13107. currentSong = -1;
  13108. drawingFlames = false;
  13109. spriteDrawX = -1;
  13110. spriteDrawY = -1;
  13111. anIntArray968 = new int[33];
  13112. anIntArray969 = new int[256];
  13113. decompressors = new Decompressor[5];
  13114. variousSettings = new int[2000];
  13115. aBoolean972 = false;
  13116. anInt975 = 50;
  13117. anIntArray976 = new int[anInt975];
  13118. anIntArray977 = new int[anInt975];
  13119. anIntArray978 = new int[anInt975];
  13120. anIntArray979 = new int[anInt975];
  13121. anIntArray980 = new int[anInt975];
  13122. anIntArray981 = new int[anInt975];
  13123. anIntArray982 = new int[anInt975];
  13124. aStringArray983 = new String[anInt975];
  13125. anInt985 = -1;
  13126. hitMarks = new Sprite[24];
  13127. hitMark = new Sprite[4];
  13128. applyTrans = 0;
  13129. anIntArray990 = new int[5];
  13130. aBoolean994 = false;
  13131. anInt1002 = 0x23201b;
  13132. amountOrNameInput = "";
  13133. aClass19_1013 = new NodeList();
  13134. aBoolean1017 = false;
  13135. anInt1018 = -1;
  13136. anIntArray1030 = new int[5];
  13137. aBoolean1031 = false;
  13138. mapFunctions = new Sprite[100];
  13139. dialogID = -1;
  13140. maxStats = new int[Skills.skillsCount];
  13141. anIntArray1045 = new int[2000];
  13142. aBoolean1047 = true;
  13143. anIntArray1052 = new int[151];
  13144. anInt1054 = -1;
  13145. aClass19_1056 = new NodeList();
  13146. anIntArray1057 = new int[33];
  13147. aClass9_1059 = new RSInterface();
  13148. mapScenes = new Background[100];
  13149. barFillColor = 0x4d4233;
  13150. anIntArray1065 = new int[7];
  13151. anIntArray1072 = new int[1000];
  13152. anIntArray1073 = new int[1000];
  13153. aBoolean1080 = false;
  13154. friendsList = new String[200];
  13155. inStream = Stream.create();
  13156. expectedCRCs = new int[9];
  13157. menuActionCmd2 = new int[500];
  13158. menuActionCmd3 = new int[500];
  13159. menuActionCmd4 = new int[500];
  13160. menuActionID = new int[500];
  13161. menuActionCmd1 = new int[500];
  13162. headIcons = new Sprite[20];
  13163. skullIcons = new Sprite[20];
  13164. headIconsHint = new Sprite[20];
  13165. tabAreaAltered = false;
  13166. aString1121 = "";
  13167. atPlayerActions = new String[5];
  13168. atPlayerArray = new boolean[5];
  13169. anIntArrayArrayArray1129 = new int[4][13][13];
  13170. anInt1132 = 2;
  13171. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  13172. aBoolean1141 = false;
  13173. aBoolean1149 = false;
  13174. crosses = new Sprite[8];
  13175. musicEnabled = true;
  13176. needDrawTabArea = false;
  13177. loggedIn = false;
  13178. curseSelected = false;
  13179. praySelected = false;
  13180. prayClicked = false;
  13181. canMute = false;
  13182. aBoolean1159 = false;
  13183. aBoolean1160 = false;
  13184. anInt1171 = 1;
  13185. myUsername = "";
  13186. myPassword = "";
  13187. genericLoadingError = false;
  13188. reportAbuseInterfaceID = -1;
  13189. aClass19_1179 = new NodeList();
  13190. anInt1184 = 128;
  13191. invOverlayInterfaceID = -1;
  13192. stream = Stream.create();
  13193. menuActionName = new String[500];
  13194. anIntArray1203 = new int[5];
  13195. anIntArray1207 = new int[50];
  13196. anInt1210 = 2;
  13197. anInt1211 = 78;
  13198. promptInput = "";
  13199. modIcons = new Background[5];
  13200. tabID = 3;
  13201. inputTaken = false;
  13202. songChanging = true;
  13203. anIntArray1229 = new int[151];
  13204. aClass11Array1230 = new Class11[4];
  13205. aBoolean1233 = false;
  13206. anIntArray1240 = new int[100];
  13207. anIntArray1241 = new int[50];
  13208. aBoolean1242 = false;
  13209. anIntArray1250 = new int[50];
  13210. rsAlreadyLoaded = false;
  13211. welcomeScreenRaised = false;
  13212. messagePromptRaised = false;
  13213. loginMessage1 = "";
  13214. loginMessage2 = "";
  13215. backDialogID = -1;
  13216. anInt1279 = 2;
  13217. bigX = new int[4000];
  13218. bigY = new int[4000];
  13219. anInt1289 = -1;
  13220. }
  13221.  
  13222. public int rights;
  13223. public int backgroundCount;
  13224. public Sprite localSprite3;
  13225. public Sprite localSprite2;
  13226. public Sprite localSprite1;
  13227. public int opacityCount;
  13228. public int count;
  13229. public int xpCounter;
  13230. public Sprite backgroundFix;
  13231. private Sprite loadingBarFull;
  13232. private Sprite loadingBarEmpty;
  13233. public Sprite SmallCritHit;
  13234. public Sprite BigCritHit;
  13235. private Sprite SummIcon;
  13236. private Sprite SummOrb;
  13237. private Sprite SummOrbFill;
  13238. private Background titleBox;
  13239. private Sprite loginHover;
  13240. private Sprite boxHover;
  13241. private Background titleButton;
  13242. public String name;
  13243. public String message;
  13244. public String clanname;
  13245. private final int[] chatRights;
  13246. public int chatTypeView;
  13247. public int clanChatMode;
  13248. public int duelMode;
  13249. /* Declare custom sprites */
  13250. private Sprite chatArea;
  13251. private Sprite loadingPleaseWait;
  13252. private Sprite reestablish;
  13253. private Sprite[] chatButtons;
  13254. private Sprite tabArea;
  13255. public Sprite tabHover;
  13256. public Sprite tabClicked;
  13257. public Sprite[] newSideIcons;
  13258. private Sprite mapArea;
  13259. /**/
  13260. private GraphicsBuffer leftFrame;
  13261. private GraphicsBuffer topFrame;
  13262. private GraphicsBuffer rightFrame;
  13263. private int ignoreCount;
  13264. private long aLong824;
  13265. private int[][] anIntArrayArray825;
  13266. private int[] friendsNodeIDs;
  13267. private NodeList[][][] groundArray;
  13268. private int[] anIntArray828;
  13269. private int[] anIntArray829;
  13270. private volatile boolean aBoolean831;
  13271. private Socket aSocket832;
  13272. private int loginScreenState;
  13273. private Stream aStream_834;
  13274. private NPC[] npcArray;
  13275. private int npcCount;
  13276. private int[] npcIndices;
  13277. private int anInt839;
  13278. private int[] anIntArray840;
  13279. private int anInt841;
  13280. private int anInt842;
  13281. private int anInt843;
  13282. private String aString844;
  13283. private int privateChatMode;
  13284. private Stream aStream_847;
  13285. private boolean aBoolean848;
  13286. private static int anInt849;
  13287. private int[] anIntArray850;
  13288. private int[] anIntArray851;
  13289. private int[] anIntArray852;
  13290. private int[] anIntArray853;
  13291. private static int anInt854;
  13292. private int anInt855;
  13293. public static int openInterfaceID;
  13294. private int xCameraPos;
  13295. private int zCameraPos;
  13296. private int yCameraPos;
  13297. private int yCameraCurve;
  13298. private int xCameraCurve;
  13299. private int myPrivilege;
  13300. private final int[] currentExp;
  13301. private Sprite[] redStones;
  13302. private Sprite mapFlag;
  13303. private Sprite mapMarker;
  13304. private boolean aBoolean872;
  13305. private final int[] anIntArray873;
  13306. private int anInt874;
  13307. private final boolean[] aBooleanArray876;
  13308. private int weight;
  13309. private MouseDetection mouseDetection;
  13310. private volatile boolean drawFlames;
  13311. private String reportAbuseInput;
  13312. private int unknownInt10;
  13313. private boolean menuOpen;
  13314. private int anInt886;
  13315. private String inputString;
  13316. private final int maxPlayers;
  13317. private final int myPlayerIndex;
  13318. private Player[] playerArray;
  13319. private int playerCount;
  13320. private int[] playerIndices;
  13321. private int anInt893;
  13322. private int[] anIntArray894;
  13323. private Stream[] aStreamArray895s;
  13324. private int anInt896;
  13325. private int anInt897;
  13326. private int friendsCount;
  13327. private int anInt900;
  13328. private int[][] anIntArrayArray901;
  13329. private final int anInt902;
  13330. private byte[] aByteArray912;
  13331. private int anInt913;
  13332. private int crossX;
  13333. private int crossY;
  13334. private int crossIndex;
  13335. private int crossType;
  13336. private int plane;
  13337. private final int[] currentStats;
  13338. private static int anInt924;
  13339. private final long[] ignoreListAsLongs;
  13340. private boolean loadingError;
  13341. private final int anInt927;
  13342. private final int[] anIntArray928;
  13343. private int[][] anIntArrayArray929;
  13344. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  13345. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  13346. private int anInt933;
  13347. private int anInt934;
  13348. private int anInt935;
  13349. private int anInt936;
  13350. private int anInt937;
  13351. private int anInt938;
  13352. private static int anInt940;
  13353. private final int[] chatTypes;
  13354. private final String[] chatNames;
  13355. private final String[] chatMessages;
  13356. private int anInt945;
  13357. private WorldController worldController;
  13358. private Sprite[] sideIcons;
  13359. private int menuScreenArea;
  13360. private int menuOffsetX;
  13361. private int menuOffsetY;
  13362. private int menuWidth;
  13363. private int menuHeight;
  13364. private long aLong953;
  13365. private boolean aBoolean954;
  13366. private long[] friendsListAsLongs;
  13367. private String[] clanList = new String[100];
  13368. private int currentSong;
  13369. private static int nodeID = 10;
  13370. static int portOff;
  13371. static boolean clientData;
  13372. private static boolean isMembers = true;
  13373. private static boolean lowMem;
  13374. private volatile boolean drawingFlames;
  13375. private int spriteDrawX;
  13376. private int spriteDrawY;
  13377. private final int[] anIntArray965 = {
  13378. 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  13379. };
  13380. private Background aBackground_966;
  13381. private Background aBackground_967;
  13382. private final int[] anIntArray968;
  13383. private final int[] anIntArray969;
  13384. final Decompressor[] decompressors;
  13385. public int variousSettings[];
  13386. private boolean aBoolean972;
  13387. private final int anInt975;
  13388. private final int[] anIntArray976;
  13389. private final int[] anIntArray977;
  13390. private final int[] anIntArray978;
  13391. private final int[] anIntArray979;
  13392. private final int[] anIntArray980;
  13393. private final int[] anIntArray981;
  13394. private final int[] anIntArray982;
  13395. private final String[] aStringArray983;
  13396. private int anInt984;
  13397. private int anInt985;
  13398. private static int anInt986;
  13399. private Sprite[] hitMarks;
  13400. private Sprite[] hitMark;
  13401. public int applyTrans;
  13402. private int anInt988;
  13403. private int anInt989;
  13404. private final int[] anIntArray990;
  13405. private static boolean aBoolean993;
  13406. private final boolean aBoolean994;
  13407. private int anInt995;
  13408. private int anInt996;
  13409. private int anInt997;
  13410. private int anInt998;
  13411. private int anInt999;
  13412. private ISAACRandomGen encryption;
  13413. private Sprite mapEdge;
  13414. private Sprite multiOverlay;
  13415. private final int anInt1002;
  13416. static final int[][] anIntArrayArray1003 = {
  13417. {
  13418. 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  13419. 2983, 54193
  13420. }, {
  13421. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  13422. 56621, 4783, 1341, 16578, 35003, 25239
  13423. }, {
  13424. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  13425. 10153, 56621, 4783, 1341, 16578, 35003
  13426. }, {
  13427. 4626, 11146, 6439, 12, 4758, 10270
  13428. }, {
  13429. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  13430. }
  13431. };
  13432. private String amountOrNameInput;
  13433. private static int anInt1005;
  13434. private int daysSinceLastLogin;
  13435. private int pktSize;
  13436. private int pktType;
  13437. private int anInt1009;
  13438. private int anInt1010;
  13439. private int anInt1011;
  13440. private NodeList aClass19_1013;
  13441. private int anInt1014;
  13442. private int anInt1015;
  13443. private int anInt1016;
  13444. private boolean aBoolean1017;
  13445. private int anInt1018;
  13446. private static final int[] anIntArray1019;
  13447. private int anInt1021;
  13448. private int anInt1022;
  13449. private int loadingStage;
  13450. private Sprite scrollBar1;
  13451. private Sprite scrollBar2;
  13452. private int anInt1026;
  13453. private Background backBase1;
  13454. private Background backBase2;
  13455. private Background backHmid1;
  13456. private final int[] anIntArray1030;
  13457. private boolean aBoolean1031;
  13458. private Sprite[] mapFunctions;
  13459. private int baseX;
  13460. private int baseY;
  13461. private int anInt1036;
  13462. private int anInt1037;
  13463. private int loginFailures;
  13464. private int anInt1039;
  13465. private int anInt1040;
  13466. private int anInt1041;
  13467. private int dialogID;
  13468. private final int[] maxStats;
  13469. private final int[] anIntArray1045;
  13470. private int anInt1046;
  13471. private boolean aBoolean1047;
  13472. private int anInt1048;
  13473. private String aString1049;
  13474. private static int anInt1051;
  13475. private final int[] anIntArray1052;
  13476. private StreamLoader titleStreamLoader;
  13477. private int anInt1054;
  13478. private int anInt1055;
  13479. private NodeList aClass19_1056;
  13480. private final int[] anIntArray1057;
  13481. public final RSInterface aClass9_1059;
  13482. private Background[] mapScenes;
  13483. private static int anInt1061;
  13484. private int anInt1062;
  13485. private final int barFillColor;
  13486. private int friendsListAction;
  13487. private final int[] anIntArray1065;
  13488. private int mouseInvInterfaceIndex;
  13489. private int lastActiveInvInterface;
  13490. public OnDemandFetcher onDemandFetcher;
  13491. private int anInt1069;
  13492. private int anInt1070;
  13493. private int anInt1071;
  13494. private int[] anIntArray1072;
  13495. private int[] anIntArray1073;
  13496. private Sprite mapDotItem;
  13497. private Sprite mapDotNPC;
  13498. private Sprite mapDotPlayer;
  13499. private Sprite mapDotFriend;
  13500. private Sprite mapDotTeam;
  13501. private Sprite mapDotClan;
  13502. private int anInt1079;
  13503. private boolean aBoolean1080;
  13504. private String[] friendsList;
  13505. private Stream inStream;
  13506. private int anInt1084;
  13507. private int anInt1085;
  13508. private int activeInterfaceType;
  13509. private int anInt1087;
  13510. private int anInt1088;
  13511. public static int anInt1089;
  13512. private final int[] expectedCRCs;
  13513. private int[] menuActionCmd2;
  13514. private int[] menuActionCmd3;
  13515. public int[] menuActionCmd4;
  13516. private int[] menuActionID;
  13517. private int[] menuActionCmd1;
  13518. private Sprite[] headIcons;
  13519. private Sprite[] skullIcons;
  13520. private Sprite[] headIconsHint;
  13521. private static int anInt1097;
  13522. private int anInt1098;
  13523. private int anInt1099;
  13524. private int anInt1100;
  13525. private int anInt1101;
  13526. private int anInt1102;
  13527. public static boolean tabAreaAltered;
  13528. private int anInt1104;
  13529. private GraphicsBuffer aRSImageProducer_1107;
  13530. private GraphicsBuffer aRSImageProducer_1108;
  13531. private GraphicsBuffer aRSImageProducer_1109;
  13532. private GraphicsBuffer aRSImageProducer_1110;
  13533. private GraphicsBuffer aRSImageProducer_1111;
  13534. private GraphicsBuffer aRSImageProducer_1112;
  13535. private GraphicsBuffer aRSImageProducer_1113;
  13536. private GraphicsBuffer aRSImageProducer_1114;
  13537. private GraphicsBuffer aRSImageProducer_1115;
  13538. private static int anInt1117;
  13539. private int membersInt;
  13540. private String aString1121;
  13541. private Sprite compass;
  13542. private GraphicsBuffer aRSImageProducer_1123;
  13543. private GraphicsBuffer aRSImageProducer_1124;
  13544. private GraphicsBuffer aRSImageProducer_1125;
  13545. public static Player myPlayer;
  13546. private final String[] atPlayerActions;
  13547. private final boolean[] atPlayerArray;
  13548. private final int[][][] anIntArrayArrayArray1129;
  13549. public static final int[] tabInterfaceIDs = {
  13550. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  13551. -1, -1, -1, -1, -1, -1, -1
  13552. };
  13553. private int anInt1131;
  13554. private int anInt1132;
  13555. private int menuActionRow;
  13556. private static int anInt1134;
  13557. private int spellSelected;
  13558. private int anInt1137;
  13559. private int spellUsableOn;
  13560. private String spellTooltip;
  13561. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  13562. private boolean aBoolean1141;
  13563. private static int anInt1142;
  13564. private int energy;
  13565. private boolean aBoolean1149;
  13566. private Sprite[] crosses;
  13567. private boolean musicEnabled;
  13568. private Background[] aBackgroundArray1152s;
  13569. public static boolean needDrawTabArea;
  13570. private int unreadMessages;
  13571. private static int anInt1155;
  13572. private static boolean fpsOn;
  13573. public boolean loggedIn;
  13574. private boolean canMute;
  13575. private boolean aBoolean1159;
  13576. private boolean aBoolean1160;
  13577. static int loopCycle;
  13578. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  13579. private GraphicsBuffer aRSImageProducer_1163;
  13580. private GraphicsBuffer mapEdgeIP;
  13581. private GraphicsBuffer aRSImageProducer_1164;
  13582. private GraphicsBuffer aRSImageProducer_1165;
  13583. private GraphicsBuffer aRSImageProducer_1166;
  13584. private int daysSinceRecovChange;
  13585. private RSSocket socketStream;
  13586. private int anInt1169;
  13587. private int minimapInt3;
  13588. private int anInt1171;
  13589. private long aLong1172;
  13590. private String myUsername;
  13591. private String myPassword;
  13592. private static int anInt1175;
  13593. private boolean genericLoadingError;
  13594. private final int[] anIntArray1177 = {
  13595. 0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  13596. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  13597. 2, 2, 3
  13598. };
  13599. private int reportAbuseInterfaceID;
  13600. private NodeList aClass19_1179;
  13601. private int[] anIntArray1180;
  13602. private int[] anIntArray1181;
  13603. private int[] anIntArray1182;
  13604. private byte[][] aByteArrayArray1183;
  13605. private int anInt1184;
  13606. private int minimapInt1;
  13607. private int anInt1186;
  13608. private int anInt1187;
  13609. private static int anInt1188;
  13610. private int invOverlayInterfaceID;
  13611. private int[] anIntArray1190;
  13612. private int[] anIntArray1191;
  13613. private Stream stream;
  13614. private int anInt1193;
  13615. private int splitPrivateChat;
  13616. private Background mapBack;
  13617. private String[] menuActionName;
  13618. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  13619. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  13620. private final int[] anIntArray1203;
  13621. static final int[] anIntArray1204 = {
  13622. 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  13623. 58654, 5027, 1457, 16565, 34991, 25486
  13624. };
  13625. private static boolean flagged;
  13626. private final int[] anIntArray1207;
  13627. private int anInt1208;
  13628. private int minimapInt2;
  13629. public static int anInt1210;
  13630. public static int anInt1211;
  13631. private String promptInput;
  13632. private int anInt1213;
  13633. private int[][][] intGroundArray;
  13634. private long aLong1215;
  13635. private int loginScreenCursorPos;
  13636. private final Background[] modIcons;
  13637. private long aLong1220;
  13638. public static int tabID;
  13639. private int anInt1222;
  13640. public static boolean inputTaken;
  13641. private int inputDialogState;
  13642. private static int anInt1226;
  13643. private int nextSong;
  13644. private boolean songChanging;
  13645. private final int[] anIntArray1229;
  13646. private Class11[] aClass11Array1230;
  13647. public static int anIntArray1232[];
  13648. private boolean aBoolean1233;
  13649. private int[] anIntArray1234;
  13650. private int[] anIntArray1235;
  13651. private int[] anIntArray1236;
  13652. private int anInt1237;
  13653. private int anInt1238;
  13654. public final int anInt1239 = 100;
  13655. private final int[] anIntArray1240;
  13656. private final int[] anIntArray1241;
  13657. private boolean aBoolean1242;
  13658. private int atInventoryLoopCycle;
  13659. private int atInventoryInterface;
  13660. private int atInventoryIndex;
  13661. private int atInventoryInterfaceType;
  13662. private byte[][] aByteArrayArray1247;
  13663. private int tradeMode;
  13664. private int anInt1249;
  13665. private final int[] anIntArray1250;
  13666. private int anInt1251;
  13667. private final boolean rsAlreadyLoaded;
  13668. private int anInt1253;
  13669. private int anInt1254;
  13670. private boolean welcomeScreenRaised;
  13671. private boolean messagePromptRaised;
  13672. private int anInt1257;
  13673. private byte[][][] byteGroundArray;
  13674. private int prevSong;
  13675. private int destX;
  13676. private int destY;
  13677. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  13678. private int anInt1264;
  13679. private int anInt1265;
  13680. private String loginMessage1;
  13681. private String loginMessage2;
  13682. private int anInt1268;
  13683. private int anInt1269;
  13684. private TextDrawingArea smallText;
  13685. private TextDrawingArea aTextDrawingArea_1271;
  13686. private TextDrawingArea chatTextDrawingArea;
  13687. private int anInt1275;
  13688. private int backDialogID;
  13689. private int anInt1278;
  13690. private int anInt1279;
  13691. private int[] bigX;
  13692. private int[] bigY;
  13693. private int itemSelected;
  13694. private int anInt1283;
  13695. private int anInt1284;
  13696. private int anInt1285;
  13697. private String selectedItemName;
  13698. private int publicChatMode;
  13699. private static int anInt1288;
  13700. private int anInt1289;
  13701. public static int anInt1290;
  13702. public static String server = "";
  13703. public int drawCount;
  13704. public int fullscreenInterfaceID;
  13705. public int anInt1044;//377
  13706. public int anInt1129;//377
  13707. public int anInt1315;//377
  13708. public int anInt1500;//377
  13709. public int anInt1501;//377
  13710. public int[] fullScreenTextureArray;
  13711. public void resetAllImageProducers() {
  13712. if (super.fullGameScreen != null) {
  13713. return;
  13714. }
  13715. aRSImageProducer_1166 = null;
  13716. aRSImageProducer_1164 = null;
  13717. aRSImageProducer_1163 = null;
  13718. aRSImageProducer_1165 = null;
  13719. aRSImageProducer_1123 = null;
  13720. aRSImageProducer_1124 = null;
  13721. aRSImageProducer_1125 = null;
  13722. aRSImageProducer_1107 = null;
  13723. aRSImageProducer_1108 = null;
  13724. aRSImageProducer_1109 = null;
  13725. aRSImageProducer_1110 = null;
  13726. aRSImageProducer_1111 = null;
  13727. aRSImageProducer_1112 = null;
  13728. aRSImageProducer_1113 = null;
  13729. aRSImageProducer_1114 = null;
  13730. aRSImageProducer_1115 = null;
  13731. super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  13732. welcomeScreenRaised = true;
  13733. }
  13734.  
  13735.  
  13736. public void launchURL(String url) {
  13737. String osName = System.getProperty("os.name");
  13738. try {
  13739. if (osName.startsWith("Mac OS")) {
  13740. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  13741. Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
  13742. openURL.invoke(null, new Object[] {url});
  13743. } else if (osName.startsWith("Windows"))
  13744. Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  13745. else { //assume Unix or Linux
  13746. String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  13747. String browser = null;
  13748. for (int count = 0; count < browsers.length && browser == null; count++)
  13749. if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
  13750. browser = browsers[count];
  13751. if (browser == null) {
  13752. throw new Exception("Could not find web browser");
  13753. } else
  13754. Runtime.getRuntime().exec(new String[] {browser, url});
  13755. }
  13756. } catch (Exception e) {
  13757. pushMessage("Failed to open URL.", 0, "");
  13758. }
  13759. }
  13760.  
  13761. static {
  13762. anIntArray1019 = new int[99];
  13763. int i = 0;
  13764. for(int j = 0; j < 99; j++) {
  13765. int l = j + 1;
  13766. int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  13767. i += i1;
  13768. anIntArray1019[j] = i / 4;
  13769. }
  13770. anIntArray1232 = new int[32];
  13771. i = 2;
  13772. for(int k = 0; k < 32; k++) {
  13773. anIntArray1232[k] = i - 1;
  13774. i += i;
  13775. }
  13776. }
  13777. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement