Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.nr.client;
- import java.applet.AppletContext;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Point;
- import java.awt.Toolkit;
- import java.awt.datatransfer.Clipboard;
- import java.awt.datatransfer.DataFlavor;
- import java.awt.datatransfer.StringSelection;
- import java.awt.datatransfer.Transferable;
- import java.awt.datatransfer.UnsupportedFlavorException;
- import java.awt.event.KeyEvent;
- import java.io.BufferedInputStream;
- import java.io.DataInputStream;
- import java.io.File;
- import java.io.FileInputStream;
- import java.io.FileOutputStream;
- import java.io.IOException;
- import java.io.OutputStream;
- import java.io.PrintStream;
- import java.net.InetAddress;
- import java.net.Socket;
- import java.net.URL;
- import java.nio.file.Files;
- import java.nio.file.Path;
- import java.nio.file.Paths;
- import java.util.AbstractMap;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.Iterator;
- import java.util.Map;
- import java.util.Map.Entry;
- import org.nr.client.cache.Decompressor;
- import org.nr.client.cache.FileOperations;
- import org.nr.client.cache.FileUtility;
- import org.nr.client.cache.Node;
- import org.nr.client.cache.NodeList;
- import org.nr.client.cache.OnDemandData;
- import org.nr.client.cache.OnDemandFetcher;
- import org.nr.client.cache.Signlink;
- import org.nr.client.cache.StreamLoader;
- import org.nr.client.cache.TeeOutputStream;
- import org.nr.client.cache.VarBit;
- import org.nr.client.cache.download.Downloader;
- import org.nr.client.definition.ItemDefinition;
- import org.nr.client.definition.NpcDefinition;
- import org.nr.client.definition.ObjectDefinition;
- import org.nr.client.media.Media;
- import org.nr.client.media.Sprite;
- import org.nr.client.media.SpriteLoader;
- import org.nr.client.media.widget.RSInterface;
- import org.nr.client.media.widget.Widgets;
- import org.nr.client.media.widget.gameframe.Gameframe;
- import org.nr.client.media.widget.gameframe.Gameframe317;
- import org.nr.client.media.widget.gameframe.Gameframe459;
- import org.nr.client.media.widget.gameframe.Gameframe474;
- import org.nr.client.media.widget.gameframe.Gameframe525;
- import org.nr.client.media.widget.gameframe.Gameframe602;
- import org.nr.client.media.widget.mikey.InterfaceDropTables;
- import org.nr.client.media.widget.mikey.InterfaceSettings;
- import org.nr.client.media.widget.mikey.MikeysInterfaces;
- import org.nr.client.model.Animable;
- import org.nr.client.model.Animable_Sub3;
- import org.nr.client.model.Animable_Sub4;
- import org.nr.client.model.Animable_Sub5;
- import org.nr.client.model.Animation;
- import org.nr.client.model.Background;
- import org.nr.client.model.Censor;
- import org.nr.client.model.Class11;
- import org.nr.client.model.Class30_Sub1;
- import org.nr.client.model.Class36;
- import org.nr.client.model.CombatOverlays;
- import org.nr.client.model.DrawingArea;
- import org.nr.client.model.Entity;
- import org.nr.client.model.ExperienceCounter;
- import org.nr.client.model.Floor;
- import org.nr.client.model.Fog;
- import org.nr.client.model.FontStyle;
- import org.nr.client.model.GameObjectSpawns;
- import org.nr.client.model.GameObjectSpawns.GameObject;
- import org.nr.client.model.IdentityKit;
- import org.nr.client.model.ImageProducer;
- import org.nr.client.model.Item;
- import org.nr.client.model.MapRender;
- import org.nr.client.model.MidiPlayer;
- import org.nr.client.model.Model;
- import org.nr.client.model.Npc;
- import org.nr.client.model.Object1;
- import org.nr.client.model.Object2;
- import org.nr.client.model.Object3;
- import org.nr.client.model.Object5;
- import org.nr.client.model.ObjectManager;
- import org.nr.client.model.OverlayFlo;
- import org.nr.client.model.Player;
- import org.nr.client.model.RSFont;
- import org.nr.client.model.Sounds;
- import org.nr.client.model.SpotAnim;
- import org.nr.client.model.TextClass;
- import org.nr.client.model.TextInput;
- import org.nr.client.model.Texture;
- import org.nr.client.model.Varp;
- import org.nr.client.model.WorldController;
- import org.nr.client.net.IsaacRandomGenerator;
- import org.nr.client.net.RSBuffer;
- import org.nr.client.net.RSSocket;
- import org.nr.client.net.SizeConstants;
- import org.nr.client.util.ClientSettings;
- import org.nr.client.util.Configuration;
- import org.nr.client.util.Configuration.World;
- import org.nr.client.util.MouseDetection;
- import org.nr.client.util.Skills;
- import org.nr.client.util.Skills.SkillData;
- public class Client extends RSApplet {
- /**
- * Credits: Lost Valentino Poes700 Maxi Eliminate Zion
- */
- /**
- * Enable/disable for hp/prayer/run/xp counter/world map orbs
- */
- public boolean loadOrbs = false;
- /**
- * Enable/disable for roofs
- */
- public boolean roofsOff = false;
- /**
- * RSA keys
- */
- private static final long serialVersionUID = 5707517957054703648L;
- /**
- * newDamage enables or disables fake constitution.
- */
- public static boolean newDamage = true;
- /**
- * npcBits can be changed to what your server's bits are set to. This needs
- * to be the same as serverside
- */
- public static int npcBits = 18;
- private int screenOpacity = 250;
- private final static int SHADOW_SPEED = 1;
- private int shadowDestination = 250;
- private int mySummonIndex;
- public enum ScreenMode {
- FIXED, RESIZABLE, FULLSCREEN;
- }
- public ScreenMode frameMode = ScreenMode.FIXED;
- public int frameWidth = 765;
- public int frameHeight = 503;
- public int screenAreaWidth = 512;
- public int screenAreaHeight = 334;
- private int cameraZoom = 600;
- public boolean showChatComponents = true;
- public boolean showTabComponents = true;
- public boolean changeTabArea = frameMode == ScreenMode.FIXED ? false : true;
- public boolean changeChatArea = frameMode == ScreenMode.FIXED ? false : true;
- public boolean transparentTabArea = false;
- public MidiPlayer midiPlayer;
- public int midiVolume = 64;
- public static int playery() {
- return instance.baseY + (Client.myPlayer.y - 6 >> 7);
- }
- public static int playerx() {
- return instance.baseX + (Client.myPlayer.x - 6 >> 7);
- }
- public void stopMidi() {
- if (midiPlayer != null) {
- midiPlayer.stop();
- } else {
- System.out.println("Midi player is null!");
- }
- }
- public static void setClipboardContents(String aString) {
- StringSelection stringSelection = new StringSelection(aString);
- Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
- clipboard.setContents(stringSelection, null);
- }
- public static String getClipboardContents() {
- String result = "";
- Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
- // odd: the Object param of getContents is not currently used
- Transferable contents = clipboard.getContents(null);
- boolean hasTransferableText = (contents != null)
- && contents.isDataFlavorSupported(DataFlavor.stringFlavor);
- if (hasTransferableText) {
- try {
- result = (String) contents
- .getTransferData(DataFlavor.stringFlavor);
- } catch (UnsupportedFlavorException ex) {
- // highly unlikely since we are using a standard DataFlavor
- System.out.println(ex);
- ex.printStackTrace();
- } catch (IOException ex) {
- System.out.println(ex);
- ex.printStackTrace();
- }
- }
- return result;
- }
- public void setMidiVolume(int vol) {
- midiVolume = vol;
- if (midiPlayer == null) {
- return;
- }
- if (midiPlayer.playing()) {
- midiPlayer.setVolume(0, midiVolume);
- }
- }
- public void playMidi(byte abyte0[]) {
- boolean quickSong = (prevSong > 0 ? true : false);
- if (midiPlayer == null) {
- System.out.println("Midi player is null");
- return;
- }
- if (midiPlayer.playing() && !quickSong) {
- midiPlayer.play(abyte0, false, midiVolume);// add fading to this one
- } else {
- midiPlayer.play(abyte0, false, midiVolume);
- }
- }
- public static boolean isOldschool() {
- // return ClientSettings.getBoolean("old_characters");
- return true;
- }
- public void switchCharacters() {
- Player.mruNodes.unlinkAll();
- }
- public void onKeyPress(int keyCode) {
- switch (keyCode) {
- case KeyEvent.VK_C:
- if (!isPressed(KeyEvent.VK_CONTROL)) {
- return;
- }
- int x = baseX + (myPlayer.x - 6 >> 7);
- int y = baseY + (myPlayer.y - 6 >> 7);
- StringSelection selection = new StringSelection(x + ", " + y);
- Toolkit.getDefaultToolkit().getSystemClipboard().setContents(selection, selection);
- break;
- case KeyEvent.VK_V:
- if (!isPressed(KeyEvent.VK_CONTROL)) {
- return;
- }
- String contents = "";
- try {
- contents = (String) Toolkit.getDefaultToolkit().getSystemClipboard().getData(DataFlavor.stringFlavor);
- } catch (Exception e) {
- }
- if (friendsListAction > 0 && messagePromptRaised) {
- promptInput += contents;
- } else {
- inputString += contents;
- }
- break;
- case KeyEvent.VK_ESCAPE:
- if (openInterfaceID == 5292 || openInterfaceID == 3824) {
- clearTopInterfaces();
- }
- break;
- case KeyEvent.VK_TAB:
- tabToReplyPm();
- break;
- }
- fkey(keyCode);
- }
- public static boolean fkey(int key) {
- int[][] keys = { { 1, KeyEvent.VK_F1 }, { 2, KeyEvent.VK_F2 }, { 3, KeyEvent.VK_F3 }, { 4, KeyEvent.VK_F4 },
- { 5, KeyEvent.VK_F5 }, { 6, KeyEvent.VK_F6 }, { 7, KeyEvent.VK_F7 }, { 8, KeyEvent.VK_F8 } };
- for (int i = 0; i < keys.length; i++) {
- if (key == keys[i][1]) {
- for (int k = 0; k < instance.keybinds.length; k++) {
- if (instance.keybinds[k] == keys[i][0]) {
- instance.openTab(k);
- return true;
- }
- }
- instance.pushMessage("This f-key is not bound, navigate to your settings tab to set it.", 0, "");
- return true;
- }
- }
- return false;
- }
- public void preloadModels(String directory, int index) {
- try {
- recursiveLoadModels(new File(Signlink.getCacheDirectory() + directory), index);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- private void recursiveLoadModels(File directory, int index) {
- if (!directory.exists())
- return;
- File[] fileArray = directory.listFiles();
- for (int i = 0; i < fileArray.length; i++) {
- if (fileArray[i].isDirectory()) {
- recursiveLoadModels(fileArray[i], index);
- } else {
- File model = fileArray[i];
- System.out.println("Loading model file to index: " + index + ", " + model.getName());
- byte[] buffer = ReadFile(model.getPath());
- Model.method460(buffer, Integer.parseInt(getFileNameWithoutExtension(model.getName())), index);
- }
- }
- }
- public void preloadMaps() {
- try {
- recursiveLoadMaps(new File(Signlink.getCacheDirectory() + "/raw/maps/"));
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- private void recursiveLoadMaps(File directory) {
- if (!directory.exists())
- return;
- File[] fileArray = directory.listFiles();
- for (int i = 0; i < fileArray.length; i++) {
- if (fileArray[i].isDirectory()) {
- recursiveLoadAnims(fileArray[i]);
- } else {
- File model = fileArray[i];
- System.out.println("Loading map file " + model.getName());
- byte[] buffer = ReadFile(model.getPath());
- decompressors[4].method234(buffer.length, buffer,
- Integer.parseInt(getFileNameWithoutExtension(model.toString())));
- }
- }
- }
- public void preloadAnims() {
- try {
- recursiveLoadAnims(new File(Signlink.getCacheDirectory() + "/raw/anims/"));
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- private void recursiveLoadAnims(File directory) {
- if (!directory.exists())
- return;
- File[] fileArray = directory.listFiles();
- for (int i = 0; i < fileArray.length; i++) {
- if (fileArray[i].isDirectory()) {
- recursiveLoadAnims(fileArray[i]);
- } else {
- File model = fileArray[i];
- System.out.println("Loading animation file " + model.getName());
- byte[] buffer = ReadFile(model.getPath());
- Class36.load(Integer.parseInt(getFileNameWithoutExtension(model.getName())), buffer, 0);
- // Model.method460(buffer,
- // Integer.parseInt(getFileNameWithoutExtension(model.getName())),
- // false);
- }
- }
- }
- public void openPromptForInput(String message) {
- promptInput = "";
- aString1121 = message;
- messagePromptRaised = true;
- inputTaken = true;
- friendsListAction = -1;
- }
- private void processShadow() {
- if (screenOpacity < shadowDestination) {
- screenOpacity += SHADOW_SPEED;
- } else if (screenOpacity > shadowDestination) {
- screenOpacity -= SHADOW_SPEED;
- }
- }
- private void setAutoCastOff() {
- autoCast = false;
- autocastId = 0;
- sendPacket185(6667);
- }
- public void openLink(int buttonId) {
- switch (buttonId) {
- case 14009:
- launchURL("http://near-reality.org/bloodlust/");
- return;
- case 14005:
- launchURL("http://near-reality.org/bloodlust/invites");
- return;
- case 14013:
- launchURL("http://near-reality.org/bloodlust/invites");
- return;
- }
- }
- public void sendPacket185(int buttonID) {
- openLink(buttonID);
- MikeysInterfaces.buttonClicked(buttonID);
- stream.createFrame(185);
- stream.writeWord(buttonID);
- RSInterface rsi = RSInterface.interfaceCache[buttonID];
- if (rsi == null)
- return;
- if (rsi.valueIndexArray != null && rsi.valueIndexArray[0][0] == 5) {
- int configID = rsi.valueIndexArray[0][1];
- variousSettings[configID] = 1 - variousSettings[configID];
- method33(configID);
- // needDrawTabArea = true;
- }
- }
- public boolean packModel(int modelId, int index) {
- byte[] abyte0 = getModel(modelId);
- if (abyte0 != null && abyte0.length > 0) {
- decompressors[index].method234(abyte0.length, abyte0, modelId);
- // System.out.println("Packed model: " + modelId);
- return true;
- } else {
- System.err.println("Could not pack model: " + modelId);
- }
- return false;
- }
- public byte[] getModel(int index) {
- try {
- File model = new File(Signlink.getCacheDirectory() + "models/" + index + ".gz");
- byte[] aByte = new byte[(int) model.length()];
- FileInputStream Fis = new FileInputStream(model);
- Fis.read(aByte);
- Fis.close();
- return aByte;
- } catch (Exception e) {
- return null;
- }
- }
- public void setCameraZoom(int cameraZoom) {
- if (!fixed() && cameraZoom > 600)
- cameraZoom = 600;
- this.cameraZoom = cameraZoom;
- ClientSettings.set("zoom", cameraZoom);
- }
- public int getCameraZoom() {
- return cameraZoom;
- }
- public boolean fixed() {
- return frameMode == ScreenMode.FIXED;
- }
- public void resizable(int width, int height) {
- if (this.frameMode != ScreenMode.RESIZABLE) {
- this.frameMode = ScreenMode.RESIZABLE;
- frameWidth = width;
- frameHeight = height;
- rebuildFrameSize(frameMode, frameWidth, frameHeight);
- setBounds();
- }
- }
- public void frameMode(ScreenMode screenMode) {
- // if (frameMode != screenMode) {
- frameMode = screenMode;
- if (screenMode == ScreenMode.FIXED) {
- frameWidth = 765;
- frameHeight = 503;
- setCameraZoom(600);
- WorldController.viewDistance = 9;
- changeChatArea = false;
- changeTabArea = false;
- } else if (screenMode == ScreenMode.RESIZABLE) {
- frameWidth = 800;
- frameHeight = 600;
- setCameraZoom(850);
- // WorldController.viewDistance = 10;
- } else if (screenMode == ScreenMode.FULLSCREEN) {
- setCameraZoom(600);
- // WorldController.viewDistance = 10;
- frameWidth = (int) Toolkit.getDefaultToolkit().getScreenSize().getWidth();
- frameHeight = (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight();
- }
- rebuildFrameSize(screenMode, frameWidth, frameHeight);
- setBounds();
- // }
- showChatComponents = screenMode == ScreenMode.FIXED ? true : showChatComponents;
- showTabComponents = screenMode == ScreenMode.FIXED ? true : showTabComponents;
- }
- public void rebuildFrameSize(ScreenMode screenMode, int screenWidth, int screenHeight) {
- try {
- screenAreaWidth = (screenMode == ScreenMode.FIXED) ? 512 : screenWidth;
- screenAreaHeight = (screenMode == ScreenMode.FIXED) ? 334 : screenHeight;
- frameWidth = screenWidth;
- frameHeight = screenHeight;
- // instance.refreshFrameSize(screenMode == ScreenMode.FULLSCREEN, screenWidth, screenHeight,
- // screenMode == ScreenMode.RESIZABLE, screenMode != ScreenMode.FIXED);
- // ClientUI.getInstance().resize(screenWidth, screenHeight);
- ClientUI.getInstance().handleResize(screenMode, screenWidth, screenHeight);
- Widgets.load();
- setBounds();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public void refreshFrameSize() {
- if (frameMode == ScreenMode.RESIZABLE) {
- if (cameraZoom > 600)
- setCameraZoom(600);
- if (WorldController.viewDistance != 10) {
- WorldController.viewDistance = 10;
- setBounds();
- }
- if (frameWidth != (ClientUI.getInstance().getWidth()/*
- * appletClient() ?
- * getGameComponent().getWidth() :
- *//*gameFrame.getFrameWidth()*/)) {
- frameWidth = (ClientUI.getInstance().getWidth()/*
- * appletClient() ?
- * getGameComponent().getWidth() :
- gameFrame.getFrameWidth()*/);
- screenAreaWidth = frameWidth;
- ClientSettings.set("screen_width", frameWidth);
- setBounds();
- }
- if (frameHeight != (/*
- * appletClient() ?
- * getGameComponent().getHeight() :
- gameFrame.getFrameHeight()*/ClientUI.getInstance().getHeight())) {
- frameHeight = (/*
- * appletClient() ?
- * getGameComponent().getHeight() :
- gameFrame.getFrameHeight()*/ClientUI.getInstance().getHeight());
- screenAreaHeight = frameHeight;
- ClientSettings.set("screen_height", frameHeight);
- setBounds();
- }
- /*
- * if (frameMode == ScreenMode.RESIZABLE && (frameWidth >= 766) &&
- * (frameWidth <= 1025) && (frameHeight >= 504) && (frameHeight <=
- * 850)) { if (WorldController.viewDistance != 9) {
- * WorldController.viewDistance = 9; setBounds(); } cameraZoom =
- * 575; } else if (frameMode == ScreenMode.FIXED) { cameraZoom =
- * 600; } else if (frameMode == ScreenMode.RESIZABLE || frameMode ==
- * ScreenMode.FULLSCREEN) { if (WorldController.viewDistance != 10)
- * { WorldController.viewDistance = 10; setBounds(); } cameraZoom =
- * 600; }
- */
- }
- }
- private void setBounds() {
- Texture.method365(frameWidth, frameHeight);
- fullScreenTextureArray = Texture.anIntArray1472;
- Texture.method365(
- frameMode == ScreenMode.FIXED
- ? (aRSImageProducer_1166 != null ? aRSImageProducer_1166.canvasWidth : 519) : frameWidth,
- frameMode == ScreenMode.FIXED
- ? (aRSImageProducer_1166 != null ? aRSImageProducer_1166.canvasHeight : 165) : frameHeight);
- anIntArray1180 = Texture.anIntArray1472;
- Texture.method365(
- frameMode == ScreenMode.FIXED
- ? (aRSImageProducer_1163 != null ? aRSImageProducer_1163.canvasWidth : 249) : frameWidth,
- frameMode == ScreenMode.FIXED
- ? (aRSImageProducer_1163 != null ? aRSImageProducer_1163.canvasHeight : 335) : frameHeight);
- anIntArray1181 = Texture.anIntArray1472;
- Texture.method365(screenAreaWidth, screenAreaHeight);
- anIntArray1182 = Texture.anIntArray1472;
- 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 = Texture.anIntArray1470[k8];
- ai[i8] = l8 * i9 >> 16;
- }
- WorldController.method310(500, 800, screenAreaWidth, screenAreaHeight, ai);
- if (loggedIn) {
- aRSImageProducer_1165 = new ImageProducer(screenAreaWidth, screenAreaHeight);
- }
- }
- public static boolean isSummon(final Npc npc) {
- String action = "";
- for (int i = 0; i <= 4; i++) {
- if (npc.desc == null)
- return false;
- if (npc.desc.actions == null)
- return false;
- action = npc.desc.actions[i];
- if (action == null)
- continue;
- if (action.toLowerCase().contains("pick-up")) {
- return true;
- }
- }
- return false;
- }
- public void setTabInterfaceId(int index, int interfaceId) {
- this.tabInterfaceIDs[index] = interfaceId;
- if (this.tabID == index) {
- // this.needDrawTabArea = true;
- tabAreaAltered = true;
- this.inputTaken = true;
- }
- }
- public void openTab(int tab) {
- tabID = tab;
- tabAreaAltered = true;
- inputTaken = true;
- }
- public boolean getMousePositions() {
- if (mouseInRegion(frameWidth - (frameWidth <= 1000 ? 240 : 420), frameHeight - (frameWidth <= 1000 ? 90 : 37),
- frameWidth, frameHeight)) {
- return false;
- }
- if (showChatComponents) {
- if (changeChatArea) {
- if (super.mouseX > 0 && super.mouseX < 494 && super.mouseY > frameHeight - 175
- && super.mouseY < frameHeight) {
- return true;
- } else {
- if (super.mouseX > 494 && super.mouseX < 515 && super.mouseY > frameHeight - 175
- && super.mouseY < frameHeight) {
- return false;
- }
- }
- } else if (!changeChatArea) {
- if (super.mouseX > 0 && super.mouseX < 519 && super.mouseY > frameHeight - 175
- && super.mouseY < frameHeight) {
- return false;
- }
- }
- }
- if (mouseInRegion(frameWidth - 216, 0, frameWidth, 172)) {
- return false;
- }
- if (!changeTabArea) {
- if (super.mouseX > 0 && super.mouseY > 0 && super.mouseY < frameWidth && super.mouseY < frameHeight) {
- if (super.mouseX >= frameWidth - 242 && super.mouseY >= frameHeight - 335) {
- return false;
- }
- return true;
- }
- return false;
- }
- if (showTabComponents) {
- if (frameWidth > 1000) {
- if (super.mouseX >= frameWidth - 420 && super.mouseX <= frameWidth && super.mouseY >= frameHeight - 37
- && super.mouseY <= frameHeight
- || super.mouseX > frameWidth - 225 && super.mouseX < frameWidth
- && super.mouseY > frameHeight - 37 - 274 && super.mouseY < frameHeight) {
- return false;
- }
- } else {
- if (super.mouseX >= frameWidth - 210 && super.mouseX <= frameWidth && super.mouseY >= frameHeight - 74
- && super.mouseY <= frameHeight
- || super.mouseX > frameWidth - 225 && super.mouseX < frameWidth
- && super.mouseY > frameHeight - 74 - 274 && super.mouseY < frameHeight) {
- return false;
- }
- }
- }
- return true;
- }
- public boolean mouseInRegion(int x1, int y1, int x2, int y2) {
- if (super.mouseX >= x1 && super.mouseX <= x2 && super.mouseY >= y1 && super.mouseY <= y2) {
- return true;
- }
- return false;
- }
- public boolean mouseMapPosition() {
- if (super.mouseX >= frameWidth - 21 && super.mouseX <= frameWidth && super.mouseY >= 0 && super.mouseY <= 21) {
- return false;
- }
- return true;
- }
- private void drawLoadingMessages(int used, String s, String s1) {
- int width = regularText.getTextWidth(used == 1 ? s : s1);
- int height = s1 == null ? 25 : 38;
- DrawingArea.drawPixels(1, 1, width + 6, height, 0);
- DrawingArea.drawPixels(1, 1, width + 6, 1, 0xffffff);
- DrawingArea.drawPixels(1, 1, 1, height, 0xffffff);
- DrawingArea.drawPixels(1, height, width + 6, 1, 0xffffff);
- DrawingArea.drawPixels(width + 6, 1, 1, height, 0xffffff);
- regularText.drawText(0xffffff, s, 18, width / 2 + 5);
- if (s1 != null) {
- regularText.drawText(0xffffff, s1, 31, width / 2 + 5);
- }
- }
- 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 (s.length() > 8)
- s = "@gre@" + 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(long j) {
- 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 faceNorth() {
- minimapInt1 = 0;
- anInt1184 = 120;
- }
- public void faceSouth() {
- minimapInt1 = 1010;
- anInt1184 = 120;
- }
- 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 BufferedInputStream(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;
- }
- }
- private boolean menuHasAddFriend(int j) {
- if (j < 0)
- return false;
- int k = menuActionID[j];
- if (k >= 2000)
- k -= 2000;
- return k == 337;
- }
- public String itemResultNames[] = new String[100];
- public int itemResultIDs[] = new int[100];
- public static int itemResultScrollPos;
- public static boolean displayScrollbar;
- public void displayItemSearch() {
- int yPosOffset = (frameMode != ScreenMode.FIXED) ? screenAreaHeight - 165 : 0;
- int xPosOffset = 0;
- try {
- // quickChat = false;
- if (buttonclicked && inputDialogState == 3) {
- if (amountOrNameInput != "") {
- itemSearch(amountOrNameInput);
- }
- cacheSprites[64].drawSprite(0 + xPosOffset, 0 + yPosOffset);
- DrawingArea.setDrawingArea(121 + yPosOffset, 8, 512, 7);
- cacheSprites2[678].drawSprite(18, 18 + yPosOffset);
- for (int j = 0; j < totalItemResults; j++) {
- int x = super.mouseX;
- int y = super.mouseY;
- final int yPos = 21 + j * 14 - itemResultScrollPos;
- if (yPos > 0 && yPos < 210) {
- String n = itemResultNames[j];
- for (int i = 0; i <= 20; i++)
- if (n.contains("<img=" + i + ">"))
- n = n.replaceAll("<img=" + i + ">", "");
- boldText.method591(capitalizeFirstChar(n), 78, 0xA05A00,
- yPos + yPosOffset + (totalItemResults < 8 ? 6 : 0));
- if (x > 74 && x < 495
- && y > ((frameMode == ScreenMode.FIXED) ? 338 : screenAreaHeight - 165) + yPos - 13
- + (totalItemResults < 8 ? 6 : 0)
- && y < ((frameMode == ScreenMode.FIXED) ? 338 : screenAreaHeight - 165) + yPos + 2
- + (totalItemResults < 8 ? 6 : 0)) {
- DrawingArea.fillRectangle(0x807660, yPos - 12 + yPosOffset + (totalItemResults < 8 ? 6 : 0),
- 424, 15, 60, 75);
- Sprite itemImg = ItemDefinition.getSprite(itemResultIDs[j], 1, 0);
- if (itemImg != null)
- itemImg.drawSprite(22, 20 + yPosOffset);
- GEItemId = itemResultIDs[j];
- }
- }
- }
- DrawingArea.drawPixels(74, 8 + yPosOffset, 2, 113, 0x807660);
- DrawingArea.defaultDrawingAreaSize();
- if (totalItemResults > 8) {
- displayScrollbar = true;
- drawScrollbar(114, itemResultScrollPos, 8 + yPosOffset, 496 + xPosOffset, totalItemResults * 14,
- false);
- // drawScrollbar(112, itemResultScrollPos, 8, 496,
- // totalItemResults * 14 + 12, 0);
- } else {
- displayScrollbar = false;
- }
- boolean showMatches = true;
- showMatches = true;
- if (amountOrNameInput.length() == 0) {
- boldText.drawCenteredText(0xA05A00, 259, "Grand Exchange Item Search", 30 + yPosOffset, false);
- smallText.drawCenteredText(0xA05A00, 259,
- "To search for an item, start by typing part of it's name.", 80 + yPosOffset, false);
- smallText.drawCenteredText(0xA05A00, 259,
- "Then, simply select the item you want from the results on the display.",
- 80 + 15 + yPosOffset, false);
- // chatTextDrawingArea.drawText(0xffffff, amountOrNameInput
- // +
- // "*", 32, 133);
- showMatches = false;
- }
- if (totalItemResults == 0 && showMatches) {
- smallText.drawCenteredText(0xA05A00, 259, "No matching items found", 80 + yPosOffset, false);
- }
- DrawingArea.fillRectangle(0x807660, 121 + yPosOffset, 506, 15, 120, 7);// box
- // chatTextDrawingArea.drawText(0, "<img=8>", 133, 12);
- boldText.method591(amountOrNameInput + "*", 28 + xPosOffset, 0xffffff, 133 + yPosOffset);
- // chatTextDrawingArea.drawText(0xffffff, amountOrNameInput +
- // "*",
- // 133, 122);
- DrawingArea.drawLine(121 + yPosOffset, 0x807660, 506, 7);// line
- // drawClose(496, 122, 496, 345 + 112, 496 + 19, 361 + 112);
- // drawClose(496, 122, 496, 345 + 112, 496 + 19, 361 + 112);
- // drawClose(496, 122, 496, 345 + 112, 496 + 19, 361 + 112);
- }
- cacheSprites2[679].drawSprite(11, 122 + yPosOffset);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public static String capitalizeFirstChar(String s) {
- try {
- if (s != "")
- return (s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase()).trim();
- } catch (Exception e) {
- }
- return s;
- }
- public void itemSearch(String n) {
- if (n == null || n.length() == 0) {
- totalItemResults = 0;
- return;
- }
- String searchName = n;
- String searchParts[] = new String[100];
- int totalResults = 0;
- do {
- int k = searchName.indexOf(" ");
- if (k == -1)
- break;
- String part = searchName.substring(0, k).trim();
- if (part.length() > 0)
- searchParts[totalResults++] = part.toLowerCase();
- searchName = searchName.substring(k + 1);
- } while (true);
- searchName = searchName.trim();
- if (searchName.length() > 0)
- searchParts[totalResults++] = searchName.toLowerCase();
- totalItemResults = 0;
- label0: for (int id = 0; id < ItemDefinition.totalItems; id++) {
- ItemDefinition item = ItemDefinition.forID(id);
- if (item.certTemplateID != -1 || item.lentItemID != -1 || item.name == null || item.name == "Picture"
- || item.certID == 18786 || item.name == "Null" || item.name.toLowerCase().contains("coins")
- || item.value <= 0 || item.untradeable)
- continue;
- String result = item.name.toLowerCase();
- for (int idx = 0; idx < totalResults; idx++)
- if (result.indexOf(searchParts[idx]) == -1)
- continue label0;
- itemResultNames[totalItemResults] = result;
- itemResultIDs[totalItemResults] = id;
- totalItemResults++;
- if (totalItemResults >= itemResultNames.length)
- return;
- }
- }
- public static String optimizeText(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.replace("_", " ");
- }
- private void buildItemSearch(int mouseY) {
- int y = 0;
- for (int idx = 0; idx < 100; idx++) {
- if (amountOrNameInput.length() == 0)
- return;
- else if (totalItemResults == 0)
- return;
- if (amountOrNameInput == "")
- return;
- if (itemResultNames[idx] == null)
- continue;
- String name = capitalizeFirstChar(itemResultNames[idx]);
- for (int i = 0; i <= 20; i++)
- if (name.contains(" <img=" + i + ">"))
- name = name.replaceAll(" <img=" + i + ">", "");
- int textY = (21 + y * 14) - itemResultScrollPos;
- if (mouseY > textY - 14 && mouseY <= textY && super.mouseX > 74 && super.mouseX < 495) {
- menuActionName[menuActionRow] = "" + name;
- menuActionID[menuActionRow] = 1251;
- menuActionRow++;
- }
- y++;
- }
- }
- public void drawGrandExchange() {
- if (openInterfaceID != 24500 && openInterfaceID != 54700 && openInterfaceID != 53700) {
- return;
- }
- if (openInterfaceID == 24500) {
- for (int i = 1; i < Slots.length; i++) {
- if (Slots[i] == 0) {
- drawUpdate(i, "Regular");
- }
- if (Slots[i] == 1 && slots[i] == "Sell") {
- drawUpdate(i, "Submit Sell");
- }
- if (Slots[i] == 1 && slots[i] == "Buy") {
- drawUpdate(i, "Submit Buy");
- }
- if (Slots[i] == 2 && slots[i] == "Sell") {
- drawUpdate(i, "Sell");
- }
- if (Slots[i] == 2 && slots[i] == "Buy") {
- drawUpdate(i, "Buy");
- }
- if (Slots[i] == 3 && slots[i] == "Sell") {
- drawUpdate(i, "Finished Selling");
- }
- if (Slots[i] == 3 && slots[i] == "Buy") {
- drawUpdate(i, "Finished Buying");
- }
- }
- }
- int x = 0;
- int y = 0;
- x = (frameMode == ScreenMode.FIXED) ? 71 : (71 + (screenAreaWidth / 2 - 256));
- y = (frameMode == ScreenMode.FIXED) ? 303 : (screenAreaHeight / 2 + 136);
- if (openInterfaceID == 54700) {
- per4 = cacheSprites2[647];
- per5 = cacheSprites2[648];
- per6 = cacheSprites2[649];
- abort2 = cacheSprites2[651];
- if (slotColorPercent[slotSelected] == 100 || slotAborted[slotSelected]) {
- RSInterface.interfaceCache[54800].tooltip = "[GE]";
- } else {
- RSInterface.interfaceCache[54800].tooltip = "Abort offer";
- }
- if (slotSelected <= 6) {
- if (!slotAborted[slotSelected]) {
- for (int k9 = 1; k9 < slotColorPercent[slotSelected]; k9++) {
- if (slotColorPercent[slotSelected] > 0) {
- if (k9 == 1) {
- if (per4 != null)
- per4.drawSprite(x, y);
- x += 3;
- } else if (k9 == 99) {
- if (per6 != null)
- per6.drawSprite(x, y);
- x += 4;
- } else {
- if (per5 != null)
- per5.drawSprite(x, y);
- x += 3;
- }
- }
- }
- } else {
- if (abort2 != null)
- abort2.drawSprite(x, y);
- }
- }
- }
- x = (frameMode == ScreenMode.FIXED) ? 71 : (71 + (screenAreaWidth / 2 - 256));
- y = (frameMode == ScreenMode.FIXED) ? 303 : (screenAreaHeight / 2 + 136);
- if (openInterfaceID == 53700) {
- per4 = cacheSprites2[647];
- per5 = cacheSprites2[648];
- per6 = cacheSprites2[649];
- abort2 = cacheSprites2[651];
- if (slotColorPercent[slotSelected] == 100 || slotAborted[slotSelected]) {
- RSInterface.interfaceCache[53800].tooltip = "[GE]";
- } else {
- RSInterface.interfaceCache[53800].tooltip = "Abort offer";
- }
- if (slotSelected <= 6) {
- if (!slotAborted[slotSelected]) {
- for (int k9 = 1; k9 < slotColorPercent[slotSelected]; k9++) {
- if (slotColorPercent[slotSelected] > 0) {
- if (k9 == 1) {
- if (per4 != null)
- per4.drawSprite(x, y);
- x += 3;
- } else if (k9 == 99) {
- if (per6 != null)
- per6.drawSprite(x, y);
- x += 4;
- } else {
- if (per5 != null)
- per5.drawSprite(x, y);
- x += 3;
- }
- }
- }
- } else {
- if (abort2 != null)
- abort2.drawSprite(x, y);
- }
- }
- }
- }
- public void drawUpdate(int id, String type) {
- int x = 0;
- int y = 0;
- int x2 = 0;
- int y2 = 0;
- int x3 = 0;
- int y3 = 0;
- boolean fixed = (frameMode == ScreenMode.FIXED);
- switch (id) {
- case 1:
- x = fixed ? 30 : (screenAreaWidth / 2 - 226);
- x2 = fixed ? 80 : (screenAreaWidth / 2 - 226 + 50);
- x3 = fixed ? 40 : (screenAreaWidth / 2 - 226 + 10);
- y = fixed ? 74 : (screenAreaHeight / 2 - 93);
- y2 = fixed ? 136 : (screenAreaHeight / 2 - 93 + 62);
- y3 = fixed ? 115 : (screenAreaHeight / 2 - 93 + 41);
- break;
- case 2:
- x = fixed ? 186 : (screenAreaWidth / 2 - 70);
- x2 = fixed ? 80 + 156 : (screenAreaWidth / 2 - 70 + 50);
- x3 = fixed ? 40 + 156 : (screenAreaWidth / 2 - 70 + 10);
- y = fixed ? 74 : (screenAreaHeight / 2 - 93);
- y2 = fixed ? 136 : (screenAreaHeight / 2 - 93 + 62);
- y3 = fixed ? 115 : (screenAreaHeight / 2 - 93 + 41);
- break;
- case 3:
- x = fixed ? 342 : (screenAreaWidth / 2 + 86);
- x2 = fixed ? 80 + 156 + 156 : (screenAreaWidth / 2 + 86 + 50);
- x3 = fixed ? 40 + 156 + 156 : (screenAreaWidth / 2 + 86 + 10);
- y = fixed ? 74 : (screenAreaHeight / 2 - 93);
- y2 = fixed ? 136 : (screenAreaHeight / 2 - 93 + 62);
- y3 = fixed ? 115 : (screenAreaHeight / 2 - 93 + 41);
- break;
- case 4:
- x = fixed ? 30 : (screenAreaWidth / 2 - 226);
- x2 = fixed ? 80 : (screenAreaWidth / 2 - 226 + 50);
- x3 = fixed ? 40 : (screenAreaWidth / 2 - 226 + 10);
- y = fixed ? 194 : (screenAreaHeight / 2 + 27);
- y2 = fixed ? 256 : (screenAreaHeight / 2 + 27 + 62);
- y3 = fixed ? 235 : (screenAreaHeight / 2 + 27 + 41);
- break;
- case 5:
- x = fixed ? 186 : (screenAreaWidth / 2 - 70);
- x2 = fixed ? 80 + 156 : (screenAreaWidth / 2 - 70 + 50);
- x3 = fixed ? 40 + 156 : (screenAreaWidth / 2 - 70 + 10);
- y = fixed ? 194 : (screenAreaHeight / 2 + 27);
- y2 = fixed ? 256 : (screenAreaHeight / 2 + 27 + 62);
- y3 = fixed ? 235 : (screenAreaHeight / 2 + 27 + 41);
- break;
- case 6:
- x = fixed ? 342 : (screenAreaWidth / 2 + 86);
- x2 = fixed ? 80 + 156 + 156 : (screenAreaWidth / 2 + 86 + 50);
- x3 = fixed ? 40 + 156 + 156 : (screenAreaWidth / 2 + 86 + 10);
- y = fixed ? 194 : (screenAreaHeight / 2 + 27);
- y2 = fixed ? 256 : (screenAreaHeight / 2 + 27 + 62);
- y3 = fixed ? 235 : (screenAreaHeight / 2 + 27 + 41);
- break;
- }
- x -= 2;
- x2 -= 2;
- x3 -= 2;
- int minus = 20;
- if (type == "Sell") {
- if (super.mouseX >= x && super.mouseX <= x + 140 && super.mouseY >= y && super.mouseY <= y + 110
- && !menuOpen) {
- SellHover = cacheSprites2[655];
- if (SellHover != null)
- SellHover.drawSprite(x, y);
- } else {
- cacheSprites2[30].drawSprite(x, y);
- }
- cacheSprites2[678].drawSprite(x + 6, y + 30);
- if (slotItems[id] > 0 && ItemDefinition.getSprite(slotItems[id], 1, 0) != null)
- ItemDefinition.getSprite(slotItems[id], 1, 0).drawSprite(x + 9, y + 32);
- drawInterface(0, x + 110, RSInterface.interfaceCache[54000], y + 38);
- setGrandExchange(id, false);
- if (slotAborted[id] || slotColorPercent[id] == 100) {
- changeSet(id, true, false);
- } else {
- changeSet(id, true, true);
- }
- drawPercentage(id);
- smallText.method592(0xCC9900, x2, RSInterface.interfaceCache[32000 + id].message, y2 - minus, true);
- smallText.method592(0xBDBB5B, x2, RSInterface.interfaceCache[33000 + id].message, y2, true);
- smallText.method592(0xFFFF00, x3, RSInterface.interfaceCache[33100 + id].message, y3, true);
- setHovers(id, false);
- if (cacheSprites2[640] != null) {
- cacheSprites2[640].drawSprite(x + 110, y + 39);
- if (mouseInRegion(x + 112, y + 38, x + 132, y + 60)) {
- cacheSprites2[641].drawSprite(x + 110, y + 39);
- changeSet(id, false, true);
- }
- }
- String name[] = optimizeText(ItemDefinition.forID(slotItems[id]).name).split(" ");
- int index = 0;
- for (String n : name) {
- int xDraw = x + 77;
- int yDraw = y + (name.length > 2 ? 41 : 48) + (index * 15);
- smallText.drawCenteredText(0xA05A00, xDraw, n, yDraw, false);
- index++;
- }
- } else if (type == "Buy") {
- if (super.mouseX >= x && super.mouseX <= x + 140 && super.mouseY >= y && super.mouseY <= y + 110
- && !menuOpen) {
- BuyHover = cacheSprites2[654];
- if (BuyHover != null)
- BuyHover.drawSprite(x, y);
- } else {
- cacheSprites2[29].drawSprite(x, y);
- }
- cacheSprites2[678].drawSprite(x + 6, y + 30);
- if (slotItems[id] > 0 && ItemDefinition.getSprite(slotItems[id], 1, 0) != null)
- ItemDefinition.getSprite(slotItems[id], 1, 0).drawSprite(x + 9, y + 32);
- setGrandExchange(id, false);
- if (slotAborted[id] || slotColorPercent[id] == 100) {
- changeSet(id, true, false);
- } else {
- changeSet(id, true, true);
- }
- drawPercentage(id);
- smallText.method592(0xCC9900, x2, RSInterface.interfaceCache[32000 + id].message, y2 - minus, true);
- smallText.method592(0xBDBB5B, x2, RSInterface.interfaceCache[33000 + id].message, y2, true);
- smallText.method592(0xFFFF00, x3, RSInterface.interfaceCache[33100 + id].message, y3, true);
- setHovers(id, false);
- if (cacheSprites2[640] != null) {
- cacheSprites2[640].drawSprite(x + 110, y + 39);
- if (mouseInRegion(x + 112, y + 38, x + 132, y + 60)) {
- cacheSprites2[641].drawSprite(x + 110, y + 39);
- changeSet(id, false, true);
- }
- }
- String name[] = optimizeText(ItemDefinition.forID(slotItems[id]).name).split(" ");
- int index = 0;
- for (String n : name) {
- int xDraw = x + 77;
- int yDraw = y + (name.length > 2 ? 41 : 48) + (index * 15);
- smallText.drawCenteredText(0xA05A00, xDraw, n, yDraw, false);
- index++;
- }
- } else if (type == "Submit Buy") {
- if (super.mouseX >= x && super.mouseX <= x + 140 && super.mouseY >= y && super.mouseY <= y + 110
- && !menuOpen) {
- buySubmitHover = cacheSprites2[656];
- if (buySubmitHover != null)
- buySubmitHover.drawSprite(x, y);
- } else {
- cacheSprites2[27].drawSprite(x, y);
- }
- setGrandExchange(id, false);
- changeSet(id, false, false);
- smallText.method592(0xCC9900, x2, RSInterface.interfaceCache[32000 + id].message, y2 - minus, true);
- smallText.method592(0xBDBB5B, x2, RSInterface.interfaceCache[33000 + id].message, y2, true);
- smallText.method592(0xFFFF00, x3, RSInterface.interfaceCache[33100 + id].message, y3, true);
- setHovers(id, false);
- } else if (type == "Submit Sell") {
- if (super.mouseX >= x && super.mouseX <= x + 140 && super.mouseY >= y && super.mouseY <= y + 110
- && !menuOpen) {
- sellSubmitHover = cacheSprites2[657];
- if (sellSubmitHover != null)
- sellSubmitHover.drawSprite(x, y);
- } else {
- cacheSprites2[28].drawSprite(x, y);
- }
- setGrandExchange(id, false);
- changeSet(id, false, false);
- smallText.method592(0xCC9900, x2, RSInterface.interfaceCache[32000 + id].message, y2 - minus, true);
- smallText.method592(0xBDBB5B, x2, RSInterface.interfaceCache[33000 + id].message, y2, true);
- smallText.method592(0xFFFF00, x3, RSInterface.interfaceCache[33100 + id].message, y3, true);
- setHovers(id, false);
- } else if (type == "Regular") {
- setGrandExchange(id, true);
- setHovers(id, true);
- } else if (type == "Finished Selling") {
- if (super.mouseX >= x && super.mouseX <= x + 140 && super.mouseY >= y && super.mouseY <= y + 110
- && !menuOpen) {
- SellHover = cacheSprites2[655];
- if (SellHover != null)
- SellHover.drawSprite(x, y);
- } else {
- cacheSprites2[30].drawSprite(x, y);
- }
- cacheSprites2[678].drawSprite(x + 6, y + 30);
- if (slotItems[id] > 0 && ItemDefinition.getSprite(slotItems[id], 1, 0) != null)
- ItemDefinition.getSprite(slotItems[id], 1, 0).drawSprite(x + 9, y + 32);
- drawInterface(0, x + 110, RSInterface.interfaceCache[54000], y + 38);
- setGrandExchange(id, false);
- changeSet(id, true, false);
- drawPercentage(id);
- smallText.method592(0xCC9900, x2, RSInterface.interfaceCache[32000 + id].message, y2 - minus, true);
- smallText.method592(0xBDBB5B, x2, RSInterface.interfaceCache[33000 + id].message, y2, true);
- smallText.method592(0xFFFF00, x3, RSInterface.interfaceCache[33100 + id].message, y3, true);
- setHovers(id, false);
- if (cacheSprites2[640] != null) {
- cacheSprites2[640].drawSprite(x + 110, y + 39);
- if (mouseInRegion(x + 112, y + 38, x + 132, y + 60)) {
- cacheSprites2[641].drawSprite(x + 110, y + 39);
- changeSet(id, false, true);
- }
- }
- String name[] = optimizeText(ItemDefinition.forID(slotItems[id]).name).split(" ");
- int index = 0;
- for (String n : name) {
- int xDraw = x + 77;
- int yDraw = y + (name.length > 2 ? 41 : 48) + (index * 15);
- smallText.drawCenteredText(0xA05A00, xDraw, n, yDraw, false);
- index++;
- }
- } else if (type == "Finished Buying") {
- if (super.mouseX >= x && super.mouseX <= x + 140 && super.mouseY >= y && super.mouseY <= y + 110
- && !menuOpen) {
- BuyHover = cacheSprites2[656];
- if (BuyHover != null)
- BuyHover.drawSprite(x, y);
- } else {
- cacheSprites2[29].drawSprite(x, y);
- }
- cacheSprites2[678].drawSprite(x + 6, y + 30);
- ItemDefinition.getSprite(slotItems[id], 1, 0).drawSprite(x + 9, y + 32);
- drawInterface(0, x + 110, RSInterface.interfaceCache[54000], y + 38);
- setGrandExchange(id, false);
- changeSet(id, true, false);
- drawPercentage(id);
- smallText.method592(0xCC9900, x2, RSInterface.interfaceCache[32000 + id].message, y2 - minus, true);
- smallText.method592(0xBDBB5B, x2, RSInterface.interfaceCache[33000 + id].message, y2, true);
- smallText.method592(0xFFFF00, x3, RSInterface.interfaceCache[33100 + id].message, y3, true);
- setHovers(id, false);
- if (cacheSprites2[640] != null) {
- cacheSprites2[640].drawSprite(x + 110, y + 39);
- if (mouseInRegion(x + 112, y + 38, x + 132, y + 60)) {
- cacheSprites2[641].drawSprite(x + 110, y + 39);
- changeSet(id, false, true);
- }
- }
- String name[] = optimizeText(ItemDefinition.forID(slotItems[id]).name).split(" ");
- int index = 0;
- for (String n : name) {
- int xDraw = x + 77;
- int yDraw = y + (name.length > 2 ? 41 : 48) + (index * 15);
- smallText.drawCenteredText(0xA05A00, xDraw, n, yDraw, false);
- index++;
- }
- }
- }
- public void drawPercentage(int id) {
- per0 = cacheSprites2[643];
- per1 = cacheSprites2[644];
- per2 = cacheSprites2[645];
- per3 = cacheSprites2[646];
- abort1 = cacheSprites2[650];
- int x = 0;
- int y = 0;
- boolean fixed = (frameMode == ScreenMode.FIXED);
- switch (id) {
- case 1:
- x = fixed ? 30 + 8 : (screenAreaWidth / 2 - 226 + 8);
- y = fixed ? 74 + 81 : (screenAreaHeight / 2 - 93 + 81);
- break;
- case 2:
- x = fixed ? 186 + 8 : (screenAreaWidth / 2 - 70 + 8);
- y = fixed ? 74 + 81 : (screenAreaHeight / 2 - 93 + 81);
- break;
- case 3:
- x = fixed ? 342 + 8 : (screenAreaWidth / 2 + 86 + 8);
- y = fixed ? 74 + 81 : (screenAreaHeight / 2 - 93 + 81);
- break;
- case 4:
- x = fixed ? 30 + 8 : (screenAreaWidth / 2 - 226 + 8);
- y = fixed ? 194 + 81 : (screenAreaHeight / 2 + 27 + 81);
- break;
- case 5:
- x = fixed ? 186 + 8 : (screenAreaWidth / 2 - 70 + 8);
- y = fixed ? 194 + 81 : (screenAreaHeight / 2 + 27 + 81);
- break;
- case 6:
- x = fixed ? 342 + 8 : (screenAreaWidth / 2 + 86 + 8);
- y = fixed ? 194 + 81 : (screenAreaHeight / 2 + 27 + 81);
- break;
- }
- x -= 2;
- if (slotColorPercent[id] > 100) {
- slotColorPercent[id] = 100;
- }
- int s = 0;
- if (!slotAborted[id]) {
- for (int k9 = 1; k9 < slotColorPercent[id]; k9++) {
- if (slotColorPercent[id] > 0) {
- if (k9 == 1) {
- if (per0 != null)
- per0.drawSprite(x, y);
- x += 2;
- } else if (k9 == 2) {
- if (per1 != null)
- per1.drawSprite(x, y);
- x += 2;
- } else if (k9 >= 6 && k9 <= 14) {
- if (per3 != null)
- per3.drawSprite(x, y);
- x += 1;
- } else if (k9 >= 56 && k9 <= 65) {
- if (per3 != null)
- per3.drawSprite(x, y);
- x += 1;
- } else if (k9 >= 76 && k9 <= 82) {
- if (per3 != null)
- per3.drawSprite(x, y);
- x += 1;
- } else {
- if (s == 0) {
- if (per2 != null)
- per2.drawSprite(x, y);
- x += 2;
- s += 1;
- } else if (s == 1) {
- if (per3 != null)
- per3.drawSprite(x, y);
- x += 1;
- s += 1;
- } else if (s == 2) {
- if (per3 != null)
- per3.drawSprite(x, y);
- x += 1;
- s = 0;
- } else if (s == 4) {
- if (per3 != null)
- per3.drawSprite(x, y);
- x += 1;
- s = 0;
- }
- }
- }
- }
- } else {
- if (abort1 != null)
- abort1.drawSprite(x, y);
- }
- }
- public void setHovers(int id, boolean on) {
- switch (id) {
- case 1:
- if (!on) {
- } else {
- }
- break;
- case 2:
- if (!on) {
- } else {
- }
- break;
- case 3:
- if (!on) {
- } else {
- }
- break;
- case 4:
- if (!on) {
- } else {
- }
- break;
- case 5:
- if (!on) {
- } else {
- }
- break;
- case 6:
- if (!on) {
- } else {
- }
- break;
- }
- }
- public void setGrandExchange(int id, boolean on) {
- switch (id) {
- case 1:
- if (on) {
- RSInterface.interfaceCache[24505].tooltip = "Buy";
- RSInterface.interfaceCache[24511].tooltip = "Sell";
- changeSet(id, false, false);
- } else {
- RSInterface.interfaceCache[24505].tooltip = "[GE]";
- RSInterface.interfaceCache[24511].tooltip = "[GE]";
- }
- break;
- case 2:
- if (on) {
- RSInterface.interfaceCache[24523].tooltip = "Buy";
- RSInterface.interfaceCache[24526].tooltip = "Sell";
- changeSet(id, false, false);
- } else {
- RSInterface.interfaceCache[24523].tooltip = "[GE]";
- RSInterface.interfaceCache[24526].tooltip = "[GE]";
- }
- break;
- case 3:
- if (on) {
- RSInterface.interfaceCache[24514].tooltip = "Buy";
- RSInterface.interfaceCache[24529].tooltip = "Sell";
- changeSet(id, false, false);
- } else {
- RSInterface.interfaceCache[24514].tooltip = "[GE]";
- RSInterface.interfaceCache[24529].tooltip = "[GE]";
- }
- break;
- case 4:
- if (on) {
- RSInterface.interfaceCache[24508].tooltip = "Buy";
- RSInterface.interfaceCache[24532].tooltip = "Sell";
- changeSet(id, false, false);
- } else {
- RSInterface.interfaceCache[24508].tooltip = "[GE]";
- RSInterface.interfaceCache[24532].tooltip = "[GE]";
- }
- break;
- case 5:
- if (on) {
- RSInterface.interfaceCache[24517].tooltip = "Buy";
- RSInterface.interfaceCache[24535].tooltip = "Sell";
- changeSet(id, false, false);
- } else {
- RSInterface.interfaceCache[24517].tooltip = "[GE]";
- RSInterface.interfaceCache[24535].tooltip = "[GE]";
- }
- break;
- case 6:
- if (on) {
- RSInterface.interfaceCache[24520].tooltip = "Buy";
- RSInterface.interfaceCache[24538].tooltip = "Sell";
- changeSet(id, false, false);
- } else {
- RSInterface.interfaceCache[24520].tooltip = "[GE]";
- RSInterface.interfaceCache[24538].tooltip = "[GE]";
- }
- break;
- }
- }
- public void changeSet(int id, boolean view, boolean abort) {
- switch (id) {
- case 1:
- if (view) {
- RSInterface.interfaceCache[24543].tooltip = "View offer";
- } else {
- RSInterface.interfaceCache[24543].tooltip = "[GE]";
- }
- if (abort) {
- RSInterface.interfaceCache[24541].tooltip = "Abort offer";
- } else {
- RSInterface.interfaceCache[24541].tooltip = "[GE]";
- }
- break;
- case 2:
- if (view) {
- RSInterface.interfaceCache[24547].tooltip = "View offer";
- } else {
- RSInterface.interfaceCache[24547].tooltip = "[GE]";
- }
- if (abort) {
- RSInterface.interfaceCache[24545].tooltip = "Abort offer";
- } else {
- RSInterface.interfaceCache[24545].tooltip = "[GE]";
- }
- break;
- case 3:
- if (view) {
- RSInterface.interfaceCache[24551].tooltip = "View offer";
- } else {
- RSInterface.interfaceCache[24551].tooltip = "[GE]";
- }
- if (abort) {
- RSInterface.interfaceCache[24549].tooltip = "Abort offer";
- } else {
- RSInterface.interfaceCache[24549].tooltip = "[GE]";
- }
- break;
- case 4:
- if (view) {
- RSInterface.interfaceCache[24555].tooltip = "View offer";
- } else {
- RSInterface.interfaceCache[24555].tooltip = "[GE]";
- }
- if (abort) {
- RSInterface.interfaceCache[24553].tooltip = "Abort offer";
- } else {
- RSInterface.interfaceCache[24553].tooltip = "[GE]";
- }
- break;
- case 5:
- if (view) {
- RSInterface.interfaceCache[24559].tooltip = "View offer";
- } else {
- RSInterface.interfaceCache[24559].tooltip = "[GE]";
- }
- if (abort) {
- RSInterface.interfaceCache[24557].tooltip = "Abort offer";
- } else {
- RSInterface.interfaceCache[24557].tooltip = "[GE]";
- }
- break;
- case 6:
- if (view) {
- RSInterface.interfaceCache[24563].tooltip = "View offer";
- } else {
- RSInterface.interfaceCache[24563].tooltip = "[GE]";
- }
- if (abort) {
- RSInterface.interfaceCache[24561].tooltip = "Abort offer";
- } else {
- RSInterface.interfaceCache[24561].tooltip = "[GE]";
- }
- break;
- }
- }
- public boolean isRecruit(String name) {
- name = name.toLowerCase();
- if (Recruits.contains(" " + name + ",")) {
- return true;
- }
- if (Recruits.contains(", " + name + "]")) {
- return true;
- }
- if (Recruits.contains("[" + name + ",")) {
- return true;
- }
- if (Recruits.contains("[" + name + "]")) {
- return true;
- }
- return false;
- }
- public boolean isCorporal(String name) {
- name = name.toLowerCase();
- if (Corporals.contains(" " + name + ",")) {
- return true;
- }
- if (Corporals.contains(", " + name + "]")) {
- return true;
- }
- if (Corporals.contains("[" + name + ",")) {
- return true;
- }
- if (Corporals.contains("[" + name + "]")) {
- return true;
- }
- return false;
- }
- public boolean isSergeant(String name) {
- name = name.toLowerCase();
- if (Sergeants.contains(" " + name + ",")) {
- return true;
- }
- if (Sergeants.contains(", " + name + "]")) {
- return true;
- }
- if (Sergeants.contains("[" + name + ",")) {
- return true;
- }
- if (Sergeants.contains("[" + name + "]")) {
- return true;
- }
- return false;
- }
- public boolean isLieutenant(String name) {
- name = name.toLowerCase();
- if (Lieutenants.contains(" " + name + ",")) {
- return true;
- }
- if (Lieutenants.contains(", " + name + "]")) {
- return true;
- }
- if (Lieutenants.contains("[" + name + ",")) {
- return true;
- }
- if (Lieutenants.contains("[" + name + "]")) {
- return true;
- }
- return false;
- }
- public boolean isCaptain(String name) {
- name = name.toLowerCase();
- if (Captains.contains(" " + name + ",")) {
- return true;
- }
- if (Captains.contains(", " + name + "]")) {
- return true;
- }
- if (Captains.contains("[" + name + ",")) {
- return true;
- }
- if (Captains.contains("[" + name + "]")) {
- return true;
- }
- return false;
- }
- public boolean isGeneral(String name) {
- name = name.toLowerCase();
- if (Generals.contains(" " + name + ",")) {
- return true;
- }
- if (Generals.contains(", " + name + "]")) {
- return true;
- }
- if (Generals.contains("[" + name + ",")) {
- return true;
- }
- if (Generals.contains("[" + name + "]")) {
- return true;
- }
- return false;
- }
- void sendPacket(int packet) {
- if (packet == 103) {
- stream.createFrame(103);
- stream.writeByte(inputString.length() - 1);
- stream.writeString(inputString.substring(2));
- inputString = "";
- promptInput = "";
- interfaceButtonAction = 0;
- }
- if (packet == 1003) {
- stream.createFrame(103);
- inputString = "::" + inputString;
- stream.writeByte(inputString.length() - 1);
- stream.writeString(inputString.substring(2));
- inputString = "";
- promptInput = "";
- interfaceButtonAction = 0;
- }
- }
- private int showClanOptions;
- private void updateClanChatTab() {
- RSInterface.rebuildClanChatList(showClanOptions);
- }
- public void init() {
- try {
- nodeID = 10;
- portOff = 0;
- setHighMemAndReadUUID();
- isMembers = true;
- Signlink.storeid = 32;
- Signlink.startpriv(InetAddress.getLocalHost());
- initClientFrame(frameWidth, frameHeight);
- instance = this;
- } catch (Exception exception) {
- return;
- }
- }
- 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 {
- World world = getCurrentWorld();
- return new Socket(InetAddress.getByName(world.getAddress()), world.getPort());
- }
- private void processMenuClick() {
- if (activeInterfaceType != 0)
- return;
- int j = super.clickMode3;
- if (spellSelected == 1 && super.saveClickX >= 516 && 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 -= 519;
- j1 -= 168;
- }
- if (menuScreenArea == 2) {
- k -= 17;
- j1 -= 338;
- }
- if (menuScreenArea == 3) {
- k -= 519;
- j1 -= 0;
- }
- if (k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10
- || j1 > menuOffsetY + menuHeight + 10) {
- menuOpen = false;
- if (menuScreenArea == 1) {
- }
- 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;
- switch (menuScreenArea) {
- case 0:
- k2 -= 4;
- l2 -= 4;
- break;
- case 1:
- k2 -= 519;
- l2 -= 168;
- break;
- case 2:
- k2 -= 5;
- l2 -= 338;
- break;
- case 3:
- k2 -= 519;
- l2 -= 0;
- break;
- }
- 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;
- }
- if (i3 != -1)
- doAction(i3);
- menuOpen = false;
- if (menuScreenArea == 1) {
- }
- 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.aBoolean259 || class9.aBoolean235) {
- 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();
- processMainScreenClick();
- gameframe.processTabAreaClick();
- }
- }
- 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 "";
- }
- private void saveMidi(boolean flag, byte abyte0[]) {
- Signlink.midifade = flag ? 1 : 0;
- Signlink.midisave(abyte0, abyte0.length);
- }
- public void loadObjectsForRegion() {
- GameObjectSpawns.load();
- for (GameObject o : GameObjectSpawns.getObjects()) {
- addObject(o.getX(), o.getY(), o.getId(), o.getRotation(), o.getType(), o.getZ());
- }
- }
- public void addObject(int x, int y, int objectId, int face, int type, int height) {
- int mX = mapX - 6;
- int mY = mapY - 6;
- int x2 = x - (mX * 8);
- int y2 = y - (mY * 8);
- int i15 = 40 >> 2;
- int l17 = anIntArray1177[i15];
- if (y2 > 0 && y2 < 103 && x2 > 0 && x2 < 103) {
- requestObject(-1, objectId, face, l17, y2, type, height, x2, 0);
- }
- }
- private void method22() {
- try {
- anInt985 = -1;
- aClass19_1056.removeAll();
- aClass19_1013.removeAll();
- Texture.method366();
- unlinkMRUNodes();
- worldController.initToNull();
- System.gc();
- for (int i = 0; i < 4; i++)
- aClass11Array1230[i].method210();
- for (int l = 0; l < 4; l++) {
- for (int k1 = 0; k1 < 104; k1++) {
- for (int j2 = 0; j2 < 104; j2++)
- byteGroundArray[l][k1][j2] = 0;
- }
- }
- ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
- loadObjectsForRegion();
- int k2 = aByteArrayArray1183.length;
- stream.createFrame(0);
- if (!aBoolean1159) {
- for (int i3 = 0; i3 < k2; i3++) {
- int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
- int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
- byte abyte0[] = aByteArrayArray1183[i3];
- if (abyte0 != null)
- objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8,
- aClass11Array1230);
- }
- for (int j4 = 0; j4 < k2; j4++) {
- int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
- int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
- byte abyte2[] = aByteArrayArray1183[j4];
- if (abyte2 == null && anInt1070 < 800)
- objectManager.method174(k7, 64, 64, l5);
- }
- anInt1097++;
- if (anInt1097 > 160) {
- anInt1097 = 0;
- stream.createFrame(238);
- stream.writeByte(96);
- }
- stream.createFrame(0);
- for (int i6 = 0; i6 < k2; i6++) {
- byte abyte1[] = aByteArrayArray1247[i6];
- if (abyte1 != null) {
- int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
- int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
- objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
- }
- }
- /*
- * for (GameObject object : GameObjects.getAll()) {
- * addObject(object.getX(), object.getY(), object.getId(),
- * object.getOrientation(), object.getType(), object.getZ()); }
- */
- }
- if (aBoolean1159) {
- for (int j3 = 0; j3 < 4; j3++) {
- for (int k4 = 0; k4 < 13; k4++) {
- for (int j6 = 0; j6 < 13; j6++) {
- int l7 = anIntArrayArrayArray1129[j3][k4][j6];
- if (l7 != -1) {
- int i9 = l7 >> 24 & 3;
- int l9 = l7 >> 1 & 3;
- int j10 = l7 >> 14 & 0x3ff;
- int l10 = l7 >> 3 & 0x7ff;
- int j11 = (j10 / 8 << 8) + l10 / 8;
- for (int l11 = 0; l11 < anIntArray1234.length; l11++) {
- if (anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
- continue;
- objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8,
- aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
- break;
- }
- }
- }
- }
- }
- for (int l4 = 0; l4 < 13; l4++) {
- for (int k6 = 0; k6 < 13; k6++) {
- int i8 = anIntArrayArrayArray1129[0][l4][k6];
- if (i8 == -1)
- objectManager.method174(k6 * 8, 8, 8, l4 * 8);
- }
- }
- stream.createFrame(0);
- for (int l6 = 0; l6 < 4; l6++) {
- for (int j8 = 0; j8 < 13; j8++) {
- for (int j9 = 0; j9 < 13; j9++) {
- int i10 = anIntArrayArrayArray1129[l6][j8][j9];
- if (i10 != -1) {
- int k10 = i10 >> 24 & 3;
- int i11 = i10 >> 1 & 3;
- int k11 = i10 >> 14 & 0x3ff;
- int i12 = i10 >> 3 & 0x7ff;
- int j12 = (k11 / 8 << 8) + i12 / 8;
- for (int k12 = 0; k12 < anIntArray1234.length; k12++) {
- if (anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
- continue;
- objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8,
- (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
- break;
- }
- }
- }
- }
- }
- }
- stream.createFrame(0);
- objectManager.method171(aClass11Array1230, worldController);
- aRSImageProducer_1165.initDrawingArea();
- stream.createFrame(0);
- int k3 = ObjectManager.anInt145;
- if (k3 > plane)
- k3 = plane;
- if (k3 < plane - 1)
- k3 = plane - 1;
- if (lowMem)
- worldController.method275(ObjectManager.anInt145);
- else
- worldController.method275(0);
- for (int i5 = 0; i5 < 104; i5++) {
- for (int i7 = 0; i7 < 104; i7++)
- spawnGroundItem(i5, i7);
- }
- anInt1051++;
- if (anInt1051 > 98) {
- anInt1051 = 0;
- stream.createFrame(150);
- }
- method63();
- } catch (Exception exception) {
- exception.printStackTrace();
- }
- ObjectDefinition.mruNodes1.unlinkAll();
- if (ClientUI.getInstance() != null) {
- stream.createFrame(210);
- stream.writeDWord(0x3f008edd);
- }
- if (lowMem && Signlink.cache_dat != null) {
- int j = onDemandFetcher.getVersionCount(0);
- for (int i1 = 0; i1 < j; i1++) {
- int l1 = onDemandFetcher.getModelIndex(i1);
- if ((l1 & 0x79) == 0)
- Model.method461(i1);
- }
- }
- System.gc();
- Texture.method367(20);
- onDemandFetcher.method566();
- int k = (anInt1069 - 6) / 8 - 1;
- int j1 = (anInt1069 + 6) / 8 + 1;
- int i2 = (anInt1070 - 6) / 8 - 1;
- int l2 = (anInt1070 + 6) / 8 + 1;
- if (aBoolean1141) {
- k = 49;
- j1 = 50;
- i2 = 49;
- l2 = 50;
- }
- for (int l3 = k; l3 <= j1; l3++) {
- for (int j5 = i2; j5 <= l2; j5++)
- if (l3 == k || l3 == j1 || j5 == i2 || j5 == l2) {
- int j7 = onDemandFetcher.method562(0, j5, l3);
- if (j7 != -1)
- onDemandFetcher.method560(j7, 3);
- int k8 = onDemandFetcher.method562(1, j5, l3);
- if (k8 != -1)
- onDemandFetcher.method560(k8, 3);
- }
- }
- }
- public 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);
- }
- private void unlinkMRUNodes() {
- ObjectDefinition.mruNodes1.unlinkAll();
- ObjectDefinition.mruNodes2.unlinkAll();
- NpcDefinition.mruNodes.unlinkAll();
- ItemDefinition.mruNodes2.unlinkAll();
- ItemDefinition.mruNodes1.unlinkAll();
- Player.mruNodes.unlinkAll();
- SpotAnim.aMRUNodes_415.unlinkAll();
- }
- private void method24(int i) {
- int ai[] = minimapImage.myPixels;
- int j = ai.length;
- for (int k = 0; k < j; k++)
- ai[k] = 0;
- for (int l = 1; l < 103; l++) {
- int i1 = 24628 + (103 - l) * 512 * 4;
- for (int k1 = 1; k1 < 103; k1++) {
- if ((byteGroundArray[i][k1][l] & 0x18) == 0)
- worldController.method309(ai, i1, i, k1, l);
- if (i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
- worldController.method309(ai, i1, i + 1, k1, l);
- i1 += 4;
- }
- }
- int j1 = 0xFFFFFF;
- int l1 = 0xEE0000;
- minimapImage.method343();
- for (int i2 = 1; i2 < 103; i2++) {
- for (int j2 = 1; j2 < 103; j2++) {
- if ((byteGroundArray[i][j2][i2] & 0x18) == 0)
- method50(i2, j1, j2, l1, i);
- if (i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
- method50(i2, j1, j2, l1, i + 1);
- }
- }
- aRSImageProducer_1165.initDrawingArea();
- anInt1071 = 0;
- for (int k2 = 0; k2 < 104; k2++) {
- for (int l2 = 0; l2 < 104; l2++) {
- int i3 = worldController.method303(plane, k2, l2);
- if (i3 != 0) {
- i3 = worldController.fetchGroundDecorationNewUID(plane, k2, l2);
- int j3 = ObjectDefinition.forID(i3).anInt746;
- if (j3 >= 0) {
- int k3 = k2;
- int l3 = l2;
- aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
- anIntArray1072[anInt1071] = k3;
- anIntArray1073[anInt1071] = l3;
- anInt1071++;
- }
- }
- }
- }
- }
- private void spawnGroundItem(int i, int j) {
- NodeList class19 = groundArray[plane][i][j];
- if (class19 == null) {
- worldController.method295(plane, i, j);
- return;
- }
- int k = 0xfa0a1f01;
- Object obj = null;
- for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19.reverseGetNext()) {
- ItemDefinition itemDef = ItemDefinition.forID(item.ID);
- int l = itemDef.value;
- if (itemDef.stackable)
- l *= item.itemAmount + 1;
- // notifyItemSpawn(item, i + baseX, j + baseY);
- if (l > k) {
- k = l;
- obj = item;
- }
- }
- class19.insertTail(((Node) (obj)));
- Object obj1 = null;
- Object obj2 = null;
- for (Item class30_sub2_sub4_sub2_1 = (Item) class19
- .reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item) class19
- .reverseGetNext()) {
- if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
- obj1 = class30_sub2_sub4_sub2_1;
- if (class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID
- && obj2 == null)
- obj2 = class30_sub2_sub4_sub2_1;
- }
- int i1 = i + (j << 7) + 0x60000000;
- worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64),
- ((Animable) (obj2)), ((Animable) (obj)), plane, j);
- }
- private void method26(boolean flag) {
- for (int j = 0; j < npcCount; j++) {
- Npc npc = npcArray[npcIndices[j]];
- int k = 0x20000000 + (npcIndices[j] << 14);
- if (npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
- continue;
- int l = npc.x >> 7;
- int i1 = npc.y >> 7;
- if (l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
- continue;
- if (npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64) {
- if (anIntArrayArray929[l][i1] == anInt1265)
- continue;
- anIntArrayArray929[l][i1] = anInt1265;
- }
- if (!npc.desc.aBoolean84)
- k += 0x80000000;
- worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y,
- (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
- }
- }
- public void drawHoverBox(int xPos, int yPos, String text) {
- String[] results = text.split("\n");
- int height = (results.length * 16) + 6;
- int width;
- width = smallText.getTextWidth(results[0]) + 6;
- for (int i = 1; i < results.length; i++)
- if (width <= smallText.getTextWidth(results[i]) + 6)
- width = smallText.getTextWidth(results[i]) + 6;
- DrawingArea.drawPixels(xPos, yPos, width, height, 0xFFFFA0);
- DrawingArea.fillPixels(xPos, width, height, 0, yPos);
- yPos += 14;
- for (int i = 0; i < results.length; i++) {
- smallText.method389(false, xPos + 3, 0, results[i], yPos);
- yPos += 16;
- }
- }
- private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1) {
- if (class9 == null)
- class9 = RSInterface.interfaceCache[0];
- if (class9.type != 0 || class9.children == null || class9.mouseOverTriggered)
- return;
- if (k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
- return;
- int k1 = class9.children.length;
- for (int l1 = 0; l1 < k1; l1++) {
- int i2 = class9.childX[l1] + i;
- int j2 = (class9.childY[l1] + l) - j1;
- RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
- if (class9_1 == null)
- continue;
- i2 += class9_1.anInt263;
- j2 += class9_1.anInt265;
- if (class9_1.type == 8 && k >= i2 && i1 >= j2 && k <= i2 + class9_1.width && i1 <= j2 + class9_1.height) {
- tooltipHoverChildId = class9_1.id;
- tooltipHoverX = i2;
- tooltipHoverY = j2;
- }
- if ((class9_1.hoverType >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width
- && i1 < j2 + class9_1.height)
- if (class9_1.hoverType >= 0)
- anInt886 = class9_1.hoverType;
- else
- anInt886 = class9_1.id;
- if (class9_1.type == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
- anInt1315 = class9_1.id;
- }
- if (class9_1.type == 0) {
- buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
- if (class9_1.scrollMax > class9_1.height)
- method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
- } else {
- if (class9_1.atActionType == 1 && mouseX >= i2 && mouseY >= j2 && mouseX < i2 + class9_1.width
- && mouseY < j2 + class9_1.height) {
- boolean flag = false;
- boolean flag1 = false;
- if (class9_1.contentType != 0)
- flag = buildFriendsListMenu(class9_1);
- if (!flag && !flag1) {
- if (class9_1.actions != null) {
- for (int jj = class9_1.actions.length - 1; jj >= 0; jj--) {
- String s = class9_1.actions[jj];
- if (s != null) {
- menuActionName[menuActionRow] = s;
- menuActionID[menuActionRow] = 222;
- menuActionCmd3[menuActionRow] = class9_1.id;
- currentActionMenu = menuActionRow;
- menuActionRow++;
- }
- }
- }
- String tooltip = class9_1.tooltip;
- if (tooltip != null) {
- menuActionName[menuActionRow] = tooltip;
- menuActionID[menuActionRow] = 315;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- }
- }
- if (class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width
- && i1 < j2 + class9_1.height) {
- String s = class9_1.selectedActionName;
- if (s.indexOf(" ") != -1)
- s = s.substring(0, s.indexOf(" "));
- if (class9_1.spellName.endsWith("Rush") || class9_1.spellName.endsWith("Burst")
- || class9_1.spellName.endsWith("Blitz") || class9_1.spellName.endsWith("Barrage")
- || class9_1.spellName.endsWith("strike") || class9_1.spellName.endsWith("bolt")
- || class9_1.spellName.equals("Crumble undead") || class9_1.spellName.endsWith("blast")
- || class9_1.spellName.endsWith("wave") || class9_1.spellName.equals("Claws of Guthix")
- || class9_1.spellName.equals("Flames of Zamorak")
- || class9_1.spellName.equals("Magic Dart")) {
- /*
- * menuActionName[menuActionRow] = "Autocast @gre@" +
- * class9_1.spellName; menuActionID[menuActionRow] =
- * 104; menuActionCmd3[menuActionRow] = class9_1.id;
- * menuActionRow++;
- */
- }
- menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
- menuActionID[menuActionRow] = 626;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- if (class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width
- && i1 < j2 + class9_1.height) {
- menuActionName[menuActionRow] = "Close";
- menuActionID[menuActionRow] = 200;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- if (class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width
- && i1 < j2 + class9_1.height) {
- // System.out.println("2"+class9_1.tooltip + ", " +
- // class9_1.interfaceID);
- // menuActionName[menuActionRow] = class9_1.tooltip + ", " +
- // class9_1.id;
- menuActionName[menuActionRow] = class9_1.tooltip;
- menuActionID[menuActionRow] = 169;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- if (class9_1.hoverText != null) {
- // drawHoverBox(k, l, class9_1.hoverText);
- // System.out.println("DRAWING INTERFACE: " +
- // class9_1.hoverText);
- }
- }
- if (class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width
- && i1 < j2 + class9_1.height) {
- // System.out.println("3"+class9_1.tooltip + ", " +
- // class9_1.interfaceID);
- // menuActionName[menuActionRow] = class9_1.tooltip + ", " +
- // class9_1.id;
- menuActionName[menuActionRow] = class9_1.tooltip;
- menuActionID[menuActionRow] = 646;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- if (class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width
- && i1 < j2 + class9_1.height) {
- // System.out.println("4"+class9_1.tooltip + ", " +
- // class9_1.interfaceID);
- // menuActionName[menuActionRow] = class9_1.tooltip + ", " +
- // class9_1.id;
- menuActionName[menuActionRow] = class9_1.tooltip;
- menuActionID[menuActionRow] = 679;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- if (class9_1.type == 2) {
- boolean search = class9_1.itemSearch && friendsListAction == -1 && promptInput != null
- && promptInput.length() > 0;
- if (!messagePromptRaised && search)
- search = false;
- boolean clearWhiteSpace = !search && class9_1.invClearWhiteSpace;
- int results = -1;
- int k2 = search ? 0 : class9.invStartIndex;
- int yoffset = 0;
- for (int l2 = 0; l2 < class9_1.height; l2++) {
- if (clearWhiteSpace && class9_1.invClearWhiteSpaceSeperator != null) {
- if (l2 != 0 && l2 != class9_1.height - 1
- && l2 * class9_1.width % class9_1.invWhiteSpaceSeperatorCutoff == 0) {
- for (int i7 = l2 * class9_1.width; i7 < (l2 * class9_1.width) + 100; i7++) {
- if (class9_1.inv[i7] > 0) {
- yoffset += 20;
- break;
- }
- }
- }
- }
- if (clearWhiteSpace) {
- int items = 0;
- for (int l4 = 0; l4 < class9_1.width; l4++) {
- if (k2 >= class9_1.inv.length)
- continue;
- if (class9_1.inv[k2 + l4] > 0) {
- items++;
- }
- }
- if (items == 0) {
- k2 += class9_1.width;
- continue;
- }
- }
- for (int i3 = 0; i3 < class9_1.width; i3++) {
- if (k2 >= class9_1.inv.length)
- continue;
- if (search && class9_1.inv[k2] > 0) {
- ItemDefinition itemdef = ItemDefinition.forID(class9_1.inv[k2] - 1);
- if (itemdef == null || itemdef.name == null) {
- k2++;
- continue;
- }
- if (!itemdef.name.toLowerCase().contains(promptInput.toLowerCase())) {
- k2++;
- continue;
- }
- results++;
- }
- if (clearWhiteSpace) {
- results++;
- }
- int j3 = i2 + (search || clearWhiteSpace ? (results % class9_1.width) : i3)
- * (32 + class9_1.invSpritePadX);
- int k3 = (j2 + (search || clearWhiteSpace ? (results / class9_1.width) : l2)
- * (32 + class9_1.invSpritePadY)) + yoffset;
- if (k2 < 20) {
- j3 += class9_1.spritesX[k2];
- k3 += class9_1.spritesY[k2];
- }
- if (k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32) {
- mouseInvInterfaceIndex = k2;
- lastActiveInvInterface = class9_1.id;
- if (class9_1.inv[k2] > 0) {
- ItemDefinition itemDef = ItemDefinition.forID(class9_1.inv[k2] - 1);
- if (itemSelected == 1 && class9_1.isInventoryInterface) {
- if (class9_1.id != anInt1284 || k2 != anInt1283) {
- menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@"
- + itemDef.name;
- menuActionID[menuActionRow] = 870;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- } else if (spellSelected == 1 && class9_1.isInventoryInterface) {
- if ((spellUsableOn & 0x10) == 16) {
- menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
- menuActionID[menuActionRow] = 543;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- } else {
- if (class9_1.isInventoryInterface) {
- for (int l3 = 4; l3 >= 3; l3--)
- if (itemDef.itemActions != null && itemDef.itemActions[l3] != null) {
- menuActionName[menuActionRow] = itemDef.itemActions[l3] + " @lre@"
- + itemDef.name;
- if (l3 == 3)
- menuActionID[menuActionRow] = 493;
- if (l3 == 4)
- menuActionID[menuActionRow] = 847;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- } else if (l3 == 4) {
- menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
- menuActionID[menuActionRow] = 847;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- }
- if (class9_1.usableItemInterface) {
- menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
- menuActionID[menuActionRow] = 447;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- if (class9_1.isInventoryInterface && itemDef.itemActions != null) {
- for (int i4 = 2; i4 >= 0; i4--)
- if (itemDef.itemActions[i4] != null) {
- menuActionName[menuActionRow] = itemDef.itemActions[i4] + " @lre@"
- + itemDef.name;
- if (i4 == 0)
- menuActionID[menuActionRow] = 74;
- if (i4 == 1)
- menuActionID[menuActionRow] = 454;
- if (i4 == 2)
- menuActionID[menuActionRow] = 539;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- }
- if (class9_1.actions != null) {
- for (int j4 = class9_1.actions.length == 6 ? 5 : 4; j4 >= 0; j4--)
- if (class9_1.actions[j4] != null) {
- menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@"
- + itemDef.name;
- if (j4 == 0)
- menuActionID[menuActionRow] = 632;
- if (j4 == 1)
- menuActionID[menuActionRow] = 78;
- if (j4 == 2)
- menuActionID[menuActionRow] = 867;
- if (j4 == 3)
- menuActionID[menuActionRow] = 431;
- if (j4 == 4)
- menuActionID[menuActionRow] = 53;
- if (j4 == 5)
- menuActionID[menuActionRow] = 54;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- }
- // menuActionName[menuActionRow] =
- // "Examine @lre@" + itemDef.name +
- // " @gre@(@whi@" + (class9_1.inv[k2] -
- // 1) + "@gre@)";
- menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name
- + (clientData ? (", ID: " + itemDef.id) : "");
- menuActionID[menuActionRow] = 1125;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- }
- }
- k2++;
- }
- }
- }
- }
- }
- }
- public void drawScrollbar(int barHeight, int scrollPos, int yPos, int xPos, int contentHeight,
- boolean isTransparent) {
- // if (!isOldScrollbar) {
- /*
- * scrollBar3.method361(i1, l); scrollBar4.method361(i1, (l + j) - 16);
- */
- int backingAmount = (barHeight - 32) / (isTransparent ? 2 : 5);
- int scrollPartHeight = ((barHeight - 32) * barHeight) / contentHeight;
- if (scrollPartHeight < 10)
- scrollPartHeight = 10;
- int scrollPartAmount = (scrollPartHeight / (isTransparent ? 1 : 5)) - 2;
- int scrollPartPos = ((barHeight - 32 - scrollPartHeight) * scrollPos) / (contentHeight - barHeight) + 16 + yPos;
- for (int i = 0, yyPos = yPos + 16; i <= (isTransparent ? backingAmount / 2 + 6
- : backingAmount); i++, yyPos += (isTransparent ? 3 : 5)) {
- if (isTransparent) {
- cacheSprites3[126 + 7].drawAdvancedSprite(xPos, yyPos);
- } else {
- cacheSprites3[133 + 7].drawSprite(xPos, yyPos);
- }
- }
- if (isTransparent) {
- cacheSprites3[127 + 7].drawAdvancedSprite(xPos, scrollPartPos);
- } else
- cacheSprites3[134 + 7].drawSprite(xPos, scrollPartPos); // above
- // part, not
- // it
- scrollPartPos += 5;
- for (int i = 0; i <= (isTransparent ? scrollPartAmount - 9 : scrollPartAmount); i++) {
- if (isTransparent) {
- cacheSprites3[128 + 7].drawAdvancedSprite(xPos, scrollPartPos);
- } else
- cacheSprites3[135 + 7].drawSprite(xPos, scrollPartPos);
- scrollPartPos += isTransparent ? 1 : 5;
- }
- scrollPartPos = ((barHeight - 32 - scrollPartHeight) * scrollPos) / (contentHeight - barHeight) + 16 + yPos
- + (scrollPartHeight - 5);
- if (isTransparent) {
- cacheSprites3[129 + 7].drawAdvancedSprite(xPos, scrollPartPos);
- } else
- cacheSprites3[132 + 7].drawSprite(xPos, scrollPartPos);
- /*
- * if (newScroller) { cacheSprites3[146 + 7].drawSprite(xPos, yPos);
- * cacheSprites3[147 + 7].drawSprite(xPos, (yPos + barHeight) - 16); }
- * else
- */if (isTransparent) {
- cacheSprites3[124 + 7].drawAdvancedSprite(xPos, yPos);
- cacheSprites3[125 + 7].drawAdvancedSprite(xPos, (yPos + barHeight) - 16);
- } else {
- cacheSprites3[144 + 7].drawSprite(xPos, yPos);
- cacheSprites3[145 + 7].drawSprite(xPos, (yPos + barHeight) - 16);
- }
- /*
- * } else { scrollBar1.method361(xPos, yPos); scrollBar2.method361(xPos,
- * (yPos + barHeight) - 16);
- *
- * DrawingArea.drawPixels(xPos, yPos + 16, 16, barHeight - 32,
- * anInt1002); int k1 = ((barHeight - 32) * barHeight) / contentHeight;
- * if(k1 < 8) k1 = 8; int l1 = ((barHeight - 32 - k1) * scrollPos) /
- * (contentHeight - barHeight); DrawingArea.drawPixels(xPos, yPos + 16 +
- * l1, 16, k1, anInt1063); DrawingArea.method341(yPos + 16 + l1,
- * anInt902, k1, xPos); DrawingArea.method341(yPos + 16 + l1, anInt902,
- * k1, xPos + 1); DrawingArea.drawLine(yPos + 16 + l1, anInt902, 16,
- * xPos); DrawingArea.drawLine(yPos + 17 + l1, anInt902, 16, xPos);
- * DrawingArea.method341(yPos + 16 + l1, anInt927, k1, xPos + 15);
- * DrawingArea.method341(yPos + 17 + l1, anInt927, k1 - 1, xPos + 14);
- * DrawingArea.drawLine(yPos + 15 + l1 + k1, anInt927, 16, xPos);
- * DrawingArea.drawLine(yPos + 14 + l1 + k1, anInt927, 15, xPos + 1); }
- */
- }
- private void updateNPCs(RSBuffer stream, int i) {
- anInt839 = 0;
- anInt893 = 0;
- method139(stream);
- method46(i, stream);
- method86(stream);
- for (int k = 0; k < anInt839; k++) {
- int l = anIntArray840[k];
- if (npcArray[l].anInt1537 != loopCycle) {
- npcArray[l].desc = null;
- npcArray[l] = null;
- }
- }
- if (stream.currentOffset != i) {
- Signlink.reporterror(
- myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
- throw new RuntimeException("eek");
- }
- for (int i1 = 0; i1 < npcCount; i1++)
- if (npcArray[npcIndices[i1]] == null) {
- Signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
- throw new RuntimeException("eek");
- }
- }
- private void method33(int i) {
- try {
- if (i >= Varp.cache.length)
- return;
- int j = Varp.cache[i].anInt709;
- if (j == 0)
- return;
- int k = variousSettings[i];
- if (j == 1) {
- if (k == 1)
- Texture.method372(0.90000000000000002D);
- if (k == 2)
- Texture.method372(0.80000000000000004D);
- if (k == 3)
- Texture.method372(0.69999999999999996D);
- if (k == 4)
- Texture.method372(0.59999999999999998D);
- ItemDefinition.mruNodes1.unlinkAll();
- welcomeScreenRaised = true;
- }
- if (j == 3) {
- boolean flag1 = musicEnabled;
- if (k == 0) {
- setMidiVolume(192);
- musicEnabled = true;
- }
- if (k == 1) {
- setMidiVolume(128);
- musicEnabled = true;
- }
- if (k == 2) {
- setMidiVolume(64);
- musicEnabled = true;
- }
- if (k == 3) {
- setMidiVolume(32);
- musicEnabled = true;
- }
- if (k == 4)
- musicEnabled = false;
- if (musicEnabled != flag1 && !lowMem) {
- if (musicEnabled) {
- nextSong = currentSong;
- // songChanging = true;
- onDemandFetcher.method558(2, nextSong);
- } else {
- stopMidi();
- }
- prevSong = 0;
- }
- }
- if (j == 4) {
- if (k == 0) {
- aBoolean848 = true;
- setWaveVolume(0);
- }
- if (k == 1) {
- aBoolean848 = true;
- setWaveVolume(-400);
- }
- if (k == 2) {
- aBoolean848 = true;
- setWaveVolume(-800);
- }
- if (k == 3) {
- aBoolean848 = true;
- setWaveVolume(-1200);
- }
- if (k == 4)
- aBoolean848 = false;
- }
- if (j == 5)
- anInt1253 = k;
- if (j == 6)
- anInt1249 = k;
- if (j == 8) {
- splitPrivateChat = k;
- inputTaken = true;
- }
- if (j == 9)
- anInt913 = k;
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public StreamLoader mediaStreamLoader;
- public void updateEntities() {
- try {
- int anInt974 = 0;
- for (int j = -1; j < playerCount + npcCount; j++) {
- Object obj;
- if (j == -1)
- obj = myPlayer;
- else if (j < playerCount)
- obj = playerArray[playerIndices[j]];
- else
- obj = npcArray[npcIndices[j - playerCount]];
- if (obj == null || !((Entity) (obj)).isVisible())
- continue;
- if (obj instanceof Npc) {
- NpcDefinition entityDef = ((Npc) obj).desc;
- if (entityDef.childrenIDs != null)
- entityDef = entityDef.method161();
- if (entityDef == null)
- continue;
- }
- if (j < playerCount) {
- int l = 30;
- Player player = (Player) obj;
- if (player.headIcon >= 0) {
- npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
- if (spriteDrawX > -1) {
- if (player.skulled) {
- // l += 2;
- skullIcons[0].drawSprite(spriteDrawX - 12, spriteDrawY - l);
- l += 26;
- }
- if (player.bountyHunterIcon >= 0 && player.bountyHunterIcon <= 4) {
- cacheSprites[674 + player.bountyHunterIcon]
- .drawSprite(spriteDrawX - (player.skulled ? 8 : 10), spriteDrawY - l);
- l += 28;
- }
- if (player.headIcon < 18) {
- headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
- l += 18;
- }
- }
- }
- if (j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
- npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
- if (spriteDrawX > -1)
- headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
- }
- if (ClientSettings.getBoolean("names_above_head")) {
- npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
- int color = Integer.MAX_VALUE;
- if (myPlayer.bloodlustName.equalsIgnoreCase(player.bloodlustName)) {
- color = 0x00ff00;
- } else {
- color = 0x2080ff;
- }
- if (player.bloodlustName.isEmpty()) {
- color = Integer.MAX_VALUE;
- }
- if (player.playerRights == 14) {
- color = 0xCC0000;
- }
- String bloodlustRender = player.bloodlustName == null ? "" : player.bloodlustName;
- newBoldFont.drawCenteredString(player.name, spriteDrawX, spriteDrawY - l + 8, color, 0);
- newBoldFont.drawCenteredString("\\<" + bloodlustRender + "\\>", spriteDrawX, spriteDrawY - l + 21, color, 0);
- l += 3;
- }
- } else {
- NpcDefinition entityDef_1 = ((Npc) obj).desc;
- if (entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
- npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
- if (spriteDrawX > -1) {
- if (entityDef_1.anInt75 == 19) // Soul-Split hard
- // code
- entityDef_1.anInt75 = 17;
- if (headIcons[entityDef_1.anInt75] == null) {
- System.err.println("Null headicon: " + entityDef_1.anInt75);
- } else {
- headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
- }
- }
- }
- if (anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
- npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
- if (spriteDrawX > -1)
- headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
- }
- }
- if (((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0
- || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player) obj).name))) {
- npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
- if (spriteDrawX > -1 && anInt974 < anInt975) {
- anIntArray979[anInt974] = boldText.method384(((Entity) (obj)).textSpoken) / 2;
- anIntArray978[anInt974] = boldText.anInt1497;
- anIntArray976[anInt974] = spriteDrawX;
- anIntArray977[anInt974] = spriteDrawY;
- anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
- anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
- anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
- aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
- if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3) {
- anIntArray978[anInt974] += 10;
- anIntArray977[anInt974] += 5;
- }
- if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
- anIntArray979[anInt974] = 60;
- if (anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
- anIntArray978[anInt974] += 5;
- }
- }
- if (((Entity) (obj)).loopCycleStatus > loopCycle) {
- try {
- npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
- if (spriteDrawX > -1) {
- Entity entity = (Entity) obj;
- int hitpoints = entity.maxHealth;
- boolean bigBar = entity instanceof Npc && hitpoints > 990;
- int length = 30;
- if (bigBar) {
- length += hitpoints / 60;
- }
- if (length > 120)
- length = 120;
- int i1 = (((Entity) (obj)).currentHealth * length) / ((Entity) (obj)).maxHealth;
- int hpPercent = (((Entity) (obj)).currentHealth * 56) / ((Entity) (obj)).maxHealth;
- if (hpPercent > 56) {
- hpPercent = 56;
- }
- if (i1 > length) {
- i1 = length;
- }
- if (i1 < 0) {
- i1 = 0;
- }
- if (ClientSettings.getBoolean("hp_above_head")) {
- newBoldFont.drawCenteredString(
- (entity.currentHealth / 10) + "/" + (entity.maxHealth / 10), spriteDrawX,
- spriteDrawY - 35, 0xff0000, 0);
- }
- if (!ClientSettings.getBoolean("new_hitbar")) {
- // DrawingArea.drawPixels(spriteDrawX - 15, spriteDrawY - 3, i1, 5, 65280);
- // DrawingArea.drawPixels((spriteDrawX - 15) + i1, spriteDrawY - 3, 30 - i1, 5, 0xff0000);
- DrawingArea.drawPixels((spriteDrawX) - (length / 2), spriteDrawY - 3, i1, 5, 65280);
- DrawingArea.drawPixels((spriteDrawX - length / 2) + i1, spriteDrawY - 3, length - i1, 5, 0xff0000);
- } else {
- /*
- * i1 = (((Entity) (obj)).currentHealth * 30) /
- * ((Entity) (obj)).maxHealth;
- *
- * //if (i1 > 30) //i1 = 30;
- *
- * int barWidth = 56; int percent = (((Entity)
- * (obj)).currentHealth * barWidth) / ((Entity)
- * (obj)).maxHealth; if(percent > barWidth)
- * percent = barWidth; //if (percent < 0)
- * //percent = 0;
- *
- *
- * cacheSprites3[173].drawSprite(spriteDrawX -
- * 28, spriteDrawY - 5);
- * cacheSprites3[172].copy().getSubImage(
- * cacheSprites3[172], 0, 0, percent,
- * 7).drawSprite(spriteDrawX - 28, spriteDrawY -
- * 5);
- */
- i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
- if (i1 > 30)
- i1 = 30;
- int barWidth = 56;
- int percent = (((Entity) (obj)).currentHealth * barWidth) / ((Entity) (obj)).maxHealth;
- if (percent > barWidth)
- percent = barWidth;
- cacheSprites3[173].drawSprite(spriteDrawX - 28, spriteDrawY - 5);
- cacheSprites3[172].getSubImage(cacheSprites3[172].copy(), 0, 0, percent, 7)
- .drawSprite(spriteDrawX - 28, spriteDrawY - 5);
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- for (int j1 = 0; j1 < 4; j1++) {
- if (((Entity) (obj)).hitsLoopCycle[j1] > loopCycle) {
- npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
- if (spriteDrawX > -1) {
- if (ClientSettings.getInt("hitmarks") == 602) {
- if (j1 == 1)
- spriteDrawY += 20;
- if (j1 == 2) {
- spriteDrawY += 40;
- }
- if (j1 == 3) {
- spriteDrawY += 60;
- }
- } else {
- if (j1 == 1)
- spriteDrawY -= 20;
- if (j1 == 2) {
- spriteDrawX -= 15;
- spriteDrawY -= 10;
- }
- if (j1 == 3) {
- spriteDrawX += 15;
- spriteDrawY -= 10;
- }
- }
- /**
- * Draw hitmark
- */
- int hitMarkType = ((Entity) (obj)).hitMarkTypes[j1];
- int hit = ((Entity) (obj)).hitArray[j1];
- if (!ClientSettings.getBoolean("constitution")) {
- hit = (int) Math.ceil(((double) hit) / 10d);
- }
- Sprite hitmark = hitMarks[hitMarkType];
- if (hitMarkType == 0 || hitMarkType == 1
- || hitMarkType == 2 && ClientSettings.getInt("hitmarks") == 602) {
- /**
- * Hit/block
- */
- if (ClientSettings.getInt("hitmarks") == 562) {
- /**
- * 562
- */
- if (hitMarkType == 0) {
- cacheSprites3[165].drawAdvancedSprite(spriteDrawX - 9, spriteDrawY - 12);
- } else {
- if (hit >= 100) {
- cacheSprites3[167].drawAdvancedSprite(spriteDrawX - 18, spriteDrawY - 13);
- } else {
- cacheSprites3[166].drawAdvancedSprite(spriteDrawX - 12, spriteDrawY - 12);
- }
- }
- } else if (ClientSettings.getInt("hitmarks") == 602) {
- int opacity = 256 - ((Entity) (obj)).hitsOpacityCycle[j1];
- int icon = ((Entity) (obj)).hitsIcon[j1];
- int offset = ((Entity) (obj)).hitsOpacityCycle[j1] / 3;
- if (offset > 28)
- offset = 28;
- if (hitMarkType == 0) {
- spriteDrawY -= 10;
- cacheSprites3[168].drawTransparentSprite(spriteDrawX - 12,
- spriteDrawY - 12 - offset, opacity);
- } else if (hitMarkType == 2) {
- int hitSprite = hit <= 9 ? 470 : hit <= 99 ? 471 : 472;
- cacheSprites3[hitSprite].drawTransparentSprite(
- spriteDrawX - (cacheSprites3[hitSprite].myWidth / 2),
- spriteDrawY - 16 - offset, opacity);
- } else {
- int hitSprite = hit <= 9 ? 169 : hit <= 99 ? 170 : 171;
- cacheSprites3[hitSprite].drawTransparentSprite(
- spriteDrawX - (cacheSprites3[hitSprite].myWidth / 2),
- spriteDrawY - 16 - offset, opacity);
- int sprite = icon == 0 ? 69 : icon == 1 ? 70 : icon == 2 ? 71 : -1;
- if (sprite != -1) {
- cacheSprites[sprite].drawTransparentSprite(
- spriteDrawX - (cacheSprites3[hitSprite].myWidth / 2)
- - cacheSprites[sprite].myWidth - 2,
- spriteDrawY - 16 - offset - 2, opacity);
- }
- }
- ((Entity) (obj)).hitsOpacityCycle[j1] += 2;
- if (((Entity) (obj)).hitsOpacityCycle[j1] > 256) {
- ((Entity) (obj)).hitsOpacityCycle[j1] = 256;
- }
- } else {
- /**
- * 317
- */
- hitMarks[hitMarkType].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
- }
- } else {
- /**
- * Other hitmarks
- */
- hitMarks[hitMarkType].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
- }
- if (!(ClientSettings.getInt("hitmarks") == 602 && hitMarkType == 0)) {
- if (!(ClientSettings.getInt("hitmarks") == 562
- || ClientSettings.getInt("hitmarks") == 602)
- || (ClientSettings.getInt("hitmarks") == 562
- || ClientSettings.getInt("hitmarks") == 602)) {
- if (ClientSettings.getInt("hitmarks") == 602) {
- int opacity = 256 - ((Entity) (obj)).hitsOpacityCycle[j1];
- int offset = ((Entity) (obj)).hitsOpacityCycle[j1] / 3;
- if (offset > 28)
- offset = 28;
- if (opacity < 0) {
- opacity = 0;
- }
- int xOffset = -8;
- if (hit > 99) {
- xOffset = -8;
- } else if (hit > 9) {
- xOffset = -8;
- }
- newSmallFont.drawCenteredString("<trans=" + opacity + ">" + String.valueOf(hit),
- spriteDrawX + xOffset + 8, spriteDrawY + 4 + -6 - offset, 0xffffff, 0);
- /*
- * newSmallFont .drawText( 0, "<trans="
- * + opacity + ">" +
- * String.valueOf(((Entity)
- * (obj)).hitArray[j1]), spriteDrawY + 4
- * + (Configuration.hitMarkType ==
- * HitMarkType.TYPE_602 ? -6 : 0),
- * spriteDrawX +
- * (Configuration.hitMarkType ==
- * HitMarkType.TYPE_602 ? 9 : 0));
- *
- * smallFont .drawText( 0xffffff,
- * "<trans=" + opacity + ">" +
- * String.valueOf(((Entity)
- * (obj)).hitArray[j1]), spriteDrawY + 3
- * + (Configuration.hitMarkType ==
- * HitMarkType.TYPE_602 ? -6 : 0),
- * spriteDrawX - 1 +
- * (Configuration.hitMarkType ==
- * HitMarkType.TYPE_602 ? 9 : 0));
- */
- } else if (ClientSettings.getInt("hitmarks") == 562) {
- newSmallFont.drawCenteredString(String.valueOf(hit), spriteDrawX - 1,
- spriteDrawY + 4, 0xffffff, 0);
- // aTextDrawingArea_1270.drawText(0,
- // String.valueOf(((Entity)
- // (obj)).hitArray[j1]), spriteDrawY +
- // 4, spriteDrawX);
- // aTextDrawingArea_1270.drawText(0xffffff,
- // String.valueOf(((Entity)
- // (obj)).hitArray[j1]), spriteDrawY +
- // 3, spriteDrawX - 1);
- } else {
- newSmallFont.drawCenteredString(String.valueOf(hit), spriteDrawX - 1,
- spriteDrawY + 4, 0xffffff, 0);
- // aTextDrawingArea_1270.drawText(0,
- // String.valueOf(((Entity)
- // (obj)).hitArray[j1]), spriteDrawY +
- // 4, spriteDrawX);
- // aTextDrawingArea_1270.drawText(0xffffff,
- // String.valueOf(((Entity)
- // (obj)).hitArray[j1]), spriteDrawY +
- // 3, spriteDrawX - 1);
- }
- } else {
- newSmallFont.drawCenteredString(String.valueOf(hit), spriteDrawX - 1,
- spriteDrawY + 4, 0xffffff, 0);
- // aTextDrawingArea_1270.drawText(0,
- // String.valueOf(((Entity)
- // (obj)).hitArray[j1]), spriteDrawY + 4,
- // spriteDrawX);
- // aTextDrawingArea_1270.drawText(0xffffff,
- // String.valueOf(((Entity)
- // (obj)).hitArray[j1]), spriteDrawY + 3,
- // spriteDrawX - 1);
- }
- }
- /*
- * hitMarks[((Entity)
- * (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX -
- * 12, spriteDrawY - 12);
- * aTextDrawingArea_1270.drawText(0,
- * String.valueOf(((Entity) (obj)).hitArray[j1]),
- * spriteDrawY + 4, spriteDrawX);
- * aTextDrawingArea_1270.drawText(0xffffff,
- * String.valueOf(((Entity) (obj)).hitArray[j1]),
- * spriteDrawY + 3, spriteDrawX - 1);
- */
- }
- /*
- * hitMarks[((Entity)
- * (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12,
- * spriteDrawY - 12); smallText.drawText(0,
- * String.valueOf(((Entity) (obj)).hitArray[j1]),
- * spriteDrawY + 4, spriteDrawX);
- * smallText.drawText(0xffffff, String.valueOf(((Entity)
- * (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX -
- * 1);
- */
- }
- }
- }
- for (int k = 0; k < anInt974; k++) {
- int k1 = anIntArray976[k];
- int l1 = anIntArray977[k];
- int j2 = anIntArray979[k];
- int k2 = anIntArray978[k];
- boolean flag = true;
- while (flag) {
- flag = false;
- for (int l2 = 0; l2 < k; l2++)
- if (l1 + 2 > anIntArray977[l2] - anIntArray978[l2] && l1 - k2 < anIntArray977[l2] + 2
- && k1 - j2 < anIntArray976[l2] + anIntArray979[l2]
- && k1 + j2 > anIntArray976[l2] - anIntArray979[l2]
- && anIntArray977[l2] - anIntArray978[l2] < l1) {
- l1 = anIntArray977[l2] - anIntArray978[l2];
- flag = true;
- }
- }
- spriteDrawX = anIntArray976[k];
- spriteDrawY = anIntArray977[k] = l1;
- String s = aStringArray983[k];
- if (anInt1249 == 0) {
- int i3 = 0xffff00;
- if (anIntArray980[k] < 6)
- i3 = anIntArray965[anIntArray980[k]];
- if (anIntArray980[k] == 6)
- i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
- if (anIntArray980[k] == 7)
- i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
- if (anIntArray980[k] == 8)
- i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
- if (anIntArray980[k] == 9) {
- int j3 = 150 - anIntArray982[k];
- if (j3 < 50)
- i3 = 0xff0000 + 1280 * j3;
- else if (j3 < 100)
- i3 = 0xffff00 - 0x50000 * (j3 - 50);
- else if (j3 < 150)
- i3 = 65280 + 5 * (j3 - 100);
- }
- if (anIntArray980[k] == 10) {
- int k3 = 150 - anIntArray982[k];
- if (k3 < 50)
- i3 = 0xff0000 + 5 * k3;
- else if (k3 < 100)
- i3 = 0xff00ff - 0x50000 * (k3 - 50);
- else if (k3 < 150)
- i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
- }
- if (anIntArray980[k] == 11) {
- int l3 = 150 - anIntArray982[k];
- if (l3 < 50)
- i3 = 0xffffff - 0x50005 * l3;
- else if (l3 < 100)
- i3 = 65280 + 0x50005 * (l3 - 50);
- else if (l3 < 150)
- i3 = 0xffffff - 0x50000 * (l3 - 100);
- }
- if (anIntArray981[k] == 0) {
- boldText.drawText(0, s, spriteDrawY + 1, spriteDrawX);
- boldText.drawText(i3, s, spriteDrawY, spriteDrawX);
- }
- if (anIntArray981[k] == 1) {
- boldText.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
- boldText.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
- }
- if (anIntArray981[k] == 2) {
- boldText.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
- boldText.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
- }
- if (anIntArray981[k] == 3) {
- boldText.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
- boldText.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
- }
- if (anIntArray981[k] == 4) {
- int i4 = boldText.method384(s);
- int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
- DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
- boldText.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
- boldText.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
- DrawingArea.defaultDrawingAreaSize();
- }
- if (anIntArray981[k] == 5) {
- int j4 = 150 - anIntArray982[k];
- int l4 = 0;
- if (j4 < 25)
- l4 = j4 - 25;
- else if (j4 > 125)
- l4 = j4 - 125;
- DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - boldText.anInt1497 - 1);
- boldText.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
- boldText.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
- DrawingArea.defaultDrawingAreaSize();
- }
- } else {
- boldText.drawText(0, s, spriteDrawY + 1, spriteDrawX);
- boldText.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- private void delFriend(long l) {
- try {
- if (l == 0L)
- return;
- for (int i = 0; i < friendsCount; i++) {
- if (friendsListAsLongs[i] != l)
- continue;
- friendsCount--;
- for (int j = i; j < friendsCount; j++) {
- friendsList[j] = friendsList[j + 1];
- friendsNodeIDs[j] = friendsNodeIDs[j + 1];
- friendsListAsLongs[j] = friendsListAsLongs[j + 1];
- }
- stream.createFrame(215);
- stream.writeQWord(l);
- break;
- }
- } catch (RuntimeException runtimeexception) {
- Signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
- throw new RuntimeException();
- }
- }
- private final int[] sideIconsX = { 17, 49, 83, 114, 146, 180, 214, 16, 49, 82, 116, 148, 184, 216 },
- sideIconsY = { 9, 7, 7, 5, 2, 3, 7, 303, 306, 306, 302, 305, 303, 303, 303 },
- sideIconsId = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 },
- sideIconsTab = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 };
- public void drawSideIcons() {
- int xOffset = frameMode == ScreenMode.FIXED ? 0 : frameWidth - 247;
- int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 336;
- if (frameMode == ScreenMode.FIXED || frameMode != ScreenMode.FIXED && !changeTabArea) {
- for (int i = 0; i < sideIconsTab.length; i++) {
- if (tabInterfaceIDs[sideIconsTab[i]] != -1) {
- if (sideIconsId[i] != -1) {
- sideIcons[sideIconsId[i]].drawSprite(sideIconsX[i] + xOffset, sideIconsY[i] + yOffset);
- }
- }
- }
- } else if (changeTabArea && frameWidth < 1000) {
- int[] iconId = { 0, 1, 2, 3, 4, 5, 6, -1, 8, 9, 7, 11, 12, 13 };
- int[] iconX = { 219, 189, 156, 126, 93, 62, 30, 219, 189, 156, 124, 92, 59, 28 };
- int[] iconY = { 67, 69, 67, 69, 72, 72, 69, 32, 29, 29, 32, 30, 33, 31, 32 };
- for (int i = 0; i < sideIconsTab.length; i++) {
- if (tabInterfaceIDs[sideIconsTab[i]] != -1) {
- if (iconId[i] != -1) {
- sideIcons[iconId[i]].drawSprite(frameWidth - iconX[i], frameHeight - iconY[i]);
- }
- }
- }
- } else if (changeTabArea && frameWidth >= 1000) {
- int[] iconId = { 0, 1, 2, 3, 4, 5, 6, -1, 8, 9, 7, 11, 12, 13 };
- int[] iconX = { 50, 80, 114, 143, 176, 208, 240, 242, 273, 306, 338, 370, 404, 433 };
- int[] iconY = { 30, 32, 30, 32, 34, 34, 32, 32, 29, 29, 32, 31, 32, 32, 32 };
- for (int i = 0; i < sideIconsTab.length; i++) {
- if (tabInterfaceIDs[sideIconsTab[i]] != -1) {
- if (iconId[i] != -1) {
- sideIcons[iconId[i]].drawSprite(frameWidth - 461 + iconX[i], frameHeight - iconY[i]);
- }
- }
- }
- }
- }
- private void method37(int j) {
- if (!lowMem) {
- if (Texture.anIntArray1480[17] >= j) {
- Background background = Texture.aBackgroundArray1474s[17];
- int k = background.anInt1452 * background.anInt1453 - 1;
- int j1 = background.anInt1452 * anInt945 * 2;
- byte abyte0[] = background.aByteArray1450;
- byte abyte3[] = aByteArray912;
- for (int i2 = 0; i2 <= k; i2++)
- abyte3[i2] = abyte0[i2 - j1 & k];
- background.aByteArray1450 = abyte3;
- aByteArray912 = abyte0;
- Texture.method370(17);
- anInt854++;
- if (anInt854 > 1235) {
- anInt854 = 0;
- /*
- * stream.createFrame(226); stream.writeWordBigEndian(0);
- * int l2 = stream.currentOffset; stream.writeWord(58722);
- * stream.writeWordBigEndian(240); stream.writeWord((int)
- * (Math.random() * 65536D));
- * stream.writeWordBigEndian((int) (Math.random() * 256D));
- * if ((int) (Math.random() * 2D) == 0)
- * stream.writeWord(51825); stream.writeWordBigEndian((int)
- * (Math.random() * 256D)); stream.writeWord((int)
- * (Math.random() * 65536D)); stream.writeWord(7130);
- * stream.writeWord((int) (Math.random() * 65536D));
- * stream.writeWord(61657);
- * stream.writeBytes(stream.currentOffset - l2);
- */
- }
- }
- if (Texture.anIntArray1480[24] >= j) {
- Background background_1 = Texture.aBackgroundArray1474s[24];
- int l = background_1.anInt1452 * background_1.anInt1453 - 1;
- int k1 = background_1.anInt1452 * anInt945 * 2;
- byte abyte1[] = background_1.aByteArray1450;
- byte abyte4[] = aByteArray912;
- for (int j2 = 0; j2 <= l; j2++)
- abyte4[j2] = abyte1[j2 - k1 & l];
- background_1.aByteArray1450 = abyte4;
- aByteArray912 = abyte1;
- Texture.method370(24);
- }
- if (Texture.anIntArray1480[34] >= j) {
- Background background_2 = Texture.aBackgroundArray1474s[34];
- int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
- int l1 = background_2.anInt1452 * anInt945 * 2;
- byte abyte2[] = background_2.aByteArray1450;
- byte abyte5[] = aByteArray912;
- for (int k2 = 0; k2 <= i1; k2++)
- abyte5[k2] = abyte2[k2 - l1 & i1];
- background_2.aByteArray1450 = abyte5;
- aByteArray912 = abyte2;
- Texture.method370(34);
- }
- if (Texture.anIntArray1480[40] >= j) {
- Background background_2 = Texture.aBackgroundArray1474s[40];
- int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
- int l1 = background_2.anInt1452 * anInt945 * 2;
- byte abyte2[] = background_2.aByteArray1450;
- byte abyte5[] = aByteArray912;
- for (int k2 = 0; k2 <= i1; k2++)
- abyte5[k2] = abyte2[k2 - l1 & i1];
- background_2.aByteArray1450 = abyte5;
- aByteArray912 = abyte2;
- Texture.method370(40);
- }
- }
- }
- private void method38() {
- for (int i = -1; i < playerCount; i++) {
- int j;
- if (i == -1)
- j = myPlayerIndex;
- else
- j = playerIndices[i];
- Player player = playerArray[j];
- if (player != null && player.textCycle > 0) {
- player.textCycle--;
- if (player.textCycle == 0)
- player.textSpoken = null;
- }
- }
- for (int k = 0; k < npcCount; k++) {
- int l = npcIndices[k];
- Npc npc = npcArray[l];
- if (npc != null && npc.textCycle > 0) {
- npc.textCycle--;
- if (npc.textCycle == 0)
- npc.textSpoken = null;
- }
- }
- }
- private void calcCameraPos() {
- int i = anInt1098 * 128 + 64;
- int j = anInt1099 * 128 + 64;
- int k = method42(plane, j, i) - anInt1100;
- if (xCameraPos < i) {
- xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
- if (xCameraPos > i)
- xCameraPos = i;
- }
- if (xCameraPos > i) {
- xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
- if (xCameraPos < i)
- xCameraPos = i;
- }
- if (zCameraPos < k) {
- zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
- if (zCameraPos > k)
- zCameraPos = k;
- }
- if (zCameraPos > k) {
- zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
- if (zCameraPos < k)
- zCameraPos = k;
- }
- if (yCameraPos < j) {
- yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
- if (yCameraPos > j)
- yCameraPos = j;
- }
- if (yCameraPos > j) {
- yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
- if (yCameraPos < j)
- yCameraPos = j;
- }
- i = anInt995 * 128 + 64;
- j = anInt996 * 128 + 64;
- k = method42(plane, j, i) - anInt997;
- int l = i - xCameraPos;
- int i1 = k - zCameraPos;
- int j1 = j - yCameraPos;
- int k1 = (int) Math.sqrt(l * l + j1 * j1);
- int l1 = (int) (Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
- int i2 = (int) (Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
- if (l1 < 128)
- l1 = 128;
- if (l1 > 383)
- l1 = 383;
- if (yCameraCurve < l1) {
- yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
- if (yCameraCurve > l1)
- yCameraCurve = l1;
- }
- if (yCameraCurve > l1) {
- yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
- if (yCameraCurve < l1)
- yCameraCurve = l1;
- }
- int j2 = i2 - xCameraCurve;
- if (j2 > 1024)
- j2 -= 2048;
- if (j2 < -1024)
- j2 += 2048;
- if (j2 > 0) {
- xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
- xCameraCurve &= 0x7ff;
- }
- if (j2 < 0) {
- xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
- xCameraCurve &= 0x7ff;
- }
- int k2 = i2 - xCameraCurve;
- if (k2 > 1024)
- k2 -= 2048;
- if (k2 < -1024)
- k2 += 2048;
- if (k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
- xCameraCurve = i2;
- }
- public void drawSceneHover(int xOffset, int yOffset) {
- if (frameMode != ScreenMode.FIXED) {
- xOffset = yOffset = 0;
- }
- if (ClientSettings.getBoolean("menu_scene_hovers")) {
- if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0) {
- if (!ClientSettings.getBoolean("clear_scene_hover")) {
- ClientSettings.set("clear_scene_hover", true);
- inputTaken = true;
- tabAreaAltered = true;
- }
- return;
- }
- String s;
- if (itemSelected == 1 && menuActionRow < 2)
- s = "Use " + selectedItemName + " with...";
- else if (spellSelected == 1 && menuActionRow < 2)
- s = spellTooltip + "...";
- else
- s = menuActionName[menuActionRow - 1];
- // if(menuActionRow > 2)
- // s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
- if (!s.contains("Walk here")) {
- inputTaken = true;
- tabAreaAltered = true;
- int textWidth = smallText.getTextWidth("@whi@" + s) + 4;
- int x = mouseX - 2 + 16 - xOffset;
- int y = mouseY - 12 + 24 - yOffset;
- int x2 = mouseX + 16 - xOffset;
- int y2 = mouseY + 24 - yOffset;
- if (x + textWidth + 1 + xOffset > frameWidth) {
- int difference = x + textWidth + 1 + xOffset - frameWidth;
- x -= difference;
- x2 -= difference;
- }
- // Draw background
- DrawingArea.drawTransparentPixels(x, y, textWidth, 16, 0, 200);
- // Draw Border
- DrawingArea.drawPixels(textWidth + 1, y - 1, 0, x, 1);
- // DrawingArea.drawPixels(1, mouseY - 12 + 24 - yOffset, mouseX
- // - 2 + 16 - xOffset - 1, 0, textWidth + 7 - 4);
- DrawingArea.drawPixels(textWidth, y + 16, 0, x, 1);
- // DrawingArea.drawPixels(1, mouseY - 12 + 24 - yOffset + 16 +
- // 1, mouseX - 2 + 16 - xOffset, 0, textWidth);
- DrawingArea.drawPixels(1, y, 0, x, 17);
- // DrawingArea.drawPixels(18, mouseY - 12 + 24 - yOffset, mouseX
- // - 2 + 16 - xOffset - 1, 0, 1);
- DrawingArea.drawPixels(1, y, 0, x + textWidth, 17);
- // DrawingArea.drawPixels(18, mouseY - 12 + 24 - yOffset, mouseX
- // - 2 + 16 - xOffset + textWidth + 1, 0, 1);
- RSFont font = newSmallFont;
- font.drawBasicString("@whi@" + s, x2, y2, 0xFFFFFFFF, 0);
- // aTextDrawingArea_1270.method389(true, x2, 0, "@whi@" + s,
- // y2);
- if (ClientSettings.getBoolean("clear_scene_hover")) {
- ClientSettings.set("clear_scene_hover", false);
- }
- } else {
- if (!ClientSettings.getBoolean("clear_scene_hover")) {
- ClientSettings.set("clear_scene_hover", true);
- inputTaken = true;
- tabAreaAltered = true;
- }
- }
- }
- }
- public void drawMenu(int xOffset, int yOffset) {
- if (frameMode != ScreenMode.FIXED) {
- xOffset = yOffset = 0;
- }
- inputTaken = true;
- tabAreaAltered = true;
- int i = menuOffsetX - (xOffset - 4);
- int j = (-yOffset + 4) + menuOffsetY;
- int k = menuWidth;
- int l = menuHeight + 1;
- if (ClientSettings.getInt("menu") == 562) {
- RSFont font = newBoldFont;
- DrawingArea.drawPixels(i, j + 2, k, l - 4, 0x706a5e);
- DrawingArea.drawPixels(i + 1, j + 1, k - 2, l - 2, 0x706a5e);
- DrawingArea.drawPixels(i + 2, j, k - 4, l, 0x706a5e);
- DrawingArea.drawPixels(i + 3, j + 1, k - 6, l - 2, 0x2d2822);
- DrawingArea.drawPixels(i + 2, j + 2, k - 4, l - 4, 0x2d2822);
- DrawingArea.drawPixels(i + 1, j + 3, k - 2, l - 6, 0x2d2822);
- DrawingArea.drawPixels(i + 2, j + 19, k - 4, l - 22, 0x524a3d);
- DrawingArea.drawPixels(i + 3, j + 20, k - 6, l - 22, 0x524a3d);
- DrawingArea.drawPixels(i + 3, j + 20, k - 6, l - 23, 0x2b271c);
- DrawingArea.fillPixels(i + 3, k - 6, 1, 0x2a291b, j + 2);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x2a261b, j + 3);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x252116, j + 4);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x211e15, j + 5);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x1e1b12, j + 6);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x1a170e, j + 7);
- DrawingArea.fillPixels(i + 2, k - 4, 2, 0x15120b, j + 8);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x100d08, j + 10);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 11);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x080703, j + 12);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 13);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x070802, j + 14);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 15);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x070802, j + 16);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 17);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x2a291b, j + 18);
- DrawingArea.fillPixels(i + 3, k - 6, 1, 0x564943, j + 19);
- font.drawBasicString("Choose Option", i + 3, j + 14, 0xc6b895, -1);
- // chatTextDrawingArea.method385(0xc6b895, "Choose Option", j + 14,
- // i + 3);
- int j1 = super.mouseX - xOffset;
- int k1 = -yOffset + super.mouseY;
- for (int l1 = 0; l1 < menuActionRow; l1++) {
- int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
- int j2 = 0xc6b895;
- if (j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3) {
- DrawingArea.drawPixels(i + 3, i2 - 11, menuWidth - 6, 15, 0x6f695d);
- j2 = 0xeee5c6;
- currentActionMenu = l1;
- }
- font.drawBasicString(menuActionName[l1], i + 4, i2 + 1, j2, -1);
- // chatTextDrawingArea.method389(true, i + 4, j2,
- // menuActionName[l1], i2 + 1);
- }
- } else if (ClientSettings.getInt("menu") == 602) {
- RSFont font = newRegularFont;
- DrawingArea.drawPixels(i, j + 2, k, l - 4, 0x706a5e);
- DrawingArea.drawPixels(i + 1, j + 1, k - 2, l - 2, 0x706a5e);
- DrawingArea.drawPixels(i + 2, j, k - 4, l, 0x706a5e);
- DrawingArea.drawPixels(i + 3, j + 1, k - 6, l - 2, 0x2d2822);
- DrawingArea.drawPixels(i + 2, j + 2, k - 4, l - 4, 0x2d2822);
- DrawingArea.drawPixels(i + 1, j + 3, k - 2, l - 6, 0x2d2822);
- DrawingArea.drawPixels(i + 2, j + 19, k - 4, l - 22, 0x524a3d);
- DrawingArea.drawPixels(i + 3, j + 20, k - 6, l - 22, 0x524a3d);
- DrawingArea.drawPixels(i + 3, j + 20, k - 6, l - 23, 0x112329);
- DrawingArea.fillPixels(i + 3, k - 6, 1, 0x2a291b, j + 2);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x2a261b, j + 3);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x252116, j + 4);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x211e15, j + 5);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x1e1b12, j + 6);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x1a170e, j + 7);
- DrawingArea.fillPixels(i + 2, k - 4, 2, 0x15120b, j + 8);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x100d08, j + 10);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 11);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x080703, j + 12);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 13);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x070802, j + 14);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 15);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x070802, j + 16);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x090a04, j + 17);
- DrawingArea.fillPixels(i + 2, k - 4, 1, 0x2a291b, j + 18);
- DrawingArea.fillPixels(i + 3, k - 6, 1, 0x564943, j + 19);
- font.drawBasicString("Choose Option", i + 3, j + 14, 0xc6b895, -1);
- // aTextDrawingArea_1271.method385(0xc6b895, "Choose Option", j +
- // 14, i + 3);
- int j1 = super.mouseX - xOffset;
- int k1 = -yOffset + super.mouseY;
- for (int l1 = 0; l1 < menuActionRow; l1++) {
- int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
- if (j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3) {
- DrawingArea.drawPixels(i + 3, i2 - 11, menuWidth - 6, 15, 0x26566C);
- currentActionMenu = l1;
- }
- font.drawBasicString(menuActionName[l1], i + 4, i2 + 1, 0xAAA184, -1);
- // aTextDrawingArea_1271.method389(true, i + 4, 0xAAA184,
- // menuActionName[l1], i2 + 1);
- }
- } else {
- RSFont font = newBoldFont;
- int i1 = 0x5d5447;
- //DrawingArea.drawPixels(i, j, k, l, i1);
- DrawingArea.transparentBox(l, j, i, i1, k, 0, 170);
- DrawingArea.transparentBox(17, j + 1, i + 1, 0x000000, k - 2, 0, 150);
- DrawingArea.drawPixels(i + 1, j + 1, k - 2, 16, 0);
- DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
- font.drawBasicString("Choose Option", i + 3, j + 14, i1, 0);
- // chatTextDrawingArea.method385(i1, "Choose Option", j + 14, i +
- // 3);
- int j1 = super.mouseX - xOffset;
- int k1 = -yOffset + super.mouseY;
- for (int l1 = 0; l1 < menuActionRow; l1++) {
- int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
- int j2 = 0xffffff;
- if (j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3) {
- j2 = 0xffff00;
- currentActionMenu = l1;
- }
- font.drawBasicString(menuActionName[l1], i + 4, i2 + 1, j2, 0);
- // chatTextDrawingArea.method389(true, i + 3, j2,
- // menuActionName[l1], i2);
- }
- }
- }
- private void addFriend(long l) {
- try {
- if (l == 0L)
- return;
- if (friendsCount >= 100 && anInt1046 != 1) {
- pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
- return;
- }
- if (friendsCount >= 200) {
- pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
- return;
- }
- String s = TextClass.fixName(TextClass.nameForLong(l));
- for (int i = 0; i < friendsCount; i++)
- if (friendsListAsLongs[i] == l) {
- pushMessage(s + " is already on your friend list", 0, "");
- return;
- }
- for (int j = 0; j < ignoreCount; j++)
- if (ignoreListAsLongs[j] == l) {
- pushMessage("Please remove " + s + " from your ignore list first", 0, "");
- return;
- }
- if (s.equals(myPlayer.name)) {
- return;
- } else {
- friendsList[friendsCount] = s;
- friendsListAsLongs[friendsCount] = l;
- friendsNodeIDs[friendsCount] = 0;
- friendsCount++;
- stream.createFrame(188);
- stream.writeQWord(l);
- return;
- }
- } catch (RuntimeException runtimeexception) {
- Signlink.reporterror("15283, " + (byte) 68 + ", " + l + ", " + runtimeexception.toString());
- }
- throw new RuntimeException();
- }
- private int method42(int i, int j, int k) {
- int l = k >> 7;
- int i1 = j >> 7;
- if (l < 0 || i1 < 0 || l > 103 || i1 > 103)
- return 0;
- int j1 = i;
- if (j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
- j1++;
- int k1 = k & 0x7f;
- int l1 = j & 0x7f;
- int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
- int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
- return i2 * (128 - l1) + j2 * l1 >> 7;
- }
- private static String intToKOrMil(int j) {
- if (j < 0x186a0)
- return String.valueOf(j);
- if (j < 0x989680)
- return j / 1000 + "K";
- else
- return j / 0xf4240 + "M";
- }
- private void resetLogout() {
- try {
- if (socketStream != null)
- socketStream.close();
- } catch (Exception _ex) {
- }
- socketStream = null;
- loggedIn = false;
- loginScreenState = 0;
- canEnterAuth = false;
- // myUsername = "";
- if (!ClientSettings.getBoolean("remember_me"))
- myPassword = "";
- myAuth = "";
- unlinkMRUNodes();
- worldController.initToNull();
- for (int i = 0; i < 4; i++)
- aClass11Array1230[i].method210();
- System.gc();
- stopMidi();
- CombatOverlays.clearOverlays();
- // currentSong = -1;
- nextSong = -1;
- prevSong = 0;
- gameframeHint = 0;
- unknownInt10 = -1;
- ClientSettings.save();
- frameMode(ScreenMode.FIXED);
- }
- private void method45() {
- aBoolean1031 = true;
- for (int j = 0; j < 7; j++) {
- anIntArray1065[j] = -1;
- for (int k = 0; k < IdentityKit.length; k++) {
- if (IdentityKit.cache[k].aBoolean662 || IdentityKit.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
- continue;
- anIntArray1065[j] = k;
- break;
- }
- }
- }
- private void method46(int i, RSBuffer stream) {
- while (stream.bitPosition + 21 < i * 8) {
- int k = stream.readBits(14);
- if (k == 16383)
- break;
- if (npcArray[k] == null)
- npcArray[k] = new Npc();
- Npc npc = npcArray[k];
- npcIndices[npcCount++] = k;
- npc.anInt1537 = loopCycle;
- int l = stream.readBits(5);
- if (l > 15)
- l -= 32;
- int i1 = stream.readBits(5);
- if (i1 > 15)
- i1 -= 32;
- int j1 = stream.readBits(1);
- npc.desc = NpcDefinition.forID(stream.readBits(npcBits));
- int k1 = stream.readBits(1);
- if (k1 == 1)
- anIntArray894[anInt893++] = k;
- npc.serverIndex = k;
- npc.anInt1540 = npc.desc.aByte68;
- npc.anInt1504 = npc.desc.anInt79;
- npc.anInt1554 = npc.desc.walkAnim;
- npc.anInt1555 = npc.desc.anInt58;
- npc.anInt1556 = npc.desc.anInt83;
- npc.anInt1557 = npc.desc.anInt55;
- npc.anInt1511 = npc.desc.standAnim;
- npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
- }
- stream.finishBitAccess();
- }
- public void processGameLoop() {
- if (rsAlreadyLoaded || loadingError || genericLoadingError)
- return;
- loopCycle++;
- if (!loggedIn)
- processLoginScreenInput();
- else
- mainGameProcessor();
- processOnDemandQueue();
- }
- private void swapPlayerIndices(int source, int target) {
- int temp = playerIndices[target];
- playerIndices[target] = playerIndices[source];
- playerIndices[source] = temp;
- }
- private void method47(boolean flag) {
- if (myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
- destX = 0;
- int j = playerCount;
- if (flag)
- j = 1;
- int interactingIndex = -1;
- if (myPlayer.interactingEntity >= 32768) {
- interactingIndex = myPlayer.interactingEntity - 32768;
- }
- int interactingIndicesIndex = -1;
- for (int i = 0; i < playerIndices.length; i++) {
- if (playerIndices[i] == interactingIndex) {
- interactingIndicesIndex = i;
- }
- }
- if (interactingIndicesIndex >= 0) {
- swapPlayerIndices(interactingIndicesIndex, 0);
- }
- for (int l = 0; l < j; l++) {
- Player player;
- int i1;
- if (flag) {
- player = myPlayer;
- i1 = myPlayerIndex << 14;
- } else {
- player = playerArray[playerIndices[l]];
- i1 = playerIndices[l] << 14;
- }
- if (player == null || !player.isVisible())
- continue;
- player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag
- && player.anInt1517 == player.anInt1511;
- int j1 = player.x >> 7;
- int k1 = player.y >> 7;
- if (j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
- continue;
- if (player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
- player.aBoolean1699 = false;
- player.anInt1709 = method42(plane, player.y, player.x);
- worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x,
- player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
- continue;
- }
- if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
- if (anIntArrayArray929[j1][k1] == anInt1265)
- continue;
- anIntArrayArray929[j1][k1] = anInt1265;
- }
- player.anInt1709 = method42(plane, player.y, player.x);
- worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player,
- player.aBoolean1541);
- }
- if (interactingIndicesIndex >= 0) {
- swapPlayerIndices(interactingIndicesIndex, 0);
- }
- }
- private boolean promptUserForInput(RSInterface class9) {
- int j = class9.contentType;
- if (anInt900 == 2) {
- if (j == 201) {
- inputTaken = true;
- inputDialogState = 0;
- messagePromptRaised = true;
- promptInput = "";
- friendsListAction = 1;
- aString1121 = "Enter name of friend to add to list";
- }
- if (j == 202) {
- inputTaken = true;
- inputDialogState = 0;
- messagePromptRaised = true;
- promptInput = "";
- friendsListAction = 2;
- aString1121 = "Enter name of friend to delete from list";
- }
- }
- if (j == 205) {
- anInt1011 = 250;
- return true;
- }
- if (j == 501) {
- inputTaken = true;
- inputDialogState = 0;
- messagePromptRaised = true;
- promptInput = "";
- friendsListAction = 4;
- aString1121 = "Enter name of player to add to list";
- }
- if (j == 502) {
- inputTaken = true;
- inputDialogState = 0;
- messagePromptRaised = true;
- promptInput = "";
- friendsListAction = 5;
- aString1121 = "Enter name of player to delete from list";
- }
- if (j == 550) {
- inputTaken = true;
- inputDialogState = 0;
- messagePromptRaised = true;
- promptInput = "";
- friendsListAction = 6;
- aString1121 = "Enter the name of the chat you wish to join";
- }
- if (j >= 300 && j <= 313) {
- int k = (j - 300) / 2;
- int j1 = j & 1;
- int i2 = anIntArray1065[k];
- if (i2 != -1) {
- do {
- if (j1 == 0 && --i2 < 0)
- i2 = IdentityKit.length - 1;
- if (j1 == 1 && ++i2 >= IdentityKit.length)
- i2 = 0;
- } while (IdentityKit.cache[i2].aBoolean662
- || IdentityKit.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
- anIntArray1065[k] = i2;
- aBoolean1031 = true;
- }
- }
- if (j >= 314 && j <= 323) {
- int l = (j - 314) / 2;
- int k1 = j & 1;
- int j2 = anIntArray990[l];
- if (k1 == 0 && --j2 < 0)
- j2 = anIntArrayArray1003[l].length - 1;
- if (k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
- j2 = 0;
- anIntArray990[l] = j2;
- aBoolean1031 = true;
- }
- if (j == 324 && !aBoolean1047) {
- aBoolean1047 = true;
- method45();
- }
- if (j == 325 && aBoolean1047) {
- aBoolean1047 = false;
- method45();
- }
- if (j == 326) {
- // Cheaphax lvl 9000
- // XXX: ruse replaced this packet
- String s = " " + (aBoolean1047 ? 0 : 1) + "";
- for (int i1 = 0; i1 < 7; i1++)
- s += " " + (anIntArray1065[i1]);
- for (int l1 = 0; l1 < 5; l1++)
- s += " " + (anIntArray990[l1]);
- stream.createFrame(11);
- stream.writeByte(s.substring(1).length() + 1);
- stream.writeString(s.substring(1));
- return true;
- }
- if (j == 613)
- canMute = !canMute;
- if (j >= 601 && j <= 612) {
- clearTopInterfaces();
- if (reportAbuseInput.length() > 0) {
- stream.createFrame(218);
- stream.writeQWord(TextClass.longForName(reportAbuseInput));
- stream.writeByte(j - 601);
- stream.writeByte(canMute ? 1 : 0);
- }
- }
- return false;
- }
- private void method49(RSBuffer stream) {
- for (int j = 0; j < anInt893; j++) {
- int k = anIntArray894[j];
- Player player = playerArray[k];
- int l = stream.readUnsignedByte();
- if ((l & 0x40) != 0)
- l += stream.readUnsignedByte() << 8;
- method107(l, k, stream, player);
- }
- }
- private void method50(int i, int k, int l, int i1, int j1) {
- int k1 = worldController.method300(j1, l, i);
- if (k1 != 0) {
- int l1 = worldController.method304(j1, l, i, k1);
- int k2 = l1 >> 6 & 3;
- int i3 = l1 & 0x1f;
- int k3 = k;
- if (k1 > 0)
- k3 = i1;
- int ai[] = minimapImage.myPixels;
- int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
- int i5 = worldController.fetchWallObjectNewUID(j1, l, i);
- ObjectDefinition class46_2 = ObjectDefinition.forID(i5);
- if (class46_2.anInt758 != -1) {
- Background background_2 = mapScenes[class46_2.anInt758];
- if (background_2 != null) {
- int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
- int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
- background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
- }
- } else {
- if (i3 == 0 || i3 == 2)
- if (k2 == 0) {
- ai[k4] = k3;
- ai[k4 + 512] = k3;
- ai[k4 + 1024] = k3;
- ai[k4 + 1536] = k3;
- } else if (k2 == 1) {
- ai[k4] = k3;
- ai[k4 + 1] = k3;
- ai[k4 + 2] = k3;
- ai[k4 + 3] = k3;
- } else if (k2 == 2) {
- ai[k4 + 3] = k3;
- ai[k4 + 3 + 512] = k3;
- ai[k4 + 3 + 1024] = k3;
- ai[k4 + 3 + 1536] = k3;
- } else if (k2 == 3) {
- ai[k4 + 1536] = k3;
- ai[k4 + 1536 + 1] = k3;
- ai[k4 + 1536 + 2] = k3;
- ai[k4 + 1536 + 3] = k3;
- }
- if (i3 == 3)
- if (k2 == 0)
- ai[k4] = k3;
- else if (k2 == 1)
- ai[k4 + 3] = k3;
- else if (k2 == 2)
- ai[k4 + 3 + 1536] = k3;
- else if (k2 == 3)
- ai[k4 + 1536] = k3;
- if (i3 == 2)
- if (k2 == 3) {
- ai[k4] = k3;
- ai[k4 + 512] = k3;
- ai[k4 + 1024] = k3;
- ai[k4 + 1536] = k3;
- } else if (k2 == 0) {
- ai[k4] = k3;
- ai[k4 + 1] = k3;
- ai[k4 + 2] = k3;
- ai[k4 + 3] = k3;
- } else if (k2 == 1) {
- ai[k4 + 3] = k3;
- ai[k4 + 3 + 512] = k3;
- ai[k4 + 3 + 1024] = k3;
- ai[k4 + 3 + 1536] = k3;
- } else if (k2 == 2) {
- ai[k4 + 1536] = k3;
- ai[k4 + 1536 + 1] = k3;
- ai[k4 + 1536 + 2] = k3;
- ai[k4 + 1536 + 3] = k3;
- }
- }
- }
- k1 = worldController.method302(j1, l, i);
- if (k1 != 0) {
- int i2 = worldController.method304(j1, l, i, k1);
- int l2 = i2 >> 6 & 3;
- int j3 = i2 & 0x1f;
- int l3 = k1 >> 14 & 0x7fff;
- ObjectDefinition class46_1 = ObjectDefinition.forID(l3);
- if (class46_1.anInt758 != -1) {
- Background background_1 = mapScenes[class46_1.anInt758];
- if (background_1 != null) {
- int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
- int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
- background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
- }
- } else if (j3 == 9) {
- int l4 = 0xeeeeee;
- if (k1 > 0)
- l4 = 0xee0000;
- int ai1[] = minimapImage.myPixels;
- int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
- if (l2 == 0 || l2 == 2) {
- ai1[l5 + 1536] = l4;
- ai1[l5 + 1024 + 1] = l4;
- ai1[l5 + 512 + 2] = l4;
- ai1[l5 + 3] = l4;
- } else {
- ai1[l5] = l4;
- ai1[l5 + 512 + 1] = l4;
- ai1[l5 + 1024 + 2] = l4;
- ai1[l5 + 1536 + 3] = l4;
- }
- }
- }
- k1 = worldController.method303(j1, l, i);
- if (k1 != 0) {
- int j2 = k1 >> 14 & 0x7fff;
- ObjectDefinition class46 = ObjectDefinition.forID(j2);
- if (class46.anInt758 != -1) {
- Background background = mapScenes[class46.anInt758];
- if (background != null) {
- int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
- int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
- background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
- }
- }
- }
- }
- /*
- * private void loadTitleScreen() { aBackground_966 = new
- * Background(titleStreamLoader, "titlebox", 0); aBackground_967 = new
- * Background(titleStreamLoader, "titlebutton", 0); aBackgroundArray1152s =
- * new Background[12]; int j = 0; try { j =
- * Integer.parseInt(getParameter("fl_icon")); } catch (Exception _ex) { } if
- * (j == 0) { for (int k = 0; k < 12; k++) aBackgroundArray1152s[k] = new
- * Background(titleStreamLoader, "runes", k);
- *
- * } else { for (int l = 0; l < 12; l++) aBackgroundArray1152s[l] = new
- * Background(titleStreamLoader, "runes", 12 + (l & 3));
- *
- * } aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
- * aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
- * System.arraycopy(aRSImageProducer_1110.canvasRaster, 0,
- * aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
- *
- * System.arraycopy(aRSImageProducer_1111.canvasRaster, 0,
- * aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
- *
- * anIntArray851 = new int[256]; for (int k1 = 0; k1 < 64; k1++)
- * anIntArray851[k1] = k1 * 0x40000;
- *
- * for (int l1 = 0; l1 < 64; l1++) anIntArray851[l1 + 64] = 0xff0000 + 1024
- * * l1;
- *
- * for (int i2 = 0; i2 < 64; i2++) anIntArray851[i2 + 128] = 0xffff00 + 4 *
- * i2;
- *
- * for (int j2 = 0; j2 < 64; j2++) anIntArray851[j2 + 192] = 0xffffff;
- *
- * anIntArray852 = new int[256]; for (int k2 = 0; k2 < 64; k2++)
- * anIntArray852[k2] = k2 * 1024;
- *
- * for (int l2 = 0; l2 < 64; l2++) anIntArray852[l2 + 64] = 65280 + 4 * l2;
- *
- * for (int i3 = 0; i3 < 64; i3++) anIntArray852[i3 + 128] = 65535 + 0x40000
- * * i3;
- *
- * for (int j3 = 0; j3 < 64; j3++) anIntArray852[j3 + 192] = 0xffffff;
- *
- * anIntArray853 = new int[256]; for (int k3 = 0; k3 < 64; k3++)
- * anIntArray853[k3] = k3 * 4;
- *
- * for (int l3 = 0; l3 < 64; l3++) anIntArray853[l3 + 64] = 255 + 0x40000 *
- * l3;
- *
- * for (int i4 = 0; i4 < 64; i4++) anIntArray853[i4 + 128] = 0xff00ff + 1024
- * * i4;
- *
- * for (int j4 = 0; j4 < 64; j4++) anIntArray853[j4 + 192] = 0xffffff;
- *
- * anIntArray850 = new int[256]; anIntArray1190 = new int[32768];
- * anIntArray1191 = new int[32768]; randomizeBackground(null); anIntArray828
- * = new int[32768]; anIntArray829 = new int[32768]; drawLoadingText(10,
- * "Connecting to fileserver"); if (!aBoolean831) { drawFlames = true;
- * aBoolean831 = true; startRunnable(this, 2); } }
- */
- public static void main(String args[]) {
- try {
- nodeID = 10;
- portOff = 0;
- setHighMemAndReadUUID();
- isMembers = true;
- Signlink.storeid = 32;
- Signlink.startpriv(InetAddress.getLocalHost());
- instance = new Client();
- ClientUI.getInstance().initUI();
- instance.frameMode(ScreenMode.FIXED);
- // instance.createClientFrame(instance.frameWidth, instance.frameHeight);
- instance.setGameframe(new Gameframe317());
- TeeOutputStream outputStream = new TeeOutputStream(System.err,
- new FileOutputStream("./near-reality-errors.txt", true));
- System.setErr(new PrintStream(outputStream));
- instance.midiPlayer = new MidiPlayer();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public static Client instance;
- private void loadingStages() {
- if (lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
- aRSImageProducer_1165.initDrawingArea();
- drawLoadingMessages(1, "Loading - please wait.", null);
- aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics,
- frameMode == ScreenMode.FIXED ? 4 : 0);
- loadingStage = 1;
- aLong824 = System.currentTimeMillis();
- }
- if (loadingStage == 1) {
- int j = method54();
- if (j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
- Signlink.reporterror(
- myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + ","
- + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
- aLong824 = System.currentTimeMillis();
- }
- }
- if (loadingStage == 2 && plane != anInt985) {
- anInt985 = plane;
- method24(plane);
- }
- }
- private int method54() {
- for (int i = 0; i < aByteArrayArray1183.length; i++) {
- if (aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
- return -1;
- if (aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
- return -2;
- }
- boolean flag = true;
- for (int j = 0; j < aByteArrayArray1183.length; j++) {
- byte abyte0[] = aByteArrayArray1247[j];
- if (abyte0 != null) {
- int k = (anIntArray1234[j] >> 8) * 64 - baseX;
- int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
- if (aBoolean1159) {
- k = 10;
- l = 10;
- }
- try {
- flag &= ObjectManager.method189(k, abyte0, l);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
- if (!flag)
- return -3;
- if (aBoolean1080) {
- return -4;
- } else {
- loadingStage = 2;
- ObjectManager.anInt131 = plane;
- method22();
- stream.createFrame(121);
- return 0;
- }
- }
- private void method55() {
- for (Animable_Sub4 class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
- .reverseGetFirst(); class30_sub2_sub4_sub4 != null; class30_sub2_sub4_sub4 = (Animable_Sub4) aClass19_1013
- .reverseGetNext())
- if (class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
- class30_sub2_sub4_sub4.unlink();
- else if (loopCycle >= class30_sub2_sub4_sub4.anInt1571) {
- if (class30_sub2_sub4_sub4.anInt1590 > 0) {
- Npc npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
- if (npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
- class30_sub2_sub4_sub4.method455(loopCycle, npc.y,
- method42(class30_sub2_sub4_sub4.anInt1597, npc.y, npc.x)
- - class30_sub2_sub4_sub4.anInt1583,
- npc.x);
- }
- if (class30_sub2_sub4_sub4.anInt1590 < 0) {
- int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
- Player player;
- if (j == unknownInt10)
- player = myPlayer;
- else
- player = playerArray[j];
- if (player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
- class30_sub2_sub4_sub4.method455(loopCycle, player.y,
- method42(class30_sub2_sub4_sub4.anInt1597, player.y, player.x)
- - class30_sub2_sub4_sub4.anInt1583,
- player.x);
- }
- class30_sub2_sub4_sub4.method456(anInt945);
- worldController.method285(plane, class30_sub2_sub4_sub4.anInt1595,
- (int) class30_sub2_sub4_sub4.aDouble1587, -1, (int) class30_sub2_sub4_sub4.aDouble1586, 60,
- (int) class30_sub2_sub4_sub4.aDouble1585, class30_sub2_sub4_sub4, false);
- }
- }
- public AppletContext getAppletContext() {
- if (Signlink.mainapp != null)
- return Signlink.mainapp.getAppletContext();
- else
- return super.getAppletContext();
- }
- private void processOnDemandQueue() {
- do {
- OnDemandData onDemandData;
- do {
- onDemandData = onDemandFetcher.getNextNode();
- if (onDemandData == null)
- return;
- if (onDemandData.dataType == 0) {
- Model.method460(onDemandData.buffer, onDemandData.ID, 0);
- if (backDialogID != -1)
- inputTaken = true;
- }
- if (onDemandData.dataType == 1) {
- Class36.load(onDemandData.ID, onDemandData.buffer, 0);
- }
- if (onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null) {
- playMidi(onDemandData.buffer);
- currentSong = nextSong;
- }
- if (onDemandData.dataType == 3 && loadingStage == 1) {
- for (int i = 0; i < aByteArrayArray1183.length; i++) {
- if (anIntArray1235[i] == onDemandData.ID) {
- byte[] preload = checkMapPreload(onDemandData.ID);
- if (preload != null) {
- aByteArrayArray1183[i] = preload;
- } else {
- aByteArrayArray1183[i] = onDemandData.buffer;
- if (onDemandData.buffer == null)
- anIntArray1235[i] = -1;
- }
- break;
- }
- if (anIntArray1236[i] != onDemandData.ID)
- continue;
- if (onDemandData.buffer == null) {
- anIntArray1236[i] = -1;
- break;
- }
- byte[] preload = checkMapPreload(onDemandData.ID);
- if (preload != null) {
- aByteArrayArray1247[i] = new byte[preload.length + 1];
- aByteArrayArray1247[i][aByteArrayArray1247[i].length - 1] = 0;
- for (int k = 0; k < preload.length; k++) {
- aByteArrayArray1247[i][k] = preload[k];
- }
- } else {
- aByteArrayArray1247[i] = new byte[onDemandData.buffer.length + 1];
- aByteArrayArray1247[i][aByteArrayArray1247[i].length - 1] = 0;
- for (int k = 0; k < onDemandData.buffer.length; k++) {
- aByteArrayArray1247[i][k] = onDemandData.buffer[k];
- }
- }
- break;
- }
- }
- if (onDemandData.dataType == 4) {
- Model.method460(onDemandData.buffer, onDemandData.ID, 1);
- if (backDialogID != -1)
- inputTaken = true;
- }
- if (onDemandData.dataType == 5) {
- Class36.load(onDemandData.ID, onDemandData.buffer, 1);
- }
- if (onDemandData.dataType == 6) {
- Class36.load(onDemandData.ID, onDemandData.buffer, 2);
- }
- if (onDemandData.dataType == 7) {
- Model.method460(onDemandData.buffer, onDemandData.ID, 2);
- if (backDialogID != -1)
- inputTaken = true;
- }
- if (onDemandData.dataType == 8 && loadingStage == 1) {
- for (int i = 0; i < aByteArrayArray1183.length; i++) {
- if (anIntArray1235[i] == onDemandData.ID) {
- aByteArrayArray1183[i] = onDemandData.buffer;
- if (onDemandData.buffer == null)
- anIntArray1235[i] = -1;
- break;
- }
- if (anIntArray1236[i] != onDemandData.ID)
- continue;
- if (onDemandData.buffer == null) {
- anIntArray1236[i] = -1;
- break;
- }
- aByteArrayArray1247[i] = new byte[onDemandData.buffer.length + 1];
- aByteArrayArray1247[i][aByteArrayArray1247[i].length - 1] = 1;
- for (int k = 0; k < onDemandData.buffer.length; k++) {
- aByteArrayArray1247[i][k] = onDemandData.buffer[k];
- }
- break;
- }
- }
- } while (onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
- ObjectManager.method173(new RSBuffer(onDemandData.buffer), onDemandFetcher);
- } while (true);
- }
- public byte[] checkMapPreload(int file) {
- String preload = Signlink.getCacheDirectory() + "raw/maps/" + file + ".dat";
- if (new File(preload).exists()) {
- return FileOperations.ReadFile(preload);
- } else {
- return null;
- }
- }
- private void openInterface(int id) {
- RSInterface widget = RSInterface.interfaceCache[id];
- if (widget == null || widget.children == null)
- return;
- for (int j = 0; j < widget.children.length; j++) {
- if (widget.children[j] == -1)
- break;
- RSInterface class9_1 = RSInterface.interfaceCache[widget.children[j]];
- if (class9_1 == null)
- continue;
- if (class9_1.type == 1)
- openInterface(class9_1.id);
- class9_1.anInt246 = 0;
- class9_1.anInt208 = 0;
- }
- switch (id) {
- case 62870:
- for (int i = 0; i < 100; i++) {
- RSInterface bossNameWidget = RSInterface.interfaceCache[62_879 + i * 2];
- if (bossNameWidget.message.isEmpty()) {
- RSInterface scrollableWidget = RSInterface.interfaceCache[62_877];
- scrollableWidget.scrollMax = i * 20 + 25;
- if (scrollableWidget.scrollMax <= scrollableWidget.height) {
- scrollableWidget.scrollMax = scrollableWidget.height + 1;
- }
- break;
- }
- }
- break;
- }
- }
- private void drawHeadIcon() {
- if (anInt855 != 2)
- return;
- calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
- if (spriteDrawX > -1 && loopCycle % 20 < 10)
- headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
- }
- public void doGEAction(int l) {
- if (l == 721) {
- inputTaken = true;
- amountOrNameInput = "";
- inputDialogState = 1;
- interfaceButtonAction = 1557;
- }
- if (l == 722) {
- inputTaken = true;
- amountOrNameInput = "";
- inputDialogState = 1;
- interfaceButtonAction = 1557;
- }
- if (l == 723) {
- inputTaken = true;
- amountOrNameInput = "";
- inputDialogState = 1;
- interfaceButtonAction = 1558;
- }
- if (l == 724) {
- inputTaken = true;
- amountOrNameInput = "";
- inputDialogState = 1;
- interfaceButtonAction = 1558;
- }
- }
- public boolean shiftDrop() {
- return ClientSettings.getBoolean("shift_dropping") && isPressed(KeyEvent.VK_SHIFT);
- }
- private void mainGameProcessor() {
- // XXX: hardcoded ruse shit
- if (openInterfaceID == 24600 && buttonclicked && interfaceButtonAction != 1558 && interfaceButtonAction != 1557
- && inputDialogState != 3) {
- if (inputDialogState == 1) {
- } else {
- inputDialogState = 3;
- }
- }
- if (openInterfaceID == 24600 && !buttonclicked && interfaceButtonAction != 1558 && interfaceButtonAction != 1557
- && inputDialogState != 1) {
- inputDialogState = 0;
- }
- //
- if (gameframe.isMouseInsideTabArea() && shiftDrop()) {
- menuActionRow = 3;
- }
- refreshFrameSize();
- if (anInt1104 > 1)
- anInt1104--;
- if (anInt1011 > 0)
- anInt1011--;
- for (int j = 0; j < 10; j++) {
- if (!parsePacket()) {
- break;
- } else {
- int opcode = anInt841;
- if (opcodeReceived.containsKey(opcode)) {
- opcodeReceived.put(opcode, opcodeReceived.get(opcode) + 1);
- } else {
- opcodeReceived.put(opcode, 1l);
- }
- }
- }
- if (System.currentTimeMillis() - lastReceivedUpdate >= 1_000) {
- bytesReceived = inStream.received;
- inStream.received = 0;
- lastReceivedUpdate = System.currentTimeMillis();
- }
- if (!loggedIn)
- return;
- synchronized (mouseDetection.syncObject) {
- if (flagged) {
- if (super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40) {
- stream.createFrame(45);
- stream.writeByte(0);
- int j2 = stream.currentOffset;
- int j3 = 0;
- for (int j4 = 0; j4 < mouseDetection.coordsIndex; j4++) {
- if (j2 - stream.currentOffset >= 240)
- break;
- j3++;
- int l4 = mouseDetection.coordsY[j4];
- if (l4 < 0)
- l4 = 0;
- else if (l4 > 502)
- l4 = 502;
- int k5 = mouseDetection.coordsX[j4];
- if (k5 < 0)
- k5 = 0;
- else if (k5 > 764)
- k5 = 764;
- int i6 = l4 * 765 + k5;
- if (mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1) {
- k5 = -1;
- l4 = -1;
- i6 = 0x7ffff;
- }
- if (k5 == anInt1237 && l4 == anInt1238) {
- if (anInt1022 < 2047)
- anInt1022++;
- } else {
- int j6 = k5 - anInt1237;
- anInt1237 = k5;
- int k6 = l4 - anInt1238;
- anInt1238 = l4;
- if (anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31) {
- j6 += 32;
- k6 += 32;
- stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
- anInt1022 = 0;
- } else if (anInt1022 < 8) {
- stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
- anInt1022 = 0;
- } else {
- stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
- anInt1022 = 0;
- }
- }
- }
- stream.writeBytes(stream.currentOffset - j2);
- if (j3 >= mouseDetection.coordsIndex) {
- mouseDetection.coordsIndex = 0;
- } else {
- mouseDetection.coordsIndex -= j3;
- for (int i5 = 0; i5 < mouseDetection.coordsIndex; i5++) {
- mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
- mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
- }
- }
- }
- } else {
- mouseDetection.coordsIndex = 0;
- }
- }
- if (super.clickMode3 != 0) {
- long l = (super.aLong29 - aLong1220) / 50L;
- if (l > 4095L)
- l = 4095L;
- aLong1220 = super.aLong29;
- int k2 = super.saveClickY;
- if (k2 < 0)
- k2 = 0;
- else if (k2 > 502)
- k2 = 502;
- int k3 = super.saveClickX;
- if (k3 < 0)
- k3 = 0;
- else if (k3 > 764)
- k3 = 764;
- int k4 = k2 * 765 + k3;
- int j5 = 0;
- if (super.clickMode3 == 2)
- j5 = 1;
- int l5 = (int) l;
- stream.createFrame(241);
- stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
- }
- processShadow();
- if (anInt1016 > 0)
- anInt1016--;
- if (super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
- aBoolean1017 = true;
- if (aBoolean1017 && anInt1016 <= 0) {
- anInt1016 = 20;
- aBoolean1017 = false;
- stream.createFrame(86);
- stream.writeWord(anInt1184);
- stream.method432(minimapInt1);
- }
- if (super.awtFocus && !aBoolean954) {
- aBoolean954 = true;
- stream.createFrame(3);
- stream.writeByte(1);
- }
- if (!super.awtFocus && aBoolean954) {
- aBoolean954 = false;
- stream.createFrame(3);
- stream.writeByte(0);
- }
- loadingStages();
- method115();
- anInt1009++;
- if (anInt1009 > 750)
- dropClient();
- method114();
- processNpcInterfaceDisplayAnimation();
- method95();
- method38();
- anInt945++;
- if (crossType != 0) {
- crossIndex += 20;
- if (crossIndex >= 400)
- crossType = 0;
- }
- if (atInventoryInterfaceType != 0) {
- atInventoryLoopCycle++;
- if (atInventoryLoopCycle >= 15) {
- if (atInventoryInterfaceType == 2) {
- }
- if (atInventoryInterfaceType == 3)
- inputTaken = true;
- atInventoryInterfaceType = 0;
- }
- }
- if (activeInterfaceType != 0) {
- anInt989++;
- if (super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5
- || super.mouseY < anInt1088 - 5)
- aBoolean1242 = true;
- if (super.clickMode2 == 0) {
- if (activeInterfaceType == 2) {
- }
- if (activeInterfaceType == 3)
- inputTaken = true;
- activeInterfaceType = 0;
- if (aBoolean1242 && anInt989 >= ClientSettings.getInt("dragging_threshold")) {
- lastActiveInvInterface = -1;
- processRightClick();
- if (lastActiveInvInterface != anInt1084) {
- stream.createFrame(240);
- stream.method433(lastActiveInvInterface);
- stream.method433(anInt1084);
- stream.method433(mouseInvInterfaceIndex);
- stream.method433(anInt1085);
- } else if (lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085) {
- RSInterface class9 = RSInterface.interfaceCache[anInt1084];
- int j1 = 0;
- if (anInt913 == 1 && class9.contentType == 206)
- j1 = 1;
- if (class9.inv[mouseInvInterfaceIndex] <= 0)
- j1 = 0;
- if (class9.aBoolean235) {
- int l2 = anInt1085;
- int l3 = mouseInvInterfaceIndex;
- class9.inv[l3] = class9.inv[l2];
- class9.invStackSizes[l3] = class9.invStackSizes[l2];
- class9.inv[l2] = -1;
- class9.invStackSizes[l2] = 0;
- } else if (j1 == 1) {
- boolean bankMainTab = class9.id == 5382 && variousSettings[456] == 1;
- int l2 = anInt1085;
- int l3 = mouseInvInterfaceIndex;
- if (bankMainTab && (l2 / 100) != (l3 / 100)) {
- int tab1 = (l2 / 100);
- int tab2 = (l3 / 100);
- int slot1 = l2;
- int slot2 = l3;
- int startSlot = class9.freeSlot(tab2 * 100, 100) - 1;
- if (startSlot != -2) {
- for (int i = startSlot; i >= slot2; i--) {
- class9.inv[i + 1] = class9.inv[i];
- class9.invStackSizes[i + 1] = class9.invStackSizes[i];
- class9.inv[i] = -1;
- class9.invStackSizes[i] = 0;
- }
- class9.inv[slot2] = class9.inv[slot1];
- class9.invStackSizes[slot2] = class9.invStackSizes[slot1];
- class9.inv[slot1] = -1;
- class9.invStackSizes[slot1] = -1;
- class9.shift(tab1 * 100, 100);
- }
- } else {
- int i3 = anInt1085;
- for (int i4 = mouseInvInterfaceIndex; i3 != i4;) {
- if (i3 > i4) {
- class9.swapInventoryItems(i3, i3 - 1);
- i3--;
- } else if (i3 < i4) {
- class9.swapInventoryItems(i3, i3 + 1);
- i3++;
- }
- }
- }
- } else {
- class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
- if (class9.shiftInvLeft) {
- main: for (int i = 0; i < class9.inv.length; i++) {
- if (class9.inv[i] <= 0) {
- for (int k = i + 1; k < class9.inv.length; k++) {
- if (class9.inv[k] > 0) {
- class9.swapInventoryItems(k, i);
- continue main;
- }
- }
- }
- }
- }
- }
- stream.createFrame(214);
- stream.method433(anInt1084);
- stream.method424(j1);
- stream.method433(anInt1085);
- stream.method431(mouseInvInterfaceIndex);
- }
- } else if ((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
- determineMenuSize();
- else if (menuActionRow > 0)
- doAction(menuActionRow - 1);
- atInventoryLoopCycle = 10;
- super.clickMode3 = 0;
- }
- }
- if (WorldController.anInt470 != -1) {
- int k = WorldController.anInt470;
- int k1 = WorldController.anInt471;
- boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
- WorldController.anInt470 = -1;
- if (flag) {
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 1;
- crossIndex = 0;
- }
- }
- if (super.clickMode3 == 1 && aString844 != null) {
- aString844 = null;
- inputTaken = true;
- super.clickMode3 = 0;
- }
- processMenuClick();
- if (super.clickMode2 == 1 || super.clickMode3 == 1)
- anInt1213++;
- if (tooltipHoverChildId != 0) {
- RSInterface hoverInter = RSInterface.get(tooltipHoverChildId);
- if (hoverInter != null) {
- if (super.mouseX < tooltipHoverX || super.mouseY < tooltipHoverY
- || super.mouseX > tooltipHoverX + hoverInter.width
- || super.mouseY > tooltipHoverY + hoverInter.height) {
- tooltipHoverChildId = 0;
- inputTaken = true;
- // needDrawTabArea = true;
- }
- } else {
- tooltipHoverChildId = 0;
- inputTaken = true;
- // needDrawTabArea = true;
- }
- if (tooltipHoverLoopCycle < 25 && !menuOpen) {
- tooltipHoverLoopCycle++;
- if (tooltipHoverLoopCycle == 25) {
- inputTaken = true;
- // needDrawTabArea = true;
- }
- }
- } else if (tooltipHoverLoopCycle > 0) {
- tooltipHoverLoopCycle--;
- }
- if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
- if (anInt1501 < 0 && !menuOpen) {
- anInt1501++;
- if (anInt1501 == 0) {
- if (anInt1500 != 0) {
- inputTaken = true;
- }
- if (anInt1044 != 0) {
- }
- }
- }
- } else if (anInt1501 > 0) {
- anInt1501--;
- }
- if (loadingStage == 2)
- method108();
- if (loadingStage == 2 && aBoolean1160)
- calcCameraPos();
- for (int i1 = 0; i1 < 5; i1++)
- anIntArray1030[i1]++;
- method73();
- super.idleTime++;
- if (super.idleTime > 4500) {
- anInt1011 = 250;
- super.idleTime -= 500;
- stream.createFrame(202);
- }
- anInt1010++;
- if (anInt1010 > 50)
- stream.createFrame(0);
- try {
- if (socketStream != null && stream.currentOffset > 0) {
- socketStream.queueBytes(stream.currentOffset, stream.buffer);
- stream.currentOffset = 0;
- anInt1010 = 0;
- }
- } catch (IOException _ex) {
- dropClient();
- } catch (Exception exception) {
- resetLogout();
- }
- }
- private void method63() {
- Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetFirst();
- for (; class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179.reverseGetNext())
- if (class30_sub1.delay == -1) {
- class30_sub1.anInt1302 = 0;
- method89(class30_sub1);
- } else {
- class30_sub1.unlink();
- }
- }
- private void resetImageProducers() {
- if (aRSImageProducer_1107 != null)
- return;
- super.fullGameScreen = null;
- aRSImageProducer_1166 = null;
- aRSImageProducer_1164 = null;
- aRSImageProducer_1163 = null;
- aRSImageProducer_1165 = null;
- aRSImageProducer_1125 = null;
- aRSImageProducer_1110 = new ImageProducer(128, 265);
- DrawingArea.setAllPixelsToZero();
- aRSImageProducer_1111 = new ImageProducer(128, 265);
- DrawingArea.setAllPixelsToZero();
- aRSImageProducer_1107 = new ImageProducer(509, 171);
- DrawingArea.setAllPixelsToZero();
- aRSImageProducer_1108 = new ImageProducer(360, 132);
- DrawingArea.setAllPixelsToZero();
- aRSImageProducer_1109 = new ImageProducer(765, 503);
- DrawingArea.setAllPixelsToZero();
- aRSImageProducer_1112 = new ImageProducer(202, 238);
- DrawingArea.setAllPixelsToZero();
- aRSImageProducer_1113 = new ImageProducer(203, 238);
- DrawingArea.setAllPixelsToZero();
- aRSImageProducer_1114 = new ImageProducer(74, 94);
- DrawingArea.setAllPixelsToZero();
- aRSImageProducer_1115 = new ImageProducer(75, 94);
- DrawingArea.setAllPixelsToZero();
- if (titleStreamLoader != null) {
- drawLogo();
- // loadTitleScreen();
- }
- welcomeScreenRaised = true;
- }
- float LP = 0.0f;
- void drawSmoothLoadingText(int i, String s) {
- for (float f = LP; f < (float) i; f = (float) ((double) f + 0.29999999999999999D)) {
- drawLoadingText((int) f + 1, s);
- LP = i;
- }
- }
- @Override
- public void drawLoadingText(int i, String s) {
- resetImageProducers();
- if (newBoldFont == null) {
- super.drawLoadingText(i == -1 ? 100 : i, s + (i != -1 ? (" - " + i + "%") : ""));
- return;
- }
- final int percentage = i == -1 ? 100 : i;
- final int centerX = 765 / 2, centerY = (503 / 2) - 15;
- aRSImageProducer_1109.initDrawingArea();
- DrawingArea.setAllPixelsToZero();
- DrawingArea.fillPixels(centerX - 152, 304, 34, 0x00B718, centerY);
- DrawingArea.fillPixels(centerX - 151, 302, 32, 0, centerY + 1);
- DrawingArea.drawPixels(centerX - 150, centerY + 2, percentage * 3, 30, 0x00B718);
- DrawingArea.drawPixels((centerX - 150) + percentage * 3, centerY + 2, 300 - percentage * 3, 30, 0);
- newBoldFont.drawCenteredString(s + (i != -1 ? " - " + i + "%" : ""), centerX, (centerY + 22), 0xffffff, -1);
- aRSImageProducer_1109.drawGraphics(0, super.graphics, 0);
- if (welcomeScreenRaised) {
- welcomeScreenRaised = false;
- }
- }
- private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag, int j1) {
- int anInt992;
- if (aBoolean972)
- anInt992 = 32;
- else
- anInt992 = 0;
- aBoolean972 = false;
- if (k >= i && k < i + 16 && l >= i1 && l < i1 + 16) {
- class9.scrollPosition -= anInt1213 * 4;
- if (flag) {
- }
- } else if (k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j) {
- class9.scrollPosition += anInt1213 * 4;
- if (flag) {
- }
- } else if (k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0) {
- int l1 = ((j - 32) * j) / j1;
- if (l1 < 8)
- l1 = 8;
- int i2 = l - i1 - 16 - l1 / 2;
- int j2 = j - 32 - l1;
- class9.scrollPosition = ((j1 - j) * i2) / j2;
- if (flag) {
- }
- aBoolean972 = true;
- }
- }
- private boolean method66(int i, int j, int k, int id) {
- int j1 = worldController.method304(plane, k, j, i);
- if (i == -1)
- return false;
- int type = j1 & 0x1f;
- int face = j1 >> 6 & 3;
- if (type == 10 || type == 11 || type == 22) {
- ObjectDefinition class46 = ObjectDefinition.forID(id);
- int sizeX;
- int sizeY;
- if (face == 0 || face == 2) {
- sizeX = class46.anInt744;
- sizeY = class46.anInt761;
- } else {
- sizeX = class46.anInt761;
- sizeY = class46.anInt744;
- }
- int k2 = class46.anInt768;
- if (face != 0)
- k2 = (k2 << face & 0xf) + (k2 >> 4 - face);
- doWalkTo(2, face, 0, type + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
- } else {
- doWalkTo(2, face, 0, type + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
- }
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- return true;
- }
- private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k) {
- byte abyte0[] = null;
- int l = 5;
- try {
- if (decompressors[0] != null)
- abyte0 = decompressors[0].decompress(i);
- } catch (Exception _ex) {
- }
- if (abyte0 != null) {
- // aCRC32_930.reset();
- // aCRC32_930.update(abyte0);
- // int i1 = (int)aCRC32_930.getValue();
- // if(i1 != j)
- }
- if (abyte0 != null) {
- StreamLoader streamLoader = new StreamLoader(abyte0);
- return streamLoader;
- }
- int j1 = 0;
- while (abyte0 == null) {
- String s2 = "Unknown error";
- String request = "Requesting " + s;
- drawSmoothLoadingText(k, request);
- try {
- int k1 = 0;
- DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
- byte abyte1[] = new byte[6];
- datainputstream.readFully(abyte1, 0, 6);
- RSBuffer stream = new RSBuffer(abyte1);
- stream.currentOffset = 3;
- int i2 = stream.read3Bytes() + 6;
- int j2 = 6;
- abyte0 = new byte[i2];
- System.arraycopy(abyte1, 0, abyte0, 0, 6);
- while (j2 < i2) {
- int l2 = i2 - j2;
- if (l2 > 1000)
- l2 = 1000;
- int j3 = datainputstream.read(abyte0, j2, l2);
- if (j3 < 0) {
- s2 = "Length error: " + j2 + "/" + i2;
- throw new IOException("EOF");
- }
- j2 += j3;
- int k3 = (j2 * 100) / i2;
- if (k3 != k1)
- drawSmoothLoadingText(k, "Loading " + s + " - " + k3 + "%");
- k1 = k3;
- }
- datainputstream.close();
- try {
- if (decompressors[0] != null)
- decompressors[0].method234(abyte0.length, abyte0, i);
- } catch (Exception _ex) {
- decompressors[0] = null;
- }
- /*
- * if(abyte0 != null) { aCRC32_930.reset();
- * aCRC32_930.update(abyte0); int i3 =
- * (int)aCRC32_930.getValue(); if(i3 != j) { abyte0 = null;
- * j1++; s2 = "Checksum error: " + i3; } }
- */
- } catch (IOException ioexception) {
- if (s2.equals("Unknown error"))
- s2 = "Connection error";
- abyte0 = null;
- } catch (NullPointerException _ex) {
- s2 = "Null error";
- abyte0 = null;
- if (!Signlink.reporterror)
- return null;
- } catch (ArrayIndexOutOfBoundsException _ex) {
- s2 = "Bounds error";
- abyte0 = null;
- if (!Signlink.reporterror)
- return null;
- } catch (Exception _ex) {
- s2 = "Unexpected error";
- abyte0 = null;
- if (!Signlink.reporterror)
- return null;
- }
- if (abyte0 == null) {
- for (int l1 = l; l1 > 0; l1--) {
- if (j1 >= 3) {
- drawSmoothLoadingText(k, "Game updated - please reload page");
- l1 = 10;
- } else {
- drawSmoothLoadingText(k, s2 + " - Retrying in " + l1);
- }
- try {
- Thread.sleep(1000L);
- } catch (Exception _ex) {
- }
- }
- l *= 2;
- if (l > 60)
- l = 60;
- aBoolean872 = !aBoolean872;
- }
- }
- StreamLoader streamLoader_1 = new StreamLoader(abyte0);
- return streamLoader_1;
- }
- private StreamLoader streamLoaderFromFile(String file, String s, String s1, int j, int k) {
- byte abyte0[] = null;
- int l = 5;
- try {
- abyte0 = FileUtility.readFile(file);
- } catch (Exception _ex) {
- _ex.printStackTrace();
- }
- if (abyte0 != null) {
- // aCRC32_930.reset();
- // aCRC32_930.update(abyte0);
- // int i1 = (int)aCRC32_930.getValue();
- // if(i1 != j)
- }
- if (abyte0 != null) {
- StreamLoader streamLoader = new StreamLoader(abyte0);
- return streamLoader;
- }
- int j1 = 0;
- while (abyte0 == null) {
- String s2 = "Unknown error";
- String request = "Requesting " + s;
- drawSmoothLoadingText(k, request);
- try {
- int k1 = 0;
- DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
- byte abyte1[] = new byte[6];
- datainputstream.readFully(abyte1, 0, 6);
- RSBuffer stream = new RSBuffer(abyte1);
- stream.currentOffset = 3;
- int i2 = stream.read3Bytes() + 6;
- int j2 = 6;
- abyte0 = new byte[i2];
- System.arraycopy(abyte1, 0, abyte0, 0, 6);
- while (j2 < i2) {
- int l2 = i2 - j2;
- if (l2 > 1000)
- l2 = 1000;
- int j3 = datainputstream.read(abyte0, j2, l2);
- if (j3 < 0) {
- s2 = "Length error: " + j2 + "/" + i2;
- throw new IOException("EOF");
- }
- j2 += j3;
- int k3 = (j2 * 100) / i2;
- if (k3 != k1)
- drawSmoothLoadingText(k, "Loading " + s + " - " + k3 + "%");
- k1 = k3;
- }
- datainputstream.close();
- try {
- // if (decompressors[0] != null)
- // decompressors[0].method234(abyte0.length, abyte0, i);
- } catch (Exception _ex) {
- decompressors[0] = null;
- }
- /*
- * if(abyte0 != null) { aCRC32_930.reset();
- * aCRC32_930.update(abyte0); int i3 =
- * (int)aCRC32_930.getValue(); if(i3 != j) { abyte0 = null;
- * j1++; s2 = "Checksum error: " + i3; } }
- */
- } catch (IOException ioexception) {
- if (s2.equals("Unknown error"))
- s2 = "Connection error";
- abyte0 = null;
- } catch (NullPointerException _ex) {
- s2 = "Null error";
- abyte0 = null;
- if (!Signlink.reporterror)
- return null;
- } catch (ArrayIndexOutOfBoundsException _ex) {
- s2 = "Bounds error";
- abyte0 = null;
- if (!Signlink.reporterror)
- return null;
- } catch (Exception _ex) {
- s2 = "Unexpected error";
- abyte0 = null;
- if (!Signlink.reporterror)
- return null;
- }
- if (abyte0 == null) {
- for (int l1 = l; l1 > 0; l1--) {
- if (j1 >= 3) {
- drawSmoothLoadingText(k, "Game updated - please reload page");
- l1 = 10;
- } else {
- drawSmoothLoadingText(k, s2 + " - Retrying in " + l1);
- }
- try {
- Thread.sleep(1000L);
- } catch (Exception _ex) {
- }
- }
- l *= 2;
- if (l > 60)
- l = 60;
- aBoolean872 = !aBoolean872;
- }
- }
- StreamLoader streamLoader_1 = new StreamLoader(abyte0);
- return streamLoader_1;
- }
- private void dropClient() {
- if (anInt1011 > 0) {
- resetLogout();
- return;
- }
- DrawingArea.fillPixels(2, 229, 39, 0xffffff, 2); // white box around
- DrawingArea.drawPixels(3, 3, 227, 37, 0); // black fill
- regularText.drawText(0, "Connection lost.", 19, 120);
- regularText.drawText(0xffffff, "Connection lost.", 18, 119);
- regularText.drawText(0, "Please wait - attempting to reestablish.", 34, 117);
- regularText.drawText(0xffffff, "Please wait - attempting to reestablish.", 34, 116);
- aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics,
- frameMode == ScreenMode.FIXED ? 4 : 0);
- anInt1021 = 0;
- destX = 0;
- RSSocket rsSocket = socketStream;
- loggedIn = false;
- loginFailures = 0;
- login(myUsername, myPassword, myAuth, rememberPin, true);
- if (!loggedIn)
- resetLogout();
- try {
- rsSocket.close();
- } catch (Exception _ex) {
- }
- }
- public void setNorth() {
- anInt1278 = 0;
- anInt1131 = 0;
- anInt896 = 0;
- minimapInt1 = 0;
- minimapInt2 = 0;
- minimapInt3 = 0;
- }
- private void doAction(int i) {
- if (i < 0)
- return;
- /*
- * if (inputDialogState != 0) { inputDialogState = 0; inputTaken = true;
- * }
- */
- int j = menuActionCmd2[i];
- int k = menuActionCmd3[i];
- int cmd4 = menuActionCmd4[i];
- int l = menuActionID[i];
- int i1 = menuActionCmd1[i];
- int id = (i1 > 0x7fff ? cmd4 : i1 >> 14 & 0x7fff);
- if (l >= 2000)
- l -= 2000;
- gameframe.handleGameframeAction(l);
- MapRender.handleMapAction(l, cmd4);
- CombatOverlays.menuClick(l, j);
- if (k == 24630 || k == 24632) {
- if (inputDialogState == 3) {
- buttonclicked = false;
- totalItemResults = 0;
- amountOrNameInput = "";
- }
- }
- if (j == 22222) {
- inputTaken = true;
- messagePromptRaised = true;
- amountOrNameInput = "";
- promptInput = "";
- inputDialogState = 0;
- interfaceButtonAction = 6199;
- aString1121 = "Enter a name for the clan chat:";
- }
- if (j == 677) {
- inputTaken = true;
- messagePromptRaised = true;
- amountOrNameInput = "";
- promptInput = "";
- inputDialogState = 0;
- interfaceButtonAction = 6200;
- aString1121 = "Enter name of the player you would like kicked.";
- }
- if (l == 1315) {
- inputString = "[NOT]" + clanName;
- sendPacket(1003);
- }
- if (l == 1316) {
- inputString = "[REC]" + clanName;
- sendPacket(1003);
- }
- if (l == 1317) {
- inputString = "[COR]" + clanName;
- sendPacket(1003);
- }
- if (l == 1318) {
- inputString = "[SER]" + clanName;
- sendPacket(1003);
- }
- if (l == 1319) {
- inputString = "[LIE]" + clanName;
- sendPacket(1003);
- }
- if (l == 1320) {
- inputString = "[CAP]" + clanName;
- sendPacket(1003);
- }
- if (l == 1321) {
- inputString = "[GEN]" + clanName;
- sendPacket(1003);
- }
- if (l == 1251) {
- buttonclicked = false;
- stream.createFrame(204);
- stream.writeWord(GEItemId);
- }
- if (l == 851) {
- stream.createFrame(185);
- stream.writeWord(155);
- }
- if (l == 700) {
- if (tabInterfaceIDs[10] != -1) {
- if (tabID == 10) {
- showTabComponents = !showTabComponents;
- } else {
- showTabComponents = true;
- }
- tabID = 10;
- tabAreaAltered = true;
- }
- }
- if (l == 696) {
- setNorth();
- }
- if (l == 1506) { // Select quick prayers
- stream.createFrame(185);
- stream.writeWord(5001);
- }
- if (l == 104) {
- /*
- * spellID = k; if (!autoCast || (autocastId != spellID)) { autoCast
- * = true; autocastId = spellID; sendPacket185(autocastId, -1, 135);
- * // pushMessage("Autocast spell selected.", 0, ""); } else if
- * (autocastId == spellID) { setAutoCastOff(); }
- */
- setAutoCastOff();
- }
- if (l == 582) {
- Npc npc = npcArray[i1];
- if (npc != null) {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(57);
- stream.method432(anInt1285);
- stream.method432(i1);
- stream.method431(anInt1283);
- stream.method432(anInt1284);
- }
- }
- if (l == 234) {
- boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
- if (!flag1)
- flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(236);
- stream.method431(k + baseY);
- stream.method432(i1);
- stream.method431(j + baseX);
- }
- if (l == 62 && method66(i1, k, j, id)) {
- stream.createFrame(192);
- stream.writeWord(anInt1284);
- stream.writeWord(id);
- stream.method433(k + baseY);
- stream.method431(anInt1283);
- stream.method433(j + baseX);
- stream.writeWord(anInt1285);
- }
- if (l == 511) {
- boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
- if (!flag2)
- flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(25);
- stream.method431(anInt1284);
- stream.method432(anInt1285);
- stream.writeWord(i1);
- stream.method432(k + baseY);
- stream.method433(anInt1283);
- stream.writeWord(j + baseX);
- }
- if (l == 74) {
- stream.createFrame(122);
- stream.writeWord(k);
- stream.writeWord(j);/// XXX: ruse changed this packet
- stream.method432(i1);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if (RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if (l == 222) {
- stream.createFrame(222);
- stream.writeWord(k);
- stream.writeByte(currentActionMenu);
- }
- if (l == 315) {
- RSInterface class9 = RSInterface.interfaceCache[k];
- boolean flag8 = true;
- if (class9.contentType > 0)
- flag8 = promptUserForInput(class9);
- if (flag8) {
- switch (k) {
- case 24654:
- amountOrNameInput = "";
- totalItemResults = 0;
- buttonclicked = inputDialogState == 3 ? false : true;
- inputDialogState = inputDialogState == 3 ? 0 : 3;
- break;
- case 19144:
- sendFrame248(15106, 3213);
- openInterface(15106);
- inputTaken = true;
- break;
- default:
- openLink(k);
- MikeysInterfaces.buttonClicked(k);
- stream.createFrame(185);
- stream.writeWord(k);
- break;
- }
- }
- }
- if (l == 561) {
- Player player = playerArray[i1];
- if (player != null) {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false,
- player.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- anInt1188 += i1;
- if (anInt1188 >= 90) {
- stream.createFrame(136);
- anInt1188 = 0;
- }
- stream.createFrame(128);
- stream.writeWord(i1);
- }
- }
- if (l == 20) {
- Npc class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
- if (class30_sub2_sub4_sub1_sub1_1 != null) {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_1.smallY[0],
- myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_1.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(155);
- stream.method431(i1);
- }
- }
- if (l == 779) {
- Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
- if (class30_sub2_sub4_sub1_sub2_1 != null) {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_1.smallY[0],
- myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_1.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(153);
- stream.method431(i1);
- }
- }
- if (l == 519)
- if (!menuOpen)
- worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
- else
- worldController.method312(k - 4, j - 4);
- if (l == 1062) {
- anInt924 += baseX;
- if (anInt924 >= 113) {
- stream.createFrame(183);
- stream.writeDWordBigEndian(0xe63271);
- anInt924 = 0;
- }
- method66(i1, k, j, id);
- stream.createFrame(228);
- stream.method432(id);
- stream.method432(k + baseY);
- stream.writeWord(j + baseX);
- }
- if (l == 679 && !aBoolean1149) {
- stream.createFrame(40);
- stream.writeWord(k);
- aBoolean1149 = true;
- }
- if (l == 431) {
- stream.createFrame(129);
- stream.method432(j);
- stream.writeWord(k);
- stream.method432(i1);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if (RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if (l == 337 || l == 42 || l == 792 || l == 322) {
- String s = menuActionName[i];
- int k1 = s.indexOf("@whi@");
- if (k1 != -1) {
- long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
- if (l == 337)
- addFriend(l3);
- if (l == 42)
- addIgnore(l3);
- if (l == 792)
- delFriend(l3);
- if (l == 322)
- delIgnore(l3);
- }
- }
- if (l == 53) {
- stream.createFrame(135);
- stream.method431(j);
- stream.method432(k);
- stream.method432(i1);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if (RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if (l == 54) {
- stream.createFrame(135);
- stream.method431(j);
- stream.method432(11);
- stream.method431(i1);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if (RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if (l == 539) {
- stream.createFrame(16);
- stream.method432(i1);
- stream.method433(j);
- stream.method433(k);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if (RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if (l == 484 || l == 6) {
- String s1 = menuActionName[i];
- int l1 = s1.indexOf("@whi@");
- if (l1 != -1) {
- s1 = s1.substring(l1 + 5).trim();
- String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
- boolean flag9 = false;
- for (int j3 = 0; j3 < playerCount; j3++) {
- Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
- if (class30_sub2_sub4_sub1_sub2_7 == null || class30_sub2_sub4_sub1_sub2_7.name == null
- || !class30_sub2_sub4_sub1_sub2_7.name.equalsIgnoreCase(s7))
- continue;
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_7.smallY[0],
- myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_7.smallX[0]);
- if (l == 484) {
- stream.createFrame(139);
- stream.method431(playerIndices[j3]);
- }
- if (l == 6) {
- anInt1188 += i1;
- if (anInt1188 >= 90) {
- stream.createFrame(136);
- anInt1188 = 0;
- }
- stream.createFrame(128);
- stream.writeWord(playerIndices[j3]);
- }
- flag9 = true;
- break;
- }
- if (!flag9)
- pushMessage("Unable to find " + s7, 0, "");
- }
- }
- if (l == 870) {
- stream.createFrame(53);
- stream.writeWord(j);
- stream.method432(anInt1283);
- stream.method433(i1);
- stream.writeWord(anInt1284);
- stream.method431(anInt1285);
- stream.writeWord(k);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if (RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if (l == 847) {
- stream.createFrame(87);
- stream.method432(i1);
- stream.writeWord(k);
- stream.method432(j);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if (RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if (l == 626) {
- RSInterface class9_1 = RSInterface.interfaceCache[k];
- spellSelected = 1;
- spellID = class9_1.id;
- anInt1137 = k;
- spellUsableOn = class9_1.spellUsableOn;
- itemSelected = 0;
- String s4 = class9_1.selectedActionName;
- if (s4.indexOf(" ") != -1)
- s4 = s4.substring(0, s4.indexOf(" "));
- String s8 = class9_1.selectedActionName;
- if (s8.indexOf(" ") != -1)
- s8 = s8.substring(s8.indexOf(" ") + 1);
- spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
- // class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265,
- // 0xffffff);
- // class9_1.sprite1.drawSprite(200,200);
- // System.out.println("Sprite: " + class9_1.sprite1.toString());
- if (spellUsableOn == 16) {
- tabID = 3;
- tabAreaAltered = true;
- }
- return;
- }
- if (l == 78) {
- stream.createFrame(117);
- stream.method433(k);
- stream.method432(i1);
- stream.method431(j);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if (RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if (l == 27) {
- Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
- if (class30_sub2_sub4_sub1_sub2_2 != null) {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_2.smallY[0],
- myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_2.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- anInt986 += i1;
- if (anInt986 >= 54) {
- stream.createFrame(189);
- stream.writeByte(234);
- anInt986 = 0;
- }
- stream.createFrame(73);
- stream.method431(i1);
- }
- }
- if (l == 213) {
- boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
- if (!flag3)
- flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(79);
- stream.method431(k + baseY);
- stream.writeWord(i1);
- stream.method432(j + baseX);
- }
- if (l == 632) {
- stream.createFrame(145);
- stream.method432(k);
- stream.method432(j);
- stream.method432(i1);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if (RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if (l == 1004) {
- if (tabInterfaceIDs[10] != -1) {
- tabID = 10;
- tabAreaAltered = true;
- }
- }
- if (l == 1003) {
- clanChatMode = 2;
- inputTaken = true;
- }
- if (l == 1002) {
- clanChatMode = 1;
- inputTaken = true;
- }
- if (l == 1001) {
- clanChatMode = 0;
- inputTaken = true;
- }
- if (l == 997) {
- publicChatMode = 3;
- inputTaken = true;
- }
- if (l == 996) {
- publicChatMode = 2;
- inputTaken = true;
- }
- if (l == 995) {
- publicChatMode = 1;
- inputTaken = true;
- }
- if (l == 994) {
- publicChatMode = 0;
- inputTaken = true;
- }
- if (l == 992) {
- privateChatMode = 2;
- inputTaken = true;
- }
- if (l == 991) {
- privateChatMode = 1;
- inputTaken = true;
- }
- if (l == 990) {
- privateChatMode = 0;
- inputTaken = true;
- }
- if (l == 987) {
- tradeMode = 2;
- inputTaken = true;
- }
- if (l == 986) {
- tradeMode = 1;
- inputTaken = true;
- }
- if (l == 985) {
- tradeMode = 0;
- inputTaken = true;
- }
- if (l == 493) {
- stream.createFrame(75);
- stream.method433(k);
- stream.method431(j);
- stream.method432(i1);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if (RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if (l == 652) {
- boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
- if (!flag4)
- flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(156);
- stream.method432(j + baseX);
- stream.method431(k + baseY);
- stream.method433(i1);
- }
- if (l == 94) {
- boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
- if (!flag5)
- flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(181);
- stream.method431(k + baseY);
- stream.writeWord(i1);
- stream.method431(j + baseX);
- stream.method432(anInt1137);
- }
- if (l == 646) {
- openLink(k);
- MikeysInterfaces.buttonClicked(k);
- stream.createFrame(185);
- stream.writeWord(k);
- RSInterface class9_2 = RSInterface.interfaceCache[k];
- if (class9_2.clickingChangesConfig) {
- if (class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
- int i2 = class9_2.valueIndexArray[0][1];
- if (variousSettings[i2] != class9_2.anIntArray212[0]) {
- variousSettings[i2] = class9_2.anIntArray212[0];
- method33(i2);
- }
- }
- }
- }
- if (l == 225) {
- Npc class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
- if (class30_sub2_sub4_sub1_sub1_2 != null) {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_2.smallY[0],
- myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_2.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- anInt1226 += i1;
- if (anInt1226 >= 85) {
- stream.createFrame(230);
- stream.writeByte(239);
- anInt1226 = 0;
- }
- stream.createFrame(17);
- stream.method433(i1);
- }
- }
- if (l == 965) {
- Npc class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
- if (class30_sub2_sub4_sub1_sub1_3 != null) {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_3.smallY[0],
- myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_3.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- anInt1134++;
- if (anInt1134 >= 96) {
- stream.createFrame(152);
- stream.writeByte(88);
- anInt1134 = 0;
- }
- stream.createFrame(21);
- stream.writeWord(i1);
- }
- }
- if (l == 413) {
- Npc class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
- if (class30_sub2_sub4_sub1_sub1_4 != null) {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_4.smallY[0],
- myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_4.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(131);
- stream.method433(i1);
- stream.method432(anInt1137);
- }
- }
- if (l == 200)
- clearTopInterfaces();
- if (l == 1025) {
- Npc class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
- if (class30_sub2_sub4_sub1_sub1_5 != null) {
- NpcDefinition entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
- if (entityDef.childrenIDs != null)
- entityDef = entityDef.method161();
- if (entityDef != null) {
- stream.createFrame(6);
- stream.method431(entityDef.id);
- }
- }
- }
- if (l == 900) {
- method66(i1, k, j, id);
- stream.createFrame(252);
- stream.method433(id);
- stream.method431(k + baseY);
- stream.method432(j + baseX);
- }
- if (l == 412) {
- Npc class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
- if (class30_sub2_sub4_sub1_sub1_6 != null) {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_6.smallY[0],
- myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_6.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(72);
- stream.method432(i1);
- }
- }
- if (l == 365) {
- Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
- if (class30_sub2_sub4_sub1_sub2_3 != null) {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_3.smallY[0],
- myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_3.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(249);
- stream.method432(i1);
- stream.method431(anInt1137);
- }
- }
- if (l == 729) {
- Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
- if (class30_sub2_sub4_sub1_sub2_4 != null) {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_4.smallY[0],
- myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_4.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(39);
- stream.method431(i1);
- }
- }
- if (l == 577) {
- Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
- if (class30_sub2_sub4_sub1_sub2_5 != null) {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_5.smallY[0],
- myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_5.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(139);
- stream.method431(i1);
- }
- }
- if (l == 956 && method66(i1, k, j, id)) {
- stream.createFrame(35);
- stream.method431(j + baseX);
- stream.method432(anInt1137);
- stream.method432(k + baseY);
- stream.method431(id);
- }
- if (l == 567) {
- boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
- if (!flag6)
- flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(23);
- stream.method431(k + baseY);
- stream.method431(i1);
- stream.method431(j + baseX);
- }
- if (l == 867) {
- if ((i1 & 3) == 0)
- anInt1175++;
- if (anInt1175 >= 59) {
- stream.createFrame(200);
- stream.writeWord(25501);
- anInt1175 = 0;
- }
- stream.createFrame(43);
- stream.method431(k);
- stream.method432(i1);
- stream.method432(j);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if (RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if (l == 543) {
- stream.createFrame(237);
- stream.writeWord(j);
- stream.method432(i1);
- stream.writeWord(k);
- stream.method432(anInt1137);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if (RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if (l == 606) {
- String s2 = menuActionName[i];
- int j2 = s2.indexOf("@whi@");
- if (j2 != -1)
- if (openInterfaceID == -1) {
- clearTopInterfaces();
- reportAbuseInput = s2.substring(j2 + 5).trim();
- canMute = false;
- for (int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++) {
- if (RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
- continue;
- reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
- break;
- }
- } else {
- pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
- }
- }
- if (l == 491) {
- Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
- if (class30_sub2_sub4_sub1_sub2_6 != null) {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_6.smallY[0],
- myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_6.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(14);
- stream.method432(anInt1284);
- stream.writeWord(i1);
- stream.writeWord(anInt1285);
- stream.method431(anInt1283);
- }
- }
- if (l == 639) {
- String s3 = menuActionName[i];
- int k2 = s3.indexOf("@whi@");
- if (k2 != -1) {
- long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
- int k3 = -1;
- for (int i4 = 0; i4 < friendsCount; i4++) {
- if (friendsListAsLongs[i4] != l4)
- continue;
- k3 = i4;
- break;
- }
- if (k3 != -1 && friendsNodeIDs[k3] > 0) {
- inputTaken = true;
- inputDialogState = 0;
- messagePromptRaised = true;
- promptInput = "";
- friendsListAction = 3;
- aLong953 = friendsListAsLongs[k3];
- aString1121 = "Enter message to send to " + friendsList[k3];
- }
- }
- }
- if (l == 454) {
- stream.createFrame(41);
- stream.method432(i1);
- stream.method432(j);
- stream.method432(k);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if (RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if (RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if (l == 478) {
- Npc class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
- if (class30_sub2_sub4_sub1_sub1_7 != null) {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_7.smallY[0],
- myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_7.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- if ((i1 & 3) == 0)
- anInt1155++;
- if (anInt1155 >= 53) {
- stream.createFrame(85);
- stream.writeByte(66);
- anInt1155 = 0;
- }
- stream.createFrame(18);
- stream.method431(i1);
- }
- }
- if (l == 113) {
- method66(i1, k, j, id);
- stream.createFrame(70);
- stream.method431(j + baseX);
- stream.writeWord(k + baseY);
- stream.method433(id);
- }
- if (l == 872) {
- method66(i1, k, j, id);
- stream.createFrame(234);
- stream.method433(j + baseX);
- stream.method432(id);
- stream.method433(k + baseY);
- }
- if (l == 502) {
- method66(i1, k, j, id);
- stream.createFrame(132);
- stream.method433(j + baseX);
- stream.writeDWord(id);
- stream.method432(k + baseY);
- }
- if (l == 1125) {
- ItemDefinition itemDef = ItemDefinition.forID(i1);
- /*
- * RSInterface class9_4 = RSInterface.interfaceCache[k]; String s5;
- * if (class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0) s5
- * = class9_4.invStackSizes[j] + " x " + itemDef.name; else if
- * (itemDef.description != null) s5 = new
- * String(itemDef.description); else s5 = "It's a " + itemDef.name +
- * "."; pushMessage(s5, 0, "");
- */
- RSInterface class9_4 = RSInterface.interfaceCache[k];
- stream.createFrame(2); // examine item
- stream.method432(itemDef.id);
- stream.writeDWord(class9_4.invStackSizes[j]);
- }
- if (l == 169) {
- openLink(k);
- MikeysInterfaces.buttonClicked(k);
- stream.createFrame(185);
- stream.writeWord(k);
- RSInterface class9_3 = RSInterface.interfaceCache[k];
- if (class9_3.clickingChangesConfig) {
- if (class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
- int l2 = class9_3.valueIndexArray[0][1];
- variousSettings[l2] = 1 - variousSettings[l2];
- method33(l2);
- MikeysInterfaces.configButton(l2, variousSettings[l2]);
- }
- }
- }
- if (l == 447) {
- itemSelected = 1;
- anInt1283 = j;
- anInt1284 = k;
- anInt1285 = i1;
- selectedItemName = ItemDefinition.forID(i1).name;
- spellSelected = 0;
- return;
- }
- if (l == 1226) {
- int j1 = id;
- ObjectDefinition class46 = ObjectDefinition.forID(j1);
- String s10;
- if (class46.description != null)
- s10 = new String(class46.description);
- else
- s10 = "It's a " + class46.name + ".";
- pushMessage(s10, 0, "");
- }
- if (l == 244) {
- boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
- if (!flag7)
- flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(253);
- stream.method431(j + baseX);
- stream.method433(k + baseY);
- stream.method432(i1);
- }
- if (l == 1448) {
- ItemDefinition itemDef_1 = ItemDefinition.forID(i1);
- String s6;
- stream.createFrame(2); // examine item
- stream.method432(itemDef_1.id);
- stream.writeDWord(cmd4);
- /*
- * if (itemDef_1.description != null) s6 = new
- * String(itemDef_1.description); else s6 = "It's a " +
- * itemDef_1.name + "."; pushMessage(s6, 0, "");
- */
- }
- itemSelected = 0;
- spellSelected = 0;
- }
- @SuppressWarnings("unused")
- private void method70() {
- anInt1251 = 0;
- int j = (myPlayer.x >> 7) + baseX;
- int k = (myPlayer.y >> 7) + baseY;
- if (j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
- anInt1251 = 1;
- if (j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
- anInt1251 = 1;
- if (anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
- anInt1251 = 0;
- }
- public void run() {
- /*
- * if (drawFlames) { drawFlames(); } else {
- */
- super.run();
- // }
- }
- private void build3dScreenMenu() {
- if (itemSelected == 0 && spellSelected == 0) {
- menuActionName[menuActionRow] = "Walk here";
- menuActionID[menuActionRow] = 519;
- menuActionCmd2[menuActionRow] = super.mouseX;
- menuActionCmd3[menuActionRow] = super.mouseY;
- menuActionRow++;
- }
- int j = -1;
- for (int k = 0; k < Model.anInt1687; k++) {
- int l = Model.anIntArray1688[k];// data
- int i1 = l & 0x7f;// x
- int j1 = l >> 7 & 0x7f;// y
- int k1 = l >> 29 & 3;// face
- int l1 = -1;// objId
- if (k1 != 2)
- l1 = l >> 14 & 0x7fff;
- if (l == j)
- continue;
- j = l;
- if (k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0) {
- l1 = Model.anIntArray1689[k];
- ObjectDefinition class46 = ObjectDefinition.forID(l1);
- if (class46.childrenIDs != null)
- class46 = class46.method580();
- if (class46 == null)
- continue;
- if (itemSelected == 1) {
- menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
- menuActionID[menuActionRow] = 62;
- menuActionCmd1[menuActionRow] = l;
- menuActionCmd2[menuActionRow] = i1;
- menuActionCmd3[menuActionRow] = j1;
- menuActionCmd4[menuActionRow] = l1;
- menuActionRow++;
- } else if (spellSelected == 1) {
- if ((spellUsableOn & 4) == 4) {
- menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
- menuActionID[menuActionRow] = 956;
- menuActionCmd1[menuActionRow] = l;
- menuActionCmd2[menuActionRow] = i1;
- menuActionCmd3[menuActionRow] = j1;
- menuActionCmd4[menuActionRow] = l1;
- menuActionRow++;
- }
- } else {
- if (class46.actions != null) {
- for (int i2 = 4; i2 >= 0; i2--)
- if (class46.actions[i2] != null) {
- menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
- if (i2 == 0)
- menuActionID[menuActionRow] = 502;
- if (i2 == 1)
- menuActionID[menuActionRow] = 900;
- if (i2 == 2)
- menuActionID[menuActionRow] = 113;
- if (i2 == 3)
- menuActionID[menuActionRow] = 872;
- if (i2 == 4)
- menuActionID[menuActionRow] = 1062;
- menuActionCmd1[menuActionRow] = l;
- menuActionCmd2[menuActionRow] = i1;
- menuActionCmd3[menuActionRow] = j1;
- menuActionCmd4[menuActionRow] = l1;
- menuActionRow++;
- }
- }
- // menuActionName[menuActionRow] = "Examine @cya@" +
- // class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" +
- // (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
- menuActionName[menuActionRow] = "Examine @cya@" + class46.name
- + (clientData ? ", ID: " + class46.type : "");
- menuActionID[menuActionRow] = 1226;
- menuActionCmd1[menuActionRow] = class46.type << 14;
- menuActionCmd2[menuActionRow] = i1;
- menuActionCmd3[menuActionRow] = j1;
- menuActionCmd4[menuActionRow] = l1;
- menuActionRow++;
- }
- }
- if (k1 == 1) {
- Npc npc = npcArray[l1];
- try {
- if (npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64) {
- for (int j2 = 0; j2 < npcCount; j2++) {
- Npc npc2 = npcArray[npcIndices[j2]];
- if (npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x
- && npc2.y == npc.y)
- buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
- }
- for (int l2 = 0; l2 < playerCount; l2++) {
- Player player = playerArray[playerIndices[l2]];
- if (player != null && player.x == npc.x && player.y == npc.y)
- buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
- }
- }
- boolean disableActionsRendering = isSummon(npc);
- if (disableActionsRendering) {
- if (mySummonIndex == npc.serverIndex) {
- disableActionsRendering = false;
- }
- }
- if (!disableActionsRendering) {
- buildAtNPCMenu(npc.desc, l1, j1, i1);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- if (k1 == 0) {
- Player player = playerArray[l1];
- if ((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
- for (int k2 = 0; k2 < npcCount; k2++) {
- Npc class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
- if (class30_sub2_sub4_sub1_sub1_2 != null && class30_sub2_sub4_sub1_sub1_2.desc.aByte68 == 1
- && class30_sub2_sub4_sub1_sub1_2.x == player.x
- && class30_sub2_sub4_sub1_sub1_2.y == player.y) {
- boolean disableActionsRendering = isSummon(class30_sub2_sub4_sub1_sub1_2);
- if (disableActionsRendering) {
- if (mySummonIndex == class30_sub2_sub4_sub1_sub1_2.serverIndex) {
- disableActionsRendering = false;
- }
- }
- if (!disableActionsRendering) {
- buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
- }
- }
- }
- for (int i3 = 0; i3 < playerCount; i3++) {
- Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
- if (class30_sub2_sub4_sub1_sub2_2 != null && class30_sub2_sub4_sub1_sub2_2 != player
- && class30_sub2_sub4_sub1_sub2_2.x == player.x
- && class30_sub2_sub4_sub1_sub2_2.y == player.y)
- buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
- }
- }
- buildAtPlayerMenu(i1, l1, player, j1);
- }
- if (k1 == 3) {
- NodeList class19 = groundArray[plane][i1][j1];
- if (class19 != null) {
- for (Item item = (Item) class19.getFirst(); item != null; item = (Item) class19.getNext()) {
- ItemDefinition itemDef = ItemDefinition.forID(item.ID);
- if (itemSelected == 1) {
- menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
- menuActionID[menuActionRow] = 511;
- menuActionCmd1[menuActionRow] = item.ID;
- menuActionCmd2[menuActionRow] = i1;
- menuActionCmd3[menuActionRow] = j1;
- menuActionRow++;
- } else if (spellSelected == 1) {
- if ((spellUsableOn & 1) == 1) {
- menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
- menuActionID[menuActionRow] = 94;
- menuActionCmd1[menuActionRow] = item.ID;
- menuActionCmd2[menuActionRow] = i1;
- menuActionCmd3[menuActionRow] = j1;
- menuActionRow++;
- }
- } else {
- for (int j3 = 4; j3 >= 0; j3--)
- if (itemDef.groundActions != null && itemDef.groundActions[j3] != null) {
- menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
- if (j3 == 0)
- menuActionID[menuActionRow] = 652;
- if (j3 == 1)
- menuActionID[menuActionRow] = 567;
- if (j3 == 2)
- menuActionID[menuActionRow] = 234;
- if (j3 == 3)
- menuActionID[menuActionRow] = 244;
- if (j3 == 4)
- menuActionID[menuActionRow] = 213;
- menuActionCmd1[menuActionRow] = item.ID;
- menuActionCmd2[menuActionRow] = i1;
- menuActionCmd3[menuActionRow] = j1;
- menuActionRow++;
- } else if (j3 == 2) {
- menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
- menuActionID[menuActionRow] = 234;
- menuActionCmd1[menuActionRow] = item.ID;
- menuActionCmd2[menuActionRow] = i1;
- menuActionCmd3[menuActionRow] = j1;
- menuActionRow++;
- }
- menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
- menuActionID[menuActionRow] = 1448;
- menuActionCmd1[menuActionRow] = item.ID;
- menuActionCmd2[menuActionRow] = i1;
- menuActionCmd3[menuActionRow] = j1;
- menuActionCmd4[menuActionRow] = item.itemAmount;
- menuActionRow++;
- }
- }
- }
- }
- }
- }
- public void cleanUpForQuit() {
- Signlink.reporterror = false;
- try {
- if (socketStream != null) {
- socketStream.close();
- }
- } catch (Exception _ex) {
- }
- socketStream = null;
- stopMidi();
- if (mouseDetection != null)
- mouseDetection.running = false;
- mouseDetection = null;
- onDemandFetcher.disable();
- onDemandFetcher = null;
- aStream_834 = null;
- stream = null;
- aStream_847 = null;
- inStream = null;
- anIntArray1234 = null;
- aByteArrayArray1183 = null;
- aByteArrayArray1247 = null;
- anIntArray1235 = null;
- anIntArray1236 = null;
- intGroundArray = null;
- byteGroundArray = null;
- worldController = null;
- aClass11Array1230 = null;
- anIntArrayArray901 = null;
- anIntArrayArray825 = null;
- bigX = null;
- bigY = null;
- aByteArray912 = null;
- aRSImageProducer_1163 = null;
- leftFrame = null;
- topFrame = null;
- aRSImageProducer_1164 = null;
- aRSImageProducer_1165 = null;
- aRSImageProducer_1166 = null;
- aRSImageProducer_1125 = null;
- /* Null pointers for custom sprites */
- loginSprites = null;
- mapBack = null;
- mapBack2 = null;
- sideIcons = null;
- compass = null;
- hitMarks = null;
- headIcons = null;
- skullIcons = null;
- headIconsHint = null;
- crosses = null;
- mapDotItem = null;
- mapDotNPC = null;
- mapDotPlayer = null;
- mapDotFriend = null;
- mapDotTeam = null;
- mapScenes = null;
- mapFunctions = null;
- anIntArrayArray929 = null;
- playerArray = null;
- playerIndices = null;
- anIntArray894 = null;
- aStreamArray895s = null;
- anIntArray840 = null;
- npcArray = null;
- npcIndices = null;
- groundArray = null;
- aClass19_1179 = null;
- aClass19_1013 = null;
- aClass19_1056 = null;
- menuActionCmd2 = null;
- menuActionCmd3 = null;
- menuActionCmd4 = null;
- menuActionID = null;
- menuActionCmd1 = null;
- menuActionName = null;
- variousSettings = null;
- anIntArray1072 = null;
- anIntArray1073 = null;
- aClass30_Sub2_Sub1_Sub1Array1140 = null;
- minimapImage = null;
- friendsList = null;
- friendsListAsLongs = null;
- friendsNodeIDs = null;
- aRSImageProducer_1110 = null;
- aRSImageProducer_1111 = null;
- aRSImageProducer_1107 = null;
- aRSImageProducer_1108 = null;
- aRSImageProducer_1109 = null;
- aRSImageProducer_1112 = null;
- aRSImageProducer_1113 = null;
- aRSImageProducer_1114 = null;
- aRSImageProducer_1115 = null;
- multiOverlay = null;
- nullLoader();
- ObjectDefinition.nullLoader();
- NpcDefinition.nullLoader();
- ItemDefinition.nullLoader();
- Floor.cache = null;
- IdentityKit.cache = null;
- RSInterface.interfaceCache = null;
- Animation.nullLoader();
- SpotAnim.nullLoader();
- SpotAnim.aMRUNodes_415 = null;
- Varp.cache = null;
- super.fullGameScreen = null;
- Player.mruNodes = null;
- Texture.nullLoader();
- WorldController.nullLoader();
- Model.nullLoader();
- Class36.nullLoader();
- System.gc();
- }
- Component getGameComponent() {
- if (Signlink.mainapp != null)
- return Signlink.mainapp;
- if (super.gameFrame != null)
- return super.gameFrame;
- else
- return this;
- }
- private String tabName = null;
- private ArrayList<String> getPrivateMessageNames() {
- ArrayList<String> names = new ArrayList<>();
- for (int i = 0; i < chatMessages.length; i++) {
- if (chatMessages[i] == null) {
- continue;
- }
- int type = chatTypes[i];
- String name = chatNames[i];
- if (name == null || (type != 3 && type != 7)) {
- continue;
- }
- for (int k = 0; k < 20; k++) {
- String crown = "@cr" + k + "@";
- if (name.startsWith(crown)) {
- name = name.substring(crown.length());
- }
- }
- String cleanName = name.toLowerCase().trim();
- if (cleanName.isEmpty() || names.contains(cleanName)) {
- continue;
- }
- names.add(cleanName);
- }
- return names;
- }
- public void tabToReplyPm() {
- ArrayList<String> names = getPrivateMessageNames();
- if (!messagePromptRaised) {
- tabName = null;
- }
- if (tabName != null) {
- boolean found = false;
- for (int i = 0; i < names.size(); i++) {
- String name = names.get(i);
- if (found) {
- tabName = name;
- break;
- }
- if (!name.equalsIgnoreCase(tabName)) {
- continue;
- }
- found = true;
- tabName = null;
- }
- } else {
- tabName = names.isEmpty() ? null : names.get(0);
- }
- inputTaken = false;
- friendsListAction = 0;
- messagePromptRaised = false;
- try {
- if (tabName == null) {
- pushMessage("You have not recieved any messages.", 0, "");
- } else {
- long namel = TextClass.longForName(tabName.trim());
- int node = -1;
- for (int count = 0; count < friendsListAsLongs.length; count++) {
- if (friendsListAsLongs[count] != namel)
- continue;
- node = count;
- break;
- }
- if (privateChatMode != 0 && node == -1) {
- pushMessage("Turn your private chat to on or add this player to message them.", 0, "");
- return;
- }
- inputTaken = true;
- inputDialogState = 0;
- messagePromptRaised = true;
- promptInput = "";
- friendsListAction = 3;
- aLong953 = namel;
- aString1121 = "Enter message to send to " + TextClass.fixName(TextClass.nameForLong(namel));
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- private void method73() {
- do {
- int j = readChar(-796);
- if (j == -1)
- break;
- if (backDialogID != -1 && j == 32 && !aBoolean1149) {
- int[] dialogues = { 4885, 4890, 4896, 4903, 971, 976, 982, 989, 356 + 3 };
- int[] continueComponents = { 4907, 4899, 4892, 4886 };
- for (int component : continueComponents) {
- if (RSInterface.get(component).anInt263 != 0 || RSInterface.get(component).anInt265 != 0) {
- return;
- }
- }
- for (int dialogue : dialogues) {
- if (backDialogID == dialogue - 3) {
- stream.createFrame(40);
- stream.writeWord(0);
- aBoolean1149 = true;
- return;
- }
- }
- }
- if (openInterfaceID != -1) {
- if (openInterfaceID == reportAbuseInterfaceID) {
- if (j == 8 && reportAbuseInput.length() > 0)
- reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
- if ((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32)
- && reportAbuseInput.length() < 12)
- reportAbuseInput += (char) j;
- return;
- }
- try {
- RSInterface open = RSInterface.get(openInterfaceID);
- if (open.children != null) {
- for (int i = 0; i < open.children.length; i++) {
- RSInterface child = RSInterface.get(open.children[i]);
- if (child == null)
- continue;
- if (child.inputField) {
- if (j == 8) {
- if (child.inputFieldString.length() > 0) {
- if (child.inputFieldString.equalsIgnoreCase("enter a name to search"))
- return;
- child.inputFieldString = child.inputFieldString.substring(0,
- child.inputFieldString.length() - 1);
- if (child.inputFieldString.length() == 0) {
- child.inputFieldString = "Enter a name to search";
- }
- MikeysInterfaces.inputFieldEdited(open.children[i]);
- }
- } else {
- if (j >= 32 && j <= 122) {
- if (child.inputFieldString.equalsIgnoreCase("enter a name to search"))
- child.inputFieldString = "";
- if (child.inputFieldString.length() < 21) {
- child.inputFieldString += (char) j;
- MikeysInterfaces.inputFieldEdited(open.children[i]);
- }
- }
- }
- return;
- }
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- if (messagePromptRaised) {
- if (j >= 32 && j <= 122 && promptInput.length() < 80) {
- promptInput += (char) j;
- inputTaken = true;
- }
- if (j == 8 && promptInput.length() > 0) {
- promptInput = promptInput.substring(0, promptInput.length() - 1);
- inputTaken = true;
- }
- if (j == 13 || j == 10) {
- messagePromptRaised = false;
- inputTaken = true;
- if (friendsListAction == 1) {
- long l = TextClass.longForName(promptInput);
- addFriend(l);
- }
- if (friendsListAction == 2 && friendsCount > 0) {
- long l1 = TextClass.longForName(promptInput);
- delFriend(l1);
- }
- if (friendsListAction == 3 && promptInput.length() > 0) {
- tabName = null;
- stream.createFrame(126);
- stream.writeByte(0);
- int k = stream.currentOffset;
- stream.writeQWord(aLong953);
- TextInput.method526(promptInput, stream);
- stream.writeBytes(stream.currentOffset - k);
- promptInput = TextInput.processText(promptInput);
- // promptInput = Censor.doCensor(promptInput);
- pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
- if (privateChatMode == 2) {
- privateChatMode = 1;
- stream.createFrame(95);
- stream.writeByte(publicChatMode);
- stream.writeByte(privateChatMode);
- stream.writeByte(tradeMode);
- }
- }
- if (friendsListAction == 4 && ignoreCount < 100) {
- long l2 = TextClass.longForName(promptInput);
- addIgnore(l2);
- }
- if (friendsListAction == 5 && ignoreCount > 0) {
- long l3 = TextClass.longForName(promptInput);
- delIgnore(l3);
- }
- if (friendsListAction == 6) {
- long l3 = TextClass.longForName(promptInput);
- chatJoin(l3);
- }
- }
- } else if (inputDialogState == 1) {
- if (j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
- amountOrNameInput += (char) j;
- inputTaken = true;
- }
- if ((!amountOrNameInput.toLowerCase().contains("k") && !amountOrNameInput.toLowerCase().contains("m")
- && !amountOrNameInput.toLowerCase().contains("b")) && (j == 107 || j == 109 || j == 98)) {
- amountOrNameInput += (char) j;
- inputTaken = true;
- }
- if (j == 8 && amountOrNameInput.length() > 0) {
- amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
- inputTaken = true;
- }
- if (j == 13 || j == 10) {
- if (amountOrNameInput.length() > 0) {
- if (amountOrNameInput.toLowerCase().contains("k")) {
- amountOrNameInput = amountOrNameInput.replaceAll("k", "000");
- } else if (amountOrNameInput.toLowerCase().contains("m")) {
- amountOrNameInput = amountOrNameInput.replaceAll("m", "000000");
- } else if (amountOrNameInput.toLowerCase().contains("b")) {
- amountOrNameInput = amountOrNameInput.replaceAll("b", "000000000");
- }
- long amount = 0;
- try {
- amount = Long.parseLong(amountOrNameInput);
- if (amount > Integer.MAX_VALUE)
- amount = Integer.MAX_VALUE;
- stream.createFrame(208);
- stream.writeDWord((int) amount);
- } catch (NumberFormatException e) {
- }
- }
- inputDialogState = 0;
- inputTaken = true;
- }
- } else if (inputDialogState == 3) {
- if (j == 10) {
- totalItemResults = 0;
- amountOrNameInput = "";
- inputDialogState = 0;
- inputTaken = true;
- }
- if (j == 13 || j == 10) {
- if (amountOrNameInput.length() == 0) {
- buttonclicked = false;
- interfaceButtonAction = 0;
- }
- }
- if (j >= 32 && j <= 122 && amountOrNameInput.length() < 40) {
- amountOrNameInput += (char) j;
- inputTaken = true;
- }
- if (j == 8 && amountOrNameInput.length() > 0) {
- amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
- inputTaken = true;
- }
- } else if (inputDialogState == 2) {
- if (j >= 32 && j <= 122 && amountOrNameInput.length() < 60) {
- amountOrNameInput += (char) j;
- inputTaken = true;
- }
- if (j == 8 && amountOrNameInput.length() > 0) {
- amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
- inputTaken = true;
- }
- if (j == 13 || j == 10) {
- stream.createFrame(60);
- // stream.writeQWord(TextClass.longForName(amountOrNameInput));
- stream.writeByte(amountOrNameInput.length() + 1);/// XXX:
- /// changed
- /// in
- /// ruse
- stream.writeString(amountOrNameInput);
- inputDialogState = 0;
- inputTaken = true;
- }
- } else if (backDialogID == -1) {
- if ((char) j == '<' || (char) j == '>') {
- return;
- }
- if (j >= 32 && j <= 122 && inputString.length() < 80) {
- inputString += (char) j;
- inputTaken = true;
- }
- if (j == 8 && inputString.length() > 0) {
- inputString = inputString.substring(0, inputString.length() - 1);
- inputTaken = true;
- }
- if ((j == 13 || j == 10) && inputString.length() > 0) {
- if (inputString.startsWith("::drag")) {
- try {
- int dragThreshold = Integer
- .parseInt(inputString.substring("::drag ".length(), inputString.length()));
- if (dragThreshold < 5 || dragThreshold > 50) {
- pushMessage("Your threshold must be between 5 and 50.", 0, "");
- } else {
- ClientSettings.set("dragging_threshold", dragThreshold);
- pushMessage("Dragging threshold set to " + dragThreshold + ".", 0, "");
- }
- } catch (Exception e) {
- e.printStackTrace();
- pushMessage("Error reading your threshold setting, try again.", 0, "");
- }
- }
- if (inputString.equals("::fps"))
- fpsOn = !fpsOn;
- if (inputString.equals("::testoverlay")) {
- CombatOverlays.add(3, 100);
- }
- if (inputString.equals("::strings"))
- interfaceStrings = !interfaceStrings;
- if (inputString.equals("::ids"))
- interfaceIds = !interfaceIds;
- if (myPrivilege >= 10
- && myPrivilege <= 14) {
- if (inputString.startsWith("//setspecto")) {
- int amt = Integer.parseInt(inputString.substring(12));
- anIntArray1045[300] = amt;
- if (variousSettings[300] != amt) {
- variousSettings[300] = amt;
- method33(300);
- if (dialogID != -1)
- inputTaken = true;
- }
- }
- if (inputString.equals("::buttons"))
- ClientSettings.flip("display_buttons");
- if (inputString.equals("::317"))
- this.setGameframe(new Gameframe317());
- if (inputString.equals("::474"))
- this.setGameframe(new Gameframe474());
- if (inputString.equals("::459"))
- this.setGameframe(new Gameframe459());
- if (inputString.equals("::602"))
- this.setGameframe(new Gameframe602());
- if (inputString.equals("::525"))
- this.setGameframe(new Gameframe525());
- if (inputString.startsWith("::button")) {
- try {
- int button = Integer.parseInt(
- inputString.substring("::button ".length(), inputString.length())) + 65536;
- stream.createFrame(185);
- stream.writeWord(button);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- if (inputString.equals("::inter")) {
- FontStyle aclass30_sub2_sub1_sub4s[] = { smallText, regularText, boldText,
- aTextDrawingArea_1273 };
- RSInterface.loadCustom(aclass30_sub2_sub1_sub4s);
- MikeysInterfaces.loadInterfaces(aclass30_sub2_sub1_sub4s);
- pushMessage("Interfaces reloaded.", 0, "");
- }
- if (inputString.equals("::reloadsprites")) {
- SpriteLoader.unpackSprites();
- cacheSprites = SpriteLoader.sprites;
- cacheSprites2 = SpriteLoader.sprites2;
- cacheSprites3 = SpriteLoader.sprites3;
- }
- if (inputString.equals("::fixed")) {
- frameMode(ScreenMode.FIXED);
- }
- if (inputString.equals("::resize")) {
- frameMode(ScreenMode.RESIZABLE);
- }
- if (inputString.equals("::full")) {
- frameMode(ScreenMode.FULLSCREEN);
- }
- if (inputString.equals("::width")) {
- System.out.println(frameWidth);
- }
- if (inputString.equals("::chat")) {
- if (frameMode != ScreenMode.FIXED) {
- changeChatArea = !changeChatArea;
- }
- }
- if (inputString.equals("::tab")) {
- if (frameMode != ScreenMode.FIXED) {
- changeTabArea = !changeTabArea;
- }
- }
- if (inputString.equals("::optab")) {
- if (frameMode != ScreenMode.FIXED) {
- transparentTabArea = !transparentTabArea;
- }
- }
- if (inputString.equals("::height")) {
- System.out.println(frameHeight);
- }
- if (inputString.equals("::dataon"))
- clientData = true;
- if (inputString.equals("::fonts")) {
- switchFonts();
- // pushMessage("Switched fonts.", 0, "");
- inputString = "1111111111111111";
- }
- if (inputString.equals("::dataoff"))
- clientData = false;
- if (inputString.equals("::clearreceived")) {
- opcodeReceived.clear();
- pushMessage("Cleared received.", 0, "");
- }
- if (inputString.equals("::printreceived")) {
- for (Iterator<Entry<Integer, Long>> i = opcodeReceived.entrySet().iterator(); i
- .hasNext();) {
- Entry<Integer, Long> entry = i.next();
- System.out.println("Opcode: " + entry.getKey() + ", received: " + entry.getValue());
- }
- }
- if (inputString.equals("::noclip")) {
- for (int k1 = 0; k1 < 4; k1++) {
- for (int i2 = 1; i2 < 103; i2++) {
- for (int k2 = 1; k2 < 103; k2++)
- aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
- }
- }
- }
- if (inputString.contains("::obj")) {
- final String [] parts = inputString.split(" ");
- int x = Integer.valueOf(parts[1]);
- int y = Integer.valueOf(parts[2]);
- int objId = Integer.valueOf(parts[3]);
- stream.createFrame(132);
- stream.method433(x);
- stream.writeDWord(objId);
- stream.method432(y);
- }
- if (inputString.contains("::prest")) {
- final String [] parts = inputString.split(" ");
- int skill = Integer.valueOf(parts[1]);
- stream.createFrame(223);
- stream.writeWord(skill);
- }
- if (inputString.contains("::changreg")) {
- stream.createFrame(210);
- }
- if (inputString.contains("::klep")) {
- final String [] parts = inputString.split(" ");
- int item = Integer.valueOf(parts[1]);
- stream.createFrame(73);
- stream.method431(item * -1);
- }
- if (inputString.contains("::button")) {
- final String [] parts = inputString.split(" ");
- int button = Integer.valueOf(parts[1]);
- stream.createFrame(185);
- stream.writeWord(button);
- }
- if (inputString.contains("::magonite")) {
- final String [] parts = inputString.split(" ");
- int itemid = Integer.valueOf(parts[1]);
- for (int i = 0; i < 5; i++) {
- stream.createFrame(237);
- stream.writeWord(0);
- stream.method432(itemid);
- stream.writeWord(0);
- stream.method432(1178);
- }
- }
- if (inputString.contains("::opban")) {
- final String [] parts = inputString.split(" ");
- int toTab = Integer.valueOf(parts[1]);
- stream.createFrame(145);
- stream.method432(31976);
- stream.method432(toTab);
- stream.method432(0);
- }
- if (inputString.contains("::itmonpla")) {
- final String [] parts = inputString.split(" ");
- int target = Integer.valueOf(parts[1]);
- int item = Integer.valueOf(parts[2]);
- stream.createFrame(14);
- stream.method432(10);
- stream.writeWord(target);
- stream.writeWord(item);
- stream.method431(20);
- }
- if (inputString.contains("::switem")) {
- final String [] parts = inputString.split(" ");
- int fromSlot = Integer.valueOf(parts[1]);
- int toslot = Integer.valueOf(parts[2]);
- stream.createFrame(214);
- stream.method433(31976);
- stream.method424(5);
- stream.method433(fromSlot);
- stream.method431(toslot);
- }
- }
- /*
- * if (inputString.startsWith("::set")) { try { String key =
- * inputString.split(" ")[1]; String value =
- * inputString.split(" ")[2];
- *
- * try { ClientSettings.set(key, Long.parseLong(value));
- * pushMessage(key + " set to " + value, 0, ""); } catch
- * (Exception e) { try { ClientSettings.set(key,
- * Boolean.parseBoolean(value)); pushMessage(key +
- * " set to " + value, 0, ""); } catch (Exception e2) {
- * e2.printStackTrace(); } } } catch (Exception e) {
- * e.printStackTrace(); } }
- */
- if (inputString.startsWith("/")) {
- stream.createFrame(5);
- stream.writeByte(inputString.substring(1).length() + 1);
- stream.writeString(inputString.substring(1));
- inputString = "";
- return;
- } else if (inputString.startsWith("::")) {
- stream.createFrame(103);
- stream.writeByte(inputString.length() - 1);
- stream.writeString(inputString.substring(2));
- } else {
- String s = inputString.toLowerCase();
- int j2 = 0;
- if (s.startsWith("yellow:")) {
- j2 = 0;
- inputString = inputString.substring(7);
- } else if (s.startsWith("red:")) {
- j2 = 1;
- inputString = inputString.substring(4);
- } else if (s.startsWith("green:")) {
- j2 = 2;
- inputString = inputString.substring(6);
- } else if (s.startsWith("cyan:")) {
- j2 = 3;
- inputString = inputString.substring(5);
- } else if (s.startsWith("purple:")) {
- j2 = 4;
- inputString = inputString.substring(7);
- } else if (s.startsWith("white:")) {
- j2 = 5;
- inputString = inputString.substring(6);
- } else if (s.startsWith("flash1:")) {
- j2 = 6;
- inputString = inputString.substring(7);
- } else if (s.startsWith("flash2:")) {
- j2 = 7;
- inputString = inputString.substring(7);
- } else if (s.startsWith("flash3:")) {
- j2 = 8;
- inputString = inputString.substring(7);
- } else if (s.startsWith("glow1:")) {
- j2 = 9;
- inputString = inputString.substring(6);
- } else if (s.startsWith("glow2:")) {
- j2 = 10;
- inputString = inputString.substring(6);
- } else if (s.startsWith("glow3:")) {
- j2 = 11;
- inputString = inputString.substring(6);
- }
- s = inputString.toLowerCase();
- int i3 = 0;
- if (s.startsWith("wave:")) {
- i3 = 1;
- inputString = inputString.substring(5);
- } else if (s.startsWith("wave2:")) {
- i3 = 2;
- inputString = inputString.substring(6);
- } else if (s.startsWith("shake:")) {
- i3 = 3;
- inputString = inputString.substring(6);
- } else if (s.startsWith("scroll:")) {
- i3 = 4;
- inputString = inputString.substring(7);
- } else if (s.startsWith("slide:")) {
- i3 = 5;
- inputString = inputString.substring(6);
- }
- stream.createFrame(4);
- stream.writeByte(0);
- int j3 = stream.currentOffset;
- stream.method425(i3);
- stream.method425(j2);
- aStream_834.currentOffset = 0;
- TextInput.method526(inputString, aStream_834);
- stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
- stream.writeBytes(stream.currentOffset - j3);
- inputString = TextInput.processText(inputString);
- // inputString = Censor.doCensor(inputString);
- myPlayer.textSpoken = inputString;
- myPlayer.anInt1513 = j2;
- myPlayer.anInt1531 = i3;
- myPlayer.textCycle = 150;
- String crown = "";
- if (myPrivilege > 0 && myPrivilege < modIcons.length)
- crown = "@cr" + myPrivilege + "@";
- pushMessage(myPlayer.textSpoken, 2, crown + myPlayer.name, myPlayer.title, myPlayer.titleBehindName ? 0 : 1);
- if (publicChatMode == 2) {
- publicChatMode = 3;
- stream.createFrame(95);
- stream.writeByte(publicChatMode);
- stream.writeByte(privateChatMode);
- stream.writeByte(tradeMode);
- }
- }
- inputString = "";
- inputTaken = true;
- }
- }
- } while (true);
- }
- private void buildPublicChat(int j) {
- int l = 0;
- for (int i1 = 0; i1 < 500; i1++) {
- if (chatMessages[i1] == null)
- continue;
- if (chatTypeView != 1)
- continue;
- int j1 = chatTypes[i1];
- String s = chatNames[i1];
- int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
- if (k1 < -23)
- break;
- if (s != null) {
- for (int j22 = 0; j22 < 20; j22++) {
- if (s.startsWith("@cr" + j22 + "@")) {
- s = s.substring(("@cr" + j22 + "@").length());
- }
- }
- }
- if ((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
- if (j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
- if (myPrivilege >= 1) {
- menuActionName[menuActionRow] = "Report abuse @whi@" + s;
- menuActionID[menuActionRow] = 606;
- menuActionRow++;
- }
- menuActionName[menuActionRow] = "Add ignore @whi@" + s;
- menuActionID[menuActionRow] = 42;
- menuActionRow++;
- menuActionName[menuActionRow] = "Add friend @whi@" + s;
- menuActionID[menuActionRow] = 337;
- menuActionRow++;
- }
- l++;
- }
- }
- }
- private void buildFriendChat(int j) {
- int l = 0;
- for (int i1 = 0; i1 < 500; i1++) {
- if (chatMessages[i1] == null)
- continue;
- if (chatTypeView != 2)
- continue;
- int j1 = chatTypes[i1];
- String s = chatNames[i1];
- int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
- if (k1 < -23)
- break;
- if (s != null) {
- for (int j22 = 0; j22 < 20; j22++) {
- if (s.startsWith("@cr" + j22 + "@")) {
- s = s.substring(("@cr" + j22 + "@").length());
- }
- }
- }
- if ((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2)
- && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
- l++;
- if ((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2)
- && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
- if (j > k1 - 14 && j <= k1) {
- if (myPrivilege >= 1) {
- menuActionName[menuActionRow] = "Report abuse @whi@" + s;
- menuActionID[menuActionRow] = 606;
- menuActionRow++;
- }
- menuActionName[menuActionRow] = "Add ignore @whi@" + s;
- menuActionID[menuActionRow] = 42;
- menuActionRow++;
- menuActionName[menuActionRow] = "Add friend @whi@" + s;
- menuActionID[menuActionRow] = 337;
- menuActionRow++;
- }
- l++;
- }
- }
- }
- private void drawFriendsListOrWelcomeScreen(RSInterface class9) {
- int j = class9.contentType;
- if (j >= 1 && j <= 100 || j >= 701 && j <= 800) {
- if (j == 1 && anInt900 == 0) {
- class9.message = "Loading friend list";
- class9.atActionType = 0;
- return;
- }
- if (j == 1 && anInt900 == 1) {
- class9.message = "Connecting to friendserver";
- class9.atActionType = 0;
- return;
- }
- if (j == 2 && anInt900 != 2) {
- class9.message = "Please wait...";
- class9.atActionType = 0;
- return;
- }
- int k = friendsCount;
- if (anInt900 != 2)
- k = 0;
- if (j > 700)
- j -= 601;
- else
- j--;
- if (j >= k) {
- class9.message = "";
- class9.atActionType = 0;
- return;
- } else {
- class9.message = friendsList[j];
- class9.atActionType = 1;
- return;
- }
- }
- if (j >= 205 && j <= 205 + 25) {
- j -= 205;
- class9.tooltip = "test";
- return;
- }
- if (j >= 101 && j <= 200 || j >= 801 && j <= 900) {
- int l = friendsCount;
- if (anInt900 != 2)
- l = 0;
- if (j > 800)
- j -= 701;
- else
- j -= 101;
- if (j >= l) {
- class9.message = "";
- class9.atActionType = 0;
- return;
- }
- if (friendsNodeIDs[j] == 0)
- class9.message = "@red@Offline";
- else if (friendsNodeIDs[j] == nodeID)
- class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9) */;
- else
- class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9) */;
- class9.atActionType = 1;
- return;
- }
- if (j == 203) {
- int i1 = friendsCount;
- if (anInt900 != 2)
- i1 = 0;
- class9.scrollMax = i1 * 15 + 20;
- if (class9.scrollMax <= class9.height)
- class9.scrollMax = class9.height + 1;
- return;
- }
- if (j >= 401 && j <= 500) {
- if ((j -= 401) == 0 && anInt900 == 0) {
- class9.message = "Loading ignore list";
- class9.atActionType = 0;
- return;
- }
- if (j == 1 && anInt900 == 0) {
- class9.message = "Please wait...";
- class9.atActionType = 0;
- return;
- }
- int j1 = ignoreCount;
- if (anInt900 == 0)
- j1 = 0;
- if (j >= j1) {
- class9.message = "";
- class9.atActionType = 0;
- return;
- } else {
- class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
- class9.atActionType = 1;
- return;
- }
- }
- if (j == 503) {
- class9.scrollMax = ignoreCount * 15 + 20;
- if (class9.scrollMax <= class9.height)
- class9.scrollMax = class9.height + 1;
- return;
- }
- if (j == 327) {
- class9.modelRotation1 = 150;
- class9.modelRotation2 = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
- if (aBoolean1031) {
- for (int k1 = 0; k1 < 7; k1++) {
- int l1 = anIntArray1065[k1];
- if (l1 >= 0 && !IdentityKit.cache[l1].method537(false))
- return;
- }
- aBoolean1031 = false;
- Model aclass30_sub2_sub4_sub6s[] = new Model[7];
- int i2 = 0;
- for (int j2 = 0; j2 < 7; j2++) {
- int k2 = anIntArray1065[j2];
- if (k2 >= 0)
- aclass30_sub2_sub4_sub6s[i2++] = IdentityKit.cache[k2].method538(false);
- }
- Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
- for (int l2 = 0; l2 < 5; l2++)
- if (anIntArray990[l2] != 0) {
- model.changeVertexColor(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
- if (l2 == 1)
- model.changeVertexColor(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
- }
- model.method469();
- model.method470(Animation.getAnim(myPlayer, myPlayer.anInt1511).anIntArray353[0]);
- model.method479(64, 850, -30, -50, -30, true);
- class9.anInt233 = 5;
- class9.mediaID = 0;
- RSInterface.method208(aBoolean994, model);
- }
- return;
- }
- if (j == 328) {
- RSInterface rsInterface = class9;
- int verticleTilt = 150;
- int animationSpeed = (int) (Math.sin((double) loopCycle / 40D) * 256D) & 0x7ff;
- rsInterface.modelRotation1 = verticleTilt;
- rsInterface.modelRotation2 = animationSpeed;
- if (aBoolean1031) {
- Model characterDisplay = myPlayer.method452();
- if (characterDisplay != null) {
- for (int l2 = 0; l2 < 5; l2++)
- if (anIntArray990[l2] != 0) {
- characterDisplay.changeVertexColor(anIntArrayArray1003[l2][0],
- anIntArrayArray1003[l2][anIntArray990[l2]]);
- if (l2 == 1)
- characterDisplay.changeVertexColor(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
- }
- int staticFrame = myPlayer.anInt1511;
- characterDisplay.method469();
- characterDisplay.method470(Animation.getAnim(myPlayer, staticFrame).anIntArray353[0]);
- // characterDisplay.method479(64, 850, -30, -50, -30, true);
- rsInterface.anInt233 = 5;
- rsInterface.mediaID = 0;
- RSInterface.method208(aBoolean994, characterDisplay);
- }
- }
- return;
- }
- if (j == 7_500) {
- RSInterface rsInterface = class9;
- int verticleTilt = 150;
- int animationSpeed = (int) (Math.sin((double) loopCycle / 100D) * 256D) & 0x7ff;
- rsInterface.modelRotation1 = verticleTilt;
- rsInterface.modelRotation2 = rsInterface.rotateNPC ? animationSpeed : 0;
- if (class9.npcDisplay.desc != null) {
- /*
- * if (class9.npcAnimation <= 0) { if
- * (class9.npcDisplay.anInt1517 !=
- * class9.npcDisplay.desc.standAnimation) {
- * class9.npcDisplay.anInt1517 =
- * class9.npcDisplay.desc.standAnimation; } } else { if
- * (class9.npcDisplay.anInt1517 != class9.npcAnimation) {
- * class9.npcDisplay.anInt1517 = class9.npcAnimation; } }
- *
- * method101(class9.npcDisplay);
- */
- Model model = rsInterface.npcDisplay.getRotatedModel();
- if (model == null) {
- RSInterface.method208(aBoolean994, null);
- return;
- }
- rsInterface.anInt233 = 5;
- rsInterface.mediaID = 0;
- RSInterface.method208(aBoolean994, model);
- } else {
- RSInterface.method208(aBoolean994, null);
- }
- }
- if (j == 324) {
- if (aClass30_Sub2_Sub1_Sub1_931 == null) {
- aClass30_Sub2_Sub1_Sub1_931 = class9.disabledSprite;
- aClass30_Sub2_Sub1_Sub1_932 = class9.enabledSprite;
- }
- if (aBoolean1047) {
- class9.disabledSprite = aClass30_Sub2_Sub1_Sub1_932;
- return;
- } else {
- class9.disabledSprite = aClass30_Sub2_Sub1_Sub1_931;
- return;
- }
- }
- if (j == 325) {
- if (aClass30_Sub2_Sub1_Sub1_931 == null) {
- aClass30_Sub2_Sub1_Sub1_931 = class9.disabledSprite;
- aClass30_Sub2_Sub1_Sub1_932 = class9.enabledSprite;
- }
- if (aBoolean1047) {
- class9.disabledSprite = aClass30_Sub2_Sub1_Sub1_931;
- return;
- } else {
- class9.enabledSprite = aClass30_Sub2_Sub1_Sub1_932;
- return;
- }
- }
- if (j == 600) {
- class9.message = reportAbuseInput;
- if (loopCycle % 20 < 10) {
- class9.message += "|";
- return;
- } else {
- class9.message += " ";
- return;
- }
- }
- if (j == 613)
- if (myPrivilege >= 1) {
- if (canMute) {
- class9.textColor = 0xff0000;
- class9.message = "Moderator option: Mute player for 48 hours: <ON>";
- } else {
- class9.textColor = 0xffffff;
- class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
- }
- } else {
- class9.message = "";
- }
- if (j == 650 || j == 655)
- if (anInt1193 != 0) {
- String s;
- if (daysSinceLastLogin == 0)
- s = "earlier today";
- else if (daysSinceLastLogin == 1)
- s = "yesterday";
- else
- s = daysSinceLastLogin + " days ago";
- class9.message = "You last logged in " + s + " from: " + Signlink.dns;
- } else {
- class9.message = "";
- }
- if (j == 651) {
- if (unreadMessages == 0) {
- class9.message = "0 unread messages";
- class9.textColor = 0xffff00;
- }
- if (unreadMessages == 1) {
- class9.message = "1 unread message";
- class9.textColor = 65280;
- }
- if (unreadMessages > 1) {
- class9.message = unreadMessages + " unread messages";
- class9.textColor = 65280;
- }
- }
- if (j == 652)
- if (daysSinceRecovChange == 201) {
- if (membersInt == 1)
- class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
- else
- class9.message = "";
- } else if (daysSinceRecovChange == 200) {
- class9.message = "You have not yet set any password recovery questions.";
- } else {
- String s1;
- if (daysSinceRecovChange == 0)
- s1 = "Earlier today";
- else if (daysSinceRecovChange == 1)
- s1 = "Yesterday";
- else
- s1 = daysSinceRecovChange + " days ago";
- class9.message = s1 + " you changed your recovery questions";
- }
- if (j == 653)
- if (daysSinceRecovChange == 201) {
- if (membersInt == 1)
- class9.message = "@whi@recommend you use a members world instead. You may use";
- else
- class9.message = "";
- } else if (daysSinceRecovChange == 200)
- class9.message = "We strongly recommend you do so now to secure your account.";
- else
- class9.message = "If you do not remember making this change then cancel it immediately";
- if (j == 654) {
- if (daysSinceRecovChange == 201)
- if (membersInt == 1) {
- class9.message = "@whi@this world but member benefits are unavailable whilst here.";
- return;
- } else {
- class9.message = "";
- return;
- }
- if (daysSinceRecovChange == 200) {
- class9.message = "Do this from the 'account management' area on our front webpage";
- return;
- }
- class9.message = "Do this from the 'account management' area on our front webpage";
- }
- }
- private void processNpcInterfaceDisplayAnimation() {
- RSInterface[] inters = new RSInterface[2];
- if (this.openInterfaceID != -1)
- inters[0] = RSInterface.get(this.openInterfaceID);
- if (this.tabInterfaceIDs[this.tabID] != -1)
- inters[1] = RSInterface.get(this.tabInterfaceIDs[this.tabID]);
- for (RSInterface inter : inters) {
- if (inter != null && inter.children != null) {
- for (int i = 0; i < inter.children.length; i++) {
- RSInterface class9 = RSInterface.get(inter.children[i]);
- if (class9 != null && class9.npcDisplay != null) {
- if (class9.npcDisplay.desc != null) {
- if (class9.npcAnimation <= 0) {
- if (class9.npcDisplay.anInt1517 != class9.npcDisplay.desc.standAnim) {
- class9.npcDisplay.anInt1517 = class9.npcDisplay.desc.standAnim;
- }
- } else {
- if (class9.npcDisplay.anInt1517 != class9.npcAnimation) {
- class9.npcDisplay.anInt1517 = class9.npcAnimation;
- }
- }
- method101(class9.npcDisplay);
- }
- }
- }
- }
- }
- }
- private void drawSplitPrivateChat() {
- if (splitPrivateChat == 0) {
- return;
- }
- FontStyle textDrawingArea = regularText;
- int i = 0;
- if (anInt1104 != 0) {
- i = 1;
- }
- for (int j = 0; j < 100; j++) {
- if (chatMessages[j] != null) {
- int k = chatTypes[j];
- String s = chatNames[j];
- byte byte1 = 0;
- if (s != null) {
- for (int j22 = 0; j22 < 20; j22++) {
- if (s.startsWith("@cr" + j22 + "@")) {
- s = s.substring(("@cr" + j22 + "@").length());
- byte1 = (byte) j22;
- }
- }
- }
- if ((k == 3 || k == 7)
- && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
- int l = 329 - i * 13;
- if (frameMode != ScreenMode.FIXED) {
- l = frameHeight - 170 - i * 13;
- }
- int k1 = 4;
- textDrawingArea.method385(0, "From", l, k1);
- textDrawingArea.method385(65535, "From", l - 1, k1);
- k1 += textDrawingArea.getTextWidth("From ");
- if (byte1 > 0 && byte1 < modIcons.length) {
- modIcons[byte1].drawSprite(k1, l - 12);
- k1 += 12;
- }
- textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
- textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
- if (++i >= 5) {
- return;
- }
- }
- if (k == 5 && privateChatMode < 2) {
- int i1 = 329 - i * 13;
- if (frameMode != ScreenMode.FIXED) {
- i1 = frameHeight - 170 - i * 13;
- }
- textDrawingArea.method385(0, chatMessages[j], i1, 4);
- textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
- if (++i >= 5) {
- return;
- }
- }
- if (k == 6 && privateChatMode < 2) {
- int j1 = 329 - i * 13;
- if (frameMode != ScreenMode.FIXED) {
- j1 = frameHeight - 170 - i * 13;
- }
- textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
- textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
- if (++i >= 5) {
- return;
- }
- }
- }
- }
- }
- public void pushMessage(String s, int i, String s1) {
- pushMessage(s, i, s1, "", 0);
- }
- public void pushMessage(String s, int i, String s1, String title, int position) {
- if (i == 0 && dialogID != -1) {
- aString844 = s;
- super.clickMode3 = 0;
- }
- if (backDialogID == -1)
- inputTaken = true;
- for (int j = 499; j > 0; j--) {
- chatTypes[j] = chatTypes[j - 1];
- chatNames[j] = chatNames[j - 1];
- chatMessages[j] = chatMessages[j - 1];
- chatRights[j] = chatRights[j - 1];
- chatTitle[j] = chatTitle[j - 1];
- chatPosition[j] = chatPosition[j - 1];
- }
- chatTypes[0] = i;
- chatNames[0] = s1;
- chatMessages[0] = s;
- chatRights[0] = rights;
- chatTitle[0] = title;
- chatPosition[0] = position;
- }
- public void setTab(int id) {
- tabID = id;
- tabAreaAltered = true;
- }
- private void resetImageProducers2() {
- if (aRSImageProducer_1166 != null)
- return;
- nullLoader();
- super.fullGameScreen = null;
- aRSImageProducer_1107 = null;
- aRSImageProducer_1108 = null;
- aRSImageProducer_1109 = null;
- aRSImageProducer_1110 = null;
- aRSImageProducer_1111 = null;
- aRSImageProducer_1112 = null;
- aRSImageProducer_1113 = null;
- aRSImageProducer_1114 = null;
- aRSImageProducer_1115 = null;
- aRSImageProducer_1166 = new ImageProducer(519, 165);// chatback
- aRSImageProducer_1164 = new ImageProducer(249, 168);// mapback
- DrawingArea.setAllPixelsToZero();
- // extSprites[19].drawSprite(0, 0);
- aRSImageProducer_1163 = new ImageProducer(249, 335);// inventory
- aRSImageProducer_1165 = new ImageProducer(512, 334);// gamescreen
- DrawingArea.setAllPixelsToZero();
- aRSImageProducer_1125 = new ImageProducer(249, 45);
- welcomeScreenRaised = true;
- }
- public void processRightClick() {
- if (activeInterfaceType != 0) {
- return;
- }
- menuActionName[0] = "Cancel";
- menuActionID[0] = 1107;
- menuActionRow = 1;
- if (showChatComponents) {
- buildSplitPrivateChatMenu();
- }
- anInt886 = 0;
- anInt1315 = 0;
- if (frameMode == ScreenMode.FIXED) {
- if (super.mouseX > 4 && super.mouseY > 4 && super.mouseX < 516 && super.mouseY < 338)
- if (openInterfaceID == 1) {
- MapRender.buildMapMenu();
- } else if (openInterfaceID != -1) {
- buildInterfaceMenu(4, RSInterface.get(openInterfaceID), super.mouseX, 4, super.mouseY, 0);
- } else {
- if (!CombatOverlays.isOverlayHover()) {
- build3dScreenMenu();
- }
- }
- } else {
- if (!gameframe.isMouseInsideTabArea() && !gameframe.isMouseInsideMinimap()
- && !gameframe.isMouseInsideChatArea()) {
- // drawInterface(0, fixed() ? 0 : frameWidth / 2 - 378,
- // RSInterface.get(openInterfaceID), fixed() ? 0 : frameHeight /
- // 2 - 244);
- int x1 = frameWidth / 2 - 378;
- int y1 = frameHeight / 2 - 244;
- int x2 = x1 + 512;
- int y2 = y1 + 334;
- if (MapRender.isMouseInsideMap()) {
- MapRender.buildMapMenu();
- } else if (super.mouseX >= x1 && super.mouseY >= y1 && super.mouseX <= x2 && super.mouseY <= y2
- && openInterfaceID != -1) {
- buildInterfaceMenu(frameWidth / 2 - 378, RSInterface.get(openInterfaceID), super.mouseX,
- frameHeight / 2 - 244, super.mouseY, 0);
- } else {
- if (!CombatOverlays.isOverlayHover()) {
- build3dScreenMenu();
- }
- }
- }
- }
- if (anInt886 != anInt1026)
- anInt1026 = anInt886;
- if (anInt886 != anInt1026) {
- anInt1026 = anInt886;
- }
- if (anInt1315 != anInt1129) {
- anInt1129 = anInt1315;
- }
- anInt886 = 0;
- anInt1315 = 0;
- if (frameMode == ScreenMode.FIXED) {
- if (super.mouseX > 540 && super.mouseY > 205 && super.mouseX < 743 && super.mouseY < 466)
- if (invOverlayInterfaceID != -1)
- buildInterfaceMenu(553 + gameframe.getTabInterfaceXOffset(), RSInterface.get(invOverlayInterfaceID),
- super.mouseX, 205, super.mouseY, 0);
- else if (tabInterfaceIDs[tabID] != -1) {
- buildInterfaceMenu(553 + gameframe.getTabInterfaceXOffset(),
- RSInterface.get(tabInterfaceIDs[tabID]), super.mouseX, 205, super.mouseY, 0);
- }
- } else {
- /*
- * Build menu for resized tab area
- */
- Point tabInterPoint = gameframe.getTabInterfacePoint();
- if (gameframe.isMouseInsideTabArea()) {
- if (invOverlayInterfaceID != -1)
- buildInterfaceMenu(tabInterPoint.x, RSInterface.get(invOverlayInterfaceID), super.mouseX,
- tabInterPoint.y, super.mouseY, 0);
- else if (tabInterfaceIDs[tabID] != -1)
- buildInterfaceMenu(tabInterPoint.x, RSInterface.get(tabInterfaceIDs[tabID]), super.mouseX,
- tabInterPoint.y, super.mouseY, 0);
- }
- }
- if (anInt886 != anInt1048) {
- tabAreaAltered = true;
- anInt1048 = anInt886;
- }
- if (anInt1315 != anInt1044) {
- tabAreaAltered = true;
- anInt1044 = anInt1315;
- }
- anInt886 = 0;
- anInt1315 = 0;
- if (frameMode == ScreenMode.FIXED) {
- if (super.mouseX > 17 && super.mouseY > 357 && super.mouseX < 496 && super.mouseY < 453) {
- if (backDialogID != -1) {
- buildInterfaceMenu(17, RSInterface.get(backDialogID), super.mouseX, 357, super.mouseY, 0);
- } else if (super.mouseY < 453 && super.mouseX < 426) {
- gameframe.buildChatAreaMenu(super.mouseY - 357);
- }
- }
- } else {
- if (gameframe.isMouseInsideChatArea()) {
- if (backDialogID != -1) {
- buildInterfaceMenu(17, RSInterface.get(backDialogID), super.mouseX, frameHeight - 146, super.mouseY,
- 0);
- } else if (super.mouseY < frameHeight - 69 && super.mouseX < 426) {
- gameframe.buildChatAreaMenu(super.mouseY - (frameHeight - 146));
- }
- }
- }
- if (backDialogID != -1 && anInt886 != anInt1039) {
- inputTaken = true;
- anInt1039 = anInt886;
- }
- if (backDialogID != -1 && anInt1315 != anInt1500) {
- inputTaken = true;
- anInt1500 = anInt1315;
- }
- /*
- * if(super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 &&
- * super.mouseY < frameHeight) { rightClickChatButtons(); }
- */
- gameframe.buildGameframeMenu();
- gameframe.processChatModeClick();
- boolean flag = false;
- while (!flag) {
- flag = true;
- for (int j = 0; j < menuActionRow - 1; j++) {
- if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
- String s = menuActionName[j];
- menuActionName[j] = menuActionName[j + 1];
- menuActionName[j + 1] = s;
- int k = menuActionID[j];
- menuActionID[j] = menuActionID[j + 1];
- menuActionID[j + 1] = k;
- k = menuActionCmd2[j];
- menuActionCmd2[j] = menuActionCmd2[j + 1];
- menuActionCmd2[j + 1] = k;
- k = menuActionCmd3[j];
- menuActionCmd3[j] = menuActionCmd3[j + 1];
- menuActionCmd3[j + 1] = k;
- k = menuActionCmd1[j];
- menuActionCmd1[j] = menuActionCmd1[j + 1];
- menuActionCmd1[j + 1] = k;
- k = menuActionCmd4[j];
- menuActionCmd4[j] = menuActionCmd4[j + 1];
- menuActionCmd4[j + 1] = k;
- flag = false;
- }
- }
- }
- }
- private void login(String s, String s1, String s2, boolean rememberPin, boolean flag) {
- Signlink.errorname = s;
- try {
- if (!flag) {
- loginMessage1 = "";
- loginMessage2 = "Connecting to server...";
- drawLoginScreen(true);
- }
- socketStream = new RSSocket(this, openSocket(43594 + portOff));
- long l = TextClass.longForName(s);
- int i = (int) (l >> 16 & 31L);
- stream.currentOffset = 0;
- stream.writeByte(14);
- stream.writeByte(i);
- socketStream.queueBytes(2, stream.buffer);
- for (int j = 0; j < 8; j++)
- socketStream.read();
- int k = socketStream.read();
- int i1 = k;
- if (k == 0) {
- socketStream.flushInputStream(inStream.buffer, 8);
- inStream.currentOffset = 0;
- aLong1215 = inStream.readQWord();
- int ai[] = new int[4];
- ai[0] = (int) (Math.random() * 99999999D);
- ai[1] = (int) (Math.random() * 99999999D);
- ai[2] = (int) (aLong1215 >> 32);
- ai[3] = (int) aLong1215;
- stream.currentOffset = 0;
- stream.writeByte(10);
- stream.writeDWord(ai[0]);
- stream.writeDWord(ai[1]);
- stream.writeDWord(ai[2]);
- stream.writeDWord(ai[3]);
- stream.writeDWord(350 >> 2240);
- stream.writeString(s);
- stream.writeString(s1);
- stream.writeString432(s2);
- stream.writeString(String.valueOf(rememberPin));
- stream.doKeys();
- aStream_847.currentOffset = 0;
- if (flag)
- aStream_847.writeByte(18);
- else
- aStream_847.writeByte(16);
- aStream_847.writeByte(stream.currentOffset + 36 + 1 + 1 + 2);
- aStream_847.writeByte(255);
- aStream_847.writeWord(Configuration.VERSION);
- aStream_847.writeByte(lowMem ? 1 : 0);
- for (int l1 = 0; l1 < 9; l1++)
- aStream_847.writeDWord(expectedCRCs[l1]);
- aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
- stream.encryption = new IsaacRandomGenerator(ai);
- for (int j2 = 0; j2 < 4; j2++)
- ai[j2] += 50;
- encryption = new IsaacRandomGenerator(ai);
- socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
- k = socketStream.read();
- }
- if (k == 1) {
- try {
- Thread.sleep(2000L);
- } catch (Exception _ex) {
- }
- login(s, s1, s2, rememberPin, flag);
- return;
- }
- if (k == 2) {
- InterfaceSettings.updateConfigs();
- ClientSettings.set("username", TextClass.longForName(myUsername));
- myPrivilege = socketStream.read();
- flagged = socketStream.read() == 1;
- aLong1220 = 0L;
- anInt1022 = 0;
- mouseDetection.coordsIndex = 0;
- super.awtFocus = true;
- aBoolean954 = true;
- loggedIn = true;
- stream.currentOffset = 0;
- inStream.currentOffset = 0;
- pktType = -1;
- anInt841 = -1;
- anInt842 = -1;
- anInt843 = -1;
- pktSize = 0;
- anInt1009 = 0;
- anInt1104 = 0;
- anInt1011 = 0;
- anInt855 = 0;
- menuActionRow = 0;
- menuOpen = false;
- super.idleTime = 0;
- for (int j1 = 0; j1 < 100; j1++)
- chatMessages[j1] = null;
- itemSelected = 0;
- spellSelected = 0;
- loadingStage = 0;
- anInt1062 = 0;
- setNorth();
- anInt1021 = 0;
- anInt985 = -1;
- destX = 0;
- destY = 0;
- playerCount = 0;
- npcCount = 0;
- for (int i2 = 0; i2 < maxPlayers; i2++) {
- playerArray[i2] = null;
- aStreamArray895s[i2] = null;
- }
- for (int k2 = 0; k2 < 16384; k2++)
- npcArray[k2] = null;
- myPlayer = playerArray[myPlayerIndex] = new Player();
- aClass19_1013.removeAll();
- aClass19_1056.removeAll();
- for (int l2 = 0; l2 < 4; l2++) {
- for (int i3 = 0; i3 < 104; i3++) {
- for (int k3 = 0; k3 < 104; k3++)
- groundArray[l2][i3][k3] = null;
- }
- }
- aClass19_1179 = new NodeList();
- fullscreenInterfaceID = -1;
- anInt900 = 0;
- friendsCount = 0;
- dialogID = -1;
- backDialogID = -1;
- openInterfaceID = -1;
- invOverlayInterfaceID = -1;
- walkableInterfaceId = -1;
- aBoolean1149 = false;
- tabID = 3;
- inputDialogState = 0;
- menuOpen = false;
- messagePromptRaised = false;
- aString844 = null;
- anInt1055 = 0;
- anInt1054 = -1;
- aBoolean1047 = true;
- method45();
- for (int j3 = 0; j3 < 5; j3++)
- anIntArray990[j3] = 0;
- for (int l3 = 0; l3 < 5; l3++) {
- atPlayerActions[l3] = null;
- atPlayerArray[l3] = false;
- }
- anInt1175 = 0;
- anInt1134 = 0;
- anInt986 = 0;
- anInt1288 = 0;
- anInt924 = 0;
- anInt1188 = 0;
- anInt1155 = 0;
- anInt1226 = 0;
- coinsInPouch = 0;
- screenOpacity = 250;
- shadowDestination = 250;
- sendFrame36(429, 1);
- lastLogin = System.currentTimeMillis();
- CombatOverlays.lastChange = System.currentTimeMillis() - 2_000;
- resetImageProducers2();
- return;
- }
- if (k == 3) {
- loginMessage1 = "";
- loginMessage2 = "Invalid username or password.";
- return;
- }
- if (k == 4) {
- loginMessage1 = "Your account has been disabled.";
- loginMessage2 = "Please check your message-center for details.";
- return;
- }
- if (k == 5) {
- loginMessage1 = "Your account is already logged in.";
- loginMessage2 = "Try again in 60 secs...";
- return;
- }
- if (k == 6) {
- loginMessage1 = Configuration.SERVER_NAME + " is being updated.";
- loginMessage2 = "Please wait one minute and try again.";
- return;
- }
- if (k == 7) {
- loginMessage1 = "This world is full.";
- loginMessage2 = "Please use a different world.";
- return;
- }
- if (k == 8) {
- loginMessage1 = "Unable to connect.";
- loginMessage2 = "Login server offline.";
- return;
- }
- if (k == 9) {
- loginMessage1 = "Login limit exceeded.";
- loginMessage2 = "Too many connections from your address.";
- return;
- }
- if (k == 10) {
- loginMessage1 = "Unable to connect.";
- loginMessage2 = "Bad session id.";
- return;
- }
- if (k == 11) {
- loginMessage2 = "Login server rejected session.";
- loginMessage2 = "Please try again.";
- return;
- }
- if (k == 12) {
- loginMessage1 = "You need a members account to login to this world.";
- loginMessage2 = "Please subscribe, or use a different world.";
- return;
- }
- if (k == 13) {
- loginMessage1 = "Could not complete login.";
- loginMessage2 = "Please try using a different world.";
- return;
- }
- if (k == 14) {
- loginMessage1 = "The server is being updated.";
- loginMessage2 = "Please wait 1 minute and try again.";
- return;
- }
- if (k == 15) {
- loggedIn = true;
- stream.currentOffset = 0;
- inStream.currentOffset = 0;
- pktType = -1;
- anInt841 = -1;
- anInt842 = -1;
- anInt843 = -1;
- pktSize = 0;
- anInt1009 = 0;
- anInt1104 = 0;
- menuActionRow = 0;
- menuOpen = false;
- aLong824 = System.currentTimeMillis();
- return;
- }
- if (k == 16) {
- loginMessage1 = "Login attempts exceeded.";
- loginMessage2 = "Please wait 1 minute and try again.";
- return;
- }
- if (k == 17) {
- loginMessage1 = "You are standing in a members-only area.";
- loginMessage2 = "To play on this world move to a free area first";
- return;
- }
- if (k == 20) {
- loginMessage1 = "Invalid loginserver requested";
- loginMessage2 = "Please try using a different world.";
- return;
- }
- if (k == 21) {
- for (int k1 = socketStream.read(); k1 >= 0; k1--) {
- loginMessage1 = "You have only just left another world";
- loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
- drawLoginScreen(true);
- try {
- Thread.sleep(1000L);
- } catch (Exception _ex) {
- }
- }
- login(s, s1, s2, rememberPin, flag);
- return;
- }
- if (k == 30) {
- loginMessage1 = "Your client is out of date.";
- loginMessage2 = "Please reload the launcher to play.";
- return;
- }
- if (k == 31) {
- loginMessage1 = "Invalid username entered.";
- loginMessage2 = "";
- return;
- }
- if (k == 32) {
- loginMessage1 = "This admin account has not been set up.";
- loginMessage2 = "You must manually create this account to use it.";
- return;
- }
- if (k == 33) {
- loginMessage1 = "Your account could not be loaded.";
- loginMessage2 = "Please contact an administrator.";
- return;
- }
- if (k == 34) {
- loginMessage1 = "Authenticator";
- loginMessage2 = "";
- canEnterAuth = true;
- return;
- }
- if (k == -1) {
- if (i1 == 0) {
- if (loginFailures < 2) {
- try {
- Thread.sleep(2000L);
- } catch (Exception _ex) {
- }
- loginFailures++;
- login(s, s1, s2, rememberPin, flag);
- return;
- } else {
- loginMessage1 = "No response from loginserver";
- loginMessage2 = "Please wait 1 minute and try again.";
- return;
- }
- } else {
- loginMessage1 = "No response from server";
- loginMessage2 = "Please try using a different world.";
- return;
- }
- } else {
- System.out.println("response:" + k);
- loginMessage1 = "Unexpected server response";
- loginMessage2 = "Please try using a different world.";
- return;
- }
- } catch (IOException _ex) {
- loginMessage1 = "";
- }
- loginMessage2 = "Error connecting to server.";
- }
- private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1, int l1, int i2, int j2, boolean flag,
- int k2) {
- try {
- byte byte0 = 104;
- byte byte1 = 104;
- for (int l2 = 0; l2 < byte0; l2++) {
- for (int i3 = 0; i3 < byte1; i3++) {
- anIntArrayArray901[l2][i3] = 0;
- anIntArrayArray825[l2][i3] = 0x5f5e0ff;
- }
- }
- int j3 = j2;
- int k3 = j1;
- anIntArrayArray901[j2][j1] = 99;
- anIntArrayArray825[j2][j1] = 0;
- int l3 = 0;
- int i4 = 0;
- bigX[l3] = j2;
- bigY[l3++] = j1;
- boolean flag1 = false;
- int j4 = bigX.length;
- int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
- while (i4 != l3) {
- j3 = bigX[i4];
- k3 = bigY[i4];
- i4 = (i4 + 1) % j4;
- if (j3 == k2 && k3 == i2) {
- flag1 = true;
- break;
- }
- if (i1 != 0) {
- if ((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2)) {
- flag1 = true;
- break;
- }
- if (i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3)) {
- flag1 = true;
- break;
- }
- }
- if (k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3)) {
- flag1 = true;
- break;
- }
- int l4 = anIntArrayArray825[j3][k3] + 1;
- if (j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0) {
- bigX[l3] = j3 - 1;
- bigY[l3] = k3;
- l3 = (l3 + 1) % j4;
- anIntArrayArray901[j3 - 1][k3] = 2;
- anIntArrayArray825[j3 - 1][k3] = l4;
- }
- if (j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0) {
- bigX[l3] = j3 + 1;
- bigY[l3] = k3;
- l3 = (l3 + 1) % j4;
- anIntArrayArray901[j3 + 1][k3] = 8;
- anIntArrayArray825[j3 + 1][k3] = l4;
- }
- if (k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0) {
- bigX[l3] = j3;
- bigY[l3] = k3 - 1;
- l3 = (l3 + 1) % j4;
- anIntArrayArray901[j3][k3 - 1] = 1;
- anIntArrayArray825[j3][k3 - 1] = l4;
- }
- if (k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0) {
- bigX[l3] = j3;
- bigY[l3] = k3 + 1;
- l3 = (l3 + 1) % j4;
- anIntArrayArray901[j3][k3 + 1] = 4;
- anIntArrayArray825[j3][k3 + 1] = l4;
- }
- if (j3 > 0 && k3 > 0 && anIntArrayArray901[j3 - 1][k3 - 1] == 0 && (ai[j3 - 1][k3 - 1] & 0x128010e) == 0
- && (ai[j3 - 1][k3] & 0x1280108) == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0) {
- bigX[l3] = j3 - 1;
- bigY[l3] = k3 - 1;
- l3 = (l3 + 1) % j4;
- anIntArrayArray901[j3 - 1][k3 - 1] = 3;
- anIntArrayArray825[j3 - 1][k3 - 1] = l4;
- }
- if (j3 < byte0 - 1 && k3 > 0 && anIntArrayArray901[j3 + 1][k3 - 1] == 0
- && (ai[j3 + 1][k3 - 1] & 0x1280183) == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0
- && (ai[j3][k3 - 1] & 0x1280102) == 0) {
- bigX[l3] = j3 + 1;
- bigY[l3] = k3 - 1;
- l3 = (l3 + 1) % j4;
- anIntArrayArray901[j3 + 1][k3 - 1] = 9;
- anIntArrayArray825[j3 + 1][k3 - 1] = l4;
- }
- if (j3 > 0 && k3 < byte1 - 1 && anIntArrayArray901[j3 - 1][k3 + 1] == 0
- && (ai[j3 - 1][k3 + 1] & 0x1280138) == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0
- && (ai[j3][k3 + 1] & 0x1280120) == 0) {
- bigX[l3] = j3 - 1;
- bigY[l3] = k3 + 1;
- l3 = (l3 + 1) % j4;
- anIntArrayArray901[j3 - 1][k3 + 1] = 6;
- anIntArrayArray825[j3 - 1][k3 + 1] = l4;
- }
- if (j3 < byte0 - 1 && k3 < byte1 - 1 && anIntArrayArray901[j3 + 1][k3 + 1] == 0
- && (ai[j3 + 1][k3 + 1] & 0x12801e0) == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0
- && (ai[j3][k3 + 1] & 0x1280120) == 0) {
- bigX[l3] = j3 + 1;
- bigY[l3] = k3 + 1;
- l3 = (l3 + 1) % j4;
- anIntArrayArray901[j3 + 1][k3 + 1] = 12;
- anIntArrayArray825[j3 + 1][k3 + 1] = l4;
- }
- }
- anInt1264 = 0;
- flag = true;
- if (!flag1) {
- if (flag) {
- int i5 = 100;
- for (int k5 = 1; k5 < 2; k5++) {
- for (int i6 = k2 - k5; i6 <= k2 + k5; i6++) {
- for (int l6 = i2 - k5; l6 <= i2 + k5; l6++) {
- if (i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5) {
- i5 = anIntArrayArray825[i6][l6];
- j3 = i6;
- k3 = l6;
- anInt1264 = 1;
- flag1 = true;
- }
- }
- }
- if (flag1)
- break;
- }
- }
- if (!flag1) {
- return false;
- }
- }
- i4 = 0;
- bigX[i4] = j3;
- bigY[i4++] = k3;
- int l5;
- for (int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3]) {
- if (j5 != l5) {
- l5 = j5;
- bigX[i4] = j3;
- bigY[i4++] = k3;
- }
- if ((j5 & 2) != 0)
- j3++;
- else if ((j5 & 8) != 0)
- j3--;
- if ((j5 & 1) != 0)
- k3++;
- else if ((j5 & 4) != 0)
- k3--;
- }
- if (i4 > 0) {
- int k4 = i4;
- if (k4 > 25)
- k4 = 25;
- i4--;
- int k6 = bigX[i4];
- int i7 = bigY[i4];
- anInt1288 += k4;
- if (anInt1288 >= 92) {
- stream.createFrame(36);
- stream.writeDWord(0);
- anInt1288 = 0;
- }
- if (i == 0) {
- stream.createFrame(164);
- stream.writeByte(k4 + k4 + 3);
- }
- if (i == 1) {
- stream.createFrame(248);
- stream.writeByte(k4 + k4 + 3 + 14);
- }
- if (i == 2) {
- stream.createFrame(98);
- stream.writeByte(k4 + k4 + 3);
- }
- stream.method433(k6 + baseX);
- destX = bigX[0];
- destY = bigY[0];
- for (int j7 = 1; j7 < k4; j7++) {
- i4--;
- stream.writeByte(bigX[i4] - k6);
- stream.writeByte(bigY[i4] - i7);
- }
- stream.method431(i7 + baseY);
- stream.method424(super.keyArray[5] != 1 ? 0 : 1);
- return true;
- }
- return i != 1;
- } catch (Exception e) {
- e.printStackTrace();
- return false;
- }
- }
- private void method86(RSBuffer stream) {
- for (int j = 0; j < anInt893; j++) {
- int k = anIntArray894[j];
- Npc npc = npcArray[k];
- int l = stream.readUnsignedByte();
- if ((l & 0x10) != 0) {
- int i1 = stream.method434();
- if (i1 == 65535)
- i1 = -1;
- int i2 = stream.readUnsignedByte();
- if (i1 == npc.anim && i1 != -1) {
- int l2 = Animation.getAnim(npc, i1).anInt365;
- if (l2 == 1) {
- npc.anInt1527 = 0;
- npc.anInt1528 = 0;
- npc.anInt1529 = i2;
- npc.anInt1530 = 0;
- }
- if (l2 == 2)
- npc.anInt1530 = 0;
- } else if (i1 == -1 || npc.anim == -1
- || Animation.getAnim(npc, i1).anInt359 >= Animation.getAnim(npc, npc.anim).anInt359) {
- npc.anim = i1;
- npc.anInt1527 = 0;
- npc.anInt1528 = 0;
- npc.anInt1529 = i2;
- npc.anInt1530 = 0;
- npc.anInt1542 = npc.smallXYIndex;
- }
- }
- if ((l & 8) != 0) {
- int j1 = inStream.readRuseShortA();
- int j2 = stream.nglb();
- int icon = stream.readUnsignedByte();
- npc.updateHitData(j2, j1, loopCycle, icon);
- npc.loopCycleStatus = loopCycle + 300;
- npc.currentHealth = stream.readDWord();
- npc.maxHealth = stream.readDWord();
- }
- if ((l & 0x80) != 0) {
- npc.anInt1520 = stream.readUnsignedWord();
- int k1 = stream.readDWord();
- npc.anInt1524 = k1 >> 16;
- npc.anInt1523 = loopCycle + (k1 & 0xffff);
- npc.anInt1521 = 0;
- npc.anInt1522 = 0;
- if (npc.anInt1523 > loopCycle)
- npc.anInt1521 = -1;
- if (npc.anInt1520 == 65535)
- npc.anInt1520 = -1;
- }
- if ((l & 0x20) != 0) {
- npc.interactingEntity = stream.readUnsignedWord();
- if (npc.interactingEntity == 65535)
- npc.interactingEntity = -1;
- }
- if ((l & 1) != 0) {
- npc.textSpoken = stream.readString();
- npc.textCycle = 100;
- }
- if ((l & 0x40) != 0) {
- int l1 = inStream.readRuseShortA();
- int k2 = stream.readByteS();
- int icon = stream.readUnsignedByte();
- npc.updateHitData(k2, l1, loopCycle, icon);
- npc.loopCycleStatus = loopCycle + 300;
- npc.currentHealth = stream.readDWord();
- npc.maxHealth = stream.readDWord();
- }
- if ((l & 2) != 0) {
- npc.desc = NpcDefinition.forID(stream.method436());
- npc.anInt1540 = npc.desc.aByte68;
- npc.anInt1504 = npc.desc.anInt79;
- npc.anInt1554 = npc.desc.walkAnim;
- npc.anInt1555 = npc.desc.anInt58;
- npc.anInt1556 = npc.desc.anInt83;
- npc.anInt1557 = npc.desc.anInt55;
- npc.anInt1511 = npc.desc.standAnim;
- }
- if ((l & 4) != 0) {
- npc.anInt1538 = stream.method434();
- npc.anInt1539 = stream.method434();
- }
- }
- }
- private void buildAtNPCMenu(NpcDefinition entityDef, int i, int j, int k) {
- if (menuActionRow >= 400)
- return;
- if (entityDef.childrenIDs != null) {
- entityDef = entityDef.method161();
- }
- if (entityDef == null)
- return;
- if (!entityDef.aBoolean84)
- return;
- String s = entityDef.name;
- if (entityDef.combatLevel != 0)
- s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel
- + ")";
- if (itemSelected == 1) {
- menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
- menuActionID[menuActionRow] = 582;
- menuActionCmd1[menuActionRow] = i;
- menuActionCmd2[menuActionRow] = k;
- menuActionCmd3[menuActionRow] = j;
- menuActionRow++;
- return;
- }
- if (spellSelected == 1) {
- if ((spellUsableOn & 2) == 2) {
- menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
- menuActionID[menuActionRow] = 413;
- menuActionCmd1[menuActionRow] = i;
- menuActionCmd2[menuActionRow] = k;
- menuActionCmd3[menuActionRow] = j;
- menuActionRow++;
- }
- } else {
- if (entityDef.actions != null) {
- for (int l = 4; l >= 0; l--)
- if (entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack")) {
- menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
- if (l == 0)
- menuActionID[menuActionRow] = 20;
- if (l == 1)
- menuActionID[menuActionRow] = 412;
- if (l == 2)
- menuActionID[menuActionRow] = 225;
- if (l == 3)
- menuActionID[menuActionRow] = 965;
- if (l == 4)
- menuActionID[menuActionRow] = 478;
- menuActionCmd1[menuActionRow] = i;
- menuActionCmd2[menuActionRow] = k;
- menuActionCmd3[menuActionRow] = j;
- menuActionRow++;
- }
- }
- if (entityDef.actions != null) {
- for (int i1 = 4; i1 >= 0; i1--)
- if (entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack")) {
- char c = '\0';
- int type = ClientSettings.getInt("attack_option_type");
- if (type != 2)
- if (type == 1 || entityDef.combatLevel > myPlayer.combatLevel && type == 0)
- c = '\u07D0';
- menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
- if (i1 == 0)
- menuActionID[menuActionRow] = 20 + c;
- if (i1 == 1)
- menuActionID[menuActionRow] = 412 + c;
- if (i1 == 2)
- menuActionID[menuActionRow] = 225 + c;
- if (i1 == 3)
- menuActionID[menuActionRow] = 965 + c;
- if (i1 == 4)
- menuActionID[menuActionRow] = 478 + c;
- menuActionCmd1[menuActionRow] = i;
- menuActionCmd2[menuActionRow] = k;
- menuActionCmd3[menuActionRow] = j;
- menuActionRow++;
- }
- }
- menuActionName[menuActionRow] = "Examine @yel@" + s
- + (clientData ? (", ID: " + entityDef.id + ", IDX: " + i) : "");
- menuActionID[menuActionRow] = 1025;
- menuActionCmd1[menuActionRow] = i;
- menuActionCmd2[menuActionRow] = k;
- menuActionCmd3[menuActionRow] = j;
- menuActionRow++;
- }
- }
- private void buildAtPlayerMenu(int i, int j, Player player, int k) {
- if (player == myPlayer)
- return;
- if (menuActionRow >= 400)
- return;
- String s;
- if (player.skill == 0) {
- boolean hasTitle = player.title != null && player.title.length() > 0;
- if (hasTitle) {
- String title = "<col=C96300>" + player.title + "</col>";
- if (player.titleBehindName) {
- s = title + " " + player.name;
- } else {
- s = player.name + " " + title;
- }
- } else {
- s = player.name;
- }
- s += combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
- } else {
- s = player.name + " (skill-" + player.skill + ")";
- }
- if (itemSelected == 1) {
- menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
- menuActionID[menuActionRow] = 491;
- menuActionCmd1[menuActionRow] = j;
- menuActionCmd2[menuActionRow] = i;
- menuActionCmd3[menuActionRow] = k;
- menuActionRow++;
- } else if (spellSelected == 1) {
- if ((spellUsableOn & 8) == 8) {
- menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
- menuActionID[menuActionRow] = 365;
- menuActionCmd1[menuActionRow] = j;
- menuActionCmd2[menuActionRow] = i;
- menuActionCmd3[menuActionRow] = k;
- menuActionRow++;
- }
- } else {
- for (int l = 4; l >= 0; l--)
- if (atPlayerActions[l] != null) {
- menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
- char c = '\0';
- if (atPlayerActions[l].equalsIgnoreCase("attack")) {
- int type = ClientSettings.getInt("attack_option_type");
- if (type != 2)
- if (type == 1 || player.combatLevel > myPlayer.combatLevel && type == 0)
- c = '\u07D0';
- if (myPlayer.team != 0 && player.team != 0)
- if (myPlayer.team == player.team)
- c = '\u07D0';
- else
- c = '\0';
- } else if (atPlayerArray[l])
- c = '\u07D0';
- if (l == 0)
- menuActionID[menuActionRow] = 561 + c;
- if (l == 1)
- menuActionID[menuActionRow] = 779 + c;
- if (l == 2)
- menuActionID[menuActionRow] = 27 + c;
- if (l == 3)
- menuActionID[menuActionRow] = 577 + c;
- if (l == 4)
- menuActionID[menuActionRow] = 729 + c;
- menuActionCmd1[menuActionRow] = j;
- menuActionCmd2[menuActionRow] = i;
- menuActionCmd3[menuActionRow] = k;
- menuActionRow++;
- }
- }
- for (int i1 = 0; i1 < menuActionRow; i1++) {
- if (menuActionID[i1] == 519) {
- menuActionName[i1] = "Walk here @whi@" + s;
- return;
- }
- }
- }
- private void method89(Class30_Sub1 class30_sub1) {
- int i = 0;
- int j = -1;
- int k = 0;
- int l = 0;
- if (class30_sub1.face == 0)
- i = worldController.method300(class30_sub1.heightLevel, class30_sub1.x, class30_sub1.y);
- if (class30_sub1.face == 1)
- i = worldController.method301(class30_sub1.heightLevel, class30_sub1.x, class30_sub1.y);
- if (class30_sub1.face == 2)
- i = worldController.method302(class30_sub1.heightLevel, class30_sub1.x, class30_sub1.y);
- if (class30_sub1.face == 3)
- i = worldController.method303(class30_sub1.heightLevel, class30_sub1.x, class30_sub1.y);
- if (i != 0) {
- int i1 = worldController.method304(class30_sub1.heightLevel, class30_sub1.x, class30_sub1.y, i);
- j = i >> 14 & 0x7fff;
- k = i1 & 0x1f;
- l = i1 >> 6;
- }
- class30_sub1.anInt1299 = j;
- class30_sub1.anInt1301 = k;
- class30_sub1.anInt1300 = l;
- }
- public void switchFonts() {
- FontStyle c1 = smallText;
- FontStyle c2 = regularText;
- FontStyle c3 = boldText;
- FontStyle c4 = aTextDrawingArea_1273;
- smallText = smallText_2;
- // regularText = regularText_2;
- // boldText = boldText_2;
- // aTextDrawingArea_1273 = aTextDrawingArea_1273_2;
- if (RSInterface.interfaceCache != null) {
- for (RSInterface inter : RSInterface.interfaceCache) {
- if (inter == null)
- continue;
- if (inter.textDrawingAreas == c1)
- inter.textDrawingAreas = smallText_2;
- if (inter.textDrawingAreas == c2)
- inter.textDrawingAreas = regularText_2;
- if (inter.textDrawingAreas == c3)
- inter.textDrawingAreas = boldText_2;
- if (inter.textDrawingAreas == c4)
- inter.textDrawingAreas = aTextDrawingArea_1273_2;
- }
- }
- smallText_2 = c1;
- regularText_2 = c2;
- boldText_2 = c3;
- aTextDrawingArea_1273_2 = c4;
- /*
- * RSFont c5 = newSmallFont; RSFont c6 = newRegularFont; RSFont c7 =
- * newBoldFont; RSFont c8 = newFancyFont;
- *
- * newSmallFont = newSmallFont_2; newRegularFont = newRegularFont_2;
- * newBoldFont = newBoldFont_2; newFancyFont = newFancyFont_2;
- *
- * newSmallFont_2 = c5; newRegularFont_2 = c6; newBoldFont_2 = c7;
- * newFancyFont_2 = c8;
- */
- }
- public static void restart() {
- try {
- final String javaBin = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java";
- File currentJar = new File(Client.class.getProtectionDomain().getCodeSource().getLocation().toURI());
- if (!currentJar.getName().endsWith(".jar"))
- return;
- final ArrayList<String> command = new ArrayList<String>();
- command.add(javaBin);
- command.add("-jar");
- command.add(currentJar.getPath());
- final ProcessBuilder builder = new ProcessBuilder(command);
- builder.start();
- } catch (Exception e) {
- e.printStackTrace();
- }
- System.exit(0);
- }
- void startUp() {
- Downloader cacheDownloader = new Downloader.CacheDownloader();
- Downloader mediaDownloader = new Downloader.MediaDownloader();
- Downloader rawDownloader = new Downloader.RawDownloader();
- try {
- drawSmoothLoadingText(20, "Starting up");
- if (Signlink.cache_dat != null) {
- for (int i = 0; i < 10; i++)
- decompressors[i] = new Decompressor(Signlink.cache_dat, Signlink.cache_idx[i], i + 1);
- } else {
- throw new IllegalStateException("No signlink cache dat!");
- }
- if (!Signlink.getCacheDirectory().equals(Signlink.getLocalCacheDirectory())) {
- cacheDownloader.download();
- mediaDownloader.download();
- rawDownloader.download();
- }
- Media.load();
- ClientSettings.setUnsaved("minimap_config");
- ClientSettings.load();
- titleStreamLoader = new StreamLoader(Media.getBytes("title_screen.dat"));
- aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
- aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
- smallText = new FontStyle(false, "p11_full", titleStreamLoader);
- regularText = new FontStyle(false, "p12_full", titleStreamLoader);
- boldText = new FontStyle(false, "b12_full", titleStreamLoader);
- aTextDrawingArea_1273 = new FontStyle(true, "q8_full", titleStreamLoader);
- smallText_2 = new FontStyle(false, "font9", titleStreamLoader);
- regularText_2 = new FontStyle(false, "font7", titleStreamLoader);
- boldText_2 = new FontStyle(false, "font8", titleStreamLoader);
- aTextDrawingArea_1273_2 = new FontStyle(true, "font4", titleStreamLoader);
- newSmallFont = new RSFont(false, "p11_full", titleStreamLoader);
- newRegularFont = new RSFont(false, "p12_full", titleStreamLoader);
- newBoldFont = new RSFont(false, "b12_full", titleStreamLoader);
- newFancyFont = new RSFont(true, "q8_full", titleStreamLoader);
- newSmallFont_2 = new RSFont(false, "font9", titleStreamLoader);
- newRegularFont_2 = new RSFont(false, "font7", titleStreamLoader);
- newBoldFont_2 = new RSFont(false, "font8", titleStreamLoader);
- newFancyFont_2 = new RSFont(true, "font4", titleStreamLoader);
- Object[][] newFontOffsets = { { smallText_2, newSmallFont_2, 0, -2 },
- { aTextDrawingArea_1273_2, newFancyFont_2, 0, 1 }, { boldText_2, newBoldFont_2, 0, -4 },
- { regularText_2, newRegularFont_2, 0, -4 }, };
- for (Object[] newFontOffset : newFontOffsets) {
- FontStyle font1 = (FontStyle) newFontOffset[0];
- for (int i = 0; i < font1.anIntArray1495.length; i++) {
- font1.anIntArray1495[i] += (int) newFontOffset[3];
- }
- RSFont font2 = (RSFont) newFontOffset[1];
- for (int i = 0; i < font2.characterDrawYOffsets.length; i++) {
- font2.characterDrawYOffsets[i] += (int) newFontOffset[3];
- }
- }
- // i == 9 ? -2 : i == 4 ? 1 : 0
- /*
- * for (Object[] newFont : newFonts) { if (newFont[0] instanceof
- * TextDrawingArea) { //((TextDrawingArea)
- * newFont[0]).anIntArray1494 = ((TextDrawingArea)
- * newFont[1]).anIntArray1494; ((TextDrawingArea)
- * newFont[0]).anIntArray1495 = ((TextDrawingArea)
- * newFont[1]).anIntArray1495; } else { ((RSFont)
- * newFont[0]).characterScreenWidths = ((RSFont)
- * newFont[1]).characterScreenWidths; } }
- */
- // switchFonts();
- /*
- * RSFont olds[] = {newSmallFont, newRegularFont, newBoldFont,
- * newFancyFont}; RSFont news[] = {newFonts[8], newFonts[6],
- * newFonts[7], newFonts[3]};
- */
- // GameObjectSpawns.init();
- StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
- StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
- StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
- this.mediaStreamLoader = streamLoader_2;
- StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
- StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
- streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
- byteGroundArray = new byte[4][104][104];
- intGroundArray = new int[4][105][105];
- worldController = new WorldController(intGroundArray);
- for (int j = 0; j < 4; j++)
- aClass11Array1230[j] = new Class11();
- minimapImage = new Sprite(512, 512);
- StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
- drawSmoothLoadingText(60, "Connecting to update server");
- onDemandFetcher = new OnDemandFetcher();
- onDemandFetcher.start(streamLoader_6, this);
- Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
- drawSmoothLoadingText(80, "Unpacking media");
- // onDemandFetcher.dumpMapsOSRS();
- /*
- * if(!lowMem) { nextSong = 56; try { nextSong =
- * Integer.parseInt(getParameter("music")); } catch(Exception _ex) {
- * } //songChanging = true; onDemandFetcher.method558(2, nextSong);
- * while(onDemandFetcher.getNodeCount() > 0) {
- * processOnDemandQueue(); try { Thread.sleep(100L); }
- * catch(Exception _ex) { } if(onDemandFetcher.anInt1349 > 3) {
- * //loadError(); throw new IllegalStateException(); } } }
- */
- SpriteLoader.unpackSprites();
- cacheSprites = SpriteLoader.sprites;
- cacheSprites2 = SpriteLoader.sprites2;
- cacheSprites3 = SpriteLoader.sprites3;
- loginSprites = new Sprite[11];
- for (int i = 0; i < loginSprites.length; i++) {
- loginSprites[i] = new Sprite("login/" + i);
- }
- multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
- mapBack = new Background(streamLoader_2, "mapback", 0);
- mapBack2 = new Background(streamLoader_2, "mapback", 1);
- for (int j3 = 0; j3 <= 14; j3++)
- sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
- compass = new Sprite(streamLoader_2, "compass", 0);
- try {
- for (int k3 = 0; k3 < 100; k3++)
- mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
- } catch (Exception _ex) {
- }
- try {
- for (int l3 = 0; l3 < 100; l3++)
- mapFunctions[l3] = new Sprite(streamLoader_2, "mapfunction", l3);
- } catch (Exception _ex) {
- }
- try {
- for (int i4 = 0; i4 < hitMarks.length; i4++) {
- hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
- }
- hitMarks[4] = new Sprite("hitmarks/venom");
- } catch (Exception _ex) {
- _ex.printStackTrace();
- }
- try {
- for (int h1 = 0; h1 < 6; h1++)
- headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
- } catch (Exception _ex) {
- }
- try {
- for (int j4 = 0; j4 < 18; j4++)
- headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);
- for (int j45 = 0; j45 < 3; j45++)
- skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45);
- } catch (Exception _ex) {
- }
- mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
- mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
- for (int k4 = 0; k4 < 8; k4++)
- crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
- mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
- mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
- mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
- mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
- mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
- mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
- scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
- scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
- for (int l4 = 0; l4 < modIcons.length; l4++)
- modIcons[l4] = new Sprite("crowns/" + l4);
- Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
- leftFrame = new ImageProducer(sprite.myWidth, sprite.myHeight);
- sprite.method346(0, 0);
- sprite = new Sprite(streamLoader_2, "screenframe", 1);
- topFrame = new ImageProducer(sprite.myWidth, sprite.myHeight);
- sprite.method346(0, 0);
- int i5 = (int) (Math.random() * 21D) - 10;
- int j5 = (int) (Math.random() * 21D) - 10;
- int k5 = (int) (Math.random() * 21D) - 10;
- int l5 = (int) (Math.random() * 41D) - 20;
- for (int i6 = 0; i6 < 100; i6++) {
- if (mapFunctions[i6] != null)
- mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
- if (mapScenes[i6] != null)
- mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
- }
- drawSmoothLoadingText(83, "Unpacking textures");
- Texture.method368(streamLoader_3);
- Texture.method372(0.80000000000000004D);
- Texture.method367(20);
- drawSmoothLoadingText(86, "Unpacking config");
- // repackCacheIndex(1);
- // repackCacheIndex(2);
- // repackCacheIndex(4);
- // repackCacheIndex(5);
- // repackCacheIndex(6);
- // repackCacheIndex(7);
- // repackCacheIndex(8);
- // repackCacheIndex(9);
- preloadModels("/raw/models/", 0);
- // preloadModels("/raw/models-osrs/", 2);
- preloadAnims();
- // preloadMaps();
- Animation.unpackConfig(streamLoader);
- ObjectDefinition.unpackConfig(streamLoader);
- Floor.unpackConfig(streamLoader);
- OverlayFlo.unpackConfig(streamLoader);
- ItemDefinition.unpackConfig(streamLoader);
- NpcDefinition.unpackConfig(streamLoader);
- IdentityKit.unpackConfig(streamLoader);
- SpotAnim.unpackConfig(streamLoader);
- Varp.unpackConfig(streamLoader);
- VarBit.unpackConfig(streamLoader);
- InterfaceDropTables.load();
- ItemDefinition.isMembers = isMembers;
- drawSmoothLoadingText(95, "Unpacking interfaces");
- FontStyle aclass30_sub2_sub1_sub4s[] = { smallText, regularText, boldText, aTextDrawingArea_1273 };
- RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
- MikeysInterfaces.loadInterfaces(aclass30_sub2_sub1_sub4s);
- Widgets.load();
- // RSInterface.printInterfaceIndexGaps();
- drawSmoothLoadingText(100, "Preparing game engine");
- configureMinimap(1);
- setBounds();
- Censor.loadConfig(streamLoader_4);
- mouseDetection = new MouseDetection(this);
- startRunnable(mouseDetection, 10);
- Animable_Sub5.clientInstance = this;
- ObjectDefinition.clientInstance = this;
- NpcDefinition.clientInstance = this;
- RSFont.unpackChatImages();
- if (Configuration.DUMP_OTHER_INDEXES) {
- onDemandFetcher.dumpMaps();
- onDemandFetcher.dumpAnims();
- }
- // unpackCacheIndex(4, 100_000);
- // unpackCacheIndex(9, 100_000);
- // onDemandFetcher.dumpTheModels();
- System.gc();
- return;
- } catch (Exception exception) {
- exception.printStackTrace();
- try {
- cacheDownloader.updateVersion(-1);
- mediaDownloader.updateVersion(-1);
- rawDownloader.updateVersion(-1);
- System.out.println("here");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- loadingError = true;
- }
- private void method91(RSBuffer stream, int i) {
- while (stream.bitPosition + 10 < i * 8) {
- int j = stream.readBits(11);
- if (j == 2047)
- break;
- if (playerArray[j] == null) {
- playerArray[j] = new Player();
- if (aStreamArray895s[j] != null)
- playerArray[j].updatePlayer(aStreamArray895s[j]);
- }
- playerIndices[playerCount++] = j;
- Player player = playerArray[j];
- player.anInt1537 = loopCycle;
- int k = stream.readBits(1);
- if (k == 1)
- anIntArray894[anInt893++] = j;
- int l = stream.readBits(1);
- int i1 = stream.readBits(5);
- if (i1 > 15)
- i1 -= 32;
- int j1 = stream.readBits(5);
- if (j1 > 15)
- j1 -= 32;
- player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
- }
- stream.finishBitAccess();
- }
- public String indexLocation(int cacheIndex, int index) {
- return Signlink.getCacheDirectory() + "index" + cacheIndex + "/" + (index != -1 ? index + ".gz" : "");
- }
- public void repackCacheIndex(int cacheIndex) {
- System.out.println("Started repacking index " + cacheIndex + ".");
- int indexLength = new File(indexLocation(cacheIndex, -1)).listFiles().length;
- File[] file = new File(indexLocation(cacheIndex, -1)).listFiles();
- try {
- for (int index = 0; index < indexLength; index++) {
- int fileIndex = Integer.parseInt(getFileNameWithoutExtension(file[index].toString()));
- byte[] data = fileToByteArray(cacheIndex, fileIndex);
- if (data != null && data.length > 0) {
- decompressors[cacheIndex].method234(data.length, data, fileIndex);
- System.out.println("Repacked " + fileIndex + ".");
- } else {
- System.out.println("Unable to locate index " + fileIndex + ".");
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- System.out.println("Error packing cache index " + cacheIndex + ".");
- }
- System.out.println("Finished repacking " + cacheIndex + ".");
- }
- public void unpackCacheIndex(int cacheIndex, int limit) {
- Path directory = Paths.get(Signlink.getCacheDirectory(), "dump" + cacheIndex);
- System.out.println("Started unpacking index " + cacheIndex + ".");
- try {
- Files.createDirectories(directory);
- for (int index = 0; index < limit; index++) {
- try {
- byte[] data = decompressors[cacheIndex].decompress(index);
- if (data != null && data.length > 0) {
- FileOutputStream out = new FileOutputStream(directory.resolve(index + ".gz").toFile());
- out.write(data);
- out.close();
- System.out.println("Unpacking " + cacheIndex + " file: " + index + ".");
- } else {
- }
- } catch (IOException io) {
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- System.out.println("Finished unpacking " + cacheIndex + ".");
- }
- public byte[] fileToByteArray(int cacheIndex, int index) {
- try {
- if (indexLocation(cacheIndex, index).length() <= 0 || indexLocation(cacheIndex, index) == null) {
- return null;
- }
- File file = new File(indexLocation(cacheIndex, index));
- byte[] fileData = new byte[(int) file.length()];
- FileInputStream fis = new FileInputStream(file);
- fis.read(fileData);
- fis.close();
- return fileData;
- } catch (Exception e) {
- return null;
- }
- }
- public 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);
- }
- private void processMainScreenClick() {
- if (anInt1021 != 0)
- return;
- if (!this.menuOpen && menuActionRow == 1 && super.clickMode3 == 1) {
- Point minimapPoint = gameframe.getMinimapPoint();
- int i = super.saveClickX - 25 - 550;
- int j = super.saveClickY - 5 - 4;
- if (frameMode != ScreenMode.FIXED) {
- i = super.saveClickX - 59 - (frameWidth - gameframe.getFixedMapArea().myWidth + 26) - minimapPoint.x;
- j -= minimapPoint.y;
- } else {
- i -= minimapPoint.x;
- j -= minimapPoint.y;
- }
- if (i >= 0 && j >= 0 && i < 146 && j < 151) {
- i -= 73;
- j -= 75;
- int k = minimapInt1 + minimapInt2 & 0x7ff;
- int i1 = Texture.anIntArray1470[k];
- int j1 = Texture.anIntArray1471[k];
- i1 = i1 * (minimapInt3 + 256) >> 8;
- j1 = j1 * (minimapInt3 + 256) >> 8;
- int k1 = j * i1 + i * j1 >> 11;
- int l1 = j * j1 - i * i1 >> 11;
- int i2 = myPlayer.x + k1 >> 7;
- int j2 = myPlayer.y - l1 >> 7;
- boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
- if (flag1) {
- stream.writeByte(i);
- stream.writeByte(j);
- stream.writeWord(minimapInt1);
- stream.writeByte(57);
- stream.writeByte(minimapInt2);
- stream.writeByte(minimapInt3);
- stream.writeByte(89);
- stream.writeWord(myPlayer.x);
- stream.writeWord(myPlayer.y);
- stream.writeByte(anInt1264);
- stream.writeByte(63);
- }
- }
- /*
- * anInt1117++; if (anInt1117 > 1151) { anInt1117 = 0;
- * stream.createFrame(246); stream.writeWordBigEndian(0); int l =
- * stream.currentOffset; if ((int) (Math.random() * 2D) == 0)
- * stream.writeWordBigEndian(101); stream.writeWordBigEndian(197);
- * stream.writeWord((int) (Math.random() * 65536D));
- * stream.writeWordBigEndian((int) (Math.random() * 256D));
- * stream.writeWordBigEndian(67); stream.writeWord(14214); if ((int)
- * (Math.random() * 2D) == 0) stream.writeWord(29487);
- * stream.writeWord((int) (Math.random() * 65536D)); if ((int)
- * (Math.random() * 2D) == 0) stream.writeWordBigEndian(220);
- * stream.writeWordBigEndian(180);
- * stream.writeBytes(stream.currentOffset - l); }
- */
- }
- }
- private String interfaceIntToString(long j) {
- if (j < Long.MAX_VALUE) {
- return TextClass.putCommasInNumber(j);/// XXX: changed from
- /// String.valueOf(j) to
- /// make numbers in
- /// interfaces look better
- } else {
- return "*";
- }
- }
- private void showErrorScreen() {
- Graphics g = getGameComponent().getGraphics();
- g.setColor(Color.black);
- g.fillRect(0, 0, 765, 503);
- method4(1);
- if (loadingError) {
- long time = System.currentTimeMillis();
- while (true) {
- long seconds = 10 - ((System.currentTimeMillis() - time) / 1_000);
- aBoolean831 = false;
- g.setColor(Color.black);
- g.fillRect(0, 0, 765, 503);
- g.setFont(new Font("Helvetica", 1, 16));
- g.setColor(Color.yellow);
- int k = 35;
- g.drawString("A fatal error has occured.", 30, k);
- k += 50;
- g.setColor(Color.white);
- g.drawString("The client will automatically try to resolve it.", 30, k);
- k += 50;
- g.drawString("Please do not close the client window.", 30, k);
- k += 50;
- g.drawString("Restarting in " + seconds + "...", 30, k);
- k += 50;
- // g.drawString("Restarting in " + seconds + "...", 30, k);
- k += 50;
- if (seconds == 0) {
- restart();
- }
- try {
- Thread.sleep(50);
- } catch (Exception e) {
- }
- }
- }
- 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 " + Configuration.SERVER_NAME + " make sure you play from", 50, 100);
- g.drawString("http://www.UrlHere.com", 50, 150);
- }
- if (rsAlreadyLoaded) {
- aBoolean831 = false;
- g.setColor(Color.yellow);
- int l = 35;
- g.drawString("Error a copy of " + Configuration.SERVER_NAME + " 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(getCurrentWorld().getAddress() + ":" + (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.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184) {
- entity.anim = -1;
- entity.anInt1520 = -1;
- entity.anInt1547 = 0;
- entity.anInt1548 = 0;
- entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
- entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
- entity.method446();
- }
- if (entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776)) {
- entity.anim = -1;
- entity.anInt1520 = -1;
- entity.anInt1547 = 0;
- entity.anInt1548 = 0;
- entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
- entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
- entity.method446();
- }
- if (entity.anInt1547 > loopCycle)
- method97(entity);
- else if (entity.anInt1548 >= loopCycle)
- method98(entity);
- else
- method99(entity);
- method100(entity);
- method101(entity);
- }
- private void method97(Entity entity) {
- int i = entity.anInt1547 - loopCycle;
- int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
- int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
- entity.x += (j - entity.x) / i;
- entity.y += (k - entity.y) / i;
- entity.anInt1503 = 0;
- if (entity.anInt1549 == 0)
- entity.turnDirection = 1024;
- if (entity.anInt1549 == 1)
- entity.turnDirection = 1536;
- if (entity.anInt1549 == 2)
- entity.turnDirection = 0;
- if (entity.anInt1549 == 3)
- entity.turnDirection = 512;
- }
- private void method98(Entity entity) {
- if (entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0
- || entity.anInt1528 + 1 > Animation.getAnim(entity, entity.anim).method258(entity.anInt1527)) {
- int i = entity.anInt1548 - entity.anInt1547;
- int j = loopCycle - entity.anInt1547;
- int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
- int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
- int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
- int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
- entity.x = (k * (i - j) + i1 * j) / i;
- entity.y = (l * (i - j) + j1 * j) / i;
- }
- entity.anInt1503 = 0;
- if (entity.anInt1549 == 0)
- entity.turnDirection = 1024;
- if (entity.anInt1549 == 1)
- entity.turnDirection = 1536;
- if (entity.anInt1549 == 2)
- entity.turnDirection = 0;
- if (entity.anInt1549 == 3)
- entity.turnDirection = 512;
- entity.anInt1552 = entity.turnDirection;
- }
- private void method99(Entity entity) {
- entity.anInt1517 = entity.anInt1511;
- if (entity.smallXYIndex == 0) {
- entity.anInt1503 = 0;
- return;
- }
- if (entity.anim != -1 && entity.anInt1529 == 0) {
- Animation animation = Animation.getAnim(entity, entity.anim);
- if (entity.anInt1542 > 0 && animation.anInt363 == 0) {
- entity.anInt1503++;
- return;
- }
- if (entity.anInt1542 <= 0 && animation.anInt364 == 0) {
- entity.anInt1503++;
- return;
- }
- }
- int i = entity.x;
- int j = entity.y;
- int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
- int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
- if (k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256) {
- entity.x = k;
- entity.y = 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.anInt1552 & 0x7ff;
- if (i1 > 1024)
- i1 -= 2048;
- int j1 = entity.anInt1555;
- if (i1 >= -256 && i1 <= 256)
- j1 = entity.anInt1554;
- else if (i1 >= 256 && i1 < 768)
- j1 = entity.anInt1557;
- else if (i1 >= -768 && i1 <= -256)
- j1 = entity.anInt1556;
- if (j1 == -1)
- j1 = entity.anInt1554;
- entity.anInt1517 = j1;
- int k1 = 4;
- if (entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
- k1 = 2;
- if (entity.smallXYIndex > 2)
- k1 = 6;
- if (entity.smallXYIndex > 3)
- k1 = 8;
- if (entity.anInt1503 > 0 && entity.smallXYIndex > 1) {
- k1 = 8;
- entity.anInt1503--;
- }
- if (entity.aBooleanArray1553[entity.smallXYIndex - 1])
- k1 <<= 1;
- if (k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
- entity.anInt1517 = entity.anInt1505;
- if (i < k) {
- entity.x += k1;
- if (entity.x > k)
- entity.x = k;
- } else if (i > k) {
- entity.x -= k1;
- if (entity.x < k)
- entity.x = k;
- }
- if (j < l) {
- entity.y += k1;
- if (entity.y > l)
- entity.y = l;
- } else if (j > l) {
- entity.y -= k1;
- if (entity.y < l)
- entity.y = l;
- }
- if (entity.x == k && entity.y == l) {
- entity.smallXYIndex--;
- if (entity.anInt1542 > 0)
- entity.anInt1542--;
- }
- }
- private void method100(Entity entity) {
- if (entity.anInt1504 == 0)
- return;
- if (entity.interactingEntity != -1 && entity.interactingEntity < 32768) {
- Npc npc = npcArray[entity.interactingEntity];
- if (npc != null) {
- int i1 = entity.x - npc.x;
- int k1 = entity.y - npc.y;
- 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 == unknownInt10)
- j = myPlayerIndex;
- Player player = playerArray[j];
- if (player != null) {
- int l1 = entity.x - player.x;
- int i2 = entity.y - player.y;
- if (l1 != 0 || i2 != 0)
- entity.turnDirection = (int) (Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
- }
- }
- if ((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0)) {
- int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
- int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
- if (k != 0 || j1 != 0)
- entity.turnDirection = (int) (Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
- entity.anInt1538 = 0;
- entity.anInt1539 = 0;
- }
- int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
- if (l != 0) {
- if (l < entity.anInt1504 || l > 2048 - entity.anInt1504)
- entity.anInt1552 = entity.turnDirection;
- else if (l > 1024)
- entity.anInt1552 -= entity.anInt1504;
- else
- entity.anInt1552 += entity.anInt1504;
- entity.anInt1552 &= 0x7ff;
- if (entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection) {
- if (entity.anInt1512 != -1) {
- entity.anInt1517 = entity.anInt1512;
- return;
- }
- entity.anInt1517 = entity.anInt1554;
- }
- }
- }
- public void method101(Entity entity) {
- entity.aBoolean1541 = false;
- if (entity.anInt1517 > Animation.anims().length)
- entity.anInt1517 = -1;
- if (entity.anInt1517 != -1) {
- Animation animation = Animation.getAnim(entity, entity.anInt1517);
- entity.anInt1519++;
- if (entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518)) {
- entity.anInt1519 = 1;
- entity.anInt1518++;
- entity.nextIdleAnimationFrame++;// Tweening code added
- }
- // XXX: Tweening code
- entity.nextIdleAnimationFrame = entity.anInt1518 + 1;
- if (entity.nextIdleAnimationFrame >= animation.anInt352) {
- if (entity.nextIdleAnimationFrame >= animation.anInt352)
- entity.nextIdleAnimationFrame = 0;
- }
- // End tweening code
- if (entity.anInt1518 >= animation.anInt352) {
- entity.anInt1519 = 1;
- entity.anInt1518 = 0;
- }
- }
- if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
- if (entity.anInt1521 < 0)
- entity.anInt1521 = 0;
- SpotAnim gfx = SpotAnim.getGfx(entity, entity.anInt1520);
- Animation animation_1 = gfx.aAnimation_407;
- if (animation_1 != null) {
- for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352
- && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
- entity.anInt1522 -= animation_1.method258(entity.anInt1521);
- if (entity.anInt1521 >= animation_1.anInt352
- && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
- entity.anInt1520 = -1;
- }
- }
- if (entity.anim != -1 && entity.anInt1529 <= 1) {
- Animation animation_2 = Animation.getAnim(entity, entity.anim);
- if (animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle
- && entity.anInt1548 < loopCycle) {
- entity.anInt1529 = 1;
- return;
- }
- }
- if (entity.anim != -1 && entity.anInt1529 == 0) {
- Animation animation_3 = Animation.getAnim(entity, entity.anim);
- for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352
- && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
- entity.anInt1528 -= animation_3.method258(entity.anInt1527);
- if (entity.anInt1527 >= animation_3.anInt352) {
- entity.anInt1527 -= animation_3.anInt356;
- entity.anInt1530++;
- if (entity.anInt1530 >= animation_3.anInt362)
- entity.anim = -1;
- if (entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
- entity.anim = -1;
- }
- // XXX: Tweening code
- entity.nextAnimationFrame = entity.anInt1527 + 1;
- if (entity.nextAnimationFrame >= animation_3.anInt352) {
- if (entity.anInt1530 >= animation_3.anInt362)
- entity.nextAnimationFrame = entity.anInt1527 + 1;
- if (entity.nextAnimationFrame < 0 || entity.nextAnimationFrame >= animation_3.anInt352)
- entity.nextAnimationFrame = entity.anInt1527;
- }
- // End tweening code
- entity.aBoolean1541 = animation_3.aBoolean358;
- }
- if (entity.anInt1529 > 0)
- entity.anInt1529--;
- }
- 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.initDrawingArea();
- Texture.anIntArray1472 = fullScreenTextureArray;
- DrawingArea.setAllPixelsToZero();
- welcomeScreenRaised = true;
- if (openInterfaceID != -1) {
- RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
- if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
- rsInterface_1.width = 765;
- rsInterface_1.height = 503;
- }
- drawInterface(0, 0, rsInterface_1, 8);
- }
- RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
- if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
- rsInterface.width = 765;
- rsInterface.height = 503;
- }
- drawInterface(0, 0, rsInterface, 8);
- if (!menuOpen) {
- processRightClick();
- drawTooltip();
- } else {
- drawMenu(frameMode == ScreenMode.FIXED ? 4 : 0, frameMode == ScreenMode.FIXED ? 4 : 0);
- }
- }
- drawCount++;
- super.fullGameScreen.drawGraphics(0, super.graphics, 0);
- return;
- } else {
- if (drawCount != 0) {
- resetImageProducers2();
- }
- }
- if (welcomeScreenRaised) {
- welcomeScreenRaised = false;
- if (frameMode == ScreenMode.FIXED) {
- topFrame.drawGraphics(0, super.graphics, 0);
- leftFrame.drawGraphics(4, super.graphics, 0);
- /*
- * backLeftIP2.drawGraphics(357, super.graphics, 0);
- * backRightIP1.drawGraphics(4, super.graphics, 722);
- * backRightIP2.drawGraphics(205, super.graphics, 743);
- * backTopIP1.drawGraphics(0, super.graphics, 0);
- * backVmidIP1.drawGraphics(4, super.graphics, 516);
- * backVmidIP2.drawGraphics(205, super.graphics, 516);
- * backVmidIP3.drawGraphics(357, super.graphics, 496);
- * backVmidIP2_2.drawGraphics(338, super.graphics, 0);
- */
- aRSImageProducer_1164.initDrawingArea();
- gameframe.getFixedMapArea().drawSprite(0, 0);
- if (ClientSettings.getBoolean("orbs_enabled")) {
- gameframe.drawOrbs(0);
- }
- // gameframe.drawTeleportOrb(0);
- gameframe.onMinimapDraw();
- Point compassPoint = gameframe.getCompassPoint();
- int offsetX = frameMode == ScreenMode.FIXED ? 0
- : (frameWidth - gameframe.getFixedMapArea().myWidth + 26);
- compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 4 + compassPoint.y,
- 34 + offsetX + compassPoint.x, 33, 25);
- aRSImageProducer_1163.initDrawingArea();
- gameframe.drawTabArea();
- }
- aRSImageProducer_1165.initDrawingArea();
- int offset = frameMode == ScreenMode.FIXED ? 4 : 0;
- aRSImageProducer_1165.drawGraphics(offset, super.graphics, offset);
- if (frameMode == ScreenMode.FIXED) {
- aRSImageProducer_1164.drawGraphics(0, super.graphics, 516);
- aRSImageProducer_1163.drawGraphics(168, super.graphics, 516);
- }
- // needDrawTabArea = true;
- inputTaken = true;
- tabAreaAltered = true;
- // aBoolean1233 = true;
- if (loadingStage != 2) {
- // aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
- // aRSImageProducer_1164.drawGraphics(4, super.graphics, 550);
- }
- }
- if (invOverlayInterfaceID != -1) {
- method119(anInt945, invOverlayInterfaceID);
- }
- gameframe.drawTabArea();
- if (backDialogID == -1 && inputDialogState == 3) {
- int position = totalItemResults * 14 + 7;
- aClass9_1059.scrollPosition = itemResultScrollPos;
- if (super.mouseX > 478 && super.mouseX < 580 && super.mouseY > (screenAreaHeight - 161)) {
- method65(494, 110, super.mouseX - 0, super.mouseY - (screenAreaHeight - 155), aClass9_1059, 0, false,
- totalItemResults);
- }
- int scrollPosition = aClass9_1059.scrollPosition;
- if (scrollPosition < 0) {
- scrollPosition = 0;
- }
- if (scrollPosition > position - 110) {
- scrollPosition = position - 110;
- }
- if (itemResultScrollPos != scrollPosition) {
- itemResultScrollPos = scrollPosition;
- inputTaken = true;
- }
- } else if (backDialogID == -1) {
- boolean fixed = frameMode == ScreenMode.FIXED;
- // int scrollbarYOffset = gameframe.getScrollbarYOffset() -
- // gameframe.getScrollbarYOffset();
- int mouseYOffset = fixed ? 332 + 24 : frameHeight - 148;
- aClass9_1059.scrollPosition = anInt1211 - anInt1089 - (77 + gameframe.getScrollbarLengthOffset());
- /*
- * if(super.mouseX > 448 + gameframe.getScrollbarXOffset() &&
- * super.mouseX < 560 + gameframe.getScrollbarXOffset() &&
- * super.mouseY > mouseYOffset) {
- */
- method65(463 + gameframe.getScrollbarXOffset(), (77 + gameframe.getScrollbarLengthOffset()),
- super.mouseX - 17, super.mouseY - mouseYOffset, aClass9_1059, 0 + gameframe.getScrollbarYOffset(),
- false, anInt1211);
- // }
- int i = anInt1211 - (77 + gameframe.getScrollbarLengthOffset()) - aClass9_1059.scrollPosition;
- if (i < 0)
- i = 0;
- if (i > anInt1211 - (77 + gameframe.getScrollbarLengthOffset()))
- i = anInt1211 - (77 + gameframe.getScrollbarLengthOffset());
- if (anInt1089 != i) {
- anInt1089 = i;
- 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;
- gameframe.drawChatArea();
- if (inputTaken) {
- inputTaken = false;
- }
- // } else {
- // gameframe.drawChannelModes();
- // }
- if (loadingStage == 2)
- method146();
- if (loadingStage == 2) {
- if (frameMode == ScreenMode.FIXED) {
- gameframe.drawMinimap();
- aRSImageProducer_1164.drawGraphics(0, super.graphics, 516);
- }
- }
- if (anInt1054 != -1)
- tabAreaAltered = true;
- if (tabAreaAltered) {
- if (anInt1054 != -1 && anInt1054 == tabID) {
- anInt1054 = -1;
- stream.createFrame(120);
- stream.writeByte(tabID);
- }
- tabAreaAltered = false;
- aRSImageProducer_1125.initDrawingArea();
- aRSImageProducer_1165.initDrawingArea();
- }
- anInt945 = 0;
- }
- private boolean buildFriendsListMenu(RSInterface class9) {
- int i = class9.contentType;
- if (i >= 1 && i <= 200 || i >= 701 && i <= 900) {
- if (i >= 801)
- i -= 701;
- else if (i >= 701)
- i -= 601;
- else if (i >= 101)
- i -= 101;
- else
- i--;
- menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
- menuActionID[menuActionRow] = 792;
- menuActionRow++;
- menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
- menuActionID[menuActionRow] = 639;
- menuActionRow++;
- return true;
- }
- if (i >= 401 && i <= 500) {
- menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
- menuActionID[menuActionRow] = 322;
- menuActionRow++;
- return true;
- } else {
- return false;
- }
- }
- private void method104() {
- Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056.reverseGetFirst();
- for (; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3) aClass19_1056.reverseGetNext())
- if (class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
- class30_sub2_sub4_sub3.unlink();
- else if (loopCycle >= class30_sub2_sub4_sub3.anInt1564) {
- class30_sub2_sub4_sub3.method454(anInt945);
- if (class30_sub2_sub4_sub3.aBoolean1567)
- class30_sub2_sub4_sub3.unlink();
- else
- worldController.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);
- }
- }
- public void drawBlackBox(int xPos, int yPos) {
- DrawingArea.drawPixels(xPos - 2, yPos - 1, 1, 71, 0x726451);
- DrawingArea.drawPixels(xPos + 174, yPos, 1, 69, 0x726451);
- DrawingArea.drawPixels(xPos - 2, yPos - 2, 178, 1, 0x726451);
- DrawingArea.drawPixels(xPos, yPos + 68, 174, 1, 0x726451);
- DrawingArea.drawPixels(xPos - 1, yPos - 1, 1, 71, 0x2E2B23);
- DrawingArea.drawPixels(xPos + 175, yPos - 1, 1, 71, 0x2E2B23);
- DrawingArea.drawPixels(xPos, yPos - 1, 175, 1, 0x2E2B23);
- DrawingArea.drawPixels(xPos, yPos + 69, 175, 1, 0x2E2B23);
- DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
- }
- public void drawInterface(int j, int k, RSInterface class9, int l) {
- if (class9 == null)
- class9 = RSInterface.interfaceCache[0];
- if (class9.type != 0 || class9.children == null)
- return;
- if (class9.mouseOverTriggered && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id) {
- return;
- }
- int i1 = DrawingArea.topX;
- int j1 = DrawingArea.topY;
- int k1 = DrawingArea.bottomX;
- int l1 = DrawingArea.bottomY;
- DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
- int i2 = class9.children.length;
- boolean drawnNoitemSprite = false;
- for (int j2 = 0; j2 < i2; j2++) {
- int k2 = class9.childX[j2] + k;
- int l2 = (class9.childY[j2] + l) - j;
- RSInterface child = RSInterface.interfaceCache[class9.children[j2]];
- if (child == null || child.hidden) {
- continue;
- }
- if (interfaceIds) {
- newSmallFont.drawBasicString("" + child.id, k2, l2, Integer.MAX_VALUE, 0);
- }
- k2 += child.anInt263;
- l2 += child.anInt265;
- if (child.contentType > 0)
- drawFriendsListOrWelcomeScreen(child);
- //
- for (int m5 = 0; m5 < IDs.length; m5++) {
- if (child.id == IDs[m5] + 1) {
- if (m5 > 61)
- drawBlackBox(k2 + 1, l2);
- else
- drawBlackBox(k2, l2 + 1);
- }
- } /// XXX: ruse hardcode shit between //'s
- for (int r = 0; r < runeChildren.length; r++)
- if (child.id == runeChildren[r])
- child.modelZoom = 775;
- // if(child.id == 1194 || child.id == 12856) //Removes black boxes
- // when not hovering in spellbook
- // continue;
- //
- 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(child.scrollPosition, k2, child, l2);
- if (child.scrollMax > child.height)
- drawScrollbar(child.height, child.scrollPosition, l2, k2 + child.width, child.scrollMax, false);
- } else if (child.type != 1)
- if (child.type == 2) {
- boolean search = child.itemSearch && friendsListAction == -1 && promptInput != null
- && promptInput.length() > 0;
- if (!messagePromptRaised && search)
- search = false;
- boolean clearWhiteSpace = !search && child.invClearWhiteSpace;
- int i3 = search ? 0 : class9.invStartIndex;
- int results = -1;
- int yoffset = 0;
- if (child.invDynamicScrollbar) {
- int invScrollMax = child.invDefaultScrollMax;
- int items = 0;
- for (int l6 = 0; l6 < child.height; l6++) {
- if (clearWhiteSpace && child.invClearWhiteSpaceSeperator != null) {
- if (l6 != 0 && l6 != child.height - 1
- && l6 * child.width % child.invWhiteSpaceSeperatorCutoff == 0) {
- for (int i7 = l6 * child.width; i7 < (l6 * child.width) + 100; i7++) {
- if (child.inv[i7] > 0) {
- invScrollMax += 20;
- break;
- }
- }
- }
- }
- int spritePadY = child.invSpritePadY;
- for (int l8 = 0; l8 < child.width; l8++) {
- if (child.inv[(l6 * child.width) + l8] > 0) {
- items++;
- if (items * (32 + spritePadY) >= RSInterface.get(child.parentID).height) {
- invScrollMax += (32 + spritePadY);
- }
- break;
- }
- }
- }
- class9.scrollMax = invScrollMax;
- }
- for (int l3 = 0; l3 < child.height; l3++) {
- if (clearWhiteSpace && child.invClearWhiteSpaceSeperator != null) {
- if (l3 != 0 && l3 != child.height - 1
- && l3 * child.width % child.invWhiteSpaceSeperatorCutoff == 0) {
- int j6 = l2 + (results / child.width) * (32 + child.invSpritePadY);
- if (results == -1)
- j6 -= 38;
- for (int i7 = l3 * child.width; i7 < (l3 * child.width) + 100; i7++) {
- if (child.inv[i7] > 0) {
- yoffset += 20;
- child.invClearWhiteSpaceSeperator.drawSprite(k2 - 8, j6 - 4 + 38 + yoffset - 8);
- break;
- }
- }
- }
- }
- if (clearWhiteSpace) {
- int items = 0;
- for (int l4 = 0; l4 < child.width; l4++) {
- if (i3 >= child.inv.length)
- continue;
- if (child.inv[i3 + l4] > 0) {
- items++;
- }
- }
- if (items == 0) {
- i3 += child.width;
- continue;
- }
- }
- for (int l4 = 0; l4 < child.width; l4++) {
- if (i3 >= child.inv.length)
- continue;
- if (search && child.inv[i3] > 0) {
- ItemDefinition itemdef = ItemDefinition.forID(child.inv[i3] - 1);
- if (itemdef == null || itemdef.name == null
- || !itemdef.name.toLowerCase().contains(promptInput.toLowerCase())) {
- i3++;
- continue;
- }
- results++;
- }
- if (clearWhiteSpace) {
- results++;
- }
- int k5 = k2 + (search || clearWhiteSpace ? (results % child.width) : l4)
- * (32 + child.invSpritePadX);
- int j6 = (l2 + ((search || clearWhiteSpace ? (results / child.width) : l3))
- * (32 + child.invSpritePadY)) + yoffset;
- if (i3 < 20) {
- k5 += child.spritesX[i3];
- j6 += child.spritesY[i3];
- }
- if (child.inv[i3] > 0) {
- if (child.invItemSprite != null)
- child.invItemSprite.drawSprite(k5, j6);
- int k6 = 0;
- int j7 = 0;
- int j9 = child.inv[i3] - 1;
- if (k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32
- && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
- int l9 = 0;
- if (itemSelected == 1 && anInt1283 == i3 && anInt1284 == child.id)
- l9 = 0xffffff;
- Sprite class30_sub2_sub1_sub1_2 = ItemDefinition.getSprite(j9,
- child.invStackSizes[i3], l9);
- if (class30_sub2_sub1_sub1_2 != null) {
- if (activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == child.id) {
- k6 = super.mouseX - anInt1087;
- j7 = super.mouseY - anInt1088;
- if (k6 < 5 && k6 > -5)
- k6 = 0;
- if (j7 < 5 && j7 > -5)
- j7 = 0;
- if (anInt989 < ClientSettings.getInt("dragging_threshold")) {
- k6 = 0;
- j7 = 0;
- }
- class30_sub2_sub1_sub1_2.drawSprite1(k5 + k6, j6 + j7);
- currentDragSprite = class30_sub2_sub1_sub1_2;
- currentDragX = k5 + k6;
- currentDragY = j6 + j7;
- currentDragAmount = child.hideInvStackSizes ? -1 : child.invStackSizes[i3];
- currentDragAmountX = j6 + 9 + j7;
- currentDragAmountY = k5 + k6;
- if (j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
- int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
- if (i10 > anInt945 * 10)
- i10 = anInt945 * 10;
- if (i10 > class9.scrollPosition)
- i10 = class9.scrollPosition;
- class9.scrollPosition -= i10;
- anInt1088 += i10;
- }
- if (j6 + j7 + 32 > DrawingArea.bottomY
- && class9.scrollPosition < class9.scrollMax - class9.height) {
- int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
- if (j10 > anInt945 * 10)
- j10 = anInt945 * 10;
- if (j10 > class9.scrollMax - class9.height - class9.scrollPosition)
- j10 = class9.scrollMax - class9.height - class9.scrollPosition;
- class9.scrollPosition += j10;
- anInt1088 -= j10;
- }
- } else if (atInventoryInterfaceType != 0 && atInventoryIndex == i3
- && atInventoryInterface == child.id)
- class30_sub2_sub1_sub1_2.drawSprite1(k5, j6);
- else
- class30_sub2_sub1_sub1_2.drawSprite(k5, j6);
- if (class30_sub2_sub1_sub1_2.anInt1444 == 33 || child.invStackSizes[i3] != 1) {
- int k10 = child.invStackSizes[i3];
- if (!child.hideInvStackSizes) {
- if (k10 >= 1500000000 && child.drawInfinity) {
- SpriteLoader.sprites[653].drawSprite(k5, j6);
- } else {
- smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
- if (k10 >= 1)
- smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7,
- k5 + k6);
- if (k10 >= 100000)
- smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7,
- k5 + k6);
- if (k10 >= 10000000)
- smallText.method385(0x00FF80, intToKOrMil(k10), j6 + 9 + j7,
- k5 + k6);
- }
- }
- }
- }
- }
- } else if (child.sprites != null && i3 < 20) {
- Sprite class30_sub2_sub1_sub1_1 = child.sprites[i3];
- if (class30_sub2_sub1_sub1_1 != null)
- class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
- } else {
- if (!drawnNoitemSprite) {
- if (child.invNoItemSprite != null) {
- child.invNoItemSprite.drawSprite(k5, j6);
- drawnNoitemSprite = true;
- }
- }
- }
- i3++;
- }
- }
- } else if (child.type == 3) {
- boolean flag = false;
- if (anInt1039 == child.id || anInt1048 == child.id || anInt1026 == child.id)
- flag = true;
- int j3;
- if (interfaceIsSelected(child)) {
- j3 = child.anInt219;
- if (flag && child.anInt239 != 0)
- j3 = child.anInt239;
- } else {
- j3 = child.textColor;
- if (flag && child.anInt216 != 0)
- j3 = child.anInt216;
- }
- if (child.opacity == 0) {
- if (child.aBoolean227)
- DrawingArea.drawPixels(k2, l2, child.width, child.height, j3);
- else
- DrawingArea.fillPixels(k2, child.width, child.height, j3, l2);
- } else if (child.aBoolean227)
- DrawingArea.method335(j3, l2, child.width, child.height, 256 - (child.opacity & 0xff), k2);
- else
- DrawingArea.method338(l2, child.height, 256 - (child.opacity & 0xff), j3, child.width, k2);
- } else if (child.type == 4) {
- FontStyle textDrawingArea = child.textDrawingAreas;
- String s = interfaceStrings ? "" + child.id : child.message;
- boolean flag1 = false;
- int xOffset = 0;
- int imageDraw = 0;
- if (s.contains("<img=")) {
- int prefix = s.indexOf("<img=");
- int suffix = s.indexOf(">");
- String imageId = s.substring(prefix + 5, suffix);
- s = s.replace("<img=" + imageId + ">", "");
- s = s.replace("</img>", "");
- if (imageId.matches("[-+]?\\d*\\.?\\d+")) {
- imageDraw = Integer.parseInt(imageId);
- if (imageDraw < 1 || imageDraw >= modIcons.length) {
- imageDraw = 0;
- }
- }
- if (imageDraw > 0) {
- xOffset += 14;
- }
- }
- if (child.id == 2458)
- s = "Click here to logout";
- if (anInt1039 == child.id || anInt1048 == child.id || anInt1026 == child.id)
- flag1 = true;
- int i4;
- if (child.id != 199) {//// XXX: idfk...
- if (interfaceIsSelected(child)) {
- i4 = child.anInt219;
- if (flag1 && child.anInt239 != 0)
- i4 = child.anInt239;
- if (child.aString228.length() > 0)
- s = child.aString228;
- } else {
- i4 = child.textColor;
- if (flag1 && child.anInt216 != 0)
- i4 = child.anInt216;
- }
- } else {
- i4 = child.textColor;
- }
- if (child.atActionType == 6 && aBoolean1149) {
- s = "Please wait...";
- i4 = child.textColor;
- }
- if (DrawingArea.width == 516) {
- if (i4 == 0xffff00)
- i4 = 255;
- if (i4 == 49152)
- i4 = 0xffffff;
- }
- if ((backDialogID != -1 || dialogID != -1 || child.message.contains("Click here to continue"))
- && (class9.id == backDialogID || class9.id == dialogID)) {
- if (i4 == 0xffff00) {
- i4 = 255;
- }
- if (i4 == 49152) {
- i4 = 0xffffff;
- }
- }
- if ((child.parentID == 1151) || (child.parentID == 12855)) {
- switch (i4) {
- case 16773120:
- i4 = 0xFE981F;
- break;
- case 7040819:
- i4 = 0xAF6A1A;
- break;
- }
- }
- for (int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497) {
- if (s.indexOf("%") != -1) {
- do {
- int k7 = s.indexOf("%1");
- if (k7 == -1)
- break;
- if (child.id < 4000 || child.id > 5000 && child.id != 13921 && child.id != 13922
- && child.id != 12171 && child.id != 12172)
- s = s.substring(0, k7) + methodR(extractInterfaceValues(child, 0))
- + s.substring(k7 + 2);
- else
- s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(child, 0))
- + s.substring(k7 + 2);
- } while (true);
- do {
- int l7 = s.indexOf("%2");
- if (l7 == -1)
- break;
- s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(child, 1))
- + s.substring(l7 + 2);
- } while (true);
- do {
- int i8 = s.indexOf("%3");
- if (i8 == -1)
- break;
- s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(child, 2))
- + s.substring(i8 + 2);
- } while (true);
- do {
- int j8 = s.indexOf("%4");
- if (j8 == -1)
- break;
- s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(child, 3))
- + s.substring(j8 + 2);
- } while (true);
- do {
- int k8 = s.indexOf("%5");
- if (k8 == -1)
- break;
- s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(child, 4))
- + s.substring(k8 + 2);
- } while (true);
- }
- int l8 = s.indexOf("\\n");
- String s1;
- if (l8 != -1) {
- s1 = s.substring(0, l8);
- s = s.substring(l8 + 2);
- } else {
- s1 = s;
- s = "";
- }
- if (child.centerText) {
- textDrawingArea.method382(i4, k2 + child.width / 2, s1, l6, child.textShadow);
- } else {
- textDrawingArea.method389(child.textShadow, k2 + xOffset, i4, s1, l6);
- }
- }
- } else if (child.type == 5) {
- Sprite sprite;
- if (interfaceIsSelected(child)) {
- if (child.enabledSpriteId != -1) {
- sprite = cacheSprites2[child.enabledSpriteId];
- } else {
- sprite = child.enabledSprite;
- }
- } else if (child.disabledSpriteId != -1) {
- sprite = cacheSprites2[child.disabledSpriteId];
- } else {
- sprite = child.disabledSprite;
- }
- //
- /// XXX: hardcoded ruse shit between //'s
- if (child.id == 1164 || child.id == 1167 || child.id == 1170 || child.id == 1174 || child.id == 1540
- || child.id == 1541 || child.id == 7455 || child.id == 18470 || child.id == 13035
- || child.id == 13045 || child.id == 13053 || child.id == 13061 || child.id == 13069
- || child.id == 13079 || child.id == 30064 || child.id == 30075 || child.id == 30083
- || child.id == 30106 || child.id == 30114 || child.id == 30106 || child.id == 30170
- || child.id == 13087 || child.id == 30162 || child.id == 13095) {
- if (child.enabledSpriteId != -1) {
- sprite = cacheSprites2[child.enabledSpriteId];
- } else {
- sprite = child.enabledSprite;
- }
- }
- //
- if (spellSelected == 1 && child.id == spellID && spellID != 0 && sprite != null) {
- sprite.drawSprite(k2, l2, 0xffffff);
- } else {
- if (sprite != null) {
- if (child.type == 5) {
- if (child.advancedSprite) {
- sprite.drawAdvancedSprite(k2, l2);
- } else {
- /*
- * if(currentGEItem > 0) {
- * if(child.enabledSpriteId == 634) { sprite
- * = geSearchBox; } else
- * if(child.enabledSpriteId == 635) { sprite
- * = geSearchBoxHover; } }
- */
- sprite.drawSprite(k2, l2);
- }
- } else {
- sprite.drawSprite1(k2, l2, child.opacity);
- }
- }
- }
- // if(autocast && child.id == autoCastId)
- // extSprites[43].drawSprite(k2-3, l2-3);
- /*
- * if (sprite != null) if (child.drawsTransparent) {
- * sprite.drawSprite1(k2, l2); } else {
- * sprite.drawSprite(k2, l2); } // /// XXX: hardcoded ruse
- * shit between //'s if (autoCast && child.id == autocastId)
- * cacheSprites2[47].drawSprite(k2 - 3, l2 - 2);
- */
- if (child.summonReq > 0) {
- if (child.summonReq > maxStats[23])
- child.greyScale = true;
- else if (maxStats[23] > child.summonReq)
- child.greyScale = false;
- if (child.greyScale && child.disabledSprite != null)
- child.disabledSprite.greyScale();
- }
- //
- if (child.inputField) {
- newSmallFont.drawCenteredString(child.inputFieldString, k2 + child.inputFieldStringX,
- l2 + child.inputFieldStringY, 0xFE972F, 0);
- }
- // newRegularFont.drawBasicString("" + child.id, k2, l2,
- // Integer.MAX_VALUE, 0);
- } else if (child.type == 6) {
- int k3 = Texture.textureInt1;
- int j4 = Texture.textureInt2;
- Texture.textureInt1 = k2 + child.width / 2;
- Texture.textureInt2 = l2 + child.height / 2;
- int i5 = Texture.anIntArray1470[child.modelRotation1] * child.modelZoom >> 16;
- int l5 = Texture.anIntArray1471[child.modelRotation1] * child.modelZoom >> 16;
- boolean flag2 = interfaceIsSelected(child);
- int i7;
- if (flag2)
- i7 = child.anInt258;
- else
- i7 = child.anInt257;
- Model model = null;
- if (i7 == -1) {
- model = child.method209(-1, -1, flag2);
- } else {
- Animation animation = Animation.getAnim(null, i7);
- if (animation != null) {
- model = child.method209(animation.anIntArray354[child.anInt246],
- animation.anIntArray353[child.anInt246], flag2);
- }
- }
- if (model != null)
- model.method482(child.modelRotation2, 0, child.modelRotation1, 0, i5, l5);
- Texture.textureInt1 = k3;
- Texture.textureInt2 = j4;
- } else if (child.type == 7) {
- FontStyle textDrawingArea_1 = child.textDrawingAreas;
- int k4 = 0;
- for (int j5 = 0; j5 < child.height; j5++) {
- for (int i6 = 0; i6 < child.width; i6++) {
- if (child.inv[k4] > 0) {
- ItemDefinition itemDef = ItemDefinition.forID(child.inv[k4] - 1);
- String s2 = itemDef.name;
- if (itemDef.stackable || child.invStackSizes[k4] != 1)
- s2 = s2 + " x" + intToKOrMilLongName(child.invStackSizes[k4]);
- int i9 = k2 + i6 * (115 + child.invSpritePadX);
- int k9 = l2 + j5 * (12 + child.invSpritePadY);
- if (child.centerText)
- textDrawingArea_1.method382(child.textColor, i9 + child.width / 2, s2, k9,
- child.textShadow);
- else
- textDrawingArea_1.method389(child.textShadow, i9, child.textColor, s2, k9);
- }
- k4++;
- }
- }
- } else if (child.type == 8 && tooltipHoverChildId == child.id && tooltipHoverLoopCycle == 25
- && !menuOpen) {
- int boxWidth = 0;
- int boxHeight = 0;
- FontStyle textDrawingArea_2 = regularText;
- String string = interfaceStrings ? "" + child.id : child.message;
- for (String s1 = string; 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 = textDrawingArea_2.getTextWidth(s4);
- if (j10 > boxWidth) {
- boxWidth = j10;
- }
- boxHeight += textDrawingArea_2.anInt1497 + 1;
- }
- boxWidth += 6;
- boxHeight += 7;
- int xPos = (k2 + child.width) - 5 - boxWidth;
- int yPos = l2 + child.height + 5;
- if (xPos < k2 + 5)
- xPos = k2 + 5;
- if (xPos + boxWidth > k + class9.width)
- xPos = (k + class9.width) - boxWidth;
- if (yPos + boxHeight > l + class9.height)
- yPos = (l2 - boxHeight);
- int xOffset = fixed() ? 516 : 0;
- if (xPos + boxWidth + xOffset > frameWidth) {
- xPos -= xPos + boxWidth + xOffset - frameWidth + 7;
- }
- DrawingArea.drawPixels(xPos, yPos, boxWidth, boxHeight, 0xFFFFA0);
- DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
- String s2 = interfaceStrings ? "" + child.id : child.message;
- for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2
- .length() > 0; j11 += textDrawingArea_2.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) {
- newRegularFont.drawCenteredString(s5, xPos, j11, 0, -1);
- // textDrawingArea_2.method382(yPos, xPos +
- // class9_1.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);
- newRegularFont.drawBasicString(text, xPos + 3, j11, 0, -1);
- // textDrawingArea_2.method389(false, xPos + 3,
- // 0, text, j11);
- int rightX = boxWidth + xPos - textDrawingArea_2.getTextWidth(text2) - 2;
- // textDrawingArea_2.method389(false, rightX, 0,
- // text2, j11);
- newRegularFont.drawBasicString(text2, rightX, j11, 0, -1);
- } else {
- newRegularFont.drawBasicString(s5, xPos + 3, j11, 0, -1);
- // textDrawingArea_2.method389(false, xPos + 3,
- // 0, s5, j11);
- }
- }
- }
- } else if (child.type == 9) {
- Sprite sprite;/// XXX: type 9 was different in ruse, not
- /// sure why
- if (interfaceIsSelected(child)) {
- sprite = child.enabledSprite;
- } else {
- sprite = child.disabledSprite;
- }
- if (sprite != null) {
- if (child.drawsTransparent)
- sprite.drawTransparentSprite(k2, l2, child.customOpacity);
- else
- sprite.drawSprite(k2, l2);
- }
- }
- }
- DrawingArea.setDrawingArea(l1, i1, k1, j1);
- }
- private void randomizeBackground(Background background) {
- int j = 256;
- for (int k = 0; k < anIntArray1190.length; k++)
- anIntArray1190[k] = 0;
- for (int l = 0; l < 5000; l++) {
- int i1 = (int) (Math.random() * 128D * (double) j);
- anIntArray1190[i1] = (int) (Math.random() * 256D);
- }
- for (int j1 = 0; j1 < 20; j1++) {
- for (int k1 = 1; k1 < j - 1; k1++) {
- for (int i2 = 1; i2 < 127; i2++) {
- int k2 = i2 + (k1 << 7);
- anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128]
- + anIntArray1190[k2 + 128]) / 4;
- }
- }
- int ai[] = anIntArray1190;
- anIntArray1190 = anIntArray1191;
- anIntArray1191 = ai;
- }
- if (background != null) {
- int l1 = 0;
- for (int j2 = 0; j2 < background.anInt1453; j2++) {
- for (int l2 = 0; l2 < background.anInt1452; l2++)
- if (background.aByteArray1450[l1++] != 0) {
- int i3 = l2 + 16 + background.anInt1454;
- int j3 = j2 + 16 + background.anInt1455;
- int k3 = i3 + (j3 << 7);
- anIntArray1190[k3] = 0;
- }
- }
- }
- }
- private void method107(int i, int j, RSBuffer stream, Player player) {
- if ((i & 0x400) != 0) {
- player.anInt1543 = stream.method428();
- player.anInt1545 = stream.method428();
- player.anInt1544 = stream.method428();
- player.anInt1546 = stream.method428();
- player.anInt1547 = stream.method436() + loopCycle;
- player.anInt1548 = stream.method435() + loopCycle;
- player.anInt1549 = stream.method428();
- player.method446();
- }
- if ((i & 0x100) != 0) {
- player.anInt1520 = stream.method434();
- int k = stream.readDWord();
- player.anInt1524 = k >> 16;
- player.anInt1523 = loopCycle + (k & 0xffff);
- player.anInt1521 = 0;
- player.anInt1522 = 0;
- if (player.anInt1523 > loopCycle)
- player.anInt1521 = -1;
- if (player.anInt1520 == 65535)
- player.anInt1520 = -1;
- }
- if ((i & 8) != 0) {
- int l = stream.method434();
- if (l == 65535)
- l = -1;
- int i2 = stream.method427();
- if (l == player.anim && l != -1) {
- int i3 = Animation.getAnim(player, l).anInt365;
- if (i3 == 1) {
- player.anInt1527 = 0;
- player.anInt1528 = 0;
- player.anInt1529 = i2;
- player.anInt1530 = 0;
- }
- if (i3 == 2)
- player.anInt1530 = 0;
- } else if (l == -1 || player.anim == -1
- || Animation.getAnim(player, l).anInt359 >= Animation.getAnim(player, player.anim).anInt359) {
- player.anim = l;
- player.anInt1527 = 0;
- player.anInt1528 = 0;
- player.anInt1529 = i2;
- player.anInt1530 = 0;
- player.anInt1542 = player.smallXYIndex;
- }
- }
- if ((i & 4) != 0) {
- player.textSpoken = stream.readString();
- if (player.textSpoken.charAt(0) == '~') {
- player.textSpoken = player.textSpoken.substring(1);
- pushMessage(player.textSpoken, 2, player.name, player.title, player.titleBehindName ? 0 : 1);
- } else if (player == myPlayer)
- pushMessage(player.textSpoken, 2, player.name, player.title, player.titleBehindName ? 0 : 1);
- player.anInt1513 = 0;
- player.anInt1531 = 0;
- player.textCycle = 150;
- }
- if ((i & 0x80) != 0) {
- // right fucking here
- /*
- * int effects = stream.ig2(); int rights =
- * stream.readUnsignedByte(); int gloColor = 0;//0; int ironman2 =
- * stream.readUnsignedByte(); int chatTextSize = stream.nglb(); int
- * currentOffset = stream.currentOffset;
- */
- int i1 = stream.ig2();
- int j2 = stream.readUnsignedByte();
- int ironman2 = stream.readUnsignedByte();
- int j3 = stream.nglb();
- int k3 = stream.currentOffset;
- if (player.name != null && player.visible) {
- long l3 = TextClass.longForName(player.name);
- boolean flag = false;
- if (j2 <= 1) {
- for (int i4 = 0; i4 < ignoreCount; i4++) {
- if (ignoreListAsLongs[i4] != l3)
- continue;
- flag = true;
- break;
- }
- }
- if (!flag && anInt1251 == 0)
- try {
- aStream_834.currentOffset = 0;
- stream.method442(j3, 0, aStream_834.buffer);
- aStream_834.currentOffset = 0;
- String s = TextInput.method525(j3, aStream_834);
- // s = Censor.doCensor(s);
- player.textSpoken = s;
- player.anInt1513 = i1 >> 8;
- player.privelage = j2;
- player.anInt1531 = i1 & 0xff;
- player.textCycle = 150;
- String crown = "";
- if (j2 > 0 && j2 < modIcons.length) {
- crown = "@cr" + j2 + "@";
- }
- if (crown.equals(""))
- pushMessage(s, 2, player.name);
- else
- pushMessage(s, 1, crown + player.name);
- } catch (Exception exception) {
- Signlink.reporterror("cde2");
- }
- }
- stream.currentOffset = k3 + j3;
- }
- if ((i & 1) != 0) {
- player.interactingEntity = stream.method434();
- if (player.interactingEntity == 65535)
- player.interactingEntity = -1;
- }
- if ((i & 0x10) != 0) {
- int j1 = stream.method427();
- byte abyte0[] = new byte[j1];
- RSBuffer stream_1 = new RSBuffer(abyte0);
- stream.readBytes(j1, 0, abyte0);
- aStreamArray895s[j] = stream_1;
- player.updatePlayer(stream_1);
- }
- if ((i & 2) != 0) {
- player.anInt1538 = stream.method436();
- player.anInt1539 = stream.method434();
- }
- if ((i & 0x20) != 0) {
- int k1 = inStream.readRuseShortA();
- int k2 = stream.readUnsignedByte();
- int icon = stream.readUnsignedByte();
- int soakDamage = inStream.readRuseShortA();
- player.updateHitData(k2, k1, loopCycle, icon);
- player.loopCycleStatus = loopCycle + 300;
- player.currentHealth = stream.readRuseShortA();
- player.maxHealth = stream.readRuseShortA();
- }
- if ((i & 0x200) != 0) {
- int l1 = inStream.readRuseShortA();
- int l2 = stream.readUnsignedByte();
- int icon = stream.readUnsignedByte();
- int soakDamage = inStream.readRuseShortA();
- player.updateHitData(l2, l1, loopCycle, icon);
- player.loopCycleStatus = loopCycle + 300;
- player.currentHealth = stream.readRuseShortA();
- player.maxHealth = stream.readRuseShortA();
- }
- }
- private void method108() {
- try {
- int j = myPlayer.x + anInt1278;
- int k = myPlayer.y + anInt1131;
- 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;
- if (super.keyArray[1] == 1)
- anInt1186 += (-24 - anInt1186) / 2;
- else if (super.keyArray[2] == 1)
- anInt1186 += (24 - anInt1186) / 2;
- else
- anInt1186 /= 2;
- if (super.keyArray[3] == 1)
- anInt1187 += (12 - anInt1187) / 2;
- else if (super.keyArray[4] == 1)
- anInt1187 += (-12 - anInt1187) / 2;
- else
- anInt1187 /= 2;
- minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
- anInt1184 += anInt1187 / 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 && (byteGroundArray[1][l1][k2] & 2) == 2)
- l2++;
- int i3 = j1 - intGroundArray[l2][l1][k2];
- if (i3 > k1)
- k1 = i3;
- }
- }
- }
- anInt1005++;
- if (anInt1005 > 1512) {
- anInt1005 = 0;
- /*
- * stream.createFrame(77); stream.writeWordBigEndian(0); int i2
- * = stream.currentOffset; stream.writeWordBigEndian((int)
- * (Math.random() * 256D)); stream.writeWordBigEndian(101);
- * stream.writeWordBigEndian(233); stream.writeWord(45092); if
- * ((int) (Math.random() * 2D) == 0) stream.writeWord(35784);
- * stream.writeWordBigEndian((int) (Math.random() * 256D));
- * stream.writeWordBigEndian(64); stream.writeWordBigEndian(38);
- * stream.writeWord((int) (Math.random() * 65536D));
- * stream.writeWord((int) (Math.random() * 65536D));
- * stream.writeBytes(stream.currentOffset - 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.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + ","
- + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
- throw new RuntimeException("eek");
- }
- }
- public void processDrawing() {
- if (rsAlreadyLoaded || loadingError || genericLoadingError) {
- showErrorScreen();
- return;
- }
- if (!loggedIn)
- drawLoginScreen(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;
- }
- private void draw3dScreen() {
- if (screenOpacity != 0 && screenOpacity < 250) {
- RSInterface.interfaceCache[35556].width = screenAreaWidth;
- RSInterface.interfaceCache[35556].height = screenAreaHeight;
- RSInterface.interfaceCache[35556].opacity = (byte) screenOpacity;
- drawInterface(0, 0, RSInterface.interfaceCache[35555], 0);
- drawInterface(0, 512, RSInterface.interfaceCache[35555], 0);
- drawInterface(0, 512 * 2, RSInterface.interfaceCache[35555], 0);
- drawInterface(0, 512 * 3, RSInterface.interfaceCache[35555], 0);
- drawInterface(0, 0, RSInterface.interfaceCache[35555], 700);
- drawInterface(0, 512, RSInterface.interfaceCache[35555], 700);
- drawInterface(0, 512 * 2, RSInterface.interfaceCache[35555], 700);
- drawInterface(0, 512 * 3, RSInterface.interfaceCache[35555], 700);
- }
- if (showChatComponents) {
- drawSplitPrivateChat();
- }
- if (crossType == 1) {
- int offSet = frameMode == ScreenMode.FIXED ? 4 : 0;
- crosses[crossIndex / 100].drawSprite(crossX - 8 - offSet, crossY - 8 - offSet);
- anInt1142++;
- if (anInt1142 > 67) {
- anInt1142 = 0;
- stream.createFrame(78);
- }
- }
- if (crossType == 2) {
- int offSet = frameMode == ScreenMode.FIXED ? 4 : 0;
- crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - offSet, crossY - 8 - offSet);
- }
- /// XXX: some things are added here
- try {
- ExperienceCounter.draw();
- CombatOverlays.drawBoostedStats();
- CombatOverlays.drawCombatant();
- CombatOverlays.drawOverlays();
- if (loopCycle - lastCameraZoomChange <= 100) {
- int opacity = 255 - (int) (255d * ((loopCycle - lastCameraZoomChange) / 100d));
- int percentage = (int) ((((double) cameraZoom) / 600d) * 100d);
- newSmallFont.drawCenteredString("<trans=" + opacity + ">" + "Zoom: " + percentage + "%", 478,
- fixed() ? 330 : frameHeight - 170, Integer.MAX_VALUE, 0);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- if (fpsOn) {
- int textColour = 0xffff00;
- if (super.fps < 15) {
- textColour = 0xff0000;
- }
- // DecimalFormat decimalFormat = new DecimalFormat("#.##");
- boldText.method385(textColour, "Fps: " + super.fps, 45,
- frameMode == ScreenMode.FIXED ? 430 : frameWidth - 300);
- // boldText.method385(0xffff00, "Kb/s: " +
- // decimalFormat.format(((double) bytesReceived / 1024d)), 60,
- // frameMode == ScreenMode.FIXED ? 430 : frameWidth - 300);
- }
- if (anInt1055 == 1) {
- multiOverlay.drawSprite(frameMode == ScreenMode.FIXED ? 470 : frameWidth - 85,
- frameMode == ScreenMode.FIXED ? 296 : 188);
- }
- if (walkableInterfaceId != -1) {
- method119(anInt945, walkableInterfaceId);
- /*
- * if (walkableInterfaceId == 197 && frameMode != ScreenMode.FIXED)
- * { skullIcons[0].drawSprite(frameWidth - 157, 168); String text =
- * RSInterface.interfaceCache[199].message.replace("@yel@", "");
- * regularText.drawChatInput(0xE1981D, frameWidth - 165, text, 207,
- * true); } else
- */if (walkableInterfaceId == 201 && frameMode != ScreenMode.FIXED) {
- drawInterface(0, frameWidth - 560, RSInterface.interfaceCache[walkableInterfaceId], -109);
- } else {
- int x = 0;
- int y = 0;
- if (!fixed()) {
- switch (walkableInterfaceId) {
- case 197:
- x = frameWidth - 615;
- y = -86;
- break;
- }
- }
- drawInterface(0, x, RSInterface.interfaceCache[walkableInterfaceId], y);
- }
- }
- int x = baseX + (myPlayer.x - 6 >> 7);
- int y = baseY + (myPlayer.y - 6 >> 7);
- final String screenMode = frameMode == ScreenMode.FIXED ? "Fixed" : "Resizable";
- if (clientData) {
- int textColour = 0xffff00;
- int fpsColour = 0xffff00;
- if (super.fps < 15) {
- fpsColour = 0xff0000;
- }
- int regionX = x >> 3;
- int regionY = y >> 3;
- int regionId = ((regionX / 8) << 8) + (regionY / 8);
- regularText.method385(textColour, "Mapdata: " + anIntArray1235[0] + ".dat", frameHeight - 285, 5);
- regularText.method385(textColour,
- "Frame width: " + (mouseX - frameWidth) + ", Frame height: " + (mouseY - frameHeight),
- frameHeight - 271, 5);
- regularText.method385(textColour, "Client Zoom: " + cameraZoom, frameHeight - 257, 5);
- regularText.method385(fpsColour, "Fps: " + super.fps, frameHeight - 243, 5);
- Runtime runtime = Runtime.getRuntime();
- int clientMemory = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
- regularText.method385(textColour, "Memory Usage: " + clientMemory + "k", frameHeight - 229, 5);
- regularText.method385(textColour, "Mouse X: " + mouseX + ", Mouse Y: " + mouseY, frameHeight - 215, 5);
- regularText.method385(textColour, "Coords: " + x + ", " + y, frameHeight - 201, 5);
- regularText.method385(textColour, "Client Mode: " + screenMode + "", frameHeight - 187, 5);
- regularText.method385(textColour, "Client Resolution: " + frameWidth + "x" + frameHeight, frameHeight - 173,
- 5);
- }
- if (openInterfaceID != -1) {
- if (openInterfaceID == 1) {
- MapRender.render();
- } else {
- currentDragSprite = null;
- currentDragX = 0;
- currentDragY = 0;
- method119(anInt945, openInterfaceID);
- drawInterface(0, fixed() ? 0 : frameWidth / 2 - 378, RSInterface.get(openInterfaceID),
- fixed() ? 0 : frameHeight / 2 - 244);
- if (currentDragSprite != null) {
- currentDragSprite.drawSprite(currentDragX, currentDragY);
- if ((currentDragSprite.anInt1444 == 33 || currentDragAmount != 1) && currentDragAmount != -1) {
- smallText.method385(0, intToKOrMil(currentDragAmount), currentDragAmountX + 1,
- currentDragAmountY + 1);
- if (currentDragAmount >= 1)
- smallText.method385(0xFFFF00, intToKOrMil(currentDragAmount), currentDragAmountX,
- currentDragAmountY);
- if (currentDragAmount >= 100000)
- smallText.method385(0xFFFFFF, intToKOrMil(currentDragAmount), currentDragAmountX,
- currentDragAmountY);
- if (currentDragAmount >= 10000000)
- smallText.method385(0x00FF80, intToKOrMil(currentDragAmount), currentDragAmountX,
- currentDragAmountY);
- }
- }
- }
- }
- if (frameMode == ScreenMode.FIXED) {
- // gameframe.drawCoinsInPouch();
- }
- drawGrandExchange();
- if (!menuOpen) {
- processRightClick();
- drawTooltip();
- drawSceneHover(4, 4);
- } else if (menuScreenArea == 0) {
- drawMenu(frameMode == ScreenMode.FIXED ? 4 : 0, frameMode == ScreenMode.FIXED ? 4 : 0);
- }
- if (anInt1104 != 0) {
- int j = anInt1104 / 50;
- int l = j / 60;
- int yOffset = frameMode == ScreenMode.FIXED ? 0 : frameHeight - 498;
- j %= 60;
- if (j < 10)
- regularText.method385(0xffff00, "System update in: " + l + ":0" + j, 329 + yOffset, 4);
- else
- regularText.method385(0xffff00, "System update in: " + l + ":" + j, 329 + yOffset, 4);
- anInt849++;
- if (anInt849 > 75) {
- anInt849 = 0;
- stream.createFrame(148);
- }
- }
- }
- private void addIgnore(long l) {
- try {
- if (l == 0L)
- return;
- if (ignoreCount >= 100) {
- pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
- return;
- }
- String s = TextClass.fixName(TextClass.nameForLong(l));
- for (int j = 0; j < ignoreCount; j++)
- if (ignoreListAsLongs[j] == l) {
- pushMessage(s + " is already on your ignore list", 0, "");
- return;
- }
- for (int k = 0; k < friendsCount; k++)
- if (friendsListAsLongs[k] == l) {
- pushMessage("Please remove " + s + " from your friend list first", 0, "");
- return;
- }
- ignoreListAsLongs[ignoreCount++] = l;
- stream.createFrame(133);
- stream.writeQWord(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 = playerArray[j];
- if (player != null)
- method96(player);
- }
- }
- private void method115() {
- if (loadingStage == 2) {
- for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
- .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
- .reverseGetNext()) {
- if (class30_sub1.delay > 0)
- class30_sub1.delay--;
- if (class30_sub1.delay == 0) {
- if (class30_sub1.anInt1299 < 0
- || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301)) {
- method142(class30_sub1.y, class30_sub1.heightLevel, class30_sub1.anInt1300,
- class30_sub1.anInt1301, class30_sub1.x, class30_sub1.face, class30_sub1.anInt1299);
- class30_sub1.unlink();
- }
- } else {
- if (class30_sub1.anInt1302 > 0)
- class30_sub1.anInt1302--;
- if (class30_sub1.anInt1302 == 0 && class30_sub1.x >= 1 && class30_sub1.y >= 1
- && class30_sub1.x <= 102 && class30_sub1.y <= 102 && (class30_sub1.objectId < 0
- || ObjectManager.method178(class30_sub1.objectId, class30_sub1.type))) {
- method142(class30_sub1.y, class30_sub1.heightLevel, class30_sub1.faceIndex, class30_sub1.type,
- class30_sub1.x, class30_sub1.face, class30_sub1.objectId);
- class30_sub1.anInt1302 = -1;
- if (class30_sub1.objectId == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
- class30_sub1.unlink();
- else if (class30_sub1.objectId == class30_sub1.anInt1299
- && class30_sub1.faceIndex == class30_sub1.anInt1300
- && class30_sub1.type == class30_sub1.anInt1301)
- class30_sub1.unlink();
- }
- }
- }
- }
- }
- private void determineMenuSize() {
- int boxLength = boldText.getTextWidth("Choose option");
- for (int row = 0; row < menuActionRow; row++) {
- String text = menuActionName[row];
- text = text.replaceAll("</col>", "");
- int i = 0;
- while (text.contains("<col=") && i++ < 10) {
- int colorIndex = text.indexOf("<col=");
- int colorEndIndex = text.indexOf(">");
- String color = text.substring(colorIndex, colorEndIndex + 1);
- text = text.replace(color, "");
- }
- int actionLength = boldText.getTextWidth(text);
- if (actionLength > boxLength)
- boxLength = actionLength;
- }
- boxLength += 8;
- int offset = 15 * menuActionRow + 21;
- if (super.saveClickX > 0 && super.saveClickY > 0 && super.saveClickX < frameWidth
- && super.saveClickY < frameHeight) {
- int xClick = super.saveClickX - boxLength / 2;
- if (xClick + boxLength > frameWidth - 4) {
- xClick = frameWidth - 4 - boxLength;
- }
- if (xClick < 0) {
- xClick = 0;
- }
- int yClick = super.saveClickY - 0;
- if (yClick + offset > frameHeight - 6) {
- yClick = frameHeight - 6 - offset;
- }
- if (yClick < 0) {
- yClick = 0;
- }
- menuOpen = true;
- menuOffsetX = xClick;
- menuOffsetY = yClick;
- menuWidth = boxLength;
- menuHeight = 15 * menuActionRow + 22;
- }
- }
- private void method117(RSBuffer stream) {
- stream.initBitAccess();
- int j = stream.readBits(1);
- if (j == 0)
- return;
- int k = stream.readBits(2);
- if (k == 0) {
- anIntArray894[anInt893++] = myPlayerIndex;
- return;
- }
- if (k == 1) {
- int l = stream.readBits(3);
- myPlayer.moveInDir(false, l);
- int k1 = stream.readBits(1);
- if (k1 == 1)
- anIntArray894[anInt893++] = myPlayerIndex;
- return;
- }
- if (k == 2) {
- int i1 = stream.readBits(3);
- myPlayer.moveInDir(true, i1);
- int l1 = stream.readBits(3);
- myPlayer.moveInDir(true, l1);
- int j2 = stream.readBits(1);
- if (j2 == 1)
- anIntArray894[anInt893++] = myPlayerIndex;
- return;
- }
- if (k == 3) {
- plane = stream.readBits(2);
- int j1 = stream.readBits(1);
- int i2 = stream.readBits(1);
- if (i2 == 1)
- anIntArray894[anInt893++] = myPlayerIndex;
- int k2 = stream.readBits(7);
- int l2 = stream.readBits(7);
- myPlayer.setPos(l2, k2, j1 == 1);
- }
- }
- private void nullLoader() {
- aBoolean831 = false;
- while (drawingFlames) {
- aBoolean831 = false;
- try {
- Thread.sleep(50L);
- } catch (Exception _ex) {
- }
- }
- aBackground_966 = null;
- aBackground_967 = null;
- aBackgroundArray1152s = null;
- anIntArray850 = null;
- anIntArray851 = null;
- anIntArray852 = null;
- anIntArray853 = null;
- anIntArray1190 = null;
- anIntArray1191 = null;
- anIntArray828 = null;
- anIntArray829 = null;
- aClass30_Sub2_Sub1_Sub1_1201 = null;
- aClass30_Sub2_Sub1_Sub1_1202 = null;
- }
- private boolean method119(int i, int j) {
- boolean flag1 = false;
- RSInterface class9 = RSInterface.interfaceCache[j];
- if (class9.children == null)
- return flag1;
- for (int k = 0; k < class9.children.length; k++) {
- if (class9.children[k] == -1)
- break;
- RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
- if (class9_1 == null)
- continue;
- if (class9_1.type == 1)
- flag1 |= method119(i, class9_1.id);
- if (class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1)) {
- boolean flag2 = interfaceIsSelected(class9_1);
- int l;
- if (flag2)
- l = class9_1.anInt258;
- else
- l = class9_1.anInt257;
- if (l != -1) {
- Animation animation = Animation.getAnim(null, l);
- if (animation != null) {
- for (class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);) {
- class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
- class9_1.anInt246++;
- if (class9_1.anInt246 >= animation.anInt352) {
- class9_1.anInt246 -= animation.anInt356;
- if (class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
- class9_1.anInt246 = 0;
- }
- flag1 = true;
- }
- }
- }
- }
- }
- return flag1;
- }
- private int method120() {
- if (ClientSettings.getBoolean("roofs_disabled")) {
- return plane;
- }
- int j = 3;
- if (yCameraCurve < 310) {
- int k = xCameraPos >> 7;
- int l = yCameraPos >> 7;
- int i1 = myPlayer.x >> 7;
- int j1 = myPlayer.y >> 7;
- if ((byteGroundArray[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 ((byteGroundArray[plane][k][l] & 4) != 0)
- j = plane;
- k2 += i2;
- if (k2 >= 0x10000) {
- k2 -= 0x10000;
- if (l < j1)
- l++;
- else if (l > j1)
- l--;
- if ((byteGroundArray[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 ((byteGroundArray[plane][k][l] & 4) != 0)
- j = plane;
- l2 += j2;
- if (l2 >= 0x10000) {
- l2 -= 0x10000;
- if (k < i1)
- k++;
- else if (k > i1)
- k--;
- if ((byteGroundArray[plane][k][l] & 4) != 0)
- j = plane;
- }
- }
- }
- }
- if ((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
- j = plane;
- return j;
- }
- private int method121() {
- if (roofsOff) {
- return plane;
- }
- int j = method42(plane, yCameraPos, xCameraPos);
- if (j - zCameraPos < 800 && (byteGroundArray[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--;
- System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
- stream.createFrame(74);
- stream.writeQWord(l);
- return;
- }
- return;
- } catch (RuntimeException runtimeexception) {
- Signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
- }
- throw new RuntimeException();
- }
- private void chatJoin(long l) {
- try {
- if (l == 0L)
- return;
- stream.createFrame(60);
- stream.writeQWord(l);
- return;
- } catch (RuntimeException runtimeexception) {
- Signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
- }
- throw new RuntimeException();
- }
- public String getParameter(String s) {
- if (Signlink.mainapp != null)
- return Signlink.mainapp.getParameter(s);
- else
- return super.getParameter(s);
- }
- private static final int [] RUNES = new int [] {
- 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 4694, 4695, 4696, 4697, 4698, 4699, 9076, 9075
- };
- private static boolean isRune(final int itemId) {
- for (int i : RUNES) {
- if (itemId == i) {
- return true;
- }
- }
- return false;
- }
- private static boolean interfaceContainsItem(final int itemId, final RSInterface _interface) {
- for (int index = 0; index < _interface.inv.length; index ++) {
- if (_interface.inv[index] == itemId) {
- return true;
- }
- }
- return false;
- }
- private static int getIndexByInterface(final int itemId, final RSInterface _interface) {
- for (int index = 0; index < _interface.inv.length; index ++) {
- if (_interface.inv[index] == itemId) {
- return index;
- }
- }
- return -1;
- }
- private long extractInterfaceValues(RSInterface class9, int j) {
- if (class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
- return -2;
- try {
- int ai[] = class9.valueIndexArray[j];
- long k = 0;
- int l = 0;
- int i1 = 0;
- do {
- int j1 = ai[l++];
- long k1 = 0;
- byte byte0 = 0;
- if (j1 == 0) {
- return k;
- }
- if (j1 == 1) {
- int index = ai[l++];
- k1 = currentStats[index];
- if (index == 3 || index == 5) {
- k1 = (int) Math.ceil(((double) k1) / 10d);
- }
- }
- if (j1 == 2) {
- int index = ai[l++];
- k1 = maxStats[index];
- }
- if (j1 == 3)
- k1 = currentExp[ai[l++]];
- if (j1 == 4) {
- RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
- int itemId = ai[l++];
- if (itemId >= 0 && itemId < ItemDefinition.totalItems
- && (!ItemDefinition.forID(itemId).membersObject || isMembers)) {
- boolean isRune = isRune(itemId + 1);
- boolean hasPouch = interfaceContainsItem(42791 + 1, class9_1);
- int pouchIndex = getIndexByInterface(itemId + 1, RSInterface.get(41710));
- if (isRune && hasPouch && pouchIndex != -1) {
- k1 += RSInterface.get(41710).invStackSizes[pouchIndex];
- }
- for (int inventoryIndex = 0; inventoryIndex < class9_1.inv.length; inventoryIndex++) {
- if (class9_1.inv[inventoryIndex] == itemId + 1) {
- k1 += class9_1.invStackSizes[inventoryIndex];
- }
- }
- }
- }
- if (j1 == 5)
- k1 = variousSettings[ai[l++]];
- if (j1 == 6)
- k1 = experienceForLevels[maxStats[ai[l++]] - 1];
- if (j1 == 7)
- k1 = (variousSettings[ai[l++]] * 100) / 46875;
- if (j1 == 8)
- k1 = myPlayer.combatLevel;
- if (j1 == 9) {
- for (int l1 = 0; l1 < Skills.skillsCount; l1++)
- if (Skills.skillEnabled[l1])
- k1 += maxStats[l1];
- }
- if (j1 == 10) {
- RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
- int l2 = ai[l++] + 1;
- if (l2 >= 0 && l2 < ItemDefinition.totalItems && isMembers) {
- for (int k3 = 0; k3 < class9_2.inv.length; k3++) {
- if (class9_2.inv[k3] != l2)
- continue;
- k1 = 0x3b9ac9ff;
- break;
- }
- }
- }
- if (j1 == 11)
- k1 = energy;
- if (j1 == 12)
- k1 = weight;
- if (j1 == 13) {
- int i2 = variousSettings[ai[l++]];
- int i3 = ai[l++];
- k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
- }
- if (j1 == 14) {
- int j2 = ai[l++];
- VarBit varBit = VarBit.cache[j2];
- int l3 = varBit.anInt648;
- int i4 = varBit.anInt649;
- int j4 = varBit.anInt650;
- int k4 = anIntArray1232[j4 - i4];
- k1 = variousSettings[l3] >> i4 & k4;
- }
- if (j1 == 15)
- byte0 = 1;
- if (j1 == 16)
- byte0 = 2;
- if (j1 == 17)
- byte0 = 3;
- if (j1 == 18)
- k1 = (myPlayer.x >> 7) + baseX;
- if (j1 == 19)
- k1 = (myPlayer.y >> 7) + baseY;
- if (j1 == 20) {
- k1 = ai[l++];
- }
- if (j1 == 21) {
- int skill = ai[l++];
- int experience = currentExp[skill];
- int expIndex = 0;
- for (int it = 0; it < experienceForLevels.length; it++) {
- if (experience < experienceForLevels[it]) {
- expIndex = it;
- break;
- }
- }
- int expUntil = maxStats[skill] == 99 ? 0 : experienceForLevels[expIndex] - experience;
- k1 = expUntil;
- }
- if (j1 == 22) {
- l++;
- long total = 0;
- for (int exp : currentExp) {
- total += exp;
- }
- k1 = total;
- }
- if (j1 == 23) {
- RSInterface class9_2 = RSInterface.get(ai[l++]);
- int items = 0;
- for (int k3 = 0; k3 < class9_2.inv.length; k3++) {
- if (class9_2.inv[k3] > 0)
- items++;
- }
- k1 = items;
- }
- if (j1 == 24) {
- l++;
- int attack = maxStats[SkillData.ATTACK.ordinal()];
- int defence = maxStats[SkillData.DEFENCE.ordinal()];
- int strength = maxStats[SkillData.STRENGTH.ordinal()];
- int hp = (int) (maxStats[SkillData.CONSTITUTION.ordinal()]);
- int prayer = (int) (maxStats[SkillData.PRAYER.ordinal()]);
- int ranged = maxStats[SkillData.RANGED.ordinal()];
- int magic = maxStats[SkillData.MAGIC.ordinal()];
- int combatLevel = 3;
- combatLevel = (int) ((defence + hp + Math.floor(prayer / 2)) * 0.2535) + 1;
- double melee = (attack + strength) * 0.325;
- double ranger = Math.floor(ranged * 1.5) * 0.325;
- double mage = Math.floor(magic * 1.5) * 0.325;
- if (melee >= ranger && melee >= mage) {
- combatLevel += melee;
- } else if (ranger >= melee && ranger >= mage) {
- combatLevel += ranger;
- } else if (mage >= melee && mage >= ranger) {
- combatLevel += mage;
- }
- if (combatLevel > 126) {
- combatLevel = 126;
- } else if (combatLevel < 3) {
- combatLevel = 3;
- }
- k1 = combatLevel;
- }
- if (j1 == 25) {
- l++;
- int total = 0;
- for (int i = 0; i < maxStats.length; i++) {
- total += maxStats[i];
- }
- k1 = total;
- }
- 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;
- }
- } while (true);
- } catch (Exception _ex) {
- return -1;
- }
- }
- private void drawTooltip() {
- if (menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
- return;
- String s;
- if (itemSelected == 1 && menuActionRow < 2)
- s = "Use " + selectedItemName + " with...";
- else if (spellSelected == 1 && menuActionRow < 2)
- s = spellTooltip + "...";
- else
- s = menuActionName[menuActionRow - 1];
- if (gameframe.isMouseInsideTabArea() && shiftDrop()) {
- s = menuActionName[2];
- }
- if (menuActionRow > 2)
- s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
- if (!ClientSettings.getBoolean("menu_scene_hovers")) {
- newBoldFont.drawBasicString(s, 4, 15, 0xffffff, 0);
- }
- }
- private void markMinimap(Sprite sprite, int x, int y) {
- if (sprite == null) {
- return;
- }
- int k = minimapInt1 + minimapInt2 & 0x7ff;
- int l = x * x + y * y;
- if (l > 6400) {
- return;
- }
- int i1 = Model.modelIntArray1[k];
- int j1 = Model.modelIntArray2[k];
- i1 = (i1 * 256) / (minimapInt3 + 256);
- j1 = (j1 * 256) / (minimapInt3 + 256);
- int k1 = y * i1 + x * j1 >> 16;
- int l1 = y * j1 - x * i1 >> 16;
- if (frameMode == ScreenMode.FIXED) {
- sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 + 30, 83 - l1 - sprite.anInt1445 / 2 - 4 + 5);
- } else {
- sprite.drawSprite(((77 + k1) - sprite.anInt1444 / 2) + 4 + (frameWidth - 167),
- 85 - l1 - sprite.anInt1445 / 2 - 4);
- }
- }
- public void configureMinimap(int mapbackSpriteIndex) {
- if (ClientSettings.getInt("minimap_config") == mapbackSpriteIndex)
- return;
- ClientSettings.set("minimap_config", mapbackSpriteIndex);
- for (int j6 = 0; j6 < 33; j6++) {
- int k6 = 999;
- int i7 = 0;
- for (int k7 = 0; k7 < 34; k7++) {
- if (mapBack2.aByteArray1450[k7 + j6 * mapBack2.anInt1452] == 0) {
- if (k6 == 999)
- k6 = k7;
- continue;
- }
- if (k6 == 999)
- continue;
- i7 = k7;
- break;
- }
- anIntArray968[j6] = k6;
- anIntArray1057[j6] = i7 - k6;
- }
- if (mapbackSpriteIndex == 0) {
- for (int l6 = 1; l6 < 154; l6++) {
- int j7 = 999;
- int l7 = 0;
- for (int j8 = 1; 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;
- }
- } else if (mapbackSpriteIndex == 1) {
- for (int l6 = 5; l6 < 156; l6++) {
- int j7 = 999;
- int l7 = 0;
- for (int j8 = 25; j8 < 172; j8++) {
- if (mapBack2.aByteArray1450[j8 + l6 * mapBack2.anInt1452] == 0 && (j8 > 34 || l6 > 34)) {
- if (j7 == 999)
- j7 = j8;
- continue;
- }
- if (j7 == 999)
- continue;
- l7 = j8;
- break;
- }
- anIntArray1052[l6 - 5] = j7 - 25;
- anIntArray1229[l6 - 5] = l7 - j7;
- }
- }
- }
- private void npcScreenPos(Entity entity, int i) {
- calcEntityScreenPos(entity.x, i, entity.y);
- }
- 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.modelIntArray1[yCameraCurve];
- int k1 = Model.modelIntArray2[yCameraCurve];
- int l1 = Model.modelIntArray1[xCameraCurve];
- int i2 = Model.modelIntArray2[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 = Texture.textureInt1 + (i << WorldController.viewDistance) / l;
- spriteDrawY = Texture.textureInt2 + (i1 << WorldController.viewDistance) / l;
- } else {
- spriteDrawX = -1;
- spriteDrawY = -1;
- }
- }
- private void buildSplitPrivateChatMenu() {
- if (splitPrivateChat == 0)
- return;
- int i = 0;
- if (anInt1104 != 0)
- i = 1;
- for (int j = 0; j < 100; j++)
- if (chatMessages[j] != null) {
- int k = chatTypes[j];
- String s = chatNames[j];
- if (s != null) {
- for (int j22 = 0; j22 < 20; j22++) {
- if (s.startsWith("@cr" + j22 + "@")) {
- s = s.substring(("@cr" + j22 + "@").length());
- }
- }
- }
- if ((k == 3 || k == 7)
- && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
- int offSet = frameMode == ScreenMode.FIXED ? 4 : 0;
- int l = 329 - i * 13;
- if (frameMode != ScreenMode.FIXED) {
- l = frameHeight - 170 - i * 13;
- }
- if (super.mouseX > 4 && super.mouseY - offSet > l - 10 && super.mouseY - offSet <= l + 3) {
- int i1 = regularText.getTextWidth("From: " + s + chatMessages[j]) + 25;
- if (i1 > 450)
- i1 = 450;
- if (super.mouseX < 4 + i1) {
- if (myPrivilege >= 1) {
- menuActionName[menuActionRow] = "Report abuse @whi@" + s;
- menuActionID[menuActionRow] = 2606;
- menuActionRow++;
- }
- menuActionName[menuActionRow] = "Add ignore @whi@" + s;
- menuActionID[menuActionRow] = 2042;
- menuActionRow++;
- menuActionName[menuActionRow] = "Add friend @whi@" + s;
- menuActionID[menuActionRow] = 2337;
- menuActionRow++;
- }
- }
- if (++i >= 5)
- return;
- }
- if ((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
- return;
- }
- }
- private void requestObject(int delay, int objectId, int faceIndex, int face, int y, int type, int heightLevel,
- int x, int unknow2) {
- Class30_Sub1 class30_sub1 = null;
- for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
- .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
- .reverseGetNext()) {
- if (class30_sub1_1.heightLevel != heightLevel || class30_sub1_1.x != x || class30_sub1_1.y != y
- || class30_sub1_1.face != face)
- continue;
- class30_sub1 = class30_sub1_1;
- break;
- }
- if (class30_sub1 == null) {
- class30_sub1 = new Class30_Sub1();
- class30_sub1.heightLevel = heightLevel;
- class30_sub1.face = face;
- class30_sub1.x = x;
- class30_sub1.y = y;
- method89(class30_sub1);
- aClass19_1179.insertHead(class30_sub1);
- }
- class30_sub1.objectId = objectId;
- class30_sub1.type = type;
- class30_sub1.faceIndex = faceIndex;
- class30_sub1.anInt1302 = unknow2;
- class30_sub1.delay = delay;
- }
- private boolean interfaceIsSelected(RSInterface class9) {
- if (class9.anIntArray245 == null)
- return false;
- for (int i = 0; i < class9.anIntArray245.length; i++) {
- long j = extractInterfaceValues(class9, i);
- int k = class9.anIntArray212[i];
- if (class9.anIntArray245[i] == 2) {
- if (j >= k)
- return false;
- } else if (class9.anIntArray245[i] == 3) {
- if (j <= k)
- return false;
- } else if (class9.anIntArray245[i] == 4) {
- if (j == k)
- return false;
- } else if (j != k)
- return false;
- }
- return true;
- }
- private DataInputStream openJagGrabInputStream(String s) throws IOException {
- // if(!aBoolean872)
- // if(signlink.mainapp != null)
- // return signlink.openurl(s);
- // else
- // return new DataInputStream((new URL(getCodeBase(), s)).openStream());
- if (aSocket832 != null) {
- try {
- aSocket832.close();
- } catch (Exception _ex) {
- }
- aSocket832 = null;
- }
- aSocket832 = openSocket(43595);
- aSocket832.setSoTimeout(10000);
- java.io.InputStream inputstream = aSocket832.getInputStream();
- OutputStream outputstream = aSocket832.getOutputStream();
- outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
- return new DataInputStream(inputstream);
- }
- /*
- * private void doFlamesDrawing() { char c = '\u0100'; if (anInt1040 > 0) {
- * for (int i = 0; i < 256; i++) if (anInt1040 > 768) anIntArray850[i] =
- * method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040); else if
- * (anInt1040 > 256) anIntArray850[i] = anIntArray852[i]; else
- * anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 -
- * anInt1040);
- *
- * } else if (anInt1041 > 0) { for (int j = 0; j < 256; j++) if (anInt1041 >
- * 768) anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024
- * - anInt1041); else if (anInt1041 > 256) anIntArray850[j] =
- * anIntArray853[j]; else anIntArray850[j] = method83(anIntArray853[j],
- * anIntArray851[j], 256 - anInt1041);
- *
- * } else { System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
- *
- * } System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0,
- * aRSImageProducer_1110.canvasRaster, 0, 33920);
- *
- * int i1 = 0; int j1 = 1152; for (int k1 = 1; k1 < c - 1; k1++) { int l1 =
- * (anIntArray969[k1] * (c - k1)) / c; int j2 = 22 + l1; if (j2 < 0) j2 = 0;
- * i1 += j2; for (int l2 = j2; l2 < 128; l2++) { int j3 =
- * anIntArray828[i1++]; if (j3 != 0) { int l3 = j3; int j4 = 256 - j3; j3 =
- * anIntArray850[j3]; int l4 = aRSImageProducer_1110.canvasRaster[j1];
- * aRSImageProducer_1110.canvasRaster[j1++] = ((j3 & 0xff00ff) * l3 + (l4 &
- * 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 &
- * 0xff0000) >> 8; } else { j1++; } }
- *
- * j1 += j2; }
- *
- * aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
- * System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0,
- * aRSImageProducer_1111.canvasRaster, 0, 33920);
- *
- * i1 = 0; j1 = 1176; for (int k2 = 1; k2 < c - 1; k2++) { int i3 =
- * (anIntArray969[k2] * (c - k2)) / c; int k3 = 103 - i3; j1 += i3; for (int
- * i4 = 0; i4 < k3; i4++) { int k4 = anIntArray828[i1++]; if (k4 != 0) { int
- * i5 = k4; int j5 = 256 - k4; k4 = anIntArray850[k4]; int k5 =
- * aRSImageProducer_1111.canvasRaster[j1];
- * aRSImageProducer_1111.canvasRaster[j1++] = ((k4 & 0xff00ff) * i5 + (k5 &
- * 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 &
- * 0xff0000) >> 8; } else { j1++; } }
- *
- * i1 += 128 - k3; j1 += 128 - k3 - i3; }
- *
- * aRSImageProducer_1111.drawGraphics(0, super.graphics, 637); }
- */
- private void method134(RSBuffer stream) {
- int j = stream.readBits(8);
- if (j < playerCount) {
- for (int k = j; k < playerCount; k++)
- anIntArray840[anInt839++] = playerIndices[k];
- }
- if (j > playerCount) {
- Signlink.reporterror(myUsername + " Too many players");
- throw new RuntimeException("eek");
- }
- playerCount = 0;
- for (int l = 0; l < j; l++) {
- int i1 = playerIndices[l];
- Player player = playerArray[i1];
- int j1 = stream.readBits(1);
- if (j1 == 0) {
- playerIndices[playerCount++] = i1;
- player.anInt1537 = loopCycle;
- } else {
- int k1 = stream.readBits(2);
- if (k1 == 0) {
- playerIndices[playerCount++] = i1;
- player.anInt1537 = loopCycle;
- anIntArray894[anInt893++] = i1;
- } else if (k1 == 1) {
- playerIndices[playerCount++] = i1;
- player.anInt1537 = loopCycle;
- int l1 = stream.readBits(3);
- player.moveInDir(false, l1);
- int j2 = stream.readBits(1);
- if (j2 == 1)
- anIntArray894[anInt893++] = i1;
- } else if (k1 == 2) {
- playerIndices[playerCount++] = i1;
- player.anInt1537 = loopCycle;
- int i2 = stream.readBits(3);
- player.moveInDir(true, i2);
- int k2 = stream.readBits(3);
- player.moveInDir(true, k2);
- int l2 = stream.readBits(1);
- if (l2 == 1)
- anIntArray894[anInt893++] = i1;
- } else if (k1 == 3)
- anIntArray840[anInt839++] = i1;
- }
- }
- }
- public boolean inSprite(boolean Click, Sprite sprite, int xCoord, int yCoord) {
- if (Click && super.clickMode3 != 1) {
- return false;
- }
- return (Click ? saveClickX : mouseX) >= xCoord && (Click ? saveClickX : mouseX) <= xCoord + sprite.myWidth
- && (Click ? saveClickY : mouseY) >= yCoord && (Click ? saveClickY : mouseY) <= yCoord + sprite.myHeight;
- }
- int titleAlpha;
- int loginFade;
- boolean shiftLogin;
- private boolean rememberMe;
- private void drawLogo() {
- // logout
- if (aRSImageProducer_1107 == null)
- resetImageProducers();
- Sprite sprite = new Sprite("login/0", this);
- aRSImageProducer_1107.initDrawingArea();
- sprite.drawAdvancedSprite(-100, 0);
- aRSImageProducer_1108.initDrawingArea();
- sprite.drawAdvancedSprite(-202, 0);
- aRSImageProducer_1109.initDrawingArea();
- sprite.drawAdvancedSprite(-202, -171);
- aRSImageProducer_1110.initDrawingArea();
- sprite.drawAdvancedSprite(0, 0);
- aRSImageProducer_1111.initDrawingArea();
- sprite.drawAdvancedSprite(-562, 0);
- aRSImageProducer_1112.initDrawingArea();
- sprite.drawAdvancedSprite(0, -265);
- aRSImageProducer_1113.initDrawingArea();
- sprite.drawAdvancedSprite(-562, 0);
- aRSImageProducer_1114.initDrawingArea();
- sprite.drawAdvancedSprite(-128, -171);
- aRSImageProducer_1115.initDrawingArea();
- sprite.drawAdvancedSprite(-562, -171);
- }
- private void drawLoginScreen(boolean flag) {
- drawLogo();
- resetImageProducers();
- aRSImageProducer_1109.initDrawingArea();
- if (aBackground_966 == null) {
- aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
- aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
- }
- aBackground_966.method361(0, 0);
- char c = '\u0168';
- char c1 = '\310';
- if (loginScreenState == 0) {
- int i = c1 / 2 + 80;
- smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
- i = c1 / 2 - 20;
- boldText.method382(0xffff00, c / 2, "Welcome to Near-Reality", i, true);
- i += 30;
- int l = c / 2 - 80;
- int k1 = c1 / 2 + 20;
- aBackground_967.method361(l - 73, k1 - 20);
- boldText.method382(0xffffff, l, "Info", k1 + 5, true);
- l = c / 2 + 80;
- aBackground_967.method361(l - 73, k1 - 20);
- boldText.method382(0xffffff, l, "Logon", k1 + 5, true);
- }
- if (loginScreenState == 2) {
- int i = c1 / 2 + 80;
- smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
- int j = c1 / 2 - 40;
- if (loginMessage1.length() > 0) {
- boldText.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
- boldText.method382(0xffff00, c / 2, loginMessage2, j, true);
- j += 30;
- } else {
- boldText.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
- j += 30;
- }
- w = (c / 2) - 38;
- h = j - 15;
- if (canEnterAuth) {
- loginScreenCursorPos = 2;
- loginMessage1 = "Authenticator";
- loginMessage2 = "";
- int height = h - 5;
- boldText.method382(0xffffFF, w + 40, "Enter the 6-digit code generated by your", height, true);
- boldText.method382(0xffffFF, w + 40, "authenticator app.", height + 15, true);
- canEnterAuth = true;
- // boldText.method389(true, c / 2 - 90, 0xffffff, "Username: " +
- // TextClass.fixName(myUsername)
- // + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ?
- // "@yel@|" : ""), j);
- j += 15;
- boldText.method389(true, c / 2 - 109, 0xffffff, "PIN: " + TextClass.fixName(myAuth)
- + ((loginScreenCursorPos == 2) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j + 7);
- boldText.method382(0xffffFF, w + 90, "@yel@Trust this computer", j, true);
- boldText.method382(0xffffFF, w + 67, "@yel@for 30 days:", j + 15, true);
- Sprite remember = null;
- if (!rememberPin)
- remember = new Sprite("login/remember_off");
- else
- remember = new Sprite("login/remember_on");
- remember.drawSprite(w + 130, j + 5);
- j += 15;
- if (!flag) {
- int i1 = c / 2 - 80;
- int l1 = c1 / 2 + 50;
- aBackground_967.method361(i1 - 73, l1 - 20);
- boldText.method382(0xffffff, i1, "Continue", l1 + 5, true);
- i1 = c / 2 + 80;
- aBackground_967.method361(i1 - 73, l1 - 20);
- boldText.method382(0xffffff, i1, "Cancel", l1 + 5, true);
- }
- } else {
- w = (c / 2) + 5;
- h = j - 15;
- boldText.method382(0xffffFF, w, "World: @red@(" + currentWorld + ") " + getCurrentWorld().getName(), h,
- true);
- boldText.method389(true, c / 2 - 90, 0xffffff, "Username: " + TextClass.fixName(myUsername)
- + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
- j += 15;
- boldText.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword)
- + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
- j += 15;
- if (!flag) {
- int i1 = c / 2 - 80;
- int l1 = c1 / 2 + 50;
- aBackground_967.method361(i1 - 73, l1 - 20);
- boldText.method382(0xffffff, i1, "Login", l1 + 5, true);
- i1 = c / 2 + 80;
- aBackground_967.method361(i1 - 73, l1 - 20);
- boldText.method382(0xffffff, i1, "Select Next World?", l1 + 5, true);
- }
- regularText.drawRegularText(true, w - 70, 0xFFFFFF, "Remember Password?", h + 47);
- if (ClientSettings.getBoolean("remember_me")) {
- DrawingArea.drawDiagonalLine(w - 80, h + 49, w - 94, h + 35, 0xFFFF00);
- DrawingArea.drawDiagonalLine(w - 80, h + 35, w - 94, h + 49, 0xFFFF00);
- }
- DrawingArea.drawRectangle(w - 94, h + 35, 15, 15, 0xFFFFFF, 255);
- }
- }
- if (loginScreenState == 3) {
- boldText.method382(0xffff00, c / 2, "Create a free account", c1 / 2 - 60, true);
- int k = c1 / 2 - 35;
- boldText.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
- k += 15;
- boldText.method382(0xffffff, c / 2, "enter a username and password that", k, true);
- k += 15;
- boldText.method382(0xffffff, c / 2, "you wish to use.", k, true);
- k += 15;
- boldText.method382(0xffffff, c / 2, "Forums: http://near-reality.org", k, true);
- k += 15;
- int j1 = c / 2;
- int i2 = c1 / 2 + 50;
- aBackground_967.method361(j1 - 73, i2 - 20);
- boldText.method382(0xffffff, j1, "Cancel", i2 + 5, true);
- }
- aRSImageProducer_1107.drawGraphics(0, super.graphics, 100);
- aRSImageProducer_1108.drawGraphics(0, super.graphics, 202);
- aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
- aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
- aRSImageProducer_1111.drawGraphics(0, super.graphics, 562);
- aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
- aRSImageProducer_1113.drawGraphics(0, super.graphics, 562);
- aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
- aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
- if (welcomeScreenRaised) {
- welcomeScreenRaised = false;
- }
- }
- int w = 0;
- int h = 0;
- private int currentWorld;
- private void drawLoginScreenOld(boolean flag) {
- resetImageProducers();
- aRSImageProducer_1109.initDrawingArea();
- DrawingArea.drawFilledPixels(0, 0, 765, 503, 0x000000);
- int centerX = 765 / 2;
- int centerY = 503 / 2;
- // titleAlpha = 0;
- titleAlpha += titleAlpha < 250 ? 8 : 0;
- /*
- * if (Constants.DISPLAY_GAMEWORLD_ON_LOGIN) {
- * drawAnimatedWorldBackground(true); } else {
- */
- if (titleAlpha < 250) {
- loginSprites[0].drawTransparentSprite(centerX - loginSprites[0].myWidth / 2,
- centerY - loginSprites[0].myHeight / 2, titleAlpha);
- } else {
- loginSprites[0].drawAdvancedSprite(centerX - loginSprites[0].myWidth / 2,
- centerY - loginSprites[0].myHeight / 2);
- }
- // }
- if (titleAlpha >= 240) {
- aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
- aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
- aBackground_966.method361(0, 0);
- char c = '\u0168';
- char c1 = '\310';
- if (loginScreenState == 0) {
- int i = c1 / 2 + 80;
- smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
- i = c1 / 2 - 20;
- boldText.method382(0xffff00, c / 2, "Welcome to Near-Reality", i, true);
- i += 30;
- int l = c / 2 - 80;
- int k1 = c1 / 2 + 20;
- aBackground_967.method361(l - 73, k1 - 20);
- boldText.method382(0xffffff, l, "Info", k1 + 5, true);
- l = c / 2 + 80;
- aBackground_967.method361(l - 73, k1 - 20);
- boldText.method382(0xffffff, l, "Logon", k1 + 5, true);
- }
- if (loginScreenState == 2) {
- int i = c1 / 2 + 80;
- smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
- int j = c1 / 2 - 40;
- if (loginMessage1.length() > 0) {
- boldText.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
- boldText.method382(0xffff00, c / 2, loginMessage2, j, true);
- j += 30;
- } else {
- boldText.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
- j += 30;
- }
- w = (c / 2) - 38;
- h = j - 15;
- switch (currentWorld) {
- case 1:
- w = (c / 2) + 5;
- h = j - 15;
- boldText.method382(0xffffFF, w, "World: @red@(1) World 1", h, true);
- break;
- case 2:
- w = (c / 2) + 5;
- h = j - 15;
- boldText.method382(0xffffFF, w, "World: @red@(2) World 2", h, true);
- break;
- }
- boldText.method389(true, c / 2 - 90, 0xffffff, "Username: " + TextClass.fixName(myUsername)
- + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
- j += 15;
- boldText.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword)
- + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
- j += 15;
- if (!flag) {
- int i1 = c / 2 - 80;
- int l1 = c1 / 2 + 50;
- aBackground_967.method361(i1 - 73, l1 - 20);
- boldText.method382(0xffffff, i1, "Login", l1 + 5, true);
- i1 = c / 2 + 80;
- aBackground_967.method361(i1 - 73, l1 - 20);
- boldText.method382(0xffffff, i1, "Select Next World?", l1 + 5, true);
- }
- }
- if (loginScreenState == 3) {
- boldText.method382(0xffff00, c / 2, "Create a free account", c1 / 2 - 60, true);
- int k = c1 / 2 - 35;
- boldText.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
- k += 15;
- boldText.method382(0xffffff, c / 2, "enter a username and password that", k, true);
- k += 15;
- boldText.method382(0xffffff, c / 2, "you wish to use.", k, true);
- k += 15;
- boldText.method382(0xffffff, c / 2, "Forums: http://near-reality.org", k, true);
- k += 15;
- int j1 = c / 2;
- int i2 = c1 / 2 + 50;
- aBackground_967.method361(j1 - 73, i2 - 20);
- boldText.method382(0xffffff, j1, "Cancel", i2 + 5, true);
- }
- aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
- if (welcomeScreenRaised) {
- welcomeScreenRaised = false;
- }
- }
- }
- /*
- * private void drawFlames() { drawingFlames = true; try { long l =
- * System.currentTimeMillis(); int i = 0; int j = 20; while (aBoolean831) {
- * calcFlamesPosition(); calcFlamesPosition(); doFlamesDrawing(); 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 method137(RSBuffer stream, int j) {
- if (j == 84) {
- int k = stream.readUnsignedByte();
- int j3 = anInt1268 + (k >> 4 & 7);
- int i6 = anInt1269 + (k & 7);
- int l8 = stream.readUnsignedWord();
- int k11 = stream.readUnsignedWord();
- int l13 = stream.readUnsignedWord();
- if (j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104) {
- NodeList class19_1 = groundArray[plane][j3][i6];
- if (class19_1 != null) {
- for (Item class30_sub2_sub4_sub2_3 = (Item) class19_1
- .reverseGetFirst(); class30_sub2_sub4_sub2_3 != null; class30_sub2_sub4_sub2_3 = (Item) class19_1
- .reverseGetNext()) {
- if (class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.itemAmount != k11)
- continue;
- class30_sub2_sub4_sub2_3.itemAmount = l13;
- break;
- }
- spawnGroundItem(j3, i6);
- }
- }
- return;
- }
- if (j == 105) {
- int l = stream.readUnsignedByte();
- int k3 = anInt1268 + (l >> 4 & 7);
- int j6 = anInt1269 + (l & 7);
- int i9 = stream.readUnsignedWord();
- int l11 = stream.readUnsignedByte();
- int i14 = l11 >> 4 & 0xf;
- int i16 = l11 & 7;
- if (myPlayer.smallX[0] >= k3 - i14 && myPlayer.smallX[0] <= k3 + i14 && myPlayer.smallY[0] >= j6 - i14
- && myPlayer.smallY[0] <= j6 + i14 && aBoolean848 && !lowMem && anInt1062 < 50) {
- anIntArray1207[anInt1062] = i9;
- anIntArray1241[anInt1062] = i16;
- anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
- anInt1062++;
- }
- }
- if (j == 215) {
- int i1 = stream.method435();
- int l3 = stream.method428();
- int k6 = anInt1268 + (l3 >> 4 & 7);
- int j9 = anInt1269 + (l3 & 7);
- int i12 = stream.method435();
- int j14 = stream.readUnsignedWord();
- if (k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10) {
- Item class30_sub2_sub4_sub2_2 = new Item();
- class30_sub2_sub4_sub2_2.ID = i1;
- class30_sub2_sub4_sub2_2.itemAmount = j14;
- if (groundArray[plane][k6][j9] == null)
- groundArray[plane][k6][j9] = new NodeList();
- groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
- spawnGroundItem(k6, j9);
- }
- return;
- }
- if (j == 156) {
- int j1 = stream.method426();
- int i4 = anInt1268 + (j1 >> 4 & 7);
- int l6 = anInt1269 + (j1 & 7);
- int k9 = stream.readDWord();
- if (i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104) {
- NodeList class19 = groundArray[plane][i4][l6];
- if (class19 != null) {
- for (Item item = (Item) class19.reverseGetFirst(); item != null; item = (Item) class19
- .reverseGetNext()) {
- if (item.ID != k9/* (k9 & 0x7fff) */)/// XXX: changed to
- /// fix osrs
- /// items not
- /// dissapearing
- continue;
- item.unlink();
- break;
- }
- if (class19.reverseGetFirst() == null)
- groundArray[plane][i4][l6] = null;
- spawnGroundItem(i4, l6);
- }
- }
- return;
- }
- if (j == 160) {
- int k1 = stream.method428();
- int j4 = anInt1268 + (k1 >> 4 & 7);
- int i7 = anInt1269 + (k1 & 7);
- int l9 = stream.method428();
- int j12 = l9 >> 2;
- int k14 = l9 & 3;
- int j16 = anIntArray1177[j12];
- int j17 = stream.method435();
- if (j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103) {
- int j18 = intGroundArray[plane][j4][i7];
- int i19 = intGroundArray[plane][j4 + 1][i7];
- int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
- int k20 = intGroundArray[plane][j4][i7 + 1];
- if (j16 == 0) {
- Object1 class10 = worldController.method296(plane, j4, i7);
- if (class10 != null) {
- int k21 = class10.uid >> 14 & 0x7fff;
- if (j12 == 2) {
- class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17,
- false);
- class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20,
- j17, false);
- } else {
- class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17,
- false);
- }
- }
- }
- if (j16 == 1) {
- Object2 class26 = worldController.method297(j4, i7, plane);
- if (class26 != null)
- class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19,
- j18, k20, j17, false);
- }
- if (j16 == 2) {
- Object5 class28 = worldController.method298(j4, i7, plane);
- if (j12 == 11)
- j12 = 10;
- if (class28 != null)
- class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19,
- l19, j18, k20, j17, false);
- }
- if (j16 == 3) {
- Object3 class49 = worldController.method299(i7, j4, plane);
- if (class49 != null)
- class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19,
- l19, j18, k20, j17, false);
- }
- }
- return;
- }
- if (j == 147) {
- int l1 = stream.method428();
- int k4 = anInt1268 + (l1 >> 4 & 7);
- int j7 = anInt1269 + (l1 & 7);
- int i10 = stream.readUnsignedWord();
- byte byte0 = stream.method430();
- int l14 = stream.method434();
- byte byte1 = stream.method429();
- int k17 = stream.readUnsignedWord();
- int k18 = stream.method428();
- int j19 = k18 >> 2;
- int i20 = k18 & 3;
- int l20 = anIntArray1177[j19];
- byte byte2 = stream.readSignedByte();
- int l21 = stream.readUnsignedWord();
- byte byte3 = stream.method429();
- Player player;
- if (i10 == unknownInt10)
- player = myPlayer;
- else
- player = playerArray[i10];
- if (player != null) {
- ObjectDefinition class46 = ObjectDefinition.forID(l21);
- int i22 = intGroundArray[plane][k4][j7];
- int j22 = intGroundArray[plane][k4 + 1][j7];
- int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
- int l22 = intGroundArray[plane][k4][j7 + 1];
- Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
- if (model != null) {
- requestObject(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
- player.anInt1707 = l14 + loopCycle;
- player.anInt1708 = k17 + loopCycle;
- player.aModel_1714 = model;
- int i23 = class46.anInt744;
- int j23 = class46.anInt761;
- if (i20 == 1 || i20 == 3) {
- i23 = class46.anInt761;
- j23 = class46.anInt744;
- }
- player.anInt1711 = k4 * 128 + i23 * 64;
- player.anInt1713 = j7 * 128 + j23 * 64;
- player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
- if (byte2 > byte0) {
- byte byte4 = byte2;
- byte2 = byte0;
- byte0 = byte4;
- }
- if (byte3 > byte1) {
- byte byte5 = byte3;
- byte3 = byte1;
- byte1 = byte5;
- }
- player.anInt1719 = k4 + byte2;
- player.anInt1721 = k4 + byte0;
- player.anInt1720 = j7 + byte3;
- player.anInt1722 = j7 + byte1;
- }
- }
- }
- if (j == 151) {
- int heightLevel = stream.method426();
- int x = anInt1268;
- int y = anInt1269;
- int id = stream.readDWord();
- int faceTypeMask = stream.method428();
- int type = faceTypeMask >> 2;
- int faceIndex = faceTypeMask & 3;
- int face = anIntArray1177[type];
- if (x >= 0 && y >= 0 && x < 104 && y < 104)
- requestObject(-1, id, faceIndex, face, y, type, heightLevel, x, 0);
- return;
- }
- if (j == 4) {
- int j2 = stream.readUnsignedByte();
- int i5 = anInt1268 + (j2 >> 4 & 7);
- int l7 = anInt1269 + (j2 & 7);
- int k10 = stream.readUnsignedWord();
- int l12 = stream.readUnsignedByte();
- int j15 = stream.readUnsignedWord();
- if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) {
- i5 = i5 * 128 + 64;
- l7 = l7 * 128 + 64;
- Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10,
- method42(plane, l7, i5) - l12, l7, i5);
- aClass19_1056.insertHead(class30_sub2_sub4_sub3);
- }
- return;
- }
- if (j == 44) {
- int k2 = stream.method436();
- int j5 = stream.readUnsignedWord();
- int i8 = stream.readUnsignedByte();
- int l10 = anInt1268 + (i8 >> 4 & 7);
- int i13 = anInt1269 + (i8 & 7);
- if (l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104) {
- Item class30_sub2_sub4_sub2_1 = new Item();
- class30_sub2_sub4_sub2_1.ID = k2;
- class30_sub2_sub4_sub2_1.itemAmount = j5;
- if (groundArray[plane][l10][i13] == null)
- groundArray[plane][l10][i13] = new NodeList();
- groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
- spawnGroundItem(l10, i13);
- }
- return;
- }
- if (j == 101) {
- int l2 = stream.method427();
- int k5 = l2 >> 2;
- int j8 = l2 & 3;
- int i11 = anIntArray1177[k5];
- int j13 = stream.readUnsignedByte();
- int k15 = anInt1268 + (j13 >> 4 & 7);
- int l16 = anInt1269 + (j13 & 7);
- if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
- requestObject(-1, -1, j8, i11, l16, k5, plane, k15, 0);
- return;
- }
- if (j == 117) {
- int i3 = stream.readUnsignedByte();
- int l5 = anInt1268 + (i3 >> 4 & 7);
- int k8 = anInt1269 + (i3 & 7);
- int j11 = l5 + stream.readSignedByte();
- int k13 = k8 + stream.readSignedByte();
- int l15 = stream.readSignedWord();
- int i17 = stream.readUnsignedWord();
- int i18 = stream.readUnsignedByte() * 4;
- int l18 = stream.readUnsignedByte() * 4;
- int k19 = stream.readUnsignedWord();
- int j20 = stream.readUnsignedWord();
- int i21 = stream.readUnsignedByte();
- int j21 = stream.readUnsignedByte();
- if (l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104
- && i17 != 65535) {
- l5 = l5 * 128 + 64;
- k8 = k8 * 128 + 64;
- j11 = j11 * 128 + 64;
- k13 = k13 * 128 + 64;
- Animable_Sub4 class30_sub2_sub4_sub4 = new Animable_Sub4(i21, l18, k19 + loopCycle, j20 + loopCycle,
- j21, plane, method42(plane, k8, l5) - i18, k8, l5, l15, i17);
- class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
- aClass19_1013.insertHead(class30_sub2_sub4_sub4);
- }
- }
- }
- private void method139(RSBuffer stream) {
- stream.initBitAccess();
- int k = stream.readBits(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.readBits(1);
- if (k1 == 0) {
- npcIndices[npcCount++] = j1;
- npc.anInt1537 = loopCycle;
- } else {
- int l1 = stream.readBits(2);
- if (l1 == 0) {
- npcIndices[npcCount++] = j1;
- npc.anInt1537 = loopCycle;
- anIntArray894[anInt893++] = j1;
- } else if (l1 == 1) {
- npcIndices[npcCount++] = j1;
- npc.anInt1537 = loopCycle;
- int i2 = stream.readBits(3);
- npc.moveInDir(false, i2);
- int k2 = stream.readBits(1);
- if (k2 == 1)
- anIntArray894[anInt893++] = j1;
- } else if (l1 == 2) {
- npcIndices[npcCount++] = j1;
- npc.anInt1537 = loopCycle;
- int j2 = stream.readBits(3);
- npc.moveInDir(true, j2);
- int l2 = stream.readBits(3);
- npc.moveInDir(true, l2);
- int i3 = stream.readBits(1);
- if (i3 == 1)
- anIntArray894[anInt893++] = j1;
- } else if (l1 == 3)
- anIntArray840[anInt839++] = j1;
- }
- }
- }
- private void processLoginScreenInput() {
- if (loginScreenState == 0) {
- int i = super.myWidth / 2 - 80;
- int l = super.myHeight / 2 + 20;
- l += 20;
- if (super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75
- && super.saveClickY >= l - 20 && super.saveClickY <= l + 20) {
- loginScreenState = 3;
- loginScreenCursorPos = 0;
- }
- i = super.myWidth / 2 + 80;
- if (super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75
- && super.saveClickY >= l - 20 && super.saveClickY <= l + 20) {
- loginMessage1 = "";
- loginMessage2 = "Enter your username & password.";
- loginScreenState = 2;
- loginScreenCursorPos = 0;
- }
- } else {
- if (loginScreenState == 2) {
- int j = super.myHeight / 2 - 40;
- j += 30;
- j += 25;
- if (super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
- loginScreenCursorPos = 0;
- j += 15;
- if (super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
- loginScreenCursorPos = 1;
- j += 15;
- int i1 = super.myWidth / 2 - 80;
- int k1 = super.myHeight / 2 + 50;
- k1 += 20;
- char c = '\u0168';
- w = (c / 2) + 5;
- h = j - 15;
- if (super.clickMode3 == 1 && super.saveClickX <= 307 && super.saveClickX >= 292 && super.saveClickY >= 283 && super.saveClickY <= 298) {
- ClientSettings.set("remember_me", !ClientSettings.getBoolean("remember_me"));
- ClientSettings.save();
- super.clickMode3 = 0;
- }
- if (super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75
- && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20) {
- if (myUsername.length() == 0) {
- loginMessage1 = "Enter a username";
- if (myPassword.length() == 0)
- loginMessage1 = loginMessage1 + " & password";
- loginMessage1 = loginMessage1 + "!";
- loginMessage2 = "";
- return;
- }
- if (myPassword.length() == 0) {
- loginMessage1 = "Enter a password!";
- loginMessage2 = "";
- return;
- }
- if (myPassword.length() < 5) {
- loginMessage1 = "Your password is too weak.";
- loginMessage2 = "";
- return;
- }
- loginFailures = 0;
- login(myUsername, myPassword, myAuth, rememberPin, false);
- if (loggedIn)
- return;
- }
- if (canEnterAuth) {
- // 272 1055
- if (super.clickMode3 == 1 && super.saveClickX >= 475 && super.saveClickX <= 487
- && super.saveClickY >= 281 && super.saveClickY <= 292) {
- rememberPin = !rememberPin;
- }
- }
- i1 = super.myWidth / 2 + 80;
- if (super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75
- && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20) {
- if (canEnterAuth) {
- canEnterAuth = false;
- loginMessage1 = "";
- loginMessage2 = "Enter your username & password.";
- loginScreenState = 2;
- loginScreenCursorPos = 0;
- } else {
- currentWorld++;
- if (currentWorld > Configuration.WORLDS.size()) {
- currentWorld = 1;
- }
- }
- drawLoginScreen(true);
- }
- do {
- int l1 = readChar(-796);
- if (l1 == -1)
- break;
- boolean flag1 = false;
- for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
- if (l1 != validUserPassChars.charAt(i2))
- continue;
- flag1 = true;
- break;
- }
- if (loginScreenCursorPos == 0) {
- if (l1 == 8 && myUsername.length() > 0)
- myUsername = myUsername.substring(0, myUsername.length() - 1);
- if (l1 == 9 || l1 == 10 || l1 == 13)
- loginScreenCursorPos = 1;
- if (flag1)
- myUsername += (char) l1;
- if (myUsername.length() > 12)
- myUsername = myUsername.substring(0, 12);
- } else if (loginScreenCursorPos == 1) {
- if (l1 == 8 && myPassword.length() > 0)
- myPassword = myPassword.substring(0, myPassword.length() - 1);
- if (l1 == 9 || l1 == 10 || l1 == 13)
- loginScreenCursorPos = 0;
- if (flag1)
- myPassword += (char) l1;
- if (myPassword.length() > 20)
- myPassword = myPassword.substring(0, 20);
- } else if (loginScreenCursorPos == 2) {
- if (l1 == 8 && myAuth.length() > 0)
- myAuth = myAuth.substring(0, myAuth.length() - 1);
- if (l1 == 9 || l1 == 13)
- loginScreenCursorPos = 0;
- if (l1 == 10) {
- loginFailures = 0;
- login(myUsername, myPassword, myAuth, rememberPin, false);
- if (loggedIn)
- return;
- }
- if (flag1) {
- char input = (char) l1;
- if (!Character.isDigit(input))
- return;
- if (myAuth.length() > 5)
- return;
- myAuth += input;
- }
- if (myAuth.length() > 20)
- myAuth = myAuth.substring(0, 20);
- }
- } while (true);
- return;
- }
- if (loginScreenState == 3) {
- int k = super.myWidth / 2;
- int j1 = super.myHeight / 2 + 50;
- j1 += 20;
- if (super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75
- && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
- loginScreenState = 0;
- }
- }
- }
- private void processLoginScreenInputOld() {
- /*
- * if (loginScreenState == 0) { int i = super.myWidth / 2 - 80; int l =
- * super.myHeight / 2 + 20; l += 20; if (super.clickMode3 == 1 &&
- * super.saveClickX >= i - 75 && super.saveClickX <= i + 75 &&
- * super.saveClickY >= l - 20 && super.saveClickY <= l + 20) {
- * loginScreenState = 3; loginScreenCursorPos = 0; } i = super.myWidth /
- * 2 + 80; if (super.clickMode3 == 1 && super.saveClickX >= i - 75 &&
- * super.saveClickX <= i + 75 && super.saveClickY >= l - 20 &&
- * super.saveClickY <= l + 20) { loginMessage1 = ""; loginMessage2 =
- * "Enter your username & password."; loginScreenState = 2;
- * loginScreenCursorPos = 0; } } else {
- */
- int centerX = 765 / 2;
- int centerY = 503 / 2;
- int boxX = centerX - loginSprites[2].myWidth / 2;
- int boxY = centerY - loginSprites[2].myHeight / 2 + 50;
- // if (loginScreenState == 2) {
- if (loginSprites[3].clicked(boxX + 57, boxY + 43, 0, 0)) {
- loginScreenCursorPos = 0;
- }
- if (loginSprites[3].clicked(boxX + 57, boxY + 114, 0, 0)) {
- loginScreenCursorPos = 1;
- }
- if (canEnterAuth) {
- if (loginSprites[3].clicked(boxX + 57, boxY + 274, 0, 0)) {
- loginScreenCursorPos = 2;
- }
- }
- if (loginSprites[6].clicked(boxX + 78, boxY + 207, 0, 0)) {
- if (myPassword.length() < 5) {
- loginMessage1 = "Your password is too weak.";
- } else {
- loginFailures = 0;
- login(myUsername, myPassword, myAuth, rememberPin, false);
- if (loggedIn)
- return;
- }
- }
- do {
- int l1 = readChar(-796);
- if (l1 == -1)
- break;
- boolean flag1 = false;
- for (int i2 = 0; i2 < validUserPassChars.length(); i2++) {
- if (l1 != validUserPassChars.charAt(i2))
- continue;
- flag1 = true;
- break;
- }
- if (loginScreenCursorPos == 0) {
- if (l1 == 8 && myUsername.length() > 0)
- myUsername = myUsername.substring(0, myUsername.length() - 1);
- if (l1 == 9 || l1 == 10 || l1 == 13)
- loginScreenCursorPos = 1;
- if (flag1)
- myUsername += (char) l1;
- if (myUsername.length() > 12)
- myUsername = myUsername.substring(0, 12);
- } else if (loginScreenCursorPos == 1) {
- if (l1 == 8 && myPassword.length() > 0)
- myPassword = myPassword.substring(0, myPassword.length() - 1);
- if (l1 == 9 || l1 == 13)
- loginScreenCursorPos = 0;
- if (l1 == 10) {
- if (myPassword.length() < 5) {
- loginMessage1 = "Your password is too weak.";
- } else {
- loginFailures = 0;
- login(myUsername, myPassword, myAuth, rememberPin, false);
- if (loggedIn)
- return;
- }
- }
- if (flag1)
- myPassword += (char) l1;
- if (myPassword.length() > 20)
- myPassword = myPassword.substring(0, 20);
- } else if (loginScreenCursorPos == 2) {
- if (l1 == 8 && myAuth.length() > 0)
- myAuth = myAuth.substring(0, myAuth.length() - 1);
- if (l1 == 9 || l1 == 13)
- loginScreenCursorPos = 0;
- if (l1 == 10) {
- loginFailures = 0;
- login(myUsername, myPassword, myAuth, rememberPin, false);
- if (loggedIn)
- return;
- }
- if (flag1)
- myAuth += (char) l1;
- if (myAuth.length() > 20)
- myAuth = myAuth.substring(0, 20);
- }
- } while (true);
- return;
- // }
- /*
- * if (loginScreenState == 3) { int k = super.myWidth / 2; int j1 =
- * super.myHeight / 2 + 50; j1 += 20; if (super.clickMode3 == 1 &&
- * super.saveClickX >= k - 75 && super.saveClickX <= k + 75 &&
- * super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
- * loginScreenState = 0; }
- */
- // }
- }
- private void method142(int i, int j, int k, int l, int i1, int j1, int k1) {
- if (i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102) {
- if (lowMem && j != plane)
- return;
- int i2 = 0;
- if (j1 == 0)
- i2 = worldController.method300(j, i1, i);
- if (j1 == 1)
- i2 = worldController.method301(j, i1, i);
- if (j1 == 2)
- i2 = worldController.method302(j, i1, i);
- if (j1 == 3)
- i2 = worldController.method303(j, i1, i);
- if (i2 != 0) {
- int i3 = worldController.method304(j, i1, i, i2);
- int j2 = i2 >> 14 & 0x7fff;
- int k2 = i3 & 0x1f;
- int l2 = i3 >> 6;
- if (j1 == 0) {
- worldController.method291(i1, j, i, (byte) -119);
- ObjectDefinition class46 = ObjectDefinition.forID(j2);
- if (class46.aBoolean767)
- aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
- }
- if (j1 == 1)
- worldController.method292(i, j, i1);
- if (j1 == 2) {
- worldController.method293(j, i1, i);
- ObjectDefinition class46_1 = ObjectDefinition.forID(j2);
- if (i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103
- || i + class46_1.anInt761 > 103)
- return;
- if (class46_1.aBoolean767)
- aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761,
- class46_1.aBoolean757);
- }
- if (j1 == 3) {
- worldController.method294(j, i, i1);
- ObjectDefinition class46_2 = ObjectDefinition.forID(j2);
- if (class46_2.aBoolean767 && class46_2.hasActions)
- aClass11Array1230[j].method218(i, i1);
- }
- }
- if (k1 >= 0) {
- int j3 = j;
- if (j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
- j3++;
- ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
- }
- }
- }
- private void updatePlayers(int i, RSBuffer stream) {
- anInt839 = 0;
- anInt893 = 0;
- method117(stream);
- method134(stream);
- method91(stream, i);
- method49(stream);
- for (int k = 0; k < anInt839; k++) {
- int l = anIntArray840[k];
- if (playerArray[l].anInt1537 != loopCycle)
- playerArray[l] = null;
- }
- if (stream.currentOffset != i) {
- Signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
- throw new RuntimeException("eek");
- }
- for (int i1 = 0; i1 < playerCount; i1++)
- if (playerArray[playerIndices[i1]] == null) {
- Signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " 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.modelIntArray1[l1];
- int k3 = Model.modelIntArray2[l1];
- int i4 = k2 * k3 - l2 * i3 >> 16;
- l2 = k2 * i3 + l2 * k3 >> 16;
- k2 = i4;
- }
- if (i2 != 0) {
- int j3 = Model.modelIntArray1[i2];
- int l3 = Model.modelIntArray2[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 updateStrings(String str, int i) {
- switch (i) {
- case 1675:
- sendFrame126(str, 17508);
- break;// Stab
- case 1676:
- sendFrame126(str, 17509);
- break;// Slash
- case 1677:
- sendFrame126(str, 17510);
- break;// Cursh
- case 1678:
- sendFrame126(str, 17511);
- break;// Magic
- case 1679:
- sendFrame126(str, 17512);
- break;// Range
- case 1680:
- sendFrame126(str, 17513);
- break;// Stab
- case 1681:
- sendFrame126(str, 17514);
- break;// Slash
- case 1682:
- sendFrame126(str, 17515);
- break;// Crush
- case 1683:
- sendFrame126(str, 17516);
- break;// Magic
- case 1684:
- sendFrame126(str, 17517);
- break;// Range
- case 1686:
- sendFrame126(str, 17518);
- break;// Strength
- case 1687:
- sendFrame126(str, 17519);
- break;// Prayer
- }
- }
- private static void setHighMemAndReadUUID() {
- WorldController.lowMem = false;
- Texture.lowMem = false;
- lowMem = false;
- ObjectManager.lowMem = false;
- ObjectDefinition.lowMem = false;
- }
- public void sendFrame126(String str, int i) {
- RSInterface inter = RSInterface.interfaceCache[i];
- if (inter == null) {
- System.err.println("Null interface message update: " + i);
- return;
- }
- inter.message = str;
- if (RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID]) {
- }
- }
- public void sendPacket185(int button, int toggle, int type) {
- switch (type) {
- case 135:
- RSInterface class9 = RSInterface.interfaceCache[button];
- boolean flag8 = true;
- if (class9.contentType > 0)
- flag8 = promptUserForInput(class9);
- if (flag8) {
- MikeysInterfaces.buttonClicked(button);
- stream.createFrame(185);
- stream.writeWord(button);
- }
- break;
- case 646:
- MikeysInterfaces.buttonClicked(button);
- stream.createFrame(185);
- stream.writeWord(button);
- RSInterface class9_2 = RSInterface.interfaceCache[button];
- if (class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
- if (variousSettings[toggle] != class9_2.anIntArray212[0]) {
- variousSettings[toggle] = class9_2.anIntArray212[0];
- method33(toggle);
- }
- }
- break;
- case 169:
- MikeysInterfaces.buttonClicked(button);
- stream.createFrame(185);
- stream.writeWord(button);
- RSInterface class9_3 = RSInterface.interfaceCache[button];
- if (class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
- variousSettings[toggle] = 1 - variousSettings[toggle];
- method33(toggle);
- }
- switch (button) {
- case 74214:
- if (toggle == 0)
- sendFrame36(173, toggle);
- if (toggle == 1)
- sendPacket185(153, 173, 646);
- break;
- }
- break;
- }
- }
- public void sendFrame36(int id, int state) {
- anIntArray1045[id] = state;
- if (variousSettings[id] != state) {
- variousSettings[id] = state;
- method33(id);
- if (dialogID != -1)
- inputTaken = true;
- }
- }
- public void sendFrame219() {
- if (invOverlayInterfaceID != -1) {
- invOverlayInterfaceID = -1;
- tabAreaAltered = true;
- }
- if (backDialogID != -1) {
- backDialogID = -1;
- inputTaken = true;
- }
- if (inputDialogState != 0) {
- inputDialogState = 0;
- inputTaken = true;
- }
- openInterfaceID = -1;
- aBoolean1149 = false;
- }
- public void sendFrame248(int interfaceID, int sideInterfaceID) {
- if (backDialogID != -1) {
- backDialogID = -1;
- inputTaken = true;
- }
- if (inputDialogState != 0) {
- inputDialogState = 0;
- inputTaken = true;
- }
- openInterfaceID = interfaceID;
- invOverlayInterfaceID = sideInterfaceID;
- tabAreaAltered = true;
- aBoolean1149 = false;
- }
- private boolean parsePacket() {
- if (socketStream == null)
- return false;
- try {
- int i = socketStream.available();
- if (i == 0)
- return false;
- if (pktType == -1) {
- socketStream.flushInputStream(inStream.buffer, 1);
- pktType = inStream.buffer[0] & 0xff;
- if (encryption != null)
- pktType = pktType - encryption.getNextKey() & 0xff;
- pktSize = SizeConstants.packetSizes[pktType];
- i--;
- }
- if (pktSize == -1)
- if (i > 0) {
- socketStream.flushInputStream(inStream.buffer, 1);
- pktSize = inStream.buffer[0] & 0xff;
- i--;
- } else {
- return false;
- }
- if (pktSize == -2)
- if (i > 1) {
- socketStream.flushInputStream(inStream.buffer, 2);
- inStream.currentOffset = 0;
- pktSize = inStream.readUnsignedWord();
- i -= 2;
- } else {
- return false;
- }
- if (i < pktSize)
- return false;
- inStream.currentOffset = 0;
- socketStream.flushInputStream(inStream.buffer, pktSize);
- anInt1009 = 0;
- anInt843 = anInt842;
- anInt842 = anInt841;
- anInt841 = pktType;
- // if (pktType != 81 && pktType != 65 && pktType != 126)
- // System.out.println(pktType);
- switch (pktType) {
- case 116:
- mySummonIndex = inStream.readDWord();
- pktType = -1;
- return true;
- case 3:
- gameframeHint = inStream.readUnsignedByte();
- System.out.println("gameframe hint: " + gameframeHint);
- pktType = -1;
- return true;
- case 5:
- int opcode = inStream.readUnsignedByte();
- int time = inStream.readUnsignedWord();
- CombatOverlays.add(opcode, time);
- pktType = -1;
- return true;
- case 150:
- int rsinterfaceId = inStream.readDWord();
- int npcId = inStream.readDWord();
- int modelZoom = inStream.readDWord();
- int animation = inStream.readDWord();
- if (npcId != -1) {
- RSInterface.get(rsinterfaceId).npcDisplay.desc = NpcDefinition.forID(npcId);
- } else {
- RSInterface.get(rsinterfaceId).npcDisplay.desc = null;
- }
- RSInterface.get(rsinterfaceId).modelZoom = modelZoom;
- RSInterface.get(rsinterfaceId).npcAnimation = animation;
- pktType = -1;
- return true;
- case 152:
- int rsinterfaceId2 = inStream.readDWord();
- int translateX = inStream.readSignedByte();
- int translateY = inStream.readSignedByte();
- RSInterface parent = RSInterface.get(RSInterface.get(rsinterfaceId2).parentID);
- parent.resetChildCoordinates(rsinterfaceId2);
- parent.translateChild(rsinterfaceId2, translateX, translateY);
- pktType = -1;
- return true;
- case 81:
- updatePlayers(pktSize, inStream);
- aBoolean1080 = false;
- pktType = -1;
- return true;
- case 176:
- daysSinceRecovChange = inStream.method427();
- unreadMessages = inStream.method435();
- membersInt = inStream.readUnsignedByte();
- anInt1193 = inStream.method440();
- daysSinceLastLogin = inStream.readUnsignedWord();
- if (anInt1193 != 0 && openInterfaceID == -1) {
- Signlink.dnslookup(TextClass.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;
- }
- }
- pktType = -1;
- return true;
- case 64:
- anInt1268 = inStream.method427();
- anInt1269 = inStream.method428();
- for (int j = anInt1268; j < anInt1268 + 8; j++) {
- for (int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
- if (groundArray[plane][j][l9] != null) {
- groundArray[plane][j][l9] = null;
- spawnGroundItem(j, l9);
- }
- }
- for (Class30_Sub1 class30_sub1 = (Class30_Sub1) aClass19_1179
- .reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1) aClass19_1179
- .reverseGetNext())
- if (class30_sub1.x >= anInt1268 && class30_sub1.x < anInt1268 + 8 && class30_sub1.y >= anInt1269
- && class30_sub1.y < anInt1269 + 8 && class30_sub1.heightLevel == plane)
- class30_sub1.delay = 0;
- pktType = -1;
- return true;
- case 185:
- int k = inStream.method436();
- RSInterface.interfaceCache[k].anInt233 = 3;
- if (myPlayer.desc == null)
- RSInterface.interfaceCache[k].mediaID = (myPlayer.anIntArray1700[0] << 25)
- + (myPlayer.anIntArray1700[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.desc.id);
- pktType = -1;
- return true;
- /* Clan chat packet */
- case 217:
- try {
- name = inStream.readString();
- message = inStream.readString();
- clanname = inStream.readString();
- rights = inStream.readUnsignedWord();
- String crown = "";
- if (rights > 0 && rights < modIcons.length) {
- crown = "@cr" + rights + "@";
- }
- pushMessage(message, 16, crown + name);
- } catch (Exception e) {
- e.printStackTrace();
- }
- pktType = -1;
- return true;
- case 107:
- aBoolean1160 = false;
- for (int l = 0; l < 5; l++)
- aBooleanArray876[l] = false;
- pktType = -1;
- return true;
- case 72:
- int i1 = inStream.method434();
- RSInterface class9 = RSInterface.interfaceCache[i1];
- for (int k15 = 0; k15 < class9.inv.length; k15++) {
- class9.inv[k15] = -1;
- class9.inv[k15] = 0;
- }
- MikeysInterfaces.containerUpdated(i1);
- pktType = -1;
- return true;
- case 214:
- ignoreListAsLongs = new long[100];
- ignoreCount = 0;
- int amount = Integer.parseInt(inStream.readString());
- for (int i2 = 0; i2 < amount; i2++) {
- ignoreListAsLongs[i2] = Long.parseLong(inStream.readString());
- ignoreCount++;
- }
- pktType = -1;
- return true;
- case 166:/// XXX: ruse replaced this packet, for some reason..
- inStream.readUnsignedByte();
- int type = inStream.readUnsignedByte();
- int slot = inStream.readUnsignedByte();
- if (type == 1) {
- slotColor[slot] = inStream.readUnsignedByte();
- } else if (type == 2) {
- slotColorPercent[slot] = inStream.readUnsignedByte();
- } else if (type == 3) {
- int lololol = inStream.readUnsignedByte();
- if (lololol == 1) {
- slotAborted[slot] = true;
- } else {
- slotAborted[slot] = false;
- }
- } else if (type == 4) {
- int thing = inStream.readUnsignedByte();
- if (thing == 1) {
- buttonclicked = false;
- interfaceButtonAction = 0;
- } else if (thing == 2) {
- slotSelected = slot;
- } else if (thing == 3) {
- slots[slot] = "";
- Slots[slot] = 0;
- }
- } else if (type == 5) {
- int thing1 = inStream.readUnsignedByte();
- if (thing1 == 1) {
- slotUsing = slot;
- slots[slot] = "Sell";
- Slots[slot] = 1;
- } else if (thing1 == 2) {
- slotUsing = slot;
- slots[slot] = "Buy";
- Slots[slot] = 1;
- } else if (thing1 == 3) {
- Slots[slot] = 2;
- slots[slot] = "Sell";
- } else if (thing1 == 4) {
- Slots[slot] = 2;
- slots[slot] = "Buy";
- } else if (thing1 == 5) {
- Slots[slot] = 3;
- slots[slot] = "Sell";
- } else if (thing1 == 6) {
- Slots[slot] = 3;
- slots[slot] = "Buy";
- }
- } else if (type == 6) {
- inStream.readUnsignedByte();
- buttonclicked = true;
- amountOrNameInput = "";
- totalItemResults = 0;
- } else if (type == 7) {
- int anInt1308 = inStream.readUnsignedByte();
- // resetAnAnim(anInt1308);//XXX: disabed for now..
- } else {
- inStream.readUnsignedByte();
- }
- inStream.readUnsignedByte();
- inStream.readUnsignedByte();
- pktType = -1;
- return true;
- case 134:
- int k1 = inStream.readUnsignedByte();
- int i10 = inStream.method439();
- int l15 = inStream.readUnsignedWord();
- inStream.readUnsignedWord();
- currentExp[k1] = i10;
- currentStats[k1] = l15;
- maxStats[k1] = 1;
- for (int k20 = 0; k20 < 98; k20++)
- if (i10 >= experienceForLevels[k20])
- maxStats[k1] = k20 + 2;
- pktType = -1;
- return true;
- case 71:
- int l1 = inStream.readUnsignedWord();
- int j10 = inStream.method426();
- if (l1 == 65535)
- l1 = -1;
- tabInterfaceIDs[j10] = l1;
- tabAreaAltered = true;
- pktType = -1;
- return true;
- case 74:
- int i2 = inStream.method434();
- if (i2 == 65535)
- i2 = -1;
- if (i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
- nextSong = i2;
- songChanging = true;
- onDemandFetcher.method558(2, nextSong);
- }
- currentSong = i2;
- pktType = -1;
- return true;
- case 121:
- int j2 = inStream.method436();
- int k10 = inStream.method435();
- if (musicEnabled && !lowMem) {
- nextSong = j2;
- songChanging = false;
- onDemandFetcher.method558(2, nextSong);
- prevSong = k10;
- }
- pktType = -1;
- return true;
- case 109:
- resetLogout();
- pktType = -1;
- return false;
- case 70:
- int k2 = inStream.readSignedWord();
- int l10 = inStream.method437();
- int i16 = inStream.method434();
- RSInterface class9_5 = RSInterface.interfaceCache[i16];
- class9_5.anInt263 = k2;
- class9_5.anInt265 = l10;
- pktType = -1;
- return true;
- case 190:// XXX custom special bar packet
- int specialAmount = inStream.readUnsignedByte();
- int barId = inStream.readUnsignedWord();
- int specialBarString = inStream.readUnsignedWord();
- boolean activated = inStream.readUnsignedByte() == 1;
- RSInterface.interfaceCache[specialBarString].message = (activated ? "@whi@" : "@bla@")
- + "SPECIAL ATTACK (" + specialAmount + "%)";
- int specialCheck = 10;
- int specialCheckAmount = specialAmount / 10;
- for (int i23 = 0; i23 < 10; i23++) {
- RSInterface class9_78 = RSInterface.interfaceCache[--barId];
- class9_78.anInt263 = specialCheckAmount >= specialCheck ? 500 : 0;
- class9_78.anInt265 = 0;
- specialCheck--;
- }
- pktType = -1;
- return true;
- case 191:
- int[] bonuses = new int[18];
- for (int i23 = 0; i23 < bonuses.length; i23++) {
- bonuses[i23] = inStream.readUnsignedByte();
- }
- String[][] bonusStrings = { { "1675", "Stab" }, { "1676", "Slash" }, { "1677", "Crush" },
- { "1678", "Magic" }, { "1679", "Range" }, { "1680", "Stab" }, { "1681", "Slash" },
- { "1682", "Crush" }, { "1683", "Magic" }, { "1684", "Range" }, { "16522", "Summoning" },
- { "16523", "Absorb Melee" }, { "16524", "Absorb Magic" }, { "16525", "Absorb Ranged" },
- { "1686", "Strength" }, { "16526", "Ranged Strength" }, { "1687", "Prayer" },
- { "16527", "Magic Damage" } };
- for (int i23 = 0; i23 < bonuses.length; i23++) {
- RSInterface.interfaceCache[Integer.parseInt(bonusStrings[i23][0])].message = bonusStrings[i23][1]
- + ": " + (bonuses[i23] > 0 ? "+" : "") + bonuses[i23];
- }
- pktType = -1;
- return true;
- case 73:
- case 241:
- int l2 = anInt1069;
- int i11 = anInt1070;
- if (pktType == 73) {
- l2 = mapX = inStream.method435();
- i11 = mapY = inStream.readUnsignedWord();
- aBoolean1159 = false;
- }
- if (pktType == 241) {
- i11 = inStream.method435();
- inStream.initBitAccess();
- for (int j16 = 0; j16 < 4; j16++) {
- for (int l20 = 0; l20 < 13; l20++) {
- for (int j23 = 0; j23 < 13; j23++) {
- int i26 = inStream.readBits(1);
- if (i26 == 1)
- anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
- else
- anIntArrayArrayArray1129[j16][l20][j23] = -1;
- }
- }
- }
- inStream.finishBitAccess();
- l2 = inStream.readUnsignedWord();
- aBoolean1159 = true;
- }
- if (anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
- pktType = -1;
- return true;
- }
- anInt1069 = l2;
- anInt1070 = i11;
- baseX = (anInt1069 - 6) * 8;
- baseY = (anInt1070 - 6) * 8;
- aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
- if (anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
- aBoolean1141 = true;
- loadingStage = 1;
- aLong824 = System.currentTimeMillis();
- aRSImageProducer_1165.initDrawingArea();
- drawLoadingMessages(1, "Loading - please wait.", null);
- aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics,
- frameMode == ScreenMode.FIXED ? 4 : 0);
- if (pktType == 73) {
- int k16 = 0;
- for (int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
- for (int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
- k16++;
- }
- aByteArrayArray1183 = new byte[k16][];
- aByteArrayArray1247 = new byte[k16][];
- anIntArray1234 = new int[k16];
- anIntArray1235 = new int[k16];
- anIntArray1236 = new int[k16];
- k16 = 0;
- for (int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
- for (int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
- anIntArray1234[k16] = (l23 << 8) + j26;
- if (aBoolean1141
- && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
- anIntArray1235[k16] = -1;
- anIntArray1236[k16] = -1;
- k16++;
- } else {
- int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
- if (k28 != -1) {
- onDemandFetcher.method558(onDemandFetcher.isOsrsMap(j26, l23) ? 8 : 3, k28);
- }
- int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
- if (j30 != -1) {
- onDemandFetcher.method558(onDemandFetcher.isOsrsMap(j26, l23) ? 8 : 3, j30);
- }
- k16++;
- }
- }
- }
- }
- if (pktType == 241) {
- int l16 = 0;
- int ai[] = new int[676];
- for (int i24 = 0; i24 < 4; i24++) {
- for (int k26 = 0; k26 < 13; k26++) {
- for (int l28 = 0; l28 < 13; l28++) {
- int k30 = anIntArrayArrayArray1129[i24][k26][l28];
- if (k30 != -1) {
- int k31 = k30 >> 14 & 0x3ff;
- int i32 = k30 >> 3 & 0x7ff;
- int k32 = (k31 / 8 << 8) + i32 / 8;
- for (int j33 = 0; j33 < l16; j33++) {
- if (ai[j33] != k32)
- continue;
- k32 = -1;
- }
- if (k32 != -1)
- ai[l16++] = k32;
- }
- }
- }
- }
- aByteArrayArray1183 = new byte[l16][];
- aByteArrayArray1247 = new byte[l16][];
- anIntArray1234 = new int[l16];
- anIntArray1235 = new int[l16];
- anIntArray1236 = new int[l16];
- for (int l26 = 0; l26 < l16; l26++) {
- int i29 = anIntArray1234[l26] = ai[l26];
- int l30 = i29 >> 8 & 0xff;
- int l31 = i29 & 0xff;
- int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
- if (j32 != -1)
- onDemandFetcher.method558(3, j32);
- int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
- if (i33 != -1)
- onDemandFetcher.method558(3, i33);
- }
- }
- 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.smallX[j29] -= i17;
- npc.smallY[j29] -= j21;
- }
- npc.x -= i17 * 128;
- npc.y -= j21 * 128;
- }
- }
- for (int i27 = 0; i27 < maxPlayers; i27++) {
- Player player = playerArray[i27];
- if (player != null) {
- for (int i31 = 0; i31 < 10; i31++) {
- player.smallX[i31] -= i17;
- player.smallY[i31] -= j21;
- }
- player.x -= i17 * 128;
- player.y -= 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)
- groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
- else
- groundArray[k34][k33][l33] = null;
- }
- }
- for (Class30_Sub1 class30_sub1_1 = (Class30_Sub1) aClass19_1179
- .reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1) aClass19_1179
- .reverseGetNext()) {
- class30_sub1_1.x -= i17;
- class30_sub1_1.y -= j21;
- if (class30_sub1_1.x < 0 || class30_sub1_1.y < 0 || class30_sub1_1.x >= 104
- || class30_sub1_1.y >= 104)
- class30_sub1_1.unlink();
- }
- if (destX != 0) {
- destX -= i17;
- destY -= j21;
- }
- aBoolean1160 = false;
- pktType = -1;
- return true;
- case 208:
- int i3 = inStream.readUnsignedWord();
- if (i3 == 65535)
- i3 = -1;
- if (i3 == -1) {
- walkableInterfaceId = -1;
- pktType = -1;
- return true;
- }
- RSInterface inter = RSInterface.interfaceCache[i3];
- if (inter == null || inter.children == null) {
- System.err.println("method60 (packet 208) null interface: " + i3);
- } else {
- if (i3 >= 0) {
- openInterface(i3);
- }
- walkableInterfaceId = i3;
- }
- pktType = -1;
- return true;
- case 99:
- anInt1021 = inStream.readUnsignedByte();
- pktType = -1;
- return true;
- case 51:/// XXX: custom packet for coin pouch - Michael
- coinsInPouch = inStream.readQWord();
- lastCoinsInPouchChange = System.currentTimeMillis();
- pktType = -1;
- return true;
- case 175:
- /// XXX: ruse packet
- /* int soundId = */inStream.readWordBigEndian();
- /* int volume = */inStream.readSignedByte();
- /* int delay = */inStream.readShort();
- pktType = -1;
- return true;
- case 127:/// XXX: ruse packet
- myPrivilege = inStream.readUnsignedByte();
- pktType = -1;
- return true;
- case 29:/// XXX: ruse packet
- shadowDestination = inStream.readUnsignedByte();
- pktType = -1;
- return true;
- case 27:/// XXX: ruse packet
- /*
- * inputTitle = new String(inStream.readString()); showInput =
- * false; inputDialogState = 1; if(!getOption("save_input")) {
- * amountOrNameInput = ""; }
- */
- /*
- *
- *
- * amountOrNameInput = "";
- *
- * pktType = -1;
- */
- inputTitle = new String(inStream.readString());
- messagePromptRaised = false;
- inputDialogState = 1;
- amountOrNameInput = "";
- inputTaken = true;
- pktType = -1;
- return true;
- case 88:/// XXX: ruse packet
- int xface = inStream.readSignedWord();
- int yface = inStream.readSignedWord();
- int npcindex = inStream.ig2();
- if (npcindex < npcArray.length) {
- Npc npc = npcArray[npcindex];
- if (npc != null) {
- npc.anInt1538 = xface;
- npc.anInt1539 = yface;
- }
- }
- pktType = -1;
- return true;
- case 123:
- /// XXX: ruse packet
- /* sendConsoleMessage( */inStream.readString()/* , false) */;
- pktType = -1;
- return true;
- case 75:
- int j3 = inStream.method436();
- int j11 = inStream.method436();
- RSInterface inter2 = RSInterface.interfaceCache[j11];
- if (inter2 != null) {
- inter2.anInt233 = 2;
- inter2.mediaID = j3;
- } else {
- System.err.println("Null media container (packet 75): " + j11);
- }
- pktType = -1;
- return true;
- case 114:
- anInt1104 = inStream.method434() * 30;
- pktType = -1;
- return true;
- case 60:
- anInt1269 = inStream.readUnsignedByte();
- anInt1268 = inStream.method427();
- while (inStream.currentOffset < pktSize) {
- int k3 = inStream.readUnsignedByte();
- method137(inStream, k3);
- }
- pktType = -1;
- return true;
- case 35:
- int l3 = inStream.readUnsignedByte();
- int k11 = inStream.readUnsignedByte();
- int j17 = inStream.readUnsignedByte();
- int k21 = inStream.readUnsignedByte();
- aBooleanArray876[l3] = true;
- anIntArray873[l3] = k11;
- anIntArray1203[l3] = j17;
- anIntArray928[l3] = k21;
- anIntArray1030[l3] = 0;
- pktType = -1;
- return true;
- case 174:
- int i4 = inStream.readUnsignedWord();
- int l11 = inStream.readUnsignedByte();
- int k17 = inStream.readUnsignedWord();
- if (aBoolean848 && !lowMem && anInt1062 < 50) {
- anIntArray1207[anInt1062] = i4;
- anIntArray1241[anInt1062] = l11;
- anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
- anInt1062++;
- }
- pktType = -1;
- return true;
- case 104:
- int j4 = inStream.method427();
- int i12 = inStream.method426();
- String s6 = inStream.readString();
- if (j4 >= 1 && j4 <= 5) {
- if (s6.equalsIgnoreCase("null"))
- s6 = null;
- atPlayerActions[j4 - 1] = s6;
- atPlayerArray[j4 - 1] = i12 == 0;
- }
- pktType = -1;
- return true;
- case 78:
- destX = 0;
- pktType = -1;
- return true;
- case 253:
- String s = inStream.readString();
- if (s.endsWith(":tradereq:")) {
- String s3 = s.substring(0, s.indexOf(":"));
- long l17 = TextClass.longForName(s3);
- boolean flag2 = false;
- for (int j27 = 0; j27 < ignoreCount; j27++) {
- if (ignoreListAsLongs[j27] != l17)
- continue;
- flag2 = true;
- }
- if (!flag2 && anInt1251 == 0)
- pushMessage("wishes to trade with you.", 4, s3);
- } else if (s.endsWith(":clan:")) {
- String s4 = s.substring(0, s.indexOf(":"));
- TextClass.longForName(s4);
- pushMessage("Clan: ", 8, s4);
- } else if (s.endsWith("#url#")) {
- String link = s.substring(0, s.indexOf("#"));
- pushMessage("Join us at: ", 9, link);
- } else if (s.endsWith(":duelreq:")) {
- String s4 = s.substring(0, s.indexOf(":"));
- long l18 = TextClass.longForName(s4);
- boolean flag3 = false;
- for (int k27 = 0; k27 < ignoreCount; k27++) {
- if (ignoreListAsLongs[k27] != l18)
- continue;
- flag3 = true;
- }
- if (!flag3 && anInt1251 == 0)
- pushMessage("wishes to duel with you.", 8, s4);
- } else if (s.endsWith(":chalreq:")) {
- String s5 = s.substring(0, s.indexOf(":"));
- long l19 = TextClass.longForName(s5);
- boolean flag4 = false;
- for (int l27 = 0; l27 < ignoreCount; l27++) {
- if (ignoreListAsLongs[l27] != l19)
- continue;
- flag4 = true;
- }
- if (!flag4 && anInt1251 == 0) {
- String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
- pushMessage(s8, 8, s5);
- }
- } else if (s.equalsIgnoreCase("@autocastoff")) {
- setAutoCastOff();
- } else {
- boolean clan = s.startsWith("@clan:A@");
- if (clan) {
- s = s.substring(8, s.length());
- String rankstr = s.substring(s.indexOf("<img=") + 5);
- rankstr = rankstr.substring(0, rankstr.indexOf(">"));
- rankstr = rankstr.replace("=0", "0");
- Integer rank = Integer.valueOf(rankstr);
- s = s.replace("<img=" + (rank) + ">", " ");
- pushMessage(s, clan ? 16 : 0, "@cr" + rank + "@");
- pktType = -1;
- return true;
- }
- pushMessage(s, clan ? 16 : 0, "");
- }
- pktType = -1;
- return true;
- case 1:
- for (int k4 = 0; k4 < playerArray.length; k4++)
- if (playerArray[k4] != null)
- playerArray[k4].anim = -1;
- for (int j12 = 0; j12 < npcArray.length; j12++)
- if (npcArray[j12] != null)
- npcArray[j12].anim = -1;
- pktType = -1;
- return true;
- case 50:
- long l4 = inStream.readQWord();
- int i18 = inStream.readUnsignedByte();
- String s7 = TextClass.fixName(TextClass.nameForLong(l4));
- for (int k24 = 0; k24 < friendsCount; k24++) {
- if (l4 != friendsListAsLongs[k24])
- continue;
- if (friendsNodeIDs[k24] != i18) {
- friendsNodeIDs[k24] = i18;
- if (unknownInt10 != -1) {
- if (i18 >= 2) {
- pushMessage(s7 + " has logged in.", 5, "");
- }
- if (i18 <= 1) {
- pushMessage(s7 + " has logged out.", 5, "");
- }
- }
- }
- s7 = null;
- }
- if (s7 != null && friendsCount < 200) {
- friendsListAsLongs[friendsCount] = l4;
- friendsList[friendsCount] = s7;
- friendsNodeIDs[friendsCount] = i18;
- friendsCount++;
- }
- 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;
- flag6 = false;
- }
- }
- pktType = -1;
- return true;
- case 110:
- if (tabID == 12) {
- }
- energy = inStream.readUnsignedByte();
- pktType = -1;
- return true;
- case 254:
- anInt855 = inStream.readUnsignedByte();
- if (anInt855 == 1)
- anInt1222 = inStream.readUnsignedWord();
- 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 = inStream.readUnsignedWord();
- anInt935 = inStream.readUnsignedWord();
- anInt936 = inStream.readUnsignedByte();
- }
- if (anInt855 == 10)
- anInt933 = inStream.readUnsignedWord();
- pktType = -1;
- return true;
- case 248:
- int i5 = inStream.method435();
- int k12 = inStream.readUnsignedWord();
- if (backDialogID != -1) {
- backDialogID = -1;
- inputTaken = true;
- }
- if (inputDialogState != 0) {
- inputDialogState = 0;
- inputTaken = true;
- }
- openInterfaceID = i5;
- invOverlayInterfaceID = k12;
- tabAreaAltered = true;
- aBoolean1149 = false;
- pktType = -1;
- return true;
- case 79:
- int j5 = inStream.method434();
- int l12 = inStream.method435();
- RSInterface class9_3 = RSInterface.interfaceCache[j5];
- if (class9_3 != null && class9_3.type == 0) {
- if (l12 < 0)
- l12 = 0;
- if (l12 > class9_3.scrollMax - class9_3.height)
- l12 = class9_3.scrollMax - class9_3.height;
- class9_3.scrollPosition = l12;
- }
- pktType = -1;
- return true;
- case 68:
- for (int k5 = 0; k5 < variousSettings.length; k5++)
- if (variousSettings[k5] != anIntArray1045[k5]) {
- variousSettings[k5] = anIntArray1045[k5];
- method33(k5);
- }
- pktType = -1;
- return true;
- /*
- * private message
- */
- case 196:
- long l5 = inStream.readQWord();
- /* int j18 = */inStream.readDWord();
- int l21 = inStream.readUnsignedByte();
- int gamemode = inStream.readUnsignedByte();
- boolean flag5 = false;
- if (l21 <= 1) {
- for (int l29 = 0; l29 < ignoreCount; l29++) {
- if (ignoreListAsLongs[l29] != l5)
- continue;
- flag5 = true;
- }
- }
- if (!flag5 && anInt1251 == 0)
- try {
- anInt1169 = (anInt1169 + 1) % 100;
- String s9 = TextInput.method525(pktSize - 14, inStream);
- System.out.println(s9);
- // if(l21 != 3)
- // s9 = Censor.doCensor(s9);
- int rights = l21;
- if (rights >= 1)
- System.out.println("Private message with rights: " + rights);
- String crown = "";
- if (l21 > 0 && l21 < modIcons.length) {
- crown = "@cr" + l21 + "@";
- }
- if (crown.equals(""))
- pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
- else
- pushMessage(s9, 7, crown + TextClass.fixName(TextClass.nameForLong(l5)));
- } catch (Exception exception1) {
- Signlink.reporterror("cde1");
- }
- pktType = -1;
- return true;
- case 85:
- anInt1269 = inStream.method427();
- anInt1268 = inStream.method427();
- pktType = -1;
- return true;
- case 24:
- anInt1054 = inStream.method428();
- if (anInt1054 == tabID) {
- if (anInt1054 == 3)
- tabID = 1;
- else
- tabID = 3;
- }
- pktType = -1;
- return true;
- case 246:
- int i6 = inStream.method434();
- int i13 = inStream.readUnsignedWord();
- int k18 = inStream.readUnsignedWord();
- if (k18 == 65535) {
- RSInterface.interfaceCache[i6].anInt233 = 0;
- pktType = -1;
- return true;
- } else {
- ItemDefinition itemDef = ItemDefinition.forID(k18);
- RSInterface.interfaceCache[i6].anInt233 = 4;
- RSInterface.interfaceCache[i6].mediaID = k18;
- RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotationY;
- RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotationX;
- RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
- pktType = -1;
- return true;
- }
- case 171:
- int abyte01 = inStream.readUnsignedByte();
- boolean flag1 = abyte01 == 1;
- int j13 = inStream.readUnsignedWord();
- RSInterface.interfaceCache[j13].hidden = flag1;
- RSInterface.interfaceCache[j13].mouseOverTriggered = flag1;
- pktType = -1;
- return true;
- case 142:
- int j6 = inStream.method434();
- openInterface(j6);
- if (backDialogID != -1) {
- backDialogID = -1;
- inputTaken = true;
- }
- if (inputDialogState != 0) {
- inputDialogState = 0;
- inputTaken = true;
- }
- invOverlayInterfaceID = j6;
- tabAreaAltered = true;
- openInterfaceID = -1;
- aBoolean1149 = false;
- pktType = -1;
- return true;
- case 126:
- String text = inStream.readString();
- int frame = inStream.readShort();
- if (frame == 5385 && text.equals("scrollreset")) {
- RSInterface.interfaceCache[5385].scrollPosition = 0;
- pktType = -1;
- return true;
- }
- if (frame == 29450) {
- if (text.contains("Owner:")) {
- try {
- clanchatOwner = text.substring(7);
- if (clanchatOwner == "N/A") {
- clanchatOwner = null;
- }
- } catch (Exception e) {
- clanchatOwner = null;
- }
- }
- }
- if (text.startsWith("<font=")) {
- int font = Integer.parseInt(text.substring(6, 7));
- FontStyle fonts[] = { smallText, regularText, boldText, aTextDrawingArea_1273 };
- RSInterface.interfaceCache[frame].textDrawingAreas = fonts[font];
- text = text.substring(8);
- } else if (text.startsWith("[SUMMO")) {
- // hasFamiliar = Boolean.parseBoolean(text.substring(6));
- pktType = -1;
- return true;
- } else if (text.startsWith("[UPDATEEREPORT")) {
- // reportBox2Selected =
- // text.equalsIgnoreCase("[UPDATEEREPORT 2]");
- pktType = -1;
- return true;
- } else if (text.equals("[BUGREPORT]")) {
- clearTopInterfaces();
- reportAbuseInput = "";
- // reasonForReport = "";
- // playerReporting = "Bug";
- canMute = false;
- sendPacket185(9999);
- // reportBox2Selected = true;
- pktType = -1;
- return true;
- } else if (text.equals("[CLOSEMENU]") && frame == 0) {
- menuOpen = false;
- pktType = -1;
- return true;
- }
- // if (frame == 0 && text.equals("resting"))
- // resting = false;
- if (text.startsWith("http://") || text.startsWith("www.")) {
- launchURL(text);
- pktType = -1;
- return true;
- }
- if (text.startsWith("[REG]")) {
- text = text.substring(4);
- RSInterface.interfaceCache[frame
- + 20000].disabledSprite = RSInterface.interfaceCache[frame + 20000].savedSprite[0];
- updateStrings(text, frame);
- sendFrame126(text, frame);
- pktType = -1;
- return true;
- }
- if (text.startsWith("[OWN]")) {
- text = text.substring(4);
- RSInterface.interfaceCache[frame
- + 20000].disabledSprite = RSInterface.interfaceCache[frame + 20000].savedSprite[1];
- updateStrings(text, frame);
- sendFrame126(text, frame);
- pktType = -1;
- return true;
- }
- if (text.startsWith("[MOD]")) {
- text = text.substring(4);
- RSInterface.interfaceCache[frame
- + 20000].disabledSprite = RSInterface.interfaceCache[frame + 20000].savedSprite[2];
- updateStrings(text, frame);
- sendFrame126(text, frame);
- pktType = -1;
- return true;
- }
- if (text.startsWith("[REC]")) {
- text = text.substring(4);
- RSInterface.interfaceCache[frame
- + 20000].disabledSprite = RSInterface.interfaceCache[frame + 20000].savedSprite[3];
- updateStrings(text, frame);
- sendFrame126(text, frame);
- pktType = -1;
- return true;
- }
- if (text.startsWith("[COR]")) {
- text = text.substring(4);
- RSInterface.interfaceCache[frame
- + 20000].disabledSprite = RSInterface.interfaceCache[frame + 20000].savedSprite[4];
- updateStrings(text, frame);
- sendFrame126(text, frame);
- pktType = -1;
- return true;
- }
- if (text.startsWith("[SER]")) {
- text = text.substring(4);
- RSInterface.interfaceCache[frame
- + 20000].disabledSprite = RSInterface.interfaceCache[frame + 20000].savedSprite[5];
- updateStrings(text, frame);
- sendFrame126(text, frame);
- pktType = -1;
- return true;
- }
- if (text.startsWith("[LIE]")) {
- text = text.substring(4);
- RSInterface.interfaceCache[frame
- + 20000].disabledSprite = RSInterface.interfaceCache[frame + 20000].savedSprite[6];
- updateStrings(text, frame);
- sendFrame126(text, frame);
- pktType = -1;
- return true;
- }
- if (text.startsWith("[BER]")) {
- text = text.substring(4);
- RSInterface.interfaceCache[frame
- + 20000].disabledSprite = RSInterface.interfaceCache[frame + 20000].savedSprite[7];
- updateStrings(text, frame);
- sendFrame126(text, frame);
- pktType = -1;
- return true;
- }
- if (text.startsWith("[VR]")) {
- text = text.substring(3);
- RSInterface.interfaceCache[frame
- + 20000].disabledSprite = RSInterface.interfaceCache[frame + 20000].savedSprite[8];
- updateStrings(text, frame);
- sendFrame126(text, frame);
- pktType = -1;
- return true;
- }
- if (text.startsWith("[FRI]")) {
- text = text.substring(4);
- RSInterface.interfaceCache[frame
- + 20000].disabledSprite = RSInterface.interfaceCache[frame + 20000].savedSprite[9];
- updateStrings(text, frame);
- sendFrame126(text, frame);
- pktType = -1;
- return true;
- }
- if (frame == 47997) {
- Recruits = "";
- Recruits = text;
- pktType = -1;
- return true;
- }
- if (frame == 47996) {
- Corporals = "";
- Corporals = text;
- pktType = -1;
- return true;
- }
- if (frame == 47995) {
- Sergeants = "";
- Sergeants = text;
- pktType = -1;
- return true;
- }
- if (frame == 47994) {
- Lieutenants = "";
- Lieutenants = text;
- pktType = -1;
- return true;
- }
- if (frame == 47993) {
- Captains = "";
- Captains = text;
- pktType = -1;
- return true;
- }
- if (frame == 47992) {
- Generals = "";
- Generals = text;
- pktType = -1;
- return true;
- }
- if (text.startsWith("[UPDATE]")) {
- slot = 44001;
- for (int a = 0; a < friendsCount; a++) {
- if (isRecruit("" + friendsList[a] + ""))
- sendFrame126("Recruit", slot + 800);
- else if (isCorporal("" + friendsList[a] + ""))
- sendFrame126("Corporal", slot + 800);
- else if (isSergeant("" + friendsList[a] + ""))
- sendFrame126("Sergeant", slot + 800);
- else if (isLieutenant("" + friendsList[a] + ""))
- sendFrame126("Lieutenant", slot + 800);
- else if (isCaptain("" + friendsList[a] + ""))
- sendFrame126("Captain", slot + 800);
- else if (isGeneral("" + friendsList[a] + ""))
- sendFrame126("General", slot + 800);
- else
- sendFrame126("Not ranked", slot + 800);
- sendFrame126(friendsList[a], slot);
- slot++;
- }
- pktType = -1;
- return true;
- }
- if (text.startsWith("[FI]")) {
- // text = text.substring(4);
- // otherPlayerId = Integer.parseInt(text);
- pktType = -1;
- return true;
- }
- if (frame == 57025) {
- inputTaken = true;
- inputDialogState = 0;
- messagePromptRaised = true;
- promptInput = text;
- friendsListAction = 1;
- aString1121 = "Enter name of player to add to friends list";
- pktType = -1;
- return true;
- } else if (frame == 57028) {
- inputTaken = true;
- inputDialogState = 0;
- messagePromptRaised = true;
- promptInput = text;
- friendsListAction = 4;
- aString1121 = "Enter name of player to add to ignore list";
- }
- updateStrings(text, frame);
- sendFrame126(text, frame);
- if (frame >= 18144 && frame <= 18244) {
- clanList[frame - 18144] = text;
- }
- pktType = -1;
- return true;
- case 206:
- publicChatMode = inStream.readUnsignedByte();
- privateChatMode = inStream.readUnsignedByte();
- tradeMode = inStream.readUnsignedByte();
- inputTaken = true;
- pktType = -1;
- return true;
- case 240:
- if (tabID == 12) {
- }
- weight = inStream.readSignedWord();
- pktType = -1;
- return true;
- case 8:
- int k6 = inStream.method436();
- int l13 = inStream.readUnsignedWord();
- RSInterface.interfaceCache[k6].anInt233 = 1;
- RSInterface.interfaceCache[k6].mediaID = l13;
- pktType = -1;
- return true;
- case 122:
- int l6 = inStream.method436();
- int i14 = inStream.method436();
- int i19 = i14 >> 10 & 0x1f;
- int i22 = i14 >> 5 & 0x1f;
- int l24 = i14 & 0x1f;
- RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
- pktType = -1;
- return true;
- case 53:
- int i7 = inStream.readUnsignedWord();
- RSInterface class9_1 = RSInterface.interfaceCache[i7];
- int j19 = inStream.readUnsignedWord();
- if (class9_1 == null || class9_1.inv == null) {
- Signlink.reporterror(
- "Null item container - id - " + i7 + " last two packets - " + anInt842 + "," + anInt843);
- for (int j22 = 0; j22 < j19; j22++) {
- int i25 = inStream.readUnsignedByte();
- if (i25 == 255)
- i25 = inStream.method440();
- inStream.method436();
- }
- pktType = -1;
- return true;
- }
- if (class9_1.inv.length < j19 || class9_1.invStackSizes.length < j19) {
- System.err.println("Item container out of bounds: " + i7 + " max length:"
- + class9_1.invStackSizes.length + ", sent length: " + j19);
- for (int j22 = 0; j22 < j19; j22++) {
- int i25 = inStream.readUnsignedByte();
- if (i25 == 255)
- i25 = inStream.method440();
- inStream.method436();
- }
- pktType = -1;
- return true;
- }
- if (class9_1.inv.length != class9_1.invStackSizes.length) {
- System.err.println("Mismatched inventory and stack size for interface: " + i7);
- for (int j22 = 0; j22 < j19; j22++) {
- int i25 = inStream.readUnsignedByte();
- if (i25 == 255)
- i25 = inStream.method440();
- inStream.method436();
- }
- pktType = -1;
- return true;
- }
- int item = -1;
- for (int j22 = 0; j22 < j19; j22++) {
- int i25 = inStream.readUnsignedByte();
- if (i25 == 255)
- i25 = inStream.method440();
- item = inStream.method436();
- class9_1.inv[j22] = item;
- class9_1.invStackSizes[j22] = i25;
- }
- for (int j25 = j19; j25 < class9_1.inv.length && j25 < class9_1.invStackSizes.length; j25++) {
- class9_1.inv[j25] = 0;
- class9_1.invStackSizes[j25] = 0;
- }
- if (i7 == 24680) {
- currentGEItem = item;
- }
- MikeysInterfaces.containerUpdated(i7);
- pktType = -1;
- return true;
- case 230:
- int j7 = inStream.method435();
- int j14 = inStream.readUnsignedWord();
- int k19 = inStream.readUnsignedWord();
- int k22 = inStream.method436();
- RSInterface.interfaceCache[j14].modelRotation1 = k19;
- RSInterface.interfaceCache[j14].modelRotation2 = k22;
- RSInterface.interfaceCache[j14].modelZoom = j7;
- pktType = -1;
- return true;
- case 221:
- anInt900 = inStream.readUnsignedByte();
- pktType = -1;
- return true;
- case 177:
- aBoolean1160 = true;
- anInt995 = inStream.readUnsignedByte();
- anInt996 = inStream.readUnsignedByte();
- anInt997 = inStream.readUnsignedWord();
- anInt998 = inStream.readUnsignedByte();
- anInt999 = inStream.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;
- }
- pktType = -1;
- return true;
- case 249:
- anInt1046 = inStream.method426();
- unknownInt10 = inStream.method436();
- pktType = -1;
- return true;
- case 65:
- updateNPCs(inStream, pktSize);
- pktType = -1;
- return true;
- case 187:
- inputTitle = new String(inStream.readString());
- messagePromptRaised = false;
- inputDialogState = 2;
- amountOrNameInput = "";
- inputTaken = true;
- pktType = -1;
- return true;
- case 97:
- int l7 = inStream.readUnsignedWord();
- openInterface(l7);
- if (invOverlayInterfaceID != -1) {
- invOverlayInterfaceID = -1;
- tabAreaAltered = true;
- }
- if (backDialogID != -1) {
- backDialogID = -1;
- inputTaken = true;
- }
- if (inputDialogState != 0) {
- inputDialogState = 0;
- inputTaken = true;
- }
- openInterfaceID = l7;
- aBoolean1149 = false;
- pktType = -1;
- return true;
- case 218:
- int i8 = inStream.method438();
- dialogID = i8;
- inputTaken = true;
- pktType = -1;
- return true;
- case 87:
- int j8 = inStream.method434();
- int l14 = inStream.method439();
- anIntArray1045[j8] = l14;
- if (variousSettings[j8] != l14) {
- variousSettings[j8] = l14;
- method33(j8);
- if (dialogID != -1)
- inputTaken = true;
- }
- MikeysInterfaces.configPacket(j8, l14);
- pktType = -1;
- return true;
- case 36:
- int k8 = inStream.ig2();
- byte byte0 = inStream.readSignedByte();
- anIntArray1045[k8] = byte0;
- if (variousSettings[k8] != byte0) {
- variousSettings[k8] = byte0;
- method33(k8);
- if (dialogID != -1)
- inputTaken = true;
- }
- MikeysInterfaces.configPacket(k8, byte0);
- pktType = -1;
- return true;
- case 37:/// XXX: new packet for key binds
- for (int j12 = 0; j12 < 14; j12++) {
- int bind = inStream.readUnsignedByte();
- keybinds[j12] = bind;
- int index = 64_437 + (j12 * 3);
- RSInterface.interfaceCache[index].message = bind == 0 ? "Click to set"
- : bind == 64 ? "Escape" : "F" + bind;
- }
- pktType = -1;
- return true;
- case 38:/// XXX: ruse packet
- /*
- * int auto = inStream.readUnsignedWord(); if (auto == -1) {
- * autoCast = false; autocastId = 0; } else { autoCast = true;
- * autocastId = auto; }
- */
- pktType = -1;
- return true;
- case 108:
- /// XXX: ruse packet
- /* specActivated = */inStream.readUnsignedByte()/* == 1 */;
- pktType = -1;
- return true;
- case 103:
- /// XXX: ruse packet
- /* doingDung = */inStream.readUnsignedByte()/* == 1 */;
- pktType = -1;
- return true;
- case 111:
- /// XXX: ruse packet
- /* currentSpec = */inStream.readUnsignedByte();
- pktType = -1;
- return true;
- case 112:
- /// XXX: ruse packet
- /* ironman = */inStream.readUnsignedByte();
- pktType = -1;
- return true;
- case 115:/// XXX: ruse packet
- showClanOptions = inStream.readUnsignedByte();
- updateClanChatTab();
- pktType = -1;
- return true;
- case 45:
- /// XXX: ruse packet
- /* long totalxp = */inStream.readQWord();
- // int totalXP = totalxp;
- // blockXPGain = false;
- pktType = -1;
- return true;
- case 124:/// XXX: ruse packet
- int skillID = inStream.readUnsignedByte();
- int gainedXP = inStream.readDWord();
- ExperienceCounter.skillUpdated(skillID, gainedXP);
- pktType = -1;
- return true;
- case 113:
- /// XXX: ruse packet
- /* running = */inStream.readUnsignedByte()/* > 0 */;
- // variousSettings[173] = running ? 1 : 0;
- pktType = -1;
- return true;
- case 244:/// XXX: ruse packet
- String data = inStream.readString();
- int geSlot = Integer.parseInt(data.substring(data.indexOf("<") + 1, data.indexOf(">")));
- int geData = -1;
- if (data.contains("slotaborted")) {
- slotAborted[geSlot] = true;
- }
- if (data.contains("slotselected")) {
- slotSelected = geSlot;
- }
- if (data.contains("resetslot")) {
- slots[geSlot] = "";
- Slots[geSlot] = 0;
- slotColorPercent[geSlot] = 0;
- slotAborted[geSlot] = false;
- }
- if (data.contains("slotsell")) {
- geData = Integer.parseInt(data.substring(data.indexOf("[") + 1, data.indexOf("]")));
- slots[geSlot] = "Sell";
- Slots[geSlot] = geData;
- slotAborted[geSlot] = false;
- slotColorPercent[geSlot] = 0;
- }
- if (data.contains("item")) {
- int itemId = Integer.parseInt(data.substring(data.indexOf("#") + 1, data.lastIndexOf("#")));
- slotItems[geSlot] = itemId;
- }
- if (data.contains("slotbuy")) {
- geData = Integer.parseInt(data.substring(data.indexOf("[") + 1, data.indexOf("]")));
- slots[geSlot] = "Buy";
- Slots[geSlot] = geData;
- slotAborted[geSlot] = false;
- slotColorPercent[geSlot] = 0;
- }
- if (data.contains("slotpercent")) {
- geData = Integer.parseInt(data.substring(data.indexOf("{") + 1, data.indexOf("}")));
- slotColorPercent[geSlot] = geData;
- }
- pktType = -1;
- return true;
- case 61:
- anInt1055 = inStream.readUnsignedByte();
- pktType = -1;
- return true;
- case 200:
- int l8 = inStream.readUnsignedWord();
- int i15 = inStream.readSignedWord();
- RSInterface class9_4 = RSInterface.interfaceCache[l8];
- class9_4.anInt257 = i15;
- class9_4.modelZoom = 2000;/// XXX: hardcoded ruse fix for big
- /// dialogue heads
- pktType = -1;
- return true;
- case 219:
- if (invOverlayInterfaceID != -1) {
- invOverlayInterfaceID = -1;
- tabAreaAltered = true;
- }
- if (backDialogID != -1) {
- backDialogID = -1;
- inputTaken = true;
- }
- if (inputDialogState != 0) {
- inputDialogState = 0;
- inputTaken = true;
- }
- openInterfaceID = -1;
- aBoolean1149 = false;
- pktType = -1;
- return true;
- case 34:
- int i9 = inStream.readUnsignedWord();
- RSInterface class9_2 = RSInterface.interfaceCache[i9];
- while (inStream.currentOffset < pktSize) {
- int j20 = inStream.method422();
- int i23 = inStream.readUnsignedWord();
- int l25 = inStream.readUnsignedByte();
- if (l25 == 255)
- l25 = inStream.readDWord();
- if (j20 >= 0 && j20 < class9_2.inv.length) {
- class9_2.inv[j20] = i23;
- class9_2.invStackSizes[j20] = l25;
- }
- }
- MikeysInterfaces.containerUpdated(i9);
- pktType = -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:
- method137(inStream, pktType);
- pktType = -1;
- return true;
- case 106:
- tabID = inStream.method427();
- tabAreaAltered = true;
- pktType = -1;
- return true;
- case 164:
- int j9 = inStream.method434();
- openInterface(j9);
- if (invOverlayInterfaceID != -1) {
- invOverlayInterfaceID = -1;
- tabAreaAltered = true;
- }
- backDialogID = j9;
- inputTaken = true;
- openInterfaceID = -1;
- aBoolean1149 = false;
- pktType = -1;
- return true;
- }
- Signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
- // resetLogout();
- } catch (IOException _ex) {
- dropClient();
- } catch (Exception exception) {
- String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + ","
- + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
- for (int j15 = 0; j15 < pktSize && j15 < 50; j15++)
- s2 = s2 + inStream.buffer[j15] + ",";
- Signlink.reporterror(s2);
- exception.printStackTrace();
- resetLogout();
- }
- pktType = -1;
- return true;
- }
- private void method146() {
- anInt1265++;
- method47(true);
- method26(true);
- method47(false);
- method26(false);
- method55();
- method104();
- if (!aBoolean1160) {
- int i = anInt1184;
- if (anInt984 / 256 > i)
- i = anInt984 / 256;
- if (aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
- i = anIntArray1203[4] + 128;
- int k = minimapInt1 + anInt896 & 0x7ff;
- setCameraPos(
- cameraZoom + i * ((WorldController.viewDistance == 9) && (frameMode == ScreenMode.RESIZABLE) ? 2
- : WorldController.viewDistance == 10 ? 5 : 3),
- i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
- }
- int j;
- if (!aBoolean1160)
- 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 (aBooleanArray876[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;
- }
- }
- int k2 = Texture.anInt1481;
- Model.aBoolean1684 = true;
- Model.anInt1687 = 0;
- Model.anInt1685 = super.mouseX - (frameMode == ScreenMode.FIXED ? 4 : 0);
- Model.anInt1686 = super.mouseY - (frameMode == ScreenMode.FIXED ? 4 : 0);
- DrawingArea.setAllPixelsToZero();
- worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
- worldController.clearObj5Cache();
- if (ClientSettings.getBoolean("fog")) {
- double fogDistance = Math.sqrt(Math.pow(zCameraPos, 2));
- int distance = 1325;
- if (!fixed())
- distance = 800;
- if (WorldController.viewDistance == 10)
- distance = 1000;
- int fogStartDistance = distance;
- int fogEndDistance = distance + 750;
- fog.setFogDistance((float) fogDistance);
- fog.renderFog(fogStartDistance, fogEndDistance, 3);
- }
- updateEntities();
- drawHeadIcon();
- method37(k2);
- draw3dScreen();
- if (frameMode != ScreenMode.FIXED) {
- gameframe.drawChatArea();
- gameframe.drawMinimap();
- gameframe.drawTabArea();
- // gameframe.drawCoinsInPouch();
- }
- aRSImageProducer_1165.drawGraphics(frameMode == ScreenMode.FIXED ? 4 : 0, super.graphics,
- frameMode == ScreenMode.FIXED ? 4 : 0);
- xCameraPos = l;
- zCameraPos = i1;
- yCameraPos = j1;
- yCameraCurve = k1;
- xCameraCurve = l1;
- }
- public void clearTopInterfaces() {
- stream.createFrame(130);
- if (invOverlayInterfaceID != -1) {
- invOverlayInterfaceID = -1;
- aBoolean1149 = false;
- tabAreaAltered = true;
- }
- if (backDialogID != -1) {
- backDialogID = -1;
- inputTaken = true;
- aBoolean1149 = false;
- }
- openInterfaceID = -1;
- fullscreenInterfaceID = -1;
- }
- public Client() {
- fullscreenInterfaceID = -1;
- chatRights = new int[500];
- chatTitle = new String[500];
- chatPosition = new int[500];
- chatTypeView = 0;
- clanChatMode = 0;
- anIntArrayArray825 = new int[104][104];
- friendsNodeIDs = new int[200];
- groundArray = new NodeList[4][104][104];
- aBoolean831 = false;
- aStream_834 = new RSBuffer(new byte[5000]);
- npcArray = new Npc[16384];
- npcIndices = new int[16384];
- anIntArray840 = new int[1000];
- aStream_847 = RSBuffer.create();
- aBoolean848 = true;
- openInterfaceID = -1;
- currentExp = new int[Skills.skillsCount];
- aBoolean872 = false;
- anIntArray873 = new int[5];
- aBooleanArray876 = new boolean[5];
- drawFlames = false;
- reportAbuseInput = "";
- unknownInt10 = -1;
- menuOpen = false;
- inputString = "";
- uuid = "";
- maxPlayers = 2048;
- myPlayerIndex = 2047;
- playerArray = new Player[maxPlayers];
- playerIndices = new int[maxPlayers];
- anIntArray894 = new int[maxPlayers];
- aStreamArray895s = new RSBuffer[maxPlayers];
- anInt897 = 1;
- anIntArrayArray901 = new int[104][104];
- aByteArray912 = new byte[16384];
- currentStats = new int[Skills.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];
- sideIcons = new Sprite[15];
- aBoolean954 = true;
- friendsListAsLongs = new long[200];
- currentSong = -1;
- drawingFlames = false;
- spriteDrawX = -1;
- spriteDrawY = -1;
- anIntArray968 = new int[33];
- anIntArray969 = new int[256];
- decompressors = new Decompressor[10];
- variousSettings = new int[3000];
- 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;
- hitMarks = new Sprite[5];
- anIntArray990 = new int[5];
- aBoolean994 = false;
- amountOrNameInput = "";
- aClass19_1013 = new NodeList();
- aBoolean1017 = false;
- walkableInterfaceId = -1;
- anIntArray1030 = new int[5];
- aBoolean1031 = false;
- mapFunctions = new Sprite[100];
- dialogID = -1;
- maxStats = new int[Skills.skillsCount];
- anIntArray1045 = new int[3000];
- aBoolean1047 = true;
- anIntArray1052 = new int[256];
- anIntArray1229 = new int[256];
- anInt1054 = -1;
- aClass19_1056 = new NodeList();
- anIntArray1057 = new int[33];
- aClass9_1059 = new RSInterface();
- mapScenes = new Background[100];
- barFillColor = 0x4d4233;
- anIntArray1065 = new int[7];
- anIntArray1072 = new int[1000];
- anIntArray1073 = new int[1000];
- aBoolean1080 = false;
- friendsList = new String[200];
- inStream = RSBuffer.create();
- expectedCRCs = new int[9];
- menuActionCmd2 = new int[500];
- menuActionCmd3 = new int[500];
- menuActionCmd4 = new int[500];
- menuActionID = new int[500];
- menuActionCmd1 = new int[500];
- headIcons = new Sprite[20];
- skullIcons = new Sprite[20];
- headIconsHint = new Sprite[20];
- tabAreaAltered = false;
- aString1121 = "";
- atPlayerActions = new String[5];
- atPlayerArray = new boolean[5];
- anIntArrayArrayArray1129 = new int[4][13][13];
- anInt1132 = 2;
- aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
- aBoolean1141 = false;
- aBoolean1149 = false;
- crosses = new Sprite[8];
- musicEnabled = true;
- loggedIn = false;
- canMute = false;
- aBoolean1159 = false;
- aBoolean1160 = false;
- anInt1171 = 1;
- // myUsername = "";
- myPassword = "";
- myAuth = "";
- genericLoadingError = false;
- reportAbuseInterfaceID = -1;
- aClass19_1179 = new NodeList();
- anInt1184 = 128;
- invOverlayInterfaceID = -1;
- stream = RSBuffer.create();
- menuActionName = new String[500];
- anIntArray1203 = new int[5];
- anIntArray1207 = new int[50];
- anInt1210 = 2;
- anInt1211 = 78;
- promptInput = "";
- modIcons = new Sprite[19];
- tabID = 3;
- inputTaken = false;
- songChanging = true;
- aClass11Array1230 = new Class11[4];
- anIntArray1241 = new int[50];
- aBoolean1242 = false;
- anIntArray1250 = new int[50];
- rsAlreadyLoaded = false;
- welcomeScreenRaised = false;
- messagePromptRaised = false;
- loginMessage1 = "";
- loginMessage2 = "";
- backDialogID = -1;
- anInt1279 = 2;
- bigX = new int[4000];
- bigY = new int[4000];
- /*
- * Add local world if not running from a jar.
- */
- currentWorld = 1;
- if (!getClass().getResource("/" + getClass().getName().replace('.', '/') + ".class").toString()
- .startsWith("jar:")) {
- Configuration.WORLDS.add(new World("Local Server", "127.0.0.1"));
- //currentWorld = Configuration.WORLDS.size();
- }
- }
- public World getCurrentWorld() {
- return Configuration.WORLDS.get(currentWorld - 1);
- }
- public int rights;
- public String name;
- public String message;
- public String clanname;
- private final int[] chatRights;
- public final String[] chatTitle;
- public final int[] chatPosition;
- public int chatTypeView;
- public int clanChatMode;
- // public static Sprite[] extSprites;
- public static Sprite[] loginSprites;
- public static Sprite[] cacheSprites;
- public static Sprite[] cacheSprites2;
- public static Sprite[] cacheSprites3;
- private ImageProducer leftFrame;
- private ImageProducer topFrame;
- private int ignoreCount;
- private long aLong824;
- private int[][] anIntArrayArray825;
- public int[] friendsNodeIDs;
- public NodeList[][][] groundArray;
- private int[] anIntArray828;
- private int[] anIntArray829;
- private volatile boolean aBoolean831;
- private Socket aSocket832;
- private int loginScreenState;
- private RSBuffer aStream_834;
- public Npc[] npcArray;
- public int npcCount;
- public int[] npcIndices;
- private int anInt839;
- private int[] anIntArray840;
- private int anInt841;
- private int anInt842;
- private int anInt843;
- public String aString844;
- public String prayerBook;
- public int privateChatMode;
- public int gameChatMode;
- private RSBuffer aStream_847;
- private boolean aBoolean848;
- private static int anInt849;
- private int[] anIntArray850;
- private int[] anIntArray851;
- private int[] anIntArray852;
- private int[] anIntArray853;
- private static int anInt854;
- public int anInt855;
- public int openInterfaceID;
- private int xCameraPos;
- private int zCameraPos;
- private int yCameraPos;
- private int yCameraCurve;
- private int xCameraCurve;
- public int myPrivilege;
- public final int[] currentExp;
- public Sprite mapFlag;
- public Sprite mapMarker;
- private boolean aBoolean872;
- private final int[] anIntArray873;
- private final boolean[] aBooleanArray876;
- private int weight;
- private MouseDetection mouseDetection;
- private volatile boolean drawFlames;
- String reportAbuseInput;
- private int unknownInt10;
- public boolean menuOpen;
- private int anInt886;
- public static String inputString;
- private final int maxPlayers;
- public final int myPlayerIndex;
- public Player[] playerArray;
- public int playerCount;
- public int[] playerIndices;
- private int anInt893;
- private int[] anIntArray894;
- private RSBuffer[] aStreamArray895s;
- private int anInt896;
- public int anInt897;
- public int friendsCount;
- private int anInt900;
- private int[][] anIntArrayArray901;
- private byte[] aByteArray912;
- private int anInt913;
- private int crossX;
- private int crossY;
- private int crossIndex;
- private int crossType;
- public int plane;
- public final int[] currentStats;
- private static int anInt924;
- private long[] ignoreListAsLongs;
- private boolean loadingError;
- private final int[] anIntArray928;
- private int[][] anIntArrayArray929;
- private Sprite aClass30_Sub2_Sub1_Sub1_931;
- private Sprite aClass30_Sub2_Sub1_Sub1_932;
- public int anInt933;
- public int anInt934;
- public int anInt935;
- private int anInt936;
- private int anInt937;
- private int anInt938;
- public final int[] chatTypes;
- public final String[] chatNames;
- public final String[] chatMessages;
- private int anInt945;
- private WorldController worldController;
- private Sprite[] sideIcons;
- private int menuScreenArea;
- private int menuOffsetX;
- private int menuOffsetY;
- private int menuWidth;
- private int menuHeight;
- private long aLong953;
- private boolean aBoolean954;
- public long[] friendsListAsLongs;
- public static String uuid;
- private String[] clanList = new String[100];
- private int currentSong;
- private static int nodeID = 10;
- public static int portOff;
- static boolean clientData;
- private static boolean isMembers = true;
- private static boolean lowMem;
- private volatile boolean drawingFlames;
- private int spriteDrawX;
- private int spriteDrawY;
- private final int[] anIntArray965 = { 0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff };
- private Background aBackground_966;
- private Background aBackground_967;
- public final int[] anIntArray968;
- private final int[] anIntArray969;
- public final Decompressor[] decompressors;
- 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;
- private Sprite[] hitMarks;
- public int anInt988;
- 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 IsaacRandomGenerator encryption;
- private Sprite multiOverlay;
- public static final int[][] anIntArrayArray1003 = {
- { 6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433, 2983, 54193 },
- { 8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153, 56621, 4783, 1341, 16578, 35003, 25239 },
- { 25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153, 56621, 4783, 1341, 16578, 35003 },
- { 4626, 11146, 6439, 12, 4758, 10270 }, { 4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574 } };
- public String amountOrNameInput;
- private static int anInt1005;
- private int daysSinceLastLogin;
- private int pktSize;
- private int pktType;
- private int anInt1009;
- private int anInt1010;
- private int anInt1011;
- private NodeList aClass19_1013;
- private int anInt1014;
- private int anInt1015;
- private int anInt1016;
- private boolean aBoolean1017;
- public int walkableInterfaceId;
- public static final int[] experienceForLevels;
- public int anInt1021;
- private int anInt1022;
- public int loadingStage;
- private Sprite scrollBar1;
- private Sprite scrollBar2;
- private int anInt1026;
- private final int[] anIntArray1030;
- private boolean aBoolean1031;
- private Sprite[] mapFunctions;
- public int baseX;
- public int baseY;
- private int anInt1036;
- private int anInt1037;
- private int loginFailures;
- private int anInt1039;
- private int anInt1040;
- private int anInt1041;
- public int dialogID;
- public final int[] maxStats;
- private final int[] anIntArray1045;
- private int anInt1046;
- private boolean aBoolean1047;
- private int anInt1048;
- // private String aString1049;
- private static int anInt1051;
- public final int[] anIntArray1052;
- private StreamLoader titleStreamLoader;
- public int anInt1054;
- private int anInt1055;
- private NodeList aClass19_1056;
- public final int[] anIntArray1057;
- public final RSInterface aClass9_1059;
- private Background[] mapScenes;
- private int anInt1062;
- private final int barFillColor;
- private int friendsListAction;
- private final int[] anIntArray1065;
- private int mouseInvInterfaceIndex;
- private int lastActiveInvInterface;
- public OnDemandFetcher onDemandFetcher;
- private int anInt1069;
- private int anInt1070;
- public int anInt1071;
- public int[] anIntArray1072;
- public int[] anIntArray1073;
- public Sprite mapDotItem;
- public Sprite mapDotNPC;
- public Sprite mapDotPlayer;
- public Sprite mapDotFriend;
- public Sprite mapDotTeam;
- Sprite mapDotClan;
- // private int anInt1079;
- private boolean aBoolean1080;
- private String[] friendsList;
- RSBuffer inStream;
- private int anInt1084;
- private int anInt1085;
- private int activeInterfaceType;
- private int anInt1087;
- private int anInt1088;
- public int anInt1089;
- public static int spellID = 0;
- public static int totalRead = 0;
- private final int[] expectedCRCs;
- public int[] menuActionCmd2;
- public int[] menuActionCmd3;
- public int[] menuActionCmd4;
- public int[] menuActionID;
- int[] menuActionCmd1;
- private Sprite[] headIcons;
- private Sprite[] skullIcons;
- private Sprite[] headIconsHint;
- private static int anInt1097;
- private int anInt1098;
- private int anInt1099;
- private int anInt1100;
- private int anInt1101;
- private int anInt1102;
- static boolean tabAreaAltered;
- private int anInt1104;
- private ImageProducer aRSImageProducer_1107;
- private ImageProducer aRSImageProducer_1108;
- private ImageProducer aRSImageProducer_1109;
- private ImageProducer aRSImageProducer_1110;
- private ImageProducer aRSImageProducer_1111;
- private ImageProducer aRSImageProducer_1112;
- private ImageProducer aRSImageProducer_1113;
- private ImageProducer aRSImageProducer_1114;
- private ImageProducer aRSImageProducer_1115;
- private static int anInt1117;
- private int membersInt;
- public String aString1121;
- public String inputTitle;
- public Sprite compass;
- private ImageProducer aRSImageProducer_1125;
- public static Player myPlayer;
- private final String[] atPlayerActions;
- private final boolean[] atPlayerArray;
- private final int[][][] anIntArrayArrayArray1129;
- public final int[] tabInterfaceIDs = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
- private int anInt1131;
- public int anInt1132;
- public int menuActionRow;
- private static int anInt1134;
- private int spellSelected;
- private int anInt1137;
- private int spellUsableOn;
- private String spellTooltip;
- public Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
- private boolean aBoolean1141;
- private static int anInt1142;
- public int energy;
- private boolean aBoolean1149;
- private Sprite[] crosses;
- private boolean musicEnabled;
- private Background[] aBackgroundArray1152s;
- private int unreadMessages;
- private static int anInt1155;
- private static boolean fpsOn;
- public static boolean loggedIn;
- boolean canMute;
- private boolean aBoolean1159;
- private boolean aBoolean1160;
- public static int loopCycle;
- private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
- public ImageProducer aRSImageProducer_1163;
- public ImageProducer aRSImageProducer_1164;
- public ImageProducer aRSImageProducer_1165;
- public ImageProducer aRSImageProducer_1166;
- private int daysSinceRecovChange;
- private RSSocket socketStream;
- private int anInt1169;
- public int minimapInt3;
- public int anInt1171;
- public String myUsername = "";
- private String myPassword;
- private String myAuth;
- private boolean rememberPin = false;
- private static int anInt1175;
- private boolean genericLoadingError;
- private final int[] anIntArray1177 = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3 };
- int reportAbuseInterfaceID;
- private NodeList aClass19_1179;
- public int[] anIntArray1180;
- public int[] anIntArray1181;
- public int[] anIntArray1182;
- private byte[][] aByteArrayArray1183;
- private int anInt1184;
- public int minimapInt1;
- private int anInt1186;
- private int anInt1187;
- private static int anInt1188;
- public int invOverlayInterfaceID;
- private int[] anIntArray1190;
- private int[] anIntArray1191;
- public RSBuffer stream;
- private int anInt1193;
- public int splitPrivateChat;
- public Background mapBack;
- private Background mapBack2;
- public String[] menuActionName;
- private Sprite aClass30_Sub2_Sub1_Sub1_1201;
- private Sprite aClass30_Sub2_Sub1_Sub1_1202;
- private final int[] anIntArray1203;
- public static final int[] anIntArray1204 = { 9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145, 58654,
- 5027, 1457, 16565, 34991, 25486 };
- private static boolean flagged;
- private final int[] anIntArray1207;
- public int minimapInt2;
- public int anInt1210;
- public int anInt1211;
- public String promptInput;
- private int anInt1213;
- private int[][][] intGroundArray;
- private long aLong1215;
- private int loginScreenCursorPos;
- private boolean canEnterAuth;
- public final Sprite[] modIcons;
- private long aLong1220;
- public int tabID;
- public int anInt1222;
- public static boolean inputTaken;
- public int inputDialogState;
- private static int anInt1226;
- private int nextSong;
- private boolean songChanging;
- public final int[] anIntArray1229;
- private Class11[] aClass11Array1230;
- public static int anIntArray1232[];
- private int[] anIntArray1234;
- private int[] anIntArray1235;
- private int[] anIntArray1236;
- private int anInt1237;
- private int anInt1238;
- public final int anInt1239 = 100;
- private final int[] anIntArray1241;
- private boolean aBoolean1242;
- private int atInventoryLoopCycle;
- private int atInventoryInterface;
- private int atInventoryIndex;
- private int atInventoryInterfaceType;
- private byte[][] aByteArrayArray1247;
- public int tradeMode;
- private int anInt1249;
- private final int[] anIntArray1250;
- private int anInt1251;
- private final boolean rsAlreadyLoaded;
- private int anInt1253;
- public int anInt1254;
- private boolean welcomeScreenRaised;
- public boolean messagePromptRaised;
- private byte[][][] byteGroundArray;
- private int prevSong;
- public int destX;
- public int destY;
- public Sprite minimapImage;
- private int anInt1264;
- private int anInt1265;
- private String loginMessage1;
- private String loginMessage2;
- private int anInt1268;
- private int anInt1269;
- public static FontStyle aTextDrawingArea_1273;
- public static FontStyle smallText;
- public static FontStyle regularText;
- public static FontStyle boldText;
- public static FontStyle aTextDrawingArea_1273_2;
- public static FontStyle smallText_2;
- public static FontStyle regularText_2;
- public static FontStyle boldText_2;
- public static RSFont newSmallFont, newRegularFont, newBoldFont, newFancyFont;
- public static RSFont newSmallFont_2, newRegularFont_2, newBoldFont_2, newFancyFont_2;
- private int anInt1275;
- public int backDialogID;
- private int anInt1278;
- public int anInt1279;
- private int[] bigX;
- private int[] bigY;
- private int itemSelected;
- private int anInt1283;
- private int anInt1284;
- private int anInt1285;
- private String selectedItemName;
- public int publicChatMode;
- private static int anInt1288;
- public static int anInt1290;
- 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 static int[] fullScreenTextureArray;
- public int mapX;
- public int mapY;
- public Gameframe gameframe;
- boolean autoCast;
- int autocastId;
- int currentGEItem = -1;
- public int GEItemId = -1;
- public Sprite geSearchBox, geSearchBoxHover;
- public boolean buttonclicked;
- public int totalItemResults;
- public int interfaceButtonAction;
- public int Slots[] = new int[7];
- public String slots[] = new String[7];
- public int slotItemId[] = new int[7];
- public int slotColor[] = new int[7];
- public int slotColorPercent[] = new int[7];
- public int slotItems[] = new int[7];
- public boolean slotAborted[] = new boolean[7];
- public int slotUsing = 0;
- public int slotSelected;
- public Sprite per0;
- public Sprite per1;
- public Sprite per2;
- public Sprite per3;
- public Sprite per4;
- public Sprite per5;
- public Sprite per6;
- public Sprite abort1;
- public Sprite abort2;
- public Sprite SellHover;
- public Sprite BuyHover;
- public Sprite sellSubmitHover;
- public Sprite buySubmitHover;
- public String Recruits = "";
- public String Corporals = "";
- public String Sergeants = "";
- public String Lieutenants = "";
- public String Captains = "";
- public String Generals = "";
- private String clanchatOwner = "";
- public String clanName = "";
- public static long lastLogin = System.currentTimeMillis();
- public static long lastCameraZoomChange = 0;
- public long coinsInPouch = 0;
- public long lastCoinsInPouchChange = System.currentTimeMillis();
- public int tooltipHoverChildId;
- public int tooltipHoverX;
- public int tooltipHoverY;
- public int tooltipHoverLoopCycle;
- public int[] keybinds = new int[16];
- public Sprite currentDragSprite;
- public int currentDragAmount;
- public int currentDragX;
- public int currentDragY;
- public int currentDragAmountX;
- public int currentDragAmountY;
- public long lastReceivedUpdate = System.currentTimeMillis();
- public long bytesReceived = 0;
- public Map<Integer, Long> opcodeReceived = new HashMap<Integer, Long>();
- public boolean interfaceStrings;
- public boolean interfaceIds;
- public int currentActionMenu;
- public int gameframeHint;
- Fog fog = new Fog();
- public void setGameframe(Gameframe gameframe) {
- this.gameframe = gameframe;
- Gameframe.c = this;
- this.inputTaken = true;
- if (gameframe.getVersion() <= 459) {
- this.chatTypeView = 0;
- }
- }
- public void resetAllImageProducers() {
- if (super.fullGameScreen != null) {
- return;
- }
- aRSImageProducer_1166 = null;
- aRSImageProducer_1164 = null;
- aRSImageProducer_1163 = null;
- aRSImageProducer_1165 = null;
- aRSImageProducer_1125 = null;
- aRSImageProducer_1107 = null;
- aRSImageProducer_1108 = null;
- aRSImageProducer_1109 = null;
- aRSImageProducer_1110 = null;
- aRSImageProducer_1111 = null;
- aRSImageProducer_1112 = null;
- aRSImageProducer_1113 = null;
- aRSImageProducer_1114 = null;
- aRSImageProducer_1115 = null;
- super.fullGameScreen = new ImageProducer(765, 503);
- welcomeScreenRaised = true;
- }
- public void mouseWheelDragged(int i, int j) {
- if (!mouseWheelDown) {
- return;
- }
- this.anInt1186 += i * 3;
- this.anInt1187 += (j << 1);
- }
- public void launchURL(String url) {
- String osName = System.getProperty("os.name").toLowerCase();
- try {
- if (osName.startsWith("mac")) {
- pushMessage("It's hard to open web pages in mac..", 0, "");
- pushMessage("Visit: " + url, 0, "");
- Runtime runtime = Runtime.getRuntime();
- String[] args = { "osascript", "-e", "open location \"" + url + "\"" };
- try {
- runtime.exec(args);
- } catch (IOException e) {
- pushMessage("Web page could not be opened..", 0, "");
- pushMessage("Visit: " + url, 0, "");
- }
- } else if (osName.startsWith("windows")) {
- Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
- } else { // assume Unix or Linux
- String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
- String browser = null;
- for (int count = 0; count < browsers.length && browser == null; count++) {
- if (Runtime.getRuntime().exec(new String[] { "which", browsers[count] }).waitFor() == 0) {
- browser = browsers[count];
- }
- }
- if (browser == null) {
- throw new Exception("Could not find web browser");
- } else {
- Runtime.getRuntime().exec(new String[] { browser, url });
- }
- }
- } catch (Exception e) {
- pushMessage("Failed to open URL.", 0, "");
- }
- }
- int[] IDs = { 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573, 1290, 1299, 1308, 1315,
- 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388, 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446,
- 1453, 1460, 1469, 15878, 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553, 1563,
- 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
- /* Ancients */
- 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062, 12952, 13000, 13070,
- 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096, };
- int[] runeChildren = { 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244,
- 1245, 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295, 1302,
- 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345, 1352, 1353, 1354,
- 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400, 1401, 1407, 1408, 1410, 1417,
- 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450, 1456, 1457, 1463, 1464, 1465, 1472, 1473,
- 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499, 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526,
- 1533, 1534, 1535, 1547, 1548, 1549, 1556, 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588,
- 1596, 1597, 1598, 1605, 1606, 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011,
- 8673, 8674, 12041, 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460,
- 15881, 15882, 15885, 18474, 18475, 18478 };
- static {
- experienceForLevels = 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;
- experienceForLevels[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