Advertisement
Guest User

IDung source code?

a guest
Mar 14th, 2011
924
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 412.74 KB | None | 0 0
  1. import java.awt.Color;
  2. import java.awt.Desktop;
  3. import java.awt.Font;
  4. import java.awt.Graphics;
  5. import java.awt.Graphics2D;
  6. import java.awt.Point;
  7. import java.awt.Polygon;
  8. import java.awt.Rectangle;
  9. import java.awt.RenderingHints;
  10. import java.awt.event.KeyEvent;
  11. import java.awt.event.KeyListener;
  12. import java.awt.event.MouseEvent;
  13. import java.awt.event.MouseListener;
  14. import java.awt.event.MouseMotionListener;
  15. import java.awt.image.BufferedImage;
  16. import java.io.BufferedWriter;
  17. import java.io.File;
  18. import java.io.FileInputStream;
  19. import java.io.FileWriter;
  20. import java.net.URI;
  21. import java.net.URL;
  22. import java.util.ArrayList;
  23. import java.util.ArrayList<Lorg.rsbot.script.wrappers.RSTile;>;
  24. import java.util.Collection;
  25. import java.util.Iterator;
  26. import java.util.Properties;
  27. import java.util.logging.Logger;
  28. import javax.imageio.ImageIO;
  29. import org.rsbot.event.events.MessageEvent;
  30. import org.rsbot.event.listeners.MessageListener;
  31. import org.rsbot.event.listeners.PaintListener;
  32. import org.rsbot.script.Script;
  33. import org.rsbot.script.ScriptManifest;
  34. import org.rsbot.script.methods.Calculations;
  35. import org.rsbot.script.methods.Camera;
  36. import org.rsbot.script.methods.Combat;
  37. import org.rsbot.script.methods.Combat.Prayer;
  38. import org.rsbot.script.methods.Environment;
  39. import org.rsbot.script.methods.Equipment;
  40. import org.rsbot.script.methods.Game;
  41. import org.rsbot.script.methods.Game.CHAT_MODE;
  42. import org.rsbot.script.methods.GroundItems;
  43. import org.rsbot.script.methods.Interfaces;
  44. import org.rsbot.script.methods.Inventory;
  45. import org.rsbot.script.methods.Menu;
  46. import org.rsbot.script.methods.Mouse;
  47. import org.rsbot.script.methods.NPCs;
  48. import org.rsbot.script.methods.Objects;
  49. import org.rsbot.script.methods.Players;
  50. import org.rsbot.script.methods.Skills;
  51. import org.rsbot.script.methods.Walking;
  52. import org.rsbot.script.util.Filter;
  53. import org.rsbot.script.util.Timer;
  54. import org.rsbot.script.wrappers.RSArea;
  55. import org.rsbot.script.wrappers.RSCharacter;
  56. import org.rsbot.script.wrappers.RSComponent;
  57. import org.rsbot.script.wrappers.RSGroundItem;
  58. import org.rsbot.script.wrappers.RSInterface;
  59. import org.rsbot.script.wrappers.RSItem;
  60. import org.rsbot.script.wrappers.RSModel;
  61. import org.rsbot.script.wrappers.RSNPC;
  62. import org.rsbot.script.wrappers.RSObject;
  63. import org.rsbot.script.wrappers.RSObject.Type;
  64. import org.rsbot.script.wrappers.RSObjectDef;
  65. import org.rsbot.script.wrappers.RSPlayer;
  66. import org.rsbot.script.wrappers.RSTile;
  67.  
  68. @ScriptManifest(authors={"kiko"}, keywords={"Dungeoneering"}, name="iDungeon Pro", version=1.07D, description="The most advanced Dungeoneering script in existence")
  69. public class iDungeonPro extends Script
  70.   implements KeyListener, MouseListener, MouseMotionListener, MessageListener, PaintListener
  71. {
  72.   final Rectangle lf = new Rectangle(273, 397, 12, 12);
  73.   private int re;
  74.   private final int[] pe = { 54013, 54014, 54015, 54016 };
  75.   private BufferedImage KG;
  76.   private ArrayList<RSArea> aE = new ArrayList();
  77.   private int iE;
  78.   private int LE;
  79.   final Rectangle qf = new Rectangle(380, 389, 20, 15);
  80.   private int og;
  81.   private final int[] wE = { 50240, 50241, 50242, 50243, 50244, 50245, 50246, 50247 };
  82.  
  83.   boolean xe = false;
  84.  
  85.   private final int[] Af = { 50323, 50324, 50325, 50326, 50327, 50328, 53968, 53969 };
  86.  
  87.   private ArrayList<RSTile> fG = new ArrayList();
  88.  
  89.   final Rectangle vg = new Rectangle(175, 344, 222, 17);
  90.  
  91.   private ArrayList<RSTile> ig = new ArrayList();
  92.  
  93.   private int bF = 0;
  94.   private boolean nE;
  95.   private final int[] jF = { 16295, 16361, 17490, 17678, 17754, 17794, 17796, 17883 };
  96.  
  97.   private final int Vg = 11007;
  98.   private int Cg;
  99.   private ArrayList<RSTile> AG = new ArrayList();
  100.   private boolean Fg;
  101.   private BufferedImage We;
  102.   final Rectangle cf = new Rectangle(180, 396, 12, 12);
  103.  
  104.   final Rectangle ff = new Rectangle(95, 385, 140, 18);
  105.  
  106.   private final int[] eG = { 49522, 49523, 49524, 49528, 49529, 49530, 49534, 49535, 49536 };
  107.   private int sg;
  108.   private final int[] te = { 52206, 52207, 54282 };
  109.  
  110.   private ArrayList<RSTile> be = new ArrayList();
  111.  
  112.   private int[] VD = { 0, 0, 0, 0, 0, 0 };
  113.  
  114.   final Color Qf = new Color(0, 255, 0, 200);
  115.  
  116.   private final int[] WD = { 50342, 50343, 50344, 53948, 50346, 50347, 50348, 53949 };
  117.  
  118.   boolean kf = false;
  119.  
  120.   private final int[] kg = { 49656, 49657, 49658, 54308 };
  121.   private boolean XF;
  122.   private final String[] ME = { "Salve", "Wildercress", "Blightleaf", "Roseblood", "Bryll", "Duskweed", "Soulbell", "Ectograss", "Runic", "Spiritbloom", "Celestial" };
  123.   private boolean Jg;
  124.   private int Gg;
  125.   private boolean JE;
  126.   private String Xf = "00:00:00";
  127.  
  128.   private Point YF = new Point(0, 0);
  129.  
  130.   String ce = "";
  131.  
  132.   final Color IG = new Color(0, 0, 0, 110);
  133.  
  134.   private final int[] Yf = { 50272, 50273, 50274, 50287, 50288, 50289, 50299, 50300, 50301, 50308, 50309, 50310, 50317, 50318, 50319, 53951, 53960, 53963, 53966 };
  135.   private boolean Ke;
  136.   private final String[] ae = { "Novite", "Bathus", "Marmaros", "Kratonite", "Fractite", "Zephyrium", "Argonite", "Katagon", "Gorgonite", "Promethium", "Primal" };
  137.  
  138.   private String SE = "";
  139.   private RSArea Sg;
  140.   final Rectangle qF = new Rectangle(273, 419, 12, 12);
  141.  
  142.   final Rectangle Pf = new Rectangle(401, 344, 112, 19);
  143.  
  144.   private ArrayList<RSTile> vF = new ArrayList();
  145.   private int[] lG;
  146.   private final int[] QE = { 49688, 49690, 54287 };
  147.  
  148.   boolean dg = false;
  149.  
  150.   private int xD = 3;
  151.  
  152.   final Rectangle bE = new Rectangle(180, 418, 12, 12);
  153.   private boolean gE;
  154.   private final int[] TF = { 50224, 50225, 50226, 50227, 50228, 50229, 50230, 50231 };
  155.  
  156.   private final int[] nF = { 18218, 18220, 18222, 18224, 18226, 18228, 18230, 18232 };
  157.   private boolean FF;
  158.   private final int[] XE = { 49462, 50342, 50343, 50344, 53948, 50350, 50351, 50352, 53950 };
  159.   private int yF;
  160.   private boolean le = true;
  161.  
  162.   private final int[] rg = { 50332, 50333, 50334, 53971 };
  163.   private int KE;
  164.   private Point Xe = new Point(0, 0);
  165.  
  166.   final Rectangle[] df = new Rectangle[0];
  167.   private boolean Je;
  168.   private boolean BG = true;
  169.  
  170.   private final int[][] Cf = { a.Ve, a.hc, a.TF, a.Hb, a.wE, a.vd, a.ED, a.TA };
  171.  
  172.   final Color ZE = new Color(0, 180, 0, 80);
  173.  
  174.   Filter<RSNPC> jE = new n(a);
  175.  
  176.   private final int[] aF = { 10966, 10967, 10968, 12114 };
  177.  
  178.   private final int[] LG = { 50604, 51156, 51704, 54675, 56149 };
  179.  
  180.   final Rectangle Ag = new Rectangle(315, 390, 12, 12);
  181.  
  182.   private ArrayList<RSTile> ue = new ArrayList();
  183.  
  184.   final Rectangle Ye = new Rectangle(373, 397, 12, 12);
  185.  
  186.   boolean xF = false;
  187.  
  188.   private ArrayList<RSArea> ke = new ArrayList();
  189.   private BufferedImage iG;
  190.   private final String[] yf = { "Crawling hand", "Cave crawler", "Cave slime", "Pyrefiend", "Night spider", "Jelly", "Spiritual guardian", "Seeker", "Nechryael", "Edimmu", "Soulgazer" };
  191.   private BufferedImage Hg;
  192.   private int ZF;
  193.   final Rectangle[] Sf = { a.gC, a.F, a.cf, a.bE, a.wc, a.WB };
  194.   private int Zf;
  195.   private final int zf = 18175;
  196.  
  197.   private int mf = 144;
  198.   private int me;
  199.   final Rectangle JG = new Rectangle(373, 375, 12, 12);
  200.   private int UE;
  201.   private double tE = 0.0D;
  202.  
  203.   final Rectangle ag = new Rectangle(495, 346, 18, 18);
  204.  
  205.   final Color wg = new Color(0, 255, 0, 130);
  206.   private RSTile vE;
  207.   private final int dF = 11226;
  208.   private BufferedImage UF;
  209.   private ArrayList<RSTile> Ee = new ArrayList();
  210.  
  211.   final Rectangle Pg = new Rectangle(465, 346, 18, 18);
  212.   private BufferedImage OE;
  213.   final Rectangle RE = new Rectangle(315, 413, 12, 12);
  214.  
  215.   final Rectangle lF = new Rectangle(193, 430, 12, 12);
  216.  
  217.   private final int[] Ve = { 50208, 50209, 50210, 50211, 50212, 50213, 50214, 50215 };
  218.  
  219.   private final int[] Lc = { 18314, 18316, 18318, 18320, 18322, 18324, 18326, 18328 };
  220.  
  221.   private String tc = "";
  222.  
  223.   private final int sd = 18163;
  224.  
  225.   private final int NC = 49341;
  226.   private int wb;
  227.   final Rectangle JD = new Rectangle(173, 375, 12, 12);
  228.  
  229.   private final int[] OB = { 10942, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 10951, 10952, 10953, 12117, 12118, 12119, 12120 };
  230.  
  231.   private final String[] Md = { "2", "6", "9", "12", "15", "18", "21", "22", "23", "24", "26", "27", "28", "31", "32", "36", "39", "40", "42", "44", "45", "46", "48", "51", "52", "53", "54", "56", "58", "59", "60", "64", "65", "66", "67", "68", "69", "70", "71", "72", "76", "77", "78", "79", "82", "83", "84", "85", "86", "88", "89", "91", "92", "97", "98", "99", "100", "103", "104", "112", "114", "115", "116", "117", "119", "121", "124", "129", "130", "131", "132", "137", "138", "142", "143", "144", "145", "148", "151", "156", "157", "158", "159", "160", "164", "166", "172" };
  232.   private boolean gd;
  233.   boolean BB = false;
  234.  
  235.   final Rectangle fD = new Rectangle(12, 437, 69, 16);
  236.  
  237.   boolean QC = false;
  238.   private int RB;
  239.   private final int[] Yc = { 67, 188, 836, 843, 2958, 4653, 4668, 4673, 4917, 4918, 5329, 5491, 5503, 5534, 5542, 5569, 5575, 6564, 6576, 7937, 8078, 11642, 13407, 13062, 13153, 13481, 13669, 13683, 13744, 13785, 14860 };
  240.   private int eB;
  241.   private ArrayList<Integer> ID = new ArrayList();
  242.   private RSTile[] Wd;
  243.   private int xB;
  244.   private String[] Ec = a.ae;
  245.   private boolean Od;
  246.   private final int[] TB = { 11027, 11028, 11029, 11030, 11031, 11032, 11033, 11034, 11035 };
  247.  
  248.   private final int[] Xc = { 49507, 49508, 49509, 49510, 49511, 49512, 54261 };
  249.   private int[] pb;
  250.   private int yB;
  251.   private final String oD = System.getProperty("user.home") + File.separator + "iDungeon";
  252.  
  253.   boolean Fb = true;
  254.  
  255.   private final int YC = 18159;
  256.   private int bb;
  257.   boolean Ed = true;
  258.   private int qc;
  259.   private int TC;
  260.   private ArrayList<RSArea> cD = new ArrayList();
  261.   private int Ob;
  262.   private final int Nb = 18173;
  263.  
  264.   private final int[] xC = { 10981, 10983, 10985, 10987, 10989, 10991, 10993, 10995, 10997, 10999 };
  265.  
  266.   final Rectangle gC = new Rectangle(373, 371, 12, 12);
  267.   private boolean eC;
  268.   final Rectangle mC = new Rectangle(33, 430, 12, 12);
  269.   private boolean rb;
  270.   private int pC;
  271.   boolean gB = false;
  272.   private int Wb;
  273.   final Rectangle Ub = new Rectangle(121, 420, 20, 15);
  274.  
  275.   private final int[] vd = { 50248, 50249, 50250, 50251, 50252, 50253, 50254, 50255 };
  276.  
  277.   final Rectangle[] nB = { a.wA, a.aB, a.G, a.mC, a.fC, a.lF, a.Ag, a.RE };
  278.   private String eb;
  279.   boolean qD = false;
  280.  
  281.   private final String[][] sB = { { "full helm" }, { "platebody", "chainbody" }, { "kiteshield" }, { "platelegs", "plateskirt" }, { "gauntlets" }, { "boots" } };
  282.  
  283.   private final String[] PC = { "Forgotten warrior", "Forgotten ranger", "Zombie", "Skeleton", "Giant skeleton", "Hill giant" };
  284.  
  285.   private final int[] sb = { 49306, 49335, 49336, 49337, 49338, 49375, 49376, 49377, 49378, 49379, 49380, 49387, 49388, 49389, 49462, 49463, 49464, 49504, 49505, 49506, 49516, 49517, 49518, 49564, 49565, 49566, 49574, 49575, 49576, 49577, 49578, 49579, 49603, 49604, 49605, 49606, 49607, 49608, 49625, 49626, 49627, 49644, 49645, 49646, 49650, 49651, 49652, 49677, 49678, 49679, 53987, 53988, 53989, 53990, 53992, 54001, 54006, 54067, 54070, 54071, 54072, 54073, 54106, 54107, 54108, 54109, 54236, 54274, 54284, 54299, 54300, 54315, 54316, 54317, 54318, 54319, 54320, 54335, 54360, 54361, 54362, 54363, 54404, 54417, 54620, 55478, 55479, 55480, 55481, 56079, 56081, 56526, 56527, 56528, 56529 };
  286.   private Timer hd;
  287.   private final int oB = 10058;
  288.  
  289.   final Font Kb = new Font("Trebuchet MS", 0, 11);
  290.   private boolean kC;
  291.   private int[] UC;
  292.   private int ac;
  293.   private final int[] lC = { 49693 };
  294.  
  295.   final Color sc = new Color(0, 0, 0);
  296.  
  297.   boolean od = false;
  298.  
  299.   final Rectangle tC = new Rectangle(6, 427, 81, 31);
  300.  
  301.   private ArrayList<RSArea> ic = new ArrayList();
  302.  
  303.   boolean Pb = false;
  304.  
  305.   final Rectangle[] Jb = { a.JD, a.Mb, a.JG, a.Dc, a.lf, a.Ye, a.zd, a.qF, a.Cd };
  306.  
  307.   private final String[] Ad = { "Protoleather", "Subleather", "Paraleather", "Archleather", "Dromoleather", "Spinoleather", "Gallileather", "Stegoleather", "Megaleather", "Tyrannoleather", "Sagittarian" };
  308.   private BufferedImage hb;
  309.   private int xb = -1;
  310.  
  311.   final Color nd = new Color(0, 190, 255, 140);
  312.  
  313.   private final String jc = "1.07";
  314.  
  315.   private final int[] sC = { 49381, 49382, 49383, 54333 };
  316.  
  317.   private final int[] yb = { 11036, 11037, 11038, 11039, 11040, 11041, 11042, 11043, 11044, 12094, 12095, 12096 };
  318.  
  319.   int uB = 0;
  320.   private int pd;
  321.   final Rectangle[][] ZC = { a.nB, a.Jb, a.Sf, a.df };
  322.  
  323.   private ArrayList<RSTile> ob = new ArrayList();
  324.   private boolean Sd;
  325.   private boolean Xb;
  326.   private BufferedImage rD;
  327.   private int Zc = 6; private int dC = 6;
  328.   private boolean Hc;
  329.   private final int Gc = 17566;
  330.  
  331.   boolean vC = false;
  332.   private boolean jD;
  333.   private int CD;
  334.   private int Ud = 0;
  335.   private int Rc;
  336.   private long dd = 0L;
  337.  
  338.   private String fd = "00:00:00";
  339.  
  340.   private String uC = "";
  341.  
  342.   private final int Jc = 17789;
  343.   private int eD;
  344.   int DC = 1;
  345.  
  346.   final Rectangle Mb = new Rectangle(273, 375, 12, 12);
  347.  
  348.   final Rectangle xd = new Rectangle(6, 363, 81, 32);
  349.  
  350.   private final int[] LD = { 35507, 35520, 35523, 35525, 35562, 35568, 35569, 35576 };
  351.  
  352.   private ArrayList<RSTile> fc = new ArrayList();
  353.   private boolean iD;
  354.   private final String[][] lB = { { "hood" }, { "robe top" }, { "" }, { "robe bottom" }, { "gloves" }, { "boots" } };
  355.  
  356.   final Rectangle wc = new Rectangle(420, 392, 12, 12);
  357.   private int pc;
  358.   private final int ed = 2;
  359.   private BufferedImage Dd;
  360.   final Color Cb = new Color(255, 0, 0, 130);
  361.  
  362.   Filter<RSNPC> Fd = new x(a);
  363.  
  364.   private int tB = 113;
  365.  
  366.   private final String[] VB = { "Tangle gum", "Seeping elm", "Blood spindle", "Utuku", "Spinebeam", "Bovistrangler", "Thigat", "Corpsethorn", "Entgallow", "Grave creeper", "Sagittarian" };
  367.   private int Qb;
  368.   private final int[] ED = { 50256, 50257, 50258, 50259, 50260, 50261, 50262, 50263 };
  369.  
  370.   final Font SB = new Font("Impact", 1, 13);
  371.  
  372.   private final String[] Cc = { "Forgotten warrior", "Forgotten mage", "Forgotten ranger", "Mysterious shade", "Dungeon spider", "Ghost", "Animated pickaxe", "Giant rat", "Giant bat", "Necromancer", "Thrower troll", "Hydra", "Cave crawler", "Guard dog", "Nechryael", "Hobgoblin", "Lesser demon", "Greater demon", "Mercenary leader", "Hellhound" };
  373.  
  374.   private ArrayList<RSTile> uc = new ArrayList();
  375.  
  376.   private final int[] CC = { 5, 10, 17, 30, 41, 52, 63, 71, 80, 90, 99 };
  377.  
  378.   final Rectangle aB = new Rectangle(113, 390, 12, 12);
  379.  
  380.   final Rectangle Ld = new Rectangle(367, 56, 100, 15);
  381.  
  382.   final Rectangle Rb = new Rectangle(425, 346, 18, 18);
  383.  
  384.   private final int oC = 17444;
  385.  
  386.   private ArrayList<RSArea> JB = new ArrayList();
  387.  
  388.   private final int[] Zb = { 54110, 54111, 54112, 54113 };
  389.   private RSArea QB;
  390.   private boolean jC;
  391.   private String AB = "";
  392.  
  393.   private final int[] ab = { 50346, 50347, 50348, 53949 };
  394.  
  395.   Filter<RSNPC> xc = new j(a);
  396.  
  397.   private final int[] hc = { 50216, 50217, 50218, 50219, 50220, 50221, 50222, 50223 };
  398.  
  399.   boolean UB = true;
  400.   private BufferedImage NB;
  401.   private ArrayList<Integer> EB = new ArrayList();
  402.  
  403.   private final int[] Fc = { 39912, 39913, 39920, 39921, 39929, 39930, 39931 };
  404.  
  405.   private final int wB = 17489;
  406.   private int vB;
  407.   final Color Oc = new Color(255, 255, 255, 100);
  408.   private int Pd;
  409.   private int Gd = -1;
  410.  
  411.   final Rectangle WB = new Rectangle(180, 440, 12, 12);
  412.  
  413.   private int jB = 0;
  414.  
  415.   final Rectangle kB = new Rectangle(403, 440, 100, 18);
  416.   private int[] vc;
  417.   final Color bd = new Color(255, 255, 0, 180);
  418.  
  419.   private final int[] fB = { 18282, 18284, 18286, 18288, 18290, 18292, 18294, 18296 };
  420.  
  421.   private final int[] Lb = { 50350, 50351, 50352, 53950 };
  422.  
  423.   final Rectangle Cd = new Rectangle(373, 419, 12, 12);
  424.  
  425.   private ArrayList<RSTile> Tc = new ArrayList();
  426.  
  427.   private final int[] MD = { 18250, 18252, 18254, 18256, 18258, 18260, 18262, 18264 };
  428.   private String[] PB;
  429.   private final int[] AC = { 12167, 12165, 12171, 12169, 12173 };
  430.   private int[] cB;
  431.   private int mc;
  432.   private BufferedImage gD;
  433.   private final int[] mD = { 50278, 50279, 50280, 50305, 50306, 50307, 50314, 50315, 50316, 50329, 50330, 50331, 53953, 53962, 53965, 53970 };
  434.  
  435.   Filter<RSObject> cC = new e(a);
  436.  
  437.   private final int hD = 17415;
  438.  
  439.   private int SD = -1;
  440.   private int Td;
  441.   private int Vc;
  442.   private boolean qB;
  443.   boolean qC = false;
  444.   private int Db;
  445.   private BufferedImage Kd;
  446.   Filter<RSNPC> bD = new h(a);
  447.  
  448.   private double Ab = 0.0D;
  449.  
  450.   private ArrayList<RSArea> Nc = new ArrayList();
  451.   private int GC;
  452.   final Color ub = new Color(255, 255, 255);
  453.   private boolean MC;
  454.   private boolean WC;
  455.   private String Nd = "";
  456.  
  457.   private final int[] Gb = { 39991, 40002, 40003 };
  458.  
  459.   private final int[] ad = { 49398, 49400, 49402, 49404, 49422, 49424, 49426, 49428, 49446, 49448, 49450, 49452, 54344, 54346, 54348, 54350 };
  460.  
  461.   boolean Wc = false;
  462.  
  463.   final Rectangle Dc = new Rectangle(173, 397, 12, 12);
  464.  
  465.   private final int zb = 1;
  466.  
  467.   private final int kb = 18165;
  468.  
  469.   private ArrayList<RSTile> RD = new ArrayList();
  470.  
  471.   final Rectangle kc = new Rectangle(405, 346, 18, 18);
  472.  
  473.   private final String[] kD = { "Hobgoblin", "Icefiend", "Brute", "Necromancer", "Hill giant", "Soulgazer", "Seeker", "Ice troll", "Frost dragon", "Iron dragon", "Green dragon", "Guard dog", "Earth warrior", "Hellhound" };
  474.  
  475.   private final int vb = 18161;
  476.  
  477.   boolean Xd = false;
  478.  
  479.   private final int[] gb = { 49696, 49698, 49700, 53748 };
  480.  
  481.   private ArrayList<RSTile> id = new ArrayList();
  482.   private int JC;
  483.   private final int[] aC = { 17670, 17672, 17674, 17676, 17671, 18830, 18831, 18833, 18834 };
  484.   private boolean GD;
  485.   private int bC = -1;
  486.  
  487.   private String[][] wC = a.sB;
  488.  
  489.   final Rectangle qb = new Rectangle(403, 416, 100, 16);
  490.  
  491.   final Color Jd = new Color(255, 0, 255);
  492.   private BufferedImage BC;
  493.   private final int[] Yd = { 49615, 49616, 49617, 49618 };
  494.  
  495.   private final int yC = 18169;
  496.  
  497.   private final int[] OC = { 49320, 49321, 49322, 49323 };
  498.  
  499.   private final int Pc = 18177;
  500.  
  501.   final Rectangle oc = new Rectangle(7, 458, 100, 16);
  502.  
  503.   private String Qc = "Loading images...";
  504.   private int Rd;
  505.   final Color EC = new Color(255, 0, 0);
  506.  
  507.   private final int ib = 18171;
  508.  
  509.   private final int[] Hd = { 53124, 53125, 53126, 7528 };
  510.  
  511.   private final int rd = 18201; private final int dD = 18829;
  512.  
  513.   private final int[] Mc = { 40010, 40011, 54614 };
  514.  
  515.   private long HB = 999999L;
  516.   private int BD;
  517.   private int cc;
  518.   String Bc = "";
  519.   private Timer lc;
  520.   final Rectangle Vb = new Rectangle(438, 437, 69, 16);
  521.   private Timer HD;
  522.   private final int[] Bb = { 49390, 49392, 49394, 49396, 49414, 49416, 49418, 49420, 49438, 49440, 49442, 49444, 54336, 54338, 54340, 54342 };
  523.   private boolean md;
  524.   private boolean kd = true;
  525.  
  526.   final Color Eb = new Color(160, 0, 160, 160);
  527.  
  528.   final Rectangle iC = new Rectangle(6, 395, 81, 32);
  529.  
  530.   Filter<RSNPC> CB = new f(a);
  531.  
  532.   private final int nC = 16295;
  533.   private boolean zB;
  534.   private final int[] mb = { 54237, 54238, 54239, 54240 };
  535.  
  536.   private final int[] tb = { 49278, 49279, 49276, 49277, 49274, 49275 };
  537.   private boolean nc;
  538.   boolean[] YB = { a.E, a.Ed, a.od, a.M, a.RC, a.dg };
  539.  
  540.   final Rectangle fC = new Rectangle(113, 430, 12, 12);
  541.   private int rC;
  542.   private int DD;
  543.   private int ld = 1;
  544.   private int sD;
  545.   private String cd = "Unknown";
  546.   private int ND;
  547.   final Color MB = new Color(0, 0, 0, 200);
  548.   private int Ic;
  549.   private final int[] fb = { 10954, 10955, 10956, 10957, 10958, 10959, 10960, 10961, 10962, 10963, 10964, 10965, 12121, 12122, 12123, 12124 };
  550.   private int Sc;
  551.   boolean[] yc = { a.k, a.Xd, a.IB, a.i, a.BB, a.vC, a.XC, a.Yb };
  552.   private RSArea jb;
  553.   private int pB;
  554.   private boolean ZB = true;
  555.   private int db;
  556.   private final int hC = 3;
  557.   private RSArea nb;
  558.   boolean ec = false;
  559.  
  560.   private int PD = -1;
  561.  
  562.   private final int[] wd = { 54078, 54079, 54080, 54081 };
  563.  
  564.   private final String[] LC = { "Dungeon spider", "Cave crawler" };
  565.  
  566.   private final int[] DB = { 15707, 18817, 18818, 18819, 18820, 18821, 18822, 18823, 18824, 18825, 18826, 18827, 18828 };
  567.  
  568.   final Color Qd = new Color(255, 255, 255, 215);
  569.   private boolean KD;
  570.   private ArrayList<RSObject> zc = new ArrayList();
  571.   private int SC;
  572.   boolean dc = false;
  573.   private boolean IC;
  574.   private final int[] Id = { 50342, 50343, 50344, 53948 };
  575.  
  576.   private final int[] tD = { 50281, 50282, 50283, 50293, 50294, 50295, 50335, 50336, 50337, 53954, 53956, 53958, 53972 };
  577.  
  578.   private ArrayList<RSTile> gc = new ArrayList();
  579.  
  580.   Filter<RSGroundItem> lD = new w(a);
  581.  
  582.   private final int[] KC = { 18266, 18268, 18270, 18272, 18274, 18276, 18278, 18280 };
  583.  
  584.   private int[] Sb = { 0, 0, 0, 0, 0, 0 };
  585.   private int zC;
  586.   final Rectangle zd = new Rectangle(173, 419, 12, 12);
  587.   private BufferedImage Uc;
  588.   private final int[] OD = { 49406, 49408, 49410, 49412, 49430, 49432, 49434, 49436, 49454, 49456, 49458, 49460, 54352, 54354, 54356, 54358 };
  589.   private boolean FD;
  590.   final Font jd = new Font("Trebuchet MS", 0, 15);
  591.  
  592.   final Rectangle lb = new Rectangle(310, 389, 20, 15);
  593.  
  594.   private final int[] bB = { 49665, 49666, 49667, 54311 };
  595.  
  596.   private RSGroundItem yd = null;
  597.  
  598.   private int HC = 1;
  599.  
  600.   private final int iB = 12089;
  601.   private BufferedImage VC;
  602.   private boolean hB;
  603.   private final int rB = 50552;
  604.  
  605.   final Color rc = new Color(180, 0, 0, 100);
  606.   private int Vd;
  607.   private final int[] Hb = { 50232, 50233, 50234, 50235, 50236, 50237, 50238, 50239 };
  608.  
  609.   private final int FC = 19650;
  610.  
  611.   private final int[] mB = { 49315, 49316, 49317, 49318 };
  612.   private int aD;
  613.   Filter<RSGroundItem> Zd = new t(a);
  614.  
  615.   private ArrayList<RSTile> Bd = new ArrayList();
  616.   private int Ac;
  617.   private String ud = "Unknown";
  618.  
  619.   private final int XB = 17363;
  620.  
  621.   private final int[] FB = { 18298, 18300, 18302, 18304, 18306, 18308, 18310, 18312 };
  622.  
  623.   private final int LB = 11246;
  624.   private RSTile nD;
  625.   boolean Yb = false;
  626.   private RSArea Kc;
  627.   boolean XC = true;
  628.  
  629.   boolean dB = false;
  630.  
  631.   private final int[] KB = { 49570, 49571, 49572, 54235 };
  632.   private int pD;
  633.   boolean IB = false;
  634.  
  635.   boolean RC = true;
  636.  
  637.   final Font cb = new Font("Arial", 1, 12);
  638.  
  639.   boolean qd = false;
  640.  
  641.   final Color QD = new Color(0, 0, 0, 225);
  642.  
  643.   private int[] Tb = { 0, 0, 0, 0, 0, 0 };
  644.  
  645.   private int td = 18;
  646.  
  647.   private ArrayList<RSTile> GB = new ArrayList();
  648.  
  649.   boolean bc = false;
  650.   private BufferedImage Ib;
  651.   private final int[] AD = { 39915, 39924, 39935, 54643 };
  652.   private boolean NA;
  653.   private RSTile QA;
  654.   private Timer sA;
  655.   private int RA;
  656.   private int vA;
  657.   private BufferedImage oA;
  658.   private final String rA = a.oD.concat(File.separator + "iDPSettings.ini");
  659.   private RSArea ZA;
  660.   private final int SA = 11245;
  661.   private boolean UA;
  662.   private ArrayList<RSTile> qA = new ArrayList();
  663.  
  664.   int PA = -1;
  665.   private int uA;
  666.   final Color xA = new Color(255, 215, 0, 140);
  667.  
  668.   final Color YA = new Color(160, 0, 160, 100);
  669.  
  670.   private String[] yA = null;
  671.  
  672.   private String pA = "";
  673.  
  674.   boolean zA = false;
  675.  
  676.   private final int[] TA = { 50264, 50265, 50266, 50267, 50268, 50269, 50270, 50271 };
  677.   private int OA;
  678.   final Rectangle wA = new Rectangle(33, 390, 12, 12);
  679.   private int tA;
  680.   private boolean nA;
  681.   private RSTile WA;
  682.   private final int XA = 18167;
  683.  
  684.   boolean VA = false;
  685.  
  686.   private final String EA = a.oD.concat(File.separator + "iDPLogin.ini");
  687.  
  688.   String bA = "";
  689.   private Timer KA;
  690.   private int HA;
  691.   private ArrayList<RSArea> lA = new ArrayList();
  692.  
  693.   final Color MA = new Color(160, 0, 160, 40);
  694.   private int mA;
  695.   private int IA;
  696.   private RSArea FA;
  697.   private final int[] gA = { 54241, 54242, 54243, 54244, 54245, 54246, 54247, 54248 };
  698.  
  699.   boolean iA = false;
  700.  
  701.   private RSNPC jA = null;
  702.   private Timer hA;
  703.   final Color cA = new Color(255, 255, 255, 150);
  704.  
  705.   private final String[][] LA = { { "coif" }, { "body" }, { "" }, { "chaps" }, { "vambraces" }, { "boots" } };
  706.  
  707.   Filter<RSNPC> CA = new a(a);
  708.   private int AA;
  709.   private int aA = 11;
  710.  
  711.   Filter<RSObject> dA = new z(a);
  712.  
  713.   private final int[] kA = { 18234, 18236, 18238, 18240, 18242, 18244, 18246, 18248 };
  714.  
  715.   private final int GA = 48496;
  716.   private int JA;
  717.   final Color DA = new Color(0, 0, 255, 150);
  718.  
  719.   final Color eA = new Color(160, 0, 160);
  720.  
  721.   private ArrayList<RSTile> fA = new ArrayList();
  722.  
  723.   boolean[] BA = { a.kf, a.ec, a.zA, a.VA, a.QC, a.xe, a.gB, a.bc, a.Fb };
  724.  
  725.   private final int[] P = { 18202, 18204, 18206, 18208, 18210, 18212, 18214, 18216 };
  726.  
  727.   private boolean N = true;
  728.  
  729.   final Rectangle V = new Rectangle(121, 389, 20, 15);
  730.   private int[] W;
  731.   private ArrayList<RSTile> w = new ArrayList();
  732.  
  733.   final Color R = new Color(0, 255, 0);
  734.  
  735.   private final int[][] x = { a.P, a.nF, a.kA, a.MD, a.KC, a.fB, a.FB, a.Lc };
  736.  
  737.   final Rectangle p = new Rectangle(310, 420, 20, 15);
  738.  
  739.   private final RSTile y = new RSTile(0, 0);
  740.  
  741.   private final int[] s = { 54419, 54420, 54421, 54422 };
  742.  
  743.   boolean[][] O = { a.yc, a.BA, a.YB };
  744.  
  745.   private int v = -1;
  746.   private int t;
  747.   private final String[] Y = { "Ice elemental", "Skeleton", "Giant skeleton", "Zombie", "Icefiend", "Giant bat", "Night spider", "Ice spider", "Spiritual guardian", "Ice giant", "Fire giant", "Thrower troll", "Ice troll", "Iron dragon", "Earth warrior", "Ice warrior" };
  748.   private int n;
  749.   final Rectangle o = new Rectangle(7, 458, 506, 16);
  750.  
  751.   final Rectangle S = new Rectangle(403, 395, 100, 16);
  752.  
  753.   private final int[] U = { 54190, 54191, 54192, 54193 };
  754.   private int T;
  755.   private final String[] u = { "Forgotten ranger", "Forgotten mage", "Mysterious shade", "Zombie", "Hydra", "Icefiend", "Animated book", "Skeleton", "Thrower troll", "Ice elemental", "Lesser demon", "Greater demon", "Necromancer", "Ghost" };
  756.   private int q;
  757.   private final int Z = 11010;
  758.  
  759.   final Rectangle Q = new Rectangle(445, 346, 18, 18);
  760.   private RSArea r;
  761.   private boolean X;
  762.   private Timer z = new Timer(0L);
  763.   private int K;
  764.   private int f;
  765.   final Rectangle A = new Rectangle(570, 235, 133, 12);
  766.  
  767.   int h = 1;
  768.   private int L;
  769.   final Color b = new Color(255, 255, 0);
  770.  
  771.   final Rectangle G = new Rectangle(193, 390, 12, 12);
  772.  
  773.   private ArrayList<RSTile> a = new ArrayList();
  774.  
  775.   final Color C = new Color(0, 0, 0, 180);
  776.  
  777.   boolean E = false;
  778.  
  779.   final Rectangle D = new Rectangle(380, 420, 20, 15);
  780.  
  781.   private ArrayList<RSTile> J = new ArrayList();
  782.  
  783.   boolean i = false;
  784.  
  785.   Filter<RSNPC> B = new p(a);
  786.   private int e;
  787.   private ArrayList<RSArea> l = new ArrayList();
  788.  
  789.   private final int[] I = { 54502, 54544, 54621 };
  790.  
  791.   final Rectangle m = new Rectangle(91, 344, 80, 17);
  792.  
  793.   private final int[] d = { 12125, 12126, 12127, 12128, 12129, 12130, 12131, 12132, 12133, 12134, 12135, 12136, 12137, 12138, 12139, 12140, 12141, 12142, 12143, 12144, 12145, 12146, 12147, 12148, 12149, 12150, 12151, 12152, 12153, 12154, 12155, 12156 };
  794.  
  795.   boolean M = true;
  796.  
  797.   final Rectangle H = new Rectangle(7, 344, 80, 17);
  798.  
  799.   private int g = 0;
  800.  
  801.   final Color j = new Color(0, 255, 0, 100);
  802.  
  803.   private final int[] c = { 10058, 11086, 11087, 11088, 11089, 11090, 11091, 11092, 11093, 11094, 11095, 11226 };
  804.  
  805.   boolean k = true;
  806.  
  807.   final Rectangle F = new Rectangle(180, 374, 12, 12);
  808.  
  809.   private String A(RSObject a)
  810.   {
  811.     if (a == null)
  812.       return "";
  813.     RSObjectDef localRSObjectDef;
  814.     return (localRSObjectDef = a.getDef()) != null
  815.        ? localRSObjectDef.getName() : "";
  816.   }
  817.  
  818.   private boolean JC()
  819.   {
  820.     if (!a.zB)
  821.     {
  822.       return false;
  823.     }
  824.  
  825.     int i1 = a.combat.getHealth(); int i2 = a.random(89, 93);
  826.  
  827.     if ((i1 < 1) || (i1 > i2))
  828.       return false;
  829.     int i3;
  830.     int i4 = a.vc[i3]; int i5 = i2 - i3 * 3;
  831.  
  832.     if (i1 > i5) {
  833.       return false;
  834.     }
  835.  
  836.     if (a.inventory.contains(i4)) {
  837.       return a.l(i4, "Eat");
  838.     }
  839.  
  840.     i3++;
  841.  
  842.     return false;
  843.   }
  844.  
  845.   private boolean i(int a)
  846.   {
  847.     if (a.HC == a) {
  848.       return true;
  849.     }
  850.  
  851.     int i1 = a.Vc; int i2 = a.eB;
  852.  
  853.     int i3 = i1;
  854.  
  855.     if (a != a.bb)
  856.     {
  857.       a.SA();
  858.  
  859.       i3 = i2;
  860.     }
  861.  
  862.     if (!a.l(i3, "Wield")) {
  863.       return false;
  864.     }
  865.  
  866.     if ((a == 3) && (a.pB > 0) && (!a.l(a.pB, "Wield")))
  867.     {
  868.       return false;
  869.     }
  870.     a.HC = a;
  871.  
  872.     if (a == a.bb)
  873.     {
  874.       int i4 = a.v;
  875.  
  876.       a.SD = i4;
  877.     }
  878.     else if (a == 1)
  879.     {
  880.       a.SD = 1;
  881.     }
  882.     else if (a == 2)
  883.     {
  884.       a.SD = 1;
  885.     }
  886.     else if (a == 3)
  887.     {
  888.       a.SD = 4;
  889.  
  890.       a.F();
  891.     }
  892.     return true;
  893.   }
  894.  
  895.   private void KC()
  896.   {
  897.     a.DA();
  898.  
  899.     a.w();
  900.   }
  901.  
  902.   private ArrayList<RSTile> l(RSTile a, RSTile a, boolean a, int[] a)
  903.   {
  904.     ArrayList localArrayList1 = new ArrayList(); ArrayList localArrayList2 = new ArrayList();
  905.  
  906.     if ((a == null) || (a == null))
  907.     {
  908.       return localArrayList1;
  909.     }
  910.     a.be.clear();
  911.  
  912.     Object localObject1 = a; Object localObject2 = null;
  913.  
  914.     a.f();
  915.     RSObject[] arrayOfRSObject;
  916.     int i2 = (arrayOfRSObject = a.J(a)).length;
  917.     int i3;
  918.     RSTile[] arrayOfRSTile = arrayOfRSObject[i3]
  919.       .getArea().getTileArray(); int i4 = arrayOfRSTile.length; int i5 = 0; RSTile localRSTile = arrayOfRSTile[i5];
  920.  
  921.     a.be.remove(localRSTile);
  922.  
  923.     i5++;
  924.  
  925.     i3++;
  926.  
  927.     a.be.remove(a);
  928.  
  929.     int i1 = 0; i2 = 0;
  930.  
  931.     localArrayList1.add(localObject1);
  932.  
  933.     while (!((RSTile)localObject1).equals(a))
  934.     {
  935.       double d1 = 99.989999999999995D;
  936.  
  937.       arrayOfRSTile = a.K((RSTile)localObject1); i4 = arrayOfRSTile.length; i5 = 0; localRSTile = arrayOfRSTile[i5];
  938.  
  939.       if (((a) && (a.calc.distanceBetween(localRSTile, a) == 1.0D)) || (localRSTile.equals(a)))
  940.       {
  941.         localArrayList1.add(localRSTile);
  942.  
  943.         return a.a = localArrayList1;
  944.       }
  945.       double d2;
  946.       if ((a.J(localRSTile, new int[0])) && (!localArrayList2.contains(localRSTile)))
  947.       {
  948.         d2 = a.calc.distanceBetween(localRSTile, a);
  949.  
  950.         if (d2 < d1)
  951.         {
  952.           localObject2 = localRSTile;
  953.  
  954.           d1 = d2;
  955.         }
  956.  
  957.       }
  958.  
  959.       i5++;
  960.  
  961.       i1++;
  962.  
  963.       if ((localObject2 == null) || (i2 > 15))
  964.       {
  965.         return new ArrayList();
  966.       }
  967.       if (localObject2.equals(a))
  968.       {
  969.         localArrayList1.add(localObject2);
  970.  
  971.         localObject1 = localObject2;
  972.       }
  973.       else
  974.       {
  975.         arrayOfRSTile = a.K(localObject2); i4 = arrayOfRSTile.length; i5 = 0; localRSTile = arrayOfRSTile[i5];
  976.  
  977.         if ((a.J(localRSTile, new int[0])) && (!localArrayList2.contains(localRSTile)))
  978.         {
  979.           d2 = a.calc.distanceBetween(localRSTile, a);
  980.  
  981.           if (d2 < d1)
  982.           {
  983.             localArrayList1.add(localObject2);
  984.  
  985.             localObject1 = localObject2;
  986.  
  987.             break label439;
  988.           }
  989.         }
  990.         i5++;
  991.  
  992.         label439: if (!((RSTile)localObject1).equals(localObject2))
  993.         {
  994.           arrayOfRSTile = a.K(localObject2); i4 = arrayOfRSTile.length; i5 = 0; localRSTile = arrayOfRSTile[i5];
  995.  
  996.           if (localArrayList2.contains(localRSTile))
  997.           {
  998.             localArrayList1.add(localObject2);
  999.  
  1000.             localObject1 = localObject2;
  1001.           }
  1002.           else
  1003.           {
  1004.             i5++;
  1005.           }
  1006.  
  1007.         }
  1008.  
  1009.         localArrayList2.add(localObject2);
  1010.       }
  1011.       if (i1 > 30)
  1012.       {
  1013.         i2++;
  1014.  
  1015.         localArrayList1.clear();
  1016.  
  1017.         localObject1 = a;
  1018.  
  1019.         localObject2 = null;
  1020.  
  1021.         i1 = 0;
  1022.       }
  1023.     }
  1024.     return (ArrayList<RSTile>)(a.a = localArrayList1);
  1025.   }
  1026.  
  1027.   private boolean Rc()
  1028.   {
  1029.     return (a.Y().isInCombat()) && (!a.d());
  1030.   }
  1031.  
  1032.   private void K(boolean a)
  1033.   {
  1034.     a.l(a);
  1035.  
  1036.     if (a)
  1037.       if (a.npcs.getNearest(a.B) == null) {
  1038.         a.x();
  1039.       }
  1040.       else
  1041.       {
  1042.         a = false;
  1043.       }
  1044.     if ((a.Y().isMoving()) || ((a) && (a.Y().getAnimation() != -1)))
  1045.     {
  1046.       if (a.AA()) {
  1047.         return;
  1048.       }
  1049.  
  1050.       a.KA = new Timer(0L);
  1051.  
  1052.       if (a.FA != null);
  1053.       a.sleep(150, 200);
  1054.     }
  1055.   }
  1056.  
  1057.   private boolean l(Combat.Prayer a)
  1058.   {
  1059.     int i1 = a.getIndex();
  1060.  
  1061.     if (a.interfaces.getComponent(271, 7).getComponents().length < 29)
  1062.     {
  1063.       i1 -= 10;
  1064.     }
  1065.     return a.interfaces.getComponent(271, 7).getComponent(i1).getBackgroundColor() != -1;
  1066.   }
  1067.  
  1068.   private boolean Ec()
  1069.   {
  1070.     if (a.Ed)
  1071.     {
  1072.       a.AB = "Resetting prestige...";
  1073.  
  1074.       if (a.game.getCurrentTab() == 4)
  1075.       {
  1076.         if (a.inventory.containsOneOf(a.DB))
  1077.         {
  1078.           a.inventory.getItem(a.DB).doAction("Open party interface");
  1079.         }
  1080.  
  1081.       }
  1082.       else if (a.interfaces.get(213).isValid()) {
  1083.         a.interfaces.getComponent(213, 5).doAction("Continue");
  1084.       }
  1085.       else if (a.interfaces.get(228).isValid()) {
  1086.         a.interfaces.getComponent(228, 2).doAction("Continue");
  1087.       }
  1088.       else
  1089.       {
  1090.         a.interfaces.getComponent(939, 87).doAction("Reset");
  1091.       }
  1092.  
  1093.       a.sleep(1000, 1400);
  1094.  
  1095.       a.ad();
  1096.  
  1097.       a.re += 1;
  1098.  
  1099.       a.JE = false;
  1100.  
  1101.       a.AB = "";
  1102.  
  1103.       return true;
  1104.     }
  1105.     a.log("Last floor reached, but prestiging is disabled! Shutting down script.");
  1106.  
  1107.     a.Od = false;
  1108.  
  1109.     return false;
  1110.   }
  1111.  
  1112.   private void F(Graphics a, Rectangle a)
  1113.   {
  1114.     a.fillRect(a.x, a.y, a.width, a.height);
  1115.   }
  1116.  
  1117.   private boolean A(RSTile a, String a)
  1118.   {
  1119.     return a.l(a, a.random(0.35D, 0.65D), a.random(0.35D, 0.65D), 0, a);
  1120.   }
  1121.  
  1122.   private void eB()
  1123.   {
  1124.     int i1 = 0;
  1125.  
  1126.     a.Qc = "Beginning a new dungeon!";
  1127.  
  1128.     if ((a.jA()) || (a.CA())) {
  1129.       return;
  1130.     }
  1131.  
  1132.     RSObject localRSObject = a.objects.getNearest(a.LG);
  1133.  
  1134.     if (a.M())
  1135.     {
  1136.       if (!a.C()) {
  1137.         return;
  1138.       }
  1139.  
  1140.       a.log("Exit ladder is null!");
  1141.     }
  1142.     else
  1143.     {
  1144.       i1++;
  1145.     }
  1146.  
  1147.     if (i1 > 10)
  1148.     {
  1149.       a.zB = false;
  1150.  
  1151.       return;
  1152.     }
  1153.     a.sleep(300, 500);
  1154.  
  1155.     if (a.E)
  1156.     {
  1157.       if (a.OA < a.td)
  1158.       {
  1159.         a.rb = true;
  1160.  
  1161.         if (a.Zc != a.ld)
  1162.         {
  1163.           a.nc = true;
  1164.         }
  1165.       }
  1166.       else
  1167.       {
  1168.         a.rb = false;
  1169.  
  1170.         if (!a.Ed)
  1171.         {
  1172.           a.Od = false;
  1173.  
  1174.           return;
  1175.         }
  1176.  
  1177.         if (a.Zc != a.dC)
  1178.           a.nc = true;
  1179.       }
  1180.     }
  1181.     if ((a.nc) || (!a.Od)) {
  1182.       return;
  1183.     }
  1184.  
  1185.     a.log("");
  1186.  
  1187.     a.log("Starting a new dungeon");
  1188.  
  1189.     a.T();
  1190.  
  1191.     a.walking.setRun(true);
  1192.  
  1193.     a.l(a.Vc, "Wield");
  1194.  
  1195.     a.N = false;
  1196.  
  1197.     if (a.jA())
  1198.       return;
  1199.     if (a.UA)
  1200.     {
  1201.       a.log("Reattempting to define the startroom area.");
  1202.     }
  1203.     a.sleep(500, 700);
  1204.  
  1205.     a.uA();
  1206.  
  1207.     a.jb = a.FA;
  1208.     RSComponent localRSComponent;
  1209.     if (((localRSComponent = a.interfaces.getComponent(519, 1))
  1210.       .isValid()) && (localRSComponent.getText().indexOf(":") > 0))
  1211.     {
  1212.       String str1 = localRSComponent.getText();
  1213.       String str2;
  1214.       if (Integer.parseInt(
  1215.         str2 = "" + str1.charAt(str1.indexOf(":") - 1)) < 7)
  1216.       {
  1217.         a.Zc = Integer.parseInt(str2);
  1218.  
  1219.         a.dC = a.Zc;
  1220.       }
  1221.     }
  1222.     else
  1223.     {
  1224.       if (!a.inventory.contains(18829)) { if (a.groundItems.getNearest(new int[] { 18829 }) == null);
  1225.       }
  1226.       else
  1227.       {
  1228.         a.Zc = 6;
  1229.  
  1230.         a.dC = 6; break label572;
  1231.       }
  1232.  
  1233.       if (a.J(new String[] { "Summoning obelisk" }) != null)
  1234.       {
  1235.         a.Zc = 6;
  1236.  
  1237.         a.dC = 6;
  1238.       }
  1239.       else if (a.J(new String[] { "Spinning wheel" }) != null)
  1240.       {
  1241.         a.Zc = 4;
  1242.  
  1243.         a.dC = 4;
  1244.       }
  1245.       else if (a.J(new String[] { "Runecrafting altar" }) != null)
  1246.       {
  1247.         a.Zc = 3;
  1248.  
  1249.         a.dC = 3;
  1250.       }
  1251.       else if (a.D(new int[] { 11226 }) != null)
  1252.       {
  1253.         a.Zc = 1;
  1254.  
  1255.         a.dC = 1;
  1256.       }
  1257.     }
  1258.     label572: if (!a.C())
  1259.     {
  1260.       return;
  1261.     }
  1262.     switch (localRSObject.getID())
  1263.     {
  1264.     case 51156:
  1265.       a.ud = "Frozen";
  1266.  
  1267.       if (a.bc)
  1268.       {
  1269.         if (a.Gd != -1)
  1270.         {
  1271.           a.log("Frozen floor, setting combat style to: Crush");
  1272.  
  1273.           a.SD = a.Gd;
  1274.         }
  1275.         else
  1276.         {
  1277.           a.SD = a.v;
  1278.         }
  1279.       }
  1280.       a.Sc = 145;
  1281.  
  1282.       break;
  1283.     case 50604:
  1284.       a.ud = "Abandoned";
  1285.  
  1286.       if (a.bc)
  1287.       {
  1288.         if (a.xb != -1)
  1289.         {
  1290.           a.log("Abandoned floor, setting combat style to: Slash");
  1291.  
  1292.           a.SD = a.xb;
  1293.         }
  1294.         else if (a.bC != -1)
  1295.         {
  1296.           a.log("Abandoned floor, setting combat style to: Stab");
  1297.  
  1298.           a.SD = a.bC;
  1299.         }
  1300.         else
  1301.         {
  1302.           a.SD = a.v;
  1303.         }
  1304.       }
  1305.       a.Sc = 209;
  1306.  
  1307.       break;
  1308.     case 51704:
  1309.       a.ud = "Furnished";
  1310.  
  1311.       if (a.bc) {
  1312.         if (a.xb != -1)
  1313.         {
  1314.           a.log("Furnished floor, setting combat style to: Slash");
  1315.  
  1316.           a.SD = a.xb;
  1317.         }
  1318.         else if (a.Gd != -1)
  1319.         {
  1320.           a.log("Furnished floor, setting combat style to: Crush");
  1321.  
  1322.           a.SD = a.Gd;
  1323.         }
  1324.         else
  1325.         {
  1326.           a.SD = a.v;
  1327.         }
  1328.  
  1329.       }
  1330.  
  1331.       a.Sc = 273;
  1332.  
  1333.       break;
  1334.     case 54675:
  1335.       a.ud = "Occult";
  1336.  
  1337.       if (a.xb != -1)
  1338.       {
  1339.         a.SD = a.xb;
  1340.  
  1341.         a.log("Occult floor, setting combat style to: Slash");
  1342.       }
  1343.       else if (a.bC != -1)
  1344.       {
  1345.         a.SD = a.bC;
  1346.  
  1347.         a.log("Occult floor, setting combat style to: Stab");
  1348.       }
  1349.       else
  1350.       {
  1351.         a.SD = a.v;
  1352.       }
  1353.  
  1354.       a.Sc = 3676;
  1355.  
  1356.       break;
  1357.     case 56149:
  1358.       while (0 != 0);
  1359.       a.ud = "Warped";
  1360.  
  1361.       a.Sc = 5467;
  1362.     default:
  1363.       a.log.severe("This floor type is not yet supported, returning to a lower floor.");
  1364.  
  1365.       a.nc = true;
  1366.  
  1367.       return;
  1368.     }
  1369.  
  1370.     a.r();
  1371.  
  1372.     a.VA();
  1373.  
  1374.     if (a.gE)
  1375.     {
  1376.       a.log.severe("Looks like a prayer door in the start room, trying another dungeon.");
  1377.  
  1378.       a.gE = true;
  1379.  
  1380.       a.aA();
  1381.  
  1382.       return;
  1383.     }
  1384.     a.KA = new Timer(0L);
  1385.  
  1386.     if (a.jA())
  1387.       return;
  1388.     if (a.dC != a.Zc) {
  1389.       a.log.severe("Complexity mismatch - selected: " + a.dC + ", actual: " + a.Zc);
  1390.     }
  1391.  
  1392.     if (!a.bc)
  1393.     {
  1394.       a.SD = a.v;
  1395.     }
  1396.  
  1397.     a.sA = new Timer(0L);
  1398.  
  1399.     if (a.Zc < 5) {
  1400.       a.MA();
  1401.     }
  1402.  
  1403.     a.camera.setPitch(100);
  1404.  
  1405.     if (a.Zc < 5) {
  1406.       a.MA();
  1407.     }
  1408.  
  1409.     a.A(true);
  1410.  
  1411.     if (a.VA) {
  1412.       a.game.openTab(6);
  1413.     }
  1414.  
  1415.     a.game.openTab(4);
  1416.  
  1417.     a.camera.setCompass('n');
  1418.  
  1419.     a.e();
  1420.  
  1421.     if (a.Zc > 4)
  1422.     {
  1423.       int i2 = -1; int i3 = 0;
  1424.       do
  1425.       {
  1426.         do {
  1427.           while (true)
  1428.           {
  1429.             a.AB = "Purchasing a toolkit";
  1430.  
  1431.             if (a.jA())
  1432.             {
  1433.               return;
  1434.             }
  1435.  
  1436.             a.l(a.Vc, "Wield");
  1437.  
  1438.             if (!a.inventory.contains(19650))
  1439.               break;
  1440.             a.D(true);
  1441.  
  1442.             a.inventory.getItem(new int[] { 19650 }).doClick(true);
  1443.  
  1444.             if ((i4 = 0) < 10)
  1445.             {
  1446.               a.sleep(100, 130);
  1447.  
  1448.               i4++;
  1449.             }
  1450.  
  1451.           }
  1452.  
  1453.         }
  1454.  
  1455.         while (a.l(true, 1, i2));
  1456.  
  1457.         if ((i4 = 0) >= 10)
  1458.           continue;
  1459.         a.sleep(60, 80);
  1460.  
  1461.         i4++;
  1462.       }
  1463.       while (!a.SE.contains("enough money"));
  1464.  
  1465.       i2 = -1;
  1466.  
  1467.       i3++;
  1468.  
  1469.       a.sleep(300, 500);
  1470.  
  1471.       int i4 = a.inventory.getCount(); int i5 = a.inventory.getCount(a.pb);
  1472.       int i7;
  1473.       if ((i3 > 1) || (i5 >= i4))
  1474.       {
  1475.         int[] arrayOfInt;
  1476.         int i6 = (arrayOfInt = a.vc).length; int i8 = arrayOfInt[i7];
  1477.  
  1478.         i2 = i8;
  1479.  
  1480.         i7++;
  1481.       }
  1482.  
  1483.       if ((i2 == -1) && (i3 > 2))
  1484.       {
  1485.         a.log("Unable to purchase a toolkit, trying a new floor.");
  1486.  
  1487.         if (a.UA)
  1488.         {
  1489.           a.env.saveScreenshot(false);
  1490.         }
  1491.         a.nc = true;
  1492.  
  1493.         return;
  1494.       }
  1495.       a.SE = "";
  1496.  
  1497.       a.AB = "";
  1498.     }
  1499.  
  1500.     a.Fg = true;
  1501.   }
  1502.  
  1503.   private boolean l(RSTile a, double a, double a, int a, String a)
  1504.   {
  1505.     int i1;
  1506.     Point localPoint;
  1507.     if ((localPoint = a.calc.tileToScreen(a, a, a, a)).x !=
  1508.       -1)
  1509.     {
  1510.       a.mouse.move(localPoint);
  1511.  
  1512.       if (a.l(a))
  1513.       {
  1514.         return true;
  1515.       }
  1516.  
  1517.       if (!a.Y().isMoving()) {
  1518.         if ((!a.contains("Use")) && (a.menu.contains("Use")))
  1519.           a.l(a, 1);
  1520.         else {
  1521.           i1 += 4;
  1522.         }
  1523.  
  1524.       }
  1525.  
  1526.     }
  1527.     else if (!a.Y().isMoving())
  1528.     {
  1529.       a.A(a, 1);
  1530.     }
  1531.  
  1532.     i1++;
  1533.  
  1534.     return false;
  1535.   }
  1536.  
  1537.   private RSTile[] h(RSTile a)
  1538.   {
  1539.     int i1 = a.getX(); int i2 = a.getY();
  1540.  
  1541.     return new RSTile[] { new RSTile(i1 + 1, i2), new RSTile(i1 - 1, i2), new RSTile(i1, i2 + 1), new RSTile(i1, i2 - 1) };
  1542.   }
  1543.  
  1544.   private boolean G(boolean a)
  1545.   {
  1546.     int i1 = 0;
  1547.  
  1548.     a.Hb();
  1549.     do
  1550.     {
  1551.       do
  1552.         do {
  1553.           while (true)
  1554.           {
  1555.             if ((a.Zc()) || (!a.DD()))
  1556.             {
  1557.               return false;
  1558.             }
  1559.             a.yd = a.groundItems.getNearest(new int[] { 18829 });
  1560.  
  1561.             if ((!a) || (a.yd == null))
  1562.               break;
  1563.             if (!a.l(a.yd))
  1564.             {
  1565.               continue;
  1566.             }
  1567.  
  1568.             a.K(false);
  1569.           }
  1570.  
  1571.         }
  1572.  
  1573.         while (a.jb == null); while (a.jb.contains(new RSTile[] { a.X() }));
  1574.  
  1575.       if (a.GA())
  1576.       {
  1577.         a.sleep(800, 1700);
  1578.  
  1579.         a.F(false);
  1580.  
  1581.         a.K(true);
  1582.       }
  1583.       if ((!a.jb.contains(new RSTile[] { a.X() })) && (a.d())) {
  1584.         a.sleep(2000, 4000);
  1585.       }
  1586.  
  1587.       if ((i1 == 0) || (a.Y().getAnimation() != -1)) continue; if (a.jb.contains(new RSTile[] { a.X() }))
  1588.         continue;
  1589.       a.sleep(600, 800);
  1590.     }
  1591.  
  1592.     while (((i1 != 0) && (a.Y().getAnimation() != -1)) || (!a.F(24, "Cast")));
  1593.  
  1594.     i1 = 1;
  1595.  
  1596.     a.sleep(1100, 2500);
  1597.  
  1598.     a.game.openTab(4);
  1599.  
  1600.     a.K(true);
  1601.  
  1602.     a.uA();
  1603.  
  1604.     return true;
  1605.   }
  1606.  
  1607.   private RSItem[] jb()
  1608.   {
  1609.     return new RSItem[] { a.equipment.getItem(8), a.equipment.getItem(20), a.equipment.getItem(23), a.equipment.getItem(26), a.equipment.getItem(29), a.equipment.getItem(32) };
  1610.   }
  1611.  
  1612.   public void onRepaint(Graphics a)
  1613.   {
  1614.     ((Graphics2D)a).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  1615.  
  1616.     if (a.game.isLoggedIn())
  1617.     {
  1618.       a.setFont(a.jd);
  1619.       Iterator localIterator2;
  1620.       Object localObject1;
  1621.       Object localObject2;
  1622.       if ((a.M) && (a.zB) && (a.FA != null) && (a.r != null))
  1623.       {
  1624.         a.setColor(a.FA.equals(a.r) ? a.QD : a.IG);
  1625.         Iterator localIterator1;
  1626.         RSTile localRSTile1 = (RSTile)localIterator1.next();
  1627.  
  1628.         a.l(a, localRSTile1, 0.5D);
  1629.  
  1630.         a.setColor(a.Cb);
  1631.  
  1632.         localRSTile1 = (RSTile)localIterator1.next();
  1633.  
  1634.         a.l(a, localRSTile1, 0.5D);
  1635.  
  1636.         if (a.ke.contains(a.r)) {
  1637.           a.setColor(a.xA);
  1638.         }
  1639.         else if ((a.jb != null) && (a.r.equals(a.jb)))
  1640.           a.setColor(a.nd);
  1641.         else if ((a.l.contains(a.r)) || ((a.nb != null) && (a.r.equals(a.nb)))) {
  1642.           a.setColor(a.Cb);
  1643.         }
  1644.         else if (a.ic.contains(a.r)) {
  1645.           a.setColor(a.Eb);
  1646.         }
  1647.         else if ((a.Ke) || (a.aE.contains(a.r)))
  1648.         {
  1649.           a.setColor(a.j);
  1650.         }
  1651.         else {
  1652.           a.setColor(a.DA);
  1653.         }
  1654.  
  1655.         localRSTile1 = (RSTile)localIterator1.next();
  1656.  
  1657.         a.l(a, localRSTile1, 0.5D);
  1658.  
  1659.         a.setColor(a.Qf);
  1660.  
  1661.         a.l(a, a.vE, 0.5D);
  1662.  
  1663.         a.setColor(a.bd);
  1664.         int i1;
  1665.         if ((a.cB != null) && (a.Wd != null))
  1666.         {
  1667.           int i4;
  1668.           if ((i4 = a.cB[i1] - 1) !=
  1669.             -1) {
  1670.             a.l(a, a.Wd[i4], 0.4D);
  1671.           }
  1672.  
  1673.           i1++;
  1674.         }
  1675.  
  1676.         for (localIterator2 = a.a.iterator(); localIterator2.hasNext(); )
  1677.         {
  1678.           if (!(localObject1 = (RSTile)localIterator2.next())
  1679.             .equals(a.vE))
  1680.           {
  1681.             a.l(a, (RSTile)localObject1, 0.3D);
  1682.           }
  1683.         }
  1684.         for (localIterator2 = a.fA.iterator(); localIterator2.hasNext(); ) { localObject1 = (RSTile)localIterator2.next();
  1685.  
  1686.           if ((a.calc.distanceBetween(a.X(), (RSTile)localObject1) < 17.0D) && (
  1687.             (localObject2 = a.G((RSTile)localObject1)) != null))
  1688.           {
  1689.             if (a.fG.contains(localObject1))
  1690.             {
  1691.               a.setColor(a.Jd);
  1692.             }
  1693.             else if ((a.vF.contains(localObject1)) || (a.gc.contains(localObject1)))
  1694.             {
  1695.               a.setColor(a.EC);
  1696.             }
  1697.             else if (a.w.contains(localObject1)) {
  1698.               a.setColor(a.R);
  1699.             }
  1700.             else
  1701.             {
  1702.               a.setColor(a.b);
  1703.             }
  1704.             RSTile[] arrayOfRSTile;
  1705.             int i7 = (arrayOfRSTile = ((RSObject)localObject2).getArea().getTileArray()).length; RSTile localRSTile2 = arrayOfRSTile[i8];
  1706.  
  1707.             a.l(a, localRSTile2, 0.5D);
  1708.  
  1709.             i8++;
  1710.           }
  1711.         }
  1712.         int i8;
  1713.         a.setColor(a.DA);
  1714.  
  1715.         for (localIterator2 = a.uc.iterator(); localIterator2.hasNext(); )
  1716.         {
  1717.           if (!(localObject1 = (RSTile)localIterator2.next())
  1718.             .equals(a.vE))
  1719.           {
  1720.             a.l(a, (RSTile)localObject1, 0.3D);
  1721.           }
  1722.         }
  1723.       }
  1724.       if (a.dg)
  1725.       {
  1726.         a.setColor(a.sc);
  1727.  
  1728.         a.F(a, a.oc);
  1729.  
  1730.         if (((a.nc) || (a.Qc.contains("Entering D"))) && (a.game.getCurrentTab() != 4))
  1731.         {
  1732.           a.F(a, a.A);
  1733.         }
  1734.  
  1735.         if ((a.Qc.contains("next dungeon...")) || ((a.N) && (a.pC != 0) && (a.jb == null))) {
  1736.           a.F(a, a.Ld);
  1737.         }
  1738.  
  1739.       }
  1740.  
  1741.       if (!a.iA)
  1742.       {
  1743.         if (a.o.contains(a.Xe))
  1744.         {
  1745.           a.setColor(a.sc);
  1746.  
  1747.           a.drawString((a.bF != 0 ? "Highscores rank: " + a.bF + " || " : "") + (a.jB != 0 ? a.jB + " users online || " : "") + "by kiko & ShadowMoose", 92 + a.mf + a.tB, 472);
  1748.         }
  1749.         a.eb = (a.sA != null ? a.sA.toElapsedString() : "00:00:00");
  1750.  
  1751.         a.setColor(a.QD);
  1752.  
  1753.         if ((a.dc) && (a.uB != 1)) {
  1754.           a.fillRect(7, 363, 80, 95);
  1755.         }
  1756.  
  1757.         a.fillRect(87, 363, 426, 95);
  1758.  
  1759.         a.setColor(a.sc);
  1760.  
  1761.         if (a.Wc)
  1762.         {
  1763.           a.setColor(a.IG);
  1764.         }
  1765.         else if (a.o.contains(a.Xe))
  1766.         {
  1767.           a.setColor(a.MB);
  1768.         }
  1769.         a.F(a, a.o);
  1770.  
  1771.         a.setColor(a.cA);
  1772.  
  1773.         a.drawLine(6, 458, 512, 458);
  1774.  
  1775.         if ((a.UB) || (a.qD) || ((a.dc) && (a.uB == 1)))
  1776.         {
  1777.           a.drawLine(87, 363, 87, 457);
  1778.  
  1779.           a.drawLine(87, a.xd.y, 511, a.xd.y);
  1780.         }
  1781.  
  1782.         if ((a.UB) && (!a.dc))
  1783.         {
  1784.           double d1 = a.z.getElapsed();
  1785.  
  1786.           if ((a.nA) && (d1 != 0.0D))
  1787.           {
  1788.             a.ac = (a.skills.getCurrentExp(0) - a.CD);
  1789.  
  1790.             a.rC = (a.skills.getCurrentExp(2) - a.q);
  1791.  
  1792.             a.TC = (a.skills.getCurrentExp(1) - a.Rc);
  1793.  
  1794.             a.T = (a.skills.getCurrentExp(3) - a.ZF);
  1795.  
  1796.             a.sD = (a.skills.getCurrentExp(4) - a.xB);
  1797.  
  1798.             a.yB = (a.skills.getCurrentExp(6) - a.L);
  1799.  
  1800.             a.Vd = (a.skills.getCurrentExp(5) - a.pd);
  1801.  
  1802.             a.Db = (a.skills.getCurrentExp(20) - a.og);
  1803.  
  1804.             a.sg = (a.skills.getCurrentExp(14) - a.vB);
  1805.  
  1806.             a.Ac = (a.skills.getCurrentExp(11) - a.aD);
  1807.  
  1808.             a.GC = (a.skills.getCurrentExp(8) - a.K);
  1809.  
  1810.             a.mc = (a.skills.getCurrentExp(12) - a.Cg);
  1811.  
  1812.             a.UE = (a.skills.getCurrentExp(13) - a.RA);
  1813.  
  1814.             a.n = (a.skills.getCurrentExp(16) - a.Gg);
  1815.  
  1816.             a.wb = (a.skills.getCurrentExp(17) - a.db);
  1817.  
  1818.             a.t = (a.skills.getCurrentExp(23) - a.ND);
  1819.  
  1820.             a.Zf = (a.skills.getCurrentExp(15) - a.f);
  1821.  
  1822.             a.RB = (a.skills.getCurrentExp(22) - a.qc);
  1823.  
  1824.             a.AA = (a.skills.getCurrentExp(7) - a.pD);
  1825.  
  1826.             a.IA = (a.skills.getCurrentExp(10) - a.vA);
  1827.  
  1828.             a.KE = (a.skills.getCurrentExp(18) - a.e);
  1829.  
  1830.             a.LE = (a.skills.getCurrentExp(24) - a.JC);
  1831.  
  1832.             a.zC = (int)(3600000.0D / d1 * (a.ac + a.TC + a.rC + a.sD + a.yB + a.T + a.Vd));
  1833.  
  1834.             a.yF = (int)(3600000.0D / d1 * a.LE);
  1835.  
  1836.             a.HA = (int)(3600000.0D / d1 * (a.Db + a.sg + a.Ac + a.GC + a.UE + a.mc + a.n + a.wb + a.t + a.Zf + a.RB + a.AA + a.IA + a.KE));
  1837.  
  1838.             a.Ab = (Math.rint(3600000.0D / d1 * a.pC * 10.0D) / 10.0D);
  1839.           }
  1840.           if (a.h == 1)
  1841.           {
  1842.             a.setColor(a.QD);
  1843.  
  1844.             a.F(a, a.xd);
  1845.  
  1846.             a.setColor(a.iC.contains(a.Xe) ? a.C : a.MB);
  1847.  
  1848.             a.F(a, a.iC);
  1849.  
  1850.             a.setColor(a.tC.contains(a.Xe) ? a.C : a.MB);
  1851.  
  1852.             a.F(a, a.tC);
  1853.  
  1854.             a.setColor(a.Qd);
  1855.  
  1856.             a.draw3DRect(a.xd.x, a.xd.y, a.xd.width, a.xd.height, true);
  1857.  
  1858.             a.clearRect(a.xd.x + a.xd.width, a.xd.y + 1, 1, a.xd.height - 1);
  1859.  
  1860.             a.drawString("Total Time: " + a.z.toElapsedString(), 93, 380);
  1861.  
  1862.             a.drawString("Dung. Level: " + a.JA + " (+" + (a.JA - a.me) + ")", 93, 398);
  1863.  
  1864.             a.drawString("Exp Gained: " + a.LE, 93, 416);
  1865.  
  1866.             a.drawString("Exp per Hour: " + a.yF, 93, 434);
  1867.  
  1868.             a.drawString("Tokens Gained: " + a.Td, 93, 452);
  1869.  
  1870.             a.drawString("Dungeons Completed: " + a.pC, 295, 380);
  1871.  
  1872.             a.drawString("Floors per Hour: " + a.Ab, 295, 398);
  1873.  
  1874.             a.drawString("Dungeons Aborted: " + a.Ic, 295, 416);
  1875.  
  1876.             a.drawString("Total Deaths: " + a.Pd, 295, 434);
  1877.  
  1878.             a.drawString("Time to Level: " + a.XA(), 295, 452);
  1879.           }
  1880.           else if (a.h == 2)
  1881.           {
  1882.             localObject2 = "N/A";
  1883.  
  1884.             if (a.Rd == 1) {
  1885.               localObject2 = "Start";
  1886.             }
  1887.             else if (a.FF) {
  1888.               localObject2 = "Boss";
  1889.             }
  1890.             else if (a.Rd != 0)
  1891.               localObject2 = "" + a.Rd;
  1892.             a.setColor(a.xd.contains(a.Xe) ? a.C : a.MB);
  1893.  
  1894.             a.F(a, a.xd);
  1895.  
  1896.             a.setColor(a.QD);
  1897.  
  1898.             a.F(a, a.iC);
  1899.  
  1900.             a.setColor(a.tC.contains(a.Xe) ? a.C : a.MB);
  1901.  
  1902.             a.F(a, a.tC);
  1903.  
  1904.             a.setColor(a.Qd);
  1905.  
  1906.             a.draw3DRect(a.iC.x, a.iC.y, a.iC.width, a.iC.height, true);
  1907.  
  1908.             a.clearRect(a.iC.x + a.iC.width, a.iC.y + 1, 1, a.iC.height - 1);
  1909.  
  1910.             a.drawString("Floor Time: " + a.eb, 93, 380);
  1911.  
  1912.             a.drawString("Floor Type: " + a.ud, 93, 398);
  1913.  
  1914.             a.drawString("Floor Number: " + (a.Ud > 0 ? Integer.valueOf(a.Ud) : "??") + " (C" + a.Zc + ")", 93, 416);
  1915.  
  1916.             a.drawString("Current Room: " + (String)localObject2 + " (of " + a.Nc.size() + ")", 93, 434);
  1917.  
  1918.             a.drawString("Prestige Count: " + a.re, 93, 452);
  1919.  
  1920.             a.drawString("Progress: " + (a.g > 0 ? a.OA + " of " + a.g + " floors" : "Unknown"), 295, 380);
  1921.  
  1922.             a.drawString("Avg. Floor Time: " + a.tE + " mins", 295, 398);
  1923.  
  1924.             a.drawString("Fastest Dungeon: " + a.Xf, 295, 416);
  1925.  
  1926.             a.drawString("Slowest Dungeon: " + a.fd, 295, 434);
  1927.  
  1928.             a.drawString("Puzzles completed: " + a.uA, 295, 452);
  1929.           }
  1930.           else if (a.h == 3)
  1931.           {
  1932.             a.setColor(a.xd.contains(a.Xe) ? a.C : a.MB);
  1933.  
  1934.             a.F(a, a.xd);
  1935.  
  1936.             a.setColor(a.iC.contains(a.Xe) ? a.C : a.MB);
  1937.  
  1938.             a.F(a, a.iC);
  1939.  
  1940.             a.setColor(a.QD);
  1941.  
  1942.             a.F(a, a.tC);
  1943.  
  1944.             localObject2 = "";
  1945.  
  1946.             if (a.HC == 1)
  1947.             {
  1948.               if ((a.ac > 0) && (a.TC > 0))
  1949.                 localObject2 = "Controlled";
  1950.               else if (a.TC > 0)
  1951.               {
  1952.                 localObject2 = "Defensive";
  1953.               }
  1954.               else if (a.ac > 0) {
  1955.                 localObject2 = "Accurate";
  1956.               }
  1957.               else if (a.rC > 0)
  1958.               {
  1959.                 localObject2 = "Aggressive";
  1960.               }
  1961.               else
  1962.               {
  1963.                 localObject2 = "Unknown";
  1964.               }
  1965.             }
  1966.             else if (a.HC == 2) {
  1967.               localObject2 = a.TC > 0 ? "Longrange" : "Ranged";
  1968.             }
  1969.  
  1970.             a.setColor(a.Qd);
  1971.  
  1972.             a.draw3DRect(a.tC.x, a.tC.y, a.tC.width, a.tC.height, true);
  1973.  
  1974.             a.clearRect(a.tC.x + a.tC.width, a.tC.y + 1, 1, a.tC.height - 1);
  1975.  
  1976.             a.drawString("Cb Style: " + (String)localObject2, 93, 380);
  1977.  
  1978.             a.drawString("Cb exp/hr: " + a.zC, 93, 398);
  1979.  
  1980.             a.drawString("Prayer gain: " + a.Vd, 93, 416);
  1981.  
  1982.             a.drawString("Skills exp/hr: " + a.HA, 93, 434);
  1983.  
  1984.             a.drawString("Total exp/hr: " + (a.zC + a.yF + a.HA), 93, 452);
  1985.           }
  1986.           a.setFont(a.cb);
  1987.  
  1988.           a.setColor(a.Qd);
  1989.  
  1990.           a.drawString("Overview", 20, 384);
  1991.  
  1992.           a.drawString("Dungeons", 18, 415);
  1993.  
  1994.           a.drawString("Misc.", 33, 446);
  1995.  
  1996.           a.setColor(a.MB);
  1997.  
  1998.           a.fillRect(7, 361, 80, 2);
  1999.         }
  2000.         else if (a.H.contains(a.Xe))
  2001.         {
  2002.           a.setColor(a.sc);
  2003.  
  2004.           a.setFont(a.cb);
  2005.  
  2006.           a.drawString("Statistics", 21, 358);
  2007.  
  2008.           a.setFont(a.jd);
  2009.  
  2010.           a.setColor(a.C);
  2011.         }
  2012.         else
  2013.         {
  2014.           a.setColor(a.QD);
  2015.         }
  2016.         a.F(a, a.H);
  2017.  
  2018.         if (a.qD)
  2019.         {
  2020.           a.setColor(a.MB);
  2021.  
  2022.           a.fillRect(91, 361, 80, 2);
  2023.         }
  2024.         else if (a.m.contains(a.Xe))
  2025.         {
  2026.           a.setColor(a.sc);
  2027.  
  2028.           a.setFont(a.cb);
  2029.  
  2030.           a.drawString("Options", 110, 358);
  2031.  
  2032.           a.setFont(a.jd);
  2033.  
  2034.           a.setColor(a.C);
  2035.         }
  2036.         else
  2037.         {
  2038.           a.setColor(a.QD);
  2039.         }
  2040.         a.F(a, a.m);
  2041.         int i2;
  2042.         if ((a.qD) || ((a.dc) && (a.uB < 2)))
  2043.         {
  2044.           if (a.O[a.DC][i2] != 0)
  2045.           {
  2046.             if (a.ZC[a.DC][i2].contains(a.Xe)) {
  2047.               a.setColor(a.ZE);
  2048.             }
  2049.             else
  2050.             {
  2051.               a.setColor(a.wg);
  2052.             }
  2053.  
  2054.           }
  2055.           else if (a.ZC[a.DC][i2].contains(a.Xe)) {
  2056.             a.setColor(a.rc);
  2057.           }
  2058.           else
  2059.           {
  2060.             a.setColor(a.Cb);
  2061.           }
  2062.  
  2063.           a.F(a, a.ZC[a.DC][i2]);
  2064.  
  2065.           a.setColor(a.Qd);
  2066.  
  2067.           a.draw3DRect(a.ZC[a.DC][i2].x, a.ZC[a.DC][i2].y, a.ZC[a.DC][i2].width, a.ZC[a.DC][i2].height, true);
  2068.  
  2069.           i2++;
  2070.         }
  2071.  
  2072.         if ((a.qD) || (a.uB == 1))
  2073.         {
  2074.           if (a.DC == 1)
  2075.           {
  2076.             a.setColor(a.QD);
  2077.  
  2078.             a.F(a, a.xd);
  2079.  
  2080.             a.setColor(a.iC.contains(a.Xe) ? a.C : a.MB);
  2081.  
  2082.             a.F(a, a.iC);
  2083.  
  2084.             a.setColor(a.tC.contains(a.Xe) ? a.C : a.MB);
  2085.  
  2086.             a.F(a, a.tC);
  2087.  
  2088.             a.setColor(a.Qd);
  2089.  
  2090.             a.draw3DRect(a.xd.x, a.xd.y, a.xd.width, a.xd.height, true);
  2091.  
  2092.             a.clearRect(a.xd.x + a.xd.width, a.xd.y + 1, 1, a.xd.height - 1);
  2093.  
  2094.             a.drawString("Bones", 190, 387);
  2095.  
  2096.             a.drawString("Arrows", 290, 387);
  2097.  
  2098.             a.drawString("Heim crabs", 390, 387);
  2099.  
  2100.             a.drawString("Prayers", 190, 409);
  2101.  
  2102.             a.drawString("Quick pray", 290, 409);
  2103.  
  2104.             a.drawString("Pray doors", 390, 409);
  2105.  
  2106.             a.drawString("Pure mode", 190, 431);
  2107.  
  2108.             a.drawString("Style swap", 290, 431);
  2109.  
  2110.             a.drawString("Occult floors", 390, 431);
  2111.  
  2112.             a.setColor(a.ub);
  2113.  
  2114.             a.drawString("Pickup:", 118, 387);
  2115.  
  2116.             a.drawString("Prayer:", 118, 409);
  2117.  
  2118.             a.drawString("Other:", 123, 431);
  2119.           }
  2120.           else if (a.DC == 2)
  2121.           {
  2122.             a.setColor(a.xd.contains(a.Xe) ? a.C : a.MB);
  2123.  
  2124.             a.F(a, a.xd);
  2125.  
  2126.             a.setColor(a.QD);
  2127.  
  2128.             a.F(a, a.iC);
  2129.  
  2130.             a.setColor(a.tC.contains(a.Xe) ? a.C : a.MB);
  2131.  
  2132.             a.F(a, a.tC);
  2133.  
  2134.             a.setColor(a.Qd);
  2135.  
  2136.             a.draw3DRect(a.iC.x, a.iC.y, a.iC.width, a.iC.height, true);
  2137.  
  2138.             a.clearRect(a.iC.x + a.iC.width, a.iC.y + 1, 1, a.iC.height - 1);
  2139.  
  2140.             a.setColor(a.MA);
  2141.  
  2142.             a.fillRect(124, 403, 19, 19);
  2143.  
  2144.             a.fillRect(310, 403, 19, 19);
  2145.  
  2146.             a.fillRect(380, 403, 22, 19);
  2147.  
  2148.             a.setColor(a.cA);
  2149.  
  2150.             a.draw3DRect(124, 403, 19, 19, true);
  2151.  
  2152.             a.draw3DRect(310, 403, 19, 19, true);
  2153.  
  2154.             a.draw3DRect(380, 403, 22, 19, true);
  2155.  
  2156.             a.setColor(a.ub);
  2157.  
  2158.             a.drawString("Complexity:", 93, 382);
  2159.  
  2160.             a.drawString("Rush Settings:", 270, 382);
  2161.  
  2162.             a.drawString("" + a.dC, 130, 418);
  2163.  
  2164.             a.drawString("" + a.ld, 316, 418);
  2165.  
  2166.             a.drawString("" + a.td, a.td < 10 ? 387 : 383, 418);
  2167.  
  2168.             a.setColor(a.Qd);
  2169.  
  2170.             a.drawString("Enabled", 391, 383);
  2171.  
  2172.             a.drawString("Prestige", 197, 386);
  2173.  
  2174.             a.drawString("Medium", 197, 408);
  2175.  
  2176.             a.drawString("Debug", 197, 430);
  2177.  
  2178.             a.drawString("Recording", 197, 452);
  2179.  
  2180.             a.drawString("Complexity", 280, 452);
  2181.  
  2182.             a.drawString("To floor", 365, 452);
  2183.  
  2184.             a.drawString("Grab food", 436, 404);
  2185.  
  2186.             a.drawImage(a.V.contains(a.Xe) ? a.OE : a.Dd, 124, 387, null);
  2187.  
  2188.             a.drawImage(a.Ub.contains(a.Xe) ? a.iG : a.gD, 124, 422, null);
  2189.  
  2190.             a.drawImage(a.lb.contains(a.Xe) ? a.OE : a.Dd, 310, 387, null);
  2191.  
  2192.             a.drawImage(a.p.contains(a.Xe) ? a.iG : a.gD, 310, 422, null);
  2193.  
  2194.             a.drawImage(a.qf.contains(a.Xe) ? a.OE : a.Dd, 381, 387, null);
  2195.  
  2196.             a.drawImage(a.D.contains(a.Xe) ? a.iG : a.gD, 381, 422, null);
  2197.           }
  2198.           else if ((a.DC == 3) && (!a.dc))
  2199.           {
  2200.             a.setColor(a.xd.contains(a.Xe) ? a.C : a.MB);
  2201.  
  2202.             a.F(a, a.xd);
  2203.  
  2204.             a.setColor(a.iC.contains(a.Xe) ? a.C : a.MB);
  2205.  
  2206.             a.F(a, a.iC);
  2207.  
  2208.             a.setColor(a.QD);
  2209.  
  2210.             a.F(a, a.tC);
  2211.  
  2212.             a.setColor(a.ub);
  2213.  
  2214.             a.drawString("Loot item:", a.ff.x, a.ff.y - 5);
  2215.  
  2216.             a.setColor(a.MA);
  2217.  
  2218.             a.F(a, a.ff);
  2219.  
  2220.             a.setColor(a.Qd);
  2221.  
  2222.             a.draw3DRect(a.tC.x, a.tC.y, a.tC.width, a.tC.height, true);
  2223.  
  2224.             a.clearRect(a.tC.x + a.tC.width, a.tC.y + 1, 1, a.tC.height - 1);
  2225.  
  2226.             a.drawString("You'll need an extra bound item slot to use this feature.", a.ff.x, a.ff.y + 35);
  2227.  
  2228.             a.drawString("Type in the item name (case-insensitive) you wish to look for.", a.ff.x, a.ff.y + 50);
  2229.  
  2230.             a.l(a, a.ff);
  2231.  
  2232.             if ((a.ce.isEmpty()) && (a.PA != 0))
  2233.             {
  2234.               a.setColor(a.Oc);
  2235.  
  2236.               a.drawString("Item name", a.ff.x + 4, a.ff.y + 14);
  2237.             }
  2238.             else
  2239.             {
  2240.               a.drawString(a.PA == 0 ? a.ce + "_" : a.ce, a.ff.x + 4, a.ff.y + 15);
  2241.             }
  2242.  
  2243.           }
  2244.  
  2245.           a.setFont(a.cb);
  2246.  
  2247.           a.setColor(a.Qd);
  2248.  
  2249.           a.drawString("General", 23, 383);
  2250.  
  2251.           a.drawString("Complexity", 15, 415);
  2252.  
  2253.           if (!a.dc) {
  2254.             a.drawString("Extras", 28, 447);
  2255.           }
  2256.  
  2257.         }
  2258.  
  2259.         if (a.dc)
  2260.         {
  2261.           a.setFont(a.jd);
  2262.  
  2263.           if (a.uB > 0)
  2264.           {
  2265.             if (a.fD.contains(a.Xe))
  2266.             {
  2267.               a.setColor(a.QD);
  2268.  
  2269.               a.drawString("Back", 31, 450);
  2270.  
  2271.               a.setColor(a.Eb);
  2272.             }
  2273.             else
  2274.             {
  2275.               a.setColor(a.YA);
  2276.             }
  2277.             a.F(a, a.fD);
  2278.  
  2279.             a.setColor(a.Qd);
  2280.  
  2281.             a.draw3DRect(a.fD.x, a.fD.y, a.fD.width, a.fD.height, true);
  2282.  
  2283.             a.setColor(a.ub);
  2284.  
  2285.             a.drawString("Back", 32, 451);
  2286.           }
  2287.  
  2288.           if (a.Vb.contains(a.Xe))
  2289.           {
  2290.             a.setColor(a.QD);
  2291.  
  2292.             a.drawString("Continue", 442, 450);
  2293.  
  2294.             a.setColor(a.Eb);
  2295.           }
  2296.           else
  2297.           {
  2298.             a.setColor(a.YA);
  2299.           }
  2300.  
  2301.           a.F(a, a.Vb);
  2302.  
  2303.           a.setColor(a.Qd);
  2304.  
  2305.           a.draw3DRect(a.Vb.x, a.Vb.y, a.Vb.width, a.Vb.height, true);
  2306.  
  2307.           a.setColor(a.ub);
  2308.  
  2309.           a.drawString("Continue", 443, 451);
  2310.  
  2311.           if (a.uB == 0)
  2312.           {
  2313.             a.setColor(a.ub);
  2314.  
  2315.             a.drawString("Choose your primary combat style", 15, 382);
  2316.  
  2317.             a.drawString("Choose your secondary combat style", 15, 422);
  2318.  
  2319.             a.drawString("Settings options:", 300, 382);
  2320.  
  2321.             a.setColor(a.Qd);
  2322.  
  2323.             a.drawString("Melee", 50, 402);
  2324.  
  2325.             a.drawString("Range", 130, 402);
  2326.  
  2327.             a.drawString("Magic", 210, 402);
  2328.  
  2329.             a.drawString("Melee", 50, 442);
  2330.  
  2331.             a.drawString("Range", 130, 442);
  2332.  
  2333.             a.drawString("Magic", 210, 442);
  2334.  
  2335.             a.drawString("Load settings on start", 333, 402);
  2336.  
  2337.             a.drawString("Save them for next time", 333, 425);
  2338.           }
  2339.           else if (a.uB == 2)
  2340.           {
  2341.             if (a.IB)
  2342.             {
  2343.               a.setColor(a.ub);
  2344.  
  2345.               a.drawString("Wield your staff and/or blastbox to use.", 15, 380);
  2346.  
  2347.               a.drawString("Then turn the spell you want to use to autocast.", 15, 395);
  2348.  
  2349.               if (a.k())
  2350.               {
  2351.                 if (
  2352.                   (i2 = a.kA()) > 0)
  2353.                 {
  2354.                   a.Qb = i2;
  2355.                 }
  2356.                 a.setColor(a.Qd);
  2357.  
  2358.                 a.drawString("Spell selected: " + a.Qb, 15, 415);
  2359.               }
  2360.  
  2361.             }
  2362.             else if (a.Xd)
  2363.             {
  2364.               a.setColor(a.ub);
  2365.  
  2366.               a.drawString("Bind and wield the arrows you would like to use.", 15, 380);
  2367.             }
  2368.             else
  2369.             {
  2370.               a.uB = (++a.uB);
  2371.             }
  2372.           }
  2373.           else if (a.uB == 3)
  2374.           {
  2375.             if (a.i)
  2376.             {
  2377.               String str1 = "";
  2378.  
  2379.               a.setColor(a.ub);
  2380.  
  2381.               if (a.k)
  2382.               {
  2383.                 a.drawString("You'll need a secondary crush weapon for this mode.", 15, 380);
  2384.  
  2385.                 a.drawString("Right click the item and select 'Use'.", 15, 395);
  2386.               }
  2387.               else
  2388.               {
  2389.                 a.drawString("Select your backup Melee weapon.", 15, 380);
  2390.  
  2391.                 a.drawString("Right click the item and select 'Use'.", 15, 395);
  2392.               }
  2393.               if (a.game.getCurrentTab() == 4)
  2394.               {
  2395.                 if ((localObject1 = a.inventory.getSelectedItem()) != null)
  2396.                 {
  2397.                   a.eB = ((RSItem)localObject1).getID();
  2398.  
  2399.                   str1 = a.l((RSItem)localObject1);
  2400.                 }
  2401.  
  2402.               }
  2403.  
  2404.               if (a.eB > 0)
  2405.               {
  2406.                 a.setColor(a.Qd);
  2407.  
  2408.                 a.drawString("Secondary Weapon: " + (!str1.isEmpty() ? str1 : Integer.valueOf(a.eB)), 15, 415);
  2409.               }
  2410.             }
  2411.             else if (a.vC)
  2412.             {
  2413.               a.setColor(a.ub);
  2414.  
  2415.               a.drawString("You'll need a filled blastbox or combat runes to use secondary magic.", 15, 380);
  2416.  
  2417.               a.drawString("Autocast the spell to use, then return the items to your inventory.", 15, 395);
  2418.  
  2419.               if (a.k())
  2420.               {
  2421.                 int i3;
  2422.                 if ((i3 = a.kA()) > 0) {
  2423.                   a.Qb = i3;
  2424.                 }
  2425.  
  2426.                 if (a.game.getCurrentTab() == 4)
  2427.                 {
  2428.                   int i5 = a.inventory.getItemID("staff (b)");
  2429.                   int i6;
  2430.                   if ((i6 = a.inventory.getItemID("blastbox (b)")) ==
  2431.                     -1) {
  2432.                     i6 = a.inventory.getItemID("surgebox (b)");
  2433.                   }
  2434.  
  2435.                   if (i6 > 0) {
  2436.                     a.pB = i6;
  2437.                   }
  2438.  
  2439.                   if (i5 > 0)
  2440.                   {
  2441.                     a.eB = i5;
  2442.                   }
  2443.                 }
  2444.                 a.setColor(a.Qd);
  2445.  
  2446.                 a.drawString("Spell selected: " + a.Qb + ", Staff: " + ((a.eB > 0) && (a.game.getCurrentTab() == 4) ? a.J(a.l(a.inventory.getItem(new int[] { a.eB }))) : "None") + ", Blastbox: " + (a.pB > 0 ? "Yes" : "No"), 15, 415);
  2447.               }
  2448.  
  2449.             }
  2450.             else if (a.BB)
  2451.             {
  2452.               RSItem localRSItem = null;
  2453.  
  2454.               String str2 = "";
  2455.  
  2456.               a.setColor(a.ub);
  2457.  
  2458.               a.drawString("BIND the bow and arrows you would like to use.", 15, 380);
  2459.  
  2460.               a.drawString("Equip the arrows and leave the bow in your inventory.", 15, 395);
  2461.  
  2462.               a.drawString("Right click the bow and select 'Use'.", 15, 410);
  2463.  
  2464.               if (a.game.getCurrentTab() == 4) {
  2465.                 localRSItem = a.inventory.getSelectedItem();
  2466.               }
  2467.  
  2468.               if (localRSItem != null)
  2469.               {
  2470.                 a.eB = localRSItem.getID();
  2471.  
  2472.                 str2 = a.l(localRSItem);
  2473.               }
  2474.  
  2475.               if (a.eB > 1) {
  2476.                 a.drawString("Secondary Weapon: " + str2, 15, 425);
  2477.               }
  2478.  
  2479.             }
  2480.             else
  2481.             {
  2482.               a.uB = (++a.uB);
  2483.             }
  2484.           }
  2485.           else if (a.uB == 4)
  2486.           {
  2487.             a.setColor(a.ub);
  2488.  
  2489.             a.drawString("Be sure to bind and wield the primary weapon you would like to use.", 15, 380);
  2490.  
  2491.             a.drawString("Leave any unbound armor in your inventory.", 15, 395);
  2492.  
  2493.             a.drawString("Then press continue to finish the settings.", 15, 421);
  2494.           }
  2495.  
  2496.           a.setColor(a.QD);
  2497.  
  2498.           a.fillRect(175, 361, 222, 2);
  2499.         }
  2500.         a.setColor(a.vg.contains(a.Xe) ? a.MB : a.QD);
  2501.  
  2502.         a.F(a, a.vg);
  2503.  
  2504.         if (a.vg.contains(a.Xe))
  2505.         {
  2506.           a.setColor(a.sc);
  2507.  
  2508.           if (!a.dc)
  2509.           {
  2510.             if ((!a.Pf.contains(a.Xe)) || (a.pA.isEmpty()))
  2511.             {
  2512.               if ((a.AB.isEmpty()) || (!a.ZB))
  2513.               {
  2514.                 a.drawString(a.Qc, 181, 358);
  2515.               }
  2516.               else
  2517.               {
  2518.                 a.drawString("+ " + a.AB, 181, 358);
  2519.               }
  2520.  
  2521.             }
  2522.             else
  2523.             {
  2524.               a.drawString(a.pA, 181, 358);
  2525.             }
  2526.           }
  2527.           else {
  2528.             a.drawString(a.Nd, 181, 358);
  2529.           }
  2530.  
  2531.         }
  2532.  
  2533.         a.setColor(a.eA);
  2534.  
  2535.         a.setFont(a.cb);
  2536.  
  2537.         a.drawString("Statistics", 20, 357);
  2538.  
  2539.         a.drawString("Options", 109, 357);
  2540.  
  2541.         if (!a.dc)
  2542.         {
  2543.           if ((a.pA.isEmpty()) || (!a.Pf.contains(a.Xe)))
  2544.           {
  2545.             a.setColor(a.wg);
  2546.  
  2547.             a.drawString("+ " + a.AB, 180, 357);
  2548.           }
  2549.           else
  2550.           {
  2551.             a.setColor(a.EC);
  2552.  
  2553.             a.drawString(a.pA, 180, 357);
  2554.           }
  2555.         }
  2556.         else
  2557.           a.drawString(a.Nd, 180, 357);
  2558.         a.setColor(a.eA);
  2559.  
  2560.         if (!a.le)
  2561.         {
  2562.           a.setFont(a.Kb);
  2563.  
  2564.           a.drawString("v1.07", 484, 455);
  2565.         }
  2566.  
  2567.         a.setFont(a.jd);
  2568.  
  2569.         a.drawString((a.bF != 0 ? "Highscores rank: " + a.bF + " || " : "") + (a.jB != 0 ? a.jB + " users online || " : "") + "by kiko & ShadowMoose", 91 + a.mf + a.tB, 471);
  2570.       }
  2571.  
  2572.       a.setColor(a.QD);
  2573.  
  2574.       a.setFont(a.SB);
  2575.  
  2576.       a.F(a, a.Pf);
  2577.  
  2578.       if (a.Pf.contains(a.Xe))
  2579.       {
  2580.         if (!a.qd)
  2581.         {
  2582.           a.drawImage(a.kc.contains(a.Xe) ? a.Ib : a.Kd, a.kc.x, a.kc.y, null);
  2583.         }
  2584.         else {
  2585.           a.drawImage(a.kc.contains(a.Xe) ? a.VC : a.KG, a.kc.x, a.kc.y, null);
  2586.         }
  2587.  
  2588.         a.drawImage(a.Rb.contains(a.Xe) ? a.Uc : a.oA, a.Rb.x, a.Rb.y, null);
  2589.  
  2590.         a.drawImage(a.Q.contains(a.Xe) ? a.hb : a.UF, a.Q.x, a.Q.y, null);
  2591.  
  2592.         a.drawImage(a.Pg.contains(a.Xe) ? a.BC : a.We, a.Pg.x, a.Pg.y, null);
  2593.       }
  2594.       else
  2595.       {
  2596.         a.drawImage(a.Hg, a.Pf.x, a.Pf.y, null);
  2597.       }
  2598.  
  2599.       a.drawImage(a.ag.contains(a.Xe) ? a.rD : a.NB, a.ag.x, a.ag.y, null);
  2600.     }
  2601.   }
  2602.  
  2603.   private boolean Hb()
  2604.   {
  2605.     return (a.combat.isPoisoned()) && (a.inventory.contains(17566)) && (a.F(a.LC) == null) && (a.l(17566, "Drink"));
  2606.   }
  2607.  
  2608.   private void kD()
  2609.   {
  2610.     if (a.PB != null)
  2611.     {
  2612.       String[] arrayOfString;
  2613.       int i1 = (arrayOfString = a.PB).length;
  2614.       int i2;
  2615.       String str;
  2616.       int i3;
  2617.       int i5;
  2618.       if ((
  2619.         (str = arrayOfString[i2]) != null) && (!str.isEmpty()) && ((i3 = a.inventory.getItemID(str)) > 0))
  2620.       {
  2621.         RSItem localRSItem = a.inventory.getItem(new int[] { i3 });
  2622.  
  2623.         int i4 = a.F(str);
  2624.  
  2625.         if ((localRSItem != null) && (i4 > 0))
  2626.         {
  2627.           if ((a.l(str, a.wC[i5])) && (i4 > a.Sb[i5]) && (a.l(i3, "Wear")))
  2628.           {
  2629.             a.Sb[i5] = i4;
  2630.           }
  2631.           i5++;
  2632.         }
  2633.  
  2634.       }
  2635.  
  2636.       i2++;
  2637.  
  2638.       a.PB = new String[a.Sb.length];
  2639.     }
  2640.   }
  2641.  
  2642.   private void Tb()
  2643.   {
  2644.     if (a.Yb)
  2645.     {
  2646.       try
  2647.       {
  2648.         BufferedWriter localBufferedWriter = new BufferedWriter(new FileWriter(a.rA));
  2649.  
  2650.         a.O[0][7] = 0;
  2651.         int i1;
  2652.         int i2;
  2653.         localBufferedWriter.write("" + i1 + i2 + "=" + a.O[i1][i2]);
  2654.  
  2655.         localBufferedWriter.newLine();
  2656.  
  2657.         i2++;
  2658.  
  2659.         i1++;
  2660.  
  2661.         localBufferedWriter.close();
  2662.       }
  2663.       catch (Exception localException1)
  2664.       {
  2665.         a.log.severe("Error saving settings");
  2666.       }
  2667.     }
  2668.   }
  2669.  
  2670.   private void ad()
  2671.   {
  2672.     RSComponent localRSComponent;
  2673.     if ((localRSComponent = a.interfaces.getComponent(939, 83))
  2674.       .isValid())
  2675.     {
  2676.       a.OA = Integer.parseInt(localRSComponent.getText().trim());
  2677.  
  2678.       a.Ud = (a.OA + 1);
  2679.     }
  2680.     else if ((localRSComponent = a.interfaces.getComponent(933, 240))
  2681.       .isValid())
  2682.     {
  2683.       try
  2684.       {
  2685.         a.OA = Integer.parseInt(localRSComponent.getText().replace("Floor ", "").replace(":", ""));
  2686.  
  2687.         a.Ud = (a.OA + 1);
  2688.       }
  2689.       catch (Exception localException)
  2690.       {
  2691.         if (a.UA)
  2692.           a.log(localException);
  2693.       }
  2694.     }
  2695.     a.g = ((a.skills.getRealLevel(24) + 1) / 2);
  2696.  
  2697.     a.JA = a.skills.getRealLevel(24);
  2698.  
  2699.     if (a.g > 35)
  2700.       if ((!a.kd) || (!a.Fb))
  2701.       {
  2702.         a.g = 35;
  2703.       }
  2704.       else if (a.g > 47)
  2705.       {
  2706.         a.g = 47;
  2707.       }
  2708.     if ((!a.nA) && (a.g < 18))
  2709.     {
  2710.       a.td = a.g;
  2711.     }
  2712.   }
  2713.  
  2714.   private boolean rb()
  2715.   {
  2716.     a.uA();
  2717.  
  2718.     Object localObject1 = null;
  2719.  
  2720.     if ((a.FA != null) && (a.r != null) && (!a.FA.equals(a.r)))
  2721.     {
  2722.       if (a.Zc())
  2723.       {
  2724.         return false;
  2725.       }
  2726.       if (a.nb != null) if (a.nb.contains(new RSTile[] { a.X() }))
  2727.         {
  2728.           a.l(a.nb);
  2729.  
  2730.           a.FF = true;
  2731.  
  2732.           return false;
  2733.         }
  2734.       if (a.nD != null) if ((a.FA.contains(new RSTile[] { a.nD })) && ((a.Fg) || (a.AB.contains("dead end")))) {
  2735.           return false;
  2736.         }
  2737.  
  2738.  
  2739.       if ((a.Qc.contains("Teleporting")) && (a.jb != null)) if (a.jb.contains(new RSTile[] { a.X() }))
  2740.           return false;
  2741.       if (a.nD != null) if (a.FA.contains(new RSTile[] { a.nD }))
  2742.         {
  2743.           localObject1 = a.nD; break label373;
  2744.         }
  2745.       for (Object localObject2 = a.fA.iterator(); ((Iterator)localObject2).hasNext(); ) { localRSTile = (RSTile)((Iterator)localObject2).next();
  2746.  
  2747.         if ((a.FA.contains(new RSTile[] { localRSTile })) && (a.calc.distanceBetween(localRSTile, a.r.getNearestTile(localRSTile)) < 2.0D))
  2748.         {
  2749.           localObject1 = localRSTile;
  2750.  
  2751.           break;
  2752.         }
  2753.       }
  2754.       RSTile localRSTile;
  2755.       if (localObject1 == null)
  2756.       {
  2757.         for (localObject2 = a.fc.iterator(); ((Iterator)localObject2).hasNext(); ) { localRSTile = (RSTile)((Iterator)localObject2).next();
  2758.  
  2759.           if ((a.FA.contains(new RSTile[] { localRSTile })) && (a.calc.distanceBetween(localRSTile, a.r.getNearestTile(localRSTile)) < 2.0D))
  2760.           {
  2761.             localObject1 = localRSTile;
  2762.  
  2763.             break;
  2764.           }
  2765.  
  2766.         }
  2767.  
  2768.       }
  2769.  
  2770.       label373: if (localObject1 == null)
  2771.       {
  2772.         return false;
  2773.       }
  2774.       a.log("Correcting an accidental backtrack");
  2775.  
  2776.       if (a.AB.contains("monsters"))
  2777.       {
  2778.         a.Ic();
  2779.       }
  2780.       if (localObject1 != null)
  2781.       {
  2782.         if (a.Zc()) {
  2783.           return true;
  2784.         }
  2785.  
  2786.         localObject2 = a.G((RSTile)localObject1);
  2787.  
  2788.         if (a.l((RSObject)localObject2))
  2789.         {
  2790.           a.K(true);
  2791.         }
  2792.         a.sleep(400, 600);
  2793.  
  2794.         a.uA();
  2795.       }
  2796.  
  2797.     }
  2798.  
  2799.     return false;
  2800.   }
  2801.  
  2802.   private void D(RSNPC a)
  2803.   {
  2804.     if (a != null)
  2805.     {
  2806.       String str = a.getName();
  2807.  
  2808.       if ((a.bC != -1) && (a.l(str, a.kD)))
  2809.       {
  2810.         a.PD = a.bC;
  2811.       }
  2812.       else if ((a.xb != -1) && (a.l(str, a.Cc)))
  2813.       {
  2814.         a.PD = a.xb;
  2815.       }
  2816.       else if ((a.Gd != -1) && (a.l(str, a.Y)))
  2817.       {
  2818.         a.PD = a.Gd;
  2819.       }
  2820.       else
  2821.         a.PD = -1;
  2822.     }
  2823.   }
  2824.  
  2825.   private boolean Ic()
  2826.   {
  2827.     String str = a.AB;
  2828.  
  2829.     a.AB = "Om nom nom!";
  2830.  
  2831.     if (!a.AB.equals(str))
  2832.     {
  2833.       a.AB = str;
  2834.  
  2835.       return true;
  2836.     }
  2837.  
  2838.     return false;
  2839.   }
  2840.  
  2841.   private void Qd()
  2842.   {
  2843.     RSNPC localRSNPC1 = a.i(new String[] { "Rammernaut" });
  2844.  
  2845.     RSNPC localRSNPC2 = a.i(new String[] { "Stomp" });
  2846.  
  2847.     RSNPC localRSNPC3 = a.i(new String[] { "Riftsplitter" });
  2848.  
  2849.     RSNPC localRSNPC4 = a.i(new String[] { "Lexicus" });
  2850.  
  2851.     RSNPC localRSNPC5 = a.i(new String[] { "Khighorahk" });
  2852.  
  2853.     a.l(a.UC, 50, 60);
  2854.     Object localObject1;
  2855.     int i2;
  2856.     int i5;
  2857.     int i6;
  2858.     Object localObject7;
  2859.     Object localObject8;
  2860.     int i4;
  2861.     if ((a.tc.equals("Rammernaut")) || (localRSNPC1 != null))
  2862.     {
  2863.       localObject1 = null;
  2864.  
  2865.       i2 = 0;
  2866.  
  2867.       a.Qc = "Killing Rammernaut!";
  2868.  
  2869.       if (a.tc.isEmpty())
  2870.       {
  2871.         a.log(a.Qc);
  2872.  
  2873.         a.tc = "Rammernaut";
  2874.       }
  2875.       a.l(a.QC, Combat.Prayer.PROTECT_FROM_MELEE, true);
  2876.  
  2877.       if ((!a.iD) || (!a.i(3)))
  2878.       {
  2879.         a.PD = a.bC;
  2880.       }
  2881.       if (a.jA())
  2882.       {
  2883.         return;
  2884.       }
  2885.       if (localRSNPC1 != null)
  2886.       {
  2887.         if ((localRSNPC1.getMessage() != null) && (localObject1 != null) && (((String)localObject1).equals(localRSNPC1.getMessage())))
  2888.         {
  2889.           i2 = 0;
  2890.         }
  2891.         else
  2892.         {
  2893.           localObject1 = localRSNPC1.getMessage();
  2894.  
  2895.           i2 = 1;
  2896.         }
  2897.  
  2898.         if ((i2 != 0) && (localObject1 != null) && (((String)localObject1).contains("CHAA")))
  2899.         {
  2900.           a.AB = "Running for cover!";
  2901.           RSObject[] arrayOfRSObject1;
  2902.           i5 = (arrayOfRSObject1 = a.J(new int[] { 51762 })).length; if ((i6 = 0) < i5)
  2903.           {
  2904.             if (
  2905.               (localObject7 = arrayOfRSObject1[i6]) != null)
  2906.             {
  2907.               localObject8 = ((RSObject)localObject7).getLocation();
  2908.  
  2909.               a.vE = ((RSTile)localObject8);
  2910.             }
  2911.             i6++;
  2912.           }
  2913.           if (a.vE != null)
  2914.           {
  2915.             a.l(a.vE, 1);
  2916.  
  2917.             if ((i4 = 0) < 10)
  2918.             {
  2919.               if (!a.JC())
  2920.               {
  2921.                 a.sleep(400, 600);
  2922.               }
  2923.  
  2924.               i4++;
  2925.             }
  2926.             if ((i4 = 0) < 20)
  2927.             {
  2928.               a.sleep(200, 300);
  2929.  
  2930.               if ((localRSNPC1 == null) || (localRSNPC1.getMessage() == null))
  2931.               {
  2932.                 i4++;
  2933.               }
  2934.  
  2935.             }
  2936.  
  2937.           }
  2938.  
  2939.           a.AB = "";
  2940.         }
  2941.         else if (localRSNPC1.getAnimation() == 13705)
  2942.         {
  2943.           a.JC();
  2944.         }
  2945.         else if ((a.calc.distanceTo(localRSNPC1) < 3) && (!a.Y().isInCombat()) && (!localRSNPC1.isInCombat()))
  2946.         {
  2947.           a.A(a.FA.getCentralTile(), 3);
  2948.         }
  2949.         a.i(localRSNPC1);
  2950.  
  2951.         a.l(a.UC, 50, 0);
  2952.       }
  2953.  
  2954.       a.sleep(100, 200);
  2955.     }
  2956.     else
  2957.     {
  2958.       int[][] arrayOfInt1;
  2959.       RSTile localRSTile3;
  2960.       Object localObject9;
  2961.       Object localObject10;
  2962.       if ((a.tc.equals("Stomp")) || (localRSNPC2 != null))
  2963.       {
  2964.         localObject1 = new ArrayList();
  2965.  
  2966.         i2 = 0; i4 = 0; i5 = 0; i6 = a.random(12, 15);
  2967.  
  2968.         localObject7 = new int[] { 49278, 49279 };
  2969.  
  2970.         localObject8 = new int[] { 49276, 49277 };
  2971.  
  2972.         int[] arrayOfInt = { 49274, 49275 };
  2973.  
  2974.         arrayOfInt1 = new int[][] { localObject7, localObject8, arrayOfInt };
  2975.  
  2976.         a.Qc = "Killing Stomp!";
  2977.  
  2978.         if (a.tc.isEmpty())
  2979.         {
  2980.           a.log(a.Qc);
  2981.  
  2982.           a.tc = "Stomp";
  2983.         }
  2984.  
  2985.         a.l(a.QC, null, false);
  2986.  
  2987.         a.PD = a.bC;
  2988.  
  2989.         localRSTile3 = a.tA(); localObject9 = localRSNPC2.getLocation();
  2990.  
  2991.         if (localRSTile3 != null)
  2992.         {
  2993.           if (localRSTile3.getX() - ((RSTile)localObject9).getX() > 3) {
  2994.             i4 = 1;
  2995.           }
  2996.           else if (localRSTile3.getX() - ((RSTile)localObject9).getX() < -3)
  2997.             i4 = -1;
  2998.           if (localRSTile3.getY() - ((RSTile)localObject9).getY() > 3)
  2999.           {
  3000.             i5 = 1;
  3001.           }
  3002.           else if (localRSTile3.getY() - ((RSTile)localObject9).getY() < -3)
  3003.           {
  3004.             i5 = -1;
  3005.           }
  3006.         }
  3007.         RSObject[] arrayOfRSObject2;
  3008.         int i12 = (arrayOfRSObject2 = a.A(new String[] { "lodestone" })).length;
  3009.         int i13;
  3010.         RSObject localRSObject2 = arrayOfRSObject2[i13];
  3011.  
  3012.         ((ArrayList)localObject1).add(new RSTile(localRSObject2.getLocation().getX() + i4, localRSObject2.getLocation().getY() + i5));
  3013.  
  3014.         i13++;
  3015.  
  3016.         if (a.jA()) {
  3017.           return;
  3018.         }
  3019.  
  3020.         if (a.i(a.tb) != null)
  3021.         {
  3022.           int i11 = 1;
  3023.  
  3024.           i12 = 2;
  3025.  
  3026.           Timer localTimer = new Timer(a.random(14000, 16000));
  3027.  
  3028.           a.RD.clear();
  3029.  
  3030.           i6 = a.random(13, 17);
  3031.  
  3032.           a.sleep(500, 1000);
  3033.  
  3034.           if (a.objects.getNearest(arrayOfInt1[i14]) != null)
  3035.           {
  3036.             i2 = 1 + i14;
  3037.           }
  3038.           else {
  3039.             i14++;
  3040.           }
  3041.  
  3042.           if (i2 < 1) {
  3043.             i2 = 1;
  3044.           }
  3045.  
  3046.           int i14 = 15749 + i2;
  3047.  
  3048.           a.Qc = ("Killing Stomp (stage " + i2 + " of 3)");
  3049.  
  3050.           a.SE = "";
  3051.  
  3052.           for (Iterator localIterator2 = ((ArrayList)localObject1).iterator(); localIterator2.hasNext(); ) { localObject11 = (RSTile)localIterator2.next();
  3053.  
  3054.             if ((!a.X().equals(localObject11)) && (a.G((RSTile)localObject11) != null)) {
  3055.               i12--;
  3056.             }
  3057.             else if (!a.l((RSTile)localObject11, false))
  3058.             {
  3059.               a.log("This lodestone may be unreachable");
  3060.             }
  3061.           }
  3062.           Object localObject11;
  3063.           while (a.i(a.tb) != null)
  3064.           {
  3065.             if (a.jA())
  3066.             {
  3067.               return;
  3068.             }
  3069.             int i15 = 2;
  3070.  
  3071.             a.MC = false;
  3072.  
  3073.             if ((i12 == 2) && (
  3074.               (localObject11 = a.J(a.tb)) != null))
  3075.             {
  3076.               i15 = localObject11.length;
  3077.             }
  3078.             if (a.inventory.getCount(new int[] { i14 }) < i15)
  3079.             {
  3080.               if ((localObject11 = a.groundItems.getNearest(a.lD)) != null)
  3081.               {
  3082.                 if ((i11 != 0) && (a.l((RSGroundItem)localObject11)))
  3083.                 {
  3084.                   a.K(false);
  3085.                 }
  3086.                 if (a.MC)
  3087.                 {
  3088.                   a.RD.add(((RSGroundItem)localObject11).getLocation());
  3089.                 }
  3090.               }
  3091.               else
  3092.               {
  3093.                 if ((a.calc.distanceTo(localRSNPC2) > 4) && (!a.Y().isMoving()))
  3094.                   a.A(localRSNPC2.getLocation(), 1);
  3095.                 else if ((!a.JC()) && (!a.SE.contains("currently invulnerable")))
  3096.                 {
  3097.                   a.F(localRSNPC2, "Attack");
  3098.                 }
  3099.                 a.K(false);
  3100.               }
  3101.  
  3102.             }
  3103.             else if ((i12 == 2) && (localTimer != null) && (localTimer.isRunning()))
  3104.             {
  3105.               for (localObject11 = ((ArrayList)localObject1).iterator(); ((Iterator)localObject11).hasNext(); ) { RSTile localRSTile5 = (RSTile)((Iterator)localObject11).next();
  3106.  
  3107.                 if ((!a.X().equals(localRSTile5)) && (a.G(localRSTile5) != null))
  3108.                 {
  3109.                   localTimer = null;
  3110.  
  3111.                   break;
  3112.                 }
  3113.  
  3114.               }
  3115.  
  3116.               if (localTimer != null)
  3117.                 if (
  3118.                   (localObject11 = a.i(a.tb)) != null)
  3119.                 {
  3120.                   a.vE = ((RSObject)localObject11).getLocation();
  3121.  
  3122.                   if (a.l((RSObject)localObject11, "Charge"))
  3123.                   {
  3124.                     a.K(false);
  3125.  
  3126.                     if (a.MC)
  3127.                     {
  3128.                       i12--;
  3129.  
  3130.                       a.vE = null;
  3131.                     }
  3132.                     else
  3133.                     {
  3134.                       localTimer.reset();
  3135.                     }
  3136.                   }
  3137.                 }
  3138.             }
  3139.             else if ((a.calc.distanceTo(localRSNPC2) > 4) && (!a.Y().isMoving()))
  3140.             {
  3141.               a.A(localRSNPC2.getLocation(), 1);
  3142.  
  3143.               a.sleep(300, 600);
  3144.             }
  3145.             else if ((!a.JC()) && (!a.SE.contains("currently invulnerable")) && (a.F(localRSNPC2, "Attack")))
  3146.             {
  3147.               a.K(true);
  3148.             }
  3149.  
  3150.           }
  3151.  
  3152.           a.vE = null;
  3153.  
  3154.           a.RD.clear();
  3155.         }
  3156.         else
  3157.         {
  3158.           RSTile localRSTile4;
  3159.           if ((localRSNPC2 != null) && (i2 == 3) && (localRSNPC2.getAnimation() == 13449))
  3160.           {
  3161.             for (localObject10 = ((ArrayList)localObject1).iterator(); ((Iterator)localObject10).hasNext(); ) { localRSTile4 = (RSTile)((Iterator)localObject10).next();
  3162.  
  3163.               if (a.calc.distanceTo(localRSTile4) > 2)
  3164.               {
  3165.                 a.A(localRSTile4, 1);
  3166.  
  3167.                 a.sleep(600, 900);
  3168.  
  3169.                 break;
  3170.               }
  3171.             }
  3172.           }
  3173.           else if (a.J(new int[] { 49268 }).length > i6)
  3174.           {
  3175.             a.SE = "";
  3176.  
  3177.             localObject10 = a.i(new int[] { 49268 });
  3178.  
  3179.             a.A(a.HC == 1);
  3180.  
  3181.             if (localObject10 != null)
  3182.             {
  3183.               localRSTile4 = ((RSObject)localObject10).getLocation();
  3184.  
  3185.               if ((!a.Y().isMoving()) && ((a.calc.distanceTo(localRSTile4) > 1) || (localRSNPC2.isInCombat())))
  3186.               {
  3187.                 a.A(localRSTile4, 1);
  3188.               }
  3189.  
  3190.             }
  3191.  
  3192.           }
  3193.           else
  3194.           {
  3195.             a.l(a.UC, 50, 50);
  3196.  
  3197.             a.A(true);
  3198.  
  3199.             if (!a.SE.contains("currently invulnerable"))
  3200.             {
  3201.               a.i(localRSNPC2);
  3202.             }
  3203.             else
  3204.             {
  3205.               a.JC();
  3206.             }
  3207.  
  3208.           }
  3209.  
  3210.         }
  3211.  
  3212.         a.sleep(200, 300);
  3213.       }
  3214.       else
  3215.       {
  3216.         Object localObject3;
  3217.         Object localObject5;
  3218.         Object localObject6;
  3219.         if ((a.tc.equals("Har'laak the Riftsplitter")) || (localRSNPC3 != null))
  3220.         {
  3221.           int i1 = 0;
  3222.  
  3223.           localObject3 = null;
  3224.  
  3225.           localObject5 = new ArrayList();
  3226.  
  3227.           localObject6 = new ArrayList();
  3228.  
  3229.           a.Qc = "Killing the Riftsplitter!";
  3230.  
  3231.           if (a.tc.isEmpty())
  3232.           {
  3233.             a.log(a.Qc);
  3234.  
  3235.             a.tc = "Har'laak the Riftsplitter";
  3236.           }
  3237.           a.l(a.QC, Combat.Prayer.PROTECT_FROM_MAGIC, true);
  3238.  
  3239.           a.PD = (a.bC != -1 ? a.bC : a.xb);
  3240.  
  3241.           if (a.jA()) {
  3242.             return;
  3243.           }
  3244.  
  3245.           if (localRSNPC3 != null)
  3246.           {
  3247.             if ((localRSNPC3.getMessage() != null) && (localObject3 != null) && (((String)localObject3).equals(localRSNPC3.getMessage())))
  3248.             {
  3249.               i1 = 0;
  3250.             }
  3251.             else
  3252.             {
  3253.               localObject3 = localRSNPC3.getMessage();
  3254.  
  3255.               i1 = 1;
  3256.             }
  3257.  
  3258.             if ((localObject3 != null) && (i1 != 0))
  3259.             {
  3260.               a.AB = "Look out for that portal!";
  3261.  
  3262.               RSTile localRSTile1 = a.X();
  3263.               int i10;
  3264.               if (((ArrayList)localObject6).isEmpty())
  3265.               {
  3266.                 ((ArrayList)localObject5).clear();
  3267.  
  3268.                 ((ArrayList)localObject5).add(new RSArea(new RSTile(localRSTile1.getX() - 1, localRSTile1.getY() - 1), new RSTile(localRSTile1.getX() + 1, localRSTile1.getY() + 1)));
  3269.  
  3270.                 int i9 = (localObject7 = a.J(new int[] { 51866 })).length;
  3271.  
  3272.                 localRSTile3 = (arrayOfInt1 = localObject7[i10])
  3273.                   .getLocation();
  3274.  
  3275.                 localObject9 = ((ArrayList)localObject5).iterator();
  3276.                 while (true) if (((Iterator)localObject9).hasNext())
  3277.                   {
  3278.                     if (
  3279.                       (localObject10 = (RSArea)((Iterator)localObject9).next()).contains(new RSTile[] { localRSTile3 }))
  3280.                     {
  3281.                       break;
  3282.                     }
  3283.  
  3284.                     continue;
  3285.                   }
  3286.                   else
  3287.                   {
  3288.                     ((ArrayList)localObject6).add(arrayOfInt1.getLocation());
  3289.                   }
  3290.  
  3291.  
  3292.                 i10++;
  3293.               }
  3294.               else
  3295.               {
  3296.                 ((ArrayList)localObject5).add(new RSArea(new RSTile(localRSTile1.getX() - 1, localRSTile1.getY() - 1), new RSTile(localRSTile1.getX() + 1, localRSTile1.getY() + 1)));
  3297.               }
  3298.               int i8 = 20;
  3299.  
  3300.               if (a.vE == null)
  3301.               {
  3302.                 for (RSTile localRSTile2 : (ArrayList)localObject6) {
  3303.                   if ((a.calc.distanceTo(localRSTile2) > 2) && (a.calc.distanceTo(localRSTile2) < i8))
  3304.                   {
  3305.                     a.vE = localRSTile2;
  3306.  
  3307.                     i8 = a.calc.distanceTo(localRSTile2);
  3308.                   }
  3309.  
  3310.                 }
  3311.  
  3312.               }
  3313.  
  3314.               if (a.vE != null)
  3315.               {
  3316.                 ((ArrayList)localObject6).remove(a.vE);
  3317.  
  3318.                 a.i(a.vE, 0);
  3319.  
  3320.                 a.JC();
  3321.                 do
  3322.                 {
  3323.                   a.A(a.vE, 0);
  3324.                 }
  3325.                 while (a.JC());
  3326.  
  3327.                 a.sleep(300, 400);
  3328.  
  3329.                 a.vE = null;
  3330.               }
  3331.               a.AB = "";
  3332.             }
  3333.             else
  3334.             {
  3335.               a.i(localRSNPC3);
  3336.  
  3337.               a.l(a.lG, 50, 0);
  3338.  
  3339.               if ((a.calc.distanceTo(localRSNPC3) < 3) && (!a.Y().isInCombat()) && (!localRSNPC3.isInCombat()))
  3340.               {
  3341.                 a.l(a.FA.getCentralTile(), 1);
  3342.               }
  3343.             }
  3344.           }
  3345.           a.sleep(100, 200);
  3346.         }
  3347.         else
  3348.         {
  3349.           Object localObject2;
  3350.           if ((a.tc.equals("Lexicus Runewright")) || (localRSNPC4 != null))
  3351.           {
  3352.             localObject2 = "";
  3353.  
  3354.             a.Qc = "Killing Lexicus Runewright!";
  3355.  
  3356.             if (a.tc.isEmpty())
  3357.             {
  3358.               a.log(a.Qc);
  3359.  
  3360.               a.tc = "Lexicus Runewright";
  3361.             }
  3362.  
  3363.             a.l(false, Combat.Prayer.PROTECT_FROM_MAGIC, true);
  3364.  
  3365.             if (a.Sd)
  3366.             {
  3367.               a.i(2);
  3368.             }
  3369.             else
  3370.               a.PD = a.xb;
  3371.             if (a.jA())
  3372.             {
  3373.               return;
  3374.             }
  3375.             if (localRSNPC4 != null)
  3376.               if ((
  3377.                 (localObject2 = localRSNPC4.getMessage()) != null) && (((String)localObject2).contains("barrage")))
  3378.               {
  3379.                 if ((localObject3 = a.objects.getNearest(a.dA)) != null)
  3380.                 {
  3381.                   a.vE = ((RSObject)localObject3).getLocation();
  3382.  
  3383.                   a.l(a.vE, 1);
  3384.  
  3385.                   if (!a.l(a.vc, 80, 80))
  3386.                   {
  3387.                     a.sleep(500, 700);
  3388.                   }
  3389.                   a.sleep(600, 800);
  3390.  
  3391.                   a.F(localRSNPC4, "Attack");
  3392.  
  3393.                   a.vE = null;
  3394.                 }
  3395.                 a.AB = "";
  3396.               }
  3397.               else if (a.i(new String[] { "Tome" }) != null)
  3398.               {
  3399.                 if (a.F(a.i(new String[] { "Tome" })))
  3400.                 {
  3401.                   a.K(false);
  3402.  
  3403.                   a.l(a.UC, 40, 0);
  3404.                 }
  3405.                 else
  3406.                 {
  3407.                   a.sleep(300, 500);
  3408.                 }
  3409.               }
  3410.               else
  3411.               {
  3412.                 int i3;
  3413.                 for (; (i3 = 0) < 15; tmpTernaryOp = 15) { if (a.AA())
  3414.                     break;
  3415.                   if (a.i(new String[] { "Tome" }) != null)
  3416.                   {
  3417.                     break;
  3418.                   }
  3419.  
  3420.                   a.JC();
  3421.  
  3422.                   a.sleep(100, 200);
  3423.  
  3424.                   i3++;
  3425.                 }
  3426.                 (localRSNPC4.getAnimation() == 13499 ?
  3427.                   i3 : a.i(localRSNPC4));
  3428.               }
  3429.             a.l(a.lG, 40, 0);
  3430.  
  3431.             a.sleep(100, 200);
  3432.           }
  3433.           else
  3434.           {
  3435.             if (!a.tc.equals("Sagittare"))
  3436.             {
  3437.               if (a.i(new int[] { 51887 }) == null);
  3438.             }
  3439.             else
  3440.             {
  3441.               a.Qc = "Killing Sagittare!";
  3442.  
  3443.               if (a.tc.isEmpty())
  3444.               {
  3445.                 a.log(a.Qc);
  3446.  
  3447.                 a.tc = "Sagittare";
  3448.               }
  3449.  
  3450.               if (a.HC == 2)
  3451.               {
  3452.                 a.log("Swapping attack style for Sagittare!");
  3453.  
  3454.                 if (a.kC)
  3455.                 {
  3456.                   a.i(1);
  3457.                 }
  3458.                 else if (a.iD)
  3459.                 {
  3460.                   a.i(3);
  3461.                 }
  3462.                 else
  3463.                 {
  3464.                   a.log.severe("We don't have a way to kill Sagittare, aborting dungeon!");
  3465.  
  3466.                   a.nc = true;
  3467.  
  3468.                   return;
  3469.                 }
  3470.  
  3471.               }
  3472.  
  3473.               a.l(a.QC, Combat.Prayer.PROTECT_FROM_MAGIC, true);
  3474.  
  3475.               a.PD = a.xb;
  3476.  
  3477.               while (a.objects.getNearest(a.gb) == null)
  3478.               {
  3479.                 if (a.jA())
  3480.                 {
  3481.                   return;
  3482.                 }
  3483.  
  3484.                 if ((localObject2 = a.i(new String[] { "Sagittare" })) != null)
  3485.                 {
  3486.                   if ((a.SE.contains("stops you")) || (a.SE.contains("bound")))
  3487.                   {
  3488.                     a.JC();
  3489.                   }
  3490.                   Object localObject4;
  3491.                   if ((((RSNPC)localObject2).getAnimation() == 13270) || (((RSNPC)localObject2).getMessage() != null))
  3492.                   {
  3493.                     if (a.calc.distanceTo(a.FA.getCentralTile()) > 2)
  3494.                     {
  3495.                       a.vE = a.FA.getCentralTile();
  3496.                     }
  3497.                     else
  3498.                     {
  3499.                       localObject4 = a.objects.getNearest(new int[] { 50352 });
  3500.  
  3501.                       a.vE = (localObject4 != null ? ((RSObject)localObject4).getLocation() : ((RSNPC)localObject2).getLocation());
  3502.                     }
  3503.  
  3504.                     a.l(a.vE, 1);
  3505.  
  3506.                     a.sleep(3000, 5000);
  3507.  
  3508.                     a.vE = null;
  3509.                   }
  3510.                   else if ((a.HC != 3) && (a.calc.distanceTo((RSCharacter)localObject2) > 1))
  3511.                   {
  3512.                     if (a.Y().isMoving()) {
  3513.                       a.JC();
  3514.                     }
  3515.                     else
  3516.                     {
  3517.                       a.l(((RSNPC)localObject2).getLocation(), 1);
  3518.                     }
  3519.                     if (((localObject4 = a.walking.getDestination()) != null) &&
  3520.                       (a.calc.distanceBetween((RSTile)localObject4, ((RSNPC)localObject2).getLocation()) > 1.0D))
  3521.                     {
  3522.                       a.l(((RSNPC)localObject2).getLocation(), 0);
  3523.  
  3524.                       a.l(false);
  3525.                     }
  3526.                   }
  3527.                   a.l(a.UC, 50, 50);
  3528.  
  3529.                   a.i((RSNPC)localObject2);
  3530.                 }
  3531.                 a.sleep(100, 200);
  3532.               }
  3533.  
  3534.             }
  3535.  
  3536.             if ((a.tc.equals("Night-gazer Khighorahk")) || (localRSNPC5 != null))
  3537.             {
  3538.               localObject2 = new int[] { 13426, 13427, 13428, 13429 };
  3539.  
  3540.               a.Qc = "Killing Night-gazer Khighorahk!";
  3541.  
  3542.               if (a.tc.isEmpty())
  3543.               {
  3544.                 a.log(a.Qc);
  3545.  
  3546.                 a.tc = "Night-gazer Khighorahk";
  3547.               }
  3548.               a.l(false, Combat.Prayer.PROTECT_FROM_MAGIC, true);
  3549.  
  3550.               a.PD = (a.bC != -1 ? a.bC : a.xb);
  3551.  
  3552.               if (a.jA())
  3553.               {
  3554.                 return;
  3555.               }
  3556.               if ((localRSNPC5 = a.i(new String[] { "Khighorahk" })) != null)
  3557.               {
  3558.                 boolean bool = a.l(localRSNPC5.getAnimation(), localObject2);
  3559.  
  3560.                 localObject5 = localRSNPC5.getLocation();
  3561.  
  3562.                 if ((bool) && (a.calc.distanceTo((RSTile)localObject5) < 6))
  3563.                 {
  3564.                   if ((localObject6 = a.objects.getNearest(new bb(a, (RSTile)localObject5))) != null)
  3565.                   {
  3566.                     a.vE = ((RSObject)localObject6).getLocation();
  3567.  
  3568.                     a.l(a.vE, 1);
  3569.  
  3570.                     a.l(false);
  3571.                     int i7;
  3572.                     if ((i7 = 0) < 7)
  3573.                     {
  3574.                       if (!a.AA())
  3575.                       {
  3576.                         RSObject localRSObject1;
  3577.                         if ((
  3578.                           (localRSObject1 = a.i(new int[] { 49265 })) != null) && (a.calc.distanceTo(localRSObject1) < 4))
  3579.                         {
  3580.                           if (a.l(localRSObject1, "Light"))
  3581.                           {
  3582.                             a.sleep(800, 1100);
  3583.  
  3584.                             if ((a.Y().getAnimation() == 13355) && (a.Y().getAnimation() == 13354))
  3585.                               break label4150;
  3586.                             a.l(localRSObject1, "Light"); break label4150;
  3587.                           }
  3588.  
  3589.                         }
  3590.                         else if (a.Y().getAnimation() == 10070)
  3591.                         {
  3592.                           a.log("Damn.. Got knocked by his special");
  3593.  
  3594.                           a.l(a.UC, 50, 40);
  3595.  
  3596.                           break label4150;
  3597.                         }
  3598.                         if (a.walking.isRunEnabled())
  3599.                         {
  3600.                           a.sleep(200, 300);
  3601.                         }
  3602.                         else
  3603.                           if ((a.calc.distanceTo(a.vE) < 2) || (a.calc.distanceTo(localRSNPC5.getLocation()) > 8))
  3604.                             break label4150;
  3605.                         if ((a.calc.distanceTo(a.vE) < 3) && (localRSNPC5.getAnimation() != 13429))
  3606.                         {
  3607.                           a.sleep(400, 600);
  3608.                         }
  3609.                         else
  3610.                         {
  3611.                           a.sleep(200, 250);
  3612.  
  3613.                           i7++;
  3614.                         }
  3615.                       }
  3616.                     }
  3617.                     label4150: a.x();
  3618.  
  3619.                     a.sleep(500, 800);
  3620.  
  3621.                     i7++;
  3622.  
  3623.                     a.vE = null;
  3624.                   }
  3625.  
  3626.                 }
  3627.                 else if ((
  3628.                   (localObject6 = a.J(new int[] { 49266, 49267 })) != null) && (localObject6.length < 2))
  3629.                 {
  3630.                   if (a.l(a.objects.getNearest(new int[] { 49265 }), "Light"))
  3631.                     a.sleep(800, 1200);
  3632.                 }
  3633.                 else if (a.MC)
  3634.                 {
  3635.                   a.JC();
  3636.                 }
  3637.                 else
  3638.                 {
  3639.                   a.l(a.UC, 50, 0);
  3640.  
  3641.                   a.i(localRSNPC5);
  3642.                 }
  3643.  
  3644.               }
  3645.  
  3646.               a.sleep(100, 200);
  3647.             }
  3648.             else
  3649.             {
  3650.               a.Qc = "Killing an unknown boss...";
  3651.  
  3652.               a.log(a.Qc);
  3653.  
  3654.               a.l(a.QC, null, false);
  3655.  
  3656.               if (!a.h())
  3657.               {
  3658.                 return;
  3659.               }
  3660.             }
  3661.           }
  3662.         }
  3663.       }
  3664.     }
  3665.     a.Ke = true;
  3666.   }
  3667.  
  3668.   private boolean F(RSTile a, boolean a)
  3669.   {
  3670.     return (a.l(a, a)) || (!a.l(a.X(), a, a, new int[0]).isEmpty());
  3671.   }
  3672.  
  3673.   private boolean AD()
  3674.   {
  3675.     a.Qc = "Opening a skill door";
  3676.  
  3677.     if (a.ZA != null);
  3678.     if (a.jA())
  3679.     {
  3680.       return false;
  3681.     }
  3682.  
  3683.     a.uA();
  3684.  
  3685.     if ((a.nD != null) && (a.FA != null)) if (a.FA.contains(new RSTile[] { a.nD }))
  3686.       {
  3687.         RSObject localRSObject = a.G(a.nD);
  3688.  
  3689.         if (a.l(localRSObject))
  3690.         {
  3691.           a.K(true);
  3692.  
  3693.           if ((a.ZA == null) && (a.Rc()) && ((a.l(localRSObject.getID(), a.Yf)) || (a.l(localRSObject.getID(), a.tD))))
  3694.             a.l(a.vc, 70, 40);
  3695.           if (a.i(true)) {
  3696.             return true;
  3697.           }
  3698.  
  3699.         }
  3700.         else if (localRSObject != null)
  3701.         {
  3702.           a.sleep(100, 200);
  3703.         }
  3704.         if (!a.iD())
  3705.         {
  3706.           return true;
  3707.         }
  3708.       }
  3709.     a.sleep(200, 400);
  3710.  
  3711.     a.QA = a.nD;
  3712.  
  3713.     return true;
  3714.   }
  3715.  
  3716.   private int Lb()
  3717.   {
  3718.     if (a.jA())
  3719.       return 2;
  3720.     a.jA = a.D(a.xC);
  3721.  
  3722.     if ((a.jA != null) && (!a.l(a.jA)))
  3723.     {
  3724.       if ((a.HC == 1) && (a.calc.distanceTo(a.jA) > 4))
  3725.       {
  3726.         a.l(a.jA.getLocation(), 1);
  3727.       }
  3728.       else
  3729.       {
  3730.         a.F(a.jA);
  3731.       }
  3732.       a.sleep(800, 1300);
  3733.     }
  3734.  
  3735.     a.l(a.UC, 40, 50);
  3736.  
  3737.     a.sleep(100, 150);
  3738.  
  3739.     a.jA = null;
  3740.  
  3741.     return 1;
  3742.   }
  3743.  
  3744.   private boolean qb()
  3745.   {
  3746.     int i2;
  3747.     if ((a.kd) && (a.nb == null) && (!a.ud.equals("Frozen"))) if ((a.jb.contains(new RSTile[] { a.X() })) && (!a.inventory.contains(17566)))
  3748.       {
  3749.         int i1;
  3750.         i2 =
  3751.           (i1 = a.inventory.getCount(true, new int[] { 18201 })) < 400 ? i1 / 200 : 2;
  3752.  
  3753.         if ((a.inventory.getCount() < 20) && (i2 > 0))
  3754.         {
  3755.           a.l(false, i2, -1);
  3756.         }
  3757.       }
  3758.     a.nD = null;
  3759.  
  3760.     a.WA = null;
  3761.  
  3762.     a.ZA = null;
  3763.  
  3764.     a.Bd.removeAll(a.fG);
  3765.  
  3766.     a.Bd.removeAll(a.fc);
  3767.  
  3768.     a.J.removeAll(a.fG);
  3769.  
  3770.     a.J.removeAll(a.fc);
  3771.  
  3772.     a.J.removeAll(a.w);
  3773.  
  3774.     a.w.removeAll(a.fG);
  3775.  
  3776.     RSTile localRSTile1 = a.tA();
  3777.     RSArea localRSArea;
  3778.     Iterator localIterator2;
  3779.     if (((localRSArea = (RSArea)a.aE.get(i2)) != null) &&
  3780.       (!a.ic.contains(localRSArea)) && (!a.l(localRSArea, a.Bd)) && (!a.l(localRSArea, a.J)) && (!a.l(localRSArea, a.w)))
  3781.     {
  3782.       a.ic.add(localRSArea);
  3783.  
  3784.       for (localIterator2 = a.fA.iterator(); localIterator2.hasNext(); )
  3785.       {
  3786.         RSTile localRSTile3;
  3787.         if ((
  3788.           (localRSTile3 = (RSTile)localIterator2.next()) != null) && (a.calc.distanceBetween(localRSTile3, localRSArea.getNearestTile(localRSTile3)) < 4.0D))
  3789.         {
  3790.           a.fG.add(localRSTile3);
  3791.         }
  3792.       }
  3793.     }
  3794.     i2--;
  3795.  
  3796.     a.aE.removeAll(a.ic);
  3797.  
  3798.     a.w.removeAll(a.fG);
  3799.  
  3800.     a.Bd.removeAll(a.fG);
  3801.  
  3802.     a.Bd.removeAll(a.fc);
  3803.  
  3804.     a.J.removeAll(a.fG);
  3805.  
  3806.     a.J.removeAll(a.fc);
  3807.  
  3808.     a.J.removeAll(a.w);
  3809.  
  3810.     if ((a.cD.contains(a.r)) && ((localRSTile1 == null) || (a.calc.distanceTo(localRSTile1) > 3)))
  3811.     {
  3812.       a.lA();
  3813.  
  3814.       if ((a.nD == null) || (a.calc.distanceTo(a.nD) > 4))
  3815.       {
  3816.         a.log("Can't reach the back door, teleporting back");
  3817.  
  3818.         a.G(true);
  3819.  
  3820.         a.l(a.jb);
  3821.  
  3822.         return true;
  3823.       }
  3824.  
  3825.     }
  3826.  
  3827.     a.vA();
  3828.  
  3829.     a.uA();
  3830.  
  3831.     if (a.FA != null)
  3832.     {
  3833.       a.SE = "";
  3834.  
  3835.       a.Sg = a.FA;
  3836.  
  3837.       if ((a.Zc > 4) && (!a.inventory.contains(18829)) && (a.Rd == 1) && (a.Nc.size() > 1))
  3838.       {
  3839.         a.Qc = "Teleporting back to where we died";
  3840.  
  3841.         i2 = 0;
  3842.  
  3843.         a.uA();
  3844.  
  3845.         if (a.groundItems.getNearest(new int[] { 18829 }) != null);
  3846.         if (a.jA()) {
  3847.           return false;
  3848.         }
  3849.  
  3850.         if (a.SE.contains("destination"))
  3851.         {
  3852.           i2 = 1;
  3853.         }
  3854.         else
  3855.         {
  3856.           if (!a.jb.contains(new RSTile[] { a.X() }))
  3857.           {
  3858.             a.rb();
  3859.           }
  3860.           else if (a.fA()) {
  3861.             a.K(false);
  3862.           }
  3863.  
  3864.           a.sleep(300, 400);
  3865.  
  3866.           a.uA();
  3867.         }
  3868.         if (i2 == 0)
  3869.         {
  3870.           a.l(a.QB != null ? a.QB : a.FA);
  3871.  
  3872.           a.QB = null;
  3873.  
  3874.           if (!a.r.equals(a.jb))
  3875.           {
  3876.             a.qA.clear();
  3877.             int i4;
  3878.             if ((a.l.contains(a.r)) || ((a.nb != null) && ((a.tc.equals("Sagittare")) || (a.tc.equals("Stomp")))))
  3879.             {
  3880.               a.l(a.groundItems.getNearest(new int[] { 18829 }));
  3881.  
  3882.               a.sleep(300, 600);
  3883.  
  3884.               i4++;
  3885.             }
  3886.  
  3887.             a.hB = true;
  3888.  
  3889.             return true;
  3890.           }
  3891.         }
  3892.       }
  3893.       Iterator localIterator1;
  3894.       if ((a.nb != null) && (!a.ig.isEmpty()))
  3895.       {
  3896.         for (localIterator1 = a.ig.iterator(); localIterator1.hasNext(); ) { localRSTile2 = (RSTile)localIterator1.next();
  3897.  
  3898.           if (a.FA.contains(new RSTile[] { localRSTile2 }))
  3899.           {
  3900.             a.nD = localRSTile2;
  3901.  
  3902.             a.Qc = "Opening a door back to the Boss";
  3903.  
  3904.             return a.N();
  3905.           }
  3906.         }
  3907.       }
  3908.       RSTile localRSTile2;
  3909.       if ((a.QB != null) && (!a.qA.isEmpty()))
  3910.       {
  3911.         if (!a.FA.equals(a.QB))
  3912.         {
  3913.           for (localIterator1 = a.qA.iterator(); localIterator1.hasNext(); ) { localRSTile2 = (RSTile)localIterator1.next();
  3914.  
  3915.             if (a.FA.contains(new RSTile[] { localRSTile2 }))
  3916.             {
  3917.               a.nD = localRSTile2;
  3918.  
  3919.               a.Qc = "Opening a door back to where we died";
  3920.  
  3921.               return a.N();
  3922.             }
  3923.  
  3924.           }
  3925.  
  3926.         }
  3927.  
  3928.         a.qA.clear();
  3929.       }
  3930.  
  3931.       int i3 = a.lA();
  3932.  
  3933.       if (a.nD != null)
  3934.       {
  3935.         a.lc = new Timer(0L);
  3936.  
  3937.         a.A(a.WA != null ? a.WA : a.nD);
  3938.  
  3939.         if (a.M) {
  3940.           a.l(a.X(), a.WA != null ? a.WA : a.nD, true, new int[0]);
  3941.         }
  3942.  
  3943.         a.SE = "";
  3944.  
  3945.         switch (i3)
  3946.         {
  3947.         case 1:
  3948.           return a.zA();
  3949.         case 2:
  3950.           return a.UA();
  3951.         case 3:
  3952.           return a.u();
  3953.         case 4:
  3954.           return a.AD();
  3955.         case 5:
  3956.           while (0 != 0);
  3957.           return a.N();
  3958.         }
  3959.       }
  3960.     }
  3961.     return false;
  3962.   }
  3963.  
  3964.   private boolean D(boolean a)
  3965.   {
  3966.     if (!a.inventory.isFull())
  3967.       return true;
  3968.     if ((a.combat.getHealth() < 95) && (a.inventory.containsOneOf(a.vc)))
  3969.     {
  3970.       if (!a.l(a.W, 95, 50)) {
  3971.         a.l(a.vc, 95, 50);
  3972.       }
  3973.  
  3974.     }
  3975.     else if (!a.S()) {
  3976.       if ((a) && (a.inventory.getCount() > a.inventory.getCount(a.l(a.EB))))
  3977.       {
  3978.         a.F(a.X(), 2);
  3979.  
  3980.         a.MA();
  3981.       }
  3982.       else
  3983.       {
  3984.         a.l(a.vc, 101, 30);
  3985.       }
  3986.  
  3987.     }
  3988.  
  3989.     return !a.inventory.isFull();
  3990.   }
  3991.  
  3992.   private boolean l(RSComponent a, String a)
  3993.   {
  3994.     if (!a.isValid())
  3995.     {
  3996.       return false;
  3997.     }
  3998.     Rectangle localRectangle;
  3999.     if ((localRectangle = a.getArea()).x ==
  4000.       -1)
  4001.       return false;
  4002.     int i1 = localRectangle.x + 2; int i2 = localRectangle.y + 2; int i3 = localRectangle.width - 4; int i4 = localRectangle.height - 4;
  4003.  
  4004.     if ((
  4005.       new Rectangle(i1, i2, i3, i4).contains(a.mouse.getLocation())) && (a.menu.contains(a)))
  4006.     {
  4007.       a.mouse.click(true);
  4008.  
  4009.       return true;
  4010.     }
  4011.  
  4012.     a.mouse.click(a.random(i1, i1 + i3), a.random(i2, i2 + i4), true);
  4013.  
  4014.     return true;
  4015.   }
  4016.  
  4017.   private boolean Zc()
  4018.   {
  4019.     a.V();
  4020.  
  4021.     if (!a.Od) {
  4022.       return true;
  4023.     }
  4024.  
  4025.     if (a.hd != null)
  4026.     {
  4027.       if (!a.hd.isRunning())
  4028.       {
  4029.         return true;
  4030.       }
  4031.  
  4032.     }
  4033.     else if (!a.hA.isRunning())
  4034.       return true;
  4035.     return (!a.game.isLoggedIn()) || (a.AA()) || (!a.M());
  4036.   }
  4037.  
  4038.   private boolean J(RSNPC a)
  4039.   {
  4040.     if ((a != null) && (a.isValid()) && ((a.isInCombat()) || (a.l(a))))
  4041.     {
  4042.       return !a.A(a);
  4043.     }
  4044.     return false;
  4045.   }
  4046.  
  4047.   private boolean DD()
  4048.   {
  4049.     if ((a.jA()) || (a.l(a.FA, a.J)))
  4050.     {
  4051.       return false;
  4052.     }
  4053.     if (a.lA.contains(a.r))
  4054.     {
  4055.       a.log("Can't backtrack from this room, killing off enemies");
  4056.  
  4057.       if ((!a.QB()) || (!a.ZA())) {
  4058.         return false;
  4059.       }
  4060.  
  4061.     }
  4062.     else
  4063.     {
  4064.       a.log("We need to backtrack further before teleporting home");
  4065.  
  4066.       a.K();
  4067.     }
  4068.     a.uA();
  4069.  
  4070.     a.uA();
  4071.  
  4072.     return true;
  4073.   }
  4074.  
  4075.   private int rd()
  4076.   {
  4077.     if (!a.UA)
  4078.     {
  4079.       a.uC = "Unknown layout";
  4080.  
  4081.       return -1;
  4082.     }
  4083.  
  4084.     a.A(a.X(), 10);
  4085.  
  4086.     a.sleep(30000, 150000);
  4087.  
  4088.     int[] arrayOfInt1 = { 50687, 52075 };
  4089.  
  4090.     int[] arrayOfInt2 = { 52982, 51786 };
  4091.  
  4092.     RSObject localRSObject1 = a.i(new int[] { 49656, 49657, 49658, 54308 });
  4093.  
  4094.     RSObject localRSObject2 = a.J(new String[] { "Spinning blades" });
  4095.  
  4096.     RSObject localRSObject3 = a.J(new String[] { "Pendulum" });
  4097.  
  4098.     RSTile localRSTile1 = a.i(new int[] { 49765 }).getLocation();
  4099.  
  4100.     RSTile localRSTile2 = a.l(new int[][] { arrayOfInt1, arrayOfInt2 });
  4101.  
  4102.     if ((localRSTile1 == null) || (localRSTile2 == null)) {
  4103.       return -1;
  4104.     }
  4105.  
  4106.     RSTile localRSTile3 = a.i(new int[] { 49765 }).getLocation();
  4107.  
  4108.     RSTile localRSTile4 = a.tA();
  4109.  
  4110.     if (a.jA())
  4111.     {
  4112.       return 2;
  4113.     }
  4114.     if (!a.j())
  4115.     {
  4116.       return -1;
  4117.     }
  4118.     a.l(a.vc, 40, 50);
  4119.  
  4120.     a.jA = a.npcs.getNearest(a.B);
  4121.  
  4122.     a.yd = a.l(a.Zd);
  4123.  
  4124.     if ((a.jA != null) && (a.l(a.jA.getLocation(), false)))
  4125.     {
  4126.       a.F(a.jA);
  4127.     }
  4128.     else if ((a.yd != null) && (a.l(a.yd.getLocation(), false)))
  4129.       a.l(a.yd);
  4130.     else if (a.F(localRSObject2))
  4131.     {
  4132.       if ((a.calc.distanceTo(localRSObject3.getLocation()) < 5) || (a.calc.distanceTo(localRSTile2) < 3))
  4133.       {
  4134.         a.A(localRSObject3.getLocation(), 0);
  4135.       }
  4136.       else if (a.calc.distanceTo(localRSTile3) < 2)
  4137.         a.A(localRSTile2, 0);
  4138.       else {
  4139.         a.A(localRSTile3, 0);
  4140.       }
  4141.  
  4142.     }
  4143.     else if (a.F(localRSObject1))
  4144.       a.A(localRSObject3.getLocation(), 1);
  4145.     else if (a.l(localRSTile4, true))
  4146.     {
  4147.       a.l(a.i(a.bB), "Step-onto");
  4148.     }
  4149.     else
  4150.     {
  4151.       a.A(a.nD, 1);
  4152.     }
  4153.     a.K(true);
  4154.  
  4155.     if (a.AA())
  4156.     {
  4157.       a.n();
  4158.     }
  4159.     else if (a.jA()) {
  4160.       return 2;
  4161.     }
  4162.  
  4163.     a.K(true);
  4164.  
  4165.     a.sleep(600, 900);
  4166.  
  4167.     return 1;
  4168.   }
  4169.  
  4170.   public void keyPressed(KeyEvent a)
  4171.   {
  4172.   }
  4173.  
  4174.   private boolean iD()
  4175.   {
  4176.     if (((a.SE.contains("level of")) || (a.SE.contains("unable to"))) && (!a.oA()))
  4177.     {
  4178.       a.log("We don't have the level requirement for this door, removing.");
  4179.  
  4180.       a.fG.add(a.nD);
  4181.  
  4182.       a.Bd.remove(a.nD);
  4183.  
  4184.       a.w.remove(a.nD);
  4185.  
  4186.       a.J.remove(a.nD);
  4187.  
  4188.       return false;
  4189.     }
  4190.  
  4191.     return true;
  4192.   }
  4193.  
  4194.   private void J(boolean a)
  4195.   {
  4196.     if (a) {
  4197.       a.K(true);
  4198.     }
  4199.     else
  4200.     {
  4201.       a.sleep(400, 600);
  4202.     }
  4203.   }
  4204.  
  4205.   private boolean QB()
  4206.   {
  4207.     if (a.ic.contains(a.r))
  4208.     {
  4209.       return true;
  4210.     }
  4211.     if (a.npcs.getNearest(a.B) != null)
  4212.     {
  4213.       a.AB = "Clearing the room of monsters";
  4214.  
  4215.       if (a.jA())
  4216.       {
  4217.         return false;
  4218.       }
  4219.       Object localObject;
  4220.       if (!a.J(a.jA))
  4221.         if (
  4222.           (localObject = a.npcs.getNearest(a.xc)) != null)
  4223.         {
  4224.           a.jA = ((RSNPC)localObject);
  4225.         }
  4226.         else
  4227.         {
  4228.           a.jA = a.npcs.getNearest(a.bD);
  4229.         }
  4230.       if (a.F(a.jA))
  4231.       {
  4232.         a.D(a.jA);
  4233.  
  4234.         a.F();
  4235.  
  4236.         a.sleep(900, 1700);
  4237.  
  4238.         if (a.GD) {
  4239.           a.sleep(200, 300);
  4240.         }
  4241.  
  4242.       }
  4243.  
  4244.       if (a.Qc.contains(": Follow"))
  4245.       {
  4246.         if (((localObject = a.G(a.X())) != null) &&
  4247.           (a.l(((RSObject)localObject).getID(), a.te)))
  4248.           a.F(a.X(), 2);
  4249.       }
  4250.       a.l(a.UC, 45, 55);
  4251.  
  4252.       a.sleep(200, 400);
  4253.  
  4254.       a.jA = null;
  4255.  
  4256.       double d1 = a.random(3, 6);
  4257.       do
  4258.         if (a.jA())
  4259.         {
  4260.           return false;
  4261.         }
  4262.       while (a.JC());
  4263.  
  4264.       a.yd = a.l(a.Zd);
  4265.  
  4266.       a.K(false);
  4267.  
  4268.       a.sleep(300, 600);
  4269.  
  4270.       a.AB = "";
  4271.     }
  4272.  
  4273.     return true;
  4274.   }
  4275.  
  4276.   private void l(Graphics a, RSTile a, double a)
  4277.   {
  4278.     if (a == null)
  4279.     {
  4280.       return;
  4281.     }
  4282.     int i1 = a.getX(); int i2 = a.getY();
  4283.  
  4284.     Point localPoint1 = a.calc.worldToMinimap(i1 - a, i2 - a);
  4285.  
  4286.     Point localPoint2 = a.calc.worldToMinimap(i1 - a, i2 + a);
  4287.  
  4288.     Point localPoint3 = a.calc.worldToMinimap(i1 + a, i2 + a);
  4289.  
  4290.     Point localPoint4 = a.calc.worldToMinimap(i1 + a, i2 - a);
  4291.  
  4292.     if ((localPoint1.x != -1) && (localPoint2.x != -1) && (localPoint3.x != -1) && (localPoint4.x != -1))
  4293.     {
  4294.       int[] arrayOfInt1 = { localPoint1.x, localPoint2.x, localPoint3.x, localPoint4.x };
  4295.  
  4296.       int[] arrayOfInt2 = { localPoint1.y, localPoint2.y, localPoint3.y, localPoint4.y };
  4297.  
  4298.       a.fillPolygon(arrayOfInt1, arrayOfInt2, 4);
  4299.     }
  4300.   }
  4301.  
  4302.   private boolean F(int a, String a)
  4303.   {
  4304.     int i1;
  4305.     if (a.game.getCurrentTab() != 7)
  4306.     {
  4307.       a.game.openTab(7);
  4308.  
  4309.       if ((i1 = 0) < 40)
  4310.       {
  4311.         a.sleep(40, 50);
  4312.  
  4313.         i1++;
  4314.       }
  4315.     }
  4316.     return a.interfaces.getComponent(950, a).doAction(a);
  4317.   }
  4318.  
  4319.   private boolean oA()
  4320.   {
  4321.     int i1 = a.SE.indexOf("of ") + 3;
  4322.  
  4323.     if (a.SE.contains("of at least"))
  4324.     {
  4325.       i1 += 9;
  4326.     }
  4327.  
  4328.     try
  4329.     {
  4330.       String str = a.SE.substring(i1);
  4331.  
  4332.       int i2 = -1;
  4333.       int i3;
  4334.       if (
  4335.         (i3 = Integer.parseInt(str.substring(0, str.indexOf(" ")))) > 99)
  4336.         return false;
  4337.       if ((a.SE.contains("Strength")) && (a.skills.getRealLevel(2) >= i3))
  4338.       {
  4339.         a.log("Our Strength level has been temporarily lowered below " + i3 + ", waiting for it to regenerate");
  4340.  
  4341.         i2 = 2;
  4342.       }
  4343.       else if ((a.SE.contains("Magic")) && (a.skills.getRealLevel(6) >= i3))
  4344.       {
  4345.         a.log("Our Magic level has been temporarily lowered below " + i3 + ", waiting for it to regenerate");
  4346.  
  4347.         i2 = 6;
  4348.       }
  4349.       if (i2 != -1)
  4350.       {
  4351.         int i4;
  4352.         if ((i4 = i3 - a.skills.getCurrentLevel(i2)) < 0)
  4353.         {
  4354.           return false;
  4355.         }
  4356.  
  4357.         if (i4 > 4)
  4358.         {
  4359.           i4 = 4;
  4360.         }
  4361.         int i5 = a.random(i4 * 40000, i4 * 60000);
  4362.  
  4363.         a.sleep(i5);
  4364.  
  4365.         a.KA = new Timer(0L);
  4366.  
  4367.         if (a.hA != null) {
  4368.           a.hA.reset();
  4369.         }
  4370.  
  4371.         if (a.hd != null)
  4372.           a.hd.reset();
  4373.         if (a.lc != null)
  4374.         {
  4375.           a.lc = new Timer(0L);
  4376.         }
  4377.  
  4378.         a.SE = "";
  4379.  
  4380.         a.BG = true;
  4381.  
  4382.         return true;
  4383.       }
  4384.     }
  4385.     catch (Exception localException1)
  4386.     {
  4387.       if (a.UA)
  4388.         a.log(localException1);
  4389.     }
  4390.     return false;
  4391.   }
  4392.  
  4393.   private boolean F(RSNPC a, String a)
  4394.   {
  4395.     if ((a == null) || (!a.isValid())) {
  4396.       return false;
  4397.     }
  4398.  
  4399.     RSTile localRSTile = a.getLocation();
  4400.  
  4401.     if (!a.isOnScreen())
  4402.     {
  4403.       if (!a.Y().isMoving()) {
  4404.         if ((a.i(localRSTile, 1)) && (a.calc.distanceTo(localRSTile) > 6))
  4405.           a.camera.turnToTile(localRSTile, a.random(5, 15));
  4406.         else {
  4407.           a.sleep(400, 600);
  4408.         }
  4409.  
  4410.       }
  4411.  
  4412.       if (a != null)
  4413.       {
  4414.         a.sleep(50, 100);
  4415.       }
  4416.     }
  4417.     return a.l(a, a);
  4418.   }
  4419.  
  4420.   private int rA()
  4421.   {
  4422.     if (!a.UA)
  4423.     {
  4424.       a.uC = "Unsolvable puzzle";
  4425.  
  4426.       return -1;
  4427.     }
  4428.  
  4429.     a.Q();
  4430.  
  4431.     while (!a.KD)
  4432.     {
  4433.       if (a.jA())
  4434.         return 2;
  4435.       if (!a.j())
  4436.         return -1;
  4437.     }
  4438.     return 1;
  4439.   }
  4440.  
  4441.   private RSObject J(String[] a)
  4442.   {
  4443.     return a.objects.getNearest(new b(a, a));
  4444.   }
  4445.  
  4446.   private boolean l(String a, String[] a)
  4447.   {
  4448.     int i2;
  4449.     if ((a != null) && (a != null) && (!a.isEmpty()))
  4450.     {
  4451.       a = a.toLowerCase();
  4452.       String[] arrayOfString;
  4453.       int i1 = (arrayOfString = a).length;
  4454.       String str;
  4455.       if (((str = arrayOfString[i2]) != null) &&
  4456.         (!str.isEmpty()) && (a.contains(str.toLowerCase()))) {
  4457.         return true;
  4458.       }
  4459.  
  4460.       i2++;
  4461.     }
  4462.  
  4463.     return false;
  4464.   }
  4465.  
  4466.   private boolean A(int a)
  4467.   {
  4468.     if ((a < 4) && (a != a.combat.getFightMode()))
  4469.     {
  4470.       if ((a.k) && (a.i))
  4471.       {
  4472.         if (a == a.Gd)
  4473.         {
  4474.           return a.l(a.eB, "Wield");
  4475.         }
  4476.         a.l(a.Vc, "Wield");
  4477.       }
  4478.  
  4479.       a.game.openTab(0);
  4480.  
  4481.       if (a == a.combat.getFightMode()) {
  4482.         return false;
  4483.       }
  4484.  
  4485.       if (a == 0)
  4486.         a.mouse.click(577, 253, 55, 35, true);
  4487.       else if (a == 1)
  4488.       {
  4489.         a.mouse.click(661, 253, 55, 35, true);
  4490.       }
  4491.       else if (a == 2) {
  4492.         a.mouse.click(576, 306, 55, 35, true);
  4493.       }
  4494.       else if (a == 3) {
  4495.         a.mouse.click(662, 308, 55, 35, true);
  4496.       }
  4497.  
  4498.       return true;
  4499.     }
  4500.  
  4501.     return false;
  4502.   }
  4503.  
  4504.   private String XA()
  4505.   {
  4506.     if (a.yF == 0) {
  4507.       return "00:00:00";
  4508.     }
  4509.  
  4510.     StringBuilder localStringBuilder = new StringBuilder();
  4511.   }
  4512.  
  4513.   private boolean i(RSTile a, int a)
  4514.   {
  4515.     if (a != null)
  4516.     {
  4517.       if (a > 0)
  4518.         a = new RSTile(a.getX() + a.random(-a, a + 1), a.getY() + a.random(-a, a + 1));
  4519.       if (a.X().equals(a))
  4520.       {
  4521.         return false;
  4522.       }
  4523.       if (a.calc.tileOnScreen(a))
  4524.         return a.A(a, "Walk here");
  4525.       Point localPoint;
  4526.       if ((localPoint = a.calc.tileToMinimap(a)).x ==
  4527.         -1)
  4528.       {
  4529.         if (
  4530.           (a = a.walking.getClosestTileOnMap(a)) == null)
  4531.         {
  4532.           return false;
  4533.         }
  4534.         localPoint = a.calc.tileToMinimap(a);
  4535.       }
  4536.  
  4537.       if (localPoint.x != -1)
  4538.       {
  4539.         a.mouse.move(localPoint);
  4540.  
  4541.         if ((localPoint = a.calc.tileToMinimap(a)).x !=
  4542.           -1)
  4543.         {
  4544.           a.mouse.click(localPoint, true);
  4545.  
  4546.           return true;
  4547.         }
  4548.       }
  4549.     }
  4550.     return false;
  4551.   }
  4552.  
  4553.   private RSArea E(RSTile a)
  4554.   {
  4555.     if (a == null) {
  4556.       return null;
  4557.     }
  4558.  
  4559.     for (RSArea localRSArea : a.Nc)
  4560.       if (a.calc.distanceBetween(a, localRSArea.getNearestTile(a)) < 3.0D)
  4561.       {
  4562.         return localRSArea;
  4563.       }
  4564.     return null;
  4565.   }
  4566.  
  4567.   private boolean l(boolean a, Combat.Prayer a, boolean a)
  4568.   {
  4569.     if (((a) && (a.combat.getPrayerPoints() < 3)) || (!a.interfaces.get(749).isValid()))
  4570.     {
  4571.       return false;
  4572.     }
  4573.     int i1;
  4574.     if ((a.QC) && (a.HC == a.bb))
  4575.     {
  4576.       if ((a.combat.isQuickPrayerOn() != a) && (a.interfaces.get(749).isValid()))
  4577.       {
  4578.         if (a.Zc())
  4579.           return false;
  4580.         if (a.l(a.interfaces.getComponent(749, 2), a ? "Turn quick prayers on" : "Turn prayers off"))
  4581.         {
  4582.           a.sleep(150, 200);
  4583.  
  4584.           i1++;
  4585.         }
  4586.  
  4587.         a.sleep(100, 200);
  4588.       }
  4589.     }
  4590.     if ((a != null) && (a.VA) && (a.getRequiredLevel() <= a.SC))
  4591.     {
  4592.       if ((a.combat.getPrayerPoints() > 0) && (a.l(a) != a))
  4593.       {
  4594.         if (a.Zc()) {
  4595.           return false;
  4596.         }
  4597.  
  4598.         if (a.l(a, a))
  4599.         {
  4600.           a.sleep(100, 120);
  4601.  
  4602.           i1++;
  4603.         }
  4604.  
  4605.         a.sleep(100, 200);
  4606.       }
  4607.     }
  4608.     return false;
  4609.   }
  4610.  
  4611.   private RSTile[] K(RSTile a)
  4612.   {
  4613.     int i1 = a.getX(); int i2 = a.getY();
  4614.  
  4615.     return new RSTile[] { new RSTile(i1 + 1, i2 + 1), new RSTile(i1, i2 + 1), new RSTile(i1 - 1, i2 + 1), new RSTile(i1 - 1, i2), new RSTile(i1 - 1, i2 - 1), new RSTile(i1, i2 - 1), new RSTile(i1 + 1, i2 - 1), new RSTile(i1 + 1, i2) };
  4616.   }
  4617.  
  4618.   private ArrayList<RSTile> l(RSTile a, RSTile a, int[] a)
  4619.   {
  4620.     ArrayList localArrayList = new ArrayList();
  4621.  
  4622.     a.l(a, a, false, a);
  4623.  
  4624.     int i1 = -1;
  4625.     int i2;
  4626.     RSTile localRSTile1 = (RSTile)a.a.get(i2); RSTile localRSTile2 = (RSTile)a.a.get(i2 - 1);
  4627.  
  4628.     RSTile[] arrayOfRSTile = a.K(localRSTile2);
  4629.     int i3;
  4630.     if (i1 == -1)
  4631.     {
  4632.       if (localRSTile1.equals(arrayOfRSTile[i3]))
  4633.       {
  4634.         i1 = i3;
  4635.       }
  4636.       else {
  4637.         i3++;
  4638.       }
  4639.  
  4640.     }
  4641.     else if (!arrayOfRSTile[i1].equals(localRSTile1))
  4642.     {
  4643.       localArrayList.add(localRSTile2);
  4644.  
  4645.       i1 = -1;
  4646.  
  4647.       i2--;
  4648.     }
  4649.     i2++;
  4650.  
  4651.     localArrayList.add(a);
  4652.  
  4653.     return a.uc = localArrayList;
  4654.   }
  4655.  
  4656.   private String J(String a)
  4657.   {
  4658.     if ((a == null) || (!a.contains(" "))) {
  4659.       return "";
  4660.     }
  4661.  
  4662.     return a.contains(">") ? a.substring(a.indexOf(">") + 1, a.indexOf(" ")) : a.substring(0, a.indexOf(" "));
  4663.   }
  4664.  
  4665.   private int sA()
  4666.   {
  4667.     RSNPC localRSNPC = a.D(new int[] { 11007 });
  4668.     RSObject localRSObject;
  4669.     if ((localRSObject = a.i(new int[] { 49555, 49556, 49557, 49558, 49559, 49560 })) == null)
  4670.     {
  4671.       return -1;
  4672.     }
  4673.  
  4674.     RSTile localRSTile = localRSObject.getLocation();
  4675.  
  4676.     int[] arrayOfInt = { 49546, 49547, 49548, 54293 };
  4677.  
  4678.     if (localRSNPC != null) if (!localRSNPC.getLocation().equals(localRSTile))
  4679.       {
  4680.         if (a.jA()) {
  4681.           return 2;
  4682.         }
  4683.  
  4684.         if (!a.j()) {
  4685.           return -1;
  4686.         }
  4687.  
  4688.         a.l(a.vc, 50, 40);
  4689.  
  4690.         if ((localRSNPC = a.D(new int[] { 11007 })) != null)
  4691.         {
  4692.           int i1 = a.l(localRSNPC.getLocation(), localRSTile, arrayOfInt).size();
  4693.           Object localObject;
  4694.           if ((a.inventory.getCount(new int[] { 17375 }) < i1) && (!a.inventory.isFull()))
  4695.           {
  4696.             localObject = a.J(new String[] { "Fire" });
  4697.  
  4698.             if (a.inventory.contains(17374)) if (a.calc.distanceTo((RSObject)localObject) >= 4)
  4699.               {
  4700.                 if (a.inventory.getCount(new int[] { 17374, 17375 }) <= i1 + 1);
  4701.               }
  4702.               else
  4703.               {
  4704.                 if (!a.l("Raw vile fish", (RSObject)localObject))
  4705.                   break label353;
  4706.                 a.K(true); break label353;
  4707.               }
  4708.  
  4709.  
  4710.             if (a.l(a.J(new String[] { "Fishing spot" }), "Fish"))
  4711.             {
  4712.               a.x();
  4713.  
  4714.               a.K(true);
  4715.             }
  4716.           }
  4717.           else
  4718.           {
  4719.             label353: while (a.inventory.contains(17375))
  4720.             {
  4721.               if (a.jA())
  4722.               {
  4723.                 return 2;
  4724.               }
  4725.               if (!a.j())
  4726.               {
  4727.                 return -1;
  4728.               }
  4729.               if (localRSNPC == null)
  4730.               {
  4731.                 continue;
  4732.               }
  4733.  
  4734.               if ((localObject = localRSNPC.getLocation()) != null)
  4735.               {
  4736.                 a.l((RSTile)localObject, localRSTile, arrayOfInt);
  4737.  
  4738.                 a.vE = ((RSTile)a.uc.get(0));
  4739.  
  4740.                 if (a.vE != null) {
  4741.                   while ((a.inventory.contains(17375)) && (localRSNPC != null) && ((localRSNPC.isMoving()) || (localRSNPC.getLocation().equals(localObject))))
  4742.                   {
  4743.                     if (a.jA())
  4744.                     {
  4745.                       return 2;
  4746.                     }
  4747.                     if (!a.j())
  4748.                     {
  4749.                       return -1;
  4750.                     }
  4751.  
  4752.                     if ((localRSNPC = a.D(new int[] { 11007 })) == null)
  4753.                       continue;
  4754.                     if (localRSNPC.getLocation().equals(localRSTile))
  4755.                     {
  4756.                       break;
  4757.                     }
  4758.  
  4759.                     RSItem localRSItem = a.inventory.getSelectedItem();
  4760.  
  4761.                     if ((!a.calc.tileOnScreen(a.vE)) && (!a.Y().isMoving()))
  4762.                     {
  4763.                       a.i(a.vE, 1);
  4764.  
  4765.                       a.camera.turnToTile(a.vE, a.random(5, 15));
  4766.  
  4767.                       a.K(true);
  4768.                     }
  4769.                     else if ((localRSItem == null) || (localRSItem.getID() != 17375))
  4770.                     {
  4771.                       a.inventory.getItem(new int[] { 17375 }).doClick(true);
  4772.                     }
  4773.                     else if ((a.D(a.vE) == null) && (!a.Y().isMoving()) && (!localRSNPC.isMoving()) && (a.A(a.vE, "Use")))
  4774.                     {
  4775.                       a.K(true);
  4776.  
  4777.                       a.sleep(2000, 3000);
  4778.                     }
  4779.  
  4780.                     a.sleep(200, 400);
  4781.  
  4782.                     a.sleep(300, 400);
  4783.                   }
  4784.  
  4785.                 }
  4786.  
  4787.               }
  4788.  
  4789.             }
  4790.  
  4791.           }
  4792.  
  4793.         }
  4794.  
  4795.         a.sleep(100, 200);
  4796.       }
  4797.     return 1;
  4798.   }
  4799.  
  4800.   private boolean ZA()
  4801.   {
  4802.     RSGroundItem localRSGroundItem;
  4803.     if ((
  4804.       (localRSGroundItem = a.l(a.Zd)) == null) || ((a.ic.contains(a.r)) && ((a.l.contains(a.r)) || (!a.l(localRSGroundItem.getLocation(), false))))) {
  4805.       return true;
  4806.     }
  4807.  
  4808.     int i1 = 0;
  4809.  
  4810.     RSTile localRSTile = null;
  4811.  
  4812.     a.KC();
  4813.  
  4814.     if (a.AB.isEmpty())
  4815.     {
  4816.       a.AB = "Picking up food & keys";
  4817.  
  4818.       if (a.kf) {
  4819.         a.AB += " & bones";
  4820.       }
  4821.  
  4822.       if (a.ec) {
  4823.         a.AB += " & arrows";
  4824.       }
  4825.  
  4826.     }
  4827.  
  4828.     a.KA.reset();
  4829.  
  4830.     a.MC = false;
  4831.  
  4832.     if (a.jA())
  4833.       return false;
  4834.     if (a.AB.contains("reengage")) {
  4835.       return true;
  4836.     }
  4837.  
  4838.     if ((localRSTile != null) && ((i1 > 6) || (a.KA.getElapsed() > a.random(15000, 25000))))
  4839.     {
  4840.       if ((a.calc.distanceTo(localRSTile) > 1) || (a.Rd == 1)) if (a.l(localRSTile, a.Rd == 1))
  4841.         {
  4842.           if (a.Rd == 1)
  4843.           {
  4844.             a.A(localRSTile, 1); break label307;
  4845.           }
  4846.  
  4847.           a.F(localRSTile); break label307;
  4848.         }
  4849.       a.RD.add(localRSTile);
  4850.  
  4851.       label307: a.KA.reset();
  4852.  
  4853.       i1 = 0;
  4854.     }
  4855.  
  4856.     a.yd = a.l(a.Zd);
  4857.  
  4858.     if (a.yd != null)
  4859.     {
  4860.       localRSTile = a.yd.getLocation();
  4861.  
  4862.       if (a.Nc.size() == 1)
  4863.       {
  4864.         a.camera.setCompass('n');
  4865.       }
  4866.       else if ((!a.nE) && (a.inventory.getCount() > a.random(24, 26)) && (a.l(a.W, 101, 90)))
  4867.       {
  4868.         a.KA.reset();
  4869.  
  4870.         i1 = 0;
  4871.       }
  4872.       a.D(!a.nE);
  4873.  
  4874.       int i2 = a.inventory.getCount();
  4875.       int i3;
  4876.       if (a.l(a.yd))
  4877.       {
  4878.         a.sleep(100, 200);
  4879.  
  4880.         a.sleep(0, 400);
  4881.  
  4882.         if (a.MC)
  4883.         {
  4884.           a.l(localRSTile, 1);
  4885.  
  4886.           a.sleep(1000, 1500);
  4887.  
  4888.           a.MC = false;
  4889.         }
  4890.         else if (a.inventory.getCount() > i2)
  4891.         {
  4892.           a.KA.reset();
  4893.  
  4894.           a.KC();
  4895.  
  4896.           i1 = 0;
  4897.         }
  4898.         else
  4899.         {
  4900.           if (a.Y().isMoving())
  4901.           {
  4902.             a.KA.reset();
  4903.  
  4904.             i1 = 0;
  4905.           }
  4906.           else
  4907.           {
  4908.             i3++;
  4909.           }
  4910.  
  4911.           a.sleep(200, 250);
  4912.  
  4913.           i3++;
  4914.         }
  4915.       }
  4916.       else
  4917.       {
  4918.         i1++; i1 = !a.Y().isMoving() ? i1 : 0;
  4919.  
  4920.         a.uA();
  4921.       }
  4922.     }
  4923.     a.sleep(100, 300);
  4924.  
  4925.     a.kD();
  4926.  
  4927.     a.t();
  4928.  
  4929.     if ((!a.nE) && (a.inventory.getCount() > a.random(22, 26)) && (!a.l(a.W, 101, a.combat.getHealth() + 15)))
  4930.     {
  4931.       a.MA();
  4932.     }
  4933.     a.yd = null;
  4934.  
  4935.     a.AB = "";
  4936.  
  4937.     return true;
  4938.   }
  4939.  
  4940.   private boolean UA()
  4941.   {
  4942.     a.Qc = "Opening a blocked door";
  4943.     RSObject localRSObject;
  4944.     if (a.G(a.WA) != null)
  4945.     {
  4946.       if (a.jA())
  4947.         return false;
  4948.       localRSObject = a.G(a.WA);
  4949.  
  4950.       if (!a.iD())
  4951.       {
  4952.         a.fG.add(a.WA);
  4953.  
  4954.         a.Bd.remove(a.WA);
  4955.  
  4956.         a.w.remove(a.WA);
  4957.  
  4958.         a.J.remove(a.WA);
  4959.  
  4960.         a.fA.remove(a.nD);
  4961.  
  4962.         return true;
  4963.       }
  4964.       if (a.l(localRSObject))
  4965.       {
  4966.         a.K(false);
  4967.  
  4968.         a.l(a.vc, 50, 50);
  4969.       }
  4970.       else if (localRSObject != null)
  4971.       {
  4972.         a.sleep(100, 200);
  4973.       }
  4974.  
  4975.       if (a.Rc())
  4976.       {
  4977.         a.l(a.vc, 70, 50);
  4978.  
  4979.         a.sleep(900, 1500);
  4980.       }
  4981.       a.sleep(100, 200);
  4982.     }
  4983.  
  4984.     a.J.remove(a.WA);
  4985.  
  4986.     a.fA.remove(a.WA);
  4987.  
  4988.     a.Bd.remove(a.WA);
  4989.  
  4990.     a.gc.remove(a.WA);
  4991.  
  4992.     a.w.remove(a.WA);
  4993.  
  4994.     if (a.ZA != null);
  4995.     if (a.jA())
  4996.     {
  4997.       return false;
  4998.     }
  4999.  
  5000.     a.uA();
  5001.  
  5002.     if ((a.nD != null) && (a.FA != null)) if (a.FA.contains(new RSTile[] { a.nD }))
  5003.       {
  5004.         if ((
  5005.           (localRSObject = a.G(a.nD)) != null) && (a.MC))
  5006.         {
  5007.           localRSObject.doClick();
  5008.  
  5009.           a.K(false);
  5010.  
  5011.           a.MC = false;
  5012.         }
  5013.  
  5014.         if (a.l(a.G(a.nD)))
  5015.         {
  5016.           a.K(false);
  5017.  
  5018.           if (a.i(false))
  5019.           {
  5020.             return true;
  5021.           }
  5022.         }
  5023.         else
  5024.         {
  5025.           a.sleep(100, 200);
  5026.         }
  5027.       }
  5028.     a.sleep(100, 200);
  5029.  
  5030.     return true;
  5031.   }
  5032.  
  5033.   private void wA()
  5034.   {
  5035.     RSNPC localRSNPC1 = a.i(new String[] { "Gluttonous behemoth" });
  5036.  
  5037.     RSNPC localRSNPC2 = a.i(new String[] { "Bloodchiller" });
  5038.  
  5039.     RSNPC localRSNPC3 = a.i(new String[] { "Luminescent" });
  5040.  
  5041.     RSNPC localRSNPC4 = a.i(new String[] { "Lakhrahnaz" });
  5042.  
  5043.     RSObject localRSObject1 = a.objects.getNearest(new int[] { 49283 });
  5044.  
  5045.     a.l(a.UC, 50, 60);
  5046.     Object localObject2;
  5047.     int i3;
  5048.     int i4;
  5049.     if (localRSObject1 != null)
  5050.     {
  5051.       a.Qc = "Killing the Gluttonous Behemoth!";
  5052.  
  5053.       if (a.tc.isEmpty())
  5054.       {
  5055.         a.log(a.Qc);
  5056.  
  5057.         a.tc = "Gluttonous Behemoth";
  5058.       }
  5059.  
  5060.       a.PD = (a.bC != -1 ? a.bC : a.xb);
  5061.  
  5062.       a.A(true);
  5063.  
  5064.       RSTile localRSTile1 = localRSObject1.getLocation();
  5065.  
  5066.       if (
  5067.         (localObject2 = a.F(localRSTile1, new int[] { 51180 })) != null)
  5068.       {
  5069.         RSTile[] arrayOfRSTile;
  5070.         i3 = (arrayOfRSTile = a.h(localRSTile1)).length; RSTile localRSTile2 = arrayOfRSTile[i4];
  5071.         int i7;
  5072.         if ((i7 = (int)a.calc.distanceBetween(localRSTile2, (RSTile)localObject2)) ==
  5073.           3)
  5074.         {
  5075.           a.vE = localRSTile2;
  5076.         }
  5077.         else {
  5078.           i4++;
  5079.         }
  5080.  
  5081.       }
  5082.  
  5083.       if (a.vE == null)
  5084.       {
  5085.         a.log.severe("Unable to calculate the tile to protect");
  5086.  
  5087.         a.vE = localRSTile1;
  5088.       }
  5089.       a.l(a.vE, 0);
  5090.  
  5091.       a.l(a.QC, Combat.Prayer.PROTECT_FROM_MAGIC, true);
  5092.  
  5093.       a.F();
  5094.  
  5095.       if (a.jA())
  5096.       {
  5097.         return;
  5098.       }
  5099.       if ((localRSNPC1 != null) && (localRSNPC1.getAnimation() == 13720))
  5100.       {
  5101.         a.iE += 1;
  5102.  
  5103.         if (a.iE > 2)
  5104.         {
  5105.           a.log.severe("Unable to kill the Behemoth, aborting dungeon");
  5106.  
  5107.           a.nc = true;
  5108.  
  5109.           return;
  5110.         }
  5111.  
  5112.         if (localRSNPC1 != null)
  5113.         {
  5114.           a.AB = "Waiting for the behemoth to eat";
  5115.  
  5116.           a.JC();
  5117.  
  5118.           a.sleep(300, 500);
  5119.         }
  5120.       }
  5121.       if (a.calc.distanceTo(a.vE) > 1)
  5122.       {
  5123.         a.AB = "Repositioning to guard the food";
  5124.  
  5125.         if (!a.Y().isMoving())
  5126.         {
  5127.           a.A(a.vE, 0);
  5128.         }
  5129.         a.K(false);
  5130.  
  5131.         a.i(localRSNPC1);
  5132.  
  5133.         a.AB = "";
  5134.       }
  5135.  
  5136.       a.l(a.UC, 50, 60);
  5137.  
  5138.       a.sleep(200, 300);
  5139.     }
  5140.     else
  5141.     {
  5142.       if (!a.tc.equals("Astea Frostweb"))
  5143.       {
  5144.         if (a.i(new String[] { "Frostweb" }) == null);
  5145.       }
  5146.       else
  5147.       {
  5148.         int i1 = 0;
  5149.  
  5150.         a.Qc = "Killing Astea Frostweb!";
  5151.  
  5152.         if (a.tc.isEmpty())
  5153.         {
  5154.           a.log(a.Qc);
  5155.  
  5156.           a.tc = "Astea Frostweb";
  5157.         }
  5158.         a.l(a.QC, Combat.Prayer.PROTECT_FROM_MAGIC, true);
  5159.  
  5160.         if (a.Sd)
  5161.           a.i(2);
  5162.         else {
  5163.           a.PD = a.xb;
  5164.         }
  5165.  
  5166.         if (a.jA()) {
  5167.           return;
  5168.         }
  5169.  
  5170.         if ((localObject2 = a.i(new String[] { "Frostweb" })) != null)
  5171.         {
  5172.           int i2 = ((RSNPC)localObject2).getID(); i3 = 1;
  5173.  
  5174.           i1 = 0;
  5175.  
  5176.           if (a.HC == 2)
  5177.           {
  5178.             i3 = 3;
  5179.           }
  5180.           else if (a.HC == 3) {
  5181.             i3 = 2;
  5182.           }
  5183.  
  5184.           if (i2 == i4) {
  5185.             i1 = 1;
  5186.           }
  5187.           else
  5188.           {
  5189.             i4 += 3;
  5190.           }
  5191.  
  5192.           a.AB = (i1 != 0 ? "Astea is protecting against us!" : "");
  5193.  
  5194.           if (a.SE.contains("A magical force"))
  5195.           {
  5196.             a.SE = "";
  5197.  
  5198.             a.JC();
  5199.           }
  5200.           else
  5201.           {
  5202.             RSNPC localRSNPC5;
  5203.             if (a.MC)
  5204.             {
  5205.               localRSNPC5 = a.i(new String[] { "spider" });
  5206.  
  5207.               if ((a.HC == 1) && (localRSNPC5 != null))
  5208.               {
  5209.                 if (a.F(localRSNPC5))
  5210.                 {
  5211.                   a.sleep(500, 800);
  5212.                 }
  5213.               }
  5214.               else if (a.JC())
  5215.               {
  5216.                 a.sleep(200, 300);
  5217.               }
  5218.               else if ((a.HC == 1) && (a.calc.distanceTo((RSCharacter)localObject2) > 1))
  5219.                 a.i((RSNPC)localObject2);
  5220.               a.MC = false;
  5221.             }
  5222.             else if (i1 != 0)
  5223.             {
  5224.               if (
  5225.                 (localRSNPC5 = a.i(new String[] { "spider" })) != null)
  5226.               {
  5227.                 if (a.F(localRSNPC5))
  5228.                 {
  5229.                   a.sleep(500, 800);
  5230.                 }
  5231.               }
  5232.               else if (a.JC())
  5233.               {
  5234.                 a.sleep(200, 300);
  5235.               }
  5236.               else if ((a.HC == 1) && (a.calc.distanceTo((RSCharacter)localObject2) > 1))
  5237.               {
  5238.                 a.i((RSNPC)localObject2);
  5239.               }
  5240.               a.MC = false;
  5241.             }
  5242.             else
  5243.             {
  5244.               a.i((RSNPC)localObject2);
  5245.             }
  5246.           }
  5247.           a.l(a.UC, 50, 55);
  5248.         }
  5249.  
  5250.         a.sleep(200, 300);
  5251.  
  5252.         break label2523; } if (!a.tc.equals("Icy Bones")) { if (a.i(new String[] { "Bones" }) == null);
  5253.       }
  5254.       else
  5255.       {
  5256.         a.Qc = "Killing Icy Bones!";
  5257.  
  5258.         if (a.tc.isEmpty())
  5259.         {
  5260.           a.log(a.Qc);
  5261.  
  5262.           a.tc = "Icy Bones";
  5263.         }
  5264.  
  5265.         a.l(a.QC, Combat.Prayer.PROTECT_FROM_MELEE, true);
  5266.  
  5267.         a.PD = a.Gd;
  5268.  
  5269.         if (a.h())
  5270.           break label2523;
  5271.         return;
  5272.       }
  5273.       Object localObject1;
  5274.       if ((a.tc.equals("Luminescent Icefiend")) || (localRSNPC3 != null))
  5275.       {
  5276.         localObject1 = null;
  5277.  
  5278.         a.Qc = "Killing the Luminescent Icefiend!";
  5279.  
  5280.         if (a.tc.isEmpty())
  5281.         {
  5282.           a.log(a.Qc);
  5283.  
  5284.           a.tc = "Luminescent Icefiend";
  5285.         }
  5286.  
  5287.         a.vE = null;
  5288.  
  5289.         a.l(false, Combat.Prayer.PROTECT_FROM_MISSILES, true);
  5290.  
  5291.         a.PD = (a.bC != -1 ? a.bC : a.xb);
  5292.  
  5293.         if (a.jA()) {
  5294.           return;
  5295.         }
  5296.  
  5297.         if ((localRSNPC3 = a.i(new String[] { "Luminescent" })) != null)
  5298.         {
  5299.           if (localRSNPC3.getAnimation() == 13338)
  5300.           {
  5301.             if ((
  5302.               (localObject2 = a.i(new int[] { 51300 })) == null) || (a.walking.getEnergy() < a.random(8, 13)))
  5303.             {
  5304.               a.AB = (localObject2 != null ? "Out of run.. Eating after the attack" : "Eating after the attack");
  5305.             }
  5306.             while (localRSNPC3.getAnimation() == 13338)
  5307.             {
  5308.               a.sleep(100, 200); continue;
  5309.               RSObject localRSObject2;
  5310.               if (
  5311.                 (localRSObject2 = a.l((RSObject)localObject2, new int[] { 51300 })) != null)
  5312.                 localObject1 = localRSObject2.getLocation();
  5313.               a.AB = "Dodging the icicles!";
  5314.  
  5315.               if (!a.walking.isRunEnabled())
  5316.                 a.walking.setRun(true);
  5317.               else {
  5318.                 a.sleep(500, 700);
  5319.               }
  5320.  
  5321.               a.sleep(300, 400);
  5322.  
  5323.               a.vE = ((RSObject)localObject2).getLocation();
  5324.               int i6;
  5325.               label1722: while ((localRSNPC3 != null) && (localRSNPC3.getAnimation() == 13338)) { if (!a.nb.contains(new RSTile[] { a.X() }))
  5326.                   break;
  5327.                 if (a.jA())
  5328.                 {
  5329.                   return;
  5330.                 }
  5331.  
  5332.                 if (a.vE != null)
  5333.                 {
  5334.                   a.l(a.vE, 1);
  5335.  
  5336.                   a.l(true);
  5337.  
  5338.                   if ((!a.Y().isMoving()) || (a.Y().getAnimation() != -1))
  5339.                   {
  5340.                     a.l(a.vE, 1);
  5341.  
  5342.                     a.sleep(500, 800);
  5343.                   }
  5344.                   a.sleep(30, 50);
  5345.                 }
  5346.  
  5347.                 if (localRSNPC3.getAnimation() != 13338)
  5348.                   break;
  5349.                 RSObject[] arrayOfRSObject;
  5350.                 int i5 = (arrayOfRSObject = a.J(new int[] { 51300 })).length;
  5351.                 RSObject localRSObject3;
  5352.                 if ((localRSObject3 = arrayOfRSObject[i6]) != null)
  5353.                 {
  5354.                   RSTile localRSTile3 = localRSObject3.getLocation();
  5355.  
  5356.                   if (((localObject1 == null) || (!localRSTile3.equals(localObject1))) && ((a.vE == null) || ((!localRSTile3.equals(a.vE)) && ((localRSTile3.getX() == a.vE.getX()) || (localRSTile3.getY() == a.vE.getY())))))
  5357.                   {
  5358.                     localObject1 = a.vE;
  5359.  
  5360.                     a.vE = localRSTile3;
  5361.  
  5362.                     break label1722;
  5363.                   }
  5364.  
  5365.                 }
  5366.  
  5367.                 i6++;
  5368.               }
  5369.               a.l(a.UC, 15, 15);
  5370.  
  5371.               if (localRSNPC3 != null) {
  5372.                 a.A(localRSNPC3.getLocation(), 1);
  5373.               }
  5374.  
  5375.               a.vE = null;
  5376.             }
  5377.             a.AB = "";
  5378.           }
  5379.           a.i(localRSNPC3);
  5380.  
  5381.           a.l(a.UC, 40, 40);
  5382.         }
  5383.         a.sleep(200, 300);
  5384.       }
  5385.       else if ((a.tc.equals("Plane-Freezer Lakhrahnaz")) || (localRSNPC4 != null))
  5386.       {
  5387.         a.Qc = "Killing Plane-freezer Lakhrahnaz!";
  5388.  
  5389.         if (a.tc.isEmpty())
  5390.         {
  5391.           a.log(a.Qc);
  5392.  
  5393.           a.tc = "Plane-Freezer Lakhrahnaz";
  5394.         }
  5395.  
  5396.         if (a.Sd)
  5397.           a.i(2);
  5398.         else {
  5399.           a.PD = (a.bC != -1 ? a.bC : a.xb);
  5400.         }
  5401.  
  5402.         a.l(false, Combat.Prayer.PROTECT_FROM_MISSILES, true);
  5403.  
  5404.         if (a.jA()) {
  5405.           return;
  5406.         }
  5407.  
  5408.         if (
  5409.           (localRSNPC4 = a.i(new String[] { "Lakhrahnaz" })) != null)
  5410.         {
  5411.           if (((a.MC) || ((a.HC == 1) && (a.calc.distanceTo(localRSNPC4) > 2))) && (!a.Y().isMoving()))
  5412.           {
  5413.             a.A(localRSNPC4.getLocation(), 0);
  5414.  
  5415.             a.MC = false;
  5416.           }
  5417.           localObject1 = a.objects.getNearest(new int[] { 49334 });
  5418.  
  5419.           if ((!a.l(localRSNPC4)) && (a.calc.distanceTo(localRSNPC4) < 3) && (!a.Y().isMoving()) && (localObject1 != null) && (a.calc.distanceTo((RSObject)localObject1) < 3))
  5420.           {
  5421.             a.A(a.X(), 2);
  5422.  
  5423.             a.l(false);
  5424.           }
  5425.  
  5426.           a.i(localRSNPC4);
  5427.  
  5428.           a.l(a.UC, 45, 55);
  5429.         }
  5430.         a.sleep(100, 200);
  5431.  
  5432.         if ((localObject1 = a.objects.getNearest(a.gb)) != null)
  5433.         {
  5434.           a.l(((RSObject)localObject1).getLocation(), 1);
  5435.  
  5436.           a.K(false);
  5437.  
  5438.           if ((localObject2 = a.objects.getNearest(new int[] { 49334 })) != null)
  5439.           {
  5440.             a.AB = "Navigating to the nearest corner";
  5441.  
  5442.             while (localObject2 != null) { if ((localObject1 == null) || (a.calc.distanceTo((RSObject)localObject1) <= 1))
  5443.                 break;
  5444.               if (a.jA())
  5445.               {
  5446.                 return;
  5447.               }
  5448.               if ((localObject2 = a.objects.getNearest(new int[] { 49334 })) == null)
  5449.               {
  5450.                 continue;
  5451.               }
  5452.  
  5453.               a.vE = ((RSObject)localObject2).getLocation();
  5454.  
  5455.               if (!a.Y().isMoving())
  5456.               {
  5457.                 a.A(a.vE, 0);
  5458.               }
  5459.               if (!a.Y().isMoving())
  5460.                 a.A(a.X(), 5);
  5461.               a.sleep(300, 400);
  5462.             }
  5463.  
  5464.             a.l(((RSObject)localObject1).getLocation(), 0);
  5465.  
  5466.             a.AB = "";
  5467.           }
  5468.         }
  5469.       }
  5470.       else
  5471.       {
  5472.         if ((a.tc.equals("Blood Chiller")) || (localRSNPC2 != null))
  5473.         {
  5474.           a.Qc = "Killing the Blood Chiller!";
  5475.  
  5476.           if (a.tc.isEmpty())
  5477.           {
  5478.             a.log(a.Qc);
  5479.  
  5480.             a.tc = "Blood Chiller";
  5481.           }
  5482.           a.l(a.QC, null, false);
  5483.  
  5484.           a.PD = (a.bC != -1 ? a.bC : a.Gd);
  5485.         }
  5486.         while (a.objects.getNearest(a.gb) == null)
  5487.         {
  5488.           if (a.jA()) {
  5489.             return;
  5490.           }
  5491.  
  5492.           if (a.MC)
  5493.           {
  5494.             a.l(a.vc, 85, 30);
  5495.  
  5496.             a.MC = false;
  5497.           }
  5498.  
  5499.           a.i(localRSNPC2);
  5500.  
  5501.           a.l(a.UC, 50, 60);
  5502.  
  5503.           a.sleep(200, 300); continue;
  5504.  
  5505.           a.Qc = "Killing an unknown boss...";
  5506.  
  5507.           a.log(a.Qc);
  5508.  
  5509.           a.l(a.QC, null, false);
  5510.  
  5511.           if (a.h())
  5512.             break;
  5513.           return;
  5514.         }
  5515.  
  5516.       }
  5517.  
  5518.     }
  5519.  
  5520.     label2523: a.Ke = true;
  5521.   }
  5522.  
  5523.   private int TA()
  5524.   {
  5525.     int[] arrayOfInt1 = null; int[] arrayOfInt2 = null;
  5526.  
  5527.     int i1 = 0;
  5528.  
  5529.     int i2 = 1; int i3 = 1;
  5530.  
  5531.     int[] arrayOfInt3 = { 49348, 49349, 49350, 54408 };
  5532.  
  5533.     RSObject localRSObject1 = a.i(new int[] { 49345, 49346, 49347, 49348, 49349, 49350, 54407, 54408 });
  5534.  
  5535.     RSObject localRSObject2 = a.i(new int[] { 49351, 49352, 49353, 54409 });
  5536.  
  5537.     RSTile localRSTile1 = null;
  5538.  
  5539.     if ((localRSObject1 == null) || (localRSObject2 == null)) {
  5540.       return -1;
  5541.     }
  5542.  
  5543.     RSTile localRSTile2 = localRSObject1.getLocation();
  5544.  
  5545.     RSTile localRSTile3 = localRSObject2.getLocation();
  5546.  
  5547.     if (localRSTile2.getX() - localRSTile3.getX() < -4)
  5548.     {
  5549.       i2 = 1;
  5550.  
  5551.       i3 = 1;
  5552.  
  5553.       localRSTile1 = a.r.getNearestTile(a.y);
  5554.     }
  5555.  
  5556.     if (localRSTile2.getX() - localRSTile3.getX() > 4)
  5557.     {
  5558.       i2 = -1;
  5559.  
  5560.       i3 = -1;
  5561.  
  5562.       localRSTile1 = a.r.getNearestTile(new RSTile(20000, 20000));
  5563.     }
  5564.     if (localRSTile2.getY() - localRSTile3.getY() < -4)
  5565.     {
  5566.       i2 = -1;
  5567.  
  5568.       i3 = 1;
  5569.  
  5570.       localRSTile1 = a.r.getNearestTile(new RSTile(20000, 0));
  5571.  
  5572.       i1 = 1;
  5573.     }
  5574.     if (localRSTile2.getY() - localRSTile3.getY() > 4)
  5575.     {
  5576.       i2 = 1;
  5577.  
  5578.       i3 = -1;
  5579.  
  5580.       localRSTile1 = a.r.getNearestTile(new RSTile(0, 20000));
  5581.  
  5582.       i1 = 1;
  5583.     }
  5584.     int i4 = 0; int i5 = 0;
  5585.  
  5586.     if (localRSTile1 == null)
  5587.       return -1;
  5588.     i4 = localRSTile1.getX();
  5589.  
  5590.     i5 = localRSTile1.getY();
  5591.  
  5592.     RSTile[] arrayOfRSTile1 = { new RSTile(i4 + 14 * i2, i5 + 5 * i3), new RSTile(i4 + 14 * i2, i5 + 7 * i3), new RSTile(i4 + 14 * i2, i5 + 12 * i3), new RSTile(i4 + 13 * i2, i5 + 8 * i3), new RSTile(i4 + 13 * i2, i5 + 6 * i3), new RSTile(i4 + 11 * i2, i5 + 2 * i3), new RSTile(i4 + 11 * i2, i5 + 7 * i3), new RSTile(i4 + 10 * i2, i5 + 3 * i3), new RSTile(i4 + 10 * i2, i5 + 8 * i3), new RSTile(i4 + 10 * i2, i5 + 13 * i3), new RSTile(i4 + 8 * i2, i5 + 1 * i3), new RSTile(i4 + 8 * i2, i5 + 4 * i3), new RSTile(i4 + 8 * i2, i5 + 10 * i3), new RSTile(i4 + 8 * i2, i5 + 14 * i3), new RSTile(i4 + 7 * i2, i5 + 5 * i3), new RSTile(i4 + 6 * i2, i5 + 3 * i3), new RSTile(i4 + 6 * i2, i5 + 11 * i3), new RSTile(i4 + 5 * i2, i5 + 2 * i3), new RSTile(i4 + 5 * i2, i5 + 7 * i3), new RSTile(i4 + 5 * i2, i5 + 12 * i3), new RSTile(i4 + 4 * i2, i5 + 6 * i3), new RSTile(i4 + 4 * i2, i5 + 9 * i3), new RSTile(i4 + 4 * i2, i5 + 13 * i3), new RSTile(i4 + 4 * i2, i5 + 14 * i3), new RSTile(i4 + 3 * i2, i5 + 9 * i3), new RSTile(i4 + 2 * i2, i5 + 7 * i3), new RSTile(i4 + 1 * i2, i5 + 3 * i3), new RSTile(i4 + 1 * i2, i5 + 9 * i3), new RSTile(i4 + 1 * i2, i5 + 11 * i3) };
  5593.  
  5594.     RSTile[] arrayOfRSTile2 = { new RSTile(i4 + 5 * i2, i5 + 14 * i3), new RSTile(i4 + 7 * i2, i5 + 14 * i3), new RSTile(i4 + 12 * i2, i5 + 14 * i3), new RSTile(i4 + 8 * i2, i5 + 13 * i3), new RSTile(i4 + 6 * i2, i5 + 12 * i3), new RSTile(i4 + 2 * i2, i5 + 11 * i3), new RSTile(i4 + 7 * i2, i5 + 11 * i3), new RSTile(i4 + 3 * i2, i5 + 10 * i3), new RSTile(i4 + 8 * i2, i5 + 10 * i3), new RSTile(i4 + 13 * i2, i5 + 10 * i3), new RSTile(i4 + 1 * i2, i5 + 8 * i3), new RSTile(i4 + 4 * i2, i5 + 8 * i3), new RSTile(i4 + 10 * i2, i5 + 8 * i3), new RSTile(i4 + 14 * i2, i5 + 8 * i3), new RSTile(i4 + 5 * i2, i5 + 7 * i3), new RSTile(i4 + 3 * i2, i5 + 6 * i3), new RSTile(i4 + 11 * i2, i5 + 6 * i3), new RSTile(i4 + 2 * i2, i5 + 5 * i3), new RSTile(i4 + 7 * i2, i5 + 5 * i3), new RSTile(i4 + 12 * i2, i5 + 5 * i3), new RSTile(i4 + 6 * i2, i5 + 4 * i3), new RSTile(i4 + 9 * i2, i5 + 4 * i3), new RSTile(i4 + 13 * i2, i5 + 4 * i3), new RSTile(i4 + 14 * i2, i5 + 4 * i3), new RSTile(i4 + 9 * i2, i5 + 3 * i3), new RSTile(i4 + 7 * i2, i5 + 2 * i3), new RSTile(i4 + 3 * i2, i5 + 1 * i3), new RSTile(i4 + 9 * i2, i5 + 1 * i3), new RSTile(i4 + 11 * i2, i5 + 1 * i3) };
  5595.     RSObject localRSObject3;
  5596.     RSObject localRSObject4;
  5597.     RSObject localRSObject5;
  5598.     RSObject localRSObject6;
  5599.     RSObject localRSObject7;
  5600.     if (i1 != 0)
  5601.     {
  5602.       a.Wd = arrayOfRSTile1;
  5603.  
  5604.       localRSObject3 = a.G(new RSTile(i4 + 4 * i2, i5 + 5 * i3));
  5605.  
  5606.       localRSObject4 = a.G(new RSTile(i4 + 9 * i2, i5 + 2 * i3));
  5607.  
  5608.       localRSObject5 = a.G(new RSTile(i4 + 5 * i2, i5 + 2 * i3));
  5609.  
  5610.       localRSObject6 = a.G(new RSTile(i4 + 3 * i2, i5 + 5 * i3));
  5611.  
  5612.       localRSObject7 = a.G(new RSTile(i4 + 3 * i2, i5 + 1 * i3));
  5613.     }
  5614.     else
  5615.     {
  5616.       a.Wd = arrayOfRSTile2;
  5617.  
  5618.       localRSObject3 = a.G(new RSTile(i4 + 5 * i2, i5 + 4 * i3));
  5619.  
  5620.       localRSObject4 = a.G(new RSTile(i4 + 2 * i2, i5 + 9 * i3));
  5621.  
  5622.       localRSObject5 = a.G(new RSTile(i4 + 2 * i2, i5 + 5 * i3));
  5623.  
  5624.       localRSObject6 = a.G(new RSTile(i4 + 5 * i2, i5 + 3 * i3));
  5625.  
  5626.       localRSObject7 = a.G(new RSTile(i4 + 1 * i2, i5 + 3 * i3));
  5627.     }
  5628.  
  5629.     int[] arrayOfInt4 = { 54412, 54413, 54414, 54415, 54416 };
  5630.  
  5631.     if (((localRSObject3 != null) && (localRSObject3.getID() > 49359) && (localRSObject3.getID() < 49375)) || (a.l(localRSObject3.getID(), arrayOfInt4)))
  5632.     {
  5633.       arrayOfInt1 = new int[] { 14, 29, 27, 26, 16, 7, 15 };
  5634.  
  5635.       arrayOfInt2 = new int[] { 15, 7, 16, 26, 27, 0, 29, 10, 4, 1, 0 };
  5636.     }
  5637.     else if (((localRSObject5 != null) && (localRSObject5.getID() > 49359) && (localRSObject5.getID() < 49375)) || (a.l(localRSObject5.getID(), arrayOfInt4)))
  5638.     {
  5639.       arrayOfInt1 = new int[] { 14, 26, 16, 8, 4, 10, 20, 7, 13 };
  5640.  
  5641.       arrayOfInt2 = new int[] { 15, 7, 20, 10, 1, 0, 0, 11, 4, 8, 16, 26, 29, 0 };
  5642.     }
  5643.     else if (((localRSObject6 != null) && (localRSObject6.getID() > 49359) && (localRSObject6.getID() < 49375)) || (a.l(localRSObject6.getID(), arrayOfInt4)))
  5644.     {
  5645.       arrayOfInt1 = new int[] { 14, 24, 29, 26, 10, 4, 8, 7, 15 };
  5646.  
  5647.       arrayOfInt2 = new int[] { 13, 7, 8, 4, 1, 0, 1, 10, 26, 27, 0, 0 };
  5648.     }
  5649.     else if (((localRSObject4 != null) && (localRSObject4.getID() > 49359) && (localRSObject4.getID() < 49375)) || (a.l(localRSObject4.getID(), arrayOfInt4)))
  5650.     {
  5651.       arrayOfInt1 = new int[] { 14, 1, 11, 27, 29, 26, 16, 22, 13 };
  5652.  
  5653.       arrayOfInt2 = new int[] { 15, 22, 16, 26, 29, 0, 27, 11, 0, 0 };
  5654.     }
  5655.     else if (((localRSObject7 != null) && (localRSObject7.getID() > 49359) && (localRSObject7.getID() < 49375)) || (a.l(localRSObject7.getID(), arrayOfInt4)))
  5656.     {
  5657.       arrayOfInt1 = new int[] { 14, 29, 27, 4, 8, 22, 15 };
  5658.  
  5659.       arrayOfInt2 = new int[] { 15, 22, 8, 4, 1, 0, 0, 11, 27, 0 };
  5660.     }
  5661.     else
  5662.     {
  5663.       return -1;
  5664.     }
  5665.  
  5666.     if (a.jA())
  5667.       return 2;
  5668.     a.l(a.G(localRSTile3), "Pull");
  5669.  
  5670.     a.K(false);
  5671.  
  5672.     a.IC = false;
  5673.  
  5674.     while ((a.i(arrayOfInt3) == null) || (a.nD == null) || (!a.KD))
  5675.     {
  5676.       a.cB = arrayOfInt1;
  5677.  
  5678.       if (a.calc.distanceTo(localRSTile2) < 3)
  5679.       {
  5680.         a.cB = arrayOfInt2;
  5681.       }
  5682.       else
  5683.       {
  5684.         return a.calc.distanceTo(localRSTile3) < 4 ?
  5685.           a : -1;
  5686.       }
  5687.       int i6;
  5688.       if (a.AA()) {
  5689.         a.n();
  5690.       }
  5691.       else if (a.jA())
  5692.         return 2;
  5693.       Object localObject;
  5694.       int i8;
  5695.       if (a.cB[i6] == 0)
  5696.       {
  5697.         a.lA();
  5698.  
  5699.         if (a.nD == null) {
  5700.           return -1;
  5701.         }
  5702.  
  5703.         localObject = a.G(a.nD);
  5704.  
  5705.         a.vE = (localObject == null ? a.nD : ((RSObject)localObject).getArea().getNearestTile(a.X()));
  5706.  
  5707.         a.l(a.vE, 1);
  5708.  
  5709.         a.l(false);
  5710.  
  5711.         a.K(false);
  5712.  
  5713.         if ((a.i(a.X())) && (a.calc.distanceTo(a.vE) < 3))
  5714.         {
  5715.           a.KD = true;
  5716.  
  5717.           break label3590;
  5718.         }
  5719.       }
  5720.       else
  5721.       {
  5722.         a.vE = a.Wd[(a.cB[i6] - 1)];
  5723.  
  5724.         if (a.cB == arrayOfInt2)
  5725.         {
  5726.           a.lA();
  5727.         }
  5728.  
  5729.         localObject = new Timer(a.random(45000, 90000));
  5730.  
  5731.         while ((a.Y().getAnimation() != 9516) || (a.calc.distanceTo(a.vE) > 2))
  5732.         {
  5733.           if (!((Timer)localObject).isRunning())
  5734.           {
  5735.             a.uC = "We got stuck";
  5736.  
  5737.             return -1;
  5738.           }
  5739.  
  5740.           if (a.AA())
  5741.           {
  5742.             a.n();
  5743.           }
  5744.           else if (a.jA())
  5745.           {
  5746.             return 2;
  5747.           }
  5748.  
  5749.           if ((a.Y().getAnimation() == -1) && (a.l(a.G(a.vE), "Go-through")))
  5750.           {
  5751.             a.sleep(100, 200);
  5752.  
  5753.             if ((a.Y().getAnimation() == 9516) && (a.calc.distanceTo(a.vE) < 3))
  5754.               break;
  5755.             a.sleep(200, 300);
  5756.  
  5757.             i8++; continue;
  5758.           }
  5759.  
  5760.           while ((!a.calc.tileOnScreen(a.vE)) && (a.Y().isMoving()) && (a.Y().getAnimation() == -1))
  5761.             a.sleep(200, 300);
  5762.         }
  5763.         a.K(true);
  5764.  
  5765.         a.sleep(300, 400);
  5766.       }
  5767.  
  5768.       i6++;
  5769.       label3590: RSObject localRSObject8;
  5770.       if ((
  5771.         (localRSObject8 = a.i(new int[] { 49345, 49346, 49347, 54407 })) != null) && (a.calc.distanceTo(localRSObject8) < 3))
  5772.       {
  5773.         if (a.AA())
  5774.         {
  5775.           a.n();
  5776.         }
  5777.         else if (a.jA()) {
  5778.           return -1;
  5779.         }
  5780.  
  5781.         a.l(a.i(new int[] { 49345, 49346, 49347, 54407 }), "Open");
  5782.  
  5783.         a.K(false);
  5784.  
  5785.         a.EA();
  5786.  
  5787.         if (a.yd != null)
  5788.         {
  5789.           int i7 = a.yd.getItem().getID();
  5790.  
  5791.           a.l(a.yd);
  5792.  
  5793.           a.sleep(400, 600);
  5794.  
  5795.           i8++;
  5796.         }
  5797.         a.K(false);
  5798.  
  5799.         a.lA();
  5800.       }
  5801.     }
  5802.     a.NA = true;
  5803.  
  5804.     return 1;
  5805.   }
  5806.  
  5807.   private boolean l(int arg0, int arg1, int arg2, int arg3)
  5808.   {
  5809.     return true;
  5810.   }
  5811.  
  5812.   private int OA()
  5813.   {
  5814.     int[] arrayOfInt = { 39912, 39913, 39920, 39929, 39931 };
  5815.  
  5816.     boolean bool = false;
  5817.  
  5818.     RSObject localRSObject1 = a.i(new int[] { 54565, 54567, 54645 });
  5819.  
  5820.     RSObject localRSObject2 = a.i(new int[] { 49934, 49935, 49936, 53749 });
  5821.  
  5822.     RSObject localRSObject3 = a.i(new int[] { 39917, 39928, 39947, 54647 });
  5823.  
  5824.     RSObject localRSObject4 = a.i(new int[] { 54566, 54568, 54570, 54646 });
  5825.  
  5826.     RSObject localRSObject5 = a.i(new int[] { 54257, 54258, 54259, 54260 });
  5827.  
  5828.     a.jA = a.npcs.getNearest(a.B);
  5829.  
  5830.     if ((a.jA != null) && ((a.HC != 1) || (a.l(a.jA.getLocation(), false))))
  5831.     {
  5832.       if ((!a.QB()) || ((a.HC == 1) && (!a.ZA())))
  5833.       {
  5834.         return 2;
  5835.       }
  5836.     }
  5837.     bool = a.F(a.u) == null;
  5838.  
  5839.     a.A(bool);
  5840.  
  5841.     if (a.hd == null)
  5842.     {
  5843.       a.hd = new Timer(a.random(240000, 300000));
  5844.     }
  5845.  
  5846.     do
  5847.     {
  5848.       if (a.jA()) {
  5849.         return 2;
  5850.       }
  5851.  
  5852.       if (!a.j()) {
  5853.         return -1;
  5854.       }
  5855.  
  5856.       a.l(a.vc, 50, 50);
  5857.  
  5858.       if (a.i(arrayOfInt) != null)
  5859.       {
  5860.         if (a.inventory.contains(19668))
  5861.         {
  5862.           if (a.l("Climbing hook", a.J(new String[] { "Bridge" })))
  5863.           {
  5864.             a.l(bool);
  5865.  
  5866.             a.K(true);
  5867.  
  5868.             a.sleep(300, 500);
  5869.           }
  5870.         }
  5871.         else if (a.inventory.containsAll(new int[] { 19667, 19664 }))
  5872.         {
  5873.           a.inventory.useItem(a.inventory.getItem(new int[] { 19667 }), a.inventory.getItem(new int[] { 19664 }));
  5874.         }
  5875.         else if ((a.inventory.contains(19665)) && (!a.inventory.contains(19667)))
  5876.         {
  5877.           a.l(localRSObject2, "Spin");
  5878.  
  5879.           a.K(true);
  5880.         }
  5881.         else if ((a.inventory.contains(19663)) && (!a.inventory.contains(19664)))
  5882.         {
  5883.           a.l(localRSObject5, "Smith");
  5884.         }
  5885.         else if (!a.inventory.containsOneOf(new int[] { 19665, 19667 }))
  5886.         {
  5887.           a.l(localRSObject4, "Take-from");
  5888.         }
  5889.         else if (!a.inventory.containsOneOf(new int[] { 19663, 19664 }))
  5890.         {
  5891.           a.l(localRSObject1, "Take-from");
  5892.         }
  5893.  
  5894.       }
  5895.       else if (a.l(localRSObject3, "Operate"))
  5896.       {
  5897.         a.x();
  5898.  
  5899.         a.K(true);
  5900.  
  5901.         a.sleep(2300, 2700);
  5902.       }
  5903.       a.K(bool);
  5904.     }
  5905.     while (!a.Rc());
  5906.  
  5907.     a.sleep(800, 1100);
  5908.  
  5909.     if (a.M)
  5910.     {
  5911.       a.f();
  5912.     }
  5913.     return 1;
  5914.   }
  5915.  
  5916.   public void mouseMoved(MouseEvent a)
  5917.   {
  5918.     a.Xe = a.getPoint();
  5919.  
  5920.     if (a.Pf.contains(a.Xe))
  5921.     {
  5922.       if (a.kc.contains(a.Xe))
  5923.       {
  5924.         a.pA = ((!a.qd ? "Pause" : "Resume") + " iDungeon");
  5925.       }
  5926.       else if (a.Pg.contains(a.Xe)) {
  5927.         a.pA = "Terminate iDungeon";
  5928.       }
  5929.       else if (a.Rb.contains(a.Xe)) {
  5930.         a.pA = "Visit the iDungeon forums";
  5931.       }
  5932.       else if (a.Q.contains(a.Xe))
  5933.       {
  5934.         a.pA = "iDungeon help guide";
  5935.       }
  5936.       else if (a.ag.contains(a.Xe)) {
  5937.         a.pA = "Hide paint";
  5938.       }
  5939.       else
  5940.       {
  5941.         a.pA = "";
  5942.       }
  5943.     }
  5944.     else if (a.dc)
  5945.     {
  5946.       a.Nd = "Choose your settings!";
  5947.  
  5948.       if ((a.uB > 0) && (a.fD.contains(a.Xe))) {
  5949.         a.Nd = "<<< Previous page";
  5950.       }
  5951.       else if (a.Vb.contains(a.Xe)) {
  5952.         a.Nd = (a.uB < 5 ? (a.Nd = "Next page >>>") : "Finish the settings");
  5953.       }
  5954.       else if (a.o.contains(a.Xe))
  5955.       {
  5956.         a.Nd = "These guys kick ass!";
  5957.       }
  5958.       else if ((a.uB == 0) && (a.DC == 0))
  5959.       {
  5960.         if (a.wA.contains(a.Xe)) {
  5961.           a.Nd = "Set your primary combat to melee";
  5962.         }
  5963.         else if (a.aB.contains(a.Xe)) {
  5964.           a.Nd = "Set your primary combat to range";
  5965.         }
  5966.         else if (a.mC.contains(a.Xe))
  5967.         {
  5968.           a.Nd = "Set your secondary combat to melee";
  5969.         }
  5970.         else if (a.fC.contains(a.Xe))
  5971.         {
  5972.           a.Nd = "Set your secondary combat to range";
  5973.         }
  5974.         else if (a.lF.contains(a.Xe))
  5975.         {
  5976.           a.Nd = "Set your secondary combat to mage";
  5977.         }
  5978.         else if (a.Ag.contains(a.Xe))
  5979.         {
  5980.           a.Nd = "Load your settings on startup";
  5981.         }
  5982.         else if (a.RE.contains(a.Xe)) {
  5983.           a.Nd = "Save your settings for next time";
  5984.         }
  5985.  
  5986.       }
  5987.       else if (a.uB == 1)
  5988.       {
  5989.         if (a.xd.contains(a.Xe)) {
  5990.           a.Nd = "General script settings";
  5991.         }
  5992.         else if (a.iC.contains(a.Xe))
  5993.           a.Nd = "Advanced floor settings & complexity";
  5994.         else if (a.DC == 1)
  5995.         {
  5996.           if (a.JD.contains(a.Xe)) {
  5997.             a.Nd = "Pick up and bury bones";
  5998.           }
  5999.           else if (a.Mb.contains(a.Xe))
  6000.           {
  6001.             a.Nd = "Collect the arrows you use up";
  6002.           }
  6003.           else if (a.JG.contains(a.Xe))
  6004.             a.Nd = "Loot heim crabs, for extra hp";
  6005.           else if (a.Dc.contains(a.Xe)) {
  6006.             a.Nd = "Enable protect prayers for bosses";
  6007.           }
  6008.           else if (a.lf.contains(a.Xe)) {
  6009.             a.Nd = "Use quick prayers in addition";
  6010.           }
  6011.           else if (a.Ye.contains(a.Xe))
  6012.             a.Nd = "Enable this to open prayer doors";
  6013.           else if (a.zd.contains(a.Xe))
  6014.           {
  6015.             a.Nd = "Prevents defense training";
  6016.           }
  6017.           else if (a.qF.contains(a.Xe)) {
  6018.             a.Nd = "Switch attack styles by weakness";
  6019.           }
  6020.           else if (a.Cd.contains(a.Xe))
  6021.           {
  6022.             a.Nd = "Venture into the Occult";
  6023.           }
  6024.         }
  6025.         else if (a.DC == 2)
  6026.         {
  6027.           if ((a.V.contains(a.Xe)) || (a.Ub.contains(a.Xe))) {
  6028.             a.Nd = "Cycle the dungeon complexity";
  6029.           }
  6030.           else if ((a.lb.contains(a.Xe)) || (a.p.contains(a.Xe))) {
  6031.             a.Nd = "Select the complexity to rush at";
  6032.           }
  6033.           else if ((a.qf.contains(a.Xe)) || (a.D.contains(a.Xe))) {
  6034.             a.Nd = "Select the floor to rush to";
  6035.           }
  6036.           else if (a.F.contains(a.Xe))
  6037.           {
  6038.             a.Nd = "Intelligently reset your progress";
  6039.           }
  6040.           else if (a.bE.contains(a.Xe))
  6041.           {
  6042.             a.Nd = "Paint doors and rooms on the map";
  6043.           }
  6044.           else if (a.WB.contains(a.Xe))
  6045.           {
  6046.             a.Nd = "Blacks out all usernames - BETA";
  6047.           }
  6048.           else if (a.gC.contains(a.Xe))
  6049.           {
  6050.             a.Nd = "Enable rushing of certain floors";
  6051.           }
  6052.           else if (a.wc.contains(a.Xe))
  6053.           {
  6054.             a.Nd = "Enable food pickup when rushing";
  6055.           }
  6056.         }
  6057.       }
  6058.     }
  6059.   }
  6060.  
  6061.   private int NA()
  6062.   {
  6063.     RSNPC localRSNPC = a.i(new String[] { "Mercenary leader" });
  6064.  
  6065.     a.XF = true;
  6066.  
  6067.     a.l(a.QC, Combat.Prayer.PROTECT_FROM_MAGIC, true);
  6068.  
  6069.     a.A(false);
  6070.  
  6071.     if (a.jA())
  6072.     {
  6073.       return 2;
  6074.     }
  6075.  
  6076.     if ((
  6077.       (localRSNPC = a.i(new String[] { "Mercenary leader" })) != null) && (localRSNPC.getAnimation() == 710))
  6078.       a.F(localRSNPC, "Attack");
  6079.     else
  6080.       a.F(localRSNPC);
  6081.     if (a.MC)
  6082.     {
  6083.       if (!a.JC())
  6084.       {
  6085.         a.sleep(600, 900);
  6086.       }
  6087.       a.MC = false;
  6088.     }
  6089.  
  6090.     if (a.l(a.UC, 50, 55))
  6091.       a.F(localRSNPC, "Attack");
  6092.     a.sleep(500, 1000);
  6093.  
  6094.     if (a.jA())
  6095.     {
  6096.       return 2;
  6097.     }
  6098.     a.l(false, Combat.Prayer.PROTECT_FROM_MAGIC, false);
  6099.  
  6100.     a.XF = false;
  6101.  
  6102.     return 1;
  6103.   }
  6104.  
  6105.   private int qA()
  6106.   {
  6107.     if ((!a.O()) || (!a.L())) {
  6108.       return -1;
  6109.     }
  6110.  
  6111.     int[] arrayOfInt1 = { 54504, 54546, 54623 }; int[] arrayOfInt2 = { 54506, 54548, 54625 }; int[] arrayOfInt3 = { 54508, 54550, 54627 }; int[] arrayOfInt4 = { 54510, 54552, 54629 };
  6112.  
  6113.     int[][] arrayOfInt5 = { arrayOfInt1, arrayOfInt2, arrayOfInt3, arrayOfInt4 };
  6114.  
  6115.     int[] arrayOfInt6 = { 19869, 19871, 19873, 19875 };
  6116.  
  6117.     String[] arrayOfString = { "Blue", "Green", "Yellow", "Violet" };
  6118.  
  6119.     RSArea localRSArea = a.i(a.I).getArea();
  6120.  
  6121.     RSObject localRSObject1 = a.i(new int[] { 35241, 35242, 35243, 35245 });
  6122.     int i6;
  6123.     while (!a.KD)
  6124.     {
  6125.       if (a.jA())
  6126.       {
  6127.         return 2;
  6128.       }
  6129.       int i1 = 1;
  6130.       Object localObject1;
  6131.       int i3 = (localObject1 = arrayOfInt5).length;
  6132.       int i5;
  6133.       int[] arrayOfInt8 = localObject1[i5];
  6134.       RSObject[] arrayOfRSObject;
  6135.       int i9 = (arrayOfRSObject = a.J(arrayOfInt8)).length;
  6136.       int i10;
  6137.       RSObject localRSObject3 = arrayOfRSObject[i10];
  6138.  
  6139.       if (a.D(localRSObject3.getLocation()) == null)
  6140.       {
  6141.         i1 = 0;
  6142.       }
  6143.       else
  6144.       {
  6145.         i10++;
  6146.  
  6147.         i5++;
  6148.       }
  6149.       Object localObject4;
  6150.       if (i1 != 0)
  6151.       {
  6152.         Object localObject2;
  6153.         Object localObject3;
  6154.         while (!a.inventory.containsAll(arrayOfInt6))
  6155.         {
  6156.           if (a.jA())
  6157.           {
  6158.             return 2;
  6159.           }
  6160.           if (!a.j())
  6161.           {
  6162.             return -1;
  6163.           }
  6164.           a.l(a.vc, 40, 40);
  6165.  
  6166.           localObject1 = "";
  6167.  
  6168.           localObject2 = localRSObject1.getLocation();
  6169.  
  6170.           int i7 = (localObject3 = arrayOfString).length;
  6171.           int i8;
  6172.           localObject4 = localObject3[i8];
  6173.  
  6174.           if (a.inventory.getItemID((String)localObject4 + " vial") == -1)
  6175.           {
  6176.             localObject1 = localObject4;
  6177.           }
  6178.           else {
  6179.             i8++;
  6180.           }
  6181.  
  6182.           if (a.interfaces.get(238).isValid()) {
  6183.             a.l(a.interfaces.get(238), new String[] { localObject1 });
  6184.           }
  6185.           else if (a.calc.distanceTo((RSTile)localObject2) > 3)
  6186.             a.F((RSTile)localObject2);
  6187.           else if (a.l(localRSObject1, "Take-bottle"))
  6188.           {
  6189.             a.K(true);
  6190.           }
  6191.         }
  6192.         while (a.inventory.containsOneOf(arrayOfInt6))
  6193.         {
  6194.           int i2;
  6195.           if (a.jA())
  6196.           {
  6197.             return 2;
  6198.           }
  6199.           if ((localObject2 = a.i(arrayOfInt5[i2])) != null)
  6200.           {
  6201.             a.vE = ((RSObject)localObject2).getLocation();
  6202.  
  6203.             if (((localObject3 = a.D(a.vE)) != null) &&
  6204.               (a.inventory.contains(arrayOfInt6[i2])))
  6205.             {
  6206.               a.F(((RSNPC)localObject3).getLocation());
  6207.  
  6208.               a.l(arrayOfInt6[i2], (RSNPC)localObject3);
  6209.  
  6210.               a.K(false);
  6211.             }
  6212.           }
  6213.           i2++;
  6214.  
  6215.           a.sleep(200, 400);
  6216.         }
  6217.       }
  6218.       int[][] arrayOfInt7;
  6219.       int i4 = (arrayOfInt7 = arrayOfInt5).length; [I local[I = arrayOfInt7[i6];
  6220.       RSObject localRSObject2;
  6221.       if ((localRSObject2 = a.i(local[I)) != null)
  6222.       {
  6223.         a.vE = localRSObject2.getLocation();
  6224.  
  6225.         localObject4 = a.l(a.vE, "block");
  6226.  
  6227.         while ((localObject4 != null) && (a.D(a.vE) == null))
  6228.         {
  6229.           if (a.jA())
  6230.             return 2;
  6231.           if (!a.j()) {
  6232.             return -1;
  6233.           }
  6234.  
  6235.           i10 = 1; int i11 = 1;
  6236.  
  6237.           RSTile localRSTile1 = null; RSTile localRSTile2 = null; RSTile localRSTile3 = null; RSTile localRSTile4 = null; RSTile localRSTile5 = ((RSNPC)localObject4).getLocation();
  6238.  
  6239.           int i12 = 0; int i13 = 0; int i14 = localRSTile5.getX(); int i15 = localRSTile5.getY();
  6240.  
  6241.           if (i14 < a.vE.getX())
  6242.           {
  6243.             localRSTile1 = new RSTile(i14 + 1, i15);
  6244.  
  6245.             localRSTile2 = new RSTile(i14 + 2, i15);
  6246.  
  6247.             i13 = 1;
  6248.           }
  6249.           else if (i14 > a.vE.getX())
  6250.           {
  6251.             localRSTile1 = new RSTile(i14 - 1, i15);
  6252.  
  6253.             localRSTile2 = new RSTile(i14 - 2, i15);
  6254.  
  6255.             i13 = -1;
  6256.           }
  6257.           RSNPC localRSNPC;
  6258.           if (localRSTile1 != null)
  6259.           {
  6260.             i10 = 0;
  6261.  
  6262.             if ((localRSNPC = a.D(localRSTile1)) == null) {
  6263.               a.D(localRSTile2);
  6264.             }
  6265.  
  6266.             if (localRSNPC == null) { if (!localRSArea.contains(new RSTile[] { localRSTile1, localRSTile2 }));
  6267.             }
  6268.             else
  6269.             {
  6270.               a.log("The X pull is blocked!");
  6271.  
  6272.               i10 = 1;
  6273.             }
  6274.  
  6275.           }
  6276.  
  6277.           if (i15 < a.vE.getY())
  6278.           {
  6279.             localRSTile3 = new RSTile(i14, i15 + 1);
  6280.  
  6281.             localRSTile4 = new RSTile(i14, i15 + 2);
  6282.  
  6283.             i12 = 1;
  6284.           }
  6285.           else if (i15 > a.vE.getY())
  6286.           {
  6287.             localRSTile3 = new RSTile(i14, i15 - 1);
  6288.  
  6289.             localRSTile4 = new RSTile(i14, i15 - 2);
  6290.  
  6291.             i12 = -1;
  6292.           }
  6293.           if (localRSTile3 != null)
  6294.           {
  6295.             i11 = 0;
  6296.  
  6297.             if (
  6298.               (localRSNPC = a.D(localRSTile3)) == null)
  6299.               a.D(localRSTile4);
  6300.             if (localRSNPC == null)
  6301.             {
  6302.               if (!localRSArea.contains(new RSTile[] { localRSTile3, localRSTile4 }));
  6303.             }
  6304.             else
  6305.             {
  6306.               a.log("The Y pull is blocked!");
  6307.  
  6308.               i11 = 1;
  6309.             }
  6310.           }
  6311.           if (i10 == 0)
  6312.           {
  6313.             a.F(localRSTile5, i13, 0);
  6314.  
  6315.             if (a.l((RSNPC)localObject4, "Pull"))
  6316.             {
  6317.               a.l(true);
  6318.  
  6319.               a.K(true);
  6320.             }
  6321.             else
  6322.             {
  6323.               a.sleep(200, 400);
  6324.             }
  6325.  
  6326.           }
  6327.           else if (i11 == 0)
  6328.           {
  6329.             a.F(localRSTile5, 0, i12);
  6330.  
  6331.             if (a.l((RSNPC)localObject4, "Pull"))
  6332.             {
  6333.               a.l(true);
  6334.  
  6335.               a.K(true);
  6336.             }
  6337.             else
  6338.             {
  6339.               a.sleep(200, 400);
  6340.             }
  6341.  
  6342.           }
  6343.           else
  6344.           {
  6345.             a.log("No good pull tile found, trying another statue!");
  6346.  
  6347.             break;
  6348.           }
  6349.         }
  6350.       }
  6351.       i6++;
  6352.     }
  6353.  
  6354.     a.lA();
  6355.  
  6356.     a.F(a.nD);
  6357.  
  6358.     return 1;
  6359.   }
  6360.  
  6361.   private void vA()
  6362.   {
  6363.     for (Iterator localIterator = a.ID.iterator(); localIterator.hasNext(); ) { int i1 = ((Integer)localIterator.next()).intValue();
  6364.       RSObject localRSObject;
  6365.       RSTile localRSTile = localRSObject.getLocation();
  6366.  
  6367.       if (!a.J.contains(localRSTile))
  6368.       {
  6369.         int i3;
  6370.         a.J.add(localRSObject.getLocation());
  6371.  
  6372.         i3++;
  6373.  
  6374.         i2++;
  6375.       }
  6376.     }
  6377.     int i2;
  6378.   }
  6379.  
  6380.   private int xA()
  6381.   {
  6382.     int[] arrayOfInt = { 50762, 51313, 51861, 54889 };
  6383.  
  6384.     int i1 = 0; int i2 = 0; int i3 = 0;
  6385.     int i4;
  6386.     RSNPC localRSNPC1 = a.D(new int[] { a.fb[i4] });
  6387.  
  6388.     RSNPC localRSNPC2 = a.D(new int[] { a.OB[i4] });
  6389.     RSTile localRSTile1;
  6390.     int i6;
  6391.     if ((localRSNPC1 != null) && (localRSNPC2 != null))
  6392.     {
  6393.       localRSTile1 = a.l(localRSNPC2.getLocation(), arrayOfInt);
  6394.  
  6395.       RSTile localRSTile2 = a.l(localRSNPC1.getLocation(), arrayOfInt);
  6396.  
  6397.       if ((localRSTile1 == null) || (localRSTile2 == null)) {
  6398.         return -1;
  6399.       }
  6400.  
  6401.       i6 = localRSTile1.getX() - localRSTile2.getX();
  6402.  
  6403.       int i7 = localRSTile1.getY() - localRSTile2.getY();
  6404.  
  6405.       if (Math.abs(i6) > Math.abs(i7)) {
  6406.         i1 = i6 > 0 ? -7 : 7;
  6407.       }
  6408.       else if (Math.abs(i6) < Math.abs(i7)) {
  6409.         i2 = i7 > 0 ? -7 : 7;
  6410.       }
  6411.       else
  6412.       {
  6413.         return -1;
  6414.       }
  6415.  
  6416.     }
  6417.     else
  6418.     {
  6419.       i4++;
  6420.     }
  6421.  
  6422.     while (!a.KD)
  6423.     {
  6424.       if (a.jA())
  6425.       {
  6426.         return 2;
  6427.       }
  6428.       localRSNPC1 = a.npcs.getNearest(new int[] { a.fb[i4] });
  6429.  
  6430.       localRSNPC2 = a.npcs.getNearest(new int[] { a.OB[i4] });
  6431.  
  6432.       if ((localRSNPC1 != null) && (localRSNPC2 != null))
  6433.       {
  6434.         localRSTile1 = localRSNPC2.getLocation();
  6435.  
  6436.         a.vE = new RSTile(localRSTile1.getX() + i1, localRSTile1.getY() + i2);
  6437.  
  6438.         if (localRSNPC1 != null)
  6439.         {
  6440.           if (a.jA()) {
  6441.             return 2;
  6442.           }
  6443.  
  6444.           if (a.KD)
  6445.             break;
  6446.           int i5 = 1; i6 = 1;
  6447.  
  6448.           RSTile localRSTile3 = null; RSTile localRSTile4 = null; RSTile localRSTile5 = null; RSTile localRSTile6 = null; RSTile localRSTile7 = localRSNPC1.getLocation();
  6449.  
  6450.           int i8 = 0; int i9 = 0; int i10 = localRSTile7.getX(); int i11 = localRSTile7.getY();
  6451.  
  6452.           if (i10 < a.vE.getX())
  6453.           {
  6454.             localRSTile3 = new RSTile(i10 + 1, i11);
  6455.  
  6456.             localRSTile4 = new RSTile(i10 - 1, i11);
  6457.  
  6458.             i9 = -1;
  6459.           }
  6460.           else if (i10 > a.vE.getX())
  6461.           {
  6462.             localRSTile3 = new RSTile(i10 - 1, i11);
  6463.  
  6464.             localRSTile4 = new RSTile(i10 + 1, i11);
  6465.  
  6466.             i9 = 1;
  6467.           }
  6468.           RSNPC localRSNPC3;
  6469.           RSNPC localRSNPC4;
  6470.           if (localRSTile3 != null)
  6471.           {
  6472.             i5 = 0;
  6473.  
  6474.             localRSNPC3 = a.D(localRSTile3); localRSNPC4 = a.D(localRSTile4);
  6475.  
  6476.             if ((localRSNPC3 != null) || (localRSNPC4 != null))
  6477.               i5 = 1;
  6478.           }
  6479.           if (i11 < a.vE.getY())
  6480.           {
  6481.             localRSTile5 = new RSTile(i10, i11 + 1);
  6482.  
  6483.             localRSTile6 = new RSTile(i10, i11 - 1);
  6484.  
  6485.             i8 = -1;
  6486.           }
  6487.           else if (i11 > a.vE.getY())
  6488.           {
  6489.             localRSTile5 = new RSTile(i10, i11 - 1);
  6490.  
  6491.             localRSTile6 = new RSTile(i10, i11 + 1);
  6492.  
  6493.             i8 = 1;
  6494.           }
  6495.  
  6496.           if (localRSTile5 != null)
  6497.           {
  6498.             i6 = 0;
  6499.  
  6500.             localRSNPC3 = a.D(localRSTile5); localRSNPC4 = a.D(localRSTile6);
  6501.  
  6502.             if ((localRSNPC3 != null) || (localRSNPC4 != null))
  6503.             {
  6504.               i6 = 1;
  6505.             }
  6506.           }
  6507.           if (i3 > 30)
  6508.           {
  6509.             a.uC = "No pushable statue found";
  6510.  
  6511.             return -1;
  6512.           }
  6513.  
  6514.           if (i5 == 0)
  6515.           {
  6516.             a.l(localRSTile7, i9, 0);
  6517.  
  6518.             if (a.l(localRSNPC1, "Push"))
  6519.             {
  6520.               a.K(true);
  6521.  
  6522.               i3 = 0;
  6523.             }
  6524.           }
  6525.           else if (i6 == 0)
  6526.           {
  6527.             a.l(localRSTile7, 0, i8);
  6528.  
  6529.             if (a.l(localRSNPC1, "Push"))
  6530.             {
  6531.               a.K(true);
  6532.  
  6533.               i3 = 0;
  6534.             }
  6535.           }
  6536.           else
  6537.           {
  6538.             i3++;
  6539.  
  6540.             break label798;
  6541.           }
  6542.  
  6543.           a.sleep(300, 500);
  6544.         }
  6545.       }
  6546.       label798: i4++;
  6547.     }
  6548.  
  6549.     if (!a.ZA())
  6550.       return 2;
  6551.     return 1;
  6552.   }
  6553.  
  6554.   private void VA()
  6555.   {
  6556.     a.ob.clear();
  6557.  
  6558.     for (Object localObject1 = a.zc.iterator(); ((Iterator)localObject1).hasNext(); )
  6559.     {
  6560.       int i1 = (localObject2 = (RSObject)((Iterator)localObject1).next())
  6561.         .getID();
  6562.  
  6563.       localObject3 = ((RSObject)localObject2).getLocation();
  6564.  
  6565.       a.fc.add(localObject3);
  6566.  
  6567.       a.ob.add(localObject3);
  6568.  
  6569.       a.J.add(localObject3);
  6570.  
  6571.       a.GB.add(localObject3);
  6572.  
  6573.       a.ob.add(localObject3);
  6574.  
  6575.       a.J.add(localObject3);
  6576.  
  6577.       int i2 = (localObject4 = a.Cf).length;
  6578.       int i3;
  6579.       int[] arrayOfInt = localObject4[i3];
  6580.  
  6581.       a.ob.add(localObject3);
  6582.  
  6583.       a.ID.add(Integer.valueOf(i1));
  6584.  
  6585.       a.vF.add(localObject3);
  6586.  
  6587.       i3++;
  6588.  
  6589.       if (a.Zc > 4)
  6590.       {
  6591.         if (a.l(i1, a.mD))
  6592.         {
  6593.           a.gc.add(localObject3);
  6594.         }
  6595.         else if (a.l(i1, a.Af))
  6596.         {
  6597.           if (a.kd)
  6598.             a.gc.add(localObject3);
  6599.           else {
  6600.             a.fG.add(localObject3);
  6601.           }
  6602.  
  6603.         }
  6604.         else if (a.l(i1, a.rg))
  6605.         {
  6606.           if (!a.xe)
  6607.           {
  6608.             a.fG.add(localObject3);
  6609.  
  6610.             a.gE = true;
  6611.           }
  6612.           else
  6613.           {
  6614.             a.gc.add(localObject3);
  6615.           }
  6616.         }
  6617.         else if (a.l(i1, a.Yf))
  6618.         {
  6619.           a.id.add(localObject3);
  6620.  
  6621.           a.ob.add(localObject3);
  6622.  
  6623.           a.J.add(localObject3);
  6624.         }
  6625.         else if (a.l(i1, a.tD))
  6626.         {
  6627.           if (a.kd)
  6628.           {
  6629.             a.id.add(localObject3);
  6630.  
  6631.             a.ob.add(localObject3);
  6632.  
  6633.             a.J.add(localObject3);
  6634.           }
  6635.           else
  6636.           {
  6637.             a.fG.add(localObject3);
  6638.           }
  6639.  
  6640.         }
  6641.         else if (a.l(i1, a.sb))
  6642.         {
  6643.           a.ob.add(localObject3);
  6644.  
  6645.           a.J.add(localObject3);
  6646.         }
  6647.       }
  6648.     }
  6649.     Object localObject3;
  6650.     Object localObject4;
  6651.     a.AG.clear();
  6652.  
  6653.     a.zc.clear();
  6654.  
  6655.     localObject1 = new ArrayList();
  6656.  
  6657.     for (Object localObject2 = a.fG.iterator(); ((Iterator)localObject2).hasNext(); ) { localRSTile = (RSTile)((Iterator)localObject2).next();
  6658.  
  6659.       if (a.ZA.contains(new RSTile[] { localRSTile }))
  6660.       {
  6661.         for (localObject3 = a.ob.iterator(); ((Iterator)localObject3).hasNext(); ) { localObject4 = (RSTile)((Iterator)localObject3).next();
  6662.  
  6663.           if (a.calc.distanceBetween((RSTile)localObject4, localRSTile) < 4.0D)
  6664.             ((ArrayList)localObject1).add(localObject4);
  6665.         }
  6666.       }
  6667.     }
  6668.     RSTile localRSTile;
  6669.     a.fG.addAll((Collection)localObject1);
  6670.  
  6671.     a.fA.addAll((Collection)localObject1);
  6672.  
  6673.     a.ob.removeAll(a.fG);
  6674.  
  6675.     a.J.removeAll(a.fG);
  6676.  
  6677.     a.fA.addAll(a.gc);
  6678.  
  6679.     a.fA.addAll(a.vF);
  6680.  
  6681.     a.fA.addAll(a.ob);
  6682.  
  6683.     a.Bd.addAll(a.ob);
  6684.  
  6685.     if (a.nD != null)
  6686.     {
  6687.       a.w.add(a.nD);
  6688.  
  6689.       a.J.remove(a.nD);
  6690.  
  6691.       a.QA = a.nD;
  6692.     }
  6693.     else if (a.Nc.size() > 1)
  6694.     {
  6695.       a.log.severe("Near door was null when reassigning.");
  6696.     }
  6697.   }
  6698.  
  6699.   private int yA()
  6700.   {
  6701.     int[] arrayOfInt1 = { 12125, 12133, 12141, 12149 }; int[] arrayOfInt2 = { 12126, 12134, 12142, 12150 }; int[] arrayOfInt3 = { 12127, 12135, 12143, 12151 };
  6702.  
  6703.     int[] arrayOfInt4 = { 12128, 12136, 12144, 12152 }; int[] arrayOfInt5 = { 12129, 12137, 12145, 12153 }; int[] arrayOfInt6 = { 12130, 12138, 12146, 12154 };
  6704.  
  6705.     int[] arrayOfInt7 = { 12131, 12139, 12147, 12155 }; int[] arrayOfInt8 = { 12132, 12140, 12148, 12156 }; Object localObject = null;
  6706.  
  6707.     int[][] arrayOfInt9 = { arrayOfInt1, arrayOfInt2, arrayOfInt3 };
  6708.  
  6709.     int[][] arrayOfInt10 = { arrayOfInt4, arrayOfInt5, arrayOfInt6 };
  6710.  
  6711.     int[][] arrayOfInt11 = { arrayOfInt7, arrayOfInt8, localObject };
  6712.  
  6713.     int[][][] arrayOfInt = { arrayOfInt9, arrayOfInt10, arrayOfInt11 };
  6714.  
  6715.     int[] arrayOfInt12 = { 54321, 54322, 54323 };
  6716.     RSTile localRSTile1;
  6717.     if (
  6718.       (localRSTile1 = a.F(a.y, arrayOfInt12)) == null) {
  6719.       return -1;
  6720.     }
  6721.  
  6722.     int i1 = localRSTile1.getX(); int i2 = localRSTile1.getY();
  6723.  
  6724.     RSTile[] arrayOfRSTile1 = { new RSTile(i1 + 1, i2 + 5), new RSTile(i1 + 3, i2 + 5), new RSTile(i1 + 5, i2 + 5) };
  6725.  
  6726.     RSTile[] arrayOfRSTile2 = { new RSTile(i1 + 1, i2 + 3), new RSTile(i1 + 3, i2 + 3), new RSTile(i1 + 5, i2 + 3) };
  6727.  
  6728.     RSTile[] arrayOfRSTile3 = { new RSTile(i1 + 1, i2 + 1), new RSTile(i1 + 3, i2 + 1), new RSTile(i1 + 5, i2 + 1) };
  6729.  
  6730.     RSTile[][] arrayOfRSTile; = { arrayOfRSTile1, arrayOfRSTile2, arrayOfRSTile3 };
  6731.  
  6732.     if (a.jA())
  6733.     {
  6734.       return 2;
  6735.     }
  6736.  
  6737.     if (!a.j()) {
  6738.       return -1;
  6739.     }
  6740.  
  6741.     a.l(a.vc, 40, 50);
  6742.     int i3;
  6743.     if ((i3 = 0) < arrayOfRSTile;.length)
  6744.     {
  6745.       int i4;
  6746.       RSTile localRSTile2 = arrayOfRSTile;[i3][i4];
  6747.  
  6748.       if (a.D(localRSTile2) == null)
  6749.       {
  6750.         a.vE = localRSTile2;
  6751.  
  6752.         a.A(a.vE, "Move");
  6753.  
  6754.         RSNPC localRSNPC = a.D(arrayOfInt[i3][i4]);
  6755.  
  6756.         if (a.F(localRSNPC, "Move"))
  6757.         {
  6758.           a.K(true);
  6759.           while (true) {
  6760.             a.sleep(200, 300);
  6761.           }
  6762.  
  6763.         }
  6764.  
  6765.       }
  6766.       else
  6767.       {
  6768.         i4++;
  6769.  
  6770.         i3++;
  6771.       }
  6772.  
  6773.     }
  6774.  
  6775.     a.sleep(200, 300);
  6776.  
  6777.     return 1;
  6778.   }
  6779.  
  6780.   private int nA()
  6781.   {
  6782.     RSObject localRSObject = a.i(new int[] { 49543, 49544, 49545, 53995 });
  6783.  
  6784.     String str = "";
  6785.  
  6786.     if (a.jA())
  6787.     {
  6788.       return 2;
  6789.     }
  6790.     if (!a.j()) {
  6791.       return -1;
  6792.     }
  6793.  
  6794.     int i1 = a.inventory.getItemID("Spare construct " + str + " (u)");
  6795.  
  6796.     RSNPC localRSNPC2 = a.i(new String[] { "Dormant construct" });
  6797.  
  6798.     a.l(a.vc, 50, 55);
  6799.  
  6800.     if (str.isEmpty())
  6801.     {
  6802.       if (!a.SE.contains("missing")) if (a.F(a.i(new String[] { "construct" }), "Examine"))
  6803.         {
  6804.           a.K(true);
  6805.         }
  6806.  
  6807.  
  6808.       if (a.SE.contains("arm"))
  6809.         str = "arm";
  6810.       else if (a.SE.contains("leg"))
  6811.       {
  6812.         str = "leg";
  6813.       }
  6814.       else if (a.SE.contains("head"))
  6815.       {
  6816.         str = "head";
  6817.       }
  6818.  
  6819.       if (!str.isEmpty())
  6820.       {
  6821.         a.log("Construct is missing its " + str + ".");
  6822.       }
  6823.     }
  6824.     else if (localRSNPC2 != null)
  6825.     {
  6826.       if (a.F(localRSNPC2, "Charge"))
  6827.       {
  6828.         a.K(true);
  6829.  
  6830.         a.sleep(1000, 1500);
  6831.       }
  6832.  
  6833.     }
  6834.     else if ((i1 > 0) && (a.inventory.contains(i1)))
  6835.     {
  6836.       a.inventory.getItem(new int[] { i1 }).doAction("Imbue");
  6837.     }
  6838.     else if (a.inventory.getItemID("Spare construct " + str) != -1)
  6839.     {
  6840.       if (a.F(a.i(new String[] { "construct" }), "Repair"))
  6841.       {
  6842.         a.K(true);
  6843.  
  6844.         a.sleep(1000, 1500);
  6845.       }
  6846.  
  6847.     }
  6848.     else if (a.interfaces.get(451).isValid())
  6849.     {
  6850.       if (a.l(a.interfaces.get(451), new String[] { str }))
  6851.       {
  6852.         a.sleep(400, 600);
  6853.       }
  6854.  
  6855.     }
  6856.     else if (a.inventory.containsAll(new int[] { 17364, 17444 }))
  6857.     {
  6858.       a.inventory.getItem(new int[] { 17364 }).doAction("Carve");
  6859.  
  6860.       a.sleep(400, 600);
  6861.     }
  6862.     else if (!a.inventory.contains(17444))
  6863.     {
  6864.       a.l(a.groundItems.getNearest(new int[] { 17444 }));
  6865.     }
  6866.     else if (!a.inventory.contains(17364))
  6867.     {
  6868.       a.l(localRSObject, "Take");
  6869.  
  6870.       a.sleep(400, 600);
  6871.     }
  6872.     a.K(true);
  6873.  
  6874.     a.lA();
  6875.  
  6876.     RSNPC localRSNPC1 = a.i(new String[] { "Magic construct" });
  6877.     int i2;
  6878.     if ((i2 = 0) < 40)
  6879.     {
  6880.       if ((localRSNPC1 == null) || (a.nD == null))
  6881.       {
  6882.         if (i2 > 20)
  6883.         {
  6884.           break label800;
  6885.         }
  6886.       }
  6887.       else
  6888.       {
  6889.         RSTile localRSTile;
  6890.         if (a.calc.distanceTo(localRSTile) > a.random(5, 8))
  6891.         {
  6892.           a.A(localRSTile, 1);
  6893.         }
  6894.         else if (!a.JC()) {
  6895.           a.sleep(400, 1000);
  6896.         }
  6897.  
  6898.       }
  6899.  
  6900.       a.sleep(600, 800);
  6901.  
  6902.       i2++;
  6903.     }
  6904.  
  6905.     label800: return 1;
  6906.   }
  6907.  
  6908.   private int QA()
  6909.   {
  6910.     int[] arrayOfInt1 = { 49619, 49620, 49621, 49622, 49623, 49624 };
  6911.  
  6912.     int[] arrayOfInt2 = { 49609, 49610, 49611 };
  6913.  
  6914.     RSTile localRSTile1 = a.tA();
  6915.  
  6916.     a.lA();
  6917.  
  6918.     if ((localRSTile1 == null) || (a.nD == null))
  6919.     {
  6920.       return -1;
  6921.     }
  6922.  
  6923.     RSTile localRSTile2 = a.r.getCentralTile();
  6924.  
  6925.     if (a.jA())
  6926.     {
  6927.       return 2;
  6928.     }
  6929.     if (!a.j())
  6930.     {
  6931.       return -1;
  6932.     }
  6933.     a.l(a.vc, 40, 50);
  6934.  
  6935.     a.EA();
  6936.  
  6937.     if (a.AB.contains("reengage"))
  6938.     {
  6939.       a.lA();
  6940.     }
  6941.     if ((a.yd != null) && (a.l(a.yd.getLocation(), false)))
  6942.     {
  6943.       a.l(a.yd);
  6944.     }
  6945.     else
  6946.     {
  6947.       RSObject localRSObject1;
  6948.       RSObject localRSObject2;
  6949.       RSObject localRSObject3;
  6950.       if ((a.calc.distanceTo(a.nD) > 4) && (!a.l(localRSTile2, false)))
  6951.       {
  6952.         a.vE = localRSTile2;
  6953.  
  6954.         if ((localRSObject1 = a.l(arrayOfInt2)) != null)
  6955.         {
  6956.           if (a.kd)
  6957.           {
  6958.             a.l(localRSObject1, "Repair");
  6959.  
  6960.             if ((!a.x()) && (!a.x())) {
  6961.               a.l(localRSObject1, "Repair");
  6962.             }
  6963.  
  6964.           }
  6965.           else
  6966.           {
  6967.             a.A(localRSTile2, 1);
  6968.           }
  6969.         }
  6970.         else if (
  6971.           (localRSObject2 = a.i(localRSTile1, arrayOfInt1)) != null)
  6972.         {
  6973.           a.l(localRSObject2, "Destroy");
  6974.         }
  6975.         else if (
  6976.           (localRSObject3 = a.i(localRSTile1, a.Yd)) != null)
  6977.         {
  6978.           a.l(localRSObject3, "Destroy");
  6979.  
  6980.           if ((a.x()) || (a.x()))
  6981.           {
  6982.             localRSObject1 = a.i(arrayOfInt2);
  6983.  
  6984.             if ((a.kd) && (localRSObject1 != null) && (a.calc.distanceTo(localRSObject1.getLocation()) < 3))
  6985.             {
  6986.               a.l(localRSObject1, "Repair");
  6987.  
  6988.               if (!a.x())
  6989.               {
  6990.                 a.l(localRSObject1, "Repair");
  6991.               }
  6992.             }
  6993.             else
  6994.             {
  6995.               a.A(localRSTile2, 1);
  6996.             }
  6997.  
  6998.           }
  6999.  
  7000.         }
  7001.  
  7002.       }
  7003.       else
  7004.       {
  7005.         a.vE = a.nD;
  7006.  
  7007.         if (((localRSObject1 = a.i(a.vE, arrayOfInt1)) == null) ||
  7008.           (!a.F(localRSObject1)))
  7009.         {
  7010.           if (
  7011.             (localRSObject2 = a.i(a.vE, a.Yd)) != null)
  7012.           {
  7013.             a.l(localRSObject2, "Destroy");
  7014.  
  7015.             a.K(true);
  7016.  
  7017.             localRSObject3 = a.l(arrayOfInt2);
  7018.  
  7019.             if ((a.kd) && (localRSObject3 != null))
  7020.             {
  7021.               a.l(localRSObject3, "Repair");
  7022.  
  7023.               a.sleep(400, 600);
  7024.  
  7025.               a.l(localRSObject3, "Repair");
  7026.             }
  7027.             else
  7028.             {
  7029.               a.l(localRSObject1, "Destroy");
  7030.             }
  7031.           }
  7032.         }
  7033.         else if (a.l(localRSObject1, "Destroy")) {
  7034.           a.K(true);
  7035.         }
  7036.         else
  7037.         {
  7038.           a.A(a.vE, 1);
  7039.         }
  7040.       }
  7041.     }
  7042.     a.K(true);
  7043.  
  7044.     a.NA = true;
  7045.  
  7046.     return 1;
  7047.   }
  7048.  
  7049.   private boolean l(int a, int[] a)
  7050.   {
  7051.     int i2;
  7052.     if ((a != null) && (a > 0))
  7053.     {
  7054.       int[] arrayOfInt;
  7055.       int i1 = (arrayOfInt = a).length; int i3 = arrayOfInt[i2];
  7056.  
  7057.       if (a == i3)
  7058.         return true;
  7059.       i2++;
  7060.     }
  7061.  
  7062.     return false;
  7063.   }
  7064.  
  7065.   private RSTile tA()
  7066.   {
  7067.     Object localObject;
  7068.     if (!a.fc.isEmpty()) {
  7069.       for (localObject = a.fc.iterator(); ((Iterator)localObject).hasNext(); ) { RSTile localRSTile = (RSTile)((Iterator)localObject).next();
  7070.  
  7071.         if (a.r.contains(new RSTile[] { localRSTile })) {
  7072.           return localRSTile;
  7073.         }
  7074.  
  7075.       }
  7076.  
  7077.     }
  7078.     else if ((localObject = a.i(a.XE)) != null) {
  7079.       return ((RSObject)localObject).getLocation();
  7080.     }
  7081.  
  7082.     return (RSTile)null;
  7083.   }
  7084.  
  7085.   private boolean zA()
  7086.   {
  7087.     a.Qc = "Opening a standard door";
  7088.  
  7089.     if (a.ZA != null);
  7090.     if ((a.jA()) || (a.nD == null)) {
  7091.       return false;
  7092.     }
  7093.  
  7094.     a.uA();
  7095.  
  7096.     if (a.FA != null) if (a.FA.contains(new RSTile[] { a.nD }))
  7097.       {
  7098.         if (a.calc.distanceTo(a.nD) > 4)
  7099.         {
  7100.           a.SE = "";
  7101.         }
  7102.         else if (a.SE.contains("guardians"))
  7103.         {
  7104.           if (a.npcs.getNearest(a.B) != null)
  7105.           {
  7106.             if ((!a.QB()) || (!a.ZA())) {
  7107.               return false;
  7108.             }
  7109.  
  7110.           }
  7111.           else
  7112.           {
  7113.             a.log("Undetectable Guardians, removing door.");
  7114.  
  7115.             a.fG.add(a.nD);
  7116.  
  7117.             a.Bd.remove(a.nD);
  7118.  
  7119.             a.w.remove(a.nD);
  7120.  
  7121.             a.J.remove(a.nD);
  7122.  
  7123.             return true;
  7124.           }
  7125.  
  7126.           a.SE = "";
  7127.         }
  7128.         else if ((a.MC) && (a.calc.tileOnScreen(a.nD)))
  7129.         {
  7130.           if (a.calc.distanceTo(a.nD) < 4)
  7131.           {
  7132.             a.camera.moveRandomly(a.random(800, 1400));
  7133.  
  7134.             a.A(a.nD, "");
  7135.           }
  7136.           else
  7137.           {
  7138.             a.l(a.nD, 1);
  7139.           }
  7140.           a.MC = false;
  7141.         }
  7142.         else
  7143.         {
  7144.           if ((a.SE.contains("not open")) || (a.SE.contains("won't open")))
  7145.           {
  7146.             a.log("Undetected puzzle door, removing!");
  7147.  
  7148.             if (a.UA)
  7149.             {
  7150.               a.env.saveScreenshot(false);
  7151.             }
  7152.  
  7153.             a.fG.add(a.nD);
  7154.  
  7155.             a.Bd.remove(a.nD);
  7156.  
  7157.             a.J.remove(a.nD);
  7158.  
  7159.             a.Q();
  7160.  
  7161.             return true;
  7162.           }
  7163.           if (a.SE.contains("don't have the correct"))
  7164.           {
  7165.             a.log.severe("Hmm.. we got tricked, we don't have the right key!");
  7166.  
  7167.             a.fG.add(a.nD);
  7168.  
  7169.             a.fG.add(a.WA);
  7170.  
  7171.             a.J.remove(a.nD);
  7172.  
  7173.             return true;
  7174.           }
  7175.         }
  7176.         if (a.l(a.G(a.nD)))
  7177.         {
  7178.           a.K(false);
  7179.  
  7180.           if (a.i(false))
  7181.           {
  7182.             return true;
  7183.           }
  7184.         }
  7185.         else
  7186.         {
  7187.           a.sleep(100, 200);
  7188.         }
  7189.  
  7190.       }
  7191.  
  7192.  
  7193.     a.sleep(100, 200);
  7194.  
  7195.     return true;
  7196.   }
  7197.  
  7198.   private boolean A(RSTile a, int a)
  7199.   {
  7200.     if (a.i(a, a))
  7201.     {
  7202.       a.l(false);
  7203.  
  7204.       return true;
  7205.     }
  7206.  
  7207.     return false;
  7208.   }
  7209.  
  7210.   private boolean l(RSInterface a, String[] a)
  7211.   {
  7212.     int i2;
  7213.     if ((a != null) && (a.isValid()))
  7214.     {
  7215.       RSComponent[] arrayOfRSComponent;
  7216.       int i1 = (arrayOfRSComponent = a.getComponents()).length; RSComponent localRSComponent = arrayOfRSComponent[i2];
  7217.       String[] arrayOfString;
  7218.       int i3 = (arrayOfString = a).length;
  7219.       int i4;
  7220.       String str = arrayOfString[i4];
  7221.  
  7222.       if (localRSComponent.getText().toLowerCase().contains(str.toLowerCase()))
  7223.       {
  7224.         return localRSComponent.doClick();
  7225.       }
  7226.       i4++;
  7227.  
  7228.       i2++;
  7229.     }
  7230.     return false;
  7231.   }
  7232.  
  7233.   private boolean PA()
  7234.   {
  7235.     if ((!a.Y().isMoving()) && (a.FA != null))
  7236.     {
  7237.       if ((a.Qc.contains("Opening")) && (a.nD != null) && (a.calc.distanceTo(a.nD) < 6)) {
  7238.         return false;
  7239.       }
  7240.  
  7241.       RSTile localRSTile1 = null; RSTile localRSTile2 = null;
  7242.  
  7243.       if (a.jA != null)
  7244.       {
  7245.         if (a.jA.isInCombat()) {
  7246.           return false;
  7247.         }
  7248.  
  7249.         localRSTile1 = a.jA.getLocation();
  7250.  
  7251.         if (a.calc.distanceBetween(a.X(), localRSTile1) <= 1.0D) {
  7252.           return false;
  7253.         }
  7254.  
  7255.       }
  7256.  
  7257.       if (a.yd != null)
  7258.       {
  7259.         localRSTile2 = a.yd.getLocation();
  7260.  
  7261.         if (a.calc.distanceBetween(a.X(), localRSTile2) <= 1.0D)
  7262.         {
  7263.           return false;
  7264.         }
  7265.       }
  7266.       Object localObject;
  7267.       RSTile localRSTile3;
  7268.       RSObject localRSObject;
  7269.       if ((a.i(a.X())) || (a.i(localRSTile1)) || (a.i(localRSTile2)))
  7270.       {
  7271.         for (localObject = a.vF.iterator(); ((Iterator)localObject).hasNext(); ) { localRSTile3 = (RSTile)((Iterator)localObject).next();
  7272.  
  7273.           if ((a.FA.contains(new RSTile[] { localRSTile3 })) && (a.fA.contains(localRSTile3)))
  7274.           {
  7275.             if ((
  7276.               (localRSObject = a.G(localRSTile3)) != null) && (a.calc.distanceTo(localRSObject.getArea().getNearestTile(a.X())) < 2))
  7277.             {
  7278.               a.l(a.FA.getCentralTile(), 3);
  7279.  
  7280.               return (a.l(false)) || ((a.l(a.X(), 4)) && (a.l(false)));
  7281.             }
  7282.  
  7283.           }
  7284.  
  7285.         }
  7286.  
  7287.         if (a.Zc > 4)
  7288.           for (localObject = a.gc.iterator(); ((Iterator)localObject).hasNext(); ) { localRSTile3 = (RSTile)((Iterator)localObject).next();
  7289.  
  7290.             if ((a.FA.contains(new RSTile[] { localRSTile3 })) && (a.fA.contains(localRSTile3)))
  7291.             {
  7292.               if (((localRSObject = a.G(localRSTile3)) != null) &&
  7293.                 (a.calc.distanceTo(localRSObject.getArea().getNearestTile(a.X())) < 2))
  7294.               {
  7295.                 a.l(a.FA.getCentralTile(), 3);
  7296.  
  7297.                 return (a.l(false)) || ((a.l(a.X(), 4)) && (a.l(false)));
  7298.               }
  7299.             }
  7300.           }
  7301.       }
  7302.       if ((a.Qc.contains("Sliding Statues")) && (a.AB.contains("Picking")))
  7303.       {
  7304.         if (((localObject = a.D(a.fb)) == null) ||
  7305.           (a.calc.distanceBetween(a.X(), ((RSNPC)localObject).getLocation()) != 1.0D))
  7306.         {
  7307.           localObject = a.D(a.OB);
  7308.         }
  7309.         if ((localObject != null) && (a.calc.distanceBetween(a.X(), ((RSNPC)localObject).getLocation()) == 1.0D)) {
  7310.           a.l(((RSNPC)localObject).getLocation(), a.random(-1, 2), a.random(-1, 2));
  7311.         }
  7312.  
  7313.       }
  7314.  
  7315.     }
  7316.  
  7317.     return false;
  7318.   }
  7319.  
  7320.   private void F(RSTile a, int a)
  7321.   {
  7322.     do
  7323.     {
  7324.       do
  7325.         if (a.Zc())
  7326.         {
  7327.           return;
  7328.         }
  7329.       while (a.Y().isMoving());
  7330.  
  7331.       a.i(a, a);
  7332.     }
  7333.  
  7334.     while (!a.l(false));
  7335.     a.l(a.vc, 15, 15);
  7336.  
  7337.     a.K(false);
  7338.   }
  7339.  
  7340.   private RSNPC D(int[] a)
  7341.   {
  7342.     return a.npcs.getNearest(new y(a, a));
  7343.   }
  7344.  
  7345.   private int YA()
  7346.   {
  7347.     if (!a.O())
  7348.       return -1;
  7349.     if (a.jA())
  7350.     {
  7351.       return 2;
  7352.     }
  7353.     if (!a.j())
  7354.     {
  7355.       return -1;
  7356.     }
  7357.  
  7358.     RSObject localRSObject1 = a.i(new int[] { 49528, 49529, 49530 });
  7359.  
  7360.     RSObject localRSObject2 = a.i(new int[] { 49534, 49535, 49536 });
  7361.  
  7362.     RSObject localRSObject3 = a.i(new int[] { 49522, 49523, 49524 });
  7363.  
  7364.     if (localRSObject1 != null)
  7365.     {
  7366.       if (a.l(localRSObject1, "Smith-battleaxes")) {
  7367.         a.K(false);
  7368.       }
  7369.  
  7370.     }
  7371.     else if (localRSObject3 != null)
  7372.     {
  7373.       if (a.l(localRSObject3, "Cook-fish"))
  7374.       {
  7375.         a.K(false);
  7376.       }
  7377.  
  7378.     }
  7379.     else if ((localRSObject2 != null) && (a.l(localRSObject2, "Fletch-bows")))
  7380.     {
  7381.       a.K(false);
  7382.     }
  7383.  
  7384.     a.sleep(400, 600);
  7385.  
  7386.     return 1;
  7387.   }
  7388.  
  7389.   private RSObject G(RSTile a)
  7390.   {
  7391.     try
  7392.     {
  7393.       return a.objects.getTopAt(a);
  7394.     }
  7395.     catch (Exception localException)
  7396.     {
  7397.       if (a != null)
  7398.       {
  7399.         a.log.severe("Nullpointer getting the object at " + a);
  7400.       }
  7401.  
  7402.     }
  7403.  
  7404.     return null;
  7405.   }
  7406.  
  7407.   private void uA()
  7408.   {
  7409.     int i1;
  7410.     if (a.FA != null) { if (a.FA.contains(new RSTile[] { a.X() }));
  7411.     }
  7412.     else
  7413.     {
  7414.       if (((RSArea)a.Nc.get(i1)).contains(new RSTile[] { a.X() }))
  7415.       {
  7416.         a.FA = ((RSArea)a.Nc.get(i1));
  7417.  
  7418.         a.Rd = (i1 + 1);
  7419.  
  7420.         return;
  7421.       }i1++;
  7422.     }
  7423.   }
  7424.  
  7425.   private void SA()
  7426.   {
  7427.     if (!a.qB)
  7428.     {
  7429.       RSItem[] arrayOfRSItem;
  7430.       int i1 = (arrayOfRSItem = a.jb()).length;
  7431.       int i2;
  7432.       RSItem localRSItem;
  7433.       if ((
  7434.         (localRSItem = arrayOfRSItem[i2]) != null) && (localRSItem.getID() > 0) && (localRSItem.doAction("Remove")))
  7435.       {
  7436.         a.sleep(500, 800);
  7437.       }
  7438.       i2++;
  7439.  
  7440.       a.qB = true;
  7441.     }
  7442.   }
  7443.  
  7444.   private int pA()
  7445.   {
  7446.     if (!a.O())
  7447.       return -1;
  7448.     boolean bool = false;
  7449.     int[] arrayOfInt1 = { 54130, 54131, 54132, 54133, 54134, 541325, 54138, 54139, 54140, 54141, 54142 };
  7450.  
  7451.     int[] arrayOfInt2 = { 54118, 54122, 54123, 54124, 54125, 54126 };
  7452.  
  7453.     RSObject localRSObject1 = null; RSObject localRSObject2 = null;
  7454.  
  7455.     if (a.jA()) {
  7456.       return 2;
  7457.     }
  7458.  
  7459.     if (!a.j()) {
  7460.       return -1;
  7461.     }
  7462.  
  7463.     a.l(a.vc, 40, 50);
  7464.  
  7465.     bool = false;
  7466.  
  7467.     localRSObject1 = a.i(arrayOfInt1);
  7468.  
  7469.     localRSObject2 = a.i(arrayOfInt2);
  7470.  
  7471.     if ((localRSObject1 != null) && (localRSObject2 != null))
  7472.     {
  7473.       bool = a.calc.distanceTo(localRSObject1) < a.calc.distanceTo(localRSObject2) ? a.l(localRSObject1, "Mine") : a.l(localRSObject2, "Fix");
  7474.     }
  7475.     else if (localRSObject1 == null) {
  7476.       bool = a.l(localRSObject2, "Fix");
  7477.     }
  7478.     else
  7479.     {
  7480.       bool = a.l(localRSObject1, "Mine");
  7481.     }
  7482.  
  7483.     a.J(bool);
  7484.  
  7485.     return 1;
  7486.   }
  7487.  
  7488.   private RSObject[] J(int[] a)
  7489.   {
  7490.     return a.objects.getAll(new l(a, a));
  7491.   }
  7492.  
  7493.   private int RA()
  7494.   {
  7495.     int[][] arrayOfInt1 = { a.Bb, a.ad, a.OD };
  7496.  
  7497.     RSObject localRSObject1 = a.i(a.OD);
  7498.  
  7499.     RSTile localRSTile1 = a.tA();
  7500.  
  7501.     if ((localRSObject1 == null) || (localRSTile1 == null))
  7502.     {
  7503.       return -1;
  7504.     }
  7505.     int i1 = localRSTile1.getX(); int i2 = localRSTile1.getY(); int i3 = localRSObject1.getLocation().getX(); int i4 = localRSObject1.getLocation().getY();
  7506.  
  7507.     RSTile localRSTile2 = new RSTile(i3 + (i3 - i1) / 2, i4 + (i4 - i2) / 2);
  7508.     int[][] arrayOfInt2;
  7509.     int i5 = (arrayOfInt2 = arrayOfInt1).length;
  7510.     int i6;
  7511.     [I local[I = arrayOfInt2[i6];
  7512.  
  7513.     if (a.jA())
  7514.       return 2;
  7515.     RSObject localRSObject2;
  7516.     if (
  7517.       (localRSObject2 = a.i(local[I)) == null) {
  7518.       return -1;
  7519.     }
  7520.  
  7521.     a.vE = localRSObject2.getLocation();
  7522.  
  7523.     int i7 = localRSObject2.getID();
  7524.  
  7525.     a.l(a.vc, 45, 50);
  7526.  
  7527.     if (a.jA())
  7528.       return 2;
  7529.     RSObject localRSObject3;
  7530.     if (((localRSObject3 = a.G(a.vE)) != null) &&
  7531.       (localRSObject3.getID() != i7) && ((localRSObject2 = a.i(local[I)) != null))
  7532.     {
  7533.       a.vE = localRSObject2.getLocation();
  7534.     }
  7535.     if (a.X().equals(a.vE))
  7536.     {
  7537.       a.A(localRSTile2, 2);
  7538.  
  7539.       a.K(false);
  7540.     }
  7541.     else if ((a.Y().getAnimation() != 1114) && (!a.Y().isMoving()))
  7542.     {
  7543.       int i8 = 0;
  7544.  
  7545.       if (a.l(localRSObject2, "Step-onto"))
  7546.       {
  7547.         if (a.Y().getAnimation() == 1114)
  7548.           i8 = 1;
  7549.         a.sleep(300, 400);
  7550.         int i9;
  7551.         if ((i9 = 0) < 10)
  7552.         {
  7553.           if (a.Y().getAnimation() == 1114) {
  7554.             i8 = 1;
  7555.           }
  7556.  
  7557.           a.sleep(150, 200);
  7558.  
  7559.           i9++;
  7560.         }
  7561.         a.sleep(200, 400);
  7562.  
  7563.         if ((localRSObject3 = a.G(a.vE)) != null) {
  7564.           if (
  7565.             (localRSObject2 = a.i(local[I)) != null)
  7566.           {
  7567.             a.vE = localRSObject2.getLocation();
  7568.  
  7569.             if (a.A(localRSTile2, 2)) {
  7570.               a.K(false);
  7571.             }
  7572.  
  7573.           }
  7574.  
  7575.         }
  7576.  
  7577.       }
  7578.  
  7579.     }
  7580.  
  7581.     a.sleep(100, 200);
  7582.  
  7583.     i6++;
  7584.  
  7585.     a.NA = true;
  7586.  
  7587.     return 1;
  7588.   }
  7589.  
  7590.   private int WA()
  7591.   {
  7592.     int[] arrayOfInt1 = { 11036, 11037, 11038, 12094 };
  7593.  
  7594.     int[] arrayOfInt2 = { 11039, 11040, 11041, 12095 };
  7595.  
  7596.     int[] arrayOfInt3 = { 11042, 11043, 11044, 12096 };
  7597.  
  7598.     RSNPC localRSNPC = null;
  7599.  
  7600.     String str = "";
  7601.  
  7602.     if (a.D(arrayOfInt1) != null)
  7603.     {
  7604.       a.log("Equipping the meleer");
  7605.  
  7606.       localRSNPC = a.D(arrayOfInt1);
  7607.  
  7608.       str = "Sword";
  7609.     }
  7610.     else if (a.D(arrayOfInt2) != null)
  7611.     {
  7612.       a.log("Equipping the ranger");
  7613.  
  7614.       localRSNPC = a.D(arrayOfInt2);
  7615.  
  7616.       str = "Bow";
  7617.     }
  7618.     else if (a.D(arrayOfInt3) != null)
  7619.     {
  7620.       a.log("Equipping the mager");
  7621.  
  7622.       localRSNPC = a.D(arrayOfInt3);
  7623.  
  7624.       str = "Staff";
  7625.     }
  7626.     if (localRSNPC == null)
  7627.     {
  7628.       return -1;
  7629.     }
  7630.     RSObject localRSObject = a.i(new int[] { 49647, 49648, 49649, 53991 });
  7631.     do
  7632.     {
  7633.       if (a.jA())
  7634.       {
  7635.         return 2;
  7636.       }
  7637.  
  7638.       if (!a.j()) {
  7639.         return -1;
  7640.       }
  7641.  
  7642.       if ((!a.l(a.vc, 40, 50)) && (!a.inventory.contains(17444))) {
  7643.         a.l(a.groundItems.getNearest(new int[] { 17444 }));
  7644.       }
  7645.       else if (a.inventory.getItemID("Stone " + str.toLowerCase()) != -1)
  7646.         a.F(localRSNPC, "Arm");
  7647.       else if (a.interfaces.get(451).isValid())
  7648.       {
  7649.         a.l(a.interfaces.get(451), new String[] { str });
  7650.       }
  7651.       else if (a.inventory.contains(17415))
  7652.       {
  7653.         a.inventory.getItem(new int[] { 17415 }).doAction("Carve");
  7654.       }
  7655.       else if ((!a.inventory.contains(17415)) && (a.l(localRSObject, "Mine")))
  7656.       {
  7657.         a.l(true);
  7658.       }
  7659.  
  7660.       a.K(true);
  7661.     }
  7662.  
  7663.     while (!a.Y().isInCombat());
  7664.  
  7665.     if (!a.JC())
  7666.       a.sleep(800, 1000);
  7667.     a.K(true);
  7668.  
  7669.     return 1;
  7670.   }
  7671.  
  7672.   private boolean i(RSNPC a)
  7673.   {
  7674.     if (a == null) {
  7675.       a = a.npcs.getNearest(a.jE);
  7676.     }
  7677.  
  7678.     if ((a == null) || ((a.l(a) == 0) && (a.getAnimation() != -1))) {
  7679.       return false;
  7680.     }
  7681.  
  7682.     if (!a.l(a))
  7683.       if (a.l(a, "Attack " + a.getName()))
  7684.       {
  7685.         a.sleep(1000, 1400);
  7686.       }
  7687.       else if (!a.isOnScreen())
  7688.       {
  7689.         if (!a.Y().isMoving())
  7690.         {
  7691.           if (a.calc.distanceTo(a) < 10)
  7692.           {
  7693.             a.l(a.getLocation());
  7694.           }
  7695.           else
  7696.           {
  7697.             a.l(a.getLocation(), 1);
  7698.           }
  7699.  
  7700.           a.l(false);
  7701.         }
  7702.         if (a.F(a))
  7703.         {
  7704.           int i1;
  7705.           if ((i1 = 0) < (a.GD ? 18 : 15))
  7706.           {
  7707.             a.sleep(100, 200);
  7708.  
  7709.             i1++;
  7710.           }
  7711.  
  7712.           return true;
  7713.         }
  7714.       }
  7715.     return false;
  7716.   }
  7717.  
  7718.   private int HA()
  7719.   {
  7720.     int[] arrayOfInt1 = { 54365, 54367, 54369, 54371, 54373, 54375, 54377, 54379, 54381, 54383, 54385, 54387, 54389, 54391, 54393, 54395, 54397, 54399, 54401, 54403 };
  7721.  
  7722.     int[] arrayOfInt2 = { 54364, 54366, 54368, 54370 }; int[] arrayOfInt3 = { 54372, 54374, 54376, 54378 }; int[] arrayOfInt4 = { 54380, 54382, 54384, 54386 }; int[] arrayOfInt5 = { 54388, 54390, 54392, 54394 }; int[] arrayOfInt6 = { 54396, 54398, 54400, 54402 };
  7723.  
  7724.     int[][] arrayOfInt = { arrayOfInt3, arrayOfInt2, arrayOfInt5, arrayOfInt4, arrayOfInt6 };
  7725.     int i1;
  7726.     while (a.npcs.getNearest(a.AC) != null)
  7727.     {
  7728.       int i2 = 0;
  7729.  
  7730.       RSNPC localRSNPC = a.npcs.getNearest(new int[] { a.AC[i1] });
  7731.  
  7732.       RSObject localRSObject = a.i(arrayOfInt[i1]);
  7733.  
  7734.       if ((localRSNPC != null) && (localRSObject != null))
  7735.       {
  7736.         a.vE = localRSObject.getLocation();
  7737.  
  7738.         while ((localRSNPC != null) && (!localRSNPC.getLocation().equals(a.vE)))
  7739.         {
  7740.           if (a.jA()) {
  7741.             return 2;
  7742.           }
  7743.  
  7744.           RSTile localRSTile1 = null; RSTile localRSTile2 = null; RSTile localRSTile3 = null;
  7745.  
  7746.           int i3 = 1; int i4 = 1;
  7747.  
  7748.           int i5 = localRSNPC.getLocation().getX(); int i6 = localRSNPC.getLocation().getY();
  7749.  
  7750.           if (i5 > a.vE.getX())
  7751.           {
  7752.             localRSTile1 = new RSTile(i5 - 1, i6);
  7753.  
  7754.             localRSTile2 = new RSTile(i5 + 2, i6);
  7755.  
  7756.             if (!a.J(localRSTile2, arrayOfInt1))
  7757.             {
  7758.               localRSTile2 = new RSTile(i5 + 1, i6);
  7759.             }
  7760.           }
  7761.           else if (i5 < a.vE.getX())
  7762.           {
  7763.             localRSTile1 = new RSTile(i5 + 1, i6);
  7764.  
  7765.             localRSTile2 = new RSTile(i5 - 2, i6);
  7766.  
  7767.             if (!a.J(localRSTile2, arrayOfInt1))
  7768.             {
  7769.               localRSTile2 = new RSTile(i5 - 1, i6);
  7770.             }
  7771.           }
  7772.           if ((a.J(localRSTile1, arrayOfInt1)) && (a.J(localRSTile2, arrayOfInt1)))
  7773.           {
  7774.             i3 = 0;
  7775.           }
  7776.  
  7777.           if (i6 > a.vE.getY())
  7778.           {
  7779.             localRSTile1 = new RSTile(i5, i6 - 1);
  7780.  
  7781.             localRSTile3 = new RSTile(i5, i6 + 2);
  7782.  
  7783.             if (!a.J(localRSTile3, arrayOfInt1)) {
  7784.               localRSTile3 = new RSTile(i5, i6 + 1);
  7785.             }
  7786.  
  7787.           }
  7788.           else if (i6 < a.vE.getY())
  7789.           {
  7790.             localRSTile1 = new RSTile(i5, i6 + 1);
  7791.  
  7792.             localRSTile3 = new RSTile(i5, i6 - 2);
  7793.  
  7794.             if (!a.J(localRSTile3, arrayOfInt1))
  7795.             {
  7796.               localRSTile3 = new RSTile(i5, i6 - 1);
  7797.             }
  7798.  
  7799.           }
  7800.  
  7801.           if ((a.J(localRSTile1, arrayOfInt1)) && (a.J(localRSTile3, arrayOfInt1))) {
  7802.             i4 = 0;
  7803.           }
  7804.  
  7805.           if (i3 == 0)
  7806.           {
  7807.             if (!a.X().equals(localRSTile2))
  7808.             {
  7809.               a.A(localRSTile2, 0);
  7810.  
  7811.               i2 = 0;
  7812.             }
  7813.             else
  7814.             {
  7815.               i2++;
  7816.             }
  7817.  
  7818.           }
  7819.           else if (i4 == 0)
  7820.           {
  7821.             if (!a.X().equals(localRSTile3))
  7822.             {
  7823.               a.A(localRSTile3, 0);
  7824.  
  7825.               i2 = 0;
  7826.             }
  7827.             else
  7828.             {
  7829.               i2++;
  7830.             }
  7831.           }
  7832.           else
  7833.           {
  7834.             a.F(localRSNPC, "Scare");
  7835.  
  7836.             a.K(true);
  7837.           }
  7838.  
  7839.           a.sleep(500, 800);
  7840.  
  7841.           i2++;
  7842.  
  7843.           a.sleep(300, 500);
  7844.  
  7845.           if (i2 > 8)
  7846.           {
  7847.             a.F(localRSNPC, "Scare");
  7848.  
  7849.             a.sleep(400, 800);
  7850.  
  7851.             a.A(localRSNPC.getLocation(), 0);
  7852.  
  7853.             a.K(false);
  7854.  
  7855.             i2 = 0;
  7856.           }
  7857.         }
  7858.       }
  7859.       i1++;
  7860.     }
  7861.  
  7862.     return 1;
  7863.   }
  7864.  
  7865.   private boolean l(RSGroundItem a)
  7866.   {
  7867.     if (a == null)
  7868.     {
  7869.       return false;
  7870.     }
  7871.     String str = a.getItem().getName();
  7872.  
  7873.     RSTile localRSTile = a.getLocation();
  7874.  
  7875.     double d1 = 0.45D; double d2 = 0.55D; double d3 = 0.4D; double d4 = 0.6D;
  7876.  
  7877.     if ((!a.isOnScreen()) && (!a.Y().isMoving()))
  7878.     {
  7879.       a.l(localRSTile, 1);
  7880.  
  7881.       if (!a.l(false)) {
  7882.         a.PA();
  7883.       }
  7884.       else
  7885.       {
  7886.         while (!a.isOnScreen())
  7887.         {
  7888.           if (a.JC())
  7889.           {
  7890.             continue;
  7891.           }
  7892.  
  7893.           a.sleep(300, 500);
  7894.         }
  7895.  
  7896.       }
  7897.  
  7898.     }
  7899.  
  7900.     if ((a.Rd == 1) && (!a.J(localRSTile, new int[0])))
  7901.     {
  7902.       d1 = 0.35D;
  7903.  
  7904.       d2 = 0.65D;
  7905.  
  7906.       d3 = 0.75D;
  7907.  
  7908.       d4 = 0.95D;
  7909.     }
  7910.  
  7911.     return a.l(localRSTile, a.random(d1, d2), a.random(d3, d4), 0, "Take " + str);
  7912.   }
  7913.  
  7914.   private ArrayList<RSTile> F(RSArea a)
  7915.   {
  7916.     a.a.clear();
  7917.  
  7918.     Object localObject = null;
  7919.  
  7920.     RSArea localRSArea = a;
  7921.  
  7922.     int i1 = 0;
  7923.  
  7924.     while ((localRSArea != null) && (!localRSArea.equals(a.jb)))
  7925.     {
  7926.       for (Iterator localIterator = a.fc.iterator(); localIterator.hasNext(); ) { localRSTile = (RSTile)localIterator.next();
  7927.  
  7928.         if (localRSArea.contains(new RSTile[] { localRSTile }))
  7929.         {
  7930.           localObject = localRSTile;
  7931.  
  7932.           break;
  7933.         }
  7934.       }
  7935.       RSTile localRSTile;
  7936.       if (localObject != null)
  7937.       {
  7938.         if ((localRSArea = a.E(localObject)) != null)
  7939.           for (localIterator = a.w.iterator(); localIterator.hasNext(); )
  7940.           {
  7941.             if (((localRSTile = (RSTile)localIterator.next()) != null) &&
  7942.               (a.calc.distanceBetween(localRSTile, localObject) < 4.0D))
  7943.             {
  7944.               a.a.add(localRSTile);
  7945.  
  7946.               break;
  7947.             }
  7948.           }
  7949.       }
  7950.       i1++;
  7951.  
  7952.       if (i1 <= 25)
  7953.         continue;
  7954.       a.log.severe("Unable to generate path.");
  7955.  
  7956.       return a.a;
  7957.     }
  7958.     return a.a;
  7959.   }
  7960.  
  7961.   public void keyTyped(KeyEvent a)
  7962.   {
  7963.     if ((!a.iA) && (a.qD) && (a.DC == 3))
  7964.     {
  7965.       char c1;
  7966.       if (((c1 = a.getKeyChar()) ==
  7967.         '\n') || (c1 == '\t'))
  7968.       {
  7969.         a.PA = (a.PA == -1 ? ++a.PA : -1);
  7970.       }
  7971.       else if (a.PA == 0)
  7972.         if ((c1 == '\b') && (a.ce.length() > 0))
  7973.         {
  7974.           a.ce = a.ce.substring(0, a.ce.length() - 1);
  7975.         }
  7976.         else if ((c1 != '\b') && (a.ce.length() < 25))
  7977.         {
  7978.           a.ce += c1;
  7979.         }
  7980.     }
  7981.   }
  7982.  
  7983.   private int KA()
  7984.   {
  7985.     RSNPC localRSNPC;
  7986.     if (
  7987.       (localRSNPC = a.npcs.getNearest(a.aF)) == null)
  7988.     {
  7989.       if (a.jA())
  7990.         return 2;
  7991.       return -1;
  7992.     }
  7993.  
  7994.     a.vE = a.F(localRSNPC.getLocation(), a.te);
  7995.  
  7996.     while (a.npcs.getNearest(a.aF) != null)
  7997.     {
  7998.       localRSNPC = a.npcs.getNearest(a.aF);
  7999.  
  8000.       if (a.jA()) {
  8001.         return 2;
  8002.       }
  8003.  
  8004.       a.A(a.vE, 0);
  8005.  
  8006.       a.K(false);
  8007.  
  8008.       if ((localRSNPC == null) || (localRSNPC.getAnimation() == -1))
  8009.       {
  8010.         continue;
  8011.       }
  8012.  
  8013.       int i1 = localRSNPC.getAnimation();
  8014.  
  8015.       if (a.interfaces.get(238).isValid())
  8016.       {
  8017.         String str = "";
  8018.  
  8019.         if (i1 == 855)
  8020.         {
  8021.           str = "Nod head";
  8022.         }
  8023.         else if (i1 == 856) {
  8024.           str = "Shake head";
  8025.         }
  8026.         else if (i1 == 860) {
  8027.           str = "Cry";
  8028.         }
  8029.         else if (i1 == 861)
  8030.           str = "Laugh";
  8031.         else if (i1 == 863)
  8032.         {
  8033.           str = "Wave";
  8034.         }
  8035.         if (str.isEmpty())
  8036.         {
  8037.           a.F(a.vE, 1);
  8038.         }
  8039.         else
  8040.         {
  8041.           a.sleep(700, 1400);
  8042.  
  8043.           if (a.l(a.interfaces.get(238), new String[] { str }))
  8044.           {
  8045.             a.sleep(400, 800);
  8046.  
  8047.             a.sleep(300, 400);
  8048.           }
  8049.         }
  8050.       }
  8051.     }
  8052.     return 1;
  8053.   }
  8054.  
  8055.   private RSObject i(int[] a)
  8056.   {
  8057.     return a.objects.getNearest(new r(a, a));
  8058.   }
  8059.  
  8060.   private String l(RSItem a)
  8061.   {
  8062.     if (a == null)
  8063.       return "";
  8064.     String str;
  8065.     int i1;
  8066.     if ((i1 =
  8067.       (str = a.getName()).indexOf(">")) > 0)
  8068.     {
  8069.       str = str.substring(i1 + 1);
  8070.     }
  8071.     int i2;
  8072.     if ((i2 = str.indexOf(" (")) > 0)
  8073.     {
  8074.       str = str.substring(0, i2);
  8075.     }
  8076.     return str;
  8077.   }
  8078.  
  8079.   private int gA()
  8080.   {
  8081.     if (!a.O())
  8082.     {
  8083.       return -1;
  8084.     }
  8085.     boolean bool1 = false; boolean bool2 = false;
  8086.  
  8087.     RSObject localRSObject1 = a.i(new int[] { 54251 });
  8088.  
  8089.     RSObject localRSObject2 = a.i(new int[] { 49934, 49935, 49936, 53749 });
  8090.  
  8091.     RSObject localRSObject3 = a.i(new int[] { 54255 });
  8092.  
  8093.     RSObject localRSObject4 = a.i(new int[] { 54256, 54257, 54258, 54259 });
  8094.  
  8095.     RSObject localRSObject5 = a.i(a.mb);
  8096.  
  8097.     a.jA = a.npcs.getNearest(a.B);
  8098.  
  8099.     if ((a.jA != null) && ((a.HC != 1) || (a.l(a.jA.getLocation(), false))))
  8100.     {
  8101.       if ((!a.QB()) || ((a.HC == 1) && (!a.ZA())))
  8102.       {
  8103.         return 2;
  8104.       }
  8105.     }
  8106.     if (a.hd == null)
  8107.     {
  8108.       a.hd = new Timer(a.random(240000, 300000));
  8109.     }
  8110.     bool1 = a.F(a.u) == null;
  8111.  
  8112.     a.A(bool1);
  8113.     do
  8114.     {
  8115.       if (a.jA())
  8116.       {
  8117.         return 2;
  8118.       }
  8119.       if (!a.j()) {
  8120.         return -1;
  8121.       }
  8122.  
  8123.       a.yd = a.l(a.Zd);
  8124.  
  8125.       if ((a.yd != null) && (a.l(a.yd.getLocation(), false)))
  8126.       {
  8127.         bool2 = a.l(a.yd);
  8128.       }
  8129.       else if (a.SE.contains("re-attach"))
  8130.       {
  8131.         a.A(new int[] { 19663, 19664, 19665, 19667, 19668 });
  8132.       }
  8133.       if (a.inventory.contains(19668))
  8134.       {
  8135.         bool2 = a.l(localRSObject5, "Grapple");
  8136.       }
  8137.       else if (a.inventory.containsAll(new int[] { 19667, 19664 }))
  8138.       {
  8139.         a.inventory.useItem(a.inventory.getItem(new int[] { 19667 }), a.inventory.getItem(new int[] { 19664 }));
  8140.       }
  8141.       else if ((a.inventory.contains(19665)) && (!a.inventory.contains(19667)))
  8142.         bool2 = a.l(localRSObject2, "Spin");
  8143.       else if ((a.inventory.contains(19663)) && (!a.inventory.contains(19664)))
  8144.         bool2 = a.l(localRSObject4, "Smith");
  8145.       else if (!a.inventory.containsOneOf(new int[] { 19665, 19667 }))
  8146.       {
  8147.         bool2 = a.l(localRSObject3, "Plunder");
  8148.       }
  8149.       else if (!a.inventory.containsOneOf(new int[] { 19663, 19664 }))
  8150.         bool2 = a.l(localRSObject1, "Retrieve");
  8151.       if (bool2)
  8152.       {
  8153.         a.K(bool1);
  8154.       }
  8155.       else {
  8156.         a.sleep(300, 600);
  8157.       }
  8158.  
  8159.     }
  8160.  
  8161.     while (!a.Rc());
  8162.  
  8163.     a.sleep(800, 1100);
  8164.  
  8165.     a.lA();
  8166.  
  8167.     a.jA = a.npcs.getNearest(a.B);
  8168.  
  8169.     if (!a.inventory.contains(18829))
  8170.     {
  8171.       if (a.jA())
  8172.         return 2;
  8173.       RSGroundItem localRSGroundItem;
  8174.       if (a.l(localRSGroundItem))
  8175.       {
  8176.         a.K(false);
  8177.       }
  8178.       a.sleep(300, 500);
  8179.     }
  8180.     return a.A(a.nD);
  8181.   }
  8182.  
  8183.   private String i(String a)
  8184.   {
  8185.     if (a == null)
  8186.       return "";
  8187.     int i1;
  8188.     if (
  8189.       (i1 = a.indexOf(" ")) > -1)
  8190.     {
  8191.       a = a.substring(i1 + 1);
  8192.     }
  8193.     int i2;
  8194.     if (
  8195.       (i2 = a.indexOf(" (")) > 0)
  8196.     {
  8197.       a = a.substring(0, i2);
  8198.     }
  8199.     return a;
  8200.   }
  8201.  
  8202.   private RSNPC i(String[] a)
  8203.   {
  8204.     return a.npcs.getNearest(new k(a, a));
  8205.   }
  8206.  
  8207.   private boolean IA()
  8208.   {
  8209.     a.nE = false;
  8210.  
  8211.     a.VA();
  8212.  
  8213.     a.lc = null;
  8214.  
  8215.     if (a.ZA == null) {
  8216.       a.ZA = a.r;
  8217.     }
  8218.  
  8219.     if (a.ob.size() == 0)
  8220.     {
  8221.       RSObject localRSObject1 = a.i(a.gb);
  8222.  
  8223.       RSObject localRSObject2 = a.i(a.Lb);
  8224.  
  8225.       if (localRSObject1 != null)
  8226.       {
  8227.         a.log("Dungeon exit ahead!");
  8228.  
  8229.         a.s();
  8230.  
  8231.         return true;
  8232.       }
  8233.       if (localRSObject2 != null)
  8234.       {
  8235.         if (a.nb == null)
  8236.         {
  8237.           a.nb = a.ZA;
  8238.  
  8239.           a.fc.add(localRSObject2.getLocation());
  8240.  
  8241.           a.ig = a.F(a.nb);
  8242.  
  8243.           a.HD = new Timer(0L);
  8244.  
  8245.           a.PD = -1;
  8246.         }
  8247.         if (!a.nb.contains(new RSTile[] { a.X() }))
  8248.         {
  8249.           a.AB = "Preparing for the boss battle";
  8250.  
  8251.           if (a.D(new int[] { 10058 }) == null)
  8252.           {
  8253.             a.Ic();
  8254.           }
  8255.           if (a.i(new int[] { 51300 }) != null)
  8256.           {
  8257.             if ((a.walking.getEnergy() < a.random(85, 90)) && (!a.d()))
  8258.             {
  8259.               a.AB = "Resting up for the Icefiend!";
  8260.  
  8261.               a.walking.rest(100);
  8262.             }
  8263.           }
  8264.           else if (a.i(new int[] { 51887 }) != null)
  8265.           {
  8266.             if (a.HC == 2)
  8267.             {
  8268.               a.log("Swapping attack style for Sagittare!");
  8269.  
  8270.               if (a.kC)
  8271.               {
  8272.                 a.i(1);
  8273.               }
  8274.               else if (a.iD)
  8275.               {
  8276.                 a.i(3);
  8277.               }
  8278.               else
  8279.               {
  8280.                 a.log.severe("We don't have a way to kill Sagittare, aborting dungeon!");
  8281.  
  8282.                 a.nc = true;
  8283.  
  8284.                 return false;
  8285.               }
  8286.             }
  8287.           }
  8288.           else if (a.i(new String[] { "Riftsplitter" }) != null)
  8289.           {
  8290.             if (a.iD)
  8291.             {
  8292.               a.AB = "Swapping combat style to magic";
  8293.  
  8294.               a.i(3);
  8295.             }
  8296.           }
  8297.           else if (a.i(new int[] { 54475 }) != null)
  8298.           {
  8299.             if (a.HC == 1)
  8300.               if (a.Sd)
  8301.               {
  8302.                 a.AB = "Swapping combat style to range";
  8303.  
  8304.                 a.i(2);
  8305.               }
  8306.               else if (a.iD)
  8307.               {
  8308.                 a.AB = "Swapping combat style to magic";
  8309.  
  8310.                 a.i(3);
  8311.               }
  8312.               else
  8313.               {
  8314.                 a.log.severe("We can't kill this boss with melee, aborting dungeon");
  8315.  
  8316.                 a.Ic += 1;
  8317.  
  8318.                 a.nc = true;
  8319.  
  8320.                 return false;
  8321.               }
  8322.           }
  8323.           else if (a.npcs.getNearest(new String[] { "Sagittare" }) != null)
  8324.           {
  8325.             if (a.HC == 2)
  8326.             {
  8327.               a.AB = "Swapping combat style to melee";
  8328.  
  8329.               if (!a.i(1))
  8330.               {
  8331.                 a.log("We don't have a backup weapon for Saggitare, aborting dungeon.");
  8332.  
  8333.                 a.nc = true;
  8334.  
  8335.                 return false;
  8336.               }
  8337.             }
  8338.           }
  8339.           else if (a.npcs.getNearest(new String[] { "Rammernaut" }) != null)
  8340.           {
  8341.             if ((a.HC != 3) && (a.iD))
  8342.             {
  8343.               a.AB = "Swapping combat style to magic";
  8344.  
  8345.               a.i(3);
  8346.             }
  8347.           }
  8348.           a.AB = "";
  8349.         }
  8350.         a.ic.remove(a.ZA);
  8351.  
  8352.         a.Fg = false;
  8353.  
  8354.         a.hB = false;
  8355.  
  8356.         a.X = false;
  8357.  
  8358.         a.FF = true;
  8359.  
  8360.         return true;
  8361.       }
  8362.       RSTile localRSTile = a.EA();
  8363.  
  8364.       if (a.yd != null)
  8365.       {
  8366.         if (a.r.contains(new RSTile[] { a.X() }))
  8367.         {
  8368.           a.l(localRSTile, 1);
  8369.         }
  8370.         if ((a.HC == 1) && (a.calc.distanceTo(localRSTile) > a.random(5, 7)) && (a.i(a.u) != null))
  8371.         {
  8372.           a.A(false);
  8373.         }
  8374.  
  8375.         a.game.openTab(4);
  8376.  
  8377.         a.nE = true;
  8378.  
  8379.         a.AB = "Grabbing a key from the dead end";
  8380.  
  8381.         return true;
  8382.       }
  8383.       a.fG.add(a.nD);
  8384.  
  8385.       a.w.removeAll(a.fG);
  8386.  
  8387.       a.J.removeAll(a.fG);
  8388.  
  8389.       a.Bd.removeAll(a.fG);
  8390.  
  8391.       a.nE = true;
  8392.  
  8393.       a.AB = "Skipping the dead end";
  8394.  
  8395.       return false;
  8396.     }
  8397.     return true;
  8398.   }
  8399.  
  8400.   private void BA()
  8401.   {
  8402.     int i1;
  8403.     int i2 =
  8404.       i1 = a.dC;
  8405.  
  8406.     a.gd = false;
  8407.  
  8408.     a.nc = false;
  8409.  
  8410.     RSObject localRSObject = a.objects.getNearest(new int[] { 48496 });
  8411.  
  8412.     a.Qc = "Entering Daemonheim...";
  8413.  
  8414.     localRSObject = a.objects.getNearest(new int[] { 48496 });
  8415.  
  8416.     if (a.jA()) {
  8417.       return;
  8418.     }
  8419.  
  8420.     a.ad();
  8421.  
  8422.     i2 =
  8423.       i1 = a.dC;
  8424.  
  8425.     if ((a.E) && (a.OA < a.td))
  8426.     {
  8427.       i2 =
  8428.         a.ld;
  8429.     }
  8430.     if (a.interfaces.getComponent(210, 2).isValid())
  8431.     {
  8432.       a.interfaces.getComponent(210, 2).doClick();
  8433.     }
  8434.     else if (a.interfaces.get(236).isValid())
  8435.     {
  8436.       a.interfaces.getComponent(236, (a.od) && (a.interfaces.getComponent(236, 0).containsText("size")) && ((!a.E) || (a.Ud > a.td)) ? 2 : 1).doClick();
  8437.     }
  8438.     else if (a.interfaces.getComponent(947, 608).isValid())
  8439.     {
  8440.       a.ad();
  8441.  
  8442.       if ((a.OA >= a.g) || ((a.JE) && (a.OA + 2 > a.g)))
  8443.       {
  8444.         if (!a.Ec()) {
  8445.           return;
  8446.         }
  8447.  
  8448.       }
  8449.  
  8450.       if (a.iA()) {
  8451.         while (a.interfaces.getComponent(947, 608).isValid())
  8452.         {
  8453.           if (a.interfaces.getComponent(947, 765).getText().contains("" + a.Ud))
  8454.           {
  8455.             a.interfaces.getComponent(947, 761).doAction("Confirm");
  8456.           }
  8457.           else
  8458.           {
  8459.             a.interfaces.getComponent(947, 608 + a.OA).doAction("Select-floor");
  8460.           }
  8461.           a.sleep(700, 1000);
  8462.         }
  8463.  
  8464.       }
  8465.  
  8466.       a.mouse.moveRandomly(200);
  8467.     }
  8468.     else
  8469.     {
  8470.       if (a.interfaces.getComponent(938, 42).isValid())
  8471.       {
  8472.         a.SE = "";
  8473.  
  8474.         while (a.interfaces.getComponent(938, 42).isValid())
  8475.         {
  8476.           if (a.SE.contains("access complexity"))
  8477.           {
  8478.             i2--;
  8479.  
  8480.             a.SE = "";
  8481.           }
  8482.  
  8483.           if (!a.interfaces.getComponent(938, 42).getText().contains("" + i2)) {
  8484.             a.interfaces.getComponent(938, 55 + 5 * i2).doAction("Select-complexity");
  8485.           }
  8486.           else
  8487.           {
  8488.             a.interfaces.getComponent(938, 37).doAction("Confirm");
  8489.           }
  8490.           a.sleep(600, 800);
  8491.         }
  8492.  
  8493.       }
  8494.  
  8495.       if ((a.interfaces.get(939).isValid()) && ((a.OA >= a.g) || ((a.JE) && (a.OA + 2 > a.g))))
  8496.       {
  8497.         if (!a.Ec())
  8498.         {
  8499.           return;
  8500.         }
  8501.       }
  8502.       else if (localRSObject != null)
  8503.       {
  8504.         a.l(localRSObject, "Climb-down");
  8505.  
  8506.         a.K(false);
  8507.       }
  8508.  
  8509.     }
  8510.  
  8511.     a.sleep(600, 1000);
  8512.  
  8513.     a.N = true;
  8514.  
  8515.     a.zB = true;
  8516.  
  8517.     a.Zc = i2;
  8518.   }
  8519.  
  8520.   private boolean A(int[] a)
  8521.   {
  8522.     if (a.inventory.containsOneOf(a))
  8523.     {
  8524.       int i1 = a.mouse.getSpeed();
  8525.  
  8526.       a.mouse.setSpeed(i1 + a.random(1, 4));
  8527.  
  8528.       while (a.inventory.containsOneOf(a))
  8529.       {
  8530.         if (a.Zc())
  8531.         {
  8532.           return false;
  8533.         }
  8534.         RSItem localRSItem;
  8535.         if (((localRSItem = a.inventory.getItem(a)) != null) &&
  8536.           (localRSItem.doAction("Drop"))) {
  8537.           a.sleep(400, 600);
  8538.         }
  8539.  
  8540.       }
  8541.  
  8542.       a.mouse.setSpeed(i1);
  8543.  
  8544.       return true;
  8545.     }
  8546.  
  8547.     return false;
  8548.   }
  8549.  
  8550.   private RSTile EA()
  8551.   {
  8552.     int[][] arrayOfInt;
  8553.     int i1 = (arrayOfInt = a.x).length;
  8554.     int i2;
  8555.     int[] arrayOfInt1 = arrayOfInt[i2];
  8556.  
  8557.     a.yd = a.groundItems.getNearest(arrayOfInt1);
  8558.  
  8559.     if (a.yd != null) if (a.r.contains(new RSTile[] { a.yd.getLocation() }))
  8560.       {
  8561.         return a.yd.getLocation();
  8562.       }
  8563.     i2++;
  8564.  
  8565.     a.yd = null;
  8566.  
  8567.     return null;
  8568.   }
  8569.  
  8570.   private RSNPC D(RSTile a)
  8571.   {
  8572.     if (a == null) {
  8573.       return null;
  8574.     }
  8575.  
  8576.     return a.npcs.getNearest(new c(a, a));
  8577.   }
  8578.  
  8579.   private boolean cA()
  8580.   {
  8581.     int i1 = 0;
  8582.     RSObject[] arrayOfRSObject;
  8583.     int i4;
  8584.     Object localObject;
  8585.     if ((a.FA != null) && (a.nD != null))
  8586.     {
  8587.       i3 = (arrayOfRSObject = a.objects.getAll()).length; localObject = arrayOfRSObject[i4];
  8588.  
  8589.       if ((a.l(((RSObject)localObject).getID(), a.XE)) && (a.calc.distanceBetween(((RSObject)localObject).getLocation(), a.nD) < 3.0D)) if (!a.FA.contains(new RSTile[] { ((RSObject)localObject).getLocation() }))
  8590.         {
  8591.           i1 = 1;
  8592.  
  8593.           break label115;
  8594.         }
  8595.       i4++;
  8596.     }
  8597.     label115: if ((i1 == 0) && (a.Nc.size() > 0))
  8598.     {
  8599.       return false;
  8600.     }
  8601.     if (a.game.getClientState() == 11)
  8602.     {
  8603.       a.sleep(200, 300);
  8604.  
  8605.       a.sleep(300);
  8606.     }
  8607.  
  8608.     a.sleep(400);
  8609.  
  8610.     int i3 = (arrayOfRSObject = a.objects.getAll(a.cC)).length;
  8611.  
  8612.     RSTile localRSTile =
  8613.       (localObject = arrayOfRSObject[i4]).getLocation();
  8614.  
  8615.     if (!a.Ee.contains(localRSTile))
  8616.     {
  8617.       if (((RSObject)localObject).getType() == RSObject.Type.BOUNDARY)
  8618.       {
  8619.         a.Tc.add(localRSTile);
  8620.       }
  8621.       a.AG.add(localRSTile);
  8622.  
  8623.       a.zc.add(localObject);
  8624.     }
  8625.  
  8626.     i4++;
  8627.  
  8628.     if (a.AG.size() > 60)
  8629.     {
  8630.       int i2 = 20000; i3 = 20000;
  8631.  
  8632.       for (Iterator localIterator = a.AG.iterator(); localIterator.hasNext(); )
  8633.       {
  8634.         if (((localObject = (RSTile)localIterator.next())
  8635.           .getX() <= i2) && (((RSTile)localObject).getY() <= i3))
  8636.         {
  8637.           i2 = ((RSTile)localObject).getX();
  8638.  
  8639.           i3 = ((RSTile)localObject).getY();
  8640.         }
  8641.       }
  8642.       a.ZA = new RSArea(i2, i3, i2 + 15, i3 + 15);
  8643.  
  8644.       a.Nc.add(a.ZA);
  8645.  
  8646.       a.a.clear();
  8647.  
  8648.       if ((a.A(new int[] { 17363 })) && (a.EB.contains(Integer.valueOf(17363)))) {
  8649.         a.EB.remove(Integer.valueOf(17363));
  8650.       }
  8651.  
  8652.       a.l(a.ZA);
  8653.  
  8654.       a.Ee.addAll(a.AG);
  8655.  
  8656.       a.Wb = 0;
  8657.  
  8658.       a.BD = 0;
  8659.  
  8660.       a.hA.reset();
  8661.  
  8662.       a.lc = null;
  8663.  
  8664.       return true;
  8665.     }
  8666.     return false;
  8667.   }
  8668.  
  8669.   private boolean MA()
  8670.   {
  8671.     int[] arrayOfInt = a.l(a.EB);
  8672.  
  8673.     int i1 = a.mouse.getSpeed();
  8674.  
  8675.     a.mouse.setSpeed(i1 + a.random(1, 4));
  8676.  
  8677.     if (a.Zc())
  8678.       return false;
  8679.     int i2;
  8680.     int i3;
  8681.     int i4;
  8682.     if ((
  8683.       (i4 = a.inventory.getItems()[(i2 + i3 * 4)].getID()) > 0) && (!a.l(i4, arrayOfInt)))
  8684.     {
  8685.       a.inventory.dropItem(i2, i3);
  8686.     }
  8687.  
  8688.     i3++;
  8689.  
  8690.     i2++;
  8691.  
  8692.     a.sleep(a.random(500, 800));
  8693.  
  8694.     a.mouse.setSpeed(i1);
  8695.  
  8696.     return true;
  8697.   }
  8698.  
  8699.   private int hA()
  8700.   {
  8701.     RSNPC localRSNPC = null;
  8702.  
  8703.     u localu = new u(a);
  8704.  
  8705.     if (a.jA())
  8706.     {
  8707.       return 2;
  8708.     }
  8709.  
  8710.     if (!a.j())
  8711.       return -1;
  8712.     int i1;
  8713.     if (localRSNPC == null)
  8714.     {
  8715.       localRSNPC = a.npcs.getNearest(localu);
  8716.     }
  8717.     else if (a.walking.getEnergy() < a.random(15, 25))
  8718.     {
  8719.       a.walking.rest(a.random(50, 80));
  8720.     }
  8721.     else if (a.F(localRSNPC, "Catch"))
  8722.     {
  8723.       a.sleep(600, 800);
  8724.  
  8725.       if ((i1 = 0) < 15)
  8726.       {
  8727.         a.sleep(250, 300);
  8728.  
  8729.         i1++;
  8730.       }
  8731.  
  8732.     }
  8733.  
  8734.     a.sleep(100, 200);
  8735.  
  8736.     return 1;
  8737.   }
  8738.  
  8739.   private void LA()
  8740.   {
  8741.     RSNPC localRSNPC1 = a.D(new int[] { 10058 });
  8742.  
  8743.     RSNPC localRSNPC2 = a.i(new String[] { "Geomancer" });
  8744.  
  8745.     RSNPC localRSNPC3 = a.i(new String[] { "Ihlakhizan" });
  8746.  
  8747.     RSNPC localRSNPC4 = a.i(new String[] { "Pummeller" });
  8748.  
  8749.     a.l(a.UC, 50, 70);
  8750.     int i1;
  8751.     Object localObject1;
  8752.     Object localObject2;
  8753.     if ((a.tc.equals("Skeletal Hoarde")) || (localRSNPC1 != null))
  8754.     {
  8755.       i1 = 0;
  8756.  
  8757.       localObject1 = null;
  8758.  
  8759.       a.Qc = "Killing the Skeletal Hoarde!";
  8760.  
  8761.       if (a.tc.isEmpty())
  8762.       {
  8763.         a.log(a.Qc);
  8764.  
  8765.         a.tc = "Skeletal Hoarde";
  8766.       }
  8767.       a.A(a.HC != 1);
  8768.  
  8769.       a.l(false, Combat.Prayer.PROTECT_FROM_MISSILES, true);
  8770.  
  8771.       a.PD = a.Gd;
  8772.  
  8773.       a.F();
  8774.  
  8775.       a.game.openTab(4);
  8776.  
  8777.       if (a.jA()) {
  8778.         return;
  8779.       }
  8780.  
  8781.       if (localRSNPC1 != null)
  8782.       {
  8783.         if ((
  8784.           (localObject2 = localRSNPC1.getMessage()) != null) && (!((String)localObject2).contains("Chat later")))
  8785.         {
  8786.           i1 = 1;
  8787.         }
  8788.  
  8789.         localObject1 = a.J(new String[] { "Tunnel" });
  8790.  
  8791.         if (i1 != 0)
  8792.         {
  8793.           a.AB = "Blocking the next tunnel!";
  8794.  
  8795.           if (localObject1 != null)
  8796.           {
  8797.             a.vE = ((RSObject)localObject1).getLocation();
  8798.  
  8799.             a.SE = "";
  8800.  
  8801.             a.l((RSObject)localObject1, "Block");
  8802.  
  8803.             a.l(false);
  8804.  
  8805.             if (localObject1 != null)
  8806.             {
  8807.               if (a.jA()) {
  8808.                 return;
  8809.               }
  8810.  
  8811.               if (!a.SE.contains("fully powered"))
  8812.               {
  8813.                 if (a.calc.distanceTo(a.vE) > 4)
  8814.                 {
  8815.                   a.A(a.vE, 1);
  8816.                 }
  8817.  
  8818.                 if (a.l((RSObject)localObject1, "Block"))
  8819.                   a.sleep(500, 1000);
  8820.                 a.l(a.UC, 20, 20);
  8821.  
  8822.                 localObject1 = a.G(a.vE);
  8823.  
  8824.                 a.sleep(50, 100);
  8825.               }
  8826.             }
  8827.             a.AB = "";
  8828.  
  8829.             if (!a.SE.contains("fully powered"))
  8830.             {
  8831.               if (a.DD < 5) {
  8832.                 a.DD += 1;
  8833.               }
  8834.  
  8835.               a.Qc = ("Skeletal Hoarde: " + a.DD + " of 5 blocked");
  8836.             }
  8837.             a.SE = "";
  8838.  
  8839.             a.vE = null;
  8840.  
  8841.             if (a.combat.getHealth() > 40) {
  8842.               a.F(a.npcs.getNearest(a.B), "Attack");
  8843.             }
  8844.  
  8845.             i1 = 0;
  8846.           }
  8847.         }
  8848.         if ((localObject1 == null) && (a.npcs.getNearest(a.B) == null))
  8849.         {
  8850.           a.F(localRSNPC1, "Talk-To");
  8851.  
  8852.           a.sleep(700, 1100);
  8853.         }
  8854.         else if (a.combat.getHealth() < 30 + a.npcs.getAll(a.B).length * 3 + a.Zc + a.calc.distanceTo(localRSNPC1) / 3)
  8855.         {
  8856.           a.vE = localRSNPC1.getLocation();
  8857.  
  8858.           if (a.combat.getHealth() < 95)
  8859.           {
  8860.             if (a.jA())
  8861.               return;
  8862.             if (((localObject2 = localRSNPC1.getMessage()) != null) &&
  8863.               (!((String)localObject2).contains("Chat later")))
  8864.             {
  8865.               i1 = 1;
  8866.             }
  8867.             a.jA = a.npcs.getNearest(a.B);
  8868.  
  8869.             a.l(a.UC, 20, 20);
  8870.  
  8871.             if ((a.calc.distanceTo(localRSNPC1) > 3) || (a.X().equals(a.vE))) {
  8872.               a.F(a.vE, 2);
  8873.             }
  8874.             else if ((a.jA != null) && (a.calc.distanceBetween(a.vE, a.jA.getLocation()) < 5.0D)) {
  8875.               a.i(a.jA);
  8876.             }
  8877.  
  8878.             a.sleep(300, 600);
  8879.           }
  8880.           a.sleep(1400, 1800);
  8881.  
  8882.           a.vE = null;
  8883.         }
  8884.  
  8885.       }
  8886.  
  8887.       a.i(a.npcs.getNearest(a.B));
  8888.  
  8889.       a.l(a.UC, 20, 20);
  8890.     }
  8891.     else
  8892.     {
  8893.       if ((a.tc.equals("Hobgoblin Geomancer")) || (localRSNPC2 != null))
  8894.       {
  8895.         a.Qc = "Killing the Hobgoblin Geomancer!";
  8896.  
  8897.         if (a.tc.isEmpty())
  8898.         {
  8899.           a.log(a.Qc);
  8900.  
  8901.           a.tc = "Hobgoblin Geomancer";
  8902.         }
  8903.  
  8904.         a.l(a.QC, null, false);
  8905.  
  8906.         a.PD = a.xb;
  8907.       }
  8908.       while (a.objects.getNearest(a.gb) == null)
  8909.       {
  8910.         if (a.jA()) {
  8911.           return;
  8912.         }
  8913.  
  8914.         a.i(localRSNPC2);
  8915.  
  8916.         if (a.MC)
  8917.         {
  8918.           a.JC();
  8919.  
  8920.           if (!a.JC()) {
  8921.             a.sleep(1000, 2000);
  8922.           }
  8923.  
  8924.           a.sleep(1000, 2000);
  8925.  
  8926.           a.MC = false;
  8927.         }
  8928.  
  8929.         a.l(a.UC, 50, 60);
  8930.  
  8931.         a.sleep(200, 300); continue;
  8932.  
  8933.         if (!a.tc.equals("Bulwark Beast")) { if (a.i(new String[] { "Bulwark beast" }) == null);
  8934.         }
  8935.         else
  8936.         {
  8937.           i1 = 0;
  8938.  
  8939.           a.Qc = "Killing the Bulwark Beast!";
  8940.  
  8941.           if (a.tc.isEmpty())
  8942.           {
  8943.             a.log(a.Qc);
  8944.  
  8945.             a.tc = "Bulwark Beast";
  8946.           }
  8947.           localObject1 = a.i(new String[] { "Bulwark beast" });
  8948.  
  8949.           if (a.Ob < 1)
  8950.           {
  8951.             a.Ob = ((RSNPC)localObject1).getID();
  8952.           }
  8953.           a.l(false, Combat.Prayer.PROTECT_FROM_MAGIC, true);
  8954.  
  8955.           a.PD = (a.bC != -1 ? a.bC : a.Gd);
  8956.  
  8957.           if (a.jA())
  8958.           {
  8959.             return;
  8960.           }
  8961.           if ((
  8962.             (localObject1 = a.i(new String[] { "Bulwark beast" })) != null) && (a.HC != 3))
  8963.           {
  8964.             localObject2 = a.inventory.getItem(new int[] { a.Vc });
  8965.  
  8966.             if (((RSNPC)localObject1).getID() == a.Ob)
  8967.             {
  8968.               RSItem localRSItem = a.inventory.getItem(new int[] { 16295 });
  8969.  
  8970.               if ((i1 == 0) && (localRSItem == null))
  8971.               {
  8972.                 if (a.equipment.containsAll(new int[] { 16295 }))
  8973.                 {
  8974.                   i1 = 1;
  8975.                 }
  8976.                 else
  8977.                 {
  8978.                   a.AB = "Grabbing a pickaxe to mine his armor";
  8979.  
  8980.                   a.A(false);
  8981.                   RSObject localRSObject2;
  8982.                   if (
  8983.                     (localRSObject2 = a.objects.getNearest(new int[] { 49295 })) != null)
  8984.                   {
  8985.                     a.l(localRSObject2, "Take-pickaxe");
  8986.  
  8987.                     a.sleep(500, 800);
  8988.                   }
  8989.  
  8990.                   a.AB = "";
  8991.                 }
  8992.               }
  8993.               if ((localRSItem != null) && (localObject2 == null))
  8994.               {
  8995.                 if ((a.l(16295, "")) || (a.inventory.contains(a.Vc)))
  8996.                 {
  8997.                   i1 = 1;
  8998.                 }
  8999.               }
  9000.             }
  9001.             else if ((localObject2 != null) && (((RSItem)localObject2).doClick(true)))
  9002.             {
  9003.               a.sleep(700, 900);
  9004.             }
  9005.  
  9006.           }
  9007.  
  9008.           if (a.i((RSNPC)localObject1))
  9009.             a.A(true);
  9010.           a.l(a.UC, 50, 60);
  9011.  
  9012.           a.sleep(200, 300);
  9013.  
  9014.           break; } if (!a.tc.equals("Unholy Cursebearer")) { if (a.i(new String[] { "cursebearer" }) == null);
  9015.         }
  9016.         else
  9017.         {
  9018.           a.Qc = "Killing the Unholy Cursebearer!";
  9019.  
  9020.           if (a.tc.isEmpty())
  9021.           {
  9022.             a.log(a.Qc);
  9023.  
  9024.             a.tc = "Unholy Cursebearer";
  9025.           }
  9026.  
  9027.           a.l(a.QC, Combat.Prayer.PROTECT_FROM_MELEE, true);
  9028.  
  9029.           a.PD = a.Gd;
  9030.  
  9031.           if (a.h())
  9032.           {
  9033.             break;
  9034.           }
  9035.  
  9036.           return;
  9037.         }
  9038.         RSObject localRSObject1;
  9039.         if (!a.tc.equals("Shadow-Forger Ihlakhizan")) { if (a.i(new String[] { "Ihlakhizan" }) == null);
  9040.         }
  9041.         else
  9042.         {
  9043.           a.Qc = "Killing Shadow-Forger Ihlakhizan!";
  9044.  
  9045.           if (a.tc.isEmpty())
  9046.           {
  9047.             a.log(a.Qc);
  9048.  
  9049.             a.tc = "Shadow-Forger Ihlakhizan";
  9050.           }
  9051.  
  9052.           a.l(a.QC, null, false);
  9053.  
  9054.           a.PD = a.bC;
  9055.  
  9056.           while (a.objects.getNearest(a.gb) == null)
  9057.           {
  9058.             if (a.jA())
  9059.               return;
  9060.             if ((a.vE == null) || (a.calc.distanceTo(a.vE) > 3))
  9061.             {
  9062.               localRSObject1 = a.i(new int[] { 51110 }); localObject1 = a.i(new int[] { 50749 });
  9063.  
  9064.               if ((localRSObject1 != null) && (localObject1 != null))
  9065.               {
  9066.                 int i2 = localRSObject1.getLocation().getX();
  9067.  
  9068.                 int i3 = localRSObject1.getLocation().getY();
  9069.  
  9070.                 int i4 = ((RSObject)localObject1).getLocation().getX();
  9071.  
  9072.                 int i5 = ((RSObject)localObject1).getLocation().getY();
  9073.  
  9074.                 a.vE = new RSTile(i2 + (i4 - i2) / 4, i3 + (i5 - i3) / 4);
  9075.               }
  9076.  
  9077.             }
  9078.  
  9079.             a.A(a.vE, a.random(0, 2));
  9080.             do {
  9081.               a.sleep(300, 500);
  9082.             }
  9083.  
  9084.             while ((a.calc.distanceTo(a.vE) <= 1) || (!a.A(a.vE, a.random(0, 2))));
  9085.  
  9086.             a.sleep(600, 800);
  9087.  
  9088.             a.F(localRSNPC3, "Attack");
  9089.  
  9090.             a.i(localRSNPC3);
  9091.  
  9092.             if (a.l(a.UC, 50, 0))
  9093.               continue;
  9094.             a.sleep(200, 300);
  9095.           }
  9096.  
  9097.         }
  9098.  
  9099.         if (!a.tc.equals("Bal'lak the Pummeller")) { if (a.i(new String[] { "Pummeller" }) == null);
  9100.         }
  9101.         else
  9102.         {
  9103.           a.Qc = "Killing Bal'lak the Pummeller!";
  9104.  
  9105.           if (a.tc.isEmpty())
  9106.           {
  9107.             a.log(a.Qc);
  9108.  
  9109.             a.tc = "Bal'lak the Pummeller";
  9110.           }
  9111.  
  9112.           a.l(a.QC, null, false);
  9113.  
  9114.           a.PD = (a.bC != -1 ? a.bC : a.xb);
  9115.  
  9116.           while (a.objects.getNearest(a.gb) == null)
  9117.           {
  9118.             if (a.jA())
  9119.             {
  9120.               return;
  9121.             }
  9122.             if (localRSNPC4 != null)
  9123.             {
  9124.               if ((
  9125.                 (localRSObject1 = a.i(new int[] { 49298 })) != null) && (a.calc.distanceTo(localRSObject1) < 3))
  9126.               {
  9127.                 if (!a.Y().isMoving())
  9128.                   a.l(localRSNPC4.getLocation(), 1);
  9129.               }
  9130.               else if (a.interfaces.getComponent(945, 17).getRelativeX() < 100)
  9131.               {
  9132.                 a.l(a.lG, 50, 60);
  9133.               }
  9134.  
  9135.               a.i(localRSNPC4);
  9136.             }
  9137.             a.sleep(100, 200);
  9138.           }
  9139.         }
  9140.         a.Qc = "Killing an unknown boss...";
  9141.  
  9142.         a.log(a.Qc);
  9143.  
  9144.         a.l(a.QC, null, false);
  9145.  
  9146.         if (a.h())
  9147.           break;
  9148.         return;
  9149.       }
  9150.  
  9151.     }
  9152.  
  9153.     a.Ke = true;
  9154.   }
  9155.  
  9156.   private boolean J(RSTile a, int[] a)
  9157.   {
  9158.     if ((a != null) && (!a.be.contains(a))) { if (a.r.contains(new RSTile[] { a }));
  9159.     }
  9160.     else
  9161.       return false;
  9162.     RSObject[] arrayOfRSObject;
  9163.     int i1 = (arrayOfRSObject = a.objects.getAllAt(a)).length;
  9164.     int i2;
  9165.     RSObject localRSObject = arrayOfRSObject[i2];
  9166.  
  9167.     if (a.l(localRSObject.getID(), a))
  9168.     {
  9169.       return false;
  9170.     }
  9171.     i2++;
  9172.  
  9173.     return !a.ue.contains(a);
  9174.   }
  9175.  
  9176.   private boolean l(RSArea a, ArrayList<RSTile> a)
  9177.   {
  9178.     if ((a != null) && (a != null)) {
  9179.       for (RSTile localRSTile : a)
  9180.       {
  9181.         if (a.contains(new RSTile[] { localRSTile })) {
  9182.           return true;
  9183.         }
  9184.  
  9185.       }
  9186.  
  9187.     }
  9188.  
  9189.     return false;
  9190.   }
  9191.  
  9192.   private RSNPC[] F(int[] a)
  9193.   {
  9194.     return a.npcs.getAll(new m(a, a));
  9195.   }
  9196.  
  9197.   private boolean fA()
  9198.   {
  9199.     RSObject localRSObject;
  9200.     if ((localRSObject = a.objects.getNearest(a.Hd)) != null)
  9201.     {
  9202.       if (a.jb.contains(new RSTile[] { a.X() }))
  9203.       {
  9204.         Object localObject = localRSObject.getLocation();
  9205.  
  9206.         if (a.calc.distanceTo((RSTile)localObject) < 3) {
  9207.           return a.l(localRSObject, "Enter");
  9208.         }
  9209.  
  9210.         double d1 = 0.0D;
  9211.         RSTile[] arrayOfRSTile;
  9212.         int i1 = (arrayOfRSTile = localRSObject.getArea().getTileArray()).length;
  9213.         int i2;
  9214.         RSTile localRSTile = arrayOfRSTile[i2];
  9215.         double d2;
  9216.         if (
  9217.           (d2 = a.calc.distanceBetween(a.jb.getCentralTile(), localRSTile)) > d1)
  9218.         {
  9219.           localObject = localRSTile;
  9220.  
  9221.           d1 = d2;
  9222.         }
  9223.  
  9224.         i2++;
  9225.  
  9226.         if (a.calc.distanceTo((RSTile)localObject) > 3)
  9227.         {
  9228.           if (a.Y().getAnimation() == -1) { if (a.jb.contains(new RSTile[] { a.X() }));
  9229.           }
  9230.           else
  9231.           {
  9232.             a.uA();
  9233.  
  9234.             return false;
  9235.           }
  9236.  
  9237.           if (!a.Y().isMoving())
  9238.           {
  9239.             a.i((RSTile)localObject, 1);
  9240.  
  9241.             if (a.calc.distanceTo((RSTile)localObject) > a.random(6, 8))
  9242.             {
  9243.               a.camera.turnToTile((RSTile)localObject, a.random(5, 15));
  9244.             }
  9245.             else {
  9246.               a.l(false);
  9247.             }
  9248.  
  9249.           }
  9250.  
  9251.         }
  9252.  
  9253.         a.sleep(100, 200);
  9254.  
  9255.         return a.A((RSTile)localObject, "Enter");
  9256.       }
  9257.  
  9258.     }
  9259.  
  9260.     return false;
  9261.   }
  9262.  
  9263.   private boolean GA()
  9264.   {
  9265.     return a.interfaces.get(942).isValid();
  9266.   }
  9267.  
  9268.   private boolean jA()
  9269.   {
  9270.     if (!a.bA())
  9271.     {
  9272.       a.KA = new Timer(0L);
  9273.     }
  9274.  
  9275.     a.V();
  9276.  
  9277.     if (!a.Od)
  9278.     {
  9279.       a.log("Shutting down iDungeon");
  9280.  
  9281.       return true;
  9282.     }
  9283.  
  9284.     if (a.game.getClientState() != 10)
  9285.     {
  9286.       if (a.game.getClientState() != 11)
  9287.       {
  9288.         a.log("Oops.. We got logged out somehow :S");
  9289.  
  9290.         if (a.interfaces.get(596).isValid())
  9291.         {
  9292.           a.log("Exited to main screen, ceding control to LoginBot.");
  9293.  
  9294.           return true;
  9295.         }
  9296.         if (a.l(a.interfaces.getComponent(906, 171), ""))
  9297.         {
  9298.           a.sleep(4000, 8000);
  9299.         }
  9300.         a.sleep(300, 600);
  9301.  
  9302.         if ((a.game.isLoggedIn()) && (a.zB))
  9303.         {
  9304.           if (a.Zc())
  9305.           {
  9306.             return true;
  9307.           }
  9308.           a.uA();
  9309.  
  9310.           a.sleep(100, 200);
  9311.  
  9312.           a.log("Logged back in, attempting to correct.");
  9313.  
  9314.           a.yd = a.groundItems.getNearest(new int[] { 18829 });
  9315.  
  9316.           RSTile localRSTile = a.yd != null ? a.yd.getLocation() : null;
  9317.  
  9318.           if (localRSTile != null)
  9319.           {
  9320.             if (a.Zc()) {
  9321.               return true;
  9322.             }
  9323.  
  9324.             if (!a.r.contains(new RSTile[] { a.X() })) {
  9325.               a.rb();
  9326.             }
  9327.             else
  9328.             {
  9329.               a.A(localRSTile, "Take");
  9330.             }
  9331.  
  9332.             a.sleep(400, 800);
  9333.  
  9334.             a.uA();
  9335.  
  9336.             if (a.nb != null) { if (a.nb.contains(new RSTile[] { a.X() }));
  9337.             }
  9338.             else
  9339.             {
  9340.               if ((!a.QB()) || (!a.ZA()))
  9341.               {
  9342.                 return false;
  9343.               }
  9344.               if (a.Rd != 1)
  9345.               {
  9346.                 a.QB = a.FA;
  9347.  
  9348.                 a.A(new int[] { 18829 });
  9349.  
  9350.                 a.G(false);
  9351.  
  9352.                 a.l(a.jb);
  9353.  
  9354.                 a.ZA();
  9355.  
  9356.                 a.l(a.QB);
  9357.  
  9358.                 a.n();
  9359.  
  9360.                 (a.Zc > 4 ? a.FA :
  9361.                   a.rb());
  9362.               }
  9363.             }
  9364.           }
  9365.         }
  9366.       }
  9367.       else
  9368.       {
  9369.         a.sleep(100, 1000);
  9370.       }
  9371.  
  9372.       return false;
  9373.     }
  9374.     if (a.CA())
  9375.       return true;
  9376.     if (a.zB)
  9377.     {
  9378.       int i1;
  9379.       if (a.AA())
  9380.       {
  9381.         if ((a.Qc.contains("locked")) && (a.Hc))
  9382.         {
  9383.           a.log("Posthumosly assigning the lockdown");
  9384.  
  9385.           a.J.add(a.nD);
  9386.  
  9387.           a.Hc = true;
  9388.         }
  9389.  
  9390.         a.Qc = "Oh dear...";
  9391.  
  9392.         a.AB = "";
  9393.  
  9394.         a.QB = (!a.r.equals(a.jb) ? a.r : null);
  9395.  
  9396.         a.sleep(300, 500);
  9397.  
  9398.         a.hA = new Timer(a.random(360000, 480000));
  9399.  
  9400.         a.log("Died, walking back..");
  9401.  
  9402.         a.vE = null;
  9403.  
  9404.         a.Pd += 1;
  9405.  
  9406.         a.nD = null;
  9407.  
  9408.         a.WA = null;
  9409.  
  9410.         a.yd = null;
  9411.  
  9412.         a.jA = null;
  9413.  
  9414.         a.qA = a.F(a.QB);
  9415.  
  9416.         a.Fg = true;
  9417.  
  9418.         a.jC = false;
  9419.  
  9420.         a.FF = false;
  9421.  
  9422.         a.X = false;
  9423.  
  9424.         a.hB = false;
  9425.  
  9426.         a.l(a.jb);
  9427.  
  9428.         if (a.nb != null)
  9429.         {
  9430.           if ((a.tc.equals("Bal'lak the Pummeller")) && (a.interfaces.get(945).isValid()))
  9431.           {
  9432.             a.AB = "Allowing his defense to degenerate";
  9433.  
  9434.             i1 = a.interfaces.getComponent(945, 17).getRelativeX() - 15;
  9435.  
  9436.             int i3 = a.ig.size();
  9437.  
  9438.             if ((a.Zc > 4) || (i3 < 1))
  9439.             {
  9440.               i3 = 1;
  9441.             }
  9442.             int i4 = 200 * i1 - i3 * 7000;
  9443.  
  9444.             if (i3 == 1) {
  9445.               i4 += a.random(2000, 3000);
  9446.             }
  9447.  
  9448.             if (i4 > 0) {
  9449.               a.sleep(i4, (int)(i4 * 1.1D));
  9450.             }
  9451.  
  9452.           }
  9453.  
  9454.         }
  9455.         else if (a.XF)
  9456.         {
  9457.           a.AB = "Waiting for mercenaries to disperse";
  9458.  
  9459.           a.sleep(7000, 11000);
  9460.         }
  9461.  
  9462.         a.AB = "";
  9463.  
  9464.         if (a.CA())
  9465.         {
  9466.           return true;
  9467.         }
  9468.         a.uA();
  9469.  
  9470.         a.sleep(200, 300);
  9471.  
  9472.         if ((a.VA) && ((a.nb != null) || (a.l.contains(a.QB))))
  9473.         {
  9474.           a.game.openTab(6);
  9475.         }
  9476.         a.F();
  9477.  
  9478.         a.game.openTab(4);
  9479.  
  9480.         if (a.HC == a.bb)
  9481.         {
  9482.           a.l(a.Vc, "Wield");
  9483.         }
  9484.         a.walking.setRun(true);
  9485.  
  9486.         return true;
  9487.       }
  9488.  
  9489.       if ((a.nb != null) && (a.HD != null)) if ((!a.nb.contains(new RSTile[] { a.X() })) && (a.HD.getElapsed() > a.random(1500000, 1800000)))
  9490.         {
  9491.           a.log.severe("Took too long to kill " + a.tc + ", trying a new dungeon.");
  9492.  
  9493.           if (a.UA)
  9494.           {
  9495.             a.env.saveScreenshot(false);
  9496.           }
  9497.  
  9498.           a.gd = true;
  9499.  
  9500.           a.Ic += 1;
  9501.  
  9502.           a.nc = true;
  9503.  
  9504.           return true;
  9505.         }
  9506.  
  9507.  
  9508.       if ((a.hd != null) && (!a.hd.isRunning()))
  9509.       {
  9510.         a.uC = "Timed out";
  9511.  
  9512.         return true;
  9513.       }
  9514.  
  9515.       if ((a.nb == null) && (a.hd == null) && (a.hA != null) && (!a.hA.isRunning()))
  9516.       {
  9517.         if (!a.gd)
  9518.         {
  9519.           a.log.severe("Took too long to complete this dungeon, trying a new one");
  9520.  
  9521.           if (a.UA)
  9522.           {
  9523.             a.env.saveScreenshot(false);
  9524.           }
  9525.  
  9526.           a.gd = true;
  9527.  
  9528.           a.Ic += 1;
  9529.         }
  9530.  
  9531.         a.nc = true;
  9532.  
  9533.         return true;
  9534.       }
  9535.  
  9536.       if ((a.lc != null) && (a.lc.getElapsed() > a.random(10000, 15000)))
  9537.       {
  9538.         if (a.lc.getElapsed() < a.random(45000, 90000))
  9539.         {
  9540.           if ((!a.Y().isMoving()) && (a.calc.distanceTo(a.nD) > 3))
  9541.           {
  9542.             a.F(a.nD);
  9543.           }
  9544.         }
  9545.         else
  9546.         {
  9547.           a.log.severe("Took too long to open this door");
  9548.  
  9549.           if (a.UA)
  9550.           {
  9551.             a.env.saveScreenshot(false);
  9552.           }
  9553.  
  9554.           a.lc = null;
  9555.  
  9556.           if (a.r.contains(new RSTile[] { a.X() }))
  9557.           {
  9558.             if (a.nD != null)
  9559.             {
  9560.               a.fG.add(a.nD);
  9561.  
  9562.               a.J.remove(a.nD);
  9563.  
  9564.               a.Bd.remove(a.nD);
  9565.             }
  9566.             if (a.WA != null)
  9567.             {
  9568.               a.fG.add(a.WA);
  9569.  
  9570.               a.J.remove(a.WA);
  9571.  
  9572.               a.Bd.remove(a.WA);
  9573.             }
  9574.  
  9575.           }
  9576.           else
  9577.           {
  9578.             a.uA();
  9579.  
  9580.             a.l(a.FA);
  9581.  
  9582.             if (a.nD != null)
  9583.             {
  9584.               a.J.remove(a.nD);
  9585.  
  9586.               a.Bd.remove(a.nD);
  9587.  
  9588.               a.w.add(a.nD);
  9589.             }
  9590.             if (a.WA != null)
  9591.             {
  9592.               a.J.remove(a.WA);
  9593.  
  9594.               a.Bd.remove(a.WA);
  9595.  
  9596.               a.w.add(a.WA);
  9597.             }
  9598.           }
  9599.           return true;
  9600.         }
  9601.  
  9602.       }
  9603.       else if ((a.KA != null) && (a.KA.getElapsed() > a.random(10000, 20000)))
  9604.       {
  9605.         if (a.KA.getElapsed() > a.random(90000, 180000))
  9606.         {
  9607.           a.AB = "Attempting to reengage...";
  9608.  
  9609.           a.log.severe("We've been standing still for too long, lets try to do something!");
  9610.  
  9611.           if (a.r != null)
  9612.             a.A(a.r.getCentralTile(), 1);
  9613.           if (a.hd != null)
  9614.           {
  9615.             i1 = (int)a.hd.getRemaining() - a.random(90000, 120000);
  9616.  
  9617.             a.hd.setEndIn(i1);
  9618.           }
  9619.           else if (a.hA != null)
  9620.           {
  9621.             int i2 = (int)a.hA.getRemaining() - a.random(90000, 120000);
  9622.  
  9623.             a.hA.setEndIn(i2);
  9624.           }
  9625.           a.KA = new Timer(0L);
  9626.  
  9627.           if (a.r != null)
  9628.           {
  9629.             a.uA();
  9630.  
  9631.             if (!a.r.contains(new RSTile[] { a.X() }))
  9632.             {
  9633.               a.l(a.FA);
  9634.  
  9635.               a.Fg = true;
  9636.             }
  9637.           }
  9638.         }
  9639.         else
  9640.         {
  9641.           a.camera.moveRandomly(2000);
  9642.         }
  9643.  
  9644.       }
  9645.       else if ((!a.walking.isRunEnabled()) && (a.walking.getEnergy() > a.random(10, 30)))
  9646.       {
  9647.         a.walking.setRun(true);
  9648.  
  9649.         a.sleep(500, 700);
  9650.       }
  9651.       else if (a.nA)
  9652.       {
  9653.         if (a.WC)
  9654.         {
  9655.           if (a.HC == 2)
  9656.           {
  9657.             a.log("Out of arrows! Re-equipping or wielding a backup weapon.");
  9658.  
  9659.             if (a.inventory.getCount(true, new int[] { a.cc }) > a.random(4, 10))
  9660.             {
  9661.               a.l(a.cc, "Wield");
  9662.             }
  9663.             else
  9664.             {
  9665.               if (a.kC)
  9666.               {
  9667.                 a.i(1);
  9668.               }
  9669.               else if (a.iD)
  9670.               {
  9671.                 a.i(3);
  9672.               }
  9673.               else
  9674.               {
  9675.                 a.nc = true;
  9676.  
  9677.                 return true;
  9678.               }a.Sd = false;
  9679.             }
  9680.           }
  9681.           else if (a.HC == 3)
  9682.           {
  9683.             a.log("Out of Runes! Wielding our backup weapon.");
  9684.  
  9685.             if (a.kC)
  9686.             {
  9687.               a.i(1);
  9688.             }
  9689.             else if (a.Sd)
  9690.             {
  9691.               a.i(2);
  9692.             }
  9693.             else
  9694.             {
  9695.               a.nc = true;
  9696.  
  9697.               return true;
  9698.             }
  9699.  
  9700.             a.iD = false;
  9701.           }
  9702.  
  9703.           a.WC = false;
  9704.         }
  9705.         if ((a.Qc.contains("Opening a")) && (a.nD != null) && (a.calc.distanceTo(a.nD) < 6))
  9706.         {
  9707.           return false;
  9708.         }
  9709.         if (a.Qc.contains("Backtracking")) if (a.r.contains(new RSTile[] { a.X() }))
  9710.           {
  9711.             return false;
  9712.           }
  9713.         if ((a.F()) || (a.F(false)) || (a.PA()) || (a.Hb())) {
  9714.           return false;
  9715.         }
  9716.  
  9717.         if (a.game.getCurrentTab() == 4)
  9718.         {
  9719.           if ((!a.ce.isEmpty()) && (a.l(a.inventory.getItemID(a.ce), "Bind"))) {
  9720.             a.ce = "";
  9721.           }
  9722.  
  9723.           a.D(false);
  9724.         }
  9725.         if ((a.Rd == 1) && (a.interfaces.get(79).isValid()))
  9726.           a.l(a.interfaces.getComponent(79, 7), "Close");
  9727.         return a.rb();
  9728.       }
  9729.  
  9730.     }
  9731.  
  9732.     return false;
  9733.   }
  9734.  
  9735.   private boolean mA()
  9736.   {
  9737.     this.Od = true;
  9738.     JA();
  9739.     log("Cracked by Contra. Visit RECoders.org for free cracks and more!");
  9740.     return true;
  9741.   }
  9742.  
  9743.   private void l(RSArea a)
  9744.   {
  9745.     if ((a != null) && ((a.r == null) || (!a.r.equals(a))))
  9746.     {
  9747.       a.r = a;
  9748.  
  9749.       a.Tc.addAll(a.ue);
  9750.  
  9751.       a.ue.clear();
  9752.  
  9753.       for (RSTile localRSTile : a.Tc)
  9754.         if (a.r.contains(new RSTile[] { localRSTile }))
  9755.         {
  9756.           a.ue.add(localRSTile);
  9757.         }
  9758.       a.Tc.removeAll(a.ue);
  9759.  
  9760.       a.f();
  9761.     }
  9762.   }
  9763.  
  9764.   private boolean AA()
  9765.   {
  9766.     return (a.jC) || (a.Y().getAnimation() == 836);
  9767.   }
  9768.  
  9769.   private RSTile[] J(RSTile a)
  9770.   {
  9771.     int i1 = a.getX(); int i2 = a.getY();
  9772.  
  9773.     return new RSTile[] { new RSTile(i1 + 1, i2 + 1), new RSTile(i1 - 1, i2 + 1), new RSTile(i1 - 1, i2 - 1), new RSTile(i1 + 1, i2 - 1) };
  9774.   }
  9775.  
  9776.   private void aA()
  9777.   {
  9778.     a.Qc = "Exiting dungeon...";
  9779.  
  9780.     a.game.openTab(4);
  9781.  
  9782.     a.nc = true;
  9783.  
  9784.     if ((!a.Od) || (!a.game.isLoggedIn()))
  9785.       return;
  9786.     a.V();
  9787.  
  9788.     if (a.Y().isInCombat())
  9789.     {
  9790.       a.uA();
  9791.  
  9792.       a.l(a.FA);
  9793.  
  9794.       if ((a.npcs.getNearest(a.B) != null) || (a.npcs.getNearest(a.Fd) != null)) {
  9795.         a.K();
  9796.       }
  9797.  
  9798.     }
  9799.     else if ((a.game.getCurrentTab() == 4) || (a.game.getCurrentTab() == 5))
  9800.     {
  9801.       if (a.equipment.containsOneOf(a.DB))
  9802.       {
  9803.         if (a.equipment.getItem(35).doAction("Open party interface"))
  9804.         {
  9805.           int i1;
  9806.           if ((i1 = 0) < 10)
  9807.           {
  9808.             a.sleep(100, 200);
  9809.  
  9810.             i1++;
  9811.           }
  9812.           if (a.game.getCurrentTab() == 5)
  9813.           {
  9814.             a.mouse.moveRandomly(200);
  9815.           }
  9816.  
  9817.         }
  9818.         else
  9819.         {
  9820.           a.mouse.moveRandomly(50);
  9821.         }
  9822.       }
  9823.       else if (a.inventory.containsOneOf(a.DB))
  9824.       {
  9825.         a.inventory.getItem(a.DB).doAction("Open party interface");
  9826.       }
  9827.       a.sleep(600, 800);
  9828.     }
  9829.     else if (a.interfaces.get(236).isValid())
  9830.     {
  9831.       a.interfaces.getComponent(236, 1).doAction("Continue");
  9832.     }
  9833.     else if (a.interfaces.get(211).isValid())
  9834.     {
  9835.       a.interfaces.getComponent(211, 3).doAction("Continue");
  9836.     }
  9837.     else if (a.interfaces.getComponent(939, 34).isValid())
  9838.     {
  9839.       a.interfaces.getComponent(939, 34).doAction("Leave-party");
  9840.     }
  9841.     a.sleep(1100, 1500);
  9842.  
  9843.     a.T();
  9844.  
  9845.     a.ud = "Outside";
  9846.  
  9847.     a.zB = false;
  9848.   }
  9849.  
  9850.   private boolean i(RSTile a)
  9851.   {
  9852.     if ((a == null) || (a.FA == null))
  9853.     {
  9854.       return false;
  9855.     }
  9856.  
  9857.     int i1 = a.getX(); int i2 = a.getY(); int i3 = a.FA.getX(); int i4 = a.FA.getY(); int i5 = i3 + 15; int i6 = i4 + 15;
  9858.  
  9859.     return (Math.abs(i1 - i3) == 1) || (Math.abs(i1 - i5) == 1) || (Math.abs(i2 - i4) == 1) || (Math.abs(i2 - i6) == 1);
  9860.   }
  9861.  
  9862.   private boolean F(RSObject a, String a)
  9863.   {
  9864.     if (a == null)
  9865.       return false;
  9866.     RSModel localRSModel;
  9867.     return (localRSModel = a.getModel()) != null
  9868.        ? a.l(localRSModel, a) : a.A(a.getLocation(), a);
  9869.   }
  9870.  
  9871.   public void mouseDragged(MouseEvent a)
  9872.   {
  9873.   }
  9874.  
  9875.   private void JA()
  9876.   {
  9877.     new i(a).start();
  9878.   }
  9879.  
  9880.   private int dA()
  9881.   {
  9882.     int[] arrayOfInt1 = { 52046 };
  9883.  
  9884.     int[] arrayOfInt2 = { 50663, 51762, 53750 };
  9885.  
  9886.     RSObject localRSObject1 = a.J(new String[] { "Spinning blades" });
  9887.  
  9888.     RSTile localRSTile1 = a.tA();
  9889.  
  9890.     if (localRSObject1 == null)
  9891.     {
  9892.       return -1;
  9893.     }
  9894.     RSTile localRSTile2 = a.F(localRSObject1.getLocation(), arrayOfInt2);
  9895.  
  9896.     RSTile localRSTile3 = a.F(localRSTile1, a.lC); RSTile localRSTile4 = a.F(a.nD, a.lC);
  9897.  
  9898.     if ((localRSTile3 == null) || (localRSTile4 == null)) {
  9899.       return -1;
  9900.     }
  9901.  
  9902.     if ((!a.l(localRSTile3, true)) || (!a.l(localRSTile4, true)))
  9903.     {
  9904.       if (a.jA()) {
  9905.         return 2;
  9906.       }
  9907.  
  9908.       if (!a.j())
  9909.         return -1;
  9910.       RSObject localRSObject2 = a.J(new String[] { "Pendulum" });
  9911.  
  9912.       RSObject localRSObject3 = a.i(a.kg);
  9913.  
  9914.       a.l(a.vc, 40, 50);
  9915.  
  9916.       a.jA = a.npcs.getNearest(a.B);
  9917.  
  9918.       a.yd = a.l(a.Zd);
  9919.  
  9920.       if ((a.jA != null) && (a.l(a.jA.getLocation(), false)))
  9921.       {
  9922.         a.F(a.jA);
  9923.       }
  9924.       else if ((a.yd != null) && (a.l(a.yd.getLocation(), false)))
  9925.       {
  9926.         a.l(a.yd);
  9927.       }
  9928.       else if (a.F(localRSObject2))
  9929.       {
  9930.         a.A(localRSObject2.getLocation(), 1);
  9931.       }
  9932.       else if ((localRSObject2 != null) && (a.calc.distanceTo(a.nD) < 4))
  9933.       {
  9934.         a.A(localRSObject2.getLocation(), 1);
  9935.       }
  9936.       else if (a.F(a.J(new String[] { "Spinning blades" })))
  9937.       {
  9938.         if (a.calc.distanceTo(localRSTile2) > 1)
  9939.         {
  9940.           if (!a.i(a.X()))
  9941.           {
  9942.             RSObject localRSObject4 = a.i(arrayOfInt2);
  9943.  
  9944.             a.A(localRSObject4 != null ? localRSObject4.getLocation() : a.X(), localRSObject4 != null ? 1 : 3);
  9945.           }
  9946.           else
  9947.           {
  9948.             a.A(localRSTile2, 1);
  9949.           }
  9950.         }
  9951.         else if (localRSObject2 != null) {
  9952.           a.l(localRSObject2.getLocation(), 1);
  9953.         }
  9954.  
  9955.       }
  9956.       else if (a.F(localRSObject3))
  9957.       {
  9958.         a.A(localRSObject3.getLocation(), 1);
  9959.  
  9960.         a.K(true);
  9961.       }
  9962.       else if (a.l(localRSTile1, true))
  9963.       {
  9964.         a.l(a.i(a.bB), "Step-onto");
  9965.       }
  9966.  
  9967.       a.K(false);
  9968.     }
  9969.     if (a.jA())
  9970.       return 2;
  9971.     if (a.l(a.i(a.lC), "Open"))
  9972.     {
  9973.       a.K(true);
  9974.     }
  9975.  
  9976.     a.sleep(200, 400);
  9977.  
  9978.     return 1;
  9979.   }
  9980.  
  9981.   private boolean l(String a, RSObject a)
  9982.   {
  9983.     int i1;
  9984.     if ((
  9985.       (i1 = a.inventory.getItemID(a)) > 0) && (a != null))
  9986.     {
  9987.       String str = a.A(a);
  9988.  
  9989.       RSTile localRSTile = a.getLocation();
  9990.  
  9991.       if (a.calc.distanceTo(localRSTile) > 4)
  9992.       {
  9993.         a.l(localRSTile, 1);
  9994.       }
  9995.       if (a.F(i1))
  9996.       {
  9997.         if (str.isEmpty())
  9998.         {
  9999.           a.camera.turnToTile(localRSTile, a.random(5, 15));
  10000.         }
  10001.         a.sleep(200, 400);
  10002.  
  10003.         return a.doAction("Use " + a + " -> " + str);
  10004.       }
  10005.     }
  10006.     return false;
  10007.   }
  10008.  
  10009.   public void onFinish()
  10010.   {
  10011.     a.Od = false;
  10012.  
  10013.     a.iA = false;
  10014.  
  10015.     a.M = true;
  10016.  
  10017.     if ((a.pC > 1) && (a.FD))
  10018.     {
  10019.       a.FD = false;
  10020.  
  10021.       a.log("Thanks for using iDungeon Pro v1.07");
  10022.  
  10023.       a.env.saveScreenshot(true);
  10024.  
  10025.       a.log("We completed " + a.pC + " dungeons for " + a.Td + " tokens!");
  10026.     }
  10027.   }
  10028.  
  10029.   public void mouseEntered(MouseEvent a)
  10030.   {
  10031.   }
  10032.  
  10033.   private RSObject l(RSObject a, int[] a)
  10034.   {
  10035.     double d1 = 99.989999999999995D;
  10036.  
  10037.     Object localObject = null;
  10038.     int i2;
  10039.     if (a != null)
  10040.     {
  10041.       RSObject[] arrayOfRSObject;
  10042.       int i1 = (arrayOfRSObject = a.J(a)).length;
  10043.       RSObject localRSObject;
  10044.       double d2;
  10045.       if ((!
  10046.         (localRSObject = arrayOfRSObject[i2]).equals(a)) && (
  10047.         (d2 = a.calc.distanceBetween(a.X(), localRSObject.getLocation())) < d1))
  10048.       {
  10049.         d1 = d2;
  10050.  
  10051.         localObject = localRSObject;
  10052.       }
  10053.  
  10054.       i2++;
  10055.     }
  10056.     return localObject;
  10057.   }
  10058.  
  10059.   private int kA()
  10060.   {
  10061.     int i1;
  10062.     if (a.interfaces.get(950).isValid())
  10063.     {
  10064.       Point localPoint;
  10065.       if (((localPoint = a.interfaces.getComponent(950, 67).getCenter()).x >
  10066.         560) || (localPoint.y > 220))
  10067.       {
  10068.         RSComponent localRSComponent;
  10069.         if ((
  10070.           (localRSComponent = a.interfaces.getComponent(950, i1)).isValid()) && (localRSComponent.getArea().contains(localPoint)))
  10071.         {
  10072.           return i1;
  10073.         }
  10074.         i1++;
  10075.       }
  10076.  
  10077.     }
  10078.  
  10079.     return -1;
  10080.   }
  10081.  
  10082.   private boolean bA()
  10083.   {
  10084.     RSPlayer localRSPlayer;
  10085.     return ((localRSPlayer = a.Y()) != null) &&
  10086.       (!localRSPlayer.isMoving()) && (localRSPlayer.getAnimation() == -1);
  10087.   }
  10088.  
  10089.   private int eA()
  10090.   {
  10091.     if (!a.O())
  10092.     {
  10093.       return -1;
  10094.     }
  10095.  
  10096.     RSObject localRSObject1 = a.J(new String[] { "Unfinished bridge" });
  10097.  
  10098.     RSObject localRSObject2 = a.i(new int[] { 54021, 54022, 54023, 54024 });
  10099.  
  10100.     RSTile localRSTile = a.tA();
  10101.  
  10102.     if (a.hd == null)
  10103.     {
  10104.       a.hd = new Timer(a.random(480000, 600000));
  10105.     }
  10106.  
  10107.     if (a.jA())
  10108.       return 2;
  10109.     if (!a.j())
  10110.     {
  10111.       a.A(a.tA());
  10112.  
  10113.       return -1;
  10114.     }
  10115.  
  10116.     a.jA = a.npcs.getNearest(a.B);
  10117.  
  10118.     if ((a.jA != null) && (a.l(a.jA.getLocation(), false)))
  10119.     {
  10120.       if ((!a.QB()) || (!a.ZA())) {
  10121.         return 2;
  10122.       }
  10123.  
  10124.       a.hd = new Timer(a.random(240000, 300000));
  10125.     }
  10126.  
  10127.     if (a.l(localRSTile, true))
  10128.     {
  10129.       if (a.l(localRSObject1, "Jump"))
  10130.       {
  10131.         a.l(false);
  10132.  
  10133.         a.K(false);
  10134.       }
  10135.  
  10136.     }
  10137.     else
  10138.     {
  10139.       if (!a.kd)
  10140.       {
  10141.         a.lA.add(a.r);
  10142.  
  10143.         return 1;
  10144.       }
  10145.       if (a.inventory.getCount(new int[] { 19651 }) < 5)
  10146.       {
  10147.         if (a.l(localRSObject2, "Raid"))
  10148.         {
  10149.           a.K(false);
  10150.         }
  10151.       }
  10152.       else if (a.l(localRSObject1, "Repair"))
  10153.       {
  10154.         a.K(true);
  10155.       }
  10156.  
  10157.     }
  10158.  
  10159.     a.sleep(300, 500);
  10160.  
  10161.     return 1;
  10162.   }
  10163.  
  10164.   private boolean l(boolean a, int a, int a)
  10165.   {
  10166.     RSNPC localRSNPC;
  10167.     if (
  10168.       (localRSNPC = a.D(new int[] { 11226 })) != null)
  10169.     {
  10170.       a.SE = "";
  10171.  
  10172.       if (a.F(localRSNPC, "Trade"))
  10173.       {
  10174.         a.K(false);
  10175.       }
  10176.  
  10177.       a.sleep(600, 800);
  10178.       int i2;
  10179.       if ((!a) || ((!a.inventory.contains(19650)) && (!a.inventory.containsAll(a.jF))))
  10180.       {
  10181.         Object localObject1;
  10182.         Object localObject2;
  10183.         if (a)
  10184.         {
  10185.           i1 = (localObject1 = a.inventory.getItems(a.jF)).length;
  10186.  
  10187.           if ((localObject2 = localObject1[i2])
  10188.             .doAction("Sell 50"))
  10189.           {
  10190.             a.sleep(100, 300);
  10191.           }
  10192.           i2++;
  10193.         }
  10194.  
  10195.         int i1 = (localObject1 = a.inventory.getItems()).length;
  10196.         int i4;
  10197.         int i5;
  10198.         if ((i4 =
  10199.           (localObject2 = localObject1[i2]).getID()) >=
  10200.           1) if ((!a.l(i4, new int[] { 18201, 19650 })) && ((i4 == a) || (!a.l(i4, a.pb))))
  10201.           {
  10202.             if ((i5 = 0) < 3)
  10203.             {
  10204.               if (localObject2.doAction("Sell 50"))
  10205.               {
  10206.                 a.sleep(50, 300);
  10207.  
  10208.                 a.sleep(50, 300);
  10209.               }
  10210.               else
  10211.               {
  10212.                 i5++;
  10213.               }
  10214.  
  10215.             }
  10216.  
  10217.           }
  10218.  
  10219.  
  10220.         i2++;
  10221.  
  10222.         a.mouse.click(486, 270, 5, 10, true);
  10223.  
  10224.         a.sleep(400, 600);
  10225.  
  10226.         if ((localObject1 = a.interfaces.getComponent(956, 25))
  10227.           .isValid())
  10228.         {
  10229.           a.mouse.click(((RSComponent)localObject1).getComponent(3).getCenter().x, ((RSComponent)localObject1).getComponent(5).getAbsoluteY() - 15, 4, 10, true);
  10230.  
  10231.           a.sleep(200, 300);
  10232.         }
  10233.  
  10234.         a.sleep(250, 400);
  10235.  
  10236.         i1 = a.kd ? 200 : 100;
  10237.  
  10238.         if (!a)
  10239.           i1 -= 50;
  10240.         a.mouse.click(i1, 275, 10, 10, false);
  10241.         int i3;
  10242.         if ((i3 = 0) < 5)
  10243.         {
  10244.           a.sleep(80, 120);
  10245.  
  10246.           i3++;
  10247.         }
  10248.  
  10249.         a.l("Buy 1");
  10250.  
  10251.         i2++;
  10252.       }
  10253.  
  10254.       a.interfaces.getComponent(956, 18).doAction("Close");
  10255.  
  10256.       a.sleep(700, 1000);
  10257.     }
  10258.     return (a.inventory.contains(19650)) || (a.inventory.containsAll(a.jF));
  10259.   }
  10260.  
  10261.   private boolean iA()
  10262.   {
  10263.     if (a.Ud < 13) {
  10264.       return true;
  10265.     }
  10266.  
  10267.     RSComponent localRSComponent1 = a.interfaces.getComponent(947, 608 + a.OA);
  10268.  
  10269.     RSComponent localRSComponent2 = a.interfaces.getComponent(947, 47);
  10270.  
  10271.     if ((!localRSComponent1.isValid()) || (!localRSComponent2.isValid()))
  10272.     {
  10273.       return false;
  10274.     }
  10275.     if (localRSComponent2.getComponents().length != 6)
  10276.     {
  10277.       return true;
  10278.     }
  10279.     RSComponent localRSComponent3;
  10280.     if (
  10281.       (localRSComponent3 = localRSComponent1).getScrollableContentHeight() == 0);
  10282.     if (localRSComponent3.getScrollableContentHeight() == 0)
  10283.     {
  10284.       return false;
  10285.     }
  10286.     int i1 = localRSComponent3.getAbsoluteY();
  10287.  
  10288.     int i2 = localRSComponent3.getRealHeight();
  10289.  
  10290.     if ((localRSComponent1.getAbsoluteY() >= i1) && (localRSComponent1.getAbsoluteY() <= i1 + i2 - localRSComponent1.getRealHeight()))
  10291.     {
  10292.       return true;
  10293.     }
  10294.     RSComponent localRSComponent4 = localRSComponent2.getComponent(0);
  10295.  
  10296.     int i3 = localRSComponent3.getScrollableContentHeight();
  10297.     int i4;
  10298.     if ((i4 = (int)(localRSComponent4.getRealHeight() / i3 * (localRSComponent1.getRelativeY() + a.random(-i2 / 2, i2 / 2 - localRSComponent1.getRealHeight())))) < 0)
  10299.     {
  10300.       i4 = 0;
  10301.     }
  10302.     else if (i4 >= localRSComponent4.getRealHeight())
  10303.       i4 = localRSComponent4.getRealHeight() - 1;
  10304.     a.mouse.click(localRSComponent4.getAbsoluteX() + a.random(0, localRSComponent4.getRealWidth()), localRSComponent4.getAbsoluteY() + i4, true);
  10305.  
  10306.     a.sleep(100, 300);
  10307.  
  10308.     if (localRSComponent1.isValid())
  10309.     {
  10310.       a.l(localRSComponent2.getComponent(localRSComponent1.getAbsoluteY() < i1 ? 4 : 5), "");
  10311.  
  10312.       a.sleep(50, 200);
  10313.     }
  10314.  
  10315.     return (localRSComponent1.isValid()) && (localRSComponent1.getAbsoluteY() >= i1) && (localRSComponent1.getAbsoluteY() <= i1 + i2 - localRSComponent1.getRealHeight());
  10316.   }
  10317.  
  10318.   private int FA()
  10319.   {
  10320.     String str = "";
  10321.  
  10322.     if (!a.O())
  10323.     {
  10324.       return -1;
  10325.     }
  10326.     int i1 = 0; int i2 = 0;
  10327.  
  10328.     RSNPC localRSNPC = a.i(new String[] { "hoardstalker" });
  10329.  
  10330.     if (!a.KD)
  10331.     {
  10332.       if (a.jA())
  10333.       {
  10334.         return 2;
  10335.       }
  10336.       if (!a.j())
  10337.       {
  10338.         return -1;
  10339.       }
  10340.       RSObject localRSObject = a.i(new int[] { 49600, 49601, 49602 });
  10341.       Object localObject2;
  10342.       if (i1 < 1)
  10343.       {
  10344.         RSComponent localRSComponent;
  10345.         if (!
  10346.           (localRSComponent = a.interfaces.getComponent(242, 4)).isValid())
  10347.         {
  10348.           localRSComponent = a.interfaces.getComponent(241, 4);
  10349.         }
  10350.  
  10351.         if (localRSComponent.isValid())
  10352.         {
  10353.           if (
  10354.             (localObject2 = localRSComponent.getText()).contains("yetsan"))
  10355.           {
  10356.             a.uC = "Summoning requirement not met";
  10357.  
  10358.             return -1;
  10359.           }
  10360.           if (((String)localObject2).contains("a deathslinger"))
  10361.           {
  10362.             i1 = 17389;
  10363.           }
  10364.           else if (((String)localObject2).contains("cannot illuminate"))
  10365.           {
  10366.             i1 = 17393;
  10367.           }
  10368.           else if (((String)localObject2).contains("blunt force"))
  10369.           {
  10370.             i1 = 17401;
  10371.           }
  10372.           else if (((String)localObject2).contains("make you dead"))
  10373.           {
  10374.             i1 = 17403;
  10375.           }
  10376.           else if (((String)localObject2).contains("lost in winds"))
  10377.           {
  10378.             i1 = 17379;
  10379.           }
  10380.           else if (((String)localObject2).contains("stones may"))
  10381.           {
  10382.             i1 = 17387;
  10383.           }
  10384.           else if (((String)localObject2).contains("friends fly"))
  10385.           {
  10386.             i1 = 17405;
  10387.           }
  10388.           else
  10389.           {
  10390.             i2 = 1;
  10391.  
  10392.             if (((String)localObject2).contains("veins I flow"))
  10393.             {
  10394.               i1 = 17385;
  10395.  
  10396.               str = "rune";
  10397.             }
  10398.             else if (((String)localObject2).contains("get you almost"))
  10399.             {
  10400.               i1 = 17391;
  10401.  
  10402.               str = "Coins";
  10403.             }
  10404.             else if (((String)localObject2).contains("denizens"))
  10405.             {
  10406.               i1 = 17399;
  10407.  
  10408.               str = "rod";
  10409.             }
  10410.             else if (((String)localObject2).contains("one eye"))
  10411.             {
  10412.               i1 = 17409;
  10413.  
  10414.               str = "Needle";
  10415.             }
  10416.             else if (((String)localObject2).contains("demonstrate faith"))
  10417.             {
  10418.               i1 = 17383;
  10419.  
  10420.               str = "symbol";
  10421.             }
  10422.             else
  10423.             {
  10424.               i2 = 2;
  10425.  
  10426.               if (((String)localObject2).contains("yellow skin"))
  10427.               {
  10428.                 i1 = 17381;
  10429.  
  10430.                 str = "Banana";
  10431.               }
  10432.               else if (((String)localObject2).contains("water that"))
  10433.               {
  10434.                 i1 = 17395;
  10435.  
  10436.                 str = "whiskey";
  10437.               }
  10438.               else if (((String)localObject2).contains("many call"))
  10439.               {
  10440.                 i1 = 17407;
  10441.  
  10442.                 str = "Mushroom";
  10443.               }
  10444.               else if (((String)localObject2).contains("you cannot"))
  10445.               {
  10446.                 i1 = 17413;
  10447.  
  10448.                 str = "water";
  10449.               }
  10450.               else if (((String)localObject2).contains("slowest of"))
  10451.               {
  10452.                 i1 = 17411;
  10453.  
  10454.                 str = "Poison";
  10455.               }
  10456.               else if (((String)localObject2).contains("serpent am I"))
  10457.               {
  10458.                 i1 = 17397;
  10459.  
  10460.                 str = "eel";
  10461.               }
  10462.  
  10463.             }
  10464.  
  10465.           }
  10466.  
  10467.           if (i1 < 1)
  10468.           {
  10469.             a.uC = "Uknown riddle";
  10470.  
  10471.             return -1;
  10472.           }
  10473.           a.log("Fetching item: " + i1 + "; Location: " + i2);
  10474.         }
  10475.         else
  10476.         {
  10477.           a.F(localRSNPC, "Get-Riddle");
  10478.         }
  10479.       }
  10480.       else
  10481.       {
  10482.         if (a.inventory.contains(i1))
  10483.         {
  10484.           int i3 = a.inventory.getCount(new int[] { i1 });
  10485.  
  10486.           for (; ; a.sleep(200, 400))
  10487.           {
  10488.             if (a.jA()) {
  10489.               return 2;
  10490.             }
  10491.  
  10492.             a.K(false);
  10493.           }
  10494.         }
  10495.         if (localRSObject != null)
  10496.         {
  10497.           a.l(localRSObject, "Open");
  10498.         }
  10499.         else if (i2 == 0)
  10500.         {
  10501.           a.l(a.groundItems.getNearest(new int[] { i1 }));
  10502.         }
  10503.         else if (i2 == 1)
  10504.         {
  10505.           if (a.interfaces.get(238).isValid())
  10506.             a.l(a.interfaces.get(238), new String[] { str });
  10507.           else {
  10508.             a.l(a.i(new int[] { 49594, 49595, 49596 }), "Search");
  10509.           }
  10510.  
  10511.         }
  10512.         else if (i2 == 2)
  10513.         {
  10514.           Object localObject1 = null;
  10515.  
  10516.           int i4 = (localObject2 = a.J(new int[] { 49597, 49598, 49599 })).length;
  10517.           int i5;
  10518.           Object localObject3;
  10519.           RSTile localRSTile =
  10520.             (localObject3 = localObject2[i5]).getLocation();
  10521.  
  10522.           if ((!a.i(localRSTile)) && (a.l(localRSTile, true)))
  10523.           {
  10524.             localObject1 = localObject3;
  10525.           }
  10526.           else
  10527.             i5++;
  10528.           if (localObject1 == null)
  10529.           {
  10530.             if ((localObject2 = a.J(new String[] { "range" })) == null)
  10531.             {
  10532.               return -1;
  10533.             }
  10534.  
  10535.             a.A(((RSObject)localObject2).getLocation(), 1);
  10536.           }
  10537.           else if (a.interfaces.get(237).isValid())
  10538.           {
  10539.             a.l(a.interfaces.get(237), new String[] { str, "More" });
  10540.           }
  10541.           else
  10542.           {
  10543.             a.l(localObject1, "Search");
  10544.           }
  10545.         }
  10546.       }
  10547.       a.K(true);
  10548.     }
  10549.  
  10550.     return 1;
  10551.   }
  10552.  
  10553.   private int A(RSTile a)
  10554.   {
  10555.     a.BG = true;
  10556.     RSObject localRSObject;
  10557.     if ((a != null) && (!a.l(a, true)))
  10558.     {
  10559.       localRSObject = a.i(a.gA);
  10560.  
  10561.       String str = "Cross-the";
  10562.  
  10563.       if (localRSObject == null)
  10564.       {
  10565.         localRSObject = a.J(new String[] { "Unfinished bridge" });
  10566.  
  10567.         str = "Jump";
  10568.       }
  10569.  
  10570.       if (localRSObject != null)
  10571.       {
  10572.         if (a.Zc())
  10573.           return 2;
  10574.         if (!a.j())
  10575.         {
  10576.           return -1;
  10577.         }
  10578.  
  10579.         if (a.l(localRSObject, str))
  10580.         {
  10581.           a.K(true);
  10582.         }
  10583.         a.K(true);
  10584.       }
  10585.     }
  10586.     return 1;
  10587.   }
  10588.  
  10589.   private void DA()
  10590.   {
  10591.     RSGroundItem[] arrayOfRSGroundItem1 = new RSGroundItem[a.Sb.length];
  10592.  
  10593.     if (a.PB == null)
  10594.       a.PB = new String[a.Sb.length];
  10595.     RSGroundItem[] arrayOfRSGroundItem2;
  10596.     int i2 = (arrayOfRSGroundItem2 = a.groundItems.getAll()).length;
  10597.     int i3;
  10598.     RSGroundItem localRSGroundItem2 = arrayOfRSGroundItem2[i3];
  10599.     int i5;
  10600.     if (a.r.contains(new RSTile[] { localRSGroundItem2.getLocation() }))
  10601.     {
  10602.       String str2 = localRSGroundItem2.getItem().getName();
  10603.       int i4;
  10604.       if ((
  10605.         (i4 = a.F(str2)) > 0) && (i4 <= a.tA))
  10606.       {
  10607.         if ((a.l(str2, a.wC[i5])) && (i4 > a.Tb[i5]) && ((!a.wC[i5][0].equals("kiteshield")) || ((!a.GD) && (!str2.contains("(o)")))))
  10608.         {
  10609.           a.Tb[i5] = i4;
  10610.  
  10611.           arrayOfRSGroundItem1[i5] = localRSGroundItem2;
  10612.         }
  10613.  
  10614.         i5++;
  10615.       }
  10616.     }
  10617.     i3++;
  10618.     int i1;
  10619.     RSGroundItem localRSGroundItem1;
  10620.     if (
  10621.       (localRSGroundItem1 = arrayOfRSGroundItem1[i1]) != null)
  10622.     {
  10623.       String str1 = localRSGroundItem1.getItem().getName();
  10624.  
  10625.       if ((a.PB[i1] == null) || (!str1.equals(a.PB[i1])))
  10626.       {
  10627.         a.log("Improving equipment with: " + str1);
  10628.  
  10629.         a.PB[i1] = str1;
  10630.       }
  10631.  
  10632.     }
  10633.  
  10634.     i1++;
  10635.   }
  10636.  
  10637.   private boolean l(RSObject a, String a)
  10638.   {
  10639.     if (a == null) {
  10640.       return false;
  10641.     }
  10642.  
  10643.     int i1 = 0;
  10644.  
  10645.     RSTile localRSTile = a.getLocation();
  10646.     Object localObject;
  10647.     if ((a.game.getCurrentTab() == 4) && (
  10648.       (localObject = a.inventory.getSelectedItem()) != null))
  10649.       ((RSItem)localObject).doClick(true);
  10650.     if (a.F(a, a))
  10651.     {
  10652.       localObject = a.X();
  10653.  
  10654.       double d1 = a.calc.distanceBetween(a.X(), localRSTile);
  10655.  
  10656.       a.sleep((int)d1 * 200, (int)d1 * 220);
  10657.  
  10658.       i1 = (a.Y().isMoving()) || (a.calc.distanceTo(localRSTile) < 4) || (!((RSTile)localObject).equals(a.X())) ? 1 : 0;
  10659.     }
  10660.  
  10661.     if ((!a.Y().isMoving()) && (a.calc.distanceTo(localRSTile) > 4))
  10662.     {
  10663.       a.i(localRSTile, 1);
  10664.  
  10665.       if ((a.Qc.contains("Backtracking")) && (!a.combat.isAutoRetaliateEnabled()) && (a.game.getCurrentTab() != 0))
  10666.         a.game.openTab(0);
  10667.       else if (a.calc.distanceTo(localRSTile) > a.random(6, 8))
  10668.       {
  10669.         a.camera.turnToTile(localRSTile, a.random(5, 15));
  10670.       }
  10671.       else {
  10672.         a.l(false);
  10673.       }
  10674.  
  10675.     }
  10676.  
  10677.     while ((a.game.getCurrentTab() == 4) && (!a.equals("Pull")) && (!a.Ke) && (a.JC()));
  10678.     a.sleep(100, 200);
  10679.  
  10680.     return i1 != 0 ? true : a.F(a, a);
  10681.   }
  10682.  
  10683.   private boolean A(RSNPC a)
  10684.   {
  10685.     if ((a == null) || (a.l(a.getAnimation(), a.Yc))) {
  10686.       return true;
  10687.     }
  10688.  
  10689.     return (a.isInCombat()) && (a.l(a) == 0) && (!a.l(a));
  10690.   }
  10691.  
  10692.   private boolean i(boolean a)
  10693.   {
  10694.     if (a.ZA == null)
  10695.     {
  10696.       RSObject localRSObject;
  10697.       if ((a.r.contains(new RSTile[] { a.X() })) && (
  10698.         (localRSObject = a.G(a.nD)) != null))
  10699.       {
  10700.         int i2 = 0;
  10701.         RSTile[] arrayOfRSTile;
  10702.         int i3 = (arrayOfRSTile = localRSObject.getArea().getTileArray()).length;
  10703.         int i4;
  10704.         RSTile localRSTile = arrayOfRSTile[i4];
  10705.  
  10706.         if (a.calc.distanceBetween(a.X(), localRSTile) == 1.0D)
  10707.         {
  10708.           i2 = 1;
  10709.         }
  10710.         else
  10711.           i4++;
  10712.         if (i2 == 0)
  10713.         {
  10714.           return false;
  10715.         }
  10716.       }
  10717.     }
  10718.     int i1;
  10719.     if (a.ZA == null)
  10720.     {
  10721.       if (a.game.getClientState() == 11)
  10722.       {
  10723.         a.sleep(100, 200);
  10724.  
  10725.         i1--;
  10726.       }
  10727.       else
  10728.       {
  10729.         if ((a) && (!a.iD())) {
  10730.           return true;
  10731.         }
  10732.  
  10733.         if (a.cA())
  10734.         {
  10735.           return !a.IA();
  10736.         }
  10737.       }
  10738.     }
  10739.     else if (a.ZA.contains(new RSTile[] { a.X() }))
  10740.       return true;
  10741.     a.sleep(200, 400);
  10742.  
  10743.     i1++;
  10744.  
  10745.     return false;
  10746.   }
  10747.  
  10748.   private int lA()
  10749.   {
  10750.     double d1 = 99.989999999999995D;
  10751.  
  10752.     int i1 = -1;
  10753.  
  10754.     Object localObject1 = null;
  10755.  
  10756.     a.nD = null;
  10757.  
  10758.     a.WA = null;
  10759.  
  10760.     ArrayList localArrayList = new ArrayList();
  10761.  
  10762.     for (Iterator localIterator = a.J.iterator(); localIterator.hasNext(); ) { localRSTile = (RSTile)localIterator.next();
  10763.  
  10764.       if (a.r.contains(new RSTile[] { localRSTile }))
  10765.       {
  10766.         localArrayList.add(localRSTile);
  10767.       }
  10768.     }
  10769.     RSTile localRSTile;
  10770.     Object localObject2;
  10771.     if (!localArrayList.isEmpty())
  10772.     {
  10773.       for (localIterator = localArrayList.iterator(); localIterator.hasNext(); ) { localRSTile = (RSTile)localIterator.next();
  10774.  
  10775.         localObject2 = a.G(localRSTile);
  10776.  
  10777.         double d2 = a.calc.distanceBetween(a.X(), localRSTile);
  10778.  
  10779.         if ((localObject2 != null) && (d2 < d1))
  10780.         {
  10781.           i1 = 0;
  10782.  
  10783.           d1 = d2;
  10784.  
  10785.           i1 = ((RSObject)localObject2).getID();
  10786.  
  10787.           localObject1 = localRSTile;
  10788.         }
  10789.  
  10790.       }
  10791.  
  10792.       if ((localObject1 != null) && (i1 > 0))
  10793.       {
  10794.         for (localIterator = a.gc.iterator(); localIterator.hasNext(); ) { localRSTile = (RSTile)localIterator.next();
  10795.  
  10796.           if (a.calc.distanceBetween(localObject1, localRSTile) < 3.0D)
  10797.           {
  10798.             a.nD = localObject1;
  10799.  
  10800.             a.WA = localRSTile;
  10801.  
  10802.             return 2;
  10803.           }
  10804.         }
  10805.         for (localIterator = a.vF.iterator(); localIterator.hasNext(); ) { localRSTile = (RSTile)localIterator.next();
  10806.  
  10807.           if (a.calc.distanceBetween(localObject1, localRSTile) < 3.0D)
  10808.           {
  10809.             a.nD = localObject1;
  10810.  
  10811.             a.WA = localRSTile;
  10812.  
  10813.             return 3;
  10814.           }
  10815.         }
  10816.         if (a.l(i1, a.WD))
  10817.         {
  10818.           a.nD = localObject1;
  10819.  
  10820.           return 1;
  10821.         }
  10822.  
  10823.         if (a.id.contains(localObject1))
  10824.         {
  10825.           a.nD = localObject1;
  10826.  
  10827.           return 4;
  10828.         }
  10829.         if (a.l(i1, a.sb))
  10830.         {
  10831.           a.nD = localObject1;
  10832.  
  10833.           return 1;
  10834.         }
  10835.       }
  10836.     }
  10837.     for (localIterator = a.w.iterator(); localIterator.hasNext(); ) { localRSTile = (RSTile)localIterator.next();
  10838.  
  10839.       if ((a.r.contains(new RSTile[] { localRSTile })) && ((a.QA == null) || (!localRSTile.equals(a.QA)))) {
  10840.         for (localObject2 = a.Nc.iterator(); ((Iterator)localObject2).hasNext(); ) { RSArea localRSArea = (RSArea)((Iterator)localObject2).next();
  10841.  
  10842.           if (a.calc.distanceBetween(localRSTile, localRSArea.getNearestTile(localRSTile)) < 3.0D)
  10843.           {
  10844.             if ((!a.l(localRSArea, a.J)) && (!a.l(localRSArea, a.w)))
  10845.               break;
  10846.             a.nD = localRSTile;
  10847.  
  10848.             return 5;
  10849.           }
  10850.  
  10851.         }
  10852.  
  10853.       }
  10854.  
  10855.     }
  10856.  
  10857.     return 0;
  10858.   }
  10859.  
  10860.   public void keyReleased(KeyEvent a)
  10861.   {
  10862.   }
  10863.  
  10864.   private RSGroundItem l(Filter<RSGroundItem> a)
  10865.   {
  10866.     double d1 = 99.989999999999995D;
  10867.  
  10868.     Object localObject = null;
  10869.     int i3;
  10870.     if (a.r != null)
  10871.     {
  10872.       int i1 = a.r.getX(); int i2 = a.r.getY();
  10873.       int i4;
  10874.       RSTile localRSTile = new RSTile(i3, i4);
  10875.       double d2;
  10876.       int i6;
  10877.       if (
  10878.         (d2 = a.calc.distanceBetween(a.X(), localRSTile)) < d1)
  10879.       {
  10880.         RSGroundItem[] arrayOfRSGroundItem;
  10881.         int i5 = (arrayOfRSGroundItem = a.groundItems.getAllAt(i3, i4)).length; RSGroundItem localRSGroundItem = arrayOfRSGroundItem[i6];
  10882.  
  10883.         if (a.accept(localRSGroundItem))
  10884.         {
  10885.           d1 = d2;
  10886.  
  10887.           localObject = localRSGroundItem;
  10888.         }
  10889.         else
  10890.         {
  10891.           i6++;
  10892.         }
  10893.       }
  10894.       i4++;
  10895.  
  10896.       i3++;
  10897.     }
  10898.     return localObject;
  10899.   }
  10900.  
  10901.   private boolean F(RSNPC a)
  10902.   {
  10903.     if ((a == null) || (!a.isValid()) || (a.l(a))) {
  10904.       return false;
  10905.     }
  10906.  
  10907.     if (a.l(a, "Attack " + a.getName()))
  10908.     {
  10909.       if (a.tc.isEmpty())
  10910.       {
  10911.         a.D(a);
  10912.  
  10913.         if (!a.F())
  10914.         {
  10915.           a.sleep(200, 400);
  10916.         }
  10917.       }
  10918.       return true;
  10919.     }
  10920.     int i1;
  10921.     if (!a.isOnScreen())
  10922.     {
  10923.       if (!a.Y().isMoving())
  10924.       {
  10925.         a.l(a.getLocation(), 1);
  10926.  
  10927.         a.sleep(200, 400);
  10928.       }
  10929.       if ((i1 = 0) < 10)
  10930.       {
  10931.         a.sleep(100, 150);
  10932.  
  10933.         i1++;
  10934.       }
  10935.  
  10936.     }
  10937.  
  10938.     return (a.l(a)) || (a.l(a, "Attack"));
  10939.   }
  10940.  
  10941.   private RSTile F(RSTile a, String a)
  10942.   {
  10943.     double d1 = 99999.990000000005D;
  10944.  
  10945.     Object localObject = null;
  10946.     int i2;
  10947.     if (a != null)
  10948.     {
  10949.       RSObject[] arrayOfRSObject;
  10950.       int i1 = (arrayOfRSObject = a.objects.getAll()).length;
  10951.       RSObject localRSObject;
  10952.       RSTile localRSTile =
  10953.         (localRSObject = arrayOfRSObject[i2]).getLocation();
  10954.       double d2;
  10955.       if ((
  10956.         (d2 = a.calc.distanceBetween(localRSTile, a)) < d1) && (a.A(localRSObject).contains(a)))
  10957.       {
  10958.         d1 = d2;
  10959.  
  10960.         localObject = localRSTile;
  10961.       }
  10962.       i2++;
  10963.     }
  10964.  
  10965.     return localObject;
  10966.   }
  10967.  
  10968.   private boolean CA()
  10969.   {
  10970.     if ((a.nA) && (a.zB) && (!a.nc) && (!a.Qc.startsWith("Entering")) && (!a.M()))
  10971.     {
  10972.       a.log.severe("Oops.. We ended up outside somehow :S");
  10973.  
  10974.       a.T();
  10975.  
  10976.       a.ud = "Outside";
  10977.  
  10978.       a.zB = false;
  10979.  
  10980.       a.N = false;
  10981.  
  10982.       return true;
  10983.     }
  10984.     return false;
  10985.   }
  10986.  
  10987.   private void V()
  10988.   {
  10989.     if (a.qd)
  10990.     {
  10991.       a.log("Pausing iDungeon...");
  10992.  
  10993.       if (!a.Od)
  10994.       {
  10995.         return;
  10996.       }
  10997.  
  10998.       a.sleep(400, 600);
  10999.  
  11000.       a.KA = new Timer(0L);
  11001.     }
  11002.   }
  11003.  
  11004.   private boolean l(RSTile a, boolean a)
  11005.   {
  11006.     RSTile localRSTile;
  11007.     if ((
  11008.       (localRSTile = a.X()) == null) || (a == null))
  11009.       return false;
  11010.     int i1 = localRSTile.getX() - a.game.getBaseX(); int i2 = localRSTile.getY() - a.game.getBaseY();
  11011.  
  11012.     int i3 = a.getX() - a.game.getBaseX(); int i4 = a.getY() - a.game.getBaseY();
  11013.  
  11014.     int[][] arrayOfInt1 = new int[104][104]; int[][] arrayOfInt2 = new int[104][104];
  11015.  
  11016.     int[] arrayOfInt3 = new int[4000]; int[] arrayOfInt4 = new int[4000];
  11017.  
  11018.     arrayOfInt1[i5][i6] = 0;
  11019.  
  11020.     arrayOfInt2[i5][i6] = 99999999;
  11021.  
  11022.     i6++;
  11023.  
  11024.     i5++;
  11025.  
  11026.     int i5 = i1; int i6 = i2;
  11027.  
  11028.     arrayOfInt1[i1][i2] = 99;
  11029.  
  11030.     arrayOfInt2[i1][i2] = 0;
  11031.  
  11032.     int i7 = 0; int i8 = 0;
  11033.  
  11034.     arrayOfInt3[i7] = i1;
  11035.  
  11036.     arrayOfInt4[(i7++)] = i2;
  11037.  
  11038.     int[][] arrayOfInt5 = a.walking.getCollisionFlags(a.game.getPlane());
  11039.  
  11040.     int i9 = arrayOfInt3.length;
  11041.  
  11042.     while (i8 != i7)
  11043.     {
  11044.       i5 = arrayOfInt3[i8];
  11045.  
  11046.       i6 = arrayOfInt4[i8];
  11047.  
  11048.       if (a)
  11049.       {
  11050.         if (Math.abs(i6 - i4) + Math.abs(i5 - i3) == 1) {
  11051.           return true;
  11052.         }
  11053.  
  11054.       }
  11055.       else if ((i5 == i3) && (i6 == i4))
  11056.         return true;
  11057.       i8 = (i8 + 1) % i9;
  11058.  
  11059.       int i10 = arrayOfInt2[i5][i6] + 1;
  11060.  
  11061.       if ((i6 > 0) && (arrayOfInt1[i5][(i6 - 1)] == 0) && ((arrayOfInt5[(i5 + 1)][i6] & 0x1280102) == 0))
  11062.       {
  11063.         arrayOfInt3[i7] = i5;
  11064.  
  11065.         arrayOfInt4[i7] = (i6 - 1);
  11066.  
  11067.         i7 = (i7 + 1) % i9;
  11068.  
  11069.         arrayOfInt1[i5][(i6 - 1)] = 1;
  11070.  
  11071.         arrayOfInt2[i5][(i6 - 1)] = i10;
  11072.       }
  11073.       if ((i5 > 0) && (arrayOfInt1[(i5 - 1)][i6] == 0) && ((arrayOfInt5[i5][(i6 + 1)] & 0x1280108) == 0))
  11074.       {
  11075.         arrayOfInt3[i7] = (i5 - 1);
  11076.  
  11077.         arrayOfInt4[i7] = i6;
  11078.  
  11079.         i7 = (i7 + 1) % i9;
  11080.  
  11081.         arrayOfInt1[(i5 - 1)][i6] = 2;
  11082.  
  11083.         arrayOfInt2[(i5 - 1)][i6] = i10;
  11084.       }
  11085.       if ((i6 < 103) && (arrayOfInt1[i5][(i6 + 1)] == 0) && ((arrayOfInt5[(i5 + 1)][(i6 + 2)] & 0x1280120) == 0))
  11086.       {
  11087.         arrayOfInt3[i7] = i5;
  11088.  
  11089.         arrayOfInt4[i7] = (i6 + 1);
  11090.  
  11091.         i7 = (i7 + 1) % i9;
  11092.  
  11093.         arrayOfInt1[i5][(i6 + 1)] = 4;
  11094.  
  11095.         arrayOfInt2[i5][(i6 + 1)] = i10;
  11096.       }
  11097.       if ((i5 < 103) && (arrayOfInt1[(i5 + 1)][i6] == 0) && ((arrayOfInt5[(i5 + 2)][(i6 + 1)] & 0x1280180) == 0))
  11098.       {
  11099.         arrayOfInt3[i7] = (i5 + 1);
  11100.  
  11101.         arrayOfInt4[i7] = i6;
  11102.  
  11103.         i7 = (i7 + 1) % i9;
  11104.  
  11105.         arrayOfInt1[(i5 + 1)][i6] = 8;
  11106.  
  11107.         arrayOfInt2[(i5 + 1)][i6] = i10;
  11108.       }
  11109.       if ((i5 > 0) && (i6 > 0) && (arrayOfInt1[(i5 - 1)][(i6 - 1)] == 0) && ((arrayOfInt5[i5][i6] & 0x128010E) == 0) && ((arrayOfInt5[i5][(i6 + 1)] & 0x1280108) == 0) && ((arrayOfInt5[(i5 + 1)][i6] & 0x1280102) == 0))
  11110.       {
  11111.         arrayOfInt3[i7] = (i5 - 1);
  11112.  
  11113.         arrayOfInt4[i7] = (i6 - 1);
  11114.  
  11115.         i7 = (i7 + 1) % i9;
  11116.  
  11117.         arrayOfInt1[(i5 - 1)][(i6 - 1)] = 3;
  11118.  
  11119.         arrayOfInt2[(i5 - 1)][(i6 - 1)] = i10;
  11120.       }
  11121.       if ((i5 > 0) && (i6 < 103) && (arrayOfInt1[(i5 - 1)][(i6 + 1)] == 0) && ((arrayOfInt5[i5][(i6 + 2)] & 0x1280138) == 0) && ((arrayOfInt5[i5][(i6 + 1)] & 0x1280108) == 0) && ((arrayOfInt5[(i5 + 1)][(i6 + 2)] & 0x1280120) == 0))
  11122.       {
  11123.         arrayOfInt3[i7] = (i5 - 1);
  11124.  
  11125.         arrayOfInt4[i7] = (i6 + 1);
  11126.  
  11127.         i7 = (i7 + 1) % i9;
  11128.  
  11129.         arrayOfInt1[(i5 - 1)][(i6 + 1)] = 6;
  11130.  
  11131.         arrayOfInt2[(i5 - 1)][(i6 + 1)] = i10;
  11132.       }
  11133.  
  11134.       if ((i5 < 103) && (i6 > 0) && (arrayOfInt1[(i5 + 1)][(i6 - 1)] == 0) && ((arrayOfInt5[(i5 + 2)][i6] & 0x1280183) == 0) && ((arrayOfInt5[(i5 + 2)][(i6 + 1)] & 0x1280180) == 0) && ((arrayOfInt5[(i5 + 1)][i6] & 0x1280102) == 0))
  11135.       {
  11136.         arrayOfInt3[i7] = (i5 + 1);
  11137.  
  11138.         arrayOfInt4[i7] = (i6 - 1);
  11139.  
  11140.         i7 = (i7 + 1) % i9;
  11141.  
  11142.         arrayOfInt1[(i5 + 1)][(i6 - 1)] = 9;
  11143.  
  11144.         arrayOfInt2[(i5 + 1)][(i6 - 1)] = i10;
  11145.       }
  11146.  
  11147.       if ((i5 < 103) && (i6 < 103) && (arrayOfInt1[(i5 + 1)][(i6 + 1)] == 0) && ((arrayOfInt5[(i5 + 2)][(i6 + 2)] & 0x12801E0) == 0) && ((arrayOfInt5[(i5 + 2)][(i6 + 1)] & 0x1280180) == 0) && ((arrayOfInt5[(i5 + 1)][(i6 + 2)] & 0x1280120) == 0))
  11148.       {
  11149.         arrayOfInt3[i7] = (i5 + 1);
  11150.  
  11151.         arrayOfInt4[i7] = (i6 + 1);
  11152.  
  11153.         i7 = (i7 + 1) % i9;
  11154.  
  11155.         arrayOfInt1[(i5 + 1)][(i6 + 1)] = 12;
  11156.  
  11157.         arrayOfInt2[(i5 + 1)][(i6 + 1)] = i10;
  11158.       }
  11159.     }
  11160.     return false;
  11161.   }
  11162.  
  11163.   private int y()
  11164.   {
  11165.     if (!a.O()) {
  11166.       return -1;
  11167.     }
  11168.  
  11169.     RSTile localRSTile = a.tA();
  11170.  
  11171.     RSObject localRSObject = a.J(new String[] { "Spinning blades" });
  11172.  
  11173.     a.lA();
  11174.  
  11175.     if ((localRSObject == null) || (localRSTile == null) || (a.nD == null))
  11176.     {
  11177.       return -1;
  11178.     }
  11179.     if (a.calc.distanceBetween(localRSTile, localRSObject.getLocation()) < 8.0D)
  11180.     {
  11181.       a.log("Agility course layout 1");
  11182.  
  11183.       return a.a();
  11184.     }
  11185.  
  11186.     if (a.calc.distanceBetween(a.r.getCentralTile(), localRSObject.getLocation()) < 4.0D)
  11187.     {
  11188.       a.log("Agility course layout 3");
  11189.  
  11190.       return a.rd();
  11191.     }
  11192.  
  11193.     a.log("Agility course layout 2");
  11194.  
  11195.     return a.dA();
  11196.   }
  11197.  
  11198.   private int l(RSCharacter a)
  11199.   {
  11200.     try
  11201.     {
  11202.       return a.getHPPercent();
  11203.     }
  11204.     catch (Exception localException)
  11205.     {
  11206.       if (a.UA)
  11207.         localException.printStackTrace();
  11208.     }
  11209.     return 100;
  11210.   }
  11211.  
  11212.   private boolean A(RSTile a, int a, int a)
  11213.   {
  11214.     if (a == null)
  11215.     {
  11216.       return false;
  11217.     }
  11218.     RSTile localRSTile1 = a.X(); RSTile localRSTile2 = new RSTile(a.getX() + a, a.getY() + a);
  11219.  
  11220.     if (localRSTile1.equals(localRSTile2))
  11221.       return true;
  11222.     int i3;
  11223.     if (a.calc.distanceTo(localRSTile2) > 1)
  11224.     {
  11225.       RSTile[] arrayOfRSTile;
  11226.       int i2 = (arrayOfRSTile = a.h(a)).length; RSTile localRSTile3 = arrayOfRSTile[i3];
  11227.  
  11228.       if ((a.G(localRSTile3) == null) && (!localRSTile3.equals(localRSTile2)) && (a.calc.distanceBetween(localRSTile3, localRSTile2) < 2.0D))
  11229.       {
  11230.         a.A(localRSTile3, 0);
  11231.  
  11232.         a.K(false);
  11233.       }
  11234.       else
  11235.       {
  11236.         i3++;
  11237.       }
  11238.     }
  11239.     a.A(localRSTile2, 0);
  11240.  
  11241.     a.K(false);
  11242.  
  11243.     if (a.X().equals(localRSTile1))
  11244.     {
  11245.       int i1;
  11246.       a.A(a.X(), i1);
  11247.  
  11248.       a.K(false);
  11249.  
  11250.       i1++;
  11251.  
  11252.       a.A(localRSTile2, 0);
  11253.  
  11254.       a.K(false);
  11255.     }
  11256.     return a.X().equals(localRSTile2);
  11257.   }
  11258.  
  11259.   private void r()
  11260.   {
  11261.     a.EB.clear();
  11262.  
  11263.     a.SC = a.skills.getRealLevel(5);
  11264.     int i1;
  11265.     Object localObject1;
  11266.     int i10;
  11267.     if (a.le)
  11268.     {
  11269.       if (!a.Od) {
  11270.         return;
  11271.       }
  11272.  
  11273.       a.CD = a.skills.getCurrentExp(0);
  11274.  
  11275.       a.q = a.skills.getCurrentExp(2);
  11276.  
  11277.       a.Rc = a.skills.getCurrentExp(1);
  11278.  
  11279.       a.ZF = a.skills.getCurrentExp(3);
  11280.  
  11281.       a.xB = a.skills.getCurrentExp(4);
  11282.  
  11283.       a.L = a.skills.getCurrentExp(6);
  11284.  
  11285.       a.pd = a.skills.getCurrentExp(5);
  11286.  
  11287.       a.JC = a.skills.getCurrentExp(24);
  11288.  
  11289.       a.og = a.skills.getCurrentExp(20);
  11290.  
  11291.       a.vB = a.skills.getCurrentExp(14);
  11292.  
  11293.       a.aD = a.skills.getCurrentExp(11);
  11294.  
  11295.       a.K = a.skills.getCurrentExp(8);
  11296.  
  11297.       a.RA = a.skills.getCurrentExp(13);
  11298.  
  11299.       a.Cg = a.skills.getCurrentExp(12);
  11300.  
  11301.       a.Gg = a.skills.getCurrentExp(16);
  11302.  
  11303.       a.db = a.skills.getCurrentExp(17);
  11304.  
  11305.       a.ND = a.skills.getCurrentExp(23);
  11306.  
  11307.       a.f = a.skills.getCurrentExp(15);
  11308.  
  11309.       a.qc = a.skills.getCurrentExp(22);
  11310.  
  11311.       a.pD = a.skills.getCurrentExp(7);
  11312.  
  11313.       a.vA = a.skills.getCurrentExp(10);
  11314.  
  11315.       a.e = a.skills.getCurrentExp(18);
  11316.  
  11317.       a.me = a.skills.getRealLevel(24);
  11318.  
  11319.       a.JA = a.me;
  11320.  
  11321.       if (!a.H())
  11322.       {
  11323.         if (a.SC > 10)
  11324.         {
  11325.           a.O[1][5] = 1;
  11326.  
  11327.           a.xe = a.O[1][5];
  11328.  
  11329.           if (a.SC > 36)
  11330.           {
  11331.             a.O[1][3] = 1;
  11332.  
  11333.             a.VA = a.O[1][3];
  11334.           }
  11335.         }
  11336.         if (a.skills.getRealLevel(3) < 60)
  11337.         {
  11338.           a.zA = true;
  11339.  
  11340.           a.O[1][2] = 1;
  11341.         }
  11342.         if (a.skills.getRealLevel(1) < 20)
  11343.         {
  11344.           a.gB = true;
  11345.  
  11346.           a.O[1][6] = a.gB;
  11347.         }
  11348.         else
  11349.         {
  11350.           a.bc = true;
  11351.  
  11352.           a.O[1][7] = a.bc;
  11353.         }
  11354.  
  11355.       }
  11356.  
  11357.       a.kd = false;
  11358.       int i6;
  11359.       if (a.groundItems.getNearest(new int[] { 18177, 18175, 18173, 18171, 18169 }) != null)
  11360.       {
  11361.         a.kd = true;
  11362.       }
  11363.       else
  11364.       {
  11365.         a.game.openTab(9);
  11366.  
  11367.         a.game.openTab(4);
  11368.         String str1;
  11369.         if (!(str1 = a.interfaces.getComponent(550, 6).getText())
  11370.           .isEmpty())
  11371.         {
  11372.           str1 = str1.concat(".");
  11373.           String[] arrayOfString;
  11374.           int i4 = (arrayOfString = a.Md).length; localObject2 = arrayOfString[i6];
  11375.  
  11376.           if (str1.contains(" " + (String)localObject2 + ".")) {
  11377.             a.kd = true;
  11378.           }
  11379.           else
  11380.           {
  11381.             i6++;
  11382.           }
  11383.         }
  11384.       }
  11385.       a.log("Members world: " + a.kd);
  11386.  
  11387.       a.DC = 0;
  11388.  
  11389.       a.iA = false;
  11390.  
  11391.       a.UB = false;
  11392.  
  11393.       a.qD = false;
  11394.  
  11395.       a.dc = true;
  11396.  
  11397.       a.game.setChatOption(3, Game.CHAT_MODE.VIEW);
  11398.  
  11399.       a.env.setUserInput(3);
  11400.  
  11401.       if (!a.Od)
  11402.       {
  11403.         return;
  11404.       }
  11405.       a.sleep(300, 600);
  11406.  
  11407.       a.env.setUserInput(2);
  11408.  
  11409.       a.UB = true;
  11410.  
  11411.       a.qD = false;
  11412.  
  11413.       a.v = a.combat.getFightMode();
  11414.  
  11415.       if (a.IB) {
  11416.         a.v = 4;
  11417.       }
  11418.       else if (a.v == 4)
  11419.         a.v = 1;
  11420.       if ((a.gB) && ((a.v == a.xD) || (a.v == 3)))
  11421.       {
  11422.         a.v = 1;
  11423.       }
  11424.  
  11425.       a.SD = a.v;
  11426.  
  11427.       a.sleep(200, 400);
  11428.  
  11429.       i1 = a.skills.getRealLevel(0); i3 = a.skills.getRealLevel(1);
  11430.  
  11431.       a.tA = (i3 == 99 ? 11 : i3 / 10 + 1);
  11432.  
  11433.       a.mA = (i1 == 99 ? 11 : i1 / 10 + 1);
  11434.       RSItem localRSItem1;
  11435.       if (((localRSItem1 = a.equipment.getItem(17)) != null) &&
  11436.         (localRSItem1.getID() > 0))
  11437.       {
  11438.         a.Vc = localRSItem1.getID();
  11439.  
  11440.         localObject1 = a.l(localRSItem1);
  11441.  
  11442.         localObject2 = a.J((String)localObject1);
  11443.  
  11444.         a.aA = a.F((String)localObject1);
  11445.  
  11446.         a.cd = a.i((String)localObject1);
  11447.  
  11448.         if (a.cd.equals("maul"))
  11449.         {
  11450.           i10 = a.skills.getRealLevel(2);
  11451.  
  11452.           a.mA = (i10 == 99 ? 11 : i10 / 10 + 1);
  11453.         }
  11454.         else if ((a.cd.equals("dagger")) || (a.cd.equals("rapier")))
  11455.         {
  11456.           if (((String)localObject2).equals("Hailstorm"))
  11457.           {
  11458.             a.aA = 11;
  11459.           }
  11460.  
  11461.           a.Gd = -1;
  11462.  
  11463.           a.xb = 2;
  11464.  
  11465.           a.bC = 1;
  11466.         }
  11467.         else if (a.cd.equals("longsword"))
  11468.         {
  11469.           a.Gd = -1;
  11470.  
  11471.           a.xb = 1;
  11472.  
  11473.           a.bC = 2;
  11474.         }
  11475.         else if ((a.cd.equals("battleaxe")) || (a.cd.equals("2h sword")))
  11476.         {
  11477.           a.Gd = 2;
  11478.  
  11479.           a.xb = 1;
  11480.  
  11481.           a.bC = -1;
  11482.         }
  11483.         else if (a.cd.equals("spear"))
  11484.         {
  11485.           a.Gd = 2;
  11486.  
  11487.           a.xb = 1;
  11488.  
  11489.           a.bC = 0;
  11490.         }
  11491.         if ((a.cd.equals("longsword")) || (a.cd.equals("warhammer")) || (a.cd.equals("maul")))
  11492.         {
  11493.           a.xD = 2;
  11494.         }
  11495.         if ((a.cd.equals("2h sword")) || (a.cd.equals("maul")) || (a.cd.equals("spear")) || (a.cd.contains("bow")))
  11496.         {
  11497.           a.GD = true;
  11498.         }
  11499.         if (a.aA == 0)
  11500.         {
  11501.           a.aA = 11;
  11502.         }
  11503.         a.log("Weapon - Metal: " + (String)localObject2 + "; Type: " + a.cd);
  11504.  
  11505.         a.log("Weapon tier: " + a.aA + ", Max weapon tier: " + a.mA + ", Two-handed: " + (a.GD ? "Yes" : "No"));
  11506.       }
  11507.       if ((
  11508.         (localObject1 = a.equipment.getItem(38)) != null) && (((RSItem)localObject1).getID() > 0))
  11509.       {
  11510.         a.cc = ((RSItem)localObject1).getID();
  11511.       }
  11512.       Object localObject2 = a.jb();
  11513.       RSItem localRSItem2;
  11514.       if (((localRSItem2 = localObject2[i10]) != null) &&
  11515.         (localRSItem2.getID() > 0))
  11516.       {
  11517.         String str3 = a.l(localRSItem2);
  11518.  
  11519.         if ((i10 == 0) && (str3.contains("silk hood")))
  11520.         {
  11521.           a.VD[i10] = 11;
  11522.  
  11523.           a.Xb = true;
  11524.         }
  11525.         else if ((i10 == 2) && ((str3.contains("blastbox")) || (str3.contains("surgebox"))))
  11526.         {
  11527.           a.pB = localRSItem2.getID();
  11528.  
  11529.           a.VD[i10] = 11;
  11530.  
  11531.           a.GD = true;
  11532.         }
  11533.         else
  11534.         {
  11535.           a.VD[i10] = a.F(str3);
  11536.         }
  11537.         a.log("Equipped: " + str3 + "; initial tier: " + a.VD[i10] + "; hooded: " + a.Xb);
  11538.       }
  11539.  
  11540.       i10++;
  11541.     }
  11542.     int i3 = a.VD[i1];
  11543.  
  11544.     a.Tb[i1] = i3;
  11545.  
  11546.     i1++;
  11547.     RSItem[] arrayOfRSItem;
  11548.     i3 = (arrayOfRSItem = a.inventory.getItems()).length;
  11549.     int i12;
  11550.     if (
  11551.       (localObject1 = arrayOfRSItem[i5]) != null)
  11552.     {
  11553.       int i8 = ((RSItem)localObject1).getID();
  11554.       String str2;
  11555.       if (((str2 = a.l((RSItem)localObject1)) != null) &&
  11556.         (i8 > 0) && ((i12 = a.F(str2)) > 0))
  11557.       {
  11558.         if ((a.l(str2, a.wC[i13])) && (i12 > a.Tb[i13]))
  11559.         {
  11560.           int i15;
  11561.           if ((i15 = 0) < 5)
  11562.           {
  11563.             a.inventory.getItem(new int[] { i8 }).doClick(true);
  11564.  
  11565.             a.sleep(800, 1000);
  11566.  
  11567.             i15++;
  11568.           }
  11569.           a.Tb[i13] = i12;
  11570.         }
  11571.         i13++;
  11572.       }
  11573.  
  11574.     }
  11575.  
  11576.     i5++;
  11577.  
  11578.     if ((a.k) || ((a.i) && (a.eB > 0)))
  11579.       a.kC = true;
  11580.     if ((a.Xd) || ((a.BB) && (a.eB > 0) && (a.cc > 0)))
  11581.     {
  11582.       a.Sd = true;
  11583.     }
  11584.  
  11585.     if ((a.IB) || ((a.vC) && ((a.eB > 0) || (a.pB > 0)))) {
  11586.       a.iD = true;
  11587.     }
  11588.  
  11589.     i3 = a.Tb[i2];
  11590.  
  11591.     a.Sb[i2] = i3;
  11592.  
  11593.     i2++;
  11594.  
  11595.     a.vc = new int[] { 18159, 18161, 18163, 18165, 18167, 18169, 18171, 18173, 18175, 18177 };
  11596.  
  11597.     a.vc = new int[] { 18161, 18163, 18165, 18167, 18169, 18171, 18173, 18175, a.zA ?
  11598.       i15 :
  11599.       18177 };
  11600.  
  11601.     int i2 = a.skills.getRealLevel(3) / (a.kd ? 23 : 34);
  11602.  
  11603.     i3 = a.vc.length - i2; int i5 = i2 + (a.kd ? 3 : 1);
  11604.  
  11605.     int i7 = a.vc.length - i5;
  11606.  
  11607.     a.UC = new int[i3];
  11608.  
  11609.     a.lG = new int[i7];
  11610.  
  11611.     System.arraycopy(a.vc, i2, a.UC, 0, i3);
  11612.  
  11613.     System.arraycopy(a.vc, i5, a.lG, 0, i7);
  11614.  
  11615.     a.W = new int[] { 18159, a.kd ? new int[] { 18159, 18161, 18163 } : 18161 };
  11616.     Object localObject3;
  11617.     int i11 = (localObject3 = a.vc).length; int i13 = localObject3[i12];
  11618.  
  11619.     a.EB.add(Integer.valueOf(i13));
  11620.  
  11621.     i12++;
  11622.  
  11623.     if (a.kf)
  11624.     {
  11625.       i11 = (localObject3 = a.aC).length; i13 = localObject3[i12];
  11626.  
  11627.       a.EB.add(Integer.valueOf(i13));
  11628.  
  11629.       i12++;
  11630.     }
  11631.  
  11632.     if (a.Vc > 0)
  11633.     {
  11634.       a.EB.add(Integer.valueOf(a.Vc));
  11635.     }
  11636.     if (a.eB > 0)
  11637.     {
  11638.       a.EB.add(Integer.valueOf(a.eB));
  11639.     }
  11640.  
  11641.     if (a.pB > 0) {
  11642.       a.EB.add(Integer.valueOf(a.pB));
  11643.     }
  11644.  
  11645.     if (a.cc > 0) {
  11646.       a.EB.add(Integer.valueOf(a.cc));
  11647.     }
  11648.  
  11649.     i11 = (localObject3 = a.x).length;
  11650.     Object localObject4;
  11651.     Object localObject6;
  11652.     int i16 =
  11653.       (localObject6
  11654.        = localObject4 = localObject3[i12]).length;
  11655.     int i17;
  11656.     int i18 = localObject6[i17];
  11657.  
  11658.     a.EB.add(Integer.valueOf(i18));
  11659.  
  11660.     i17++;
  11661.  
  11662.     i12++;
  11663.  
  11664.     if (a.Zc > 4)
  11665.     {
  11666.       i11 = (localObject3 = a.jF).length; int i14 = localObject3[i12];
  11667.  
  11668.       a.EB.add(Integer.valueOf(i14));
  11669.  
  11670.       i12++;
  11671.  
  11672.       a.EB.add(Integer.valueOf(18829));
  11673.  
  11674.       a.EB.add(Integer.valueOf(17789));
  11675.  
  11676.       if (!a.kd)
  11677.       {
  11678.         a.EB.remove(Integer.valueOf(17490));
  11679.  
  11680.         a.EB.remove(Integer.valueOf(17754));
  11681.       }
  11682.       else
  11683.       {
  11684.         a.EB.add(Integer.valueOf(17566));
  11685.       }
  11686.  
  11687.     }
  11688.     else if (a.Ud > 11)
  11689.     {
  11690.       a.EB.add(Integer.valueOf(16295));
  11691.     }
  11692.  
  11693.     if ((a.E) && (a.OA < 1))
  11694.     {
  11695.       if ((a.game.getCurrentTab() == 4) || (a.game.getCurrentTab() == 5))
  11696.       {
  11697.         if (a.equipment.containsOneOf(a.DB)) {
  11698.           a.equipment.getItem(35).doAction("Open party interface");
  11699.         }
  11700.         else if (a.inventory.containsOneOf(a.DB))
  11701.           a.inventory.getItem(a.DB).doAction("Open party interface");
  11702.         a.sleep(800, 1200);
  11703.       }
  11704.  
  11705.       a.sleep(300, 500);
  11706.  
  11707.       a.ad();
  11708.     }
  11709.     i11 = (localObject3 = a.inventory.getItems()).length;
  11710.     Object localObject5;
  11711.     if ((
  11712.       (localObject5 = localObject3[i12]) != null) && (localObject5.getName().contains("(b)"))) {
  11713.       a.EB.add(Integer.valueOf(localObject5.getID()));
  11714.     }
  11715.  
  11716.     i12++;
  11717.  
  11718.     a.pb = new int[a.EB.size()];
  11719.     int i9;
  11720.     a.pb[i9] = ((Integer)a.EB.get(i9)).intValue();
  11721.  
  11722.     i9++;
  11723.  
  11724.     if (a.k)
  11725.     {
  11726.       a.HC = 1;
  11727.     }
  11728.     else if (a.Xd)
  11729.     {
  11730.       a.HC = 2;
  11731.  
  11732.       a.l(a.cc, "Wield");
  11733.     }
  11734.     else if (a.IB)
  11735.     {
  11736.       a.HC = 3;
  11737.  
  11738.       a.l(a.pB, "Wield");
  11739.  
  11740.       if (a.F(a.Qb, "Autocast"))
  11741.       {
  11742.         a.sleep(300, 600);
  11743.       }
  11744.       a.sleep(100, 200);
  11745.     }
  11746.  
  11747.     a.bb = a.HC;
  11748.  
  11749.     if (a.le)
  11750.     {
  11751.       a.log("Settings complete!");
  11752.  
  11753.       a.Tb();
  11754.  
  11755.       if (a.Xd)
  11756.       {
  11757.         a.Ec = a.Ad;
  11758.  
  11759.         a.yA = a.VB;
  11760.  
  11761.         a.wC = a.LA;
  11762.       }
  11763.       else if (a.IB)
  11764.       {
  11765.         a.Ec = a.ME;
  11766.  
  11767.         a.wC = a.lB;
  11768.       }
  11769.  
  11770.       a.z = new Timer(0L);
  11771.  
  11772.       a.le = false;
  11773.     }
  11774.  
  11775.     a.hA = new Timer(a.random(360000, 480000));
  11776.   }
  11777.  
  11778.   private void R()
  11779.   {
  11780.     int i2;
  11781.     if (a.aA < a.mA)
  11782.     {
  11783.       RSItem[] arrayOfRSItem;
  11784.       int i1 = (arrayOfRSItem = a.inventory.getItems()).length;
  11785.       RSItem localRSItem;
  11786.       if (
  11787.         (localRSItem = arrayOfRSItem[i2]) != null)
  11788.       {
  11789.         String str;
  11790.         if (((str = a.l(localRSItem)) != null) &&
  11791.           (!str.isEmpty()) && (str.contains(a.cd)))
  11792.         {
  11793.           int i3;
  11794.           if ((
  11795.             (i3 = a.F(str)) > a.aA) && (i3 <= a.mA))
  11796.           {
  11797.             a.pc = localRSItem.getID();
  11798.  
  11799.             return;
  11800.           }
  11801.  
  11802.         }
  11803.  
  11804.       }
  11805.  
  11806.       i2++;
  11807.     }
  11808.   }
  11809.  
  11810.   private boolean S()
  11811.   {
  11812.     if ((a.kf) && ((a.inventory.getCount(a.aC) > a.random(1, 4)) || ((a.inventory.containsOneOf(a.aC)) && (a.inventory.getCount() > 22 + a.random(0, 5)))))
  11813.     {
  11814.       int i2;
  11815.       while (a.inventory.containsOneOf(a.aC))
  11816.       {
  11817.         RSItem[] arrayOfRSItem;
  11818.         int i1 = (arrayOfRSItem = a.inventory.getItems(a.aC)).length;
  11819.         RSItem localRSItem;
  11820.         if (((localRSItem = arrayOfRSItem[i2]) != null) &&
  11821.           (localRSItem.doAction("Bury")))
  11822.           a.sleep(800, 1200);
  11823.         i2++;
  11824.       }
  11825.  
  11826.       return true;
  11827.     }
  11828.  
  11829.     return false;
  11830.   }
  11831.  
  11832.   private boolean F(RSTile a, int a, int a)
  11833.   {
  11834.     if (a == null)
  11835.     {
  11836.       return false;
  11837.     }
  11838.     RSTile localRSTile = new RSTile(a.getX() + a, a.getY() + a);
  11839.     int i1;
  11840.     while (!a.X().equals(localRSTile))
  11841.     {
  11842.       if ((a.Zc()) || (a.D(localRSTile) != null))
  11843.       {
  11844.         return false;
  11845.       }
  11846.       if (a.X().equals(localRSTile))
  11847.       {
  11848.         return true;
  11849.       }
  11850.       if (a.A(localRSTile, 0))
  11851.       {
  11852.         a.K(false);
  11853.  
  11854.         if (!a.X().equals(localRSTile))
  11855.         {
  11856.           a.A(a.X(), i1);
  11857.  
  11858.           a.K(false);
  11859.         }
  11860.  
  11861.       }
  11862.  
  11863.       a.sleep(300, 400);
  11864.  
  11865.       i1++;
  11866.     }
  11867.     return true;
  11868.   }
  11869.  
  11870.   private RSObject[] A(String[] a)
  11871.   {
  11872.     return a.objects.getAll(new q(a, a));
  11873.   }
  11874.  
  11875.   private RSTile l(RSTile a, ArrayList<RSTile> a)
  11876.   {
  11877.     double d1 = 99999.990000000005D;
  11878.  
  11879.     Object localObject = null;
  11880.  
  11881.     if (a != null)
  11882.     {
  11883.       for (RSTile localRSTile : a)
  11884.       {
  11885.         double d2;
  11886.         if ((d2 = a.calc.distanceBetween(a, localRSTile)) <
  11887.           d1)
  11888.         {
  11889.           localObject = localRSTile;
  11890.  
  11891.           d1 = d2;
  11892.         }
  11893.  
  11894.       }
  11895.  
  11896.     }
  11897.  
  11898.     return localObject;
  11899.   }
  11900.  
  11901.   private RSObject i(RSTile a, int[] a)
  11902.   {
  11903.     return a.objects.getNearest(new d(a, a, a));
  11904.   }
  11905.  
  11906.   private void T()
  11907.   {
  11908.     a.gc.clear();
  11909.  
  11910.     a.Bd.clear();
  11911.  
  11912.     a.J.clear();
  11913.  
  11914.     a.ob.clear();
  11915.  
  11916.     a.w.clear();
  11917.  
  11918.     a.vF.clear();
  11919.  
  11920.     a.fc.clear();
  11921.  
  11922.     a.fG.clear();
  11923.  
  11924.     a.fA.clear();
  11925.  
  11926.     a.qA.clear();
  11927.  
  11928.     a.ig.clear();
  11929.  
  11930.     a.Ee.clear();
  11931.  
  11932.     a.AG.clear();
  11933.  
  11934.     a.zc.clear();
  11935.  
  11936.     a.Nc.clear();
  11937.  
  11938.     a.ic.clear();
  11939.  
  11940.     a.l.clear();
  11941.  
  11942.     a.aE.clear();
  11943.  
  11944.     a.ke.clear();
  11945.  
  11946.     a.JB.clear();
  11947.  
  11948.     a.lA.clear();
  11949.  
  11950.     a.cD.clear();
  11951.  
  11952.     a.a.clear();
  11953.  
  11954.     a.uc.clear();
  11955.  
  11956.     a.RD.clear();
  11957.  
  11958.     a.ID.clear();
  11959.  
  11960.     a.Tc.clear();
  11961.  
  11962.     a.ue.clear();
  11963.  
  11964.     a.jb = null;
  11965.  
  11966.     a.FA = null;
  11967.  
  11968.     a.r = null;
  11969.  
  11970.     a.QB = null;
  11971.  
  11972.     a.Sg = null;
  11973.  
  11974.     a.nb = null;
  11975.  
  11976.     a.jA = null;
  11977.  
  11978.     a.nD = null;
  11979.  
  11980.     a.WA = null;
  11981.  
  11982.     a.vE = null;
  11983.  
  11984.     a.yd = null;
  11985.  
  11986.     a.Wd = null;
  11987.  
  11988.     a.cB = null;
  11989.  
  11990.     a.QA = null;
  11991.  
  11992.     a.hd = null;
  11993.  
  11994.     a.Rd = 0;
  11995.  
  11996.     a.Ob = 0;
  11997.  
  11998.     a.BD = 0;
  11999.  
  12000.     a.Wb = 0;
  12001.  
  12002.     a.Sc = 0;
  12003.  
  12004.     a.DD = 0;
  12005.  
  12006.     a.iE = 0;
  12007.  
  12008.     a.PD = -1;
  12009.  
  12010.     a.tc = "";
  12011.  
  12012.     a.AB = "";
  12013.  
  12014.     a.ud = "Determining";
  12015.  
  12016.     a.gd = false;
  12017.  
  12018.     a.X = false;
  12019.  
  12020.     a.hB = false;
  12021.  
  12022.     a.Fg = false;
  12023.  
  12024.     a.FF = false;
  12025.  
  12026.     a.Ke = false;
  12027.  
  12028.     a.nc = false;
  12029.  
  12030.     a.nE = false;
  12031.  
  12032.     a.gE = false;
  12033.  
  12034.     a.XF = false;
  12035.  
  12036.     a.jC = false;
  12037.  
  12038.     a.WC = false;
  12039.  
  12040.     a.qB = false;
  12041.  
  12042.     a.N = true;
  12043.  
  12044.     a.hA = new Timer(a.random(360000, 480000));
  12045.  
  12046.     a.KA = new Timer(0L);
  12047.  
  12048.     if (a.k)
  12049.     {
  12050.       a.HC = 1;
  12051.     }
  12052.     else if (a.Xd)
  12053.     {
  12054.       a.HC = 2;
  12055.     }
  12056.     else if (a.IB)
  12057.     {
  12058.       a.HC = 3;
  12059.     }
  12060.   }
  12061.  
  12062.   private int P()
  12063.   {
  12064.     RSTile localRSTile1 = a.tA();
  12065.     RSTile localRSTile2;
  12066.     if ((localRSTile2 = a.F(localRSTile1, a.sC)) == null)
  12067.     {
  12068.       return -1;
  12069.     }
  12070.  
  12071.     a.mouse.setSpeed(a.random(3, 5));
  12072.  
  12073.     if (a.jA())
  12074.     {
  12075.       return 2;
  12076.     }
  12077.  
  12078.     if (!a.Je)
  12079.       if (a.walking.getEnergy() < a.random(25, 30))
  12080.       {
  12081.         a.walking.rest(a.random(90, 100));
  12082.       }
  12083.       else if (a.calc.distanceTo(localRSTile2) > 1)
  12084.       {
  12085.         a.A(localRSTile2, 1);
  12086.       }
  12087.       else if (a.J(a.sC).length == 5)
  12088.       {
  12089.         a.l(a.G(localRSTile2), "Pull");
  12090.  
  12091.         if (!a.KD)
  12092.         {
  12093.           if (a.jA()) {
  12094.             return 2;
  12095.           }
  12096.  
  12097.           RSObject localRSObject1 = a.i(a.sC); RSObject localRSObject2 = a.l(localRSObject1, a.sC);
  12098.  
  12099.           if (localRSObject1 != null)
  12100.           {
  12101.             a.vE = localRSObject1.getLocation();
  12102.  
  12103.             if (a.l(localRSObject1, "Pull"))
  12104.             {
  12105.               int i1;
  12106.               if (a.calc.distanceTo(a.vE) < 4)
  12107.               {
  12108.                 if ((localRSObject2 != null) && (!a.Y().isMoving()) && (a.calc.distanceBetween(a.X(), a.vE) == 1.0D))
  12109.                 {
  12110.                   a.A(localRSObject2.getLocation(), 1);
  12111.                 }
  12112.                 else
  12113.                 {
  12114.                   a.sleep(50, 100);
  12115.  
  12116.                   i1++;
  12117.                 }
  12118.               }
  12119.               else
  12120.               {
  12121.                 a.l(false);
  12122.  
  12123.                 while ((a.Y().isMoving()) && (a.calc.distanceTo(localRSObject1) > 2)) {
  12124.                   a.sleep(100, 200);
  12125.                 }
  12126.  
  12127.               }
  12128.  
  12129.             }
  12130.             else if (!a.Je)
  12131.             {
  12132.               a.sleep(50, 100);
  12133.             }
  12134.           }
  12135.           a.sleep(50, 100);
  12136.         }
  12137.       }
  12138.     if (a.Je)
  12139.     {
  12140.       a.log("Failed to pull the switches in time, restarting.");
  12141.  
  12142.       a.Je = false;
  12143.  
  12144.       a.i(localRSTile2, 1);
  12145.  
  12146.       a.l(a.vc, 80, 80);
  12147.     }
  12148.     a.K(false);
  12149.  
  12150.     return 1;
  12151.   }
  12152.  
  12153.   private RSTile A(RSTile a, int[] a)
  12154.   {
  12155.     RSObject[] arrayOfRSObject;
  12156.     int i1 = (arrayOfRSObject = a.J(a)).length;
  12157.     int i2;
  12158.     RSObject localRSObject;
  12159.     if ((
  12160.       (localRSObject = arrayOfRSObject[i2]) != null) && (a.l(localRSObject.getID(), a)))
  12161.     {
  12162.       RSTile localRSTile = localRSObject.getLocation();
  12163.  
  12164.       if ((a.calc.distanceBetween(localRSTile, a) > 2.0D) && (a.calc.distanceTo(localRSTile) < 7)) {
  12165.         return localRSTile;
  12166.       }
  12167.  
  12168.     }
  12169.  
  12170.     i2++;
  12171.  
  12172.     return null;
  12173.   }
  12174.  
  12175.   private boolean l(RSModel a, Point a)
  12176.   {
  12177.     Polygon[] arrayOfPolygon;
  12178.     int i1 = (arrayOfPolygon = a.getTriangles()).length;
  12179.     int i2;
  12180.     if (arrayOfPolygon[i2]
  12181.       .contains(a))
  12182.       return true;
  12183.     i2++;
  12184.  
  12185.     return false;
  12186.   }
  12187.  
  12188.   private RSTile F(RSTile a, int[] a)
  12189.   {
  12190.     double d1 = 99999.990000000005D;
  12191.  
  12192.     Object localObject = null;
  12193.     int i2;
  12194.     if (a != null)
  12195.     {
  12196.       RSObject[] arrayOfRSObject;
  12197.       int i1 = (arrayOfRSObject = a.J(a)).length;
  12198.  
  12199.       RSTile localRSTile = arrayOfRSObject[i2]
  12200.         .getLocation();
  12201.  
  12202.       double d2 = a.calc.distanceBetween(localRSTile, a);
  12203.  
  12204.       if (d2 < d1)
  12205.       {
  12206.         d1 = d2;
  12207.  
  12208.         localObject = localRSTile;
  12209.       }
  12210.       i2++;
  12211.     }
  12212.     return localObject;
  12213.   }
  12214.  
  12215.   private boolean l(Combat.Prayer a, boolean a)
  12216.   {
  12217.     a.game.openTab(6);
  12218.  
  12219.     int i1 = a.getIndex();
  12220.  
  12221.     if (a.interfaces.getComponent(271, 7).getComponents().length < 29)
  12222.     {
  12223.       i1 -= 10;
  12224.     }
  12225.     RSComponent localRSComponent;
  12226.     if ((
  12227.       (localRSComponent = a.interfaces.getComponent(271, 7).getComponent(i1)).getBackgroundColor() == -1) == a);
  12228.     return a.l(localRSComponent, a ? "Activate" : "Deactivate");
  12229.   }
  12230.  
  12231.   private boolean A(String a)
  12232.   {
  12233.     int i1;
  12234.     if (a.kd)
  12235.     {
  12236.       if (a.equals(a.yf[i1]))
  12237.       {
  12238.         return a.skills.getRealLevel(18) >= a.CC[i1];
  12239.       }
  12240.       i1++;
  12241.     }
  12242.     return true;
  12243.   }
  12244.  
  12245.   private RSNPC F(String[] a)
  12246.   {
  12247.     if (a.r == null) {
  12248.       return null;
  12249.     }
  12250.  
  12251.     return a.npcs.getNearest(new s(a, a));
  12252.   }
  12253.  
  12254.   private boolean F(RSObject a)
  12255.   {
  12256.     int i2;
  12257.     if (a != null)
  12258.     {
  12259.       RSTile[] arrayOfRSTile;
  12260.       int i1 = (arrayOfRSTile = a.getArea().getTileArray()).length; RSTile localRSTile = arrayOfRSTile[i2];
  12261.  
  12262.       if (a.l(localRSTile, true))
  12263.       {
  12264.         return true;
  12265.       }
  12266.  
  12267.       i2++;
  12268.     }
  12269.     return false;
  12270.   }
  12271.  
  12272.   private int Z()
  12273.   {
  12274.     a.uC = "Undeterminable components";
  12275.  
  12276.     a.SE = "";
  12277.  
  12278.     a.BG = true;
  12279.  
  12280.     a.MC = false;
  12281.  
  12282.     a.vE = null;
  12283.  
  12284.     if (a.jA())
  12285.     {
  12286.       return 2;
  12287.     }
  12288.  
  12289.     if (a.i(a.lC) != null)
  12290.     {
  12291.       a.Qc = "Puzzle room: Agility Maze";
  12292.  
  12293.       if (!a.l.contains(a.r)) {
  12294.         a.l.add(a.r);
  12295.       }
  12296.  
  12297.       if (!a.ZA())
  12298.         return 2;
  12299.       if (a.hd == null)
  12300.       {
  12301.         a.hd = new Timer(a.random(480000, 600000));
  12302.       }
  12303.  
  12304.       return a.y();
  12305.     }
  12306.     if (a.i(a.QE) != null)
  12307.     {
  12308.       a.Qc = "Puzzle room: Barrels";
  12309.  
  12310.       if (!a.l.contains(a.r))
  12311.       {
  12312.         a.l.add(a.r);
  12313.       }
  12314.       if (!a.QB())
  12315.       {
  12316.         return 2;
  12317.       }
  12318.  
  12319.       if (a.hd == null) {
  12320.         a.hd = new Timer(a.random(480000, 600000));
  12321.       }
  12322.  
  12323.       return a.W();
  12324.     }
  12325.  
  12326.     if (a.i(a.Zb) != null)
  12327.     {
  12328.       a.Qc = "Puzzle room: Blood Fountain";
  12329.  
  12330.       if (!a.l.contains(a.r)) {
  12331.         a.l.add(a.r);
  12332.       }
  12333.  
  12334.       if ((!a.QB()) || (!a.ZA())) {
  12335.         return 2;
  12336.       }
  12337.  
  12338.       if (a.hd == null) {
  12339.         a.hd = new Timer(a.random(240000, 300000));
  12340.       }
  12341.  
  12342.       return a.pA();
  12343.     }
  12344.  
  12345.     if (a.i(a.s) != null)
  12346.     {
  12347.       a.Qc = "Puzzle room: Bookcases";
  12348.  
  12349.       if (!a.l.contains(a.r)) {
  12350.         a.l.add(a.r);
  12351.       }
  12352.  
  12353.       if ((!a.QB()) || (!a.ZA())) {
  12354.         return 2;
  12355.       }
  12356.  
  12357.       if (a.hd == null)
  12358.         a.hd = new Timer(a.random(480000, 600000));
  12359.       return a.rA();
  12360.     }
  12361.     if (a.D(a.AC) != null)
  12362.     {
  12363.       a.Qc = "Puzzle room: Colored Ferrets";
  12364.  
  12365.       if (!a.l.contains(a.r))
  12366.       {
  12367.         a.l.add(a.r);
  12368.       }
  12369.       if ((!a.QB()) || (!a.ZA()))
  12370.       {
  12371.         return 2;
  12372.       }
  12373.       if (a.hd == null)
  12374.       {
  12375.         a.hd = new Timer(a.random(480000, 600000));
  12376.       }
  12377.       return a.HA();
  12378.     }
  12379.  
  12380.     if (a.i(a.I) != null)
  12381.     {
  12382.       a.Qc = "Puzzle room: Colored Recesses";
  12383.  
  12384.       if (!a.l.contains(a.r))
  12385.       {
  12386.         a.l.add(a.r);
  12387.       }
  12388.  
  12389.       if ((!a.QB()) || (!a.ZA())) {
  12390.         return 2;
  12391.       }
  12392.  
  12393.       if (a.hd == null) {
  12394.         a.hd = new Timer(a.random(480000, 600000));
  12395.       }
  12396.  
  12397.       return a.qA();
  12398.     }
  12399.     if (a.i(a.Yd) != null)
  12400.     {
  12401.       a.Qc = "Puzzle room: Collapsing Room";
  12402.  
  12403.       if (!a.l.contains(a.r))
  12404.       {
  12405.         a.l.add(a.r);
  12406.  
  12407.         a.lA.add(a.r);
  12408.       }
  12409.       if (a.hd == null) {
  12410.         a.hd = new Timer(a.random(480000, 600000));
  12411.       }
  12412.  
  12413.       return a.QA();
  12414.     }
  12415.  
  12416.     if (a.i(a.Xc) != null)
  12417.     {
  12418.       a.Qc = "Puzzle room: Crystal Lights";
  12419.  
  12420.       if (!a.l.contains(a.r))
  12421.       {
  12422.         a.l.add(a.r);
  12423.       }
  12424.  
  12425.       if ((!a.QB()) || (!a.ZA()))
  12426.         return 2;
  12427.       if (a.hd == null)
  12428.         a.hd = new Timer(a.random(480000, 600000));
  12429.       return a.I();
  12430.     }
  12431.  
  12432.     if (a.J(new String[] { "Damaged Bridge" }) != null)
  12433.     {
  12434.       a.Qc = "Puzzle room: Damaged Bridge";
  12435.  
  12436.       if (!a.l.contains(a.r))
  12437.       {
  12438.         a.l.add(a.r);
  12439.       }
  12440.       if (!a.ZA())
  12441.       {
  12442.         return 2;
  12443.       }
  12444.       return a.q();
  12445.     }
  12446.     if (a.i(new String[] { "Damaged construct" }) != null)
  12447.     {
  12448.       a.Qc = "Puzzle room: Damaged Construct";
  12449.  
  12450.       if (!a.l.contains(a.r))
  12451.       {
  12452.         a.l.add(a.r);
  12453.       }
  12454.       if ((!a.QB()) || (!a.ZA()))
  12455.       {
  12456.         return 2;
  12457.       }
  12458.       if (a.hd == null)
  12459.       {
  12460.         a.hd = new Timer(a.random(480000, 600000));
  12461.       }
  12462.       return a.nA();
  12463.     }
  12464.     if (a.D(new int[] { 11007 }) != null)
  12465.     {
  12466.       a.Qc = "Puzzle room: Fishing for Ferrets";
  12467.  
  12468.       if (!a.l.contains(a.r))
  12469.       {
  12470.         a.l.add(a.r);
  12471.       }
  12472.       if ((!a.QB()) || (!a.ZA())) {
  12473.         return 2;
  12474.       }
  12475.  
  12476.       if (a.hd == null)
  12477.       {
  12478.         a.hd = new Timer(a.random(480000, 600000));
  12479.       }
  12480.  
  12481.       return a.sA();
  12482.     }
  12483.     if (a.J(new String[] { "Green tile" }) != null) if (a.J(new String[] { "Yellow tile" }) != null)
  12484.       {
  12485.         a.Qc = "Puzzle room: Flip Tiles";
  12486.  
  12487.         if (!a.l.contains(a.r))
  12488.         {
  12489.           a.l.add(a.r);
  12490.         }
  12491.  
  12492.         if ((!a.QB()) || (!a.ZA())) {
  12493.           return 2;
  12494.         }
  12495.  
  12496.         if (a.hd == null)
  12497.           a.hd = new Timer(a.random(240000, 300000));
  12498.         return a.D();
  12499.       }
  12500.  
  12501.  
  12502.     if (a.D(a.aF) != null)
  12503.     {
  12504.       a.Qc = "Puzzle room: Follow the Leader";
  12505.  
  12506.       if (!a.l.contains(a.r))
  12507.         a.l.add(a.r);
  12508.       if ((!a.QB()) || (!a.ZA()))
  12509.       {
  12510.         return 2;
  12511.       }
  12512.  
  12513.       if (a.hd == null)
  12514.         a.hd = new Timer(a.random(240000, 300000));
  12515.       return a.KA();
  12516.     }
  12517.  
  12518.     if (a.i(a.eG) != null)
  12519.     {
  12520.       a.Qc = "Puzzle room: Fremennik Camp";
  12521.  
  12522.       if (!a.l.contains(a.r))
  12523.       {
  12524.         a.l.add(a.r);
  12525.       }
  12526.       if (!a.ZA()) {
  12527.         return 2;
  12528.       }
  12529.  
  12530.       if (a.hd == null)
  12531.       {
  12532.         a.hd = new Timer(a.random(240000, 300000));
  12533.       }
  12534.       return a.YA();
  12535.     }
  12536.     if (a.D(a.xC) != null)
  12537.     {
  12538.       a.Qc = "Puzzle room: Ghosts";
  12539.  
  12540.       if (!a.l.contains(a.r)) {
  12541.         a.l.add(a.r);
  12542.       }
  12543.  
  12544.       if (!a.ZA())
  12545.       {
  12546.         return 2;
  12547.       }
  12548.       if (a.hd == null)
  12549.       {
  12550.         a.hd = new Timer(a.random(480000, 600000));
  12551.       }
  12552.  
  12553.       return a.Lb();
  12554.     }
  12555.     if ((a.i(a.mb) != null) || (a.i(a.gA) != null))
  12556.     {
  12557.       a.Qc = "Puzzle room: Grapple Chasm";
  12558.  
  12559.       if (!a.l.contains(a.r)) {
  12560.         a.l.add(a.r);
  12561.       }
  12562.  
  12563.       if (!a.ZA())
  12564.       {
  12565.         return 2;
  12566.       }
  12567.  
  12568.       return a.gA();
  12569.     }
  12570.  
  12571.     if (a.i(new String[] { "hoardstalker" }) != null)
  12572.     {
  12573.       a.Qc = "Puzzle room: Enigmatic Hoardstalker";
  12574.  
  12575.       if (!a.l.contains(a.r))
  12576.         a.l.add(a.r);
  12577.       if ((!a.QB()) || (!a.ZA())) {
  12578.         return 2;
  12579.       }
  12580.  
  12581.       if (a.hd == null) {
  12582.         a.hd = new Timer(a.random(240000, 300000));
  12583.       }
  12584.  
  12585.       return a.FA();
  12586.     }
  12587.     if (a.D(new int[] { 11010 }) != null)
  12588.     {
  12589.       a.Qc = "Puzzle room: Hunter Ferret";
  12590.  
  12591.       if (!a.l.contains(a.r))
  12592.       {
  12593.         a.l.add(a.r);
  12594.       }
  12595.       if ((!a.QB()) || (!a.ZA()))
  12596.       {
  12597.         return 2;
  12598.       }
  12599.       if (a.hd == null)
  12600.       {
  12601.         a.hd = new Timer(a.random(480000, 600000));
  12602.       }
  12603.  
  12604.       return a.m();
  12605.     }
  12606.     if (a.i(a.OC) != null)
  12607.     {
  12608.       a.Qc = "Puzzle room: Icy Pads";
  12609.  
  12610.       if (!a.l.contains(a.r))
  12611.       {
  12612.         a.l.add(a.r);
  12613.       }
  12614.  
  12615.       if (!a.ZA())
  12616.         return 2;
  12617.       if (a.hd == null)
  12618.       {
  12619.         a.hd = new Timer(a.random(480000, 600000));
  12620.       }
  12621.  
  12622.       return a.b();
  12623.     }
  12624.  
  12625.     if (a.i(a.KB) != null)
  12626.     {
  12627.       a.Qc = "Puzzle room: Lodestone Power";
  12628.  
  12629.       if (!a.l.contains(a.r)) {
  12630.         a.l.add(a.r);
  12631.       }
  12632.  
  12633.       if ((!a.QB()) || (!a.ZA()))
  12634.       {
  12635.         return 2;
  12636.       }
  12637.       if (a.hd == null)
  12638.       {
  12639.         a.hd = new Timer(a.random(480000, 600000));
  12640.       }
  12641.       return a.z();
  12642.     }
  12643.  
  12644.     if (a.i(new int[] { 49341 }) != null)
  12645.     {
  12646.       a.Qc = "Puzzle room: Maze";
  12647.  
  12648.       if (!a.l.contains(a.r))
  12649.       {
  12650.         a.l.add(a.r);
  12651.  
  12652.         a.lA.add(a.r);
  12653.  
  12654.         a.cD.add(a.r);
  12655.       }
  12656.  
  12657.       if (a.hd == null) {
  12658.         a.hd = new Timer(a.random(240000, 300000));
  12659.       }
  12660.  
  12661.       return a.TA();
  12662.     }
  12663.     if (a.i(new String[] { "Mercenary leader" }) != null)
  12664.     {
  12665.       a.Qc = "Puzzle room: Mercenary Leader";
  12666.  
  12667.       if (!a.l.contains(a.r))
  12668.         a.l.add(a.r);
  12669.       if (!a.ZA())
  12670.       {
  12671.         return 2;
  12672.       }
  12673.  
  12674.       if (a.hd == null)
  12675.         a.hd = new Timer(a.random(480000, 600000));
  12676.       return a.NA();
  12677.     }
  12678.  
  12679.     if (a.i(new String[] { "Monolith" }) != null)
  12680.     {
  12681.       a.Qc = "Puzzle room: Monolith";
  12682.  
  12683.       if (!a.l.contains(a.r))
  12684.         a.l.add(a.r);
  12685.       if (!a.ZA())
  12686.       {
  12687.         return 2;
  12688.       }
  12689.       if (a.hd == null) {
  12690.         a.hd = new Timer(a.random(480000, 600000));
  12691.       }
  12692.  
  12693.       return a.B();
  12694.     }
  12695.  
  12696.     if (a.i(a.wd) != null)
  12697.     {
  12698.       a.Qc = "Puzzle room: Poltergeist";
  12699.  
  12700.       if (!a.l.contains(a.r))
  12701.       {
  12702.         a.l.add(a.r);
  12703.       }
  12704.  
  12705.       if ((!a.QB()) || (!a.ZA()))
  12706.         return 2;
  12707.       if (a.hd == null)
  12708.       {
  12709.         a.hd = new Timer(a.random(240000, 300000));
  12710.       }
  12711.  
  12712.       return a.p();
  12713.     }
  12714.     if (a.D(new int[] { 12089 }) != null)
  12715.     {
  12716.       a.Qc = "Puzzle room: Pond Skaters";
  12717.  
  12718.       if (!a.l.contains(a.r))
  12719.       {
  12720.         a.l.add(a.r);
  12721.       }
  12722.       if ((!a.QB()) || (!a.ZA()))
  12723.       {
  12724.         return 2;
  12725.       }
  12726.       a.hd = new Timer(a.random(240000, 300000));
  12727.  
  12728.       return a.hA();
  12729.     }
  12730.  
  12731.     if (a.i(new String[] { "bloodrager" }) != null)
  12732.     {
  12733.       a.Qc = "Puzzle room: Ramokee Familiars";
  12734.  
  12735.       if (!a.l.contains(a.r))
  12736.       {
  12737.         a.l.add(a.r);
  12738.       }
  12739.       if (a.hd == null)
  12740.         a.hd = new Timer(a.random(480000, 600000));
  12741.       return a.J();
  12742.     }
  12743.     if (a.i(new String[] { "Seeker sentinel" }) != null)
  12744.     {
  12745.       a.Qc = "Puzzle room: Seeker Sentinel";
  12746.  
  12747.       if (!a.l.contains(a.r))
  12748.       {
  12749.         a.l.add(a.r);
  12750.  
  12751.         a.lA.add(a.r);
  12752.       }
  12753.       if (a.hd == null) {
  12754.         a.hd = new Timer(a.random(240000, 300000));
  12755.       }
  12756.  
  12757.       return a.E();
  12758.     }
  12759.     if (a.i(a.mB) != null)
  12760.     {
  12761.       a.Qc = "Puzzle room: Sleeping Guards";
  12762.  
  12763.       if (!a.l.contains(a.r))
  12764.       {
  12765.         a.l.add(a.r);
  12766.       }
  12767.       if (!a.ZA())
  12768.       {
  12769.         return 2;
  12770.       }
  12771.       if (a.hd == null)
  12772.         a.hd = new Timer(a.random(480000, 600000));
  12773.       return a.v();
  12774.     }
  12775.  
  12776.     if (a.D(a.d) != null)
  12777.     {
  12778.       a.Qc = "Puzzle room: Slider Puzzle";
  12779.  
  12780.       if (!a.l.contains(a.r))
  12781.       {
  12782.         a.l.add(a.r);
  12783.       }
  12784.       if ((!a.QB()) || (!a.ZA())) {
  12785.         return 2;
  12786.       }
  12787.  
  12788.       if (a.hd == null) {
  12789.         a.hd = new Timer(a.random(240000, 300000));
  12790.       }
  12791.  
  12792.       return a.yA();
  12793.     }
  12794.  
  12795.     if (a.D(a.fb) != null)
  12796.     {
  12797.       a.Qc = "Puzzle room: Sliding Statues";
  12798.  
  12799.       if (!a.l.contains(a.r))
  12800.       {
  12801.         a.l.add(a.r);
  12802.       }
  12803.  
  12804.       if (!a.QB()) {
  12805.         return 2;
  12806.       }
  12807.  
  12808.       if (a.hd == null) {
  12809.         a.hd = new Timer(a.random(480000, 600000));
  12810.       }
  12811.  
  12812.       return a.xA();
  12813.     }
  12814.     if (a.i(a.Gb) != null)
  12815.     {
  12816.       a.Qc = "Puzzle room: Statue Bridge";
  12817.  
  12818.       if (!a.l.contains(a.r))
  12819.       {
  12820.         a.l.add(a.r);
  12821.       }
  12822.       if (!a.ZA()) {
  12823.         return 2;
  12824.       }
  12825.  
  12826.       return a.c();
  12827.     }
  12828.  
  12829.     if (a.i(a.LD) != null)
  12830.     {
  12831.       a.Qc = "Puzzle room: Strange Flowers";
  12832.  
  12833.       if (!a.l.contains(a.r))
  12834.       {
  12835.         a.l.add(a.r);
  12836.       }
  12837.  
  12838.       if (a.hd == null) {
  12839.         a.hd = new Timer(a.random(480000, 600000));
  12840.       }
  12841.  
  12842.       return a.o();
  12843.     }
  12844.  
  12845.     if (a.i(a.Bb) != null)
  12846.     {
  12847.       a.Qc = "Puzzle room: Suspicious Grooves";
  12848.  
  12849.       if (!a.l.contains(a.r))
  12850.       {
  12851.         a.l.add(a.r);
  12852.  
  12853.         a.lA.add(a.r);
  12854.       }
  12855.  
  12856.       if (a.hd == null)
  12857.         a.hd = new Timer(a.random(240000, 300000));
  12858.       return a.RA();
  12859.     }
  12860.  
  12861.     if (a.D(a.TB) != null)
  12862.     {
  12863.       a.Qc = "Puzzle room: Ten Statues";
  12864.  
  12865.       if (!a.l.contains(a.r))
  12866.       {
  12867.         a.l.add(a.r);
  12868.       }
  12869.       if ((!a.QB()) || (!a.ZA()))
  12870.       {
  12871.         return 2;
  12872.       }
  12873.       if (a.hd == null)
  12874.       {
  12875.         a.hd = new Timer(a.random(480000, 600000));
  12876.       }
  12877.  
  12878.       return a.U();
  12879.     }
  12880.     if (a.D(a.yb) != null)
  12881.     {
  12882.       a.Qc = "Puzzle room: Three Statues";
  12883.  
  12884.       if (!a.l.contains(a.r)) {
  12885.         a.l.add(a.r);
  12886.       }
  12887.  
  12888.       if ((!a.QB()) || (!a.ZA()))
  12889.         return 2;
  12890.       if (a.hd == null)
  12891.       {
  12892.         a.hd = new Timer(a.random(240000, 300000));
  12893.       }
  12894.       return a.WA();
  12895.     }
  12896.  
  12897.     if (a.i(a.sC) != null)
  12898.     {
  12899.       a.Qc = "Puzzle room: Timed Switches";
  12900.  
  12901.       if (!a.l.contains(a.r))
  12902.       {
  12903.         a.l.add(a.r);
  12904.       }
  12905.  
  12906.       if ((!a.QB()) || (!a.ZA()))
  12907.       {
  12908.         return 2;
  12909.       }
  12910.       if (a.hd == null) {
  12911.         a.hd = new Timer(a.random(480000, 600000));
  12912.       }
  12913.  
  12914.       return a.P();
  12915.     }
  12916.  
  12917.     if (a.J(new String[] { "Unfinished bridge" }) != null)
  12918.     {
  12919.       a.Qc = "Puzzle room: Unfinished Bridge";
  12920.  
  12921.       if (!a.l.contains(a.r)) {
  12922.         a.l.add(a.r);
  12923.       }
  12924.  
  12925.       if (!a.ZA()) {
  12926.         return 2;
  12927.       }
  12928.  
  12929.       return a.eA();
  12930.     }
  12931.     if (a.D(new int[] { 11246 }) != null)
  12932.     {
  12933.       a.Qc = "Puzzle room: Unhappy Ghost";
  12934.  
  12935.       if (!a.l.contains(a.r)) {
  12936.         a.l.add(a.r);
  12937.       }
  12938.  
  12939.       if ((!a.QB()) || (!a.ZA()))
  12940.       {
  12941.         return 2;
  12942.       }
  12943.       if (a.hd == null)
  12944.       {
  12945.         a.hd = new Timer(a.random(240000, 300000));
  12946.       }
  12947.       return a.G();
  12948.     }
  12949.  
  12950.     if (a.i(a.Fc) != null)
  12951.     {
  12952.       a.Qc = "Puzzle room: Winch Bridge";
  12953.  
  12954.       if (!a.l.contains(a.r))
  12955.       {
  12956.         a.l.add(a.r);
  12957.       }
  12958.  
  12959.       if (!a.ZA())
  12960.       {
  12961.         return 2;
  12962.       }
  12963.       return a.OA();
  12964.     }
  12965.  
  12966.     return 0;
  12967.   }
  12968.  
  12969.   private void s()
  12970.   {
  12971.     a.Qc = "Completing the dungeon...";
  12972.  
  12973.     a.vE = null;
  12974.     RSObject localRSObject;
  12975.     if (
  12976.       (localRSObject = a.objects.getNearest(a.gb)) != null)
  12977.     {
  12978.       a.vE = localRSObject.getLocation();
  12979.  
  12980.       a.log("Exit found, completing dungeon.");
  12981.  
  12982.       a.HD = null;
  12983.  
  12984.       a.hA.reset();
  12985.  
  12986.       if (a.nb == null) {
  12987.         a.nb = a.r;
  12988.       }
  12989.  
  12990.       if (!a.interfaces.get(933).isValid())
  12991.       {
  12992.         if (a.jA()) {
  12993.           return;
  12994.         }
  12995.  
  12996.         if (localRSObject != null)
  12997.         {
  12998.           if (a.nb.contains(new RSTile[] { localRSObject.getLocation() }));
  12999.         }
  13000.         else if ((localRSObject = a.i(a.gb)) == null)
  13001.         {
  13002.           localRSObject = a.G(a.vE);
  13003.         }
  13004.         int i1;
  13005.         if (a.jD)
  13006.         {
  13007.           a.R();
  13008.  
  13009.           a.t();
  13010.  
  13011.           a.jD = false;
  13012.         }
  13013.         else if (!a.interfaces.get(236).isValid())
  13014.         {
  13015.           if (localRSObject != null)
  13016.           {
  13017.             if (a.calc.distanceTo(localRSObject) < 3) {
  13018.               a.A(localRSObject.getLocation(), 0);
  13019.             }
  13020.  
  13021.             if (a.l(localRSObject, "End-dungeon"))
  13022.             {
  13023.               a.K(true);
  13024.             }
  13025.             else
  13026.             {
  13027.               a.sleep(400, 600);
  13028.             }
  13029.           }
  13030.         }
  13031.         else
  13032.         {
  13033.           a.interfaces.getComponent(236, 1).doClick();
  13034.  
  13035.           a.sleep(200, 300);
  13036.  
  13037.           i1++;
  13038.         }
  13039.         a.sleep(200, 300);
  13040.       }
  13041.       a.Qc = "Waiting for the next dungeon...";
  13042.  
  13043.       a.pC += 1;
  13044.  
  13045.       a.Ud += 1;
  13046.  
  13047.       a.OA += 1;
  13048.       long l1;
  13049.       if (
  13050.         (l1 = a.sA.getElapsed()) < a.HB)
  13051.       {
  13052.         if (a.dd == 0L)
  13053.         {
  13054.           long l2 = a.HB;
  13055.  
  13056.           String str1 = a.Xf;
  13057.  
  13058.           a.dd = l2;
  13059.  
  13060.           a.fd = str1;
  13061.         }
  13062.  
  13063.         a.HB = l1;
  13064.  
  13065.         a.Xf = a.sA.toElapsedString();
  13066.       }
  13067.       else if (l1 > a.dd)
  13068.       {
  13069.         a.dd = l1;
  13070.  
  13071.         a.fd = a.sA.toElapsedString();
  13072.       }
  13073.       a.tE = (Math.rint(a.z.getElapsed() * 10L / a.pC / 60000L) / 10.0D);
  13074.  
  13075.       int i2 = (int)(l1 / 1000L);
  13076.  
  13077.       int i3 = a.re - a.eD;
  13078.  
  13079.       a.eD = a.re;
  13080.  
  13081.       a.T();
  13082.  
  13083.       a.ad();
  13084.  
  13085.       if (((a.interfaces.get(519).isValid()) && (a.interfaces.get(519).getText().toLowerCase().contains("not available at"))) || (a.Ud > a.g))
  13086.       {
  13087.         a.log("Last floor reached, prestiging!");
  13088.  
  13089.         if (a.OA + 3 >= a.g)
  13090.         {
  13091.           a.JE = true;
  13092.         }
  13093.         a.nc = true;
  13094.       }
  13095.       int i4 = a.Td; int i5 = 0; int i6 = 0;
  13096.  
  13097.       if (a.interfaces.get(933).isValid())
  13098.       {
  13099.         RSNPC localRSNPC;
  13100.         if ((
  13101.           (localRSNPC = a.npcs.getNearest(new int[] { 11226 })) == null) || (a.calc.distanceTo(localRSNPC) >= 4))
  13102.         {
  13103.           if (a.interfaces.getComponent(933, 13).doClick())
  13104.           {
  13105.             a.sleep(200, 400);
  13106.  
  13107.             a.ad();
  13108.  
  13109.             a.interfaces.getComponent(933, 13).doClick();
  13110.           }
  13111.           int i7;
  13112.           if (a.interfaces.getComponent(933, 322).doClick())
  13113.           {
  13114.             a.sleep(700, 900);
  13115.  
  13116.             if (a.Td == i4)
  13117.             {
  13118.               String str2 = a.interfaces.getComponent(933, 41).getText().replace("%", "").trim();
  13119.  
  13120.               String str3 = a.interfaces.getComponent(933, 39).getText().replace("%", "").trim();
  13121.  
  13122.               if (!str2.isEmpty())
  13123.               {
  13124.                 i5 = Integer.parseInt(str2);
  13125.               }
  13126.  
  13127.               if (!str3.isEmpty())
  13128.                 i6 = Integer.parseInt(str3);
  13129.               a.Td += i5;
  13130.  
  13131.               if ((i2 > 0) && (i6 > 0) && (i5 > 0))
  13132.               {
  13133.                 a.l(i2, i6, i5, i3);
  13134.               }
  13135.               else
  13136.               {
  13137.                 a.log("Stat uploading failed!");
  13138.               }
  13139.             }
  13140.             a.camera.setCompass('n');
  13141.  
  13142.             if (a.interfaces.get(933).isValid())
  13143.             {
  13144.               a.sleep(300, 400);
  13145.  
  13146.               i7++;
  13147.             }
  13148.           }
  13149.           else
  13150.           {
  13151.             a.sleep(100, 200);
  13152.           }
  13153.         }
  13154.       }
  13155.       if (a.jA())
  13156.       {
  13157.         return;
  13158.       }
  13159.  
  13160.       a.N = true;
  13161.     }
  13162.   }
  13163.  
  13164.   private boolean l(int a, int a, int a)
  13165.   {
  13166.     return (a >= a) && (a <= a);
  13167.   }
  13168.  
  13169.   private RSObject l(int[] a)
  13170.   {
  13171.     return a.objects.getNearest(new o(a, a));
  13172.   }
  13173.  
  13174.   private int F(String a)
  13175.   {
  13176.     int i1;
  13177.     if ((a != null) && (!a.isEmpty()))
  13178.     {
  13179.       String str = a.J(a);
  13180.  
  13181.       if (a.Ec[i1].equals(str)) {
  13182.         return i1 + 1;
  13183.       }
  13184.  
  13185.       i1++;
  13186.  
  13187.       if (a.yA != null)
  13188.       {
  13189.         if (a.yA[i1].equals(str)) {
  13190.           return i1 + 1;
  13191.         }
  13192.  
  13193.         i1++;
  13194.       }
  13195.     }
  13196.     return 0;
  13197.   }
  13198.  
  13199.   private int o()
  13200.   {
  13201.     if (!a.O())
  13202.       return -1;
  13203.     int[] arrayOfInt = { 35507, 35523, 35562, 35569 };
  13204.  
  13205.     String[] arrayOfString = { "blue", "purple", "red", "yellow" };
  13206.  
  13207.     if (a.jA())
  13208.     {
  13209.       return 2;
  13210.     }
  13211.     if (!a.j())
  13212.     {
  13213.       return -1;
  13214.     }
  13215.  
  13216.     RSObject localRSObject1 = a.i(a.LD);
  13217.  
  13218.     a.l(a.vc, 40, 50);
  13219.  
  13220.     a.jA = a.npcs.getNearest(a.B);
  13221.     int i2;
  13222.     if ((a.jA != null) && (a.calc.distanceTo(a.jA) < 5) && (a.l(a.jA.getLocation(), false)))
  13223.     {
  13224.       if (!a.QB())
  13225.       {
  13226.         return 2;
  13227.       }
  13228.  
  13229.     }
  13230.     else if (localRSObject1 != null) {
  13231.       if (a.Jg)
  13232.       {
  13233.         a.x();
  13234.  
  13235.         a.K(true);
  13236.  
  13237.         a.sleep(500, 800);
  13238.  
  13239.         a.l(localRSObject1.getLocation(), 1);
  13240.  
  13241.         a.Jg = false;
  13242.       }
  13243.       else if (a.F(localRSObject1))
  13244.       {
  13245.         if (a.l(localRSObject1, "Uproot"))
  13246.         {
  13247.           a.K(true);
  13248.         }
  13249.       }
  13250.       else
  13251.       {
  13252.         int i1 = localRSObject1.getID();
  13253.  
  13254.         if ((i2 = 0) < arrayOfInt.length)
  13255.         {
  13256.           if (i1 == arrayOfInt[i2])
  13257.           {
  13258.             String str = arrayOfString[i2];
  13259.             RSObject localRSObject2;
  13260.             if (
  13261.               (localRSObject2 = a.l(new String[] { "Strange " + str + " plant" })) != null) {
  13262.               a.K(true);
  13263.             }
  13264.             else
  13265.             {
  13266.               a.JC();
  13267.             }
  13268.           }
  13269.           else
  13270.           {
  13271.             i2++;
  13272.           }
  13273.  
  13274.         }
  13275.  
  13276.       }
  13277.  
  13278.     }
  13279.  
  13280.     a.sleep(400, 800);
  13281.  
  13282.     return 1;
  13283.   }
  13284.  
  13285.   private boolean O()
  13286.   {
  13287.     if (!a.kd)
  13288.     {
  13289.       a.uC = "Members-only";
  13290.  
  13291.       return false;
  13292.     }
  13293.     return true;
  13294.   }
  13295.  
  13296.   private int z()
  13297.   {
  13298.     int[] arrayOfInt1 = { 17376, 18635 };
  13299.  
  13300.     int[] arrayOfInt2 = { 50795, 51889, 54844 };
  13301.  
  13302.     RSTile[] arrayOfRSTile = null;
  13303.  
  13304.     RSTile localRSTile1 = a.tA(); RSTile localRSTile2 = null;
  13305.     RSObject localRSObject1;
  13306.     if ((localRSObject1 = a.i(a.KB)) == null)
  13307.     {
  13308.       return -1;
  13309.     }
  13310.  
  13311.     RSTile localRSTile3 = localRSObject1.getLocation();
  13312.     int i2;
  13313.     if (localRSTile1.getX() - localRSTile3.getX() > 4)
  13314.     {
  13315.       if (
  13316.         (localRSTile2 = a.F(new RSTile(20000, 20000), arrayOfInt2)) == null) {
  13317.         return -1;
  13318.       }
  13319.  
  13320.       i1 = localRSTile2.getX(); i2 = localRSTile2.getY();
  13321.  
  13322.       arrayOfRSTile = new RSTile[] { new RSTile(i1 - 1, i2), new RSTile(i1 - 2, i2 - 1), new RSTile(i1 - 2, i2 - 3), new RSTile(i1 - 2, i2 - 5), new RSTile(i1 - 3, i2 - 6), new RSTile(i1 - 5, i2 - 6), new RSTile(i1 - 8, i2 - 3) };
  13323.     }
  13324.     else if (localRSTile1.getX() - localRSTile3.getX() < -4)
  13325.     {
  13326.       if (
  13327.         (localRSTile2 = a.F(new RSTile(20000, 0), arrayOfInt2)) == null)
  13328.         return -1;
  13329.       i1 = localRSTile2.getX(); i2 = localRSTile2.getY();
  13330.  
  13331.       arrayOfRSTile = new RSTile[] { new RSTile(i1 + 1, i2), new RSTile(i1 + 2, i2 + 1), new RSTile(i1 + 2, i2 + 3), new RSTile(i1 + 2, i2 + 5), new RSTile(i1 + 3, i2 + 6), new RSTile(i1 + 5, i2 + 6), new RSTile(i1 + 8, i2 + 3) };
  13332.     }
  13333.     else if (localRSTile1.getY() - localRSTile3.getY() < -4)
  13334.     {
  13335.       if (
  13336.         (localRSTile2 = a.F(new RSTile(20000, 0), arrayOfInt2)) == null)
  13337.         return -1;
  13338.       i1 = localRSTile2.getX(); i2 = localRSTile2.getY();
  13339.  
  13340.       arrayOfRSTile = new RSTile[] { new RSTile(i1, i2 + 1), new RSTile(i1 - 1, i2 + 2), new RSTile(i1 - 3, i2 + 2), new RSTile(i1 - 5, i2 + 2), new RSTile(i1 - 6, i2 + 3), new RSTile(i1 - 6, i2 + 5), new RSTile(i1 - 3, i2 + 8) };
  13341.     }
  13342.     else if (localRSTile1.getY() - localRSTile3.getY() > 4)
  13343.     {
  13344.       if ((localRSTile2 = a.F(a.y, arrayOfInt2)) == null)
  13345.       {
  13346.         return -1;
  13347.       }
  13348.       i1 = localRSTile2.getX(); i2 = localRSTile2.getY();
  13349.  
  13350.       arrayOfRSTile = new RSTile[] { new RSTile(i1, i2 - 1), new RSTile(i1 + 1, i2 - 2), new RSTile(i1 + 3, i2 - 2), new RSTile(i1 + 5, i2 - 2), new RSTile(i1 + 6, i2 - 3), new RSTile(i1 + 6, i2 - 5), new RSTile(i1 + 3, i2 - 8) };
  13351.     }
  13352.     a.A(new int[] { 18829 });
  13353.  
  13354.     int i1 = 0;
  13355.  
  13356.     if (a.jA())
  13357.     {
  13358.       if ((!a.hd.isRunning()) && (a.l.contains(a.r)))
  13359.       {
  13360.         a.lA.add(a.r);
  13361.       }
  13362.  
  13363.       return 2;
  13364.     }
  13365.     a.l(a.vc, 50, 50);
  13366.  
  13367.     if (!a.inventory.containsOneOf(arrayOfInt1))
  13368.     {
  13369.       a.l(a.groundItems.getNearest(arrayOfInt1));
  13370.     }
  13371.     else
  13372.     {
  13373.       RSObject localRSObject2 = null;
  13374.  
  13375.       if (i1 != 0) if (a.i(new String[] { "Guardian sphere" }) == null)
  13376.           i1 = 0;
  13377.       Object localObject1;
  13378.       if (i1 != 0)
  13379.       {
  13380.         double d1 = 10.0D;
  13381.  
  13382.         if (
  13383.           (localObject1 = a.i(arrayOfInt2)) != null)
  13384.         {
  13385.           RSTile localRSTile4 = ((RSObject)localObject1).getLocation();
  13386.  
  13387.           int i4 = (localObject2 = a.h(a.X())).length;
  13388.           int i5;
  13389.           RSTile localRSTile5 = localObject2[i5];
  13390.           double d2;
  13391.           if ((d2 = a.calc.distanceBetween(localRSTile5, localRSTile4)) <
  13392.             d1)
  13393.           {
  13394.             d1 = d2;
  13395.  
  13396.             a.vE = localRSTile5;
  13397.           }
  13398.  
  13399.           i5++;
  13400.  
  13401.           Object localObject2 = a.G(a.vE);
  13402.  
  13403.           if (a.l((RSObject)localObject2, "Jump-over"))
  13404.           {
  13405.             a.K(true);
  13406.           }
  13407.  
  13408.         }
  13409.  
  13410.       }
  13411.       else
  13412.       {
  13413.         String str = "Jump-over";
  13414.  
  13415.         a.vE = null;
  13416.         int i3;
  13417.         if (a.l(localRSTile3, true))
  13418.         {
  13419.           localObject1 = arrayOfRSTile[i3];
  13420.  
  13421.           if (a.calc.distanceTo((RSTile)localObject1) == 1)
  13422.           {
  13423.             if ((i3 == 5) && ((a.calc.distanceBetween(a.X(), localRSObject1.getLocation()) < 4.5D) || (a.F(localRSObject1))))
  13424.             {
  13425.               localObject1 = arrayOfRSTile[(i3 + 1)];
  13426.  
  13427.               str = "Unlock";
  13428.             }
  13429.  
  13430.             a.vE = ((RSTile)localObject1);
  13431.  
  13432.             localRSObject2 = a.G((RSTile)localObject1);
  13433.           }
  13434.  
  13435.           i3++;
  13436.         }
  13437.         if (localRSObject2 != null)
  13438.         {
  13439.           if (a.l(localRSObject2, str))
  13440.           {
  13441.             switch (a.Y().getAnimation())
  13442.             {
  13443.             case 769:
  13444.               break;
  13445.             case 846:
  13446.               i1 = 1;
  13447.  
  13448.               break;
  13449.             case 13493:
  13450.               while (0 != 0);
  13451.               a.log("Damn, we got hit by the orb");
  13452.  
  13453.               break;
  13454.             default:
  13455.               a.sleep(200, 300);
  13456.  
  13457.               i3++;
  13458.             }
  13459.  
  13460.             a.K(true);
  13461.           }
  13462.         }
  13463.         else if (!a.X().equals(localRSTile2))
  13464.         {
  13465.           a.A(localRSTile2, 0);
  13466.  
  13467.           a.K(false);
  13468.         }
  13469.  
  13470.       }
  13471.  
  13472.     }
  13473.  
  13474.     a.sleep(400, 600);
  13475.  
  13476.     return !a.l() ? 2 : 1;
  13477.   }
  13478.  
  13479.   public void messageReceived(MessageEvent a)
  13480.   {
  13481.     int i1 = a.getID();
  13482.  
  13483.     String str = a.getMessage();
  13484.  
  13485.     if (i1 == 0)
  13486.     {
  13487.       if (str.contains("Oh dear")) {
  13488.         a.jC = true;
  13489.       }
  13490.       else if (str.contains("ou unlock the door"))
  13491.       {
  13492.         a.Hc = true;
  13493.       }
  13494.       else if ((str.contains("been frozen")) || (str.contains("force prevents")) || (str.contains("force stops")) || (str.contains("You're stunned"))) {
  13495.         a.MC = true;
  13496.       }
  13497.       else if ((str.contains("hear a click")) || (str.contains("now unlocked")) || (str.contains("act of simply")) || (str.contains("challenge room has already")))
  13498.       {
  13499.         a.KD = true;
  13500.       }
  13501.       else if (str.contains("cannot teleport"))
  13502.       {
  13503.         a.Ke = true;
  13504.       }
  13505.       else if (((str.contains("You need a")) || (str.contains("require a"))) && (str.contains("level of")))
  13506.         a.BG = false;
  13507.       else if ((str.contains("need at least ")) && (str.contains("to do that")))
  13508.         a.BG = false;
  13509.       else if (str.contains("toggle back off"))
  13510.       {
  13511.         a.Je = true;
  13512.       }
  13513.       else if (str.contains("both the chest in"))
  13514.       {
  13515.         a.IC = true;
  13516.       }
  13517.       else if (str.contains("cut down the flower"))
  13518.       {
  13519.         a.Jg = true;
  13520.       }
  13521.       else if (str.contains("received item: "))
  13522.       {
  13523.         a.jD = true;
  13524.       }
  13525.       else if ((a.HC == 2) && (str.contains("ammo left in")))
  13526.         a.WC = true;
  13527.       else if ((a.HC == 3) && (a.k()) && (str.contains("runes to cast ")))
  13528.       {
  13529.         a.WC = true;
  13530.       }
  13531.       else if (str.contains(" pull")) {
  13532.         a.md = true;
  13533.       }
  13534.  
  13535.     }
  13536.     else if ((i1 == 4) && (str.contains("can't reach")))
  13537.       a.MC = true;
  13538.     if ((i1 == 0) || (i1 == 28) || (i1 == 109))
  13539.     {
  13540.       a.SE = str;
  13541.     }
  13542.   }
  13543.  
  13544.   private boolean n()
  13545.   {
  13546.     if ((a.Nc.size() == 1) || (a.inventory.contains(18829))) {
  13547.       return true;
  13548.     }
  13549.  
  13550.     a.AB = "Teleporting back...";
  13551.  
  13552.     a.qA.clear();
  13553.  
  13554.     if (a.AA())
  13555.     {
  13556.       a.Pd += 1;
  13557.  
  13558.       a.sleep(200, 300);
  13559.     }
  13560.  
  13561.     a.uA();
  13562.  
  13563.     a.jC = false;
  13564.  
  13565.     if (a.groundItems.getNearest(new int[] { 18829 }) != null);
  13566.     if (a.Zc())
  13567.     {
  13568.       return false;
  13569.     }
  13570.     if (a.fA()) {
  13571.       a.K(false);
  13572.     }
  13573.  
  13574.     a.sleep(300, 400);
  13575.  
  13576.     a.uA();
  13577.     int i1;
  13578.     if ((i1 = 0) < 10)
  13579.     {
  13580.       if (a.l(a.groundItems.getNearest(new int[] { 18829 })))
  13581.       {
  13582.         a.sleep(500, 800);
  13583.       }
  13584.       a.sleep(300, 600);
  13585.  
  13586.       i1++;
  13587.     }
  13588.  
  13589.     a.jC = false;
  13590.  
  13591.     a.AB = "";
  13592.  
  13593.     return true;
  13594.   }
  13595.  
  13596.   private int v()
  13597.   {
  13598.     if (!a.EB.contains(Integer.valueOf(17363))) {
  13599.       a.EB.add(Integer.valueOf(17363));
  13600.     }
  13601.  
  13602.     if (a.jA())
  13603.     {
  13604.       return 2;
  13605.     }
  13606.  
  13607.     a.yd = a.groundItems.getNearest(new int[] { 17363 });
  13608.  
  13609.     if (a.yd != null)
  13610.     {
  13611.       a.l(a.yd);
  13612.     }
  13613.     else if (a.npcs.getNearest(a.B) == null)
  13614.     {
  13615.       a.A(a.r.getCentralTile(), 1);
  13616.  
  13617.       a.K(false);
  13618.     }
  13619.     else if (!a.QB())
  13620.     {
  13621.       return 2;
  13622.     }
  13623.     a.K(false);
  13624.  
  13625.     return 1;
  13626.   }
  13627.  
  13628.   private RSTile l(int[][] a)
  13629.   {
  13630.     RSTile[] arrayOfRSTile;
  13631.     int i1 = (arrayOfRSTile = a.r.getTileArray()).length;
  13632.     int i2;
  13633.     RSTile localRSTile = arrayOfRSTile[i2];
  13634.  
  13635.     int i3 = 0;
  13636.     RSObject[] arrayOfRSObject;
  13637.     int i4 = (arrayOfRSObject = a.objects.getAllAt(localRSTile)).length;
  13638.     int i5;
  13639.     RSObject localRSObject = arrayOfRSObject[i5];
  13640.     int[][] arrayOfInt;
  13641.     int i6 = (arrayOfInt = a).length;
  13642.     int i7;
  13643.     int[] arrayOfInt1 = arrayOfInt[i7];
  13644.  
  13645.     if (a.l(localRSObject.getID(), arrayOfInt1))
  13646.     {
  13647.       i3++;
  13648.     }
  13649.     else {
  13650.       i7++;
  13651.     }
  13652.  
  13653.     i5++;
  13654.  
  13655.     if (i3 == a.length)
  13656.       return localRSTile;
  13657.     i2++;
  13658.  
  13659.     return null;
  13660.   }
  13661.  
  13662.   private int U()
  13663.   {
  13664.     int[] arrayOfInt1 = { 11015, 11016, 11017 };
  13665.  
  13666.     int[] arrayOfInt2 = { 11012, 11013, 11014 };
  13667.  
  13668.     int[] arrayOfInt3 = { 11027, 11028, 11029 };
  13669.  
  13670.     int[] arrayOfInt4 = { 11030, 11031, 11032 };
  13671.  
  13672.     int[] arrayOfInt5 = { 11033, 11034, 11035 };
  13673.  
  13674.     int[][] arrayOfInt = { arrayOfInt3, arrayOfInt4, arrayOfInt5 };
  13675.  
  13676.     RSObject localRSObject = a.i(new int[] { 49647, 49648, 49649, 53991 });
  13677.  
  13678.     int i1 = a.F(arrayOfInt3).length;
  13679.  
  13680.     int i2 = a.F(arrayOfInt4).length;
  13681.  
  13682.     int i3 = a.F(arrayOfInt5).length;
  13683.     do
  13684.     {
  13685.       if (a.jA())
  13686.       {
  13687.         return 2;
  13688.       }
  13689.       if (!a.j()) {
  13690.         return -1;
  13691.       }
  13692.  
  13693.       if (a.l(a.vc, 40, 50))
  13694.         a.sleep(300, 600);
  13695.       Object localObject1;
  13696.       if (a.inventory.getCount(new int[] { 17416, 17418, 17420 }) < a.F(arrayOfInt2).length)
  13697.       {
  13698.         localObject1 = "";
  13699.  
  13700.         if (!a.inventory.contains(17444))
  13701.         {
  13702.           a.l(a.groundItems.getNearest(new int[] { 17444 }));
  13703.         }
  13704.         else
  13705.         {
  13706.           if (a.inventory.getCount(new int[] { 17420 }) < i1)
  13707.             localObject1 = "Staff";
  13708.           else if (a.inventory.getCount(new int[] { 17416 }) < i2) {
  13709.             localObject1 = "Sword";
  13710.           }
  13711.           else if (a.inventory.getCount(new int[] { 17418 }) < i3) {
  13712.             localObject1 = "Bow";
  13713.           }
  13714.  
  13715.           if (a.interfaces.get(451).isValid())
  13716.           {
  13717.             a.l(a.interfaces.get(451), new String[] { localObject1 });
  13718.           }
  13719.           else if (a.inventory.contains(17415))
  13720.           {
  13721.             if (a.inventory.getItem(new int[] { 17415 }).doAction("Carve")) {
  13722.               a.K(true);
  13723.             }
  13724.  
  13725.           }
  13726.           else if (a.l(localRSObject, "Mine"))
  13727.           {
  13728.             a.K(true);
  13729.           }
  13730.  
  13731.         }
  13732.  
  13733.       }
  13734.       else if (
  13735.         (localObject1 = a.D(arrayOfInt2)) != null)
  13736.       {
  13737.         RSNPC localRSNPC = null;
  13738.  
  13739.         a.vE = ((RSNPC)localObject1).getLocation();
  13740.  
  13741.         int i4 = a.vE.getX(); int i5 = a.vE.getY();
  13742.  
  13743.         Object localObject2 =
  13744.           { new RSTile(i4 - 4, i5), new RSTile(i4 + 4, i5), new RSTile(i4, i5 - 4), new RSTile(i4, i5 + 4) };
  13745.  
  13746.         int i6 = localObject2.length; int i7 = 0; if (i7 < i6) { RSTile localRSTile = localObject2[i7];
  13747.  
  13748.           localRSNPC = a.D(localRSTile);
  13749.  
  13750.           if (localRSNPC != null)
  13751.             localRSNPC = null;
  13752.           i7++;
  13753.         }
  13754.  
  13755.         if (localRSNPC != null)
  13756.         {
  13757.           localObject2 = "";
  13758.  
  13759.           i6 = 0; if (i6 < arrayOfInt.length) {
  13760.             if (a.l(localRSNPC.getID(), arrayOfInt[i6]))
  13761.             {
  13762.               localObject2 = "Staff";
  13763.  
  13764.               if (i6 == 1)
  13765.               {
  13766.                 localObject2 = "Sword";
  13767.               }
  13768.               else {
  13769.                 localObject2 = "Bow";
  13770.               }
  13771.  
  13772.             }
  13773.             else
  13774.             {
  13775.               i6++;
  13776.             }
  13777.  
  13778.           }
  13779.  
  13780.           if ((a.inventory.getItemID("Stone " + ((String)localObject2).toLowerCase()) != -1) && (a.F((RSNPC)localObject1, "Arm")))
  13781.           {
  13782.             a.K(true);
  13783.  
  13784.             if ((!a.interfaces.get(236).isValid()) && (!a.interfaces.get(451).isValid())) {
  13785.               a.sleep(700, 800);
  13786.             }
  13787.  
  13788.             if (a.l(a.interfaces.get(236), new String[] { localObject2 }))
  13789.             {
  13790.               a.sleep(400, 600);
  13791.  
  13792.               if (a.interfaces.get(451).isValid())
  13793.                 if (a.l(a.interfaces.get(451), new String[] { localObject2 }))
  13794.                 {
  13795.                   a.sleep(400, 600);
  13796.                 }
  13797.             }
  13798.           }
  13799.         }
  13800.       }
  13801.       a.sleep(500, 800);
  13802.     }
  13803.  
  13804.     while (!a.Y().isInCombat());
  13805.  
  13806.     if (!a.JC()) {
  13807.       a.sleep(800, 1000);
  13808.     }
  13809.  
  13810.     a.K(true);
  13811.  
  13812.     if (!a.ZA()) {
  13813.       return 2;
  13814.     }
  13815.  
  13816.     a.lA();
  13817.  
  13818.     a.F(a.nD);
  13819.  
  13820.     return 1;
  13821.   }
  13822.  
  13823.   private boolean l(int[] a, int a, int a)
  13824.   {
  13825.     if ((a.inventory.containsOneOf(a)) && (a.combat.getHealth() < a))
  13826.     {
  13827.       do
  13828.       {
  13829.         if (((a.nb != null) && (a.objects.getNearest(a.gb) != null)) || (a.Zc()))
  13830.           return false;
  13831.         int[] arrayOfInt;
  13832.         int i1 = (arrayOfInt = a).length;
  13833.         int i2;
  13834.         if ((i2 = 0) < i1) { int i3 = arrayOfInt[i2];
  13835.           RSItem localRSItem;
  13836.           if ((localRSItem = a.inventory.getItem(new int[] { i3 })) != null)
  13837.             a.sleep(300, 600);
  13838.           else {
  13839.             i2++;
  13840.           }
  13841.  
  13842.         }
  13843.  
  13844.         a.sleep(50, 100);
  13845.       }
  13846.       while ((a.inventory.containsOneOf(a)) && (a.combat.getHealth() < a));
  13847.  
  13848.       return true;
  13849.     }
  13850.     return false;
  13851.   }
  13852.  
  13853.   private void Q()
  13854.   {
  13855.     if (a.UA)
  13856.     {
  13857.       do
  13858.       {
  13859.         if (!a.game.isLoggedIn())
  13860.         {
  13861.           return;
  13862.         }
  13863.         a.sleep(10000, 30000);
  13864.       }
  13865.       while (a.random(0, 4) != 0);
  13866.  
  13867.       a.A(a.X(), 10);
  13868.     }
  13869.   }
  13870.  
  13871.   private boolean N()
  13872.   {
  13873.     if (!a.Qc.contains("Opening")) {
  13874.       a.Qc = "Opening an old door";
  13875.     }
  13876.  
  13877.     a.lc = new Timer(0L);
  13878.  
  13879.     for (Iterator localIterator = a.Nc.iterator(); localIterator.hasNext(); )
  13880.     {
  13881.       RSArea localRSArea;
  13882.       if ((
  13883.         (localRSArea = (RSArea)localIterator.next()) != null) && (!localRSArea.equals(a.Sg)) && (a.calc.distanceBetween(a.nD, localRSArea.getNearestTile(a.nD)) < 3.0D))
  13884.       {
  13885.         a.ZA = localRSArea;
  13886.  
  13887.         break;
  13888.       }
  13889.     }
  13890.     if (a.ZA == null)
  13891.     {
  13892.       return false;
  13893.     }
  13894.     if (!a.ZA.contains(new RSTile[] { a.X() }))
  13895.     {
  13896.       if (a.jA()) {
  13897.         return false;
  13898.       }
  13899.  
  13900.       a.uA();
  13901.  
  13902.       if ((a.nD != null) && (a.FA != null)) if (a.FA.contains(new RSTile[] { a.nD }))
  13903.         {
  13904.           int i1;
  13905.           if (a.l(a.G(a.nD)))
  13906.           {
  13907.             a.K(false);
  13908.  
  13909.             a.sleep(200, 250);
  13910.  
  13911.             i1++;
  13912.           }
  13913.           else
  13914.           {
  13915.             a.JC();
  13916.  
  13917.             a.sleep(100, 200);
  13918.           }
  13919.  
  13920.         }
  13921.  
  13922.  
  13923.       a.sleep(200, 400);
  13924.     }
  13925.     a.l(a.ZA);
  13926.  
  13927.     a.ZA = null;
  13928.  
  13929.     a.w.remove(a.nD);
  13930.  
  13931.     a.w.add(a.nD);
  13932.  
  13933.     a.QA = a.nD;
  13934.  
  13935.     return true;
  13936.   }
  13937.  
  13938.   private boolean A(boolean a)
  13939.   {
  13940.     if (a.combat.isAutoRetaliateEnabled() != a)
  13941.     {
  13942.       RSTile localRSTile = a.walking.getDestination();
  13943.       int i1;
  13944.       while (a.combat.isAutoRetaliateEnabled() != a)
  13945.       {
  13946.         if (a.Zc())
  13947.           return false;
  13948.         a.combat.setAutoRetaliate(a);
  13949.  
  13950.         if ((i1 = 0) < 10)
  13951.         {
  13952.           a.sleep(100, 150);
  13953.  
  13954.           i1++;
  13955.         }
  13956.       }
  13957.       a.F();
  13958.  
  13959.       if ((localRSTile != null) && (!a.calc.tileOnScreen(localRSTile)))
  13960.         a.l(localRSTile, 1);
  13961.       return true;
  13962.     }
  13963.  
  13964.     return false;
  13965.   }
  13966.  
  13967.   private int W()
  13968.   {
  13969.     if (!a.O())
  13970.       return -1;
  13971.     int[] arrayOfInt = { 49689, 49692, 54288 };
  13972.     RSObject localRSObject1;
  13973.     if (
  13974.       (localRSObject1 = a.i(a.te)) == null)
  13975.     {
  13976.       return -1;
  13977.     }
  13978.     RSTile localRSTile1 = localRSObject1.getLocation(); RSTile localRSTile2 = a.r.getCentralTile(); RSTile localRSTile3 = a.tA();
  13979.  
  13980.     int i1 = Math.abs(localRSTile2.getY() - localRSTile3.getY()) > 4 ? 1 : 0;
  13981.  
  13982.     Object localObject1 = null; RSTile localRSTile4 = null;
  13983.  
  13984.     RSObject localRSObject2 = a.i(new int[] { 50962, 50965, 52059, 54986 });
  13985.     RSObject[] arrayOfRSObject;
  13986.     int i3 = (arrayOfRSObject = a.J(new int[] { 50849, 51943, 54765 })).length;
  13987.     int i4;
  13988.     Object localObject4 = (localObject3 = arrayOfRSObject[i4])
  13989.       .getLocation();
  13990.  
  13991.     if ((a.D((RSTile)localObject4) != null) && (a.calc.distanceBetween((RSTile)localObject4, localRSTile3) < 6.0D))
  13992.     {
  13993.       localObject1 = localObject4;
  13994.     }
  13995.     else
  13996.     {
  13997.       i4++;
  13998.     }
  13999.     int i2 = 0; i3 = 0;
  14000.  
  14001.     Object localObject2 = null; Object localObject3 = null; localObject4 = null; Object localObject5 = null; Object localObject6 = null;
  14002.  
  14003.     Object localObject7 = null; Object localObject8 = null; Object localObject9 = null; Object localObject10 = null; Object localObject11 = null;
  14004.     int i5;
  14005.     int i6;
  14006.     Object localObject12;
  14007.     Object localObject13;
  14008.     Object localObject14;
  14009.     int i8;
  14010.     int i9;
  14011.     RSTile localRSTile6;
  14012.     RSNPC localRSNPC2;
  14013.     if (localObject1 != null)
  14014.     {
  14015.       i2 = 1;
  14016.  
  14017.       localObject3 = a.D(localObject1);
  14018.  
  14019.       localObject8 = localObject1;
  14020.  
  14021.       i5 = localObject1.getX(); i6 = localObject1.getY();
  14022.  
  14023.       localObject12 = new RSTile[] { new RSTile(i5 - 2, i6), new RSTile(i5 + 2, i6), new RSTile(i5, i6 - 2), new RSTile(i5, i6 + 2) };
  14024.  
  14025.       localObject13 = new RSTile[] { new RSTile(i5 - 1, i6), new RSTile(i5 + 1, i6), new RSTile(i5, i6 - 1), new RSTile(i5, i6 + 1) };
  14026.  
  14027.       i8 = (localObject14 = localObject12).length; localRSTile6 = localObject14[i9];
  14028.  
  14029.       if ((localRSNPC2 = a.D(localRSTile6)) != null)
  14030.       {
  14031.         localObject2 = localRSNPC2;
  14032.  
  14033.         localObject7 = localRSTile6;
  14034.       }
  14035.       else
  14036.       {
  14037.         i9++;
  14038.       }
  14039.       i8 = (localObject14 = localObject13).length; localRSTile6 = localObject14[i9];
  14040.  
  14041.       if (
  14042.         (localRSNPC2 = a.D(localRSTile6)) != null)
  14043.       {
  14044.         localObject4 = localRSNPC2;
  14045.  
  14046.         localObject9 = localRSTile6;
  14047.       }
  14048.       else
  14049.       {
  14050.         i9++;
  14051.       }
  14052.     }
  14053.     if (localRSObject2 != null)
  14054.     {
  14055.       i3 = 1;
  14056.  
  14057.       i5 =
  14058.         (localRSTile4 = localRSObject2.getLocation()).getX(); i6 = localRSTile4.getY();
  14059.  
  14060.       localObject12 = new RSTile[] { new RSTile(i5 - 1, i6), new RSTile(i5 + 1, i6), new RSTile(i5, i6 - 1), new RSTile(i5, i6 + 1) };
  14061.  
  14062.       localObject13 = new RSTile[] { new RSTile(i5 - 2, i6), new RSTile(i5 + 2, i6), new RSTile(i5, i6 - 2), new RSTile(i5, i6 + 2) };
  14063.  
  14064.       i8 = (localObject14 = localObject12).length; localRSTile6 = localObject14[i9];
  14065.  
  14066.       if ((localRSNPC2 = a.D(localRSTile6)) != null)
  14067.       {
  14068.         localObject5 = localRSNPC2;
  14069.  
  14070.         localObject10 = localRSTile6;
  14071.       }
  14072.       else
  14073.       {
  14074.         i9++;
  14075.       }
  14076.  
  14077.       i8 = (localObject14 = localObject13).length; localRSTile6 = localObject14[i9];
  14078.  
  14079.       if (
  14080.         (localRSNPC2 = a.D(localRSTile6)) != null)
  14081.       {
  14082.         localObject6 = localRSNPC2;
  14083.  
  14084.         localObject11 = localRSTile6;
  14085.       }
  14086.       else
  14087.       {
  14088.         i9++;
  14089.       }
  14090.     }
  14091.     if (localObject1 != null)
  14092.     {
  14093.       i2 = 1;
  14094.  
  14095.       localObject3 = a.D(localObject1);
  14096.  
  14097.       localObject8 = localObject1;
  14098.  
  14099.       i5 = localObject1.getX(); i6 = localObject1.getY();
  14100.  
  14101.       localObject12 = new RSNPC[] { a.D(new RSTile(i5 - 2, i6)), a.D(new RSTile(i5 + 2, i6)), a.D(new RSTile(i5, i6 - 2)), a.D(new RSTile(i5, i6 + 2)) };
  14102.  
  14103.       localObject13 = new RSNPC[] { a.D(new RSTile(i5 - 1, i6)), a.D(new RSTile(i5 + 1, i6)), a.D(new RSTile(i5, i6 - 1)), a.D(new RSTile(i5, i6 + 1)) };
  14104.  
  14105.       i8 = (localObject14 = localObject12).length;
  14106.  
  14107.       if ((localRSTile6 = localObject14[i9]) != null)
  14108.       {
  14109.         localObject2 = localRSTile6;
  14110.  
  14111.         localObject7 = localRSTile6.getLocation();
  14112.       }
  14113.       else
  14114.       {
  14115.         i9++;
  14116.       }
  14117.  
  14118.       i8 = (localObject14 = localObject13).length;
  14119.  
  14120.       if ((localRSTile6 = localObject14[i9]) != null)
  14121.       {
  14122.         localObject4 = localRSTile6;
  14123.  
  14124.         localObject9 = localRSTile6.getLocation();
  14125.       }
  14126.       else
  14127.       {
  14128.         i9++;
  14129.       }
  14130.     }
  14131.     RSObject localRSObject3;
  14132.     if ((localRSObject3 = a.i(arrayOfInt)) != null)
  14133.     {
  14134.       a.camera.turnToObject(localRSObject3);
  14135.     }
  14136.     if (!a.j()) {
  14137.       return -1;
  14138.     }
  14139.  
  14140.     if (a.jA()) {
  14141.       return 2;
  14142.     }
  14143.  
  14144.     RSNPC localRSNPC1 = a.D(new int[] { 11073 });
  14145.     int i10;
  14146.     if (a.interfaces.getComponent(945, 17).getRelativeX() == 200)
  14147.     {
  14148.       a.vE = localRSTile1;
  14149.  
  14150.       if (localRSNPC1 != null)
  14151.       {
  14152.         localObject12 = localRSNPC1.getLocation();
  14153.  
  14154.         localObject13 = localRSTile1;
  14155.  
  14156.         int i7 = ((RSTile)localObject12).getX(); i8 = ((RSTile)localObject12).getY(); i9 = ((RSTile)localObject13).getX(); i10 = ((RSTile)localObject13).getY();
  14157.  
  14158.         boolean bool1 = false;
  14159.  
  14160.         if (i1 != 0)
  14161.         {
  14162.           if (i7 != i9)
  14163.           {
  14164.             bool1 = i7 > i9 ? a.A((RSTile)localObject12, 1, 0) : a.A((RSTile)localObject12, -1, 0);
  14165.           }
  14166.  
  14167.         }
  14168.         else if (i8 != i10)
  14169.           bool1 = i8 > i10 ? a.A((RSTile)localObject12, 0, 1) : a.A((RSTile)localObject12, 0, -1);
  14170.         if ((bool1) && (a.F(localRSNPC1, "Push")))
  14171.         {
  14172.           a.K(true);
  14173.         }
  14174.  
  14175.       }
  14176.  
  14177.     }
  14178.     else
  14179.     {
  14180.       localObject12 = a.D(new int[] { 11075 });
  14181.  
  14182.       localRSObject3 = a.i(arrayOfInt);
  14183.  
  14184.       if ((localRSNPC1 != null) && (localRSObject3 != null))
  14185.       {
  14186.         localObject13 = localRSNPC1.getLocation();
  14187.  
  14188.         RSTile localRSTile5 = localRSObject3.getLocation();
  14189.  
  14190.         i8 = ((RSTile)localObject13).getX(); i9 = ((RSTile)localObject13).getY(); i10 = localRSTile5.getX(); int i11 = localRSTile5.getY();
  14191.         boolean bool2;
  14192.         if (i1 != 0)
  14193.         {
  14194.           if (i8 != i10)
  14195.           {
  14196.             bool2 = i8 > i10 ? a.A((RSTile)localObject13, 1, 0) : a.A((RSTile)localObject13, -1, 0);
  14197.  
  14198.             if ((bool2) && (a.F(localRSNPC1, "Push")))
  14199.             {
  14200.               a.K(true);
  14201.  
  14202.               localObject13 = localRSNPC1.getLocation();
  14203.  
  14204.               localRSTile5 = localRSObject3.getLocation();
  14205.  
  14206.               i8 = ((RSTile)localObject13).getX();
  14207.  
  14208.               i9 = ((RSTile)localObject13).getY();
  14209.  
  14210.               i10 = localRSTile5.getX();
  14211.  
  14212.               i11 = localRSTile5.getY();
  14213.  
  14214.               if (i8 == i10)
  14215.               {
  14216.                 a.A(new RSTile(i8, i9 + i9 - i11), 0);
  14217.               }
  14218.             }
  14219.           }
  14220.         }
  14221.         else if (i9 != i11)
  14222.         {
  14223.           bool2 = i9 > i11 ? a.A((RSTile)localObject13, 0, 1) : a.A((RSTile)localObject13, 0, -1);
  14224.  
  14225.           if ((bool2) && (a.F(localRSNPC1, "Push")))
  14226.           {
  14227.             a.K(true);
  14228.  
  14229.             localObject13 = localRSNPC1.getLocation();
  14230.  
  14231.             localRSTile5 = localRSObject3.getLocation();
  14232.  
  14233.             i8 = ((RSTile)localObject13).getX();
  14234.  
  14235.             i9 = ((RSTile)localObject13).getY();
  14236.  
  14237.             i10 = localRSTile5.getX();
  14238.  
  14239.             i11 = localRSTile5.getY();
  14240.  
  14241.             if (i9 == i11)
  14242.             {
  14243.               a.A(new RSTile(i8 + i8 - i10, i9), 0);
  14244.             }
  14245.           }
  14246.         }
  14247.       }
  14248.       else if (i2 != 0)
  14249.       {
  14250.         if (a.D((RSTile)localObject7) != null)
  14251.         {
  14252.           if (a.F(localObject2, "Push"))
  14253.             a.K(true);
  14254.         }
  14255.         else if (a.D(localObject8) != null)
  14256.         {
  14257.           if (a.F((RSNPC)localObject3, "Push")) {
  14258.             a.K(true);
  14259.           }
  14260.  
  14261.         }
  14262.         else if (a.D((RSTile)localObject9) != null)
  14263.         {
  14264.           if (a.F((RSNPC)localObject4, "Push"))
  14265.           {
  14266.             a.K(true);
  14267.           }
  14268.         }
  14269.         else
  14270.           i2 = 0;
  14271.       }
  14272.       else if (i3 != 0)
  14273.       {
  14274.         if (a.D(localObject10) != null)
  14275.         {
  14276.           if (a.F(localObject5, "Push"))
  14277.           {
  14278.             a.K(true);
  14279.           }
  14280.  
  14281.         }
  14282.         else if (a.D(localObject11) != null)
  14283.         {
  14284.           if (a.F(localObject6, "Push")) {
  14285.             a.K(true);
  14286.           }
  14287.  
  14288.         }
  14289.         else
  14290.         {
  14291.           i3 = 0;
  14292.         }
  14293.  
  14294.       }
  14295.       else if (localObject12 != null)
  14296.       {
  14297.         if (a.inventory.contains(17422))
  14298.         {
  14299.           if (a.calc.distanceTo(((RSNPC)localObject12).getLocation()) > 1)
  14300.           {
  14301.             a.l(localRSTile4, 1);
  14302.  
  14303.             a.l(false);
  14304.  
  14305.             a.K(false);
  14306.           }
  14307.  
  14308.           if (a.F((RSNPC)localObject12, "Fix"))
  14309.             a.K(true);
  14310.         }
  14311.         else
  14312.         {
  14313.           a.EA();
  14314.  
  14315.           if (!a.l(a.yd))
  14316.           {
  14317.             a.l(a.groundItems.getNearest(new int[] { 17422 }));
  14318.           }
  14319.  
  14320.         }
  14321.  
  14322.       }
  14323.  
  14324.     }
  14325.  
  14326.     a.sleep(300, 500);
  14327.  
  14328.     a.A(a.nD, 2);
  14329.  
  14330.     a.K(false);
  14331.  
  14332.     if (a.jA())
  14333.     {
  14334.       return 2;
  14335.     }
  14336.     a.A(a.calc.distanceTo(localRSTile4) > 2 ? localRSTile4 : a.nD, 3);
  14337.  
  14338.     if (!a.Y().isMoving()) {
  14339.       a.A(a.nD, 3);
  14340.     }
  14341.  
  14342.     a.K(false);
  14343.  
  14344.     return 1;
  14345.   }
  14346.  
  14347.   private boolean F(boolean a)
  14348.   {
  14349.     if (a)
  14350.     {
  14351.       if ((!a.GA()) && (a.interfaces.get(548).isValid()))
  14352.       {
  14353.         a.log("Checking the dungeon map.");
  14354.  
  14355.         a.l(a.interfaces.getComponent(548, 179), "");
  14356.  
  14357.         a.sleep(400, 600);
  14358.  
  14359.         return true;
  14360.       }
  14361.     }
  14362.     else if (a.GA())
  14363.     {
  14364.       a.log("Closing the dungeon map.");
  14365.  
  14366.       return a.l(a.interfaces.getComponent(942, 6), "");
  14367.     }
  14368.     return false;
  14369.   }
  14370.  
  14371.   private void t()
  14372.   {
  14373.     if (a.pc > 0)
  14374.     {
  14375.       RSItem localRSItem = a.inventory.getItem(new int[] { a.pc });
  14376.  
  14377.       String str = a.l(localRSItem);
  14378.       int i1;
  14379.       if ((i1 = a.F(str)) > 0)
  14380.       {
  14381.         a.log("Upgrading our " + a.cd + " to " + a.J(str));
  14382.  
  14383.         int i2 = a.Vc;
  14384.  
  14385.         a.aA = 0;
  14386.  
  14387.         if (a.Zc())
  14388.         {
  14389.           return;
  14390.         }
  14391.         int i3;
  14392.         if ((i3 = a.inventory.getItemID(str + " (b)")) > 0)
  14393.         {
  14394.           a.Vc = i3;
  14395.         }
  14396.         else if (a.interfaces.get(94).isValid())
  14397.         {
  14398.           a.interfaces.getComponent(94, 3).doClick();
  14399.         }
  14400.         else if (a.inventory.contains(a.Vc))
  14401.           a.inventory.getItem(new int[] { a.Vc }).doAction("Destroy");
  14402.         else if ((a.equipment.getItem(17) != null) && (a.equipment.getItem(17).getID() > 0))
  14403.         {
  14404.           a.equipment.getItem(17).doClick(true);
  14405.         }
  14406.         else if (a.inventory.contains(a.pc)) {
  14407.           a.l(a.pc, "Bind");
  14408.         }
  14409.         else if (a.l(a.groundItems.getNearest(new int[] { a.pc })))
  14410.           a.K(false);
  14411.         a.sleep(400, 800);
  14412.  
  14413.         a.l(a.Vc, "Wield");
  14414.  
  14415.         a.aA = i1;
  14416.  
  14417.         if (a.EB.contains(Integer.valueOf(a.pc))) {
  14418.           a.EB.remove(Integer.valueOf(a.pc));
  14419.         }
  14420.  
  14421.         a.pc = -1;
  14422.       }
  14423.     }
  14424.   }
  14425.  
  14426.   private boolean u()
  14427.   {
  14428.     a.Qc = "Opening a locked door";
  14429.  
  14430.     a.Hc = false;
  14431.  
  14432.     if (!a.Hc)
  14433.     {
  14434.       if (a.jA()) {
  14435.         return false;
  14436.       }
  14437.  
  14438.       if (a.Y().getAnimation() != 13798)
  14439.       {
  14440.         RSObject localRSObject = a.G(a.WA);
  14441.  
  14442.         if (a.SE.contains("don't have the correct"))
  14443.         {
  14444.           a.log.severe("Hmm.. we got tricked, we don't have the right key!");
  14445.  
  14446.           a.J.remove(a.nD);
  14447.  
  14448.           a.J.remove(a.WA);
  14449.  
  14450.           return true;
  14451.         }
  14452.  
  14453.         if (a.l(localRSObject)) {
  14454.           a.K(false);
  14455.         }
  14456.         else if (localRSObject != null)
  14457.         {
  14458.           a.sleep(100, 200);
  14459.         }
  14460.         a.sleep(200, 400);
  14461.       }
  14462.     }
  14463.     a.Hc = false;
  14464.  
  14465.     a.J.remove(a.WA);
  14466.  
  14467.     a.fA.remove(a.WA);
  14468.  
  14469.     a.Bd.remove(a.WA);
  14470.  
  14471.     a.vF.remove(a.WA);
  14472.  
  14473.     if (a.ZA != null);
  14474.     if (a.jA())
  14475.     {
  14476.       return false;
  14477.     }
  14478.     a.uA();
  14479.  
  14480.     if (a.l(a.G(a.nD)))
  14481.     {
  14482.       a.K(false);
  14483.  
  14484.       if (a.i(false))
  14485.       {
  14486.         return true;
  14487.       }
  14488.     }
  14489.     a.sleep(200, 400);
  14490.  
  14491.     return true;
  14492.   }
  14493.  
  14494.   private RSTile X()
  14495.   {
  14496.     RSPlayer localRSPlayer;
  14497.     return (localRSPlayer = a.Y()) != null
  14498.        ? localRSPlayer.getLocation() : a.y;
  14499.   }
  14500.  
  14501.   private RSPlayer Y()
  14502.   {
  14503.     return a.players.getMyPlayer();
  14504.   }
  14505.  
  14506.   private boolean x()
  14507.   {
  14508.     int i1;
  14509.     if (a.Y().getAnimation() != -1)
  14510.       return true;
  14511.     a.sleep(80, 120);
  14512.  
  14513.     i1++;
  14514.  
  14515.     return false;
  14516.   }
  14517.  
  14518.   private int p()
  14519.   {
  14520.     if ((!a.O()) || (!a.A()) || (!a.L())) {
  14521.       return -1;
  14522.     }
  14523.  
  14524.     boolean bool = false;
  14525.  
  14526.     int[] arrayOfInt1 = { 54082, 54083, 54084, 54085 };
  14527.  
  14528.     int[] arrayOfInt2 = { 54095, 54096, 54097, 54098 };
  14529.  
  14530.     int[] arrayOfInt3 = { 54099, 54100, 54101, 54102 };
  14531.  
  14532.     int[] arrayOfInt4 = { 54074, 54075, 54076 };
  14533.  
  14534.     int i1 = -1;
  14535.  
  14536.     String str = "";
  14537.  
  14538.     while (a.i(arrayOfInt1) == null)
  14539.     {
  14540.       if (a.jA()) {
  14541.         return 2;
  14542.       }
  14543.  
  14544.       if (!a.j())
  14545.       {
  14546.         return -1;
  14547.       }
  14548.       a.l(a.vc, 40, 50);
  14549.  
  14550.       if (a.inventory.getItemID("Consecrated herb") > 0)
  14551.       {
  14552.         i1 = a.inventory.getItemID("Consecrated herb");
  14553.       }
  14554.       int i2 = a.inventory.getItemID(str);
  14555.  
  14556.       RSObject localRSObject1 = a.i(arrayOfInt2);
  14557.  
  14558.       RSObject localRSObject2 = a.i(arrayOfInt3);
  14559.  
  14560.       RSObject localRSObject3 = a.i(arrayOfInt4);
  14561.  
  14562.       if (a.D(new int[] { 11245 }) != null)
  14563.       {
  14564.         if (str.isEmpty())
  14565.         {
  14566.           if (a.l(a.i(a.wd), "Read"))
  14567.           {
  14568.             a.K(true);
  14569.             RSComponent localRSComponent;
  14570.             if ((localRSComponent = a.interfaces.getComponent(211, 2))
  14571.               .isValid())
  14572.               if (localRSComponent.containsText("corianger"))
  14573.               {
  14574.                 str = "Corianger";
  14575.               }
  14576.               else if (localRSComponent.containsText("explosemary")) {
  14577.                 str = "Explosemary";
  14578.               }
  14579.               else if (localRSComponent.containsText("parslay"))
  14580.                 str = "Parslay";
  14581.               else if (localRSComponent.containsText("cardamaim"))
  14582.               {
  14583.                 str = "Cardamaim";
  14584.               }
  14585.               else if (localRSComponent.containsText("papreaper")) {
  14586.                 str = "Papreaper";
  14587.               }
  14588.               else if (localRSComponent.containsText("slaughtercress"))
  14589.                 str = "Slaughtercress";
  14590.           }
  14591.           if (!str.isEmpty())
  14592.           {
  14593.             a.log("Honoring Lief with " + str);
  14594.           }
  14595.  
  14596.         }
  14597.         else if (a.interfaces.get(232).isValid())
  14598.         {
  14599.           a.l(a.interfaces.get(232), new String[] { str, "More herbs" });
  14600.         }
  14601.         else if (localRSObject2 != null)
  14602.         {
  14603.           bool = a.l(localRSObject2, "Light");
  14604.         }
  14605.         else if ((i2 > 0) && (a.inventory.contains(i2)))
  14606.         {
  14607.           a.inventory.getItem(new int[] { i2 }).doClick(true);
  14608.         }
  14609.         else if (localRSObject3 != null)
  14610.         {
  14611.           bool = a.l(localRSObject3, "Harvest");
  14612.         }
  14613.         else if ((i1 > 0) && (a.inventory.contains(i1)) && (localRSObject1 != null))
  14614.         {
  14615.           bool = a.l("Consecrated herb", localRSObject1);
  14616.         }
  14617.  
  14618.       }
  14619.       else
  14620.       {
  14621.         bool = a.l(a.i(a.wd), "Open");
  14622.       }
  14623.       if (bool)
  14624.       {
  14625.         a.K(false);
  14626.       }
  14627.       else {
  14628.         a.sleep(200, 300);
  14629.       }
  14630.  
  14631.     }
  14632.  
  14633.     return 1;
  14634.   }
  14635.  
  14636.   private boolean F(int a)
  14637.   {
  14638.     RSItem localRSItem1 = a.inventory.getSelectedItem(); RSItem localRSItem2 = a.inventory.getItem(new int[] { a });
  14639.  
  14640.     if ((localRSItem1 != null) && (localRSItem1.getID() == a)) {
  14641.       return true;
  14642.     }
  14643.  
  14644.     if ((localRSItem2 == null) || (!localRSItem2.doAction("Use")))
  14645.       return false;
  14646.     a.sleep(600, 800);
  14647.     int i1;
  14648.     a.sleep(200, 300);
  14649.  
  14650.     i1++;
  14651.  
  14652.     return ((localRSItem1 = a.inventory.getSelectedItem()) != null) &&
  14653.       (localRSItem1.getID() == a);
  14654.   }
  14655.  
  14656.   private boolean l(RSObject a)
  14657.   {
  14658.     if (a == null) {
  14659.       return false;
  14660.     }
  14661.  
  14662.     String str1 = "";
  14663.     RSObjectDef localRSObjectDef;
  14664.     int i2;
  14665.     if ((localRSObjectDef = a.getDef()) != null)
  14666.     {
  14667.       String[] arrayOfString;
  14668.       int i1 = (arrayOfString = localRSObjectDef.getActions()).length;
  14669.       String str2;
  14670.       if ((
  14671.         (str2 = arrayOfString[i2]) != null) && (!str2.isEmpty()) && (!str2.contains("Examine")) && (!str2.equals("Walk here")) && (!str2.equals("Cancel")))
  14672.       {
  14673.         str1 = str2 + " " + localRSObjectDef.getName();
  14674.       }
  14675.       else
  14676.       {
  14677.         i2++;
  14678.       }
  14679.     }
  14680.     if ((str1.isEmpty()) && (a.calc.distanceTo(a) > 4)) {
  14681.       a.A(a.getLocation(), 1);
  14682.     }
  14683.  
  14684.     return a.l(a, str1);
  14685.   }
  14686.  
  14687.   private boolean l(String a)
  14688.   {
  14689.     int i1;
  14690.     if (
  14691.       (i1 = a.menu.getIndex(a.toLowerCase())) == -1)
  14692.     {
  14693.       a.mouse.moveRandomly(700);
  14694.  
  14695.       a.sleep(a.random(150, 400));
  14696.  
  14697.       return false;
  14698.     }
  14699.  
  14700.     if (!a.menu.isOpen())
  14701.     {
  14702.       if (i1 == 0)
  14703.       {
  14704.         a.mouse.click(true);
  14705.  
  14706.         return true;
  14707.       }
  14708.       a.mouse.click(false);
  14709.     }
  14710.     int i2;
  14711.     if ((i2 = 0) < 4)
  14712.     {
  14713.       a.sleep(10, 30);
  14714.  
  14715.       i2++;
  14716.     }
  14717.  
  14718.     if (!a.menu.isOpen())
  14719.       return false;
  14720.     String[] arrayOfString;
  14721.     if ((arrayOfString = a.menu.getItems()).length <=
  14722.       i1)
  14723.     {
  14724.       i1 = a.menu.getIndex(a.toLowerCase());
  14725.  
  14726.       if ((arrayOfString.length <= i1) || (i1 == -1)) {
  14727.         return false;
  14728.       }
  14729.  
  14730.     }
  14731.  
  14732.     int i3 = a.mouse.getSpeed();
  14733.  
  14734.     a.mouse.setSpeed(i3 + a.random(1, 3));
  14735.  
  14736.     Point localPoint = a.menu.getLocation();
  14737.  
  14738.     int i4 = a.random(4, arrayOfString[i1].length() * 4);
  14739.  
  14740.     int i5 = 21 + 16 * i1 + a.random(3, 12);
  14741.  
  14742.     a.mouse.move(localPoint.x + i4, localPoint.y + i5, 2, 2);
  14743.  
  14744.     a.mouse.setSpeed(i3);
  14745.  
  14746.     if (a.menu.isOpen())
  14747.     {
  14748.       a.mouse.click(true);
  14749.  
  14750.       return true;
  14751.     }
  14752.  
  14753.     return false;
  14754.   }
  14755.  
  14756.   private void w()
  14757.   {
  14758.     int i3;
  14759.     if (a.aA < a.mA)
  14760.     {
  14761.       int i1 =
  14762.         a.aA;
  14763.  
  14764.       RSGroundItem[] arrayOfRSGroundItem = a.groundItems.getAll(); int i2 = arrayOfRSGroundItem.length; i3 = 0; RSGroundItem localRSGroundItem = arrayOfRSGroundItem[i3];
  14765.  
  14766.       if ((localRSGroundItem != null) && (a.r != null)) if (a.r.contains(new RSTile[] { localRSGroundItem.getLocation() }))
  14767.         {
  14768.           String str = localRSGroundItem.getItem().getName();
  14769.  
  14770.           if ((str != null) && (!str.isEmpty()) && (str.contains(a.cd)))
  14771.           {
  14772.             int i4 = a.F(str);
  14773.  
  14774.             if ((i4 > i1) && (i4 <= a.mA))
  14775.             {
  14776.               i1 = i4;
  14777.  
  14778.               a.pc = localRSGroundItem.getItem().getID();
  14779.  
  14780.               a.EB.add(Integer.valueOf(a.pc));
  14781.             }
  14782.           }
  14783.         }
  14784.       i3++;
  14785.     }
  14786.   }
  14787.  
  14788.   private int l(RSTile a, RSObject a)
  14789.   {
  14790.     if (a == null)
  14791.     {
  14792.       return 0;
  14793.     }
  14794.     return 5 - (int)a.calc.distanceBetween(a, a.getLocation());
  14795.   }
  14796.  
  14797.   private int q()
  14798.   {
  14799.     if (!a.O()) {
  14800.       return -1;
  14801.     }
  14802.  
  14803.     boolean bool = false;
  14804.  
  14805.     RSObject localRSObject1 = a.i(new int[] { 54182, 54183, 54184, 54185 });
  14806.  
  14807.     RSObject localRSObject2 = a.J(new String[] { "Damaged bridge" });
  14808.  
  14809.     a.jA = a.npcs.getNearest(a.B);
  14810.  
  14811.     if ((a.jA != null) && ((a.HC != 1) || (a.l(a.jA.getLocation(), false))))
  14812.     {
  14813.       if ((!a.QB()) || ((a.HC == 1) && (!a.ZA()))) {
  14814.         return 2;
  14815.       }
  14816.  
  14817.     }
  14818.  
  14819.     if (a.hd == null)
  14820.     {
  14821.       a.hd = new Timer(a.random(240000, 300000));
  14822.     }
  14823.     bool = a.F(a.u) == null;
  14824.  
  14825.     a.A(bool);
  14826.     do
  14827.     {
  14828.       if (a.jA())
  14829.       {
  14830.         return 2;
  14831.       }
  14832.  
  14833.       if (!a.j()) {
  14834.         return -1;
  14835.       }
  14836.  
  14837.       if (a.objects.getNearest(new String[] { "Damaged bridge" }) != null)
  14838.         if (!a.inventory.contains(17444))
  14839.         {
  14840.           a.l(a.groundItems.getNearest(new int[] { 17444 }));
  14841.         }
  14842.         else if (a.inventory.contains(19661))
  14843.         {
  14844.           a.l(localRSObject2, "Repair");
  14845.         }
  14846.         else if (a.inventory.contains(19660))
  14847.         {
  14848.           a.inventory.getItem(new int[] { 19660 }).doClick(true);
  14849.         }
  14850.         else if (!a.inventory.containsOneOf(new int[] { 19660, 19661 }))
  14851.         {
  14852.           a.l(localRSObject1, "Mine");
  14853.         }
  14854.       a.K(bool);
  14855.     }
  14856.     while (!a.Rc());
  14857.  
  14858.     a.sleep(800, 1100);
  14859.  
  14860.     if (a.M) {
  14861.       a.f();
  14862.     }
  14863.  
  14864.     return 1;
  14865.   }
  14866.  
  14867.   public boolean onStart()
  14868.   {
  14869.     try
  14870.     {
  14871.       a.Hg = ImageIO.read(new URL("http://shadowscripting.com/iDungeon/Resources/proLogo.png"));
  14872.  
  14873.       a.NB = ImageIO.read(new URL("http://shadowscripting.com/iDungeon/Resources/hide.png"));
  14874.  
  14875.       a.rD = ImageIO.read(new URL("http://shadowscripting.com/iDungeon/Resources/hide_s.png"));
  14876.  
  14877.       a.Dd = ImageIO.read(new URL("http://shadowscripting.com/iDungeon/Resources/arrowUp.png"));
  14878.  
  14879.       a.OE = ImageIO.read(new URL("http://shadowscripting.com/iDungeon/Resources/arrowUp_s.png"));
  14880.  
  14881.       a.gD = ImageIO.read(new URL("http://shadowscripting.com/iDungeon/Resources/arrowDown.png"));
  14882.  
  14883.       a.iG = ImageIO.read(new URL("http://shadowscripting.com/iDungeon/Resources/arrowDown_s.png"));
  14884.  
  14885.       a.Kd = ImageIO.read(new URL("http://shadowscripting.com/iDungeon/Resources/play.png"));
  14886.  
  14887.       a.Ib = ImageIO.read(new URL("http://shadowscripting.com/iDungeon/Resources/play_s.png"));
  14888.  
  14889.       a.KG = ImageIO.read(new URL("http://shadowscripting.com/iDungeon/Resources/pause.png"));
  14890.  
  14891.       a.VC = ImageIO.read(new URL("http://shadowscripting.com/iDungeon/Resources/pause_s.png"));
  14892.  
  14893.       a.oA = ImageIO.read(new URL("http://shadowscripting.com/iDungeon/Resources/info.png"));
  14894.  
  14895.       a.Uc = ImageIO.read(new URL("http://shadowscripting.com/iDungeon/Resources/info_s.png"));
  14896.  
  14897.       a.UF = ImageIO.read(new URL("http://shadowscripting.com/iDungeon/Resources/help.png"));
  14898.  
  14899.       a.hb = ImageIO.read(new URL("http://shadowscripting.com/iDungeon/Resources/help_s.png"));
  14900.  
  14901.       a.We = ImageIO.read(new URL("http://shadowscripting.com/iDungeon/Resources/stop.png"));
  14902.  
  14903.       a.BC = ImageIO.read(new URL("http://shadowscripting.com/iDungeon/Resources/stop_s.png"));
  14904.     }
  14905.     catch (Exception localException)
  14906.     {
  14907.       a.log("Unable to load images. Try reloading the script if some are missing.");
  14908.     }
  14909.  
  14910.     a.H();
  14911.  
  14912.     return a.mA();
  14913.   }
  14914.  
  14915.   private boolean d()
  14916.   {
  14917.     return (a.Y().isInCombat()) && (a.Y().getInteracting() != null);
  14918.   }
  14919.  
  14920.   private boolean H()
  14921.   {
  14922.     try
  14923.     {
  14924.       File localFile;
  14925.       if (!(localFile = new File(a.rA))
  14926.         .exists())
  14927.         return false;
  14928.       Properties localProperties;
  14929.       (localProperties = new Properties()).load(new FileInputStream(a.rA));
  14930.  
  14931.       if ((localProperties != null) && (localProperties.getProperty("06") != null) && (localProperties.getProperty("06").equals("true")))
  14932.       {
  14933.         int i1;
  14934.         int i2;
  14935.         a.O[i1][i2] = localProperties.getProperty("" + i1 + i2).equals("true");
  14936.  
  14937.         i2++;
  14938.  
  14939.         i1++;
  14940.  
  14941.         a.k = a.O[0][0];
  14942.  
  14943.         a.Xd = a.O[0][1];
  14944.  
  14945.         a.IB = a.O[0][2];
  14946.  
  14947.         a.i = a.O[0][3];
  14948.  
  14949.         a.BB = a.O[0][4];
  14950.  
  14951.         a.vC = a.O[0][5];
  14952.  
  14953.         a.XC = a.O[0][6];
  14954.  
  14955.         a.Yb = a.O[0][7];
  14956.  
  14957.         a.kf = a.O[1][0];
  14958.  
  14959.         a.ec = a.O[1][1];
  14960.  
  14961.         a.zA = a.O[1][2];
  14962.  
  14963.         a.VA = a.O[1][3];
  14964.  
  14965.         a.QC = a.O[1][4];
  14966.  
  14967.         a.xe = a.O[1][5];
  14968.  
  14969.         a.gB = a.O[1][6];
  14970.  
  14971.         a.bc = a.O[1][7];
  14972.  
  14973.         a.Fb = a.O[1][8];
  14974.  
  14975.         a.E = a.O[2][0];
  14976.  
  14977.         a.Ed = a.O[2][1];
  14978.  
  14979.         a.od = a.O[2][2];
  14980.  
  14981.         a.M = a.O[2][3];
  14982.  
  14983.         a.RC = a.O[2][4];
  14984.  
  14985.         a.dg = a.O[2][5];
  14986.  
  14987.         return true;
  14988.       }
  14989.     }
  14990.     catch (Exception localException1)
  14991.     {
  14992.       a.log("Unable to load settings");
  14993.     }
  14994.  
  14995.     return false;
  14996.   }
  14997.  
  14998.   private int[] l(ArrayList<Integer> a)
  14999.   {
  15000.     int[] arrayOfInt = new int[a.size()];
  15001.     int i1;
  15002.     arrayOfInt[i1] = ((Integer)a.get(i1)).intValue();
  15003.  
  15004.     i1++;
  15005.  
  15006.     return arrayOfInt;
  15007.   }
  15008.  
  15009.   private void g()
  15010.   {
  15011.     if (a.nb != null) if (a.nb.contains(new RSTile[] { a.X() }))
  15012.       {
  15013.         a.FF = true;
  15014.  
  15015.         return;
  15016.       }
  15017.     int i1 = 0;
  15018.  
  15019.     a.BD += 1;
  15020.  
  15021.     a.Wb += 1;
  15022.  
  15023.     a.Bd.removeAll(a.fG);
  15024.  
  15025.     a.Bd.removeAll(a.fc);
  15026.  
  15027.     a.J.removeAll(a.fG);
  15028.  
  15029.     a.J.removeAll(a.fc);
  15030.  
  15031.     if (a.i(a.gb) != null)
  15032.     {
  15033.       a.Ke = true;
  15034.  
  15035.       return;
  15036.     }
  15037.     if ((a.npcs.getNearest(a.B) == null) && (!a.ZA())) {
  15038.       return;
  15039.     }
  15040.  
  15041.     if (a.Kc != null)
  15042.     {
  15043.       for (localObject1 = a.J.iterator(); ((Iterator)localObject1).hasNext(); ) { RSTile localRSTile1 = (RSTile)((Iterator)localObject1).next();
  15044.  
  15045.         if (a.Kc.contains(new RSTile[] { localRSTile1 }))
  15046.         {
  15047.           a.log("Gatestone teleporting to the next good door");
  15048.           int i3;
  15049.           if (a.Kc.contains(new RSTile[] { a.X() }))
  15050.           {
  15051.             a.Kc = null;
  15052.  
  15053.             return;
  15054.           }
  15055.  
  15056.           if (a.F(39, "Cast"))
  15057.           {
  15058.             a.K(true);
  15059.           }
  15060.           i3++;
  15061.  
  15062.           a.Kc = null;
  15063.  
  15064.           return;
  15065.         }
  15066.  
  15067.       }
  15068.  
  15069.     }
  15070.  
  15071.     if ((a.Wb > 2) && (a.nb == null))
  15072.     {
  15073.       if ((a.Rd == 1) && (!a.qA.isEmpty()))
  15074.       {
  15075.         a.qA.clear();
  15076.       }
  15077.       else {
  15078.         a.log("Remaining good doors: " + a.J.size());
  15079.       }
  15080.  
  15081.       a.vA();
  15082.  
  15083.       if (a.J.isEmpty())
  15084.       {
  15085.         if (a.gE)
  15086.         {
  15087.           a.log("A prayer door is preventing us from solving this dungeon");
  15088.         }
  15089.         else if (a.XF)
  15090.         {
  15091.           a.log("Too-powerful mercenaries prevent us from solving this dungeon");
  15092.         }
  15093.         else
  15094.         {
  15095.           a.log.severe("No good doors remain.. Aborting dungeon");
  15096.  
  15097.           a.Ic += 1;
  15098.         }
  15099.  
  15100.         a.aA();
  15101.  
  15102.         return;
  15103.       }
  15104.  
  15105.       if (a.Rd == 1)
  15106.         a.A(a.FA.getCentralTile(), 3);
  15107.       if (a.jb != null) if (a.jb.contains(new RSTile[] { a.X() }))
  15108.         {
  15109.           a.QA = null;
  15110.  
  15111.           a.Fg = true;
  15112.  
  15113.           return;
  15114.         }
  15115.       if (a.BD > a.random(a.Zc + 5, a.Zc + 8))
  15116.       {
  15117.         a.log.severe("Restarted too many times.. Aborting dungeon");
  15118.  
  15119.         a.Ic += 1;
  15120.  
  15121.         a.aA();
  15122.  
  15123.         return;
  15124.       }
  15125.       if (!a.DD())
  15126.         return;
  15127.       a.Wb = 0;
  15128.  
  15129.       i1 = 1;
  15130.     }
  15131.     else if (a.lA.contains(a.FA))
  15132.     {
  15133.       i1 = 1;
  15134.     }
  15135.  
  15136.     a.Qc = "Backtracking through the dungeon...";
  15137.  
  15138.     a.uA();
  15139.  
  15140.     if (a.FA == null)
  15141.       return;
  15142.     if ((a.r.contains(new RSTile[] { a.X() })) && (!a.ic.contains(a.FA)) && (a.Rd != 1))
  15143.     {
  15144.       if ((a.skills.getRealLevel(6) >= 32) && (!a.inventory.contains(17489))) if (a.inventory.getCount(true, new int[] { 17789 }) > 2)
  15145.         {
  15146.           if (a.F(38, "Cast"))
  15147.             a.K(true);
  15148.         }
  15149.       if ((a.inventory.contains(17489)) && (a.l(17489, "Drop"))) {
  15150.         a.Kc = a.r;
  15151.       }
  15152.  
  15153.     }
  15154.  
  15155.     a.J.removeAll(a.fc);
  15156.  
  15157.     a.J.removeAll(a.w);
  15158.  
  15159.     a.nD = null;
  15160.  
  15161.     a.WA = null;
  15162.  
  15163.     Object localObject1 = null;
  15164.  
  15165.     int i2 = 0;
  15166.  
  15167.     if ((a.npcs.getNearest(a.B) != null) || (a.npcs.getNearest(a.Fd) != null))
  15168.       if (a.lA.contains(a.r))
  15169.       {
  15170.         if ((!a.QB()) || (!a.ZA())) {
  15171.           return;
  15172.         }
  15173.  
  15174.       }
  15175.       else
  15176.       {
  15177.         i2 = 1;
  15178.  
  15179.         i1 = 0;
  15180.       }
  15181.     Object localObject2;
  15182.     RSTile localRSTile2;
  15183.     if ((a.r != null) && (i1 == 0))
  15184.     {
  15185.       if ((a.nE) || (i2 != 0))
  15186.       {
  15187.         for (localObject2 = a.fc.iterator(); ((Iterator)localObject2).hasNext(); ) { localRSTile2 = (RSTile)((Iterator)localObject2).next();
  15188.  
  15189.           if (a.r.contains(new RSTile[] { localRSTile2 }))
  15190.           {
  15191.             localObject1 = localRSTile2;
  15192.  
  15193.             break;
  15194.           }
  15195.  
  15196.         }
  15197.  
  15198.       }
  15199.       else
  15200.       {
  15201.         for (localObject2 = a.fc.iterator(); ((Iterator)localObject2).hasNext(); ) { localRSTile2 = (RSTile)((Iterator)localObject2).next();
  15202.  
  15203.           if (a.r.contains(new RSTile[] { localRSTile2 }))
  15204.           {
  15205.             for (localIterator1 = a.Nc.iterator(); localIterator1.hasNext(); ) { localRSArea = (RSArea)localIterator1.next();
  15206.  
  15207.               if (a.calc.distanceBetween(localRSTile2, localRSArea.getNearestTile(localRSTile2)) < 3.0D)
  15208.               {
  15209.                 if (localRSArea.equals(a.jb))
  15210.                 {
  15211.                   localObject1 = localRSTile2;
  15212.  
  15213.                   break label1099;
  15214.                 }
  15215.  
  15216.                 for (RSTile localRSTile3 : a.J)
  15217.                 {
  15218.                   if (localRSArea.contains(new RSTile[] { localRSTile3 }))
  15219.                   {
  15220.                     localObject1 = localRSTile2;
  15221.  
  15222.                     break label1099;
  15223.                   }
  15224.                 }
  15225.               }
  15226.             }
  15227.           }
  15228.         }
  15229.       }
  15230.     }
  15231.     Iterator localIterator1;
  15232.     RSArea localRSArea;
  15233.     label1099: a.uA();
  15234.  
  15235.     if ((a.FA != null) && (a.Rd != 1))
  15236.     {
  15237.       if (localObject1 != null)
  15238.       {
  15239.         a.A((RSTile)localObject1);
  15240.  
  15241.         if (a.M) {
  15242.           a.l(a.X(), (RSTile)localObject1, true, new int[0]);
  15243.         }
  15244.  
  15245.       }
  15246.  
  15247.       if (a.FA != null);
  15248.       if (localObject1 == null) {
  15249.         if (a.npcs.getNearest(a.B) != null)
  15250.         {
  15251.           a.log("Finishing off monsters before restarting");
  15252.  
  15253.           if ((!a.QB()) || (!a.ZA()))
  15254.             return;
  15255.         }
  15256.         else if (a.npcs.getNearest(a.Fd) != null)
  15257.         {
  15258.           a.log("Bad monster found, backtracking.");
  15259.  
  15260.           localObject1 = a.tA();
  15261.         }
  15262.  
  15263.       }
  15264.  
  15265.       if (localObject1 != null)
  15266.       {
  15267.         if ((localObject2 = a.G((RSTile)localObject1)) != null)
  15268.         {
  15269.           if (a.l((RSObject)localObject2, "Enter"))
  15270.           {
  15271.             if (!a.combat.isAutoRetaliateEnabled()) {
  15272.               a.game.openTab(0);
  15273.             }
  15274.  
  15275.             a.sleep(600, 800);
  15276.  
  15277.             if (a.Y().isMoving()) {
  15278.               a.sleep(100, 200);
  15279.             }
  15280.  
  15281.             a.sleep(400, 500);
  15282.           }
  15283.  
  15284.         }
  15285.         else
  15286.         {
  15287.           localObject1 = null;
  15288.         }
  15289.       }
  15290.       else {
  15291.         a.G(true);
  15292.       }
  15293.  
  15294.       a.sleep(100, 200);
  15295.  
  15296.       a.uA();
  15297.     }
  15298.  
  15299.     a.a.clear();
  15300.  
  15301.     if (a.i(a.u) == null)
  15302.       a.A(true);
  15303.     a.l(a.FA);
  15304.  
  15305.     a.hB = true;
  15306.  
  15307.     a.nE = false;
  15308.   }
  15309.  
  15310.   private boolean j()
  15311.   {
  15312.     if (((!a.BG) && (!a.oA())) || (a.interfaces.get(210).isValid()))
  15313.     {
  15314.       a.uC = "Level requirements";
  15315.  
  15316.       return false;
  15317.     }
  15318.  
  15319.     return true;
  15320.   }
  15321.  
  15322.   private int I()
  15323.   {
  15324.     int[] arrayOfInt1 = { 49468, 49469, 49470, 49477, 49478, 49479, 49486, 49487, 49488, 54262, 54265, 54268 };
  15325.  
  15326.     int[] arrayOfInt2 = { 49495, 49496, 49497, 54271 };
  15327.  
  15328.     int[] arrayOfInt3 = { 49513, 49514, 49515, 54277 };
  15329.  
  15330.     ArrayList localArrayList = new ArrayList();
  15331.  
  15332.     RSObject localRSObject1 = a.J(new String[] { "Large crystal" }); RSObject localRSObject2 = null;
  15333.  
  15334.     if (localRSObject1 == null) {
  15335.       return -1;
  15336.     }
  15337.  
  15338.     RSTile localRSTile1 = localRSObject1.getLocation(); Object localObject1 = null;
  15339.     Object localObject2;
  15340.     int i1 = (localObject2 = a.J(a.te)).length;
  15341.     int i2;
  15342.     RSObject[] arrayOfRSObject = localObject2[i2];
  15343.  
  15344.     localArrayList.add(arrayOfRSObject.getLocation());
  15345.  
  15346.     i2++;
  15347.     RSTile localRSTile2;
  15348.     while (true)
  15349.     {
  15350.       if (localObject1 != null) if (a.J(new String[] { "Inactive lodestone" }) == null)
  15351.           break;
  15352.       if (a.jA())
  15353.       {
  15354.         return 2;
  15355.       }
  15356.       if (!a.j()) {
  15357.         return -1;
  15358.       }
  15359.  
  15360.       if (a.l(a.J(new String[] { "Inactive lodestone" }), "Power-up"))
  15361.         a.K(true);
  15362.       if (
  15363.         (localRSObject2 = a.i(arrayOfInt2)) == null)
  15364.       {
  15365.         continue;
  15366.       }
  15367.  
  15368.       for (localObject2 = localArrayList.iterator(); ((Iterator)localObject2).hasNext(); )
  15369.         if ((
  15370.           (localRSTile2 = (RSTile)((Iterator)localObject2).next()) != null) && (a.calc.distanceBetween(localRSTile2, localRSObject2.getLocation()) < 3.0D))
  15371.         {
  15372.           localObject1 = localRSTile2;
  15373.  
  15374.           break;
  15375.         }
  15376.     }
  15377.     localArrayList.remove(localObject1);
  15378.  
  15379.     label789: while (a.i(arrayOfInt3) == null)
  15380.       for (localObject2 = localArrayList.iterator(); ((Iterator)localObject2).hasNext(); ) { localRSTile2 = (RSTile)((Iterator)localObject2).next();
  15381.  
  15382.         i2 = 0;
  15383.  
  15384.         a.vE = localRSTile2;
  15385.  
  15386.         if (i2 == 0)
  15387.         {
  15388.           if (a.jA()) {
  15389.             return 2;
  15390.           }
  15391.  
  15392.           int i4 = (arrayOfRSObject = a.J(arrayOfInt1)).length;
  15393.           int i5;
  15394.           RSObject localRSObject3;
  15395.           if (((localRSObject3 = arrayOfRSObject[i5]) != null) &&
  15396.             (a.calc.distanceBetween(a.vE, localRSObject3.getLocation()) < 3.0D)) {
  15397.             i2 = localRSObject3.getID();
  15398.           }
  15399.  
  15400.           i5++;
  15401.  
  15402.           a.sleep(100, 200);
  15403.         }
  15404.         a.F(a.vE, 1);
  15405.  
  15406.         if (a.jA())
  15407.         {
  15408.           return 2;
  15409.         }
  15410.         if ((a.i(new int[] { i2 }) != null) || (!a.X().equals(a.vE)))
  15411.         {
  15412.           if (a.jA())
  15413.           {
  15414.             return 2;
  15415.           }
  15416.  
  15417.           if (a.i(arrayOfInt3) == null)
  15418.           {
  15419.             if (a.X().equals(a.vE))
  15420.             {
  15421.               if (a.i(new int[] { i2 }) == null)
  15422.               {
  15423.                 break label789;
  15424.               }
  15425.  
  15426.               a.F(a.vE, 1);
  15427.             }
  15428.             else if (a.l(localRSTile1, a.i(new int[] { i2 })) == 3)
  15429.             {
  15430.               a.A(a.vE, 0);
  15431.  
  15432.               a.K(false);
  15433.             }
  15434.             a.sleep(100, 200);
  15435.           }
  15436.         }
  15437.         if (a.X().equals(a.vE))
  15438.         {
  15439.           if (a.l(localRSTile1, a.i(arrayOfInt2)) == 3)
  15440.           {
  15441.             a.l(localRSTile1, 1);
  15442.  
  15443.             a.l(false);
  15444.           }
  15445.           a.sleep(30, 50);
  15446.         }
  15447.         int i3;
  15448.         for (; (i3 = 0) < 10; tmpTernaryOp = 10)
  15449.         {
  15450.           if (a.l(localRSTile1, a.i(arrayOfInt2)) == a.l(localRSTile1, a.i(new int[] { i2 })))
  15451.           {
  15452.             a.log("Let the light go at the proper position.");
  15453.  
  15454.             a.vE = null;
  15455.  
  15456.             break;
  15457.           }
  15458.           if ((a.i(arrayOfInt3) != null) || (a.AA()))
  15459.           {
  15460.             break;
  15461.           }
  15462.  
  15463.           a.sleep(100, 150);
  15464.  
  15465.           i3++;
  15466.         }
  15467.       }
  15468.     return 1;
  15469.   }
  15470.  
  15471.   private boolean C()
  15472.   {
  15473.     if ((!a.nA) && (a.objects.getAll().length > 200))
  15474.     {
  15475.       a.log("This dungeon appears to have already been explored.");
  15476.  
  15477.       a.jC = false;
  15478.  
  15479.       a.nc = true;
  15480.  
  15481.       return false;
  15482.     }
  15483.     return true;
  15484.   }
  15485.  
  15486.   private boolean l(int a, RSNPC a)
  15487.   {
  15488.     RSItem localRSItem = a.inventory.getItem(new int[] { a });
  15489.  
  15490.     if ((a == null) || (localRSItem == null)) {
  15491.       return false;
  15492.     }
  15493.  
  15494.     if (a.calc.distanceTo(a) > 4)
  15495.     {
  15496.       a.l(a.getLocation(), 1);
  15497.     }
  15498.     if (!a.F(a))
  15499.     {
  15500.       return false;
  15501.     }
  15502.  
  15503.     a.sleep(200, 400);
  15504.  
  15505.     return (a.inventory.getSelectedItem() != null) && (a.doAction("Use"));
  15506.   }
  15507.  
  15508.   private boolean l(RSTile a, int a, int a)
  15509.   {
  15510.     if (a == null)
  15511.     {
  15512.       return false;
  15513.     }
  15514.     RSTile localRSTile1 = a.X(); RSTile localRSTile2 = new RSTile(a.getX() + a, a.getY() + a);
  15515.  
  15516.     if (localRSTile1.equals(localRSTile2))
  15517.     {
  15518.       return true;
  15519.     }
  15520.     int i3;
  15521.     if (a.calc.distanceTo(localRSTile2) > 1)
  15522.     {
  15523.       RSTile[] arrayOfRSTile;
  15524.       int i2 = (arrayOfRSTile = a.h(a)).length; RSTile localRSTile3 = arrayOfRSTile[i3];
  15525.  
  15526.       if ((a.D(localRSTile3) == null) && (!localRSTile3.equals(localRSTile2)) && (a.calc.distanceBetween(localRSTile3, localRSTile2) < 2.0D))
  15527.       {
  15528.         a.A(localRSTile3, 0);
  15529.  
  15530.         a.K(false);
  15531.       } else {
  15532.         i3++;
  15533.       }
  15534.  
  15535.     }
  15536.  
  15537.     a.A(localRSTile2, 0);
  15538.  
  15539.     a.K(false);
  15540.  
  15541.     if (a.X().equals(localRSTile1))
  15542.     {
  15543.       int i1;
  15544.       a.A(a.X(), i1);
  15545.  
  15546.       a.K(false);
  15547.  
  15548.       i1++;
  15549.  
  15550.       a.A(localRSTile2, 0);
  15551.  
  15552.       a.K(false);
  15553.     }
  15554.     return a.X().equals(localRSTile2);
  15555.   }
  15556.  
  15557.   private int B()
  15558.   {
  15559.     a.A(false);
  15560.  
  15561.     a.PD = a.xb;
  15562.  
  15563.     g localg = new g(a);
  15564.  
  15565.     if (a.i(new String[] { "Monolith" }) != null);
  15566.     if (a.jA())
  15567.     {
  15568.       return 2;
  15569.     }
  15570.     RSNPC localRSNPC;
  15571.     if (
  15572.       (localRSNPC = a.i(new String[] { "Monolith" })) != null) {
  15573.       if (a.npcs.getNearest(new int[] { 10978, 10979, 10980, 12176 }) == null)
  15574.       {
  15575.         a.vE = localRSNPC.getLocation();
  15576.  
  15577.         if ((!a.Y().isMoving()) && (a.calc.distanceTo(a.vE) > 3))
  15578.           a.A(a.vE, 2);
  15579.         if (a.F(localRSNPC, "Activate"))
  15580.         {
  15581.           a.K(false);
  15582.         }
  15583.       }
  15584.       else
  15585.       {
  15586.         a.jA = a.npcs.getNearest(localg);
  15587.  
  15588.         if (a.jA == null)
  15589.         {
  15590.           a.jA = a.npcs.getNearest(a.B);
  15591.         }
  15592.         if (a.F(a.jA))
  15593.         {
  15594.           a.vE = null;
  15595.  
  15596.           a.sleep(500, 800);
  15597.         }
  15598.         else if (a.jA == null)
  15599.         {
  15600.           a.vE = localRSNPC.getLocation();
  15601.  
  15602.           if ((a.calc.distanceTo(localRSNPC) > 2) && (!a.Y().isMoving()))
  15603.             a.l(localRSNPC.getLocation(), 1);
  15604.           if (!a.JC()) {
  15605.             a.sleep(300, 400);
  15606.           }
  15607.  
  15608.         }
  15609.  
  15610.         a.l(a.vc, 50, 50);
  15611.       }
  15612.  
  15613.     }
  15614.  
  15615.     a.sleep(100, 200);
  15616.  
  15617.     a.A(true);
  15618.  
  15619.     return 1;
  15620.   }
  15621.  
  15622.   private boolean l(RSTile a, int a)
  15623.   {
  15624.     if (a != null)
  15625.     {
  15626.       if (a > 0) {
  15627.         a = new RSTile(a.getX() + a.random(-a, a + 1), a.getY() + a.random(-a, a + 1));
  15628.       }
  15629.  
  15630.       if (a.X().equals(a))
  15631.         return false;
  15632.       Point localPoint;
  15633.       if (
  15634.         (localPoint = a.calc.tileToMinimap(a)).x == -1)
  15635.       {
  15636.         if ((a = a.walking.getClosestTileOnMap(a)) == null)
  15637.         {
  15638.           return false;
  15639.         }
  15640.  
  15641.         localPoint = a.calc.tileToMinimap(a);
  15642.       }
  15643.  
  15644.       if (localPoint.x != -1)
  15645.       {
  15646.         a.mouse.move(localPoint);
  15647.  
  15648.         if (
  15649.           (localPoint = a.calc.tileToMinimap(a)).x != -1)
  15650.         {
  15651.           a.mouse.click(localPoint, true);
  15652.  
  15653.           return true;
  15654.         }
  15655.       }
  15656.     }
  15657.     return false;
  15658.   }
  15659.  
  15660.   private int c()
  15661.   {
  15662.     if (!a.O())
  15663.     {
  15664.       return -1;
  15665.     }
  15666.     int[] arrayOfInt = { 13070, 13071, 13072, 13073, 13074, 13075, 13076, 13077, 13078, 13079, 13080, 13081, 13082, 13083, 13084, 13085, 13086, 13087 };
  15667.  
  15668.     boolean bool = false;
  15669.  
  15670.     RSObject localRSObject1 = a.i(new int[] { 39980, 39988, 54490, 54496, 54613 });
  15671.  
  15672.     a.jA = a.npcs.getNearest(a.B);
  15673.  
  15674.     if ((a.jA != null) && ((a.HC != 1) || (a.l(a.jA.getLocation(), false))))
  15675.     {
  15676.       if ((!a.QB()) || ((a.HC == 1) && (!a.ZA())))
  15677.         return 2;
  15678.     }
  15679.     if (a.hd == null)
  15680.     {
  15681.       a.hd = new Timer(a.random(240000, 300000));
  15682.     }
  15683.     bool = a.F(a.u) == null;
  15684.  
  15685.     a.A(bool);
  15686.  
  15687.     while (a.i(a.Mc) == null)
  15688.     {
  15689.       if (a.jA())
  15690.       {
  15691.         return 2;
  15692.       }
  15693.       if (!a.j())
  15694.       {
  15695.         return -1;
  15696.       }
  15697.       RSObject localRSObject2 = a.i(new int[] { 40157, 40158, 54617, 54618 });
  15698.  
  15699.       RSNPC localRSNPC = a.D(arrayOfInt);
  15700.  
  15701.       a.l(a.vc, 40, 50);
  15702.  
  15703.       if (localRSNPC != null)
  15704.       {
  15705.         if (a.SE.contains("cannot push"))
  15706.         {
  15707.           RSObject localRSObject3;
  15708.           if ((localRSObject3 = a.J(new String[] { "Statue" })) == null)
  15709.           {
  15710.             a.A(a.X(), 4);
  15711.           }
  15712.           else
  15713.             a.F(localRSObject3.getLocation());
  15714.           a.SE = "";
  15715.         }
  15716.         else
  15717.         {
  15718.           a.F(localRSNPC, "Push");
  15719.         }
  15720.       }
  15721.       else if ((a.inventory.contains(19877)) && (localRSObject2 != null))
  15722.       {
  15723.         if (a.l(localRSObject2, "Repair"))
  15724.         {
  15725.           a.K(false);
  15726.  
  15727.           a.K(false);
  15728.         }
  15729.       }
  15730.       else if (!a.inventory.contains(19877))
  15731.         a.l(localRSObject1, "Mine");
  15732.       a.K(bool);
  15733.  
  15734.       if (a.Rc())
  15735.       {
  15736.         a.sleep(800, 1100);
  15737.       }
  15738.  
  15739.     }
  15740.  
  15741.     if (a.M)
  15742.     {
  15743.       a.f();
  15744.     }
  15745.     return 1;
  15746.   }
  15747.  
  15748.   public void mouseClicked(MouseEvent a)
  15749.   {
  15750.     Point localPoint = a.getPoint();
  15751.  
  15752.     a.YF = a.getPoint();
  15753.  
  15754.     if (a.vg.contains(localPoint))
  15755.     {
  15756.       if (a.qC)
  15757.       {
  15758.         a.Od = false;
  15759.  
  15760.         a.Qc = "Shutting down iDungeon Pro";
  15761.  
  15762.         a.AB = "";
  15763.       }
  15764.       else if (a.AB.isEmpty())
  15765.       {
  15766.         a.ZB = true;
  15767.       }
  15768.       else
  15769.       {
  15770.         a.ZB = (!a.ZB);
  15771.       }
  15772.     }
  15773.     else if (a.kc.contains(localPoint))
  15774.     {
  15775.       a.qd = (!a.qd);
  15776.     }
  15777.     else if (a.Pg.contains(localPoint))
  15778.     {
  15779.       a.qC = (!a.qC);
  15780.  
  15781.       a.ZB = true;
  15782.  
  15783.       a.AB = (a.qC ? "Click here to confirm shutdown" : "");
  15784.     }
  15785.     else if (a.Rb.contains(localPoint))
  15786.     {
  15787.       try
  15788.       {
  15789.         Desktop.getDesktop().browse(new URI("http://shadowscripting.com/forums/viewforum.php?f=2"));
  15790.       }
  15791.       catch (Exception localException)
  15792.       {
  15793.         a.log("Unable to load the forums :(");
  15794.       }
  15795.     }
  15796.     else if (a.Q.contains(localPoint))
  15797.     {
  15798.       try
  15799.       {
  15800.         Desktop.getDesktop().browse(new URI("http://shadowscripting.wordpress.com/idungeon-users-guide/"));
  15801.       }
  15802.       catch (Exception localException1)
  15803.       {
  15804.         a.log("Unable to load the help manual :(");
  15805.       }
  15806.     }
  15807.     else if (a.ag.contains(localPoint))
  15808.     {
  15809.       a.iA = (!a.iA);
  15810.     }
  15811.     else if (!a.iA)
  15812.     {
  15813.       if (a.o.contains(localPoint))
  15814.       {
  15815.         a.Wc = (!a.Wc);
  15816.       }
  15817.       else if ((a.H.contains(localPoint)) && (!a.dc))
  15818.       {
  15819.         a.UB = true;
  15820.  
  15821.         a.qD = false;
  15822.       }
  15823.       else if ((a.m.contains(localPoint)) && (!a.dc))
  15824.       {
  15825.         a.UB = false;
  15826.  
  15827.         a.qD = true;
  15828.       }
  15829.       else if ((a.dc) && (a.uB == 0))
  15830.       {
  15831.         if (a.wA.contains(localPoint))
  15832.         {
  15833.           a.O[0][0] = 1;
  15834.  
  15835.           a.O[0][1] = 0;
  15836.  
  15837.           a.O[0][2] = 0;
  15838.  
  15839.           a.O[0][3] = 0;
  15840.  
  15841.           a.O[1][1] = 0;
  15842.  
  15843.           a.k = true;
  15844.  
  15845.           a.Xd = false;
  15846.  
  15847.           a.IB = false;
  15848.  
  15849.           a.i = false;
  15850.  
  15851.           a.ec = false;
  15852.         }
  15853.         else if (a.aB.contains(localPoint))
  15854.         {
  15855.           a.O[0][0] = 0;
  15856.  
  15857.           a.O[0][1] = 1;
  15858.  
  15859.           a.O[0][2] = 0;
  15860.  
  15861.           if (a.O[0][5] == 0)
  15862.           {
  15863.             a.O[0][3] = 1;
  15864.  
  15865.             a.i = true;
  15866.           }
  15867.  
  15868.           a.O[0][4] = 0;
  15869.  
  15870.           a.O[1][1] = 1;
  15871.  
  15872.           a.k = false;
  15873.  
  15874.           a.Xd = true;
  15875.  
  15876.           a.IB = false;
  15877.  
  15878.           a.BB = false;
  15879.  
  15880.           a.ec = true;
  15881.         }
  15882.         else if (a.G.contains(localPoint))
  15883.         {
  15884.           a.O[0][0] = 0;
  15885.  
  15886.           a.O[0][1] = 0;
  15887.  
  15888.           a.O[0][2] = 1;
  15889.  
  15890.           if (a.O[0][4] == 0)
  15891.           {
  15892.             a.O[0][3] = 1;
  15893.  
  15894.             a.i = true;
  15895.           }
  15896.  
  15897.           a.O[0][5] = 0;
  15898.  
  15899.           a.O[1][1] = 0;
  15900.  
  15901.           a.k = false;
  15902.  
  15903.           a.Xd = false;
  15904.  
  15905.           a.IB = false;
  15906.  
  15907.           a.vC = false;
  15908.  
  15909.           a.ec = false;
  15910.         }
  15911.         else if (a.mC.contains(localPoint))
  15912.         {
  15913.           a.O[0][3] = (a.O[0][3] == 0 ? 1 : 0);
  15914.  
  15915.           a.i = a.O[0][3];
  15916.  
  15917.           if (a.i)
  15918.           {
  15919.             a.O[0][4] = 0;
  15920.  
  15921.             a.O[0][5] = 0;
  15922.  
  15923.             a.BB = false;
  15924.  
  15925.             a.vC = false;
  15926.           }
  15927.  
  15928.         }
  15929.         else if ((a.fC.contains(localPoint)) && (!a.Xd))
  15930.         {
  15931.           a.O[0][4] = (a.O[0][4] == 0 ? 1 : 0);
  15932.  
  15933.           a.BB = a.O[0][4];
  15934.  
  15935.           if (a.BB)
  15936.           {
  15937.             a.O[0][3] = 0;
  15938.  
  15939.             a.O[0][5] = 0;
  15940.  
  15941.             a.i = false;
  15942.  
  15943.             a.vC = false;
  15944.           }
  15945.  
  15946.         }
  15947.         else if ((a.lF.contains(localPoint)) && (!a.IB))
  15948.         {
  15949.           a.O[0][5] = (a.O[0][5] == 0 ? 1 : 0);
  15950.  
  15951.           a.vC = a.O[0][5];
  15952.  
  15953.           if (a.vC)
  15954.           {
  15955.             a.O[0][3] = 0;
  15956.  
  15957.             a.O[0][4] = 0;
  15958.  
  15959.             a.i = false;
  15960.  
  15961.             a.BB = false;
  15962.           }
  15963.  
  15964.         }
  15965.         else if (a.Ag.contains(localPoint))
  15966.         {
  15967.           a.O[0][6] = (a.O[0][6] == 0 ? 1 : 0);
  15968.  
  15969.           a.XC = a.O[0][6];
  15970.         }
  15971.         else if (a.RE.contains(localPoint))
  15972.         {
  15973.           a.O[0][7] = (a.O[0][7] == 0 ? 1 : 0);
  15974.  
  15975.           a.Yb = a.O[0][7];
  15976.         }
  15977.       }
  15978.       else if (((a.dc) && (a.uB == 1)) || (a.qD))
  15979.       {
  15980.         if (a.xd.contains(localPoint)) {
  15981.           a.DC = 1;
  15982.         }
  15983.         else if (a.iC.contains(localPoint))
  15984.         {
  15985.           a.DC = 2;
  15986.         }
  15987.         else if ((!a.dc) && (a.tC.contains(localPoint)))
  15988.           a.DC = 3;
  15989.         else if (a.DC == 1)
  15990.         {
  15991.           if (a.JD.contains(localPoint))
  15992.           {
  15993.             a.O[1][0] = (a.O[1][0] == 0 ? 1 : 0);
  15994.  
  15995.             a.kf = a.O[1][0];
  15996.           }
  15997.           else if ((a.Mb.contains(localPoint)) && ((a.Xd) || (a.BB)))
  15998.           {
  15999.             a.O[1][1] = (a.O[1][1] == 0 ? 1 : 0);
  16000.  
  16001.             a.ec = a.O[1][1];
  16002.           }
  16003.           else if (a.JG.contains(localPoint))
  16004.           {
  16005.             a.O[1][2] = (a.O[1][2] == 0 ? 1 : 0);
  16006.  
  16007.             a.zA = a.O[1][2];
  16008.           }
  16009.           else if (a.Dc.contains(localPoint))
  16010.           {
  16011.             a.O[1][3] = (a.O[1][3] == 0 ? 1 : 0);
  16012.  
  16013.             a.VA = a.O[1][3];
  16014.           }
  16015.           else if (a.lf.contains(localPoint))
  16016.           {
  16017.             a.O[1][4] = (a.O[1][4] == 0 ? 1 : 0);
  16018.  
  16019.             a.QC = a.O[1][4];
  16020.           }
  16021.           else if (a.Ye.contains(localPoint))
  16022.           {
  16023.             a.O[1][5] = (a.O[1][5] == 0 ? 1 : 0);
  16024.  
  16025.             a.xe = a.O[1][5];
  16026.  
  16027.             if (!a.xe)
  16028.               a.log.severe("Warning! Disabling prayer doors will force the bot to abort many dungeons");
  16029.           }
  16030.           else if (a.zd.contains(localPoint))
  16031.           {
  16032.             a.O[1][6] = (a.O[1][6] == 0 ? 1 : 0);
  16033.  
  16034.             a.gB = a.O[1][6];
  16035.           }
  16036.           else if (a.qF.contains(localPoint))
  16037.           {
  16038.             a.O[1][7] = (a.O[1][7] == 0 ? 1 : 0);
  16039.  
  16040.             a.bc = a.O[1][7];
  16041.           }
  16042.           else if (a.Cd.contains(localPoint))
  16043.           {
  16044.             a.O[1][8] = (a.O[1][8] == 0 ? 1 : 0);
  16045.  
  16046.             a.Fb = a.O[1][8];
  16047.           }
  16048.  
  16049.         }
  16050.         else if (a.DC == 2)
  16051.         {
  16052.           if (a.V.contains(localPoint))
  16053.           {
  16054.             if (a.dC < 6) {
  16055.               a.dC += 1;
  16056.             }
  16057.             else
  16058.             {
  16059.               a.dC = 1;
  16060.             }
  16061.           }
  16062.           else if (a.Ub.contains(localPoint))
  16063.           {
  16064.             if (a.dC > 1)
  16065.               a.dC -= 1;
  16066.             else {
  16067.               a.dC = 6;
  16068.             }
  16069.  
  16070.           }
  16071.           else if (a.lb.contains(localPoint))
  16072.           {
  16073.             if (a.ld != 6) {
  16074.               a.ld += 1;
  16075.             }
  16076.             else
  16077.             {
  16078.               a.ld = 1;
  16079.             }
  16080.           }
  16081.           else if (a.p.contains(localPoint))
  16082.           {
  16083.             if (a.ld != 1)
  16084.             {
  16085.               a.ld -= 1;
  16086.             }
  16087.             else
  16088.               a.ld = 6;
  16089.           }
  16090.           else if (a.qf.contains(localPoint))
  16091.           {
  16092.             if (a.g > 0)
  16093.             {
  16094.               a.td = (a.td < a.g ? ++a.td : 1);
  16095.             }
  16096.             else if (a.td < 35)
  16097.             {
  16098.               a.td += 1;
  16099.             }
  16100.             else
  16101.             {
  16102.               a.td = 1;
  16103.             }
  16104.           }
  16105.           else if (a.D.contains(localPoint))
  16106.           {
  16107.             if (a.td > 1)
  16108.             {
  16109.               a.td -= 1;
  16110.             }
  16111.             else if (a.g > 0)
  16112.             {
  16113.               a.td = a.g;
  16114.             }
  16115.             else
  16116.             {
  16117.               a.td = 35;
  16118.             }
  16119.           }
  16120.           else if (a.gC.contains(localPoint))
  16121.           {
  16122.             a.O[2][0] = (a.O[2][0] == 0 ? 1 : 0);
  16123.  
  16124.             a.E = a.O[2][0];
  16125.           }
  16126.           else if (a.F.contains(localPoint))
  16127.           {
  16128.             a.O[2][1] = (a.O[2][1] == 0 ? 1 : 0);
  16129.  
  16130.             a.Ed = a.O[2][1];
  16131.           }
  16132.           else if (a.cf.contains(localPoint))
  16133.           {
  16134.             a.O[2][2] = (a.O[2][2] == 0 ? 1 : 0);
  16135.  
  16136.             a.od = a.O[2][2];
  16137.           }
  16138.           else if (a.bE.contains(localPoint))
  16139.           {
  16140.             a.O[2][3] = (a.O[2][3] == 0 ? 1 : 0);
  16141.  
  16142.             a.M = a.O[2][3];
  16143.           }
  16144.           else if (a.wc.contains(localPoint))
  16145.           {
  16146.             a.O[2][4] = (a.O[2][4] == 0 ? 1 : 0);
  16147.  
  16148.             a.RC = a.O[2][4];
  16149.           }
  16150.           else if (a.WB.contains(localPoint))
  16151.           {
  16152.             a.O[2][5] = (a.O[2][5] == 0 ? 1 : 0);
  16153.  
  16154.             a.dg = a.O[2][5];
  16155.           }
  16156.  
  16157.         }
  16158.         else if ((!a.dc) && (a.DC == 3)) {
  16159.           if (a.ff.contains(localPoint)) {
  16160.             a.PA = 0;
  16161.           }
  16162.           else
  16163.           {
  16164.             a.PA = -1;
  16165.           }
  16166.  
  16167.         }
  16168.  
  16169.       }
  16170.  
  16171.       if (a.dc)
  16172.       {
  16173.         if (a.Vb.contains(localPoint))
  16174.         {
  16175.           if (a.uB == 0) {
  16176.             a.DC = 1;
  16177.           }
  16178.  
  16179.           a.Pb = false;
  16180.  
  16181.           a.uB += 1;
  16182.  
  16183.           if (a.uB > 4)
  16184.           {
  16185.             a.dc = false;
  16186.  
  16187.             a.nA = true;
  16188.           }
  16189.         }
  16190.         else if ((a.fD.contains(localPoint)) && (a.uB > 0))
  16191.         {
  16192.           if (a.uB == 1)
  16193.             a.DC = 0;
  16194.           a.Pb = true;
  16195.  
  16196.           a.uB -= 1;
  16197.         }
  16198.       }
  16199.       else if (a.UB)
  16200.       {
  16201.         if (a.xd.contains(localPoint))
  16202.           a.h = 1;
  16203.         else if (a.iC.contains(localPoint))
  16204.         {
  16205.           a.h = 2;
  16206.         }
  16207.         else if (a.tC.contains(localPoint))
  16208.           a.h = 3;
  16209.       }
  16210.     }
  16211.   }
  16212.  
  16213.   private int l(int a)
  16214.   {
  16215.     return Skills.XP_TABLE[(a.skills.getRealLevel(a) + 1)] - a.skills.getCurrentExp(a);
  16216.   }
  16217.  
  16218.   private boolean L()
  16219.   {
  16220.     if (a.F(a.yf) != null)
  16221.     {
  16222.       a.uC = "Unkillable slayer monster";
  16223.  
  16224.       return false;
  16225.     }
  16226.  
  16227.     return true;
  16228.   }
  16229.  
  16230.   private RSNPC l(RSTile a, String a)
  16231.   {
  16232.     double d1 = 99999.990000000005D;
  16233.  
  16234.     Object localObject = null;
  16235.     int i2;
  16236.     if (a != null)
  16237.     {
  16238.       RSNPC[] arrayOfRSNPC;
  16239.       int i1 = (arrayOfRSNPC = a.npcs.getAll()).length;
  16240.       RSNPC localRSNPC;
  16241.       RSTile localRSTile =
  16242.         (localRSNPC = arrayOfRSNPC[i2]).getLocation();
  16243.       double d2;
  16244.       if (
  16245.         (d2 = a.calc.distanceBetween(localRSTile, a)) < d1)
  16246.       {
  16247.         if (localRSNPC.getName().toLowerCase().contains(a.toLowerCase()))
  16248.         {
  16249.           d1 = d2;
  16250.  
  16251.           localObject = localRSNPC;
  16252.         }
  16253.  
  16254.       }
  16255.  
  16256.       i2++;
  16257.     }
  16258.     return localObject;
  16259.   }
  16260.  
  16261.   private int m()
  16262.   {
  16263.     int[] arrayOfInt = { 50663, 51762, 54785 };
  16264.  
  16265.     if (!a.O())
  16266.       return -1;
  16267.     if (a.jA()) {
  16268.       return 2;
  16269.     }
  16270.  
  16271.     if (!a.j())
  16272.     {
  16273.       return -1;
  16274.     }
  16275.     RSNPC localRSNPC = a.D(new int[] { 11010 });
  16276.  
  16277.     RSObject localRSObject = a.i(new int[] { 49589, 49590, 49591, 54005 });
  16278.     int i1;
  16279.     if (
  16280.       (i1 = a.J(new int[] { 49592 }).length) < 3)
  16281.     {
  16282.       if (a.inventory.getCount(new int[] { 17377, 17378 }) < 3 - i1)
  16283.       {
  16284.         if (a.l(localRSObject, "Chop")) {
  16285.           a.K(true);
  16286.         }
  16287.  
  16288.       }
  16289.       else if (a.inventory.contains(17378))
  16290.       {
  16291.         Object localObject1 = null;
  16292.  
  16293.         a.vE = null;
  16294.  
  16295.         if (a.calc.distanceTo(a.r.getCentralTile()) > 6)
  16296.         {
  16297.           a.A(a.r.getCentralTile(), 3);
  16298.  
  16299.           a.K(false);
  16300.         }
  16301.         Object localObject2;
  16302.         int i2 = (localObject2 = a.J(arrayOfInt)).length;
  16303.         int i3;
  16304.         Object localObject3;
  16305.         RSTile localRSTile1 = (localObject3 = localObject2[i3])
  16306.           .getLocation();
  16307.         RSTile localRSTile2;
  16308.         if ((
  16309.           (localRSTile2 = a.F(localRSTile1, new int[] { 49592 })) == null) || (a.calc.distanceBetween(localRSTile1, localRSTile2) > 3.0D))
  16310.         {
  16311.           localObject1 = localRSTile1;
  16312.         }
  16313.         else {
  16314.           i3++;
  16315.         }
  16316.  
  16317.         if (localObject1 != null)
  16318.         {
  16319.           localObject2 = null;
  16320.           RSTile[] arrayOfRSTile;
  16321.           i3 = (arrayOfRSTile = a.J(localObject1)).length;
  16322.           int i4;
  16323.           localRSTile1 = arrayOfRSTile[i4];
  16324.  
  16325.           if ((a.r.contains(new RSTile[] { localRSTile1 })) && (a.G(localRSTile1) == null)) {
  16326.             localObject2 = localRSTile1;
  16327.           }
  16328.           else
  16329.           {
  16330.             i4++;
  16331.           }
  16332.  
  16333.           if (localObject2 != null)
  16334.           {
  16335.             i3 = (arrayOfRSTile = a.h((RSTile)localObject2)).length; localRSTile1 = arrayOfRSTile[i4];
  16336.  
  16337.             if (a.G(localRSTile1) == null)
  16338.               a.vE = localRSTile1;
  16339.             else {
  16340.               i4++;
  16341.             }
  16342.  
  16343.             if ((a.vE != null) && (a.inventory.contains(17378)))
  16344.             {
  16345.               if (!a.X().equals(a.vE))
  16346.               {
  16347.                 if (a.jA()) {
  16348.                   return 2;
  16349.                 }
  16350.  
  16351.                 a.i(a.vE, 0);
  16352.  
  16353.                 if (!a.inventory.contains(17378))
  16354.                 {
  16355.                   a.inventory.getItem(new int[] { 17377 }).doClick(true);
  16356.  
  16357.                   a.sleep(400, 700);
  16358.                 }
  16359.                 a.K(false);
  16360.               }
  16361.  
  16362.               if (a.l(17378, "Lay"))
  16363.               {
  16364.                 a.sleep(1000, 1300);
  16365.  
  16366.                 a.K(true);
  16367.               }
  16368.             }
  16369.           }
  16370.         }
  16371.       }
  16372.       else if (a.inventory.contains(17377))
  16373.       {
  16374.         a.inventory.getItem(new int[] { 17377 }).doClick(true);
  16375.  
  16376.         a.sleep(700, 900);
  16377.       }
  16378.     }
  16379.     else
  16380.     {
  16381.       if (localRSNPC != null) {
  16382.         a.vE = localRSNPC.getLocation();
  16383.       }
  16384.  
  16385.       a.l(a.vE, 2);
  16386.     }
  16387.     a.K(false);
  16388.  
  16389.     if (a.jA()) {
  16390.       return 2;
  16391.     }
  16392.  
  16393.     if (a.l(a.i(new int[] { 49593 }), "Pick-up"))
  16394.       a.K(true);
  16395.     a.sleep(400, 600);
  16396.  
  16397.     return 1;
  16398.   }
  16399.  
  16400.   private boolean k()
  16401.   {
  16402.     return a.combat.getFightMode() == 4;
  16403.   }
  16404.  
  16405.   private int b()
  16406.   {
  16407.     ArrayList localArrayList = new ArrayList();
  16408.  
  16409.     if (a.jA())
  16410.     {
  16411.       return 2;
  16412.     }
  16413.     localArrayList.clear();
  16414.     RSObject[] arrayOfRSObject;
  16415.     int i3 = (arrayOfRSObject = a.J(a.OC)).length;
  16416.     int i4;
  16417.     Object localObject1 = arrayOfRSObject[i4];
  16418.  
  16419.     localArrayList.add(((RSObject)localObject1).getLocation());
  16420.  
  16421.     i4++;
  16422.  
  16423.     int i1 = 4 - localArrayList.size();
  16424.  
  16425.     a.Qc = ("Puzzle room: Icy Pads (" + i1 + " of 4)");
  16426.  
  16427.     int i2 = a.X().getX(); i3 = a.X().getY();
  16428.  
  16429.     for (Iterator localIterator = localArrayList.iterator(); localIterator.hasNext(); ) { localObject1 = (RSTile)localIterator.next();
  16430.  
  16431.       if (a.l(a.X(), (RSTile)localObject1))
  16432.       {
  16433.         a.vE = ((RSTile)localObject1);
  16434.  
  16435.         a.log("Good pad found!");
  16436.  
  16437.         break;
  16438.       }
  16439.     }
  16440.     int i5;
  16441.     int i11;
  16442.     if (a.vE != null)
  16443.     {
  16444.       a.A(a.vE, 0);
  16445.  
  16446.       a.K(false);
  16447.  
  16448.       if (a.X().equals(a.vE))
  16449.       {
  16450.         a.log("Sucessfully pressed a pad!");
  16451.       }
  16452.       a.vE = null;
  16453.     }
  16454.     else if (
  16455.       (i5 = a.random(0, 13)) == 0)
  16456.     {
  16457.       if (a.A(a.r.getCentralTile(), 0))
  16458.       {
  16459.         a.K(true);
  16460.       }
  16461.     }
  16462.     else if (i5 == 1)
  16463.     {
  16464.       int i6 = a.random(-1, 2); int i8 = a.random(-1, 2);
  16465.  
  16466.       RSTile localRSTile1 = new RSTile(i2 + i6, i3 + i8);
  16467.  
  16468.       if ((a.J(localRSTile1, new int[0])) && (a.A(localRSTile1, 0)))
  16469.       {
  16470.         a.K(true);
  16471.       }
  16472.     }
  16473.     else
  16474.     {
  16475.       Object localObject2;
  16476.       RSTile localRSTile5;
  16477.       if (i5 > 9)
  16478.       {
  16479.         localObject2 = null;
  16480.         RSTile[] arrayOfRSTile1;
  16481.         i11 = (arrayOfRSTile1 = a.J(a.X())).length;
  16482.         int i12;
  16483.         localRSTile5 = arrayOfRSTile1[i12];
  16484.  
  16485.         if (a.J(localRSTile5, new int[0])) {
  16486.           localObject2 = localRSTile5;
  16487.         }
  16488.  
  16489.         i12++;
  16490.  
  16491.         if (a.A((RSTile)localObject2, 0)) {
  16492.           a.K(true);
  16493.         }
  16494.  
  16495.       }
  16496.       else if (i5 > 6)
  16497.       {
  16498.         int i9 = (localObject2 = a.J(a.X())).length; RSTile localRSTile3 = localObject2[i11];
  16499.  
  16500.         if ((a.J(localRSTile3, new int[0])) && (a.A(localRSTile3, 0)))
  16501.         {
  16502.           a.K(true);
  16503.         }
  16504.         else
  16505.           i11++;
  16506.       }
  16507.       else if (i5 > 4)
  16508.       {
  16509.         localObject2 = null;
  16510.         RSTile[] arrayOfRSTile2;
  16511.         i11 = (arrayOfRSTile2 = a.h(a.X())).length;
  16512.         int i13;
  16513.         localRSTile5 = arrayOfRSTile2[i13];
  16514.  
  16515.         if (a.J(localRSTile5, new int[0])) {
  16516.           localObject2 = localRSTile5;
  16517.         }
  16518.  
  16519.         i13++;
  16520.  
  16521.         if (a.A((RSTile)localObject2, 0))
  16522.         {
  16523.           a.K(true);
  16524.         }
  16525.  
  16526.       }
  16527.       else
  16528.       {
  16529.         int i10 = (localObject2 = a.h(a.X())).length; RSTile localRSTile4 = localObject2[i11];
  16530.  
  16531.         if ((a.J(localRSTile4, new int[0])) && (a.A(localRSTile4, 0))) {
  16532.           a.K(true);
  16533.         }
  16534.         else
  16535.         {
  16536.           i11++;
  16537.         }
  16538.       }
  16539.     }
  16540.     a.sleep(100, 400);
  16541.     RSObject localRSObject;
  16542.     if (
  16543.       (localRSObject = a.i(new int[] { 49334 })) != null)
  16544.     {
  16545.       a.AB = "Navigating to the nearest corner";
  16546.  
  16547.       a.vE = localRSObject.getLocation();
  16548.  
  16549.       a.A(a.vE, 0);
  16550.  
  16551.       a.K(false);
  16552.       RSGroundItem[] arrayOfRSGroundItem;
  16553.       i5 = (arrayOfRSGroundItem = a.groundItems.getAll()).length;
  16554.       int i7;
  16555.       RSGroundItem localRSGroundItem;
  16556.       RSTile localRSTile2 = (localRSGroundItem = arrayOfRSGroundItem[i7])
  16557.         .getLocation();
  16558.  
  16559.       if (!a.RD.contains(localRSTile2)) if (a.r.contains(new RSTile[] { localRSTile2 }))
  16560.         {
  16561.           a.RD.add(localRSTile2);
  16562.         }
  16563.       i7++;
  16564.  
  16565.       a.lA();
  16566.  
  16567.       a.l(a.nD, 0);
  16568.     }
  16569.  
  16570.     return 1;
  16571.   }
  16572.  
  16573.   private void f()
  16574.   {
  16575.     ArrayList localArrayList = new ArrayList();
  16576.     try
  16577.     {
  16578.       int[][] arrayOfInt = a.walking.getCollisionFlags(a.game.getPlane());
  16579.  
  16580.       int i1 = a.game.getBaseX(); int i2 = a.game.getBaseY();
  16581.  
  16582.       int i3 = a.r.getX() - i1; int i4 = a.r.getY() - i2;
  16583.       int i5;
  16584.       int i6;
  16585.       if ((arrayOfInt[(i5 + 1)][(i6 + 1)] & 0x1280100) != 0)
  16586.       {
  16587.         localArrayList.add(new RSTile(i5 + i1, i6 + i2));
  16588.       }
  16589.  
  16590.       i6++;
  16591.  
  16592.       i5++;
  16593.  
  16594.       localArrayList.removeAll(a.ue);
  16595.     }
  16596.     catch (Exception localException1)
  16597.     {
  16598.     }
  16599.  
  16600.     a.be = localArrayList;
  16601.   }
  16602.  
  16603.   private boolean F(RSTile a)
  16604.   {
  16605.     if (a == null)
  16606.       return false;
  16607.     int i1;
  16608.     while (a.calc.distanceTo(a) > 1)
  16609.     {
  16610.       if ((a.lc != null) && (a.lc.getElapsed() > 30000L) && (!a.l(a.nD, true))) {
  16611.         return false;
  16612.       }
  16613.  
  16614.       if (a.Zc())
  16615.       {
  16616.         return false;
  16617.       }
  16618.       if (a.calc.distanceTo(a) < 2)
  16619.       {
  16620.         return true;
  16621.       }
  16622.       if (a.A(a, 1))
  16623.       {
  16624.         a.K(false);
  16625.  
  16626.         if (a.calc.distanceTo(a) > 1)
  16627.         {
  16628.           a.A(a.X(), i1);
  16629.  
  16630.           a.K(false);
  16631.         }
  16632.  
  16633.       }
  16634.  
  16635.       a.sleep(300, 400);
  16636.  
  16637.       i1++;
  16638.     }
  16639.  
  16640.     return true;
  16641.   }
  16642.  
  16643.   public int loop()
  16644.   {
  16645.     if (!a.Od)
  16646.     {
  16647.       return -1;
  16648.     }
  16649.  
  16650.     if (a.game.isLoggedIn())
  16651.     {
  16652.       a.mouse.setSpeed(a.random(5, 8));
  16653.  
  16654.       if (a.zB)
  16655.       {
  16656.         a.uA();
  16657.  
  16658.         if (a.nc)
  16659.         {
  16660.           a.aA();
  16661.  
  16662.           a.nc = false;
  16663.         }
  16664.         else if (a.Ke)
  16665.         {
  16666.           a.s();
  16667.  
  16668.           a.Ke = false;
  16669.         }
  16670.         else if (a.N)
  16671.         {
  16672.           a.eB();
  16673.  
  16674.           a.N = false;
  16675.         }
  16676.         else if (a.nA)
  16677.         {
  16678.           if (a.FF)
  16679.           {
  16680.             a.vE = null;
  16681.  
  16682.             if (a.i(a.gb) != null)
  16683.             {
  16684.               a.Ke = true;
  16685.             }
  16686.             else if (a.ud.equals("Frozen")) {
  16687.               a.wA();
  16688.             }
  16689.             else if (a.ud.equals("Abandoned"))
  16690.               a.LA();
  16691.             else if (a.ud.equals("Furnished")) {
  16692.               a.Qd();
  16693.             }
  16694.             else if (a.ud.equals("Occult")) {
  16695.               a.i();
  16696.             }
  16697.             else
  16698.             {
  16699.               a.h();
  16700.             }
  16701.             a.FF = false;
  16702.  
  16703.             a.X = false;
  16704.           }
  16705.           else if (a.hB)
  16706.           {
  16707.             a.e();
  16708.  
  16709.             a.hB = false;
  16710.           }
  16711.           else if (a.Fg)
  16712.           {
  16713.             if (a.qb())
  16714.             {
  16715.               a.hB = true;
  16716.             }
  16717.             else
  16718.               a.X = true;
  16719.             a.nD = null;
  16720.  
  16721.             a.lc = null;
  16722.  
  16723.             a.Fg = false;
  16724.           }
  16725.           else if (a.X)
  16726.           {
  16727.             a.g();
  16728.  
  16729.             a.X = false;
  16730.           }
  16731.           else
  16732.           {
  16733.             if (a.jA())
  16734.             {
  16735.               return 100;
  16736.             }
  16737.             if (a.UA) {
  16738.               a.AB = "Hmm... Looks like we're stuck";
  16739.             }
  16740.  
  16741.             a.sleep(200, 400);
  16742.  
  16743.             a.g();
  16744.           }
  16745.         }
  16746.       }
  16747.       else
  16748.       {
  16749.         RSObject localRSObject1 = a.objects.getNearest(new int[] { 50552 });
  16750.  
  16751.         RSObject localRSObject2 = a.objects.getNearest(new int[] { 48496 });
  16752.  
  16753.         a.uA();
  16754.  
  16755.         if ((a.N) && (a.M()))
  16756.         {
  16757.           a.Qc = "Starting a new dungeon!";
  16758.  
  16759.           a.zB = true;
  16760.  
  16761.           a.eB();
  16762.         }
  16763.         else if (localRSObject1 != null)
  16764.         {
  16765.           a.Qc = "Jumping down the stairs...";
  16766.  
  16767.           if (a.l(localRSObject1, "Jump-down"))
  16768.           {
  16769.             a.K(true);
  16770.  
  16771.             a.K(true);
  16772.           }
  16773.         }
  16774.         else if (localRSObject2 != null)
  16775.         {
  16776.           a.BA();
  16777.         }
  16778.         else
  16779.         {
  16780.           if (a.jA())
  16781.           {
  16782.             return 100;
  16783.           }
  16784.  
  16785.           a.AB = "We don't know what to do :(";
  16786.         }
  16787.  
  16788.       }
  16789.  
  16790.     }
  16791.     else
  16792.     {
  16793.       a.camera.setPitch(true);
  16794.     }
  16795.     return a.random(0, 10);
  16796.   }
  16797.  
  16798.   private void e()
  16799.   {
  16800.     if (a.nb != null) if (a.nb.contains(new RSTile[] { a.X() }))
  16801.       {
  16802.         a.X = false;
  16803.  
  16804.         a.FF = true;
  16805.  
  16806.         return;
  16807.       }
  16808.  
  16809.  
  16810.     a.eC = ((a.Xb) && (!a.l(a.r, a.GB)));
  16811.  
  16812.     a.a.clear();
  16813.  
  16814.     a.uc.clear();
  16815.  
  16816.     if (a.Nc.size() > 1)
  16817.     {
  16818.       a.Qc = (a.ZA != null ? "Exploring a new room" : "Exploring an old room");
  16819.     }
  16820.     a.ZA = null;
  16821.  
  16822.     int i1 = 0;
  16823.  
  16824.     int i2 = 0;
  16825.  
  16826.     a.uA();
  16827.     Object localObject;
  16828.     if ((a.Zc > 4) && (!a.JB.contains(a.r)) && (!a.ic.contains(a.r)))
  16829.       for (localObject = a.fA.iterator(); ((Iterator)localObject).hasNext(); ) { localRSTile = (RSTile)((Iterator)localObject).next();
  16830.  
  16831.         if ((a.r.contains(new RSTile[] { localRSTile })) && (!a.fG.contains(localRSTile)))
  16832.         {
  16833.           i1 = 1;
  16834.  
  16835.           break;
  16836.         }
  16837.       }
  16838.     RSTile localRSTile;
  16839.     if (i1 != 0)
  16840.     {
  16841.       a.KD = false;
  16842.  
  16843.       a.NA = false;
  16844.  
  16845.       i2 = a.Z();
  16846.  
  16847.       localObject = a.Qc.contains("Puzzle room: ") ? a.Qc.substring(a.Qc.indexOf(":") + 2) : "Unknown puzzle";
  16848.  
  16849.       if ((i2 == 1) || (a.KD))
  16850.       {
  16851.         a.log("Puzzle: " + (String)localObject + " completed successfully" + (a.hd != null ? " in " + a.hd.toElapsedString() : "") + "!");
  16852.  
  16853.         a.vE = null;
  16854.  
  16855.         a.uA += 1;
  16856.  
  16857.         a.l.remove(a.r);
  16858.  
  16859.         a.aE.add(a.r);
  16860.  
  16861.         a.hA = new Timer(a.random(360000, 480000));
  16862.  
  16863.         a.KA = new Timer(0L);
  16864.  
  16865.         a.ic.remove(a.r);
  16866.  
  16867.         a.qA.clear();
  16868.       }
  16869.       else
  16870.       {
  16871.         if (i2 == 2)
  16872.         {
  16873.           if (a.nc) {
  16874.             return;
  16875.           }
  16876.  
  16877.           if ((a.hd != null) && ((!a.hd.isRunning()) || (a.Qc.contains("reengage"))))
  16878.           {
  16879.             a.log.severe("Took too long to solve Puzzle: " + (String)localObject + " (" + (a.hd != null ? a.hd.toElapsedString() : "unknown time") + ")");
  16880.  
  16881.             if (a.UA) {
  16882.               a.env.saveScreenshot(false);
  16883.             }
  16884.  
  16885.             a.X = true;
  16886.  
  16887.             a.PD = -1;
  16888.  
  16889.             a.fG.addAll(a.ob);
  16890.  
  16891.             a.ic.add(a.r);
  16892.  
  16893.             a.J.removeAll(a.fG);
  16894.  
  16895.             a.Bd.removeAll(a.fG);
  16896.  
  16897.             a.nE = true;
  16898.  
  16899.             a.hd = null;
  16900.  
  16901.             a.qA.clear();
  16902.  
  16903.             a.G(true);
  16904.  
  16905.             a.AB = "";
  16906.           }
  16907.           else
  16908.           {
  16909.             a.Fg = true;
  16910.           }
  16911.  
  16912.           a.vE = null;
  16913.  
  16914.           a.hA = new Timer(a.random(360000, 480000));
  16915.  
  16916.           a.KA = new Timer(0L);
  16917.  
  16918.           return;
  16919.         }
  16920.         if (i2 == -1)
  16921.         {
  16922.           a.log("Unable to complete Puzzle: " + (String)localObject + "; Reason: " + a.uC + ".");
  16923.  
  16924.           a.vE = null;
  16925.  
  16926.           a.X = true;
  16927.  
  16928.           a.PD = -1;
  16929.  
  16930.           a.fG.addAll(a.ob);
  16931.  
  16932.           a.ic.add(a.r);
  16933.  
  16934.           a.J.removeAll(a.fG);
  16935.  
  16936.           a.Bd.removeAll(a.fG);
  16937.  
  16938.           a.nE = true;
  16939.  
  16940.           a.hA = new Timer(a.random(360000, 480000));
  16941.  
  16942.           a.KA = new Timer(0L);
  16943.  
  16944.           a.qA.clear();
  16945.         }
  16946.  
  16947.       }
  16948.  
  16949.       if (!a.NA) {
  16950.         a.JB.add(a.r);
  16951.       }
  16952.  
  16953.       a.hd = null;
  16954.     }
  16955.     if (a.ke.contains(a.r)) {
  16956.       a.nE = true;
  16957.     }
  16958.  
  16959.     if ((a.Qc.contains("new room")) && (!a.L()))
  16960.     {
  16961.       for (localObject = a.GB.iterator(); ((Iterator)localObject).hasNext(); ) { localRSTile = (RSTile)((Iterator)localObject).next();
  16962.  
  16963.         if (a.r.contains(new RSTile[] { localRSTile }))
  16964.         {
  16965.           a.fG.add(localRSTile);
  16966.  
  16967.           a.Bd.remove(localRSTile);
  16968.  
  16969.           a.J.remove(localRSTile);
  16970.         }
  16971.       }
  16972.     }
  16973.     a.GB.removeAll(a.fG);
  16974.  
  16975.     if (a.l(a.r, a.GB))
  16976.     {
  16977.       if (a.nE)
  16978.       {
  16979.         a.log("We can't skip through this room!");
  16980.  
  16981.         a.ke.remove(a.r);
  16982.  
  16983.         a.nE = false;
  16984.       }
  16985.  
  16986.     }
  16987.  
  16988.     if (a.nE)
  16989.     {
  16990.       if (!a.ZA())
  16991.       {
  16992.         return;
  16993.       }
  16994.  
  16995.     }
  16996.     else if (i2 != -1)
  16997.     {
  16998.       a.A(true);
  16999.  
  17000.       if ((a.nb == null) && (!a.QB())) {
  17001.         return;
  17002.       }
  17003.  
  17004.       if (!a.ZA())
  17005.         return;
  17006.       a.l(a.vc, a.random(50, 60), a.random(50, 60));
  17007.  
  17008.       a.S();
  17009.  
  17010.       if (a.Xd) if (a.inventory.getCount(true, new int[] { a.cc }) > a.random(10, 40)) {
  17011.           a.inventory.getItem(new int[] { a.cc }).doAction("Wield");
  17012.         }
  17013.  
  17014.  
  17015.       if (!a.ZA()) {
  17016.         return;
  17017.       }
  17018.  
  17019.       a.uA();
  17020.     }
  17021.  
  17022.     a.Bd.removeAll(a.fc);
  17023.  
  17024.     a.J.removeAll(a.fc);
  17025.  
  17026.     a.J.removeAll(a.w);
  17027.  
  17028.     if ((i2 < 1) && (a.Nc.size() > 1) && (a.nb == null))
  17029.       if ((i2 == -1) || ((!a.l(a.r, a.Bd)) && (!a.l(a.r, a.J)) && (!a.l(a.r, a.w))))
  17030.       {
  17031.         a.ic.add(a.r);
  17032.  
  17033.         for (localObject = a.fA.iterator(); ((Iterator)localObject).hasNext(); ) { localRSTile = (RSTile)((Iterator)localObject).next();
  17034.  
  17035.           if (a.calc.distanceBetween(localRSTile, a.r.getNearestTile(localRSTile)) < 3.0D)
  17036.           {
  17037.             a.fG.add(localRSTile);
  17038.           }
  17039.  
  17040.         }
  17041.  
  17042.       }
  17043.       else if (!a.aE.contains(a.r))
  17044.       {
  17045.         a.aE.add(a.r);
  17046.       }
  17047.     a.Bd.removeAll(a.fG);
  17048.  
  17049.     a.J.removeAll(a.fG);
  17050.  
  17051.     a.w.removeAll(a.fG);
  17052.  
  17053.     a.AB = "";
  17054.  
  17055.     if (a.ic.contains(a.r))
  17056.     {
  17057.       if (i2 == 1)
  17058.         a.log.severe("We successfully completed the puzzle, but the room is assigned as finished?");
  17059.       a.X = true;
  17060.     }
  17061.     else
  17062.     {
  17063.       a.Fg = true;
  17064.     }
  17065.     a.ZA = null;
  17066.  
  17067.     a.eC = false;
  17068.   }
  17069.  
  17070.   private boolean M()
  17071.   {
  17072.     if ((a.interfaces.get(945).isValid()) || (!a.game.isLoggedIn()))
  17073.     {
  17074.       return true;
  17075.     }
  17076.  
  17077.     if (a.objects.getNearest(new int[] { 50552 }) == null);
  17078.     return a.objects.getNearest(new int[] { 48496 }) == null;
  17079.   }
  17080.  
  17081.   private boolean l(int a, String a)
  17082.   {
  17083.     if (!a.inventory.contains(a)) {
  17084.       return true;
  17085.     }
  17086.  
  17087.     int i1 = a.inventory.getCount(new int[] { a });
  17088.     int i2;
  17089.     if ((i2 = 0) < 6)
  17090.     {
  17091.       RSItem localRSItem;
  17092.       if ((localRSItem = a.inventory.getItem(new int[] { a })) != null)
  17093.       {
  17094.         localRSItem.doAction(a);
  17095.  
  17096.         a.sleep(1000, 1300);
  17097.  
  17098.         a.sleep(100, 200);
  17099.  
  17100.         i2++;
  17101.       }
  17102.  
  17103.     }
  17104.  
  17105.     return i1 > a.inventory.getCount(new int[] { a });
  17106.   }
  17107.  
  17108.   private int a()
  17109.   {
  17110.     RSObject localRSObject1;
  17111.     if ((localRSObject1 = a.i(new int[] { 52041, 54907, 54908 })) == null)
  17112.     {
  17113.       return -1;
  17114.     }
  17115.     RSTile localRSTile1 = localRSObject1.getLocation();
  17116.  
  17117.     RSTile localRSTile2 = a.tA();
  17118.  
  17119.     if (a.jA())
  17120.       return 2;
  17121.     if (!a.j())
  17122.     {
  17123.       return -1;
  17124.     }
  17125.     RSObject localRSObject2 = a.J(new String[] { "Spinning blades" });
  17126.  
  17127.     RSObject localRSObject3 = a.J(new String[] { "Pendulum" });
  17128.  
  17129.     a.l(a.vc, 40, 50);
  17130.  
  17131.     a.jA = a.npcs.getNearest(a.B);
  17132.  
  17133.     a.yd = a.l(a.Zd);
  17134.  
  17135.     if ((a.jA != null) && (a.l(a.jA.getLocation(), false)))
  17136.     {
  17137.       a.F(a.jA);
  17138.     }
  17139.     else if ((a.yd != null) && (a.l(a.yd.getLocation(), false)))
  17140.     {
  17141.       a.l(a.yd);
  17142.     }
  17143.     else if (a.F(localRSObject2))
  17144.     {
  17145.       if ((a.calc.distanceTo(localRSTile1) < 2) || (a.calc.distanceTo(localRSObject2) > 5)) {
  17146.         a.A(a.nD, 1);
  17147.       }
  17148.       else
  17149.       {
  17150.         a.A(localRSTile1, 0);
  17151.       }
  17152.     }
  17153.     else if (a.F(localRSObject3)) {
  17154.       a.A(localRSObject3.getLocation(), 0);
  17155.     }
  17156.     else if (a.F(a.i(a.kg)))
  17157.     {
  17158.       a.A(localRSObject3.getLocation(), 1);
  17159.     }
  17160.     else if (a.l(localRSTile2, true))
  17161.       a.l(a.i(a.bB), "Step-onto");
  17162.     else
  17163.       a.A(a.nD, 1);
  17164.     a.K(true);
  17165.  
  17166.     if (a.AA()) {
  17167.       a.n();
  17168.     }
  17169.     else if (a.jA()) {
  17170.       return 2;
  17171.     }
  17172.  
  17173.     if (a.l(a.i(a.lC), "Open"))
  17174.       a.K(true);
  17175.     a.sleep(200, 400);
  17176.  
  17177.     return 1;
  17178.   }
  17179.  
  17180.   public void mouseReleased(MouseEvent a)
  17181.   {
  17182.   }
  17183.  
  17184.   private boolean h()
  17185.   {
  17186.     if (a.jA())
  17187.     {
  17188.       return false;
  17189.     }
  17190.  
  17191.     a.i(a.npcs.getNearest(a.jE));
  17192.  
  17193.     a.l(a.UC, 50, 60);
  17194.  
  17195.     a.sleep(400, 800);
  17196.  
  17197.     return true;
  17198.   }
  17199.  
  17200.   private int E()
  17201.   {
  17202.     a.EA();
  17203.  
  17204.     a.lA();
  17205.  
  17206.     if (a.nD != null) { if (a.yd != null) if (a.r.contains(new RSTile[] { a.yd.getLocation() }))
  17207.         {
  17208.           break label63;
  17209.         }
  17210.  
  17211.  
  17212.       label63: if (a.jA()) {
  17213.         return 2;
  17214.       }
  17215.  
  17216.       RSTile localRSTile = a.EA();
  17217.  
  17218.       if (a.yd != null)
  17219.       {
  17220.         if (a.calc.distanceTo(localRSTile) > 3)
  17221.         {
  17222.           a.l(localRSTile, 1);
  17223.         }
  17224.         else {
  17225.           a.l(a.yd);
  17226.         }
  17227.  
  17228.       }
  17229.       else
  17230.       {
  17231.         a.A(a.nD, 2);
  17232.       }
  17233.       a.K(true);
  17234.  
  17235.       a.K(true);
  17236.  
  17237.       a.lA();
  17238.     }
  17239.  
  17240.     a.NA = true;
  17241.  
  17242.     return 1;
  17243.   }
  17244.  
  17245.   public void mouseExited(MouseEvent a)
  17246.   {
  17247.   }
  17248.  
  17249.   private boolean l(RSModel a, String a)
  17250.   {
  17251.     if (a == null)
  17252.       return false;
  17253.     int i1;
  17254.     if (a.l(a, a.mouse.getLocation()))
  17255.     {
  17256.       if (a.l(a))
  17257.         return true;
  17258.       if (!a.menu.contains(a))
  17259.       {
  17260.         if (!a.Y().isMoving())
  17261.         {
  17262.           i1 += 2;
  17263.         }
  17264.         i1 += 2;
  17265.       }
  17266.  
  17267.     }
  17268.  
  17269.     a.mouse.move(a.getPoint());
  17270.  
  17271.     i1++;
  17272.  
  17273.     return false;
  17274.   }
  17275.  
  17276.   private boolean l(RSNPC a, String a)
  17277.   {
  17278.     if (a == null)
  17279.       return false;
  17280.     RSModel localRSModel;
  17281.     return (localRSModel = a.getModel()) != null
  17282.        ? a.l(localRSModel, a) : a.A(a.getLocation(), a);
  17283.   }
  17284.  
  17285.   private boolean l(boolean a)
  17286.   {
  17287.     int i1;
  17288.     if ((a.Y().isMoving()) || ((a) && (a.Y().getAnimation() != -1)))
  17289.     {
  17290.       return true;
  17291.     }
  17292.  
  17293.     a.sleep(100, 150);
  17294.  
  17295.     i1++;
  17296.  
  17297.     return false;
  17298.   }
  17299.  
  17300.   private boolean l(RSTile a, RSTile a)
  17301.   {
  17302.     int i1 = a.getX(); int i2 = a.getY(); int i3 = a.getX(); int i4 = a.getY();
  17303.  
  17304.     return (i1 == i3) || (i2 == i4) || (Math.abs((i1 - i3) * 100 / (i2 - i4)) == 100);
  17305.   }
  17306.  
  17307.   private boolean K()
  17308.   {
  17309.     RSTile localRSTile;
  17310.     if (
  17311.       (localRSTile = a.tA()) != null)
  17312.     {
  17313.       if (a.FA != null);
  17314.       if ((!a.M()) || (!a.game.isLoggedIn()))
  17315.         return false;
  17316.       RSObject localRSObject;
  17317.       if ((localRSObject = a.G(localRSTile)) == null)
  17318.       {
  17319.         return false;
  17320.       }
  17321.       RSGroundItem localRSGroundItem;
  17322.       if ((
  17323.         (localRSGroundItem = a.groundItems.getNearest(new int[] { 18829 })) != null) && (a.l(localRSGroundItem.getLocation(), false)))
  17324.       {
  17325.         a.l(localRSGroundItem);
  17326.       }
  17327.       else if (a.l(localRSObject, "Enter"))
  17328.       {
  17329.         if (!a.combat.isAutoRetaliateEnabled())
  17330.           a.game.openTab(0);
  17331.         a.sleep(600, 800);
  17332.  
  17333.         if (a.Y().isMoving()) {
  17334.           a.sleep(100, 200);
  17335.         }
  17336.  
  17337.       }
  17338.  
  17339.       a.sleep(100, 200);
  17340.  
  17341.       a.uA();
  17342.  
  17343.       a.l(a.FA);
  17344.     }
  17345.  
  17346.     return false;
  17347.   }
  17348.  
  17349.   private void l(Graphics a, Rectangle a)
  17350.   {
  17351.     a.draw3DRect(a.x, a.y, a.width, a.height, true);
  17352.   }
  17353.  
  17354.   private int G()
  17355.   {
  17356.     if ((!a.O()) || (!a.A()))
  17357.       return -1;
  17358.     boolean bool = false;
  17359.  
  17360.     while (a.D(new int[] { 11246 }) != null)
  17361.     {
  17362.       if (a.jA()) {
  17363.         return 2;
  17364.       }
  17365.  
  17366.       if (!a.j())
  17367.       {
  17368.         return -1;
  17369.       }
  17370.       RSObject localRSObject1 = a.i(new int[] { 40181, 54571, 54593 });
  17371.  
  17372.       RSObject localRSObject2 = a.i(new int[] { 54572, 54594, 55451 });
  17373.  
  17374.       RSObject localRSObject3 = a.i(new int[] { 54576, 54598, 55453 });
  17375.  
  17376.       RSObject localRSObject4 = a.i(new int[] { 54580, 54602, 55457 });
  17377.  
  17378.       RSObject localRSObject5 = a.i(new int[] { 54577, 54599, 55455 });
  17379.  
  17380.       RSGroundItem localRSGroundItem = a.groundItems.getNearest(new int[] { 19879 });
  17381.  
  17382.       if (localRSObject2 != null)
  17383.       {
  17384.         bool = a.l(localRSObject2, "Bless-remains");
  17385.       }
  17386.       else if (localRSObject1 != null)
  17387.       {
  17388.         bool = a.l(localRSObject1, "Unlock");
  17389.       }
  17390.       else if (localRSObject4 != null)
  17391.       {
  17392.         bool = a.l(localRSObject4, "Repair");
  17393.       }
  17394.       else if (localRSGroundItem != null)
  17395.       {
  17396.         bool = a.l(localRSGroundItem);
  17397.       }
  17398.       else if (localRSObject3 != null)
  17399.       {
  17400.         if (!a.Y().isMoving()) {
  17401.           a.A(localRSObject3.getLocation(), 1);
  17402.         }
  17403.  
  17404.         bool = a.l(localRSObject3, "Fill");
  17405.       }
  17406.       else if (localRSObject5 != null)
  17407.       {
  17408.         if (!a.Y().isMoving())
  17409.         {
  17410.           a.A(localRSObject5.getLocation(), 1);
  17411.         }
  17412.         bool = a.l(localRSObject5, "Repair");
  17413.       }
  17414.  
  17415.       if (bool) {
  17416.         a.K(false);
  17417.       }
  17418.       else
  17419.       {
  17420.         a.sleep(200, 400);
  17421.       }
  17422.  
  17423.     }
  17424.  
  17425.     return 1;
  17426.   }
  17427.  
  17428.   private RSTile l(RSTile a, int[] a)
  17429.   {
  17430.     double d1 = 99999.990000000005D;
  17431.  
  17432.     Object localObject = null;
  17433.     int i1;
  17434.     if (a != null)
  17435.     {
  17436.       int i2;
  17437.       RSObject localRSObject;
  17438.       int i5;
  17439.       if ((localRSObject = a.G(new RSTile(i1, i2))) != null)
  17440.       {
  17441.         int i3 = localRSObject.getID();
  17442.         int[] arrayOfInt;
  17443.         int i4 = (arrayOfInt = a).length;
  17444.  
  17445.         if (arrayOfInt[i5] ==
  17446.           i3)
  17447.         {
  17448.           RSTile localRSTile = localRSObject.getLocation();
  17449.  
  17450.           double d2 = a.calc.distanceBetween(a, localRSTile);
  17451.  
  17452.           if (d2 < d1)
  17453.           {
  17454.             localObject = localRSTile;
  17455.  
  17456.             d1 = d2;
  17457.           }
  17458.  
  17459.         }
  17460.  
  17461.         i5++;
  17462.       }
  17463.  
  17464.       i2++;
  17465.  
  17466.       i1++;
  17467.     }
  17468.  
  17469.     return localObject;
  17470.   }
  17471.  
  17472.   private int D()
  17473.   {
  17474.     String str1 = "Yellow";
  17475.  
  17476.     String str2 = "Green";
  17477.     RSTile localRSTile1;
  17478.     if ((localRSTile1 = a.F(new RSTile(0, 20000), "tile")) == null) {
  17479.       return -1;
  17480.     }
  17481.  
  17482.     if (a.random(0, 2) == 1)
  17483.     {
  17484.       str1 = "Green";
  17485.  
  17486.       str2 = "Yellow";
  17487.     }
  17488.  
  17489.     a.log("Flipping the tiles to " + str1.toLowerCase());
  17490.     int i1;
  17491.     RSTile localRSTile2 = new RSTile(localRSTile1.getX(), localRSTile1.getY() - i1);
  17492.     int i2;
  17493.     RSTile localRSTile3 = new RSTile(localRSTile2.getX() + i2, localRSTile2.getY());
  17494.  
  17495.     a.vE = new RSTile(localRSTile3.getX(), localRSTile3.getY() - 1);
  17496.  
  17497.     if (a.jA())
  17498.     {
  17499.       return 2;
  17500.     }
  17501.  
  17502.     if (!a.j())
  17503.     {
  17504.       return -1;
  17505.     }
  17506.     if (a.calc.distanceTo(a.vE) > 4)
  17507.     {
  17508.       a.l(a.vE, 1);
  17509.  
  17510.       a.K(false);
  17511.     }
  17512.     int i3;
  17513.     if ((a.A(a.vE, "Imbue")) && (a.l(true)))
  17514.     {
  17515.       if (!a.x())
  17516.       {
  17517.         a.x();
  17518.       }
  17519.  
  17520.       if ((i3 = 0) < 8)
  17521.       {
  17522.         a.sleep(150, 250);
  17523.  
  17524.         i3++;
  17525.       }
  17526.     }
  17527.     a.sleep(100, 200);
  17528.  
  17529.     i2++;
  17530.  
  17531.     i1++;
  17532.     RSObject[] arrayOfRSObject;
  17533.     if ((arrayOfRSObject = a.A(new String[] { str2 + " tile" })) != null)
  17534.     {
  17535.       a.log("Matched the first four rows. Forcing " + arrayOfRSObject.length + " remaining tiles.");
  17536.  
  17537.       if (a.jA()) {
  17538.         return 2;
  17539.       }
  17540.  
  17541.       if (a.l(a.J(new String[] { str2 + " tile" }), "Force " + str2))
  17542.       {
  17543.         a.x();
  17544.  
  17545.         a.K(!a.l(a.vc, 80, 30));
  17546.       }
  17547.       a.sleep(500, 600);
  17548.     }
  17549.  
  17550.     return 1;
  17551.   }
  17552.  
  17553.   private RSObject l(String[] a)
  17554.   {
  17555.     return a.objects.getNearest(new v(a, a));
  17556.   }
  17557.  
  17558.   private int J()
  17559.   {
  17560.     Combat.Prayer localPrayer = Combat.Prayer.PROTECT_FROM_MAGIC;
  17561.  
  17562.     if (a.jA())
  17563.     {
  17564.       return 2;
  17565.     }
  17566.     a.l(a.QC, localPrayer, true);
  17567.  
  17568.     RSNPC localRSNPC1 = a.i(new String[] { "skinweaver" });
  17569.  
  17570.     RSNPC localRSNPC2 = a.i(new String[] { "bloodrager" });
  17571.  
  17572.     RSNPC localRSNPC3 = a.i(new String[] { "deathslinger" });
  17573.  
  17574.     RSNPC localRSNPC4 = a.i(new String[] { "stormbringer" });
  17575.  
  17576.     a.jA = a.npcs.getNearest(a.B);
  17577.  
  17578.     if ((a.jA != null) && (!a.jA.getName().contains("Ramokee")))
  17579.     {
  17580.       if (a.F(a.jA))
  17581.       {
  17582.         a.K(false);
  17583.       }
  17584.  
  17585.     }
  17586.     else if (localRSNPC1 != null)
  17587.     {
  17588.       if (a.F(localRSNPC1)) {
  17589.         a.K(false);
  17590.       }
  17591.  
  17592.     }
  17593.     else if (localRSNPC4 != null)
  17594.     {
  17595.       if (a.F(localRSNPC4)) {
  17596.         a.K(false);
  17597.       }
  17598.  
  17599.     }
  17600.     else if (localRSNPC3 != null)
  17601.     {
  17602.       localPrayer = Combat.Prayer.PROTECT_FROM_MISSILES;
  17603.  
  17604.       if (a.F(localRSNPC3))
  17605.       {
  17606.         a.K(false);
  17607.       }
  17608.  
  17609.     }
  17610.     else if (localRSNPC2 != null)
  17611.     {
  17612.       localPrayer = Combat.Prayer.PROTECT_FROM_MELEE;
  17613.  
  17614.       if (a.F(localRSNPC2)) {
  17615.         a.K(false);
  17616.       }
  17617.  
  17618.     }
  17619.  
  17620.     a.l(a.lG, 50, 40);
  17621.  
  17622.     a.sleep(200, 300);
  17623.  
  17624.     a.l(false, localPrayer, false);
  17625.  
  17626.     return 1;
  17627.   }
  17628.  
  17629.   private boolean l(RSTile a)
  17630.   {
  17631.     RSTile localRSTile;
  17632.     return (localRSTile = a.calc.getTileOnScreen(a)) != null
  17633.        ? a.A(localRSTile, "Walk ") : a.A(a, 0);
  17634.   }
  17635.  
  17636.   public void mousePressed(MouseEvent a)
  17637.   {
  17638.   }
  17639.  
  17640.   private boolean l(RSNPC a)
  17641.   {
  17642.     if ((a == null) || (!a.isValid()))
  17643.       return false;
  17644.     if (a.l(a.getAnimation(), a.Yc))
  17645.     {
  17646.       return true;
  17647.     }
  17648.     RSCharacter localRSCharacter;
  17649.     return ((localRSCharacter = a.Y().getInteracting()) != null) &&
  17650.       (localRSCharacter.equals(a));
  17651.   }
  17652.  
  17653.   private void i()
  17654.   {
  17655.     RSNPC localRSNPC1 = a.i(new String[] { "Gravecreeper" });
  17656.  
  17657.     RSNPC localRSNPC2 = a.i(new String[] { "Runebound behemoth" });
  17658.  
  17659.     RSNPC localRSNPC3 = a.i(new String[] { "Necrolord" });
  17660.  
  17661.     RSNPC localRSNPC4 = a.i(new String[] { "Flesh-Spoiler" });
  17662.  
  17663.     RSNPC localRSNPC5 = a.i(new String[] { "Yk'Lagor the Thunderous" });
  17664.  
  17665.     a.l(a.UC, 50, 60);
  17666.  
  17667.     if (!a.tc.equals("Skeletal Trio")) if (a.i(new String[] { "Skeletal warrior" }) == null) if (a.i(new String[] { "Skeletal sorcerer" }) == null) if (a.i(new String[] { "Skeletal archer" }) == null)
  17668.             break label921;
  17669.     Object localObject4 = null;
  17670.  
  17671.     a.Qc = "Killing the Skeletal Trio!";
  17672.  
  17673.     if (a.tc.isEmpty())
  17674.     {
  17675.       a.log(a.Qc);
  17676.  
  17677.       a.tc = "Skeletal Trio";
  17678.     }
  17679.  
  17680.     RSNPC localRSNPC6 = a.i(new String[] { "Skeletal warrior" }); RSNPC localRSNPC7 = a.i(new String[] { "Skeletal archer" }); RSNPC localRSNPC8 = a.i(new String[] { "Skeletal sorcerer" });
  17681.  
  17682.     if (a.jA())
  17683.     {
  17684.       return;
  17685.     }
  17686.     localRSNPC6 = a.i(new String[] { "Skeletal warrior" });
  17687.  
  17688.     localRSNPC7 = a.i(new String[] { "Skeletal archer" });
  17689.  
  17690.     localRSNPC8 = a.i(new String[] { "Skeletal sorcerer" });
  17691.  
  17692.     localObject4 = null;
  17693.  
  17694.     int i1 = 1;
  17695.  
  17696.     int i2 = 1;
  17697.  
  17698.     int i3 = 1;
  17699.     int i9;
  17700.     int i11;
  17701.     if (localRSNPC6 != null)
  17702.     {
  17703.       i9 = localRSNPC6.getID();
  17704.  
  17705.       i1 = 0;
  17706.  
  17707.       if (i9 == i11) {
  17708.         i1 = 1;
  17709.       }
  17710.       else
  17711.       {
  17712.         i11 += 3;
  17713.       }
  17714.     }
  17715.     if (localRSNPC7 != null)
  17716.     {
  17717.       i9 = localRSNPC7.getID();
  17718.  
  17719.       i2 = 0;
  17720.  
  17721.       if (i9 == i11) {
  17722.         i2 = 1;
  17723.       }
  17724.       else
  17725.       {
  17726.         i11 += 3;
  17727.       }
  17728.  
  17729.     }
  17730.  
  17731.     if (localRSNPC8 != null)
  17732.     {
  17733.       i9 = localRSNPC8.getID();
  17734.  
  17735.       i3 = 0;
  17736.  
  17737.       if (i9 == i11) {
  17738.         i3 = 1;
  17739.       }
  17740.       else
  17741.       {
  17742.         i11 += 3;
  17743.       }
  17744.  
  17745.     }
  17746.  
  17747.     if (a.HC == 1)
  17748.     {
  17749.       if (localRSNPC8 != null) {
  17750.         a.l(a.QC, a.HC != 1 ? Combat.Prayer.PROTECT_FROM_MISSILES : Combat.Prayer.PROTECT_FROM_MAGIC, true);
  17751.       }
  17752.       else if (localRSNPC7 != null) {
  17753.         a.l(a.QC, Combat.Prayer.PROTECT_FROM_MISSILES, true);
  17754.       }
  17755.       else
  17756.       {
  17757.         a.l(a.QC, Combat.Prayer.PROTECT_FROM_MELEE, true);
  17758.       }
  17759.  
  17760.       if (i2 == 0)
  17761.       {
  17762.         localObject4 = localRSNPC7;
  17763.  
  17764.         a.PD = a.xb;
  17765.       }
  17766.       else if (i3 == 0)
  17767.       {
  17768.         localObject4 = localRSNPC8;
  17769.  
  17770.         a.PD = a.xb;
  17771.       }
  17772.       else if (i1 == 0)
  17773.       {
  17774.         localObject4 = localRSNPC6;
  17775.       }
  17776.  
  17777.       if ((localRSNPC7 == null) && (localRSNPC8 == null)) {
  17778.         if (a.iD)
  17779.         {
  17780.           a.i(3);
  17781.         }
  17782.         else {
  17783.           a.PD = a.Gd;
  17784.         }
  17785.  
  17786.       }
  17787.  
  17788.     }
  17789.     else if (a.HC == 2)
  17790.     {
  17791.       if (localRSNPC6 != null)
  17792.       {
  17793.         a.l(a.QC, Combat.Prayer.PROTECT_FROM_MELEE, true);
  17794.       }
  17795.       else if (localRSNPC8 != null)
  17796.       {
  17797.         a.l(a.QC, Combat.Prayer.PROTECT_FROM_MAGIC, true);
  17798.       }
  17799.       else
  17800.         a.l(a.QC, Combat.Prayer.PROTECT_FROM_MISSILES, true);
  17801.       if (i3 == 0)
  17802.       {
  17803.         localObject4 = localRSNPC8;
  17804.       }
  17805.       else if (i1 == 0) {
  17806.         localObject4 = localRSNPC6;
  17807.       }
  17808.       else if (i2 == 0)
  17809.       {
  17810.         localObject4 = localRSNPC7;
  17811.       }
  17812.     }
  17813.     else if (a.HC == 3)
  17814.     {
  17815.       if (localRSNPC7 != null)
  17816.       {
  17817.         a.l(a.QC, Combat.Prayer.PROTECT_FROM_MISSILES, true);
  17818.       }
  17819.       else if (localRSNPC6 != null) {
  17820.         a.l(a.QC, Combat.Prayer.PROTECT_FROM_MELEE, true);
  17821.       }
  17822.       else
  17823.       {
  17824.         a.l(a.QC, Combat.Prayer.PROTECT_FROM_MAGIC, true);
  17825.       }
  17826.  
  17827.       if (i1 == 0)
  17828.         localObject4 = localRSNPC6;
  17829.       else if (i2 == 0) {
  17830.         localObject4 = localRSNPC7;
  17831.       }
  17832.       else if (i3 == 0)
  17833.       {
  17834.         localObject4 = localRSNPC8;
  17835.       }
  17836.     }
  17837.     if (localObject4 != null)
  17838.     {
  17839.       a.F((RSNPC)localObject4);
  17840.  
  17841.       if (!a.l(a.UC, 50, 50))
  17842.         a.sleep(400, 600);
  17843.     }
  17844.     else if (!a.JC())
  17845.     {
  17846.       a.sleep(600, 800);
  17847.     }
  17848.  
  17849.     a.sleep(200, 300);
  17850.  
  17851.     break label3638;
  17852.     label921: int i7;
  17853.     int i8;
  17854.     if ((a.tc.equals("Runebound Behemoth")) || (localRSNPC2 != null))
  17855.     {
  17856.       localObject4 = new int[] { 53977, 53979, 53978 };
  17857.  
  17858.       int i6 = 0; i7 = 0; i8 = 0;
  17859.  
  17860.       if (a.kC) {
  17861.         i6 = 1;
  17862.       }
  17863.  
  17864.       if (a.Sd) {
  17865.         i7 = 1;
  17866.       }
  17867.  
  17868.       if (a.iD)
  17869.       {
  17870.         i8 = 1;
  17871.       }
  17872.  
  17873.       boolean[] arrayOfBoolean1 = { i6, i7, i8 };
  17874.  
  17875.       a.Qc = "Killing the Runebound Behemoth!";
  17876.  
  17877.       if (a.tc.isEmpty())
  17878.       {
  17879.         a.log(a.Qc);
  17880.  
  17881.         a.tc = "Runebound Behemoth";
  17882.       }
  17883.       a.PD = a.Gd;
  17884.  
  17885.       if (a.Ob < 1)
  17886.         a.Ob = localRSNPC2.getID();
  17887.       a.l(a.QC, Combat.Prayer.PROTECT_FROM_MAGIC, true);
  17888.  
  17889.       if (a.jA())
  17890.       {
  17891.         return;
  17892.       }
  17893.  
  17894.       if (localRSNPC2 != null)
  17895.         if ((localRSNPC2.getAnimation() == 14440) || (localRSNPC2.getMessage() != null))
  17896.         {
  17897.           a.AB = "Dodging the lightning!";
  17898.  
  17899.           RSObject localRSObject2 = a.i(new int[] { 54786 });
  17900.  
  17901.           a.l(a.calc.distanceTo(localRSObject2) > 4 ? localRSObject2.getLocation() : a.nb.getCentralTile());
  17902.  
  17903.           if (!a.l(a.vc, 80, 30)) {
  17904.             a.sleep(400, 600);
  17905.           }
  17906.  
  17907.           a.AB = "";
  17908.         }
  17909.         else
  17910.         {
  17911.           int i12 = a.Ob - localRSNPC2.getID();
  17912.  
  17913.           int i13 = 1; int i14 = 1; int i15 = 1;
  17914.  
  17915.           if (i12 == 15)
  17916.           {
  17917.             i13 = 0;
  17918.           }
  17919.           else if (i12 == 30)
  17920.           {
  17921.             i14 = 0;
  17922.           }
  17923.           else if (i12 == 60)
  17924.           {
  17925.             i15 = 0;
  17926.           }
  17927.           else if (i12 == -15)
  17928.           {
  17929.             i13 = 0;
  17930.  
  17931.             i15 = 0;
  17932.           }
  17933.           else if (i12 == -30)
  17934.           {
  17935.             i14 = 0;
  17936.  
  17937.             i13 = 0;
  17938.           }
  17939.           else if (i12 == -45)
  17940.           {
  17941.             i14 = 0;
  17942.  
  17943.             i15 = 0;
  17944.           }
  17945.           boolean[] arrayOfBoolean2 = { i13, i14, i15 };
  17946.  
  17947.           int i16 = a.HC - 1;
  17948.  
  17949.           if (arrayOfBoolean2[i16] == 0)
  17950.           {
  17951.             a.i(localRSNPC2);
  17952.           }
  17953.           else if (a.i(new int[] { localObject4[i16] }) != null)
  17954.           {
  17955.             if (a.combat.getHealth() > a.random(8, 15)) if (a.l(a.i(new int[] { localObject4[i16] }), "Deactivate")) {
  17956.                 a.K(false);
  17957.               }
  17958.  
  17959.  
  17960.           }
  17961.           else
  17962.           {
  17963.             int i17 = 0;
  17964.             int i18;
  17965.             int i19 = i18 + 1;
  17966.  
  17967.             if ((a.HC != i19) && (arrayOfBoolean1[i18] != 0)) if (arrayOfBoolean2[i18] != 0) { if (a.i(new int[] { localObject4[i18] }) == null);
  17968.               }
  17969.               else
  17970.               {
  17971.                 RSObject localRSObject3;
  17972.                 if ((localRSObject3 = a.i(new int[] { localObject4[i18] })) != null)
  17973.                 {
  17974.                   a.i(localRSObject3.getLocation(), 1);
  17975.                 }
  17976.                 a.i(i19);
  17977.  
  17978.                 i17 = 1;
  17979.  
  17980.                 break label1554;
  17981.               }
  17982.  
  17983.  
  17984.             i18++;
  17985.  
  17986.             label1554: if (i17 == 0)
  17987.             {
  17988.               a.JC();
  17989.             }
  17990.           }
  17991.         }
  17992.       a.l(a.lG, 50, 0);
  17993.  
  17994.       a.sleep(100, 200);
  17995.     }
  17996.     else
  17997.     {
  17998.       Object localObject1;
  17999.       Object localObject2;
  18000.       RSTile localRSTile1;
  18001.       if ((a.tc.equals("Gravecreeper")) || (localRSNPC1 != null))
  18002.       {
  18003.         localObject1 = new int[] { 54443, 54449, 54457 };
  18004.  
  18005.         localObject2 = new int[] { 54444, 54450, 54458 };
  18006.  
  18007.         a.Qc = "Killing the Gravecreeper!";
  18008.  
  18009.         if (a.tc.isEmpty())
  18010.         {
  18011.           a.log(a.Qc);
  18012.  
  18013.           a.tc = "Gravecreeper";
  18014.         }
  18015.  
  18016.         if ((a.HC == 2) && (a.kC))
  18017.         {
  18018.           a.i(1);
  18019.         }
  18020.         a.PD = (a.xb != -1 ? a.xb : a.Gd);
  18021.  
  18022.         a.l(a.QC, a.k ? Combat.Prayer.PROTECT_FROM_MELEE : Combat.Prayer.PROTECT_FROM_MISSILES, true);
  18023.  
  18024.         if (a.jA()) {
  18025.           return;
  18026.         }
  18027.  
  18028.         if ((localRSNPC1 = a.i(new String[] { a.tc })) != null)
  18029.         {
  18030.           RSObject localRSObject1 = a.i(localObject2);
  18031.  
  18032.           if ((localObject4 = localRSNPC1.getMessage()) != null)
  18033.           {
  18034.             if (((String)localObject4).equals("Burrrn"))
  18035.             {
  18036.               a.AB = "Dodging the burn spots!";
  18037.  
  18038.               localRSTile1 = localRSNPC1.getLocation();
  18039.  
  18040.               a.vE = a.A(localRSTile1, localObject1);
  18041.  
  18042.               if ((a.vE != null) && (localRSTile1 != null))
  18043.               {
  18044.                 if (a.calc.distanceTo(localRSTile1) < 2)
  18045.                 {
  18046.                   a.A(a.vE, 1);
  18047.  
  18048.                   i7++;
  18049.                 }
  18050.                 else if (a.JC())
  18051.                 {
  18052.                   i7++;
  18053.                 }
  18054.  
  18055.                 a.sleep(400, 500);
  18056.  
  18057.                 i7++;
  18058.               }
  18059.               a.AB = "";
  18060.             }
  18061.             else if (((String)localObject4).contains("Buuu"))
  18062.             {
  18063.               a.Ic();
  18064.             }
  18065.             else if (((String)localObject4).contains("Diii"))
  18066.             {
  18067.               a.Ic();
  18068.             }
  18069.             else if (((String)localObject4).contains("Braa"))
  18070.             {
  18071.               a.Ic();
  18072.             }
  18073.  
  18074.           }
  18075.           else if ((localRSObject1 != null) && (a.calc.distanceTo(localRSObject1) < 2))
  18076.           {
  18077.             a.vE = a.A(localRSNPC1.getLocation(), localObject1);
  18078.  
  18079.             if (a.vE != null)
  18080.             {
  18081.               a.A(a.vE, 1);
  18082.             }
  18083.             else {
  18084.               a.l(a.nb.getCentralTile());
  18085.             }
  18086.  
  18087.             a.sleep(600, 1000);
  18088.           }
  18089.           else
  18090.           {
  18091.             a.i(localRSNPC1);
  18092.  
  18093.             a.l(a.lG, 50, 0);
  18094.           }
  18095.         }
  18096.         a.sleep(100, 200);
  18097.       }
  18098.       else
  18099.       {
  18100.         if ((a.tc.equals("Necrolord")) || (localRSNPC3 != null))
  18101.         {
  18102.           a.Qc = "Killing the Necrolord!";
  18103.  
  18104.           if (a.tc.isEmpty())
  18105.           {
  18106.             a.log(a.Qc);
  18107.  
  18108.             a.tc = "Necrolord";
  18109.           }
  18110.           if (a.HC == 1)
  18111.           {
  18112.             if (a.Sd)
  18113.             {
  18114.               a.i(2);
  18115.             }
  18116.             else if (a.iD)
  18117.             {
  18118.               a.i(3);
  18119.             }
  18120.             else
  18121.             {
  18122.               a.log.severe("We can't kill this boss with melee, aborting dungeon");
  18123.  
  18124.               a.Ic += 1;
  18125.  
  18126.               a.nc = true;
  18127.  
  18128.               return;
  18129.             }
  18130.           }
  18131.           if ((localRSNPC3 != null) && (a.calc.distanceTo(localRSNPC3) > 3))
  18132.           {
  18133.             a.l(localRSNPC3.getLocation(), 1);
  18134.           }
  18135.         }
  18136.         while (a.objects.getNearest(a.gb) == null)
  18137.         {
  18138.           localObject1 = a.i(new String[] { "Skeletal minion" });
  18139.  
  18140.           a.l(a.QC, (localObject1 != null) && (a.calc.distanceTo((RSCharacter)localObject1) < 4) ? Combat.Prayer.PROTECT_FROM_MELEE : Combat.Prayer.PROTECT_FROM_MAGIC, true);
  18141.  
  18142.           if (a.jA()) {
  18143.             return;
  18144.           }
  18145.  
  18146.           if (a.HC == 1)
  18147.           {
  18148.             a.log.severe("We can't kill this boss with melee, aborting dungeon");
  18149.  
  18150.             a.nc = true;
  18151.  
  18152.             return;
  18153.           }
  18154.           if (a.MC)
  18155.           {
  18156.             a.JC();
  18157.           }
  18158.           if ((a.F(localRSNPC3)) && (a.HC == 3))
  18159.           {
  18160.             a.sleep(400, 600);
  18161.  
  18162.             if (!localRSNPC3.isInCombat()) {
  18163.               a.F(a.Qb, "Cast");
  18164.             }
  18165.  
  18166.           }
  18167.  
  18168.           a.l(a.UC, 50, 60);
  18169.  
  18170.           a.sleep(200, 400);
  18171.  
  18172.           continue;
  18173.  
  18174.           if ((a.tc.equals("Flesh-Spoiler Haasghenahk")) || (localRSNPC4 != null))
  18175.           {
  18176.             a.Qc = "Killing the Flesh-Spoiler!";
  18177.  
  18178.             if (a.tc.isEmpty())
  18179.             {
  18180.               a.log(a.Qc);
  18181.  
  18182.               a.tc = "Flesh-Spoiler Haasghenahk";
  18183.             }
  18184.             a.PD = (a.bC != -1 ? a.bC : a.xb);
  18185.  
  18186.             a.l(a.QC, null, false);
  18187.           }
  18188.           while (a.objects.getNearest(a.gb) == null)
  18189.           {
  18190.             if (a.jA())
  18191.             {
  18192.               return;
  18193.             }
  18194.             localRSNPC4 = a.i(new String[] { a.tc });
  18195.  
  18196.             if (a.VA) if ((a.i(new String[] { "spawn" }) != null) && (a.skills.getRealLevel(5) > 42)) {
  18197.                 a.l(a.QC, Combat.Prayer.PROTECT_FROM_MELEE, true);
  18198.               }
  18199.  
  18200.  
  18201.             if (a.F(localRSNPC4)) {
  18202.               a.sleep(800, 1200);
  18203.             }
  18204.  
  18205.             a.l(a.UC, 50, 50); continue;
  18206.  
  18207.             if ((a.tc.equals("Yk'Lagor the Thunderous")) || (localRSNPC5 != null))
  18208.             {
  18209.               a.Qc = "Killing Yk'Lagor the Thunderous!";
  18210.  
  18211.               if (a.iD)
  18212.               {
  18213.                 a.i(3);
  18214.               }
  18215.               if (a.tc.isEmpty())
  18216.               {
  18217.                 a.log(a.Qc);
  18218.  
  18219.                 a.tc = "Yk'Lagor the Thunderous";
  18220.               }
  18221.               a.PD = (a.bC != -1 ? a.bC : a.xb);
  18222.  
  18223.               localObject1 = new ArrayList();
  18224.  
  18225.               int i4 = (localObject2 = a.J(new int[] { 55057 })).length;
  18226.               int i5;
  18227.               localRSTile1 = localObject2[i5];
  18228.               RSTile[] arrayOfRSTile;
  18229.               i8 = (arrayOfRSTile = a.h(localRSTile1.getLocation())).length;
  18230.               int i10;
  18231.               RSTile localRSTile2 = arrayOfRSTile[i10];
  18232.  
  18233.               if (a.i(localRSTile2))
  18234.               {
  18235.                 ((ArrayList)localObject1).add(localRSTile2);
  18236.               }
  18237.               else
  18238.               {
  18239.                 i10++;
  18240.               }
  18241.               i5++;
  18242.  
  18243.               a.l(false, Combat.Prayer.PROTECT_FROM_MAGIC, true);
  18244.  
  18245.               if (a.i(new String[] { "Mysterious mage" }) != null)
  18246.               {
  18247.                 a.AB = "Freeing Yk'Lagor from the mages";
  18248.  
  18249.                 a.i(a.nb.getCentralTile(), 2);
  18250.  
  18251.                 a.A(false);
  18252.  
  18253.                 if (a.jA())
  18254.                 {
  18255.                   return;
  18256.                 }
  18257.                 a.vE = a.l(a.X(), (ArrayList)localObject1);
  18258.  
  18259.                 a.A(a.vE, 0);
  18260.  
  18261.                 a.K(false);
  18262.  
  18263.                 if (a.F(a.npcs.getNearest(a.CB)))
  18264.                 {
  18265.                   a.sleep(600, 800);
  18266.                 }
  18267.                 a.l(a.UC, 50, 50);
  18268.  
  18269.                 a.AB = "";
  18270.  
  18271.                 if (a.X().equals(a.vE)) {
  18272.                   a.Ic();
  18273.                 }
  18274.  
  18275.                 a.A(true);
  18276.               }
  18277.               a.l(a.QC, a.HC == 1 ? Combat.Prayer.PROTECT_FROM_MELEE : Combat.Prayer.PROTECT_FROM_MAGIC, true);
  18278.  
  18279.               if (a.jA())
  18280.               {
  18281.                 return;
  18282.               }
  18283.               if (
  18284.                 (localRSNPC5 = a.i(new String[] { a.tc })) != null)
  18285.               {
  18286.                 Object localObject3;
  18287.                 if ((localObject2 = localRSNPC5.getMessage()) != null)
  18288.                 {
  18289.                   if (((String)localObject2).contains("This is"))
  18290.                   {
  18291.                     a.AB = "Taking cover from the quake!";
  18292.  
  18293.                     a.vE = a.l(a.X(), (ArrayList)localObject1);
  18294.  
  18295.                     localObject3 = new Timer(a.random(3800, 4500));
  18296.  
  18297.                     if (a.vE != null)
  18298.                     {
  18299.                       if ((!a.X().equals(a.vE)) && (!a.AA()))
  18300.                       {
  18301.                         if (a.jA())
  18302.                         {
  18303.                           return;
  18304.                         }
  18305.  
  18306.                         a.K(false);
  18307.  
  18308.                         a.JC();
  18309.                       }
  18310.  
  18311.                       if (a.X().equals(a.vE)) {
  18312.                         a.Ic();
  18313.                       }
  18314.  
  18315.                     }
  18316.  
  18317.                     a.AB = "";
  18318.                   }
  18319.                   else if (((String)localObject2).contains("Come"))
  18320.                   {
  18321.                     a.AB = "Dodging his grasp!";
  18322.  
  18323.                     a.vE = a.l(a.X(), (ArrayList)localObject1);
  18324.  
  18325.                     localObject3 = new Timer(a.random(3500, 4500));
  18326.  
  18327.                     if (a.vE != null)
  18328.                     {
  18329.                       a.md = false;
  18330.  
  18331.                       if (((Timer)localObject3).isRunning())
  18332.                       {
  18333.                         if (a.jA())
  18334.                         {
  18335.                           return;
  18336.                         }
  18337.                         if (a.md)
  18338.                         {
  18339.                           a.log("Damn it.. Got sucked in.");
  18340.  
  18341.                           a.sleep(4000, 6000);
  18342.                         }
  18343.                         else
  18344.                         {
  18345.                           a.K(false);
  18346.  
  18347.                           a.JC();
  18348.                         }
  18349.  
  18350.                       }
  18351.  
  18352.                       if (a.X().equals(a.vE)) {
  18353.                         a.Ic();
  18354.                       }
  18355.  
  18356.                     }
  18357.  
  18358.                     a.AB = "";
  18359.                   }
  18360.                 }
  18361.                 else
  18362.                 {
  18363.                   if (!a.Y().isMoving())
  18364.                   {
  18365.                     localObject3 = a.l(a.X(), (ArrayList)localObject1);
  18366.  
  18367.                     if (a.calc.distanceTo((RSTile)localObject3) > (a.HC == 1 ? 4 : 3))
  18368.                     {
  18369.                       a.l((RSTile)localObject3);
  18370.  
  18371.                       a.l(false);
  18372.                     }
  18373.                     else
  18374.                     {
  18375.                       a.i(localRSNPC5);
  18376.                     }
  18377.                   }
  18378.                   else
  18379.                   {
  18380.                     a.i(localRSNPC5);
  18381.                   }
  18382.  
  18383.                   a.l(a.UC, 50, 40);
  18384.                 }
  18385.               }
  18386.               a.sleep(200, 400);
  18387.             }
  18388.             else
  18389.             {
  18390.               a.Qc = "Killing an unknown boss...";
  18391.  
  18392.               a.log(a.Qc);
  18393.  
  18394.               a.l(a.QC, null, false);
  18395.  
  18396.               if (a.h())
  18397.               {
  18398.                 break;
  18399.               }
  18400.  
  18401.               return;
  18402.             }
  18403.  
  18404.           }
  18405.  
  18406.         }
  18407.  
  18408.       }
  18409.  
  18410.     }
  18411.  
  18412.     label3638: a.Ke = true;
  18413.   }
  18414.  
  18415.   private boolean A()
  18416.   {
  18417.     if (!a.xe)
  18418.     {
  18419.       a.uC = "Gains Prayer experience";
  18420.  
  18421.       a.gE = true;
  18422.  
  18423.       return false;
  18424.     }
  18425.  
  18426.     return true;
  18427.   }
  18428.  
  18429.   private boolean F()
  18430.   {
  18431.     if ((a.zB) && (a.nA) && (a.v != -1))
  18432.     {
  18433.       if ((a.nb == null) && (a.game.getCurrentTab() == 4) && (((a.k) && (a.HC == 1)) || ((a.Xd) && (a.HC == 2)) || ((a.IB) && (a.HC == 3) && (a.inventory.contains(a.Vc))))) {
  18434.         a.l(a.Vc, "Wield");
  18435.       }
  18436.  
  18437.       if (a.HC == 3)
  18438.       {
  18439.         if (a.Qb < 1)
  18440.         {
  18441.           a.iD = false;
  18442.  
  18443.           a.i(a.bb);
  18444.  
  18445.           return false;
  18446.         }
  18447.  
  18448.         if (a.SE.contains("runes to cast"))
  18449.         {
  18450.           a.l(a.IB ? a.Vc : a.eB, "Wield");
  18451.  
  18452.           if (a.pB > 0)
  18453.           {
  18454.             a.l(a.pB, "Wield");
  18455.           }
  18456.  
  18457.         }
  18458.  
  18459.         if ((!a.k()) && (a.F(a.Qb, "Autocast")))
  18460.         {
  18461.           a.sleep(400, 600);
  18462.         }
  18463.       }
  18464.       else if (a.HC == 1)
  18465.       {
  18466.         if (a.gB)
  18467.         {
  18468.           if ((a.SD == a.xD) || (a.SD == 3)) {
  18469.             a.SD = 1;
  18470.           }
  18471.  
  18472.           if ((a.combat.getFightMode() == a.xD) || (a.combat.getFightMode() == 3))
  18473.           {
  18474.             a.A(a.SD);
  18475.  
  18476.             a.sleep(400, 600);
  18477.           }
  18478.         }
  18479.         if (a.bc)
  18480.         {
  18481.           if ((a.gB) && ((a.PD == a.xD) || (a.PD == 3))) {
  18482.             a.PD = -1;
  18483.           }
  18484.           else
  18485.           {
  18486.             a.A(a.PD != -1 ? a.PD : a.SD);
  18487.           }
  18488.  
  18489.         }
  18490.         else
  18491.         {
  18492.           a.A(a.v);
  18493.         }
  18494.       }
  18495.     }
  18496.     return a.game.getCurrentTab() == 0;
  18497.   }
  18498.  
  18499.   private boolean l()
  18500.   {
  18501.     int i1;
  18502.     if (
  18503.       (i1 = a.inventory.getItemID("Law rune")) > 0) {
  18504.       if (a.inventory.getCount(new int[] { i1 }) > 2)
  18505.       {
  18506.         if (!a.F(40, "Cast")) {
  18507.           a.sleep(300, 600);
  18508.         }
  18509.  
  18510.         a.K(true);
  18511.  
  18512.         a.K(true);
  18513.         RSGroundItem localRSGroundItem;
  18514.         if (((localRSGroundItem = a.groundItems.getNearest(new int[] { 18829 })) != null) &&
  18515.           (a.l(localRSGroundItem.getLocation(), false))) {
  18516.           return true;
  18517.         }
  18518.  
  18519.       }
  18520.  
  18521.     }
  18522.  
  18523.     return (a.G(false)) && (a.n());
  18524.   }
  18525. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement