Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
- // Jad home page: http://www.kpdus.com/jad.html
- // Decompiler options: packimports(3)
- import java.applet.AppletContext;
- import java.awt.*;
- import java.io.*;
- import java.math.BigInteger;
- import java.net.*;
- import java.util.zip.CRC32;
- import java.util.zip.*;
- import java.lang.reflect.Method;
- import sign.signlink;
- import javax.swing.*;
- public class client extends RSApplet {
- public final String titleColor(final int i, int type) {
- String titleChatbox = "", titleRightclick = "";
- switch (i) {
- case 0: //orange
- titleChatbox = "13132800";
- titleRightclick = "ort";
- break;
- case 1: //purple
- titleChatbox = "11158698";
- titleRightclick = "put";
- break;
- case 2: //red
- titleChatbox = "12656646";
- titleRightclick = "ret";
- break;
- case 3: //green
- titleChatbox = "26112";
- titleRightclick = "grt";
- break;
- }
- if(type == 0)
- return titleChatbox;
- else
- return titleRightclick;
- }
- public int colorOfSplat = 0;
- public String hitText = "";
- public Sprite hitSprite = null;
- public int splatX = 0;
- public int splatY = 0;
- public int fadeOffset = 0;
- public int hitmarkWait = 0;
- public boolean addY = false;
- public Sprite[] bigSplats = new Sprite[3];
- //public Sprite[] combatIcons = new Sprite[10];
- //public Sprite[] combatIcons = new Sprite[4];
- public boolean
- is459 = false,
- is474 = false,
- is480 = false,
- is508 = false,
- is525 = false,
- is562 = true,
- idToggle = false,
- hitbarToggle = true,
- menuToggle = true,
- namesToggle = false,
- hitmarks = true;
- public static boolean
- newDamage = true,
- normalLogin = true,//KEEP TRUE!
- newHits = true;
- //public static boolean newDamage = true, newHits = true, normalLogin = true;
- public int getXPForLevel(int i)
- {
- int j = 0;
- int k = 0;
- for(int l = 1; l <= i; l++)
- {
- j = (int)((double)j + Math.floor((double)l + 300D * Math.pow(2D, (double)l / 7D)));
- if(l >= i)
- return k;
- k = (int)Math.floor(j / 4);
- }
- return 0;
- }
- public String skillNames[] = {
- "Attack", "Hitpoints", "Mining", "Strength", "Agility", "Smithing", "Defence", "Herblore", "Fishing", "Range",
- "Thieving", "Cooking", "Prayer", "Crafting", "Firemaking", "Magic", "Fletching", "Woodcutting", "Rune", "Slayer",
- "Farming", "Construction", "Hunter", "Summoning", "Dungeoneering"
- };
- public TextDrawingArea newSmallFont;
- public TextDrawingArea newRegularFont;
- public TextDrawingArea newBoldFont;
- public TextDrawingArea newFancyFont;
- public Sprite[] chatImages = new Sprite[7];
- public AlertHandler alertHandler;
- public Sprite alertBack;
- public Sprite alertBorder;
- public Sprite alertBorderH;
- private Sprite LFull;
- private Sprite LEmpty;
- public int followPlayer = 0;
- public int followNPC = 0;
- public int followDistance = 1;
- public boolean selectAction;
- public int isClicked;
- public Sprite[] LOGIN = new Sprite[27];
- public Sprite[] combatIcons = new Sprite[4];
- public Sprite qc;
- public void welcome() {
- }
- public void addLoginScreenHover(Sprite[] spriteName,int spriteId, int Xpos, int Ypos, int hoverId){
- spriteName[spriteId].drawSprite(Xpos, Ypos);
- if(super.mouseX >= Xpos && super.mouseX <= Xpos + spriteName[spriteId].myWidth && super.mouseY >= Ypos+3 && super.mouseY <= Ypos+spriteName[spriteId].myHeight+2){
- spriteName[hoverId].drawSprite(Xpos, Ypos);
- }
- }
- public void setSidebarInterface(int sidebarID, int interfaceID) {
- tabInterfaceIDs[sidebarID] = interfaceID;
- tabID = sidebarID;
- needDrawTabArea = true;
- tabAreaAltered = true;
- }
- public int positions[] = new int[2000];
- public int landScapes[] = new int[2000];
- public int objects[] = new int[2000];
- public void setNewMaps() {
- try {
- BufferedReader in = new BufferedReader(new FileReader(signlink.findcachedir()+"Maps/mapConfig.txt"));
- String s;
- int D = 0;
- while ((s = in.readLine()) != null) {
- positions[D] = Integer.parseInt(s.substring(s.indexOf("=")+1,s.indexOf("(")));
- landScapes[D] = Integer.parseInt(s.substring(s.indexOf("(")+1,s.indexOf(")")));
- objects[D] = Integer.parseInt(s.substring(s.indexOf("[")+1,s.indexOf("]")));
- D++;
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- public static String capitalize(String s) {
- for (int i = 0; i < s.length(); i++) {
- if (i == 0) {
- s = String.format( "%s%s",
- Character.toUpperCase(s.charAt(0)),
- s.substring(1) );
- }
- if (!Character.isLetterOrDigit(s.charAt(i))) {
- if (i + 1 < s.length()) {
- s = String.format( "%s%s%s",
- s.subSequence(0, i+1),
- Character.toUpperCase(s.charAt(i + 1)),
- s.substring(i+2) );
- }
- }
- }
- return s;
- }
- public int MapX, MapY;
- public static int spellID = 0;
- private static String intToKOrMilLongName(int i) {
- String s = String.valueOf(i);
- for(int k = s.length() - 3; k > 0; k -= 3)
- s = s.substring(0, k) + "," + s.substring(k);
- //if(j != 0)
- // aBoolean1224 = !aBoolean1224;
- if(s.length() > 8)
- s = "@blu@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
- else
- if(s.length() > 4)
- s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
- return " " + s;
- }
- public final String methodR(/*int i,*/ int j) {
- //if(i <= 0)
- // pktType = inStream.readUnsignedByte();
- if(j >= 0 && j < 10000)
- return String.valueOf(j);
- if(j >= 10000 && j < 10000000)
- return j / 1000 + "K";
- if(j >= 10000000 && j < 999999999)
- return j / 1000000 + "M";
- if(j >= 999999999)
- return "*";
- else
- return "?";
- }
- public void models() {
- for(int ModelIndex = 0; ModelIndex < 50000; ModelIndex++) {
- byte[] abyte0 = getModel(ModelIndex);
- if(abyte0 != null && abyte0.length > 0) {
- decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
- pushMessage("Model added successfully!", 0, "");
- }
- }
- }
- public byte[] getModel(int Index) {
- try {
- File Model = new File(signlink.findcachedir() + "/Raw/"+Index+".dat");//there we go.
- byte[] aByte = new byte[(int)Model.length()];
- FileInputStream fis = new FileInputStream(Model);
- fis.read(aByte);
- pushMessage("aByte = ["+aByte+"]!", 0, "");
- fis.close();
- return aByte;
- }
- catch(Exception e)
- {return null;}
- }
- private void stopMidi() {
- signlink.midifade = 0;
- signlink.midi = "stop";
- }
- private boolean menuHasAddFriend(int j) {
- if(j < 0)
- return false;
- int k = menuActionID[j];
- if(k >= 2000)
- k -= 2000;
- return k == 337;
- }
- public static final byte[] ReadFile(String s, boolean antiLeech) {
- try {
- byte abyte0[];
- File file = new File(s);
- int i = (int)file.length();
- abyte0 = new byte[i];
- DataInputStream datainputstream = new DataInputStream(new NovaScape(new FileInputStream(s)));
- datainputstream.readFully(abyte0, 0, i);
- datainputstream.close();
- return abyte0;
- } catch(Exception e) {
- System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
- return null;
- }
- }
- public void drawChannelButtons() {
- if(is459) {
- aTextDrawingArea_1271.method389(true, 25, 0xffffff, "Public chat", 142);
- aTextDrawingArea_1271.method389(true, 150, 0xffffff, "Private chat", 142);
- aTextDrawingArea_1271.method389(true, 285, 0xffffff, "Trade/compete", 142);
- aTextDrawingArea_1271.method389(true, 422, 0xffffff, "Report Abuse", 147);
- if(publicChatMode == 0)
- aTextDrawingArea_1271.method382(65280, 55, "On", 153, true);
- if(publicChatMode == 1)
- aTextDrawingArea_1271.method382(0xffff00, 55, "Friends", 153, true);
- if(publicChatMode == 2)
- aTextDrawingArea_1271.method382(0xff0000, 55, "Off", 153, true);
- if(publicChatMode == 3)
- aTextDrawingArea_1271.method382(65535, 55, "Hide", 153, true);
- if(privateChatMode == 0)
- aTextDrawingArea_1271.method382(65280, 180, "On", 153, true);
- if(privateChatMode == 1)
- aTextDrawingArea_1271.method382(0xffff00, 180, "Friends", 153, true);
- if(privateChatMode == 2)
- aTextDrawingArea_1271.method382(0xff0000, 180, "Off", 153, true);
- if(tradeMode == 0)
- aTextDrawingArea_1271.method382(65280, 324, "On", 153, true);
- if(tradeMode == 1)
- aTextDrawingArea_1271.method382(0xffff00, 324, "Friends", 153, true);
- if(tradeMode == 2)
- aTextDrawingArea_1271.method382(0xff0000, 324, "Off", 153, true);
- } else if(is480 || is508 || is525 || is562) {
- String text[] = { "On", "Friends", "Off", "Hide" };
- int disabledColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
- switch(cButtonCPos) {
- case 0: chatButtons[1].drawSprite(5, 142); break;
- case 1: chatButtons[1].drawSprite(62, 142); break;
- case 2: chatButtons[1].drawSprite(119, 142); break;
- case 3: chatButtons[1].drawSprite(176, 142); break;
- case 4: chatButtons[1].drawSprite(233, 142); break;
- case 5: chatButtons[1].drawSprite(290, 142); break;
- case 6: chatButtons[1].drawSprite(347, 142); break;
- } if(cButtonHPos == cButtonCPos) {
- switch(cButtonHPos) {
- case 0: chatButtons[2].drawSprite(5, 142); break;
- case 1: chatButtons[2].drawSprite(62, 142); break;
- case 2: chatButtons[2].drawSprite(119, 142); break;
- case 3: chatButtons[2].drawSprite(176, 142); break;
- case 4: chatButtons[2].drawSprite(233, 142); break;
- case 5: chatButtons[2].drawSprite(290, 142); break;
- case 7: chatButtons[2].drawSprite(347, 142); break;
- case 6: chatButtons[3].drawSprite(404, 142); break;
- }
- } else {
- switch(cButtonHPos) {
- case 0: chatButtons[2].drawSprite(5, 142); break;
- case 1: chatButtons[2].drawSprite(62, 142); break;
- case 2: chatButtons[2].drawSprite(119, 142); break;
- case 3: chatButtons[2].drawSprite(176, 142); break;
- case 4: chatButtons[2].drawSprite(233, 142); break;
- case 5: chatButtons[2].drawSprite(290, 142); break;
- case 7: chatButtons[2].drawSprite(347, 142); break;
- case 6: chatButtons[3].drawSprite(404, 142); break;
- }
- }
- smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
- smallText.method389(true, 26, 0xffffff, "All", 157);
- smallText.method389(true, 76, 0xffffff, "Game", 157);
- smallText.method389(true, 131, 0xffffff, "Public", 153);
- smallText.method389(true, 184, 0xffffff, "Private", 153);
- smallText.method389(true, 249, 0xffffff, "Clan", 153);
- smallText.method389(true, 304, 0xffffff, "Trade", 153);
- smallText.method389(true, 359, 0xffffff, "Assist", 153);
- smallText.method382(disabledColor[publicChatMode], 147, text[publicChatMode], 164, true);
- smallText.method382(disabledColor[privateChatMode], 203, text[privateChatMode], 164, true);
- smallText.method382(disabledColor[clanChatMode], 261, text[clanChatMode], 164, true);
- smallText.method382(disabledColor[tradeMode], 318, text[tradeMode], 164, true);
- smallText.method382(0xff0000, 374, "Off", 164, true);
- } else if(is474) {
- String text[] = { "On", "Friends", "Off", "Hide" };
- int disabledColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
- switch(cButtonCPos) {
- case 0: chatButtons[1].drawSprite(5, 142); break;
- case 1: chatButtons[1].drawSprite(71, 142); break;
- case 2: chatButtons[1].drawSprite(137, 142); break;
- case 3: chatButtons[1].drawSprite(203, 142); break;
- case 4: chatButtons[1].drawSprite(269, 142); break;
- case 5: chatButtons[1].drawSprite(335, 142); break;
- } if(cButtonHPos == cButtonCPos) {
- switch(cButtonHPos) {
- case 0: chatButtons[2].drawSprite(5, 142); break;
- case 1: chatButtons[2].drawSprite(71, 142); break;
- case 2: chatButtons[2].drawSprite(137, 142); break;
- case 3: chatButtons[2].drawSprite(203, 142); break;
- case 4: chatButtons[2].drawSprite(269, 142); break;
- case 5: chatButtons[2].drawSprite(335, 142); break;
- case 6: chatButtons[3].drawSprite(404, 142); break;
- }
- } else {
- switch(cButtonHPos) {
- case 0: chatButtons[0].drawSprite(5, 142); break;
- case 1: chatButtons[0].drawSprite(71, 142); break;
- case 2: chatButtons[0].drawSprite(137, 142); break;
- case 3: chatButtons[0].drawSprite(203, 142); break;
- case 4: chatButtons[0].drawSprite(269, 142); break;
- case 5: chatButtons[0].drawSprite(335, 142); break;
- case 6: chatButtons[3].drawSprite(404, 142); break;
- }
- }
- smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
- smallText.method389(true, 26, 0xffffff, "All", 157);
- smallText.method389(true, 86, 0xffffff, "Game", 157);
- smallText.method389(true, 150, 0xffffff, "Public", 152);
- smallText.method389(true, 212, 0xffffff, "Private", 152);
- smallText.method389(true, 286, 0xffffff, "Clan", 152);
- smallText.method389(true, 349, 0xffffff, "Trade", 152);
- smallText.method382(disabledColor[publicChatMode], 164, text[publicChatMode], 163, true);
- smallText.method382(disabledColor[privateChatMode], 230, text[privateChatMode], 163, true);
- smallText.method382(disabledColor[clanChatMode], 296, text[clanChatMode], 163, true);
- smallText.method382(disabledColor[tradeMode], 362, text[tradeMode], 163, true);
- }
- if(menuOpen){
- drawMenu(0, 338);
- }
- }
- private void drawChatArea() {
- chatBackImage.initDrawingArea();
- Texture.anIntArray1472 = anIntArray1180;
- chatArea[getSpriteID()].drawSprite(0, 0);
- if(spriteChanged){
- aBoolean1233 = true;
- inputTaken = true;
- }
- if(is459) {
- RSFont textDrawingArea = aTextDrawingArea_1271;
- if(messagePromptRaised) {
- newBoldFont.drawCenteredString(aString1121, 239, 60, 0, -1);
- newBoldFont.drawCenteredString( promptInput + "*", 239, 80, 128, -1);
- } else if(inputDialogState == 1) {
- newBoldFont.drawCenteredString("Enter amount:", 239, 60, 0, -1);
- newBoldFont.drawCenteredString(amountOrNameInput + "*", 239, 80, 128, -1);
- } else if(inputDialogState == 2) {
- newBoldFont.drawCenteredString("Enter name:", 239, 60, 0, -1);
- newBoldFont.drawCenteredString(amountOrNameInput + "*", 239, 80, 128, -1);
- } else if(aString844 != null) {
- newBoldFont.drawCenteredString(aString844, 239, 60, 0, -1);
- newBoldFont.drawCenteredString("Click to continue", 239, 80, 128, -1);
- } else if(backDialogID != -1) {
- drawInterface(0, 16, RSInterface.interfaceCache[backDialogID], 20);
- } else if(dialogID != -1) {
- drawInterface(0, 16, RSInterface.interfaceCache[dialogID], 20);
- } else {
- int j77 = 0;
- int j = 0;
- DrawingArea.setDrawingArea(93+5, 0, 463, 22);
- for(int k = 0; k < 100; k++)
- if(chatMessages[k] != null) {
- int chatType = chatTypes[k];
- int yPos = (88 - j77 * 14) + anInt1089 + 5;
- String s1 = chatNames[k];
- byte byte0 = 0;
- if(s1 != null && s1.startsWith("@cr0@")) {
- s1 = s1.substring(5);
- byte0 = 1;
- } else if(s1 != null && s1.startsWith("@cr1@")) {
- s1 = s1.substring(5);
- byte0 = 2;
- } else if(s1 != null && s1.startsWith("@cr2@")) {
- s1 = s1.substring(5);
- byte0 = 3;
- } else if(s1 != null && s1.startsWith("@cr3@")) {
- s1 = s1.substring(5);
- byte0 = 4;
- } else if(s1 != null && s1.startsWith("@cr4@")) {
- s1 = s1.substring(5);
- byte0 = 5;
- } else if(s1 != null && s1.startsWith("@cr5@")) {
- s1 = s1.substring(5);
- byte0 = 6;
- } else if(s1 != null && s1.startsWith("@cr6@")) {
- s1 = s1.substring(5);
- byte0 = 7;
- } else if(s1 != null && s1.startsWith("@cr7@")) {
- s1 = s1.substring(5);
- byte0 = 8;
- }
- /* Draws Chat Colored Messages */
- if(chatType == 0) {
- if (chatTypeView == 5 || chatTypeView == 0) {
- if(yPos > 0 && yPos < 110)
- newRegularFont.drawBasicString(chatMessages[k], 19, yPos, 0, -1);
- j++;
- j77++;
- }
- }
- /* Draws clickable URL text into chatarea */
- if(chatType == 9) {
- if (chatTypeView == 5 || chatTypeView == 0) {
- if(yPos > 0 && yPos < 110)
- newRegularFont.drawBasicString(chatMessages[k] + " <col=13989119>" + s1, 19, yPos, 0x7e3200, -1);
- j++;
- j77++;
- }
- }
- if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
- if (chatTypeView == 1 || chatTypeView == 0) {
- if(yPos > 0 && yPos < 110) {
- int xPos = 19;
- switch(byte0) {
- case 1:
- modIcons[0].drawSprite(xPos, yPos - 12);
- xPos += 14;
- break;
- case 2:
- modIcons[1].drawSprite(xPos, yPos - 12);
- xPos += 14;
- break;
- case 3:
- modIcons[2].drawSprite(xPos, yPos - 12);
- xPos += 14;
- break;
- case 4:
- modIcons[3].drawSprite(xPos, yPos - 12);
- xPos += 14;
- break;
- case 5:
- modIcons[4].drawSprite(xPos, yPos - 12);
- xPos += 14;
- break;
- case 6:
- modIcons[5].drawSprite(xPos, yPos - 12);
- xPos += 14;
- break;
- case 7:
- modIcons[6].drawSprite(xPos, yPos - 12);
- xPos += 14;
- break;
- case 8:
- modIcons[7].drawSprite(xPos, yPos - 12);
- xPos += 14;
- break;
- }
- newRegularFont.drawBasicString(s1 + ":", xPos, yPos, 0, -1);
- xPos += newRegularFont.getTextWidth(s1) + 8;
- newRegularFont.drawBasicString(chatMessages[k], xPos, yPos, 255, -1);
- }
- j++;
- j77++;
- }
- }
- if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
- if (chatTypeView == 2 || chatTypeView == 0) {
- if(yPos > 0 && yPos < 110) {
- int k1 = 4;
- newRegularFont.drawBasicString("From", k1, yPos, 0, -1);
- k1 += newRegularFont.getTextWidth("From ");
- switch(byte0) {
- case 1:
- modIcons[0].drawSprite(k1, yPos - 12);
- k1 += 14;
- break;
- case 2:
- modIcons[1].drawSprite(k1, yPos - 12);
- k1 += 14;
- break;
- case 3:
- modIcons[2].drawSprite(k1, yPos - 12);
- k1 += 14;
- break;
- case 4:
- modIcons[3].drawSprite(k1, yPos - 12);
- k1 += 14;
- break;
- case 5:
- modIcons[4].drawSprite(k1, yPos - 12);
- k1 += 14;
- break;
- case 6:
- modIcons[5].drawSprite(k1, yPos - 12);
- k1 += 14;
- break;
- case 7:
- modIcons[6].drawSprite(k1, yPos - 12);
- k1 += 14;
- break;
- case 8:
- modIcons[7].drawSprite(k1, yPos - 12);
- k1 += 14;
- break;
- }
- newRegularFont.drawBasicString(s1 + ":", k1, yPos, 0, -1);
- k1 += newRegularFont.getTextWidth(s1) + 8;
- newRegularFont.drawBasicString(chatMessages[k], k1, yPos, 0x800000, -1);
- }
- j++;
- j77++;
- }
- }
- if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
- if (chatTypeView == 3 || chatTypeView == 0) {
- if(yPos > 0 && yPos < 110)
- newRegularFont.drawBasicString( s1 + " " + chatMessages[k], 19, yPos, 0x800080, -1);
- j++;
- j77++;
- }
- }
- if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
- if (chatTypeView == 2 || chatTypeView == 0) {
- if(yPos > 0 && yPos < 110)
- newRegularFont.drawBasicString(chatMessages[k], 19, yPos, 0x800000, -1);
- j++;
- j77++;
- }
- }
- if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
- if (chatTypeView == 2 || chatTypeView == 0) {
- if(yPos > 0 && yPos < 110) {
- newRegularFont.drawBasicString("To " + s1 + ":", 11, yPos, 0, -1);
- newRegularFont.drawBasicString(chatMessages[k], 12 + newRegularFont.getTextWidth("To :" + s1), yPos, 0x800000, -1);
- }
- j++;
- j77++;
- }
- }
- if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
- if (chatTypeView == 3 || chatTypeView == 0) {
- if(yPos > 0 && yPos < 110)
- newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 19, yPos, 0x7e3200, -1);
- j++;
- j77++;
- }
- if(chatType == 11 && (clanChatMode == 0)) {
- if (chatTypeView == 11) {
- if(yPos > 0 && yPos < 110)
- newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 19, yPos, 0x7e3200, -1);
- j++;
- j77++;
- }
- }
- }
- if(chatType == 16) {
- int j2 = 40+11;
- int clanNameWidth = textDrawingArea.getTextWidth(clanname);
- if(chatTypeView == 11 || chatTypeView == 0) {
- if(yPos > 0 && yPos < 110)
- switch(chatRights[k]) {
- case 1:
- j2 += clanNameWidth;
- modIcons[0].drawSprite(j2 - 18, yPos - 12);
- j2 += 15;
- break;
- case 2:
- j2 += clanNameWidth;
- modIcons[1].drawSprite(j2 - 18, yPos - 12);
- j2 += 15;
- break;
- case 3:
- j2 += clanNameWidth;
- modIcons[2].drawSprite(j2 - 18, yPos - 12);
- j2 += 15;
- break;
- case 4:
- j2 += clanNameWidth;
- modIcons[3].drawSprite(j2 - 18, yPos - 12);
- j2 += 15;
- break;
- case 5:
- j2 += clanNameWidth;
- modIcons[4].drawSprite(j2 - 18, yPos - 12);
- j2 += 15;
- break;
- case 6:
- j2 += clanNameWidth;
- modIcons[5].drawSprite(j2 - 18, yPos - 12);
- j2 += 15;
- break;
- case 7:
- j2 += clanNameWidth;
- modIcons[6].drawSprite(j2 - 18, yPos - 12);
- j2 += 15;
- break;
- case 8:
- j2 += clanNameWidth;
- modIcons[7].drawSprite(j2 - 18, yPos - 12);
- j2 += 15;
- break;
- default:
- j2 += clanNameWidth;
- break;
- }
- newRegularFont.drawBasicString("[", 19, yPos, 0, -1);
- newRegularFont.drawBasicString("]", clanNameWidth + 16+11, yPos, 0, -1);
- newRegularFont.drawBasicString(""+capitalize(clanname)+"", 25, yPos, 255, -1);
- newRegularFont.drawBasicString(capitalize(chatNames[k]) + ":", j2-17, yPos);
- j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
- newRegularFont.drawBasicString(capitalize(chatMessages[k]), j2-16, yPos, 0x800000, -1);
- j++;
- j77++;
- }
- }
- }
- DrawingArea.defaultDrawingAreaSize();
- anInt1211 = j * 14 + 7;
- if(anInt1211 < 78)
- anInt1211 = 78;
- drawScrollbar(77, anInt1211 - anInt1089 - 77, 20, 480, anInt1211);
- String s;
- if(myPlayer != null && myPlayer.name != null)
- s = myPlayer.name;
- else
- s = TextClass.fixName(capitalize(myUsername));
- newRegularFont.drawBasicString(s + ":", 19, 110, 0, -1);
- newRegularFont.drawBasicString(inputString + "*", 20 + textDrawingArea.getTextWidth(s + ": "), 110, 255, -1);
- DrawingArea.method339(97, 0x000000, 479, 17);
- }
- } else if(is474 || is480 || is508 || is525 || is562) {
- RSFont textDrawingArea = aTextDrawingArea_1271;
- if(messagePromptRaised) {
- newBoldFont.drawCenteredString(aString1121, 259, 60, 0, -1);
- newBoldFont.drawCenteredString( promptInput + "*", 259, 80, 128, -1);
- } else if(inputDialogState == 1) {
- newBoldFont.drawCenteredString("Enter amount:", 259, 60, 0, -1);
- newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
- } else if(inputDialogState == 2) {
- newBoldFont.drawCenteredString("Enter name:", 259, 60, 0, -1);
- newBoldFont.drawCenteredString(amountOrNameInput + "*", 259, 80, 128, -1);
- } else if(aString844 != null) {
- newBoldFont.drawCenteredString(aString844, 259, 60, 0, -1);
- newBoldFont.drawCenteredString("Click to continue", 259, 80, 128, -1);
- } else if(backDialogID != -1) {
- drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
- } else if(dialogID != -1) {
- drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
- } else {
- int j77 = -3;
- int j = 0;
- DrawingArea.setDrawingArea(122, 8, 497, 7);
- for(int k = 0; k < 500; k++)
- if(chatMessages[k] != null) {
- int chatType = chatTypes[k];
- int yPos = (70 - j77 * 14) + anInt1089 + 5;
- String s1 = chatNames[k];
- byte byte0 = 0;
- if (s1 != null && s1.startsWith("@cr0@")) {
- s1 = s1.substring(5);
- byte0 = 1;
- } else if(s1 != null && s1.startsWith("@cr1@")) {
- s1 = s1.substring(5);
- byte0 = 2;
- } else if(s1 != null && s1.startsWith("@cr2@")) {
- s1 = s1.substring(5);
- byte0 = 3;
- } else if(s1 != null && s1.startsWith("@cr3@")) {
- s1 = s1.substring(5);
- byte0 = 4;
- } else if(s1 != null && s1.startsWith("@cr4@")) {
- s1 = s1.substring(5);
- byte0 = 5;
- } else if(s1 != null && s1.startsWith("@cr5@")) {
- s1 = s1.substring(5);
- byte0 = 6;
- } else if(s1 != null && s1.startsWith("@cr6@")) {
- s1 = s1.substring(5);
- byte0 = 7;
- } else if(s1 != null && s1.startsWith("@cr7@")) {
- s1 = s1.substring(5);
- byte0 = 8;
- }
- /* Draws Chat Colored Messages */
- if(chatType == 0) {
- if (chatTypeView == 5 || chatTypeView == 0) {
- if(yPos > 0 && yPos < 210)
- newRegularFont.drawBasicString(chatMessages[k], 11, yPos, 0, -1);
- j++;
- j77++;
- }
- }
- /* Draws clickable URL text into chatarea */
- if(chatType == 9) {
- if (chatTypeView == 5 || chatTypeView == 0) {
- if(yPos > 0 && yPos < 210)
- newRegularFont.drawBasicString(chatMessages[k] + " <col=255>" + s1, 11, yPos, 0x7e3200, -1);
- j++;
- j77++;
- }
- }
- if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
- if (chatTypeView == 1 || chatTypeView == 0) {
- if(yPos > 0 && yPos < 210) {
- int xPos = 11;
- switch(byte0) {
- case 1:
- modIcons[0].drawSprite(xPos, yPos - 12);
- xPos += 14;
- break;
- case 2:
- modIcons[1].drawSprite(xPos, yPos - 12);
- xPos += 14;
- break;
- case 3:
- modIcons[2].drawSprite(xPos, yPos - 12);
- xPos += 14;
- break;
- case 4:
- modIcons[3].drawSprite(xPos, yPos - 12);
- xPos += 14;
- break;
- case 5:
- modIcons[4].drawSprite(xPos, yPos - 12);
- xPos += 14;
- break;
- case 6:
- modIcons[5].drawSprite(xPos, yPos - 12);
- xPos += 14;
- break;
- case 7:
- modIcons[6].drawSprite(xPos, yPos - 12);
- xPos += 14;
- break;
- case 8:
- modIcons[7].drawSprite(xPos, yPos - 12);
- xPos += 14;
- break;
- }
- newRegularFont.drawBasicString(s1 + ":", xPos, yPos, 0, -1);
- xPos += newRegularFont.getTextWidth(s1) + 8;
- newRegularFont.drawBasicString(chatMessages[k], xPos, yPos, 255, -1);
- }
- j++;
- j77++;
- }
- }
- if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
- if (chatTypeView == 2 || chatTypeView == 0) {
- if(yPos > 0 && yPos < 110) {
- int k1 = 4;
- newRegularFont.drawBasicString("From", k1, yPos, 0, -1);
- k1 += newRegularFont.getTextWidth("From ");
- switch(byte0) {
- case 1:
- modIcons[0].drawSprite(k1, yPos - 12);
- k1 += 14;
- break;
- case 2:
- modIcons[1].drawSprite(k1, yPos - 12);
- k1 += 14;
- break;
- case 3:
- modIcons[2].drawSprite(k1, yPos - 12);
- k1 += 14;
- break;
- case 4:
- modIcons[3].drawSprite(k1, yPos - 12);
- k1 += 14;
- break;
- case 5:
- modIcons[4].drawSprite(k1, yPos - 12);
- k1 += 14;
- break;
- case 6:
- modIcons[5].drawSprite(k1, yPos - 12);
- k1 += 14;
- break;
- case 7:
- modIcons[6].drawSprite(k1, yPos - 12);
- k1 += 14;
- break;
- case 8:
- modIcons[7].drawSprite(k1, yPos - 12);
- k1 += 14;
- break;
- }
- newRegularFont.drawBasicString(s1 + ":", k1, yPos, 0, -1);
- k1 += newRegularFont.getTextWidth(s1) + 8;
- newRegularFont.drawBasicString(chatMessages[k], k1, yPos, 0x800000, -1);
- }
- j++;
- j77++;
- }
- }
- if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
- if (chatTypeView == 3 || chatTypeView == 0) {
- if(yPos > 0 && yPos < 210)
- newRegularFont.drawBasicString( s1 + " " + chatMessages[k], 11, yPos, 0x800080, -1);
- j++;
- j77++;
- }
- }
- if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
- if (chatTypeView == 2 || chatTypeView == 0) {
- if(yPos > 0 && yPos < 210)
- newRegularFont.drawBasicString(chatMessages[k], 11, yPos, 0x800000, -1);
- j++;
- j77++;
- }
- }
- if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
- if (chatTypeView == 2 || chatTypeView == 0) {
- if(yPos > 0 && yPos < 210) {
- newRegularFont.drawBasicString("To " + s1 + ":", 11, yPos, 0, -1);
- newRegularFont.drawBasicString(chatMessages[k], 15 + newRegularFont.getTextWidth("To :" + s1), yPos, 0x800000, -1);
- }
- j++;
- j77++;
- }
- }
- if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
- if (chatTypeView == 3 || chatTypeView == 0) {
- if(yPos > 0 && yPos < 210)
- newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
- j++;
- j77++;
- }
- if(chatType == 11 && (clanChatMode == 0)) {
- if (chatTypeView == 11) {
- if(yPos > 0 && yPos < 210)
- newRegularFont.drawBasicString(s1 + " " + chatMessages[k], 11, yPos, 0x7e3200, -1);
- j++;
- j77++;
- }
- }
- }
- if(chatType == 16) {
- int j2 = 40+11;
- int clanNameWidth = textDrawingArea.getTextWidth(clanname);
- if(chatTypeView == 11 || chatTypeView == 0) {
- if(yPos > 0 && yPos < 110)
- switch(chatRights[k]) {
- case 1:
- j2 += clanNameWidth;
- modIcons[0].drawSprite(j2 - 18, yPos - 12);
- j2 += 15;
- break;
- case 2:
- j2 += clanNameWidth;
- modIcons[1].drawSprite(j2 - 18, yPos - 12);
- j2 += 15;
- break;
- case 3:
- j2 += clanNameWidth;
- modIcons[2].drawSprite(j2 - 18, yPos - 12);
- j2 += 15;
- break;
- case 4:
- j2 += clanNameWidth;
- modIcons[3].drawSprite(j2 - 18, yPos - 12);
- j2 += 15;
- break;
- case 5:
- j2 += clanNameWidth;
- modIcons[4].drawSprite(j2 - 18, yPos - 12);
- j2 += 15;
- break;
- case 6:
- j2 += clanNameWidth;
- modIcons[5].drawSprite(j2 - 18, yPos - 12);
- j2 += 15;
- break;
- case 7:
- j2 += clanNameWidth;
- modIcons[6].drawSprite(j2 - 18, yPos - 12);
- j2 += 15;
- break;
- case 8:
- j2 += clanNameWidth;
- modIcons[7].drawSprite(j2 - 18, yPos - 12);
- j2 += 15;
- break;
- default:
- j2 += clanNameWidth;
- break;
- }
- newRegularFont.drawBasicString("[", 8, yPos, 0, -1);
- newRegularFont.drawBasicString("]", clanNameWidth + 16, yPos, 0, -1);
- newRegularFont.drawBasicString(""+capitalize(clanname)+"", 14, yPos, 255, -1);
- newRegularFont.drawBasicString(capitalize(chatNames[k]) + ":", j2-17, yPos);
- j2 += newRegularFont.getTextWidth(chatNames[k]) + 7;
- newRegularFont.drawBasicString(capitalize(chatMessages[k]), j2-16, yPos, 0x800000, -1);
- j++;
- j77++;
- }
- }
- }
- DrawingArea.defaultDrawingAreaSize();
- anInt1211 = j * 14 + 7 + 5;
- if(anInt1211 < 111)
- anInt1211 = 111;
- drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
- String s;
- if(myPlayer != null && myPlayer.name != null)
- s = myPlayer.name;
- else
- s = TextClass.fixName(capitalize(myUsername));
- if(is508) {
- qc.drawSprite(textDrawingArea.getTextWidth(s) + 11, 123);
- newRegularFont.drawBasicString(s, 11, 133, 0, -1);
- newRegularFont.drawBasicString(":", (25 + textDrawingArea.getTextWidth(s)), 133, 0, -1);
- newRegularFont.drawBasicString(inputString + ((loopCycle % 40 < 20) ? "<col=0>|" : ""), 23 + textDrawingArea.getTextWidth(s + ": "), 133 ,255 , -1);
- DrawingArea.method339(121, 0x807660, 506, 7);
- } else {
- newRegularFont.drawBasicString(s + ":", 11, 133, 0, -1);
- newRegularFont.drawBasicString(inputString + "*", 12 + textDrawingArea.getTextWidth(s + ": "), 133, 255, -1);
- DrawingArea.method339(121, 0x807660, 506, 7);
- }
- }
- }
- drawChannelButtons();
- chatBackImage.drawGraphics(338, super.graphics, 0);
- inGameScreen.initDrawingArea();
- Texture.anIntArray1472 = anIntArray1182;
- }
- public void init() {
- try {
- System.out.println("NovaScape is loading..");
- nodeID = 10;//friends list order
- portOff = 0;
- setHighMem();
- isMembers = true;
- signlink.startpriv(InetAddress.getLocalHost());
- instance = this;
- initClientFrame(503, 765);//this it? 510 770
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public void drawTabHover() {
- if(tabHPos == 0 && tabInterfaceIDs[0] != -1)
- tabHover.drawSprite(3+3, 0);
- else if(tabHPos == 1 && tabInterfaceIDs[1] != -1)
- tabHover.drawSprite(33+3, 0);
- else if(tabHPos == 2 && tabInterfaceIDs[2] != -1)
- tabHover.drawSprite(63+3, 0);
- else if(tabHPos == 3 && tabInterfaceIDs[14] != -1)
- tabHover.drawSprite(93+3, 0);
- else if(tabHPos == 4 && tabInterfaceIDs[3] != -1)
- tabHover.drawSprite(123+3, 0);
- else if(tabHPos == 5 && tabInterfaceIDs[4] != -1)
- tabHover.drawSprite(153+3, 0);
- else if(tabHPos == 6 && tabInterfaceIDs[5] != -1)
- tabHover.drawSprite(183+3, 0);
- else if(tabHPos == 7 && tabInterfaceIDs[6] != -1)
- tabHover.drawSprite(213+3, 0);
- else if(tabHPos == 15 && tabInterfaceIDs[16] != -1)
- tabHover.drawSprite(3+3, 298);
- else if(tabHPos == 8 && tabInterfaceIDs[9] != -1)
- tabHover.drawSprite(33+3, 298);
- else if(tabHPos == 9 && tabInterfaceIDs[8] != -1)
- tabHover.drawSprite(63+3, 298);
- else if(tabHPos == 10 && tabInterfaceIDs[7] != -1)
- tabHover.drawSprite(93+3, 298);
- else if(tabHPos == 11 && tabInterfaceIDs[11] != -1)
- tabHover.drawSprite(123+3, 298);
- else if(tabHPos == 12 && tabInterfaceIDs[12] != -1)
- tabHover.drawSprite(153+3, 298);
- else if(tabHPos == 13 && tabInterfaceIDs[13] != -1)
- tabHover.drawSprite(183+3,298);
- else if(tabHPos == 14 && tabInterfaceIDs[15] != -1)
- tabHover.drawSprite(213+3, 298);
- }
- public void startRunnable(Runnable runnable, int i) {
- if(i > 10)
- i = 10;
- if(signlink.mainapp != null) {
- signlink.startthread(runnable, i);
- } else {
- super.startRunnable(runnable, i);
- }
- }
- public Socket openSocket(int port) throws IOException {
- return new Socket(InetAddress.getByName(server), port);
- }
- private void processMenuClick() {
- if(activeInterfaceType != 0)
- return;
- int j = super.clickMode3;
- if(spellSelected == 1 && super.saveClickX >= 503 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
- j = 0;
- if(menuOpen) {
- if(j != 1) {
- int k = super.mouseX;
- int j1 = super.mouseY;
- if(menuScreenArea == 0) {
- k -= 4;
- j1 -= 4;
- }
- if(menuScreenArea == 1) {
- k -= 516;//519
- j1 -= 168;
- }
- if(menuScreenArea == 2) {
- k -= 5;
- j1 -= 338;
- }
- if(menuScreenArea == 3) {
- k -= 516;//519
- j1 -= 0;
- }
- if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
- menuOpen = false;
- if(menuScreenArea == 1)
- needDrawTabArea = true;
- if(menuScreenArea == 2)
- inputTaken = true;
- }
- }
- if(j == 1) {
- int l = menuOffsetX;
- int k1 = menuOffsetY;
- int i2 = menuWidth;
- int k2 = super.saveClickX;
- int l2 = super.saveClickY;
- if(menuScreenArea == 0) {
- k2 -= 4;
- l2 -= 4;
- }
- if(menuScreenArea == 1) {
- k2 -= 516;//519
- l2 -= 168;
- }
- if(menuScreenArea == 2) {
- k2 -= 5;//17
- l2 -= 338;
- }
- if(menuScreenArea == 3) {
- k2 -= 516;//519
- l2 -= 0;
- }
- int i3 = -1;
- for(int j3 = 0; j3 < menuActionRow; j3++) {
- int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
- if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
- i3 = j3;
- }
- System.out.println(i3);
- if(i3 != -1)
- doAction(i3);
- menuOpen = false;
- if(menuScreenArea == 1)
- needDrawTabArea = true;
- if(menuScreenArea == 2) {
- inputTaken = true;
- }
- }
- } else {
- if(j == 1 && menuActionRow > 0) {
- int i1 = menuActionID[menuActionRow - 1];
- if(i1 == 632 || i1 == 78 || i1 == 867 || i1 == 431 || i1 == 53 || i1 == 74 || i1 == 454 || i1 == 539 || i1 == 493 || i1 == 847 || i1 == 447 || i1 == 1125) {
- int l1 = menuActionCmd2[menuActionRow - 1];
- int j2 = menuActionCmd3[menuActionRow - 1];
- RSInterface class9 = RSInterface.interfaceCache[j2];
- if(class9.allowSwapItems || class9.deletesTargetSlot) {
- aBoolean1242 = false;
- anInt989 = 0;
- anInt1084 = j2;
- anInt1085 = l1;
- activeInterfaceType = 2;
- anInt1087 = super.saveClickX;
- anInt1088 = super.saveClickY;
- if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
- activeInterfaceType = 1;
- if(RSInterface.interfaceCache[j2].parentID == backDialogID)
- activeInterfaceType = 3;
- return;
- }
- }
- }
- if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
- j = 2;
- if(j == 1 && menuActionRow > 0)
- doAction(menuActionRow - 1);
- if(j == 2 && menuActionRow > 0)
- determineMenuSize();
- }
- }
- public static int totalRead = 0;
- public static String getFileNameWithoutExtension(String fileName) {
- File tmpFile = new File(fileName);
- tmpFile.getName();
- int whereDot = tmpFile.getName().lastIndexOf('.');
- if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2 ) {
- return tmpFile.getName().substring(0, whereDot);
- }
- return "";
- }
- public void preloadModels() {
- File file = new File(signlink.findcachedir()+"Raw/");
- File[] fileArray = file.listFiles();
- for(int y = 0; y < fileArray.length; y++) {
- String s = fileArray[y].getName();
- byte[] buffer = ReadFile(signlink.findcachedir()+"Raw/"+s);
- Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
- }
- }
- public static final byte[] ReadFile(String s) {
- try {
- byte abyte0[];
- File file = new File(s);
- int i = (int)file.length();
- abyte0 = new byte[i];
- DataInputStream datainputstream = new DataInputStream(new NovaScape(new FileInputStream(s)));
- datainputstream.readFully(abyte0, 0, i);
- datainputstream.close();
- return abyte0;
- } catch(Exception e) {
- System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement