Advertisement
Guest User

Untitled

a guest
Jul 10th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 459.08 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.awt.Dimension;
  6. import java.net.URL;
  7. import java.net.URLConnection;
  8. import java.applet.AppletContext;
  9. import java.awt.*;
  10. import java.io.*;
  11. import java.net.*;
  12. import java.lang.reflect.Method;
  13. import sign.signlink;
  14. import javax.swing.*;
  15. import java.util.zip.*;
  16. import java.util.Enumeration;
  17.  
  18. public class client extends RSApplet {
  19.  
  20. private String getCacheDir() {
  21. return signlink.findcachedir();
  22. }
  23.  
  24. public void tabToReplyPm() {
  25. String name = null;
  26. for (int k = 0; k < 100; k++) {
  27. if (chatMessages[k] == null) {
  28. continue;
  29. }
  30. int l = chatTypes[k];
  31. if (l == 3 || l == 7) {
  32. name = chatNames[k];
  33. break;
  34. }
  35. }
  36.  
  37. if (name == null) {
  38. pushMessage("You haven't received any messages to which you can reply.", 0, "");
  39. return;
  40. }
  41.  
  42. if (name.startsWith("@cr")) {
  43. name = name.substring(5);
  44. }
  45.  
  46. long nameAsLong = TextClass.longForName(name.trim());
  47. int k3 = -1;
  48. for (int i4 = 0; i4 < friendsCount; i4++) {
  49. if (friendsListAsLongs[i4] != nameAsLong) continue;
  50. k3 = i4;
  51. break;
  52. }
  53.  
  54. if (k3 != -1) {
  55. if (friendsNodeIDs[k3] > 0) {
  56. inputTaken = true;
  57. inputDialogState = 0;
  58. messagePromptRaised = true;
  59. promptInput = "";
  60. friendsListAction = 3;
  61. aLong953 = friendsListAsLongs[k3];
  62. aString1121 = "Enter message to send to " + friendsList[k3];
  63. } else {
  64. pushMessage("That player is currently offline.", 0, "");
  65. }
  66. }
  67. }
  68.  
  69. void mouseWheelDragged(int i, int j) {
  70. if (!isMouseWheelPressed())
  71. return;
  72. this.anInt1186 += i * 3;
  73. this.anInt1187 += (j << 1);
  74. }
  75.  
  76. public void maps() {
  77. for (int MapIndex = 0; MapIndex < 3536; MapIndex++) {
  78. byte[] abyte0 = GetMap(MapIndex);
  79. if (abyte0 != null && abyte0.length > 0) {
  80. decompressors[4].method234(abyte0.length, abyte0, MapIndex);
  81. }
  82. }
  83. }
  84.  
  85. public byte[] GetMap(int Index) {
  86. try {
  87. File Map = new File(signlink.findcachedir() + "dump/" + Index
  88. + ".gz");
  89. byte[] aByte = new byte[(int) Map.length()];
  90. FileInputStream Fis = new FileInputStream(Map);
  91. Fis.read(aByte);
  92. System.out.println("" + Index + " aByte = [" + aByte + "]!");
  93. Fis.close();
  94. return aByte;
  95. } catch (Exception e) {
  96. return null;
  97. }
  98. }
  99.  
  100. public String spriteDir = signlink.findcachedir() + "Sprites/";
  101. public AlertHandler alertHandler;
  102. public Sprite alertBack;
  103. public Sprite alertBorder;
  104. public Sprite alertBorderH;
  105. public static boolean hitmarks = false;
  106. public static boolean menuToggle = false;
  107. public static boolean headname = false;
  108. public static boolean headhp = false;
  109. public boolean drawLongTabs;
  110. public static boolean is483 = false;
  111. public static boolean menuClicked = false;
  112. public static boolean gameFrame474 = false;
  113. public static boolean gameFrame525 = true;
  114. public static boolean gameFrame554 = false;
  115. public static boolean gameFrame483 = false;
  116. public static boolean newHotKeys = false;
  117. public Sprite magicAuto;
  118. public boolean Autocast = false;
  119. public int autocastId = 0;
  120. public boolean xpClicked = false;
  121. public int flagPos = 72;
  122. public static int Zoom = 0;
  123. public int hitmarkPos = 0;
  124. public int loadingXpos = 0;
  125. public int optionsXpos = 0;
  126. public int followPlayer = 0;
  127. public int followNPC = 0;
  128. public int followDistance = 1;
  129. public boolean drawFlashingSymbol = false;
  130. public boolean drawFlag = false;
  131. public Sprite sprite1;
  132. public Sprite xpFlag;
  133. public Sprite x10Expand;
  134. public Sprite x10ExpandOld;
  135. public Sprite mapRing;
  136. public boolean manaHover = false;
  137. public int xpToDraw = 0;
  138. public static int testXp = 0;
  139. public boolean drawXpBar = false;
  140.  
  141. public static boolean rememberMe = false;
  142.  
  143. public static boolean isFullScreen, hasBeenBlanked;
  144. public static int extraWidth = 1280 - 765, extraHeight = 1024 - 503,
  145. clientWidth = 0, clientHeight = 0;
  146.  
  147. public String fName;
  148. public String dir;
  149. public static boolean orbs = true;
  150. public static boolean HPBarToggle = true;
  151. private Sprite HPBarFull;
  152. private Sprite HPBarEmpty;
  153. private Sprite oldHit;
  154. private Sprite oldBlue;
  155. private Sprite oldGreen;
  156. private String familiarSpecial;
  157. private Sprite summonOrbSpawn;
  158. public int MapX, MapY;
  159. public static int spellID = 0;
  160. public static boolean newDamage = false;
  161.  
  162. public int positions[] = new int[2000];
  163. public int landScapes[] = new int[2000];
  164. public int objects[] = new int[2000];
  165.  
  166. public void models() {
  167. pushMessage("Does it even call the method?", 0, "");
  168. for (int ModelIndex = 0; ModelIndex < 100000; ModelIndex++) {
  169. byte[] abyte0 = getModel(ModelIndex);
  170. if (abyte0 != null && abyte0.length > 0) {
  171. decompressors[3].method234(abyte0.length, abyte0, ModelIndex);
  172. pushMessage("Model added successfully!", 0, "");
  173. }
  174. }
  175. }
  176.  
  177. public void toggleChat() {
  178. if (displayChat)
  179. displayChat = false;
  180. else if (!displayChat)
  181. displayChat = true;
  182. }
  183.  
  184. public static String chatColorHex = "00FFFF";
  185.  
  186. public static int getChatColor() {
  187. int convertHexCode = Integer.parseInt(chatColorHex, 16);
  188. return convertHexCode;
  189.  
  190. }
  191.  
  192. public static void writeSettings() throws IOException {
  193. DataOutputStream out = new DataOutputStream(new BufferedOutputStream(
  194. new FileOutputStream(signlink.findcachedir() + "settings.dat")));
  195. //out.writeInt(rememberMe ? 1 : 0);
  196. //out.writeUTF(rememberMe ? myUsername : "");
  197. //out.writeUTF(rememberMe ? myPassword : "");
  198. //out.writeInt(is474 ? 1 : 0);
  199. out.writeInt(headhp ? 1 : 0);
  200. out.writeInt(headname ? 1 : 0);
  201. out.writeInt(menuToggle ? 1 : 0);
  202. out.writeInt(HPBarToggle ? 1 : 0);
  203. out.writeInt(gameFrame554 ? 1 : 0);
  204. out.writeInt(gameFrame474 ? 1 : 0);
  205. out.writeInt(gameFrame525 ? 1 : 0);
  206. out.writeInt(newDamage ? 1 : 0);
  207. out.writeUTF(chatColorHex);
  208. out.writeInt(Zoom);
  209. out.writeUTF(Uploader.apiKey);
  210. out.close();
  211. }
  212.  
  213. public float lastPercent;
  214.  
  215. public void drawSmothLoadingText(int i, String s) {
  216. for (float f = lastPercent; f < (float) i; f = (float) ((double) f + 0.29999999999999999D)) {
  217. drawLoadingText((int) f, s);
  218. }
  219.  
  220. lastPercent = i;
  221. }
  222.  
  223. public static void readSettings() throws IOException {
  224. DataInputStream in = new DataInputStream(new BufferedInputStream(
  225. new FileInputStream(signlink.findcachedir() + "settings.dat")));
  226. rememberMe = in.readInt() == 1 ? true : false;
  227. myUsername = in.readUTF();
  228. myPassword = in.readUTF();
  229. //is474 = in.readInt() == 1 ? true : false;
  230. headhp = in.readInt() == 1 ? true : false;
  231. headname = in.readInt() == 1 ? true : false;
  232. menuToggle = in.readInt() == 1 ? true : false;
  233. HPBarToggle = in.readInt() == 1 ? true : false;
  234. gameFrame554 = in.readInt() == 1 ? true : false;
  235. gameFrame474 = in.readInt() == 1 ? true : false;
  236. gameFrame525 = in.readInt() == 1 ? true : false;
  237. newDamage = in.readInt() == 1 ? true : false;
  238. chatColorHex = in.readUTF();
  239. Zoom = in.readInt();
  240. Uploader.apiKey = in.readUTF();
  241. in.close();
  242. }
  243.  
  244. public void setClientConfig() {
  245. /*
  246. * int i1, i2, i3, i4; i1 = x10Hits ? 1 : 0; i2 = customCursorsOn ? 1 :
  247. * 0; i3 = drawTransparentMenu ? 1 : 0; i4 = displayHP ? 1 : 0;
  248. * sendFrame36(669, (byte)i1); sendFrame36(670, (byte)i2);
  249. * sendFrame36(671, (byte)i3); sendFrame36(672, (byte)i4);
  250. */
  251. }
  252.  
  253. public byte[] getModel(int Index) {
  254. try {
  255. File Model = new File(signlink.findcachedir() + "/Raw/" + Index
  256. + ".gz");
  257. byte[] aByte = new byte[(int) Model.length()];
  258. FileInputStream fis = new FileInputStream(Model);
  259. fis.read(aByte);
  260. pushMessage("aByte = [" + aByte + "]!", 0, "");
  261. fis.close();
  262. return aByte;
  263. } catch (Exception e) {
  264. return null;
  265. }
  266. }
  267.  
  268. public int getOrbFill(int statusInt) {
  269. if (statusInt <= 100 && statusInt >= 97) {
  270. return 0;
  271. } else if (statusInt <= 96 && statusInt >= 93) {
  272. return 1;
  273. } else if (statusInt <= 92 && statusInt >= 89) {
  274. return 2;
  275. } else if (statusInt <= 88 && statusInt >= 85) {
  276. return 3;
  277. } else if (statusInt <= 84 && statusInt >= 81) {
  278. return 4;
  279. } else if (statusInt <= 80 && statusInt >= 77) {
  280. return 5;
  281. } else if (statusInt <= 76 && statusInt >= 73) {
  282. return 6;
  283. } else if (statusInt <= 72 && statusInt >= 69) {
  284. return 7;
  285. } else if (statusInt <= 68 && statusInt >= 65) {
  286. return 8;
  287. } else if (statusInt <= 64 && statusInt >= 61) {
  288. return 9;
  289. } else if (statusInt <= 60 && statusInt >= 57) {
  290. return 10;
  291. } else if (statusInt <= 56 && statusInt >= 53) {
  292. return 11;
  293. } else if (statusInt <= 52 && statusInt >= 49) {
  294. return 12;
  295. } else if (statusInt <= 48 && statusInt >= 45) {
  296. return 13;
  297. } else if (statusInt <= 44 && statusInt >= 41) {
  298. return 14;
  299. } else if (statusInt <= 40 && statusInt >= 37) {
  300. return 15;
  301. } else if (statusInt <= 36 && statusInt >= 33) {
  302. return 16;
  303. } else if (statusInt <= 32 && statusInt >= 29) {
  304. return 17;
  305. } else if (statusInt <= 28 && statusInt >= 25) {
  306. return 18;
  307. } else if (statusInt <= 24 && statusInt >= 21) {
  308. return 19;
  309. } else if (statusInt <= 20 && statusInt >= 17) {
  310. return 20;
  311. } else if (statusInt <= 16 && statusInt >= 13) {
  312. return 21;
  313. } else if (statusInt <= 12 && statusInt >= 9) {
  314. return 22;
  315. } else if (statusInt <= 8 && statusInt >= 7) {
  316. return 23;
  317. } else if (statusInt <= 6 && statusInt >= 5) {
  318. return 24;
  319. } else if (statusInt <= 4 && statusInt >= 3) {
  320. return 25;
  321. } else if (statusInt <= 2 && statusInt >= 1) {
  322. return 26;
  323. } else if (statusInt <= 0) {
  324. return 27;
  325. }
  326. return 0;
  327. }
  328.  
  329.  
  330. public void drawHPOrb() {
  331. String OrbDirectory = signlink.findcachedir()
  332. + "Sprites/GameFrame/Orbs/";
  333. String s1 = RSInterface.interfaceCache[4016].message;
  334. s1 = s1.replaceAll("%", "");
  335. int j = Integer.parseInt(s1);
  336. String s2 = RSInterface.interfaceCache[4017].message;
  337. int health;
  338. s2 = s2.replaceAll("%", "");
  339. int k = Integer.parseInt(s2);
  340. int i = (int) (((double) j / (double) k) * 100D);
  341. String cHP = RSInterface.interfaceCache[4016].message;
  342. int currentHP = Integer.parseInt(cHP);
  343. String mHP = RSInterface.interfaceCache[4017].message;
  344. int maxHP2 = Integer.parseInt(mHP);
  345. health = (int) (((double) currentHP / (double) maxHP2) * 100D);
  346. int x = isFullScreen ? 363 + extraWidth : 0;
  347. int y = isFullScreen ? +32 : 0;
  348.  
  349. int xPos = isFullScreen ? 387 + extraWidth : 0;
  350. int xPosTXT = isFullScreen ? 335 + extraWidth : 0;
  351. int yPos = isFullScreen ? +32 : 0;
  352. if (isFullScreen) {
  353. emptyOrb = new Sprite("GameFrame/Orbs/ORBS 12");
  354. } else {
  355. emptyOrb = new Sprite("GameFrame/Orbs/emptyorb");
  356. }
  357. orbFill = new Sprite(OrbDirectory + "Orb 2.PNG", 27, getOrbFill(health));
  358. /* Draws empty orb */
  359. emptyOrb.drawSprite(170 + x, 13 + y);
  360. /* Draws current HP text */
  361. if (health <= 99999 && health >= 75) {
  362. smallText.method382(65280, 213 + xPosTXT, cHP, 39 + yPos, true);
  363. } else if (health <= 74 && health >= 50) {
  364. smallText.method382(0xffff00, 213 + xPosTXT, cHP, 39 + yPos, true);
  365. } else if (health <= 49 && health >= 25) {
  366. smallText.method382(0xfca607, 213 + xPosTXT, cHP, 39 + yPos, true);
  367. } else if (health <= 24 && health >= 0) {
  368. smallText.method382(0xf50d0d, 213 + xPosTXT, cHP, 39 + yPos, true);
  369. }
  370. hitPointsFill.drawSprite(173 + xPos, 16 + yPos);
  371. orbFill.drawSprite(173 + xPos, 16 + yPos);
  372. /* Draws inside orb sprites */
  373. if (i <= 20) {
  374. if (loopCycle % 20 < 10) {
  375. hitPointsIcon.drawSprite(179 + xPos, 24 + yPos);
  376. }
  377. } else {
  378. hitPointsIcon.drawSprite(179 + xPos, 24 + yPos);
  379. }
  380. }
  381.  
  382. public void drawPrayerOrb() {
  383. String OrbDirectory = signlink.findcachedir()
  384. + "Sprites/GameFrame/Orbs/";
  385. int prayer;
  386. String cPR = RSInterface.interfaceCache[4012].message;
  387. int currentPR = Integer.parseInt(cPR);
  388. String mPR = RSInterface.interfaceCache[4013].message;
  389. int maxPR2 = Integer.parseInt(mPR);
  390. prayer = (int) (((double) currentPR / (double) maxPR2) * 100D);
  391. String cP = RSInterface.interfaceCache[4012].message;
  392. int currentPrayer = Integer.parseInt(cP);
  393. String mP = RSInterface.interfaceCache[4013].message;
  394. int maxPrayer = Integer.parseInt(mP);
  395. prayer = (int) (((double) currentPrayer / (double) maxPrayer) * 100D);
  396. int x = isFullScreen ? 347 + extraWidth : 0;
  397. int y = isFullScreen ? +32 : 0;
  398.  
  399. int xPos = isFullScreen ? 387 + extraWidth - 17 : 0;
  400. int xPosTXT = isFullScreen ? 335 + extraWidth - 17 : 0;
  401. int yPos = isFullScreen ? +32 : 0;
  402. orbFill = new Sprite(OrbDirectory + "Orb 2.PNG", 27, getOrbFill(prayer));
  403. emptyOrb.drawSprite(184 + x, 49 + y);
  404. if (prayer <= 999999 && prayer >= 75) {
  405. smallText.method382(65280, 227 + xPosTXT, cP, 75 + yPos, true);
  406. } else if (prayer <= 74 && prayer >= 50) {
  407. smallText.method382(0xffff00, 227 + xPosTXT, cP, 75 + yPos, true);
  408. } else if (prayer <= 49 && prayer >= 25) {
  409. smallText.method382(0xfca607, 227 + xPosTXT, cP, 75 + yPos, true);
  410. } else if (prayer <= 24 && prayer >= 0) {
  411. smallText.method382(0xf50d0d, 227 + xPosTXT, cP, 75 + yPos, true);
  412. }
  413. prayerFill.drawSprite(187 + xPos, 52 + yPos);
  414. orbFill.drawSprite(187 + xPos, 52 + yPos);
  415. if (prayer <= 25) {
  416. if (loopCycle % 20 < 10) {
  417. prayerIcon.drawSprite(191 + xPos, 56 + yPos);
  418. }
  419. } else {
  420. prayerIcon.drawSprite(191 + xPos, 56 + yPos);
  421. }
  422. }
  423.  
  424. public void drawRunOrb() {
  425. Sprite orb = (runClicked ? runOrb2 : runOrb1);
  426. Sprite icon = (runClicked ? runIcon2 : runIcon1);
  427. int x = isFullScreen ? 358 + extraWidth : 0;
  428. int y = isFullScreen ? +32 : 0;
  429.  
  430. int x2 = isFullScreen ? extraWidth - 160 : 0;
  431. int y2 = isFullScreen ? +36 : 0;
  432.  
  433. int xPos = isFullScreen ? 387 + extraWidth - 5 : 0;
  434. int xPosTXT = isFullScreen ? 335 + extraWidth - 5 : 0;
  435. int yPos = isFullScreen ? +32 : 0;
  436. if (isFullScreen) {
  437. hoveredEmpty = new Sprite("GameFrame/Orbs/1127");
  438. } else {
  439. hoveredEmpty = new Sprite("GameFrame/Orbs/hoveredempty");
  440. }
  441. emptyOrb.drawSprite(185 + x, 85 + y);
  442. if (super.mouseX > 713 + x2 && super.mouseX < 765 + x2
  443. && super.mouseY > 83 + y2 && super.mouseY < 118 + y2) {
  444. hoveredEmpty.drawSprite(185 + x, 85 + y);
  445. }
  446. orb.drawSprite(188 + xPos, 88 + yPos);
  447. icon.drawSprite(195 + xPos, 93 + yPos);
  448. int colour;
  449. colour = 65280;
  450. smallText.method382(colour, 229 + xPosTXT, "100", 111 + yPos, true);
  451. }
  452.  
  453. private void rightClickMapArea() {
  454. int x = isFullScreen ? extraWidth + 17 : 0;
  455. int y = isFullScreen ? -30 : 0;
  456. int x22 = isFullScreen ? extraWidth : 0;
  457.  
  458. int x2 = isFullScreen ? extraWidth - 160 : 0;
  459. int y2 = isFullScreen ? +36 : 0;
  460. if (super.mouseX >= 742 + x22 && super.mouseX <= 764 + x22
  461. && super.mouseY >= 1 && super.mouseY <= 23
  462. && tabInterfaceIDs[10] != -1) {
  463. menuActionName[1] = "Logout";
  464. menuActionID[1] = 1004;
  465. menuActionRow = 2;
  466. } else if (super.mouseX >= 516 + x && super.mouseX <= 550 + x
  467. && super.mouseY >= 46 + y && super.mouseY < 80 + y) {
  468. menuActionName[1] = "Toggle XP Total";
  469. menuActionID[1] = 1503;
  470. menuActionRow = 2;
  471. } else if (super.mouseX > 724 + x22 && super.mouseX < 741 + x22
  472. && super.mouseY > 1 && super.mouseY < 23) {
  473. menuActionName[1] = "Advisor";
  474. menuActionID[1] = 1005;
  475. menuActionRow = 2;
  476. } else if (super.mouseX > 713 + x2 && super.mouseX < 765 + x2
  477. && super.mouseY > 83 + y2 && super.mouseY < 118 + y2) {
  478. menuActionName[1] = "Run";
  479. menuActionID[1] = 1051;
  480. menuActionRow = 2;
  481. }
  482. }
  483.  
  484. public void setNewMaps() {
  485. try {
  486. BufferedReader in = new BufferedReader(new FileReader(signlink
  487. .findcachedir()
  488. + "Maps/mapConfig.txt"));
  489. String s;
  490. int D = 0;
  491. while ((s = in.readLine()) != null) {
  492. positions[D] = Integer.parseInt(s.substring(s.indexOf("=") + 1,
  493. s.indexOf("(")));
  494. landScapes[D] = Integer.parseInt(s.substring(
  495. s.indexOf("(") + 1, s.indexOf(")")));
  496. objects[D] = Integer.parseInt(s.substring(s.indexOf("[") + 1, s
  497. .indexOf("]")));
  498. D++;
  499. }
  500. } catch (IOException e) {
  501. e.printStackTrace();
  502. }
  503. }
  504.  
  505. public void drawHoverBox(int xPos, int yPos, String text) {
  506. String[] results = text.split("\n");
  507. int height = (results.length * 16) + 6;
  508. int width;
  509. width = smallText.getTextWidth(results[0]) + 6;
  510. for (int i = 1; i < results.length; i++)
  511. if (width <= smallText.getTextWidth(results[i]) + 6)
  512. width = smallText.getTextWidth(results[i]) + 6;
  513. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  514. DrawingArea.drawUnfilledPixels(xPos, width, height, 0, yPos);
  515. yPos += 14;
  516. for (int i = 0; i < results.length; i++) {
  517. smallText.method389(false, xPos + 3, 0, results[i], yPos);
  518. yPos += 16;
  519. }
  520. }
  521.  
  522. private static String intToKOrMilLongName(int i) {
  523. String s = String.valueOf(i);
  524. for (int k = s.length() - 3; k > 0; k -= 3)
  525. s = s.substring(0, k) + "," + s.substring(k);
  526.  
  527. // if(j != 0)
  528. // aBoolean1224 = !aBoolean1224;
  529. if (s.length() > 8)
  530. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@("
  531. + s + ")";
  532. else if (s.length() > 4)
  533. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  534. return " " + s;
  535. }
  536.  
  537. public final String methodR(/* int i, */int j) {
  538. // if(i <= 0)
  539. // pktType = inStream.readUnsignedByte();
  540. if (j >= 0 && j < 10000)
  541. return String.valueOf(j);
  542. if (j >= 10000 && j < 10000000)
  543. return j / 1000 + "K";
  544. if (j >= 10000000 && j < 999999999)
  545. return j / 1000000 + "M";
  546. if (j >= 999999999)
  547. return "*";
  548. else
  549. return "?";
  550. }
  551.  
  552. public static final byte[] ReadFile(String s) {
  553. try {
  554. byte abyte0[];
  555. File file = new File(s);
  556. int i = (int) file.length();
  557. abyte0 = new byte[i];
  558. DataInputStream datainputstream = new DataInputStream(
  559. new BufferedInputStream(new FileInputStream(s)));
  560. datainputstream.readFully(abyte0, 0, i);
  561. datainputstream.close();
  562. return abyte0;
  563. } catch (Exception e) {
  564. System.out.println((new StringBuilder()).append("Read Error: ")
  565. .append(s).toString());
  566. return null;
  567. }
  568. }
  569.  
  570. private void stopMidi() {
  571. signlink.midifade = 0;
  572. signlink.midi = "stop";
  573. }
  574.  
  575. private boolean menuHasAddFriend(int j) {
  576. if (j < 0)
  577. return false;
  578. int k = menuActionID[j];
  579. if (k >= 2000)
  580. k -= 2000;
  581. return k == 337;
  582. }
  583.  
  584. public void drawChannelButtons() {
  585. int y = isFullScreen ? extraHeight + 334 : 0;
  586. String text[] = { "On", "Friends", "Off", "Hide" };
  587. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  588. if (displayChat) {
  589. switch (cButtonCPos) {
  590. case 0:
  591. chatButtons[1].drawSprite(5, 142 + y);
  592. break;
  593. case 1:
  594. chatButtons[1].drawSprite(71, 142 + y);
  595. break;
  596. case 2:
  597. chatButtons[1].drawSprite(137, 142 + y);
  598. break;
  599. case 3:
  600. chatButtons[1].drawSprite(203, 142 + y);
  601. break;
  602. case 4:
  603. chatButtons[1].drawSprite(269, 142 + y);
  604. break;
  605. case 5:
  606. chatButtons[1].drawSprite(335, 142 + y);
  607. break;
  608. }
  609. if (cButtonHPos == cButtonCPos) {
  610. switch (cButtonHPos) {
  611. case 0:
  612. chatButtons[2].drawSprite(5, 142 + y);
  613. break;
  614. case 1:
  615. chatButtons[2].drawSprite(71, 142 + y);
  616. break;
  617. case 2:
  618. chatButtons[2].drawSprite(137, 142 + y);
  619. break;
  620. case 3:
  621. chatButtons[2].drawSprite(203, 142 + y);
  622. break;
  623. case 4:
  624. chatButtons[2].drawSprite(269, 142 + y);
  625. break;
  626. case 5:
  627. chatButtons[2].drawSprite(335, 142 + y);
  628. break;
  629. case 6:
  630. chatButtons[3].drawSprite(404, 142 + y);
  631. break;
  632. }
  633. } else {
  634. switch (cButtonHPos) {
  635. case 0:
  636. chatButtons[0].drawSprite(5, 142 + y);
  637. break;
  638. case 1:
  639. chatButtons[0].drawSprite(71, 142 + y);
  640. break;
  641. case 2:
  642. chatButtons[0].drawSprite(137, 142 + y);
  643. break;
  644. case 3:
  645. chatButtons[0].drawSprite(203, 142 + y);
  646. break;
  647. case 4:
  648. chatButtons[0].drawSprite(269, 142 + y);
  649. break;
  650. case 5:
  651. chatButtons[0].drawSprite(335, 142 + y);
  652. break;
  653. case 6:
  654. chatButtons[3].drawSprite(404, 142 + y);
  655. break;
  656. }
  657. }
  658. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157 + y);
  659. smallText.method389(true, 26, 0xffffff, "All", 157 + y);
  660. smallText.method389(true, 86, 0xffffff, "Game", 157 + y);
  661. smallText.method389(true, 150, 0xffffff, "Public", 152 + y);
  662. smallText.method389(true, 212, 0xffffff, "Private", 152 + y);
  663. smallText.method389(true, 286, 0xffffff, "Clan", 152 + y);
  664. smallText.method389(true, 349, 0xffffff, "Trade", 152 + y);
  665. smallText.method382(textColor[publicChatMode], 164,
  666. text[publicChatMode], 163 + y, true);
  667. smallText.method382(textColor[privateChatMode], 230,
  668. text[privateChatMode], 163 + y, true);
  669. smallText.method382(textColor[clanChatMode], 296,
  670. text[clanChatMode], 163 + y, true);
  671. smallText.method382(textColor[tradeMode], 362, text[tradeMode],
  672. 163 + y, true);
  673. }
  674. }
  675.  
  676. private void processChatToggle() {
  677. if (super.clickMode3 == 1) {
  678. if (displayChat) {
  679. if (super.saveClickX > 247 && super.saveClickX < 260
  680. && super.saveClickY > clientHeight - 173
  681. && super.saveClickY < clientHeight - 166)
  682. toggleChat();
  683. } else if (!displayChat) {
  684. if (super.saveClickX > 247 && super.saveClickX < 260
  685. && super.saveClickY > clientHeight - 15
  686. && super.saveClickY < clientHeight - 8)
  687. toggleChat();
  688. }
  689. }
  690. }
  691.  
  692. private void drawChatArea() {
  693.  
  694. int yPosOffset = isFullScreen ? clientHeight - 166 : 0;
  695. int xPosOffset = isFullScreen ? 0 : 0;
  696. if (!isFullScreen)
  697. aRSImageProducer_1166.initDrawingArea();
  698. Texture.anIntArray1472 = anIntArray1180;
  699. int y = isFullScreen ? extraHeight + 334 : 0;
  700. if (isFullScreen && displayChat)
  701. chatArea.drawSprite2(0, 0 + y);
  702. else if (!isFullScreen) {
  703. chatArea.drawSprite(0, 0);
  704. }
  705. drawChannelButtons();
  706. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  707. // RSFont textDrawingArea = aTextDrawingArea_1271;
  708. if (displayChat || !isFullScreen) {
  709. if (messagePromptRaised) {
  710. newBoldFont.drawCenteredString(aString1121, 259, 60 + y, 0, -1);
  711. newBoldFont.drawCenteredString(promptInput + "*", 259, 80 + y,
  712. 128, -1);
  713. } else if (inputDialogState == 1) {
  714. newBoldFont.drawCenteredString("Enter amount:", 259, 60 + y, 0,
  715. -1);
  716. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259,
  717. 80 + y, 128, -1);
  718. } else if (inputDialogState == 2) {
  719. newBoldFont.drawCenteredString("Enter name:", 259, 60 + y, 0,
  720. -1);
  721. newBoldFont.drawCenteredString(amountOrNameInput + "*", 259,
  722. 80 + y, 128, -1);
  723. } else if (aString844 != null) {
  724. newBoldFont.drawCenteredString(aString844, 259, 60 + y, 0, -1);
  725. newBoldFont.drawCenteredString("Click to continue", 259,
  726. 80 + y, 128, -1);
  727. } else if (backDialogID != -1) {
  728. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID],
  729. 20 + y);
  730. } else if (dialogID != -1d) {
  731. drawInterface(0, 20, RSInterface.interfaceCache[dialogID],
  732. 20 + y);
  733. } else {
  734. int j77 = -3;
  735. int j = 0;
  736. DrawingArea.setDrawingArea(122 + y, 8, 497, 7 + y);
  737. for (int k = 0; k < 500; k++)
  738. if (chatMessages[k] != null) {
  739. int chatType = chatTypes[k];
  740. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  741. String s1 = chatNames[k];
  742. byte byte0 = 0;
  743. if (s1 != null && s1.startsWith("@cr0@")) {
  744. s1 = s1.substring(5);
  745. byte0 = 1;
  746. } else if (s1 != null && s1.startsWith("@cr1@")) {
  747. s1 = s1.substring(5);
  748. byte0 = 2;
  749. } else if (s1 != null && s1.startsWith("@cr1@")) {
  750. s1 = s1.substring(5);
  751. byte0 = 3;
  752. } else if (s1 != null && s1.startsWith("@cr2@")) {
  753. s1 = s1.substring(5);
  754. byte0 = 4;
  755. } else if (s1 != null && s1.startsWith("@cr3@")) {
  756. s1 = s1.substring(5);
  757. byte0 = 5;
  758. } else if (s1 != null && s1.startsWith("@cr4@")) {
  759. s1 = s1.substring(5);
  760. byte0 = 6;
  761. }
  762. if (chatType == 0) {
  763. if (chatTypeView == 5 || chatTypeView == 0) {
  764. if (yPos > 0 && yPos < 210)
  765. newRegularFont.drawBasicString(
  766. chatMessages[k], 11, yPos + y, 0,
  767. -1);
  768. j++;
  769. j77++;
  770. }
  771. }
  772. if ((chatType == 1 || chatType == 2)
  773. && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1
  774. && isFriendOrSelf(s1))) {
  775. if (chatTypeView == 1 || chatTypeView == 0) {
  776. if (yPos > 0 && yPos < 210) {
  777. int xPos = 11;
  778. if (byte0 == 1) {
  779. modIcons[0].drawBackground(xPos + 1,
  780. yPos - 12 + y);
  781. xPos += 14;
  782. } else if (byte0 == 2) {
  783. modIcons[1].drawBackground(xPos + 1,
  784. yPos - 12 + y);
  785. xPos += 14;
  786. } else if (byte0 == 3) {
  787. modIcons[1].drawBackground(xPos + 1,
  788. yPos - 12 + y);
  789. xPos += 14;
  790. } else if (byte0 == 4) {
  791. modIcons[2].drawBackground(xPos + 1,
  792. yPos - 12 + y);
  793. xPos += 14;
  794. } else if (byte0 == 5) {
  795. modIcons[3].drawBackground(xPos + 1,
  796. yPos - 12 + y);
  797. xPos += 14;
  798. } else if (byte0 == 6) {
  799. modIcons[4].drawBackground(xPos + 1,
  800. yPos - 12 + y);
  801. xPos += 14;
  802. }
  803. newRegularFont.drawBasicString(s1 + ":",
  804. xPos, yPos + y, 0, -1);
  805. xPos += newRegularFont.getTextWidth(s1) + 8;
  806. newRegularFont.drawBasicString(
  807. chatMessages[k], xPos, yPos + y,
  808. 255, -1);
  809. }
  810. j++;
  811. j77++;
  812. }
  813. }
  814. if ((chatType == 3 || chatType == 7)
  815. && (splitPrivateChat == 0 || chatTypeView == 2)
  816. && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1
  817. && isFriendOrSelf(s1))) {
  818. if (chatTypeView == 2 || chatTypeView == 0) {
  819. if (yPos > 0 && yPos < 210) {
  820. int k1 = 11;
  821. newRegularFont.drawBasicString("From", k1,
  822. yPos + y, 0, -1);
  823. k1 += newRegularFont.getTextWidth("From ");
  824. if (byte0 == 1) {
  825. modIcons[0].drawBackground(k1, yPos
  826. - 12 + y);
  827. k1 += 12;
  828. } else if (byte0 == 2) {
  829. modIcons[0].drawBackground(k1, yPos
  830. - 12 + y);
  831. k1 += 12;
  832. } else if (byte0 == 3) {
  833. modIcons[1].drawBackground(k1, yPos
  834. - 12 + y);
  835. k1 += 12;
  836. } else if (byte0 == 4) {
  837. modIcons[1].drawBackground(k1, yPos
  838. - 12 + y);
  839. k1 += 12;
  840. } else if (byte0 == 5) {
  841. modIcons[3].drawBackground(k1, yPos
  842. - 12 + y);
  843. k1 += 12;
  844. } else if (byte0 == 6) {
  845. modIcons[4].drawBackground(k1, yPos
  846. - 12 + y);
  847. k1 += 12;
  848. }
  849. newRegularFont.drawBasicString(s1 + ":",
  850. k1, yPos + y, 0, -1);
  851. k1 += newRegularFont.getTextWidth(s1) + 8;
  852. newRegularFont.drawBasicString(
  853. chatMessages[k], k1, yPos + y,
  854. 0x800000, -1);
  855. }
  856. j++;
  857. j77++;
  858. }
  859. }
  860. if (chatType == 4
  861. && (tradeMode == 0 || tradeMode == 1
  862. && isFriendOrSelf(s1))) {
  863. if (chatTypeView == 3 || chatTypeView == 0) {
  864. if (yPos > 0 && yPos < 210)
  865. newRegularFont.drawBasicString(s1 + " "
  866. + chatMessages[k], 11, yPos + y,
  867. 0x800080, -1);
  868. j++;
  869. j77++;
  870. }
  871. }
  872. if (chatType == 5 && splitPrivateChat == 0
  873. && privateChatMode < 2) {
  874. if (chatTypeView == 2 || chatTypeView == 0) {
  875. if (yPos > 0 && yPos < 210)
  876. newRegularFont.drawBasicString(
  877. chatMessages[k], 11, yPos + y,
  878. 0x800000, -1);
  879. j++;
  880. j77++;
  881. }
  882. }
  883. if (chatType == 6
  884. && (splitPrivateChat == 0 || chatTypeView == 2)
  885. && privateChatMode < 2) {
  886. if (chatTypeView == 2 || chatTypeView == 0) {
  887. if (yPos > 0 && yPos < 210) {
  888. newRegularFont.drawBasicString("To " + s1
  889. + ":", 11, yPos + y, 0, -1);
  890. newRegularFont.drawBasicString(
  891. chatMessages[k],
  892. 15 + newRegularFont
  893. .getTextWidth("To :" + s1),
  894. yPos + y, 0x800000, -1);
  895. }
  896. j++;
  897. j77++;
  898. }
  899. }
  900. if (chatType == 8
  901. && (tradeMode == 0 || tradeMode == 1
  902. && isFriendOrSelf(s1))) {
  903. if (chatTypeView == 3 || chatTypeView == 0) {
  904. if (yPos > 0 && yPos < 210)
  905. newRegularFont.drawBasicString(s1 + " "
  906. + chatMessages[k], 11, yPos, 0x7e3200,
  907. -1);
  908. j++;
  909. j77++;
  910. }
  911. if (chatType == 11 && (clanChatMode == 0)) {//this
  912. if (chatTypeView == 11) {
  913. if (yPos > 0 && yPos < 110)
  914. newRegularFont.drawBasicString(s1 + " "
  915. + chatMessages[k], 19, yPos,
  916. 0x7e3200, -1);
  917. j++;
  918. j77++;
  919. }
  920. }
  921. }
  922. if (chatType == 12) {
  923. if (chatTypeView == 5 || chatTypeView == 0) {
  924. if (yPos > 0 && yPos < 210) {
  925. String title = "<col=0000FF>"
  926. + clanTitles[k] + "</col>";
  927. String username = (chatRights[k] > 0 ? "<img="
  928. + (chatRights[k] - 1) + ">"
  929. : "")
  930. + TextClass.fixName(chatNames[k]);
  931. String message = "<col=800000>"
  932. + chatMessages[k] + "</col>";
  933. newRegularFont.drawBasicString("[" + title
  934. + "] " + username + ": " + message,
  935. 11, yPos, 0, -1);
  936. }
  937. j++;
  938. j77++;
  939. }
  940. }
  941. if (chatType == 16) {
  942. int j2 = 40;
  943. int clanNameWidth = textDrawingArea
  944. .getTextWidth(clanTitles[k]);
  945. if (chatTypeView == 11 || chatTypeView == 0) {
  946. if (yPos > 0 && yPos < 210)
  947. switch (chatRights[k]) {
  948. case 1:
  949. j2 += clanNameWidth;
  950. modIcons[0].drawBackground(j2 - 18,
  951. yPos - 12 + y);
  952. j2 += 14;
  953. break;
  954. case 2:
  955. j2 += clanNameWidth;
  956. modIcons[1].drawBackground(j2 - 18,
  957. yPos - 12 + y);
  958. j2 += 14;
  959. break;
  960.  
  961. case 3:
  962. j2 += clanNameWidth;
  963. modIcons[1].drawBackground(j2 - 18,
  964. yPos - 12 + y);
  965. j2 += 14;
  966. break;
  967.  
  968. case 4:
  969. j2 += clanNameWidth;
  970. modIcons[2].drawBackground(j2 - 18,
  971. yPos - 12 + y);
  972. j2 += 14;
  973. break;
  974. case 5:
  975. j2 += clanNameWidth;
  976. modIcons[3].drawBackground(j2 - 18,
  977. yPos - 12 + y);
  978. j2 += 14;
  979. break;
  980. case 6:
  981. j2 += clanNameWidth;
  982. modIcons[4].drawBackground(j2 - 18,
  983. yPos - 12 + y);
  984. j2 += 14;
  985. break;
  986. default:
  987. j2 += clanNameWidth;
  988. break;
  989. }
  990. newRegularFont.drawBasicString("[", 8,
  991. yPos + y, 0, -1);
  992. newRegularFont.drawBasicString("" + clanTitles[k]
  993. + "", 14, yPos + y, 255, -1);
  994. newRegularFont.drawBasicString("]",
  995. clanNameWidth + 14, yPos + y, 0, -1);
  996. newRegularFont.drawBasicString(capitalize(chatNames[k])
  997. + ":", j2 - 17, yPos + y, 0, -1);
  998. j2 += textDrawingArea
  999. .getTextWidth(chatNames[k]) + 7;
  1000. newRegularFont.drawBasicString(chatMessages[k],
  1001. j2 - 16, yPos + y, 0x800000, -1);
  1002. j++;
  1003. j77++;
  1004. }
  1005. }
  1006. }
  1007. DrawingArea.defaultDrawingAreaSize();
  1008. anInt1211 = j * 14 + 7 + 5;
  1009. if (anInt1211 < 111)
  1010. anInt1211 = 111;
  1011. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7 + y, 496,
  1012. anInt1211);
  1013. String s;
  1014. if (myPlayer != null && myPlayer.name != null)
  1015. s = myPlayer.name;
  1016. else
  1017. s = TextClass.fixName(myUsername);
  1018. newRegularFont.drawBasicString(s + ":", 11, 133 + y, 0, -1);
  1019. newRegularFont.drawBasicString(inputString
  1020. + ((loopCycle % 40 < 20) ? "<col=#000000>|" : ""),
  1021. 12 + textDrawingArea.getTextWidth(s + ": "), 133 + y,
  1022. 255, -1);
  1023. // newRegularFont.drawBasicString(s, 11, 133+y, 0, -1);
  1024. // newRegularFont.drawBasicString(":", (25 +
  1025. // textDrawingArea.getTextWidth(s)), 133+y, 0, -1);
  1026. // newRegularFont.drawBasicString(inputString + ((loopCycle % 40
  1027. // < 20) ? "<col=0>|" : ""), 12 + textDrawingArea.getTextWidth(s
  1028. // + ": "), 133+y ,255 , -1);
  1029. DrawingArea.method339(121 + y, 0x807660, 506, 7);
  1030. }
  1031. if (menuOpen && menuScreenArea == 2) {
  1032. drawMenu();
  1033. }
  1034. if (!isFullScreen)
  1035. aRSImageProducer_1166.drawGraphics(338 + extraHeight,
  1036. isFullScreen ? bufferGraphics : super.graphics, 0);
  1037. aRSImageProducer_1165.initDrawingArea();
  1038. Texture.anIntArray1472 = anIntArray1182;
  1039. }
  1040. }
  1041.  
  1042. private Graphics bufferGraphics;
  1043. protected boolean webclient = true;
  1044. private Image buffer;
  1045.  
  1046. // clan chat
  1047. private String clanUsername;
  1048. private String clanMessage;
  1049. private String clanTitle;
  1050. private final String[] clanTitles;
  1051. private int channelRights;
  1052.  
  1053. public void init() {
  1054. try {
  1055. nodeID = 10;
  1056. portOff = 0;
  1057. setHighMem();
  1058. isMembers = true;
  1059. signlink.storeid = 32;
  1060. signlink.startpriv(InetAddress.getByName(server));
  1061. initClientFrame(503, 765);
  1062. instance = this;
  1063. } catch (Exception exception) {
  1064. return;
  1065. }
  1066. try {
  1067. readSettings();
  1068. } catch (IOException e) {
  1069. }
  1070.  
  1071. }
  1072.  
  1073. public void startRunnable(Runnable runnable, int i) {
  1074. if (i > 10)
  1075. i = 10;
  1076. if (signlink.mainapp != null) {
  1077. signlink.startthread(runnable, i);
  1078. } else {
  1079. super.startRunnable(runnable, i);
  1080. }
  1081. }
  1082.  
  1083. public Socket openSocket(int port) throws IOException {
  1084. return new Socket(InetAddress.getByName(server), port);
  1085. }
  1086.  
  1087. private void processMenuClick() {
  1088. if (activeInterfaceType != 0)
  1089. return;
  1090. int j = super.clickMode3;
  1091. if (spellSelected == 1 && super.saveClickX >= 503
  1092. && super.saveClickY >= 160 && super.saveClickX <= 765
  1093. && super.saveClickY <= 205)
  1094. j = 0;
  1095. if (menuOpen) {
  1096. if (j != 1) {
  1097. int k = super.mouseX;
  1098. int j1 = super.mouseY;
  1099. if (menuScreenArea == 0) {
  1100. k -= 4;
  1101. j1 -= 4;
  1102. }
  1103. if (menuScreenArea == 1) {
  1104. k -= 516;// 519
  1105. j1 -= 168;
  1106. }
  1107. if (menuScreenArea == 2) {
  1108. k -= 5;
  1109. j1 -= 338;
  1110. }
  1111. if (menuScreenArea == 3) {
  1112. k -= 516;// 519
  1113. j1 -= 0;
  1114. }
  1115. if (k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10
  1116. || j1 < menuOffsetY - 10
  1117. || j1 > menuOffsetY + menuHeight + 10) {
  1118. menuOpen = false;
  1119. if (menuScreenArea == 1)
  1120. needDrawTabArea = true;
  1121. if (menuScreenArea == 2)
  1122. inputTaken = true;
  1123. }
  1124. }
  1125. if (j == 1) {
  1126. int l = menuOffsetX;
  1127. int k1 = menuOffsetY;
  1128. int i2 = menuWidth;
  1129. int k2 = super.saveClickX;
  1130. int l2 = super.saveClickY;
  1131. if (menuScreenArea == 0) {
  1132. k2 -= 4;
  1133. l2 -= 4;
  1134. }
  1135. if (menuScreenArea == 1) {
  1136. k2 -= 516;// 519
  1137. l2 -= 168;
  1138. }
  1139. if (menuScreenArea == 2) {
  1140. k2 -= 5;// 17
  1141. l2 -= 338;
  1142. }
  1143. if (menuScreenArea == 3) {
  1144. k2 -= 516;// 519
  1145. l2 -= 0;
  1146. }
  1147. int i3 = -1;
  1148. for (int j3 = 0; j3 < menuActionRow; j3++) {
  1149. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  1150. if (k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  1151. i3 = j3;
  1152. }
  1153. // System.out.println(i3);
  1154. if (i3 != -1)
  1155. doAction(i3);
  1156. menuOpen = false;
  1157. if (menuScreenArea == 1)
  1158. needDrawTabArea = true;
  1159. if (menuScreenArea == 2) {
  1160. inputTaken = true;
  1161. }
  1162. }
  1163. } else {
  1164. if (j == 1 && menuActionRow > 0) {
  1165. int i1 = menuActionID[menuActionRow - 1];
  1166. if (i1 == 632 || i1 == 78 || i1 == 867 || i1 == 431 || i1 == 53
  1167. || i1 == 74 || i1 == 454 || i1 == 539 || i1 == 493
  1168. || i1 == 847 || i1 == 447 || i1 == 1125) {
  1169. int l1 = menuActionCmd2[menuActionRow - 1];
  1170. int j2 = menuActionCmd3[menuActionRow - 1];
  1171. RSInterface class9 = RSInterface.interfaceCache[j2];
  1172. if (class9.aBoolean259 || class9.aBoolean235) {
  1173. aBoolean1242 = false;
  1174. anInt989 = 0;
  1175. anInt1084 = j2;
  1176. anInt1085 = l1;
  1177. activeInterfaceType = 2;
  1178. anInt1087 = super.saveClickX;
  1179. anInt1088 = super.saveClickY;
  1180. if (RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  1181. activeInterfaceType = 1;
  1182. if (RSInterface.interfaceCache[j2].parentID == backDialogID)
  1183. activeInterfaceType = 3;
  1184. return;
  1185. }
  1186. }
  1187. }
  1188. if (j == 1
  1189. && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1))
  1190. && menuActionRow > 2)
  1191. j = 2;
  1192. if (j == 1 && menuActionRow > 0)
  1193. doAction(menuActionRow - 1);
  1194. if (j == 2 && menuActionRow > 0)
  1195. determineMenuSize();
  1196.  
  1197. }
  1198. }
  1199.  
  1200. public static int totalRead = 0;
  1201.  
  1202. public static String getFileNameWithoutExtension(String fileName) {
  1203. if (fileName.contains(".rsmap"))
  1204. fileName = fileName.replace(".rsmap", "");
  1205. File tmpFile = new File(fileName);
  1206. tmpFile.getName();
  1207. int whereDot = tmpFile.getName().lastIndexOf('.');
  1208. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
  1209. return tmpFile.getName().substring(0, whereDot);
  1210. }
  1211. return "";
  1212. }
  1213.  
  1214. public void preloadModels() {
  1215. File file = new File(signlink.findcachedir() + "Raw/");
  1216. File[] fileArray = file.listFiles();
  1217. for (int y = 0; y < fileArray.length; y++) {
  1218. String s = fileArray[y].getName();
  1219. byte[] buffer = ReadFile(signlink.findcachedir() + "Raw/" + s);
  1220. Model.method460(buffer, Integer
  1221. .parseInt(getFileNameWithoutExtension(s)));
  1222. }
  1223. }
  1224.  
  1225. public String indexLocation(int cacheIndex, int index) {
  1226. return signlink.findcachedir() + "index" + cacheIndex + "/" + (index != -1 ? index + ".gz" : "");
  1227. }
  1228.  
  1229. public void repackCacheIndex(int cacheIndex) {
  1230. System.out.println("Started repacking index " + cacheIndex + ".");
  1231. int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
  1232. File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
  1233. try {
  1234. for (int index = 0; index < indexLength; index++) {
  1235. int fileIndex = Integer.parseInt(getFileNameWithoutExtension(file[index].toString()));
  1236. byte[] data = fileToByteArray(cacheIndex, fileIndex);
  1237. if(data != null && data.length > 0) {
  1238. decompressors[cacheIndex].method234(data.length, data, fileIndex);
  1239. System.out.println("Repacked " + fileIndex + ".");
  1240. } else {
  1241. System.out.println("Unable to locate index " + fileIndex + ".");
  1242. }
  1243. }
  1244. } catch(Exception e) {
  1245. System.out.println("Error packing cache index " + cacheIndex + ".");
  1246. e.printStackTrace();
  1247. }
  1248. System.out.println("Finished repacking " + cacheIndex + ".");
  1249. }
  1250.  
  1251. public byte[] fileToByteArray(int cacheIndex, int index) {
  1252. try {
  1253. if (indexLocation(cacheIndex, index).length() <= 0 || indexLocation(cacheIndex, index) == null) {
  1254. return null;
  1255. }
  1256. File file = new File(indexLocation(cacheIndex, index));
  1257. byte[] fileData = new byte[(int)file.length()];
  1258. FileInputStream fis = new FileInputStream(file);
  1259. fis.read(fileData);
  1260. fis.close();
  1261. return fileData;
  1262. } catch(Exception e) {
  1263. return null;
  1264. }
  1265. }
  1266.  
  1267. public void preloadMaps() {
  1268. /*
  1269. * File file = new File(signlink.findcachedir() + "maps/"); File[]
  1270. * fileArray = file.listFiles(); for(int y = 0; y < fileArray.length;
  1271. * y++) { String s = fileArray[y].getName(); byte[] buffer = null;
  1272. *
  1273. * buffer = ReadFile(signlink.findcachedir() + "maps/"+s);
  1274. * decompressors[4].method234(buffer.length, buffer,
  1275. * Integer.parseInt(getFileNameWithoutExtension(s)));
  1276. * //Model.method460(buffer
  1277. * ,Integer.parseInt(getFileNameWithoutExtension(s))); }
  1278. */
  1279. preloadMaps2();
  1280. }
  1281.  
  1282. public void preloadMaps2() {
  1283. /*
  1284. * File file = new File(signlink.findcachedir() + "maps2/"); File[]
  1285. * fileArray = file.listFiles(); for(int y = 0; y < fileArray.length;
  1286. * y++) { String s = fileArray[y].getName(); byte[] buffer = null;
  1287. * buffer = gzipCompress(ReadFile(signlink.findcachedir() +
  1288. * "maps2/"+s)); decompressors[4].method234(buffer.length, buffer,
  1289. * Integer.parseInt(getFileNameWithoutExtension(s)));
  1290. * //Model.method460(buffer
  1291. * ,Integer.parseInt(getFileNameWithoutExtension(s))); }
  1292. */
  1293. }
  1294.  
  1295. public byte[] gzipCompress(byte[] data) {
  1296. ByteArrayOutputStream bys = new ByteArrayOutputStream();
  1297. try {
  1298. GZIPOutputStream gis = new GZIPOutputStream(bys);
  1299. gis.write(data);
  1300. gis.close();
  1301. } catch (IOException e) {
  1302. throw new RuntimeException(e);
  1303. }
  1304. return bys.toByteArray();
  1305. }
  1306.  
  1307. private void saveMidi(boolean flag, byte abyte0[]) {
  1308. signlink.midifade = flag ? 1 : 0;
  1309. signlink.midisave(abyte0, abyte0.length);
  1310. }
  1311.  
  1312. private void method22() {
  1313. try {
  1314. anInt985 = -1;
  1315. aClass19_1056.removeAll();
  1316. aClass19_1013.removeAll();
  1317. Texture.method366();
  1318. unlinkMRUNodes();
  1319. worldController.initToNull();
  1320. System.gc();
  1321. for (int i = 0; i < 4; i++)
  1322. aClass11Array1230[i].method210();
  1323.  
  1324. for (int l = 0; l < 4; l++) {
  1325. for (int k1 = 0; k1 < 104; k1++) {
  1326. for (int j2 = 0; j2 < 104; j2++)
  1327. byteGroundArray[l][k1][j2] = 0;
  1328.  
  1329. }
  1330.  
  1331. }
  1332.  
  1333. ObjectManager objectManager = new ObjectManager(byteGroundArray,
  1334. intGroundArray);
  1335. int k2 = aByteArrayArray1183.length;
  1336. stream.createFrame(0);
  1337. if (!aBoolean1159) {
  1338. for (int i3 = 0; i3 < k2; i3++) {
  1339. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  1340. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  1341. byte abyte0[] = aByteArrayArray1183[i3];
  1342. if (FileOperations.FileExists(signlink.findcachedir()
  1343. + "maps/" + anIntArray1235[i3] + ".dat"))
  1344. abyte0 = FileOperations.ReadFile(signlink
  1345. .findcachedir()
  1346. + "maps/" + anIntArray1235[i3] + ".dat");
  1347. if (abyte0 != null)
  1348. objectManager.method180(abyte0, k5, i4,
  1349. (anInt1069 - 6) * 8, (anInt1070 - 6) * 8,
  1350. aClass11Array1230);
  1351. }
  1352.  
  1353. for (int j4 = 0; j4 < k2; j4++) {
  1354. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  1355. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  1356. byte abyte2[] = aByteArrayArray1183[j4];
  1357. if (abyte2 == null && anInt1070 < 800)
  1358. objectManager.method174(k7, 64, 64, l5);
  1359. }
  1360.  
  1361. anInt1097++;
  1362. if (anInt1097 > 160) {
  1363. anInt1097 = 0;
  1364. stream.createFrame(238);
  1365. stream.writeWordBigEndian(96);
  1366. }
  1367. stream.createFrame(0);
  1368. for (int i6 = 0; i6 < k2; i6++) {
  1369. byte abyte1[] = aByteArrayArray1247[i6];
  1370. if (abyte1 != null) {
  1371. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  1372. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  1373. objectManager.method190(l8, aClass11Array1230, k9,
  1374. worldController, abyte1);
  1375. }
  1376. }
  1377.  
  1378. }
  1379. if (aBoolean1159) {
  1380. for (int j3 = 0; j3 < 4; j3++) {
  1381. for (int k4 = 0; k4 < 13; k4++) {
  1382. for (int j6 = 0; j6 < 13; j6++) {
  1383. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  1384. if (l7 != -1) {
  1385. int i9 = l7 >> 24 & 3;
  1386. int l9 = l7 >> 1 & 3;
  1387. int j10 = l7 >> 14 & 0x3ff;
  1388. int l10 = l7 >> 3 & 0x7ff;
  1389. int j11 = (j10 / 8 << 8) + l10 / 8;
  1390. for (int l11 = 0; l11 < anIntArray1234.length; l11++) {
  1391. if (anIntArray1234[l11] != j11
  1392. || aByteArrayArray1183[l11] == null)
  1393. continue;
  1394. objectManager.method179(i9, l9,
  1395. aClass11Array1230, k4 * 8,
  1396. (j10 & 7) * 8,
  1397. aByteArrayArray1183[l11],
  1398. (l10 & 7) * 8, j3, j6 * 8);
  1399. break;
  1400. }
  1401.  
  1402. }
  1403. }
  1404.  
  1405. }
  1406.  
  1407. }
  1408.  
  1409. for (int l4 = 0; l4 < 13; l4++) {
  1410. for (int k6 = 0; k6 < 13; k6++) {
  1411. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  1412. if (i8 == -1)
  1413. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  1414. }
  1415.  
  1416. }
  1417.  
  1418. stream.createFrame(0);
  1419. for (int l6 = 0; l6 < 4; l6++) {
  1420. for (int j8 = 0; j8 < 13; j8++) {
  1421. for (int j9 = 0; j9 < 13; j9++) {
  1422. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  1423. if (i10 != -1) {
  1424. int k10 = i10 >> 24 & 3;
  1425. int i11 = i10 >> 1 & 3;
  1426. int k11 = i10 >> 14 & 0x3ff;
  1427. int i12 = i10 >> 3 & 0x7ff;
  1428. int j12 = (k11 / 8 << 8) + i12 / 8;
  1429. for (int k12 = 0; k12 < anIntArray1234.length; k12++) {
  1430. if (anIntArray1234[k12] != j12
  1431. || aByteArrayArray1247[k12] == null)
  1432. continue;
  1433. // objectManager.method183(aClass11Array1230,
  1434. // worldController, k10, j8 * 8, (i12 & 7) *
  1435. // 8, l6, aByteArrayArray1247[k12], (k11 &
  1436. // 7) * 8, i11, j9 * 8);
  1437. byte abyte0[] = aByteArrayArray1247[k12];
  1438. if (FileOperations.FileExists(signlink
  1439. .findcachedir()
  1440. + "maps/"
  1441. + anIntArray1235[k12]
  1442. + ".dat"))
  1443. abyte0 = FileOperations
  1444. .ReadFile(signlink
  1445. .findcachedir()
  1446. + "maps/"
  1447. + anIntArray1235[k12]
  1448. + ".dat");
  1449. objectManager.method183(aClass11Array1230,
  1450. worldController, k10, j8 * 8,
  1451. (i12 & 7) * 8, l6,
  1452. aByteArrayArray1247[k12],
  1453. (k11 & 7) * 8, i11, j9 * 8);
  1454. break;
  1455. }
  1456.  
  1457. }
  1458. }
  1459.  
  1460. }
  1461.  
  1462. }
  1463.  
  1464. }
  1465. stream.createFrame(0);
  1466. objectManager.method171(aClass11Array1230, worldController);
  1467. aRSImageProducer_1165.initDrawingArea();
  1468. stream.createFrame(0);
  1469. int k3 = ObjectManager.anInt145;
  1470. if (k3 > plane)
  1471. k3 = plane;
  1472. if (k3 < plane - 1)
  1473. k3 = plane - 1;
  1474. if (lowMem)
  1475. worldController.method275(ObjectManager.anInt145);
  1476. else
  1477. worldController.method275(0);
  1478. for (int i5 = 0; i5 < 104; i5++) {
  1479. for (int i7 = 0; i7 < 104; i7++)
  1480. spawnGroundItem(i5, i7);
  1481.  
  1482. }
  1483.  
  1484. anInt1051++;
  1485. if (anInt1051 > 98) {
  1486. anInt1051 = 0;
  1487. stream.createFrame(150);
  1488. }
  1489. method63();
  1490. } catch (Exception exception) {
  1491. exception.printStackTrace();
  1492. }
  1493. ObjectDef.mruNodes1.unlinkAll();
  1494. if (super.gameFrame != null) {
  1495. stream.createFrame(210);
  1496. stream.writeDWord(0x3f008edd);
  1497. }
  1498. System.gc();
  1499. Texture.method367();
  1500. onDemandFetcher.method566();
  1501. int k = (anInt1069 - 6) / 8 - 1;
  1502. int j1 = (anInt1069 + 6) / 8 + 1;
  1503. int i2 = (anInt1070 - 6) / 8 - 1;
  1504. int l2 = (anInt1070 + 6) / 8 + 1;
  1505. if (aBoolean1141) {
  1506. k = 49;
  1507. j1 = 50;
  1508. i2 = 49;
  1509. l2 = 50;
  1510. }
  1511. for (int l3 = k; l3 <= j1; l3++) {
  1512. for (int j5 = i2; j5 <= l2; j5++)
  1513. if (l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  1514. int j7 = onDemandFetcher.method562(0, j5, l3);
  1515. if (j7 != -1)
  1516. onDemandFetcher.method560(j7, 3);
  1517. int k8 = onDemandFetcher.method562(1, j5, l3);
  1518. if (k8 != -1)
  1519. onDemandFetcher.method560(k8, 3);
  1520. }
  1521.  
  1522. }
  1523.  
  1524. }
  1525.  
  1526. private void unlinkMRUNodes() {
  1527. ObjectDef.mruNodes1.unlinkAll();
  1528. ObjectDef.mruNodes2.unlinkAll();
  1529. EntityDef.mruNodes.unlinkAll();
  1530. ItemDef.mruNodes2.unlinkAll();
  1531. ItemDef.mruNodes1.unlinkAll();
  1532. Player.mruNodes.unlinkAll();
  1533. SpotAnim.aMRUNodes_415.unlinkAll();
  1534. }
  1535.  
  1536. private void method24(int i) {
  1537. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  1538. int j = ai.length;
  1539. for (int k = 0; k < j; k++)
  1540. ai[k] = 0;
  1541.  
  1542. for (int l = 1; l < 103; l++) {
  1543. int i1 = 24628 + (103 - l) * 512 * 4;
  1544. for (int k1 = 1; k1 < 103; k1++) {
  1545. if ((byteGroundArray[i][k1][l] & 0x18) == 0)
  1546. worldController.method309(ai, i1, i, k1, l);
  1547. if (i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1548. worldController.method309(ai, i1, i + 1, k1, l);
  1549. i1 += 4;
  1550. }
  1551.  
  1552. }
  1553.  
  1554. int j1 = ((238 + (int) (Math.random() * 20D)) - 10 << 16)
  1555. + ((238 + (int) (Math.random() * 20D)) - 10 << 8)
  1556. + ((238 + (int) (Math.random() * 20D)) - 10);
  1557. int l1 = (238 + (int) (Math.random() * 20D)) - 10 << 16;
  1558. aClass30_Sub2_Sub1_Sub1_1263.method343();
  1559. for (int i2 = 1; i2 < 103; i2++) {
  1560. for (int j2 = 1; j2 < 103; j2++) {
  1561. if ((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1562. method50(i2, j1, j2, l1, i);
  1563. if (i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1564. method50(i2, j1, j2, l1, i + 1);
  1565. }
  1566.  
  1567. }
  1568.  
  1569. aRSImageProducer_1165.initDrawingArea();
  1570. anInt1071 = 0;
  1571. for (int k2 = 0; k2 < 104; k2++) {
  1572. for (int l2 = 0; l2 < 104; l2++) {
  1573. int i3 = worldController.method303(plane, k2, l2);
  1574. if (i3 != 0) {
  1575. i3 = i3 >> 14 & 0x7fff;
  1576. int j3 = ObjectDef.forID(i3).anInt746;
  1577. if (j3 >= 0) {
  1578. int k3 = k2;
  1579. int l3 = l2;
  1580. if (j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36
  1581. && j3 != 46 && j3 != 47 && j3 != 48) {
  1582. byte byte0 = 104;
  1583. byte byte1 = 104;
  1584. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  1585. for (int i4 = 0; i4 < 10; i4++) {
  1586. int j4 = (int) (Math.random() * 4D);
  1587. if (j4 == 0 && k3 > 0 && k3 > k2 - 3
  1588. && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1589. k3--;
  1590. if (j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3
  1591. && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1592. k3++;
  1593. if (j4 == 2 && l3 > 0 && l3 > l2 - 3
  1594. && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1595. l3--;
  1596. if (j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3
  1597. && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1598. l3++;
  1599. }
  1600.  
  1601. }
  1602. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  1603. anIntArray1072[anInt1071] = k3;
  1604. anIntArray1073[anInt1071] = l3;
  1605. anInt1071++;
  1606. }
  1607. }
  1608. }
  1609.  
  1610. }
  1611.  
  1612. }
  1613.  
  1614. private void spawnGroundItem(int i, int j) {
  1615. NodeList class19 = groundArray[plane][i][j];
  1616. if (class19 == null) {
  1617. worldController.method295(plane, i, j);
  1618. return;
  1619. }
  1620. int k = 0xfa0a1f01;
  1621. Object obj = null;
  1622. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  1623. .reverseGetNext()) {
  1624. ItemDef itemDef = ItemDef.forID(item.ID);
  1625. int l = itemDef.value;
  1626. if (itemDef.stackable)
  1627. l *= item.anInt1559 + 1;
  1628. // notifyItemSpawn(item, i + baseX, j + baseY);
  1629.  
  1630. if (l > k) {
  1631. k = l;
  1632. obj = item;
  1633. }
  1634. }
  1635.  
  1636. class19.insertTail(((Node) (obj)));
  1637. Object obj1 = null;
  1638. Object obj2 = null;
  1639. for (Item class30_sub2_sub4_sub2_1 = (Item) class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item) class19
  1640. .reverseGetNext()) {
  1641. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1642. && obj1 == null)
  1643. obj1 = class30_sub2_sub4_sub2_1;
  1644. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1645. && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID
  1646. && obj2 == null)
  1647. obj2 = class30_sub2_sub4_sub2_1;
  1648. }
  1649.  
  1650. int i1 = i + (j << 7) + 0x60000000;
  1651. worldController.method281(i, i1, ((Animable) (obj1)), method42(plane,
  1652. j * 128 + 64, i * 128 + 64), ((Animable) (obj2)),
  1653. ((Animable) (obj)), plane, j);
  1654. }
  1655.  
  1656. private void method26(boolean flag) {
  1657. for (int j = 0; j < npcCount; j++) {
  1658. NPC npc = npcArray[npcIndices[j]];
  1659. int k = 0x20000000 + (npcIndices[j] << 14);
  1660. if (npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1661. continue;
  1662. int l = npc.x >> 7;
  1663. int i1 = npc.y >> 7;
  1664. if (l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1665. continue;
  1666. if (npc.anInt1540 == 1 && (npc.x & 0x7f) == 64
  1667. && (npc.y & 0x7f) == 64) {
  1668. if (anIntArrayArray929[l][i1] == anInt1265)
  1669. continue;
  1670. anIntArrayArray929[l][i1] = anInt1265;
  1671. }
  1672. if (!npc.desc.aBoolean84)
  1673. k += 0x80000000;
  1674. worldController.method285(plane, npc.anInt1552, method42(plane,
  1675. npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60,
  1676. npc.x, npc, npc.aBoolean1541);
  1677. }
  1678. }
  1679.  
  1680. private boolean replayWave() {
  1681. return signlink.wavereplay();
  1682. }
  1683.  
  1684. private void loadError() {
  1685. String s = "ondemand";// was a constant parameter
  1686. System.out.println(s);
  1687. try {
  1688. getAppletContext().showDocument(
  1689. new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1690. } catch (Exception exception) {
  1691. exception.printStackTrace();
  1692. }
  1693. do
  1694. try {
  1695. Thread.sleep(1000L);
  1696. } catch (Exception _ex) {
  1697. }
  1698. while (true);
  1699. }
  1700.  
  1701. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l,
  1702. int i1, int j1) {
  1703. if (class9.type != 0 || class9.children == null
  1704. || class9.isMouseoverTriggered)
  1705. return;
  1706. if (k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1707. return;
  1708. int k1 = class9.children.length;
  1709. for (int l1 = 0; l1 < k1; l1++) {
  1710. int i2 = class9.childX[l1] + i;
  1711. int j2 = (class9.childY[l1] + l) - j1;
  1712. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1713. i2 += class9_1.anInt263;
  1714. j2 += class9_1.anInt265;
  1715. if ((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0)
  1716. && k >= i2 && i1 >= j2 && k < i2 + class9_1.width
  1717. && i1 < j2 + class9_1.height)
  1718. if (class9_1.mOverInterToTrigger >= 0)
  1719. anInt886 = class9_1.mOverInterToTrigger;
  1720. else
  1721. anInt886 = class9_1.id;
  1722. if (class9_1.type == 8 && k >= i2 && i1 >= j2
  1723. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1724. anInt1315 = class9_1.id;
  1725. }
  1726. if (class9_1.type == 0) {
  1727. buildInterfaceMenu(i2, class9_1, k, j2, i1,
  1728. class9_1.scrollPosition);
  1729. if (class9_1.scrollMax > class9_1.height)
  1730. method65(i2 + class9_1.width, class9_1.height, k, i1,
  1731. class9_1, j2, true, class9_1.scrollMax);
  1732. } else {
  1733. if (class9_1.atActionType == 1 && k >= i2 && i1 >= j2
  1734. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1735. boolean flag = false;
  1736. if (class9_1.contentType != 0)
  1737. flag = buildFriendsListMenu(class9_1);
  1738. if (!flag) {
  1739. // System.out.println("1"+class9_1.tooltip + ", " +
  1740. // class9_1.interfaceID);
  1741. menuActionName[menuActionRow] = class9_1.tooltip;// +
  1742. // ", "
  1743. // +
  1744. // class9_1.id;
  1745. menuActionID[menuActionRow] = 315;
  1746. menuActionCmd3[menuActionRow] = class9_1.id;
  1747. menuActionRow++;
  1748. }
  1749. }
  1750. if (class9_1.atActionType == 2 && spellSelected == 0 && k >= i2
  1751. && i1 >= j2 && k < i2 + class9_1.width
  1752. && i1 < j2 + class9_1.height) {
  1753. String s = class9_1.selectedActionName;
  1754. if (s.indexOf(" ") != -1)
  1755. s = s.substring(0, s.indexOf(" "));
  1756. if (class9_1.spellName.endsWith("Rush")
  1757. || class9_1.spellName.endsWith("Burst")
  1758. || class9_1.spellName.endsWith("Blitz")
  1759. || class9_1.spellName.endsWith("Barrage")
  1760. || class9_1.spellName.endsWith("strike")
  1761. || class9_1.spellName.endsWith("bolt")
  1762. || class9_1.spellName.equals("Crumble undead")
  1763. || class9_1.spellName.endsWith("blast")
  1764. || class9_1.spellName.endsWith("wave")
  1765. || class9_1.spellName.equals("Claws of Guthix")
  1766. || class9_1.spellName.equals("Flames of Zamorak")
  1767. || class9_1.spellName.equals("Magic Dart")) {
  1768. menuActionName[menuActionRow] = "Autocast @gre@"
  1769. + class9_1.spellName;
  1770. menuActionID[menuActionRow] = 104;
  1771. menuActionCmd3[menuActionRow] = class9_1.id;
  1772. menuActionRow++;
  1773. }
  1774. menuActionName[menuActionRow] = s + " @gre@"
  1775. + class9_1.spellName;
  1776. menuActionID[menuActionRow] = 626;
  1777. menuActionCmd3[menuActionRow] = class9_1.id;
  1778. menuActionRow++;
  1779. }
  1780. if (class9_1.atActionType == 3 && k >= i2 && i1 >= j2
  1781. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1782. menuActionName[menuActionRow] = "Close";
  1783. menuActionID[menuActionRow] = 200;
  1784. menuActionCmd3[menuActionRow] = class9_1.id;
  1785. menuActionRow++;
  1786. }
  1787. if (class9_1.atActionType == 4 && k >= i2 && i1 >= j2
  1788. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1789. // System.out.println("2"+class9_1.tooltip + ", " +
  1790. // class9_1.interfaceID);
  1791. menuActionName[menuActionRow] = class9_1.tooltip;// + ", " +
  1792. // class9_1.id;
  1793. menuActionID[menuActionRow] = 169;
  1794. menuActionCmd3[menuActionRow] = class9_1.id;
  1795. menuActionRow++;
  1796. if (class9_1.hoverText != null) {
  1797. // drawHoverBox(k, l, class9_1.hoverText);
  1798. // System.out.println("DRAWING INTERFACE: " +
  1799. // class9_1.hoverText);
  1800. }
  1801. }
  1802. if (class9_1.atActionType == 5 && k >= i2 && i1 >= j2
  1803. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1804. // System.out.println("3"+class9_1.tooltip + ", " +
  1805. // class9_1.interfaceID);
  1806. menuActionName[menuActionRow] = class9_1.tooltip;
  1807. menuActionID[menuActionRow] = 646;
  1808. menuActionCmd3[menuActionRow] = class9_1.id;
  1809. menuActionRow++;
  1810. }
  1811. if (class9_1.atActionType == 6 && !aBoolean1149 && k >= i2
  1812. && i1 >= j2 && k < i2 + class9_1.width
  1813. && i1 < j2 + class9_1.height) {
  1814. // System.out.println("4"+class9_1.tooltip + ", " +
  1815. // class9_1.interfaceID);
  1816. menuActionName[menuActionRow] = class9_1.tooltip;
  1817. menuActionID[menuActionRow] = 679;
  1818. menuActionCmd3[menuActionRow] = class9_1.id;
  1819. menuActionRow++;
  1820. }
  1821. //clanchat//this
  1822. if (k >= i2 && i1 >= j2
  1823. && k < i2 + (class9_1.type == 4 ? 100 : class9_1.width)
  1824. && i1 < j2 + class9_1.height) {
  1825. if (class9_1.actions != null) {
  1826. if ((class9_1.type == 4 && class9_1.message.length() > 0)
  1827. || class9_1.type == 5) {
  1828. for (int action = class9_1.actions.length - 1; action >= 0; action--) {
  1829. if (class9_1.actions[action] != null) {
  1830. menuActionName[menuActionRow] = class9_1.actions[action]
  1831. + (class9_1.type == 4 ? " "
  1832. + class9_1.message : "");
  1833. menuActionID[menuActionRow] = 647;
  1834. menuActionCmd2[menuActionRow] = action;
  1835. menuActionCmd3[menuActionRow] = class9_1.id;
  1836. menuActionRow++;
  1837. }
  1838. }
  1839. }
  1840. }
  1841. }
  1842. if (class9_1.type == 2) {
  1843. int k2 = 0;
  1844. for (int l2 = 0; l2 < class9_1.height; l2++) {
  1845. for (int i3 = 0; i3 < class9_1.width; i3++) {
  1846. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1847. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1848. if (k2 < 20) {
  1849. j3 += class9_1.spritesX[k2];
  1850. k3 += class9_1.spritesY[k2];
  1851. }
  1852. if (k >= j3 && i1 >= k3 && k < j3 + 32
  1853. && i1 < k3 + 32) {
  1854. mouseInvInterfaceIndex = k2;
  1855. lastActiveInvInterface = class9_1.id;
  1856. if (class9_1.inv[k2] > 0) {
  1857. ItemDef itemDef = ItemDef
  1858. .forID(class9_1.inv[k2] - 1);
  1859. if (itemSelected == 1
  1860. && class9_1.isInventoryInterface) {
  1861. if (class9_1.id != anInt1284
  1862. || k2 != anInt1283) {
  1863. menuActionName[menuActionRow] = "Use "
  1864. + selectedItemName
  1865. + " with @lre@"
  1866. + itemDef.name;
  1867. menuActionID[menuActionRow] = 870;
  1868. menuActionCmd1[menuActionRow] = itemDef.id;
  1869. menuActionCmd2[menuActionRow] = k2;
  1870. menuActionCmd3[menuActionRow] = class9_1.id;
  1871. menuActionRow++;
  1872. }
  1873. } else if (spellSelected == 1
  1874. && class9_1.isInventoryInterface) {
  1875. if ((spellUsableOn & 0x10) == 16) {
  1876. menuActionName[menuActionRow] = spellTooltip
  1877. + " @lre@" + itemDef.name;
  1878. menuActionID[menuActionRow] = 543;
  1879. menuActionCmd1[menuActionRow] = itemDef.id;
  1880. menuActionCmd2[menuActionRow] = k2;
  1881. menuActionCmd3[menuActionRow] = class9_1.id;
  1882. menuActionRow++;
  1883. }
  1884. } else {
  1885. if (class9_1.isInventoryInterface) {
  1886. for (int l3 = 4; l3 >= 3; l3--)
  1887. if (itemDef.actions != null
  1888. && itemDef.actions[l3] != null) {
  1889. menuActionName[menuActionRow] = itemDef.actions[l3]
  1890. + " @lre@"
  1891. + itemDef.name;
  1892. if (l3 == 3)
  1893. menuActionID[menuActionRow] = 493;
  1894. if (l3 == 4)
  1895. menuActionID[menuActionRow] = 847;
  1896. menuActionCmd1[menuActionRow] = itemDef.id;
  1897. menuActionCmd2[menuActionRow] = k2;
  1898. menuActionCmd3[menuActionRow] = class9_1.id;
  1899. menuActionRow++;
  1900. } else if (l3 == 4) {
  1901. menuActionName[menuActionRow] = "Drop @lre@"
  1902. + itemDef.name;
  1903. menuActionID[menuActionRow] = 847;
  1904. menuActionCmd1[menuActionRow] = itemDef.id;
  1905. menuActionCmd2[menuActionRow] = k2;
  1906. menuActionCmd3[menuActionRow] = class9_1.id;
  1907. menuActionRow++;
  1908. }
  1909.  
  1910. }
  1911. if (class9_1.usableItemInterface) {
  1912. menuActionName[menuActionRow] = "Use @lre@"
  1913. + itemDef.name;
  1914. menuActionID[menuActionRow] = 447;
  1915. menuActionCmd1[menuActionRow] = itemDef.id;
  1916. // k2 = inventory spot
  1917. // System.out.println(k2);
  1918. menuActionCmd2[menuActionRow] = k2;
  1919. menuActionCmd3[menuActionRow] = class9_1.id;
  1920. menuActionRow++;
  1921. }
  1922. if (class9_1.isInventoryInterface
  1923. && itemDef.actions != null) {
  1924. for (int i4 = 2; i4 >= 0; i4--)
  1925. if (itemDef.actions[i4] != null) {
  1926. menuActionName[menuActionRow] = itemDef.actions[i4]
  1927. + " @lre@"
  1928. + itemDef.name;
  1929. if (i4 == 0)
  1930. menuActionID[menuActionRow] = 74;
  1931. if (i4 == 1)
  1932. menuActionID[menuActionRow] = 454;
  1933. if (i4 == 2)
  1934. menuActionID[menuActionRow] = 539;
  1935. menuActionCmd1[menuActionRow] = itemDef.id;
  1936. menuActionCmd2[menuActionRow] = k2;
  1937. menuActionCmd3[menuActionRow] = class9_1.id;
  1938. menuActionRow++;
  1939. }
  1940.  
  1941. }
  1942. if (class9_1.actions != null) {
  1943. for (int j4 = 4; j4 >= 0; j4--)
  1944. if (class9_1.actions[j4] != null) {
  1945. menuActionName[menuActionRow] = class9_1.actions[j4]
  1946. + " @lre@"
  1947. + itemDef.name;
  1948. if (j4 == 0)
  1949. menuActionID[menuActionRow] = 632;
  1950. if (j4 == 1)
  1951. menuActionID[menuActionRow] = 78;
  1952. if (j4 == 2)
  1953. menuActionID[menuActionRow] = 867;
  1954. if (j4 == 3)
  1955. menuActionID[menuActionRow] = 431;
  1956. if (j4 == 4)
  1957. menuActionID[menuActionRow] = 53;
  1958. menuActionCmd1[menuActionRow] = itemDef.id;
  1959. menuActionCmd2[menuActionRow] = k2;
  1960. menuActionCmd3[menuActionRow] = class9_1.id;
  1961. menuActionRow++;
  1962. }
  1963.  
  1964. }
  1965. // menuActionName[menuActionRow] =
  1966. // "Examine @lre@" + itemDef.name +
  1967. // " @gre@(@whi@" + (class9_1.inv[k2] -
  1968. // 1) + "@gre@)";
  1969. menuActionName[menuActionRow] = "Examine @lre@"
  1970. + itemDef.name;
  1971. menuActionID[menuActionRow] = 1125;
  1972. menuActionCmd1[menuActionRow] = itemDef.id;
  1973. menuActionCmd2[menuActionRow] = k2;
  1974. menuActionCmd3[menuActionRow] = class9_1.id;
  1975. menuActionRow++;
  1976. }
  1977. }
  1978. }
  1979. k2++;
  1980. }
  1981.  
  1982. }
  1983.  
  1984. }
  1985. }
  1986. }
  1987.  
  1988. }
  1989.  
  1990. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1991. scrollBar1.drawSprite(i1, l);
  1992. scrollBar2.drawSprite(i1, (l + j) - 16);
  1993. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1994. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1995. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1996. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1997. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1998. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1999. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  2000. int k1 = ((j - 32) * j) / j1;
  2001. if (k1 < 8)
  2002. k1 = 8;
  2003. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  2004. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  2005. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  2006. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  2007. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  2008. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  2009. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  2010. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  2011. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  2012. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  2013. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  2014. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  2015. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  2016. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  2017. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  2018. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  2019. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  2020. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  2021. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  2022. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  2023. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  2024. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  2025. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  2026. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  2027. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  2028. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  2029. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  2030. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  2031. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  2032. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  2033. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  2034. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  2035. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  2036. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  2037. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  2038. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  2039. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  2040. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  2041. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  2042. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  2043. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  2044. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  2045. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  2046. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  2047. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  2048. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  2049. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  2050. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  2051. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  2052. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  2053. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  2054. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  2055. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  2056. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  2057. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  2058. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  2059. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  2060. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  2061. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  2062. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  2063. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  2064. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  2065. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  2066. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  2067. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  2068. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  2069. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  2070. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  2071. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  2072. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  2073. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  2074. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  2075. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  2076. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  2077. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  2078. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  2079. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  2080. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  2081. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  2082. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  2083. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  2084. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  2085. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  2086. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  2087. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  2088. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  2089. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  2090. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  2091. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  2092. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  2093. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  2094. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  2095. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  2096. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  2097. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  2098. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  2099. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  2100. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  2101. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  2102. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  2103. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  2104. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  2105. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  2106. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  2107. }
  2108.  
  2109. private void updateNPCs(Stream stream, int i) {
  2110. anInt839 = 0;
  2111. anInt893 = 0;
  2112. method139(stream);
  2113. method46(i, stream);
  2114. method86(stream);
  2115. for (int k = 0; k < anInt839; k++) {
  2116. int l = anIntArray840[k];
  2117. if (npcArray[l].anInt1537 != loopCycle) {
  2118. npcArray[l].desc = null;
  2119. npcArray[l] = null;
  2120. }
  2121. }
  2122.  
  2123. if (stream.currentOffset != i) {
  2124. signlink.reporterror(myUsername
  2125. + " size mismatch in getnpcpos - pos:"
  2126. + stream.currentOffset + " psize:" + i);
  2127. throw new RuntimeException("eek");
  2128. }
  2129. for (int i1 = 0; i1 < npcCount; i1++)
  2130. if (npcArray[npcIndices[i1]] == null) {
  2131. signlink.reporterror(myUsername
  2132. + " null entry in npc list - pos:" + i1 + " size:"
  2133. + npcCount);
  2134. throw new RuntimeException("eek");
  2135. }
  2136.  
  2137. }
  2138.  
  2139. private int cButtonHPos;
  2140. private int cButtonHCPos;
  2141. private int cButtonCPos;
  2142.  
  2143. private void processChatModeClick() {
  2144. int x = isFullScreen ? extraWidth : 0;
  2145. int y = isFullScreen ? extraHeight : 0;
  2146. if (displayChat) {
  2147. if (super.mouseX >= 5 && super.mouseX <= 61
  2148. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  2149. cButtonHPos = 0;
  2150. aBoolean1233 = true;
  2151. inputTaken = true;
  2152. } else if (super.mouseX >= 71 && super.mouseX <= 127
  2153. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  2154. cButtonHPos = 1;
  2155. aBoolean1233 = true;
  2156. inputTaken = true;
  2157. } else if (super.mouseX >= 137 && super.mouseX <= 193
  2158. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  2159. cButtonHPos = 2;
  2160. aBoolean1233 = true;
  2161. inputTaken = true;
  2162. } else if (super.mouseX >= 203 && super.mouseX <= 259
  2163. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  2164. cButtonHPos = 3;
  2165. aBoolean1233 = true;
  2166. inputTaken = true;
  2167. } else if (super.mouseX >= 269 && super.mouseX <= 325
  2168. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  2169. cButtonHPos = 4;
  2170. aBoolean1233 = true;
  2171. inputTaken = true;
  2172. } else if (super.mouseX >= 335 && super.mouseX <= 391
  2173. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  2174. cButtonHPos = 5;
  2175. aBoolean1233 = true;
  2176. inputTaken = true;
  2177. } else if (super.mouseX >= 404 && super.mouseX <= 515
  2178. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  2179. cButtonHPos = 6;
  2180. aBoolean1233 = true;
  2181. inputTaken = true;
  2182. } else {
  2183. cButtonHPos = -1;
  2184. aBoolean1233 = true;
  2185. inputTaken = true;
  2186. }
  2187. if (super.clickMode3 == 1) {
  2188. if (super.saveClickX >= 5 && super.saveClickX <= 61
  2189. && super.saveClickY >= 482 + y
  2190. && super.saveClickY <= 505 + y) {
  2191. cButtonCPos = 0;
  2192. chatTypeView = 0;
  2193. aBoolean1233 = true;
  2194. inputTaken = true;
  2195. } else if (super.saveClickX >= 71 && super.saveClickX <= 127
  2196. && super.saveClickY >= 482 + y
  2197. && super.saveClickY <= 505 + y) {
  2198. cButtonCPos = 1;
  2199. chatTypeView = 5;
  2200. aBoolean1233 = true;
  2201. inputTaken = true;
  2202. } else if (super.saveClickX >= 137 && super.saveClickX <= 193
  2203. && super.saveClickY >= 482 + y
  2204. && super.saveClickY <= 505 + y) {
  2205. cButtonCPos = 2;
  2206. chatTypeView = 1;
  2207. aBoolean1233 = true;
  2208. inputTaken = true;
  2209. } else if (super.saveClickX >= 203 && super.saveClickX <= 259
  2210. && super.saveClickY >= 482 + y
  2211. && super.saveClickY <= 505 + y) {
  2212. cButtonCPos = 3;
  2213. chatTypeView = 2;
  2214. aBoolean1233 = true;
  2215. inputTaken = true;
  2216. } else if (super.saveClickX >= 269 && super.saveClickX <= 325
  2217. && super.saveClickY >= 482 + y
  2218. && super.saveClickY <= 505 + y) {
  2219. cButtonCPos = 4;
  2220. chatTypeView = 11;
  2221. aBoolean1233 = true;
  2222. inputTaken = true;
  2223. } else if (super.saveClickX >= 335 && super.saveClickX <= 391
  2224. && super.saveClickY >= 482 + y
  2225. && super.saveClickY <= 505 + y) {
  2226. cButtonCPos = 5;
  2227. chatTypeView = 3;
  2228. aBoolean1233 = true;
  2229. inputTaken = true;
  2230. } else if (super.saveClickX >= 404 && super.saveClickX <= 515
  2231. && super.saveClickY >= 482 + y
  2232. && super.saveClickY <= 505 + y) {
  2233. if (openInterfaceID == -1) {
  2234. clearTopInterfaces();
  2235. reportAbuseInput = "";
  2236. canMute = false;
  2237. for (int i = 0; i < RSInterface.interfaceCache.length; i++) {
  2238. if (RSInterface.interfaceCache[i] == null
  2239. || RSInterface.interfaceCache[i].contentType != 600)
  2240. continue;
  2241. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  2242. break;
  2243. }
  2244. } else {
  2245. pushMessage(
  2246. "Please close the interface you have open before using 'report abuse'",
  2247. 0, "");
  2248. }
  2249. }
  2250. }
  2251. }
  2252. }
  2253.  
  2254. private void method33(int i) {
  2255. int j = Varp.cache[i].anInt709;
  2256. if (j == 0)
  2257. return;
  2258. int k = variousSettings[i];
  2259. if (j == 1) {
  2260. if (k == 1)
  2261. Texture.method372(0.90000000000000002D);
  2262. if (k == 2)
  2263. Texture.method372(0.80000000000000004D);
  2264. if (k == 3)
  2265. Texture.method372(0.69999999999999996D);
  2266. if (k == 4)
  2267. Texture.method372(0.59999999999999998D);
  2268. ItemDef.mruNodes1.unlinkAll();
  2269. welcomeScreenRaised = true;
  2270. }
  2271. if (j == 3) {
  2272. boolean flag1 = musicEnabled;
  2273. if (k == 0) {
  2274. adjustVolume(musicEnabled, 0);
  2275. musicEnabled = true;
  2276. }
  2277. if (k == 1) {
  2278. adjustVolume(musicEnabled, -400);
  2279. musicEnabled = true;
  2280. }
  2281. if (k == 2) {
  2282. adjustVolume(musicEnabled, -800);
  2283. musicEnabled = true;
  2284. }
  2285. if (k == 3) {
  2286. adjustVolume(musicEnabled, -1200);
  2287. musicEnabled = true;
  2288. }
  2289. if (k == 4)
  2290. musicEnabled = false;
  2291. if (musicEnabled != flag1 && !lowMem) {
  2292. if (musicEnabled) {
  2293. nextSong = currentSong;
  2294. songChanging = true;
  2295. onDemandFetcher.method558(2, nextSong);
  2296. } else {
  2297. stopMidi();
  2298. }
  2299. prevSong = 0;
  2300. }
  2301. }
  2302. if (j == 4) {
  2303. if (k == 0) {
  2304. aBoolean848 = true;
  2305. setWaveVolume(0);
  2306. }
  2307. if (k == 1) {
  2308. aBoolean848 = true;
  2309. setWaveVolume(-400);
  2310. }
  2311. if (k == 2) {
  2312. aBoolean848 = true;
  2313. setWaveVolume(-800);
  2314. }
  2315. if (k == 3) {
  2316. aBoolean848 = true;
  2317. setWaveVolume(-1200);
  2318. }
  2319. if (k == 4)
  2320. aBoolean848 = false;
  2321. }
  2322. if (j == 5)
  2323. anInt1253 = k;
  2324. if (j == 6)
  2325. anInt1249 = k;
  2326. if (j == 8) {
  2327. splitPrivateChat = k;
  2328. inputTaken = true;
  2329. }
  2330. if (j == 9)
  2331. anInt913 = k;
  2332. }
  2333.  
  2334. private void updateEntities() {
  2335. try{
  2336. int anInt974 = 0;
  2337. for(int j = -1; j < playerCount + npcCount; j++) {
  2338. Object obj;
  2339. if(j == -1)
  2340. obj = myPlayer;
  2341. else
  2342. if(j < playerCount)
  2343. obj = playerArray[playerIndices[j]];
  2344. else
  2345. obj = npcArray[npcIndices[j - playerCount]];
  2346. if(obj == null || !((Entity) (obj)).isVisible())
  2347. continue;
  2348. if(obj instanceof NPC) {
  2349. EntityDef entityDef = ((NPC)obj).desc;
  2350. if(entityDef.childrenIDs != null)
  2351. entityDef = entityDef.method161();
  2352. if(entityDef == null)
  2353. continue;
  2354. }
  2355. if(j < playerCount) {
  2356. int l = 30;
  2357. Player player = (Player)obj;
  2358. if(player.headIcon >= 0) {
  2359. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2360. if(spriteDrawX > -1) {
  2361. if (player.skullIcon < 2) {
  2362. skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2363. l += 25;
  2364. }
  2365. if (player.headIcon < 18) {
  2366. headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2367. l += 18;
  2368. }
  2369. }
  2370. }
  2371. if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  2372. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2373. if(spriteDrawX > -1)
  2374. headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  2375. }
  2376. } else {
  2377. EntityDef entityDef_1 = ((NPC)obj).desc;
  2378. if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  2379. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2380. if(spriteDrawX > -1)
  2381. headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  2382. }
  2383. if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  2384. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2385. if(spriteDrawX > -1)
  2386. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  2387. }
  2388. }
  2389. if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  2390. {
  2391. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  2392. if(spriteDrawX > -1 && anInt974 < anInt975)
  2393. {
  2394. anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
  2395. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  2396. anIntArray976[anInt974] = spriteDrawX;
  2397. anIntArray977[anInt974] = spriteDrawY;
  2398. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  2399. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  2400. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  2401. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  2402. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  2403. {
  2404. anIntArray978[anInt974] += 10;
  2405. anIntArray977[anInt974] += 5;
  2406. }
  2407. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  2408. anIntArray979[anInt974] = 60;
  2409. if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  2410. anIntArray978[anInt974] += 5;
  2411. }
  2412. }
  2413. if(((Entity) (obj)).loopCycleStatus > loopCycle)
  2414. {
  2415. try{
  2416. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  2417. if(spriteDrawX > -1)
  2418. {
  2419. int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  2420. if(i1 > 30)
  2421. i1 = 30;
  2422. DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  2423. DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  2424. }
  2425. }catch(Exception e){ }
  2426. }
  2427. for(int j1 = 0; j1 < 4; j1++)
  2428. if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  2429. {
  2430. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  2431. if(spriteDrawX > -1)
  2432. {
  2433. if(j1 == 1)
  2434. spriteDrawY -= 20;
  2435. if(j1 == 2)
  2436. {
  2437. spriteDrawX -= 15;
  2438. spriteDrawY -= 10;
  2439. }
  2440. if(j1 == 3)
  2441. {
  2442. spriteDrawX += 15;
  2443. spriteDrawY -= 10;
  2444. }
  2445. hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  2446. smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  2447. smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  2448. }
  2449. }
  2450. }
  2451. for(int k = 0; k < anInt974; k++) {
  2452. int k1 = anIntArray976[k];
  2453. int l1 = anIntArray977[k];
  2454. int j2 = anIntArray979[k];
  2455. int k2 = anIntArray978[k];
  2456. boolean flag = true;
  2457. while(flag)
  2458. {
  2459. flag = false;
  2460. for(int l2 = 0; l2 < k; l2++)
  2461. 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)
  2462. {
  2463. l1 = anIntArray977[l2] - anIntArray978[l2];
  2464. flag = true;
  2465. }
  2466.  
  2467. }
  2468. spriteDrawX = anIntArray976[k];
  2469. spriteDrawY = anIntArray977[k] = l1;
  2470. String s = aStringArray983[k];
  2471. if(anInt1249 == 0)
  2472. {
  2473. int i3 = 0xffff00;
  2474. if(anIntArray980[k] < 6)
  2475. i3 = anIntArray965[anIntArray980[k]];
  2476. if(anIntArray980[k] == 6)
  2477. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  2478. if(anIntArray980[k] == 7)
  2479. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  2480. if(anIntArray980[k] == 8)
  2481. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  2482. if(anIntArray980[k] == 9) {
  2483. int j3 = 150 - anIntArray982[k];
  2484. if(j3 < 50)
  2485. i3 = 0xff0000 + 1280 * j3;
  2486. else
  2487. if(j3 < 100)
  2488. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  2489. else
  2490. if(j3 < 150)
  2491. i3 = 65280 + 5 * (j3 - 100);
  2492. }
  2493. if(anIntArray980[k] == 10) {
  2494. int k3 = 150 - anIntArray982[k];
  2495. if(k3 < 50)
  2496. i3 = 0xff0000 + 5 * k3;
  2497. else
  2498. if(k3 < 100)
  2499. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  2500. else
  2501. if(k3 < 150)
  2502. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  2503. }
  2504. if(anIntArray980[k] == 11) {
  2505. int l3 = 150 - anIntArray982[k];
  2506. if(l3 < 50)
  2507. i3 = 0xffffff - 0x50005 * l3;
  2508. else
  2509. if(l3 < 100)
  2510. i3 = 65280 + 0x50005 * (l3 - 50);
  2511. else
  2512. if(l3 < 150)
  2513. i3 = 0xffffff - 0x50000 * (l3 - 100);
  2514. }
  2515. if(anIntArray981[k] == 0) {
  2516. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2517. chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  2518. }
  2519. if(anIntArray981[k] == 1) {
  2520. chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  2521. chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  2522. }
  2523. if(anIntArray981[k] == 2) {
  2524. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  2525. chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  2526. }
  2527. if(anIntArray981[k] == 3) {
  2528. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  2529. chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  2530. }
  2531. if(anIntArray981[k] == 4) {
  2532. int i4 = chatTextDrawingArea.method384(s);
  2533. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  2534. DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  2535. chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  2536. chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  2537. DrawingArea.defaultDrawingAreaSize();
  2538. }
  2539. if(anIntArray981[k] == 5) {
  2540. int j4 = 150 - anIntArray982[k];
  2541. int l4 = 0;
  2542. if(j4 < 25)
  2543. l4 = j4 - 25;
  2544. else
  2545. if(j4 > 125)
  2546. l4 = j4 - 125;
  2547. DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  2548. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  2549. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  2550. DrawingArea.defaultDrawingAreaSize();
  2551. }
  2552. } else {
  2553. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  2554. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  2555. }
  2556. }
  2557. } catch(Exception e){ }
  2558. }
  2559.  
  2560. public int headIconOffset, yOffsetForText;
  2561.  
  2562. public void manageOffsetsForToggle() {
  2563. if (headhp && headname) {
  2564. headIconOffset = 14 + 15;
  2565. yOffsetForText = 16;
  2566. } else if (headhp && !headname) {
  2567. headIconOffset = 14;
  2568. } else if (!headhp && headname) {
  2569. headIconOffset = 15;
  2570. yOffsetForText = 8;
  2571. } else {
  2572. headIconOffset = 0;
  2573. yOffsetForText = 0;
  2574. }
  2575. }
  2576.  
  2577. private void delFriend(long l) {
  2578. try {
  2579. if (l == 0L)
  2580. return;
  2581. for (int i = 0; i < friendsCount; i++) {
  2582. if (friendsListAsLongs[i] != l)
  2583. continue;
  2584. friendsCount--;
  2585. needDrawTabArea = true;
  2586. for (int j = i; j < friendsCount; j++) {
  2587. friendsList[j] = friendsList[j + 1];
  2588. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2589. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2590. }
  2591.  
  2592. stream.createFrame(215);
  2593. stream.writeQWord(l);
  2594. break;
  2595. }
  2596. } catch (RuntimeException runtimeexception) {
  2597. signlink.reporterror("18622, " + false + ", " + l + ", "
  2598. + runtimeexception.toString());
  2599. throw new RuntimeException();
  2600. }
  2601. }
  2602.  
  2603. public void drawSideIcons() {
  2604. int extraXX = drawLongTabs ? -241 : 0;
  2605. int extraYY = drawLongTabs ? +35 : 0;
  2606.  
  2607. int mhm = drawLongTabs ? +4 : 0;
  2608. int mhm2 = drawLongTabs ? -4 : 0;
  2609.  
  2610. int extraXX1 = drawLongTabs ? -233 : 0;
  2611.  
  2612. int extraX = isFullScreen ? extraWidth + 519 : 0;
  2613. int extraY = isFullScreen ? extraHeight + 168 + 262 : 0;
  2614.  
  2615. int extraX2 = !drawLongTabs ? extraWidth - 8 : 0;
  2616. int extraY2 = !drawLongTabs ? extraHeight - 5 : 0;
  2617. /* Top sideIcons */
  2618. if (tabInterfaceIDs[0] != -1)// attack
  2619. sideIcons[0].drawSprite(10 + extraX + extraXX1, 4 + extraY
  2620. + extraYY);
  2621. if (tabInterfaceIDs[1] != -1)// stat
  2622. sideIcons[1].drawSprite(43 + extraX + extraXX1, 4 + extraY
  2623. + extraYY);
  2624. if (tabInterfaceIDs[2] != -1)// quest
  2625. sideIcons[2].drawSprite(76 + extraX + extraXX1, 3 + extraY
  2626. + extraYY);
  2627. if (tabInterfaceIDs[3] != -1)// inventory
  2628. sideIcons[3].drawSprite(111 + extraX + extraXX1, 5 + extraY
  2629. + extraYY);
  2630. if (tabInterfaceIDs[4] != -1)// equipment
  2631. sideIcons[4].drawSprite(140 + extraX + extraXX1, 1 + extraY
  2632. + extraYY);
  2633. if (tabInterfaceIDs[5] != -1)// prayer
  2634. sideIcons[5].drawSprite(174 + extraX + extraXX1, 1 + extraY
  2635. + extraYY);
  2636. if (tabInterfaceIDs[6] != -1)// magic
  2637. sideIcons[6].drawSprite(208 + extraX + extraXX1, 4 + extraY
  2638. + extraYY);
  2639. if (isFullScreen)
  2640. extraY -= 262;
  2641. /* Bottom sideIcons */
  2642. if (tabInterfaceIDs[7] != -1)// clan
  2643. sideIcons[7].drawSprite(11 + extraX, 303 + extraY);
  2644. if (tabInterfaceIDs[8] != -1)// friends
  2645. sideIcons[8].drawSprite(46 + extraX, 306 + extraY);
  2646. if (tabInterfaceIDs[9] != -1)// ignore
  2647. sideIcons[9].drawSprite(79 + extraX, 306 + extraY);
  2648. if (tabInterfaceIDs[10] != -1)// options
  2649. sideIcons[10].drawSprite(113 + extraX, 302 + extraY);
  2650. if (tabInterfaceIDs[11] != -1)// options
  2651. sideIcons[11].drawSprite(145 + extraX, 304 + extraY);
  2652. if (tabInterfaceIDs[12] != -1)// emotes
  2653. sideIcons[12].drawSprite(181 + extraX, 302 + extraY);
  2654. if (tabInterfaceIDs[13] != -1)// music
  2655. sideIcons[13].drawSprite(213 + extraX, 303 + extraY);
  2656. }
  2657.  
  2658. public void drawRedStones() {
  2659. int extraX = isFullScreen ? extraWidth + 519 : 0;
  2660. int extraX2 = isFullScreen ? +4 : 0;
  2661. int extraX22 = isFullScreen ? -3 : 0;
  2662. int extraY = isFullScreen ? extraHeight + 168 + 262 : 0;
  2663. int extraY2 = isFullScreen ? extraHeight + 168 : 0;
  2664.  
  2665. int extraXX = drawLongTabs ? -232 : 0;
  2666. int extraYY = drawLongTabs ? +35 : 0;
  2667.  
  2668. int mhm = drawLongTabs ? +4 : 0;
  2669. int mhm2 = drawLongTabs ? -6 : 0;
  2670.  
  2671. int mhm4 = drawLongTabs ? +1 : 0;
  2672.  
  2673. int extraXX22 = drawLongTabs ? -241 : 0;
  2674. int extraYY22 = drawLongTabs ? +37 : 0;
  2675. if (isFullScreen && tabInterfaceIDs[tabID] != -1)
  2676. switch (tabID) {
  2677. case 0:
  2678. if (!drawLongTabs) {
  2679. redStones[0].drawSprite(3 + extraX + extraXX, 0
  2680. + extraY + extraYY);
  2681. } else {
  2682. redStones[4].drawSprite(3 + extraX + extraXX + extraX2,
  2683. 0 + extraY + extraYY);
  2684. }
  2685. break;
  2686. case 1:
  2687. redStones[4].drawSprite(41 + extraX + extraXX, 0 + extraY
  2688. + extraYY);
  2689. break;
  2690. case 2:
  2691. redStones[4].drawSprite(74 + extraX + extraXX, 0 + extraY
  2692. + extraYY);
  2693. break;
  2694. case 3:
  2695. redStones[4].drawSprite(107 + extraX + extraXX, 0 + extraY
  2696. + extraYY);
  2697. break;
  2698. case 4:
  2699. redStones[4].drawSprite(140 + extraX + extraXX, 0 + extraY
  2700. + extraYY);
  2701. break;
  2702. case 5:
  2703. redStones[4].drawSprite(173 + extraX + extraXX, 0 + extraY
  2704. + extraYY);
  2705. break;
  2706. case 6:
  2707. if (!drawLongTabs) {
  2708. redStones[1].drawSprite(206 + extraX + extraXX, 0
  2709. + extraY + extraYY);
  2710. } else {
  2711. redStones[4].drawSprite(206 + extraX + extraXX, 0
  2712. + extraY + extraYY);
  2713. }
  2714. break;
  2715. case 7:
  2716. if (!drawLongTabs) {
  2717. redStones[2].drawSprite(3 + extraX, 298 + extraY - 262);
  2718. } else {
  2719. redStones[4].drawSprite(3 + extraX + extraX2,
  2720. 298 + extraY - 262);
  2721. }
  2722. break;
  2723. case 8:
  2724. redStones[4].drawSprite(41 + extraX, 298 + extraY - 262);
  2725. break;
  2726. case 9:
  2727. redStones[4].drawSprite(74 + extraX, 298 + extraY - 262);
  2728. break;
  2729. case 10:
  2730. redStones[4].drawSprite(107 + extraX, 298 + extraY - 262);
  2731. break;
  2732. case 11:
  2733. redStones[4].drawSprite(140 + extraX, 298 + extraY - 262);
  2734. break;
  2735. case 12:
  2736. redStones[4].drawSprite(173 + extraX, 298 + extraY - 262);
  2737. break;
  2738. case 13:
  2739. if (!drawLongTabs) {
  2740. redStones[3].drawSprite(206 + extraX,
  2741. 298 + extraY - 262);
  2742. } else {
  2743. redStones[4].drawSprite(206 + extraX + extraX22,
  2744. 298 + extraY - 262);
  2745. }
  2746. break;
  2747. }
  2748. else if (isFullScreen == false && tabInterfaceIDs[tabID] != -1)
  2749. switch (tabID) {
  2750. case 0:
  2751. redStones[0].drawSprite(3, 0);
  2752. break;
  2753. case 1:
  2754. redStones[4].drawSprite(41, 0);
  2755. break;
  2756. case 2:
  2757. redStones[4].drawSprite(74, 0);
  2758. break;
  2759. case 3:
  2760. redStones[4].drawSprite(107, 0);
  2761. break;
  2762. case 4:
  2763. redStones[4].drawSprite(140, 0);
  2764. break;
  2765. case 5:
  2766. redStones[4].drawSprite(173, 0);
  2767. break;
  2768. case 6:
  2769. redStones[1].drawSprite(206, 0);
  2770. break;
  2771. case 7:
  2772. redStones[2].drawSprite(3, 298);
  2773. break;
  2774. case 8:
  2775. redStones[4].drawSprite(41, 298);
  2776. break;
  2777. case 9:
  2778. redStones[4].drawSprite(74, 298);
  2779. break;
  2780. case 10:
  2781. redStones[4].drawSprite(107, 298);
  2782. break;
  2783. case 11:
  2784. redStones[4].drawSprite(140, 298);
  2785. break;
  2786. case 12:
  2787. redStones[4].drawSprite(173, 298);
  2788. break;
  2789. case 13:
  2790. redStones[3].drawSprite(206, 298);
  2791. break;
  2792. }
  2793. }
  2794.  
  2795. private void drawTabArea() {
  2796. int x = isFullScreen ? extraWidth + 519 : 0;
  2797. int y = isFullScreen ? extraHeight + 168 : 0;
  2798. if (!isFullScreen)
  2799. aRSImageProducer_1163.initDrawingArea();
  2800. Texture.anIntArray1472 = anIntArray1181;
  2801. if (!isFullScreen) {
  2802. tabArea.drawSprite(0 + x, 0 + y);
  2803. }
  2804. if (isFullScreen && drawLongTabs) {
  2805. fullScreenSprites[1].drawSprite(-247 + x, 299 + y);
  2806. }
  2807. if (isFullScreen && !drawLongTabs) {
  2808. fullScreenSprites[2].drawSprite(-3 + x, 262 + y);
  2809. }
  2810. if (invOverlayInterfaceID == -1) {
  2811. drawRedStones();
  2812. drawSideIcons();
  2813. }
  2814. if (isFullScreen)
  2815. drawTabBack();
  2816. else {
  2817. if (invOverlayInterfaceID != -1)
  2818. drawInterface(0, 28 + x,
  2819. RSInterface.interfaceCache[invOverlayInterfaceID],
  2820. 37 + y);
  2821. else if (tabInterfaceIDs[tabID] != -1)
  2822. drawInterface(0, 28 + x,
  2823. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  2824. 37 + y);
  2825. }
  2826. if (menuOpen && menuScreenArea == 1)
  2827. drawMenu();
  2828. if (!isFullScreen)
  2829. aRSImageProducer_1163.drawGraphics(168 + extraHeight,
  2830. isFullScreen ? bufferGraphics : super.graphics,
  2831. 519 + extraWidth);
  2832. aRSImageProducer_1165.initDrawingArea();
  2833. Texture.anIntArray1472 = anIntArray1182;
  2834. }
  2835.  
  2836. public void drawTabBack() {
  2837. if (!drawLongTabs)
  2838. fullScreenSprites[0].drawSprite2(554 + extraWidth,
  2839. 156 + extraHeight);
  2840. if (invOverlayInterfaceID != -1 && !drawLongTabs)
  2841. drawInterface(0, 519 + 41 + extraWidth,
  2842. RSInterface.interfaceCache[invOverlayInterfaceID],
  2843. 168 + extraHeight - 3);
  2844. else if (tabInterfaceIDs[tabID] != -1 && !drawLongTabs)
  2845. drawInterface(0, 519 + 41 + extraWidth,
  2846. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  2847. 168 + extraHeight - 3);
  2848.  
  2849. if (drawLongTabs)
  2850. fullScreenSprites[0].drawSprite2(554 + extraWidth,
  2851. 193 + extraHeight);// 25
  2852. if (invOverlayInterfaceID != -1 && drawLongTabs)
  2853. drawInterface(0, 519 + 41 + extraWidth,
  2854. RSInterface.interfaceCache[invOverlayInterfaceID],
  2855. 168 + 35 + extraHeight - 3);
  2856. else if (tabInterfaceIDs[tabID] != -1 && drawLongTabs)
  2857. drawInterface(0, 519 + 41 + extraWidth,
  2858. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  2859. 168 + 35 + extraHeight - 3);
  2860. }
  2861.  
  2862. private void method37(int j) {
  2863. if (!lowMem) {
  2864. if (Texture.anIntArray1480[17] >= j) {
  2865. Background background = Texture.aBackgroundArray1474s[17];
  2866. int k = background.anInt1452 * background.anInt1453 - 1;
  2867. // fire cape apparently?
  2868. int j1 = background.anInt1452 * anInt945 * 2;
  2869. byte abyte0[] = background.aByteArray1450;
  2870. byte abyte3[] = aByteArray912;
  2871. for (int i2 = 0; i2 <= k; i2++)
  2872. abyte3[i2] = abyte0[i2 - j1 & k];
  2873.  
  2874. background.aByteArray1450 = abyte3;
  2875. aByteArray912 = abyte0;
  2876. Texture.method370(17);
  2877. anInt854++;
  2878. if (anInt854 > 1235) {
  2879. anInt854 = 0;
  2880. stream.createFrame(226);
  2881. stream.writeWordBigEndian(0);
  2882. int l2 = stream.currentOffset;
  2883. stream.writeWord(58722);
  2884. stream.writeWordBigEndian(240);
  2885. stream.writeWord((int) (Math.random() * 65536D));
  2886. stream.writeWordBigEndian((int) (Math.random() * 256D));
  2887. if ((int) (Math.random() * 2D) == 0)
  2888. stream.writeWord(51825);
  2889. stream.writeWordBigEndian((int) (Math.random() * 256D));
  2890. stream.writeWord((int) (Math.random() * 65536D));
  2891. stream.writeWord(7130);
  2892. stream.writeWord((int) (Math.random() * 65536D));
  2893. stream.writeWord(61657);
  2894. stream.writeBytes(stream.currentOffset - l2);
  2895. }
  2896. }
  2897. if (Texture.anIntArray1480[24] >= j) {
  2898. Background background_1 = Texture.aBackgroundArray1474s[24];
  2899. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  2900. int k1 = background_1.anInt1452 * anInt945 * 2;
  2901. byte abyte1[] = background_1.aByteArray1450;
  2902. byte abyte4[] = aByteArray912;
  2903. for (int j2 = 0; j2 <= l; j2++)
  2904. abyte4[j2] = abyte1[j2 - k1 & l];
  2905.  
  2906. background_1.aByteArray1450 = abyte4;
  2907. aByteArray912 = abyte1;
  2908. Texture.method370(24);
  2909. }
  2910. if (Texture.anIntArray1480[34] >= j) {
  2911. Background background_2 = Texture.aBackgroundArray1474s[34];
  2912. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2913. int l1 = background_2.anInt1452 * anInt945 * 2;
  2914. byte abyte2[] = background_2.aByteArray1450;
  2915. byte abyte5[] = aByteArray912;
  2916. for (int k2 = 0; k2 <= i1; k2++)
  2917. abyte5[k2] = abyte2[k2 - l1 & i1];
  2918.  
  2919. background_2.aByteArray1450 = abyte5;
  2920. aByteArray912 = abyte2;
  2921. Texture.method370(34);
  2922. }
  2923. if (Texture.anIntArray1480[40] >= j) {
  2924. Background background_2 = Texture.aBackgroundArray1474s[40];
  2925. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  2926. int l1 = background_2.anInt1452 * anInt945 * 2;
  2927. byte abyte2[] = background_2.aByteArray1450;
  2928. byte abyte5[] = aByteArray912;
  2929. for (int k2 = 0; k2 <= i1; k2++)
  2930. abyte5[k2] = abyte2[k2 - l1 & i1];
  2931.  
  2932. background_2.aByteArray1450 = abyte5;
  2933. aByteArray912 = abyte2;
  2934. Texture.method370(40);
  2935. }
  2936. }
  2937. }
  2938.  
  2939. private void method38() {
  2940. for (int i = -1; i < playerCount; i++) {
  2941. int j;
  2942. if (i == -1)
  2943. j = myPlayerIndex;
  2944. else
  2945. j = playerIndices[i];
  2946. Player player = playerArray[j];
  2947. if (player != null && player.textCycle > 0) {
  2948. player.textCycle--;
  2949. if (player.textCycle == 0)
  2950. player.textSpoken = null;
  2951. }
  2952. }
  2953. for (int k = 0; k < npcCount; k++) {
  2954. int l = npcIndices[k];
  2955. NPC npc = npcArray[l];
  2956. if (npc != null && npc.textCycle > 0) {
  2957. npc.textCycle--;
  2958. if (npc.textCycle == 0)
  2959. npc.textSpoken = null;
  2960. }
  2961. }
  2962. }
  2963.  
  2964. private void calcCameraPos() {
  2965. int i = anInt1098 * 128 + 64;
  2966. int j = anInt1099 * 128 + 64;
  2967. int k = method42(plane, j, i) - anInt1100;
  2968. if (xCameraPos < i) {
  2969. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2970. if (xCameraPos > i)
  2971. xCameraPos = i;
  2972. }
  2973. if (xCameraPos > i) {
  2974. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2975. if (xCameraPos < i)
  2976. xCameraPos = i;
  2977. }
  2978. if (zCameraPos < k) {
  2979. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2980. if (zCameraPos > k)
  2981. zCameraPos = k;
  2982. }
  2983. if (zCameraPos > k) {
  2984. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2985. if (zCameraPos < k)
  2986. zCameraPos = k;
  2987. }
  2988. if (yCameraPos < j) {
  2989. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2990. if (yCameraPos > j)
  2991. yCameraPos = j;
  2992. }
  2993. if (yCameraPos > j) {
  2994. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2995. if (yCameraPos < j)
  2996. yCameraPos = j;
  2997. }
  2998. i = anInt995 * 128 + 64;
  2999. j = anInt996 * 128 + 64;
  3000. k = method42(plane, j, i) - anInt997;
  3001. int l = i - xCameraPos;
  3002. int i1 = k - zCameraPos;
  3003. int j1 = j - yCameraPos;
  3004. int k1 = (int) Math.sqrt(l * l + j1 * j1);
  3005. int l1 = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  3006. int i2 = (int) (Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  3007. if (l1 < 128)
  3008. l1 = 128;
  3009. if (l1 > 383)
  3010. l1 = 383;
  3011. if (yCameraCurve < l1) {
  3012. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  3013. if (yCameraCurve > l1)
  3014. yCameraCurve = l1;
  3015. }
  3016. if (yCameraCurve > l1) {
  3017. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  3018. if (yCameraCurve < l1)
  3019. yCameraCurve = l1;
  3020. }
  3021. int j2 = i2 - xCameraCurve;
  3022. if (j2 > 1024)
  3023. j2 -= 2048;
  3024. if (j2 < -1024)
  3025. j2 += 2048;
  3026. if (j2 > 0) {
  3027. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  3028. xCameraCurve &= 0x7ff;
  3029. }
  3030. if (j2 < 0) {
  3031. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  3032. xCameraCurve &= 0x7ff;
  3033. }
  3034. int k2 = i2 - xCameraCurve;
  3035. if (k2 > 1024)
  3036. k2 -= 2048;
  3037. if (k2 < -1024)
  3038. k2 += 2048;
  3039. if (k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  3040. xCameraCurve = i2;
  3041. }
  3042.  
  3043. private void drawMenu() {
  3044. int i = menuOffsetX;
  3045. int j = menuOffsetY;
  3046. int k = menuWidth;
  3047. int j1 = super.mouseX;
  3048. int k1 = super.mouseY;
  3049. int l = menuHeight + 1;
  3050. int i1 = 0x5d5447;
  3051. if (menuScreenArea == 1 && isFullScreen) {
  3052. i += 519;// +extraWidth;
  3053. j += 168;// +extraHeight;
  3054. }
  3055. if (menuScreenArea == 2 && isFullScreen) {
  3056. j += 338;
  3057. }
  3058. if (menuScreenArea == 3 && isFullScreen) {
  3059. i += 515;
  3060. j += 0;
  3061. }
  3062. if (menuScreenArea == 0) {
  3063. j1 -= 4;
  3064. k1 -= 4;
  3065. }
  3066. if (menuScreenArea == 1) {
  3067. if (!isFullScreen) {
  3068. j1 -= 519;
  3069. k1 -= 168;
  3070. }
  3071. }
  3072. if (menuScreenArea == 2) {
  3073. if (!isFullScreen) {
  3074. j1 -= 17;
  3075. k1 -= 338;
  3076. }
  3077. }
  3078. if (menuScreenArea == 3 && !isFullScreen) {
  3079. j1 -= 515;
  3080. k1 -= 0;
  3081. }
  3082. if (menuToggle == false) {
  3083. //DrawingArea.method336(l, j, i, i1, k);
  3084. DrawingArea.method335(i1, j, k, l, 150, i);
  3085. //DrawingArea.method336(16, j + 1, i + 1, 0, k - 2);
  3086. DrawingArea.method335(0, j + 1, k - 2, 16, 150, i + 1);
  3087. //DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
  3088. DrawingArea.method338(j + 18, l - 19, 150, 0, k - 2, i + 1);
  3089. chatTextDrawingArea.method385(i1, "Choose Option", j + 14, i + 3);
  3090. for (int l1 = 0; l1 < menuActionRow; l1++) {
  3091. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  3092. int j2 = 0xffffff;
  3093. if (j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  3094. j2 = 0xffff00;
  3095. newBoldFont.drawBasicString(menuActionName[l1], i + 3, i2, j2, 0);
  3096. }
  3097. } else if (menuToggle == true) {
  3098. // DrawingArea.drawPixels(height, yPos, xPos, color, width);
  3099. // DrawingArea.fillPixels(xPos, width, height, color, yPos);
  3100. DrawingArea.drawPixels(l - 4, j + 2, i, 0x706a5e, k);
  3101. DrawingArea.drawPixels(l - 2, j + 1, i + 1, 0x706a5e, k - 2);
  3102. DrawingArea.drawPixels(l, j, i + 2, 0x706a5e, k - 4);
  3103. DrawingArea.drawPixels(l - 2, j + 1, i + 3, 0x2d2822, k - 6);
  3104. DrawingArea.drawPixels(l - 4, j + 2, i + 2, 0x2d2822, k - 4);
  3105. DrawingArea.drawPixels(l - 6, j + 3, i + 1, 0x2d2822, k - 2);
  3106. DrawingArea.drawPixels(l - 22, j + 19, i + 2, 0x524a3d, k - 4);
  3107. DrawingArea.drawPixels(l - 22, j + 20, i + 3, 0x524a3d, k - 6);
  3108. DrawingArea.drawPixels(l - 23, j + 20, i + 3, 0x2b271c, k - 6);
  3109. DrawingArea.fillPixels(i + 3, k - 6, 1, 0x2a291b, j + 2);
  3110. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x2a261b, j + 3);
  3111. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x252116, j + 4);
  3112. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x211e15, j + 5);
  3113. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x1e1b12, j + 6);
  3114. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x1a170e, j + 7);
  3115. DrawingArea.fillPixels(i + 2, k - 4, 2, 0x15120b, j + 8);
  3116. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x100d08, j + 10);
  3117. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 11);
  3118. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x080703, j + 12);
  3119. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 13);
  3120. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x070802, j + 14);
  3121. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 15);
  3122. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x070802, j + 16);
  3123. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 17);
  3124. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x2a291b, j + 18);
  3125. DrawingArea.fillPixels(i + 3, k - 6, 1, 0x564943, j + 19);
  3126. chatTextDrawingArea.method385(0xc6b895, "Choose Option", j + 14,
  3127. i + 3);
  3128. int x = isFullScreen ? extraWidth : 0;
  3129. int y = isFullScreen ? extraHeight : 0;
  3130. for (int l1 = 0; l1 < menuActionRow; l1++) {
  3131. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  3132. int j2 = 0xc6b895;
  3133. if (j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3) {
  3134. DrawingArea.drawPixels(15, i2 - 11, i + 3, 0x6f695d,
  3135. menuWidth - 6);
  3136. j2 = 0xeee5c6;
  3137. }
  3138. chatTextDrawingArea.method389(true, i + 4, j2,
  3139. menuActionName[l1], i2 + 1);
  3140. }
  3141. }
  3142. }
  3143.  
  3144. private void addFriend(long l) {
  3145. try {
  3146. if (l == 0L)
  3147. return;
  3148. if (friendsCount >= 100 && anInt1046 != 1) {
  3149. pushMessage(
  3150. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  3151. 0, "");
  3152. return;
  3153. }
  3154. if (friendsCount >= 200) {
  3155. pushMessage(
  3156. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  3157. 0, "");
  3158. return;
  3159. }
  3160. String s = TextClass.fixName(TextClass.nameForLong(l));
  3161. for (int i = 0; i < friendsCount; i++)
  3162. if (friendsListAsLongs[i] == l) {
  3163. pushMessage(s + " is already on your friend list", 0, "");
  3164. return;
  3165. }
  3166. for (int j = 0; j < ignoreCount; j++)
  3167. if (ignoreListAsLongs[j] == l) {
  3168. pushMessage("Please remove " + s
  3169. + " from your ignore list first", 0, "");
  3170. return;
  3171. }
  3172.  
  3173. if (s.equals(myPlayer.name)) {
  3174. return;
  3175. } else {
  3176. friendsList[friendsCount] = s;
  3177. friendsListAsLongs[friendsCount] = l;
  3178. friendsNodeIDs[friendsCount] = 0;
  3179. friendsCount++;
  3180. needDrawTabArea = true;
  3181. stream.createFrame(188);
  3182. stream.writeQWord(l);
  3183. return;
  3184. }
  3185. } catch (RuntimeException runtimeexception) {
  3186. signlink.reporterror("15283, " + (byte) 68 + ", " + l + ", "
  3187. + runtimeexception.toString());
  3188. }
  3189. throw new RuntimeException();
  3190. }
  3191.  
  3192. private int method42(int i, int j, int k) {
  3193. int l = k >> 7;
  3194. int i1 = j >> 7;
  3195. if (l < 0 || i1 < 0 || l > 103 || i1 > 103)
  3196. return 0;
  3197. int j1 = i;
  3198. if (j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  3199. j1++;
  3200. int k1 = k & 0x7f;
  3201. int l1 = j & 0x7f;
  3202. int i2 = intGroundArray[j1][l][i1] * (128 - k1)
  3203. + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  3204. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1)
  3205. + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  3206. return i2 * (128 - l1) + j2 * l1 >> 7;
  3207. }
  3208.  
  3209. private static String intToKOrMil(int j) {
  3210. if (j == 0)
  3211. return "@inf@";
  3212. if (j < 0x186a0)
  3213. return String.valueOf(j);
  3214. if (j < 0x989680)
  3215. return j / 1000 + "K";
  3216. else
  3217. return j / 0xf4240 + "M";
  3218. }
  3219.  
  3220. public JFrame frame;
  3221.  
  3222. public void resetLogout() {
  3223. followPlayer = 0;
  3224. followNPC = 0;
  3225. followDistance = 1;
  3226. try {
  3227. if (socketStream != null)
  3228. socketStream.close();
  3229. } catch (Exception _ex) {
  3230. }
  3231. alertHandler.alert = null;
  3232. socketStream = null;
  3233. loggedIn = false;
  3234. loginScreenState = 2;
  3235. loginMessage1 = "";
  3236. loginMessage2 = "";
  3237. unlinkMRUNodes();
  3238. // resize(765, 503);
  3239. for (int i = 0; i < 4; i++)
  3240. aClass11Array1230[i].method210();
  3241. System.gc();
  3242. stopMidi();
  3243. currentSong = -1;
  3244. nextSong = -1;
  3245. prevSong = 0;
  3246. try {
  3247. client.writeSettings();
  3248. } catch (IOException e) {
  3249. e.printStackTrace();
  3250. }
  3251. }
  3252. public int canWalkDelay = 0;
  3253. public int getDis(int coordX1, int coordY1, int coordX2, int coordY2)
  3254. {
  3255. int deltaX = coordX2 - coordX1;
  3256. int deltaY = coordY2 - coordY1;
  3257. return ((int)Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2)));
  3258. }
  3259. public int random(int range)
  3260. {
  3261. return (int)(Math.random() * range);
  3262. }
  3263. public boolean withinDistance(int x1, int y1, int x2, int y2, int dis)
  3264. {
  3265. for (int i = 0; i <= dis; i++)
  3266. {
  3267. try{
  3268. if ((x1 + i) == x2 && ((y1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  3269. return true;
  3270. else
  3271. if ((x1 - i) == x2 && ((x1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  3272. return true;
  3273. else
  3274. if (x1 == x2 && ((x1 + i) == y2 || (y1 - i) == y2 || y1 == y2))
  3275. return true;
  3276. } catch(Exception ex){
  3277. System.out.println("Exception in following, method : WithingDistance");
  3278. }
  3279. }
  3280. return false;
  3281. }
  3282.  
  3283. private void method45() {
  3284. aBoolean1031 = true;
  3285. for (int j = 0; j < 7; j++) {
  3286. anIntArray1065[j] = -1;
  3287. for (int k = 0; k < IdentityKit.length; k++) {
  3288. if (IdentityKit.cache[k].aBoolean662
  3289. || IdentityKit.cache[k].anInt657 != j
  3290. + (aBoolean1047 ? 0 : 7))
  3291. continue;
  3292. anIntArray1065[j] = k;
  3293. break;
  3294. }
  3295. }
  3296. }
  3297.  
  3298. private void method46(int i, Stream stream) {
  3299. while (stream.bitPosition + 21 < i * 8) {
  3300. int k = stream.readBits(14);
  3301. if (k == 16383)
  3302. break;
  3303. if (npcArray[k] == null)
  3304. npcArray[k] = new NPC();
  3305. NPC npc = npcArray[k];
  3306. npcIndices[npcCount++] = k;
  3307. npc.anInt1537 = loopCycle;
  3308. int l = stream.readBits(5);
  3309. if (l > 15)
  3310. l -= 32;
  3311. int i1 = stream.readBits(5);
  3312. if (i1 > 15)
  3313. i1 -= 32;
  3314. int j1 = stream.readBits(1);
  3315. npc.desc = EntityDef.forID(stream.readBits(14));
  3316. int k1 = stream.readBits(1);
  3317. if (k1 == 1)
  3318. anIntArray894[anInt893++] = k;
  3319. npc.anInt1540 = npc.desc.aByte68;
  3320. npc.anInt1504 = npc.desc.anInt79;
  3321. npc.anInt1554 = npc.desc.walkAnim;
  3322. npc.anInt1555 = npc.desc.anInt58;
  3323. npc.anInt1556 = npc.desc.anInt83;
  3324. npc.anInt1557 = npc.desc.anInt55;
  3325. npc.anInt1511 = npc.desc.standAnim;
  3326. npc
  3327. .setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l,
  3328. j1 == 1);
  3329. }
  3330. stream.finishBitAccess();
  3331. }
  3332.  
  3333. public void processGameLoop() {
  3334. if (rsAlreadyLoaded || loadingError || genericLoadingError)
  3335. return;
  3336. loopCycle++;
  3337. if (!loggedIn)
  3338. processLoginScreenInput();
  3339. else
  3340. mainGameProcessor();
  3341. processOnDemandQueue();
  3342. }
  3343.  
  3344. private void method47(boolean flag) {
  3345. if (myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  3346. destX = 0;
  3347. int j = playerCount;
  3348. if (flag)
  3349. j = 1;
  3350. for (int l = 0; l < j; l++) {
  3351. Player player;
  3352. int i1;
  3353. if (flag) {
  3354. player = myPlayer;
  3355. i1 = myPlayerIndex << 14;
  3356. } else {
  3357. player = playerArray[playerIndices[l]];
  3358. i1 = playerIndices[l] << 14;
  3359. }
  3360. if (player == null || !player.isVisible())
  3361. continue;
  3362. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200)
  3363. && !flag && player.anInt1517 == player.anInt1511;
  3364. int j1 = player.x >> 7;
  3365. int k1 = player.y >> 7;
  3366. if (j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  3367. continue;
  3368. if (player.aModel_1714 != null && loopCycle >= player.anInt1707
  3369. && loopCycle < player.anInt1708) {
  3370. player.aBoolean1699 = false;
  3371. player.anInt1709 = method42(plane, player.y, player.x);
  3372. worldController.method286(plane, player.y, player,
  3373. player.anInt1552, player.anInt1722, player.x,
  3374. player.anInt1709, player.anInt1719, player.anInt1721,
  3375. i1, player.anInt1720);
  3376. continue;
  3377. }
  3378. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  3379. if (anIntArrayArray929[j1][k1] == anInt1265)
  3380. continue;
  3381. anIntArrayArray929[j1][k1] = anInt1265;
  3382. }
  3383. player.anInt1709 = method42(plane, player.y, player.x);
  3384. worldController.method285(plane, player.anInt1552,
  3385. player.anInt1709, i1, player.y, 60, player.x, player,
  3386. player.aBoolean1541);
  3387. }
  3388. }
  3389.  
  3390. private boolean promptUserForInput(RSInterface class9) {
  3391. int j = class9.contentType;
  3392. if (anInt900 == 2) {
  3393. if (j == 201) {
  3394. inputTaken = true;
  3395. inputDialogState = 0;
  3396. messagePromptRaised = true;
  3397. promptInput = "";
  3398. friendsListAction = 1;
  3399. aString1121 = "Enter name of friend to add to list";
  3400. }
  3401. if (j == 202) {
  3402. inputTaken = true;
  3403. inputDialogState = 0;
  3404. messagePromptRaised = true;
  3405. promptInput = "";
  3406. friendsListAction = 2;
  3407. aString1121 = "Enter name of friend to delete from list";
  3408. }
  3409. }
  3410. if (j == 205) {
  3411. anInt1011 = 250;
  3412. return true;
  3413. }
  3414. if (j == 501) {
  3415. inputTaken = true;
  3416. inputDialogState = 0;
  3417. messagePromptRaised = true;
  3418. promptInput = "";
  3419. friendsListAction = 4;
  3420. aString1121 = "Enter name of player to add to list";
  3421. }
  3422. if (j == 502) {
  3423. inputTaken = true;
  3424. inputDialogState = 0;
  3425. messagePromptRaised = true;
  3426. promptInput = "";
  3427. friendsListAction = 5;
  3428. aString1121 = "Enter name of player to delete from list";
  3429. }
  3430. if (j == 550) {
  3431. inputTaken = true;
  3432. inputDialogState = 0;
  3433. messagePromptRaised = true;
  3434. promptInput = "";
  3435. friendsListAction = 6;
  3436. aString1121 = "Enter the name of the chat you wish to join";
  3437. }
  3438. if (j >= 300 && j <= 313) {
  3439. int k = (j - 300) / 2;
  3440. int j1 = j & 1;
  3441. int i2 = anIntArray1065[k];
  3442. if (i2 != -1) {
  3443. do {
  3444. if (j1 == 0 && --i2 < 0)
  3445. i2 = IdentityKit.length - 1;
  3446. if (j1 == 1 && ++i2 >= IdentityKit.length)
  3447. i2 = 0;
  3448. } while (IdentityKit.cache[i2].aBoolean662
  3449. || IdentityKit.cache[i2].anInt657 != k
  3450. + (aBoolean1047 ? 0 : 7));
  3451. anIntArray1065[k] = i2;
  3452. aBoolean1031 = true;
  3453. }
  3454. }
  3455. if (j >= 314 && j <= 323) {
  3456. int l = (j - 314) / 2;
  3457. int k1 = j & 1;
  3458. int j2 = anIntArray990[l];
  3459. if (k1 == 0 && --j2 < 0)
  3460. j2 = anIntArrayArray1003[l].length - 1;
  3461. if (k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  3462. j2 = 0;
  3463. anIntArray990[l] = j2;
  3464. aBoolean1031 = true;
  3465. }
  3466. if (j == 324 && !aBoolean1047) {
  3467. aBoolean1047 = true;
  3468. method45();
  3469. }
  3470. if (j == 325 && aBoolean1047) {
  3471. aBoolean1047 = false;
  3472. method45();
  3473. }
  3474. if (j == 326) {
  3475. stream.createFrame(101);
  3476. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  3477. for (int i1 = 0; i1 < 7; i1++)
  3478. stream.writeWordBigEndian(anIntArray1065[i1]);
  3479.  
  3480. for (int l1 = 0; l1 < 5; l1++)
  3481. stream.writeWordBigEndian(anIntArray990[l1]);
  3482.  
  3483. return true;
  3484. }
  3485. if (j == 613)
  3486. canMute = !canMute;
  3487. if (j >= 601 && j <= 612) {
  3488. clearTopInterfaces();
  3489. if (reportAbuseInput.length() > 0) {
  3490. stream.createFrame(218);
  3491. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  3492. stream.writeWordBigEndian(j - 601);
  3493. stream.writeWordBigEndian(canMute ? 1 : 0);
  3494. }
  3495. }
  3496. return false;
  3497. }
  3498.  
  3499. private void method49(Stream stream) {
  3500. for (int j = 0; j < anInt893; j++) {
  3501. int k = anIntArray894[j];
  3502. Player player = playerArray[k];
  3503. int l = stream.readUnsignedByte();
  3504. if ((l & 0x40) != 0)
  3505. l += stream.readUnsignedByte() << 8;
  3506. method107(l, k, stream, player);
  3507. }
  3508. }
  3509.  
  3510. private void method50(int i, int k, int l, int i1, int j1) {
  3511. int k1 = worldController.method300(j1, l, i);
  3512. if (k1 != 0) {
  3513. int l1 = worldController.method304(j1, l, i, k1);
  3514. int k2 = l1 >> 6 & 3;
  3515. int i3 = l1 & 0x1f;
  3516. int k3 = k;
  3517. if (k1 > 0)
  3518. k3 = i1;
  3519. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  3520. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3521. int i5 = k1 >> 14 & 0x7fff;
  3522. ObjectDef class46_2 = ObjectDef.forID(i5);
  3523. if (class46_2.anInt758 != -1) {
  3524. Background background_2 = mapScenes[class46_2.anInt758];
  3525. if (background_2 != null) {
  3526. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  3527. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  3528. background_2.drawBackground(48 + l * 4 + i6, 48
  3529. + (104 - i - class46_2.anInt761) * 4 + j6);
  3530. }
  3531. } else {
  3532. if (i3 == 0 || i3 == 2)
  3533. if (k2 == 0) {
  3534. ai[k4] = k3;
  3535. ai[k4 + 512] = k3;
  3536. ai[k4 + 1024] = k3;
  3537. ai[k4 + 1536] = k3;
  3538. } else if (k2 == 1) {
  3539. ai[k4] = k3;
  3540. ai[k4 + 1] = k3;
  3541. ai[k4 + 2] = k3;
  3542. ai[k4 + 3] = k3;
  3543. } else if (k2 == 2) {
  3544. ai[k4 + 3] = k3;
  3545. ai[k4 + 3 + 512] = k3;
  3546. ai[k4 + 3 + 1024] = k3;
  3547. ai[k4 + 3 + 1536] = k3;
  3548. } else if (k2 == 3) {
  3549. ai[k4 + 1536] = k3;
  3550. ai[k4 + 1536 + 1] = k3;
  3551. ai[k4 + 1536 + 2] = k3;
  3552. ai[k4 + 1536 + 3] = k3;
  3553. }
  3554. if (i3 == 3)
  3555. if (k2 == 0)
  3556. ai[k4] = k3;
  3557. else if (k2 == 1)
  3558. ai[k4 + 3] = k3;
  3559. else if (k2 == 2)
  3560. ai[k4 + 3 + 1536] = k3;
  3561. else if (k2 == 3)
  3562. ai[k4 + 1536] = k3;
  3563. if (i3 == 2)
  3564. if (k2 == 3) {
  3565. ai[k4] = k3;
  3566. ai[k4 + 512] = k3;
  3567. ai[k4 + 1024] = k3;
  3568. ai[k4 + 1536] = k3;
  3569. } else if (k2 == 0) {
  3570. ai[k4] = k3;
  3571. ai[k4 + 1] = k3;
  3572. ai[k4 + 2] = k3;
  3573. ai[k4 + 3] = k3;
  3574. } else if (k2 == 1) {
  3575. ai[k4 + 3] = k3;
  3576. ai[k4 + 3 + 512] = k3;
  3577. ai[k4 + 3 + 1024] = k3;
  3578. ai[k4 + 3 + 1536] = k3;
  3579. } else if (k2 == 2) {
  3580. ai[k4 + 1536] = k3;
  3581. ai[k4 + 1536 + 1] = k3;
  3582. ai[k4 + 1536 + 2] = k3;
  3583. ai[k4 + 1536 + 3] = k3;
  3584. }
  3585. }
  3586. }
  3587. k1 = worldController.method302(j1, l, i);
  3588. if (k1 != 0) {
  3589. int i2 = worldController.method304(j1, l, i, k1);
  3590. int l2 = i2 >> 6 & 3;
  3591. int j3 = i2 & 0x1f;
  3592. int l3 = k1 >> 14 & 0x7fff;
  3593. ObjectDef class46_1 = ObjectDef.forID(l3);
  3594. if (class46_1.anInt758 != -1) {
  3595. Background background_1 = mapScenes[class46_1.anInt758];
  3596. if (background_1 != null) {
  3597. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  3598. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  3599. background_1.drawBackground(48 + l * 4 + j5, 48
  3600. + (104 - i - class46_1.anInt761) * 4 + k5);
  3601. }
  3602. } else if (j3 == 9) {
  3603. int l4 = 0xeeeeee;
  3604. if (k1 > 0)
  3605. l4 = 0xee0000;
  3606. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  3607. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3608. if (l2 == 0 || l2 == 2) {
  3609. ai1[l5 + 1536] = l4;
  3610. ai1[l5 + 1024 + 1] = l4;
  3611. ai1[l5 + 512 + 2] = l4;
  3612. ai1[l5 + 3] = l4;
  3613. } else {
  3614. ai1[l5] = l4;
  3615. ai1[l5 + 512 + 1] = l4;
  3616. ai1[l5 + 1024 + 2] = l4;
  3617. ai1[l5 + 1536 + 3] = l4;
  3618. }
  3619. }
  3620. }
  3621. k1 = worldController.method303(j1, l, i);
  3622. if (k1 != 0) {
  3623. int j2 = k1 >> 14 & 0x7fff;
  3624. ObjectDef class46 = ObjectDef.forID(j2);
  3625. if (class46.anInt758 != -1) {
  3626. Background background = mapScenes[class46.anInt758];
  3627. if (background != null) {
  3628. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  3629. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  3630. background.drawBackground(48 + l * 4 + i4, 48
  3631. + (104 - i - class46.anInt761) * 4 + j4);
  3632. }
  3633. }
  3634. }
  3635. }
  3636.  
  3637. private void loadTitleScreen() {
  3638. loginBox = new Background(titleStreamLoader, "titlebox", 0);
  3639. loginButtonHover = new Sprite(titleStreamLoader, "titlebutton", 0);
  3640. textBoxHover = new Sprite(titleStreamLoader, "titlebox", 1);
  3641. aBackgroundArray1152s = new Background[12];
  3642. int j = 0;
  3643. try {
  3644. j = Integer.parseInt(getParameter("fl_icon"));
  3645. } catch (Exception _ex) {
  3646. }
  3647. if (j == 0) {
  3648. for (int k = 0; k < 12; k++)
  3649. aBackgroundArray1152s[k] = new Background(titleStreamLoader,
  3650. "runes", k);
  3651.  
  3652. } else {
  3653. for (int l = 0; l < 12; l++)
  3654. aBackgroundArray1152s[l] = new Background(titleStreamLoader,
  3655. "runes", 12 + (l & 3));
  3656.  
  3657. }
  3658. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  3659. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  3660. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0,
  3661. aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  3662.  
  3663. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0,
  3664. aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  3665.  
  3666. anIntArray851 = new int[256];
  3667. for (int k1 = 0; k1 < 64; k1++)
  3668. anIntArray851[k1] = k1 * 0x40000;
  3669.  
  3670. for (int l1 = 0; l1 < 64; l1++)
  3671. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  3672.  
  3673. for (int i2 = 0; i2 < 64; i2++)
  3674. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  3675.  
  3676. for (int j2 = 0; j2 < 64; j2++)
  3677. anIntArray851[j2 + 192] = 0xffffff;
  3678.  
  3679. anIntArray852 = new int[256];
  3680. for (int k2 = 0; k2 < 64; k2++)
  3681. anIntArray852[k2] = k2 * 1024;
  3682.  
  3683. for (int l2 = 0; l2 < 64; l2++)
  3684. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  3685.  
  3686. for (int i3 = 0; i3 < 64; i3++)
  3687. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  3688.  
  3689. for (int j3 = 0; j3 < 64; j3++)
  3690. anIntArray852[j3 + 192] = 0xffffff;
  3691.  
  3692. anIntArray853 = new int[256];
  3693. for (int k3 = 0; k3 < 64; k3++)
  3694. anIntArray853[k3] = k3 * 4;
  3695.  
  3696. for (int l3 = 0; l3 < 64; l3++)
  3697. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  3698.  
  3699. for (int i4 = 0; i4 < 64; i4++)
  3700. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  3701.  
  3702. for (int j4 = 0; j4 < 64; j4++)
  3703. anIntArray853[j4 + 192] = 0xffffff;
  3704.  
  3705. anIntArray850 = new int[256];
  3706. anIntArray1190 = new int[32768];
  3707. anIntArray1191 = new int[32768];
  3708. randomizeBackground(null);
  3709. anIntArray828 = new int[32768];
  3710. anIntArray829 = new int[32768];
  3711. drawLoadingText(10, "Project Decimate is loading - please wait...");
  3712. if (!aBoolean831) {
  3713. drawFlames = true;
  3714. aBoolean831 = true;
  3715. startRunnable(this, 2);
  3716. }
  3717. }
  3718.  
  3719. private static void setHighMem() {
  3720. WorldController.lowMem = false;
  3721. Texture.lowMem = false;
  3722. lowMem = false;
  3723. ObjectManager.lowMem = false;
  3724. ObjectDef.lowMem = false;
  3725. }
  3726.  
  3727. public static void main(String args[]) {
  3728. try {
  3729. nodeID = 10;
  3730. portOff = 0;
  3731. setHighMem();
  3732. isMembers = true;
  3733. clientHeight = 503;
  3734. clientWidth = 765;
  3735. signlink.storeid = 32;
  3736. signlink.startpriv(InetAddress.getByName(server));
  3737. client client1 = new client();
  3738.  
  3739. new Jframe(args);
  3740. } catch (Exception exception) {
  3741. }
  3742. }
  3743.  
  3744. public static client instance;
  3745.  
  3746. private void loadingStages() {
  3747. if (lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  3748. aRSImageProducer_1165.initDrawingArea();
  3749. DrawingArea.drawPixels(26, 1, 1, 0xC2C2C2, 134);
  3750. DrawingArea.drawPixels(24, 2, 2, 0xC2C2C2, 132);
  3751. DrawingArea.fillPixels(3, 130, 22, 0x0F0F0F, 3);
  3752. DrawingArea.drawPixels(20, 4, 4, 0x12161D, 128);
  3753. aTextDrawingArea_1271.drawText(0xFFA200, "Loading - please wait", 18, 68);
  3754. ;
  3755. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3756. loadingStage = 1;
  3757. aLong824 = System.currentTimeMillis();
  3758. }
  3759. if (loadingStage == 1) {
  3760. int j = method54();
  3761. if (j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  3762. signlink.reporterror(myUsername + " glcfb " + aLong1215 + ","
  3763. + j + "," + lowMem + "," + decompressors[0] + ","
  3764. + onDemandFetcher.getNodeCount() + "," + plane + ","
  3765. + anInt1069 + "," + anInt1070);
  3766. aLong824 = System.currentTimeMillis();
  3767. }
  3768. }
  3769. if (loadingStage == 2 && plane != anInt985) {
  3770. anInt985 = plane;
  3771. method24(plane);
  3772. }
  3773. }
  3774.  
  3775. private int method54() {
  3776. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3777. if (aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  3778. return -1;
  3779. if (aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  3780. return -2;
  3781. }
  3782. boolean flag = true;
  3783. for (int j = 0; j < aByteArrayArray1183.length; j++) {
  3784. byte abyte0[] = aByteArrayArray1247[j];
  3785. if (abyte0 != null) {
  3786. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  3787. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  3788. if (aBoolean1159) {
  3789. k = 10;
  3790. l = 10;
  3791. }
  3792. try {
  3793. flag &= ObjectManager.method189(k, abyte0, l);
  3794. } catch (Exception e) {
  3795. e.printStackTrace();
  3796. }
  3797. }
  3798. }
  3799. if (!flag)
  3800. return -3;
  3801. if (aBoolean1080) {
  3802. return -4;
  3803. } else {
  3804. loadingStage = 2;
  3805. ObjectManager.anInt131 = plane;
  3806. method22();
  3807. stream.createFrame(121);
  3808. return 0;
  3809. }
  3810. }
  3811.  
  3812. private void method55() {
  3813. for (Animable_Sub4 class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  3814. .reverseGetFirst(); class30_sub2_sub4_sub4 != null; class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  3815. .reverseGetNext())
  3816. if (class30_sub2_sub4_sub4.anInt1597 != plane
  3817. || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  3818. class30_sub2_sub4_sub4.unlink();
  3819. else if (loopCycle >= class30_sub2_sub4_sub4.anInt1571) {
  3820. if (class30_sub2_sub4_sub4.anInt1590 > 0) {
  3821. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  3822. if (npc != null && npc.x >= 0 && npc.x < 13312
  3823. && npc.y >= 0 && npc.y < 13312)
  3824. class30_sub2_sub4_sub4.method455(loopCycle, npc.y,
  3825. method42(class30_sub2_sub4_sub4.anInt1597,
  3826. npc.y, npc.x)
  3827. - class30_sub2_sub4_sub4.anInt1583,
  3828. npc.x);
  3829. }
  3830. if (class30_sub2_sub4_sub4.anInt1590 < 0) {
  3831. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  3832. Player player;
  3833. if (j == unknownInt10)
  3834. player = myPlayer;
  3835. else
  3836. player = playerArray[j];
  3837. if (player != null && player.x >= 0 && player.x < 13312
  3838. && player.y >= 0 && player.y < 13312)
  3839. class30_sub2_sub4_sub4.method455(loopCycle, player.y,
  3840. method42(class30_sub2_sub4_sub4.anInt1597,
  3841. player.y, player.x)
  3842. - class30_sub2_sub4_sub4.anInt1583,
  3843. player.x);
  3844. }
  3845. class30_sub2_sub4_sub4.method456(anInt945);
  3846. worldController.method285(plane,
  3847. class30_sub2_sub4_sub4.anInt1595,
  3848. (int) class30_sub2_sub4_sub4.aDouble1587, -1,
  3849. (int) class30_sub2_sub4_sub4.aDouble1586, 60,
  3850. (int) class30_sub2_sub4_sub4.aDouble1585,
  3851. class30_sub2_sub4_sub4, false);
  3852. }
  3853.  
  3854. }
  3855.  
  3856. public AppletContext getAppletContext() {
  3857. if (signlink.mainapp != null)
  3858. return signlink.mainapp.getAppletContext();
  3859. else
  3860. return super.getAppletContext();
  3861. }
  3862.  
  3863. public void drawLogo() {
  3864. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  3865. Sprite sprite = new Sprite(abyte0, this);
  3866. aRSImageProducer_1110.initDrawingArea();
  3867. sprite.drawSprite(0, 0);
  3868. aRSImageProducer_1111.initDrawingArea();
  3869. sprite.drawSprite(-637, 0);
  3870. aRSImageProducer_1107.initDrawingArea();
  3871. sprite.drawSprite(-128, 0);
  3872. aRSImageProducer_1108.initDrawingArea();
  3873. sprite.drawSprite(-202, -371);
  3874. aRSImageProducer_1109.initDrawingArea();
  3875. sprite.drawSprite(-202, -171);
  3876. aRSImageProducer_1112.initDrawingArea();
  3877. sprite.drawSprite(0, -265);
  3878. aRSImageProducer_1113.initDrawingArea();
  3879. sprite.drawSprite(-562, -265);
  3880. aRSImageProducer_1114.initDrawingArea();
  3881. sprite.drawSprite(-128, -171);
  3882. aRSImageProducer_1115.initDrawingArea();
  3883. sprite.drawSprite(-562, -171);
  3884. sprite = null;
  3885. Object obj = null;
  3886. Object obj1 = null;
  3887. System.gc();
  3888. }
  3889.  
  3890. private void processOnDemandQueue() {
  3891. do {
  3892. OnDemandData onDemandData;
  3893. do {
  3894. onDemandData = onDemandFetcher.getNextNode();
  3895. if (onDemandData == null)
  3896. return;
  3897. if (onDemandData.dataType == 0) {
  3898. Model.method460(onDemandData.buffer, onDemandData.ID);
  3899. // if((onDemandFetcher.getModelIndex(onDemandData.ID) &
  3900. // 0x62) != 0)
  3901. // {
  3902. needDrawTabArea = true;
  3903. if (backDialogID != -1)
  3904. inputTaken = true;
  3905. // }
  3906. }
  3907. if (onDemandData.dataType == 1 && onDemandData.buffer != null)
  3908. Class36.load(onDemandData.ID, onDemandData.buffer);
  3909. if (onDemandData.dataType == 2
  3910. && onDemandData.ID == nextSong
  3911. && onDemandData.buffer != null)
  3912. saveMidi(songChanging, onDemandData.buffer);
  3913. if (onDemandData.dataType == 3 && loadingStage == 1) {
  3914. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  3915. if (anIntArray1235[i] == onDemandData.ID) {
  3916. aByteArrayArray1183[i] = onDemandData.buffer;
  3917. if (onDemandData.buffer == null)
  3918. anIntArray1235[i] = -1;
  3919. break;
  3920. }
  3921. if (anIntArray1236[i] != onDemandData.ID)
  3922. continue;
  3923. aByteArrayArray1247[i] = onDemandData.buffer;
  3924. if (onDemandData.buffer == null)
  3925. anIntArray1236[i] = -1;
  3926. break;
  3927. }
  3928.  
  3929. }
  3930. } while (onDemandData.dataType != 93
  3931. || !onDemandFetcher.method564(onDemandData.ID));
  3932. ObjectManager.method173(new Stream(onDemandData.buffer),
  3933. onDemandFetcher);
  3934. } while (true);
  3935. }
  3936.  
  3937. private void calcFlamesPosition() {
  3938. char c = '\u0100';
  3939. for (int j = 10; j < 117; j++) {
  3940. int k = (int) (Math.random() * 100D);
  3941. if (k < 50)
  3942. anIntArray828[j + (c - 2 << 7)] = 255;
  3943. }
  3944. for (int l = 0; l < 100; l++) {
  3945. int i1 = (int) (Math.random() * 124D) + 2;
  3946. int k1 = (int) (Math.random() * 128D) + 128;
  3947. int k2 = i1 + (k1 << 7);
  3948. anIntArray828[k2] = 192;
  3949. }
  3950.  
  3951. for (int j1 = 1; j1 < c - 1; j1++) {
  3952. for (int l1 = 1; l1 < 127; l1++) {
  3953. int l2 = l1 + (j1 << 7);
  3954. anIntArray829[l2] = (anIntArray828[l2 - 1]
  3955. + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  3956. }
  3957.  
  3958. }
  3959.  
  3960. anInt1275 += 128;
  3961. if (anInt1275 > anIntArray1190.length) {
  3962. anInt1275 -= anIntArray1190.length;
  3963. int i2 = (int) (Math.random() * 12D);
  3964. randomizeBackground(aBackgroundArray1152s[i2]);
  3965. }
  3966. for (int j2 = 1; j2 < c - 1; j2++) {
  3967. for (int i3 = 1; i3 < 127; i3++) {
  3968. int k3 = i3 + (j2 << 7);
  3969. int i4 = anIntArray829[k3 + 128]
  3970. - anIntArray1190[k3 + anInt1275 & anIntArray1190.length
  3971. - 1] / 5;
  3972. if (i4 < 0)
  3973. i4 = 0;
  3974. anIntArray828[k3] = i4;
  3975. }
  3976.  
  3977. }
  3978.  
  3979. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  3980.  
  3981. anIntArray969[c - 1] = (int) (Math.sin((double) loopCycle / 14D) * 16D
  3982. + Math.sin((double) loopCycle / 15D) * 14D + Math
  3983. .sin((double) loopCycle / 16D) * 12D);
  3984. if (anInt1040 > 0)
  3985. anInt1040 -= 4;
  3986. if (anInt1041 > 0)
  3987. anInt1041 -= 4;
  3988. if (anInt1040 == 0 && anInt1041 == 0) {
  3989. int l3 = (int) (Math.random() * 2000D);
  3990. if (l3 == 0)
  3991. anInt1040 = 1024;
  3992. if (l3 == 1)
  3993. anInt1041 = 1024;
  3994. }
  3995. }
  3996.  
  3997. private boolean saveWave(byte abyte0[], int i) {
  3998. return abyte0 == null || signlink.wavesave(abyte0, i);
  3999. }
  4000.  
  4001. private void method60(int i) {
  4002. RSInterface class9 = RSInterface.interfaceCache[i];
  4003. for (int j = 0; j < class9.children.length; j++) {
  4004. if (class9.children[j] == -1)
  4005. break;
  4006. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  4007. if (class9_1.type == 1)
  4008. method60(class9_1.id);
  4009. class9_1.anInt246 = 0;
  4010. class9_1.anInt208 = 0;
  4011. }
  4012. }
  4013.  
  4014. private void drawHeadIcon() {
  4015. if (anInt855 != 2)
  4016. return;
  4017. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2,
  4018. (anInt935 - baseY << 7) + anInt938);
  4019. if (spriteDrawX > -1 && loopCycle % 20 < 10)
  4020. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  4021. }
  4022.  
  4023. private void mainGameProcessor() {
  4024. if (anInt1104 > 1)
  4025. anInt1104--;
  4026. if (anInt1011 > 0)
  4027. anInt1011--;
  4028. for (int j = 0; j < 5; j++)
  4029. if (!parsePacket())
  4030. break;
  4031.  
  4032. if (!loggedIn)
  4033. return;
  4034. try{
  4035. canWalkDelay--;
  4036. if (followNPC > 0)
  4037. {
  4038. NPC n = npcArray[followNPC];
  4039. if (n != null)
  4040. {
  4041. if (!withinDistance(myPlayer.smallX[0], myPlayer.smallY[0], n.smallX[0], n.smallY[0], followDistance))
  4042. {
  4043. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, n.smallY[0], myPlayer.smallX[0], false, n.smallX[0]);
  4044. }
  4045. }
  4046. }
  4047. else if (followPlayer > 0 && canWalkDelay <= 0)
  4048. {
  4049. Player p = playerArray[followPlayer];
  4050. if (p != null)
  4051. {
  4052. int dis = getDis(myPlayer.smallX[0], myPlayer.smallY[0], p.smallX[0], p.smallY[0]);
  4053. if (dis > followDistance)
  4054. {
  4055. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], followDistance, 0, p.smallY[0], myPlayer.smallX[0], false, p.smallX[0]);
  4056. canWalkDelay = 30;
  4057. }
  4058. else if (dis == 0)
  4059. {
  4060. int rnd = random(4);
  4061. if (rnd == 0)
  4062. {
  4063. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0], myPlayer.smallX[0], false, p.smallX[0] - 2);
  4064. }
  4065. else if (rnd == 1)
  4066. {
  4067. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0], myPlayer.smallX[0], false, p.smallX[0] + 2);
  4068. }
  4069. else if (rnd == 2)
  4070. {
  4071. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0] - 2, myPlayer.smallX[0], false, p.smallX[0]);
  4072. }
  4073. else if (rnd == 3)
  4074. {
  4075. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, p.smallY[0] + 2, myPlayer.smallX[0], false, p.smallX[0]);
  4076. }
  4077. canWalkDelay = 60;
  4078. }
  4079. }
  4080. }
  4081. } catch(Exception ex){
  4082. System.out.println("Exception in following, method : in process.)");
  4083. }
  4084. synchronized (mouseDetection.syncObject) {
  4085. if (clientWidth - 765 != extraWidth
  4086. || clientHeight - 503 != extraHeight
  4087. || (isFullScreen && (Jframe.frame.getWidth() - 11 != clientWidth || Jframe.frame
  4088. .getHeight() - 58 != clientHeight))) {
  4089. hasBeenBlanked = false;
  4090. if (isFullScreen) {
  4091. extraWidth = Jframe.frame.getWidth() - 765 - 11;
  4092. extraHeight = Jframe.frame.getHeight() - 503 - 58;
  4093. clientWidth = extraWidth + 765;
  4094. clientHeight = extraHeight + 503;
  4095. } else {
  4096. clientWidth = 765;
  4097. clientHeight = 503;
  4098. extraWidth = 0;
  4099. extraHeight = 0;
  4100. }
  4101. if (isFullScreen) {
  4102. try {
  4103. Texture.method365(clientWidth, clientHeight);
  4104. anIntArray1180 = Texture.anIntArray1472;
  4105. Texture.method365(clientWidth, clientHeight);
  4106. anIntArray1181 = Texture.anIntArray1472;
  4107. Texture.method365(clientWidth, clientHeight);
  4108. } catch (Exception e) {
  4109. e.printStackTrace();
  4110. }
  4111. anIntArray1182 = Texture.anIntArray1472;
  4112. int ai[] = new int[9];
  4113. for (int i8 = 0; i8 < 9; i8++) {
  4114. int k8 = 128 + i8 * 32 + 15;
  4115. int l8 = 600 + k8 * 3;
  4116. int i9 = Texture.anIntArray1470[k8];
  4117. ai[i8] = l8 * i9 >> 16;
  4118. }
  4119. WorldController.method310(500, 800, clientWidth,
  4120. clientHeight, ai);
  4121. buffer = getGameComponent().createImage(765 + extraWidth,
  4122. 503 + extraHeight);
  4123. bufferGraphics = buffer.getGraphics();
  4124. try {
  4125. super.fullGameScreen = new RSImageProducer(clientWidth,
  4126. clientHeight, getGameComponent());
  4127. aRSImageProducer_1165 = new RSImageProducer(
  4128. clientWidth, clientHeight, getGameComponent());
  4129. // 2Jframe.frame.resize(new Dimension(765+extraWidth,
  4130. // 503+extraHeight+46));
  4131. } catch (Exception e) {
  4132. e.printStackTrace();
  4133. }
  4134. } else {
  4135. Texture.method365(765, 503);
  4136. fullScreenTextureArray = Texture.anIntArray1472;
  4137. Texture.method365(519, 165);
  4138. anIntArray1180 = Texture.anIntArray1472;
  4139. Texture.method365(246, 335);
  4140. anIntArray1181 = Texture.anIntArray1472;
  4141. Texture.method365(512, 334);
  4142. anIntArray1182 = Texture.anIntArray1472;
  4143. int ai[] = new int[9];
  4144. for (int i8 = 0; i8 < 9; i8++) {
  4145. int k8 = 128 + i8 * 32 + 15;
  4146. int l8 = 600 + k8 * 3;
  4147. int i9 = Texture.anIntArray1470[k8];
  4148. ai[i8] = l8 * i9 >> 16;
  4149. }
  4150. WorldController.method310(500, 800, 512, 334, ai);
  4151. try {
  4152. super.fullGameScreen = new RSImageProducer(765, 503,
  4153. getGameComponent());
  4154. aRSImageProducer_1165 = new RSImageProducer(512, 334,
  4155. getGameComponent());
  4156. Jframe.frame.resize(new Dimension(765 + 16,
  4157. 503 + 46 + 14));
  4158. } catch (Exception e) {
  4159. e.printStackTrace();
  4160. }
  4161. }
  4162. }
  4163. if (flagged) {
  4164. if (super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40) {
  4165. stream.createFrame(45);
  4166. stream.writeWordBigEndian(0);
  4167. int j2 = stream.currentOffset;
  4168. int j3 = 0;
  4169. for (int j4 = 0; j4 < mouseDetection.coordsIndex; j4++) {
  4170. if (j2 - stream.currentOffset >= 240)
  4171. break;
  4172. j3++;
  4173. int l4 = mouseDetection.coordsY[j4];
  4174. if (l4 < 0)
  4175. l4 = 0;
  4176. else if (l4 > 502)
  4177. l4 = 502;
  4178. int k5 = mouseDetection.coordsX[j4];
  4179. if (k5 < 0)
  4180. k5 = 0;
  4181. else if (k5 > 764)
  4182. k5 = 764;
  4183. int i6 = l4 * 765 + k5;
  4184. if (mouseDetection.coordsY[j4] == -1
  4185. && mouseDetection.coordsX[j4] == -1) {
  4186. k5 = -1;
  4187. l4 = -1;
  4188. i6 = 0x7ffff;
  4189. }
  4190. if (k5 == anInt1237 && l4 == anInt1238) {
  4191. if (anInt1022 < 2047)
  4192. anInt1022++;
  4193. } else {
  4194. int j6 = k5 - anInt1237;
  4195. anInt1237 = k5;
  4196. int k6 = l4 - anInt1238;
  4197. anInt1238 = l4;
  4198. if (anInt1022 < 8 && j6 >= -32 && j6 <= 31
  4199. && k6 >= -32 && k6 <= 31) {
  4200. j6 += 32;
  4201. k6 += 32;
  4202. stream.writeWord((anInt1022 << 12) + (j6 << 6)
  4203. + k6);
  4204. anInt1022 = 0;
  4205. } else if (anInt1022 < 8) {
  4206. stream.writeDWordBigEndian(0x800000
  4207. + (anInt1022 << 19) + i6);
  4208. anInt1022 = 0;
  4209. } else {
  4210. stream.writeDWord(0xc0000000
  4211. + (anInt1022 << 19) + i6);
  4212. anInt1022 = 0;
  4213. }
  4214. }
  4215. }
  4216.  
  4217. stream.writeBytes(stream.currentOffset - j2);
  4218. if (j3 >= mouseDetection.coordsIndex) {
  4219. mouseDetection.coordsIndex = 0;
  4220. } else {
  4221. mouseDetection.coordsIndex -= j3;
  4222. for (int i5 = 0; i5 < mouseDetection.coordsIndex; i5++) {
  4223. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5
  4224. + j3];
  4225. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5
  4226. + j3];
  4227. }
  4228.  
  4229. }
  4230. }
  4231. } else {
  4232. mouseDetection.coordsIndex = 0;
  4233. }
  4234. }
  4235. if (super.clickMode3 != 0) {
  4236. long l = (super.aLong29 - aLong1220) / 50L;
  4237. if (l > 4095L)
  4238. l = 4095L;
  4239. aLong1220 = super.aLong29;
  4240. int k2 = super.saveClickY;
  4241. if (k2 < 0)
  4242. k2 = 0;
  4243. else if (k2 > 502)
  4244. k2 = 502;
  4245. int k3 = super.saveClickX;
  4246. if (k3 < 0)
  4247. k3 = 0;
  4248. else if (k3 > 764)
  4249. k3 = 764;
  4250. int k4 = k2 * 765 + k3;
  4251. int j5 = 0;
  4252. if (super.clickMode3 == 2)
  4253. j5 = 1;
  4254. int l5 = (int) l;
  4255. stream.createFrame(241);
  4256. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  4257. }
  4258. if (anInt1016 > 0)
  4259. anInt1016--;
  4260. if (super.keyArray[1] == 1 || super.keyArray[2] == 1
  4261. || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  4262. aBoolean1017 = true;
  4263. if (aBoolean1017 && anInt1016 <= 0) {
  4264. anInt1016 = 20;
  4265. aBoolean1017 = false;
  4266. stream.createFrame(86);
  4267. stream.writeWord(anInt1184);
  4268. stream.method432(minimapInt1);
  4269. }
  4270. if (super.awtFocus && !aBoolean954) {
  4271. aBoolean954 = true;
  4272. stream.createFrame(3);
  4273. stream.writeWordBigEndian(1);
  4274. }
  4275. if (!super.awtFocus && aBoolean954) {
  4276. aBoolean954 = false;
  4277. stream.createFrame(3);
  4278. stream.writeWordBigEndian(0);
  4279. }
  4280. loadingStages();
  4281. method115();
  4282. method90();
  4283. anInt1009++;
  4284. if (anInt1009 > 750)
  4285. dropClient();
  4286. method114();
  4287. method95();
  4288. method38();
  4289. anInt945++;
  4290. if (crossType != 0) {
  4291. crossIndex += 20;
  4292. if (crossIndex >= 400)
  4293. crossType = 0;
  4294. }
  4295. if (atInventoryInterfaceType != 0) {
  4296. atInventoryLoopCycle++;
  4297. if (atInventoryLoopCycle >= 15) {
  4298. if (atInventoryInterfaceType == 2)
  4299. needDrawTabArea = true;
  4300. if (atInventoryInterfaceType == 3)
  4301. inputTaken = true;
  4302. atInventoryInterfaceType = 0;
  4303. }
  4304. }
  4305. if (activeInterfaceType != 0) {
  4306. anInt989++;
  4307. if (super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5
  4308. || super.mouseY > anInt1088 + 5
  4309. || super.mouseY < anInt1088 - 5)
  4310. aBoolean1242 = true;
  4311. if (super.clickMode2 == 0) {
  4312. if (activeInterfaceType == 2)
  4313. needDrawTabArea = true;
  4314. if (activeInterfaceType == 3)
  4315. inputTaken = true;
  4316. activeInterfaceType = 0;
  4317. if (aBoolean1242 && anInt989 >= 10) {
  4318. lastActiveInvInterface = -1;
  4319. processRightClick();
  4320. if (lastActiveInvInterface == anInt1084
  4321. && mouseInvInterfaceIndex != anInt1085) {
  4322. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  4323. int j1 = 0;
  4324. if (anInt913 == 1 && class9.contentType == 206)
  4325. j1 = 1;
  4326. if (class9.inv[mouseInvInterfaceIndex] <= 0)
  4327. j1 = 0;
  4328. if (class9.aBoolean235) {
  4329. int l2 = anInt1085;
  4330. int l3 = mouseInvInterfaceIndex;
  4331. class9.inv[l3] = class9.inv[l2];
  4332. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  4333. class9.inv[l2] = -1;
  4334. class9.invStackSizes[l2] = 0;
  4335. } else if (j1 == 1) {
  4336. int i3 = anInt1085;
  4337. for (int i4 = mouseInvInterfaceIndex; i3 != i4;)
  4338. if (i3 > i4) {
  4339. class9.swapInventoryItems(i3, i3 - 1);
  4340. i3--;
  4341. } else if (i3 < i4) {
  4342. class9.swapInventoryItems(i3, i3 + 1);
  4343. i3++;
  4344. }
  4345.  
  4346. } else {
  4347. class9.swapInventoryItems(anInt1085,
  4348. mouseInvInterfaceIndex);
  4349. }
  4350. stream.createFrame(214);
  4351. stream.method433(anInt1084);
  4352. stream.method424(j1);
  4353. stream.method433(anInt1085);
  4354. stream.method431(mouseInvInterfaceIndex);
  4355. }
  4356. } else if ((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1))
  4357. && menuActionRow > 2)
  4358. determineMenuSize();
  4359. else if (menuActionRow > 0)
  4360. doAction(menuActionRow - 1);
  4361. atInventoryLoopCycle = 10;
  4362. super.clickMode3 = 0;
  4363. }
  4364. }
  4365. if (WorldController.anInt470 != -1) {
  4366. int k = WorldController.anInt470;
  4367. int k1 = WorldController.anInt471;
  4368. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1,
  4369. myPlayer.smallX[0], true, k);
  4370. WorldController.anInt470 = -1;
  4371. if (flag) {
  4372. crossX = super.saveClickX;
  4373. crossY = super.saveClickY;
  4374. crossType = 1;
  4375. crossIndex = 0;
  4376. }
  4377. }
  4378. if (super.clickMode3 == 1 && aString844 != null) {
  4379. aString844 = null;
  4380. inputTaken = true;
  4381. super.clickMode3 = 0;
  4382. }
  4383. processMenuClick();
  4384. processMainScreenClick();
  4385. processTabClick();
  4386. processChatModeClick();
  4387. processMapAreaClick();
  4388. if (super.clickMode2 == 1 || super.clickMode3 == 1)
  4389. anInt1213++;
  4390. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  4391. if (anInt1501 < 100) {
  4392. anInt1501++;
  4393. if (anInt1501 == 100) {
  4394. if (anInt1500 != 0) {
  4395. inputTaken = true;
  4396. }
  4397. if (anInt1044 != 0) {
  4398. needDrawTabArea = true;
  4399. }
  4400. }
  4401. }
  4402. } else if (anInt1501 > 0) {
  4403. anInt1501--;
  4404. }
  4405. if (loadingStage == 2)
  4406. method108();
  4407. if (loadingStage == 2 && aBoolean1160)
  4408. calcCameraPos();
  4409. for (int i1 = 0; i1 < 5; i1++)
  4410. anIntArray1030[i1]++;
  4411.  
  4412. method73();
  4413. super.idleTime++;
  4414. if (super.idleTime > 4500) {
  4415. anInt1011 = 250;
  4416. super.idleTime -= 500;
  4417. stream.createFrame(202);
  4418. }
  4419. anInt988++;
  4420. if (anInt988 > 500) {
  4421. anInt988 = 0;
  4422. int l1 = (int) (Math.random() * 8D);
  4423. if ((l1 & 1) == 1)
  4424. anInt1278 += anInt1279;
  4425. if ((l1 & 2) == 2)
  4426. anInt1131 += anInt1132;
  4427. if ((l1 & 4) == 4)
  4428. anInt896 += anInt897;
  4429. }
  4430. if (anInt1278 < -50)
  4431. anInt1279 = 2;
  4432. if (anInt1278 > 50)
  4433. anInt1279 = -2;
  4434. if (anInt1131 < -55)
  4435. anInt1132 = 2;
  4436. if (anInt1131 > 55)
  4437. anInt1132 = -2;
  4438. if (anInt896 < -40)
  4439. anInt897 = 1;
  4440. if (anInt896 > 40)
  4441. anInt897 = -1;
  4442. anInt1254++;
  4443. if (anInt1254 > 500) {
  4444. anInt1254 = 0;
  4445. int i2 = (int) (Math.random() * 8D);
  4446. if ((i2 & 1) == 1)
  4447. minimapInt2 += anInt1210;
  4448. if ((i2 & 2) == 2)
  4449. minimapInt3 += anInt1171;
  4450. }
  4451. if (minimapInt2 < -60)
  4452. anInt1210 = 2;
  4453. if (minimapInt2 > 60)
  4454. anInt1210 = -2;
  4455. if (minimapInt3 < -20)
  4456. anInt1171 = 1;
  4457. if (minimapInt3 > 10)
  4458. anInt1171 = -1;
  4459. anInt1010++;
  4460. if (anInt1010 > 50)
  4461. stream.createFrame(0);
  4462. try {
  4463. if (socketStream != null && stream.currentOffset > 0) {
  4464. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  4465. stream.currentOffset = 0;
  4466. anInt1010 = 0;
  4467. }
  4468. } catch (IOException _ex) {
  4469. dropClient();
  4470. } catch (Exception exception) {
  4471. resetLogout();
  4472. }
  4473. }
  4474.  
  4475. private void method63() {
  4476. Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  4477. .reverseGetFirst();
  4478. for (; class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  4479. .reverseGetNext())
  4480. if (class30_sub1.anInt1294 == -1) {
  4481. class30_sub1.anInt1302 = 0;
  4482. method89(class30_sub1);
  4483. } else {
  4484. class30_sub1.unlink();
  4485. }
  4486.  
  4487. }
  4488.  
  4489. private void resetImageProducers() {
  4490. if (aRSImageProducer_1107 != null)
  4491. return;
  4492. super.fullGameScreen = null;
  4493. aRSImageProducer_1166 = null;
  4494. aRSImageProducer_1164 = null;
  4495. aRSImageProducer_1163 = null;
  4496. aRSImageProducer_1165 = null;
  4497. aRSImageProducer_1123 = null;
  4498. aRSImageProducer_1124 = null;
  4499. aRSImageProducer_1125 = null;
  4500. aRSImageProducer_1110 = new RSImageProducer(128, 265,
  4501. getGameComponent());
  4502. DrawingArea.setAllPixelsToZero();
  4503. aRSImageProducer_1111 = new RSImageProducer(128, 265,
  4504. getGameComponent());
  4505. DrawingArea.setAllPixelsToZero();
  4506. aRSImageProducer_1107 = new RSImageProducer(509, 171,
  4507. getGameComponent());
  4508. DrawingArea.setAllPixelsToZero();
  4509. aRSImageProducer_1108 = new RSImageProducer(360, 132,
  4510. getGameComponent());
  4511. DrawingArea.setAllPixelsToZero();
  4512. loginScreenArea = new RSImageProducer(765, 503, getGameComponent());
  4513. DrawingArea.setAllPixelsToZero();
  4514. aRSImageProducer_1109 = new RSImageProducer(360, 200,
  4515. getGameComponent());
  4516. DrawingArea.setAllPixelsToZero();
  4517. aRSImageProducer_1112 = new RSImageProducer(202, 238,
  4518. getGameComponent());
  4519. DrawingArea.setAllPixelsToZero();
  4520. aRSImageProducer_1113 = new RSImageProducer(203, 238,
  4521. getGameComponent());
  4522. DrawingArea.setAllPixelsToZero();
  4523. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  4524. DrawingArea.setAllPixelsToZero();
  4525. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  4526. DrawingArea.setAllPixelsToZero();
  4527. if (titleStreamLoader != null) {
  4528. drawLogo();
  4529. loadTitleScreen();
  4530. }
  4531. welcomeScreenRaised = true;
  4532. }
  4533.  
  4534. /*void drawLoadingText(int i, String s) {
  4535. anInt1079 = i;
  4536. aString1049 = s;
  4537. resetImageProducers();
  4538. if (titleStreamLoader == null) {
  4539. super.drawLoadingText(i, s);
  4540. return;
  4541. }
  4542. aRSImageProducer_1109.initDrawingArea(); // startup screen
  4543. char c = '\u0168';
  4544. char c1 = '\310';
  4545. byte byte1 = 20;
  4546. chatTextDrawingArea.drawText(0xffffff,
  4547. "Project Decimate Client", c1 / 2 - 26 - byte1,
  4548. c / 2);
  4549. int j = c1 / 2 - 18 - byte1;
  4550. DrawingArea.fillPixels(c / 2 - 152, 304, 19, 0xff0000, j);
  4551. DrawingArea.fillPixels(c / 2 - 151, 302, 17, 0, j + 1);
  4552. DrawingArea.drawPixels(15, j + 2, c / 2 - 150, 0xff0000, i * 3);
  4553. DrawingArea
  4554. .drawPixels(15, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  4555. chatTextDrawingArea.drawText(0x000000, s, (c1 / 2 - 5) - byte1, c / 2); // loading bar text color
  4556. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  4557. if (welcomeScreenRaised) {
  4558. welcomeScreenRaised = false;
  4559. if (!aBoolean831) {
  4560. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  4561. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  4562. }
  4563. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  4564. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  4565. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  4566. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  4567. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  4568. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  4569. }
  4570. }*/
  4571.  
  4572. void drawLoadingText(int i, String s)
  4573. {
  4574. anInt1079 = i;
  4575. aString1049 = s;
  4576. resetImageProducers();
  4577. if(titleStreamLoader == null)
  4578. {
  4579. super.drawLoadingText(i, s);
  4580. return;
  4581. }
  4582. aRSImageProducer_1109.initDrawingArea();
  4583. char c = '\u0168';
  4584. char c1 = '\310';
  4585. byte byte1 = 20;
  4586. chatTextDrawingArea.drawText(0xffffff, "Project Decimate", c1 / 2 - 26 - byte1, c / 2);
  4587. int j = c1 / 2 - 18 - byte1;
  4588. DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
  4589. DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
  4590. DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
  4591. DrawingArea.drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  4592. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
  4593. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  4594. if(welcomeScreenRaised)
  4595. {
  4596. welcomeScreenRaised = false;
  4597. if(!aBoolean831)
  4598. {
  4599. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  4600. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  4601. }
  4602. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  4603. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  4604. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  4605. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  4606. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  4607. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  4608. }
  4609. }
  4610.  
  4611. private void method65(int i, int j, int k, int l, RSInterface class9,
  4612. int i1, boolean flag, int j1) {
  4613. int anInt992;
  4614. if (aBoolean972)
  4615. anInt992 = 32;
  4616. else
  4617. anInt992 = 0;
  4618. aBoolean972 = false;
  4619. if (k >= i && k < i + 16 && l >= i1 && l < i1 + 16) {
  4620. class9.scrollPosition -= anInt1213 * 4;
  4621. if (flag) {
  4622. needDrawTabArea = true;
  4623. }
  4624. } else if (k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j) {
  4625. class9.scrollPosition += anInt1213 * 4;
  4626. if (flag) {
  4627. needDrawTabArea = true;
  4628. }
  4629. } else if (k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16
  4630. && l < (i1 + j) - 16 && anInt1213 > 0) {
  4631. int l1 = ((j - 32) * j) / j1;
  4632. if (l1 < 8)
  4633. l1 = 8;
  4634. int i2 = l - i1 - 16 - l1 / 2;
  4635. int j2 = j - 32 - l1;
  4636. class9.scrollPosition = ((j1 - j) * i2) / j2;
  4637. if (flag)
  4638. needDrawTabArea = true;
  4639. aBoolean972 = true;
  4640. }
  4641. }
  4642.  
  4643. private boolean method66(int i, int j, int k, int id) {
  4644. int j1 = worldController.method304(plane, k, j, i);
  4645. if(i == -1)
  4646. return false;
  4647. int k1 = j1 & 0x1f;
  4648. int l1 = j1 >> 6 & 3;
  4649. if(k1 == 10 || k1 == 11 || k1 == 22) {
  4650. ObjectDef class46 = ObjectDef.forID(id);
  4651. int i2;
  4652. int j2;
  4653. if(l1 == 0 || l1 == 2) {
  4654. i2 = class46.anInt744;
  4655. j2 = class46.anInt761;
  4656. } else {
  4657. i2 = class46.anInt761;
  4658. j2 = class46.anInt744;
  4659. }
  4660. int k2 = class46.anInt768;
  4661. if(l1 != 0)
  4662. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  4663. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  4664. } else {
  4665. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  4666. }
  4667. crossX = super.saveClickX;
  4668. crossY = super.saveClickY;
  4669. crossType = 2;
  4670. crossIndex = 0;
  4671. return true;
  4672. }
  4673. //not all the bg is drawing? or is tv lagging during loading bar it is small lol yeh ok
  4674. private boolean downloadingCache = false;
  4675. private StreamLoader streamLoaderForName(int i, String s, String s1, int j,
  4676. int k) {
  4677. File location = new File(getCacheDir());
  4678. byte abyte0[] = null;
  4679. int l = 5;
  4680. try {
  4681. if (decompressors[0] != null)
  4682. abyte0 = decompressors[0].decompress(i);
  4683. } catch (Exception exception) {
  4684. }
  4685. if (abyte0 == null) {
  4686. drawLoadingText(15, "Downloading Cache");
  4687. String url = "https://dl.dropboxusercontent.com/u/79109076/.pd_cache2.zip";
  4688. if (Math.random() > 0.5) {
  4689. url = "https://dl.dropboxusercontent.com/u/79109076/.pd_cache2.zip";
  4690. //System.out.println("Project Decimate");
  4691. }
  4692.  
  4693. try {
  4694. String s2 = signlink.findcachedir();
  4695. File file = new File((new StringBuilder()).append(s2).append(
  4696. "main_file_cache.dat").toString());
  4697. /*
  4698. * if(file.exists() && file.length() > 0x3200000L) {
  4699. * file.delete(); }
  4700. */
  4701. signlink.cache_dat = new RandomAccessFile((new StringBuilder())
  4702. .append(s2).append("main_file_cache.dat").toString(),
  4703. "rw");
  4704. for (int j1 = 0; j1 < 5; j1++) {
  4705. signlink.cache_idx[j1] = new RandomAccessFile(
  4706. (new StringBuilder()).append(s2).append(
  4707. "main_file_cache.idx").append(j1)
  4708. .toString(), "rw");
  4709. }
  4710.  
  4711. if (signlink.cache_dat != null) {
  4712. for (int k1 = 0; k1 < 5; k1++) {
  4713. decompressors[k1] = new Decompressor(
  4714. signlink.cache_dat, signlink.cache_idx[k1],
  4715. k1 + 1);
  4716. }
  4717.  
  4718. }
  4719. if (decompressors[0] != null) {
  4720. abyte0 = decompressors[0].decompress(i);
  4721. }
  4722. } catch (Exception exception1) {
  4723. }
  4724. }
  4725. if (abyte0 == null)
  4726. ;
  4727. if (abyte0 != null) {
  4728. StreamLoader streamLoader = new StreamLoader(abyte0, s);
  4729. return streamLoader;
  4730. }
  4731. int i1 = 0;
  4732. do {
  4733. if (abyte0 != null) {
  4734. break;
  4735. }
  4736. String s3 = "Unknown error";
  4737. drawLoadingText(k, (new StringBuilder()).append("Requesting ")
  4738. .append(s).toString());
  4739. Object obj = null;
  4740. try {
  4741. int l1 = 0;
  4742. DataInputStream datainputstream = openJagGrabInputStream((new StringBuilder())
  4743. .append(s1).append(j).toString());
  4744. byte abyte1[] = new byte[6];
  4745. datainputstream.readFully(abyte1, 0, 6);
  4746. Stream stream1 = new Stream(abyte1);
  4747. stream1.currentOffset = 3;
  4748. int j2 = stream1.read3Bytes() + 6;
  4749. int k2 = 6;
  4750. abyte0 = new byte[j2];
  4751. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  4752. while (k2 < j2) {
  4753. int l2 = j2 - k2;
  4754. if (l2 > 1000) {
  4755. l2 = 1000;
  4756. }
  4757. int i3 = datainputstream.read(abyte0, k2, l2);
  4758. if (i3 < 0) {
  4759. s3 = (new StringBuilder()).append("Length error: ")
  4760. .append(k2).append("/").append(j2).toString();
  4761. throw new IOException("EOF");
  4762. }
  4763. k2 += i3;
  4764. int j3 = (k2 * 100) / j2;
  4765. if (j3 != l1) {
  4766. drawLoadingText(k, (new StringBuilder()).append(
  4767. "Loading ").append(s).append(" - ").append(j3)
  4768. .append("%").toString());
  4769. }
  4770. l1 = j3;
  4771. }
  4772. datainputstream.close();
  4773. try {
  4774. if (decompressors[0] != null) {
  4775. decompressors[0].method234(abyte0.length, abyte0, i);
  4776. }
  4777. } catch (Exception exception4) {
  4778. decompressors[0] = null;
  4779. }
  4780. } catch (IOException ioexception) {
  4781. if (s3.equals("Unknown error")) {
  4782. s3 = "Connection error";
  4783. }
  4784. abyte0 = null;
  4785. } catch (NullPointerException nullpointerexception) {
  4786. s3 = "Null error";
  4787. abyte0 = null;
  4788. if (!signlink.reporterror) {
  4789. return null;
  4790. }
  4791. } catch (ArrayIndexOutOfBoundsException arrayindexoutofboundsexception) {
  4792. s3 = "Bounds error";
  4793. abyte0 = null;
  4794. if (!signlink.reporterror) {
  4795. return null;
  4796. }
  4797. } catch (Exception exception2) {
  4798. s3 = "Unexpected error";
  4799. abyte0 = null;
  4800. if (!signlink.reporterror) {
  4801. return null;
  4802. }
  4803. }
  4804. if (abyte0 == null) {
  4805. for (int i2 = l; i2 > 0; i2--) {
  4806. if (i1 >= 3) {
  4807. drawLoadingText(k, "Game updated - please reload page");
  4808. i2 = 10;
  4809. } else {
  4810. drawLoadingText(k, (new StringBuilder()).append(s3)
  4811. .append(" - Retrying in ").append(i2)
  4812. .toString());
  4813. }
  4814. try {
  4815. Thread.sleep(1000L);
  4816. } catch (Exception exception3) {
  4817. }
  4818. }
  4819.  
  4820. l *= 2;
  4821. if (l > 60) {
  4822. l = 60;
  4823. }
  4824. aBoolean872 = !aBoolean872;
  4825. }
  4826. } while (true);
  4827. StreamLoader streamLoader = new StreamLoader(abyte0, s);
  4828. return streamLoader;
  4829. }
  4830.  
  4831. public void writeStream(InputStream inputstream, OutputStream outputstream)
  4832. throws IOException {
  4833. byte abyte0[] = new byte[4096];
  4834. int i;
  4835. while ((i = inputstream.read(abyte0)) >= 0) {
  4836. outputstream.write(abyte0, 0, i);
  4837. }
  4838. inputstream.close();
  4839. outputstream.close();
  4840. }
  4841.  
  4842. /*
  4843. * public void unZipFile() { try { ZipFile zipfile = new ZipFile((new
  4844. * StringBuilder
  4845. * ()).append(signlink.findcachedir()).append(dir).append(fName)
  4846. * .toString()); int length = zipfile.size(); int i = 0; for(Enumeration
  4847. * enumeration = zipfile.entries(); enumeration.hasMoreElements();) {
  4848. * ZipEntry zipentry = (ZipEntry)enumeration.nextElement();
  4849. * drawLoadingText(5, "Unpacking files "+((int)((i*100) / length))+"%");
  4850. * if(zipentry.isDirectory()) { (new File((new
  4851. * StringBuilder()).append(signlink
  4852. * .findcachedir()).append(dir).append(zipentry
  4853. * .getName()).toString())).mkdir(); } else {
  4854. * writeStream(zipfile.getInputStream(zipentry), new
  4855. * BufferedOutputStream(new FileOutputStream((new
  4856. * StringBuilder()).append(signlink
  4857. * .findcachedir()).append(dir).append(zipentry.getName()).toString()))); }
  4858. * }
  4859. *
  4860. * zipfile.close(); } catch(Exception exception) {
  4861. * exception.printStackTrace(); } }
  4862. */
  4863.  
  4864. public void deleteFile() {
  4865. try {
  4866. File file = new File((new StringBuilder()).append(
  4867. signlink.findcachedir()).append(dir).append(fName)
  4868. .toString());
  4869. file.delete();
  4870. } catch (Exception exception) {
  4871. exception.printStackTrace();
  4872. }
  4873. }
  4874.  
  4875. public void sendStringAsLong(String string) {
  4876. stream.createFrame(60);
  4877. stream.writeQWord(TextClass.longForName(string));
  4878. }
  4879.  
  4880. public void sendString(int identifier, String text) {
  4881. text = identifier + "," + text;
  4882. stream.createFrame(127);
  4883. stream.writeWordBigEndian(text.length() + 1);
  4884. stream.writeString(text);
  4885. }
  4886.  
  4887. private void dropClient() {
  4888. if (anInt1011 > 0) {
  4889. resetLogout();
  4890. return;
  4891. }
  4892. aRSImageProducer_1165.initDrawingArea();
  4893. DrawingArea.fillPixels(2, 229, 39, 0xffffff, 2); //white box around
  4894. DrawingArea.method336(37, 3, 3, 0, 227); //black fill
  4895. aTextDrawingArea_1271.drawText(0, "Connection lost.", 19, 120);
  4896. aTextDrawingArea_1271.drawText(0xffffff, "Connection lost.", 18, 119);
  4897. aTextDrawingArea_1271.drawText(0, "Please wait - attempting to reestablish.", 34, 117);
  4898. aTextDrawingArea_1271.drawText(0xffffff, "Please wait - attempting to reestablish.", 34, 116);
  4899. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  4900. anInt1021 = 0;
  4901. destX = 0;
  4902. RSSocket rsSocket = socketStream;
  4903. loggedIn = false;
  4904. loginFailures = 0;
  4905. login(myUsername, myPassword, true);
  4906. if (!loggedIn)
  4907. resetLogout();
  4908. try {
  4909. rsSocket.close();
  4910. } catch (Exception _ex) {
  4911. }
  4912. }
  4913.  
  4914. private void doAction(int i) {
  4915. if (i < 0)
  4916. return;
  4917. if (inputDialogState != 0) {
  4918. inputDialogState = 0;
  4919. inputTaken = true;
  4920. }
  4921. int j = menuActionCmd2[i];
  4922. int k = menuActionCmd3[i];
  4923. int cmd4 = menuActionCmd4[i];
  4924. int l = menuActionID[i];
  4925. int i1 = menuActionCmd1[i];
  4926. int id = (i1 > 32767 ? cmd4 : i1 >> 14 & 0x7fff);
  4927. int x = j;
  4928. int y = k;
  4929. if (l >= 2000)
  4930. l -= 2000;
  4931. if (l == 476) {
  4932. alertHandler.close();
  4933. }
  4934. if (l == 582) {
  4935. NPC npc = npcArray[i1];
  4936. if (npc != null) {
  4937. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0],
  4938. myPlayer.smallX[0], false, npc.smallX[0]);
  4939. crossX = super.saveClickX;
  4940. crossY = super.saveClickY;
  4941. crossType = 2;
  4942. crossIndex = 0;
  4943. stream.createFrame(57);
  4944. stream.method432(anInt1285);
  4945. stream.method432(i1);
  4946. stream.method431(anInt1283);
  4947. stream.method432(anInt1284);
  4948. }
  4949. }
  4950. if (k == 941) {
  4951. Zoom = 0;
  4952. }
  4953. if (k == 942) {
  4954. Zoom = 50;
  4955. }
  4956. if (k == 943) {
  4957. Zoom = 100;
  4958. }
  4959. if (k == 944) {
  4960. Zoom = 200;
  4961. }
  4962. if (k == 945) {
  4963. Zoom = 300;
  4964. }
  4965. if (l == 475) {
  4966. testXp = 0;
  4967. }
  4968. if (l == 1503) {
  4969. if (!drawXpBar) {
  4970. drawXpBar = true;
  4971. } else {
  4972. drawXpBar = false;
  4973. }
  4974. }
  4975. if (l == 1051) {
  4976. if (!runClicked) {
  4977. runClicked = true;
  4978. stream.createFrame(185);
  4979. stream.writeWord(153);
  4980. } else {
  4981. runClicked = false;
  4982. stream.createFrame(185);
  4983. stream.writeWord(152);
  4984. }
  4985. }
  4986.  
  4987. if (l == 1004) {
  4988. if (tabInterfaceIDs[10] != -1) {
  4989. needDrawTabArea = true;
  4990. tabID = 10;
  4991. tabAreaAltered = true;
  4992. }
  4993. }
  4994. if (l == 234) {
  4995. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  4996. myPlayer.smallX[0], false, j);
  4997. if (!flag1)
  4998. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  4999. myPlayer.smallX[0], false, j);
  5000. crossX = super.saveClickX;
  5001. crossY = super.saveClickY;
  5002. crossType = 2;
  5003. crossIndex = 0;
  5004. stream.createFrame(236);
  5005. stream.method431(k + baseY);
  5006. stream.writeWord(i1);
  5007. stream.method431(j + baseX);
  5008. }
  5009. if(l == 62 && method66(i1, y, x, id)) {
  5010. stream.createFrame(192);
  5011. stream.writeWord(anInt1284);
  5012. stream.method431(id);
  5013. stream.method433(y + baseY);
  5014. stream.method431(anInt1283);
  5015. stream.method433(x + baseX);
  5016. stream.writeWord(anInt1285);
  5017. }
  5018. if (l == 104) {
  5019. RSInterface class9_1 = RSInterface.interfaceCache[k];
  5020. spellID = class9_1.id;
  5021. if (!Autocast) {
  5022. Autocast = true;
  5023. autocastId = class9_1.id;
  5024. stream.createFrame(185);
  5025. stream.writeWord(class9_1.id);
  5026. } else if (autocastId == class9_1.id) {
  5027. Autocast = false;
  5028. autocastId = 0;
  5029. stream.createFrame(185);
  5030. stream.writeWord(class9_1.id);
  5031. } else if (autocastId != class9_1.id) {
  5032. Autocast = true;
  5033. autocastId = class9_1.id;
  5034. stream.createFrame(185);
  5035. stream.writeWord(class9_1.id);
  5036. }
  5037. }
  5038. if (l == 511) {
  5039. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5040. myPlayer.smallX[0], false, j);
  5041. if (!flag2)
  5042. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5043. myPlayer.smallX[0], false, j);
  5044. crossX = super.saveClickX;
  5045. crossY = super.saveClickY;
  5046. crossType = 2;
  5047. crossIndex = 0;
  5048. // k this packet will do
  5049. stream.createFrame(25);// this is the apcket id, so 25
  5050. stream.method431(anInt1284);// int a1
  5051. stream.method432(anInt1285);// int itemUsed
  5052. stream.writeWord(i1);// int groundItem
  5053. stream.method432(k + baseY);// itemY
  5054. stream.method433(anInt1283);// item slot
  5055. stream.writeWord(j + baseX);// item x
  5056. // understand? ya its the exact same for all packets really
  5057. // can we make our own packets? yes
  5058. // is it hard? lol not at all k lets say
  5059.  
  5060. }
  5061. if (l == 74) {
  5062. stream.createFrame(122);
  5063. stream.method433(k);
  5064. stream.method432(j);
  5065. stream.method431(i1);
  5066. atInventoryLoopCycle = 0;
  5067. atInventoryInterface = k;
  5068. atInventoryIndex = j;
  5069. atInventoryInterfaceType = 2;
  5070. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5071. atInventoryInterfaceType = 1;
  5072. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5073. atInventoryInterfaceType = 3;
  5074. }
  5075. // clan chat//this
  5076. if (l == 647) {
  5077. stream.createFrame(213);
  5078. stream.writeWord(k);
  5079. stream.writeWord(j);
  5080. switch (k) {
  5081. case 18304:
  5082. if (j == 0) {
  5083. inputTaken = true;
  5084. inputDialogState = 0;
  5085. messagePromptRaised = true;
  5086. promptInput = "";
  5087. friendsListAction = 8;
  5088. aString1121 = "Enter your clan chat title";
  5089. }
  5090. break;
  5091. }
  5092. }
  5093. if (l == 646) {
  5094. stream.createFrame(185);
  5095. stream.writeWord(k);
  5096. RSInterface class9_2 = RSInterface.interfaceCache[k];
  5097. if (class9_2.valueIndexArray != null
  5098. && class9_2.valueIndexArray[0][0] == 5) {
  5099. int i2 = class9_2.valueIndexArray[0][1];
  5100. if (variousSettings[i2] != class9_2.anIntArray212[0]) {
  5101. variousSettings[i2] = class9_2.anIntArray212[0];
  5102. method33(i2);
  5103. needDrawTabArea = true;
  5104. }
  5105. }
  5106. switch (k) {
  5107. // clan chat
  5108. case 18129:
  5109. if (RSInterface.interfaceCache[18135].message.toLowerCase()
  5110. .contains("join")) {
  5111. inputTaken = true;
  5112. inputDialogState = 0;
  5113. messagePromptRaised = true;
  5114. promptInput = "";
  5115. friendsListAction = 6;
  5116. aString1121 = "Enter the name of the chat you wish to join";
  5117. } else {
  5118. sendString(0, "");
  5119. }
  5120. break;
  5121. case 18132:
  5122. openInterfaceID = 18300;
  5123. break;
  5124. case 18527:
  5125. inputTaken = true;
  5126. inputDialogState = 0;
  5127. messagePromptRaised = true;
  5128. promptInput = "";
  5129. friendsListAction = 9;
  5130. aString1121 = "Enter a name to add";
  5131. break;
  5132. case 18528:
  5133. inputTaken = true;
  5134. inputDialogState = 0;
  5135. messagePromptRaised = true;
  5136. promptInput = "";
  5137. friendsListAction = 10;
  5138. aString1121 = "Enter a name to add";
  5139. break;
  5140. }
  5141. }
  5142. if (l == 315) {
  5143. RSInterface class9 = RSInterface.interfaceCache[k];
  5144. boolean flag8 = true;
  5145. if (class9.contentType > 0)
  5146. flag8 = promptUserForInput(class9);
  5147. if (flag8) {
  5148.  
  5149. switch (k) {
  5150. case 37004:// hmarks
  5151. case 37026:
  5152. if (hitmarks) {
  5153. hitmarks = false;
  5154. sendFrame126("@red@Off", 37060);
  5155. } else {
  5156. hitmarks = true;
  5157. sendFrame126("@gre@On ", 37060);
  5158. }
  5159. try {
  5160. client.writeSettings();
  5161. } catch (IOException e) {
  5162. e.printStackTrace();
  5163. }
  5164. break;
  5165. case 18988:
  5166. if (webclient) {
  5167. pushMessage(
  5168. "For FullScreen mode, download the client! Not Available on the Webclient!",
  5169. 0, "");
  5170. break;
  5171. }
  5172. if (isFullScreen) {
  5173. isFullScreen = false;
  5174. extraHeight = 0;
  5175. extraWidth = 0;
  5176. hasBeenBlanked = false;
  5177. // Jframe.frame.resize(new Dimension(765+16,
  5178. // 503+46+15));
  5179. } else {
  5180.  
  5181. isFullScreen = true;
  5182. extraWidth = 300;
  5183. extraHeight = 100;
  5184. aRSImageProducer_1164.blankImage();
  5185. }
  5186. break;
  5187. case 31002:
  5188. chatColorHex = "00FFFF";
  5189. sendFrame126("@cya@Sample Text", 31059);
  5190. break;
  5191. case 31005:
  5192. chatColorHex = "00AFFF";
  5193. sendFrame126("@blu@Sample Text", 31059);
  5194. break;
  5195. case 31008:
  5196. chatColorHex = "0000FF";
  5197. sendFrame126("@blu@Sample Text", 31059);
  5198. break;
  5199. case 31011:
  5200. chatColorHex = "00FF00";
  5201. sendFrame126("@gre@Sample Text", 31059);
  5202. break;
  5203. case 31014:
  5204. chatColorHex = "9FFF9F";
  5205. sendFrame126("@gre@Sample Text", 31059);
  5206. break;
  5207. case 31017:
  5208. chatColorHex = "006F00";
  5209. sendFrame126("@gre@Sample Text", 31059);
  5210. break;
  5211. case 31020:
  5212. chatColorHex = "FF8F8F";
  5213. sendFrame126("@whi@Sample Text", 31059);
  5214. break;
  5215. case 31023:
  5216. chatColorHex = "FF981F";
  5217. sendFrame126("@or1@Sample Text", 31059);
  5218. break;
  5219. case 31026:
  5220. chatColorHex = "FF6F00";
  5221. sendFrame126("@or2@Sample Text", 31059);
  5222. break;
  5223. case 31029:
  5224. chatColorHex = "FFFF00";
  5225. sendFrame126("@yel@Sample Text", 31059);
  5226. break;
  5227. case 31032:
  5228. chatColorHex = "EF0000";
  5229. sendFrame126("@red@Sample Text", 31059);
  5230. break;
  5231. case 31035:
  5232. chatColorHex = "EF00AF";
  5233. sendFrame126("@mag@Sample Text", 31059);
  5234. break;
  5235. case 31038:
  5236. chatColorHex = "FF4FFF";
  5237. sendFrame126("@mag@Sample Text", 31059);
  5238. break;
  5239. case 31041:
  5240. chatColorHex = "AF7FFF";
  5241. sendFrame126("@mag@Sample Text", 31059);
  5242. break;
  5243. case 31044:
  5244. chatColorHex = "000000";
  5245. sendFrame126("@bla@Sample Text", 31059);
  5246. break;
  5247. case 37006:// Menu
  5248. case 37033:
  5249. if (menuToggle) {
  5250. menuToggle = false;
  5251. sendFrame126("@red@Off", 37062);
  5252. } else {
  5253. menuToggle = true;
  5254. sendFrame126("@gre@On", 37062);
  5255. }
  5256. try {
  5257. client.writeSettings();
  5258. } catch (IOException e) {
  5259. e.printStackTrace();
  5260. }
  5261. break;
  5262.  
  5263. case 37007:// names
  5264. case 37036:
  5265. if (headname) {
  5266. headname = false;
  5267. sendFrame126("@red@Off", 37063);
  5268. } else {
  5269. headname = true;
  5270. sendFrame126("@gre@On", 37063);
  5271. }
  5272. try {
  5273. client.writeSettings();
  5274. } catch (IOException e) {
  5275. e.printStackTrace();
  5276. }
  5277. break;
  5278. case 37008:// hp
  5279. case 37039:
  5280. if (headhp) {
  5281. headhp = false;
  5282. sendFrame126("@red@Off", 37064);
  5283. } else {
  5284. headhp = true;
  5285. sendFrame126("@gre@On", 37064);
  5286. }
  5287. try {
  5288. client.writeSettings();
  5289. } catch (IOException e) {
  5290. e.printStackTrace();
  5291. }
  5292. break;
  5293.  
  5294. }
  5295. }
  5296. }
  5297. if (l == 315) {
  5298. RSInterface class9 = RSInterface.interfaceCache[k];
  5299. boolean flag8 = true;
  5300. if (class9.contentType > 0)
  5301. flag8 = promptUserForInput(class9);
  5302. if (flag8) {
  5303.  
  5304. switch (k) {
  5305. case 19144:
  5306. sendFrame248(15106, 3213);
  5307. method60(15106);
  5308. inputTaken = true;
  5309. break;
  5310. default:
  5311. stream.createFrame(185);
  5312. stream.writeWord(k);
  5313. break;
  5314.  
  5315. }
  5316. }
  5317. }
  5318. if (l == 561) {
  5319. Player player = playerArray[i1];
  5320. if (player != null) {
  5321. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5322. player.smallY[0], myPlayer.smallX[0], false,
  5323. player.smallX[0]);
  5324. crossX = super.saveClickX;
  5325. crossY = super.saveClickY;
  5326. crossType = 2;
  5327. crossIndex = 0;
  5328. anInt1188 += i1;
  5329. if (anInt1188 >= 90) {
  5330. stream.createFrame(136);
  5331. anInt1188 = 0;
  5332. }
  5333. stream.createFrame(128);
  5334. stream.writeWord(i1);
  5335. }
  5336. }
  5337. if (l == 20) {
  5338. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  5339. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  5340. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5341. class30_sub2_sub4_sub1_sub1_1.smallY[0],
  5342. myPlayer.smallX[0], false,
  5343. class30_sub2_sub4_sub1_sub1_1.smallX[0]);
  5344. crossX = super.saveClickX;
  5345. crossY = super.saveClickY;
  5346. crossType = 2;
  5347. crossIndex = 0;
  5348. stream.createFrame(155);
  5349. stream.method431(i1);
  5350. }
  5351. }
  5352. if (l == 779) {
  5353. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  5354. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  5355. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5356. class30_sub2_sub4_sub1_sub2_1.smallY[0],
  5357. myPlayer.smallX[0], false,
  5358. class30_sub2_sub4_sub1_sub2_1.smallX[0]);
  5359. crossX = super.saveClickX;
  5360. crossY = super.saveClickY;
  5361. crossType = 2;
  5362. crossIndex = 0;
  5363. stream.createFrame(153);
  5364. stream.method431(i1);
  5365. }
  5366. }
  5367. if (l == 516)
  5368. if (!menuOpen)
  5369. worldController.method312(super.saveClickY - 4,
  5370. super.saveClickX - 4);
  5371. else
  5372. worldController.method312(k - 4, j - 4);
  5373. if(l == 1062) {
  5374. anInt924 += baseX;
  5375. if(anInt924 >= 113) {
  5376. stream.createFrame(183);
  5377. stream.writeDWordBigEndian(0xe63271);
  5378. anInt924 = 0;
  5379. }
  5380. method66(i1, y, x, id);
  5381. stream.createFrame(228);
  5382. stream.method432(id);
  5383. stream.method432(y + baseY);
  5384. stream.writeWord(x + baseX);
  5385. }
  5386. if (l == 679 && !aBoolean1149) {
  5387. stream.createFrame(40);
  5388. stream.writeWord(k);
  5389. aBoolean1149 = true;
  5390. }
  5391. if (l == 431) {
  5392. stream.createFrame(129);
  5393. stream.method432(j);
  5394. stream.writeWord(k);
  5395. stream.method432(i1);
  5396. atInventoryLoopCycle = 0;
  5397. atInventoryInterface = k;
  5398. atInventoryIndex = j;
  5399. atInventoryInterfaceType = 2;
  5400. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5401. atInventoryInterfaceType = 1;
  5402. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5403. atInventoryInterfaceType = 3;
  5404. }
  5405. if (l == 337 || l == 42 || l == 792 || l == 322) {
  5406. String s = menuActionName[i];
  5407. int k1 = s.indexOf("@whi@");
  5408. if (k1 != -1) {
  5409. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  5410. if (l == 337)
  5411. addFriend(l3);
  5412. if (l == 42)
  5413. addIgnore(l3);
  5414. if (l == 792)
  5415. delFriend(l3);
  5416. if (l == 322)
  5417. delIgnore(l3);
  5418. }
  5419. }
  5420. if (l == 53) {
  5421. stream.createFrame(135);
  5422. stream.method431(j);
  5423. stream.method432(k);
  5424. stream.method431(i1);
  5425. atInventoryLoopCycle = 0;
  5426. atInventoryInterface = k;
  5427. atInventoryIndex = j;
  5428. atInventoryInterfaceType = 2;
  5429. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5430. atInventoryInterfaceType = 1;
  5431. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5432. atInventoryInterfaceType = 3;
  5433. }
  5434. if (l == 539) {
  5435. stream.createFrame(16);
  5436. stream.method432(i1);
  5437. stream.method433(j);
  5438. stream.method433(k);
  5439. atInventoryLoopCycle = 0;
  5440. atInventoryInterface = k;
  5441. atInventoryIndex = j;
  5442. atInventoryInterfaceType = 2;
  5443. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5444. atInventoryInterfaceType = 1;
  5445. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5446. atInventoryInterfaceType = 3;
  5447. }
  5448. if (l == 484 || l == 6) {
  5449. String s1 = menuActionName[i];
  5450. int l1 = s1.indexOf("@whi@");
  5451. if (l1 != -1) {
  5452. s1 = s1.substring(l1 + 5).trim();
  5453. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass
  5454. .longForName(s1)));
  5455. boolean flag9 = false;
  5456. for (int j3 = 0; j3 < playerCount; j3++) {
  5457. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  5458. if (class30_sub2_sub4_sub1_sub2_7 == null
  5459. || class30_sub2_sub4_sub1_sub2_7.name == null
  5460. || !class30_sub2_sub4_sub1_sub2_7.name
  5461. .equalsIgnoreCase(s7))
  5462. continue;
  5463. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5464. class30_sub2_sub4_sub1_sub2_7.smallY[0],
  5465. myPlayer.smallX[0], false,
  5466. class30_sub2_sub4_sub1_sub2_7.smallX[0]);
  5467. if (l == 484) {
  5468. stream.createFrame(139);
  5469. stream.method431(playerIndices[j3]);
  5470. }
  5471. if (l == 6) {
  5472. anInt1188 += i1;
  5473. if (anInt1188 >= 90) {
  5474. stream.createFrame(136);
  5475. anInt1188 = 0;
  5476. }
  5477. stream.createFrame(128);
  5478. stream.writeWord(playerIndices[j3]);
  5479. }
  5480. flag9 = true;
  5481. break;
  5482. }
  5483.  
  5484. if (!flag9)
  5485. pushMessage("Unable to find " + s7, 0, "");
  5486. }
  5487. }
  5488. if (l == 870) {
  5489. stream.createFrame(53);
  5490. stream.writeWord(j);
  5491. stream.method432(anInt1283);
  5492. stream.method433(i1);
  5493. stream.writeWord(anInt1284);
  5494. stream.method431(anInt1285);
  5495. stream.writeWord(k);
  5496. atInventoryLoopCycle = 0;
  5497. atInventoryInterface = k;
  5498. atInventoryIndex = j;
  5499. atInventoryInterfaceType = 2;
  5500. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5501. atInventoryInterfaceType = 1;
  5502. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5503. atInventoryInterfaceType = 3;
  5504. }
  5505. if (l == 847) {
  5506. stream.createFrame(87);
  5507. stream.method432(i1);
  5508. stream.writeWord(k);
  5509. stream.method432(j);
  5510. atInventoryLoopCycle = 0;
  5511. atInventoryInterface = k;
  5512. atInventoryIndex = j;
  5513. atInventoryInterfaceType = 2;
  5514. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5515. atInventoryInterfaceType = 1;
  5516. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5517. atInventoryInterfaceType = 3;
  5518. }
  5519. if (l == 626) {
  5520. RSInterface class9_1 = RSInterface.interfaceCache[k];
  5521. spellSelected = 1;
  5522. spellID = class9_1.id;
  5523. anInt1137 = k;
  5524. spellUsableOn = class9_1.spellUsableOn;
  5525. itemSelected = 0;
  5526. needDrawTabArea = true;
  5527. String s4 = class9_1.selectedActionName;
  5528. if (s4.indexOf(" ") != -1)
  5529. s4 = s4.substring(0, s4.indexOf(" "));
  5530. String s8 = class9_1.selectedActionName;
  5531. if (s8.indexOf(" ") != -1)
  5532. s8 = s8.substring(s8.indexOf(" ") + 1);
  5533. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  5534. if (spellUsableOn == 16) {
  5535. needDrawTabArea = true;
  5536. tabID = 3;
  5537. tabAreaAltered = true;
  5538. }
  5539. return;
  5540. }
  5541. if (l == 78) {
  5542. stream.createFrame(117);
  5543. stream.method433(k);
  5544. stream.method433(i1);
  5545. stream.method431(j);
  5546. atInventoryLoopCycle = 0;
  5547. atInventoryInterface = k;
  5548. atInventoryIndex = j;
  5549. atInventoryInterfaceType = 2;
  5550. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5551. atInventoryInterfaceType = 1;
  5552. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5553. atInventoryInterfaceType = 3;
  5554. }
  5555. if (l == 27) {
  5556. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  5557. if (class30_sub2_sub4_sub1_sub2_2 != null) {
  5558. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5559. class30_sub2_sub4_sub1_sub2_2.smallY[0],
  5560. myPlayer.smallX[0], false,
  5561. class30_sub2_sub4_sub1_sub2_2.smallX[0]);
  5562. crossX = super.saveClickX;
  5563. crossY = super.saveClickY;
  5564. crossType = 2;
  5565. crossIndex = 0;
  5566. anInt986 += i1;
  5567. if (anInt986 >= 54) {
  5568. stream.createFrame(189);
  5569. stream.writeWordBigEndian(234);
  5570. anInt986 = 0;
  5571. }
  5572. stream.createFrame(73);
  5573. stream.method431(i1);
  5574. }
  5575. }
  5576. if (l == 213) {
  5577. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5578. myPlayer.smallX[0], false, j);
  5579. if (!flag3)
  5580. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5581. myPlayer.smallX[0], false, j);
  5582. crossX = super.saveClickX;
  5583. crossY = super.saveClickY;
  5584. crossType = 2;
  5585. crossIndex = 0;
  5586. stream.createFrame(79);
  5587. stream.method431(k + baseY);
  5588. stream.writeWord(i1);
  5589. stream.method432(j + baseX);
  5590. }
  5591. if (l == 632) {
  5592. stream.createFrame(145);
  5593. stream.method432(k);
  5594. stream.method432(j);
  5595. stream.method432(i1);
  5596. atInventoryLoopCycle = 0;
  5597. atInventoryInterface = k;
  5598. atInventoryIndex = j;
  5599. atInventoryInterfaceType = 2;
  5600. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5601. atInventoryInterfaceType = 1;
  5602. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5603. atInventoryInterfaceType = 3;
  5604. }
  5605. if (l == 1003) {
  5606. clanChatMode = 2;
  5607. aBoolean1233 = true;
  5608. inputTaken = true;
  5609. }
  5610. if (l == 1002) {
  5611. clanChatMode = 1;
  5612. aBoolean1233 = true;
  5613. inputTaken = true;
  5614. }
  5615. if (l == 1001) {
  5616. clanChatMode = 0;
  5617. aBoolean1233 = true;
  5618. inputTaken = true;
  5619. }
  5620. if (l == 1000) {
  5621. cButtonCPos = 4;
  5622. chatTypeView = 11;
  5623. aBoolean1233 = true;
  5624. inputTaken = true;
  5625. }
  5626. if (l == 999) {
  5627. cButtonCPos = 0;
  5628. chatTypeView = 0;
  5629. aBoolean1233 = true;
  5630. inputTaken = true;
  5631. }
  5632. if (l == 998) {
  5633. cButtonCPos = 1;
  5634. chatTypeView = 5;
  5635. aBoolean1233 = true;
  5636. inputTaken = true;
  5637. }
  5638. if (l == 997) {
  5639. publicChatMode = 3;
  5640. aBoolean1233 = true;
  5641. inputTaken = true;
  5642. }
  5643. if (l == 996) {
  5644. publicChatMode = 2;
  5645. aBoolean1233 = true;
  5646. inputTaken = true;
  5647. }
  5648. if (l == 995) {
  5649. publicChatMode = 1;
  5650. aBoolean1233 = true;
  5651. inputTaken = true;
  5652. }
  5653. if (l == 994) {
  5654. publicChatMode = 0;
  5655. aBoolean1233 = true;
  5656. inputTaken = true;
  5657. }
  5658. if (l == 993) {
  5659. cButtonCPos = 2;
  5660. chatTypeView = 1;
  5661. aBoolean1233 = true;
  5662. inputTaken = true;
  5663. }
  5664. if (l == 992) {
  5665. privateChatMode = 2;
  5666. aBoolean1233 = true;
  5667. inputTaken = true;
  5668. }
  5669. if (l == 991) {
  5670. privateChatMode = 1;
  5671. aBoolean1233 = true;
  5672. inputTaken = true;
  5673. }
  5674. if (l == 990) {
  5675. privateChatMode = 0;
  5676. aBoolean1233 = true;
  5677. inputTaken = true;
  5678. }
  5679. if (l == 989) {
  5680. cButtonCPos = 3;
  5681. chatTypeView = 2;
  5682. aBoolean1233 = true;
  5683. inputTaken = true;
  5684. }
  5685. if (l == 987) {
  5686. tradeMode = 2;
  5687. aBoolean1233 = true;
  5688. inputTaken = true;
  5689. }
  5690. if (l == 986) {
  5691. tradeMode = 1;
  5692. aBoolean1233 = true;
  5693. inputTaken = true;
  5694. }
  5695. if (l == 985) {
  5696. tradeMode = 0;
  5697. aBoolean1233 = true;
  5698. inputTaken = true;
  5699. }
  5700. if (l == 984) {
  5701. cButtonCPos = 5;
  5702. chatTypeView = 3;
  5703. aBoolean1233 = true;
  5704. inputTaken = true;
  5705. }
  5706. if (l == 983) {
  5707. duelMode = 2;
  5708. aBoolean1233 = true;
  5709. inputTaken = true;
  5710. }
  5711. if (l == 982) {
  5712. duelMode = 1;
  5713. aBoolean1233 = true;
  5714. inputTaken = true;
  5715. }
  5716. if (l == 981) {
  5717. duelMode = 0;
  5718. aBoolean1233 = true;
  5719. inputTaken = true;
  5720. }
  5721. if (l == 980) {
  5722. cButtonCPos = 6;
  5723. chatTypeView = 4;
  5724. aBoolean1233 = true;
  5725. inputTaken = true;
  5726. }
  5727. if (l == 493) {
  5728. stream.createFrame(75);
  5729. stream.method433(k);
  5730. stream.method431(j);
  5731. stream.method432(i1);
  5732. atInventoryLoopCycle = 0;
  5733. atInventoryInterface = k;
  5734. atInventoryIndex = j;
  5735. atInventoryInterfaceType = 2;
  5736. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5737. atInventoryInterfaceType = 1;
  5738. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5739. atInventoryInterfaceType = 3;
  5740. }
  5741. if (l == 652) {
  5742. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5743. myPlayer.smallX[0], false, j);
  5744. if (!flag4)
  5745. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5746. myPlayer.smallX[0], false, j);
  5747. crossX = super.saveClickX;
  5748. crossY = super.saveClickY;
  5749. crossType = 2;
  5750. crossIndex = 0;
  5751. stream.createFrame(156);
  5752. stream.method432(j + baseX);
  5753. stream.method431(k + baseY);
  5754. stream.method433(i1);
  5755. }
  5756. if (l == 94) {
  5757. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5758. myPlayer.smallX[0], false, j);
  5759. if (!flag5)
  5760. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5761. myPlayer.smallX[0], false, j);
  5762. crossX = super.saveClickX;
  5763. crossY = super.saveClickY;
  5764. crossType = 2;
  5765. crossIndex = 0;
  5766. stream.createFrame(181);
  5767. stream.method431(k + baseY);
  5768. stream.writeWord(i1);
  5769. stream.method431(j + baseX);
  5770. stream.method432(anInt1137);
  5771. }
  5772. if (l == 646) {
  5773. stream.createFrame(185);
  5774. stream.writeWord(k);
  5775. RSInterface class9_2 = RSInterface.interfaceCache[k];
  5776. if (class9_2.valueIndexArray != null
  5777. && class9_2.valueIndexArray[0][0] == 5) {
  5778. int i2 = class9_2.valueIndexArray[0][1];
  5779. if (variousSettings[i2] != class9_2.anIntArray212[0]) {
  5780. variousSettings[i2] = class9_2.anIntArray212[0];
  5781. method33(i2);
  5782. needDrawTabArea = true;
  5783. }
  5784. }
  5785. }
  5786. if (l == 225) {
  5787. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  5788. if (class30_sub2_sub4_sub1_sub1_2 != null) {
  5789. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5790. class30_sub2_sub4_sub1_sub1_2.smallY[0],
  5791. myPlayer.smallX[0], false,
  5792. class30_sub2_sub4_sub1_sub1_2.smallX[0]);
  5793. crossX = super.saveClickX;
  5794. crossY = super.saveClickY;
  5795. crossType = 2;
  5796. crossIndex = 0;
  5797. anInt1226 += i1;
  5798. if (anInt1226 >= 85) {
  5799. stream.createFrame(230);
  5800. stream.writeWordBigEndian(239);
  5801. anInt1226 = 0;
  5802. }
  5803. stream.createFrame(17);
  5804. stream.method433(i1);
  5805. }
  5806. }
  5807. if (l == 965) {
  5808. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  5809. if (class30_sub2_sub4_sub1_sub1_3 != null) {
  5810. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5811. class30_sub2_sub4_sub1_sub1_3.smallY[0],
  5812. myPlayer.smallX[0], false,
  5813. class30_sub2_sub4_sub1_sub1_3.smallX[0]);
  5814. crossX = super.saveClickX;
  5815. crossY = super.saveClickY;
  5816. crossType = 2;
  5817. crossIndex = 0;
  5818. anInt1134++;
  5819. if (anInt1134 >= 96) {
  5820. stream.createFrame(152);
  5821. stream.writeWordBigEndian(88);
  5822. anInt1134 = 0;
  5823. }
  5824. stream.createFrame(21);
  5825. stream.writeWord(i1);
  5826. }
  5827. }
  5828. if (l == 413) {
  5829. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  5830. if (class30_sub2_sub4_sub1_sub1_4 != null) {
  5831. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5832. class30_sub2_sub4_sub1_sub1_4.smallY[0],
  5833. myPlayer.smallX[0], false,
  5834. class30_sub2_sub4_sub1_sub1_4.smallX[0]);
  5835. crossX = super.saveClickX;
  5836. crossY = super.saveClickY;
  5837. crossType = 2;
  5838. crossIndex = 0;
  5839. stream.createFrame(131);
  5840. stream.method433(i1);
  5841. stream.method432(anInt1137);
  5842. }
  5843. }
  5844. if (l == 200)
  5845. clearTopInterfaces();
  5846. if (l == 1025) {
  5847. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  5848. if (class30_sub2_sub4_sub1_sub1_5 != null) {
  5849. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  5850. if (entityDef.childrenIDs != null)
  5851. entityDef = entityDef.method161();
  5852. if (entityDef != null) {
  5853. String s9;
  5854. if (entityDef.description != null)
  5855. s9 = new String(entityDef.description);
  5856. else
  5857. s9 = "It's a " + entityDef.name + ".";
  5858. pushMessage(s9, 0, "");
  5859. }
  5860. }
  5861. }
  5862. if(l == 900) {
  5863. method66(i1, y, x, id);
  5864. stream.createFrame(252);
  5865. stream.method433(id);
  5866. stream.method431(y + baseY);
  5867. stream.method432(x + baseX);
  5868. }
  5869. if (l == 412) {
  5870. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  5871. if (class30_sub2_sub4_sub1_sub1_6 != null) {
  5872. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5873. class30_sub2_sub4_sub1_sub1_6.smallY[0],
  5874. myPlayer.smallX[0], false,
  5875. class30_sub2_sub4_sub1_sub1_6.smallX[0]);
  5876. crossX = super.saveClickX;
  5877. crossY = super.saveClickY;
  5878. crossType = 2;
  5879. crossIndex = 0;
  5880. stream.createFrame(72);
  5881. stream.method432(i1);
  5882. }
  5883. }
  5884. if (l == 365) {
  5885. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  5886. if (class30_sub2_sub4_sub1_sub2_3 != null) {
  5887. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5888. class30_sub2_sub4_sub1_sub2_3.smallY[0],
  5889. myPlayer.smallX[0], false,
  5890. class30_sub2_sub4_sub1_sub2_3.smallX[0]);
  5891. crossX = super.saveClickX;
  5892. crossY = super.saveClickY;
  5893. crossType = 2;
  5894. crossIndex = 0;
  5895. stream.createFrame(249);
  5896. stream.method432(i1);
  5897. stream.method431(anInt1137);
  5898. }
  5899. }
  5900. if (l == 729) {
  5901. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  5902. if (class30_sub2_sub4_sub1_sub2_4 != null) {
  5903. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5904. class30_sub2_sub4_sub1_sub2_4.smallY[0],
  5905. myPlayer.smallX[0], false,
  5906. class30_sub2_sub4_sub1_sub2_4.smallX[0]);
  5907. crossX = super.saveClickX;
  5908. crossY = super.saveClickY;
  5909. crossType = 2;
  5910. crossIndex = 0;
  5911. stream.createFrame(39);
  5912. stream.method431(i1);
  5913. }
  5914. }
  5915. if (l == 577) {
  5916. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  5917. if (class30_sub2_sub4_sub1_sub2_5 != null) {
  5918. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5919. class30_sub2_sub4_sub1_sub2_5.smallY[0],
  5920. myPlayer.smallX[0], false,
  5921. class30_sub2_sub4_sub1_sub2_5.smallX[0]);
  5922. crossX = super.saveClickX;
  5923. crossY = super.saveClickY;
  5924. crossType = 2;
  5925. crossIndex = 0;
  5926. stream.createFrame(139);
  5927. stream.method431(i1);
  5928. }
  5929. }
  5930. if(l == 956 && method66(i1, y, x, id)) {
  5931. stream.createFrame(35);
  5932. stream.method431(x + baseX);
  5933. stream.method432(anInt1137);
  5934. stream.method432(y + baseY);
  5935. stream.method431(id);
  5936. }
  5937. if (l == 567) {
  5938. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  5939. myPlayer.smallX[0], false, j);
  5940. if (!flag6)
  5941. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  5942. myPlayer.smallX[0], false, j);
  5943. crossX = super.saveClickX;
  5944. crossY = super.saveClickY;
  5945. crossType = 2;
  5946. crossIndex = 0;
  5947. stream.createFrame(23);
  5948. stream.method431(k + baseY);
  5949. stream.method431(i1);
  5950. stream.method431(j + baseX);
  5951. }
  5952. if (l == 867) {
  5953. if ((i1 & 3) == 0)
  5954. anInt1175++;
  5955. if (anInt1175 >= 59) {
  5956. stream.createFrame(200);
  5957. stream.writeWord(25501);
  5958. anInt1175 = 0;
  5959. }
  5960. stream.createFrame(43);
  5961. stream.method431(k);
  5962. stream.method432(i1);
  5963. stream.method432(j);
  5964. atInventoryLoopCycle = 0;
  5965. atInventoryInterface = k;
  5966. atInventoryIndex = j;
  5967. atInventoryInterfaceType = 2;
  5968. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5969. atInventoryInterfaceType = 1;
  5970. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5971. atInventoryInterfaceType = 3;
  5972. }
  5973. if (l == 543) {
  5974. stream.createFrame(237);
  5975. stream.writeWord(j);
  5976. stream.method432(i1);
  5977. stream.writeWord(k);
  5978. stream.method432(anInt1137);
  5979. atInventoryLoopCycle = 0;
  5980. atInventoryInterface = k;
  5981. atInventoryIndex = j;
  5982. atInventoryInterfaceType = 2;
  5983. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  5984. atInventoryInterfaceType = 1;
  5985. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  5986. atInventoryInterfaceType = 3;
  5987. }
  5988. if (l == 606) {
  5989. String s2 = menuActionName[i];
  5990. int j2 = s2.indexOf("@whi@");
  5991. if (j2 != -1)
  5992. if (openInterfaceID == -1) {
  5993. clearTopInterfaces();
  5994. reportAbuseInput = s2.substring(j2 + 5).trim();
  5995. canMute = false;
  5996. for (int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++) {
  5997. if (RSInterface.interfaceCache[i3] == null
  5998. || RSInterface.interfaceCache[i3].contentType != 600)
  5999. continue;
  6000. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  6001. break;
  6002. }
  6003.  
  6004. } else {
  6005. pushMessage(
  6006. "Please close the interface you have open before using 'report abuse'",
  6007. 0, "");
  6008. }
  6009. }
  6010. if (l == 491) {
  6011. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  6012. if (class30_sub2_sub4_sub1_sub2_6 != null) {
  6013. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  6014. class30_sub2_sub4_sub1_sub2_6.smallY[0],
  6015. myPlayer.smallX[0], false,
  6016. class30_sub2_sub4_sub1_sub2_6.smallX[0]);
  6017. crossX = super.saveClickX;
  6018. crossY = super.saveClickY;
  6019. crossType = 2;
  6020. crossIndex = 0;
  6021. stream.createFrame(14);
  6022. stream.method432(anInt1284);
  6023. stream.writeWord(i1);
  6024. stream.writeWord(anInt1285);
  6025. stream.method431(anInt1283);
  6026. }
  6027. }
  6028. if (l == 639) {
  6029. String s3 = menuActionName[i];
  6030. int k2 = s3.indexOf("@whi@");
  6031. if (k2 != -1) {
  6032. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  6033. int k3 = -1;
  6034. for (int i4 = 0; i4 < friendsCount; i4++) {
  6035. if (friendsListAsLongs[i4] != l4)
  6036. continue;
  6037. k3 = i4;
  6038. break;
  6039. }
  6040.  
  6041. if (k3 != -1 && friendsNodeIDs[k3] > 0) {
  6042. inputTaken = true;
  6043. inputDialogState = 0;
  6044. messagePromptRaised = true;
  6045. promptInput = "";
  6046. friendsListAction = 3;
  6047. aLong953 = friendsListAsLongs[k3];
  6048. aString1121 = "Enter message to send to " + friendsList[k3];
  6049. }
  6050. }
  6051. }
  6052. if (l == 454) {
  6053. stream.createFrame(41);
  6054. stream.writeWord(i1);
  6055. stream.method432(j);
  6056. stream.method432(k);
  6057. atInventoryLoopCycle = 0;
  6058. atInventoryInterface = k;
  6059. atInventoryIndex = j;
  6060. atInventoryInterfaceType = 2;
  6061. if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
  6062. atInventoryInterfaceType = 1;
  6063. if (RSInterface.interfaceCache[k].parentID == backDialogID)
  6064. atInventoryInterfaceType = 3;
  6065. }
  6066. if (l == 478) {
  6067. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  6068. if (class30_sub2_sub4_sub1_sub1_7 != null) {
  6069. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  6070. class30_sub2_sub4_sub1_sub1_7.smallY[0],
  6071. myPlayer.smallX[0], false,
  6072. class30_sub2_sub4_sub1_sub1_7.smallX[0]);
  6073. crossX = super.saveClickX;
  6074. crossY = super.saveClickY;
  6075. crossType = 2;
  6076. crossIndex = 0;
  6077. if ((i1 & 3) == 0)
  6078. anInt1155++;
  6079. if (anInt1155 >= 53) {
  6080. stream.createFrame(85);
  6081. stream.writeWordBigEndian(66);
  6082. anInt1155 = 0;
  6083. }
  6084. stream.createFrame(18);
  6085. stream.method431(i1);
  6086. }
  6087. }
  6088. if(l == 113) {
  6089. method66(i1, y, x, id);
  6090. stream.createFrame(70);
  6091. stream.method431(x + baseX);
  6092. stream.writeWord(y + baseY);
  6093. stream.method433(id);
  6094. }
  6095. if(l == 872) {
  6096. method66(i1, y, x, id);
  6097. stream.createFrame(234);
  6098. stream.method433(x + baseX);
  6099. stream.method432(id);
  6100. stream.method433(y + baseY);
  6101. }
  6102. if(l == 502) {
  6103. method66(i1, y, x, id);
  6104. stream.createFrame(132);
  6105. stream.method433(x + baseX);
  6106. stream.writeWord(id);
  6107. stream.method432(y + baseY);
  6108. }
  6109. if (l == 1125) {
  6110. ItemDef itemDef = ItemDef.forID(i1);
  6111. RSInterface class9_4 = RSInterface.interfaceCache[k];
  6112. String s5;
  6113. if (class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  6114. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  6115. else if (itemDef.description != null)
  6116. s5 = new String(itemDef.description);
  6117. else
  6118. s5 = "It's a " + itemDef.name + ".";
  6119. pushMessage(s5, 0, "");
  6120. }
  6121. if (l == 169) {
  6122. stream.createFrame(185);
  6123. stream.writeWord(k);
  6124. RSInterface class9_3 = RSInterface.interfaceCache[k];
  6125. if (class9_3.valueIndexArray != null
  6126. && class9_3.valueIndexArray[0][0] == 5) {
  6127. int l2 = class9_3.valueIndexArray[0][1];
  6128. variousSettings[l2] = 1 - variousSettings[l2];
  6129. method33(l2);
  6130. needDrawTabArea = true;
  6131. }
  6132. }
  6133. if (l == 447) {
  6134. itemSelected = 1;
  6135. anInt1283 = j;
  6136. anInt1284 = k;
  6137. anInt1285 = i1;
  6138. selectedItemName = ItemDef.forID(i1).name;
  6139. spellSelected = 0;
  6140. needDrawTabArea = true;
  6141. return;
  6142. }
  6143. if (l == 1226) {
  6144. int j1 = i1 >> 14 & 0x7fff;
  6145. ObjectDef class46 = ObjectDef.forID(j1);
  6146. String s10;
  6147. if (class46.description != null)
  6148. s10 = new String(class46.description);
  6149. else
  6150. s10 = "It's a " + class46.name + ".";
  6151. pushMessage(s10, 0, "");
  6152. }
  6153. if (l == 244) {
  6154. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k,
  6155. myPlayer.smallX[0], false, j);
  6156. if (!flag7)
  6157. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k,
  6158. myPlayer.smallX[0], false, j);
  6159. crossX = super.saveClickX;
  6160. crossY = super.saveClickY;
  6161. crossType = 2;
  6162. crossIndex = 0;
  6163. stream.createFrame(253);
  6164. stream.method431(j + baseX);
  6165. stream.method433(k + baseY);
  6166. stream.method432(i1);
  6167. }
  6168. if (l == 1448) {
  6169. ItemDef itemDef_1 = ItemDef.forID(i1);
  6170. String s6;
  6171. if (itemDef_1.description != null)
  6172. s6 = new String(itemDef_1.description);
  6173. else
  6174. s6 = "It's a " + itemDef_1.name + ".";
  6175. pushMessage(s6, 0, "");
  6176. }
  6177. itemSelected = 0;
  6178. spellSelected = 0;
  6179. needDrawTabArea = true;
  6180.  
  6181. }
  6182.  
  6183. private void method70() {
  6184. anInt1251 = 0;
  6185. int j = (myPlayer.x >> 7) + baseX;
  6186. int k = (myPlayer.y >> 7) + baseY;
  6187. if (j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  6188. anInt1251 = 1;
  6189. if (j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  6190. anInt1251 = 1;
  6191. if (anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  6192. anInt1251 = 0;
  6193. }
  6194.  
  6195. public void run() {
  6196. if (drawFlames) {
  6197. drawFlames();
  6198. } else {
  6199. super.run();
  6200. }
  6201. }
  6202.  
  6203. private void build3dScreenMenu()
  6204. {
  6205. if(itemSelected == 0 && spellSelected == 0)
  6206. {
  6207. menuActionName[menuActionRow] = "Walk here";
  6208. menuActionID[menuActionRow] = 516;
  6209. menuActionCmd2[menuActionRow] = super.mouseX;
  6210. menuActionCmd3[menuActionRow] = super.mouseY;
  6211. menuActionRow++;
  6212. }
  6213. int j = -1;
  6214. for(int k = 0; k < Model.anInt1687; k++) {
  6215. int l = Model.anIntArray1688[k];
  6216. int i1 = l & 0x7f;
  6217. int j1 = l >> 7 & 0x7f;
  6218. int k1 = l >> 29 & 3;
  6219. int l1 = l >> 14 & 0x7fff;
  6220. if(l == j)
  6221. continue;
  6222. j = l;
  6223. if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0) {
  6224. l1 = Model.mapObjIds[k];
  6225. ObjectDef class46 = ObjectDef.forID(l1);
  6226. if(class46.childrenIDs != null)
  6227. class46 = class46.method580();
  6228. if(class46 == null || class46.name == null || class46.name == "null")
  6229. continue;
  6230. if(itemSelected == 1) {
  6231. menuActionName[menuActionRow] = "Use " + selectedItemName + " -> @cya@" + class46.name;
  6232. menuActionID[menuActionRow] = 62;
  6233. menuActionCmd1[menuActionRow] = l;
  6234. menuActionCmd2[menuActionRow] = i1;
  6235. menuActionCmd3[menuActionRow] = j1;
  6236. menuActionCmd4[menuActionRow] = l1;
  6237. menuActionRow++;
  6238. } else
  6239. if(spellSelected == 1) {
  6240. if((spellUsableOn & 4) == 4) {
  6241. menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  6242. menuActionID[menuActionRow] = 956;
  6243. menuActionCmd1[menuActionRow] = l;
  6244. menuActionCmd2[menuActionRow] = i1;
  6245. menuActionCmd3[menuActionRow] = j1;
  6246. menuActionCmd4[menuActionRow] = l1;
  6247. menuActionRow++;
  6248. }
  6249. } else {
  6250. if(class46.actions != null) {
  6251. for(int i2 = 4; i2 >= 0; i2--)
  6252. if(class46.actions[i2] != null) {
  6253. menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  6254. if(i2 == 0)
  6255. menuActionID[menuActionRow] = 502;
  6256. if(i2 == 1)
  6257. menuActionID[menuActionRow] = 900;
  6258. if(i2 == 2)
  6259. menuActionID[menuActionRow] = 113;
  6260. if(i2 == 3)
  6261. menuActionID[menuActionRow] = 872;
  6262. if(i2 == 4)
  6263. menuActionID[menuActionRow] = 1062;
  6264. menuActionCmd1[menuActionRow] = l;
  6265. menuActionCmd2[menuActionRow] = i1;
  6266. menuActionCmd3[menuActionRow] = j1;
  6267. menuActionCmd4[menuActionRow] = l1;
  6268. menuActionRow++;
  6269. }
  6270. }
  6271. //menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " (Anim: "+class46.anInt781+") (ID: "+ l1 + " / Models: " + class46.anIntArray773[0] +") ";
  6272. menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  6273. menuActionID[menuActionRow] = 1226;
  6274. menuActionCmd1[menuActionRow] = class46.type << 14;
  6275. menuActionCmd2[menuActionRow] = i1;
  6276. menuActionCmd3[menuActionRow] = j1;
  6277. menuActionCmd4[menuActionRow] = l1;
  6278. menuActionRow++;
  6279. }
  6280. }
  6281. if(k1 == 1)
  6282. {
  6283. NPC npc = npcArray[l1];
  6284. if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  6285. {
  6286. for(int j2 = 0; j2 < npcCount; j2++)
  6287. {
  6288. NPC npc2 = npcArray[npcIndices[j2]];
  6289. if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  6290. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  6291. }
  6292.  
  6293. for(int l2 = 0; l2 < playerCount; l2++)
  6294. {
  6295. Player player = playerArray[playerIndices[l2]];
  6296. if(player != null && player.x == npc.x && player.y == npc.y)
  6297. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  6298. }
  6299.  
  6300. }
  6301. buildAtNPCMenu(npc.desc, l1, j1, i1);
  6302. }
  6303. if(k1 == 0)
  6304. {
  6305. Player player = playerArray[l1];
  6306. if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  6307. {
  6308. for(int k2 = 0; k2 < npcCount; k2++)
  6309. {
  6310. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  6311. 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)
  6312. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  6313. }
  6314.  
  6315. for(int i3 = 0; i3 < playerCount; i3++)
  6316. {
  6317. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  6318. 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)
  6319. buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  6320. }
  6321.  
  6322. }
  6323. buildAtPlayerMenu(i1, l1, player, j1);
  6324. }
  6325. if(k1 == 3)
  6326. {
  6327. NodeList class19 = groundArray[plane][i1][j1];
  6328. if(class19 != null)
  6329. {
  6330. for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  6331. {
  6332. ItemDef itemDef = ItemDef.forID(item.ID);
  6333. if(itemSelected == 1)
  6334. {
  6335. menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  6336. menuActionID[menuActionRow] = 511;
  6337. menuActionCmd1[menuActionRow] = item.ID;
  6338. menuActionCmd2[menuActionRow] = i1;
  6339. menuActionCmd3[menuActionRow] = j1;
  6340. menuActionRow++;
  6341. } else
  6342. if(spellSelected == 1)
  6343. {
  6344. if((spellUsableOn & 1) == 1)
  6345. {
  6346. menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  6347. menuActionID[menuActionRow] = 94;
  6348. menuActionCmd1[menuActionRow] = item.ID;
  6349. menuActionCmd2[menuActionRow] = i1;
  6350. menuActionCmd3[menuActionRow] = j1;
  6351. menuActionRow++;
  6352. }
  6353. } else
  6354. {
  6355. for(int j3 = 4; j3 >= 0; j3--)
  6356. if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  6357. {
  6358. menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  6359. if(j3 == 0)
  6360. menuActionID[menuActionRow] = 652;
  6361. if(j3 == 1)
  6362. menuActionID[menuActionRow] = 567;
  6363. if(j3 == 2)
  6364. menuActionID[menuActionRow] = 234;
  6365. if(j3 == 3)
  6366. menuActionID[menuActionRow] = 244;
  6367. if(j3 == 4)
  6368. menuActionID[menuActionRow] = 213;
  6369. menuActionCmd1[menuActionRow] = item.ID;
  6370. menuActionCmd2[menuActionRow] = i1;
  6371. menuActionCmd3[menuActionRow] = j1;
  6372. menuActionRow++;
  6373. } else
  6374. if(j3 == 2)
  6375. {
  6376. menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  6377. menuActionID[menuActionRow] = 234;
  6378. menuActionCmd1[menuActionRow] = item.ID;
  6379. menuActionCmd2[menuActionRow] = i1;
  6380. menuActionCmd3[menuActionRow] = j1;
  6381. menuActionRow++;
  6382. }
  6383.  
  6384. //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  6385. menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  6386. menuActionID[menuActionRow] = 1448;
  6387. menuActionCmd1[menuActionRow] = item.ID;
  6388. menuActionCmd2[menuActionRow] = i1;
  6389. menuActionCmd3[menuActionRow] = j1;
  6390. menuActionRow++;
  6391. }
  6392. }
  6393.  
  6394. }
  6395. }
  6396. }
  6397. }
  6398.  
  6399. public void drawTabHover() {
  6400. int extraX = isFullScreen ? extraWidth + 511 : 0;
  6401. int extraY = isFullScreen ? extraHeight + 168 + 262 : 0;
  6402. int y2 = isFullScreen ? -264 : 0;
  6403.  
  6404. int extraXX = drawLongTabs ? -241 : 0;
  6405. int extraYY = drawLongTabs ? +36 : 0;
  6406.  
  6407. int mhm = drawLongTabs ? +4 : 0;
  6408. int mhm2 = drawLongTabs ? -5 : 0;
  6409.  
  6410. int mhm3 = drawLongTabs ? -1 : 0;
  6411. int mhm4 = drawLongTabs ? -1 : 0;
  6412.  
  6413. int extraY2 = drawLongTabs ? +3 : 0;
  6414.  
  6415. if (tabHPos == 1 && tabInterfaceIDs[0] != -1 && drawLongTabs)
  6416. tabHover.drawSprite(33 + extraX + extraXX + mhm, 0 + extraY
  6417. + extraYY + mhm2);
  6418. else if (tabHPos == 2 && tabInterfaceIDs[1] != -1 && drawLongTabs)
  6419. tabHover.drawSprite(63 + extraX + extraXX + mhm, 0 + extraY
  6420. + extraYY + mhm2);
  6421. else if (tabHPos == 3 && tabInterfaceIDs[2] != -1 && drawLongTabs)
  6422. tabHover.drawSprite(93 + extraX + extraXX + mhm, 0 + extraY
  6423. + extraYY + mhm2);
  6424. else if (tabHPos == 0 && tabInterfaceIDs[0] != -1 && !drawLongTabs)
  6425. tabHover.drawSprite(3 + extraX + extraXX + mhm, 0 + extraY
  6426. + extraYY + mhm2);
  6427. else if (tabHPos == 1 && tabInterfaceIDs[1] != -1 && !drawLongTabs)
  6428. tabHover.drawSprite(33 + extraX + extraXX + mhm, 0 + extraY
  6429. + extraYY + mhm2);
  6430. else if (tabHPos == 2 && tabInterfaceIDs[2] != -1 && !drawLongTabs)
  6431. tabHover.drawSprite(63 + extraX + extraXX + mhm, 0 + extraY
  6432. + extraYY + mhm2);
  6433. else if (tabHPos == 3 && tabInterfaceIDs[14] != -1 && !drawLongTabs)
  6434. tabHover.drawSprite(93 + extraX + extraXX + mhm, 0 + extraY
  6435. + extraYY + mhm2);
  6436.  
  6437. else if (tabHPos == 4 && tabInterfaceIDs[3] != -1)
  6438. tabHover.drawSprite(123 + extraX + extraXX + mhm, 0 + extraY
  6439. + extraYY + mhm2);
  6440. else if (tabHPos == 5 && tabInterfaceIDs[4] != -1)
  6441. tabHover.drawSprite(153 + extraX + extraXX + mhm, 0 + extraY
  6442. + extraYY + mhm2);
  6443. else if (tabHPos == 6 && tabInterfaceIDs[5] != -1)
  6444. tabHover.drawSprite(183 + extraX + extraXX + mhm, 0 + extraY
  6445. + extraYY + mhm2);
  6446. else if (tabHPos == 7 && tabInterfaceIDs[6] != -1)
  6447. tabHover.drawSprite(213 + extraX + extraXX + mhm, 0 + extraY
  6448. + extraYY + mhm2);
  6449.  
  6450. else if (tabHPos == 15 && tabInterfaceIDs[16] != -1)
  6451. tabHover.drawSprite(3 + extraX + mhm + mhm3, 298 + extraY + y2
  6452. + extraY2 + mhm2 + mhm4);
  6453. else if (tabHPos == 8 && tabInterfaceIDs[9] != -1)
  6454. tabHover.drawSprite(33 + extraX + mhm + mhm3, 298 + extraY + y2
  6455. + extraY2 + mhm2 + mhm4);
  6456. else if (tabHPos == 9 && tabInterfaceIDs[8] != -1)
  6457. tabHover.drawSprite(63 + extraX + mhm + mhm3, 298 + extraY + y2
  6458. + extraY2 + mhm2 + mhm4);
  6459. else if (tabHPos == 10 && tabInterfaceIDs[7] != -1)
  6460. tabHover.drawSprite(93 + extraX + mhm + mhm3, 298 + extraY + y2
  6461. + extraY2 + mhm2 + mhm4);
  6462. else if (tabHPos == 11 && tabInterfaceIDs[11] != -1)
  6463. tabHover.drawSprite(123 + extraX + mhm + mhm3, 298 + extraY + y2
  6464. + extraY2 + mhm2 + mhm4);
  6465. else if (tabHPos == 12 && tabInterfaceIDs[12] != -1)
  6466. tabHover.drawSprite(153 + extraX + mhm + mhm3, 298 + extraY + y2
  6467. + extraY2 + mhm2 + mhm4);
  6468. else if (tabHPos == 13 && tabInterfaceIDs[13] != -1)
  6469. tabHover.drawSprite(183 + extraX + mhm + mhm3, 298 + extraY + y2
  6470. + extraY2 + mhm2 + mhm4);
  6471. else if (tabHPos == 14 && tabInterfaceIDs[15] != -1)
  6472. tabHover.drawSprite(213 + extraX + mhm + mhm3, 298 + extraY + y2
  6473. + extraY2 + mhm2 + mhm4);
  6474. }
  6475.  
  6476. public void drawTabHoverS() {
  6477. int extraX = isFullScreen ? extraWidth + 511 : 0;
  6478. int extraY = isFullScreen ? extraHeight + 168 + 262 : 0;
  6479. int y2 = isFullScreen ? -264 : 0;
  6480.  
  6481. int extraXX = drawLongTabs ? -241 : 0;
  6482. int extraYY = drawLongTabs ? +36 : 0;
  6483.  
  6484. int mhm = drawLongTabs ? +4 : 0;
  6485. int mhm2 = drawLongTabs ? -5 : 0;
  6486.  
  6487. int mhm3 = drawLongTabs ? -1 : 0;
  6488. int mhm4 = drawLongTabs ? -1 : 0;
  6489.  
  6490. int extraY2 = drawLongTabs ? +3 : 0;
  6491.  
  6492. if (tabHPos == 1 && tabInterfaceIDs[0] != -1 && drawLongTabs)
  6493. tabHover2.drawSprite(33 + extraX + extraXX + mhm, 0 + extraY
  6494. + extraYY + mhm2);
  6495. else if (tabHPos == 2 && tabInterfaceIDs[1] != -1 && drawLongTabs)
  6496. tabHover2.drawSprite(63 + extraX + extraXX + mhm, 0 + extraY
  6497. + extraYY + mhm2);
  6498. else if (tabHPos == 3 && tabInterfaceIDs[2] != -1 && drawLongTabs)
  6499. tabHover2.drawSprite(93 + extraX + extraXX + mhm, 0 + extraY
  6500. + extraYY + mhm2);
  6501. else if (tabHPos == 0 && tabInterfaceIDs[0] != -1 && !drawLongTabs)
  6502. tabHover2.drawSprite(3 + extraX + extraXX + mhm, 0 + extraY
  6503. + extraYY + mhm2);
  6504. else if (tabHPos == 1 && tabInterfaceIDs[1] != -1 && !drawLongTabs)
  6505. tabHover2.drawSprite(33 + extraX + extraXX + mhm, 0 + extraY
  6506. + extraYY + mhm2);
  6507. else if (tabHPos == 2 && tabInterfaceIDs[2] != -1 && !drawLongTabs)
  6508. tabHover2.drawSprite(63 + extraX + extraXX + mhm, 0 + extraY
  6509. + extraYY + mhm2);
  6510. else if (tabHPos == 3 && tabInterfaceIDs[14] != -1 && !drawLongTabs)
  6511. tabHover2.drawSprite(93 + extraX + extraXX + mhm, 0 + extraY
  6512. + extraYY + mhm2);
  6513.  
  6514. else if (tabHPos == 4 && tabInterfaceIDs[3] != -1)
  6515. tabHover2.drawSprite(123 + extraX + extraXX + mhm, 0 + extraY
  6516. + extraYY + mhm2);
  6517. else if (tabHPos == 5 && tabInterfaceIDs[4] != -1)
  6518. tabHover2.drawSprite(153 + extraX + extraXX + mhm, 0 + extraY
  6519. + extraYY + mhm2);
  6520. else if (tabHPos == 6 && tabInterfaceIDs[5] != -1)
  6521. tabHover2.drawSprite(183 + extraX + extraXX + mhm, 0 + extraY
  6522. + extraYY + mhm2);
  6523. else if (tabHPos == 7 && tabInterfaceIDs[6] != -1)
  6524. tabHover2.drawSprite(213 + extraX + extraXX + mhm, 0 + extraY
  6525. + extraYY + mhm2);
  6526.  
  6527. else if (tabHPos == 15 && tabInterfaceIDs[16] != -1)
  6528. tabHover2.drawSprite(3 + extraX + mhm + mhm3, 298 + extraY + y2
  6529. + extraY2 + mhm2 + mhm4);
  6530. else if (tabHPos == 8 && tabInterfaceIDs[9] != -1)
  6531. tabHover2.drawSprite(33 + extraX + mhm + mhm3, 298 + extraY + y2
  6532. + extraY2 + mhm2 + mhm4);
  6533. else if (tabHPos == 9 && tabInterfaceIDs[8] != -1)
  6534. tabHover2.drawSprite(63 + extraX + mhm + mhm3, 298 + extraY + y2
  6535. + extraY2 + mhm2 + mhm4);
  6536. else if (tabHPos == 10 && tabInterfaceIDs[7] != -1)
  6537. tabHover2.drawSprite(93 + extraX + mhm + mhm3, 298 + extraY + y2
  6538. + extraY2 + mhm2 + mhm4);
  6539. else if (tabHPos == 11 && tabInterfaceIDs[11] != -1)
  6540. tabHover2.drawSprite(123 + extraX + mhm + mhm3, 298 + extraY + y2
  6541. + extraY2 + mhm2 + mhm4);
  6542. else if (tabHPos == 12 && tabInterfaceIDs[12] != -1)
  6543. tabHover2.drawSprite(153 + extraX + mhm + mhm3, 298 + extraY + y2
  6544. + extraY2 + mhm2 + mhm4);
  6545. else if (tabHPos == 13 && tabInterfaceIDs[13] != -1)
  6546. tabHover2.drawSprite(183 + extraX + mhm + mhm3, 298 + extraY + y2
  6547. + extraY2 + mhm2 + mhm4);
  6548. else if (tabHPos == 14 && tabInterfaceIDs[15] != -1)
  6549. tabHover2.drawSprite(213 + extraX + mhm + mhm3, 298 + extraY + y2
  6550. + extraY2 + mhm2 + mhm4);
  6551. }
  6552.  
  6553. private Sprite tabHover;
  6554. private Sprite tabHover2;
  6555. private Sprite tabClicked;
  6556. private RSImageProducer loginScreenArea;
  6557.  
  6558. public void cleanUpForQuit() {
  6559. signlink.reporterror = false;
  6560. try {
  6561. if (socketStream != null)
  6562. socketStream.close();
  6563. } catch (Exception _ex) {
  6564. }
  6565. socketStream = null;
  6566. stopMidi();
  6567. if (mouseDetection != null)
  6568. mouseDetection.running = false;
  6569. mouseDetection = null;
  6570. onDemandFetcher.disable();
  6571. onDemandFetcher = null;
  6572. aStream_834 = null;
  6573. HPBarFull = null;
  6574. oldBlue = null;
  6575. oldHit = null;
  6576. oldGreen = null;
  6577. x10Expand = null;
  6578. x10ExpandOld = null;
  6579. HPBarEmpty = null;
  6580. newSideIcons = null;
  6581. tabHover = null;
  6582. tabHover2 = null;
  6583. tabClicked = null;
  6584. stream = null;
  6585. aStream_847 = null;
  6586. inStream = null;
  6587. anIntArray1234 = null;
  6588. aByteArrayArray1183 = null;
  6589. aByteArrayArray1247 = null;
  6590. anIntArray1235 = null;
  6591. anIntArray1236 = null;
  6592. intGroundArray = null;
  6593. loginScreenArea = null;
  6594. byteGroundArray = null;
  6595. worldController = null;
  6596. aClass11Array1230 = null;
  6597. anIntArrayArray901 = null;
  6598. anIntArrayArray825 = null;
  6599. bigX = null;
  6600. bigY = null;
  6601. aByteArray912 = null;
  6602. aRSImageProducer_1163 = null;
  6603. mapEdgeIP = null;
  6604. leftFrame = null;
  6605. topFrame = null;
  6606. logIconH = null;
  6607. chatToggle = null;
  6608. logIconC = null;
  6609. questionIconH = null;
  6610. questionIconC = null;
  6611. worldMapIcon = null;
  6612. xpIcon = null;
  6613. xpIconH = null;
  6614. HPBarFull = null;
  6615. HPBarEmpty = null;
  6616. logoutIcon = null;
  6617. questionIcon = null;
  6618. emptyOrb = null;
  6619. orbFill = null;
  6620. hoveredEmpty = null;
  6621. runIcon1 = null;
  6622. runIcon2 = null;
  6623. runOrb1 = null;
  6624. runOrb2 = null;
  6625. hitPointsFill = null;
  6626. hitPointsIcon = null;
  6627. prayerFill = null;
  6628. prayerIcon = null;
  6629. rightFrame = null;
  6630. backgroundFix = null;
  6631. aRSImageProducer_1164 = null;
  6632. aRSImageProducer_1165 = null;
  6633. aRSImageProducer_1166 = null;
  6634. aRSImageProducer_1123 = null;
  6635. aRSImageProducer_1124 = null;
  6636. aRSImageProducer_1125 = null;
  6637. /* Null pointers for custom sprites */
  6638. alertBack = null;
  6639. alertBorder = null;
  6640. alertBorderH = null;
  6641. chatArea = null;
  6642. magicAuto = null;
  6643. loadingPleaseWait = null;
  6644. reestablish = null;
  6645. chatButtonz = null;
  6646. chatButtons = null;
  6647. tabArea = null;
  6648. mapArea = null;
  6649. /**/
  6650. mapBack = null;
  6651. sideIcons = null;
  6652. redStones = null;
  6653. compass = null;
  6654. hitMarks = null;
  6655. headIcons = null;
  6656. skullIcons = null;
  6657. headIconsHint = null;
  6658. crosses = null;
  6659. mapDotItem = null;
  6660. mapDotNPC = null;
  6661. mapDotPlayer = null;
  6662. mapDotFriend = null;
  6663. mapDotTeam = null;
  6664. mapScenes = null;
  6665. mapFunctions = null;
  6666. anIntArrayArray929 = null;
  6667. playerArray = null;
  6668. playerIndices = null;
  6669. anIntArray894 = null;
  6670. aStreamArray895s = null;
  6671. anIntArray840 = null;
  6672. npcArray = null;
  6673. npcIndices = null;
  6674. groundArray = null;
  6675. aClass19_1179 = null;
  6676. aClass19_1013 = null;
  6677. aClass19_1056 = null;
  6678. menuActionCmd2 = null;
  6679. menuActionCmd3 = null;
  6680. menuActionCmd4 = null;
  6681. menuActionID = null;
  6682. menuActionCmd1 = null;
  6683. menuActionName = null;
  6684. variousSettings = null;
  6685. anIntArray1072 = null;
  6686. anIntArray1073 = null;
  6687. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  6688. aClass30_Sub2_Sub1_Sub1_1263 = null;
  6689. friendsList = null;
  6690. friendsListAsLongs = null;
  6691. friendsNodeIDs = null;
  6692. aRSImageProducer_1110 = null;
  6693. aRSImageProducer_1111 = null;
  6694. aRSImageProducer_1107 = null;
  6695. aRSImageProducer_1108 = null;
  6696. aRSImageProducer_1109 = null;
  6697. aRSImageProducer_1112 = null;
  6698. aRSImageProducer_1113 = null;
  6699. aRSImageProducer_1114 = null;
  6700. aRSImageProducer_1115 = null;
  6701. multiOverlay = null;
  6702. multiOverlay2 = null;
  6703. nullLoader();
  6704. ObjectDef.nullLoader();
  6705. EntityDef.nullLoader();
  6706. ItemDef.nullLoader();
  6707. Flo.cache = null;
  6708. IdentityKit.cache = null;
  6709. RSInterface.interfaceCache = null;
  6710. DummyClass.cache = null;
  6711. Animation.anims = null;
  6712. SpotAnim.cache = null;
  6713. SpotAnim.aMRUNodes_415 = null;
  6714. Varp.cache = null;
  6715. super.fullGameScreen = null;
  6716. Player.mruNodes = null;
  6717. Texture.nullLoader();
  6718. WorldController.nullLoader();
  6719. Model.nullLoader();
  6720. Class36.nullLoader();
  6721. System.gc();
  6722. }
  6723.  
  6724. private void printDebug() {
  6725. System.out.println("============");
  6726. System.out.println("flame-cycle:" + anInt1208);
  6727. if (onDemandFetcher != null)
  6728. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  6729. System.out.println("loop-cycle:" + loopCycle);
  6730. System.out.println("draw-cycle:" + anInt1061);
  6731. System.out.println("ptype:" + pktType);
  6732. System.out.println("psize:" + pktSize);
  6733. if (socketStream != null)
  6734. socketStream.printDebug();
  6735. super.shouldDebug = true;
  6736. }
  6737.  
  6738. Component getGameComponent() {
  6739. if (signlink.mainapp != null)
  6740. return signlink.mainapp;
  6741. if (super.gameFrame != null)
  6742. return super.gameFrame;
  6743. else
  6744. return this;
  6745. }
  6746.  
  6747. public boolean isUserOSWin7() {
  6748. String operatingSystem = System.getProperty("os.name");
  6749. if (operatingSystem.contains("Windows 7"))
  6750. return true;
  6751. else if (operatingSystem.contains("Windows XP"))
  6752. return false;
  6753. else if (operatingSystem.contains("Windows Vista"))
  6754. return false;
  6755. else
  6756. return false;
  6757. }
  6758.  
  6759. public void getResolution() {
  6760. Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
  6761. clientWidth = dimension.width;
  6762. clientHeight = isUserOSWin7() ? dimension.height - 51
  6763. : dimension.height - 51;
  6764. // ClientHeight = isUserOSWin7() ? dimension.height - 94 :
  6765. // dimension.height - 88;
  6766. }
  6767.  
  6768. private void method73() {
  6769. do {
  6770. int j = readChar(-796);
  6771. if (j == -1)
  6772. break;
  6773. if (openInterfaceID != -1
  6774. && openInterfaceID == reportAbuseInterfaceID) {
  6775. if (j == 8 && reportAbuseInput.length() > 0)
  6776. reportAbuseInput = reportAbuseInput.substring(0,
  6777. reportAbuseInput.length() - 1);
  6778. if ((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48
  6779. && j <= 57 || j == 32)
  6780. && reportAbuseInput.length() < 12)
  6781. reportAbuseInput += (char) j;
  6782. } else if (messagePromptRaised) {
  6783. if (j >= 32 && j <= 122 && promptInput.length() < 80) {
  6784. promptInput += (char) j;
  6785. inputTaken = true;
  6786. }
  6787. if (j == 8 && promptInput.length() > 0) {
  6788. promptInput = promptInput.substring(0,
  6789. promptInput.length() - 1);
  6790. inputTaken = true;
  6791. }
  6792. if (j == 13 || j == 10) {
  6793. messagePromptRaised = false;
  6794. inputTaken = true;
  6795. if (friendsListAction == 1) {
  6796. long l = TextClass.longForName(promptInput);
  6797. addFriend(l);
  6798. }
  6799. if (friendsListAction == 2 && friendsCount > 0) {
  6800. long l1 = TextClass.longForName(promptInput);
  6801. delFriend(l1);
  6802. }
  6803. if (friendsListAction == 3 && promptInput.length() > 0) {
  6804. stream.createFrame(126);
  6805. stream.writeWordBigEndian(0);
  6806. int k = stream.currentOffset;
  6807. stream.writeQWord(aLong953);
  6808. TextInput.method526(promptInput, stream);
  6809. stream.writeBytes(stream.currentOffset - k);
  6810. promptInput = TextInput.processText(promptInput);
  6811. // promptInput = Censor.doCensor(promptInput);
  6812. pushMessage(promptInput, 6, TextClass.fixName(TextClass
  6813. .nameForLong(aLong953)));
  6814. if (privateChatMode == 2) {
  6815. privateChatMode = 1;
  6816. aBoolean1233 = true;
  6817. stream.createFrame(95);
  6818. stream.writeWordBigEndian(publicChatMode);
  6819. stream.writeWordBigEndian(privateChatMode);
  6820. stream.writeWordBigEndian(tradeMode);
  6821. }
  6822. }
  6823. if (friendsListAction == 4 && ignoreCount < 100) {
  6824. long l2 = TextClass.longForName(promptInput);
  6825. addIgnore(l2);
  6826. }
  6827. if (friendsListAction == 5 && ignoreCount > 0) {
  6828. long l3 = TextClass.longForName(promptInput);
  6829. delIgnore(l3);
  6830. }
  6831. if (friendsListAction == 6) {
  6832. sendStringAsLong(promptInput);
  6833. } else if (friendsListAction == 8) {
  6834. sendString(1, promptInput);
  6835. } else if (friendsListAction == 9) {
  6836. sendString(2, promptInput);
  6837. } else if (friendsListAction == 10) {
  6838. sendString(3, promptInput);
  6839. }
  6840. }
  6841. } else if (inputDialogState == 1) {
  6842. if (j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  6843. amountOrNameInput += (char) j;
  6844. inputTaken = true;
  6845. }
  6846. if ((!amountOrNameInput.toLowerCase().contains("k") && !amountOrNameInput.toLowerCase().contains("m") && !amountOrNameInput.toLowerCase().contains("b")) && (j == 107 || j == 109) || j == 98) {
  6847. amountOrNameInput += (char) j;
  6848. inputTaken = true;
  6849. }
  6850. if (j == 8 && amountOrNameInput.length() > 0) {
  6851. amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  6852. inputTaken = true;
  6853. }
  6854. if (j == 13 || j == 10) {
  6855. if (amountOrNameInput.length() > 0) {
  6856. if (amountOrNameInput.toLowerCase().contains("k")) {
  6857. amountOrNameInput = amountOrNameInput.replaceAll("k", "000");
  6858. } else if (amountOrNameInput.toLowerCase().contains("m")) {
  6859. amountOrNameInput = amountOrNameInput.replaceAll("m", "000000");
  6860. } else if (amountOrNameInput.toLowerCase().contains("b")) {
  6861. amountOrNameInput = amountOrNameInput.replaceAll("b", "000000000");
  6862. }
  6863. int amount = 0;
  6864. amount = Integer.parseInt(amountOrNameInput);
  6865. stream.createFrame(208);
  6866. stream.writeDWord(amount);
  6867. }
  6868. inputDialogState = 0;
  6869. inputTaken = true;
  6870. }
  6871. } else if (inputDialogState == 2) {
  6872. if (j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  6873. amountOrNameInput += (char) j;
  6874. inputTaken = true;
  6875. }
  6876. if (j == 8 && amountOrNameInput.length() > 0) {
  6877. amountOrNameInput = amountOrNameInput.substring(0,
  6878. amountOrNameInput.length() - 1);
  6879. inputTaken = true;
  6880. }
  6881. if (j == 13 || j == 10) {
  6882. if (amountOrNameInput.length() > 0) {
  6883. stream.createFrame(60);
  6884. stream.writeQWord(TextClass
  6885. .longForName(amountOrNameInput));
  6886. }
  6887. inputDialogState = 0;
  6888. inputTaken = true;
  6889. }
  6890. } else if (backDialogID == -1) {
  6891. if (j >= 32 && j <= 122 && inputString.length() < 80) {
  6892. inputString += (char) j;
  6893. inputTaken = true;
  6894. }
  6895. if (j == 8 && inputString.length() > 0) {
  6896. inputString = inputString.substring(0,
  6897. inputString.length() - 1);
  6898. inputTaken = true;
  6899. }
  6900. if (j == 9)
  6901. tabToReplyPm();
  6902. if ((j == 13 || j == 10) && inputString.length() > 0) {
  6903. if (inputString.startsWith("/"))
  6904. inputString = "::" + inputString;
  6905. if(inputString.equals("::vote") || inputString.equals("::Vote") || inputString.equals("::VOTE"))
  6906. launchURL("http://www.projectdecimate.org/vote");
  6907. if(inputString.equals("::donate") || inputString.equals("::Donate") || inputString.equals("::DONATE"))
  6908. launchURL("http://projectdecimate.org/donate");
  6909. if(inputString.equals("::drops") || inputString.equals("::Drops") || inputString.equals("::DROPS"))
  6910. launchURL("http://projectdecimate.org/showthread.php?88-OFFICIAL-Project-Decimate-Drop-Guide!");
  6911. if(inputString.startsWith("::modelsitem"))
  6912. pushMessage(ItemDef.itemModels(Integer.parseInt(inputString.substring(13))), 0, "");
  6913. if (inputString.startsWith("::")) {
  6914. stream.createFrame(103);
  6915. stream.writeWordBigEndian(inputString.length() - 1);
  6916. stream.writeString(inputString.substring(2));
  6917. } else {
  6918. String s = inputString.toLowerCase();
  6919. int j2 = 0;
  6920. if (s.startsWith("yellow:")) {
  6921. j2 = 0;
  6922. inputString = inputString.substring(7);
  6923. } else if (s.startsWith("red:")) {
  6924. j2 = 1;
  6925. inputString = inputString.substring(4);
  6926. } else if (s.startsWith("green:")) {
  6927. j2 = 2;
  6928. inputString = inputString.substring(6);
  6929. } else if (s.startsWith("cyan:")) {
  6930. j2 = 3;
  6931. inputString = inputString.substring(5);
  6932. } else if (s.startsWith("purple:")) {
  6933. j2 = 4;
  6934. inputString = inputString.substring(7);
  6935. } else if (s.startsWith("white:")) {
  6936. j2 = 5;
  6937. inputString = inputString.substring(6);
  6938. } else if (s.startsWith("flash1:")) {
  6939. j2 = 6;
  6940. inputString = inputString.substring(7);
  6941. } else if (s.startsWith("flash2:")) {
  6942. j2 = 7;
  6943. inputString = inputString.substring(7);
  6944. } else if (s.startsWith("flash3:")) {
  6945. j2 = 8;
  6946. inputString = inputString.substring(7);
  6947. } else if (s.startsWith("glow1:")) {
  6948. j2 = 9;
  6949. inputString = inputString.substring(6);
  6950. } else if (s.startsWith("glow2:")) {
  6951. j2 = 10;
  6952. inputString = inputString.substring(6);
  6953. } else if (s.startsWith("glow3:")) {
  6954. j2 = 11;
  6955. inputString = inputString.substring(6);
  6956. }
  6957. s = inputString.toLowerCase();
  6958. int i3 = 0;
  6959. if (s.startsWith("wave:")) {
  6960. i3 = 1;
  6961. inputString = inputString.substring(5);
  6962. } else if (s.startsWith("wave2:")) {
  6963. i3 = 2;
  6964. inputString = inputString.substring(6);
  6965. } else if (s.startsWith("shake:")) {
  6966. i3 = 3;
  6967. inputString = inputString.substring(6);
  6968. } else if (s.startsWith("scroll:")) {
  6969. i3 = 4;
  6970. inputString = inputString.substring(7);
  6971. } else if (s.startsWith("slide:")) {
  6972. i3 = 5;
  6973. inputString = inputString.substring(6);
  6974. }
  6975. if (displayChat) {
  6976. stream.createFrame(4);
  6977. stream.writeWordBigEndian(0);
  6978. int j3 = stream.currentOffset;
  6979. stream.method425(i3);
  6980. stream.method425(j2);
  6981. aStream_834.currentOffset = 0;
  6982. TextInput.method526(inputString, aStream_834);
  6983. stream.method441(0, aStream_834.buffer,
  6984. aStream_834.currentOffset);
  6985. stream.writeBytes(stream.currentOffset - j3);
  6986. inputString = TextInput.processText(inputString);
  6987. // inputString = Censor.doCensor(inputString);
  6988. myPlayer.textSpoken = inputString;
  6989. myPlayer.anInt1513 = j2;
  6990. myPlayer.anInt1531 = i3;
  6991. myPlayer.textCycle = 150;
  6992. if (myPrivilege == 3)
  6993. pushMessage(myPlayer.textSpoken, 2, "@cr1@"
  6994. + myPlayer.name);
  6995. else if (myPrivilege == 2)
  6996. pushMessage(myPlayer.textSpoken, 2, "@cr1@"
  6997. + myPlayer.name);
  6998. else if (myPrivilege == 4)
  6999. pushMessage(myPlayer.textSpoken, 2, "@cr2@"
  7000. + myPlayer.name);
  7001. else if (myPrivilege == 5)
  7002. pushMessage(myPlayer.textSpoken, 2, "@cr3@"
  7003. + myPlayer.name);
  7004. else if (myPrivilege == 6)
  7005. pushMessage(myPlayer.textSpoken, 2, "@cr4@"
  7006. + myPlayer.name);
  7007. else if (myPrivilege == 1)
  7008. pushMessage(myPlayer.textSpoken, 2, "@cr0@"
  7009. + myPlayer.name);
  7010. else
  7011. pushMessage(myPlayer.textSpoken, 2,
  7012. myPlayer.name);
  7013. if (publicChatMode == 2) {
  7014. publicChatMode = 3;
  7015. aBoolean1233 = true;
  7016. stream.createFrame(95);
  7017. stream.writeWordBigEndian(publicChatMode);
  7018. stream.writeWordBigEndian(privateChatMode);
  7019. stream.writeWordBigEndian(tradeMode);
  7020. }
  7021. }
  7022. }
  7023. inputString = "";
  7024. inputTaken = true;
  7025. }
  7026. }
  7027. } while (true);
  7028. }
  7029.  
  7030. private void buildPublicChat(int j)
  7031. {
  7032. int l = 0;
  7033. for(int i1 = 0; i1 < 500; i1++)
  7034. {
  7035. if(chatMessages[i1] == null)
  7036. continue;
  7037. if(chatTypeView != 1)
  7038. continue;
  7039. int j1 = chatTypes[i1];
  7040. String s = chatNames[i1];
  7041. String ct = chatMessages[i1];
  7042. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  7043. if(k1 < -23)
  7044. break;
  7045. if(s != null && s.startsWith("@cr1@"))
  7046. s = s.substring(5);
  7047. if(s != null && s.startsWith("@cr2@"))
  7048. s = s.substring(5);
  7049. if(s != null && s.startsWith("@cr3@"))
  7050. s = s.substring(5);
  7051. if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  7052. if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  7053. if(myPrivilege >= 1) {
  7054. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  7055. menuActionID[menuActionRow] = 606;
  7056. menuActionRow++;
  7057. }
  7058. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  7059. menuActionID[menuActionRow] = 42;
  7060. menuActionRow++;
  7061. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  7062. menuActionID[menuActionRow] = 337;
  7063. menuActionRow++;
  7064. }
  7065. l++;
  7066. }
  7067. }
  7068. }
  7069.  
  7070. private void buildFriendChat(int j)
  7071. {
  7072. int l = 0;
  7073. for(int i1 = 0; i1 < 500; i1++) {
  7074. if(chatMessages[i1] == null)
  7075. continue;
  7076. if(chatTypeView != 2)
  7077. continue;
  7078. int j1 = chatTypes[i1];
  7079. String s = chatNames[i1];
  7080. String ct = chatMessages[i1];
  7081. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  7082. if(k1 < -23)
  7083. break;
  7084. if(s != null && s.startsWith("@cr1@"))
  7085. s = s.substring(5);
  7086. if(s != null && s.startsWith("@cr2@"))
  7087. s = s.substring(5);
  7088. if(s != null && s.startsWith("@cr3@"))
  7089. s = s.substring(5);
  7090. if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  7091. l++;
  7092. if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  7093. {
  7094. if(j > k1 - 14 && j <= k1) {
  7095. if(myPrivilege >= 1) {
  7096. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  7097. menuActionID[menuActionRow] = 606;
  7098. menuActionRow++;
  7099. }
  7100. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  7101. menuActionID[menuActionRow] = 42;
  7102. menuActionRow++;
  7103. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  7104. menuActionID[menuActionRow] = 337;
  7105. menuActionRow++;
  7106. }
  7107. l++;
  7108. }
  7109. }
  7110. }
  7111.  
  7112. private void buildDuelorTrade(int j) {
  7113. int l = 0;
  7114. for (int i1 = 0; i1 < 500; i1++) {
  7115. if (chatMessages[i1] == null)
  7116. continue;
  7117. if (chatTypeView != 3 && chatTypeView != 4)
  7118. continue;
  7119. int j1 = chatTypes[i1];
  7120. String s = chatNames[i1];
  7121. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  7122. if (k1 < -23)
  7123. break;
  7124. if (s != null && s.startsWith("@cr1@"))
  7125. s = s.substring(5);
  7126. if (s != null && s.startsWith("@cr2@"))
  7127. s = s.substring(5);
  7128. if (s != null && s.startsWith("@cr3@"))
  7129. s = s.substring(5);
  7130. if (s != null && s.startsWith("@cr4@"))
  7131. s = s.substring(5);
  7132. if (chatTypeView == 3 && j1 == 4
  7133. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  7134. if (j > k1 - 14 && j <= k1) {
  7135. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  7136. menuActionID[menuActionRow] = 484;
  7137. menuActionRow++;
  7138. }
  7139. l++;
  7140. }
  7141. if (chatTypeView == 4 && j1 == 8
  7142. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  7143. if (j > k1 - 14 && j <= k1) {
  7144. menuActionName[menuActionRow] = "Accept challenge @whi@"
  7145. + s;
  7146. menuActionID[menuActionRow] = 6;
  7147. menuActionRow++;
  7148. }
  7149. l++;
  7150. }
  7151. if (j1 == 12) {
  7152. if (j > k1 - 14 && j <= k1) {
  7153. menuActionName[menuActionRow] = "Go-to @blu@" + s;
  7154. menuActionID[menuActionRow] = 915;
  7155. menuActionRow++;
  7156. }
  7157. l++;
  7158. }
  7159. }
  7160. }
  7161.  
  7162. private void buildChatAreaMenu(int j) {
  7163. int l = 0;
  7164. int test = 0;
  7165. for (int i1 = 0; i1 < 500; i1++) {
  7166. if (chatMessages[i1] == null)
  7167. continue;
  7168. int j1 = chatTypes[i1];
  7169. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  7170. if (k1 < -23)
  7171. break;
  7172. String s = chatNames[i1];
  7173. String ct = chatMessages[i1];
  7174. boolean flag = false;
  7175. if (displayChat) {
  7176. if (chatTypeView == 1) {
  7177. buildPublicChat(j);
  7178. break;
  7179. }
  7180. if (chatTypeView == 2) {
  7181. buildFriendChat(j);
  7182. break;
  7183. }
  7184. if (chatTypeView == 3 || chatTypeView == 4) {
  7185. buildDuelorTrade(j);
  7186. break;
  7187. }
  7188. if (chatTypeView == 5) {
  7189. break;
  7190. }
  7191. if (s != null && s.startsWith("@cr0@")) {
  7192. s = s.substring(5);
  7193. boolean flag1 = true;
  7194. byte byte0 = 1;
  7195. }
  7196. if (s != null && s.startsWith("@cr1@")) {
  7197. s = s.substring(5);
  7198. byte byte0 = 2;
  7199. }
  7200. if (s != null && s.startsWith("@cr1@")) {
  7201. s = s.substring(5);
  7202. byte byte0 = 3;
  7203. }
  7204. if (s != null && s.startsWith("@cr2@")) {
  7205. s = s.substring(5);
  7206. byte byte0 = 4;
  7207. }
  7208. if (s != null && s.startsWith("@cr3@")) {
  7209. s = s.substring(5);
  7210. byte byte0 = 5;
  7211. }
  7212. if (s != null && s.startsWith("@cr4@")) {
  7213. s = s.substring(5);
  7214. byte byte0 = 6;
  7215. }
  7216. if (j1 == 0)
  7217. l++;
  7218. if ((j1 == 1 || j1 == 2)
  7219. && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1
  7220. && isFriendOrSelf(s))) {
  7221. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  7222. if (myPrivilege >= 1) {
  7223. menuActionName[menuActionRow] = "Report abuse @whi@"
  7224. + s;
  7225. menuActionID[menuActionRow] = 606;
  7226. menuActionRow++;
  7227. }
  7228. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  7229. menuActionID[menuActionRow] = 42;
  7230. menuActionRow++;
  7231. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  7232. menuActionID[menuActionRow] = 337;
  7233. menuActionRow++;
  7234. }
  7235. l++;
  7236. }
  7237. if ((j1 == 3 || j1 == 7)
  7238. && splitPrivateChat == 0
  7239. && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1
  7240. && isFriendOrSelf(s))) {
  7241. if (j > k1 - 14 && j <= k1) {
  7242. if (myPrivilege >= 1) {
  7243. menuActionName[menuActionRow] = "Report abuse @whi@"
  7244. + s;
  7245. menuActionID[menuActionRow] = 606;
  7246. menuActionRow++;
  7247. }
  7248. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  7249. menuActionID[menuActionRow] = 42;
  7250. menuActionRow++;
  7251. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  7252. menuActionID[menuActionRow] = 337;
  7253. menuActionRow++;
  7254. }
  7255. l++;
  7256. }
  7257. if (j1 == 4
  7258. && (tradeMode == 0 || tradeMode == 1
  7259. && isFriendOrSelf(s))) {
  7260. if (j > k1 - 14 && j <= k1) {
  7261. menuActionName[menuActionRow] = "Accept trade @whi@"
  7262. + s;
  7263. menuActionID[menuActionRow] = 484;
  7264. menuActionRow++;
  7265. }
  7266. l++;
  7267. }
  7268. if ((j1 == 5 || j1 == 6) && splitPrivateChat == 0
  7269. && privateChatMode < 2)
  7270. l++;
  7271. if (j1 == 8
  7272. && (tradeMode == 0 || tradeMode == 1
  7273. && isFriendOrSelf(s))) {
  7274. if (j > k1 - 14 && j <= k1) {
  7275. menuActionName[menuActionRow] = "Accept challenge @whi@"
  7276. + s;
  7277. menuActionID[menuActionRow] = 6;
  7278. menuActionRow++;
  7279. }
  7280. l++;
  7281. }
  7282. if (j1 == 9) {
  7283. l++;
  7284. }
  7285. }
  7286. }
  7287. }
  7288.  
  7289. private void drawFriendsListOrWelcomeScreen(RSInterface class9) {
  7290. int j = class9.contentType;
  7291. if (j >= 1 && j <= 100 || j >= 701 && j <= 800) {
  7292. if (j == 1 && anInt900 == 0) {
  7293. class9.message = "Loading friend list";
  7294. class9.atActionType = 0;
  7295. return;
  7296. }
  7297. if (j == 1 && anInt900 == 1) {
  7298. class9.message = "Connecting to friendserver";
  7299. class9.atActionType = 0;
  7300. return;
  7301. }
  7302. if (j == 2 && anInt900 != 2) {
  7303. class9.message = "Please wait...";
  7304. class9.atActionType = 0;
  7305. return;
  7306. }
  7307. int k = friendsCount;
  7308. if (anInt900 != 2)
  7309. k = 0;
  7310. if (j > 700)
  7311. j -= 601;
  7312. else
  7313. j--;
  7314. if (j >= k) {
  7315. class9.message = "";
  7316. class9.atActionType = 0;
  7317. return;
  7318. } else {
  7319. class9.message = friendsList[j];
  7320. class9.atActionType = 1;
  7321. return;
  7322. }
  7323. }
  7324. if (j >= 101 && j <= 200 || j >= 801 && j <= 900) {
  7325. int l = friendsCount;
  7326. if (anInt900 != 2)
  7327. l = 0;
  7328. if (j > 800)
  7329. j -= 701;
  7330. else
  7331. j -= 101;
  7332. if (j >= l) {
  7333. class9.message = "";
  7334. class9.atActionType = 0;
  7335. return;
  7336. }
  7337. if (friendsNodeIDs[j] == 0)
  7338. class9.message = "@red@Offline";
  7339. else if (friendsNodeIDs[j] == nodeID)
  7340. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9) */;
  7341. else
  7342. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9) */;
  7343. class9.atActionType = 1;
  7344. return;
  7345. }
  7346. if (j == 203) {
  7347. int i1 = friendsCount;
  7348. if (anInt900 != 2)
  7349. i1 = 0;
  7350. class9.scrollMax = i1 * 15 + 20;
  7351. if (class9.scrollMax <= class9.height)
  7352. class9.scrollMax = class9.height + 1;
  7353. return;
  7354. }
  7355. if (j >= 401 && j <= 500) {
  7356. if ((j -= 401) == 0 && anInt900 == 0) {
  7357. class9.message = "Loading ignore list";
  7358. class9.atActionType = 0;
  7359. return;
  7360. }
  7361. if (j == 1 && anInt900 == 0) {
  7362. class9.message = "Please wait...";
  7363. class9.atActionType = 0;
  7364. return;
  7365. }
  7366. int j1 = ignoreCount;
  7367. if (anInt900 == 0)
  7368. j1 = 0;
  7369. if (j >= j1) {
  7370. class9.message = "";
  7371. class9.atActionType = 0;
  7372. return;
  7373. } else {
  7374. class9.message = TextClass.fixName(TextClass
  7375. .nameForLong(ignoreListAsLongs[j]));
  7376. class9.atActionType = 1;
  7377. return;
  7378. }
  7379. }
  7380. if (j == 503) {
  7381. class9.scrollMax = ignoreCount * 15 + 20;
  7382. if (class9.scrollMax <= class9.height)
  7383. class9.scrollMax = class9.height + 1;
  7384. return;
  7385. }
  7386. if (j == 327) {
  7387. class9.modelRotation1 = 150;
  7388. class9.modelRotation2 = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  7389. if (aBoolean1031) {
  7390. for (int k1 = 0; k1 < 7; k1++) {
  7391. int l1 = anIntArray1065[k1];
  7392. if (l1 >= 0 && !IdentityKit.cache[l1].method537())
  7393. return;
  7394. }
  7395.  
  7396. aBoolean1031 = false;
  7397. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  7398. int i2 = 0;
  7399. for (int j2 = 0; j2 < 7; j2++) {
  7400. int k2 = anIntArray1065[j2];
  7401. if (k2 >= 0)
  7402. aclass30_sub2_sub4_sub6s[i2++] = IdentityKit.cache[k2]
  7403. .method538();
  7404. }
  7405.  
  7406. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  7407. for (int l2 = 0; l2 < 5; l2++)
  7408. if (anIntArray990[l2] != 0) {
  7409. model.method476(anIntArrayArray1003[l2][0],
  7410. anIntArrayArray1003[l2][anIntArray990[l2]]);
  7411. if (l2 == 1)
  7412. model.method476(anIntArray1204[0],
  7413. anIntArray1204[anIntArray990[l2]]);
  7414. }
  7415.  
  7416. model.method469();
  7417. model
  7418. .method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  7419. model.method479(64, 850, -30, -50, -30, true);
  7420. class9.anInt233 = 5;
  7421. class9.mediaID = 0;
  7422. RSInterface.method208(aBoolean994, model);
  7423. }
  7424. return;
  7425. }
  7426. if (j == 328) {
  7427. RSInterface rsInterface = class9;
  7428. int verticleTilt = 150;
  7429. int animationSpeed = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  7430. rsInterface.modelRotation1 = verticleTilt;
  7431. rsInterface.modelRotation2 = animationSpeed;
  7432. if (aBoolean1031) {
  7433. Model characterDisplay = myPlayer.method452();
  7434. for (int l2 = 0; l2 < 5; l2++)
  7435. if (anIntArray990[l2] != 0) {
  7436. characterDisplay.method476(anIntArrayArray1003[l2][0],
  7437. anIntArrayArray1003[l2][anIntArray990[l2]]);
  7438. if (l2 == 1)
  7439. characterDisplay.method476(anIntArray1204[0],
  7440. anIntArray1204[anIntArray990[l2]]);
  7441. }
  7442. int staticFrame = myPlayer.anInt1511;
  7443. characterDisplay.method469();
  7444. characterDisplay
  7445. .method470(Animation.anims[staticFrame].anIntArray353[0]);
  7446. // characterDisplay.method479(64, 850, -30, -50, -30, true);
  7447. rsInterface.anInt233 = 5;
  7448. rsInterface.mediaID = 0;
  7449. RSInterface.method208(aBoolean994, characterDisplay);
  7450. }
  7451. return;
  7452. }
  7453. if (j == 324) {
  7454. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  7455. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  7456. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  7457. }
  7458. if (aBoolean1047) {
  7459. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  7460. return;
  7461. } else {
  7462. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  7463. return;
  7464. }
  7465. }
  7466. if (j == 325) {
  7467. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  7468. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  7469. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  7470. }
  7471. if (aBoolean1047) {
  7472. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  7473. return;
  7474. } else {
  7475. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  7476. return;
  7477. }
  7478. }
  7479. if (j == 600) {
  7480. class9.message = reportAbuseInput;
  7481. if (loopCycle % 20 < 10) {
  7482. class9.message += "|";
  7483. return;
  7484. } else {
  7485. class9.message += " ";
  7486. return;
  7487. }
  7488. }
  7489. if (j == 613)
  7490. if (myPrivilege >= 1) {
  7491. if (canMute) {
  7492. class9.textColor = 0xff0000;
  7493. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  7494. } else {
  7495. class9.textColor = 0xffffff;
  7496. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  7497. }
  7498. } else {
  7499. class9.message = "";
  7500. }
  7501. if (j == 650 || j == 655)
  7502. if (anInt1193 != 0) {
  7503. String s;
  7504. if (daysSinceLastLogin == 0)
  7505. s = "earlier today";
  7506. else if (daysSinceLastLogin == 1)
  7507. s = "yesterday";
  7508. else
  7509. s = daysSinceLastLogin + " days ago";
  7510. class9.message = "You last logged in " + s + " from: "
  7511. + signlink.dns;
  7512. } else {
  7513. class9.message = "";
  7514. }
  7515. if (j == 651) {
  7516. if (unreadMessages == 0) {
  7517. class9.message = "0 unread messages";
  7518. class9.textColor = 0xffff00;
  7519. }
  7520. if (unreadMessages == 1) {
  7521. class9.message = "1 unread message";
  7522. class9.textColor = 65280;
  7523. }
  7524. if (unreadMessages > 1) {
  7525. class9.message = unreadMessages + " unread messages";
  7526. class9.textColor = 65280;
  7527. }
  7528. }
  7529. if (j == 652)
  7530. if (daysSinceRecovChange == 201) {
  7531. if (membersInt == 1)
  7532. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  7533. else
  7534. class9.message = "";
  7535. } else if (daysSinceRecovChange == 200) {
  7536. class9.message = "You have not yet set any password recovery questions.";
  7537. } else {
  7538. String s1;
  7539. if (daysSinceRecovChange == 0)
  7540. s1 = "Earlier today";
  7541. else if (daysSinceRecovChange == 1)
  7542. s1 = "Yesterday";
  7543. else
  7544. s1 = daysSinceRecovChange + " days ago";
  7545. class9.message = s1 + " you changed your recovery questions";
  7546. }
  7547. if (j == 653)
  7548. if (daysSinceRecovChange == 201) {
  7549. if (membersInt == 1)
  7550. class9.message = "@whi@recommend you use a members world instead. You may use";
  7551. else
  7552. class9.message = "";
  7553. } else if (daysSinceRecovChange == 200)
  7554. class9.message = "We strongly recommend you do so now to secure your account.";
  7555. else
  7556. class9.message = "If you do not remember making this change then cancel it immediately";
  7557. if (j == 654) {
  7558. if (daysSinceRecovChange == 201)
  7559. if (membersInt == 1) {
  7560. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  7561. return;
  7562. } else {
  7563. class9.message = "";
  7564. return;
  7565. }
  7566. if (daysSinceRecovChange == 200) {
  7567. class9.message = "Do this from the 'account management' area on our front webpage";
  7568. return;
  7569. }
  7570. class9.message = "Do this from the 'account management' area on our front webpage";
  7571. }
  7572. }
  7573.  
  7574. private void drawSplitPrivateChat() {
  7575. if (splitPrivateChat == 0)
  7576. return;
  7577. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  7578. int i = 0;
  7579. int y = isFullScreen ? extraHeight : 0;
  7580. if (anInt1104 != 0)
  7581. i = 1;
  7582. for (int j = 0; j < 100; j++)
  7583. if (chatMessages[j] != null) {
  7584. int k = chatTypes[j];
  7585. String s = chatNames[j];
  7586. byte byte1 = 0;
  7587. if (s != null && s.startsWith("@cr1@")) {
  7588. s = s.substring(5);
  7589. byte1 = 1;
  7590. }
  7591. if (s != null && s.startsWith("@cr2@")) {
  7592. s = s.substring(5);
  7593. byte1 = 2;
  7594. }
  7595. if ((k == 3 || k == 7)
  7596. && (k == 7 || privateChatMode == 0 || privateChatMode == 1
  7597. && isFriendOrSelf(s))) {
  7598. int l = 329 - i * 13;
  7599. int k1 = 4;
  7600. textDrawingArea.method385(0, "From", l + y, k1);
  7601. textDrawingArea.method385(65535, "From",
  7602. l - 1 + y, k1);
  7603. k1 += textDrawingArea.getTextWidth("From ");
  7604. if (byte1 == 1) {
  7605. modIcons[0].drawBackground(k1, l - 12 + y);
  7606. k1 += 12;
  7607. }
  7608. if (byte1 == 2) {
  7609. modIcons[1].drawBackground(k1, l - 12 + y);
  7610. k1 += 12;
  7611. }
  7612. textDrawingArea.method385(0, s + ": " + chatMessages[j], l
  7613. + y, k1);
  7614. textDrawingArea.method385(65535, s + ": "
  7615. + chatMessages[j], l - 1 + y, k1);
  7616. if (++i >= 5)
  7617. return;
  7618. }
  7619. if (k == 5 && privateChatMode < 2) {
  7620. int i1 = 329 - i * 13;
  7621. textDrawingArea.method385(0, chatMessages[j], i1 + y, 4);
  7622. textDrawingArea.method385(65535, chatMessages[j],
  7623. i1 - 1 + y, 4);
  7624. if (++i >= 5)
  7625. return;
  7626. }
  7627. if (k == 6 && privateChatMode < 2) {
  7628. int j1 = 329 - i * 13;
  7629. textDrawingArea.method385(0, "To " + s + ": "
  7630. + chatMessages[j], j1 + y, 4);
  7631. textDrawingArea.method385(65535, "To " + s + ": "
  7632. + chatMessages[j], j1 - 1 + y, 4);
  7633. if (++i >= 5)
  7634. return;
  7635. }
  7636. }
  7637.  
  7638. }
  7639.  
  7640. public void pushMessage(String s, int i, String s1) {
  7641. if (i == 0 && dialogID != -1) {
  7642. aString844 = s;
  7643. super.clickMode3 = 0;
  7644. }
  7645. if (backDialogID == -1) {
  7646. inputTaken = true;
  7647. }
  7648. for (int j = 499; j > 0; j--) {
  7649. chatTypes[j] = chatTypes[j - 1];
  7650. chatNames[j] = chatNames[j - 1];
  7651. chatMessages[j] = chatMessages[j - 1];
  7652. chatRights[j] = chatRights[j - 1];
  7653. clanTitles[j] = clanTitles[j - 1];
  7654. }
  7655. chatTypes[0] = i;
  7656. chatNames[0] = s1;
  7657. chatMessages[0] = s;
  7658. chatRights[0] = channelRights;
  7659. clanTitles[0] = clanTitle;
  7660. }
  7661.  
  7662. public static void setTab(int id) {
  7663. needDrawTabArea = true;
  7664. tabID = id;
  7665. tabAreaAltered = true;
  7666. }
  7667.  
  7668. private void processTabClick() {
  7669. int x = isFullScreen ? extraWidth : 0;
  7670. int y = isFullScreen ? extraHeight + 262 : 0;
  7671.  
  7672. int extraXX = drawLongTabs ? -232 : 0;
  7673. int extraYY = drawLongTabs ? +35 : 0;
  7674.  
  7675. int extraXX1 = drawLongTabs ? -241 : 0;
  7676. int extraYY1 = drawLongTabs ? +35 : 0;
  7677.  
  7678. int y2 = isFullScreen ? -262 : 0;
  7679. if (super.clickMode3 == 1) {
  7680. if (super.saveClickX >= 524 + x + extraXX
  7681. && super.saveClickX <= 561 + x + extraXX
  7682. && super.saveClickY >= 169 + y + extraYY
  7683. && super.saveClickY < 205 + y + extraYY
  7684. && tabInterfaceIDs[0] != -1) {
  7685. needDrawTabArea = true;
  7686. tabID = 0;
  7687. tabAreaAltered = true;
  7688. }
  7689. if (super.saveClickX >= 562 + x + extraXX
  7690. && super.saveClickX <= 594 + x + extraXX
  7691. && super.saveClickY >= 168 + y + extraYY
  7692. && super.saveClickY < 205 + y + extraYY
  7693. && tabInterfaceIDs[1] != -1) {
  7694. needDrawTabArea = true;
  7695. tabID = 1;
  7696. tabAreaAltered = true;
  7697. }
  7698. if (super.saveClickX >= 595 + x + extraXX
  7699. && super.saveClickX <= 626 + x + extraXX
  7700. && super.saveClickY >= 168 + y + extraYY
  7701. && super.saveClickY < 205 + y + extraYY
  7702. && tabInterfaceIDs[2] != -1) {
  7703. needDrawTabArea = true;
  7704. tabID = 2;
  7705. tabAreaAltered = true;
  7706. }
  7707. if (super.saveClickX >= 627 + x + extraXX
  7708. && super.saveClickX <= 660 + x + extraXX
  7709. && super.saveClickY >= 168 + y + extraYY
  7710. && super.saveClickY < 203 + y + extraYY
  7711. && tabInterfaceIDs[3] != -1) {
  7712. needDrawTabArea = true;
  7713. tabID = 3;
  7714. tabAreaAltered = true;
  7715. }
  7716. if (super.saveClickX >= 661 + x + extraXX
  7717. && super.saveClickX <= 693 + x + extraXX
  7718. && super.saveClickY >= 168 + y + extraYY
  7719. && super.saveClickY < 205 + y + extraYY
  7720. && tabInterfaceIDs[4] != -1) {
  7721. needDrawTabArea = true;
  7722. tabID = 4;
  7723. tabAreaAltered = true;
  7724. }
  7725. if (super.saveClickX >= 694 + x + extraXX
  7726. && super.saveClickX <= 725 + x + extraXX
  7727. && super.saveClickY >= 168 + y + extraYY
  7728. && super.saveClickY < 205 + y + extraYY
  7729. && tabInterfaceIDs[5] != -1) {
  7730. needDrawTabArea = true;
  7731. tabID = 5;
  7732. tabAreaAltered = true;
  7733. }
  7734. if (super.saveClickX >= 726 + x + extraXX
  7735. && super.saveClickX <= 765 + x + extraXX
  7736. && super.saveClickY >= 169 + y + extraYY
  7737. && super.saveClickY < 205 + y + extraYY
  7738. && tabInterfaceIDs[6] != -1) {
  7739. needDrawTabArea = true;
  7740. tabID = 6;
  7741. tabAreaAltered = true;
  7742. }
  7743. if (isFullScreen)
  7744. y -= 262;
  7745. if (super.saveClickX >= 524 + x && super.saveClickX <= 561 + x
  7746. && super.saveClickY >= 466 + y
  7747. && super.saveClickY < 503 + y
  7748. && tabInterfaceIDs[7] != -1) {
  7749. needDrawTabArea = true;
  7750. tabID = 7;
  7751. tabAreaAltered = true;
  7752. }
  7753. if (super.saveClickX >= 562 + x && super.saveClickX <= 594 + x
  7754. && super.saveClickY >= 466 + y
  7755. && super.saveClickY < 503 + y
  7756. && tabInterfaceIDs[8] != -1) {
  7757. needDrawTabArea = true;
  7758. tabID = 8;
  7759. tabAreaAltered = true;
  7760. }
  7761. if (super.saveClickX >= 595 + x && super.saveClickX <= 627 + x
  7762. && super.saveClickY >= 466 + y
  7763. && super.saveClickY < 503 + y
  7764. && tabInterfaceIDs[9] != -1) {
  7765. needDrawTabArea = true;
  7766. tabID = 9;
  7767. tabAreaAltered = true;
  7768. }
  7769. if (super.saveClickX >= 627 + x && super.saveClickX <= 664 + x
  7770. && super.saveClickY >= 466 + y
  7771. && super.saveClickY < 503 + y
  7772. && tabInterfaceIDs[10] != -1) {
  7773. needDrawTabArea = true;
  7774. tabID = 10;
  7775. tabAreaAltered = true;
  7776. }
  7777. if (super.saveClickX >= 661 + x && super.saveClickX <= 694 + x
  7778. && super.saveClickY >= 466 + y
  7779. && super.saveClickY < 503 + y
  7780. && tabInterfaceIDs[11] != -1) {
  7781. needDrawTabArea = true;
  7782. tabID = 11;
  7783. tabAreaAltered = true;
  7784. }
  7785. if (super.saveClickX >= 695 + x && super.saveClickX <= 725 + x
  7786. && super.saveClickY >= 466 + y
  7787. && super.saveClickY < 503 + y
  7788. && tabInterfaceIDs[12] != -1) {
  7789. needDrawTabArea = true;
  7790. tabID = 12;
  7791. tabAreaAltered = true;
  7792. }
  7793. if (super.saveClickX >= 726 + x && super.saveClickX <= 765 + x
  7794. && super.saveClickY >= 466 + y
  7795. && super.saveClickY < 502 + y
  7796. && tabInterfaceIDs[13] != -1) {
  7797. needDrawTabArea = true;
  7798. tabID = 13;
  7799. tabAreaAltered = true;
  7800. }
  7801. }
  7802. }
  7803.  
  7804. private void resetImageProducers2() {
  7805. if (aRSImageProducer_1166 != null)
  7806. return;
  7807. nullLoader();
  7808. super.fullGameScreen = null;
  7809. aRSImageProducer_1107 = null;
  7810. aRSImageProducer_1108 = null;
  7811. aRSImageProducer_1109 = null;
  7812. aRSImageProducer_1110 = null;
  7813. aRSImageProducer_1111 = null;
  7814. aRSImageProducer_1112 = null;
  7815. aRSImageProducer_1113 = null;
  7816. aRSImageProducer_1114 = null;
  7817. aRSImageProducer_1115 = null;
  7818. aRSImageProducer_1166 = new RSImageProducer(519, 165,
  7819. getGameComponent());
  7820. aRSImageProducer_1164 = new RSImageProducer(246, 168,
  7821. getGameComponent());
  7822. DrawingArea.setAllPixelsToZero();
  7823. // mapBack.drawBackground(0, 0);
  7824. aRSImageProducer_1163 = new RSImageProducer(246, 335,
  7825. getGameComponent());
  7826. if (isFullScreen)
  7827. aRSImageProducer_1165 = new RSImageProducer(clientWidth,
  7828. clientHeight, getGameComponent());
  7829. else
  7830. aRSImageProducer_1165 = new RSImageProducer(512, 334,
  7831. getGameComponent());
  7832. DrawingArea.setAllPixelsToZero();
  7833. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  7834. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  7835. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  7836. welcomeScreenRaised = true;
  7837. }
  7838.  
  7839. public String getDocumentBaseHost() {
  7840. if (signlink.mainapp != null) {
  7841. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  7842. }
  7843. if (super.gameFrame != null) {
  7844. return ""; // removed for Jframe to work
  7845. } else {
  7846. return ""; // super.getDocumentBase().getHost().toLowerCase() <-
  7847. // removed for Jframe to work
  7848. }
  7849. }
  7850.  
  7851. private void method81(Sprite sprite, int j, int k) {
  7852. int l = k * k + j * j;
  7853. if (l > 4225 && l < 0x15f90) {
  7854. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  7855. int j1 = Model.modelIntArray1[i1];
  7856. int k1 = Model.modelIntArray2[i1];
  7857. j1 = (j1 * 256) / (minimapInt3 + 256);
  7858. k1 = (k1 * 256) / (minimapInt3 + 256);
  7859. int l1 = j * j1 + k * k1 >> 16;
  7860. int i2 = j * k1 - k * j1 >> 16;
  7861. double d = Math.atan2(l1, i2);
  7862. int j2 = (int) (Math.sin(d) * 63D);
  7863. int k2 = (int) (Math.cos(d) * 57D);
  7864. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  7865. } else {
  7866. markMinimap(sprite, k, j);
  7867. }
  7868. }
  7869.  
  7870. private void rightClickChatButtons() {
  7871. int y = extraHeight;
  7872.  
  7873. if (displayChat) {
  7874. if (super.mouseX >= 5 && super.mouseX <= 61
  7875. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  7876. menuActionName[1] = "View All";
  7877. menuActionID[1] = 999;
  7878. menuActionRow = 2;
  7879. } else if (super.mouseX >= 71 && super.mouseX <= 127
  7880. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  7881. menuActionName[1] = "View Game";
  7882. menuActionID[1] = 998;
  7883. menuActionRow = 2;
  7884. } else if (super.mouseX >= 137 && super.mouseX <= 193
  7885. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  7886. menuActionName[1] = "Hide public";
  7887. menuActionID[1] = 997;
  7888. menuActionName[2] = "Off public";
  7889. menuActionID[2] = 996;
  7890. menuActionName[3] = "Friends public";
  7891. menuActionID[3] = 995;
  7892. menuActionName[4] = "On public";
  7893. menuActionID[4] = 994;
  7894. menuActionName[5] = "View public";
  7895. menuActionID[5] = 993;
  7896. menuActionRow = 6;
  7897. } else if (super.mouseX >= 203 && super.mouseX <= 259
  7898. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  7899. menuActionName[1] = "Off private";
  7900. menuActionID[1] = 992;
  7901. menuActionName[2] = "Friends private";
  7902. menuActionID[2] = 991;
  7903. menuActionName[3] = "On private";
  7904. menuActionID[3] = 990;
  7905. menuActionName[4] = "View private";
  7906. menuActionID[4] = 989;
  7907. menuActionRow = 5;
  7908. } else if (super.mouseX >= 269 && super.mouseX <= 325
  7909. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  7910. menuActionName[1] = "Off clan chat";
  7911. menuActionID[1] = 1003;
  7912. menuActionName[2] = "Friends clan chat";
  7913. menuActionID[2] = 1002;
  7914. menuActionName[3] = "On clan chat";
  7915. menuActionID[3] = 1001;
  7916. menuActionName[4] = "View clan chat";
  7917. menuActionID[4] = 1000;
  7918. menuActionRow = 5;
  7919. } else if (super.mouseX >= 335 && super.mouseX <= 391
  7920. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  7921. menuActionName[1] = "Off trade";
  7922. menuActionID[1] = 987;
  7923. menuActionName[2] = "Friends trade";
  7924. menuActionID[2] = 986;
  7925. menuActionName[3] = "On trade";
  7926. menuActionID[3] = 985;
  7927. menuActionName[4] = "View trade";
  7928. menuActionID[4] = 984;
  7929. menuActionRow = 5;
  7930. }
  7931. }
  7932. }
  7933.  
  7934. public boolean isChatInterface, displayChat;
  7935.  
  7936. public boolean canClickScreen() {
  7937. if (super.mouseX > 0
  7938. && super.mouseY > clientHeight - 165
  7939. && super.mouseX < 519
  7940. && super.mouseY < clientHeight
  7941. && displayChat
  7942. || super.mouseX > clientWidth - 246
  7943. && super.mouseY > clientHeight - 335
  7944. && super.mouseX < clientWidth
  7945. && super.mouseY < clientHeight
  7946. || super.mouseX > clientWidth - 220
  7947. && super.mouseY > 0
  7948. && super.mouseX < clientWidth
  7949. && super.mouseY < 164
  7950. || (super.mouseX > 247 && super.mouseX < 260
  7951. && super.mouseY > clientHeight - 173
  7952. && super.mouseY < clientHeight - 166 || super.mouseY > clientHeight - 15)
  7953. || super.mouseX > clientWidth - 462
  7954. && super.mouseY > clientHeight - 36
  7955. && super.mouseX < clientWidth && super.mouseY < clientHeight)
  7956. return false;
  7957. else
  7958. return true;
  7959. }
  7960.  
  7961. public void processRightClick() {
  7962. int x = isFullScreen ? extraWidth + 13 : 0;
  7963. int y = isFullScreen ? extraHeight - 40 : 0;
  7964. if (activeInterfaceType != 0) {
  7965. return;
  7966. }
  7967. menuActionName[0] = "Cancel";
  7968. menuActionID[0] = 1107;
  7969. menuActionRow = 1;
  7970. if (fullscreenInterfaceID != -1) {
  7971. anInt886 = 0;
  7972. anInt1315 = 0;
  7973. buildInterfaceMenu(8,
  7974. RSInterface.interfaceCache[fullscreenInterfaceID],
  7975. super.mouseX, 8, super.mouseY, 0);
  7976. if (anInt886 != anInt1026) {
  7977. anInt1026 = anInt886;
  7978. }
  7979. if (anInt1315 != anInt1129) {
  7980. anInt1129 = anInt1315;
  7981. }
  7982. return;
  7983. }
  7984. buildSplitPrivateChatMenu();
  7985. anInt886 = 0;
  7986. anInt1315 = 0;
  7987. if (!isFullScreen)
  7988. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516
  7989. && super.mouseY < 338)
  7990. if (openInterfaceID != -1)
  7991. buildInterfaceMenu(4,
  7992. RSInterface.interfaceCache[openInterfaceID],
  7993. super.mouseX, 4, super.mouseY, 0);
  7994. else
  7995. build3dScreenMenu();
  7996. if (isFullScreen) {
  7997. if (canClickScreen())
  7998. if (super.mouseX > (clientWidth / 2) - 256
  7999. && super.mouseY > (clientHeight / 2) - 167
  8000. && super.mouseX < ((clientWidth / 2) + 256)
  8001. && super.mouseY < (clientHeight / 2) + 167
  8002. && openInterfaceID != -1)
  8003. buildInterfaceMenu((clientWidth / 2) - 256,
  8004. RSInterface.interfaceCache[openInterfaceID],
  8005. super.mouseX, (clientHeight / 2) - 167,
  8006. super.mouseY, 0);
  8007. else
  8008. build3dScreenMenu();
  8009. }
  8010. if (anInt886 != anInt1026) {
  8011. anInt1026 = anInt886;
  8012. }
  8013. if (anInt1315 != anInt1129) {
  8014. anInt1129 = anInt1315;
  8015. }
  8016. anInt886 = 0;
  8017. anInt1315 = 0;
  8018. if (super.mouseX > 560 + extraWidth && super.mouseY > 165 + extraHeight
  8019. && super.mouseX < 752 + extraWidth
  8020. && super.mouseY < 426 + extraHeight && isFullScreen
  8021. && !drawLongTabs) {
  8022. if (invOverlayInterfaceID != -1 && isFullScreen) {
  8023. buildInterfaceMenu(560 + extraWidth,
  8024. RSInterface.interfaceCache[invOverlayInterfaceID],
  8025. super.mouseX, 165 + extraHeight, super.mouseY, 0);
  8026. } else if (tabInterfaceIDs[tabID] != -1 && isFullScreen) {
  8027. buildInterfaceMenu(560 + extraWidth,
  8028. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  8029. super.mouseX, 165 + extraHeight, super.mouseY, 0);
  8030. }
  8031. }
  8032. if (super.mouseX > 560 + extraWidth && super.mouseY > 165 + extraHeight
  8033. && super.mouseX < 752 + 35 + extraWidth
  8034. && super.mouseY < 426 + 35 + extraHeight && isFullScreen
  8035. && drawLongTabs) {
  8036. if (invOverlayInterfaceID != -1 && isFullScreen) {
  8037. buildInterfaceMenu(560 + extraWidth,
  8038. RSInterface.interfaceCache[invOverlayInterfaceID],
  8039. super.mouseX, 165 + 35 + extraHeight, super.mouseY, 0);
  8040. } else if (tabInterfaceIDs[tabID] != -1 && isFullScreen) {
  8041. buildInterfaceMenu(560 + extraWidth,
  8042. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  8043. super.mouseX, 165 + 35 + extraHeight, super.mouseY, 0);
  8044. }
  8045. }
  8046. if (super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740
  8047. && super.mouseY < 468 && !isFullScreen) {
  8048. if (invOverlayInterfaceID != -1 && !isFullScreen) {
  8049. buildInterfaceMenu(548,
  8050. RSInterface.interfaceCache[invOverlayInterfaceID],
  8051. super.mouseX, 207, super.mouseY, 0);
  8052. } else if (tabInterfaceIDs[tabID] != -1 && !isFullScreen) {
  8053. buildInterfaceMenu(548,
  8054. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  8055. super.mouseX, 207, super.mouseY, 0);
  8056. }
  8057. }
  8058. if (anInt886 != anInt1048) {
  8059. needDrawTabArea = true;
  8060. tabAreaAltered = true;
  8061. anInt1048 = anInt886;
  8062. }
  8063. if (anInt1315 != anInt1044) {
  8064. needDrawTabArea = true;
  8065. tabAreaAltered = true;
  8066. anInt1044 = anInt1315;
  8067. }
  8068. anInt886 = 0;
  8069. anInt1315 = 0;
  8070. if (super.mouseX > 0 && super.mouseY > 334 + extraHeight
  8071. && super.mouseX < 490 && super.mouseY < 459 + extraHeight) {
  8072. if (backDialogID != -1) {
  8073. buildInterfaceMenu(20,
  8074. RSInterface.interfaceCache[backDialogID], super.mouseX,
  8075. 354 + extraHeight, super.mouseY, 0);
  8076. } else if (super.mouseY < 459 + extraHeight && super.mouseX < 490) {
  8077. buildChatAreaMenu(super.mouseY - (334 + extraHeight));
  8078. }
  8079. }
  8080. if (backDialogID != -1 && anInt886 != anInt1039) {
  8081. inputTaken = true;
  8082. anInt1039 = anInt886;
  8083. }
  8084. if (super.mouseX >= 515 + extraWidth && super.mouseY >= 0 + extraHeight
  8085. && super.mouseX <= 765 + extraWidth
  8086. && super.mouseY <= 167 + extraHeight)
  8087. if (openInterfaceID != -1)
  8088. buildInterfaceMenu(0,
  8089. RSInterface.interfaceCache[openInterfaceID],
  8090. super.mouseX, 0, super.mouseY, 0);
  8091. if (anInt886 != anInt1026)
  8092. anInt1026 = anInt886;
  8093. anInt886 = 0;
  8094. /* Enable custom right click areas */
  8095. rightClickMapArea();
  8096. if (super.mouseX > 4 && super.mouseY > clientHeight - 23
  8097. && super.mouseX < 516 && super.mouseY < clientHeight) {
  8098. rightClickChatButtons();
  8099. }
  8100. alertHandler.processMouse(super.mouseX, super.mouseY);
  8101. /**/
  8102. boolean flag = false;
  8103. while (!flag) {
  8104. flag = true;
  8105. for (int j = 0; j < menuActionRow - 1; j++) {
  8106. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  8107. String s = menuActionName[j];
  8108. menuActionName[j] = menuActionName[j + 1];
  8109. menuActionName[j + 1] = s;
  8110. int k = menuActionID[j];
  8111. menuActionID[j] = menuActionID[j + 1];
  8112. menuActionID[j + 1] = k;
  8113. k = menuActionCmd2[j];
  8114. menuActionCmd2[j] = menuActionCmd2[j + 1];
  8115. menuActionCmd2[j + 1] = k;
  8116. k = menuActionCmd3[j];
  8117. menuActionCmd3[j] = menuActionCmd3[j + 1];
  8118. menuActionCmd3[j + 1] = k;
  8119. k = menuActionCmd4[j];
  8120. menuActionCmd4[j] = menuActionCmd4[j + 1];
  8121. menuActionCmd4[j + 1] = k;
  8122. k = menuActionCmd1[j];
  8123. menuActionCmd1[j] = menuActionCmd1[j + 1];
  8124. menuActionCmd1[j + 1] = k;
  8125. flag = false;
  8126. }
  8127. }
  8128. }
  8129. }
  8130.  
  8131. private int retardLevel = 5;
  8132.  
  8133. private int method83(int i, int j, int k) {
  8134. int l = 256 - k;
  8135. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00)
  8136. + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  8137. }
  8138.  
  8139. private void login(String s, String s1, boolean flag) {
  8140. signlink.errorname = s;
  8141. try {
  8142. if (!flag) {
  8143. loginMessage2 = "";
  8144. loginMessage1 = "Connecting to server...";
  8145. drawLoginScreen();
  8146. }
  8147. socketStream = new RSSocket(this, openSocket(43594 + portOff));
  8148. long l = TextClass.longForName(s);
  8149. int i = (int) (l >> 16 & 31L);
  8150. stream.currentOffset = 0;
  8151. stream.writeWordBigEndian(14);
  8152. stream.writeWordBigEndian(i);
  8153. socketStream.queueBytes(2, stream.buffer);
  8154. for (int j = 0; j < 8; j++)
  8155. socketStream.read();
  8156.  
  8157. int k = socketStream.read();
  8158. int i1 = k;
  8159. if (k == 0) {
  8160. socketStream.flushInputStream(inStream.buffer, 8);
  8161. inStream.currentOffset = 0;
  8162. aLong1215 = inStream.readQWord();
  8163. int ai[] = new int[4];
  8164. ai[0] = (int) (Math.random() * 99999999D);
  8165. ai[1] = (int) (Math.random() * 99999999D);
  8166. ai[2] = (int) (aLong1215 >> 32);
  8167. ai[3] = (int) aLong1215;
  8168. stream.currentOffset = 0;
  8169. stream.writeWordBigEndian(10);
  8170. stream.writeDWord(ai[0]);
  8171. stream.writeDWord(ai[1]);
  8172. stream.writeDWord(ai[2]);
  8173. stream.writeDWord(ai[3]);
  8174. stream.writeDWord(signlink.uid);
  8175. stream.writeString(s);
  8176. stream.writeString(s1);
  8177. stream.doKeys();
  8178. aStream_847.currentOffset = 0;
  8179. if (flag)
  8180. aStream_847.writeWordBigEndian(18);
  8181. else
  8182. aStream_847.writeWordBigEndian(16);
  8183. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1
  8184. + 1 + 2);
  8185. aStream_847.writeWordBigEndian(255);
  8186. aStream_847.writeWord(317);
  8187. aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  8188. for (int l1 = 0; l1 < 9; l1++)
  8189. aStream_847.writeDWord(expectedCRCs[l1]);
  8190.  
  8191. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  8192. stream.encryption = new ISAACRandomGen(ai);
  8193. for (int j2 = 0; j2 < 4; j2++)
  8194. ai[j2] += 50;
  8195.  
  8196. encryption = new ISAACRandomGen(ai);
  8197. socketStream.queueBytes(aStream_847.currentOffset,
  8198. aStream_847.buffer);
  8199. k = socketStream.read();
  8200. }
  8201. if (k == 1) {
  8202. try {
  8203. Thread.sleep(2000L);
  8204. } catch (Exception _ex) {
  8205. }
  8206. login(s, s1, flag);
  8207. return;
  8208. }
  8209. if (k == 2) {
  8210. myPrivilege = socketStream.read();
  8211. flagged = socketStream.read() == 1;
  8212. aLong1220 = 0L;
  8213. anInt1022 = 0;
  8214. mouseDetection.coordsIndex = 0;
  8215. super.awtFocus = true;
  8216. aBoolean954 = true;
  8217. loggedIn = true;
  8218. stream.currentOffset = 0;
  8219. inStream.currentOffset = 0;
  8220. pktType = -1;
  8221. anInt841 = -1;
  8222. anInt842 = -1;
  8223. anInt843 = -1;
  8224. pktSize = 0;
  8225. anInt1009 = 0;
  8226. anInt1104 = 0;
  8227. anInt1011 = 0;
  8228. anInt855 = 0;
  8229. menuActionRow = 0;
  8230. menuOpen = false;
  8231. super.idleTime = 0;
  8232. for (int j1 = 0; j1 < 100; j1++)
  8233. chatMessages[j1] = null;
  8234.  
  8235. itemSelected = 0;
  8236. spellSelected = 0;
  8237. loadingStage = 0;
  8238. anInt1062 = 0;
  8239. anInt1278 = (int) (Math.random() * 100D) - 50;
  8240. anInt1131 = (int) (Math.random() * 110D) - 55;
  8241. anInt896 = (int) (Math.random() * 80D) - 40;
  8242. minimapInt2 = (int) (Math.random() * 120D) - 60;
  8243. minimapInt3 = (int) (Math.random() * 30D) - 20;
  8244. minimapInt1 = (int) (Math.random() * 20D) - 10 & 0x7ff;
  8245. anInt1021 = 0;
  8246. anInt985 = -1;
  8247. destX = 0;
  8248. destY = 0;
  8249. playerCount = 0;
  8250. npcCount = 0;
  8251. for (int i2 = 0; i2 < maxPlayers; i2++) {
  8252. playerArray[i2] = null;
  8253. aStreamArray895s[i2] = null;
  8254. }
  8255.  
  8256. for (int k2 = 0; k2 < 16384; k2++)
  8257. npcArray[k2] = null;
  8258.  
  8259. myPlayer = playerArray[myPlayerIndex] = new Player();
  8260. aClass19_1013.removeAll();
  8261. aClass19_1056.removeAll();
  8262. for (int l2 = 0; l2 < 4; l2++) {
  8263. for (int i3 = 0; i3 < 104; i3++) {
  8264. for (int k3 = 0; k3 < 104; k3++)
  8265. groundArray[l2][i3][k3] = null;
  8266.  
  8267. }
  8268.  
  8269. }
  8270.  
  8271. aClass19_1179 = new NodeList();
  8272. fullscreenInterfaceID = -1;
  8273. anInt900 = 0;
  8274. friendsCount = 0;
  8275. dialogID = -1;
  8276. backDialogID = -1;
  8277. openInterfaceID = -1;
  8278. invOverlayInterfaceID = -1;
  8279. anInt1018 = -1;
  8280. aBoolean1149 = false;
  8281. tabID = 3;
  8282. inputDialogState = 0;
  8283. menuOpen = false;
  8284. messagePromptRaised = false;
  8285. aString844 = null;
  8286. anInt1055 = 0;
  8287. anInt1054 = -1;
  8288. aBoolean1047 = true;
  8289. method45();
  8290. for (int j3 = 0; j3 < 5; j3++)
  8291. anIntArray990[j3] = 0;
  8292.  
  8293. for (int l3 = 0; l3 < 5; l3++) {
  8294. atPlayerActions[l3] = null;
  8295. atPlayerArray[l3] = false;
  8296. }
  8297.  
  8298. anInt1175 = 0;
  8299. anInt1134 = 0;
  8300. anInt986 = 0;
  8301. anInt1288 = 0;
  8302. anInt924 = 0;
  8303. anInt1188 = 0;
  8304. anInt1155 = 0;
  8305. anInt1226 = 0;
  8306. int anInt941 = 0;
  8307. int anInt1260 = 0;
  8308. resetImageProducers2();
  8309. setDefaultCursor();
  8310. // resize(clientWidth, clientHeight);
  8311. return;
  8312. }
  8313. if (k == 3) {
  8314. loginMessage1 = "";
  8315. loginMessage2 = "Invalid username or password.";
  8316. return;
  8317. }
  8318. if (k == 4) {
  8319. loginMessage1 = "Your account has been disabled.";
  8320. loginMessage2 = "Please appeal on forums.";
  8321. return;
  8322. }
  8323. if (k == 5) {
  8324. loginMessage1 = "Your account is already logged in.";
  8325. loginMessage2 = "Try again in 60 secs...";
  8326. return;
  8327. }
  8328. if (k == 6) {
  8329. loginMessage1 = "Project Decimate has been updated!";
  8330. loginMessage2 = "Please reload this page.";
  8331. return;
  8332. }
  8333. if (k == 7) {
  8334. loginMessage1 = "This world is full.";
  8335. loginMessage2 = "Please use a different world.";
  8336. return;
  8337. }
  8338. if (k == 8) {
  8339. loginMessage1 = "Unable to connect.";
  8340. loginMessage2 = "Login server offline.";
  8341. return;
  8342. }
  8343. if (k == 9) {
  8344. loginMessage1 = "Login limit exceeded.";
  8345. loginMessage2 = "Too many connections from your address.";
  8346. return;
  8347. }
  8348. if (k == 10) {
  8349. loginMessage1 = "Unable to connect.";
  8350. loginMessage2 = "Bad session id.";
  8351. return;
  8352. }
  8353. if (k == 11) {
  8354. loginMessage2 = "Login server rejected session.";
  8355. loginMessage2 = "Please try again.";
  8356. return;
  8357. }
  8358. if (k == 12) {
  8359. loginMessage1 = "You need a members account to login to this world.";
  8360. loginMessage2 = "Please subscribe, or use a different world.";
  8361. return;
  8362. }
  8363. if (k == 13) {
  8364. loginMessage1 = "Could not complete login.";
  8365. loginMessage2 = "Please try using a different world.";
  8366. return;
  8367. }
  8368. if (k == 14) {
  8369. loginMessage1 = "The server is being updated.";
  8370. loginMessage2 = "Please wait 1 minute and try again.";
  8371. return;
  8372. }
  8373. if (k == 15) {
  8374. loggedIn = true;
  8375. stream.currentOffset = 0;
  8376. inStream.currentOffset = 0;
  8377. pktType = -1;
  8378. anInt841 = -1;
  8379. anInt842 = -1;
  8380. anInt843 = -1;
  8381. pktSize = 0;
  8382. anInt1009 = 0;
  8383. anInt1104 = 0;
  8384. menuActionRow = 0;
  8385. menuOpen = false;
  8386. aLong824 = System.currentTimeMillis();
  8387. return;
  8388. }
  8389. if (k == 16) {
  8390. loginMessage1 = "Login attempts exceeded.";
  8391. loginMessage2 = "Please wait 1 minute and try again.";
  8392. return;
  8393. }
  8394. if (k == 17) {
  8395. loginMessage1 = "You are standing in a members-only area.";
  8396. loginMessage2 = "To play on this world move to a free area first";
  8397. return;
  8398. }
  8399. if (k == 20) {
  8400. loginMessage1 = "Invalid loginserver requested";
  8401. loginMessage2 = "Please try using a different world.";
  8402. return;
  8403. }
  8404. if (k == 21) {
  8405. for (int k1 = socketStream.read(); k1 >= 0; k1--) {
  8406. loginMessage1 = "You have only just left another world";
  8407. loginMessage2 = "Your profile will be transferred in: "
  8408. + k1 + " seconds";
  8409. drawLoginScreen();
  8410. try {
  8411. Thread.sleep(1000L);
  8412. } catch (Exception _ex) {
  8413. }
  8414. }
  8415.  
  8416. login(s, s1, flag);
  8417. return;
  8418. }
  8419. if (k == -1) {
  8420. if (i1 == 0) {
  8421. if (loginFailures < 2) {
  8422. try {
  8423. Thread.sleep(2000L);
  8424. } catch (Exception _ex) {
  8425. }
  8426. loginFailures++;
  8427. login(s, s1, flag);
  8428. return;
  8429. } else {
  8430. loginMessage1 = "No response from loginserver";
  8431. loginMessage2 = "Please wait 1 minute and try again.";
  8432. return;
  8433. }
  8434. } else {
  8435. loginMessage1 = "No response from server";
  8436. loginMessage2 = "Please try using a different world.";
  8437. return;
  8438. }
  8439. } else {
  8440. System.out.println("response:" + k);
  8441. loginMessage1 = "Unexpected server response";
  8442. loginMessage2 = "Please try using a different world.";
  8443. return;
  8444. }
  8445. } catch (IOException _ex) {
  8446. loginMessage1 = "";
  8447. }
  8448. loginMessage1 = "Error connecting to server.";
  8449. }
  8450.  
  8451. private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1,
  8452. int l1, int i2, int j2, boolean flag, int k2) {
  8453. byte byte0 = 104;
  8454. byte byte1 = 104;
  8455. for (int l2 = 0; l2 < byte0; l2++) {
  8456. for (int i3 = 0; i3 < byte1; i3++) {
  8457. anIntArrayArray901[l2][i3] = 0;
  8458. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  8459. }
  8460. }
  8461. int j3 = j2;
  8462. int k3 = j1;
  8463. anIntArrayArray901[j2][j1] = 99;
  8464. anIntArrayArray825[j2][j1] = 0;
  8465. int l3 = 0;
  8466. int i4 = 0;
  8467. bigX[l3] = j2;
  8468. bigY[l3++] = j1;
  8469. boolean flag1 = false;
  8470. int j4 = bigX.length;
  8471. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  8472. while (i4 != l3) {
  8473. j3 = bigX[i4];
  8474. k3 = bigY[i4];
  8475. i4 = (i4 + 1) % j4;
  8476. if (j3 == k2 && k3 == i2) {
  8477. flag1 = true;
  8478. break;
  8479. }
  8480. if (i1 != 0) {
  8481. if ((i1 < 5 || i1 == 10)
  8482. && aClass11Array1230[plane].method219(k2, j3, k3, j,
  8483. i1 - 1, i2)) {
  8484. flag1 = true;
  8485. break;
  8486. }
  8487. if (i1 < 10
  8488. && aClass11Array1230[plane].method220(k2, i2, k3,
  8489. i1 - 1, j, j3)) {
  8490. flag1 = true;
  8491. break;
  8492. }
  8493. }
  8494. if (k1 != 0
  8495. && k != 0
  8496. && aClass11Array1230[plane].method221(i2, k2, j3, k, l1,
  8497. k1, k3)) {
  8498. flag1 = true;
  8499. break;
  8500. }
  8501. int l4 = anIntArrayArray825[j3][k3] + 1;
  8502. if (j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0
  8503. && (ai[j3 - 1][k3] & 0x1280108) == 0) {
  8504. bigX[l3] = j3 - 1;
  8505. bigY[l3] = k3;
  8506. l3 = (l3 + 1) % j4;
  8507. anIntArrayArray901[j3 - 1][k3] = 2;
  8508. anIntArrayArray825[j3 - 1][k3] = l4;
  8509. }
  8510. if (j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0
  8511. && (ai[j3 + 1][k3] & 0x1280180) == 0) {
  8512. bigX[l3] = j3 + 1;
  8513. bigY[l3] = k3;
  8514. l3 = (l3 + 1) % j4;
  8515. anIntArrayArray901[j3 + 1][k3] = 8;
  8516. anIntArrayArray825[j3 + 1][k3] = l4;
  8517. }
  8518. if (k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0
  8519. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  8520. bigX[l3] = j3;
  8521. bigY[l3] = k3 - 1;
  8522. l3 = (l3 + 1) % j4;
  8523. anIntArrayArray901[j3][k3 - 1] = 1;
  8524. anIntArrayArray825[j3][k3 - 1] = l4;
  8525. }
  8526. if (k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0
  8527. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  8528. bigX[l3] = j3;
  8529. bigY[l3] = k3 + 1;
  8530. l3 = (l3 + 1) % j4;
  8531. anIntArrayArray901[j3][k3 + 1] = 4;
  8532. anIntArrayArray825[j3][k3 + 1] = l4;
  8533. }
  8534. if (j3 > 0 && k3 > 0 && anIntArrayArray901[j3 - 1][k3 - 1] == 0
  8535. && (ai[j3 - 1][k3 - 1] & 0x128010e) == 0
  8536. && (ai[j3 - 1][k3] & 0x1280108) == 0
  8537. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  8538. bigX[l3] = j3 - 1;
  8539. bigY[l3] = k3 - 1;
  8540. l3 = (l3 + 1) % j4;
  8541. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  8542. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  8543. }
  8544. if (j3 < byte0 - 1 && k3 > 0
  8545. && anIntArrayArray901[j3 + 1][k3 - 1] == 0
  8546. && (ai[j3 + 1][k3 - 1] & 0x1280183) == 0
  8547. && (ai[j3 + 1][k3] & 0x1280180) == 0
  8548. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  8549. bigX[l3] = j3 + 1;
  8550. bigY[l3] = k3 - 1;
  8551. l3 = (l3 + 1) % j4;
  8552. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  8553. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  8554. }
  8555. if (j3 > 0 && k3 < byte1 - 1
  8556. && anIntArrayArray901[j3 - 1][k3 + 1] == 0
  8557. && (ai[j3 - 1][k3 + 1] & 0x1280138) == 0
  8558. && (ai[j3 - 1][k3] & 0x1280108) == 0
  8559. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  8560. bigX[l3] = j3 - 1;
  8561. bigY[l3] = k3 + 1;
  8562. l3 = (l3 + 1) % j4;
  8563. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  8564. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  8565. }
  8566. if (j3 < byte0 - 1 && k3 < byte1 - 1
  8567. && anIntArrayArray901[j3 + 1][k3 + 1] == 0
  8568. && (ai[j3 + 1][k3 + 1] & 0x12801e0) == 0
  8569. && (ai[j3 + 1][k3] & 0x1280180) == 0
  8570. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  8571. bigX[l3] = j3 + 1;
  8572. bigY[l3] = k3 + 1;
  8573. l3 = (l3 + 1) % j4;
  8574. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  8575. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  8576. }
  8577. }
  8578. anInt1264 = 0;
  8579. if (!flag1) {
  8580. if (flag) {
  8581. int i5 = 100;
  8582. for (int k5 = 1; k5 < 2; k5++) {
  8583. for (int i6 = k2 - k5; i6 <= k2 + k5; i6++) {
  8584. for (int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  8585. if (i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104
  8586. && anIntArrayArray825[i6][l6] < i5) {
  8587. i5 = anIntArrayArray825[i6][l6];
  8588. j3 = i6;
  8589. k3 = l6;
  8590. anInt1264 = 1;
  8591. flag1 = true;
  8592. }
  8593.  
  8594. }
  8595.  
  8596. if (flag1)
  8597. break;
  8598. }
  8599.  
  8600. }
  8601. if (!flag1)
  8602. return false;
  8603. }
  8604. i4 = 0;
  8605. bigX[i4] = j3;
  8606. bigY[i4++] = k3;
  8607. int l5;
  8608. for (int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3]) {
  8609. if (j5 != l5) {
  8610. l5 = j5;
  8611. bigX[i4] = j3;
  8612. bigY[i4++] = k3;
  8613. }
  8614. if ((j5 & 2) != 0)
  8615. j3++;
  8616. else if ((j5 & 8) != 0)
  8617. j3--;
  8618. if ((j5 & 1) != 0)
  8619. k3++;
  8620. else if ((j5 & 4) != 0)
  8621. k3--;
  8622. }
  8623. // if(cancelWalk) { return i4 > 0; }
  8624.  
  8625. if (i4 > 0) {
  8626. int k4 = i4;
  8627. if (k4 > 25)
  8628. k4 = 25;
  8629. i4--;
  8630. int k6 = bigX[i4];
  8631. int i7 = bigY[i4];
  8632. anInt1288 += k4;
  8633. if (anInt1288 >= 92) {
  8634. stream.createFrame(36);
  8635. stream.writeDWord(0);
  8636. anInt1288 = 0;
  8637. }
  8638. if (i == 0) {
  8639. stream.createFrame(164);
  8640. stream.writeWordBigEndian(k4 + k4 + 3);
  8641. }
  8642. if (i == 1) {
  8643. stream.createFrame(248);
  8644. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  8645. }
  8646. if (i == 2) {
  8647. stream.createFrame(98);
  8648. stream.writeWordBigEndian(k4 + k4 + 3);
  8649. }
  8650. stream.method433(k6 + baseX);
  8651. destX = bigX[0];
  8652. destY = bigY[0];
  8653. for (int j7 = 1; j7 < k4; j7++) {
  8654. i4--;
  8655. stream.writeWordBigEndian(bigX[i4] - k6);
  8656. stream.writeWordBigEndian(bigY[i4] - i7);
  8657. }
  8658.  
  8659. stream.method431(i7 + baseY);
  8660. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  8661. return true;
  8662. }
  8663. return i != 1;
  8664. }
  8665.  
  8666. private void method86(Stream stream) {
  8667. for (int j = 0; j < anInt893; j++) {
  8668. int k = anIntArray894[j];
  8669. NPC npc = npcArray[k];
  8670. int l = stream.readUnsignedByte();
  8671. if ((l & 0x10) != 0) {
  8672. int i1 = stream.method434();
  8673. if (i1 == 65535)
  8674. i1 = -1;
  8675. int i2 = stream.readUnsignedByte();
  8676. if (i1 == npc.anim && i1 != -1) {
  8677. int l2 = Animation.anims[i1].anInt365;
  8678. if (l2 == 1) {
  8679. npc.anInt1527 = 0;
  8680. npc.anInt1528 = 0;
  8681. npc.anInt1529 = i2;
  8682. npc.anInt1530 = 0;
  8683. }
  8684. if (l2 == 2)
  8685. npc.anInt1530 = 0;
  8686. } else if (i1 == -1
  8687. || npc.anim == -1
  8688. || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359) {
  8689. npc.anim = i1;
  8690. npc.anInt1527 = 0;
  8691. npc.anInt1528 = 0;
  8692. npc.anInt1529 = i2;
  8693. npc.anInt1530 = 0;
  8694. npc.anInt1542 = npc.smallXYIndex;
  8695. }
  8696. }
  8697. if ((l & 8) != 0) {
  8698. int j1 = stream.method426();
  8699. int j2 = stream.method427();
  8700. npc.updateHitData(j2, j1, loopCycle);
  8701. npc.loopCycleStatus = loopCycle + 300;
  8702. npc.currentHealth = stream.method426();
  8703. npc.maxHealth = stream.readUnsignedByte();
  8704. }
  8705. if ((l & 0x80) != 0) {
  8706. npc.anInt1520 = stream.readUnsignedWord();
  8707. int k1 = stream.readDWord();
  8708. npc.anInt1524 = k1 >> 16;
  8709. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  8710. npc.anInt1521 = 0;
  8711. npc.anInt1522 = 0;
  8712. if (npc.anInt1523 > loopCycle)
  8713. npc.anInt1521 = -1;
  8714. if (npc.anInt1520 == 65535)
  8715. npc.anInt1520 = -1;
  8716. }
  8717. if ((l & 0x20) != 0) {
  8718. npc.interactingEntity = stream.readUnsignedWord();
  8719. if (npc.interactingEntity == 65535)
  8720. npc.interactingEntity = -1;
  8721. }
  8722. if ((l & 1) != 0) {
  8723. npc.textSpoken = stream.readString();
  8724. npc.textCycle = 100;
  8725. // entityMessage(npc);
  8726.  
  8727. }
  8728. if ((l & 0x40) != 0) {
  8729. int l1 = stream.method427();
  8730. int k2 = stream.method428();
  8731. npc.updateHitData(k2, l1, loopCycle);
  8732. npc.loopCycleStatus = loopCycle + 300;
  8733. npc.currentHealth = stream.method428();
  8734. npc.maxHealth = stream.method427();
  8735. }
  8736. if ((l & 2) != 0) {
  8737. npc.desc = EntityDef.forID(stream.method436());
  8738. npc.anInt1540 = npc.desc.aByte68;
  8739. npc.anInt1504 = npc.desc.anInt79;
  8740. npc.anInt1554 = npc.desc.walkAnim;
  8741. npc.anInt1555 = npc.desc.anInt58;
  8742. npc.anInt1556 = npc.desc.anInt83;
  8743. npc.anInt1557 = npc.desc.anInt55;
  8744. npc.anInt1511 = npc.desc.standAnim;
  8745. }
  8746. if ((l & 4) != 0) {
  8747. npc.anInt1538 = stream.method434();
  8748. npc.anInt1539 = stream.method434();
  8749. }
  8750. }
  8751. }
  8752.  
  8753. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k) {
  8754. if (menuActionRow >= 400)
  8755. return;
  8756. if (entityDef.childrenIDs != null)
  8757. entityDef = entityDef.method161();
  8758. if (entityDef == null)
  8759. return;
  8760. if (!entityDef.aBoolean84)
  8761. return;
  8762. String s = entityDef.name;
  8763. if (entityDef.combatLevel != 0)
  8764. s = s
  8765. + combatDiffColor(myPlayer.combatLevel,
  8766. entityDef.combatLevel) + " (level-"
  8767. + entityDef.combatLevel + ")";
  8768. if (itemSelected == 1) {
  8769. menuActionName[menuActionRow] = "Use " + selectedItemName
  8770. + " with @yel@" + s;
  8771. menuActionID[menuActionRow] = 582;
  8772. menuActionCmd1[menuActionRow] = i;
  8773. menuActionCmd2[menuActionRow] = k;
  8774. menuActionCmd3[menuActionRow] = j;
  8775. menuActionRow++;
  8776. return;
  8777. }
  8778. if (spellSelected == 1) {
  8779. if ((spellUsableOn & 2) == 2) {
  8780. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  8781. menuActionID[menuActionRow] = 413;
  8782. menuActionCmd1[menuActionRow] = i;
  8783. menuActionCmd2[menuActionRow] = k;
  8784. menuActionCmd3[menuActionRow] = j;
  8785. menuActionRow++;
  8786. }
  8787. } else {
  8788. if (entityDef.actions != null) {
  8789. for (int l = 4; l >= 0; l--)
  8790. if (entityDef.actions[l] != null
  8791. && !entityDef.actions[l].equalsIgnoreCase("attack")) {
  8792. menuActionName[menuActionRow] = entityDef.actions[l]
  8793. + " @yel@" + s;
  8794. if (l == 0)
  8795. menuActionID[menuActionRow] = 20;
  8796. if (l == 1)
  8797. menuActionID[menuActionRow] = 412;
  8798. if (l == 2)
  8799. menuActionID[menuActionRow] = 225;
  8800. if (l == 3)
  8801. menuActionID[menuActionRow] = 965;
  8802. if (l == 4)
  8803. menuActionID[menuActionRow] = 478;
  8804. menuActionCmd1[menuActionRow] = i;
  8805. menuActionCmd2[menuActionRow] = k;
  8806. menuActionCmd3[menuActionRow] = j;
  8807. menuActionRow++;
  8808. }
  8809.  
  8810. }
  8811. if (entityDef.actions != null) {
  8812. for (int i1 = 4; i1 >= 0; i1--)
  8813. if (entityDef.actions[i1] != null
  8814. && entityDef.actions[i1].equalsIgnoreCase("attack")) {
  8815. char c = '\0';
  8816. if (entityDef.combatLevel > myPlayer.combatLevel)
  8817. c = '\u07D0';
  8818. menuActionName[menuActionRow] = entityDef.actions[i1]
  8819. + " @yel@" + s;
  8820. if (i1 == 0)
  8821. menuActionID[menuActionRow] = 20 + c;
  8822. if (i1 == 1)
  8823. menuActionID[menuActionRow] = 412 + c;
  8824. if (i1 == 2)
  8825. menuActionID[menuActionRow] = 225 + c;
  8826. if (i1 == 3)
  8827. menuActionID[menuActionRow] = 965 + c;
  8828. if (i1 == 4)
  8829. menuActionID[menuActionRow] = 478 + c;
  8830. menuActionCmd1[menuActionRow] = i;
  8831. menuActionCmd2[menuActionRow] = k;
  8832. menuActionCmd3[menuActionRow] = j;
  8833. menuActionRow++;
  8834. }
  8835.  
  8836. }
  8837. // menuActionName[menuActionRow] = "Examine @yel@" + s +
  8838. // " @gre@(@whi@" + entityDef.type + "@gre@)";
  8839. menuActionName[menuActionRow] = "Examine @yel@" + s;
  8840. menuActionID[menuActionRow] = 1025;
  8841. menuActionCmd1[menuActionRow] = i;
  8842. menuActionCmd2[menuActionRow] = k;
  8843. menuActionCmd3[menuActionRow] = j;
  8844. menuActionRow++;
  8845. }
  8846. }
  8847.  
  8848. private void buildAtPlayerMenu(int i, int j, Player player, int k) {
  8849. if (player == myPlayer)
  8850. return;
  8851. if (menuActionRow >= 400)
  8852. return;
  8853. String s;
  8854. if (player.skill == 0) {
  8855. s = player.name
  8856. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  8857. + " (level-" + player.combatLevel + ")";
  8858. } else {
  8859. s = Loyalty.title[player.skill] + "@whi@ " + player.name
  8860. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  8861. + " (level-" + player.combatLevel + ")";
  8862. }
  8863. if (itemSelected == 1) {
  8864. menuActionName[menuActionRow] = "Use " + selectedItemName
  8865. + " with @whi@" + s;
  8866. menuActionID[menuActionRow] = 491;
  8867. menuActionCmd1[menuActionRow] = j;
  8868. menuActionCmd2[menuActionRow] = i;
  8869. menuActionCmd3[menuActionRow] = k;
  8870. menuActionRow++;
  8871. } else if (spellSelected == 1) {
  8872. if ((spellUsableOn & 8) == 8) {
  8873. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  8874. menuActionID[menuActionRow] = 365;
  8875. menuActionCmd1[menuActionRow] = j;
  8876. menuActionCmd2[menuActionRow] = i;
  8877. menuActionCmd3[menuActionRow] = k;
  8878. menuActionRow++;
  8879. }
  8880. } else {
  8881. for (int l = 4; l >= 0; l--)
  8882. if (atPlayerActions[l] != null) {
  8883. menuActionName[menuActionRow] = atPlayerActions[l]
  8884. + " @whi@" + s;
  8885. char c = '\0';
  8886. if (atPlayerActions[l].equalsIgnoreCase("attack")) {
  8887. if (player.combatLevel > myPlayer.combatLevel)
  8888. c = '\u07D0';
  8889. if (myPlayer.team != 0 && player.team != 0)
  8890. if (myPlayer.team == player.team)
  8891. c = '\u07D0';
  8892. else
  8893. c = '\0';
  8894. } else if (atPlayerArray[l])
  8895. c = '\u07D0';
  8896. if (l == 0)
  8897. menuActionID[menuActionRow] = 561 + c;
  8898. if (l == 1)
  8899. menuActionID[menuActionRow] = 779 + c;
  8900. if (l == 2)
  8901. menuActionID[menuActionRow] = 27 + c;
  8902. if (l == 3)
  8903. menuActionID[menuActionRow] = 577 + c;
  8904. if (l == 4)
  8905. menuActionID[menuActionRow] = 729 + c;
  8906. menuActionCmd1[menuActionRow] = j;
  8907. menuActionCmd2[menuActionRow] = i;
  8908. menuActionCmd3[menuActionRow] = k;
  8909. menuActionRow++;
  8910. }
  8911.  
  8912. }
  8913. for (int i1 = 0; i1 < menuActionRow; i1++)
  8914. if (menuActionID[i1] == 516) {
  8915. menuActionName[i1] = "Walk here @whi@" + s;
  8916. return;
  8917. }
  8918.  
  8919. }
  8920.  
  8921. private void method89(Class30_Sub1 class30_sub1) {
  8922. int i = 0;
  8923. int j = -1;
  8924. int k = 0;
  8925. int l = 0;
  8926. if (class30_sub1.anInt1296 == 0)
  8927. i = worldController.method300(class30_sub1.anInt1295,
  8928. class30_sub1.anInt1297, class30_sub1.anInt1298);
  8929. if (class30_sub1.anInt1296 == 1)
  8930. i = worldController.method301(class30_sub1.anInt1295,
  8931. class30_sub1.anInt1297, class30_sub1.anInt1298);
  8932. if (class30_sub1.anInt1296 == 2)
  8933. i = worldController.method302(class30_sub1.anInt1295,
  8934. class30_sub1.anInt1297, class30_sub1.anInt1298);
  8935. if (class30_sub1.anInt1296 == 3)
  8936. i = worldController.method303(class30_sub1.anInt1295,
  8937. class30_sub1.anInt1297, class30_sub1.anInt1298);
  8938. if (i != 0) {
  8939. int i1 = worldController.method304(class30_sub1.anInt1295,
  8940. class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  8941. j = i >> 14 & 0x7fff;
  8942. k = i1 & 0x1f;
  8943. l = i1 >> 6;
  8944. }
  8945. class30_sub1.anInt1299 = j;
  8946. class30_sub1.anInt1301 = k;
  8947. class30_sub1.anInt1300 = l;
  8948. }
  8949.  
  8950. private void method90() {
  8951. for (int i = 0; i < anInt1062; i++)
  8952. if (anIntArray1250[i] <= 0) {
  8953. boolean flag1 = false;
  8954. try {
  8955. if (anIntArray1207[i] == anInt874
  8956. && anIntArray1241[i] == anInt1289) {
  8957. if (!replayWave())
  8958. flag1 = true;
  8959. } else {
  8960. Stream stream = Sounds.method241(anIntArray1241[i],
  8961. anIntArray1207[i]);
  8962. if (System.currentTimeMillis()
  8963. + (long) (stream.currentOffset / 22) > aLong1172
  8964. + (long) (anInt1257 / 22)) {
  8965. anInt1257 = stream.currentOffset;
  8966. aLong1172 = System.currentTimeMillis();
  8967. if (saveWave(stream.buffer, stream.currentOffset)) {
  8968. anInt874 = anIntArray1207[i];
  8969. anInt1289 = anIntArray1241[i];
  8970. } else {
  8971. flag1 = true;
  8972. }
  8973. }
  8974. }
  8975. } catch (Exception exception) {
  8976. }
  8977. if (!flag1 || anIntArray1250[i] == -5) {
  8978. anInt1062--;
  8979. for (int j = i; j < anInt1062; j++) {
  8980. anIntArray1207[j] = anIntArray1207[j + 1];
  8981. anIntArray1241[j] = anIntArray1241[j + 1];
  8982. anIntArray1250[j] = anIntArray1250[j + 1];
  8983. }
  8984.  
  8985. i--;
  8986. } else {
  8987. anIntArray1250[i] = -5;
  8988. }
  8989. } else {
  8990. anIntArray1250[i]--;
  8991. }
  8992.  
  8993. if (prevSong > 0) {
  8994. prevSong -= 20;
  8995. if (prevSong < 0)
  8996. prevSong = 0;
  8997. if (prevSong == 0 && musicEnabled && !lowMem) {
  8998. nextSong = currentSong;
  8999. songChanging = true;
  9000. onDemandFetcher.method558(2, nextSong);
  9001. }
  9002. }
  9003. }
  9004.  
  9005. private Sprite chatButtonz;
  9006.  
  9007. void startUp() {
  9008. drawSmothLoadingText(20, "");
  9009. new CacheDownloader(this).downloadCache();
  9010. //new UpdateCache(this).run();
  9011. if (signlink.sunjava)
  9012. super.minDelay = 5;
  9013. if (aBoolean993) {
  9014. // rsAlreadyLoaded = true;
  9015. // return;
  9016. }
  9017. aBoolean993 = true;
  9018. boolean flag = true;
  9019. String s = getDocumentBaseHost();
  9020. if (signlink.cache_dat != null) {
  9021. for (int i = 0; i < 5; i++)
  9022. decompressors[i] = new Decompressor(signlink.cache_dat,
  9023. signlink.cache_idx[i], i + 1);
  9024. }
  9025. // repackCacheIndex(4);
  9026. try {
  9027. titleStreamLoader = streamLoaderForName(1, "title screen", "title",
  9028. expectedCRCs[1], 25);
  9029. smallText = new TextDrawingArea(false, "p11_full",
  9030. titleStreamLoader);
  9031. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full",
  9032. titleStreamLoader);
  9033. chatTextDrawingArea = new TextDrawingArea(false, "b12_full",
  9034. titleStreamLoader);
  9035. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true,
  9036. "q8_full", titleStreamLoader);
  9037. newSmallFont = new RSFont(false, "p11_full", titleStreamLoader);
  9038. newRegularFont = new RSFont(false, "p12_full", titleStreamLoader);
  9039. newBoldFont = new RSFont(false, "b12_full", titleStreamLoader);
  9040. newFancyFont = new RSFont(true, "q8_full", titleStreamLoader);
  9041. newSmallFont.unpackChatImages(chatImages);
  9042. newRegularFont.unpackChatImages(chatImages);
  9043. newBoldFont.unpackChatImages(chatImages);
  9044. newFancyFont.unpackChatImages(chatImages);
  9045. try {
  9046. drawLogo();
  9047. loadTitleScreen();
  9048.  
  9049. } catch (Exception e) {
  9050. e.printStackTrace();
  9051. }
  9052. //backgroundFix.drawSprite(0, 0);
  9053. StreamLoader streamLoader = streamLoaderForName(2, "config",
  9054. "config", expectedCRCs[2], 30);
  9055. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface",
  9056. "interface", expectedCRCs[3], 35);
  9057. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics",
  9058. "media", expectedCRCs[4], 40);
  9059. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures",
  9060. "textures", expectedCRCs[6], 45);
  9061. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system",
  9062. "wordenc", expectedCRCs[7], 50);
  9063. StreamLoader streamLoader_5 = streamLoaderForName(8,
  9064. "sound effects", "sounds", expectedCRCs[8], 55);
  9065. byteGroundArray = new byte[4][104][104];
  9066. intGroundArray = new int[4][105][105];
  9067. worldController = new WorldController(intGroundArray);
  9068.  
  9069. for (int j = 0; j < 4; j++)
  9070. aClass11Array1230[j] = new Class11();
  9071.  
  9072. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  9073. //loadingPleaseWait = new Sprite("loadingPleaseWait");
  9074. //for (int nSI = 0; nSI <= 14; nSI++)
  9075. //newSideIcons[nSI] = new Sprite("Gameframe/tabs/icon " + nSI);
  9076. //tabHover = new Sprite("Gameframe/tabs/tabhover");
  9077. //tabHover2 = new Sprite("Gameframe/tabs/tabhover2");
  9078. multiOverlay2 = new Sprite("Gameframe/multi");
  9079. tabClicked = new Sprite("Gameframe/tabs/tabclicked");
  9080. //reestablish = new Sprite("reestablish");
  9081. magicAuto = new Sprite("Interfaces/Autocast/magicAuto");
  9082. sprite1 = new Sprite("Gameframe/sprite1");
  9083. chatButtonz = new Sprite("GameFrame/chatbuttons");
  9084. xpFlag = new Sprite("Gameframe/xpFlag");
  9085. //x10Expand = new Sprite("expanded");
  9086. //x10ExpandOld = new Sprite("expandedOld");
  9087. mapRing = new Sprite("Gameframe/Orbs/1129");
  9088. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list",
  9089. "versionlist", expectedCRCs[5], 60);
  9090. drawSmothLoadingText(60,
  9091. "Project Decimate is loading - please wait...");
  9092. onDemandFetcher = new OnDemandFetcher();
  9093. onDemandFetcher.start(streamLoader_6, this);
  9094. Class36.method528(onDemandFetcher.getAnimCount());
  9095. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  9096. //preloadModels();
  9097. //maps();
  9098. //repackCacheIndex(1);//models
  9099. //repackCacheIndex(2);//anims
  9100. //repackCacheIndex(3);//sounds
  9101. //repackCacheIndex(4);//maps
  9102. drawSmothLoadingText(80,
  9103. "Project Decimate is loading - please wait...");
  9104. logIconH = new Sprite(streamLoader_2, "orbs", 0);
  9105. logIconC = new Sprite(streamLoader_2, "orbs", 1);
  9106. questionIconH = new Sprite(streamLoader_2, "orbs", 4);
  9107. questionIconC = new Sprite(streamLoader_2, "orbs", 5);
  9108. worldMapIcon = new Sprite("GameFrame/Orbs/mapicon");
  9109. xpIcon = new Sprite("GameFrame/Orbs/2730");
  9110. xpIconH = new Sprite("GameFrame/Orbs/2731");
  9111. //oldHit = new Sprite("GameFrame/hit");
  9112. //oldBlue = new Sprite("GameFrame/def");
  9113. fullScreenSprites[0] = new Sprite("invbg");
  9114. fullScreenSprites[1] = new Sprite("tabs");
  9115. fullScreenSprites[2] = new Sprite("tabs2");
  9116. //oldGreen = new Sprite("GameFrame/poison");
  9117. for (int c2 = 0; c2 < 2; c2++)
  9118. chatToggle[c2] = new Sprite("chattoggle " + c2);
  9119. mapArea[1] = new Sprite("maparea");
  9120. mapArea[2] = new Sprite("maparea2");
  9121. mapArea[0] = new Sprite("fullscreenmapback");
  9122. HPBarFull = new Sprite(sign.signlink.findcachedir()
  9123. + "Sprites/HITPOINTS_0.PNG", 1);
  9124. HPBarEmpty = new Sprite(sign.signlink.findcachedir()
  9125. + "Sprites/HITPOINTS_1.PNG", 1);
  9126. logoutIcon = new Sprite(streamLoader_2, "orbs", 2);
  9127. questionIcon = new Sprite(streamLoader_2, "orbs", 3);
  9128. emptyOrb = new Sprite("GameFrame/Orbs/emptyorb");
  9129. orbFill = new Sprite("GameFrame/Orbs/Orb 2");
  9130. hoveredEmpty = new Sprite("GameFrame/Orbs/hoveredempty");
  9131. runIcon1 = new Sprite("GameFrame/Orbs/runicon1");
  9132. runIcon2 = new Sprite("GameFrame/Orbs/runicon2");
  9133. runOrb1 = new Sprite("GameFrame/Orbs/runorb1");
  9134. runOrb2 = new Sprite("GameFrame/Orbs/runorb2");
  9135. hitPointsFill = new Sprite("GameFrame/Orbs/hitpointsfill");
  9136. hitPointsIcon = new Sprite("GameFrame/Orbs/hitpointsicon");
  9137. prayerFill = new Sprite("GameFrame/Orbs/prayerfill");
  9138. prayerIcon = new Sprite("GameFrame/Orbs/prayericon");
  9139. HPBarFull = new Sprite(sign.signlink.findcachedir()
  9140. + "Sprites/HITPOINTS_0.PNG", 1);
  9141. HPBarEmpty = new Sprite(sign.signlink.findcachedir()
  9142. + "Sprites/HITPOINTS_1.PNG", 1);
  9143. infinity = new Sprite("infinity");
  9144. /* Custom sprite unpacking */
  9145. Sprite[] clanIcons = new Sprite[9];//this
  9146. for (int index = 0; index < clanIcons.length; index++) {//this
  9147. // clanIcons[index] = new Sprite(streamLoader_2, "clanicons",
  9148. // index);
  9149. clanIcons[index] = new Sprite("Clan Chat/Icons/" + index);//this
  9150. }
  9151. RSFont.unpackImages(clanIcons);
  9152. chatArea = new Sprite("chatarea");
  9153. //tabs554 = new Sprite("554short");
  9154. //long554 = new Sprite("tab");
  9155. //if (is554) {
  9156. //tabArea = new Sprite("tabarea3");
  9157. //}
  9158. //if (!is474 && !is554) {
  9159. tabArea = new Sprite("tabarea");
  9160. //}
  9161. //if (is474) {
  9162. //tabArea = new Sprite("tabarea2");
  9163. //}
  9164. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  9165. /**/
  9166. mapBack = new Background(streamLoader_2, "mapback", 0);
  9167. for (int c1 = 0; c1 <= 3; c1++)
  9168. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  9169. for (int j3 = 0; j3 <= 14; j3++)
  9170. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  9171. for (int r1 = 0; r1 < 5; r1++)
  9172. redStones[r1] = new Sprite("redstones " + r1);
  9173. compass = new Sprite(streamLoader_2, "compass", 0);
  9174. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  9175. mapEdge.method345();
  9176. try {
  9177. for (int k3 = 0; k3 < 100; k3++)
  9178. mapScenes[k3] = new Background(streamLoader_2, "mapscene",
  9179. k3);
  9180. } catch (Exception _ex) {
  9181. }
  9182. try {
  9183. for (int l3 = 0; l3 < 100; l3++)
  9184. mapFunctions[l3] = new Sprite(streamLoader_2,
  9185. "mapfunction", l3);
  9186. } catch (Exception _ex) {
  9187. }
  9188. try {
  9189. for (int i4 = 0; i4 < 20; i4++)
  9190. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  9191. } catch (Exception _ex) {
  9192. }
  9193. try {
  9194. for (int h1 = 0; h1 < 6; h1++)
  9195. headIconsHint[h1] = new Sprite(streamLoader_2,
  9196. "headicons_hint", h1);
  9197. } catch (Exception _ex) {
  9198. }
  9199. try {
  9200. for (int j4 = 0; j4 < 8; j4++)
  9201. headIcons[j4] = new Sprite(streamLoader_2,
  9202. "headicons_prayer", j4);
  9203. for (int idx = 0; idx < 18; idx++)
  9204. headIcons[idx] = new Sprite("Player/Prayer/Prayer " + idx);
  9205. for (int j45 = 0; j45 < 3; j45++)
  9206. skullIcons[j45] = new Sprite(streamLoader_2,
  9207. "headicons_pk", j45);
  9208. } catch (Exception _ex) {
  9209. }
  9210. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  9211. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  9212. for (int k4 = 0; k4 < 8; k4++)
  9213. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  9214.  
  9215. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  9216. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  9217. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  9218. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  9219. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  9220. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  9221. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  9222. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  9223.  
  9224. alertBack = new Sprite("alertback");
  9225. alertBorder = new Sprite("alertborder");
  9226. alertBorderH = new Sprite("alertborderh");
  9227.  
  9228. for (int l4 = 0; l4 < 5; l4++)
  9229. chatImages[l4] = new Sprite(streamLoader_2, "mod_icons", l4);
  9230.  
  9231. for (int l4 = 0; l4 < 5; l4++)
  9232. modIcons[l4] = new Background(streamLoader_2, "mod_icons", l4);
  9233.  
  9234. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  9235. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  9236. getGameComponent());
  9237. sprite.method346(0, 0);
  9238. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  9239. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  9240. getGameComponent());
  9241. sprite.method346(0, 0);
  9242. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  9243. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  9244. getGameComponent());
  9245. sprite.method346(0, 0);
  9246. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  9247. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  9248. getGameComponent());
  9249. sprite.method346(0, 0);
  9250.  
  9251. int i5 = (int) (Math.random() * 21D) - 10;
  9252. int j5 = (int) (Math.random() * 21D) - 10;
  9253. int k5 = (int) (Math.random() * 21D) - 10;
  9254. int l5 = (int) (Math.random() * 41D) - 20;
  9255. for (int i6 = 0; i6 < 100; i6++) {
  9256. if (mapFunctions[i6] != null)
  9257. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  9258. if (mapScenes[i6] != null)
  9259. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  9260. }
  9261.  
  9262. drawSmothLoadingText(83,
  9263. "Project Decimate is loading - please wait...");
  9264. Texture.method368(streamLoader_3);
  9265. Texture.method372(0.80000000000000004D);
  9266. Texture.method367();
  9267. drawSmothLoadingText(86,
  9268. "Project Decimate is loading - please wait...");
  9269. Animation.unpackConfig(streamLoader);
  9270. ObjectDef.unpackConfig(streamLoader);
  9271. Flo.unpackConfig(streamLoader);
  9272. OverLayFlo317.unpackConfig(streamLoader);
  9273. ItemDef.unpackConfig(streamLoader);
  9274. EntityDef.unpackConfig(streamLoader);
  9275. IdentityKit.unpackConfig(streamLoader);
  9276. SpotAnim.unpackConfig(streamLoader);
  9277. Varp.unpackConfig(streamLoader);
  9278. VarBit.unpackConfig(streamLoader);
  9279. ItemDef.isMembers = isMembers;
  9280. if (!lowMem) {
  9281. drawSmothLoadingText(90,
  9282. "Project Decimate is loading - please wait...");
  9283. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  9284. Stream stream = new Stream(abyte0);
  9285. Sounds.unpack(stream);
  9286. }
  9287. drawSmothLoadingText(95,
  9288. "Project Decimate is loading - please wait...");
  9289. TextDrawingArea aclass30_sub2_sub1_sub4s[] = { smallText,
  9290. aTextDrawingArea_1271, chatTextDrawingArea,
  9291. aTextDrawingArea_1273 };
  9292. RSInterface.fonts = aclass30_sub2_sub1_sub4s;
  9293. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s,
  9294. streamLoader_2);
  9295. drawSmothLoadingText(100,
  9296. "Project Decimate is loading - please wait...");
  9297. System.out.println("Width: " + (519 + 41));
  9298. System.out.println("Height: " + (168 - 3));
  9299. for (int j6 = 0; j6 < 33; j6++) {
  9300. int k6 = 0;
  9301. int i7 = 0;
  9302. for (int k7 = 0; k7 < 34; k7++) {
  9303. if (mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0) {
  9304. if (k6 == 0)
  9305. k6 = k7;
  9306. continue;
  9307. }
  9308. if (k6 == 0)
  9309. continue;
  9310. i7 = k7;
  9311. break;
  9312. }
  9313.  
  9314. anIntArray968[j6] = k6;
  9315. anIntArray1057[j6] = i7 - k6;
  9316. }
  9317.  
  9318. for (int l6 = 5; l6 < 156; l6++) {
  9319. int j7 = 999;
  9320. int l7 = 0;
  9321. for (int j8 = 20; j8 < 172; j8++) {
  9322. if (mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0
  9323. && (j8 > 34 || l6 > 34)) {
  9324. if (j7 == 999)
  9325. j7 = j8;
  9326. continue;
  9327. }
  9328. if (j7 == 999)
  9329. continue;
  9330. l7 = j8;
  9331. break;
  9332. }
  9333.  
  9334. anIntArray1052[l6 - 5] = j7 - 20;
  9335. anIntArray1229[l6 - 5] = l7 - j7;
  9336. if (anIntArray1229[l6 - 5] == -20)
  9337. anIntArray1229[l6 - 5] = 152;
  9338. }
  9339.  
  9340. Texture.method365(519, 165);
  9341. anIntArray1180 = Texture.anIntArray1472;
  9342. Texture.method365(246, 335);
  9343. anIntArray1181 = Texture.anIntArray1472;
  9344. Texture.method365(512, 334);
  9345. anIntArray1182 = Texture.anIntArray1472;
  9346. int ai[] = new int[9];
  9347. for (int i8 = 0; i8 < 9; i8++) {
  9348. int k8 = 128 + i8 * 32 + 15;
  9349. int l8 = 600 + k8 * 3;
  9350. int i9 = Texture.anIntArray1470[k8];
  9351. ai[i8] = l8 * i9 >> 16;
  9352. }
  9353. WorldController.method310(500, 800, 512, 334, ai);
  9354. Censor.loadConfig(streamLoader_4);
  9355. mouseDetection = new MouseDetection(this);
  9356. startRunnable(mouseDetection, 10);
  9357. Animable_Sub5.clientInstance = this;
  9358. ObjectDef.clientInstance = this;
  9359. EntityDef.clientInstance = this;
  9360. buffer = getGameComponent().createImage(765 + extraWidth,
  9361. 503 + extraHeight);
  9362. bufferGraphics = buffer.getGraphics();
  9363. // preloadMaps();
  9364. return;
  9365. } catch (Exception exception) {
  9366. exception.printStackTrace();
  9367. // signlink.reporterror("loaderror " + aString1049 + " " +
  9368. // anInt1079);
  9369. }
  9370. loadingError = true;
  9371. }
  9372.  
  9373. private void method91(Stream stream, int i) {
  9374. while (stream.bitPosition + 10 < i * 8) {
  9375. int j = stream.readBits(11);
  9376. if (j == 2047)
  9377. break;
  9378. if (playerArray[j] == null) {
  9379. playerArray[j] = new Player();
  9380. if (aStreamArray895s[j] != null)
  9381. playerArray[j].updatePlayer(aStreamArray895s[j]);
  9382. }
  9383. playerIndices[playerCount++] = j;
  9384. Player player = playerArray[j];
  9385. player.anInt1537 = loopCycle;
  9386. int k = stream.readBits(1);
  9387. if (k == 1)
  9388. anIntArray894[anInt893++] = j;
  9389. int l = stream.readBits(1);
  9390. int i1 = stream.readBits(5);
  9391. if (i1 > 15)
  9392. i1 -= 32;
  9393. int j1 = stream.readBits(5);
  9394. if (j1 > 15)
  9395. j1 -= 32;
  9396. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1,
  9397. l == 1);
  9398. }
  9399. stream.finishBitAccess();
  9400. }
  9401.  
  9402. private void processMainScreenClick() {
  9403. if (anInt1021 != 0)
  9404. return;
  9405. int x = isFullScreen ? extraWidth : 0;
  9406. int y = isFullScreen ? extraHeight : 0;
  9407. if (super.clickMode3 == 1) {
  9408. if (!isFullScreen) {
  9409. int x2 = isFullScreen ? 558 : 528;
  9410. int i = super.saveClickX - 25 - x2 - x;
  9411. int j = super.saveClickY - 5 - 4;
  9412. if (i >= 0 && j >= 0 && i < 146 && j < 151) {
  9413. i -= 73;
  9414. j -= 75;
  9415. int k = minimapInt1 + minimapInt2 & 0x7ff;
  9416. int i1 = Texture.anIntArray1470[k];
  9417. int j1 = Texture.anIntArray1471[k];
  9418. i1 = i1 * (minimapInt3 + 256) >> 8;
  9419. j1 = j1 * (minimapInt3 + 256) >> 8;
  9420. int k1 = j * i1 + i * j1 >> 11;
  9421. int l1 = j * j1 - i * i1 >> 11;
  9422. int i2 = myPlayer.x + k1 >> 7;
  9423. int j2 = myPlayer.y - l1 >> 7;
  9424. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0,
  9425. 0, j2, myPlayer.smallX[0], true, i2);
  9426. if (flag1) {
  9427. stream.writeWordBigEndian(i);
  9428. stream.writeWordBigEndian(j);
  9429. stream.writeWord(minimapInt1);
  9430. stream.writeWordBigEndian(57);
  9431. stream.writeWordBigEndian(minimapInt2);
  9432. stream.writeWordBigEndian(minimapInt3);
  9433. stream.writeWordBigEndian(89);
  9434. stream.writeWord(myPlayer.x);
  9435. stream.writeWord(myPlayer.y);
  9436. stream.writeWordBigEndian(anInt1264);
  9437. stream.writeWordBigEndian(63);
  9438. }
  9439. }
  9440. }
  9441. if (isFullScreen) {
  9442. int x2 = isFullScreen ? 558 : 528;
  9443. int i = super.saveClickX - 25 - x2 - x;
  9444. int j = super.saveClickY - 5 - 4;
  9445. if (i >= 0 && j >= 0 && i < 146 && j < 151) {
  9446. i -= 73;
  9447. j -= 75;
  9448. int k = minimapInt1 + minimapInt2 & 0x7ff;
  9449. int i1 = Texture.anIntArray1470[k];
  9450. int j1 = Texture.anIntArray1471[k];
  9451. i1 = i1 * (minimapInt3 + 256) >> 8;
  9452. j1 = j1 * (minimapInt3 + 256) >> 8;
  9453. int k1 = j * i1 + i * j1 >> 11;
  9454. int l1 = j * j1 - i * i1 >> 11;
  9455. int i2 = myPlayer.x + k1 >> 7;
  9456. int j2 = myPlayer.y - l1 >> 7;
  9457. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0,
  9458. 0, j2, myPlayer.smallX[0], true, i2);
  9459. if (flag1) {
  9460. stream.writeWordBigEndian(i);
  9461. stream.writeWordBigEndian(j);
  9462. stream.writeWord(minimapInt1);
  9463. stream.writeWordBigEndian(57);
  9464. stream.writeWordBigEndian(minimapInt2);
  9465. stream.writeWordBigEndian(minimapInt3);
  9466. stream.writeWordBigEndian(89);
  9467. stream.writeWord(myPlayer.x);
  9468. stream.writeWord(myPlayer.y);
  9469. stream.writeWordBigEndian(anInt1264);
  9470. stream.writeWordBigEndian(63);
  9471. }
  9472. }
  9473. }
  9474. anInt1117++;
  9475. if (anInt1117 > 1151) {
  9476. anInt1117 = 0;
  9477. stream.createFrame(246);
  9478. stream.writeWordBigEndian(0);
  9479. int l = stream.currentOffset;
  9480. if ((int) (Math.random() * 2D) == 0)
  9481. stream.writeWordBigEndian(101);
  9482. stream.writeWordBigEndian(197);
  9483. stream.writeWord((int) (Math.random() * 65536D));
  9484. stream.writeWordBigEndian((int) (Math.random() * 256D));
  9485. stream.writeWordBigEndian(67);
  9486. stream.writeWord(14214);
  9487. if ((int) (Math.random() * 2D) == 0)
  9488. stream.writeWord(29487);
  9489. stream.writeWord((int) (Math.random() * 65536D));
  9490. if ((int) (Math.random() * 2D) == 0)
  9491. stream.writeWordBigEndian(220);
  9492. stream.writeWordBigEndian(180);
  9493. stream.writeBytes(stream.currentOffset - l);
  9494. }
  9495. }
  9496. }
  9497.  
  9498. private String interfaceIntToString(int j) {
  9499. if (j < 0x3b9ac9ff)
  9500. return String.valueOf(j);
  9501. else
  9502. return "*";
  9503. }
  9504.  
  9505. private void showErrorScreen() {
  9506. Graphics g = getGameComponent().getGraphics();
  9507. g.setColor(Color.black);
  9508. g.fillRect(0, 0, 765, 503);
  9509. method4(1);
  9510. if (loadingError) {
  9511. aBoolean831 = false;
  9512. g.setFont(new Font("Helvetica", 1, 16));
  9513. g.setColor(Color.yellow);
  9514. int k = 35;
  9515. g.drawString(
  9516. "Sorry, an error has occured whilst loading Project Decimate",
  9517. 30, k);
  9518. k += 50;
  9519. g.setColor(Color.white);
  9520. g.drawString("To fix this try the following (in order):", 30, k);
  9521. k += 50;
  9522. g.setColor(Color.white);
  9523. g.setFont(new Font("Helvetica", 1, 12));
  9524. g
  9525. .drawString(
  9526. "1: Try closing ALL open web-browser windows, and reloading",
  9527. 30, k);
  9528. k += 30;
  9529. g
  9530. .drawString(
  9531. "2: Try clearing your web-browsers cache from tools->internet options",
  9532. 30, k);
  9533. k += 30;
  9534. g.drawString("3: Try using a different game-world", 30, k);
  9535. k += 30;
  9536. g.drawString("4: Try rebooting your computer", 30, k);
  9537. k += 30;
  9538. g
  9539. .drawString(
  9540. "5: Try selecting a different version of Java from the play-game menu",
  9541. 30, k);
  9542. }
  9543. if (genericLoadingError) {
  9544. aBoolean831 = false;
  9545. g.setFont(new Font("Helvetica", 1, 20));
  9546. g.setColor(Color.white);
  9547. g.drawString("Error - unable to load game!", 50, 50);
  9548. g.drawString("To play Project Decimate make sure you play from", 50, 100);
  9549. g.drawString("", 50, 150);
  9550. }
  9551. if (rsAlreadyLoaded) {
  9552. aBoolean831 = false;
  9553. g.setColor(Color.yellow);
  9554. int l = 35;
  9555. g.drawString(
  9556. "Error a copy of Project Decimate already appears to be loaded",
  9557. 30, l);
  9558. l += 50;
  9559. g.setColor(Color.white);
  9560. g.drawString("To fix this try the following (in order):", 30, l);
  9561. l += 50;
  9562. g.setColor(Color.white);
  9563. g.setFont(new Font("Helvetica", 1, 12));
  9564. g
  9565. .drawString(
  9566. "1: Try closing ALL open web-browser windows, and reloading",
  9567. 30, l);
  9568. l += 30;
  9569. g
  9570. .drawString(
  9571. "2: Try rebooting your computer, and reloading",
  9572. 30, l);
  9573. l += 30;
  9574. }
  9575. }
  9576.  
  9577. public URL getCodeBase() {
  9578. try {
  9579. return new URL(server + ":" + (80 + portOff));
  9580. } catch (Exception _ex) {
  9581. }
  9582. return null;
  9583. }
  9584.  
  9585. private void method95() {
  9586. for (int j = 0; j < npcCount; j++) {
  9587. int k = npcIndices[j];
  9588. NPC npc = npcArray[k];
  9589. if (npc != null)
  9590. method96(npc);
  9591. }
  9592. }
  9593.  
  9594. private void method96(Entity entity) {
  9595. if (entity.x < 128 || entity.y < 128 || entity.x >= 13184
  9596. || entity.y >= 13184) {
  9597. entity.anim = -1;
  9598. entity.anInt1520 = -1;
  9599. entity.anInt1547 = 0;
  9600. entity.anInt1548 = 0;
  9601. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  9602. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  9603. entity.method446();
  9604. }
  9605. if (entity == myPlayer
  9606. && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776)) {
  9607. entity.anim = -1;
  9608. entity.anInt1520 = -1;
  9609. entity.anInt1547 = 0;
  9610. entity.anInt1548 = 0;
  9611. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  9612. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  9613. entity.method446();
  9614. }
  9615. if (entity.anInt1547 > loopCycle)
  9616. method97(entity);
  9617. else if (entity.anInt1548 >= loopCycle)
  9618. method98(entity);
  9619. else
  9620. method99(entity);
  9621. method100(entity);
  9622. method101(entity);
  9623. }
  9624.  
  9625. private void method97(Entity entity) {
  9626. int i = entity.anInt1547 - loopCycle;
  9627. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9628. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9629. entity.x += (j - entity.x) / i;
  9630. entity.y += (k - entity.y) / i;
  9631. entity.anInt1503 = 0;
  9632. if (entity.anInt1549 == 0)
  9633. entity.turnDirection = 1024;
  9634. if (entity.anInt1549 == 1)
  9635. entity.turnDirection = 1536;
  9636. if (entity.anInt1549 == 2)
  9637. entity.turnDirection = 0;
  9638. if (entity.anInt1549 == 3)
  9639. entity.turnDirection = 512;
  9640. }
  9641.  
  9642. private void method98(Entity entity) {
  9643. if (entity.anInt1548 == loopCycle
  9644. || entity.anim == -1
  9645. || entity.anInt1529 != 0
  9646. || entity.anInt1528 + 1 > Animation.anims[entity.anim]
  9647. .method258(entity.anInt1527)) {
  9648. int i = entity.anInt1548 - entity.anInt1547;
  9649. int j = loopCycle - entity.anInt1547;
  9650. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  9651. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  9652. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  9653. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  9654. entity.x = (k * (i - j) + i1 * j) / i;
  9655. entity.y = (l * (i - j) + j1 * j) / i;
  9656. }
  9657. entity.anInt1503 = 0;
  9658. if (entity.anInt1549 == 0)
  9659. entity.turnDirection = 1024;
  9660. if (entity.anInt1549 == 1)
  9661. entity.turnDirection = 1536;
  9662. if (entity.anInt1549 == 2)
  9663. entity.turnDirection = 0;
  9664. if (entity.anInt1549 == 3)
  9665. entity.turnDirection = 512;
  9666. entity.anInt1552 = entity.turnDirection;
  9667. }
  9668.  
  9669. private void method99(Entity entity) {
  9670. entity.anInt1517 = entity.anInt1511;
  9671. if (entity.smallXYIndex == 0) {
  9672. entity.anInt1503 = 0;
  9673. return;
  9674. }
  9675. if (entity.anim != -1 && entity.anInt1529 == 0) {
  9676. Animation animation = Animation.anims[entity.anim];
  9677. if (entity.anInt1542 > 0 && animation.anInt363 == 0) {
  9678. entity.anInt1503++;
  9679. return;
  9680. }
  9681. if (entity.anInt1542 <= 0 && animation.anInt364 == 0) {
  9682. entity.anInt1503++;
  9683. return;
  9684. }
  9685. }
  9686. int i = entity.x;
  9687. int j = entity.y;
  9688. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  9689. * 64;
  9690. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  9691. * 64;
  9692. if (k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256) {
  9693. entity.x = k;
  9694. entity.y = l;
  9695. return;
  9696. }
  9697. if (i < k) {
  9698. if (j < l)
  9699. entity.turnDirection = 1280;
  9700. else if (j > l)
  9701. entity.turnDirection = 1792;
  9702. else
  9703. entity.turnDirection = 1536;
  9704. } else if (i > k) {
  9705. if (j < l)
  9706. entity.turnDirection = 768;
  9707. else if (j > l)
  9708. entity.turnDirection = 256;
  9709. else
  9710. entity.turnDirection = 512;
  9711. } else if (j < l)
  9712. entity.turnDirection = 1024;
  9713. else
  9714. entity.turnDirection = 0;
  9715. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9716. if (i1 > 1024)
  9717. i1 -= 2048;
  9718. int j1 = entity.anInt1555;
  9719. if (i1 >= -256 && i1 <= 256)
  9720. j1 = entity.anInt1554;
  9721. else if (i1 >= 256 && i1 < 768)
  9722. j1 = entity.anInt1557;
  9723. else if (i1 >= -768 && i1 <= -256)
  9724. j1 = entity.anInt1556;
  9725. if (j1 == -1)
  9726. j1 = entity.anInt1554;
  9727. entity.anInt1517 = j1;
  9728. int k1 = 4;
  9729. if (entity.anInt1552 != entity.turnDirection
  9730. && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  9731. k1 = 2;
  9732. if (entity.smallXYIndex > 2)
  9733. k1 = 6;
  9734. if (entity.smallXYIndex > 3)
  9735. k1 = 8;
  9736. if (entity.anInt1503 > 0 && entity.smallXYIndex > 1) {
  9737. k1 = 8;
  9738. entity.anInt1503--;
  9739. }
  9740. if (entity.aBooleanArray1553[entity.smallXYIndex - 1])
  9741. k1 <<= 1;
  9742. if (k1 >= 8 && entity.anInt1517 == entity.anInt1554
  9743. && entity.anInt1505 != -1)
  9744. entity.anInt1517 = entity.anInt1505;
  9745. if (i < k) {
  9746. entity.x += k1;
  9747. if (entity.x > k)
  9748. entity.x = k;
  9749. } else if (i > k) {
  9750. entity.x -= k1;
  9751. if (entity.x < k)
  9752. entity.x = k;
  9753. }
  9754. if (j < l) {
  9755. entity.y += k1;
  9756. if (entity.y > l)
  9757. entity.y = l;
  9758. } else if (j > l) {
  9759. entity.y -= k1;
  9760. if (entity.y < l)
  9761. entity.y = l;
  9762. }
  9763. if (entity.x == k && entity.y == l) {
  9764. entity.smallXYIndex--;
  9765. if (entity.anInt1542 > 0)
  9766. entity.anInt1542--;
  9767. }
  9768. }
  9769.  
  9770. private void method100(Entity entity) {
  9771. if (entity.anInt1504 == 0)
  9772. return;
  9773. if (entity.interactingEntity != -1 && entity.interactingEntity < 32768) {
  9774. NPC npc = npcArray[entity.interactingEntity];
  9775. if (npc != null) {
  9776. int i1 = entity.x - npc.x;
  9777. int k1 = entity.y - npc.y;
  9778. if (i1 != 0 || k1 != 0)
  9779. entity.turnDirection = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  9780. }
  9781. }
  9782. if (entity.interactingEntity >= 32768) {
  9783. int j = entity.interactingEntity - 32768;
  9784. if (j == unknownInt10)
  9785. j = myPlayerIndex;
  9786. Player player = playerArray[j];
  9787. if (player != null) {
  9788. int l1 = entity.x - player.x;
  9789. int i2 = entity.y - player.y;
  9790. if (l1 != 0 || i2 != 0)
  9791. entity.turnDirection = (int) (Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  9792. }
  9793. }
  9794. if ((entity.anInt1538 != 0 || entity.anInt1539 != 0)
  9795. && (entity.smallXYIndex == 0 || entity.anInt1503 > 0)) {
  9796. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  9797. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  9798. if (k != 0 || j1 != 0)
  9799. entity.turnDirection = (int) (Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  9800. entity.anInt1538 = 0;
  9801. entity.anInt1539 = 0;
  9802. }
  9803. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  9804. if (l != 0) {
  9805. if (l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  9806. entity.anInt1552 = entity.turnDirection;
  9807. else if (l > 1024)
  9808. entity.anInt1552 -= entity.anInt1504;
  9809. else
  9810. entity.anInt1552 += entity.anInt1504;
  9811. entity.anInt1552 &= 0x7ff;
  9812. if (entity.anInt1517 == entity.anInt1511
  9813. && entity.anInt1552 != entity.turnDirection) {
  9814. if (entity.anInt1512 != -1) {
  9815. entity.anInt1517 = entity.anInt1512;
  9816. return;
  9817. }
  9818. entity.anInt1517 = entity.anInt1554;
  9819. }
  9820. }
  9821. }
  9822.  
  9823. private void method101(Entity entity) {
  9824. entity.aBoolean1541 = false;
  9825. if (entity.anInt1517 != -1) {
  9826. Animation animation = Animation.anims[entity.anInt1517];
  9827. entity.anInt1519++;
  9828. if (entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518)) {
  9829. entity.anInt1519 = 1;//this is the frame delay. 0 is what it's normally at. higher number = faster animations.
  9830. entity.anInt1518++;
  9831. }
  9832. if (entity.anInt1518 >= animation.anInt352) {
  9833. entity.anInt1519 = 1;
  9834. entity.anInt1518 = 0;
  9835. }
  9836. }
  9837. if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
  9838. if (entity.anInt1521 < 0)
  9839. entity.anInt1521 = 0;
  9840. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  9841. for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352
  9842. && entity.anInt1522 > animation_1
  9843. .method258(entity.anInt1521); entity.anInt1521++)
  9844. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  9845.  
  9846. if (entity.anInt1521 >= animation_1.anInt352
  9847. && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  9848. entity.anInt1520 = -1;
  9849. }
  9850. if (entity.anim != -1 && entity.anInt1529 <= 1) {
  9851. Animation animation_2 = Animation.anims[entity.anim];
  9852. if (animation_2.anInt363 == 1 && entity.anInt1542 > 0
  9853. && entity.anInt1547 <= loopCycle
  9854. && entity.anInt1548 < loopCycle) {
  9855. entity.anInt1529 = 1;
  9856. return;
  9857. }
  9858. }
  9859. if (entity.anim != -1 && entity.anInt1529 == 0) {
  9860. Animation animation_3 = Animation.anims[entity.anim];
  9861. for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352
  9862. && entity.anInt1528 > animation_3
  9863. .method258(entity.anInt1527); entity.anInt1527++)
  9864. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  9865.  
  9866. if (entity.anInt1527 >= animation_3.anInt352) {
  9867. entity.anInt1527 -= animation_3.anInt356;
  9868. entity.anInt1530++;
  9869. if (entity.anInt1530 >= animation_3.anInt362)
  9870. entity.anim = -1;
  9871. if (entity.anInt1527 < 0
  9872. || entity.anInt1527 >= animation_3.anInt352)
  9873. entity.anim = -1;
  9874. }
  9875. entity.aBoolean1541 = animation_3.aBoolean358;
  9876. }
  9877. if (entity.anInt1529 > 0)
  9878. entity.anInt1529--;
  9879. }
  9880.  
  9881. private void drawGameScreen() {
  9882. if (fullscreenInterfaceID != -1
  9883. && (loadingStage == 2 || super.fullGameScreen != null)) {
  9884. if (loadingStage == 2) {
  9885. method119(anInt945, fullscreenInterfaceID);
  9886. if (openInterfaceID != -1) {
  9887. method119(anInt945, openInterfaceID);
  9888. }
  9889. anInt945 = 0;
  9890. resetAllImageProducers();
  9891. super.fullGameScreen.initDrawingArea();
  9892. Texture.anIntArray1472 = fullScreenTextureArray;
  9893. DrawingArea.setAllPixelsToZero();
  9894. welcomeScreenRaised = true;
  9895. if (openInterfaceID != -1) {
  9896. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  9897. if (rsInterface_1.width == 512
  9898. && rsInterface_1.height == 334
  9899. && rsInterface_1.type == 0) {
  9900. rsInterface_1.width = 765;
  9901. rsInterface_1.height = 503;
  9902. }
  9903. drawInterface(0, 0, rsInterface_1, 8);
  9904. }
  9905. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  9906. if (rsInterface.width == 512 && rsInterface.height == 334
  9907. && rsInterface.type == 0) {
  9908. rsInterface.width = 765;
  9909. rsInterface.height = 503;
  9910. }
  9911. drawInterface(0, 0, rsInterface, 8);
  9912.  
  9913. if (!menuOpen) {
  9914. processRightClick();
  9915. drawTooltip();
  9916. } else {
  9917. drawMenu();
  9918. }
  9919. }
  9920. drawCount++;
  9921. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  9922. return;
  9923. } else {
  9924. if (drawCount != 0) {
  9925. resetImageProducers2();
  9926. }
  9927. }
  9928. if (welcomeScreenRaised) {
  9929. welcomeScreenRaised = false;
  9930. if (!isFullScreen) {
  9931. topFrame.drawGraphics(0, super.graphics, 0);
  9932. leftFrame.drawGraphics(4, super.graphics, 0);
  9933. rightFrame.drawGraphics(4, super.graphics, 516);
  9934. mapEdgeIP.drawGraphics(4, super.graphics, 519);
  9935. }
  9936. needDrawTabArea = true;
  9937. inputTaken = true;
  9938. tabAreaAltered = true;
  9939. aBoolean1233 = true;
  9940. if (loadingStage != 2) {
  9941. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  9942. aRSImageProducer_1164.drawGraphics(0, super.graphics,
  9943. 519 + extraWidth);
  9944. }
  9945. }
  9946. if (menuOpen && menuScreenArea == 1)
  9947. needDrawTabArea = true;
  9948. if (invOverlayInterfaceID != -1) {
  9949. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  9950. if (flag1)
  9951. needDrawTabArea = true;
  9952. }
  9953. if (atInventoryInterfaceType == 2)
  9954. needDrawTabArea = true;
  9955. if (activeInterfaceType == 2)
  9956. needDrawTabArea = true;
  9957. if (needDrawTabArea) {
  9958. if (!isFullScreen)
  9959. drawTabArea();
  9960. needDrawTabArea = false;
  9961. }
  9962. if (backDialogID == -1) {
  9963. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  9964. if (super.mouseX > 478 && super.mouseX < 580
  9965. && super.mouseY > (clientHeight - 161))
  9966. method65(494, 110, super.mouseX - 0, super.mouseY
  9967. - (clientHeight - 155), aClass9_1059, 0, false,
  9968. anInt1211);
  9969. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  9970. if (i < 0)
  9971. i = 0;
  9972. if (i > anInt1211 - 110)
  9973. i = anInt1211 - 110;
  9974. if (anInt1089 != i) {
  9975. anInt1089 = i;
  9976. inputTaken = true;
  9977. }
  9978. }
  9979. if (backDialogID != -1) {
  9980. boolean flag2 = method119(anInt945, backDialogID);
  9981. if (flag2)
  9982. inputTaken = true;
  9983. }
  9984. if (atInventoryInterfaceType == 3)
  9985. inputTaken = true;
  9986. if (activeInterfaceType == 3)
  9987. inputTaken = true;
  9988. if (aString844 != null)
  9989. inputTaken = true;
  9990. if (menuOpen && menuScreenArea == 2)
  9991. inputTaken = true;
  9992. if (inputTaken && !isFullScreen) {
  9993. try {
  9994. drawChatArea();
  9995. } catch (Exception e) {
  9996. e.printStackTrace();
  9997. }
  9998. inputTaken = false;
  9999. }
  10000. if (loadingStage == 2)
  10001. try {
  10002. method146();
  10003. } catch (Exception e) {
  10004. }
  10005. if (loadingStage == 2 && !isFullScreen) {
  10006. drawMinimap();
  10007. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  10008. }
  10009. if (anInt1054 != -1)
  10010. tabAreaAltered = true;
  10011. if (tabAreaAltered) {
  10012. if (anInt1054 != -1 && anInt1054 == tabID) {
  10013. anInt1054 = -1;
  10014. stream.createFrame(120);
  10015. stream.writeWordBigEndian(tabID);
  10016. }
  10017. tabAreaAltered = false;
  10018. aRSImageProducer_1125.initDrawingArea();
  10019. aRSImageProducer_1165.initDrawingArea();
  10020. }
  10021. if (aBoolean1233) {
  10022. aBoolean1233 = false;
  10023. }
  10024. anInt945 = 0;
  10025. // RSInterface.resetRunesAndLevels(1541); //DERP
  10026. }
  10027.  
  10028. private void determineMenuSize() {
  10029. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  10030. for (int j = 0; j < menuActionRow; j++) {
  10031. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  10032. if (k > i)
  10033. i = k;
  10034. }
  10035. int x = isFullScreen ? extraWidth : 0;
  10036. int y = isFullScreen ? extraHeight : 0;
  10037. i += 8;
  10038. int l = 15 * menuActionRow + 21;
  10039. if (super.saveClickX > 4 && super.saveClickY > 4
  10040. && super.saveClickX < 516 && super.saveClickY < 338) {
  10041. int i1 = super.saveClickX - 4 - i / 2;
  10042. if (i1 + i > 512 + x)
  10043. i1 = 512 + x - i;
  10044. if (i1 < 0)
  10045. i1 = 0;
  10046. int l1 = super.saveClickY - 4;
  10047. if (l1 + l > 334 + y)
  10048. l1 = 334 + y - l;
  10049. if (l1 < 0)
  10050. l1 = 0;
  10051. menuOpen = true;
  10052. menuScreenArea = 0;
  10053. menuOffsetX = i1;
  10054. menuOffsetY = l1;
  10055. menuWidth = i;
  10056. menuHeight = 15 * menuActionRow + 22;
  10057. }
  10058. if (super.saveClickX > 519 && super.saveClickY > 168
  10059. && super.saveClickX < 765 + x && super.saveClickY < 503 + y) {
  10060. int j1 = super.saveClickX - 519 - i / 2;
  10061. if (j1 < 0)
  10062. j1 = 0;
  10063. else if (j1 + i > 245 + x)
  10064. j1 = 245 + x - i;
  10065. int i2 = super.saveClickY - 168;
  10066. if (i2 < 0)
  10067. i2 = 0;
  10068. else if (i2 + l > 333 + y)
  10069. i2 = 333 + y - l;
  10070. menuOpen = true;
  10071. menuOffsetX = j1;
  10072. menuOffsetY = i2;
  10073.  
  10074. menuScreenArea = 1;
  10075. menuWidth = i;
  10076. menuHeight = 15 * menuActionRow + 22;
  10077. }
  10078. if (super.saveClickX > 0 && super.saveClickY > 338
  10079. && super.saveClickX < 516 && super.saveClickY < 503 + y) {
  10080. int k1 = super.saveClickX - 0 - i / 2;
  10081. if (k1 < 0)
  10082. k1 = 0;
  10083. else if (k1 + i > 516)
  10084. k1 = 516 - i;
  10085. int j2 = super.saveClickY - 338;
  10086. if (j2 < 0)
  10087. j2 = 0;
  10088. else if (j2 + l > 165 + y)
  10089. j2 = 165 + y - l;
  10090. menuOpen = true;
  10091. menuOffsetX = k1;
  10092. menuOffsetY = j2;
  10093. menuWidth = i;
  10094.  
  10095. menuScreenArea = 2;
  10096. menuHeight = 15 * menuActionRow + 22;
  10097. }
  10098. if (super.saveClickX >= 515 + extraWidth && super.saveClickY >= 0
  10099. && super.saveClickX <= 765 + extraWidth
  10100. && super.saveClickY <= 169) {
  10101. int k1 = super.saveClickX - 515 - i / 2;
  10102. if (k1 < 0)
  10103. k1 = 0;
  10104. else if (k1 + i > 249 + extraWidth)
  10105. k1 = 249 + extraWidth - i;
  10106. int j2 = super.saveClickY;
  10107. if (j2 < 0)
  10108. j2 = 0;
  10109. else if (j2 + l > 168)
  10110. j2 = 168 - l;
  10111. menuOpen = true;
  10112. menuScreenArea = 3;
  10113. menuOffsetX = k1;
  10114. menuOffsetY = j2;
  10115. menuWidth = i;
  10116. menuHeight = 15 * menuActionRow + 22;
  10117. }
  10118. }
  10119.  
  10120. private boolean buildFriendsListMenu(RSInterface class9) {
  10121. int i = class9.contentType;
  10122. if (i >= 1 && i <= 200 || i >= 701 && i <= 900) {
  10123. if (i >= 801)
  10124. i -= 701;
  10125. else if (i >= 701)
  10126. i -= 601;
  10127. else if (i >= 101)
  10128. i -= 101;
  10129. else
  10130. i--;
  10131. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  10132. menuActionID[menuActionRow] = 792;
  10133. menuActionRow++;
  10134. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  10135. menuActionID[menuActionRow] = 639;
  10136. menuActionRow++;
  10137. return true;
  10138. }
  10139. if (i >= 401 && i <= 500) {
  10140. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  10141. menuActionID[menuActionRow] = 322;
  10142. menuActionRow++;
  10143. return true;
  10144. } else {
  10145. return false;
  10146. }
  10147. }
  10148.  
  10149. private void method104() {
  10150. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  10151. .reverseGetFirst();
  10152. for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  10153. .reverseGetNext())
  10154. if (class30_sub2_sub4_sub3.anInt1560 != plane
  10155. || class30_sub2_sub4_sub3.aBoolean1567)
  10156. class30_sub2_sub4_sub3.unlink();
  10157. else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
  10158. class30_sub2_sub4_sub3.method454(anInt945);
  10159. if (class30_sub2_sub4_sub3.aBoolean1567)
  10160. class30_sub2_sub4_sub3.unlink();
  10161. else
  10162. worldController.method285(class30_sub2_sub4_sub3.anInt1560,
  10163. 0, class30_sub2_sub4_sub3.anInt1563, -1,
  10164. class30_sub2_sub4_sub3.anInt1562, 60,
  10165. class30_sub2_sub4_sub3.anInt1561,
  10166. class30_sub2_sub4_sub3, false);
  10167. }
  10168.  
  10169. }
  10170.  
  10171. public void drawBlackBox(int xPos, int yPos) {
  10172. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  10173. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  10174. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  10175. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  10176. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  10177. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  10178. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  10179. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  10180. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  10181. }
  10182.  
  10183. private void drawInterface(int j, int k, RSInterface class9, int l) {
  10184. if (class9.type != 0 || class9.children == null)
  10185. return;
  10186. if (class9.isMouseoverTriggered && anInt1026 != class9.id
  10187. && anInt1048 != class9.id && anInt1039 != class9.id)
  10188. return;
  10189. int i1 = DrawingArea.topX;
  10190. int j1 = DrawingArea.topY;
  10191. int k1 = DrawingArea.bottomX;
  10192. int l1 = DrawingArea.bottomY;
  10193. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  10194. int i2 = class9.children.length;
  10195. for (int j2 = 0; j2 < i2; j2++) {
  10196. int k2 = class9.childX[j2] + k;
  10197. int l2 = (class9.childY[j2] + l) - j;
  10198. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  10199. k2 += class9_1.anInt263;
  10200. l2 += class9_1.anInt265;
  10201. if (class9_1.contentType > 0)
  10202. drawFriendsListOrWelcomeScreen(class9_1);
  10203. // here
  10204. int[] IDs = { 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258,
  10205. 1267, 1274, 1283, 1573, 1290, 1299, 1308, 1315, 1324, 1333,
  10206. 1340, 1349, 1358, 1367, 1374, 1381, 1388, 1397, 1404, 1583,
  10207. 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469,
  10208. 15878, 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503,
  10209. 1512, 1521, 1530, 1544, 1553, 1563, 1593, 1635, 12426,
  10210. 12436, 12446, 12456, 6004, 18471,
  10211. /* Ancients */
  10212. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012,
  10213. 13054, 12920, 12882, 13062, 12952, 13000, 13070, 12912,
  10214. 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096 };
  10215. for (int m5 = 0; m5 < IDs.length; m5++) {
  10216. if (class9_1.id == IDs[m5] + 1) {
  10217. if (m5 > 61)
  10218. drawBlackBox(k2 + 1, l2);
  10219. else
  10220. drawBlackBox(k2, l2 + 1);
  10221. }
  10222. }
  10223. int[] runeChildren = { 1202, 1203, 1209, 1210, 1211, 1218, 1219,
  10224. 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245, 1252,
  10225. 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279,
  10226. 1286, 1287, 1293, 1294, 1295, 1302, 1303, 1304, 1311, 1312,
  10227. 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344,
  10228. 1345, 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377,
  10229. 1378, 1384, 1385, 1391, 1392, 1393, 1400, 1401, 1407, 1408,
  10230. 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441,
  10231. 1442, 1449, 1450, 1456, 1457, 1463, 1464, 1465, 1472, 1473,
  10232. 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499, 1506,
  10233. 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534,
  10234. 1535, 1547, 1548, 1549, 1556, 1557, 1558, 1566, 1567, 1568,
  10235. 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605,
  10236. 1606, 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639,
  10237. 1640, 6007, 6008, 6011, 8673, 8674, 12041, 12042, 12429,
  10238. 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451,
  10239. 12459, 12460, 15881, 15882, 15885, 18474, 18475, 18478 };
  10240. for (int r = 0; r < runeChildren.length; r++)
  10241. if (class9_1.id == runeChildren[r])
  10242. class9_1.modelZoom = 775;
  10243. if (class9_1.type == 0) {
  10244. if (class9_1.scrollPosition > class9_1.scrollMax
  10245. - class9_1.height)
  10246. class9_1.scrollPosition = class9_1.scrollMax
  10247. - class9_1.height;
  10248. if (class9_1.scrollPosition < 0)
  10249. class9_1.scrollPosition = 0;
  10250. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  10251. if (class9_1.scrollMax > class9_1.height) {
  10252. // clan chat//this
  10253. if (class9_1.id == 18143) {
  10254. int clanMates = 0;
  10255. for (int i = 18155; i < 18244; i++) {
  10256. RSInterface line = RSInterface.interfaceCache[i];
  10257. if (line.message.length() > 0) {
  10258. clanMates++;
  10259. }
  10260. }
  10261. class9_1.scrollMax = (clanMates * 14)
  10262. + class9_1.height + 1;
  10263. }
  10264. if (class9_1.id == 18322 || class9_1.id == 18423) {
  10265. int members = 0;
  10266. for (int i = class9_1.id + 1; i < class9_1.id + 1 + 100; i++) {
  10267. RSInterface line = RSInterface.interfaceCache[i];
  10268. if (line != null && line.message != null) {
  10269. if (line.message.length() > 0) {
  10270. members++;
  10271. }
  10272. }
  10273. }
  10274. class9_1.scrollMax = (members * 14) + 1;
  10275. }
  10276. drawScrollbar(class9_1.height, class9_1.scrollPosition,
  10277. l2, k2 + class9_1.width, class9_1.scrollMax);
  10278. }
  10279. } else if (class9_1.type != 1)
  10280. if (class9_1.type == 2) {
  10281. int i3 = 0;
  10282. for (int l3 = 0; l3 < class9_1.height; l3++) {
  10283. for (int l4 = 0; l4 < class9_1.width; l4++) {
  10284. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  10285. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  10286. if (i3 < 20) {
  10287. k5 += class9_1.spritesX[i3];
  10288. j6 += class9_1.spritesY[i3];
  10289. }
  10290. if (class9_1.inv[i3] > 0) {
  10291. int k6 = 0;
  10292. int j7 = 0;
  10293. int j9 = class9_1.inv[i3] - 1;
  10294. if (k5 > DrawingArea.topX - 32
  10295. && k5 < DrawingArea.bottomX
  10296. && j6 > DrawingArea.topY - 32
  10297. && j6 < DrawingArea.bottomY
  10298. || activeInterfaceType != 0
  10299. && anInt1085 == i3) {
  10300. int l9 = 0;
  10301. if (itemSelected == 1 && anInt1283 == i3
  10302. && anInt1284 == class9_1.id)
  10303. l9 = 0xffffff;
  10304. Sprite class30_sub2_sub1_sub1_2 = ItemDef
  10305. .getSprite(j9,
  10306. class9_1.invStackSizes[i3],
  10307. l9);
  10308. if (class30_sub2_sub1_sub1_2 != null) {
  10309. if (activeInterfaceType != 0
  10310. && anInt1085 == i3
  10311. && anInt1084 == class9_1.id) {
  10312. k6 = super.mouseX - anInt1087;
  10313. j7 = super.mouseY - anInt1088;
  10314. if (k6 < 5 && k6 > -5)
  10315. k6 = 0;
  10316. if (j7 < 5 && j7 > -5)
  10317. j7 = 0;
  10318. if (anInt989 < 10) {
  10319. k6 = 0;
  10320. j7 = 0;
  10321. }
  10322. class30_sub2_sub1_sub1_2
  10323. .drawSprite1(k5 + k6, j6
  10324. + j7);
  10325. if (j6 + j7 < DrawingArea.topY
  10326. && class9.scrollPosition > 0) {
  10327. int i10 = (anInt945 * (DrawingArea.topY
  10328. - j6 - j7)) / 3;
  10329. if (i10 > anInt945 * 10)
  10330. i10 = anInt945 * 10;
  10331. if (i10 > class9.scrollPosition)
  10332. i10 = class9.scrollPosition;
  10333. class9.scrollPosition -= i10;
  10334. anInt1088 += i10;
  10335. }
  10336. if (j6 + j7 + 32 > DrawingArea.bottomY
  10337. && class9.scrollPosition < class9.scrollMax
  10338. - class9.height) {
  10339. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  10340. if (j10 > anInt945 * 10)
  10341. j10 = anInt945 * 10;
  10342. if (j10 > class9.scrollMax
  10343. - class9.height
  10344. - class9.scrollPosition)
  10345. j10 = class9.scrollMax
  10346. - class9.height
  10347. - class9.scrollPosition;
  10348. class9.scrollPosition += j10;
  10349. anInt1088 -= j10;
  10350. }
  10351. } else if (atInventoryInterfaceType != 0
  10352. && atInventoryIndex == i3
  10353. && atInventoryInterface == class9_1.id)
  10354. class30_sub2_sub1_sub1_2
  10355. .drawSprite1(k5, j6);
  10356. else
  10357. class30_sub2_sub1_sub1_2
  10358. .drawSprite(k5, j6);
  10359. if (class30_sub2_sub1_sub1_2.anInt1444 == 33
  10360. || class9_1.invStackSizes[i3] != 1) {
  10361. int k10 = class9_1.invStackSizes[i3];
  10362. if (intToKOrMil(k10) == "@inf@") {
  10363. infinity.drawSprite(k5 + k6, j6
  10364. + j7);
  10365. } else {
  10366. if (k10 >= 1) {
  10367. smallText.method385(0,
  10368. intToKOrMil(k10),
  10369. j6 + 10 + j7, k5
  10370. + 1 + k6);
  10371. smallText.method385(
  10372. 0xFFFF00,
  10373. intToKOrMil(k10),
  10374. j6 + 9 + j7, k5
  10375. + k6);
  10376. }
  10377. if (k10 >= 100000) {
  10378. smallText.method385(0,
  10379. intToKOrMil(k10),
  10380. j6 + 10 + j7, k5
  10381. + 1 + k6);
  10382. smallText.method385(
  10383. 0xFFFFFF,
  10384. intToKOrMil(k10),
  10385. j6 + 9 + j7, k5
  10386. + k6);
  10387. }
  10388. if (k10 >= 10000000) {
  10389. smallText.method385(0,
  10390. intToKOrMil(k10),
  10391. j6 + 10 + j7, k5
  10392. + 1 + k6);
  10393. smallText.method385(
  10394. 0x00ff80,
  10395. intToKOrMil(k10),
  10396. j6 + 9 + j7, k5
  10397. + k6);
  10398. }
  10399. /*
  10400. * smallText.method385(0,
  10401. * intToKOrMil(k10), j6 + 10 +
  10402. * j7, k5 + 1 + k6);
  10403. * smallText.method385(0xffff00,
  10404. * intToKOrMil(k10), j6 + 9 +
  10405. * j7, k5 + k6);
  10406. */
  10407. }
  10408. }
  10409. }
  10410. }
  10411. } else if (class9_1.sprites != null && i3 < 20) {
  10412. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  10413. if (class30_sub2_sub1_sub1_1 != null)
  10414. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  10415. }
  10416. i3++;
  10417. }
  10418. }
  10419. } else if (class9_1.type == 3) {
  10420. boolean flag = false;
  10421. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id
  10422. || anInt1026 == class9_1.id)
  10423. flag = true;
  10424. int j3;
  10425. if (interfaceIsSelected(class9_1)) {
  10426. j3 = class9_1.anInt219;
  10427. if (flag && class9_1.anInt239 != 0)
  10428. j3 = class9_1.anInt239;
  10429. } else {
  10430. j3 = class9_1.textColor;
  10431. if (flag && class9_1.anInt216 != 0)
  10432. j3 = class9_1.anInt216;
  10433. }
  10434. if (class9_1.aByte254 == 0) {
  10435. if (class9_1.aBoolean227)
  10436. DrawingArea.drawPixels(class9_1.height, l2, k2, j3,
  10437. class9_1.width);
  10438. else
  10439. DrawingArea.fillPixels(k2, class9_1.width,
  10440. class9_1.height, j3, l2);
  10441. } else if (class9_1.aBoolean227)
  10442. DrawingArea.method335(j3, l2, class9_1.width,
  10443. class9_1.height,
  10444. 256 - (class9_1.aByte254 & 0xff), k2);
  10445. else
  10446. DrawingArea.method338(l2, class9_1.height,
  10447. 256 - (class9_1.aByte254 & 0xff), j3,
  10448. class9_1.width, k2);
  10449. } else if (class9_1.type == 4) {
  10450. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  10451. String s = class9_1.message;
  10452. boolean flag1 = false;
  10453. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id
  10454. || anInt1026 == class9_1.id)
  10455. flag1 = true;
  10456. int i4;
  10457. if (interfaceIsSelected(class9_1)) {
  10458. i4 = class9_1.anInt219;
  10459. if (flag1 && class9_1.anInt239 != 0)
  10460. i4 = class9_1.anInt239;
  10461. if (class9_1.aString228.length() > 0)
  10462. s = class9_1.aString228;
  10463. } else {
  10464. i4 = class9_1.textColor;
  10465. if (flag1 && class9_1.anInt216 != 0)
  10466. i4 = class9_1.anInt216;
  10467. }
  10468. if (class9_1.atActionType == 6 && aBoolean1149) {
  10469. s = "Please wait...";
  10470. i4 = class9_1.textColor;
  10471. }
  10472. if (DrawingArea.width == 519) {
  10473. if (i4 == 0xffff00)
  10474. i4 = 255;
  10475. if (i4 == 49152)
  10476. i4 = 0xffffff;
  10477. }
  10478. if ((class9_1.parentID == 1151)
  10479. || (class9_1.parentID == 12855)) {
  10480. switch (i4) {
  10481. case 16773120:
  10482. i4 = 0xFE981F;
  10483. break;
  10484. case 7040819:
  10485. i4 = 0xAF6A1A;
  10486. break;
  10487. }
  10488. }
  10489. // Skill interface
  10490. int id = 4004;
  10491. int id2 = 4005;
  10492. if (class9_1.parentID == 3917 && class9_1.id != id
  10493. && class9_1.id != id + 2 && class9_1.id != id + 4
  10494. && class9_1.id != id + 6 && class9_1.id != id + 8
  10495. && class9_1.id != id + 10 && class9_1.id != id + 12
  10496. && class9_1.id != id + 14 && class9_1.id != id + 16
  10497. && class9_1.id != id + 18 && class9_1.id != id + 20
  10498. && class9_1.id != id + 23 && class9_1.id != id + 24
  10499. && class9_1.id != id + 26 && class9_1.id != id + 28
  10500. && class9_1.id != id + 30 && class9_1.id != id + 32
  10501. && class9_1.id != id + 34 && class9_1.id != 13926
  10502. && class9_1.id != 4152 && class9_1.id != 12166
  10503. && class9_1.id != id2 && class9_1.id != id2 + 2
  10504. && class9_1.id != id2 + 4 && class9_1.id != id2 + 6
  10505. && class9_1.id != id2 + 8
  10506. && class9_1.id != id2 + 10
  10507. && class9_1.id != id2 + 12
  10508. && class9_1.id != id2 + 14
  10509. && class9_1.id != id2 + 16
  10510. && class9_1.id != id2 + 18
  10511. && class9_1.id != id2 + 20
  10512. && class9_1.id != id2 + 23
  10513. && class9_1.id != id2 + 24
  10514. && class9_1.id != id2 + 26
  10515. && class9_1.id != id2 + 28
  10516. && class9_1.id != id2 + 30
  10517. && class9_1.id != id2 + 32
  10518. && class9_1.id != id2 + 34 && class9_1.id != 13927
  10519. && class9_1.id != 4153 && class9_1.id != 12167
  10520. && class9_1.id != 4026) {
  10521. if (i4 == 16776960)
  10522. i4 = 0x0000;
  10523. class9_1.textShadow = false;
  10524. }
  10525. for (int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497) {
  10526. if (s.indexOf("%") != -1) {
  10527. do {
  10528. int k7 = s.indexOf("%1");
  10529. if (k7 == -1)
  10530. break;
  10531. if (class9_1.id < 4000 || class9_1.id > 5000
  10532. && class9_1.id != 13921
  10533. && class9_1.id != 13922
  10534. && class9_1.id != 12171
  10535. && class9_1.id != 12172)
  10536. s = s.substring(0, k7)
  10537. + methodR(extractInterfaceValues(
  10538. class9_1, 0))
  10539. + s.substring(k7 + 2);
  10540. else
  10541. s = s.substring(0, k7)
  10542. + interfaceIntToString(extractInterfaceValues(
  10543. class9_1, 0))
  10544. + s.substring(k7 + 2);
  10545. } while (true);
  10546. do {
  10547. int l7 = s.indexOf("%2");
  10548. if (l7 == -1)
  10549. break;
  10550. s = s.substring(0, l7)
  10551. + interfaceIntToString(extractInterfaceValues(
  10552. class9_1, 1))
  10553. + s.substring(l7 + 2);
  10554. } while (true);
  10555. do {
  10556. int i8 = s.indexOf("%3");
  10557. if (i8 == -1)
  10558. break;
  10559. s = s.substring(0, i8)
  10560. + interfaceIntToString(extractInterfaceValues(
  10561. class9_1, 2))
  10562. + s.substring(i8 + 2);
  10563. } while (true);
  10564. do {
  10565. int j8 = s.indexOf("%4");
  10566. if (j8 == -1)
  10567. break;
  10568. s = s.substring(0, j8)
  10569. + interfaceIntToString(extractInterfaceValues(
  10570. class9_1, 3))
  10571. + s.substring(j8 + 2);
  10572. } while (true);
  10573. do {
  10574. int k8 = s.indexOf("%5");
  10575. if (k8 == -1)
  10576. break;
  10577. s = s.substring(0, k8)
  10578. + interfaceIntToString(extractInterfaceValues(
  10579. class9_1, 4))
  10580. + s.substring(k8 + 2);
  10581. } while (true);
  10582. }
  10583. int l8 = s.indexOf("\\n");
  10584. String s1;
  10585. if (l8 != -1) {
  10586. s1 = s.substring(0, l8);
  10587. s = s.substring(l8 + 2);
  10588. } else {
  10589. s1 = s;
  10590. s = "";
  10591. }
  10592. /*if (class9_1.centerText)
  10593. textDrawingArea.method382(i4, k2 + class9_1.width
  10594. / 2, s1, l6, class9_1.textShadow);
  10595. else
  10596. textDrawingArea.method389(class9_1.textShadow, k2,
  10597. i4, s1, l6);*/
  10598.  
  10599. RSFont font = null;
  10600. if (textDrawingArea == smallText) {
  10601. font = newSmallFont;
  10602. } else if (textDrawingArea == aTextDrawingArea_1271) {
  10603. font = newRegularFont;
  10604. } else if (textDrawingArea == chatTextDrawingArea) {
  10605. font = newBoldFont;
  10606. }
  10607. if (class9_1.centerText) {
  10608.  
  10609. if(font != null)
  10610. font.drawCenteredString(s1,
  10611. k2 + class9_1.width / 2, l6, i4,
  10612. class9_1.textShadow ? 0 : -1);
  10613. else
  10614. textDrawingArea.method382(i4, k2 + class9_1.width
  10615. / 2, s1, l6, class9_1.textShadow);
  10616.  
  10617. } else {
  10618. if(font != null)
  10619. font.drawBasicString(s1, k2, l6, i4,
  10620. class9_1.textShadow ? 0 : -1);
  10621. else
  10622. textDrawingArea.method389(class9_1.textShadow, k2,
  10623. i4, s1, l6);
  10624. }
  10625. }
  10626. } else if (class9_1.type == 5) {
  10627. // whats this?
  10628.  
  10629. Sprite sprite;
  10630. if (interfaceIsSelected(class9_1))
  10631. sprite = class9_1.sprite2;
  10632. else
  10633. sprite = class9_1.sprite1;
  10634. if (sprite != null) {
  10635. if (spellSelected == 1 && class9_1.id == spellID && spellID != 0)
  10636. sprite.Outlining(k2, l2, 0xffffff);
  10637. else
  10638. sprite.drawSprite(k2, l2);
  10639. }
  10640. if (Autocast && class9_1.id == autocastId)
  10641. magicAuto.drawSprite(k2 - 3, l2 - 3);
  10642. if (sprite != null)
  10643. sprite.drawSprite(k2, l2);
  10644. } else if (class9_1.type == 6) {
  10645. int k3 = Texture.textureInt1;
  10646. int j4 = Texture.textureInt2;
  10647. Texture.textureInt1 = k2 + class9_1.width / 2;
  10648. Texture.textureInt2 = l2 + class9_1.height / 2;
  10649. int i5 = Texture.anIntArray1470[class9_1.modelRotation1]
  10650. * class9_1.modelZoom >> 16;
  10651. int l5 = Texture.anIntArray1471[class9_1.modelRotation1]
  10652. * class9_1.modelZoom >> 16;
  10653. boolean flag2 = interfaceIsSelected(class9_1);
  10654. int i7;
  10655. if (flag2)
  10656. i7 = class9_1.anInt258;
  10657. else
  10658. i7 = class9_1.anInt257;
  10659. Model model;
  10660. if (i7 == -1) {
  10661. model = class9_1.method209(-1, -1, flag2);
  10662. } else {
  10663. Animation animation = Animation.anims[i7];
  10664. model = class9_1.method209(
  10665. animation.anIntArray354[class9_1.anInt246],
  10666. animation.anIntArray353[class9_1.anInt246],
  10667. flag2);
  10668. }
  10669. if (model != null)
  10670. model.method482(class9_1.modelRotation2, 0,
  10671. class9_1.modelRotation1, 0, i5, l5);
  10672. Texture.textureInt1 = k3;
  10673. Texture.textureInt2 = j4;
  10674. } else if (class9_1.type == 7) {
  10675. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  10676. int k4 = 0;
  10677. for (int j5 = 0; j5 < class9_1.height; j5++) {
  10678. for (int i6 = 0; i6 < class9_1.width; i6++) {
  10679. if (class9_1.inv[k4] > 0) {
  10680. ItemDef itemDef = ItemDef
  10681. .forID(class9_1.inv[k4] - 1);
  10682. String s2 = itemDef.name;
  10683. if (itemDef.stackable
  10684. || class9_1.invStackSizes[k4] != 1)
  10685. s2 = s2
  10686. + " x"
  10687. + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  10688. int i9 = k2 + i6
  10689. * (115 + class9_1.invSpritePadX);
  10690. int k9 = l2 + j5
  10691. * (12 + class9_1.invSpritePadY);
  10692. if (class9_1.centerText)
  10693. textDrawingArea_1.method382(
  10694. class9_1.textColor, i9
  10695. + class9_1.width / 2, s2,
  10696. k9, class9_1.textShadow);
  10697. else
  10698. textDrawingArea_1.method389(
  10699. class9_1.textShadow, i9,
  10700. class9_1.textColor, s2, k9);
  10701. }
  10702. k4++;
  10703. }
  10704. }
  10705. } else if (class9_1.type == 8) {
  10706. String hoverText;
  10707. if (interfaceIsSelected(class9_1)) {
  10708. hoverText = class9_1.aString228;
  10709. } else
  10710. hoverText = class9_1.message;
  10711. drawHoverBox(k2, l2, hoverText);
  10712. // drawHoverBox(k2, l2, class9_1.popupString);
  10713. }
  10714. }
  10715. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  10716. }
  10717.  
  10718. private void randomizeBackground(Background background) {
  10719. int j = 256;
  10720. for (int k = 0; k < anIntArray1190.length; k++)
  10721. anIntArray1190[k] = 0;
  10722.  
  10723. for (int l = 0; l < 5000; l++) {
  10724. int i1 = (int) (Math.random() * 128D * (double) j);
  10725. anIntArray1190[i1] = (int) (Math.random() * 256D);
  10726. }
  10727. for (int j1 = 0; j1 < 20; j1++) {
  10728. for (int k1 = 1; k1 < j - 1; k1++) {
  10729. for (int i2 = 1; i2 < 127; i2++) {
  10730. int k2 = i2 + (k1 << 7);
  10731. anIntArray1191[k2] = (anIntArray1190[k2 - 1]
  10732. + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  10733. }
  10734.  
  10735. }
  10736. int ai[] = anIntArray1190;
  10737. anIntArray1190 = anIntArray1191;
  10738. anIntArray1191 = ai;
  10739. }
  10740. if (background != null) {
  10741. int l1 = 0;
  10742. for (int j2 = 0; j2 < background.anInt1453; j2++) {
  10743. for (int l2 = 0; l2 < background.anInt1452; l2++)
  10744. if (background.aByteArray1450[l1++] != 0) {
  10745. int i3 = l2 + 16 + background.anInt1454;
  10746. int j3 = j2 + 16 + background.anInt1455;
  10747. int k3 = i3 + (j3 << 7);
  10748. anIntArray1190[k3] = 0;
  10749. }
  10750. }
  10751. }
  10752. }
  10753.  
  10754. private void method107(int i, int j, Stream stream, Player player) {
  10755. if ((i & 0x400) != 0) {
  10756. player.anInt1543 = stream.method428();
  10757. player.anInt1545 = stream.method428();
  10758. player.anInt1544 = stream.method428();
  10759. player.anInt1546 = stream.method428();
  10760. player.anInt1547 = stream.method436() + loopCycle;
  10761. player.anInt1548 = stream.method435() + loopCycle;
  10762. player.anInt1549 = stream.method428();
  10763. player.method446();
  10764. }
  10765. if ((i & 0x100) != 0) {
  10766. player.anInt1520 = stream.method434();
  10767. int k = stream.readDWord();
  10768. player.anInt1524 = k >> 16;
  10769. player.anInt1523 = loopCycle + (k & 0xffff);
  10770. player.anInt1521 = 0;
  10771. player.anInt1522 = 0;
  10772. if (player.anInt1523 > loopCycle)
  10773. player.anInt1521 = -1;
  10774. if (player.anInt1520 == 65535)
  10775. player.anInt1520 = -1;
  10776. }
  10777. if ((i & 8) != 0) {
  10778. int l = stream.method434();
  10779. if (l == 65535)
  10780. l = -1;
  10781. int i2 = stream.method427();
  10782. if (l == player.anim && l != -1) {
  10783. int i3 = Animation.anims[l].anInt365;
  10784. if (i3 == 1) {
  10785. player.anInt1527 = 0;
  10786. player.anInt1528 = 0;
  10787. player.anInt1529 = i2;
  10788. player.anInt1530 = 0;
  10789. }
  10790. if (i3 == 2)
  10791. player.anInt1530 = 0;
  10792. } else if (l == -1
  10793. || player.anim == -1
  10794. || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359) {
  10795. player.anim = l;
  10796. player.anInt1527 = 0;
  10797. player.anInt1528 = 0;
  10798. player.anInt1529 = i2;
  10799. player.anInt1530 = 0;
  10800. player.anInt1542 = player.smallXYIndex;
  10801. }
  10802. }
  10803. if ((i & 4) != 0) {
  10804. player.textSpoken = stream.readString();
  10805. if (player.textSpoken.charAt(0) == '~') {
  10806. player.textSpoken = player.textSpoken.substring(1);
  10807. pushMessage(player.textSpoken, 2, player.name);
  10808. } else if (player == myPlayer)
  10809. pushMessage(player.textSpoken, 2, player.name);
  10810. player.anInt1513 = 0;
  10811. player.anInt1531 = 0;
  10812. player.textCycle = 150;
  10813. }
  10814. if ((i & 0x80) != 0) {
  10815. // right fucking here
  10816. int i1 = stream.method434();
  10817. int j2 = stream.readUnsignedByte();
  10818. int j3 = stream.method427();
  10819. int k3 = stream.currentOffset;
  10820. if (player.name != null && player.visible) {
  10821. long l3 = TextClass.longForName(player.name);
  10822. boolean flag = false;
  10823. if (j2 <= 1) {
  10824. for (int i4 = 0; i4 < ignoreCount; i4++) {
  10825. if (ignoreListAsLongs[i4] != l3)
  10826. continue;
  10827. flag = true;
  10828. break;
  10829. }
  10830.  
  10831. }
  10832. if (!flag && anInt1251 == 0)
  10833. try {
  10834. aStream_834.currentOffset = 0;
  10835. stream.method442(j3, 0, aStream_834.buffer);
  10836. aStream_834.currentOffset = 0;
  10837. String s = TextInput.method525(j3, aStream_834);
  10838. // s = Censor.doCensor(s);
  10839. player.textSpoken = s;
  10840. player.anInt1513 = i1 >> 8;
  10841. player.privelage = j2;
  10842. player.anInt1531 = i1 & 0xff;
  10843. player.textCycle = 150;
  10844. if (j2 == 3)
  10845. pushMessage(s, 1, "@cr1@" + player.name);
  10846. else if (j2 == 2)
  10847. pushMessage(s, 1, "@cr1@" + player.name);
  10848. else if (j2 == 4)
  10849. pushMessage(s, 1, "@cr2@" + player.name);
  10850. else if (j2 == 5)
  10851. pushMessage(s, 1, "@cr3@" + player.name);
  10852. else if (j2 == 6)
  10853. pushMessage(s, 1, "@cr4@" + player.name);
  10854. else if (j2 == 1)
  10855. pushMessage(s, 1, "@cr0@" + player.name);
  10856. else
  10857. pushMessage(s, 2, player.name);
  10858. } catch (Exception exception) {
  10859. signlink.reporterror("cde2");
  10860. }
  10861. }
  10862. stream.currentOffset = k3 + j3;
  10863. }
  10864. if ((i & 1) != 0) {
  10865. player.interactingEntity = stream.method434();
  10866. if (player.interactingEntity == 65535)
  10867. player.interactingEntity = -1;
  10868. }
  10869. if ((i & 0x10) != 0) {
  10870. int j1 = stream.method427();
  10871. byte abyte0[] = new byte[j1];
  10872. Stream stream_1 = new Stream(abyte0);
  10873. stream.readBytes(j1, 0, abyte0);
  10874. aStreamArray895s[j] = stream_1;
  10875. player.updatePlayer(stream_1);
  10876. }
  10877. if ((i & 2) != 0) {
  10878. player.anInt1538 = stream.method436();
  10879. player.anInt1539 = stream.method434();
  10880. }
  10881. if ((i & 0x20) != 0) {
  10882. int k1 = stream.readUnsignedByte();
  10883. int k2 = stream.method426();
  10884. player.updateHitData(k2, k1, loopCycle);
  10885. player.loopCycleStatus = loopCycle + 300;
  10886. player.currentHealth = stream.method427();
  10887. player.maxHealth = stream.readUnsignedByte();
  10888. }
  10889. if ((i & 0x200) != 0) {
  10890. int l1 = stream.readUnsignedByte();
  10891. int l2 = stream.method428();
  10892. player.updateHitData(l2, l1, loopCycle);
  10893. player.loopCycleStatus = loopCycle + 300;
  10894. player.currentHealth = stream.readUnsignedByte();
  10895. player.maxHealth = stream.method427();
  10896. }
  10897. }
  10898.  
  10899. private void method108() {
  10900. try {
  10901. int j = myPlayer.x + anInt1278;
  10902. int k = myPlayer.y + anInt1131;
  10903. if (anInt1014 - j < -500 || anInt1014 - j > 500
  10904. || anInt1015 - k < -500 || anInt1015 - k > 500) {
  10905. anInt1014 = j;
  10906. anInt1015 = k;
  10907. }
  10908. if (anInt1014 != j)
  10909. anInt1014 += (j - anInt1014) / 16;
  10910. if (anInt1015 != k)
  10911. anInt1015 += (k - anInt1015) / 16;
  10912. if (super.keyArray[1] == 1)
  10913. anInt1186 += (-24 - anInt1186) / 2;
  10914. else if (super.keyArray[2] == 1)
  10915. anInt1186 += (24 - anInt1186) / 2;
  10916. else
  10917. anInt1186 /= 2;
  10918. if (super.keyArray[3] == 1)
  10919. anInt1187 += (12 - anInt1187) / 2;
  10920. else if (super.keyArray[4] == 1)
  10921. anInt1187 += (-12 - anInt1187) / 2;
  10922. else
  10923. anInt1187 /= 2;
  10924. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  10925. anInt1184 += anInt1187 / 2;
  10926. if (anInt1184 < 128)
  10927. anInt1184 = 128;
  10928. if (anInt1184 > 383)
  10929. anInt1184 = 383;
  10930. int l = anInt1014 >> 7;
  10931. int i1 = anInt1015 >> 7;
  10932. int j1 = method42(plane, anInt1015, anInt1014);
  10933. int k1 = 0;
  10934. if (l > 3 && i1 > 3 && l < 100 && i1 < 100) {
  10935. for (int l1 = l - 4; l1 <= l + 4; l1++) {
  10936. for (int k2 = i1 - 4; k2 <= i1 + 4; k2++) {
  10937. int l2 = plane;
  10938. if (l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  10939. l2++;
  10940. int i3 = j1 - intGroundArray[l2][l1][k2];
  10941. if (i3 > k1)
  10942. k1 = i3;
  10943. }
  10944.  
  10945. }
  10946.  
  10947. }
  10948. anInt1005++;
  10949. if (anInt1005 > 1512) {
  10950. anInt1005 = 0;
  10951. stream.createFrame(77);
  10952. stream.writeWordBigEndian(0);
  10953. int i2 = stream.currentOffset;
  10954. stream.writeWordBigEndian((int) (Math.random() * 256D));
  10955. stream.writeWordBigEndian(101);
  10956. stream.writeWordBigEndian(233);
  10957. stream.writeWord(45092);
  10958. if ((int) (Math.random() * 2D) == 0)
  10959. stream.writeWord(35784);
  10960. stream.writeWordBigEndian((int) (Math.random() * 256D));
  10961. stream.writeWordBigEndian(64);
  10962. stream.writeWordBigEndian(38);
  10963. stream.writeWord((int) (Math.random() * 65536D));
  10964. stream.writeWord((int) (Math.random() * 65536D));
  10965. stream.writeBytes(stream.currentOffset - i2);
  10966. }
  10967. int j2 = k1 * 192;
  10968. if (j2 > 0x17f00)
  10969. j2 = 0x17f00;
  10970. if (j2 < 32768)
  10971. j2 = 32768;
  10972. if (j2 > anInt984) {
  10973. anInt984 += (j2 - anInt984) / 24;
  10974. return;
  10975. }
  10976. if (j2 < anInt984) {
  10977. anInt984 += (j2 - anInt984) / 80;
  10978. }
  10979. } catch (Exception _ex) {
  10980. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y
  10981. + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + ","
  10982. + anInt1070 + "," + baseX + "," + baseY);
  10983. throw new RuntimeException("eek");
  10984. }
  10985. }
  10986.  
  10987. public void processDrawing() {
  10988. if (rsAlreadyLoaded || loadingError || genericLoadingError) {
  10989. showErrorScreen();
  10990. return;
  10991. }
  10992. anInt1061++;
  10993. if (!loggedIn)
  10994. drawLoginScreen();
  10995. else
  10996. drawGameScreen();
  10997. anInt1213 = 0;
  10998. }
  10999.  
  11000. private boolean isFriendOrSelf(String s) {
  11001. if (s == null)
  11002. return false;
  11003. for (int i = 0; i < friendsCount; i++)
  11004. if (s.equalsIgnoreCase(friendsList[i]))
  11005. return true;
  11006. return s.equalsIgnoreCase(myPlayer.name);
  11007. }
  11008.  
  11009. private static String combatDiffColor(int i, int j) {
  11010. int k = i - j;
  11011. if (k < -9)
  11012. return "@red@";
  11013. if (k < -6)
  11014. return "@or3@";
  11015. if (k < -3)
  11016. return "@or2@";
  11017. if (k < 0)
  11018. return "@or1@";
  11019. if (k > 9)
  11020. return "@gre@";
  11021. if (k > 6)
  11022. return "@gr3@";
  11023. if (k > 3)
  11024. return "@gr2@";
  11025. if (k > 0)
  11026. return "@gr1@";
  11027. else
  11028. return "@yel@";
  11029. }
  11030.  
  11031. private void setWaveVolume(int i) {
  11032. signlink.wavevol = i;
  11033. }
  11034.  
  11035. private void draw3dScreen() {
  11036. alertHandler.processAlerts();
  11037. int xs = isFullScreen ? extraWidth + 200 : 0;
  11038. int ys = isFullScreen ? extraHeight - 200 : 0;
  11039.  
  11040. int xPo3s = isFullScreen ? (clientWidth / 2) - 256 : 0;
  11041. int yPo3s = isFullScreen ? (clientHeight / 2) - 167 : 0;
  11042.  
  11043. int xs2 = isFullScreen ? 200 + extraWidth : 0;
  11044. int ys2 = isFullScreen ? extraHeight - 450 : 0;
  11045. drawSplitPrivateChat();
  11046. if (crossType == 1) {
  11047. crosses[crossIndex / 100]
  11048. .drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  11049. anInt1142++;
  11050. if (anInt1142 > 67) {
  11051. anInt1142 = 0;
  11052. stream.createFrame(78);
  11053. }
  11054. }
  11055. if (crossType == 2)
  11056. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4,
  11057. crossY - 8 - 4);
  11058. if (anInt1018 != -1 && anInt1018 != 21119 && anInt1018 != 21100) {
  11059. method119(anInt945, anInt1018);
  11060. drawInterface(0, 0 + xs2, RSInterface.interfaceCache[anInt1018],
  11061. 0 + ys2);
  11062. }
  11063. if (anInt1018 == 21119 || anInt1018 == 21100) {
  11064. method119(anInt945, anInt1018);
  11065. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  11066. }
  11067. if (openInterfaceID != -1) {
  11068. method119(anInt945, openInterfaceID);
  11069. drawInterface(0, xPo3s,
  11070. RSInterface.interfaceCache[openInterfaceID], yPo3s);
  11071. }
  11072. method70();
  11073. if (!menuOpen) {
  11074. processRightClick();
  11075. drawTooltip();
  11076. } else if (menuScreenArea == 0)
  11077. drawMenu();
  11078. if (anInt1055 == 1 && !isFullScreen)
  11079. multiOverlay.drawSprite(472, 296);
  11080. if (anInt1055 == 1 && isFullScreen)
  11081. multiOverlay2.drawSprite(472 + xs, 296 + ys);
  11082. if (fpsOn) {
  11083. char c = '\u01FB';
  11084. int k = 20;
  11085. int i1 = 0xffff00;
  11086. if (super.fps < 15)
  11087. i1 = 0xff0000;
  11088. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  11089. k += 15;
  11090. Runtime runtime = Runtime.getRuntime();
  11091. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  11092. i1 = 0xffff00;
  11093. if (j1 > 0x2000000 && lowMem)
  11094. i1 = 0xff0000;
  11095. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  11096. k += 15;
  11097. }
  11098. int i1 = 0xffff00;
  11099. int x = baseX + (myPlayer.x - 6 >> 7);
  11100. int y = baseY + (myPlayer.y - 6 >> 7);
  11101. if (clientData) {
  11102. char c = '\u01FB';
  11103. int k = 20;
  11104. if (super.fps < 15)
  11105. i1 = 0xff0000;
  11106. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285,
  11107. 5);
  11108. Runtime runtime = Runtime.getRuntime();
  11109. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  11110. i1 = 0xffff00;
  11111. if (j1 > 0x2000000 && lowMem)
  11112. i1 = 0xff0000;
  11113. k += 15;
  11114. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299,
  11115. 5);
  11116. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: "
  11117. + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  11118. aTextDrawingArea_1271.method385(0xffff00,
  11119. "Coords: " + x + ", " + y, 329, 5);
  11120. }
  11121. if (anInt1104 != 0) {
  11122. int j = anInt1104 / 50;
  11123. int l = j / 60;
  11124. j %= 60;
  11125. if (j < 10)
  11126. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  11127. + l + ":0" + j, 329, 4);
  11128. else
  11129. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  11130. + l + ":" + j, 329, 4);
  11131. anInt849++;
  11132. if (anInt849 > 75) {
  11133. anInt849 = 0;
  11134. stream.createFrame(148);
  11135. }
  11136. }
  11137. }
  11138.  
  11139. private void addIgnore(long l) {
  11140. try {
  11141. if (l == 0L)
  11142. return;
  11143. if (ignoreCount >= 100) {
  11144. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  11145. return;
  11146. }
  11147. String s = TextClass.fixName(TextClass.nameForLong(l));
  11148. for (int j = 0; j < ignoreCount; j++)
  11149. if (ignoreListAsLongs[j] == l) {
  11150. pushMessage(s + " is already on your ignore list", 0, "");
  11151. return;
  11152. }
  11153. for (int k = 0; k < friendsCount; k++)
  11154. if (friendsListAsLongs[k] == l) {
  11155. pushMessage("Please remove " + s
  11156. + " from your friend list first", 0, "");
  11157. return;
  11158. }
  11159.  
  11160. ignoreListAsLongs[ignoreCount++] = l;
  11161. needDrawTabArea = true;
  11162. stream.createFrame(133);
  11163. stream.writeQWord(l);
  11164. return;
  11165. } catch (RuntimeException runtimeexception) {
  11166. signlink.reporterror("45688, " + l + ", " + 4 + ", "
  11167. + runtimeexception.toString());
  11168. }
  11169. throw new RuntimeException();
  11170. }
  11171.  
  11172. private void method114() {
  11173. for (int i = -1; i < playerCount; i++) {
  11174. int j;
  11175. if (i == -1)
  11176. j = myPlayerIndex;
  11177. else
  11178. j = playerIndices[i];
  11179. Player player = playerArray[j];
  11180. if (player != null)
  11181. method96(player);
  11182. }
  11183.  
  11184. }
  11185.  
  11186. private void method115() {
  11187. if (loadingStage == 2) {
  11188. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  11189. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  11190. .reverseGetNext()) {
  11191. if (class30_sub1.anInt1294 > 0)
  11192. class30_sub1.anInt1294--;
  11193. if (class30_sub1.anInt1294 == 0) {
  11194. if (class30_sub1.anInt1299 < 0
  11195. || ObjectManager.method178(class30_sub1.anInt1299,
  11196. class30_sub1.anInt1301)) {
  11197. method142(class30_sub1.anInt1298,
  11198. class30_sub1.anInt1295, class30_sub1.anInt1300,
  11199. class30_sub1.anInt1301, class30_sub1.anInt1297,
  11200. class30_sub1.anInt1296, class30_sub1.anInt1299);
  11201. class30_sub1.unlink();
  11202. }
  11203. } else {
  11204. if (class30_sub1.anInt1302 > 0)
  11205. class30_sub1.anInt1302--;
  11206. if (class30_sub1.anInt1302 == 0
  11207. && class30_sub1.anInt1297 >= 1
  11208. && class30_sub1.anInt1298 >= 1
  11209. && class30_sub1.anInt1297 <= 102
  11210. && class30_sub1.anInt1298 <= 102
  11211. && (class30_sub1.anInt1291 < 0 || ObjectManager
  11212. .method178(class30_sub1.anInt1291,
  11213. class30_sub1.anInt1293))) {
  11214. method142(class30_sub1.anInt1298,
  11215. class30_sub1.anInt1295, class30_sub1.anInt1292,
  11216. class30_sub1.anInt1293, class30_sub1.anInt1297,
  11217. class30_sub1.anInt1296, class30_sub1.anInt1291);
  11218. class30_sub1.anInt1302 = -1;
  11219. if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  11220. && class30_sub1.anInt1299 == -1)
  11221. class30_sub1.unlink();
  11222. else if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  11223. && class30_sub1.anInt1292 == class30_sub1.anInt1300
  11224. && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  11225. class30_sub1.unlink();
  11226. }
  11227. }
  11228. }
  11229.  
  11230. }
  11231. }
  11232.  
  11233. // stops the click from going over sprite
  11234. private void method117(Stream stream) {
  11235. stream.initBitAccess();
  11236. int j = stream.readBits(1);
  11237. if (j == 0)
  11238. return;
  11239. int k = stream.readBits(2);
  11240. if (k == 0) {
  11241. anIntArray894[anInt893++] = myPlayerIndex;
  11242. return;
  11243. }
  11244. if (k == 1) {
  11245. int l = stream.readBits(3);
  11246. myPlayer.moveInDir(false, l);
  11247. int k1 = stream.readBits(1);
  11248. if (k1 == 1)
  11249. anIntArray894[anInt893++] = myPlayerIndex;
  11250. return;
  11251. }
  11252. if (k == 2) {
  11253. int i1 = stream.readBits(3);
  11254. myPlayer.moveInDir(true, i1);
  11255. int l1 = stream.readBits(3);
  11256. myPlayer.moveInDir(true, l1);
  11257. int j2 = stream.readBits(1);
  11258. if (j2 == 1)
  11259. anIntArray894[anInt893++] = myPlayerIndex;
  11260. return;
  11261. }
  11262. if (k == 3) {
  11263. plane = stream.readBits(2);
  11264. int j1 = stream.readBits(1);
  11265. int i2 = stream.readBits(1);
  11266. if (i2 == 1)
  11267. anIntArray894[anInt893++] = myPlayerIndex;
  11268. int k2 = stream.readBits(7);
  11269. int l2 = stream.readBits(7);
  11270. myPlayer.setPos(l2, k2, j1 == 1);
  11271. }
  11272. }
  11273.  
  11274. public Sprite titleBox;
  11275. public Sprite titleButton;
  11276. public Sprite titleButtonHover;
  11277. private Background loginBox;
  11278.  
  11279. private void nullLoader() {
  11280. aBoolean831 = false;
  11281. while (drawingFlames) {
  11282. aBoolean831 = false;
  11283. try {
  11284. Thread.sleep(50L);
  11285. } catch (Exception _ex) {
  11286. }
  11287. }
  11288. aBackground_966 = null;
  11289. aBackground_967 = null;
  11290. loginBox = null;
  11291. loginButtonHover = null;
  11292. textBoxHover = null;
  11293. titleBox = null;
  11294. titleButton = null;
  11295. titleButtonHover = null;
  11296. aBackgroundArray1152s = null;
  11297. anIntArray850 = null;
  11298. anIntArray851 = null;
  11299. anIntArray852 = null;
  11300. anIntArray853 = null;
  11301. anIntArray1190 = null;
  11302. anIntArray1191 = null;
  11303. anIntArray828 = null;
  11304. anIntArray829 = null;
  11305. aClass30_Sub2_Sub1_Sub1_1201 = null;
  11306. aClass30_Sub2_Sub1_Sub1_1202 = null;
  11307. }
  11308.  
  11309. private boolean method119(int i, int j) {
  11310. boolean flag1 = false;
  11311. RSInterface class9 = RSInterface.interfaceCache[j];
  11312. if (class9 == null || class9.children == null)
  11313. return false;
  11314. for (int k = 0; k < class9.children.length; k++) {
  11315. if (class9.children[k] == -1)
  11316. break;
  11317. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  11318. if (class9_1.type == 1)
  11319. flag1 |= method119(i, class9_1.id);
  11320. if (class9_1.type == 6
  11321. && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1)) {
  11322. boolean flag2 = interfaceIsSelected(class9_1);
  11323. int l;
  11324. if (flag2)
  11325. l = class9_1.anInt258;
  11326. else
  11327. l = class9_1.anInt257;
  11328. if (l != -1) {
  11329. Animation animation = Animation.anims[l];
  11330. for (class9_1.anInt208 += i; class9_1.anInt208 > animation
  11331. .method258(class9_1.anInt246);) {
  11332. class9_1.anInt208 -= animation
  11333. .method258(class9_1.anInt246) + 1;
  11334. class9_1.anInt246++;
  11335. if (class9_1.anInt246 >= animation.anInt352) {
  11336. class9_1.anInt246 -= animation.anInt356;
  11337. if (class9_1.anInt246 < 0
  11338. || class9_1.anInt246 >= animation.anInt352)
  11339. class9_1.anInt246 = 0;
  11340. }
  11341. flag1 = true;
  11342. }
  11343.  
  11344. }
  11345. }
  11346. }
  11347.  
  11348. return flag1;
  11349. }
  11350.  
  11351. private int method120() {
  11352. int j = 3;
  11353. if (yCameraCurve < 310) {
  11354. int k = xCameraPos >> 7;
  11355. int l = yCameraPos >> 7;
  11356. int i1 = myPlayer.x >> 7;
  11357. int j1 = myPlayer.y >> 7;
  11358. if ((byteGroundArray[plane][k][l] & 4) != 0)
  11359. j = plane;
  11360. int k1;
  11361. if (i1 > k)
  11362. k1 = i1 - k;
  11363. else
  11364. k1 = k - i1;
  11365. int l1;
  11366. if (j1 > l)
  11367. l1 = j1 - l;
  11368. else
  11369. l1 = l - j1;
  11370. if (k1 > l1) {
  11371. int i2 = (l1 * 0x10000) / k1;
  11372. int k2 = 32768;
  11373. while (k != i1) {
  11374. if (k < i1)
  11375. k++;
  11376. else if (k > i1)
  11377. k--;
  11378. if ((byteGroundArray[plane][k][l] & 4) != 0)
  11379. j = plane;
  11380. k2 += i2;
  11381. if (k2 >= 0x10000) {
  11382. k2 -= 0x10000;
  11383. if (l < j1)
  11384. l++;
  11385. else if (l > j1)
  11386. l--;
  11387. if ((byteGroundArray[plane][k][l] & 4) != 0)
  11388. j = plane;
  11389. }
  11390. }
  11391. } else {
  11392. int j2 = (k1 * 0x10000) / l1;
  11393. int l2 = 32768;
  11394. while (l != j1) {
  11395. if (l < j1)
  11396. l++;
  11397. else if (l > j1)
  11398. l--;
  11399. if ((byteGroundArray[plane][k][l] & 4) != 0)
  11400. j = plane;
  11401. l2 += j2;
  11402. if (l2 >= 0x10000) {
  11403. l2 -= 0x10000;
  11404. if (k < i1)
  11405. k++;
  11406. else if (k > i1)
  11407. k--;
  11408. if ((byteGroundArray[plane][k][l] & 4) != 0)
  11409. j = plane;
  11410. }
  11411. }
  11412. }
  11413. }
  11414. if ((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  11415. j = plane;
  11416. return j;
  11417. }
  11418.  
  11419. private int method121() {
  11420. int j = method42(plane, yCameraPos, xCameraPos);
  11421. if (j - zCameraPos < 800
  11422. && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  11423. return plane;
  11424. else
  11425. return 3;
  11426. }
  11427.  
  11428. private void delIgnore(long l) {
  11429. try {
  11430. if (l == 0L)
  11431. return;
  11432. for (int j = 0; j < ignoreCount; j++)
  11433. if (ignoreListAsLongs[j] == l) {
  11434. ignoreCount--;
  11435. needDrawTabArea = true;
  11436. System.arraycopy(ignoreListAsLongs, j + 1,
  11437. ignoreListAsLongs, j, ignoreCount - j);
  11438.  
  11439. stream.createFrame(74);
  11440. stream.writeQWord(l);
  11441. return;
  11442. }
  11443.  
  11444. return;
  11445. } catch (RuntimeException runtimeexception) {
  11446. signlink.reporterror("47229, " + 3 + ", " + l + ", "
  11447. + runtimeexception.toString());
  11448. }
  11449. throw new RuntimeException();
  11450. }
  11451.  
  11452. private void chatJoin(long l) {
  11453. try {
  11454. if (l == 0L)
  11455. return;
  11456. stream.createFrame(60);
  11457. stream.writeQWord(l);
  11458. return;
  11459. } catch (RuntimeException runtimeexception) {
  11460. signlink.reporterror("47229, " + 3 + ", " + l + ", "
  11461. + runtimeexception.toString());
  11462. }
  11463. throw new RuntimeException();
  11464.  
  11465. }
  11466.  
  11467. public String getParameter(String s) {
  11468. if (signlink.mainapp != null)
  11469. return signlink.mainapp.getParameter(s);
  11470. else
  11471. return super.getParameter(s);
  11472. }
  11473.  
  11474. private void adjustVolume(boolean flag, int i) {
  11475. signlink.midivol = i;
  11476. if (flag)
  11477. signlink.midi = "voladjust";
  11478. }
  11479.  
  11480. private int extractInterfaceValues(RSInterface class9, int j) {
  11481. if (class9.valueIndexArray == null
  11482. || j >= class9.valueIndexArray.length)
  11483. return -2;
  11484. try {
  11485. int ai[] = class9.valueIndexArray[j];
  11486. int k = 0;
  11487. int l = 0;
  11488. int i1 = 0;
  11489. do {
  11490. int j1 = ai[l++];
  11491. int k1 = 0;
  11492. byte byte0 = 0;
  11493. if (j1 == 0)
  11494. return k;
  11495. if (j1 == 1)
  11496. k1 = currentStats[ai[l++]];
  11497. if (j1 == 2)
  11498. k1 = maxStats[ai[l++]];
  11499. if (j1 == 3)
  11500. k1 = currentExp[ai[l++]];
  11501. if (j1 == 4) {
  11502. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  11503. int k2 = ai[l++];
  11504. if (k2 >= 0 && k2 < ItemDef.totalItems
  11505. && (!ItemDef.forID(k2).membersObject || isMembers)) {
  11506. for (int j3 = 0; j3 < class9_1.inv.length; j3++)
  11507. if (class9_1.inv[j3] == k2 + 1)
  11508. k1 += class9_1.invStackSizes[j3];
  11509.  
  11510. }
  11511. }
  11512. if (j1 == 5)
  11513. k1 = variousSettings[ai[l++]];
  11514. if (j1 == 6)
  11515. k1 = anIntArray1019[ai[l++] - 1];
  11516. if (j1 == 7)
  11517. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  11518. if (j1 == 8)
  11519. k1 = myPlayer.combatLevel;
  11520. if (j1 == 9) {
  11521. for (int l1 = 0; l1 < Skills.skillsCount; l1++)
  11522. if (Skills.skillEnabled[l1])
  11523. k1 += maxStats[l1];
  11524.  
  11525. }
  11526. if (j1 == 10) {
  11527. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  11528. int l2 = ai[l++] + 1;
  11529. if (l2 >= 0 && l2 < ItemDef.totalItems
  11530. && (!ItemDef.forID(l2).membersObject || isMembers)) {
  11531. for (int k3 = 0; k3 < class9_2.inv.length; k3++) {
  11532. if (class9_2.inv[k3] != l2)
  11533. continue;
  11534. k1 = 0x3b9ac9ff;
  11535. break;
  11536. }
  11537.  
  11538. }
  11539. }
  11540. if (j1 == 11)
  11541. k1 = energy;
  11542. if (j1 == 12)
  11543. k1 = weight;
  11544. if (j1 == 13) {
  11545. int i2 = variousSettings[ai[l++]];
  11546. int i3 = ai[l++];
  11547. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  11548. }
  11549. if (j1 == 14) {
  11550. int j2 = ai[l++];
  11551. VarBit varBit = VarBit.cache[j2];
  11552. int l3 = varBit.anInt648;
  11553. int i4 = varBit.anInt649;
  11554. int j4 = varBit.anInt650;
  11555. int k4 = anIntArray1232[j4 - i4];
  11556. k1 = variousSettings[l3] >> i4 & k4;
  11557. }
  11558. if (j1 == 15)
  11559. byte0 = 1;
  11560. if (j1 == 16)
  11561. byte0 = 2;
  11562. if (j1 == 17)
  11563. byte0 = 3;
  11564. if (j1 == 18)
  11565. k1 = (myPlayer.x >> 7) + baseX;
  11566. if (j1 == 19)
  11567. k1 = (myPlayer.y >> 7) + baseY;
  11568. if (j1 == 20)
  11569. k1 = ai[l++];
  11570. if (byte0 == 0) {
  11571. if (i1 == 0)
  11572. k += k1;
  11573. if (i1 == 1)
  11574. k -= k1;
  11575. if (i1 == 2 && k1 != 0)
  11576. k /= k1;
  11577. if (i1 == 3)
  11578. k *= k1;
  11579. i1 = 0;
  11580. } else {
  11581. i1 = byte0;
  11582. }
  11583. } while (true);
  11584. } catch (Exception _ex) {
  11585. return -1;
  11586. }
  11587. }
  11588.  
  11589. private void drawTooltip() {
  11590. if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  11591. return;
  11592. String s;
  11593. if (itemSelected == 1 && menuActionRow < 2)
  11594. s = "Use " + selectedItemName + " with...";
  11595. else if (spellSelected == 1 && menuActionRow < 2)
  11596. s = spellTooltip + "...";
  11597. else
  11598. s = menuActionName[menuActionRow - 1];
  11599. if (menuActionRow > 2)
  11600. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  11601. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  11602. }
  11603.  
  11604. private void drawMinimap() {
  11605. int x = isFullScreen ? 549 + extraWidth : 0;
  11606. int markY = isFullScreen ? 6 : 0;
  11607. int markX = isFullScreen ? 9 : 0;
  11608. if (!isFullScreen)
  11609. aRSImageProducer_1164.initDrawingArea();
  11610. if (anInt1021 == 2) {
  11611. byte abyte0[] = mapBack.aByteArray1450;
  11612. int ai[] = DrawingArea.pixels;
  11613. int k2 = abyte0.length;
  11614. for (int i5 = 0; i5 < k2; i5++)
  11615. if (abyte0[i5] == 0)
  11616. ai[i5] = 0;
  11617. aRSImageProducer_1165.initDrawingArea();
  11618. return;
  11619. }
  11620. int i = minimapInt1 + minimapInt2 & 0x7ff;
  11621. int j = 48 + myPlayer.x / 32;
  11622. int l2 = 464 - myPlayer.y / 32;
  11623. if (!isFullScreen) {
  11624. aClass30_Sub2_Sub1_Sub1_1263.method352(152, i, anIntArray1229,
  11625. 256 + minimapInt3, anIntArray1052, l2, 10, 32, 146, j);
  11626. }
  11627. if (isFullScreen) {
  11628. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229,
  11629. 256 + minimapInt3, anIntArray1052, l2, 12, 34 + x, 146, j);
  11630. }
  11631. if (!isFullScreen) {
  11632. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229,
  11633. 256 + minimapInt3, anIntArray1052, l2, 9, 34 + x, 146, j);
  11634. }
  11635. for (int j5 = 0; j5 < anInt1071; j5++) {
  11636. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  11637. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  11638. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  11639. }
  11640.  
  11641. for (int k5 = 0; k5 < 104; k5++) {
  11642. for (int l5 = 0; l5 < 104; l5++) {
  11643. NodeList class19 = groundArray[plane][k5][l5];
  11644. if (class19 != null) {
  11645. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  11646. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  11647. markMinimap(mapDotItem, l, j3);
  11648. }
  11649. }
  11650. }
  11651.  
  11652. for (int i6 = 0; i6 < npcCount; i6++) {
  11653. NPC npc = npcArray[npcIndices[i6]];
  11654. if (npc != null && npc.isVisible()) {
  11655. EntityDef entityDef = npc.desc;
  11656. if (entityDef.childrenIDs != null)
  11657. entityDef = entityDef.method161();
  11658. if (entityDef != null && entityDef.aBoolean87
  11659. && entityDef.aBoolean84) {
  11660. int i1 = npc.x / 32 - myPlayer.x / 32;
  11661. int k3 = npc.y / 32 - myPlayer.y / 32;
  11662. markMinimap(mapDotNPC, i1, k3);
  11663. }
  11664. }
  11665. }
  11666.  
  11667. for (int j6 = 0; j6 < playerCount; j6++) {
  11668. Player player = playerArray[playerIndices[j6]];
  11669. if (player != null && player.isVisible()) {
  11670. int j1 = player.x / 32 - myPlayer.x / 32;
  11671. int l3 = player.y / 32 - myPlayer.y / 32;
  11672. boolean flag1 = false;
  11673. boolean flag3 = false;
  11674. for (int j3 = 0; j3 < clanList.length; j3++) {
  11675. if (clanList[j3] == null)
  11676. continue;
  11677. if (!clanList[j3].equalsIgnoreCase(player.name))
  11678. continue;
  11679. flag3 = true;
  11680. break;
  11681. }
  11682. long l6 = TextClass.longForName(player.name);
  11683. for (int k6 = 0; k6 < friendsCount; k6++) {
  11684. if (l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  11685. continue;
  11686. flag1 = true;
  11687. break;
  11688. }
  11689. boolean flag2 = false;
  11690. if (myPlayer.team != 0 && player.team != 0
  11691. && myPlayer.team == player.team)
  11692. flag2 = true;
  11693. if (flag1)
  11694. markMinimap(mapDotFriend, j1, l3);
  11695. else if (flag3)
  11696. markMinimap(mapDotClan, j1, l3);
  11697. else if (flag2)
  11698. markMinimap(mapDotTeam, j1, l3);
  11699. else
  11700. markMinimap(mapDotPlayer, j1, l3);
  11701. }
  11702. }
  11703.  
  11704. if (anInt855 != 0 && loopCycle % 20 < 10) {
  11705. if (anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  11706. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  11707. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  11708. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x
  11709. / 32;
  11710. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y
  11711. / 32;
  11712. method81(mapMarker, i4, k1);
  11713. }
  11714. }
  11715. if (anInt855 == 2) {
  11716. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  11717. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  11718. method81(mapMarker, j4, l1);
  11719. }
  11720. if (anInt855 == 10 && anInt933 >= 0
  11721. && anInt933 < playerArray.length) {
  11722. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  11723. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  11724. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x
  11725. / 32;
  11726. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y
  11727. / 32;
  11728. method81(mapMarker, k4, i2);
  11729. }
  11730. }
  11731. }
  11732. if (destX != 0) {
  11733. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  11734. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  11735. markMinimap(mapFlag, j2, l4);
  11736. }
  11737. if (!isFullScreen) {
  11738. DrawingArea.drawPixels(3, 84, 105, 0xffffff, 3);
  11739. }
  11740. // mapBack.drawBackground(0, 0);
  11741. if (!isFullScreen) {
  11742. compass.method352(33, minimapInt1, anIntArray1057, 256,
  11743. anIntArray968, 25, isFullScreen ? 12 : 8,
  11744. isFullScreen ? 30 + x : 8, 33, 25);
  11745. }
  11746. if (isFullScreen) {
  11747. compass.method352(33, minimapInt1, anIntArray1057, 256,
  11748. anIntArray968, 25, isFullScreen ? 12 : 8,
  11749. isFullScreen ? 30 + x : 8, 33, 25);
  11750. }
  11751. // Compass
  11752. if (isFullScreen) {
  11753. DrawingArea.drawPixels(3, 78 + markY, 97 + x + markX, 0xffffff, 3);
  11754. }
  11755. if (isFullScreen) {
  11756. mapArea[0].drawSprite(25 + x, 7);
  11757. }
  11758. if (!isFullScreen) {
  11759. mapArea[1].drawSprite(0, 0);
  11760. }
  11761. if (!hasBeenBlanked) {
  11762. aRSImageProducer_1164.blankImage();
  11763. hasBeenBlanked = true;
  11764. }
  11765. drawXPButton();
  11766. drawHPOrb();
  11767. drawPrayerOrb();
  11768. drawRunOrb();
  11769. //drawSummoningOrb();
  11770. drawLogoutButton();
  11771. drawQuestionButton();
  11772. drawWorldMapButton();
  11773. if (menuOpen && menuScreenArea == 3) {
  11774. drawMenu();
  11775. }
  11776. aRSImageProducer_1165.initDrawingArea();
  11777. }
  11778.  
  11779. public void drawLogoutButton() {
  11780. int x = isFullScreen ? extraWidth + 510 : 0;
  11781. int y = isFullScreen ? -30 : 0;
  11782. if (tabInterfaceIDs[10] != -1 && anInt1054 == 9)
  11783. if (loopCycle % 20 >= 10)
  11784. ;
  11785. logoutIcon.drawSprite(225 + x, 0);
  11786. if (logIconHPos == 1) {
  11787. logIconH.drawSprite(225 + x, 0);
  11788. }
  11789. if (tabID == 10)
  11790. logIconC.drawSprite(225 + x, 0);
  11791. }
  11792.  
  11793. public void drawQuestionButton() {
  11794. int x = isFullScreen ? extraWidth + 510 : 0;
  11795. int y = isFullScreen ? -30 : 0;
  11796. if (tabInterfaceIDs[11] != -1 && anInt1054 == 9)
  11797. if (loopCycle % 20 >= 11)
  11798. ;
  11799. questionIcon.drawSprite(204 + x, 0);
  11800. if (questionIconHPos == 1) {
  11801. questionIconH.drawSprite(204 + x, 0);
  11802. }
  11803. }
  11804.  
  11805. public int logIconHPos = 0;
  11806. public int questionIconHPos = 0;
  11807. public int xpIconHPos = 0;
  11808.  
  11809. public void drawWorldMapButton() {
  11810. int x = isFullScreen ? 700 + extraWidth : 0;
  11811. int y = isFullScreen ? -0 : 0;
  11812.  
  11813. int xm = isFullScreen ? 706 + extraWidth : 0;
  11814. int ym = isFullScreen ? +5 : 0;
  11815. if (isFullScreen) {
  11816. mapRing.drawSprite(8 + x, 124 + y);
  11817. }
  11818. worldMapIcon.drawSprite(8 + xm, 124 + ym);
  11819. }
  11820.  
  11821. public void processMapAreaClick() {
  11822. int x = isFullScreen ? extraWidth + 17 : 0;
  11823. int y = isFullScreen ? -30 : 0;
  11824.  
  11825. int x29 = isFullScreen ? extraWidth : 0;
  11826.  
  11827. int x2 = isFullScreen ? 358 + extraWidth : 0;
  11828. int y2 = isFullScreen ? +32 : 0;
  11829. // Logout Button
  11830. if (super.mouseX >= 742 + x29 && super.mouseX <= 764 + x29
  11831. && super.mouseY >= 1 && super.mouseY <= 23) {
  11832. logIconHPos = 1;
  11833. } else {
  11834. logIconHPos = 0;
  11835. }
  11836. // XP Button
  11837. if (super.mouseX >= 519 + x && super.mouseX <= 550 + x
  11838. && super.mouseY >= 50 + y && super.mouseY <= 78 + y) {
  11839. xpIconHPos = 1;
  11840. } else {
  11841. xpIconHPos = 0;
  11842. }
  11843. // Advisor Button
  11844. if (super.mouseX >= 724 + x29 && super.mouseX <= 741 + x29
  11845. && super.mouseY >= 1 && super.mouseY <= 23) {
  11846. questionIconHPos = 1;
  11847. } else {
  11848. questionIconHPos = 0;
  11849. }
  11850. if (super.clickMode3 == 1 && super.saveClickX >= 516
  11851. && super.saveClickX <= 550 && super.saveClickY >= 46
  11852. && super.saveClickY <= 80) {
  11853. if (!xpClicked) {
  11854. xpClicked = true;
  11855. drawXpBar = true;
  11856. } else {
  11857. xpClicked = false;
  11858. drawXpBar = false;
  11859. }
  11860. }
  11861. }
  11862.  
  11863. public void drawXPButton() {
  11864. int x = isFullScreen ? 535 + extraWidth : 0;
  11865. int y = isFullScreen ? -36 : 0;
  11866. if (tabInterfaceIDs[12] != -1 && anInt1054 == 9)
  11867. if (loopCycle % 20 >= 12)
  11868. ;
  11869. xpIcon.drawSprite(0 + x, 47 + y);
  11870. if (xpIconHPos == 1) {
  11871. xpIconH.drawSprite(0 + x, 47 + y);
  11872. }
  11873. }
  11874.  
  11875. private void npcScreenPos(Entity entity, int i) {
  11876. calcEntityScreenPos(entity.x, i, entity.y);
  11877. }
  11878.  
  11879. private void calcEntityScreenPos(int i, int j, int l) {
  11880. if (i < 128 || l < 128 || i > 13056 || l > 13056) {
  11881. spriteDrawX = -1;
  11882. spriteDrawY = -1;
  11883. return;
  11884. }
  11885. int i1 = method42(plane, l, i) - j;
  11886. i -= xCameraPos;
  11887. i1 -= zCameraPos;
  11888. l -= yCameraPos;
  11889. int j1 = Model.modelIntArray1[yCameraCurve];
  11890. int k1 = Model.modelIntArray2[yCameraCurve];
  11891. int l1 = Model.modelIntArray1[xCameraCurve];
  11892. int i2 = Model.modelIntArray2[xCameraCurve];
  11893. int j2 = l * l1 + i * i2 >> 16;
  11894. l = l * i2 - i * l1 >> 16;
  11895. i = j2;
  11896. j2 = i1 * k1 - l * j1 >> 16;
  11897. l = i1 * j1 + l * k1 >> 16;
  11898. i1 = j2;
  11899. if (l >= 50) {
  11900. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  11901. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  11902. } else {
  11903. spriteDrawX = -1;
  11904. spriteDrawY = -1;
  11905. }
  11906. }
  11907.  
  11908. private void buildSplitPrivateChatMenu()
  11909. {
  11910. if(splitPrivateChat == 0)
  11911. return;
  11912. int i = 0;
  11913. if(anInt1104 != 0)
  11914. i = 1;
  11915. for(int j = 0; j < 100; j++)
  11916. if(chatMessages[j] != null)
  11917. {
  11918. int k = chatTypes[j];
  11919. String s = chatNames[j];
  11920. boolean flag1 = false;
  11921. if(s != null && s.startsWith("@cr1@"))
  11922. {
  11923. s = s.substring(5);
  11924. boolean flag2 = true;
  11925. }
  11926. if(s != null && s.startsWith("@cr2@"))
  11927. {
  11928. s = s.substring(5);
  11929. byte byte0 = 2;
  11930. }
  11931. if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  11932. {
  11933. int l = 329 - i * 13;
  11934. if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  11935. {
  11936. int i1 = aTextDrawingArea_1271.getTextWidth("From: " + s + chatMessages[j]) + 25;
  11937. if(i1 > 450)
  11938. i1 = 450;
  11939. if(super.mouseX < 4 + i1)
  11940. {
  11941. if(myPrivilege >= 1)
  11942. {
  11943. menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  11944. menuActionID[menuActionRow] = 2606;
  11945. menuActionRow++;
  11946. }
  11947. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  11948. menuActionID[menuActionRow] = 2042;
  11949. menuActionRow++;
  11950. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  11951. menuActionID[menuActionRow] = 2337;
  11952. menuActionRow++;
  11953. }
  11954. }
  11955. if(++i >= 5)
  11956. return;
  11957. }
  11958. if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  11959. return;
  11960. }
  11961.  
  11962. }
  11963.  
  11964. private void method130(int j, int k, int l, int i1, int j1, int k1, int l1,
  11965. int i2, int j2) {
  11966. Class30_Sub1 class30_sub1 = null;
  11967. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  11968. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  11969. .reverseGetNext()) {
  11970. if (class30_sub1_1.anInt1295 != l1
  11971. || class30_sub1_1.anInt1297 != i2
  11972. || class30_sub1_1.anInt1298 != j1
  11973. || class30_sub1_1.anInt1296 != i1)
  11974. continue;
  11975. class30_sub1 = class30_sub1_1;
  11976. break;
  11977. }
  11978.  
  11979. if (class30_sub1 == null) {
  11980. class30_sub1 = new Class30_Sub1();
  11981. class30_sub1.anInt1295 = l1;
  11982. class30_sub1.anInt1296 = i1;
  11983. class30_sub1.anInt1297 = i2;
  11984. class30_sub1.anInt1298 = j1;
  11985. method89(class30_sub1);
  11986. aClass19_1179.insertHead(class30_sub1);
  11987. }
  11988. class30_sub1.anInt1291 = k;
  11989. class30_sub1.anInt1293 = k1;
  11990. class30_sub1.anInt1292 = l;
  11991. class30_sub1.anInt1302 = j2;
  11992. class30_sub1.anInt1294 = j;
  11993. }
  11994.  
  11995. private boolean interfaceIsSelected(RSInterface class9) {
  11996. if (class9.anIntArray245 == null)
  11997. return false;
  11998. for (int i = 0; i < class9.anIntArray245.length; i++) {
  11999. int j = extractInterfaceValues(class9, i);
  12000. int k = class9.anIntArray212[i];
  12001. if (class9.anIntArray245[i] == 2) {
  12002. if (j >= k)
  12003. return false;
  12004. } else if (class9.anIntArray245[i] == 3) {
  12005. if (j <= k)
  12006. return false;
  12007. } else if (class9.anIntArray245[i] == 4) {
  12008. if (j == k)
  12009. return false;
  12010. } else if (j != k)
  12011. return false;
  12012. }
  12013.  
  12014. return true;
  12015. }
  12016.  
  12017. private DataInputStream openJagGrabInputStream(String s) throws IOException {
  12018. // if(!aBoolean872)
  12019. // if(signlink.mainapp != null)
  12020. // return signlink.openurl(s);
  12021. // else
  12022. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  12023. if (aSocket832 != null) {
  12024. try {
  12025. aSocket832.close();
  12026. } catch (Exception _ex) {
  12027. }
  12028. aSocket832 = null;
  12029. }
  12030. aSocket832 = openSocket(43594);
  12031. aSocket832.setSoTimeout(10000);
  12032. java.io.InputStream inputstream = aSocket832.getInputStream();
  12033. OutputStream outputstream = aSocket832.getOutputStream();
  12034. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  12035. return new DataInputStream(inputstream);
  12036. }
  12037.  
  12038. private void doFlamesDrawing() {
  12039. char c = '\u0100';
  12040. if (anInt1040 > 0) {
  12041. for (int i = 0; i < 256; i++)
  12042. if (anInt1040 > 768)
  12043. anIntArray850[i] = method83(anIntArray851[i],
  12044. anIntArray852[i], 1024 - anInt1040);
  12045. else if (anInt1040 > 256)
  12046. anIntArray850[i] = anIntArray852[i];
  12047. else
  12048. anIntArray850[i] = method83(anIntArray852[i],
  12049. anIntArray851[i], 256 - anInt1040);
  12050.  
  12051. } else if (anInt1041 > 0) {
  12052. for (int j = 0; j < 256; j++)
  12053. if (anInt1041 > 768)
  12054. anIntArray850[j] = method83(anIntArray851[j],
  12055. anIntArray853[j], 1024 - anInt1041);
  12056. else if (anInt1041 > 256)
  12057. anIntArray850[j] = anIntArray853[j];
  12058. else
  12059. anIntArray850[j] = method83(anIntArray853[j],
  12060. anIntArray851[j], 256 - anInt1041);
  12061.  
  12062. } else {
  12063. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  12064.  
  12065. }
  12066. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0,
  12067. aRSImageProducer_1110.anIntArray315, 0, 33920);
  12068.  
  12069. int i1 = 0;
  12070. int j1 = 1152;
  12071. for (int k1 = 1; k1 < c - 1; k1++) {
  12072. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  12073. int j2 = 22 + l1;
  12074. if (j2 < 0)
  12075. j2 = 0;
  12076. i1 += j2;
  12077. for (int l2 = j2; l2 < 128; l2++) {
  12078. int j3 = anIntArray828[i1++];
  12079. if (j3 != 0) {
  12080. j1++;
  12081. }
  12082. }
  12083.  
  12084. j1 += j2;
  12085. }
  12086.  
  12087. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  12088. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0,
  12089. aRSImageProducer_1111.anIntArray315, 0, 33920);
  12090.  
  12091. i1 = 0;
  12092. j1 = 1176;
  12093. for (int k2 = 1; k2 < c - 1; k2++) {
  12094. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  12095. int k3 = 103 - i3;
  12096. j1 += i3;
  12097. for (int i4 = 0; i4 < k3; i4++) {
  12098. int k4 = anIntArray828[i1++];
  12099. if (k4 != 0) {
  12100. j1++;
  12101. }
  12102. }
  12103.  
  12104. i1 += 128 - k3;
  12105. j1 += 128 - k3 - i3;
  12106. }
  12107.  
  12108. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  12109. }
  12110.  
  12111. private void method134(Stream stream) {
  12112. int j = stream.readBits(8);
  12113. if (j < playerCount) {
  12114. for (int k = j; k < playerCount; k++)
  12115. anIntArray840[anInt839++] = playerIndices[k];
  12116.  
  12117. }
  12118. if (j > playerCount) {
  12119. signlink.reporterror(myUsername + " Too many players");
  12120. throw new RuntimeException("eek");
  12121. }
  12122. playerCount = 0;
  12123. for (int l = 0; l < j; l++) {
  12124. int i1 = playerIndices[l];
  12125. Player player = playerArray[i1];
  12126. int j1 = stream.readBits(1);
  12127. if (j1 == 0) {
  12128. playerIndices[playerCount++] = i1;
  12129. player.anInt1537 = loopCycle;
  12130. } else {
  12131. int k1 = stream.readBits(2);
  12132. if (k1 == 0) {
  12133. playerIndices[playerCount++] = i1;
  12134. player.anInt1537 = loopCycle;
  12135. anIntArray894[anInt893++] = i1;
  12136. } else if (k1 == 1) {
  12137. playerIndices[playerCount++] = i1;
  12138. player.anInt1537 = loopCycle;
  12139. int l1 = stream.readBits(3);
  12140. player.moveInDir(false, l1);
  12141. int j2 = stream.readBits(1);
  12142. if (j2 == 1)
  12143. anIntArray894[anInt893++] = i1;
  12144. } else if (k1 == 2) {
  12145. playerIndices[playerCount++] = i1;
  12146. player.anInt1537 = loopCycle;
  12147. int i2 = stream.readBits(3);
  12148. player.moveInDir(true, i2);
  12149. int k2 = stream.readBits(3);
  12150. player.moveInDir(true, k2);
  12151. int l2 = stream.readBits(1);
  12152. if (l2 == 1)
  12153. anIntArray894[anInt893++] = i1;
  12154. } else if (k1 == 3)
  12155. anIntArray840[anInt839++] = i1;
  12156. }
  12157. }
  12158. }
  12159.  
  12160. public int count, backgroundCount, opacityCount;
  12161. public boolean isTextCursor = false;
  12162.  
  12163. public void setTextCursor() {
  12164. isTextCursor = true;
  12165. Cursor cursor = new Cursor(Cursor.TEXT_CURSOR);
  12166. getGameComponent().setCursor(cursor);
  12167. }
  12168.  
  12169. public void setDefaultCursor() {
  12170. isTextCursor = false;
  12171. getGameComponent().setCursor(Cursor.getDefaultCursor());
  12172. }
  12173.  
  12174. public static String capitalize(String s) {
  12175. for (int i = 0; i < s.length(); i++) {
  12176. if (i == 0) {
  12177. s = String.format("%s%s", Character.toUpperCase(s.charAt(0)), s
  12178. .substring(1));
  12179. }
  12180. if (!Character.isLetterOrDigit(s.charAt(i))) {
  12181. if (i + 1 < s.length()) {
  12182. s = String.format("%s%s%s", s.subSequence(0, i + 1),
  12183. Character.toUpperCase(s.charAt(i + 1)), s
  12184. .substring(i + 2));
  12185. }
  12186. }
  12187. }
  12188. return s;
  12189. }
  12190.  
  12191. public static String capitalizeFirst(String s) {
  12192. if (s.length() > 1) {
  12193. s.toLowerCase();
  12194. char c = s.charAt(0);
  12195. c = Character.toUpperCase(c);
  12196. return new String(c + s.substring(1, s.length()));
  12197. } else {
  12198. return s.toUpperCase();
  12199. }
  12200. }
  12201.  
  12202. public static String capitalizeAll(String s) {
  12203. String[] tokens = s.split(" ");
  12204. String end = "";
  12205. for(int i = 0; i < tokens.length; i++){
  12206. char c = Character.toUpperCase(tokens[i].charAt(0));
  12207. if (i == tokens.length - 1) {
  12208. end += c + tokens[i].substring(1, tokens[i].length());
  12209. } else {
  12210. end += c + tokens[i].substring(1, tokens[i].length()) + " ";
  12211. }
  12212. }
  12213. return end;
  12214. }
  12215.  
  12216. private Sprite loginButtonHover;
  12217. private Sprite textBoxHover;
  12218. public Sprite backgroundFix;
  12219.  
  12220. public void drawLoginScreen() {
  12221. try {
  12222. if (count == 0) {
  12223. Sprite sprite = new Sprite("background/BG " + backgroundCount);
  12224. sprite.drawSpriteWithOpacity(0, 0, opacityCount);
  12225. if (backgroundCount == 2)
  12226. backgroundCount = 0;
  12227. else
  12228. backgroundCount++;
  12229. }
  12230. if (count >= 100) {
  12231. opacityCount++;
  12232. Sprite sprite = new Sprite("background/BG " + backgroundCount);
  12233. sprite.drawSpriteWithOpacity(0, 0, opacityCount);
  12234. }
  12235. if (count == 250) {
  12236. count = 0;
  12237. opacityCount = 0;
  12238. } else {
  12239. count++;
  12240. }
  12241. resetImageProducers();
  12242. loginScreenArea.initDrawingArea();
  12243. backgroundFix.drawSprite(0, 0);
  12244. // titleBox.drawBackground(206, 140);
  12245. loginBox.drawBackground(253, 140);
  12246. char c = '\u0168';
  12247. char c1 = '\310';
  12248. int i1 = c / 2;
  12249. int l1 = c1 / 2 + 50;
  12250. // Sprite sprite1 = new Sprite("SPRITEE 9");
  12251. // Sprite sprite2 = new Sprite("SPRITEE 10");
  12252. // smallText.method382(0xffff00, 378 ,"MouseX: "+ super.mouseX+
  12253. // " MouseY: "+ super.mouseY, 225-50-20, true);
  12254. if (loginScreenState == 2) {
  12255. int j = c1 / 2 - 129 + 82;
  12256. if (super.mouseX >= 276 && super.mouseX <= 493
  12257. && super.mouseY >= 199 && super.mouseY <= 224) {
  12258. textBoxHover.drawSprite(275, 200);
  12259. setTextCursor();
  12260. } else if (super.mouseX >= 276 && super.mouseX <= 492
  12261. && super.mouseY >= 245 && super.mouseY <= 272) {
  12262. textBoxHover.drawSprite(275, 246);
  12263. setTextCursor();
  12264. } else if (isTextCursor) {
  12265. setDefaultCursor();
  12266. }
  12267. smallText.method382(0xffffff, 385, loginMessage1, 283, true);
  12268. smallText.method382(0xffffff, 385, loginMessage2, 297, true);
  12269. // username & password
  12270. j += 39;
  12271. smallText.method389(false, 281, 0xffffff,
  12272. ""
  12273. + capitalize(myUsername)
  12274. + ((loginScreenCursorPos == 0)
  12275. & (loopCycle % 40 < 20) ? "|" : ""),
  12276. 216);
  12277. j += 53;
  12278. smallText.method389(true, 281, 0xffffff,
  12279. ""
  12280. + TextClass.passwordAsterisks(myPassword)
  12281. + ((loginScreenCursorPos == 1)
  12282. & (loopCycle % 40 < 20) ? "|" : ""),
  12283. 263);
  12284. j += 55;
  12285. // hovering
  12286. //Sprite sprite1 = new Sprite("SPRITEE 9");
  12287. //Sprite sprite2 = new Sprite("SPRITEE 10");
  12288. //if (!rememberMe)
  12289. //sprite1.drawSprite(265, 337);
  12290. //else
  12291. //sprite2.drawSprite(265, 337);
  12292. if (super.mouseX >= 293 && super.mouseX <= 474
  12293. && super.mouseY >= 302 && super.mouseY <= 327)
  12294. loginButtonHover.drawSprite(294, 301);
  12295. }
  12296. //smallText.method389(true, 283, 0xffffff, "Remember me?", 350);
  12297. loginScreenArea.drawGraphics(0, super.graphics, 0);
  12298. } catch (Exception ex) {
  12299. System.out.println(ex);
  12300. }
  12301. }
  12302.  
  12303. private void drawFlames() {
  12304. }
  12305.  
  12306. public void raiseWelcomeScreen() {
  12307. welcomeScreenRaised = true;
  12308. }
  12309.  
  12310. private void method137(Stream stream, int j) {
  12311. if (j == 84) {
  12312. int k = stream.readUnsignedByte();
  12313. int j3 = anInt1268 + (k >> 4 & 7);
  12314. int i6 = anInt1269 + (k & 7);
  12315. int l8 = stream.readUnsignedWord();
  12316. int k11 = stream.readUnsignedWord();
  12317. int l13 = stream.readUnsignedWord();
  12318. if (j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104) {
  12319. NodeList class19_1 = groundArray[plane][j3][i6];
  12320. if (class19_1 != null) {
  12321. for (Item class30_sub2_sub4_sub2_3 = (Item) class19_1
  12322. .reverseGetFirst(); class30_sub2_sub4_sub2_3 != null; class30_sub2_sub4_sub2_3 = (Item) class19_1
  12323. .reverseGetNext()) {
  12324. if (class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff)
  12325. || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  12326. continue;
  12327. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  12328. break;
  12329. }
  12330.  
  12331. spawnGroundItem(j3, i6);
  12332. }
  12333. }
  12334. return;
  12335. }
  12336. if (j == 105) {
  12337. int l = stream.readUnsignedByte();
  12338. int k3 = anInt1268 + (l >> 4 & 7);
  12339. int j6 = anInt1269 + (l & 7);
  12340. int i9 = stream.readUnsignedWord();
  12341. int l11 = stream.readUnsignedByte();
  12342. int i14 = l11 >> 4 & 0xf;
  12343. int i16 = l11 & 7;
  12344. if (myPlayer.smallX[0] >= k3 - i14
  12345. && myPlayer.smallX[0] <= k3 + i14
  12346. && myPlayer.smallY[0] >= j6 - i14
  12347. && myPlayer.smallY[0] <= j6 + i14 && aBoolean848 && !lowMem
  12348. && anInt1062 < 50) {
  12349. anIntArray1207[anInt1062] = i9;
  12350. anIntArray1241[anInt1062] = i16;
  12351. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  12352. anInt1062++;
  12353. }
  12354. }
  12355. if (j == 215) {
  12356. int i1 = stream.method435();
  12357. int l3 = stream.method428();
  12358. int k6 = anInt1268 + (l3 >> 4 & 7);
  12359. int j9 = anInt1269 + (l3 & 7);
  12360. int i12 = stream.method435();
  12361. int j14 = stream.readUnsignedWord();
  12362. if (k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104
  12363. && i12 != unknownInt10) {
  12364. Item class30_sub2_sub4_sub2_2 = new Item();
  12365. class30_sub2_sub4_sub2_2.ID = i1;
  12366. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  12367. if (groundArray[plane][k6][j9] == null)
  12368. groundArray[plane][k6][j9] = new NodeList();
  12369. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  12370. spawnGroundItem(k6, j9);
  12371. }
  12372. return;
  12373. }
  12374. if (j == 156) {
  12375. int j1 = stream.method426();
  12376. int i4 = anInt1268 + (j1 >> 4 & 7);
  12377. int l6 = anInt1269 + (j1 & 7);
  12378. int k9 = stream.readUnsignedWord();
  12379. if (i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104) {
  12380. NodeList class19 = groundArray[plane][i4][l6];
  12381. if (class19 != null) {
  12382. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  12383. .reverseGetNext()) {
  12384. if (item.ID != (k9 & 0x7fff))
  12385. continue;
  12386. item.unlink();
  12387. break;
  12388. }
  12389.  
  12390. if (class19.reverseGetFirst() == null)
  12391. groundArray[plane][i4][l6] = null;
  12392. spawnGroundItem(i4, l6);
  12393. }
  12394. }
  12395. return;
  12396. }
  12397. if (j == 160) {
  12398. int k1 = stream.method428();
  12399. int j4 = anInt1268 + (k1 >> 4 & 7);
  12400. int i7 = anInt1269 + (k1 & 7);
  12401. int l9 = stream.method428();
  12402. int j12 = l9 >> 2;
  12403. int k14 = l9 & 3;
  12404. int j16 = anIntArray1177[j12];
  12405. int j17 = stream.method435();
  12406. if (j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103) {
  12407. int j18 = intGroundArray[plane][j4][i7];
  12408. int i19 = intGroundArray[plane][j4 + 1][i7];
  12409. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  12410. int k20 = intGroundArray[plane][j4][i7 + 1];
  12411. if (j16 == 0) {
  12412. Object1 class10 = worldController.method296(plane, j4, i7);
  12413. if (class10 != null) {
  12414. int k21 = class10.uid >> 14 & 0x7fff;
  12415. if (j12 == 2) {
  12416. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  12417. k21, 4 + k14, 2, i19, l19, j18, k20, j17,
  12418. false);
  12419. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(
  12420. k21, k14 + 1 & 3, 2, i19, l19, j18, k20,
  12421. j17, false);
  12422. } else {
  12423. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  12424. k21, k14, j12, i19, l19, j18, k20, j17,
  12425. false);
  12426. }
  12427. }
  12428. }
  12429. if (j16 == 1) {
  12430. Object2 class26 = worldController.method297(j4, i7, plane);
  12431. if (class26 != null)
  12432. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(
  12433. class26.uid >> 14 & 0x7fff, 0, 4, i19, l19,
  12434. j18, k20, j17, false);
  12435. }
  12436. if (j16 == 2) {
  12437. Object5 class28 = worldController.method298(j4, i7, plane);
  12438. if (j12 == 11)
  12439. j12 = 10;
  12440. if (class28 != null)
  12441. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(
  12442. class28.uid >> 14 & 0x7fff, k14, j12, i19, l19,
  12443. j18, k20, j17, false);
  12444. }
  12445. if (j16 == 3) {
  12446. Object3 class49 = worldController.method299(i7, j4, plane);
  12447. if (class49 != null)
  12448. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(
  12449. class49.uid >> 14 & 0x7fff, k14, 22, i19, l19,
  12450. j18, k20, j17, false);
  12451. }
  12452. }
  12453. return;
  12454. }
  12455. if (j == 147) {
  12456. int l1 = stream.method428();
  12457. int k4 = anInt1268 + (l1 >> 4 & 7);
  12458. int j7 = anInt1269 + (l1 & 7);
  12459. int i10 = stream.readUnsignedWord();
  12460. byte byte0 = stream.method430();
  12461. int l14 = stream.method434();
  12462. byte byte1 = stream.method429();
  12463. int k17 = stream.readUnsignedWord();
  12464. int k18 = stream.method428();
  12465. int j19 = k18 >> 2;
  12466. int i20 = k18 & 3;
  12467. int l20 = anIntArray1177[j19];
  12468. byte byte2 = stream.readSignedByte();
  12469. int l21 = stream.readUnsignedWord();
  12470. byte byte3 = stream.method429();
  12471. Player player;
  12472. if (i10 == unknownInt10)
  12473. player = myPlayer;
  12474. else
  12475. player = playerArray[i10];
  12476. if (player != null) {
  12477. ObjectDef class46 = ObjectDef.forID(l21);
  12478. int i22 = intGroundArray[plane][k4][j7];
  12479. int j22 = intGroundArray[plane][k4 + 1][j7];
  12480. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  12481. int l22 = intGroundArray[plane][k4][j7 + 1];
  12482. Model model = class46.method578(j19, i20, i22, j22, k22, l22,
  12483. -1);
  12484. if (model != null) {
  12485. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  12486. player.anInt1707 = l14 + loopCycle;
  12487. player.anInt1708 = k17 + loopCycle;
  12488. player.aModel_1714 = model;
  12489. int i23 = class46.anInt744;
  12490. int j23 = class46.anInt761;
  12491. if (i20 == 1 || i20 == 3) {
  12492. i23 = class46.anInt761;
  12493. j23 = class46.anInt744;
  12494. }
  12495. player.anInt1711 = k4 * 128 + i23 * 64;
  12496. player.anInt1713 = j7 * 128 + j23 * 64;
  12497. player.anInt1712 = method42(plane, player.anInt1713,
  12498. player.anInt1711);
  12499. if (byte2 > byte0) {
  12500. byte byte4 = byte2;
  12501. byte2 = byte0;
  12502. byte0 = byte4;
  12503. }
  12504. if (byte3 > byte1) {
  12505. byte byte5 = byte3;
  12506. byte3 = byte1;
  12507. byte1 = byte5;
  12508. }
  12509. player.anInt1719 = k4 + byte2;
  12510. player.anInt1721 = k4 + byte0;
  12511. player.anInt1720 = j7 + byte3;
  12512. player.anInt1722 = j7 + byte1;
  12513. }
  12514. }
  12515. }
  12516. if (j == 151) {
  12517. int i2 = stream.method426();
  12518. int l4 = anInt1268 + (i2 >> 4 & 7);
  12519. int k7 = anInt1269 + (i2 & 7);
  12520. int j10 = stream.method434();
  12521. int k12 = stream.method428();
  12522. int i15 = k12 >> 2;
  12523. int k16 = k12 & 3;
  12524. int l17 = anIntArray1177[i15];
  12525. if (l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  12526. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  12527. return;
  12528. }
  12529. if (j == 4) {
  12530. int j2 = stream.readUnsignedByte();
  12531. int i5 = anInt1268 + (j2 >> 4 & 7);
  12532. int l7 = anInt1269 + (j2 & 7);
  12533. int k10 = stream.readUnsignedWord();
  12534. int l12 = stream.readUnsignedByte();
  12535. int j15 = stream.readUnsignedWord();
  12536. if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) {
  12537. i5 = i5 * 128 + 64;
  12538. l7 = l7 * 128 + 64;
  12539. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane,
  12540. loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7,
  12541. i5);
  12542. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  12543. }
  12544. return;
  12545. }
  12546. if (j == 44) {
  12547. int k2 = stream.method436();
  12548. int j5 = stream.readUnsignedWord();
  12549. int i8 = stream.readUnsignedByte();
  12550. int l10 = anInt1268 + (i8 >> 4 & 7);
  12551. int i13 = anInt1269 + (i8 & 7);
  12552. if (l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104) {
  12553. Item class30_sub2_sub4_sub2_1 = new Item();
  12554. class30_sub2_sub4_sub2_1.ID = k2;
  12555. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  12556. if (groundArray[plane][l10][i13] == null)
  12557. groundArray[plane][l10][i13] = new NodeList();
  12558. groundArray[plane][l10][i13]
  12559. .insertHead(class30_sub2_sub4_sub2_1);
  12560. spawnGroundItem(l10, i13);
  12561. }
  12562. return;
  12563. }
  12564. if (j == 101) {
  12565. int l2 = stream.method427();
  12566. int k5 = l2 >> 2;
  12567. int j8 = l2 & 3;
  12568. int i11 = anIntArray1177[k5];
  12569. int j13 = stream.readUnsignedByte();
  12570. int k15 = anInt1268 + (j13 >> 4 & 7);
  12571. int l16 = anInt1269 + (j13 & 7);
  12572. if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  12573. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  12574. return;
  12575. }
  12576. if (j == 117) {
  12577. int i3 = stream.readUnsignedByte();
  12578. int l5 = anInt1268 + (i3 >> 4 & 7);
  12579. int k8 = anInt1269 + (i3 & 7);
  12580. int j11 = l5 + stream.readSignedByte();
  12581. int k13 = k8 + stream.readSignedByte();
  12582. int l15 = stream.readSignedWord();
  12583. int i17 = stream.readUnsignedWord();
  12584. int i18 = stream.readUnsignedByte() * 4;
  12585. int l18 = stream.readUnsignedByte() * 4;
  12586. int k19 = stream.readUnsignedWord();
  12587. int j20 = stream.readUnsignedWord();
  12588. int i21 = stream.readUnsignedByte();
  12589. int j21 = stream.readUnsignedByte();
  12590. if (l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0
  12591. && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535) {
  12592. l5 = l5 * 128 + 64;
  12593. k8 = k8 * 128 + 64;
  12594. j11 = j11 * 128 + 64;
  12595. k13 = k13 * 128 + 64;
  12596. Animable_Sub4 class30_sub2_sub4_sub4 = new Animable_Sub4(i21,
  12597. l18, k19 + loopCycle, j20 + loopCycle, j21, plane,
  12598. method42(plane, k8, l5) - i18, k8, l5, l15, i17);
  12599. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13,
  12600. method42(plane, k13, j11) - l18, j11);
  12601. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  12602. }
  12603. }
  12604. }
  12605.  
  12606. private static void setLowMem() {
  12607. WorldController.lowMem = true;
  12608. Texture.lowMem = true;
  12609. lowMem = true;
  12610. ObjectManager.lowMem = true;
  12611. ObjectDef.lowMem = true;
  12612. }
  12613.  
  12614. private void method139(Stream stream) {
  12615. stream.initBitAccess();
  12616. int k = stream.readBits(8);
  12617. if (k < npcCount) {
  12618. for (int l = k; l < npcCount; l++)
  12619. anIntArray840[anInt839++] = npcIndices[l];
  12620.  
  12621. }
  12622. if (k > npcCount) {
  12623. signlink.reporterror(myUsername + " Too many npcs");
  12624. throw new RuntimeException("eek");
  12625. }
  12626. npcCount = 0;
  12627. for (int i1 = 0; i1 < k; i1++) {
  12628. int j1 = npcIndices[i1];
  12629. NPC npc = npcArray[j1];
  12630. int k1 = stream.readBits(1);
  12631. if (k1 == 0) {
  12632. npcIndices[npcCount++] = j1;
  12633. npc.anInt1537 = loopCycle;
  12634. } else {
  12635. int l1 = stream.readBits(2);
  12636. if (l1 == 0) {
  12637. npcIndices[npcCount++] = j1;
  12638. npc.anInt1537 = loopCycle;
  12639. anIntArray894[anInt893++] = j1;
  12640. } else if (l1 == 1) {
  12641. npcIndices[npcCount++] = j1;
  12642. npc.anInt1537 = loopCycle;
  12643. int i2 = stream.readBits(3);
  12644. npc.moveInDir(false, i2);
  12645. int k2 = stream.readBits(1);
  12646. if (k2 == 1)
  12647. anIntArray894[anInt893++] = j1;
  12648. } else if (l1 == 2) {
  12649. npcIndices[npcCount++] = j1;
  12650. npc.anInt1537 = loopCycle;
  12651. int j2 = stream.readBits(3);
  12652. npc.moveInDir(true, j2);
  12653. int l2 = stream.readBits(3);
  12654. npc.moveInDir(true, l2);
  12655. int i3 = stream.readBits(1);
  12656. if (i3 == 1)
  12657. anIntArray894[anInt893++] = j1;
  12658. } else if (l1 == 3)
  12659. anIntArray840[anInt839++] = j1;
  12660. }
  12661. }
  12662.  
  12663. }
  12664.  
  12665. private void resetImage() {
  12666. DrawingArea.setAllPixelsToZero();
  12667. }
  12668.  
  12669. public void processLoginScreenInput() {
  12670. if (loginScreenState == 0) {
  12671. loginMessage1 = "";
  12672. loginScreenState = 2;
  12673. loginScreenCursorPos = 0;
  12674. } else {
  12675. if (loginScreenState == 2) {
  12676. int j = super.myHeight / 2 - 40;
  12677. j += 30;
  12678. j += 25;
  12679. resetImage();
  12680. if (super.clickMode3 == 1 && super.saveClickX >= 263
  12681. && super.saveClickX <= 355 && super.saveClickY >= 336
  12682. && super.saveClickY <= 355) {
  12683. rememberMe = rememberMe ? false : true;
  12684. }
  12685.  
  12686. if (super.clickMode3 == 1 && super.saveClickX >= 276
  12687. && super.saveClickX <= 493 && super.saveClickY >= 199
  12688. && super.saveClickY < 224)// box 1
  12689. loginScreenCursorPos = 0;
  12690. j += 15;
  12691. if (super.clickMode3 == 1
  12692. && super.saveClickX >= 276 // box 2clicking
  12693. && super.saveClickX <= 492 && super.saveClickY >= 245
  12694. && super.mouseY <= 272)
  12695. loginScreenCursorPos = 1;
  12696. j += 15;
  12697. int i1 = super.myWidth / 2;
  12698. int k1 = super.myHeight / 2 + 50;
  12699. k1 += 20;
  12700.  
  12701. // Back here
  12702. if (super.clickMode3 == 1
  12703. && super.saveClickX >= 293 // login button clicking
  12704. && super.saveClickX <= 474 && super.saveClickY >= 302
  12705. && super.saveClickY <= 327) {
  12706. loginFailures = 0;
  12707. login(myUsername, myPassword, false);
  12708. try {
  12709. client.writeSettings();
  12710. } catch (IOException e) {
  12711. e.printStackTrace();
  12712. }
  12713. if (loggedIn)
  12714. return;
  12715. }
  12716. do {
  12717. int l1 = readChar(-796);
  12718. if (l1 == -1)
  12719. break;
  12720. boolean flag1 = false;
  12721. for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  12722. if (l1 != validUserPassChars.charAt(i2))
  12723. continue;
  12724. flag1 = true;
  12725. break;
  12726. }
  12727.  
  12728. if (loginScreenCursorPos == 0) {
  12729. if (l1 == 8 && myUsername.length() > 0)
  12730. myUsername = myUsername.substring(0, myUsername
  12731. .length() - 1);
  12732. if (l1 == 9 || l1 == 10 || l1 == 13)
  12733. loginScreenCursorPos = 1;
  12734. if (flag1)
  12735. myUsername += (char) l1;
  12736. if (myUsername.length() > 12)
  12737. myUsername = myUsername.substring(0, 12);
  12738. } else if (loginScreenCursorPos == 1) {
  12739. if (l1 == 8 && myPassword.length() > 0)
  12740. myPassword = myPassword.substring(0, myPassword
  12741. .length() - 1);
  12742. if (l1 == 9 || l1 == 10 || l1 == 13)
  12743. if (myUsername.length() > 0
  12744. && myPassword.length() > 0)
  12745. login(myUsername, myPassword, false);
  12746. else
  12747. loginScreenCursorPos = 0;
  12748. if (flag1)
  12749. myPassword += (char) l1;
  12750. if (myPassword.length() > 20)
  12751. myPassword = myPassword.substring(0, 20);
  12752. }
  12753. } while (true);
  12754. return;
  12755. }
  12756. if (loginScreenState == 3) {
  12757. int k = super.myWidth / 2;
  12758. int j1 = super.myHeight / 2 + 50;
  12759. j1 += 20;
  12760. if (super.clickMode3 == 1 && super.saveClickX >= k - 75
  12761. && super.saveClickX <= k + 75
  12762. && super.saveClickY >= j1 - 20
  12763. && super.saveClickY <= j1 + 20)
  12764. loginScreenState = 0;
  12765. }
  12766. }
  12767. }
  12768.  
  12769. private void markMinimap(Sprite sprite, int i, int j) {
  12770. int x = isFullScreen ? 549 + extraWidth : 0;
  12771. int markY = 6;
  12772. int markX = 9;
  12773. int k = minimapInt1 + minimapInt2 & 0x7ff;
  12774. int l = i * i + j * j;
  12775. if (l > 6400)
  12776. return;
  12777. int i1 = Model.modelIntArray1[k];
  12778. int j1 = Model.modelIntArray2[k];
  12779. i1 = (i1 * 256) / (minimapInt3 + 256);
  12780. j1 = (j1 * 256) / (minimapInt3 + 256);
  12781. int k1 = j * i1 + i * j1 >> 16;
  12782. int l1 = j * j1 - i * i1 >> 16;
  12783. try {
  12784. if (!isFullScreen) {
  12785. sprite.drawSprite((((94 + k1) - sprite.anInt1444 / 2) + 4) + x
  12786. + markX, (83 - l1 - sprite.anInt1445 / 2 - 4) + markY);
  12787. }
  12788. } catch (Exception e) {
  12789. }
  12790. try {
  12791. if (isFullScreen) {
  12792. sprite.drawSprite((((94 + k1) - sprite.anInt1444 / 2) + 4) + x
  12793. + markX, (83 - l1 - sprite.anInt1445 / 2 - 4) + markY);
  12794. }
  12795. } catch (Exception e) {
  12796. }
  12797.  
  12798. }
  12799.  
  12800. private void method142(int i, int j, int k, int l, int i1, int j1, int k1) {
  12801. if (i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102) {
  12802. if (lowMem && j != plane)
  12803. return;
  12804. int i2 = 0;
  12805. if (j1 == 0)
  12806. i2 = worldController.method300(j, i1, i);
  12807. if (j1 == 1)
  12808. i2 = worldController.method301(j, i1, i);
  12809. if (j1 == 2)
  12810. i2 = worldController.method302(j, i1, i);
  12811. if (j1 == 3)
  12812. i2 = worldController.method303(j, i1, i);
  12813. if (i2 != 0) {
  12814. int i3 = worldController.method304(j, i1, i, i2);
  12815. int j2 = i2 >> 14 & 0x7fff;
  12816. int k2 = i3 & 0x1f;
  12817. int l2 = i3 >> 6;
  12818. if (j1 == 0) {
  12819. worldController.method291(i1, j, i, (byte) -119);
  12820. ObjectDef class46 = ObjectDef.forID(j2);
  12821. if (class46.aBoolean767)
  12822. aClass11Array1230[j].method215(l2, k2,
  12823. class46.aBoolean757, i1, i);
  12824. }
  12825. if (j1 == 1)
  12826. worldController.method292(i, j, i1);
  12827. if (j1 == 2) {
  12828. worldController.method293(j, i1, i);
  12829. ObjectDef class46_1 = ObjectDef.forID(j2);
  12830. if (i1 + class46_1.anInt744 > 103
  12831. || i + class46_1.anInt744 > 103
  12832. || i1 + class46_1.anInt761 > 103
  12833. || i + class46_1.anInt761 > 103)
  12834. return;
  12835. if (class46_1.aBoolean767)
  12836. aClass11Array1230[j].method216(l2, class46_1.anInt744,
  12837. i1, i, class46_1.anInt761,
  12838. class46_1.aBoolean757);
  12839. }
  12840. if (j1 == 3) {
  12841. worldController.method294(j, i, i1);
  12842. ObjectDef class46_2 = ObjectDef.forID(j2);
  12843. if (class46_2.aBoolean767 && class46_2.hasActions)
  12844. aClass11Array1230[j].method218(i, i1);
  12845. }
  12846. }
  12847. if (k1 >= 0) {
  12848. int j3 = j;
  12849. if (j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  12850. j3++;
  12851. ObjectManager.method188(worldController, k, i, l, j3,
  12852. aClass11Array1230[j], intGroundArray, i1, k1, j);
  12853. }
  12854. }
  12855. }
  12856.  
  12857. private void updatePlayers(int i, Stream stream) {
  12858. anInt839 = 0;
  12859. anInt893 = 0;
  12860. method117(stream);
  12861. method134(stream);
  12862. method91(stream, i);
  12863. method49(stream);
  12864. for (int k = 0; k < anInt839; k++) {
  12865. int l = anIntArray840[k];
  12866. if (playerArray[l].anInt1537 != loopCycle)
  12867. playerArray[l] = null;
  12868. }
  12869.  
  12870. if (stream.currentOffset != i) {
  12871. signlink.reporterror("Error packet size mismatch in getplayer pos:"
  12872. + stream.currentOffset + " psize:" + i);
  12873. throw new RuntimeException("eek");
  12874. }
  12875. for (int i1 = 0; i1 < playerCount; i1++)
  12876. if (playerArray[playerIndices[i1]] == null) {
  12877. signlink.reporterror(myUsername
  12878. + " null entry in pl list - pos:" + i1 + " size:"
  12879. + playerCount);
  12880. throw new RuntimeException("eek");
  12881. }
  12882.  
  12883. }
  12884.  
  12885. private void setCameraPos(int i, int j, int k, int l, int i1, int j1) {
  12886. try {
  12887. int k1 = 2048 - j & 0x7ff;
  12888. int l1 = 2048 - i1 & 0x7ff;
  12889. int i2 = 0;
  12890. int j2 = 0;
  12891. if (Zoom > 330) {
  12892. Zoom = 330;
  12893. }
  12894. if (Zoom < -390) {
  12895. Zoom = -390;
  12896. }
  12897. int k2 = i - Zoom;
  12898. if (k1 != 0) {
  12899. int l2 = Model.modelIntArray1[k1];
  12900. int j3 = Model.modelIntArray2[k1];
  12901. int l3 = j2 * j3 - k2 * l2 >> 16;
  12902. k2 = j2 * l2 + k2 * j3 >> 16;
  12903. j2 = l3;
  12904. }
  12905. if (l1 != 0) {
  12906. int i3 = Model.modelIntArray1[l1];
  12907. int k3 = Model.modelIntArray2[l1];
  12908. int i4 = k2 * i3 + i2 * k3 >> 16;
  12909. k2 = k2 * k3 - i2 * i3 >> 16;
  12910. i2 = i4;
  12911. }
  12912. xCameraPos = k - i2;
  12913. zCameraPos = l - j2;
  12914. yCameraPos = j1 - k2;
  12915. yCameraCurve = j;
  12916. xCameraCurve = i1;
  12917. } catch (Exception exception) {
  12918. }
  12919. }
  12920.  
  12921. public void updateStrings(String str, int i) {
  12922. switch (i) {
  12923. case 1675:
  12924. sendFrame126(str, 17508);
  12925. break;// Stab
  12926. case 1676:
  12927. sendFrame126(str, 17509);
  12928. break;// Slash
  12929. case 1677:
  12930. sendFrame126(str, 17510);
  12931. break;// Cursh
  12932. case 1678:
  12933. sendFrame126(str, 17511);
  12934. break;// Magic
  12935. case 1679:
  12936. sendFrame126(str, 17512);
  12937. break;// Range
  12938. case 1680:
  12939. sendFrame126(str, 17513);
  12940. break;// Stab
  12941. case 1681:
  12942. sendFrame126(str, 17514);
  12943. break;// Slash
  12944. case 1682:
  12945. sendFrame126(str, 17515);
  12946. break;// Crush
  12947. case 1683:
  12948. sendFrame126(str, 17516);
  12949. break;// Magic
  12950. case 1684:
  12951. sendFrame126(str, 17517);
  12952. break;// Range
  12953. case 1686:
  12954. sendFrame126(str, 17518);
  12955. break;// Strength
  12956. case 1687:
  12957. sendFrame126(str, 17519);
  12958. break;// Prayer
  12959. }
  12960. }
  12961.  
  12962. public void sendFrame126(String str, int i) {
  12963. try {
  12964. RSInterface.interfaceCache[i].message = str;
  12965. if (RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  12966. needDrawTabArea = true;
  12967. } catch (Exception e) {
  12968. }
  12969. }
  12970.  
  12971. public void sendPacket185(int button, int toggle, int type) {
  12972. switch (type) {
  12973. case 135:
  12974. RSInterface class9 = RSInterface.interfaceCache[button];
  12975. boolean flag8 = true;
  12976. if (class9.contentType > 0)
  12977. flag8 = promptUserForInput(class9);
  12978. if (flag8) {
  12979. stream.createFrame(185);
  12980. stream.writeWord(button);
  12981. }
  12982. break;
  12983. case 646:
  12984. stream.createFrame(185);
  12985. stream.writeWord(button);
  12986. RSInterface class9_2 = RSInterface.interfaceCache[button];
  12987. if (class9_2.valueIndexArray != null
  12988. && class9_2.valueIndexArray[0][0] == 5) {
  12989. if (variousSettings[toggle] != class9_2.anIntArray212[0]) {
  12990. variousSettings[toggle] = class9_2.anIntArray212[0];
  12991. method33(toggle);
  12992. needDrawTabArea = true;
  12993. }
  12994. }
  12995. break;
  12996. case 169:
  12997. stream.createFrame(185);
  12998. stream.writeWord(button);
  12999. RSInterface class9_3 = RSInterface.interfaceCache[button];
  13000. if (class9_3.valueIndexArray != null
  13001. && class9_3.valueIndexArray[0][0] == 5) {
  13002. variousSettings[toggle] = 1 - variousSettings[toggle];
  13003. method33(toggle);
  13004. needDrawTabArea = true;
  13005. }
  13006. switch (button) {
  13007. case 19136:
  13008. System.out.println("toggle = " + toggle);
  13009. if (toggle == 0)
  13010. sendFrame36(173, toggle);
  13011. if (toggle == 1)
  13012. sendPacket185(153, 173, 646);
  13013. break;
  13014. }
  13015. break;
  13016. }
  13017. }
  13018.  
  13019. public void sendFrame36(int id, int state) {
  13020. anIntArray1045[id] = state;
  13021. if (variousSettings[id] != state) {
  13022. variousSettings[id] = state;
  13023. method33(id);
  13024. needDrawTabArea = true;
  13025. if (dialogID != -1)
  13026. inputTaken = true;
  13027. }
  13028. }
  13029.  
  13030. public void sendFrame219() {
  13031. if (invOverlayInterfaceID != -1) {
  13032. invOverlayInterfaceID = -1;
  13033. needDrawTabArea = true;
  13034. tabAreaAltered = true;
  13035. }
  13036. if (backDialogID != -1) {
  13037. backDialogID = -1;
  13038. inputTaken = true;
  13039. }
  13040. if (inputDialogState != 0) {
  13041. inputDialogState = 0;
  13042. inputTaken = true;
  13043. }
  13044. openInterfaceID = -1;
  13045. aBoolean1149 = false;
  13046. }
  13047.  
  13048. public void sendFrame248(int interfaceID, int sideInterfaceID) {
  13049. if (backDialogID != -1) {
  13050. backDialogID = -1;
  13051. inputTaken = true;
  13052. }
  13053. if (inputDialogState != 0) {
  13054. inputDialogState = 0;
  13055. inputTaken = true;
  13056. }
  13057. openInterfaceID = interfaceID;
  13058. invOverlayInterfaceID = sideInterfaceID;
  13059. needDrawTabArea = true;
  13060. tabAreaAltered = true;
  13061. aBoolean1149 = false;
  13062. }
  13063.  
  13064. private boolean parsePacket() {
  13065. if (socketStream == null)
  13066. return false;
  13067. try {
  13068. int i = socketStream.available();
  13069. if (i == 0)
  13070. return false;
  13071. if (pktType == -1) {
  13072. socketStream.flushInputStream(inStream.buffer, 1);
  13073. pktType = inStream.buffer[0] & 0xff;
  13074. if (encryption != null)
  13075. pktType = pktType - encryption.getNextKey() & 0xff;
  13076. pktSize = SizeConstants.packetSizes[pktType];
  13077. i--;
  13078. }
  13079. if (pktSize == -1)
  13080. if (i > 0) {
  13081. socketStream.flushInputStream(inStream.buffer, 1);
  13082. pktSize = inStream.buffer[0] & 0xff;
  13083. i--;
  13084. } else {
  13085. return false;
  13086. }
  13087. if (pktSize == -2)
  13088. if (i > 1) {
  13089. socketStream.flushInputStream(inStream.buffer, 2);
  13090. inStream.currentOffset = 0;
  13091. pktSize = inStream.readUnsignedWord();
  13092. i -= 2;
  13093. } else {
  13094. return false;
  13095. }
  13096. if (i < pktSize)
  13097. return false;
  13098. inStream.currentOffset = 0;
  13099. socketStream.flushInputStream(inStream.buffer, pktSize);
  13100. anInt1009 = 0;
  13101. anInt843 = anInt842;
  13102. anInt842 = anInt841;
  13103. anInt841 = pktType;
  13104. switch (pktType) {
  13105. case 81:
  13106. updatePlayers(pktSize, inStream);
  13107. aBoolean1080 = false;
  13108. pktType = -1;
  13109. return true;
  13110.  
  13111. case 176:
  13112. daysSinceRecovChange = inStream.method427();
  13113. unreadMessages = inStream.method435();
  13114. membersInt = inStream.readUnsignedByte();
  13115. anInt1193 = inStream.method440();
  13116. daysSinceLastLogin = inStream.readUnsignedWord();
  13117. if (anInt1193 != 0 && openInterfaceID == -1) {
  13118. signlink.dnslookup(TextClass.method586(anInt1193));
  13119. clearTopInterfaces();
  13120. char c = '\u028A';
  13121. if (daysSinceRecovChange != 201 || membersInt == 1)
  13122. c = '\u028F';
  13123. reportAbuseInput = "";
  13124. canMute = false;
  13125. for (int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  13126. if (RSInterface.interfaceCache[k9] == null
  13127. || RSInterface.interfaceCache[k9].contentType != c)
  13128. continue;
  13129. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  13130.  
  13131. }
  13132. }
  13133. pktType = -1;
  13134. return true;
  13135.  
  13136. case 64:
  13137. anInt1268 = inStream.method427();
  13138. anInt1269 = inStream.method428();
  13139. for (int j = anInt1268; j < anInt1268 + 8; j++) {
  13140. for (int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  13141. if (groundArray[plane][j][l9] != null) {
  13142. groundArray[plane][j][l9] = null;
  13143. spawnGroundItem(j, l9);
  13144. }
  13145. }
  13146. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  13147. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  13148. .reverseGetNext())
  13149. if (class30_sub1.anInt1297 >= anInt1268
  13150. && class30_sub1.anInt1297 < anInt1268 + 8
  13151. && class30_sub1.anInt1298 >= anInt1269
  13152. && class30_sub1.anInt1298 < anInt1269 + 8
  13153. && class30_sub1.anInt1295 == plane)
  13154. class30_sub1.anInt1294 = 0;
  13155. pktType = -1;
  13156. return true;
  13157.  
  13158. case 185:
  13159. int k = inStream.method436();
  13160. RSInterface.interfaceCache[k].anInt233 = 3;
  13161. if (myPlayer.desc == null)
  13162. RSInterface.interfaceCache[k].mediaID = (myPlayer.anIntArray1700[0] << 25)
  13163. + (myPlayer.anIntArray1700[4] << 20)
  13164. + (myPlayer.equipment[0] << 15)
  13165. + (myPlayer.equipment[8] << 10)
  13166. + (myPlayer.equipment[11] << 5)
  13167. + myPlayer.equipment[1];
  13168. else
  13169. RSInterface.interfaceCache[k].mediaID = (int) (0x12345678L + myPlayer.desc.type);
  13170. pktType = -1;
  13171. return true;
  13172.  
  13173. /* Clan message packet *///this
  13174. case 217:
  13175. try {
  13176. clanUsername = inStream.readString();
  13177. clanMessage = TextInput.processText(inStream.readString());
  13178. clanTitle = inStream.readString();
  13179. channelRights = inStream.readUnsignedWord();
  13180. pushMessage(clanMessage, 16, clanUsername);
  13181. //System.out.println("clanMessage: " + clanMessage + ", clanUsername: " + clanUsername);
  13182. } catch (Exception e) {
  13183. e.printStackTrace();
  13184. }
  13185. pktType = -1;
  13186. return true;
  13187. case 216:
  13188. try {
  13189. name = inStream.readString();
  13190. addClanMember(name);
  13191. } catch (Exception e) {
  13192. e.printStackTrace();
  13193. }
  13194. pktType = -1;
  13195. return true;
  13196. case 213:
  13197. try {
  13198. name = inStream.readString();
  13199. removeClanMember(name);
  13200. } catch (Exception e) {
  13201. e.printStackTrace();
  13202. }
  13203. pktType = -1;
  13204. return true;
  13205.  
  13206. case 107:
  13207. aBoolean1160 = false;
  13208. for (int l = 0; l < 5; l++)
  13209. aBooleanArray876[l] = false;
  13210. pktType = -1;
  13211. return true;
  13212. case 72:
  13213. int i1 = inStream.method434();
  13214. RSInterface class9 = RSInterface.interfaceCache[i1];
  13215. for (int k15 = 0; k15 < class9.inv.length; k15++) {
  13216. class9.inv[k15] = -1;
  13217. class9.inv[k15] = 0;
  13218. }
  13219. pktType = -1;
  13220. return true;
  13221.  
  13222. case 214:
  13223. ignoreCount = pktSize / 8;
  13224. for (int j1 = 0; j1 < ignoreCount; j1++)
  13225. ignoreListAsLongs[j1] = inStream.readQWord();
  13226. pktType = -1;
  13227. return true;
  13228.  
  13229. case 166:
  13230. aBoolean1160 = true;
  13231. anInt1098 = inStream.readUnsignedByte();
  13232. anInt1099 = inStream.readUnsignedByte();
  13233. anInt1100 = inStream.readUnsignedWord();
  13234. anInt1101 = inStream.readUnsignedByte();
  13235. anInt1102 = inStream.readUnsignedByte();
  13236. if (anInt1102 >= 100) {
  13237. xCameraPos = anInt1098 * 128 + 64;
  13238. yCameraPos = anInt1099 * 128 + 64;
  13239. zCameraPos = method42(plane, yCameraPos, xCameraPos)
  13240. - anInt1100;
  13241. }
  13242. pktType = -1;
  13243. return true;
  13244.  
  13245. case 134:
  13246. needDrawTabArea = true;
  13247.  
  13248. int k1 = inStream.readUnsignedByte();
  13249. int i10 = inStream.method439();
  13250. int l15 = inStream.readUnsignedByte();
  13251. int oldXp = currentExp[k1];
  13252. if (drawXpBar) {
  13253. drawFlag = true;
  13254. }
  13255. currentExp[k1] = i10;
  13256. currentStats[k1] = l15;
  13257. maxStats[k1] = 1;
  13258. testXp += currentExp[k1] - oldXp;
  13259. xpToDraw += currentExp[k1] - oldXp;
  13260. if (testXp == currentExp[k1]) {
  13261. testXp = 0;
  13262. xpToDraw = 0;
  13263. }
  13264. for (int k20 = 0; k20 < 98; k20++)
  13265. if (i10 >= anIntArray1019[k20])
  13266. maxStats[k1] = k20 + 2;
  13267. pktType = -1;
  13268. return true;
  13269.  
  13270. case 71:
  13271. int l1 = inStream.readUnsignedWord();
  13272. int j10 = inStream.method426();
  13273. if (l1 == 65535)
  13274. l1 = -1;
  13275. tabInterfaceIDs[j10] = l1;
  13276. needDrawTabArea = true;
  13277. tabAreaAltered = true;
  13278. pktType = -1;
  13279. return true;
  13280.  
  13281. case 74:
  13282. int i2 = inStream.method434();
  13283. if (i2 == 65535)
  13284. i2 = -1;
  13285. if (i2 != currentSong && musicEnabled && !lowMem
  13286. && prevSong == 0) {
  13287. nextSong = i2;
  13288. songChanging = true;
  13289. onDemandFetcher.method558(2, nextSong);
  13290. }
  13291. currentSong = i2;
  13292. pktType = -1;
  13293. return true;
  13294.  
  13295. case 121:
  13296. int j2 = inStream.method436();
  13297. int k10 = inStream.method435();
  13298. if (musicEnabled && !lowMem) {
  13299. nextSong = j2;
  13300. songChanging = false;
  13301. onDemandFetcher.method558(2, nextSong);
  13302. prevSong = k10;
  13303. }
  13304. pktType = -1;
  13305. return true;
  13306.  
  13307. case 109:
  13308. resetLogout();
  13309. pktType = -1;
  13310. return false;
  13311.  
  13312. case 70:
  13313. int k2 = inStream.readSignedWord();
  13314. int l10 = inStream.method437();
  13315. int i16 = inStream.method434();
  13316. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  13317. class9_5.anInt263 = k2;
  13318. class9_5.anInt265 = l10;
  13319. pktType = -1;
  13320. return true;
  13321.  
  13322. case 73:
  13323. case 241:
  13324. int l2 = anInt1069;
  13325. int i11 = anInt1070;
  13326. if (pktType == 73) {
  13327. l2 = inStream.method435();
  13328. i11 = inStream.readUnsignedWord();
  13329. aBoolean1159 = false;
  13330. }
  13331. if (pktType == 241) {
  13332. i11 = inStream.method435();
  13333. inStream.initBitAccess();
  13334. for (int j16 = 0; j16 < 4; j16++) {
  13335. for (int l20 = 0; l20 < 13; l20++) {
  13336. for (int j23 = 0; j23 < 13; j23++) {
  13337. int i26 = inStream.readBits(1);
  13338. if (i26 == 1)
  13339. anIntArrayArrayArray1129[j16][l20][j23] = inStream
  13340. .readBits(26);
  13341. else
  13342. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  13343. }
  13344. }
  13345. }
  13346. inStream.finishBitAccess();
  13347. l2 = inStream.readUnsignedWord();
  13348. aBoolean1159 = true;
  13349. }
  13350. if (anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  13351. pktType = -1;
  13352. return true;
  13353. }
  13354. anInt1069 = l2;
  13355. anInt1070 = i11;
  13356. baseX = (anInt1069 - 6) * 8;
  13357. baseY = (anInt1070 - 6) * 8;
  13358. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49)
  13359. && anInt1070 / 8 == 48;
  13360. if (anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  13361. aBoolean1141 = true;
  13362. loadingStage = 1;
  13363. aLong824 = System.currentTimeMillis();
  13364. aRSImageProducer_1165.initDrawingArea();
  13365. DrawingArea.fillPixels(2, 130, 22, 0xffffff, 2); //white box around
  13366. DrawingArea.method336(20, 3, 3, 0, 128); //black fill
  13367. aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 18, 68);
  13368. aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 17, 67);
  13369. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  13370. if (pktType == 73) {
  13371. int k16 = 0;
  13372. for (int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  13373. for (int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  13374. k16++;
  13375. }
  13376. aByteArrayArray1183 = new byte[k16][];
  13377. aByteArrayArray1247 = new byte[k16][];
  13378. anIntArray1234 = new int[k16];
  13379. anIntArray1235 = new int[k16];
  13380. anIntArray1236 = new int[k16];
  13381. k16 = 0;
  13382. for (int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  13383. for (int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  13384. anIntArray1234[k16] = (l23 << 8) + j26;
  13385. if (aBoolean1141
  13386. && (j26 == 49 || j26 == 149 || j26 == 147
  13387. || l23 == 50 || l23 == 49
  13388. && j26 == 47)) {
  13389. anIntArray1235[k16] = -1;
  13390. anIntArray1236[k16] = -1;
  13391. k16++;
  13392. } else {
  13393. int k28 = anIntArray1235[k16] = onDemandFetcher
  13394. .method562(0, j26, l23);
  13395. if (k28 != -1)
  13396. onDemandFetcher.method558(3, k28);
  13397. int j30 = anIntArray1236[k16] = onDemandFetcher
  13398. .method562(1, j26, l23);
  13399. if (j30 != -1)
  13400. onDemandFetcher.method558(3, j30);
  13401. k16++;
  13402. }
  13403. }
  13404. }
  13405. }
  13406. if (pktType == 241) {
  13407. int l16 = 0;
  13408. int ai[] = new int[676];
  13409. for (int i24 = 0; i24 < 4; i24++) {
  13410. for (int k26 = 0; k26 < 13; k26++) {
  13411. for (int l28 = 0; l28 < 13; l28++) {
  13412. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  13413. if (k30 != -1) {
  13414. int k31 = k30 >> 14 & 0x3ff;
  13415. int i32 = k30 >> 3 & 0x7ff;
  13416. int k32 = (k31 / 8 << 8) + i32 / 8;
  13417. for (int j33 = 0; j33 < l16; j33++) {
  13418. if (ai[j33] != k32)
  13419. continue;
  13420. k32 = -1;
  13421.  
  13422. }
  13423. if (k32 != -1)
  13424. ai[l16++] = k32;
  13425. }
  13426. }
  13427. }
  13428. }
  13429. aByteArrayArray1183 = new byte[l16][];
  13430. aByteArrayArray1247 = new byte[l16][];
  13431. anIntArray1234 = new int[l16];
  13432. anIntArray1235 = new int[l16];
  13433. anIntArray1236 = new int[l16];
  13434. for (int l26 = 0; l26 < l16; l26++) {
  13435. int i29 = anIntArray1234[l26] = ai[l26];
  13436. int l30 = i29 >> 8 & 0xff;
  13437. int l31 = i29 & 0xff;
  13438. int j32 = anIntArray1235[l26] = onDemandFetcher
  13439. .method562(0, l31, l30);
  13440. if (j32 != -1)
  13441. onDemandFetcher.method558(3, j32);
  13442. int i33 = anIntArray1236[l26] = onDemandFetcher
  13443. .method562(1, l31, l30);
  13444. if (i33 != -1)
  13445. onDemandFetcher.method558(3, i33);
  13446. }
  13447. }
  13448. int i17 = baseX - anInt1036;
  13449. int j21 = baseY - anInt1037;
  13450. anInt1036 = baseX;
  13451. anInt1037 = baseY;
  13452. for (int j24 = 0; j24 < 16384; j24++) {
  13453. NPC npc = npcArray[j24];
  13454. if (npc != null) {
  13455. for (int j29 = 0; j29 < 10; j29++) {
  13456. npc.smallX[j29] -= i17;
  13457. npc.smallY[j29] -= j21;
  13458. }
  13459. npc.x -= i17 * 128;
  13460. npc.y -= j21 * 128;
  13461. }
  13462. }
  13463. for (int i27 = 0; i27 < maxPlayers; i27++) {
  13464. Player player = playerArray[i27];
  13465. if (player != null) {
  13466. for (int i31 = 0; i31 < 10; i31++) {
  13467. player.smallX[i31] -= i17;
  13468. player.smallY[i31] -= j21;
  13469. }
  13470. player.x -= i17 * 128;
  13471. player.y -= j21 * 128;
  13472. }
  13473. }
  13474. aBoolean1080 = true;
  13475. byte byte1 = 0;
  13476. byte byte2 = 104;
  13477. byte byte3 = 1;
  13478. if (i17 < 0) {
  13479. byte1 = 103;
  13480. byte2 = -1;
  13481. byte3 = -1;
  13482. }
  13483. byte byte4 = 0;
  13484. byte byte5 = 104;
  13485. byte byte6 = 1;
  13486. if (j21 < 0) {
  13487. byte4 = 103;
  13488. byte5 = -1;
  13489. byte6 = -1;
  13490. }
  13491. for (int k33 = byte1; k33 != byte2; k33 += byte3) {
  13492. for (int l33 = byte4; l33 != byte5; l33 += byte6) {
  13493. int i34 = k33 + i17;
  13494. int j34 = l33 + j21;
  13495. for (int k34 = 0; k34 < 4; k34++)
  13496. if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  13497. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  13498. else
  13499. groundArray[k34][k33][l33] = null;
  13500. }
  13501. }
  13502. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  13503. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  13504. .reverseGetNext()) {
  13505. class30_sub1_1.anInt1297 -= i17;
  13506. class30_sub1_1.anInt1298 -= j21;
  13507. if (class30_sub1_1.anInt1297 < 0
  13508. || class30_sub1_1.anInt1298 < 0
  13509. || class30_sub1_1.anInt1297 >= 104
  13510. || class30_sub1_1.anInt1298 >= 104)
  13511. class30_sub1_1.unlink();
  13512. }
  13513. if (destX != 0) {
  13514. destX -= i17;
  13515. destY -= j21;
  13516. }
  13517. aBoolean1160 = false;
  13518. pktType = -1;
  13519. return true;
  13520.  
  13521. case 208:
  13522. int i3 = inStream.method437();
  13523. if (i3 >= 0)
  13524. method60(i3);
  13525. anInt1018 = i3;
  13526. pktType = -1;
  13527. return true;
  13528.  
  13529. case 99:
  13530. anInt1021 = inStream.readUnsignedByte();
  13531. pktType = -1;
  13532. return true;
  13533.  
  13534. case 75:
  13535. int j3 = inStream.method436();
  13536. int j11 = inStream.method436();
  13537. RSInterface.interfaceCache[j11].anInt233 = 2;
  13538. RSInterface.interfaceCache[j11].mediaID = j3;
  13539. pktType = -1;
  13540. return true;
  13541.  
  13542. case 114:
  13543. anInt1104 = inStream.method434() * 30;
  13544. pktType = -1;
  13545. return true;
  13546.  
  13547. case 60:
  13548. anInt1269 = inStream.readUnsignedByte();
  13549. anInt1268 = inStream.method427();
  13550. while (inStream.currentOffset < pktSize) {
  13551. int k3 = inStream.readUnsignedByte();
  13552. method137(inStream, k3);
  13553. }
  13554. pktType = -1;
  13555. return true;
  13556.  
  13557. case 35:
  13558. int l3 = inStream.readUnsignedByte();
  13559. int k11 = inStream.readUnsignedByte();
  13560. int j17 = inStream.readUnsignedByte();
  13561. int k21 = inStream.readUnsignedByte();
  13562. aBooleanArray876[l3] = true;
  13563. anIntArray873[l3] = k11;
  13564. anIntArray1203[l3] = j17;
  13565. anIntArray928[l3] = k21;
  13566. anIntArray1030[l3] = 0;
  13567. pktType = -1;
  13568. return true;
  13569.  
  13570. case 174:
  13571. int i4 = inStream.readUnsignedWord();
  13572. int l11 = inStream.readUnsignedByte();
  13573. int k17 = inStream.readUnsignedWord();
  13574. if(aBoolean848 && !lowMem && anInt1062 < 50) {
  13575. anIntArray1207[anInt1062] = i4;
  13576. anIntArray1241[anInt1062] = l11;
  13577. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  13578. anInt1062++;
  13579. }
  13580. pktType = -1;
  13581. return true;
  13582.  
  13583. case 104:
  13584. int j4 = inStream.method427();
  13585. int i12 = inStream.method426();
  13586. String s6 = inStream.readString();
  13587. if (j4 >= 1 && j4 <= 5) {
  13588. if (s6.equalsIgnoreCase("null"))
  13589. s6 = null;
  13590. atPlayerActions[j4 - 1] = s6;
  13591. atPlayerArray[j4 - 1] = i12 == 0;
  13592. }
  13593. pktType = -1;
  13594. return true;
  13595.  
  13596. case 78:
  13597. destX = 0;
  13598. pktType = -1;
  13599. return true;
  13600.  
  13601. case 253:
  13602. String s = inStream.readString();
  13603. if (s.startsWith("Alert##")) {
  13604. String[] args = s.split("##");
  13605. if (args.length == 3) {
  13606. alertHandler.alert = new Alert("Notification", args[1],
  13607. args[2]);
  13608. } else if (args.length == 4) {
  13609. alertHandler.alert = new Alert(args[1], args[2],
  13610. args[3]);
  13611. }
  13612. pktType = -1;
  13613. return true;
  13614. }
  13615. if (s.endsWith(":tradereq:")) {
  13616. String s3 = s.substring(0, s.indexOf(":"));
  13617. long l17 = TextClass.longForName(s3);
  13618. boolean flag2 = false;
  13619. for (int j27 = 0; j27 < ignoreCount; j27++) {
  13620. if (ignoreListAsLongs[j27] != l17)
  13621. continue;
  13622. flag2 = true;
  13623.  
  13624. }
  13625. if (!flag2 && anInt1251 == 0)
  13626. pushMessage("wishes to trade with you.", 4, s3);
  13627. } else if (s.endsWith(":clan:")) {
  13628. String s4 = s.substring(0, s.indexOf(":"));
  13629. TextClass.longForName(s4);
  13630. pushMessage("Clan: ", 8, s4);
  13631. } else if (s.endsWith("#url#")) {
  13632. String link = s.substring(0, s.indexOf("#"));
  13633. pushMessage("Join us at: ", 9, link);
  13634. } else if (s.endsWith(":duelreq:")) {
  13635. String s4 = s.substring(0, s.indexOf(":"));
  13636. long l18 = TextClass.longForName(s4);
  13637. boolean flag3 = false;
  13638. for (int k27 = 0; k27 < ignoreCount; k27++) {
  13639. if (ignoreListAsLongs[k27] != l18)
  13640. continue;
  13641. flag3 = true;
  13642.  
  13643. }
  13644. if (!flag3 && anInt1251 == 0)
  13645. pushMessage("wishes to duel with you.", 8, s4);
  13646. } else if (s.endsWith(":resetautocast:")) {
  13647. Autocast = false;
  13648. autocastId = 0;
  13649. magicAuto.drawSprite(1000, 1000);
  13650. } else if (s.endsWith(":chalreq:")) {
  13651. String s5 = s.substring(0, s.indexOf(":"));
  13652. long l19 = TextClass.longForName(s5);
  13653. boolean flag4 = false;
  13654. for (int l27 = 0; l27 < ignoreCount; l27++) {
  13655. if (ignoreListAsLongs[l27] != l19)
  13656. continue;
  13657. flag4 = true;
  13658.  
  13659. }
  13660. if (!flag4 && anInt1251 == 0) {
  13661. String s8 = s.substring(s.indexOf(":") + 1,
  13662. s.length() - 9);
  13663. pushMessage(s8, 8, s5);
  13664. }
  13665. } else {
  13666. pushMessage(s, 0, "");
  13667. }
  13668. pktType = -1;
  13669. return true;
  13670.  
  13671. case 1:
  13672. for (int k4 = 0; k4 < playerArray.length; k4++)
  13673. if (playerArray[k4] != null)
  13674. playerArray[k4].anim = -1;
  13675. for (int j12 = 0; j12 < npcArray.length; j12++)
  13676. if (npcArray[j12] != null)
  13677. npcArray[j12].anim = -1;
  13678. pktType = -1;
  13679. return true;
  13680.  
  13681. case 50:
  13682. long l4 = inStream.readQWord();
  13683. int i18 = inStream.readUnsignedByte();
  13684. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  13685. for(int k24 = 0; k24 < friendsCount; k24++) {
  13686. if(l4 != friendsListAsLongs[k24])
  13687. continue;
  13688. if(friendsNodeIDs[k24] != i18) {
  13689. friendsNodeIDs[k24] = i18;
  13690. needDrawTabArea = true;
  13691. if(i18 >= 2) {
  13692. pushMessage(s7 + " has logged in.", 5, "");
  13693. }
  13694. if(i18 <= 1) {
  13695. pushMessage(s7 + " has logged out.", 5, "");
  13696. }
  13697. }
  13698. s7 = null;
  13699.  
  13700. }
  13701. if(s7 != null && friendsCount < 200) {
  13702. friendsListAsLongs[friendsCount] = l4;
  13703. friendsList[friendsCount] = s7;
  13704. friendsNodeIDs[friendsCount] = i18;
  13705. friendsCount++;
  13706. needDrawTabArea = true;
  13707. }
  13708. for(boolean flag6 = false; !flag6;) {
  13709. flag6 = true;
  13710. for(int k29 = 0; k29 < friendsCount - 1; k29++)
  13711. if(friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  13712. int j31 = friendsNodeIDs[k29];
  13713. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  13714. friendsNodeIDs[k29 + 1] = j31;
  13715. String s10 = friendsList[k29];
  13716. friendsList[k29] = friendsList[k29 + 1];
  13717. friendsList[k29 + 1] = s10;
  13718. long l32 = friendsListAsLongs[k29];
  13719. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  13720. friendsListAsLongs[k29 + 1] = l32;
  13721. needDrawTabArea = true;
  13722. flag6 = false;
  13723. }
  13724. }
  13725. pktType = -1;
  13726. return true;
  13727.  
  13728. case 110:
  13729. if (tabID == 12)
  13730. needDrawTabArea = true;
  13731. energy = inStream.readUnsignedByte();
  13732. pktType = -1;
  13733. return true;
  13734.  
  13735. case 254:
  13736. anInt855 = inStream.readUnsignedByte();
  13737. if (anInt855 == 1)
  13738. anInt1222 = inStream.readUnsignedWord();
  13739. if (anInt855 >= 2 && anInt855 <= 6) {
  13740. if (anInt855 == 2) {
  13741. anInt937 = 64;
  13742. anInt938 = 64;
  13743. }
  13744. if (anInt855 == 3) {
  13745. anInt937 = 0;
  13746. anInt938 = 64;
  13747. }
  13748. if (anInt855 == 4) {
  13749. anInt937 = 128;
  13750. anInt938 = 64;
  13751. }
  13752. if (anInt855 == 5) {
  13753. anInt937 = 64;
  13754. anInt938 = 0;
  13755. }
  13756. if (anInt855 == 6) {
  13757. anInt937 = 64;
  13758. anInt938 = 128;
  13759. }
  13760. anInt855 = 2;
  13761. anInt934 = inStream.readUnsignedWord();
  13762. anInt935 = inStream.readUnsignedWord();
  13763. anInt936 = inStream.readUnsignedByte();
  13764. }
  13765. if (anInt855 == 10)
  13766. anInt933 = inStream.readUnsignedWord();
  13767. pktType = -1;
  13768. return true;
  13769.  
  13770. case 248:
  13771. int i5 = inStream.method435();
  13772. int k12 = inStream.readUnsignedWord();
  13773. if (backDialogID != -1) {
  13774. backDialogID = -1;
  13775. inputTaken = true;
  13776. }
  13777. if (inputDialogState != 0) {
  13778. inputDialogState = 0;
  13779. inputTaken = true;
  13780. }
  13781. openInterfaceID = i5;
  13782. invOverlayInterfaceID = k12;
  13783. needDrawTabArea = true;
  13784. tabAreaAltered = true;
  13785. aBoolean1149 = false;
  13786. pktType = -1;
  13787. return true;
  13788.  
  13789. case 79:
  13790. int j5 = inStream.method434();
  13791. int l12 = inStream.method435();
  13792. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  13793. if (class9_3 != null && class9_3.type == 0) {
  13794. if (l12 < 0)
  13795. l12 = 0;
  13796. if (l12 > class9_3.scrollMax - class9_3.height)
  13797. l12 = class9_3.scrollMax - class9_3.height;
  13798. class9_3.scrollPosition = l12;
  13799. }
  13800. pktType = -1;
  13801. return true;
  13802.  
  13803. case 68:
  13804. for (int k5 = 0; k5 < variousSettings.length; k5++)
  13805. if (variousSettings[k5] != anIntArray1045[k5]) {
  13806. variousSettings[k5] = anIntArray1045[k5];
  13807. method33(k5);
  13808. needDrawTabArea = true;
  13809. }
  13810. pktType = -1;
  13811. return true;
  13812.  
  13813. case 196:
  13814. long l5 = inStream.readQWord();
  13815. int j18 = inStream.readDWord();
  13816. int l21 = inStream.readUnsignedByte();
  13817. boolean flag5 = false;
  13818. if(l21 <= 1) {
  13819. for(int l29 = 0; l29 < ignoreCount; l29++) {
  13820. if(ignoreListAsLongs[l29] != l5)
  13821. continue;
  13822. flag5 = true;
  13823.  
  13824. }
  13825. }
  13826. if(!flag5 && anInt1251 == 0)
  13827. try {
  13828. String s9 = TextInput.method525(pktSize - 13, inStream);
  13829. //if(l21 != 3)
  13830. //s9 = Censor.doCensor(s9);
  13831. if(l21 == 2 || l21 == 3)
  13832. pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13833. else
  13834. if(l21 == 1)
  13835. pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  13836. else
  13837. pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  13838. } catch(Exception exception1) {
  13839. signlink.reporterror("cde1");
  13840. }
  13841. pktType = -1;
  13842. return true;
  13843.  
  13844. case 85:
  13845. anInt1269 = inStream.method427();
  13846. anInt1268 = inStream.method427();
  13847. pktType = -1;
  13848. return true;
  13849.  
  13850. case 24:
  13851. anInt1054 = inStream.method428();
  13852. if (anInt1054 == tabID) {
  13853. if (anInt1054 == 3)
  13854. tabID = 1;
  13855. else
  13856. tabID = 3;
  13857. needDrawTabArea = true;
  13858. }
  13859. pktType = -1;
  13860. return true;
  13861.  
  13862. case 246:
  13863. int i6 = inStream.method434();
  13864. int i13 = inStream.readUnsignedWord();
  13865. int k18 = inStream.readUnsignedWord();
  13866. if (k18 == 65535) {
  13867. RSInterface.interfaceCache[i6].anInt233 = 0;
  13868. pktType = -1;
  13869. return true;
  13870. } else {
  13871. ItemDef itemDef = ItemDef.forID(k18);
  13872. RSInterface.interfaceCache[i6].anInt233 = 4;
  13873. RSInterface.interfaceCache[i6].mediaID = k18;
  13874. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotation1;
  13875. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotation2;
  13876. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100)
  13877. / i13;
  13878. pktType = -1;
  13879. return true;
  13880. }
  13881.  
  13882. case 171:
  13883. boolean flag1 = inStream.readUnsignedByte() == 1;
  13884. int j13 = inStream.readUnsignedWord();
  13885. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  13886. pktType = -1;
  13887. return true;
  13888.  
  13889. case 142:
  13890. int j6 = inStream.method434();
  13891. method60(j6);
  13892. if (backDialogID != -1) {
  13893. backDialogID = -1;
  13894. inputTaken = true;
  13895. }
  13896. if (inputDialogState != 0) {
  13897. inputDialogState = 0;
  13898. inputTaken = true;
  13899. }
  13900. invOverlayInterfaceID = j6;
  13901. needDrawTabArea = true;
  13902. tabAreaAltered = true;
  13903. openInterfaceID = -1;
  13904. aBoolean1149 = false;
  13905. pktType = -1;
  13906. return true;
  13907.  
  13908. case 126:
  13909. try {
  13910. String text = inStream.readString();
  13911. int frame = inStream.method435();
  13912. //System.out.println("sendstring="+text+", frame="+frame);
  13913. if (text.startsWith("www.")) {
  13914. launchURL(text);
  13915. pktType = -1;
  13916. return true;
  13917. }
  13918. RSInterface.interfaceCache[frame].message = text;
  13919. if (RSInterface.interfaceCache[frame].parentID == tabInterfaceIDs[tabID]
  13920. || frame >= 7562 && frame <= 7586)
  13921. needDrawTabArea = true;
  13922. pktType = -1;
  13923. } catch (Exception e) {
  13924. }
  13925. pktType = -1;
  13926. return true;
  13927.  
  13928. case 206:
  13929. publicChatMode = inStream.readUnsignedByte();
  13930. privateChatMode = inStream.readUnsignedByte();
  13931. tradeMode = inStream.readUnsignedByte();
  13932. aBoolean1233 = true;
  13933. inputTaken = true;
  13934. pktType = -1;
  13935. return true;
  13936.  
  13937. case 240:
  13938. if (tabID == 12)
  13939. needDrawTabArea = true;
  13940. weight = inStream.readSignedWord();
  13941. pktType = -1;
  13942. return true;
  13943.  
  13944. case 8:
  13945. int k6 = inStream.method436();
  13946. int l13 = inStream.readUnsignedWord();
  13947. RSInterface.interfaceCache[k6].anInt233 = 1;
  13948. RSInterface.interfaceCache[k6].mediaID = l13;
  13949. pktType = -1;
  13950. return true;
  13951.  
  13952. case 122:
  13953. int l6 = inStream.method436();
  13954. int i14 = inStream.method436();
  13955. int i19 = i14 >> 10 & 0x1f;
  13956. int i22 = i14 >> 5 & 0x1f;
  13957. int l24 = i14 & 0x1f;
  13958. RSInterface.interfaceCache[l6].textColor = (i19 << 19)
  13959. + (i22 << 11) + (l24 << 3);
  13960. pktType = -1;
  13961. return true;
  13962.  
  13963. case 53:
  13964. needDrawTabArea = true;
  13965. int i7 = inStream.readUnsignedWord();
  13966. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  13967. int j19 = inStream.readUnsignedWord();
  13968. for (int j22 = 0; j22 < j19; j22++) {
  13969. int i25 = inStream.readUnsignedByte();
  13970. if (i25 == 255)
  13971. i25 = inStream.method440();
  13972. class9_1.inv[j22] = inStream.method436();
  13973. class9_1.invStackSizes[j22] = i25;
  13974. }
  13975. for (int j25 = j19; j25 < class9_1.inv.length; j25++) {
  13976. class9_1.inv[j25] = 0;
  13977. class9_1.invStackSizes[j25] = 0;
  13978. }
  13979. pktType = -1;
  13980. return true;
  13981.  
  13982. case 230:
  13983. int j7 = inStream.method435();
  13984. int j14 = inStream.readUnsignedWord();
  13985. int k19 = inStream.readUnsignedWord();
  13986. int k22 = inStream.method436();
  13987. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  13988. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  13989. RSInterface.interfaceCache[j14].modelZoom = j7;
  13990. pktType = -1;
  13991. return true;
  13992.  
  13993. case 221:
  13994. anInt900 = inStream.readUnsignedByte();
  13995. needDrawTabArea = true;
  13996. pktType = -1;
  13997. return true;
  13998.  
  13999. case 177:
  14000. aBoolean1160 = true;
  14001. anInt995 = inStream.readUnsignedByte();
  14002. anInt996 = inStream.readUnsignedByte();
  14003. anInt997 = inStream.readUnsignedWord();
  14004. anInt998 = inStream.readUnsignedByte();
  14005. anInt999 = inStream.readUnsignedByte();
  14006. if (anInt999 >= 100) {
  14007. int k7 = anInt995 * 128 + 64;
  14008. int k14 = anInt996 * 128 + 64;
  14009. int i20 = method42(plane, k14, k7) - anInt997;
  14010. int l22 = k7 - xCameraPos;
  14011. int k25 = i20 - zCameraPos;
  14012. int j28 = k14 - yCameraPos;
  14013. int i30 = (int) Math.sqrt(l22 * l22 + j28 * j28);
  14014. yCameraCurve = (int) (Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  14015. xCameraCurve = (int) (Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  14016. if (yCameraCurve < 128)
  14017. yCameraCurve = 128;
  14018. if (yCameraCurve > 383)
  14019. yCameraCurve = 383;
  14020. }
  14021. pktType = -1;
  14022. return true;
  14023.  
  14024. case 249:
  14025. anInt1046 = inStream.method426();
  14026. unknownInt10 = inStream.method436();
  14027. pktType = -1;
  14028. return true;
  14029.  
  14030. case 65:
  14031. updateNPCs(inStream, pktSize);
  14032. pktType = -1;
  14033. return true;
  14034.  
  14035. case 27:
  14036. messagePromptRaised = false;
  14037. inputDialogState = 1;
  14038. amountOrNameInput = "";
  14039. inputTaken = true;
  14040. pktType = -1;
  14041. return true;
  14042.  
  14043. case 187:
  14044. messagePromptRaised = false;
  14045. inputDialogState = 2;
  14046. amountOrNameInput = "";
  14047. inputTaken = true;
  14048. pktType = -1;
  14049. return true;
  14050.  
  14051. case 97:
  14052. int l7 = inStream.readUnsignedWord();
  14053. method60(l7);
  14054. if (invOverlayInterfaceID != -1) {
  14055. invOverlayInterfaceID = -1;
  14056. needDrawTabArea = true;
  14057. tabAreaAltered = true;
  14058. }
  14059. if (backDialogID != -1) {
  14060. backDialogID = -1;
  14061. inputTaken = true;
  14062. }
  14063. if (inputDialogState != 0) {
  14064. inputDialogState = 0;
  14065. inputTaken = true;
  14066. }
  14067. openInterfaceID = l7;
  14068. aBoolean1149 = false;
  14069. pktType = -1;
  14070. return true;
  14071.  
  14072. case 218:
  14073. int i8 = inStream.method438();
  14074. dialogID = i8;
  14075. inputTaken = true;
  14076. pktType = -1;
  14077. return true;
  14078.  
  14079. case 87:
  14080. int j8 = inStream.method434();
  14081. int l14 = inStream.method439();
  14082. anIntArray1045[j8] = l14;
  14083. if (variousSettings[j8] != l14) {
  14084. variousSettings[j8] = l14;
  14085. method33(j8);
  14086. needDrawTabArea = true;
  14087. if (dialogID != -1)
  14088. inputTaken = true;
  14089. }
  14090. pktType = -1;
  14091. return true;
  14092.  
  14093. case 36:
  14094. int k8 = inStream.method434();
  14095. byte byte0 = inStream.readSignedByte();
  14096. anIntArray1045[k8] = byte0;
  14097. if (variousSettings[k8] != byte0) {
  14098. variousSettings[k8] = byte0;
  14099. method33(k8);
  14100. needDrawTabArea = true;
  14101. if (dialogID != -1)
  14102. inputTaken = true;
  14103. }
  14104. pktType = -1;
  14105. return true;
  14106.  
  14107. case 61:
  14108. anInt1055 = inStream.readUnsignedByte();
  14109. pktType = -1;
  14110. return true;
  14111.  
  14112. case 200:
  14113. int l8 = inStream.readUnsignedWord();
  14114. int i15 = inStream.readSignedWord();
  14115. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  14116. class9_4.anInt257 = i15;
  14117. class9_4.modelZoom = 2000; // anInt269
  14118. if (i15 == -1) {
  14119. class9_4.anInt246 = 0;
  14120. class9_4.anInt208 = 0;
  14121. }
  14122. pktType = -1;
  14123. return true;
  14124.  
  14125. case 219:
  14126. if (invOverlayInterfaceID != -1) {
  14127. invOverlayInterfaceID = -1;
  14128. needDrawTabArea = true;
  14129. tabAreaAltered = true;
  14130. }
  14131. if (backDialogID != -1) {
  14132. backDialogID = -1;
  14133. inputTaken = true;
  14134. }
  14135. if (inputDialogState != 0) {
  14136. inputDialogState = 0;
  14137. inputTaken = true;
  14138. }
  14139. openInterfaceID = -1;
  14140. aBoolean1149 = false;
  14141. pktType = -1;
  14142. return true;
  14143.  
  14144. case 34:
  14145. needDrawTabArea = true;
  14146. int i9 = inStream.readUnsignedWord();
  14147. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  14148. while (inStream.currentOffset < pktSize) {
  14149. int j20 = inStream.method422();
  14150. int i23 = inStream.readUnsignedWord();
  14151. int l25 = inStream.readUnsignedByte();
  14152. if (l25 == 255)
  14153. l25 = inStream.readDWord();
  14154. if (j20 >= 0 && j20 < class9_2.inv.length) {
  14155. class9_2.inv[j20] = i23;
  14156. class9_2.invStackSizes[j20] = l25;
  14157. }
  14158. }
  14159. pktType = -1;
  14160. return true;
  14161.  
  14162. case 4:
  14163. case 44:
  14164. case 84:
  14165. case 101:
  14166. case 105:
  14167. case 117:
  14168. case 147:
  14169. case 151:
  14170. case 156:
  14171. case 160:
  14172. case 215:
  14173. method137(inStream, pktType);
  14174. pktType = -1;
  14175. return true;
  14176.  
  14177. case 106:
  14178. tabID = inStream.method427();
  14179. needDrawTabArea = true;
  14180. tabAreaAltered = true;
  14181. pktType = -1;
  14182. return true;
  14183.  
  14184. case 164:
  14185. int j9 = inStream.method434();
  14186. method60(j9);
  14187. if (invOverlayInterfaceID != -1) {
  14188. invOverlayInterfaceID = -1;
  14189. needDrawTabArea = true;
  14190. tabAreaAltered = true;
  14191. }
  14192. backDialogID = j9;
  14193. inputTaken = true;
  14194. openInterfaceID = -1;
  14195. aBoolean1149 = false;
  14196. pktType = -1;
  14197. return true;
  14198.  
  14199. }
  14200. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - "
  14201. + anInt842 + "," + anInt843);
  14202. // resetLogout();
  14203. } catch (IOException _ex) {
  14204. dropClient();
  14205. } catch (Exception exception) {
  14206. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843
  14207. + " - " + pktSize + "," + (baseX + myPlayer.smallX[0])
  14208. + "," + (baseY + myPlayer.smallY[0]) + " - ";
  14209. for (int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  14210. s2 = s2 + inStream.buffer[j15] + ",";
  14211. signlink.reporterror(s2);
  14212. // resetLogout();
  14213. }
  14214. pktType = -1;
  14215. return true;
  14216. }
  14217.  
  14218. private void method146() {
  14219. anInt1265++;
  14220. method47(true);
  14221. method26(true);
  14222. method47(false);
  14223. method26(false);
  14224. method55();
  14225. method104();
  14226. if (!aBoolean1160) {
  14227. int i = anInt1184;
  14228. if (anInt984 / 256 > i)
  14229. i = anInt984 / 256;
  14230. if (aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  14231. i = anIntArray1203[4] + 128;
  14232. int k = minimapInt1 + anInt896 & 0x7ff;
  14233. setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y,
  14234. myPlayer.x) - 50, k, anInt1015);
  14235. }
  14236. int j;
  14237. if (!aBoolean1160)
  14238. j = method120();
  14239. else
  14240. j = method121();
  14241. int l = xCameraPos;
  14242. int i1 = zCameraPos;
  14243. int j1 = yCameraPos;
  14244. int k1 = yCameraCurve;
  14245. int l1 = xCameraCurve;
  14246. for (int i2 = 0; i2 < 5; i2++)
  14247. if (aBooleanArray876[i2]) {
  14248. int j2 = (int) ((Math.random()
  14249. * (double) (anIntArray873[i2] * 2 + 1) - (double) anIntArray873[i2]) + Math
  14250. .sin((double) anIntArray1030[i2]
  14251. * ((double) anIntArray928[i2] / 100D))
  14252. * (double) anIntArray1203[i2]);
  14253. if (i2 == 0)
  14254. xCameraPos += j2;
  14255. if (i2 == 1)
  14256. zCameraPos += j2;
  14257. if (i2 == 2)
  14258. yCameraPos += j2;
  14259. if (i2 == 3)
  14260. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  14261. if (i2 == 4) {
  14262. yCameraCurve += j2;
  14263. if (yCameraCurve < 128)
  14264. yCameraCurve = 128;
  14265. if (yCameraCurve > 383)
  14266. yCameraCurve = 383;
  14267. }
  14268. }
  14269. int k2 = Texture.anInt1481;
  14270. Model.aBoolean1684 = true;
  14271. Model.anInt1687 = 0;
  14272. Model.anInt1685 = super.mouseX - 4;
  14273. Model.anInt1686 = super.mouseY - 4;
  14274. DrawingArea.setAllPixelsToZero();
  14275. worldController.method313(xCameraPos, yCameraPos, xCameraCurve,
  14276. zCameraPos, j, yCameraCurve);
  14277. worldController.clearObj5Cache();
  14278. updateEntities();
  14279. drawHeadIcon();
  14280. method37(k2);
  14281. draw3dScreen();
  14282. int x = isFullScreen ? 20 + extraWidth : 0;
  14283. int y = isFullScreen ? -32 : 0;
  14284. if (drawFlag) {
  14285. if (xpToDraw != 0) {
  14286. if (flagPos < 125) {
  14287. if (flagPos < 100) {
  14288. flagPos += 2;
  14289. } else {
  14290. flagPos += 1;
  14291. }
  14292. xpFlag.drawSprite(423 + x, flagPos + y);
  14293. smallText.method382(0xCC6600, 470 + x,
  14294. "" + xpToDraw + "xp", flagPos + 20 + y, true);
  14295. } else {
  14296. }
  14297. if (flagPos >= 125) {
  14298. drawFlag = false;
  14299. flagPos = 72;
  14300. xpToDraw = 0;
  14301. }
  14302. }
  14303. }
  14304. if (drawXpBar) {
  14305. String text = "" + testXp;
  14306. int txtWidth = smallText.getTextWidth(text) + 10;
  14307. int drawX = 472; // 507
  14308. sprite1.drawSprite(419 + x, 51 + y);
  14309. smallText.method382(0xFFFFFD, 430 + x, "XP:", 64 + y, true);
  14310. if (testXp <= 999999999) {
  14311. smallText.method382(0xFFFFFD, drawX + x, text, 64 + y, true);
  14312. } else if (testXp >= 999999999) {
  14313. smallText.method382(0xFFFFFD, drawX + x, "ALOT!", 64 + y, true);
  14314. }
  14315. }
  14316. if (isFullScreen) {
  14317. drawMinimap();
  14318. drawTabArea();
  14319. drawChatArea();
  14320. aRSImageProducer_1165.drawGraphics(4, bufferGraphics, 4);
  14321. super.graphics.drawImage(buffer, 0, 0, getGameComponent());
  14322. } else
  14323. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  14324. xCameraPos = l;
  14325. zCameraPos = i1;
  14326. yCameraPos = j1;
  14327. yCameraCurve = k1;
  14328. xCameraCurve = l1;
  14329. }
  14330.  
  14331. private int xpAddedPos;
  14332.  
  14333. public void clearTopInterfaces() {
  14334. stream.createFrame(130);
  14335. if (invOverlayInterfaceID != -1) {
  14336. invOverlayInterfaceID = -1;
  14337. needDrawTabArea = true;
  14338. aBoolean1149 = false;
  14339. tabAreaAltered = true;
  14340. }
  14341. if (backDialogID != -1) {
  14342. backDialogID = -1;
  14343. inputTaken = true;
  14344. aBoolean1149 = false;
  14345. }
  14346. openInterfaceID = -1;
  14347. fullscreenInterfaceID = -1;
  14348. }
  14349.  
  14350. public Sprite[] chatButton, chatToggle, loginTab;
  14351.  
  14352. public client() {
  14353. alertHandler = new AlertHandler(this);
  14354. fullscreenInterfaceID = -1;
  14355. chatRights = new int[500];
  14356. chatTypeView = 0;
  14357. mapArea = new Sprite[3];
  14358. mapArea = new Sprite[3];
  14359. backgroundFix = new Sprite("background");;
  14360. fullScreenSprites = new Sprite[3];
  14361. tabHPos = -1;
  14362. lastPercent = 0.0F;
  14363. drawLongTabs = false;
  14364. isFullScreen = false;
  14365. hasBeenBlanked = false;
  14366. clanTitles = new String[500];//this
  14367. clanChatMode = 0;
  14368. cButtonHPos = -1;
  14369. displayChat = true;
  14370. cButtonHCPos = -1;
  14371. cButtonCPos = 0;
  14372. anIntArrayArray825 = new int[104][104];
  14373. friendsNodeIDs = new int[200];
  14374. groundArray = new NodeList[4][104][104];
  14375. aBoolean831 = false;
  14376. aStream_834 = new Stream(new byte[30000]);
  14377. npcArray = new NPC[16384];
  14378. npcIndices = new int[16384];
  14379. anIntArray840 = new int[1000];
  14380. aStream_847 = Stream.create();
  14381. aBoolean848 = true;
  14382. openInterfaceID = -1;
  14383. currentExp = new int[Skills.skillsCount];
  14384. aBoolean872 = false;
  14385. anIntArray873 = new int[5];
  14386. // (new Class30_Sub1_Sub1()).start();
  14387. anInt874 = -1;
  14388. aBooleanArray876 = new boolean[5];
  14389. drawFlames = false;
  14390. reportAbuseInput = "";
  14391. unknownInt10 = -1;
  14392. menuOpen = false;
  14393. inputString = "";
  14394. maxPlayers = 2048;
  14395. myPlayerIndex = 2047;
  14396. playerArray = new Player[maxPlayers];
  14397. playerIndices = new int[maxPlayers];
  14398. anIntArray894 = new int[maxPlayers];
  14399. aStreamArray895s = new Stream[maxPlayers];
  14400. anInt897 = 1;
  14401. anIntArrayArray901 = new int[104][104];
  14402. anInt902 = 0x766654;
  14403. aByteArray912 = new byte[16384];
  14404. currentStats = new int[Skills.skillsCount];
  14405. ignoreListAsLongs = new long[100];
  14406. loadingError = false;
  14407. anInt927 = 0x332d25;
  14408. anIntArray928 = new int[5];
  14409. anIntArrayArray929 = new int[104][104];
  14410. chatTypes = new int[500];
  14411. chatNames = new String[500];
  14412. chatMessages = new String[500];
  14413. chatButtons = new Sprite[4];
  14414. sideIcons = new Sprite[15];
  14415. chatToggle = new Sprite[2];
  14416. newSideIcons = new Sprite[15];
  14417. redStones = new Sprite[5];
  14418. aBoolean954 = true;
  14419. friendsListAsLongs = new long[200];
  14420. currentSong = -1;
  14421. drawingFlames = false;
  14422. spriteDrawX = -1;
  14423. spriteDrawY = -1;
  14424. anIntArray968 = new int[33];
  14425. anIntArray969 = new int[256];
  14426. decompressors = new Decompressor[5];
  14427. variousSettings = new int[2000];
  14428. aBoolean972 = false;
  14429. anInt975 = 50;
  14430. anIntArray976 = new int[anInt975];
  14431. anIntArray977 = new int[anInt975];
  14432. anIntArray978 = new int[anInt975];
  14433. anIntArray979 = new int[anInt975];
  14434. anIntArray980 = new int[anInt975];
  14435. anIntArray981 = new int[anInt975];
  14436. anIntArray982 = new int[anInt975];
  14437. aStringArray983 = new String[anInt975];
  14438. anInt985 = -1;
  14439. hitMarks = new Sprite[20];
  14440. anIntArray990 = new int[5];
  14441. aBoolean994 = false;
  14442. anInt1002 = 0x23201b;
  14443. amountOrNameInput = "";
  14444. aClass19_1013 = new NodeList();
  14445. aBoolean1017 = false;
  14446. anInt1018 = -1;
  14447. anIntArray1030 = new int[5];
  14448. aBoolean1031 = false;
  14449. mapFunctions = new Sprite[100];
  14450. dialogID = -1;
  14451. maxStats = new int[Skills.skillsCount];
  14452. anIntArray1045 = new int[2000];
  14453. aBoolean1047 = true;
  14454. anIntArray1052 = new int[151];
  14455. anInt1054 = -1;
  14456. aClass19_1056 = new NodeList();
  14457. anIntArray1057 = new int[33];
  14458. aClass9_1059 = new RSInterface();
  14459. mapScenes = new Background[100];
  14460. barFillColor = 0x4d4233;
  14461. anIntArray1065 = new int[7];
  14462. anIntArray1072 = new int[1000];
  14463. anIntArray1073 = new int[1000];
  14464. aBoolean1080 = false;
  14465. friendsList = new String[200];
  14466. inStream = Stream.create();
  14467. expectedCRCs = new int[9];
  14468. menuActionCmd2 = new int[500];
  14469. menuActionCmd3 = new int[500];
  14470. menuActionCmd4 = new int[500];
  14471. menuActionID = new int[500];
  14472. menuActionCmd1 = new int[500];
  14473. headIcons = new Sprite[20];
  14474. skullIcons = new Sprite[20];
  14475. headIconsHint = new Sprite[20];
  14476. tabAreaAltered = false;
  14477. aString1121 = "";
  14478. atPlayerActions = new String[5];
  14479. atPlayerArray = new boolean[5];
  14480. anIntArrayArrayArray1129 = new int[4][13][13];
  14481. anInt1132 = 2;
  14482. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  14483. aBoolean1141 = false;
  14484. aBoolean1149 = false;
  14485. crosses = new Sprite[8];
  14486. musicEnabled = true;
  14487. needDrawTabArea = false;
  14488. loggedIn = false;
  14489. canMute = false;
  14490. aBoolean1159 = false;
  14491. aBoolean1160 = false;
  14492. anInt1171 = 1;
  14493. myUsername = "";
  14494. myPassword = "";
  14495. genericLoadingError = false;
  14496. reportAbuseInterfaceID = -1;
  14497. aClass19_1179 = new NodeList();
  14498. anInt1184 = 128;
  14499. invOverlayInterfaceID = -1;
  14500. stream = Stream.create();
  14501. menuActionName = new String[500];
  14502. anIntArray1203 = new int[5];
  14503. anIntArray1207 = new int[50];
  14504. anInt1210 = 2;
  14505. anInt1211 = 78;
  14506. promptInput = "";
  14507. modIcons = new Background[5];
  14508. tabID = 3;
  14509. inputTaken = false;
  14510. songChanging = true;
  14511. anIntArray1229 = new int[151];
  14512. aClass11Array1230 = new Class11[4];
  14513. aBoolean1233 = false;
  14514. anIntArray1240 = new int[100];
  14515. anIntArray1241 = new int[50];
  14516. aBoolean1242 = false;
  14517. anIntArray1250 = new int[50];
  14518. rsAlreadyLoaded = false;
  14519. welcomeScreenRaised = false;
  14520. messagePromptRaised = false;
  14521. loginMessage1 = "";
  14522. loginMessage2 = "";
  14523. backDialogID = -1;
  14524. anInt1279 = 2;
  14525. bigX = new int[4000];
  14526. bigY = new int[4000];
  14527. anInt1289 = -1;
  14528. }
  14529.  
  14530. public void addClanMember(String name) {
  14531. int index = findEmptyIndex();
  14532. sendFrame126(name, index + 18144);
  14533. clanList[index] = name;
  14534. }
  14535.  
  14536. public void removeClanMember(String name) {
  14537. for (int i = 0; i < 100; i++) {
  14538. if (clanList[i].equals(name)) {
  14539. sendFrame126("", i + 18144);
  14540. clanList[i] = "";
  14541. }
  14542. }
  14543. }
  14544.  
  14545. private int findEmptyIndex() {
  14546. for (int i = 0; i < 100; i++) {
  14547. if (clanList[i].equals(""))
  14548. return i;
  14549. }
  14550. return 0;
  14551. }
  14552.  
  14553. public int rights;
  14554. public String name;
  14555. public String message;
  14556. private final int[] chatRights;
  14557. public int chatTypeView;
  14558. public int clanChatMode;
  14559. public int duelMode;
  14560. /* Declare custom sprites */
  14561. private Sprite chatArea;
  14562. private Sprite loadingPleaseWait;
  14563. private Sprite reestablish;
  14564. private Sprite[] chatButtons;
  14565. private Sprite[] fullScreenSprites;
  14566. private Sprite tabArea;
  14567. private Sprite tabs554;
  14568. private Sprite long554;
  14569. // private Sprite mapArea;
  14570. /**/
  14571. private RSImageProducer leftFrame;
  14572. private RSImageProducer topFrame;
  14573. private RSImageProducer rightFrame;
  14574. private int ignoreCount;
  14575. private long aLong824;
  14576. private int[][] anIntArrayArray825;
  14577. private int[] friendsNodeIDs;
  14578. private NodeList[][][] groundArray;
  14579. private int[] anIntArray828;
  14580. private int[] anIntArray829;
  14581. private volatile boolean aBoolean831;
  14582. private Socket aSocket832;
  14583. private int loginScreenState;
  14584. private Stream aStream_834;
  14585. private NPC[] npcArray;
  14586. private int npcCount;
  14587. private int[] npcIndices;
  14588. private int anInt839;
  14589. private int[] anIntArray840;
  14590. private int anInt841;
  14591. private int anInt842;
  14592. private int anInt843;
  14593. private String aString844;
  14594. private int privateChatMode;
  14595. private Stream aStream_847;
  14596. private boolean aBoolean848;
  14597. private static int anInt849;
  14598. private int[] anIntArray850;
  14599. private int[] anIntArray851;
  14600. private int[] anIntArray852;
  14601. private int[] anIntArray853;
  14602. private static int anInt854;
  14603. private int anInt855;
  14604. public static int openInterfaceID;
  14605. private int xCameraPos;
  14606. private int zCameraPos;
  14607. private int yCameraPos;
  14608. private int yCameraCurve;
  14609. private int xCameraCurve;
  14610. private int myPrivilege;
  14611. private final int[] currentExp;
  14612. private Sprite[] redStones;
  14613. private Sprite mapFlag;
  14614. private Sprite mapMarker;
  14615. private boolean aBoolean872;
  14616. private final int[] anIntArray873;
  14617. private int anInt874;
  14618. private final boolean[] aBooleanArray876;
  14619. private int weight;
  14620. private MouseDetection mouseDetection;
  14621. private volatile boolean drawFlames;
  14622. private String reportAbuseInput;
  14623. private int unknownInt10;
  14624. private boolean menuOpen;
  14625. private int anInt886;
  14626. private String inputString;
  14627. private final int maxPlayers;
  14628. private final int myPlayerIndex;
  14629. private Player[] playerArray;
  14630. private int playerCount;
  14631. private int[] playerIndices;
  14632. private int anInt893;
  14633. private int[] anIntArray894;
  14634. private Stream[] aStreamArray895s;
  14635. private int anInt896;
  14636. private int anInt897;
  14637. private int friendsCount;
  14638. private int anInt900;
  14639. private int[][] anIntArrayArray901;
  14640. private final int anInt902;
  14641. private byte[] aByteArray912;
  14642. private int anInt913;
  14643. private int crossX;
  14644. private int crossY;
  14645. private int crossIndex;
  14646. private int crossType;
  14647. private int plane;
  14648. private final int[] currentStats;
  14649. private static int anInt924;
  14650. private final long[] ignoreListAsLongs;
  14651. private boolean loadingError;
  14652. private final int anInt927;
  14653. private final int[] anIntArray928;
  14654. private int[][] anIntArrayArray929;
  14655. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  14656. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  14657. private int anInt933;
  14658. private int anInt934;
  14659. private int anInt935;
  14660. private int anInt936;
  14661. private int anInt937;
  14662. private int anInt938;
  14663. private static int anInt940;
  14664. private final int[] chatTypes;
  14665. private final String[] chatNames;
  14666. private final String[] chatMessages;
  14667. private int anInt945;
  14668. private WorldController worldController;
  14669. private Sprite[] sideIcons;
  14670. private int menuScreenArea;
  14671. private int menuOffsetX;
  14672. private int menuOffsetY;
  14673. private int menuWidth;
  14674. private int menuHeight;
  14675. private long aLong953;
  14676. private boolean aBoolean954;
  14677. private long[] friendsListAsLongs;
  14678. private String[] clanList = new String[100];
  14679. private int currentSong;
  14680. private static int nodeID = 10;
  14681. static int portOff;
  14682. static boolean clientData;
  14683. private static boolean isMembers = true;
  14684. private static boolean lowMem;
  14685. private volatile boolean drawingFlames;
  14686. private int spriteDrawX;
  14687. private int spriteDrawY;
  14688. private final int[] anIntArray965 = { 0xffff00, 0xff0000, 65280, 65535,
  14689. 0xff00ff, 0xffffff };
  14690. private Background aBackground_966;
  14691. private Background aBackground_967;
  14692. private final int[] anIntArray968;
  14693. private final int[] anIntArray969;
  14694. final Decompressor[] decompressors;
  14695. public int variousSettings[];
  14696. private boolean aBoolean972;
  14697. private final int anInt975;
  14698. private final int[] anIntArray976;
  14699. private final int[] anIntArray977;
  14700. private final int[] anIntArray978;
  14701. private final int[] anIntArray979;
  14702. private final int[] anIntArray980;
  14703. private final int[] anIntArray981;
  14704. private final int[] anIntArray982;
  14705. private final String[] aStringArray983;
  14706. private int anInt984;
  14707. private int anInt985;
  14708. private static int anInt986;
  14709. private Sprite[] hitMarks;
  14710. private int anInt988;
  14711. private int anInt989;
  14712. private final int[] anIntArray990;
  14713. private static boolean aBoolean993;
  14714. private final boolean aBoolean994;
  14715. private int anInt995;
  14716. private int anInt996;
  14717. private int anInt997;
  14718. private int anInt998;
  14719. private int anInt999;
  14720. private ISAACRandomGen encryption;
  14721. private Sprite mapEdge;
  14722. private Sprite multiOverlay;
  14723. private Sprite multiOverlay2;
  14724. private final int anInt1002;
  14725. static final int[][] anIntArrayArray1003 = {
  14726. { 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433, 2983,
  14727. 54193 },
  14728. { 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  14729. 56621, 4783, 1341, 16578, 35003, 25239 },
  14730. { 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  14731. 10153, 56621, 4783, 1341, 16578, 35003 },
  14732. { 4626, 11146, 6439, 12, 4758, 10270 },
  14733. { 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574 } };
  14734. public RSFont newSmallFont, newRegularFont, newBoldFont, newFancyFont;
  14735. public Sprite[] chatImages = new Sprite[5];
  14736. private String amountOrNameInput;
  14737. private static int anInt1005;
  14738. private int daysSinceLastLogin;
  14739. private int pktSize;
  14740. private int pktType;
  14741. private int anInt1009;
  14742. private int anInt1010;
  14743. private int anInt1011;
  14744. private NodeList aClass19_1013;
  14745. private int anInt1014;
  14746. private int anInt1015;
  14747. private int anInt1016;
  14748. private boolean aBoolean1017;
  14749. private int anInt1018;
  14750. private static final int[] anIntArray1019;
  14751. private int anInt1021;
  14752. private int anInt1022;
  14753. private int loadingStage;
  14754. private Sprite scrollBar1;
  14755. private Sprite scrollBar2;
  14756. private int anInt1026;
  14757. private Background backBase1;
  14758. private Background backBase2;
  14759. private Background backHmid1;
  14760. private final int[] anIntArray1030;
  14761. private boolean aBoolean1031;
  14762. private Sprite[] mapFunctions;
  14763. private int baseX;
  14764. private int baseY;
  14765. private int anInt1036;
  14766. private int anInt1037;
  14767. private int loginFailures;
  14768. private int anInt1039;
  14769. private int anInt1040;
  14770. private int anInt1041;
  14771. private int dialogID;
  14772. private final int[] maxStats;
  14773. private final int[] anIntArray1045;
  14774. private int anInt1046;
  14775. private boolean aBoolean1047;
  14776. private int anInt1048;
  14777. private String aString1049;
  14778. private static int anInt1051;
  14779. private final int[] anIntArray1052;
  14780. private StreamLoader titleStreamLoader;
  14781. private int anInt1054;
  14782. private int anInt1055;
  14783. private NodeList aClass19_1056;
  14784. private final int[] anIntArray1057;
  14785. public static RSInterface aClass9_1059;
  14786. private Background[] mapScenes;
  14787. private static int anInt1061;
  14788. private int anInt1062;
  14789. private final int barFillColor;
  14790. private int friendsListAction;
  14791. private final int[] anIntArray1065;
  14792. private int mouseInvInterfaceIndex;
  14793. private int lastActiveInvInterface;
  14794. public OnDemandFetcher onDemandFetcher;
  14795. private Sprite[] mapArea;
  14796. private int anInt1069;
  14797. private int anInt1070;
  14798. private int anInt1071;
  14799. private int[] anIntArray1072;
  14800. private int[] anIntArray1073;
  14801. private Sprite mapDotItem;
  14802. private Sprite mapDotNPC;
  14803. private Sprite mapDotPlayer;
  14804. private Sprite mapDotFriend;
  14805. private Sprite mapDotTeam;
  14806. private Sprite mapDotClan;
  14807. private int anInt1079;
  14808. private boolean aBoolean1080;
  14809. private String[] friendsList;
  14810. private Stream inStream;
  14811. private int anInt1084;
  14812. private int anInt1085;
  14813. private int activeInterfaceType;
  14814. private int anInt1087;
  14815. private int anInt1088;
  14816. public static int anInt1089;
  14817. private final int[] expectedCRCs;
  14818. private int[] menuActionCmd2;
  14819. private int[] menuActionCmd3;
  14820. public int[] menuActionID;
  14821. private int[] menuActionCmd1;
  14822. private Sprite[] headIcons;
  14823. private Sprite[] skullIcons;
  14824. private Sprite[] headIconsHint;
  14825. private static int anInt1097;
  14826. private int anInt1098;
  14827. private int anInt1099;
  14828. private int anInt1100;
  14829. private int anInt1101;
  14830. private int anInt1102;
  14831. public static boolean tabAreaAltered;
  14832. private int anInt1104;
  14833. private RSImageProducer aRSImageProducer_1107;
  14834. private RSImageProducer aRSImageProducer_1108;
  14835. private RSImageProducer aRSImageProducer_1109;
  14836. private RSImageProducer aRSImageProducer_1110;
  14837. private RSImageProducer aRSImageProducer_1111;
  14838. private RSImageProducer aRSImageProducer_1112;
  14839. private RSImageProducer aRSImageProducer_1113;
  14840. private RSImageProducer aRSImageProducer_1114;
  14841. private RSImageProducer aRSImageProducer_1115;
  14842. private static int anInt1117;
  14843. private int membersInt;
  14844. private String aString1121;
  14845. private Sprite compass;
  14846. private RSImageProducer aRSImageProducer_1123;
  14847. private RSImageProducer aRSImageProducer_1124;
  14848. private RSImageProducer aRSImageProducer_1125;
  14849. public static Player myPlayer;
  14850. private final String[] atPlayerActions;
  14851. private final boolean[] atPlayerArray;
  14852. private final int[][][] anIntArrayArrayArray1129;
  14853. public static int[] tabInterfaceIDs = { -1, -1, -1, -1, -1, -1, -1, -1, -1,
  14854. -1, -1, -1, -1, -1, -1, -1, -1 };
  14855. private int anInt1131;
  14856. private int anInt1132;
  14857. public int menuActionRow;
  14858. public int tabHPos;
  14859. private static int anInt1134;
  14860. private int spellSelected;
  14861. private int anInt1137;
  14862. private int spellUsableOn;
  14863. private String spellTooltip;
  14864. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  14865. private boolean aBoolean1141;
  14866. private static int anInt1142;
  14867. private int energy;
  14868. private boolean aBoolean1149;
  14869. private Sprite[] crosses;
  14870. private boolean musicEnabled;
  14871. private Background[] aBackgroundArray1152s;
  14872. public static boolean needDrawTabArea;
  14873. private int unreadMessages;
  14874. private static int anInt1155;
  14875. private static boolean fpsOn;
  14876. public static boolean loggedIn;
  14877. private boolean canMute;
  14878. private boolean aBoolean1159;
  14879. private boolean aBoolean1160;
  14880. static int loopCycle;
  14881. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  14882. private RSImageProducer aRSImageProducer_1163;
  14883. private RSImageProducer mapEdgeIP;
  14884. private RSImageProducer aRSImageProducer_1164;
  14885. private RSImageProducer aRSImageProducer_1165;
  14886. private RSImageProducer aRSImageProducer_1166;
  14887. private int daysSinceRecovChange;
  14888. private RSSocket socketStream;
  14889. private int anInt1169;
  14890. private int minimapInt3;
  14891. private int anInt1171;
  14892. private long aLong1172;
  14893. private static String myUsername;
  14894. private static String myPassword;
  14895. private static int anInt1175;
  14896. private boolean genericLoadingError;
  14897. private final int[] anIntArray1177 = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2,
  14898. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3 };
  14899. private int reportAbuseInterfaceID;
  14900. private NodeList aClass19_1179;
  14901. private int[] anIntArray1180;
  14902. private int[] anIntArray1181;
  14903. private int[] anIntArray1182;
  14904. private byte[][] aByteArrayArray1183;
  14905. private int anInt1184;
  14906. private int minimapInt1;
  14907. private int anInt1186;
  14908. private int anInt1187;
  14909. private static int anInt1188;
  14910. public static int invOverlayInterfaceID;
  14911. private int[] anIntArray1190;
  14912. private int[] anIntArray1191;
  14913. private Stream stream;
  14914. private int anInt1193;
  14915. private int splitPrivateChat;
  14916. private Background mapBack;
  14917. public String[] menuActionName;
  14918. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  14919. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  14920. private final int[] anIntArray1203;
  14921. static final int[] anIntArray1204 = { 9104, 10275, 7595, 3610, 7975, 8526,
  14922. 918, 38802, 24466, 10145, 58654, 5027, 1457, 16565, 34991, 25486 };
  14923. private static boolean flagged;
  14924. private final int[] anIntArray1207;
  14925. private int anInt1208;
  14926. private int minimapInt2;
  14927. private int anInt1210;
  14928. private int anInt1211;
  14929. private String promptInput;
  14930. private int anInt1213;
  14931. private int[][][] intGroundArray;
  14932. private long aLong1215;
  14933. private int loginScreenCursorPos;
  14934. private final Background[] modIcons;
  14935. private long aLong1220;
  14936. public static int tabID;
  14937. private int anInt1222;
  14938. public static boolean inputTaken;
  14939. private int inputDialogState;
  14940. private static int anInt1226;
  14941. private int nextSong;
  14942. private boolean songChanging;
  14943. private final int[] anIntArray1229;
  14944. private Class11[] aClass11Array1230;
  14945. public static int anIntArray1232[];
  14946. private boolean aBoolean1233;
  14947. private int[] anIntArray1234;
  14948. private int[] anIntArray1235;
  14949. private int[] anIntArray1236;
  14950. private int anInt1237;
  14951. private int anInt1238;
  14952. private Sprite infinity;
  14953. public final int anInt1239 = 100;
  14954. private final int[] anIntArray1240;
  14955. private final int[] anIntArray1241;
  14956. private boolean aBoolean1242;
  14957. private int atInventoryLoopCycle;
  14958. private int atInventoryInterface;
  14959. private int atInventoryIndex;
  14960. private int atInventoryInterfaceType;
  14961. private byte[][] aByteArrayArray1247;
  14962. private int tradeMode;
  14963. private int anInt1249;
  14964. private final int[] anIntArray1250;
  14965. private int anInt1251;
  14966. private final boolean rsAlreadyLoaded;
  14967. private int anInt1253;
  14968. private int anInt1254;
  14969. private boolean welcomeScreenRaised;
  14970. private boolean messagePromptRaised;
  14971. private int anInt1257;
  14972. private byte[][][] byteGroundArray;
  14973. private int prevSong;
  14974. private int destX;
  14975. private int destY;
  14976. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  14977. private int anInt1264;
  14978. private int anInt1265;
  14979. public boolean runClicked = false;
  14980. private String loginMessage1;
  14981. private String loginMessage2;
  14982. private int anInt1268;
  14983. private int anInt1269;
  14984. public TextDrawingArea smallText;
  14985. public TextDrawingArea aTextDrawingArea_1271;
  14986. private TextDrawingArea chatTextDrawingArea;
  14987. private int anInt1275;
  14988. private Sprite[] newSideIcons;
  14989. private int backDialogID;
  14990. private int anInt1278;
  14991. private int anInt1279;
  14992. private int[] bigX;
  14993. private int[] bigY;
  14994. private int itemSelected;
  14995. private int anInt1283;
  14996. private int anInt1284;
  14997. private int anInt1285;
  14998. private String selectedItemName;
  14999. private int publicChatMode;
  15000. private static int anInt1288;
  15001. private int anInt1289;
  15002. public static int anInt1290;
  15003. //public static String server = "167.114.0.139";
  15004. //public static String server = "pdv3.no-ip.biz";
  15005. public static String server = "127.0.0.1";
  15006. public int drawCount;
  15007. public int fullscreenInterfaceID;
  15008. public int anInt1044;// 377
  15009. public int anInt1129;// 377
  15010. public int anInt1315;// 377
  15011. public int anInt1500;// 377
  15012. private Sprite logIconH;
  15013. private Sprite logIconC;
  15014. private Sprite questionIconH;
  15015. private Sprite questionIconC;
  15016. private Sprite worldMapIcon;
  15017. private Sprite xpIcon;
  15018. private Sprite xpIconH;
  15019. private Sprite logoutIcon;
  15020. private Sprite questionIcon;
  15021. private Sprite emptyOrb;
  15022. private Sprite orbFill;
  15023. private Sprite hoveredEmpty;
  15024. private Sprite runIcon1;
  15025. private Sprite runIcon2;
  15026. private Sprite runOrb1;
  15027. private Sprite runOrb2;
  15028. private Sprite hitPointsFill;
  15029. private Sprite hitPointsIcon;
  15030. private Sprite prayerFill;
  15031. private Sprite prayerIcon;
  15032. public int anInt1501;// 377
  15033. public int[] fullScreenTextureArray;
  15034. public int[] menuActionCmd4;
  15035.  
  15036. public void resetAllImageProducers() {
  15037. if (super.fullGameScreen != null) {
  15038. return;
  15039. }
  15040. aRSImageProducer_1166 = null;
  15041. aRSImageProducer_1164 = null;
  15042. aRSImageProducer_1163 = null;
  15043. aRSImageProducer_1165 = null;
  15044. aRSImageProducer_1123 = null;
  15045. aRSImageProducer_1124 = null;
  15046. aRSImageProducer_1125 = null;
  15047. aRSImageProducer_1107 = null;
  15048. aRSImageProducer_1108 = null;
  15049. aRSImageProducer_1109 = null;
  15050. aRSImageProducer_1110 = null;
  15051. aRSImageProducer_1111 = null;
  15052. aRSImageProducer_1112 = null;
  15053. aRSImageProducer_1113 = null;
  15054. aRSImageProducer_1114 = null;
  15055. aRSImageProducer_1115 = null;
  15056. super.fullGameScreen = new RSImageProducer(765 + extraWidth,
  15057. 503 + extraHeight, getGameComponent());
  15058. welcomeScreenRaised = true;
  15059. }
  15060.  
  15061. public void launchURL(String url) {
  15062. String osName = System.getProperty("os.name");
  15063. try {
  15064. if (osName.startsWith("Mac OS")) {
  15065. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  15066. Method openURL = fileMgr.getDeclaredMethod("openURL",
  15067. new Class[] { String.class });
  15068. openURL.invoke(null, new Object[] { url });
  15069. } else if (osName.startsWith("Windows"))
  15070. Runtime.getRuntime().exec(
  15071. "rundll32 url.dll,FileProtocolHandler " + url);
  15072. else { // assume Unix or Linux
  15073. String[] browsers = { "firefox", "opera", "konqueror",
  15074. "epiphany", "mozilla", "netscape", "safari" };
  15075. String browser = null;
  15076. for (int count = 0; count < browsers.length && browser == null; count++)
  15077. if (Runtime.getRuntime().exec(
  15078. new String[] { "which", browsers[count] })
  15079. .waitFor() == 0)
  15080. browser = browsers[count];
  15081. if (browser == null) {
  15082. throw new Exception("Could not find web browser");
  15083. } else
  15084. Runtime.getRuntime().exec(new String[] { browser, url });
  15085. }
  15086. } catch (Exception e) {
  15087. pushMessage("Failed to open URL.", 0, "");
  15088. }
  15089. }
  15090.  
  15091. static {
  15092. anIntArray1019 = new int[99];
  15093. int i = 0;
  15094. for (int j = 0; j < 99; j++) {
  15095. int l = j + 1;
  15096. int i1 = (int) ((double) l + 300D * Math.pow(2D, (double) l / 7D));
  15097. i += i1;
  15098. anIntArray1019[j] = i / 4;
  15099. }
  15100. anIntArray1232 = new int[32];
  15101. i = 2;
  15102. for (int k = 0; k < 32; k++) {
  15103. anIntArray1232[k] = i - 1;
  15104. i += i;
  15105. }
  15106. }
  15107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement