Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Drawing of exp counter drops
- */
- @SuppressWarnings("unused")
- private int digits;
- @SuppressWarnings("unused")
- private static int anInt1290;
- @SuppressWarnings("unused")
- private final int[] orbX = { 0, 0, 24 };
- @SuppressWarnings("unused")
- private final int[] orbY = { 41, 85, 122 };
- @SuppressWarnings("unused")
- private final int[] orbTextX = { 15, 16, 40 };
- @SuppressWarnings("unused")
- private final int[] orbTextY = { 67, 111, 148 };
- @SuppressWarnings("unused")
- private final int[] coloredOrbX = { 27, 27, 51 };
- @SuppressWarnings("unused")
- private final int[] coloredOrbY = { 45, 89, 126 };
- @SuppressWarnings("unused")
- private final int[] currentInterface = { 4016, 4012, 149 };
- @SuppressWarnings("unused")
- private final int[] maximumInterface = { 4017, 4013, 149 };
- @SuppressWarnings("unused")
- private final int[] orbIconX = { 33, 30, 58 };
- @SuppressWarnings("unused")
- private final int[] orbIconY = { 51, 92, 130 };
- @SuppressWarnings("unused")
- private int currentTrackLoop;
- @SuppressWarnings("unused")
- private FileArchive mediaStreamLoader;
- @SuppressWarnings("unused")
- private int anInt1279;
- @SuppressWarnings("unused")
- private int anInt1264;
- @SuppressWarnings("unused")
- private final int anInt1239 = 100;
- @SuppressWarnings("unused")
- private int anInt1210;
- @SuppressWarnings("unused")
- private int anInt1171;
- @SuppressWarnings("unused")
- private int anInt1132;
- @SuppressWarnings("unused")
- private int member;
- @SuppressWarnings("unused")
- private int anInt988;
- @SuppressWarnings("unused")
- private int anInt897;
- @SuppressWarnings("unused")
- private String prayerBook;
- @SuppressWarnings("unused")
- private String clanname;
- @SuppressWarnings("unused")
- private int currentTrackPlaying;
- @SuppressWarnings("unused")
- private static final byte[] ReadFile(String fileName) {
- try {
- byte abyte0[];
- File file = new File(fileName);
- int i = (int) file.length();
- abyte0 = new byte[i];
- DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(fileName)));
- datainputstream.readFully(abyte0, 0, i);
- datainputstream.close();
- return abyte0;
- } catch (Exception e) {
- System.out.println((new StringBuilder()).append("Read Error: ").append(fileName).toString());
- return null;
- }
- }
- @SuppressWarnings("unused")
- private static AbstractMap.SimpleEntry<Integer, Integer> getNextInteger(ArrayList<Integer> values) {
- ArrayList<AbstractMap.SimpleEntry<Integer, Integer>> frequencies = new ArrayList<>();
- int maxIndex = 0;
- main: for (int i = 0; i < values.size(); ++i) {
- int value = values.get(i);
- for (int j = 0; j < frequencies.size(); ++j) {
- if (frequencies.get(j).getKey() == value) {
- frequencies.get(j).setValue(frequencies.get(j).getValue() + 1);
- if (frequencies.get(maxIndex).getValue() < frequencies.get(j).getValue()) {
- maxIndex = j;
- }
- continue main;
- }
- }
- frequencies.add(new AbstractMap.SimpleEntry<Integer, Integer>(value, 1));
- }
- return frequencies.get(maxIndex);
- }
- @SuppressWarnings("unused")
- private int getOrbFill(int statusInt) {
- if (statusInt <= Integer.MAX_VALUE && statusInt >= 97)
- return 0;
- else if (statusInt <= 96 && statusInt >= 93)
- return 1;
- else if (statusInt <= 92 && statusInt >= 89)
- return 2;
- else if (statusInt <= 88 && statusInt >= 85)
- return 3;
- else if (statusInt <= 84 && statusInt >= 81)
- return 4;
- else if (statusInt <= 80 && statusInt >= 77)
- return 5;
- else if (statusInt <= 76 && statusInt >= 73)
- return 6;
- else if (statusInt <= 72 && statusInt >= 69)
- return 7;
- else if (statusInt <= 68 && statusInt >= 65)
- return 8;
- else if (statusInt <= 64 && statusInt >= 61)
- return 9;
- else if (statusInt <= 60 && statusInt >= 57)
- return 10;
- else if (statusInt <= 56 && statusInt >= 53)
- return 11;
- else if (statusInt <= 52 && statusInt >= 49)
- return 12;
- else if (statusInt <= 48 && statusInt >= 45)
- return 13;
- else if (statusInt <= 44 && statusInt >= 41)
- return 14;
- else if (statusInt <= 40 && statusInt >= 37)
- return 15;
- else if (statusInt <= 36 && statusInt >= 33)
- return 16;
- else if (statusInt <= 32 && statusInt >= 29)
- return 17;
- else if (statusInt <= 28 && statusInt >= 25)
- return 18;
- else if (statusInt <= 24 && statusInt >= 21)
- return 19;
- else if (statusInt <= 20 && statusInt >= 17)
- return 20;
- else if (statusInt <= 16 && statusInt >= 13)
- return 21;
- else if (statusInt <= 12 && statusInt >= 9)
- return 22;
- else if (statusInt <= 8 && statusInt >= 7)
- return 23;
- else if (statusInt <= 6 && statusInt >= 5)
- return 24;
- else if (statusInt <= 4 && statusInt >= 3)
- return 25;
- else if (statusInt <= 2 && statusInt >= 1)
- return 26;
- else if (statusInt <= 0)
- return 27;
- return 0;
- }
- /**
- * Draws the exp counter
- */
- @SuppressWarnings("unused")
- private void drawExpCounter() {
- final boolean wilderness = openWalkableInterface == 23300;
- int width = 138;
- int xPos = wilderness && frameMode != ScreenMode.FIXED ? frameWidth - 383 : frameWidth - 395;
- int yPos = wilderness ? (frameMode != ScreenMode.FIXED ? 114 : 100) : 2;
- // Draw box ..
- // Rasterizer2D.drawTransparentBox(xPos, yPos, width, height, 0x5a5245,
- // 150);
- cacheSprite[337].drawAdvancedSprite(xPos, yPos);
- // Draw skill info..
- if (currentSkill != -1) {
- // Draw sprite icon..
- cacheSprite[73 + currentSkill].drawAdvancedSprite(xPos + 6, yPos + 7);
- // Draw black
- // Rasterizer2D.drawBox(xPos + 5, yPos + 30, width - 8, 10, 00000);
- cacheSprite[338].drawAdvancedSprite(xPos + 5, yPos + 30);
- // Draw green
- int currentLevel = maximumLevels[currentSkill];
- int percent = (width - 11);
- // Attempt to calculate percent...
- if (currentLevel != 99) {
- try {
- int initExp = getXPForLevel(currentLevel);
- int newExp = getXPForLevel(currentLevel + 1);
- int gained = currentExp[currentSkill] - initExp;
- int remainder = newExp - initExp;
- percent = (int) (((double) gained / (double) remainder) * (width - 11));
- if (percent > (width - 11)) {
- percent = (width - 11);
- }
- } catch (ArithmeticException e) {
- e.printStackTrace();
- }
- }
- Rasterizer2D.drawBox(xPos + 6, yPos + 32, percent, 8, getProgressColor(percent));
- }
- // Draw total exp..
- String totalExpString = "+" + StringUtils.insertCommasToNumber("" + totalExp + "");
- int textDrawX = totalExp < 1000 ? xPos + 120 : totalExp < 10000 ? xPos + 110 : xPos + 100 - totalExpString.length();
- newBoldFont.drawCenteredString(totalExpString, textDrawX, yPos + 14, 16777215, 0);
- }
- @SuppressWarnings("unused")
- private void sendButtonClick(int button, int toggle, int type) {
- Widget widget = Widget.interfaceCache[button];
- switch (type) {
- case 135:
- boolean flag8 = true;
- if (widget.contentType > 0) {
- flag8 = promptUserForInput(widget);
- }
- if (flag8) {
- sendPacket(new ClickButton(button));
- }
- break;
- // case reset setting widget
- case 646:
- sendPacket(new ClickButton(button));
- if (widget.valueIndexArray != null && widget.valueIndexArray[0][0] == 5) {
- if (settings[toggle] != widget.requiredValues[0]) {
- settings[toggle] = widget.requiredValues[0];
- updateVarp(toggle);
- }
- }
- break;
- case 169:
- sendPacket(new ClickButton(button));
- if (widget.valueIndexArray != null && widget.valueIndexArray[0][0] == 5) {
- settings[toggle] = 1 - settings[toggle];
- updateVarp(toggle);
- }
- break;
- default:
- System.out.println("button: " + button + " - toggle: " + toggle + " - type: " + type);
- break;
- }
- }
- /**
- * Sets button configurations on interfaces.
- */
- @SuppressWarnings("unused")
- private void sendConfiguration(int id, int state) {
- anIntArray1045[id] = state;
- if (settings[id] != state) {
- settings[id] = state;
- updateVarp(id);
- if (dialogueId != -1)
- updateChatbox = true;
- }
- }
- /**
- * Clears the screen of all open interfaces.
- */
- @SuppressWarnings("unused")
- private void clearScreen() {
- if (overlayInterfaceId != -1) {
- overlayInterfaceId = -1;
- tabAreaAltered = true;
- }
- if (backDialogueId != -1) {
- backDialogueId = -1;
- updateChatbox = true;
- }
- if (inputDialogState != 0) {
- inputDialogState = 0;
- updateChatbox = true;
- }
- openInterfaceId = -1;
- continuedDialogue = false;
- }
- /**
- * This method updates default messages upon login to the desired text of the interface text.
- */
- @SuppressWarnings("unused")
- private void updateStrings(String message, int index) {
- switch (index) {
- case 1675:
- sendString(message, 17508);
- break;// Stab
- case 1676:
- sendString(message, 17509);
- break;// Slash
- case 1677:
- sendString(message, 17510);
- break;// Crush
- case 1678:
- sendString(message, 17511);
- break;// Magic
- case 1679:
- sendString(message, 17512);
- break;// Range
- case 1680:
- sendString(message, 17513);
- break;// Stab
- case 1681:
- sendString(message, 17514);
- break;// Slash
- case 1682:
- sendString(message, 17515);
- break;// Crush
- case 1683:
- sendString(message, 17516);
- break;// Magic
- case 1684:
- sendString(message, 17517);
- break;// Range
- case 1686:
- sendString(message, 17518);
- break;// Strength
- case 1687:
- sendString(message, 17519);
- break;// Prayer
- }
- }
- @SuppressWarnings("unused")
- private void loginScreenAccessories() {
- /**
- * World-selection
- */
- setupLoginScreen();
- loginScreenAccessories.drawGraphics(400, super.graphics, 0);
- loginScreenAccessories.initDrawingArea();
- cacheSprite[57].drawSprite(6, 63);
- if (!Configuration.worldSwitch) {
- boldText.method382(0xffffff, 55, "World 301", 78, true);
- smallText.method382(0xffffff, 55, "Click to switch", 92, true);
- Configuration.server_address = "localhost";
- Configuration.server_port = 43594;
- }
- loginMusicImageProducer.drawGraphics(265, super.graphics, 562);
- loginMusicImageProducer.initDrawingArea();
- if (Configuration.enableMusic) {
- cacheSprite[58].drawSprite(158, 196);
- } else {
- cacheSprite[59].drawSprite(158, 196);
- stopMidi();
- }
- }
- @SuppressWarnings("unused")
- private void drawMusicSprites() {
- int musicState = 0;
- bottomRightImageProducer.initDrawingArea();
- switch (musicState) {
- case 0:
- cacheSprite[58].drawSprite(158, 196);
- break;
- case 1:
- cacheSprite[59].drawSprite(158, 196);
- break;
- }
- }
- @SuppressWarnings("unused")
- private void drawOnBankInterface() {
- /*
- * if(openInterfaceId == 5292 && Widget.interfaceCache[27000].defaultText.equals("1")) { int total_tabs = Integer.parseInt(Widget.interfaceCache[27001].defaultText); currentBankTab = Integer.parseInt(Widget.interfaceCache[27002].defaultText); for(int k = 0; k <= total_tabs; k++) { Widget.interfaceCache[27014 + k].disabledSprite = cacheSprite[123]; if(k == 0) { Widget.interfaceCache[27014 + k].actions = new String[]{"Main Tab"}; } else { Widget.interfaceCache[27014 + k].actions = new String[]{ "Select Tab", "Collapse Tab"}; } } for(int l = total_tabs + 1; l <= 8; l++) { Widget.interfaceCache[27014+ l].disabledSprite = null; Widget.interfaceCache[27014 + l].tooltip = null; Widget.interfaceCache[27014 + l].defaultText = null; } if(total_tabs != 8) { Widget.interfaceCache[27015 +
- * total_tabs].disabledSprite = cacheSprite[122]; Widget.interfaceCache[27015 + total_tabs].actions = new String[]{"Create Tab"}; } if(currentBankTab == -1) { Widget.interfaceCache[27013].disabledSprite = cacheSprite[124]; } else if(currentBankTab > 0) { Widget.interfaceCache[27014 + currentBankTab].disabledSprite = cacheSprite[126]; Widget.interfaceCache[27014].disabledSprite = cacheSprite[124]; } else { Widget.interfaceCache[27014].disabledSprite = cacheSprite[121]; } Widget.interfaceCache[27000].defaultText = "0"; }
- */
- }
- @SuppressWarnings("unused")
- private int getLevelForXP(int exp) {
- int points = 0;
- int output = 0;
- if (exp > 13034430) {
- return 99;
- }
- for (int lvl = 1; lvl <= 99; lvl++) {
- points += Math.floor(lvl + 300.0 * Math.pow(2.0, lvl / 7.0));
- output = (int) Math.floor(points / 4);
- if (output >= exp) {
- return lvl;
- }
- }
- return 0;
- }
- @SuppressWarnings("unused")
- private boolean isSelectingQuickPrayers() {
- return tabInterfaceIDs[5] == 17200;
- }
- @SuppressWarnings("unused")
- private void playSong(int id) {
- if (id != currentSong && Configuration.enableMusic && !lowMemory && prevSong == 0) {
- nextSong = id;
- fadeMusic = true;
- resourceProvider.provide(2, nextSong);
- currentSong = id;
- }
- }
- @SuppressWarnings("unused")
- private String getNameForTab(int tab) {
- switch (tab) {
- case 0:
- return "Combat";
- case 1:
- return "Stats";
- case 2:
- return "Spawn tab";
- case 3:
- return "Inventory";
- case 4:
- return "Equipment";
- case 5:
- return "Prayer";
- case 6:
- return "Magic";
- case 7:
- return "Clan chat";
- case 8:
- return "Friends";
- case 9:
- return "Ignores";
- case 10:
- return "Logout";
- case 11:
- return "Settings";
- case 12:
- return "Emotes";
- case 13:
- return "PvP";
- }
- return "";
- }
- /**
- * Initializes the client for startup
- */
- @SuppressWarnings("unused")
- private void initialize() {
- try {
- nodeID = 10;
- portOffset = 0;
- setHighMem();
- isMembers = true;
- SignLink.storeid = 32;
- SignLink.startpriv(InetAddress.getLocalHost());
- initClientFrame(frameWidth, frameHeight);
- instance = this;
- } catch (Exception exception) {
- return;
- }
- }
- @SuppressWarnings("unused")
- private void addObject(int x, int y, int objectId, int face, int type, int height) {
- int mX = this.regionX - 6;
- int mY = this.regionY - 6;
- int x2 = x - mX * 8;
- int y2 = y - mY * 8;
- int i15 = 40 >> 2;
- int l17 = objectGroups[i15];
- if (y2 > 0 && y2 < 103 && x2 > 0 && x2 < 103) {
- requestSpawnObject(-1, objectId, face, l17, y2, type, height, x2, 0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement