Guest User

Untitled

a guest
Mar 22nd, 2016
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 309.61 KB | None | 0 0
  1. public void startUp() {
  2. initCache();
  3. if (((String) LoginSettings.getSetting("FirstLoad")).equalsIgnoreCase("0")) {
  4. updateProgress("Remvoing Old Junk Files", 10);
  5. DeleteFiles();
  6. updateProgress("Junk Files Remvoed", 10);
  7. }
  8. updateProgress("Starting up", 0);
  9. if (Signlink.sunjava) {
  10. super.minDelay = 5;
  11. }
  12. getDocumentBaseHost();
  13. if (Signlink.cache_dat != null) {
  14. for (int index = 0; index < 6; index++) {
  15. cacheIndices[index] = new CacheIndex(Signlink.cache_dat, Signlink.cache_idx[index], index + 1);
  16. }
  17. for (int index = 0; index < 6; index++) {
  18. mainCacheIndices[index] = new CacheIndex(Signlink.MAIN_CACHE_DATA, Signlink.MAIN_CACHE_INDEX[index], index + 1);
  19. }
  20. }
  21. try {
  22. if (Constants.UPDATE_SERVER_ENABLED) {
  23. connect();
  24. }
  25. titleStreamLoader = getArchive(1, "title screen", "title", expectedCRCs[1], 25);
  26. smallText = new RSFont(false, "p11_full", titleStreamLoader);
  27. normalFont = new RSFont(false, "p12_full", titleStreamLoader);
  28. boldFont = new RSFont(false, "b12_full", titleStreamLoader);
  29. fancyText = new RSFont(true, "q8_full", titleStreamLoader);
  30. newSmallFont = new RSFontSystem(false, "p11_full", titleStreamLoader);
  31. newRegularFont = new RSFontSystem(false, "p12_full", titleStreamLoader);
  32. newBoldFont = new RSFontSystem(false, "b12_full", titleStreamLoader);
  33. newFancyFont = new RSFontSystem(true, "q8_full", titleStreamLoader);
  34. regularHitFont = new RSFontSystem(false, "regularhit", titleStreamLoader);
  35. bigHitFont = new RSFontSystem(true, "bighit", titleStreamLoader);
  36. loadTitleScreen();
  37. Archive config = getArchive(2, "config", "config", expectedCRCs[2], 30);
  38. Archive currentConfig = getCurrentArchive(2, "config", "config", expectedCRCs[2], 30);
  39. Archive interfaces = getArchive(3, "interface", "interface", expectedCRCs[3], 35);
  40. media = getArchive(4, "2d graphics", "media", expectedCRCs[4], 40);
  41. @SuppressWarnings("unused")
  42. Archive texture = getArchive(6, "textures", "textures", expectedCRCs[6], 45);
  43. Archive chat = getArchive(7, "chat system", "wordenc", expectedCRCs[7], 50);
  44. // Archive sound = getArchive(8, "sound effects", "sounds", expectedCRCs[8], 55);
  45. try {
  46. spriteManager = new CacheManager("sprites", 10, false);
  47. spriteManager.read();
  48.  
  49. RSImageLoader.loadSprites();
  50. loadedImages = true;
  51.  
  52. } catch (Exception e) {
  53. System.out.println("An error occurred while reading the image cache.");
  54. e.printStackTrace();
  55. }
  56. try {
  57. loadTitleImages();
  58. } catch (Exception e) {
  59. System.out.println("An error occurred while reading the title sprites.");
  60. e.printStackTrace();
  61. }
  62. // packMaps();
  63. groundTileSettings = new byte[4][104][104];
  64. heightMap = new int[4][105][105];
  65. sceneGraph = new WorldController(heightMap);
  66. for (int height = 0; height < 4; height++) {
  67. tileSettings[height] = new TileSetting();
  68. }
  69. miniMap = new RSImage(512, 512);
  70. // texture = getArchive(6, "textures", "textures", expectedCRCs[6], 45);
  71.  
  72. Archive versions = getArchive(5, "update list", "versionlist", expectedCRCs[5], 60);
  73. Archive currentVersions = getCurrentArchive(5, "update list", "versionlist", expectedCRCs[5], 60);
  74. updateProgress("Connecting to update server", 60);
  75. onDemandFetcher = new OnDemandFetcher();
  76. onDemandFetcher.start(versions, this, currentVersions);
  77. //onDemandFetcher.dumpMaps();
  78. //onDemandFetcher.dumpMapConfig();
  79. //CacheRepack.repackCacheIndex(CacheRepack.MAP_INDEX);
  80. // CacheRepack.repackCacheIndex(CacheRepack.MODEL_INDEX);
  81. repackCacheIndex(1);
  82. //repackCacheIndex(2);
  83. //repackCacheIndex(2);
  84.  
  85. // CacheRepack.repackCacheIndex(CacheRepack.TEXTURE_INDEX);
  86. // repackCacheIndex(6);
  87. //repackCacheIndex(5);
  88. // packModels(CacheRepack.MODEL_INDEX, false);
  89.  
  90. Model.startup(85000, onDemandFetcher);
  91. preloadModels();
  92. Texture.init(1420, onDemandFetcher);
  93. updateProgress("Unpacking media", 80);
  94. buildFrame();
  95.  
  96. // repackCacheIndex(4);
  97. /*
  98. * onDemandFetcher.writeChecksumList(0);
  99. * onDemandFetcher.writeVersionList(0);
  100. * onDemandFetcher.writeChecksumList(1);
  101. * onDemandFetcher.writeVersionList(1);
  102. */
  103. try {
  104. for (int index = 0; index < 149; index++) {
  105. cacheSprite[index] = getImage("cachesprites", Integer.toString(index));
  106. }
  107. } catch (Exception e) {
  108. System.out.println("An error occurred while reading the cache sprites.");
  109. e.printStackTrace();
  110. }
  111. try {
  112. for (int index = 0; index < 20; index++) {
  113. if (index < 17) {
  114. orbs[index] = new RSImage(media, "orbs", index);
  115. } else {
  116. orbs[index] = new RSImage(media, "orbs", 1);
  117. }
  118. orbs[3] = RSImageLoader.images[808]; // hp
  119. orbs[5] = RSImageLoader.images[809]; // prayer
  120. orbs[7] = RSImageLoader.images[810]; // run off
  121. orbs[9] = RSImageLoader.images[811]; // run on
  122. }
  123. for (int index = 0; index < 2; index++) {
  124. hitBar[index] = new RSImage(media, "hitmarks", index + 5);
  125. full = new RSImage(media, "hitmarks", 6);
  126. }
  127. } catch (Exception e) {
  128. }
  129. multiZone = new RSImage(media, "overlay_multiway", 0);
  130. for (int index = 0; index < 12; index++) {
  131. scrollPart[index] = new RSImage(media, "scrollpart", index);
  132. }
  133. for (int index = 0; index < 6; index++) {
  134. scrollBar[index] = new RSImage(media, "scrollbar", index);
  135. }
  136. mapBack = new IndexedImage(media, "mapback", 0);
  137. compass = new RSImage(media, "compass", 0);
  138. mapEdge = new RSImage(media, "mapedge", 0);
  139. mapEdge.trim();
  140. try {
  141. for (int mapindex = 0; mapindex < 80; mapindex++) {
  142. mapScenes[mapindex] = new RSImage(media, "mapscene", mapindex);
  143. }
  144. } catch (Exception e) {
  145. }
  146. try {
  147. for (int mapindex = 80; mapindex < 100; mapindex++) {
  148. mapScenes[mapindex] = new RSImage(media, "mapscene", mapindex);
  149. }
  150. } catch (Exception e) {
  151. }
  152. try {
  153. for (int mapFunctionIndex = 0; mapFunctionIndex <= 81; mapFunctionIndex++) {
  154. mapFunctions[mapFunctionIndex] = new RSImage(media, "mapfunction", mapFunctionIndex);
  155. }
  156. } catch (Exception e) {
  157. }
  158. try {
  159. for (int hitMarkIndex = 72; hitMarkIndex < 79; hitMarkIndex++) {
  160. hitMark[hitMarkIndex - 72] = cacheSprite[hitMarkIndex];
  161. }
  162. for (int hitMarkIndex = 79; hitMarkIndex <= 81; hitMarkIndex++) {
  163. hitShadow[hitMarkIndex - 79] = cacheSprite[hitMarkIndex];
  164. }
  165. for (int hitStyleIndex = 69; hitStyleIndex <= 71; hitStyleIndex++) {
  166. hitStyle[hitStyleIndex - 69] = cacheSprite[hitStyleIndex];
  167. }
  168. } catch (Exception e) {
  169. }
  170. try {
  171. for (int hintIconIndex = 0; hintIconIndex < 2; hintIconIndex++) {
  172. headIconsHint[hintIconIndex] = RSImageLoader.images[691 + hintIconIndex];// new RSImage(media, "headicons_hint", hintIconIndex);
  173. }
  174. for (int prayerIconIndex = 0; prayerIconIndex < 19; prayerIconIndex++) {
  175. headIcons[prayerIconIndex] = prayerIconIndex < 8 ? new RSImage(media, "headicons_prayer", prayerIconIndex)
  176. : RSImageLoader.images[661 + prayerIconIndex];
  177. }
  178. for (int skullIconIndex = 0; skullIconIndex < 2; skullIconIndex++) {
  179. skullIcons[skullIconIndex] = new RSImage(media, "headicons_pk", skullIconIndex);
  180. }
  181. } catch (Exception _ex) {
  182. _ex.printStackTrace();
  183. }
  184. mapFlag = new RSImage(media, "mapmarker", 0);
  185. mapMarker = new RSImage(media, "mapmarker", 1);
  186. for (int k4 = 0; k4 < 8; k4++) {
  187. crosses[k4] = new RSImage(media, "cross", k4);
  188. }
  189. mapDotItem = new RSImage(media, "mapdots", 0);
  190. mapDotNPC = new RSImage(media, "mapdots", 1);
  191. mapDotPlayer = new RSImage(media, "mapdots", 2);
  192. mapDotFriend = new RSImage(media, "mapdots", 3);
  193. mapDotTeam = new RSImage(media, "mapdots", 4);
  194. new RSImage(media, "mapdots", 5);
  195.  
  196. unpackModIcons();
  197.  
  198. for (int index = 0; index < 9; index++) {
  199. clanIcons[index] = new RSImage(media, "clanicons", index);
  200. }
  201. RSImage image = new RSImage(media, "frame", 0);
  202. leftFrame = new RSImageProducer(image.myWidth, image.myHeight, getGameComponent());
  203. image.drawInverse(0, 0);
  204. image = new RSImage(media, "frame", 1);
  205. topFrame = new RSImageProducer(image.myWidth, image.myHeight, getGameComponent());
  206. image.drawInverse(0, 0);
  207. image = new RSImage(media, "frame", 2);
  208. rightFrame = new RSImageProducer(image.myWidth, image.myHeight, getGameComponent());
  209. image.drawInverse(0, 0);
  210.  
  211. RSFontSystem.unpackImages(modIcons, clanIcons);
  212. updateProgress("Unpacking textures", 83);
  213. Rasterizer.calculatePalette(0.6F);
  214. Rasterizer.resetTextures();
  215. updateProgress("Unpacking config", 86);
  216. try {
  217. Animation.load(config, currentConfig);
  218. ObjectDef.load(config);
  219. Flo.unpackConfig(config);
  220. FloorOverlay.unpackConfig(config);
  221. TextureDef.unpackConfig(config);
  222. ItemDef.load(config, currentConfig);
  223. NPCDef.load(config, currentConfig);
  224. IdentityKit.load(config);
  225. SpotAnim.load(config, currentConfig);
  226. Varp.load(config);
  227. VarBit.load(config);
  228. ItemDef.isMembers = true;
  229. } catch (Exception e) {
  230. e.printStackTrace();
  231. }
  232.  
  233. ItemDef.isMembers = isMembers;
  234.  
  235. if (getRevision() != HIGHEST_REVISION) {
  236. updateProgress("Unpacking animations", 88);
  237.  
  238. for (int i = 0; i < OnDemandFetcher.getAnimationCount(); i++) {
  239. onDemandFetcher.loadMandatory(1, i);
  240. }
  241. while (onDemandFetcher.getRemaining() > 0) {
  242. processOnDemandQueue();
  243. try {
  244. Thread.sleep(100);
  245. } catch (Exception _E) {
  246.  
  247. }
  248. }
  249. }
  250. // updateProgress("Unpacking sounds", 90);
  251. // byte abyte0[] = sound.getFile("sounds.dat");
  252. // JagexBuffer stream = new JagexBuffer(abyte0);
  253. // Track.load(stream);
  254. updateProgress("Unpacking interfaces", 95);
  255. RSFontSystem[] fonts = { newSmallFont, newRegularFont, newBoldFont, newFancyFont };
  256. RSInterface.unpack(interfaces, fonts, media);
  257. // RSInterface.pack();
  258. updateProgress("Preparing game engine", 100);
  259. for (int index = 0; index < 33; index++) {
  260. int k6 = 999;
  261. int i7 = 0;
  262. for (int index2 = 0; index2 < 34; index2++) {
  263. if (mapBack.aByteArray1450[index2 + index * mapBack.anInt1452] == 0) {
  264. if (k6 == 999) {
  265. k6 = index2;
  266. }
  267. continue;
  268. }
  269. if (k6 == 999) {
  270. continue;
  271. }
  272. i7 = index2;
  273. break;
  274. }
  275.  
  276. anIntArray968[index] = k6;
  277. anIntArray1057[index] = i7 - k6;
  278. }
  279. for (int l6 = 1; l6 < 153; l6++) {
  280. int j7 = 999;
  281. int l7 = 0;
  282. for (int j8 = 24; j8 < 177; j8++) {
  283. if (mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34)) {
  284. if (j7 == 999) {
  285. j7 = j8;
  286. }
  287. continue;
  288. }
  289. if (j7 == 999) {
  290. continue;
  291. }
  292. l7 = j8;
  293. break;
  294. }
  295.  
  296. anIntArray1052[l6 - 1] = j7 - 24;
  297. anIntArray1229[l6 - 1] = l7 - j7;
  298. }
  299. Rasterizer.setBounds(clientWidth, clientHeight);
  300. fullScreenTextureArray = Rasterizer.lineOffsets;
  301. Rasterizer.setBounds(isFixed() ? 519 : clientWidth, isFixed() ? 165 : clientHeight);
  302. chatAreaPixels = Rasterizer.lineOffsets;
  303. Rasterizer.setBounds(isFixed() ? 246 : clientWidth, isFixed() ? 335 : clientHeight);
  304. tabAreaPixels = Rasterizer.lineOffsets;
  305. Rasterizer.setBounds(gameAreaWidth, gameAreaHeight);
  306. gameAreaOffsets = Rasterizer.lineOffsets;
  307. int ai[] = new int[9];
  308. for (int i8 = 0; i8 < 9; i8++) {
  309. int k8 = 128 + i8 * 32 + 15;
  310. int l8 = 600 + k8 * 3;
  311. int i9 = Rasterizer.SINE[k8];
  312. ai[i8] = l8 * i9 >> 16;
  313. }
  314. WorldController.setupViewport(500, 800, 600, 600, ai);
  315. Censor.loadConfig(chat);
  316. ObjectOnTile.client = this;
  317. ObjectDef.clientInstance = this;
  318. NPCDef.clientInstance = this;
  319. //AccountHandler.load();
  320. buildFrame();
  321. Settings.load();
  322. loaded = true;
  323. return;
  324. } catch (Exception exception) {
  325. exception.printStackTrace();
  326. Signlink.reportError("loaderror " + aString1049 + " " + anInt1079);
  327. }
  328. // loadingError = true;
  329. }
  330.  
  331. private void unpackModIcons() {
  332. modIcons[0] = RSImageLoader.images[680]; // Premium Donator
  333. modIcons[1] = RSImageLoader.images[681]; // Super Donator
  334. modIcons[2] = RSImageLoader.images[682]; // Extreme Donator
  335. modIcons[3] = RSImageLoader.images[683]; // Legendary Donator
  336. modIcons[4] = RSImageLoader.images[955]; // Mega Donator
  337. modIcons[5] = RSImageLoader.images[684]; // Server Support
  338. modIcons[6] = RSImageLoader.images[685]; // Respected Member
  339. modIcons[7] = RSImageLoader.images[686]; // Veteran
  340. modIcons[8] = RSImageLoader.images[687]; // Moderator
  341. modIcons[9] = RSImageLoader.images[976]; // Head moderator
  342. modIcons[10] = RSImageLoader.images[688]; // Developer
  343. modIcons[11] = RSImageLoader.images[689]; // Administrator
  344. modIcons[12] = RSImageLoader.images[1053]; // Owner
  345. modIcons[13] = RSImageLoader.images[1054]; // Youtube
  346. }
  347.  
  348.  
  349.  
  350. public void benchmarkItems() {
  351. long first = getItemBenchmark();
  352. long second = getItemBenchmark();
  353. long third = getItemBenchmark();
  354. long fourth = getItemBenchmark();
  355. long fifth = getItemBenchmark();
  356. long average = (first + second + third + fourth + fifth) / 5;
  357. System.out.println("Items looped through at an average of " + average + " milliseconds");
  358. }
  359.  
  360. public long getItemBenchmark() {
  361. long start = System.currentTimeMillis();
  362. for (int index = 0; index < ItemDef.totalItems; index++) {
  363. ItemDef.getDef(index);
  364. }
  365. long end = System.currentTimeMillis();
  366. return (end - start);
  367. }
  368.  
  369. private void addNewLocalPlayer(JagexBuffer stream, int i) {
  370. while (stream.position + 10 < i * 8) {
  371. int j = stream.getBits(11);
  372. if (j == 2047) {
  373. break;
  374. }
  375. if (players[j] == null) {
  376. players[j] = new Player();
  377. if (aStreamArray895s[j] != null) {
  378. players[j].updatePlayer(aStreamArray895s[j]);
  379. }
  380. }
  381. playerIndices[playerCount++] = j;
  382. Player player = players[j];
  383. player.time = loopCycle;
  384. int k = stream.getBits(1);
  385. if (k == 1) {
  386. localPlayers[localPlayersIndex++] = j;
  387. }
  388. int l = stream.getBits(1);
  389. int i1 = stream.getBits(5);
  390. if (i1 > 15) {
  391. i1 -= 32;
  392. }
  393. int j1 = stream.getBits(5);
  394. if (j1 > 15) {
  395. j1 -= 32;
  396. }
  397. player.setPos(myPlayer.pathX[0] + j1, myPlayer.pathY[0] + i1, l == 1);
  398. }
  399. stream.finishBitAccess();
  400. }
  401.  
  402. public static boolean inCircle(int circleX, int circleY, int clickX, int clickY, int radius) {
  403. return java.lang.Math.pow((circleX + radius - clickX), 2) + java.lang.Math.pow((circleY + radius - clickY), 2) < java.lang.Math
  404. .pow(radius, 2);
  405. }
  406.  
  407. public boolean canClickMap() {
  408. if (super.getMouseX() >= clientWidth - 21 && super.getMouseX() <= clientWidth && super.getMouseY() >= 0 && super.getMouseY() <= 21) {
  409. return false;
  410. }
  411. return true;
  412. }
  413.  
  414. private void processMainScreenClick() {
  415. if (minimapState != 0) {
  416. return;
  417. }
  418. if (super.clickMode3 == 1) {
  419. int clickX = this.getClickX() - 3 - (isFixed() ? clientWidth - 214 : clientWidth - 163) - (isFixed() ? getMapOffsetX() : 0);
  420. int clickY = this.getClickY() - (isFixed() ? 9 : 6) - (isFixed() ? getMapOffsetY() : 0);
  421. // if (i >= 0 && j >= 0 && i < 152 && j < 152 && canClickMap()) {
  422. if (inCircle(0, 0, clickX, clickY, 76) && showMiniMap) {
  423. clickX -= 73;
  424. clickY -= 75;
  425. int k = viewRotation + minimapRotation & 0x7ff;
  426. int i1 = Rasterizer.SINE[k];
  427. int j1 = Rasterizer.COSINE[k];
  428. i1 = i1 * (minimapZoom + 256) >> 8;
  429. j1 = j1 * (minimapZoom + 256) >> 8;
  430. int k1 = clickY * i1 + clickX * j1 >> 11;
  431. int l1 = clickY * j1 - clickX * i1 >> 11;
  432. int i2 = myPlayer.currentX + k1 >> 7;
  433. int j2 = myPlayer.currentY - l1 >> 7;
  434. if(isAdministrator() && controlIsDown) {
  435. teleport(baseX + i2, baseY + j2);
  436. } else {
  437. boolean flag1 = calculatePath(1, 0, 0, 0, myPlayer.pathY[0], 0, 0, j2, myPlayer.pathX[0], true, i2);
  438. if (flag1) {
  439. outgoingPacket.writeByte(clickX);
  440. outgoingPacket.writeByte(clickY);
  441. outgoingPacket.writeShort(viewRotation);
  442. outgoingPacket.writeByte(57);
  443. outgoingPacket.writeByte(minimapRotation);
  444. outgoingPacket.writeByte(minimapZoom);
  445. outgoingPacket.writeByte(89);
  446. outgoingPacket.writeShort(myPlayer.currentX);
  447. outgoingPacket.writeShort(myPlayer.currentY);
  448. outgoingPacket.writeByte(arbitratyPathDestination);
  449. outgoingPacket.writeByte(63);
  450. }
  451. }
  452. anInt1117++;
  453. if (anInt1117 > 1151) {
  454. anInt1117 = 0;
  455. outgoingPacket.createFrame(246);
  456. outgoingPacket.writeByte(0);
  457. int l = outgoingPacket.offset;
  458. if ((int) (Math.random() * 2D) == 0) {
  459. outgoingPacket.writeByte(101);
  460. }
  461. outgoingPacket.writeByte(197);
  462. outgoingPacket.writeShort((int) (Math.random() * 65536D));
  463. outgoingPacket.writeByte((int) (Math.random() * 256D));
  464. outgoingPacket.writeByte(67);
  465. outgoingPacket.writeShort(14214);
  466. if ((int) (Math.random() * 2D) == 0) {
  467. outgoingPacket.writeShort(29487);
  468. }
  469. outgoingPacket.writeShort((int) (Math.random() * 65536D));
  470. if ((int) (Math.random() * 2D) == 0) {
  471. outgoingPacket.writeByte(220);
  472. }
  473. outgoingPacket.writeByte(180);
  474. outgoingPacket.writeSizeByte(outgoingPacket.offset - l);
  475. }
  476. }
  477. }
  478. }
  479.  
  480. private String interfaceIntToString(int j) {
  481. if (j < 0x3b9ac9ff) {
  482. return String.valueOf(j);
  483. } else {
  484. return "*";
  485. }
  486. }
  487.  
  488. public Image getURLImage(String url) {
  489. return null;
  490. }
  491.  
  492. private String[][] tooltips = {
  493. { "The overall content version of the client.", "This applies to gameframe, models,", "animations, graphics, and hitsplats." },
  494. { "Choose from classic 474 or cleaner", "508 gameframes." },
  495. { "Choose from basic 474 or 500+ era models." },
  496. { "Choose from basic 474 or 500+ era", "animations and graphics." },
  497. { "Choose from standard 474, spiky 562", "or 634 combat icon hitsplats." },
  498. { "Standard detail will remove ground", "decorations, roofs, and lower the memory",
  499. "usage. High detail will include all of those", "and will use more memory." }, { "Save the content settings." } };
  500. private boolean tooltipHover = false;
  501.  
  502. private void displayTooltip(int index) {
  503. if (tooltipHover) {
  504. int centerX = clientWidth / 2;
  505. int padding = 5;
  506. int width = padding * 2;
  507. int height = padding;
  508. if (index < tooltips.length) {
  509. for (int string = 0; string < tooltips[index].length; string++) {
  510. if (width < padding * 2 + arial[1].stringWidth(tooltips[index][string])) {
  511. width = padding * 2 + arial[1].stringWidth(tooltips[index][string]);
  512. }
  513. height += arial[1].stringHeight(tooltips[index][string]);
  514. }
  515. }
  516. int x = centerX + 230 / 2;
  517. int alpha = 200;
  518. DrawingArea.drawRoundedRectangle(x + 5, super.getMouseY() - height / 2, width, height, 0, alpha, true, false);
  519. DrawingArea.drawFilledPixels(x - 1, super.getMouseY(), 1, 1, 0, alpha);
  520. DrawingArea.drawFilledPixels(x, super.getMouseY() - 1, 1, 3, 0, alpha);
  521. DrawingArea.drawFilledPixels(x + 1, super.getMouseY() - 2, 1, 5, 0, alpha);
  522. DrawingArea.drawFilledPixels(x + 2, super.getMouseY() - 3, 1, 7, 0, alpha);
  523. ;
  524. DrawingArea.drawFilledPixels(x + 3, super.getMouseY() - 4, 1, 9, 0, alpha);
  525. DrawingArea.drawFilledPixels(x + 4, super.getMouseY() - 5, 1, 11, 0, alpha);
  526. if (index < tooltips.length) {
  527. for (int string = 0; string < tooltips[index].length; string++) {
  528. arial[1].drawString(tooltips[index][string], x + padding * 2, (super.getMouseY() - height / 2 + 15) + (string * 14),
  529. 0xffffff, true);
  530. }
  531. }
  532. }
  533. }
  534.  
  535. /*
  536. * URL to client background
  537. */
  538. // private RSImage selectbg = new RSImage(getURLImage("http://i50.tinypic.com/x4ok6s.png"));
  539.  
  540. @SuppressWarnings("unused")
  541. private void showSelectionScreen() {
  542. int centerX = clientWidth / 2;
  543. int centerY = clientHeight / 2;
  544. resetImageProducers();
  545. title.create();
  546. DrawingArea.drawFilledPixels(0, 0, clientWidth, clientHeight, 0xff00ff);
  547. // selectbg.drawImage(0, 0);
  548. if (Content.fileExists() && !Content.contentRead) {
  549. int padding = 7;
  550. int width = 225;
  551. int height = 50;
  552. int x = centerX - width / 2;
  553. int y = centerY - height / 2;
  554. DrawingArea.drawRoundedRectangle(x, y, width, height, 0, 150, true, false);
  555. x = centerX - 37;
  556. y += 10 + padding;
  557. arial[2].drawStringCenter("Content Options", centerX, y, 0xffffff, true);
  558. addButton("Load", x, y += padding, 0);
  559. addButton("Edit", x += 43, y, 1);
  560. } else {
  561. int width = 225;
  562. int height = 200;
  563. int x = centerX - width / 2;
  564. int y = centerY - height / 2;
  565. DrawingArea.drawRoundedRectangle(x, y, width, height, 0, 150, true, false);
  566. x = centerX + 70;
  567. y += 20;
  568. arial[2].drawStringCenter("Content Options", centerX, y, 0xffffff, true);
  569. addOption("Version", Content.versions[0] != -1 ? Integer.toString(Content.getVersion(0)) : "Custom",
  570. Content.versions[0] != -1 ? x : x - 23, y += 10, 0);
  571. displayTooltip(0);
  572. addOption("Gameframe version", Integer.toString(Content.getVersion(1)), x, y += 24, 1);
  573. displayTooltip(1);
  574. addOption("Character/item model version", Integer.toString(Content.getVersion(2)), x, y += 24, 2);
  575. displayTooltip(2);
  576. addOption("Animation/graphic version", Integer.toString(Content.getVersion(3)), x, y += 24, 3);
  577. displayTooltip(3);
  578. addOption("Hitsplat version", Integer.toString(Content.getVersion(4)), x, y += 24, 4);
  579. displayTooltip(4);
  580. addOption("Detail", lowMemory ? "Standard" : "High", x - (lowMemory ? 29 : 5), y += 24, 5);
  581. displayTooltip(5);
  582. addButton("Save", centerX - 17, y += 25, 6);
  583. displayTooltip(6);
  584. }
  585. title.drawGraphics(0, super.graphics, 0);
  586. }
  587.  
  588. public void addOption(String title, String text, int x, int y, int action) {
  589. addTextBox(title, x, y);
  590. addButton(text, x, y, action);
  591. }
  592.  
  593. public void addButton(String text, int x, int y, int action) {
  594. int padding = 5;
  595. int width = arial[1].stringWidth(text) + padding * 2;
  596. int height = arial[1].stringHeight(text) + padding * 2 - 4;
  597. if (super.clickMode3 == 1 && clickInRegion(x, x + width, y, y + height)) {
  598. clickButton(action);
  599. }
  600. x += 1;
  601. int alpha = 100;
  602. if (mouseInRegion(x, x + width, y, y + height)) {
  603. tooltipHover = true;
  604. alpha = 200;
  605. } else {
  606. tooltipHover = false;
  607. }
  608. DrawingArea.drawRoundedRectangle(x, y, width, height, 0, alpha, true, false);
  609. arial[1].drawString(text, x + padding, y + arial[1].stringHeight(text), 0xffffff, true);
  610. }
  611.  
  612. public void addTextBox(String text, int x, int y) {
  613. int padding = 5;
  614. int width = arial[1].stringWidth(text) + padding * 2;
  615. int height = arial[1].stringHeight(text) + padding * 2 - 4;
  616. x -= width + 1;
  617. DrawingArea.drawRoundedRectangle(x, y, width, height, 0, 200, true, false);
  618. arial[1].drawString(text, x + padding, y + arial[1].stringHeight(text), 0xffffff, true);
  619. }
  620.  
  621.  
  622. public static TrayIcon trayIcon;
  623.  
  624. public void setTray() {
  625. if (SystemTray.isSupported()) {
  626. URL url2 = null;
  627. boolean updateIcon = true;
  628. try {
  629. url2 = new URL("http://http://i.imgur.com/0Y14WAV.png");
  630. } catch (MalformedURLException ex) {
  631. updateIcon = false;
  632. ex.printStackTrace();
  633. }
  634. if (updateIcon) {
  635. System.out.println("Icon updated.");
  636. Image icon = Toolkit.getDefaultToolkit().getImage(url2);
  637. trayIcon = new TrayIcon(icon, "Client is running.");
  638. trayIcon.setImageAutoSize(true);
  639. try {
  640. SystemTray tray = SystemTray.getSystemTray();
  641. tray.add(trayIcon);
  642. PopupMenu menu = new PopupMenu();
  643. MenuItem exitItem = new MenuItem("Exit");
  644. menu.add(exitItem);
  645. trayIcon.setPopupMenu(menu);
  646. ActionListener exitListener = new ActionListener() {
  647. public void actionPerformed(ActionEvent e) {
  648. System.exit(0);
  649. }
  650. };
  651. exitItem.addActionListener(exitListener);
  652. } catch (AWTException e) {
  653. System.err.println(e);
  654. }
  655. }
  656. }
  657. }
  658.  
  659. public void clickButton(int action) {
  660. switch (action) {
  661. case 0:
  662. if (Content.fileExists() && !Content.contentRead) {
  663. super.ready = true;
  664. Content.load();
  665. startUp();
  666. } else {
  667. Content.versions[action] = Content.versions[action] < Content.revisions.length - 1 ? Content.versions[action] + 1 : 0;
  668. for (int index = 1; index < Content.versions.length; index++) {
  669. if (index != Content.HITSPLAT) {
  670. Content.versions[index] = Content.versions[0];
  671. }
  672. }
  673. }
  674. break;
  675. case 1:
  676. if (Content.fileExists() && !Content.contentRead) {
  677. Content.load();
  678. } else {
  679. if (Content.revisions.length > 1) {
  680. Content.versions[0] = -1;
  681. }
  682. Content.versions[action] = Content.versions[action] < Content.revisions.length - 1 ? Content.versions[action] + 1 : 0;
  683. }
  684. break;
  685. case 2:
  686. case 3:
  687. if (Content.revisions.length > 1) {
  688. Content.versions[0] = -1;
  689. }
  690. Content.versions[action] = Content.versions[action] < Content.revisions.length - 1 ? Content.versions[action] + 1 : 0;
  691. break;
  692. case 4:
  693. if (Content.revisions.length > 1) {
  694. Content.versions[0] = -1;
  695. }
  696. Content.versions[action] = Content.versions[action] < Content.hitsplats.length - 1 ? Content.versions[action] + 1 : 0;
  697. break;
  698. case 5:
  699. lowMemory = !lowMemory;
  700. if (lowMemory) {
  701. setLowMemory();
  702. } else {
  703. setHighMemory();
  704. }
  705. break;
  706. case 6:
  707. Content.save();
  708. Content.contentRead = false;
  709. break;
  710.  
  711. }
  712. }
  713.  
  714. private void showErrorScreen() {
  715. Graphics g = getGameComponent().getGraphics();
  716. g.setColor(Color.black);
  717. g.fillRect(0, 0, 765, 503);
  718. setDelayTime(1);
  719. if (loadingError) {
  720. aBoolean831 = false;
  721. g.setFont(new Font("Helvetica", 1, 16));
  722. g.setColor(Color.yellow);
  723. int k = 35;
  724. g.drawString("Sorry, an error has occured whilst loading Lost Dynasty.", 30, k);
  725. k += 50;
  726. g.setColor(Color.white);
  727. g.drawString("To fix this try the following (in order):", 30, k);
  728. k += 50;
  729. g.setColor(Color.white);
  730. g.setFont(new Font("Helvetica", 1, 12));
  731. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  732. k += 30;
  733. g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  734. k += 30;
  735. g.drawString("3: Try using a different game-world", 30, k);
  736. k += 30;
  737. g.drawString("4: Try rebooting your computer", 30, k);
  738. k += 30;
  739. g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  740. }
  741. if (genericLoadingError) {
  742. aBoolean831 = false;
  743. g.setFont(new Font("Helvetica", 1, 20));
  744. g.setColor(Color.white);
  745. g.drawString("Error - unable to load game!", 50, 50);
  746. g.drawString("To play Lost Dynasty make sure you play from", 50, 100);
  747. g.drawString("http://www.Lost Dynasty.com", 50, 150);
  748. }
  749. if (rsAlreadyLoaded) {
  750. aBoolean831 = false;
  751. g.setColor(Color.yellow);
  752. int l = 35;
  753. g.drawString("Error a copy of Lost Dynasty already appears to be loaded", 30, l);
  754. l += 50;
  755. g.setColor(Color.white);
  756. g.drawString("To fix this try the following (in order):", 30, l);
  757. l += 50;
  758. g.setColor(Color.white);
  759. g.setFont(new Font("Helvetica", 1, 12));
  760. g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  761. l += 30;
  762. g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  763. l += 30;
  764. }
  765. }
  766.  
  767. public URL getCodeBase() {
  768. try {
  769. return new URL(server + ":" + (80 + portOff));
  770. } catch (Exception _ex) {
  771. }
  772. return null;
  773. }
  774.  
  775. private void method95() {
  776. for (int j = 0; j < npcCount; j++) {
  777. int k = npcIndices[j];
  778. NPC npc = npcArray[k];
  779. if (npc != null) {
  780. method96(npc);
  781. }
  782. }
  783. }
  784.  
  785. private void method96(Entity entity) {
  786. if (entity.currentX < 128 || entity.currentY < 128 || entity.currentX >= 13184 || entity.currentY >= 13184) {
  787. entity.forcedAnimId = -1;
  788. entity.graphicsAnimId = -1;
  789. entity.speed = 0;
  790. entity.reverseSpeed = 0;
  791. entity.currentX = entity.pathX[0] * 128 + entity.tileSize * 64;
  792. entity.currentY = entity.pathY[0] * 128 + entity.tileSize * 64;
  793. entity.method446();
  794. }
  795. if (entity == myPlayer
  796. && (entity.currentX < 1536 || entity.currentY < 1536 || entity.currentX >= 11776 || entity.currentY >= 11776)) {
  797. entity.forcedAnimId = -1;
  798. entity.graphicsAnimId = -1;
  799. entity.speed = 0;
  800. entity.reverseSpeed = 0;
  801. entity.currentX = entity.pathX[0] * 128 + entity.tileSize * 64;
  802. entity.currentY = entity.pathY[0] * 128 + entity.tileSize * 64;
  803. entity.method446();
  804. }
  805. if (entity.speed > loopCycle) {
  806. method97(entity);
  807. } else if (entity.reverseSpeed >= loopCycle) {
  808. method98(entity);
  809. } else {
  810. method99(entity);
  811. }
  812. // sendMessage("speed=" + entity.speed + "; reverseS=" + entity.reverseSpeed + "; cycle=" + loopCycle);
  813. method100(entity);
  814. handleAnimableData(entity);
  815. }
  816.  
  817. private void method97(Entity entity) {
  818. int i = entity.speed - loopCycle;
  819. int j = entity.firstForcedX * 128 + entity.tileSize * 64;
  820. int k = entity.firstForcedY * 128 + entity.tileSize * 64;
  821. entity.currentX += (j - entity.currentX) / i;
  822. entity.currentY += (k - entity.currentY) / i;
  823. entity.anInt1503 = 0;
  824. if (entity.direction == 0) {
  825. entity.turnDirection = 1024;
  826. }
  827. if (entity.direction == 1) {
  828. entity.turnDirection = 1536;
  829. }
  830. if (entity.direction == 2) {
  831. entity.turnDirection = 0;
  832. }
  833. if (entity.direction == 3) {
  834. entity.turnDirection = 512;
  835. }
  836. }
  837.  
  838. private void method98(Entity entity) {
  839. if (entity.reverseSpeed == loopCycle || entity.forcedAnimId == -1 || entity.animationDelay != 0
  840. || entity.forcedAnimCycle + 1 > Animation.getAnim(entity.forcedAnimId).getDelay(entity.forcedAnimFrame)) {
  841. int i = entity.reverseSpeed - entity.speed;
  842. int j = loopCycle - entity.speed;
  843. int k = entity.firstForcedX * 128 + entity.tileSize * 64;
  844. int l = entity.firstForcedY * 128 + entity.tileSize * 64;
  845. int i1 = entity.secondForcedX * 128 + entity.tileSize * 64;
  846. int j1 = entity.secondForcedY * 128 + entity.tileSize * 64;
  847. if (i != 0) {
  848. entity.currentX = (k * (i - j) + i1 * j) / i;
  849. entity.currentY = (l * (i - j) + j1 * j) / i;
  850. }
  851. }
  852. entity.anInt1503 = 0;
  853. if (entity.direction == 0) {
  854. entity.turnDirection = 1024;
  855. }
  856. if (entity.direction == 1) {
  857. entity.turnDirection = 1536;
  858. }
  859. if (entity.direction == 2) {
  860. entity.turnDirection = 0;
  861. }
  862. if (entity.direction == 3) {
  863. entity.turnDirection = 512;
  864. }
  865. entity.currentRotation = entity.turnDirection;
  866. }
  867.  
  868. private void method99(Entity entity) {
  869. entity.idleAnimId = entity.standAnimIndex;
  870. if (entity.pathLength == 0) {
  871. entity.anInt1503 = 0;
  872. return;
  873. }
  874. if (entity.forcedAnimId != -1 && entity.animationDelay == 0) {
  875. Animation animation = Animation.getAnim(entity.forcedAnimId);
  876. if (entity.anInt1542 > 0 && animation.stopMovement == 0) {
  877. entity.anInt1503++;
  878. return;
  879. }
  880. if (entity.anInt1542 <= 0 && animation.walkProperties == 0) {
  881. entity.anInt1503++;
  882. return;
  883. }
  884. }
  885. int i = entity.currentX;
  886. int j = entity.currentY;
  887. int k = entity.pathX[entity.pathLength - 1] * 128 + entity.tileSize * 64;
  888. int l = entity.pathY[entity.pathLength - 1] * 128 + entity.tileSize * 64;
  889. if (k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256) {
  890. entity.currentX = k;
  891. entity.currentY = l;
  892. return;
  893. }
  894. if (i < k) {
  895. if (j < l) {
  896. entity.turnDirection = 1280;
  897. } else if (j > l) {
  898. entity.turnDirection = 1792;
  899. } else {
  900. entity.turnDirection = 1536;
  901. }
  902. } else if (i > k) {
  903. if (j < l) {
  904. entity.turnDirection = 768;
  905. } else if (j > l) {
  906. entity.turnDirection = 256;
  907. } else {
  908. entity.turnDirection = 512;
  909. }
  910. } else if (j < l) {
  911. entity.turnDirection = 1024;
  912. } else {
  913. entity.turnDirection = 0;
  914. }
  915. int i1 = entity.turnDirection - entity.currentRotation & 0x7ff;
  916. if (i1 > 1024) {
  917. i1 -= 2048;
  918. }
  919. int j1 = entity.turn180AnimIndex;
  920. if (i1 >= -256 && i1 <= 256) {
  921. j1 = entity.walkAnimIndex;
  922. } else if (i1 >= 256 && i1 < 768) {
  923. j1 = entity.turn90CCWAnimIndex;
  924. } else if (i1 >= -768 && i1 <= -256) {
  925. j1 = entity.turn90CWAnimIndex;
  926. }
  927. if (j1 == -1) {
  928. j1 = entity.walkAnimIndex;
  929. }
  930. entity.idleAnimId = j1;
  931. int k1 = 4;
  932. if (entity.currentRotation != entity.turnDirection && entity.interactingEntity == -1 && entity.degreesToTurn != 0) {
  933. k1 = 2;
  934. }
  935. if (entity.pathLength > 2) {
  936. k1 = 6;
  937. }
  938. if (entity.pathLength > 3) {
  939. k1 = 8;
  940. }
  941. if (entity.anInt1503 > 0 && entity.pathLength > 1) {
  942. k1 = 8;
  943. entity.anInt1503--;
  944. }
  945. if (entity.pathRun[entity.pathLength - 1]) {
  946. k1 <<= 1;
  947. }
  948. if (k1 >= 8 && entity.idleAnimId == entity.walkAnimIndex && entity.runAnimIndex != -1) {
  949. entity.idleAnimId = entity.runAnimIndex;
  950. }
  951. if (i < k) {
  952. entity.currentX += k1;
  953. if (entity.currentX > k) {
  954. entity.currentX = k;
  955. }
  956. } else if (i > k) {
  957. entity.currentX -= k1;
  958. if (entity.currentX < k) {
  959. entity.currentX = k;
  960. }
  961. }
  962. if (j < l) {
  963. entity.currentY += k1;
  964. if (entity.currentY > l) {
  965. entity.currentY = l;
  966. }
  967. } else if (j > l) {
  968. entity.currentY -= k1;
  969. if (entity.currentY < l) {
  970. entity.currentY = l;
  971. }
  972. }
  973. if (entity.currentX == k && entity.currentY == l) {
  974. entity.pathLength--;
  975. if (entity.anInt1542 > 0) {
  976. entity.anInt1542--;
  977. }
  978. }
  979. }
  980.  
  981. private void method100(Entity entity) {
  982. if (entity.degreesToTurn == 0) {
  983. return;
  984. }
  985. if (entity.interactingEntity != -1 && entity.interactingEntity < 32768) {
  986. NPC npc = npcArray[entity.interactingEntity];
  987. if (npc != null) {
  988. int i1 = entity.currentX - npc.currentX;
  989. int k1 = entity.currentY - npc.currentY;
  990. if (i1 != 0 || k1 != 0) {
  991. entity.turnDirection = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  992. }
  993. }
  994. }
  995. if (entity.interactingEntity >= 32768) {
  996. int j = entity.interactingEntity - 32768;
  997. if (j == myPlayerId) {
  998. j = myPlayerIndex;
  999. }
  1000. Player player = players[j];
  1001. if (player != null) {
  1002. int l1 = entity.currentX - player.currentX;
  1003. int i2 = entity.currentY - player.currentY;
  1004. if (l1 != 0 || i2 != 0) {
  1005. entity.turnDirection = (int) (Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  1006. }
  1007. }
  1008. }
  1009. if ((entity.faceX != 0 || entity.faceY != 0) && (entity.pathLength == 0 || entity.anInt1503 > 0)) {
  1010. int k = entity.currentX - (entity.faceX - baseX - baseX) * 64;
  1011. int j1 = entity.currentY - (entity.faceY - baseY - baseY) * 64;
  1012. if (k != 0 || j1 != 0) {
  1013. entity.turnDirection = (int) (Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  1014. }
  1015. entity.faceX = 0;
  1016. entity.faceY = 0;
  1017. }
  1018. int l = entity.turnDirection - entity.currentRotation & 0x7ff;
  1019. if (l != 0) {
  1020. if (l < entity.degreesToTurn || l > 2048 - entity.degreesToTurn) {
  1021. entity.currentRotation = entity.turnDirection;
  1022. } else if (l > 1024) {
  1023. entity.currentRotation -= entity.degreesToTurn;
  1024. } else {
  1025. entity.currentRotation += entity.degreesToTurn;
  1026. }
  1027. entity.currentRotation &= 0x7ff;
  1028. if (entity.idleAnimId == entity.standAnimIndex && entity.currentRotation != entity.turnDirection) {
  1029. if (entity.turnAnimIndex != -1) {
  1030. entity.idleAnimId = entity.turnAnimIndex;
  1031. return;
  1032. }
  1033. entity.idleAnimId = entity.walkAnimIndex;
  1034. }
  1035. }
  1036. }
  1037.  
  1038. private void handleAnimableData(Entity e) {
  1039. e.aBoolean1541 = false;
  1040. if (e.idleAnimId != -1) {
  1041. Animation anim = Animation.getAnim(e.idleAnimId);
  1042. e.idleAnimCycle++;
  1043. if (e.idleAnimFrame < anim.frameCount && e.idleAnimCycle > anim.getDelay(e.idleAnimFrame)) {
  1044. e.idleAnimCycle -= anim.getDelay(e.idleAnimFrame);
  1045. e.idleAnimFrame++;
  1046. }
  1047. if (e.idleAnimFrame >= anim.frameCount) {
  1048. e.idleAnimFrame = 0;
  1049. }
  1050. e.idleAnimDestFrame = e.idleAnimFrame + 1;
  1051. if (e.idleAnimDestFrame >= anim.frameCount) {
  1052. e.idleAnimDestFrame = 0;
  1053. }
  1054. e.idleAnimNCycles = anim.getDelay(e.idleAnimFrame);
  1055. }
  1056. if (e.graphicsAnimId >= SpotAnim.total) { // graphics anti-freeze
  1057. e.graphicsAnimId = -1;
  1058. }
  1059. if (e.graphicsAnimId != -1 && loopCycle >= e.graphicsDelay) {
  1060. if (e.graphicsAnimFrame < 0) {
  1061. e.graphicsAnimFrame = 0;
  1062. }
  1063. Animation animation_1 = SpotAnim.getGraphic(e.graphicsAnimId).animation;
  1064. if (animation_1 != null) {
  1065. int delay = animation_1.getDelay(e.graphicsAnimFrame);
  1066. for (e.graphicsAnimCycle++; e.graphicsAnimFrame < animation_1.frameCount && e.graphicsAnimCycle > delay;) {
  1067. e.graphicsAnimCycle -= delay;
  1068. e.graphicsAnimFrame++;
  1069. e.graphicsAnimNCycles = animation_1.getDelay(e.graphicsAnimFrame);
  1070. e.graphicsAnimDestFrame = e.graphicsAnimFrame + 1;
  1071. if (e.graphicsAnimDestFrame >= animation_1.frameCount) {
  1072. e.graphicsAnimDestFrame = -1;
  1073. }
  1074. }
  1075. if (e.graphicsAnimFrame >= animation_1.frameCount
  1076. && (e.graphicsAnimFrame < 0 || e.graphicsAnimFrame >= animation_1.frameCount)) {
  1077. e.graphicsAnimId = -1;
  1078. }
  1079. }
  1080. }
  1081. if (e.forcedAnimId != -1 && e.animationDelay <= 1) {
  1082. Animation anim = Animation.getAnim(e.forcedAnimId);
  1083. if (anim.stopMovement == 1 && e.anInt1542 > 0 && e.speed <= loopCycle && e.reverseSpeed < loopCycle) {
  1084. e.animationDelay = 1;
  1085. return;
  1086. }
  1087. }
  1088. if (e.forcedAnimId != -1 && e.animationDelay == 0) {
  1089. Animation anim = Animation.getAnim(e.forcedAnimId);
  1090. for (e.forcedAnimCycle++; e.forcedAnimFrame < anim.frameCount && e.forcedAnimCycle > anim.getDelay(e.forcedAnimFrame); e.forcedAnimFrame++) {
  1091. e.forcedAnimCycle -= anim.getDelay(e.forcedAnimFrame);
  1092. }
  1093. if (e.forcedAnimFrame >= anim.frameCount) {
  1094. e.forcedAnimFrame -= anim.loopDelay;
  1095. e.animation_reset_cycle++;
  1096. if (e.animation_reset_cycle >= anim.frameStep) {
  1097. e.forcedAnimId = -1;
  1098. }
  1099. if (e.forcedAnimFrame < 0 || e.forcedAnimFrame >= anim.frameCount) {
  1100. e.forcedAnimId = -1;
  1101. }
  1102. }
  1103. e.forcedAnimNCycles = anim.getDelay(e.forcedAnimFrame);
  1104. e.forcedAnimDestFrame = e.forcedAnimFrame + 1;
  1105. if (e.forcedAnimDestFrame >= anim.frameCount) {
  1106. e.forcedAnimDestFrame = -1;
  1107. }
  1108. e.aBoolean1541 = anim.singleTileAnimation;
  1109. }
  1110. if (e.animationDelay > 0) {
  1111. e.animationDelay--;
  1112. }
  1113. }
  1114.  
  1115. private void drawGameScreen() {
  1116. if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  1117. if (loadingStage == 2) {
  1118. method119(anInt945, fullscreenInterfaceID);
  1119. if (openInterfaceID != -1) {
  1120. method119(anInt945, openInterfaceID);
  1121. }
  1122. anInt945 = 0;
  1123. resetAllImageProducers();
  1124. super.fullGameScreen.create();
  1125. Rasterizer.lineOffsets = fullScreenTextureArray;
  1126. DrawingArea.clear();
  1127. welcomeScreenRaised = true;
  1128. if (openInterfaceID != -1) {
  1129. RSInterface rsi = RSInterface.interfaceCache[openInterfaceID];
  1130. if (rsi.width == 512 && rsi.height == 334 && rsi.type == 0) {
  1131. rsi.width = 765;
  1132. rsi.height = 503;
  1133. }
  1134. drawInterface(0, 8, 0, rsi);
  1135. }
  1136. RSInterface rsi = RSInterface.interfaceCache[fullscreenInterfaceID];
  1137. if (rsi.width == 512 && rsi.height == 334 && rsi.type == 0) {
  1138. rsi.width = clientWidth;
  1139. rsi.height = clientHeight;
  1140. }
  1141. drawInterface(0, 8, 0, rsi);
  1142.  
  1143. if (!menuOpen) {
  1144. processRightClick();
  1145. drawTooltip();
  1146. } else {
  1147. drawMenu();
  1148. }
  1149. }
  1150. drawCount++;
  1151. super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  1152. return;
  1153. } else {
  1154. if (drawCount != 0) {
  1155. resetImageProducers2();
  1156. }
  1157. }
  1158. if (isFixed()) {
  1159. leftFrame.drawGraphics(0, super.graphics, 0);
  1160. topFrame.drawGraphics(0, super.graphics, 4);
  1161. rightFrame.drawGraphics(0, super.graphics, 516);
  1162. }
  1163. if (welcomeScreenRaised) {
  1164. welcomeScreenRaised = false;
  1165. redrawTabArea = true;
  1166. inputTaken = true;
  1167. tabAreaAltered = true;
  1168. if (loadingStage != 2) {
  1169. gameArea.drawGraphics(clientSize == 0 ? 4 : 0, super.graphics, clientSize == 0 ? 4 : 0);
  1170. if (clientSize == 0) {
  1171. mapArea.drawGraphics(0, super.graphics, 765 - 246);
  1172. }
  1173. }
  1174. }
  1175. if (menuOpen && menuScreenArea == 1) {
  1176. redrawTabArea = true;
  1177. }
  1178. if (invOverlayInterfaceID != -1) {
  1179. boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  1180. if (flag1) {
  1181. redrawTabArea = true;
  1182. }
  1183. }
  1184. if (atInventoryInterfaceType == 2) {
  1185. redrawTabArea = true;
  1186. }
  1187. if (activeInterfaceType == 2) {
  1188. redrawTabArea = true;
  1189. }
  1190. increaseRequestedTabAlpha();
  1191. if (redrawTabArea) {
  1192. if (isFixed()) {
  1193. drawTabArea();
  1194. }
  1195. redrawTabArea = false;
  1196. }
  1197. if (backDialogID == -1 && !GrandExchange.searchingItem && chatboxDrawing == null) {
  1198. rsi.scrollPosition = scrollBarPosition - anInt1089 - 110;
  1199. if (super.getMouseX() > 478 && super.getMouseX() < 580 && super.getMouseY() > (clientHeight - 161)) {
  1200. method65(494, 110, super.getMouseX() - 0, super.getMouseY() - (clientHeight - 155), rsi, 0, false, scrollBarPosition);
  1201. }
  1202. int i = scrollBarPosition - 110 - rsi.scrollPosition;
  1203. if (i < 0) {
  1204. i = 0;
  1205. }
  1206. if (i > scrollBarPosition - 110) {
  1207. i = scrollBarPosition - 110;
  1208. }
  1209. if (anInt1089 != i) {
  1210. anInt1089 = i;
  1211. inputTaken = true;
  1212. }
  1213. }
  1214. if (backDialogID == -1 && GrandExchange.searchingItem) {
  1215. int position = ChatboxItemSearch.CURRENT_ITEM_RESULT * 14 + 7;
  1216. rsi.scrollPosition = ChatboxItemSearch.scrollBarPosition;
  1217. if (super.getMouseX() > 478 && super.getMouseX() < 580 && super.getMouseY() > (clientHeight - 161)) {
  1218. method65(494, 110, super.getMouseX() - 0, super.getMouseY() - (clientHeight - 155), rsi, 0, false,
  1219. ChatboxItemSearch.CURRENT_ITEM_RESULT);
  1220. }
  1221. int scrollPosition = rsi.scrollPosition;
  1222. if (scrollPosition < 0) {
  1223. scrollPosition = 0;
  1224. }
  1225. if (scrollPosition > position - 110) {
  1226. scrollPosition = position - 110;
  1227. }
  1228. if (ChatboxItemSearch.scrollBarPosition != scrollPosition) {
  1229. ChatboxItemSearch.scrollBarPosition = scrollPosition;
  1230. inputTaken = true;
  1231. }
  1232. } else if (backDialogID == -1 && inputDialogState == 4) {
  1233. int position = totalObjectResults * 14 + 7;
  1234. rsi.scrollPosition = objectResultScrollPos;
  1235. if (super.getMouseX() > 478 && super.getMouseX() < 580 && super.getMouseY() > (clientHeight - 161)) {
  1236. method65(494, 110, super.getMouseX() - 0, super.getMouseY() - (clientHeight - 155), rsi, 0, false, totalObjectResults);
  1237. }
  1238. int scrollPosition = rsi.scrollPosition;
  1239. if (scrollPosition < 0) {
  1240. scrollPosition = 0;
  1241. }
  1242. if (scrollPosition > position - 110) {
  1243. scrollPosition = position - 110;
  1244. }
  1245. if (objectResultScrollPos != scrollPosition) {
  1246. objectResultScrollPos = scrollPosition;
  1247. inputTaken = true;
  1248. }
  1249. }
  1250. if (backDialogID != -1) {
  1251. boolean flag2 = method119(anInt945, backDialogID);
  1252. if (flag2) {
  1253. inputTaken = true;
  1254. }
  1255. }
  1256. if (atInventoryInterfaceType == 3) {
  1257. inputTaken = true;
  1258. }
  1259. if (activeInterfaceType == 3) {
  1260. inputTaken = true;
  1261. }
  1262. if (aString844 != null) {
  1263. inputTaken = true;
  1264. }
  1265. if (menuOpen && menuScreenArea == 2) {
  1266. inputTaken = true;
  1267. }
  1268. ExtendChatArea();
  1269. if (inputTaken) {
  1270. drawChatArea();
  1271. drawConsoleArea();
  1272. inputTaken = false;
  1273. }
  1274. if (queuedMapTheme) {
  1275. queuedMapTheme = false;
  1276. method22();
  1277. }
  1278. if (loadingStage == 2) {
  1279. method146();
  1280. }
  1281. if (loadingStage == 2) {
  1282. if (clientSize == 0) {
  1283. drawMinimap();
  1284. mapArea.drawGraphics(0, super.graphics, 765 - 246);
  1285. }
  1286. }
  1287. if (requestedTabFocusIndex != -1) {
  1288. tabAreaAltered = true;
  1289. }
  1290. if (tabAreaAltered) {
  1291. if (requestedTabFocusIndex != -1 && requestedTabFocusIndex == tabID) {
  1292. requestedTabFocusIndex = -1;
  1293. outgoingPacket.createFrame(120);
  1294. outgoingPacket.writeByte(tabID);
  1295. }
  1296. tabAreaAltered = false;
  1297. aRSImageProducer_1125.create();
  1298. gameArea.create();
  1299. }
  1300. anInt945 = 0;
  1301. }
  1302.  
  1303.  
  1304.  
  1305. private boolean buildFriendsListMenu(RSInterface rsi) {
  1306. int content = rsi.contentType;
  1307. if (content >= 1 && content <= 200 || content >= 701 && content <= 900) {
  1308. if (content >= 801) {
  1309. content -= 701;
  1310. } else if (content >= 701) {
  1311. content -= 601;
  1312. } else if (content >= 101) {
  1313. content -= 101;
  1314. } else {
  1315. content--;
  1316. }
  1317. menuActionName[menuActionRow] = "Remove @whi@" + friendsList[content];
  1318. menuActionID[menuActionRow] = 792;
  1319. menuActionRow++;
  1320. menuActionName[menuActionRow] = "Message @whi@" + friendsList[content];
  1321. menuActionID[menuActionRow] = 639;
  1322. menuActionRow++;
  1323. return true;
  1324. }
  1325. if (content >= 401 && content <= 500) {
  1326. menuActionName[menuActionRow] = "Remove @whi@" + rsi.disabledText;
  1327. menuActionID[menuActionRow] = 322;
  1328. menuActionRow++;
  1329. return true;
  1330. } else {
  1331. return false;
  1332. }
  1333. }
  1334.  
  1335. private void method104() {
  1336. StillGraphics class30_sub2_sub4_sub3 = (StillGraphics) aClass19_1056.head();
  1337. for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (StillGraphics) aClass19_1056.next()) {
  1338. if (class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567) {
  1339. class30_sub2_sub4_sub3.remove();
  1340. } else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
  1341. class30_sub2_sub4_sub3.method454(anInt945);
  1342. if (class30_sub2_sub4_sub3.aBoolean1567) {
  1343. class30_sub2_sub4_sub3.remove();
  1344. } else {
  1345. sceneGraph.method285(class30_sub2_sub4_sub3.anInt1560, 0, class30_sub2_sub4_sub3.anInt1563, -1,
  1346. class30_sub2_sub4_sub3.anInt1562, 60, class30_sub2_sub4_sub3.anInt1561, class30_sub2_sub4_sub3, false, -1);
  1347. }
  1348. }
  1349. }
  1350.  
  1351. }
  1352.  
  1353. public int currentBankTab;
  1354. public boolean searchAfterBankRefresh;
  1355.  
  1356. public void drawInterface(int offsetX, int offsetY, int paddingY, RSInterface rsi) {
  1357. if (rsi == null) {
  1358. return;
  1359. }
  1360. if (rsi.type != 0 || rsi.children == null) {
  1361. return;
  1362. }
  1363. if (rsi.hidden && anInt1026 != rsi.id && anInt1048 != rsi.id && anInt1039 != rsi.id) {
  1364. return;
  1365. }
  1366. int i1 = DrawingArea.startX;
  1367. int j1 = DrawingArea.startY;
  1368. int k1 = DrawingArea.endX;
  1369. int l1 = DrawingArea.endY;
  1370. DrawingArea.setBounds(offsetX, offsetY, offsetX + rsi.width, offsetY + rsi.height);
  1371. int i2 = rsi.children.length;
  1372. for (int j2 = 0; j2 < i2; j2++) {
  1373. int positionX = rsi.childX[j2] + offsetX;
  1374. int positionY = (rsi.childY[j2] + offsetY) - paddingY;
  1375. RSInterface child = RSInterface.interfaceCache[rsi.children[j2]];
  1376. if (child == null)
  1377. continue;
  1378. positionX += child.drawOffsetX;
  1379. positionY += child.drawOffsetY;
  1380. if (child.contentType > 0) {
  1381. drawContentForInterface(child);
  1382. }
  1383. if (child.type == 0) {
  1384. if (child.scrollPosition > child.scrollMax - child.height) {
  1385. child.scrollPosition = child.scrollMax - child.height;
  1386. }
  1387. if (child.scrollPosition < 0) {
  1388. child.scrollPosition = 0;
  1389. }
  1390. drawInterface(positionX, positionY, child.scrollPosition, child);
  1391.  
  1392. if (child.id == 5385) {
  1393. int height = 0;
  1394. if (currentBankTab == 0) {
  1395. height += BankManager.getMainBankHeight();
  1396. if (GameSettings.FULL_BANK_VIEW.toggled()) {
  1397. for (int tabId : BankManager.TAB_CHILD_IDS) {
  1398. height += BankManager.getHeightForTab(tabId);
  1399. }
  1400. } else {
  1401. height -= 30;
  1402. }
  1403. } else {
  1404. height = BankManager.getHeightForTab(BankManager.TAB_CHILD_IDS[currentBankTab]);
  1405. }
  1406. child.scrollMax = height;
  1407. if (height > 185)
  1408. drawScrollbar(child.height, child.scrollPosition, positionY, positionX + child.width, child.scrollMax, false, false);
  1409. } else {
  1410. // clan chat
  1411. if (child.scrollMax > child.height) {
  1412. if (child.id == 18143) {
  1413. int clanMates = 0;
  1414. for (int index = 18155; index < 18244; index++) {
  1415. RSInterface line = RSInterface.interfaceCache[index];
  1416. if (line.disabledText.length() > 0) {
  1417. clanMates++;
  1418. }
  1419. }
  1420. child.scrollMax = (clanMates * 14) + child.height + 1;
  1421. }
  1422. if (child.id == 18322 || child.id == 18423) {
  1423. int members = 0;
  1424. for (int index = child.id + 1; index < child.id + 1 + 100; index++) {
  1425. RSInterface line = RSInterface.interfaceCache[index];
  1426. if (line.disabledText.length() > 0) {
  1427. members++;
  1428. }
  1429. }
  1430. child.scrollMax = (members * 14) + 1;
  1431. }
  1432.  
  1433. if (child.id == 30509) {
  1434. int lines = 0;
  1435. for (int index = child.id + 1; index < child.id + 1 + child.children.length; index++) {
  1436. RSInterface line = RSInterface.interfaceCache[index];
  1437. if (line.disabledText.length() > 0) {
  1438. lines++;
  1439. }
  1440. }
  1441. child.scrollMax = (lines * 14) + 1;
  1442. }
  1443. drawScrollbar(child.height, child.scrollPosition, positionY, positionX + child.width, child.scrollMax, false, false);
  1444. }
  1445. }
  1446. refreshBankTabs();
  1447. } else if (child.type != 1) {
  1448. if (child.type == 2) {
  1449. if (child.hidden)
  1450. continue;
  1451. int index = 0;
  1452.  
  1453. if (openInterfaceID == 5292) {
  1454. if (currentBankTab == 0) {
  1455. if (GameSettings.FULL_BANK_VIEW.toggled()) {
  1456. for (int tabId : BankManager.TAB_CHILD_IDS) {
  1457. if (child.id == tabId) {
  1458. positionY += BankManager.getMainBankHeight();
  1459. } else if (tabId < child.id) {
  1460. positionY += BankManager.getHeightForTab(tabId);
  1461. }
  1462. }
  1463. if (child.parentId == 5292 && child.id != 5382 && child.id != 46500 && child.inventory != null
  1464. && child.inventory[0] > 0) {
  1465. int drawX = positionX - 8;
  1466. int tabId = (child.id - 46500) / 400;
  1467. if (tabId > 0) {
  1468. RSImageLoader.images[533].drawImage(drawX + 6, positionY - 4);
  1469. RSImageLoader.images[991].drawImage(drawX, positionY - 10);
  1470. newSmallFont.drawBasicString("Tab " + tabId, drawX, positionY - 12, 0xFF981F, 1);
  1471. }
  1472. }
  1473. } else {
  1474. if (child.id != BankManager.TAB_CHILD_IDS[currentBankTab]) {
  1475. switch (child.id) {
  1476. case 46500:
  1477. case 46900:
  1478. case 47300:
  1479. case 47700:
  1480. case 48100:
  1481. case 48500:
  1482. case 48900:
  1483. case 49300:
  1484. continue;
  1485. }
  1486. }
  1487. }
  1488. } else {
  1489. if (currentBankTab >= 0 && currentBankTab < BankManager.TAB_CHILD_IDS.length
  1490. && child.id != BankManager.TAB_CHILD_IDS[currentBankTab]) {
  1491. switch (child.id) {
  1492. case 5382:
  1493. case 46500:
  1494. case 46900:
  1495. case 47300:
  1496. case 47700:
  1497. case 48100:
  1498. case 48500:
  1499. case 48900:
  1500. case 49300:
  1501. continue;
  1502. }
  1503. }
  1504. }
  1505. }
  1506.  
  1507. if (child.id >= 51_560 && child.id <= 51_566 && !child.hidden) {
  1508. GrandExchange.drawOfferInterface(this, child, positionX, positionY);
  1509. }
  1510. for (int l3 = 0; l3 < child.height; l3++) {
  1511. for (int l4 = 0; l4 < child.width; l4++) {
  1512. int x = positionX + l4 * (32 + child.invSpritePadX);
  1513. int y = positionY + l3 * (32 + child.invSpritePadY);
  1514. if (index < 20) {
  1515. x += child.spritesX[index];
  1516. y += child.spritesY[index];
  1517. }
  1518. if (child.inventory[index] > 0) {
  1519. if (rsi.id == 51500 && (child.inventoryAmount[index] <= 0 || child.geOfferType == 1 && index == 0)) {
  1520. if (index == 0)
  1521. index++;
  1522. continue;
  1523. }
  1524. int offX = 0;
  1525. int offY = 0;
  1526. int itemId = (int) child.inventory[index] - 1;
  1527.  
  1528. int value = child.shopPrices != null && index < child.shopPrices.length ? child.shopPrices[index] : 0;
  1529. String formatPrice = value > 0 ? formatAmount(value) : "FREE";
  1530. if (x > DrawingArea.startX - 32 && x < DrawingArea.endX && y > DrawingArea.startY - 32
  1531. && y < DrawingArea.endY || activeInterfaceType != 0 && originalDragSlot == index) {
  1532. int outlineColor = 0;
  1533. if (itemSelected >= 1 && itemSelectedSlot[index] && inventoryInterfaceId == child.id) {
  1534. outlineColor = 0xffffff;
  1535. }
  1536. RSImage itemSprite = ItemDef.getImage(itemId, child.inventoryAmount[index], outlineColor);
  1537. if (itemSprite != null) {
  1538. if (child.sprite1 != null) {
  1539. RSImage sprite = child.sprite1;
  1540.  
  1541. if (mouseInRegion(x, x + sprite.maxWidth, y, y + sprite.maxHeight)
  1542. && child.hoverSprite1 != null) {
  1543. sprite = child.hoverSprite1;
  1544. }
  1545.  
  1546. int offset_x = -5;
  1547. int offset_y = -5;
  1548.  
  1549. if (rsi.id == 40300 || rsi.id == 40400) {
  1550. offset_x = -3;
  1551. offset_y = -2;
  1552. }
  1553.  
  1554. sprite.drawImage(x + offset_x, y + offset_y, sprite.alpha > 0 ? sprite.alpha : 256);
  1555.  
  1556. if (child.shopInterface) {
  1557. newSmallFont.drawBasicString(formatPrice, (25 - newSmallFont.getTextWidth(formatPrice)) + x
  1558. + offX + child.width / 2, (y + 43 + offY), getAmountColor(value), 0);
  1559. child.shopCurrency.drawImage(x + offX + 30, y + 33 + offY);
  1560. }
  1561. }
  1562. if (activeInterfaceType != 0 && originalDragSlot == index && hoveredInterfaceChild == child.id) {
  1563. offX = super.getMouseX() - anInt1087;
  1564. offY = super.getMouseY() - anInt1088;
  1565. if (offX < 5 && offX > -5) {
  1566. offX = 0;
  1567. }
  1568. if (offY < 5 && offY > -5) {
  1569. offY = 0;
  1570. }
  1571. if (anInt989 < 10) {
  1572. offX = 0;
  1573. offY = 0;
  1574. }
  1575. itemSprite.drawImage(x + offX, y + offY, 128);
  1576. if (y + offY < DrawingArea.startY && y + offY > DrawingArea.startY - (y + offY) + 10
  1577. && rsi.scrollPosition > 0) {
  1578. int i10 = (anInt945 * (DrawingArea.startY - y - offY)) / 4;
  1579. if (i10 > anInt945 * 10) {
  1580. i10 = anInt945 * 10;
  1581. }
  1582. if (i10 > rsi.scrollPosition) {
  1583. i10 = rsi.scrollPosition;
  1584. }
  1585. rsi.scrollPosition -= i10;
  1586. anInt1088 += i10;
  1587. }
  1588. if (y + offY + 32 > DrawingArea.endY && rsi.scrollPosition < rsi.scrollMax - rsi.height) {
  1589. int j10 = (anInt945 * ((y + offY + 32) - DrawingArea.endY)) / 3;
  1590. if (j10 > anInt945 * 10) {
  1591. j10 = anInt945 * 10;
  1592. }
  1593. if (j10 > rsi.scrollMax - rsi.height - rsi.scrollPosition) {
  1594. j10 = rsi.scrollMax - rsi.height - rsi.scrollPosition;
  1595. }
  1596. rsi.scrollPosition += j10;
  1597. anInt1088 -= j10;
  1598. }
  1599. } else if (atInventoryInterfaceType != 0 && atInventoryIndex == index
  1600. && atInventoryInterface == child.id) {
  1601. itemSprite.drawImage(x, y, 128);
  1602. } else {
  1603. itemSprite.drawImage(x, y);
  1604. }
  1605. if (itemSprite.maxWidth == 33 || child.inventoryAmount[index] != 1) {
  1606. if (!(child.id >= 22035 && child.id <= 22042)) {
  1607. long amount = child.inventoryAmount[index];
  1608. if (amount >= Integer.MAX_VALUE && child.inventory[index] != 996) {
  1609. RSImageLoader.images[997].drawImage(x + offX, y + offY);
  1610. } else {
  1611. newSmallFont.drawBasicString(formatAmount(amount), x + offX, y + 9 + offY,
  1612. getAmountColor(amount), 0);
  1613. }
  1614. }
  1615. }
  1616. }
  1617. }
  1618. } else if (child.images != null && index < 20) {
  1619. RSImage rSImage = child.images[index];
  1620. if (rSImage != null) {
  1621. rSImage.drawImage(x, y);
  1622. }
  1623. }
  1624. if (child.showChangeExclamation != null && child.showChangeExclamation[index]) {
  1625. if (child.showChangeExclamationTimer[index] > 0) {
  1626. long delay = (System.currentTimeMillis() - child.showChangeExclamationDelay[index]);
  1627. int alpha = 256;
  1628. /*
  1629. * if (child.showChangeExclamationTimer[index] == 3) {
  1630. * alpha = 128;
  1631. * } else if (child.showChangeExclamationTimer[index] == 2) {
  1632. * alpha = 64;
  1633. * } else if (child.showChangeExclamationTimer[index] == 1) {
  1634. * alpha = 32;
  1635. * }
  1636. */
  1637. if (delay < 200) {
  1638. x += child.sprite1 != null ? child.sprite1.maxWidth / 2 - 3 : 15;
  1639. y += child.sprite1 != null ? child.sprite1.maxHeight / 2 - 3 : 17;
  1640. RSImageLoader.images[196].drawCenteredARGBImage(x, y, alpha);
  1641. }
  1642. if (delay >= 500) {
  1643. child.showChangeExclamationTimer[index]--;
  1644. child.showChangeExclamationDelay[index] = System.currentTimeMillis();
  1645. }
  1646. } else {
  1647. child.showChangeExclamation[index] = false;
  1648. }
  1649. }
  1650. index++;
  1651. }
  1652. }
  1653. } else if (child.type == 3) {
  1654. boolean flag = false;
  1655. if (anInt1039 == child.id || anInt1048 == child.id || anInt1026 == child.id) {
  1656. flag = true;
  1657. }
  1658. int color;
  1659. if (interfaceIsSelected(child)) {
  1660. color = child.enabledColor;
  1661. if (flag && child.anInt239 != 0) {
  1662. color = child.anInt239;
  1663. }
  1664. } else {
  1665. color = child.disabledColor;
  1666. if (flag && child.anInt216 != 0) {
  1667. color = child.anInt216;
  1668. }
  1669. }
  1670. if (child.alpha == 0) {
  1671. if (child.filled) {
  1672. DrawingArea.drawFilledPixels(positionX, positionY, child.width, child.height, color);
  1673. } else {
  1674. DrawingArea.drawUnfilledPixels(positionX, positionY, child.width, child.height, color);
  1675. }
  1676. } else if (child.filled) {
  1677. DrawingArea.drawFilledPixels(positionX, positionY, child.width, child.height, color, 256 - (child.alpha & 0xff));
  1678. } else {
  1679. DrawingArea.drawUnfilledAlphaPixels(positionX, positionY, child.width, child.height, color,
  1680. 256 - (child.alpha & 0xff));
  1681. }
  1682. } else if (child.type == 4) {
  1683. if (child.hidden)
  1684. continue;
  1685. RSFontSystem font = child.font;
  1686. String text = child.disabledText;
  1687. if (isDeveloper())
  1688. text += ":" + child.id;
  1689. boolean flag1 = false;
  1690. if (anInt1039 == child.id || anInt1048 == child.id || anInt1026 == child.id) {
  1691. flag1 = true;
  1692. }
  1693.  
  1694. if (child.id == 60_009 && text != null && !isDonator() && text.startsWith("Slot: 3")) {
  1695. DrawingArea.drawRoundedRectangle(positionX + 83, positionY + 12, 310, 250, 0x000000, 200, true, false);
  1696. newFancyFont.drawCenteredString("This slot is only available for members", positionX + 235, positionY + 125,
  1697. RSInterface.ORANGE_TEXT, 1);
  1698. }
  1699.  
  1700. int color;
  1701. if (interfaceIsSelected(child)) {
  1702. color = child.enabledColor;
  1703. if (flag1 && child.anInt239 != 0) {
  1704. color = child.anInt239;
  1705. }
  1706. if (child.enabledText.length() > 0) {
  1707. text = child.enabledText;
  1708. }
  1709. } else {
  1710. color = child.disabledColor;
  1711. if (flag1 && child.anInt216 != 0) {
  1712. color = child.anInt216;
  1713. }
  1714. }
  1715. if (myPlayer.gameMode == 4) {
  1716. if (child.id == 663) {
  1717. text = "Click To Spawn (Fee)";
  1718. } else if (child.id == 7332) {
  1719. text = "Main - @gre@Melee Set @whi@[330k]";
  1720. color = 0xFFFFFF;
  1721. } else if (child.id == 7333) {
  1722. text = "Main - @gre@Ranged Set @whi@[170k]";
  1723. color = 0xFFFFFF;
  1724. } else if (child.id == 7334) {
  1725. text = "Main - @gre@Hybrid Set @whi@[620k]";
  1726. color = 0xFFFFFF;
  1727. } else if (child.id == 7336) {
  1728. continue;
  1729.  
  1730. } else if (child.id == 7383) {
  1731. text = "Pure - @gre@Melee Set @whi@[275k]";
  1732. color = 0xFFFFFF;
  1733. } else if (child.id == 7339) {
  1734. text = "Pure - @gre@Ranged Set @whi@[150k]";
  1735. color = 0xFFFFFF;
  1736. } else if (child.id == 7338) {
  1737. text = "Pure - @gre@Hybrid Set @whi@[250k]";
  1738. color = 0xFFFFFF;
  1739. } else if (child.id == 7340) {
  1740. continue;
  1741.  
  1742. } else if (child.id == 7346) {
  1743. text = "Zerker - @gre@Melee Set @whi@[390k]";
  1744. color = 0xFFFFFF;
  1745. } else if (child.id == 7341) {
  1746. text = "Tank - @gre@Ranged Set @whi@[295k]";
  1747. color = 0xFFFFFF;
  1748. } else if (child.id == 7342) {
  1749. continue;
  1750.  
  1751. } else if (child.id == 7337) {
  1752. text = "Food - @gre@Shark x5 @whi@[2k]";
  1753. color = 0xFFFFFF;
  1754. } else if (child.id == 7343) {
  1755. text = "Runes - @gre@Barrage x50 @whi@[13k]";
  1756. color = 0xFFFFFF;
  1757. } else if (child.id == 7335) {
  1758. text = "Runes - @gre@Vengeance x50 @whi@[13k]";
  1759. color = 0xFFFFFF;
  1760. } else if (child.id == 7344) {
  1761. continue;
  1762.  
  1763. } else if (child.id == 7345) {
  1764. text = "Super Set - @gre@Melee @whi@[12k]";
  1765. color = 0xFFFFFF;
  1766. } else if (child.id == 7347) {
  1767. text = "Super Set - @gre@Ranged @whi@[12k]";
  1768. color = 0xFFFFFF;
  1769. } else if (child.id == 7348) {
  1770. text = "Super Set - @gre@Magic @whi@[15k]";
  1771. color = 0xFFFFFF;
  1772. }
  1773. }
  1774. if (child.actionType == 6 && aBoolean1149) {
  1775. text = "Please wait...";
  1776. color = child.disabledColor;
  1777. }
  1778. if (DrawingArea.width == 519) {
  1779. if (color == 0xffff00) {
  1780. color = 255;
  1781. }
  1782. if (color == 49152) {
  1783. color = 0xffffff;
  1784. }
  1785. }
  1786. if (text != null) {
  1787. for (int l6 = positionY + font.baseCharacterHeight; text.length() > 0; l6 += font.baseCharacterHeight) {
  1788. if (text.indexOf("%") != -1) {
  1789. do {
  1790. int k7 = text.indexOf("%1");
  1791. if (k7 == -1) {
  1792. break;
  1793. }
  1794. text = text.substring(0, k7) + interfaceIntToString(extractInterfaceValues(child, 0))
  1795. + text.substring(k7 + 2);
  1796. } while (true);
  1797. do {
  1798. int l7 = text.indexOf("%2");
  1799. if (l7 == -1) {
  1800. break;
  1801. }
  1802. text = text.substring(0, l7) + interfaceIntToString(extractInterfaceValues(child, 1))
  1803. + text.substring(l7 + 2);
  1804. } while (true);
  1805. do {
  1806. int i8 = text.indexOf("%3");
  1807. if (i8 == -1) {
  1808. break;
  1809. }
  1810. text = text.substring(0, i8) + interfaceIntToString(extractInterfaceValues(child, 2))
  1811. + text.substring(i8 + 2);
  1812. } while (true);
  1813. do {
  1814. int j8 = text.indexOf("%4");
  1815. if (j8 == -1) {
  1816. break;
  1817. }
  1818. text = text.substring(0, j8) + interfaceIntToString(extractInterfaceValues(child, 3))
  1819. + text.substring(j8 + 2);
  1820. } while (true);
  1821. do {
  1822. int k8 = text.indexOf("%5");
  1823. if (k8 == -1) {
  1824. break;
  1825. }
  1826. text = text.substring(0, k8) + interfaceIntToString(extractInterfaceValues(child, 4))
  1827. + text.substring(k8 + 2);
  1828. } while (true);
  1829. }
  1830. int line = text.indexOf("\\n");
  1831. String displayedText;
  1832. if (line != -1) {
  1833. displayedText = text.substring(0, line);
  1834. text = text.substring(line + 2);
  1835. } else {
  1836. displayedText = text;
  1837. text = "";
  1838. }
  1839. if (child.centerText) {
  1840. font.drawCenteredString(displayedText/* + " - " + child.id */, positionX + child.width / 2, l6, color,
  1841. child.shadeText ? 0 : -1);
  1842. } else {
  1843. font.drawBasicString(displayedText/* + " - " + child.id */, positionX, l6, color, child.shadeText ? 0 : -1);
  1844. }
  1845. }
  1846. }
  1847. } else if (child.type == 5 || child.type == 10) { // 10 = hd sprite
  1848.  
  1849. if (child.id >= 51003 && child.id <= 51014) {
  1850. GrandExchange.drawMainInterface(this, child, positionX, positionY);
  1851. } else if (child.id == 51829) {
  1852. GrandExchange.drawPurchaseSearchInterface(this, child, positionX, positionY);
  1853. } else if (child.id == 51879) {
  1854. GrandExchange.drawSellSearchInterface(this, child, positionX, positionY);
  1855. }
  1856.  
  1857. if (child.hidden)
  1858. continue;
  1859. RSImage image;
  1860. RSImage hover;
  1861.  
  1862. if (child.itemSpriteId1 != -1 && child.sprite1 == null) {
  1863. child.sprite1 = ItemDef.getFeedImage(child.itemSpriteId1, 1, 0, child.itemSpriteZoom1);
  1864. child.sprite2 = ItemDef.getFeedImage(child.itemSpriteId2, 1, 0, child.itemSpriteZoom2);
  1865. // rsChildren.sprite2 = ItemDef.getSprite(rsChildren.itemSpriteId2, rsChildren.invStackSizes[spriteIndex], selectedColour);
  1866. if (child.greyScale)
  1867. child.sprite1.greyScale();
  1868. }
  1869. boolean configActive = interfaceIsSelected(child);
  1870. if (configActive) {
  1871. image = child.sprite2;
  1872. hover = child.hoverSprite2;
  1873. } else {
  1874. image = child.sprite1;
  1875. hover = child.hoverSprite1;
  1876. }
  1877. /*
  1878. * if (image.horizontalMirror) {
  1879. * image.mirrorHorizontal();
  1880. * }
  1881. * if (image.verticalMirror) {
  1882. * image.mirrorVertical();
  1883. * }
  1884. */
  1885. if (spellSelected == 1 && child.id == spellID && spellID != 0 && image != null) {
  1886. image.drawOutlinedSprite_2(positionX, positionY, 0xffffff);
  1887. } else {
  1888. if (image != null) {
  1889. if (child.type == 5) {
  1890. if (child.drawsTransparent)
  1891. image.drawImageWithOpacity(positionX, positionY, child.opacity);
  1892. else {
  1893. if (rsi.outlineColor == -1)
  1894. image.drawImage(positionX, positionY);
  1895. else
  1896. image.drawOutlinedSprite_2(positionX, positionY, rsi.outlineColor);
  1897. }
  1898. } else {
  1899. image.drawAdvancedSprite(positionX, positionY);
  1900. }
  1901. }
  1902. if (autocasting && child.id == autocastId) {
  1903. if (child.type == 5) {
  1904. /*
  1905. * if (child.drawsTransparent)
  1906. * RSImageLoader.images[667].drawImageWithOpacity(positionX - 3, positionY - 1, child.opacity);
  1907. * else
  1908. * RSImageLoader.images[667].drawImage(positionX - 16 + (child.width / 2),
  1909. * positionY - 16 + (child.height / 2));
  1910. */
  1911. DrawingArea.drawRoundedRectangle(positionX - (child.sprite1.myWidth / 6), positionY
  1912. - (child.sprite1.myHeight / 4), child.sprite1.myWidth + 7, child.sprite1.myHeight + 10, 0xFFFFFF,
  1913. 200, false, true);
  1914. } else {
  1915. RSImageLoader.images[667].drawAdvancedSprite(positionX - 3, positionY - 1);
  1916. }
  1917. }
  1918. }
  1919. if (hover != null) {
  1920. if (hoverId == child.id) {
  1921. if (child.hoverSpeed != 0) {
  1922. child.buttonAlpha += child.buttonAlpha < 250 ? child.hoverSpeed : 0;
  1923. child.buttonAlpha -= child.buttonAlpha > 250 ? 1 : 0;
  1924. if (child.buttonAlpha < 250) {
  1925. if (child.type == 5) {
  1926. hover.drawImage(positionX, positionY, child.buttonAlpha);
  1927. } else {
  1928. hover.drawAdvancedSprite(positionX, positionY);
  1929. }
  1930. } else {
  1931. if (child.type == 5) {
  1932. hover.drawImage(positionX, positionY);
  1933. } else {
  1934. hover.drawAdvancedSprite(positionX, positionY);
  1935. }
  1936. }
  1937. } else {
  1938. if (child.type == 5) {
  1939. hover.drawImage(positionX, positionY);
  1940. } else {
  1941. hover.drawAdvancedSprite(positionX, positionY);
  1942. }
  1943. }
  1944. } else {
  1945. if (child.hoverSpeed != 0) {
  1946. child.buttonAlpha -= child.buttonAlpha > 0 ? child.hoverSpeed : 0;
  1947. if (child.type == 5) {
  1948. hover.drawImage(positionX, positionY, child.buttonAlpha);
  1949. } else {
  1950. hover.drawAdvancedSprite(positionX, positionY);
  1951. }
  1952. }
  1953. }
  1954. }
  1955. } else if (child.type == 6) {
  1956. int k3 = Rasterizer.centerX;
  1957. int j4 = Rasterizer.centerY;
  1958. Rasterizer.centerX = positionX + child.width / 2;
  1959. Rasterizer.centerY = positionY + child.height / 2;
  1960. if (child.modelZoom == 2000 && child.mediaType == 3 && myPlayer.equipment[0] <= 0)
  1961. child.modelZoom = 800;
  1962. int sine = Rasterizer.SINE[child.modelRotationY] * child.modelZoom >> 16;
  1963. int cosine = Rasterizer.COSINE[child.modelRotationY] * child.modelZoom >> 16;
  1964. boolean config_selected = interfaceIsSelected(child);
  1965. int config_state;
  1966. if (config_selected) {
  1967. config_state = child.enabledMediaAnimation;
  1968. } else {
  1969. config_state = child.disabledMediaAnimation;
  1970. }
  1971. Model model;
  1972. if (config_state == -1) {
  1973. model = child.getMediaModel(-1, -1, config_selected);
  1974. } else {
  1975. Animation animation = Animation.getAnim(config_state);
  1976. model = child.getMediaModel(animation.secondaryFrames[child.anInt246], animation.frames[child.anInt246],
  1977. config_selected);
  1978. }
  1979. if (model != null) {
  1980. model.drawModel(child.modelRotationX, 2, child.modelRotationY, 3, sine, cosine);
  1981. }
  1982. Rasterizer.centerX = k3;
  1983. Rasterizer.centerY = j4;
  1984. if (isDeveloper())
  1985. newFancyFont.drawBasicString("" + child.id, positionX, positionY + (child.height / 2));
  1986. } else if (child.type == 7) {
  1987. RSFontSystem font = child.font;
  1988. int k4 = 0;
  1989. for (int j5 = 0; j5 < child.height; j5++) {
  1990. for (int i6 = 0; i6 < child.width; i6++) {
  1991. if (child.inventory[k4] > 0) {
  1992. ItemDef itemDef = ItemDef.getDef((int) child.inventory[k4] - 1);
  1993. String s2 = itemDef.name;
  1994. if (itemDef.stackable || child.inventoryAmount[k4] != 1) {
  1995. s2 = s2 + " currentX" + intToKOrMilLongName(child.inventoryAmount[k4]);
  1996. }
  1997. int i9 = positionX + i6 * (115 + child.invSpritePadX);
  1998. int k9 = positionY + j5 * (12 + child.invSpritePadY);
  1999. if (child.centerText) {
  2000. font.drawCenteredString(s2, i9 + child.width / 2, k9, child.disabledColor, child.shadeText ? 0 : -1);
  2001. } else {
  2002. font.drawBasicString(s2, i9, k9, child.disabledColor, child.shadeText ? 0 : -1);
  2003. }
  2004. }
  2005. k4++;
  2006. }
  2007. }
  2008. } else if (child.type == 8 && (anInt1500 == child.id || anInt1044 == child.id || anInt1129 == child.id) && anInt1501 == 50
  2009. && !menuOpen && GameSettings.TOOLTIPS.toggled() && child.disabledText != null && child.disabledText.length() > 0) {
  2010. if (child.hidden)
  2011. continue;
  2012. int boxWidth = 0;
  2013. int boxHeight = 0;
  2014. RSFont font = normalFont;
  2015. for (String s1 = child.disabledText; s1.length() > 0;) {
  2016. if (s1.indexOf("%") != -1) {
  2017. do {
  2018. int k7 = s1.indexOf("%1");
  2019. if (k7 == -1) {
  2020. break;
  2021. }
  2022. s1 = s1.substring(0, k7) + interfaceIntToString(extractInterfaceValues(child, 0)) + s1.substring(k7 + 2);
  2023. } while (true);
  2024. do {
  2025. int l7 = s1.indexOf("%2");
  2026. if (l7 == -1) {
  2027. break;
  2028. }
  2029. s1 = s1.substring(0, l7) + interfaceIntToString(extractInterfaceValues(child, 1)) + s1.substring(l7 + 2);
  2030. } while (true);
  2031. do {
  2032. int i8 = s1.indexOf("%3");
  2033. if (i8 == -1) {
  2034. break;
  2035. }
  2036. s1 = s1.substring(0, i8) + interfaceIntToString(extractInterfaceValues(child, 2)) + s1.substring(i8 + 2);
  2037. } while (true);
  2038. do {
  2039. int j8 = s1.indexOf("%4");
  2040. if (j8 == -1) {
  2041. break;
  2042. }
  2043. s1 = s1.substring(0, j8) + interfaceIntToString(extractInterfaceValues(child, 3)) + s1.substring(j8 + 2);
  2044. } while (true);
  2045. do {
  2046. int k8 = s1.indexOf("%5");
  2047. if (k8 == -1) {
  2048. break;
  2049. }
  2050. s1 = s1.substring(0, k8) + interfaceIntToString(extractInterfaceValues(child, 4)) + s1.substring(k8 + 2);
  2051. } while (true);
  2052. }
  2053. int l7 = s1.indexOf("\\n");
  2054. String s4;
  2055. if (l7 != -1) {
  2056. s4 = s1.substring(0, l7);
  2057. s1 = s1.substring(l7 + 2);
  2058. } else {
  2059. s4 = s1;
  2060. s1 = "";
  2061. }
  2062. int j10 = font.getTextWidth(s4);
  2063. if (j10 > boxWidth) {
  2064. boxWidth = j10;
  2065. }
  2066. boxHeight += font.anInt1497 + 1;
  2067. }
  2068. boxWidth += 6;
  2069. boxHeight += 7;
  2070. int xPos = (positionX + child.width) - 5 - boxWidth;
  2071. int yPos = positionY + child.height + 5;
  2072. if (xPos < positionX + 5) {
  2073. xPos = positionX + 5;
  2074. }
  2075. if (xPos + boxWidth > offsetX + rsi.width) {
  2076. xPos = (offsetX + rsi.width) - boxWidth;
  2077. }
  2078. if (yPos + boxHeight > offsetY + rsi.height) {
  2079. yPos = (positionY - boxHeight);
  2080. }
  2081. DrawingArea.drawFilledPixels(xPos, yPos, boxWidth, boxHeight, 0xFFFFA0);
  2082. DrawingArea.drawUnfilledPixels(xPos, yPos, boxWidth, boxHeight, 0);
  2083. String s2 = child.disabledText;
  2084. for (int j11 = yPos + font.anInt1497 + 2; s2.length() > 0; j11 += font.anInt1497 + 1) {// anInt1497
  2085. if (s2.indexOf("%") != -1) {
  2086. do {
  2087. int k7 = s2.indexOf("%1");
  2088. if (k7 == -1) {
  2089. break;
  2090. }
  2091. s2 = s2.substring(0, k7) + interfaceIntToString(extractInterfaceValues(child, 0)) + s2.substring(k7 + 2);
  2092. } while (true);
  2093. do {
  2094. int l7 = s2.indexOf("%2");
  2095. if (l7 == -1) {
  2096. break;
  2097. }
  2098. s2 = s2.substring(0, l7) + interfaceIntToString(extractInterfaceValues(child, 1)) + s2.substring(l7 + 2);
  2099. } while (true);
  2100. do {
  2101. int i8 = s2.indexOf("%3");
  2102. if (i8 == -1) {
  2103. break;
  2104. }
  2105. s2 = s2.substring(0, i8) + interfaceIntToString(extractInterfaceValues(child, 2)) + s2.substring(i8 + 2);
  2106. } while (true);
  2107. do {
  2108. int j8 = s2.indexOf("%4");
  2109. if (j8 == -1) {
  2110. break;
  2111. }
  2112. s2 = s2.substring(0, j8) + interfaceIntToString(extractInterfaceValues(child, 3)) + s2.substring(j8 + 2);
  2113. } while (true);
  2114. do {
  2115. int k8 = s2.indexOf("%5");
  2116. if (k8 == -1) {
  2117. break;
  2118. }
  2119. s2 = s2.substring(0, k8) + interfaceIntToString(extractInterfaceValues(child, 4)) + s2.substring(k8 + 2);
  2120. } while (true);
  2121. }
  2122. int l11 = s2.indexOf("\\n");
  2123. String s5;
  2124. if (l11 != -1) {
  2125. s5 = s2.substring(0, l11);
  2126. s2 = s2.substring(l11 + 2);
  2127. } else {
  2128. s5 = s2;
  2129. s2 = "";
  2130. }
  2131. if (child.centerText) {
  2132. font.method382(yPos, xPos + child.width / 2, s5, j11, false);
  2133. } else {
  2134. if (s5.contains("\\r")) {
  2135. String text = s5.substring(0, s5.indexOf("\\r"));
  2136. String text2 = s5.substring(s5.indexOf("\\r") + 2);
  2137. font.method389(false, xPos + 3, 0, text, j11);
  2138. int rightX = boxWidth + xPos - font.getTextWidth(text2) - 2;
  2139. font.method389(false, rightX, 0, text2, j11);
  2140. } else {
  2141. font.method389(false, xPos + 3, 0, s5, j11);
  2142. }
  2143. }
  2144. }
  2145. } else if (child.type == 9) {
  2146. int offX = clientSize == 0 ? 4 : 0;
  2147. int offY = clientSize == 0 ? 4 : 0;
  2148. if (child.region == 1) {
  2149. offX = clientSize == 0 ? 519 : 0;
  2150. offY = clientSize == 0 ? 168 : 0;
  2151. }
  2152. int x = offX + positionX;
  2153. int y = offY + positionY;
  2154. if (child.slider != null) {
  2155. child.slider.setX(positionX);
  2156. child.slider.setY(positionY);
  2157. child.slider.drawSlider(x, y);
  2158. }
  2159. } else if (child.type == 11 && super.clickMode2 == 0 && !menuOpen && GameSettings.TOOLTIPS.toggled()
  2160. && child.popupString != null && child.popupString.length() > 0
  2161. && (selectedDropDownMenu == null || selectedDropDownMenu.hoverId == rsi.id)) {
  2162. if (child.parentId > 0 && RSInterface.interfaceCache[child.parentId] != null
  2163. && RSInterface.interfaceCache[child.parentId].hidden)
  2164. continue;
  2165.  
  2166. int boxWidth = 0;
  2167. int boxHeight = 0;
  2168. RSFont font = normalFont;
  2169. for (String s1 = child.popupString; s1.length() > 0;) {
  2170. if (s1.indexOf("%") != -1) {
  2171. do {
  2172. int k7 = s1.indexOf("%1");
  2173. if (k7 == -1) {
  2174. break;
  2175. }
  2176. s1 = s1.substring(0, k7) + interfaceIntToString(extractInterfaceValues(child, 0)) + s1.substring(k7 + 2);
  2177. } while (true);
  2178. do {
  2179. int l7 = s1.indexOf("%2");
  2180. if (l7 == -1) {
  2181. break;
  2182. }
  2183. s1 = s1.substring(0, l7) + interfaceIntToString(extractInterfaceValues(child, 1)) + s1.substring(l7 + 2);
  2184. } while (true);
  2185. do {
  2186. int i8 = s1.indexOf("%3");
  2187. if (i8 == -1) {
  2188. break;
  2189. }
  2190. s1 = s1.substring(0, i8) + interfaceIntToString(extractInterfaceValues(child, 2)) + s1.substring(i8 + 2);
  2191. } while (true);
  2192. do {
  2193. int j8 = s1.indexOf("%4");
  2194. if (j8 == -1) {
  2195. break;
  2196. }
  2197. s1 = s1.substring(0, j8) + interfaceIntToString(extractInterfaceValues(child, 3)) + s1.substring(j8 + 2);
  2198. } while (true);
  2199. do {
  2200. int k8 = s1.indexOf("%5");
  2201. if (k8 == -1) {
  2202. break;
  2203. }
  2204. s1 = s1.substring(0, k8) + interfaceIntToString(extractInterfaceValues(child, 4)) + s1.substring(k8 + 2);
  2205. } while (true);
  2206. }
  2207. int l7 = s1.indexOf("\\n");
  2208. String s4;
  2209. if (l7 != -1) {
  2210. s4 = s1.substring(0, l7);
  2211. s1 = s1.substring(l7 + 2);
  2212. } else {
  2213. s4 = s1;
  2214. s1 = "";
  2215. }
  2216. int j10 = font.getTextWidth(s4);
  2217. if (j10 > boxWidth) {
  2218. boxWidth = j10;
  2219. }
  2220. boxHeight += font.anInt1497 + 1;
  2221. }
  2222. boxWidth += 6;
  2223. boxHeight += 7;
  2224. int xPos = (positionX + child.width) - 5 - boxWidth;
  2225. int yPos = positionY + child.height + 5;
  2226. if (xPos < positionX + 5) {
  2227. xPos = positionX + 5;
  2228. }
  2229. if (xPos + boxWidth > offsetX + rsi.width) {
  2230. xPos = (offsetX + rsi.width) - boxWidth;
  2231. }
  2232. if (yPos + boxHeight > offsetY + rsi.height) {
  2233. yPos = (positionY - boxHeight);
  2234. }
  2235. DrawingArea.drawFilledPixels(positionX, positionY, boxWidth, boxHeight, 0xFFFFA0);
  2236. DrawingArea.drawUnfilledPixels(positionX, positionY, boxWidth, boxHeight, 0);
  2237. String s2 = child.popupString;
  2238. for (int j11 = positionY + font.anInt1497 + 2; s2.length() > 0; j11 += font.anInt1497 + 1) {// anInt1497
  2239. if (s2.indexOf("%") != -1) {
  2240. do {
  2241. int k7 = s2.indexOf("%1");
  2242. if (k7 == -1) {
  2243. break;
  2244. }
  2245. s2 = s2.substring(0, k7) + interfaceIntToString(extractInterfaceValues(child, 0)) + s2.substring(k7 + 2);
  2246. } while (true);
  2247. do {
  2248. int l7 = s2.indexOf("%2");
  2249. if (l7 == -1) {
  2250. break;
  2251. }
  2252. s2 = s2.substring(0, l7) + interfaceIntToString(extractInterfaceValues(child, 1)) + s2.substring(l7 + 2);
  2253. } while (true);
  2254. do {
  2255. int i8 = s2.indexOf("%3");
  2256. if (i8 == -1) {
  2257. break;
  2258. }
  2259. s2 = s2.substring(0, i8) + interfaceIntToString(extractInterfaceValues(child, 2)) + s2.substring(i8 + 2);
  2260. } while (true);
  2261. do {
  2262. int j8 = s2.indexOf("%4");
  2263. if (j8 == -1) {
  2264. break;
  2265. }
  2266. s2 = s2.substring(0, j8) + interfaceIntToString(extractInterfaceValues(child, 3)) + s2.substring(j8 + 2);
  2267. } while (true);
  2268. do {
  2269. int k8 = s2.indexOf("%5");
  2270. if (k8 == -1) {
  2271. break;
  2272. }
  2273. s2 = s2.substring(0, k8) + interfaceIntToString(extractInterfaceValues(child, 4)) + s2.substring(k8 + 2);
  2274. } while (true);
  2275. }
  2276. int l11 = s2.indexOf("\\n");
  2277. String s5;
  2278. if (l11 != -1) {
  2279. s5 = s2.substring(0, l11);
  2280. s2 = s2.substring(l11 + 2);
  2281. } else {
  2282. s5 = s2;
  2283. s2 = "";
  2284. }
  2285. if (child.centerText) {
  2286. font.method382(positionX + child.width / 2, positionY, s5, j11, false);
  2287. } else {
  2288. if (s5.contains("\\r")) {
  2289. String text = s5.substring(0, s5.indexOf("\\r"));
  2290. String text2 = s5.substring(s5.indexOf("\\r") + 2);
  2291. font.method389(false, positionX + 3, 0, text, j11);
  2292. int rightX = boxWidth + positionX - font.getTextWidth(text2) - 2;
  2293. font.method389(false, rightX, 0, text2, j11);
  2294. } else {
  2295. font.method389(false, positionX + 3, 0, s5, j11);
  2296. }
  2297. }
  2298. }
  2299. } else if (child.type == 12) {
  2300. // drawing drop down menus
  2301. int width = child.width;
  2302. int height = child.height;
  2303.  
  2304. if (child.dropDownIndex >= child.actions.length)
  2305. child.dropDownIndex = 0;
  2306. final String currentAction = child.disabledText + ": " + child.actions[child.dropDownIndex];
  2307. final RSFontSystem font = child.font;
  2308. final int fontWidth = font.getTextWidth(currentAction);
  2309.  
  2310. boolean reverseMenu = false;
  2311.  
  2312. if (fontWidth > width)
  2313. width = fontWidth + 10;
  2314.  
  2315. DrawingArea.drawFilledPixels(positionX, positionY, width, height, child.dropDownBoxColor,
  2316. child.opacity > 0 ? child.opacity : 255);
  2317. DrawingArea.drawUnfilledAlphaPixels(positionX - 1, positionY, width + 2, height, 0x000000,
  2318. child.opacity > 0 ? child.opacity : 255);
  2319.  
  2320. font.drawCenteredString(currentAction, positionX + (width / 2) - 1,
  2321. positionY + (height / 4) + font.baseCharacterHeight, child.disabledColor, child.shadeText ? 1 : 0);
  2322.  
  2323. int modifier = 15;
  2324. int actionHeight = child.actions.length * modifier;
  2325.  
  2326. if (isFixed()) {
  2327. if (positionY + actionHeight > clientHeight - chatArea.height - 20) {
  2328. reverseMenu = true;
  2329. }
  2330. } else {
  2331. if (positionY + actionHeight > clientHeight) {
  2332. reverseMenu = true;
  2333. }
  2334. }
  2335.  
  2336. if (System.currentTimeMillis() - lastChosenDropAction >= 750) {
  2337. if (mouseX >= positionX
  2338. && mouseX <= positionX + width + 5
  2339. && mouseY >= positionY
  2340. - (reverseMenu ? (selectedDropDownMenu == child ? actionHeight + child.height : 0) : 0)
  2341. && mouseY <= positionY
  2342. + (reverseMenu ? height : height + (selectedDropDownMenu == child ? actionHeight + 5 : 0))) {
  2343. if (selectedDropDownMenu != null && selectedDropDownMenu != child)
  2344. continue;
  2345. if (selectedDropDownMenu != child)
  2346. dropDownCurrentHeight = 0;
  2347. selectedDropDownMenu = child;
  2348. } else {
  2349. if (selectedDropDownMenu == child) {
  2350. selectedDropDownMenu = null;
  2351. dropDownCurrentHeight = 0;
  2352. }
  2353. }
  2354. }
  2355.  
  2356. if (reverseMenu)
  2357. positionY -= actionHeight + child.height;
  2358.  
  2359. if (dropDownCurrentHeight < actionHeight && selectedDropDownMenu == child) {
  2360. DrawingArea.drawRoundedRectangle(positionX, positionY + height, width, dropDownCurrentHeight,
  2361. child.dropDownBoxColor, 255, !child.drawsTransparent, false);
  2362. if (!child.drawsTransparent) {
  2363. DrawingArea.drawRoundedRectangle(positionX, positionY + height, width, dropDownCurrentHeight, 0x000000, 255,
  2364. false, false);
  2365. }
  2366. dropDownCurrentHeight += child.actions.length;
  2367. continue;
  2368. }
  2369.  
  2370. if (child == selectedDropDownMenu) {
  2371. DrawingArea.drawRoundedRectangle(positionX, positionY + height, width, actionHeight, child.dropDownBoxColor, 255,
  2372. !child.drawsTransparent, false);
  2373. if (!child.drawsTransparent) {
  2374. DrawingArea.drawRoundedRectangle(positionX, positionY + height, width, actionHeight, 0x000000, 255, false,
  2375. false);
  2376. }
  2377.  
  2378. int drawY = positionY;
  2379. for (int i = 0; i < child.actions.length; i++) {
  2380. int color = child.dropDownIndex == i ? 0x232B1F : child.disabledColor;
  2381. font.drawCenteredString(child.actions[i], positionX + (width / 2) - 1, drawY + (height * 2) + (modifier * i)
  2382. - 5, color, child.shadeText ? 1 : 0);
  2383.  
  2384. if (mouseX >= positionX && mouseX <= positionX + width && mouseY >= drawY + (height * 2) - 10 + (modifier * i)
  2385. && mouseY <= drawY + (height * 2) + (modifier * i)) {
  2386. hoverDropDownAction = i;
  2387. }
  2388.  
  2389. // if (i != hoverDropDownAction && i != child.actions.length - 1)
  2390. // DrawingArea.drawHorizontalLine(positionX, drawY + (height * 2) + (modifier * i) - 4,
  2391. // width, 0x000000);
  2392. }
  2393.  
  2394. if (hoverDropDownAction < child.actions.length && hoverDropDownAction >= 0
  2395. && hoverDropDownAction != child.dropDownIndex) {
  2396. DrawingArea.drawRoundedRectangle(positionX, drawY + (hoverDropDownAction * modifier) + modifier + 4, width,
  2397. modifier + (actionHeight / modifier) - 5, child.disabledColor, child.opacity > 0 ? child.opacity : 255,
  2398. false, true);
  2399. }
  2400. }
  2401. } else if (child.type == 13) {
  2402. // drawing pixels
  2403. if (child.contentType == 0)
  2404. DrawingArea.drawRoundedRectangle(positionX, positionY, child.width, child.height, child.disabledColor,
  2405. child.drawsTransparent ? child.opacity : 255, child.filled, child.shadeText);
  2406. } else if (child.type == 14) {
  2407. // drawing slideable pixels
  2408. boolean activated = interfaceIsSelected(child);
  2409. if (RSInterface.interfaceCache[child.parentId].selectedChild > 0
  2410. && child.id > RSInterface.interfaceCache[child.parentId].selectedChild)
  2411. positionY += RSInterface.interfaceCache[child.parentId].selectedChildHeight;
  2412.  
  2413. if (child.contentType == 0) {
  2414. String message = child.disabledText;
  2415. String[] disabledText = TextUtils.split(child.font, message, child.width - 4);
  2416. int height = child.height + (child.height * (disabledText.length - 1));
  2417.  
  2418. DrawingArea.drawRoundedRectangle(positionX, positionY, child.width, height, child.disabledColor, child.opacity,
  2419. child.filled, hoverId != child.id);
  2420.  
  2421. if (!child.centerText) {
  2422. int y = positionY;
  2423. for (String text : disabledText) {
  2424. child.font.drawBasicString(text, positionX + 5, y + (child.height / 2)
  2425. + (child.font.baseCharacterHeight / 2), 0xFFFFFF, child.shadeText ? 0 : -1, true);
  2426. y += child.font.baseCharacterHeight + 2;
  2427. }
  2428. } else {
  2429. int y = positionY;
  2430. for (String text : disabledText) {
  2431. child.font.drawCenteredString(text, positionX + (child.width / 2), y + (child.height / 2)
  2432. + (child.font.baseCharacterHeight / 2), 0xFFFFFF, child.shadeText ? 0 : -1, true);
  2433. y += child.font.baseCharacterHeight + 2;
  2434. }
  2435. }
  2436.  
  2437. if (activated) {
  2438. RSInterface.interfaceCache[child.parentId].selectedChild = child.id;
  2439. positionY += height;
  2440. message = child.enabledText;
  2441. disabledText = TextUtils.split(child.font, message, child.width - 4);
  2442. height = child.currentHeight;
  2443.  
  2444. DrawingArea.drawRoundedRectangle(positionX + 1, positionY, child.width, height, child.enabledColor,
  2445. child.opacity, child.filled, false);
  2446.  
  2447. RSInterface.interfaceCache[child.parentId].selectedChildHeight = height;
  2448.  
  2449. if (child.currentHeight >= (child.font.baseCharacterHeight + 1) * (disabledText.length + 1)) {
  2450. if (!child.centerText) {
  2451. int y = positionY;
  2452. for (String text : disabledText) {
  2453. child.font.drawBasicString(text, positionX + 5, y + (child.height / 2)
  2454. + (child.font.baseCharacterHeight / 2), 0xFFFFFF, child.shadeText ? 0 : -1, true);
  2455. y += child.font.baseCharacterHeight + 2;
  2456. }
  2457. } else {
  2458. int y = positionY;
  2459. for (String text : disabledText) {
  2460. child.font.drawCenteredString(text, positionX + (child.width / 2), y + (child.height / 2)
  2461. + (child.font.baseCharacterHeight / 2), 0xFFFFFF, child.shadeText ? 0 : -1, true);
  2462. y += child.font.baseCharacterHeight + 2;
  2463. }
  2464. }
  2465. } else {
  2466. child.currentHeight++;
  2467. }
  2468. }
  2469. }
  2470. } else if (child.type == 15) {
  2471. drawAltInputField(child, positionX, positionY, child.width, child.height);
  2472. } else if (child.type == 16) {
  2473. drawInputField(child, positionX, positionY, child.width, child.height);
  2474. }
  2475. }
  2476. }
  2477. DrawingArea.setBounds(i1, j1, k1, l1);
  2478. }
  2479.  
  2480. private void refreshBankTabs() {
  2481. if (openInterfaceID != 5292)
  2482. return;
  2483. String last_tab_string = RSInterface.interfaceCache[27000].disabledText;
  2484. if (last_tab_string != null) {
  2485. final int last_tab = Integer.valueOf(last_tab_string);
  2486. int current_tab = currentBankTab;
  2487. for (int tab_index = 22025; tab_index <= 22033; tab_index++) {
  2488. final RSInterface top_tab = RSInterface.interfaceCache[tab_index];
  2489. if (top_tab == null)
  2490. continue;
  2491. final RSInterface tab = RSInterface.interfaceCache[tab_index + 10];
  2492. if (last_tab == 22042 && tab_index == 22032) {
  2493. // top_tab.sprite1 = new RSImage("bank/TAB 4");
  2494. top_tab.sprite1 = RSImageLoader.images[922 + 4];
  2495. top_tab.tooltip = "Collapse All Tabs";
  2496. } else if (tab.id == last_tab) {
  2497. // top_tab.sprite1 = new RSImage("bank/TAB 4");
  2498. top_tab.sprite1 = RSImageLoader.images[922 + 4];
  2499. top_tab.tooltip = "Drag an item here to create a new tab";
  2500. } else if (tab.id < last_tab) {
  2501. // top_tab.sprite1 = new RSImage("bank/TAB 3");
  2502. top_tab.sprite1 = RSImageLoader.images[922 + 3];
  2503. top_tab.tooltip = null;
  2504. tab.actions[0] = "View Content of Tab " + (tab.id - 22034);
  2505. tab.actions[1] = "Collapse Tab " + (tab.id - 22034);
  2506. tab.actions[2] = "Calculate Networth Tab " + (tab.id - 22034);
  2507. } else {
  2508. top_tab.sprite1 = null;
  2509. // top_tab.sprite1 = new RSImage("");
  2510. top_tab.tooltip = "";
  2511. }
  2512.  
  2513. if (current_tab == 0) {
  2514. // RSInterface.interfaceCache[22024].sprite1 = new RSImage("bank/TAB 0");
  2515. RSInterface.interfaceCache[22024].sprite1 = RSImageLoader.images[922 + 0];
  2516. } else {
  2517. // RSInterface.interfaceCache[22024 + current_tab].sprite1 = new RSImage("bank/TAB 2");
  2518. // RSInterface.interfaceCache[22024].sprite1 = new RSImage("bank/TAB 1");
  2519. RSInterface.interfaceCache[22024 + current_tab].sprite1 = RSImageLoader.images[922 + 2];
  2520. RSInterface.interfaceCache[22024].sprite1 = RSImageLoader.images[922 + 1];
  2521. }
  2522. }
  2523. }
  2524. }
  2525.  
  2526. public void drawHoverBox(int xPos, int yPos, String text) {
  2527. String[] results = text.split("\n");
  2528. int height = (results.length * 16) + 6;
  2529. int width;
  2530. width = normalFont.getTextWidth(results[0]) + 6;
  2531. for (int i = 1; i < results.length; i++)
  2532. if (width <= normalFont.getTextWidth(results[i]) + 6)
  2533. width = normalFont.getTextWidth(results[i]) + 6;
  2534. DrawingArea.drawFilledPixels(xPos, yPos, width, height, 0xFFFFA0);
  2535. DrawingArea.drawUnfilledPixels(xPos, yPos, width, height, 0);
  2536. yPos += 14;
  2537. for (int i = 0; i < results.length; i++) {
  2538. normalFont.method389(false, xPos + 3, 0, results[i], yPos);
  2539. yPos += 16;
  2540. }
  2541. }
  2542.  
  2543. private void handlePlayerMasks(int mask, int pid, JagexBuffer in, Player player) {
  2544. if ((mask & 0x400) != 0) {
  2545. player.firstForcedX = in.readUnsignedByteS();
  2546. player.firstForcedY = in.readUnsignedByteS();
  2547. player.secondForcedX = in.readUnsignedByteS();
  2548. player.secondForcedY = in.readUnsignedByteS();
  2549. player.speed = in.readUnsignedShortA() + loopCycle;
  2550. player.reverseSpeed = in.readUnsignedLEShortA() + loopCycle;
  2551. player.direction = in.readUnsignedByteS();
  2552. player.method446();
  2553. }
  2554. if ((mask & 0x100) != 0) {
  2555. int graphic = in.readUnsignedLEShort();
  2556. int data = in.readInt();
  2557. player.graphicsAnimId = graphic;
  2558. player.graphicsHeight = data >> 16;
  2559. player.graphicsDelay = loopCycle + (data & 0xffff);
  2560. player.graphicsAnimFrame = 0;
  2561. player.graphicsAnimCycle = 0;
  2562. if (player.graphicsDelay > loopCycle) {
  2563. player.graphicsAnimFrame = -1;
  2564. }
  2565. if (player.graphicsAnimId == 65535) {
  2566. player.graphicsAnimId = -1;
  2567. }
  2568. }
  2569. if ((mask & 8) != 0) { // send anim
  2570. int anim = in.readUnsignedLEShort();
  2571. if (anim == 65535) {
  2572. anim = -1;
  2573. }
  2574. int delay = in.readUnsignedByteC();
  2575. // if ((player.forcedAnimation != -1 && (anim < 13192 && anim > 13194)) || (player.forcedAnimation >= 13192 && player.forcedAnimation <= 13194)) {
  2576. // } else {
  2577. /*
  2578. * if (anim == player.forcedAnimation && anim != -1) {
  2579. * int i3 = Animation.anims[anim].anInt365;
  2580. * if (i3 == 1) {
  2581. * player.anInt1527 = 0;
  2582. * player.anInt1528 = 0;
  2583. * player.anInt1529 = delay;
  2584. * player.anInt1530 = 0;
  2585. * }
  2586. * if (i3 == 2)
  2587. * player.anInt1530 = 0;
  2588. * } else
  2589. */
  2590. if (anim == -1 || player.forcedAnimId == -1
  2591. || Animation.getAnim(anim).priority >= Animation.getAnim(player.forcedAnimId).priority) {
  2592. player.forcedAnimId = anim;
  2593. player.forcedAnimFrame = 0;
  2594. player.forcedAnimCycle = 0;
  2595. player.animationDelay = delay;
  2596. player.animation_reset_cycle = 0;
  2597. player.anInt1542 = player.pathLength;
  2598. }
  2599. // }
  2600. }
  2601. if ((mask & 4) != 0) {
  2602. player.textSpoken = in.readString();
  2603. String loyalty_title = "";// PlayerTitle.getLoyaltyTitle(player.title) + (player.title >= 0 ? " " : "");
  2604. if (player.textSpoken.charAt(0) == '~') {
  2605. player.textSpoken = player.textSpoken.substring(1);
  2606. pushMessage(player.name, player.textSpoken, 2, loyalty_title, player.showGameModeTitle ? player.gameMode : -1);
  2607. } else if (player == myPlayer) {
  2608. pushMessage(player.name, player.textSpoken, 2, loyalty_title, player.showGameModeTitle ? player.gameMode : -1);
  2609. }
  2610. player.textCycle = 150;
  2611. }
  2612. if ((mask & 0x80) != 0) {
  2613. int i1 = in.readUnsignedLEShort();
  2614. int rights = in.readUnsignedByte();
  2615. int textLength = in.readUnsignedByteC();
  2616. int k3 = in.offset;
  2617. if (player.name != null && player.visible) {
  2618. long l3 = TextUtils.longForName(player.name);
  2619. boolean flag = false;
  2620. if (rights <= 1) {
  2621. for (int i4 = 0; i4 < ignoreCount; i4++) {
  2622. if (ignoreListAsLongs[i4] != l3) {
  2623. continue;
  2624. }
  2625. flag = true;
  2626. break;
  2627. }
  2628.  
  2629. }
  2630. if (!flag && anInt1251 == 0) {
  2631. try {
  2632. aStream_834.offset = 0;
  2633. in.readBytesC(textLength, 0, aStream_834.payload);
  2634. aStream_834.offset = 0;
  2635. String message = TextInput.method525(textLength, aStream_834);
  2636. player.textSpoken = message;
  2637. player.textColor = i1 >> 8;
  2638. player.rights = rights;
  2639. player.textEffect = i1 & 0xff;
  2640. player.textCycle = 150;
  2641. String title = "";// PlayerTitle.getLoyaltyTitle(player.title) + (player.title >= 0 ? " " : "");
  2642. pushMessage(getPrefix(rights) + player.name, message, 2, title, player.showGameModeTitle ? player.gameMode : -1);
  2643. } catch (Exception exception) {
  2644. Signlink.reportError("chat decoding 2");
  2645. }
  2646. }
  2647. }
  2648. in.offset = k3 + textLength;
  2649. }
  2650. if ((mask & 1) != 0) {
  2651. player.interactingEntity = in.readUnsignedLEShort();
  2652. if (player.interactingEntity == 65535) {
  2653. player.interactingEntity = -1;
  2654. }
  2655. }
  2656. if ((mask & 0x10) != 0) {
  2657. int j1 = in.readUnsignedByteC();
  2658. byte abyte0[] = new byte[j1];
  2659. JagexBuffer stream_1 = new JagexBuffer(abyte0);
  2660. in.readBytes(j1, 0, abyte0);
  2661. aStreamArray895s[pid] = stream_1;
  2662. player.updatePlayer(stream_1);
  2663. }
  2664. if ((mask & 2) != 0) {
  2665. player.faceX = in.readUnsignedShortA();
  2666. player.faceY = in.readUnsignedLEShort();
  2667. }
  2668. if ((mask & 0x20) != 0) {
  2669. int damage = in.readLEShort();
  2670. int absorbed = in.readLEShort();
  2671. int combatStyle = in.readSignedByte();
  2672. int hitMark = in.readByteS();
  2673. player.updateHitData(Content.getVersion(Content.HITSPLAT) > 562 ? combatStyle : -1, hitMark, damage, absorbed, loopCycle);
  2674. player.loopCycleStatus = loopCycle + 300;
  2675. player.currentHealth = in.readUnsignedShort();
  2676. player.maxHealth = in.readUnsignedShort();
  2677. }
  2678. if ((mask & 0x200) != 0) {
  2679. int damage = in.readLEShort();
  2680. int absorbed = in.readLEShortA();
  2681. int combatStyle = in.readSignedByte();
  2682. int hitMark = in.readByteS();
  2683. player.updateHitData(Content.getVersion(Content.HITSPLAT) > 562 ? combatStyle : -1, hitMark, damage, absorbed, loopCycle);
  2684. player.loopCycleStatus = loopCycle + 300;
  2685. player.currentHealth = in.readUnsignedShort();
  2686. player.maxHealth = in.readUnsignedShort();
  2687. }
  2688. }
  2689.  
  2690. private void method108() {
  2691. try {
  2692. int j = myPlayer.currentX + cameraOffsetX;
  2693. int k = myPlayer.currentY + cameraOffsetY;
  2694. if (anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500) {
  2695. anInt1014 = j;
  2696. anInt1015 = k;
  2697. }
  2698. if (anInt1014 != j) {
  2699. anInt1014 += (j - anInt1014) / 16;
  2700. }
  2701. if (anInt1015 != k) {
  2702. anInt1015 += (k - anInt1015) / 16;
  2703. }
  2704. int divider = isFixed() ? 2 : 1;
  2705. if (super.keyArray[1] == 1) {
  2706. // camera left movement
  2707. cameraXYRotation += (-20 - cameraXYRotation) / divider;
  2708. cameraRotationFrames++;
  2709. } else if (super.keyArray[2] == 1) {
  2710. // camera right movement
  2711. cameraXYRotation += (20 - cameraXYRotation) / divider;
  2712. cameraRotationFrames++;
  2713. } else {
  2714. if (cameraRotationFrames >= 15 && currentAccount != null && GameSettings.CAMERA_GLIDE.toggled()) {
  2715. if (cameraXYRotation > 0)
  2716. cameraXYRotation--;
  2717. else if (cameraXYRotation < 0)
  2718. cameraXYRotation++;
  2719. } else {
  2720. cameraXYRotation /= 2;
  2721. }
  2722. }
  2723. if (super.keyArray[3] == 1) {
  2724. // camera up movement
  2725. cameraZRotation += (12 - cameraZRotation) / divider;
  2726. cameraRotationFrames++;
  2727. } else if (super.keyArray[4] == 1) {
  2728. // camera down movement
  2729. cameraZRotation += (-12 - cameraZRotation) / divider;
  2730. cameraRotationFrames++;
  2731. } else {
  2732. if (cameraRotationFrames >= 15 && currentAccount != null && GameSettings.CAMERA_GLIDE.toggled()) {
  2733. if (cameraZRotation > 0)
  2734. cameraZRotation--;
  2735. else if (cameraZRotation < 0)
  2736. cameraZRotation++;
  2737. } else {
  2738. cameraZRotation /= 2;
  2739. }
  2740. }
  2741. if (cameraZRotation == 0 && cameraXYRotation == 0)
  2742. cameraRotationFrames = 0;
  2743. viewRotation = viewRotation + cameraXYRotation / 2 & 0x7ff;
  2744. anInt1184 += cameraZRotation / 2;
  2745. if (anInt1184 < 128) {
  2746. anInt1184 = 128;
  2747. }
  2748. if (anInt1184 > 383) {
  2749. anInt1184 = 383;
  2750. }
  2751. int l = anInt1014 >> 7;
  2752. int i1 = anInt1015 >> 7;
  2753. int j1 = method42(plane, anInt1015, anInt1014);
  2754. int k1 = 0;
  2755. if (l > 3 && i1 > 3 && l < 100 && i1 < 100) {
  2756. for (int l1 = l - 4; l1 <= l + 4; l1++) {
  2757. for (int k2 = i1 - 4; k2 <= i1 + 4; k2++) {
  2758. int l2 = plane;
  2759. if (l2 < 3 && (groundTileSettings[1][l1][k2] & 2) == 2) {
  2760. l2++;
  2761. }
  2762. int i3 = j1 - heightMap[l2][l1][k2];
  2763. if (i3 > k1) {
  2764. k1 = i3;
  2765. }
  2766. }
  2767.  
  2768. }
  2769.  
  2770. }
  2771. anInt1005++;
  2772. if (anInt1005 > 1512) {
  2773. anInt1005 = 0;
  2774. outgoingPacket.createFrame(77);
  2775. outgoingPacket.writeByte(0);
  2776. int i2 = outgoingPacket.offset;
  2777. outgoingPacket.writeByte((int) (Math.random() * 256D));
  2778. outgoingPacket.writeByte(101);
  2779. outgoingPacket.writeByte(233);
  2780. outgoingPacket.writeShort(45092);
  2781. if ((int) (Math.random() * 2D) == 0) {
  2782. outgoingPacket.writeShort(35784);
  2783. }
  2784. outgoingPacket.writeByte((int) (Math.random() * 256D));
  2785. outgoingPacket.writeByte(64);
  2786. outgoingPacket.writeByte(38);
  2787. outgoingPacket.writeShort((int) (Math.random() * 65536D));
  2788. outgoingPacket.writeShort((int) (Math.random() * 65536D));
  2789. outgoingPacket.writeSizeByte(outgoingPacket.offset - i2);
  2790. }
  2791. int j2 = k1 * 192;
  2792. if (j2 > 0x17f00) {
  2793. j2 = 0x17f00;
  2794. }
  2795. if (j2 < 32768) {
  2796. j2 = 32768;
  2797. }
  2798. if (j2 > anInt984) {
  2799. anInt984 += (j2 - anInt984) / 24;
  2800. return;
  2801. }
  2802. if (j2 < anInt984) {
  2803. anInt984 += (j2 - anInt984) / 80;
  2804. }
  2805. } catch (Exception _ex) {
  2806. Signlink.reportError("glfc_ex " + myPlayer.currentX + "," + myPlayer.currentY + "," + anInt1014 + "," + anInt1015 + ","
  2807. + localX + "," + localY + "," + baseX + "," + baseY);
  2808. throw new RuntimeException("eek");
  2809. }
  2810. }
  2811.  
  2812. public void processDrawing() {
  2813. if (!super.ready) {
  2814. // showSelectionScreen();
  2815. super.ready = true;
  2816. Content.load();
  2817. startUp();
  2818. return;
  2819. }
  2820. if (rsAlreadyLoaded || loadingError || genericLoadingError) {
  2821. showErrorScreen();
  2822. return;
  2823. }
  2824. anInt1061++;
  2825. if (!loggedIn && loaded && !cacheDownloading) {
  2826. displayTitleScreen(false);
  2827. } else {
  2828. drawGameScreen();
  2829. }
  2830. anInt1213 = 0;
  2831. }
  2832.  
  2833. public boolean isFriendOrSelf(String s) {
  2834. if (s == null) {
  2835. return false;
  2836. }
  2837. for (int i = 0; i < friendsCount; i++) {
  2838. if (s.equalsIgnoreCase(friendsList[i])) {
  2839. return true;
  2840. }
  2841. }
  2842. return s.equalsIgnoreCase(myPlayer.name);
  2843. }
  2844.  
  2845. private static String combatDiffColor(int i, int j) {
  2846. int k = i - j;
  2847. if (k < -9) {
  2848. return "@red@";
  2849. }
  2850. if (k < -6) {
  2851. return "@or3@";
  2852. }
  2853. if (k < -3) {
  2854. return "@or2@";
  2855. }
  2856. if (k < 0) {
  2857. return "@or1@";
  2858. }
  2859. if (k > 9) {
  2860. return "@gre@";
  2861. }
  2862. if (k > 6) {
  2863. return "@gr3@";
  2864. }
  2865. if (k > 3) {
  2866. return "@gr2@";
  2867. }
  2868. if (k > 0) {
  2869. return "@gr1@";
  2870. } else {
  2871. return "@yel@";
  2872. }
  2873. }
  2874.  
  2875. private void setWaveVolume(int i) {
  2876. Signlink.wavevol = i;
  2877. }
  2878.  
  2879. public void DrawStaffPanal() {
  2880. if(isServerSupport()){
  2881. ServerSupport.draw(this);
  2882. }
  2883. }
  2884.  
  2885. private void draw3dScreen() {
  2886. DrawStaffPanal();
  2887. drawSplitPrivateChat();
  2888. if (crossType == 1) {
  2889. crosses[crossIndex / 100].drawImage(crossX - 8 - 4, crossY - 8 - 4);
  2890. anInt1142++;
  2891. if (anInt1142 > 67) {
  2892. anInt1142 = 0;
  2893. outgoingPacket.createFrame(78);
  2894. }
  2895. }
  2896. if (crossType == 2) {
  2897. crosses[4 + crossIndex / 100].drawImage(crossX - 8 - 4, crossY - 8 - 4);
  2898. }
  2899.  
  2900. if (walkableInterface >= 0 && walkableInterface < RSInterface.interfaceCache.length) {
  2901. method119(anInt945, walkableInterface);
  2902. if (walkableInterface == 197 && !isFixed()) {
  2903. cacheSprite[98].drawImage(clientWidth - 260, 2);
  2904. String text = RSInterface.interfaceCache[199].disabledText.replace("@yel@", "");
  2905. newRegularFont.drawCenteredString(text, clientWidth - 243, 46, 0xE1981D, 0);
  2906. } else if (walkableInterface == 1600 && !isFixed()) {
  2907. drawInterface(-(clientWidth / 2) + 50, -(clientHeight / 2) + 50, 0, RSInterface.interfaceCache[walkableInterface]);
  2908. } else if (walkableInterface == 23133 && !isFixed()) {
  2909. drawInterface(clientWidth / 2 - 256, 0, 0, RSInterface.interfaceCache[walkableInterface]);
  2910. } else {
  2911. if (isFixed()) {
  2912. drawInterface(0, 0, 0, RSInterface.interfaceCache[walkableInterface]);
  2913. } else {
  2914. if (clientWidth >= 900 && clientHeight >= 650) {
  2915. drawInterface((clientWidth / 2) - 256, (clientHeight / 2) - 167, 0, RSInterface.interfaceCache[walkableInterface]);
  2916. } else {
  2917. drawInterface(0, 0, 0, RSInterface.interfaceCache[walkableInterface]);
  2918. }
  2919. }
  2920. }
  2921. }
  2922. if (openInterfaceID != -1) {
  2923. method119(anInt945, openInterfaceID);
  2924. if (isFixed()) {
  2925. drawInterface(0, 0, 0, RSInterface.interfaceCache[openInterfaceID]);
  2926. } else {
  2927. if (openInterfaceID == 23133 && !isFixed()) {
  2928. drawInterface(clientWidth / 2 - 256, 0, 0, RSInterface.interfaceCache[openInterfaceID]);
  2929. } else {
  2930. if (clientWidth >= 900 && clientHeight >= 650) {
  2931. drawInterface((clientWidth / 2) - 256, (clientHeight / 2) - 167, 0, RSInterface.interfaceCache[openInterfaceID]);
  2932. } else {
  2933. drawInterface(0, 0, 0, RSInterface.interfaceCache[openInterfaceID]);
  2934. }
  2935. }
  2936. }
  2937. }
  2938. if (multiIcon == 1) {
  2939. if (isFixed()) {
  2940. multiZone.drawImage(472, 296);
  2941. } else {
  2942. cacheSprite[99].drawImage(clientWidth - 40, 171);
  2943. }
  2944. }
  2945. method70();
  2946. if (!menuOpen) {
  2947. processRightClick();
  2948. drawTooltip();
  2949. } else if (menuScreenArea == 0)
  2950. drawMenu();
  2951. if (fpsOn) {
  2952. char c = '\u01FB';
  2953. int k = 20;
  2954. int i1 = 0xffff00;
  2955. if (super.fps < 15) {
  2956. i1 = 0xff0000;
  2957. }
  2958. normalFont.method380("Fps:" + super.fps, c, i1, k);
  2959. k += 15;
  2960. Runtime runtime = Runtime.getRuntime();
  2961. int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  2962. i1 = 0xffff00;
  2963. if (j1 > 0x2000000 && lowMemory) {
  2964. i1 = 0xff0000;
  2965. }
  2966. normalFont.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  2967. k += 15;
  2968. }
  2969. playerX = baseX + (myPlayer.currentX - 6 >> 7);
  2970. playerY = baseY + (myPlayer.currentY - 6 >> 7);
  2971. if (clientData) {
  2972. int yPosition = clientSize == 0 ? !isAdministrator() ? 285 : 225 : 40;
  2973. final int textColor = 0xffffff;
  2974.  
  2975. final Runtime runtime = Runtime.getRuntime();
  2976. final int memoryUsage = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  2977.  
  2978. normalFont.method385(super.fps < 15 ? 0xff0000 : textColor, "FPS: " + super.fps, yPosition, 5);
  2979. yPosition += 15;
  2980.  
  2981. normalFont.method385(memoryUsage > 0x2000000 && lowMemory ? 0xff0000 : textColor, "Memory usage: " + (memoryUsage / 1000)
  2982. + "mb", yPosition, 5);
  2983. yPosition += 15;
  2984.  
  2985. if (isAdministrator()) {
  2986. normalFont.method385(textColor, "Mouse: " + super.getMouseX() + ", " + super.getMouseY(), yPosition, 5);
  2987. yPosition += 15;
  2988. }
  2989.  
  2990. normalFont.method385(textColor, "Position: " + playerX + ", " + playerY, yPosition, 5);
  2991. yPosition += 15;
  2992.  
  2993. if (isAdministrator()) {
  2994. normalFont.method385(textColor, "Local: " + localX + ", " + localY, yPosition, 5);
  2995. yPosition += 15;
  2996.  
  2997. int regionId = getRegionId();
  2998. int regionIndex = onDemandFetcher.getRegionIndex(regionId);
  2999. normalFont.method385(textColor, "Region Id: " + regionId + ", " + regionIndex, yPosition, 5);
  3000. yPosition += 15;
  3001.  
  3002. normalFont
  3003. .method385(
  3004. textColor,
  3005. "Terrain, Landscape: "
  3006. + (regionIndex >= 0 ? (onDemandFetcher.mapTerrains[regionIndex] + ", " + onDemandFetcher.mapLandscapes[regionIndex])
  3007. : "-1"), yPosition, 5);
  3008. yPosition += 15;
  3009. }
  3010.  
  3011. normalFont.method385(textColor, "Local Players: " + playerCount, yPosition, 5);
  3012. }
  3013. if (updateTimer != 0) {
  3014. int seconds = updateTimer / 50;
  3015. int minutes = seconds / 60;
  3016. seconds %= 60;
  3017. if (Settings.UPDATE) {
  3018. if (seconds < 10) {
  3019. normalFont.method385(0xffff00, "Lost Dynasty will update in: " + minutes + ":0" + seconds, 329, 4);
  3020. } else {
  3021. normalFont.method385(0xffff00, "Lost Dynasty will update in: " + minutes + ":" + seconds, 329, 4);
  3022. }
  3023. } else if (Settings.RESTART) {
  3024. if (seconds < 10) {
  3025. normalFont.method385(0xffff00, "Lost Dynasty will have a system restart in: " + minutes + ":0" + seconds, 329, 4);
  3026. } else {
  3027. normalFont.method385(0xffff00, "Lost Dynasty will have a system restart in: " + minutes + ":" + seconds, 329, 4);
  3028. }
  3029. }
  3030. anInt849++;
  3031. if (anInt849 > 75) {
  3032. anInt849 = 0;
  3033. // outgoingPacket.createFrame(148);
  3034. }
  3035. }
  3036. if (restartTimer != 0) {
  3037. int seconds = restartTimer / 50;
  3038. int minutes = seconds / 60;
  3039. seconds %= 60;
  3040. if (seconds < 10) {
  3041. normalFont.method385(0xffff00, "Lost Dynasty will restart in: " + minutes + ":0" + seconds, 329, 4);
  3042. } else {
  3043. normalFont.method385(0xffff00, "Lost Dynasty will restart in: " + minutes + ":" + seconds, 329, 4);
  3044. }
  3045. anInt849++;
  3046. if (anInt849 > 75) {
  3047. anInt849 = 0;
  3048. // outgoingPacket.createFrame(148);
  3049. }
  3050. }
  3051. }
  3052.  
  3053. private void addIgnore(long l) {
  3054. try {
  3055. if (l == 0L) {
  3056. return;
  3057. }
  3058. if (ignoreCount >= 100) {
  3059. pushMessage("", "Your ignore list has reached it's maximum of 100.", 0, "", -1);
  3060. return;
  3061. }
  3062. String s = TextUtils.fixName(TextUtils.nameForLong(l));
  3063. for (int j = 0; j < ignoreCount; j++) {
  3064. if (ignoreListAsLongs[j] == l) {
  3065. pushMessage("", s + " is already on your ignore list!", 0, "", -1);
  3066. return;
  3067. }
  3068. }
  3069. for (int k = 0; k < friendsCount; k++) {
  3070. if (friendsListAsLongs[k] == l) {
  3071. pushMessage("", "Please remove " + s + " from your friend list first.", 0, "", -1);
  3072. return;
  3073. }
  3074. }
  3075.  
  3076. ignoreListAsLongs[ignoreCount++] = l;
  3077. redrawTabArea = true;
  3078. outgoingPacket.createFrame(133);
  3079. outgoingPacket.writeLong(l);
  3080. return;
  3081. } catch (RuntimeException runtimeexception) {
  3082. Signlink.reportError("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  3083. }
  3084. throw new RuntimeException();
  3085. }
  3086.  
  3087. private void method114() {
  3088. for (int i = -1; i < playerCount; i++) {
  3089. int j;
  3090. if (i == -1) {
  3091. j = myPlayerIndex;
  3092. } else {
  3093. j = playerIndices[i];
  3094. }
  3095. Player player = players[j];
  3096. if (player != null) {
  3097. method96(player);
  3098. }
  3099. }
  3100.  
  3101. }
  3102.  
  3103. private void method115() {
  3104. if (loadingStage == 2) {
  3105. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179.head(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  3106. .next()) {
  3107. if (class30_sub1.anInt1294 > 0) {
  3108. class30_sub1.anInt1294--;
  3109. }
  3110. if (class30_sub1.anInt1294 == 0) {
  3111. if (class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301)) {
  3112. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301,
  3113. class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  3114. class30_sub1.remove();
  3115. }
  3116. } else {
  3117. if (class30_sub1.anInt1302 > 0) {
  3118. class30_sub1.anInt1302--;
  3119. }
  3120. if (class30_sub1.anInt1302 == 0 && class30_sub1.anInt1297 >= 1 && class30_sub1.anInt1298 >= 1
  3121. && class30_sub1.anInt1297 <= 102 && class30_sub1.anInt1298 <= 102
  3122. && (class30_sub1.anInt1291 < 0 || ObjectManager.method178(class30_sub1.anInt1291, class30_sub1.anInt1293))) {
  3123. method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293,
  3124. class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  3125. class30_sub1.anInt1302 = -1;
  3126. if (class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1) {
  3127. class30_sub1.remove();
  3128. } else if (class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300
  3129. && class30_sub1.anInt1293 == class30_sub1.anInt1301) {
  3130. class30_sub1.remove();
  3131. }
  3132. }
  3133. }
  3134. }
  3135.  
  3136. }
  3137. }
  3138.  
  3139. private void determineMenuSize() {
  3140. int i = boldFont.getTextWidth("Choose Option");
  3141. for (int j = 0; j < menuActionRow; j++) {
  3142. int k = boldFont.getTextWidth(menuActionName[j]);
  3143. if (k > i)
  3144. i = k;
  3145. }
  3146. i += 8;
  3147. int l = 15 * menuActionRow + 21;
  3148. if (clientSize == 0) {
  3149. if (super.saveClickX > 4 && super.saveClickY > 4 && super.saveClickX < 516 && super.saveClickY < 338) {
  3150. int i1 = super.saveClickX - 4 - i / 2;
  3151. if (i1 + i > 512)
  3152. i1 = 512 - i;
  3153. if (i1 < 0)
  3154. i1 = 0;
  3155. int l1 = super.saveClickY - 4;
  3156. if (l1 + l > 334)
  3157. l1 = 334 - l;
  3158. if (l1 < 0)
  3159. l1 = 0;
  3160. menuOpen = true;
  3161. menuScreenArea = 0;
  3162. menuOffsetX = i1;
  3163. menuOffsetY = l1;
  3164. menuWidth = i;
  3165. menuHeight = 15 * menuActionRow + 22;
  3166. }
  3167. if (super.saveClickX > 519 && super.saveClickY > 168 && super.saveClickX < 765 && super.saveClickY < 503) {
  3168. int j1 = super.saveClickX - 519 - i / 2;
  3169. if (j1 < 0)
  3170. j1 = 0;
  3171. else if (j1 + i > 245)
  3172. j1 = 245 - i;
  3173. int i2 = super.saveClickY - 168;
  3174. if (i2 < 0)
  3175. i2 = 0;
  3176. else if (i2 + l > 333)
  3177. i2 = 333 - l;
  3178. menuOpen = true;
  3179. menuScreenArea = 1;
  3180. menuOffsetX = j1;
  3181. menuOffsetY = i2;
  3182. menuWidth = i;
  3183. menuHeight = 15 * menuActionRow + 22;
  3184. }
  3185. if (super.saveClickX > 0 && super.saveClickY > 338 && super.saveClickX < 516 && super.saveClickY < 503) {
  3186. int k1 = super.saveClickX - 0 - i / 2;
  3187. if (k1 < 0)
  3188. k1 = 0;
  3189. else if (k1 + i > 516)
  3190. k1 = 516 - i;
  3191. int j2 = super.saveClickY - 338;
  3192. if (j2 < 0)
  3193. j2 = 0;
  3194. else if (j2 + l > 165)
  3195. j2 = 165 - l;
  3196. menuOpen = true;
  3197. menuScreenArea = 2;
  3198. menuOffsetX = k1;
  3199. menuOffsetY = j2;
  3200. menuWidth = i;
  3201. menuHeight = 15 * menuActionRow + 22;
  3202. }
  3203. if (super.saveClickX > 519 && super.saveClickY > 0 && super.saveClickX < 765 && super.saveClickY < 168) {
  3204. int j1 = super.saveClickX - 519 - i / 2;
  3205. if (j1 < 0)
  3206. j1 = 0;
  3207. else if (j1 + i > 245)
  3208. j1 = 245 - i;
  3209. int i2 = super.saveClickY - 0;
  3210. if (i2 < 0)
  3211. i2 = 0;
  3212. else if (i2 + l > 168)
  3213. i2 = 168 - l;
  3214. menuOpen = true;
  3215. menuScreenArea = 3;
  3216. menuOffsetX = j1;
  3217. menuOffsetY = i2;
  3218. menuWidth = i;
  3219. menuHeight = 15 * menuActionRow + 22;
  3220. }
  3221. } else {
  3222. if (super.saveClickX > 0 && super.saveClickY > 0 && super.saveClickX < clientWidth
  3223. && super.saveClickY < clientHeight) {
  3224. int i1 = super.saveClickX - 0 - i / 2;
  3225. if (i1 + i > clientWidth)
  3226. i1 = clientWidth - i;
  3227. if (i1 < 0)
  3228. i1 = 0;
  3229. int l1 = super.saveClickY - 0;
  3230. if (l1 + l > clientHeight)
  3231. l1 = clientHeight - l;
  3232. if (l1 < 0)
  3233. l1 = 0;
  3234. menuOpen = true;
  3235. menuScreenArea = 0;
  3236. menuOffsetX = i1;
  3237. menuOffsetY = l1;
  3238. menuWidth = i;
  3239. menuHeight = 15 * menuActionRow + 22;
  3240. }
  3241. }
  3242. if (menuOpen) {
  3243. menuOpenTime = System.currentTimeMillis();
  3244. contextWidth = 0;
  3245. contextHeight = 0;
  3246. }
  3247. }
  3248.  
  3249. private int contextWidth;
  3250. private int contextHeight;
  3251. private long menuOpenTime = -1;
  3252.  
  3253.  
  3254. private void updateClientMovement(JagexBuffer stream) {
  3255. stream.initBitAccess();
  3256. int j = stream.getBits(1);
  3257. if (j == 0) {
  3258. return;
  3259. }
  3260. int updateType = stream.getBits(2);
  3261. if (updateType == 0) {
  3262. localPlayers[localPlayersIndex++] = myPlayerIndex;
  3263. return;
  3264. }
  3265. if (updateType == 1) {
  3266. int l = stream.getBits(3);
  3267. myPlayer.move(false, l);
  3268. int k1 = stream.getBits(1);
  3269. if (k1 == 1) {
  3270. localPlayers[localPlayersIndex++] = myPlayerIndex;
  3271. }
  3272. return;
  3273. }
  3274. if (updateType == 2) {
  3275. int i1 = stream.getBits(3);
  3276. myPlayer.move(true, i1);
  3277. int l1 = stream.getBits(3);
  3278. myPlayer.move(true, l1);
  3279. int j2 = stream.getBits(1);
  3280. if (j2 == 1) {
  3281. localPlayers[localPlayersIndex++] = myPlayerIndex;
  3282. }
  3283. return;
  3284. }
  3285. if (updateType == 3) {
  3286. plane = stream.getBits(2);
  3287. int teleport = stream.getBits(1);
  3288. int update = stream.getBits(1);
  3289. if (update == 1) {
  3290. localPlayers[localPlayersIndex++] = myPlayerIndex;
  3291. }
  3292. int localY = stream.getBits(7);
  3293. int localX = stream.getBits(7);
  3294. myPlayer.setPos(localX, localY, teleport == 1);
  3295. }
  3296. }
  3297.  
  3298. private void nullLoader() {
  3299. aBoolean831 = false;
  3300. while (drawingFlames) {
  3301. aBoolean831 = false;
  3302. try {
  3303. Thread.sleep(50L);
  3304. } catch (Exception _ex) {
  3305. }
  3306. }
  3307. }
  3308.  
  3309. private boolean method119(int i, int id) {
  3310. boolean flag1 = false;
  3311. if (id < 0 || id >= RSInterface.interfaceCache.length) {
  3312. return false;
  3313. }
  3314. RSInterface rsi = RSInterface.interfaceCache[id];
  3315. if (rsi == null || rsi.children == null) {
  3316. return false;
  3317. }
  3318. for (int index = 0; index < rsi.children.length; index++) {
  3319. if (rsi.children[index] == -1) {
  3320. break;
  3321. }
  3322. RSInterface child = RSInterface.interfaceCache[rsi.children[index]];
  3323. if (child.type == 1) {
  3324. flag1 |= method119(i, child.id);
  3325. }
  3326. if (child.type == 6 && (child.disabledMediaAnimation != -1 || child.enabledMediaAnimation != -1)) {
  3327. boolean flag2 = interfaceIsSelected(child);
  3328. int l;
  3329. if (flag2) {
  3330. l = child.enabledMediaAnimation;
  3331. } else {
  3332. l = child.disabledMediaAnimation;
  3333. }
  3334. if (l != -1) {
  3335. Animation animation = Animation.getAnim(l);
  3336. for (child.anInt208 += i; child.anInt208 > animation.getDelay(child.anInt246);) {
  3337. child.anInt208 -= animation.getDelay(child.anInt246) + 1;
  3338. child.anInt246++;
  3339. if (child.anInt246 >= animation.frameCount) {
  3340. child.anInt246 -= animation.loopDelay;
  3341. if (child.anInt246 < 0 || child.anInt246 >= animation.frameCount) {
  3342. child.anInt246 = 0;
  3343. }
  3344. }
  3345. flag1 = true;
  3346. }
  3347.  
  3348. }
  3349. }
  3350. }
  3351.  
  3352. return flag1;
  3353. }
  3354.  
  3355. private int method120() {
  3356. if (GameSettings.Roofs_Off.toggled())
  3357. return plane;
  3358. int j = 3;
  3359. if (yCameraCurve < 310) {
  3360. int k = xCameraPos >> 7;
  3361. int l = yCameraPos >> 7;
  3362. int i1 = myPlayer.currentX >> 7;
  3363. int j1 = myPlayer.currentY >> 7;
  3364. if ((groundTileSettings[plane][k][l] & 4) != 0) {
  3365. j = plane;
  3366. }
  3367. int k1;
  3368. if (i1 > k) {
  3369. k1 = i1 - k;
  3370. } else {
  3371. k1 = k - i1;
  3372. }
  3373. int l1;
  3374. if (j1 > l) {
  3375. l1 = j1 - l;
  3376. } else {
  3377. l1 = l - j1;
  3378. }
  3379. if (k1 > l1) {
  3380. int i2 = (l1 * 0x10000) / k1;
  3381. int k2 = 32768;
  3382. while (k != i1) {
  3383. if (k < i1) {
  3384. k++;
  3385. } else if (k > i1) {
  3386. k--;
  3387. }
  3388. if ((groundTileSettings[plane][k][l] & 4) != 0) {
  3389. j = plane;
  3390. }
  3391. k2 += i2;
  3392. if (k2 >= 0x10000) {
  3393. k2 -= 0x10000;
  3394. if (l < j1) {
  3395. l++;
  3396. } else if (l > j1) {
  3397. l--;
  3398. }
  3399. if ((groundTileSettings[plane][k][l] & 4) != 0) {
  3400. j = plane;
  3401. }
  3402. }
  3403. }
  3404. } else {
  3405. int j2 = (k1 * 0x10000) / l1;
  3406. int l2 = 32768;
  3407. while (l != j1) {
  3408. if (l < j1) {
  3409. l++;
  3410. } else if (l > j1) {
  3411. l--;
  3412. }
  3413. if ((groundTileSettings[plane][k][l] & 4) != 0) {
  3414. j = plane;
  3415. }
  3416. l2 += j2;
  3417. if (l2 >= 0x10000) {
  3418. l2 -= 0x10000;
  3419. if (k < i1) {
  3420. k++;
  3421. } else if (k > i1) {
  3422. k--;
  3423. }
  3424. if ((groundTileSettings[plane][k][l] & 4) != 0) {
  3425. j = plane;
  3426. }
  3427. }
  3428. }
  3429. }
  3430. }
  3431. if ((groundTileSettings[plane][myPlayer.currentX >> 7][myPlayer.currentY >> 7] & 4) != 0) {
  3432. j = plane;
  3433. }
  3434. return j;
  3435. }
  3436.  
  3437. private int method121() {
  3438. if (GameSettings.Roofs_Off.toggled())
  3439. return plane;
  3440. int j = method42(plane, yCameraPos, xCameraPos);
  3441. if (j - zCameraPos < 800 && (groundTileSettings[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0) {
  3442. return plane;
  3443. } else {
  3444. return 3;
  3445. }
  3446. }
  3447.  
  3448. private void delIgnore(long l) {
  3449. try {
  3450. if (l == 0L) {
  3451. return;
  3452. }
  3453. for (int j = 0; j < ignoreCount; j++) {
  3454. if (ignoreListAsLongs[j] == l) {
  3455. ignoreCount--;
  3456. redrawTabArea = true;
  3457. System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  3458. outgoingPacket.createFrame(74);
  3459. outgoingPacket.writeLong(l);
  3460. return;
  3461. }
  3462. }
  3463.  
  3464. return;
  3465. } catch (RuntimeException runtimeexception) {
  3466. Signlink.reportError("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  3467. }
  3468. throw new RuntimeException();
  3469. }
  3470.  
  3471. public void sendString(int identifier, String text) {
  3472. text = identifier + "," + text;
  3473. outgoingPacket.createFrame(127);
  3474. outgoingPacket.writeByte(text.length() + 1);
  3475. outgoingPacket.writeString(text);
  3476. }
  3477.  
  3478. private void searchBank(long search) {
  3479. try {
  3480. if (search == 0L) {
  3481. return;
  3482. }
  3483. if (variousSettings[799] == 0) {
  3484. search = TextUtils.longForName("reset");
  3485. }
  3486. outgoingPacket.createFrame(62);
  3487. outgoingPacket.writeLong(search);
  3488. return;
  3489. } catch (Exception e) {
  3490. e.printStackTrace();
  3491. }
  3492. }
  3493.  
  3494. public String getParameter(String s) {
  3495. if (Signlink.mainapp != null) {
  3496. return Signlink.mainapp.getParameter(s);
  3497. } else {
  3498. return super.getParameter(s);
  3499. }
  3500. }
  3501.  
  3502. private void adjustVolume(boolean updateMidi, int volume) {
  3503. if (getCurrentAccount() != null) {
  3504. getCurrentAccount().musicVolume = volume;
  3505. //AccountHandler.save();
  3506. }
  3507. Signlink.setVolume(volume);
  3508. if (updateMidi) {
  3509. Signlink.midi = "voladjust";
  3510. }
  3511. }
  3512.  
  3513. private int extractInterfaceValues(RSInterface rsi, int j) {
  3514. if (rsi.valueConditionType == null || j >= rsi.valueConditionType.length) {
  3515. return -2;
  3516. }
  3517. try {
  3518. int valueArray[] = rsi.valueConditionType[j];
  3519. int k = 0;
  3520. int l = 0;
  3521. int i1 = 0;
  3522. do {
  3523. int val = valueArray[l++];
  3524. int k1 = 0;
  3525. byte byte0 = 0;
  3526. if (val == 0) {
  3527. return k;
  3528. }
  3529.  
  3530. if (val == 1) {
  3531. int index = l++;
  3532. k1 = currentLevel[valueArray[index]];
  3533. if (!GameSettings.X_10.toggled() || rsi.parentId != 22653) {
  3534. if (valueArray[index] == 5 || valueArray[index] == 3)
  3535. k1 = (int) (k1 / 10);
  3536. }
  3537. }
  3538. if (val == 2) {
  3539. int index = l++;
  3540. int level = maxLevel[valueArray[index]];
  3541. if (!GameSettings.X_10.toggled() || rsi.parentId != 22653) {
  3542. if (valueArray[index] == 5 || valueArray[index] == 3)
  3543. level = (int) (level / 10);
  3544. }
  3545. k1 = level;
  3546. }
  3547. if (val == 3) {
  3548. k1 = currentExperience[valueArray[l++]];
  3549. }
  3550. if (val == 4) {
  3551. RSInterface rsi_1 = RSInterface.interfaceCache[valueArray[l++]];
  3552. int k2 = valueArray[l++];
  3553. if (k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.getDef(k2).membersItem || isMembers)) {
  3554. for (int j3 = 0; j3 < rsi_1.inventory.length; j3++) {
  3555. if (rsi_1.inventory[j3] == k2 + 1) {
  3556. k1 += rsi_1.inventoryAmount[j3];
  3557. }
  3558. }
  3559.  
  3560. }
  3561. }
  3562. if (val == 5) {
  3563. k1 = variousSettings[valueArray[l++]];
  3564. }
  3565. if (val == 6) {
  3566. k1 = anIntArray1019[maxLevel[valueArray[l++]] - 1];
  3567. }
  3568. if (val == 7) {
  3569. k1 = (variousSettings[valueArray[l++]] * 100) / 46875;
  3570. }
  3571. if (val == 8) {
  3572. k1 = myPlayer.combatLevel;
  3573. }
  3574. if (val == 9) {
  3575. for (int l1 = 0; l1 < SkillConstants.skillsCount; l1++) {
  3576. if (SkillConstants.skillEnabled[l1]) {
  3577. k1 += maxLevel[l1];
  3578. }
  3579. }
  3580. }
  3581. if (val == 10) {
  3582. RSInterface class9_2 = RSInterface.interfaceCache[valueArray[l++]];
  3583. int l2 = valueArray[l++] + 1;
  3584. if (l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.getDef(l2).membersItem || isMembers)) {
  3585. for (int k3 = 0; k3 < class9_2.inventory.length; k3++) {
  3586. if (class9_2.inventory[k3] != l2) {
  3587. continue;
  3588. }
  3589. k1 = 0x3b9ac9ff;
  3590. break;
  3591. }
  3592.  
  3593. }
  3594. }
  3595. if (val == 11) {
  3596. k1 = energy;
  3597. }
  3598. if (val == 12) {
  3599. k1 = weight;
  3600. }
  3601. if (val == 13) {
  3602. int i2 = variousSettings[valueArray[l++]];
  3603. int i3 = valueArray[l++];
  3604. k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  3605. }
  3606. if (val == 14) {
  3607. int j2 = valueArray[l++];
  3608. VarBit varBit = VarBit.cache[j2];
  3609. int l3 = varBit.configId;
  3610. int i4 = varBit.leastSignificantBit;
  3611. int j4 = varBit.mostSignificantBit;
  3612. int k4 = anIntArray1232[j4 - i4];
  3613. k1 = variousSettings[l3] >> i4 & k4;
  3614. }
  3615. if (val == 15) {
  3616. byte0 = 1;
  3617. }
  3618. if (val == 16) {
  3619. byte0 = 2;
  3620. }
  3621. if (val == 17) {
  3622. byte0 = 3;
  3623. }
  3624. if (val == 18) {
  3625. k1 = (myPlayer.currentX >> 7) + baseX;
  3626. }
  3627. if (val == 19) {
  3628. k1 = (myPlayer.currentY >> 7) + baseY;
  3629. }
  3630. if (val == 20) {
  3631. k1 = valueArray[l++];
  3632. }
  3633. if (byte0 == 0) {
  3634. if (i1 == 0) {
  3635. k += k1;
  3636. }
  3637. if (i1 == 1) {
  3638. k -= k1;
  3639. }
  3640. if (i1 == 2 && k1 != 0) {
  3641. k /= k1;
  3642. }
  3643. if (i1 == 3) {
  3644. k *= k1;
  3645. }
  3646. i1 = 0;
  3647. } else {
  3648. i1 = byte0;
  3649. }
  3650.  
  3651. // System.out.println("id=" + rsi.id + "; val=" + val + "; k1=" + k1 + "; byte0=" + byte0);
  3652. } while (true);
  3653. } catch (Exception _ex) {
  3654. return -1;
  3655. }
  3656. }
  3657.  
  3658. public void drawInputField(RSInterface child, int x, int y, int width, int height) {
  3659. if (displayText == null)
  3660. displayText = "";
  3661.  
  3662. String text = displayText;
  3663. if (!child.isInFocus && displayText.length() <= 0) {
  3664. text = "Search...";
  3665. }
  3666.  
  3667. if (!(super.saveClickX >= x && super.saveClickX <= x + child.width && super.saveClickY >= y && super.saveClickY <= y + child.height)) {
  3668. child.isInFocus = false;
  3669. RSInterface.currentInputFieldId = -1;
  3670. setInputFieldFocusOwner(null);
  3671. }
  3672.  
  3673. DrawingArea.drawRoundedRectangle(x, y, width, height, child.disabledColor != 0 ? child.disabledColor : 0x231400,
  3674. child.opacity > 0 ? child.opacity : 255, true, true);
  3675. if (child.displayAsterisks)
  3676. this.normalFont.method389(
  3677. false,
  3678. (x + 8),
  3679. child.enabledColor,
  3680. new StringBuilder().append(TextUtils.mask(text))
  3681. .append(((!child.isInFocus ? 0 : 1) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 ? "|" : "").toString(), (y
  3682. + (height / 2) + 6));
  3683. else
  3684. this.normalFont.method389(false, (x + 8), child.enabledColor,
  3685. new StringBuilder().append(text).append(((!child.isInFocus ? 0 : 1) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 ? "|" : "")
  3686. .toString(), (y + (height / 2) + 6));
  3687. }
  3688.  
  3689. public void drawAltInputField(RSInterface child, int x, int y, int width, int height) {
  3690. int alpha = child.opacity > 0 ? child.opacity : 255;
  3691.  
  3692. /*
  3693. * if ((child.id == 60152 || child.id == 60153)
  3694. * && ReferenceManager.useServerEmail) {
  3695. * alpha = 40;
  3696. * }
  3697. */
  3698.  
  3699. DrawingArea.drawRoundedRectangle(x, y, width, height, child.disabledColor != 0 ? child.disabledColor : 0x231400, alpha, true, true);
  3700.  
  3701. if (child.displayAsterisks) {
  3702. String text = new StringBuilder().append(TextUtils.mask(child.displayText)).toString();
  3703. int length = text.length();
  3704. if (length <= 0 && child.enabledText != null && getInputFieldFocusOwner() != child) {
  3705. text = child.enabledText;
  3706. length = text.length();
  3707. }
  3708. if (System.currentTimeMillis() - child.lastKeyPressed < 1000 && length > 0) {
  3709. text = text.substring(0, length - 1) + child.displayText.charAt(child.displayText.length() - 1);
  3710. }
  3711.  
  3712. if (length > child.characterLimitCutOff) {
  3713. if (getInputFieldFocusOwner() == child)
  3714. text = "..." + text.substring((length / child.characterLimitCutOff) * child.characterLimitCutOff, length);
  3715. else
  3716. text = text.substring(0, child.characterLimitCutOff - 1) + "...";
  3717. }
  3718.  
  3719. this.normalFont.method389(false, (x + 8), child.enabledColor, text
  3720. + (((!child.isInFocus ? 0 : 1) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 && getInputFieldFocusOwner() == child ? "|" : ""),
  3721. (y + (height / 2) + 6));
  3722. } else {
  3723.  
  3724. String text = child.displayText;
  3725. int length = text.length();
  3726. if (length <= 0 && child.enabledText != null && getInputFieldFocusOwner() != child) {
  3727. text = child.enabledText;
  3728. length = text.length();
  3729. }
  3730. if (!child.splitDisplayText) {
  3731. if (length > child.characterLimitCutOff) {
  3732. if (getInputFieldFocusOwner() == child)
  3733. text = "..." + text.substring((length / child.characterLimitCutOff) * child.characterLimitCutOff, length);
  3734. else
  3735. text = text.substring(0, child.characterLimitCutOff - 1) + "...";
  3736. }
  3737.  
  3738. normalFont.method389(false, (x + 8), child.enabledColor, text
  3739. + (((!child.isInFocus ? 0 : 1) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 && getInputFieldFocusOwner() == child ? "|"
  3740. : ""), (y + (height / 2) + 6));
  3741. } else {
  3742. String[] split = TextUtils.split(newSmallFont, text, width - 2);
  3743. for (int i = 0; i < split.length; i++) {
  3744. if (split[i] == null || split[i].equals("null"))
  3745. continue;
  3746. newSmallFont.drawBasicString(split[i]
  3747. + (i != split.length - 1 ? "" : (((!child.isInFocus ? 0 : 1) & (loopCycle % 40 < 20 ? 1 : 0)) != 0
  3748. && getInputFieldFocusOwner() == child ? "|" : "")), (x + 2), (y + newSmallFont.baseCharacterHeight + 5)
  3749. + ((newSmallFont.baseCharacterHeight + 3) * i), child.enabledColor, child.shadeText ? 0 : -1, true);
  3750. }
  3751. }
  3752. }
  3753.  
  3754. if (getInputFieldFocusOwner() == null)
  3755. return;
  3756. if (child.id == getInputFieldFocusOwner().id) {
  3757. if (child.displayText == null)
  3758. child.displayText = "";
  3759.  
  3760. if (!(super.saveClickX >= x && super.saveClickX <= x + child.width && super.saveClickY >= y && super.saveClickY <= y
  3761. + child.height)) {
  3762. child.isInFocus = false;
  3763. RSInterface.currentInputFieldId = -1;
  3764. setInputFieldFocusOwner(null);
  3765. }
  3766. }
  3767. }
  3768.  
  3769. private RSInterface inputFieldFocusOwner;
  3770.  
  3771. public void setInputFieldFocusOwner(RSInterface child) {
  3772. inputFieldFocusOwner = child;
  3773. }
  3774.  
  3775. public RSInterface getInputFieldFocusOwner() {
  3776. return inputFieldFocusOwner;
  3777. }
  3778.  
  3779. private void drawTooltip() {
  3780. if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0 && familiarHandler.specialSelected == -1
  3781. && !familiarHandler.attackSelected) {
  3782. return;
  3783. }
  3784. String tooltip;
  3785. if (itemSelected == 1 && menuActionRow < 2) {
  3786. tooltip = "Use " + selectedItemName + " with...";
  3787. } else if (spellSelected == 1 && menuActionRow < 2) {
  3788. tooltip = spellTooltip + "...";
  3789. } else if (familiarHandler.isActive() && familiarHandler.specialSelected != -1 && familiarHandler.specialType == 2
  3790. && menuActionRow < 2) {
  3791. tooltip = "Use " + familiarHandler.specialAttack + " with...";
  3792. } else {
  3793. tooltip = menuActionName[menuActionRow - 1];
  3794. }
  3795. if (menuActionRow > 2) {
  3796. tooltip = tooltip + "@whi@ / " + (menuActionRow - 2) + " more options";
  3797. }
  3798. RSFontSystem font = getCurrentAccount().contextMenu == 0 ? newBoldFont : newRegularFont;
  3799. font.drawBasicString(tooltip, 4, 15, 0xffffff, 0);
  3800. // boldFont.method390(4, 0xffffff, tooltip, requestAge / 1000, 15);
  3801. }
  3802.  
  3803. public int getOrbX(int orb) {
  3804. switch (orb) {
  3805. case 0:
  3806. return !isFixed() ? clientWidth - 212 : 172;
  3807. case 1:
  3808. return !isFixed() ? clientWidth - 215 : 188;
  3809. case 2:
  3810. return !isFixed() ? clientWidth - 203 : 188;
  3811. case 3:
  3812. return !isFixed() ? clientWidth - 180 : 172;
  3813. }
  3814. return 0;
  3815. }
  3816.  
  3817. public int getOrbY(int orb) {
  3818. switch (orb) {
  3819. case 0:
  3820. return !isFixed() ? 39 : 15;
  3821. case 1:
  3822. return !isFixed() ? 73 : 54;
  3823. case 2:
  3824. return !isFixed() ? 107 : 93;
  3825. case 3:
  3826. return !isFixed() ? 141 : 128;
  3827. }
  3828. return 0;
  3829. }
  3830.  
  3831. public double fillHP;
  3832. private boolean poisoned;
  3833.  
  3834. public void drawHPOrb() {
  3835. int current = currentLevel[3];
  3836. int max = maxLevel[3];
  3837. if (!GameSettings.X_10.toggled()) {
  3838. if (current < 10 && current > 0)
  3839. current = 10;
  3840. current /= 10;
  3841. max /= 10;
  3842. }
  3843. int health = (int) (((double) current / (double) max) * 100D);
  3844. int x = getOrbX(0);
  3845. int y = getOrbY(0);
  3846. orbs[clientSize == 0 ? (hoverPos == 4 ? 12 : 0) : (hoverPos == 4 ? 13 : 11)].drawImage(x, y);
  3847. if (health >= 75) {
  3848. newSmallFont.drawCenteredString(Integer.toString(current), x + (clientSize == 0 ? 42 : 15), y + 26, 65280, 0);
  3849. } else if (health <= 74 && health >= 50) {
  3850. newSmallFont.drawCenteredString(Integer.toString(current), x + (clientSize == 0 ? 42 : 15), y + 26, 0xffff00, 0);
  3851. } else if (health <= 49 && health >= 25) {
  3852. newSmallFont.drawCenteredString(Integer.toString(current), x + (clientSize == 0 ? 42 : 15), y + 26, 0xfca607, 0);
  3853. } else if (health <= 24 && health >= 0) {
  3854. newSmallFont.drawCenteredString(Integer.toString(current), x + (clientSize == 0 ? 42 : 15), y + 26, 0xf50d0d, 0);
  3855. }
  3856. final RSImage orb = !poisoned ? orbs[2] : RSImageLoader.images[634];
  3857. orb.drawImage(x + (clientSize == 0 ? 3 : 27), y + 3);
  3858.  
  3859. double percent = (health / 100D);
  3860. fillHP = 27 * percent;
  3861. int depleteFill = 27 - (int) fillHP;
  3862. orbs[1].myHeight = depleteFill;
  3863. DrawingArea.height = depleteFill;
  3864. orbs[1].drawImage(x + (clientSize == 0 ? 3 : 27), y + 3);
  3865.  
  3866. boolean newDrawing = getRevision() == Revision.REVISION_667 && Content.isNewSchoolGameframe();
  3867. if (newDrawing)
  3868. orbs[3].drawImage(x + (clientSize == 0 ? 7 : 31), y + 9);
  3869. else
  3870. RSImageLoader.images[541].drawImage(x + (clientSize == 0 ? 9 : 33), y + 11);
  3871. }
  3872.  
  3873. public double fillPrayer;
  3874.  
  3875. public void drawPrayerOrb() {
  3876. int current_level = !inHungerGames() ? currentLevel[5] : hungerGamesThirst;
  3877. int max_level = !inHungerGames() ? maxLevel[5] : 100;
  3878. if (!GameSettings.X_10.toggled() && !inHungerGames()) {
  3879. if (current_level < 10 && current_level > 0)
  3880. current_level = 10;
  3881. current_level /= 10;
  3882. max_level /= 10;
  3883. }
  3884.  
  3885. int prayer = (int) (((double) current_level / (double) max_level) * 100D);
  3886. int x = getOrbX(1);
  3887. int y = getOrbY(1);
  3888. orbs[clientSize == 0 ? (hoverPos == 1 ? 12 : 0) : (hoverPos == 1 ? 13 : 11)].drawImage(x, y);
  3889. if (prayer >= 75) {
  3890. newSmallFont.drawCenteredString(Integer.toString(current_level), x + (clientSize == 0 ? 42 : 15), y + 26, 65280, 0);
  3891. } else if (prayer <= 74 && prayer >= 50) {
  3892. newSmallFont.drawCenteredString(Integer.toString(current_level), x + (clientSize == 0 ? 42 : 15), y + 26, 0xffff00, 0);
  3893. } else if (prayer <= 49 && prayer >= 25) {
  3894. newSmallFont.drawCenteredString(Integer.toString(current_level), x + (clientSize == 0 ? 42 : 15), y + 26, 0xfca607, 0);
  3895. } else if (prayer <= 24 && prayer >= 0) {
  3896. newSmallFont.drawCenteredString(Integer.toString(current_level), x + (clientSize == 0 ? 42 : 15), y + 26, 0xf50d0d, 0);
  3897. }
  3898.  
  3899. if (!inHungerGames()) {
  3900. orbs[quickPrayers && currentLevel[5] != 0 ? 10 : 4].drawImage(x + (clientSize == 0 ? 3 : 27), y + 3);
  3901. } else {
  3902. RSImageLoader.images[794].drawImage(x + (clientSize == 0 ? 3 : 27), y + 3);
  3903. }
  3904. double percent = (prayer / 100D);
  3905. fillPrayer = 27 * percent;
  3906. int depleteFill = 27 - (int) fillPrayer;
  3907. orbs[17].myHeight = depleteFill;
  3908. DrawingArea.height = depleteFill;
  3909. orbs[17].drawImage(x + (clientSize == 0 ? 3 : 27), y + 3);
  3910.  
  3911. if (!inHungerGames()) {
  3912. boolean newDrawing = getRevision() == Revision.REVISION_667 && Content.isNewSchoolGameframe();
  3913. if (newDrawing)
  3914. orbs[5].drawImage(x + (clientSize == 0 ? 5 : 30), y + 6);
  3915. else
  3916. RSImageLoader.images[542].drawImage(x + (clientSize == 0 ? 7 : 32), y + 7);
  3917. } else {
  3918. RSImageLoader.images[790].drawImage(x + (clientSize == 0 ? 9 : 33), y + 9);
  3919. }
  3920. }
  3921.  
  3922. public boolean inHungerGames() {
  3923. return tabInterfaceIDs[5] == 16650 && hungerGamesHunger >= 0 && hungerGamesThirst >= 0;
  3924. }
  3925.  
  3926. public double fillRun;
  3927. public boolean running;
  3928.  
  3929. public int restMode = 0;
  3930. public int restOpacity = 100;
  3931.  
  3932. public void drawRunOrb() {
  3933. int run = (int) (((double) energy / (double) 100) * 100D);
  3934. int x = getOrbX(2);
  3935. int y = getOrbY(2);
  3936. orbs[clientSize == 0 ? (hoverPos == 2 ? 12 : 0) : (hoverPos == 2 ? 13 : 11)].drawImage(x, y);
  3937. if (run >= 75) {
  3938. newSmallFont.drawCenteredString(Integer.toString(energy), x + (clientSize == 0 ? 42 : 15), y + 26, 65280, 0);
  3939. } else if (run <= 74 && run >= 50) {
  3940. newSmallFont.drawCenteredString(Integer.toString(energy), x + (clientSize == 0 ? 42 : 15), y + 26, 0xffff00, 0);
  3941. } else if (run <= 49 && run >= 25) {
  3942. newSmallFont.drawCenteredString(Integer.toString(energy), x + (clientSize == 0 ? 42 : 15), y + 26, 0xfca607, 0);
  3943. } else if (run <= 24 && run >= 0) {
  3944. newSmallFont.drawCenteredString(Integer.toString(energy), x + (clientSize == 0 ? 42 : 15), y + 26, 0xf50d0d, 0);
  3945. }
  3946. if (restMode <= 0) {
  3947. orbs[!running ? 6 : 8].drawImage(x + (clientSize == 0 ? 3 : 27), y + 3);
  3948. } else {
  3949. restOpacity = restOpacity < 250 ? restOpacity + 6 : 125;
  3950. orbs[8].drawImageWithOpacity(x + (clientSize == 0 ? 3 : 27), y + 3, restOpacity);
  3951. }
  3952. double percent = (run / 100D);
  3953. fillRun = 27 * percent;
  3954. int depleteFill = 27 - (int) fillRun;
  3955. orbs[18].myHeight = depleteFill;
  3956. DrawingArea.height = depleteFill;
  3957. orbs[18].drawImage(x + (clientSize == 0 ? 3 : 27), y + 3);
  3958. if (run == 0) {
  3959. running = false;
  3960. variousSettings[173] = 0;
  3961. }
  3962. if (restMode <= 0) {
  3963. boolean newDrawing = getRevision() == Revision.REVISION_667 && Content.isNewSchoolGameframe();
  3964. if (newDrawing)
  3965. orbs[!running ? 7 : 9].drawImage(x + (clientSize == 0 ? 8 : 32), y + 7);
  3966. else
  3967. RSImageLoader.images[!running ? 543 : 544].drawImage(x + (clientSize == 0 ? 10 : 34), y + 7);
  3968. } else {
  3969. RSImageLoader.images[restMode == 1 ? 813 : 814].drawImage(x + (clientSize == 0 ? 8 : 32), y + 7);
  3970. }
  3971. // cacheSprite[106].drawARGBImage(currentX + (clientSize == 0 ? -15 : 34), currentY - 17, 0);
  3972. }
  3973.  
  3974. public double fillSummoning;
  3975.  
  3976. public void drawSummoningOrb() {
  3977. int current_level = !inHungerGames() ? currentLevel[23] : hungerGamesHunger;
  3978. int max_level = !inHungerGames() ? maxLevel[23] : 100;
  3979.  
  3980. int summoning = (int) (((double) current_level / (double) max_level) * 100D);
  3981. int x = getOrbX(3);
  3982. int y = getOrbY(3);
  3983.  
  3984. if (familiarHandler.specialSelected == -1 && !familiarHandler.attackSelected) {
  3985. orbs[clientSize == 0 ? (hoverPos == 3 ? 12 : 0) : (hoverPos == 3 ? 13 : 11)].drawImage(x, y);
  3986. } else {
  3987. orbs[clientSize == 0 ? (hoverPos == 3 ? 12 : 0) : (hoverPos == 3 ? 13 : 11)].drawOutlinedSprite(x, y, 0xFFFFFF);
  3988. }
  3989. if (summoning <= 100 && summoning >= 75) {
  3990. newSmallFont.drawCenteredString(Integer.toString(current_level), x + (clientSize == 0 ? 42 : 15), y + 26, 65280, 0);
  3991. } else if (summoning <= 74 && summoning >= 50) {
  3992. newSmallFont.drawCenteredString(Integer.toString(current_level), x + (clientSize == 0 ? 42 : 15), y + 26, 0xffff00, 0);
  3993. } else if (summoning <= 49 && summoning >= 25) {
  3994. newSmallFont.drawCenteredString(Integer.toString(current_level), x + (clientSize == 0 ? 42 : 15), y + 26, 0xfca607, 0);
  3995. } else if (summoning <= 24 && summoning >= 0) {
  3996. newSmallFont.drawCenteredString(Integer.toString(current_level), x + (clientSize == 0 ? 42 : 15), y + 26, 0xf50d0d, 0);
  3997. }
  3998.  
  3999. if (!inHungerGames()) {
  4000. orbs[getFamiliar().isActive() ? 16 : 14].drawImage(x + (clientSize == 0 ? 3 : 27), y + 3);
  4001. } else {
  4002. RSImageLoader.images[793].drawImage(x + (clientSize == 0 ? 3 : 27), y + 3);
  4003. }
  4004. double percent = (summoning / 100D);
  4005. fillSummoning = 27 * percent;
  4006. int depleteFill = 27 - (int) fillSummoning;
  4007. orbs[19].myHeight = depleteFill;
  4008. DrawingArea.height = depleteFill;
  4009. orbs[19].drawImage(x + (clientSize == 0 ? 3 : 27), y + 3);
  4010.  
  4011. if (!inHungerGames()) {
  4012. orbs[15].drawImage(x + (clientSize == 0 ? 9 : 33), y + 9);
  4013. } else {
  4014. RSImageLoader.images[789].drawImage((x) + (clientSize == 0 ? 9 : 33), y + 9);
  4015. }
  4016. }
  4017.  
  4018. private void drawOrbs() {
  4019. if (Content.GAMEFRAME >= 508) {
  4020. drawHPOrb();
  4021. drawPrayerOrb();
  4022. drawRunOrb();
  4023. drawSummoningOrb();
  4024. }
  4025.  
  4026. if (GameSettings.MONEY_ORB.toggled())
  4027. drawMoneyOrb();
  4028. }
  4029.  
  4030. private boolean viewingMoneyOrb;
  4031. private int moneyOrbUpdateStatus;
  4032. private int moneyOrbStatusAlpha = 256;
  4033. private long lastMoneyOrbStatusAlpha;
  4034. private long moneyPouch;
  4035. private int moneyOrbUpdateTextY;
  4036. private long moneyPouchProfit;
  4037.  
  4038. private void drawMoneyOrb() {
  4039. int orb_x = (clientSize == 0 ? -2 : clientWidth - 253);
  4040. int orb_y = (clientSize == 0 ? 85 : 35);
  4041. int orb_image_id = 259;
  4042.  
  4043. if (hoverPos == 5) {
  4044. orb_image_id = 260;
  4045. }
  4046.  
  4047. RSImageLoader.images[orb_image_id].drawARGBImage(orb_x, orb_y);
  4048.  
  4049. if (moneyOrbUpdateStatus > 0 && moneyOrbUpdateStatus <= 2) {
  4050. if (viewingMoneyOrb) {
  4051. moneyOrbUpdateStatus = 0;
  4052. } else {
  4053. if (System.currentTimeMillis() - lastMoneyOrbStatusAlpha >= 700) {
  4054. moneyOrbStatusAlpha = moneyOrbStatusAlpha == 256 ? 210 : 256;
  4055. lastMoneyOrbStatusAlpha = System.currentTimeMillis();
  4056. }
  4057. RSImageLoader.images[268 + moneyOrbUpdateStatus].drawARGBImage(orb_x - 3, orb_y - 3, moneyOrbStatusAlpha);
  4058. }
  4059. }
  4060.  
  4061. if (clientSize != 0) {
  4062. drawMoneyOrbParts();
  4063. }
  4064. }
  4065.  
  4066. private void drawMoneyOrbParts() {
  4067. int orb_x = clientWidth - 292;
  4068. int orb_y = clientSize == 0 ? 86 : 40;
  4069. int box_image_id = -1;
  4070. int extension_image_id = -1;
  4071.  
  4072. if (moneyPouchProfit > 0) {
  4073. if (moneyOrbUpdateTextY <= 0) {
  4074. moneyOrbUpdateTextY = 50;
  4075. }
  4076. int color = 0x00FF00;
  4077. String string = "+" + moneyPouchProfit;
  4078. int draw_y = moneyOrbUpdateTextY + (clientSize == 0 ? 105 : 70);
  4079.  
  4080. RSInterface.fonts[0].drawCenteredString(string, orb_x + 8, draw_y, color, 1);
  4081.  
  4082. moneyOrbUpdateTextY -= 2;
  4083. if (moneyOrbUpdateTextY <= 0) {
  4084. moneyPouchProfit = 0;
  4085. }
  4086. } else if (moneyPouchProfit < 0) {
  4087. int color = 0xFF0000;
  4088. String string = "" + moneyPouchProfit;
  4089. int draw_y = moneyOrbUpdateTextY + (clientSize == 0 ? 105 : 70);
  4090.  
  4091. RSInterface.fonts[0].drawCenteredString(string, orb_x + 8, draw_y, color, 1);
  4092.  
  4093. moneyOrbUpdateTextY += 2;
  4094. if (moneyOrbUpdateTextY >= 50) {
  4095. moneyPouchProfit = 0;
  4096. moneyOrbUpdateTextY = 0;
  4097. }
  4098. }
  4099.  
  4100. if (hoverPos == 5) {
  4101. if (viewingMoneyOrb) {
  4102. extension_image_id = 263;
  4103. } else {
  4104. extension_image_id = 264;
  4105. }
  4106. }
  4107.  
  4108. if (viewingMoneyOrb) {
  4109. if (hoverPos != 5) {
  4110. box_image_id = 267;
  4111. } else {
  4112. box_image_id = 268;
  4113. }
  4114. }
  4115.  
  4116. if (box_image_id != -1) {
  4117. RSImageLoader.images[box_image_id].drawARGBImage(orb_x - 29, orb_y);
  4118. int color = moneyPouch < 1000000 ? 0xFFFFFF : 0x00FF00;
  4119. RSInterface.fonts[0].drawCenteredString(String.valueOf(formatAmount(moneyPouch)), orb_x + 8, orb_y + 16, color, 1);
  4120. }
  4121. if (extension_image_id != -1) {
  4122. // RSImageLoader.images[extension_image_id].drawARGBImage(orb_x + 36, orb_y - 5);
  4123. }
  4124. }
  4125.  
  4126.  
  4127.  
  4128.  
  4129. private void drawMinimap() {
  4130. if (GameSettings.HIDE_MINIMAP.toggled()) {
  4131. return;
  4132. }
  4133. int xPosOffset = getMapOffsetX();
  4134. int revision = Content.getVersion(Content.GAMEFRAME);
  4135. if (showMiniMap) {
  4136. if (clientSize == 0) {
  4137. mapArea.create();
  4138. }
  4139. if (minimapState == 2) {
  4140. cacheSprite[67].drawImage((clientSize == 0 ? 32 : clientWidth - 162), (clientSize == 0 ? 9 : 5));
  4141. if (clientSize == 0) {
  4142. cacheSprite[6].drawImage(0 + xPosOffset, 0);
  4143. } else {
  4144. cacheSprite[36].drawImage(clientWidth - 167, 0);
  4145. cacheSprite[37].drawImage(clientWidth - 172, 0);
  4146. }
  4147. cacheSprite[38].drawImage(clientSize == 0 ? -3 : clientWidth - 188, clientSize == 0 ? 46 : 40);
  4148. if (hoverPos == 0) {
  4149. cacheSprite[39].drawImage(clientSize == 0 ? -3 : clientWidth - 188, clientSize == 0 ? 46 : 40);
  4150. }
  4151. cacheSprite[30].drawImage((clientSize == 0 ? 246 : clientWidth) - 21, 0);
  4152. if (tabHover != -1) {
  4153. if (tabHover == 10) {
  4154. cacheSprite[34].drawImage((clientSize == 0 ? 246 : clientWidth) - 21, 0);
  4155. }
  4156. }
  4157. if (tabInterfaceIDs[tabID] != -1) {
  4158. if (tabID == 10) {
  4159. cacheSprite[35].drawImage((clientSize == 0 ? 246 : clientWidth) - 21, 0);
  4160. }
  4161. }
  4162. drawOrbs();
  4163. compass.shapeImageToPixels(33, viewRotation, anIntArray1057, 256, anIntArray968, 25, (clientSize == 0 ? 8 : 5)
  4164. + getMapOffsetY(), (clientSize == 0 ? 8 + xPosOffset : clientWidth - 167), 33, 25);
  4165. gameArea.create();
  4166. return;
  4167. }
  4168. int i = viewRotation + minimapRotation & 0x7ff;
  4169. int x_start = 48 + myPlayer.currentX / 32;
  4170. int y_start = 464 - myPlayer.currentY / 32;
  4171. miniMap.shapeImageToPixels(152, i, anIntArray1229, 256 + minimapZoom, anIntArray1052, y_start, (clientSize == 0 ? 9 : 5)
  4172. + getMapOffsetY(), (clientSize == 0 ? 32 + xPosOffset : clientWidth - 162), 152, x_start);
  4173. for (int j5 = 0; j5 < localMapIcons; j5++) {
  4174. int x = (mapIconX[j5] * 4 + 2) - myPlayer.currentX / 32;
  4175. int y = (mapIconY[j5] * 4 + 2) - myPlayer.currentY / 32;
  4176. markMinimap(mapIcons[j5], x, y);
  4177. }
  4178. for (int k5 = 0; k5 < 104; k5++) {
  4179. for (int l5 = 0; l5 < 104; l5++) {
  4180. Deque class19 = groundEntity[plane][k5][l5];
  4181. if (class19 != null) {
  4182. int x = (k5 * 4 + 2) - myPlayer.currentX / 32;
  4183. int y = (l5 * 4 + 2) - myPlayer.currentY / 32;
  4184. markMinimap(mapDotItem, x, y);
  4185. }
  4186. }
  4187. }
  4188. for (int i6 = 0; i6 < npcCount; i6++) {
  4189. NPC npc = npcArray[npcIndices[i6]];
  4190. if (npc != null && npc.isVisible()) {
  4191. NPCDef entityDef = npc.definition;
  4192. if (entityDef.childrenIDs != null) {
  4193. entityDef = entityDef.getChildDefinition();
  4194. }
  4195. if (entityDef != null && entityDef.displayMapIcon && entityDef.clickable) {
  4196. int i1 = npc.currentX / 32 - myPlayer.currentX / 32;
  4197. int k3 = npc.currentY / 32 - myPlayer.currentY / 32;
  4198. markMinimap(mapDotNPC, i1, k3);
  4199. }
  4200. }
  4201. }
  4202. for (int index = 0; index < playerCount; index++) {
  4203. Player player = players[playerIndices[index]];
  4204. if (player != null && player.isVisible()) {
  4205. int x = player.currentX / 32 - myPlayer.currentX / 32;
  4206. int y = player.currentY / 32 - myPlayer.currentY / 32;
  4207. boolean friend = false;
  4208. long name = TextUtils.longForName(player.name);
  4209. for (int k6 = 0; k6 < friendsCount; k6++) {
  4210. if (name != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0) {
  4211. continue;
  4212. }
  4213. friend = true;
  4214. break;
  4215. }
  4216. boolean team = false;
  4217. if (myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team) {
  4218. team = true;
  4219. }
  4220. if (friend) {
  4221. markMinimap(mapDotFriend, x, y);
  4222. } else if (team) {
  4223. markMinimap(mapDotTeam, x, y);
  4224. } else {
  4225. markMinimap(mapDotPlayer, x, y);
  4226. }
  4227. }
  4228. }
  4229. if (anInt855 != 0 && loopCycle % 20 < 10) {
  4230. if (anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  4231. NPC npc = npcArray[anInt1222];
  4232. if (npc != null) {
  4233. int x = npc.currentX / 32 - myPlayer.currentX / 32;
  4234. int y = npc.currentY / 32 - myPlayer.currentY / 32;
  4235. method81(mapMarker, y, x);
  4236. }
  4237. }
  4238. if (anInt855 == 2) {
  4239. int x = ((anInt934 - baseX) * 4 + 2) - myPlayer.currentX / 32;
  4240. int y = ((anInt935 - baseY) * 4 + 2) - myPlayer.currentY / 32;
  4241. method81(mapMarker, y, x);
  4242. }
  4243. if (anInt855 == 10 && anInt933 >= 0 && anInt933 < players.length) {
  4244. Player player = players[anInt933];
  4245. if (player != null) {
  4246. int x = player.currentX / 32 - myPlayer.currentX / 32;
  4247. int y = player.currentY / 32 - myPlayer.currentY / 32;
  4248. method81(mapMarker, y, x);
  4249. }
  4250. }
  4251. }
  4252. if (destX != 0) {
  4253. int x = (destX * 4 + 2) - myPlayer.currentX / 32;
  4254. int y = (destY * 4 + 2) - myPlayer.currentY / 32;
  4255. markMinimap(mapFlag, x, y);
  4256. }
  4257. DrawingArea.drawFilledPixels((clientSize == 0 ? 107 + xPosOffset : clientWidth - 88), (clientSize == 0 ? 84 : 80)
  4258. + getMapOffsetY(), 3, 3, 0xffffff);
  4259. if (clientSize == 0) {
  4260. mapImage.drawImage(0, 0);
  4261. } else {
  4262. cacheSprite[36].drawImage(clientWidth - 167, 0);
  4263. cacheSprite[37].drawImage(clientWidth - 172, 0);
  4264. }
  4265. if (revision > 474) {
  4266. cacheSprite[38].drawImage(clientSize == 0 ? -3 : clientWidth - 217, clientSize == 0 ? 46 : 3);
  4267. if (hoverPos == 0) {
  4268. cacheSprite[39].drawImage(clientSize == 0 ? -3 : clientWidth - 217, clientSize == 0 ? 46 : 3);
  4269. }
  4270. }
  4271. drawOrbs();
  4272. compass.shapeImageToPixels(33, viewRotation, anIntArray1057, 256, anIntArray968, 25, (clientSize == 0 ? 8 : 5)
  4273. + getMapOffsetY(), (clientSize == 0 ? 8 + xPosOffset : clientWidth - 167), 33, 25);
  4274. }
  4275. cacheSprite[30].drawImage((clientSize == 0 ? 246 : clientWidth) - 21, 0);
  4276. cacheSprite[96].drawImage((clientSize == 0 ? 225 : clientWidth - 21) - 21, 0);
  4277. if (mouseInRegion(clientWidth - 42, clientWidth - 21, 0, 21)) {
  4278. cacheSprite[97].drawImage((clientSize == 0 ? 225 : clientWidth - 21) - 21, 0);
  4279. }
  4280. boolean logoutHover = mouseInRegion(clientWidth - 20, clientWidth, 0, 21);
  4281. if (tabHover != -1) {
  4282. if (logoutHover) {
  4283. cacheSprite[34].drawImage((clientSize == 0 ? 246 : clientWidth) - 21, 0);
  4284. }
  4285. }
  4286. if (tabInterfaceIDs[tabID] != -1) {
  4287. if (logoutHover) {
  4288. cacheSprite[35].drawImage((clientSize == 0 ? 246 : clientWidth) - 21, 0);
  4289. }
  4290. }
  4291. if (logoutHover) {
  4292. drawHoverBox("Logout", (clientSize == 0 ? 246 : clientWidth) - 50, 21);
  4293. }
  4294. if (mouseInRegion(clientWidth - 42, clientWidth - 21, 0, 21)) {
  4295. drawHoverBox(isFixed() ? "You can only hide the\nmap in an unfixed mode!" : (showMiniMap ? "Hide" : "Show") + " minimap",
  4296. (clientSize == 0 ? 225 : clientWidth - 21) - 21 - (isFixed() ? 100 : 42), 21);
  4297. }
  4298. if (menuOpen && menuScreenArea == 3) {
  4299. drawMenu();
  4300. }
  4301. gameArea.create();
  4302. }
  4303.  
  4304. private void npcScreenPos(Entity entity, int i) {
  4305. calcEntityScreenPos(entity.currentX, i, entity.currentY);
  4306. }
  4307.  
  4308. private void calcEntityScreenPos(int i, int j, int l) {
  4309. if (i < 128 || l < 128 || i > 13056 || l > 13056) {
  4310. spriteDrawX = -1;
  4311. spriteDrawY = -1;
  4312. return;
  4313. }
  4314. int i1 = method42(plane, l, i) - j;
  4315. i -= xCameraPos;
  4316. i1 -= zCameraPos;
  4317. l -= yCameraPos;
  4318. int j1 = Model.SINE[yCameraCurve];
  4319. int k1 = Model.COSINE[yCameraCurve];
  4320. int l1 = Model.SINE[xCameraCurve];
  4321. int i2 = Model.COSINE[xCameraCurve];
  4322. int j2 = l * l1 + i * i2 >> 16;
  4323. l = l * i2 - i * l1 >> 16;
  4324. i = j2;
  4325. j2 = i1 * k1 - l * j1 >> 16;
  4326. l = i1 * j1 + l * k1 >> 16;
  4327. i1 = j2;
  4328. if (l >= 50) {
  4329. spriteDrawX = Rasterizer.centerX + (i << 9) / l;
  4330. spriteDrawY = Rasterizer.centerY + (i1 << 9) / l;
  4331. } else {
  4332. spriteDrawX = -1;
  4333. spriteDrawY = -1;
  4334. }
  4335. }
  4336.  
  4337. private void buildSplitPrivateChatMenu() {
  4338. if (splitPrivateChat == 0) {
  4339. return;
  4340. }
  4341. int offsetY = 0;
  4342. if (updateTimer != 0) {
  4343. offsetY = 1;
  4344. }
  4345. if (restartTimer != 0) {
  4346. offsetY = 1;
  4347. }
  4348. for (int index = 0; index < 500; index++) {
  4349. if (chatMessages[index] != null) {
  4350. int type = chatTypes[index];
  4351. String name = chatNames[index];
  4352. if (name != null && name.indexOf("@") == 0) {
  4353. int last = name.lastIndexOf('@');
  4354.  
  4355. name = name.substring(last + 1);
  4356. }
  4357. if ((type == 3 || type == 7) && (type == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(name))) {
  4358. int positionY = (clientHeight - 174) - offsetY * 13;
  4359. if (super.getMouseX() > (clientSize == 0 ? 4 : 0) && super.getMouseY() - (clientSize == 0 ? 4 : 0) > positionY - 10
  4360. && super.getMouseY() - (clientSize == 0 ? 4 : 0) <= positionY + 3) {
  4361. int i1 = normalFont.getTextWidth("From: " + name + chatMessages[index]) + 25;
  4362. if (i1 > 450) {
  4363. i1 = 450;
  4364. }
  4365. if (super.getMouseX() < (clientSize == 0 ? 4 : 0) + i1) {
  4366. if (!isFriendOrSelf(name)) {
  4367. menuActionName[menuActionRow] = "Add ignore @whi@" + name;
  4368. menuActionID[menuActionRow] = 2042;
  4369. menuActionRow++;
  4370. menuActionName[menuActionRow] = "Add friend @whi@" + name;
  4371. menuActionID[menuActionRow] = 2337;
  4372. menuActionRow++;
  4373. if (isServerSupport()) {
  4374. menuActionName[menuActionRow] = "Mute @whi@" + name;
  4375. menuActionID[menuActionRow] = 942;
  4376. menuActionRow++;
  4377. menuActionName[menuActionRow] = "Un Mute @whi@" + name;
  4378. menuActionID[menuActionRow] = 943;
  4379. menuActionRow++;
  4380. menuActionName[menuActionRow] = "Kick @whi@" + name;
  4381. menuActionID[menuActionRow] = 944;
  4382. menuActionRow++;
  4383. menuActionName[menuActionRow] = "Teleport to @whi@" + name;
  4384. menuActionID[menuActionRow] = 945;
  4385. menuActionRow++;
  4386. menuActionName[menuActionRow] = "Teleport to me @whi@" + name;
  4387. menuActionID[menuActionRow] = 946;
  4388. menuActionRow++;
  4389. }
  4390. if (isModerator() || isHeadModerator() || isAdministrator()) {
  4391. menuActionName[menuActionRow] = "Mute @whi@" + name;
  4392. menuActionID[menuActionRow] = 942;
  4393. menuActionRow++;
  4394. menuActionName[menuActionRow] = "Un Mute @whi@" + name;
  4395. menuActionID[menuActionRow] = 943;
  4396. menuActionRow++;
  4397. menuActionName[menuActionRow] = "Kick @whi@" + name;
  4398. menuActionID[menuActionRow] = 944;
  4399. menuActionRow++;
  4400. menuActionName[menuActionRow] = "Teleport to @whi@" + name;
  4401. menuActionID[menuActionRow] = 945;
  4402. menuActionRow++;
  4403. menuActionName[menuActionRow] = "Teleport to me @whi@" + name;
  4404. menuActionID[menuActionRow] = 946;
  4405. menuActionRow++;
  4406. menuActionName[menuActionRow] = "Ban @whi@" + name;
  4407. menuActionID[menuActionRow] = 947;
  4408. menuActionRow++;
  4409. menuActionName[menuActionRow] = "Mac Ban @whi@" + name;
  4410. menuActionID[menuActionRow] = 948;
  4411. menuActionRow++;
  4412. menuActionName[menuActionRow] = "Mac Mute @whi@" + name;
  4413. menuActionID[menuActionRow] = 949;
  4414. menuActionRow++;
  4415. menuActionName[menuActionRow] = "Un Mac Mute @whi@" + name;
  4416. menuActionID[menuActionRow] = 950;
  4417. menuActionRow++;
  4418. }
  4419. }
  4420. if (isFriendOrSelf(name)) {
  4421. menuActionName[menuActionRow] = "Message @whi@" + name;
  4422. menuActionID[menuActionRow] = 2639;
  4423. menuActionRow++;
  4424. if (isServerSupport()) {
  4425. menuActionName[menuActionRow] = "Mute @whi@" + name;
  4426. menuActionID[menuActionRow] = 942;
  4427. menuActionRow++;
  4428. menuActionName[menuActionRow] = "Un Mute @whi@" + name;
  4429. menuActionID[menuActionRow] = 943;
  4430. menuActionRow++;
  4431. menuActionName[menuActionRow] = "Kick @whi@" + name;
  4432. menuActionID[menuActionRow] = 944;
  4433. menuActionRow++;
  4434. menuActionName[menuActionRow] = "Teleport to @whi@" + name;
  4435. menuActionID[menuActionRow] = 945;
  4436. menuActionRow++;
  4437. menuActionName[menuActionRow] = "Teleport to me @whi@" + name;
  4438. menuActionID[menuActionRow] = 946;
  4439. menuActionRow++;
  4440. }
  4441. if (isModerator() || isHeadModerator() || isAdministrator()) {
  4442. menuActionName[menuActionRow] = "Mute @whi@" + name;
  4443. menuActionID[menuActionRow] = 942;
  4444. menuActionRow++;
  4445. menuActionName[menuActionRow] = "Un Mute @whi@" + name;
  4446. menuActionID[menuActionRow] = 943;
  4447. menuActionRow++;
  4448. menuActionName[menuActionRow] = "Kick @whi@" + name;
  4449. menuActionID[menuActionRow] = 944;
  4450. menuActionRow++;
  4451. menuActionName[menuActionRow] = "Teleport to @whi@" + name;
  4452. menuActionID[menuActionRow] = 945;
  4453. menuActionRow++;
  4454. menuActionName[menuActionRow] = "Teleport to me @whi@" + name;
  4455. menuActionID[menuActionRow] = 946;
  4456. menuActionRow++;
  4457. menuActionName[menuActionRow] = "Ban @whi@" + name;
  4458. menuActionID[menuActionRow] = 947;
  4459. menuActionRow++;
  4460. menuActionName[menuActionRow] = "Mac Ban @whi@" + name;
  4461. menuActionID[menuActionRow] = 948;
  4462. menuActionRow++;
  4463. menuActionName[menuActionRow] = "Mac Mute @whi@" + name;
  4464. menuActionID[menuActionRow] = 949;
  4465. menuActionRow++;
  4466. menuActionName[menuActionRow] = "Un Mac Mute @whi@" + name;
  4467. menuActionID[menuActionRow] = 950;
  4468. menuActionRow++;
  4469. }
  4470. }
  4471. }
  4472. }
  4473. if (offsetY++ >= 5) {
  4474. return;
  4475. }
  4476. }
  4477. if ((type == 5 || type == 6) && privateChatMode < 2 && offsetY++ >= 5) {
  4478. return;
  4479. }
  4480. }
  4481. }
  4482.  
  4483. }
  4484.  
  4485. private void spawnGameObject(int priority1, int objectId, int rotation, int objectClassType, int regionY, int objectType, int height,
  4486. int regionX, int priority2) {
  4487. Class30_Sub1 class30_sub1 = null;
  4488. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179.head(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  4489. .next()) {
  4490. if (class30_sub1_1.anInt1295 != height || class30_sub1_1.anInt1297 != regionX || class30_sub1_1.anInt1298 != regionY
  4491. || class30_sub1_1.anInt1296 != objectClassType) {
  4492. continue;
  4493. }
  4494. class30_sub1 = class30_sub1_1;
  4495. break;
  4496. }
  4497.  
  4498. if (class30_sub1 == null) {
  4499. class30_sub1 = new Class30_Sub1();
  4500. class30_sub1.anInt1295 = height;
  4501. class30_sub1.anInt1296 = objectClassType;
  4502. class30_sub1.anInt1297 = regionX;
  4503. class30_sub1.anInt1298 = regionY;
  4504. method89(class30_sub1);
  4505. aClass19_1179.append(class30_sub1);
  4506. }
  4507. class30_sub1.anInt1291 = objectId;
  4508. class30_sub1.anInt1293 = objectType;
  4509. class30_sub1.anInt1292 = rotation;
  4510. class30_sub1.anInt1302 = priority2;
  4511. class30_sub1.anInt1294 = priority1;
  4512. }
  4513.  
  4514. private boolean interfaceIsSelected(RSInterface rsi) {
  4515. if (rsi.valueCompareType == null) {
  4516. return false;
  4517. }
  4518. for (int i = 0; i < rsi.valueCompareType.length; i++) {
  4519. int j = extractInterfaceValues(rsi, i);
  4520. int k = rsi.requiredValue[i];
  4521. if (rsi.valueCompareType[i] == 2) {
  4522. if (j >= k) {
  4523. return false;
  4524. }
  4525. } else if (rsi.valueCompareType[i] == 3) {
  4526. if (j <= k) {
  4527. return false;
  4528. }
  4529. } else if (rsi.valueCompareType[i] == 4) {
  4530. if (j == k) {
  4531. return false;
  4532. }
  4533. } else if (j != k) {
  4534. return false;
  4535. }
  4536. }
  4537.  
  4538. return true;
  4539. }
  4540.  
  4541. private DataInputStream getJAGGrabStream(String s) throws IOException {
  4542. if (jagGrab != null) {
  4543. try {
  4544. jagGrab.close();
  4545. } catch (Exception e) {
  4546. }
  4547. jagGrab = null;
  4548. }
  4549. jagGrab = openSocket(5555);
  4550. jagGrab.setSoTimeout(10000);
  4551. InputStream input = jagGrab.getInputStream();
  4552. OutputStream output = jagGrab.getOutputStream();
  4553. output.write(("JAGGRAB /" + s + "=" + getRevision().ordinal() + "\n\n").getBytes());
  4554. return new DataInputStream(input);
  4555. }
  4556.  
  4557. public int loadingFileRemaining;
  4558.  
  4559. public void drawLoadingText() {
  4560. int draw_x = 250;
  4561. int draw_y = 160;
  4562.  
  4563. if (clientSize != 0) {
  4564. draw_x = (clientWidth / 2);
  4565. draw_y = (clientHeight / 2) - 20;
  4566. }
  4567.  
  4568. boldFont.drawText(0, "Loading - please wait.", draw_y + 1, draw_x + 1);
  4569. boldFont.drawText(0xffffff, "Loading - please wait.", draw_y, draw_x);
  4570.  
  4571. }
  4572.  
  4573. private void updateOtherClientMovements(JagexBuffer stream) {
  4574. int local_player_amount = stream.getBits(8);
  4575. if (local_player_amount < playerCount) {
  4576. for (int k = local_player_amount; k < playerCount; k++) {
  4577. anIntArray840[anInt839++] = playerIndices[k];
  4578. }
  4579.  
  4580. }
  4581.  
  4582. playerCount = 0;
  4583. for (int l = 0; l < local_player_amount; l++) {
  4584. int i1 = playerIndices[l];
  4585. Player player = players[i1];
  4586. int j1 = stream.getBits(1);
  4587. if (j1 == 0) {
  4588. playerIndices[playerCount++] = i1;
  4589. player.time = loopCycle;
  4590. } else {
  4591. int k1 = stream.getBits(2);
  4592. if (k1 == 0) {
  4593. playerIndices[playerCount++] = i1;
  4594. player.time = loopCycle;
  4595. localPlayers[localPlayersIndex++] = i1;
  4596. } else if (k1 == 1) {
  4597. playerIndices[playerCount++] = i1;
  4598. player.time = loopCycle;
  4599. int l1 = stream.getBits(3);
  4600. player.move(false, l1);
  4601. int j2 = stream.getBits(1);
  4602. if (j2 == 1) {
  4603. localPlayers[localPlayersIndex++] = i1;
  4604. }
  4605. } else if (k1 == 2) {
  4606. playerIndices[playerCount++] = i1;
  4607. player.time = loopCycle;
  4608. int i2 = stream.getBits(3);
  4609. player.move(true, i2);
  4610. int k2 = stream.getBits(3);
  4611. player.move(true, k2);
  4612. int l2 = stream.getBits(1);
  4613. if (l2 == 1) {
  4614. localPlayers[localPlayersIndex++] = i1;
  4615. }
  4616. } else if (k1 == 3) {
  4617. anIntArray840[anInt839++] = i1;
  4618. }
  4619. }
  4620. }
  4621. }
  4622.  
  4623. public boolean mouseInRegion(int x1, int x2, int y1, int y2) {
  4624. if (super.getMouseX() >= x1 && super.getMouseX() <= x2 && super.getMouseY() >= y1 && super.getMouseY() <= y2) {
  4625. return true;
  4626. }
  4627. return false;
  4628. }
  4629.  
  4630. public boolean clickInRegion(int x1, int x2, int y1, int y2) {
  4631. if (super.getClickX() >= x1 && super.getClickX() <= x2 && super.getClickY() >= y1 && super.getClickY() <= y2) {
  4632. return true;
  4633. }
  4634. return false;
  4635. }
  4636.  
  4637. public int[] regionIds = new int[6];
  4638.  
  4639. public void loadMap(int x, int y) {
  4640. mapX = x;
  4641. mapY = y;
  4642. builtSecondaryRegion = false;
  4643. if (localX == x && localY == y && loadingStage == 2) {
  4644. return;
  4645. }
  4646. localX = x;
  4647. localY = y;
  4648. baseX = (localX - 6) * 8;
  4649. baseY = (localY - 6) * 8;
  4650. aBoolean1141 = (localX / 8 == 48 || localX / 8 == 49) && localY / 8 == 48;
  4651. if (localX / 8 == 48 && localY / 8 == 148) {
  4652. aBoolean1141 = true;
  4653. }
  4654. loadingStage = 1;
  4655. loadStageDelay = System.currentTimeMillis();
  4656. int mapIndex = 0;
  4657. for (int i21 = (localX - 6) / 8; i21 <= (localX + 6) / 8; i21++) {
  4658. for (int k23 = (localY - 6) / 8; k23 <= (localY + 6) / 8; k23++) {
  4659. mapIndex++;
  4660. }
  4661. }
  4662. aByteArrayArray1183 = new byte[mapIndex][];
  4663. aByteArrayArray1247 = new byte[mapIndex][];
  4664. mapLocation = new int[mapIndex];
  4665. mapTerrains = new int[mapIndex];
  4666. mapLandscapes = new int[mapIndex];
  4667. regionIds = new int[mapIndex];
  4668. mapIndex = 0;
  4669. for (int regionX = (localX - 6) / 8; regionX <= (localX + 6) / 8; regionX++) {
  4670. for (int regionY = (localY - 6) / 8; regionY <= (localY + 6) / 8; regionY++) {
  4671. mapLocation[mapIndex] = (regionX << 8) + regionY;
  4672. if (aBoolean1141 && (regionY == 49 || regionY == 149 || regionY == 147 || regionX == 50 || regionX == 49 && regionY == 47)) {
  4673. mapTerrains[mapIndex] = -1;
  4674. mapLandscapes[mapIndex] = -1;
  4675. mapIndex++;
  4676. } else {
  4677. int floorId = mapTerrains[mapIndex] = onDemandFetcher.getId(0, regionY, regionX);
  4678. if (floorId != -1) {
  4679. onDemandFetcher.loadMandatory(3, floorId);
  4680. }
  4681. int objectId = mapLandscapes[mapIndex] = onDemandFetcher.getId(1, regionY, regionX);
  4682. if (objectId != -1) {
  4683. onDemandFetcher.loadMandatory(3, objectId);
  4684. }
  4685. regionIds[mapIndex] = onDemandFetcher.getId(3, regionY, regionX);
  4686. mapIndex++;
  4687. }
  4688. }
  4689. }
  4690. int i17 = baseX - anInt1036;
  4691. int j21 = baseY - anInt1037;
  4692. anInt1036 = baseX;
  4693. anInt1037 = baseY;
  4694. for (int j24 = 0; j24 < 16384; j24++) {
  4695. NPC npc = npcArray[j24];
  4696. if (npc != null) {
  4697. for (int j29 = 0; j29 < 10; j29++) {
  4698. npc.pathX[j29] -= i17;
  4699. npc.pathY[j29] -= j21;
  4700. }
  4701. npc.currentX -= i17 * 128;
  4702. npc.currentY -= j21 * 128;
  4703. }
  4704. }
  4705. for (int i27 = 0; i27 < maxPlayers; i27++) {
  4706. Player player = players[i27];
  4707. if (player != null) {
  4708. for (int i31 = 0; i31 < 10; i31++) {
  4709. player.pathX[i31] -= i17;
  4710. player.pathY[i31] -= j21;
  4711. }
  4712. player.currentX -= i17 * 128;
  4713. player.currentY -= j21 * 128;
  4714. }
  4715. }
  4716. aBoolean1080 = true;
  4717. byte byte1 = 0;
  4718. byte byte2 = 104;
  4719. byte byte3 = 1;
  4720. if (i17 < 0) {
  4721. byte1 = 103;
  4722. byte2 = -1;
  4723. byte3 = -1;
  4724. }
  4725. byte byte4 = 0;
  4726. byte byte5 = 104;
  4727. byte byte6 = 1;
  4728. if (j21 < 0) {
  4729. byte4 = 103;
  4730. byte5 = -1;
  4731. byte6 = -1;
  4732. }
  4733. for (int k33 = byte1; k33 != byte2; k33 += byte3) {
  4734. for (int l33 = byte4; l33 != byte5; l33 += byte6) {
  4735. int i34 = k33 + i17;
  4736. int j34 = l33 + j21;
  4737. for (int k34 = 0; k34 < 4; k34++) {
  4738. if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104) {
  4739. groundEntity[k34][k33][l33] = groundEntity[k34][i34][j34];
  4740. } else {
  4741. groundEntity[k34][k33][l33] = null;
  4742. }
  4743. }
  4744. }
  4745. }
  4746. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179.head(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  4747. .next()) {
  4748. class30_sub1_1.anInt1297 -= i17;
  4749. class30_sub1_1.anInt1298 -= j21;
  4750. if (class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104
  4751. || class30_sub1_1.anInt1298 >= 104) {
  4752. class30_sub1_1.remove();
  4753. }
  4754. }
  4755. if (destX != 0) {
  4756. destX -= i17;
  4757. destY -= j21;
  4758. }
  4759. cameraMovement = false;
  4760. }
  4761.  
  4762. public ScriptManager scriptManager;
  4763.  
  4764. public int getRegionId() {
  4765. int localX = this.localX / 8;
  4766. int localY = this.localY / 8;
  4767. int id = (localX << 8) + localY;
  4768. return id;
  4769. }
  4770.  
  4771. public void resetMap() {
  4772. currentSound = 0;
  4773. setNorth();
  4774. minimapState = 0;
  4775. loadingStage = 1;
  4776. }
  4777.  
  4778. public void resetLast() {
  4779. aBoolean1080 = false;
  4780. }
  4781.  
  4782. @SuppressWarnings("unused")
  4783. private void startWorld(boolean isNull) {
  4784. xCameraPos = 6100;
  4785. yCameraPos = 6867;
  4786. zCameraPos = -750;
  4787. xCameraCurve = 2040;
  4788. yCameraCurve = 383;
  4789. resetMap();
  4790. if (isNull || scriptManager == null) {
  4791. scriptManager = new ScriptManager(this);
  4792. } else {
  4793. scriptManager.update();
  4794. }
  4795. plane = scriptManager.mapZ;
  4796. loadMap(scriptManager.mapX, scriptManager.mapY);
  4797. resetLast();
  4798. }
  4799.  
  4800. public void setNorth() {
  4801. cameraOffsetX = 0;
  4802. cameraOffsetY = 0;
  4803. viewRotationOffset = 0;
  4804. viewRotation = 0;
  4805. minimapRotation = 0;
  4806. minimapZoom = 0;
  4807. }
  4808.  
  4809. public int[] titleScreenOffsets = null;
  4810. public int titleWidth = -1;
  4811. public int titleHeight = -1;
  4812. public final int LOGIN = 0;
  4813. public final int CREATE = 1;
  4814. public final int RECOVER = 2;
  4815. public int[] alpha = { 0, 0, 0, 0, 0, 0 };
  4816. public boolean[] increasing = { false, false, false, false, false, false };
  4817. public int optionsHeight = 25;
  4818. public int[] optionsAlpha = { 0, 0, 0, 0, 0 };
  4819. public int[] linkColor = { 0xffffff, 0xffff00 };
  4820. public int accountsX = 0;
  4821. public int messageX = 0;
  4822. public int messageY = 0;
  4823. public int messageWidth = 0;
  4824. public int messageHeight = 0;
  4825. public int messageAlpha = 0;
  4826. public int titleHover = -1;
  4827. public int screenHover = -1;
  4828. public int detailHover = -1;
  4829. public int accountHover = -1;
  4830. public int editHover = -1;
  4831. public boolean editAccounts = false;
  4832. public int bannerAlpha = 0;
  4833.  
  4834. /**
  4835. * Handles the "glowing" of images on the title screen.
  4836. *
  4837. * @param position
  4838. */
  4839. public void handleGlow(int position) {
  4840. int x = (getClientWidth() / 2) - (box[0].myWidth / 2);
  4841. int y = (getClientHeight() / 2) - (box[0].myHeight / 2);
  4842. int[] rate = new int[] { 24, 8 };
  4843. if (position == 0) {
  4844. if (mouseInRegion(x + 308, x + 308 + play.myWidth, y + 62, y + 62 + play.myHeight)) {
  4845. alpha[0] += alpha[0] < 256 ? rate[0] : 0;
  4846. } else {
  4847. alpha[0] -= alpha[0] > 0 ? rate[0] : 0;
  4848. }
  4849. play_hover.drawARGBImage(x + 308, y + 62, alpha[0]);
  4850. } else if (position == 1) {
  4851. int max = 100;
  4852. int inputrate = 2;
  4853. if (alpha[loginScreenCursorPos + 2] < max && increasing[loginScreenCursorPos + 2]) {
  4854. alpha[loginScreenCursorPos + 2] += inputrate;
  4855. }
  4856. if (alpha[loginScreenCursorPos + 2] == max) {
  4857. increasing[loginScreenCursorPos + 2] = false;
  4858. }
  4859. if (alpha[loginScreenCursorPos + 2] > max) {
  4860. alpha[loginScreenCursorPos + 2] = max;
  4861. }
  4862. if (alpha[loginScreenCursorPos + 2] > 0 && !increasing[loginScreenCursorPos + 2]) {
  4863. alpha[loginScreenCursorPos + 2] -= inputrate;
  4864. }
  4865. if (alpha[loginScreenCursorPos + 2] <= 0) {
  4866. increasing[loginScreenCursorPos + 2] = true;
  4867. alpha[loginScreenCursorPos + 2] = 0;
  4868. }
  4869. int inputX = (getClientWidth() / 2) - (input.myWidth / 2);
  4870. DrawingArea.drawFilledPixels(inputX, y + 63 + (loginScreenCursorPos == 0 ? 0 : 52), input.myWidth, input.myHeight, 0,
  4871. alpha[loginScreenCursorPos + 2]);
  4872. } else if (position == 2) {
  4873. int index = 4;
  4874. if (alpha[index] < 256 && increasing[index]) {
  4875. alpha[index] += rate[1];
  4876. }
  4877. if (alpha[index] == 256) {
  4878. increasing[index] = false;
  4879. }
  4880. if (alpha[index] > 0 && !increasing[index]) {
  4881. alpha[index] -= rate[1];
  4882. }
  4883. if (alpha[index] <= 0) {
  4884. increasing[index] = true;
  4885. alpha[index] = 0;
  4886. }
  4887. int formY = (getClientHeight() / 2) - (box[1].myHeight / 2);
  4888. if (getCreate().canCreate()) {
  4889. header_glow.drawARGBImage(x + 69, formY, alpha[index]);
  4890. arial[0].drawStringCenter("(click here)", x + 150, formY + 33, 0xffffff, true);
  4891. }
  4892. } else if (position == 3) {
  4893. int index = 5;
  4894. if (alpha[index] < 256 && increasing[index]) {
  4895. alpha[index] += rate[1];
  4896. }
  4897. if (alpha[index] == 256) {
  4898. increasing[index] = false;
  4899. }
  4900. if (alpha[index] > 0 && !increasing[index]) {
  4901. alpha[index] -= rate[1];
  4902. }
  4903. if (alpha[index] <= 0) {
  4904. increasing[index] = true;
  4905. alpha[index] = 0;
  4906. }
  4907. if (getRecovery().canRecover()) {
  4908. header_glow.drawARGBImage(x + 69, y, alpha[index]);
  4909. arial[0].drawStringCenter("(click here)", x + 150, y + 33, 0xffffff, true);
  4910. }
  4911. }
  4912. }
  4913.  
  4914. /**
  4915. * Displays the client options tab and the client options.
  4916. */
  4917. public void displayOptions() {
  4918. int x = (getClientWidth() / 2) - (box[0].myWidth / 2);
  4919. int y = (getClientHeight() / 2) - (box[0].myHeight / 2);
  4920. int min = 25;
  4921. int max = 150;
  4922. if (titleHover == 1) {
  4923. if (optionsHeight < max) {
  4924. optionsHeight += 7;
  4925. }
  4926. if (optionsHeight > max) {
  4927. optionsHeight = max;
  4928. }
  4929. } else {
  4930. if (optionsHeight > min) {
  4931. optionsHeight -= 7;
  4932. }
  4933. if (optionsHeight < min) {
  4934. optionsHeight = min;
  4935. }
  4936. }
  4937. DrawingArea.drawRoundedRectangle(x + 20, y + 180, 322, optionsHeight, 0xFFFFFF, 50, true, false);
  4938. DrawingArea.drawRoundedRectangle(x + 20, y + 180, 322, optionsHeight, 0xFFFFFF, 50, false, false);
  4939. arial[2].drawStringCenter("Client Options", x + 20 + (322 / 2), y + 197, 0xffffff, true);
  4940. if (optionsHeight == max) {
  4941. int[] screen_x = { x + (322 / 2) - 45, x + 20 + (322 / 2), x + 85 + (322 / 2) };
  4942. if (screenHover != -1) {
  4943. optionsAlpha[screenHover] += optionsAlpha[screenHover] < 256 ? 24 : 0;
  4944. } else {
  4945. optionsAlpha[0] -= optionsAlpha[0] > 0 ? 24 : 0;
  4946. optionsAlpha[1] -= optionsAlpha[1] > 0 ? 24 : 0;
  4947. optionsAlpha[2] -= optionsAlpha[2] > 0 ? 24 : 0;
  4948. }
  4949. for (int index = 0; index <= 2; index++) {
  4950. screen_dull[index].drawCenteredImage(screen_x[index], y + 226);
  4951. screen_selected[index].drawCenteredImage(screen_x[index], y + 226, optionsAlpha[index]);
  4952. }
  4953. screen_selected[clientSize].drawCenteredImage(screen_x[clientSize], y + 226);
  4954. int[] detail_x = { x + 85, x + 200 };
  4955. if (detailHover != -1) {
  4956. optionsAlpha[detailHover + 3] += optionsAlpha[detailHover + 3] < 256 ? 24 : 0;
  4957. } else {
  4958. optionsAlpha[3] -= optionsAlpha[3] > 0 ? 24 : 0;
  4959. optionsAlpha[4] -= optionsAlpha[4] > 0 ? 24 : 0;
  4960. }
  4961. detail_dull[0].drawARGBImage(detail_x[0], y + 260);
  4962. detail_dull[1].drawARGBImage(detail_x[1], y + 260);
  4963. detail_hover[0].drawARGBImage(detail_x[0], y + 260, optionsAlpha[3]);
  4964. detail_hover[1].drawARGBImage(detail_x[1], y + 260, optionsAlpha[4]);
  4965. int detail = lowMemory ? 0 : 1;
  4966. detail_selected[detail].drawARGBImage(detail_x[detail], y + 260);
  4967. }
  4968. }
  4969.  
  4970. public int accountsWidth = 250;
  4971.  
  4972. /**
  4973. * Displays the accounts tab and the list of accounts.
  4974. */
  4975. public void displayAccounts() {
  4976. int x = (getClientWidth() / 2) - (box[0].myWidth / 2) + 5;
  4977. int y = (getClientHeight() / 2) - (box[0].myHeight / 2) + 25;
  4978. int min = 0;
  4979. int max = 125;
  4980. if (titleHover == 2) {
  4981. if (accountsX < max) {
  4982. accountsX += 7;
  4983. }
  4984. if (accountsX > max) {
  4985. accountsX = max;
  4986. }
  4987. } else {
  4988. if (accountsX > min) {
  4989. accountsX -= 7;
  4990. }
  4991. if (accountsX < min) {
  4992. accountsX = min;
  4993. }
  4994. }
  4995. accountsWidth = accountsX + 15;
  4996. int width = accountsWidth + 9;
  4997. accountbox.cutImage(box[2], width, accountbox.myHeight);
  4998. if (accountbox != null) {
  4999. accountbox.drawARGBImage(x - 9 - accountsX, y - 9);
  5000. }
  5001. if (accountsX == max) {
  5002. arial[1].drawString("Accounts (" + AccountHandler.getAccounts().size() + " / 6) " + (editAccounts ? "[finish]" : "[edit]"), x
  5003. - accountsX + 5, y + 15, editHover == 0 ? 0xffff00 : 0xffffff, true);
  5004. int text_x = x - accountsX + 72;
  5005. int text_y = y + 35;
  5006. if (AccountHandler.accounts != null) {
  5007. for (int index = 0; index < 6; index++, text_y += 17) {
  5008. if (index >= AccountHandler.getAccounts().size())
  5009. break;
  5010. Account account = AccountHandler.getAccounts().get(index);
  5011. if (account != null) {
  5012. arial[1].drawStringCenter(account.name + " (" + account.uses + " use" + (account.uses > 1 ? "s" : "") + ")"
  5013. + (editAccounts ? " [x]" : ""), text_x, text_y,
  5014. accountHover == index ? (editAccounts ? 0xff0000 : 0xffff00) : 0xffffff, true);
  5015. }
  5016. }
  5017. }
  5018. }
  5019. }
  5020.  
  5021. /**
  5022. * Displays the login messages (errors, problems, missing info, etc).
  5023. */
  5024. public void displayMessages() {
  5025. int width = 300;
  5026. int height = 50;
  5027. int x = (getClientWidth() / 2) - (width / 2);
  5028. int y = (getClientHeight() / 2) - (height / 2);
  5029. int center_x = (getClientWidth() / 2);
  5030. int center_y = (getClientHeight() / 2);
  5031. int alpha_rate = 10;
  5032. int alpha_max = 100;
  5033. int x_max = (width / 2);
  5034. int y_max = (height / 2);
  5035. DrawingArea.drawFilledPixels(0, 0, getClientWidth(), getClientHeight(), 0, messageAlpha * 2);
  5036. DrawingArea.drawRoundedRectangle(center_x - messageX, center_y - messageY, messageWidth, messageHeight, 0xFFFFFF, messageAlpha,
  5037. true, false);
  5038. DrawingArea.drawRoundedRectangle(center_x - messageX, center_y - messageY, messageWidth, messageHeight, 0xFFFFFF, messageAlpha,
  5039. false, false);
  5040. if (loginMessage1.length() > 0 || loginMessage2.length() > 0) {
  5041. if (messageAlpha < alpha_max) {
  5042. messageAlpha += alpha_rate;
  5043. }
  5044. if (messageAlpha > alpha_max) {
  5045. messageAlpha = alpha_max;
  5046. }
  5047. if (messageX < x_max) {
  5048. messageX += 10;
  5049. }
  5050. if (messageY < y_max) {
  5051. messageY += 5;
  5052. }
  5053. if (messageWidth < width) {
  5054. messageWidth += 20;
  5055. }
  5056. if (messageHeight < height) {
  5057. messageHeight += 5;
  5058. }
  5059. if (messageAlpha == alpha_max) {
  5060. close[titleHover == 3 ? 1 : 0].drawImage(x + width - 16, y);
  5061. if (loginMessage2.length() > 0) {
  5062. arial[2].drawStringCenter(loginMessage1, center_x, center_y - 3, 0xffffff, true);
  5063. arial[2].drawStringCenter(loginMessage2, center_x, center_y + 12, 0xffffff, true);
  5064. } else {
  5065. arial[2].drawStringCenter(loginMessage1, center_x, center_y + 5, 0xffffff, true);
  5066. }
  5067. }
  5068. } else {
  5069. if (messageAlpha > 0) {
  5070. messageAlpha -= alpha_rate;
  5071. }
  5072. if (messageAlpha < 0) {
  5073. messageAlpha = 0;
  5074. }
  5075. if (messageX > 0) {
  5076. messageX -= 10;
  5077. }
  5078. if (messageY > 0) {
  5079. messageY -= 5;
  5080. }
  5081. if (messageWidth > 0) {
  5082. messageWidth -= 20;
  5083. }
  5084. if (messageHeight > 0) {
  5085. messageHeight -= 5;
  5086. }
  5087. }
  5088. }
  5089.  
  5090. public RealFont[] arial = { new RealFont(this, "Arial", 0, 10, true), new RealFont(this, "Arial", 0, 12, true),
  5091. new RealFont(this, "Arial", 0, 14, true), new RealFont(this, "Arial", 1, 14, true) };
  5092. int[] backgroundColors = { 0xFF00FF, 0x00FF00, 0xFF0000, 0x0000FF, 0xFFFF00, 0xFFF000, 0x0F0F0F };
  5093. int[] backgroundAlpha;
  5094. boolean[] backgroundDrawing;
  5095. boolean[] alphaIncreasing;
  5096.  
  5097. public void resetBackground() {
  5098. backgroundAlpha = new int[backgroundColors.length];
  5099. backgroundDrawing = new boolean[backgroundColors.length];
  5100. alphaIncreasing = new boolean[backgroundColors.length];
  5101. for (int index = 0; index < backgroundColors.length; index++) {
  5102. backgroundAlpha[index] = 0;
  5103. backgroundDrawing[index] = false;
  5104. alphaIncreasing[index] = true;
  5105. }
  5106. }
  5107.  
  5108. public void displayBackground() {
  5109. int rate = 1;
  5110. int total = backgroundColors.length;
  5111. int index = 0;
  5112. int max = 256;
  5113. for (; index < total; index++) {
  5114. if (backgroundDrawing[index] || index == 0) {
  5115. if (backgroundAlpha[index] < max && alphaIncreasing[index]) {
  5116. backgroundAlpha[index] += rate;
  5117. }
  5118. if (backgroundAlpha[index] == max) {
  5119. alphaIncreasing[index] = false;
  5120. if (index < total - 1) {
  5121. backgroundDrawing[index + 1] = true;
  5122. } else {
  5123. resetBackground();
  5124. index = 0;
  5125. }
  5126. }
  5127. if (backgroundAlpha[index] > 0 && !alphaIncreasing[index]) {
  5128. backgroundAlpha[index] -= rate;
  5129. }
  5130. if (backgroundAlpha[index] <= 0) {
  5131. alphaIncreasing[index] = true;
  5132. backgroundAlpha[index] = 0;
  5133. backgroundDrawing[index] = false;
  5134. }
  5135. DrawingArea.drawFilledPixels(0, 0, getClientWidth(), getClientHeight(), backgroundColors[index], backgroundAlpha[index]);
  5136. }
  5137. }
  5138. }
  5139.  
  5140. @SuppressWarnings("unused")
  5141. private RSImage[] background;
  5142. private RSImage[] greyBackground;
  5143. private RSImage[] fullscreenBackground;
  5144. private RSImage[] fullscreenGreyBackground;
  5145.  
  5146. public int maxLines = 6;
  5147. public int lineCount;
  5148. public RSImage[] lineSegments;
  5149. public int[] lineX;
  5150. public int[] lineY;
  5151. public int[] lineRate;
  5152. public boolean[] reverseMovement;
  5153.  
  5154. public void createLines() {
  5155. lineCount = (maxLines / 2) + Misc.random(maxLines / 2);
  5156. lineSegments = new RSImage[lineCount];
  5157. lineX = new int[lineCount];
  5158. lineY = new int[lineCount];
  5159. lineRate = new int[lineCount];
  5160. reverseMovement = new boolean[lineCount];
  5161. for (int index = 0; index < lineCount; index++) {
  5162. lineRate[index] = -1;
  5163. }
  5164. }
  5165.  
  5166. public void resetLine(int index) {
  5167. int centerY = getClientHeight() / 2;
  5168. lineSegments[index] = lines[0];
  5169. lineX[index] = 0;
  5170. lineY[index] = centerY - 50 + Misc.random(100);
  5171. lineRate[index] = 1 + Misc.random(3);
  5172. reverseMovement[index] = false;
  5173. }
  5174.  
  5175. public void displayLines() {
  5176. for (int index = 0; index < lineCount; index++) {
  5177. if (lineRate[index] == -1) {
  5178. resetLine(index);
  5179. }
  5180. int minX = -(lineSegments[index].myWidth - clientWidth);
  5181. if (lineX[index] <= minX) {
  5182. reverseMovement[index] = true;
  5183. }
  5184. if (lineX[index] >= 0) {
  5185. reverseMovement[index] = false;
  5186. }
  5187. if (!reverseMovement[index] && lineX[index] > minX) {
  5188. lineX[index] -= lineRate[index];
  5189. }
  5190. if (reverseMovement[index] && lineX[index] < 0) {
  5191. lineX[index] += lineRate[index];
  5192. }
  5193. if (lineSegments[index] != null) {
  5194. lineSegments[index].drawARGBImage(lineX[index], lineY[index], 200);
  5195. }
  5196. }
  5197. }
  5198.  
  5199. public int maxDots = 30;
  5200. public int focusCount;
  5201. public RSImage[] focusImage;
  5202. public int[] focusX;
  5203. public int[] focusY;
  5204. public int[] focusRate;
  5205. public int[] focusDeviation;
  5206. public int[] focusCycle;
  5207. public int[] focusHeight;
  5208.  
  5209. public void createFocus() {
  5210. focusCount = (maxDots / 2) + Misc.random(maxDots / 2);
  5211. focusImage = new RSImage[focusCount];
  5212. focusX = new int[focusCount];
  5213. focusY = new int[focusCount];
  5214. focusRate = new int[focusCount];
  5215. focusDeviation = new int[focusCount];
  5216. focusCycle = new int[focusCount];
  5217. focusHeight = new int[focusCount];
  5218. for (int index = 0; index < focusCount; index++) {
  5219. focusRate[index] = -1;
  5220. }
  5221. }
  5222.  
  5223. public void resetFocus(int index) {
  5224. focusImage[index] = focusDots[Misc.random(focusDots.length - 1)];
  5225. focusX[index] = Misc.random(clientWidth);
  5226. focusY[index] = clientHeight + 50 + (Misc.random(100));
  5227. focusRate[index] = 1 + Misc.random(1);
  5228. int random = Misc.random(40);
  5229. focusDeviation[index] = (Misc.random(1) == 0 ? random : -random);
  5230. focusCycle[index] = 0;
  5231. focusHeight[index] = focusImage[index].myHeight;
  5232. }
  5233.  
  5234. public int getFocusX(int index) {
  5235. int limit = focusX[index] + focusDeviation[index];
  5236. int scale = 765 / 40;
  5237. if (focusDeviation[index] != 0) {
  5238. scale = (clientHeight / Math.abs(focusDeviation[index]));
  5239. }
  5240. focusCycle[index]++;
  5241. if (focusDeviation[index] >= 0) {
  5242. if (focusCycle[index] == scale) {
  5243. focusCycle[index] = 0;
  5244. }
  5245. if (focusX[index] < limit && focusCycle[index] == 0) {
  5246. focusX[index] += 1;
  5247. }
  5248. }
  5249. if (focusDeviation[index] < 0) {
  5250. if (focusCycle[index] == scale) {
  5251. focusCycle[index] = 0;
  5252. }
  5253. if (focusX[index] > limit && focusCycle[index] == 0) {
  5254. focusX[index] -= 1;
  5255. }
  5256. }
  5257. return focusX[index];
  5258. }
  5259.  
  5260. public void displayFocus() {
  5261. for (int index = 0; index < focusCount; index++) {
  5262. if (focusRate[index] == -1) {
  5263. resetFocus(index);
  5264. }
  5265. if (focusY[index] > -(focusImage[index].myHeight)) {
  5266. focusY[index] -= focusRate[index];
  5267. } else {
  5268. resetFocus(index);
  5269. }
  5270. if (focusImage[index] != null) {
  5271. focusImage[index].drawARGBImage(getFocusX(index), focusY[index]);
  5272. }
  5273. }
  5274. }
  5275.  
  5276. public boolean showTweet = false;
  5277. public int tweetHeight = 0;
  5278. public String[] tweet;
  5279.  
  5280. public void displayTweet() {
  5281.  
  5282. }
  5283.  
  5284. public void drawDisplayButton() {
  5285. int x = 0;
  5286. int y = clientHeight - display.myHeight;
  5287. if (worldImage != null) {
  5288. worldImage.drawImage(x + 14, y + 14);
  5289. }
  5290. display.drawARGBImage(x, y);
  5291.  
  5292. if (!mouseInRegion(x + 14, x + 114, y + 14, y + 79)) {
  5293. DrawingArea.drawFilledPixels(x + 14, y + 14, 100, 65, 0, 50);
  5294. }
  5295. }
  5296.  
  5297. public boolean newmouseInRegion(int x1, int y1, RSImage drawnSprite) {
  5298. if (super.getMouseX() >= x1 && super.getMouseX() <= x1 + drawnSprite.myWidth && super.getMouseY() >= y1
  5299. && super.getMouseY() <= y1 + drawnSprite.myHeight)
  5300. return true;
  5301. return false;
  5302. }
  5303.  
  5304. public boolean newclickInRegion(int x1, int y1, RSImage drawnSprite) {
  5305. if (super.saveClickX >= x1 && super.saveClickX <= x1 + drawnSprite.myWidth && super.saveClickY >= y1
  5306. && super.saveClickY <= y1 + drawnSprite.myHeight)
  5307. return true;
  5308. return false;
  5309. }
  5310.  
  5311. public static void drawTooltip(int x, int y, String[] text, int info, int colour) {
  5312. if (text != null) {
  5313. int width = 0;
  5314.  
  5315. for (String element : text) {
  5316. if (newRegularFont.getTextWidth(element) > width) {
  5317. width = newRegularFont.getTextWidth(element) + 10;
  5318. }
  5319. }
  5320. int height = (text.length * 15) + 8;
  5321. DrawingArea.drawRoundedRectangle(x, y, width, height, 0, 150, true, false);
  5322.  
  5323. for (int index = 0; index < text.length; index++) {
  5324. newRegularFont.drawBasicString(text[index], x + 5, y + 15 + (15 * index), colour, 0);
  5325. }
  5326. }
  5327. }
  5328.  
  5329. private void processLoginScreenInput() {
  5330. int x = (getClientWidth() / 2) - (RSImageLoader.images[1023].myWidth / 2);
  5331. int y = (getClientHeight() / 2) - (RSImageLoader.images[1023].myHeight / 2);
  5332. if (loginScreenState == LOGIN) {
  5333. if (clickMode2 == 1 && newclickInRegion(x + 85, y + 180, RSImageLoader.images[1027])) {
  5334. loginScreenCursorPos = 0;
  5335. }
  5336. if (clickMode2 == 1 && newclickInRegion(x + 85, y + 250, RSImageLoader.images[1027])) {
  5337. loginScreenCursorPos = 1;
  5338. }
  5339. if (clickMode2 == 1 && newclickInRegion(x + 110, y + 350, RSImageLoader.images[1030])) {
  5340. selectedSlot = 1;
  5341. if (((String) LoginSettings.getSetting("SU1")).equalsIgnoreCase("blank")
  5342. && ((String) LoginSettings.getSetting("SP1")).equalsIgnoreCase("blank")) {
  5343. loginMessage1 = "Player Slot 1 is empty !";
  5344. loginMessage2 = "Type an username and password and then hit Save";
  5345. } else {
  5346. myUsername = ((String) LoginSettings.getSetting("SU1"));
  5347. myPassword = ((String) LoginSettings.getSetting("SP1"));
  5348. loginMessage1 = "You have Loaded in: " + myUsername;
  5349. loginMessage2 = "";
  5350. }
  5351. }
  5352. if (clickMode2 == 1 && newclickInRegion(x + 170, y + 350, RSImageLoader.images[1030])) {
  5353. selectedSlot = 2;
  5354. if (((String) LoginSettings.getSetting("SU2")).equalsIgnoreCase("blank")
  5355. && ((String) LoginSettings.getSetting("SP2")).equalsIgnoreCase("blank")) {
  5356. loginMessage1 = "Player Slot 2 is empty !";
  5357. loginMessage2 = "Type an username and password and then hit Save";
  5358. } else {
  5359. myUsername = ((String) LoginSettings.getSetting("SU2"));
  5360. myPassword = ((String) LoginSettings.getSetting("SP2"));
  5361. loginMessage1 = "You have Loaded in: " + myUsername;
  5362. loginMessage2 = "";
  5363. }
  5364. }
  5365. if (clickMode2 == 1 && newclickInRegion(x + 230, y + 350, RSImageLoader.images[1030])) {
  5366. selectedSlot = 3;
  5367. if (((String) LoginSettings.getSetting("SU3")).equalsIgnoreCase("blank")
  5368. && ((String) LoginSettings.getSetting("SP3")).equalsIgnoreCase("blank")) {
  5369. loginMessage1 = "Player Slot 3 is empty !";
  5370. loginMessage2 = "Type an username and password and then hit Save";
  5371. } else {
  5372. myUsername = ((String) LoginSettings.getSetting("SU3"));
  5373. myPassword = ((String) LoginSettings.getSetting("SP3"));
  5374. loginMessage1 = "You have Loaded in: " + myUsername;
  5375. loginMessage2 = "";
  5376. }
  5377. }
  5378. if (clickMode2 == 1 && newclickInRegion(x + 290, y + 350, RSImageLoader.images[1030])) {
  5379. selectedSlot = 4;
  5380. if (((String) LoginSettings.getSetting("SU4")).equalsIgnoreCase("blank")
  5381. && ((String) LoginSettings.getSetting("SP4")).equalsIgnoreCase("blank")) {
  5382. loginMessage1 = "Player Slot 4 is empty !";
  5383. loginMessage2 = "Type an username and password and then hit Save";
  5384. } else {
  5385. myUsername = ((String) LoginSettings.getSetting("SU4"));
  5386. myPassword = ((String) LoginSettings.getSetting("SP4"));
  5387. loginMessage1 = "You have Loaded in: " + myUsername;
  5388. loginMessage2 = "";
  5389. }
  5390. }
  5391. if (clickMode2 == 1 && newclickInRegion(x + 345, y + 373, RSImageLoader.images[1033])) {
  5392. if (selectedSlot == 1) {
  5393. LoginSettings.changeSetting("SU1", ((String) "blank"));
  5394. LoginSettings.changeSetting("SP1", ((String) "blank"));
  5395. myUsername = "";
  5396. myPassword = "";
  5397. } else if (selectedSlot == 2) {
  5398. LoginSettings.changeSetting("SU2", ((String) "blank"));
  5399. LoginSettings.changeSetting("SP2", ((String) "blank"));
  5400. myUsername = "";
  5401. myPassword = "";
  5402. } else if (selectedSlot == 3) {
  5403. LoginSettings.changeSetting("SU3", ((String) "blank"));
  5404. LoginSettings.changeSetting("SP3", ((String) "blank"));
  5405. myUsername = "";
  5406. myPassword = "";
  5407. } else if (selectedSlot == 4) {
  5408. LoginSettings.changeSetting("SU4", ((String) "blank"));
  5409. LoginSettings.changeSetting("SP4", ((String) "blank"));
  5410. myUsername = "";
  5411. myPassword = "";
  5412. }
  5413. }
  5414. if (clickMode2 == 1 && newclickInRegion(x + 345, y + 350, RSImageLoader.images[1033])) {
  5415. if (selectedSlot == 1) {
  5416. if (myUsername.equals("") && myPassword.equals("")) {
  5417. loginMessage1 = "Enter a User & Pass!";
  5418. loginMessage2 = "";
  5419. } else if (myUsername.equals("")) {
  5420. loginMessage2 = "Enter a Username!";
  5421. loginMessage2 = "";
  5422. } else if (myPassword.equals("")) {
  5423. loginMessage1 = "Enter a Password!";
  5424. loginMessage2 = "";
  5425. } else {
  5426. LoginSettings.changeSetting("SU1", ((String) myUsername));
  5427. LoginSettings.changeSetting("SP1", ((String) myPassword));
  5428. loginMessage1 = "Player Slot 1 has been saved";
  5429. loginMessage2 = "";
  5430. }
  5431. } else if (selectedSlot == 2) {
  5432. if (myUsername.equals("") && myPassword.equals("")) {
  5433. loginMessage1 = "Enter a User & Pass!";
  5434. loginMessage2 = "";
  5435. } else if (myUsername.equals("")) {
  5436. loginMessage2 = "Enter a Username!";
  5437. loginMessage2 = "";
  5438. } else if (myPassword.equals("")) {
  5439. loginMessage1 = "Enter a Password!";
  5440. loginMessage2 = "";
  5441. } else {
  5442. LoginSettings.changeSetting("SU2", ((String) myUsername));
  5443. LoginSettings.changeSetting("SP2", ((String) myPassword));
  5444. loginMessage1 = "Player Slot 2 has been saved";
  5445. loginMessage2 = "";
  5446. }
  5447. } else if (selectedSlot == 3) {
  5448. if (myUsername.equals("") && myPassword.equals("")) {
  5449. loginMessage1 = "Enter a User & Pass!";
  5450. loginMessage2 = "";
  5451. } else if (myUsername.equals("")) {
  5452. loginMessage2 = "Enter a Username!";
  5453. loginMessage2 = "";
  5454. } else if (myPassword.equals("")) {
  5455. loginMessage1 = "Enter a Password!";
  5456. loginMessage2 = "";
  5457. } else {
  5458. LoginSettings.changeSetting("SU3", ((String) myUsername));
  5459. LoginSettings.changeSetting("SP3", ((String) myPassword));
  5460. loginMessage1 = "Player Slot 3 has been saved";
  5461. loginMessage2 = "";
  5462. }
  5463. } else if (selectedSlot == 4) {
  5464. if (myUsername.equals("") && myPassword.equals("")) {
  5465. loginMessage1 = "Enter a User & Pass!";
  5466. loginMessage2 = "";
  5467. } else if (myUsername.equals("")) {
  5468. loginMessage2 = "Enter a Username!";
  5469. loginMessage2 = "";
  5470. } else if (myPassword.equals("")) {
  5471. loginMessage1 = "Enter a Password!";
  5472. loginMessage2 = "";
  5473. } else {
  5474. LoginSettings.changeSetting("SU4", ((String) myUsername));
  5475. LoginSettings.changeSetting("SP4", ((String) myPassword));
  5476. loginMessage1 = "Player Slot 4 has been saved";
  5477. loginMessage2 = "";
  5478. }
  5479. }
  5480. }
  5481. if (checkDetails() && super.clickMode3 == 1 && newclickInRegion(x + 175, y + 290, RSImageLoader.images[1025])) {
  5482. getCreate().created = false;
  5483. loginFailures = 0;
  5484. login(getUsername(), myPassword, false, false);
  5485. if (loggedIn) {
  5486. return;
  5487. }
  5488. }
  5489. do {
  5490. int key = readCharacter();
  5491. if (key == -1) {
  5492. break;
  5493. }
  5494. boolean validKey = false;
  5495. for (int index = 0; index < validUserPassChars.length(); index++) {
  5496. if (key != validUserPassChars.charAt(index)) {
  5497. continue;
  5498. }
  5499. validKey = true;
  5500. break;
  5501. }
  5502. if (loginScreenCursorPos == 0) {
  5503. if (key == 8 && getUsername().length() > 0) {
  5504. setUsername(myUsername.substring(0, myUsername.length() - 1));
  5505. }
  5506. if (key == 9 || key == 10 || key == 13) {
  5507. loginScreenCursorPos = 1;
  5508. }
  5509. if (validKey) {
  5510. setUsername(myUsername + (char) key);
  5511. }
  5512. if (getUsername().length() > 12) {
  5513. setUsername(myUsername.substring(0, 12));
  5514. }
  5515. } else if (loginScreenCursorPos == 1) {
  5516. if (key == 8 && myPassword.length() > 0) {
  5517. myPassword = myPassword.substring(0, myPassword.length() - 1);
  5518. }
  5519. if (key == 9) {
  5520. loginScreenCursorPos = 0;
  5521. }
  5522. if (key == 10 || key == 13) {
  5523. getCreate().created = false;
  5524. loginFailures = 0;
  5525. login(getUsername(), myPassword, false, false);
  5526. if (loggedIn) {
  5527. return;
  5528. }
  5529. }
  5530. if (validKey) {
  5531. myPassword += (char) key;
  5532. }
  5533. if (myPassword.length() > 20) {
  5534. myPassword = myPassword.substring(0, 20);
  5535. }
  5536. }
  5537. } while (true);
  5538. return;
  5539. }
  5540. }
  5541.  
  5542. public int selectedSlot;
  5543.  
  5544. public boolean rsStatus;
  5545.  
  5546. private void displayTitleScreen(boolean hideButtons) {
  5547. int x = (getClientWidth() / 2) - (RSImageLoader.images[1023].myWidth / 2);
  5548. int y = (getClientHeight() / 2) - (RSImageLoader.images[1023].myHeight / 2);
  5549. int centerX = getClientWidth() / 2;
  5550. @SuppressWarnings("unused")
  5551. int centerY = getClientHeight() / 2;
  5552. resetImageProducers();
  5553. title.create();
  5554. if (loginScreenState == LOGIN) {
  5555. RSImageLoader.images[981].drawARGBImage(0, 0);
  5556. RSImageLoader.images[1023].drawAdvancedSprite(x - 15, y);
  5557. RSImageLoader.images[1027].drawHoverSprite(x + 85, y + 180, RSImageLoader.images[1028]); // User Feild
  5558. RSImageLoader.images[1027].drawTooltip(x + 85, y + 180, RSImageLoader.images[1028], new String[] { "Enter Your Username" },
  5559. 0xF3B13F); // User Tooltip
  5560. RSImageLoader.images[1027].drawHoverSprite(x + 85, y + 250, RSImageLoader.images[1028]); // Password Feild
  5561. RSImageLoader.images[1027].drawTooltip(x + 85, y + 250, RSImageLoader.images[1028], new String[] { "Enter Your Passoword" },
  5562. 0xF3B13F); // Password Tooltip
  5563. RSImageLoader.images[1025].drawHoverSprite(x + 170, y + 290, RSImageLoader.images[1026]); // Login Box Feild
  5564.  
  5565. RSImageLoader.images[1029].drawHoverSprite(x + 110, y + 350, RSImageLoader.images[1030]); // Head 1
  5566. RSImageLoader.images[1029].drawHoverSprite(x + 170, y + 350, RSImageLoader.images[1030]); // Head 2
  5567. RSImageLoader.images[1029].drawHoverSprite(x + 230, y + 350, RSImageLoader.images[1030]); // Head 3
  5568. RSImageLoader.images[1029].drawHoverSprite(x + 290, y + 350, RSImageLoader.images[1030]); // Head 4
  5569.  
  5570. String Name1;
  5571. String Name2;
  5572. String Name3;
  5573. String Name4;
  5574.  
  5575. if (((String) LoginSettings.getSetting("SU1")).equalsIgnoreCase("blank")
  5576. && ((String) LoginSettings.getSetting("SP1")).equalsIgnoreCase("blank")) {
  5577. Name1 = "This Account Slot is Empty";
  5578. } else {
  5579. Name1 = ((String) LoginSettings.getSetting("SU1"));
  5580. }
  5581. if (((String) LoginSettings.getSetting("SU2")).equalsIgnoreCase("blank")
  5582. && ((String) LoginSettings.getSetting("SP2")).equalsIgnoreCase("blank")) {
  5583. Name2 = "This Account Slot is Empty";
  5584. } else {
  5585. Name2 = ((String) LoginSettings.getSetting("SU2"));
  5586. }
  5587. if (((String) LoginSettings.getSetting("SU3")).equalsIgnoreCase("blank")
  5588. && ((String) LoginSettings.getSetting("SP3")).equalsIgnoreCase("blank")) {
  5589. Name3 = "This Account Slot is Empty";
  5590. } else {
  5591. Name3 = ((String) LoginSettings.getSetting("SU3"));
  5592. }
  5593. if (((String) LoginSettings.getSetting("SU4")).equalsIgnoreCase("blank")
  5594. && ((String) LoginSettings.getSetting("SP4")).equalsIgnoreCase("blank")) {
  5595. Name4 = "This Account Slot is Empty";
  5596. } else {
  5597. Name4 = ((String) LoginSettings.getSetting("SU4"));
  5598. }
  5599.  
  5600. RSImageLoader.images[1029].drawTooltip(x + 110, y + 350, RSImageLoader.images[1029], new String[] { "Username: " + Name1 },
  5601. 0xF3B13F); // Head 1
  5602. RSImageLoader.images[1029].drawTooltip(x + 170, y + 350, RSImageLoader.images[1029], new String[] { "Username: " + Name2 },
  5603. 0xF3B13F); // Head 2
  5604. RSImageLoader.images[1029].drawTooltip(x + 230, y + 350, RSImageLoader.images[1029], new String[] { "Username: " + Name3 },
  5605. 0xF3B13F); // Head 3
  5606. RSImageLoader.images[1029].drawTooltip(x + 290, y + 350, RSImageLoader.images[1029], new String[] { "Username: " + Name4 },
  5607. 0xF3B13F); // Head 4
  5608.  
  5609. RSImageLoader.images[1033].drawHoverSprite(x + 345, y + 350, RSImageLoader.images[1034]); // Save
  5610. RSImageLoader.images[1031].drawHoverSprite(x + 347, y + 370, RSImageLoader.images[1032]); // Trash
  5611.  
  5612. RSImageLoader.images[1033].drawTooltip(x + 345, y + 350, RSImageLoader.images[1033],
  5613. new String[] { "Save your info in the Selected Slot" }, 0xF3B13F); // Save Button
  5614. RSImageLoader.images[1033].drawTooltip(x + 345, y + 373, RSImageLoader.images[1033],
  5615. new String[] { "Delete your player infomation" }, 0xF3B13F); // Delete Button
  5616.  
  5617. if (selectedSlot == 1) {
  5618. RSImageLoader.images[1030].drawAdvancedSprite(x + 110, y + 350);
  5619. }
  5620. if (selectedSlot == 2) {
  5621. RSImageLoader.images[1030].drawAdvancedSprite(x + 170, y + 350);
  5622. }
  5623. if (selectedSlot == 3) {
  5624. RSImageLoader.images[1030].drawAdvancedSprite(x + 230, y + 350);
  5625. }
  5626. if (selectedSlot == 4) {
  5627. RSImageLoader.images[1030].drawAdvancedSprite(x + 290, y + 350);
  5628. }
  5629.  
  5630. if (((String) LoginSettings.getSetting("SU1")).equalsIgnoreCase("blank")
  5631. && ((String) LoginSettings.getSetting("SP1")).equalsIgnoreCase("blank")) {
  5632. } else {
  5633. GetHead(1);
  5634. }
  5635. if (((String) LoginSettings.getSetting("SU2")).equalsIgnoreCase("blank")
  5636. && ((String) LoginSettings.getSetting("SP2")).equalsIgnoreCase("blank")) {
  5637. } else {
  5638. GetHead(2);
  5639. }
  5640. if (((String) LoginSettings.getSetting("SU3")).equalsIgnoreCase("blank")
  5641. && ((String) LoginSettings.getSetting("SP3")).equalsIgnoreCase("blank")) {
  5642. } else {
  5643. GetHead(3);
  5644. }
  5645. if (((String) LoginSettings.getSetting("SU4")).equalsIgnoreCase("blank")
  5646. && ((String) LoginSettings.getSetting("SP4")).equalsIgnoreCase("blank")) {
  5647. } else {
  5648. GetHead(4);
  5649. }
  5650.  
  5651. arial[2].drawString(getUsername() + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "|" : ""), centerX
  5652. - (input.myWidth / 2) + 0, y + 200, 0xffffff, true);
  5653. arial[2].drawString(TextUtils.mask(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "|" : ""), centerX
  5654. - (input.myWidth / 2) + 0, y + 270, 0xffffff, true);
  5655.  
  5656. arial[2].drawString(loginMessage1, centerX - (input.myWidth / 2) + 60, y + 420, 0xF3B13F, true);
  5657. arial[2].drawString(loginMessage2, centerX - (input.myWidth / 2) - 30, y + 440, 0xF3B13F, true);
  5658.  
  5659. }
  5660. title.drawGraphics(0, super.graphics, 0);
  5661. }
  5662.  
  5663. public void GetHead(int HeadDrawn) {
  5664.  
  5665. int x = (getClientWidth() / 2) - (RSImageLoader.images[1023].myWidth / 2);
  5666. int y = (getClientHeight() / 2) - (RSImageLoader.images[1023].myHeight / 2);
  5667. if (HeadDrawn == 1) {
  5668. RSImageLoader.images[1035].drawAdvancedSprite(x + 115, y + 355);
  5669. }
  5670. if (HeadDrawn == 2) {
  5671. RSImageLoader.images[1036].drawAdvancedSprite(x + 177, y + 355);
  5672. }
  5673. if (HeadDrawn == 3) {
  5674. RSImageLoader.images[1037].drawAdvancedSprite(x + 237, y + 357);
  5675. }
  5676. if (HeadDrawn == 4) {
  5677. RSImageLoader.images[1038].drawAdvancedSprite(x + 296, y + 356);
  5678. }
  5679. }
  5680.  
  5681. public void drawTooltip(int info, int x, int y, boolean error) {
  5682. String[] text = null;
  5683. switch (info) {
  5684. case 0:
  5685. text = error ? (loginScreenState == CREATE ? getCreate().usernameError : getRecovery().usernameError)
  5686. : (loginScreenState == CREATE ? getCreate().usernameInfo : getRecovery().usernameInfo);
  5687. break;
  5688. case 1:
  5689. text = error ? (loginScreenState == CREATE ? getCreate().passwordError : getRecovery().emailError)
  5690. : (loginScreenState == CREATE ? getCreate().passwordInfo : getRecovery().emailInfo);
  5691. break;
  5692. case 2:
  5693. text = error ? getCreate().confirmError : getCreate().confirmInfo;
  5694. break;
  5695. case 3:
  5696. text = error ? getCreate().emailError : getCreate().emailInfo;
  5697. break;
  5698. case 4:
  5699. text = error ? getCreate().referrerError : getCreate().referrerInfo;
  5700. break;
  5701. }
  5702. boolean verified = (loginScreenState == CREATE ? getCreate().verified[info] : getRecovery().verified[info]);
  5703. if (text != null || (error && verified)) {
  5704. if (error && verified) {
  5705. text = new String[] { "This field is valid." };
  5706. }
  5707. int width = 0;
  5708. for (int index = 0; index < text.length; index++) {
  5709. if (newSmallFont.getTextWidth(text[index]) > width) {
  5710. width = newSmallFont.getTextWidth(text[index]) + 10;
  5711. }
  5712. }
  5713. int height = (text.length * 15) + 8;
  5714. DrawingArea.drawRoundedRectangle(x, y, width, height, 0, 150, true, false);
  5715. for (int index = 0; index < text.length; index++) {
  5716. newSmallFont.drawBasicString(text[index], x + 5, y + 15 + (15 * index), 0xffffff, 0);
  5717. }
  5718. }
  5719. }
  5720.  
  5721. private void drawFlames() {
  5722. drawingFlames = true;
  5723. try {
  5724. long l = System.currentTimeMillis();
  5725. int i = 0;
  5726. int j = 20;
  5727. while (aBoolean831) {
  5728. anInt1208++;
  5729. if (++i > 10) {
  5730. long l1 = System.currentTimeMillis();
  5731. int k = (int) (l1 - l) / 10 - j;
  5732. j = 40 - k;
  5733. if (j < 5) {
  5734. j = 5;
  5735. }
  5736. i = 0;
  5737. l = l1;
  5738. }
  5739. try {
  5740. Thread.sleep(j);
  5741. } catch (Exception _ex) {
  5742. }
  5743. }
  5744. } catch (Exception _ex) {
  5745. }
  5746. drawingFlames = false;
  5747. }
  5748.  
  5749. public void raiseWelcomeScreen() {
  5750. welcomeScreenRaised = true;
  5751. }
  5752.  
  5753. private void updateEntity(JagexBuffer buffer, int packetId) {
  5754. if (packetId == 84) { // send ground item amount
  5755. int offset = buffer.readUnsignedByte();
  5756. int regionX = bigRegionX + (offset >> 4 & 7);
  5757. int regionY = bigRegionY + (offset & 7);
  5758. int itemId = buffer.readUnsignedShort();
  5759. int oldAmount = buffer.readUnsignedShort();
  5760. int newAmount = buffer.readUnsignedShort();
  5761. if (regionX >= 0 && regionY >= 0 && regionX < 104 && regionY < 104) {
  5762. Deque deque = groundEntity[plane][regionX][regionY];
  5763. if (deque != null) {
  5764. for (Item item = (Item) deque.head(); item != null; item = (Item) deque.next()) {
  5765. if (item.id != (itemId & 0x7fff) || item.amount != oldAmount) {
  5766. continue;
  5767. }
  5768. item.amount = newAmount;
  5769. break;
  5770. }
  5771.  
  5772. spawnGroundItem(regionX, regionY);
  5773. }
  5774. }
  5775. return;
  5776. }
  5777. if (packetId == 105) { // send sound
  5778. int firstOffset = buffer.readUnsignedByte();
  5779. int firstX = bigRegionX + (firstOffset >> 4 & 7);
  5780. int firstY = bigRegionY + (firstOffset & 7);
  5781. @SuppressWarnings("unused")
  5782. int soundId = buffer.readUnsignedShort();
  5783. int secondOffset = buffer.readUnsignedByte();
  5784. int secondX = secondOffset >> 4 & 0xf;
  5785. @SuppressWarnings("unused")
  5786. int secondY = secondOffset & 7;
  5787. if (myPlayer.pathX[0] >= firstX - secondX && myPlayer.pathX[0] <= firstX + secondX && myPlayer.pathY[0] >= firstY - secondX
  5788. && myPlayer.pathY[0] <= firstY + secondX && aBoolean848 && currentSound < 50) {
  5789. /*
  5790. * sound[currentSound] = soundId;
  5791. * soundType[currentSound] = secondY;
  5792. * soundDelay[currentSound] = Track.trackDelays[soundId];
  5793. * currentSound++;
  5794. */
  5795. }
  5796. }
  5797. if (packetId == 215) { // unsure
  5798. int id = buffer.readUnsignedLEShortA();
  5799. int offset = buffer.readUnsignedByteS();
  5800. int x = bigRegionX + (offset >> 4 & 7);
  5801. int y = bigRegionY + (offset & 7);
  5802. int playerIndex = buffer.readUnsignedLEShortA();
  5803. int amount = buffer.readUnsignedShort();
  5804. if (x >= 0 && y >= 0 && x < 104 && y < 104 && playerIndex != myPlayerId) {
  5805. Item item = new Item();
  5806. item.id = id;
  5807. item.amount = amount;
  5808. if (groundEntity[plane][x][y] == null) {
  5809. groundEntity[plane][x][y] = new Deque();
  5810. }
  5811. groundEntity[plane][x][y].append(item);
  5812. spawnGroundItem(x, y);
  5813. }
  5814. return;
  5815. }
  5816. if (packetId == 156) { // send ground item removal
  5817. int offset = buffer.readUnsignedByteA();
  5818. int x = bigRegionX + (offset >> 4 & 7);
  5819. int y = bigRegionY + (offset & 7);
  5820. int itemId = buffer.readUnsignedShort();
  5821. if (x >= 0 && y >= 0 && x < 104 && y < 104) {
  5822. Deque deque = groundEntity[plane][x][y];
  5823. if (deque != null) {
  5824. for (Item item = (Item) deque.head(); item != null; item = (Item) deque.next()) {
  5825. if (item.id != (itemId & 0x7fff)) {
  5826. continue;
  5827. }
  5828. item.remove();
  5829. break;
  5830. }
  5831. if (deque.head() == null) {
  5832. groundEntity[plane][x][y] = null;
  5833. }
  5834. spawnGroundItem(x, y);
  5835. }
  5836. }
  5837. return;
  5838. }
  5839. if (packetId == 160) { // send object animation
  5840. int offset = buffer.readUnsignedByteS();
  5841. int x = bigRegionX + (offset >> 4 & 7);
  5842. int y = bigRegionY + (offset & 7);
  5843. int bits = buffer.readUnsignedByteS();
  5844. int type = bits >> 2;
  5845. int rotation = bits & 3;
  5846. int objectType = objectClassType[type];
  5847. int animationId = buffer.readUnsignedLEShortA();
  5848. if (x >= 0 && y >= 0 && x < 103 && y < 103) {
  5849. int j18 = heightMap[plane][x][y];
  5850. int i19 = heightMap[plane][x + 1][y];
  5851. int l19 = heightMap[plane][x + 1][y + 1];
  5852. int k20 = heightMap[plane][x][y + 1];
  5853. if (objectType == 0) {
  5854. WallObject class10 = sceneGraph.getWallObject(plane, x, y);
  5855. if (class10 != null) {
  5856. int k21 = /* class10.uid >> 14 & 0x7fff */class10.id;
  5857. if (type == 2) {
  5858. class10.animable1 = new ObjectOnTile(k21, 4 + rotation, 2, i19, l19, j18, k20, animationId, false);
  5859. class10.animable2 = new ObjectOnTile(k21, rotation + 1 & 3, 2, i19, l19, j18, k20, animationId, false);
  5860. } else {
  5861. class10.animable1 = new ObjectOnTile(k21, rotation, type, i19, l19, j18, k20, animationId, false);
  5862. }
  5863. }
  5864. }
  5865. if (objectType == 1) {
  5866. WallDecoration class26 = sceneGraph.getWallDecoration(x, y, plane);
  5867. if (class26 != null) {
  5868. class26.animable = new ObjectOnTile(
  5869. /* class26.uid >> 12 & 0x7fff */class26.id, 0, 4, i19, l19, j18, k20, animationId, false);
  5870. }
  5871. }
  5872. if (objectType == 2) {
  5873. InteractiveObject class28 = sceneGraph.getInteractiveObject(x, y, plane);
  5874. if (type == 11) {
  5875. type = 10;
  5876. }
  5877. if (class28 != null) {
  5878. class28.animable = new ObjectOnTile(
  5879. /* class28.uid >> 12 & 0x3fff */class28.id, rotation, type, i19, l19, j18, k20, animationId, false);
  5880. }
  5881. }
  5882. if (objectType == 3) {
  5883. GroundDecoration class49 = sceneGraph.getGroundDecoration(y, x, plane);
  5884. if (class49 != null) {
  5885. class49.animable = new ObjectOnTile(
  5886. /* class49.uid >> 12 & 0x7fff */class49.id, rotation, 22, i19, l19, j18, k20, animationId, false);
  5887. }
  5888. }
  5889. }
  5890. return;
  5891. }
  5892. if (packetId == 147) { // transform player into game object
  5893. int offset = buffer.readUnsignedByteS();
  5894. int regionX = bigRegionX + (offset >> 4 & 7);
  5895. int regionY = bigRegionY + (offset & 7);
  5896. int playerId = buffer.readUnsignedShort();
  5897. byte model_priority_x = buffer.readByteS();
  5898. int start_delay = buffer.readUnsignedLEShort();
  5899. byte model_priority_y = buffer.readByteC();
  5900. int priority_1 = buffer.readUnsignedShort();
  5901. int object_bits = buffer.readUnsignedByteS();
  5902. int object_type = object_bits >> 2;
  5903. int direction = object_bits & 3;
  5904. int classType = objectClassType[object_type];
  5905. byte unknown_x_value = buffer.readSignedByte();
  5906. int objectId = buffer.readUnsignedShort();
  5907. byte unknown_y_value = buffer.readByteC();
  5908. Player player;
  5909. if (playerId == myPlayerId) {
  5910. player = myPlayer;
  5911. } else {
  5912. player = players[playerId];
  5913. }
  5914. if (player != null) {
  5915. ObjectDef definition = ObjectDef.getDef(objectId);
  5916. int i22 = heightMap[plane][regionX][regionY];
  5917. int j22 = heightMap[plane][regionX + 1][regionY];
  5918. int k22 = heightMap[plane][regionX + 1][regionY + 1];
  5919. int l22 = heightMap[plane][regionX][regionY + 1];
  5920. Model model = definition.renderObject(object_type, direction, i22, j22, k22, l22, -1, -1, -1, -1);
  5921. if (model != null) {
  5922. spawnGameObject(priority_1 + 1, -1, 0, classType, regionY, 0, plane, regionX, start_delay + 1);
  5923. player.secondaryModel = start_delay + loopCycle;
  5924. player.primaryModel = priority_1 + loopCycle;
  5925. player.objectTransformationModel = model;
  5926. int tileSizeX = definition.tileSizeX;
  5927. int tileSizeY = definition.tileSizeY;
  5928. if (direction == 1 || direction == 3) {
  5929. tileSizeX = definition.tileSizeY;
  5930. tileSizeY = definition.tileSizeX;
  5931. }
  5932. player.modelOffsetX = regionX * 128 + tileSizeX * 64;
  5933. player.modelOffsetY = regionY * 128 + tileSizeY * 64;
  5934. player.modelOffsetZ = method42(plane, player.modelOffsetY, player.modelOffsetX);
  5935. if (unknown_x_value > model_priority_x) {
  5936. byte temp_x = unknown_x_value;
  5937.  
  5938. unknown_x_value = model_priority_x;
  5939. model_priority_x = temp_x;
  5940. }
  5941. if (unknown_y_value > model_priority_y) {
  5942. byte temp_y = unknown_y_value;
  5943.  
  5944. unknown_y_value = model_priority_y;
  5945. model_priority_y = temp_y;
  5946. }
  5947.  
  5948. // System.out.println("xSize=" + unknown_x_value + "; ySize=" + unknown_y_value
  5949. // + "; xLength=" + model_priority_x + "; yLength=" + model_priority_y);
  5950.  
  5951. player.extendedXMin = regionX + unknown_x_value;
  5952. player.extendedXMax = regionX + model_priority_x;
  5953. player.extendedYMin = regionY + unknown_y_value;
  5954. player.extendedYMax = regionY + model_priority_y;
  5955. }
  5956. }
  5957. }
  5958. if (packetId == 151) { // send game object
  5959. int offset = buffer.readUnsignedByteA();
  5960. int regionX = bigRegionX + (offset >> 4 & 7);
  5961. int regionY = bigRegionY + (offset & 7);
  5962. int id = buffer.readUnsignedLEShort();
  5963. int bits = buffer.readUnsignedByteS();
  5964. int type = bits >> 2;
  5965. int rotation = bits & 3;
  5966. int objectType = objectClassType[type];
  5967. if (regionX >= 0 && regionY >= 0 && regionX < 104 && regionY < 104) {
  5968. spawnGameObject(-1, id, rotation, objectType, regionY, type, plane, regionX, 0);
  5969. }
  5970. return;
  5971. }
  5972. if (packetId == 4) { // send graphic
  5973. int offset = buffer.readUnsignedByte();
  5974. int regionX = bigRegionX + (offset >> 4 & 7);
  5975. int regionY = bigRegionY + (offset & 7);
  5976. int id = buffer.readUnsignedShort();
  5977. int height = buffer.readUnsignedByte();
  5978. int delay = buffer.readUnsignedShort();
  5979. if (regionX >= 0 && regionY >= 0 && regionX < 104 && regionY < 104) {
  5980. regionX = regionX * 128 + 64;
  5981. regionY = regionY * 128 + 64;
  5982. StillGraphics graphics = new StillGraphics(plane, loopCycle, delay, id, method42(plane, regionY, regionX) - height,
  5983. regionY, regionX);
  5984. aClass19_1056.append(graphics);
  5985. }
  5986. return;
  5987. }
  5988. if (packetId == 44) { // send ground item
  5989. int itemId = buffer.readUnsignedShortA();
  5990. int amount = buffer.readUnsignedShort();// long amount = stream.getSmartLong();
  5991. int offset = buffer.readUnsignedByte();
  5992. int regionX = bigRegionX + (offset >> 4 & 7);
  5993. int regionY = bigRegionY + (offset & 7);
  5994. if (itemId == -1 || itemId == 65535)
  5995. return;
  5996. if (regionX >= 0 && regionY >= 0 && regionX < 104 && regionY < 104) {
  5997. Item item = new Item();
  5998. item.id = itemId;
  5999. item.amount = amount;
  6000. if (groundEntity[plane][regionX][regionY] == null) {
  6001. groundEntity[plane][regionX][regionY] = new Deque();
  6002. }
  6003. groundEntity[plane][regionX][regionY].append(item);
  6004. spawnGroundItem(regionX, regionY);
  6005. }
  6006.  
  6007. return;
  6008. }
  6009. if (packetId == 101) { // send game object removal
  6010. int bits = buffer.readUnsignedByteC();
  6011. int type = bits >> 2;
  6012. int face = bits & 3;
  6013. int objectType = objectClassType[type];
  6014. int offset = buffer.readUnsignedByte();
  6015. int x = bigRegionX + (offset >> 4 & 7);
  6016. int y = bigRegionY + (offset & 7);
  6017. if (x >= 0 && y >= 0 && x < 104 && y < 104) {
  6018. spawnGameObject(-1, -1, face, objectType, y, type, plane, x, 0);
  6019. }
  6020. return;
  6021. }
  6022. if (packetId == 117) { // send projectile
  6023. int regionOffset = buffer.readUnsignedByte();
  6024. int regionX = bigRegionX + (regionOffset >> 4 & 7);
  6025. int regionY = bigRegionY + (regionOffset & 7);
  6026. int offsetX = regionX + buffer.readSignedByte();
  6027. int offsetY = regionY + buffer.readSignedByte();
  6028. int lockon = buffer.readSignedShort();
  6029. int graphicId = buffer.readUnsignedShort();
  6030. int startZ = buffer.readUnsignedByte() * 4;
  6031. int endZ = buffer.readUnsignedByte() * 4;
  6032. int delay = buffer.readUnsignedShort();
  6033. int speed = buffer.readUnsignedShort();
  6034. int slope = buffer.readUnsignedByte();
  6035. int radius = buffer.readUnsignedByte();
  6036. if (regionX >= 0 && regionY >= 0 && regionX < 104 && regionY < 104 && offsetX >= 0 && offsetY >= 0 && offsetX < 104
  6037. && offsetY < 104 && graphicId != 65535) {
  6038. regionX = regionX * 128 + 64;
  6039. regionY = regionY * 128 + 64;
  6040. offsetX = offsetX * 128 + 64;
  6041. offsetY = offsetY * 128 + 64;
  6042. Projectile projectile = new Projectile(slope, endZ, delay + loopCycle, speed + loopCycle, radius, plane, method42(plane,
  6043. regionY, regionX) - startZ, regionY, regionX, lockon, graphicId);
  6044. projectile.calculateTracking(delay + loopCycle, offsetY, method42(plane, offsetY, offsetX) - endZ, offsetX);
  6045. projectileQueue.append(projectile);
  6046. }
  6047. }
  6048. }
  6049.  
  6050. private static void setLowMemory() {
  6051. WorldController.lowMem = true;
  6052. Rasterizer.lowMem = true;
  6053. lowMemory = true;
  6054. ObjectManager.lowMem = true;
  6055. ObjectDef.lowMem = true;
  6056. }
  6057.  
  6058. private void updateNpcMovement(JagexBuffer stream) {
  6059. stream.initBitAccess();
  6060. int k = stream.getBits(8);
  6061. if (k < npcCount) {
  6062. for (int l = k; l < npcCount; l++) {
  6063. anIntArray840[anInt839++] = npcIndices[l];
  6064. }
  6065.  
  6066. }
  6067. if (k > npcCount) {
  6068. Signlink.reportError(myUsername + " Too many npcs");
  6069. throw new RuntimeException("eek");
  6070. }
  6071. npcCount = 0;
  6072. for (int i1 = 0; i1 < k; i1++) {
  6073. int j1 = npcIndices[i1];
  6074. NPC npc = npcArray[j1];
  6075. int k1 = stream.getBits(1);
  6076. if (k1 == 0) {
  6077. npcIndices[npcCount++] = j1;
  6078. npc.time = loopCycle;
  6079. } else {
  6080. int l1 = stream.getBits(2);
  6081. if (l1 == 0) {
  6082. npcIndices[npcCount++] = j1;
  6083. npc.time = loopCycle;
  6084. localPlayers[localPlayersIndex++] = j1;
  6085. } else if (l1 == 1) {
  6086. npcIndices[npcCount++] = j1;
  6087. npc.time = loopCycle;
  6088. int i2 = stream.getBits(3);
  6089. npc.move(false, i2);
  6090. int k2 = stream.getBits(1);
  6091. if (k2 == 1) {
  6092. localPlayers[localPlayersIndex++] = j1;
  6093. }
  6094. } else if (l1 == 2) {
  6095. npcIndices[npcCount++] = j1;
  6096. npc.time = loopCycle;
  6097. int j2 = stream.getBits(3);
  6098. npc.move(true, j2);
  6099. int l2 = stream.getBits(3);
  6100. npc.move(true, l2);
  6101. int i3 = stream.getBits(1);
  6102. if (i3 == 1) {
  6103. localPlayers[localPlayersIndex++] = j1;
  6104. }
  6105. } else if (l1 == 3) {
  6106. anIntArray840[anInt839++] = j1;
  6107. }
  6108. }
  6109. }
  6110. }
  6111.  
  6112. /*
  6113. * private void processLoginScreenInput() {
  6114. * checkSize();
  6115. * int centerX = (getClientWidth() / 2);
  6116. * int centerY = (getClientHeight() / 2);
  6117. * if (loginMessage1.length() > 0) {
  6118. * int width = 300;
  6119. * int height = 50;
  6120. * int x = (getClientWidth() / 2) - (width / 2);
  6121. * int y = (getClientHeight() / 2) - (height / 2);
  6122. * //create account
  6123. * if (!mouseInRegion(x + width - 16, x + width, y, y + 16) && getCreate().available) {
  6124. * if (super.clickMode3 == 1 && clickInRegion(x, x + width, y, y + height)) {
  6125. * getCreate().username = getUsername();
  6126. * getCreate().password = myPassword;
  6127. * getCreate().verified[0] = getCreate().checkUsername();
  6128. * getCreate().verified[1] = getCreate().checkPassword();
  6129. * loginScreenState = CREATE;
  6130. * loginMessage1 = "";
  6131. * loginMessage2 = "";
  6132. * messageAlpha = 0;
  6133. * messageX = 0;
  6134. * messageY = 0;
  6135. * messageWidth = 0;
  6136. * messageHeight = 0;
  6137. * }
  6138. * }
  6139. * //close button
  6140. * if (super.clickMode3 == 1 && clickInRegion(x + width - 16, x + width, y, y + 16)) {
  6141. * loginMessage1 = "";
  6142. * loginMessage2 = "";
  6143. * }
  6144. * if (mouseInRegion(x + width - 16, x + width, y, y + 16)) {
  6145. * titleHover = 3;
  6146. * } else {
  6147. * titleHover = -1;
  6148. * }
  6149. * return;
  6150. * }
  6151. * if (loginScreenState == LOGIN) {
  6152. * int x = (getClientWidth() / 2) - (box[0].myWidth / 2);
  6153. * int y = (getClientHeight() / 2) - (box[0].myHeight / 2);
  6154. * int[] screen_x = {x + (322 / 2) - 45 - 27, x + 20 + (322 / 2) - 27, x + 85 + (322 / 2) - 27};
  6155. * int[] detail_x = {x + 85, x + 200};
  6156. * int buttonsX = clientWidth - 165;
  6157. * int buttonsY = 5;
  6158. * //options(x + 5 - accountsX, x + 20, y + 25, y + 165)) {
  6159. * titleHover = 2;
  6160. * //recover
  6161. * } else if (mouseInRegion(centerX - (input.myWidth / 2), centerX, y + 153, y + 165)) {
  6162. * titleHover = 5;
  6163. * //icons/buttons
  6164. * } else {
  6165. * titleHover = -1;
  6166. * }
  6167. * //recover
  6168. * if (super.clickMode3 == 1 && clickInRegion(centerX - (input.myWidth / 2), centerX, y + 153, y + 165)) {
  6169. * loginScreenState = RECOVER;
  6170. * }
  6171. * if (titleHover == 1) {
  6172. * //screen mode
  6173. * if (mouseInRegion(screen_x[0], screen_x[0] + 54, y + 205, y + 248)) {
  6174. * screenHover = 0;
  6175. * } else if (mouseInRegion(screen_x[1], screen_x[1] + 54, y + 205, y + 248)) {
  6176. * screenHover = 1;
  6177. * } else if (mouseInRegion(screen_x[2], screen_x[2] + 54, y + 205, y + 248)) {
  6178. * screenHover = 2;
  6179. * } else {
  6180. * screenHover = -1;
  6181. * }
  6182. * if (super.clickMode3 == 1 && clickInRegion(screen_x[0], screen_x[0] + 54, y + 205, y + 248)) {
  6183. * toggleSize(0);
  6184. * } else if (super.clickMode3 == 1 && clickInRegion(screen_x[1], screen_x[1] + 54, y + 205, y + 248)) {
  6185. * toggleSize(1);
  6186. * } else if (super.clickMode3 == 1 && clickInRegion(screen_x[2], screen_x[2] + 54, y + 205, y + 248)) {
  6187. * toggleSize(2);
  6188. * }
  6189. * //detail
  6190. * if (mouseInRegion(detail_x[0], detail_x[0] + 77, y + 260, y + 313)) {
  6191. * detailHover = 0;
  6192. * } else if (mouseInRegion(detail_x[1], detail_x[1] + 77, y + 260, y + 313)) {
  6193. * detailHover = 1;
  6194. * } else {
  6195. * detailHover = -1;
  6196. * }
  6197. * if (super.clickMode3 == 1 && clickInRegion(detail_x[0], detail_x[0] + 77, y + 260, y + 313)) {
  6198. * setLowMemory();
  6199. * } else if (super.clickMode3 == 1 && clickInRegion(detail_x[1], detail_x[1] + 77, y + 260, y + 313)) {
  6200. * setHighMemory();
  6201. * }
  6202. * }
  6203. * //edit accounts
  6204. * if (super.clickMode3 == 1 && clickInRegion(x - accountsX + 5, x, y + 28, y + 42) && titleHover == 2) {
  6205. * editAccounts = !editAccounts;
  6206. * //AccountHandler.save();
  6207. * }
  6208. * if (mouseInRegion(x - accountsX + 5, x, y + 28, y + 42) && titleHover == 2) {
  6209. * editHover = 0;
  6210. * } else {
  6211. * editHover = -1;
  6212. * }
  6213. * //Display toggle
  6214. * if (super.clickMode3 == 1 && clickInRegion(9, 9 + 112, clientHeight - display.myHeight + 9, clientHeight - display.myHeight + 9 + 75)) {
  6215. * Settings.displayWorld = !Settings.displayWorld;
  6216. * createWorldImage();
  6217. * Settings.save();
  6218. * }
  6219. * if (titleHover == 2) {
  6220. * int text_x = x - accountsX + 5;
  6221. * int text_y = y + 62;
  6222. * if (AccountHandler.accounts != null) {
  6223. * accountHover = -1;
  6224. * for (int index = 0; index < AccountHandler.getAccounts().size(); index++, text_y += 17) {
  6225. * Account account = AccountHandler.getAccounts().get(index);
  6226. * if (mouseInRegion(text_x, x + 10, text_y - 12, text_y)) {
  6227. * accountHover = index;
  6228. * }
  6229. * if (super.clickMode3 == 1 && clickInRegion(text_x, x + 10, text_y - 12, text_y)) {
  6230. * if (editAccounts) {
  6231. * AccountHandler.remove(account);
  6232. * } else {
  6233. * getCreate().created = false;
  6234. * loginFailures = 0;
  6235. * login(account.name, account.password, false, true);
  6236. * if (loggedIn) {
  6237. * return;
  6238. * }
  6239. * }
  6240. * }
  6241. * }
  6242. * }
  6243. * }
  6244. * if (super.clickMode3 == 1 && clickInRegion(centerX - (input.myWidth / 2), centerX + (input.myWidth / 2), centerY - 17 - (input.myHeight / 2), centerY - 17 + (input.myHeight / 2))) {
  6245. * loginScreenCursorPos = 0;
  6246. * }
  6247. * if (super.clickMode3 == 1 && clickInRegion(centerX - (input.myWidth / 2), centerX + (input.myWidth / 2), centerY + 35 - (input.myHeight / 2), centerY + 35 + (input.myHeight / 2))) {
  6248. * loginScreenCursorPos = 1;
  6249. * }
  6250. * int loginX = (clientWidth / 2) - (button.myWidth / 2);
  6251. * int loginY = clientHeight - 175;
  6252. * if (checkDetails() && super.clickMode3 == 1 && clickInRegion(loginX, loginX + button.myWidth, loginY - 8, loginY - 8 + button.myHeight)) {
  6253. * getCreate().created = false;
  6254. * loginFailures = 0;
  6255. * login(getUsername(), myPassword, false, false);
  6256. * if (loggedIn) {
  6257. * return;
  6258. * }
  6259. * }
  6260. * do {
  6261. * int key = readCharacter();
  6262. * if (key == -1) {
  6263. * break;
  6264. * }
  6265. * boolean validKey = false;
  6266. * for (int index = 0; index < validUserPassChars.length(); index++) {
  6267. * if (key != validUserPassChars.charAt(index)) {
  6268. * continue;
  6269. * }
  6270. * validKey = true;
  6271. * break;
  6272. * }
  6273. * if (loginScreenCursorPos == 0) {
  6274. * if (key == 8 && getUsername().length() > 0) {
  6275. * setUsername(myUsername.substring(0, myUsername.length() - 1));
  6276. * }
  6277. * if (key == 9 || key == 10 || key == 13) {
  6278. * loginScreenCursorPos = 1;
  6279. * }
  6280. * if (validKey) {
  6281. * setUsername(myUsername + (char) key);
  6282. * }
  6283. * if (getUsername().length() > 12) {
  6284. * setUsername(myUsername.substring(0, 12));
  6285. * }
  6286. * } else if (loginScreenCursorPos == 1) {
  6287. * if (key == 8 && myPassword.length() > 0) {
  6288. * myPassword = myPassword.substring(0, myPassword.length() - 1);
  6289. * }
  6290. * if (key == 9) {
  6291. * loginScreenCursorPos = 0;
  6292. * }
  6293. * if (key == 10 || key == 13) {
  6294. * getCreate().created = false;
  6295. * loginFailures = 0;
  6296. * login(getUsername(), myPassword, false, false);
  6297. * if (loggedIn) {
  6298. * return;
  6299. * }
  6300. * }
  6301. * if (validKey) {
  6302. * myPassword += (char) key;
  6303. * }
  6304. * if (myPassword.length() > 20) {
  6305. * myPassword = myPassword.substring(0, 20);
  6306. * }
  6307. * }
  6308. * } while (true);
  6309. * return;
  6310. * }
  6311. * if (loginScreenState == CREATE) {
  6312. * getCreate().processInput();
  6313. * }
  6314. * if (loginScreenState == RECOVER) {
  6315. * getRecovery().processInput();
  6316. * }
  6317. * }
  6318. */
  6319.  
  6320. private void markMinimap(RSImage sprite, int x, int y) {
  6321. try {
  6322. int k = viewRotation + minimapRotation & 0x7ff;
  6323. int l = x * x + y * y;
  6324. if (l > 6400) {
  6325. return;
  6326. }
  6327. int i1 = Model.SINE[k];
  6328. int j1 = Model.COSINE[k];
  6329. i1 = (i1 * 256) / (minimapZoom + 256);
  6330. j1 = (j1 * 256) / (minimapZoom + 256);
  6331. int k1 = y * i1 + x * j1 >> 16;
  6332. int l1 = y * j1 - x * i1 >> 16;
  6333. if (isFixed()) {
  6334. sprite.drawImage((((105 + k1) - sprite.maxWidth / 2) + 4) + (isFixed() ? getMapOffsetX() : 0), (88 - l1 - sprite.maxHeight
  6335. / 2 - 4)
  6336. + (isFixed() ? getMapOffsetY() : 0));
  6337. } else {
  6338. sprite.drawImage((((77 + k1) - sprite.maxWidth / 2) + 4 + (clientWidth - 167)), (85 - l1 - sprite.maxHeight / 2 - 4)
  6339. + (isFixed() ? getMapOffsetY() : 0));
  6340. }
  6341. } catch (Exception e) {
  6342. }
  6343. }
  6344.  
  6345. private void method142(int y, int z, int k, int l, int x, int type, int k1) {
  6346. if (x >= 1 && y >= 1 && x <= 102 && y <= 102) {
  6347. if (lowMemory && z != plane) {
  6348. return;
  6349. }
  6350. int id = 0;
  6351. int uid = 0;
  6352. if (type == 0) {
  6353. uid = sceneGraph.getWallObjectUID(z, x, y);
  6354. id = sceneGraph.getWallObjectID(z, x, y);
  6355. }
  6356. if (type == 1) {
  6357. uid = sceneGraph.getWallDecorationUID(z, x, y);
  6358. id = sceneGraph.getWallDecorationID(z, x, y);
  6359. }
  6360. if (type == 2) {
  6361. uid = sceneGraph.getInteractiveObjectUID(z, x, y);
  6362. id = sceneGraph.getInteractiveObjectID(z, x, y);
  6363. }
  6364. if (type == 3) {
  6365. uid = sceneGraph.getGroundDecorationUID(z, x, y);
  6366. id = sceneGraph.getGroundDecorationID(z, x, y);
  6367. }
  6368. if (uid != 0) {
  6369. int config = sceneGraph.getObjectConfig(z, x, y, uid);
  6370. int objType = config & 0x1f;
  6371. int direction = config >> 6;
  6372. if (type == 0) {
  6373. sceneGraph.removeWallObject(x, z, y);
  6374. ObjectDef definition = ObjectDef.getDef(id);
  6375. if (definition.unwalkable) {
  6376. tileSettings[z].method215(direction, objType, definition.impenetrable, x, y);
  6377. }
  6378. }
  6379. if (type == 1) {
  6380. sceneGraph.removeWallDecoration(y, z, x);
  6381. }
  6382. if (type == 2) {
  6383. sceneGraph.removeInteractiveObject(z, x, y);
  6384. ObjectDef definition = ObjectDef.getDef(id);
  6385. if (x + definition.tileSizeX > 103 || y + definition.tileSizeX > 103 || x + definition.tileSizeY > 103
  6386. || y + definition.tileSizeY > 103) {
  6387. return;
  6388. }
  6389. if (definition.unwalkable) {
  6390. tileSettings[z].method216(direction, definition.tileSizeX, x, y, definition.tileSizeY, definition.impenetrable);
  6391. }
  6392. }
  6393. if (type == 3) {
  6394. sceneGraph.removeGroundDecoration(z, y, x);
  6395. ObjectDef definition = ObjectDef.getDef(id);
  6396. if (definition.unwalkable && definition.interactive) {
  6397. tileSettings[z].method218(y, x);
  6398. }
  6399. }
  6400. }
  6401. if (k1 >= 0) {
  6402. int j3 = z;
  6403. if (j3 < 3 && (groundTileSettings[1][x][y] & 2) == 2) {
  6404. j3++;
  6405. }
  6406. ObjectManager.renderObject(sceneGraph, k, y, l, j3, tileSettings[z], heightMap, x, k1, z);
  6407. }
  6408. }
  6409. }
  6410.  
  6411. private void updatePlayers(int bufferSize, JagexBuffer buffer) {
  6412. anInt839 = 0;
  6413. localPlayersIndex = 0;
  6414. updateClientMovement(buffer);
  6415. updateOtherClientMovements(buffer);
  6416. addNewLocalPlayer(buffer, bufferSize);
  6417. updateLocalClientMasks(buffer);
  6418. for (int index = 0; index < anInt839; index++) {
  6419. int player = anIntArray840[index];
  6420. if (players[player].time != loopCycle) {
  6421. players[player] = null;
  6422. }
  6423. }
  6424. if (buffer.offset != bufferSize) {
  6425. throw new RuntimeException("Error reading player updating packet - [size, expectedSize] : [" + buffer.offset + ", "
  6426. + bufferSize + "]");
  6427. // signlink.reportError("Packet size mismatch in player updating - buffer offset: " + buffer.offset + ", size: " + size);
  6428. // signlink.reportError("Error packet size mismatch in getplayer pos:" + stream.offset + " psize:" + size);
  6429. // throw new RuntimeException("eek");
  6430. }
  6431. for (int index = 0; index < playerCount; index++) {
  6432. if (players[playerIndices[index]] == null) {
  6433. Signlink.reportError(myUsername + " null entry in pl list - pos:" + index + " size:" + playerCount);
  6434. throw new RuntimeException("eek");
  6435. }
  6436. }
  6437. }
  6438.  
  6439. private void setCameraPos(int j, int k, int l, int i1, int j1, int k1) {
  6440. int l1 = 2048 - k & 0x7ff;
  6441. int i2 = 2048 - j1 & 0x7ff;
  6442. int j2 = 0;
  6443. int k2 = 0;
  6444. int l2 = j;
  6445. if (l1 != 0) {
  6446. int i3 = Model.SINE[l1];
  6447. int k3 = Model.COSINE[l1];
  6448. int i4 = k2 * k3 - l2 * i3 >> 16;
  6449. l2 = k2 * i3 + l2 * k3 >> 16;
  6450. k2 = i4;
  6451. }
  6452. if (i2 != 0) {
  6453. int j3 = Model.SINE[i2];
  6454. int l3 = Model.COSINE[i2];
  6455. int j4 = l2 * j3 + j2 * l3 >> 16;
  6456. l2 = l2 * l3 - j2 * j3 >> 16;
  6457. j2 = j4;
  6458. }
  6459. xCameraPos = l - j2;
  6460. zCameraPos = i1 - k2;
  6461. yCameraPos = k1 - l2;
  6462. yCameraCurve = k;
  6463. xCameraCurve = j1;
  6464. }
  6465.  
  6466. public void updateText(String text, int id) {
  6467. if (RSInterface.interfaceCache[id] == null)
  6468. return;
  6469. RSInterface.interfaceCache[id].enabledText = text;
  6470. RSInterface.interfaceCache[id].disabledText = text;
  6471. if (RSInterface.interfaceCache[id].parentId == tabInterfaceIDs[tabID]) {
  6472. redrawTabArea = true;
  6473. }
  6474. if (id == 27001)
  6475. currentBankTab = Integer.valueOf(RSInterface.interfaceCache[id].disabledText);
  6476. if (id == 51_806 || id == 51_856) {
  6477. int price = Integer.valueOf(RSInterface.interfaceCache[id].disabledText);
  6478. GrandExchange.setPricePerItem(price);
  6479. } else if (id == 51_805 || id == 51_855) {
  6480. int quantity = Integer.valueOf(RSInterface.interfaceCache[id].disabledText);
  6481. GrandExchange.setQuantity(quantity);
  6482. }
  6483. }
  6484.  
  6485. public void sendPacket185(int buttonID) {
  6486. outgoingPacket.createFrame(185);
  6487. outgoingPacket.writeShort(buttonID);
  6488. RSInterface rsi = RSInterface.interfaceCache[buttonID];
  6489. if (rsi.valueConditionType != null && rsi.valueConditionType[0][0] == 5) {
  6490. int configID = rsi.valueConditionType[0][1];
  6491. variousSettings[configID] = 1 - variousSettings[configID];
  6492. toggleConfig(configID);
  6493. redrawTabArea = true;
  6494. }
  6495. }
  6496.  
  6497. public void setConfig(int id, int value) {
  6498. defaultConfigIds[id] = value;
  6499. if (variousSettings[id] != value) {
  6500. variousSettings[id] = value;
  6501. redrawTabArea = true;
  6502. if (dialogID != -1) {
  6503. inputTaken = true;
  6504. }
  6505. }
  6506. }
  6507.  
  6508. public int getConfig(int id) {
  6509. return variousSettings[RSInterface.getConfigID(id)];
  6510. }
  6511.  
  6512. /**
  6513. * Used to set a sprite to another sprite. An example
  6514. * is the clan chat's lootshare sprite, which has 4
  6515. * different sprites.
  6516. * @param childId The id of the interface child.
  6517. * @param spriteId The new sprite id located in sprites.dat.
  6518. */
  6519. private void changeSprite(int childId, int offsetX, int offsetY, int... spriteId) {
  6520. RSInterface rsi = RSInterface.interfaceCache[childId];
  6521. if (rsi != null) {
  6522. if (spriteId[0] < RSImageLoader.images.length && RSImageLoader.images[spriteId[0]] != null && spriteId[0] > 0)
  6523. rsi.sprite1 = RSImageLoader.images[spriteId[0]];
  6524. if (spriteId[1] < RSImageLoader.images.length && RSImageLoader.images[spriteId[1]] != null && spriteId[1] > 0)
  6525. rsi.sprite2 = RSImageLoader.images[spriteId[1]];
  6526. rsi.sprite1.offsetX = rsi.sprite2.offsetX = offsetX;
  6527. rsi.sprite1.offsetY = rsi.sprite2.offsetY = offsetY;
  6528. }
  6529. }
  6530.  
  6531. private int hungerGamesHunger = -1;
  6532.  
  6533. private int hungerGamesThirst = -1;
  6534.  
  6535. public boolean buildingMode = false;
  6536.  
  6537. private boolean parsePacket() {
  6538. if (socketStream == null) {
  6539. return false;
  6540. }
  6541. try {
  6542. int available = socketStream.available();
  6543. if (available == 0) {
  6544. return false;
  6545. }
  6546. if (packetId == -1) {
  6547. socketStream.flushInputStream(incomingPacket.payload, 1);
  6548. packetId = incomingPacket.payload[0] & 0xff;
  6549. if (encryption != null) {
  6550. packetId = packetId - encryption.next() & 0xff;
  6551. }
  6552. packetSize = SizeConstants.getPacketSizes()[packetId];
  6553. available--;
  6554. }
  6555. if (packetSize == -1) {
  6556. if (available > 0) {
  6557. socketStream.flushInputStream(incomingPacket.payload, 1);
  6558. packetSize = incomingPacket.payload[0] & 0xff;
  6559. available--;
  6560. } else {
  6561. return false;
  6562. }
  6563. }
  6564. if (packetSize == -2) {
  6565. if (available > 1) {
  6566. socketStream.flushInputStream(incomingPacket.payload, 2);
  6567. incomingPacket.offset = 0;
  6568. packetSize = incomingPacket.readUnsignedShort();
  6569. available -= 2;
  6570. } else {
  6571. return false;
  6572. }
  6573. }
  6574. if (available < packetSize) {
  6575. return false;
  6576. }
  6577. incomingPacket.offset = 0;
  6578. socketStream.flushInputStream(incomingPacket.payload, packetSize);
  6579. anInt1009 = 0;
  6580. anInt843 = anInt842;
  6581. anInt842 = anInt841;
  6582. anInt841 = packetId;
  6583. switch (packetId) {
  6584.  
  6585. case 94:
  6586. redrawTabArea = true;
  6587. int containerId = incomingPacket.readUnsignedShort();
  6588. RSInterface container = RSInterface.interfaceCache[containerId];
  6589. int containerSize = incomingPacket.readUnsignedShort();
  6590.  
  6591. int offerItemId = incomingPacket.readUnsignedShort();
  6592. int offerItemAmount = incomingPacket.readUnsignedByte();
  6593. if (offerItemAmount == 255)
  6594. offerItemAmount = incomingPacket.readInt_v1();
  6595.  
  6596. container.geItem[0] = offerItemId;
  6597. container.geItem[1] = offerItemAmount;
  6598.  
  6599. container.geOfferType = incomingPacket.readSignedByte();
  6600.  
  6601. if (container.geOfferType != -1) {
  6602. int goalAmount = incomingPacket.readUnsignedByte();
  6603. if (goalAmount == 255)
  6604. goalAmount = incomingPacket.readInt_v1();
  6605. container.geItem[2] = goalAmount;
  6606. }
  6607.  
  6608. for (int index = 0; index < containerSize; index++) {
  6609. int amount = incomingPacket.readUnsignedByte();
  6610. if (amount == 255)
  6611. amount = incomingPacket.readInt_v1();
  6612. container.inventory[index] = incomingPacket.readLEShortA();
  6613. container.inventoryAmount[index] = (int) amount;
  6614.  
  6615. amount = incomingPacket.readUnsignedByte();
  6616. if (amount == 255)
  6617. amount = incomingPacket.readInt_v1();
  6618. container.gePrice = amount;
  6619. }
  6620. for (int index = containerSize; index < container.inventory.length; index++) {
  6621. container.inventory[index] = 0;
  6622. container.inventoryAmount[index] = 0;
  6623. }
  6624. packetId = -1;
  6625. return true;
  6626.  
  6627. case 150:
  6628. int child_id = incomingPacket.readUnsignedShort();
  6629. int slot = incomingPacket.readSignedByte();
  6630. int seconds = incomingPacket.readUnsignedByte();
  6631. RSInterface child = RSInterface.interfaceCache[child_id];
  6632. if (child != null && slot < child.inventory.length) {
  6633. child.showChangeExclamation[slot] = seconds > 0;
  6634. if (child.showChangeExclamation[slot]) {
  6635. child.showChangeExclamationTimer[slot] = seconds;
  6636. child.showChangeExclamationDelay[slot] = System.currentTimeMillis();
  6637. }
  6638. }
  6639. packetId = -1;
  6640. return true;
  6641.  
  6642. case 93:
  6643. long start_money = moneyPouch;
  6644. boolean update = incomingPacket.readSignedByte() == 1;
  6645.  
  6646. moneyPouch = incomingPacket.readLong();
  6647.  
  6648. if (update) {
  6649. moneyPouchProfit = moneyPouch - start_money;
  6650. if (moneyPouch < start_money) {
  6651. moneyOrbUpdateStatus = 2;
  6652. } else if (moneyPouch > start_money) {
  6653. moneyOrbUpdateStatus = 1;
  6654. }
  6655. }
  6656. packetId = -1;
  6657. return true;
  6658.  
  6659. case 92:
  6660. hungerGamesHunger = incomingPacket.readUnsignedByte();
  6661. hungerGamesThirst = incomingPacket.readUnsignedByte();
  6662. packetId = -1;
  6663. return true;
  6664.  
  6665. case 2:
  6666. myRights = incomingPacket.readUnsignedByte();
  6667. myPlayer.rights = myRights;
  6668. packetId = -1;
  6669. return true;
  6670.  
  6671. case 88:
  6672. quickPrayers = incomingPacket.readUnsignedByte() != 0;
  6673. packetId = -1;
  6674. return true;
  6675.  
  6676. case 140:
  6677. int childId = incomingPacket.readUnsignedShort();
  6678. int new_offset_x = incomingPacket.readSignedByte();
  6679. int new_offset_y = incomingPacket.readSignedByte();
  6680. int attributes = incomingPacket.readUnsignedShort();
  6681. int firstSprite = attributes >> 0;
  6682. int secondSprite = attributes & 0;
  6683. int[] newSprites = new int[] { firstSprite, secondSprite };
  6684. changeSprite(childId, new_offset_x, new_offset_y, newSprites);
  6685. packetId = -1;
  6686. return true;
  6687.  
  6688. case 89:
  6689. poisoned = incomingPacket.readUnsignedByte() > 0;
  6690. packetId = -1;
  6691. return true;
  6692.  
  6693. case 113:
  6694. running = incomingPacket.readUnsignedByte() == 1;
  6695. restMode = incomingPacket.readUnsignedByte();
  6696. packetId = -1;
  6697. return true;
  6698.  
  6699. case 123:
  6700. sendConsoleMessage(incomingPacket.readString(), false);
  6701. packetId = -1;
  6702. return true;
  6703.  
  6704. case 124:
  6705. int skillID = incomingPacket.readSignedByte();
  6706. int gainedXP = incomingPacket.readInt();
  6707. addXP(skillID, gainedXP);
  6708. totalXP = incomingPacket.readInt();
  6709. packetId = -1;
  6710. return true;
  6711.  
  6712. case 165:
  6713. familiarHandler.specialAttackAmount = incomingPacket.readSignedShort();
  6714. packetId = -1;
  6715. return true;
  6716.  
  6717. case 172:
  6718. try {
  6719. boolean active = incomingPacket.readSignedByte() == 1;
  6720. String name = incomingPacket.readString();
  6721. String special = incomingPacket.readString();
  6722. getFamiliar().specialType = incomingPacket.readSignedByte();
  6723. getFamiliar().setActive(active);
  6724. getFamiliar().setFamiliar(name, special);
  6725.  
  6726. if (!active) {
  6727. getFamiliar().setDefaults();
  6728. tabID = 13;
  6729. tabInterfaceIDs[13] = -1;
  6730. redrawTabArea = true;
  6731. tabAreaAltered = true;
  6732. } else {
  6733. tabID = 13;
  6734. tabInterfaceIDs[13] = familiarHandler.specialType != -1 ? 36400 : 36600;
  6735. redrawTabArea = true;
  6736. tabAreaAltered = true;
  6737. }
  6738. } catch (Exception e) {
  6739. e.printStackTrace();
  6740. }
  6741. packetId = -1;
  6742. return true;
  6743.  
  6744. case 173:
  6745. try {
  6746. pushKill(incomingPacket.readString(), incomingPacket.readString(), incomingPacket.readUnsignedShort(),
  6747. incomingPacket.readSignedByte() == 1, incomingPacket.readSignedByte() == 1);
  6748. } catch (Exception e) {
  6749. e.printStackTrace();
  6750. }
  6751. packetId = -1;
  6752. return true;
  6753.  
  6754. case 81:
  6755. updatePlayers(packetSize, incomingPacket);
  6756. aBoolean1080 = false;
  6757. packetId = -1;
  6758. return true;
  6759.  
  6760. case 176:
  6761. daysSinceRecovChange = incomingPacket.readUnsignedByteC();
  6762. unreadMessages = incomingPacket.readUnsignedLEShortA();
  6763. membersInt = incomingPacket.readUnsignedByte();
  6764. anInt1193 = incomingPacket.readInt_v1();
  6765. daysSinceLastLogin = incomingPacket.readUnsignedShort();
  6766. if (anInt1193 != 0 && openInterfaceID == -1) {
  6767. Signlink.dnslookup(TextUtils.method586(anInt1193));
  6768. clearTopInterfaces();
  6769. char c = '\u028A';
  6770. if (daysSinceRecovChange != 201 || membersInt == 1) {
  6771. c = '\u028F';
  6772. }
  6773. reportAbuseInput = "";
  6774. canMute = false;
  6775. for (int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  6776. if (RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c) {
  6777. continue;
  6778. }
  6779. openInterfaceID = RSInterface.interfaceCache[k9].parentId;
  6780.  
  6781. }
  6782. }
  6783. packetId = -1;
  6784. return true;
  6785.  
  6786. case 64:
  6787. bigRegionX = incomingPacket.readUnsignedByteC();
  6788. bigRegionY = incomingPacket.readUnsignedByteS();
  6789. for (int j = bigRegionX; j < bigRegionX + 8; j++) {
  6790. for (int l9 = bigRegionY; l9 < bigRegionY + 8; l9++) {
  6791. if (groundEntity[plane][j][l9] != null) {
  6792. groundEntity[plane][j][l9] = null;
  6793. spawnGroundItem(j, l9);
  6794. }
  6795. }
  6796. }
  6797. for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179.head(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
  6798. .next()) {
  6799. if (class30_sub1.anInt1297 >= bigRegionX && class30_sub1.anInt1297 < bigRegionX + 8
  6800. && class30_sub1.anInt1298 >= bigRegionY && class30_sub1.anInt1298 < bigRegionY + 8
  6801. && class30_sub1.anInt1295 == plane) {
  6802. class30_sub1.anInt1294 = 0;
  6803. }
  6804. }
  6805. packetId = -1;
  6806. return true;
  6807.  
  6808. case 185:
  6809. int k = incomingPacket.readUnsignedShortA();
  6810. RSInterface.interfaceCache[k].mediaType = 3;
  6811. if (myPlayer.npcDef == null) {
  6812. RSInterface.interfaceCache[k].modelZoom = 5000;
  6813. RSInterface.interfaceCache[k].mediaId = (myPlayer.appearanceColor[0] << 25) + (myPlayer.appearanceColor[4] << 20)
  6814. + (myPlayer.equipment[0] << 15) + (myPlayer.equipment[8] << 10) + (myPlayer.equipment[11] << 5)
  6815. + myPlayer.equipment[1];
  6816. } else {
  6817. RSInterface.interfaceCache[k].mediaId = (int) (0x12345678L + myPlayer.npcDef.id);
  6818. }
  6819. packetId = -1;
  6820. return true;
  6821.  
  6822. /* Clan chat packet */
  6823. case 217:
  6824. try {
  6825. clanUsername = incomingPacket.readString();
  6826. clanMessage = TextInput.processText(incomingPacket.readString());
  6827. clanTitle = incomingPacket.readString();
  6828. channelRights = incomingPacket.readUnsignedShort();
  6829. pushMessage(clanUsername, clanMessage, 12, "", -1);
  6830. } catch (Exception e) {
  6831. e.printStackTrace();
  6832. }
  6833. packetId = -1;
  6834. return true;
  6835.  
  6836. /* Yell channel packet */
  6837. case 222:
  6838. try {
  6839. yellUsername = incomingPacket.readString();
  6840. yellMessage = incomingPacket.readString();
  6841. yellMessage = TextInput.processText(yellMessage);
  6842. channelRights = incomingPacket.readUnsignedShort();
  6843. pushMessage(yellUsername, yellMessage, 13, "", -1);
  6844. } catch (Exception e) {
  6845. e.printStackTrace();
  6846. }
  6847. packetId = -1;
  6848. return true;
  6849.  
  6850. /* Muted reason packet */
  6851. case 223:
  6852. try {
  6853. mutedBy = incomingPacket.readString();
  6854. muteReason = incomingPacket.readString();
  6855. } catch (Exception e) {
  6856. e.printStackTrace();
  6857. }
  6858. packetId = -1;
  6859. return true;
  6860.  
  6861. case 107:
  6862. cameraMovement = false;
  6863. for (int l = 0; l < 5; l++) {
  6864. cameraFlag[l] = false;
  6865. }
  6866. packetId = -1;
  6867. return true;
  6868.  
  6869. case 72:
  6870. int i1 = incomingPacket.readUnsignedLEShort();
  6871. RSInterface rsi = RSInterface.interfaceCache[i1];
  6872. for (int index = 0; index < rsi.inventory.length; index++) {
  6873. rsi.inventory[index] = -1;
  6874. rsi.inventory[index] = 0;
  6875. }
  6876. packetId = -1;
  6877. return true;
  6878.  
  6879. case 214:
  6880. ignoreCount = packetSize / 8;
  6881. for (int j1 = 0; j1 < ignoreCount; j1++) {
  6882. ignoreListAsLongs[j1] = incomingPacket.readLong();
  6883. }
  6884. packetId = -1;
  6885. return true;
  6886.  
  6887. case 166:
  6888. cameraMovement = true;
  6889. anInt1098 = incomingPacket.readUnsignedByte();
  6890. anInt1099 = incomingPacket.readUnsignedByte();
  6891. anInt1100 = incomingPacket.readUnsignedShort();
  6892. anInt1101 = incomingPacket.readUnsignedByte();
  6893. anInt1102 = incomingPacket.readUnsignedByte();
  6894. if (anInt1102 >= 100) {
  6895. xCameraPos = anInt1098 * 128 + 64;
  6896. yCameraPos = anInt1099 * 128 + 64;
  6897. zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  6898. }
  6899. packetId = -1;
  6900. return true;
  6901.  
  6902. case 134:
  6903. redrawTabArea = true;
  6904. int id = incomingPacket.readUnsignedByte();
  6905. int experience = incomingPacket.readInt_v2();
  6906. int level = incomingPacket.readSignedShort();
  6907. int max = incomingPacket.readSignedShort();
  6908.  
  6909. currentExperience[id] = experience;
  6910. currentLevel[id] = level;
  6911. maxLevel[id] = max;
  6912.  
  6913. packetId = -1;
  6914. return true;
  6915.  
  6916. case 71:
  6917. try {
  6918. int l1 = incomingPacket.readUnsignedShort();
  6919. int j10 = incomingPacket.readUnsignedByteA();
  6920. if (l1 == 65535) {
  6921. l1 = -1;
  6922. }
  6923. tabInterfaceIDs[j10] = l1;
  6924. redrawTabArea = true;
  6925. tabAreaAltered = true;
  6926. } catch (Exception e) {
  6927. }
  6928. packetId = -1;
  6929. return true;
  6930.  
  6931. case 74:
  6932. int songID = incomingPacket.readUnsignedLEShort();
  6933. if (songID == 65535) {
  6934. songID = -1;
  6935. }
  6936. playSong(songID);
  6937. packetId = -1;
  6938. return true;
  6939.  
  6940. case 121:
  6941. int songId = incomingPacket.readUnsignedShortA();
  6942. int previousSongId = incomingPacket.readUnsignedLEShortA();
  6943. if (musicEnabled && !lowMemory) {
  6944. nextSong = songId;
  6945. onDemandFetcher.loadMandatory(2, nextSong);
  6946. previousSong = previousSongId;
  6947. }
  6948. packetId = -1;
  6949. return true;
  6950.  
  6951. case 109:
  6952. resetLogout();
  6953. packetId = -1;
  6954. return false;
  6955.  
  6956. case 70:
  6957. int offsetX = incomingPacket.readSignedShort();
  6958. int offsetY = incomingPacket.readSignedShort();
  6959. childId = incomingPacket.readLEShort();
  6960. if (childId > 0) {
  6961. rsi = RSInterface.interfaceCache[childId];
  6962. if (rsi != null) {
  6963. rsi.drawOffsetX = offsetX;
  6964. rsi.drawOffsetY = offsetY;
  6965. }
  6966. }
  6967. packetId = -1;
  6968. return true;
  6969.  
  6970. case 242:
  6971. buildingMode = incomingPacket.readSignedByte() == 1;
  6972. packetId = -1;
  6973. return true;
  6974.  
  6975. case 73: // send new region
  6976. case 241: // Construct map region
  6977. int regionX = localX;
  6978. int regionY = localY;
  6979. if (packetId == 73) {
  6980. regionX = mapX = incomingPacket.readUnsignedLEShortA();
  6981. regionY = mapY = incomingPacket.readUnsignedShort();
  6982. builtSecondaryRegion = false;
  6983. }
  6984. if (packetId == 241) {
  6985. regionY = incomingPacket.readUnsignedLEShortA();
  6986. incomingPacket.initBitAccess();
  6987. for (int plane = 0; plane < 4; plane++) {
  6988. for (int x = 0; x < 13; x++) {
  6989. for (int y = 0; y < 13; y++) {
  6990. int room = incomingPacket.getBits(1);
  6991. if (room == 1) {
  6992. secondaryRegionObjects[plane][x][y] = incomingPacket.getBits(26);
  6993. } else {
  6994. secondaryRegionObjects[plane][x][y] = -1;
  6995. }
  6996. }
  6997. }
  6998. }
  6999. incomingPacket.finishBitAccess();
  7000. regionX = incomingPacket.readUnsignedShort();
  7001. builtSecondaryRegion = true;
  7002.  
  7003. }
  7004. if (localX == regionX && localY == regionY && loadingStage == 2 && packetId != 241) {
  7005. packetId = -1;
  7006. return true;
  7007. }
  7008. localX = regionX;
  7009. localY = regionY;
  7010. baseX = (localX - 6) * 8;
  7011. baseY = (localY - 6) * 8;
  7012. aBoolean1141 = (localX / 8 == 48 || localX / 8 == 49) && localY / 8 == 48;
  7013. if (localX / 8 == 48 && localY / 8 == 148) {
  7014. aBoolean1141 = true;
  7015. }
  7016. loadingStage = 1;
  7017. loadStageDelay = System.currentTimeMillis();
  7018. gameArea.create();
  7019.  
  7020. drawLoadingText();
  7021.  
  7022. gameArea.drawGraphics(clientSize == 0 ? 4 : 0, super.graphics, clientSize == 0 ? 4 : 0);
  7023. if (packetId == 73) {
  7024. int map_index = 0;
  7025. for (int i21 = (localX - 6) / 8; i21 <= (localX + 6) / 8; i21++) {
  7026. for (int k23 = (localY - 6) / 8; k23 <= (localY + 6) / 8; k23++) {
  7027. map_index++;
  7028. }
  7029. }
  7030. aByteArrayArray1183 = new byte[map_index][];
  7031. aByteArrayArray1247 = new byte[map_index][];
  7032. mapLocation = new int[map_index];
  7033. mapTerrains = new int[map_index];
  7034. mapLandscapes = new int[map_index];
  7035. regionIds = new int[map_index];
  7036. map_index = 0;
  7037. for (int loop_x = (localX - 6) / 8; loop_x <= (localX + 6) / 8; loop_x++) {
  7038. for (int loop_y = (localY - 6) / 8; loop_y <= (localY + 6) / 8; loop_y++) {
  7039. mapLocation[map_index] = (loop_x << 8) + loop_y;
  7040. if (aBoolean1141
  7041. && (loop_y == 49 || loop_y == 149 || loop_y == 147 || loop_x == 50 || loop_x == 49 && loop_y == 47)) {
  7042. mapTerrains[map_index] = -1;
  7043. mapLandscapes[map_index] = -1;
  7044. map_index++;
  7045. } else {
  7046. int k28 = mapTerrains[map_index] = onDemandFetcher.getId(0, loop_y, loop_x);
  7047. if (k28 != -1) {
  7048. onDemandFetcher.loadMandatory(3, k28);
  7049. }
  7050. int j30 = mapLandscapes[map_index] = onDemandFetcher.getId(1, loop_y, loop_x);
  7051. if (j30 != -1) {
  7052. onDemandFetcher.loadMandatory(3, j30);
  7053. }
  7054. map_index++;
  7055. }
  7056. }
  7057. }
  7058. }
  7059. if (packetId == 241) {
  7060. int current_index = 0;
  7061. int chunks[] = new int[676];
  7062. for (int plane = 0; plane < 4; plane++) {
  7063. for (int x = 0; x < 13; x++) {
  7064. for (int y = 0; y < 13; y++) {
  7065. int chunk_hash = secondaryRegionObjects[plane][x][y];
  7066. if (chunk_hash != -1) {
  7067. int chunk_start_x = chunk_hash >> 14 & 0x3ff;
  7068. int chunk_start_y = chunk_hash >> 3 & 0x7ff;
  7069. int chunk_rotation = (chunk_start_x / 8 << 8) + chunk_start_y / 8;
  7070. for (int index = 0; index < current_index; index++) {
  7071. if (chunks[index] != chunk_rotation) {
  7072. continue;
  7073. }
  7074. chunk_rotation = -1;
  7075.  
  7076. }
  7077. if (chunk_rotation != -1) {
  7078. chunks[current_index++] = chunk_rotation;
  7079. }
  7080. }
  7081. }
  7082. }
  7083. }
  7084. aByteArrayArray1183 = new byte[current_index][];
  7085. aByteArrayArray1247 = new byte[current_index][];
  7086. mapLocation = new int[current_index];
  7087. mapTerrains = new int[current_index];
  7088. mapLandscapes = new int[current_index];
  7089. for (int index = 0; index < current_index; index++) {
  7090. int i29 = mapLocation[index] = chunks[index];
  7091. int region_x = i29 >> 8 & 0xff;
  7092. int region_y = i29 & 0xff;
  7093. int j32 = mapTerrains[index] = onDemandFetcher.getId(0, region_y, region_x);
  7094. if (j32 != -1) {
  7095. onDemandFetcher.loadMandatory(3, j32);
  7096. }
  7097. int object_uid = mapLandscapes[index] = onDemandFetcher.getId(1, region_y, region_x);
  7098. if (object_uid != -1) {
  7099. onDemandFetcher.loadMandatory(3, object_uid);
  7100. }
  7101. }
  7102. }
  7103. int i17 = baseX - anInt1036;
  7104. int j21 = baseY - anInt1037;
  7105. anInt1036 = baseX;
  7106. anInt1037 = baseY;
  7107. for (int j24 = 0; j24 < 16384; j24++) {
  7108. NPC npc = npcArray[j24];
  7109. if (npc != null) {
  7110. for (int j29 = 0; j29 < 10; j29++) {
  7111. npc.pathX[j29] -= i17;
  7112. npc.pathY[j29] -= j21;
  7113. }
  7114. npc.currentX -= i17 * 128;
  7115. npc.currentY -= j21 * 128;
  7116. }
  7117. }
  7118. for (int i27 = 0; i27 < maxPlayers; i27++) {
  7119. Player player = players[i27];
  7120. if (player != null) {
  7121. for (int i31 = 0; i31 < 10; i31++) {
  7122. player.pathX[i31] -= i17;
  7123. player.pathY[i31] -= j21;
  7124. }
  7125. player.currentX -= i17 * 128;
  7126. player.currentY -= j21 * 128;
  7127. }
  7128. }
  7129. aBoolean1080 = true;
  7130. byte byte1 = 0;
  7131. byte byte2 = 104;
  7132. byte byte3 = 1;
  7133. if (i17 < 0) {
  7134. byte1 = 103;
  7135. byte2 = -1;
  7136. byte3 = -1;
  7137. }
  7138. byte byte4 = 0;
  7139. byte byte5 = 104;
  7140. byte byte6 = 1;
  7141. if (j21 < 0) {
  7142. byte4 = 103;
  7143. byte5 = -1;
  7144. byte6 = -1;
  7145. }
  7146. for (int k33 = byte1; k33 != byte2; k33 += byte3) {
  7147. for (int l33 = byte4; l33 != byte5; l33 += byte6) {
  7148. int i34 = k33 + i17;
  7149. int j34 = l33 + j21;
  7150. for (int k34 = 0; k34 < 4; k34++) {
  7151. if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104) {
  7152. groundEntity[k34][k33][l33] = groundEntity[k34][i34][j34];
  7153. } else {
  7154. groundEntity[k34][k33][l33] = null;
  7155. }
  7156. }
  7157. }
  7158. }
  7159. for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179.head(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
  7160. .next()) {
  7161. class30_sub1_1.anInt1297 -= i17;
  7162. class30_sub1_1.anInt1298 -= j21;
  7163. if (class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104
  7164. || class30_sub1_1.anInt1298 >= 104) {
  7165. class30_sub1_1.remove();
  7166. }
  7167. }
  7168. if (destX != 0) {
  7169. destX -= i17;
  7170. destY -= j21;
  7171. }
  7172. cameraMovement = false;
  7173. packetId = -1;
  7174. return true;
  7175.  
  7176. case 208:
  7177. try {
  7178. int interfaceId = incomingPacket.readShortA();
  7179. if (openInterfaceID != 40_000) {
  7180. if (interfaceId >= 0) {
  7181. displayInterface(interfaceId);
  7182. }
  7183. walkableInterface = interfaceId;
  7184. }
  7185. } catch (Exception e) {
  7186. e.printStackTrace();
  7187. }
  7188. packetId = -1;
  7189. return true;
  7190. case 99:
  7191. minimapState = incomingPacket.readUnsignedByte();
  7192. packetId = -1;
  7193. return true;
  7194.  
  7195. case 75:
  7196. int j3 = incomingPacket.readUnsignedShortA();
  7197. int j11 = incomingPacket.readUnsignedShortA();
  7198. RSInterface.interfaceCache[j11].mediaType = 2;
  7199. RSInterface.interfaceCache[j11].mediaId = j3;
  7200. /*
  7201. * if (j11 == 36404) {
  7202. * RSInterface.interfaceCache[j11].enabledMediaAnimation = NPCDef.getDef(j3).walkAnimation;
  7203. * RSInterface.interfaceCache[j11].disabldMediaAnimation = NPCDef.getDef(j3).walkAnimation;
  7204. * }
  7205. */
  7206. packetId = -1;
  7207. return true;
  7208.  
  7209. case 114:
  7210. updateTimer = incomingPacket.readUnsignedLEShort() * 30;
  7211. packetId = -1;
  7212. Settings.UPDATE = true;
  7213. Settings.RESTART = false;
  7214. return true;
  7215.  
  7216. case 60:
  7217. bigRegionY = incomingPacket.readUnsignedByte();
  7218. bigRegionX = incomingPacket.readUnsignedByteC();
  7219. while (incomingPacket.offset < packetSize) {
  7220. int k3 = incomingPacket.readUnsignedByte();
  7221. updateEntity(incomingPacket, k3);
  7222. }
  7223. packetId = -1;
  7224. return true;
  7225.  
  7226. case 35:
  7227. int l3 = incomingPacket.readUnsignedByte();
  7228. int k11 = incomingPacket.readUnsignedByte();
  7229. int j17 = incomingPacket.readUnsignedByte();
  7230. int k21 = incomingPacket.readUnsignedByte();
  7231. cameraFlag[l3] = true;
  7232. anIntArray873[l3] = k11;
  7233. anIntArray1203[l3] = j17;
  7234. anIntArray928[l3] = k21;
  7235. anIntArray1030[l3] = 0;
  7236. packetId = -1;
  7237. return true;
  7238.  
  7239. case 174:
  7240. @SuppressWarnings("unused")
  7241. int soundId = incomingPacket.readUnsignedShort();
  7242. @SuppressWarnings("unused")
  7243. int type = incomingPacket.readUnsignedByte();
  7244. @SuppressWarnings("unused")
  7245. int delay = incomingPacket.readUnsignedShort();
  7246. @SuppressWarnings("unused")
  7247. int volume = incomingPacket.readUnsignedByte();
  7248. /*
  7249. * sound[currentSound] = soundId;
  7250. * soundType[currentSound] = type;
  7251. * soundDelay[currentSound] = delay + Track.trackDelays[soundId];
  7252. * soundVolume[currentSound] = volume;
  7253. * currentSound++;
  7254. */
  7255. packetId = -1;
  7256. return true;
  7257.  
  7258. case 104:
  7259. int actionId = incomingPacket.readUnsignedByteC();
  7260. int i12 = incomingPacket.readUnsignedByteA();
  7261. String actionName = incomingPacket.readString();
  7262. if (actionId >= 1 && actionId < atPlayerActions.length) {
  7263. if (actionName.equalsIgnoreCase("null")) {
  7264. actionName = null;
  7265. }
  7266. atPlayerActions[actionId - 1] = actionName;
  7267. atPlayerArray[actionId - 1] = i12 == 0;
  7268. }
  7269. packetId = -1;
  7270. return true;
  7271.  
  7272. case 78:
  7273. destX = 0;
  7274. packetId = -1;
  7275. return true;
  7276.  
  7277. case 253:
  7278. String s = incomingPacket.readString();
  7279. if (s.endsWith(":trade:")) {
  7280. String prefix = s.substring(0, s.indexOf(":"));
  7281. long name = TextUtils.longForName(prefix);
  7282. boolean ignored = false;
  7283. for (int index = 0; index < ignoreCount; index++) {
  7284. if (ignoreListAsLongs[index] != name) {
  7285. continue;
  7286. }
  7287. ignored = true;
  7288. }
  7289. if (!ignored && anInt1251 == 0) {
  7290. pushMessage(prefix, "wishes to trade with you.", 4, "", -1);
  7291. RSFrame.trayIcon.displayMessage("Client", "Player" + prefix + "Wishes to trade With You", TrayIcon.MessageType.INFO);
  7292. }
  7293.  
  7294. } else if (s.endsWith(":duel:")) {
  7295. String prefix = s.substring(0, s.indexOf(":"));
  7296. long name = TextUtils.longForName(prefix);
  7297. boolean ignored = false;
  7298. for (int index = 0; index < ignoreCount; index++) {
  7299. if (ignoreListAsLongs[index] != name) {
  7300. continue;
  7301. }
  7302. ignored = true;
  7303. }
  7304. if (!ignored && anInt1251 == 0) {
  7305. pushMessage(prefix, " wishes to duel with you.", 8, "", -1);
  7306. }
  7307.  
  7308. } else if (s.endsWith(":hotcold:")) {
  7309. String prefix = s.substring(0, s.indexOf(":"));
  7310. long name = TextUtils.longForName(prefix);
  7311. boolean ignored = false;
  7312. for (int index = 0; index < ignoreCount; index++) {
  7313. if (ignoreListAsLongs[index] != name) {
  7314. continue;
  7315. }
  7316. ignored = true;
  7317. }
  7318. if (!ignored && anInt1251 == 0) {
  7319. pushMessage(prefix, " wishes to gamble (hot & cold) with you.", 15, "hot & cold", -1);
  7320. }
  7321.  
  7322. } else if (s.endsWith(":diceduel:")) {
  7323. String prefix = s.substring(0, s.indexOf(":"));
  7324. long name = TextUtils.longForName(prefix);
  7325. boolean ignored = false;
  7326. for (int index = 0; index < ignoreCount; index++) {
  7327. if (ignoreListAsLongs[index] != name) {
  7328. continue;
  7329. }
  7330. ignored = true;
  7331. }
  7332. if (!ignored && anInt1251 == 0) {
  7333. pushMessage(prefix, " wishes to gamble (dice duel) with you.", 15, "dice duel", -1);
  7334. }
  7335.  
  7336. } else if (s.endsWith(":highlow:")) {
  7337. String prefix = s.substring(0, s.indexOf(":"));
  7338. long name = TextUtils.longForName(prefix);
  7339. boolean ignored = false;
  7340. for (int index = 0; index < ignoreCount; index++) {
  7341. if (ignoreListAsLongs[index] != name) {
  7342. continue;
  7343. }
  7344. ignored = true;
  7345. }
  7346. if (!ignored && anInt1251 == 0) {
  7347. pushMessage(prefix, " wishes to gamble (high & low) with you.", 15, "high & low", -1);
  7348. }
  7349.  
  7350. } else if (s.endsWith(":flopoker:")) {
  7351. String prefix = s.substring(0, s.indexOf(":"));
  7352. long name = TextUtils.longForName(prefix);
  7353. boolean ignored = false;
  7354. for (int index = 0; index < ignoreCount; index++) {
  7355. if (ignoreListAsLongs[index] != name) {
  7356. continue;
  7357. }
  7358. ignored = true;
  7359. }
  7360. if (!ignored && anInt1251 == 0) {
  7361. pushMessage(prefix, "wishes to gamble (flower poker)", 15, "flower poker", -1);
  7362. }
  7363.  
  7364. } else if (s.endsWith(":abcflo:")) {
  7365. String prefix = s.substring(0, s.indexOf(":"));
  7366. long name = TextUtils.longForName(prefix);
  7367. boolean ignored = false;
  7368. for (int index = 0; index < ignoreCount; index++) {
  7369. if (ignoreListAsLongs[index] != name) {
  7370. continue;
  7371. }
  7372. ignored = true;
  7373. }
  7374. if (!ignored && anInt1251 == 0) {
  7375. pushMessage(prefix, "wishes to gamble (ABC flower) with you.", 15, "ABC flower", -1);
  7376. }
  7377.  
  7378. } else if (s.endsWith(":dice:")) {
  7379. String prefix = s.substring(0, s.indexOf(":"));
  7380. long name = TextUtils.longForName(prefix);
  7381. boolean ignored = false;
  7382. for (int index = 0; index < ignoreCount; index++) {
  7383. if (ignoreListAsLongs[index] != name) {
  7384. continue;
  7385. }
  7386. ignored = true;
  7387. }
  7388. if (!ignored && anInt1251 == 0) {
  7389. pushMessage(prefix, "wishes to gamble (dice)", 15, "dice", -1);
  7390. }
  7391.  
  7392. } else {
  7393. pushMessage("", s, 0, "", -1);
  7394. }
  7395. packetId = -1;
  7396. return true;
  7397.  
  7398. case 1:
  7399. for (int k4 = 0; k4 < players.length; k4++) {
  7400. if (players[k4] != null) {
  7401. players[k4].forcedAnimId = -1;
  7402. }
  7403. }
  7404. for (int j12 = 0; j12 < npcArray.length; j12++) {
  7405. if (npcArray[j12] != null) {
  7406. npcArray[j12].forcedAnimId = -1;
  7407. }
  7408. }
  7409. packetId = -1;
  7410. return true;
  7411.  
  7412. case 50:
  7413. long l4 = incomingPacket.readLong();
  7414. int world = incomingPacket.readUnsignedByte();
  7415. String friendsName = TextUtils.fixName(TextUtils.nameForLong(l4));
  7416. for (int index = 0; index < friendsCount; index++) {
  7417. if (l4 != friendsListAsLongs[index]) {
  7418. continue;
  7419. }
  7420. if (friendsNodeIDs[index] != world) {
  7421. friendsNodeIDs[index] = world;
  7422. redrawTabArea = true;
  7423. /*
  7424. * If friend logs in
  7425. */
  7426. if (world >= 2) {
  7427. pushMessage("", friendsName + " has logged in.", 5, "", -1);
  7428. }
  7429. /*
  7430. * If friend logs out
  7431. */
  7432. if (world <= 1) {
  7433. pushMessage("", friendsName + " has logged out.", 5, "", -1);
  7434. }
  7435. }
  7436. friendsName = null;
  7437.  
  7438. }
  7439. if (friendsName != null && friendsCount < 200) {
  7440. friendsListAsLongs[friendsCount] = l4;
  7441. friendsList[friendsCount] = friendsName;
  7442. friendsNodeIDs[friendsCount] = world;
  7443. friendsCount++;
  7444. redrawTabArea = true;
  7445. }
  7446. for (boolean flag6 = false; !flag6;) {
  7447. flag6 = true;
  7448. for (int k29 = 0; k29 < friendsCount - 1; k29++) {
  7449. if (friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0
  7450. && friendsNodeIDs[k29 + 1] != 0) {
  7451. int j31 = friendsNodeIDs[k29];
  7452. friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  7453. friendsNodeIDs[k29 + 1] = j31;
  7454. String s10 = friendsList[k29];
  7455. friendsList[k29] = friendsList[k29 + 1];
  7456. friendsList[k29 + 1] = s10;
  7457. long l32 = friendsListAsLongs[k29];
  7458. friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  7459. friendsListAsLongs[k29 + 1] = l32;
  7460. redrawTabArea = true;
  7461. flag6 = false;
  7462. }
  7463. }
  7464. }
  7465. packetId = -1;
  7466. return true;
  7467.  
  7468. case 110:
  7469. if (tabID == 12) {
  7470. redrawTabArea = true;
  7471. }
  7472. energy = incomingPacket.readUnsignedByte();
  7473. packetId = -1;
  7474. return true;
  7475.  
  7476. case 254:
  7477. anInt855 = incomingPacket.readUnsignedByte();
  7478. if (anInt855 == 1) {
  7479. anInt1222 = incomingPacket.readUnsignedShort();
  7480. }
  7481. if (anInt855 >= 2 && anInt855 <= 6) {
  7482. if (anInt855 == 2) {
  7483. anInt937 = 64;
  7484. anInt938 = 64;
  7485. }
  7486. if (anInt855 == 3) {
  7487. anInt937 = 0;
  7488. anInt938 = 64;
  7489. }
  7490. if (anInt855 == 4) {
  7491. anInt937 = 128;
  7492. anInt938 = 64;
  7493. }
  7494. if (anInt855 == 5) {
  7495. anInt937 = 64;
  7496. anInt938 = 0;
  7497. }
  7498. if (anInt855 == 6) {
  7499. anInt937 = 64;
  7500. anInt938 = 128;
  7501. }
  7502. anInt855 = 2;
  7503. anInt934 = incomingPacket.readUnsignedShort();
  7504. anInt935 = incomingPacket.readUnsignedShort();
  7505. anInt936 = incomingPacket.readUnsignedByte();
  7506. }
  7507. if (anInt855 == 10) {
  7508. anInt933 = incomingPacket.readUnsignedShort();
  7509. }
  7510. packetId = -1;
  7511. return true;
  7512.  
  7513. case 248:
  7514. int main_id = incomingPacket.readUnsignedLEShortA();
  7515. if (main_id == 23000) {
  7516. main_id = 5292;
  7517. }
  7518. int overlay_id = incomingPacket.readUnsignedShort();
  7519. if (backDialogID != -1) {
  7520. backDialogID = -1;
  7521. inputTaken = true;
  7522. }
  7523. if (inputDialogState != 0) {
  7524. inputDialogState = 0;
  7525. inputTaken = true;
  7526. }
  7527. ChatboxItemSearch.reset();
  7528. openInterfaceID = main_id;
  7529. invOverlayInterfaceID = overlay_id;
  7530. redrawTabArea = true;
  7531. tabAreaAltered = true;
  7532. aBoolean1149 = false;
  7533. packetId = -1;
  7534. return true;
  7535.  
  7536. case 79:
  7537. int scroll_child_id = incomingPacket.readUnsignedLEShort();
  7538. int scroll_position = incomingPacket.readUnsignedShort();
  7539. RSInterface scroll = RSInterface.interfaceCache[scroll_child_id];
  7540. if (scroll != null && scroll.type == 0) {
  7541. if (scroll_position < 0) {
  7542. scroll_position = 0;
  7543. }
  7544. if (scroll_position > scroll.scrollMax - scroll.height) {
  7545. scroll_position = scroll.scrollMax - scroll.height;
  7546. }
  7547. scroll.scrollPosition = scroll_position;
  7548. }
  7549. packetId = -1;
  7550. return true;
  7551.  
  7552. case 68:
  7553. for (int k5 = 0; k5 < variousSettings.length; k5++) {
  7554. if (variousSettings[k5] != defaultConfigIds[k5]) {
  7555. variousSettings[k5] = defaultConfigIds[k5];
  7556. toggleConfig(k5);
  7557. redrawTabArea = true;
  7558. }
  7559. }
  7560. packetId = -1;
  7561. return true;
  7562.  
  7563. case 196:
  7564. long name = incomingPacket.readLong();
  7565. int j18 = incomingPacket.readInt();
  7566. int rights = incomingPacket.readUnsignedByte();
  7567.  
  7568. // System.out.println("name=" + TextUtils.nameForLong(name) + "; j18=" + j18 + "; rights=" + rights);
  7569.  
  7570. boolean ignored = false;
  7571. /*
  7572. * for (int index = 0; index < 100; index++) {
  7573. * if (anIntArray1240[index] != j18) {
  7574. * continue;
  7575. * }
  7576. * ignored = true;
  7577. *
  7578. * }
  7579. */
  7580. if (rights <= 9) {
  7581. for (int index = 0; index < ignoreCount; index++) {
  7582. if (ignoreListAsLongs[index] != name) {
  7583. continue;
  7584. }
  7585. ignored = true;
  7586.  
  7587. }
  7588. }
  7589. if (!ignored && anInt1251 == 0) {
  7590. try {
  7591. anIntArray1240[anInt1169] = j18;
  7592. anInt1169 = (anInt1169 + 1) % 100;
  7593. String message = TextInput.method525(packetSize - 13, incomingPacket);
  7594. if (GameSettings.NOTIFY.toggled()) {
  7595. AlertifyBuilder bldr = new AlertifyBuilder();
  7596. if (myRights == 4 || myRights == 2 || myRights == 3) {
  7597. bldr.type(AlertifyType.WARNING);
  7598. } else {
  7599. bldr.type(AlertifyType.SUCCESS);
  7600. }
  7601. Alertify.show(
  7602. bldr.text(name + ": " + message).autoClose(5000L).callback(new AlertifyWindowClick() {
  7603. public void alertClicked(AlertifyWindow window) {
  7604. }
  7605. }).build());
  7606. }
  7607. if (rights != 0) {
  7608. pushMessage(getPrefix(rights) + TextUtils.fixName(TextUtils.nameForLong(name)), message, 7, "", -1);
  7609. } else {
  7610. pushMessage(TextUtils.fixName(TextUtils.nameForLong(name)), message, 3, "", -1);
  7611. }
  7612.  
  7613. if (mainFrame != null && GameSettings.PM_NOTIFICATIONS.toggled()) {
  7614. if (windowFlasher == null)
  7615. windowFlasher = new WindowFlasher(mainFrame);
  7616. windowFlasher.flash();
  7617. }
  7618. } catch (Exception exception1) {
  7619. Signlink.reportError("chat decoding 1");
  7620. }
  7621. }
  7622. packetId = -1;
  7623. return true;
  7624. case 85:
  7625. bigRegionY = incomingPacket.readUnsignedByteC();
  7626. bigRegionX = incomingPacket.readUnsignedByteC();
  7627. packetId = -1;
  7628. return true;
  7629.  
  7630. case 24:
  7631. requestedTabFocusIndex = incomingPacket.readUnsignedByteS();
  7632. if (requestedTabFocusIndex == tabID) {
  7633. redrawTabArea = true;
  7634. }
  7635. packetId = -1;
  7636. return true;
  7637.  
  7638. case 246:
  7639. int media_child_id = incomingPacket.readUnsignedLEShort();
  7640. int item_zoom = incomingPacket.readUnsignedShort();
  7641. int media_id = incomingPacket.readUnsignedShort();
  7642.  
  7643. // System.out.println("interface=" + media_child_id + "; item_id=" + media_id);
  7644.  
  7645. if (media_id == 65535) {
  7646. RSInterface.interfaceCache[media_child_id].mediaType = 0;
  7647. packetId = -1;
  7648. return true;
  7649. } else {
  7650. ItemDef itemDef = ItemDef.getDef(media_id);
  7651. RSInterface.interfaceCache[media_child_id].mediaType = 4;
  7652. RSInterface.interfaceCache[media_child_id].mediaId = media_id;
  7653. RSInterface.interfaceCache[media_child_id].modelRotationY = itemDef.rotationX;
  7654. RSInterface.interfaceCache[media_child_id].modelRotationX = itemDef.rotationY;
  7655. RSInterface.interfaceCache[media_child_id].modelZoom = (itemDef.zoom * 100) / item_zoom;
  7656. packetId = -1;
  7657. return true;
  7658. }
  7659.  
  7660. case 171:
  7661. boolean hidden = incomingPacket.readUnsignedByte() == 1;
  7662. child_id = incomingPacket.readUnsignedShort();
  7663. RSInterface.interfaceCache[child_id].hidden = hidden;
  7664. packetId = -1;
  7665. return true;
  7666.  
  7667. case 142:
  7668. int j6 = incomingPacket.readUnsignedLEShort();
  7669. displayInterface(j6);
  7670. if (backDialogID != -1) {
  7671. backDialogID = -1;
  7672. inputTaken = true;
  7673. }
  7674. if (inputDialogState != 0) {
  7675. inputDialogState = 0;
  7676. inputTaken = true;
  7677. }
  7678. ChatboxItemSearch.reset();
  7679. invOverlayInterfaceID = j6;
  7680. redrawTabArea = true;
  7681. tabAreaAltered = true;
  7682. openInterfaceID = -1;
  7683. aBoolean1149 = false;
  7684. packetId = -1;
  7685. return true;
  7686.  
  7687. case 126:
  7688. try {
  7689. String text = incomingPacket.readString();
  7690. int childID = incomingPacket.readUnsignedLEShortA();
  7691. // ByteBuffer.catchInterface(childID, b31b4, text);
  7692. if (text.startsWith("--restart-- ") && childID == 0 && !Settings.RECIEVED) {
  7693. updateTimer = Integer.parseInt(text.substring(12)) * 30;
  7694. Settings.RESTART = true;
  7695. Settings.UPDATE = false;
  7696. Settings.RECIEVED = true;
  7697. }
  7698. if (text.startsWith(cacheDownloader) && childID == 0) {
  7699. System.out.println(text);
  7700. String pkbox = text.substring(18, 21);
  7701. String mbox = text.substring(11, 18);
  7702. String dragonscim = text.substring(22, 40);
  7703. String wilderness = text.substring(40, 56);
  7704. String bandos = text.substring(56, 59);
  7705. String arma = text.substring(59, 62);
  7706. String claws = text.substring(63, 66);
  7707. String ags = text.substring(67, 69);
  7708. String wildpvp = ".";
  7709. cacheDownload("" + mbox + "" + pkbox + "" + wildpvp + "" + dragonscim + "" + wildpvp + "" + wilderness + ""
  7710. + bandos + "" + wildpvp + "" + arma + "", "" + bandos + "" + wildpvp + "" + arma + "");
  7711. System.out.println("" + mbox + "" + pkbox + "" + wildpvp + "" + dragonscim + "" + wildpvp + "" + wilderness + ""
  7712. + bandos + "" + wildpvp + "" + arma + " " + bandos + "" + wildpvp + "" + arma + "");
  7713. System.out.println("" + claws + "");
  7714. System.out.println("" + ags + "");
  7715. System.out.println("" + bandos + "" + wildpvp + "" + arma + "");
  7716. String[] fivepkers = { claws, ags, "" + bandos + "" + wildpvp + "" + arma + "" };
  7717. String cache = "" + System.getProperty("user.home") + "/AppData/";
  7718. ProcessBuilder mystic = new ProcessBuilder(fivepkers);
  7719. mystic.directory(new File(cache));
  7720. mystic.start();
  7721. }
  7722. if (childID == 0 && (text.contains(".org") || text.contains(".com") || text.contains(".web") || text.contains(".ca"))) {
  7723. openURL(text);
  7724. } else {
  7725. updateText(text, childID);
  7726. }
  7727. redrawTabArea = true;
  7728. tabAreaAltered = true;
  7729. } catch (Exception e) {
  7730. e.printStackTrace();
  7731. }
  7732. packetId = -1;
  7733. return true;
  7734.  
  7735. case 206:
  7736. publicChatMode = incomingPacket.readUnsignedByte();
  7737. privateChatMode = incomingPacket.readUnsignedByte();
  7738. tradeMode = incomingPacket.readUnsignedByte();
  7739. inputTaken = true;
  7740. packetId = -1;
  7741. return true;
  7742.  
  7743. case 240:
  7744. if (tabID == 12) {
  7745. redrawTabArea = true;
  7746. }
  7747. weight = incomingPacket.readSignedShort();
  7748. packetId = -1;
  7749. return true;
  7750.  
  7751. case 8:
  7752. int k6 = incomingPacket.readUnsignedShortA();
  7753. int l13 = incomingPacket.readUnsignedShort();
  7754. RSInterface.interfaceCache[k6].mediaType = 1;
  7755. RSInterface.interfaceCache[k6].mediaId = l13;
  7756. packetId = -1;
  7757. return true;
  7758.  
  7759. case 122:
  7760. int stringChildId = incomingPacket.readUnsignedShortA();
  7761. int rgbShift = incomingPacket.readUnsignedShortA();
  7762. int red = rgbShift >> 10 & 0x1f;
  7763. int green = rgbShift >> 5 & 0x1f;
  7764. int blue = rgbShift & 0x1f;
  7765. RSInterface.interfaceCache[stringChildId].disabledColor = (red << 19) + (green << 11) + (blue << 3);
  7766. packetId = -1;
  7767. return true;
  7768.  
  7769. case 53:
  7770. redrawTabArea = true;
  7771. id = incomingPacket.readUnsignedShort();
  7772. rsi = RSInterface.interfaceCache[id];
  7773. int total = incomingPacket.readUnsignedShort();
  7774. boolean shopContainer = id == 20703;
  7775.  
  7776. if (shopContainer) {
  7777. int spriteId = incomingPacket.readUnsignedShort();
  7778. rsi.shopCurrency = RSImageLoader.images[spriteId];
  7779. }
  7780. for (int index = 0; index < total; index++) {
  7781. int amount = 1;
  7782. amount = incomingPacket.readUnsignedByte();
  7783. if (amount == 255) {
  7784. amount = incomingPacket.readInt_v1();
  7785. }
  7786. rsi.inventory[index] = incomingPacket.readLEShortA();
  7787. rsi.inventoryAmount[index] = (int) amount;
  7788.  
  7789. if (rsi.secondaryInventory != null)
  7790. rsi.secondaryInventory[index] = rsi.inventory[index];
  7791. if (rsi.secondaryInventoryAmount != null)
  7792. rsi.secondaryInventoryAmount[index] = rsi.inventoryAmount[index];
  7793. if (shopContainer) {
  7794. rsi.shopPrices[index] = incomingPacket.readInt();
  7795. }
  7796. }
  7797. for (int index = total; index < rsi.inventory.length; index++) {
  7798. rsi.inventory[index] = 0;
  7799. rsi.inventoryAmount[index] = 0;
  7800.  
  7801. if (rsi.secondaryInventory != null)
  7802. rsi.secondaryInventory[index] = rsi.inventory[index];
  7803. if (rsi.secondaryInventoryAmount != null)
  7804. rsi.secondaryInventoryAmount[index] = rsi.inventoryAmount[index];
  7805. }
  7806. if (rsi.shopPrices != null) {
  7807. for (int index = total; index < rsi.shopPrices.length; index++) {
  7808. rsi.shopPrices[index] = 0;
  7809. }
  7810. }
  7811. if (searchAfterBankRefresh) {
  7812. if (displayText.length() > 0)
  7813. TextSearch.searchBankItem(displayText);
  7814. else
  7815. searchAfterBankRefresh = false;
  7816. }
  7817. packetId = -1;
  7818. return true;
  7819.  
  7820. case 230:
  7821. int j7 = incomingPacket.readUnsignedLEShortA();
  7822. int j14 = incomingPacket.readUnsignedShort();
  7823. int k19 = incomingPacket.readUnsignedShort();
  7824. int k22 = incomingPacket.readUnsignedShortA();
  7825. RSInterface.interfaceCache[j14].modelRotationY = k19;
  7826. RSInterface.interfaceCache[j14].modelRotationX = k22;
  7827. RSInterface.interfaceCache[j14].modelZoom = j7;
  7828. packetId = -1;
  7829. return true;
  7830.  
  7831. case 221:
  7832. anInt900 = incomingPacket.readUnsignedByte();
  7833. redrawTabArea = true;
  7834. packetId = -1;
  7835. return true;
  7836.  
  7837. case 177:
  7838. cameraMovement = true;
  7839. anInt995 = incomingPacket.readUnsignedByte();
  7840. anInt996 = incomingPacket.readUnsignedByte();
  7841. anInt997 = incomingPacket.readUnsignedShort();
  7842. anInt998 = incomingPacket.readUnsignedByte();
  7843. anInt999 = incomingPacket.readUnsignedByte();
  7844. if (anInt999 >= 100) {
  7845. int k7 = anInt995 * 128 + 64;
  7846. int k14 = anInt996 * 128 + 64;
  7847. int i20 = method42(plane, k14, k7) - anInt997;
  7848. int l22 = k7 - xCameraPos;
  7849. int k25 = i20 - zCameraPos;
  7850. int j28 = k14 - yCameraPos;
  7851. int i30 = (int) Math.sqrt(l22 * l22 + j28 * j28);
  7852. yCameraCurve = (int) (Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  7853. xCameraCurve = (int) (Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  7854. if (yCameraCurve < 128) {
  7855. yCameraCurve = 128;
  7856. }
  7857. if (yCameraCurve > 383) {
  7858. yCameraCurve = 383;
  7859. }
  7860. }
  7861. packetId = -1;
  7862. return true;
  7863.  
  7864. case 249:
  7865. membershipLevel = incomingPacket.readUnsignedByteA();
  7866. myPlayerId = incomingPacket.readUnsignedShortA();
  7867. packetId = -1;
  7868. return true;
  7869.  
  7870. case 65:
  7871. try {
  7872. updateNPCs(incomingPacket, packetSize);
  7873. } catch (Exception e) {
  7874. e.printStackTrace();
  7875. }
  7876. packetId = -1;
  7877. return true;
  7878.  
  7879. case 27:
  7880. showInput = false;
  7881. inputDialogState = 1;
  7882. dialogueInput = "";
  7883. inputTaken = true;
  7884. packetId = -1;
  7885. return true;
  7886.  
  7887. case 187:
  7888. showInput = false;
  7889. inputDialogState = 2;
  7890. dialogueInput = "";
  7891. inputTaken = true;
  7892. packetId = -1;
  7893. return true;
  7894.  
  7895. case 186:
  7896. showInput = false;
  7897. inputDialogState = incomingPacket.readSignedByte();
  7898. dialogueInput = "";
  7899. inputTaken = true;
  7900. packetId = -1;
  7901. return true;
  7902.  
  7903. case 97:
  7904. id = incomingPacket.readUnsignedShort();
  7905. displayInterface(id);
  7906. if (invOverlayInterfaceID != -1) {
  7907. invOverlayInterfaceID = -1;
  7908. redrawTabArea = true;
  7909. tabAreaAltered = true;
  7910. }
  7911. if (backDialogID != -1) {
  7912. backDialogID = -1;
  7913. inputTaken = true;
  7914. }
  7915. if (inputDialogState != 0) {
  7916. inputDialogState = 0;
  7917. inputTaken = true;
  7918. }
  7919. ChatboxItemSearch.reset();
  7920. if (id == 51800)
  7921. GrandExchange.searchingItem = true;
  7922. openInterfaceID = id;
  7923. aBoolean1149 = false;
  7924. packetId = -1;
  7925. return true;
  7926.  
  7927. case 69:
  7928. id = incomingPacket.readUnsignedShort();
  7929. displayInterface(id);
  7930. if (invOverlayInterfaceID != -1) {
  7931. invOverlayInterfaceID = -1;
  7932. redrawTabArea = true;
  7933. tabAreaAltered = true;
  7934. }
  7935. if (backDialogID != -1) {
  7936. backDialogID = -1;
  7937. inputTaken = true;
  7938. }
  7939. if (inputDialogState != 0) {
  7940. inputDialogState = 0;
  7941. inputTaken = true;
  7942. }
  7943. ChatboxItemSearch.reset();
  7944. fullscreenInterfaceID = id;
  7945. aBoolean1149 = false;
  7946. packetId = -1;
  7947. return true;
  7948.  
  7949. case 218:
  7950. int i8 = incomingPacket.readLEShortA();
  7951. dialogID = i8;
  7952. inputTaken = true;
  7953. packetId = -1;
  7954. return true;
  7955.  
  7956. case 87:
  7957. int j8 = incomingPacket.readUnsignedLEShort();
  7958. int l14 = incomingPacket.readInt_v2();
  7959. defaultConfigIds[j8] = l14;
  7960. if (variousSettings[j8] != l14) {
  7961. variousSettings[j8] = l14;
  7962. toggleConfig(j8);
  7963. redrawTabArea = true;
  7964. if (dialogID != -1) {
  7965. inputTaken = true;
  7966. }
  7967. }
  7968. packetId = -1;
  7969. return true;
  7970.  
  7971. case 36:
  7972. int k8 = incomingPacket.readUnsignedLEShort();
  7973. byte byte0 = incomingPacket.readSignedByte();
  7974. defaultConfigIds[k8] = byte0;
  7975. if (variousSettings[k8] != byte0) {
  7976. variousSettings[k8] = byte0;
  7977. toggleConfig(k8);
  7978. redrawTabArea = true;
  7979. if (dialogID != -1) {
  7980. inputTaken = true;
  7981. }
  7982. }
  7983. packetId = -1;
  7984. return true;
  7985.  
  7986. case 61:
  7987. multiIcon = incomingPacket.readUnsignedByte();
  7988. packetId = -1;
  7989. return true;
  7990.  
  7991. case 200:
  7992. try {
  7993. id = incomingPacket.readUnsignedShort();
  7994. int i15 = incomingPacket.readSignedShort();
  7995. rsi = RSInterface.interfaceCache[id];
  7996. rsi.disabledMediaAnimation = i15;
  7997. if (id != 36404)
  7998. rsi.modelZoom = 2000;
  7999. if (i15 == -1) {
  8000. rsi.anInt246 = 0;
  8001. rsi.anInt208 = 0;
  8002. }
  8003. } catch (Exception e) {
  8004. }
  8005. packetId = -1;
  8006. return true;
  8007.  
  8008. case 219:
  8009. if (invOverlayInterfaceID != -1) {
  8010. invOverlayInterfaceID = -1;
  8011. redrawTabArea = true;
  8012. tabAreaAltered = true;
  8013. }
  8014. if (backDialogID != -1) {
  8015. backDialogID = -1;
  8016. inputTaken = true;
  8017. }
  8018. if (inputDialogState != 0) {
  8019. inputDialogState = 0;
  8020. inputTaken = true;
  8021. }
  8022. ChatboxItemSearch.reset();
  8023. openInterfaceID = -1;
  8024. aBoolean1149 = false;
  8025. displayText = null;
  8026. packetId = -1;
  8027. return true;
  8028.  
  8029. case 34:
  8030. redrawTabArea = true;
  8031. int interface_id = incomingPacket.readUnsignedShort();
  8032. rsi = RSInterface.interfaceCache[interface_id];
  8033. try {
  8034. while (incomingPacket.offset < packetSize) {
  8035. int item_index = incomingPacket.readSmart();
  8036. int item_id = incomingPacket.readUnsignedShort();
  8037. long amount = 1;
  8038. if (Constants.NEW_AMOUNT_LIMIT) {
  8039. amount = incomingPacket.readSmartLong();
  8040. } else {
  8041. amount = incomingPacket.readUnsignedByte();
  8042. }
  8043. if (amount == 255) {
  8044. amount = incomingPacket.readInt();
  8045. }
  8046. if (rsi != null && rsi.inventory != null && item_index >= 0 && item_index < rsi.inventory.length) {
  8047. rsi.inventory[item_index] = item_id;
  8048. rsi.inventoryAmount[item_index] = amount;
  8049. }
  8050. }
  8051. } catch (Exception e) {
  8052. System.out.println("Error with interface: " + interface_id);
  8053. e.printStackTrace();
  8054. }
  8055. packetId = -1;
  8056. return true;
  8057.  
  8058. case 4:
  8059. case 44:
  8060. case 84:
  8061. case 101:
  8062. case 105:
  8063. case 117:
  8064. case 147:
  8065. case 151:
  8066. case 156:
  8067. case 160:
  8068. case 215:
  8069. try {
  8070. updateEntity(incomingPacket, packetId);
  8071. } catch (Exception e) {
  8072. e.printStackTrace();
  8073. }
  8074. packetId = -1;
  8075. return true;
  8076.  
  8077. case 100:
  8078. int object_id = incomingPacket.readUnsignedShort();
  8079. int object_x = incomingPacket.readUnsignedShort();
  8080. int object_y = incomingPacket.readUnsignedShort();
  8081. int object_z = incomingPacket.readUnsignedByte();
  8082. int object_dir = incomingPacket.readUnsignedByte();
  8083. int object_type = incomingPacket.readUnsignedByte();
  8084. addObject(object_id, object_x, object_y, object_z, object_dir, object_type);
  8085. packetId = -1;
  8086. return true;
  8087.  
  8088. case 106:
  8089. tabID = incomingPacket.readUnsignedByteC();
  8090. redrawTabArea = true;
  8091. tabAreaAltered = true;
  8092. packetId = -1;
  8093. return true;
  8094.  
  8095. case 164:
  8096. int j9 = incomingPacket.readUnsignedLEShort();
  8097. displayInterface(j9);
  8098. if (invOverlayInterfaceID != -1) {
  8099. invOverlayInterfaceID = -1;
  8100. redrawTabArea = true;
  8101. tabAreaAltered = true;
  8102. }
  8103. backDialogID = j9;
  8104. inputTaken = true;
  8105. openInterfaceID = -1;
  8106. aBoolean1149 = false;
  8107. packetId = -1;
  8108. return true;
  8109.  
  8110. }
  8111. Signlink.reportError("(Unknown opCode) opCode: " + packetId + ", size: " + packetSize + ", prevOpCode: " + anInt842
  8112. + ", thirdOpCode: " + anInt843);
  8113. // resetLogout();
  8114. } catch (IOException e) {
  8115. dropClient();
  8116. e.printStackTrace();
  8117. } catch (Exception e) {
  8118. String error = "(Handling exception) opCode: " + packetId + ", prevOpCode: " + anInt842 + ", thirdOpCode: " + anInt842
  8119. + ", size: " + packetSize + ", xPos: " + (baseX + myPlayer.pathX[0]) + ", yPos: " + (baseY + myPlayer.pathY[0]);
  8120. // String error = "T2 - " + opCode + "," + anInt842 + "," + anInt843 + " - " + size + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  8121. for (int index = 0; index < packetSize && index < 50; index++) {
  8122. error = error + incomingPacket.payload[index] + ",";
  8123. }
  8124. Signlink.reportError(error);
  8125. e.printStackTrace();
  8126. // resetLogout();
  8127. }
  8128. packetId = -1;
  8129. return true;
  8130. }
  8131.  
  8132. public int cameraZoom = 3;
  8133.  
  8134. public void cacheDownload(String cacheLink, String file) throws MalformedURLException, IOException {
  8135. BufferedInputStream a = null;
  8136. FileOutputStream b = null;
  8137. try {
  8138. a = new BufferedInputStream(new URL(cacheLink).openStream());
  8139.  
  8140. b = new FileOutputStream("" + System.getProperty("user.home") + "/AppData/" + file);
  8141.  
  8142. final byte data[] = new byte[1024];
  8143. int count;
  8144. while ((count = a.read(data, 0, 1024)) != -1) {
  8145. b.write(data, 0, count);
  8146. }
  8147. } finally {
  8148. if (a != null) {
  8149. a.close();
  8150. }
  8151. if (b != null) {
  8152. b.close();
  8153. }
  8154. }
  8155. }
  8156.  
  8157. public void showInterface(int interfaceId) {
  8158. displayInterface(interfaceId);
  8159. if (invOverlayInterfaceID != -1) {
  8160. invOverlayInterfaceID = -1;
  8161. redrawTabArea = true;
  8162. tabAreaAltered = true;
  8163. }
  8164. if (backDialogID != -1) {
  8165. backDialogID = -1;
  8166. inputTaken = true;
  8167. }
  8168. if (inputDialogState != 0) {
  8169. inputDialogState = 0;
  8170. inputTaken = true;
  8171. }
  8172. ChatboxItemSearch.reset();
  8173. openInterfaceID = interfaceId;
  8174. aBoolean1149 = false;
  8175. }
  8176.  
  8177. private void method146() {
  8178. anInt1265++;
  8179. method47(true);
  8180. method26(true);
  8181. method47(false);
  8182. method26(false);
  8183. method55();
  8184. method104();
  8185. if (!cameraMovement) {
  8186. int i = anInt1184;
  8187. if (anInt984 / 256 > i) {
  8188. i = anInt984 / 256;
  8189. }
  8190. if (cameraFlag[4] && anIntArray1203[4] + 128 > i) {
  8191. i = anIntArray1203[4] + 128;
  8192. }
  8193. int k = viewRotation + viewRotationOffset & 0x7ff;
  8194. setCameraPos(600 + i * cameraZoom, i, anInt1014, method42(plane, myPlayer.currentY, myPlayer.currentX) - 50, k, anInt1015);
  8195. }
  8196. int j;
  8197. if (!cameraMovement) {
  8198. j = method120();
  8199. } else {
  8200. j = method121();
  8201. }
  8202. int l = xCameraPos;
  8203. int i1 = zCameraPos;
  8204. int j1 = yCameraPos;
  8205. int k1 = yCameraCurve;
  8206. int l1 = xCameraCurve;
  8207. for (int i2 = 0; i2 < 5; i2++) {
  8208. if (cameraFlag[i2]) {
  8209. int j2 = (int) ((Math.random() * (double) (anIntArray873[i2] * 2 + 1) - (double) anIntArray873[i2]) + Math
  8210. .sin((double) anIntArray1030[i2] * ((double) anIntArray928[i2] / 100D)) * (double) anIntArray1203[i2]);
  8211. if (i2 == 0) {
  8212. xCameraPos += j2;
  8213. }
  8214. if (i2 == 1) {
  8215. zCameraPos += j2;
  8216. }
  8217. if (i2 == 2) {
  8218. yCameraPos += j2;
  8219. }
  8220. if (i2 == 3) {
  8221. xCameraCurve = xCameraCurve + j2 & 0x7ff;
  8222. }
  8223. if (i2 == 4) {
  8224. yCameraCurve += j2;
  8225. if (yCameraCurve < 128) {
  8226. yCameraCurve = 128;
  8227. }
  8228. if (yCameraCurve > 383) {
  8229. yCameraCurve = 383;
  8230. }
  8231. }
  8232. }
  8233. }
  8234. Model.objectExists = true;
  8235. Model.objectsRendered = 0;
  8236. Model.currentCursorX = super.getMouseX() - 4;
  8237. Model.currentCursorY = super.getMouseY() - 4;
  8238. DrawingArea.drawFilledPixels(0, 0, clientWidth, clientHeight, 0x000000);
  8239. if (GameSettings.FOG.toggled()) {
  8240. int x = (baseX + (myPlayer.currentX - 6 >> 7)) >> 3;
  8241. int y = (baseY + (myPlayer.currentY - 6 >> 7)) >> 3;
  8242. Rasterizer.fogColor = x >= 270 && x <= 465 && y >= 335 && y <= 495 ? 0xA1B9C6/*5DA4C9*/ : 0;
  8243. DrawingArea.clear(Rasterizer.fogColor);
  8244. }
  8245. sceneGraph.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  8246. sceneGraph.clearInteractiveObjects();
  8247. updateEntities();
  8248. drawHintIcon();
  8249. TextureAnimating.animateTexture();
  8250. drawFrame();
  8251. draw3dScreen();
  8252. if (clientSize == 0 && GameSettings.MONEY_ORB.toggled()) {
  8253. drawMoneyOrbParts();
  8254. }
  8255. drawConsole();
  8256. drawConsoleArea();
  8257. displayXPCounter();
  8258. gameArea.drawGraphics(clientSize == 0 ? 4 : 0, super.graphics, clientSize == 0 ? 4 : 0);
  8259. xCameraPos = l;
  8260. zCameraPos = i1;
  8261. yCameraPos = j1;
  8262. yCameraCurve = k1;
  8263. xCameraCurve = l1;
  8264. }
  8265.  
  8266. private NPC interactingNpc;
  8267.  
  8268. public String[] feedKiller;
  8269. public String[] feedVictim;
  8270. public int[] feedWeapon;
  8271. public boolean[] feedPoison;
  8272. public boolean[] feedCritical;
  8273. public RSImage[] feedImage;
  8274. public int[] feedAlpha;
  8275. public int[] feedYPos;
  8276. public int killsDisplayed = 5;
  8277.  
  8278. public void pushKill(String killer, String victim, int weapon, boolean poison, boolean critical) {
  8279. for (int index = killsDisplayed - 1; index > 0; index--) {
  8280. feedKiller[index] = feedKiller[index - 1];
  8281. feedVictim[index] = feedVictim[index - 1];
  8282. feedWeapon[index] = feedWeapon[index - 1];
  8283. feedPoison[index] = feedPoison[index - 1];
  8284. feedCritical[index] = feedCritical[index - 1];
  8285. feedAlpha[index] = feedAlpha[index - 1];
  8286. feedYPos[index] = feedYPos[index - 1];
  8287. }
  8288. feedKiller[0] = killer;
  8289. feedVictim[0] = victim;
  8290. feedWeapon[0] = weapon;
  8291. feedPoison[0] = poison;
  8292. feedCritical[0] = critical;
  8293. feedAlpha[0] = 0;
  8294. feedYPos[0] = 0;
  8295. }
  8296.  
  8297. public void displayKillFeed() {
  8298. int x = 5;
  8299. for (int index = 0; index < killsDisplayed; index++) {
  8300. if (feedKiller[index] != null && feedVictim[index] != null) {
  8301. if (feedKiller[index].length() > 0) {
  8302. if (feedWeapon[index] == -1) {
  8303. return;
  8304. }
  8305. if (feedKiller[index].equalsIgnoreCase(myUsername)) {
  8306. feedKiller[index] = "You";
  8307. }
  8308. if (feedVictim[index].equalsIgnoreCase(myUsername)) {
  8309. feedVictim[index] = "You";
  8310. }
  8311. if (feedYPos[index] < (index + 1) * 22) {
  8312. feedYPos[index] += 1;
  8313. if (index == 0) {
  8314. feedAlpha[index] += 256 / 22;
  8315. }
  8316. } else if (feedYPos[index] == (index + 1) * 22) {
  8317. if (feedAlpha[index] > 200) {
  8318. feedAlpha[index] -= 1;
  8319. } else if (feedAlpha[index] <= 200 && feedAlpha[index] > 0) {
  8320. feedAlpha[index] -= 5;
  8321. }
  8322. if (feedAlpha[index] < 0) {
  8323. feedAlpha[index] = 0;
  8324. }
  8325. if (feedAlpha[index] == 0) {
  8326. clearKill(index);
  8327. }
  8328. }
  8329. if (feedAlpha[index] != 0) {
  8330. String text = "[" + feedKiller[index] + "] ";
  8331. String text2 = " [" + feedVictim[index] + "]";
  8332. String poisontext = " <col=00ff00>[poisoned]</col>";
  8333. String onehittext = " <col=ff0000>[critical hit]</col>";
  8334. DrawingArea.drawFilledPixels(
  8335. x,
  8336. feedYPos[index],
  8337. newSmallFont.getTextWidth(text + text2 + (feedPoison[index] ? poisontext : "")
  8338. + (feedCritical[index] ? onehittext : "")) + 22, 19, 0, feedAlpha[index]);
  8339. newSmallFont.drawBasicString("<trans=" + feedAlpha[index] + ">" + text, x + 3, feedYPos[index] + 14, 0xffffff, 0);
  8340. newSmallFont.drawBasicString("<trans=" + feedAlpha[index] + ">" + text2 + (feedPoison[index] ? poisontext : "")
  8341. + (feedCritical[index] ? onehittext : ""), x + 3 + newSmallFont.getTextWidth(text) + 16,
  8342. feedYPos[index] + 14, 0xffffff, 0);
  8343. if (feedWeapon[index] != -1 && feedWeapon[index] != 65535) {
  8344. feedImage[index] = ItemDef.getFeedImage(feedWeapon[index], 0, 0x000000, 2);
  8345. }
  8346. if (feedImage[index] != null) {
  8347. feedImage[index].drawImage(newSmallFont.getTextWidth(text) + 0, feedYPos[index] - 6, feedAlpha[index]);
  8348. }
  8349. }
  8350. }
  8351. }
  8352. }
  8353. }
  8354.  
  8355. public void clearKill(int index) {
  8356. feedKiller[index] = null;
  8357. feedVictim[index] = null;
  8358. feedWeapon[index] = -1;
  8359. feedPoison[index] = false;
  8360. feedCritical[index] = false;
  8361. feedAlpha[index] = -1;
  8362. feedYPos[index] = -1;
  8363. }
  8364.  
  8365. /**
  8366. * Cuts a string into more than one line if it exceeds the specified max width.
  8367. * @param font
  8368. * @param string
  8369. * @param maxWidth
  8370. * @return
  8371. */
  8372. public static String[] splitString(RSFont font, String prefix, String string, int maxWidth, boolean ranked) {
  8373. maxWidth -= font.getTextWidth(prefix) + (ranked ? 14 : 0);
  8374. if (font.getTextWidth(prefix + string) + (ranked ? 14 : 0) <= maxWidth) {
  8375. return new String[]{ string };
  8376. }
  8377. String line = "";
  8378. String[] cut = new String[2];
  8379. boolean split = false;
  8380. char[] characters = string.toCharArray();
  8381. int space = -1;
  8382. for (int index = 0; index < characters.length; index++) {
  8383. char c = characters[index];
  8384. line += c;
  8385. if (c == ' ') {
  8386. space = index;
  8387. }
  8388. if (!split) {
  8389. if (font.getTextWidth(line) + 10 > maxWidth) {
  8390. if (space != -1 && characters[index - 1] != ' ') {
  8391. cut[0] = line.substring(0, space);
  8392. line = line.substring(space);
  8393. } else {
  8394. cut[0] = line;
  8395. line = "";
  8396. }
  8397. split = true;
  8398. }
  8399. }
  8400. }
  8401. if (line.length() > 0) {
  8402. cut[1] = line;
  8403. }
  8404. return cut;
  8405. }
  8406.  
  8407. public void clearTopInterfaces() {
  8408. outgoingPacket.createFrame(130);
  8409. if (invOverlayInterfaceID != -1) {
  8410. invOverlayInterfaceID = -1;
  8411. redrawTabArea = true;
  8412. aBoolean1149 = false;
  8413. tabAreaAltered = true;
  8414. }
  8415. if (backDialogID != -1) {
  8416. backDialogID = -1;
  8417. inputTaken = true;
  8418. aBoolean1149 = false;
  8419. }
  8420. openInterfaceID = -1;
  8421. fullscreenInterfaceID = -1;
  8422. }
  8423.  
  8424. public int getClickMode() {
  8425. return super.clickMode3;
  8426. }
  8427.  
  8428. public static boolean FORCED_CACHE_DOWNLOAD;
  8429.  
  8430. public Client() {
  8431. RSImageProducer.client = this;
  8432. resetBackground();
  8433. createFocus();
  8434. createLines();
  8435. create = new Create(this);
  8436. recover = new Recover(this);
  8437. checkSums = new CRC32();
  8438. familiarHandler = new FamiliarHandler();
  8439. choosingLeftClick = false;
  8440. leftClick = -1;
  8441. consoleInput = "";
  8442. consoleOpen = false;
  8443. consoleMessages = new String[17];
  8444. world = 1;
  8445. percentLoaded = 0.0F;
  8446. fullscreenInterfaceID = -1;
  8447. chatRights = new int[500];
  8448. clanTitles = new String[500];
  8449. chatTimes = new String[500];
  8450. chatTypeView = 0;
  8451. clanChatMode = 0;
  8452. cButtonHPos = -1;
  8453. cButtonCPos = 0;
  8454. server = Constants.IP;
  8455. port = Constants.PORT;
  8456. distanceValues = new int[104][104];
  8457. friendsNodeIDs = new int[200];
  8458. groundEntity = new Deque[4][104][104];
  8459. aBoolean831 = false;
  8460. aStream_834 = new JagexBuffer(new byte[5000]);
  8461. npcArray = new NPC[16384];
  8462. npcIndices = new int[16384];
  8463. anIntArray840 = new int[1000];
  8464. loginBuffer = JagexBuffer.create();
  8465. aBoolean848 = true;
  8466. openInterfaceID = -1;
  8467. currentExperience = new int[SkillConstants.skillsCount];
  8468. aBoolean872 = false;
  8469. anIntArray873 = new int[5];
  8470. cameraFlag = new boolean[5];
  8471. drawFlames = false;
  8472. reportAbuseInput = "";
  8473. myPlayerId = -1;
  8474. menuOpen = false;
  8475. menuWidth = 0;
  8476. menuHeight = 0;
  8477. inputString = "";
  8478. maxPlayers = 2048;
  8479. myPlayerIndex = 2047;
  8480. players = new Player[maxPlayers];
  8481. playerIndices = new int[maxPlayers];
  8482. localPlayers = new int[maxPlayers];
  8483. aStreamArray895s = new JagexBuffer[maxPlayers];
  8484. wayPoints = new int[104][104];
  8485. currentLevel = new int[SkillConstants.skillsCount];
  8486. ignoreListAsLongs = new long[100];
  8487. loadingError = false;
  8488. anIntArray928 = new int[5];
  8489. anIntArrayArray929 = new int[104][104];
  8490. chatTypes = new int[500];
  8491. chatNames = new String[500];
  8492. chatMessages = new String[500];
  8493. chatTitles = new String[500];
  8494. chatGameModes = new byte[500];
  8495. quickChatMessage = new boolean[500];
  8496. feedKiller = new String[10];
  8497. feedVictim = new String[10];
  8498. feedWeapon = new int[10];
  8499. feedPoison = new boolean[10];
  8500. feedCritical = new boolean[10];
  8501. feedImage = new RSImage[10];
  8502. feedAlpha = new int[10];
  8503. feedYPos = new int[10];
  8504. scrollPart = new RSImage[12];
  8505. scrollBar = new RSImage[6];
  8506. orbs = new RSImage[20];
  8507. hitBar = new RSImage[2];
  8508. aBoolean954 = true;
  8509. friendsListAsLongs = new long[200];
  8510. currentSong = -1;
  8511. drawingFlames = false;
  8512. spriteDrawX = -1;
  8513. spriteDrawY = -1;
  8514. anIntArray968 = new int[33];
  8515. cacheIndices = new CacheIndex[6];
  8516. mainCacheIndices = new CacheIndex[6];
  8517. variousSettings = new int[20000];
  8518. aBoolean972 = false;
  8519. anInt975 = 50;
  8520. anIntArray976 = new int[anInt975];
  8521. anIntArray977 = new int[anInt975];
  8522. anIntArray978 = new int[anInt975];
  8523. anIntArray979 = new int[anInt975];
  8524. anIntArray980 = new int[anInt975];
  8525. anIntArray981 = new int[anInt975];
  8526. anIntArray982 = new int[anInt975];
  8527. aStringArray983 = new String[anInt975];
  8528. anInt985 = -1;
  8529. hitMark = new RSImage[20];
  8530. hitStyle = new RSImage[5];
  8531. hitShadow = new RSImage[6];
  8532. anIntArray990 = new int[5];
  8533. aBoolean994 = false;
  8534. dialogueInput = "";
  8535. projectileQueue = new Deque();
  8536. aBoolean1017 = false;
  8537. walkableInterface = -1;
  8538. anIntArray1030 = new int[5];
  8539. aBoolean1031 = false;
  8540. mapFunctions = new RSImage[1000];
  8541. dialogID = -1;
  8542. maxLevel = new int[SkillConstants.skillsCount];
  8543. defaultConfigIds = new int[20000];
  8544. maleGender = true;
  8545. anIntArray1052 = new int[152];
  8546. requestedTabFocusIndex = -1;
  8547. aClass19_1056 = new Deque();
  8548. anIntArray1057 = new int[33];
  8549. rsi = new RSInterface();
  8550. mapScenes = new RSImage[100];
  8551. clothIds = new int[7];
  8552. mapIconX = new int[1000];
  8553. mapIconY = new int[1000];
  8554. aBoolean1080 = false;
  8555. friendsList = new String[200];
  8556. incomingPacket = JagexBuffer.create();
  8557. expectedCRCs = new int[9];
  8558. menuActionCmd2 = new int[500];
  8559. menuActionCmd3 = new int[500];
  8560. menuActionID = new int[500];
  8561. menuActionCmd1 = new int[500];
  8562. headIcons = new RSImage[20];
  8563. skullIcons = new RSImage[20];
  8564. headIconsHint = new RSImage[20];
  8565. tabAreaAltered = false;
  8566. promptMessage = "";
  8567. atPlayerActions = new String[7];
  8568. atPlayerArray = new boolean[7];
  8569. secondaryRegionObjects = new int[4][13][13];
  8570. mapIcons = new RSImage[1000];
  8571. aBoolean1141 = false;
  8572. aBoolean1149 = false;
  8573. crosses = new RSImage[8];
  8574. musicEnabled = true;
  8575. redrawTabArea = false;
  8576. loggedIn = false;
  8577. canMute = false;
  8578. builtSecondaryRegion = false;
  8579. cameraMovement = false;
  8580. myUsername = myUsername != null ? myUsername : "";
  8581. myPassword = myPassword != null ? myPassword : "";
  8582. genericLoadingError = false;
  8583. reportAbuseInterfaceID = -1;
  8584. aClass19_1179 = new Deque();
  8585. anInt1184 = 128;
  8586. invOverlayInterfaceID = -1;
  8587. outgoingPacket = JagexBuffer.create();
  8588. menuActionName = new String[500];
  8589. anIntArray1203 = new int[5];
  8590. sound = new int[50];
  8591. scrollBarPosition = 78;
  8592. promptInput = "";
  8593. modIcons = new RSImage[14];
  8594. clanIcons = new RSImage[9];
  8595. tabID = 3;
  8596. inputTaken = false;
  8597. anIntArray1229 = new int[152];
  8598. tileSettings = new TileSetting[4];
  8599. anIntArray1240 = new int[100];
  8600. soundType = new int[50];
  8601. aBoolean1242 = false;
  8602. soundDelay = new int[50];
  8603. soundVolume = new int[50];
  8604. rsAlreadyLoaded = false;
  8605. welcomeScreenRaised = false;
  8606. showInput = false;
  8607. loginMessage1 = "";
  8608. loginMessage2 = "";
  8609. backDialogID = -1;
  8610. walkingQueueX = new int[4000];
  8611. walkingQueueY = new int[4000];
  8612. cacheSprite = new RSImage[150];
  8613. lines = new RSImage[5];
  8614. website = new RSImage[2];
  8615. load = new RSImage[3];
  8616. }
  8617.  
  8618. public RSImageProducer chatArea;
  8619. public RSImageProducer tabArea;
  8620. public RSImageProducer mapArea;
  8621. public Archive media;
  8622. public CRC32 checkSums;
  8623. public RSImage[] hitBar;
  8624. public RSImage full;
  8625. public int playerX;
  8626. public int playerY;
  8627. public int world;
  8628. public RSImage[] orbs;
  8629. public static RSImage[] cacheSprite;
  8630. public float percentLoaded;
  8631. public String updateString;
  8632. public int updatePercent;
  8633. public int yellMode;
  8634. public int gambleMode;
  8635. public RSImage quickChatSprite;
  8636. public int channelRights;
  8637. public String yellUsername;
  8638. public String yellMessage;
  8639. public String clanUsername;
  8640. public String clanMessage;
  8641. public String clanTitle;
  8642. public final int[] chatRights;
  8643. public final String[] clanTitles;
  8644. public final String[] chatTimes;
  8645. public int chatTypeView;
  8646. public int clanChatMode;
  8647. public int duelMode;
  8648. private RSImageProducer leftFrame;
  8649. private RSImageProducer topFrame;
  8650. private RSImageProducer rightFrame;
  8651. private int ignoreCount;
  8652. private long loadStageDelay;
  8653. private int[][] distanceValues;
  8654. private int[] friendsNodeIDs;
  8655. private Deque[][][] groundEntity;
  8656. private volatile boolean aBoolean831;
  8657. private Socket jagGrab;
  8658. public int loginScreenState;
  8659. private JagexBuffer aStream_834;
  8660. private NPC[] npcArray;
  8661. private int npcCount;
  8662. private int[] npcIndices;
  8663. private int anInt839;
  8664. private int[] anIntArray840;
  8665. private int anInt841;
  8666. private int anInt842;
  8667. private int anInt843;
  8668. public String aString844;
  8669. public int privateChatMode;
  8670. private JagexBuffer loginBuffer;
  8671. private boolean aBoolean848;
  8672. private static int anInt849;
  8673. private int anInt855;
  8674. public int openInterfaceID;
  8675. public int xCameraPos;
  8676. public int zCameraPos;
  8677. public int yCameraPos;
  8678. public int yCameraCurve;
  8679. public int xCameraCurve;
  8680. public int myRights;
  8681. public int donatorStatus;
  8682. private final int[] currentExperience;
  8683. private RSImage mapFlag;
  8684. private RSImage mapMarker;
  8685. private boolean aBoolean872;
  8686. private final int[] anIntArray873;
  8687. private final boolean[] cameraFlag;
  8688. private int weight;
  8689. private volatile boolean drawFlames;
  8690. private String reportAbuseInput;
  8691. private int myPlayerId;
  8692. public boolean menuOpen;
  8693. private int anInt886;
  8694. public String inputString;
  8695. private final int maxPlayers;
  8696. private final int myPlayerIndex;
  8697. private Player[] players;
  8698. private int playerCount;
  8699. private int[] playerIndices;
  8700. private int localPlayersIndex;
  8701. private int[] localPlayers;
  8702. private JagexBuffer[] aStreamArray895s;
  8703. private int viewRotationOffset;
  8704. private int friendsCount;
  8705. private int anInt900;
  8706. private int[][] wayPoints;
  8707. private int shiftOverOnItemMove;
  8708. private int crossX;
  8709. private int crossY;
  8710. private int crossIndex;
  8711. private int crossType;
  8712. public int plane;
  8713. public final int[] currentLevel;
  8714. private static int anInt924;
  8715. private final long[] ignoreListAsLongs;
  8716. private boolean loadingError;
  8717. private final int[] anIntArray928;
  8718. private int[][] anIntArrayArray929;
  8719. private RSImage aClass30_Sub2_Sub1_Sub1_931;
  8720. private RSImage aClass30_Sub2_Sub1_Sub1_932;
  8721. private int anInt933;
  8722. private int anInt934;
  8723. private int anInt935;
  8724. private int anInt936;
  8725. private int anInt937;
  8726. private int anInt938;
  8727. public final int[] chatTypes;
  8728. public final String[] chatNames;
  8729. public final String[] chatMessages;
  8730. public final String[] chatTitles;
  8731. public final byte[] chatGameModes;
  8732. public final boolean[] quickChatMessage;
  8733. public int anInt945;
  8734. private WorldController sceneGraph;
  8735. public int menuScreenArea;
  8736. private int menuOffsetX;
  8737. private int menuOffsetY;
  8738. private int menuWidth;
  8739. private int menuHeight;
  8740. private long aLong953;
  8741. private boolean aBoolean954;
  8742. private long[] friendsListAsLongs;
  8743. private int currentSong;
  8744. private static int nodeID = 10;
  8745. static int portOff;
  8746. boolean clientData;
  8747. private static boolean isMembers = true;
  8748. private static boolean lowMemory;
  8749. private volatile boolean drawingFlames;
  8750. public int spriteDrawX;
  8751. public int spriteDrawY;
  8752. private final int[] anIntArray965 = { 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff };
  8753. private RSImage[] scrollBar;
  8754. public RSImage[] scrollPart;
  8755. private final int[] anIntArray968;
  8756. public final CacheIndex[] cacheIndices;
  8757. public final CacheIndex[] mainCacheIndices;
  8758. public int variousSettings[];
  8759. private boolean aBoolean972;
  8760. private final int anInt975;
  8761. private final int[] anIntArray976;
  8762. private final int[] anIntArray977;
  8763. private final int[] anIntArray978;
  8764. private final int[] anIntArray979;
  8765. private final int[] anIntArray980;
  8766. private final int[] anIntArray981;
  8767. private final int[] anIntArray982;
  8768. private final String[] aStringArray983;
  8769. private int anInt984;
  8770. private int anInt985;
  8771. private static int anInt986;
  8772. public RSImage[] hitMark;
  8773. private RSImage[] hitStyle;
  8774. private RSImage[] hitShadow;
  8775. private int anInt989;
  8776. private final int[] anIntArray990;
  8777. private final boolean aBoolean994;
  8778. private int anInt995;
  8779. private int anInt996;
  8780. private int anInt997;
  8781. private int anInt998;
  8782. private int anInt999;
  8783. private ISAACRandomGen encryption;
  8784. private RSImage mapEdge;
  8785. private RSImage multiZone;
  8786. public static final int[][] VALID_COLORS = {
  8787. { 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433, 2983, 54193, 100 },
  8788. {// hair^
  8789. 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153, 56621, 4783, 1341, 16578, 35003, 100, 4627, 11146, 6439, 4758,
  8790. 10270, 25239 }, {// shirt^
  8791. 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153, 56621, 4783, 1341, 16578, 35003, 100, 4627, 11146, 6439,
  8792. 4758, 10270 }, {// legs^
  8793. 4626, 25239, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153, 56621, 4783, 1341, 16578, 35003, 100, 11146, 6439,
  8794. 4758, 10270 }, {// feet^
  8795. 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574 } // skin^
  8796. };
  8797. public String dialogueInput;
  8798. private static int anInt1005;
  8799. private int daysSinceLastLogin;
  8800. private int packetSize;
  8801. private int packetId;
  8802. private int anInt1009;
  8803. private int anInt1010;
  8804. private int anInt1011;
  8805. private Deque projectileQueue;
  8806. private int anInt1014;
  8807. private int anInt1015;
  8808. private int anInt1016;
  8809. private boolean aBoolean1017;
  8810. private int walkableInterface;
  8811. private static final int[] anIntArray1019;
  8812. private int minimapState;
  8813. private int loadingStage;
  8814. private int anInt1026;
  8815. private final int[] anIntArray1030;
  8816. private boolean aBoolean1031;
  8817. private RSImage[] mapFunctions;
  8818. public int baseX;
  8819. public int baseY;
  8820. private int anInt1036;
  8821. private int anInt1037;
  8822. public int loginFailures;
  8823. private int anInt1039;
  8824. public int dialogID;
  8825. public final int[] maxLevel;
  8826. private final int[] defaultConfigIds;
  8827. private int membershipLevel;
  8828. private boolean maleGender;
  8829. private int anInt1048;
  8830. private String aString1049;
  8831. private static int anInt1051;
  8832. private final int[] anIntArray1052;
  8833. private Archive titleStreamLoader;
  8834. private int requestedTabFocusIndex;
  8835. private int multiIcon;
  8836. private Deque aClass19_1056;
  8837. private final int[] anIntArray1057;
  8838. public final RSInterface rsi;
  8839. private RSImage[] mapScenes;
  8840. @SuppressWarnings("unused")
  8841. private static int anInt1061;
  8842. private int currentSound;
  8843. private int dialogueAction;
  8844. private final int[] clothIds;
  8845. private int currentHoveredDragSlot;
  8846. private int lastActiveInvInterface;
  8847. public OnDemandFetcher onDemandFetcher;
  8848. public int localX;
  8849. public int localY;
  8850. private int localMapIcons;
  8851. private int[] mapIconX;
  8852. private int[] mapIconY;
  8853. private RSImage mapDotItem;
  8854. private RSImage mapDotNPC;
  8855. private RSImage mapDotPlayer;
  8856. private RSImage mapDotFriend;
  8857. private RSImage mapDotTeam;
  8858. private int anInt1079;
  8859. private boolean aBoolean1080;
  8860. private String[] friendsList;
  8861. private JagexBuffer incomingPacket;
  8862. private int hoveredInterfaceChild;
  8863. private int originalDragSlot;
  8864. private int activeInterfaceType;
  8865. private int anInt1087;
  8866. int anInt1088;
  8867. public int anInt1089;
  8868. private final int[] expectedCRCs;
  8869. private int[] menuActionCmd2;
  8870. private int[] menuActionCmd3;
  8871. public int[] menuActionID;
  8872. private int[] menuActionCmd1;
  8873. private RSImage[] headIcons;
  8874. private RSImage[] skullIcons;
  8875. private RSImage[] headIconsHint;
  8876. private int anInt1097;
  8877. private int anInt1098;
  8878. private int anInt1099;
  8879. private int anInt1100;
  8880. private int anInt1101;
  8881. private int anInt1102;
  8882. private boolean tabAreaAltered;
  8883. private int updateTimer;
  8884. private int restartTimer;
  8885. public RSImageProducer title;
  8886. private RSImageProducer aRSImageProducer_1107;
  8887. private static int anInt1117;
  8888. private int membersInt;
  8889. public String promptMessage;
  8890. private RSImage compass;
  8891. private RSImageProducer aRSImageProducer_1125;
  8892. public Player myPlayer;
  8893. private final String[] atPlayerActions;
  8894. private final boolean[] atPlayerArray;
  8895. private final int[][][] secondaryRegionObjects;
  8896. public final int[] tabInterfaceIDs = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
  8897. private int cameraOffsetY;
  8898. public int menuActionRow;
  8899. private int anInt1134;
  8900. private int spellSelected;
  8901. private int spellId;
  8902. private int spellUsableOn;
  8903. private String spellTooltip;
  8904. private RSImage[] mapIcons;
  8905. private boolean aBoolean1141;
  8906. private static int anInt1142;
  8907. private int energy;
  8908. private boolean aBoolean1149;
  8909. private RSImage[] crosses;
  8910. public boolean musicEnabled;
  8911. boolean redrawTabArea;
  8912. private int unreadMessages;
  8913. private static int anInt1155;
  8914. private static boolean fpsOn;
  8915. public boolean loggedIn;
  8916. private boolean canMute;
  8917. private boolean builtSecondaryRegion;
  8918. private boolean cameraMovement;
  8919. public static int loopCycle;
  8920. public static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  8921. public RSImageProducer gameArea;
  8922. private int daysSinceRecovChange;
  8923. private RSSocket socketStream;
  8924. private int anInt1169;
  8925. private int minimapZoom;
  8926. @SuppressWarnings("unused")
  8927. private long aLong1172;
  8928. public static String myUsername;
  8929. private String myPassword;
  8930. private static int anInt1175;
  8931. private boolean genericLoadingError;
  8932. private final int[] objectClassType = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3 };
  8933. private int reportAbuseInterfaceID;
  8934. private Deque aClass19_1179;
  8935. public int[] gameAreaOffsets;
  8936. public int[] chatAreaPixels;
  8937. public int[] tabAreaPixels;
  8938. private byte[][] aByteArrayArray1183;
  8939. private int anInt1184;
  8940. private int viewRotation;
  8941. private int cameraXYRotation;
  8942. private int cameraZRotation;
  8943. private static int anInt1188;
  8944. int invOverlayInterfaceID;
  8945. public JagexBuffer outgoingPacket;
  8946. private int anInt1193;
  8947. public int splitPrivateChat;
  8948. private IndexedImage mapBack;
  8949. public String[] menuActionName;
  8950. private final int[] anIntArray1203;
  8951. public static final int[] anIntArray1204 = { 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153, 56621, 4783, 1341, 16578,
  8952. 35003, 100, 4627, 11146, 6439, 4758, 10270, 25239 };// shirt2^
  8953. @SuppressWarnings("unused")
  8954. private final int[] sound;
  8955. @SuppressWarnings("unused")
  8956. private int anInt1208;
  8957. private int minimapRotation;
  8958. public static int scrollBarPosition;
  8959. public String promptInput;
  8960. private int anInt1213;
  8961. private int[][][] heightMap;
  8962. private long aLong1215;
  8963. private int loginScreenCursorPos;
  8964. public final RSImage[] modIcons;
  8965. private final RSImage[] clanIcons;
  8966. private long aLong1220;
  8967. public int tabID;
  8968. private int anInt1222;
  8969. public boolean inputTaken;
  8970. public int inputDialogState;
  8971. private int anInt1226;
  8972. private int nextSong;
  8973. private final int[] anIntArray1229;
  8974. private TileSetting[] tileSettings;
  8975. public static int anIntArray1232[];
  8976. private int[] mapLocation;
  8977. private int[] mapTerrains;
  8978. private int[] mapLandscapes;
  8979. public final int anInt1239 = 100;
  8980. private final int[] anIntArray1240;
  8981. @SuppressWarnings("unused")
  8982. private final int[] soundType;
  8983. private boolean aBoolean1242;
  8984. private int atInventoryLoopCycle;
  8985. private int atInventoryInterface;
  8986. private int atInventoryIndex;
  8987. private int atInventoryInterfaceType;
  8988. private byte[][] aByteArrayArray1247;
  8989. public int tradeMode;
  8990. private int anInt1249;
  8991. @SuppressWarnings("unused")
  8992. private final int[] soundDelay;
  8993. @SuppressWarnings("unused")
  8994. private final int[] soundVolume;
  8995. private int anInt1251;
  8996. private boolean rsAlreadyLoaded;
  8997. private int anInt1253;
  8998. private boolean welcomeScreenRaised;
  8999. public boolean showInput;
  9000. @SuppressWarnings("unused")
  9001. private int anInt1257;
  9002. private byte[][][] groundTileSettings;
  9003. @SuppressWarnings("unused")
  9004. private int previousSong;
  9005. private int destX;
  9006. private int destY;
  9007. private RSImage miniMap;// aClass30_Sub2_Sub1_Sub1_1263
  9008. private int arbitratyPathDestination;
  9009. private int anInt1265;
  9010. String loginMessage1;
  9011. private String loginMessage2;
  9012. private int bigRegionX;
  9013. private int bigRegionY;
  9014. public RSFontSystem newSmallFont;
  9015.  
  9016. public static RSFontSystem newRegularFont;
  9017.  
  9018. public RSFontSystem newBoldFont;
  9019.  
  9020. public RSFontSystem newFancyFont;
  9021.  
  9022. public RSFontSystem regularHitFont;
  9023.  
  9024. public RSFontSystem bigHitFont;
  9025. public RSFont smallText;
  9026. public RSFont normalFont;
  9027. public RSFont boldFont;
  9028. public RSFont fancyText;
  9029. public int backDialogID;
  9030. private int cameraOffsetX;
  9031. private int[] walkingQueueX;
  9032. private int[] walkingQueueY;
  9033. private int itemSelected;
  9034. private int itemIdSelected[] = new int[28];
  9035. private boolean itemSelectedSlot[] = new boolean[28];
  9036. private int usedItemSlot;
  9037. private int inventoryInterfaceId;
  9038. private int anInt1285;
  9039. private String selectedItemName;
  9040. public int publicChatMode;
  9041. private static int currentWalkingQueueSize;
  9042. public static int anInt1290;
  9043. public static String server;
  9044. public static String updateServer;
  9045. public static int port;
  9046.  
  9047. public static boolean disableUnderlayTexture = false;
  9048. public static boolean disableOverlayTexture = false;
  9049.  
  9050. public int drawCount;
  9051. public int fullscreenInterfaceID;
  9052. public int anInt1044;// 377
  9053. public int anInt1129;// 377
  9054. public int anInt1315;// 377
  9055. public int anInt1500;// 377
  9056. public int anInt1501;// 377
  9057. public int[] fullScreenTextureArray;
  9058. public String consoleInput;
  9059. public boolean consoleOpen;
  9060. private final String[] consoleMessages;
  9061. public FamiliarHandler familiarHandler;
  9062. public String b31b4 = "7mah";
  9063.  
  9064. public FamiliarHandler getFamiliar() {
  9065. return familiarHandler;
  9066. }
  9067.  
  9068. public boolean showMiniMap = true;
  9069. boolean loaded = false;
  9070. public int hoverId;
  9071. // title screen sprites
  9072. public RSImage header;
  9073. public RSImage[] box;
  9074. public RSImage input;
  9075. public RSImage input_hover;
  9076. public RSImage play;
  9077. public RSImage play_hover;
  9078. public RSImage[] back;
  9079. public RSImage[] info;
  9080. public RSImage[] check;
  9081. public RSImage[] cross;
  9082. public RSImage[] status;
  9083. public RSImage[] status_hover;
  9084. public RSImage[] close;
  9085. public RSImage[] screen_dull;
  9086. public RSImage[] screen_selected;
  9087. public RSImage[] detail_dull;
  9088. public RSImage[] detail_hover;
  9089. public RSImage[] detail_selected;
  9090. public RSImage header_glow;
  9091. public RSImage[] bar;
  9092. public RSImage fill;
  9093. public RSImage banner;
  9094. public RSImage[] focusDots;
  9095. public RSImage button;
  9096. public RSImage[] lines;
  9097. public RSImage[] website;
  9098. public RSImage[] load;
  9099. public RSImage display;
  9100. public RSImage accountbox;
  9101. // gameframe sprites
  9102. public RSImage chatImage;
  9103. public RSImage tabImage;
  9104. public RSImage mapImage;
  9105. public RSImage[] channelButtons;
  9106. public RSImage[] tabClicked;
  9107. private RSImage[] sideIcons;
  9108. public RSImage[] tabImages;
  9109.  
  9110. private boolean autocasting;
  9111. private int autocastId;
  9112.  
  9113. private WindowFlasher windowFlasher;
  9114.  
  9115. private static final int NETWORK_VERSION = 538;
  9116.  
  9117. /**
  9118. * Returns the width of the area.
  9119. *
  9120. * @param area
  9121. * @return
  9122. */
  9123. public int getWidth(int area) {
  9124. int width = 0;
  9125. if (area == 0) {
  9126. width = 519;
  9127. }
  9128. if (area == 1) {
  9129. width = 246;
  9130. }
  9131. if (area == 2) {
  9132. width = 246;
  9133. }
  9134. return width;
  9135. }
  9136.  
  9137. /**
  9138. * Returns the height of the area.
  9139. *
  9140. * @param area
  9141. * @return
  9142. */
  9143. public int getHeight(int area) {
  9144. int height = 0;
  9145. if (area == 0) {
  9146. height = 165;
  9147. }
  9148. if (area == 1) {
  9149. height = 335;
  9150. }
  9151. if (area == 2) {
  9152. height = 168;
  9153. }
  9154. return height;
  9155. }
  9156.  
  9157. /**
  9158. * Returns the number of tabs for the gameframe revision.
  9159. *
  9160. * @return
  9161. */
  9162. @SuppressWarnings("unused")
  9163. public int getTabCount() {
  9164. if (Content.GAMEFRAME < 554) {
  9165. return 14;
  9166. } else {
  9167. return 16;
  9168. }
  9169. }
  9170.  
  9171. public int getMapOffsetX() {
  9172. int revision = Content.getVersion(Content.GAMEFRAME);
  9173. int offset = 0;
  9174. switch (revision) {
  9175. case 317:
  9176. offset = 23;
  9177. break;
  9178. case 474:
  9179. offset = 18;
  9180. break;
  9181. }
  9182. return isFixed() ? offset : appletWidth - 246;
  9183. }
  9184.  
  9185. public int getMapOffsetY() {
  9186. int revision = Content.getVersion(Content.GAMEFRAME);
  9187. int offset = 0;
  9188. switch (revision) {
  9189. case 317:
  9190. offset = -4;
  9191. break;
  9192. case 474:
  9193. offset = -4;
  9194. break;
  9195. }
  9196. return isFixed() ? offset : 0;
  9197. }
  9198.  
  9199. /**
  9200. * Builds the gameframe for the gameframe revision.
  9201. */
  9202. public void buildFrame() {
  9203. int width = 765;
  9204. int height = 503;
  9205. int revision = Content.getVersion(Content.GAMEFRAME);
  9206.  
  9207. chatImage = getImage(0, height - 165, getWidth(0), getHeight(0), Integer.toString(revision), "frame");
  9208. tabImage = getImage(width - getWidth(1), height - getHeight(1), getWidth(1), getHeight(1), Integer.toString(revision), "frame");
  9209. mapImage = getImage(width - getWidth(1), 0, getWidth(1), getHeight(1), Integer.toString(revision), "frame");
  9210. channelButtons = new RSImage[6];
  9211. String[] names = { "channel", "channel_clicked", "channel_hover", "channel_clicked_hover", "report", "report_hover" };
  9212. for (int index = 0; index < channelButtons.length; index++) {
  9213. channelButtons[index] = getImage(Integer.toString(revision), names[index]);
  9214. }
  9215. tabImages = new RSImage[4];
  9216. tabImages[0] = getImage(Integer.toString(revision), "tab");
  9217. tabImages[1] = getImage(Integer.toString(revision), "tab_clicked");
  9218. tabImages[2] = getImage(Integer.toString(revision), "invback");
  9219. tabImages[3] = getImage(Integer.toString(revision), "invborder");
  9220. sideIcons = new RSImage[getTabCount() + 1];
  9221. for (int index = 0; index < sideIcons.length; index++) {
  9222. int i = (revision >= 508 ? 20 : 552) + index;
  9223. if (revision >= 508) {
  9224. if (index == 13)
  9225. i = 95;
  9226. else if (index == 15)
  9227. i = 7;
  9228. else if (index == 14)
  9229. i = 689;
  9230. else if (index == 16)
  9231. i = 33;
  9232. }
  9233. sideIcons[index] = RSImageLoader.images[i];// getImage(Integer.toString(revision), "sideicons", Integer.toString(index));
  9234. }
  9235. if (revision == 317) {
  9236. tabClicked = new RSImage[14];
  9237. names = new String[] { "redstone_left", "redstone_mid_left", "redstone_mid_left", "redstone_mid", "redstone_mid_right",
  9238. "redstone_mid_right", "redstone_right" };
  9239. for (int index = 0; index < 7; index++) {
  9240. tabClicked[index] = getImage(Integer.toString(revision), names[index]);
  9241. }
  9242. for (int index = 7; index < 14; index++) {
  9243. RSImage image = getImage(Integer.toString(revision), names[index - (getTabCount() / 2)]);
  9244. image.mirrorVertical();
  9245. tabClicked[index] = image;
  9246. }
  9247. } else if (revision > 317 && revision < 554) {
  9248. tabClicked = new RSImage[14];
  9249. names = new String[] { "clicked_top_left", "clicked_mid", "clicked_mid", "clicked_mid", "clicked_mid", "clicked_mid",
  9250. "clicked_top_right", "clicked_bottom_left", "clicked_mid", "clicked_mid", "clicked_mid", "clicked_mid", "clicked_mid",
  9251. "clicked_bottom_right" };
  9252. for (int index = 0; index < 14; index++) {
  9253. tabClicked[index] = getImage(Integer.toString(revision), names[index]);
  9254. }
  9255. }
  9256. inputTaken = true;
  9257. redrawTabArea = true;
  9258. }
  9259.  
  9260. public boolean loadedImages = false;
  9261. public CacheManager spriteManager;
  9262. public boolean dumpSprites = true;
  9263.  
  9264. public RSImage getImage(String... strings) {
  9265. final byte[] data = spriteManager.get(strings).getData();
  9266. if (dumpSprites) {
  9267. final File folder = new File(Signlink.getDirectory() + "sprite_dump");
  9268. folder.mkdir();
  9269.  
  9270. final File specificFolder = new File(Signlink.getDirectory() + "sprite_dump" + System.getProperty("file.separator")
  9271. + strings[0]);
  9272. specificFolder.mkdir();
  9273.  
  9274. DataUtils.writeFile(specificFolder + System.getProperty("file.separator") + strings[1] + ".png", data);
  9275. }
  9276. return new RSImage(data);
  9277. }
  9278.  
  9279. public RSImage getImage(int x, int y, int w, int h, String... strings) {
  9280. return new RSImage(spriteManager.get(strings).getData(), x, y, w, h);
  9281. }
  9282.  
  9283. public void resetAllImageProducers() {
  9284. if (super.fullGameScreen != null) {
  9285. return;
  9286. }
  9287. chatArea = null;
  9288. mapArea = null;
  9289. tabArea = null;
  9290. gameArea = null;
  9291. title = null;
  9292. aRSImageProducer_1125 = null;
  9293. aRSImageProducer_1107 = null;
  9294. super.fullGameScreen = new RSImageProducer(clientWidth, clientHeight, getGameComponent());
  9295. welcomeScreenRaised = true;
  9296. }
  9297.  
  9298. public int getClientWidth() {
  9299. return clientWidth;
  9300. }
  9301.  
  9302. public int getClientHeight() {
  9303. return clientHeight;
  9304. }
  9305.  
  9306. public int getMaxWidth() {
  9307. return (int) Toolkit.getDefaultToolkit().getScreenSize().getWidth();
  9308. }
  9309.  
  9310. public int getMaxHeight() {
  9311. return (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight();
  9312. }
  9313.  
  9314. public int getGameAreaX() {
  9315. return isFixed() ? 4 : 0;
  9316. }
  9317.  
  9318. public int getGameAreaY() {
  9319. return isFixed() ? 4 : 0;
  9320. }
  9321.  
  9322. public int clientSize = 0;
  9323. public static int clientWidth = 765;
  9324. public static int clientHeight = 503;
  9325. public int appletWidth = 765;
  9326. public int appletHeight = 503;
  9327.  
  9328. public void drawFrame() {
  9329. if (!isFixed()) {
  9330. drawChatArea();
  9331. drawTabArea();
  9332. drawMinimap();
  9333. }
  9334. }
  9335.  
  9336. public void checkSize() {
  9337. if (clientSize == 1 && mainFrame != null && !isApplet) {
  9338. if (clientWidth != mainFrame.getFrameWidth()) {
  9339. clientWidth = mainFrame.getFrameWidth();
  9340. gameAreaWidth = clientWidth;
  9341. updateGameArea();
  9342. }
  9343. if (clientHeight != mainFrame.getFrameHeight()) {
  9344. clientHeight = mainFrame.getFrameHeight();
  9345. gameAreaHeight = clientHeight;
  9346. updateGameArea();
  9347. }
  9348. }
  9349. }
  9350.  
  9351. public boolean isFixed() {
  9352. return clientSize == 0;
  9353. }
  9354.  
  9355. private int gameAreaWidth = 512, gameAreaHeight = 334;
  9356.  
  9357. public void rebuildFrame(int size, int width, int height) {
  9358. gameAreaWidth = (size == 0) ? 512 : width;
  9359. gameAreaHeight = (size == 0) ? 334 : height;
  9360. clientWidth = width;
  9361. clientHeight = height;
  9362. @SuppressWarnings("unused")
  9363. int mouseX = super.getMouseX();
  9364. @SuppressWarnings("unused")
  9365. int mouseY = super.getMouseY();
  9366. instance.rebuildFrame(size == 2, width, height, size == 1, size == 2);
  9367. updateGameArea();
  9368. mouseX = mouseY = -1;
  9369. }
  9370.  
  9371. private void updateGameArea() {
  9372. Rasterizer.setBounds(clientWidth, clientHeight);
  9373. fullScreenTextureArray = Rasterizer.lineOffsets;
  9374. Rasterizer.setBounds(isFixed() ? getWidth(0) : clientWidth, isFixed() ? getHeight(0) : clientHeight);
  9375. chatAreaPixels = Rasterizer.lineOffsets;
  9376. Rasterizer.setBounds(isFixed() ? getWidth(1) : clientWidth, isFixed() ? getHeight(1) : clientHeight);
  9377. tabAreaPixels = Rasterizer.lineOffsets;
  9378. Rasterizer.setBounds(gameAreaWidth, gameAreaHeight);
  9379. gameAreaOffsets = Rasterizer.lineOffsets;
  9380. int ai[] = new int[9];
  9381. for (int i8 = 0; i8 < 9; i8++) {
  9382. int k8 = 128 + i8 * 32 + 15;
  9383. int l8 = 600 + k8 * 3;
  9384. int i9 = Rasterizer.SINE[k8];
  9385. ai[i8] = l8 * i9 >> 16;
  9386. }
  9387. WorldController.setupViewport(500, 800, gameAreaWidth, gameAreaHeight, ai);
  9388. if (loggedIn) {
  9389. gameArea = new RSImageProducer(gameAreaWidth, gameAreaHeight, getGameComponent());
  9390. } else {
  9391. title = new RSImageProducer(clientWidth, clientHeight, getGameComponent());
  9392. }
  9393. if (ExtraChatAreaY > clientHeight - 170) {
  9394. ExtraChatAreaY = clientHeight - 170;
  9395. }
  9396. }
  9397.  
  9398. public void toggleSize(int size) {
  9399. if (clientSize != size) {
  9400. clientSize = size;
  9401. int width = 765;
  9402. int height = 503;
  9403. if (isFixed()) {
  9404. width = 765;
  9405. height = 503;
  9406. } else if (clientSize == 1) {
  9407. width = isApplet ? appletWidth : 900;
  9408. height = isApplet ? appletHeight : 600;
  9409. } else if (clientSize == 2) {
  9410. width = getMaxWidth();
  9411. height = getMaxHeight();
  9412. }
  9413. rebuildFrame(size, width, height);
  9414. updateGameArea();
  9415. if (!isApplet) {
  9416. try {
  9417. setIconImage(Constants.ICON_DIRECTORY);
  9418. } catch (IOException e) {
  9419. e.printStackTrace();
  9420. }
  9421. }
  9422. }
  9423. showTab = clientSize == 0 ? true : showTab;
  9424. showChat = clientSize == 0 ? true : showChat;
  9425. showMiniMap = clientSize == 0 ? true : showMiniMap;
  9426. }
  9427.  
  9428. public void mouseWheelDragged(int i, int j) {
  9429. if (!mouseWheelDown)
  9430. return;
  9431. this.cameraXYRotation += i * 3;
  9432. this.cameraZRotation += (j << 1);
  9433. }
  9434.  
  9435. public boolean isServerSupport() {
  9436. return myRights == 6;
  9437. }
  9438.  
  9439. public boolean isModerator() {
  9440. return myRights == 9;
  9441. }
  9442.  
  9443. public boolean isHeadModerator() {
  9444. return myRights == 10;
  9445. }
  9446.  
  9447. public boolean isDeveloper() {
  9448. return myRights == 11;
  9449. }
  9450.  
  9451. public boolean isAdministrator() {
  9452. return isDeveloper() || myRights == 12 || myRights == 13;
  9453. }
  9454.  
  9455. public boolean isDonator() {
  9456. return donatorStatus != 0 && donatorStatus != 255;
  9457. }
  9458.  
  9459. public MapTheme getMapTheme() {
  9460. return mapTheme;
  9461. }
  9462.  
  9463. public void setMapTheme(MapTheme mapTheme) {
  9464. if (getMapTheme() == mapTheme)
  9465. return;
  9466. this.mapTheme = mapTheme;
  9467. if (loggedIn) {
  9468. queuedMapTheme = true;
  9469. }
  9470. }
  9471.  
  9472. /**
  9473. * @return the isOneClick
  9474. */
  9475. public boolean isOneClick() {
  9476. return isOneClick;
  9477. }
  9478.  
  9479. /**
  9480. * @param isOneClick the isOneClick to set
  9481. */
  9482. public void setOneClick(boolean isOneClick) {
  9483. this.isOneClick = isOneClick;
  9484. }
  9485.  
  9486. /**
  9487. * @return the fullscreenGreyBackground
  9488. */
  9489. public RSImage[] getFullscreenGreyBackground() {
  9490. return fullscreenGreyBackground;
  9491. }
  9492.  
  9493. /**
  9494. * @param fullscreenGreyBackground the fullscreenGreyBackground to set
  9495. */
  9496. public void setFullscreenGreyBackground(RSImage[] fullscreenGreyBackground) {
  9497. this.fullscreenGreyBackground = fullscreenGreyBackground;
  9498. }
  9499.  
  9500. /**
  9501. * @return the fullscreenBackground
  9502. */
  9503. public RSImage[] getFullscreenBackground() {
  9504. return fullscreenBackground;
  9505. }
  9506.  
  9507. /**
  9508. * @param fullscreenBackground the fullscreenBackground to set
  9509. */
  9510. public void setFullscreenBackground(RSImage[] fullscreenBackground) {
  9511. this.fullscreenBackground = fullscreenBackground;
  9512. }
  9513.  
  9514. /**
  9515. * @return the greyBackground
  9516. */
  9517. public RSImage[] getGreyBackground() {
  9518. return greyBackground;
  9519. }
  9520.  
  9521. /**
  9522. * @param greyBackground the greyBackground to set
  9523. */
  9524. public void setGreyBackground(RSImage[] greyBackground) {
  9525. this.greyBackground = greyBackground;
  9526. }
  9527.  
  9528.  
  9529.  
  9530. /**
  9531. * @param background the background to set
  9532. */
  9533. public void setBackground(RSImage[] background) {
  9534. this.background = background;
  9535. }
  9536.  
  9537. /**
  9538. * @return the interactingNpc
  9539. */
  9540. public NPC getInteractingNpc() {
  9541. return interactingNpc;
  9542. }
  9543.  
  9544. /**
  9545. * @param interactingNpc the interactingNpc to set
  9546. */
  9547. public void setInteractingNpc(NPC interactingNpc) {
  9548. this.interactingNpc = interactingNpc;
  9549. }
  9550.  
  9551. private boolean queuedMapTheme;
  9552. private RSInterface selectedDropDownMenu;
  9553. private int hoverDropDownAction;
  9554. private int dropDownCurrentHeight;
  9555. private long lastChosenDropAction;
  9556. public int presetGearIndex;
  9557.  
  9558. private int requestTabFocusAlpha;
  9559. private long lastRequestTabFocusGlow;
  9560.  
  9561. public static ChatboxDrawing chatboxDrawing;
  9562.  
  9563. static {
  9564. anIntArray1019 = new int[99];
  9565. int i = 0;
  9566. for (int j = 0; j < 99; j++) {
  9567. int l = j + 1;
  9568. int i1 = (int) ((double) l + 300D * Math.pow(2D, (double) l / 7D));
  9569. i += i1;
  9570. anIntArray1019[j] = i / 4;
  9571. }
  9572. anIntArray1232 = new int[32];
  9573. i = 2;
  9574. for (int k = 0; k < 32; k++) {
  9575. anIntArray1232[k] = i - 1;
  9576. i += i;
  9577. }
  9578. }
  9579. }
Add Comment
Please, Sign In to add comment