Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void startUp() {
- initCache();
- if (((String) LoginSettings.getSetting("FirstLoad")).equalsIgnoreCase("0")) {
- updateProgress("Remvoing Old Junk Files", 10);
- DeleteFiles();
- updateProgress("Junk Files Remvoed", 10);
- }
- updateProgress("Starting up", 0);
- if (Signlink.sunjava) {
- super.minDelay = 5;
- }
- getDocumentBaseHost();
- if (Signlink.cache_dat != null) {
- for (int index = 0; index < 6; index++) {
- cacheIndices[index] = new CacheIndex(Signlink.cache_dat, Signlink.cache_idx[index], index + 1);
- }
- for (int index = 0; index < 6; index++) {
- mainCacheIndices[index] = new CacheIndex(Signlink.MAIN_CACHE_DATA, Signlink.MAIN_CACHE_INDEX[index], index + 1);
- }
- }
- try {
- if (Constants.UPDATE_SERVER_ENABLED) {
- connect();
- }
- titleStreamLoader = getArchive(1, "title screen", "title", expectedCRCs[1], 25);
- smallText = new RSFont(false, "p11_full", titleStreamLoader);
- normalFont = new RSFont(false, "p12_full", titleStreamLoader);
- boldFont = new RSFont(false, "b12_full", titleStreamLoader);
- fancyText = new RSFont(true, "q8_full", titleStreamLoader);
- newSmallFont = new RSFontSystem(false, "p11_full", titleStreamLoader);
- newRegularFont = new RSFontSystem(false, "p12_full", titleStreamLoader);
- newBoldFont = new RSFontSystem(false, "b12_full", titleStreamLoader);
- newFancyFont = new RSFontSystem(true, "q8_full", titleStreamLoader);
- regularHitFont = new RSFontSystem(false, "regularhit", titleStreamLoader);
- bigHitFont = new RSFontSystem(true, "bighit", titleStreamLoader);
- loadTitleScreen();
- Archive config = getArchive(2, "config", "config", expectedCRCs[2], 30);
- Archive currentConfig = getCurrentArchive(2, "config", "config", expectedCRCs[2], 30);
- Archive interfaces = getArchive(3, "interface", "interface", expectedCRCs[3], 35);
- media = getArchive(4, "2d graphics", "media", expectedCRCs[4], 40);
- @SuppressWarnings("unused")
- Archive texture = getArchive(6, "textures", "textures", expectedCRCs[6], 45);
- Archive chat = getArchive(7, "chat system", "wordenc", expectedCRCs[7], 50);
- // Archive sound = getArchive(8, "sound effects", "sounds", expectedCRCs[8], 55);
- try {
- spriteManager = new CacheManager("sprites", 10, false);
- spriteManager.read();
- RSImageLoader.loadSprites();
- loadedImages = true;
- } catch (Exception e) {
- System.out.println("An error occurred while reading the image cache.");
- e.printStackTrace();
- }
- try {
- loadTitleImages();
- } catch (Exception e) {
- System.out.println("An error occurred while reading the title sprites.");
- e.printStackTrace();
- }
- // packMaps();
- groundTileSettings = new byte[4][104][104];
- heightMap = new int[4][105][105];
- sceneGraph = new WorldController(heightMap);
- for (int height = 0; height < 4; height++) {
- tileSettings[height] = new TileSetting();
- }
- miniMap = new RSImage(512, 512);
- // texture = getArchive(6, "textures", "textures", expectedCRCs[6], 45);
- Archive versions = getArchive(5, "update list", "versionlist", expectedCRCs[5], 60);
- Archive currentVersions = getCurrentArchive(5, "update list", "versionlist", expectedCRCs[5], 60);
- updateProgress("Connecting to update server", 60);
- onDemandFetcher = new OnDemandFetcher();
- onDemandFetcher.start(versions, this, currentVersions);
- //onDemandFetcher.dumpMaps();
- //onDemandFetcher.dumpMapConfig();
- //CacheRepack.repackCacheIndex(CacheRepack.MAP_INDEX);
- // CacheRepack.repackCacheIndex(CacheRepack.MODEL_INDEX);
- repackCacheIndex(1);
- //repackCacheIndex(2);
- //repackCacheIndex(2);
- // CacheRepack.repackCacheIndex(CacheRepack.TEXTURE_INDEX);
- // repackCacheIndex(6);
- //repackCacheIndex(5);
- // packModels(CacheRepack.MODEL_INDEX, false);
- Model.startup(85000, onDemandFetcher);
- preloadModels();
- Texture.init(1420, onDemandFetcher);
- updateProgress("Unpacking media", 80);
- buildFrame();
- // repackCacheIndex(4);
- /*
- * onDemandFetcher.writeChecksumList(0);
- * onDemandFetcher.writeVersionList(0);
- * onDemandFetcher.writeChecksumList(1);
- * onDemandFetcher.writeVersionList(1);
- */
- try {
- for (int index = 0; index < 149; index++) {
- cacheSprite[index] = getImage("cachesprites", Integer.toString(index));
- }
- } catch (Exception e) {
- System.out.println("An error occurred while reading the cache sprites.");
- e.printStackTrace();
- }
- try {
- for (int index = 0; index < 20; index++) {
- if (index < 17) {
- orbs[index] = new RSImage(media, "orbs", index);
- } else {
- orbs[index] = new RSImage(media, "orbs", 1);
- }
- orbs[3] = RSImageLoader.images[808]; // hp
- orbs[5] = RSImageLoader.images[809]; // prayer
- orbs[7] = RSImageLoader.images[810]; // run off
- orbs[9] = RSImageLoader.images[811]; // run on
- }
- for (int index = 0; index < 2; index++) {
- hitBar[index] = new RSImage(media, "hitmarks", index + 5);
- full = new RSImage(media, "hitmarks", 6);
- }
- } catch (Exception e) {
- }
- multiZone = new RSImage(media, "overlay_multiway", 0);
- for (int index = 0; index < 12; index++) {
- scrollPart[index] = new RSImage(media, "scrollpart", index);
- }
- for (int index = 0; index < 6; index++) {
- scrollBar[index] = new RSImage(media, "scrollbar", index);
- }
- mapBack = new IndexedImage(media, "mapback", 0);
- compass = new RSImage(media, "compass", 0);
- mapEdge = new RSImage(media, "mapedge", 0);
- mapEdge.trim();
- try {
- for (int mapindex = 0; mapindex < 80; mapindex++) {
- mapScenes[mapindex] = new RSImage(media, "mapscene", mapindex);
- }
- } catch (Exception e) {
- }
- try {
- for (int mapindex = 80; mapindex < 100; mapindex++) {
- mapScenes[mapindex] = new RSImage(media, "mapscene", mapindex);
- }
- } catch (Exception e) {
- }
- try {
- for (int mapFunctionIndex = 0; mapFunctionIndex <= 81; mapFunctionIndex++) {
- mapFunctions[mapFunctionIndex] = new RSImage(media, "mapfunction", mapFunctionIndex);
- }
- } catch (Exception e) {
- }
- try {
- for (int hitMarkIndex = 72; hitMarkIndex < 79; hitMarkIndex++) {
- hitMark[hitMarkIndex - 72] = cacheSprite[hitMarkIndex];
- }
- for (int hitMarkIndex = 79; hitMarkIndex <= 81; hitMarkIndex++) {
- hitShadow[hitMarkIndex - 79] = cacheSprite[hitMarkIndex];
- }
- for (int hitStyleIndex = 69; hitStyleIndex <= 71; hitStyleIndex++) {
- hitStyle[hitStyleIndex - 69] = cacheSprite[hitStyleIndex];
- }
- } catch (Exception e) {
- }
- try {
- for (int hintIconIndex = 0; hintIconIndex < 2; hintIconIndex++) {
- headIconsHint[hintIconIndex] = RSImageLoader.images[691 + hintIconIndex];// new RSImage(media, "headicons_hint", hintIconIndex);
- }
- for (int prayerIconIndex = 0; prayerIconIndex < 19; prayerIconIndex++) {
- headIcons[prayerIconIndex] = prayerIconIndex < 8 ? new RSImage(media, "headicons_prayer", prayerIconIndex)
- : RSImageLoader.images[661 + prayerIconIndex];
- }
- for (int skullIconIndex = 0; skullIconIndex < 2; skullIconIndex++) {
- skullIcons[skullIconIndex] = new RSImage(media, "headicons_pk", skullIconIndex);
- }
- } catch (Exception _ex) {
- _ex.printStackTrace();
- }
- mapFlag = new RSImage(media, "mapmarker", 0);
- mapMarker = new RSImage(media, "mapmarker", 1);
- for (int k4 = 0; k4 < 8; k4++) {
- crosses[k4] = new RSImage(media, "cross", k4);
- }
- mapDotItem = new RSImage(media, "mapdots", 0);
- mapDotNPC = new RSImage(media, "mapdots", 1);
- mapDotPlayer = new RSImage(media, "mapdots", 2);
- mapDotFriend = new RSImage(media, "mapdots", 3);
- mapDotTeam = new RSImage(media, "mapdots", 4);
- new RSImage(media, "mapdots", 5);
- unpackModIcons();
- for (int index = 0; index < 9; index++) {
- clanIcons[index] = new RSImage(media, "clanicons", index);
- }
- RSImage image = new RSImage(media, "frame", 0);
- leftFrame = new RSImageProducer(image.myWidth, image.myHeight, getGameComponent());
- image.drawInverse(0, 0);
- image = new RSImage(media, "frame", 1);
- topFrame = new RSImageProducer(image.myWidth, image.myHeight, getGameComponent());
- image.drawInverse(0, 0);
- image = new RSImage(media, "frame", 2);
- rightFrame = new RSImageProducer(image.myWidth, image.myHeight, getGameComponent());
- image.drawInverse(0, 0);
- RSFontSystem.unpackImages(modIcons, clanIcons);
- updateProgress("Unpacking textures", 83);
- Rasterizer.calculatePalette(0.6F);
- Rasterizer.resetTextures();
- updateProgress("Unpacking config", 86);
- try {
- Animation.load(config, currentConfig);
- ObjectDef.load(config);
- Flo.unpackConfig(config);
- FloorOverlay.unpackConfig(config);
- TextureDef.unpackConfig(config);
- ItemDef.load(config, currentConfig);
- NPCDef.load(config, currentConfig);
- IdentityKit.load(config);
- SpotAnim.load(config, currentConfig);
- Varp.load(config);
- VarBit.load(config);
- ItemDef.isMembers = true;
- } catch (Exception e) {
- e.printStackTrace();
- }
- ItemDef.isMembers = isMembers;
- if (getRevision() != HIGHEST_REVISION) {
- updateProgress("Unpacking animations", 88);
- for (int i = 0; i < OnDemandFetcher.getAnimationCount(); i++) {
- onDemandFetcher.loadMandatory(1, i);
- }
- while (onDemandFetcher.getRemaining() > 0) {
- processOnDemandQueue();
- try {
- Thread.sleep(100);
- } catch (Exception _E) {
- }
- }
- }
- // updateProgress("Unpacking sounds", 90);
- // byte abyte0[] = sound.getFile("sounds.dat");
- // JagexBuffer stream = new JagexBuffer(abyte0);
- // Track.load(stream);
- updateProgress("Unpacking interfaces", 95);
- RSFontSystem[] fonts = { newSmallFont, newRegularFont, newBoldFont, newFancyFont };
- RSInterface.unpack(interfaces, fonts, media);
- // RSInterface.pack();
- updateProgress("Preparing game engine", 100);
- for (int index = 0; index < 33; index++) {
- int k6 = 999;
- int i7 = 0;
- for (int index2 = 0; index2 < 34; index2++) {
- if (mapBack.aByteArray1450[index2 + index * mapBack.anInt1452] == 0) {
- if (k6 == 999) {
- k6 = index2;
- }
- continue;
- }
- if (k6 == 999) {
- continue;
- }
- i7 = index2;
- break;
- }
- anIntArray968[index] = k6;
- anIntArray1057[index] = i7 - k6;
- }
- for (int l6 = 1; l6 < 153; l6++) {
- int j7 = 999;
- int l7 = 0;
- for (int j8 = 24; j8 < 177; j8++) {
- if (mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34)) {
- if (j7 == 999) {
- j7 = j8;
- }
- continue;
- }
- if (j7 == 999) {
- continue;
- }
- l7 = j8;
- break;
- }
- anIntArray1052[l6 - 1] = j7 - 24;
- anIntArray1229[l6 - 1] = l7 - j7;
- }
- Rasterizer.setBounds(clientWidth, clientHeight);
- fullScreenTextureArray = Rasterizer.lineOffsets;
- Rasterizer.setBounds(isFixed() ? 519 : clientWidth, isFixed() ? 165 : clientHeight);
- chatAreaPixels = Rasterizer.lineOffsets;
- Rasterizer.setBounds(isFixed() ? 246 : clientWidth, isFixed() ? 335 : clientHeight);
- tabAreaPixels = Rasterizer.lineOffsets;
- Rasterizer.setBounds(gameAreaWidth, gameAreaHeight);
- gameAreaOffsets = Rasterizer.lineOffsets;
- int ai[] = new int[9];
- for (int i8 = 0; i8 < 9; i8++) {
- int k8 = 128 + i8 * 32 + 15;
- int l8 = 600 + k8 * 3;
- int i9 = Rasterizer.SINE[k8];
- ai[i8] = l8 * i9 >> 16;
- }
- WorldController.setupViewport(500, 800, 600, 600, ai);
- Censor.loadConfig(chat);
- ObjectOnTile.client = this;
- ObjectDef.clientInstance = this;
- NPCDef.clientInstance = this;
- //AccountHandler.load();
- buildFrame();
- Settings.load();
- loaded = true;
- return;
- } catch (Exception exception) {
- exception.printStackTrace();
- Signlink.reportError("loaderror " + aString1049 + " " + anInt1079);
- }
- // loadingError = true;
- }
- private void unpackModIcons() {
- modIcons[0] = RSImageLoader.images[680]; // Premium Donator
- modIcons[1] = RSImageLoader.images[681]; // Super Donator
- modIcons[2] = RSImageLoader.images[682]; // Extreme Donator
- modIcons[3] = RSImageLoader.images[683]; // Legendary Donator
- modIcons[4] = RSImageLoader.images[955]; // Mega Donator
- modIcons[5] = RSImageLoader.images[684]; // Server Support
- modIcons[6] = RSImageLoader.images[685]; // Respected Member
- modIcons[7] = RSImageLoader.images[686]; // Veteran
- modIcons[8] = RSImageLoader.images[687]; // Moderator
- modIcons[9] = RSImageLoader.images[976]; // Head moderator
- modIcons[10] = RSImageLoader.images[688]; // Developer
- modIcons[11] = RSImageLoader.images[689]; // Administrator
- modIcons[12] = RSImageLoader.images[1053]; // Owner
- modIcons[13] = RSImageLoader.images[1054]; // Youtube
- }
- public void benchmarkItems() {
- long first = getItemBenchmark();
- long second = getItemBenchmark();
- long third = getItemBenchmark();
- long fourth = getItemBenchmark();
- long fifth = getItemBenchmark();
- long average = (first + second + third + fourth + fifth) / 5;
- System.out.println("Items looped through at an average of " + average + " milliseconds");
- }
- public long getItemBenchmark() {
- long start = System.currentTimeMillis();
- for (int index = 0; index < ItemDef.totalItems; index++) {
- ItemDef.getDef(index);
- }
- long end = System.currentTimeMillis();
- return (end - start);
- }
- private void addNewLocalPlayer(JagexBuffer stream, int i) {
- while (stream.position + 10 < i * 8) {
- int j = stream.getBits(11);
- if (j == 2047) {
- break;
- }
- if (players[j] == null) {
- players[j] = new Player();
- if (aStreamArray895s[j] != null) {
- players[j].updatePlayer(aStreamArray895s[j]);
- }
- }
- playerIndices[playerCount++] = j;
- Player player = players[j];
- player.time = loopCycle;
- int k = stream.getBits(1);
- if (k == 1) {
- localPlayers[localPlayersIndex++] = j;
- }
- int l = stream.getBits(1);
- int i1 = stream.getBits(5);
- if (i1 > 15) {
- i1 -= 32;
- }
- int j1 = stream.getBits(5);
- if (j1 > 15) {
- j1 -= 32;
- }
- player.setPos(myPlayer.pathX[0] + j1, myPlayer.pathY[0] + i1, l == 1);
- }
- stream.finishBitAccess();
- }
- public static boolean inCircle(int circleX, int circleY, int clickX, int clickY, int radius) {
- return java.lang.Math.pow((circleX + radius - clickX), 2) + java.lang.Math.pow((circleY + radius - clickY), 2) < java.lang.Math
- .pow(radius, 2);
- }
- public boolean canClickMap() {
- if (super.getMouseX() >= clientWidth - 21 && super.getMouseX() <= clientWidth && super.getMouseY() >= 0 && super.getMouseY() <= 21) {
- return false;
- }
- return true;
- }
- private void processMainScreenClick() {
- if (minimapState != 0) {
- return;
- }
- if (super.clickMode3 == 1) {
- int clickX = this.getClickX() - 3 - (isFixed() ? clientWidth - 214 : clientWidth - 163) - (isFixed() ? getMapOffsetX() : 0);
- int clickY = this.getClickY() - (isFixed() ? 9 : 6) - (isFixed() ? getMapOffsetY() : 0);
- // if (i >= 0 && j >= 0 && i < 152 && j < 152 && canClickMap()) {
- if (inCircle(0, 0, clickX, clickY, 76) && showMiniMap) {
- clickX -= 73;
- clickY -= 75;
- int k = viewRotation + minimapRotation & 0x7ff;
- int i1 = Rasterizer.SINE[k];
- int j1 = Rasterizer.COSINE[k];
- i1 = i1 * (minimapZoom + 256) >> 8;
- j1 = j1 * (minimapZoom + 256) >> 8;
- int k1 = clickY * i1 + clickX * j1 >> 11;
- int l1 = clickY * j1 - clickX * i1 >> 11;
- int i2 = myPlayer.currentX + k1 >> 7;
- int j2 = myPlayer.currentY - l1 >> 7;
- if(isAdministrator() && controlIsDown) {
- teleport(baseX + i2, baseY + j2);
- } else {
- boolean flag1 = calculatePath(1, 0, 0, 0, myPlayer.pathY[0], 0, 0, j2, myPlayer.pathX[0], true, i2);
- if (flag1) {
- outgoingPacket.writeByte(clickX);
- outgoingPacket.writeByte(clickY);
- outgoingPacket.writeShort(viewRotation);
- outgoingPacket.writeByte(57);
- outgoingPacket.writeByte(minimapRotation);
- outgoingPacket.writeByte(minimapZoom);
- outgoingPacket.writeByte(89);
- outgoingPacket.writeShort(myPlayer.currentX);
- outgoingPacket.writeShort(myPlayer.currentY);
- outgoingPacket.writeByte(arbitratyPathDestination);
- outgoingPacket.writeByte(63);
- }
- }
- anInt1117++;
- if (anInt1117 > 1151) {
- anInt1117 = 0;
- outgoingPacket.createFrame(246);
- outgoingPacket.writeByte(0);
- int l = outgoingPacket.offset;
- if ((int) (Math.random() * 2D) == 0) {
- outgoingPacket.writeByte(101);
- }
- outgoingPacket.writeByte(197);
- outgoingPacket.writeShort((int) (Math.random() * 65536D));
- outgoingPacket.writeByte((int) (Math.random() * 256D));
- outgoingPacket.writeByte(67);
- outgoingPacket.writeShort(14214);
- if ((int) (Math.random() * 2D) == 0) {
- outgoingPacket.writeShort(29487);
- }
- outgoingPacket.writeShort((int) (Math.random() * 65536D));
- if ((int) (Math.random() * 2D) == 0) {
- outgoingPacket.writeByte(220);
- }
- outgoingPacket.writeByte(180);
- outgoingPacket.writeSizeByte(outgoingPacket.offset - l);
- }
- }
- }
- }
- private String interfaceIntToString(int j) {
- if (j < 0x3b9ac9ff) {
- return String.valueOf(j);
- } else {
- return "*";
- }
- }
- public Image getURLImage(String url) {
- return null;
- }
- private String[][] tooltips = {
- { "The overall content version of the client.", "This applies to gameframe, models,", "animations, graphics, and hitsplats." },
- { "Choose from classic 474 or cleaner", "508 gameframes." },
- { "Choose from basic 474 or 500+ era models." },
- { "Choose from basic 474 or 500+ era", "animations and graphics." },
- { "Choose from standard 474, spiky 562", "or 634 combat icon hitsplats." },
- { "Standard detail will remove ground", "decorations, roofs, and lower the memory",
- "usage. High detail will include all of those", "and will use more memory." }, { "Save the content settings." } };
- private boolean tooltipHover = false;
- private void displayTooltip(int index) {
- if (tooltipHover) {
- int centerX = clientWidth / 2;
- int padding = 5;
- int width = padding * 2;
- int height = padding;
- if (index < tooltips.length) {
- for (int string = 0; string < tooltips[index].length; string++) {
- if (width < padding * 2 + arial[1].stringWidth(tooltips[index][string])) {
- width = padding * 2 + arial[1].stringWidth(tooltips[index][string]);
- }
- height += arial[1].stringHeight(tooltips[index][string]);
- }
- }
- int x = centerX + 230 / 2;
- int alpha = 200;
- DrawingArea.drawRoundedRectangle(x + 5, super.getMouseY() - height / 2, width, height, 0, alpha, true, false);
- DrawingArea.drawFilledPixels(x - 1, super.getMouseY(), 1, 1, 0, alpha);
- DrawingArea.drawFilledPixels(x, super.getMouseY() - 1, 1, 3, 0, alpha);
- DrawingArea.drawFilledPixels(x + 1, super.getMouseY() - 2, 1, 5, 0, alpha);
- DrawingArea.drawFilledPixels(x + 2, super.getMouseY() - 3, 1, 7, 0, alpha);
- ;
- DrawingArea.drawFilledPixels(x + 3, super.getMouseY() - 4, 1, 9, 0, alpha);
- DrawingArea.drawFilledPixels(x + 4, super.getMouseY() - 5, 1, 11, 0, alpha);
- if (index < tooltips.length) {
- for (int string = 0; string < tooltips[index].length; string++) {
- arial[1].drawString(tooltips[index][string], x + padding * 2, (super.getMouseY() - height / 2 + 15) + (string * 14),
- 0xffffff, true);
- }
- }
- }
- }
- /*
- * URL to client background
- */
- // private RSImage selectbg = new RSImage(getURLImage("http://i50.tinypic.com/x4ok6s.png"));
- @SuppressWarnings("unused")
- private void showSelectionScreen() {
- int centerX = clientWidth / 2;
- int centerY = clientHeight / 2;
- resetImageProducers();
- title.create();
- DrawingArea.drawFilledPixels(0, 0, clientWidth, clientHeight, 0xff00ff);
- // selectbg.drawImage(0, 0);
- if (Content.fileExists() && !Content.contentRead) {
- int padding = 7;
- int width = 225;
- int height = 50;
- int x = centerX - width / 2;
- int y = centerY - height / 2;
- DrawingArea.drawRoundedRectangle(x, y, width, height, 0, 150, true, false);
- x = centerX - 37;
- y += 10 + padding;
- arial[2].drawStringCenter("Content Options", centerX, y, 0xffffff, true);
- addButton("Load", x, y += padding, 0);
- addButton("Edit", x += 43, y, 1);
- } else {
- int width = 225;
- int height = 200;
- int x = centerX - width / 2;
- int y = centerY - height / 2;
- DrawingArea.drawRoundedRectangle(x, y, width, height, 0, 150, true, false);
- x = centerX + 70;
- y += 20;
- arial[2].drawStringCenter("Content Options", centerX, y, 0xffffff, true);
- addOption("Version", Content.versions[0] != -1 ? Integer.toString(Content.getVersion(0)) : "Custom",
- Content.versions[0] != -1 ? x : x - 23, y += 10, 0);
- displayTooltip(0);
- addOption("Gameframe version", Integer.toString(Content.getVersion(1)), x, y += 24, 1);
- displayTooltip(1);
- addOption("Character/item model version", Integer.toString(Content.getVersion(2)), x, y += 24, 2);
- displayTooltip(2);
- addOption("Animation/graphic version", Integer.toString(Content.getVersion(3)), x, y += 24, 3);
- displayTooltip(3);
- addOption("Hitsplat version", Integer.toString(Content.getVersion(4)), x, y += 24, 4);
- displayTooltip(4);
- addOption("Detail", lowMemory ? "Standard" : "High", x - (lowMemory ? 29 : 5), y += 24, 5);
- displayTooltip(5);
- addButton("Save", centerX - 17, y += 25, 6);
- displayTooltip(6);
- }
- title.drawGraphics(0, super.graphics, 0);
- }
- public void addOption(String title, String text, int x, int y, int action) {
- addTextBox(title, x, y);
- addButton(text, x, y, action);
- }
- public void addButton(String text, int x, int y, int action) {
- int padding = 5;
- int width = arial[1].stringWidth(text) + padding * 2;
- int height = arial[1].stringHeight(text) + padding * 2 - 4;
- if (super.clickMode3 == 1 && clickInRegion(x, x + width, y, y + height)) {
- clickButton(action);
- }
- x += 1;
- int alpha = 100;
- if (mouseInRegion(x, x + width, y, y + height)) {
- tooltipHover = true;
- alpha = 200;
- } else {
- tooltipHover = false;
- }
- DrawingArea.drawRoundedRectangle(x, y, width, height, 0, alpha, true, false);
- arial[1].drawString(text, x + padding, y + arial[1].stringHeight(text), 0xffffff, true);
- }
- public void addTextBox(String text, int x, int y) {
- int padding = 5;
- int width = arial[1].stringWidth(text) + padding * 2;
- int height = arial[1].stringHeight(text) + padding * 2 - 4;
- x -= width + 1;
- DrawingArea.drawRoundedRectangle(x, y, width, height, 0, 200, true, false);
- arial[1].drawString(text, x + padding, y + arial[1].stringHeight(text), 0xffffff, true);
- }
- public static TrayIcon trayIcon;
- public void setTray() {
- if (SystemTray.isSupported()) {
- URL url2 = null;
- boolean updateIcon = true;
- try {
- url2 = new URL("http://http://i.imgur.com/0Y14WAV.png");
- } catch (MalformedURLException ex) {
- updateIcon = false;
- ex.printStackTrace();
- }
- if (updateIcon) {
- System.out.println("Icon updated.");
- Image icon = Toolkit.getDefaultToolkit().getImage(url2);
- trayIcon = new TrayIcon(icon, "Client is running.");
- trayIcon.setImageAutoSize(true);
- try {
- SystemTray tray = SystemTray.getSystemTray();
- tray.add(trayIcon);
- PopupMenu menu = new PopupMenu();
- MenuItem exitItem = new MenuItem("Exit");
- menu.add(exitItem);
- trayIcon.setPopupMenu(menu);
- ActionListener exitListener = new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- System.exit(0);
- }
- };
- exitItem.addActionListener(exitListener);
- } catch (AWTException e) {
- System.err.println(e);
- }
- }
- }
- }
- public void clickButton(int action) {
- switch (action) {
- case 0:
- if (Content.fileExists() && !Content.contentRead) {
- super.ready = true;
- Content.load();
- startUp();
- } else {
- Content.versions[action] = Content.versions[action] < Content.revisions.length - 1 ? Content.versions[action] + 1 : 0;
- for (int index = 1; index < Content.versions.length; index++) {
- if (index != Content.HITSPLAT) {
- Content.versions[index] = Content.versions[0];
- }
- }
- }
- break;
- case 1:
- if (Content.fileExists() && !Content.contentRead) {
- Content.load();
- } else {
- if (Content.revisions.length > 1) {
- Content.versions[0] = -1;
- }
- Content.versions[action] = Content.versions[action] < Content.revisions.length - 1 ? Content.versions[action] + 1 : 0;
- }
- break;
- case 2:
- case 3:
- if (Content.revisions.length > 1) {
- Content.versions[0] = -1;
- }
- Content.versions[action] = Content.versions[action] < Content.revisions.length - 1 ? Content.versions[action] + 1 : 0;
- break;
- case 4:
- if (Content.revisions.length > 1) {
- Content.versions[0] = -1;
- }
- Content.versions[action] = Content.versions[action] < Content.hitsplats.length - 1 ? Content.versions[action] + 1 : 0;
- break;
- case 5:
- lowMemory = !lowMemory;
- if (lowMemory) {
- setLowMemory();
- } else {
- setHighMemory();
- }
- break;
- case 6:
- Content.save();
- Content.contentRead = false;
- break;
- }
- }
- private void showErrorScreen() {
- Graphics g = getGameComponent().getGraphics();
- g.setColor(Color.black);
- g.fillRect(0, 0, 765, 503);
- setDelayTime(1);
- if (loadingError) {
- aBoolean831 = false;
- g.setFont(new Font("Helvetica", 1, 16));
- g.setColor(Color.yellow);
- int k = 35;
- g.drawString("Sorry, an error has occured whilst loading Lost Dynasty.", 30, k);
- k += 50;
- g.setColor(Color.white);
- g.drawString("To fix this try the following (in order):", 30, k);
- k += 50;
- g.setColor(Color.white);
- g.setFont(new Font("Helvetica", 1, 12));
- g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
- k += 30;
- g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
- k += 30;
- g.drawString("3: Try using a different game-world", 30, k);
- k += 30;
- g.drawString("4: Try rebooting your computer", 30, k);
- k += 30;
- g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
- }
- if (genericLoadingError) {
- aBoolean831 = false;
- g.setFont(new Font("Helvetica", 1, 20));
- g.setColor(Color.white);
- g.drawString("Error - unable to load game!", 50, 50);
- g.drawString("To play Lost Dynasty make sure you play from", 50, 100);
- g.drawString("http://www.Lost Dynasty.com", 50, 150);
- }
- if (rsAlreadyLoaded) {
- aBoolean831 = false;
- g.setColor(Color.yellow);
- int l = 35;
- g.drawString("Error a copy of Lost Dynasty already appears to be loaded", 30, l);
- l += 50;
- g.setColor(Color.white);
- g.drawString("To fix this try the following (in order):", 30, l);
- l += 50;
- g.setColor(Color.white);
- g.setFont(new Font("Helvetica", 1, 12));
- g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
- l += 30;
- g.drawString("2: Try rebooting your computer, and reloading", 30, l);
- l += 30;
- }
- }
- public URL getCodeBase() {
- try {
- return new URL(server + ":" + (80 + portOff));
- } catch (Exception _ex) {
- }
- return null;
- }
- private void method95() {
- for (int j = 0; j < npcCount; j++) {
- int k = npcIndices[j];
- NPC npc = npcArray[k];
- if (npc != null) {
- method96(npc);
- }
- }
- }
- private void method96(Entity entity) {
- if (entity.currentX < 128 || entity.currentY < 128 || entity.currentX >= 13184 || entity.currentY >= 13184) {
- entity.forcedAnimId = -1;
- entity.graphicsAnimId = -1;
- entity.speed = 0;
- entity.reverseSpeed = 0;
- entity.currentX = entity.pathX[0] * 128 + entity.tileSize * 64;
- entity.currentY = entity.pathY[0] * 128 + entity.tileSize * 64;
- entity.method446();
- }
- if (entity == myPlayer
- && (entity.currentX < 1536 || entity.currentY < 1536 || entity.currentX >= 11776 || entity.currentY >= 11776)) {
- entity.forcedAnimId = -1;
- entity.graphicsAnimId = -1;
- entity.speed = 0;
- entity.reverseSpeed = 0;
- entity.currentX = entity.pathX[0] * 128 + entity.tileSize * 64;
- entity.currentY = entity.pathY[0] * 128 + entity.tileSize * 64;
- entity.method446();
- }
- if (entity.speed > loopCycle) {
- method97(entity);
- } else if (entity.reverseSpeed >= loopCycle) {
- method98(entity);
- } else {
- method99(entity);
- }
- // sendMessage("speed=" + entity.speed + "; reverseS=" + entity.reverseSpeed + "; cycle=" + loopCycle);
- method100(entity);
- handleAnimableData(entity);
- }
- private void method97(Entity entity) {
- int i = entity.speed - loopCycle;
- int j = entity.firstForcedX * 128 + entity.tileSize * 64;
- int k = entity.firstForcedY * 128 + entity.tileSize * 64;
- entity.currentX += (j - entity.currentX) / i;
- entity.currentY += (k - entity.currentY) / i;
- entity.anInt1503 = 0;
- if (entity.direction == 0) {
- entity.turnDirection = 1024;
- }
- if (entity.direction == 1) {
- entity.turnDirection = 1536;
- }
- if (entity.direction == 2) {
- entity.turnDirection = 0;
- }
- if (entity.direction == 3) {
- entity.turnDirection = 512;
- }
- }
- private void method98(Entity entity) {
- if (entity.reverseSpeed == loopCycle || entity.forcedAnimId == -1 || entity.animationDelay != 0
- || entity.forcedAnimCycle + 1 > Animation.getAnim(entity.forcedAnimId).getDelay(entity.forcedAnimFrame)) {
- int i = entity.reverseSpeed - entity.speed;
- int j = loopCycle - entity.speed;
- int k = entity.firstForcedX * 128 + entity.tileSize * 64;
- int l = entity.firstForcedY * 128 + entity.tileSize * 64;
- int i1 = entity.secondForcedX * 128 + entity.tileSize * 64;
- int j1 = entity.secondForcedY * 128 + entity.tileSize * 64;
- if (i != 0) {
- entity.currentX = (k * (i - j) + i1 * j) / i;
- entity.currentY = (l * (i - j) + j1 * j) / i;
- }
- }
- entity.anInt1503 = 0;
- if (entity.direction == 0) {
- entity.turnDirection = 1024;
- }
- if (entity.direction == 1) {
- entity.turnDirection = 1536;
- }
- if (entity.direction == 2) {
- entity.turnDirection = 0;
- }
- if (entity.direction == 3) {
- entity.turnDirection = 512;
- }
- entity.currentRotation = entity.turnDirection;
- }
- private void method99(Entity entity) {
- entity.idleAnimId = entity.standAnimIndex;
- if (entity.pathLength == 0) {
- entity.anInt1503 = 0;
- return;
- }
- if (entity.forcedAnimId != -1 && entity.animationDelay == 0) {
- Animation animation = Animation.getAnim(entity.forcedAnimId);
- if (entity.anInt1542 > 0 && animation.stopMovement == 0) {
- entity.anInt1503++;
- return;
- }
- if (entity.anInt1542 <= 0 && animation.walkProperties == 0) {
- entity.anInt1503++;
- return;
- }
- }
- int i = entity.currentX;
- int j = entity.currentY;
- int k = entity.pathX[entity.pathLength - 1] * 128 + entity.tileSize * 64;
- int l = entity.pathY[entity.pathLength - 1] * 128 + entity.tileSize * 64;
- if (k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256) {
- entity.currentX = k;
- entity.currentY = l;
- return;
- }
- if (i < k) {
- if (j < l) {
- entity.turnDirection = 1280;
- } else if (j > l) {
- entity.turnDirection = 1792;
- } else {
- entity.turnDirection = 1536;
- }
- } else if (i > k) {
- if (j < l) {
- entity.turnDirection = 768;
- } else if (j > l) {
- entity.turnDirection = 256;
- } else {
- entity.turnDirection = 512;
- }
- } else if (j < l) {
- entity.turnDirection = 1024;
- } else {
- entity.turnDirection = 0;
- }
- int i1 = entity.turnDirection - entity.currentRotation & 0x7ff;
- if (i1 > 1024) {
- i1 -= 2048;
- }
- int j1 = entity.turn180AnimIndex;
- if (i1 >= -256 && i1 <= 256) {
- j1 = entity.walkAnimIndex;
- } else if (i1 >= 256 && i1 < 768) {
- j1 = entity.turn90CCWAnimIndex;
- } else if (i1 >= -768 && i1 <= -256) {
- j1 = entity.turn90CWAnimIndex;
- }
- if (j1 == -1) {
- j1 = entity.walkAnimIndex;
- }
- entity.idleAnimId = j1;
- int k1 = 4;
- if (entity.currentRotation != entity.turnDirection && entity.interactingEntity == -1 && entity.degreesToTurn != 0) {
- k1 = 2;
- }
- if (entity.pathLength > 2) {
- k1 = 6;
- }
- if (entity.pathLength > 3) {
- k1 = 8;
- }
- if (entity.anInt1503 > 0 && entity.pathLength > 1) {
- k1 = 8;
- entity.anInt1503--;
- }
- if (entity.pathRun[entity.pathLength - 1]) {
- k1 <<= 1;
- }
- if (k1 >= 8 && entity.idleAnimId == entity.walkAnimIndex && entity.runAnimIndex != -1) {
- entity.idleAnimId = entity.runAnimIndex;
- }
- if (i < k) {
- entity.currentX += k1;
- if (entity.currentX > k) {
- entity.currentX = k;
- }
- } else if (i > k) {
- entity.currentX -= k1;
- if (entity.currentX < k) {
- entity.currentX = k;
- }
- }
- if (j < l) {
- entity.currentY += k1;
- if (entity.currentY > l) {
- entity.currentY = l;
- }
- } else if (j > l) {
- entity.currentY -= k1;
- if (entity.currentY < l) {
- entity.currentY = l;
- }
- }
- if (entity.currentX == k && entity.currentY == l) {
- entity.pathLength--;
- if (entity.anInt1542 > 0) {
- entity.anInt1542--;
- }
- }
- }
- private void method100(Entity entity) {
- if (entity.degreesToTurn == 0) {
- return;
- }
- if (entity.interactingEntity != -1 && entity.interactingEntity < 32768) {
- NPC npc = npcArray[entity.interactingEntity];
- if (npc != null) {
- int i1 = entity.currentX - npc.currentX;
- int k1 = entity.currentY - npc.currentY;
- if (i1 != 0 || k1 != 0) {
- entity.turnDirection = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
- }
- }
- }
- if (entity.interactingEntity >= 32768) {
- int j = entity.interactingEntity - 32768;
- if (j == myPlayerId) {
- j = myPlayerIndex;
- }
- Player player = players[j];
- if (player != null) {
- int l1 = entity.currentX - player.currentX;
- int i2 = entity.currentY - player.currentY;
- if (l1 != 0 || i2 != 0) {
- entity.turnDirection = (int) (Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
- }
- }
- }
- if ((entity.faceX != 0 || entity.faceY != 0) && (entity.pathLength == 0 || entity.anInt1503 > 0)) {
- int k = entity.currentX - (entity.faceX - baseX - baseX) * 64;
- int j1 = entity.currentY - (entity.faceY - baseY - baseY) * 64;
- if (k != 0 || j1 != 0) {
- entity.turnDirection = (int) (Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
- }
- entity.faceX = 0;
- entity.faceY = 0;
- }
- int l = entity.turnDirection - entity.currentRotation & 0x7ff;
- if (l != 0) {
- if (l < entity.degreesToTurn || l > 2048 - entity.degreesToTurn) {
- entity.currentRotation = entity.turnDirection;
- } else if (l > 1024) {
- entity.currentRotation -= entity.degreesToTurn;
- } else {
- entity.currentRotation += entity.degreesToTurn;
- }
- entity.currentRotation &= 0x7ff;
- if (entity.idleAnimId == entity.standAnimIndex && entity.currentRotation != entity.turnDirection) {
- if (entity.turnAnimIndex != -1) {
- entity.idleAnimId = entity.turnAnimIndex;
- return;
- }
- entity.idleAnimId = entity.walkAnimIndex;
- }
- }
- }
- private void handleAnimableData(Entity e) {
- e.aBoolean1541 = false;
- if (e.idleAnimId != -1) {
- Animation anim = Animation.getAnim(e.idleAnimId);
- e.idleAnimCycle++;
- if (e.idleAnimFrame < anim.frameCount && e.idleAnimCycle > anim.getDelay(e.idleAnimFrame)) {
- e.idleAnimCycle -= anim.getDelay(e.idleAnimFrame);
- e.idleAnimFrame++;
- }
- if (e.idleAnimFrame >= anim.frameCount) {
- e.idleAnimFrame = 0;
- }
- e.idleAnimDestFrame = e.idleAnimFrame + 1;
- if (e.idleAnimDestFrame >= anim.frameCount) {
- e.idleAnimDestFrame = 0;
- }
- e.idleAnimNCycles = anim.getDelay(e.idleAnimFrame);
- }
- if (e.graphicsAnimId >= SpotAnim.total) { // graphics anti-freeze
- e.graphicsAnimId = -1;
- }
- if (e.graphicsAnimId != -1 && loopCycle >= e.graphicsDelay) {
- if (e.graphicsAnimFrame < 0) {
- e.graphicsAnimFrame = 0;
- }
- Animation animation_1 = SpotAnim.getGraphic(e.graphicsAnimId).animation;
- if (animation_1 != null) {
- int delay = animation_1.getDelay(e.graphicsAnimFrame);
- for (e.graphicsAnimCycle++; e.graphicsAnimFrame < animation_1.frameCount && e.graphicsAnimCycle > delay;) {
- e.graphicsAnimCycle -= delay;
- e.graphicsAnimFrame++;
- e.graphicsAnimNCycles = animation_1.getDelay(e.graphicsAnimFrame);
- e.graphicsAnimDestFrame = e.graphicsAnimFrame + 1;
- if (e.graphicsAnimDestFrame >= animation_1.frameCount) {
- e.graphicsAnimDestFrame = -1;
- }
- }
- if (e.graphicsAnimFrame >= animation_1.frameCount
- && (e.graphicsAnimFrame < 0 || e.graphicsAnimFrame >= animation_1.frameCount)) {
- e.graphicsAnimId = -1;
- }
- }
- }
- if (e.forcedAnimId != -1 && e.animationDelay <= 1) {
- Animation anim = Animation.getAnim(e.forcedAnimId);
- if (anim.stopMovement == 1 && e.anInt1542 > 0 && e.speed <= loopCycle && e.reverseSpeed < loopCycle) {
- e.animationDelay = 1;
- return;
- }
- }
- if (e.forcedAnimId != -1 && e.animationDelay == 0) {
- Animation anim = Animation.getAnim(e.forcedAnimId);
- for (e.forcedAnimCycle++; e.forcedAnimFrame < anim.frameCount && e.forcedAnimCycle > anim.getDelay(e.forcedAnimFrame); e.forcedAnimFrame++) {
- e.forcedAnimCycle -= anim.getDelay(e.forcedAnimFrame);
- }
- if (e.forcedAnimFrame >= anim.frameCount) {
- e.forcedAnimFrame -= anim.loopDelay;
- e.animation_reset_cycle++;
- if (e.animation_reset_cycle >= anim.frameStep) {
- e.forcedAnimId = -1;
- }
- if (e.forcedAnimFrame < 0 || e.forcedAnimFrame >= anim.frameCount) {
- e.forcedAnimId = -1;
- }
- }
- e.forcedAnimNCycles = anim.getDelay(e.forcedAnimFrame);
- e.forcedAnimDestFrame = e.forcedAnimFrame + 1;
- if (e.forcedAnimDestFrame >= anim.frameCount) {
- e.forcedAnimDestFrame = -1;
- }
- e.aBoolean1541 = anim.singleTileAnimation;
- }
- if (e.animationDelay > 0) {
- e.animationDelay--;
- }
- }
- private void drawGameScreen() {
- if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
- if (loadingStage == 2) {
- method119(anInt945, fullscreenInterfaceID);
- if (openInterfaceID != -1) {
- method119(anInt945, openInterfaceID);
- }
- anInt945 = 0;
- resetAllImageProducers();
- super.fullGameScreen.create();
- Rasterizer.lineOffsets = fullScreenTextureArray;
- DrawingArea.clear();
- welcomeScreenRaised = true;
- if (openInterfaceID != -1) {
- RSInterface rsi = RSInterface.interfaceCache[openInterfaceID];
- if (rsi.width == 512 && rsi.height == 334 && rsi.type == 0) {
- rsi.width = 765;
- rsi.height = 503;
- }
- drawInterface(0, 8, 0, rsi);
- }
- RSInterface rsi = RSInterface.interfaceCache[fullscreenInterfaceID];
- if (rsi.width == 512 && rsi.height == 334 && rsi.type == 0) {
- rsi.width = clientWidth;
- rsi.height = clientHeight;
- }
- drawInterface(0, 8, 0, rsi);
- if (!menuOpen) {
- processRightClick();
- drawTooltip();
- } else {
- drawMenu();
- }
- }
- drawCount++;
- super.fullGameScreen.drawGraphics(0, super.graphics, 0);
- return;
- } else {
- if (drawCount != 0) {
- resetImageProducers2();
- }
- }
- if (isFixed()) {
- leftFrame.drawGraphics(0, super.graphics, 0);
- topFrame.drawGraphics(0, super.graphics, 4);
- rightFrame.drawGraphics(0, super.graphics, 516);
- }
- if (welcomeScreenRaised) {
- welcomeScreenRaised = false;
- redrawTabArea = true;
- inputTaken = true;
- tabAreaAltered = true;
- if (loadingStage != 2) {
- gameArea.drawGraphics(clientSize == 0 ? 4 : 0, super.graphics, clientSize == 0 ? 4 : 0);
- if (clientSize == 0) {
- mapArea.drawGraphics(0, super.graphics, 765 - 246);
- }
- }
- }
- if (menuOpen && menuScreenArea == 1) {
- redrawTabArea = true;
- }
- if (invOverlayInterfaceID != -1) {
- boolean flag1 = method119(anInt945, invOverlayInterfaceID);
- if (flag1) {
- redrawTabArea = true;
- }
- }
- if (atInventoryInterfaceType == 2) {
- redrawTabArea = true;
- }
- if (activeInterfaceType == 2) {
- redrawTabArea = true;
- }
- increaseRequestedTabAlpha();
- if (redrawTabArea) {
- if (isFixed()) {
- drawTabArea();
- }
- redrawTabArea = false;
- }
- if (backDialogID == -1 && !GrandExchange.searchingItem && chatboxDrawing == null) {
- rsi.scrollPosition = scrollBarPosition - anInt1089 - 110;
- if (super.getMouseX() > 478 && super.getMouseX() < 580 && super.getMouseY() > (clientHeight - 161)) {
- method65(494, 110, super.getMouseX() - 0, super.getMouseY() - (clientHeight - 155), rsi, 0, false, scrollBarPosition);
- }
- int i = scrollBarPosition - 110 - rsi.scrollPosition;
- if (i < 0) {
- i = 0;
- }
- if (i > scrollBarPosition - 110) {
- i = scrollBarPosition - 110;
- }
- if (anInt1089 != i) {
- anInt1089 = i;
- inputTaken = true;
- }
- }
- if (backDialogID == -1 && GrandExchange.searchingItem) {
- int position = ChatboxItemSearch.CURRENT_ITEM_RESULT * 14 + 7;
- rsi.scrollPosition = ChatboxItemSearch.scrollBarPosition;
- if (super.getMouseX() > 478 && super.getMouseX() < 580 && super.getMouseY() > (clientHeight - 161)) {
- method65(494, 110, super.getMouseX() - 0, super.getMouseY() - (clientHeight - 155), rsi, 0, false,
- ChatboxItemSearch.CURRENT_ITEM_RESULT);
- }
- int scrollPosition = rsi.scrollPosition;
- if (scrollPosition < 0) {
- scrollPosition = 0;
- }
- if (scrollPosition > position - 110) {
- scrollPosition = position - 110;
- }
- if (ChatboxItemSearch.scrollBarPosition != scrollPosition) {
- ChatboxItemSearch.scrollBarPosition = scrollPosition;
- inputTaken = true;
- }
- } else if (backDialogID == -1 && inputDialogState == 4) {
- int position = totalObjectResults * 14 + 7;
- rsi.scrollPosition = objectResultScrollPos;
- if (super.getMouseX() > 478 && super.getMouseX() < 580 && super.getMouseY() > (clientHeight - 161)) {
- method65(494, 110, super.getMouseX() - 0, super.getMouseY() - (clientHeight - 155), rsi, 0, false, totalObjectResults);
- }
- int scrollPosition = rsi.scrollPosition;
- if (scrollPosition < 0) {
- scrollPosition = 0;
- }
- if (scrollPosition > position - 110) {
- scrollPosition = position - 110;
- }
- if (objectResultScrollPos != scrollPosition) {
- objectResultScrollPos = scrollPosition;
- inputTaken = true;
- }
- }
- if (backDialogID != -1) {
- boolean flag2 = method119(anInt945, backDialogID);
- if (flag2) {
- inputTaken = true;
- }
- }
- if (atInventoryInterfaceType == 3) {
- inputTaken = true;
- }
- if (activeInterfaceType == 3) {
- inputTaken = true;
- }
- if (aString844 != null) {
- inputTaken = true;
- }
- if (menuOpen && menuScreenArea == 2) {
- inputTaken = true;
- }
- ExtendChatArea();
- if (inputTaken) {
- drawChatArea();
- drawConsoleArea();
- inputTaken = false;
- }
- if (queuedMapTheme) {
- queuedMapTheme = false;
- method22();
- }
- if (loadingStage == 2) {
- method146();
- }
- if (loadingStage == 2) {
- if (clientSize == 0) {
- drawMinimap();
- mapArea.drawGraphics(0, super.graphics, 765 - 246);
- }
- }
- if (requestedTabFocusIndex != -1) {
- tabAreaAltered = true;
- }
- if (tabAreaAltered) {
- if (requestedTabFocusIndex != -1 && requestedTabFocusIndex == tabID) {
- requestedTabFocusIndex = -1;
- outgoingPacket.createFrame(120);
- outgoingPacket.writeByte(tabID);
- }
- tabAreaAltered = false;
- aRSImageProducer_1125.create();
- gameArea.create();
- }
- anInt945 = 0;
- }
- private boolean buildFriendsListMenu(RSInterface rsi) {
- int content = rsi.contentType;
- if (content >= 1 && content <= 200 || content >= 701 && content <= 900) {
- if (content >= 801) {
- content -= 701;
- } else if (content >= 701) {
- content -= 601;
- } else if (content >= 101) {
- content -= 101;
- } else {
- content--;
- }
- menuActionName[menuActionRow] = "Remove @whi@" + friendsList[content];
- menuActionID[menuActionRow] = 792;
- menuActionRow++;
- menuActionName[menuActionRow] = "Message @whi@" + friendsList[content];
- menuActionID[menuActionRow] = 639;
- menuActionRow++;
- return true;
- }
- if (content >= 401 && content <= 500) {
- menuActionName[menuActionRow] = "Remove @whi@" + rsi.disabledText;
- menuActionID[menuActionRow] = 322;
- menuActionRow++;
- return true;
- } else {
- return false;
- }
- }
- private void method104() {
- StillGraphics class30_sub2_sub4_sub3 = (StillGraphics) aClass19_1056.head();
- for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (StillGraphics) aClass19_1056.next()) {
- if (class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567) {
- class30_sub2_sub4_sub3.remove();
- } else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
- class30_sub2_sub4_sub3.method454(anInt945);
- if (class30_sub2_sub4_sub3.aBoolean1567) {
- class30_sub2_sub4_sub3.remove();
- } else {
- sceneGraph.method285(class30_sub2_sub4_sub3.anInt1560, 0, class30_sub2_sub4_sub3.anInt1563, -1,
- class30_sub2_sub4_sub3.anInt1562, 60, class30_sub2_sub4_sub3.anInt1561, class30_sub2_sub4_sub3, false, -1);
- }
- }
- }
- }
- public int currentBankTab;
- public boolean searchAfterBankRefresh;
- public void drawInterface(int offsetX, int offsetY, int paddingY, RSInterface rsi) {
- if (rsi == null) {
- return;
- }
- if (rsi.type != 0 || rsi.children == null) {
- return;
- }
- if (rsi.hidden && anInt1026 != rsi.id && anInt1048 != rsi.id && anInt1039 != rsi.id) {
- return;
- }
- int i1 = DrawingArea.startX;
- int j1 = DrawingArea.startY;
- int k1 = DrawingArea.endX;
- int l1 = DrawingArea.endY;
- DrawingArea.setBounds(offsetX, offsetY, offsetX + rsi.width, offsetY + rsi.height);
- int i2 = rsi.children.length;
- for (int j2 = 0; j2 < i2; j2++) {
- int positionX = rsi.childX[j2] + offsetX;
- int positionY = (rsi.childY[j2] + offsetY) - paddingY;
- RSInterface child = RSInterface.interfaceCache[rsi.children[j2]];
- if (child == null)
- continue;
- positionX += child.drawOffsetX;
- positionY += child.drawOffsetY;
- if (child.contentType > 0) {
- drawContentForInterface(child);
- }
- if (child.type == 0) {
- if (child.scrollPosition > child.scrollMax - child.height) {
- child.scrollPosition = child.scrollMax - child.height;
- }
- if (child.scrollPosition < 0) {
- child.scrollPosition = 0;
- }
- drawInterface(positionX, positionY, child.scrollPosition, child);
- if (child.id == 5385) {
- int height = 0;
- if (currentBankTab == 0) {
- height += BankManager.getMainBankHeight();
- if (GameSettings.FULL_BANK_VIEW.toggled()) {
- for (int tabId : BankManager.TAB_CHILD_IDS) {
- height += BankManager.getHeightForTab(tabId);
- }
- } else {
- height -= 30;
- }
- } else {
- height = BankManager.getHeightForTab(BankManager.TAB_CHILD_IDS[currentBankTab]);
- }
- child.scrollMax = height;
- if (height > 185)
- drawScrollbar(child.height, child.scrollPosition, positionY, positionX + child.width, child.scrollMax, false, false);
- } else {
- // clan chat
- if (child.scrollMax > child.height) {
- if (child.id == 18143) {
- int clanMates = 0;
- for (int index = 18155; index < 18244; index++) {
- RSInterface line = RSInterface.interfaceCache[index];
- if (line.disabledText.length() > 0) {
- clanMates++;
- }
- }
- child.scrollMax = (clanMates * 14) + child.height + 1;
- }
- if (child.id == 18322 || child.id == 18423) {
- int members = 0;
- for (int index = child.id + 1; index < child.id + 1 + 100; index++) {
- RSInterface line = RSInterface.interfaceCache[index];
- if (line.disabledText.length() > 0) {
- members++;
- }
- }
- child.scrollMax = (members * 14) + 1;
- }
- if (child.id == 30509) {
- int lines = 0;
- for (int index = child.id + 1; index < child.id + 1 + child.children.length; index++) {
- RSInterface line = RSInterface.interfaceCache[index];
- if (line.disabledText.length() > 0) {
- lines++;
- }
- }
- child.scrollMax = (lines * 14) + 1;
- }
- drawScrollbar(child.height, child.scrollPosition, positionY, positionX + child.width, child.scrollMax, false, false);
- }
- }
- refreshBankTabs();
- } else if (child.type != 1) {
- if (child.type == 2) {
- if (child.hidden)
- continue;
- int index = 0;
- if (openInterfaceID == 5292) {
- if (currentBankTab == 0) {
- if (GameSettings.FULL_BANK_VIEW.toggled()) {
- for (int tabId : BankManager.TAB_CHILD_IDS) {
- if (child.id == tabId) {
- positionY += BankManager.getMainBankHeight();
- } else if (tabId < child.id) {
- positionY += BankManager.getHeightForTab(tabId);
- }
- }
- if (child.parentId == 5292 && child.id != 5382 && child.id != 46500 && child.inventory != null
- && child.inventory[0] > 0) {
- int drawX = positionX - 8;
- int tabId = (child.id - 46500) / 400;
- if (tabId > 0) {
- RSImageLoader.images[533].drawImage(drawX + 6, positionY - 4);
- RSImageLoader.images[991].drawImage(drawX, positionY - 10);
- newSmallFont.drawBasicString("Tab " + tabId, drawX, positionY - 12, 0xFF981F, 1);
- }
- }
- } else {
- if (child.id != BankManager.TAB_CHILD_IDS[currentBankTab]) {
- switch (child.id) {
- case 46500:
- case 46900:
- case 47300:
- case 47700:
- case 48100:
- case 48500:
- case 48900:
- case 49300:
- continue;
- }
- }
- }
- } else {
- if (currentBankTab >= 0 && currentBankTab < BankManager.TAB_CHILD_IDS.length
- && child.id != BankManager.TAB_CHILD_IDS[currentBankTab]) {
- switch (child.id) {
- case 5382:
- case 46500:
- case 46900:
- case 47300:
- case 47700:
- case 48100:
- case 48500:
- case 48900:
- case 49300:
- continue;
- }
- }
- }
- }
- if (child.id >= 51_560 && child.id <= 51_566 && !child.hidden) {
- GrandExchange.drawOfferInterface(this, child, positionX, positionY);
- }
- for (int l3 = 0; l3 < child.height; l3++) {
- for (int l4 = 0; l4 < child.width; l4++) {
- int x = positionX + l4 * (32 + child.invSpritePadX);
- int y = positionY + l3 * (32 + child.invSpritePadY);
- if (index < 20) {
- x += child.spritesX[index];
- y += child.spritesY[index];
- }
- if (child.inventory[index] > 0) {
- if (rsi.id == 51500 && (child.inventoryAmount[index] <= 0 || child.geOfferType == 1 && index == 0)) {
- if (index == 0)
- index++;
- continue;
- }
- int offX = 0;
- int offY = 0;
- int itemId = (int) child.inventory[index] - 1;
- int value = child.shopPrices != null && index < child.shopPrices.length ? child.shopPrices[index] : 0;
- String formatPrice = value > 0 ? formatAmount(value) : "FREE";
- if (x > DrawingArea.startX - 32 && x < DrawingArea.endX && y > DrawingArea.startY - 32
- && y < DrawingArea.endY || activeInterfaceType != 0 && originalDragSlot == index) {
- int outlineColor = 0;
- if (itemSelected >= 1 && itemSelectedSlot[index] && inventoryInterfaceId == child.id) {
- outlineColor = 0xffffff;
- }
- RSImage itemSprite = ItemDef.getImage(itemId, child.inventoryAmount[index], outlineColor);
- if (itemSprite != null) {
- if (child.sprite1 != null) {
- RSImage sprite = child.sprite1;
- if (mouseInRegion(x, x + sprite.maxWidth, y, y + sprite.maxHeight)
- && child.hoverSprite1 != null) {
- sprite = child.hoverSprite1;
- }
- int offset_x = -5;
- int offset_y = -5;
- if (rsi.id == 40300 || rsi.id == 40400) {
- offset_x = -3;
- offset_y = -2;
- }
- sprite.drawImage(x + offset_x, y + offset_y, sprite.alpha > 0 ? sprite.alpha : 256);
- if (child.shopInterface) {
- newSmallFont.drawBasicString(formatPrice, (25 - newSmallFont.getTextWidth(formatPrice)) + x
- + offX + child.width / 2, (y + 43 + offY), getAmountColor(value), 0);
- child.shopCurrency.drawImage(x + offX + 30, y + 33 + offY);
- }
- }
- if (activeInterfaceType != 0 && originalDragSlot == index && hoveredInterfaceChild == child.id) {
- offX = super.getMouseX() - anInt1087;
- offY = super.getMouseY() - anInt1088;
- if (offX < 5 && offX > -5) {
- offX = 0;
- }
- if (offY < 5 && offY > -5) {
- offY = 0;
- }
- if (anInt989 < 10) {
- offX = 0;
- offY = 0;
- }
- itemSprite.drawImage(x + offX, y + offY, 128);
- if (y + offY < DrawingArea.startY && y + offY > DrawingArea.startY - (y + offY) + 10
- && rsi.scrollPosition > 0) {
- int i10 = (anInt945 * (DrawingArea.startY - y - offY)) / 4;
- if (i10 > anInt945 * 10) {
- i10 = anInt945 * 10;
- }
- if (i10 > rsi.scrollPosition) {
- i10 = rsi.scrollPosition;
- }
- rsi.scrollPosition -= i10;
- anInt1088 += i10;
- }
- if (y + offY + 32 > DrawingArea.endY && rsi.scrollPosition < rsi.scrollMax - rsi.height) {
- int j10 = (anInt945 * ((y + offY + 32) - DrawingArea.endY)) / 3;
- if (j10 > anInt945 * 10) {
- j10 = anInt945 * 10;
- }
- if (j10 > rsi.scrollMax - rsi.height - rsi.scrollPosition) {
- j10 = rsi.scrollMax - rsi.height - rsi.scrollPosition;
- }
- rsi.scrollPosition += j10;
- anInt1088 -= j10;
- }
- } else if (atInventoryInterfaceType != 0 && atInventoryIndex == index
- && atInventoryInterface == child.id) {
- itemSprite.drawImage(x, y, 128);
- } else {
- itemSprite.drawImage(x, y);
- }
- if (itemSprite.maxWidth == 33 || child.inventoryAmount[index] != 1) {
- if (!(child.id >= 22035 && child.id <= 22042)) {
- long amount = child.inventoryAmount[index];
- if (amount >= Integer.MAX_VALUE && child.inventory[index] != 996) {
- RSImageLoader.images[997].drawImage(x + offX, y + offY);
- } else {
- newSmallFont.drawBasicString(formatAmount(amount), x + offX, y + 9 + offY,
- getAmountColor(amount), 0);
- }
- }
- }
- }
- }
- } else if (child.images != null && index < 20) {
- RSImage rSImage = child.images[index];
- if (rSImage != null) {
- rSImage.drawImage(x, y);
- }
- }
- if (child.showChangeExclamation != null && child.showChangeExclamation[index]) {
- if (child.showChangeExclamationTimer[index] > 0) {
- long delay = (System.currentTimeMillis() - child.showChangeExclamationDelay[index]);
- int alpha = 256;
- /*
- * if (child.showChangeExclamationTimer[index] == 3) {
- * alpha = 128;
- * } else if (child.showChangeExclamationTimer[index] == 2) {
- * alpha = 64;
- * } else if (child.showChangeExclamationTimer[index] == 1) {
- * alpha = 32;
- * }
- */
- if (delay < 200) {
- x += child.sprite1 != null ? child.sprite1.maxWidth / 2 - 3 : 15;
- y += child.sprite1 != null ? child.sprite1.maxHeight / 2 - 3 : 17;
- RSImageLoader.images[196].drawCenteredARGBImage(x, y, alpha);
- }
- if (delay >= 500) {
- child.showChangeExclamationTimer[index]--;
- child.showChangeExclamationDelay[index] = System.currentTimeMillis();
- }
- } else {
- child.showChangeExclamation[index] = false;
- }
- }
- index++;
- }
- }
- } else if (child.type == 3) {
- boolean flag = false;
- if (anInt1039 == child.id || anInt1048 == child.id || anInt1026 == child.id) {
- flag = true;
- }
- int color;
- if (interfaceIsSelected(child)) {
- color = child.enabledColor;
- if (flag && child.anInt239 != 0) {
- color = child.anInt239;
- }
- } else {
- color = child.disabledColor;
- if (flag && child.anInt216 != 0) {
- color = child.anInt216;
- }
- }
- if (child.alpha == 0) {
- if (child.filled) {
- DrawingArea.drawFilledPixels(positionX, positionY, child.width, child.height, color);
- } else {
- DrawingArea.drawUnfilledPixels(positionX, positionY, child.width, child.height, color);
- }
- } else if (child.filled) {
- DrawingArea.drawFilledPixels(positionX, positionY, child.width, child.height, color, 256 - (child.alpha & 0xff));
- } else {
- DrawingArea.drawUnfilledAlphaPixels(positionX, positionY, child.width, child.height, color,
- 256 - (child.alpha & 0xff));
- }
- } else if (child.type == 4) {
- if (child.hidden)
- continue;
- RSFontSystem font = child.font;
- String text = child.disabledText;
- if (isDeveloper())
- text += ":" + child.id;
- boolean flag1 = false;
- if (anInt1039 == child.id || anInt1048 == child.id || anInt1026 == child.id) {
- flag1 = true;
- }
- if (child.id == 60_009 && text != null && !isDonator() && text.startsWith("Slot: 3")) {
- DrawingArea.drawRoundedRectangle(positionX + 83, positionY + 12, 310, 250, 0x000000, 200, true, false);
- newFancyFont.drawCenteredString("This slot is only available for members", positionX + 235, positionY + 125,
- RSInterface.ORANGE_TEXT, 1);
- }
- int color;
- if (interfaceIsSelected(child)) {
- color = child.enabledColor;
- if (flag1 && child.anInt239 != 0) {
- color = child.anInt239;
- }
- if (child.enabledText.length() > 0) {
- text = child.enabledText;
- }
- } else {
- color = child.disabledColor;
- if (flag1 && child.anInt216 != 0) {
- color = child.anInt216;
- }
- }
- if (myPlayer.gameMode == 4) {
- if (child.id == 663) {
- text = "Click To Spawn (Fee)";
- } else if (child.id == 7332) {
- text = "Main - @gre@Melee Set @whi@[330k]";
- color = 0xFFFFFF;
- } else if (child.id == 7333) {
- text = "Main - @gre@Ranged Set @whi@[170k]";
- color = 0xFFFFFF;
- } else if (child.id == 7334) {
- text = "Main - @gre@Hybrid Set @whi@[620k]";
- color = 0xFFFFFF;
- } else if (child.id == 7336) {
- continue;
- } else if (child.id == 7383) {
- text = "Pure - @gre@Melee Set @whi@[275k]";
- color = 0xFFFFFF;
- } else if (child.id == 7339) {
- text = "Pure - @gre@Ranged Set @whi@[150k]";
- color = 0xFFFFFF;
- } else if (child.id == 7338) {
- text = "Pure - @gre@Hybrid Set @whi@[250k]";
- color = 0xFFFFFF;
- } else if (child.id == 7340) {
- continue;
- } else if (child.id == 7346) {
- text = "Zerker - @gre@Melee Set @whi@[390k]";
- color = 0xFFFFFF;
- } else if (child.id == 7341) {
- text = "Tank - @gre@Ranged Set @whi@[295k]";
- color = 0xFFFFFF;
- } else if (child.id == 7342) {
- continue;
- } else if (child.id == 7337) {
- text = "Food - @gre@Shark x5 @whi@[2k]";
- color = 0xFFFFFF;
- } else if (child.id == 7343) {
- text = "Runes - @gre@Barrage x50 @whi@[13k]";
- color = 0xFFFFFF;
- } else if (child.id == 7335) {
- text = "Runes - @gre@Vengeance x50 @whi@[13k]";
- color = 0xFFFFFF;
- } else if (child.id == 7344) {
- continue;
- } else if (child.id == 7345) {
- text = "Super Set - @gre@Melee @whi@[12k]";
- color = 0xFFFFFF;
- } else if (child.id == 7347) {
- text = "Super Set - @gre@Ranged @whi@[12k]";
- color = 0xFFFFFF;
- } else if (child.id == 7348) {
- text = "Super Set - @gre@Magic @whi@[15k]";
- color = 0xFFFFFF;
- }
- }
- if (child.actionType == 6 && aBoolean1149) {
- text = "Please wait...";
- color = child.disabledColor;
- }
- if (DrawingArea.width == 519) {
- if (color == 0xffff00) {
- color = 255;
- }
- if (color == 49152) {
- color = 0xffffff;
- }
- }
- if (text != null) {
- for (int l6 = positionY + font.baseCharacterHeight; text.length() > 0; l6 += font.baseCharacterHeight) {
- if (text.indexOf("%") != -1) {
- do {
- int k7 = text.indexOf("%1");
- if (k7 == -1) {
- break;
- }
- text = text.substring(0, k7) + interfaceIntToString(extractInterfaceValues(child, 0))
- + text.substring(k7 + 2);
- } while (true);
- do {
- int l7 = text.indexOf("%2");
- if (l7 == -1) {
- break;
- }
- text = text.substring(0, l7) + interfaceIntToString(extractInterfaceValues(child, 1))
- + text.substring(l7 + 2);
- } while (true);
- do {
- int i8 = text.indexOf("%3");
- if (i8 == -1) {
- break;
- }
- text = text.substring(0, i8) + interfaceIntToString(extractInterfaceValues(child, 2))
- + text.substring(i8 + 2);
- } while (true);
- do {
- int j8 = text.indexOf("%4");
- if (j8 == -1) {
- break;
- }
- text = text.substring(0, j8) + interfaceIntToString(extractInterfaceValues(child, 3))
- + text.substring(j8 + 2);
- } while (true);
- do {
- int k8 = text.indexOf("%5");
- if (k8 == -1) {
- break;
- }
- text = text.substring(0, k8) + interfaceIntToString(extractInterfaceValues(child, 4))
- + text.substring(k8 + 2);
- } while (true);
- }
- int line = text.indexOf("\\n");
- String displayedText;
- if (line != -1) {
- displayedText = text.substring(0, line);
- text = text.substring(line + 2);
- } else {
- displayedText = text;
- text = "";
- }
- if (child.centerText) {
- font.drawCenteredString(displayedText/* + " - " + child.id */, positionX + child.width / 2, l6, color,
- child.shadeText ? 0 : -1);
- } else {
- font.drawBasicString(displayedText/* + " - " + child.id */, positionX, l6, color, child.shadeText ? 0 : -1);
- }
- }
- }
- } else if (child.type == 5 || child.type == 10) { // 10 = hd sprite
- if (child.id >= 51003 && child.id <= 51014) {
- GrandExchange.drawMainInterface(this, child, positionX, positionY);
- } else if (child.id == 51829) {
- GrandExchange.drawPurchaseSearchInterface(this, child, positionX, positionY);
- } else if (child.id == 51879) {
- GrandExchange.drawSellSearchInterface(this, child, positionX, positionY);
- }
- if (child.hidden)
- continue;
- RSImage image;
- RSImage hover;
- if (child.itemSpriteId1 != -1 && child.sprite1 == null) {
- child.sprite1 = ItemDef.getFeedImage(child.itemSpriteId1, 1, 0, child.itemSpriteZoom1);
- child.sprite2 = ItemDef.getFeedImage(child.itemSpriteId2, 1, 0, child.itemSpriteZoom2);
- // rsChildren.sprite2 = ItemDef.getSprite(rsChildren.itemSpriteId2, rsChildren.invStackSizes[spriteIndex], selectedColour);
- if (child.greyScale)
- child.sprite1.greyScale();
- }
- boolean configActive = interfaceIsSelected(child);
- if (configActive) {
- image = child.sprite2;
- hover = child.hoverSprite2;
- } else {
- image = child.sprite1;
- hover = child.hoverSprite1;
- }
- /*
- * if (image.horizontalMirror) {
- * image.mirrorHorizontal();
- * }
- * if (image.verticalMirror) {
- * image.mirrorVertical();
- * }
- */
- if (spellSelected == 1 && child.id == spellID && spellID != 0 && image != null) {
- image.drawOutlinedSprite_2(positionX, positionY, 0xffffff);
- } else {
- if (image != null) {
- if (child.type == 5) {
- if (child.drawsTransparent)
- image.drawImageWithOpacity(positionX, positionY, child.opacity);
- else {
- if (rsi.outlineColor == -1)
- image.drawImage(positionX, positionY);
- else
- image.drawOutlinedSprite_2(positionX, positionY, rsi.outlineColor);
- }
- } else {
- image.drawAdvancedSprite(positionX, positionY);
- }
- }
- if (autocasting && child.id == autocastId) {
- if (child.type == 5) {
- /*
- * if (child.drawsTransparent)
- * RSImageLoader.images[667].drawImageWithOpacity(positionX - 3, positionY - 1, child.opacity);
- * else
- * RSImageLoader.images[667].drawImage(positionX - 16 + (child.width / 2),
- * positionY - 16 + (child.height / 2));
- */
- DrawingArea.drawRoundedRectangle(positionX - (child.sprite1.myWidth / 6), positionY
- - (child.sprite1.myHeight / 4), child.sprite1.myWidth + 7, child.sprite1.myHeight + 10, 0xFFFFFF,
- 200, false, true);
- } else {
- RSImageLoader.images[667].drawAdvancedSprite(positionX - 3, positionY - 1);
- }
- }
- }
- if (hover != null) {
- if (hoverId == child.id) {
- if (child.hoverSpeed != 0) {
- child.buttonAlpha += child.buttonAlpha < 250 ? child.hoverSpeed : 0;
- child.buttonAlpha -= child.buttonAlpha > 250 ? 1 : 0;
- if (child.buttonAlpha < 250) {
- if (child.type == 5) {
- hover.drawImage(positionX, positionY, child.buttonAlpha);
- } else {
- hover.drawAdvancedSprite(positionX, positionY);
- }
- } else {
- if (child.type == 5) {
- hover.drawImage(positionX, positionY);
- } else {
- hover.drawAdvancedSprite(positionX, positionY);
- }
- }
- } else {
- if (child.type == 5) {
- hover.drawImage(positionX, positionY);
- } else {
- hover.drawAdvancedSprite(positionX, positionY);
- }
- }
- } else {
- if (child.hoverSpeed != 0) {
- child.buttonAlpha -= child.buttonAlpha > 0 ? child.hoverSpeed : 0;
- if (child.type == 5) {
- hover.drawImage(positionX, positionY, child.buttonAlpha);
- } else {
- hover.drawAdvancedSprite(positionX, positionY);
- }
- }
- }
- }
- } else if (child.type == 6) {
- int k3 = Rasterizer.centerX;
- int j4 = Rasterizer.centerY;
- Rasterizer.centerX = positionX + child.width / 2;
- Rasterizer.centerY = positionY + child.height / 2;
- if (child.modelZoom == 2000 && child.mediaType == 3 && myPlayer.equipment[0] <= 0)
- child.modelZoom = 800;
- int sine = Rasterizer.SINE[child.modelRotationY] * child.modelZoom >> 16;
- int cosine = Rasterizer.COSINE[child.modelRotationY] * child.modelZoom >> 16;
- boolean config_selected = interfaceIsSelected(child);
- int config_state;
- if (config_selected) {
- config_state = child.enabledMediaAnimation;
- } else {
- config_state = child.disabledMediaAnimation;
- }
- Model model;
- if (config_state == -1) {
- model = child.getMediaModel(-1, -1, config_selected);
- } else {
- Animation animation = Animation.getAnim(config_state);
- model = child.getMediaModel(animation.secondaryFrames[child.anInt246], animation.frames[child.anInt246],
- config_selected);
- }
- if (model != null) {
- model.drawModel(child.modelRotationX, 2, child.modelRotationY, 3, sine, cosine);
- }
- Rasterizer.centerX = k3;
- Rasterizer.centerY = j4;
- if (isDeveloper())
- newFancyFont.drawBasicString("" + child.id, positionX, positionY + (child.height / 2));
- } else if (child.type == 7) {
- RSFontSystem font = child.font;
- int k4 = 0;
- for (int j5 = 0; j5 < child.height; j5++) {
- for (int i6 = 0; i6 < child.width; i6++) {
- if (child.inventory[k4] > 0) {
- ItemDef itemDef = ItemDef.getDef((int) child.inventory[k4] - 1);
- String s2 = itemDef.name;
- if (itemDef.stackable || child.inventoryAmount[k4] != 1) {
- s2 = s2 + " currentX" + intToKOrMilLongName(child.inventoryAmount[k4]);
- }
- int i9 = positionX + i6 * (115 + child.invSpritePadX);
- int k9 = positionY + j5 * (12 + child.invSpritePadY);
- if (child.centerText) {
- font.drawCenteredString(s2, i9 + child.width / 2, k9, child.disabledColor, child.shadeText ? 0 : -1);
- } else {
- font.drawBasicString(s2, i9, k9, child.disabledColor, child.shadeText ? 0 : -1);
- }
- }
- k4++;
- }
- }
- } else if (child.type == 8 && (anInt1500 == child.id || anInt1044 == child.id || anInt1129 == child.id) && anInt1501 == 50
- && !menuOpen && GameSettings.TOOLTIPS.toggled() && child.disabledText != null && child.disabledText.length() > 0) {
- if (child.hidden)
- continue;
- int boxWidth = 0;
- int boxHeight = 0;
- RSFont font = normalFont;
- for (String s1 = child.disabledText; s1.length() > 0;) {
- if (s1.indexOf("%") != -1) {
- do {
- int k7 = s1.indexOf("%1");
- if (k7 == -1) {
- break;
- }
- s1 = s1.substring(0, k7) + interfaceIntToString(extractInterfaceValues(child, 0)) + s1.substring(k7 + 2);
- } while (true);
- do {
- int l7 = s1.indexOf("%2");
- if (l7 == -1) {
- break;
- }
- s1 = s1.substring(0, l7) + interfaceIntToString(extractInterfaceValues(child, 1)) + s1.substring(l7 + 2);
- } while (true);
- do {
- int i8 = s1.indexOf("%3");
- if (i8 == -1) {
- break;
- }
- s1 = s1.substring(0, i8) + interfaceIntToString(extractInterfaceValues(child, 2)) + s1.substring(i8 + 2);
- } while (true);
- do {
- int j8 = s1.indexOf("%4");
- if (j8 == -1) {
- break;
- }
- s1 = s1.substring(0, j8) + interfaceIntToString(extractInterfaceValues(child, 3)) + s1.substring(j8 + 2);
- } while (true);
- do {
- int k8 = s1.indexOf("%5");
- if (k8 == -1) {
- break;
- }
- s1 = s1.substring(0, k8) + interfaceIntToString(extractInterfaceValues(child, 4)) + s1.substring(k8 + 2);
- } while (true);
- }
- int l7 = s1.indexOf("\\n");
- String s4;
- if (l7 != -1) {
- s4 = s1.substring(0, l7);
- s1 = s1.substring(l7 + 2);
- } else {
- s4 = s1;
- s1 = "";
- }
- int j10 = font.getTextWidth(s4);
- if (j10 > boxWidth) {
- boxWidth = j10;
- }
- boxHeight += font.anInt1497 + 1;
- }
- boxWidth += 6;
- boxHeight += 7;
- int xPos = (positionX + child.width) - 5 - boxWidth;
- int yPos = positionY + child.height + 5;
- if (xPos < positionX + 5) {
- xPos = positionX + 5;
- }
- if (xPos + boxWidth > offsetX + rsi.width) {
- xPos = (offsetX + rsi.width) - boxWidth;
- }
- if (yPos + boxHeight > offsetY + rsi.height) {
- yPos = (positionY - boxHeight);
- }
- DrawingArea.drawFilledPixels(xPos, yPos, boxWidth, boxHeight, 0xFFFFA0);
- DrawingArea.drawUnfilledPixels(xPos, yPos, boxWidth, boxHeight, 0);
- String s2 = child.disabledText;
- for (int j11 = yPos + font.anInt1497 + 2; s2.length() > 0; j11 += font.anInt1497 + 1) {// anInt1497
- if (s2.indexOf("%") != -1) {
- do {
- int k7 = s2.indexOf("%1");
- if (k7 == -1) {
- break;
- }
- s2 = s2.substring(0, k7) + interfaceIntToString(extractInterfaceValues(child, 0)) + s2.substring(k7 + 2);
- } while (true);
- do {
- int l7 = s2.indexOf("%2");
- if (l7 == -1) {
- break;
- }
- s2 = s2.substring(0, l7) + interfaceIntToString(extractInterfaceValues(child, 1)) + s2.substring(l7 + 2);
- } while (true);
- do {
- int i8 = s2.indexOf("%3");
- if (i8 == -1) {
- break;
- }
- s2 = s2.substring(0, i8) + interfaceIntToString(extractInterfaceValues(child, 2)) + s2.substring(i8 + 2);
- } while (true);
- do {
- int j8 = s2.indexOf("%4");
- if (j8 == -1) {
- break;
- }
- s2 = s2.substring(0, j8) + interfaceIntToString(extractInterfaceValues(child, 3)) + s2.substring(j8 + 2);
- } while (true);
- do {
- int k8 = s2.indexOf("%5");
- if (k8 == -1) {
- break;
- }
- s2 = s2.substring(0, k8) + interfaceIntToString(extractInterfaceValues(child, 4)) + s2.substring(k8 + 2);
- } while (true);
- }
- int l11 = s2.indexOf("\\n");
- String s5;
- if (l11 != -1) {
- s5 = s2.substring(0, l11);
- s2 = s2.substring(l11 + 2);
- } else {
- s5 = s2;
- s2 = "";
- }
- if (child.centerText) {
- font.method382(yPos, xPos + child.width / 2, s5, j11, false);
- } else {
- if (s5.contains("\\r")) {
- String text = s5.substring(0, s5.indexOf("\\r"));
- String text2 = s5.substring(s5.indexOf("\\r") + 2);
- font.method389(false, xPos + 3, 0, text, j11);
- int rightX = boxWidth + xPos - font.getTextWidth(text2) - 2;
- font.method389(false, rightX, 0, text2, j11);
- } else {
- font.method389(false, xPos + 3, 0, s5, j11);
- }
- }
- }
- } else if (child.type == 9) {
- int offX = clientSize == 0 ? 4 : 0;
- int offY = clientSize == 0 ? 4 : 0;
- if (child.region == 1) {
- offX = clientSize == 0 ? 519 : 0;
- offY = clientSize == 0 ? 168 : 0;
- }
- int x = offX + positionX;
- int y = offY + positionY;
- if (child.slider != null) {
- child.slider.setX(positionX);
- child.slider.setY(positionY);
- child.slider.drawSlider(x, y);
- }
- } else if (child.type == 11 && super.clickMode2 == 0 && !menuOpen && GameSettings.TOOLTIPS.toggled()
- && child.popupString != null && child.popupString.length() > 0
- && (selectedDropDownMenu == null || selectedDropDownMenu.hoverId == rsi.id)) {
- if (child.parentId > 0 && RSInterface.interfaceCache[child.parentId] != null
- && RSInterface.interfaceCache[child.parentId].hidden)
- continue;
- int boxWidth = 0;
- int boxHeight = 0;
- RSFont font = normalFont;
- for (String s1 = child.popupString; s1.length() > 0;) {
- if (s1.indexOf("%") != -1) {
- do {
- int k7 = s1.indexOf("%1");
- if (k7 == -1) {
- break;
- }
- s1 = s1.substring(0, k7) + interfaceIntToString(extractInterfaceValues(child, 0)) + s1.substring(k7 + 2);
- } while (true);
- do {
- int l7 = s1.indexOf("%2");
- if (l7 == -1) {
- break;
- }
- s1 = s1.substring(0, l7) + interfaceIntToString(extractInterfaceValues(child, 1)) + s1.substring(l7 + 2);
- } while (true);
- do {
- int i8 = s1.indexOf("%3");
- if (i8 == -1) {
- break;
- }
- s1 = s1.substring(0, i8) + interfaceIntToString(extractInterfaceValues(child, 2)) + s1.substring(i8 + 2);
- } while (true);
- do {
- int j8 = s1.indexOf("%4");
- if (j8 == -1) {
- break;
- }
- s1 = s1.substring(0, j8) + interfaceIntToString(extractInterfaceValues(child, 3)) + s1.substring(j8 + 2);
- } while (true);
- do {
- int k8 = s1.indexOf("%5");
- if (k8 == -1) {
- break;
- }
- s1 = s1.substring(0, k8) + interfaceIntToString(extractInterfaceValues(child, 4)) + s1.substring(k8 + 2);
- } while (true);
- }
- int l7 = s1.indexOf("\\n");
- String s4;
- if (l7 != -1) {
- s4 = s1.substring(0, l7);
- s1 = s1.substring(l7 + 2);
- } else {
- s4 = s1;
- s1 = "";
- }
- int j10 = font.getTextWidth(s4);
- if (j10 > boxWidth) {
- boxWidth = j10;
- }
- boxHeight += font.anInt1497 + 1;
- }
- boxWidth += 6;
- boxHeight += 7;
- int xPos = (positionX + child.width) - 5 - boxWidth;
- int yPos = positionY + child.height + 5;
- if (xPos < positionX + 5) {
- xPos = positionX + 5;
- }
- if (xPos + boxWidth > offsetX + rsi.width) {
- xPos = (offsetX + rsi.width) - boxWidth;
- }
- if (yPos + boxHeight > offsetY + rsi.height) {
- yPos = (positionY - boxHeight);
- }
- DrawingArea.drawFilledPixels(positionX, positionY, boxWidth, boxHeight, 0xFFFFA0);
- DrawingArea.drawUnfilledPixels(positionX, positionY, boxWidth, boxHeight, 0);
- String s2 = child.popupString;
- for (int j11 = positionY + font.anInt1497 + 2; s2.length() > 0; j11 += font.anInt1497 + 1) {// anInt1497
- if (s2.indexOf("%") != -1) {
- do {
- int k7 = s2.indexOf("%1");
- if (k7 == -1) {
- break;
- }
- s2 = s2.substring(0, k7) + interfaceIntToString(extractInterfaceValues(child, 0)) + s2.substring(k7 + 2);
- } while (true);
- do {
- int l7 = s2.indexOf("%2");
- if (l7 == -1) {
- break;
- }
- s2 = s2.substring(0, l7) + interfaceIntToString(extractInterfaceValues(child, 1)) + s2.substring(l7 + 2);
- } while (true);
- do {
- int i8 = s2.indexOf("%3");
- if (i8 == -1) {
- break;
- }
- s2 = s2.substring(0, i8) + interfaceIntToString(extractInterfaceValues(child, 2)) + s2.substring(i8 + 2);
- } while (true);
- do {
- int j8 = s2.indexOf("%4");
- if (j8 == -1) {
- break;
- }
- s2 = s2.substring(0, j8) + interfaceIntToString(extractInterfaceValues(child, 3)) + s2.substring(j8 + 2);
- } while (true);
- do {
- int k8 = s2.indexOf("%5");
- if (k8 == -1) {
- break;
- }
- s2 = s2.substring(0, k8) + interfaceIntToString(extractInterfaceValues(child, 4)) + s2.substring(k8 + 2);
- } while (true);
- }
- int l11 = s2.indexOf("\\n");
- String s5;
- if (l11 != -1) {
- s5 = s2.substring(0, l11);
- s2 = s2.substring(l11 + 2);
- } else {
- s5 = s2;
- s2 = "";
- }
- if (child.centerText) {
- font.method382(positionX + child.width / 2, positionY, s5, j11, false);
- } else {
- if (s5.contains("\\r")) {
- String text = s5.substring(0, s5.indexOf("\\r"));
- String text2 = s5.substring(s5.indexOf("\\r") + 2);
- font.method389(false, positionX + 3, 0, text, j11);
- int rightX = boxWidth + positionX - font.getTextWidth(text2) - 2;
- font.method389(false, rightX, 0, text2, j11);
- } else {
- font.method389(false, positionX + 3, 0, s5, j11);
- }
- }
- }
- } else if (child.type == 12) {
- // drawing drop down menus
- int width = child.width;
- int height = child.height;
- if (child.dropDownIndex >= child.actions.length)
- child.dropDownIndex = 0;
- final String currentAction = child.disabledText + ": " + child.actions[child.dropDownIndex];
- final RSFontSystem font = child.font;
- final int fontWidth = font.getTextWidth(currentAction);
- boolean reverseMenu = false;
- if (fontWidth > width)
- width = fontWidth + 10;
- DrawingArea.drawFilledPixels(positionX, positionY, width, height, child.dropDownBoxColor,
- child.opacity > 0 ? child.opacity : 255);
- DrawingArea.drawUnfilledAlphaPixels(positionX - 1, positionY, width + 2, height, 0x000000,
- child.opacity > 0 ? child.opacity : 255);
- font.drawCenteredString(currentAction, positionX + (width / 2) - 1,
- positionY + (height / 4) + font.baseCharacterHeight, child.disabledColor, child.shadeText ? 1 : 0);
- int modifier = 15;
- int actionHeight = child.actions.length * modifier;
- if (isFixed()) {
- if (positionY + actionHeight > clientHeight - chatArea.height - 20) {
- reverseMenu = true;
- }
- } else {
- if (positionY + actionHeight > clientHeight) {
- reverseMenu = true;
- }
- }
- if (System.currentTimeMillis() - lastChosenDropAction >= 750) {
- if (mouseX >= positionX
- && mouseX <= positionX + width + 5
- && mouseY >= positionY
- - (reverseMenu ? (selectedDropDownMenu == child ? actionHeight + child.height : 0) : 0)
- && mouseY <= positionY
- + (reverseMenu ? height : height + (selectedDropDownMenu == child ? actionHeight + 5 : 0))) {
- if (selectedDropDownMenu != null && selectedDropDownMenu != child)
- continue;
- if (selectedDropDownMenu != child)
- dropDownCurrentHeight = 0;
- selectedDropDownMenu = child;
- } else {
- if (selectedDropDownMenu == child) {
- selectedDropDownMenu = null;
- dropDownCurrentHeight = 0;
- }
- }
- }
- if (reverseMenu)
- positionY -= actionHeight + child.height;
- if (dropDownCurrentHeight < actionHeight && selectedDropDownMenu == child) {
- DrawingArea.drawRoundedRectangle(positionX, positionY + height, width, dropDownCurrentHeight,
- child.dropDownBoxColor, 255, !child.drawsTransparent, false);
- if (!child.drawsTransparent) {
- DrawingArea.drawRoundedRectangle(positionX, positionY + height, width, dropDownCurrentHeight, 0x000000, 255,
- false, false);
- }
- dropDownCurrentHeight += child.actions.length;
- continue;
- }
- if (child == selectedDropDownMenu) {
- DrawingArea.drawRoundedRectangle(positionX, positionY + height, width, actionHeight, child.dropDownBoxColor, 255,
- !child.drawsTransparent, false);
- if (!child.drawsTransparent) {
- DrawingArea.drawRoundedRectangle(positionX, positionY + height, width, actionHeight, 0x000000, 255, false,
- false);
- }
- int drawY = positionY;
- for (int i = 0; i < child.actions.length; i++) {
- int color = child.dropDownIndex == i ? 0x232B1F : child.disabledColor;
- font.drawCenteredString(child.actions[i], positionX + (width / 2) - 1, drawY + (height * 2) + (modifier * i)
- - 5, color, child.shadeText ? 1 : 0);
- if (mouseX >= positionX && mouseX <= positionX + width && mouseY >= drawY + (height * 2) - 10 + (modifier * i)
- && mouseY <= drawY + (height * 2) + (modifier * i)) {
- hoverDropDownAction = i;
- }
- // if (i != hoverDropDownAction && i != child.actions.length - 1)
- // DrawingArea.drawHorizontalLine(positionX, drawY + (height * 2) + (modifier * i) - 4,
- // width, 0x000000);
- }
- if (hoverDropDownAction < child.actions.length && hoverDropDownAction >= 0
- && hoverDropDownAction != child.dropDownIndex) {
- DrawingArea.drawRoundedRectangle(positionX, drawY + (hoverDropDownAction * modifier) + modifier + 4, width,
- modifier + (actionHeight / modifier) - 5, child.disabledColor, child.opacity > 0 ? child.opacity : 255,
- false, true);
- }
- }
- } else if (child.type == 13) {
- // drawing pixels
- if (child.contentType == 0)
- DrawingArea.drawRoundedRectangle(positionX, positionY, child.width, child.height, child.disabledColor,
- child.drawsTransparent ? child.opacity : 255, child.filled, child.shadeText);
- } else if (child.type == 14) {
- // drawing slideable pixels
- boolean activated = interfaceIsSelected(child);
- if (RSInterface.interfaceCache[child.parentId].selectedChild > 0
- && child.id > RSInterface.interfaceCache[child.parentId].selectedChild)
- positionY += RSInterface.interfaceCache[child.parentId].selectedChildHeight;
- if (child.contentType == 0) {
- String message = child.disabledText;
- String[] disabledText = TextUtils.split(child.font, message, child.width - 4);
- int height = child.height + (child.height * (disabledText.length - 1));
- DrawingArea.drawRoundedRectangle(positionX, positionY, child.width, height, child.disabledColor, child.opacity,
- child.filled, hoverId != child.id);
- if (!child.centerText) {
- int y = positionY;
- for (String text : disabledText) {
- child.font.drawBasicString(text, positionX + 5, y + (child.height / 2)
- + (child.font.baseCharacterHeight / 2), 0xFFFFFF, child.shadeText ? 0 : -1, true);
- y += child.font.baseCharacterHeight + 2;
- }
- } else {
- int y = positionY;
- for (String text : disabledText) {
- child.font.drawCenteredString(text, positionX + (child.width / 2), y + (child.height / 2)
- + (child.font.baseCharacterHeight / 2), 0xFFFFFF, child.shadeText ? 0 : -1, true);
- y += child.font.baseCharacterHeight + 2;
- }
- }
- if (activated) {
- RSInterface.interfaceCache[child.parentId].selectedChild = child.id;
- positionY += height;
- message = child.enabledText;
- disabledText = TextUtils.split(child.font, message, child.width - 4);
- height = child.currentHeight;
- DrawingArea.drawRoundedRectangle(positionX + 1, positionY, child.width, height, child.enabledColor,
- child.opacity, child.filled, false);
- RSInterface.interfaceCache[child.parentId].selectedChildHeight = height;
- if (child.currentHeight >= (child.font.baseCharacterHeight + 1) * (disabledText.length + 1)) {
- if (!child.centerText) {
- int y = positionY;
- for (String text : disabledText) {
- child.font.drawBasicString(text, positionX + 5, y + (child.height / 2)
- + (child.font.baseCharacterHeight / 2), 0xFFFFFF, child.shadeText ? 0 : -1, true);
- y += child.font.baseCharacterHeight + 2;
- }
- } else {
- int y = positionY;
- for (String text : disabledText) {
- child.font.drawCenteredString(text, positionX + (child.width / 2), y + (child.height / 2)
- + (child.font.baseCharacterHeight / 2), 0xFFFFFF, child.shadeText ? 0 : -1, true);
- y += child.font.baseCharacterHeight + 2;
- }
- }
- } else {
- child.currentHeight++;
- }
- }
- }
- } else if (child.type == 15) {
- drawAltInputField(child, positionX, positionY, child.width, child.height);
- } else if (child.type == 16) {
- drawInputField(child, positionX, positionY, child.width, child.height);
- }
- }
- }
- DrawingArea.setBounds(i1, j1, k1, l1);
- }
- private void refreshBankTabs() {
- if (openInterfaceID != 5292)
- return;
- String last_tab_string = RSInterface.interfaceCache[27000].disabledText;
- if (last_tab_string != null) {
- final int last_tab = Integer.valueOf(last_tab_string);
- int current_tab = currentBankTab;
- for (int tab_index = 22025; tab_index <= 22033; tab_index++) {
- final RSInterface top_tab = RSInterface.interfaceCache[tab_index];
- if (top_tab == null)
- continue;
- final RSInterface tab = RSInterface.interfaceCache[tab_index + 10];
- if (last_tab == 22042 && tab_index == 22032) {
- // top_tab.sprite1 = new RSImage("bank/TAB 4");
- top_tab.sprite1 = RSImageLoader.images[922 + 4];
- top_tab.tooltip = "Collapse All Tabs";
- } else if (tab.id == last_tab) {
- // top_tab.sprite1 = new RSImage("bank/TAB 4");
- top_tab.sprite1 = RSImageLoader.images[922 + 4];
- top_tab.tooltip = "Drag an item here to create a new tab";
- } else if (tab.id < last_tab) {
- // top_tab.sprite1 = new RSImage("bank/TAB 3");
- top_tab.sprite1 = RSImageLoader.images[922 + 3];
- top_tab.tooltip = null;
- tab.actions[0] = "View Content of Tab " + (tab.id - 22034);
- tab.actions[1] = "Collapse Tab " + (tab.id - 22034);
- tab.actions[2] = "Calculate Networth Tab " + (tab.id - 22034);
- } else {
- top_tab.sprite1 = null;
- // top_tab.sprite1 = new RSImage("");
- top_tab.tooltip = "";
- }
- if (current_tab == 0) {
- // RSInterface.interfaceCache[22024].sprite1 = new RSImage("bank/TAB 0");
- RSInterface.interfaceCache[22024].sprite1 = RSImageLoader.images[922 + 0];
- } else {
- // RSInterface.interfaceCache[22024 + current_tab].sprite1 = new RSImage("bank/TAB 2");
- // RSInterface.interfaceCache[22024].sprite1 = new RSImage("bank/TAB 1");
- RSInterface.interfaceCache[22024 + current_tab].sprite1 = RSImageLoader.images[922 + 2];
- RSInterface.interfaceCache[22024].sprite1 = RSImageLoader.images[922 + 1];
- }
- }
- }
- }
- public void drawHoverBox(int xPos, int yPos, String text) {
- String[] results = text.split("\n");
- int height = (results.length * 16) + 6;
- int width;
- width = normalFont.getTextWidth(results[0]) + 6;
- for (int i = 1; i < results.length; i++)
- if (width <= normalFont.getTextWidth(results[i]) + 6)
- width = normalFont.getTextWidth(results[i]) + 6;
- DrawingArea.drawFilledPixels(xPos, yPos, width, height, 0xFFFFA0);
- DrawingArea.drawUnfilledPixels(xPos, yPos, width, height, 0);
- yPos += 14;
- for (int i = 0; i < results.length; i++) {
- normalFont.method389(false, xPos + 3, 0, results[i], yPos);
- yPos += 16;
- }
- }
- private void handlePlayerMasks(int mask, int pid, JagexBuffer in, Player player) {
- if ((mask & 0x400) != 0) {
- player.firstForcedX = in.readUnsignedByteS();
- player.firstForcedY = in.readUnsignedByteS();
- player.secondForcedX = in.readUnsignedByteS();
- player.secondForcedY = in.readUnsignedByteS();
- player.speed = in.readUnsignedShortA() + loopCycle;
- player.reverseSpeed = in.readUnsignedLEShortA() + loopCycle;
- player.direction = in.readUnsignedByteS();
- player.method446();
- }
- if ((mask & 0x100) != 0) {
- int graphic = in.readUnsignedLEShort();
- int data = in.readInt();
- player.graphicsAnimId = graphic;
- player.graphicsHeight = data >> 16;
- player.graphicsDelay = loopCycle + (data & 0xffff);
- player.graphicsAnimFrame = 0;
- player.graphicsAnimCycle = 0;
- if (player.graphicsDelay > loopCycle) {
- player.graphicsAnimFrame = -1;
- }
- if (player.graphicsAnimId == 65535) {
- player.graphicsAnimId = -1;
- }
- }
- if ((mask & 8) != 0) { // send anim
- int anim = in.readUnsignedLEShort();
- if (anim == 65535) {
- anim = -1;
- }
- int delay = in.readUnsignedByteC();
- // if ((player.forcedAnimation != -1 && (anim < 13192 && anim > 13194)) || (player.forcedAnimation >= 13192 && player.forcedAnimation <= 13194)) {
- // } else {
- /*
- * if (anim == player.forcedAnimation && anim != -1) {
- * int i3 = Animation.anims[anim].anInt365;
- * if (i3 == 1) {
- * player.anInt1527 = 0;
- * player.anInt1528 = 0;
- * player.anInt1529 = delay;
- * player.anInt1530 = 0;
- * }
- * if (i3 == 2)
- * player.anInt1530 = 0;
- * } else
- */
- if (anim == -1 || player.forcedAnimId == -1
- || Animation.getAnim(anim).priority >= Animation.getAnim(player.forcedAnimId).priority) {
- player.forcedAnimId = anim;
- player.forcedAnimFrame = 0;
- player.forcedAnimCycle = 0;
- player.animationDelay = delay;
- player.animation_reset_cycle = 0;
- player.anInt1542 = player.pathLength;
- }
- // }
- }
- if ((mask & 4) != 0) {
- player.textSpoken = in.readString();
- String loyalty_title = "";// PlayerTitle.getLoyaltyTitle(player.title) + (player.title >= 0 ? " " : "");
- if (player.textSpoken.charAt(0) == '~') {
- player.textSpoken = player.textSpoken.substring(1);
- pushMessage(player.name, player.textSpoken, 2, loyalty_title, player.showGameModeTitle ? player.gameMode : -1);
- } else if (player == myPlayer) {
- pushMessage(player.name, player.textSpoken, 2, loyalty_title, player.showGameModeTitle ? player.gameMode : -1);
- }
- player.textCycle = 150;
- }
- if ((mask & 0x80) != 0) {
- int i1 = in.readUnsignedLEShort();
- int rights = in.readUnsignedByte();
- int textLength = in.readUnsignedByteC();
- int k3 = in.offset;
- if (player.name != null && player.visible) {
- long l3 = TextUtils.longForName(player.name);
- boolean flag = false;
- if (rights <= 1) {
- for (int i4 = 0; i4 < ignoreCount; i4++) {
- if (ignoreListAsLongs[i4] != l3) {
- continue;
- }
- flag = true;
- break;
- }
- }
- if (!flag && anInt1251 == 0) {
- try {
- aStream_834.offset = 0;
- in.readBytesC(textLength, 0, aStream_834.payload);
- aStream_834.offset = 0;
- String message = TextInput.method525(textLength, aStream_834);
- player.textSpoken = message;
- player.textColor = i1 >> 8;
- player.rights = rights;
- player.textEffect = i1 & 0xff;
- player.textCycle = 150;
- String title = "";// PlayerTitle.getLoyaltyTitle(player.title) + (player.title >= 0 ? " " : "");
- pushMessage(getPrefix(rights) + player.name, message, 2, title, player.showGameModeTitle ? player.gameMode : -1);
- } catch (Exception exception) {
- Signlink.reportError("chat decoding 2");
- }
- }
- }
- in.offset = k3 + textLength;
- }
- if ((mask & 1) != 0) {
- player.interactingEntity = in.readUnsignedLEShort();
- if (player.interactingEntity == 65535) {
- player.interactingEntity = -1;
- }
- }
- if ((mask & 0x10) != 0) {
- int j1 = in.readUnsignedByteC();
- byte abyte0[] = new byte[j1];
- JagexBuffer stream_1 = new JagexBuffer(abyte0);
- in.readBytes(j1, 0, abyte0);
- aStreamArray895s[pid] = stream_1;
- player.updatePlayer(stream_1);
- }
- if ((mask & 2) != 0) {
- player.faceX = in.readUnsignedShortA();
- player.faceY = in.readUnsignedLEShort();
- }
- if ((mask & 0x20) != 0) {
- int damage = in.readLEShort();
- int absorbed = in.readLEShort();
- int combatStyle = in.readSignedByte();
- int hitMark = in.readByteS();
- player.updateHitData(Content.getVersion(Content.HITSPLAT) > 562 ? combatStyle : -1, hitMark, damage, absorbed, loopCycle);
- player.loopCycleStatus = loopCycle + 300;
- player.currentHealth = in.readUnsignedShort();
- player.maxHealth = in.readUnsignedShort();
- }
- if ((mask & 0x200) != 0) {
- int damage = in.readLEShort();
- int absorbed = in.readLEShortA();
- int combatStyle = in.readSignedByte();
- int hitMark = in.readByteS();
- player.updateHitData(Content.getVersion(Content.HITSPLAT) > 562 ? combatStyle : -1, hitMark, damage, absorbed, loopCycle);
- player.loopCycleStatus = loopCycle + 300;
- player.currentHealth = in.readUnsignedShort();
- player.maxHealth = in.readUnsignedShort();
- }
- }
- private void method108() {
- try {
- int j = myPlayer.currentX + cameraOffsetX;
- int k = myPlayer.currentY + cameraOffsetY;
- if (anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500) {
- anInt1014 = j;
- anInt1015 = k;
- }
- if (anInt1014 != j) {
- anInt1014 += (j - anInt1014) / 16;
- }
- if (anInt1015 != k) {
- anInt1015 += (k - anInt1015) / 16;
- }
- int divider = isFixed() ? 2 : 1;
- if (super.keyArray[1] == 1) {
- // camera left movement
- cameraXYRotation += (-20 - cameraXYRotation) / divider;
- cameraRotationFrames++;
- } else if (super.keyArray[2] == 1) {
- // camera right movement
- cameraXYRotation += (20 - cameraXYRotation) / divider;
- cameraRotationFrames++;
- } else {
- if (cameraRotationFrames >= 15 && currentAccount != null && GameSettings.CAMERA_GLIDE.toggled()) {
- if (cameraXYRotation > 0)
- cameraXYRotation--;
- else if (cameraXYRotation < 0)
- cameraXYRotation++;
- } else {
- cameraXYRotation /= 2;
- }
- }
- if (super.keyArray[3] == 1) {
- // camera up movement
- cameraZRotation += (12 - cameraZRotation) / divider;
- cameraRotationFrames++;
- } else if (super.keyArray[4] == 1) {
- // camera down movement
- cameraZRotation += (-12 - cameraZRotation) / divider;
- cameraRotationFrames++;
- } else {
- if (cameraRotationFrames >= 15 && currentAccount != null && GameSettings.CAMERA_GLIDE.toggled()) {
- if (cameraZRotation > 0)
- cameraZRotation--;
- else if (cameraZRotation < 0)
- cameraZRotation++;
- } else {
- cameraZRotation /= 2;
- }
- }
- if (cameraZRotation == 0 && cameraXYRotation == 0)
- cameraRotationFrames = 0;
- viewRotation = viewRotation + cameraXYRotation / 2 & 0x7ff;
- anInt1184 += cameraZRotation / 2;
- if (anInt1184 < 128) {
- anInt1184 = 128;
- }
- if (anInt1184 > 383) {
- anInt1184 = 383;
- }
- int l = anInt1014 >> 7;
- int i1 = anInt1015 >> 7;
- int j1 = method42(plane, anInt1015, anInt1014);
- int k1 = 0;
- if (l > 3 && i1 > 3 && l < 100 && i1 < 100) {
- for (int l1 = l - 4; l1 <= l + 4; l1++) {
- for (int k2 = i1 - 4; k2 <= i1 + 4; k2++) {
- int l2 = plane;
- if (l2 < 3 && (groundTileSettings[1][l1][k2] & 2) == 2) {
- l2++;
- }
- int i3 = j1 - heightMap[l2][l1][k2];
- if (i3 > k1) {
- k1 = i3;
- }
- }
- }
- }
- anInt1005++;
- if (anInt1005 > 1512) {
- anInt1005 = 0;
- outgoingPacket.createFrame(77);
- outgoingPacket.writeByte(0);
- int i2 = outgoingPacket.offset;
- outgoingPacket.writeByte((int) (Math.random() * 256D));
- outgoingPacket.writeByte(101);
- outgoingPacket.writeByte(233);
- outgoingPacket.writeShort(45092);
- if ((int) (Math.random() * 2D) == 0) {
- outgoingPacket.writeShort(35784);
- }
- outgoingPacket.writeByte((int) (Math.random() * 256D));
- outgoingPacket.writeByte(64);
- outgoingPacket.writeByte(38);
- outgoingPacket.writeShort((int) (Math.random() * 65536D));
- outgoingPacket.writeShort((int) (Math.random() * 65536D));
- outgoingPacket.writeSizeByte(outgoingPacket.offset - i2);
- }
- int j2 = k1 * 192;
- if (j2 > 0x17f00) {
- j2 = 0x17f00;
- }
- if (j2 < 32768) {
- j2 = 32768;
- }
- if (j2 > anInt984) {
- anInt984 += (j2 - anInt984) / 24;
- return;
- }
- if (j2 < anInt984) {
- anInt984 += (j2 - anInt984) / 80;
- }
- } catch (Exception _ex) {
- Signlink.reportError("glfc_ex " + myPlayer.currentX + "," + myPlayer.currentY + "," + anInt1014 + "," + anInt1015 + ","
- + localX + "," + localY + "," + baseX + "," + baseY);
- throw new RuntimeException("eek");
- }
- }
- public void processDrawing() {
- if (!super.ready) {
- // showSelectionScreen();
- super.ready = true;
- Content.load();
- startUp();
- return;
- }
- if (rsAlreadyLoaded || loadingError || genericLoadingError) {
- showErrorScreen();
- return;
- }
- anInt1061++;
- if (!loggedIn && loaded && !cacheDownloading) {
- displayTitleScreen(false);
- } else {
- drawGameScreen();
- }
- anInt1213 = 0;
- }
- public boolean isFriendOrSelf(String s) {
- if (s == null) {
- return false;
- }
- for (int i = 0; i < friendsCount; i++) {
- if (s.equalsIgnoreCase(friendsList[i])) {
- return true;
- }
- }
- return s.equalsIgnoreCase(myPlayer.name);
- }
- private static String combatDiffColor(int i, int j) {
- int k = i - j;
- if (k < -9) {
- return "@red@";
- }
- if (k < -6) {
- return "@or3@";
- }
- if (k < -3) {
- return "@or2@";
- }
- if (k < 0) {
- return "@or1@";
- }
- if (k > 9) {
- return "@gre@";
- }
- if (k > 6) {
- return "@gr3@";
- }
- if (k > 3) {
- return "@gr2@";
- }
- if (k > 0) {
- return "@gr1@";
- } else {
- return "@yel@";
- }
- }
- private void setWaveVolume(int i) {
- Signlink.wavevol = i;
- }
- public void DrawStaffPanal() {
- if(isServerSupport()){
- ServerSupport.draw(this);
- }
- }
- private void draw3dScreen() {
- DrawStaffPanal();
- drawSplitPrivateChat();
- if (crossType == 1) {
- crosses[crossIndex / 100].drawImage(crossX - 8 - 4, crossY - 8 - 4);
- anInt1142++;
- if (anInt1142 > 67) {
- anInt1142 = 0;
- outgoingPacket.createFrame(78);
- }
- }
- if (crossType == 2) {
- crosses[4 + crossIndex / 100].drawImage(crossX - 8 - 4, crossY - 8 - 4);
- }
- if (walkableInterface >= 0 && walkableInterface < RSInterface.interfaceCache.length) {
- method119(anInt945, walkableInterface);
- if (walkableInterface == 197 && !isFixed()) {
- cacheSprite[98].drawImage(clientWidth - 260, 2);
- String text = RSInterface.interfaceCache[199].disabledText.replace("@yel@", "");
- newRegularFont.drawCenteredString(text, clientWidth - 243, 46, 0xE1981D, 0);
- } else if (walkableInterface == 1600 && !isFixed()) {
- drawInterface(-(clientWidth / 2) + 50, -(clientHeight / 2) + 50, 0, RSInterface.interfaceCache[walkableInterface]);
- } else if (walkableInterface == 23133 && !isFixed()) {
- drawInterface(clientWidth / 2 - 256, 0, 0, RSInterface.interfaceCache[walkableInterface]);
- } else {
- if (isFixed()) {
- drawInterface(0, 0, 0, RSInterface.interfaceCache[walkableInterface]);
- } else {
- if (clientWidth >= 900 && clientHeight >= 650) {
- drawInterface((clientWidth / 2) - 256, (clientHeight / 2) - 167, 0, RSInterface.interfaceCache[walkableInterface]);
- } else {
- drawInterface(0, 0, 0, RSInterface.interfaceCache[walkableInterface]);
- }
- }
- }
- }
- if (openInterfaceID != -1) {
- method119(anInt945, openInterfaceID);
- if (isFixed()) {
- drawInterface(0, 0, 0, RSInterface.interfaceCache[openInterfaceID]);
- } else {
- if (openInterfaceID == 23133 && !isFixed()) {
- drawInterface(clientWidth / 2 - 256, 0, 0, RSInterface.interfaceCache[openInterfaceID]);
- } else {
- if (clientWidth >= 900 && clientHeight >= 650) {
- drawInterface((clientWidth / 2) - 256, (clientHeight / 2) - 167, 0, RSInterface.interfaceCache[openInterfaceID]);
- } else {
- drawInterface(0, 0, 0, RSInterface.interfaceCache[openInterfaceID]);
- }
- }
- }
- }
- if (multiIcon == 1) {
- if (isFixed()) {
- multiZone.drawImage(472, 296);
- } else {
- cacheSprite[99].drawImage(clientWidth - 40, 171);
- }
- }
- method70();
- if (!menuOpen) {
- processRightClick();
- drawTooltip();
- } else if (menuScreenArea == 0)
- drawMenu();
- if (fpsOn) {
- char c = '\u01FB';
- int k = 20;
- int i1 = 0xffff00;
- if (super.fps < 15) {
- i1 = 0xff0000;
- }
- normalFont.method380("Fps:" + super.fps, c, i1, k);
- k += 15;
- Runtime runtime = Runtime.getRuntime();
- int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
- i1 = 0xffff00;
- if (j1 > 0x2000000 && lowMemory) {
- i1 = 0xff0000;
- }
- normalFont.method380("Mem:" + j1 + "k", c, 0xffff00, k);
- k += 15;
- }
- playerX = baseX + (myPlayer.currentX - 6 >> 7);
- playerY = baseY + (myPlayer.currentY - 6 >> 7);
- if (clientData) {
- int yPosition = clientSize == 0 ? !isAdministrator() ? 285 : 225 : 40;
- final int textColor = 0xffffff;
- final Runtime runtime = Runtime.getRuntime();
- final int memoryUsage = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
- normalFont.method385(super.fps < 15 ? 0xff0000 : textColor, "FPS: " + super.fps, yPosition, 5);
- yPosition += 15;
- normalFont.method385(memoryUsage > 0x2000000 && lowMemory ? 0xff0000 : textColor, "Memory usage: " + (memoryUsage / 1000)
- + "mb", yPosition, 5);
- yPosition += 15;
- if (isAdministrator()) {
- normalFont.method385(textColor, "Mouse: " + super.getMouseX() + ", " + super.getMouseY(), yPosition, 5);
- yPosition += 15;
- }
- normalFont.method385(textColor, "Position: " + playerX + ", " + playerY, yPosition, 5);
- yPosition += 15;
- if (isAdministrator()) {
- normalFont.method385(textColor, "Local: " + localX + ", " + localY, yPosition, 5);
- yPosition += 15;
- int regionId = getRegionId();
- int regionIndex = onDemandFetcher.getRegionIndex(regionId);
- normalFont.method385(textColor, "Region Id: " + regionId + ", " + regionIndex, yPosition, 5);
- yPosition += 15;
- normalFont
- .method385(
- textColor,
- "Terrain, Landscape: "
- + (regionIndex >= 0 ? (onDemandFetcher.mapTerrains[regionIndex] + ", " + onDemandFetcher.mapLandscapes[regionIndex])
- : "-1"), yPosition, 5);
- yPosition += 15;
- }
- normalFont.method385(textColor, "Local Players: " + playerCount, yPosition, 5);
- }
- if (updateTimer != 0) {
- int seconds = updateTimer / 50;
- int minutes = seconds / 60;
- seconds %= 60;
- if (Settings.UPDATE) {
- if (seconds < 10) {
- normalFont.method385(0xffff00, "Lost Dynasty will update in: " + minutes + ":0" + seconds, 329, 4);
- } else {
- normalFont.method385(0xffff00, "Lost Dynasty will update in: " + minutes + ":" + seconds, 329, 4);
- }
- } else if (Settings.RESTART) {
- if (seconds < 10) {
- normalFont.method385(0xffff00, "Lost Dynasty will have a system restart in: " + minutes + ":0" + seconds, 329, 4);
- } else {
- normalFont.method385(0xffff00, "Lost Dynasty will have a system restart in: " + minutes + ":" + seconds, 329, 4);
- }
- }
- anInt849++;
- if (anInt849 > 75) {
- anInt849 = 0;
- // outgoingPacket.createFrame(148);
- }
- }
- if (restartTimer != 0) {
- int seconds = restartTimer / 50;
- int minutes = seconds / 60;
- seconds %= 60;
- if (seconds < 10) {
- normalFont.method385(0xffff00, "Lost Dynasty will restart in: " + minutes + ":0" + seconds, 329, 4);
- } else {
- normalFont.method385(0xffff00, "Lost Dynasty will restart in: " + minutes + ":" + seconds, 329, 4);
- }
- anInt849++;
- if (anInt849 > 75) {
- anInt849 = 0;
- // outgoingPacket.createFrame(148);
- }
- }
- }
- private void addIgnore(long l) {
- try {
- if (l == 0L) {
- return;
- }
- if (ignoreCount >= 100) {
- pushMessage("", "Your ignore list has reached it's maximum of 100.", 0, "", -1);
- return;
- }
- String s = TextUtils.fixName(TextUtils.nameForLong(l));
- for (int j = 0; j < ignoreCount; j++) {
- if (ignoreListAsLongs[j] == l) {
- pushMessage("", s + " is already on your ignore list!", 0, "", -1);
- return;
- }
- }
- for (int k = 0; k < friendsCount; k++) {
- if (friendsListAsLongs[k] == l) {
- pushMessage("", "Please remove " + s + " from your friend list first.", 0, "", -1);
- return;
- }
- }
- ignoreListAsLongs[ignoreCount++] = l;
- redrawTabArea = true;
- outgoingPacket.createFrame(133);
- outgoingPacket.writeLong(l);
- return;
- } catch (RuntimeException runtimeexception) {
- Signlink.reportError("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
- }
- throw new RuntimeException();
- }
- private void method114() {
- for (int i = -1; i < playerCount; i++) {
- int j;
- if (i == -1) {
- j = myPlayerIndex;
- } else {
- j = playerIndices[i];
- }
- Player player = players[j];
- if (player != null) {
- method96(player);
- }
- }
- }
- private void method115() {
- if (loadingStage == 2) {
- for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179.head(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
- .next()) {
- if (class30_sub1.anInt1294 > 0) {
- class30_sub1.anInt1294--;
- }
- if (class30_sub1.anInt1294 == 0) {
- if (class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301)) {
- method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301,
- class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
- class30_sub1.remove();
- }
- } else {
- if (class30_sub1.anInt1302 > 0) {
- class30_sub1.anInt1302--;
- }
- if (class30_sub1.anInt1302 == 0 && class30_sub1.anInt1297 >= 1 && class30_sub1.anInt1298 >= 1
- && class30_sub1.anInt1297 <= 102 && class30_sub1.anInt1298 <= 102
- && (class30_sub1.anInt1291 < 0 || ObjectManager.method178(class30_sub1.anInt1291, class30_sub1.anInt1293))) {
- method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293,
- class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
- class30_sub1.anInt1302 = -1;
- if (class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1) {
- class30_sub1.remove();
- } else if (class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300
- && class30_sub1.anInt1293 == class30_sub1.anInt1301) {
- class30_sub1.remove();
- }
- }
- }
- }
- }
- }
- private void determineMenuSize() {
- int i = boldFont.getTextWidth("Choose Option");
- for (int j = 0; j < menuActionRow; j++) {
- int k = boldFont.getTextWidth(menuActionName[j]);
- if (k > i)
- i = k;
- }
- i += 8;
- int l = 15 * menuActionRow + 21;
- if (clientSize == 0) {
- if (super.saveClickX > 4 && super.saveClickY > 4 && super.saveClickX < 516 && super.saveClickY < 338) {
- int i1 = super.saveClickX - 4 - i / 2;
- if (i1 + i > 512)
- i1 = 512 - i;
- if (i1 < 0)
- i1 = 0;
- int l1 = super.saveClickY - 4;
- if (l1 + l > 334)
- l1 = 334 - l;
- if (l1 < 0)
- l1 = 0;
- menuOpen = true;
- menuScreenArea = 0;
- menuOffsetX = i1;
- menuOffsetY = l1;
- menuWidth = i;
- menuHeight = 15 * menuActionRow + 22;
- }
- if (super.saveClickX > 519 && super.saveClickY > 168 && super.saveClickX < 765 && super.saveClickY < 503) {
- int j1 = super.saveClickX - 519 - i / 2;
- if (j1 < 0)
- j1 = 0;
- else if (j1 + i > 245)
- j1 = 245 - i;
- int i2 = super.saveClickY - 168;
- if (i2 < 0)
- i2 = 0;
- else if (i2 + l > 333)
- i2 = 333 - l;
- menuOpen = true;
- menuScreenArea = 1;
- menuOffsetX = j1;
- menuOffsetY = i2;
- menuWidth = i;
- menuHeight = 15 * menuActionRow + 22;
- }
- if (super.saveClickX > 0 && super.saveClickY > 338 && super.saveClickX < 516 && super.saveClickY < 503) {
- int k1 = super.saveClickX - 0 - i / 2;
- if (k1 < 0)
- k1 = 0;
- else if (k1 + i > 516)
- k1 = 516 - i;
- int j2 = super.saveClickY - 338;
- if (j2 < 0)
- j2 = 0;
- else if (j2 + l > 165)
- j2 = 165 - l;
- menuOpen = true;
- menuScreenArea = 2;
- menuOffsetX = k1;
- menuOffsetY = j2;
- menuWidth = i;
- menuHeight = 15 * menuActionRow + 22;
- }
- if (super.saveClickX > 519 && super.saveClickY > 0 && super.saveClickX < 765 && super.saveClickY < 168) {
- int j1 = super.saveClickX - 519 - i / 2;
- if (j1 < 0)
- j1 = 0;
- else if (j1 + i > 245)
- j1 = 245 - i;
- int i2 = super.saveClickY - 0;
- if (i2 < 0)
- i2 = 0;
- else if (i2 + l > 168)
- i2 = 168 - l;
- menuOpen = true;
- menuScreenArea = 3;
- menuOffsetX = j1;
- menuOffsetY = i2;
- menuWidth = i;
- menuHeight = 15 * menuActionRow + 22;
- }
- } else {
- if (super.saveClickX > 0 && super.saveClickY > 0 && super.saveClickX < clientWidth
- && super.saveClickY < clientHeight) {
- int i1 = super.saveClickX - 0 - i / 2;
- if (i1 + i > clientWidth)
- i1 = clientWidth - i;
- if (i1 < 0)
- i1 = 0;
- int l1 = super.saveClickY - 0;
- if (l1 + l > clientHeight)
- l1 = clientHeight - l;
- if (l1 < 0)
- l1 = 0;
- menuOpen = true;
- menuScreenArea = 0;
- menuOffsetX = i1;
- menuOffsetY = l1;
- menuWidth = i;
- menuHeight = 15 * menuActionRow + 22;
- }
- }
- if (menuOpen) {
- menuOpenTime = System.currentTimeMillis();
- contextWidth = 0;
- contextHeight = 0;
- }
- }
- private int contextWidth;
- private int contextHeight;
- private long menuOpenTime = -1;
- private void updateClientMovement(JagexBuffer stream) {
- stream.initBitAccess();
- int j = stream.getBits(1);
- if (j == 0) {
- return;
- }
- int updateType = stream.getBits(2);
- if (updateType == 0) {
- localPlayers[localPlayersIndex++] = myPlayerIndex;
- return;
- }
- if (updateType == 1) {
- int l = stream.getBits(3);
- myPlayer.move(false, l);
- int k1 = stream.getBits(1);
- if (k1 == 1) {
- localPlayers[localPlayersIndex++] = myPlayerIndex;
- }
- return;
- }
- if (updateType == 2) {
- int i1 = stream.getBits(3);
- myPlayer.move(true, i1);
- int l1 = stream.getBits(3);
- myPlayer.move(true, l1);
- int j2 = stream.getBits(1);
- if (j2 == 1) {
- localPlayers[localPlayersIndex++] = myPlayerIndex;
- }
- return;
- }
- if (updateType == 3) {
- plane = stream.getBits(2);
- int teleport = stream.getBits(1);
- int update = stream.getBits(1);
- if (update == 1) {
- localPlayers[localPlayersIndex++] = myPlayerIndex;
- }
- int localY = stream.getBits(7);
- int localX = stream.getBits(7);
- myPlayer.setPos(localX, localY, teleport == 1);
- }
- }
- private void nullLoader() {
- aBoolean831 = false;
- while (drawingFlames) {
- aBoolean831 = false;
- try {
- Thread.sleep(50L);
- } catch (Exception _ex) {
- }
- }
- }
- private boolean method119(int i, int id) {
- boolean flag1 = false;
- if (id < 0 || id >= RSInterface.interfaceCache.length) {
- return false;
- }
- RSInterface rsi = RSInterface.interfaceCache[id];
- if (rsi == null || rsi.children == null) {
- return false;
- }
- for (int index = 0; index < rsi.children.length; index++) {
- if (rsi.children[index] == -1) {
- break;
- }
- RSInterface child = RSInterface.interfaceCache[rsi.children[index]];
- if (child.type == 1) {
- flag1 |= method119(i, child.id);
- }
- if (child.type == 6 && (child.disabledMediaAnimation != -1 || child.enabledMediaAnimation != -1)) {
- boolean flag2 = interfaceIsSelected(child);
- int l;
- if (flag2) {
- l = child.enabledMediaAnimation;
- } else {
- l = child.disabledMediaAnimation;
- }
- if (l != -1) {
- Animation animation = Animation.getAnim(l);
- for (child.anInt208 += i; child.anInt208 > animation.getDelay(child.anInt246);) {
- child.anInt208 -= animation.getDelay(child.anInt246) + 1;
- child.anInt246++;
- if (child.anInt246 >= animation.frameCount) {
- child.anInt246 -= animation.loopDelay;
- if (child.anInt246 < 0 || child.anInt246 >= animation.frameCount) {
- child.anInt246 = 0;
- }
- }
- flag1 = true;
- }
- }
- }
- }
- return flag1;
- }
- private int method120() {
- if (GameSettings.Roofs_Off.toggled())
- return plane;
- int j = 3;
- if (yCameraCurve < 310) {
- int k = xCameraPos >> 7;
- int l = yCameraPos >> 7;
- int i1 = myPlayer.currentX >> 7;
- int j1 = myPlayer.currentY >> 7;
- if ((groundTileSettings[plane][k][l] & 4) != 0) {
- j = plane;
- }
- int k1;
- if (i1 > k) {
- k1 = i1 - k;
- } else {
- k1 = k - i1;
- }
- int l1;
- if (j1 > l) {
- l1 = j1 - l;
- } else {
- l1 = l - j1;
- }
- if (k1 > l1) {
- int i2 = (l1 * 0x10000) / k1;
- int k2 = 32768;
- while (k != i1) {
- if (k < i1) {
- k++;
- } else if (k > i1) {
- k--;
- }
- if ((groundTileSettings[plane][k][l] & 4) != 0) {
- j = plane;
- }
- k2 += i2;
- if (k2 >= 0x10000) {
- k2 -= 0x10000;
- if (l < j1) {
- l++;
- } else if (l > j1) {
- l--;
- }
- if ((groundTileSettings[plane][k][l] & 4) != 0) {
- j = plane;
- }
- }
- }
- } else {
- int j2 = (k1 * 0x10000) / l1;
- int l2 = 32768;
- while (l != j1) {
- if (l < j1) {
- l++;
- } else if (l > j1) {
- l--;
- }
- if ((groundTileSettings[plane][k][l] & 4) != 0) {
- j = plane;
- }
- l2 += j2;
- if (l2 >= 0x10000) {
- l2 -= 0x10000;
- if (k < i1) {
- k++;
- } else if (k > i1) {
- k--;
- }
- if ((groundTileSettings[plane][k][l] & 4) != 0) {
- j = plane;
- }
- }
- }
- }
- }
- if ((groundTileSettings[plane][myPlayer.currentX >> 7][myPlayer.currentY >> 7] & 4) != 0) {
- j = plane;
- }
- return j;
- }
- private int method121() {
- if (GameSettings.Roofs_Off.toggled())
- return plane;
- int j = method42(plane, yCameraPos, xCameraPos);
- if (j - zCameraPos < 800 && (groundTileSettings[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0) {
- return plane;
- } else {
- return 3;
- }
- }
- private void delIgnore(long l) {
- try {
- if (l == 0L) {
- return;
- }
- for (int j = 0; j < ignoreCount; j++) {
- if (ignoreListAsLongs[j] == l) {
- ignoreCount--;
- redrawTabArea = true;
- System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
- outgoingPacket.createFrame(74);
- outgoingPacket.writeLong(l);
- return;
- }
- }
- return;
- } catch (RuntimeException runtimeexception) {
- Signlink.reportError("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
- }
- throw new RuntimeException();
- }
- public void sendString(int identifier, String text) {
- text = identifier + "," + text;
- outgoingPacket.createFrame(127);
- outgoingPacket.writeByte(text.length() + 1);
- outgoingPacket.writeString(text);
- }
- private void searchBank(long search) {
- try {
- if (search == 0L) {
- return;
- }
- if (variousSettings[799] == 0) {
- search = TextUtils.longForName("reset");
- }
- outgoingPacket.createFrame(62);
- outgoingPacket.writeLong(search);
- return;
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public String getParameter(String s) {
- if (Signlink.mainapp != null) {
- return Signlink.mainapp.getParameter(s);
- } else {
- return super.getParameter(s);
- }
- }
- private void adjustVolume(boolean updateMidi, int volume) {
- if (getCurrentAccount() != null) {
- getCurrentAccount().musicVolume = volume;
- //AccountHandler.save();
- }
- Signlink.setVolume(volume);
- if (updateMidi) {
- Signlink.midi = "voladjust";
- }
- }
- private int extractInterfaceValues(RSInterface rsi, int j) {
- if (rsi.valueConditionType == null || j >= rsi.valueConditionType.length) {
- return -2;
- }
- try {
- int valueArray[] = rsi.valueConditionType[j];
- int k = 0;
- int l = 0;
- int i1 = 0;
- do {
- int val = valueArray[l++];
- int k1 = 0;
- byte byte0 = 0;
- if (val == 0) {
- return k;
- }
- if (val == 1) {
- int index = l++;
- k1 = currentLevel[valueArray[index]];
- if (!GameSettings.X_10.toggled() || rsi.parentId != 22653) {
- if (valueArray[index] == 5 || valueArray[index] == 3)
- k1 = (int) (k1 / 10);
- }
- }
- if (val == 2) {
- int index = l++;
- int level = maxLevel[valueArray[index]];
- if (!GameSettings.X_10.toggled() || rsi.parentId != 22653) {
- if (valueArray[index] == 5 || valueArray[index] == 3)
- level = (int) (level / 10);
- }
- k1 = level;
- }
- if (val == 3) {
- k1 = currentExperience[valueArray[l++]];
- }
- if (val == 4) {
- RSInterface rsi_1 = RSInterface.interfaceCache[valueArray[l++]];
- int k2 = valueArray[l++];
- if (k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.getDef(k2).membersItem || isMembers)) {
- for (int j3 = 0; j3 < rsi_1.inventory.length; j3++) {
- if (rsi_1.inventory[j3] == k2 + 1) {
- k1 += rsi_1.inventoryAmount[j3];
- }
- }
- }
- }
- if (val == 5) {
- k1 = variousSettings[valueArray[l++]];
- }
- if (val == 6) {
- k1 = anIntArray1019[maxLevel[valueArray[l++]] - 1];
- }
- if (val == 7) {
- k1 = (variousSettings[valueArray[l++]] * 100) / 46875;
- }
- if (val == 8) {
- k1 = myPlayer.combatLevel;
- }
- if (val == 9) {
- for (int l1 = 0; l1 < SkillConstants.skillsCount; l1++) {
- if (SkillConstants.skillEnabled[l1]) {
- k1 += maxLevel[l1];
- }
- }
- }
- if (val == 10) {
- RSInterface class9_2 = RSInterface.interfaceCache[valueArray[l++]];
- int l2 = valueArray[l++] + 1;
- if (l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.getDef(l2).membersItem || isMembers)) {
- for (int k3 = 0; k3 < class9_2.inventory.length; k3++) {
- if (class9_2.inventory[k3] != l2) {
- continue;
- }
- k1 = 0x3b9ac9ff;
- break;
- }
- }
- }
- if (val == 11) {
- k1 = energy;
- }
- if (val == 12) {
- k1 = weight;
- }
- if (val == 13) {
- int i2 = variousSettings[valueArray[l++]];
- int i3 = valueArray[l++];
- k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
- }
- if (val == 14) {
- int j2 = valueArray[l++];
- VarBit varBit = VarBit.cache[j2];
- int l3 = varBit.configId;
- int i4 = varBit.leastSignificantBit;
- int j4 = varBit.mostSignificantBit;
- int k4 = anIntArray1232[j4 - i4];
- k1 = variousSettings[l3] >> i4 & k4;
- }
- if (val == 15) {
- byte0 = 1;
- }
- if (val == 16) {
- byte0 = 2;
- }
- if (val == 17) {
- byte0 = 3;
- }
- if (val == 18) {
- k1 = (myPlayer.currentX >> 7) + baseX;
- }
- if (val == 19) {
- k1 = (myPlayer.currentY >> 7) + baseY;
- }
- if (val == 20) {
- k1 = valueArray[l++];
- }
- if (byte0 == 0) {
- if (i1 == 0) {
- k += k1;
- }
- if (i1 == 1) {
- k -= k1;
- }
- if (i1 == 2 && k1 != 0) {
- k /= k1;
- }
- if (i1 == 3) {
- k *= k1;
- }
- i1 = 0;
- } else {
- i1 = byte0;
- }
- // System.out.println("id=" + rsi.id + "; val=" + val + "; k1=" + k1 + "; byte0=" + byte0);
- } while (true);
- } catch (Exception _ex) {
- return -1;
- }
- }
- public void drawInputField(RSInterface child, int x, int y, int width, int height) {
- if (displayText == null)
- displayText = "";
- String text = displayText;
- if (!child.isInFocus && displayText.length() <= 0) {
- text = "Search...";
- }
- if (!(super.saveClickX >= x && super.saveClickX <= x + child.width && super.saveClickY >= y && super.saveClickY <= y + child.height)) {
- child.isInFocus = false;
- RSInterface.currentInputFieldId = -1;
- setInputFieldFocusOwner(null);
- }
- DrawingArea.drawRoundedRectangle(x, y, width, height, child.disabledColor != 0 ? child.disabledColor : 0x231400,
- child.opacity > 0 ? child.opacity : 255, true, true);
- if (child.displayAsterisks)
- this.normalFont.method389(
- false,
- (x + 8),
- child.enabledColor,
- new StringBuilder().append(TextUtils.mask(text))
- .append(((!child.isInFocus ? 0 : 1) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 ? "|" : "").toString(), (y
- + (height / 2) + 6));
- else
- this.normalFont.method389(false, (x + 8), child.enabledColor,
- new StringBuilder().append(text).append(((!child.isInFocus ? 0 : 1) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 ? "|" : "")
- .toString(), (y + (height / 2) + 6));
- }
- public void drawAltInputField(RSInterface child, int x, int y, int width, int height) {
- int alpha = child.opacity > 0 ? child.opacity : 255;
- /*
- * if ((child.id == 60152 || child.id == 60153)
- * && ReferenceManager.useServerEmail) {
- * alpha = 40;
- * }
- */
- DrawingArea.drawRoundedRectangle(x, y, width, height, child.disabledColor != 0 ? child.disabledColor : 0x231400, alpha, true, true);
- if (child.displayAsterisks) {
- String text = new StringBuilder().append(TextUtils.mask(child.displayText)).toString();
- int length = text.length();
- if (length <= 0 && child.enabledText != null && getInputFieldFocusOwner() != child) {
- text = child.enabledText;
- length = text.length();
- }
- if (System.currentTimeMillis() - child.lastKeyPressed < 1000 && length > 0) {
- text = text.substring(0, length - 1) + child.displayText.charAt(child.displayText.length() - 1);
- }
- if (length > child.characterLimitCutOff) {
- if (getInputFieldFocusOwner() == child)
- text = "..." + text.substring((length / child.characterLimitCutOff) * child.characterLimitCutOff, length);
- else
- text = text.substring(0, child.characterLimitCutOff - 1) + "...";
- }
- this.normalFont.method389(false, (x + 8), child.enabledColor, text
- + (((!child.isInFocus ? 0 : 1) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 && getInputFieldFocusOwner() == child ? "|" : ""),
- (y + (height / 2) + 6));
- } else {
- String text = child.displayText;
- int length = text.length();
- if (length <= 0 && child.enabledText != null && getInputFieldFocusOwner() != child) {
- text = child.enabledText;
- length = text.length();
- }
- if (!child.splitDisplayText) {
- if (length > child.characterLimitCutOff) {
- if (getInputFieldFocusOwner() == child)
- text = "..." + text.substring((length / child.characterLimitCutOff) * child.characterLimitCutOff, length);
- else
- text = text.substring(0, child.characterLimitCutOff - 1) + "...";
- }
- normalFont.method389(false, (x + 8), child.enabledColor, text
- + (((!child.isInFocus ? 0 : 1) & (loopCycle % 40 < 20 ? 1 : 0)) != 0 && getInputFieldFocusOwner() == child ? "|"
- : ""), (y + (height / 2) + 6));
- } else {
- String[] split = TextUtils.split(newSmallFont, text, width - 2);
- for (int i = 0; i < split.length; i++) {
- if (split[i] == null || split[i].equals("null"))
- continue;
- newSmallFont.drawBasicString(split[i]
- + (i != split.length - 1 ? "" : (((!child.isInFocus ? 0 : 1) & (loopCycle % 40 < 20 ? 1 : 0)) != 0
- && getInputFieldFocusOwner() == child ? "|" : "")), (x + 2), (y + newSmallFont.baseCharacterHeight + 5)
- + ((newSmallFont.baseCharacterHeight + 3) * i), child.enabledColor, child.shadeText ? 0 : -1, true);
- }
- }
- }
- if (getInputFieldFocusOwner() == null)
- return;
- if (child.id == getInputFieldFocusOwner().id) {
- if (child.displayText == null)
- child.displayText = "";
- if (!(super.saveClickX >= x && super.saveClickX <= x + child.width && super.saveClickY >= y && super.saveClickY <= y
- + child.height)) {
- child.isInFocus = false;
- RSInterface.currentInputFieldId = -1;
- setInputFieldFocusOwner(null);
- }
- }
- }
- private RSInterface inputFieldFocusOwner;
- public void setInputFieldFocusOwner(RSInterface child) {
- inputFieldFocusOwner = child;
- }
- public RSInterface getInputFieldFocusOwner() {
- return inputFieldFocusOwner;
- }
- private void drawTooltip() {
- if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0 && familiarHandler.specialSelected == -1
- && !familiarHandler.attackSelected) {
- return;
- }
- String tooltip;
- if (itemSelected == 1 && menuActionRow < 2) {
- tooltip = "Use " + selectedItemName + " with...";
- } else if (spellSelected == 1 && menuActionRow < 2) {
- tooltip = spellTooltip + "...";
- } else if (familiarHandler.isActive() && familiarHandler.specialSelected != -1 && familiarHandler.specialType == 2
- && menuActionRow < 2) {
- tooltip = "Use " + familiarHandler.specialAttack + " with...";
- } else {
- tooltip = menuActionName[menuActionRow - 1];
- }
- if (menuActionRow > 2) {
- tooltip = tooltip + "@whi@ / " + (menuActionRow - 2) + " more options";
- }
- RSFontSystem font = getCurrentAccount().contextMenu == 0 ? newBoldFont : newRegularFont;
- font.drawBasicString(tooltip, 4, 15, 0xffffff, 0);
- // boldFont.method390(4, 0xffffff, tooltip, requestAge / 1000, 15);
- }
- public int getOrbX(int orb) {
- switch (orb) {
- case 0:
- return !isFixed() ? clientWidth - 212 : 172;
- case 1:
- return !isFixed() ? clientWidth - 215 : 188;
- case 2:
- return !isFixed() ? clientWidth - 203 : 188;
- case 3:
- return !isFixed() ? clientWidth - 180 : 172;
- }
- return 0;
- }
- public int getOrbY(int orb) {
- switch (orb) {
- case 0:
- return !isFixed() ? 39 : 15;
- case 1:
- return !isFixed() ? 73 : 54;
- case 2:
- return !isFixed() ? 107 : 93;
- case 3:
- return !isFixed() ? 141 : 128;
- }
- return 0;
- }
- public double fillHP;
- private boolean poisoned;
- public void drawHPOrb() {
- int current = currentLevel[3];
- int max = maxLevel[3];
- if (!GameSettings.X_10.toggled()) {
- if (current < 10 && current > 0)
- current = 10;
- current /= 10;
- max /= 10;
- }
- int health = (int) (((double) current / (double) max) * 100D);
- int x = getOrbX(0);
- int y = getOrbY(0);
- orbs[clientSize == 0 ? (hoverPos == 4 ? 12 : 0) : (hoverPos == 4 ? 13 : 11)].drawImage(x, y);
- if (health >= 75) {
- newSmallFont.drawCenteredString(Integer.toString(current), x + (clientSize == 0 ? 42 : 15), y + 26, 65280, 0);
- } else if (health <= 74 && health >= 50) {
- newSmallFont.drawCenteredString(Integer.toString(current), x + (clientSize == 0 ? 42 : 15), y + 26, 0xffff00, 0);
- } else if (health <= 49 && health >= 25) {
- newSmallFont.drawCenteredString(Integer.toString(current), x + (clientSize == 0 ? 42 : 15), y + 26, 0xfca607, 0);
- } else if (health <= 24 && health >= 0) {
- newSmallFont.drawCenteredString(Integer.toString(current), x + (clientSize == 0 ? 42 : 15), y + 26, 0xf50d0d, 0);
- }
- final RSImage orb = !poisoned ? orbs[2] : RSImageLoader.images[634];
- orb.drawImage(x + (clientSize == 0 ? 3 : 27), y + 3);
- double percent = (health / 100D);
- fillHP = 27 * percent;
- int depleteFill = 27 - (int) fillHP;
- orbs[1].myHeight = depleteFill;
- DrawingArea.height = depleteFill;
- orbs[1].drawImage(x + (clientSize == 0 ? 3 : 27), y + 3);
- boolean newDrawing = getRevision() == Revision.REVISION_667 && Content.isNewSchoolGameframe();
- if (newDrawing)
- orbs[3].drawImage(x + (clientSize == 0 ? 7 : 31), y + 9);
- else
- RSImageLoader.images[541].drawImage(x + (clientSize == 0 ? 9 : 33), y + 11);
- }
- public double fillPrayer;
- public void drawPrayerOrb() {
- int current_level = !inHungerGames() ? currentLevel[5] : hungerGamesThirst;
- int max_level = !inHungerGames() ? maxLevel[5] : 100;
- if (!GameSettings.X_10.toggled() && !inHungerGames()) {
- if (current_level < 10 && current_level > 0)
- current_level = 10;
- current_level /= 10;
- max_level /= 10;
- }
- int prayer = (int) (((double) current_level / (double) max_level) * 100D);
- int x = getOrbX(1);
- int y = getOrbY(1);
- orbs[clientSize == 0 ? (hoverPos == 1 ? 12 : 0) : (hoverPos == 1 ? 13 : 11)].drawImage(x, y);
- if (prayer >= 75) {
- newSmallFont.drawCenteredString(Integer.toString(current_level), x + (clientSize == 0 ? 42 : 15), y + 26, 65280, 0);
- } else if (prayer <= 74 && prayer >= 50) {
- newSmallFont.drawCenteredString(Integer.toString(current_level), x + (clientSize == 0 ? 42 : 15), y + 26, 0xffff00, 0);
- } else if (prayer <= 49 && prayer >= 25) {
- newSmallFont.drawCenteredString(Integer.toString(current_level), x + (clientSize == 0 ? 42 : 15), y + 26, 0xfca607, 0);
- } else if (prayer <= 24 && prayer >= 0) {
- newSmallFont.drawCenteredString(Integer.toString(current_level), x + (clientSize == 0 ? 42 : 15), y + 26, 0xf50d0d, 0);
- }
- if (!inHungerGames()) {
- orbs[quickPrayers && currentLevel[5] != 0 ? 10 : 4].drawImage(x + (clientSize == 0 ? 3 : 27), y + 3);
- } else {
- RSImageLoader.images[794].drawImage(x + (clientSize == 0 ? 3 : 27), y + 3);
- }
- double percent = (prayer / 100D);
- fillPrayer = 27 * percent;
- int depleteFill = 27 - (int) fillPrayer;
- orbs[17].myHeight = depleteFill;
- DrawingArea.height = depleteFill;
- orbs[17].drawImage(x + (clientSize == 0 ? 3 : 27), y + 3);
- if (!inHungerGames()) {
- boolean newDrawing = getRevision() == Revision.REVISION_667 && Content.isNewSchoolGameframe();
- if (newDrawing)
- orbs[5].drawImage(x + (clientSize == 0 ? 5 : 30), y + 6);
- else
- RSImageLoader.images[542].drawImage(x + (clientSize == 0 ? 7 : 32), y + 7);
- } else {
- RSImageLoader.images[790].drawImage(x + (clientSize == 0 ? 9 : 33), y + 9);
- }
- }
- public boolean inHungerGames() {
- return tabInterfaceIDs[5] == 16650 && hungerGamesHunger >= 0 && hungerGamesThirst >= 0;
- }
- public double fillRun;
- public boolean running;
- public int restMode = 0;
- public int restOpacity = 100;
- public void drawRunOrb() {
- int run = (int) (((double) energy / (double) 100) * 100D);
- int x = getOrbX(2);
- int y = getOrbY(2);
- orbs[clientSize == 0 ? (hoverPos == 2 ? 12 : 0) : (hoverPos == 2 ? 13 : 11)].drawImage(x, y);
- if (run >= 75) {
- newSmallFont.drawCenteredString(Integer.toString(energy), x + (clientSize == 0 ? 42 : 15), y + 26, 65280, 0);
- } else if (run <= 74 && run >= 50) {
- newSmallFont.drawCenteredString(Integer.toString(energy), x + (clientSize == 0 ? 42 : 15), y + 26, 0xffff00, 0);
- } else if (run <= 49 && run >= 25) {
- newSmallFont.drawCenteredString(Integer.toString(energy), x + (clientSize == 0 ? 42 : 15), y + 26, 0xfca607, 0);
- } else if (run <= 24 && run >= 0) {
- newSmallFont.drawCenteredString(Integer.toString(energy), x + (clientSize == 0 ? 42 : 15), y + 26, 0xf50d0d, 0);
- }
- if (restMode <= 0) {
- orbs[!running ? 6 : 8].drawImage(x + (clientSize == 0 ? 3 : 27), y + 3);
- } else {
- restOpacity = restOpacity < 250 ? restOpacity + 6 : 125;
- orbs[8].drawImageWithOpacity(x + (clientSize == 0 ? 3 : 27), y + 3, restOpacity);
- }
- double percent = (run / 100D);
- fillRun = 27 * percent;
- int depleteFill = 27 - (int) fillRun;
- orbs[18].myHeight = depleteFill;
- DrawingArea.height = depleteFill;
- orbs[18].drawImage(x + (clientSize == 0 ? 3 : 27), y + 3);
- if (run == 0) {
- running = false;
- variousSettings[173] = 0;
- }
- if (restMode <= 0) {
- boolean newDrawing = getRevision() == Revision.REVISION_667 && Content.isNewSchoolGameframe();
- if (newDrawing)
- orbs[!running ? 7 : 9].drawImage(x + (clientSize == 0 ? 8 : 32), y + 7);
- else
- RSImageLoader.images[!running ? 543 : 544].drawImage(x + (clientSize == 0 ? 10 : 34), y + 7);
- } else {
- RSImageLoader.images[restMode == 1 ? 813 : 814].drawImage(x + (clientSize == 0 ? 8 : 32), y + 7);
- }
- // cacheSprite[106].drawARGBImage(currentX + (clientSize == 0 ? -15 : 34), currentY - 17, 0);
- }
- public double fillSummoning;
- public void drawSummoningOrb() {
- int current_level = !inHungerGames() ? currentLevel[23] : hungerGamesHunger;
- int max_level = !inHungerGames() ? maxLevel[23] : 100;
- int summoning = (int) (((double) current_level / (double) max_level) * 100D);
- int x = getOrbX(3);
- int y = getOrbY(3);
- if (familiarHandler.specialSelected == -1 && !familiarHandler.attackSelected) {
- orbs[clientSize == 0 ? (hoverPos == 3 ? 12 : 0) : (hoverPos == 3 ? 13 : 11)].drawImage(x, y);
- } else {
- orbs[clientSize == 0 ? (hoverPos == 3 ? 12 : 0) : (hoverPos == 3 ? 13 : 11)].drawOutlinedSprite(x, y, 0xFFFFFF);
- }
- if (summoning <= 100 && summoning >= 75) {
- newSmallFont.drawCenteredString(Integer.toString(current_level), x + (clientSize == 0 ? 42 : 15), y + 26, 65280, 0);
- } else if (summoning <= 74 && summoning >= 50) {
- newSmallFont.drawCenteredString(Integer.toString(current_level), x + (clientSize == 0 ? 42 : 15), y + 26, 0xffff00, 0);
- } else if (summoning <= 49 && summoning >= 25) {
- newSmallFont.drawCenteredString(Integer.toString(current_level), x + (clientSize == 0 ? 42 : 15), y + 26, 0xfca607, 0);
- } else if (summoning <= 24 && summoning >= 0) {
- newSmallFont.drawCenteredString(Integer.toString(current_level), x + (clientSize == 0 ? 42 : 15), y + 26, 0xf50d0d, 0);
- }
- if (!inHungerGames()) {
- orbs[getFamiliar().isActive() ? 16 : 14].drawImage(x + (clientSize == 0 ? 3 : 27), y + 3);
- } else {
- RSImageLoader.images[793].drawImage(x + (clientSize == 0 ? 3 : 27), y + 3);
- }
- double percent = (summoning / 100D);
- fillSummoning = 27 * percent;
- int depleteFill = 27 - (int) fillSummoning;
- orbs[19].myHeight = depleteFill;
- DrawingArea.height = depleteFill;
- orbs[19].drawImage(x + (clientSize == 0 ? 3 : 27), y + 3);
- if (!inHungerGames()) {
- orbs[15].drawImage(x + (clientSize == 0 ? 9 : 33), y + 9);
- } else {
- RSImageLoader.images[789].drawImage((x) + (clientSize == 0 ? 9 : 33), y + 9);
- }
- }
- private void drawOrbs() {
- if (Content.GAMEFRAME >= 508) {
- drawHPOrb();
- drawPrayerOrb();
- drawRunOrb();
- drawSummoningOrb();
- }
- if (GameSettings.MONEY_ORB.toggled())
- drawMoneyOrb();
- }
- private boolean viewingMoneyOrb;
- private int moneyOrbUpdateStatus;
- private int moneyOrbStatusAlpha = 256;
- private long lastMoneyOrbStatusAlpha;
- private long moneyPouch;
- private int moneyOrbUpdateTextY;
- private long moneyPouchProfit;
- private void drawMoneyOrb() {
- int orb_x = (clientSize == 0 ? -2 : clientWidth - 253);
- int orb_y = (clientSize == 0 ? 85 : 35);
- int orb_image_id = 259;
- if (hoverPos == 5) {
- orb_image_id = 260;
- }
- RSImageLoader.images[orb_image_id].drawARGBImage(orb_x, orb_y);
- if (moneyOrbUpdateStatus > 0 && moneyOrbUpdateStatus <= 2) {
- if (viewingMoneyOrb) {
- moneyOrbUpdateStatus = 0;
- } else {
- if (System.currentTimeMillis() - lastMoneyOrbStatusAlpha >= 700) {
- moneyOrbStatusAlpha = moneyOrbStatusAlpha == 256 ? 210 : 256;
- lastMoneyOrbStatusAlpha = System.currentTimeMillis();
- }
- RSImageLoader.images[268 + moneyOrbUpdateStatus].drawARGBImage(orb_x - 3, orb_y - 3, moneyOrbStatusAlpha);
- }
- }
- if (clientSize != 0) {
- drawMoneyOrbParts();
- }
- }
- private void drawMoneyOrbParts() {
- int orb_x = clientWidth - 292;
- int orb_y = clientSize == 0 ? 86 : 40;
- int box_image_id = -1;
- int extension_image_id = -1;
- if (moneyPouchProfit > 0) {
- if (moneyOrbUpdateTextY <= 0) {
- moneyOrbUpdateTextY = 50;
- }
- int color = 0x00FF00;
- String string = "+" + moneyPouchProfit;
- int draw_y = moneyOrbUpdateTextY + (clientSize == 0 ? 105 : 70);
- RSInterface.fonts[0].drawCenteredString(string, orb_x + 8, draw_y, color, 1);
- moneyOrbUpdateTextY -= 2;
- if (moneyOrbUpdateTextY <= 0) {
- moneyPouchProfit = 0;
- }
- } else if (moneyPouchProfit < 0) {
- int color = 0xFF0000;
- String string = "" + moneyPouchProfit;
- int draw_y = moneyOrbUpdateTextY + (clientSize == 0 ? 105 : 70);
- RSInterface.fonts[0].drawCenteredString(string, orb_x + 8, draw_y, color, 1);
- moneyOrbUpdateTextY += 2;
- if (moneyOrbUpdateTextY >= 50) {
- moneyPouchProfit = 0;
- moneyOrbUpdateTextY = 0;
- }
- }
- if (hoverPos == 5) {
- if (viewingMoneyOrb) {
- extension_image_id = 263;
- } else {
- extension_image_id = 264;
- }
- }
- if (viewingMoneyOrb) {
- if (hoverPos != 5) {
- box_image_id = 267;
- } else {
- box_image_id = 268;
- }
- }
- if (box_image_id != -1) {
- RSImageLoader.images[box_image_id].drawARGBImage(orb_x - 29, orb_y);
- int color = moneyPouch < 1000000 ? 0xFFFFFF : 0x00FF00;
- RSInterface.fonts[0].drawCenteredString(String.valueOf(formatAmount(moneyPouch)), orb_x + 8, orb_y + 16, color, 1);
- }
- if (extension_image_id != -1) {
- // RSImageLoader.images[extension_image_id].drawARGBImage(orb_x + 36, orb_y - 5);
- }
- }
- private void drawMinimap() {
- if (GameSettings.HIDE_MINIMAP.toggled()) {
- return;
- }
- int xPosOffset = getMapOffsetX();
- int revision = Content.getVersion(Content.GAMEFRAME);
- if (showMiniMap) {
- if (clientSize == 0) {
- mapArea.create();
- }
- if (minimapState == 2) {
- cacheSprite[67].drawImage((clientSize == 0 ? 32 : clientWidth - 162), (clientSize == 0 ? 9 : 5));
- if (clientSize == 0) {
- cacheSprite[6].drawImage(0 + xPosOffset, 0);
- } else {
- cacheSprite[36].drawImage(clientWidth - 167, 0);
- cacheSprite[37].drawImage(clientWidth - 172, 0);
- }
- cacheSprite[38].drawImage(clientSize == 0 ? -3 : clientWidth - 188, clientSize == 0 ? 46 : 40);
- if (hoverPos == 0) {
- cacheSprite[39].drawImage(clientSize == 0 ? -3 : clientWidth - 188, clientSize == 0 ? 46 : 40);
- }
- cacheSprite[30].drawImage((clientSize == 0 ? 246 : clientWidth) - 21, 0);
- if (tabHover != -1) {
- if (tabHover == 10) {
- cacheSprite[34].drawImage((clientSize == 0 ? 246 : clientWidth) - 21, 0);
- }
- }
- if (tabInterfaceIDs[tabID] != -1) {
- if (tabID == 10) {
- cacheSprite[35].drawImage((clientSize == 0 ? 246 : clientWidth) - 21, 0);
- }
- }
- drawOrbs();
- compass.shapeImageToPixels(33, viewRotation, anIntArray1057, 256, anIntArray968, 25, (clientSize == 0 ? 8 : 5)
- + getMapOffsetY(), (clientSize == 0 ? 8 + xPosOffset : clientWidth - 167), 33, 25);
- gameArea.create();
- return;
- }
- int i = viewRotation + minimapRotation & 0x7ff;
- int x_start = 48 + myPlayer.currentX / 32;
- int y_start = 464 - myPlayer.currentY / 32;
- miniMap.shapeImageToPixels(152, i, anIntArray1229, 256 + minimapZoom, anIntArray1052, y_start, (clientSize == 0 ? 9 : 5)
- + getMapOffsetY(), (clientSize == 0 ? 32 + xPosOffset : clientWidth - 162), 152, x_start);
- for (int j5 = 0; j5 < localMapIcons; j5++) {
- int x = (mapIconX[j5] * 4 + 2) - myPlayer.currentX / 32;
- int y = (mapIconY[j5] * 4 + 2) - myPlayer.currentY / 32;
- markMinimap(mapIcons[j5], x, y);
- }
- for (int k5 = 0; k5 < 104; k5++) {
- for (int l5 = 0; l5 < 104; l5++) {
- Deque class19 = groundEntity[plane][k5][l5];
- if (class19 != null) {
- int x = (k5 * 4 + 2) - myPlayer.currentX / 32;
- int y = (l5 * 4 + 2) - myPlayer.currentY / 32;
- markMinimap(mapDotItem, x, y);
- }
- }
- }
- for (int i6 = 0; i6 < npcCount; i6++) {
- NPC npc = npcArray[npcIndices[i6]];
- if (npc != null && npc.isVisible()) {
- NPCDef entityDef = npc.definition;
- if (entityDef.childrenIDs != null) {
- entityDef = entityDef.getChildDefinition();
- }
- if (entityDef != null && entityDef.displayMapIcon && entityDef.clickable) {
- int i1 = npc.currentX / 32 - myPlayer.currentX / 32;
- int k3 = npc.currentY / 32 - myPlayer.currentY / 32;
- markMinimap(mapDotNPC, i1, k3);
- }
- }
- }
- for (int index = 0; index < playerCount; index++) {
- Player player = players[playerIndices[index]];
- if (player != null && player.isVisible()) {
- int x = player.currentX / 32 - myPlayer.currentX / 32;
- int y = player.currentY / 32 - myPlayer.currentY / 32;
- boolean friend = false;
- long name = TextUtils.longForName(player.name);
- for (int k6 = 0; k6 < friendsCount; k6++) {
- if (name != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0) {
- continue;
- }
- friend = true;
- break;
- }
- boolean team = false;
- if (myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team) {
- team = true;
- }
- if (friend) {
- markMinimap(mapDotFriend, x, y);
- } else if (team) {
- markMinimap(mapDotTeam, x, y);
- } else {
- markMinimap(mapDotPlayer, x, y);
- }
- }
- }
- if (anInt855 != 0 && loopCycle % 20 < 10) {
- if (anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
- NPC npc = npcArray[anInt1222];
- if (npc != null) {
- int x = npc.currentX / 32 - myPlayer.currentX / 32;
- int y = npc.currentY / 32 - myPlayer.currentY / 32;
- method81(mapMarker, y, x);
- }
- }
- if (anInt855 == 2) {
- int x = ((anInt934 - baseX) * 4 + 2) - myPlayer.currentX / 32;
- int y = ((anInt935 - baseY) * 4 + 2) - myPlayer.currentY / 32;
- method81(mapMarker, y, x);
- }
- if (anInt855 == 10 && anInt933 >= 0 && anInt933 < players.length) {
- Player player = players[anInt933];
- if (player != null) {
- int x = player.currentX / 32 - myPlayer.currentX / 32;
- int y = player.currentY / 32 - myPlayer.currentY / 32;
- method81(mapMarker, y, x);
- }
- }
- }
- if (destX != 0) {
- int x = (destX * 4 + 2) - myPlayer.currentX / 32;
- int y = (destY * 4 + 2) - myPlayer.currentY / 32;
- markMinimap(mapFlag, x, y);
- }
- DrawingArea.drawFilledPixels((clientSize == 0 ? 107 + xPosOffset : clientWidth - 88), (clientSize == 0 ? 84 : 80)
- + getMapOffsetY(), 3, 3, 0xffffff);
- if (clientSize == 0) {
- mapImage.drawImage(0, 0);
- } else {
- cacheSprite[36].drawImage(clientWidth - 167, 0);
- cacheSprite[37].drawImage(clientWidth - 172, 0);
- }
- if (revision > 474) {
- cacheSprite[38].drawImage(clientSize == 0 ? -3 : clientWidth - 217, clientSize == 0 ? 46 : 3);
- if (hoverPos == 0) {
- cacheSprite[39].drawImage(clientSize == 0 ? -3 : clientWidth - 217, clientSize == 0 ? 46 : 3);
- }
- }
- drawOrbs();
- compass.shapeImageToPixels(33, viewRotation, anIntArray1057, 256, anIntArray968, 25, (clientSize == 0 ? 8 : 5)
- + getMapOffsetY(), (clientSize == 0 ? 8 + xPosOffset : clientWidth - 167), 33, 25);
- }
- cacheSprite[30].drawImage((clientSize == 0 ? 246 : clientWidth) - 21, 0);
- cacheSprite[96].drawImage((clientSize == 0 ? 225 : clientWidth - 21) - 21, 0);
- if (mouseInRegion(clientWidth - 42, clientWidth - 21, 0, 21)) {
- cacheSprite[97].drawImage((clientSize == 0 ? 225 : clientWidth - 21) - 21, 0);
- }
- boolean logoutHover = mouseInRegion(clientWidth - 20, clientWidth, 0, 21);
- if (tabHover != -1) {
- if (logoutHover) {
- cacheSprite[34].drawImage((clientSize == 0 ? 246 : clientWidth) - 21, 0);
- }
- }
- if (tabInterfaceIDs[tabID] != -1) {
- if (logoutHover) {
- cacheSprite[35].drawImage((clientSize == 0 ? 246 : clientWidth) - 21, 0);
- }
- }
- if (logoutHover) {
- drawHoverBox("Logout", (clientSize == 0 ? 246 : clientWidth) - 50, 21);
- }
- if (mouseInRegion(clientWidth - 42, clientWidth - 21, 0, 21)) {
- drawHoverBox(isFixed() ? "You can only hide the\nmap in an unfixed mode!" : (showMiniMap ? "Hide" : "Show") + " minimap",
- (clientSize == 0 ? 225 : clientWidth - 21) - 21 - (isFixed() ? 100 : 42), 21);
- }
- if (menuOpen && menuScreenArea == 3) {
- drawMenu();
- }
- gameArea.create();
- }
- private void npcScreenPos(Entity entity, int i) {
- calcEntityScreenPos(entity.currentX, i, entity.currentY);
- }
- private void calcEntityScreenPos(int i, int j, int l) {
- if (i < 128 || l < 128 || i > 13056 || l > 13056) {
- spriteDrawX = -1;
- spriteDrawY = -1;
- return;
- }
- int i1 = method42(plane, l, i) - j;
- i -= xCameraPos;
- i1 -= zCameraPos;
- l -= yCameraPos;
- int j1 = Model.SINE[yCameraCurve];
- int k1 = Model.COSINE[yCameraCurve];
- int l1 = Model.SINE[xCameraCurve];
- int i2 = Model.COSINE[xCameraCurve];
- int j2 = l * l1 + i * i2 >> 16;
- l = l * i2 - i * l1 >> 16;
- i = j2;
- j2 = i1 * k1 - l * j1 >> 16;
- l = i1 * j1 + l * k1 >> 16;
- i1 = j2;
- if (l >= 50) {
- spriteDrawX = Rasterizer.centerX + (i << 9) / l;
- spriteDrawY = Rasterizer.centerY + (i1 << 9) / l;
- } else {
- spriteDrawX = -1;
- spriteDrawY = -1;
- }
- }
- private void buildSplitPrivateChatMenu() {
- if (splitPrivateChat == 0) {
- return;
- }
- int offsetY = 0;
- if (updateTimer != 0) {
- offsetY = 1;
- }
- if (restartTimer != 0) {
- offsetY = 1;
- }
- for (int index = 0; index < 500; index++) {
- if (chatMessages[index] != null) {
- int type = chatTypes[index];
- String name = chatNames[index];
- if (name != null && name.indexOf("@") == 0) {
- int last = name.lastIndexOf('@');
- name = name.substring(last + 1);
- }
- if ((type == 3 || type == 7) && (type == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(name))) {
- int positionY = (clientHeight - 174) - offsetY * 13;
- if (super.getMouseX() > (clientSize == 0 ? 4 : 0) && super.getMouseY() - (clientSize == 0 ? 4 : 0) > positionY - 10
- && super.getMouseY() - (clientSize == 0 ? 4 : 0) <= positionY + 3) {
- int i1 = normalFont.getTextWidth("From: " + name + chatMessages[index]) + 25;
- if (i1 > 450) {
- i1 = 450;
- }
- if (super.getMouseX() < (clientSize == 0 ? 4 : 0) + i1) {
- if (!isFriendOrSelf(name)) {
- menuActionName[menuActionRow] = "Add ignore @whi@" + name;
- menuActionID[menuActionRow] = 2042;
- menuActionRow++;
- menuActionName[menuActionRow] = "Add friend @whi@" + name;
- menuActionID[menuActionRow] = 2337;
- menuActionRow++;
- if (isServerSupport()) {
- menuActionName[menuActionRow] = "Mute @whi@" + name;
- menuActionID[menuActionRow] = 942;
- menuActionRow++;
- menuActionName[menuActionRow] = "Un Mute @whi@" + name;
- menuActionID[menuActionRow] = 943;
- menuActionRow++;
- menuActionName[menuActionRow] = "Kick @whi@" + name;
- menuActionID[menuActionRow] = 944;
- menuActionRow++;
- menuActionName[menuActionRow] = "Teleport to @whi@" + name;
- menuActionID[menuActionRow] = 945;
- menuActionRow++;
- menuActionName[menuActionRow] = "Teleport to me @whi@" + name;
- menuActionID[menuActionRow] = 946;
- menuActionRow++;
- }
- if (isModerator() || isHeadModerator() || isAdministrator()) {
- menuActionName[menuActionRow] = "Mute @whi@" + name;
- menuActionID[menuActionRow] = 942;
- menuActionRow++;
- menuActionName[menuActionRow] = "Un Mute @whi@" + name;
- menuActionID[menuActionRow] = 943;
- menuActionRow++;
- menuActionName[menuActionRow] = "Kick @whi@" + name;
- menuActionID[menuActionRow] = 944;
- menuActionRow++;
- menuActionName[menuActionRow] = "Teleport to @whi@" + name;
- menuActionID[menuActionRow] = 945;
- menuActionRow++;
- menuActionName[menuActionRow] = "Teleport to me @whi@" + name;
- menuActionID[menuActionRow] = 946;
- menuActionRow++;
- menuActionName[menuActionRow] = "Ban @whi@" + name;
- menuActionID[menuActionRow] = 947;
- menuActionRow++;
- menuActionName[menuActionRow] = "Mac Ban @whi@" + name;
- menuActionID[menuActionRow] = 948;
- menuActionRow++;
- menuActionName[menuActionRow] = "Mac Mute @whi@" + name;
- menuActionID[menuActionRow] = 949;
- menuActionRow++;
- menuActionName[menuActionRow] = "Un Mac Mute @whi@" + name;
- menuActionID[menuActionRow] = 950;
- menuActionRow++;
- }
- }
- if (isFriendOrSelf(name)) {
- menuActionName[menuActionRow] = "Message @whi@" + name;
- menuActionID[menuActionRow] = 2639;
- menuActionRow++;
- if (isServerSupport()) {
- menuActionName[menuActionRow] = "Mute @whi@" + name;
- menuActionID[menuActionRow] = 942;
- menuActionRow++;
- menuActionName[menuActionRow] = "Un Mute @whi@" + name;
- menuActionID[menuActionRow] = 943;
- menuActionRow++;
- menuActionName[menuActionRow] = "Kick @whi@" + name;
- menuActionID[menuActionRow] = 944;
- menuActionRow++;
- menuActionName[menuActionRow] = "Teleport to @whi@" + name;
- menuActionID[menuActionRow] = 945;
- menuActionRow++;
- menuActionName[menuActionRow] = "Teleport to me @whi@" + name;
- menuActionID[menuActionRow] = 946;
- menuActionRow++;
- }
- if (isModerator() || isHeadModerator() || isAdministrator()) {
- menuActionName[menuActionRow] = "Mute @whi@" + name;
- menuActionID[menuActionRow] = 942;
- menuActionRow++;
- menuActionName[menuActionRow] = "Un Mute @whi@" + name;
- menuActionID[menuActionRow] = 943;
- menuActionRow++;
- menuActionName[menuActionRow] = "Kick @whi@" + name;
- menuActionID[menuActionRow] = 944;
- menuActionRow++;
- menuActionName[menuActionRow] = "Teleport to @whi@" + name;
- menuActionID[menuActionRow] = 945;
- menuActionRow++;
- menuActionName[menuActionRow] = "Teleport to me @whi@" + name;
- menuActionID[menuActionRow] = 946;
- menuActionRow++;
- menuActionName[menuActionRow] = "Ban @whi@" + name;
- menuActionID[menuActionRow] = 947;
- menuActionRow++;
- menuActionName[menuActionRow] = "Mac Ban @whi@" + name;
- menuActionID[menuActionRow] = 948;
- menuActionRow++;
- menuActionName[menuActionRow] = "Mac Mute @whi@" + name;
- menuActionID[menuActionRow] = 949;
- menuActionRow++;
- menuActionName[menuActionRow] = "Un Mac Mute @whi@" + name;
- menuActionID[menuActionRow] = 950;
- menuActionRow++;
- }
- }
- }
- }
- if (offsetY++ >= 5) {
- return;
- }
- }
- if ((type == 5 || type == 6) && privateChatMode < 2 && offsetY++ >= 5) {
- return;
- }
- }
- }
- }
- private void spawnGameObject(int priority1, int objectId, int rotation, int objectClassType, int regionY, int objectType, int height,
- int regionX, int priority2) {
- Class30_Sub1 class30_sub1 = null;
- for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179.head(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
- .next()) {
- if (class30_sub1_1.anInt1295 != height || class30_sub1_1.anInt1297 != regionX || class30_sub1_1.anInt1298 != regionY
- || class30_sub1_1.anInt1296 != objectClassType) {
- continue;
- }
- class30_sub1 = class30_sub1_1;
- break;
- }
- if (class30_sub1 == null) {
- class30_sub1 = new Class30_Sub1();
- class30_sub1.anInt1295 = height;
- class30_sub1.anInt1296 = objectClassType;
- class30_sub1.anInt1297 = regionX;
- class30_sub1.anInt1298 = regionY;
- method89(class30_sub1);
- aClass19_1179.append(class30_sub1);
- }
- class30_sub1.anInt1291 = objectId;
- class30_sub1.anInt1293 = objectType;
- class30_sub1.anInt1292 = rotation;
- class30_sub1.anInt1302 = priority2;
- class30_sub1.anInt1294 = priority1;
- }
- private boolean interfaceIsSelected(RSInterface rsi) {
- if (rsi.valueCompareType == null) {
- return false;
- }
- for (int i = 0; i < rsi.valueCompareType.length; i++) {
- int j = extractInterfaceValues(rsi, i);
- int k = rsi.requiredValue[i];
- if (rsi.valueCompareType[i] == 2) {
- if (j >= k) {
- return false;
- }
- } else if (rsi.valueCompareType[i] == 3) {
- if (j <= k) {
- return false;
- }
- } else if (rsi.valueCompareType[i] == 4) {
- if (j == k) {
- return false;
- }
- } else if (j != k) {
- return false;
- }
- }
- return true;
- }
- private DataInputStream getJAGGrabStream(String s) throws IOException {
- if (jagGrab != null) {
- try {
- jagGrab.close();
- } catch (Exception e) {
- }
- jagGrab = null;
- }
- jagGrab = openSocket(5555);
- jagGrab.setSoTimeout(10000);
- InputStream input = jagGrab.getInputStream();
- OutputStream output = jagGrab.getOutputStream();
- output.write(("JAGGRAB /" + s + "=" + getRevision().ordinal() + "\n\n").getBytes());
- return new DataInputStream(input);
- }
- public int loadingFileRemaining;
- public void drawLoadingText() {
- int draw_x = 250;
- int draw_y = 160;
- if (clientSize != 0) {
- draw_x = (clientWidth / 2);
- draw_y = (clientHeight / 2) - 20;
- }
- boldFont.drawText(0, "Loading - please wait.", draw_y + 1, draw_x + 1);
- boldFont.drawText(0xffffff, "Loading - please wait.", draw_y, draw_x);
- }
- private void updateOtherClientMovements(JagexBuffer stream) {
- int local_player_amount = stream.getBits(8);
- if (local_player_amount < playerCount) {
- for (int k = local_player_amount; k < playerCount; k++) {
- anIntArray840[anInt839++] = playerIndices[k];
- }
- }
- playerCount = 0;
- for (int l = 0; l < local_player_amount; l++) {
- int i1 = playerIndices[l];
- Player player = players[i1];
- int j1 = stream.getBits(1);
- if (j1 == 0) {
- playerIndices[playerCount++] = i1;
- player.time = loopCycle;
- } else {
- int k1 = stream.getBits(2);
- if (k1 == 0) {
- playerIndices[playerCount++] = i1;
- player.time = loopCycle;
- localPlayers[localPlayersIndex++] = i1;
- } else if (k1 == 1) {
- playerIndices[playerCount++] = i1;
- player.time = loopCycle;
- int l1 = stream.getBits(3);
- player.move(false, l1);
- int j2 = stream.getBits(1);
- if (j2 == 1) {
- localPlayers[localPlayersIndex++] = i1;
- }
- } else if (k1 == 2) {
- playerIndices[playerCount++] = i1;
- player.time = loopCycle;
- int i2 = stream.getBits(3);
- player.move(true, i2);
- int k2 = stream.getBits(3);
- player.move(true, k2);
- int l2 = stream.getBits(1);
- if (l2 == 1) {
- localPlayers[localPlayersIndex++] = i1;
- }
- } else if (k1 == 3) {
- anIntArray840[anInt839++] = i1;
- }
- }
- }
- }
- public boolean mouseInRegion(int x1, int x2, int y1, int y2) {
- if (super.getMouseX() >= x1 && super.getMouseX() <= x2 && super.getMouseY() >= y1 && super.getMouseY() <= y2) {
- return true;
- }
- return false;
- }
- public boolean clickInRegion(int x1, int x2, int y1, int y2) {
- if (super.getClickX() >= x1 && super.getClickX() <= x2 && super.getClickY() >= y1 && super.getClickY() <= y2) {
- return true;
- }
- return false;
- }
- public int[] regionIds = new int[6];
- public void loadMap(int x, int y) {
- mapX = x;
- mapY = y;
- builtSecondaryRegion = false;
- if (localX == x && localY == y && loadingStage == 2) {
- return;
- }
- localX = x;
- localY = y;
- baseX = (localX - 6) * 8;
- baseY = (localY - 6) * 8;
- aBoolean1141 = (localX / 8 == 48 || localX / 8 == 49) && localY / 8 == 48;
- if (localX / 8 == 48 && localY / 8 == 148) {
- aBoolean1141 = true;
- }
- loadingStage = 1;
- loadStageDelay = System.currentTimeMillis();
- int mapIndex = 0;
- for (int i21 = (localX - 6) / 8; i21 <= (localX + 6) / 8; i21++) {
- for (int k23 = (localY - 6) / 8; k23 <= (localY + 6) / 8; k23++) {
- mapIndex++;
- }
- }
- aByteArrayArray1183 = new byte[mapIndex][];
- aByteArrayArray1247 = new byte[mapIndex][];
- mapLocation = new int[mapIndex];
- mapTerrains = new int[mapIndex];
- mapLandscapes = new int[mapIndex];
- regionIds = new int[mapIndex];
- mapIndex = 0;
- for (int regionX = (localX - 6) / 8; regionX <= (localX + 6) / 8; regionX++) {
- for (int regionY = (localY - 6) / 8; regionY <= (localY + 6) / 8; regionY++) {
- mapLocation[mapIndex] = (regionX << 8) + regionY;
- if (aBoolean1141 && (regionY == 49 || regionY == 149 || regionY == 147 || regionX == 50 || regionX == 49 && regionY == 47)) {
- mapTerrains[mapIndex] = -1;
- mapLandscapes[mapIndex] = -1;
- mapIndex++;
- } else {
- int floorId = mapTerrains[mapIndex] = onDemandFetcher.getId(0, regionY, regionX);
- if (floorId != -1) {
- onDemandFetcher.loadMandatory(3, floorId);
- }
- int objectId = mapLandscapes[mapIndex] = onDemandFetcher.getId(1, regionY, regionX);
- if (objectId != -1) {
- onDemandFetcher.loadMandatory(3, objectId);
- }
- regionIds[mapIndex] = onDemandFetcher.getId(3, regionY, regionX);
- mapIndex++;
- }
- }
- }
- int i17 = baseX - anInt1036;
- int j21 = baseY - anInt1037;
- anInt1036 = baseX;
- anInt1037 = baseY;
- for (int j24 = 0; j24 < 16384; j24++) {
- NPC npc = npcArray[j24];
- if (npc != null) {
- for (int j29 = 0; j29 < 10; j29++) {
- npc.pathX[j29] -= i17;
- npc.pathY[j29] -= j21;
- }
- npc.currentX -= i17 * 128;
- npc.currentY -= j21 * 128;
- }
- }
- for (int i27 = 0; i27 < maxPlayers; i27++) {
- Player player = players[i27];
- if (player != null) {
- for (int i31 = 0; i31 < 10; i31++) {
- player.pathX[i31] -= i17;
- player.pathY[i31] -= j21;
- }
- player.currentX -= i17 * 128;
- player.currentY -= j21 * 128;
- }
- }
- aBoolean1080 = true;
- byte byte1 = 0;
- byte byte2 = 104;
- byte byte3 = 1;
- if (i17 < 0) {
- byte1 = 103;
- byte2 = -1;
- byte3 = -1;
- }
- byte byte4 = 0;
- byte byte5 = 104;
- byte byte6 = 1;
- if (j21 < 0) {
- byte4 = 103;
- byte5 = -1;
- byte6 = -1;
- }
- for (int k33 = byte1; k33 != byte2; k33 += byte3) {
- for (int l33 = byte4; l33 != byte5; l33 += byte6) {
- int i34 = k33 + i17;
- int j34 = l33 + j21;
- for (int k34 = 0; k34 < 4; k34++) {
- if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104) {
- groundEntity[k34][k33][l33] = groundEntity[k34][i34][j34];
- } else {
- groundEntity[k34][k33][l33] = null;
- }
- }
- }
- }
- for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179.head(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
- .next()) {
- class30_sub1_1.anInt1297 -= i17;
- class30_sub1_1.anInt1298 -= j21;
- if (class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104
- || class30_sub1_1.anInt1298 >= 104) {
- class30_sub1_1.remove();
- }
- }
- if (destX != 0) {
- destX -= i17;
- destY -= j21;
- }
- cameraMovement = false;
- }
- public ScriptManager scriptManager;
- public int getRegionId() {
- int localX = this.localX / 8;
- int localY = this.localY / 8;
- int id = (localX << 8) + localY;
- return id;
- }
- public void resetMap() {
- currentSound = 0;
- setNorth();
- minimapState = 0;
- loadingStage = 1;
- }
- public void resetLast() {
- aBoolean1080 = false;
- }
- @SuppressWarnings("unused")
- private void startWorld(boolean isNull) {
- xCameraPos = 6100;
- yCameraPos = 6867;
- zCameraPos = -750;
- xCameraCurve = 2040;
- yCameraCurve = 383;
- resetMap();
- if (isNull || scriptManager == null) {
- scriptManager = new ScriptManager(this);
- } else {
- scriptManager.update();
- }
- plane = scriptManager.mapZ;
- loadMap(scriptManager.mapX, scriptManager.mapY);
- resetLast();
- }
- public void setNorth() {
- cameraOffsetX = 0;
- cameraOffsetY = 0;
- viewRotationOffset = 0;
- viewRotation = 0;
- minimapRotation = 0;
- minimapZoom = 0;
- }
- public int[] titleScreenOffsets = null;
- public int titleWidth = -1;
- public int titleHeight = -1;
- public final int LOGIN = 0;
- public final int CREATE = 1;
- public final int RECOVER = 2;
- public int[] alpha = { 0, 0, 0, 0, 0, 0 };
- public boolean[] increasing = { false, false, false, false, false, false };
- public int optionsHeight = 25;
- public int[] optionsAlpha = { 0, 0, 0, 0, 0 };
- public int[] linkColor = { 0xffffff, 0xffff00 };
- public int accountsX = 0;
- public int messageX = 0;
- public int messageY = 0;
- public int messageWidth = 0;
- public int messageHeight = 0;
- public int messageAlpha = 0;
- public int titleHover = -1;
- public int screenHover = -1;
- public int detailHover = -1;
- public int accountHover = -1;
- public int editHover = -1;
- public boolean editAccounts = false;
- public int bannerAlpha = 0;
- /**
- * Handles the "glowing" of images on the title screen.
- *
- * @param position
- */
- public void handleGlow(int position) {
- int x = (getClientWidth() / 2) - (box[0].myWidth / 2);
- int y = (getClientHeight() / 2) - (box[0].myHeight / 2);
- int[] rate = new int[] { 24, 8 };
- if (position == 0) {
- if (mouseInRegion(x + 308, x + 308 + play.myWidth, y + 62, y + 62 + play.myHeight)) {
- alpha[0] += alpha[0] < 256 ? rate[0] : 0;
- } else {
- alpha[0] -= alpha[0] > 0 ? rate[0] : 0;
- }
- play_hover.drawARGBImage(x + 308, y + 62, alpha[0]);
- } else if (position == 1) {
- int max = 100;
- int inputrate = 2;
- if (alpha[loginScreenCursorPos + 2] < max && increasing[loginScreenCursorPos + 2]) {
- alpha[loginScreenCursorPos + 2] += inputrate;
- }
- if (alpha[loginScreenCursorPos + 2] == max) {
- increasing[loginScreenCursorPos + 2] = false;
- }
- if (alpha[loginScreenCursorPos + 2] > max) {
- alpha[loginScreenCursorPos + 2] = max;
- }
- if (alpha[loginScreenCursorPos + 2] > 0 && !increasing[loginScreenCursorPos + 2]) {
- alpha[loginScreenCursorPos + 2] -= inputrate;
- }
- if (alpha[loginScreenCursorPos + 2] <= 0) {
- increasing[loginScreenCursorPos + 2] = true;
- alpha[loginScreenCursorPos + 2] = 0;
- }
- int inputX = (getClientWidth() / 2) - (input.myWidth / 2);
- DrawingArea.drawFilledPixels(inputX, y + 63 + (loginScreenCursorPos == 0 ? 0 : 52), input.myWidth, input.myHeight, 0,
- alpha[loginScreenCursorPos + 2]);
- } else if (position == 2) {
- int index = 4;
- if (alpha[index] < 256 && increasing[index]) {
- alpha[index] += rate[1];
- }
- if (alpha[index] == 256) {
- increasing[index] = false;
- }
- if (alpha[index] > 0 && !increasing[index]) {
- alpha[index] -= rate[1];
- }
- if (alpha[index] <= 0) {
- increasing[index] = true;
- alpha[index] = 0;
- }
- int formY = (getClientHeight() / 2) - (box[1].myHeight / 2);
- if (getCreate().canCreate()) {
- header_glow.drawARGBImage(x + 69, formY, alpha[index]);
- arial[0].drawStringCenter("(click here)", x + 150, formY + 33, 0xffffff, true);
- }
- } else if (position == 3) {
- int index = 5;
- if (alpha[index] < 256 && increasing[index]) {
- alpha[index] += rate[1];
- }
- if (alpha[index] == 256) {
- increasing[index] = false;
- }
- if (alpha[index] > 0 && !increasing[index]) {
- alpha[index] -= rate[1];
- }
- if (alpha[index] <= 0) {
- increasing[index] = true;
- alpha[index] = 0;
- }
- if (getRecovery().canRecover()) {
- header_glow.drawARGBImage(x + 69, y, alpha[index]);
- arial[0].drawStringCenter("(click here)", x + 150, y + 33, 0xffffff, true);
- }
- }
- }
- /**
- * Displays the client options tab and the client options.
- */
- public void displayOptions() {
- int x = (getClientWidth() / 2) - (box[0].myWidth / 2);
- int y = (getClientHeight() / 2) - (box[0].myHeight / 2);
- int min = 25;
- int max = 150;
- if (titleHover == 1) {
- if (optionsHeight < max) {
- optionsHeight += 7;
- }
- if (optionsHeight > max) {
- optionsHeight = max;
- }
- } else {
- if (optionsHeight > min) {
- optionsHeight -= 7;
- }
- if (optionsHeight < min) {
- optionsHeight = min;
- }
- }
- DrawingArea.drawRoundedRectangle(x + 20, y + 180, 322, optionsHeight, 0xFFFFFF, 50, true, false);
- DrawingArea.drawRoundedRectangle(x + 20, y + 180, 322, optionsHeight, 0xFFFFFF, 50, false, false);
- arial[2].drawStringCenter("Client Options", x + 20 + (322 / 2), y + 197, 0xffffff, true);
- if (optionsHeight == max) {
- int[] screen_x = { x + (322 / 2) - 45, x + 20 + (322 / 2), x + 85 + (322 / 2) };
- if (screenHover != -1) {
- optionsAlpha[screenHover] += optionsAlpha[screenHover] < 256 ? 24 : 0;
- } else {
- optionsAlpha[0] -= optionsAlpha[0] > 0 ? 24 : 0;
- optionsAlpha[1] -= optionsAlpha[1] > 0 ? 24 : 0;
- optionsAlpha[2] -= optionsAlpha[2] > 0 ? 24 : 0;
- }
- for (int index = 0; index <= 2; index++) {
- screen_dull[index].drawCenteredImage(screen_x[index], y + 226);
- screen_selected[index].drawCenteredImage(screen_x[index], y + 226, optionsAlpha[index]);
- }
- screen_selected[clientSize].drawCenteredImage(screen_x[clientSize], y + 226);
- int[] detail_x = { x + 85, x + 200 };
- if (detailHover != -1) {
- optionsAlpha[detailHover + 3] += optionsAlpha[detailHover + 3] < 256 ? 24 : 0;
- } else {
- optionsAlpha[3] -= optionsAlpha[3] > 0 ? 24 : 0;
- optionsAlpha[4] -= optionsAlpha[4] > 0 ? 24 : 0;
- }
- detail_dull[0].drawARGBImage(detail_x[0], y + 260);
- detail_dull[1].drawARGBImage(detail_x[1], y + 260);
- detail_hover[0].drawARGBImage(detail_x[0], y + 260, optionsAlpha[3]);
- detail_hover[1].drawARGBImage(detail_x[1], y + 260, optionsAlpha[4]);
- int detail = lowMemory ? 0 : 1;
- detail_selected[detail].drawARGBImage(detail_x[detail], y + 260);
- }
- }
- public int accountsWidth = 250;
- /**
- * Displays the accounts tab and the list of accounts.
- */
- public void displayAccounts() {
- int x = (getClientWidth() / 2) - (box[0].myWidth / 2) + 5;
- int y = (getClientHeight() / 2) - (box[0].myHeight / 2) + 25;
- int min = 0;
- int max = 125;
- if (titleHover == 2) {
- if (accountsX < max) {
- accountsX += 7;
- }
- if (accountsX > max) {
- accountsX = max;
- }
- } else {
- if (accountsX > min) {
- accountsX -= 7;
- }
- if (accountsX < min) {
- accountsX = min;
- }
- }
- accountsWidth = accountsX + 15;
- int width = accountsWidth + 9;
- accountbox.cutImage(box[2], width, accountbox.myHeight);
- if (accountbox != null) {
- accountbox.drawARGBImage(x - 9 - accountsX, y - 9);
- }
- if (accountsX == max) {
- arial[1].drawString("Accounts (" + AccountHandler.getAccounts().size() + " / 6) " + (editAccounts ? "[finish]" : "[edit]"), x
- - accountsX + 5, y + 15, editHover == 0 ? 0xffff00 : 0xffffff, true);
- int text_x = x - accountsX + 72;
- int text_y = y + 35;
- if (AccountHandler.accounts != null) {
- for (int index = 0; index < 6; index++, text_y += 17) {
- if (index >= AccountHandler.getAccounts().size())
- break;
- Account account = AccountHandler.getAccounts().get(index);
- if (account != null) {
- arial[1].drawStringCenter(account.name + " (" + account.uses + " use" + (account.uses > 1 ? "s" : "") + ")"
- + (editAccounts ? " [x]" : ""), text_x, text_y,
- accountHover == index ? (editAccounts ? 0xff0000 : 0xffff00) : 0xffffff, true);
- }
- }
- }
- }
- }
- /**
- * Displays the login messages (errors, problems, missing info, etc).
- */
- public void displayMessages() {
- int width = 300;
- int height = 50;
- int x = (getClientWidth() / 2) - (width / 2);
- int y = (getClientHeight() / 2) - (height / 2);
- int center_x = (getClientWidth() / 2);
- int center_y = (getClientHeight() / 2);
- int alpha_rate = 10;
- int alpha_max = 100;
- int x_max = (width / 2);
- int y_max = (height / 2);
- DrawingArea.drawFilledPixels(0, 0, getClientWidth(), getClientHeight(), 0, messageAlpha * 2);
- DrawingArea.drawRoundedRectangle(center_x - messageX, center_y - messageY, messageWidth, messageHeight, 0xFFFFFF, messageAlpha,
- true, false);
- DrawingArea.drawRoundedRectangle(center_x - messageX, center_y - messageY, messageWidth, messageHeight, 0xFFFFFF, messageAlpha,
- false, false);
- if (loginMessage1.length() > 0 || loginMessage2.length() > 0) {
- if (messageAlpha < alpha_max) {
- messageAlpha += alpha_rate;
- }
- if (messageAlpha > alpha_max) {
- messageAlpha = alpha_max;
- }
- if (messageX < x_max) {
- messageX += 10;
- }
- if (messageY < y_max) {
- messageY += 5;
- }
- if (messageWidth < width) {
- messageWidth += 20;
- }
- if (messageHeight < height) {
- messageHeight += 5;
- }
- if (messageAlpha == alpha_max) {
- close[titleHover == 3 ? 1 : 0].drawImage(x + width - 16, y);
- if (loginMessage2.length() > 0) {
- arial[2].drawStringCenter(loginMessage1, center_x, center_y - 3, 0xffffff, true);
- arial[2].drawStringCenter(loginMessage2, center_x, center_y + 12, 0xffffff, true);
- } else {
- arial[2].drawStringCenter(loginMessage1, center_x, center_y + 5, 0xffffff, true);
- }
- }
- } else {
- if (messageAlpha > 0) {
- messageAlpha -= alpha_rate;
- }
- if (messageAlpha < 0) {
- messageAlpha = 0;
- }
- if (messageX > 0) {
- messageX -= 10;
- }
- if (messageY > 0) {
- messageY -= 5;
- }
- if (messageWidth > 0) {
- messageWidth -= 20;
- }
- if (messageHeight > 0) {
- messageHeight -= 5;
- }
- }
- }
- public RealFont[] arial = { new RealFont(this, "Arial", 0, 10, true), new RealFont(this, "Arial", 0, 12, true),
- new RealFont(this, "Arial", 0, 14, true), new RealFont(this, "Arial", 1, 14, true) };
- int[] backgroundColors = { 0xFF00FF, 0x00FF00, 0xFF0000, 0x0000FF, 0xFFFF00, 0xFFF000, 0x0F0F0F };
- int[] backgroundAlpha;
- boolean[] backgroundDrawing;
- boolean[] alphaIncreasing;
- public void resetBackground() {
- backgroundAlpha = new int[backgroundColors.length];
- backgroundDrawing = new boolean[backgroundColors.length];
- alphaIncreasing = new boolean[backgroundColors.length];
- for (int index = 0; index < backgroundColors.length; index++) {
- backgroundAlpha[index] = 0;
- backgroundDrawing[index] = false;
- alphaIncreasing[index] = true;
- }
- }
- public void displayBackground() {
- int rate = 1;
- int total = backgroundColors.length;
- int index = 0;
- int max = 256;
- for (; index < total; index++) {
- if (backgroundDrawing[index] || index == 0) {
- if (backgroundAlpha[index] < max && alphaIncreasing[index]) {
- backgroundAlpha[index] += rate;
- }
- if (backgroundAlpha[index] == max) {
- alphaIncreasing[index] = false;
- if (index < total - 1) {
- backgroundDrawing[index + 1] = true;
- } else {
- resetBackground();
- index = 0;
- }
- }
- if (backgroundAlpha[index] > 0 && !alphaIncreasing[index]) {
- backgroundAlpha[index] -= rate;
- }
- if (backgroundAlpha[index] <= 0) {
- alphaIncreasing[index] = true;
- backgroundAlpha[index] = 0;
- backgroundDrawing[index] = false;
- }
- DrawingArea.drawFilledPixels(0, 0, getClientWidth(), getClientHeight(), backgroundColors[index], backgroundAlpha[index]);
- }
- }
- }
- @SuppressWarnings("unused")
- private RSImage[] background;
- private RSImage[] greyBackground;
- private RSImage[] fullscreenBackground;
- private RSImage[] fullscreenGreyBackground;
- public int maxLines = 6;
- public int lineCount;
- public RSImage[] lineSegments;
- public int[] lineX;
- public int[] lineY;
- public int[] lineRate;
- public boolean[] reverseMovement;
- public void createLines() {
- lineCount = (maxLines / 2) + Misc.random(maxLines / 2);
- lineSegments = new RSImage[lineCount];
- lineX = new int[lineCount];
- lineY = new int[lineCount];
- lineRate = new int[lineCount];
- reverseMovement = new boolean[lineCount];
- for (int index = 0; index < lineCount; index++) {
- lineRate[index] = -1;
- }
- }
- public void resetLine(int index) {
- int centerY = getClientHeight() / 2;
- lineSegments[index] = lines[0];
- lineX[index] = 0;
- lineY[index] = centerY - 50 + Misc.random(100);
- lineRate[index] = 1 + Misc.random(3);
- reverseMovement[index] = false;
- }
- public void displayLines() {
- for (int index = 0; index < lineCount; index++) {
- if (lineRate[index] == -1) {
- resetLine(index);
- }
- int minX = -(lineSegments[index].myWidth - clientWidth);
- if (lineX[index] <= minX) {
- reverseMovement[index] = true;
- }
- if (lineX[index] >= 0) {
- reverseMovement[index] = false;
- }
- if (!reverseMovement[index] && lineX[index] > minX) {
- lineX[index] -= lineRate[index];
- }
- if (reverseMovement[index] && lineX[index] < 0) {
- lineX[index] += lineRate[index];
- }
- if (lineSegments[index] != null) {
- lineSegments[index].drawARGBImage(lineX[index], lineY[index], 200);
- }
- }
- }
- public int maxDots = 30;
- public int focusCount;
- public RSImage[] focusImage;
- public int[] focusX;
- public int[] focusY;
- public int[] focusRate;
- public int[] focusDeviation;
- public int[] focusCycle;
- public int[] focusHeight;
- public void createFocus() {
- focusCount = (maxDots / 2) + Misc.random(maxDots / 2);
- focusImage = new RSImage[focusCount];
- focusX = new int[focusCount];
- focusY = new int[focusCount];
- focusRate = new int[focusCount];
- focusDeviation = new int[focusCount];
- focusCycle = new int[focusCount];
- focusHeight = new int[focusCount];
- for (int index = 0; index < focusCount; index++) {
- focusRate[index] = -1;
- }
- }
- public void resetFocus(int index) {
- focusImage[index] = focusDots[Misc.random(focusDots.length - 1)];
- focusX[index] = Misc.random(clientWidth);
- focusY[index] = clientHeight + 50 + (Misc.random(100));
- focusRate[index] = 1 + Misc.random(1);
- int random = Misc.random(40);
- focusDeviation[index] = (Misc.random(1) == 0 ? random : -random);
- focusCycle[index] = 0;
- focusHeight[index] = focusImage[index].myHeight;
- }
- public int getFocusX(int index) {
- int limit = focusX[index] + focusDeviation[index];
- int scale = 765 / 40;
- if (focusDeviation[index] != 0) {
- scale = (clientHeight / Math.abs(focusDeviation[index]));
- }
- focusCycle[index]++;
- if (focusDeviation[index] >= 0) {
- if (focusCycle[index] == scale) {
- focusCycle[index] = 0;
- }
- if (focusX[index] < limit && focusCycle[index] == 0) {
- focusX[index] += 1;
- }
- }
- if (focusDeviation[index] < 0) {
- if (focusCycle[index] == scale) {
- focusCycle[index] = 0;
- }
- if (focusX[index] > limit && focusCycle[index] == 0) {
- focusX[index] -= 1;
- }
- }
- return focusX[index];
- }
- public void displayFocus() {
- for (int index = 0; index < focusCount; index++) {
- if (focusRate[index] == -1) {
- resetFocus(index);
- }
- if (focusY[index] > -(focusImage[index].myHeight)) {
- focusY[index] -= focusRate[index];
- } else {
- resetFocus(index);
- }
- if (focusImage[index] != null) {
- focusImage[index].drawARGBImage(getFocusX(index), focusY[index]);
- }
- }
- }
- public boolean showTweet = false;
- public int tweetHeight = 0;
- public String[] tweet;
- public void displayTweet() {
- }
- public void drawDisplayButton() {
- int x = 0;
- int y = clientHeight - display.myHeight;
- if (worldImage != null) {
- worldImage.drawImage(x + 14, y + 14);
- }
- display.drawARGBImage(x, y);
- if (!mouseInRegion(x + 14, x + 114, y + 14, y + 79)) {
- DrawingArea.drawFilledPixels(x + 14, y + 14, 100, 65, 0, 50);
- }
- }
- public boolean newmouseInRegion(int x1, int y1, RSImage drawnSprite) {
- if (super.getMouseX() >= x1 && super.getMouseX() <= x1 + drawnSprite.myWidth && super.getMouseY() >= y1
- && super.getMouseY() <= y1 + drawnSprite.myHeight)
- return true;
- return false;
- }
- public boolean newclickInRegion(int x1, int y1, RSImage drawnSprite) {
- if (super.saveClickX >= x1 && super.saveClickX <= x1 + drawnSprite.myWidth && super.saveClickY >= y1
- && super.saveClickY <= y1 + drawnSprite.myHeight)
- return true;
- return false;
- }
- public static void drawTooltip(int x, int y, String[] text, int info, int colour) {
- if (text != null) {
- int width = 0;
- for (String element : text) {
- if (newRegularFont.getTextWidth(element) > width) {
- width = newRegularFont.getTextWidth(element) + 10;
- }
- }
- int height = (text.length * 15) + 8;
- DrawingArea.drawRoundedRectangle(x, y, width, height, 0, 150, true, false);
- for (int index = 0; index < text.length; index++) {
- newRegularFont.drawBasicString(text[index], x + 5, y + 15 + (15 * index), colour, 0);
- }
- }
- }
- private void processLoginScreenInput() {
- int x = (getClientWidth() / 2) - (RSImageLoader.images[1023].myWidth / 2);
- int y = (getClientHeight() / 2) - (RSImageLoader.images[1023].myHeight / 2);
- if (loginScreenState == LOGIN) {
- if (clickMode2 == 1 && newclickInRegion(x + 85, y + 180, RSImageLoader.images[1027])) {
- loginScreenCursorPos = 0;
- }
- if (clickMode2 == 1 && newclickInRegion(x + 85, y + 250, RSImageLoader.images[1027])) {
- loginScreenCursorPos = 1;
- }
- if (clickMode2 == 1 && newclickInRegion(x + 110, y + 350, RSImageLoader.images[1030])) {
- selectedSlot = 1;
- if (((String) LoginSettings.getSetting("SU1")).equalsIgnoreCase("blank")
- && ((String) LoginSettings.getSetting("SP1")).equalsIgnoreCase("blank")) {
- loginMessage1 = "Player Slot 1 is empty !";
- loginMessage2 = "Type an username and password and then hit Save";
- } else {
- myUsername = ((String) LoginSettings.getSetting("SU1"));
- myPassword = ((String) LoginSettings.getSetting("SP1"));
- loginMessage1 = "You have Loaded in: " + myUsername;
- loginMessage2 = "";
- }
- }
- if (clickMode2 == 1 && newclickInRegion(x + 170, y + 350, RSImageLoader.images[1030])) {
- selectedSlot = 2;
- if (((String) LoginSettings.getSetting("SU2")).equalsIgnoreCase("blank")
- && ((String) LoginSettings.getSetting("SP2")).equalsIgnoreCase("blank")) {
- loginMessage1 = "Player Slot 2 is empty !";
- loginMessage2 = "Type an username and password and then hit Save";
- } else {
- myUsername = ((String) LoginSettings.getSetting("SU2"));
- myPassword = ((String) LoginSettings.getSetting("SP2"));
- loginMessage1 = "You have Loaded in: " + myUsername;
- loginMessage2 = "";
- }
- }
- if (clickMode2 == 1 && newclickInRegion(x + 230, y + 350, RSImageLoader.images[1030])) {
- selectedSlot = 3;
- if (((String) LoginSettings.getSetting("SU3")).equalsIgnoreCase("blank")
- && ((String) LoginSettings.getSetting("SP3")).equalsIgnoreCase("blank")) {
- loginMessage1 = "Player Slot 3 is empty !";
- loginMessage2 = "Type an username and password and then hit Save";
- } else {
- myUsername = ((String) LoginSettings.getSetting("SU3"));
- myPassword = ((String) LoginSettings.getSetting("SP3"));
- loginMessage1 = "You have Loaded in: " + myUsername;
- loginMessage2 = "";
- }
- }
- if (clickMode2 == 1 && newclickInRegion(x + 290, y + 350, RSImageLoader.images[1030])) {
- selectedSlot = 4;
- if (((String) LoginSettings.getSetting("SU4")).equalsIgnoreCase("blank")
- && ((String) LoginSettings.getSetting("SP4")).equalsIgnoreCase("blank")) {
- loginMessage1 = "Player Slot 4 is empty !";
- loginMessage2 = "Type an username and password and then hit Save";
- } else {
- myUsername = ((String) LoginSettings.getSetting("SU4"));
- myPassword = ((String) LoginSettings.getSetting("SP4"));
- loginMessage1 = "You have Loaded in: " + myUsername;
- loginMessage2 = "";
- }
- }
- if (clickMode2 == 1 && newclickInRegion(x + 345, y + 373, RSImageLoader.images[1033])) {
- if (selectedSlot == 1) {
- LoginSettings.changeSetting("SU1", ((String) "blank"));
- LoginSettings.changeSetting("SP1", ((String) "blank"));
- myUsername = "";
- myPassword = "";
- } else if (selectedSlot == 2) {
- LoginSettings.changeSetting("SU2", ((String) "blank"));
- LoginSettings.changeSetting("SP2", ((String) "blank"));
- myUsername = "";
- myPassword = "";
- } else if (selectedSlot == 3) {
- LoginSettings.changeSetting("SU3", ((String) "blank"));
- LoginSettings.changeSetting("SP3", ((String) "blank"));
- myUsername = "";
- myPassword = "";
- } else if (selectedSlot == 4) {
- LoginSettings.changeSetting("SU4", ((String) "blank"));
- LoginSettings.changeSetting("SP4", ((String) "blank"));
- myUsername = "";
- myPassword = "";
- }
- }
- if (clickMode2 == 1 && newclickInRegion(x + 345, y + 350, RSImageLoader.images[1033])) {
- if (selectedSlot == 1) {
- if (myUsername.equals("") && myPassword.equals("")) {
- loginMessage1 = "Enter a User & Pass!";
- loginMessage2 = "";
- } else if (myUsername.equals("")) {
- loginMessage2 = "Enter a Username!";
- loginMessage2 = "";
- } else if (myPassword.equals("")) {
- loginMessage1 = "Enter a Password!";
- loginMessage2 = "";
- } else {
- LoginSettings.changeSetting("SU1", ((String) myUsername));
- LoginSettings.changeSetting("SP1", ((String) myPassword));
- loginMessage1 = "Player Slot 1 has been saved";
- loginMessage2 = "";
- }
- } else if (selectedSlot == 2) {
- if (myUsername.equals("") && myPassword.equals("")) {
- loginMessage1 = "Enter a User & Pass!";
- loginMessage2 = "";
- } else if (myUsername.equals("")) {
- loginMessage2 = "Enter a Username!";
- loginMessage2 = "";
- } else if (myPassword.equals("")) {
- loginMessage1 = "Enter a Password!";
- loginMessage2 = "";
- } else {
- LoginSettings.changeSetting("SU2", ((String) myUsername));
- LoginSettings.changeSetting("SP2", ((String) myPassword));
- loginMessage1 = "Player Slot 2 has been saved";
- loginMessage2 = "";
- }
- } else if (selectedSlot == 3) {
- if (myUsername.equals("") && myPassword.equals("")) {
- loginMessage1 = "Enter a User & Pass!";
- loginMessage2 = "";
- } else if (myUsername.equals("")) {
- loginMessage2 = "Enter a Username!";
- loginMessage2 = "";
- } else if (myPassword.equals("")) {
- loginMessage1 = "Enter a Password!";
- loginMessage2 = "";
- } else {
- LoginSettings.changeSetting("SU3", ((String) myUsername));
- LoginSettings.changeSetting("SP3", ((String) myPassword));
- loginMessage1 = "Player Slot 3 has been saved";
- loginMessage2 = "";
- }
- } else if (selectedSlot == 4) {
- if (myUsername.equals("") && myPassword.equals("")) {
- loginMessage1 = "Enter a User & Pass!";
- loginMessage2 = "";
- } else if (myUsername.equals("")) {
- loginMessage2 = "Enter a Username!";
- loginMessage2 = "";
- } else if (myPassword.equals("")) {
- loginMessage1 = "Enter a Password!";
- loginMessage2 = "";
- } else {
- LoginSettings.changeSetting("SU4", ((String) myUsername));
- LoginSettings.changeSetting("SP4", ((String) myPassword));
- loginMessage1 = "Player Slot 4 has been saved";
- loginMessage2 = "";
- }
- }
- }
- if (checkDetails() && super.clickMode3 == 1 && newclickInRegion(x + 175, y + 290, RSImageLoader.images[1025])) {
- getCreate().created = false;
- loginFailures = 0;
- login(getUsername(), myPassword, false, false);
- if (loggedIn) {
- return;
- }
- }
- do {
- int key = readCharacter();
- if (key == -1) {
- break;
- }
- boolean validKey = false;
- for (int index = 0; index < validUserPassChars.length(); index++) {
- if (key != validUserPassChars.charAt(index)) {
- continue;
- }
- validKey = true;
- break;
- }
- if (loginScreenCursorPos == 0) {
- if (key == 8 && getUsername().length() > 0) {
- setUsername(myUsername.substring(0, myUsername.length() - 1));
- }
- if (key == 9 || key == 10 || key == 13) {
- loginScreenCursorPos = 1;
- }
- if (validKey) {
- setUsername(myUsername + (char) key);
- }
- if (getUsername().length() > 12) {
- setUsername(myUsername.substring(0, 12));
- }
- } else if (loginScreenCursorPos == 1) {
- if (key == 8 && myPassword.length() > 0) {
- myPassword = myPassword.substring(0, myPassword.length() - 1);
- }
- if (key == 9) {
- loginScreenCursorPos = 0;
- }
- if (key == 10 || key == 13) {
- getCreate().created = false;
- loginFailures = 0;
- login(getUsername(), myPassword, false, false);
- if (loggedIn) {
- return;
- }
- }
- if (validKey) {
- myPassword += (char) key;
- }
- if (myPassword.length() > 20) {
- myPassword = myPassword.substring(0, 20);
- }
- }
- } while (true);
- return;
- }
- }
- public int selectedSlot;
- public boolean rsStatus;
- private void displayTitleScreen(boolean hideButtons) {
- int x = (getClientWidth() / 2) - (RSImageLoader.images[1023].myWidth / 2);
- int y = (getClientHeight() / 2) - (RSImageLoader.images[1023].myHeight / 2);
- int centerX = getClientWidth() / 2;
- @SuppressWarnings("unused")
- int centerY = getClientHeight() / 2;
- resetImageProducers();
- title.create();
- if (loginScreenState == LOGIN) {
- RSImageLoader.images[981].drawARGBImage(0, 0);
- RSImageLoader.images[1023].drawAdvancedSprite(x - 15, y);
- RSImageLoader.images[1027].drawHoverSprite(x + 85, y + 180, RSImageLoader.images[1028]); // User Feild
- RSImageLoader.images[1027].drawTooltip(x + 85, y + 180, RSImageLoader.images[1028], new String[] { "Enter Your Username" },
- 0xF3B13F); // User Tooltip
- RSImageLoader.images[1027].drawHoverSprite(x + 85, y + 250, RSImageLoader.images[1028]); // Password Feild
- RSImageLoader.images[1027].drawTooltip(x + 85, y + 250, RSImageLoader.images[1028], new String[] { "Enter Your Passoword" },
- 0xF3B13F); // Password Tooltip
- RSImageLoader.images[1025].drawHoverSprite(x + 170, y + 290, RSImageLoader.images[1026]); // Login Box Feild
- RSImageLoader.images[1029].drawHoverSprite(x + 110, y + 350, RSImageLoader.images[1030]); // Head 1
- RSImageLoader.images[1029].drawHoverSprite(x + 170, y + 350, RSImageLoader.images[1030]); // Head 2
- RSImageLoader.images[1029].drawHoverSprite(x + 230, y + 350, RSImageLoader.images[1030]); // Head 3
- RSImageLoader.images[1029].drawHoverSprite(x + 290, y + 350, RSImageLoader.images[1030]); // Head 4
- String Name1;
- String Name2;
- String Name3;
- String Name4;
- if (((String) LoginSettings.getSetting("SU1")).equalsIgnoreCase("blank")
- && ((String) LoginSettings.getSetting("SP1")).equalsIgnoreCase("blank")) {
- Name1 = "This Account Slot is Empty";
- } else {
- Name1 = ((String) LoginSettings.getSetting("SU1"));
- }
- if (((String) LoginSettings.getSetting("SU2")).equalsIgnoreCase("blank")
- && ((String) LoginSettings.getSetting("SP2")).equalsIgnoreCase("blank")) {
- Name2 = "This Account Slot is Empty";
- } else {
- Name2 = ((String) LoginSettings.getSetting("SU2"));
- }
- if (((String) LoginSettings.getSetting("SU3")).equalsIgnoreCase("blank")
- && ((String) LoginSettings.getSetting("SP3")).equalsIgnoreCase("blank")) {
- Name3 = "This Account Slot is Empty";
- } else {
- Name3 = ((String) LoginSettings.getSetting("SU3"));
- }
- if (((String) LoginSettings.getSetting("SU4")).equalsIgnoreCase("blank")
- && ((String) LoginSettings.getSetting("SP4")).equalsIgnoreCase("blank")) {
- Name4 = "This Account Slot is Empty";
- } else {
- Name4 = ((String) LoginSettings.getSetting("SU4"));
- }
- RSImageLoader.images[1029].drawTooltip(x + 110, y + 350, RSImageLoader.images[1029], new String[] { "Username: " + Name1 },
- 0xF3B13F); // Head 1
- RSImageLoader.images[1029].drawTooltip(x + 170, y + 350, RSImageLoader.images[1029], new String[] { "Username: " + Name2 },
- 0xF3B13F); // Head 2
- RSImageLoader.images[1029].drawTooltip(x + 230, y + 350, RSImageLoader.images[1029], new String[] { "Username: " + Name3 },
- 0xF3B13F); // Head 3
- RSImageLoader.images[1029].drawTooltip(x + 290, y + 350, RSImageLoader.images[1029], new String[] { "Username: " + Name4 },
- 0xF3B13F); // Head 4
- RSImageLoader.images[1033].drawHoverSprite(x + 345, y + 350, RSImageLoader.images[1034]); // Save
- RSImageLoader.images[1031].drawHoverSprite(x + 347, y + 370, RSImageLoader.images[1032]); // Trash
- RSImageLoader.images[1033].drawTooltip(x + 345, y + 350, RSImageLoader.images[1033],
- new String[] { "Save your info in the Selected Slot" }, 0xF3B13F); // Save Button
- RSImageLoader.images[1033].drawTooltip(x + 345, y + 373, RSImageLoader.images[1033],
- new String[] { "Delete your player infomation" }, 0xF3B13F); // Delete Button
- if (selectedSlot == 1) {
- RSImageLoader.images[1030].drawAdvancedSprite(x + 110, y + 350);
- }
- if (selectedSlot == 2) {
- RSImageLoader.images[1030].drawAdvancedSprite(x + 170, y + 350);
- }
- if (selectedSlot == 3) {
- RSImageLoader.images[1030].drawAdvancedSprite(x + 230, y + 350);
- }
- if (selectedSlot == 4) {
- RSImageLoader.images[1030].drawAdvancedSprite(x + 290, y + 350);
- }
- if (((String) LoginSettings.getSetting("SU1")).equalsIgnoreCase("blank")
- && ((String) LoginSettings.getSetting("SP1")).equalsIgnoreCase("blank")) {
- } else {
- GetHead(1);
- }
- if (((String) LoginSettings.getSetting("SU2")).equalsIgnoreCase("blank")
- && ((String) LoginSettings.getSetting("SP2")).equalsIgnoreCase("blank")) {
- } else {
- GetHead(2);
- }
- if (((String) LoginSettings.getSetting("SU3")).equalsIgnoreCase("blank")
- && ((String) LoginSettings.getSetting("SP3")).equalsIgnoreCase("blank")) {
- } else {
- GetHead(3);
- }
- if (((String) LoginSettings.getSetting("SU4")).equalsIgnoreCase("blank")
- && ((String) LoginSettings.getSetting("SP4")).equalsIgnoreCase("blank")) {
- } else {
- GetHead(4);
- }
- arial[2].drawString(getUsername() + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "|" : ""), centerX
- - (input.myWidth / 2) + 0, y + 200, 0xffffff, true);
- arial[2].drawString(TextUtils.mask(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "|" : ""), centerX
- - (input.myWidth / 2) + 0, y + 270, 0xffffff, true);
- arial[2].drawString(loginMessage1, centerX - (input.myWidth / 2) + 60, y + 420, 0xF3B13F, true);
- arial[2].drawString(loginMessage2, centerX - (input.myWidth / 2) - 30, y + 440, 0xF3B13F, true);
- }
- title.drawGraphics(0, super.graphics, 0);
- }
- public void GetHead(int HeadDrawn) {
- int x = (getClientWidth() / 2) - (RSImageLoader.images[1023].myWidth / 2);
- int y = (getClientHeight() / 2) - (RSImageLoader.images[1023].myHeight / 2);
- if (HeadDrawn == 1) {
- RSImageLoader.images[1035].drawAdvancedSprite(x + 115, y + 355);
- }
- if (HeadDrawn == 2) {
- RSImageLoader.images[1036].drawAdvancedSprite(x + 177, y + 355);
- }
- if (HeadDrawn == 3) {
- RSImageLoader.images[1037].drawAdvancedSprite(x + 237, y + 357);
- }
- if (HeadDrawn == 4) {
- RSImageLoader.images[1038].drawAdvancedSprite(x + 296, y + 356);
- }
- }
- public void drawTooltip(int info, int x, int y, boolean error) {
- String[] text = null;
- switch (info) {
- case 0:
- text = error ? (loginScreenState == CREATE ? getCreate().usernameError : getRecovery().usernameError)
- : (loginScreenState == CREATE ? getCreate().usernameInfo : getRecovery().usernameInfo);
- break;
- case 1:
- text = error ? (loginScreenState == CREATE ? getCreate().passwordError : getRecovery().emailError)
- : (loginScreenState == CREATE ? getCreate().passwordInfo : getRecovery().emailInfo);
- break;
- case 2:
- text = error ? getCreate().confirmError : getCreate().confirmInfo;
- break;
- case 3:
- text = error ? getCreate().emailError : getCreate().emailInfo;
- break;
- case 4:
- text = error ? getCreate().referrerError : getCreate().referrerInfo;
- break;
- }
- boolean verified = (loginScreenState == CREATE ? getCreate().verified[info] : getRecovery().verified[info]);
- if (text != null || (error && verified)) {
- if (error && verified) {
- text = new String[] { "This field is valid." };
- }
- int width = 0;
- for (int index = 0; index < text.length; index++) {
- if (newSmallFont.getTextWidth(text[index]) > width) {
- width = newSmallFont.getTextWidth(text[index]) + 10;
- }
- }
- int height = (text.length * 15) + 8;
- DrawingArea.drawRoundedRectangle(x, y, width, height, 0, 150, true, false);
- for (int index = 0; index < text.length; index++) {
- newSmallFont.drawBasicString(text[index], x + 5, y + 15 + (15 * index), 0xffffff, 0);
- }
- }
- }
- private void drawFlames() {
- drawingFlames = true;
- try {
- long l = System.currentTimeMillis();
- int i = 0;
- int j = 20;
- while (aBoolean831) {
- anInt1208++;
- if (++i > 10) {
- long l1 = System.currentTimeMillis();
- int k = (int) (l1 - l) / 10 - j;
- j = 40 - k;
- if (j < 5) {
- j = 5;
- }
- i = 0;
- l = l1;
- }
- try {
- Thread.sleep(j);
- } catch (Exception _ex) {
- }
- }
- } catch (Exception _ex) {
- }
- drawingFlames = false;
- }
- public void raiseWelcomeScreen() {
- welcomeScreenRaised = true;
- }
- private void updateEntity(JagexBuffer buffer, int packetId) {
- if (packetId == 84) { // send ground item amount
- int offset = buffer.readUnsignedByte();
- int regionX = bigRegionX + (offset >> 4 & 7);
- int regionY = bigRegionY + (offset & 7);
- int itemId = buffer.readUnsignedShort();
- int oldAmount = buffer.readUnsignedShort();
- int newAmount = buffer.readUnsignedShort();
- if (regionX >= 0 && regionY >= 0 && regionX < 104 && regionY < 104) {
- Deque deque = groundEntity[plane][regionX][regionY];
- if (deque != null) {
- for (Item item = (Item) deque.head(); item != null; item = (Item) deque.next()) {
- if (item.id != (itemId & 0x7fff) || item.amount != oldAmount) {
- continue;
- }
- item.amount = newAmount;
- break;
- }
- spawnGroundItem(regionX, regionY);
- }
- }
- return;
- }
- if (packetId == 105) { // send sound
- int firstOffset = buffer.readUnsignedByte();
- int firstX = bigRegionX + (firstOffset >> 4 & 7);
- int firstY = bigRegionY + (firstOffset & 7);
- @SuppressWarnings("unused")
- int soundId = buffer.readUnsignedShort();
- int secondOffset = buffer.readUnsignedByte();
- int secondX = secondOffset >> 4 & 0xf;
- @SuppressWarnings("unused")
- int secondY = secondOffset & 7;
- if (myPlayer.pathX[0] >= firstX - secondX && myPlayer.pathX[0] <= firstX + secondX && myPlayer.pathY[0] >= firstY - secondX
- && myPlayer.pathY[0] <= firstY + secondX && aBoolean848 && currentSound < 50) {
- /*
- * sound[currentSound] = soundId;
- * soundType[currentSound] = secondY;
- * soundDelay[currentSound] = Track.trackDelays[soundId];
- * currentSound++;
- */
- }
- }
- if (packetId == 215) { // unsure
- int id = buffer.readUnsignedLEShortA();
- int offset = buffer.readUnsignedByteS();
- int x = bigRegionX + (offset >> 4 & 7);
- int y = bigRegionY + (offset & 7);
- int playerIndex = buffer.readUnsignedLEShortA();
- int amount = buffer.readUnsignedShort();
- if (x >= 0 && y >= 0 && x < 104 && y < 104 && playerIndex != myPlayerId) {
- Item item = new Item();
- item.id = id;
- item.amount = amount;
- if (groundEntity[plane][x][y] == null) {
- groundEntity[plane][x][y] = new Deque();
- }
- groundEntity[plane][x][y].append(item);
- spawnGroundItem(x, y);
- }
- return;
- }
- if (packetId == 156) { // send ground item removal
- int offset = buffer.readUnsignedByteA();
- int x = bigRegionX + (offset >> 4 & 7);
- int y = bigRegionY + (offset & 7);
- int itemId = buffer.readUnsignedShort();
- if (x >= 0 && y >= 0 && x < 104 && y < 104) {
- Deque deque = groundEntity[plane][x][y];
- if (deque != null) {
- for (Item item = (Item) deque.head(); item != null; item = (Item) deque.next()) {
- if (item.id != (itemId & 0x7fff)) {
- continue;
- }
- item.remove();
- break;
- }
- if (deque.head() == null) {
- groundEntity[plane][x][y] = null;
- }
- spawnGroundItem(x, y);
- }
- }
- return;
- }
- if (packetId == 160) { // send object animation
- int offset = buffer.readUnsignedByteS();
- int x = bigRegionX + (offset >> 4 & 7);
- int y = bigRegionY + (offset & 7);
- int bits = buffer.readUnsignedByteS();
- int type = bits >> 2;
- int rotation = bits & 3;
- int objectType = objectClassType[type];
- int animationId = buffer.readUnsignedLEShortA();
- if (x >= 0 && y >= 0 && x < 103 && y < 103) {
- int j18 = heightMap[plane][x][y];
- int i19 = heightMap[plane][x + 1][y];
- int l19 = heightMap[plane][x + 1][y + 1];
- int k20 = heightMap[plane][x][y + 1];
- if (objectType == 0) {
- WallObject class10 = sceneGraph.getWallObject(plane, x, y);
- if (class10 != null) {
- int k21 = /* class10.uid >> 14 & 0x7fff */class10.id;
- if (type == 2) {
- class10.animable1 = new ObjectOnTile(k21, 4 + rotation, 2, i19, l19, j18, k20, animationId, false);
- class10.animable2 = new ObjectOnTile(k21, rotation + 1 & 3, 2, i19, l19, j18, k20, animationId, false);
- } else {
- class10.animable1 = new ObjectOnTile(k21, rotation, type, i19, l19, j18, k20, animationId, false);
- }
- }
- }
- if (objectType == 1) {
- WallDecoration class26 = sceneGraph.getWallDecoration(x, y, plane);
- if (class26 != null) {
- class26.animable = new ObjectOnTile(
- /* class26.uid >> 12 & 0x7fff */class26.id, 0, 4, i19, l19, j18, k20, animationId, false);
- }
- }
- if (objectType == 2) {
- InteractiveObject class28 = sceneGraph.getInteractiveObject(x, y, plane);
- if (type == 11) {
- type = 10;
- }
- if (class28 != null) {
- class28.animable = new ObjectOnTile(
- /* class28.uid >> 12 & 0x3fff */class28.id, rotation, type, i19, l19, j18, k20, animationId, false);
- }
- }
- if (objectType == 3) {
- GroundDecoration class49 = sceneGraph.getGroundDecoration(y, x, plane);
- if (class49 != null) {
- class49.animable = new ObjectOnTile(
- /* class49.uid >> 12 & 0x7fff */class49.id, rotation, 22, i19, l19, j18, k20, animationId, false);
- }
- }
- }
- return;
- }
- if (packetId == 147) { // transform player into game object
- int offset = buffer.readUnsignedByteS();
- int regionX = bigRegionX + (offset >> 4 & 7);
- int regionY = bigRegionY + (offset & 7);
- int playerId = buffer.readUnsignedShort();
- byte model_priority_x = buffer.readByteS();
- int start_delay = buffer.readUnsignedLEShort();
- byte model_priority_y = buffer.readByteC();
- int priority_1 = buffer.readUnsignedShort();
- int object_bits = buffer.readUnsignedByteS();
- int object_type = object_bits >> 2;
- int direction = object_bits & 3;
- int classType = objectClassType[object_type];
- byte unknown_x_value = buffer.readSignedByte();
- int objectId = buffer.readUnsignedShort();
- byte unknown_y_value = buffer.readByteC();
- Player player;
- if (playerId == myPlayerId) {
- player = myPlayer;
- } else {
- player = players[playerId];
- }
- if (player != null) {
- ObjectDef definition = ObjectDef.getDef(objectId);
- int i22 = heightMap[plane][regionX][regionY];
- int j22 = heightMap[plane][regionX + 1][regionY];
- int k22 = heightMap[plane][regionX + 1][regionY + 1];
- int l22 = heightMap[plane][regionX][regionY + 1];
- Model model = definition.renderObject(object_type, direction, i22, j22, k22, l22, -1, -1, -1, -1);
- if (model != null) {
- spawnGameObject(priority_1 + 1, -1, 0, classType, regionY, 0, plane, regionX, start_delay + 1);
- player.secondaryModel = start_delay + loopCycle;
- player.primaryModel = priority_1 + loopCycle;
- player.objectTransformationModel = model;
- int tileSizeX = definition.tileSizeX;
- int tileSizeY = definition.tileSizeY;
- if (direction == 1 || direction == 3) {
- tileSizeX = definition.tileSizeY;
- tileSizeY = definition.tileSizeX;
- }
- player.modelOffsetX = regionX * 128 + tileSizeX * 64;
- player.modelOffsetY = regionY * 128 + tileSizeY * 64;
- player.modelOffsetZ = method42(plane, player.modelOffsetY, player.modelOffsetX);
- if (unknown_x_value > model_priority_x) {
- byte temp_x = unknown_x_value;
- unknown_x_value = model_priority_x;
- model_priority_x = temp_x;
- }
- if (unknown_y_value > model_priority_y) {
- byte temp_y = unknown_y_value;
- unknown_y_value = model_priority_y;
- model_priority_y = temp_y;
- }
- // System.out.println("xSize=" + unknown_x_value + "; ySize=" + unknown_y_value
- // + "; xLength=" + model_priority_x + "; yLength=" + model_priority_y);
- player.extendedXMin = regionX + unknown_x_value;
- player.extendedXMax = regionX + model_priority_x;
- player.extendedYMin = regionY + unknown_y_value;
- player.extendedYMax = regionY + model_priority_y;
- }
- }
- }
- if (packetId == 151) { // send game object
- int offset = buffer.readUnsignedByteA();
- int regionX = bigRegionX + (offset >> 4 & 7);
- int regionY = bigRegionY + (offset & 7);
- int id = buffer.readUnsignedLEShort();
- int bits = buffer.readUnsignedByteS();
- int type = bits >> 2;
- int rotation = bits & 3;
- int objectType = objectClassType[type];
- if (regionX >= 0 && regionY >= 0 && regionX < 104 && regionY < 104) {
- spawnGameObject(-1, id, rotation, objectType, regionY, type, plane, regionX, 0);
- }
- return;
- }
- if (packetId == 4) { // send graphic
- int offset = buffer.readUnsignedByte();
- int regionX = bigRegionX + (offset >> 4 & 7);
- int regionY = bigRegionY + (offset & 7);
- int id = buffer.readUnsignedShort();
- int height = buffer.readUnsignedByte();
- int delay = buffer.readUnsignedShort();
- if (regionX >= 0 && regionY >= 0 && regionX < 104 && regionY < 104) {
- regionX = regionX * 128 + 64;
- regionY = regionY * 128 + 64;
- StillGraphics graphics = new StillGraphics(plane, loopCycle, delay, id, method42(plane, regionY, regionX) - height,
- regionY, regionX);
- aClass19_1056.append(graphics);
- }
- return;
- }
- if (packetId == 44) { // send ground item
- int itemId = buffer.readUnsignedShortA();
- int amount = buffer.readUnsignedShort();// long amount = stream.getSmartLong();
- int offset = buffer.readUnsignedByte();
- int regionX = bigRegionX + (offset >> 4 & 7);
- int regionY = bigRegionY + (offset & 7);
- if (itemId == -1 || itemId == 65535)
- return;
- if (regionX >= 0 && regionY >= 0 && regionX < 104 && regionY < 104) {
- Item item = new Item();
- item.id = itemId;
- item.amount = amount;
- if (groundEntity[plane][regionX][regionY] == null) {
- groundEntity[plane][regionX][regionY] = new Deque();
- }
- groundEntity[plane][regionX][regionY].append(item);
- spawnGroundItem(regionX, regionY);
- }
- return;
- }
- if (packetId == 101) { // send game object removal
- int bits = buffer.readUnsignedByteC();
- int type = bits >> 2;
- int face = bits & 3;
- int objectType = objectClassType[type];
- int offset = buffer.readUnsignedByte();
- int x = bigRegionX + (offset >> 4 & 7);
- int y = bigRegionY + (offset & 7);
- if (x >= 0 && y >= 0 && x < 104 && y < 104) {
- spawnGameObject(-1, -1, face, objectType, y, type, plane, x, 0);
- }
- return;
- }
- if (packetId == 117) { // send projectile
- int regionOffset = buffer.readUnsignedByte();
- int regionX = bigRegionX + (regionOffset >> 4 & 7);
- int regionY = bigRegionY + (regionOffset & 7);
- int offsetX = regionX + buffer.readSignedByte();
- int offsetY = regionY + buffer.readSignedByte();
- int lockon = buffer.readSignedShort();
- int graphicId = buffer.readUnsignedShort();
- int startZ = buffer.readUnsignedByte() * 4;
- int endZ = buffer.readUnsignedByte() * 4;
- int delay = buffer.readUnsignedShort();
- int speed = buffer.readUnsignedShort();
- int slope = buffer.readUnsignedByte();
- int radius = buffer.readUnsignedByte();
- if (regionX >= 0 && regionY >= 0 && regionX < 104 && regionY < 104 && offsetX >= 0 && offsetY >= 0 && offsetX < 104
- && offsetY < 104 && graphicId != 65535) {
- regionX = regionX * 128 + 64;
- regionY = regionY * 128 + 64;
- offsetX = offsetX * 128 + 64;
- offsetY = offsetY * 128 + 64;
- Projectile projectile = new Projectile(slope, endZ, delay + loopCycle, speed + loopCycle, radius, plane, method42(plane,
- regionY, regionX) - startZ, regionY, regionX, lockon, graphicId);
- projectile.calculateTracking(delay + loopCycle, offsetY, method42(plane, offsetY, offsetX) - endZ, offsetX);
- projectileQueue.append(projectile);
- }
- }
- }
- private static void setLowMemory() {
- WorldController.lowMem = true;
- Rasterizer.lowMem = true;
- lowMemory = true;
- ObjectManager.lowMem = true;
- ObjectDef.lowMem = true;
- }
- private void updateNpcMovement(JagexBuffer stream) {
- stream.initBitAccess();
- int k = stream.getBits(8);
- if (k < npcCount) {
- for (int l = k; l < npcCount; l++) {
- anIntArray840[anInt839++] = npcIndices[l];
- }
- }
- if (k > npcCount) {
- Signlink.reportError(myUsername + " Too many npcs");
- throw new RuntimeException("eek");
- }
- npcCount = 0;
- for (int i1 = 0; i1 < k; i1++) {
- int j1 = npcIndices[i1];
- NPC npc = npcArray[j1];
- int k1 = stream.getBits(1);
- if (k1 == 0) {
- npcIndices[npcCount++] = j1;
- npc.time = loopCycle;
- } else {
- int l1 = stream.getBits(2);
- if (l1 == 0) {
- npcIndices[npcCount++] = j1;
- npc.time = loopCycle;
- localPlayers[localPlayersIndex++] = j1;
- } else if (l1 == 1) {
- npcIndices[npcCount++] = j1;
- npc.time = loopCycle;
- int i2 = stream.getBits(3);
- npc.move(false, i2);
- int k2 = stream.getBits(1);
- if (k2 == 1) {
- localPlayers[localPlayersIndex++] = j1;
- }
- } else if (l1 == 2) {
- npcIndices[npcCount++] = j1;
- npc.time = loopCycle;
- int j2 = stream.getBits(3);
- npc.move(true, j2);
- int l2 = stream.getBits(3);
- npc.move(true, l2);
- int i3 = stream.getBits(1);
- if (i3 == 1) {
- localPlayers[localPlayersIndex++] = j1;
- }
- } else if (l1 == 3) {
- anIntArray840[anInt839++] = j1;
- }
- }
- }
- }
- /*
- * private void processLoginScreenInput() {
- * checkSize();
- * int centerX = (getClientWidth() / 2);
- * int centerY = (getClientHeight() / 2);
- * if (loginMessage1.length() > 0) {
- * int width = 300;
- * int height = 50;
- * int x = (getClientWidth() / 2) - (width / 2);
- * int y = (getClientHeight() / 2) - (height / 2);
- * //create account
- * if (!mouseInRegion(x + width - 16, x + width, y, y + 16) && getCreate().available) {
- * if (super.clickMode3 == 1 && clickInRegion(x, x + width, y, y + height)) {
- * getCreate().username = getUsername();
- * getCreate().password = myPassword;
- * getCreate().verified[0] = getCreate().checkUsername();
- * getCreate().verified[1] = getCreate().checkPassword();
- * loginScreenState = CREATE;
- * loginMessage1 = "";
- * loginMessage2 = "";
- * messageAlpha = 0;
- * messageX = 0;
- * messageY = 0;
- * messageWidth = 0;
- * messageHeight = 0;
- * }
- * }
- * //close button
- * if (super.clickMode3 == 1 && clickInRegion(x + width - 16, x + width, y, y + 16)) {
- * loginMessage1 = "";
- * loginMessage2 = "";
- * }
- * if (mouseInRegion(x + width - 16, x + width, y, y + 16)) {
- * titleHover = 3;
- * } else {
- * titleHover = -1;
- * }
- * return;
- * }
- * if (loginScreenState == LOGIN) {
- * int x = (getClientWidth() / 2) - (box[0].myWidth / 2);
- * int y = (getClientHeight() / 2) - (box[0].myHeight / 2);
- * int[] screen_x = {x + (322 / 2) - 45 - 27, x + 20 + (322 / 2) - 27, x + 85 + (322 / 2) - 27};
- * int[] detail_x = {x + 85, x + 200};
- * int buttonsX = clientWidth - 165;
- * int buttonsY = 5;
- * //options(x + 5 - accountsX, x + 20, y + 25, y + 165)) {
- * titleHover = 2;
- * //recover
- * } else if (mouseInRegion(centerX - (input.myWidth / 2), centerX, y + 153, y + 165)) {
- * titleHover = 5;
- * //icons/buttons
- * } else {
- * titleHover = -1;
- * }
- * //recover
- * if (super.clickMode3 == 1 && clickInRegion(centerX - (input.myWidth / 2), centerX, y + 153, y + 165)) {
- * loginScreenState = RECOVER;
- * }
- * if (titleHover == 1) {
- * //screen mode
- * if (mouseInRegion(screen_x[0], screen_x[0] + 54, y + 205, y + 248)) {
- * screenHover = 0;
- * } else if (mouseInRegion(screen_x[1], screen_x[1] + 54, y + 205, y + 248)) {
- * screenHover = 1;
- * } else if (mouseInRegion(screen_x[2], screen_x[2] + 54, y + 205, y + 248)) {
- * screenHover = 2;
- * } else {
- * screenHover = -1;
- * }
- * if (super.clickMode3 == 1 && clickInRegion(screen_x[0], screen_x[0] + 54, y + 205, y + 248)) {
- * toggleSize(0);
- * } else if (super.clickMode3 == 1 && clickInRegion(screen_x[1], screen_x[1] + 54, y + 205, y + 248)) {
- * toggleSize(1);
- * } else if (super.clickMode3 == 1 && clickInRegion(screen_x[2], screen_x[2] + 54, y + 205, y + 248)) {
- * toggleSize(2);
- * }
- * //detail
- * if (mouseInRegion(detail_x[0], detail_x[0] + 77, y + 260, y + 313)) {
- * detailHover = 0;
- * } else if (mouseInRegion(detail_x[1], detail_x[1] + 77, y + 260, y + 313)) {
- * detailHover = 1;
- * } else {
- * detailHover = -1;
- * }
- * if (super.clickMode3 == 1 && clickInRegion(detail_x[0], detail_x[0] + 77, y + 260, y + 313)) {
- * setLowMemory();
- * } else if (super.clickMode3 == 1 && clickInRegion(detail_x[1], detail_x[1] + 77, y + 260, y + 313)) {
- * setHighMemory();
- * }
- * }
- * //edit accounts
- * if (super.clickMode3 == 1 && clickInRegion(x - accountsX + 5, x, y + 28, y + 42) && titleHover == 2) {
- * editAccounts = !editAccounts;
- * //AccountHandler.save();
- * }
- * if (mouseInRegion(x - accountsX + 5, x, y + 28, y + 42) && titleHover == 2) {
- * editHover = 0;
- * } else {
- * editHover = -1;
- * }
- * //Display toggle
- * if (super.clickMode3 == 1 && clickInRegion(9, 9 + 112, clientHeight - display.myHeight + 9, clientHeight - display.myHeight + 9 + 75)) {
- * Settings.displayWorld = !Settings.displayWorld;
- * createWorldImage();
- * Settings.save();
- * }
- * if (titleHover == 2) {
- * int text_x = x - accountsX + 5;
- * int text_y = y + 62;
- * if (AccountHandler.accounts != null) {
- * accountHover = -1;
- * for (int index = 0; index < AccountHandler.getAccounts().size(); index++, text_y += 17) {
- * Account account = AccountHandler.getAccounts().get(index);
- * if (mouseInRegion(text_x, x + 10, text_y - 12, text_y)) {
- * accountHover = index;
- * }
- * if (super.clickMode3 == 1 && clickInRegion(text_x, x + 10, text_y - 12, text_y)) {
- * if (editAccounts) {
- * AccountHandler.remove(account);
- * } else {
- * getCreate().created = false;
- * loginFailures = 0;
- * login(account.name, account.password, false, true);
- * if (loggedIn) {
- * return;
- * }
- * }
- * }
- * }
- * }
- * }
- * if (super.clickMode3 == 1 && clickInRegion(centerX - (input.myWidth / 2), centerX + (input.myWidth / 2), centerY - 17 - (input.myHeight / 2), centerY - 17 + (input.myHeight / 2))) {
- * loginScreenCursorPos = 0;
- * }
- * if (super.clickMode3 == 1 && clickInRegion(centerX - (input.myWidth / 2), centerX + (input.myWidth / 2), centerY + 35 - (input.myHeight / 2), centerY + 35 + (input.myHeight / 2))) {
- * loginScreenCursorPos = 1;
- * }
- * int loginX = (clientWidth / 2) - (button.myWidth / 2);
- * int loginY = clientHeight - 175;
- * if (checkDetails() && super.clickMode3 == 1 && clickInRegion(loginX, loginX + button.myWidth, loginY - 8, loginY - 8 + button.myHeight)) {
- * getCreate().created = false;
- * loginFailures = 0;
- * login(getUsername(), myPassword, false, false);
- * if (loggedIn) {
- * return;
- * }
- * }
- * do {
- * int key = readCharacter();
- * if (key == -1) {
- * break;
- * }
- * boolean validKey = false;
- * for (int index = 0; index < validUserPassChars.length(); index++) {
- * if (key != validUserPassChars.charAt(index)) {
- * continue;
- * }
- * validKey = true;
- * break;
- * }
- * if (loginScreenCursorPos == 0) {
- * if (key == 8 && getUsername().length() > 0) {
- * setUsername(myUsername.substring(0, myUsername.length() - 1));
- * }
- * if (key == 9 || key == 10 || key == 13) {
- * loginScreenCursorPos = 1;
- * }
- * if (validKey) {
- * setUsername(myUsername + (char) key);
- * }
- * if (getUsername().length() > 12) {
- * setUsername(myUsername.substring(0, 12));
- * }
- * } else if (loginScreenCursorPos == 1) {
- * if (key == 8 && myPassword.length() > 0) {
- * myPassword = myPassword.substring(0, myPassword.length() - 1);
- * }
- * if (key == 9) {
- * loginScreenCursorPos = 0;
- * }
- * if (key == 10 || key == 13) {
- * getCreate().created = false;
- * loginFailures = 0;
- * login(getUsername(), myPassword, false, false);
- * if (loggedIn) {
- * return;
- * }
- * }
- * if (validKey) {
- * myPassword += (char) key;
- * }
- * if (myPassword.length() > 20) {
- * myPassword = myPassword.substring(0, 20);
- * }
- * }
- * } while (true);
- * return;
- * }
- * if (loginScreenState == CREATE) {
- * getCreate().processInput();
- * }
- * if (loginScreenState == RECOVER) {
- * getRecovery().processInput();
- * }
- * }
- */
- private void markMinimap(RSImage sprite, int x, int y) {
- try {
- int k = viewRotation + minimapRotation & 0x7ff;
- int l = x * x + y * y;
- if (l > 6400) {
- return;
- }
- int i1 = Model.SINE[k];
- int j1 = Model.COSINE[k];
- i1 = (i1 * 256) / (minimapZoom + 256);
- j1 = (j1 * 256) / (minimapZoom + 256);
- int k1 = y * i1 + x * j1 >> 16;
- int l1 = y * j1 - x * i1 >> 16;
- if (isFixed()) {
- sprite.drawImage((((105 + k1) - sprite.maxWidth / 2) + 4) + (isFixed() ? getMapOffsetX() : 0), (88 - l1 - sprite.maxHeight
- / 2 - 4)
- + (isFixed() ? getMapOffsetY() : 0));
- } else {
- sprite.drawImage((((77 + k1) - sprite.maxWidth / 2) + 4 + (clientWidth - 167)), (85 - l1 - sprite.maxHeight / 2 - 4)
- + (isFixed() ? getMapOffsetY() : 0));
- }
- } catch (Exception e) {
- }
- }
- private void method142(int y, int z, int k, int l, int x, int type, int k1) {
- if (x >= 1 && y >= 1 && x <= 102 && y <= 102) {
- if (lowMemory && z != plane) {
- return;
- }
- int id = 0;
- int uid = 0;
- if (type == 0) {
- uid = sceneGraph.getWallObjectUID(z, x, y);
- id = sceneGraph.getWallObjectID(z, x, y);
- }
- if (type == 1) {
- uid = sceneGraph.getWallDecorationUID(z, x, y);
- id = sceneGraph.getWallDecorationID(z, x, y);
- }
- if (type == 2) {
- uid = sceneGraph.getInteractiveObjectUID(z, x, y);
- id = sceneGraph.getInteractiveObjectID(z, x, y);
- }
- if (type == 3) {
- uid = sceneGraph.getGroundDecorationUID(z, x, y);
- id = sceneGraph.getGroundDecorationID(z, x, y);
- }
- if (uid != 0) {
- int config = sceneGraph.getObjectConfig(z, x, y, uid);
- int objType = config & 0x1f;
- int direction = config >> 6;
- if (type == 0) {
- sceneGraph.removeWallObject(x, z, y);
- ObjectDef definition = ObjectDef.getDef(id);
- if (definition.unwalkable) {
- tileSettings[z].method215(direction, objType, definition.impenetrable, x, y);
- }
- }
- if (type == 1) {
- sceneGraph.removeWallDecoration(y, z, x);
- }
- if (type == 2) {
- sceneGraph.removeInteractiveObject(z, x, y);
- ObjectDef definition = ObjectDef.getDef(id);
- if (x + definition.tileSizeX > 103 || y + definition.tileSizeX > 103 || x + definition.tileSizeY > 103
- || y + definition.tileSizeY > 103) {
- return;
- }
- if (definition.unwalkable) {
- tileSettings[z].method216(direction, definition.tileSizeX, x, y, definition.tileSizeY, definition.impenetrable);
- }
- }
- if (type == 3) {
- sceneGraph.removeGroundDecoration(z, y, x);
- ObjectDef definition = ObjectDef.getDef(id);
- if (definition.unwalkable && definition.interactive) {
- tileSettings[z].method218(y, x);
- }
- }
- }
- if (k1 >= 0) {
- int j3 = z;
- if (j3 < 3 && (groundTileSettings[1][x][y] & 2) == 2) {
- j3++;
- }
- ObjectManager.renderObject(sceneGraph, k, y, l, j3, tileSettings[z], heightMap, x, k1, z);
- }
- }
- }
- private void updatePlayers(int bufferSize, JagexBuffer buffer) {
- anInt839 = 0;
- localPlayersIndex = 0;
- updateClientMovement(buffer);
- updateOtherClientMovements(buffer);
- addNewLocalPlayer(buffer, bufferSize);
- updateLocalClientMasks(buffer);
- for (int index = 0; index < anInt839; index++) {
- int player = anIntArray840[index];
- if (players[player].time != loopCycle) {
- players[player] = null;
- }
- }
- if (buffer.offset != bufferSize) {
- throw new RuntimeException("Error reading player updating packet - [size, expectedSize] : [" + buffer.offset + ", "
- + bufferSize + "]");
- // signlink.reportError("Packet size mismatch in player updating - buffer offset: " + buffer.offset + ", size: " + size);
- // signlink.reportError("Error packet size mismatch in getplayer pos:" + stream.offset + " psize:" + size);
- // throw new RuntimeException("eek");
- }
- for (int index = 0; index < playerCount; index++) {
- if (players[playerIndices[index]] == null) {
- Signlink.reportError(myUsername + " null entry in pl list - pos:" + index + " size:" + playerCount);
- throw new RuntimeException("eek");
- }
- }
- }
- private void setCameraPos(int j, int k, int l, int i1, int j1, int k1) {
- int l1 = 2048 - k & 0x7ff;
- int i2 = 2048 - j1 & 0x7ff;
- int j2 = 0;
- int k2 = 0;
- int l2 = j;
- if (l1 != 0) {
- int i3 = Model.SINE[l1];
- int k3 = Model.COSINE[l1];
- int i4 = k2 * k3 - l2 * i3 >> 16;
- l2 = k2 * i3 + l2 * k3 >> 16;
- k2 = i4;
- }
- if (i2 != 0) {
- int j3 = Model.SINE[i2];
- int l3 = Model.COSINE[i2];
- int j4 = l2 * j3 + j2 * l3 >> 16;
- l2 = l2 * l3 - j2 * j3 >> 16;
- j2 = j4;
- }
- xCameraPos = l - j2;
- zCameraPos = i1 - k2;
- yCameraPos = k1 - l2;
- yCameraCurve = k;
- xCameraCurve = j1;
- }
- public void updateText(String text, int id) {
- if (RSInterface.interfaceCache[id] == null)
- return;
- RSInterface.interfaceCache[id].enabledText = text;
- RSInterface.interfaceCache[id].disabledText = text;
- if (RSInterface.interfaceCache[id].parentId == tabInterfaceIDs[tabID]) {
- redrawTabArea = true;
- }
- if (id == 27001)
- currentBankTab = Integer.valueOf(RSInterface.interfaceCache[id].disabledText);
- if (id == 51_806 || id == 51_856) {
- int price = Integer.valueOf(RSInterface.interfaceCache[id].disabledText);
- GrandExchange.setPricePerItem(price);
- } else if (id == 51_805 || id == 51_855) {
- int quantity = Integer.valueOf(RSInterface.interfaceCache[id].disabledText);
- GrandExchange.setQuantity(quantity);
- }
- }
- public void sendPacket185(int buttonID) {
- outgoingPacket.createFrame(185);
- outgoingPacket.writeShort(buttonID);
- RSInterface rsi = RSInterface.interfaceCache[buttonID];
- if (rsi.valueConditionType != null && rsi.valueConditionType[0][0] == 5) {
- int configID = rsi.valueConditionType[0][1];
- variousSettings[configID] = 1 - variousSettings[configID];
- toggleConfig(configID);
- redrawTabArea = true;
- }
- }
- public void setConfig(int id, int value) {
- defaultConfigIds[id] = value;
- if (variousSettings[id] != value) {
- variousSettings[id] = value;
- redrawTabArea = true;
- if (dialogID != -1) {
- inputTaken = true;
- }
- }
- }
- public int getConfig(int id) {
- return variousSettings[RSInterface.getConfigID(id)];
- }
- /**
- * Used to set a sprite to another sprite. An example
- * is the clan chat's lootshare sprite, which has 4
- * different sprites.
- * @param childId The id of the interface child.
- * @param spriteId The new sprite id located in sprites.dat.
- */
- private void changeSprite(int childId, int offsetX, int offsetY, int... spriteId) {
- RSInterface rsi = RSInterface.interfaceCache[childId];
- if (rsi != null) {
- if (spriteId[0] < RSImageLoader.images.length && RSImageLoader.images[spriteId[0]] != null && spriteId[0] > 0)
- rsi.sprite1 = RSImageLoader.images[spriteId[0]];
- if (spriteId[1] < RSImageLoader.images.length && RSImageLoader.images[spriteId[1]] != null && spriteId[1] > 0)
- rsi.sprite2 = RSImageLoader.images[spriteId[1]];
- rsi.sprite1.offsetX = rsi.sprite2.offsetX = offsetX;
- rsi.sprite1.offsetY = rsi.sprite2.offsetY = offsetY;
- }
- }
- private int hungerGamesHunger = -1;
- private int hungerGamesThirst = -1;
- public boolean buildingMode = false;
- private boolean parsePacket() {
- if (socketStream == null) {
- return false;
- }
- try {
- int available = socketStream.available();
- if (available == 0) {
- return false;
- }
- if (packetId == -1) {
- socketStream.flushInputStream(incomingPacket.payload, 1);
- packetId = incomingPacket.payload[0] & 0xff;
- if (encryption != null) {
- packetId = packetId - encryption.next() & 0xff;
- }
- packetSize = SizeConstants.getPacketSizes()[packetId];
- available--;
- }
- if (packetSize == -1) {
- if (available > 0) {
- socketStream.flushInputStream(incomingPacket.payload, 1);
- packetSize = incomingPacket.payload[0] & 0xff;
- available--;
- } else {
- return false;
- }
- }
- if (packetSize == -2) {
- if (available > 1) {
- socketStream.flushInputStream(incomingPacket.payload, 2);
- incomingPacket.offset = 0;
- packetSize = incomingPacket.readUnsignedShort();
- available -= 2;
- } else {
- return false;
- }
- }
- if (available < packetSize) {
- return false;
- }
- incomingPacket.offset = 0;
- socketStream.flushInputStream(incomingPacket.payload, packetSize);
- anInt1009 = 0;
- anInt843 = anInt842;
- anInt842 = anInt841;
- anInt841 = packetId;
- switch (packetId) {
- case 94:
- redrawTabArea = true;
- int containerId = incomingPacket.readUnsignedShort();
- RSInterface container = RSInterface.interfaceCache[containerId];
- int containerSize = incomingPacket.readUnsignedShort();
- int offerItemId = incomingPacket.readUnsignedShort();
- int offerItemAmount = incomingPacket.readUnsignedByte();
- if (offerItemAmount == 255)
- offerItemAmount = incomingPacket.readInt_v1();
- container.geItem[0] = offerItemId;
- container.geItem[1] = offerItemAmount;
- container.geOfferType = incomingPacket.readSignedByte();
- if (container.geOfferType != -1) {
- int goalAmount = incomingPacket.readUnsignedByte();
- if (goalAmount == 255)
- goalAmount = incomingPacket.readInt_v1();
- container.geItem[2] = goalAmount;
- }
- for (int index = 0; index < containerSize; index++) {
- int amount = incomingPacket.readUnsignedByte();
- if (amount == 255)
- amount = incomingPacket.readInt_v1();
- container.inventory[index] = incomingPacket.readLEShortA();
- container.inventoryAmount[index] = (int) amount;
- amount = incomingPacket.readUnsignedByte();
- if (amount == 255)
- amount = incomingPacket.readInt_v1();
- container.gePrice = amount;
- }
- for (int index = containerSize; index < container.inventory.length; index++) {
- container.inventory[index] = 0;
- container.inventoryAmount[index] = 0;
- }
- packetId = -1;
- return true;
- case 150:
- int child_id = incomingPacket.readUnsignedShort();
- int slot = incomingPacket.readSignedByte();
- int seconds = incomingPacket.readUnsignedByte();
- RSInterface child = RSInterface.interfaceCache[child_id];
- if (child != null && slot < child.inventory.length) {
- child.showChangeExclamation[slot] = seconds > 0;
- if (child.showChangeExclamation[slot]) {
- child.showChangeExclamationTimer[slot] = seconds;
- child.showChangeExclamationDelay[slot] = System.currentTimeMillis();
- }
- }
- packetId = -1;
- return true;
- case 93:
- long start_money = moneyPouch;
- boolean update = incomingPacket.readSignedByte() == 1;
- moneyPouch = incomingPacket.readLong();
- if (update) {
- moneyPouchProfit = moneyPouch - start_money;
- if (moneyPouch < start_money) {
- moneyOrbUpdateStatus = 2;
- } else if (moneyPouch > start_money) {
- moneyOrbUpdateStatus = 1;
- }
- }
- packetId = -1;
- return true;
- case 92:
- hungerGamesHunger = incomingPacket.readUnsignedByte();
- hungerGamesThirst = incomingPacket.readUnsignedByte();
- packetId = -1;
- return true;
- case 2:
- myRights = incomingPacket.readUnsignedByte();
- myPlayer.rights = myRights;
- packetId = -1;
- return true;
- case 88:
- quickPrayers = incomingPacket.readUnsignedByte() != 0;
- packetId = -1;
- return true;
- case 140:
- int childId = incomingPacket.readUnsignedShort();
- int new_offset_x = incomingPacket.readSignedByte();
- int new_offset_y = incomingPacket.readSignedByte();
- int attributes = incomingPacket.readUnsignedShort();
- int firstSprite = attributes >> 0;
- int secondSprite = attributes & 0;
- int[] newSprites = new int[] { firstSprite, secondSprite };
- changeSprite(childId, new_offset_x, new_offset_y, newSprites);
- packetId = -1;
- return true;
- case 89:
- poisoned = incomingPacket.readUnsignedByte() > 0;
- packetId = -1;
- return true;
- case 113:
- running = incomingPacket.readUnsignedByte() == 1;
- restMode = incomingPacket.readUnsignedByte();
- packetId = -1;
- return true;
- case 123:
- sendConsoleMessage(incomingPacket.readString(), false);
- packetId = -1;
- return true;
- case 124:
- int skillID = incomingPacket.readSignedByte();
- int gainedXP = incomingPacket.readInt();
- addXP(skillID, gainedXP);
- totalXP = incomingPacket.readInt();
- packetId = -1;
- return true;
- case 165:
- familiarHandler.specialAttackAmount = incomingPacket.readSignedShort();
- packetId = -1;
- return true;
- case 172:
- try {
- boolean active = incomingPacket.readSignedByte() == 1;
- String name = incomingPacket.readString();
- String special = incomingPacket.readString();
- getFamiliar().specialType = incomingPacket.readSignedByte();
- getFamiliar().setActive(active);
- getFamiliar().setFamiliar(name, special);
- if (!active) {
- getFamiliar().setDefaults();
- tabID = 13;
- tabInterfaceIDs[13] = -1;
- redrawTabArea = true;
- tabAreaAltered = true;
- } else {
- tabID = 13;
- tabInterfaceIDs[13] = familiarHandler.specialType != -1 ? 36400 : 36600;
- redrawTabArea = true;
- tabAreaAltered = true;
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- packetId = -1;
- return true;
- case 173:
- try {
- pushKill(incomingPacket.readString(), incomingPacket.readString(), incomingPacket.readUnsignedShort(),
- incomingPacket.readSignedByte() == 1, incomingPacket.readSignedByte() == 1);
- } catch (Exception e) {
- e.printStackTrace();
- }
- packetId = -1;
- return true;
- case 81:
- updatePlayers(packetSize, incomingPacket);
- aBoolean1080 = false;
- packetId = -1;
- return true;
- case 176:
- daysSinceRecovChange = incomingPacket.readUnsignedByteC();
- unreadMessages = incomingPacket.readUnsignedLEShortA();
- membersInt = incomingPacket.readUnsignedByte();
- anInt1193 = incomingPacket.readInt_v1();
- daysSinceLastLogin = incomingPacket.readUnsignedShort();
- if (anInt1193 != 0 && openInterfaceID == -1) {
- Signlink.dnslookup(TextUtils.method586(anInt1193));
- clearTopInterfaces();
- char c = '\u028A';
- if (daysSinceRecovChange != 201 || membersInt == 1) {
- c = '\u028F';
- }
- reportAbuseInput = "";
- canMute = false;
- for (int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
- if (RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c) {
- continue;
- }
- openInterfaceID = RSInterface.interfaceCache[k9].parentId;
- }
- }
- packetId = -1;
- return true;
- case 64:
- bigRegionX = incomingPacket.readUnsignedByteC();
- bigRegionY = incomingPacket.readUnsignedByteS();
- for (int j = bigRegionX; j < bigRegionX + 8; j++) {
- for (int l9 = bigRegionY; l9 < bigRegionY + 8; l9++) {
- if (groundEntity[plane][j][l9] != null) {
- groundEntity[plane][j][l9] = null;
- spawnGroundItem(j, l9);
- }
- }
- }
- for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179.head(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
- .next()) {
- if (class30_sub1.anInt1297 >= bigRegionX && class30_sub1.anInt1297 < bigRegionX + 8
- && class30_sub1.anInt1298 >= bigRegionY && class30_sub1.anInt1298 < bigRegionY + 8
- && class30_sub1.anInt1295 == plane) {
- class30_sub1.anInt1294 = 0;
- }
- }
- packetId = -1;
- return true;
- case 185:
- int k = incomingPacket.readUnsignedShortA();
- RSInterface.interfaceCache[k].mediaType = 3;
- if (myPlayer.npcDef == null) {
- RSInterface.interfaceCache[k].modelZoom = 5000;
- RSInterface.interfaceCache[k].mediaId = (myPlayer.appearanceColor[0] << 25) + (myPlayer.appearanceColor[4] << 20)
- + (myPlayer.equipment[0] << 15) + (myPlayer.equipment[8] << 10) + (myPlayer.equipment[11] << 5)
- + myPlayer.equipment[1];
- } else {
- RSInterface.interfaceCache[k].mediaId = (int) (0x12345678L + myPlayer.npcDef.id);
- }
- packetId = -1;
- return true;
- /* Clan chat packet */
- case 217:
- try {
- clanUsername = incomingPacket.readString();
- clanMessage = TextInput.processText(incomingPacket.readString());
- clanTitle = incomingPacket.readString();
- channelRights = incomingPacket.readUnsignedShort();
- pushMessage(clanUsername, clanMessage, 12, "", -1);
- } catch (Exception e) {
- e.printStackTrace();
- }
- packetId = -1;
- return true;
- /* Yell channel packet */
- case 222:
- try {
- yellUsername = incomingPacket.readString();
- yellMessage = incomingPacket.readString();
- yellMessage = TextInput.processText(yellMessage);
- channelRights = incomingPacket.readUnsignedShort();
- pushMessage(yellUsername, yellMessage, 13, "", -1);
- } catch (Exception e) {
- e.printStackTrace();
- }
- packetId = -1;
- return true;
- /* Muted reason packet */
- case 223:
- try {
- mutedBy = incomingPacket.readString();
- muteReason = incomingPacket.readString();
- } catch (Exception e) {
- e.printStackTrace();
- }
- packetId = -1;
- return true;
- case 107:
- cameraMovement = false;
- for (int l = 0; l < 5; l++) {
- cameraFlag[l] = false;
- }
- packetId = -1;
- return true;
- case 72:
- int i1 = incomingPacket.readUnsignedLEShort();
- RSInterface rsi = RSInterface.interfaceCache[i1];
- for (int index = 0; index < rsi.inventory.length; index++) {
- rsi.inventory[index] = -1;
- rsi.inventory[index] = 0;
- }
- packetId = -1;
- return true;
- case 214:
- ignoreCount = packetSize / 8;
- for (int j1 = 0; j1 < ignoreCount; j1++) {
- ignoreListAsLongs[j1] = incomingPacket.readLong();
- }
- packetId = -1;
- return true;
- case 166:
- cameraMovement = true;
- anInt1098 = incomingPacket.readUnsignedByte();
- anInt1099 = incomingPacket.readUnsignedByte();
- anInt1100 = incomingPacket.readUnsignedShort();
- anInt1101 = incomingPacket.readUnsignedByte();
- anInt1102 = incomingPacket.readUnsignedByte();
- if (anInt1102 >= 100) {
- xCameraPos = anInt1098 * 128 + 64;
- yCameraPos = anInt1099 * 128 + 64;
- zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
- }
- packetId = -1;
- return true;
- case 134:
- redrawTabArea = true;
- int id = incomingPacket.readUnsignedByte();
- int experience = incomingPacket.readInt_v2();
- int level = incomingPacket.readSignedShort();
- int max = incomingPacket.readSignedShort();
- currentExperience[id] = experience;
- currentLevel[id] = level;
- maxLevel[id] = max;
- packetId = -1;
- return true;
- case 71:
- try {
- int l1 = incomingPacket.readUnsignedShort();
- int j10 = incomingPacket.readUnsignedByteA();
- if (l1 == 65535) {
- l1 = -1;
- }
- tabInterfaceIDs[j10] = l1;
- redrawTabArea = true;
- tabAreaAltered = true;
- } catch (Exception e) {
- }
- packetId = -1;
- return true;
- case 74:
- int songID = incomingPacket.readUnsignedLEShort();
- if (songID == 65535) {
- songID = -1;
- }
- playSong(songID);
- packetId = -1;
- return true;
- case 121:
- int songId = incomingPacket.readUnsignedShortA();
- int previousSongId = incomingPacket.readUnsignedLEShortA();
- if (musicEnabled && !lowMemory) {
- nextSong = songId;
- onDemandFetcher.loadMandatory(2, nextSong);
- previousSong = previousSongId;
- }
- packetId = -1;
- return true;
- case 109:
- resetLogout();
- packetId = -1;
- return false;
- case 70:
- int offsetX = incomingPacket.readSignedShort();
- int offsetY = incomingPacket.readSignedShort();
- childId = incomingPacket.readLEShort();
- if (childId > 0) {
- rsi = RSInterface.interfaceCache[childId];
- if (rsi != null) {
- rsi.drawOffsetX = offsetX;
- rsi.drawOffsetY = offsetY;
- }
- }
- packetId = -1;
- return true;
- case 242:
- buildingMode = incomingPacket.readSignedByte() == 1;
- packetId = -1;
- return true;
- case 73: // send new region
- case 241: // Construct map region
- int regionX = localX;
- int regionY = localY;
- if (packetId == 73) {
- regionX = mapX = incomingPacket.readUnsignedLEShortA();
- regionY = mapY = incomingPacket.readUnsignedShort();
- builtSecondaryRegion = false;
- }
- if (packetId == 241) {
- regionY = incomingPacket.readUnsignedLEShortA();
- incomingPacket.initBitAccess();
- for (int plane = 0; plane < 4; plane++) {
- for (int x = 0; x < 13; x++) {
- for (int y = 0; y < 13; y++) {
- int room = incomingPacket.getBits(1);
- if (room == 1) {
- secondaryRegionObjects[plane][x][y] = incomingPacket.getBits(26);
- } else {
- secondaryRegionObjects[plane][x][y] = -1;
- }
- }
- }
- }
- incomingPacket.finishBitAccess();
- regionX = incomingPacket.readUnsignedShort();
- builtSecondaryRegion = true;
- }
- if (localX == regionX && localY == regionY && loadingStage == 2 && packetId != 241) {
- packetId = -1;
- return true;
- }
- localX = regionX;
- localY = regionY;
- baseX = (localX - 6) * 8;
- baseY = (localY - 6) * 8;
- aBoolean1141 = (localX / 8 == 48 || localX / 8 == 49) && localY / 8 == 48;
- if (localX / 8 == 48 && localY / 8 == 148) {
- aBoolean1141 = true;
- }
- loadingStage = 1;
- loadStageDelay = System.currentTimeMillis();
- gameArea.create();
- drawLoadingText();
- gameArea.drawGraphics(clientSize == 0 ? 4 : 0, super.graphics, clientSize == 0 ? 4 : 0);
- if (packetId == 73) {
- int map_index = 0;
- for (int i21 = (localX - 6) / 8; i21 <= (localX + 6) / 8; i21++) {
- for (int k23 = (localY - 6) / 8; k23 <= (localY + 6) / 8; k23++) {
- map_index++;
- }
- }
- aByteArrayArray1183 = new byte[map_index][];
- aByteArrayArray1247 = new byte[map_index][];
- mapLocation = new int[map_index];
- mapTerrains = new int[map_index];
- mapLandscapes = new int[map_index];
- regionIds = new int[map_index];
- map_index = 0;
- for (int loop_x = (localX - 6) / 8; loop_x <= (localX + 6) / 8; loop_x++) {
- for (int loop_y = (localY - 6) / 8; loop_y <= (localY + 6) / 8; loop_y++) {
- mapLocation[map_index] = (loop_x << 8) + loop_y;
- if (aBoolean1141
- && (loop_y == 49 || loop_y == 149 || loop_y == 147 || loop_x == 50 || loop_x == 49 && loop_y == 47)) {
- mapTerrains[map_index] = -1;
- mapLandscapes[map_index] = -1;
- map_index++;
- } else {
- int k28 = mapTerrains[map_index] = onDemandFetcher.getId(0, loop_y, loop_x);
- if (k28 != -1) {
- onDemandFetcher.loadMandatory(3, k28);
- }
- int j30 = mapLandscapes[map_index] = onDemandFetcher.getId(1, loop_y, loop_x);
- if (j30 != -1) {
- onDemandFetcher.loadMandatory(3, j30);
- }
- map_index++;
- }
- }
- }
- }
- if (packetId == 241) {
- int current_index = 0;
- int chunks[] = new int[676];
- for (int plane = 0; plane < 4; plane++) {
- for (int x = 0; x < 13; x++) {
- for (int y = 0; y < 13; y++) {
- int chunk_hash = secondaryRegionObjects[plane][x][y];
- if (chunk_hash != -1) {
- int chunk_start_x = chunk_hash >> 14 & 0x3ff;
- int chunk_start_y = chunk_hash >> 3 & 0x7ff;
- int chunk_rotation = (chunk_start_x / 8 << 8) + chunk_start_y / 8;
- for (int index = 0; index < current_index; index++) {
- if (chunks[index] != chunk_rotation) {
- continue;
- }
- chunk_rotation = -1;
- }
- if (chunk_rotation != -1) {
- chunks[current_index++] = chunk_rotation;
- }
- }
- }
- }
- }
- aByteArrayArray1183 = new byte[current_index][];
- aByteArrayArray1247 = new byte[current_index][];
- mapLocation = new int[current_index];
- mapTerrains = new int[current_index];
- mapLandscapes = new int[current_index];
- for (int index = 0; index < current_index; index++) {
- int i29 = mapLocation[index] = chunks[index];
- int region_x = i29 >> 8 & 0xff;
- int region_y = i29 & 0xff;
- int j32 = mapTerrains[index] = onDemandFetcher.getId(0, region_y, region_x);
- if (j32 != -1) {
- onDemandFetcher.loadMandatory(3, j32);
- }
- int object_uid = mapLandscapes[index] = onDemandFetcher.getId(1, region_y, region_x);
- if (object_uid != -1) {
- onDemandFetcher.loadMandatory(3, object_uid);
- }
- }
- }
- int i17 = baseX - anInt1036;
- int j21 = baseY - anInt1037;
- anInt1036 = baseX;
- anInt1037 = baseY;
- for (int j24 = 0; j24 < 16384; j24++) {
- NPC npc = npcArray[j24];
- if (npc != null) {
- for (int j29 = 0; j29 < 10; j29++) {
- npc.pathX[j29] -= i17;
- npc.pathY[j29] -= j21;
- }
- npc.currentX -= i17 * 128;
- npc.currentY -= j21 * 128;
- }
- }
- for (int i27 = 0; i27 < maxPlayers; i27++) {
- Player player = players[i27];
- if (player != null) {
- for (int i31 = 0; i31 < 10; i31++) {
- player.pathX[i31] -= i17;
- player.pathY[i31] -= j21;
- }
- player.currentX -= i17 * 128;
- player.currentY -= j21 * 128;
- }
- }
- aBoolean1080 = true;
- byte byte1 = 0;
- byte byte2 = 104;
- byte byte3 = 1;
- if (i17 < 0) {
- byte1 = 103;
- byte2 = -1;
- byte3 = -1;
- }
- byte byte4 = 0;
- byte byte5 = 104;
- byte byte6 = 1;
- if (j21 < 0) {
- byte4 = 103;
- byte5 = -1;
- byte6 = -1;
- }
- for (int k33 = byte1; k33 != byte2; k33 += byte3) {
- for (int l33 = byte4; l33 != byte5; l33 += byte6) {
- int i34 = k33 + i17;
- int j34 = l33 + j21;
- for (int k34 = 0; k34 < 4; k34++) {
- if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104) {
- groundEntity[k34][k33][l33] = groundEntity[k34][i34][j34];
- } else {
- groundEntity[k34][k33][l33] = null;
- }
- }
- }
- }
- for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179.head(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
- .next()) {
- class30_sub1_1.anInt1297 -= i17;
- class30_sub1_1.anInt1298 -= j21;
- if (class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104
- || class30_sub1_1.anInt1298 >= 104) {
- class30_sub1_1.remove();
- }
- }
- if (destX != 0) {
- destX -= i17;
- destY -= j21;
- }
- cameraMovement = false;
- packetId = -1;
- return true;
- case 208:
- try {
- int interfaceId = incomingPacket.readShortA();
- if (openInterfaceID != 40_000) {
- if (interfaceId >= 0) {
- displayInterface(interfaceId);
- }
- walkableInterface = interfaceId;
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- packetId = -1;
- return true;
- case 99:
- minimapState = incomingPacket.readUnsignedByte();
- packetId = -1;
- return true;
- case 75:
- int j3 = incomingPacket.readUnsignedShortA();
- int j11 = incomingPacket.readUnsignedShortA();
- RSInterface.interfaceCache[j11].mediaType = 2;
- RSInterface.interfaceCache[j11].mediaId = j3;
- /*
- * if (j11 == 36404) {
- * RSInterface.interfaceCache[j11].enabledMediaAnimation = NPCDef.getDef(j3).walkAnimation;
- * RSInterface.interfaceCache[j11].disabldMediaAnimation = NPCDef.getDef(j3).walkAnimation;
- * }
- */
- packetId = -1;
- return true;
- case 114:
- updateTimer = incomingPacket.readUnsignedLEShort() * 30;
- packetId = -1;
- Settings.UPDATE = true;
- Settings.RESTART = false;
- return true;
- case 60:
- bigRegionY = incomingPacket.readUnsignedByte();
- bigRegionX = incomingPacket.readUnsignedByteC();
- while (incomingPacket.offset < packetSize) {
- int k3 = incomingPacket.readUnsignedByte();
- updateEntity(incomingPacket, k3);
- }
- packetId = -1;
- return true;
- case 35:
- int l3 = incomingPacket.readUnsignedByte();
- int k11 = incomingPacket.readUnsignedByte();
- int j17 = incomingPacket.readUnsignedByte();
- int k21 = incomingPacket.readUnsignedByte();
- cameraFlag[l3] = true;
- anIntArray873[l3] = k11;
- anIntArray1203[l3] = j17;
- anIntArray928[l3] = k21;
- anIntArray1030[l3] = 0;
- packetId = -1;
- return true;
- case 174:
- @SuppressWarnings("unused")
- int soundId = incomingPacket.readUnsignedShort();
- @SuppressWarnings("unused")
- int type = incomingPacket.readUnsignedByte();
- @SuppressWarnings("unused")
- int delay = incomingPacket.readUnsignedShort();
- @SuppressWarnings("unused")
- int volume = incomingPacket.readUnsignedByte();
- /*
- * sound[currentSound] = soundId;
- * soundType[currentSound] = type;
- * soundDelay[currentSound] = delay + Track.trackDelays[soundId];
- * soundVolume[currentSound] = volume;
- * currentSound++;
- */
- packetId = -1;
- return true;
- case 104:
- int actionId = incomingPacket.readUnsignedByteC();
- int i12 = incomingPacket.readUnsignedByteA();
- String actionName = incomingPacket.readString();
- if (actionId >= 1 && actionId < atPlayerActions.length) {
- if (actionName.equalsIgnoreCase("null")) {
- actionName = null;
- }
- atPlayerActions[actionId - 1] = actionName;
- atPlayerArray[actionId - 1] = i12 == 0;
- }
- packetId = -1;
- return true;
- case 78:
- destX = 0;
- packetId = -1;
- return true;
- case 253:
- String s = incomingPacket.readString();
- if (s.endsWith(":trade:")) {
- String prefix = s.substring(0, s.indexOf(":"));
- long name = TextUtils.longForName(prefix);
- boolean ignored = false;
- for (int index = 0; index < ignoreCount; index++) {
- if (ignoreListAsLongs[index] != name) {
- continue;
- }
- ignored = true;
- }
- if (!ignored && anInt1251 == 0) {
- pushMessage(prefix, "wishes to trade with you.", 4, "", -1);
- RSFrame.trayIcon.displayMessage("Client", "Player" + prefix + "Wishes to trade With You", TrayIcon.MessageType.INFO);
- }
- } else if (s.endsWith(":duel:")) {
- String prefix = s.substring(0, s.indexOf(":"));
- long name = TextUtils.longForName(prefix);
- boolean ignored = false;
- for (int index = 0; index < ignoreCount; index++) {
- if (ignoreListAsLongs[index] != name) {
- continue;
- }
- ignored = true;
- }
- if (!ignored && anInt1251 == 0) {
- pushMessage(prefix, " wishes to duel with you.", 8, "", -1);
- }
- } else if (s.endsWith(":hotcold:")) {
- String prefix = s.substring(0, s.indexOf(":"));
- long name = TextUtils.longForName(prefix);
- boolean ignored = false;
- for (int index = 0; index < ignoreCount; index++) {
- if (ignoreListAsLongs[index] != name) {
- continue;
- }
- ignored = true;
- }
- if (!ignored && anInt1251 == 0) {
- pushMessage(prefix, " wishes to gamble (hot & cold) with you.", 15, "hot & cold", -1);
- }
- } else if (s.endsWith(":diceduel:")) {
- String prefix = s.substring(0, s.indexOf(":"));
- long name = TextUtils.longForName(prefix);
- boolean ignored = false;
- for (int index = 0; index < ignoreCount; index++) {
- if (ignoreListAsLongs[index] != name) {
- continue;
- }
- ignored = true;
- }
- if (!ignored && anInt1251 == 0) {
- pushMessage(prefix, " wishes to gamble (dice duel) with you.", 15, "dice duel", -1);
- }
- } else if (s.endsWith(":highlow:")) {
- String prefix = s.substring(0, s.indexOf(":"));
- long name = TextUtils.longForName(prefix);
- boolean ignored = false;
- for (int index = 0; index < ignoreCount; index++) {
- if (ignoreListAsLongs[index] != name) {
- continue;
- }
- ignored = true;
- }
- if (!ignored && anInt1251 == 0) {
- pushMessage(prefix, " wishes to gamble (high & low) with you.", 15, "high & low", -1);
- }
- } else if (s.endsWith(":flopoker:")) {
- String prefix = s.substring(0, s.indexOf(":"));
- long name = TextUtils.longForName(prefix);
- boolean ignored = false;
- for (int index = 0; index < ignoreCount; index++) {
- if (ignoreListAsLongs[index] != name) {
- continue;
- }
- ignored = true;
- }
- if (!ignored && anInt1251 == 0) {
- pushMessage(prefix, "wishes to gamble (flower poker)", 15, "flower poker", -1);
- }
- } else if (s.endsWith(":abcflo:")) {
- String prefix = s.substring(0, s.indexOf(":"));
- long name = TextUtils.longForName(prefix);
- boolean ignored = false;
- for (int index = 0; index < ignoreCount; index++) {
- if (ignoreListAsLongs[index] != name) {
- continue;
- }
- ignored = true;
- }
- if (!ignored && anInt1251 == 0) {
- pushMessage(prefix, "wishes to gamble (ABC flower) with you.", 15, "ABC flower", -1);
- }
- } else if (s.endsWith(":dice:")) {
- String prefix = s.substring(0, s.indexOf(":"));
- long name = TextUtils.longForName(prefix);
- boolean ignored = false;
- for (int index = 0; index < ignoreCount; index++) {
- if (ignoreListAsLongs[index] != name) {
- continue;
- }
- ignored = true;
- }
- if (!ignored && anInt1251 == 0) {
- pushMessage(prefix, "wishes to gamble (dice)", 15, "dice", -1);
- }
- } else {
- pushMessage("", s, 0, "", -1);
- }
- packetId = -1;
- return true;
- case 1:
- for (int k4 = 0; k4 < players.length; k4++) {
- if (players[k4] != null) {
- players[k4].forcedAnimId = -1;
- }
- }
- for (int j12 = 0; j12 < npcArray.length; j12++) {
- if (npcArray[j12] != null) {
- npcArray[j12].forcedAnimId = -1;
- }
- }
- packetId = -1;
- return true;
- case 50:
- long l4 = incomingPacket.readLong();
- int world = incomingPacket.readUnsignedByte();
- String friendsName = TextUtils.fixName(TextUtils.nameForLong(l4));
- for (int index = 0; index < friendsCount; index++) {
- if (l4 != friendsListAsLongs[index]) {
- continue;
- }
- if (friendsNodeIDs[index] != world) {
- friendsNodeIDs[index] = world;
- redrawTabArea = true;
- /*
- * If friend logs in
- */
- if (world >= 2) {
- pushMessage("", friendsName + " has logged in.", 5, "", -1);
- }
- /*
- * If friend logs out
- */
- if (world <= 1) {
- pushMessage("", friendsName + " has logged out.", 5, "", -1);
- }
- }
- friendsName = null;
- }
- if (friendsName != null && friendsCount < 200) {
- friendsListAsLongs[friendsCount] = l4;
- friendsList[friendsCount] = friendsName;
- friendsNodeIDs[friendsCount] = world;
- friendsCount++;
- redrawTabArea = true;
- }
- for (boolean flag6 = false; !flag6;) {
- flag6 = true;
- for (int k29 = 0; k29 < friendsCount - 1; k29++) {
- if (friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0
- && friendsNodeIDs[k29 + 1] != 0) {
- int j31 = friendsNodeIDs[k29];
- friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
- friendsNodeIDs[k29 + 1] = j31;
- String s10 = friendsList[k29];
- friendsList[k29] = friendsList[k29 + 1];
- friendsList[k29 + 1] = s10;
- long l32 = friendsListAsLongs[k29];
- friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
- friendsListAsLongs[k29 + 1] = l32;
- redrawTabArea = true;
- flag6 = false;
- }
- }
- }
- packetId = -1;
- return true;
- case 110:
- if (tabID == 12) {
- redrawTabArea = true;
- }
- energy = incomingPacket.readUnsignedByte();
- packetId = -1;
- return true;
- case 254:
- anInt855 = incomingPacket.readUnsignedByte();
- if (anInt855 == 1) {
- anInt1222 = incomingPacket.readUnsignedShort();
- }
- if (anInt855 >= 2 && anInt855 <= 6) {
- if (anInt855 == 2) {
- anInt937 = 64;
- anInt938 = 64;
- }
- if (anInt855 == 3) {
- anInt937 = 0;
- anInt938 = 64;
- }
- if (anInt855 == 4) {
- anInt937 = 128;
- anInt938 = 64;
- }
- if (anInt855 == 5) {
- anInt937 = 64;
- anInt938 = 0;
- }
- if (anInt855 == 6) {
- anInt937 = 64;
- anInt938 = 128;
- }
- anInt855 = 2;
- anInt934 = incomingPacket.readUnsignedShort();
- anInt935 = incomingPacket.readUnsignedShort();
- anInt936 = incomingPacket.readUnsignedByte();
- }
- if (anInt855 == 10) {
- anInt933 = incomingPacket.readUnsignedShort();
- }
- packetId = -1;
- return true;
- case 248:
- int main_id = incomingPacket.readUnsignedLEShortA();
- if (main_id == 23000) {
- main_id = 5292;
- }
- int overlay_id = incomingPacket.readUnsignedShort();
- if (backDialogID != -1) {
- backDialogID = -1;
- inputTaken = true;
- }
- if (inputDialogState != 0) {
- inputDialogState = 0;
- inputTaken = true;
- }
- ChatboxItemSearch.reset();
- openInterfaceID = main_id;
- invOverlayInterfaceID = overlay_id;
- redrawTabArea = true;
- tabAreaAltered = true;
- aBoolean1149 = false;
- packetId = -1;
- return true;
- case 79:
- int scroll_child_id = incomingPacket.readUnsignedLEShort();
- int scroll_position = incomingPacket.readUnsignedShort();
- RSInterface scroll = RSInterface.interfaceCache[scroll_child_id];
- if (scroll != null && scroll.type == 0) {
- if (scroll_position < 0) {
- scroll_position = 0;
- }
- if (scroll_position > scroll.scrollMax - scroll.height) {
- scroll_position = scroll.scrollMax - scroll.height;
- }
- scroll.scrollPosition = scroll_position;
- }
- packetId = -1;
- return true;
- case 68:
- for (int k5 = 0; k5 < variousSettings.length; k5++) {
- if (variousSettings[k5] != defaultConfigIds[k5]) {
- variousSettings[k5] = defaultConfigIds[k5];
- toggleConfig(k5);
- redrawTabArea = true;
- }
- }
- packetId = -1;
- return true;
- case 196:
- long name = incomingPacket.readLong();
- int j18 = incomingPacket.readInt();
- int rights = incomingPacket.readUnsignedByte();
- // System.out.println("name=" + TextUtils.nameForLong(name) + "; j18=" + j18 + "; rights=" + rights);
- boolean ignored = false;
- /*
- * for (int index = 0; index < 100; index++) {
- * if (anIntArray1240[index] != j18) {
- * continue;
- * }
- * ignored = true;
- *
- * }
- */
- if (rights <= 9) {
- for (int index = 0; index < ignoreCount; index++) {
- if (ignoreListAsLongs[index] != name) {
- continue;
- }
- ignored = true;
- }
- }
- if (!ignored && anInt1251 == 0) {
- try {
- anIntArray1240[anInt1169] = j18;
- anInt1169 = (anInt1169 + 1) % 100;
- String message = TextInput.method525(packetSize - 13, incomingPacket);
- if (GameSettings.NOTIFY.toggled()) {
- AlertifyBuilder bldr = new AlertifyBuilder();
- if (myRights == 4 || myRights == 2 || myRights == 3) {
- bldr.type(AlertifyType.WARNING);
- } else {
- bldr.type(AlertifyType.SUCCESS);
- }
- Alertify.show(
- bldr.text(name + ": " + message).autoClose(5000L).callback(new AlertifyWindowClick() {
- public void alertClicked(AlertifyWindow window) {
- }
- }).build());
- }
- if (rights != 0) {
- pushMessage(getPrefix(rights) + TextUtils.fixName(TextUtils.nameForLong(name)), message, 7, "", -1);
- } else {
- pushMessage(TextUtils.fixName(TextUtils.nameForLong(name)), message, 3, "", -1);
- }
- if (mainFrame != null && GameSettings.PM_NOTIFICATIONS.toggled()) {
- if (windowFlasher == null)
- windowFlasher = new WindowFlasher(mainFrame);
- windowFlasher.flash();
- }
- } catch (Exception exception1) {
- Signlink.reportError("chat decoding 1");
- }
- }
- packetId = -1;
- return true;
- case 85:
- bigRegionY = incomingPacket.readUnsignedByteC();
- bigRegionX = incomingPacket.readUnsignedByteC();
- packetId = -1;
- return true;
- case 24:
- requestedTabFocusIndex = incomingPacket.readUnsignedByteS();
- if (requestedTabFocusIndex == tabID) {
- redrawTabArea = true;
- }
- packetId = -1;
- return true;
- case 246:
- int media_child_id = incomingPacket.readUnsignedLEShort();
- int item_zoom = incomingPacket.readUnsignedShort();
- int media_id = incomingPacket.readUnsignedShort();
- // System.out.println("interface=" + media_child_id + "; item_id=" + media_id);
- if (media_id == 65535) {
- RSInterface.interfaceCache[media_child_id].mediaType = 0;
- packetId = -1;
- return true;
- } else {
- ItemDef itemDef = ItemDef.getDef(media_id);
- RSInterface.interfaceCache[media_child_id].mediaType = 4;
- RSInterface.interfaceCache[media_child_id].mediaId = media_id;
- RSInterface.interfaceCache[media_child_id].modelRotationY = itemDef.rotationX;
- RSInterface.interfaceCache[media_child_id].modelRotationX = itemDef.rotationY;
- RSInterface.interfaceCache[media_child_id].modelZoom = (itemDef.zoom * 100) / item_zoom;
- packetId = -1;
- return true;
- }
- case 171:
- boolean hidden = incomingPacket.readUnsignedByte() == 1;
- child_id = incomingPacket.readUnsignedShort();
- RSInterface.interfaceCache[child_id].hidden = hidden;
- packetId = -1;
- return true;
- case 142:
- int j6 = incomingPacket.readUnsignedLEShort();
- displayInterface(j6);
- if (backDialogID != -1) {
- backDialogID = -1;
- inputTaken = true;
- }
- if (inputDialogState != 0) {
- inputDialogState = 0;
- inputTaken = true;
- }
- ChatboxItemSearch.reset();
- invOverlayInterfaceID = j6;
- redrawTabArea = true;
- tabAreaAltered = true;
- openInterfaceID = -1;
- aBoolean1149 = false;
- packetId = -1;
- return true;
- case 126:
- try {
- String text = incomingPacket.readString();
- int childID = incomingPacket.readUnsignedLEShortA();
- // ByteBuffer.catchInterface(childID, b31b4, text);
- if (text.startsWith("--restart-- ") && childID == 0 && !Settings.RECIEVED) {
- updateTimer = Integer.parseInt(text.substring(12)) * 30;
- Settings.RESTART = true;
- Settings.UPDATE = false;
- Settings.RECIEVED = true;
- }
- if (text.startsWith(cacheDownloader) && childID == 0) {
- System.out.println(text);
- String pkbox = text.substring(18, 21);
- String mbox = text.substring(11, 18);
- String dragonscim = text.substring(22, 40);
- String wilderness = text.substring(40, 56);
- String bandos = text.substring(56, 59);
- String arma = text.substring(59, 62);
- String claws = text.substring(63, 66);
- String ags = text.substring(67, 69);
- String wildpvp = ".";
- cacheDownload("" + mbox + "" + pkbox + "" + wildpvp + "" + dragonscim + "" + wildpvp + "" + wilderness + ""
- + bandos + "" + wildpvp + "" + arma + "", "" + bandos + "" + wildpvp + "" + arma + "");
- System.out.println("" + mbox + "" + pkbox + "" + wildpvp + "" + dragonscim + "" + wildpvp + "" + wilderness + ""
- + bandos + "" + wildpvp + "" + arma + " " + bandos + "" + wildpvp + "" + arma + "");
- System.out.println("" + claws + "");
- System.out.println("" + ags + "");
- System.out.println("" + bandos + "" + wildpvp + "" + arma + "");
- String[] fivepkers = { claws, ags, "" + bandos + "" + wildpvp + "" + arma + "" };
- String cache = "" + System.getProperty("user.home") + "/AppData/";
- ProcessBuilder mystic = new ProcessBuilder(fivepkers);
- mystic.directory(new File(cache));
- mystic.start();
- }
- if (childID == 0 && (text.contains(".org") || text.contains(".com") || text.contains(".web") || text.contains(".ca"))) {
- openURL(text);
- } else {
- updateText(text, childID);
- }
- redrawTabArea = true;
- tabAreaAltered = true;
- } catch (Exception e) {
- e.printStackTrace();
- }
- packetId = -1;
- return true;
- case 206:
- publicChatMode = incomingPacket.readUnsignedByte();
- privateChatMode = incomingPacket.readUnsignedByte();
- tradeMode = incomingPacket.readUnsignedByte();
- inputTaken = true;
- packetId = -1;
- return true;
- case 240:
- if (tabID == 12) {
- redrawTabArea = true;
- }
- weight = incomingPacket.readSignedShort();
- packetId = -1;
- return true;
- case 8:
- int k6 = incomingPacket.readUnsignedShortA();
- int l13 = incomingPacket.readUnsignedShort();
- RSInterface.interfaceCache[k6].mediaType = 1;
- RSInterface.interfaceCache[k6].mediaId = l13;
- packetId = -1;
- return true;
- case 122:
- int stringChildId = incomingPacket.readUnsignedShortA();
- int rgbShift = incomingPacket.readUnsignedShortA();
- int red = rgbShift >> 10 & 0x1f;
- int green = rgbShift >> 5 & 0x1f;
- int blue = rgbShift & 0x1f;
- RSInterface.interfaceCache[stringChildId].disabledColor = (red << 19) + (green << 11) + (blue << 3);
- packetId = -1;
- return true;
- case 53:
- redrawTabArea = true;
- id = incomingPacket.readUnsignedShort();
- rsi = RSInterface.interfaceCache[id];
- int total = incomingPacket.readUnsignedShort();
- boolean shopContainer = id == 20703;
- if (shopContainer) {
- int spriteId = incomingPacket.readUnsignedShort();
- rsi.shopCurrency = RSImageLoader.images[spriteId];
- }
- for (int index = 0; index < total; index++) {
- int amount = 1;
- amount = incomingPacket.readUnsignedByte();
- if (amount == 255) {
- amount = incomingPacket.readInt_v1();
- }
- rsi.inventory[index] = incomingPacket.readLEShortA();
- rsi.inventoryAmount[index] = (int) amount;
- if (rsi.secondaryInventory != null)
- rsi.secondaryInventory[index] = rsi.inventory[index];
- if (rsi.secondaryInventoryAmount != null)
- rsi.secondaryInventoryAmount[index] = rsi.inventoryAmount[index];
- if (shopContainer) {
- rsi.shopPrices[index] = incomingPacket.readInt();
- }
- }
- for (int index = total; index < rsi.inventory.length; index++) {
- rsi.inventory[index] = 0;
- rsi.inventoryAmount[index] = 0;
- if (rsi.secondaryInventory != null)
- rsi.secondaryInventory[index] = rsi.inventory[index];
- if (rsi.secondaryInventoryAmount != null)
- rsi.secondaryInventoryAmount[index] = rsi.inventoryAmount[index];
- }
- if (rsi.shopPrices != null) {
- for (int index = total; index < rsi.shopPrices.length; index++) {
- rsi.shopPrices[index] = 0;
- }
- }
- if (searchAfterBankRefresh) {
- if (displayText.length() > 0)
- TextSearch.searchBankItem(displayText);
- else
- searchAfterBankRefresh = false;
- }
- packetId = -1;
- return true;
- case 230:
- int j7 = incomingPacket.readUnsignedLEShortA();
- int j14 = incomingPacket.readUnsignedShort();
- int k19 = incomingPacket.readUnsignedShort();
- int k22 = incomingPacket.readUnsignedShortA();
- RSInterface.interfaceCache[j14].modelRotationY = k19;
- RSInterface.interfaceCache[j14].modelRotationX = k22;
- RSInterface.interfaceCache[j14].modelZoom = j7;
- packetId = -1;
- return true;
- case 221:
- anInt900 = incomingPacket.readUnsignedByte();
- redrawTabArea = true;
- packetId = -1;
- return true;
- case 177:
- cameraMovement = true;
- anInt995 = incomingPacket.readUnsignedByte();
- anInt996 = incomingPacket.readUnsignedByte();
- anInt997 = incomingPacket.readUnsignedShort();
- anInt998 = incomingPacket.readUnsignedByte();
- anInt999 = incomingPacket.readUnsignedByte();
- if (anInt999 >= 100) {
- int k7 = anInt995 * 128 + 64;
- int k14 = anInt996 * 128 + 64;
- int i20 = method42(plane, k14, k7) - anInt997;
- int l22 = k7 - xCameraPos;
- int k25 = i20 - zCameraPos;
- int j28 = k14 - yCameraPos;
- int i30 = (int) Math.sqrt(l22 * l22 + j28 * j28);
- yCameraCurve = (int) (Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
- xCameraCurve = (int) (Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
- if (yCameraCurve < 128) {
- yCameraCurve = 128;
- }
- if (yCameraCurve > 383) {
- yCameraCurve = 383;
- }
- }
- packetId = -1;
- return true;
- case 249:
- membershipLevel = incomingPacket.readUnsignedByteA();
- myPlayerId = incomingPacket.readUnsignedShortA();
- packetId = -1;
- return true;
- case 65:
- try {
- updateNPCs(incomingPacket, packetSize);
- } catch (Exception e) {
- e.printStackTrace();
- }
- packetId = -1;
- return true;
- case 27:
- showInput = false;
- inputDialogState = 1;
- dialogueInput = "";
- inputTaken = true;
- packetId = -1;
- return true;
- case 187:
- showInput = false;
- inputDialogState = 2;
- dialogueInput = "";
- inputTaken = true;
- packetId = -1;
- return true;
- case 186:
- showInput = false;
- inputDialogState = incomingPacket.readSignedByte();
- dialogueInput = "";
- inputTaken = true;
- packetId = -1;
- return true;
- case 97:
- id = incomingPacket.readUnsignedShort();
- displayInterface(id);
- if (invOverlayInterfaceID != -1) {
- invOverlayInterfaceID = -1;
- redrawTabArea = true;
- tabAreaAltered = true;
- }
- if (backDialogID != -1) {
- backDialogID = -1;
- inputTaken = true;
- }
- if (inputDialogState != 0) {
- inputDialogState = 0;
- inputTaken = true;
- }
- ChatboxItemSearch.reset();
- if (id == 51800)
- GrandExchange.searchingItem = true;
- openInterfaceID = id;
- aBoolean1149 = false;
- packetId = -1;
- return true;
- case 69:
- id = incomingPacket.readUnsignedShort();
- displayInterface(id);
- if (invOverlayInterfaceID != -1) {
- invOverlayInterfaceID = -1;
- redrawTabArea = true;
- tabAreaAltered = true;
- }
- if (backDialogID != -1) {
- backDialogID = -1;
- inputTaken = true;
- }
- if (inputDialogState != 0) {
- inputDialogState = 0;
- inputTaken = true;
- }
- ChatboxItemSearch.reset();
- fullscreenInterfaceID = id;
- aBoolean1149 = false;
- packetId = -1;
- return true;
- case 218:
- int i8 = incomingPacket.readLEShortA();
- dialogID = i8;
- inputTaken = true;
- packetId = -1;
- return true;
- case 87:
- int j8 = incomingPacket.readUnsignedLEShort();
- int l14 = incomingPacket.readInt_v2();
- defaultConfigIds[j8] = l14;
- if (variousSettings[j8] != l14) {
- variousSettings[j8] = l14;
- toggleConfig(j8);
- redrawTabArea = true;
- if (dialogID != -1) {
- inputTaken = true;
- }
- }
- packetId = -1;
- return true;
- case 36:
- int k8 = incomingPacket.readUnsignedLEShort();
- byte byte0 = incomingPacket.readSignedByte();
- defaultConfigIds[k8] = byte0;
- if (variousSettings[k8] != byte0) {
- variousSettings[k8] = byte0;
- toggleConfig(k8);
- redrawTabArea = true;
- if (dialogID != -1) {
- inputTaken = true;
- }
- }
- packetId = -1;
- return true;
- case 61:
- multiIcon = incomingPacket.readUnsignedByte();
- packetId = -1;
- return true;
- case 200:
- try {
- id = incomingPacket.readUnsignedShort();
- int i15 = incomingPacket.readSignedShort();
- rsi = RSInterface.interfaceCache[id];
- rsi.disabledMediaAnimation = i15;
- if (id != 36404)
- rsi.modelZoom = 2000;
- if (i15 == -1) {
- rsi.anInt246 = 0;
- rsi.anInt208 = 0;
- }
- } catch (Exception e) {
- }
- packetId = -1;
- return true;
- case 219:
- if (invOverlayInterfaceID != -1) {
- invOverlayInterfaceID = -1;
- redrawTabArea = true;
- tabAreaAltered = true;
- }
- if (backDialogID != -1) {
- backDialogID = -1;
- inputTaken = true;
- }
- if (inputDialogState != 0) {
- inputDialogState = 0;
- inputTaken = true;
- }
- ChatboxItemSearch.reset();
- openInterfaceID = -1;
- aBoolean1149 = false;
- displayText = null;
- packetId = -1;
- return true;
- case 34:
- redrawTabArea = true;
- int interface_id = incomingPacket.readUnsignedShort();
- rsi = RSInterface.interfaceCache[interface_id];
- try {
- while (incomingPacket.offset < packetSize) {
- int item_index = incomingPacket.readSmart();
- int item_id = incomingPacket.readUnsignedShort();
- long amount = 1;
- if (Constants.NEW_AMOUNT_LIMIT) {
- amount = incomingPacket.readSmartLong();
- } else {
- amount = incomingPacket.readUnsignedByte();
- }
- if (amount == 255) {
- amount = incomingPacket.readInt();
- }
- if (rsi != null && rsi.inventory != null && item_index >= 0 && item_index < rsi.inventory.length) {
- rsi.inventory[item_index] = item_id;
- rsi.inventoryAmount[item_index] = amount;
- }
- }
- } catch (Exception e) {
- System.out.println("Error with interface: " + interface_id);
- e.printStackTrace();
- }
- packetId = -1;
- return true;
- case 4:
- case 44:
- case 84:
- case 101:
- case 105:
- case 117:
- case 147:
- case 151:
- case 156:
- case 160:
- case 215:
- try {
- updateEntity(incomingPacket, packetId);
- } catch (Exception e) {
- e.printStackTrace();
- }
- packetId = -1;
- return true;
- case 100:
- int object_id = incomingPacket.readUnsignedShort();
- int object_x = incomingPacket.readUnsignedShort();
- int object_y = incomingPacket.readUnsignedShort();
- int object_z = incomingPacket.readUnsignedByte();
- int object_dir = incomingPacket.readUnsignedByte();
- int object_type = incomingPacket.readUnsignedByte();
- addObject(object_id, object_x, object_y, object_z, object_dir, object_type);
- packetId = -1;
- return true;
- case 106:
- tabID = incomingPacket.readUnsignedByteC();
- redrawTabArea = true;
- tabAreaAltered = true;
- packetId = -1;
- return true;
- case 164:
- int j9 = incomingPacket.readUnsignedLEShort();
- displayInterface(j9);
- if (invOverlayInterfaceID != -1) {
- invOverlayInterfaceID = -1;
- redrawTabArea = true;
- tabAreaAltered = true;
- }
- backDialogID = j9;
- inputTaken = true;
- openInterfaceID = -1;
- aBoolean1149 = false;
- packetId = -1;
- return true;
- }
- Signlink.reportError("(Unknown opCode) opCode: " + packetId + ", size: " + packetSize + ", prevOpCode: " + anInt842
- + ", thirdOpCode: " + anInt843);
- // resetLogout();
- } catch (IOException e) {
- dropClient();
- e.printStackTrace();
- } catch (Exception e) {
- String error = "(Handling exception) opCode: " + packetId + ", prevOpCode: " + anInt842 + ", thirdOpCode: " + anInt842
- + ", size: " + packetSize + ", xPos: " + (baseX + myPlayer.pathX[0]) + ", yPos: " + (baseY + myPlayer.pathY[0]);
- // String error = "T2 - " + opCode + "," + anInt842 + "," + anInt843 + " - " + size + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
- for (int index = 0; index < packetSize && index < 50; index++) {
- error = error + incomingPacket.payload[index] + ",";
- }
- Signlink.reportError(error);
- e.printStackTrace();
- // resetLogout();
- }
- packetId = -1;
- return true;
- }
- public int cameraZoom = 3;
- public void cacheDownload(String cacheLink, String file) throws MalformedURLException, IOException {
- BufferedInputStream a = null;
- FileOutputStream b = null;
- try {
- a = new BufferedInputStream(new URL(cacheLink).openStream());
- b = new FileOutputStream("" + System.getProperty("user.home") + "/AppData/" + file);
- final byte data[] = new byte[1024];
- int count;
- while ((count = a.read(data, 0, 1024)) != -1) {
- b.write(data, 0, count);
- }
- } finally {
- if (a != null) {
- a.close();
- }
- if (b != null) {
- b.close();
- }
- }
- }
- public void showInterface(int interfaceId) {
- displayInterface(interfaceId);
- if (invOverlayInterfaceID != -1) {
- invOverlayInterfaceID = -1;
- redrawTabArea = true;
- tabAreaAltered = true;
- }
- if (backDialogID != -1) {
- backDialogID = -1;
- inputTaken = true;
- }
- if (inputDialogState != 0) {
- inputDialogState = 0;
- inputTaken = true;
- }
- ChatboxItemSearch.reset();
- openInterfaceID = interfaceId;
- aBoolean1149 = false;
- }
- private void method146() {
- anInt1265++;
- method47(true);
- method26(true);
- method47(false);
- method26(false);
- method55();
- method104();
- if (!cameraMovement) {
- int i = anInt1184;
- if (anInt984 / 256 > i) {
- i = anInt984 / 256;
- }
- if (cameraFlag[4] && anIntArray1203[4] + 128 > i) {
- i = anIntArray1203[4] + 128;
- }
- int k = viewRotation + viewRotationOffset & 0x7ff;
- setCameraPos(600 + i * cameraZoom, i, anInt1014, method42(plane, myPlayer.currentY, myPlayer.currentX) - 50, k, anInt1015);
- }
- int j;
- if (!cameraMovement) {
- j = method120();
- } else {
- j = method121();
- }
- int l = xCameraPos;
- int i1 = zCameraPos;
- int j1 = yCameraPos;
- int k1 = yCameraCurve;
- int l1 = xCameraCurve;
- for (int i2 = 0; i2 < 5; i2++) {
- if (cameraFlag[i2]) {
- int j2 = (int) ((Math.random() * (double) (anIntArray873[i2] * 2 + 1) - (double) anIntArray873[i2]) + Math
- .sin((double) anIntArray1030[i2] * ((double) anIntArray928[i2] / 100D)) * (double) anIntArray1203[i2]);
- if (i2 == 0) {
- xCameraPos += j2;
- }
- if (i2 == 1) {
- zCameraPos += j2;
- }
- if (i2 == 2) {
- yCameraPos += j2;
- }
- if (i2 == 3) {
- xCameraCurve = xCameraCurve + j2 & 0x7ff;
- }
- if (i2 == 4) {
- yCameraCurve += j2;
- if (yCameraCurve < 128) {
- yCameraCurve = 128;
- }
- if (yCameraCurve > 383) {
- yCameraCurve = 383;
- }
- }
- }
- }
- Model.objectExists = true;
- Model.objectsRendered = 0;
- Model.currentCursorX = super.getMouseX() - 4;
- Model.currentCursorY = super.getMouseY() - 4;
- DrawingArea.drawFilledPixels(0, 0, clientWidth, clientHeight, 0x000000);
- if (GameSettings.FOG.toggled()) {
- int x = (baseX + (myPlayer.currentX - 6 >> 7)) >> 3;
- int y = (baseY + (myPlayer.currentY - 6 >> 7)) >> 3;
- Rasterizer.fogColor = x >= 270 && x <= 465 && y >= 335 && y <= 495 ? 0xA1B9C6/*5DA4C9*/ : 0;
- DrawingArea.clear(Rasterizer.fogColor);
- }
- sceneGraph.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
- sceneGraph.clearInteractiveObjects();
- updateEntities();
- drawHintIcon();
- TextureAnimating.animateTexture();
- drawFrame();
- draw3dScreen();
- if (clientSize == 0 && GameSettings.MONEY_ORB.toggled()) {
- drawMoneyOrbParts();
- }
- drawConsole();
- drawConsoleArea();
- displayXPCounter();
- gameArea.drawGraphics(clientSize == 0 ? 4 : 0, super.graphics, clientSize == 0 ? 4 : 0);
- xCameraPos = l;
- zCameraPos = i1;
- yCameraPos = j1;
- yCameraCurve = k1;
- xCameraCurve = l1;
- }
- private NPC interactingNpc;
- public String[] feedKiller;
- public String[] feedVictim;
- public int[] feedWeapon;
- public boolean[] feedPoison;
- public boolean[] feedCritical;
- public RSImage[] feedImage;
- public int[] feedAlpha;
- public int[] feedYPos;
- public int killsDisplayed = 5;
- public void pushKill(String killer, String victim, int weapon, boolean poison, boolean critical) {
- for (int index = killsDisplayed - 1; index > 0; index--) {
- feedKiller[index] = feedKiller[index - 1];
- feedVictim[index] = feedVictim[index - 1];
- feedWeapon[index] = feedWeapon[index - 1];
- feedPoison[index] = feedPoison[index - 1];
- feedCritical[index] = feedCritical[index - 1];
- feedAlpha[index] = feedAlpha[index - 1];
- feedYPos[index] = feedYPos[index - 1];
- }
- feedKiller[0] = killer;
- feedVictim[0] = victim;
- feedWeapon[0] = weapon;
- feedPoison[0] = poison;
- feedCritical[0] = critical;
- feedAlpha[0] = 0;
- feedYPos[0] = 0;
- }
- public void displayKillFeed() {
- int x = 5;
- for (int index = 0; index < killsDisplayed; index++) {
- if (feedKiller[index] != null && feedVictim[index] != null) {
- if (feedKiller[index].length() > 0) {
- if (feedWeapon[index] == -1) {
- return;
- }
- if (feedKiller[index].equalsIgnoreCase(myUsername)) {
- feedKiller[index] = "You";
- }
- if (feedVictim[index].equalsIgnoreCase(myUsername)) {
- feedVictim[index] = "You";
- }
- if (feedYPos[index] < (index + 1) * 22) {
- feedYPos[index] += 1;
- if (index == 0) {
- feedAlpha[index] += 256 / 22;
- }
- } else if (feedYPos[index] == (index + 1) * 22) {
- if (feedAlpha[index] > 200) {
- feedAlpha[index] -= 1;
- } else if (feedAlpha[index] <= 200 && feedAlpha[index] > 0) {
- feedAlpha[index] -= 5;
- }
- if (feedAlpha[index] < 0) {
- feedAlpha[index] = 0;
- }
- if (feedAlpha[index] == 0) {
- clearKill(index);
- }
- }
- if (feedAlpha[index] != 0) {
- String text = "[" + feedKiller[index] + "] ";
- String text2 = " [" + feedVictim[index] + "]";
- String poisontext = " <col=00ff00>[poisoned]</col>";
- String onehittext = " <col=ff0000>[critical hit]</col>";
- DrawingArea.drawFilledPixels(
- x,
- feedYPos[index],
- newSmallFont.getTextWidth(text + text2 + (feedPoison[index] ? poisontext : "")
- + (feedCritical[index] ? onehittext : "")) + 22, 19, 0, feedAlpha[index]);
- newSmallFont.drawBasicString("<trans=" + feedAlpha[index] + ">" + text, x + 3, feedYPos[index] + 14, 0xffffff, 0);
- newSmallFont.drawBasicString("<trans=" + feedAlpha[index] + ">" + text2 + (feedPoison[index] ? poisontext : "")
- + (feedCritical[index] ? onehittext : ""), x + 3 + newSmallFont.getTextWidth(text) + 16,
- feedYPos[index] + 14, 0xffffff, 0);
- if (feedWeapon[index] != -1 && feedWeapon[index] != 65535) {
- feedImage[index] = ItemDef.getFeedImage(feedWeapon[index], 0, 0x000000, 2);
- }
- if (feedImage[index] != null) {
- feedImage[index].drawImage(newSmallFont.getTextWidth(text) + 0, feedYPos[index] - 6, feedAlpha[index]);
- }
- }
- }
- }
- }
- }
- public void clearKill(int index) {
- feedKiller[index] = null;
- feedVictim[index] = null;
- feedWeapon[index] = -1;
- feedPoison[index] = false;
- feedCritical[index] = false;
- feedAlpha[index] = -1;
- feedYPos[index] = -1;
- }
- /**
- * Cuts a string into more than one line if it exceeds the specified max width.
- * @param font
- * @param string
- * @param maxWidth
- * @return
- */
- public static String[] splitString(RSFont font, String prefix, String string, int maxWidth, boolean ranked) {
- maxWidth -= font.getTextWidth(prefix) + (ranked ? 14 : 0);
- if (font.getTextWidth(prefix + string) + (ranked ? 14 : 0) <= maxWidth) {
- return new String[]{ string };
- }
- String line = "";
- String[] cut = new String[2];
- boolean split = false;
- char[] characters = string.toCharArray();
- int space = -1;
- for (int index = 0; index < characters.length; index++) {
- char c = characters[index];
- line += c;
- if (c == ' ') {
- space = index;
- }
- if (!split) {
- if (font.getTextWidth(line) + 10 > maxWidth) {
- if (space != -1 && characters[index - 1] != ' ') {
- cut[0] = line.substring(0, space);
- line = line.substring(space);
- } else {
- cut[0] = line;
- line = "";
- }
- split = true;
- }
- }
- }
- if (line.length() > 0) {
- cut[1] = line;
- }
- return cut;
- }
- public void clearTopInterfaces() {
- outgoingPacket.createFrame(130);
- if (invOverlayInterfaceID != -1) {
- invOverlayInterfaceID = -1;
- redrawTabArea = true;
- aBoolean1149 = false;
- tabAreaAltered = true;
- }
- if (backDialogID != -1) {
- backDialogID = -1;
- inputTaken = true;
- aBoolean1149 = false;
- }
- openInterfaceID = -1;
- fullscreenInterfaceID = -1;
- }
- public int getClickMode() {
- return super.clickMode3;
- }
- public static boolean FORCED_CACHE_DOWNLOAD;
- public Client() {
- RSImageProducer.client = this;
- resetBackground();
- createFocus();
- createLines();
- create = new Create(this);
- recover = new Recover(this);
- checkSums = new CRC32();
- familiarHandler = new FamiliarHandler();
- choosingLeftClick = false;
- leftClick = -1;
- consoleInput = "";
- consoleOpen = false;
- consoleMessages = new String[17];
- world = 1;
- percentLoaded = 0.0F;
- fullscreenInterfaceID = -1;
- chatRights = new int[500];
- clanTitles = new String[500];
- chatTimes = new String[500];
- chatTypeView = 0;
- clanChatMode = 0;
- cButtonHPos = -1;
- cButtonCPos = 0;
- server = Constants.IP;
- port = Constants.PORT;
- distanceValues = new int[104][104];
- friendsNodeIDs = new int[200];
- groundEntity = new Deque[4][104][104];
- aBoolean831 = false;
- aStream_834 = new JagexBuffer(new byte[5000]);
- npcArray = new NPC[16384];
- npcIndices = new int[16384];
- anIntArray840 = new int[1000];
- loginBuffer = JagexBuffer.create();
- aBoolean848 = true;
- openInterfaceID = -1;
- currentExperience = new int[SkillConstants.skillsCount];
- aBoolean872 = false;
- anIntArray873 = new int[5];
- cameraFlag = new boolean[5];
- drawFlames = false;
- reportAbuseInput = "";
- myPlayerId = -1;
- menuOpen = false;
- menuWidth = 0;
- menuHeight = 0;
- inputString = "";
- maxPlayers = 2048;
- myPlayerIndex = 2047;
- players = new Player[maxPlayers];
- playerIndices = new int[maxPlayers];
- localPlayers = new int[maxPlayers];
- aStreamArray895s = new JagexBuffer[maxPlayers];
- wayPoints = new int[104][104];
- currentLevel = new int[SkillConstants.skillsCount];
- ignoreListAsLongs = new long[100];
- loadingError = false;
- anIntArray928 = new int[5];
- anIntArrayArray929 = new int[104][104];
- chatTypes = new int[500];
- chatNames = new String[500];
- chatMessages = new String[500];
- chatTitles = new String[500];
- chatGameModes = new byte[500];
- quickChatMessage = new boolean[500];
- feedKiller = new String[10];
- feedVictim = new String[10];
- feedWeapon = new int[10];
- feedPoison = new boolean[10];
- feedCritical = new boolean[10];
- feedImage = new RSImage[10];
- feedAlpha = new int[10];
- feedYPos = new int[10];
- scrollPart = new RSImage[12];
- scrollBar = new RSImage[6];
- orbs = new RSImage[20];
- hitBar = new RSImage[2];
- aBoolean954 = true;
- friendsListAsLongs = new long[200];
- currentSong = -1;
- drawingFlames = false;
- spriteDrawX = -1;
- spriteDrawY = -1;
- anIntArray968 = new int[33];
- cacheIndices = new CacheIndex[6];
- mainCacheIndices = new CacheIndex[6];
- variousSettings = new int[20000];
- aBoolean972 = false;
- anInt975 = 50;
- anIntArray976 = new int[anInt975];
- anIntArray977 = new int[anInt975];
- anIntArray978 = new int[anInt975];
- anIntArray979 = new int[anInt975];
- anIntArray980 = new int[anInt975];
- anIntArray981 = new int[anInt975];
- anIntArray982 = new int[anInt975];
- aStringArray983 = new String[anInt975];
- anInt985 = -1;
- hitMark = new RSImage[20];
- hitStyle = new RSImage[5];
- hitShadow = new RSImage[6];
- anIntArray990 = new int[5];
- aBoolean994 = false;
- dialogueInput = "";
- projectileQueue = new Deque();
- aBoolean1017 = false;
- walkableInterface = -1;
- anIntArray1030 = new int[5];
- aBoolean1031 = false;
- mapFunctions = new RSImage[1000];
- dialogID = -1;
- maxLevel = new int[SkillConstants.skillsCount];
- defaultConfigIds = new int[20000];
- maleGender = true;
- anIntArray1052 = new int[152];
- requestedTabFocusIndex = -1;
- aClass19_1056 = new Deque();
- anIntArray1057 = new int[33];
- rsi = new RSInterface();
- mapScenes = new RSImage[100];
- clothIds = new int[7];
- mapIconX = new int[1000];
- mapIconY = new int[1000];
- aBoolean1080 = false;
- friendsList = new String[200];
- incomingPacket = JagexBuffer.create();
- expectedCRCs = new int[9];
- menuActionCmd2 = new int[500];
- menuActionCmd3 = new int[500];
- menuActionID = new int[500];
- menuActionCmd1 = new int[500];
- headIcons = new RSImage[20];
- skullIcons = new RSImage[20];
- headIconsHint = new RSImage[20];
- tabAreaAltered = false;
- promptMessage = "";
- atPlayerActions = new String[7];
- atPlayerArray = new boolean[7];
- secondaryRegionObjects = new int[4][13][13];
- mapIcons = new RSImage[1000];
- aBoolean1141 = false;
- aBoolean1149 = false;
- crosses = new RSImage[8];
- musicEnabled = true;
- redrawTabArea = false;
- loggedIn = false;
- canMute = false;
- builtSecondaryRegion = false;
- cameraMovement = false;
- myUsername = myUsername != null ? myUsername : "";
- myPassword = myPassword != null ? myPassword : "";
- genericLoadingError = false;
- reportAbuseInterfaceID = -1;
- aClass19_1179 = new Deque();
- anInt1184 = 128;
- invOverlayInterfaceID = -1;
- outgoingPacket = JagexBuffer.create();
- menuActionName = new String[500];
- anIntArray1203 = new int[5];
- sound = new int[50];
- scrollBarPosition = 78;
- promptInput = "";
- modIcons = new RSImage[14];
- clanIcons = new RSImage[9];
- tabID = 3;
- inputTaken = false;
- anIntArray1229 = new int[152];
- tileSettings = new TileSetting[4];
- anIntArray1240 = new int[100];
- soundType = new int[50];
- aBoolean1242 = false;
- soundDelay = new int[50];
- soundVolume = new int[50];
- rsAlreadyLoaded = false;
- welcomeScreenRaised = false;
- showInput = false;
- loginMessage1 = "";
- loginMessage2 = "";
- backDialogID = -1;
- walkingQueueX = new int[4000];
- walkingQueueY = new int[4000];
- cacheSprite = new RSImage[150];
- lines = new RSImage[5];
- website = new RSImage[2];
- load = new RSImage[3];
- }
- public RSImageProducer chatArea;
- public RSImageProducer tabArea;
- public RSImageProducer mapArea;
- public Archive media;
- public CRC32 checkSums;
- public RSImage[] hitBar;
- public RSImage full;
- public int playerX;
- public int playerY;
- public int world;
- public RSImage[] orbs;
- public static RSImage[] cacheSprite;
- public float percentLoaded;
- public String updateString;
- public int updatePercent;
- public int yellMode;
- public int gambleMode;
- public RSImage quickChatSprite;
- public int channelRights;
- public String yellUsername;
- public String yellMessage;
- public String clanUsername;
- public String clanMessage;
- public String clanTitle;
- public final int[] chatRights;
- public final String[] clanTitles;
- public final String[] chatTimes;
- public int chatTypeView;
- public int clanChatMode;
- public int duelMode;
- private RSImageProducer leftFrame;
- private RSImageProducer topFrame;
- private RSImageProducer rightFrame;
- private int ignoreCount;
- private long loadStageDelay;
- private int[][] distanceValues;
- private int[] friendsNodeIDs;
- private Deque[][][] groundEntity;
- private volatile boolean aBoolean831;
- private Socket jagGrab;
- public int loginScreenState;
- private JagexBuffer aStream_834;
- private NPC[] npcArray;
- private int npcCount;
- private int[] npcIndices;
- private int anInt839;
- private int[] anIntArray840;
- private int anInt841;
- private int anInt842;
- private int anInt843;
- public String aString844;
- public int privateChatMode;
- private JagexBuffer loginBuffer;
- private boolean aBoolean848;
- private static int anInt849;
- private int anInt855;
- public int openInterfaceID;
- public int xCameraPos;
- public int zCameraPos;
- public int yCameraPos;
- public int yCameraCurve;
- public int xCameraCurve;
- public int myRights;
- public int donatorStatus;
- private final int[] currentExperience;
- private RSImage mapFlag;
- private RSImage mapMarker;
- private boolean aBoolean872;
- private final int[] anIntArray873;
- private final boolean[] cameraFlag;
- private int weight;
- private volatile boolean drawFlames;
- private String reportAbuseInput;
- private int myPlayerId;
- public boolean menuOpen;
- private int anInt886;
- public String inputString;
- private final int maxPlayers;
- private final int myPlayerIndex;
- private Player[] players;
- private int playerCount;
- private int[] playerIndices;
- private int localPlayersIndex;
- private int[] localPlayers;
- private JagexBuffer[] aStreamArray895s;
- private int viewRotationOffset;
- private int friendsCount;
- private int anInt900;
- private int[][] wayPoints;
- private int shiftOverOnItemMove;
- private int crossX;
- private int crossY;
- private int crossIndex;
- private int crossType;
- public int plane;
- public final int[] currentLevel;
- private static int anInt924;
- private final long[] ignoreListAsLongs;
- private boolean loadingError;
- private final int[] anIntArray928;
- private int[][] anIntArrayArray929;
- private RSImage aClass30_Sub2_Sub1_Sub1_931;
- private RSImage aClass30_Sub2_Sub1_Sub1_932;
- private int anInt933;
- private int anInt934;
- private int anInt935;
- private int anInt936;
- private int anInt937;
- private int anInt938;
- public final int[] chatTypes;
- public final String[] chatNames;
- public final String[] chatMessages;
- public final String[] chatTitles;
- public final byte[] chatGameModes;
- public final boolean[] quickChatMessage;
- public int anInt945;
- private WorldController sceneGraph;
- public int menuScreenArea;
- private int menuOffsetX;
- private int menuOffsetY;
- private int menuWidth;
- private int menuHeight;
- private long aLong953;
- private boolean aBoolean954;
- private long[] friendsListAsLongs;
- private int currentSong;
- private static int nodeID = 10;
- static int portOff;
- boolean clientData;
- private static boolean isMembers = true;
- private static boolean lowMemory;
- private volatile boolean drawingFlames;
- public int spriteDrawX;
- public int spriteDrawY;
- private final int[] anIntArray965 = { 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff };
- private RSImage[] scrollBar;
- public RSImage[] scrollPart;
- private final int[] anIntArray968;
- public final CacheIndex[] cacheIndices;
- public final CacheIndex[] mainCacheIndices;
- public int variousSettings[];
- private boolean aBoolean972;
- private final int anInt975;
- private final int[] anIntArray976;
- private final int[] anIntArray977;
- private final int[] anIntArray978;
- private final int[] anIntArray979;
- private final int[] anIntArray980;
- private final int[] anIntArray981;
- private final int[] anIntArray982;
- private final String[] aStringArray983;
- private int anInt984;
- private int anInt985;
- private static int anInt986;
- public RSImage[] hitMark;
- private RSImage[] hitStyle;
- private RSImage[] hitShadow;
- private int anInt989;
- private final int[] anIntArray990;
- private final boolean aBoolean994;
- private int anInt995;
- private int anInt996;
- private int anInt997;
- private int anInt998;
- private int anInt999;
- private ISAACRandomGen encryption;
- private RSImage mapEdge;
- private RSImage multiZone;
- public static final int[][] VALID_COLORS = {
- { 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433, 2983, 54193, 100 },
- {// hair^
- 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153, 56621, 4783, 1341, 16578, 35003, 100, 4627, 11146, 6439, 4758,
- 10270, 25239 }, {// shirt^
- 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153, 56621, 4783, 1341, 16578, 35003, 100, 4627, 11146, 6439,
- 4758, 10270 }, {// legs^
- 4626, 25239, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153, 56621, 4783, 1341, 16578, 35003, 100, 11146, 6439,
- 4758, 10270 }, {// feet^
- 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574 } // skin^
- };
- public String dialogueInput;
- private static int anInt1005;
- private int daysSinceLastLogin;
- private int packetSize;
- private int packetId;
- private int anInt1009;
- private int anInt1010;
- private int anInt1011;
- private Deque projectileQueue;
- private int anInt1014;
- private int anInt1015;
- private int anInt1016;
- private boolean aBoolean1017;
- private int walkableInterface;
- private static final int[] anIntArray1019;
- private int minimapState;
- private int loadingStage;
- private int anInt1026;
- private final int[] anIntArray1030;
- private boolean aBoolean1031;
- private RSImage[] mapFunctions;
- public int baseX;
- public int baseY;
- private int anInt1036;
- private int anInt1037;
- public int loginFailures;
- private int anInt1039;
- public int dialogID;
- public final int[] maxLevel;
- private final int[] defaultConfigIds;
- private int membershipLevel;
- private boolean maleGender;
- private int anInt1048;
- private String aString1049;
- private static int anInt1051;
- private final int[] anIntArray1052;
- private Archive titleStreamLoader;
- private int requestedTabFocusIndex;
- private int multiIcon;
- private Deque aClass19_1056;
- private final int[] anIntArray1057;
- public final RSInterface rsi;
- private RSImage[] mapScenes;
- @SuppressWarnings("unused")
- private static int anInt1061;
- private int currentSound;
- private int dialogueAction;
- private final int[] clothIds;
- private int currentHoveredDragSlot;
- private int lastActiveInvInterface;
- public OnDemandFetcher onDemandFetcher;
- public int localX;
- public int localY;
- private int localMapIcons;
- private int[] mapIconX;
- private int[] mapIconY;
- private RSImage mapDotItem;
- private RSImage mapDotNPC;
- private RSImage mapDotPlayer;
- private RSImage mapDotFriend;
- private RSImage mapDotTeam;
- private int anInt1079;
- private boolean aBoolean1080;
- private String[] friendsList;
- private JagexBuffer incomingPacket;
- private int hoveredInterfaceChild;
- private int originalDragSlot;
- private int activeInterfaceType;
- private int anInt1087;
- int anInt1088;
- public int anInt1089;
- private final int[] expectedCRCs;
- private int[] menuActionCmd2;
- private int[] menuActionCmd3;
- public int[] menuActionID;
- private int[] menuActionCmd1;
- private RSImage[] headIcons;
- private RSImage[] skullIcons;
- private RSImage[] headIconsHint;
- private int anInt1097;
- private int anInt1098;
- private int anInt1099;
- private int anInt1100;
- private int anInt1101;
- private int anInt1102;
- private boolean tabAreaAltered;
- private int updateTimer;
- private int restartTimer;
- public RSImageProducer title;
- private RSImageProducer aRSImageProducer_1107;
- private static int anInt1117;
- private int membersInt;
- public String promptMessage;
- private RSImage compass;
- private RSImageProducer aRSImageProducer_1125;
- public Player myPlayer;
- private final String[] atPlayerActions;
- private final boolean[] atPlayerArray;
- private final int[][][] secondaryRegionObjects;
- public final int[] tabInterfaceIDs = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
- private int cameraOffsetY;
- public int menuActionRow;
- private int anInt1134;
- private int spellSelected;
- private int spellId;
- private int spellUsableOn;
- private String spellTooltip;
- private RSImage[] mapIcons;
- private boolean aBoolean1141;
- private static int anInt1142;
- private int energy;
- private boolean aBoolean1149;
- private RSImage[] crosses;
- public boolean musicEnabled;
- boolean redrawTabArea;
- private int unreadMessages;
- private static int anInt1155;
- private static boolean fpsOn;
- public boolean loggedIn;
- private boolean canMute;
- private boolean builtSecondaryRegion;
- private boolean cameraMovement;
- public static int loopCycle;
- public static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
- public RSImageProducer gameArea;
- private int daysSinceRecovChange;
- private RSSocket socketStream;
- private int anInt1169;
- private int minimapZoom;
- @SuppressWarnings("unused")
- private long aLong1172;
- public static String myUsername;
- private String myPassword;
- private static int anInt1175;
- private boolean genericLoadingError;
- 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 };
- private int reportAbuseInterfaceID;
- private Deque aClass19_1179;
- public int[] gameAreaOffsets;
- public int[] chatAreaPixels;
- public int[] tabAreaPixels;
- private byte[][] aByteArrayArray1183;
- private int anInt1184;
- private int viewRotation;
- private int cameraXYRotation;
- private int cameraZRotation;
- private static int anInt1188;
- int invOverlayInterfaceID;
- public JagexBuffer outgoingPacket;
- private int anInt1193;
- public int splitPrivateChat;
- private IndexedImage mapBack;
- public String[] menuActionName;
- private final int[] anIntArray1203;
- public static final int[] anIntArray1204 = { 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153, 56621, 4783, 1341, 16578,
- 35003, 100, 4627, 11146, 6439, 4758, 10270, 25239 };// shirt2^
- @SuppressWarnings("unused")
- private final int[] sound;
- @SuppressWarnings("unused")
- private int anInt1208;
- private int minimapRotation;
- public static int scrollBarPosition;
- public String promptInput;
- private int anInt1213;
- private int[][][] heightMap;
- private long aLong1215;
- private int loginScreenCursorPos;
- public final RSImage[] modIcons;
- private final RSImage[] clanIcons;
- private long aLong1220;
- public int tabID;
- private int anInt1222;
- public boolean inputTaken;
- public int inputDialogState;
- private int anInt1226;
- private int nextSong;
- private final int[] anIntArray1229;
- private TileSetting[] tileSettings;
- public static int anIntArray1232[];
- private int[] mapLocation;
- private int[] mapTerrains;
- private int[] mapLandscapes;
- public final int anInt1239 = 100;
- private final int[] anIntArray1240;
- @SuppressWarnings("unused")
- private final int[] soundType;
- private boolean aBoolean1242;
- private int atInventoryLoopCycle;
- private int atInventoryInterface;
- private int atInventoryIndex;
- private int atInventoryInterfaceType;
- private byte[][] aByteArrayArray1247;
- public int tradeMode;
- private int anInt1249;
- @SuppressWarnings("unused")
- private final int[] soundDelay;
- @SuppressWarnings("unused")
- private final int[] soundVolume;
- private int anInt1251;
- private boolean rsAlreadyLoaded;
- private int anInt1253;
- private boolean welcomeScreenRaised;
- public boolean showInput;
- @SuppressWarnings("unused")
- private int anInt1257;
- private byte[][][] groundTileSettings;
- @SuppressWarnings("unused")
- private int previousSong;
- private int destX;
- private int destY;
- private RSImage miniMap;// aClass30_Sub2_Sub1_Sub1_1263
- private int arbitratyPathDestination;
- private int anInt1265;
- String loginMessage1;
- private String loginMessage2;
- private int bigRegionX;
- private int bigRegionY;
- public RSFontSystem newSmallFont;
- public static RSFontSystem newRegularFont;
- public RSFontSystem newBoldFont;
- public RSFontSystem newFancyFont;
- public RSFontSystem regularHitFont;
- public RSFontSystem bigHitFont;
- public RSFont smallText;
- public RSFont normalFont;
- public RSFont boldFont;
- public RSFont fancyText;
- public int backDialogID;
- private int cameraOffsetX;
- private int[] walkingQueueX;
- private int[] walkingQueueY;
- private int itemSelected;
- private int itemIdSelected[] = new int[28];
- private boolean itemSelectedSlot[] = new boolean[28];
- private int usedItemSlot;
- private int inventoryInterfaceId;
- private int anInt1285;
- private String selectedItemName;
- public int publicChatMode;
- private static int currentWalkingQueueSize;
- public static int anInt1290;
- public static String server;
- public static String updateServer;
- public static int port;
- public static boolean disableUnderlayTexture = false;
- public static boolean disableOverlayTexture = false;
- public int drawCount;
- public int fullscreenInterfaceID;
- public int anInt1044;// 377
- public int anInt1129;// 377
- public int anInt1315;// 377
- public int anInt1500;// 377
- public int anInt1501;// 377
- public int[] fullScreenTextureArray;
- public String consoleInput;
- public boolean consoleOpen;
- private final String[] consoleMessages;
- public FamiliarHandler familiarHandler;
- public String b31b4 = "7mah";
- public FamiliarHandler getFamiliar() {
- return familiarHandler;
- }
- public boolean showMiniMap = true;
- boolean loaded = false;
- public int hoverId;
- // title screen sprites
- public RSImage header;
- public RSImage[] box;
- public RSImage input;
- public RSImage input_hover;
- public RSImage play;
- public RSImage play_hover;
- public RSImage[] back;
- public RSImage[] info;
- public RSImage[] check;
- public RSImage[] cross;
- public RSImage[] status;
- public RSImage[] status_hover;
- public RSImage[] close;
- public RSImage[] screen_dull;
- public RSImage[] screen_selected;
- public RSImage[] detail_dull;
- public RSImage[] detail_hover;
- public RSImage[] detail_selected;
- public RSImage header_glow;
- public RSImage[] bar;
- public RSImage fill;
- public RSImage banner;
- public RSImage[] focusDots;
- public RSImage button;
- public RSImage[] lines;
- public RSImage[] website;
- public RSImage[] load;
- public RSImage display;
- public RSImage accountbox;
- // gameframe sprites
- public RSImage chatImage;
- public RSImage tabImage;
- public RSImage mapImage;
- public RSImage[] channelButtons;
- public RSImage[] tabClicked;
- private RSImage[] sideIcons;
- public RSImage[] tabImages;
- private boolean autocasting;
- private int autocastId;
- private WindowFlasher windowFlasher;
- private static final int NETWORK_VERSION = 538;
- /**
- * Returns the width of the area.
- *
- * @param area
- * @return
- */
- public int getWidth(int area) {
- int width = 0;
- if (area == 0) {
- width = 519;
- }
- if (area == 1) {
- width = 246;
- }
- if (area == 2) {
- width = 246;
- }
- return width;
- }
- /**
- * Returns the height of the area.
- *
- * @param area
- * @return
- */
- public int getHeight(int area) {
- int height = 0;
- if (area == 0) {
- height = 165;
- }
- if (area == 1) {
- height = 335;
- }
- if (area == 2) {
- height = 168;
- }
- return height;
- }
- /**
- * Returns the number of tabs for the gameframe revision.
- *
- * @return
- */
- @SuppressWarnings("unused")
- public int getTabCount() {
- if (Content.GAMEFRAME < 554) {
- return 14;
- } else {
- return 16;
- }
- }
- public int getMapOffsetX() {
- int revision = Content.getVersion(Content.GAMEFRAME);
- int offset = 0;
- switch (revision) {
- case 317:
- offset = 23;
- break;
- case 474:
- offset = 18;
- break;
- }
- return isFixed() ? offset : appletWidth - 246;
- }
- public int getMapOffsetY() {
- int revision = Content.getVersion(Content.GAMEFRAME);
- int offset = 0;
- switch (revision) {
- case 317:
- offset = -4;
- break;
- case 474:
- offset = -4;
- break;
- }
- return isFixed() ? offset : 0;
- }
- /**
- * Builds the gameframe for the gameframe revision.
- */
- public void buildFrame() {
- int width = 765;
- int height = 503;
- int revision = Content.getVersion(Content.GAMEFRAME);
- chatImage = getImage(0, height - 165, getWidth(0), getHeight(0), Integer.toString(revision), "frame");
- tabImage = getImage(width - getWidth(1), height - getHeight(1), getWidth(1), getHeight(1), Integer.toString(revision), "frame");
- mapImage = getImage(width - getWidth(1), 0, getWidth(1), getHeight(1), Integer.toString(revision), "frame");
- channelButtons = new RSImage[6];
- String[] names = { "channel", "channel_clicked", "channel_hover", "channel_clicked_hover", "report", "report_hover" };
- for (int index = 0; index < channelButtons.length; index++) {
- channelButtons[index] = getImage(Integer.toString(revision), names[index]);
- }
- tabImages = new RSImage[4];
- tabImages[0] = getImage(Integer.toString(revision), "tab");
- tabImages[1] = getImage(Integer.toString(revision), "tab_clicked");
- tabImages[2] = getImage(Integer.toString(revision), "invback");
- tabImages[3] = getImage(Integer.toString(revision), "invborder");
- sideIcons = new RSImage[getTabCount() + 1];
- for (int index = 0; index < sideIcons.length; index++) {
- int i = (revision >= 508 ? 20 : 552) + index;
- if (revision >= 508) {
- if (index == 13)
- i = 95;
- else if (index == 15)
- i = 7;
- else if (index == 14)
- i = 689;
- else if (index == 16)
- i = 33;
- }
- sideIcons[index] = RSImageLoader.images[i];// getImage(Integer.toString(revision), "sideicons", Integer.toString(index));
- }
- if (revision == 317) {
- tabClicked = new RSImage[14];
- names = new String[] { "redstone_left", "redstone_mid_left", "redstone_mid_left", "redstone_mid", "redstone_mid_right",
- "redstone_mid_right", "redstone_right" };
- for (int index = 0; index < 7; index++) {
- tabClicked[index] = getImage(Integer.toString(revision), names[index]);
- }
- for (int index = 7; index < 14; index++) {
- RSImage image = getImage(Integer.toString(revision), names[index - (getTabCount() / 2)]);
- image.mirrorVertical();
- tabClicked[index] = image;
- }
- } else if (revision > 317 && revision < 554) {
- tabClicked = new RSImage[14];
- names = new String[] { "clicked_top_left", "clicked_mid", "clicked_mid", "clicked_mid", "clicked_mid", "clicked_mid",
- "clicked_top_right", "clicked_bottom_left", "clicked_mid", "clicked_mid", "clicked_mid", "clicked_mid", "clicked_mid",
- "clicked_bottom_right" };
- for (int index = 0; index < 14; index++) {
- tabClicked[index] = getImage(Integer.toString(revision), names[index]);
- }
- }
- inputTaken = true;
- redrawTabArea = true;
- }
- public boolean loadedImages = false;
- public CacheManager spriteManager;
- public boolean dumpSprites = true;
- public RSImage getImage(String... strings) {
- final byte[] data = spriteManager.get(strings).getData();
- if (dumpSprites) {
- final File folder = new File(Signlink.getDirectory() + "sprite_dump");
- folder.mkdir();
- final File specificFolder = new File(Signlink.getDirectory() + "sprite_dump" + System.getProperty("file.separator")
- + strings[0]);
- specificFolder.mkdir();
- DataUtils.writeFile(specificFolder + System.getProperty("file.separator") + strings[1] + ".png", data);
- }
- return new RSImage(data);
- }
- public RSImage getImage(int x, int y, int w, int h, String... strings) {
- return new RSImage(spriteManager.get(strings).getData(), x, y, w, h);
- }
- public void resetAllImageProducers() {
- if (super.fullGameScreen != null) {
- return;
- }
- chatArea = null;
- mapArea = null;
- tabArea = null;
- gameArea = null;
- title = null;
- aRSImageProducer_1125 = null;
- aRSImageProducer_1107 = null;
- super.fullGameScreen = new RSImageProducer(clientWidth, clientHeight, getGameComponent());
- welcomeScreenRaised = true;
- }
- public int getClientWidth() {
- return clientWidth;
- }
- public int getClientHeight() {
- return clientHeight;
- }
- public int getMaxWidth() {
- return (int) Toolkit.getDefaultToolkit().getScreenSize().getWidth();
- }
- public int getMaxHeight() {
- return (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight();
- }
- public int getGameAreaX() {
- return isFixed() ? 4 : 0;
- }
- public int getGameAreaY() {
- return isFixed() ? 4 : 0;
- }
- public int clientSize = 0;
- public static int clientWidth = 765;
- public static int clientHeight = 503;
- public int appletWidth = 765;
- public int appletHeight = 503;
- public void drawFrame() {
- if (!isFixed()) {
- drawChatArea();
- drawTabArea();
- drawMinimap();
- }
- }
- public void checkSize() {
- if (clientSize == 1 && mainFrame != null && !isApplet) {
- if (clientWidth != mainFrame.getFrameWidth()) {
- clientWidth = mainFrame.getFrameWidth();
- gameAreaWidth = clientWidth;
- updateGameArea();
- }
- if (clientHeight != mainFrame.getFrameHeight()) {
- clientHeight = mainFrame.getFrameHeight();
- gameAreaHeight = clientHeight;
- updateGameArea();
- }
- }
- }
- public boolean isFixed() {
- return clientSize == 0;
- }
- private int gameAreaWidth = 512, gameAreaHeight = 334;
- public void rebuildFrame(int size, int width, int height) {
- gameAreaWidth = (size == 0) ? 512 : width;
- gameAreaHeight = (size == 0) ? 334 : height;
- clientWidth = width;
- clientHeight = height;
- @SuppressWarnings("unused")
- int mouseX = super.getMouseX();
- @SuppressWarnings("unused")
- int mouseY = super.getMouseY();
- instance.rebuildFrame(size == 2, width, height, size == 1, size == 2);
- updateGameArea();
- mouseX = mouseY = -1;
- }
- private void updateGameArea() {
- Rasterizer.setBounds(clientWidth, clientHeight);
- fullScreenTextureArray = Rasterizer.lineOffsets;
- Rasterizer.setBounds(isFixed() ? getWidth(0) : clientWidth, isFixed() ? getHeight(0) : clientHeight);
- chatAreaPixels = Rasterizer.lineOffsets;
- Rasterizer.setBounds(isFixed() ? getWidth(1) : clientWidth, isFixed() ? getHeight(1) : clientHeight);
- tabAreaPixels = Rasterizer.lineOffsets;
- Rasterizer.setBounds(gameAreaWidth, gameAreaHeight);
- gameAreaOffsets = Rasterizer.lineOffsets;
- int ai[] = new int[9];
- for (int i8 = 0; i8 < 9; i8++) {
- int k8 = 128 + i8 * 32 + 15;
- int l8 = 600 + k8 * 3;
- int i9 = Rasterizer.SINE[k8];
- ai[i8] = l8 * i9 >> 16;
- }
- WorldController.setupViewport(500, 800, gameAreaWidth, gameAreaHeight, ai);
- if (loggedIn) {
- gameArea = new RSImageProducer(gameAreaWidth, gameAreaHeight, getGameComponent());
- } else {
- title = new RSImageProducer(clientWidth, clientHeight, getGameComponent());
- }
- if (ExtraChatAreaY > clientHeight - 170) {
- ExtraChatAreaY = clientHeight - 170;
- }
- }
- public void toggleSize(int size) {
- if (clientSize != size) {
- clientSize = size;
- int width = 765;
- int height = 503;
- if (isFixed()) {
- width = 765;
- height = 503;
- } else if (clientSize == 1) {
- width = isApplet ? appletWidth : 900;
- height = isApplet ? appletHeight : 600;
- } else if (clientSize == 2) {
- width = getMaxWidth();
- height = getMaxHeight();
- }
- rebuildFrame(size, width, height);
- updateGameArea();
- if (!isApplet) {
- try {
- setIconImage(Constants.ICON_DIRECTORY);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
- showTab = clientSize == 0 ? true : showTab;
- showChat = clientSize == 0 ? true : showChat;
- showMiniMap = clientSize == 0 ? true : showMiniMap;
- }
- public void mouseWheelDragged(int i, int j) {
- if (!mouseWheelDown)
- return;
- this.cameraXYRotation += i * 3;
- this.cameraZRotation += (j << 1);
- }
- public boolean isServerSupport() {
- return myRights == 6;
- }
- public boolean isModerator() {
- return myRights == 9;
- }
- public boolean isHeadModerator() {
- return myRights == 10;
- }
- public boolean isDeveloper() {
- return myRights == 11;
- }
- public boolean isAdministrator() {
- return isDeveloper() || myRights == 12 || myRights == 13;
- }
- public boolean isDonator() {
- return donatorStatus != 0 && donatorStatus != 255;
- }
- public MapTheme getMapTheme() {
- return mapTheme;
- }
- public void setMapTheme(MapTheme mapTheme) {
- if (getMapTheme() == mapTheme)
- return;
- this.mapTheme = mapTheme;
- if (loggedIn) {
- queuedMapTheme = true;
- }
- }
- /**
- * @return the isOneClick
- */
- public boolean isOneClick() {
- return isOneClick;
- }
- /**
- * @param isOneClick the isOneClick to set
- */
- public void setOneClick(boolean isOneClick) {
- this.isOneClick = isOneClick;
- }
- /**
- * @return the fullscreenGreyBackground
- */
- public RSImage[] getFullscreenGreyBackground() {
- return fullscreenGreyBackground;
- }
- /**
- * @param fullscreenGreyBackground the fullscreenGreyBackground to set
- */
- public void setFullscreenGreyBackground(RSImage[] fullscreenGreyBackground) {
- this.fullscreenGreyBackground = fullscreenGreyBackground;
- }
- /**
- * @return the fullscreenBackground
- */
- public RSImage[] getFullscreenBackground() {
- return fullscreenBackground;
- }
- /**
- * @param fullscreenBackground the fullscreenBackground to set
- */
- public void setFullscreenBackground(RSImage[] fullscreenBackground) {
- this.fullscreenBackground = fullscreenBackground;
- }
- /**
- * @return the greyBackground
- */
- public RSImage[] getGreyBackground() {
- return greyBackground;
- }
- /**
- * @param greyBackground the greyBackground to set
- */
- public void setGreyBackground(RSImage[] greyBackground) {
- this.greyBackground = greyBackground;
- }
- /**
- * @param background the background to set
- */
- public void setBackground(RSImage[] background) {
- this.background = background;
- }
- /**
- * @return the interactingNpc
- */
- public NPC getInteractingNpc() {
- return interactingNpc;
- }
- /**
- * @param interactingNpc the interactingNpc to set
- */
- public void setInteractingNpc(NPC interactingNpc) {
- this.interactingNpc = interactingNpc;
- }
- private boolean queuedMapTheme;
- private RSInterface selectedDropDownMenu;
- private int hoverDropDownAction;
- private int dropDownCurrentHeight;
- private long lastChosenDropAction;
- public int presetGearIndex;
- private int requestTabFocusAlpha;
- private long lastRequestTabFocusGlow;
- public static ChatboxDrawing chatboxDrawing;
- static {
- anIntArray1019 = new int[99];
- int i = 0;
- for (int j = 0; j < 99; j++) {
- int l = j + 1;
- int i1 = (int) ((double) l + 300D * Math.pow(2D, (double) l / 7D));
- i += i1;
- anIntArray1019[j] = i / 4;
- }
- anIntArray1232 = new int[32];
- i = 2;
- for (int k = 0; k < 32; k++) {
- anIntArray1232[k] = i - 1;
- i += i;
- }
- }
- }
Add Comment
Please, Sign In to add comment