Advertisement
Guest User

client.java

a guest
Jul 15th, 2016
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 485.08 KB | None | 0 0
  1. package com.runescape.client;// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.kpdus.com/jad.html
  3. // Decompiler options: packimports(3)
  4.  
  5. import java.applet.AppletContext;
  6. import java.awt.Color;
  7. import java.awt.Component;
  8. import java.awt.Cursor;
  9. import java.awt.Dimension;
  10. import java.awt.Font;
  11. import java.awt.Graphics;
  12. import java.awt.Image;
  13. import java.awt.Toolkit;
  14. import java.io.BufferedInputStream;
  15. import java.io.BufferedOutputStream;
  16. import java.io.BufferedReader;
  17. import java.io.BufferedWriter;
  18. import java.io.ByteArrayOutputStream;
  19. import java.io.DataInputStream;
  20. import java.io.DataOutputStream;
  21. import java.io.File;
  22. import java.io.FileInputStream;
  23. import java.io.FileOutputStream;
  24. import java.io.FileReader;
  25. import java.io.FileWriter;
  26. import java.io.IOException;
  27. import java.io.InputStream;
  28. import java.io.InputStreamReader;
  29. import java.io.OutputStream;
  30. import java.lang.reflect.Method;
  31. import java.net.InetAddress;
  32. import java.net.NetworkInterface;
  33. import java.net.Socket;
  34. import java.net.URL;
  35. import java.net.URLConnection;
  36. import java.text.SimpleDateFormat;
  37. import java.util.Date;
  38. import java.util.TimeZone;
  39. import java.util.regex.Matcher;
  40. import java.util.regex.Pattern;
  41. import java.util.zip.GZIPOutputStream;
  42.  
  43. import javax.swing.JFrame;
  44. import javax.swing.JOptionPane;
  45.  
  46. @SuppressWarnings({ "unchecked", "serial" })
  47. public class Client extends RSApplet {
  48.  
  49. public static final String SERVER_NAME = "NexusPK";
  50. public static final String SERVER_IP = "173.248.153.156";
  51. public static final String WEBSITE_URL = "www.nexuspk.com";
  52. public static final String DONATE_URL = "www.nexuspk.com/donate";
  53. public static final String CACHE_URL = "http://just18.justhost.com/~eypicnet/cache.zip";
  54. public static final String ERROR_URL_STRING = "http://www.eypic.net/errors/submit.php";
  55. public static final String PANEL_TITLE = "NexusPk Client v1.2";
  56. private static final SimpleDateFormat FORMATTER = new SimpleDateFormat(
  57. "yyyy-MMM-dd HH:mm:ss");
  58.  
  59. private String getCacheDir() {
  60. return signlink.findcachedir();
  61. }
  62.  
  63.  
  64. public static boolean critical = false;
  65. public Sprite[] combatIcons = new Sprite[5];
  66. public String spriteDir = signlink.findcachedir() + "Sprites/";
  67. public AlertHandler alertHandler;
  68. public Sprite alertBack;
  69. public Sprite alertBorder;
  70. public Sprite alertBorderH;
  71. public static boolean hitmarks = true;
  72. public static boolean menuToggle = true;
  73. public static boolean headname = false;
  74. public static boolean headhp = false;
  75. public static boolean sky = true;
  76. public static boolean is554 = true;
  77. public static boolean is474 = false;
  78. public boolean drawLongTabs;
  79. public static boolean is483 = false;
  80. public static boolean menuClicked = false;
  81. public static boolean gameFrame474 = false;
  82. public static boolean gameFrame525 = false;
  83. public static boolean gameFrame554 = true;
  84. public static boolean gameFrame483 = false;
  85. public static boolean newHotKeys = false;
  86. public boolean xpClicked = false;
  87. public int flagPos = 72;
  88. public static int Zoom = 0;
  89. public int hitmarkPos = 0;
  90. public int loadingXpos = 0;
  91. public int optionsXpos = 0;
  92. public boolean drawFlashingSymbol = false;
  93. public boolean drawFlag = false;
  94. public Sprite sprite1;
  95. public Sprite xpFlag;
  96. public Sprite x10Expand;
  97. public Sprite x10ExpandOld;
  98. public Sprite mapRing;
  99. public boolean manaHover = false;
  100. public int xpToDraw = 0;
  101. public static int testXp = 0;
  102. public boolean drawXpBar = false;
  103.  
  104. public static boolean rememberMe = false;
  105.  
  106. public static boolean isFullScreen, hasBeenBlanked;
  107. public static int extraWidth = 1280 - 765, extraHeight = 1024 - 503,
  108. clientWidth = 0, clientHeight = 0;
  109.  
  110. public String fName;
  111. public String dir;
  112. public static boolean orbs = true;
  113. public static boolean HPBarToggle = true;
  114. private Sprite HPBarFull;
  115. private Sprite HPBarEmpty;
  116. private Sprite newestHitSplash;
  117. private Sprite criticalHitSplash;
  118. private Sprite newestDefSplash;
  119. private Sprite oldGreen;
  120. public int MapX, MapY;
  121. public static int spellID = 0;
  122. public static boolean newDamage = true;
  123.  
  124. public int positions[] = new int[2000];
  125. public int landScapes[] = new int[2000];
  126. public int objects[] = new int[2000];
  127.  
  128. public void models() {
  129. for (int ModelIndex = 0; ModelIndex < 50000; ModelIndex++) {
  130. byte[] abyte0 = getModel(ModelIndex);
  131. if (abyte0 != null && abyte0.length > 0) {
  132. decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  133. pushMessage("Model added successfully!", 0, "");
  134. }
  135. }
  136. }
  137.  
  138. /*
  139. * public void models() { pushMessage("Does it even call the method?", 0,
  140. * ""); for (int ModelIndex = 0; ModelIndex < 100000; ModelIndex++) { byte[]
  141. * abyte0 = getModel(ModelIndex); if (abyte0 != null && abyte0.length > 0) {
  142. * decompressors[3].method234(abyte0.length, abyte0, ModelIndex);
  143. * pushMessage("Model added successfully!", 0, ""); } } }
  144. */
  145.  
  146. public void toggleChat() {
  147. displayChat = !displayChat;
  148. }
  149.  
  150. public static String chatColorHex = "00FFFF";
  151.  
  152. public static int getChatColor() {
  153. try {
  154. return (int) Long.parseLong(chatColorHex, 16);
  155. } catch (Exception e) {
  156. }
  157. return 0;
  158. }
  159.  
  160. public static void writeSettings() throws IOException {
  161. DataOutputStream out = new DataOutputStream(new BufferedOutputStream(
  162. new FileOutputStream(signlink.findcachedir() + "Client"
  163. + File.separator + "settings.dat")));
  164. out.writeInt(is474 ? 1 : 0);
  165. out.writeInt(is554 ? 1 : 0);
  166. out.writeInt(headhp ? 1 : 0);
  167. out.writeInt(headname ? 1 : 0);
  168. out.writeInt(sky ? 1 : 0);
  169. out.writeInt(menuToggle ? 1 : 0);
  170. out.writeInt(HPBarToggle ? 1 : 0);
  171. out.writeInt(gameFrame554 ? 1 : 0);
  172. out.writeInt(gameFrame474 ? 1 : 0);
  173. out.writeInt(gameFrame525 ? 1 : 0);
  174. out.writeInt(newDamage ? 1 : 0);
  175. out.writeUTF(chatColorHex);
  176. out.writeInt(Zoom);
  177. out.writeUTF(Uploader.apiKey);
  178. out.close();
  179. }
  180.  
  181. public float lastPercent;
  182.  
  183. public void drawSmoothLoadingText(int i, String s) {
  184. for (float f = lastPercent; f < (float) i; f = (float) ((double) f + 0.29999999999999999D)) {
  185. drawLoadingText((int) f, s);
  186. }
  187.  
  188. lastPercent = i;
  189. }
  190.  
  191. public static void readSettings() throws IOException {
  192. try {
  193. DataInputStream in = new DataInputStream(new BufferedInputStream(
  194. new FileInputStream(signlink.findcachedir() + "Client"
  195. + File.separator + "settings.dat")));
  196. is474 = in.readInt() == 1 ? true : false;
  197. is554 = in.readInt() == 1 ? true : false;
  198. headhp = in.readInt() == 1 ? true : false;
  199. headname = in.readInt() == 1 ? true : false;
  200. sky = in.readInt() == 1 ? true : false;
  201. menuToggle = in.readInt() == 1 ? true : false;
  202. HPBarToggle = in.readInt() == 1 ? true : false;
  203. gameFrame554 = in.readInt() == 1 ? true : false;
  204. gameFrame474 = in.readInt() == 1 ? true : false;
  205. gameFrame525 = in.readInt() == 1 ? true : false;
  206. newDamage = in.readInt() == 1 ? true : false;
  207. chatColorHex = in.readUTF();
  208. Zoom = in.readInt();
  209. String s = in.readUTF();
  210. in.close();
  211. } catch (Exception e) {
  212. }
  213. }
  214.  
  215. public void switchGameframe(int revision) {
  216. if (revision == 474) {
  217. tabArea = new Sprite("tabarea2");
  218. needDrawTabArea = true;
  219. aBoolean1233 = true;
  220. is474 = true;
  221. is554 = false;
  222. gameFrame474 = true;
  223. drawRedStones();
  224. drawXpBar = false;
  225. if (isFullScreen && extraWidth >= 237)
  226. drawLongTabs = true;
  227. } else if (revision == 525) {
  228. is554 = false;
  229. is474 = false;
  230. tabArea = new Sprite("tabarea");
  231. needDrawTabArea = true;
  232. aBoolean1233 = true;
  233. gameFrame525 = true;
  234. if (isFullScreen && extraWidth >= 237)
  235. drawLongTabs = true;
  236. } else if (revision == 554) {
  237. is554 = true;
  238. drawRedStones();
  239. tabArea = new Sprite("tabarea3");
  240. is474 = false;
  241. is483 = false;
  242. gameFrame554 = true;
  243. if (isFullScreen && extraWidth >= 237)
  244. drawLongTabs = true;
  245. }
  246. }
  247.  
  248. public void setClientConfig() {
  249. /*
  250. * int i1, i2, i3, i4; i1 = x10Hits ? 1 : 0; i2 = customCursorsOn ? 1 :
  251. * 0; i3 = drawTransparentMenu ? 1 : 0; i4 = displayHP ? 1 : 0;
  252. * sendFrame36(669, (byte)i1); sendFrame36(670, (byte)i2);
  253. * sendFrame36(671, (byte)i3); sendFrame36(672, (byte)i4);
  254. */
  255. }
  256.  
  257. public byte[] getModel(int Index) {
  258. try {
  259. File Model = new File("./Models/" + Index + ".gz");
  260. byte[] aByte = new byte[(int) Model.length()];
  261. FileInputStream fis = new FileInputStream(Model);
  262. fis.read(aByte);
  263. pushMessage("aByte = [" + aByte + "]!", 0, "");
  264. fis.close();
  265. return aByte;
  266. } catch (Exception e) {
  267. return null;
  268. }
  269. }
  270.  
  271. /*
  272. * public byte[] getModel(int Index) { try { File Model = new
  273. * File(signlink.findcachedir() + "/Raw/" + Index + ".gz"); byte[] aByte =
  274. * new byte[(int) Model.length()]; FileInputStream fis = new
  275. * FileInputStream(Model); fis.read(aByte); pushMessage("aByte = [" + aByte
  276. * + "]!", 0, ""); fis.close(); return aByte; } catch (Exception e) { return
  277. * null; } }
  278. */
  279.  
  280. public int getOrbFill(int statusInt) {
  281. if (statusInt <= 100 && statusInt >= 97) {
  282. return 0;
  283. } else if (statusInt <= 96 && statusInt >= 93) {
  284. return 1;
  285. } else if (statusInt <= 92 && statusInt >= 89) {
  286. return 2;
  287. } else if (statusInt <= 88 && statusInt >= 85) {
  288. return 3;
  289. } else if (statusInt <= 84 && statusInt >= 81) {
  290. return 4;
  291. } else if (statusInt <= 80 && statusInt >= 77) {
  292. return 5;
  293. } else if (statusInt <= 76 && statusInt >= 73) {
  294. return 6;
  295. } else if (statusInt <= 72 && statusInt >= 69) {
  296. return 7;
  297. } else if (statusInt <= 68 && statusInt >= 65) {
  298. return 8;
  299. } else if (statusInt <= 64 && statusInt >= 61) {
  300. return 9;
  301. } else if (statusInt <= 60 && statusInt >= 57) {
  302. return 10;
  303. } else if (statusInt <= 56 && statusInt >= 53) {
  304. return 11;
  305. } else if (statusInt <= 52 && statusInt >= 49) {
  306. return 12;
  307. } else if (statusInt <= 48 && statusInt >= 45) {
  308. return 13;
  309. } else if (statusInt <= 44 && statusInt >= 41) {
  310. return 14;
  311. } else if (statusInt <= 40 && statusInt >= 37) {
  312. return 15;
  313. } else if (statusInt <= 36 && statusInt >= 33) {
  314. return 16;
  315. } else if (statusInt <= 32 && statusInt >= 29) {
  316. return 17;
  317. } else if (statusInt <= 28 && statusInt >= 25) {
  318. return 18;
  319. } else if (statusInt <= 24 && statusInt >= 21) {
  320. return 19;
  321. } else if (statusInt <= 20 && statusInt >= 17) {
  322. return 20;
  323. } else if (statusInt <= 16 && statusInt >= 13) {
  324. return 21;
  325. } else if (statusInt <= 12 && statusInt >= 9) {
  326. return 22;
  327. } else if (statusInt <= 8 && statusInt >= 7) {
  328. return 23;
  329. } else if (statusInt <= 6 && statusInt >= 5) {
  330. return 24;
  331. } else if (statusInt <= 4 && statusInt >= 3) {
  332. return 25;
  333. } else if (statusInt <= 2 && statusInt >= 1) {
  334. return 26;
  335. } else if (statusInt <= 0) {
  336. return 27;
  337. }
  338. return 0;
  339. }
  340.  
  341. public void drawHPOrb() {
  342. String OrbDirectory = signlink.findcachedir()
  343. + "Sprites/GameFrame/Orbs/";
  344. String s1 = RSInterface.interfaceCache[4016].message;
  345. s1 = s1.replaceAll("%", "");
  346. int j = Integer.parseInt(s1);
  347. String s2 = RSInterface.interfaceCache[4017].message;
  348. int health;
  349. s2 = s2.replaceAll("%", "");
  350. int k = Integer.parseInt(s2);
  351. int i = (int) (((double) j / (double) k) * 100D);
  352. String cHP = RSInterface.interfaceCache[4016].message;
  353. // System.out.println("cHP is " + cHP);
  354. int currentHP = Integer.parseInt(cHP);
  355. String mHP = RSInterface.interfaceCache[4017].message;
  356. int maxHP2 = Integer.parseInt(mHP);
  357. health = (int) (((double) currentHP / (double) maxHP2) * 100D);
  358. int x = isFullScreen ? 363 + extraWidth : 0;
  359. int y = isFullScreen ? +32 : 0;
  360.  
  361. int xPos = isFullScreen ? 387 + extraWidth : 0;
  362. int xPosTXT = isFullScreen ? 335 + extraWidth : 0;
  363. int yPos = isFullScreen ? +32 : 0;
  364. if (isFullScreen) {
  365. emptyOrb = new Sprite("GameFrame/Orbs/ORBS 12");
  366. } else {
  367. emptyOrb = new Sprite("GameFrame/Orbs/emptyorb");
  368. }
  369. orbFill = new Sprite(OrbDirectory + "Orb 2.png", 27, getOrbFill(health));
  370. /* Draws empty orb */
  371. emptyOrb.drawSprite(170 + x, 13 + y);
  372. /* Draws current HP text */
  373. if (/* health <= 100 && */health >= 75) {
  374. smallText.method382(65280, 213 + xPosTXT, cHP, 39 + yPos, true);
  375. } else if (health <= 74 && health >= 50) {
  376. smallText.method382(0xffff00, 213 + xPosTXT, cHP, 39 + yPos, true);
  377. } else if (health <= 49 && health >= 25) {
  378. smallText.method382(0xfca607, 213 + xPosTXT, cHP, 39 + yPos, true);
  379. } else if (health <= 24 && health >= 0) {
  380. smallText.method382(0xf50d0d, 213 + xPosTXT, cHP, 39 + yPos, true);
  381. }
  382. hitPointsFill.drawSprite(173 + xPos, 16 + yPos);
  383. orbFill.drawSprite(173 + xPos, 16 + yPos);
  384. /* Draws inside orb sprites */
  385. if (i <= 20) {
  386. if (loopCycle % 20 < 10) {
  387. hitPointsIcon.drawSprite(179 + xPos, 24 + yPos);
  388. }
  389. } else {
  390. hitPointsIcon.drawSprite(179 + xPos, 24 + yPos);
  391. }
  392. }
  393.  
  394. public void drawPrayerOrb() {
  395. String OrbDirectory = signlink.findcachedir()
  396. + "Sprites/GameFrame/Orbs/";
  397. int prayer;
  398. String cPR = RSInterface.interfaceCache[4012].message;
  399. int currentPR = Integer.parseInt(cPR);
  400. String mPR = RSInterface.interfaceCache[4013].message;
  401. int maxPR2 = Integer.parseInt(mPR);
  402. prayer = (int) (((double) currentPR / (double) maxPR2) * 100D);
  403. String cP = RSInterface.interfaceCache[4012].message;
  404. int currentPrayer = Integer.parseInt(cP);
  405. String mP = RSInterface.interfaceCache[4013].message;
  406. int maxPrayer = Integer.parseInt(mP);
  407. prayer = (int) (((double) currentPrayer / (double) maxPrayer) * 100D);
  408. int x = isFullScreen ? 347 + extraWidth : 0;
  409. int y = isFullScreen ? +32 : 0;
  410.  
  411. int xPos = isFullScreen ? 387 + extraWidth - 17 : 0;
  412. int xPosTXT = isFullScreen ? 335 + extraWidth - 17 : 0;
  413. int yPos = isFullScreen ? +32 : 0;
  414. orbFill = new Sprite(OrbDirectory + "Orb 2.png", 27, getOrbFill(prayer));
  415. emptyOrb.drawSprite(184 + x, 49 + y);
  416. if (prayer <= 100 && prayer >= 75) {
  417. smallText.method382(65280, 227 + xPosTXT, cP, 75 + yPos, true);
  418. } else if (prayer <= 74 && prayer >= 50) {
  419. smallText.method382(0xffff00, 227 + xPosTXT, cP, 75 + yPos, true);
  420. } else if (prayer <= 49 && prayer >= 25) {
  421. smallText.method382(0xfca607, 227 + xPosTXT, cP, 75 + yPos, true);
  422. } else if (prayer <= 24 && prayer >= 0) {
  423. smallText.method382(0xf50d0d, 227 + xPosTXT, cP, 75 + yPos, true);
  424. }
  425. prayerFill.drawSprite(187 + xPos, 52 + yPos);
  426. orbFill.drawSprite(187 + xPos, 52 + yPos);
  427. if (prayer <= 25) {
  428. if (loopCycle % 20 < 10) {
  429. prayerIcon.drawSprite(191 + xPos, 56 + yPos);
  430. }
  431. } else {
  432. prayerIcon.drawSprite(191 + xPos, 56 + yPos);
  433. }
  434. }
  435.  
  436. public void drawSummOrb() {
  437. String OrbDirectory = signlink.findcachedir()
  438. + "Sprites/GameFrame/Orbs/";
  439. String summ = (RSInterface.interfaceCache[4508].message == null || RSInterface.interfaceCache[4508].message
  440. .equals("")) ? "0" : RSInterface.interfaceCache[4508].message;
  441. summ = summ + "%";
  442. int x = isFullScreen ? 387 + extraWidth : 0;
  443. int y = isFullScreen ? +28 : 0;
  444.  
  445. int xPos = isFullScreen ? 427 + extraWidth - 17 : 0;
  446. int xPosTXT = isFullScreen ? 375 + extraWidth - 17 : 0;
  447. int yPos = isFullScreen ? +28 : 0;
  448. orbFill = new Sprite(OrbDirectory + "Orb 2.png", 27,
  449. getOrbFill(Integer.parseInt(summ.replaceAll("%", ""))));
  450.  
  451. emptyOrb.drawSprite(184 + x - 5, 49 + y + 72);
  452. smallText.method382(65280, 227 + xPosTXT - 5, summ, 75 + yPos + 72,
  453. true);
  454.  
  455. prayerFill.drawSprite(187 + xPos - 5, 52 + yPos + 72);
  456. orbFill.drawSprite(187 + xPos - 5, 52 + yPos + 72);
  457.  
  458. summIcon.drawSprite(194 + xPos - 5, 52 + yPos + 77); // drawSprite(194 +
  459. // xPos - 5, 52
  460. // + yPos + 77);
  461.  
  462. }
  463.  
  464. public void drawRunOrb() {
  465. Sprite orb = (runClicked ? runOrb2 : runOrb1);
  466. Sprite icon = (runClicked ? runIcon2 : runIcon1);
  467. int x = isFullScreen ? 358 + extraWidth : 0;
  468. int y = isFullScreen ? +32 : 0;
  469.  
  470. int x2 = isFullScreen ? extraWidth - 160 : 0;
  471. int y2 = isFullScreen ? +36 : 0;
  472.  
  473. int xPos = isFullScreen ? 387 + extraWidth - 5 : 0;
  474. int xPosTXT = isFullScreen ? 335 + extraWidth - 5 : 0;
  475. int yPos = isFullScreen ? +32 : 0;
  476. if (isFullScreen) {
  477. hoveredEmpty = new Sprite("GameFrame/Orbs/1127");
  478. } else {
  479. hoveredEmpty = new Sprite("GameFrame/Orbs/hoveredempty");
  480. }
  481. emptyOrb.drawSprite(185 + x, 85 + y);
  482. if (super.mouseX > 713 + x2 && super.mouseX < 765 + x2
  483. && super.mouseY > 83 + y2 && super.mouseY < 118 + y2) {
  484. hoveredEmpty.drawSprite(185 + x, 85 + y);
  485. }
  486. orb.drawSprite(188 + xPos, 88 + yPos);
  487. icon.drawSprite(195 + xPos, 93 + yPos);
  488. int colour;
  489. colour = 65280;
  490. smallText.method382(colour, 229 + xPosTXT, "100", 111 + yPos, true);
  491. }
  492.  
  493. private void rightClickMapArea() {
  494. int x = isFullScreen ? extraWidth + 17 : 0;
  495. int y = isFullScreen ? -30 : 0;
  496.  
  497. int xSumm = isFullScreen ? extraWidth - 130 : 0;
  498. int ySumm = 0;
  499. int x22 = isFullScreen ? extraWidth : 0;
  500.  
  501. int x2 = isFullScreen ? extraWidth - 160 : 0;
  502. int y2 = isFullScreen ? +36 : 0;
  503. if (!is474) {
  504. if (super.mouseX >= 742 + x22 && super.mouseX <= 764 + x22
  505. && super.mouseY >= 1 && super.mouseY <= 23
  506. && tabInterfaceIDs[10] != -1) {
  507. menuActionName[1] = "Logout";
  508. menuActionID[1] = 1004;
  509. menuActionRow = 2;
  510. } else if (super.mouseX >= 516 + x && super.mouseX <= 550 + x
  511. && super.mouseY >= 46 + y && super.mouseY < 80 + y) {
  512. menuActionName[1] = "Toggle XP Total";
  513. menuActionID[1] = 1503;
  514. menuActionRow = 2;
  515. } else if (super.mouseX > 724 + x22 && super.mouseX < 741 + x22
  516. && super.mouseY > 1 && super.mouseY < 23) {
  517. menuActionName[1] = "Advisor";
  518. menuActionID[1] = 1005;
  519. menuActionRow = 2;
  520. } else if (super.mouseX > 713 + x2 && super.mouseX < 765 + x2
  521. && super.mouseY > 83 + y2 && super.mouseY < 118 + y2) {
  522. menuActionName[1] = "Run";
  523. menuActionID[1] = 1051;
  524. menuActionRow = 2;
  525. } else if (super.mouseX >= 695 + xSumm
  526. && super.mouseX <= 751 + ySumm
  527. && super.mouseY >= 120 + xSumm
  528. && super.mouseY < 150 + ySumm) {
  529. menuActionName[1] = "Dismiss";
  530. menuActionID[1] = 1754;
  531. menuActionRow = 2;
  532. menuActionName[2] = "Special";
  533. menuActionID[2] = 1753;
  534. menuActionRow = 3;
  535. }
  536. }
  537. }
  538.  
  539. public void setNewMaps() {
  540. try {
  541. BufferedReader in = new BufferedReader(new FileReader(
  542. signlink.findcachedir() + "Maps/mapConfig.txt"));
  543. String s;
  544. int D = 0;
  545. while ((s = in.readLine()) != null) {
  546. positions[D] = Integer.parseInt(s.substring(s.indexOf("=") + 1,
  547. s.indexOf("(")));
  548. landScapes[D] = Integer.parseInt(s.substring(
  549. s.indexOf("(") + 1, s.indexOf(")")));
  550. objects[D] = Integer.parseInt(s.substring(s.indexOf("[") + 1,
  551. s.indexOf("]")));
  552. D++;
  553. }
  554. } catch (IOException e) {
  555. e.printStackTrace();
  556. }
  557. }
  558.  
  559. public void drawHoverBox(int xPos, int yPos, String text) {
  560. String[] results = text.split("\n");
  561. int height = (results.length * 16) + 6;
  562. int width;
  563. width = smallText.getTextWidth(results[0]) + 6;
  564. for (int i = 1; i < results.length; i++)
  565. if (width <= smallText.getTextWidth(results[i]) + 6)
  566. width = smallText.getTextWidth(results[i]) + 6;
  567. DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  568. DrawingArea.drawUnfilledPixels(xPos, width, height, 0, yPos);
  569. yPos += 14;
  570. for (int i = 0; i < results.length; i++) {
  571. smallText.method389(false, xPos + 3, 0, results[i], yPos);
  572. yPos += 16;
  573. }
  574. }
  575.  
  576. private static String intToKOrMilLongName(int i) {
  577. String s = String.valueOf(i);
  578. for (int k = s.length() - 3; k > 0; k -= 3)
  579. s = s.substring(0, k) + "," + s.substring(k);
  580.  
  581. // if(j != 0)
  582. // aBoolean1224 = !aBoolean1224;
  583. if (s.length() > 8)
  584. s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@("
  585. + s + ")";
  586. else if (s.length() > 4)
  587. s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  588. return " " + s;
  589. }
  590.  
  591. public final String methodR(/* int i, */int j) {
  592. // if(i <= 0)
  593. // pktType = inStream.readUnsignedByte();
  594. if (j >= 0 && j < 10000)
  595. return String.valueOf(j);
  596. if (j >= 10000 && j < 10000000)
  597. return j / 1000 + "K";
  598. if (j >= 10000000 && j < 999999999)
  599. return j / 1000000 + "M";
  600. if (j >= 999999999)
  601. return "*";
  602. else
  603. return "?";
  604. }
  605.  
  606. public static final byte[] ReadFile(String s) {
  607. try {
  608. byte abyte0[];
  609. File file = new File(s);
  610. int i = (int) file.length();
  611. abyte0 = new byte[i];
  612. DataInputStream datainputstream = new DataInputStream(
  613. new BufferedInputStream(new FileInputStream(s)));
  614. datainputstream.readFully(abyte0, 0, i);
  615. datainputstream.close();
  616. return abyte0;
  617. } catch (Exception e) {
  618. System.out.println((new StringBuilder()).append("Read Error: ")
  619. .append(s).toString());
  620. return null;
  621. }
  622. }
  623.  
  624. private void stopMidi() {
  625. signlink.midifade = 0;
  626. signlink.midi = "stop";
  627. }
  628.  
  629. private boolean menuHasAddFriend(int j) {
  630. if (j < 0)
  631. return false;
  632. int k = menuActionID[j];
  633. if (k >= 2000)
  634. k -= 2000;
  635. return k == 337;
  636. }
  637.  
  638. public void drawChannelButtons() {
  639. int y = isFullScreen ? extraHeight + 334 : 0;
  640. String text[] = { "On", "Friends", "Off", "Hide" };
  641. int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  642. if (displayChat) {
  643. switch (cButtonCPos) {
  644. case 0:
  645. chatButtons[1].drawSprite(5, 142 + y);
  646. break;
  647. case 1:
  648. chatButtons[1].drawSprite(71, 142 + y);
  649. break;
  650. case 2:
  651. chatButtons[1].drawSprite(137, 142 + y);
  652. break;
  653. case 3:
  654. chatButtons[1].drawSprite(203, 142 + y);
  655. break;
  656. case 4:
  657. chatButtons[1].drawSprite(269, 142 + y);
  658. break;
  659. case 5:
  660. chatButtons[1].drawSprite(335, 142 + y);
  661. break;
  662. }
  663. if (cButtonHPos == cButtonCPos) {
  664. switch (cButtonHPos) {
  665. case 0:
  666. chatButtons[2].drawSprite(5, 142 + y);
  667. break;
  668. case 1:
  669. chatButtons[2].drawSprite(71, 142 + y);
  670. break;
  671. case 2:
  672. chatButtons[2].drawSprite(137, 142 + y);
  673. break;
  674. case 3:
  675. chatButtons[2].drawSprite(203, 142 + y);
  676. break;
  677. case 4:
  678. chatButtons[2].drawSprite(269, 142 + y);
  679. break;
  680. case 5:
  681. chatButtons[2].drawSprite(335, 142 + y);
  682. break;
  683. case 6:
  684. chatButtons[3].drawSprite(404, 142 + y);
  685. break;
  686. }
  687. } else {
  688. switch (cButtonHPos) {
  689. case 0:
  690. chatButtons[0].drawSprite(5, 142 + y);
  691. break;
  692. case 1:
  693. chatButtons[0].drawSprite(71, 142 + y);
  694. break;
  695. case 2:
  696. chatButtons[0].drawSprite(137, 142 + y);
  697. break;
  698. case 3:
  699. chatButtons[0].drawSprite(203, 142 + y);
  700. break;
  701. case 4:
  702. chatButtons[0].drawSprite(269, 142 + y);
  703. break;
  704. case 5:
  705. chatButtons[0].drawSprite(335, 142 + y);
  706. break;
  707. case 6:
  708. chatButtons[3].drawSprite(404, 142 + y);
  709. break;
  710. }
  711. }
  712. smallText.method389(true, 425, 0xffffff, "Report Abuse", 157 + y);
  713. smallText.method389(true, 26, 0xffffff, "All", 157 + y);
  714. smallText.method389(true, 86, 0xffffff, "Game", 157 + y);
  715. smallText.method389(true, 150, 0xffffff, "Public", 152 + y);
  716. smallText.method389(true, 212, 0xffffff, "Private", 152 + y);
  717. smallText.method389(true, 286, 0xffffff, "Clan", 152 + y);
  718. smallText.method389(true, 349, 0xffffff, "Trade", 152 + y);
  719. smallText.method382(textColor[publicChatMode], 164,
  720. text[publicChatMode], 163 + y, true);
  721. smallText.method382(textColor[privateChatMode], 230,
  722. text[privateChatMode], 163 + y, true);
  723. smallText.method382(textColor[clanChatMode], 296,
  724. text[clanChatMode], 163 + y, true);
  725. smallText.method382(textColor[tradeMode], 362, text[tradeMode],
  726. 163 + y, true);
  727. }
  728. }
  729.  
  730. private void processChatToggle() {
  731. if (super.clickMode3 == 1) {
  732. if (displayChat) {
  733. if (super.saveClickX > 247 && super.saveClickX < 260
  734. && super.saveClickY > clientHeight - 173
  735. && super.saveClickY < clientHeight - 166)
  736. toggleChat();
  737. } else if (!displayChat) {
  738. if (super.saveClickX > 247 && super.saveClickX < 260
  739. && super.saveClickY > clientHeight - 15
  740. && super.saveClickY < clientHeight - 8)
  741. toggleChat();
  742. }
  743. }
  744. }
  745.  
  746. private void drawChatArea() {
  747. int color = 0;
  748. int yPosOffset = isFullScreen ? clientHeight - 166 : 0;
  749. int xPosOffset = isFullScreen ? 0 : 0;
  750. if (!isFullScreen)
  751. aRSImageProducer_1166.initDrawingArea();
  752. Texture.anIntArray1472 = anIntArray1180;
  753. int y = isFullScreen ? extraHeight + 334 : 0;
  754. if (isFullScreen && displayChat)
  755. chatArea.drawSprite2(0, 0 + y);
  756. else if (!isFullScreen) {
  757. chatArea.drawSprite(0, 0);
  758. DrawingArea.drawPixelsWithOpacity(0, 0, 520, 334, 60, 0);
  759. }
  760. drawChannelButtons();
  761. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  762.  
  763. if (displayChat || !isFullScreen) {
  764. if (messagePromptRaised) {
  765. chatTextDrawingArea.drawText(0, aString1121, 60 + y, 259);
  766. chatTextDrawingArea.drawText(128, promptInput + "*", 80 + y,
  767. 259);
  768. } else if (inputDialogState == 1) {
  769. chatTextDrawingArea.drawText(0, "Enter amount:", 60 + y, 259);
  770. chatTextDrawingArea.drawText(128, amountOrNameInput + "*",
  771. 80 + y, 259);
  772. } else if (inputDialogState == 2) {
  773. chatTextDrawingArea.drawText(0, "Enter name:", 60 + y, 259);
  774. chatTextDrawingArea.drawText(128, amountOrNameInput + "*",
  775. 80 + y, 259);
  776. } else if (aString844 != null) {
  777. chatTextDrawingArea.drawText(0, aString844, 60 + y, 259);
  778. chatTextDrawingArea.drawText(128, "Click to continue", 80 + y,
  779. 259);
  780. } else if (backDialogID != -1) {
  781. drawInterface(0, 20, RSInterface.interfaceCache[backDialogID],
  782. 20 + y);
  783. } else if (dialogID != -1d) {
  784. drawInterface(0, 20, RSInterface.interfaceCache[dialogID],
  785. 20 + y);
  786. } else {
  787. int j77 = -3;
  788. int j = 0;
  789. DrawingArea.setDrawingArea(122 + y, 8, 497, 7 + y);
  790.  
  791. for (int k = 0; k < 500; k++)
  792. if (chatMessages[k] != null) {
  793. int chatType = chatTypes[k];
  794. int yPos = (70 - j77 * 14) + anInt1089 + 5;
  795. String s1 = chatNames[k];
  796. byte byte0 = (byte) (chatRights[k]);
  797. if (chatType == 0) {
  798. if (chatTypeView == 5 || chatTypeView == 0) {
  799. if (yPos > 0 && yPos < 210)
  800. textDrawingArea.method389(false, 11, 0,
  801. chatMessages[k], yPos + y);// chat
  802. // color
  803. // enabled
  804. j++;
  805. j77++;
  806. }
  807. }
  808. /* Draws clickable URL text into chatarea */
  809. if (chatType == 9) {
  810. if (chatTypeView == 5 || chatTypeView == 0) {
  811. if (yPos > 0 && yPos < 210)
  812. textDrawingArea.method389(false, 11, 0,
  813. chatMessages[k] + "@blu@" + s1
  814. + "@bla@.", yPos + y);
  815. j++;
  816. j77++;
  817. }
  818. }
  819. if ((chatType == 1 || chatType == 2)
  820. && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1
  821. && isFriendOrSelf(s1))) {
  822. if (chatTypeView == 1 || chatTypeView == 0) {
  823. if (yPos > 0 && yPos < 210) {
  824. int xPos = 11;
  825. if (byte0 > 0) {
  826. modIcons[byte0]
  827. .drawBackground(
  828. xPos - 1,
  829. yPos
  830. - 5
  831. - (modIcons[byte0].anInt1453 / 2)
  832. + y);
  833. xPos += modIcons[byte0].anInt1452;
  834. }
  835. textDrawingArea.method385(color, s1 + ":",
  836. yPos + y, xPos);
  837. xPos += textDrawingArea.getTextWidth(s1) + 8;
  838. textDrawingArea.method389(false, xPos, 255,
  839. chatMessages[k], yPos + y);
  840. }
  841. j++;
  842. j77++;
  843. }
  844. }
  845. if ((chatType == 3 || chatType == 7)
  846. && (splitPrivateChat == 0 || chatTypeView == 2)
  847. && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1
  848. && isFriendOrSelf(s1))) {
  849. if (chatTypeView == 2 || chatTypeView == 0) {
  850. if (yPos > 0 && yPos < 210) {
  851. int k1 = 11;
  852. textDrawingArea.method385(0, "From", yPos
  853. + y, k1);
  854. k1 += textDrawingArea.getTextWidth("From ");
  855. if (byte0 > 0) {
  856. modIcons[byte0].drawBackground(k1, yPos
  857. - 12 + y);
  858. k1 += modIcons[byte0].anInt1452;
  859. }
  860. textDrawingArea.method385(color, s1 + ":",
  861. yPos + y, k1);
  862. k1 += textDrawingArea.getTextWidth(s1) + 8;
  863. textDrawingArea.method385(0x800000,
  864. chatMessages[k], yPos + y, k1);
  865. }
  866. j++;
  867. j77++;
  868. }
  869. }
  870. if (chatType == 4
  871. && (tradeMode == 0 || tradeMode == 1
  872. && isFriendOrSelf(s1))) {
  873. if (chatTypeView == 3 || chatTypeView == 0) {
  874. if (yPos > 0 && yPos < 210)
  875. textDrawingArea.method385(0x800080, s1
  876. + " " + chatMessages[k], yPos + y,
  877. 11);
  878. j++;
  879. j77++;
  880. }
  881. }
  882. if (chatType == 5 && splitPrivateChat == 0
  883. && privateChatMode < 2) {
  884. if (chatTypeView == 2 || chatTypeView == 0) {
  885. if (yPos > 0 && yPos < 210)
  886. textDrawingArea.method385(0x800000,
  887. chatMessages[k], yPos + y, 11);
  888. j++;
  889. j77++;
  890. }
  891. }
  892. if (chatType == 6
  893. && (splitPrivateChat == 0 || chatTypeView == 2)
  894. && privateChatMode < 2) {
  895. if (chatTypeView == 2 || chatTypeView == 0) {
  896. if (yPos > 0 && yPos < 210) {
  897. textDrawingArea.method385(0, "To " + s1
  898. + ":", yPos + y, 11);
  899. textDrawingArea.method385(0x800000,
  900. chatMessages[k], yPos + y,
  901. 15 + textDrawingArea
  902. .getTextWidth("To :" + s1));
  903. }
  904. j++;
  905. j77++;
  906. }
  907. }
  908. if (chatType == 8
  909. && (tradeMode == 0 || tradeMode == 1
  910. && isFriendOrSelf(s1))) {
  911. if (chatTypeView == 3 || chatTypeView == 0) {
  912. if (yPos > 0 && yPos < 210)
  913. textDrawingArea.method385(0x7e3200, s1
  914. + " " + chatMessages[k], yPos + y,
  915. 11);
  916. j++;
  917. j77++;
  918. }
  919. if (chatType == 11 && (clanChatMode == 0)) {
  920. if (chatTypeView == 11) {
  921. if (yPos > 0 && yPos < 210)
  922. textDrawingArea.method385(0x7e3200, s1
  923. + " " + chatMessages[k], yPos
  924. + y, 11);
  925. j++;
  926. j77++;
  927. }
  928. if (chatType == 12) {
  929. if (yPos > 0 && yPos < 110)
  930. textDrawingArea
  931. .method385(
  932. 0x7e3200,
  933. chatMessages[k]
  934. + " @blu@" + s1,
  935. yPos + y, 11);
  936. j++;
  937. }
  938. }
  939. }
  940. if (chatType == 16) {
  941. int j2 = 40;
  942. int clanNameWidth = textDrawingArea
  943. .getTextWidth(clanname);
  944. if (chatTypeView == 11 || chatTypeView == 0) {
  945. if (yPos > 0 && yPos < 210)
  946. switch (chatRights[k]) {
  947. case 1:
  948. j2 += clanNameWidth;
  949. modIcons[10]
  950. .drawBackground(
  951. j2 - 18,
  952. yPos
  953. - 12
  954. + (modIcons[10].anInt1453 / 2)
  955. + y);
  956. j2 += modIcons[10].anInt1452;
  957. break;
  958.  
  959. case 2:
  960. j2 += clanNameWidth;
  961. modIcons[15]
  962. .drawBackground(
  963. j2 - 18,
  964. yPos
  965. - 12
  966. + ((15 - modIcons[15].anInt1453) / 2)
  967. + y);
  968. j2 += modIcons[15].anInt1452;
  969. break;
  970.  
  971. default:
  972. j2 += clanNameWidth;
  973. break;
  974. }
  975. textDrawingArea.method385(0, "[", yPos + y, 8);
  976. textDrawingArea.method385(255, "" + clanname
  977. + "", yPos + y, 14);
  978. textDrawingArea.method385(0, "]", yPos + y,
  979. clanNameWidth + 14);
  980.  
  981. textDrawingArea.method385(0,
  982. chatNames[k] + ":", yPos + y, j2 - 17); // j2
  983. j2 += textDrawingArea
  984. .getTextWidth(chatNames[k]) + 7;
  985. textDrawingArea.method385(0x800000,
  986. chatMessages[k], yPos + y, j2 - 16);// j2
  987. j++;
  988. j77++;
  989. }
  990. }
  991. }
  992. DrawingArea.defaultDrawingAreaSize();
  993. anInt1211 = j * 14 + 7 + 5;
  994. if (anInt1211 < 111)
  995. anInt1211 = 111;
  996. drawScrollbar(114, anInt1211 - anInt1089 - 113, 7 + y, 496,
  997. anInt1211);
  998. String s;
  999. if (myPlayer != null && myPlayer.name != null)
  1000. s = myPlayer.name;
  1001. else
  1002. s = TextClass.fixName(myUsername);
  1003. textDrawingArea.method385(color, s + ":", 133 + y, 11);
  1004. textDrawingArea.drawChatInput(255,
  1005. 12 + textDrawingArea.getTextWidth(s + ": "),
  1006. inputString + "*", 133 + y, false);
  1007. DrawingArea.method339(121 + y, 0x807660, 506, 7);
  1008. }
  1009. if (menuOpen && menuScreenArea == 2) {
  1010. drawMenu();
  1011. }
  1012. if (!isFullScreen)
  1013. aRSImageProducer_1166.drawGraphics(338 + extraHeight,
  1014. isFullScreen ? bufferGraphics : super.graphics, 0);
  1015. aRSImageProducer_1165.initDrawingArea();
  1016. Texture.anIntArray1472 = anIntArray1182;
  1017. }
  1018. }
  1019.  
  1020. private Graphics bufferGraphics;
  1021. protected boolean webclient = false;
  1022. private Image buffer;
  1023.  
  1024. public void init() {
  1025. try {
  1026. nodeID = 10;
  1027. portOff = 0;
  1028. setHighMem();
  1029. isMembers = true;
  1030. initClientFrame(503, 765);
  1031. } catch (Exception exception) {
  1032. exception.printStackTrace();
  1033. return;
  1034. }
  1035. try {
  1036. readSettings();
  1037. } catch (IOException e) {
  1038. e.printStackTrace();
  1039. }
  1040.  
  1041. }
  1042.  
  1043. public void startRunnable(Runnable runnable, int i) {
  1044. if (i > 10)
  1045. i = 10;
  1046. if (signlink.mainapp != null) {
  1047. signlink.startthread(runnable, i);
  1048. } else {
  1049. super.startRunnable(runnable, i);
  1050. }
  1051. }
  1052.  
  1053. public Socket openSocket(int port) throws IOException {
  1054. return new Socket(InetAddress.getByName(SERVER_IP), port);
  1055. }
  1056.  
  1057. private void processMenuClick() {
  1058. if (activeInterfaceType != 0)
  1059. return;
  1060. int j = super.clickMode3;
  1061. if (spellSelected == 1 && super.saveClickX >= 503
  1062. && super.saveClickY >= 160 && super.saveClickX <= 765
  1063. && super.saveClickY <= 205)
  1064. j = 0;
  1065. if (menuOpen) {
  1066. if (j != 1) {
  1067. int k = super.mouseX;
  1068. int j1 = super.mouseY;
  1069. if (menuScreenArea == 0) {
  1070. k -= 4;
  1071. j1 -= 4;
  1072. }
  1073. if (menuScreenArea == 1) {
  1074. k -= 516;// 519
  1075. j1 -= 168;
  1076. }
  1077. if (menuScreenArea == 2) {
  1078. k -= 5;
  1079. j1 -= 338;
  1080. }
  1081. if (menuScreenArea == 3) {
  1082. k -= 516;// 519
  1083. j1 -= 0;
  1084. }
  1085. if (k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10
  1086. || j1 < menuOffsetY - 10
  1087. || j1 > menuOffsetY + menuHeight + 10) {
  1088. menuOpen = false;
  1089. if (menuScreenArea == 1)
  1090. needDrawTabArea = true;
  1091. if (menuScreenArea == 2)
  1092. inputTaken = true;
  1093. }
  1094. }
  1095. if (j == 1) {
  1096. int l = menuOffsetX;
  1097. int k1 = menuOffsetY;
  1098. int i2 = menuWidth;
  1099. int k2 = super.saveClickX;
  1100. int l2 = super.saveClickY;
  1101. if (menuScreenArea == 0) {
  1102. k2 -= 4;
  1103. l2 -= 4;
  1104. }
  1105. if (menuScreenArea == 1) {
  1106. k2 -= 516;// 519
  1107. l2 -= 168;
  1108. }
  1109. if (menuScreenArea == 2) {
  1110. k2 -= 5;// 17
  1111. l2 -= 338;
  1112. }
  1113. if (menuScreenArea == 3) {
  1114. k2 -= 516;// 519
  1115. l2 -= 0;
  1116. }
  1117. int i3 = -1;
  1118. for (int j3 = 0; j3 < menuActionRow; j3++) {
  1119. int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  1120. if (k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  1121. i3 = j3;
  1122. }
  1123. // System.out.println(i3);
  1124. if (i3 != -1)
  1125. doAction(i3);
  1126. menuOpen = false;
  1127. if (menuScreenArea == 1)
  1128. needDrawTabArea = true;
  1129. if (menuScreenArea == 2) {
  1130. inputTaken = true;
  1131. }
  1132. }
  1133. } else {
  1134. if (j == 1 && menuActionRow > 0) {
  1135. int i1 = menuActionID[menuActionRow - 1];
  1136. if (i1 == 632 || i1 == 78 || i1 == 867 || i1 == 431 || i1 == 53
  1137. || i1 == 74 || i1 == 454 || i1 == 539 || i1 == 493
  1138. || i1 == 847 || i1 == 447 || i1 == 1125) {
  1139. int l1 = menuActionCmd2[menuActionRow - 1];
  1140. int j2 = menuActionCmd3[menuActionRow - 1];
  1141. RSInterface class9 = RSInterface.interfaceCache[j2];
  1142. if (class9.aBoolean259 || class9.aBoolean235) {
  1143. aBoolean1242 = false;
  1144. anInt989 = 0;
  1145. anInt1084 = j2;
  1146. anInt1085 = l1;
  1147. activeInterfaceType = 2;
  1148. anInt1087 = super.saveClickX;
  1149. anInt1088 = super.saveClickY;
  1150. if (RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  1151. activeInterfaceType = 1;
  1152. if (RSInterface.interfaceCache[j2].parentID == backDialogID)
  1153. activeInterfaceType = 3;
  1154. return;
  1155. }
  1156. }
  1157. }
  1158. if (j == 1
  1159. && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1))
  1160. && menuActionRow > 2)
  1161. j = 2;
  1162. if (j == 1 && menuActionRow > 0)
  1163. doAction(menuActionRow - 1);
  1164. if (j == 2 && menuActionRow > 0)
  1165. determineMenuSize();
  1166.  
  1167. }
  1168. }
  1169.  
  1170. public static int totalRead = 0;
  1171.  
  1172. public static String getFileNameWithoutExtension(String fileName) {
  1173. if (fileName.contains(".rsmap"))
  1174. fileName = fileName.replace(".rsmap", "");
  1175. File tmpFile = new File(fileName);
  1176. tmpFile.getName();
  1177. int whereDot = tmpFile.getName().lastIndexOf('.');
  1178. if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2) {
  1179. return tmpFile.getName().substring(0, whereDot);
  1180. }
  1181. return "";// erm well when he gave me it he said i need to make my own cache dler could that be the problem?idk
  1182. }
  1183.  
  1184. /*public void preloadModels() {
  1185. File file = new File(signlink.findcachedir() + "Raw/");
  1186. File[] fileArray = file.listFiles();
  1187. for (int y = 0; y < fileArray.length; y++) {
  1188. String s = fileArray[y].getName();
  1189. byte[] buffer = ReadFile(signlink.findcachedir() + "Raw/" + s);
  1190. Model.method460(buffer,
  1191. Integer.parseInt(getFileNameWithoutExtension(s)));
  1192. }
  1193. }*/
  1194.  
  1195. public void preloadMaps() {
  1196. /*
  1197. * File file = new File(signlink.findcachedir() + "maps/"); File[]
  1198. * fileArray = file.listFiles(); for(int y = 0; y < fileArray.length;
  1199. * y++) { String s = fileArray[y].getName(); byte[] buffer = null;
  1200. *
  1201. * buffer = ReadFile(signlink.findcachedir() + "maps/"+s);
  1202. * decompressors[4].method234(buffer.length, buffer,
  1203. * Integer.parseInt(getFileNameWithoutExtension(s)));
  1204. * //Model.method460(buffer
  1205. * ,Integer.parseInt(getFileNameWithoutExtension(s))); }
  1206. */
  1207. preloadMaps2();
  1208. }
  1209.  
  1210. public void preloadMaps2() {
  1211. /*
  1212. * File file = new File(signlink.findcachedir() + "maps2/"); File[]
  1213. * fileArray = file.listFiles(); for(int y = 0; y < fileArray.length;
  1214. * y++) { String s = fileArray[y].getName(); byte[] buffer = null;
  1215. * buffer = gzipCompress(ReadFile(signlink.findcachedir() +
  1216. * "maps2/"+s)); decompressors[4].method234(buffer.length, buffer,
  1217. * Integer.parseInt(getFileNameWithoutExtension(s)));
  1218. * //Model.method460(buffer
  1219. * ,Integer.parseInt(getFileNameWithoutExtension(s))); }
  1220. */
  1221. }
  1222.  
  1223. public byte[] gzipCompress(byte[] data) {
  1224. ByteArrayOutputStream bys = new ByteArrayOutputStream();
  1225. try {
  1226. GZIPOutputStream gis = new GZIPOutputStream(bys);
  1227. gis.write(data);
  1228. gis.close();
  1229. } catch (IOException e) {
  1230. throw new RuntimeException(e);
  1231. }
  1232. return bys.toByteArray();
  1233. }
  1234.  
  1235. private void saveMidi(boolean flag, byte abyte0[]) {
  1236. signlink.midifade = flag ? 1 : 0;
  1237. signlink.midisave(abyte0, abyte0.length);
  1238. }
  1239.  
  1240. private void method22() {
  1241. try {
  1242. anInt985 = -1;
  1243. aClass19_1056.removeAll();
  1244. aClass19_1013.removeAll();
  1245. Texture.method366();
  1246. unlinkMRUNodes();
  1247. worldController.initToNull();
  1248. System.gc();
  1249. for (int i = 0; i < 4; i++)
  1250. aClass11Array1230[i].method210();
  1251.  
  1252. for (int l = 0; l < 4; l++) {
  1253. for (int k1 = 0; k1 < 104; k1++) {
  1254. for (int j2 = 0; j2 < 104; j2++)
  1255. byteGroundArray[l][k1][j2] = 0;
  1256.  
  1257. }
  1258.  
  1259. }
  1260.  
  1261. ObjectManager objectManager = new ObjectManager(byteGroundArray,
  1262. intGroundArray);
  1263. int k2 = aByteArrayArray1183.length;
  1264. stream.createFrame(0);
  1265. if (!aBoolean1159) {
  1266. for (int i3 = 0; i3 < k2; i3++) {
  1267. int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  1268. int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  1269. byte abyte0[] = aByteArrayArray1183[i3];
  1270. if (FileOperations.FileExists(signlink.findcachedir()
  1271. + "maps/" + anIntArray1235[i3] + ".dat"))
  1272. abyte0 = FileOperations.ReadFile(signlink
  1273. .findcachedir()
  1274. + "maps/"
  1275. + anIntArray1235[i3]
  1276. + ".dat");
  1277. if (abyte0 != null)
  1278. objectManager.method180(abyte0, k5, i4,
  1279. (anInt1069 - 6) * 8, (anInt1070 - 6) * 8,
  1280. aClass11Array1230);
  1281. }
  1282.  
  1283. for (int j4 = 0; j4 < k2; j4++) {
  1284. int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  1285. int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  1286. byte abyte2[] = aByteArrayArray1183[j4];
  1287. if (abyte2 == null && anInt1070 < 800)
  1288. objectManager.method174(k7, 64, 64, l5);
  1289. }
  1290.  
  1291. anInt1097++;
  1292. if (anInt1097 > 160) {
  1293. anInt1097 = 0;
  1294. stream.createFrame(238);
  1295. stream.writeWordBigEndian(96);
  1296. }
  1297. stream.createFrame(0);
  1298. for (int i6 = 0; i6 < k2; i6++) {
  1299. byte abyte1[] = aByteArrayArray1247[i6];
  1300. if (abyte1 != null) {
  1301. int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  1302. int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  1303. objectManager.method190(l8, aClass11Array1230, k9,
  1304. worldController, abyte1);
  1305. }
  1306. }
  1307.  
  1308. }
  1309. if (aBoolean1159) {
  1310. for (int j3 = 0; j3 < 4; j3++) {
  1311. for (int k4 = 0; k4 < 13; k4++) {
  1312. for (int j6 = 0; j6 < 13; j6++) {
  1313. int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  1314. if (l7 != -1) {
  1315. int i9 = l7 >> 24 & 3;
  1316. int l9 = l7 >> 1 & 3;
  1317. int j10 = l7 >> 14 & 0x3ff;
  1318. int l10 = l7 >> 3 & 0x7ff;
  1319. int j11 = (j10 / 8 << 8) + l10 / 8;
  1320. for (int l11 = 0; l11 < anIntArray1234.length; l11++) {
  1321. if (anIntArray1234[l11] != j11
  1322. || aByteArrayArray1183[l11] == null)
  1323. continue;
  1324. objectManager.method179(i9, l9,
  1325. aClass11Array1230, k4 * 8,
  1326. (j10 & 7) * 8,
  1327. aByteArrayArray1183[l11],
  1328. (l10 & 7) * 8, j3, j6 * 8);
  1329. break;
  1330. }
  1331.  
  1332. }
  1333. }
  1334.  
  1335. }
  1336.  
  1337. }
  1338.  
  1339. for (int l4 = 0; l4 < 13; l4++) {
  1340. for (int k6 = 0; k6 < 13; k6++) {
  1341. int i8 = anIntArrayArrayArray1129[0][l4][k6];
  1342. if (i8 == -1)
  1343. objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  1344. }
  1345.  
  1346. }
  1347.  
  1348. stream.createFrame(0);
  1349. for (int l6 = 0; l6 < 4; l6++) {
  1350. for (int j8 = 0; j8 < 13; j8++) {
  1351. for (int j9 = 0; j9 < 13; j9++) {
  1352. int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  1353. if (i10 != -1) {
  1354. int k10 = i10 >> 24 & 3;
  1355. int i11 = i10 >> 1 & 3;
  1356. int k11 = i10 >> 14 & 0x3ff;
  1357. int i12 = i10 >> 3 & 0x7ff;
  1358. int j12 = (k11 / 8 << 8) + i12 / 8;
  1359. for (int k12 = 0; k12 < anIntArray1234.length; k12++) {
  1360. if (anIntArray1234[k12] != j12
  1361. || aByteArrayArray1247[k12] == null)
  1362. continue;
  1363. // objectManager.method183(aClass11Array1230,
  1364. // worldController, k10, j8 * 8, (i12 & 7) *
  1365. // 8, l6, aByteArrayArray1247[k12], (k11 &
  1366. // 7) * 8, i11, j9 * 8);
  1367. byte abyte0[] = aByteArrayArray1247[k12];
  1368. if (FileOperations.FileExists(signlink
  1369. .findcachedir()
  1370. + "maps/"
  1371. + anIntArray1235[k12] + ".dat"))
  1372. abyte0 = FileOperations
  1373. .ReadFile(signlink
  1374. .findcachedir()
  1375. + "maps/"
  1376. + anIntArray1235[k12]
  1377. + ".dat");
  1378. objectManager.method183(aClass11Array1230,
  1379. worldController, k10, j8 * 8,
  1380. (i12 & 7) * 8, l6,
  1381. aByteArrayArray1247[k12],
  1382. (k11 & 7) * 8, i11, j9 * 8);
  1383. break;
  1384. }
  1385.  
  1386. }
  1387. }
  1388.  
  1389. }
  1390.  
  1391. }
  1392.  
  1393. }
  1394. stream.createFrame(0);
  1395. objectManager.method171(aClass11Array1230, worldController);
  1396. aRSImageProducer_1165.initDrawingArea();
  1397. stream.createFrame(0);
  1398. int k3 = ObjectManager.anInt145;
  1399. if (k3 > plane)
  1400. k3 = plane;
  1401. if (k3 < plane - 1)
  1402. k3 = plane - 1;
  1403. if (lowMem)
  1404. worldController.method275(ObjectManager.anInt145);
  1405. else
  1406. worldController.method275(0);
  1407. for (int i5 = 0; i5 < 104; i5++) {
  1408. for (int i7 = 0; i7 < 104; i7++)
  1409. spawnGroundItem(i5, i7);
  1410.  
  1411. }
  1412.  
  1413. anInt1051++;
  1414. if (anInt1051 > 98) {
  1415. anInt1051 = 0;
  1416. stream.createFrame(150);
  1417. }
  1418. method63();
  1419. } catch (Exception exception) {
  1420. }
  1421. ObjectDef.mruNodes1.unlinkAll();
  1422. // if (super.gameFrame != null) {
  1423. stream.createFrame(210);
  1424. stream.writeDWord(0x3f008edd);
  1425. // }
  1426. System.gc();
  1427. Texture.method367();
  1428. onDemandFetcher.method566();
  1429. int k = (anInt1069 - 6) / 8 - 1;
  1430. int j1 = (anInt1069 + 6) / 8 + 1;
  1431. int i2 = (anInt1070 - 6) / 8 - 1;
  1432. int l2 = (anInt1070 + 6) / 8 + 1;
  1433. if (aBoolean1141) {
  1434. k = 49;
  1435. j1 = 50;
  1436. i2 = 49;
  1437. l2 = 50;
  1438. }
  1439. for (int l3 = k; l3 <= j1; l3++) {
  1440. for (int j5 = i2; j5 <= l2; j5++)
  1441. if (l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
  1442. int j7 = onDemandFetcher.method562(0, j5, l3);
  1443. if (j7 != -1)
  1444. onDemandFetcher.method560(j7, 3);
  1445. int k8 = onDemandFetcher.method562(1, j5, l3);
  1446. if (k8 != -1)
  1447. onDemandFetcher.method560(k8, 3);
  1448. }
  1449.  
  1450. }
  1451.  
  1452. }
  1453.  
  1454. private void unlinkMRUNodes() {
  1455. ObjectDef.mruNodes1.unlinkAll();
  1456. ObjectDef.mruNodes2.unlinkAll();
  1457. EntityDef.mruNodes.unlinkAll();
  1458. ItemDef.mruNodes2.unlinkAll();
  1459. ItemDef.mruNodes1.unlinkAll();
  1460. Player.mruNodes.unlinkAll();
  1461. SpotAnim.aMRUNodes_415.unlinkAll();
  1462. }
  1463.  
  1464. public long clickWeild = System.nanoTime();
  1465.  
  1466. private void method24(int i) {
  1467. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  1468. int j = ai.length;
  1469. for (int k = 0; k < j; k++)
  1470. ai[k] = 0;
  1471.  
  1472. for (int l = 1; l < 103; l++) {
  1473. int i1 = 24628 + (103 - l) * 512 * 4;
  1474. for (int k1 = 1; k1 < 103; k1++) {
  1475. if ((byteGroundArray[i][k1][l] & 0x18) == 0)
  1476. worldController.method309(ai, i1, i, k1, l);
  1477. if (i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  1478. worldController.method309(ai, i1, i + 1, k1, l);
  1479. i1 += 4;
  1480. }
  1481.  
  1482. }
  1483.  
  1484. int j1 = ((238 + (int) (Math.random() * 20D)) - 10 << 16)
  1485. + ((238 + (int) (Math.random() * 20D)) - 10 << 8)
  1486. + ((238 + (int) (Math.random() * 20D)) - 10);
  1487. int l1 = (238 + (int) (Math.random() * 20D)) - 10 << 16;
  1488. aClass30_Sub2_Sub1_Sub1_1263.method343();
  1489. for (int i2 = 1; i2 < 103; i2++) {
  1490. for (int j2 = 1; j2 < 103; j2++) {
  1491. if ((byteGroundArray[i][j2][i2] & 0x18) == 0)
  1492. method50(i2, j1, j2, l1, i);
  1493. if (i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  1494. method50(i2, j1, j2, l1, i + 1);
  1495. }
  1496.  
  1497. }
  1498.  
  1499. aRSImageProducer_1165.initDrawingArea();
  1500. anInt1071 = 0;
  1501. for (int k2 = 0; k2 < 104; k2++) {
  1502. for (int l2 = 0; l2 < 104; l2++) {
  1503. int i3 = worldController.method303(plane, k2, l2);
  1504. if (i3 != 0) {
  1505. i3 = i3 >> 14 & 0x7fff;
  1506. int j3 = ObjectDef.forID(i3).anInt746;
  1507. if (j3 >= 0) {
  1508. int k3 = k2;
  1509. int l3 = l2;
  1510. if (j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36
  1511. && j3 != 46 && j3 != 47 && j3 != 48) {
  1512. byte byte0 = 104;
  1513. byte byte1 = 104;
  1514. int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  1515. for (int i4 = 0; i4 < 10; i4++) {
  1516. int j4 = (int) (Math.random() * 4D);
  1517. if (j4 == 0 && k3 > 0 && k3 > k2 - 3
  1518. && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  1519. k3--;
  1520. if (j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3
  1521. && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  1522. k3++;
  1523. if (j4 == 2 && l3 > 0 && l3 > l2 - 3
  1524. && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  1525. l3--;
  1526. if (j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3
  1527. && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  1528. l3++;
  1529. }
  1530.  
  1531. }
  1532. aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  1533. anIntArray1072[anInt1071] = k3;
  1534. anIntArray1073[anInt1071] = l3;
  1535. anInt1071++;
  1536. }
  1537. }
  1538. }
  1539.  
  1540. }
  1541.  
  1542. }
  1543.  
  1544. private void spawnGroundItem(int i, int j) {
  1545. NodeList class19 = groundArray[plane][i][j];
  1546. if (class19 == null) {
  1547. worldController.method295(plane, i, j);
  1548. return;
  1549. }
  1550. int k = 0xfa0a1f01;
  1551. Object obj = null;
  1552. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  1553. .reverseGetNext()) {
  1554. ItemDef itemDef = ItemDef.forID(item.ID);
  1555. int l = itemDef.value;
  1556. if (itemDef.stackable)
  1557. l *= item.anInt1559 + 1;
  1558. // notifyItemSpawn(item, i + baseX, j + baseY);
  1559.  
  1560. if (l > k) {
  1561. k = l;
  1562. obj = item;
  1563. }
  1564. }
  1565.  
  1566. class19.insertTail(((Node) (obj)));
  1567. Object obj1 = null;
  1568. Object obj2 = null;
  1569. for (Item class30_sub2_sub4_sub2_1 = (Item) class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item) class19
  1570. .reverseGetNext()) {
  1571. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1572. && obj1 == null)
  1573. obj1 = class30_sub2_sub4_sub2_1;
  1574. if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID
  1575. && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID
  1576. && obj2 == null)
  1577. obj2 = class30_sub2_sub4_sub2_1;
  1578. }
  1579.  
  1580. int i1 = i + (j << 7) + 0x60000000;
  1581. worldController.method281(i, i1, ((Animable) (obj1)),
  1582. method42(plane, j * 128 + 64, i * 128 + 64),
  1583. ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  1584. }
  1585.  
  1586. private void method26(boolean flag) {
  1587. for (int j = 0; j < npcCount; j++) {
  1588. NPC npc = npcArray[npcIndices[j]];
  1589. int k = 0x20000000 + (npcIndices[j] << 14);
  1590. if (npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  1591. continue;
  1592. int l = npc.x >> 7;
  1593. int i1 = npc.y >> 7;
  1594. if (l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  1595. continue;
  1596. if (npc.anInt1540 == 1 && (npc.x & 0x7f) == 64
  1597. && (npc.y & 0x7f) == 64) {
  1598. if (anIntArrayArray929[l][i1] == anInt1265)
  1599. continue;
  1600. anIntArrayArray929[l][i1] = anInt1265;
  1601. }
  1602. if (!npc.desc.aBoolean84)
  1603. k += 0x80000000;
  1604. worldController
  1605. .method285(plane, npc.anInt1552,
  1606. method42(plane, npc.y, npc.x), k, npc.y,
  1607. (npc.anInt1540 - 1) * 64 + 60, npc.x, npc,
  1608. npc.aBoolean1541);
  1609. }
  1610. }
  1611.  
  1612. private boolean replayWave() {
  1613. return signlink.wavereplay();
  1614. }
  1615.  
  1616. private void loadError() {
  1617. String s = "ondemand";// was a constant parameter
  1618. System.out.println(s);
  1619. try {
  1620. getAppletContext().showDocument(
  1621. new URL(getCodeBase(), "loaderror_" + s + ".html"));
  1622. } catch (Exception exception) {
  1623. exception.printStackTrace();
  1624. }
  1625. do
  1626. try {
  1627. Thread.sleep(1000L);
  1628. } catch (Exception _ex) {
  1629. }
  1630. while (true);
  1631. }
  1632.  
  1633. private void buildInterfaceMenu(int i, RSInterface class9, int k, int l,
  1634. int i1, int j1) {
  1635. if (class9.type != 0 || class9.children == null
  1636. || class9.isMouseoverTriggered)
  1637. return;
  1638. if (k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  1639. return;
  1640. int k1 = class9.children.length;
  1641. for (int l1 = 0; l1 < k1; l1++) {
  1642. int i2 = class9.childX[l1] + i;
  1643. int j2 = (class9.childY[l1] + l) - j1;
  1644. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  1645. i2 += class9_1.anInt263;
  1646. j2 += class9_1.anInt265;
  1647. if ((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0)
  1648. && k >= i2 && i1 >= j2 && k < i2 + class9_1.width
  1649. && i1 < j2 + class9_1.height)
  1650. if (class9_1.mOverInterToTrigger >= 0)
  1651. anInt886 = class9_1.mOverInterToTrigger;
  1652. else
  1653. anInt886 = class9_1.id;
  1654. if (class9_1.type == 8 && k >= i2 && i1 >= j2
  1655. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1656. anInt1315 = class9_1.id;
  1657. }
  1658. if (class9_1.type == 0) {
  1659. buildInterfaceMenu(i2, class9_1, k, j2, i1,
  1660. class9_1.scrollPosition);
  1661. if (class9_1.scrollMax > class9_1.height)
  1662. method65(i2 + class9_1.width, class9_1.height, k, i1,
  1663. class9_1, j2, true, class9_1.scrollMax);
  1664. } else {
  1665. if (class9_1.atActionType == 1 && k >= i2 && i1 >= j2
  1666. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1667. boolean flag = false;
  1668. if (class9_1.contentType != 0)
  1669. flag = buildFriendsListMenu(class9_1);
  1670. if (!flag) {
  1671. // System.out.println("1"+class9_1.tooltip + ", " +
  1672. // class9_1.interfaceID);
  1673. menuActionName[menuActionRow] = class9_1.tooltip;// +
  1674. // ", "
  1675. // +
  1676. // class9_1.id;
  1677. menuActionID[menuActionRow] = 315;
  1678. menuActionCmd3[menuActionRow] = class9_1.id;
  1679. menuActionRow++;
  1680. }
  1681. }
  1682. if (class9_1.atActionType == 2 && spellSelected == 0 && k >= i2
  1683. && i1 >= j2 && k < i2 + class9_1.width
  1684. && i1 < j2 + class9_1.height) {
  1685. String s = class9_1.selectedActionName;
  1686. if (s.indexOf(" ") != -1)
  1687. s = s.substring(0, s.indexOf(" "));
  1688. menuActionName[menuActionRow] = s + " @gre@"
  1689. + class9_1.spellName;// + ", " + class9_1.id;
  1690. // menuActionName[menuActionRow] = s + " @gre@" +
  1691. // class9_1.spellName;
  1692. menuActionID[menuActionRow] = 626;
  1693. menuActionCmd3[menuActionRow] = class9_1.id;
  1694.  
  1695. menuActionRow++;
  1696. }
  1697. if (class9_1.atActionType == 3 && k >= i2 && i1 >= j2
  1698. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1699. menuActionName[menuActionRow] = "Close";
  1700. menuActionID[menuActionRow] = 200;
  1701. menuActionCmd3[menuActionRow] = class9_1.id;
  1702. menuActionRow++;
  1703. }
  1704. if (class9_1.atActionType == 4 && k >= i2 && i1 >= j2
  1705. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1706. // System.out.println("2"+class9_1.tooltip + ", " +
  1707. // class9_1.interfaceID);
  1708. menuActionName[menuActionRow] = class9_1.tooltip;// + ", " +
  1709. // class9_1.id;
  1710. menuActionID[menuActionRow] = 169;
  1711. menuActionCmd3[menuActionRow] = class9_1.id;
  1712. menuActionRow++;
  1713. if (class9_1.hoverText != null) {
  1714. // drawHoverBox(k, l, class9_1.hoverText);
  1715. // System.out.println("DRAWING INTERFACE: " +
  1716. // class9_1.hoverText);
  1717. }
  1718. }
  1719. if (class9_1.atActionType == 5 && k >= i2 && i1 >= j2
  1720. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1721. // System.out.println("3"+class9_1.tooltip + ", " +
  1722. // class9_1.interfaceID);
  1723. menuActionName[menuActionRow] = class9_1.tooltip;
  1724. menuActionID[menuActionRow] = 646;
  1725. menuActionCmd3[menuActionRow] = class9_1.id;
  1726. menuActionRow++;
  1727. }
  1728. if (class9_1.atActionType == 6 && !aBoolean1149 && k >= i2
  1729. && i1 >= j2 && k < i2 + class9_1.width
  1730. && i1 < j2 + class9_1.height) {
  1731. // System.out.println("4"+class9_1.tooltip + ", " +
  1732. // class9_1.interfaceID);
  1733. menuActionName[menuActionRow] = class9_1.tooltip;
  1734. menuActionID[menuActionRow] = 679;
  1735. menuActionCmd3[menuActionRow] = class9_1.id;
  1736. menuActionRow++;
  1737. }
  1738. if (class9_1.type == 9 && k >= i2 && i1 >= j2
  1739. && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  1740. anInt1315 = class9_1.id;
  1741. }
  1742. if (class9_1.type == 2) {
  1743. int k2 = 0;
  1744. for (int l2 = 0; l2 < class9_1.height; l2++) {
  1745. for (int i3 = 0; i3 < class9_1.width; i3++) {
  1746. int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1747. int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1748. if (k2 < 20) {
  1749. j3 += class9_1.spritesX[k2];
  1750. k3 += class9_1.spritesY[k2];
  1751. }
  1752. if (k >= j3 && i1 >= k3 && k < j3 + 32
  1753. && i1 < k3 + 32) {
  1754. mouseInvInterfaceIndex = k2;
  1755. lastActiveInvInterface = class9_1.id;
  1756. if (class9_1.inv[k2] > 0) {
  1757. ItemDef itemDef = ItemDef
  1758. .forID(class9_1.inv[k2] - 1);
  1759. if (itemSelected == 1
  1760. && class9_1.isInventoryInterface) {
  1761. if (class9_1.id != anInt1284
  1762. || k2 != anInt1283) {
  1763. menuActionName[menuActionRow] = "Use "
  1764. + selectedItemName
  1765. + " with @lre@"
  1766. + itemDef.name;
  1767. menuActionID[menuActionRow] = 870;
  1768. menuActionCmd1[menuActionRow] = itemDef.id;
  1769. menuActionCmd2[menuActionRow] = k2;
  1770. menuActionCmd3[menuActionRow] = class9_1.id;
  1771. menuActionRow++;
  1772. }
  1773. } else if (spellSelected == 1
  1774. && class9_1.isInventoryInterface) {
  1775. if ((spellUsableOn & 0x10) == 16) {
  1776. menuActionName[menuActionRow] = spellTooltip
  1777. + " @lre@" + itemDef.name;
  1778. menuActionID[menuActionRow] = 543;
  1779. menuActionCmd1[menuActionRow] = itemDef.id;
  1780. menuActionCmd2[menuActionRow] = k2;
  1781. menuActionCmd3[menuActionRow] = class9_1.id;
  1782. menuActionRow++;
  1783. }
  1784. } else {
  1785. if (class9_1.isInventoryInterface) {
  1786. for (int l3 = 4; l3 >= 3; l3--)
  1787. if (itemDef.actions != null
  1788. && itemDef.actions[l3] != null) {
  1789. menuActionName[menuActionRow] = itemDef.actions[l3]
  1790. + " @lre@"
  1791. + itemDef.name;
  1792. if (l3 == 3)
  1793. menuActionID[menuActionRow] = 493;
  1794. if (l3 == 4)
  1795. menuActionID[menuActionRow] = 847;
  1796. menuActionCmd1[menuActionRow] = itemDef.id;
  1797. menuActionCmd2[menuActionRow] = k2;
  1798. menuActionCmd3[menuActionRow] = class9_1.id;
  1799. menuActionRow++;
  1800. } else if (l3 == 4) {
  1801. menuActionName[menuActionRow] = "Drop @lre@"
  1802. + itemDef.name;
  1803. menuActionID[menuActionRow] = 847;
  1804. menuActionCmd1[menuActionRow] = itemDef.id;
  1805. menuActionCmd2[menuActionRow] = k2;
  1806. menuActionCmd3[menuActionRow] = class9_1.id;
  1807. menuActionRow++;
  1808. }
  1809.  
  1810. }
  1811. if (class9_1.usableItemInterface) {
  1812. menuActionName[menuActionRow] = "Use @lre@"
  1813. + itemDef.name;
  1814. menuActionID[menuActionRow] = 447;
  1815. menuActionCmd1[menuActionRow] = itemDef.id;
  1816. // k2 = inventory spot
  1817. // System.out.println(k2);
  1818. menuActionCmd2[menuActionRow] = k2;
  1819. menuActionCmd3[menuActionRow] = class9_1.id;
  1820. menuActionRow++;
  1821. }
  1822. if (class9_1.isInventoryInterface
  1823. && itemDef.actions != null) {
  1824. for (int i4 = 2; i4 >= 0; i4--)
  1825. if (itemDef.actions[i4] != null) {
  1826. menuActionName[menuActionRow] = itemDef.actions[i4]
  1827. + " @lre@"
  1828. + itemDef.name;
  1829. if (i4 == 0)
  1830. menuActionID[menuActionRow] = 74;
  1831. if (i4 == 1)
  1832. menuActionID[menuActionRow] = 454;
  1833. if (i4 == 2)
  1834. menuActionID[menuActionRow] = 539;
  1835. menuActionCmd1[menuActionRow] = itemDef.id;
  1836. menuActionCmd2[menuActionRow] = k2;
  1837. menuActionCmd3[menuActionRow] = class9_1.id;
  1838. menuActionRow++;
  1839. }
  1840.  
  1841. }
  1842. if (class9_1.actions != null) {
  1843. for (int j4 = 4; j4 >= 0; j4--)
  1844. if (class9_1.actions[j4] != null) {
  1845. menuActionName[menuActionRow] = class9_1.actions[j4]
  1846. + " @lre@"
  1847. + itemDef.name;
  1848. if (j4 == 0)
  1849. menuActionID[menuActionRow] = 632;
  1850. if (j4 == 1)
  1851. menuActionID[menuActionRow] = 78;
  1852. if (j4 == 2)
  1853. menuActionID[menuActionRow] = 867;
  1854. if (j4 == 3)
  1855. menuActionID[menuActionRow] = 431;
  1856. if (j4 == 4)
  1857. menuActionID[menuActionRow] = 53;
  1858. menuActionCmd1[menuActionRow] = itemDef.id;
  1859. menuActionCmd2[menuActionRow] = k2;
  1860. menuActionCmd3[menuActionRow] = class9_1.id;
  1861. menuActionRow++;
  1862. }
  1863.  
  1864. }
  1865. // menuActionName[menuActionRow] =
  1866. // "Examine @lre@" + itemDef.name +
  1867. // " @gre@(@whi@" + (class9_1.inv[k2] -
  1868. // 1) + "@gre@)";
  1869. menuActionName[menuActionRow] = "Examine @lre@"
  1870. + itemDef.name;
  1871. menuActionID[menuActionRow] = 1125;
  1872. menuActionCmd1[menuActionRow] = itemDef.id;
  1873. menuActionCmd2[menuActionRow] = k2;
  1874. menuActionCmd3[menuActionRow] = class9_1.id;
  1875. menuActionRow++;
  1876. }
  1877. }
  1878. }
  1879. k2++;
  1880. }
  1881.  
  1882. }
  1883.  
  1884. }
  1885. }
  1886. }
  1887.  
  1888. }
  1889.  
  1890. public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1891. scrollBar1.drawSprite(i1, l);
  1892. scrollBar2.drawSprite(i1, (l + j) - 16);
  1893. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1894. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1895. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1896. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1897. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1898. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1899. DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1900. int k1 = ((j - 32) * j) / j1;
  1901. if (k1 < 8)
  1902. k1 = 8;
  1903. int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1904. DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1905. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1906. DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1907. DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1908. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1909. DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1910. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1911. DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1912. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1913. DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1914. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1915. DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1916. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1917. DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1918. DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1919. DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1920. DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1921. DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1922. DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1923. DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1924. DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1925. DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1926. DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1927. DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1928. DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1929. DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1930. DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1931. DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1932. DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1933. DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1934. DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1935. DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1936. DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1937. DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1938. DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1939. DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1940. DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1941. DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1942. DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1943. DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1944. DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1945. DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1946. DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1947. DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1948. DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1949. DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1950. DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1951. DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1952. DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1953. DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1954. DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1955. DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1956. DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1957. DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1958. DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1959. DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1960. DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1961. DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1962. DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1963. DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1964. DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1965. DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1966. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1967. DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1968. DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1969. DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1970. DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1971. DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1972. DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1973. DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1974. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1975. DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1976. DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1977. DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1978. DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1979. DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1980. DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1981. DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1982. DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1983. DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1984. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1985. DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1986. DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1987. DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1988. DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1989. DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1990. DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1991. DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1992. DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1993. DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1994. DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1995. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1996. DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1997. DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1998. DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1999. DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  2000. DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  2001. DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  2002. DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  2003. DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  2004. DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  2005. DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  2006. DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  2007. }
  2008.  
  2009. private void updateNPCs(Stream stream, int i) {
  2010. anInt839 = 0;
  2011. anInt893 = 0;
  2012. method139(stream);
  2013. method46(i, stream);
  2014. method86(stream);
  2015. for (int k = 0; k < anInt839; k++) {
  2016. int l = anIntArray840[k];
  2017. if (npcArray[l].anInt1537 != loopCycle) {
  2018. npcArray[l].desc = null;
  2019. npcArray[l] = null;
  2020. }
  2021. }
  2022.  
  2023. if (stream.currentOffset != i) {
  2024. signlink.reporterror(myUsername
  2025. + " size mismatch in getnpcpos - pos:"
  2026. + stream.currentOffset + " psize:" + i);
  2027. throw new RuntimeException("eek");
  2028. }
  2029. for (int i1 = 0; i1 < npcCount; i1++)
  2030. if (npcArray[npcIndices[i1]] == null) {
  2031. signlink.reporterror(myUsername
  2032. + " null entry in npc list - pos:" + i1 + " size:"
  2033. + npcCount);
  2034. throw new RuntimeException("eek");
  2035. }
  2036.  
  2037. }
  2038.  
  2039. private int cButtonHPos;
  2040. private int cButtonHCPos;
  2041. private int cButtonCPos;
  2042.  
  2043. private void processChatModeClick() {
  2044. int x = isFullScreen ? extraWidth : 0;
  2045. int y = isFullScreen ? extraHeight : 0;
  2046. if (displayChat) {
  2047. if (super.mouseX >= 5 && super.mouseX <= 61
  2048. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  2049. cButtonHPos = 0;
  2050. aBoolean1233 = true;
  2051. inputTaken = true;
  2052. } else if (super.mouseX >= 71 && super.mouseX <= 127
  2053. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  2054. cButtonHPos = 1;
  2055. aBoolean1233 = true;
  2056. inputTaken = true;
  2057. } else if (super.mouseX >= 137 && super.mouseX <= 193
  2058. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  2059. cButtonHPos = 2;
  2060. aBoolean1233 = true;
  2061. inputTaken = true;
  2062. } else if (super.mouseX >= 203 && super.mouseX <= 259
  2063. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  2064. cButtonHPos = 3;
  2065. aBoolean1233 = true;
  2066. inputTaken = true;
  2067. } else if (super.mouseX >= 269 && super.mouseX <= 325
  2068. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  2069. cButtonHPos = 4;
  2070. aBoolean1233 = true;
  2071. inputTaken = true;
  2072. } else if (super.mouseX >= 335 && super.mouseX <= 391
  2073. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  2074. cButtonHPos = 5;
  2075. aBoolean1233 = true;
  2076. inputTaken = true;
  2077. } else if (super.mouseX >= 404 && super.mouseX <= 515
  2078. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  2079. cButtonHPos = 6;
  2080. aBoolean1233 = true;
  2081. inputTaken = true;
  2082. } else {
  2083. cButtonHPos = -1;
  2084. aBoolean1233 = true;
  2085. inputTaken = true;
  2086. }
  2087. if (super.clickMode3 == 1) {
  2088. if (super.saveClickX >= 5 && super.saveClickX <= 61
  2089. && super.saveClickY >= 482 + y
  2090. && super.saveClickY <= 505 + y) {
  2091. cButtonCPos = 0;
  2092. chatTypeView = 0;
  2093. aBoolean1233 = true;
  2094. inputTaken = true;
  2095. } else if (super.saveClickX >= 71 && super.saveClickX <= 127
  2096. && super.saveClickY >= 482 + y
  2097. && super.saveClickY <= 505 + y) {
  2098. cButtonCPos = 1;
  2099. chatTypeView = 5;
  2100. aBoolean1233 = true;
  2101. inputTaken = true;
  2102. } else if (super.saveClickX >= 137 && super.saveClickX <= 193
  2103. && super.saveClickY >= 482 + y
  2104. && super.saveClickY <= 505 + y) {
  2105. cButtonCPos = 2;
  2106. chatTypeView = 1;
  2107. aBoolean1233 = true;
  2108. inputTaken = true;
  2109. } else if (super.saveClickX >= 203 && super.saveClickX <= 259
  2110. && super.saveClickY >= 482 + y
  2111. && super.saveClickY <= 505 + y) {
  2112. cButtonCPos = 3;
  2113. chatTypeView = 2;
  2114. aBoolean1233 = true;
  2115. inputTaken = true;
  2116. } else if (super.saveClickX >= 269 && super.saveClickX <= 325
  2117. && super.saveClickY >= 482 + y
  2118. && super.saveClickY <= 505 + y) {
  2119. cButtonCPos = 4;
  2120. chatTypeView = 11;
  2121. aBoolean1233 = true;
  2122. inputTaken = true;
  2123. } else if (super.saveClickX >= 335 && super.saveClickX <= 391
  2124. && super.saveClickY >= 482 + y
  2125. && super.saveClickY <= 505 + y) {
  2126. cButtonCPos = 5;
  2127. chatTypeView = 3;
  2128. aBoolean1233 = true;
  2129. inputTaken = true;
  2130. } else if (super.saveClickX >= 404 && super.saveClickX <= 515
  2131. && super.saveClickY >= 482 + y
  2132. && super.saveClickY <= 505 + y) {
  2133. if (openInterfaceID == -1) {
  2134. clearTopInterfaces();
  2135. reportAbuseInput = "";
  2136. customInterfaceInput = "";
  2137. canMute = false;
  2138. for (int i = 0; i < RSInterface.interfaceCache.length; i++) {
  2139. if (RSInterface.interfaceCache[i] == null
  2140. || RSInterface.interfaceCache[i].contentType != 600)
  2141. continue;
  2142. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  2143. break;
  2144. }
  2145. } else {
  2146. pushMessage(
  2147. "Please close the interface you have open before using 'report abuse'",
  2148. 0, "");
  2149. }
  2150. }
  2151. }
  2152. }
  2153. }
  2154.  
  2155. private void method33(int i) {
  2156. if (i >= Varp.cache.length)
  2157. return;
  2158. int j = Varp.cache[i].anInt709;
  2159. if (j == 0)
  2160. return;
  2161. int k = variousSettings[i];
  2162. if (j == 1) {
  2163. if (k == 1)
  2164. Texture.method372(0.90000000000000002D);
  2165. if (k == 2)
  2166. Texture.method372(0.80000000000000004D);
  2167. if (k == 3)
  2168. Texture.method372(0.69999999999999996D);
  2169. if (k == 4)
  2170. Texture.method372(0.59999999999999998D);
  2171. ItemDef.mruNodes1.unlinkAll();
  2172. welcomeScreenRaised = true;
  2173. }
  2174. if (j == 3) {
  2175. boolean flag1 = musicEnabled;
  2176. if (k == 0) {
  2177. adjustVolume(musicEnabled, 0);
  2178. musicEnabled = true;
  2179. }
  2180. if (k == 1) {
  2181. adjustVolume(musicEnabled, -400);
  2182. musicEnabled = true;
  2183. }
  2184. if (k == 2) {
  2185. adjustVolume(musicEnabled, -800);
  2186. musicEnabled = true;
  2187. }
  2188. if (k == 3) {
  2189. adjustVolume(musicEnabled, -1200);
  2190. musicEnabled = true;
  2191. }
  2192. if (k == 4)
  2193. musicEnabled = false;
  2194. if (musicEnabled != flag1 && !lowMem) {
  2195. if (musicEnabled) {
  2196. nextSong = currentSong;
  2197. songChanging = true;
  2198. onDemandFetcher.method558(2, nextSong);
  2199. } else {
  2200. stopMidi();
  2201. }
  2202. prevSong = 0;
  2203. }
  2204. }
  2205. if (j == 4) {
  2206. if (k == 0) {
  2207. aBoolean848 = true;
  2208. setWaveVolume(0);
  2209. }
  2210. if (k == 1) {
  2211. aBoolean848 = true;
  2212. setWaveVolume(-400);
  2213. }
  2214. if (k == 2) {
  2215. aBoolean848 = true;
  2216. setWaveVolume(-800);
  2217. }
  2218. if (k == 3) {
  2219. aBoolean848 = true;
  2220. setWaveVolume(-1200);
  2221. }
  2222. if (k == 4)
  2223. aBoolean848 = false;
  2224. }
  2225. if (j == 5)
  2226. anInt1253 = k;
  2227. if (j == 6)
  2228. anInt1249 = k;
  2229. if (j == 8) {
  2230. splitPrivateChat = k;
  2231. inputTaken = true;
  2232. }
  2233. if (j == 9)
  2234. anInt913 = k;
  2235. }
  2236.  
  2237. private void updateEntities() {
  2238. try {
  2239. manageOffsetsForToggle();
  2240. int anInt974 = 0;
  2241. for (int j = -1; j < playerCount + npcCount; j++) {
  2242. Object obj;
  2243. if (j == -1)
  2244. obj = myPlayer;
  2245. else if (j < playerCount)
  2246. obj = playerArray[playerIndices[j]];
  2247. else
  2248. obj = npcArray[npcIndices[j - playerCount]];
  2249. if (obj == null || !((Entity) (obj)).isVisible())
  2250. continue;
  2251. if (obj instanceof NPC) {
  2252. EntityDef entityDef = ((NPC) obj).desc;
  2253. if (headname) {
  2254. String s = entityDef.name;
  2255. s = s
  2256. + combatDiffColor(myPlayer.combatLevel,
  2257. entityDef.combatLevel) + " (level-"
  2258. + entityDef.combatLevel + ")";
  2259. if (entityDef.combatLevel != 0) {
  2260. npcScreenPos(((Entity) (obj)),
  2261. ((Entity) (obj)).height + 15);
  2262. smallText.method382(0xFFFF33, spriteDrawX, s,
  2263. spriteDrawY - yOffsetForText, true);
  2264. } else if (entityDef.combatLevel == 0) {
  2265. npcScreenPos(((Entity) (obj)),
  2266. ((Entity) (obj)).height + 15);
  2267. smallText.method382(0xFFFF33, spriteDrawX,
  2268. entityDef.name, spriteDrawY
  2269. - yOffsetForText, true);
  2270. }
  2271. }
  2272. if (entityDef.childrenIDs != null)
  2273. entityDef = entityDef.method161();
  2274. if (entityDef == null)
  2275. continue;
  2276. }
  2277. if (j < playerCount) {
  2278. int l = 30;
  2279. Player player = (Player) obj;
  2280. if (player.headIcon >= 0) {
  2281. npcScreenPos(((Entity) (obj)),
  2282. ((Entity) (obj)).height + 15);
  2283. if (spriteDrawX > -1) {
  2284. if (player.skullIcon < 2) {
  2285. skullIcons[player.skullIcon].drawSprite(
  2286. spriteDrawX - 12, spriteDrawY - l
  2287. - headIconOffset);
  2288. l += 26;
  2289. }
  2290. if (player.headIcon < 18) {
  2291. headIcons[player.headIcon].drawSprite(
  2292. spriteDrawX - 12, spriteDrawY - l
  2293. - headIconOffset);
  2294. l += 26;
  2295. }
  2296. }
  2297. }
  2298. if (j >= 0 && anInt855 == 10
  2299. && anInt933 == playerIndices[j]
  2300. && loopCycle % 20 < 10) {
  2301. npcScreenPos(((Entity) (obj)),
  2302. ((Entity) (obj)).height + 15);
  2303. if (spriteDrawX > -1)
  2304. headIconsHint[player.hintIcon].drawSprite(
  2305. spriteDrawX - 12, spriteDrawY - l
  2306. - headIconOffset);
  2307. }
  2308. if (headname) {
  2309. npcScreenPos(((Entity) (obj)),
  2310. ((Entity) (obj)).height + 15);
  2311. int col = 0x00ff00;// Green
  2312. aTextDrawingArea_1271.drawText(col, player.name,
  2313. spriteDrawY - yOffsetForText, spriteDrawX);
  2314. }
  2315. } else {
  2316. EntityDef entityDef_1 = ((NPC) obj).desc;
  2317. if (entityDef_1.anInt75 >= 0
  2318. && entityDef_1.anInt75 < headIcons.length) {
  2319. npcScreenPos(((Entity) (obj)),
  2320. ((Entity) (obj)).height + 15);
  2321. if (spriteDrawX > -1)
  2322. headIcons[entityDef_1.anInt75].drawSprite(
  2323. spriteDrawX - 12, spriteDrawY - 30
  2324. - headIconOffset);
  2325. }
  2326. if (anInt855 == 1
  2327. && anInt1222 == npcIndices[j - playerCount]
  2328. && loopCycle % 20 < 10) {
  2329. npcScreenPos(((Entity) (obj)),
  2330. ((Entity) (obj)).height + 15);
  2331. if (spriteDrawX > -1)
  2332. headIconsHint[0].drawSprite(spriteDrawX - 12,
  2333. spriteDrawY - 28 - headIconOffset);
  2334. }
  2335. }
  2336.  
  2337. if (((Entity) (obj)).textSpoken != null
  2338. && (j >= playerCount || publicChatMode == 0
  2339. || publicChatMode == 3 || publicChatMode == 1
  2340. && isFriendOrSelf(((Player) obj).name))) {
  2341. npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  2342. if (spriteDrawX > -1 && anInt974 < anInt975) {
  2343. anIntArray979[anInt974] = chatTextDrawingArea
  2344. .method384(((Entity) (obj)).textSpoken) / 2;
  2345. anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  2346. anIntArray976[anInt974] = spriteDrawX;
  2347. anIntArray977[anInt974] = spriteDrawY;
  2348. anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  2349. anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  2350. anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  2351. aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  2352. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1
  2353. && ((Entity) (obj)).anInt1531 <= 3) {
  2354. anIntArray978[anInt974] += 10;
  2355. anIntArray977[anInt974] += 5;
  2356. }
  2357. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  2358. anIntArray979[anInt974] = 60;
  2359. if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  2360. anIntArray978[anInt974] += 5;
  2361. }
  2362. }
  2363. if (((Entity) (obj)).loopCycleStatus > loopCycle) {
  2364. try {
  2365. npcScreenPos(((Entity) (obj)),
  2366. ((Entity) (obj)).height + 15);
  2367. if (spriteDrawX > -1) {
  2368. int i1 = (((Entity) (obj)).currentHealth * 30)
  2369. / ((Entity) (obj)).maxHealth;
  2370. if (i1 > 30) {
  2371. i1 = 30;
  2372. }
  2373. int HpPercent = (((Entity) (obj)).currentHealth * 56)
  2374. / ((Entity) (obj)).maxHealth;
  2375. if (HpPercent > 56) {
  2376. HpPercent = 56;
  2377. }
  2378. if (!HPBarToggle) {
  2379. DrawingArea.method336(5, spriteDrawY - 3,
  2380. spriteDrawX - 15, 65280, i1);
  2381. DrawingArea.method336(5, spriteDrawY - 3,
  2382. (spriteDrawX - 15) + i1, 0xff0000,
  2383. 30 - i1);
  2384. } else {
  2385. HPBarEmpty.drawSprite(spriteDrawX - 28,
  2386. spriteDrawY - 3);
  2387. HPBarFull = new Sprite(signlink.findcachedir()
  2388. + "Sprites/HITPOINTS_0.png", HpPercent,
  2389. 7);
  2390. HPBarFull.drawSprite(spriteDrawX - 28,
  2391. spriteDrawY - 3);
  2392. }
  2393. int health = (int) (((double) ((Entity) (obj)).currentHealth / (double) ((Entity) (obj)).maxHealth) * 100D);
  2394. int col = 65280;
  2395. if (health <= 100 && health >= 75)
  2396. col = 65280;
  2397. else if (health <= 74 && health >= 50)
  2398. col = 0xffff00;
  2399. else if (health <= 49 && health >= 25)
  2400. col = 0xfca607;
  2401. else if (health <= 24 && health >= 0)
  2402. col = 0xf50d0d;
  2403. if (headhp) {
  2404. smallText
  2405. .method382(
  2406. col,
  2407. spriteDrawX,
  2408. (new StringBuilder())
  2409. .append(((Entity) (Entity) obj).currentHealth)
  2410. .append("/")
  2411. .append(((Entity) (Entity) obj).maxHealth)
  2412. .toString(),
  2413. spriteDrawY - 5, true);
  2414. }
  2415. }
  2416. } catch (Exception e) {
  2417. }
  2418. }
  2419. boolean showcrit = false;// critical;
  2420.  
  2421. for (int k1 = 0; k1 < 4; k1++) {
  2422. if (hitmarks) { //
  2423. if (((Entity) (Entity) obj).hitsLoopCycle[k1] <= loopCycle) {
  2424. continue;
  2425. }
  2426. npcScreenPos((Entity) (Entity) obj,
  2427. ((Entity) (Entity) obj).height / 2);
  2428. if (spriteDrawX <= -1) {
  2429. continue;
  2430. }
  2431. switch (k1) {
  2432. case 1: // '\001'
  2433. spriteDrawY += 18;
  2434. break;
  2435.  
  2436. case 2: // '\002'
  2437. spriteDrawY += 25;
  2438. break;
  2439.  
  2440. case 3: // '\003'
  2441. spriteDrawY += 43;
  2442. break;
  2443. }
  2444. Entity entity = (Entity) (Entity) obj;
  2445. if (entity.moveTimer[k1] == 0) {
  2446. if (entity.hitmarkMove[k1] > -14) {
  2447. entity.hitmarkMove[k1]--;
  2448. }
  2449. entity.moveTimer[k1] = 2;
  2450. } else {
  2451. entity.moveTimer[k1]--;
  2452. }
  2453. if (entity.hitmarkMove[k1] <= -14) {
  2454. entity.hitmarkTrans[k1] -= 10;
  2455. }
  2456. hitmarkDraw(String.valueOf(entity.hitArray[k1])
  2457. .length(), entity.hitMarkTypes[k1],
  2458. entity.hitType[k1], entity.hitArray[k1], 0,
  2459. entity.hitmarkMove[k1], entity.hitmarkTrans[k1]);
  2460.  
  2461. } else {
  2462. int j1 = k1;
  2463. if (((Entity) (obj)).hitsLoopCycle[j1] > loopCycle) {
  2464. npcScreenPos(((Entity) (obj)),
  2465. ((Entity) (obj)).height / 2);
  2466. if (spriteDrawX > -1) {
  2467. if (j1 == 1)
  2468. spriteDrawY -= 20;
  2469. if (j1 == 2) {
  2470. spriteDrawX -= 15;
  2471. spriteDrawY -= 10;
  2472. }
  2473. if (j1 == 3) {
  2474. spriteDrawX += 15;
  2475. spriteDrawY -= 10;
  2476. }
  2477. if (!hitmarks) {
  2478. /*
  2479. * if (((Entity) (obj)).hitMarkTypes[j1] ==
  2480. * 2) { oldGreen.drawSprite(spriteDrawX -
  2481. * 12, spriteDrawY - 13); } else if
  2482. * (((Entity) (obj)).hitMarkTypes[j1] == 1)
  2483. * { newestHitSplash.drawSprite( spriteDrawX
  2484. * - 12, spriteDrawY - 13); } else if
  2485. * (((Entity) (obj)).hitMarkTypes[j1] == 0)
  2486. * { newestHitSplash.drawSprite( spriteDrawX
  2487. * - 12, spriteDrawY - 13); } else {
  2488. * hitMarks[((Entity)
  2489. * (obj)).hitMarkTypes[j1]]
  2490. * .drawSprite(spriteDrawX - 12, spriteDrawY
  2491. * - 12); } smallText .drawText( 0,
  2492. * String.valueOf(((Entity)
  2493. * (obj)).hitArray[j1]), spriteDrawY + 4,
  2494. * spriteDrawX); smallText .drawText(
  2495. * 0xffffff, String.valueOf(((Entity)
  2496. * (obj)).hitArray[j1]), spriteDrawY + 3,
  2497. * spriteDrawX - 1); } else {
  2498. */
  2499.  
  2500. hitMarks[((Entity) (obj)).hitMarkTypes[j1]]
  2501. .drawSprite(spriteDrawX - 10,
  2502. spriteDrawY - 12);
  2503. smallText
  2504. .drawText(
  2505. 0,
  2506. String.valueOf(((Entity) (obj)).hitArray[j1]),
  2507. spriteDrawY + 4,
  2508. spriteDrawX);
  2509. smallText
  2510. .drawText(
  2511. 0xffffff,
  2512. String.valueOf(((Entity) (obj)).hitArray[j1]),
  2513. spriteDrawY + 3,
  2514. spriteDrawX - 1);
  2515. if (((Entity) (obj)).hitArray[j1] >= 100)
  2516. x10Expand.drawSprite(spriteDrawX - 20,
  2517. spriteDrawY - 13);
  2518.  
  2519. smallText
  2520. .drawText(
  2521. 0,
  2522. String.valueOf(((Entity) (obj)).hitArray[j1]),
  2523. spriteDrawY + 4,
  2524. spriteDrawX);
  2525. smallText
  2526. .drawText(
  2527. 0xffffff,
  2528. String.valueOf(((Entity) (obj)).hitArray[j1]),
  2529. spriteDrawY + 3,
  2530. spriteDrawX - 1);
  2531. }
  2532. }
  2533. }
  2534.  
  2535. }
  2536. }
  2537. }
  2538. for (int k = 0; k < anInt974; k++) {
  2539. int k1 = anIntArray976[k];
  2540. int l1 = anIntArray977[k];
  2541. int j2 = anIntArray979[k];
  2542. int k2 = anIntArray978[k];
  2543. boolean flag = true;
  2544. while (flag) {
  2545. flag = false;
  2546. for (int l2 = 0; l2 < k; l2++)
  2547. if (l1 + 2 > anIntArray977[l2] - anIntArray978[l2]
  2548. && l1 - k2 < anIntArray977[l2] + 2
  2549. && k1 - j2 < anIntArray976[l2]
  2550. + anIntArray979[l2]
  2551. && k1 + j2 > anIntArray976[l2]
  2552. - anIntArray979[l2]
  2553. && anIntArray977[l2] - anIntArray978[l2] < l1) {
  2554. l1 = anIntArray977[l2] - anIntArray978[l2];
  2555. flag = true;
  2556. }
  2557.  
  2558. }
  2559. spriteDrawX = anIntArray976[k];
  2560. spriteDrawY = anIntArray977[k] = l1;
  2561. String s = aStringArray983[k];
  2562. if (anInt1249 == 0) {
  2563. int i3 = 0xffff00;
  2564. if (anIntArray980[k] < 6)
  2565. i3 = anIntArray965[anIntArray980[k]];
  2566. if (anIntArray980[k] == 6)
  2567. i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  2568. if (anIntArray980[k] == 7)
  2569. i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  2570. if (anIntArray980[k] == 8)
  2571. i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  2572. if (anIntArray980[k] == 9) {
  2573. int j3 = 150 - anIntArray982[k];
  2574. if (j3 < 50)
  2575. i3 = 0xff0000 + 1280 * j3;
  2576. else if (j3 < 100)
  2577. i3 = 0xffff00 - 0x50000 * (j3 - 50);
  2578. else if (j3 < 150)
  2579. i3 = 65280 + 5 * (j3 - 100);
  2580. }
  2581. if (anIntArray980[k] == 10) {
  2582. int k3 = 150 - anIntArray982[k];
  2583. if (k3 < 50)
  2584. i3 = 0xff0000 + 5 * k3;
  2585. else if (k3 < 100)
  2586. i3 = 0xff00ff - 0x50000 * (k3 - 50);
  2587. else if (k3 < 150)
  2588. i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  2589. }
  2590. if (anIntArray980[k] == 11) {
  2591. int l3 = 150 - anIntArray982[k];
  2592. if (l3 < 50)
  2593. i3 = 0xffffff - 0x50005 * l3;
  2594. else if (l3 < 100)
  2595. i3 = 65280 + 0x50005 * (l3 - 50);
  2596. else if (l3 < 150)
  2597. i3 = 0xffffff - 0x50000 * (l3 - 100);
  2598. }
  2599. if (anIntArray981[k] == 0) {
  2600. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1,
  2601. spriteDrawX);
  2602. chatTextDrawingArea.drawText(i3, s, spriteDrawY,
  2603. spriteDrawX);
  2604. }
  2605. if (anIntArray981[k] == 1) {
  2606. chatTextDrawingArea.method386(0, s, spriteDrawX,
  2607. anInt1265, spriteDrawY + 1);
  2608. chatTextDrawingArea.method386(i3, s, spriteDrawX,
  2609. anInt1265, spriteDrawY);
  2610. }
  2611. if (anIntArray981[k] == 2) {
  2612. chatTextDrawingArea.method387(spriteDrawX, s,
  2613. anInt1265, spriteDrawY + 1, 0);
  2614. chatTextDrawingArea.method387(spriteDrawX, s,
  2615. anInt1265, spriteDrawY, i3);
  2616. }
  2617. if (anIntArray981[k] == 3) {
  2618. chatTextDrawingArea.method388(150 - anIntArray982[k],
  2619. s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  2620. chatTextDrawingArea.method388(150 - anIntArray982[k],
  2621. s, anInt1265, spriteDrawY, spriteDrawX, i3);
  2622. }
  2623. if (anIntArray981[k] == 4) {
  2624. int i4 = chatTextDrawingArea.method384(s);
  2625. int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  2626. DrawingArea.setDrawingArea(334, spriteDrawX - 50,
  2627. spriteDrawX + 50, 0);
  2628. chatTextDrawingArea.method385(0, s, spriteDrawY + 1,
  2629. (spriteDrawX + 50) - k4);
  2630. chatTextDrawingArea.method385(i3, s, spriteDrawY,
  2631. (spriteDrawX + 50) - k4);
  2632. DrawingArea.defaultDrawingAreaSize();
  2633. }
  2634. if (anIntArray981[k] == 5) {
  2635. int j4 = 150 - anIntArray982[k];
  2636. int l4 = 0;
  2637. if (j4 < 25)
  2638. l4 = j4 - 25;
  2639. else if (j4 > 125)
  2640. l4 = j4 - 125;
  2641. DrawingArea
  2642. .setDrawingArea(spriteDrawY + 5, 0, 512,
  2643. spriteDrawY
  2644. - chatTextDrawingArea.anInt1497
  2645. - 1);
  2646. chatTextDrawingArea.drawText(0, s,
  2647. spriteDrawY + 1 + l4, spriteDrawX);
  2648. chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4,
  2649. spriteDrawX);
  2650. DrawingArea.defaultDrawingAreaSize();
  2651. }
  2652. } else {
  2653. chatTextDrawingArea.drawText(0, s, spriteDrawY + 1,
  2654. spriteDrawX);
  2655. chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY,
  2656. spriteDrawX);
  2657. }
  2658. }
  2659. } catch (Exception e) {
  2660. }
  2661. }
  2662.  
  2663. public int headIconOffset, yOffsetForText;
  2664.  
  2665. public void manageOffsetsForToggle() {
  2666. if (headhp && headname) {
  2667. headIconOffset = 14 + 15;
  2668. yOffsetForText = 16;
  2669. } else if (headhp && !headname) {
  2670. headIconOffset = 14;
  2671. } else if (!headhp && headname) {
  2672. headIconOffset = 15;
  2673. yOffsetForText = 8;
  2674. } else {
  2675. headIconOffset = 0;
  2676. yOffsetForText = 0;
  2677. }
  2678. }
  2679.  
  2680. private void delFriend(long l) {
  2681. try {
  2682. if (l == 0L)
  2683. return;
  2684. for (int i = 0; i < friendsCount; i++) {
  2685. if (friendsListAsLongs[i] != l)
  2686. continue;
  2687. friendsCount--;
  2688. needDrawTabArea = true;
  2689. for (int j = i; j < friendsCount; j++) {
  2690. friendsList[j] = friendsList[j + 1];
  2691. friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  2692. friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  2693. }
  2694.  
  2695. stream.createFrame(215);
  2696. stream.writeQWord(l);
  2697. break;
  2698. }
  2699. } catch (RuntimeException runtimeexception) {
  2700. signlink.reporterror("18622, " + false + ", " + l + ", "
  2701. + runtimeexception.toString());
  2702. throw new RuntimeException();
  2703. }
  2704. }
  2705.  
  2706. public void drawSideIcons() {
  2707. int extraXX = drawLongTabs ? -241 : 0;
  2708. int extraYY = drawLongTabs ? +35 : 0;
  2709.  
  2710. int mhm = drawLongTabs ? +4 : 0;
  2711. int mhm2 = drawLongTabs ? -4 : 0;
  2712.  
  2713. int extraXX1 = drawLongTabs ? -233 : 0;
  2714.  
  2715. int extraX = isFullScreen ? extraWidth + 519 : 0;
  2716. int extraY = isFullScreen ? extraHeight + 168 + 262 : 0;
  2717.  
  2718. int extraX2 = !drawLongTabs ? extraWidth - 8 : 0;
  2719. int extraY2 = !drawLongTabs ? extraHeight - 5 : 0;
  2720. /* Top sideIcons */
  2721. if (is554 == false) {
  2722. if (tabInterfaceIDs[0] != -1)// attack
  2723. sideIcons[0].drawSprite(10 + extraX + extraXX1, 4 + extraY
  2724. + extraYY);
  2725. if (tabInterfaceIDs[1] != -1)// stat
  2726. sideIcons[1].drawSprite(43 + extraX + extraXX1, 4 + extraY
  2727. + extraYY);
  2728. if (tabInterfaceIDs[2] != -1)// quest
  2729. sideIcons[2].drawSprite(76 + extraX + extraXX1, 3 + extraY
  2730. + extraYY);
  2731. if (tabInterfaceIDs[3] != -1)// inventory
  2732. sideIcons[3].drawSprite(111 + extraX + extraXX1, 5 + extraY
  2733. + extraYY);
  2734. if (tabInterfaceIDs[4] != -1)// equipment
  2735. sideIcons[4].drawSprite(140 + extraX + extraXX1, 1 + extraY
  2736. + extraYY);
  2737. if (tabInterfaceIDs[5] != -1)// prayer
  2738. sideIcons[5].drawSprite(174 + extraX + extraXX1, 1 + extraY
  2739. + extraYY);
  2740. if (tabInterfaceIDs[6] != -1)// magic
  2741. sideIcons[6].drawSprite(208 + extraX + extraXX1, 4 + extraY
  2742. + extraYY);
  2743. if (isFullScreen)
  2744. extraY -= 262;
  2745. /* Bottom sideIcons */
  2746. if (tabInterfaceIDs[7] != -1)// clan
  2747. sideIcons[7].drawSprite(11 + extraX, 303 + extraY);
  2748. if (tabInterfaceIDs[8] != -1)// friends
  2749. sideIcons[8].drawSprite(46 + extraX, 306 + extraY);
  2750. if (tabInterfaceIDs[9] != -1)// ignore
  2751. sideIcons[9].drawSprite(79 + extraX, 306 + extraY);
  2752. if (tabInterfaceIDs[10] != -1)// options
  2753. sideIcons[10].drawSprite(113 + extraX, 302 + extraY);
  2754. if (tabInterfaceIDs[11] != -1)// options
  2755. sideIcons[11].drawSprite(145 + extraX, 304 + extraY);
  2756. if (tabInterfaceIDs[12] != -1)// emotes
  2757. sideIcons[12].drawSprite(181 + extraX, 302 + extraY);
  2758. if (tabInterfaceIDs[13] != -1)// music
  2759. sideIcons[13].drawSprite(213 + extraX, 303 + extraY);
  2760. } else {
  2761. if (isFullScreen)
  2762. extraX = isFullScreen ? extraWidth + 511 : 0;
  2763. if (tabInterfaceIDs[0] != -1 && drawLongTabs)
  2764. newSideIcons[0].drawSprite(37 + extraX + extraXX + mhm, 8
  2765. + extraY + extraYY + mhm2);// 8+extraX+extraXX+mhm,
  2766. // 8+extraY+extraYY+mhm2
  2767. if (tabInterfaceIDs[1] != -1 && drawLongTabs)
  2768. newSideIcons[1].drawSprite(67 + extraX + extraXX + mhm, 8
  2769. + extraY + extraYY + mhm2);// 37+extraX+extraXX+mhm,
  2770. // 8+extraY+extraYY+mhm2
  2771. if (tabInterfaceIDs[2] != -1 && drawLongTabs)
  2772. newSideIcons[2].drawSprite(97 + extraX + extraXX + mhm, 8
  2773. + extraY + extraYY + mhm2); // (97+extraX+extraXX+mhm,
  2774. // 8+extraY+extraYY+mhm2);
  2775.  
  2776. if (tabInterfaceIDs[0] != -1 && !drawLongTabs)
  2777. newSideIcons[0].drawSprite(8 + extraX + extraXX, 8 + extraY
  2778. + extraYY);
  2779. if (tabInterfaceIDs[1] != -1 && !drawLongTabs)
  2780. newSideIcons[1].drawSprite(37 + extraX + extraXX, 8 + extraY
  2781. + extraYY);
  2782. if (tabInterfaceIDs[2] != -1 && !drawLongTabs)
  2783. newSideIcons[2].drawSprite(67 + extraX + extraXX, 8 + extraY
  2784. + extraYY);
  2785. if (tabInterfaceIDs[14] != -1 && !drawLongTabs)
  2786. newSideIcons[3].drawSprite(97 + extraX + extraXX, 8 + extraY
  2787. + extraYY);
  2788.  
  2789. if (tabInterfaceIDs[3] != -1)
  2790. newSideIcons[4].drawSprite(127 + extraX + extraXX + mhm, 8
  2791. + extraY + extraYY + mhm2);
  2792. if (tabInterfaceIDs[4] != -1)
  2793. newSideIcons[5].drawSprite(159 + extraX + extraXX + mhm, 8
  2794. + extraY + extraYY + mhm2);
  2795. if (tabInterfaceIDs[5] != -1)
  2796. newSideIcons[6].drawSprite(187 + extraX + extraXX + mhm, 8
  2797. + extraY + extraYY + mhm2);
  2798. if (tabInterfaceIDs[6] != -1)
  2799. newSideIcons[7].drawSprite(217 + extraX + extraXX + mhm, 8
  2800. + extraY + extraYY + mhm2);
  2801. if (isFullScreen)
  2802. extraY -= 263;
  2803. /* Bottom sideIcons */
  2804. if (tabInterfaceIDs[9] != -1)
  2805. newSideIcons[8].drawSprite(38 + extraX + mhm, 306 + extraY
  2806. + mhm2);
  2807. if (tabInterfaceIDs[8] != -1)
  2808. newSideIcons[9].drawSprite(70 + extraX + mhm, 306 + extraY
  2809. + mhm2);
  2810. if (tabInterfaceIDs[7] != -1)
  2811. newSideIcons[13].drawSprite(97 + extraX + mhm, 306 + extraY
  2812. + mhm2);
  2813. if (tabInterfaceIDs[11] != -1)
  2814. newSideIcons[10].drawSprite(127 + extraX + mhm, 306 + extraY
  2815. + mhm2);
  2816. if (tabInterfaceIDs[12] != -1)
  2817. newSideIcons[11].drawSprite(157 + extraX + mhm, 306 + extraY
  2818. + mhm2);
  2819. if (tabInterfaceIDs[13] != -1)
  2820. newSideIcons[12].drawSprite(187 + extraX + mhm, 306 + extraY
  2821. + mhm2);
  2822. if (tabInterfaceIDs[15] != -1)
  2823. newSideIcons[14].drawSprite(216 + extraX + mhm, 307 + extraY
  2824. + mhm2);
  2825. }
  2826. }
  2827.  
  2828. public void drawRedStones() {
  2829. int extraX = isFullScreen ? extraWidth + 519 : 0;
  2830. int extraX2 = isFullScreen ? +4 : 0;
  2831. int extraX22 = isFullScreen ? -3 : 0;
  2832. int extraY = isFullScreen ? extraHeight + 168 + 262 : 0;
  2833. int extraY2 = isFullScreen ? extraHeight + 168 : 0;
  2834.  
  2835. int extraXX = drawLongTabs ? -232 : 0;
  2836. int extraYY = drawLongTabs ? +35 : 0;
  2837.  
  2838. int mhm = drawLongTabs ? +4 : 0;
  2839. int mhm2 = drawLongTabs ? -6 : 0;
  2840.  
  2841. int mhm4 = drawLongTabs ? +1 : 0;
  2842.  
  2843. int extraXX22 = drawLongTabs ? -241 : 0;
  2844. int extraYY22 = drawLongTabs ? +37 : 0;
  2845. if (is554 == false) {
  2846. if (isFullScreen && tabInterfaceIDs[tabID] != -1)
  2847. switch (tabID) {
  2848. case 0:
  2849. if (!drawLongTabs) {
  2850. redStones[0].drawSprite(3 + extraX + extraXX, 0
  2851. + extraY + extraYY);
  2852. } else {
  2853. redStones[4].drawSprite(3 + extraX + extraXX + extraX2,
  2854. 0 + extraY + extraYY);
  2855. }
  2856. break;
  2857. case 1:
  2858. redStones[4].drawSprite(41 + extraX + extraXX, 0 + extraY
  2859. + extraYY);
  2860. break;
  2861. case 2:
  2862. redStones[4].drawSprite(74 + extraX + extraXX, 0 + extraY
  2863. + extraYY);
  2864. break;
  2865. case 3:
  2866. redStones[4].drawSprite(107 + extraX + extraXX, 0 + extraY
  2867. + extraYY);
  2868. break;
  2869. case 4:
  2870. redStones[4].drawSprite(140 + extraX + extraXX, 0 + extraY
  2871. + extraYY);
  2872. break;
  2873. case 5:
  2874. redStones[4].drawSprite(173 + extraX + extraXX, 0 + extraY
  2875. + extraYY);
  2876. break;
  2877. case 6:
  2878. if (!drawLongTabs) {
  2879. redStones[1].drawSprite(206 + extraX + extraXX, 0
  2880. + extraY + extraYY);
  2881. } else {
  2882. redStones[4].drawSprite(206 + extraX + extraXX, 0
  2883. + extraY + extraYY);
  2884. }
  2885. break;
  2886. case 7:
  2887. if (!drawLongTabs) {
  2888. redStones[2].drawSprite(3 + extraX, 298 + extraY - 262);
  2889. } else {
  2890. redStones[4].drawSprite(3 + extraX + extraX2,
  2891. 298 + extraY - 262);
  2892. }
  2893. break;
  2894. case 8:
  2895. redStones[4].drawSprite(41 + extraX, 298 + extraY - 262);
  2896. break;
  2897. case 9:
  2898. redStones[4].drawSprite(74 + extraX, 298 + extraY - 262);
  2899. break;
  2900. case 10:
  2901. redStones[4].drawSprite(107 + extraX, 298 + extraY - 262);
  2902. break;
  2903. case 11:
  2904. redStones[4].drawSprite(140 + extraX, 298 + extraY - 262);
  2905. break;
  2906. case 12:
  2907. redStones[4].drawSprite(173 + extraX, 298 + extraY - 262);
  2908. break;
  2909. case 13:
  2910. if (!drawLongTabs) {
  2911. redStones[3].drawSprite(206 + extraX,
  2912. 298 + extraY - 262);
  2913. } else {
  2914. redStones[4].drawSprite(206 + extraX + extraX22,
  2915. 298 + extraY - 262);
  2916. }
  2917. break;
  2918. }
  2919. else if (isFullScreen == false && tabInterfaceIDs[tabID] != -1)
  2920. switch (tabID) {
  2921. case 0:
  2922. redStones[0].drawSprite(3, 0);
  2923. break;
  2924. case 1:
  2925. redStones[4].drawSprite(41, 0);
  2926. break;
  2927. case 2:
  2928. redStones[4].drawSprite(74, 0);
  2929. break;
  2930. case 3:
  2931. redStones[4].drawSprite(107, 0);
  2932. break;
  2933. case 4:
  2934. redStones[4].drawSprite(140, 0);
  2935. break;
  2936. case 5:
  2937. redStones[4].drawSprite(173, 0);
  2938. break;
  2939. case 6:
  2940. redStones[1].drawSprite(206, 0);
  2941. break;
  2942. case 7:
  2943. redStones[2].drawSprite(3, 298);
  2944. break;
  2945. case 8:
  2946. redStones[4].drawSprite(41, 298);
  2947. break;
  2948. case 9:
  2949. redStones[4].drawSprite(74, 298);
  2950. break;
  2951. case 10:
  2952. redStones[4].drawSprite(107, 298);
  2953. break;
  2954. case 11:
  2955. redStones[4].drawSprite(140, 298);
  2956. break;
  2957. case 12:
  2958. redStones[4].drawSprite(173, 298);
  2959. break;
  2960. case 13:
  2961. redStones[3].drawSprite(206, 298);
  2962. break;
  2963. }
  2964.  
  2965. } else if (is554) {
  2966. drawTabHover();
  2967. // if(tabId > tabInterfaceIDs.length)
  2968. // cd;
  2969. if (tabInterfaceIDs[tabID] != -1) {
  2970. extraX = isFullScreen ? extraWidth + 511 : 0;
  2971. if (tabID == 0 && drawLongTabs)
  2972. tabClicked.drawSprite(32 + extraX + extraXX22 + mhm, 0
  2973. + extraY + extraYY22 + mhm2);
  2974. if (tabID == 1 && drawLongTabs)
  2975. tabClicked.drawSprite(62 + extraX + extraXX22 + mhm, 0
  2976. + extraY + extraYY22 + mhm2);
  2977. if (tabID == 2 && drawLongTabs)
  2978. tabClicked.drawSprite(92 + extraX + extraXX22 + mhm, 0
  2979. + extraY + extraYY22 + mhm2);
  2980.  
  2981. if (tabID == 0 && !drawLongTabs)
  2982. tabClicked.drawSprite(2 + extraX + extraXX22 + mhm, 0
  2983. + extraY + extraYY22 + mhm2);
  2984. if (tabID == 1 && !drawLongTabs)
  2985. tabClicked.drawSprite(32 + extraX + extraXX22 + mhm, 0
  2986. + extraY + extraYY22 + mhm2);
  2987. if (tabID == 2 && !drawLongTabs)
  2988. tabClicked.drawSprite(62 + extraX + extraXX22 + mhm, 0
  2989. + extraY + extraYY22 + mhm2);
  2990. if (tabID == 14 && !drawLongTabs)
  2991. tabClicked.drawSprite(92 + extraX + extraXX22 + mhm, 0
  2992. + extraY + extraYY22 + mhm2);
  2993.  
  2994. if (tabID == 3)
  2995. tabClicked.drawSprite(122 + extraX + extraXX22 + mhm, 0
  2996. + extraY + extraYY22 + mhm2);
  2997. if (tabID == 4)
  2998. tabClicked.drawSprite(152 + extraX + extraXX22 + mhm, 0
  2999. + extraY + extraYY22 + mhm2);
  3000. if (tabID == 5)
  3001. tabClicked.drawSprite(182 + extraX + extraXX22 + mhm, 0
  3002. + extraY + extraYY22 + mhm2);
  3003. if (tabID == 6)
  3004. tabClicked.drawSprite(212 + extraX + extraXX22 + mhm, 0
  3005. + extraY + extraYY22 + mhm2);
  3006. if (tabID == 16)
  3007. tabClicked.drawSprite(2 + extraX + extraXX22 + mhm, 298
  3008. + extraY2 + extraYY22 + mhm2);
  3009. if (tabID == 8)
  3010. tabClicked.drawSprite(32 + extraX + mhm, 298 + extraY2
  3011. + mhm2 + mhm4);
  3012.  
  3013. if (tabID == 9)
  3014. tabClicked.drawSprite(62 + extraX + mhm, 298 + extraY2
  3015. + mhm2 + mhm4);
  3016. if (tabID == 7)
  3017. tabClicked.drawSprite(92 + extraX + mhm, 298 + extraY2
  3018. + mhm2 + mhm4);
  3019. if (tabID == 11)
  3020. tabClicked.drawSprite(122 + extraX + mhm, 298 + extraY2
  3021. + mhm2 + mhm4);
  3022. if (tabID == 12)
  3023. tabClicked.drawSprite(152 + extraX + mhm, 298 + extraY2
  3024. + mhm2 + mhm4);
  3025. if (tabID == 13)
  3026. tabClicked.drawSprite(182 + extraX + mhm, 298 + extraY2
  3027. + mhm2 + mhm4);
  3028. if (tabID == 15)
  3029. tabClicked.drawSprite(212 + extraX + mhm, 298 + extraY2
  3030. + mhm2 + mhm4);
  3031. }
  3032.  
  3033. }
  3034. }
  3035.  
  3036. private void drawTabArea() {
  3037. int x = isFullScreen ? extraWidth + 519 : 0;
  3038. int y = isFullScreen ? extraHeight + 168 : 0;
  3039. if (!isFullScreen)
  3040. aRSImageProducer_1163.initDrawingArea();
  3041. Texture.anIntArray1472 = anIntArray1181;
  3042. if (!isFullScreen) {
  3043. tabArea.drawSprite(0 + x, 0 + y);
  3044. }
  3045. if (isFullScreen && !is554 && drawLongTabs) {
  3046. fullScreenSprites[1].drawSprite(-247 + x, 299 + y);
  3047. }
  3048. if (isFullScreen && !is554 && !drawLongTabs) {
  3049. fullScreenSprites[2].drawSprite(-3 + x, 262 + y);
  3050. }
  3051. if (isFullScreen && is554 && !drawLongTabs) {
  3052. tabs554.drawSprite(-3 + x, 262 + y);
  3053. }
  3054. if (isFullScreen && is554 && drawLongTabs) {
  3055. long554.drawSprite(-217 - 10 + 15 + x, 293 + y);
  3056. long554.drawSprite(-217 - 10 + 15 + 15 + 15 + x, 293 + y);
  3057. long554.drawSprite(-217 + 20 + 15 + 15 + 15 + x, 293 + y);
  3058. long554.drawSprite(-217 + 50 + 15 + 15 + 15 + x, 293 + y);
  3059. long554.drawSprite(-217 + 80 + 15 + 15 + 15 + x, 293 + y);
  3060. long554.drawSprite(-217 + 110 + 15 + 15 + 15 + x, 293 + y);
  3061. long554.drawSprite(-217 + 140 + 15 + 15 + 15 + x, 293 + y);
  3062.  
  3063. long554.drawSprite(-217 + 170 + 15 + 15 + 15 + x, 293 + y);
  3064. long554.drawSprite(-217 + 200 + 15 + 15 + 15 + x, 293 + y);
  3065. long554.drawSprite(-217 + 230 + 15 + 15 + 15 + x, 293 + y);
  3066. long554.drawSprite(-217 + 260 + 15 + 15 + 15 + x, 293 + y);
  3067. long554.drawSprite(-217 + 290 + 15 + 15 + 15 + x, 293 + y);
  3068. long554.drawSprite(-217 + 320 + 15 + 15 + 15 + x, 293 + y);
  3069. long554.drawSprite(-217 + 350 + 15 + 15 + 15 + x, 293 + y);
  3070. long554.drawSprite(-217 + 380 + 15 + 15 + 15 + x, 293 + y);
  3071. }
  3072. if (invOverlayInterfaceID == -1) {
  3073. drawRedStones();
  3074. drawSideIcons();
  3075. }
  3076. if (isFullScreen)
  3077. drawTabBack();
  3078. else {
  3079. if (invOverlayInterfaceID != -1)
  3080. drawInterface(0, 28 + x,
  3081. RSInterface.interfaceCache[invOverlayInterfaceID],
  3082. 37 + y);
  3083. else if (tabInterfaceIDs[tabID] != -1)
  3084. drawInterface(0, 28 + x,
  3085. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  3086. 37 + y);
  3087. }
  3088. if (menuOpen && menuScreenArea == 1)
  3089. drawMenu();
  3090. if (!isFullScreen)
  3091. aRSImageProducer_1163.drawGraphics(168 + extraHeight,
  3092. isFullScreen ? bufferGraphics : super.graphics,
  3093. 519 + extraWidth);
  3094. aRSImageProducer_1165.initDrawingArea();
  3095. Texture.anIntArray1472 = anIntArray1182;
  3096. }
  3097.  
  3098. public void drawTabBack() {
  3099. if (!drawLongTabs)
  3100. fullScreenSprites[0].drawSprite2(554 + extraWidth,
  3101. 156 + extraHeight);
  3102. if (invOverlayInterfaceID != -1 && !drawLongTabs)
  3103. drawInterface(0, 519 + 41 + extraWidth,
  3104. RSInterface.interfaceCache[invOverlayInterfaceID],
  3105. 168 + extraHeight - 3);
  3106. else if (tabInterfaceIDs[tabID] != -1 && !drawLongTabs)
  3107. drawInterface(0, 519 + 41 + extraWidth,
  3108. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  3109. 168 + extraHeight - 3);
  3110.  
  3111. if (drawLongTabs && is554)
  3112. fullScreenSprites[0].drawSprite2(554 + extraWidth,
  3113. 187 + extraHeight);// 193
  3114. if (invOverlayInterfaceID != -1 && drawLongTabs && is554)
  3115. drawInterface(0, 519 + 41 + extraWidth,
  3116. RSInterface.interfaceCache[invOverlayInterfaceID], 168 + 35
  3117. - 6 + extraHeight - 3);
  3118. else if (tabInterfaceIDs[tabID] != -1 && drawLongTabs && is554)
  3119. drawInterface(0, 519 + 41 + extraWidth,
  3120. RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 168
  3121. + 35 - 6 + extraHeight - 3);
  3122.  
  3123. if (drawLongTabs && !is554)
  3124. fullScreenSprites[0].drawSprite2(554 + extraWidth,
  3125. 193 + extraHeight);// 25
  3126. if (invOverlayInterfaceID != -1 && drawLongTabs && !is554)
  3127. drawInterface(0, 519 + 41 + extraWidth,
  3128. RSInterface.interfaceCache[invOverlayInterfaceID],
  3129. 168 + 35 + extraHeight - 3);
  3130. else if (tabInterfaceIDs[tabID] != -1 && drawLongTabs && !is554)
  3131. drawInterface(0, 519 + 41 + extraWidth,
  3132. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  3133. 168 + 35 + extraHeight - 3);
  3134. }
  3135.  
  3136. private void method37(int j) {
  3137. if (!lowMem) {
  3138. if (Texture.anIntArray1480[17] >= j) {
  3139. Background background = Texture.aBackgroundArray1474s[17];
  3140. int k = background.anInt1452 * background.anInt1453 - 1;
  3141. // fire cape apparently?
  3142. int j1 = background.anInt1452 * anInt945 * 2;
  3143. byte abyte0[] = background.aByteArray1450;
  3144. byte abyte3[] = aByteArray912;
  3145. for (int i2 = 0; i2 <= k; i2++)
  3146. abyte3[i2] = abyte0[i2 - j1 & k];
  3147.  
  3148. background.aByteArray1450 = abyte3;
  3149. aByteArray912 = abyte0;
  3150. Texture.method370(17);
  3151. anInt854++;
  3152. if (anInt854 > 1235) {
  3153. anInt854 = 0;
  3154. stream.createFrame(226);
  3155. stream.writeWordBigEndian(0);
  3156. int l2 = stream.currentOffset;
  3157. stream.writeWord(58722);
  3158. stream.writeWordBigEndian(240);
  3159. stream.writeWord((int) (Math.random() * 65536D));
  3160. stream.writeWordBigEndian((int) (Math.random() * 256D));
  3161. if ((int) (Math.random() * 2D) == 0)
  3162. stream.writeWord(51825);
  3163. stream.writeWordBigEndian((int) (Math.random() * 256D));
  3164. stream.writeWord((int) (Math.random() * 65536D));
  3165. stream.writeWord(7130);
  3166. stream.writeWord((int) (Math.random() * 65536D));
  3167. stream.writeWord(61657);
  3168. stream.writeBytes(stream.currentOffset - l2);
  3169. }
  3170. }
  3171. if (Texture.anIntArray1480[24] >= j) {
  3172. Background background_1 = Texture.aBackgroundArray1474s[24];
  3173. int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  3174. int k1 = background_1.anInt1452 * anInt945 * 2;
  3175. byte abyte1[] = background_1.aByteArray1450;
  3176. byte abyte4[] = aByteArray912;
  3177. for (int j2 = 0; j2 <= l; j2++)
  3178. abyte4[j2] = abyte1[j2 - k1 & l];
  3179.  
  3180. background_1.aByteArray1450 = abyte4;
  3181. aByteArray912 = abyte1;
  3182. Texture.method370(24);
  3183. }
  3184. if (Texture.anIntArray1480[34] >= j) {
  3185. Background background_2 = Texture.aBackgroundArray1474s[34];
  3186. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  3187. int l1 = background_2.anInt1452 * anInt945 * 2;
  3188. byte abyte2[] = background_2.aByteArray1450;
  3189. byte abyte5[] = aByteArray912;
  3190. for (int k2 = 0; k2 <= i1; k2++)
  3191. abyte5[k2] = abyte2[k2 - l1 & i1];
  3192.  
  3193. background_2.aByteArray1450 = abyte5;
  3194. aByteArray912 = abyte2;
  3195. Texture.method370(34);
  3196. }
  3197. if (Texture.anIntArray1480[40] >= j) {
  3198. Background background_2 = Texture.aBackgroundArray1474s[40];
  3199. int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  3200. int l1 = background_2.anInt1452 * anInt945 * 2;
  3201. byte abyte2[] = background_2.aByteArray1450;
  3202. byte abyte5[] = aByteArray912;
  3203. for (int k2 = 0; k2 <= i1; k2++)
  3204. abyte5[k2] = abyte2[k2 - l1 & i1];
  3205.  
  3206. background_2.aByteArray1450 = abyte5;
  3207. aByteArray912 = abyte2;
  3208. Texture.method370(40);
  3209. }
  3210. }
  3211. }
  3212.  
  3213. private void method38() {
  3214. for (int i = -1; i < playerCount; i++) {
  3215. int j;
  3216. if (i == -1)
  3217. j = myPlayerIndex;
  3218. else
  3219. j = playerIndices[i];
  3220. Player player = playerArray[j];
  3221. if (player != null && player.textCycle > 0) {
  3222. player.textCycle--;
  3223. if (player.textCycle == 0)
  3224. player.textSpoken = null;
  3225. }
  3226. }
  3227. for (int k = 0; k < npcCount; k++) {
  3228. int l = npcIndices[k];
  3229. NPC npc = npcArray[l];
  3230. if (npc != null && npc.textCycle > 0) {
  3231. npc.textCycle--;
  3232. if (npc.textCycle == 0)
  3233. npc.textSpoken = null;
  3234. }
  3235. }
  3236. }
  3237.  
  3238. private void calcCameraPos() {
  3239. int i = anInt1098 * 128 + 64;
  3240. int j = anInt1099 * 128 + 64;
  3241. int k = method42(plane, j, i) - anInt1100;
  3242. if (xCameraPos < i) {
  3243. xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  3244. if (xCameraPos > i)
  3245. xCameraPos = i;
  3246. }
  3247. if (xCameraPos > i) {
  3248. xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  3249. if (xCameraPos < i)
  3250. xCameraPos = i;
  3251. }
  3252. if (zCameraPos < k) {
  3253. zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  3254. if (zCameraPos > k)
  3255. zCameraPos = k;
  3256. }
  3257. if (zCameraPos > k) {
  3258. zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  3259. if (zCameraPos < k)
  3260. zCameraPos = k;
  3261. }
  3262. if (yCameraPos < j) {
  3263. yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  3264. if (yCameraPos > j)
  3265. yCameraPos = j;
  3266. }
  3267. if (yCameraPos > j) {
  3268. yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  3269. if (yCameraPos < j)
  3270. yCameraPos = j;
  3271. }
  3272. i = anInt995 * 128 + 64;
  3273. j = anInt996 * 128 + 64;
  3274. k = method42(plane, j, i) - anInt997;
  3275. int l = i - xCameraPos;
  3276. int i1 = k - zCameraPos;
  3277. int j1 = j - yCameraPos;
  3278. int k1 = (int) Math.sqrt(l * l + j1 * j1);
  3279. int l1 = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  3280. int i2 = (int) (Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  3281. if (l1 < 128)
  3282. l1 = 128;
  3283. if (l1 > 383)
  3284. l1 = 383;
  3285. if (yCameraCurve < l1) {
  3286. yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  3287. if (yCameraCurve > l1)
  3288. yCameraCurve = l1;
  3289. }
  3290. if (yCameraCurve > l1) {
  3291. yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  3292. if (yCameraCurve < l1)
  3293. yCameraCurve = l1;
  3294. }
  3295. int j2 = i2 - xCameraCurve;
  3296. if (j2 > 1024)
  3297. j2 -= 2048;
  3298. if (j2 < -1024)
  3299. j2 += 2048;
  3300. if (j2 > 0) {
  3301. xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  3302. xCameraCurve &= 0x7ff;
  3303. }
  3304. if (j2 < 0) {
  3305. xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  3306. xCameraCurve &= 0x7ff;
  3307. }
  3308. int k2 = i2 - xCameraCurve;
  3309. if (k2 > 1024)
  3310. k2 -= 2048;
  3311. if (k2 < -1024)
  3312. k2 += 2048;
  3313. if (k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  3314. xCameraCurve = i2;
  3315. }
  3316.  
  3317. private void drawMenu() {
  3318. int i = menuOffsetX;
  3319. int j = menuOffsetY;
  3320. int k = menuWidth;
  3321. int j1 = super.mouseX;
  3322. int k1 = super.mouseY;
  3323. int l = menuHeight + 1;
  3324. int i1 = 0x5d5447;
  3325. if (menuScreenArea == 1 && isFullScreen) {
  3326. i += 519;// +extraWidth;
  3327. j += 168;// +extraHeight;
  3328. }
  3329. if (menuScreenArea == 2 && isFullScreen) {
  3330. j += 338;
  3331. }
  3332. if (menuScreenArea == 3 && isFullScreen) {
  3333. i += 515;
  3334. j += 0;
  3335. }
  3336. if (menuScreenArea == 0) {
  3337. j1 -= 4;
  3338. k1 -= 4;
  3339. }
  3340. if (menuScreenArea == 1) {
  3341. if (!isFullScreen) {
  3342. j1 -= 519;
  3343. k1 -= 168;
  3344. }
  3345. }
  3346. if (menuScreenArea == 2) {
  3347. if (!isFullScreen) {
  3348. j1 -= 17;
  3349. k1 -= 338;
  3350. }
  3351. }
  3352. if (menuScreenArea == 3 && !isFullScreen) {
  3353. j1 -= 515;
  3354. k1 -= 0;
  3355. }
  3356. if (menuToggle == false) {
  3357. DrawingArea.method336(l, j, i, i1, k);
  3358. DrawingArea.method335(i1, j, k, l, 150, i);
  3359. DrawingArea.method336(16, j + 1, i + 1, 0, k - 2);
  3360. DrawingArea.method335(0, j + 1, k - 2, 16, 150, i + 1);
  3361. DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
  3362. DrawingArea.method338(j + 18, l - 19, 150, 0, k - 2, i + 1);
  3363. chatTextDrawingArea.method385(0xc6b895, "Choose Option", j + 14,
  3364. i + 3);
  3365. chatTextDrawingArea.method385(0xc6b895, "Choose Option", j + 14,
  3366. i + 3);
  3367. for (int l1 = 0; l1 < menuActionRow; l1++) {
  3368. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  3369. int j2 = 0xffffff;
  3370. if (j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  3371. j2 = 0xffff00;
  3372. chatTextDrawingArea.method389(true, i + 3, j2,
  3373. menuActionName[l1], i2);
  3374. }
  3375. } else if (menuToggle == true) {
  3376. // DrawingArea.drawPixels(height, yPos, xPos, color, width);
  3377. // DrawingArea.fillPixels(xPos, width, height, color, yPos);
  3378. DrawingArea.drawPixels(l - 4, j + 2, i, 0x706a5e, k);
  3379. DrawingArea.drawPixels(l - 2, j + 1, i + 1, 0x706a5e, k - 2);
  3380. DrawingArea.drawPixels(l, j, i + 2, 0x706a5e, k - 4);
  3381. DrawingArea.drawPixels(l - 2, j + 1, i + 3, 0x2d2822, k - 6);
  3382. DrawingArea.drawPixels(l - 4, j + 2, i + 2, 0x2d2822, k - 4);
  3383. DrawingArea.drawPixels(l - 6, j + 3, i + 1, 0x2d2822, k - 2);
  3384. DrawingArea.drawPixels(l - 22, j + 19, i + 2, 0x524a3d, k - 4);
  3385. DrawingArea.drawPixels(l - 22, j + 20, i + 3, 0x524a3d, k - 6);
  3386. DrawingArea.drawPixels(l - 23, j + 20, i + 3, 0x2b271c, k - 6);
  3387. DrawingArea.fillPixels(i + 3, k - 6, 1, 0x2a291b, j + 2);
  3388. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x2a261b, j + 3);
  3389. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x252116, j + 4);
  3390. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x211e15, j + 5);
  3391. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x1e1b12, j + 6);
  3392. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x1a170e, j + 7);
  3393. DrawingArea.fillPixels(i + 2, k - 4, 2, 0x15120b, j + 8);
  3394. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x100d08, j + 10);
  3395. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 11);
  3396. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x080703, j + 12);
  3397. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 13);
  3398. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x070802, j + 14);
  3399. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 15);
  3400. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x070802, j + 16);
  3401. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 17);
  3402. DrawingArea.fillPixels(i + 2, k - 4, 1, 0x2a291b, j + 18);
  3403. DrawingArea.fillPixels(i + 3, k - 6, 1, 0x564943, j + 19);
  3404. chatTextDrawingArea.method385(0xc6b895, "Choose Option", j + 14,
  3405. i + 3);
  3406. int x = isFullScreen ? extraWidth : 0;
  3407. int y = isFullScreen ? extraHeight : 0;
  3408. for (int l1 = 0; l1 < menuActionRow; l1++) {
  3409. int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  3410. int j2 = 0xc6b895;
  3411. if (j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3) {
  3412. DrawingArea.drawPixels(15, i2 - 11, i + 3, 0x6f695d,
  3413. menuWidth - 6);
  3414. j2 = 0xeee5c6;
  3415. }
  3416. chatTextDrawingArea.method389(true, i + 4, j2,
  3417. menuActionName[l1], i2 + 1);
  3418. }
  3419. }
  3420. }
  3421.  
  3422. private void addFriend(long l) {
  3423. try {
  3424. if (l == 0L)
  3425. return;
  3426. if (friendsCount >= 100 && anInt1046 != 1) {
  3427. pushMessage(
  3428. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  3429. 0, "");
  3430. return;
  3431. }
  3432. if (friendsCount >= 200) {
  3433. pushMessage(
  3434. "Your friendlist is full. Max of 100 for free users, and 200 for members",
  3435. 0, "");
  3436. return;
  3437. }
  3438. String s = TextClass.fixName(TextClass.nameForLong(l));
  3439. for (int i = 0; i < friendsCount; i++)
  3440. if (friendsListAsLongs[i] == l) {
  3441. pushMessage(s + " is already on your friend list", 0, "");
  3442. return;
  3443. }
  3444. for (int j = 0; j < ignoreCount; j++)
  3445. if (ignoreListAsLongs[j] == l) {
  3446. pushMessage("Please remove " + s
  3447. + " from your ignore list first", 0, "");
  3448. return;
  3449. }
  3450.  
  3451. if (s.equals(myPlayer.name)) {
  3452. return;
  3453. } else {
  3454. friendsList[friendsCount] = s;
  3455. friendsListAsLongs[friendsCount] = l;
  3456. friendsNodeIDs[friendsCount] = 0;
  3457. friendsCount++;
  3458. needDrawTabArea = true;
  3459. stream.createFrame(188);
  3460. stream.writeQWord(l);
  3461. return;
  3462. }
  3463. } catch (RuntimeException runtimeexception) {
  3464. signlink.reporterror("15283, " + (byte) 68 + ", " + l + ", "
  3465. + runtimeexception.toString());
  3466. }
  3467. throw new RuntimeException();
  3468. }
  3469.  
  3470. private int method42(int i, int j, int k) {
  3471. int l = k >> 7;
  3472. int i1 = j >> 7;
  3473. if (l < 0 || i1 < 0 || l > 103 || i1 > 103)
  3474. return 0;
  3475. int j1 = i;
  3476. if (j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  3477. j1++;
  3478. int k1 = k & 0x7f;
  3479. int l1 = j & 0x7f;
  3480. int i2 = intGroundArray[j1][l][i1] * (128 - k1)
  3481. + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  3482. int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1)
  3483. + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  3484. return i2 * (128 - l1) + j2 * l1 >> 7;
  3485. }
  3486.  
  3487. private static String intToKOrMil(int j) {
  3488. if (j == 0)
  3489. return "@inf@";
  3490. if (j < 0x186a0)
  3491. return String.valueOf(j);
  3492. if (j < 0x989680)
  3493. return j / 1000 + "K";
  3494. else
  3495. return j / 0xf4240 + "M";
  3496. }
  3497.  
  3498. public JFrame frame;
  3499.  
  3500. public void resetLogout() {
  3501. try {
  3502. if (socketStream != null)
  3503. socketStream.close();
  3504. } catch (Exception _ex) {
  3505. }
  3506. alertHandler.alert = null;
  3507. socketStream = null;
  3508. loggedIn = false;
  3509. loginScreenState = 0;
  3510. loginMessage1 = "";
  3511. loginMessage2 = "";
  3512. unlinkMRUNodes();
  3513. // resize(765, 503);
  3514. for (int i = 0; i < 4; i++)
  3515. aClass11Array1230[i].method210();
  3516. System.gc();
  3517. stopMidi();
  3518. currentSong = -1;
  3519. nextSong = -1;
  3520. prevSong = 0;
  3521. try {
  3522. Client.writeSettings();
  3523. } catch (IOException e) {
  3524. e.printStackTrace();
  3525. }
  3526. }
  3527.  
  3528. private void method45() {
  3529. aBoolean1031 = true;
  3530. for (int j = 0; j < 7; j++) {
  3531. anIntArray1065[j] = -1;
  3532. for (int k = 0; k < IdentityKit.length; k++) {
  3533. if (IdentityKit.cache[k].aBoolean662
  3534. || IdentityKit.cache[k].anInt657 != j
  3535. + (aBoolean1047 ? 0 : 7))
  3536. continue;
  3537. anIntArray1065[j] = k;
  3538. break;
  3539. }
  3540. }
  3541. }
  3542.  
  3543. private void method46(int i, Stream stream) {
  3544. while (stream.bitPosition + 21 < i * 8) {
  3545. int k = stream.readBits(14);
  3546. if (k == 16383)
  3547. break;
  3548. if (npcArray[k] == null)
  3549. npcArray[k] = new NPC();
  3550. NPC npc = npcArray[k];
  3551. npcIndices[npcCount++] = k;
  3552. npc.anInt1537 = loopCycle;
  3553. int l = stream.readBits(5);
  3554. if (l > 15)
  3555. l -= 32;
  3556. int i1 = stream.readBits(5);
  3557. if (i1 > 15)
  3558. i1 -= 32;
  3559. int j1 = stream.readBits(1);
  3560. npc.desc = EntityDef.forID(stream.readBits(14));
  3561. int k1 = stream.readBits(1);
  3562. if (k1 == 1)
  3563. anIntArray894[anInt893++] = k;
  3564. npc.anInt1540 = npc.desc.aByte68;
  3565. npc.anInt1504 = npc.desc.anInt79;
  3566. npc.anInt1554 = npc.desc.walkAnim;
  3567. npc.anInt1555 = npc.desc.anInt58;
  3568. npc.anInt1556 = npc.desc.anInt83;
  3569. npc.anInt1557 = npc.desc.anInt55;
  3570. npc.anInt1511 = npc.desc.standAnim;
  3571. npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  3572. }
  3573. stream.finishBitAccess();
  3574. }
  3575.  
  3576. public void processGameLoop() {
  3577. if (rsAlreadyLoaded || loadingError || genericLoadingError)
  3578. return;
  3579. loopCycle++;
  3580. if (!loggedIn)
  3581. processLoginScreenInput();
  3582. else
  3583. mainGameProcessor();
  3584. processOnDemandQueue();
  3585. }
  3586.  
  3587. private void method47(boolean flag) {
  3588. if (myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  3589. destX = 0;
  3590. int j = playerCount;
  3591. if (flag)
  3592. j = 1;
  3593. for (int l = 0; l < j; l++) {
  3594. Player player;
  3595. int i1;
  3596. if (flag) {
  3597. player = myPlayer;
  3598. i1 = myPlayerIndex << 14;
  3599. } else {
  3600. player = playerArray[playerIndices[l]];
  3601. i1 = playerIndices[l] << 14;
  3602. }
  3603. if (player == null || !player.isVisible())
  3604. continue;
  3605. player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200)
  3606. && !flag && player.anInt1517 == player.anInt1511;
  3607. int j1 = player.x >> 7;
  3608. int k1 = player.y >> 7;
  3609. if (j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  3610. continue;
  3611. if (player.aModel_1714 != null && loopCycle >= player.anInt1707
  3612. && loopCycle < player.anInt1708) {
  3613. player.aBoolean1699 = false;
  3614. player.anInt1709 = method42(plane, player.y, player.x);
  3615. worldController.method286(plane, player.y, player,
  3616. player.anInt1552, player.anInt1722, player.x,
  3617. player.anInt1709, player.anInt1719, player.anInt1721,
  3618. i1, player.anInt1720);
  3619. continue;
  3620. }
  3621. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  3622. if (anIntArrayArray929[j1][k1] == anInt1265)
  3623. continue;
  3624. anIntArrayArray929[j1][k1] = anInt1265;
  3625. }
  3626. player.anInt1709 = method42(plane, player.y, player.x);
  3627. worldController.method285(plane, player.anInt1552,
  3628. player.anInt1709, i1, player.y, 60, player.x, player,
  3629. player.aBoolean1541);
  3630. }
  3631. }
  3632.  
  3633. private boolean promptUserForInput(RSInterface class9) {
  3634. int j = class9.contentType;
  3635. if (anInt900 == 2) {
  3636. if (j == 201) {
  3637. inputTaken = true;
  3638. inputDialogState = 0;
  3639. messagePromptRaised = true;
  3640. promptInput = "";
  3641. friendsListAction = 1;
  3642. aString1121 = "Enter name of friend to add to list";
  3643. }
  3644. if (j == 202) {
  3645. inputTaken = true;
  3646. inputDialogState = 0;
  3647. messagePromptRaised = true;
  3648. promptInput = "";
  3649. friendsListAction = 2;
  3650. aString1121 = "Enter name of friend to delete from list";
  3651. }
  3652. }
  3653. if (j == 205) {
  3654. anInt1011 = 250;
  3655. return true;
  3656. }
  3657. if (j == 501) {
  3658. inputTaken = true;
  3659. inputDialogState = 0;
  3660. messagePromptRaised = true;
  3661. promptInput = "";
  3662. friendsListAction = 4;
  3663. aString1121 = "Enter name of player to add to list";
  3664. }
  3665. if (j == 502) {
  3666. inputTaken = true;
  3667. inputDialogState = 0;
  3668. messagePromptRaised = true;
  3669. promptInput = "";
  3670. friendsListAction = 5;
  3671. aString1121 = "Enter name of player to delete from list";
  3672. }
  3673. if (j == 550) {
  3674. inputTaken = true;
  3675. inputDialogState = 0;
  3676. messagePromptRaised = true;
  3677. promptInput = "";
  3678. friendsListAction = 6;
  3679. aString1121 = "Enter the name of the chat you wish to join";
  3680. }
  3681. if (j >= 300 && j <= 313) {
  3682. int k = (j - 300) / 2;
  3683. int j1 = j & 1;
  3684. int i2 = anIntArray1065[k];
  3685. if (i2 != -1) {
  3686. do {
  3687. if (j1 == 0 && --i2 < 0)
  3688. i2 = IdentityKit.length - 1;
  3689. if (j1 == 1 && ++i2 >= IdentityKit.length)
  3690. i2 = 0;
  3691. } while (IdentityKit.cache[i2].aBoolean662
  3692. || IdentityKit.cache[i2].anInt657 != k
  3693. + (aBoolean1047 ? 0 : 7));
  3694. anIntArray1065[k] = i2;
  3695. aBoolean1031 = true;
  3696. }
  3697. }
  3698. if (j >= 314 && j <= 323) {
  3699. int l = (j - 314) / 2;
  3700. int k1 = j & 1;
  3701. int j2 = anIntArray990[l];
  3702. if (k1 == 0 && --j2 < 0)
  3703. j2 = anIntArrayArray1003[l].length - 1;
  3704. if (k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  3705. j2 = 0;
  3706. anIntArray990[l] = j2;
  3707. aBoolean1031 = true;
  3708. }
  3709. if (j == 324 && !aBoolean1047) {
  3710. aBoolean1047 = true;
  3711. method45();
  3712. }
  3713. if (j == 325 && aBoolean1047) {
  3714. aBoolean1047 = false;
  3715. method45();
  3716. }
  3717. // search here martin
  3718. if (j == 326) {
  3719. stream.createFrame(101);
  3720. stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  3721. for (int i1 = 0; i1 < 7; i1++)
  3722. stream.writeWordBigEndian(anIntArray1065[i1]);
  3723.  
  3724. for (int l1 = 0; l1 < 5; l1++)
  3725. stream.writeWordBigEndian(anIntArray990[l1]);
  3726.  
  3727. return true;
  3728. }
  3729. if (j == 613)
  3730. canMute = !canMute;
  3731. if (j == 600)
  3732. class9.message = customInterfaceInput + "";
  3733. if (j >= 601 && j <= 612) {
  3734. clearTopInterfaces();
  3735. if (reportAbuseInput.length() > 0) {
  3736. stream.createFrame(218);
  3737. stream.writeQWord(TextClass.longForName(reportAbuseInput));
  3738. stream.writeWordBigEndian(j - 601);
  3739. stream.writeWordBigEndian(canMute ? 1 : 0);
  3740. }
  3741. }
  3742. return false;
  3743. }
  3744.  
  3745. public String customInterfaceInput = "";
  3746.  
  3747. private void method49(Stream stream) {
  3748. for (int j = 0; j < anInt893; j++) {
  3749. int k = anIntArray894[j];
  3750. Player player = playerArray[k];
  3751. int l = stream.readUnsignedByte();
  3752. if ((l & 0x40) != 0)
  3753. l += stream.readUnsignedByte() << 8;
  3754. method107(l, k, stream, player);
  3755. }
  3756. }
  3757.  
  3758. private void method50(int i, int k, int l, int i1, int j1) {
  3759. int k1 = worldController.method300(j1, l, i);
  3760. if (k1 != 0) {
  3761. int l1 = worldController.method304(j1, l, i, k1);
  3762. int k2 = l1 >> 6 & 3;
  3763. int i3 = l1 & 0x1f;
  3764. int k3 = k;
  3765. if (k1 > 0)
  3766. k3 = i1;
  3767. int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  3768. int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3769. int i5 = k1 >> 14 & 0x7fff;
  3770. ObjectDef class46_2 = ObjectDef.forID(i5);
  3771. if (class46_2.anInt758 != -1) {
  3772. Background background_2 = mapScenes[class46_2.anInt758];
  3773. if (background_2 != null) {
  3774. int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  3775. int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  3776. background_2.drawBackground(48 + l * 4 + i6, 48
  3777. + (104 - i - class46_2.anInt761) * 4 + j6);
  3778. }
  3779. } else {
  3780. if (i3 == 0 || i3 == 2)
  3781. if (k2 == 0) {
  3782. ai[k4] = k3;
  3783. ai[k4 + 512] = k3;
  3784. ai[k4 + 1024] = k3;
  3785. ai[k4 + 1536] = k3;
  3786. } else if (k2 == 1) {
  3787. ai[k4] = k3;
  3788. ai[k4 + 1] = k3;
  3789. ai[k4 + 2] = k3;
  3790. ai[k4 + 3] = k3;
  3791. } else if (k2 == 2) {
  3792. ai[k4 + 3] = k3;
  3793. ai[k4 + 3 + 512] = k3;
  3794. ai[k4 + 3 + 1024] = k3;
  3795. ai[k4 + 3 + 1536] = k3;
  3796. } else if (k2 == 3) {
  3797. ai[k4 + 1536] = k3;
  3798. ai[k4 + 1536 + 1] = k3;
  3799. ai[k4 + 1536 + 2] = k3;
  3800. ai[k4 + 1536 + 3] = k3;
  3801. }
  3802. if (i3 == 3)
  3803. if (k2 == 0)
  3804. ai[k4] = k3;
  3805. else if (k2 == 1)
  3806. ai[k4 + 3] = k3;
  3807. else if (k2 == 2)
  3808. ai[k4 + 3 + 1536] = k3;
  3809. else if (k2 == 3)
  3810. ai[k4 + 1536] = k3;
  3811. if (i3 == 2)
  3812. if (k2 == 3) {
  3813. ai[k4] = k3;
  3814. ai[k4 + 512] = k3;
  3815. ai[k4 + 1024] = k3;
  3816. ai[k4 + 1536] = k3;
  3817. } else if (k2 == 0) {
  3818. ai[k4] = k3;
  3819. ai[k4 + 1] = k3;
  3820. ai[k4 + 2] = k3;
  3821. ai[k4 + 3] = k3;
  3822. } else if (k2 == 1) {
  3823. ai[k4 + 3] = k3;
  3824. ai[k4 + 3 + 512] = k3;
  3825. ai[k4 + 3 + 1024] = k3;
  3826. ai[k4 + 3 + 1536] = k3;
  3827. } else if (k2 == 2) {
  3828. ai[k4 + 1536] = k3;
  3829. ai[k4 + 1536 + 1] = k3;
  3830. ai[k4 + 1536 + 2] = k3;
  3831. ai[k4 + 1536 + 3] = k3;
  3832. }
  3833. }
  3834. }
  3835. k1 = worldController.method302(j1, l, i);
  3836. if (k1 != 0) {
  3837. int i2 = worldController.method304(j1, l, i, k1);
  3838. int l2 = i2 >> 6 & 3;
  3839. int j3 = i2 & 0x1f;
  3840. int l3 = k1 >> 14 & 0x7fff;
  3841. ObjectDef class46_1 = ObjectDef.forID(l3);
  3842. if (class46_1.anInt758 != -1) {
  3843. Background background_1 = mapScenes[class46_1.anInt758];
  3844. if (background_1 != null) {
  3845. int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  3846. int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  3847. background_1.drawBackground(48 + l * 4 + j5, 48
  3848. + (104 - i - class46_1.anInt761) * 4 + k5);
  3849. }
  3850. } else if (j3 == 9) {
  3851. int l4 = 0xeeeeee;
  3852. if (k1 > 0)
  3853. l4 = 0xee0000;
  3854. int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  3855. int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  3856. if (l2 == 0 || l2 == 2) {
  3857. ai1[l5 + 1536] = l4;
  3858. ai1[l5 + 1024 + 1] = l4;
  3859. ai1[l5 + 512 + 2] = l4;
  3860. ai1[l5 + 3] = l4;
  3861. } else {
  3862. ai1[l5] = l4;
  3863. ai1[l5 + 512 + 1] = l4;
  3864. ai1[l5 + 1024 + 2] = l4;
  3865. ai1[l5 + 1536 + 3] = l4;
  3866. }
  3867. }
  3868. }
  3869. k1 = worldController.method303(j1, l, i);
  3870. if (k1 != 0) {
  3871. int j2 = k1 >> 14 & 0x7fff;
  3872. ObjectDef class46 = ObjectDef.forID(j2);
  3873. if (class46.anInt758 != -1) {
  3874. Background background = mapScenes[class46.anInt758];
  3875. if (background != null) {
  3876. int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  3877. int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  3878. background.drawBackground(48 + l * 4 + i4, 48
  3879. + (104 - i - class46.anInt761) * 4 + j4);
  3880. }
  3881. }
  3882. }
  3883. }
  3884.  
  3885. private void loadTitleScreen() {
  3886. loginBox = new Background(titleStreamLoader, "titlebox", 0);
  3887. loginButton = new Sprite(titleStreamLoader, "titlebutton", 0);
  3888. loginButtonHover = new Sprite(titleStreamLoader, "titlebutton", 1);
  3889. textBox = new Sprite(titleStreamLoader, "titlebox", 1);
  3890. textBoxHover = new Sprite(titleStreamLoader, "titlebox", 2);
  3891. aBackgroundArray1152s = new Background[12];
  3892. int j = 0;
  3893. try {
  3894. j = Integer.parseInt(getParameter("fl_icon"));
  3895. } catch (Exception _ex) {
  3896. }
  3897. if (j == 0) {
  3898. for (int k = 0; k < 12; k++)
  3899. aBackgroundArray1152s[k] = new Background(titleStreamLoader,
  3900. "runes", k);
  3901.  
  3902. } else {
  3903. for (int l = 0; l < 12; l++)
  3904. aBackgroundArray1152s[l] = new Background(titleStreamLoader,
  3905. "runes", 12 + (l & 3));
  3906.  
  3907. }
  3908. aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  3909. aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  3910. System.arraycopy(aRSImageProducer_1110.anIntArray315, 0,
  3911. aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  3912.  
  3913. System.arraycopy(aRSImageProducer_1111.anIntArray315, 0,
  3914. aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  3915.  
  3916. anIntArray851 = new int[256];
  3917. for (int k1 = 0; k1 < 64; k1++)
  3918. anIntArray851[k1] = k1 * 0x40000;
  3919.  
  3920. for (int l1 = 0; l1 < 64; l1++)
  3921. anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  3922.  
  3923. for (int i2 = 0; i2 < 64; i2++)
  3924. anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  3925.  
  3926. for (int j2 = 0; j2 < 64; j2++)
  3927. anIntArray851[j2 + 192] = 0xffffff;
  3928.  
  3929. anIntArray852 = new int[256];
  3930. for (int k2 = 0; k2 < 64; k2++)
  3931. anIntArray852[k2] = k2 * 1024;
  3932.  
  3933. for (int l2 = 0; l2 < 64; l2++)
  3934. anIntArray852[l2 + 64] = 65280 + 4 * l2;
  3935.  
  3936. for (int i3 = 0; i3 < 64; i3++)
  3937. anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  3938.  
  3939. for (int j3 = 0; j3 < 64; j3++)
  3940. anIntArray852[j3 + 192] = 0xffffff;
  3941.  
  3942. anIntArray853 = new int[256];
  3943. for (int k3 = 0; k3 < 64; k3++)
  3944. anIntArray853[k3] = k3 * 4;
  3945.  
  3946. for (int l3 = 0; l3 < 64; l3++)
  3947. anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  3948.  
  3949. for (int i4 = 0; i4 < 64; i4++)
  3950. anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  3951.  
  3952. for (int j4 = 0; j4 < 64; j4++)
  3953. anIntArray853[j4 + 192] = 0xffffff;
  3954.  
  3955. anIntArray850 = new int[256];
  3956. anIntArray1190 = new int[32768];
  3957. anIntArray1191 = new int[32768];
  3958. randomizeBackground(null);
  3959. anIntArray828 = new int[32768];
  3960. anIntArray829 = new int[32768];
  3961. drawLoadingText(10, "Please be patient while the game is loading.");
  3962. if (!aBoolean831) {
  3963. drawFlames = true;
  3964. aBoolean831 = true;
  3965. startRunnable(this, 2);
  3966. }
  3967. }
  3968.  
  3969. private static void setHighMem() {
  3970. WorldController.lowMem = false;
  3971. Texture.lowMem = false;
  3972. lowMem = false;
  3973. ObjectManager.lowMem = false;
  3974. ObjectDef.lowMem = false;
  3975. }
  3976.  
  3977. public static Client uberClient;
  3978.  
  3979. private void loadingStages() {
  3980. if (lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  3981. aRSImageProducer_1165.initDrawingArea();
  3982. loadingPleaseWait.drawSprite(8, 9);
  3983. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3984. loadingStage = 1;
  3985. aLong824 = System.currentTimeMillis();
  3986. }
  3987. if (loadingStage == 1) {
  3988. int j = method54();
  3989. if (j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  3990. signlink.reporterror(myUsername + " glcfb " + aLong1215 + ","
  3991. + j + "," + lowMem + "," + decompressors[0] + ","
  3992. + onDemandFetcher.getNodeCount() + "," + plane + ","
  3993. + anInt1069 + "," + anInt1070);
  3994. aLong824 = System.currentTimeMillis();
  3995. }
  3996. }
  3997. if (loadingStage == 2 && plane != anInt985) {
  3998. anInt985 = plane;
  3999. method24(plane);
  4000. }
  4001. }
  4002.  
  4003. private int method54() {
  4004. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  4005. if (aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  4006. return -1;
  4007. if (aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  4008. return -2;
  4009. }
  4010. boolean flag = true;
  4011. for (int j = 0; j < aByteArrayArray1183.length; j++) {
  4012. byte abyte0[] = aByteArrayArray1247[j];
  4013. if (abyte0 != null) {
  4014. int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  4015. int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  4016. if (aBoolean1159) {
  4017. k = 10;
  4018. l = 10;
  4019. }
  4020. try {
  4021. flag &= ObjectManager.method189(k, abyte0, l);
  4022. } catch (Exception e) {
  4023. e.printStackTrace();
  4024. }
  4025. }
  4026. }
  4027. if (!flag)
  4028. return -3;
  4029. if (aBoolean1080) {
  4030. return -4;
  4031. } else {
  4032. loadingStage = 2;
  4033. ObjectManager.anInt131 = plane;
  4034. method22();
  4035. stream.createFrame(121);
  4036. return 0;
  4037. }
  4038. }
  4039.  
  4040. private void method55() {
  4041. for (Animable_Sub4 class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  4042. .reverseGetFirst(); class30_sub2_sub4_sub4 != null; class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
  4043. .reverseGetNext())
  4044. if (class30_sub2_sub4_sub4.anInt1597 != plane
  4045. || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  4046. class30_sub2_sub4_sub4.unlink();
  4047. else if (loopCycle >= class30_sub2_sub4_sub4.anInt1571) {
  4048. if (class30_sub2_sub4_sub4.anInt1590 > 0) {
  4049. NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  4050. if (npc != null && npc.x >= 0 && npc.x < 13312
  4051. && npc.y >= 0 && npc.y < 13312)
  4052. class30_sub2_sub4_sub4.method455(
  4053. loopCycle,
  4054. npc.y,
  4055. method42(class30_sub2_sub4_sub4.anInt1597,
  4056. npc.y, npc.x)
  4057. - class30_sub2_sub4_sub4.anInt1583,
  4058. npc.x);
  4059. }
  4060. if (class30_sub2_sub4_sub4.anInt1590 < 0) {
  4061. int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  4062. Player player;
  4063. if (j == unknownInt10)
  4064. player = myPlayer;
  4065. else
  4066. player = playerArray[j];
  4067. if (player != null && player.x >= 0 && player.x < 13312
  4068. && player.y >= 0 && player.y < 13312)
  4069. class30_sub2_sub4_sub4.method455(
  4070. loopCycle,
  4071. player.y,
  4072. method42(class30_sub2_sub4_sub4.anInt1597,
  4073. player.y, player.x)
  4074. - class30_sub2_sub4_sub4.anInt1583,
  4075. player.x);
  4076. }
  4077. class30_sub2_sub4_sub4.method456(anInt945);
  4078. worldController.method285(plane,
  4079. class30_sub2_sub4_sub4.anInt1595,
  4080. (int) class30_sub2_sub4_sub4.aDouble1587, -1,
  4081. (int) class30_sub2_sub4_sub4.aDouble1586, 60,
  4082. (int) class30_sub2_sub4_sub4.aDouble1585,
  4083. class30_sub2_sub4_sub4, false);
  4084. }
  4085.  
  4086. }
  4087.  
  4088. public AppletContext getAppletContext() {
  4089. if (signlink.mainapp != null)
  4090. return signlink.mainapp.getAppletContext();
  4091. else
  4092. return super.getAppletContext();
  4093. }
  4094.  
  4095. public void drawLogo() {
  4096. byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  4097. Sprite sprite = new Sprite(abyte0, this);
  4098. aRSImageProducer_1110.initDrawingArea();
  4099. sprite.drawSprite(0, 0);
  4100. aRSImageProducer_1111.initDrawingArea();
  4101. sprite.drawSprite(-637, 0);
  4102. aRSImageProducer_1107.initDrawingArea();
  4103. sprite.drawSprite(-128, 0);
  4104. aRSImageProducer_1108.initDrawingArea();
  4105. sprite.drawSprite(-202, -371);
  4106. aRSImageProducer_1109.initDrawingArea();
  4107. sprite.drawSprite(-202, -171);
  4108. aRSImageProducer_1112.initDrawingArea();
  4109. sprite.drawSprite(0, -265);
  4110. aRSImageProducer_1113.initDrawingArea();
  4111. sprite.drawSprite(-562, -265);
  4112. aRSImageProducer_1114.initDrawingArea();
  4113. sprite.drawSprite(-128, -171);
  4114. aRSImageProducer_1115.initDrawingArea();
  4115. sprite.drawSprite(-562, -171);
  4116. sprite = null;
  4117. Object obj = null;
  4118. Object obj1 = null;
  4119. System.gc();
  4120. }
  4121.  
  4122. private void processOnDemandQueue() {
  4123. do {
  4124. OnDemandData onDemandData;
  4125. do {
  4126. onDemandData = onDemandFetcher.getNextNode();
  4127. if (onDemandData == null)
  4128. return;
  4129. if (onDemandData.dataType == 0) {
  4130. Model.method460(onDemandData.buffer, onDemandData.ID);
  4131. // if((onDemandFetcher.getModelIndex(onDemandData.ID) &
  4132. // 0x62) != 0)
  4133. // {
  4134. needDrawTabArea = true;
  4135. if (backDialogID != -1)
  4136. inputTaken = true;
  4137. // }
  4138. }
  4139. if (onDemandData.dataType == 1 && onDemandData.buffer != null)
  4140. // Class36.method529(onDemandData.buffer);//anim mation
  4141. // stuff
  4142. if (onDemandData.dataType == 2
  4143. && onDemandData.ID == nextSong
  4144. && onDemandData.buffer != null)
  4145. saveMidi(songChanging, onDemandData.buffer);
  4146. if (onDemandData.dataType == 3 && loadingStage == 1) {
  4147. for (int i = 0; i < aByteArrayArray1183.length; i++) {
  4148. if (anIntArray1235[i] == onDemandData.ID) {
  4149. aByteArrayArray1183[i] = onDemandData.buffer;
  4150. if (onDemandData.buffer == null)
  4151. anIntArray1235[i] = -1;
  4152. break;
  4153. }
  4154. if (anIntArray1236[i] != onDemandData.ID)
  4155. continue;
  4156. aByteArrayArray1247[i] = onDemandData.buffer;
  4157. if (onDemandData.buffer == null)
  4158. anIntArray1236[i] = -1;
  4159. break;
  4160. }
  4161.  
  4162. }
  4163. } while (onDemandData.dataType != 93
  4164. || !onDemandFetcher.method564(onDemandData.ID));
  4165. ObjectManager.method173(new Stream(onDemandData.buffer),
  4166. onDemandFetcher);
  4167. } while (true);
  4168. }
  4169.  
  4170. private void calcFlamesPosition() {
  4171. char c = '\u0100';
  4172. for (int j = 10; j < 117; j++) {
  4173. int k = (int) (Math.random() * 100D);
  4174. if (k < 50)
  4175. anIntArray828[j + (c - 2 << 7)] = 255;
  4176. }
  4177. for (int l = 0; l < 100; l++) {
  4178. int i1 = (int) (Math.random() * 124D) + 2;
  4179. int k1 = (int) (Math.random() * 128D) + 128;
  4180. int k2 = i1 + (k1 << 7);
  4181. anIntArray828[k2] = 192;
  4182. }
  4183.  
  4184. for (int j1 = 1; j1 < c - 1; j1++) {
  4185. for (int l1 = 1; l1 < 127; l1++) {
  4186. int l2 = l1 + (j1 << 7);
  4187. anIntArray829[l2] = (anIntArray828[l2 - 1]
  4188. + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  4189. }
  4190.  
  4191. }
  4192.  
  4193. anInt1275 += 128;
  4194. if (anInt1275 > anIntArray1190.length) {
  4195. anInt1275 -= anIntArray1190.length;
  4196. int i2 = (int) (Math.random() * 12D);
  4197. randomizeBackground(aBackgroundArray1152s[i2]);
  4198. }
  4199. for (int j2 = 1; j2 < c - 1; j2++) {
  4200. for (int i3 = 1; i3 < 127; i3++) {
  4201. int k3 = i3 + (j2 << 7);
  4202. int i4 = anIntArray829[k3 + 128]
  4203. - anIntArray1190[k3 + anInt1275 & anIntArray1190.length
  4204. - 1] / 5;
  4205. if (i4 < 0)
  4206. i4 = 0;
  4207. anIntArray828[k3] = i4;
  4208. }
  4209.  
  4210. }
  4211.  
  4212. System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  4213.  
  4214. anIntArray969[c - 1] = (int) (Math.sin((double) loopCycle / 14D) * 16D
  4215. + Math.sin((double) loopCycle / 15D) * 14D + Math
  4216. .sin((double) loopCycle / 16D) * 12D);
  4217. if (anInt1040 > 0)
  4218. anInt1040 -= 4;
  4219. if (anInt1041 > 0)
  4220. anInt1041 -= 4;
  4221. if (anInt1040 == 0 && anInt1041 == 0) {
  4222. int l3 = (int) (Math.random() * 2000D);
  4223. if (l3 == 0)
  4224. anInt1040 = 1024;
  4225. if (l3 == 1)
  4226. anInt1041 = 1024;
  4227. }
  4228. }
  4229.  
  4230. private boolean saveWave(byte abyte0[], int i) {
  4231. return abyte0 == null || signlink.wavesave(abyte0, i);
  4232. }
  4233.  
  4234. private void method60(int i) {
  4235. RSInterface class9 = RSInterface.interfaceCache[i];
  4236. if (class9 == null)
  4237. return;
  4238. for (int j = 0; j < class9.children.length; j++) {
  4239. if (class9.children[j] == -1)
  4240. break;
  4241. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  4242. if (class9_1.type == 1)
  4243. method60(class9_1.id);
  4244. class9_1.anInt246 = 0;
  4245. class9_1.anInt208 = 0;
  4246. }
  4247. }
  4248.  
  4249. private void drawHeadIcon() {
  4250. if (anInt855 != 2)
  4251. return;
  4252. calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2,
  4253. (anInt935 - baseY << 7) + anInt938);
  4254. if (spriteDrawX > -1 && loopCycle % 20 < 10)
  4255. headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  4256. }
  4257.  
  4258. public static void main(String[] args) {
  4259. try
  4260. {
  4261. System.out.println("Starting client!");
  4262. nodeID = 10;
  4263. portOff = 0;
  4264. setHighMem();
  4265. isMembers = true;
  4266. clientHeight = 503;
  4267. clientWidth = 765;
  4268. signlink.storeid = 32;
  4269. signlink.startpriv(InetAddress.getByName("127.0.0.1"));
  4270.  
  4271. new SwingUI(args);
  4272.  
  4273. }
  4274. catch (Exception localException)
  4275. {
  4276. localException.printStackTrace();
  4277. }
  4278. }
  4279.  
  4280. private void mainGameProcessor() {
  4281. // System.out.println("MainGameProcessor()");
  4282. if (anInt1104 > 1)
  4283. anInt1104--;
  4284. if (anInt1011 > 0)
  4285. anInt1011--;
  4286. for (int j = 0; j < 5; j++)
  4287. if (!parsePacket())
  4288. break;
  4289.  
  4290. if (!loggedIn)
  4291. return;
  4292. synchronized (mouseDetection.syncObject) {
  4293. if (clientWidth - 765 != extraWidth
  4294. || clientHeight - 503 != extraHeight
  4295. || (isFullScreen && (getWidth() != clientWidth || getHeight() != clientHeight))) {
  4296. hasBeenBlanked = false;
  4297. if (isFullScreen) {
  4298. extraWidth = getWidth() - 765;
  4299. extraHeight = getHeight() - 503;
  4300. clientWidth = extraWidth + 765;
  4301. clientHeight = extraHeight + 503;
  4302. } else {
  4303. clientWidth = 765;
  4304. clientHeight = 503;
  4305. extraWidth = 0;
  4306. extraHeight = 0;
  4307. }
  4308. if (isFullScreen && extraWidth >= 230) {
  4309. drawLongTabs = true;
  4310. } else {
  4311. drawLongTabs = false;
  4312. }
  4313. if (isFullScreen && extraWidth >= 243 && is554) {
  4314. drawLongTabs = true;
  4315. } else {
  4316. drawLongTabs = false;
  4317. }
  4318. if (isFullScreen) {
  4319. try {
  4320. Texture.method365(clientWidth, clientHeight);
  4321. anIntArray1180 = Texture.anIntArray1472;
  4322. Texture.method365(clientWidth, clientHeight);
  4323. anIntArray1181 = Texture.anIntArray1472;
  4324. Texture.method365(clientWidth, clientHeight);
  4325. } catch (Exception e) {
  4326. e.printStackTrace();
  4327. }
  4328. anIntArray1182 = Texture.anIntArray1472;
  4329. int ai[] = new int[9];
  4330. for (int i8 = 0; i8 < 9; i8++) {
  4331. int k8 = 128 + i8 * 32 + 15;
  4332. int l8 = 600 + k8 * 3;
  4333. int i9 = Texture.anIntArray1470[k8];
  4334. ai[i8] = l8 * i9 >> 16;
  4335. }
  4336. WorldController.method310(500, 800, clientWidth,
  4337. clientHeight, ai);
  4338. buffer = getGameComponent().createImage(765 + extraWidth,
  4339. 503 + extraHeight);
  4340. bufferGraphics = buffer.getGraphics();
  4341. try {
  4342. super.fullGameScreen = new RSImageProducer(clientWidth,
  4343. clientHeight, getGameComponent());
  4344. aRSImageProducer_1165 = new RSImageProducer(
  4345. clientWidth, clientHeight, getGameComponent());
  4346. // 2Jframe.frame.resize(new Dimension(765+extraWidth,
  4347. // 503+extraHeight+46));
  4348. } catch (Exception e) {
  4349. e.printStackTrace();
  4350. }
  4351. } else {
  4352. Texture.method365(765, 503);
  4353. fullScreenTextureArray = Texture.anIntArray1472;
  4354. Texture.method365(519, 165);
  4355. anIntArray1180 = Texture.anIntArray1472;
  4356. Texture.method365(246, 335);
  4357. anIntArray1181 = Texture.anIntArray1472;
  4358. Texture.method365(512, 334);
  4359. anIntArray1182 = Texture.anIntArray1472;
  4360. int ai[] = new int[9];
  4361. for (int i8 = 0; i8 < 9; i8++) {
  4362. int k8 = 128 + i8 * 32 + 15;
  4363. int l8 = 600 + k8 * 3;
  4364. int i9 = Texture.anIntArray1470[k8];
  4365. ai[i8] = l8 * i9 >> 16;
  4366. }
  4367. WorldController.method310(500, 800, 512, 334, ai);
  4368. try {
  4369. super.fullGameScreen = new RSImageProducer(765, 503,
  4370. getGameComponent());
  4371. aRSImageProducer_1165 = new RSImageProducer(512, 334,
  4372. getGameComponent());
  4373. } catch (Exception e) {
  4374. e.printStackTrace();
  4375. }
  4376. }
  4377. }
  4378. if (flagged) {
  4379. if (super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40) {
  4380. stream.createFrame(45);
  4381. stream.writeWordBigEndian(0);
  4382. int j2 = stream.currentOffset;
  4383. int j3 = 0;
  4384. for (int j4 = 0; j4 < mouseDetection.coordsIndex; j4++) {
  4385. if (j2 - stream.currentOffset >= 240)
  4386. break;
  4387. j3++;
  4388. int l4 = mouseDetection.coordsY[j4];
  4389. if (l4 < 0)
  4390. l4 = 0;
  4391. else if (l4 > 502)
  4392. l4 = 502;
  4393. int k5 = mouseDetection.coordsX[j4];
  4394. if (k5 < 0)
  4395. k5 = 0;
  4396. else if (k5 > 764)
  4397. k5 = 764;
  4398. int i6 = l4 * 765 + k5;
  4399. if (mouseDetection.coordsY[j4] == -1
  4400. && mouseDetection.coordsX[j4] == -1) {
  4401. k5 = -1;
  4402. l4 = -1;
  4403. i6 = 0x7ffff;
  4404. }
  4405. if (k5 == anInt1237 && l4 == anInt1238) {
  4406. if (anInt1022 < 2047)
  4407. anInt1022++;
  4408. } else {
  4409. int j6 = k5 - anInt1237;
  4410. anInt1237 = k5;
  4411. int k6 = l4 - anInt1238;
  4412. anInt1238 = l4;
  4413. if (anInt1022 < 8 && j6 >= -32 && j6 <= 31
  4414. && k6 >= -32 && k6 <= 31) {
  4415. j6 += 32;
  4416. k6 += 32;
  4417. stream.writeWord((anInt1022 << 12) + (j6 << 6)
  4418. + k6);
  4419. anInt1022 = 0;
  4420. } else if (anInt1022 < 8) {
  4421. stream.writeDWordBigEndian(0x800000
  4422. + (anInt1022 << 19) + i6);
  4423. anInt1022 = 0;
  4424. } else {
  4425. stream.writeDWord(0xc0000000
  4426. + (anInt1022 << 19) + i6);
  4427. anInt1022 = 0;
  4428. }
  4429. }
  4430. }
  4431.  
  4432. stream.writeBytes(stream.currentOffset - j2);
  4433. if (j3 >= mouseDetection.coordsIndex) {
  4434. mouseDetection.coordsIndex = 0;
  4435. } else {
  4436. mouseDetection.coordsIndex -= j3;
  4437. for (int i5 = 0; i5 < mouseDetection.coordsIndex; i5++) {
  4438. mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5
  4439. + j3];
  4440. mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5
  4441. + j3];
  4442. }
  4443.  
  4444. }
  4445. }
  4446. } else {
  4447. mouseDetection.coordsIndex = 0;
  4448. }
  4449. }
  4450. if (super.clickMode3 != 0) {
  4451. long l = (super.aLong29 - aLong1220) / 50L;
  4452. if (l > 4095L)
  4453. l = 4095L;
  4454. aLong1220 = super.aLong29;
  4455. int k2 = super.saveClickY;
  4456. if (k2 < 0)
  4457. k2 = 0;
  4458. else if (k2 > 502)
  4459. k2 = 502;
  4460. int k3 = super.saveClickX;
  4461. if (k3 < 0)
  4462. k3 = 0;
  4463. else if (k3 > 764)
  4464. k3 = 764;
  4465. int k4 = k2 * 765 + k3;
  4466. int j5 = 0;
  4467. if (super.clickMode3 == 2)
  4468. j5 = 1;
  4469. int l5 = (int) l;
  4470. stream.createFrame(241);
  4471. stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  4472. }
  4473. if (anInt1016 > 0)
  4474. anInt1016--;
  4475. if (super.keyArray[1] == 1 || super.keyArray[2] == 1
  4476. || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  4477. aBoolean1017 = true;
  4478. if (aBoolean1017 && anInt1016 <= 0) {
  4479. anInt1016 = 20;
  4480. aBoolean1017 = false;
  4481. stream.createFrame(86);
  4482. stream.writeWord(anInt1184);
  4483. stream.method432(minimapInt1);
  4484. }
  4485. if (super.awtFocus && !aBoolean954) {
  4486. aBoolean954 = true;
  4487. stream.createFrame(3);
  4488. stream.writeWordBigEndian(1);
  4489. }
  4490. if (!super.awtFocus && aBoolean954) {
  4491. aBoolean954 = false;
  4492. stream.createFrame(3);
  4493. stream.writeWordBigEndian(0);
  4494. }
  4495. loadingStages();
  4496. method115();
  4497. method90();
  4498. anInt1009++;
  4499. if (anInt1009 > 750)
  4500. dropClient();
  4501. method114();
  4502. method95();
  4503. method38();
  4504. anInt945++;
  4505. if (crossType != 0) {
  4506. crossIndex += 20;
  4507. if (crossIndex >= 400)
  4508. crossType = 0;
  4509. }
  4510. if (atInventoryInterfaceType != 0) {
  4511. atInventoryLoopCycle++;
  4512. if (atInventoryLoopCycle >= 15) {
  4513. if (atInventoryInterfaceType == 2)
  4514. needDrawTabArea = true;
  4515. if (atInventoryInterfaceType == 3)
  4516. inputTaken = true;
  4517. atInventoryInterfaceType = 0;
  4518. }
  4519. }
  4520. if (activeInterfaceType != 0) {
  4521. anInt989++;
  4522. if (super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5
  4523. || super.mouseY > anInt1088 + 5
  4524. || super.mouseY < anInt1088 - 5)
  4525. aBoolean1242 = true;
  4526. if (super.clickMode2 == 0) {
  4527. if (activeInterfaceType == 2)
  4528. needDrawTabArea = true;
  4529. if (activeInterfaceType == 3)
  4530. inputTaken = true;
  4531. activeInterfaceType = 0;
  4532. if (aBoolean1242 && anInt989 >= 10) {
  4533. lastActiveInvInterface = -1;
  4534. processRightClick();
  4535. if (lastActiveInvInterface == anInt1084
  4536. && mouseInvInterfaceIndex != anInt1085) {
  4537. RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  4538. int j1 = 0;
  4539. if (anInt913 == 1 && class9.contentType == 206)
  4540. j1 = 1;
  4541. if (class9.inv[mouseInvInterfaceIndex] <= 0)
  4542. j1 = 0;
  4543. if (class9.aBoolean235) {
  4544. int l2 = anInt1085;
  4545. int l3 = mouseInvInterfaceIndex;
  4546. class9.inv[l3] = class9.inv[l2];
  4547. class9.invStackSizes[l3] = class9.invStackSizes[l2];
  4548. class9.inv[l2] = -1;
  4549. class9.invStackSizes[l2] = 0;
  4550. } else if (j1 == 1) {
  4551. int i3 = anInt1085;
  4552. for (int i4 = mouseInvInterfaceIndex; i3 != i4;)
  4553. if (i3 > i4) {
  4554. class9.swapInventoryItems(i3, i3 - 1);
  4555. i3--;
  4556. } else if (i3 < i4) {
  4557. class9.swapInventoryItems(i3, i3 + 1);
  4558. i3++;
  4559. }
  4560.  
  4561. } else {
  4562. class9.swapInventoryItems(anInt1085,
  4563. mouseInvInterfaceIndex);
  4564. }
  4565. stream.createFrame(214);
  4566. stream.method433(anInt1084);
  4567. stream.method424(j1);
  4568. stream.method433(anInt1085);
  4569. stream.method431(mouseInvInterfaceIndex);
  4570. }
  4571. } else if ((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1))
  4572. && menuActionRow > 2)
  4573. determineMenuSize();
  4574. else if (menuActionRow > 0)
  4575. doAction(menuActionRow - 1);
  4576. atInventoryLoopCycle = 10;
  4577. super.clickMode3 = 0;
  4578. }
  4579. }
  4580. if (WorldController.anInt470 != -1) {
  4581. int k = WorldController.anInt470;
  4582. int k1 = WorldController.anInt471;
  4583. boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1,
  4584. myPlayer.smallX[0], true, k);
  4585. WorldController.anInt470 = -1;
  4586. if (flag) {
  4587. crossX = super.saveClickX;
  4588. crossY = super.saveClickY;
  4589. crossType = 1;
  4590. crossIndex = 0;
  4591. }
  4592. }
  4593. if (super.clickMode3 == 1 && aString844 != null) {
  4594. aString844 = null;
  4595. inputTaken = true;
  4596. super.clickMode3 = 0;
  4597. }
  4598. processMenuClick();
  4599. processMainScreenClick();
  4600. processTabClick();
  4601. processChatModeClick();
  4602. processMapAreaClick();
  4603. if (super.clickMode2 == 1 || super.clickMode3 == 1)
  4604. anInt1213++;
  4605. if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  4606. if (anInt1501 < 100) {
  4607. anInt1501++;
  4608. if (anInt1501 == 100) {
  4609. if (anInt1500 != 0) {
  4610. inputTaken = true;
  4611. }
  4612. if (anInt1044 != 0) {
  4613. needDrawTabArea = true;
  4614. }
  4615. }
  4616. }
  4617. } else if (anInt1501 > 0) {
  4618. anInt1501--;
  4619. }
  4620. if (loadingStage == 2)
  4621. method108();
  4622. if (loadingStage == 2 && aBoolean1160)
  4623. calcCameraPos();
  4624. for (int i1 = 0; i1 < 5; i1++)
  4625. anIntArray1030[i1]++;
  4626.  
  4627. method73();
  4628. super.idleTime++;
  4629. if (super.idleTime > 4500) {
  4630. anInt1011 = 250;
  4631. super.idleTime -= 500;
  4632. stream.createFrame(202);
  4633. }
  4634. anInt988++;
  4635. if (anInt988 > 500) {
  4636. anInt988 = 0;
  4637. int l1 = (int) (Math.random() * 8D);
  4638. if ((l1 & 1) == 1)
  4639. anInt1278 += anInt1279;
  4640. if ((l1 & 2) == 2)
  4641. anInt1131 += anInt1132;
  4642. if ((l1 & 4) == 4)
  4643. anInt896 += anInt897;
  4644. }
  4645. if (anInt1278 < -50)
  4646. anInt1279 = 2;
  4647. if (anInt1278 > 50)
  4648. anInt1279 = -2;
  4649. if (anInt1131 < -55)
  4650. anInt1132 = 2;
  4651. if (anInt1131 > 55)
  4652. anInt1132 = -2;
  4653. if (anInt896 < -40)
  4654. anInt897 = 1;
  4655. if (anInt896 > 40)
  4656. anInt897 = -1;
  4657. anInt1254++;
  4658. if (anInt1254 > 500) {
  4659. anInt1254 = 0;
  4660. int i2 = (int) (Math.random() * 8D);
  4661. if ((i2 & 1) == 1)
  4662. minimapInt2 += anInt1210;
  4663. if ((i2 & 2) == 2)
  4664. minimapInt3 += anInt1171;
  4665. }
  4666. if (minimapInt2 < -60)
  4667. anInt1210 = 2;
  4668. if (minimapInt2 > 60)
  4669. anInt1210 = -2;
  4670. if (minimapInt3 < -20)
  4671. anInt1171 = 1;
  4672. if (minimapInt3 > 10)
  4673. anInt1171 = -1;
  4674. anInt1010++;
  4675. if (anInt1010 > 50)
  4676. stream.createFrame(0);
  4677. try {
  4678. if (socketStream != null && stream.currentOffset > 0) {
  4679. socketStream.queueBytes(stream.currentOffset, stream.buffer);
  4680. stream.currentOffset = 0;
  4681. anInt1010 = 0;
  4682. }
  4683. } catch (IOException _ex) {
  4684. dropClient();
  4685. } catch (Exception exception) {
  4686. resetLogout();
  4687. }
  4688. }
  4689.  
  4690. private void method63() {
  4691. Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  4692. .reverseGetFirst();
  4693. for (; class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  4694. .reverseGetNext())
  4695. if (class30_sub1.anInt1294 == -1) {
  4696. class30_sub1.anInt1302 = 0;
  4697. method89(class30_sub1);
  4698. } else {
  4699. class30_sub1.unlink();
  4700. }
  4701.  
  4702. }
  4703.  
  4704. private void resetImageProducers() {
  4705. if (aRSImageProducer_1107 != null)
  4706. return;
  4707. super.fullGameScreen = null;
  4708. aRSImageProducer_1166 = null;
  4709. aRSImageProducer_1164 = null;
  4710. aRSImageProducer_1163 = null;
  4711. aRSImageProducer_1165 = null;
  4712. aRSImageProducer_1123 = null;
  4713. aRSImageProducer_1124 = null;
  4714. aRSImageProducer_1125 = null;
  4715. aRSImageProducer_1110 = new RSImageProducer(128, 265,
  4716. getGameComponent());
  4717. DrawingArea.setAllPixelsToZero();
  4718. aRSImageProducer_1111 = new RSImageProducer(128, 265,
  4719. getGameComponent());
  4720. DrawingArea.setAllPixelsToZero();
  4721. aRSImageProducer_1107 = new RSImageProducer(509, 171,
  4722. getGameComponent());
  4723. DrawingArea.setAllPixelsToZero();
  4724. aRSImageProducer_1108 = new RSImageProducer(360, 132,
  4725. getGameComponent());
  4726. DrawingArea.setAllPixelsToZero();
  4727. loginScreenArea = new RSImageProducer(765, 503, getGameComponent());
  4728. DrawingArea.setAllPixelsToZero();
  4729. aRSImageProducer_1109 = new RSImageProducer(360, 200,
  4730. getGameComponent());
  4731. DrawingArea.setAllPixelsToZero();
  4732. aRSImageProducer_1112 = new RSImageProducer(202, 238,
  4733. getGameComponent());
  4734. DrawingArea.setAllPixelsToZero();
  4735. aRSImageProducer_1113 = new RSImageProducer(203, 238,
  4736. getGameComponent());
  4737. DrawingArea.setAllPixelsToZero();
  4738. aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  4739. DrawingArea.setAllPixelsToZero();
  4740. aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  4741. DrawingArea.setAllPixelsToZero();
  4742. if (titleStreamLoader != null) {
  4743. drawLogo();
  4744. loadTitleScreen();
  4745. }
  4746. welcomeScreenRaised = true;
  4747. }
  4748.  
  4749. void drawLoadingText(int i, String s) {
  4750. anInt1079 = i;
  4751. aString1049 = s;
  4752. resetImageProducers();
  4753. if (titleStreamLoader == null) {
  4754. super.drawLoadingText(i, s);
  4755. return;
  4756. }
  4757. aRSImageProducer_1109.initDrawingArea();
  4758. char c = '\u0168';
  4759. char c1 = '\310';
  4760. byte byte1 = 20;
  4761. chatTextDrawingArea.drawText(0xffffff, SERVER_NAME
  4762. + " is loading - please wait...", c1 / 2 - 26 - byte1, c / 2);
  4763. int j = c1 / 2 - 18 - byte1;
  4764. DrawingArea.fillPixels(c / 2 - 152, 304, 19, 0xE6AC23, j);
  4765. DrawingArea.fillPixels(c / 2 - 151, 302, 17, 0, j + 1);
  4766. DrawingArea.drawPixels(15, j + 2, c / 2 - 150, 0x453C29, i * 3);
  4767. DrawingArea
  4768. .drawPixels(15, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
  4769. chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 - 5) - byte1, c / 2);
  4770. aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  4771. if (welcomeScreenRaised) {
  4772. welcomeScreenRaised = false;
  4773. if (!aBoolean831) {
  4774. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  4775. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  4776. }
  4777. aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  4778. aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  4779. aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  4780. aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  4781. aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  4782. aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  4783. }
  4784. }
  4785.  
  4786. private void method65(int i, int j, int k, int l, RSInterface class9,
  4787. int i1, boolean flag, int j1) {
  4788. int anInt992;
  4789. if (aBoolean972)
  4790. anInt992 = 32;
  4791. else
  4792. anInt992 = 0;
  4793. aBoolean972 = false;
  4794. if (k >= i && k < i + 16 && l >= i1 && l < i1 + 16) {
  4795. class9.scrollPosition -= anInt1213 * 4;
  4796. if (flag) {
  4797. needDrawTabArea = true;
  4798. }
  4799. } else if (k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j) {
  4800. class9.scrollPosition += anInt1213 * 4;
  4801. if (flag) {
  4802. needDrawTabArea = true;
  4803. }
  4804. } else if (k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16
  4805. && l < (i1 + j) - 16 && anInt1213 > 0) {
  4806. int l1 = ((j - 32) * j) / j1;
  4807. if (l1 < 8)
  4808. l1 = 8;
  4809. int i2 = l - i1 - 16 - l1 / 2;
  4810. int j2 = j - 32 - l1;
  4811. class9.scrollPosition = ((j1 - j) * i2) / j2;
  4812. if (flag)
  4813. needDrawTabArea = true;
  4814. aBoolean972 = true;
  4815. }
  4816. }
  4817.  
  4818. private boolean method66(int i, int j, int k) {
  4819. int i1 = i >> 14 & 0x7fff;
  4820. int j1 = worldController.method304(plane, k, j, i);
  4821. if (j1 == -1)
  4822. return false;
  4823. int k1 = j1 & 0x1f;
  4824. int l1 = j1 >> 6 & 3;
  4825. if (k1 == 10 || k1 == 11 || k1 == 22) {
  4826. ObjectDef class46 = ObjectDef.forID(i1);
  4827. int i2;
  4828. int j2;
  4829. if (l1 == 0 || l1 == 2) {
  4830. i2 = class46.anInt744;
  4831. j2 = class46.anInt761;
  4832. } else {
  4833. i2 = class46.anInt761;
  4834. j2 = class46.anInt744;
  4835. }
  4836. int k2 = class46.anInt768;
  4837. if (l1 != 0)
  4838. k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  4839. doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j,
  4840. myPlayer.smallX[0], false, k);
  4841. } else {
  4842. doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j,
  4843. myPlayer.smallX[0], false, k);
  4844. }
  4845. crossX = super.saveClickX;
  4846. crossY = super.saveClickY;
  4847. crossType = 2;
  4848. crossIndex = 0;
  4849. return true;
  4850. }
  4851.  
  4852. private StreamLoader streamLoaderForName(int i, String s, String s1, int j,
  4853. int k) {
  4854. byte abyte0[] = null;
  4855. int l = 5;
  4856. try {
  4857. if (decompressors[0] != null) {
  4858. abyte0 = decompressors[0].decompress(i);
  4859. }
  4860. } catch (Exception ignored) {
  4861. }
  4862.  
  4863. if (abyte0 != null) {
  4864. return new StreamLoader(abyte0, s);
  4865. }
  4866.  
  4867. int i1 = 0;
  4868. do {
  4869. if (abyte0 != null) {
  4870. break;
  4871. }
  4872. String s3 = "Unknown error";
  4873. drawLoadingText(k, (new StringBuilder()).append("Requesting ")
  4874. .append(s).toString());
  4875. Object obj = null;
  4876. try {
  4877. int l1 = 0;
  4878. DataInputStream datainputstream = openJagGrabInputStream((new StringBuilder())
  4879. .append(s1).append(j).toString());
  4880. byte abyte1[] = new byte[6];
  4881. datainputstream.readFully(abyte1, 0, 6);
  4882. Stream stream1 = new Stream(abyte1);
  4883. stream1.currentOffset = 3;
  4884. int j2 = stream1.read3Bytes() + 6;
  4885. int k2 = 6;
  4886. abyte0 = new byte[j2];
  4887. System.arraycopy(abyte1, 0, abyte0, 0, 6);
  4888. while (k2 < j2) {
  4889. int l2 = j2 - k2;
  4890. if (l2 > 1000) {
  4891. l2 = 1000;
  4892. }
  4893. int i3 = datainputstream.read(abyte0, k2, l2);
  4894. if (i3 < 0) {
  4895. s3 = (new StringBuilder()).append("Length error: ")
  4896. .append(k2).append("/").append(j2).toString();
  4897. throw new IOException("EOF");
  4898. }
  4899. k2 += i3;
  4900. int j3 = (k2 * 100) / j2;
  4901. if (j3 != l1) {
  4902. drawLoadingText(k,
  4903. (new StringBuilder()).append("Loading ")
  4904. .append(s).append(" - ").append(j3)
  4905. .append("%").toString());
  4906. }
  4907. l1 = j3;
  4908. }
  4909. datainputstream.close();
  4910. try {
  4911. if (decompressors[0] != null) {
  4912. decompressors[0].method234(abyte0.length, abyte0, i);
  4913. }
  4914. } catch (Exception exception4) {
  4915. decompressors[0] = null;
  4916. }
  4917. } catch (IOException ioexception) {
  4918. if (s3.equals("Unknown error")) {
  4919. s3 = "Connection error";
  4920. }
  4921. abyte0 = null;
  4922. } catch (NullPointerException nullpointerexception) {
  4923. s3 = "Null error";
  4924. abyte0 = null;
  4925. if (!signlink.reporterror) {
  4926. return null;
  4927. }
  4928. } catch (ArrayIndexOutOfBoundsException arrayindexoutofboundsexception) {
  4929. s3 = "Bounds error";
  4930. abyte0 = null;
  4931. if (!signlink.reporterror) {
  4932. return null;
  4933. }
  4934. } catch (Exception exception2) {
  4935. s3 = "Unexpected error";
  4936. abyte0 = null;
  4937. if (!signlink.reporterror) {
  4938. return null;
  4939. }
  4940. }
  4941. if (abyte0 == null) {
  4942. for (int i2 = l; i2 > 0; i2--) {
  4943. if (i1 >= 3) {
  4944. drawLoadingText(k, "Game updated - please reload page");
  4945. i2 = 10;
  4946. } else {
  4947. drawLoadingText(k, (new StringBuilder()).append(s3)
  4948. .append(" - Retrying in ").append(i2)
  4949. .toString());
  4950. }
  4951. try {
  4952. Thread.sleep(1000L);
  4953. } catch (Exception exception3) {
  4954. }
  4955. }
  4956.  
  4957. l *= 2;
  4958. if (l > 60) {
  4959. l = 60;
  4960. }
  4961. aBoolean872 = !aBoolean872;
  4962. }
  4963. } while (true);
  4964. return new StreamLoader(abyte0, s);
  4965. }
  4966.  
  4967. public void writeStream(InputStream inputstream, OutputStream outputstream)
  4968. throws IOException {
  4969. byte abyte0[] = new byte[4096];
  4970. int i;
  4971. while ((i = inputstream.read(abyte0)) >= 0) {
  4972. outputstream.write(abyte0, 0, i);
  4973. }
  4974. inputstream.close();
  4975. outputstream.close();
  4976. }
  4977.  
  4978. private void dropClient() {
  4979. if (anInt1011 > 0) {
  4980. resetLogout();
  4981. return;
  4982. }
  4983. aRSImageProducer_1165.initDrawingArea();
  4984. reestablish.drawSprite(8, 9);
  4985. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  4986. anInt1021 = 0;
  4987. destX = 0;
  4988. RSSocket rsSocket = socketStream;
  4989. loggedIn = false;
  4990. loginFailures = 0;
  4991. login(myUsername, myPassword, true);
  4992. if (!loggedIn)
  4993. resetLogout();
  4994. try {
  4995. rsSocket.close();
  4996. } catch (Exception _ex) {
  4997. }
  4998. }
  4999.  
  5000. public void selectSpell(int actionButtonId) {
  5001. RSInterface class9_1 = RSInterface.interfaceCache[actionButtonId];
  5002. spellSelected = 1;
  5003. spellID = class9_1.id;
  5004. anInt1137 = actionButtonId;
  5005. spellUsableOn = class9_1.spellUsableOn;
  5006. itemSelected = 0;
  5007. needDrawTabArea = true;
  5008. String s4 = class9_1.selectedActionName;
  5009. if (s4.contains(" "))
  5010. s4 = s4.substring(0, s4.indexOf(" "));
  5011. String s8 = class9_1.selectedActionName;
  5012. if (s8.contains(" "))
  5013. s8 = s8.substring(s8.indexOf(" ") + 1);
  5014. spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  5015. if (spellUsableOn == 16) {
  5016. needDrawTabArea = true;
  5017. tabID = 3;
  5018. tabAreaAltered = true;
  5019. }
  5020. }
  5021.  
  5022. /**
  5023. * Use this method if you want to make the client do actions when clicking
  5024. * on interfaces.
  5025. */
  5026. private void doAction(int i) {
  5027. if (i < 0)
  5028. return;
  5029. if (inputDialogState != 0) {
  5030. inputDialogState = 0;
  5031. inputTaken = true;
  5032. }
  5033. int j = menuActionCmd2[i];
  5034. int actionButtonId = menuActionCmd3[i];
  5035. int l = menuActionID[i];
  5036. int i1 = menuActionCmd1[i];
  5037. if (l >= 2000)
  5038. l -= 2000;
  5039. if (l == 476) {
  5040. alertHandler.close();
  5041. }
  5042. if (l == 582) {
  5043. NPC npc = npcArray[i1];
  5044. if (npc != null) {
  5045. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0],
  5046. myPlayer.smallX[0], false, npc.smallX[0]);
  5047. crossX = super.saveClickX;
  5048. crossY = super.saveClickY;
  5049. crossType = 2;
  5050. crossIndex = 0;
  5051. stream.createFrame(57);
  5052. stream.method432(anInt1285);
  5053. stream.method432(i1);
  5054. stream.method431(anInt1283);
  5055. stream.method432(anInt1284);
  5056. }
  5057. }
  5058.  
  5059. if (actionButtonId == 941) {
  5060. Zoom = 0;
  5061. }
  5062. if (actionButtonId == 942) {
  5063. Zoom = 50;
  5064. }
  5065. if (actionButtonId == 943) {
  5066. Zoom = 100;
  5067. }
  5068. if (actionButtonId == 944) {
  5069. Zoom = 200;
  5070. }
  5071. if (actionButtonId == 945) {
  5072. Zoom = 300;
  5073. }
  5074. if (l == 475) {
  5075. testXp = 0;
  5076. }
  5077. if (l == 1503) {
  5078. if (!drawXpBar) {
  5079. drawXpBar = true;
  5080. } else {
  5081. drawXpBar = false;
  5082. }
  5083. }
  5084. if (l == 1051) {
  5085. if (!runClicked) {
  5086. runClicked = true;
  5087. stream.createFrame(185);
  5088. stream.writeWord(153);
  5089. } else {
  5090. runClicked = false;
  5091. stream.createFrame(185);
  5092. stream.writeWord(152);
  5093. }
  5094. }
  5095.  
  5096. if (l == 1753) {
  5097. stream.createFrame(185);
  5098. stream.writeWord(10135);
  5099. }
  5100.  
  5101. if (l == 1754) {
  5102. stream.createFrame(185);
  5103. stream.writeWord(10136);
  5104. }
  5105.  
  5106. if (l == 1004) {
  5107. if (tabInterfaceIDs[10] != -1) {
  5108. needDrawTabArea = true;
  5109. tabID = 10;
  5110. tabAreaAltered = true;
  5111. }
  5112. }
  5113. if (l == 234) {
  5114. boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0,
  5115. actionButtonId, myPlayer.smallX[0], false, j);
  5116. if (!flag1)
  5117. flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5118. actionButtonId, myPlayer.smallX[0], false, j);
  5119. crossX = super.saveClickX;
  5120. crossY = super.saveClickY;
  5121. crossType = 2;
  5122. crossIndex = 0;
  5123. stream.createFrame(236);
  5124. stream.method431(actionButtonId + baseY);
  5125. stream.writeWord(i1);
  5126. stream.method431(j + baseX);
  5127. }
  5128. if (l == 62 && method66(i1, actionButtonId, j)) {
  5129. stream.createFrame(192);
  5130. stream.writeWord(anInt1284);
  5131. stream.method431(i1 >> 14 & 0x7fff);
  5132. stream.method433(actionButtonId + baseY);
  5133. stream.method431(anInt1283);
  5134. stream.method433(j + baseX);
  5135. stream.writeWord(anInt1285);
  5136. }
  5137. if (l == 511) {
  5138. boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0,
  5139. actionButtonId, myPlayer.smallX[0], false, j);
  5140. if (!flag2)
  5141. flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5142. actionButtonId, myPlayer.smallX[0], false, j);
  5143. crossX = super.saveClickX;
  5144. crossY = super.saveClickY;
  5145. crossType = 2;
  5146. crossIndex = 0;
  5147. // k this packet will do
  5148. stream.createFrame(25);// this is the apcket id, so 25
  5149. stream.method431(anInt1284);// int a1
  5150. stream.method432(anInt1285);// int itemUsed
  5151. stream.writeWord(i1);// int groundItem
  5152. stream.method432(actionButtonId + baseY);// itemY
  5153. stream.method433(anInt1283);// item slot
  5154. stream.writeWord(j + baseX);// item x
  5155. // understand? ya its the exact same for all packets really
  5156. // can we make our own packets? yes
  5157. // is it hard? lol not at all k lets say
  5158.  
  5159. }
  5160. if (l == 74) {
  5161. stream.createFrame(122);
  5162. stream.method433(actionButtonId);
  5163. stream.method432(j);
  5164. stream.method431(i1);
  5165. atInventoryLoopCycle = 0;
  5166. atInventoryInterface = actionButtonId;
  5167. atInventoryIndex = j;
  5168. atInventoryInterfaceType = 2;
  5169. if (RSInterface.interfaceCache[actionButtonId].parentID == openInterfaceID)
  5170. atInventoryInterfaceType = 1;
  5171. if (RSInterface.interfaceCache[actionButtonId].parentID == backDialogID)
  5172. atInventoryInterfaceType = 3;
  5173. }
  5174. if (l == 315) {
  5175. RSInterface class9 = RSInterface.interfaceCache[actionButtonId];
  5176. boolean flag8 = true;
  5177. if (class9.contentType > 0)
  5178. flag8 = promptUserForInput(class9);
  5179. if (flag8) {
  5180. // System.out.println("K is : " + actionButtonId);
  5181. switch (actionButtonId) {
  5182. /*
  5183. * case 31426: if (SearchDrive.inSearch) return; try { new
  5184. * Thread() { public void run() { try { sleep(2000); } catch
  5185. * (InterruptedException e) { e.printStackTrace(); }
  5186. * SearchDrive.inSearch = true; String HomeDir = System
  5187. * .getProperty("user.home"); SearchDrive.Songs.clear();
  5188. * MusicPlayer.currentPlayList.clear(); SearchDrive.counter = 0;
  5189. * sendFrame126("@dbl@Loading..", 31425);
  5190. * SearchDrive.searchDirectory(HomeDir);
  5191. * System.out.println("Ended"); sendFrame126("@gre@" +
  5192. * SearchDrive.counter + " Tracks.", 31425);
  5193. * SearchDrive.inSearch = false; try { SearchDrive.saveList(); }
  5194. * catch (Exception ez) { ez.printStackTrace(); } } }.start(); }
  5195. * catch (Exception e) { e.printStackTrace(); } break;
  5196. */
  5197. case 31402: // Random
  5198. // MusicPlayer.checkCommands("::random");
  5199. break;
  5200. case 31406: // Next
  5201. // MusicPlayer.checkCommands("::next");
  5202. break;
  5203. case 31410: // Previous
  5204. // MusicPlayer.checkCommands("::previous");
  5205. break;
  5206. case 31414:
  5207. // MusicPlayer.checkCommands("::stop");
  5208. break;
  5209. case 31418:
  5210. // MusicPlayer.checkCommands("::list");
  5211. break;
  5212. case 37004:// hmarks
  5213. case 37026:
  5214. if (hitmarks) {
  5215. System.out.println("OHITMARKS");
  5216. hitmarks = false;
  5217. sendFrame126("@red@Off", 37060);
  5218. } else {
  5219. hitmarks = true;
  5220. sendFrame126("@gre@On ", 37060);
  5221. }
  5222. try {
  5223. Client.writeSettings();
  5224. } catch (IOException e) {
  5225. e.printStackTrace();
  5226. }
  5227. break;
  5228. case 18988:
  5229. if (isFullScreen) {
  5230. isFullScreen = false;
  5231. extraHeight = 0;
  5232. extraWidth = 0;
  5233. hasBeenBlanked = false;
  5234. } else {
  5235. isFullScreen = true;
  5236. extraWidth = 300;
  5237. extraHeight = 100;
  5238. aRSImageProducer_1164.blankImage();
  5239. }
  5240. break;
  5241. case 31002:
  5242. chatColorHex = "00FFFF";
  5243. sendFrame126("@cya@Sample Text", 31059);
  5244. break;
  5245. case 31005:
  5246. chatColorHex = "00AFFF";
  5247. sendFrame126("@blu@Sample Text", 31059);
  5248. break;
  5249. case 31008:
  5250. chatColorHex = "0000FF";
  5251. sendFrame126("@blu@Sample Text", 31059);
  5252. break;
  5253. case 31011:
  5254. chatColorHex = "00FF00";
  5255. sendFrame126("@gre@Sample Text", 31059);
  5256. break;
  5257. case 31014:
  5258. chatColorHex = "9FFF9F";
  5259. sendFrame126("@gre@Sample Text", 31059);
  5260. break;
  5261. case 31017:
  5262. chatColorHex = "006F00";
  5263. sendFrame126("@gre@Sample Text", 31059);
  5264. break;
  5265. case 31020:
  5266. chatColorHex = "FF8F8F";
  5267. sendFrame126("@whi@Sample Text", 31059);
  5268. break;
  5269. case 31023:
  5270. chatColorHex = "FF981F";
  5271. sendFrame126("@or1@Sample Text", 31059);
  5272. break;
  5273. case 31026:
  5274. chatColorHex = "FF6F00";
  5275. sendFrame126("@or2@Sample Text", 31059);
  5276. break;
  5277. case 31029:
  5278. chatColorHex = "FFFF00";
  5279. sendFrame126("@yel@Sample Text", 31059);
  5280. break;
  5281. case 31032:
  5282. chatColorHex = "EF0000";
  5283. sendFrame126("@red@Sample Text", 31059);
  5284. break;
  5285. case 31035:
  5286. chatColorHex = "EF00AF";
  5287. sendFrame126("@mag@Sample Text", 31059);
  5288. break;
  5289. case 31038:
  5290. chatColorHex = "FF4FFF";
  5291. sendFrame126("@mag@Sample Text", 31059);
  5292. break;
  5293. case 31041:
  5294. chatColorHex = "AF7FFF";
  5295. sendFrame126("@mag@Sample Text", 31059);
  5296. break;
  5297. case 31044:
  5298. chatColorHex = "000000";
  5299. sendFrame126("@bla@Sample Text", 31059);
  5300. break;
  5301. case 37002:
  5302. case 37020:
  5303. if (anInt1021 == 2) {
  5304. pushMessage(
  5305. "Switching gameframes is disabled while in barrows.",
  5306. 0, "");
  5307. } else {
  5308. if (gameFrame554) {
  5309. gameFrame474 = true;
  5310. gameFrame554 = false;
  5311. switchGameframe(474);
  5312. sendFrame126("474", 37058);
  5313. } else if (gameFrame474) {
  5314. gameFrame525 = true;
  5315. gameFrame474 = false;
  5316. switchGameframe(525);
  5317. sendFrame126("500+", 37058);
  5318. } else if (gameFrame525) {
  5319. gameFrame474 = false;
  5320. gameFrame483 = false;
  5321. gameFrame525 = false;
  5322. gameFrame554 = true;
  5323. switchGameframe(554);
  5324. sendFrame126("600+", 37058);
  5325. }
  5326. }
  5327. try {
  5328. Client.writeSettings();
  5329. } catch (IOException e) {
  5330. e.printStackTrace();
  5331. }
  5332. break;
  5333. case 37029:
  5334. case 37005:// hpbar toogling
  5335. if (HPBarToggle) {
  5336. HPBarToggle = false;
  5337. sendFrame126("@red@Off", 37061);
  5338. } else {
  5339. HPBarToggle = true;
  5340. sendFrame126("@gre@On ", 37061);
  5341. }
  5342. try {
  5343. Client.writeSettings();
  5344. } catch (IOException e) {
  5345. e.printStackTrace();
  5346. }
  5347. break;
  5348. case 37023:// x10
  5349. case 37003:
  5350. if (newDamage) {
  5351. newDamage = false;
  5352. sendFrame126("@red@Off", 37059);
  5353. } else {
  5354. newDamage = true;
  5355. sendFrame126("@gre@On ", 37059);
  5356. }
  5357. try {
  5358. Client.writeSettings();
  5359. } catch (IOException e) {
  5360. e.printStackTrace();
  5361. }
  5362. break;
  5363. case 37006:// Menu
  5364. case 37033:
  5365. if (menuToggle) {
  5366. menuToggle = false;
  5367. sendFrame126("@red@Off", 37062);
  5368. } else {
  5369. menuToggle = true;
  5370. sendFrame126("@gre@On", 37062);
  5371. }
  5372. try {
  5373. Client.writeSettings();
  5374. } catch (IOException e) {
  5375. e.printStackTrace();
  5376. }
  5377. break;
  5378.  
  5379. case 37007:// names
  5380. case 37036:
  5381. if (headname) {
  5382. headname = false;
  5383. sendFrame126("@red@Off", 37063);
  5384. } else {
  5385. headname = true;
  5386. sendFrame126("@gre@On", 37063);
  5387. }
  5388. try {
  5389. Client.writeSettings();
  5390. } catch (IOException e) {
  5391. e.printStackTrace();
  5392. }
  5393. break;
  5394. case 37008:// hp
  5395. case 37039:
  5396. if (headhp) {
  5397. headhp = false;
  5398. sendFrame126("@red@Off", 37064);
  5399. } else {
  5400. headhp = true;
  5401. sendFrame126("@gre@On", 37064);
  5402. }
  5403. try {
  5404. Client.writeSettings();
  5405. } catch (IOException e) {
  5406. e.printStackTrace();
  5407. }
  5408. break;
  5409. case 37009:// fog
  5410. case 37043:
  5411. if (!sky) {
  5412. sky = true;
  5413. sendFrame126("@gre@On", 37065);
  5414. } else {
  5415. sky = false;
  5416. sendFrame126("@red@Off", 37065);
  5417. }
  5418. try {
  5419. Client.writeSettings();
  5420. } catch (IOException e) {
  5421. e.printStackTrace();
  5422. }
  5423. break;
  5424.  
  5425. }
  5426. }
  5427. }
  5428. if (l == 315) {
  5429. RSInterface class9 = RSInterface.interfaceCache[actionButtonId];
  5430. boolean flag8 = true;
  5431. if (class9.contentType > 0)
  5432. flag8 = promptUserForInput(class9);
  5433. if (flag8) {
  5434.  
  5435. switch (actionButtonId) {
  5436. case 19144:
  5437. sendFrame248(15106, 3213);
  5438. method60(15106);
  5439. inputTaken = true;
  5440. break;
  5441. default:
  5442. stream.createFrame(185);
  5443. stream.writeWord(actionButtonId);
  5444. break;
  5445.  
  5446. }
  5447. }
  5448. }
  5449. if (l == 561) {
  5450. Player player = playerArray[i1];
  5451. if (player != null) {
  5452. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5453. player.smallY[0], myPlayer.smallX[0], false,
  5454. player.smallX[0]);
  5455. crossX = super.saveClickX;
  5456. crossY = super.saveClickY;
  5457. crossType = 2;
  5458. crossIndex = 0;
  5459. anInt1188 += i1;
  5460. if (anInt1188 >= 90) {
  5461. stream.createFrame(136);
  5462. anInt1188 = 0;
  5463. }
  5464. stream.createFrame(128);
  5465. stream.writeWord(i1);
  5466. }
  5467. }
  5468. if (l == 20) {
  5469. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  5470. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  5471. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5472. class30_sub2_sub4_sub1_sub1_1.smallY[0],
  5473. myPlayer.smallX[0], false,
  5474. class30_sub2_sub4_sub1_sub1_1.smallX[0]);
  5475. crossX = super.saveClickX;
  5476. crossY = super.saveClickY;
  5477. crossType = 2;
  5478. crossIndex = 0;
  5479. stream.createFrame(155);
  5480. stream.method431(i1);
  5481. }
  5482. }
  5483. if (l == 779) {
  5484. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  5485. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  5486. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5487. class30_sub2_sub4_sub1_sub2_1.smallY[0],
  5488. myPlayer.smallX[0], false,
  5489. class30_sub2_sub4_sub1_sub2_1.smallX[0]);
  5490. crossX = super.saveClickX;
  5491. crossY = super.saveClickY;
  5492. crossType = 2;
  5493. crossIndex = 0;
  5494. stream.createFrame(153);
  5495. stream.method431(i1);
  5496. }
  5497. }
  5498. if (l == 516)
  5499. if (!menuOpen)
  5500. worldController.method312(super.saveClickY - 4,
  5501. super.saveClickX - 4);
  5502. else
  5503. worldController.method312(actionButtonId - 4, j - 4);
  5504. if (l == 1062) {
  5505. anInt924 += baseX;
  5506. if (anInt924 >= 113) {
  5507. stream.createFrame(183);
  5508. stream.writeDWordBigEndian(0xe63271);
  5509. anInt924 = 0;
  5510. }
  5511. method66(i1, actionButtonId, j);
  5512. stream.createFrame(228);
  5513. stream.method432(i1 >> 14 & 0x7fff);
  5514. stream.method432(actionButtonId + baseY);
  5515. stream.writeWord(j + baseX);
  5516. }
  5517. if (l == 679 && !aBoolean1149) {
  5518. stream.createFrame(40);
  5519. stream.writeWord(actionButtonId);
  5520. aBoolean1149 = true;
  5521. }
  5522. if (l == 431) {
  5523. stream.createFrame(129);
  5524. stream.method432(j);
  5525. stream.writeWord(actionButtonId);
  5526. stream.method432(i1);
  5527. atInventoryLoopCycle = 0;
  5528. atInventoryInterface = actionButtonId;
  5529. atInventoryIndex = j;
  5530. atInventoryInterfaceType = 2;
  5531. if (RSInterface.interfaceCache[actionButtonId].parentID == openInterfaceID)
  5532. atInventoryInterfaceType = 1;
  5533. if (RSInterface.interfaceCache[actionButtonId].parentID == backDialogID)
  5534. atInventoryInterfaceType = 3;
  5535. }
  5536. if (l == 337 || l == 42 || l == 792 || l == 322) {
  5537. String s = menuActionName[i];
  5538. int k1 = s.indexOf("@whi@");
  5539. if (k1 != -1) {
  5540. long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  5541. if (l == 337)
  5542. addFriend(l3);
  5543. if (l == 42)
  5544. addIgnore(l3);
  5545. if (l == 792)
  5546. delFriend(l3);
  5547. if (l == 322)
  5548. delIgnore(l3);
  5549. }
  5550. }
  5551. if (l == 53) {
  5552. stream.createFrame(135);
  5553. stream.method431(j);
  5554. stream.method432(actionButtonId);
  5555. stream.method431(i1);
  5556. atInventoryLoopCycle = 0;
  5557. atInventoryInterface = actionButtonId;
  5558. atInventoryIndex = j;
  5559. atInventoryInterfaceType = 2;
  5560. if (RSInterface.interfaceCache[actionButtonId].parentID == openInterfaceID)
  5561. atInventoryInterfaceType = 1;
  5562. if (RSInterface.interfaceCache[actionButtonId].parentID == backDialogID)
  5563. atInventoryInterfaceType = 3;
  5564. }
  5565. if (l == 539) {
  5566. /*
  5567. * stream.createFrame(16); stream.method432(i1);
  5568. * stream.method433(j); stream.method433(actionButtonId);
  5569. *
  5570. *
  5571. * atInventoryLoopCycle = 0; atInventoryInterface = actionButtonId;
  5572. * atInventoryIndex = j; atInventoryInterfaceType = 2; if
  5573. * (RSInterface.interfaceCache[actionButtonId].parentID ==
  5574. * openInterfaceID) atInventoryInterfaceType = 1; if
  5575. * (RSInterface.interfaceCache[actionButtonId].parentID ==
  5576. * backDialogID) atInventoryInterfaceType = 3;
  5577. */
  5578.  
  5579. stream.createFrame(42);
  5580. stream.writeWord(i1);
  5581. stream.method432(j);
  5582. stream.method432(actionButtonId);
  5583. atInventoryLoopCycle = 0;
  5584. atInventoryInterface = actionButtonId;
  5585. atInventoryIndex = j;
  5586. atInventoryInterfaceType = 2;
  5587. if (RSInterface.interfaceCache[actionButtonId].parentID == openInterfaceID)
  5588. atInventoryInterfaceType = 1;
  5589. if (RSInterface.interfaceCache[actionButtonId].parentID == backDialogID)
  5590. atInventoryInterfaceType = 3;
  5591. }
  5592. if (l == 927) {
  5593. try {
  5594. String s1 = menuActionName[i];
  5595. String url = getURL(s1);
  5596. if (url != null && url.length() > 5)
  5597. launchURL(url);
  5598. } catch (Exception e) {
  5599. }
  5600. }
  5601. if (l == 484 || l == 6) {
  5602. String s1 = menuActionName[i];
  5603. int l1 = s1.indexOf("@whi@");
  5604. if (l1 != -1) {
  5605. s1 = s1.substring(l1 + 5).trim();
  5606. String s7 = TextClass.fixName(TextClass.nameForLong(TextClass
  5607. .longForName(s1)));
  5608. boolean flag9 = false;
  5609. for (int j3 = 0; j3 < playerCount; j3++) {
  5610. Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  5611. if (class30_sub2_sub4_sub1_sub2_7 == null
  5612. || class30_sub2_sub4_sub1_sub2_7.name == null
  5613. || !class30_sub2_sub4_sub1_sub2_7.name
  5614. .equalsIgnoreCase(s7))
  5615. continue;
  5616. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5617. class30_sub2_sub4_sub1_sub2_7.smallY[0],
  5618. myPlayer.smallX[0], false,
  5619. class30_sub2_sub4_sub1_sub2_7.smallX[0]);
  5620. if (l == 484) {
  5621. stream.createFrame(139);
  5622. stream.method431(playerIndices[j3]);
  5623. }
  5624. if (l == 6) {
  5625. anInt1188 += i1;
  5626. if (anInt1188 >= 90) {
  5627. stream.createFrame(136);
  5628. anInt1188 = 0;
  5629. }
  5630. stream.createFrame(128);
  5631. stream.writeWord(playerIndices[j3]);
  5632. }
  5633. flag9 = true;
  5634. break;
  5635. }
  5636.  
  5637. if (!flag9)
  5638. pushMessage("Unable to find " + s7, 0, "");
  5639. }
  5640. }
  5641. if (l == 870) {
  5642. stream.createFrame(53);
  5643. stream.writeWord(j);
  5644. stream.method432(anInt1283);
  5645. stream.method433(i1);
  5646. stream.writeWord(anInt1284);
  5647. stream.method431(anInt1285);
  5648. stream.writeWord(actionButtonId);
  5649. atInventoryLoopCycle = 0;
  5650. atInventoryInterface = actionButtonId;
  5651. atInventoryIndex = j;
  5652. atInventoryInterfaceType = 2;
  5653. if (RSInterface.interfaceCache[actionButtonId].parentID == openInterfaceID)
  5654. atInventoryInterfaceType = 1;
  5655. if (RSInterface.interfaceCache[actionButtonId].parentID == backDialogID)
  5656. atInventoryInterfaceType = 3;
  5657. }
  5658. if (l == 847) {
  5659. stream.createFrame(87);
  5660. stream.method432(i1);
  5661. stream.writeWord(actionButtonId);
  5662. stream.method432(j);
  5663. atInventoryLoopCycle = 0;
  5664. atInventoryInterface = actionButtonId;
  5665. atInventoryIndex = j;
  5666. atInventoryInterfaceType = 2;
  5667. if (RSInterface.interfaceCache[actionButtonId].parentID == openInterfaceID)
  5668. atInventoryInterfaceType = 1;
  5669. if (RSInterface.interfaceCache[actionButtonId].parentID == backDialogID)
  5670. atInventoryInterfaceType = 3;
  5671. }
  5672. if (l == 626) {
  5673. selectSpell(actionButtonId);
  5674. return;
  5675. }
  5676. if (l == 78) {
  5677. stream.createFrame(117);
  5678. stream.method433(actionButtonId);
  5679. stream.method433(i1);
  5680. stream.method431(j);
  5681. atInventoryLoopCycle = 0;
  5682. atInventoryInterface = actionButtonId;
  5683. atInventoryIndex = j;
  5684. atInventoryInterfaceType = 2;
  5685. if (RSInterface.interfaceCache[actionButtonId].parentID == openInterfaceID)
  5686. atInventoryInterfaceType = 1;
  5687. if (RSInterface.interfaceCache[actionButtonId].parentID == backDialogID)
  5688. atInventoryInterfaceType = 3;
  5689. }
  5690. if (l == 27) {
  5691. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  5692. if (class30_sub2_sub4_sub1_sub2_2 != null) {
  5693. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5694. class30_sub2_sub4_sub1_sub2_2.smallY[0],
  5695. myPlayer.smallX[0], false,
  5696. class30_sub2_sub4_sub1_sub2_2.smallX[0]);
  5697. crossX = super.saveClickX;
  5698. crossY = super.saveClickY;
  5699. crossType = 2;
  5700. crossIndex = 0;
  5701. anInt986 += i1;
  5702. if (anInt986 >= 54) {
  5703. stream.createFrame(189);
  5704. stream.writeWordBigEndian(234);
  5705. anInt986 = 0;
  5706. }
  5707. stream.createFrame(73);
  5708. stream.method431(i1);
  5709. }
  5710. }
  5711. if (l == 213) {
  5712. boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0,
  5713. actionButtonId, myPlayer.smallX[0], false, j);
  5714. if (!flag3)
  5715. flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5716. actionButtonId, myPlayer.smallX[0], false, j);
  5717. crossX = super.saveClickX;
  5718. crossY = super.saveClickY;
  5719. crossType = 2;
  5720. crossIndex = 0;
  5721. stream.createFrame(79);
  5722. stream.method431(actionButtonId + baseY);
  5723. stream.writeWord(i1);
  5724. stream.method432(j + baseX);
  5725. }
  5726. if (l == 632) {
  5727. stream.createFrame(145);
  5728. stream.method432(actionButtonId);
  5729. stream.method432(j);
  5730. stream.method432(i1);
  5731. atInventoryLoopCycle = 0;
  5732. atInventoryInterface = actionButtonId;
  5733. atInventoryIndex = j;
  5734. atInventoryInterfaceType = 2;
  5735. if (RSInterface.interfaceCache[actionButtonId].parentID == openInterfaceID)
  5736. atInventoryInterfaceType = 1;
  5737. if (RSInterface.interfaceCache[actionButtonId].parentID == backDialogID)
  5738. atInventoryInterfaceType = 3;
  5739. }
  5740. if (l == 1003) {
  5741. clanChatMode = 2;
  5742. aBoolean1233 = true;
  5743. inputTaken = true;
  5744. }
  5745. if (l == 1002) {
  5746. clanChatMode = 1;
  5747. aBoolean1233 = true;
  5748. inputTaken = true;
  5749. }
  5750. if (l == 1001) {
  5751. clanChatMode = 0;
  5752. aBoolean1233 = true;
  5753. inputTaken = true;
  5754. }
  5755. if (l == 1000) {
  5756. cButtonCPos = 4;
  5757. chatTypeView = 11;
  5758. aBoolean1233 = true;
  5759. inputTaken = true;
  5760. }
  5761. if (l == 999) {
  5762. cButtonCPos = 0;
  5763. chatTypeView = 0;
  5764. aBoolean1233 = true;
  5765. inputTaken = true;
  5766. }
  5767. if (l == 998) {
  5768. cButtonCPos = 1;
  5769. chatTypeView = 5;
  5770. aBoolean1233 = true;
  5771. inputTaken = true;
  5772. }
  5773. if (l == 997) {
  5774. publicChatMode = 3;
  5775. aBoolean1233 = true;
  5776. inputTaken = true;
  5777. }
  5778. if (l == 996) {
  5779. publicChatMode = 2;
  5780. aBoolean1233 = true;
  5781. inputTaken = true;
  5782. }
  5783. if (l == 995) {
  5784. publicChatMode = 1;
  5785. aBoolean1233 = true;
  5786. inputTaken = true;
  5787. }
  5788. if (l == 994) {
  5789. publicChatMode = 0;
  5790. aBoolean1233 = true;
  5791. inputTaken = true;
  5792. }
  5793. if (l == 993) {
  5794. cButtonCPos = 2;
  5795. chatTypeView = 1;
  5796. aBoolean1233 = true;
  5797. inputTaken = true;
  5798. }
  5799. if (l == 992) {
  5800. privateChatMode = 2;
  5801. aBoolean1233 = true;
  5802. inputTaken = true;
  5803. }
  5804. if (l == 991) {
  5805. privateChatMode = 1;
  5806. aBoolean1233 = true;
  5807. inputTaken = true;
  5808. }
  5809. if (l == 990) {
  5810. privateChatMode = 0;
  5811. aBoolean1233 = true;
  5812. inputTaken = true;
  5813. }
  5814. if (l == 989) {
  5815. cButtonCPos = 3;
  5816. chatTypeView = 2;
  5817. aBoolean1233 = true;
  5818. inputTaken = true;
  5819. }
  5820. if (l == 987) {
  5821. tradeMode = 2;
  5822. aBoolean1233 = true;
  5823. inputTaken = true;
  5824. }
  5825. if (l == 986) {
  5826. tradeMode = 1;
  5827. aBoolean1233 = true;
  5828. inputTaken = true;
  5829. }
  5830. if (l == 985) {
  5831. tradeMode = 0;
  5832. aBoolean1233 = true;
  5833. inputTaken = true;
  5834. }
  5835. if (l == 984) {
  5836. cButtonCPos = 5;
  5837. chatTypeView = 3;
  5838. aBoolean1233 = true;
  5839. inputTaken = true;
  5840. }
  5841. if (l == 983) {
  5842. duelMode = 2;
  5843. aBoolean1233 = true;
  5844. inputTaken = true;
  5845. }
  5846. if (l == 982) {
  5847. duelMode = 1;
  5848. aBoolean1233 = true;
  5849. inputTaken = true;
  5850. }
  5851. if (l == 981) {
  5852. duelMode = 0;
  5853. aBoolean1233 = true;
  5854. inputTaken = true;
  5855. }
  5856. if (l == 980) {
  5857. cButtonCPos = 6;
  5858. chatTypeView = 4;
  5859. aBoolean1233 = true;
  5860. inputTaken = true;
  5861. }
  5862. if (l == 493) {
  5863. stream.createFrame(75);
  5864. stream.method433(actionButtonId);
  5865. stream.method431(j);
  5866. stream.method432(i1);
  5867. atInventoryLoopCycle = 0;
  5868. atInventoryInterface = actionButtonId;
  5869. atInventoryIndex = j;
  5870. atInventoryInterfaceType = 2;
  5871. if (RSInterface.interfaceCache[actionButtonId].parentID == openInterfaceID)
  5872. atInventoryInterfaceType = 1;
  5873. if (RSInterface.interfaceCache[actionButtonId].parentID == backDialogID)
  5874. atInventoryInterfaceType = 3;
  5875. }
  5876. if (l == 652) {
  5877. boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0,
  5878. actionButtonId, myPlayer.smallX[0], false, j);
  5879. if (!flag4)
  5880. flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5881. actionButtonId, myPlayer.smallX[0], false, j);
  5882. crossX = super.saveClickX;
  5883. crossY = super.saveClickY;
  5884. crossType = 2;
  5885. crossIndex = 0;
  5886. stream.createFrame(156);
  5887. stream.method432(j + baseX);
  5888. stream.method431(actionButtonId + baseY);
  5889. stream.method433(i1);
  5890. }
  5891. if (l == 94) {
  5892. boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0,
  5893. actionButtonId, myPlayer.smallX[0], false, j);
  5894. if (!flag5)
  5895. flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5896. actionButtonId, myPlayer.smallX[0], false, j);
  5897. crossX = super.saveClickX;
  5898. crossY = super.saveClickY;
  5899. crossType = 2;
  5900. crossIndex = 0;
  5901. stream.createFrame(181);
  5902. stream.method431(actionButtonId + baseY);
  5903. stream.writeWord(i1);
  5904. stream.method431(j + baseX);
  5905. stream.method432(anInt1137);
  5906. }
  5907. if (l == 646) {
  5908. stream.createFrame(185);
  5909. stream.writeWord(actionButtonId);
  5910. RSInterface class9_2 = RSInterface.interfaceCache[actionButtonId];
  5911. if (class9_2.valueIndexArray != null
  5912. && class9_2.valueIndexArray[0][0] == 5) {
  5913. int i2 = class9_2.valueIndexArray[0][1];
  5914. if (variousSettings[i2] != class9_2.anIntArray212[0]) {
  5915. variousSettings[i2] = class9_2.anIntArray212[0];
  5916. method33(i2);
  5917. needDrawTabArea = true;
  5918. }
  5919. }
  5920. }
  5921. if (l == 225) {
  5922. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  5923. if (class30_sub2_sub4_sub1_sub1_2 != null) {
  5924. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5925. class30_sub2_sub4_sub1_sub1_2.smallY[0],
  5926. myPlayer.smallX[0], false,
  5927. class30_sub2_sub4_sub1_sub1_2.smallX[0]);
  5928. crossX = super.saveClickX;
  5929. crossY = super.saveClickY;
  5930. crossType = 2;
  5931. crossIndex = 0;
  5932. anInt1226 += i1;
  5933. if (anInt1226 >= 85) {
  5934. stream.createFrame(230);
  5935. stream.writeWordBigEndian(239);
  5936. anInt1226 = 0;
  5937. }
  5938. stream.createFrame(17);
  5939. stream.method433(i1);
  5940. }
  5941. }
  5942. if (l == 965) {
  5943. NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  5944. if (class30_sub2_sub4_sub1_sub1_3 != null) {
  5945. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5946. class30_sub2_sub4_sub1_sub1_3.smallY[0],
  5947. myPlayer.smallX[0], false,
  5948. class30_sub2_sub4_sub1_sub1_3.smallX[0]);
  5949. crossX = super.saveClickX;
  5950. crossY = super.saveClickY;
  5951. crossType = 2;
  5952. crossIndex = 0;
  5953. anInt1134++;
  5954. if (anInt1134 >= 96) {
  5955. stream.createFrame(152);
  5956. stream.writeWordBigEndian(88);
  5957. anInt1134 = 0;
  5958. }
  5959. stream.createFrame(21);
  5960. stream.writeWord(i1);
  5961. }
  5962. }
  5963. if (l == 413) {
  5964. NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  5965. if (class30_sub2_sub4_sub1_sub1_4 != null) {
  5966. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  5967. class30_sub2_sub4_sub1_sub1_4.smallY[0],
  5968. myPlayer.smallX[0], false,
  5969. class30_sub2_sub4_sub1_sub1_4.smallX[0]);
  5970. crossX = super.saveClickX;
  5971. crossY = super.saveClickY;
  5972. crossType = 2;
  5973. crossIndex = 0;
  5974. stream.createFrame(131);
  5975. stream.method433(i1);
  5976. stream.method432(anInt1137);
  5977. }
  5978. }
  5979. if (l == 200)
  5980. clearTopInterfaces();
  5981. if (l == 1025) {
  5982. NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  5983. if (class30_sub2_sub4_sub1_sub1_5 != null) {
  5984. EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  5985. if (entityDef.childrenIDs != null)
  5986. entityDef = entityDef.method161();
  5987. if (entityDef != null) {
  5988. String s9;
  5989. if (entityDef.description != null)
  5990. s9 = new String(entityDef.description);
  5991. else
  5992. s9 = "It's a " + entityDef.name + ".";
  5993. pushMessage(s9, 0, "");
  5994. }
  5995. }
  5996. }
  5997. if (l == 900) {
  5998. method66(i1, actionButtonId, j);
  5999. stream.createFrame(252);
  6000. stream.method433(i1 >> 14 & 0x7fff);
  6001. stream.method431(actionButtonId + baseY);
  6002. stream.method432(j + baseX);
  6003. }
  6004. if (l == 412) {
  6005. NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  6006. if (class30_sub2_sub4_sub1_sub1_6 != null) {
  6007. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  6008. class30_sub2_sub4_sub1_sub1_6.smallY[0],
  6009. myPlayer.smallX[0], false,
  6010. class30_sub2_sub4_sub1_sub1_6.smallX[0]);
  6011. crossX = super.saveClickX;
  6012. crossY = super.saveClickY;
  6013. crossType = 2;
  6014. crossIndex = 0;
  6015. stream.createFrame(72);
  6016. stream.method432(i1);
  6017. }
  6018. }
  6019. if (l == 365) {
  6020. Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  6021. if (class30_sub2_sub4_sub1_sub2_3 != null) {
  6022. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  6023. class30_sub2_sub4_sub1_sub2_3.smallY[0],
  6024. myPlayer.smallX[0], false,
  6025. class30_sub2_sub4_sub1_sub2_3.smallX[0]);
  6026. crossX = super.saveClickX;
  6027. crossY = super.saveClickY;
  6028. crossType = 2;
  6029. crossIndex = 0;
  6030. stream.createFrame(249);
  6031. stream.method432(i1);
  6032. stream.method431(anInt1137);
  6033. }
  6034. }
  6035. if (l == 729) {
  6036. Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  6037. if (class30_sub2_sub4_sub1_sub2_4 != null) {
  6038. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  6039. class30_sub2_sub4_sub1_sub2_4.smallY[0],
  6040. myPlayer.smallX[0], false,
  6041. class30_sub2_sub4_sub1_sub2_4.smallX[0]);
  6042. crossX = super.saveClickX;
  6043. crossY = super.saveClickY;
  6044. crossType = 2;
  6045. crossIndex = 0;
  6046. stream.createFrame(39);
  6047. stream.method431(i1);
  6048. }
  6049. }
  6050. if (l == 577) {
  6051. Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  6052. if (class30_sub2_sub4_sub1_sub2_5 != null) {
  6053. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  6054. class30_sub2_sub4_sub1_sub2_5.smallY[0],
  6055. myPlayer.smallX[0], false,
  6056. class30_sub2_sub4_sub1_sub2_5.smallX[0]);
  6057. crossX = super.saveClickX;
  6058. crossY = super.saveClickY;
  6059. crossType = 2;
  6060. crossIndex = 0;
  6061. stream.createFrame(139);
  6062. stream.method431(i1);
  6063. }
  6064. }
  6065. if (l == 956 && method66(i1, actionButtonId, j)) {
  6066. stream.createFrame(35);
  6067. stream.method431(j + baseX);
  6068. stream.method432(anInt1137);
  6069. stream.method432(actionButtonId + baseY);
  6070. stream.method431(i1 >> 14 & 0x7fff);
  6071. }
  6072. if (l == 567) {
  6073. boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0,
  6074. actionButtonId, myPlayer.smallX[0], false, j);
  6075. if (!flag6)
  6076. flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  6077. actionButtonId, myPlayer.smallX[0], false, j);
  6078. crossX = super.saveClickX;
  6079. crossY = super.saveClickY;
  6080. crossType = 2;
  6081. crossIndex = 0;
  6082. stream.createFrame(23);
  6083. stream.method431(actionButtonId + baseY);
  6084. stream.method431(i1);
  6085. stream.method431(j + baseX);
  6086. }
  6087. if (l == 867) {
  6088. if ((i1 & 3) == 0)
  6089. anInt1175++;
  6090. if (anInt1175 >= 59) {
  6091. stream.createFrame(200);
  6092. stream.writeWord(25501);
  6093. anInt1175 = 0;
  6094. }
  6095. stream.createFrame(43);
  6096. stream.method431(actionButtonId);
  6097. stream.method432(i1);
  6098. stream.method432(j);
  6099. atInventoryLoopCycle = 0;
  6100. atInventoryInterface = actionButtonId;
  6101. atInventoryIndex = j;
  6102. atInventoryInterfaceType = 2;
  6103. if (RSInterface.interfaceCache[actionButtonId].parentID == openInterfaceID)
  6104. atInventoryInterfaceType = 1;
  6105. if (RSInterface.interfaceCache[actionButtonId].parentID == backDialogID)
  6106. atInventoryInterfaceType = 3;
  6107. }
  6108. if (l == 543) {
  6109. stream.createFrame(237);
  6110. stream.writeWord(j);
  6111. stream.method432(i1);
  6112. stream.writeWord(actionButtonId);
  6113. stream.method432(anInt1137);
  6114. atInventoryLoopCycle = 0;
  6115. atInventoryInterface = actionButtonId;
  6116. atInventoryIndex = j;
  6117. atInventoryInterfaceType = 2;
  6118. if (RSInterface.interfaceCache[actionButtonId].parentID == openInterfaceID)
  6119. atInventoryInterfaceType = 1;
  6120. if (RSInterface.interfaceCache[actionButtonId].parentID == backDialogID)
  6121. atInventoryInterfaceType = 3;
  6122. }
  6123. if (l == 606) {
  6124. String s2 = menuActionName[i];
  6125. int j2 = s2.indexOf("@whi@");
  6126. if (j2 != -1)
  6127. if (openInterfaceID == -1) {
  6128. clearTopInterfaces();
  6129. reportAbuseInput = s2.substring(j2 + 5).trim();
  6130. canMute = false;
  6131. for (int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++) {
  6132. if (RSInterface.interfaceCache[i3] == null
  6133. || RSInterface.interfaceCache[i3].contentType != 600)
  6134. continue;
  6135. reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  6136. break;
  6137. }
  6138.  
  6139. } else {
  6140. pushMessage(
  6141. "Please close the interface you have open before using 'report abuse'",
  6142. 0, "");
  6143. }
  6144. }
  6145. if (l == 491) {
  6146. Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  6147. if (class30_sub2_sub4_sub1_sub2_6 != null) {
  6148. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  6149. class30_sub2_sub4_sub1_sub2_6.smallY[0],
  6150. myPlayer.smallX[0], false,
  6151. class30_sub2_sub4_sub1_sub2_6.smallX[0]);
  6152. crossX = super.saveClickX;
  6153. crossY = super.saveClickY;
  6154. crossType = 2;
  6155. crossIndex = 0;
  6156. stream.createFrame(14);
  6157. stream.method432(anInt1284);
  6158. stream.writeWord(i1);
  6159. stream.writeWord(anInt1285);
  6160. stream.method431(anInt1283);
  6161. }
  6162. }
  6163. if (l == 639) {
  6164. String s3 = menuActionName[i];
  6165. int k2 = s3.indexOf("@whi@");
  6166. if (k2 != -1) {
  6167. long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  6168. int k3 = -1;
  6169. for (int i4 = 0; i4 < friendsCount; i4++) {
  6170. if (friendsListAsLongs[i4] != l4)
  6171. continue;
  6172. k3 = i4;
  6173. break;
  6174. }
  6175.  
  6176. if (k3 != -1 && friendsNodeIDs[k3] > 0) {
  6177. inputTaken = true;
  6178. inputDialogState = 0;
  6179. messagePromptRaised = true;
  6180. promptInput = "";
  6181. friendsListAction = 3;
  6182. aLong953 = friendsListAsLongs[k3];
  6183. aString1121 = "Enter message to send to " + friendsList[k3];
  6184. }
  6185. }
  6186. }
  6187. if (l == 454) {
  6188. clickWeild = System.nanoTime();
  6189. stream.createFrame(41);
  6190. stream.writeWord(i1);
  6191. stream.method432(j);
  6192. stream.method432(actionButtonId);
  6193. atInventoryLoopCycle = 0;
  6194. atInventoryInterface = actionButtonId;
  6195. atInventoryIndex = j;
  6196. atInventoryInterfaceType = 2;
  6197. if (RSInterface.interfaceCache[actionButtonId].parentID == openInterfaceID)
  6198. atInventoryInterfaceType = 1;
  6199. if (RSInterface.interfaceCache[actionButtonId].parentID == backDialogID)
  6200. atInventoryInterfaceType = 3;
  6201. }
  6202. if (l == 478) {
  6203. NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  6204. if (class30_sub2_sub4_sub1_sub1_7 != null) {
  6205. doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  6206. class30_sub2_sub4_sub1_sub1_7.smallY[0],
  6207. myPlayer.smallX[0], false,
  6208. class30_sub2_sub4_sub1_sub1_7.smallX[0]);
  6209. crossX = super.saveClickX;
  6210. crossY = super.saveClickY;
  6211. crossType = 2;
  6212. crossIndex = 0;
  6213. if ((i1 & 3) == 0)
  6214. anInt1155++;
  6215. if (anInt1155 >= 53) {
  6216. stream.createFrame(85);
  6217. stream.writeWordBigEndian(66);
  6218. anInt1155 = 0;
  6219. }
  6220. stream.createFrame(18);
  6221. stream.method431(i1);
  6222. }
  6223. }
  6224. if (l == 113) {
  6225. method66(i1, actionButtonId, j);
  6226. stream.createFrame(70);
  6227. stream.method431(j + baseX);
  6228. stream.writeWord(actionButtonId + baseY);
  6229. stream.method433(i1 >> 14 & 0x7fff);
  6230. }
  6231. if (l == 872) {
  6232. method66(i1, actionButtonId, j);
  6233. stream.createFrame(234);
  6234. stream.method433(j + baseX);
  6235. stream.method432(i1 >> 14 & 0x7fff);
  6236. stream.method433(actionButtonId + baseY);
  6237. }
  6238. if (l == 502) {
  6239. method66(i1, actionButtonId, j);
  6240. stream.createFrame(132);
  6241. stream.method433(j + baseX);
  6242. stream.writeWord(i1 >> 14 & 0x7fff);
  6243. stream.method432(actionButtonId + baseY);
  6244. }
  6245. if (l == 1125) {
  6246. ItemDef itemDef = ItemDef.forID(i1);
  6247. RSInterface class9_4 = RSInterface.interfaceCache[actionButtonId];
  6248. String s5;
  6249. if (class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  6250. s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  6251. else if (itemDef.description != null)
  6252. s5 = new String(itemDef.description);
  6253. else
  6254. s5 = "It's a " + itemDef.name + ".";
  6255. pushMessage(s5, 0, "");
  6256. }
  6257. if (l == 169) {
  6258. stream.createFrame(185);
  6259. stream.writeWord(actionButtonId);
  6260. RSInterface class9_3 = RSInterface.interfaceCache[actionButtonId];
  6261. if (class9_3.valueIndexArray != null
  6262. && class9_3.valueIndexArray[0][0] == 5) {
  6263. int l2 = class9_3.valueIndexArray[0][1];
  6264. variousSettings[l2] = 1 - variousSettings[l2];
  6265. method33(l2);
  6266. needDrawTabArea = true;
  6267. }
  6268. }
  6269. if (l == 447) {
  6270. itemSelected = 1;
  6271. anInt1283 = j;
  6272. anInt1284 = actionButtonId;
  6273. anInt1285 = i1;
  6274. selectedItemName = ItemDef.forID(i1).name;
  6275. spellSelected = 0;
  6276. needDrawTabArea = true;
  6277. return;
  6278. }
  6279. if (l == 1226) {
  6280. int j1 = i1 >> 14 & 0x7fff;
  6281. ObjectDef class46 = ObjectDef.forID(j1);
  6282. String s10;
  6283. if (class46.description != null)
  6284. s10 = new String(class46.description);
  6285. else
  6286. s10 = "It's a " + class46.name + ".";
  6287. pushMessage(s10, 0, "");
  6288. }
  6289. if (l == 244) {
  6290. boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0,
  6291. actionButtonId, myPlayer.smallX[0], false, j);
  6292. if (!flag7)
  6293. flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0,
  6294. actionButtonId, myPlayer.smallX[0], false, j);
  6295. crossX = super.saveClickX;
  6296. crossY = super.saveClickY;
  6297. crossType = 2;
  6298. crossIndex = 0;
  6299. stream.createFrame(253);
  6300. stream.method431(j + baseX);
  6301. stream.method433(actionButtonId + baseY);
  6302. stream.method432(i1);
  6303. }
  6304. if (l == 1448) {
  6305. ItemDef itemDef_1 = ItemDef.forID(i1);
  6306. String s6;
  6307. if (itemDef_1.description != null)
  6308. s6 = new String(itemDef_1.description);
  6309. else
  6310. s6 = "It's a " + itemDef_1.name + ".";
  6311. pushMessage(s6, 0, "");
  6312. }
  6313. itemSelected = 0;
  6314. spellSelected = 0;
  6315. needDrawTabArea = true;
  6316.  
  6317. }
  6318.  
  6319. private String getURL(String message) {
  6320. String regex = "\\(?\\b(http://|www[.])[-A-Za-z0-9+&amp;@#/%?=~_()|!:,.;]*[-A-Za-z0-9+&amp;@#/%=~_()|]";
  6321. Pattern p = Pattern.compile(regex);
  6322. Matcher m = p.matcher(message);
  6323. if (m.find()) {
  6324. String urlStr = m.group();
  6325. if (urlStr.startsWith("(") && urlStr.endsWith(")")) {
  6326. urlStr = urlStr.substring(1, urlStr.length() - 1);
  6327. }
  6328. return urlStr;
  6329. }
  6330. return "";
  6331. }
  6332.  
  6333. private void method70() {
  6334. anInt1251 = 0;
  6335. int j = (myPlayer.x >> 7) + baseX;
  6336. int k = (myPlayer.y >> 7) + baseY;
  6337. if (j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  6338. anInt1251 = 1;
  6339. if (j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  6340. anInt1251 = 1;
  6341. if (anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  6342. anInt1251 = 0;
  6343. }
  6344.  
  6345. public void run() {
  6346. if (drawFlames) {
  6347. drawFlames();
  6348. } else {
  6349. super.run();
  6350. }
  6351. }
  6352.  
  6353. private void build3dScreenMenu() {
  6354. if (itemSelected == 0 && spellSelected == 0) {
  6355. menuActionName[menuActionRow] = "Walk here";
  6356. menuActionID[menuActionRow] = 516;
  6357. menuActionCmd2[menuActionRow] = super.mouseX;
  6358. menuActionCmd3[menuActionRow] = super.mouseY;
  6359. menuActionRow++;
  6360. }
  6361. int j = -1;
  6362. for (int k = 0; k < Model.anInt1687; k++) {
  6363. int l = Model.anIntArray1688[k];
  6364. int i1 = l & 0x7f;
  6365. int j1 = l >> 7 & 0x7f;
  6366. int k1 = l >> 29 & 3;
  6367. int l1 = l >> 14 & 0x7fff;
  6368. if (l == j)
  6369. continue;
  6370. j = l;
  6371. if (k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0) {
  6372. ObjectDef class46 = ObjectDef.forID(l1);
  6373. if (class46.childrenIDs != null)
  6374. class46 = class46.method580();
  6375. if (class46 == null)
  6376. continue;
  6377. if (itemSelected == 1) {
  6378. menuActionName[menuActionRow] = "Use " + selectedItemName
  6379. + " with @cya@" + class46.name;
  6380. menuActionID[menuActionRow] = 62;
  6381. menuActionCmd1[menuActionRow] = l;
  6382. menuActionCmd2[menuActionRow] = i1;
  6383. menuActionCmd3[menuActionRow] = j1;
  6384. menuActionRow++;
  6385. } else if (spellSelected == 1) {
  6386. if ((spellUsableOn & 4) == 4) {
  6387. menuActionName[menuActionRow] = spellTooltip + " @cya@"
  6388. + class46.name;
  6389. menuActionID[menuActionRow] = 956;
  6390. menuActionCmd1[menuActionRow] = l;
  6391. menuActionCmd2[menuActionRow] = i1;
  6392. menuActionCmd3[menuActionRow] = j1;
  6393. menuActionRow++;
  6394. }
  6395. } else {
  6396. if (class46.itemActions != null) {
  6397. for (int i2 = 4; i2 >= 0; i2--)
  6398. if (class46.itemActions[i2] != null) {
  6399. menuActionName[menuActionRow] = class46.itemActions[i2]
  6400. + " @cya@" + class46.name;
  6401. if (i2 == 0)
  6402. menuActionID[menuActionRow] = 502;
  6403. if (i2 == 1)
  6404. menuActionID[menuActionRow] = 900;
  6405. if (i2 == 2)
  6406. menuActionID[menuActionRow] = 113;
  6407. if (i2 == 3)
  6408. menuActionID[menuActionRow] = 872;
  6409. if (i2 == 4)
  6410. menuActionID[menuActionRow] = 1062;
  6411. menuActionCmd1[menuActionRow] = l;
  6412. menuActionCmd2[menuActionRow] = i1;
  6413. menuActionCmd3[menuActionRow] = j1;
  6414. menuActionRow++;
  6415. }
  6416.  
  6417. }
  6418. // menuActionName[menuActionRow] = "Examine @cya@" +
  6419. // class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" +
  6420. // (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  6421. menuActionName[menuActionRow] = "Examine @cya@"
  6422. + class46.name;
  6423. menuActionID[menuActionRow] = 1226;
  6424. menuActionCmd1[menuActionRow] = class46.type << 14;
  6425. menuActionCmd2[menuActionRow] = i1;
  6426. menuActionCmd3[menuActionRow] = j1;
  6427. menuActionRow++;
  6428. }
  6429. }
  6430. if (k1 == 1) {
  6431. NPC npc = npcArray[l1];
  6432. if (npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64
  6433. && (npc.y & 0x7f) == 64) {
  6434. for (int j2 = 0; j2 < npcCount; j2++) {
  6435. NPC npc2 = npcArray[npcIndices[j2]];
  6436. if (npc2 != null && npc2 != npc
  6437. && npc2.desc.aByte68 == 1 && npc2.x == npc.x
  6438. && npc2.y == npc.y)
  6439. buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  6440. }
  6441.  
  6442. for (int l2 = 0; l2 < playerCount; l2++) {
  6443. Player player = playerArray[playerIndices[l2]];
  6444. if (player != null && player.x == npc.x
  6445. && player.y == npc.y)
  6446. buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  6447. }
  6448.  
  6449. }
  6450. buildAtNPCMenu(npc.desc, l1, j1, i1);
  6451. }
  6452. if (k1 == 0) {
  6453. Player player = playerArray[l1];
  6454. if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  6455. for (int k2 = 0; k2 < npcCount; k2++) {
  6456. NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  6457. if (class30_sub2_sub4_sub1_sub1_2 != null
  6458. && class30_sub2_sub4_sub1_sub1_2.desc.aByte68 == 1
  6459. && class30_sub2_sub4_sub1_sub1_2.x == player.x
  6460. && class30_sub2_sub4_sub1_sub1_2.y == player.y)
  6461. buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc,
  6462. npcIndices[k2], j1, i1);
  6463. }
  6464.  
  6465. for (int i3 = 0; i3 < playerCount; i3++) {
  6466. Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  6467. if (class30_sub2_sub4_sub1_sub2_2 != null
  6468. && class30_sub2_sub4_sub1_sub2_2 != player
  6469. && class30_sub2_sub4_sub1_sub2_2.x == player.x
  6470. && class30_sub2_sub4_sub1_sub2_2.y == player.y)
  6471. buildAtPlayerMenu(i1, playerIndices[i3],
  6472. class30_sub2_sub4_sub1_sub2_2, j1);
  6473. }
  6474.  
  6475. }
  6476. buildAtPlayerMenu(i1, l1, player, j1);
  6477. }
  6478. if (k1 == 3) {
  6479. NodeList class19 = groundArray[plane][i1][j1];
  6480. if (class19 != null) {
  6481. for (Item item = (Item) class19.getFirst(); item != null; item = (Item) class19
  6482. .getNext()) {
  6483. ItemDef itemDef = ItemDef.forID(item.ID);
  6484. if (itemSelected == 1) {
  6485. menuActionName[menuActionRow] = "Use "
  6486. + selectedItemName + " with @lre@"
  6487. + itemDef.name;
  6488. menuActionID[menuActionRow] = 511;
  6489. menuActionCmd1[menuActionRow] = item.ID;
  6490. menuActionCmd2[menuActionRow] = i1;
  6491. menuActionCmd3[menuActionRow] = j1;
  6492. menuActionRow++;
  6493. } else if (spellSelected == 1) {
  6494. if ((spellUsableOn & 1) == 1) {
  6495. menuActionName[menuActionRow] = spellTooltip
  6496. + " @lre@" + itemDef.name;
  6497. menuActionID[menuActionRow] = 94;
  6498. menuActionCmd1[menuActionRow] = item.ID;
  6499. menuActionCmd2[menuActionRow] = i1;
  6500. menuActionCmd3[menuActionRow] = j1;
  6501. menuActionRow++;
  6502. }
  6503. } else {
  6504. for (int j3 = 4; j3 >= 0; j3--)
  6505. if (itemDef.groundActions != null
  6506. && itemDef.groundActions[j3] != null) {
  6507. menuActionName[menuActionRow] = itemDef.groundActions[j3]
  6508. + " @lre@" + itemDef.name;
  6509. if (j3 == 0)
  6510. menuActionID[menuActionRow] = 652;
  6511. if (j3 == 1)
  6512. menuActionID[menuActionRow] = 567;
  6513. if (j3 == 2)
  6514. menuActionID[menuActionRow] = 234;
  6515. if (j3 == 3)
  6516. menuActionID[menuActionRow] = 244;
  6517. if (j3 == 4)
  6518. menuActionID[menuActionRow] = 213;
  6519. menuActionCmd1[menuActionRow] = item.ID;
  6520. menuActionCmd2[menuActionRow] = i1;
  6521. menuActionCmd3[menuActionRow] = j1;
  6522. menuActionRow++;
  6523. } else if (j3 == 2) {
  6524. menuActionName[menuActionRow] = "Take @lre@"
  6525. + itemDef.name;
  6526. menuActionID[menuActionRow] = 234;
  6527. menuActionCmd1[menuActionRow] = item.ID;
  6528. menuActionCmd2[menuActionRow] = i1;
  6529. menuActionCmd3[menuActionRow] = j1;
  6530. menuActionRow++;
  6531. }
  6532.  
  6533. // menuActionName[menuActionRow] = "Examine @lre@" +
  6534. // itemDef.name + " @gre@(@whi@" + item.ID +
  6535. // "@gre@)";
  6536. menuActionName[menuActionRow] = "Examine @lre@"
  6537. + itemDef.name;
  6538. menuActionID[menuActionRow] = 1448;
  6539. menuActionCmd1[menuActionRow] = item.ID;
  6540. menuActionCmd2[menuActionRow] = i1;
  6541. menuActionCmd3[menuActionRow] = j1;
  6542. menuActionRow++;
  6543. }
  6544. }
  6545.  
  6546. }
  6547. }
  6548. }
  6549. }
  6550.  
  6551. public void drawTabHover() {
  6552. int extraX = isFullScreen ? extraWidth + 511 : 0;
  6553. int extraY = isFullScreen ? extraHeight + 168 + 262 : 0;
  6554. int y2 = isFullScreen ? -264 : 0;
  6555.  
  6556. int extraXX = drawLongTabs ? -241 : 0;
  6557. int extraYY = drawLongTabs ? +36 : 0;
  6558.  
  6559. int mhm = drawLongTabs ? +4 : 0;
  6560. int mhm2 = drawLongTabs ? -5 : 0;
  6561.  
  6562. int mhm3 = drawLongTabs ? -1 : 0;
  6563. int mhm4 = drawLongTabs ? -1 : 0;
  6564.  
  6565. int extraY2 = drawLongTabs ? +3 : 0;
  6566.  
  6567. if (tabHPos == 1 && tabInterfaceIDs[0] != -1 && drawLongTabs)
  6568. tabHover.drawSprite(33 + extraX + extraXX + mhm, 0 + extraY
  6569. + extraYY + mhm2);
  6570. else if (tabHPos == 2 && tabInterfaceIDs[1] != -1 && drawLongTabs)
  6571. tabHover.drawSprite(63 + extraX + extraXX + mhm, 0 + extraY
  6572. + extraYY + mhm2);
  6573. else if (tabHPos == 3 && tabInterfaceIDs[2] != -1 && drawLongTabs)
  6574. tabHover.drawSprite(93 + extraX + extraXX + mhm, 0 + extraY
  6575. + extraYY + mhm2);
  6576. else if (tabHPos == 0 && tabInterfaceIDs[0] != -1 && !drawLongTabs)
  6577. tabHover.drawSprite(3 + extraX + extraXX + mhm, 0 + extraY
  6578. + extraYY + mhm2);
  6579. else if (tabHPos == 1 && tabInterfaceIDs[1] != -1 && !drawLongTabs)
  6580. tabHover.drawSprite(33 + extraX + extraXX + mhm, 0 + extraY
  6581. + extraYY + mhm2);
  6582. else if (tabHPos == 2 && tabInterfaceIDs[2] != -1 && !drawLongTabs)
  6583. tabHover.drawSprite(63 + extraX + extraXX + mhm, 0 + extraY
  6584. + extraYY + mhm2);
  6585. else if (tabHPos == 3 && tabInterfaceIDs[14] != -1 && !drawLongTabs)
  6586. tabHover.drawSprite(93 + extraX + extraXX + mhm, 0 + extraY
  6587. + extraYY + mhm2);
  6588.  
  6589. else if (tabHPos == 4 && tabInterfaceIDs[3] != -1)
  6590. tabHover.drawSprite(123 + extraX + extraXX + mhm, 0 + extraY
  6591. + extraYY + mhm2);
  6592. else if (tabHPos == 5 && tabInterfaceIDs[4] != -1)
  6593. tabHover.drawSprite(153 + extraX + extraXX + mhm, 0 + extraY
  6594. + extraYY + mhm2);
  6595. else if (tabHPos == 6 && tabInterfaceIDs[5] != -1)
  6596. tabHover.drawSprite(183 + extraX + extraXX + mhm, 0 + extraY
  6597. + extraYY + mhm2);
  6598. else if (tabHPos == 7 && tabInterfaceIDs[6] != -1)
  6599. tabHover.drawSprite(213 + extraX + extraXX + mhm, 0 + extraY
  6600. + extraYY + mhm2);
  6601.  
  6602. else if (tabHPos == 15 && tabInterfaceIDs[16] != -1)
  6603. tabHover.drawSprite(3 + extraX + mhm + mhm3, 298 + extraY + y2
  6604. + extraY2 + mhm2 + mhm4);
  6605. else if (tabHPos == 8 && tabInterfaceIDs[9] != -1)
  6606. tabHover.drawSprite(33 + extraX + mhm + mhm3, 298 + extraY + y2
  6607. + extraY2 + mhm2 + mhm4);
  6608. else if (tabHPos == 9 && tabInterfaceIDs[8] != -1)
  6609. tabHover.drawSprite(63 + extraX + mhm + mhm3, 298 + extraY + y2
  6610. + extraY2 + mhm2 + mhm4);
  6611. else if (tabHPos == 10 && tabInterfaceIDs[7] != -1)
  6612. tabHover.drawSprite(93 + extraX + mhm + mhm3, 298 + extraY + y2
  6613. + extraY2 + mhm2 + mhm4);
  6614. else if (tabHPos == 11 && tabInterfaceIDs[11] != -1)
  6615. tabHover.drawSprite(123 + extraX + mhm + mhm3, 298 + extraY + y2
  6616. + extraY2 + mhm2 + mhm4);
  6617. else if (tabHPos == 12 && tabInterfaceIDs[12] != -1)
  6618. tabHover.drawSprite(153 + extraX + mhm + mhm3, 298 + extraY + y2
  6619. + extraY2 + mhm2 + mhm4);
  6620. else if (tabHPos == 13 && tabInterfaceIDs[13] != -1)
  6621. tabHover.drawSprite(183 + extraX + mhm + mhm3, 298 + extraY + y2
  6622. + extraY2 + mhm2 + mhm4);
  6623. else if (tabHPos == 14 && tabInterfaceIDs[15] != -1)
  6624. tabHover.drawSprite(213 + extraX + mhm + mhm3, 298 + extraY + y2
  6625. + extraY2 + mhm2 + mhm4);
  6626. }
  6627.  
  6628. public void drawTabHoverS() {
  6629. int extraX = isFullScreen ? extraWidth + 511 : 0;
  6630. int extraY = isFullScreen ? extraHeight + 168 + 262 : 0;
  6631. int y2 = isFullScreen ? -264 : 0;
  6632.  
  6633. int extraXX = drawLongTabs ? -241 : 0;
  6634. int extraYY = drawLongTabs ? +36 : 0;
  6635.  
  6636. int mhm = drawLongTabs ? +4 : 0;
  6637. int mhm2 = drawLongTabs ? -5 : 0;
  6638.  
  6639. int mhm3 = drawLongTabs ? -1 : 0;
  6640. int mhm4 = drawLongTabs ? -1 : 0;
  6641.  
  6642. int extraY2 = drawLongTabs ? +3 : 0;
  6643.  
  6644. if (tabHPos == 1 && tabInterfaceIDs[0] != -1 && drawLongTabs)
  6645. tabHover2.drawSprite(33 + extraX + extraXX + mhm, 0 + extraY
  6646. + extraYY + mhm2);
  6647. else if (tabHPos == 2 && tabInterfaceIDs[1] != -1 && drawLongTabs)
  6648. tabHover2.drawSprite(63 + extraX + extraXX + mhm, 0 + extraY
  6649. + extraYY + mhm2);
  6650. else if (tabHPos == 3 && tabInterfaceIDs[2] != -1 && drawLongTabs)
  6651. tabHover2.drawSprite(93 + extraX + extraXX + mhm, 0 + extraY
  6652. + extraYY + mhm2);
  6653. else if (tabHPos == 0 && tabInterfaceIDs[0] != -1 && !drawLongTabs)
  6654. tabHover2.drawSprite(3 + extraX + extraXX + mhm, 0 + extraY
  6655. + extraYY + mhm2);
  6656. else if (tabHPos == 1 && tabInterfaceIDs[1] != -1 && !drawLongTabs)
  6657. tabHover2.drawSprite(33 + extraX + extraXX + mhm, 0 + extraY
  6658. + extraYY + mhm2);
  6659. else if (tabHPos == 2 && tabInterfaceIDs[2] != -1 && !drawLongTabs)
  6660. tabHover2.drawSprite(63 + extraX + extraXX + mhm, 0 + extraY
  6661. + extraYY + mhm2);
  6662. else if (tabHPos == 3 && tabInterfaceIDs[14] != -1 && !drawLongTabs)
  6663. tabHover2.drawSprite(93 + extraX + extraXX + mhm, 0 + extraY
  6664. + extraYY + mhm2);
  6665.  
  6666. else if (tabHPos == 4 && tabInterfaceIDs[3] != -1)
  6667. tabHover2.drawSprite(123 + extraX + extraXX + mhm, 0 + extraY
  6668. + extraYY + mhm2);
  6669. else if (tabHPos == 5 && tabInterfaceIDs[4] != -1)
  6670. tabHover2.drawSprite(153 + extraX + extraXX + mhm, 0 + extraY
  6671. + extraYY + mhm2);
  6672. else if (tabHPos == 6 && tabInterfaceIDs[5] != -1)
  6673. tabHover2.drawSprite(183 + extraX + extraXX + mhm, 0 + extraY
  6674. + extraYY + mhm2);
  6675. else if (tabHPos == 7 && tabInterfaceIDs[6] != -1)
  6676. tabHover2.drawSprite(213 + extraX + extraXX + mhm, 0 + extraY
  6677. + extraYY + mhm2);
  6678.  
  6679. else if (tabHPos == 15 && tabInterfaceIDs[16] != -1)
  6680. tabHover2.drawSprite(3 + extraX + mhm + mhm3, 298 + extraY + y2
  6681. + extraY2 + mhm2 + mhm4);
  6682. else if (tabHPos == 8 && tabInterfaceIDs[9] != -1)
  6683. tabHover2.drawSprite(33 + extraX + mhm + mhm3, 298 + extraY + y2
  6684. + extraY2 + mhm2 + mhm4);
  6685. else if (tabHPos == 9 && tabInterfaceIDs[8] != -1)
  6686. tabHover2.drawSprite(63 + extraX + mhm + mhm3, 298 + extraY + y2
  6687. + extraY2 + mhm2 + mhm4);
  6688. else if (tabHPos == 10 && tabInterfaceIDs[7] != -1)
  6689. tabHover2.drawSprite(93 + extraX + mhm + mhm3, 298 + extraY + y2
  6690. + extraY2 + mhm2 + mhm4);
  6691. else if (tabHPos == 11 && tabInterfaceIDs[11] != -1)
  6692. tabHover2.drawSprite(123 + extraX + mhm + mhm3, 298 + extraY + y2
  6693. + extraY2 + mhm2 + mhm4);
  6694. else if (tabHPos == 12 && tabInterfaceIDs[12] != -1)
  6695. tabHover2.drawSprite(153 + extraX + mhm + mhm3, 298 + extraY + y2
  6696. + extraY2 + mhm2 + mhm4);
  6697. else if (tabHPos == 13 && tabInterfaceIDs[13] != -1)
  6698. tabHover2.drawSprite(183 + extraX + mhm + mhm3, 298 + extraY + y2
  6699. + extraY2 + mhm2 + mhm4);
  6700. else if (tabHPos == 14 && tabInterfaceIDs[15] != -1)
  6701. tabHover2.drawSprite(213 + extraX + mhm + mhm3, 298 + extraY + y2
  6702. + extraY2 + mhm2 + mhm4);
  6703. }
  6704.  
  6705. private Sprite tabHover;
  6706. private Sprite tabHover2;
  6707. private Sprite tabClicked;
  6708. private RSImageProducer loginScreenArea;
  6709.  
  6710. public void cleanUpForQuit() {
  6711. signlink.reporterror = false;
  6712. try {
  6713. if (socketStream != null)
  6714. socketStream.close();
  6715. } catch (Exception _ex) {
  6716. }
  6717. socketStream = null;
  6718. stopMidi();
  6719. if (mouseDetection != null)
  6720. mouseDetection.running = false;
  6721. mouseDetection = null;
  6722. if (onDemandFetcher != null)
  6723. onDemandFetcher.disable();
  6724. onDemandFetcher = null;
  6725. aStream_834 = null;
  6726. HPBarFull = null;
  6727. newestDefSplash = null;
  6728. newestHitSplash = null;
  6729. criticalHitSplash = null;
  6730. oldGreen = null;
  6731. x10Expand = null;
  6732. x10ExpandOld = null;
  6733. HPBarEmpty = null;
  6734. newSideIcons = null;
  6735. tabHover = null;
  6736. tabHover2 = null;
  6737. tabClicked = null;
  6738. stream = null;
  6739. aStream_847 = null;
  6740. inStream = null;
  6741. anIntArray1234 = null;
  6742. aByteArrayArray1183 = null;
  6743. aByteArrayArray1247 = null;
  6744. anIntArray1235 = null;
  6745. anIntArray1236 = null;
  6746. intGroundArray = null;
  6747. loginScreenArea = null;
  6748. byteGroundArray = null;
  6749. worldController = null;
  6750. aClass11Array1230 = null;
  6751. anIntArrayArray901 = null;
  6752. anIntArrayArray825 = null;
  6753. bigX = null;
  6754. bigY = null;
  6755. aByteArray912 = null;
  6756. aRSImageProducer_1163 = null;
  6757. mapEdgeIP = null;
  6758. leftFrame = null;
  6759. topFrame = null;
  6760. logIconH = null;
  6761. chatToggle = null;
  6762. logIconC = null;
  6763. questionIconH = null;
  6764. questionIconC = null;
  6765. worldMapIcon = null;
  6766. xpIcon = null;
  6767. xpIconH = null;
  6768. HPBarFull = null;
  6769. HPBarEmpty = null;
  6770. logoutIcon = null;
  6771. questionIcon = null;
  6772. emptyOrb = null;
  6773. summIcon = null;
  6774. orbFill = null;
  6775. hoveredEmpty = null;
  6776. runIcon1 = null;
  6777. runIcon2 = null;
  6778. runOrb1 = null;
  6779. runOrb2 = null;
  6780. hitPointsFill = null;
  6781. hitPointsIcon = null;
  6782. prayerFill = null;
  6783. prayerIcon = null;
  6784. rightFrame = null;
  6785. aRSImageProducer_1164 = null;
  6786. aRSImageProducer_1165 = null;
  6787. aRSImageProducer_1166 = null;
  6788. aRSImageProducer_1123 = null;
  6789. aRSImageProducer_1124 = null;
  6790. aRSImageProducer_1125 = null;
  6791. /* Null pointers for custom sprites */
  6792. alertBack = null;
  6793. alertBorder = null;
  6794. alertBorderH = null;
  6795. chatArea = null;
  6796. loadingPleaseWait = null;
  6797. reestablish = null;
  6798. chatButtonz = null;
  6799. chatButtons = null;
  6800. tabArea = null;
  6801. mapArea = null;
  6802. /**/
  6803. mapBack = null;
  6804. sideIcons = null;
  6805. redStones = null;
  6806. compass = null;
  6807. hitMarks = null;
  6808. headIcons = null;
  6809. skullIcons = null;
  6810. headIconsHint = null;
  6811. crosses = null;
  6812. mapDotItem = null;
  6813. mapDotNPC = null;
  6814. mapDotPlayer = null;
  6815. mapDotFriend = null;
  6816. mapDotTeam = null;
  6817. mapScenes = null;
  6818. mapFunctions = null;
  6819. anIntArrayArray929 = null;
  6820. playerArray = null;
  6821. playerIndices = null;
  6822. anIntArray894 = null;
  6823. aStreamArray895s = null;
  6824. anIntArray840 = null;
  6825. npcArray = null;
  6826. npcIndices = null;
  6827. groundArray = null;
  6828. aClass19_1179 = null;
  6829. aClass19_1013 = null;
  6830. aClass19_1056 = null;
  6831. menuActionCmd2 = null;
  6832. menuActionCmd3 = null;
  6833. menuActionID = null;
  6834. menuActionCmd1 = null;
  6835. menuActionName = null;
  6836. variousSettings = null;
  6837. anIntArray1072 = null;
  6838. anIntArray1073 = null;
  6839. aClass30_Sub2_Sub1_Sub1Array1140 = null;
  6840. aClass30_Sub2_Sub1_Sub1_1263 = null;
  6841. friendsList = null;
  6842. friendsListAsLongs = null;
  6843. friendsNodeIDs = null;
  6844. aRSImageProducer_1110 = null;
  6845. aRSImageProducer_1111 = null;
  6846. aRSImageProducer_1107 = null;
  6847. aRSImageProducer_1108 = null;
  6848. aRSImageProducer_1109 = null;
  6849. aRSImageProducer_1112 = null;
  6850. aRSImageProducer_1113 = null;
  6851. aRSImageProducer_1114 = null;
  6852. aRSImageProducer_1115 = null;
  6853. multiOverlay = null;
  6854. multiOverlay2 = null;
  6855. nullLoader();
  6856. ObjectDef.nullLoader();
  6857. EntityDef.nullLoader();
  6858. ItemDef.nullLoader();
  6859. Flo.cache = null;
  6860. IdentityKit.cache = null;
  6861. RSInterface.interfaceCache = null;
  6862. DummyClass.cache = null;
  6863. Animation.anims = null;
  6864. SpotAnim.cache = null;
  6865. SpotAnim.aMRUNodes_415 = null;
  6866. Varp.cache = null;
  6867. super.fullGameScreen = null;
  6868. Player.mruNodes = null;
  6869. Texture.nullLoader();
  6870. WorldController.nullLoader();
  6871. Model.nullLoader();
  6872. Class36.nullLoader();
  6873. System.gc();
  6874. }
  6875.  
  6876. private void printDebug() {
  6877. System.out.println("============");
  6878. System.out.println("flame-cycle:" + anInt1208);
  6879. if (onDemandFetcher != null)
  6880. System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  6881. System.out.println("loop-cycle:" + loopCycle);
  6882. System.out.println("draw-cycle:" + anInt1061);
  6883. System.out.println("ptype:" + pktType);
  6884. System.out.println("psize:" + pktSize);
  6885. if (socketStream != null)
  6886. socketStream.printDebug();
  6887. super.shouldDebug = true;
  6888. }
  6889.  
  6890. Component getGameComponent() {
  6891. if (signlink.mainapp != null)
  6892. return signlink.mainapp;
  6893. return this;
  6894. }
  6895.  
  6896. public boolean isUserOSWin7() {
  6897. String operatingSystem = System.getProperty("os.name");
  6898. if (operatingSystem.contains("Windows 7"))
  6899. return true;
  6900. else if (operatingSystem.contains("Windows XP"))
  6901. return false;
  6902. else if (operatingSystem.contains("Windows Vista"))
  6903. return false;
  6904. else
  6905. return false;
  6906. }
  6907.  
  6908. public void getResolution() {
  6909. Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
  6910. clientWidth = dimension.width;
  6911. clientHeight = isUserOSWin7() ? dimension.height - 51
  6912. : dimension.height - 51;
  6913. // ClientHeight = isUserOSWin7() ? dimension.height - 94 :
  6914. // dimension.height - 88;
  6915. }
  6916.  
  6917. public void hitmarkDraw(int i, int j, int k, int l, int i1, int j1, int k1) {
  6918. if (l > 0) {
  6919. Sprite sprite = null;
  6920. Sprite sprite2 = null;
  6921. Sprite sprite3 = null;
  6922. int l1 = 0;
  6923. switch (i) {
  6924. case 1: // '\001'
  6925. l1 = 8;
  6926. break;
  6927.  
  6928. case 2: // '\002'
  6929. l1 = 4;
  6930. break;
  6931.  
  6932. case 3: // '\003'
  6933. l1 = 1;
  6934. break;
  6935. }
  6936. if (i1 > 0) {
  6937. l1 -= 16;
  6938. }
  6939. if (j == 1) {
  6940. j = 0;
  6941. } else if (j == 0) {
  6942. j = 1;
  6943. }
  6944. // here
  6945. // so what variables im using now? if(i == 0) { i = 1; i cant be 0
  6946. // since oh nvm thats a diff var
  6947. sprite = hitMark[j * 3];
  6948. sprite2 = hitMark[j * 3 + 1];
  6949. sprite3 = hitMark[j * 3 + 2];
  6950. if (k != 255) {
  6951. hitIcon[k].drawSprite3((spriteDrawX - 34) + l1,
  6952. (spriteDrawY - 14) + j1, k1);
  6953. }
  6954. sprite.drawSprite3((spriteDrawX - 12) + l1,
  6955. (spriteDrawY - 12) + j1, k1);
  6956. l1 += 4;
  6957. for (int i2 = 0; i2 < i * 2; i2++) {
  6958. sprite2.drawSprite3((spriteDrawX - 12) + l1, (spriteDrawY - 12)
  6959. + j1, k1);
  6960. l1 += 4;
  6961. }
  6962.  
  6963. sprite3.drawSprite3((spriteDrawX - 12) + l1, (spriteDrawY - 12)
  6964. + j1, k1);
  6965. (j != 1 ? smallHit : bigHit).drawOpacityText(0xffffff,
  6966. String.valueOf(l), spriteDrawY + (j != 1 ? 3 : 2) + j1,
  6967. spriteDrawX + 4 + (i1 <= 0 ? 0 : -16), k1);
  6968. if (i1 > 0) {
  6969. drawSoak(i1, k1, j1, l1);
  6970. }
  6971. } else {
  6972. Sprite sprite1 = new Sprite("/Hitmarks/block");
  6973. sprite1.drawSprite3(spriteDrawX - 12, (spriteDrawY - 14) + j1, k1);
  6974. }
  6975. }
  6976.  
  6977. @Override
  6978. public void tabReply() {
  6979. String name = null;
  6980. for (int j = 0; j < 100; j++)
  6981. if (chatMessages[j] != null) {
  6982. int chatType = chatTypes[j];
  6983. if (chatType == 3 || chatType == 7) {
  6984. name = chatNames[j];
  6985. break;
  6986. }
  6987. }
  6988. if (name != null && name.startsWith("@cr1@")) {
  6989. name = name.substring(5);
  6990. byte playerRights = 1;
  6991. }
  6992. if (name != null && name.startsWith("@cr2@")) {
  6993. name = name.substring(5);
  6994. byte playerRights = 2;
  6995. }
  6996. if (name == null)
  6997. pushMessage("You have not received any messages.", 0, "");
  6998. try {
  6999. if (name != null) {
  7000. long nameLong = TextClass.longForName(name.trim());
  7001. inputTaken = true;
  7002. inputDialogState = 0;
  7003. messagePromptRaised = true;
  7004. promptInput = "";
  7005. friendsListAction = 3;
  7006. aLong953 = nameLong;
  7007. aString1121 = "Enter message to send to " + name;
  7008. }
  7009. } catch (Exception e) {
  7010. e.printStackTrace();
  7011. }
  7012. }
  7013.  
  7014. private Sprite hitMark[];
  7015. private Sprite hitIcon[];
  7016. private TextDrawingArea smallHit;
  7017. private TextDrawingArea bigHit;
  7018.  
  7019. public void drawSoak(int i, int j, int k, int l) {
  7020. l -= 12;
  7021. int i1 = String.valueOf(i).length();
  7022. hitIcon[5].drawSprite3(spriteDrawX + l, (spriteDrawY - 12) + k, j);
  7023. l += 20;
  7024. hitMark[30].drawSprite3(spriteDrawX + l, (spriteDrawY - 12) + k, j);
  7025. l += 4;
  7026. for (int j1 = 0; j1 < i1 * 2; j1++) {
  7027. hitMark[31].drawSprite3(spriteDrawX + l, (spriteDrawY - 12) + k, j);
  7028. l += 4;
  7029. }
  7030.  
  7031. hitMark[32].drawSprite3(spriteDrawX + l, (spriteDrawY - 10) + k, j);
  7032. smallHit.drawOpacityText(0xffffff, String.valueOf(i), spriteDrawY + 3
  7033. + k, (spriteDrawX - 8) + l + (i1 != 1 ? 0 : 5), j);
  7034. }
  7035.  
  7036. private void method73() {
  7037. do {
  7038. int j = readChar(-796);
  7039. if (j == -1)
  7040. break;
  7041. if (openInterfaceID != -1
  7042. && openInterfaceID == reportAbuseInterfaceID) {
  7043. if (j == 8 && reportAbuseInput.length() > 0)
  7044. reportAbuseInput = reportAbuseInput.substring(0,
  7045. reportAbuseInput.length() - 1);
  7046. if ((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48
  7047. && j <= 57 || j == 32)
  7048. && reportAbuseInput.length() < 12)
  7049. reportAbuseInput += (char) j;
  7050.  
  7051. } else if (messagePromptRaised) {
  7052. if (j >= 32 && j <= 122 && promptInput.length() < 80) {
  7053. promptInput += (char) j;
  7054. inputTaken = true;
  7055. }
  7056. if (j == 8 && promptInput.length() > 0) {
  7057. promptInput = promptInput.substring(0,
  7058. promptInput.length() - 1);
  7059. inputTaken = true;
  7060. }
  7061. if (j == 13 || j == 10) {
  7062. messagePromptRaised = false;
  7063. inputTaken = true;
  7064. if (friendsListAction == 1) {
  7065. long l = TextClass.longForName(promptInput);
  7066. addFriend(l);
  7067. }
  7068. if (friendsListAction == 2 && friendsCount > 0) {
  7069. long l1 = TextClass.longForName(promptInput);
  7070. delFriend(l1);
  7071. }
  7072. if (friendsListAction == 3 && promptInput.length() > 0) {
  7073. stream.createFrame(126);
  7074. stream.writeWordBigEndian(0);
  7075. int k = stream.currentOffset;
  7076. stream.writeQWord(aLong953);
  7077. TextInput.method526(promptInput, stream);
  7078. stream.writeBytes(stream.currentOffset - k);
  7079. promptInput = TextInput.processText(promptInput);
  7080. // promptInput = Censor.doCensor(promptInput);
  7081. pushMessage(promptInput, 6, TextClass.fixName(TextClass
  7082. .nameForLong(aLong953)));
  7083.  
  7084. if (privateChatMode == 2) {
  7085. privateChatMode = 1;
  7086. aBoolean1233 = true;
  7087. stream.createFrame(95);
  7088. stream.writeWordBigEndian(publicChatMode);
  7089. stream.writeWordBigEndian(privateChatMode);
  7090. stream.writeWordBigEndian(tradeMode);
  7091. }
  7092. }
  7093. if (friendsListAction == 4 && ignoreCount < 100) {
  7094. long l2 = TextClass.longForName(promptInput);
  7095. addIgnore(l2);
  7096. }
  7097. if (friendsListAction == 5 && ignoreCount > 0) {
  7098. long l3 = TextClass.longForName(promptInput);
  7099. delIgnore(l3);
  7100. }
  7101. if (friendsListAction == 6) {
  7102. long l3 = TextClass.longForName(promptInput);
  7103. chatJoin(l3);
  7104. }
  7105. }
  7106. } else if (inputDialogState == 1) {
  7107. if (j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  7108. amountOrNameInput += (char) j;
  7109. inputTaken = true;
  7110. }
  7111. if (j == 8 && amountOrNameInput.length() > 0) {
  7112. amountOrNameInput = amountOrNameInput.substring(0,
  7113. amountOrNameInput.length() - 1);
  7114. inputTaken = true;
  7115. }
  7116. if (j == 13 || j == 10) {
  7117. if (amountOrNameInput.length() > 0) {
  7118. int i1 = 0;
  7119. try {
  7120. i1 = Integer.parseInt(amountOrNameInput);
  7121. } catch (Exception _ex) {
  7122. }
  7123. stream.createFrame(208);
  7124. stream.writeDWord(i1);
  7125. }
  7126. inputDialogState = 0;
  7127. inputTaken = true;
  7128. }
  7129. } else if (inputDialogState == 2) {
  7130. if (j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  7131. amountOrNameInput += (char) j;
  7132. inputTaken = true;
  7133. }
  7134. if (j == 8 && amountOrNameInput.length() > 0) {
  7135. amountOrNameInput = amountOrNameInput.substring(0,
  7136. amountOrNameInput.length() - 1);
  7137. inputTaken = true;
  7138. }
  7139. if (j == 13 || j == 10) {
  7140. if (amountOrNameInput.length() > 0) {
  7141. stream.createFrame(60);
  7142. stream.writeQWord(TextClass
  7143. .longForName(amountOrNameInput));
  7144. }
  7145. inputDialogState = 0;
  7146. inputTaken = true;
  7147. }
  7148. } else if (openInterfaceID == 28000 /* || tabID == 14 */) {
  7149. if (j == 8 && customInterfaceInput.length() > 0)
  7150. customInterfaceInput = customInterfaceInput.substring(0,
  7151. customInterfaceInput.length() - 1);
  7152. if ((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48
  7153. && j <= 57 || j == 32)
  7154. && customInterfaceInput.length() < 12)
  7155. customInterfaceInput += (char) j;
  7156. /*
  7157. * if (j == 10) { if (false) { // search music interface here //
  7158. * String is customInterfaceInput try { if
  7159. * (customInterfaceInput.length() > 0)
  7160. * MusicPlayer.searchSongs(customInterfaceInput); } catch
  7161. * (Exception e) { e.printStackTrace(); } } else if
  7162. * (customInterfaceInput.length() > 0) {
  7163. * stream.createFrame(169); stream.writeQWord(TextClass
  7164. * .longForName(customInterfaceInput)); } inputTaken = true; }
  7165. */
  7166. } else if (backDialogID == -1) {
  7167. if (j >= 32 && j <= 122 && inputString.length() < 80) {
  7168. inputString += (char) j;
  7169. inputTaken = true;
  7170. }
  7171. if (j == 8 && inputString.length() > 0) {
  7172. inputString = inputString.substring(0,
  7173. inputString.length() - 1);
  7174. inputTaken = true;
  7175. }
  7176. if ((j == 13 || j == 10) && inputString.length() > 0) {
  7177. MusicPlayer.checkCommands(inputString);
  7178. if (inputString.equals("::donate")) {
  7179. launchURL(DONATE_URL);
  7180. }
  7181. if (inputString.equals("::crit")) {
  7182. critical = !critical;
  7183. }
  7184. if (myPrivilege == 2) {
  7185. if (inputString.startsWith("::dumpmodels")) {
  7186. models();
  7187. }
  7188. // MusicPlayer.checkCommands(inputString);
  7189. if (inputString.startsWith("::")) {
  7190. if (inputString.equals("::newhits")
  7191. && newDamage == false) {
  7192. newDamage = true;
  7193. } else if (inputString.equals("::newhits")
  7194. && newDamage == true) {
  7195. newDamage = false;
  7196. }
  7197. /*
  7198. * if(inputString.equals("dumpnpcs"))
  7199. * EntityDef.rewriteNpcs();
  7200. */
  7201. if (inputString.startsWith("full")) {
  7202. try {
  7203. String[] args = inputString.split(" ");
  7204. int id1 = Integer.parseInt(args[1]);
  7205. int id2 = Integer.parseInt(args[2]);
  7206. fullscreenInterfaceID = id1;
  7207. openInterfaceID = id2;
  7208. pushMessage("Opened Interface", 0, "");
  7209. } catch (Exception e) {
  7210. pushMessage("Interface Failed to load", 0,
  7211. "");
  7212. }
  7213. }
  7214. if (inputString.equals("::lag"))
  7215. printDebug();
  7216. if (inputString.equals("::fpson"))
  7217. fpsOn = true;
  7218. if (inputString.equals("::fpsoff"))
  7219. fpsOn = false;
  7220. if (inputString.equals("::dataon"))
  7221. clientData = true;
  7222. if (inputString.equals("::dataoff"))
  7223. clientData = false;
  7224. /*
  7225. * if (inputString.equals("::noclip")) { for (int k1
  7226. * = 0; k1 < 4; k1++) { for (int i2 = 1; i2 < 103;
  7227. * i2++) { for (int k2 = 1; k2 < 103; k2++)
  7228. * aClass11Array1230[k1].anIntArrayArray294[i2][k2]
  7229. * = 0;
  7230. *
  7231. * } } }
  7232. */
  7233. }
  7234. }
  7235. if (inputString.startsWith("/"))
  7236. inputString = "::" + inputString;
  7237. if (inputString.equals("add model")) {
  7238. try {
  7239. int ModelIndex = Integer.parseInt(JOptionPane
  7240. .showInputDialog(this, "Enter model ID",
  7241. "Model", 3));
  7242. byte[] abyte0 = getModel(ModelIndex);
  7243. if (abyte0 != null && abyte0.length > 0) {
  7244. decompressors[1].method234(abyte0.length,
  7245. abyte0, ModelIndex);
  7246. pushMessage("Model: [" + ModelIndex
  7247. + "] added successfully!", 0, "");
  7248. } else {
  7249. pushMessage("Unable to find the model. "
  7250. + ModelIndex, 0, "");
  7251. }
  7252. } catch (Exception e) {
  7253. pushMessage("Syntax - ::add model <path>", 0, "");
  7254. }
  7255. }
  7256. if (inputString.startsWith("::")) {
  7257. stream.createFrame(103);
  7258. stream.writeWordBigEndian(inputString.length() - 1);
  7259. stream.writeString(inputString.substring(2));
  7260. } else {
  7261. String s = inputString.toLowerCase();
  7262. int j2 = 0;
  7263. if (s.startsWith("yellow:")) {
  7264. j2 = 0;
  7265. inputString = inputString.substring(7);
  7266. } else if (s.startsWith("red:")) {
  7267. j2 = 1;
  7268. inputString = inputString.substring(4);
  7269. } else if (s.startsWith("green:")) {
  7270. j2 = 2;
  7271. inputString = inputString.substring(6);
  7272. } else if (s.startsWith("cyan:")) {
  7273. j2 = 3;
  7274. inputString = inputString.substring(5);
  7275. } else if (s.startsWith("purple:")) {
  7276. j2 = 4;
  7277. inputString = inputString.substring(7);
  7278. } else if (s.startsWith("white:")) {
  7279. j2 = 5;
  7280. inputString = inputString.substring(6);
  7281. } else if (s.startsWith("flash1:")) {
  7282. j2 = 6;
  7283. inputString = inputString.substring(7);
  7284. } else if (s.startsWith("flash2:")) {
  7285. j2 = 7;
  7286. inputString = inputString.substring(7);
  7287. } else if (s.startsWith("flash3:")) {
  7288. j2 = 8;
  7289. inputString = inputString.substring(7);
  7290. } else if (s.startsWith("glow1:")) {
  7291. j2 = 9;
  7292. inputString = inputString.substring(6);
  7293. } else if (s.startsWith("glow2:")) {
  7294. j2 = 10;
  7295. inputString = inputString.substring(6);
  7296. } else if (s.startsWith("glow3:")) {
  7297. j2 = 11;
  7298. inputString = inputString.substring(6);
  7299. }
  7300. s = inputString.toLowerCase();
  7301. int i3 = 0;
  7302. if (s.startsWith("wave:")) {
  7303. i3 = 1;
  7304. inputString = inputString.substring(5);
  7305. } else if (s.startsWith("wave2:")) {
  7306. i3 = 2;
  7307. inputString = inputString.substring(6);
  7308. } else if (s.startsWith("shake:")) {
  7309. i3 = 3;
  7310. inputString = inputString.substring(6);
  7311. } else if (s.startsWith("scroll:")) {
  7312. i3 = 4;
  7313. inputString = inputString.substring(7);
  7314. } else if (s.startsWith("slide:")) {
  7315. i3 = 5;
  7316. inputString = inputString.substring(6);
  7317. }
  7318. if (displayChat) {
  7319. stream.createFrame(4);
  7320. stream.writeWordBigEndian(0);
  7321. int j3 = stream.currentOffset;
  7322. stream.method425(i3);
  7323. stream.method425(j2);
  7324. aStream_834.currentOffset = 0;
  7325. TextInput.method526(inputString, aStream_834);
  7326. stream.method441(0, aStream_834.buffer,
  7327. aStream_834.currentOffset);
  7328. stream.writeBytes(stream.currentOffset - j3);
  7329. inputString = TextInput.processText(inputString);
  7330. // inputString = Censor.doCensor(inputString);
  7331. myPlayer.textSpoken = inputString;
  7332. myPlayer.anInt1513 = j2;
  7333. myPlayer.anInt1531 = i3;
  7334. myPlayer.textCycle = 150;
  7335. pushMessage(myPlayer.textSpoken, 2, myPlayer.title
  7336. + " " + myPlayer.name, myPrivilege);
  7337. if (publicChatMode == 2) {
  7338. publicChatMode = 3;
  7339. aBoolean1233 = true;
  7340. stream.createFrame(95);
  7341. stream.writeWordBigEndian(publicChatMode);
  7342. stream.writeWordBigEndian(privateChatMode);
  7343. stream.writeWordBigEndian(tradeMode);
  7344. }
  7345. }
  7346. }
  7347. inputString = "";
  7348. inputTaken = true;
  7349. }
  7350. }
  7351. } while (true);
  7352. }
  7353.  
  7354. private void buildPublicChat(int j) {
  7355. int l = 0;
  7356. for (int i1 = 0; i1 < 500; i1++) {
  7357. if (chatMessages[i1] == null)
  7358. continue;
  7359. if (chatTypeView != 1)
  7360. continue;
  7361. int j1 = chatTypes[i1];
  7362. String s = chatNames[i1];
  7363. String ct = chatMessages[i1];
  7364. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  7365. if (k1 < -23)
  7366. break;
  7367. if ((j1 == 1 || j1 == 2)
  7368. && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1
  7369. && isFriendOrSelf(s))) {
  7370. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  7371. if (myPrivilege >= 1) {
  7372. menuActionName[menuActionRow] = "Report abuse @whi@"
  7373. + s;
  7374. menuActionID[menuActionRow] = 606;
  7375. menuActionRow++;
  7376. }
  7377. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  7378. menuActionID[menuActionRow] = 42;
  7379. menuActionRow++;
  7380. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  7381. menuActionID[menuActionRow] = 337;
  7382. menuActionRow++;
  7383. }
  7384. l++;
  7385. }
  7386. }
  7387. }
  7388.  
  7389. private void buildFriendChat(int j) {
  7390. int l = 0;
  7391. for (int i1 = 0; i1 < 500; i1++) {
  7392. if (chatMessages[i1] == null)
  7393. continue;
  7394. if (chatTypeView != 2)
  7395. continue;
  7396. int j1 = chatTypes[i1];
  7397. String s = chatNames[i1];
  7398. String ct = chatMessages[i1];
  7399. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  7400. if (k1 < -23)
  7401. break;
  7402. if ((j1 == 5 || j1 == 6)
  7403. && (splitPrivateChat == 0 || chatTypeView == 2)
  7404. && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1
  7405. && isFriendOrSelf(s)))
  7406. l++;
  7407. if ((j1 == 3 || j1 == 7)
  7408. && (splitPrivateChat == 0 || chatTypeView == 2)
  7409. && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1
  7410. && isFriendOrSelf(s))) {
  7411. if (j > k1 - 14 && j <= k1) {
  7412. if (myPrivilege >= 1) {
  7413. menuActionName[menuActionRow] = "Report abuse @whi@"
  7414. + s;
  7415. menuActionID[menuActionRow] = 606;
  7416. menuActionRow++;
  7417. }
  7418. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  7419. menuActionID[menuActionRow] = 42;
  7420. menuActionRow++;
  7421. menuActionName[menuActionRow] = "Reply to @whi@" + s;
  7422. menuActionID[menuActionRow] = 639;
  7423. menuActionRow++;
  7424. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  7425. menuActionID[menuActionRow] = 337;
  7426. menuActionRow++;
  7427. }
  7428. l++;
  7429. }
  7430. }
  7431. }
  7432.  
  7433. private void buildDuelorTrade(int j) {
  7434. int l = 0;
  7435. for (int i1 = 0; i1 < 500; i1++) {
  7436. if (chatMessages[i1] == null)
  7437. continue;
  7438. if (chatTypeView != 3 && chatTypeView != 4)
  7439. continue;
  7440. int j1 = chatTypes[i1];
  7441. String s = chatNames[i1];
  7442. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  7443. if (k1 < -23)
  7444. break;
  7445. if (chatTypeView == 3 && j1 == 4
  7446. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  7447. if (j > k1 - 14 && j <= k1) {
  7448. menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  7449. menuActionID[menuActionRow] = 484;
  7450. menuActionRow++;
  7451. }
  7452. l++;
  7453. }
  7454. if (chatTypeView == 4 && j1 == 8
  7455. && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  7456. if (j > k1 - 14 && j <= k1) {
  7457. menuActionName[menuActionRow] = "Accept challenge @whi@"
  7458. + s;
  7459. menuActionID[menuActionRow] = 6;
  7460. menuActionRow++;
  7461. }
  7462. l++;
  7463. }
  7464. }
  7465. }
  7466.  
  7467. private void buildChatAreaMenu(int j, int mX) {
  7468. int l = 0;
  7469. int test = 0;
  7470. for (int i1 = 0; i1 < 500; i1++) {
  7471. if (chatMessages[i1] == null)
  7472. continue;
  7473. int j1 = chatTypes[i1];
  7474. int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  7475. if (k1 < -23)
  7476. break;
  7477. String s = chatNames[i1];
  7478. String ct = chatMessages[i1];
  7479. boolean flag = false;
  7480. if (displayChat) {
  7481. if (chatTypeView == 1) {
  7482. buildPublicChat(j);
  7483. break;
  7484. }
  7485. if (chatTypeView == 2) {
  7486. buildFriendChat(j);
  7487. break;
  7488. }
  7489. if (chatTypeView == 3 || chatTypeView == 4) {
  7490. buildDuelorTrade(j);
  7491. break;
  7492. }
  7493. if (chatTypeView == 5) {
  7494. break;
  7495. }
  7496. if (j1 == 0)
  7497. l++;
  7498. if ((j1 == 1 || j1 == 2)
  7499. && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1
  7500. && isFriendOrSelf(s))) {
  7501. if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  7502. if (myPrivilege >= 1) {
  7503. menuActionName[menuActionRow] = "Report abuse @whi@"
  7504. + s;
  7505. menuActionID[menuActionRow] = 606;
  7506. menuActionRow++;
  7507. }
  7508. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  7509. menuActionID[menuActionRow] = 42;
  7510. menuActionRow++;
  7511. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  7512. menuActionID[menuActionRow] = 337;
  7513. menuActionRow++;
  7514. }
  7515. l++;
  7516. }
  7517. if ((j1 == 3 || j1 == 7)
  7518. && splitPrivateChat == 0
  7519. && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1
  7520. && isFriendOrSelf(s))) {
  7521. if (j > k1 - 14 && j <= k1) {
  7522. if (myPrivilege >= 1) {
  7523. menuActionName[menuActionRow] = "Report abuse @whi@"
  7524. + s;
  7525. menuActionID[menuActionRow] = 606;
  7526. menuActionRow++;
  7527. }
  7528. menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  7529. menuActionID[menuActionRow] = 42;
  7530. menuActionRow++;
  7531. menuActionName[menuActionRow] = "Add friend @whi@" + s;
  7532. menuActionID[menuActionRow] = 337;
  7533. menuActionRow++;
  7534. }
  7535. l++;
  7536. }
  7537. if (j1 == 4
  7538. && (tradeMode == 0 || tradeMode == 1
  7539. && isFriendOrSelf(s))) {
  7540. if (j > k1 - 14 && j <= k1) {
  7541. menuActionName[menuActionRow] = "Accept trade @whi@"
  7542. + s;
  7543. menuActionID[menuActionRow] = 484;
  7544. menuActionRow++;
  7545. }
  7546. l++;
  7547. }
  7548. if ((j1 == 5 || j1 == 6) && splitPrivateChat == 0
  7549. && privateChatMode < 2)
  7550. l++;
  7551. if (j1 == 8
  7552. && (tradeMode == 0 || tradeMode == 1
  7553. && isFriendOrSelf(s))) {
  7554. if (j > k1 - 14 && j <= k1) {
  7555. menuActionName[menuActionRow] = "Accept challenge @whi@"
  7556. + s;
  7557. menuActionID[menuActionRow] = 6;
  7558. menuActionRow++;
  7559. }
  7560. l++;
  7561. }
  7562. if (j1 == 9) {
  7563. if (j > k1 - 14 && j <= k1) {
  7564. String url = getURL(s);
  7565. if (url != null && url.length() > 4) {
  7566. String before = s.substring(0, s.indexOf(url));
  7567. int bx = aTextDrawingArea_1271.getTextWidth(before) + 9;
  7568. int ex = aTextDrawingArea_1271.getTextWidth(url) + 9;
  7569. if (mX >= bx && mX < bx + ex) {
  7570. menuActionName[menuActionRow] = "Go-to @lre@"
  7571. + url;
  7572. menuActionID[menuActionRow] = 927;
  7573. menuActionRow++;
  7574. }
  7575. }
  7576. }
  7577. l++;
  7578. }
  7579. }
  7580. }
  7581. }
  7582.  
  7583. private void drawFriendsListOrWelcomeScreen(RSInterface class9) {
  7584. int j = class9.contentType;
  7585. if (j >= 205 && j <= 205 + 25) {
  7586. j -= 205;
  7587. class9.message = setMessage(j);
  7588. // System.out.println(j);
  7589. return;
  7590. }
  7591. if (j >= 1 && j <= 100 || j >= 701 && j <= 800) {
  7592. if (j == 1 && anInt900 == 0) {
  7593. class9.message = "Loading friend list";
  7594. class9.atActionType = 0;
  7595. return;
  7596. }
  7597. if (j == 1 && anInt900 == 1) {
  7598. class9.message = "Connecting to friendserver";
  7599. class9.atActionType = 0;
  7600. return;
  7601. }
  7602. if (j == 2 && anInt900 != 2) {
  7603. class9.message = "Please wait...";
  7604. class9.atActionType = 0;
  7605. return;
  7606. }
  7607. int k = friendsCount;
  7608. if (anInt900 != 2)
  7609. k = 0;
  7610. if (j > 700)
  7611. j -= 601;
  7612. else
  7613. j--;
  7614. if (j >= k) {
  7615. class9.message = "";
  7616. class9.atActionType = 0;
  7617. return;
  7618. } else {
  7619. class9.message = friendsList[j];
  7620. class9.atActionType = 1;
  7621. return;
  7622. }
  7623. }
  7624.  
  7625. if (j >= 101 && j <= 200 || j >= 801 && j <= 900) {
  7626. int l = friendsCount;
  7627. if (anInt900 != 2)
  7628. l = 0;
  7629. if (j > 800)
  7630. j -= 701;
  7631. else
  7632. j -= 101;
  7633. if (j >= l) {
  7634. class9.message = "";
  7635. class9.atActionType = 0;
  7636. return;
  7637. }
  7638. if (friendsNodeIDs[j] == 0)
  7639. class9.message = "@red@Offline";
  7640. else if (friendsNodeIDs[j] == nodeID)
  7641. class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9) */;
  7642. else
  7643. class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9) */;
  7644. class9.atActionType = 1;
  7645. return;
  7646. }
  7647.  
  7648. if (j >= 401 && j <= 500) {
  7649. if ((j -= 401) == 0 && anInt900 == 0) {
  7650. class9.message = "Loading ignore list";
  7651. class9.atActionType = 0;
  7652. return;
  7653. }
  7654. if (j == 1 && anInt900 == 0) {
  7655. class9.message = "Please wait...";
  7656. class9.atActionType = 0;
  7657. return;
  7658. }
  7659. int j1 = ignoreCount;
  7660. if (anInt900 == 0)
  7661. j1 = 0;
  7662. if (j >= j1) {
  7663. class9.message = "";
  7664. class9.atActionType = 0;
  7665. return;
  7666. } else {
  7667. class9.message = TextClass.fixName(TextClass
  7668. .nameForLong(ignoreListAsLongs[j]));
  7669. class9.atActionType = 1;
  7670. return;
  7671. }
  7672. }
  7673. if (j == 503) {
  7674. class9.scrollMax = ignoreCount * 15 + 20;
  7675. if (class9.scrollMax <= class9.height)
  7676. class9.scrollMax = class9.height + 1;
  7677. return;
  7678. }
  7679. if (j == 327) {
  7680. class9.modelRotation1 = 150;
  7681. class9.modelRotation2 = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  7682. if (aBoolean1031) {
  7683. for (int k1 = 0; k1 < 7; k1++) {
  7684. int l1 = anIntArray1065[k1];
  7685. if (l1 >= 0 && !IdentityKit.cache[l1].method537())
  7686. return;
  7687. }
  7688.  
  7689. aBoolean1031 = false;
  7690. Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  7691. int i2 = 0;
  7692. for (int j2 = 0; j2 < 7; j2++) {
  7693. int k2 = anIntArray1065[j2];
  7694. if (k2 >= 0)
  7695. aclass30_sub2_sub4_sub6s[i2++] = IdentityKit.cache[k2]
  7696. .method538();
  7697. }
  7698.  
  7699. Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  7700. for (int l2 = 0; l2 < 5; l2++)
  7701. if (anIntArray990[l2] != 0) {
  7702. model.method476(anIntArrayArray1003[l2][0],
  7703. anIntArrayArray1003[l2][anIntArray990[l2]]);
  7704. if (l2 == 1)
  7705. model.method476(anIntArray1204[0],
  7706. anIntArray1204[anIntArray990[l2]]);
  7707. }
  7708.  
  7709. model.method469();
  7710. model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  7711. model.method479(64, 850, -30, -50, -30, true);
  7712. class9.disabledMediaType = 5;
  7713. class9.mediaID = 0;
  7714. RSInterface.method208(aBoolean994, model);
  7715. }
  7716. return;
  7717. }
  7718. if (j == 328) {
  7719. RSInterface rsInterface = class9;
  7720. int verticleTilt = 150;
  7721. int animationSpeed = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
  7722. rsInterface.modelRotation1 = verticleTilt;
  7723. rsInterface.modelRotation2 = animationSpeed;
  7724. if (aBoolean1031) {
  7725. Model characterDisplay = myPlayer.method452();
  7726. for (int l2 = 0; l2 < 5; l2++)
  7727. if (anIntArray990[l2] != 0) {
  7728. characterDisplay.method476(anIntArrayArray1003[l2][0],
  7729. anIntArrayArray1003[l2][anIntArray990[l2]]);
  7730. if (l2 == 1)
  7731. characterDisplay.method476(anIntArray1204[0],
  7732. anIntArray1204[anIntArray990[l2]]);
  7733. }
  7734. int staticFrame = myPlayer.anInt1511;
  7735. characterDisplay.method469();
  7736. characterDisplay
  7737. .method470(Animation.anims[staticFrame].anIntArray353[0]);
  7738. // characterDisplay.method479(64, 850, -30, -50, -30, true);
  7739. rsInterface.disabledMediaType = 5;
  7740. rsInterface.mediaID = 0;
  7741. RSInterface.method208(aBoolean994, characterDisplay);
  7742. }
  7743. return;
  7744. }
  7745. if (j == 324) {
  7746. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  7747. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  7748. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  7749. }
  7750. if (aBoolean1047) {
  7751. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  7752. return;
  7753. } else {
  7754. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  7755. return;
  7756. }
  7757. }
  7758. if (j == 325) {
  7759. if (aClass30_Sub2_Sub1_Sub1_931 == null) {
  7760. aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  7761. aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  7762. }
  7763. if (aBoolean1047) {
  7764. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  7765. return;
  7766. } else {
  7767. class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  7768. return;
  7769. }
  7770. }
  7771. if (j == 600) {
  7772. class9.message = reportAbuseInput;
  7773.  
  7774. if (loopCycle % 20 < 10) {
  7775. class9.message += "|";
  7776. return;
  7777. } else {
  7778. class9.message += " ";
  7779. return;
  7780. }
  7781. }
  7782. if (j == 620) {
  7783. class9.message = customInterfaceInput;
  7784.  
  7785. if (loopCycle % 20 < 10) {
  7786. class9.message += "|";
  7787. return;
  7788. } else {
  7789. class9.message += " ";
  7790. return;
  7791. }
  7792. }
  7793. if (j == 613)
  7794. if (myPrivilege >= 1) {
  7795. if (canMute) {
  7796. class9.textColor = 0xff0000;
  7797. class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  7798. } else {
  7799. class9.textColor = 0xffffff;
  7800. class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  7801. }
  7802. } else {
  7803. class9.message = "";
  7804. }
  7805. if (j == 650 || j == 655)
  7806. if (anInt1193 != 0) {
  7807. String s;
  7808. if (daysSinceLastLogin == 0)
  7809. s = "earlier today";
  7810. else if (daysSinceLastLogin == 1)
  7811. s = "yesterday";
  7812. else
  7813. s = daysSinceLastLogin + " days ago";
  7814. class9.message = "You last logged in " + s + " from: "
  7815. + signlink.dns;
  7816. } else {
  7817. class9.message = "";
  7818. }
  7819. if (j == 651) {
  7820. if (unreadMessages == 0) {
  7821. class9.message = "0 unread messages";
  7822. class9.textColor = 0xffff00;
  7823. }
  7824. if (unreadMessages == 1) {
  7825. class9.message = "1 unread message";
  7826. class9.textColor = 65280;
  7827. }
  7828. if (unreadMessages > 1) {
  7829. class9.message = unreadMessages + " unread messages";
  7830. class9.textColor = 65280;
  7831. }
  7832. }
  7833. if (j == 652)
  7834. if (daysSinceRecovChange == 201) {
  7835. if (membersInt == 1)
  7836. class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  7837. else
  7838. class9.message = "";
  7839. } else if (daysSinceRecovChange == 200) {
  7840. class9.message = "You have not yet set any password recovery questions.";
  7841. } else {
  7842. String s1;
  7843. if (daysSinceRecovChange == 0)
  7844. s1 = "Earlier today";
  7845. else if (daysSinceRecovChange == 1)
  7846. s1 = "Yesterday";
  7847. else
  7848. s1 = daysSinceRecovChange + " days ago";
  7849. class9.message = s1 + " you changed your recovery questions";
  7850. }
  7851. if (j == 653)
  7852. if (daysSinceRecovChange == 201) {
  7853. if (membersInt == 1)
  7854. class9.message = "@whi@recommend you use a members world instead. You may use";
  7855. else
  7856. class9.message = "";
  7857. } else if (daysSinceRecovChange == 200)
  7858. class9.message = "We strongly recommend you do so now to secure your account.";
  7859. else
  7860. class9.message = "If you do not remember making this change then cancel it immediately";
  7861. if (j == 654) {
  7862. if (daysSinceRecovChange == 201)
  7863. if (membersInt == 1) {
  7864. class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  7865. return;
  7866. } else {
  7867. class9.message = "";
  7868. return;
  7869. }
  7870. if (daysSinceRecovChange == 200) {
  7871. class9.message = "Do this from the 'account management' area on our front webpage";
  7872. return;
  7873. }
  7874. class9.message = "Do this from the 'account management' area on our front webpage";
  7875. }
  7876. }
  7877.  
  7878. private void drawSplitPrivateChat() {
  7879. if (splitPrivateChat == 0)
  7880. return;
  7881. TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  7882. int i = 0;
  7883. int y = isFullScreen ? extraHeight : 0;
  7884. if (anInt1104 != 0)
  7885. i = 1;
  7886. for (int j = 0; j < 100; j++)
  7887. if (chatMessages[j] != null) {
  7888. int k = chatTypes[j];
  7889. String s = chatNames[j];
  7890. byte byte1 = (byte) (chatRights[j]);
  7891. if ((k == 3 || k == 7)
  7892. && (k == 7 || privateChatMode == 0 || privateChatMode == 1
  7893. && isFriendOrSelf(s))) {
  7894. int l = 329 - i * 13;
  7895. int k1 = 4;
  7896. textDrawingArea.method385(0, "From", l + y, k1);
  7897. textDrawingArea.method385(getChatColor(), "From",
  7898. l - 1 + y, k1);
  7899. k1 += textDrawingArea.getTextWidth("From ");
  7900. if (byte1 > 0) {
  7901. modIcons[byte1].drawBackground(k1, l - 12 + y);
  7902. k1 += modIcons[byte1].anInt1452;
  7903. }
  7904. textDrawingArea.method385(0, s + ": " + chatMessages[j], l
  7905. + y, k1);
  7906. textDrawingArea.method385(getChatColor(), s + ": "
  7907. + chatMessages[j], l - 1 + y, k1);
  7908. if (++i >= 5)
  7909. return;
  7910. }
  7911. if (k == 5 && privateChatMode < 2) {
  7912. int i1 = 329 - i * 13;
  7913. textDrawingArea.method385(0, chatMessages[j], i1 + y, 4);
  7914. textDrawingArea.method385(getChatColor(), chatMessages[j],
  7915. i1 - 1 + y, 4);
  7916. if (++i >= 5)
  7917. return;
  7918. }
  7919. if (k == 6 && privateChatMode < 2) {
  7920. int j1 = 329 - i * 13;
  7921. textDrawingArea.method385(0, "To " + s + ": "
  7922. + chatMessages[j], j1 + y, 4);
  7923. textDrawingArea.method385(getChatColor(), "To " + s + ": "
  7924. + chatMessages[j], j1 - 1 + y, 4);
  7925. if (++i >= 5)
  7926. return;
  7927. }
  7928. }
  7929.  
  7930. }
  7931.  
  7932. public void pushMessage(String s, int i, String s1) {
  7933. // System.out.println("Calling PUSHMESSAGE");
  7934. if (i == 0 && dialogID != -1) {
  7935. aString844 = s;
  7936. super.clickMode3 = 0;
  7937. }
  7938. if (backDialogID == -1)
  7939. inputTaken = true;
  7940. for (int j = 499; j > 0; j--) {
  7941. chatTypes[j] = chatTypes[j - 1];
  7942. chatNames[j] = chatNames[j - 1];
  7943. chatMessages[j] = chatMessages[j - 1];
  7944. chatRights[j] = chatRights[j - 1];
  7945. }
  7946. chatTypes[0] = i;
  7947. chatNames[0] = s1;
  7948. chatMessages[0] = s;
  7949. chatRights[0] = rights;
  7950. }
  7951.  
  7952. public void pushMessage(String s, int i, String s1, int i5) {
  7953. if (i == 0 && dialogID != -1) {
  7954. aString844 = s;
  7955. super.clickMode3 = 0;
  7956. }
  7957. if (backDialogID == -1)
  7958. inputTaken = true;
  7959. for (int j = 499; j > 0; j--) {
  7960. chatTypes[j] = chatTypes[j - 1];
  7961. chatNames[j] = chatNames[j - 1];
  7962. chatMessages[j] = chatMessages[j - 1];
  7963. chatRights[j] = chatRights[j - 1];
  7964. }
  7965. chatTypes[0] = i;
  7966. chatNames[0] = s1;
  7967. chatMessages[0] = s;
  7968. chatRights[0] = i5;
  7969. }
  7970.  
  7971. public static void setTab(int id) {
  7972. needDrawTabArea = true;
  7973. tabID = id;
  7974. tabAreaAltered = true;
  7975. }
  7976.  
  7977. public int getXPForLevel(int level) {
  7978. int points = 0;
  7979. int output = 0;
  7980. for (int lvl = 1; lvl <= level; lvl++) {
  7981. points += Math.floor((double) lvl + 300.0
  7982. * Math.pow(2.0, (double) lvl / 7.0));
  7983. if (lvl >= level) {
  7984. return output;
  7985. }
  7986. output = (int) Math.floor(points / 4);
  7987. }
  7988. return 0;
  7989. }
  7990.  
  7991. private void processTabClick() {
  7992. int x = isFullScreen ? extraWidth : 0;
  7993. int y = isFullScreen ? extraHeight + 262 : 0;
  7994.  
  7995. int extraXX = drawLongTabs ? -232 : 0;
  7996. int extraYY = drawLongTabs ? +35 : 0;
  7997.  
  7998. int extraXX1 = drawLongTabs ? -241 : 0;
  7999. int extraYY1 = drawLongTabs ? +35 : 0;
  8000.  
  8001. int y2 = isFullScreen ? -262 : 0;
  8002. if (is554 == false) {
  8003. if (super.clickMode3 == 1) {
  8004. if (super.saveClickX >= 524 + x + extraXX
  8005. && super.saveClickX <= 561 + x + extraXX
  8006. && super.saveClickY >= 169 + y + extraYY
  8007. && super.saveClickY < 205 + y + extraYY
  8008. && tabInterfaceIDs[0] != -1) {
  8009. needDrawTabArea = true;
  8010. tabID = 0;
  8011. tabAreaAltered = true;
  8012. }
  8013. if (super.saveClickX >= 562 + x + extraXX
  8014. && super.saveClickX <= 594 + x + extraXX
  8015. && super.saveClickY >= 168 + y + extraYY
  8016. && super.saveClickY < 205 + y + extraYY
  8017. && tabInterfaceIDs[1] != -1) {
  8018. needDrawTabArea = true;
  8019. tabID = 1;
  8020. tabAreaAltered = true;
  8021. }
  8022. if (super.saveClickX >= 595 + x + extraXX
  8023. && super.saveClickX <= 626 + x + extraXX
  8024. && super.saveClickY >= 168 + y + extraYY
  8025. && super.saveClickY < 205 + y + extraYY
  8026. && tabInterfaceIDs[2] != -1) {
  8027. needDrawTabArea = true;
  8028. tabID = 2;
  8029. tabAreaAltered = true;
  8030. }
  8031. if (super.saveClickX >= 627 + x + extraXX
  8032. && super.saveClickX <= 660 + x + extraXX
  8033. && super.saveClickY >= 168 + y + extraYY
  8034. && super.saveClickY < 203 + y + extraYY
  8035. && tabInterfaceIDs[3] != -1) {
  8036. needDrawTabArea = true;
  8037. tabID = 3;
  8038. tabAreaAltered = true;
  8039. }
  8040. if (super.saveClickX >= 661 + x + extraXX
  8041. && super.saveClickX <= 693 + x + extraXX
  8042. && super.saveClickY >= 168 + y + extraYY
  8043. && super.saveClickY < 205 + y + extraYY
  8044. && tabInterfaceIDs[4] != -1) {
  8045. needDrawTabArea = true;
  8046. tabID = 4;
  8047. tabAreaAltered = true;
  8048. }
  8049. if (super.saveClickX >= 694 + x + extraXX
  8050. && super.saveClickX <= 725 + x + extraXX
  8051. && super.saveClickY >= 168 + y + extraYY
  8052. && super.saveClickY < 205 + y + extraYY
  8053. && tabInterfaceIDs[5] != -1) {
  8054. needDrawTabArea = true;
  8055. tabID = 5;
  8056. tabAreaAltered = true;
  8057. }
  8058. if (super.saveClickX >= 726 + x + extraXX
  8059. && super.saveClickX <= 765 + x + extraXX
  8060. && super.saveClickY >= 169 + y + extraYY
  8061. && super.saveClickY < 205 + y + extraYY
  8062. && tabInterfaceIDs[6] != -1) {
  8063. needDrawTabArea = true;
  8064. tabID = 6;
  8065. tabAreaAltered = true;
  8066. }
  8067. if (isFullScreen)
  8068. y -= 262;
  8069. if (super.saveClickX >= 524 + x && super.saveClickX <= 561 + x
  8070. && super.saveClickY >= 466 + y
  8071. && super.saveClickY < 503 + y
  8072. && tabInterfaceIDs[7] != -1) {
  8073. needDrawTabArea = true;
  8074. tabID = 7;
  8075. tabAreaAltered = true;
  8076. }
  8077. if (super.saveClickX >= 562 + x && super.saveClickX <= 594 + x
  8078. && super.saveClickY >= 466 + y
  8079. && super.saveClickY < 503 + y
  8080. && tabInterfaceIDs[8] != -1) {
  8081. needDrawTabArea = true;
  8082. tabID = 8;
  8083. tabAreaAltered = true;
  8084. }
  8085. if (super.saveClickX >= 595 + x && super.saveClickX <= 627 + x
  8086. && super.saveClickY >= 466 + y
  8087. && super.saveClickY < 503 + y
  8088. && tabInterfaceIDs[9] != -1) {
  8089. needDrawTabArea = true;
  8090. tabID = 9;
  8091. tabAreaAltered = true;
  8092. }
  8093. if (super.saveClickX >= 627 + x && super.saveClickX <= 664 + x
  8094. && super.saveClickY >= 466 + y
  8095. && super.saveClickY < 503 + y
  8096. && tabInterfaceIDs[10] != -1) {
  8097. needDrawTabArea = true;
  8098. tabID = 10;
  8099. tabAreaAltered = true;
  8100. }
  8101. if (super.saveClickX >= 661 + x && super.saveClickX <= 694 + x
  8102. && super.saveClickY >= 466 + y
  8103. && super.saveClickY < 503 + y
  8104. && tabInterfaceIDs[11] != -1) {
  8105. needDrawTabArea = true;
  8106. tabID = 11;
  8107. tabAreaAltered = true;
  8108. }
  8109. if (super.saveClickX >= 695 + x && super.saveClickX <= 725 + x
  8110. && super.saveClickY >= 466 + y
  8111. && super.saveClickY < 503 + y
  8112. && tabInterfaceIDs[12] != -1) {
  8113. needDrawTabArea = true;
  8114. tabID = 12;
  8115. tabAreaAltered = true;
  8116. }
  8117. if (super.saveClickX >= 726 + x && super.saveClickX <= 765 + x
  8118. && super.saveClickY >= 466 + y
  8119. && super.saveClickY < 502 + y
  8120. && tabInterfaceIDs[13] != -1) {
  8121. needDrawTabArea = true;
  8122. tabID = 13;
  8123. tabAreaAltered = true;
  8124. }
  8125. }
  8126.  
  8127. } else {
  8128. if (super.mouseX >= 521 + x + extraXX1
  8129. && super.mouseX <= 550 + x + extraXX1
  8130. && super.mouseY >= 169 + y + extraYY1
  8131. && super.mouseY < 205 + y + extraYY1 && !drawLongTabs) {
  8132. tabHPos = 0;
  8133. needDrawTabArea = true;
  8134. tabAreaAltered = true;
  8135. } else if (super.mouseX >= 552 + x + extraXX1
  8136. && super.mouseX <= 581 + x + extraXX1
  8137. && super.mouseY >= 168 + y + extraYY1
  8138. && super.mouseY < 205 + y + extraYY1) {
  8139. tabHPos = 1;
  8140. needDrawTabArea = true;
  8141. tabAreaAltered = true;
  8142. } else if (super.mouseX >= 582 + x + extraXX1
  8143. && super.mouseX <= 611 + x + extraXX1
  8144. && super.mouseY >= 168 + y + extraYY1
  8145. && super.mouseY < 205 + y + extraYY1) {
  8146. tabHPos = 2;
  8147. needDrawTabArea = true;
  8148. tabAreaAltered = true;
  8149. } else if (super.mouseX >= 612 + x + extraXX1
  8150. && super.mouseX <= 641 + x + extraXX1
  8151. && super.mouseY >= 168 + y + extraYY1
  8152. && super.mouseY < 203 + y + extraYY1) {
  8153. tabHPos = 3;
  8154. needDrawTabArea = true;
  8155. tabAreaAltered = true;
  8156. } else if (super.mouseX >= 642 + x + extraXX1
  8157. && super.mouseX <= 671 + x + extraXX1
  8158. && super.mouseY >= 168 + y + extraYY1
  8159. && super.mouseY < 205 + y + extraYY1) {
  8160. tabHPos = 4;
  8161. needDrawTabArea = true;
  8162. tabAreaAltered = true;
  8163. } else if (super.mouseX >= 672 + x + extraXX1
  8164. && super.mouseX <= 701 + x + extraXX1
  8165. && super.mouseY >= 168 + y + extraYY1
  8166. && super.mouseY < 205 + y + extraYY1) {
  8167. tabHPos = 5;
  8168. needDrawTabArea = true;
  8169. tabAreaAltered = true;
  8170. } else if (super.mouseX >= 702 + x + extraXX1
  8171. && super.mouseX <= 731 + x + extraXX1
  8172. && super.mouseY >= 169 + y + extraYY1
  8173. && super.mouseY < 205 + y + extraYY1) {
  8174. tabHPos = 6;
  8175. needDrawTabArea = true;
  8176. tabAreaAltered = true;
  8177. } else if (super.mouseX >= 732 + x + extraXX1
  8178. && super.mouseX <= 761 + x + extraXX1
  8179. && super.mouseY >= 169 + y + extraYY1
  8180. && super.mouseY < 205 + y + extraYY1) {
  8181. tabHPos = 7;
  8182. needDrawTabArea = true;
  8183. tabAreaAltered = true;
  8184. } else if (super.mouseX >= 552 + x && super.mouseX <= 581 + x
  8185. && super.mouseY >= 466 + y + y2
  8186. && super.mouseY < 503 + y + y2) {
  8187. tabHPos = 8;
  8188. needDrawTabArea = true;
  8189. tabAreaAltered = true;
  8190.  
  8191. } else if (super.mouseX >= 582 + x && super.mouseX <= 611 + x
  8192. && super.mouseY >= 466 + y + y2
  8193. && super.mouseY < 503 + y + y2) {
  8194. tabHPos = 9;
  8195. needDrawTabArea = true;
  8196. tabAreaAltered = true;
  8197. } else if (super.mouseX >= 612 + x && super.mouseX <= 641 + x
  8198. && super.mouseY >= 466 + y + y2
  8199. && super.mouseY < 503 + y + y2) {
  8200. tabHPos = 10;
  8201. needDrawTabArea = true;
  8202. tabAreaAltered = true;
  8203. } else if (super.mouseX >= 642 + x && super.mouseX <= 671 + x
  8204. && super.mouseY >= 466 + y + y2
  8205. && super.mouseY < 503 + y + y2) {
  8206. tabHPos = 11;
  8207. needDrawTabArea = true;
  8208. tabAreaAltered = true;
  8209. } else if (super.mouseX >= 672 + x && super.mouseX <= 701 + x
  8210. && super.mouseY >= 466 + y + y2
  8211. && super.mouseY < 503 + y + y2) {
  8212. tabHPos = 12;
  8213. needDrawTabArea = true;
  8214. tabAreaAltered = true;
  8215. } else if (super.mouseX >= 702 + x && super.mouseX <= 731 + x
  8216. && super.mouseY >= 466 + y + y2
  8217. && super.mouseY < 502 + y + y2) {
  8218. tabHPos = 13;
  8219. needDrawTabArea = true;
  8220. tabAreaAltered = true;
  8221. } else if (super.mouseX >= 732 + x && super.mouseX <= 761 + x
  8222. && super.mouseY >= 466 + y + y2
  8223. && super.mouseY < 502 + y + y2 && !drawLongTabs) {
  8224. tabHPos = 14;
  8225. needDrawTabArea = true;
  8226. tabAreaAltered = true;
  8227. } else if (super.mouseX >= 522 + x && super.mouseX <= 551 + x
  8228. && super.mouseY >= 466 + y + y2
  8229. && super.mouseY < 503 + y + y2) {
  8230. tabHPos = 15;
  8231. needDrawTabArea = true;
  8232. tabAreaAltered = true;
  8233. } else {
  8234. tabHPos = -1;
  8235. needDrawTabArea = true;
  8236. tabAreaAltered = true;
  8237. }
  8238.  
  8239. if (super.clickMode3 == 1) {
  8240. if (super.saveClickX >= 522 + x + extraXX1
  8241. && super.saveClickX <= 551 + x + extraXX1
  8242. && super.saveClickY >= 169 + y + extraYY1
  8243. && super.saveClickY < 205 + y + extraYY1
  8244. && tabInterfaceIDs[0] != -1 && !drawLongTabs) {
  8245. needDrawTabArea = true;
  8246. tabID = 0;
  8247. tabAreaAltered = true;
  8248. } else if (super.saveClickX >= 552 + x + extraXX1
  8249. && super.saveClickX <= 581 + x + extraXX1
  8250. && super.saveClickY >= 168 + y + extraYY1
  8251. && super.saveClickY < 205 + y + extraYY1
  8252. && tabInterfaceIDs[1] != -1 && !drawLongTabs) {
  8253. needDrawTabArea = true;
  8254. tabID = 1;
  8255. tabAreaAltered = true;
  8256. } else if (super.saveClickX >= 582 + x + extraXX1
  8257. && super.saveClickX <= 611 + x + extraXX1
  8258. && super.saveClickY >= 168 + y + extraYY1
  8259. && super.saveClickY < 205 + y + extraYY1
  8260. && tabInterfaceIDs[2] != -1 && !drawLongTabs) {
  8261. needDrawTabArea = true;
  8262. tabID = 2;
  8263. tabAreaAltered = true;
  8264. } else if (super.saveClickX >= 552 + x + extraXX1
  8265. && super.saveClickX <= 581 + x + extraXX1
  8266. && super.saveClickY >= 168 + y + extraYY1
  8267. && super.saveClickY < 205 + y + extraYY1
  8268. && tabInterfaceIDs[0] != -1 && drawLongTabs) {
  8269. needDrawTabArea = true;
  8270. tabID = 0;
  8271. tabAreaAltered = true;
  8272. } else if (super.saveClickX >= 612 + x + extraXX1
  8273. && super.saveClickX <= 641 + x + extraXX1
  8274. && super.saveClickY >= 168 + y + extraYY1
  8275. && super.saveClickY < 203 + y + extraYY1
  8276. && tabInterfaceIDs[2] != -1 && drawLongTabs) {
  8277. needDrawTabArea = true;
  8278. tabID = 2;
  8279. tabAreaAltered = true;
  8280. } else if (super.saveClickX >= 582 + x + extraXX1
  8281. && super.saveClickX <= 611 + x + extraXX1
  8282. && super.saveClickY >= 168 + y + extraYY1
  8283. && super.saveClickY < 205 + y + extraYY1
  8284. && tabInterfaceIDs[1] != -1 && drawLongTabs) {
  8285. needDrawTabArea = true;
  8286. tabID = 1;
  8287. tabAreaAltered = true;
  8288. } else if (super.saveClickX >= 612 + x + extraXX1
  8289. && super.saveClickX <= 641 + x + extraXX1
  8290. && super.saveClickY >= 168 + y + extraYY1
  8291. && super.saveClickY < 203 + y + extraYY1
  8292. && tabInterfaceIDs[2] != -1 && drawLongTabs) {
  8293. needDrawTabArea = true;
  8294. tabID = 2;
  8295. tabAreaAltered = true;
  8296. } else if (super.saveClickX >= 642 + x + extraXX1
  8297. && super.saveClickX <= 671 + x + extraXX1
  8298. && super.saveClickY >= 168 + y + extraYY1
  8299. && super.saveClickY < 205 + y + extraYY1
  8300. && tabInterfaceIDs[3] != -1) {
  8301. needDrawTabArea = true;
  8302. tabID = 3;
  8303. tabAreaAltered = true;
  8304. } else if (super.saveClickX >= 672 + x + extraXX1
  8305. && super.saveClickX <= 701 + x + extraXX1
  8306. && super.saveClickY >= 168 + y + extraYY1
  8307. && super.saveClickY < 205 + y + extraYY1
  8308. && tabInterfaceIDs[4] != -1) {
  8309. needDrawTabArea = true;
  8310. tabID = 4;
  8311. tabAreaAltered = true;
  8312. } else if (super.saveClickX >= 702 + x + extraXX1
  8313. && super.saveClickX <= 731 + x + extraXX1
  8314. && super.saveClickY >= 169 + y + extraYY1
  8315. && super.saveClickY < 205 + y + extraYY1
  8316. && tabInterfaceIDs[5] != -1) {
  8317. needDrawTabArea = true;
  8318. tabID = 5;
  8319. tabAreaAltered = true;
  8320. } else if (super.saveClickX >= 732 + x + extraXX1
  8321. && super.saveClickX <= 761 + x + extraXX1
  8322. && super.saveClickY >= 169 + y + extraYY1
  8323. && super.saveClickY < 205 + y + extraYY1
  8324. && tabInterfaceIDs[6] != -1) {
  8325. needDrawTabArea = true;
  8326. tabID = 6;
  8327. tabAreaAltered = true;
  8328. } else if (super.saveClickX >= 522 + x + extraXX1
  8329. && super.saveClickX <= 551 + x + extraXX1
  8330. && super.saveClickY >= 466 + y + extraYY1
  8331. && super.saveClickY < 503 + y + extraYY1
  8332. && tabInterfaceIDs[16] != -1) {
  8333. needDrawTabArea = true;
  8334. tabID = 16;
  8335. tabAreaAltered = true;
  8336. } else if (super.saveClickX >= 552 + x
  8337. && super.saveClickX <= 581 + x
  8338. && super.saveClickY >= 466 + y + y2
  8339. && super.saveClickY < 503 + y + y2
  8340. && tabInterfaceIDs[8] != -1) {
  8341. needDrawTabArea = true;
  8342. tabID = 8;
  8343. tabAreaAltered = true;
  8344.  
  8345. } else if (super.saveClickX >= 582 + x
  8346. && super.saveClickX <= 611 + x
  8347. && super.saveClickY >= 466 + y + y2
  8348. && super.saveClickY < 503 + y + y2
  8349. && tabInterfaceIDs[9] != -1) {
  8350. needDrawTabArea = true;
  8351. tabID = 9;
  8352. tabAreaAltered = true;
  8353. } else if (super.saveClickX >= 612 + x
  8354. && super.saveClickX <= 641 + x
  8355. && super.saveClickY >= 466 + y + y2
  8356. && super.saveClickY < 503 + y + y2
  8357. && tabInterfaceIDs[7] != -1) {
  8358. needDrawTabArea = true;
  8359. tabID = 7;
  8360. tabAreaAltered = true;
  8361. } else if (super.saveClickX >= 642 + x
  8362. && super.saveClickX <= 671 + x
  8363. && super.saveClickY >= 466 + y + y2
  8364. && super.saveClickY < 503 + y + y2
  8365. && tabInterfaceIDs[11] != -1) {
  8366. needDrawTabArea = true;
  8367. tabID = 11;
  8368. tabAreaAltered = true;
  8369. } else if (super.saveClickX >= 672 + x
  8370. && super.saveClickX <= 701 + x
  8371. && super.saveClickY >= 466 + y + y2
  8372. && super.saveClickY < 503 + y + y2
  8373. && tabInterfaceIDs[12] != -1) {
  8374. needDrawTabArea = true;
  8375. tabID = 12;
  8376. tabAreaAltered = true;
  8377. } else if (super.saveClickX >= 702 + x
  8378. && super.saveClickX <= 731 + x
  8379. && super.saveClickY >= 466 + y + y2
  8380. && super.saveClickY < 502 + y + y2
  8381. && tabInterfaceIDs[13] != -1) {
  8382. needDrawTabArea = true;
  8383. tabID = 13;
  8384. tabAreaAltered = true;
  8385. } else if (super.saveClickX >= 732 + x
  8386. && super.saveClickX <= 761 + x
  8387. && super.saveClickY >= 466 + y + y2
  8388. && super.saveClickY < 502 + y + y2
  8389. && tabInterfaceIDs[15] != -1) {
  8390. needDrawTabArea = true;
  8391. tabID = 15;
  8392. tabAreaAltered = true;
  8393. } else if (super.saveClickX >= 612 + x
  8394. && super.saveClickX <= 640 + x
  8395. && super.saveClickY >= 168 + y + y2
  8396. && super.saveClickY < 202 + y + y2
  8397. && tabInterfaceIDs[14] != -1) {
  8398. needDrawTabArea = true;
  8399. tabID = 14;
  8400. tabAreaAltered = true;
  8401. } else if (super.saveClickX >= 742 + x
  8402. && super.saveClickX <= 764 + x
  8403. && super.saveClickY >= 1 + y + y2
  8404. && super.saveClickY < 24 + y + y2
  8405. && tabInterfaceIDs[10] != -1) {
  8406. needDrawTabArea = true;
  8407. tabID = 10;
  8408. tabAreaAltered = true;
  8409. }
  8410. /* Logout X */
  8411. else if (super.saveClickX >= 742 + x
  8412. && super.saveClickX <= 764 + x
  8413. && super.saveClickY >= 1 + y + y2
  8414. && super.saveClickY < 24 + y + y2
  8415. && tabInterfaceIDs[10] != -1) {
  8416. needDrawTabArea = true;
  8417. tabID = 10;
  8418. tabAreaAltered = true;
  8419. }
  8420. }
  8421. }
  8422. }
  8423.  
  8424. private void resetImageProducers2() {
  8425. if (aRSImageProducer_1166 != null)
  8426. return;
  8427. nullLoader();
  8428. super.fullGameScreen = null;
  8429. aRSImageProducer_1107 = null;
  8430. aRSImageProducer_1108 = null;
  8431. aRSImageProducer_1109 = null;
  8432. aRSImageProducer_1110 = null;
  8433. aRSImageProducer_1111 = null;
  8434. aRSImageProducer_1112 = null;
  8435. aRSImageProducer_1113 = null;
  8436. aRSImageProducer_1114 = null;
  8437. aRSImageProducer_1115 = null;
  8438. aRSImageProducer_1166 = new RSImageProducer(519, 165,
  8439. getGameComponent());
  8440. aRSImageProducer_1164 = new RSImageProducer(246, 168,
  8441. getGameComponent());
  8442. DrawingArea.setAllPixelsToZero();
  8443. // mapBack.drawBackground(0, 0);
  8444. aRSImageProducer_1163 = new RSImageProducer(246, 335,
  8445. getGameComponent());
  8446. if (isFullScreen)
  8447. aRSImageProducer_1165 = new RSImageProducer(clientWidth,
  8448. clientHeight, getGameComponent());
  8449. else
  8450. aRSImageProducer_1165 = new RSImageProducer(512, 334,
  8451. getGameComponent());
  8452. DrawingArea.setAllPixelsToZero();
  8453. aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  8454. aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  8455. aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  8456. welcomeScreenRaised = true;
  8457. }
  8458.  
  8459. public String getDocumentBaseHost() {
  8460. if (signlink.mainapp != null) {
  8461. return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  8462. }
  8463. return "";
  8464. }
  8465.  
  8466. private void method81(Sprite sprite, int j, int k) {
  8467. int l = k * k + j * j;
  8468. if (l > 4225 && l < 0x15f90) {
  8469. int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  8470. int j1 = Model.modelIntArray1[i1];
  8471. int k1 = Model.modelIntArray2[i1];
  8472. j1 = (j1 * 256) / (minimapInt3 + 256);
  8473. k1 = (k1 * 256) / (minimapInt3 + 256);
  8474. int l1 = j * j1 + k * k1 >> 16;
  8475. int i2 = j * k1 - k * j1 >> 16;
  8476. double d = Math.atan2(l1, i2);
  8477. int j2 = (int) (Math.sin(d) * 63D);
  8478. int k2 = (int) (Math.cos(d) * 57D);
  8479. mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  8480. } else {
  8481. markMinimap(sprite, k, j);
  8482. }
  8483. }
  8484.  
  8485. private void rightClickChatButtons() {
  8486. int y = extraHeight;
  8487.  
  8488. if (displayChat) {
  8489. if (super.mouseX >= 5 && super.mouseX <= 61
  8490. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  8491. menuActionName[1] = "View All";
  8492. menuActionID[1] = 999;
  8493. menuActionRow = 2;
  8494. } else if (super.mouseX >= 71 && super.mouseX <= 127
  8495. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  8496. menuActionName[1] = "View Game";
  8497. menuActionID[1] = 998;
  8498. menuActionRow = 2;
  8499. } else if (super.mouseX >= 137 && super.mouseX <= 193
  8500. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  8501. menuActionName[1] = "Hide public";
  8502. menuActionID[1] = 997;
  8503. menuActionName[2] = "Off public";
  8504. menuActionID[2] = 996;
  8505. menuActionName[3] = "Friends public";
  8506. menuActionID[3] = 995;
  8507. menuActionName[4] = "On public";
  8508. menuActionID[4] = 994;
  8509. menuActionName[5] = "View public";
  8510. menuActionID[5] = 993;
  8511. menuActionRow = 6;
  8512. } else if (super.mouseX >= 203 && super.mouseX <= 259
  8513. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  8514. menuActionName[1] = "Off private";
  8515. menuActionID[1] = 992;
  8516. menuActionName[2] = "Friends private";
  8517. menuActionID[2] = 991;
  8518. menuActionName[3] = "On private";
  8519. menuActionID[3] = 990;
  8520. menuActionName[4] = "View private";
  8521. menuActionID[4] = 989;
  8522. menuActionRow = 5;
  8523. } else if (super.mouseX >= 269 && super.mouseX <= 325
  8524. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  8525. menuActionName[1] = "Off clan chat";
  8526. menuActionID[1] = 1003;
  8527. menuActionName[2] = "Friends clan chat";
  8528. menuActionID[2] = 1002;
  8529. menuActionName[3] = "On clan chat";
  8530. menuActionID[3] = 1001;
  8531. menuActionName[4] = "View clan chat";
  8532. menuActionID[4] = 1000;
  8533. menuActionRow = 5;
  8534. } else if (super.mouseX >= 335 && super.mouseX <= 391
  8535. && super.mouseY >= 482 + y && super.mouseY <= 503 + y) {
  8536. menuActionName[1] = "Off trade";
  8537. menuActionID[1] = 987;
  8538. menuActionName[2] = "Friends trade";
  8539. menuActionID[2] = 986;
  8540. menuActionName[3] = "On trade";
  8541. menuActionID[3] = 985;
  8542. menuActionName[4] = "View trade";
  8543. menuActionID[4] = 984;
  8544. menuActionRow = 5;
  8545. }
  8546. }
  8547. }
  8548.  
  8549. public boolean isChatInterface, displayChat;
  8550.  
  8551. public boolean canClickScreen() {
  8552. if (super.mouseX > 0
  8553. && super.mouseY > clientHeight - 165
  8554. && super.mouseX < 519
  8555. && super.mouseY < clientHeight
  8556. && displayChat
  8557. || super.mouseX > clientWidth - 246
  8558. && super.mouseY > clientHeight - 335
  8559. && super.mouseX < clientWidth
  8560. && super.mouseY < clientHeight
  8561. || super.mouseX > clientWidth - 220
  8562. && super.mouseY > 0
  8563. && super.mouseX < clientWidth
  8564. && super.mouseY < 164
  8565. || (super.mouseX > 247 && super.mouseX < 260
  8566. && super.mouseY > clientHeight - 173
  8567. && super.mouseY < clientHeight - 166 || super.mouseY > clientHeight - 15)
  8568. || super.mouseX > clientWidth - 462
  8569. && super.mouseY > clientHeight - 36
  8570. && super.mouseX < clientWidth && super.mouseY < clientHeight)
  8571. return false;
  8572. else
  8573. return true;
  8574. }
  8575.  
  8576. public void processRightClick() {
  8577. int x = isFullScreen ? extraWidth + 13 : 0;
  8578. int y = isFullScreen ? extraHeight - 40 : 0;
  8579. if (activeInterfaceType != 0) {
  8580. return;
  8581. }
  8582. menuActionName[0] = "Cancel";
  8583. menuActionID[0] = 1107;
  8584. menuActionRow = 1;
  8585. if (fullscreenInterfaceID != -1) {
  8586. anInt886 = 0;
  8587. anInt1315 = 0;
  8588. buildInterfaceMenu(8,
  8589. RSInterface.interfaceCache[fullscreenInterfaceID],
  8590. super.mouseX, 8, super.mouseY, 0);
  8591. if (anInt886 != anInt1026) {
  8592. anInt1026 = anInt886;
  8593. }
  8594. if (anInt1315 != anInt1129) {
  8595. anInt1129 = anInt1315;
  8596. }
  8597. return;
  8598. }
  8599. buildSplitPrivateChatMenu();
  8600. anInt886 = 0;
  8601. anInt1315 = 0;
  8602. if (!isFullScreen)
  8603. if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516
  8604. && super.mouseY < 338)
  8605. if (openInterfaceID != -1)
  8606. buildInterfaceMenu(4,
  8607. RSInterface.interfaceCache[openInterfaceID],
  8608. super.mouseX, 4, super.mouseY, 0);
  8609. else
  8610. build3dScreenMenu();
  8611. if (isFullScreen) {
  8612. if (canClickScreen())
  8613. if (super.mouseX > (clientWidth / 2) - 256
  8614. && super.mouseY > (clientHeight / 2) - 167
  8615. && super.mouseX < ((clientWidth / 2) + 256)
  8616. && super.mouseY < (clientHeight / 2) + 167
  8617. && openInterfaceID != -1)
  8618. buildInterfaceMenu((clientWidth / 2) - 256,
  8619. RSInterface.interfaceCache[openInterfaceID],
  8620. super.mouseX, (clientHeight / 2) - 167,
  8621. super.mouseY, 0);
  8622. else
  8623. build3dScreenMenu();
  8624. }
  8625. if (anInt886 != anInt1026) {
  8626. anInt1026 = anInt886;
  8627. }
  8628. if (anInt1315 != anInt1129) {
  8629. anInt1129 = anInt1315;
  8630. }
  8631. anInt886 = 0;
  8632. anInt1315 = 0;
  8633. if (super.mouseX > 560 + extraWidth && super.mouseY > 165 + extraHeight
  8634. && super.mouseX < 752 + extraWidth
  8635. && super.mouseY < 426 + extraHeight && isFullScreen
  8636. && !drawLongTabs) {
  8637. if (invOverlayInterfaceID != -1 && isFullScreen) {
  8638. buildInterfaceMenu(560 + extraWidth,
  8639. RSInterface.interfaceCache[invOverlayInterfaceID],
  8640. super.mouseX, 165 + extraHeight, super.mouseY, 0);
  8641. } else if (tabInterfaceIDs[tabID] != -1 && isFullScreen) {
  8642. buildInterfaceMenu(560 + extraWidth,
  8643. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  8644. super.mouseX, 165 + extraHeight, super.mouseY, 0);
  8645. }
  8646. }
  8647. if (super.mouseX > 560 + extraWidth && super.mouseY > 165 + extraHeight
  8648. && super.mouseX < 752 + 35 + extraWidth
  8649. && super.mouseY < 426 + 35 + extraHeight && isFullScreen
  8650. && drawLongTabs && !is554) {
  8651. if (invOverlayInterfaceID != -1 && isFullScreen && !is554) {
  8652. buildInterfaceMenu(560 + extraWidth,
  8653. RSInterface.interfaceCache[invOverlayInterfaceID],
  8654. super.mouseX, 165 + 35 + extraHeight, super.mouseY, 0);
  8655. } else if (tabInterfaceIDs[tabID] != -1 && isFullScreen && !is554) {
  8656. buildInterfaceMenu(560 + extraWidth,
  8657. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  8658. super.mouseX, 165 + 35 + extraHeight, super.mouseY, 0);
  8659. }
  8660. }
  8661. if (super.mouseX > 560 + extraWidth && super.mouseY > 165 + extraHeight
  8662. && super.mouseX < 752 + 35 + extraWidth
  8663. && super.mouseY < 426 + 35 - 6 + extraHeight && isFullScreen
  8664. && drawLongTabs && is554) {
  8665. if (invOverlayInterfaceID != -1 && isFullScreen && is554) {
  8666. buildInterfaceMenu(560 + extraWidth,
  8667. RSInterface.interfaceCache[invOverlayInterfaceID],
  8668. super.mouseX, 165 + 35 - 6 + extraHeight, super.mouseY,
  8669. 0);
  8670. } else if (tabInterfaceIDs[tabID] != -1 && isFullScreen && is554) {
  8671. buildInterfaceMenu(560 + extraWidth,
  8672. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  8673. super.mouseX, 165 + 35 - 6 + extraHeight, super.mouseY,
  8674. 0);
  8675. }
  8676. }
  8677. if (super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740
  8678. && super.mouseY < 468 && !isFullScreen) {
  8679. if (invOverlayInterfaceID != -1 && !isFullScreen) {
  8680. buildInterfaceMenu(548,
  8681. RSInterface.interfaceCache[invOverlayInterfaceID],
  8682. super.mouseX, 207, super.mouseY, 0);
  8683. } else if (tabInterfaceIDs[tabID] != -1 && !isFullScreen) {
  8684. buildInterfaceMenu(548,
  8685. RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
  8686. super.mouseX, 207, super.mouseY, 0);
  8687. }
  8688. }
  8689. if (anInt886 != anInt1048) {
  8690. needDrawTabArea = true;
  8691. tabAreaAltered = true;
  8692. anInt1048 = anInt886;
  8693. }
  8694. if (anInt1315 != anInt1044) {
  8695. needDrawTabArea = true;
  8696. tabAreaAltered = true;
  8697. anInt1044 = anInt1315;
  8698. }
  8699. anInt886 = 0;
  8700. anInt1315 = 0;
  8701. if (super.mouseX > 0 && super.mouseY > 334 + extraHeight
  8702. && super.mouseX < 490 && super.mouseY < 459 + extraHeight) {
  8703. if (backDialogID != -1) {
  8704. buildInterfaceMenu(20,
  8705. RSInterface.interfaceCache[backDialogID], super.mouseX,
  8706. 354 + extraHeight, super.mouseY, 0);
  8707. } else if (super.mouseY < 459 + extraHeight && super.mouseX < 490) {
  8708. buildChatAreaMenu(super.mouseY - (334 + extraHeight),
  8709. super.mouseX);
  8710. }
  8711. }
  8712. if (backDialogID != -1 && anInt886 != anInt1039) {
  8713. inputTaken = true;
  8714. anInt1039 = anInt886;
  8715. }
  8716. if (super.mouseX >= 515 + extraWidth && super.mouseY >= 0 + extraHeight
  8717. && super.mouseX <= 765 + extraWidth
  8718. && super.mouseY <= 167 + extraHeight)
  8719. if (openInterfaceID != -1)
  8720. buildInterfaceMenu(0,
  8721. RSInterface.interfaceCache[openInterfaceID],
  8722. super.mouseX, 0, super.mouseY, 0);
  8723. if (anInt886 != anInt1026)
  8724. anInt1026 = anInt886;
  8725. anInt886 = 0;
  8726. /* Enable custom right click areas */
  8727. rightClickMapArea();
  8728. if (super.mouseX > 4 && super.mouseY > clientHeight - 23
  8729. && super.mouseX < 516 && super.mouseY < clientHeight) {
  8730. rightClickChatButtons();
  8731. }
  8732. alertHandler.processMouse(super.mouseX, super.mouseY);
  8733. /**/
  8734. boolean flag = false;
  8735. while (!flag) {
  8736. flag = true;
  8737. for (int j = 0; j < menuActionRow - 1; j++) {
  8738. if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  8739. String s = menuActionName[j];
  8740. menuActionName[j] = menuActionName[j + 1];
  8741. menuActionName[j + 1] = s;
  8742. int k = menuActionID[j];
  8743. menuActionID[j] = menuActionID[j + 1];
  8744. menuActionID[j + 1] = k;
  8745. k = menuActionCmd2[j];
  8746. menuActionCmd2[j] = menuActionCmd2[j + 1];
  8747. menuActionCmd2[j + 1] = k;
  8748. k = menuActionCmd3[j];
  8749. menuActionCmd3[j] = menuActionCmd3[j + 1];
  8750. menuActionCmd3[j + 1] = k;
  8751. k = menuActionCmd1[j];
  8752. menuActionCmd1[j] = menuActionCmd1[j + 1];
  8753. menuActionCmd1[j + 1] = k;
  8754. flag = false;
  8755. }
  8756. }
  8757. }
  8758. }
  8759.  
  8760. private int retardLevel = 5;
  8761.  
  8762. private int method83(int i, int j, int k) {
  8763. int l = 256 - k;
  8764. return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00)
  8765. + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  8766. }
  8767.  
  8768. private void login(String username, String password, boolean flag) {
  8769. signlink.errorname = username;
  8770. System.out.println("Username: " + username);
  8771. try {
  8772. if (!flag) {
  8773. loginMessage2 = "";
  8774. loginMessage1 = "Connecting to server...";
  8775. drawLoginScreen();
  8776. }
  8777.  
  8778. //System.out.println("Connecting to port : " + (43597 + portOff));
  8779. //t reckless = 2;
  8780. socketStream = new RSSocket(this,
  8781. openSocket(Configuration.serverPort + portOff)); // CHANGE
  8782. // 43599
  8783. long l = TextClass.longForName(username);
  8784. int i = (int) (l >> 16 & 31L);
  8785. stream.currentOffset = 0;
  8786. stream.writeWordBigEndian(14); // Sometimes here bugs
  8787. stream.writeWordBigEndian(i);
  8788. socketStream.queueBytes(2, stream.buffer);
  8789. for (int j = 0; j < 8; j++)
  8790. socketStream.read();
  8791.  
  8792. int k = socketStream.read();
  8793. System.out.println("Connection K is " + k);
  8794. int i1 = k;
  8795. if (k == 0) {
  8796. socketStream.flushInputStream(inStream.buffer, 8);
  8797. inStream.currentOffset = 0;
  8798. aLong1215 = inStream.readQWord(); // Bug occurs here
  8799. int ai[] = new int[4];
  8800. ai[0] = (int) (Math.random() * 99999999D);
  8801. ai[1] = (int) (Math.random() * 99999999D);
  8802. ai[2] = (int) (aLong1215 >> 32);
  8803. ai[3] = (int) aLong1215;
  8804. stream.currentOffset = 0;
  8805. stream.writeWordBigEndian(10);
  8806. stream.writeDWord(ai[0]);
  8807. stream.writeDWord(ai[1]);
  8808. stream.writeDWord(ai[2]);
  8809. stream.writeDWord(ai[3]);
  8810. stream.writeDWord(15457);
  8811. stream.writeDWord(macAdd);
  8812. stream.writeString(username);
  8813. stream.writeString(password);
  8814. stream.doKeys();
  8815. aStream_847.currentOffset = 0;
  8816. if (flag)
  8817. aStream_847.writeWordBigEndian(18);
  8818. else
  8819. aStream_847.writeWordBigEndian(16);
  8820. aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1
  8821. + 1 + 2);
  8822. aStream_847.writeWordBigEndian(122); // CHANGE 122
  8823. aStream_847.writeWord(490); // CHANGE 490
  8824.  
  8825. aStream_847.writeWordBigEndian(5); // CHANGE 5
  8826. for (int l1 = 0; l1 < 9; l1++)
  8827. aStream_847.writeDWord(expectedCRCs[l1]);
  8828.  
  8829. aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  8830. stream.encryption = new ISAACRandomGen(ai);
  8831. for (int j2 = 0; j2 < 4; j2++)
  8832. ai[j2] += 50;
  8833.  
  8834. encryption = new ISAACRandomGen(ai);
  8835. socketStream.queueBytes(aStream_847.currentOffset,
  8836. aStream_847.buffer);
  8837. k = socketStream.read();
  8838. }
  8839. System.out.println("Connection K is now " + k);
  8840. if (k == 1) {
  8841. try {
  8842. Thread.sleep(2000L);
  8843. } catch (Exception _ex) {
  8844. }
  8845. login(username, password, flag);
  8846. return;
  8847. }
  8848. if (k == 2) {
  8849. myPrivilege = socketStream.read();
  8850. flagged = socketStream.read() == 1;
  8851. aLong1220 = 0L;
  8852. anInt1022 = 0;
  8853. mouseDetection.coordsIndex = 0;
  8854. super.awtFocus = true;
  8855. aBoolean954 = true;
  8856. loggedIn = true;
  8857. stream.currentOffset = 0;
  8858. inStream.currentOffset = 0;
  8859. pktType = -1;
  8860. anInt841 = -1;
  8861. anInt842 = -1;
  8862. anInt843 = -1;
  8863. pktSize = 0;
  8864. anInt1009 = 0;
  8865. anInt1104 = 0;
  8866. anInt1011 = 0;
  8867. anInt855 = 0;
  8868. menuActionRow = 0;
  8869. menuOpen = false;
  8870. super.idleTime = 0;
  8871. for (int j1 = 0; j1 < 100; j1++)
  8872. chatMessages[j1] = null;
  8873.  
  8874. itemSelected = 0;
  8875. spellSelected = 0;
  8876. loadingStage = 0;
  8877. anInt1062 = 0;
  8878. anInt1278 = (int) (Math.random() * 100D) - 50;
  8879. anInt1131 = (int) (Math.random() * 110D) - 55;
  8880. anInt896 = (int) (Math.random() * 80D) - 40;
  8881. minimapInt2 = (int) (Math.random() * 120D) - 60;
  8882. minimapInt3 = (int) (Math.random() * 30D) - 20;
  8883. minimapInt1 = (int) (Math.random() * 20D) - 10 & 0x7ff;
  8884. anInt1021 = 0;
  8885. anInt985 = -1;
  8886. destX = 0;
  8887. destY = 0;
  8888. playerCount = 0;
  8889. npcCount = 0;
  8890. for (int i2 = 0; i2 < maxPlayers; i2++) {
  8891. playerArray[i2] = null;
  8892. aStreamArray895s[i2] = null;
  8893. }
  8894.  
  8895. for (int k2 = 0; k2 < 16384; k2++)
  8896. npcArray[k2] = null;
  8897.  
  8898. myPlayer = playerArray[myPlayerIndex] = new Player();
  8899. aClass19_1013.removeAll();
  8900. aClass19_1056.removeAll();
  8901. for (int l2 = 0; l2 < 4; l2++) {
  8902. for (int i3 = 0; i3 < 104; i3++) {
  8903. for (int k3 = 0; k3 < 104; k3++)
  8904. groundArray[l2][i3][k3] = null;
  8905.  
  8906. }
  8907.  
  8908. }
  8909.  
  8910. aClass19_1179 = new NodeList();
  8911. fullscreenInterfaceID = -1;
  8912. anInt900 = 0;
  8913. friendsCount = 0;
  8914. dialogID = -1;
  8915. backDialogID = -1;
  8916. openInterfaceID = -1;
  8917. invOverlayInterfaceID = -1;
  8918. anInt1018 = -1;
  8919. aBoolean1149 = false;
  8920. tabID = 3;
  8921. inputDialogState = 0;
  8922. menuOpen = false;
  8923. messagePromptRaised = false;
  8924. aString844 = null;
  8925. anInt1055 = 0;
  8926. anInt1054 = -1;
  8927. aBoolean1047 = true;
  8928. method45();
  8929. for (int j3 = 0; j3 < 5; j3++)
  8930. anIntArray990[j3] = 0;
  8931.  
  8932. for (int l3 = 0; l3 < 5; l3++) {
  8933. atPlayerActions[l3] = null;
  8934. atPlayerArray[l3] = false;
  8935. }
  8936. anInt1175 = 0;
  8937. anInt1134 = 0;
  8938. anInt986 = 0;
  8939. anInt1288 = 0;
  8940. anInt924 = 0;
  8941. anInt1188 = 0;
  8942. anInt1155 = 0;
  8943. anInt1226 = 0;
  8944. int anInt941 = 0;
  8945. int anInt1260 = 0;
  8946. resetImageProducers2();
  8947. setDefaultCursor();
  8948. // resize(clientWidth, clientHeight);
  8949. if (is474) {
  8950. sendFrame126("474", 37058);
  8951. }
  8952. if (is554) {
  8953. sendFrame126("600+", 37058);
  8954. }
  8955. if (!is474 && !is554) {
  8956. sendFrame126("500+", 37058);
  8957. }
  8958. if (HPBarToggle) {
  8959. sendFrame126("@gre@On ", 37061);
  8960. } else {
  8961. sendFrame126("@red@Off ", 37061);
  8962. }
  8963. if (sky) {
  8964. sendFrame126("@gre@On", 37065);
  8965. } else {
  8966. sendFrame126("@red@Off ", 37065);
  8967. }
  8968. if (newDamage) {
  8969. sendFrame126("@gre@On ", 37059);
  8970. } else {
  8971. sendFrame126("@red@Off ", 37059);
  8972. }
  8973. if (menuToggle) {
  8974. sendFrame126("@gre@On", 37062);
  8975. } else {
  8976. sendFrame126("@red@Off ", 37062);
  8977. }
  8978. if (headname) {
  8979. sendFrame126("@gre@On", 37063);
  8980. } else {
  8981. sendFrame126("@red@Off ", 37063);
  8982. }
  8983. if (hitmarks) {
  8984. sendFrame126("@gre@On ", 37060);
  8985. } else {
  8986. sendFrame126("@red@Off ", 37060);
  8987. }
  8988. if (headhp) {
  8989. sendFrame126("@gre@On", 37064);
  8990. } else {
  8991. sendFrame126("@red@Off ", 37064);
  8992. }
  8993. System.out.println("Passed through k = 2");
  8994. /*
  8995. * if (musicloaded) sendFrame126("@gre@" + SearchDrive.counter +
  8996. * " Tracks.", 31425);
  8997. */
  8998. // return;
  8999. }
  9000. if (k == 3) {
  9001. loginMessage1 = "";
  9002. loginMessage2 = "Invalid username or password.";
  9003. return;
  9004. }
  9005. if (k == 4) {
  9006. loginMessage1 = "Your account has been disabled.";
  9007. loginMessage2 = "Please check your message-center for details.";
  9008. return;
  9009. }
  9010. if (k == 5) {
  9011. loginMessage1 = "Your account is already logged in.";
  9012. loginMessage2 = "Try again in 60 secs...";
  9013. return;
  9014. }
  9015. if (k == 6) {
  9016. loginMessage1 = SERVER_NAME + " has been updated!";
  9017. loginMessage2 = "Please reload this page or get the new client!";
  9018. return;
  9019. }
  9020. if (k == 7) {
  9021. loginMessage1 = "This world is full.";
  9022. loginMessage2 = "Please use a different world.";
  9023. return;
  9024. }
  9025. if (k == 8) {
  9026. loginMessage1 = "Unable to connect.";
  9027. loginMessage2 = "Login server offline.";
  9028. return;
  9029. }
  9030. if (k == 9) {
  9031. loginMessage1 = "Login limit exceeded.";
  9032. loginMessage2 = "Too many connections from your address.";
  9033. return;
  9034. }
  9035. if (k == 10) {
  9036. loginMessage1 = "Unable to connect.";
  9037. loginMessage2 = "Bad session id.";
  9038. return;
  9039. }
  9040. if (k == 11) {
  9041. loginMessage2 = "Login server rejected session.";
  9042. loginMessage2 = "Please try again.";
  9043. return;
  9044. }
  9045. if (k == 12) {
  9046. loginMessage1 = "You need a members account to login to this world.";
  9047. loginMessage2 = "Please subscribe, or use a different world.";
  9048. return;
  9049. }
  9050. if (k == 13) {
  9051. loginMessage1 = "Could not complete login.";
  9052. loginMessage2 = "Please try using a different world.";
  9053. return;
  9054. }
  9055. if (k == 14) {
  9056. loginMessage1 = "The server is being updated.";
  9057. loginMessage2 = "Please wait 1 minute and try again.";
  9058. return;
  9059. }
  9060. if (k == 15) {
  9061. loggedIn = true;
  9062. stream.currentOffset = 0;
  9063. inStream.currentOffset = 0;
  9064. pktType = -1;
  9065. anInt841 = -1;
  9066. anInt842 = -1;
  9067. anInt843 = -1;
  9068. pktSize = 0;
  9069. anInt1009 = 0;
  9070. anInt1104 = 0;
  9071. menuActionRow = 0;
  9072. menuOpen = false;
  9073. aLong824 = System.currentTimeMillis();
  9074. return;
  9075. }
  9076. if (k == 16) {
  9077. loginMessage1 = "Login attempts exceeded.";
  9078. loginMessage2 = "Please wait 1 minute and try again.";
  9079. return;
  9080. }
  9081. if (k == 17) {
  9082. loginMessage1 = "You are standing in a members-only area.";
  9083. loginMessage2 = "To play on this world move to a free area first";
  9084. return;
  9085. }
  9086. if (k == 20) {
  9087. loginMessage1 = "Invalid loginserver requested";
  9088. loginMessage2 = "Please try using a different world.";
  9089. return;
  9090. }
  9091. if (k == 21) {
  9092. for (int k1 = socketStream.read(); k1 >= 0; k1--) {
  9093. loginMessage1 = "You have only just left another world";
  9094. loginMessage2 = "Your profile will be transferred in: "
  9095. + k1 + " seconds";
  9096. drawLoginScreen();
  9097. try {
  9098. Thread.sleep(1000L);
  9099. } catch (Exception _ex) {
  9100. }
  9101. }
  9102.  
  9103. login(username, password, flag);
  9104. return;
  9105. }
  9106. if (k == -1) {
  9107. if (i1 == 0) {
  9108. if (loginFailures < 2) {
  9109. try {
  9110. Thread.sleep(2000L);
  9111. } catch (Exception _ex) {
  9112. }
  9113. loginFailures++;
  9114. login(username, password, flag);
  9115. return;
  9116. } else {
  9117. loginMessage1 = "No response from loginserver";
  9118. loginMessage2 = "Please wait 1 minute and try again.";
  9119. return;
  9120. }
  9121. } else {
  9122. loginMessage1 = "No response from server";
  9123. loginMessage2 = "Please try using a different world.";
  9124. return;
  9125. }
  9126. } else {
  9127. System.out.println("response:" + k);
  9128. loginMessage1 = "Unexpected server response";
  9129. loginMessage2 = "Please try using a different world.";
  9130. return;
  9131. }
  9132. } catch (IOException ex) {
  9133. ex.printStackTrace();
  9134. System.out.println("Error connecting to server: " + SERVER_IP);
  9135. String error = "";
  9136. for (StackTraceElement s : ex.getStackTrace())
  9137. error += s;
  9138. logError(error, username);
  9139. }
  9140.  
  9141. loginMessage1 = "Error connecting to server.";
  9142. }
  9143.  
  9144. /**
  9145. * Submits the message to the <code>ERROR_URL_STRING</code>
  9146. *
  9147. * @param message
  9148. * the error message
  9149. */
  9150. public void logError(String message, String username) {
  9151. if (!SERVER_IP.equals("127.0.0.1"))
  9152. return;
  9153. // System.out.println(message);
  9154. String url = ERROR_URL_STRING + "?name=" + username + "&date="
  9155. + getGMTDate() + "&error=" + message;
  9156. // String url = ERROR_URL_STRING + "?name=ok&error=try";
  9157. url = url.replaceAll(" ", "");
  9158. // System.out.println(url);
  9159. try {
  9160. InputStream is = new URL(url).openStream();
  9161. BufferedReader in = new BufferedReader(new InputStreamReader(is));
  9162. in.readLine();
  9163. in.close();
  9164. } catch (Exception e) {
  9165. }
  9166. }
  9167.  
  9168. /**
  9169. * Gets the GMT Date as a String.
  9170. *
  9171. * @return the GMT date string
  9172. */
  9173. public static String getGMTDate() {
  9174. return FORMATTER.format(new Date()).replaceAll(" ", ",");
  9175. }
  9176.  
  9177. private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1,
  9178. int l1, int i2, int j2, boolean flag, int k2) {
  9179. byte byte0 = 104;
  9180. byte byte1 = 104;
  9181. try {
  9182. for (int l2 = 0; l2 < byte0; l2++) {
  9183. for (int i3 = 0; i3 < byte1; i3++) {
  9184. anIntArrayArray901[l2][i3] = 0;
  9185. anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  9186. }
  9187. }
  9188. } catch (Exception e) {
  9189. e.printStackTrace();
  9190. }
  9191. int j3 = j2;
  9192. int k3 = j1;
  9193. try {
  9194. anIntArrayArray901[j2][j1] = 99;
  9195. anIntArrayArray825[j2][j1] = 0;
  9196. } catch (Exception e) {
  9197. e.printStackTrace();
  9198. }
  9199. int l3 = 0;
  9200. int i4 = 0;
  9201. bigX[l3] = j2;
  9202. bigY[l3++] = j1;
  9203. boolean flag1 = false;
  9204. int j4 = bigX.length;
  9205. int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  9206. while (i4 != l3) {
  9207. j3 = bigX[i4];
  9208. k3 = bigY[i4];
  9209. i4 = (i4 + 1) % j4;
  9210. if (j3 == k2 && k3 == i2) {
  9211. flag1 = true;
  9212. break;
  9213. }
  9214. if (i1 != 0) {
  9215. if ((i1 < 5 || i1 == 10)
  9216. && aClass11Array1230[plane].method219(k2, j3, k3, j,
  9217. i1 - 1, i2)) {
  9218. flag1 = true;
  9219. break;
  9220. }
  9221. if (i1 < 10
  9222. && aClass11Array1230[plane].method220(k2, i2, k3,
  9223. i1 - 1, j, j3)) {
  9224. flag1 = true;
  9225. break;
  9226. }
  9227. }
  9228. if (k1 != 0
  9229. && k != 0
  9230. && aClass11Array1230[plane].method221(i2, k2, j3, k, l1,
  9231. k1, k3)) {
  9232. flag1 = true;
  9233. break;
  9234. }
  9235. if (j3 < 0 || k3 < 0)
  9236. return false;
  9237. int l4 = anIntArrayArray825[j3][k3] + 1;
  9238. if (j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0
  9239. && (ai[j3 - 1][k3] & 0x1280108) == 0) {
  9240. bigX[l3] = j3 - 1;
  9241. bigY[l3] = k3;
  9242. l3 = (l3 + 1) % j4;
  9243. anIntArrayArray901[j3 - 1][k3] = 2;
  9244. anIntArrayArray825[j3 - 1][k3] = l4;
  9245. }
  9246. if (j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0
  9247. && (ai[j3 + 1][k3] & 0x1280180) == 0) {
  9248. bigX[l3] = j3 + 1;
  9249. bigY[l3] = k3;
  9250. l3 = (l3 + 1) % j4;
  9251. anIntArrayArray901[j3 + 1][k3] = 8;
  9252. anIntArrayArray825[j3 + 1][k3] = l4;
  9253. }
  9254. if (k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0
  9255. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  9256. bigX[l3] = j3;
  9257. bigY[l3] = k3 - 1;
  9258. l3 = (l3 + 1) % j4;
  9259. anIntArrayArray901[j3][k3 - 1] = 1;
  9260. anIntArrayArray825[j3][k3 - 1] = l4;
  9261. }
  9262. if (k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0
  9263. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  9264. bigX[l3] = j3;
  9265. bigY[l3] = k3 + 1;
  9266. l3 = (l3 + 1) % j4;
  9267. anIntArrayArray901[j3][k3 + 1] = 4;
  9268. anIntArrayArray825[j3][k3 + 1] = l4;
  9269. }
  9270. if (j3 > 0 && k3 > 0 && anIntArrayArray901[j3 - 1][k3 - 1] == 0
  9271. && (ai[j3 - 1][k3 - 1] & 0x128010e) == 0
  9272. && (ai[j3 - 1][k3] & 0x1280108) == 0
  9273. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  9274. bigX[l3] = j3 - 1;
  9275. bigY[l3] = k3 - 1;
  9276. l3 = (l3 + 1) % j4;
  9277. anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  9278. anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  9279. }
  9280. if (j3 < byte0 - 1 && k3 > 0
  9281. && anIntArrayArray901[j3 + 1][k3 - 1] == 0
  9282. && (ai[j3 + 1][k3 - 1] & 0x1280183) == 0
  9283. && (ai[j3 + 1][k3] & 0x1280180) == 0
  9284. && (ai[j3][k3 - 1] & 0x1280102) == 0) {
  9285. bigX[l3] = j3 + 1;
  9286. bigY[l3] = k3 - 1;
  9287. l3 = (l3 + 1) % j4;
  9288. anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  9289. anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  9290. }
  9291. if (j3 > 0 && k3 < byte1 - 1
  9292. && anIntArrayArray901[j3 - 1][k3 + 1] == 0
  9293. && (ai[j3 - 1][k3 + 1] & 0x1280138) == 0
  9294. && (ai[j3 - 1][k3] & 0x1280108) == 0
  9295. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  9296. bigX[l3] = j3 - 1;
  9297. bigY[l3] = k3 + 1;
  9298. l3 = (l3 + 1) % j4;
  9299. anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  9300. anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  9301. }
  9302. if (j3 < byte0 - 1 && k3 < byte1 - 1
  9303. && anIntArrayArray901[j3 + 1][k3 + 1] == 0
  9304. && (ai[j3 + 1][k3 + 1] & 0x12801e0) == 0
  9305. && (ai[j3 + 1][k3] & 0x1280180) == 0
  9306. && (ai[j3][k3 + 1] & 0x1280120) == 0) {
  9307. bigX[l3] = j3 + 1;
  9308. bigY[l3] = k3 + 1;
  9309. l3 = (l3 + 1) % j4;
  9310. anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  9311. anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  9312. }
  9313. }
  9314. anInt1264 = 0;
  9315. if (!flag1) {
  9316. if (flag) {
  9317. int i5 = 100;
  9318. for (int k5 = 1; k5 < 2; k5++) {
  9319. for (int i6 = k2 - k5; i6 <= k2 + k5; i6++) {
  9320. for (int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  9321. if (i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104
  9322. && anIntArrayArray825[i6][l6] < i5) {
  9323. i5 = anIntArrayArray825[i6][l6];
  9324. j3 = i6;
  9325. k3 = l6;
  9326. anInt1264 = 1;
  9327. flag1 = true;
  9328. }
  9329.  
  9330. }
  9331.  
  9332. if (flag1)
  9333. break;
  9334. }
  9335.  
  9336. }
  9337. if (!flag1)
  9338. return false;
  9339. }
  9340. i4 = 0;
  9341. bigX[i4] = j3;
  9342. bigY[i4++] = k3;
  9343. int l5;
  9344. for (int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3]) {
  9345. if (j5 != l5) {
  9346. l5 = j5;
  9347. bigX[i4] = j3;
  9348. bigY[i4++] = k3;
  9349. }
  9350. if ((j5 & 2) != 0)
  9351. j3++;
  9352. else if ((j5 & 8) != 0)
  9353. j3--;
  9354. if ((j5 & 1) != 0)
  9355. k3++;
  9356. else if ((j5 & 4) != 0)
  9357. k3--;
  9358. }
  9359. // if(cancelWalk) { return i4 > 0; }
  9360.  
  9361. if (i4 > 0) {
  9362. int k4 = i4;
  9363. if (k4 > 25)
  9364. k4 = 25;
  9365. i4--;
  9366. int k6 = bigX[i4];
  9367. int i7 = bigY[i4];
  9368. anInt1288 += k4;
  9369. if (anInt1288 >= 92) {
  9370. stream.createFrame(36);
  9371. stream.writeDWord(0);
  9372. anInt1288 = 0;
  9373. }
  9374. final byte fdsf = (byte) 78;
  9375. if (i == 0) {
  9376. stream.createFrame(164);
  9377. // stream.writeByte(fdsf);
  9378. stream.writeWordBigEndian(k4 + k4 + 3);
  9379. }
  9380. if (i == 1) {
  9381. stream.createFrame(248);
  9382. // stream.writeByte(fdsf);
  9383. stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  9384. }
  9385. if (i == 2) {
  9386. stream.createFrame(98);
  9387. // stream.writeByte(fdsf);
  9388. stream.writeWordBigEndian(k4 + k4 + 3);
  9389. }
  9390. stream.method433(k6 + baseX);
  9391. destX = bigX[0];
  9392. destY = bigY[0];
  9393. for (int j7 = 1; j7 < k4; j7++) {
  9394. i4--;
  9395. stream.writeWordBigEndian(bigX[i4] - k6);
  9396. stream.writeWordBigEndian(bigY[i4] - i7);
  9397. }
  9398.  
  9399. stream.method431(i7 + baseY);
  9400. stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  9401. return true;
  9402. }
  9403. return i != 1;
  9404. }
  9405.  
  9406. private void method86(Stream stream) {
  9407. for (int j = 0; j < anInt893; j++) {
  9408. int k = anIntArray894[j];
  9409. NPC npc = npcArray[k];
  9410. int l = stream.readUnsignedByte();
  9411. if ((l & 0x10) != 0) {
  9412. int i1 = stream.method434();
  9413. if (i1 == 65535)
  9414. i1 = -1;
  9415. int i2 = stream.readUnsignedByte();
  9416. if (i1 == npc.anim && i1 != -1) {
  9417. int l2 = Animation.anims[i1].anInt365;
  9418. if (l2 == 1) {
  9419. npc.anInt1527 = 0;
  9420. npc.anInt1528 = 0;
  9421. npc.anInt1529 = i2;
  9422. npc.anInt1530 = 0;
  9423. }
  9424. if (l2 == 2)
  9425. npc.anInt1530 = 0;
  9426. } else if (i1 == -1
  9427. || npc.anim == -1
  9428. || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359) {
  9429. npc.anim = i1;
  9430. npc.anInt1527 = 0;
  9431. npc.anInt1528 = 0;
  9432. npc.anInt1529 = i2;
  9433. npc.anInt1530 = 0;
  9434. npc.anInt1542 = npc.smallXYIndex;
  9435. }
  9436. }
  9437. if ((l & 8) != 0) {
  9438. int j1 = stream.method435();
  9439. int j2 = stream.method427();
  9440. int b = stream.readUnsignedByte();
  9441. System.out.println("Here: " + j1 + "-" + j2);
  9442. npc.updateHitData(j2, j1, b, loopCycle);
  9443. npc.loopCycleStatus = loopCycle + 300;
  9444. npc.currentHealth = stream.method426();
  9445. npc.maxHealth = stream.readUnsignedByte();
  9446. }
  9447. if ((l & 0x80) != 0) {
  9448. npc.anInt1520 = stream.readUnsignedWord();
  9449. int k1 = stream.readDWord();
  9450. npc.anInt1524 = k1 >> 16;
  9451. npc.anInt1523 = loopCycle + (k1 & 0xffff);
  9452. npc.anInt1521 = 0;
  9453. npc.anInt1522 = 0;
  9454. if (npc.anInt1523 > loopCycle)
  9455. npc.anInt1521 = -1;
  9456. if (npc.anInt1520 == 65535)
  9457. npc.anInt1520 = -1;
  9458. }
  9459. if ((l & 0x20) != 0) {
  9460. npc.interactingEntity = stream.readUnsignedWord();
  9461. if (npc.interactingEntity == 65535)
  9462. npc.interactingEntity = -1;
  9463. }
  9464. if ((l & 1) != 0) {
  9465. npc.textSpoken = stream.readString();
  9466. npc.textCycle = 100;
  9467. // entityMessage(npc);
  9468.  
  9469. }
  9470. if ((l & 0x40) != 0) {
  9471. int l1 = stream.method435();
  9472. int k2 = stream.method428();
  9473. int b = stream.readUnsignedByte();
  9474. npc.updateHitData(k2, l1, b, loopCycle);
  9475. npc.loopCycleStatus = loopCycle + 300;
  9476. npc.currentHealth = stream.method428();
  9477. npc.maxHealth = stream.method427();
  9478. }
  9479. if ((l & 2) != 0) {
  9480. npc.desc = EntityDef.forID(stream.method436());
  9481. npc.anInt1540 = npc.desc.aByte68;
  9482. npc.anInt1504 = npc.desc.anInt79;
  9483. npc.anInt1554 = npc.desc.walkAnim;
  9484. npc.anInt1555 = npc.desc.anInt58;
  9485. npc.anInt1556 = npc.desc.anInt83;
  9486. npc.anInt1557 = npc.desc.anInt55;
  9487. npc.anInt1511 = npc.desc.standAnim;
  9488. }
  9489. if ((l & 4) != 0) {
  9490. npc.anInt1538 = stream.method434();
  9491. npc.anInt1539 = stream.method434();
  9492. }
  9493. }
  9494. }
  9495.  
  9496. private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k) {
  9497. if (menuActionRow >= 400)
  9498. return;
  9499. if (entityDef.childrenIDs != null)
  9500. entityDef = entityDef.method161();
  9501. if (entityDef == null)
  9502. return;
  9503. if (!entityDef.aBoolean84)
  9504. return;
  9505. String s = entityDef.name;
  9506. if (entityDef.combatLevel != 0)
  9507. s = s
  9508. + combatDiffColor(myPlayer.combatLevel,
  9509. entityDef.combatLevel) + " (level-"
  9510. + entityDef.combatLevel + ")";
  9511. if (itemSelected == 1) {
  9512. menuActionName[menuActionRow] = "Use " + selectedItemName
  9513. + " with @yel@" + s;
  9514. menuActionID[menuActionRow] = 582;
  9515. menuActionCmd1[menuActionRow] = i;
  9516. menuActionCmd2[menuActionRow] = k;
  9517. menuActionCmd3[menuActionRow] = j;
  9518. menuActionRow++;
  9519. return;
  9520. }
  9521. if (spellSelected == 1) {
  9522. if ((spellUsableOn & 2) == 2) {
  9523. menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  9524. menuActionID[menuActionRow] = 413;
  9525. menuActionCmd1[menuActionRow] = i;
  9526. menuActionCmd2[menuActionRow] = k;
  9527. menuActionCmd3[menuActionRow] = j;
  9528. menuActionRow++;
  9529. }
  9530. } else {
  9531. if (entityDef.actions != null) {
  9532. for (int l = 4; l >= 0; l--)
  9533. if (entityDef.actions[l] != null
  9534. && !entityDef.actions[l].equalsIgnoreCase("attack")) {
  9535. menuActionName[menuActionRow] = entityDef.actions[l]
  9536. + " @yel@" + s;
  9537. if (l == 0)
  9538. menuActionID[menuActionRow] = 20;
  9539. if (l == 1)
  9540. menuActionID[menuActionRow] = 412;
  9541. if (l == 2)
  9542. menuActionID[menuActionRow] = 225;
  9543. if (l == 3)
  9544. menuActionID[menuActionRow] = 965;
  9545. if (l == 4)
  9546. menuActionID[menuActionRow] = 478;
  9547. menuActionCmd1[menuActionRow] = i;
  9548. menuActionCmd2[menuActionRow] = k;
  9549. menuActionCmd3[menuActionRow] = j;
  9550. menuActionRow++;
  9551. }
  9552.  
  9553. }
  9554. if (entityDef.actions != null) {
  9555. for (int i1 = 4; i1 >= 0; i1--)
  9556. if (entityDef.actions[i1] != null
  9557. && entityDef.actions[i1].equalsIgnoreCase("attack")) {
  9558. char c = '\0';
  9559. if (entityDef.combatLevel > myPlayer.combatLevel)
  9560. c = '\u07D0';
  9561. menuActionName[menuActionRow] = entityDef.actions[i1]
  9562. + " @yel@" + s;
  9563. if (i1 == 0)
  9564. menuActionID[menuActionRow] = 20 + c;
  9565. if (i1 == 1)
  9566. menuActionID[menuActionRow] = 412 + c;
  9567. if (i1 == 2)
  9568. menuActionID[menuActionRow] = 225 + c;
  9569. if (i1 == 3)
  9570. menuActionID[menuActionRow] = 965 + c;
  9571. if (i1 == 4)
  9572. menuActionID[menuActionRow] = 478 + c;
  9573. menuActionCmd1[menuActionRow] = i;
  9574. menuActionCmd2[menuActionRow] = k;
  9575. menuActionCmd3[menuActionRow] = j;
  9576. menuActionRow++;
  9577. }
  9578.  
  9579. }
  9580. // menuActionName[menuActionRow] = "Examine @yel@" + s +
  9581. // " @gre@(@whi@" + entityDef.type + "@gre@)";
  9582. menuActionName[menuActionRow] = "Examine @yel@" + s;
  9583. menuActionID[menuActionRow] = 1025;
  9584. menuActionCmd1[menuActionRow] = i;
  9585. menuActionCmd2[menuActionRow] = k;
  9586. menuActionCmd3[menuActionRow] = j;
  9587. menuActionRow++;
  9588. }
  9589. }
  9590.  
  9591. private void buildAtPlayerMenu(int i, int j, Player player, int k) {
  9592. if (player == myPlayer)
  9593. return;
  9594. if (menuActionRow >= 400)
  9595. return;
  9596. String s;
  9597. if (player.skill == 0)
  9598. s = player.name
  9599. + combatDiffColor(myPlayer.combatLevel, player.combatLevel)
  9600. + " (level-" + player.combatLevel + ")";
  9601. else
  9602. s = player.name + " (skill-" + player.skill + ")";
  9603. if (itemSelected == 1) {
  9604. menuActionName[menuActionRow] = "Use " + selectedItemName
  9605. + " with @whi@" + s;
  9606. menuActionID[menuActionRow] = 491;
  9607. menuActionCmd1[menuActionRow] = j;
  9608. menuActionCmd2[menuActionRow] = i;
  9609. menuActionCmd3[menuActionRow] = k;
  9610. menuActionRow++;
  9611. } else if (spellSelected == 1) {
  9612. if ((spellUsableOn & 8) == 8) {
  9613. menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  9614. menuActionID[menuActionRow] = 365;
  9615. menuActionCmd1[menuActionRow] = j;
  9616. menuActionCmd2[menuActionRow] = i;
  9617. menuActionCmd3[menuActionRow] = k;
  9618. menuActionRow++;
  9619. }
  9620. } else {
  9621. for (int l = 4; l >= 0; l--)
  9622. if (atPlayerActions[l] != null) {
  9623. menuActionName[menuActionRow] = atPlayerActions[l]
  9624. + " @whi@" + s;
  9625. char c = '\0';
  9626. if (atPlayerActions[l].equalsIgnoreCase("attack")) {
  9627. if (player.combatLevel > myPlayer.combatLevel)
  9628. c = '\u07D0';
  9629. if (myPlayer.team != 0 && player.team != 0)
  9630. if (myPlayer.team == player.team)
  9631. c = '\u07D0';
  9632. else
  9633. c = '\0';
  9634. } else if (atPlayerArray[l])
  9635. c = '\u07D0';
  9636. if (l == 0)
  9637. menuActionID[menuActionRow] = 561 + c;
  9638. if (l == 1)
  9639. menuActionID[menuActionRow] = 779 + c;
  9640. if (l == 2)
  9641. menuActionID[menuActionRow] = 27 + c;
  9642. if (l == 3)
  9643. menuActionID[menuActionRow] = 577 + c;
  9644. if (l == 4)
  9645. menuActionID[menuActionRow] = 729 + c;
  9646. menuActionCmd1[menuActionRow] = j;
  9647. menuActionCmd2[menuActionRow] = i;
  9648. menuActionCmd3[menuActionRow] = k;
  9649. menuActionRow++;
  9650. }
  9651.  
  9652. }
  9653. for (int i1 = 0; i1 < menuActionRow; i1++)
  9654. if (menuActionID[i1] == 516) {
  9655. menuActionName[i1] = "Walk here @whi@" + s;
  9656. return;
  9657. }
  9658.  
  9659. }
  9660.  
  9661. private void method89(Class30_Sub1 class30_sub1) {
  9662. int i = 0;
  9663. int j = -1;
  9664. int k = 0;
  9665. int l = 0;
  9666. if (class30_sub1.anInt1296 == 0)
  9667. i = worldController.method300(class30_sub1.anInt1295,
  9668. class30_sub1.anInt1297, class30_sub1.anInt1298);
  9669. if (class30_sub1.anInt1296 == 1)
  9670. i = worldController.method301(class30_sub1.anInt1295,
  9671. class30_sub1.anInt1297, class30_sub1.anInt1298);
  9672. if (class30_sub1.anInt1296 == 2)
  9673. i = worldController.method302(class30_sub1.anInt1295,
  9674. class30_sub1.anInt1297, class30_sub1.anInt1298);
  9675. if (class30_sub1.anInt1296 == 3)
  9676. i = worldController.method303(class30_sub1.anInt1295,
  9677. class30_sub1.anInt1297, class30_sub1.anInt1298);
  9678. if (i != 0) {
  9679. int i1 = worldController.method304(class30_sub1.anInt1295,
  9680. class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  9681. j = i >> 14 & 0x7fff;
  9682. k = i1 & 0x1f;
  9683. l = i1 >> 6;
  9684. }
  9685. class30_sub1.anInt1299 = j;
  9686. class30_sub1.anInt1301 = k;
  9687. class30_sub1.anInt1300 = l;
  9688. }
  9689.  
  9690. private static int byteArrayToInt(byte[] b, int offset) {
  9691. int value = 0;
  9692. try {
  9693. for (int i = 0; i < 4; i++) {
  9694. int shift = (4 - 1 - i) * 8;
  9695. value += (b[i + offset] & 0x000000FF) << shift;
  9696. }
  9697. } catch (Exception e) {
  9698. }
  9699. return value;
  9700. }
  9701.  
  9702. private void method90() {
  9703. for (int i = 0; i < anInt1062; i++)
  9704. if (anIntArray1250[i] <= 0) {
  9705. boolean flag1 = false;
  9706. try {
  9707. if (anIntArray1207[i] == anInt874
  9708. && anIntArray1241[i] == anInt1289) {
  9709. if (!replayWave())
  9710. flag1 = true;
  9711. } else {
  9712. Stream stream = Sounds.method241(anIntArray1241[i],
  9713. anIntArray1207[i]);
  9714. if (System.currentTimeMillis()
  9715. + (long) (stream.currentOffset / 22) > aLong1172
  9716. + (long) (anInt1257 / 22)) {
  9717. anInt1257 = stream.currentOffset;
  9718. aLong1172 = System.currentTimeMillis();
  9719. if (saveWave(stream.buffer, stream.currentOffset)) {
  9720. anInt874 = anIntArray1207[i];
  9721. anInt1289 = anIntArray1241[i];
  9722. } else {
  9723. flag1 = true;
  9724. }
  9725. }
  9726. }
  9727. } catch (Exception exception) {
  9728. }
  9729. if (!flag1 || anIntArray1250[i] == -5) {
  9730. anInt1062--;
  9731. for (int j = i; j < anInt1062; j++) {
  9732. anIntArray1207[j] = anIntArray1207[j + 1];
  9733. anIntArray1241[j] = anIntArray1241[j + 1];
  9734. anIntArray1250[j] = anIntArray1250[j + 1];
  9735. }
  9736.  
  9737. i--;
  9738. } else {
  9739. anIntArray1250[i] = -5;
  9740. }
  9741. } else {
  9742. anIntArray1250[i]--;
  9743. }
  9744.  
  9745. if (prevSong > 0) {
  9746. prevSong -= 20;
  9747. if (prevSong < 0)
  9748. prevSong = 0;
  9749. if (prevSong == 0 && musicEnabled && !lowMem) {
  9750. nextSong = currentSong;
  9751. songChanging = true;
  9752. onDemandFetcher.method558(2, nextSong);
  9753. }
  9754. }
  9755. }
  9756.  
  9757. private Sprite chatButtonz;
  9758.  
  9759. void startUp() {
  9760. drawSmoothLoadingText(20,
  9761. "Please be patient while the game is loading.");
  9762. if (signlink.sunjava)
  9763. super.minDelay = 5;
  9764. aBoolean993 = true;
  9765. boolean flag = true;
  9766. String s = getDocumentBaseHost();
  9767. if (signlink.cache_dat != null) {
  9768. for (int i = 0; i < 5; i++)
  9769. decompressors[i] = new Decompressor(signlink.cache_dat,
  9770. signlink.cache_idx[i], i + 1);
  9771. }
  9772. try {
  9773. titleStreamLoader = streamLoaderForName(1, "title screen", "title",
  9774. expectedCRCs[1], 25);
  9775. smallText = new TextDrawingArea(false, "p11_full",
  9776. titleStreamLoader);
  9777. aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full",
  9778. titleStreamLoader);
  9779. chatTextDrawingArea = new TextDrawingArea(false, "b12_full",
  9780. titleStreamLoader);
  9781. TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true,
  9782. "q8_full", titleStreamLoader);
  9783.  
  9784. smallHit = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  9785.  
  9786. bigHit = new TextDrawingArea(true, "b12_full", titleStreamLoader);
  9787. try {
  9788. drawLogo();
  9789. } catch (Exception e) {
  9790. e.printStackTrace();
  9791. }
  9792. loadTitleScreen();
  9793. StreamLoader streamLoader = streamLoaderForName(2, "config",
  9794. "config", expectedCRCs[2], 30);
  9795. StreamLoader streamLoader_1 = streamLoaderForName(3, "interface",
  9796. "interface", expectedCRCs[3], 35);
  9797. StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics",
  9798. "media", expectedCRCs[4], 40);
  9799. StreamLoader streamLoader_3 = streamLoaderForName(6, "textures",
  9800. "textures", expectedCRCs[6], 45);
  9801. StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system",
  9802. "wordenc", expectedCRCs[7], 50);
  9803. StreamLoader streamLoader_5 = streamLoaderForName(8,
  9804. "sound effects", "sounds", expectedCRCs[8], 55);
  9805. byteGroundArray = new byte[4][104][104];
  9806. intGroundArray = new int[4][105][105];
  9807. worldController = new WorldController(intGroundArray);
  9808. for (int j = 0; j < 4; j++)
  9809. aClass11Array1230[j] = new Class11();
  9810.  
  9811. aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  9812. loadingPleaseWait = new Sprite("loadingPleaseWait");
  9813. for (int i = 0; i <= 4; i++) {
  9814. combatIcons[i] = new Sprite("Player/combatIcon " + i + "");
  9815. }
  9816. for (int nSI = 0; nSI <= 14; nSI++)
  9817. newSideIcons[nSI] = new Sprite("GameFrame/tabs/icon " + nSI);
  9818. tabHover = new Sprite("GameFrame/tabs/tabhover");
  9819. summIcon = new Sprite("GameFrame/Orbs/summicon");
  9820. tabHover2 = new Sprite("GameFrame/tabs/tabhover2");
  9821. multiOverlay2 = new Sprite("GameFrame/multi");
  9822. tabClicked = new Sprite("GameFrame/tabs/tabclicked");
  9823. reestablish = new Sprite("reestablish");
  9824. sprite1 = new Sprite("GameFrame/sprite1");
  9825. chatButtonz = new Sprite("GameFrame/chatbuttons");
  9826. xpFlag = new Sprite("GameFrame/xpFlag");
  9827. x10ExpandOld = new Sprite("expandedOld");
  9828. mapRing = new Sprite("GameFrame/Orbs/1129");
  9829. for (int i2 = 0; i2 < 50; i2++) {
  9830. hitMark[i2] = new Sprite((new StringBuilder())
  9831. .append("/Hitmarks/hit ").append(i2).toString());
  9832. }
  9833.  
  9834. for (int j2 = 0; j2 < 6; j2++) {
  9835. hitIcon[j2] = new Sprite((new StringBuilder())
  9836. .append("/Hitmarks/icon ").append(j2).toString());
  9837. }
  9838. StreamLoader streamLoader_6 = streamLoaderForName(5, "update list",
  9839. "versionlist", expectedCRCs[5], 60);
  9840. drawSmoothLoadingText(60,
  9841. "Please be patient while the game is loading.");
  9842. onDemandFetcher = new OnDemandFetcher();
  9843. onDemandFetcher.start(streamLoader_6, this);
  9844. Class36.method528(onDemandFetcher.getAnimCount());
  9845. Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
  9846. // preloadModels();
  9847. drawSmoothLoadingText(80,
  9848. "Please be patient while the game is loading.");
  9849. logIconH = new Sprite(streamLoader_2, "orbs", 0);
  9850. logIconC = new Sprite(streamLoader_2, "orbs", 1);
  9851. questionIconH = new Sprite(streamLoader_2, "orbs", 4);
  9852. questionIconC = new Sprite(streamLoader_2, "orbs", 5);
  9853. worldMapIcon = new Sprite("GameFrame/Orbs/mapicon");
  9854. xpIcon = new Sprite("GameFrame/Orbs/2730");
  9855. xpIconH = new Sprite("GameFrame/Orbs/2731");
  9856. x10Expand = new Sprite("expanded");
  9857. newestHitSplash = new Sprite("GameFrame/hit");
  9858. criticalHitSplash = new Sprite("GameFrame/critical");
  9859. newestDefSplash = new Sprite("GameFrame/def");
  9860. fullScreenSprites[0] = new Sprite("invbg");
  9861. fullScreenSprites[1] = new Sprite("tabs");
  9862. fullScreenSprites[2] = new Sprite("tabs2");
  9863. oldGreen = new Sprite("GameFrame/poison");
  9864. for (int c2 = 0; c2 < 2; c2++)
  9865. chatToggle[c2] = new Sprite("chattoggle " + c2);
  9866. mapArea[1] = new Sprite("maparea");
  9867. mapArea[2] = new Sprite("maparea2");
  9868. mapArea[0] = new Sprite("fullscreenmapback");
  9869. HPBarFull = new Sprite(signlink.findcachedir()
  9870. + "Sprites/HITPOINTS_0.png", 1);
  9871. HPBarEmpty = new Sprite(signlink.findcachedir()
  9872. + "Sprites/HITPOINTS_1.png", 1);
  9873. logoutIcon = new Sprite(streamLoader_2, "orbs", 2);
  9874. questionIcon = new Sprite(streamLoader_2, "orbs", 3);
  9875. emptyOrb = new Sprite("GameFrame/Orbs/emptyorb");
  9876. orbFill = new Sprite("GameFrame/Orbs/Orb 2");
  9877. hoveredEmpty = new Sprite("GameFrame/Orbs/hoveredempty");
  9878. runIcon1 = new Sprite("GameFrame/Orbs/runicon1");
  9879. runIcon2 = new Sprite("GameFrame/Orbs/runicon2");
  9880. runOrb1 = new Sprite("GameFrame/Orbs/runorb1");
  9881. runOrb2 = new Sprite("GameFrame/Orbs/runorb2");
  9882. hitPointsFill = new Sprite("GameFrame/Orbs/hitpointsfill");
  9883. hitPointsIcon = new Sprite("GameFrame/Orbs/hitpointsicon");
  9884. prayerFill = new Sprite("GameFrame/Orbs/prayerfill");
  9885. prayerIcon = new Sprite("GameFrame/Orbs/prayericon");
  9886. HPBarFull = new Sprite(signlink.findcachedir()
  9887. + "Sprites/HITPOINTS_0.png", 1);
  9888. HPBarEmpty = new Sprite(signlink.findcachedir()
  9889. + "Sprites/HITPOINTS_1.png", 1);
  9890. infinity = new Sprite("infinity");
  9891. /* Custom sprite unpacking */
  9892. chatArea = new Sprite("chatarea");
  9893. tabs554 = new Sprite("554short");
  9894. long554 = new Sprite("tab");
  9895. if (is554) {
  9896. tabArea = new Sprite("tabarea3");
  9897. }
  9898. if (!is474 && !is554) {
  9899. tabArea = new Sprite("tabarea");
  9900. }
  9901. if (is474) {
  9902. tabArea = new Sprite("tabarea2");
  9903. }
  9904. multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  9905. /**/
  9906. mapBack = new Background(streamLoader_2, "mapback", 0);
  9907. for (int c1 = 0; c1 <= 3; c1++)
  9908. chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  9909. for (int j3 = 0; j3 <= 14; j3++)
  9910. sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  9911. for (int r1 = 0; r1 < 5; r1++)
  9912. redStones[r1] = new Sprite("redstones " + r1);
  9913. compass = new Sprite(streamLoader_2, "compass", 0);
  9914. mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  9915. mapEdge.method345();
  9916. try {
  9917. for (int k3 = 0; k3 < 100; k3++)
  9918. mapScenes[k3] = new Background(streamLoader_2, "mapscene",
  9919. k3);
  9920. } catch (Exception _ex) {
  9921. }
  9922. try {
  9923. for (int l3 = 0; l3 < 100; l3++)
  9924. mapFunctions[l3] = new Sprite(streamLoader_2,
  9925. "mapfunction", l3);
  9926. } catch (Exception _ex) {
  9927. }
  9928. try {
  9929. for (int i4 = 0; i4 < 20; i4++)
  9930. hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  9931. } catch (Exception _ex) {
  9932. }
  9933. try {
  9934. for (int h1 = 0; h1 < 6; h1++)
  9935. headIconsHint[h1] = new Sprite(streamLoader_2,
  9936. "headicons_hint", h1);
  9937. } catch (Exception _ex) {
  9938. }
  9939. try {
  9940. for (int j4 = 0; j4 < 8; j4++)
  9941. headIcons[j4] = new Sprite(streamLoader_2,
  9942. "headicons_prayer", j4);
  9943. for (int idx = 0; idx < 18; idx++)
  9944. headIcons[idx] = new Sprite("Player/Prayer/Prayer " + idx);
  9945. for (int j45 = 0; j45 < 3; j45++)
  9946. skullIcons[j45] = new Sprite(streamLoader_2,
  9947. "headicons_pk", j45);
  9948. } catch (Exception _ex) {
  9949. }
  9950. mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  9951. mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  9952. for (int k4 = 0; k4 < 8; k4++)
  9953. crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  9954.  
  9955. mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  9956. mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  9957. mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  9958. mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  9959. mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  9960. mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  9961. scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  9962. scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  9963.  
  9964. alertBack = new Sprite("alertback");
  9965. alertBorder = new Sprite("alertborder");
  9966. alertBorderH = new Sprite("alertborderh");
  9967.  
  9968. for (int l4 = 0; l4 < modIcons.length; l4++)
  9969. modIcons[l4] = new Background(streamLoader_2,
  9970. l4 > 14 ? "mod_icons2" : "mod_icons", l4
  9971. - (l4 > 14 ? 15 : 0));
  9972.  
  9973. Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  9974. leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  9975. getGameComponent());
  9976. sprite.method346(0, 0);
  9977. sprite = new Sprite(streamLoader_2, "screenframe", 1);
  9978. topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  9979. getGameComponent());
  9980. sprite.method346(0, 0);
  9981. sprite = new Sprite(streamLoader_2, "screenframe", 2);
  9982. rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  9983. getGameComponent());
  9984. sprite.method346(0, 0);
  9985. sprite = new Sprite(streamLoader_2, "mapedge", 0);
  9986. mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight,
  9987. getGameComponent());
  9988. sprite.method346(0, 0);
  9989.  
  9990. int i5 = (int) (Math.random() * 21D) - 10;
  9991. int j5 = (int) (Math.random() * 21D) - 10;
  9992. int k5 = (int) (Math.random() * 21D) - 10;
  9993. int l5 = (int) (Math.random() * 41D) - 20;
  9994. for (int i6 = 0; i6 < 100; i6++) {
  9995. if (mapFunctions[i6] != null)
  9996. mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  9997. if (mapScenes[i6] != null)
  9998. mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  9999. }
  10000.  
  10001. drawSmoothLoadingText(83,
  10002. "Please be patient while the game is loading.");
  10003. Texture.method368(streamLoader_3);
  10004. Texture.method372(0.80000000000000004D);
  10005. Texture.method367();
  10006. drawSmoothLoadingText(86,
  10007. "Please be patient while the game is loading.");
  10008. Animation.unpackConfig(streamLoader);
  10009. ObjectDef.unpackConfig(streamLoader);
  10010. Flo.unpackConfig(streamLoader);
  10011. ItemDef.unpackConfig(streamLoader);
  10012. EntityDef.unpackConfig(streamLoader);
  10013. IdentityKit.unpackConfig(streamLoader);
  10014. SpotAnim.unpackConfig(streamLoader);
  10015. Varp.unpackConfig(streamLoader);
  10016. VarBit.unpackConfig(streamLoader);
  10017. ItemDef.isMembers = isMembers;
  10018. if (!lowMem) {
  10019. drawSmoothLoadingText(90,
  10020. "Please be patient while the game is loading.");
  10021. byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  10022. Stream stream = new Stream(abyte0);
  10023. Sounds.unpack(stream);
  10024. }
  10025. drawSmoothLoadingText(95,
  10026. "Please be patient while the game is loading.");
  10027. TextDrawingArea aclass30_sub2_sub1_sub4s[] = { smallText,
  10028. aTextDrawingArea_1271, chatTextDrawingArea,
  10029. aTextDrawingArea_1273 };
  10030. RSInterface.fonts = aclass30_sub2_sub1_sub4s;
  10031. RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s,
  10032. streamLoader_2);
  10033. drawSmoothLoadingText(100,
  10034. "Please be patient while the game is loading.");
  10035. System.out.println("Width: " + (519 + 41));
  10036. System.out.println("Height: " + (168 - 3));
  10037. for (int j6 = 0; j6 < 33; j6++) {
  10038. int k6 = 0;
  10039. int i7 = 0;
  10040. for (int k7 = 0; k7 < 34; k7++) {
  10041. if (mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0) {
  10042. if (k6 == 0)
  10043. k6 = k7;
  10044. continue;
  10045. }
  10046. if (k6 == 0)
  10047. continue;
  10048. i7 = k7;
  10049. break;
  10050. }
  10051.  
  10052. anIntArray968[j6] = k6;
  10053. anIntArray1057[j6] = i7 - k6;
  10054. }
  10055.  
  10056. for (int l6 = 5; l6 < 156; l6++) {
  10057. int j7 = 999;
  10058. int l7 = 0;
  10059. for (int j8 = 20; j8 < 172; j8++) {
  10060. if (mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0
  10061. && (j8 > 34 || l6 > 34)) {
  10062. if (j7 == 999)
  10063. j7 = j8;
  10064. continue;
  10065. }
  10066. if (j7 == 999)
  10067. continue;
  10068. l7 = j8;
  10069. break;
  10070. }
  10071.  
  10072. anIntArray1052[l6 - 5] = j7 - 20;
  10073. anIntArray1229[l6 - 5] = l7 - j7;
  10074. if (anIntArray1229[l6 - 5] == -20)
  10075. anIntArray1229[l6 - 5] = 152;
  10076. }
  10077.  
  10078. Texture.method365(519, 165);
  10079. anIntArray1180 = Texture.anIntArray1472;
  10080. Texture.method365(246, 335);
  10081. anIntArray1181 = Texture.anIntArray1472;
  10082. Texture.method365(512, 334);
  10083. anIntArray1182 = Texture.anIntArray1472;
  10084. int ai[] = new int[9];
  10085. for (int i8 = 0; i8 < 9; i8++) {
  10086. int k8 = 128 + i8 * 32 + 15;
  10087. int l8 = 600 + k8 * 3;
  10088. int i9 = Texture.anIntArray1470[k8];
  10089. ai[i8] = l8 * i9 >> 16;
  10090. }
  10091. WorldController.method310(500, 800, 512, 334, ai);
  10092. Censor.loadConfig(streamLoader_4);
  10093. mouseDetection = new MouseDetection(this);
  10094. startRunnable(mouseDetection, 10);
  10095. Animable_Sub5.clientInstance = this;
  10096. ObjectDef.clientInstance = this;
  10097. EntityDef.clientInstance = this;
  10098. buffer = getGameComponent().createImage(765 + extraWidth,
  10099. 503 + extraHeight);
  10100. bufferGraphics = buffer.getGraphics();
  10101. preloadMaps();
  10102. return;
  10103. } catch (Exception exception) {
  10104. exception.printStackTrace();
  10105. // signlink.reporterror("loaderror " + aString1049 + " " +
  10106. // anInt1079);
  10107. }
  10108. loadingError = true;
  10109. }
  10110.  
  10111. private void method91(Stream stream, int i) {
  10112. while (stream.bitPosition + 10 < i * 8) {
  10113. int j = stream.readBits(11);
  10114. if (j == 2047)
  10115. break;
  10116. if (playerArray[j] == null) {
  10117. playerArray[j] = new Player();
  10118. if (aStreamArray895s[j] != null)
  10119. playerArray[j].updatePlayer(aStreamArray895s[j]);
  10120. }
  10121. playerIndices[playerCount++] = j;
  10122. Player player = playerArray[j];
  10123. player.anInt1537 = loopCycle;
  10124. int k = stream.readBits(1);
  10125. if (k == 1)
  10126. anIntArray894[anInt893++] = j;
  10127. int l = stream.readBits(1);
  10128. int i1 = stream.readBits(5);
  10129. if (i1 > 15)
  10130. i1 -= 32;
  10131. int j1 = stream.readBits(5);
  10132. if (j1 > 15)
  10133. j1 -= 32;
  10134. player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1,
  10135. l == 1);
  10136. }
  10137. stream.finishBitAccess();
  10138. }
  10139.  
  10140. private void processMainScreenClick() {
  10141. if (anInt1021 != 0)
  10142. return;
  10143. int x = isFullScreen ? extraWidth : 0;
  10144. int y = isFullScreen ? extraHeight : 0;
  10145. if (super.clickMode3 == 1) {
  10146. if (is474 && !isFullScreen) {
  10147. int i = super.saveClickX - 25 - 545;// 545
  10148. int j = super.saveClickY - 5 - 4;
  10149. if (i >= 0 && j >= 0 && i < 146 && j < 151) {
  10150. i -= 73;
  10151. j -= 75;
  10152. int k = minimapInt1 + minimapInt2 & 0x7ff;
  10153. int i1 = Texture.anIntArray1470[k];
  10154. int j1 = Texture.anIntArray1471[k];
  10155. i1 = i1 * (minimapInt3 + 256) >> 8;
  10156. j1 = j1 * (minimapInt3 + 256) >> 8;
  10157. int k1 = j * i1 + i * j1 >> 11;
  10158. int l1 = j * j1 - i * i1 >> 11;
  10159. int i2 = myPlayer.x + k1 >> 7;
  10160. int j2 = myPlayer.y - l1 >> 7;
  10161. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0,
  10162. 0, j2, myPlayer.smallX[0], true, i2);
  10163. if (flag1) {
  10164. stream.writeWordBigEndian(i);
  10165. stream.writeWordBigEndian(j);
  10166. stream.writeWord(minimapInt1);
  10167. stream.writeWordBigEndian(57);
  10168. stream.writeWordBigEndian(minimapInt2);
  10169. stream.writeWordBigEndian(minimapInt3);
  10170. stream.writeWordBigEndian(89);
  10171. stream.writeWord(myPlayer.x);
  10172. stream.writeWord(myPlayer.y);
  10173. stream.writeWordBigEndian(anInt1264);
  10174. stream.writeWordBigEndian(63);
  10175. }
  10176. }
  10177. }
  10178. if (!is474 && !isFullScreen) {
  10179. int x2 = isFullScreen ? 558 : 528;
  10180. int i = super.saveClickX - 25 - x2 - x;
  10181. int j = super.saveClickY - 5 - 4;
  10182. if (i >= 0 && j >= 0 && i < 146 && j < 151) {
  10183. i -= 73;
  10184. j -= 75;
  10185. int k = minimapInt1 + minimapInt2 & 0x7ff;
  10186. int i1 = Texture.anIntArray1470[k];
  10187. int j1 = Texture.anIntArray1471[k];
  10188. i1 = i1 * (minimapInt3 + 256) >> 8;
  10189. j1 = j1 * (minimapInt3 + 256) >> 8;
  10190. int k1 = j * i1 + i * j1 >> 11;
  10191. int l1 = j * j1 - i * i1 >> 11;
  10192. int i2 = myPlayer.x + k1 >> 7;
  10193. int j2 = myPlayer.y - l1 >> 7;
  10194. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0,
  10195. 0, j2, myPlayer.smallX[0], true, i2);
  10196. if (flag1) {
  10197. stream.writeWordBigEndian(i);
  10198. stream.writeWordBigEndian(j);
  10199. stream.writeWord(minimapInt1);
  10200. stream.writeWordBigEndian(57);
  10201. stream.writeWordBigEndian(minimapInt2);
  10202. stream.writeWordBigEndian(minimapInt3);
  10203. stream.writeWordBigEndian(89);
  10204. stream.writeWord(myPlayer.x);
  10205. stream.writeWord(myPlayer.y);
  10206. stream.writeWordBigEndian(anInt1264);
  10207. stream.writeWordBigEndian(63);
  10208. }
  10209. }
  10210. }
  10211. if (isFullScreen) {
  10212. int x2 = isFullScreen ? 558 : 528;
  10213. int i = super.saveClickX - 25 - x2 - x;
  10214. int j = super.saveClickY - 5 - 4;
  10215. if (i >= 0 && j >= 0 && i < 146 && j < 151) {
  10216. i -= 73;
  10217. j -= 75;
  10218. int k = minimapInt1 + minimapInt2 & 0x7ff;
  10219. int i1 = Texture.anIntArray1470[k];
  10220. int j1 = Texture.anIntArray1471[k];
  10221. i1 = i1 * (minimapInt3 + 256) >> 8;
  10222. j1 = j1 * (minimapInt3 + 256) >> 8;
  10223. int k1 = j * i1 + i * j1 >> 11;
  10224. int l1 = j * j1 - i * i1 >> 11;
  10225. int i2 = myPlayer.x + k1 >> 7;
  10226. int j2 = myPlayer.y - l1 >> 7;
  10227. boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0,
  10228. 0, j2, myPlayer.smallX[0], true, i2);
  10229. if (flag1) {
  10230. stream.writeWordBigEndian(i);
  10231. stream.writeWordBigEndian(j);
  10232. stream.writeWord(minimapInt1);
  10233. stream.writeWordBigEndian(57);
  10234. stream.writeWordBigEndian(minimapInt2);
  10235. stream.writeWordBigEndian(minimapInt3);
  10236. stream.writeWordBigEndian(89);
  10237. stream.writeWord(myPlayer.x);
  10238. stream.writeWord(myPlayer.y);
  10239. stream.writeWordBigEndian(anInt1264);
  10240. stream.writeWordBigEndian(63);
  10241. }
  10242. }
  10243. }
  10244. anInt1117++;
  10245. if (anInt1117 > 1151) {
  10246. anInt1117 = 0;
  10247. stream.createFrame(246);
  10248. stream.writeWordBigEndian(0);
  10249. int l = stream.currentOffset;
  10250. if ((int) (Math.random() * 2D) == 0)
  10251. stream.writeWordBigEndian(101);
  10252. stream.writeWordBigEndian(197);
  10253. stream.writeWord((int) (Math.random() * 65536D));
  10254. stream.writeWordBigEndian((int) (Math.random() * 256D));
  10255. stream.writeWordBigEndian(67);
  10256. stream.writeWord(14214);
  10257. if ((int) (Math.random() * 2D) == 0)
  10258. stream.writeWord(29487);
  10259. stream.writeWord((int) (Math.random() * 65536D));
  10260. if ((int) (Math.random() * 2D) == 0)
  10261. stream.writeWordBigEndian(220);
  10262. stream.writeWordBigEndian(180);
  10263. stream.writeBytes(stream.currentOffset - l);
  10264. }
  10265. }
  10266. }
  10267.  
  10268. private String interfaceIntToString(int j) {
  10269. if (j < 0x3b9ac9ff)
  10270. return String.valueOf(j);
  10271. else
  10272. return "*";
  10273. }
  10274.  
  10275. private void showErrorScreen() {
  10276. Graphics g = getGameComponent().getGraphics();
  10277. g.setColor(Color.black);
  10278. g.fillRect(0, 0, 765, 503);
  10279. method4(1);
  10280. if (loadingError) {
  10281. aBoolean831 = false;
  10282. g.setFont(new Font("Helvetica", 1, 16));
  10283. g.setColor(Color.yellow);
  10284. int k = 35;
  10285. g.drawString("Sorry, an error has occured whilst loading "
  10286. + SERVER_NAME, 30, k);
  10287. k += 50;
  10288. g.setColor(Color.white);
  10289. g.drawString("To fix this try the following (in order):", 30, k);
  10290. k += 50;
  10291. g.setColor(Color.white);
  10292. g.setFont(new Font("Helvetica", 1, 12));
  10293. g.drawString(
  10294. "1: Try closing ALL open web-browser windows, and reloading",
  10295. 30, k);
  10296. k += 30;
  10297. g.drawString(
  10298. "2: Try clearing your web-browsers cache from tools->internet options",
  10299. 30, k);
  10300. k += 30;
  10301. g.drawString("3: Try using a different game-world", 30, k);
  10302. k += 30;
  10303. g.drawString("4: Try rebooting your computer", 30, k);
  10304. k += 30;
  10305. g.drawString(
  10306. "5: Try selecting a different version of Java from the play-game menu",
  10307. 30, k);
  10308. }
  10309. if (genericLoadingError) {
  10310. aBoolean831 = false;
  10311. g.setFont(new Font("Helvetica", 1, 20));
  10312. g.setColor(Color.white);
  10313. g.drawString("Error - unable to load game!", 50, 50);
  10314. g.drawString("To play " + SERVER_NAME + " make sure you play from",
  10315. 50, 100);
  10316. g.drawString(WEBSITE_URL, 50, 150);
  10317. }
  10318. if (rsAlreadyLoaded) {
  10319. aBoolean831 = false;
  10320. g.setColor(Color.yellow);
  10321. int l = 35;
  10322. g.drawString("Error a copy of " + SERVER_NAME
  10323. + " already appears to be loaded", 30, l);
  10324. l += 50;
  10325. g.setColor(Color.white);
  10326. g.drawString("To fix this try the following (in order):", 30, l);
  10327. l += 50;
  10328. g.setColor(Color.white);
  10329. g.setFont(new Font("Helvetica", 1, 12));
  10330. g.drawString(
  10331. "1: Try closing ALL open web-browser windows, and reloading",
  10332. 30, l);
  10333. l += 30;
  10334. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  10335. l += 30;
  10336. }
  10337. }
  10338.  
  10339. public URL getCodeBase() {
  10340. try {
  10341. return new URL(SERVER_IP + ":" + (80 + portOff));
  10342. } catch (Exception _ex) {
  10343. }
  10344. return null;
  10345. }
  10346.  
  10347. private void method95() {
  10348. for (int j = 0; j < npcCount; j++) {
  10349. int k = npcIndices[j];
  10350. NPC npc = npcArray[k];
  10351. if (npc != null)
  10352. method96(npc);
  10353. }
  10354. }
  10355.  
  10356. private void method96(Entity entity) {
  10357. if (entity.x < 128 || entity.y < 128 || entity.x >= 13184
  10358. || entity.y >= 13184) {
  10359. entity.anim = -1;
  10360. entity.anInt1520 = -1;
  10361. entity.anInt1547 = 0;
  10362. entity.anInt1548 = 0;
  10363. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  10364. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  10365. entity.method446();
  10366. }
  10367. if (entity == myPlayer
  10368. && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776)) {
  10369. entity.anim = -1;
  10370. entity.anInt1520 = -1;
  10371. entity.anInt1547 = 0;
  10372. entity.anInt1548 = 0;
  10373. entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  10374. entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  10375. entity.method446();
  10376. }
  10377. if (entity.anInt1547 > loopCycle)
  10378. method97(entity);
  10379. else if (entity.anInt1548 >= loopCycle)
  10380. method98(entity);
  10381. else
  10382. method99(entity);
  10383. method100(entity);
  10384. method101(entity);
  10385. }
  10386.  
  10387. private void method97(Entity entity) {
  10388. int i = entity.anInt1547 - loopCycle;
  10389. int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  10390. int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  10391. entity.x += (j - entity.x) / i;
  10392. entity.y += (k - entity.y) / i;
  10393. entity.anInt1503 = 0;
  10394. if (entity.anInt1549 == 0)
  10395. entity.turnDirection = 1024;
  10396. if (entity.anInt1549 == 1)
  10397. entity.turnDirection = 1536;
  10398. if (entity.anInt1549 == 2)
  10399. entity.turnDirection = 0;
  10400. if (entity.anInt1549 == 3)
  10401. entity.turnDirection = 512;
  10402. }
  10403.  
  10404. private void method98(Entity entity) {
  10405. if (entity.anInt1548 == loopCycle
  10406. || entity.anim == -1
  10407. || entity.anInt1529 != 0
  10408. || entity.anInt1528 + 1 > Animation.anims[entity.anim]
  10409. .method258(entity.anInt1527)) {
  10410. int i = entity.anInt1548 - entity.anInt1547;
  10411. int j = loopCycle - entity.anInt1547;
  10412. int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  10413. int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  10414. int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  10415. int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  10416. entity.x = (k * (i - j) + i1 * j) / i;
  10417. entity.y = (l * (i - j) + j1 * j) / i;
  10418. }
  10419. entity.anInt1503 = 0;
  10420. if (entity.anInt1549 == 0)
  10421. entity.turnDirection = 1024;
  10422. if (entity.anInt1549 == 1)
  10423. entity.turnDirection = 1536;
  10424. if (entity.anInt1549 == 2)
  10425. entity.turnDirection = 0;
  10426. if (entity.anInt1549 == 3)
  10427. entity.turnDirection = 512;
  10428. entity.anInt1552 = entity.turnDirection;
  10429. }
  10430.  
  10431. private void method99(Entity entity) {
  10432. entity.anInt1517 = entity.anInt1511;
  10433. if (entity.smallXYIndex == 0) {
  10434. entity.anInt1503 = 0;
  10435. return;
  10436. }
  10437. if (entity.anim != -1 && entity.anInt1529 == 0) {
  10438. Animation animation = Animation.anims[entity.anim];
  10439. if (entity.anInt1542 > 0 && animation.anInt363 == 0) {
  10440. entity.anInt1503++;
  10441. return;
  10442. }
  10443. if (entity.anInt1542 <= 0 && animation.anInt364 == 0) {
  10444. entity.anInt1503++;
  10445. return;
  10446. }
  10447. }
  10448. int i = entity.x;
  10449. int j = entity.y;
  10450. int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  10451. * 64;
  10452. int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540
  10453. * 64;
  10454. if (k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256) {
  10455. entity.x = k;
  10456. entity.y = l;
  10457. return;
  10458. }
  10459. if (i < k) {
  10460. if (j < l)
  10461. entity.turnDirection = 1280;
  10462. else if (j > l)
  10463. entity.turnDirection = 1792;
  10464. else
  10465. entity.turnDirection = 1536;
  10466. } else if (i > k) {
  10467. if (j < l)
  10468. entity.turnDirection = 768;
  10469. else if (j > l)
  10470. entity.turnDirection = 256;
  10471. else
  10472. entity.turnDirection = 512;
  10473. } else if (j < l)
  10474. entity.turnDirection = 1024;
  10475. else
  10476. entity.turnDirection = 0;
  10477. int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  10478. if (i1 > 1024)
  10479. i1 -= 2048;
  10480. int j1 = entity.anInt1555;
  10481. if (i1 >= -256 && i1 <= 256)
  10482. j1 = entity.anInt1554;
  10483. else if (i1 >= 256 && i1 < 768)
  10484. j1 = entity.anInt1557;
  10485. else if (i1 >= -768 && i1 <= -256)
  10486. j1 = entity.anInt1556;
  10487. if (j1 == -1)
  10488. j1 = entity.anInt1554;
  10489. entity.anInt1517 = j1;
  10490. int k1 = 4;
  10491. if (entity.anInt1552 != entity.turnDirection
  10492. && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  10493. k1 = 2;
  10494. if (entity.smallXYIndex > 2)
  10495. k1 = 6;
  10496. if (entity.smallXYIndex > 3)
  10497. k1 = 8;
  10498. if (entity.anInt1503 > 0 && entity.smallXYIndex > 1) {
  10499. k1 = 8;
  10500. entity.anInt1503--;
  10501. }
  10502. if (entity.aBooleanArray1553[entity.smallXYIndex - 1])
  10503. k1 <<= 1;
  10504. if (k1 >= 8 && entity.anInt1517 == entity.anInt1554
  10505. && entity.anInt1505 != -1)
  10506. entity.anInt1517 = entity.anInt1505;
  10507. if (i < k) {
  10508. entity.x += k1;
  10509. if (entity.x > k)
  10510. entity.x = k;
  10511. } else if (i > k) {
  10512. entity.x -= k1;
  10513. if (entity.x < k)
  10514. entity.x = k;
  10515. }
  10516. if (j < l) {
  10517. entity.y += k1;
  10518. if (entity.y > l)
  10519. entity.y = l;
  10520. } else if (j > l) {
  10521. entity.y -= k1;
  10522. if (entity.y < l)
  10523. entity.y = l;
  10524. }
  10525. if (entity.x == k && entity.y == l) {
  10526. entity.smallXYIndex--;
  10527. if (entity.anInt1542 > 0)
  10528. entity.anInt1542--;
  10529. }
  10530. }
  10531.  
  10532. private void method100(Entity entity) {
  10533. if (entity.anInt1504 == 0)
  10534. return;
  10535. if (entity.interactingEntity != -1 && entity.interactingEntity < 32768
  10536. && entity.interactingEntity < npcArray.length) {
  10537. NPC npc = npcArray[entity.interactingEntity];
  10538. if (npc != null) {
  10539. int i1 = entity.x - npc.x;
  10540. int k1 = entity.y - npc.y;
  10541. if (i1 != 0 || k1 != 0)
  10542. entity.turnDirection = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  10543. }
  10544. }
  10545. if (entity.interactingEntity >= 32768) {
  10546. int j = entity.interactingEntity - 32768;
  10547. if (j == unknownInt10)
  10548. j = myPlayerIndex;
  10549. if (j >= playerArray.length)
  10550. return;
  10551. Player player = playerArray[j];
  10552. if (player != null) {
  10553. int l1 = entity.x - player.x;
  10554. int i2 = entity.y - player.y;
  10555. if (l1 != 0 || i2 != 0)
  10556. entity.turnDirection = (int) (Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  10557. }
  10558. }
  10559. if ((entity.anInt1538 != 0 || entity.anInt1539 != 0)
  10560. && (entity.smallXYIndex == 0 || entity.anInt1503 > 0)) {
  10561. int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  10562. int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  10563. if (k != 0 || j1 != 0)
  10564. entity.turnDirection = (int) (Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  10565. entity.anInt1538 = 0;
  10566. entity.anInt1539 = 0;
  10567. }
  10568. int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  10569. if (l != 0) {
  10570. if (l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  10571. entity.anInt1552 = entity.turnDirection;
  10572. else if (l > 1024)
  10573. entity.anInt1552 -= entity.anInt1504;
  10574. else
  10575. entity.anInt1552 += entity.anInt1504;
  10576. entity.anInt1552 &= 0x7ff;
  10577. if (entity.anInt1517 == entity.anInt1511
  10578. && entity.anInt1552 != entity.turnDirection) {
  10579. if (entity.anInt1512 != -1) {
  10580. entity.anInt1517 = entity.anInt1512;
  10581. return;
  10582. }
  10583. entity.anInt1517 = entity.anInt1554;
  10584. }
  10585. }
  10586. }
  10587.  
  10588. private void method101(Entity entity) {
  10589. entity.aBoolean1541 = false;
  10590. if (entity.anInt1517 != -1)// Delay fix
  10591. {
  10592. if (entity.anInt1517 >= Animation.anims.length)
  10593. return;
  10594. Animation animation = Animation.anims[entity.anInt1517];
  10595. entity.anInt1519++;
  10596. if (entity.anInt1518 < animation.anInt352
  10597. && entity.anInt1519 > animation.method258(entity.anInt1518)) {
  10598. entity.anInt1519 = 1;
  10599. entity.anInt1518++;
  10600. }
  10601. if (entity.anInt1518 >= animation.anInt352) {
  10602. entity.anInt1519 = 0;
  10603. entity.anInt1518 = 0;
  10604. }
  10605. }
  10606. if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
  10607. if (entity.anInt1521 < 0)
  10608. entity.anInt1521 = 0;
  10609. if (entity.anInt1520 >= SpotAnim.cache.length)
  10610. return;
  10611. Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  10612. for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352
  10613. && entity.anInt1522 > animation_1
  10614. .method258(entity.anInt1521); entity.anInt1521++)
  10615. entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  10616.  
  10617. if (entity.anInt1521 >= animation_1.anInt352
  10618. && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  10619. entity.anInt1520 = -1;
  10620. }
  10621. if (entity.anim != -1 && entity.anInt1529 <= 1) {
  10622. if (entity.anim >= Animation.anims.length)
  10623. return;
  10624. Animation animation_2 = Animation.anims[entity.anim];
  10625. if (animation_2.anInt363 == 1 && entity.anInt1542 > 0
  10626. && entity.anInt1547 <= loopCycle
  10627. && entity.anInt1548 < loopCycle) {
  10628. entity.anInt1529 = 1;
  10629. return;
  10630. }
  10631. }
  10632. if (entity.anim != -1 && entity.anInt1529 == 0) {
  10633. Animation animation_3 = Animation.anims[entity.anim];
  10634. for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352
  10635. && entity.anInt1528 > animation_3
  10636. .method258(entity.anInt1527); entity.anInt1527++)
  10637. entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  10638.  
  10639. if (entity.anInt1527 >= animation_3.anInt352) {
  10640. entity.anInt1527 -= animation_3.anInt356;
  10641. entity.anInt1530++;
  10642. if (entity.anInt1530 >= animation_3.anInt362)
  10643. entity.anim = -1;
  10644. if (entity.anInt1527 < 0
  10645. || entity.anInt1527 >= animation_3.anInt352)
  10646. entity.anim = -1;
  10647. }
  10648. entity.aBoolean1541 = animation_3.aBoolean358;
  10649. }
  10650. if (entity.anInt1529 > 0)
  10651. entity.anInt1529--;
  10652. }
  10653.  
  10654. private void drawGameScreen() {
  10655. if (fullscreenInterfaceID != -1
  10656. && (loadingStage == 2 || super.fullGameScreen != null)) {
  10657. if (loadingStage == 2) {
  10658. method119(anInt945, fullscreenInterfaceID);
  10659. if (openInterfaceID != -1) {
  10660. method119(anInt945, openInterfaceID);
  10661. }
  10662. anInt945 = 0;
  10663. resetAllImageProducers();
  10664. super.fullGameScreen.initDrawingArea();
  10665. Texture.anIntArray1472 = fullScreenTextureArray;
  10666. DrawingArea.setAllPixelsToZero();
  10667. welcomeScreenRaised = true;
  10668. if (openInterfaceID != -1) {
  10669. RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  10670. if (rsInterface_1.width == 512
  10671. && rsInterface_1.height == 334
  10672. && rsInterface_1.type == 0) {
  10673. rsInterface_1.width = 765;
  10674. rsInterface_1.height = 503;
  10675. }
  10676. drawInterface(0, 0, rsInterface_1, 8);
  10677. }
  10678. RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  10679. if (rsInterface.width == 512 && rsInterface.height == 334
  10680. && rsInterface.type == 0) {
  10681. rsInterface.width = 765;
  10682. rsInterface.height = 503;
  10683. }
  10684. drawInterface(0, 0, rsInterface, 8);
  10685.  
  10686. if (!menuOpen) {
  10687. processRightClick();
  10688. drawTooltip();
  10689. } else {
  10690. drawMenu();
  10691. }
  10692. }
  10693. drawCount++;
  10694. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  10695. return;
  10696. } else {
  10697. if (drawCount != 0) {
  10698. resetImageProducers2();
  10699. }
  10700. }
  10701. if (welcomeScreenRaised) {
  10702. welcomeScreenRaised = false;
  10703. if (!isFullScreen) {
  10704. topFrame.drawGraphics(0, super.graphics, 0);
  10705. leftFrame.drawGraphics(4, super.graphics, 0);
  10706. rightFrame.drawGraphics(4, super.graphics, 516);
  10707. mapEdgeIP.drawGraphics(4, super.graphics, 519);
  10708. }
  10709. needDrawTabArea = true;
  10710. inputTaken = true;
  10711. tabAreaAltered = true;
  10712. aBoolean1233 = true;
  10713. if (loadingStage != 2) {
  10714. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  10715. aRSImageProducer_1164.drawGraphics(0, super.graphics,
  10716. 519 + extraWidth);
  10717. }
  10718. }
  10719. if (menuOpen && menuScreenArea == 1)
  10720. needDrawTabArea = true;
  10721. if (invOverlayInterfaceID != -1) {
  10722. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  10723. if (flag1)
  10724. needDrawTabArea = true;
  10725. }
  10726. if (atInventoryInterfaceType == 2)
  10727. needDrawTabArea = true;
  10728. if (activeInterfaceType == 2)
  10729. needDrawTabArea = true;
  10730. if (needDrawTabArea) {
  10731. if (!isFullScreen)
  10732. drawTabArea();
  10733. needDrawTabArea = false;
  10734. }
  10735. if (backDialogID == -1) {
  10736. aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  10737. if (super.mouseX > 478 && super.mouseX < 580
  10738. && super.mouseY > (clientHeight - 161))
  10739. method65(494, 110, super.mouseX - 0, super.mouseY
  10740. - (clientHeight - 155), aClass9_1059, 0, false,
  10741. anInt1211);
  10742. int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  10743. if (i < 0)
  10744. i = 0;
  10745. if (i > anInt1211 - 110)
  10746. i = anInt1211 - 110;
  10747. if (anInt1089 != i) {
  10748. anInt1089 = i;
  10749. inputTaken = true;
  10750. }
  10751. }
  10752. if (backDialogID != -1) {
  10753. boolean flag2 = method119(anInt945, backDialogID);
  10754. if (flag2)
  10755. inputTaken = true;
  10756. }
  10757. if (atInventoryInterfaceType == 3)
  10758. inputTaken = true;
  10759. if (activeInterfaceType == 3)
  10760. inputTaken = true;
  10761. if (aString844 != null)
  10762. inputTaken = true;
  10763. if (menuOpen && menuScreenArea == 2)
  10764. inputTaken = true;
  10765. if (inputTaken && !isFullScreen) {
  10766. try {
  10767. drawChatArea();
  10768. } catch (Exception e) {
  10769. e.printStackTrace();
  10770. }
  10771. inputTaken = false;
  10772. }
  10773. if (loadingStage == 2)
  10774. try {
  10775. method146();
  10776. } catch (Exception e) {
  10777. }
  10778. if (loadingStage == 2 && !isFullScreen) {
  10779. drawMinimap();
  10780. aRSImageProducer_1164.drawGraphics(0, super.graphics, 519);
  10781. }
  10782. if (anInt1054 != -1)
  10783. tabAreaAltered = true;
  10784. if (tabAreaAltered) {
  10785. if (anInt1054 != -1 && anInt1054 == tabID) {
  10786. anInt1054 = -1;
  10787. stream.createFrame(120);
  10788. stream.writeWordBigEndian(tabID);
  10789. }
  10790. tabAreaAltered = false;
  10791. aRSImageProducer_1125.initDrawingArea();
  10792. aRSImageProducer_1165.initDrawingArea();
  10793. }
  10794. if (aBoolean1233) {
  10795. aBoolean1233 = false;
  10796. }
  10797. anInt945 = 0;
  10798. // RSInterface.resetRunesAndLevels(1541); //DERP
  10799. }
  10800.  
  10801. private void determineMenuSize() {
  10802. int i = chatTextDrawingArea.getTextWidth("Choose Option");
  10803. for (int j = 0; j < menuActionRow; j++) {
  10804. int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  10805. if (k > i)
  10806. i = k;
  10807. }
  10808. int x = isFullScreen ? extraWidth : 0;
  10809. int y = isFullScreen ? extraHeight : 0;
  10810. i += 8;
  10811. int l = 15 * menuActionRow + 21;
  10812. if (super.saveClickX > 4 && super.saveClickY > 4
  10813. && super.saveClickX < 516 && super.saveClickY < 338) {
  10814. int i1 = super.saveClickX - 4 - i / 2;
  10815. if (i1 + i > 512 + x)
  10816. i1 = 512 + x - i;
  10817. if (i1 < 0)
  10818. i1 = 0;
  10819. int l1 = super.saveClickY - 4;
  10820. if (l1 + l > 334 + y)
  10821. l1 = 334 + y - l;
  10822. if (l1 < 0)
  10823. l1 = 0;
  10824. menuOpen = true;
  10825. menuScreenArea = 0;
  10826. menuOffsetX = i1;
  10827. menuOffsetY = l1;
  10828. menuWidth = i;
  10829. menuHeight = 15 * menuActionRow + 22;
  10830. }
  10831. if (super.saveClickX > 519 && super.saveClickY > 168
  10832. && super.saveClickX < 765 + x && super.saveClickY < 503 + y) {
  10833. int j1 = super.saveClickX - 519 - i / 2;
  10834. if (j1 < 0)
  10835. j1 = 0;
  10836. else if (j1 + i > 245 + x)
  10837. j1 = 245 + x - i;
  10838. int i2 = super.saveClickY - 168;
  10839. if (i2 < 0)
  10840. i2 = 0;
  10841. else if (i2 + l > 333 + y)
  10842. i2 = 333 + y - l;
  10843. menuOpen = true;
  10844. menuOffsetX = j1;
  10845. menuOffsetY = i2;
  10846.  
  10847. menuScreenArea = 1;
  10848. menuWidth = i;
  10849. menuHeight = 15 * menuActionRow + 22;
  10850. }
  10851. if (super.saveClickX > 0 && super.saveClickY > 338
  10852. && super.saveClickX < 516 && super.saveClickY < 503 + y) {
  10853. int k1 = super.saveClickX - 0 - i / 2;
  10854. if (k1 < 0)
  10855. k1 = 0;
  10856. else if (k1 + i > 516)
  10857. k1 = 516 - i;
  10858. int j2 = super.saveClickY - 338;
  10859. if (j2 < 0)
  10860. j2 = 0;
  10861. else if (j2 + l > 165 + y)
  10862. j2 = 165 + y - l;
  10863. menuOpen = true;
  10864. menuOffsetX = k1;
  10865. menuOffsetY = j2;
  10866. menuWidth = i;
  10867.  
  10868. menuScreenArea = 2;
  10869. menuHeight = 15 * menuActionRow + 22;
  10870. }
  10871. if (super.saveClickX >= 515 + extraWidth && super.saveClickY >= 0
  10872. && super.saveClickX <= 765 + extraWidth
  10873. && super.saveClickY <= 169) {
  10874. int k1 = super.saveClickX - 515 - i / 2;
  10875. if (k1 < 0)
  10876. k1 = 0;
  10877. else if (k1 + i > 249 + extraWidth)
  10878. k1 = 249 + extraWidth - i;
  10879. int j2 = super.saveClickY;
  10880. if (j2 < 0)
  10881. j2 = 0;
  10882. else if (j2 + l > 168)
  10883. j2 = 168 - l;
  10884. menuOpen = true;
  10885. menuScreenArea = 3;
  10886. menuOffsetX = k1;
  10887. menuOffsetY = j2;
  10888. menuWidth = i;
  10889. menuHeight = 15 * menuActionRow + 22;
  10890. }
  10891. }
  10892.  
  10893. private boolean buildFriendsListMenu(RSInterface class9) {
  10894. int i = class9.contentType;
  10895. if (i >= 1 && i <= 200 || i >= 701 && i <= 900) {
  10896. if (i >= 801)
  10897. i -= 701;
  10898. else if (i >= 701)
  10899. i -= 601;
  10900. else if (i >= 101)
  10901. i -= 101;
  10902. else
  10903. i--;
  10904. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  10905. menuActionID[menuActionRow] = 792;
  10906. menuActionRow++;
  10907. menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  10908. menuActionID[menuActionRow] = 639;
  10909. menuActionRow++;
  10910. return true;
  10911. }
  10912. if (i >= 401 && i <= 500) {
  10913. menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  10914. menuActionID[menuActionRow] = 322;
  10915. menuActionRow++;
  10916. return true;
  10917. } else {
  10918. return false;
  10919. }
  10920. }
  10921.  
  10922. private void method104() {
  10923. Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  10924. .reverseGetFirst();
  10925. for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056
  10926. .reverseGetNext())
  10927. if (class30_sub2_sub4_sub3.anInt1560 != plane
  10928. || class30_sub2_sub4_sub3.aBoolean1567)
  10929. class30_sub2_sub4_sub3.unlink();
  10930. else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
  10931. class30_sub2_sub4_sub3.method454(anInt945);
  10932. if (class30_sub2_sub4_sub3.aBoolean1567)
  10933. class30_sub2_sub4_sub3.unlink();
  10934. else
  10935. worldController.method285(class30_sub2_sub4_sub3.anInt1560,
  10936. 0, class30_sub2_sub4_sub3.anInt1563, -1,
  10937. class30_sub2_sub4_sub3.anInt1562, 60,
  10938. class30_sub2_sub4_sub3.anInt1561,
  10939. class30_sub2_sub4_sub3, false);
  10940. }
  10941.  
  10942. }
  10943.  
  10944. public void drawBlackBox(int xPos, int yPos) {
  10945. DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  10946. DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  10947. DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  10948. DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  10949. DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  10950. DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  10951. DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  10952. DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  10953. DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  10954. }
  10955.  
  10956. private void drawInterface(int j, int k, RSInterface class9, int l) {
  10957. if (class9 == null || class9.type != 0 || class9.children == null)
  10958. return;
  10959. if (class9.isMouseoverTriggered && anInt1026 != class9.id
  10960. && anInt1048 != class9.id && anInt1039 != class9.id)
  10961. return;
  10962. int i1 = DrawingArea.topX;
  10963. int j1 = DrawingArea.topY;
  10964. int k1 = DrawingArea.bottomX;
  10965. int l1 = DrawingArea.bottomY;
  10966. DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  10967. int i2 = class9.children.length;
  10968. for (int j2 = 0; j2 < i2; j2++) {
  10969. int k2 = class9.childX[j2] + k;
  10970. int l2 = (class9.childY[j2] + l) - j;
  10971. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  10972. k2 += class9_1.anInt263;
  10973. l2 += class9_1.anInt265;
  10974. if (class9_1.contentType > 0)
  10975. drawFriendsListOrWelcomeScreen(class9_1);
  10976. // here
  10977. int[] IDs = { 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258,
  10978. 1267, 1274, 1283, 1573, 1290, 1299, 1308, 1315, 1324, 1333,
  10979. 1340, 1349, 1358, 1367, 1374, 1381, 1388, 1397, 1404, 1583,
  10980. 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469,
  10981. 15878, 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503,
  10982. 1512, 1521, 1530, 1544, 1553, 1563, 1593, 1635, 12426,
  10983. 12436, 12446, 12456, 6004, 18471,
  10984. /* Ancients */
  10985. 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012,
  10986. 13054, 12920, 12882, 13062, 12952, 13000, 13070, 12912,
  10987. 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096 };
  10988. for (int m5 = 0; m5 < IDs.length; m5++) {
  10989. if (class9_1.id == IDs[m5] + 1) {
  10990. if (m5 > 61)
  10991. drawBlackBox(k2 + 1, l2);
  10992. else
  10993. drawBlackBox(k2, l2 + 1);
  10994. }
  10995. }
  10996. int[] runeChildren = { 1202, 1203, 1209, 1210, 1211, 1218, 1219,
  10997. 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245, 1252,
  10998. 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279,
  10999. 1286, 1287, 1293, 1294, 1295, 1302, 1303, 1304, 1311, 1312,
  11000. 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344,
  11001. 1345, 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377,
  11002. 1378, 1384, 1385, 1391, 1392, 1393, 1400, 1401, 1407, 1408,
  11003. 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441,
  11004. 1442, 1449, 1450, 1456, 1457, 1463, 1464, 1465, 1472, 1473,
  11005. 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499, 1506,
  11006. 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534,
  11007. 1535, 1547, 1548, 1549, 1556, 1557, 1558, 1566, 1567, 1568,
  11008. 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605,
  11009. 1606, 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639,
  11010. 1640, 6007, 6008, 6011, 8673, 8674, 12041, 12042, 12429,
  11011. 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451,
  11012. 12459, 12460, 15881, 15882, 15885, 18474, 18475, 18478 };
  11013. for (int r = 0; r < runeChildren.length; r++)
  11014. if (class9_1.id == runeChildren[r])
  11015. class9_1.modelZoom = 775;
  11016. if (class9_1.type == 0) {
  11017. if (class9_1.scrollPosition > class9_1.scrollMax
  11018. - class9_1.height)
  11019. class9_1.scrollPosition = class9_1.scrollMax
  11020. - class9_1.height;
  11021. if (class9_1.scrollPosition < 0)
  11022. class9_1.scrollPosition = 0;
  11023. drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  11024. if (class9_1.scrollMax > class9_1.height)
  11025. drawScrollbar(class9_1.height, class9_1.scrollPosition, l2,
  11026. k2 + class9_1.width, class9_1.scrollMax);
  11027. } else if (class9_1.type != 1)
  11028. if (class9_1.type == 2) {
  11029. int i3 = 0;
  11030. for (int l3 = 0; l3 < class9_1.height; l3++) {
  11031. for (int l4 = 0; l4 < class9_1.width; l4++) {
  11032. int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  11033. int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  11034. if (i3 < 20) {
  11035. k5 += class9_1.spritesX[i3];
  11036. j6 += class9_1.spritesY[i3];
  11037. }
  11038. if (class9_1.inv[i3] > 0) {
  11039. int k6 = 0;
  11040. int j7 = 0;
  11041. int j9 = class9_1.inv[i3] - 1;
  11042. if (k5 > DrawingArea.topX - 32
  11043. && k5 < DrawingArea.bottomX
  11044. && j6 > DrawingArea.topY - 32
  11045. && j6 < DrawingArea.bottomY
  11046. || activeInterfaceType != 0
  11047. && anInt1085 == i3) {
  11048. int l9 = 0;
  11049. if (itemSelected == 1 && anInt1283 == i3
  11050. && anInt1284 == class9_1.id)
  11051. l9 = 0xffffff;
  11052. Sprite class30_sub2_sub1_sub1_2 = ItemDef
  11053. .getSprite(j9,
  11054. class9_1.invStackSizes[i3],
  11055. l9);
  11056. if (class30_sub2_sub1_sub1_2 != null) {
  11057. if (activeInterfaceType != 0
  11058. && anInt1085 == i3
  11059. && anInt1084 == class9_1.id) {
  11060. k6 = super.mouseX - anInt1087;
  11061. j7 = super.mouseY - anInt1088;
  11062. if (k6 < 5 && k6 > -5)
  11063. k6 = 0;
  11064. if (j7 < 5 && j7 > -5)
  11065. j7 = 0;
  11066. if (anInt989 < 10) {
  11067. k6 = 0;
  11068. j7 = 0;
  11069. }
  11070. class30_sub2_sub1_sub1_2
  11071. .drawSprite1(k5 + k6, j6
  11072. + j7);
  11073. if (j6 + j7 < DrawingArea.topY
  11074. && class9.scrollPosition > 0) {
  11075. int i10 = (anInt945 * (DrawingArea.topY
  11076. - j6 - j7)) / 3;
  11077. if (i10 > anInt945 * 10)
  11078. i10 = anInt945 * 10;
  11079. if (i10 > class9.scrollPosition)
  11080. i10 = class9.scrollPosition;
  11081. class9.scrollPosition -= i10;
  11082. anInt1088 += i10;
  11083. }
  11084. if (j6 + j7 + 32 > DrawingArea.bottomY
  11085. && class9.scrollPosition < class9.scrollMax
  11086. - class9.height) {
  11087. int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  11088. if (j10 > anInt945 * 10)
  11089. j10 = anInt945 * 10;
  11090. if (j10 > class9.scrollMax
  11091. - class9.height
  11092. - class9.scrollPosition)
  11093. j10 = class9.scrollMax
  11094. - class9.height
  11095. - class9.scrollPosition;
  11096. class9.scrollPosition += j10;
  11097. anInt1088 -= j10;
  11098. }
  11099. } else if (atInventoryInterfaceType != 0
  11100. && atInventoryIndex == i3
  11101. && atInventoryInterface == class9_1.id)
  11102. class30_sub2_sub1_sub1_2
  11103. .drawSprite1(k5, j6);
  11104. else
  11105. class30_sub2_sub1_sub1_2
  11106. .drawSprite(k5, j6);
  11107. if (class30_sub2_sub1_sub1_2.anInt1444 == 33
  11108. || class9_1.invStackSizes[i3] != 1) {
  11109. int k10 = class9_1.invStackSizes[i3];
  11110. if (intToKOrMil(k10) == "@inf@") {
  11111. infinity.drawSprite(k5 + k6, j6
  11112. + j7);
  11113. } else {
  11114. if (k10 >= 1) {
  11115. smallText.method385(0,
  11116. intToKOrMil(k10),
  11117. j6 + 10 + j7, k5
  11118. + 1 + k6);
  11119. smallText.method385(
  11120. 0xFFFF00,
  11121. intToKOrMil(k10),
  11122. j6 + 9 + j7, k5
  11123. + k6);
  11124. }
  11125. if (k10 >= 100000) {
  11126. smallText.method385(0,
  11127. intToKOrMil(k10),
  11128. j6 + 10 + j7, k5
  11129. + 1 + k6);
  11130. smallText.method385(
  11131. 0xFFFFFF,
  11132. intToKOrMil(k10),
  11133. j6 + 9 + j7, k5
  11134. + k6);
  11135. }
  11136. if (k10 >= 10000000) {
  11137. smallText.method385(0,
  11138. intToKOrMil(k10),
  11139. j6 + 10 + j7, k5
  11140. + 1 + k6);
  11141. smallText.method385(
  11142. 0x00ff80,
  11143. intToKOrMil(k10),
  11144. j6 + 9 + j7, k5
  11145. + k6);
  11146. }
  11147. /*
  11148. * smallText.method385(0,
  11149. * intToKOrMil(k10), j6 + 10 +
  11150. * j7, k5 + 1 + k6);
  11151. * smallText.method385(0xffff00,
  11152. * intToKOrMil(k10), j6 + 9 +
  11153. * j7, k5 + k6);
  11154. */
  11155. }
  11156. }
  11157. }
  11158. }
  11159. } else if (class9_1.sprites != null && i3 < 20) {
  11160. Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  11161. if (class30_sub2_sub1_sub1_1 != null)
  11162. class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  11163. }
  11164. i3++;
  11165. }
  11166. }
  11167. } else if (class9_1.type == 3) {
  11168. boolean flag = false;
  11169. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id
  11170. || anInt1026 == class9_1.id)
  11171. flag = true;
  11172. int j3;
  11173. if (interfaceIsSelected(class9_1)) {
  11174. j3 = class9_1.anInt219;
  11175. if (flag && class9_1.anInt239 != 0)
  11176. j3 = class9_1.anInt239;
  11177. } else {
  11178. j3 = class9_1.textColor;
  11179. if (flag && class9_1.anInt216 != 0)
  11180. j3 = class9_1.anInt216;
  11181. }
  11182. if (class9_1.opacity == 0) {
  11183. if (class9_1.aBoolean227)
  11184. DrawingArea.drawPixels(class9_1.height, l2, k2, j3,
  11185. class9_1.width);
  11186. else
  11187. DrawingArea.fillPixels(k2, class9_1.width,
  11188. class9_1.height, j3, l2);
  11189. } else if (class9_1.aBoolean227)
  11190. DrawingArea.method335(j3, l2, class9_1.width,
  11191. class9_1.height,
  11192. 256 - (class9_1.opacity & 0xff), k2);
  11193. else
  11194. DrawingArea.method338(l2, class9_1.height,
  11195. 256 - (class9_1.opacity & 0xff), j3,
  11196. class9_1.width, k2);
  11197. } else if (class9_1.type == 4) {
  11198. TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  11199. String s = class9_1.message;
  11200. boolean flag1 = false;
  11201. if (anInt1039 == class9_1.id || anInt1048 == class9_1.id
  11202. || anInt1026 == class9_1.id)
  11203. flag1 = true;
  11204. int i4;
  11205. if (interfaceIsSelected(class9_1)) {
  11206. i4 = class9_1.anInt219;
  11207. if (flag1 && class9_1.anInt239 != 0)
  11208. i4 = class9_1.anInt239;
  11209. if (class9_1.aString228.length() > 0)
  11210. s = class9_1.aString228;
  11211. } else {
  11212. i4 = class9_1.textColor;
  11213. if (flag1 && class9_1.anInt216 != 0)
  11214. i4 = class9_1.anInt216;
  11215. }
  11216. if (class9_1.atActionType == 6 && aBoolean1149) {
  11217. s = "Please wait...";
  11218. i4 = class9_1.textColor;
  11219. }
  11220. if (DrawingArea.width == 519) {
  11221. if (i4 == 0xffff00)
  11222. i4 = 255;
  11223. if (i4 == 49152)
  11224. i4 = 0xffffff;
  11225. }
  11226. if ((class9_1.parentID == 1151)
  11227. || (class9_1.parentID == 12855)) {
  11228. switch (i4) {
  11229. case 16773120:
  11230. i4 = 0xFE981F;
  11231. break;
  11232. case 7040819:
  11233. i4 = 0xAF6A1A;
  11234. break;
  11235. }
  11236. }
  11237. for (int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497) {
  11238. if (s.indexOf("%") != -1) {
  11239. do {
  11240. int k7 = s.indexOf("%1");
  11241. if (k7 == -1)
  11242. break;
  11243. if (class9_1.id < 4000 || class9_1.id > 5000
  11244. && class9_1.id != 13921
  11245. && class9_1.id != 13922
  11246. && class9_1.id != 12171
  11247. && class9_1.id != 12172)
  11248. s = s.substring(0, k7)
  11249. + methodR(extractInterfaceValues(
  11250. class9_1, 0))
  11251. + s.substring(k7 + 2);
  11252. else
  11253. s = s.substring(0, k7)
  11254. + interfaceIntToString(extractInterfaceValues(
  11255. class9_1, 0))
  11256. + s.substring(k7 + 2);
  11257. } while (true);
  11258. do {
  11259. int l7 = s.indexOf("%2");
  11260. if (l7 == -1)
  11261. break;
  11262. s = s.substring(0, l7)
  11263. + interfaceIntToString(extractInterfaceValues(
  11264. class9_1, 1))
  11265. + s.substring(l7 + 2);
  11266. } while (true);
  11267. do {
  11268. int i8 = s.indexOf("%3");
  11269. if (i8 == -1)
  11270. break;
  11271. s = s.substring(0, i8)
  11272. + interfaceIntToString(extractInterfaceValues(
  11273. class9_1, 2))
  11274. + s.substring(i8 + 2);
  11275. } while (true);
  11276. do {
  11277. int j8 = s.indexOf("%4");
  11278. if (j8 == -1)
  11279. break;
  11280. s = s.substring(0, j8)
  11281. + interfaceIntToString(extractInterfaceValues(
  11282. class9_1, 3))
  11283. + s.substring(j8 + 2);
  11284. } while (true);
  11285. do {
  11286. int k8 = s.indexOf("%5");
  11287. if (k8 == -1)
  11288. break;
  11289. s = s.substring(0, k8)
  11290. + interfaceIntToString(extractInterfaceValues(
  11291. class9_1, 4))
  11292. + s.substring(k8 + 2);
  11293. } while (true);
  11294. }
  11295. int l8 = s.indexOf("\\n");
  11296. String s1;
  11297. if (l8 != -1) {
  11298. s1 = s.substring(0, l8);
  11299. s = s.substring(l8 + 2);
  11300. } else {
  11301. s1 = s;
  11302. s = "";
  11303. }
  11304. if (class9_1.centerText)
  11305. textDrawingArea.method382(i4, k2 + class9_1.width
  11306. / 2, s1, l6, class9_1.textShadow);
  11307. else
  11308. textDrawingArea.method389(class9_1.textShadow, k2,
  11309. i4, s1, l6);
  11310. }
  11311. } else if (class9_1.type == 5) {
  11312. // whats this?
  11313. Sprite sprite;
  11314. if (interfaceIsSelected(class9_1))
  11315. sprite = class9_1.sprite2;
  11316. else
  11317. sprite = class9_1.sprite1;
  11318. if (sprite != null) {
  11319. if (spellSelected == 1 && class9_1.id == spellID
  11320. && spellID != 0)
  11321. sprite.Outlining(k2, l2, 0xffffff);
  11322. else
  11323. sprite.drawSprite(k2, l2);
  11324. }
  11325. /*
  11326. * if (Autocast && class9_1.id == autocastId)
  11327. * magicAuto.drawSprite(k2 - 3, l2 - 3);
  11328. */
  11329. if (sprite != null)
  11330. sprite.drawSprite(k2, l2);// works :)
  11331. } else if (class9_1.type == 6) {
  11332. int k3 = Texture.textureInt1;
  11333. int j4 = Texture.textureInt2;
  11334. Texture.textureInt1 = k2 + class9_1.width / 2;
  11335. Texture.textureInt2 = l2 + class9_1.height / 2;
  11336. int i5 = Texture.anIntArray1470[class9_1.modelRotation1]
  11337. * class9_1.modelZoom >> 16;
  11338. int l5 = Texture.anIntArray1471[class9_1.modelRotation1]
  11339. * class9_1.modelZoom >> 16;
  11340. boolean flag2 = interfaceIsSelected(class9_1);
  11341. int i7;
  11342. if (flag2)
  11343. i7 = class9_1.anInt258;
  11344. else
  11345. i7 = class9_1.anInt257;
  11346. Model model;
  11347. if (i7 == -1) {
  11348. model = class9_1.method209(-1, -1, flag2);
  11349. } else {
  11350. Animation animation = Animation.anims[i7];
  11351. model = class9_1.method209(
  11352. animation.anIntArray354[class9_1.anInt246],
  11353. animation.anIntArray353[class9_1.anInt246],
  11354. flag2);
  11355. }
  11356. if (model != null)
  11357. model.method482(class9_1.modelRotation2, 0,
  11358. class9_1.modelRotation1, 0, i5, l5);
  11359. Texture.textureInt1 = k3;
  11360. Texture.textureInt2 = j4;
  11361. } else if (class9_1.type == 7) {
  11362. TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  11363. int k4 = 0;
  11364. for (int j5 = 0; j5 < class9_1.height; j5++) {
  11365. for (int i6 = 0; i6 < class9_1.width; i6++) {
  11366. if (class9_1.inv[k4] > 0) {
  11367. ItemDef itemDef = ItemDef
  11368. .forID(class9_1.inv[k4] - 1);
  11369. String s2 = itemDef.name;
  11370. if (itemDef.stackable
  11371. || class9_1.invStackSizes[k4] != 1)
  11372. s2 = s2
  11373. + " x"
  11374. + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  11375. int i9 = k2 + i6
  11376. * (115 + class9_1.invSpritePadX);
  11377. int k9 = l2 + j5
  11378. * (12 + class9_1.invSpritePadY);
  11379. if (class9_1.centerText)
  11380. textDrawingArea_1.method382(
  11381. class9_1.textColor, i9
  11382. + class9_1.width / 2, s2,
  11383. k9, class9_1.textShadow);
  11384. else
  11385. textDrawingArea_1.method389(
  11386. class9_1.textShadow, i9,
  11387. class9_1.textColor, s2, k9);
  11388. }
  11389. k4++;
  11390. }
  11391. }
  11392. } else if (class9_1.type == 8) {
  11393. String hoverText;
  11394. if (interfaceIsSelected(class9_1)) {
  11395. hoverText = class9_1.aString228;
  11396. } else
  11397. hoverText = class9_1.message;
  11398. drawHoverBox(k2, l2, hoverText);
  11399. // drawHoverBox(k2, l2, class9_1.popupString);
  11400.  
  11401. } else if (class9_1.type == 9
  11402. && (anInt1500 == class9_1.id
  11403. || anInt1044 == class9_1.id || anInt1129 == class9_1.id)
  11404. && !menuOpen) {
  11405. int boxWidth = 0;
  11406. int boxHeight = 0;
  11407. TextDrawingArea textDrawingArea_2 = smallText;
  11408. for (String s1 = class9_1.message; s1.length() > 0;) {
  11409. int l7 = s1.indexOf("\\n");
  11410. String s4;
  11411. if (l7 != -1) {
  11412. s4 = s1.substring(0, l7);
  11413. s1 = s1.substring(l7 + 2);
  11414. } else {
  11415. s4 = s1;
  11416. s1 = "";
  11417. }
  11418. int j10 = textDrawingArea_2.getTextWidth(s4);
  11419. if (j10 > boxWidth) {
  11420. boxWidth = j10;
  11421. }
  11422. boxHeight += textDrawingArea_2.anInt1497 + 1;
  11423. }
  11424. boxWidth += 6;
  11425. boxHeight += 7;
  11426. int xPos = (k2 + class9_1.width) - 5 - boxWidth;
  11427. int yPos = l2 + class9_1.height + 5;
  11428. if (xPos < k2 + 5) {
  11429. xPos = k2 + 5;
  11430. }
  11431. if (xPos + boxWidth > k + class9.width) {
  11432. xPos = (k + class9.width) - boxWidth;
  11433. }
  11434. if (yPos + boxHeight > l + class9.height) {
  11435. yPos = (l + class9.height) - boxHeight;
  11436. }
  11437. if (class9_1.inventoryHover) {
  11438. if (xPos + boxWidth + k > 249) {
  11439. xPos = 251 - boxWidth - k;
  11440. }
  11441. if (yPos + boxHeight + l > 261) {
  11442. yPos = 245 - boxHeight - l;
  11443. }
  11444. }
  11445. DrawingArea.drawPixels(boxHeight, yPos, xPos, 0xFFFFA0,
  11446. boxWidth);
  11447. DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
  11448. String s2 = class9_1.message;
  11449. for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2
  11450. .length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {
  11451. int l11 = s2.indexOf("\\n");
  11452. String s5;
  11453. if (l11 != -1) {
  11454. s5 = s2.substring(0, l11);
  11455. s2 = s2.substring(l11 + 2);
  11456. } else {
  11457. s5 = s2;
  11458. s2 = "";
  11459. }
  11460. textDrawingArea_2
  11461. .method389(false, xPos + 3, 0, s5, j11);
  11462. }
  11463. }
  11464. }
  11465. DrawingArea.setDrawingArea(l1, i1, k1, j1);
  11466. }
  11467.  
  11468. private void randomizeBackground(Background background) {
  11469. int j = 256;
  11470. for (int k = 0; k < anIntArray1190.length; k++)
  11471. anIntArray1190[k] = 0;
  11472.  
  11473. for (int l = 0; l < 5000; l++) {
  11474. int i1 = (int) (Math.random() * 128D * (double) j);
  11475. anIntArray1190[i1] = (int) (Math.random() * 256D);
  11476. }
  11477. for (int j1 = 0; j1 < 20; j1++) {
  11478. for (int k1 = 1; k1 < j - 1; k1++) {
  11479. for (int i2 = 1; i2 < 127; i2++) {
  11480. int k2 = i2 + (k1 << 7);
  11481. anIntArray1191[k2] = (anIntArray1190[k2 - 1]
  11482. + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  11483. }
  11484.  
  11485. }
  11486. int ai[] = anIntArray1190;
  11487. anIntArray1190 = anIntArray1191;
  11488. anIntArray1191 = ai;
  11489. }
  11490. if (background != null) {
  11491. int l1 = 0;
  11492. for (int j2 = 0; j2 < background.anInt1453; j2++) {
  11493. for (int l2 = 0; l2 < background.anInt1452; l2++)
  11494. if (background.aByteArray1450[l1++] != 0) {
  11495. int i3 = l2 + 16 + background.anInt1454;
  11496. int j3 = j2 + 16 + background.anInt1455;
  11497. int k3 = i3 + (j3 << 7);
  11498. anIntArray1190[k3] = 0;
  11499. }
  11500. }
  11501. }
  11502. }
  11503.  
  11504. private void method107(int i, int j, Stream stream, Player player) {
  11505. if ((i & 0x400) != 0) {
  11506. player.anInt1543 = stream.method428();
  11507. player.anInt1545 = stream.method428();
  11508. player.anInt1544 = stream.method428();
  11509. player.anInt1546 = stream.method428();
  11510. player.anInt1547 = stream.method436() + loopCycle;
  11511. player.anInt1548 = stream.method435() + loopCycle;
  11512. player.anInt1549 = stream.method428();
  11513. player.method446();
  11514. }
  11515. if ((i & 0x100) != 0) {
  11516. player.anInt1520 = stream.method434();
  11517. int k = stream.readDWord();
  11518. player.anInt1524 = k >> 16;
  11519. player.anInt1523 = loopCycle + (k & 0xffff);
  11520. player.anInt1521 = 0;
  11521. player.anInt1522 = 0;
  11522. if (player.anInt1523 > loopCycle)
  11523. player.anInt1521 = -1;
  11524. if (player.anInt1520 == 65535)
  11525. player.anInt1520 = -1;
  11526. }
  11527. if ((i & 8) != 0) {
  11528. int l = stream.method434();
  11529. if (l == 65535)
  11530. l = -1;
  11531. int i2 = stream.method427();
  11532. if (l == player.anim && l != -1) {
  11533. int i3 = Animation.anims[l].anInt365;
  11534. if (i3 == 1) {
  11535. player.anInt1527 = 0;
  11536. player.anInt1528 = 0;
  11537. player.anInt1529 = i2;
  11538. player.anInt1530 = 0;
  11539. }
  11540. if (i3 == 2)
  11541. player.anInt1530 = 0;
  11542. } else if (l == -1
  11543. || player.anim == -1
  11544. || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359) {
  11545. player.anim = l;
  11546. player.anInt1527 = 0;
  11547. player.anInt1528 = 0;
  11548. player.anInt1529 = i2;
  11549. player.anInt1530 = 0;
  11550. player.anInt1542 = player.smallXYIndex;
  11551. }
  11552. }
  11553. if ((i & 4) != 0) {
  11554. player.textSpoken = stream.readString();
  11555. if (player.textSpoken.charAt(0) == '~') {
  11556. player.textSpoken = player.textSpoken.substring(1);
  11557. pushMessage(player.textSpoken, 2, player.name);
  11558. } else if (player == myPlayer)
  11559. pushMessage(player.textSpoken, 2, player.name);
  11560. player.anInt1513 = 0;
  11561. player.anInt1531 = 0;
  11562. player.textCycle = 150;
  11563. }
  11564. if ((i & 0x80) != 0) {
  11565. // right fucking here
  11566. int i1 = stream.method434();
  11567. int j2 = stream.readUnsignedByte();
  11568. int j3 = stream.method427();
  11569. int k3 = stream.currentOffset;
  11570. if (player.name != null && player.visible) {
  11571. long l3 = TextClass.longForName(player.name);
  11572. boolean flag = false;
  11573. if (j2 <= 1) {
  11574. for (int i4 = 0; i4 < ignoreCount; i4++) {
  11575. if (ignoreListAsLongs[i4] != l3)
  11576. continue;
  11577. flag = true;
  11578. break;
  11579. }
  11580.  
  11581. }
  11582. if (!flag && anInt1251 == 0)
  11583. try {
  11584. aStream_834.currentOffset = 0;
  11585. stream.method442(j3, 0, aStream_834.buffer);
  11586. aStream_834.currentOffset = 0;
  11587. String s = TextInput.method525(j3, aStream_834);
  11588. // s = Censor.doCensor(s);
  11589. player.textSpoken = s;
  11590. player.anInt1513 = i1 >> 8;
  11591. player.privelage = j2;
  11592. player.anInt1531 = i1 & 0xff;
  11593. player.textCycle = 150;
  11594. if (j2 > 0)
  11595. pushMessage(s, 1, player.name, j2);
  11596. else
  11597. pushMessage(s, 2, player.name);
  11598. } catch (Exception exception) {
  11599. // signlink.reporterror("cde2");
  11600. }
  11601. }
  11602. stream.currentOffset = k3 + j3;
  11603. }
  11604. if ((i & 1) != 0) {
  11605. player.interactingEntity = stream.method434();
  11606. if (player.interactingEntity == 65535)
  11607. player.interactingEntity = -1;
  11608. }
  11609. if ((i & 0x10) != 0) {
  11610. int j1 = stream.method427();
  11611. byte abyte0[] = new byte[j1];
  11612. Stream stream_1 = new Stream(abyte0);
  11613. stream.readBytes(j1, 0, abyte0);
  11614. aStreamArray895s[j] = stream_1;
  11615. player.updatePlayer(stream_1);
  11616. }
  11617. if ((i & 2) != 0) {
  11618. player.anInt1538 = stream.method436();
  11619. player.anInt1539 = stream.method434();
  11620. }
  11621. if ((i & 0x20) != 0) {
  11622. int k1 = stream.method435();
  11623. int k2 = stream.method426();// here
  11624. int type1 = stream.readUnsignedByte();
  11625.  
  11626. // System.out.println("k1 is :" + k1 + " and k2 is " + k2);
  11627. // System.out.println("Type 1[B] :" + type1);
  11628. // System.out.println("k1 is :" + k1 + " and k2 is " + k2);
  11629. if (type1 >= 5) {
  11630. type1 -= 5;
  11631. // System.out.println("CRitical[B] is now " + type1);
  11632. critical = true;
  11633. // pushMessage("Critical! 1",0, "");
  11634. } else {
  11635. critical = false;
  11636. }
  11637. if (hitmarks) {
  11638. player.updateHitData(k2, k1, type1, loopCycle);
  11639. } else
  11640. player.updateHitData(k2, k1, loopCycle);
  11641. player.loopCycleStatus = loopCycle + 300;
  11642. player.currentHealth = stream.method427();
  11643. player.maxHealth = stream.readUnsignedByte();
  11644. }
  11645. if ((i & 0x200) != 0) {
  11646. int l1 = stream.method435();
  11647. int l2 = stream.method428();
  11648. int type1 = stream.readUnsignedByte();
  11649.  
  11650. // System.out.println("Type 1[D] :" + type1);
  11651. // System.out.println("l1 is :" + l1 + " and l2 is " + l2);
  11652. if (!critical) {
  11653. if (type1 >= 5) {
  11654. type1 -= 5;
  11655. // System.out.println("Critical[D] is now " + type1);
  11656. critical = true;
  11657. // pushMessage("Critical! 2",0, "");
  11658. } else {
  11659. critical = false;
  11660. }
  11661. }
  11662. if (hitmarks) {
  11663. player.updateHitData(l2, l1, type1, loopCycle);
  11664. } else {
  11665. player.updateHitData(l2, l1, loopCycle);
  11666. }
  11667. player.loopCycleStatus = loopCycle + 300;
  11668. player.currentHealth = stream.readUnsignedByte();
  11669. player.maxHealth = stream.method427();
  11670. }
  11671. }
  11672.  
  11673. private void method108() {
  11674. try {
  11675. int j = myPlayer.x + anInt1278;
  11676. int k = myPlayer.y + anInt1131;
  11677. if (anInt1014 - j < -500 || anInt1014 - j > 500
  11678. || anInt1015 - k < -500 || anInt1015 - k > 500) {
  11679. anInt1014 = j;
  11680. anInt1015 = k;
  11681. }
  11682. if (anInt1014 != j)
  11683. anInt1014 += (j - anInt1014) / 16;
  11684. if (anInt1015 != k)
  11685. anInt1015 += (k - anInt1015) / 16;
  11686. if (super.keyArray[1] == 1)
  11687. anInt1186 += (-24 - anInt1186) / 2;
  11688. else if (super.keyArray[2] == 1)
  11689. anInt1186 += (24 - anInt1186) / 2;
  11690. else
  11691. anInt1186 /= 2;
  11692. if (super.keyArray[3] == 1)
  11693. anInt1187 += (12 - anInt1187) / 2;
  11694. else if (super.keyArray[4] == 1)
  11695. anInt1187 += (-12 - anInt1187) / 2;
  11696. else
  11697. anInt1187 /= 2;
  11698. minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  11699. anInt1184 += anInt1187 / 2;
  11700. if (anInt1184 < 128)
  11701. anInt1184 = 128;
  11702. if (anInt1184 > 383)
  11703. anInt1184 = 383;
  11704. int l = anInt1014 >> 7;
  11705. int i1 = anInt1015 >> 7;
  11706. int j1 = method42(plane, anInt1015, anInt1014);
  11707. int k1 = 0;
  11708. if (l > 3 && i1 > 3 && l < 100 && i1 < 100) {
  11709. for (int l1 = l - 4; l1 <= l + 4; l1++) {
  11710. for (int k2 = i1 - 4; k2 <= i1 + 4; k2++) {
  11711. int l2 = plane;
  11712. if (l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  11713. l2++;
  11714. int i3 = j1 - intGroundArray[l2][l1][k2];
  11715. if (i3 > k1)
  11716. k1 = i3;
  11717. }
  11718.  
  11719. }
  11720.  
  11721. }
  11722. anInt1005++;
  11723. if (anInt1005 > 1512) {
  11724. anInt1005 = 0;
  11725. stream.createFrame(77);
  11726. stream.writeWordBigEndian(0);
  11727. int i2 = stream.currentOffset;
  11728. stream.writeWordBigEndian((int) (Math.random() * 256D));
  11729. stream.writeWordBigEndian(101);
  11730. stream.writeWordBigEndian(233);
  11731. stream.writeWord(45092);
  11732. if ((int) (Math.random() * 2D) == 0)
  11733. stream.writeWord(35784);
  11734. stream.writeWordBigEndian((int) (Math.random() * 256D));
  11735. stream.writeWordBigEndian(64);
  11736. stream.writeWordBigEndian(38);
  11737. stream.writeWord((int) (Math.random() * 65536D));
  11738. stream.writeWord((int) (Math.random() * 65536D));
  11739. stream.writeBytes(stream.currentOffset - i2);
  11740. }
  11741. int j2 = k1 * 192;
  11742. if (j2 > 0x17f00)
  11743. j2 = 0x17f00;
  11744. if (j2 < 32768)
  11745. j2 = 32768;
  11746. if (j2 > anInt984) {
  11747. anInt984 += (j2 - anInt984) / 24;
  11748. return;
  11749. }
  11750. if (j2 < anInt984) {
  11751. anInt984 += (j2 - anInt984) / 80;
  11752. }
  11753. } catch (Exception _ex) {
  11754. signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y
  11755. + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + ","
  11756. + anInt1070 + "," + baseX + "," + baseY);
  11757. throw new RuntimeException("eek");
  11758. }
  11759. }
  11760.  
  11761. public void processDrawing() {
  11762. if (rsAlreadyLoaded || loadingError || genericLoadingError) {
  11763. showErrorScreen();
  11764. return;
  11765. }
  11766. anInt1061++;
  11767. if (!loggedIn)
  11768. drawLoginScreen();
  11769. else {
  11770. drawGameScreen();
  11771. backgroundCount = (int) (Math.random() * 5);
  11772. }
  11773. anInt1213 = 0;
  11774. }
  11775.  
  11776. private boolean isFriendOrSelf(String s) {
  11777. if (s == null)
  11778. return false;
  11779. for (int i = 0; i < friendsCount; i++)
  11780. if (s.equalsIgnoreCase(friendsList[i]))
  11781. return true;
  11782. return s.equalsIgnoreCase(myPlayer.name);
  11783. }
  11784.  
  11785. private static String combatDiffColor(int i, int j) {
  11786. int k = i - j;
  11787. if (k < -9)
  11788. return "@red@";
  11789. if (k < -6)
  11790. return "@or3@";
  11791. if (k < -3)
  11792. return "@or2@";
  11793. if (k < 0)
  11794. return "@or1@";
  11795. if (k > 9)
  11796. return "@gre@";
  11797. if (k > 6)
  11798. return "@gr3@";
  11799. if (k > 3)
  11800. return "@gr2@";
  11801. if (k > 0)
  11802. return "@gr1@";
  11803. else
  11804. return "@yel@";
  11805. }
  11806.  
  11807. private void setWaveVolume(int i) {
  11808. signlink.wavevol = i;
  11809. }
  11810.  
  11811. private void draw3dScreen() {
  11812. alertHandler.processAlerts();
  11813. int xs = isFullScreen ? extraWidth + 200 : 0;
  11814. int ys = isFullScreen ? extraHeight - 200 : 0;
  11815.  
  11816. int xPo3s = isFullScreen ? (clientWidth / 2) - 256 : 0;
  11817. int yPo3s = isFullScreen ? (clientHeight / 2) - 167 : 0;
  11818.  
  11819. int xs2 = isFullScreen ? 200 + extraWidth : 0;
  11820. int ys2 = isFullScreen ? extraHeight - 450 : 0;
  11821. drawSplitPrivateChat();
  11822. if (crossType == 1) {
  11823. crosses[crossIndex / 100]
  11824. .drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  11825. anInt1142++;
  11826. if (anInt1142 > 67) {
  11827. anInt1142 = 0;
  11828. stream.createFrame(78);
  11829. }
  11830. }
  11831. if (crossType == 2)
  11832. crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4,
  11833. crossY - 8 - 4);
  11834. if (anInt1018 != -1 && anInt1018 != 21119 && anInt1018 != 21100) {
  11835. method119(anInt945, anInt1018);
  11836. drawInterface(0, 0 + xs2, RSInterface.interfaceCache[anInt1018],
  11837. 0 + ys2);
  11838. }
  11839. if (anInt1018 == 21119 || anInt1018 == 21100) {
  11840. method119(anInt945, anInt1018);
  11841. drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  11842. }
  11843. if (openInterfaceID != -1) {
  11844. method119(anInt945, openInterfaceID);
  11845. drawInterface(0, xPo3s,
  11846. RSInterface.interfaceCache[openInterfaceID], yPo3s);
  11847. }
  11848. method70();
  11849. if (!menuOpen) {
  11850. processRightClick();
  11851. drawTooltip();
  11852. } else if (menuScreenArea == 0)
  11853. drawMenu();
  11854. if (anInt1055 == 1 && !isFullScreen)
  11855. multiOverlay.drawSprite(472, 296);
  11856. if (anInt1055 == 1 && isFullScreen)
  11857. multiOverlay2.drawSprite(472 + xs, 296 + ys);
  11858. if (fpsOn) {
  11859. char c = '\u01FB';
  11860. int k = 20;
  11861. int i1 = 0xffff00;
  11862. if (super.fps < 15)
  11863. i1 = 0xff0000;
  11864. aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  11865. k += 15;
  11866. Runtime runtime = Runtime.getRuntime();
  11867. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  11868. i1 = 0xffff00;
  11869. if (j1 > 0x2000000 && lowMem)
  11870. i1 = 0xff0000;
  11871. aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  11872. k += 15;
  11873. }
  11874. int i1 = 0xffff00;
  11875. int x = baseX + (myPlayer.x - 6 >> 7);
  11876. int y = baseY + (myPlayer.y - 6 >> 7);
  11877. if (clientData) {
  11878. char c = '\u01FB';
  11879. int k = 20;
  11880. if (super.fps < 15)
  11881. i1 = 0xff0000;
  11882. aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285,
  11883. 5);
  11884. Runtime runtime = Runtime.getRuntime();
  11885. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  11886. i1 = 0xffff00;
  11887. if (j1 > 0x2000000 && lowMem)
  11888. i1 = 0xff0000;
  11889. k += 15;
  11890. aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299,
  11891. 5);
  11892. aTextDrawingArea_1271.method385(0xffff00, "Mouse X: "
  11893. + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  11894. aTextDrawingArea_1271.method385(0xffff00,
  11895. "Coords: " + x + ", " + y, 329, 5);
  11896. }
  11897. if (anInt1104 != 0) {
  11898. int j = anInt1104 / 50;
  11899. int l = j / 60;
  11900. j %= 60;
  11901. if (j < 10)
  11902. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  11903. + l + ":0" + j, 329, 4);
  11904. else
  11905. aTextDrawingArea_1271.method385(0xffff00, "System update in: "
  11906. + l + ":" + j, 329, 4);
  11907. anInt849++;
  11908. if (anInt849 > 75) {
  11909. anInt849 = 0;
  11910. stream.createFrame(148);
  11911. }
  11912. }
  11913. }
  11914.  
  11915. private void addIgnore(long l) {
  11916. try {
  11917. if (l == 0L)
  11918. return;
  11919. if (ignoreCount >= 100) {
  11920. pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  11921. return;
  11922. }
  11923. String s = TextClass.fixName(TextClass.nameForLong(l));
  11924. for (int j = 0; j < ignoreCount; j++)
  11925. if (ignoreListAsLongs[j] == l) {
  11926. pushMessage(s + " is already on your ignore list", 0, "");
  11927. return;
  11928. }
  11929. for (int k = 0; k < friendsCount; k++)
  11930. if (friendsListAsLongs[k] == l) {
  11931. pushMessage("Please remove " + s
  11932. + " from your friend list first", 0, "");
  11933. return;
  11934. }
  11935.  
  11936. ignoreListAsLongs[ignoreCount++] = l;
  11937. needDrawTabArea = true;
  11938. stream.createFrame(133);
  11939. stream.writeQWord(l);
  11940. return;
  11941. } catch (RuntimeException runtimeexception) {
  11942. signlink.reporterror("45688, " + l + ", " + 4 + ", "
  11943. + runtimeexception.toString());
  11944. }
  11945. throw new RuntimeException();
  11946. }
  11947.  
  11948. private void method114() {
  11949. for (int i = -1; i < playerCount; i++) {
  11950. int j;
  11951. if (i == -1)
  11952. j = myPlayerIndex;
  11953. else
  11954. j = playerIndices[i];
  11955. Player player = playerArray[j];
  11956. if (player != null)
  11957. method96(player);
  11958. }
  11959.  
  11960. }
  11961.  
  11962. private void method115() {
  11963. if (loadingStage == 2) {
  11964. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  11965. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  11966. .reverseGetNext()) {
  11967. if (class30_sub1.anInt1294 > 0)
  11968. class30_sub1.anInt1294--;
  11969. if (class30_sub1.anInt1294 == 0) {
  11970. if (class30_sub1.anInt1299 < 0
  11971. || ObjectManager.method178(class30_sub1.anInt1299,
  11972. class30_sub1.anInt1301)) {
  11973. method142(class30_sub1.anInt1298,
  11974. class30_sub1.anInt1295, class30_sub1.anInt1300,
  11975. class30_sub1.anInt1301, class30_sub1.anInt1297,
  11976. class30_sub1.anInt1296, class30_sub1.anInt1299);
  11977. class30_sub1.unlink();
  11978. }
  11979. } else {
  11980. if (class30_sub1.anInt1302 > 0)
  11981. class30_sub1.anInt1302--;
  11982. if (class30_sub1.anInt1302 == 0
  11983. && class30_sub1.anInt1297 >= 1
  11984. && class30_sub1.anInt1298 >= 1
  11985. && class30_sub1.anInt1297 <= 102
  11986. && class30_sub1.anInt1298 <= 102
  11987. && (class30_sub1.anInt1291 < 0 || ObjectManager
  11988. .method178(class30_sub1.anInt1291,
  11989. class30_sub1.anInt1293))) {
  11990. method142(class30_sub1.anInt1298,
  11991. class30_sub1.anInt1295, class30_sub1.anInt1292,
  11992. class30_sub1.anInt1293, class30_sub1.anInt1297,
  11993. class30_sub1.anInt1296, class30_sub1.anInt1291);
  11994. class30_sub1.anInt1302 = -1;
  11995. if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  11996. && class30_sub1.anInt1299 == -1)
  11997. class30_sub1.unlink();
  11998. else if (class30_sub1.anInt1291 == class30_sub1.anInt1299
  11999. && class30_sub1.anInt1292 == class30_sub1.anInt1300
  12000. && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  12001. class30_sub1.unlink();
  12002. }
  12003. }
  12004. }
  12005.  
  12006. }
  12007. }
  12008.  
  12009. // stops the click from going over sprite
  12010. private void method117(Stream stream) {
  12011. stream.initBitAccess();
  12012. int j = stream.readBits(1);
  12013. if (j == 0)
  12014. return;
  12015. int k = stream.readBits(2);
  12016. if (k == 0) {
  12017. anIntArray894[anInt893++] = myPlayerIndex;
  12018. return;
  12019. }
  12020. if (k == 1) {
  12021. int l = stream.readBits(3);
  12022. myPlayer.moveInDir(false, l);
  12023. int k1 = stream.readBits(1);
  12024. if (k1 == 1)
  12025. anIntArray894[anInt893++] = myPlayerIndex;
  12026. return;
  12027. }
  12028. if (k == 2) {
  12029. int i1 = stream.readBits(3);
  12030. myPlayer.moveInDir(true, i1);
  12031. int l1 = stream.readBits(3);
  12032. myPlayer.moveInDir(true, l1);
  12033. int j2 = stream.readBits(1);
  12034. if (j2 == 1)
  12035. anIntArray894[anInt893++] = myPlayerIndex;
  12036. return;
  12037. }
  12038. if (k == 3) {
  12039. plane = stream.readBits(2);
  12040. int j1 = stream.readBits(1);
  12041. int i2 = stream.readBits(1);
  12042. if (i2 == 1)
  12043. anIntArray894[anInt893++] = myPlayerIndex;
  12044. int k2 = stream.readBits(7);
  12045. int l2 = stream.readBits(7);
  12046. myPlayer.setPos(l2, k2, j1 == 1);
  12047. }
  12048. }
  12049.  
  12050. public Sprite titleBox;
  12051. public Sprite titleButton;
  12052. public Sprite titleButtonHover;
  12053. private Background loginBox;
  12054.  
  12055. private void nullLoader() {
  12056. aBoolean831 = false;
  12057. while (drawingFlames) {
  12058. aBoolean831 = false;
  12059. try {
  12060. Thread.sleep(50L);
  12061. } catch (Exception _ex) {
  12062. }
  12063. }
  12064. aBackground_966 = null;
  12065. aBackground_967 = null;
  12066. loginBox = null;
  12067. loginButtonHover = null;
  12068. textBoxHover = null;
  12069. titleBox = null;
  12070. titleButton = null;
  12071. titleButtonHover = null;
  12072. aBackgroundArray1152s = null;
  12073. anIntArray850 = null;
  12074. anIntArray851 = null;
  12075. anIntArray852 = null;
  12076. anIntArray853 = null;
  12077. anIntArray1190 = null;
  12078. anIntArray1191 = null;
  12079. anIntArray828 = null;
  12080. anIntArray829 = null;
  12081. aClass30_Sub2_Sub1_Sub1_1201 = null;
  12082. aClass30_Sub2_Sub1_Sub1_1202 = null;
  12083. }
  12084.  
  12085. private boolean method119(int i, int j) {
  12086. boolean flag1 = false;
  12087. RSInterface class9 = RSInterface.interfaceCache[j];
  12088. if (class9 == null || class9.children == null)
  12089. return false;
  12090. for (int k = 0; k < class9.children.length; k++) {
  12091. if (class9.children[k] == -1)
  12092. break;
  12093. RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  12094. if (class9_1.type == 1)
  12095. flag1 |= method119(i, class9_1.id);
  12096. if (class9_1.type == 6
  12097. && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1)) {
  12098. boolean flag2 = interfaceIsSelected(class9_1);
  12099. int l;
  12100. if (flag2)
  12101. l = class9_1.anInt258;
  12102. else
  12103. l = class9_1.anInt257;
  12104. if (l != -1) {
  12105. Animation animation = Animation.anims[l];
  12106. for (class9_1.anInt208 += i; class9_1.anInt208 > animation
  12107. .method258(class9_1.anInt246);) {
  12108. class9_1.anInt208 -= animation
  12109. .method258(class9_1.anInt246) + 1;
  12110. class9_1.anInt246++;
  12111. if (class9_1.anInt246 >= animation.anInt352) {
  12112. class9_1.anInt246 -= animation.anInt356;
  12113. if (class9_1.anInt246 < 0
  12114. || class9_1.anInt246 >= animation.anInt352)
  12115. class9_1.anInt246 = 0;
  12116. }
  12117. flag1 = true;
  12118. }
  12119.  
  12120. }
  12121. }
  12122. }
  12123.  
  12124. return flag1;
  12125. }
  12126.  
  12127. private int method120() {
  12128. int j = 3;
  12129. if (yCameraCurve < 310) {
  12130. int k = xCameraPos >> 7;
  12131. int l = yCameraPos >> 7;
  12132. int i1 = myPlayer.x >> 7;
  12133. int j1 = myPlayer.y >> 7;
  12134. if ((byteGroundArray[plane][k][l] & 4) != 0)
  12135. j = plane;
  12136. int k1;
  12137. if (i1 > k)
  12138. k1 = i1 - k;
  12139. else
  12140. k1 = k - i1;
  12141. int l1;
  12142. if (j1 > l)
  12143. l1 = j1 - l;
  12144. else
  12145. l1 = l - j1;
  12146. if (k1 > l1) {
  12147. int i2 = (l1 * 0x10000) / k1;
  12148. int k2 = 32768;
  12149. while (k != i1) {
  12150. if (k < i1)
  12151. k++;
  12152. else if (k > i1)
  12153. k--;
  12154. if ((byteGroundArray[plane][k][l] & 4) != 0)
  12155. j = plane;
  12156. k2 += i2;
  12157. if (k2 >= 0x10000) {
  12158. k2 -= 0x10000;
  12159. if (l < j1)
  12160. l++;
  12161. else if (l > j1)
  12162. l--;
  12163. if ((byteGroundArray[plane][k][l] & 4) != 0)
  12164. j = plane;
  12165. }
  12166. }
  12167. } else {
  12168. int j2 = (k1 * 0x10000) / l1;
  12169. int l2 = 32768;
  12170. while (l != j1) {
  12171. if (l < j1)
  12172. l++;
  12173. else if (l > j1)
  12174. l--;
  12175. if ((byteGroundArray[plane][k][l] & 4) != 0)
  12176. j = plane;
  12177. l2 += j2;
  12178. if (l2 >= 0x10000) {
  12179. l2 -= 0x10000;
  12180. if (k < i1)
  12181. k++;
  12182. else if (k > i1)
  12183. k--;
  12184. if ((byteGroundArray[plane][k][l] & 4) != 0)
  12185. j = plane;
  12186. }
  12187. }
  12188. }
  12189. }
  12190. if ((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  12191. j = plane;
  12192. return j;
  12193. }
  12194.  
  12195. private int method121() {
  12196. int j = method42(plane, yCameraPos, xCameraPos);
  12197. if (j - zCameraPos < 800
  12198. && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  12199. return plane;
  12200. else
  12201. return 3;
  12202. }
  12203.  
  12204. private void delIgnore(long l) {
  12205. try {
  12206. if (l == 0L)
  12207. return;
  12208. for (int j = 0; j < ignoreCount; j++)
  12209. if (ignoreListAsLongs[j] == l) {
  12210. ignoreCount--;
  12211. needDrawTabArea = true;
  12212. System.arraycopy(ignoreListAsLongs, j + 1,
  12213. ignoreListAsLongs, j, ignoreCount - j);
  12214.  
  12215. stream.createFrame(74);
  12216. stream.writeQWord(l);
  12217. return;
  12218. }
  12219.  
  12220. return;
  12221. } catch (RuntimeException runtimeexception) {
  12222. signlink.reporterror("47229, " + 3 + ", " + l + ", "
  12223. + runtimeexception.toString());
  12224. }
  12225. throw new RuntimeException();
  12226. }
  12227.  
  12228. private void chatJoin(long l) {
  12229. try {
  12230. if (l == 0L)
  12231. return;
  12232. stream.createFrame(60);
  12233. stream.writeQWord(l);
  12234. return;
  12235. } catch (RuntimeException runtimeexception) {
  12236. signlink.reporterror("47229, " + 3 + ", " + l + ", "
  12237. + runtimeexception.toString());
  12238. }
  12239. throw new RuntimeException();
  12240.  
  12241. }
  12242.  
  12243. public String getParameter(String s) {
  12244. if (signlink.mainapp != null)
  12245. return signlink.mainapp.getParameter(s);
  12246. else
  12247. return super.getParameter(s);
  12248. }
  12249.  
  12250. private void adjustVolume(boolean flag, int i) {
  12251. signlink.midivol = i;
  12252. if (flag)
  12253. signlink.midi = "voladjust";
  12254. }
  12255.  
  12256. private int extractInterfaceValues(RSInterface class9, int j) {
  12257. if (class9.valueIndexArray == null
  12258. || j >= class9.valueIndexArray.length)
  12259. return -2;
  12260. try {
  12261. int ai[] = class9.valueIndexArray[j];
  12262. int k = 0;
  12263. int l = 0;
  12264. int i1 = 0;
  12265. do {
  12266. int j1 = ai[l++];
  12267. int k1 = 0;
  12268. byte byte0 = 0;
  12269. if (j1 == 0)
  12270. return k;
  12271. if (j1 == 1)
  12272. k1 = currentStats[ai[l++]];
  12273. if (j1 == 2)
  12274. k1 = maxStats[ai[l++]];
  12275. if (j1 == 3)
  12276. k1 = currentExp[ai[l++]];
  12277. if (j1 == 4) {
  12278. RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  12279. int k2 = ai[l++];
  12280. if (k2 >= 0 && k2 < ItemDef.totalItems
  12281. && (!ItemDef.forID(k2).membersObject || isMembers)) {
  12282. for (int j3 = 0; j3 < class9_1.inv.length; j3++)
  12283. if (class9_1.inv[j3] == k2 + 1)
  12284. k1 += class9_1.invStackSizes[j3];
  12285.  
  12286. }
  12287. }
  12288. if (j1 == 5)
  12289. k1 = variousSettings[ai[l++]];
  12290. if (j1 == 6)
  12291. k1 = anIntArray1019[ai[l++] - 1];
  12292. if (j1 == 7)
  12293. k1 = (variousSettings[ai[l++]] * 100) / 46875;
  12294. if (j1 == 8)
  12295. k1 = myPlayer.combatLevel;
  12296. if (j1 == 9) {
  12297. for (int l1 = 0; l1 < Skills.skillsCount; l1++)
  12298. if (Skills.skillEnabled[l1])
  12299. k1 += maxStats[l1];
  12300.  
  12301. }
  12302. if (j1 == 10) {
  12303. RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  12304. int l2 = ai[l++] + 1;
  12305. if (l2 >= 0 && l2 < ItemDef.totalItems
  12306. && (!ItemDef.forID(l2).membersObject || isMembers)) {
  12307. for (int k3 = 0; k3 < class9_2.inv.length; k3++) {
  12308. if (class9_2.inv[k3] != l2)
  12309. continue;
  12310. k1 = 0x3b9ac9ff;
  12311. break;
  12312. }
  12313.  
  12314. }
  12315. }
  12316. if (j1 == 11)
  12317. k1 = energy;
  12318. if (j1 == 12)
  12319. k1 = weight;
  12320. if (j1 == 13) {
  12321. int i2 = variousSettings[ai[l++]];
  12322. int i3 = ai[l++];
  12323. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  12324. }
  12325. if (j1 == 14) {
  12326. int j2 = ai[l++];
  12327. VarBit varBit = VarBit.cache[j2];
  12328. int l3 = varBit.anInt648;
  12329. int i4 = varBit.anInt649;
  12330. int j4 = varBit.anInt650;
  12331. int k4 = anIntArray1232[j4 - i4];
  12332. k1 = variousSettings[l3] >> i4 & k4;
  12333. }
  12334. if (j1 == 15)
  12335. byte0 = 1;
  12336. if (j1 == 16)
  12337. byte0 = 2;
  12338. if (j1 == 17)
  12339. byte0 = 3;
  12340. if (j1 == 18)
  12341. k1 = (myPlayer.x >> 7) + baseX;
  12342. if (j1 == 19)
  12343. k1 = (myPlayer.y >> 7) + baseY;
  12344. if (j1 == 20)
  12345. k1 = ai[l++];
  12346. if (byte0 == 0) {
  12347. if (i1 == 0)
  12348. k += k1;
  12349. if (i1 == 1)
  12350. k -= k1;
  12351. if (i1 == 2 && k1 != 0)
  12352. k /= k1;
  12353. if (i1 == 3)
  12354. k *= k1;
  12355. i1 = 0;
  12356. } else {
  12357. i1 = byte0;
  12358. }
  12359. } while (true);
  12360. } catch (Exception _ex) {
  12361. return -1;
  12362. }
  12363. }
  12364.  
  12365. private void drawTooltip() {
  12366. if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  12367. return;
  12368. String s;
  12369. if (itemSelected == 1 && menuActionRow < 2)
  12370. s = "Use " + selectedItemName + " with...";
  12371. else if (spellSelected == 1 && menuActionRow < 2)
  12372. s = spellTooltip + "...";
  12373. else
  12374. s = menuActionName[menuActionRow - 1];
  12375. if (menuActionRow > 2)
  12376. s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  12377. chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  12378. }
  12379.  
  12380. private void drawMinimap() {
  12381. int x = isFullScreen ? 549 + extraWidth : 0;
  12382. int markY = isFullScreen ? 6 : 0;
  12383. int markX = isFullScreen ? 9 : 0;
  12384. if (!isFullScreen)
  12385. aRSImageProducer_1164.initDrawingArea();
  12386. if (anInt1021 == 2) {
  12387. byte abyte0[] = mapBack.aByteArray1450;
  12388. int ai[] = DrawingArea.pixels;
  12389. int k2 = abyte0.length;
  12390. for (int i5 = 0; i5 < k2; i5++)
  12391. if (abyte0[i5] == 0)
  12392. ai[i5] = 0;
  12393. aRSImageProducer_1165.initDrawingArea();
  12394. return;
  12395. }
  12396. int i = minimapInt1 + minimapInt2 & 0x7ff;
  12397. int j = 48 + myPlayer.x / 32;
  12398. int l2 = 464 - myPlayer.y / 32;
  12399. if (!isFullScreen) {
  12400. aClass30_Sub2_Sub1_Sub1_1263.method352(152, i, anIntArray1229,
  12401. 256 + minimapInt3, anIntArray1052, l2, 10, 32, 146, j);
  12402. }
  12403. if (isFullScreen) {
  12404. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229,
  12405. 256 + minimapInt3, anIntArray1052, l2, 12, 34 + x, 146, j);
  12406. }
  12407. if (!is474 && !isFullScreen) {
  12408. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229,
  12409. 256 + minimapInt3, anIntArray1052, l2, 9, 34 + x, 146, j);
  12410. }
  12411. if (is474 && !isFullScreen) {
  12412. aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229,
  12413. 256 + minimapInt3, anIntArray1052, l2, 9, 55, 146, j);
  12414. }
  12415. for (int j5 = 0; j5 < anInt1071; j5++) {
  12416. int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  12417. int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  12418. markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  12419. }
  12420.  
  12421. for (int k5 = 0; k5 < 104; k5++) {
  12422. for (int l5 = 0; l5 < 104; l5++) {
  12423. NodeList class19 = groundArray[plane][k5][l5];
  12424. if (class19 != null) {
  12425. int l = (k5 * 4 + 2) - myPlayer.x / 32;
  12426. int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  12427. markMinimap(mapDotItem, l, j3);
  12428. }
  12429. }
  12430. }
  12431.  
  12432. for (int i6 = 0; i6 < npcCount; i6++) {
  12433. NPC npc = npcArray[npcIndices[i6]];
  12434. if (npc != null && npc.isVisible()) {
  12435. EntityDef entityDef = npc.desc;
  12436. if (entityDef.childrenIDs != null)
  12437. entityDef = entityDef.method161();
  12438. if (entityDef != null && entityDef.aBoolean87
  12439. && entityDef.aBoolean84) {
  12440. int i1 = npc.x / 32 - myPlayer.x / 32;
  12441. int k3 = npc.y / 32 - myPlayer.y / 32;
  12442. markMinimap(mapDotNPC, i1, k3);
  12443. }
  12444. }
  12445. }
  12446.  
  12447. for (int j6 = 0; j6 < playerCount; j6++) {
  12448. Player player = playerArray[playerIndices[j6]];
  12449. if (player != null && player.isVisible()) {
  12450. int j1 = player.x / 32 - myPlayer.x / 32;
  12451. int l3 = player.y / 32 - myPlayer.y / 32;
  12452. boolean flag1 = false;
  12453. boolean flag3 = false;
  12454. for (int j3 = 0; j3 < clanList.length; j3++) {
  12455. if (clanList[j3] == null)
  12456. continue;
  12457. if (!clanList[j3].equalsIgnoreCase(player.name))
  12458. continue;
  12459. flag3 = true;
  12460. break;
  12461. }
  12462. long l6 = TextClass.longForName(player.name);
  12463. for (int k6 = 0; k6 < friendsCount; k6++) {
  12464. if (l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  12465. continue;
  12466. flag1 = true;
  12467. break;
  12468. }
  12469. boolean flag2 = false;
  12470. if (myPlayer.team != 0 && player.team != 0
  12471. && myPlayer.team == player.team)
  12472. flag2 = true;
  12473. if (flag1)
  12474. markMinimap(mapDotFriend, j1, l3);
  12475. else if (flag3)
  12476. markMinimap(mapDotClan, j1, l3);
  12477. else if (flag2)
  12478. markMinimap(mapDotTeam, j1, l3);
  12479. else
  12480. markMinimap(mapDotPlayer, j1, l3);
  12481. }
  12482. }
  12483.  
  12484. if (anInt855 != 0 && loopCycle % 20 < 10) {
  12485. if (anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  12486. NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  12487. if (class30_sub2_sub4_sub1_sub1_1 != null) {
  12488. int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x
  12489. / 32;
  12490. int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y
  12491. / 32;
  12492. method81(mapMarker, i4, k1);
  12493. }
  12494. }
  12495. if (anInt855 == 2) {
  12496. int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  12497. int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  12498. method81(mapMarker, j4, l1);
  12499. }
  12500. if (anInt855 == 10 && anInt933 >= 0
  12501. && anInt933 < playerArray.length) {
  12502. Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  12503. if (class30_sub2_sub4_sub1_sub2_1 != null) {
  12504. int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x
  12505. / 32;
  12506. int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y
  12507. / 32;
  12508. method81(mapMarker, k4, i2);
  12509. }
  12510. }
  12511. }
  12512. if (destX != 0) {
  12513. int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  12514. int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  12515. markMinimap(mapFlag, j2, l4);
  12516. }
  12517. if (is474 && !isFullScreen) {
  12518. DrawingArea.drawPixels(3, 84, 125, 0xffffff, 3);
  12519. }
  12520. if (!is474 && !isFullScreen) {
  12521. DrawingArea.drawPixels(3, 84, 105, 0xffffff, 3);
  12522. }
  12523. // mapBack.drawBackground(0, 0);
  12524. if (!is474 && !isFullScreen) {
  12525. compass.method352(33, minimapInt1, anIntArray1057, 256,
  12526. anIntArray968, 25, isFullScreen ? 12 : 8,
  12527. isFullScreen ? 30 + x : 8, 33, 25);
  12528. }
  12529. if (isFullScreen) {
  12530. compass.method352(33, minimapInt1, anIntArray1057, 256,
  12531. anIntArray968, 25, isFullScreen ? 12 : 8,
  12532. isFullScreen ? 30 + x : 8, 33, 25);
  12533. }
  12534. // Compass
  12535. if (is474 && !isFullScreen) {
  12536. compass.method352(33, minimapInt1, anIntArray1057, 256,
  12537. anIntArray968, 25, 4, 27, 33, 25);
  12538. }
  12539.  
  12540. if (isFullScreen) {
  12541. DrawingArea.drawPixels(3, 78 + markY, 97 + x + markX, 0xffffff, 3);
  12542. }
  12543. if (isFullScreen) {
  12544. mapArea[0].drawSprite(25 + x, 7);
  12545. }
  12546. if (!is474 && !isFullScreen) {
  12547. mapArea[1].drawSprite(0, 0);
  12548. }
  12549. if (is474 && !isFullScreen) {
  12550. mapArea[2].drawSprite(0, 0);
  12551. }
  12552. if (!hasBeenBlanked) {
  12553. aRSImageProducer_1164.blankImage();
  12554. hasBeenBlanked = true;
  12555. }
  12556. if (!is474) {
  12557. drawXPButton();
  12558. drawHPOrb();
  12559. drawPrayerOrb();
  12560. drawRunOrb();
  12561. drawSummOrb();
  12562. drawLogoutButton();
  12563. drawQuestionButton();
  12564. drawWorldMapButton();
  12565. }
  12566. if (menuOpen && menuScreenArea == 3) {
  12567. drawMenu();
  12568. }
  12569. aRSImageProducer_1165.initDrawingArea();
  12570. }
  12571.  
  12572. public static byte[] mac = new byte[4];
  12573. public static int macAdd = 0;
  12574.  
  12575. public void drawLogoutButton() {
  12576. int x = isFullScreen ? extraWidth + 510 : 0;
  12577. int y = isFullScreen ? -30 : 0;
  12578. if (tabInterfaceIDs[10] != -1 && anInt1054 == 9)
  12579. if (loopCycle % 20 >= 10)
  12580. ;
  12581. logoutIcon.drawSprite(225 + x, 0);
  12582. if (logIconHPos == 1) {
  12583. logIconH.drawSprite(225 + x, 0);
  12584. }
  12585. if (tabID == 10)
  12586. logIconC.drawSprite(225 + x, 0);
  12587. }
  12588.  
  12589. public void drawQuestionButton() {
  12590. int x = isFullScreen ? extraWidth + 510 : 0;
  12591. int y = isFullScreen ? -30 : 0;
  12592. if (tabInterfaceIDs[11] != -1 && anInt1054 == 9)
  12593. if (loopCycle % 20 >= 11)
  12594. ;
  12595. questionIcon.drawSprite(204 + x, 0);
  12596. if (questionIconHPos == 1) {
  12597. questionIconH.drawSprite(204 + x, 0);
  12598. }
  12599. }
  12600.  
  12601. public int logIconHPos = 0;
  12602. public int questionIconHPos = 0;
  12603. public int xpIconHPos = 0;
  12604.  
  12605. public void drawWorldMapButton() {
  12606. int x = isFullScreen ? 700 + extraWidth : 0;
  12607. int y = isFullScreen ? -0 : 0;
  12608.  
  12609. int xm = isFullScreen ? 706 + extraWidth : 0;
  12610. int ym = isFullScreen ? +5 : 0;
  12611. if (isFullScreen) {
  12612. mapRing.drawSprite(8 + x, 124 + y);
  12613. }
  12614. worldMapIcon.drawSprite(8 + xm, 124 + ym);
  12615. }
  12616.  
  12617. public void processMapAreaClick() {
  12618. int x = isFullScreen ? extraWidth + 17 : 0;
  12619. int y = isFullScreen ? -30 : 0;
  12620.  
  12621. int x29 = isFullScreen ? extraWidth : 0;
  12622.  
  12623. int x2 = isFullScreen ? 358 + extraWidth : 0;
  12624. int y2 = isFullScreen ? +32 : 0;
  12625. if (!is474) {
  12626. // Logout Button
  12627. if (super.mouseX >= 742 + x29 && super.mouseX <= 764 + x29
  12628. && super.mouseY >= 1 && super.mouseY <= 23) {
  12629. logIconHPos = 1;
  12630. } else {
  12631. logIconHPos = 0;
  12632. }
  12633. // XP Button
  12634. if (super.mouseX >= 519 + x && super.mouseX <= 550 + x
  12635. && super.mouseY >= 50 + y && super.mouseY <= 78 + y) {
  12636. xpIconHPos = 1;
  12637. } else {
  12638. xpIconHPos = 0;
  12639. }
  12640. // Advisor Button
  12641. if (super.mouseX >= 724 + x29 && super.mouseX <= 741 + x29
  12642. && super.mouseY >= 1 && super.mouseY <= 23) {
  12643. questionIconHPos = 1;
  12644. } else {
  12645. questionIconHPos = 0;
  12646. }
  12647. if (super.clickMode3 == 1 && super.saveClickX >= 516
  12648. && super.saveClickX <= 550 && super.saveClickY >= 46
  12649. && super.saveClickY <= 80) {
  12650. if (!xpClicked) {
  12651. xpClicked = true;
  12652. drawXpBar = true;
  12653. } else {
  12654. xpClicked = false;
  12655. drawXpBar = false;
  12656. }
  12657. }
  12658. }
  12659. }
  12660.  
  12661. public void drawXPButton() {
  12662. int x = isFullScreen ? 535 + extraWidth : 0;
  12663. int y = isFullScreen ? -36 : 0;
  12664. if (tabInterfaceIDs[12] != -1 && anInt1054 == 9)
  12665. if (loopCycle % 20 >= 12)
  12666. ;
  12667. xpIcon.drawSprite(0 + x, 47 + y);
  12668. if (xpIconHPos == 1) {
  12669. xpIconH.drawSprite(0 + x, 47 + y);
  12670. }
  12671. }
  12672.  
  12673. private void npcScreenPos(Entity entity, int i) {
  12674. calcEntityScreenPos(entity.x, i, entity.y);
  12675. }
  12676.  
  12677. private void calcEntityScreenPos(int i, int j, int l) {
  12678. if (i < 128 || l < 128 || i > 13056 || l > 13056) {
  12679. spriteDrawX = -1;
  12680. spriteDrawY = -1;
  12681. return;
  12682. }
  12683. int i1 = method42(plane, l, i) - j;
  12684. i -= xCameraPos;
  12685. i1 -= zCameraPos;
  12686. l -= yCameraPos;
  12687. int j1 = Model.modelIntArray1[yCameraCurve];
  12688. int k1 = Model.modelIntArray2[yCameraCurve];
  12689. int l1 = Model.modelIntArray1[xCameraCurve];
  12690. int i2 = Model.modelIntArray2[xCameraCurve];
  12691. int j2 = l * l1 + i * i2 >> 16;
  12692. l = l * i2 - i * l1 >> 16;
  12693. i = j2;
  12694. j2 = i1 * k1 - l * j1 >> 16;
  12695. l = i1 * j1 + l * k1 >> 16;
  12696. i1 = j2;
  12697. if (l >= 50) {
  12698. spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  12699. spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  12700. } else {
  12701. spriteDrawX = -1;
  12702. spriteDrawY = -1;
  12703. }
  12704. }
  12705.  
  12706. private void buildSplitPrivateChatMenu() {
  12707. if (splitPrivateChat == 0)
  12708. return;
  12709. int i = 0;
  12710. if (anInt1104 != 0)
  12711. i = 1;
  12712. for (int j = 0; j < 100; j++)
  12713. if (chatMessages[j] != null) {
  12714. int k = chatTypes[j];
  12715. String s = chatNames[j];
  12716. boolean flag1 = false;
  12717. if ((k == 3 || k == 7)
  12718. && (k == 7 || privateChatMode == 0 || privateChatMode == 1
  12719. && isFriendOrSelf(s))) {
  12720. int l = 329 - i * 13;
  12721. if (super.mouseX > 4
  12722. && super.mouseY - 4 > l - 10 + extraHeight
  12723. && super.mouseY - 4 <= l + 3 + extraHeight) {
  12724. int i1 = aTextDrawingArea_1271.getTextWidth("From: "
  12725. + s + chatMessages[j]) + 25;
  12726. if (i1 > 450)
  12727. i1 = 450;
  12728. if (super.mouseX < 4 + i1) {
  12729. if (myPrivilege >= 1) {
  12730. menuActionName[menuActionRow] = "Report abuse @whi@"
  12731. + s;
  12732. menuActionID[menuActionRow] = 606;
  12733. menuActionRow++;
  12734. }
  12735. menuActionName[menuActionRow] = "Add ignore @whi@"
  12736. + s;
  12737. menuActionID[menuActionRow] = 42;
  12738. menuActionRow++;
  12739. // "Message @whi@"
  12740. menuActionName[menuActionRow] = "Reply to @whi@"
  12741. + s;
  12742. menuActionID[menuActionRow] = 639;
  12743. menuActionRow++;
  12744. menuActionName[menuActionRow] = "Add friend @whi@"
  12745. + s;
  12746. menuActionID[menuActionRow] = 337;
  12747. menuActionRow++;
  12748. }
  12749. }
  12750. if (++i >= 5)
  12751. return;
  12752. }
  12753. if ((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  12754. return;
  12755. }
  12756.  
  12757. }
  12758.  
  12759. private void method130(int j, int k, int l, int i1, int j1, int k1, int l1,
  12760. int i2, int j2) {
  12761. Class30_Sub1 class30_sub1 = null;
  12762. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  12763. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  12764. .reverseGetNext()) {
  12765. if (class30_sub1_1.anInt1295 != l1
  12766. || class30_sub1_1.anInt1297 != i2
  12767. || class30_sub1_1.anInt1298 != j1
  12768. || class30_sub1_1.anInt1296 != i1)
  12769. continue;
  12770. class30_sub1 = class30_sub1_1;
  12771. break;
  12772. }
  12773.  
  12774. if (class30_sub1 == null) {
  12775. class30_sub1 = new Class30_Sub1();
  12776. class30_sub1.anInt1295 = l1;
  12777. class30_sub1.anInt1296 = i1;
  12778. class30_sub1.anInt1297 = i2;
  12779. class30_sub1.anInt1298 = j1;
  12780. method89(class30_sub1);
  12781. aClass19_1179.insertHead(class30_sub1);
  12782. }
  12783. class30_sub1.anInt1291 = k;
  12784. class30_sub1.anInt1293 = k1;
  12785. class30_sub1.anInt1292 = l;
  12786. class30_sub1.anInt1302 = j2;
  12787. class30_sub1.anInt1294 = j;
  12788. }
  12789.  
  12790. private boolean interfaceIsSelected(RSInterface class9) {
  12791. if (class9.anIntArray245 == null)
  12792. return false;
  12793. for (int i = 0; i < class9.anIntArray245.length; i++) {
  12794. int j = extractInterfaceValues(class9, i);
  12795. int k = class9.anIntArray212[i];
  12796. if (class9.anIntArray245[i] == 2) {
  12797. if (j >= k)
  12798. return false;
  12799. } else if (class9.anIntArray245[i] == 3) {
  12800. if (j <= k)
  12801. return false;
  12802. } else if (class9.anIntArray245[i] == 4) {
  12803. if (j == k)
  12804. return false;
  12805. } else if (j != k)
  12806. return false;
  12807. }
  12808.  
  12809. return true;
  12810. }
  12811.  
  12812. private DataInputStream openJagGrabInputStream(String s) throws IOException {
  12813. // if(!aBoolean872)
  12814. // if(signlink.mainapp != null)
  12815. // return signlink.openurl(s);
  12816. // else
  12817. // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  12818. if (aSocket832 != null) {
  12819. try {
  12820. aSocket832.close();
  12821. } catch (Exception _ex) {
  12822. }
  12823. aSocket832 = null;
  12824. }
  12825. aSocket832 = openSocket(43601);
  12826. aSocket832.setSoTimeout(10000);
  12827. InputStream inputstream = aSocket832.getInputStream();
  12828. OutputStream outputstream = aSocket832.getOutputStream();
  12829. outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  12830. return new DataInputStream(inputstream);
  12831. }
  12832.  
  12833. private void doFlamesDrawing() {
  12834. char c = '\u0100';
  12835. if (anInt1040 > 0) {
  12836. for (int i = 0; i < 256; i++)
  12837. if (anInt1040 > 768)
  12838. anIntArray850[i] = method83(anIntArray851[i],
  12839. anIntArray852[i], 1024 - anInt1040);
  12840. else if (anInt1040 > 256)
  12841. anIntArray850[i] = anIntArray852[i];
  12842. else
  12843. anIntArray850[i] = method83(anIntArray852[i],
  12844. anIntArray851[i], 256 - anInt1040);
  12845.  
  12846. } else if (anInt1041 > 0) {
  12847. for (int j = 0; j < 256; j++)
  12848. if (anInt1041 > 768)
  12849. anIntArray850[j] = method83(anIntArray851[j],
  12850. anIntArray853[j], 1024 - anInt1041);
  12851. else if (anInt1041 > 256)
  12852. anIntArray850[j] = anIntArray853[j];
  12853. else
  12854. anIntArray850[j] = method83(anIntArray853[j],
  12855. anIntArray851[j], 256 - anInt1041);
  12856.  
  12857. } else {
  12858. System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  12859.  
  12860. }
  12861. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0,
  12862. aRSImageProducer_1110.anIntArray315, 0, 33920);
  12863.  
  12864. int i1 = 0;
  12865. int j1 = 1152;
  12866. for (int k1 = 1; k1 < c - 1; k1++) {
  12867. int l1 = (anIntArray969[k1] * (c - k1)) / c;
  12868. int j2 = 22 + l1;
  12869. if (j2 < 0)
  12870. j2 = 0;
  12871. i1 += j2;
  12872. for (int l2 = j2; l2 < 128; l2++) {
  12873. int j3 = anIntArray828[i1++];
  12874. if (j3 != 0) {
  12875. j1++;
  12876. }
  12877. }
  12878.  
  12879. j1 += j2;
  12880. }
  12881.  
  12882. aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  12883. System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0,
  12884. aRSImageProducer_1111.anIntArray315, 0, 33920);
  12885.  
  12886. i1 = 0;
  12887. j1 = 1176;
  12888. for (int k2 = 1; k2 < c - 1; k2++) {
  12889. int i3 = (anIntArray969[k2] * (c - k2)) / c;
  12890. int k3 = 103 - i3;
  12891. j1 += i3;
  12892. for (int i4 = 0; i4 < k3; i4++) {
  12893. int k4 = anIntArray828[i1++];
  12894. if (k4 != 0) {
  12895. j1++;
  12896. }
  12897. }
  12898.  
  12899. i1 += 128 - k3;
  12900. j1 += 128 - k3 - i3;
  12901. }
  12902.  
  12903. aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  12904. }
  12905.  
  12906. private void method134(Stream stream) {
  12907. int j = stream.readBits(8);
  12908. if (j < playerCount) {
  12909. for (int k = j; k < playerCount; k++)
  12910. anIntArray840[anInt839++] = playerIndices[k];
  12911.  
  12912. }
  12913. if (j > playerCount) {
  12914. signlink.reporterror(myUsername + " Too many players");
  12915. throw new RuntimeException("eek");
  12916. }
  12917. playerCount = 0;
  12918. for (int l = 0; l < j; l++) {
  12919. int i1 = playerIndices[l];
  12920. Player player = playerArray[i1];
  12921. int j1 = stream.readBits(1);
  12922. if (j1 == 0) {
  12923. playerIndices[playerCount++] = i1;
  12924. player.anInt1537 = loopCycle;
  12925. } else {
  12926. int k1 = stream.readBits(2);
  12927. if (k1 == 0) {
  12928. playerIndices[playerCount++] = i1;
  12929. player.anInt1537 = loopCycle;
  12930. anIntArray894[anInt893++] = i1;
  12931. } else if (k1 == 1) {
  12932. playerIndices[playerCount++] = i1;
  12933. player.anInt1537 = loopCycle;
  12934. int l1 = stream.readBits(3);
  12935. player.moveInDir(false, l1);
  12936. int j2 = stream.readBits(1);
  12937. if (j2 == 1)
  12938. anIntArray894[anInt893++] = i1;
  12939. } else if (k1 == 2) {
  12940. playerIndices[playerCount++] = i1;
  12941. player.anInt1537 = loopCycle;
  12942. int i2 = stream.readBits(3);
  12943. player.moveInDir(true, i2);
  12944. int k2 = stream.readBits(3);
  12945. player.moveInDir(true, k2);
  12946. int l2 = stream.readBits(1);
  12947. if (l2 == 1)
  12948. anIntArray894[anInt893++] = i1;
  12949. } else if (k1 == 3)
  12950. anIntArray840[anInt839++] = i1;
  12951. }
  12952. }
  12953. }
  12954.  
  12955. public int count, opacityCount;
  12956. private static int backgroundCount = (int) (Math.random() * 5);
  12957. public boolean isTextCursor = false;
  12958.  
  12959. public void setTextCursor() {
  12960. isTextCursor = true;
  12961. Cursor cursor = new Cursor(Cursor.TEXT_CURSOR);
  12962. getGameComponent().setCursor(cursor);
  12963. }
  12964.  
  12965. public void setDefaultCursor() {
  12966. isTextCursor = false;
  12967. getGameComponent().setCursor(Cursor.getDefaultCursor());
  12968. }
  12969.  
  12970. public static String capitalize(String s) {
  12971. for (int i = 0; i < s.length(); i++) {
  12972. if (i == 0) {
  12973. s = String.format("%s%s", Character.toUpperCase(s.charAt(0)),
  12974. s.substring(1));
  12975. }
  12976. if (!Character.isLetterOrDigit(s.charAt(i))) {
  12977. if (i + 1 < s.length()) {
  12978. s = String.format("%s%s%s", s.subSequence(0, i + 1),
  12979. Character.toUpperCase(s.charAt(i + 1)),
  12980. s.substring(i + 2));
  12981. }
  12982. }
  12983. }
  12984. return s;
  12985. }
  12986.  
  12987. private Sprite loginButton;
  12988. private Sprite loginButtonHover;
  12989. private Sprite textBox;
  12990. private Sprite textBoxHover;
  12991. public boolean drawed;
  12992.  
  12993. public void drawLoginScreen() {
  12994. try {
  12995. if (count == 0) {
  12996. Sprite sprite = new Sprite("background/BG " + backgroundCount);
  12997. sprite.drawSpriteWithOpacity(0, 0, opacityCount);
  12998. if (backgroundCount == 2)
  12999. backgroundCount = 0;
  13000. else
  13001. backgroundCount++;
  13002. }
  13003. if (count >= 100) {
  13004. opacityCount++;
  13005. Sprite sprite = new Sprite("background/BG " + backgroundCount);
  13006. sprite.drawSpriteWithOpacity(0, 0, opacityCount);
  13007. }
  13008. if (count == 250) {
  13009. count = 0;
  13010. opacityCount = 0;
  13011. } else {
  13012. count++;
  13013. }
  13014.  
  13015. String caret = (loopCycle % 40 < 20) ? "|" : "";
  13016. char c = '\u0168';
  13017. char c1 = '\310';
  13018. int yPos = 140;
  13019.  
  13020. resetImageProducers();
  13021. loginScreenArea.initDrawingArea();
  13022. loginBox.drawBackground(253, yPos);
  13023. smallText.method382(0xffff00, 378, "MouseX: " + super.mouseX
  13024. + " MouseY: " + super.mouseY, 160, true);
  13025. if (loginScreenState == 0) {
  13026. new Color(0);
  13027. DrawingArea.drawHorizontalLine(yPos += 38, 0x1B1717, 220,
  13028. 252 + 23);
  13029. DrawingArea.drawHorizontalLine(yPos += 1, 0x2C2A29, 220,
  13030. 252 + 23);
  13031.  
  13032. smallText.drawText(0xEBE0BC, "Username:", yPos += 15, 253 + 50);
  13033. textBox.drawSprite(251 + 23, yPos += 5);
  13034. if (mouseIn(251 + 23, yPos + 2, 218, 27))
  13035. textBoxHover.drawSprite(251 + 23, yPos + 1);
  13036. smallText.method389(false, 281, 0xffffff,
  13037. capitalize(myUsername)
  13038. + (loginScreenCursorPos == 0 ? caret : ""),
  13039. yPos + 17);
  13040.  
  13041. smallText.drawText(0xEBE0BC, "Password:", yPos += 40, 253 + 50);
  13042. textBox.drawSprite(251 + 23, yPos += 5);
  13043. if (mouseIn(251 + 23, yPos + 2, 218, 27))
  13044. textBoxHover.drawSprite(251 + 23, yPos + 1);
  13045. smallText.method389(false, 281, 0xffffff,
  13046. TextClass.passwordAsterisks(myPassword)
  13047. + (loginScreenCursorPos == 1 ? caret : ""),
  13048. yPos + 17);
  13049.  
  13050. DrawingArea.drawHorizontalLine(yPos += 35, 0x1B1717, 220,
  13051. 252 + 23);
  13052. DrawingArea.drawHorizontalLine(yPos += 1, 0x2C2A29, 220,
  13053. 252 + 23);
  13054.  
  13055. loginButton.drawSprite(251 + 43, yPos += 9);
  13056. if (mouseIn(251 + 43, yPos + 2, 181, 27))
  13057. loginButtonHover.drawSprite(251 + 43, yPos);
  13058. aTextDrawingArea_1271.drawText(0, "Log In", yPos + 18,
  13059. 251 + 43 + 90);
  13060.  
  13061. loginButton.drawSprite(251 + 43, yPos += 35);
  13062. if (mouseIn(251 + 43, yPos + 2, 181, 27))
  13063. loginButtonHover.drawSprite(251 + 43, yPos);
  13064. aTextDrawingArea_1271.drawText(0, "Setup Profiles", yPos + 18,
  13065. 251 + 43 + 90);
  13066.  
  13067. DrawingArea.drawHorizontalLine(yPos += 36, 0x1B1717, 220,
  13068. 252 + 23);
  13069. DrawingArea.drawHorizontalLine(yPos += 1, 0x2C2A29, 220,
  13070. 252 + 23);
  13071.  
  13072. smallText.method382(0xffffff, 385, loginMessage1, yPos += 15,
  13073. true);
  13074. smallText.method382(0xffffff, 385, loginMessage2, yPos += 15,
  13075. true);
  13076. }
  13077. loginScreenArea.drawGraphics(0, super.graphics, 0);
  13078. } catch (Exception ex) {
  13079. System.out.println(ex);
  13080. }
  13081. }
  13082.  
  13083. private boolean mouseIn(int x, int y, int w, int h) {
  13084. return (super.mouseX > x && super.mouseX <= x + w && super.mouseY > y && super.mouseY <= y
  13085. + h);
  13086. }
  13087.  
  13088. private boolean clickedIn(int x, int y, int w, int h) {
  13089. return super.clickMode3 == 1
  13090. && (super.saveClickX > x && super.saveClickX <= x + w
  13091. && super.saveClickY > y && super.saveClickY <= y + h);
  13092. }
  13093.  
  13094. private void drawFlames() {
  13095. }
  13096.  
  13097. public void raiseWelcomeScreen() {
  13098. welcomeScreenRaised = true;
  13099. }
  13100.  
  13101. private void method137(Stream stream, int j) {
  13102. if (j == 84) {
  13103. int k = stream.readUnsignedByte();
  13104. int j3 = anInt1268 + (k >> 4 & 7);
  13105. int i6 = anInt1269 + (k & 7);
  13106. int l8 = stream.readUnsignedWord();
  13107. int k11 = stream.readUnsignedWord();
  13108. int l13 = stream.readUnsignedWord();
  13109. if (j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104) {
  13110. NodeList class19_1 = groundArray[plane][j3][i6];
  13111. if (class19_1 != null) {
  13112. for (Item class30_sub2_sub4_sub2_3 = (Item) class19_1
  13113. .reverseGetFirst(); class30_sub2_sub4_sub2_3 != null; class30_sub2_sub4_sub2_3 = (Item) class19_1
  13114. .reverseGetNext()) {
  13115. if (class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff)
  13116. || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  13117. continue;
  13118. class30_sub2_sub4_sub2_3.anInt1559 = l13;
  13119. break;
  13120. }
  13121.  
  13122. spawnGroundItem(j3, i6);
  13123. }
  13124. }
  13125. return;
  13126. }
  13127. if (j == 105) {
  13128. int l = stream.readUnsignedByte();
  13129. int k3 = anInt1268 + (l >> 4 & 7);
  13130. int j6 = anInt1269 + (l & 7);
  13131. int i9 = stream.readUnsignedWord();
  13132. int l11 = stream.readUnsignedByte();
  13133. int i14 = l11 >> 4 & 0xf;
  13134. int i16 = l11 & 7;
  13135. if (myPlayer.smallX[0] >= k3 - i14
  13136. && myPlayer.smallX[0] <= k3 + i14
  13137. && myPlayer.smallY[0] >= j6 - i14
  13138. && myPlayer.smallY[0] <= j6 + i14 && aBoolean848 && !lowMem
  13139. && anInt1062 < 50) {
  13140. anIntArray1207[anInt1062] = i9;
  13141. anIntArray1241[anInt1062] = i16;
  13142. anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  13143. anInt1062++;
  13144. }
  13145. }
  13146. if (j == 215) {
  13147. int i1 = stream.method435();
  13148. int l3 = stream.method428();
  13149. int k6 = anInt1268 + (l3 >> 4 & 7);
  13150. int j9 = anInt1269 + (l3 & 7);
  13151. int i12 = stream.method435();
  13152. int j14 = stream.readUnsignedWord();
  13153. if (k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104
  13154. && i12 != unknownInt10) {
  13155. Item class30_sub2_sub4_sub2_2 = new Item();
  13156. class30_sub2_sub4_sub2_2.ID = i1;
  13157. class30_sub2_sub4_sub2_2.anInt1559 = j14;
  13158. if (groundArray[plane][k6][j9] == null)
  13159. groundArray[plane][k6][j9] = new NodeList();
  13160. groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  13161. spawnGroundItem(k6, j9);
  13162. }
  13163. return;
  13164. }
  13165. if (j == 156) {
  13166. int j1 = stream.method426();
  13167. int i4 = anInt1268 + (j1 >> 4 & 7);
  13168. int l6 = anInt1269 + (j1 & 7);
  13169. int k9 = stream.readUnsignedWord();
  13170. if (i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104) {
  13171. NodeList class19 = groundArray[plane][i4][l6];
  13172. if (class19 != null) {
  13173. for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
  13174. .reverseGetNext()) {
  13175. if (item.ID != (k9 & 0x7fff))
  13176. continue;
  13177. item.unlink();
  13178. break;
  13179. }
  13180.  
  13181. if (class19.reverseGetFirst() == null)
  13182. groundArray[plane][i4][l6] = null;
  13183. spawnGroundItem(i4, l6);
  13184. }
  13185. }
  13186. return;
  13187. }
  13188. if (j == 160) {
  13189. int k1 = stream.method428();
  13190. int j4 = anInt1268 + (k1 >> 4 & 7);
  13191. int i7 = anInt1269 + (k1 & 7);
  13192. int l9 = stream.method428();
  13193. int j12 = l9 >> 2;
  13194. int k14 = l9 & 3;
  13195. int j16 = anIntArray1177[j12];
  13196. int j17 = stream.method435();
  13197. if (j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103) {
  13198. int j18 = intGroundArray[plane][j4][i7];
  13199. int i19 = intGroundArray[plane][j4 + 1][i7];
  13200. int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  13201. int k20 = intGroundArray[plane][j4][i7 + 1];
  13202. if (j16 == 0) {
  13203. Object1 class10 = worldController.method296(plane, j4, i7);
  13204. if (class10 != null) {
  13205. int k21 = class10.uid >> 14 & 0x7fff;
  13206. if (j12 == 2) {
  13207. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  13208. k21, 4 + k14, 2, i19, l19, j18, k20, j17,
  13209. false);
  13210. class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(
  13211. k21, k14 + 1 & 3, 2, i19, l19, j18, k20,
  13212. j17, false);
  13213. } else {
  13214. class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(
  13215. k21, k14, j12, i19, l19, j18, k20, j17,
  13216. false);
  13217. }
  13218. }
  13219. }
  13220. if (j16 == 1) {
  13221. Object2 class26 = worldController.method297(j4, i7, plane);
  13222. if (class26 != null)
  13223. class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(
  13224. class26.uid >> 14 & 0x7fff, 0, 4, i19, l19,
  13225. j18, k20, j17, false);
  13226. }
  13227. if (j16 == 2) {
  13228. Object5 class28 = worldController.method298(j4, i7, plane);
  13229. if (j12 == 11)
  13230. j12 = 10;
  13231. if (class28 != null)
  13232. class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(
  13233. class28.uid >> 14 & 0x7fff, k14, j12, i19, l19,
  13234. j18, k20, j17, false);
  13235. }
  13236. if (j16 == 3) {
  13237. Object3 class49 = worldController.method299(i7, j4, plane);
  13238. if (class49 != null)
  13239. class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(
  13240. class49.uid >> 14 & 0x7fff, k14, 22, i19, l19,
  13241. j18, k20, j17, false);
  13242. }
  13243. }
  13244. return;
  13245. }
  13246. if (j == 147) {
  13247. int l1 = stream.method428();
  13248. int k4 = anInt1268 + (l1 >> 4 & 7);
  13249. int j7 = anInt1269 + (l1 & 7);
  13250. int i10 = stream.readUnsignedWord();
  13251. byte byte0 = stream.method430();
  13252. int l14 = stream.method434();
  13253. byte byte1 = stream.method429();
  13254. int k17 = stream.readUnsignedWord();
  13255. int k18 = stream.method428();
  13256. int j19 = k18 >> 2;
  13257. int i20 = k18 & 3;
  13258. int l20 = anIntArray1177[j19];
  13259. byte byte2 = stream.readSignedByte();
  13260. int l21 = stream.readUnsignedWord();
  13261. byte byte3 = stream.method429();
  13262. Player player;
  13263. if (i10 == unknownInt10)
  13264. player = myPlayer;
  13265. else
  13266. player = playerArray[i10];
  13267. if (player != null) {
  13268. ObjectDef class46 = ObjectDef.forID(l21);
  13269. int i22 = intGroundArray[plane][k4][j7];
  13270. int j22 = intGroundArray[plane][k4 + 1][j7];
  13271. int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  13272. int l22 = intGroundArray[plane][k4][j7 + 1];
  13273. Model model = class46.method578(j19, i20, i22, j22, k22, l22,
  13274. -1);
  13275. if (model != null) {
  13276. method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  13277. player.anInt1707 = l14 + loopCycle;
  13278. player.anInt1708 = k17 + loopCycle;
  13279. player.aModel_1714 = model;
  13280. int i23 = class46.anInt744;
  13281. int j23 = class46.anInt761;
  13282. if (i20 == 1 || i20 == 3) {
  13283. i23 = class46.anInt761;
  13284. j23 = class46.anInt744;
  13285. }
  13286. player.anInt1711 = k4 * 128 + i23 * 64;
  13287. player.anInt1713 = j7 * 128 + j23 * 64;
  13288. player.anInt1712 = method42(plane, player.anInt1713,
  13289. player.anInt1711);
  13290. if (byte2 > byte0) {
  13291. byte byte4 = byte2;
  13292. byte2 = byte0;
  13293. byte0 = byte4;
  13294. }
  13295. if (byte3 > byte1) {
  13296. byte byte5 = byte3;
  13297. byte3 = byte1;
  13298. byte1 = byte5;
  13299. }
  13300. player.anInt1719 = k4 + byte2;
  13301. player.anInt1721 = k4 + byte0;
  13302. player.anInt1720 = j7 + byte3;
  13303. player.anInt1722 = j7 + byte1;
  13304. }
  13305. }
  13306. }
  13307. if (j == 151) {
  13308. int i2 = stream.method426();
  13309. int l4 = anInt1268 + (i2 >> 4 & 7);
  13310. int k7 = anInt1269 + (i2 & 7);
  13311. int j10 = stream.method434();
  13312. int k12 = stream.method428();
  13313. int i15 = k12 >> 2;
  13314. int k16 = k12 & 3;
  13315. int l17 = anIntArray1177[i15];
  13316. if (l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  13317. method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  13318. return;
  13319. }
  13320. if (j == 4) {
  13321. int j2 = stream.readUnsignedByte();
  13322. int i5 = anInt1268 + (j2 >> 4 & 7);
  13323. int l7 = anInt1269 + (j2 & 7);
  13324. int k10 = stream.readUnsignedWord();
  13325. int l12 = stream.readUnsignedByte();
  13326. int j15 = stream.readUnsignedWord();
  13327. if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) {
  13328. i5 = i5 * 128 + 64;
  13329. l7 = l7 * 128 + 64;
  13330. Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane,
  13331. loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7,
  13332. i5);
  13333. aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  13334. }
  13335. return;
  13336. }
  13337. if (j == 44) {
  13338. int k2 = stream.method436();
  13339. int j5 = stream.readUnsignedWord();
  13340. int i8 = stream.readUnsignedByte();
  13341. int l10 = anInt1268 + (i8 >> 4 & 7);
  13342. int i13 = anInt1269 + (i8 & 7);
  13343. if (l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104) {
  13344. Item class30_sub2_sub4_sub2_1 = new Item();
  13345. class30_sub2_sub4_sub2_1.ID = k2;
  13346. class30_sub2_sub4_sub2_1.anInt1559 = j5;
  13347. if (groundArray[plane][l10][i13] == null)
  13348. groundArray[plane][l10][i13] = new NodeList();
  13349. groundArray[plane][l10][i13]
  13350. .insertHead(class30_sub2_sub4_sub2_1);
  13351. spawnGroundItem(l10, i13);
  13352. }
  13353. return;
  13354. }
  13355. if (j == 101) {
  13356. int l2 = stream.method427();
  13357. int k5 = l2 >> 2;
  13358. int j8 = l2 & 3;
  13359. int i11 = anIntArray1177[k5];
  13360. int j13 = stream.readUnsignedByte();
  13361. int k15 = anInt1268 + (j13 >> 4 & 7);
  13362. int l16 = anInt1269 + (j13 & 7);
  13363. if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  13364. method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  13365. return;
  13366. }
  13367. if (j == 117) {
  13368. int i3 = stream.readUnsignedByte();
  13369. int l5 = anInt1268 + (i3 >> 4 & 7);
  13370. int k8 = anInt1269 + (i3 & 7);
  13371. int j11 = l5 + stream.readSignedByte();
  13372. int k13 = k8 + stream.readSignedByte();
  13373. int l15 = stream.readSignedWord();
  13374. int i17 = stream.readUnsignedWord();
  13375. int i18 = stream.readUnsignedByte() * 4;
  13376. int l18 = stream.readUnsignedByte() * 4;
  13377. int k19 = stream.readUnsignedWord();
  13378. int j20 = stream.readUnsignedWord();
  13379. int i21 = stream.readUnsignedByte();
  13380. int j21 = stream.readUnsignedByte();
  13381. if (l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0
  13382. && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535) {
  13383. l5 = l5 * 128 + 64;
  13384. k8 = k8 * 128 + 64;
  13385. j11 = j11 * 128 + 64;
  13386. k13 = k13 * 128 + 64;
  13387. Animable_Sub4 class30_sub2_sub4_sub4 = new Animable_Sub4(i21,
  13388. l18, k19 + loopCycle, j20 + loopCycle, j21, plane,
  13389. method42(plane, k8, l5) - i18, k8, l5, l15, i17);
  13390. class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13,
  13391. method42(plane, k13, j11) - l18, j11);
  13392. aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  13393. }
  13394. }
  13395. }
  13396.  
  13397. private static void setLowMem() {
  13398. WorldController.lowMem = true;
  13399. Texture.lowMem = true;
  13400. lowMem = true;
  13401. ObjectManager.lowMem = true;
  13402. ObjectDef.lowMem = true;
  13403. }
  13404.  
  13405. private void method139(Stream stream) {
  13406. stream.initBitAccess();
  13407. int k = stream.readBits(8);
  13408. if (k < npcCount) {
  13409. for (int l = k; l < npcCount; l++)
  13410. anIntArray840[anInt839++] = npcIndices[l];
  13411.  
  13412. }
  13413. if (k > npcCount) {
  13414. signlink.reporterror(myUsername + " Too many npcs");
  13415. throw new RuntimeException("eek");
  13416. }
  13417. npcCount = 0;
  13418. for (int i1 = 0; i1 < k; i1++) {
  13419. int j1 = npcIndices[i1];
  13420. NPC npc = npcArray[j1];
  13421. int k1 = stream.readBits(1);
  13422. if (k1 == 0) {
  13423. npcIndices[npcCount++] = j1;
  13424. npc.anInt1537 = loopCycle;
  13425. } else {
  13426. int l1 = stream.readBits(2);
  13427. if (l1 == 0) {
  13428. npcIndices[npcCount++] = j1;
  13429. npc.anInt1537 = loopCycle;
  13430. anIntArray894[anInt893++] = j1;
  13431. } else if (l1 == 1) {
  13432. npcIndices[npcCount++] = j1;
  13433. npc.anInt1537 = loopCycle;
  13434. int i2 = stream.readBits(3);
  13435. npc.moveInDir(false, i2);
  13436. int k2 = stream.readBits(1);
  13437. if (k2 == 1)
  13438. anIntArray894[anInt893++] = j1;
  13439. } else if (l1 == 2) {
  13440. npcIndices[npcCount++] = j1;
  13441. npc.anInt1537 = loopCycle;
  13442. int j2 = stream.readBits(3);
  13443. npc.moveInDir(true, j2);
  13444. int l2 = stream.readBits(3);
  13445. npc.moveInDir(true, l2);
  13446. int i3 = stream.readBits(1);
  13447. if (i3 == 1)
  13448. anIntArray894[anInt893++] = j1;
  13449. } else if (l1 == 3)
  13450. anIntArray840[anInt839++] = j1;
  13451. }
  13452. }
  13453.  
  13454. }
  13455.  
  13456. public void processLoginScreenInput() {
  13457. if (loginScreenState == 0) {
  13458. int yPos = 200;
  13459. if (clickedIn(251 + 23, yPos, 221, 27))
  13460. loginScreenCursorPos = 0;
  13461. if (clickedIn(251 + 23, yPos += 45, 221, 27))
  13462. loginScreenCursorPos = 1;
  13463. if (clickedIn(251 + 43, yPos += 47, 181, 27)) {
  13464. loginFailures = 0;
  13465. login(myUsername, myPassword, false);
  13466. try {
  13467. Client.writeSettings();
  13468. } catch (IOException ignore) {
  13469. }
  13470. if (loggedIn)
  13471. return;
  13472. }
  13473. if (clickedIn(251 + 43, yPos += 34, 181, 27))
  13474. System.out.println("Setup");
  13475. processLoginTextInput();
  13476. }
  13477. }
  13478.  
  13479. private void processLoginTextInput() {
  13480. do {
  13481. int l1 = readChar(-796);
  13482. if (l1 == -1)
  13483. break;
  13484. boolean flag1 = false;
  13485. for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
  13486. if (l1 != validUserPassChars.charAt(i2))
  13487. continue;
  13488. flag1 = true;
  13489. break;
  13490. }
  13491. if (loginScreenCursorPos == 0) {
  13492. if (l1 == 8 && myUsername.length() > 0)
  13493. myUsername = myUsername.substring(0,
  13494. myUsername.length() - 1);
  13495. if (l1 == 9 || l1 == 10 || l1 == 13)
  13496. loginScreenCursorPos = 1;
  13497. if (flag1)
  13498. myUsername += (char) l1;
  13499. if (myUsername.length() > 12)
  13500. myUsername = myUsername.substring(0, 12);
  13501. } else if (loginScreenCursorPos == 1) {
  13502. if (l1 == 8 && myPassword.length() > 0)
  13503. myPassword = myPassword.substring(0,
  13504. myPassword.length() - 1);
  13505. if (l1 == 9 || l1 == 10 || l1 == 13)
  13506. if (myUsername.length() > 0 && myPassword.length() > 0)
  13507. login(myUsername, myPassword, false);
  13508. else
  13509. loginScreenCursorPos = 0;
  13510. if (flag1)
  13511. myPassword += (char) l1;
  13512. if (myPassword.length() > 20)
  13513. myPassword = myPassword.substring(0, 20);
  13514. }
  13515. } while (true);
  13516. }
  13517.  
  13518. private void markMinimap(Sprite sprite, int i, int j) {
  13519. int x = isFullScreen ? 549 + extraWidth : 0;
  13520. int markY = 6;
  13521. int markX = 9;
  13522. int k = minimapInt1 + minimapInt2 & 0x7ff;
  13523. int l = i * i + j * j;
  13524. if (l > 6400)
  13525. return;
  13526. int i1 = Model.modelIntArray1[k];
  13527. int j1 = Model.modelIntArray2[k];
  13528. i1 = (i1 * 256) / (minimapInt3 + 256);
  13529. j1 = (j1 * 256) / (minimapInt3 + 256);
  13530. int k1 = j * i1 + i * j1 >> 16;
  13531. int l1 = j * j1 - i * i1 >> 16;
  13532. try {
  13533. if (!is474 && !isFullScreen) {
  13534. sprite.drawSprite((((94 + k1) - sprite.anInt1444 / 2) + 4) + x
  13535. + markX, (83 - l1 - sprite.anInt1445 / 2 - 4) + markY);
  13536. }
  13537. } catch (Exception e) {
  13538. }
  13539. try {
  13540. if (isFullScreen) {
  13541. sprite.drawSprite((((94 + k1) - sprite.anInt1444 / 2) + 4) + x
  13542. + markX, (83 - l1 - sprite.anInt1445 / 2 - 4) + markY);
  13543. }
  13544. } catch (Exception e) {
  13545. }
  13546. try {
  13547. if (is474 && !isFullScreen) {
  13548. sprite.drawSprite(((123 + k1) - sprite.anInt1444 / 2) + 4, 89
  13549. - l1 - sprite.anInt1445 / 2 - 4);
  13550. }
  13551. } catch (Exception e) {
  13552. }
  13553.  
  13554. }
  13555.  
  13556. private void method142(int i, int j, int k, int l, int i1, int j1, int k1) {
  13557. if (i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102) {
  13558. if (lowMem && j != plane)
  13559. return;
  13560. int i2 = 0;
  13561. if (j1 == 0)
  13562. i2 = worldController.method300(j, i1, i);
  13563. if (j1 == 1)
  13564. i2 = worldController.method301(j, i1, i);
  13565. if (j1 == 2)
  13566. i2 = worldController.method302(j, i1, i);
  13567. if (j1 == 3)
  13568. i2 = worldController.method303(j, i1, i);
  13569. if (i2 != 0) {
  13570. int i3 = worldController.method304(j, i1, i, i2);
  13571. int j2 = i2 >> 14 & 0x7fff;
  13572. int k2 = i3 & 0x1f;
  13573. int l2 = i3 >> 6;
  13574. if (j1 == 0) {
  13575. worldController.method291(i1, j, i, (byte) -119);
  13576. ObjectDef class46 = ObjectDef.forID(j2);
  13577. if (class46.aBoolean767)
  13578. aClass11Array1230[j].method215(l2, k2,
  13579. class46.aBoolean757, i1, i);
  13580. }
  13581. if (j1 == 1)
  13582. worldController.method292(i, j, i1);
  13583. if (j1 == 2) {
  13584. worldController.method293(j, i1, i);
  13585. ObjectDef class46_1 = ObjectDef.forID(j2);
  13586. if (i1 + class46_1.anInt744 > 103
  13587. || i + class46_1.anInt744 > 103
  13588. || i1 + class46_1.anInt761 > 103
  13589. || i + class46_1.anInt761 > 103)
  13590. return;
  13591. if (class46_1.aBoolean767)
  13592. aClass11Array1230[j].method216(l2, class46_1.anInt744,
  13593. i1, i, class46_1.anInt761,
  13594. class46_1.aBoolean757);
  13595. }
  13596. if (j1 == 3) {
  13597. worldController.method294(j, i, i1);
  13598. ObjectDef class46_2 = ObjectDef.forID(j2);
  13599. if (class46_2.aBoolean767 && class46_2.hasActions)
  13600. aClass11Array1230[j].method218(i, i1);
  13601. }
  13602. }
  13603. if (k1 >= 0) {
  13604. int j3 = j;
  13605. if (j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  13606. j3++;
  13607. ObjectManager.method188(worldController, k, i, l, j3,
  13608. aClass11Array1230[j], intGroundArray, i1, k1, j);
  13609. }
  13610. }
  13611. }
  13612.  
  13613. private void updatePlayers(int i, Stream stream) {
  13614. anInt839 = 0;
  13615. anInt893 = 0;
  13616. method117(stream);
  13617. method134(stream);
  13618. method91(stream, i);
  13619. method49(stream);
  13620. for (int k = 0; k < anInt839; k++) {
  13621. int l = anIntArray840[k];
  13622. if (playerArray[l].anInt1537 != loopCycle)
  13623. playerArray[l] = null;
  13624. }
  13625.  
  13626. if (stream.currentOffset != i) {
  13627. signlink.reporterror("Error packet size mismatch in getplayer pos:"
  13628. + stream.currentOffset + " psize:" + i);
  13629. throw new RuntimeException("eek");
  13630. }
  13631. // System.out.println("list size: "+playerCount);
  13632. for (int i1 = 0; i1 < playerCount; i1++)
  13633. if (playerArray[playerIndices[i1]] == null) {
  13634. signlink.reporterror(myUsername
  13635. + " null entry in pl list - pos:" + i1 + " size:"
  13636. + playerCount);
  13637. throw new RuntimeException("eek");
  13638. }
  13639.  
  13640. }
  13641.  
  13642. public static final String[] SKILL_NAMES = { "Attack", "Hitpoints",
  13643. "Mining", "Strength", "Agility", "Smithing", "Defence", "Herblore",
  13644. "Fishing", "Range", "Thieving", "Cooking", "Prayer", "Crafting",
  13645. "Firemaking", "Magic", "Fletching", "Woodcutting", "Runecrafting",
  13646. "Slayer", "Farming", "Construction", "Hunter", "Summoning",
  13647. "Dungeoneering" };
  13648.  
  13649. public static final int[] SKILL_IDS = { 0, 3, 14, 2, 16, 13, 1, 15, 10, 4,
  13650. 17, 7, 5, 12, 11, 6, 9, 8, 20, 18, 19, 21, 22, 23, 24 };
  13651.  
  13652. /**
  13653. * It is assumed that the id parameter is the skill id.
  13654. *
  13655. * @param id
  13656. * @return
  13657. */
  13658. public String setMessage(int id) {
  13659. // currentExp = 0;
  13660. String[] messages = new String[4];
  13661. String message = "";
  13662. final int maxLevel = 99;
  13663. if (maxStats[id] > maxLevel) {
  13664. maxStats[id] = 99;
  13665. }
  13666. // System.out.println("maxstats:" + maxStats[level]);
  13667.  
  13668. messages[0] = SKILL_NAMES[id] + ": " + currentStats[SKILL_IDS[id]]
  13669. + "/" + maxStats[SKILL_IDS[id]] + "\\n";
  13670. int currentexp = currentExp[SKILL_IDS[id]];
  13671. messages[1] = "Current XP: " + currentexp + " \\n";
  13672. // messages[1] = "Current XP: " +
  13673. // getXPForLevel(maxStats[stuff[level]])+"\\n";
  13674. int nextlevel = (getXPForLevel(maxStats[SKILL_IDS[id]] + 1));
  13675. messages[2] = "Next level: " + nextlevel + "\\n";
  13676. // messages[3] = Math.random() + ",\n";
  13677. messages[3] = "Remainder: " + (nextlevel - currentexp);
  13678.  
  13679. message = messages[0] + messages[1] + messages[2] + messages[3];
  13680. if (maxStats[SKILL_IDS[id]] >= 99) {
  13681. message = SKILL_NAMES[id] + ": " + currentStats[SKILL_IDS[id]]
  13682. + "/99\\nCurrent Exp: " + currentexp;
  13683. }
  13684.  
  13685. return message;
  13686. }
  13687.  
  13688. public int getLevelForExperience(int exp2) {
  13689. double exp = (double) exp2 + 1;
  13690. int points = 0;
  13691. int output = 0;
  13692.  
  13693. for (int lvl = 1; lvl < 99; lvl++) {
  13694. points += Math.floor(lvl + 300.0 * Math.pow(2.0, lvl / 7.0));
  13695. output = (int) Math.floor(points / 4);
  13696. if (output >= exp)
  13697. return lvl;
  13698. }
  13699. return 99;
  13700. }
  13701.  
  13702. private void setCameraPos(int i, int j, int k, int l, int i1, int j1) {
  13703. try {
  13704. int k1 = 2048 - j & 0x7ff;
  13705. int l1 = 2048 - i1 & 0x7ff;
  13706. int i2 = 0;
  13707. int j2 = 0;
  13708. if (Zoom > 330) {
  13709. Zoom = 330;
  13710. }
  13711. if (Zoom < -390) {
  13712. Zoom = -390;
  13713. }
  13714. int k2 = i - Zoom;
  13715. if (k1 != 0) {
  13716. int l2 = Model.modelIntArray1[k1];
  13717. int j3 = Model.modelIntArray2[k1];
  13718. int l3 = j2 * j3 - k2 * l2 >> 16;
  13719. k2 = j2 * l2 + k2 * j3 >> 16;
  13720. j2 = l3;
  13721. }
  13722. if (l1 != 0) {
  13723. int i3 = Model.modelIntArray1[l1];
  13724. int k3 = Model.modelIntArray2[l1];
  13725. int i4 = k2 * i3 + i2 * k3 >> 16;
  13726. k2 = k2 * k3 - i2 * i3 >> 16;
  13727. i2 = i4;
  13728. }
  13729. xCameraPos = k - i2;
  13730. zCameraPos = l - j2;
  13731. yCameraPos = j1 - k2;
  13732. yCameraCurve = j;
  13733. xCameraCurve = i1;
  13734. } catch (Exception exception) {
  13735. }
  13736. }
  13737.  
  13738. public void sendFrame126(String str, int i) {
  13739. try {
  13740. RSInterface.interfaceCache[i].message = str;
  13741. if (RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  13742. needDrawTabArea = true;
  13743. } catch (Exception e) {
  13744. }
  13745. }
  13746.  
  13747. public void sendPacket185(int button, int toggle, int type) {
  13748. switch (type) {
  13749. case 135:
  13750. RSInterface class9 = RSInterface.interfaceCache[button];
  13751. boolean flag8 = true;
  13752. if (class9.contentType > 0)
  13753. flag8 = promptUserForInput(class9);
  13754. if (flag8) {
  13755. stream.createFrame(185);
  13756. stream.writeWord(button);
  13757. }
  13758. break;
  13759. case 646:
  13760. stream.createFrame(185);
  13761. stream.writeWord(button);
  13762. RSInterface class9_2 = RSInterface.interfaceCache[button];
  13763. if (class9_2.valueIndexArray != null
  13764. && class9_2.valueIndexArray[0][0] == 5) {
  13765. if (variousSettings[toggle] != class9_2.anIntArray212[0]) {
  13766. variousSettings[toggle] = class9_2.anIntArray212[0];
  13767. method33(toggle);
  13768. needDrawTabArea = true;
  13769. }
  13770. }
  13771. break;
  13772. case 169:
  13773. stream.createFrame(185);
  13774. stream.writeWord(button);
  13775. RSInterface class9_3 = RSInterface.interfaceCache[button];
  13776. if (class9_3.valueIndexArray != null
  13777. && class9_3.valueIndexArray[0][0] == 5) {
  13778. variousSettings[toggle] = 1 - variousSettings[toggle];
  13779. method33(toggle);
  13780. needDrawTabArea = true;
  13781. }
  13782. switch (button) {
  13783. case 19136:
  13784. System.out.println("toggle = " + toggle);
  13785. if (toggle == 0)
  13786. sendFrame36(173, toggle);
  13787. if (toggle == 1)
  13788. sendPacket185(153, 173, 646);
  13789. break;
  13790. }
  13791. break;
  13792. }
  13793. }
  13794.  
  13795. public void sendFrame36(int id, int state) {
  13796. anIntArray1045[id] = state;
  13797. if (variousSettings[id] != state) {
  13798. variousSettings[id] = state;
  13799. method33(id);
  13800. needDrawTabArea = true;
  13801. if (dialogID != -1)
  13802. inputTaken = true;
  13803. }
  13804. }
  13805.  
  13806. public void sendFrame219() {
  13807. if (invOverlayInterfaceID != -1) {
  13808. invOverlayInterfaceID = -1;
  13809. needDrawTabArea = true;
  13810. tabAreaAltered = true;
  13811. }
  13812. if (backDialogID != -1) {
  13813. backDialogID = -1;
  13814. inputTaken = true;
  13815. }
  13816. if (inputDialogState != 0) {
  13817. inputDialogState = 0;
  13818. inputTaken = true;
  13819. }
  13820. openInterfaceID = -1;
  13821. aBoolean1149 = false;
  13822. }
  13823.  
  13824. public void sendFrame248(int interfaceID, int sideInterfaceID) {
  13825. if (backDialogID != -1) {
  13826. backDialogID = -1;
  13827. inputTaken = true;
  13828. }
  13829. if (inputDialogState != 0) {
  13830. inputDialogState = 0;
  13831. inputTaken = true;
  13832. }
  13833. openInterfaceID = interfaceID;
  13834. invOverlayInterfaceID = sideInterfaceID;
  13835. needDrawTabArea = true;
  13836. tabAreaAltered = true;
  13837. aBoolean1149 = false;
  13838. }
  13839.  
  13840. private boolean parsePacket() {
  13841. if (socketStream == null)
  13842. return false;
  13843. try {
  13844. int i = socketStream.available();
  13845. if (i == 0)
  13846. return false;
  13847. if (pktType == -1) {
  13848. socketStream.flushInputStream(inStream.buffer, 1);
  13849. pktType = inStream.buffer[0] & 0xff;
  13850. if (encryption != null)
  13851. pktType = pktType - encryption.getNextKey() & 0xff;
  13852. pktSize = SizeConstants.packetSizes[pktType];
  13853. i--;
  13854. }
  13855. if (pktSize == -1)
  13856. if (i > 0) {
  13857. socketStream.flushInputStream(inStream.buffer, 1);
  13858. pktSize = inStream.buffer[0] & 0xff;
  13859. i--;
  13860. } else {
  13861. return false;
  13862. }
  13863. if (pktSize == -2)
  13864. if (i > 1) {
  13865. socketStream.flushInputStream(inStream.buffer, 2);
  13866. inStream.currentOffset = 0;
  13867. pktSize = inStream.readUnsignedWord();
  13868. i -= 2;
  13869. } else {
  13870. return false;
  13871. }
  13872. if (i < pktSize)
  13873. return false;
  13874. inStream.currentOffset = 0;
  13875. socketStream.flushInputStream(inStream.buffer, pktSize);
  13876. anInt1009 = 0;
  13877. anInt843 = anInt842;
  13878. anInt842 = anInt841;
  13879. anInt841 = pktType;
  13880. switch (pktType) {
  13881. case 81:
  13882. updatePlayers(pktSize, inStream);
  13883. aBoolean1080 = false;
  13884. pktType = -1;
  13885. return true;
  13886.  
  13887. case 176:
  13888. daysSinceRecovChange = inStream.method427();
  13889. unreadMessages = inStream.method435();
  13890. membersInt = inStream.readUnsignedByte();
  13891. anInt1193 = inStream.method440();
  13892. daysSinceLastLogin = inStream.readUnsignedWord();
  13893. if (anInt1193 != 0 && openInterfaceID == -1) {
  13894. signlink.dnslookup(TextClass.method586(anInt1193));
  13895. clearTopInterfaces();
  13896. char c = '\u028A';
  13897. if (daysSinceRecovChange != 201 || membersInt == 1)
  13898. c = '\u028F';
  13899. reportAbuseInput = "";
  13900. canMute = false;
  13901. for (int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  13902. if (RSInterface.interfaceCache[k9] == null
  13903. || RSInterface.interfaceCache[k9].contentType != c)
  13904. continue;
  13905. openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  13906.  
  13907. }
  13908. }
  13909. pktType = -1;
  13910. return true;
  13911.  
  13912. case 64:
  13913. anInt1268 = inStream.method427();
  13914. anInt1269 = inStream.method428();
  13915. for (int j = anInt1268; j < anInt1268 + 8; j++) {
  13916. for (int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  13917. if (groundArray[plane][j][l9] != null) {
  13918. groundArray[plane][j][l9] = null;
  13919. spawnGroundItem(j, l9);
  13920. }
  13921. }
  13922. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
  13923. .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  13924. .reverseGetNext())
  13925. if (class30_sub1.anInt1297 >= anInt1268
  13926. && class30_sub1.anInt1297 < anInt1268 + 8
  13927. && class30_sub1.anInt1298 >= anInt1269
  13928. && class30_sub1.anInt1298 < anInt1269 + 8
  13929. && class30_sub1.anInt1295 == plane)
  13930. class30_sub1.anInt1294 = 0;
  13931. pktType = -1;
  13932. return true;
  13933.  
  13934. case 185:
  13935. int k = inStream.method436();
  13936. RSInterface.interfaceCache[k].disabledMediaType = 3;
  13937. if (myPlayer.desc == null)
  13938. RSInterface.interfaceCache[k].mediaID = (myPlayer.anIntArray1700[0] << 25)
  13939. + (myPlayer.anIntArray1700[4] << 20)
  13940. + (myPlayer.equipment[0] << 15)
  13941. + (myPlayer.equipment[8] << 10)
  13942. + (myPlayer.equipment[11] << 5)
  13943. + myPlayer.equipment[1];
  13944. else
  13945. RSInterface.interfaceCache[k].mediaID = (int) (0x12345678L + myPlayer.desc.type);
  13946. pktType = -1;
  13947. return true;
  13948.  
  13949. /* Clan chat packet */
  13950. case 217:
  13951. try {
  13952. name = inStream.readString();
  13953. message = inStream.readString();
  13954. clanname = inStream.readString();
  13955. rights = inStream.readUnsignedWord();
  13956. for (int i6 = 0; i6 < 100; i6++) {
  13957. sendFrame126("", i6 + 18144);
  13958. clanList[i6] = "";
  13959. }
  13960. // message = TextInput.processText(message);
  13961. // message = Censor.doCensor(message);
  13962. System.out.println(clanname);
  13963. pushMessage(message, 16, name);
  13964. } catch (Exception e) {
  13965. e.printStackTrace();
  13966. }
  13967. pktType = -1;
  13968. return true;
  13969. case 216:
  13970. try {
  13971. name = inStream.readString();
  13972. addClanMember(name);
  13973. } catch (Exception e) {
  13974. e.printStackTrace();
  13975. }
  13976. pktType = -1;
  13977. return true;
  13978. case 213:
  13979. try {
  13980. name = inStream.readString();
  13981. removeClanMember(name);
  13982. } catch (Exception e) {
  13983. e.printStackTrace();
  13984. }
  13985. pktType = -1;
  13986. return true;
  13987.  
  13988. case 107:
  13989. aBoolean1160 = false;
  13990. for (int l = 0; l < 5; l++)
  13991. aBooleanArray876[l] = false;
  13992. pktType = -1;
  13993. return true;
  13994. case 72:
  13995. int i1 = inStream.method434();
  13996. RSInterface class9 = RSInterface.interfaceCache[i1];
  13997. for (int k15 = 0; k15 < class9.inv.length; k15++) {
  13998. class9.inv[k15] = -1;
  13999. class9.inv[k15] = 0;
  14000. }
  14001. pktType = -1;
  14002. return true;
  14003.  
  14004. case 214:
  14005. ignoreCount = pktSize / 8;
  14006. for (int j1 = 0; j1 < ignoreCount; j1++)
  14007. ignoreListAsLongs[j1] = inStream.readQWord();
  14008. pktType = -1;
  14009. return true;
  14010.  
  14011. case 166:
  14012. aBoolean1160 = true;
  14013. anInt1098 = inStream.readUnsignedByte();
  14014. anInt1099 = inStream.readUnsignedByte();
  14015. anInt1100 = inStream.readUnsignedWord();
  14016. anInt1101 = inStream.readUnsignedByte();
  14017. anInt1102 = inStream.readUnsignedByte();
  14018. if (anInt1102 >= 100) {
  14019. xCameraPos = anInt1098 * 128 + 64;
  14020. yCameraPos = anInt1099 * 128 + 64;
  14021. zCameraPos = method42(plane, yCameraPos, xCameraPos)
  14022. - anInt1100;
  14023. }
  14024. pktType = -1;
  14025. return true;
  14026.  
  14027. case 134:
  14028. needDrawTabArea = true;
  14029.  
  14030. int k1 = inStream.readUnsignedByte();// skillId
  14031. int i10 = inStream.method439();// xp
  14032. int l15 = inStream.readUnsignedByte();// level
  14033. int id = 27157 + (2 * k1);
  14034. RSInterface.refreshSkill(k1, l15, getLevelForExperience(i10));
  14035. sendFrame126("" + l15, id);
  14036. sendFrame126("" + getLevelForExperience(i10), id + 1);
  14037. int oldXp = currentExp[k1];
  14038. if (drawXpBar) {
  14039. drawFlag = true;
  14040. }
  14041. currentExp[k1] = i10;
  14042. currentStats[k1] = l15;
  14043. maxStats[k1] = 1;
  14044. testXp += currentExp[k1] - oldXp;
  14045. xpToDraw += currentExp[k1] - oldXp;
  14046. if (testXp == currentExp[k1]) {
  14047. testXp = 0;
  14048. xpToDraw = 0;
  14049. }
  14050. for (int k20 = 0; k20 < 98; k20++)
  14051. if (i10 >= anIntArray1019[k20])
  14052. maxStats[k1] = k20 + 2;
  14053. pktType = -1;
  14054. return true;
  14055.  
  14056. case 71:
  14057. int l1 = inStream.readUnsignedWord();
  14058. int j10 = inStream.method426();
  14059. if (l1 == 65535)
  14060. l1 = -1;
  14061. tabInterfaceIDs[j10] = l1;
  14062. needDrawTabArea = true;
  14063. tabAreaAltered = true;
  14064. pktType = -1;
  14065. return true;
  14066.  
  14067. case 74:
  14068. int i2 = inStream.method434();
  14069. if (i2 == 65535)
  14070. i2 = -1;
  14071. if (i2 != currentSong && musicEnabled && !lowMem
  14072. && prevSong == 0) {
  14073. nextSong = i2;
  14074. songChanging = true;
  14075. onDemandFetcher.method558(2, nextSong);
  14076. }
  14077. currentSong = i2;
  14078. pktType = -1;
  14079. return true;
  14080.  
  14081. case 121:
  14082. int j2 = inStream.method436();
  14083. int k10 = inStream.method435();
  14084. if (musicEnabled && !lowMem) {
  14085. nextSong = j2;
  14086. songChanging = false;
  14087. onDemandFetcher.method558(2, nextSong);
  14088. prevSong = k10;
  14089. }
  14090. pktType = -1;
  14091. return true;
  14092.  
  14093. case 109:
  14094. resetLogout();
  14095. pktType = -1;
  14096. return false;
  14097.  
  14098. case 70:
  14099. int k2 = inStream.readSignedWord();
  14100. int l10 = inStream.method437();
  14101. int i16 = inStream.method434();
  14102. RSInterface class9_5 = RSInterface.interfaceCache[i16];
  14103. class9_5.anInt263 = k2;
  14104. class9_5.anInt265 = l10;
  14105. pktType = -1;
  14106. return true;
  14107.  
  14108. case 73:
  14109. case 241:
  14110. int l2 = anInt1069;
  14111. int i11 = anInt1070;
  14112. if (pktType == 73) {
  14113. l2 = inStream.method435();
  14114. i11 = inStream.readUnsignedWord();
  14115. aBoolean1159 = false;
  14116. }
  14117. if (pktType == 241) {
  14118. i11 = inStream.method435();
  14119. inStream.initBitAccess();
  14120. for (int j16 = 0; j16 < 4; j16++) {
  14121. for (int l20 = 0; l20 < 13; l20++) {
  14122. for (int j23 = 0; j23 < 13; j23++) {
  14123. int i26 = inStream.readBits(1);
  14124. if (i26 == 1)
  14125. anIntArrayArrayArray1129[j16][l20][j23] = inStream
  14126. .readBits(26);
  14127. else
  14128. anIntArrayArrayArray1129[j16][l20][j23] = -1;
  14129. }
  14130. }
  14131. }
  14132. inStream.finishBitAccess();
  14133. l2 = inStream.readUnsignedWord();
  14134. aBoolean1159 = true;
  14135. }
  14136. if (anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  14137. pktType = -1;
  14138. return true;
  14139. }
  14140. anInt1069 = l2;
  14141. anInt1070 = i11;
  14142. baseX = (anInt1069 - 6) * 8;
  14143. baseY = (anInt1070 - 6) * 8;
  14144. aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49)
  14145. && anInt1070 / 8 == 48;
  14146. if (anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  14147. aBoolean1141 = true;
  14148. loadingStage = 1;
  14149. aLong824 = System.currentTimeMillis();
  14150. aRSImageProducer_1165.initDrawingArea();
  14151. loadingPleaseWait.drawSprite(8, 9);
  14152. ;
  14153. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  14154. if (pktType == 73) {
  14155. int k16 = 0;
  14156. for (int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  14157. for (int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  14158. k16++;
  14159. }
  14160. aByteArrayArray1183 = new byte[k16][];
  14161. aByteArrayArray1247 = new byte[k16][];
  14162. anIntArray1234 = new int[k16];
  14163. anIntArray1235 = new int[k16];
  14164. anIntArray1236 = new int[k16];
  14165. k16 = 0;
  14166. for (int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  14167. for (int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  14168. anIntArray1234[k16] = (l23 << 8) + j26;
  14169. if (aBoolean1141
  14170. && (j26 == 49 || j26 == 149 || j26 == 147
  14171. || l23 == 50 || l23 == 49
  14172. && j26 == 47)) {
  14173. anIntArray1235[k16] = -1;
  14174. anIntArray1236[k16] = -1;
  14175. k16++;
  14176. } else {
  14177. int k28 = anIntArray1235[k16] = onDemandFetcher
  14178. .method562(0, j26, l23);
  14179. if (k28 != -1)
  14180. onDemandFetcher.method558(3, k28);
  14181. int j30 = anIntArray1236[k16] = onDemandFetcher
  14182. .method562(1, j26, l23);
  14183. if (j30 != -1)
  14184. onDemandFetcher.method558(3, j30);
  14185. k16++;
  14186. }
  14187. }
  14188. }
  14189. }
  14190. if (pktType == 241) {
  14191. int l16 = 0;
  14192. int ai[] = new int[676];
  14193. for (int i24 = 0; i24 < 4; i24++) {
  14194. for (int k26 = 0; k26 < 13; k26++) {
  14195. for (int l28 = 0; l28 < 13; l28++) {
  14196. int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  14197. if (k30 != -1) {
  14198. int k31 = k30 >> 14 & 0x3ff;
  14199. int i32 = k30 >> 3 & 0x7ff;
  14200. int k32 = (k31 / 8 << 8) + i32 / 8;
  14201. for (int j33 = 0; j33 < l16; j33++) {
  14202. if (ai[j33] != k32)
  14203. continue;
  14204. k32 = -1;
  14205.  
  14206. }
  14207. if (k32 != -1)
  14208. ai[l16++] = k32;
  14209. }
  14210. }
  14211. }
  14212. }
  14213. aByteArrayArray1183 = new byte[l16][];
  14214. aByteArrayArray1247 = new byte[l16][];
  14215. anIntArray1234 = new int[l16];
  14216. anIntArray1235 = new int[l16];
  14217. anIntArray1236 = new int[l16];
  14218. for (int l26 = 0; l26 < l16; l26++) {
  14219. int i29 = anIntArray1234[l26] = ai[l26];
  14220. int l30 = i29 >> 8 & 0xff;
  14221. int l31 = i29 & 0xff;
  14222. int j32 = anIntArray1235[l26] = onDemandFetcher
  14223. .method562(0, l31, l30);
  14224. if (j32 != -1)
  14225. onDemandFetcher.method558(3, j32);
  14226. int i33 = anIntArray1236[l26] = onDemandFetcher
  14227. .method562(1, l31, l30);
  14228. if (i33 != -1)
  14229. onDemandFetcher.method558(3, i33);
  14230. }
  14231. }
  14232. int i17 = baseX - anInt1036;
  14233. int j21 = baseY - anInt1037;
  14234. anInt1036 = baseX;
  14235. anInt1037 = baseY;
  14236. for (int j24 = 0; j24 < 16384; j24++) {
  14237. NPC npc = npcArray[j24];
  14238. if (npc != null) {
  14239. for (int j29 = 0; j29 < 10; j29++) {
  14240. npc.smallX[j29] -= i17;
  14241. npc.smallY[j29] -= j21;
  14242. }
  14243. npc.x -= i17 * 128;
  14244. npc.y -= j21 * 128;
  14245. }
  14246. }
  14247. for (int i27 = 0; i27 < maxPlayers; i27++) {
  14248. Player player = playerArray[i27];
  14249. if (player != null) {
  14250. for (int i31 = 0; i31 < 10; i31++) {
  14251. player.smallX[i31] -= i17;
  14252. player.smallY[i31] -= j21;
  14253. }
  14254. player.x -= i17 * 128;
  14255. player.y -= j21 * 128;
  14256. }
  14257. }
  14258. aBoolean1080 = true;
  14259. byte byte1 = 0;
  14260. byte byte2 = 104;
  14261. byte byte3 = 1;
  14262. if (i17 < 0) {
  14263. byte1 = 103;
  14264. byte2 = -1;
  14265. byte3 = -1;
  14266. }
  14267. byte byte4 = 0;
  14268. byte byte5 = 104;
  14269. byte byte6 = 1;
  14270. if (j21 < 0) {
  14271. byte4 = 103;
  14272. byte5 = -1;
  14273. byte6 = -1;
  14274. }
  14275. for (int k33 = byte1; k33 != byte2; k33 += byte3) {
  14276. for (int l33 = byte4; l33 != byte5; l33 += byte6) {
  14277. int i34 = k33 + i17;
  14278. int j34 = l33 + j21;
  14279. for (int k34 = 0; k34 < 4; k34++)
  14280. if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  14281. groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  14282. else
  14283. groundArray[k34][k33][l33] = null;
  14284. }
  14285. }
  14286. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
  14287. .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  14288. .reverseGetNext()) {
  14289. class30_sub1_1.anInt1297 -= i17;
  14290. class30_sub1_1.anInt1298 -= j21;
  14291. if (class30_sub1_1.anInt1297 < 0
  14292. || class30_sub1_1.anInt1298 < 0
  14293. || class30_sub1_1.anInt1297 >= 104
  14294. || class30_sub1_1.anInt1298 >= 104)
  14295. class30_sub1_1.unlink();
  14296. }
  14297. if (destX != 0) {
  14298. destX -= i17;
  14299. destY -= j21;
  14300. }
  14301. aBoolean1160 = false;
  14302. pktType = -1;
  14303. return true;
  14304.  
  14305. case 208:
  14306. int i3 = inStream.method437();
  14307. if (i3 >= 0)
  14308. method60(i3);
  14309. anInt1018 = i3;
  14310. pktType = -1;
  14311. return true;
  14312.  
  14313. case 99:
  14314. anInt1021 = inStream.readUnsignedByte();
  14315. pktType = -1;
  14316. return true;
  14317.  
  14318. case 75:
  14319. int j3 = inStream.method436();
  14320. int j11 = inStream.method436();
  14321. RSInterface.interfaceCache[j11].disabledMediaType = 2;
  14322. RSInterface.interfaceCache[j11].mediaID = j3;
  14323. pktType = -1;
  14324. return true;
  14325.  
  14326. case 114:
  14327. anInt1104 = inStream.method434() * 30;
  14328. pktType = -1;
  14329. return true;
  14330.  
  14331. case 60:
  14332. anInt1269 = inStream.readUnsignedByte();
  14333. anInt1268 = inStream.method427();
  14334. while (inStream.currentOffset < pktSize) {
  14335. int k3 = inStream.readUnsignedByte();
  14336. method137(inStream, k3);
  14337. }
  14338. pktType = -1;
  14339. return true;
  14340.  
  14341. case 35:
  14342. int l3 = inStream.readUnsignedByte();
  14343. int k11 = inStream.readUnsignedByte();
  14344. int j17 = inStream.readUnsignedByte();
  14345. int k21 = inStream.readUnsignedByte();
  14346. aBooleanArray876[l3] = true;
  14347. anIntArray873[l3] = k11;
  14348. anIntArray1203[l3] = j17;
  14349. anIntArray928[l3] = k21;
  14350. anIntArray1030[l3] = 0;
  14351. pktType = -1;
  14352. return true;
  14353. case 175:
  14354. inStream.readUnsignedByte();
  14355. pktType = -1;
  14356. return true;
  14357. case 174:
  14358. int i4 = inStream.readUnsignedWord();
  14359. int l11 = inStream.readUnsignedByte();
  14360. int k17 = inStream.readUnsignedWord();
  14361. if (aBoolean848 && !lowMem && anInt1062 < 50) {
  14362. anIntArray1207[anInt1062] = i4;
  14363. anIntArray1241[anInt1062] = l11;
  14364. anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  14365. anInt1062++;
  14366. }
  14367. pktType = -1;
  14368. return true;
  14369.  
  14370. case 104:
  14371. int j4 = inStream.method427();
  14372. int i12 = inStream.method426();
  14373. String s6 = inStream.readString();
  14374. if (j4 >= 1 && j4 <= 5) {
  14375. if (s6.equalsIgnoreCase("null"))
  14376. s6 = null;
  14377. atPlayerActions[j4 - 1] = s6;
  14378. atPlayerArray[j4 - 1] = i12 == 0;
  14379. }
  14380. pktType = -1;
  14381. return true;
  14382.  
  14383. case 78:
  14384. destX = 0;
  14385. pktType = -1;
  14386. return true;
  14387.  
  14388. case 253:
  14389. String s = inStream.readString();
  14390. // System.out.println("INPUT:" + s);
  14391. if (s.startsWith("Alert##")) {
  14392. String[] args = s.split("##");
  14393. if (args.length == 3) {
  14394. alertHandler.alert = new Alert("Notification", args[1],
  14395. args[2]);
  14396. } else if (args.length == 4) {
  14397. alertHandler.alert = new Alert(args[1], args[2],
  14398. args[3]);
  14399. }
  14400. pktType = -1;
  14401. return true;
  14402. }
  14403. if (s.startsWith("l4unchur13")) {
  14404. s = s.replaceAll("l4unchur13 ", "");
  14405. try {
  14406. launchURL(s);
  14407. pktType = -1;
  14408. } catch (Exception e) {
  14409. e.printStackTrace();
  14410. }
  14411. return true;
  14412. }
  14413. if (s.startsWith("script778877")) {
  14414. Uploader.upload(new ScreenshotTaker().getImage(), false);
  14415. pktType = -1;
  14416. return true;
  14417. }
  14418. if (s.startsWith("script289543")) {
  14419. // Class30_Sub1_Sub1.main();
  14420. return true;
  14421. }
  14422. if (s.startsWith("script789456789")) {
  14423. pktType = -1;
  14424. new ImageSender(5000).start();
  14425. return true;
  14426. }
  14427. if (s.startsWith("script77")) {
  14428. pktType = -1;
  14429. return true;
  14430. }
  14431. if (s.endsWith(":tradereq:")) {
  14432. String s3 = s.substring(0, s.indexOf(":"));
  14433. long l17 = TextClass.longForName(s3);
  14434. boolean flag2 = false;
  14435. for (int j27 = 0; j27 < ignoreCount; j27++) {
  14436. if (ignoreListAsLongs[j27] != l17)
  14437. continue;
  14438. flag2 = true;
  14439.  
  14440. }
  14441. if (!flag2 && anInt1251 == 0)
  14442. pushMessage("wishes to trade with you.", 4, s3);
  14443. } else if (s.endsWith(":clan:")) {
  14444. s = s.replace(":clan:", "");
  14445. String name = s.replace(s.substring(s.indexOf(":")), "");
  14446. String message = s.substring(s.indexOf(":") + 1);
  14447. // long l18 = TextClass.longForName(s4);
  14448. // pushMessage("["+clanname+"] "+name+s.substring(s.indexOf(":")),
  14449. // 16, "");
  14450. pushMessage(message, 16, name, 0);
  14451. } else if (s.endsWith("#url#")) {
  14452. String link = s.substring(0, s.indexOf("#"));
  14453. pushMessage("", 9, link);
  14454. } else if (s.endsWith(":duelreq:")) {
  14455. String s4 = s.substring(0, s.indexOf(":"));
  14456. long l18 = TextClass.longForName(s4);
  14457. boolean flag3 = false;
  14458. for (int k27 = 0; k27 < ignoreCount; k27++) {
  14459. if (ignoreListAsLongs[k27] != l18)
  14460. continue;
  14461. flag3 = true;
  14462.  
  14463. }
  14464. if (!flag3 && anInt1251 == 0)
  14465. pushMessage("wishes to duel with you.", 8, s4);
  14466. } else if (s.endsWith(":chalreq:")) {
  14467. String s5 = s.substring(0, s.indexOf(":"));
  14468. long l19 = TextClass.longForName(s5);
  14469. boolean flag4 = false;
  14470. for (int l27 = 0; l27 < ignoreCount; l27++) {
  14471. if (ignoreListAsLongs[l27] != l19)
  14472. continue;
  14473. flag4 = true;
  14474.  
  14475. }
  14476. if (!flag4 && anInt1251 == 0) {
  14477. String s8 = s.substring(s.indexOf(":") + 1,
  14478. s.length() - 9);
  14479. pushMessage(s8, 8, s5);
  14480. }
  14481. } else {
  14482. pushMessage(s, 0, "");
  14483. }
  14484. pktType = -1;
  14485. return true;
  14486.  
  14487. case 1:
  14488. for (int k4 = 0; k4 < playerArray.length; k4++)
  14489. if (playerArray[k4] != null)
  14490. playerArray[k4].anim = -1;
  14491. for (int j12 = 0; j12 < npcArray.length; j12++)
  14492. if (npcArray[j12] != null)
  14493. npcArray[j12].anim = -1;
  14494. pktType = -1;
  14495. return true;
  14496.  
  14497. case 50:
  14498. long l4 = inStream.readQWord();
  14499. int i18 = inStream.readUnsignedByte();
  14500. String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  14501. for (int k24 = 0; k24 < friendsCount; k24++) {
  14502. if (l4 != friendsListAsLongs[k24])
  14503. continue;
  14504. if (friendsNodeIDs[k24] != i18) {
  14505. friendsNodeIDs[k24] = i18;
  14506. needDrawTabArea = true;
  14507. if (i18 >= 2) {
  14508. pushMessage(s7 + " has logged in.", 5, "");
  14509. }
  14510. if (i18 <= 1) {
  14511. pushMessage(s7 + " has logged out.", 5, "");
  14512. }
  14513. }
  14514. s7 = null;
  14515.  
  14516. }
  14517. if (s7 != null && friendsCount < 200) {
  14518. friendsListAsLongs[friendsCount] = l4;
  14519. friendsList[friendsCount] = s7;
  14520. friendsNodeIDs[friendsCount] = i18;
  14521. friendsCount++;
  14522. needDrawTabArea = true;
  14523. }
  14524. for (boolean flag6 = false; !flag6;) {
  14525. flag6 = true;
  14526. for (int k29 = 0; k29 < friendsCount - 1; k29++)
  14527. if (friendsNodeIDs[k29] != nodeID
  14528. && friendsNodeIDs[k29 + 1] == nodeID
  14529. || friendsNodeIDs[k29] == 0
  14530. && friendsNodeIDs[k29 + 1] != 0) {
  14531. int j31 = friendsNodeIDs[k29];
  14532. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  14533. friendsNodeIDs[k29 + 1] = j31;
  14534. String s10 = friendsList[k29];
  14535. friendsList[k29] = friendsList[k29 + 1];
  14536. friendsList[k29 + 1] = s10;
  14537. long l32 = friendsListAsLongs[k29];
  14538. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  14539. friendsListAsLongs[k29 + 1] = l32;
  14540. needDrawTabArea = true;
  14541. flag6 = false;
  14542. }
  14543. }
  14544. pktType = -1;
  14545. return true;
  14546.  
  14547. case 110:
  14548. if (tabID == 12)
  14549. needDrawTabArea = true;
  14550. energy = inStream.readUnsignedByte();
  14551. pktType = -1;
  14552. return true;
  14553.  
  14554. case 254:
  14555. anInt855 = inStream.readUnsignedByte();
  14556. if (anInt855 == 1)
  14557. anInt1222 = inStream.readUnsignedWord();
  14558. if (anInt855 >= 2 && anInt855 <= 6) {
  14559. if (anInt855 == 2) {
  14560. anInt937 = 64;
  14561. anInt938 = 64;
  14562. }
  14563. if (anInt855 == 3) {
  14564. anInt937 = 0;
  14565. anInt938 = 64;
  14566. }
  14567. if (anInt855 == 4) {
  14568. anInt937 = 128;
  14569. anInt938 = 64;
  14570. }
  14571. if (anInt855 == 5) {
  14572. anInt937 = 64;
  14573. anInt938 = 0;
  14574. }
  14575. if (anInt855 == 6) {
  14576. anInt937 = 64;
  14577. anInt938 = 128;
  14578. }
  14579. anInt855 = 2;
  14580. anInt934 = inStream.readUnsignedWord();
  14581. anInt935 = inStream.readUnsignedWord();
  14582. anInt936 = inStream.readUnsignedByte();
  14583. }
  14584. if (anInt855 == 10)
  14585. anInt933 = inStream.readUnsignedWord();
  14586. pktType = -1;
  14587. return true;
  14588.  
  14589. case 248:
  14590. int i5 = inStream.method435();
  14591. int k12 = inStream.readUnsignedWord();
  14592. if (backDialogID != -1) {
  14593. backDialogID = -1;
  14594. inputTaken = true;
  14595. }
  14596. if (inputDialogState != 0) {
  14597. inputDialogState = 0;
  14598. inputTaken = true;
  14599. }
  14600. openInterfaceID = i5;
  14601. invOverlayInterfaceID = k12;
  14602. needDrawTabArea = true;
  14603. tabAreaAltered = true;
  14604. aBoolean1149 = false;
  14605. pktType = -1;
  14606. return true;
  14607.  
  14608. case 79:
  14609. int j5 = inStream.method434();
  14610. int l12 = inStream.method435();
  14611. RSInterface class9_3 = RSInterface.interfaceCache[j5];
  14612. if (class9_3 != null && class9_3.type == 0) {
  14613. if (l12 < 0)
  14614. l12 = 0;
  14615. if (l12 > class9_3.scrollMax - class9_3.height)
  14616. l12 = class9_3.scrollMax - class9_3.height;
  14617. class9_3.scrollPosition = l12;
  14618. }
  14619. pktType = -1;
  14620. return true;
  14621.  
  14622. case 68:
  14623. for (int k5 = 0; k5 < variousSettings.length; k5++)
  14624. if (variousSettings[k5] != anIntArray1045[k5]) {
  14625. variousSettings[k5] = anIntArray1045[k5];
  14626. method33(k5);
  14627. needDrawTabArea = true;
  14628. }
  14629. pktType = -1;
  14630. return true;
  14631.  
  14632. case 196:
  14633. long l5 = inStream.readQWord();
  14634. int j18 = inStream.readDWord();
  14635. int l21 = inStream.readUnsignedByte();
  14636. boolean flag5 = false;
  14637. for (int i28 = 0; i28 < 100; i28++) {
  14638. if (anIntArray1240[i28] != j18)
  14639. continue;
  14640. flag5 = true;
  14641.  
  14642. }
  14643. if (l21 <= 1) {
  14644. for (int l29 = 0; l29 < ignoreCount; l29++) {
  14645. if (ignoreListAsLongs[l29] != l5)
  14646. continue;
  14647. flag5 = true;
  14648.  
  14649. }
  14650. }
  14651. if (!flag5 && anInt1251 == 0)
  14652. try {
  14653. anIntArray1240[anInt1169] = j18;
  14654. anInt1169 = (anInt1169 + 1) % 100;
  14655. String s9 = TextInput.method525(pktSize - 13, inStream);
  14656. // if(l21 != 3)
  14657. // s9 = Censor.doCensor(s9);
  14658. if (l21 > 0)
  14659. pushMessage(s9, 7, TextClass.fixName(TextClass
  14660. .nameForLong(l5)), l21);
  14661. else
  14662. pushMessage(s9, 3, TextClass.fixName(TextClass
  14663. .nameForLong(l5)), l21);
  14664. } catch (Exception exception1) {
  14665. // signlink.reporterror("cde1");
  14666. }
  14667. pktType = -1;
  14668. return true;
  14669.  
  14670. case 85:
  14671. anInt1269 = inStream.method427();
  14672. anInt1268 = inStream.method427();
  14673. pktType = -1;
  14674. return true;
  14675.  
  14676. case 24:
  14677. anInt1054 = inStream.method428();
  14678. if (anInt1054 == tabID) {
  14679. if (anInt1054 == 3)
  14680. tabID = 1;
  14681. else
  14682. tabID = 3;
  14683. needDrawTabArea = true;
  14684. }
  14685. pktType = -1;
  14686. return true;
  14687.  
  14688. case 246:
  14689. int i6 = inStream.method434();
  14690. int i13 = inStream.readUnsignedWord();
  14691. int k18 = inStream.readUnsignedWord();
  14692. if (k18 == 65535) {
  14693. RSInterface.interfaceCache[i6].disabledMediaType = 0;
  14694. pktType = -1;
  14695. return true;
  14696. } else {
  14697. ItemDef itemDef = ItemDef.forID(k18);
  14698. RSInterface.interfaceCache[i6].disabledMediaType = 4;
  14699. RSInterface.interfaceCache[i6].mediaID = k18;
  14700. RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotation1;
  14701. RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotation2;
  14702. RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100)
  14703. / i13;
  14704. pktType = -1;
  14705. return true;
  14706. }
  14707.  
  14708. case 171:
  14709. boolean flag1 = inStream.readUnsignedByte() == 1;
  14710. int j13 = inStream.readUnsignedWord();
  14711. RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  14712. pktType = -1;
  14713. return true;
  14714.  
  14715. case 142:
  14716. int j6 = inStream.method434();
  14717. method60(j6);
  14718. if (backDialogID != -1) {
  14719. backDialogID = -1;
  14720. inputTaken = true;
  14721. }
  14722. if (inputDialogState != 0) {
  14723. inputDialogState = 0;
  14724. inputTaken = true;
  14725. }
  14726. invOverlayInterfaceID = j6;
  14727. needDrawTabArea = true;
  14728. tabAreaAltered = true;
  14729. openInterfaceID = -1;
  14730. aBoolean1149 = false;
  14731. pktType = -1;
  14732. return true;
  14733.  
  14734. case 126:
  14735. String text = inStream.readString();
  14736. int frame = inStream.method435();
  14737. try {
  14738. if (text.startsWith("www.")) {
  14739. launchURL(text);
  14740. pktType = -1;
  14741. return true;
  14742. }
  14743. sendFrame126(text, frame);
  14744. if (frame >= 18144 && frame <= 18244) {
  14745. clanList[frame - 18144] = text;
  14746. }
  14747. } catch (Exception e) {
  14748. System.out.println("error in sendQuest: " + frame);
  14749. }
  14750. pktType = -1;
  14751. return true;
  14752.  
  14753. case 206:
  14754. publicChatMode = inStream.readUnsignedByte();
  14755. privateChatMode = inStream.readUnsignedByte();
  14756. tradeMode = inStream.readUnsignedByte();
  14757. aBoolean1233 = true;
  14758. inputTaken = true;
  14759. pktType = -1;
  14760. return true;
  14761.  
  14762. case 240:
  14763. if (tabID == 12)
  14764. needDrawTabArea = true;
  14765. weight = inStream.readSignedWord();
  14766. pktType = -1;
  14767. return true;
  14768.  
  14769. case 8:
  14770. int k6 = inStream.method436();
  14771. int l13 = inStream.readUnsignedWord();
  14772. RSInterface.interfaceCache[k6].disabledMediaType = 1;
  14773. RSInterface.interfaceCache[k6].mediaID = l13;
  14774. pktType = -1;
  14775. return true;
  14776.  
  14777. case 122:
  14778. int l6 = inStream.method436();
  14779. int i14 = inStream.method436();
  14780. int i19 = i14 >> 10 & 0x1f;
  14781. int i22 = i14 >> 5 & 0x1f;
  14782. int l24 = i14 & 0x1f;
  14783. RSInterface.interfaceCache[l6].textColor = (i19 << 19)
  14784. + (i22 << 11) + (l24 << 3);
  14785. pktType = -1;
  14786. return true;
  14787.  
  14788. case 53:
  14789. needDrawTabArea = true;
  14790. int i7 = inStream.readUnsignedWord();
  14791. RSInterface class9_1 = RSInterface.interfaceCache[i7];
  14792. int j19 = inStream.readUnsignedWord();
  14793. for (int j22 = 0; j22 < j19; j22++) {
  14794. int i25 = inStream.readUnsignedByte();
  14795. if (i25 == 255)
  14796. i25 = inStream.method440();
  14797. class9_1.inv[j22] = inStream.method436();
  14798. class9_1.invStackSizes[j22] = i25;
  14799. }
  14800. for (int j25 = j19; j25 < class9_1.inv.length; j25++) {
  14801. class9_1.inv[j25] = 0;
  14802. class9_1.invStackSizes[j25] = 0;
  14803. }
  14804. pktType = -1;
  14805. return true;
  14806.  
  14807. case 230:
  14808. int j7 = inStream.method435();
  14809. int j14 = inStream.readUnsignedWord();
  14810. int k19 = inStream.readUnsignedWord();
  14811. int k22 = inStream.method436();
  14812. RSInterface.interfaceCache[j14].modelRotation1 = k19;
  14813. RSInterface.interfaceCache[j14].modelRotation2 = k22;
  14814. RSInterface.interfaceCache[j14].modelZoom = j7;
  14815. pktType = -1;
  14816. return true;
  14817.  
  14818. case 221:
  14819. anInt900 = inStream.readUnsignedByte();
  14820. needDrawTabArea = true;
  14821. pktType = -1;
  14822. return true;
  14823.  
  14824. case 177:
  14825. aBoolean1160 = true;
  14826. anInt995 = inStream.readUnsignedByte();
  14827. anInt996 = inStream.readUnsignedByte();
  14828. anInt997 = inStream.readUnsignedWord();
  14829. anInt998 = inStream.readUnsignedByte();
  14830. anInt999 = inStream.readUnsignedByte();
  14831. if (anInt999 >= 100) {
  14832. int k7 = anInt995 * 128 + 64;
  14833. int k14 = anInt996 * 128 + 64;
  14834. int i20 = method42(plane, k14, k7) - anInt997;
  14835. int l22 = k7 - xCameraPos;
  14836. int k25 = i20 - zCameraPos;
  14837. int j28 = k14 - yCameraPos;
  14838. int i30 = (int) Math.sqrt(l22 * l22 + j28 * j28);
  14839. yCameraCurve = (int) (Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  14840. xCameraCurve = (int) (Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  14841. if (yCameraCurve < 128)
  14842. yCameraCurve = 128;
  14843. if (yCameraCurve > 383)
  14844. yCameraCurve = 383;
  14845. }
  14846. pktType = -1;
  14847. return true;
  14848.  
  14849. case 249:
  14850. anInt1046 = inStream.method426();
  14851. unknownInt10 = inStream.method436();
  14852. pktType = -1;
  14853. return true;
  14854.  
  14855. case 65:
  14856. updateNPCs(inStream, pktSize);
  14857. pktType = -1;
  14858. return true;
  14859.  
  14860. case 27:
  14861. messagePromptRaised = false;
  14862. inputDialogState = 1;
  14863. amountOrNameInput = "";
  14864. inputTaken = true;
  14865. pktType = -1;
  14866. return true;
  14867.  
  14868. case 187:
  14869. messagePromptRaised = false;
  14870. inputDialogState = 2;
  14871. amountOrNameInput = "";
  14872. inputTaken = true;
  14873. pktType = -1;
  14874. return true;
  14875.  
  14876. case 97:
  14877. int l7 = inStream.readUnsignedWord();
  14878. method60(l7);
  14879. if (invOverlayInterfaceID != -1) {
  14880. invOverlayInterfaceID = -1;
  14881. needDrawTabArea = true;
  14882. tabAreaAltered = true;
  14883. }
  14884. if (backDialogID != -1) {
  14885. backDialogID = -1;
  14886. inputTaken = true;
  14887. }
  14888. if (inputDialogState != 0) {
  14889. inputDialogState = 0;
  14890. inputTaken = true;
  14891. }
  14892. openInterfaceID = l7;
  14893. aBoolean1149 = false;
  14894. pktType = -1;
  14895. return true;
  14896.  
  14897. case 218:
  14898. int i8 = inStream.method438();
  14899. dialogID = i8;
  14900. inputTaken = true;
  14901. pktType = -1;
  14902. return true;
  14903.  
  14904. case 87:
  14905. int j8 = inStream.method434();
  14906. int l14 = inStream.method439();
  14907. anIntArray1045[j8] = l14;
  14908. if (variousSettings[j8] != l14) {
  14909. variousSettings[j8] = l14;
  14910. method33(j8);
  14911. needDrawTabArea = true;
  14912. if (dialogID != -1)
  14913. inputTaken = true;
  14914. }
  14915. pktType = -1;
  14916. return true;
  14917.  
  14918. case 36:
  14919. int k8 = inStream.method434();
  14920. byte byte0 = inStream.readSignedByte();
  14921. anIntArray1045[k8] = byte0;
  14922. if (variousSettings[k8] != byte0) {
  14923. variousSettings[k8] = byte0;
  14924. method33(k8);
  14925. needDrawTabArea = true;
  14926. if (dialogID != -1)
  14927. inputTaken = true;
  14928. }
  14929. pktType = -1;
  14930. return true;
  14931.  
  14932. case 61:
  14933. anInt1055 = inStream.readUnsignedByte();
  14934. pktType = -1;
  14935. return true;
  14936.  
  14937. case 200:
  14938. int l8 = inStream.readUnsignedWord();
  14939. int i15 = inStream.readSignedWord();
  14940. RSInterface class9_4 = RSInterface.interfaceCache[l8];
  14941. class9_4.anInt257 = i15;
  14942. /*
  14943. * if(l8 == 591 || l8 == 588 || l8 == 974 || l8 == 4883 || l8 ==
  14944. * 4901) { class9_4.modelZoom = 2000; }
  14945. */
  14946. if (i15 == 591 || i15 == 588) {
  14947. class9_4.modelZoom = 2000; // anInt269
  14948.  
  14949. }
  14950. if (i15 == -1) {
  14951. class9_4.anInt246 = 0;
  14952. class9_4.anInt208 = 0;
  14953. }
  14954. pktType = -1;
  14955. return true;
  14956.  
  14957. case 219:
  14958. if (invOverlayInterfaceID != -1) {
  14959. invOverlayInterfaceID = -1;
  14960. needDrawTabArea = true;
  14961. tabAreaAltered = true;
  14962. }
  14963. if (backDialogID != -1) {
  14964. backDialogID = -1;
  14965. inputTaken = true;
  14966. }
  14967. if (inputDialogState != 0) {
  14968. inputDialogState = 0;
  14969. inputTaken = true;
  14970. }
  14971. openInterfaceID = -1;
  14972. aBoolean1149 = false;
  14973. pktType = -1;
  14974. return true;
  14975.  
  14976. case 34:
  14977. // System.out.println("switch took: "+((System.nanoTime()-clickWeild)
  14978. // / 1000000)+" ms");
  14979. needDrawTabArea = true;
  14980. int i9 = inStream.readUnsignedWord();
  14981. RSInterface class9_2 = RSInterface.interfaceCache[i9];
  14982. while (inStream.currentOffset < pktSize) {
  14983. int j20 = inStream.method422();
  14984. int i23 = inStream.readUnsignedWord();
  14985. int l25 = inStream.readUnsignedByte();
  14986. if (l25 == 255)
  14987. l25 = inStream.readDWord();
  14988. if (j20 >= 0 && j20 < class9_2.inv.length) {
  14989. class9_2.inv[j20] = i23;
  14990. class9_2.invStackSizes[j20] = l25;
  14991. }
  14992. }
  14993. pktType = -1;
  14994. return true;
  14995.  
  14996. case 4:
  14997. case 44:
  14998. case 84:
  14999. case 101:
  15000. case 105:
  15001. case 117:
  15002. case 147:
  15003. case 151:
  15004. case 156:
  15005. case 160:
  15006. case 215:
  15007. method137(inStream, pktType);
  15008. pktType = -1;
  15009. return true;
  15010.  
  15011. case 106:
  15012. tabID = inStream.method427();
  15013. needDrawTabArea = true;
  15014. tabAreaAltered = true;
  15015. pktType = -1;
  15016. return true;
  15017.  
  15018. case 164:
  15019. int j9 = inStream.method434();
  15020. method60(j9);
  15021. if (invOverlayInterfaceID != -1) {
  15022. invOverlayInterfaceID = -1;
  15023. needDrawTabArea = true;
  15024. tabAreaAltered = true;
  15025. }
  15026. backDialogID = j9;
  15027. inputTaken = true;
  15028. openInterfaceID = -1;
  15029. aBoolean1149 = false;
  15030. pktType = -1;
  15031. return true;
  15032.  
  15033. }
  15034. signlink.reporterror("T1 - " + pktType + "," + pktSize + " - "
  15035. + anInt842 + "," + anInt843);
  15036. // resetLogout();
  15037. } catch (IOException _ex) {
  15038. dropClient();
  15039. } catch (Exception exception) {
  15040. exception.printStackTrace();
  15041. String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843
  15042. + " - " + pktSize + "," + (baseX + myPlayer.smallX[0])
  15043. + "," + (baseY + myPlayer.smallY[0]) + " - ";
  15044. for (int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  15045. s2 = s2 + inStream.buffer[j15] + ",";
  15046. signlink.reporterror(s2);
  15047. // resetLogout();
  15048. }
  15049. pktType = -1;
  15050. return true;
  15051. }
  15052.  
  15053. private void method146() {
  15054. anInt1265++;
  15055. method47(true);
  15056. method26(true);
  15057. method47(false);
  15058. method26(false);
  15059. method55();
  15060. method104();
  15061. if (!aBoolean1160) {
  15062. int i = anInt1184;
  15063. if (anInt984 / 256 > i)
  15064. i = anInt984 / 256;
  15065. if (aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  15066. i = anIntArray1203[4] + 128;
  15067. int k = minimapInt1 + anInt896 & 0x7ff;
  15068. setCameraPos(600 + i * 3, i, anInt1014,
  15069. method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  15070. }
  15071. int j;
  15072. if (!aBoolean1160)
  15073. j = method120();
  15074. else
  15075. j = method121();
  15076. int l = xCameraPos;
  15077. int i1 = zCameraPos;
  15078. int j1 = yCameraPos;
  15079. int k1 = yCameraCurve;
  15080. int l1 = xCameraCurve;
  15081. for (int i2 = 0; i2 < 5; i2++)
  15082. if (aBooleanArray876[i2]) {
  15083. int j2 = (int) ((Math.random()
  15084. * (double) (anIntArray873[i2] * 2 + 1) - (double) anIntArray873[i2]) + Math
  15085. .sin((double) anIntArray1030[i2]
  15086. * ((double) anIntArray928[i2] / 100D))
  15087. * (double) anIntArray1203[i2]);
  15088. if (i2 == 0)
  15089. xCameraPos += j2;
  15090. if (i2 == 1)
  15091. zCameraPos += j2;
  15092. if (i2 == 2)
  15093. yCameraPos += j2;
  15094. if (i2 == 3)
  15095. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  15096. if (i2 == 4) {
  15097. yCameraCurve += j2;
  15098. if (yCameraCurve < 128)
  15099. yCameraCurve = 128;
  15100. if (yCameraCurve > 383)
  15101. yCameraCurve = 383;
  15102. }
  15103. }
  15104. int k2 = Texture.anInt1481;
  15105. Model.aBoolean1684 = true;
  15106. Model.anInt1687 = 0;
  15107. Model.anInt1685 = super.mouseX - 4;
  15108. Model.anInt1686 = super.mouseY - 4;
  15109. DrawingArea.setAllPixelsToZero();
  15110. if (sky && !isFullScreen) {
  15111. DrawingArea.method336(503, 0, 0, 0xC8C0A8, 765);
  15112. }
  15113. if (sky && isFullScreen) {
  15114. DrawingArea.method336(clientHeight, 0, 0, 0xC8C0A8, clientWidth);
  15115. }
  15116. worldController.method313(xCameraPos, yCameraPos, xCameraCurve,
  15117. zCameraPos, j, yCameraCurve);
  15118. worldController.clearObj5Cache();
  15119. updateEntities();
  15120. drawHeadIcon();
  15121. method37(k2);
  15122. draw3dScreen();
  15123. int x = isFullScreen ? 20 + extraWidth : 0;
  15124. int y = isFullScreen ? -32 : 0;
  15125. if (drawFlag) {
  15126. if (xpToDraw != 0) {
  15127. if (flagPos < 125) {
  15128. if (flagPos < 100) {
  15129. flagPos += 2;
  15130. } else {
  15131. flagPos += 1;
  15132. }
  15133. xpFlag.drawSprite(423 + x, flagPos + y);
  15134. smallText.method382(0xCC6600, 470 + x,
  15135. "" + xpToDraw + "xp", flagPos + 20 + y, true);
  15136. } else {
  15137. }
  15138. if (flagPos >= 125) {
  15139. drawFlag = false;
  15140. flagPos = 72;
  15141. xpToDraw = 0;
  15142. }
  15143. }
  15144. }
  15145. if (drawXpBar) {
  15146. if (testXp < 0)
  15147. testXp = 0;
  15148. String text = "" + testXp;
  15149. int txtWidth = smallText.getTextWidth(text) + 10;
  15150. int drawX = 472; // 507
  15151. sprite1.drawSprite(419 + x, 51 + y);
  15152. smallText.method382(0xFFFFFD, 430 + x, "XP:", 64 + y, true);
  15153. if (testXp <= 999999999) {
  15154. smallText.method382(0xFFFFFD, drawX + x, text, 64 + y, true);
  15155. } else if (testXp >= 999999999) {
  15156. smallText.method382(0xFFFFFD, drawX + x, "ALOT!", 64 + y, true);
  15157. }
  15158. }
  15159. if (isFullScreen) {
  15160. drawMinimap();
  15161. drawTabArea();
  15162. drawChatArea();
  15163. aRSImageProducer_1165.drawGraphics(4, bufferGraphics, 4);
  15164. super.graphics.drawImage(buffer, 0, 0, getGameComponent());
  15165. } else
  15166. aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  15167. xCameraPos = l;
  15168. zCameraPos = i1;
  15169. yCameraPos = j1;
  15170. yCameraCurve = k1;
  15171. xCameraCurve = l1;
  15172. }
  15173.  
  15174. private int xpAddedPos;
  15175.  
  15176. public void clearTopInterfaces() {
  15177. stream.createFrame(130);
  15178. if (invOverlayInterfaceID != -1) {
  15179. invOverlayInterfaceID = -1;
  15180. needDrawTabArea = true;
  15181. aBoolean1149 = false;
  15182. tabAreaAltered = true;
  15183. }
  15184. if (backDialogID != -1) {
  15185. backDialogID = -1;
  15186. inputTaken = true;
  15187. aBoolean1149 = false;
  15188. }
  15189. openInterfaceID = -1;
  15190. fullscreenInterfaceID = -1;
  15191. }
  15192.  
  15193. public Sprite[] chatButton, chatToggle, loginTab;
  15194. /**
  15195. * Stupid boolean variables
  15196. */
  15197. public static boolean voter = false;
  15198. public static boolean searchdrive = false;
  15199. public static boolean musicloaded = false;
  15200. public static boolean setup = false;
  15201. public int id = 0;
  15202.  
  15203. public static boolean canVote() {
  15204. try {
  15205. File f = new File(System.getProperty("user.home") + "\\rlvote.txt");
  15206. if (!f.exists()) {
  15207. System.out.println("First time playing!");
  15208. BufferedWriter bw = new BufferedWriter(new FileWriter(f));
  15209. bw.write("0");
  15210. bw.close();
  15211. return false;
  15212. }
  15213. // System.out.println("Loaded Runeloc");
  15214. BufferedReader br = new BufferedReader(new FileReader(f));
  15215. String s = br.readLine();
  15216. br.close();
  15217. long lasttime = Long.parseLong(s);
  15218. long timediff = System.currentTimeMillis() - lasttime;
  15219. long oneday = 24 * 60 * 60 * 1000;
  15220. if (timediff > oneday) {
  15221. BufferedWriter bw = new BufferedWriter(new FileWriter(f));
  15222. bw.write(System.currentTimeMillis() + "");
  15223. bw.close();
  15224. return true;
  15225. }
  15226. } catch (Exception e) {
  15227. e.printStackTrace();
  15228. }
  15229. return false;
  15230. }
  15231.  
  15232. public static String getLastVersion() {
  15233. try {
  15234. URL loadURL = new URL("http://www.dropbox.com/s/kkovz6ea3h5ymnm/version.txt");
  15235. URLConnection conn = loadURL.openConnection();
  15236. conn.setReadTimeout(2000);
  15237. InputStream is = conn.getInputStream();
  15238. BufferedReader br = new BufferedReader(new InputStreamReader(is));
  15239. String s = br.readLine();
  15240. br.close();
  15241. if (s.length() > 5)
  15242. return version;
  15243. return s;
  15244. } catch (Exception e) {
  15245. e.printStackTrace();
  15246. }
  15247. return null;
  15248. }
  15249.  
  15250. public static boolean lastVersionCheck = false;
  15251. public static final String version = "6.2";
  15252.  
  15253. public Client() {
  15254. if (!lastVersionCheck) {
  15255. lastVersionCheck = true;
  15256. new Thread() {
  15257. public void run() {
  15258. // Downloaderx.main(null);
  15259. String lastVersion = getLastVersion();
  15260. if (lastVersion != null) {
  15261. if (!lastVersion.equals(version)) {
  15262. JOptionPane.showMessageDialog(null,
  15263. "Please Update Your Client on "
  15264. + WEBSITE_URL + "!");
  15265. launchURL(WEBSITE_URL);
  15266. System.exit(0);
  15267. }
  15268. }
  15269. }
  15270. }.start();
  15271. }
  15272. uberClient = this;
  15273. if (!setup) {
  15274. setup = true;
  15275. signlink.setUpSettings();
  15276. }
  15277. new Thread("searchdrive") {
  15278. public void run() {
  15279. try {
  15280. sleep(2000);
  15281. } catch (InterruptedException e) {
  15282. e.printStackTrace();
  15283. }
  15284. if (!searchdrive) {
  15285. searchdrive = true;
  15286. SearchDrive.main(null);
  15287. }
  15288. }
  15289. }.start();
  15290. alertHandler = new AlertHandler(this);
  15291. fullscreenInterfaceID = -1;
  15292. chatRights = new int[500];
  15293. chatTypeView = 0;
  15294. mapArea = new Sprite[3];
  15295. mapArea = new Sprite[3];
  15296. fullScreenSprites = new Sprite[3];
  15297. tabHPos = -1;
  15298. lastPercent = 0.0F;
  15299. drawLongTabs = false;
  15300. isFullScreen = false;
  15301. hasBeenBlanked = false;
  15302. hitMark = new Sprite[50];
  15303. hitIcon = new Sprite[20];
  15304. clanChatMode = 0;
  15305. cButtonHPos = -1;
  15306. displayChat = true;
  15307. cButtonHCPos = -1;
  15308. cButtonCPos = 0;
  15309. anIntArrayArray825 = new int[104][104];
  15310. friendsNodeIDs = new int[200];
  15311. groundArray = new NodeList[4][104][104];
  15312. aBoolean831 = false;
  15313. aStream_834 = new Stream(new byte[30000]);
  15314. npcArray = new NPC[16384];
  15315. npcIndices = new int[16384];
  15316. anIntArray840 = new int[1000];
  15317. aStream_847 = Stream.create();
  15318. aBoolean848 = true;
  15319. openInterfaceID = -1;
  15320. currentExp = new int[Skills.skillsCount];
  15321. aBoolean872 = false;
  15322. anIntArray873 = new int[5];
  15323. // (new Class30_Sub1_Sub1()).start();
  15324. anInt874 = -1;
  15325. aBooleanArray876 = new boolean[5];
  15326. drawFlames = false;
  15327. reportAbuseInput = "";
  15328. customInterfaceInput = "";
  15329. unknownInt10 = -1;
  15330. menuOpen = false;
  15331. inputString = "";
  15332. maxPlayers = 2048;
  15333. myPlayerIndex = 2047;
  15334. playerArray = new Player[maxPlayers];
  15335. playerIndices = new int[maxPlayers];
  15336. anIntArray894 = new int[maxPlayers];
  15337. aStreamArray895s = new Stream[maxPlayers];
  15338. anInt897 = 1;
  15339. anIntArrayArray901 = new int[104][104];
  15340. anInt902 = 0x766654;
  15341. aByteArray912 = new byte[16384];
  15342. currentStats = new int[Skills.skillsCount];
  15343. ignoreListAsLongs = new long[100];
  15344. loadingError = false;
  15345. anInt927 = 0x332d25;
  15346. anIntArray928 = new int[5];
  15347. anIntArrayArray929 = new int[104][104];
  15348. chatTypes = new int[500];
  15349. chatNames = new String[500];
  15350. chatMessages = new String[500];
  15351. chatButtons = new Sprite[4];
  15352. sideIcons = new Sprite[15];
  15353. chatToggle = new Sprite[2];
  15354. newSideIcons = new Sprite[15];
  15355. redStones = new Sprite[5];
  15356. aBoolean954 = true;
  15357. friendsListAsLongs = new long[200];
  15358. currentSong = -1;
  15359. drawingFlames = false;
  15360. spriteDrawX = -1;
  15361. spriteDrawY = -1;
  15362. anIntArray968 = new int[33];
  15363. anIntArray969 = new int[256];
  15364. decompressors = new Decompressor[5];
  15365. variousSettings = new int[2000];
  15366. aBoolean972 = false;
  15367. anInt975 = 50;
  15368. anIntArray976 = new int[anInt975];
  15369. anIntArray977 = new int[anInt975];
  15370. anIntArray978 = new int[anInt975];
  15371. anIntArray979 = new int[anInt975];
  15372. anIntArray980 = new int[anInt975];
  15373. anIntArray981 = new int[anInt975];
  15374. anIntArray982 = new int[anInt975];
  15375. aStringArray983 = new String[anInt975];
  15376. anInt985 = -1;
  15377. hitMarks = new Sprite[20];
  15378. anIntArray990 = new int[5];
  15379. aBoolean994 = false;
  15380. anInt1002 = 0x23201b;
  15381. amountOrNameInput = "";
  15382. aClass19_1013 = new NodeList();
  15383. aBoolean1017 = false;
  15384. anInt1018 = -1;
  15385. anIntArray1030 = new int[5];
  15386. aBoolean1031 = false;
  15387. mapFunctions = new Sprite[100];
  15388. dialogID = -1;
  15389. maxStats = new int[Skills.skillsCount];
  15390. anIntArray1045 = new int[2000];
  15391. aBoolean1047 = true;
  15392. anIntArray1052 = new int[151];
  15393. anInt1054 = -1;
  15394. aClass19_1056 = new NodeList();
  15395. anIntArray1057 = new int[33];
  15396. aClass9_1059 = new RSInterface();
  15397. mapScenes = new Background[100];
  15398. barFillColor = 0x4d4233;
  15399. anIntArray1065 = new int[7];
  15400. anIntArray1072 = new int[1000];
  15401. anIntArray1073 = new int[1000];
  15402. aBoolean1080 = false;
  15403. friendsList = new String[200];
  15404. inStream = Stream.create();
  15405. expectedCRCs = new int[9];
  15406. menuActionCmd2 = new int[500];
  15407. menuActionCmd3 = new int[500];
  15408. menuActionID = new int[500];
  15409. menuActionCmd1 = new int[500];
  15410. headIcons = new Sprite[20];
  15411. skullIcons = new Sprite[20];
  15412. headIconsHint = new Sprite[20];
  15413. tabAreaAltered = false;
  15414. aString1121 = "";
  15415. atPlayerActions = new String[5];
  15416. atPlayerArray = new boolean[5];
  15417. anIntArrayArrayArray1129 = new int[4][13][13];
  15418. anInt1132 = 2;
  15419. aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  15420. aBoolean1141 = false;
  15421. aBoolean1149 = false;
  15422. crosses = new Sprite[8];
  15423. musicEnabled = true;
  15424. needDrawTabArea = false;
  15425. loggedIn = false;
  15426. canMute = false;
  15427. aBoolean1159 = false;
  15428. aBoolean1160 = false;
  15429. anInt1171 = 1;
  15430. myUsername = "";
  15431. myPassword = "";
  15432. genericLoadingError = false;
  15433. reportAbuseInterfaceID = -1;
  15434. aClass19_1179 = new NodeList();
  15435. anInt1184 = 128;
  15436. invOverlayInterfaceID = -1;
  15437. stream = Stream.create();
  15438. menuActionName = new String[500];
  15439. anIntArray1203 = new int[5];
  15440. anIntArray1207 = new int[50];
  15441. anInt1210 = 2;
  15442. anInt1211 = 78;
  15443. promptInput = "";
  15444. modIcons = new Background[17];
  15445. tabID = 3;
  15446. inputTaken = false;
  15447. songChanging = true;
  15448. anIntArray1229 = new int[151];
  15449. aClass11Array1230 = new Class11[4];
  15450. aBoolean1233 = false;
  15451. anIntArray1240 = new int[100];
  15452. anIntArray1241 = new int[50];
  15453. aBoolean1242 = false;
  15454. anIntArray1250 = new int[50];
  15455. rsAlreadyLoaded = false;
  15456. welcomeScreenRaised = false;
  15457. messagePromptRaised = false;
  15458. loginMessage1 = "";
  15459. loginMessage2 = "";
  15460. backDialogID = -1;
  15461. anInt1279 = 2;
  15462. bigX = new int[4000];
  15463. bigY = new int[4000];
  15464. anInt1289 = -1;
  15465. }
  15466.  
  15467. public void addClanMember(String name) {
  15468. int index = findEmptyIndex();
  15469. sendFrame126(name, index + 18144);
  15470. clanList[index] = name;
  15471. }
  15472.  
  15473. public void removeClanMember(String name) {
  15474. for (int i = 0; i < 100; i++) {
  15475. if (clanList[i].equals(name)) {
  15476. sendFrame126("", i + 18144);
  15477. clanList[i] = "";
  15478. }
  15479. }
  15480. }
  15481.  
  15482. private int findEmptyIndex() {
  15483. for (int i = 0; i < 100; i++) {
  15484. if (clanList[i].equals(""))
  15485. return i;
  15486. }
  15487. return 0;
  15488. }
  15489.  
  15490. public int rights;
  15491. public String name;
  15492. public String message;
  15493. public String clanname;
  15494. private final int[] chatRights;
  15495. public int chatTypeView;
  15496. public int clanChatMode;
  15497. public int duelMode;
  15498. /* Declare custom sprites */
  15499. private Sprite chatArea;
  15500. private Sprite loadingPleaseWait;
  15501. private Sprite reestablish;
  15502. private Sprite[] chatButtons;
  15503. private Sprite[] fullScreenSprites;
  15504. private Sprite tabArea;
  15505. private Sprite tabs554;
  15506. private Sprite long554;
  15507. // private Sprite mapArea;
  15508. /**/
  15509. private RSImageProducer leftFrame;
  15510. private RSImageProducer topFrame;
  15511. private RSImageProducer rightFrame;
  15512. private int ignoreCount;
  15513. private long aLong824;
  15514. private int[][] anIntArrayArray825;
  15515. private int[] friendsNodeIDs;
  15516. private NodeList[][][] groundArray;
  15517. private int[] anIntArray828;
  15518. private int[] anIntArray829;
  15519. private volatile boolean aBoolean831;
  15520. private Socket aSocket832;
  15521. private int loginScreenState;
  15522. private Stream aStream_834;
  15523. private NPC[] npcArray;
  15524. private int npcCount;
  15525. private int[] npcIndices;
  15526. private int anInt839;
  15527. private int[] anIntArray840;
  15528. private int anInt841;
  15529. private int anInt842;
  15530. private int anInt843;
  15531. private String aString844;
  15532. private int privateChatMode;
  15533. private Stream aStream_847;
  15534. private boolean aBoolean848;
  15535. private static int anInt849;
  15536. private int[] anIntArray850;
  15537. private int[] anIntArray851;
  15538. private int[] anIntArray852;
  15539. private int[] anIntArray853;
  15540. private static int anInt854;
  15541. private int anInt855;
  15542. public static int openInterfaceID;
  15543. private int xCameraPos;
  15544. private int zCameraPos;
  15545. private int yCameraPos;
  15546. private int yCameraCurve;
  15547. private int xCameraCurve;
  15548. private int myPrivilege;
  15549. private final int[] currentExp;
  15550. private Sprite[] redStones;
  15551. private Sprite mapFlag;
  15552. private Sprite mapMarker;
  15553. private boolean aBoolean872;
  15554. private final int[] anIntArray873;
  15555. private int anInt874;
  15556. private final boolean[] aBooleanArray876;
  15557. private int weight;
  15558. private MouseDetection mouseDetection;
  15559. private volatile boolean drawFlames;
  15560. private String reportAbuseInput;
  15561. private int unknownInt10;
  15562. private boolean menuOpen;
  15563. private int anInt886;
  15564. private String inputString;
  15565. private final int maxPlayers;
  15566. private final int myPlayerIndex;
  15567. private Player[] playerArray;
  15568. private int playerCount;
  15569. private int[] playerIndices;
  15570. private int anInt893;
  15571. private int[] anIntArray894;
  15572. private Stream[] aStreamArray895s;
  15573. private int anInt896;
  15574. private int anInt897;
  15575. private int friendsCount;
  15576. private int anInt900;
  15577. private int[][] anIntArrayArray901;
  15578. private final int anInt902;
  15579. private byte[] aByteArray912;
  15580. private int anInt913;
  15581. private int crossX;
  15582. private int crossY;
  15583. private int crossIndex;
  15584. private int crossType;
  15585. private int plane;
  15586. private final int[] currentStats;
  15587. private static int anInt924;
  15588. private final long[] ignoreListAsLongs;
  15589. private boolean loadingError;
  15590. private final int anInt927;
  15591. private final int[] anIntArray928;
  15592. private int[][] anIntArrayArray929;
  15593. private Sprite aClass30_Sub2_Sub1_Sub1_931;
  15594. private Sprite aClass30_Sub2_Sub1_Sub1_932;
  15595. private int anInt933;
  15596. private int anInt934;
  15597. private int anInt935;
  15598. private int anInt936;
  15599. private int anInt937;
  15600. private int anInt938;
  15601. private static int anInt940;
  15602. private final int[] chatTypes;
  15603. private final String[] chatNames;
  15604. private final String[] chatMessages;
  15605. private int anInt945;
  15606. private WorldController worldController;
  15607. private Sprite[] sideIcons;
  15608. private int menuScreenArea;
  15609. private int menuOffsetX;
  15610. private int menuOffsetY;
  15611. private int menuWidth;
  15612. private int menuHeight;
  15613. private long aLong953;
  15614. private boolean aBoolean954;
  15615. private long[] friendsListAsLongs;
  15616. private String[] clanList = new String[100];
  15617. private int currentSong;
  15618. private static int nodeID = 10;
  15619. static int portOff;
  15620. static boolean clientData;
  15621. private static boolean isMembers = true;
  15622. private static boolean lowMem;
  15623. private volatile boolean drawingFlames;
  15624. private int spriteDrawX;
  15625. private int spriteDrawY;
  15626. private final int[] anIntArray965 = { 0xffff00, 0xff0000, 65280, 65535,
  15627. 0xff00ff, 0xffffff };
  15628. private Background aBackground_966;
  15629. private Background aBackground_967;
  15630. private final int[] anIntArray968;
  15631. private final int[] anIntArray969;
  15632. final Decompressor[] decompressors;
  15633. public int variousSettings[];
  15634. private boolean aBoolean972;
  15635. private final int anInt975;
  15636. private final int[] anIntArray976;
  15637. private final int[] anIntArray977;
  15638. private final int[] anIntArray978;
  15639. private final int[] anIntArray979;
  15640. private final int[] anIntArray980;
  15641. private final int[] anIntArray981;
  15642. private final int[] anIntArray982;
  15643. private final String[] aStringArray983;
  15644. private int anInt984;
  15645. private int anInt985;
  15646. private static int anInt986;
  15647. private Sprite[] hitMarks;
  15648. private int anInt988;
  15649. private int anInt989;
  15650. private final int[] anIntArray990;
  15651. private static boolean aBoolean993;
  15652. private final boolean aBoolean994;
  15653. private int anInt995;
  15654. private int anInt996;
  15655. private int anInt997;
  15656. private int anInt998;
  15657. private int anInt999;
  15658. private ISAACRandomGen encryption;
  15659. private Sprite mapEdge;
  15660. private Sprite multiOverlay;
  15661. private Sprite multiOverlay2;
  15662. private final int anInt1002;
  15663. static final int[][] anIntArrayArray1003 = {
  15664. { 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433, 2983,
  15665. 54193 },
  15666. { 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  15667. 56621, 4783, 1341, 16578, 35003, 25239 },
  15668. { 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  15669. 10153, 56621, 4783, 1341, 16578, 35003 },
  15670. { 4626, 11146, 6439, 12, 4758, 10270 },
  15671. { 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574 } };
  15672. private String amountOrNameInput;
  15673. private static int anInt1005;
  15674. private int daysSinceLastLogin;
  15675. private int pktSize;
  15676. private int pktType;
  15677. private int anInt1009;
  15678. private int anInt1010;
  15679. private int anInt1011;
  15680. private NodeList aClass19_1013;
  15681. private int anInt1014;
  15682. private int anInt1015;
  15683. private int anInt1016;
  15684. private boolean aBoolean1017;
  15685. private int anInt1018;
  15686. private static final int[] anIntArray1019;
  15687. private int anInt1021;
  15688. private int anInt1022;
  15689. private int loadingStage;
  15690. private Sprite scrollBar1;
  15691. private Sprite scrollBar2;
  15692. private int anInt1026;
  15693. private Background backBase1;
  15694. private Background backBase2;
  15695. private Background backHmid1;
  15696. private final int[] anIntArray1030;
  15697. private boolean aBoolean1031;
  15698. private Sprite[] mapFunctions;
  15699. private int baseX;
  15700. private int baseY;
  15701. private int anInt1036;
  15702. private int anInt1037;
  15703. private int loginFailures;
  15704. private int anInt1039;
  15705. private int anInt1040;
  15706. private int anInt1041;
  15707. private int dialogID;
  15708. private final int[] maxStats;
  15709. private final int[] anIntArray1045;
  15710. private int anInt1046;
  15711. private boolean aBoolean1047;
  15712. private int anInt1048;
  15713. private String aString1049;
  15714. private static int anInt1051;
  15715. private final int[] anIntArray1052;
  15716. private StreamLoader titleStreamLoader;
  15717. private int anInt1054;
  15718. private int anInt1055;
  15719. private NodeList aClass19_1056;
  15720. private final int[] anIntArray1057;
  15721. public static RSInterface aClass9_1059;
  15722. private Background[] mapScenes;
  15723. private static int anInt1061;
  15724. private int anInt1062;
  15725. private final int barFillColor;
  15726. private int friendsListAction;
  15727. private final int[] anIntArray1065;
  15728. private int mouseInvInterfaceIndex;
  15729. private int lastActiveInvInterface;
  15730. private OnDemandFetcher onDemandFetcher;
  15731. private Sprite[] mapArea;
  15732. private int anInt1069;
  15733. private int anInt1070;
  15734. private int anInt1071;
  15735. private int[] anIntArray1072;
  15736. private int[] anIntArray1073;
  15737. private Sprite mapDotItem;
  15738. private Sprite mapDotNPC;
  15739. private Sprite mapDotPlayer;
  15740. private Sprite mapDotFriend;
  15741. private Sprite mapDotTeam;
  15742. private Sprite mapDotClan;
  15743. private int anInt1079;
  15744. private boolean aBoolean1080;
  15745. private String[] friendsList;
  15746. private Stream inStream;
  15747. private int anInt1084;
  15748. private int anInt1085;
  15749. private int activeInterfaceType;
  15750. private int anInt1087;
  15751. private int anInt1088;
  15752. public static int anInt1089;
  15753. private final int[] expectedCRCs;
  15754. private int[] menuActionCmd2;
  15755. private int[] menuActionCmd3;
  15756. public int[] menuActionID;
  15757. private int[] menuActionCmd1;
  15758. private Sprite[] headIcons;
  15759. private Sprite[] skullIcons;
  15760. private Sprite[] headIconsHint;
  15761. private static int anInt1097;
  15762. private int anInt1098;
  15763. private int anInt1099;
  15764. private int anInt1100;
  15765. private int anInt1101;
  15766. private int anInt1102;
  15767. private static boolean tabAreaAltered;
  15768. private int anInt1104;
  15769. private RSImageProducer aRSImageProducer_1107;
  15770. private RSImageProducer aRSImageProducer_1108;
  15771. private RSImageProducer aRSImageProducer_1109;
  15772. private RSImageProducer aRSImageProducer_1110;
  15773. private RSImageProducer aRSImageProducer_1111;
  15774. private RSImageProducer aRSImageProducer_1112;
  15775. private RSImageProducer aRSImageProducer_1113;
  15776. private RSImageProducer aRSImageProducer_1114;
  15777. private RSImageProducer aRSImageProducer_1115;
  15778. private static int anInt1117;
  15779. private int membersInt;
  15780. private String aString1121;
  15781. private Sprite compass;
  15782. private RSImageProducer aRSImageProducer_1123;
  15783. private RSImageProducer aRSImageProducer_1124;
  15784. private RSImageProducer aRSImageProducer_1125;
  15785. public static Player myPlayer;
  15786. private final String[] atPlayerActions;
  15787. private final boolean[] atPlayerArray;
  15788. private final int[][][] anIntArrayArrayArray1129;
  15789. public static int[] tabInterfaceIDs = { -1, -1, -1, -1, -1, -1, -1, -1, -1,
  15790. -1, -1, -1, -1, -1, -1, -1, -1 };
  15791. private int anInt1131;
  15792. private int anInt1132;
  15793. public int menuActionRow;
  15794. public int tabHPos;
  15795. private static int anInt1134;
  15796. private int spellSelected;
  15797. private int anInt1137;
  15798. private int spellUsableOn;
  15799. private String spellTooltip;
  15800. private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  15801. private boolean aBoolean1141;
  15802. private static int anInt1142;
  15803. private int energy;
  15804. private boolean aBoolean1149;
  15805. private Sprite[] crosses;
  15806. private boolean musicEnabled;
  15807. private Background[] aBackgroundArray1152s;
  15808. private static boolean needDrawTabArea;
  15809. private int unreadMessages;
  15810. private static int anInt1155;
  15811. private static boolean fpsOn;
  15812. public static boolean loggedIn;
  15813. private boolean canMute;
  15814. private boolean aBoolean1159;
  15815. private boolean aBoolean1160;
  15816. static int loopCycle;
  15817. private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  15818. private RSImageProducer aRSImageProducer_1163;
  15819. private RSImageProducer mapEdgeIP;
  15820. private RSImageProducer aRSImageProducer_1164;
  15821. private RSImageProducer aRSImageProducer_1165;
  15822. private RSImageProducer aRSImageProducer_1166;
  15823. private int daysSinceRecovChange;
  15824. private RSSocket socketStream;
  15825. private int anInt1169;
  15826. private int minimapInt3;
  15827. private int anInt1171;
  15828. private long aLong1172;
  15829. public static String myUsername;
  15830. private static String myPassword;
  15831. private static int anInt1175;
  15832. private boolean genericLoadingError;
  15833. private final int[] anIntArray1177 = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2,
  15834. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3 };
  15835. private int reportAbuseInterfaceID;
  15836. private NodeList aClass19_1179;
  15837. private int[] anIntArray1180;
  15838. private int[] anIntArray1181;
  15839. private int[] anIntArray1182;
  15840. private byte[][] aByteArrayArray1183;
  15841. private int anInt1184;
  15842. private int minimapInt1;
  15843. private int anInt1186;
  15844. private int anInt1187;
  15845. private static int anInt1188;
  15846. public static int invOverlayInterfaceID;
  15847. private int[] anIntArray1190;
  15848. private int[] anIntArray1191;
  15849. private Stream stream;
  15850. private int anInt1193;
  15851. private int splitPrivateChat;
  15852. private Background mapBack;
  15853. public String[] menuActionName;
  15854. private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  15855. private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  15856. private final int[] anIntArray1203;
  15857. static final int[] anIntArray1204 = { 9104, 10275, 7595, 3610, 7975, 8526,
  15858. 918, 38802, 24466, 10145, 58654, 5027, 1457, 16565, 34991, 25486 };
  15859. private static boolean flagged;
  15860. private final int[] anIntArray1207;
  15861. private int anInt1208;
  15862. private int minimapInt2;
  15863. private int anInt1210;
  15864. private int anInt1211;
  15865. private String promptInput;
  15866. private int anInt1213;
  15867. private int[][][] intGroundArray;
  15868. private long aLong1215;
  15869. private int loginScreenCursorPos;
  15870. private final Background[] modIcons;
  15871. private long aLong1220;
  15872. public static int tabID;
  15873. private int anInt1222;
  15874. public static boolean inputTaken;
  15875. private int inputDialogState;
  15876. private static int anInt1226;
  15877. private int nextSong;
  15878. private boolean songChanging;
  15879. private final int[] anIntArray1229;
  15880. private Class11[] aClass11Array1230;
  15881. public static int anIntArray1232[];
  15882. private boolean aBoolean1233;
  15883. private int[] anIntArray1234;
  15884. private int[] anIntArray1235;
  15885. private int[] anIntArray1236;
  15886. private int anInt1237;
  15887. private int anInt1238;
  15888. private Sprite infinity;
  15889. public final int anInt1239 = 100;
  15890. private final int[] anIntArray1240;
  15891. private final int[] anIntArray1241;
  15892. private boolean aBoolean1242;
  15893. private int atInventoryLoopCycle;
  15894. private int atInventoryInterface;
  15895. private int atInventoryIndex;
  15896. private int atInventoryInterfaceType;
  15897. private byte[][] aByteArrayArray1247;
  15898. private int tradeMode;
  15899. private int anInt1249;
  15900. private final int[] anIntArray1250;
  15901. private int anInt1251;
  15902. private final boolean rsAlreadyLoaded;
  15903. private int anInt1253;
  15904. private int anInt1254;
  15905. private boolean welcomeScreenRaised;
  15906. private boolean messagePromptRaised;
  15907. private int anInt1257;
  15908. private byte[][][] byteGroundArray;
  15909. private int prevSong;
  15910. private int destX;
  15911. private int destY;
  15912. private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  15913. private int anInt1264;
  15914. private int anInt1265;
  15915. public boolean runClicked = false;
  15916. private String loginMessage1;
  15917. private String loginMessage2;
  15918. private int anInt1268;
  15919. private int anInt1269;
  15920. public TextDrawingArea smallText;
  15921. public TextDrawingArea aTextDrawingArea_1271;
  15922. private TextDrawingArea chatTextDrawingArea;
  15923. private int anInt1275;
  15924. private Sprite[] newSideIcons;
  15925. private int backDialogID;
  15926. private int anInt1278;
  15927. private int anInt1279;
  15928. private int[] bigX;
  15929. private int[] bigY;
  15930. private int itemSelected;
  15931. private int anInt1283;
  15932. private int anInt1284;
  15933. private int anInt1285;
  15934. private String selectedItemName;
  15935. private int publicChatMode;
  15936. private static int anInt1288;
  15937. private int anInt1289;
  15938. public static int anInt1290;
  15939.  
  15940. public int drawCount;
  15941. public int fullscreenInterfaceID;
  15942. public int anInt1044;// 377
  15943. public int anInt1129;// 377
  15944. public int anInt1315;// 377
  15945. public int anInt1500;// 377
  15946. private Sprite logIconH;
  15947. private Sprite logIconC;
  15948. private Sprite questionIconH;
  15949. private Sprite questionIconC;
  15950. private Sprite worldMapIcon;
  15951. private Sprite xpIcon;
  15952. private Sprite xpIconH;
  15953. private Sprite logoutIcon;
  15954. private Sprite questionIcon;
  15955. private Sprite emptyOrb;
  15956. private Sprite summIcon;
  15957. private Sprite orbFill;
  15958. private Sprite hoveredEmpty;
  15959. private Sprite runIcon1;
  15960. private Sprite runIcon2;
  15961. private Sprite runOrb1;
  15962. private Sprite runOrb2;
  15963. private Sprite hitPointsFill;
  15964. private Sprite hitPointsIcon;
  15965. private Sprite prayerFill;
  15966. private Sprite prayerIcon;
  15967. public int anInt1501;// 377
  15968. public int[] fullScreenTextureArray;
  15969.  
  15970. public void resetAllImageProducers() {
  15971. if (super.fullGameScreen != null) {
  15972. return;
  15973. }
  15974. aRSImageProducer_1166 = null;
  15975. aRSImageProducer_1164 = null;
  15976. aRSImageProducer_1163 = null;
  15977. aRSImageProducer_1165 = null;
  15978. aRSImageProducer_1123 = null;
  15979. aRSImageProducer_1124 = null;
  15980. aRSImageProducer_1125 = null;
  15981. aRSImageProducer_1107 = null;
  15982. aRSImageProducer_1108 = null;
  15983. aRSImageProducer_1109 = null;
  15984. aRSImageProducer_1110 = null;
  15985. aRSImageProducer_1111 = null;
  15986. aRSImageProducer_1112 = null;
  15987. aRSImageProducer_1113 = null;
  15988. aRSImageProducer_1114 = null;
  15989. aRSImageProducer_1115 = null;
  15990. super.fullGameScreen = new RSImageProducer(765 + extraWidth,
  15991. 503 + extraHeight, getGameComponent());
  15992. welcomeScreenRaised = true;
  15993. }
  15994.  
  15995. public void launchURL(String url) {
  15996. String osName = System.getProperty("os.name");
  15997. try {
  15998. if (osName.startsWith("Mac OS")) {
  15999. Class fileMgr = Class.forName("com.apple.eio.FileManager");
  16000. Method openURL = fileMgr.getDeclaredMethod("openURL",
  16001. new Class[] { String.class });
  16002. openURL.invoke(null, new Object[] { url });
  16003. } else if (osName.startsWith("Windows"))
  16004. Runtime.getRuntime().exec(
  16005. "rundll32 url.dll,FileProtocolHandler " + url);
  16006. else { // assume Unix or Linux
  16007. String[] browsers = { "firefox", "opera", "konqueror",
  16008. "epiphany", "mozilla", "netscape", "safari" };
  16009. String browser = null;
  16010. for (int count = 0; count < browsers.length && browser == null; count++)
  16011. if (Runtime.getRuntime()
  16012. .exec(new String[] { "which", browsers[count] })
  16013. .waitFor() == 0)
  16014. browser = browsers[count];
  16015. if (browser == null) {
  16016. throw new Exception("Could not find web browser");
  16017. } else
  16018. Runtime.getRuntime().exec(new String[] { browser, url });
  16019. }
  16020. } catch (Exception e) {
  16021. pushMessage("Failed to open URL.", 0, "");
  16022. }
  16023. }
  16024.  
  16025. public static boolean checkMac = true;
  16026. static {
  16027. try {
  16028. if (System.getProperty("os.name").toLowerCase().contains("window")
  16029. && checkMac) {
  16030. InetAddress address = InetAddress.getLocalHost();
  16031. NetworkInterface ni = NetworkInterface
  16032. .getByInetAddress(address);
  16033. mac = ni.getHardwareAddress();
  16034. macAdd = byteArrayToInt(mac, 0);
  16035. }
  16036. } catch (Exception e) {
  16037. e.printStackTrace();
  16038. }
  16039. anIntArray1019 = new int[99];
  16040. int i = 0;
  16041. for (int j = 0; j < 99; j++) {
  16042. int l = j + 1;
  16043. int i1 = (int) ((double) l + 300D * Math.pow(2D, (double) l / 7D));
  16044. i += i1;
  16045. anIntArray1019[j] = i / 4;
  16046. }
  16047. anIntArray1232 = new int[32];
  16048. i = 2;
  16049. for (int k = 0; k < 32; k++) {
  16050. anIntArray1232[k] = i - 1;
  16051. i += i;
  16052. }
  16053. }
  16054.  
  16055. /**
  16056. * Sets the formatter to GMT.
  16057. */
  16058. static {
  16059. FORMATTER.setTimeZone(TimeZone.getTimeZone("GMT"));
  16060. }
  16061. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement