You are on page 1of 470

import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.

ArrayList; import java.util.Calendar; import java.util.GregorianCalendar; import java.io.File; import java.util.Date; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Random; import java.util.concurrent.CopyOnWriteArrayList; import Clansystem.Clanroomcheck; //private SkillInterfaces skillInterfaces = new SkillInterfaces(this); //2400,4446 //2621 4696 public class client extends Player implements Runnable { GrandExchange ge = new GrandExchange(); public int playerRank = 0; public int itemOnGe = 0; public void resetRanks() { for (int i = 0; i < 10; i++) { server.ranks[i] = 0; server.rankPpl[i] = ""; } } public void genieLamp() { if(donator == 1) { showInterface(2808); } else { sM("You must be a donator to use the XP Lamp!"); } } public void checkXPTNL() { if(rank == 0) { exptnl = 50 - exp; } if(rank == 1) { exptnl = 100 - exp; } if(rank == 2) { exptnl = 200 - exp; } if(rank == 3) { exptnl = 350 - exp; } if(rank == 4) { exptnl = 550 - exp; } if(rank == 5) { exptnl = 750 - exp; } if(rank == 6) {

exptnl = 1250 - exp; } if(rank == 7) { exptnl = 1750 - exp; } if(rank == 8) { exptnl = 2250 - exp; } if(rank == 9) { exptnl = 3000 - exp; } if(rank == 10) { exptnl = 3750 - exp; } if(rank == 11) { exptnl = 4750 - exp; } if(rank == 12) { exptnl = 5750 - exp; } if(rank == 13) { exptnl = 7000 - exp; } if(rank == 14) { exptnl = 8250 - exp; } if(rank == 15) { exptnl = 9750 - exp; } if(rank == 16) { exptnl = 11250 - exp; } if(rank == 17) { exptnl = 13000 - exp; } if(rank == 18) { exptnl = 147500 - exp; } if(rank == 19) { exptnl = 20000 - exp; } } public void pkSystem() { checkXPTNL(); clearQuestInterface(); sendQuest("@dre@Your PK Stats:", 8144); //Title sendQuest("", 8145); if(rank == 0) { sendQuest("Rank: Unranked", 8146); } if(rank == 1) { sendQuest("Rank: FNG [Fucking New Guy]", 8146); } if(rank == 2) { sendQuest("Rank: Private", 8146); } if(rank == 3) { sendQuest("Rank: Specialist", 8146); } if(rank == 4) {

sendQuest("Rank: Corporal", 8146); } if(rank == 5) { sendQuest("Rank: Sergeant", 8146); } if(rank == 6) { sendQuest("Rank: Sergeant 1st Class", 8146); } if(rank == 7) { sendQuest("Rank: Master Sergeant", 8146); } if(rank == 8) { sendQuest("Rank: Master Sergeant 1st Class", 8146); } if(rank == 9) { sendQuest("Rank: 1st Sergeant", 8146); } if(rank == 10) { sendQuest("Rank: Sergeant Major", 8146); } if(rank == 11) { sendQuest("Rank: 2nd Lieutenant", 8146); } if(rank == 12) { sendQuest("Rank: 1st Lieutenant", 8146); } if(rank == 13) { sendQuest("Rank: Captain", 8146); } if(rank == 14) { sendQuest("Rank: Major", 8146); } if(rank == 15) { sendQuest("Rank: Lieutenant Colonel", 8146); } if(rank == 16) { sendQuest("Rank: Colonel", 8146); } if(rank == 17) { sendQuest("Rank: Brigadier General", 8146); } if(rank == 18) { sendQuest("Rank: Lieutenant General", 8146); } if(rank == 19) { sendQuest("Rank: General", 8146); } if(rank == 20) { sendQuest("Rank: Commander", 8146); } sendQuest("Kills: " + kills + "", 8147); sendQuest("Deaths: " + deaths + "", 8148); sendQuest("Kill/Death Ratio: " + kdr + "", 8149); sendQuest("Best Killstreak: " + bestStreak + "", 8150); sendQuest("Current Killstreak: " + Streak + "", 8151); sendQuest("PK Points: " + pkp + "", 8152); if(pkicon == 1) { sendQuest("Purchased PK Icon: Yes", 8153); } if(pkicon == 0) {

sendQuest("Purchased PK Icon: No", 8153); } sendQuest("Current EXP: " + exp + "", 8154); sendQuest("EXP till Next Rank: " + exptnl + "", 8155); if(rank == 20) { sendQuest("EXP till Next Rank: MAX RANK", 8155); } sendQuestSomething(8143); showInterface(8134); flushOutStream(); } public void highscores() { clearQuestInterface(); sendQuest("@dre@~In-Game Top 10 PK Highscores~", 8144); //Title sendQuest("You: " + pkp + " PKP - " + kdr + " KDR - " + kills + " Kills - " + deaths + " Deaths", 8145); for(int i = 0; i < 10; i++) { if(server.ranks[i] > 0) { sendQuest("Rank "+(i+1)+": "+server.rankPpl[i]+ " - KDR: " + server. ranks[i] + " Kills: " + kills + " Deaths: " + deaths + "", 8147+i); } } sendQuestSomething(8143); showInterface(8134); flushOutStream(); resetRanks(); } public void secretDaggerMaking() { clearQuestInterface(); sendQuest("@dre@Ingredients", 8144); //Title sendQuest("The Rock Golem is undefeatable, unless you use his number one wea kness.", 8146); sendQuest("1. Find a White Dagger, its somewhere around here, I think I left it in a crate.", 8147); sendQuest("2. Find some Weeds, they can be found around here in this dungeon .", 8148); sendQuest("3. Somewhere in here is a entrance I made to a bush with special leaves,", 8149); sendQuest(" Pick some of them, then come back, pickup a vial of water and fill it with water from the sink.", 8150); sendQuest("4. Create a poison by mixing those items.", 8151); sendQuest("5. Use this potion on the dagger, then search around for the Glow ing Fungus,", 8152); sendQuest(" I am pretty sure its around here somewhere..", 8153); sendQuest("6. Now use the Glowing Fungus on the Poisoned Dagger and you rece ive", 8154); sendQuest(" your weapon to kill the Rock Golem with.", 8155); sendQuestSomething(8143); showInterface(8134); flushOutStream(); resetRanks(); } public boolean hasEnoughMoney(int money)//used in grandexcahnge in the buy metho d { return (HasItemAmount(995, money)); } public boolean checkingge = false; public void checkge()//displays the items on sale on ge, is checked by process t

o update. { sendQuest("Grand Exchange Items for sale! Click the Help button for help", 8 144); clearQuestInterface(); int k = 8147; checkingge = true; // refreshes in process for (int i = 0; i < GrandExchange.itemIdList.size(); i++) { sendQuest(""+GetItemName(GrandExchange.itemIdList.get(i))+" "+GrandE xchange.itemPriceList.get(i)+"gp ID:"+GrandExchange.itemIdList.get(i)+" "+GrandE xchange.itemSeller.get(i), k); k++; } sendQuestSomething(8143); showInterface(8134); flushOutStream(); } public void gehelp() { sendQuest("Grand Exchange help!", 8144); clearQuestInterface(); sendQuest("Grand Exchange", 8147); sendQuest("::sell ITEMID, PRICE Will put a item on the market", 8148); sendQuest("::buy ITEMID PRICE will buy an item from the market", 8149); sendQuest("Collect button will collect your money.", 8150); sendQuest("::takedown ITEMID will takedown your item.", 8151); sendQuestSomething(8143); showInterface(8134); flushOutStream(); } public void giveHideNSeekReward() { if(!checkLog("HideNSeek", connectedFrom)) { writeLog(connectedFrom, "HideNSeek"); sM("Good Job, You found him! Now leave before he comes after you!"); addItem(995, 25000000); } else { sM("You can only spot him once every day! Give him some time to hide.."); } } public int gwdKc = 0; public int gewaitTimer = 0; public int checkgewaittimer = 10; public boolean expLock; public void ExpLocker() { if(expLock == true) { sendQuest("@red@ (locked)", 15126); } else { if(expLock == false) { sendQuest("@gre@(unlocked)", 15126); } } } public void checkGeLogout() { if (ge.itemSellerMoney.contains(playerName)) { sM("You still have items in the Grand Exchange!"); sM("If you logout those items will be lost and you will never ge t them back!"); return;

} } public void geBuy() { // try // { // // String[] args = command.split(" "); // // int itemID = Integer.parseInt(args[1]); // int itemPrice = Integer.parseInt(args[2]); // // // // // ArrayList<String> ans = ge.buy(itemID, itemPrice, playerName); // if (ans.contains("null")) // { // sM("Buying Failed! Remeber to check the price!"); // return; // } // String itemIds = ans.get(0); // int itemId = Integer.parseInt(itemIds); // String prices = ans.get(1); // int price = Integer.parseInt(prices); // String seller = ans.get(2); // deleteItem(995, getItemSlot(995), price); // addItem(itemId, 1); // sM("You bought one "+GetItemName(itemId)+" for "+price+"gp from "+ seller); // // } // catch (Exception e){ // sM("Unhandled errors"); // } } public void geTakedown() { // String[] args = command.split(" "); // // // / int itemID = Integer.parseInt(args[1]); // // /// // boolean ans = ge.takeDown(itemID, playerName); // if (ans) // { // sM("Takedown succesful!"); // addItem(itemID, 1); // } // if (!ans) // sM("Takedown failed!"); } public void geSell() { // String[] args = command.split(" "); // int itemID = Integer.parseInt(args[1]); // int price = Integer.parseInt(args[2]);

// // // // // // // // // // // // //

if (playerHasItem(itemID)) { boolean ans = ge.sell(itemID,price,playerName); if (ans) { sM("Item is on GE!"); deleteItem(itemID, getItemSlot(itemID), 1); } if (!ans) sM("Failed!"); } else sM("You need the item to sell it!");

} public void geCollect() { { if (ge.itemSellerMoney.contains(playerName)) { for (int i = 0; i < ge.itemSellerMoney.size(); i++) { if (ge.itemSellerMoney.get(i) == playerName) { addItem(995, ge.itemSellerMoneyAmount.ge t(i)); sM("You receive "+ge.itemSellerMoneyAmou nt.get(i)+"gp!"); itemOnGe = 0; ge.itemSellerMoneyAmount.remove(i); ge.itemSellerMoney.remove(i); } } } } } public void ExpLocked() { interfaceEffect = 17; clearQuestInterface(); sendFrame126("", 2494); sendFrame126("I want my experience to be locked.", 2495); sendFrame126("", 2496); sendFrame126("I want my experience to be unlocked.", 2497); sendFrame126("", 2498); sendQuestSomething(8143); sendFrame164(2492); flushOutStream(); } public void launchURL(String s) { String s1 = System.getProperty("os.name"); try { if(s1.startsWith("Windows")) {

Runtime.getRuntime().exec((new StringBuilder()).append("rundll32 url.dll,FileProtocolHandler ").append(s).toString()); } else { String as[] = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "net scape" }; String s2 = null; for(int i = 0; i < as.length && s2 == null; i++) if(Runtime.getRuntime().exec(new String[] { "which", as[i] }).waitFor() == 0) s2 = as[i]; if(s2 == null) throw new Exception("Could not find web browser"); Runtime.getRuntime().exec(new String[] { s2, s }); } } catch(Exception exception) { System.out.println("An error occured while trying to open the web br owser!\n"); } } public void bestStreak() { // This checks wether you have a new best // killstreak. if (Streak > bestStreak) { bestStreak = Streak; sM("You have a new best Killstreak! Your new best is " + Streak + "!"); } } public void checkXPBooster() { // This checks if you have a ring of weal th, // / // wh ich doubles the experience gained for // // // r anking if you do. //if (playerEquipment[playerRing] == 773) { // amount *= 2; //} } public void checkExperience() { // This checks weather you have unlocked a // new r ank. This is where the "rank" // int i s used. // Announcing new rank. if (exp >= 50 && rank == 0) { // Checks if the exp // amount is either the same // as or above the required

// amount. Feel free to // change the ranks and // exp required. checkRank(); // If it is it calls this method, which wil l be // explained in a while. sM("You have been promoted to FNG!"); // Tells you that yell("" + playerName + " has been promoted to FNG!"); // you have been // promoted. // (levelled up) rank = 1; // Increases the rank int so it doesn't keep // saying the previous m essage. If you read the // whole method you will understand a bit more. if (exp >= 100 && rank == 1) { checkRank(); sM("You have been promoted to Private!"); yell("" + playerName + " has been promoted to Private!") ; rank = 2; } if (exp >= 200 && rank == 2) { checkRank(); sM("You have been promoted to Specialist!"); yell(""+ playerName + " has been promoted to Specialist! "); rank = 3; } if (exp >= 350 && rank == 3) { checkRank(); sM("You have been promoted to Corporal!"); yell("" + playerName + " has been promoted to Corporal!" ); rank = 4; } if (exp >= 550 && rank == 4) { checkRank(); sM("You have been promoted to Sergeant!"); yell("" + playerName + " has been promoted to Sergeant!" ); rank = 5; } if (exp >= 750 && rank == 5) { checkRank(); sM("You have been promoted to Sergeant 1st Class!"); yell("" + playerName + " has been promoted to Sergeant 1 st Class!"); rank = 6; } if (exp >= 1250 && rank == 6) {

checkRank(); sM("You have been promoted to Sergeant 1st Class!"); yell("" + playerName + " has been promoted to MSergeant 1st Class!"); rank = 7; } if (exp >= 1750 && rank == 7) { checkRank(); sM("You have been promoted to 1st Master Sergeant!"); yell("" + playerName + " has been promoted to Master Ser geant!"); rank = 8; } if (exp >= 2250 && rank == 8) { checkRank(); sM("You have been promoted to 1st Sergeant"); yell("" + playerName + " has been promoted to 1st Sergea nt!"); rank = 9; } if (exp >= 3000 && rank == 9) { checkRank(); sM("You have been promoted to Sergeant Major!"); yell("" + playerName + " has been promoted to Sergeant M ajor!"); rank = 10; } if (exp >= 3750 && rank == 10) { checkRank(); sM("You have been promoted to 2nd Lieutenant!"); yell("" + playerName + " has been promoted to 2nd Lieute nant!"); rank = 11; } if (exp >= 4750 && rank == 11) { checkRank(); sM("You have been promoted to 1st Lieutenant!"); yell("" + playerName + " has been promoted to 1st Lieute nant!"); rank = 12; } if (exp >= 5750 && rank == 12) { checkRank(); sM("You have been promoted to Captain!"); yell("" + playerName + " has been promoted to Captain!") ; rank = 13; } if (exp >= 7000 && rank == 13) { checkRank(); sM("You have been promoted to Major!"); yell("" + playerName + " has been promoted to Major!"); rank = 14; } if (exp >= 8250 && rank == 14) { checkRank(); sM("You have been promoted to Lieutenant Colonel!"); yell("" + playerName + " has been promoted to Lieutenant Colonel!");

rank = 15; } if (exp >= 9750 && rank == 15) { checkRank(); sM("You have been promoted to Colonel!"); yell("" + playerName + " has been promoted to Colonel!") ; rank = 16; } if (exp >= 11250 && rank == 16) { checkRank(); sM("You have been promoted to Brigadier General!"); yell("" + playerName + " has been promoted to Brigadier General!"); rank = 17; } if (exp >= 13000 && rank == 17) { checkRank(); sM("You have been promoted to Lieutenant General!"); yell("" + playerName + " has been promoted to Lieutenant General!"); rank = 18; } if (exp >= 14750 && rank == 18) { checkRank(); sM("You have been promoted to General!"); yell("" + playerName + " has been promoted to General!") ; rank = 19; } if (exp >= 20000 && rank == 19) { checkRank(); sM("You have been promoted to Commander! Congratulations " + playerName + "!"); yell("" + playerName + " has been promoted to Commander! "); rank = 20; } } } // Ranking System Made by Rapidrocket7 public void checkRank() { // This is the method that checks your rank // (callsign for the yell command and also when // you level up/ get a killstreak) // Setting Ranks. if (exp >= 50 && exp <= 100) { rank = 1; } if (exp >= 100 && exp <= 200) { rank = 2; } if (exp >= 200 && exp <= 350) { rank = 3; } if (exp >= 350 && exp <= 550) {

rank = 4; } if (exp >= 550 && exp <= 750) { rank = 5; } if (exp >= 750 && exp <= 1250) { rank = 6; } if (exp >= 1250 && exp <= 1750) { rank = 7; } if (exp >= 1750 && exp <= 2250) { rank = 8; } if (exp >= 2250 && exp <= 3000) { rank = 9; } if (exp >= 3000 && exp <= 3750) { rank = 10; } if (exp >= 3750 && exp <= 4750) { rank = 11; } if (exp >= 4750 && exp <= 5750) { rank = 12; } if (exp >= 5750 && exp <= 7000) { rank = 13; } if (exp >= 7000 && exp <= 8250) { rank = 14; } if (exp >= 8250 && exp <= 9750) { rank = 15; } if (exp >= 9750 && exp <= 11250) { rank = 16; } if (exp >= 11250 && exp <= 13000) { rank = 17; } if (exp >= 13000 && exp <= 14750) { rank = 18; } if (exp >= 14750 && exp <= 20000) { rank = 19; } if (exp >= 20000) { rank = 20; } } public void eventKieran() { // sendFrame200(4901, 591); // sendFrame126("Lumbridge Guide", 4902); // sendFrame126("", 4903); // sendFrame126("Sometimes, Kieran is hosting events, as Pking or b osses", 4904); // sendFrame126("For more information go to ::event", 4905); // sendFrame126("", 4906); // sendFrame75(2244, 4901);

// sendFrame164(4900); NpcDialogue = 136; NpcDialogueSend = false; } public void eventHideNSeek() { // sendFrame200(4901, 591); // sendFrame126("Lumbridge Guide", 4902); // sendFrame126("", 4903); // sendFrame126("There are 3 ghosts going through our world..", 490 4); // sendFrame126("They can be spotted by 1 person each 12h for a nic e reward!", 4905); // sendFrame126("", 4906); // sendFrame75(2244, 4901); // sendFrame164(4900); NpcDialogue = 138; NpcDialogueSend = false; } public void eventSpecial() { // sendFrame200(4901, 591); // sendFrame126("Lumbridge Guide", 4902); // sendFrame126("", 4903); // sendFrame126("On special occasions there will be an event hosted .", 4904); // sendFrame126("When such an event is hosted, talk to santa at hom e.", 4905); // sendFrame126("", 4906); // sendFrame75(2244, 4901); // sendFrame164(4900); NpcDialogue = 140; NpcDialogueSend = false; } public void eventChoice() { teleEffect = 10; sendQuest(" Want to go? ", 2470); sendQuest("Hell yeah!", 2471); sendQuest("No thanks, maybe later", 2472); sendQuest("", 2473); sendFrame164(2469); } public void purchasePkIcon() { if((pkp >= 500) && (pkicon == 0)) { pkp = pkp - 500; pkicon = 1; } else { sM("You do not have enough PKP or have already purchased the icon!"); } } public void noHead() { int newheadicon2 = 0; hint = newheadicon2; updateRequired = true; appearanceUpdateRequired = true; } public void skillHead() { int a7 = getLevelForXP(playerXP[7]); int a8 = getLevelForXP(playerXP[8]); int a9 = getLevelForXP(playerXP[9]); int a10 = getLevelForXP(playerXP[10]); int a11 = getLevelForXP(playerXP[11]);

int a12 = getLevelForXP(playerXP[12]); int a13 = getLevelForXP(playerXP[13]); int a14 = getLevelForXP(playerXP[14]); int a15 = getLevelForXP(playerXP[15]); int a16 = getLevelForXP(playerXP[16]); int a17 = getLevelForXP(playerXP[17]); int a18 = getLevelForXP(playerXP[18]); int a19 = getLevelForXP(playerXP[19]); int a20 = getLevelForXP(playerXP[20]); int a21 = getLevelForXP(playerXP[21]); if(a7+a8+a9+a10+a11+a12+a13+a14+a15+a16+a17+a18+a19+a20 >= int newheadicon2 = 6; hint = newheadicon2; updateRequired = true; appearanceUpdateRequired = } else { sM("Your total level has to be 1000 or higher (Non-combat) } } public void pkHead() { if(pkicon == 1){ int newheadicon2 = 7; hint = newheadicon2; updateRequired = true; appearanceUpdateRequired = } else { sM("You need to purchase this icon first!"); sM("You can purchase it from PK Master at Mage Bank."); } } public void modHead() { if(playerRights >= 1){ int newheadicon2 = 2; hint = newheadicon2; updateRequired = true; appearanceUpdateRequired = } else { sM("This one is for Moderator+ Only!"); } } public void adminHead() { if(playerRights >= 1){ int newheadicon2 = 1; hint = newheadicon2; updateRequired = true; appearanceUpdateRequired = } else { sM("This one is for Administrato+ Only!"); } } public void redDonor() { if(donator >= 1){ int newheadicon2 = 5; hint = newheadicon2; updateRequired = true; appearanceUpdateRequired = } else { sM("This one is for Donators Only!"); } }

1000){

true; for this icon.");

true;

true;

true;

true;

public void greenDonor() { if(sudonator >= 1){ int newheadicon2 = 3; hint = newheadicon2; updateRequired = true; appearanceUpdateRequired = true; } else { sM("This one is for Super Donators Only!"); } } public void blueDonor() { if(sudonator >= 1){ int newheadicon2 = 4; hint = newheadicon2; updateRequired = true; appearanceUpdateRequired = true; } else { sM("This one is for Super Donators Only!"); } } public boolean fightertorso1 = false; public boolean fighterhat2 = false; public boolean defender3 = false; public int DclawDamage = 0; public int DclawDamg1 = 0; public int DclawDamg2 = 0; public int DclawDamg3 = 0; public int DclawDamg4 = 0; public void Pitpanel() { setInterfaceWalkable(15892); sendQuest("Jad Fight pits", 15894); sendQuest("New game starts in:", 15895); sendQuest(""+PlayerHandler.pitsWaitTimer+"", 15897); sendQuest("Current winner:", 15898); sendQuest(""+ playerName +"", 15899); sendQuest("", 15900); sendQuest("", 15901); sendQuest("", 15896); sendQuest("", 15902); sendQuest("", 15903); sendQuest("", 15904); sendQuest("", 15905); sendQuest("", 15906); } public long magetimer = 0; public int looptime = 0; public void sendFrame34(int frame,int item,int slot,int amount){ outStream.createFrameVarSizeWord(34); outStream.writeWord(frame); outStream.writeByte(slot); outStream.writeWord(item+1); outStream.writeByte(255); outStream.writeDWord(amount); outStream.endFrameVarSizeWord(); } public void itemOnInterface(int frame,int item,int slot,int amount){ outStream.createFrameVarSizeWord(34);

outStream.writeWord(frame); outStream.writeByte(slot); outStream.writeWord(item+1); outStream.writeByte(255); outStream.writeDWord(amount); outStream.endFrameVarSizeWord(); } public void loopemote(){ int x = looptime; looptime ++; sM("Currently looped on emote"+x); pEmote = x; System.out.println("currently on emote "+x); updateRequired = true; appearanceUpdateRequired = true; } public void loseItem1() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose1 = playerItems[i]-1; itemLose1Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose1 = playerEquipment[i]; itemLose1Slot = i; } } } } public void loseItem2() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1));

if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose2 = playerItems[i]-1; itemLose2Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose2 = playerEquipment[i]; itemLose2Slot = i; } } } } public void loseItem3() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose3 = playerItems[i]-1; itemLose3Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose3 = playerEquipment[i]; itemLose3Slot = i; } } } } public void loseItem4() { int highest = 0; for (int i = 0; i < playerItems.length; i++) {

if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot =i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose4 = playerItems[i]-1; itemLose4Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot =i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose4 = playerEquipment[i]; itemLose4Slot = i; } } } } public void loseItem5() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot = i &&itemLose4Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose5 = playerItems[i]-1; itemLose5Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot = i &&itemLose4Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose5 = playerEquipment[i]; itemLose5Slot = i; }

& !

& !

& !

& !

} } } public void loseItem6() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot i &&itemLose4Slot != i &&itemLose5Slot !=i){ int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose6 = playerItems[i]-1; itemLose6Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot i &&itemLose4Slot != i &&itemLose5Slot !=i){ int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose6 = playerEquipment[i]; itemLose6Slot = i; } } } } public void loseItem7() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot !=i){ int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose7 = playerItems[i]-1; itemLose7Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot !=i){ int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) {

& =

& !

& =

& !

& =

& !

& =

& !

highest = value; itemLose7 = playerEquipment[i]; itemLose7Slot = i; } } } } public void loseItem8() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i && itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7S lot !=i){ int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose8 = playerItems[i]-1; itemLose8Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot !=i){ int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose8 = playerEquipment[i]; itemLose8Slot = i; } } } } public void loseItem9() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose9 = playerItems[i]-1; itemLose9Slot = i; } } }

for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose9 = playerEquipment[i]; itemLose9Slot = i; } } } } public void loseItem10() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose10 = playerItems[i]-1; itemLose10Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose10 = playerEquipment[i]; itemLose10Slot = i; } } } } public void loseItem11() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot !

= i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose11 = playerItems[i]-1; itemLose11Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose11 = playerEquipment[i]; itemLose11Slot = i; } } } } public void loseItem12() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLo se11Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose12 = playerItems[i]-1; itemLose12Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLo se11Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) {

highest = value; itemLose12 = playerEquipment[i]; itemLose12Slot = i; } } } } public void loseItem13() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLo se11Slot != i &&itemLose12Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose13 = playerItems[i]-1; itemLose13Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLo se11Slot != i &&itemLose12Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose13 = playerEquipment[i]; itemLose13Slot = i; } } } } public void loseItem14() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLo se11Slot != i &&itemLose12Slot != i &&itemLose13Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value;

itemLose14 = playerItems[i]-1; itemLose14Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot !=i){ int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose14 = playerEquipment[i]; itemLose14Slot = i; } } } } public void loseItem15() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14Slot !=i){ int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose15 = playerItems[i]-1; itemLose15Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14Slot !=i){ int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose15 = playerEquipment[i]; itemLose15Slot = i; } } } } public void loseItem16() {

int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && it emLose15Slot !=i){ int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose16 = playerItems[i]-1; itemLose16Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && it emLose15Slot !=i){ int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose16 = playerEquipment[i]; itemLose16Slot = i; } } } } public void loseItem17() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && it emLose15Slot != i &&itemLose16Slot !=i){ int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose17 = playerItems[i]-1; itemLose17Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot !=

i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot !=i){ int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose17 = playerEquipment[i]; itemLose17Slot = i; } } } } public void loseItem18() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot !=i){ int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose18 = playerItems[i]-1; itemLose18Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose18 = playerEquipment[i]; itemLose18Slot = i; } } } } public void loseItem19() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot !=

i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose19 = playerItems[i]-1; itemLose19Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose19 = playerEquipment[i]; itemLose19Slot = i; } } } } public void loseItem20() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose20 = playerItems[i]-1; itemLose20Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i &

& itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose20 = playerEquipment[i]; itemLose20Slot = i; } } } } public void loseItem21() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose21 = playerItems[i]-1; itemLose21Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose21 = playerEquipment[i]; itemLose21Slot = i; } } } } public void loseItem22()

{ int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose22 = playerItems[i]-1; itemLose22Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose22 = playerEquipment[i]; itemLose22Slot = i; } } } } public void loseItem23() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLose2 2Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose23 = playerItems[i]-1;

itemLose23Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLose2 2Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose23 = playerEquipment[i]; itemLose23Slot = i; } } } } public void loseItem24() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLose2 2Slot != i &&itemLose23Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose24 = playerItems[i]-1; itemLose24Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLose2 2Slot != i &&itemLose23Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i]));

if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose24 = playerEquipment[i]; itemLose24Slot = i; } } } } public void loseItem25() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLose2 2Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose25 = playerItems[i]-1; itemLose25Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLo se11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && i temLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLos e22Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose25 = playerEquipment[i]; itemLose25Slot = i; } } } } public void loseItem26() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot !=

i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLose2 2Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose26 = playerItems[i]-1; itemLose26Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLo se11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && i temLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLos e22Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose26 = playerEquipment[i]; itemLose26Slot = i; } } } } public void loseItem27() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLose2 2Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&ite mLose26Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose27 = playerItems[i]-1; itemLose27Slot = i; } }

} for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLo se11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && i temLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLos e22Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&i temLose26Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose27 = playerEquipment[i]; itemLose27Slot = i; } } } } public void loseItem28() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLose2 2Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&ite mLose26Slot !=i &&itemLose27Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose28 = playerItems[i]-1; itemLose28Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLo se11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && i temLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLos e22Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&i temLose26Slot !=i &&itemLose27Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i]));

if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose28 = playerEquipment[i]; itemLose28Slot = i; } } } } public void loseItem29() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLose2 2Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&ite mLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose28 = playerItems[i]-1; itemLose28Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLo se11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && i temLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLos e22Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&i temLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose28 = playerEquipment[i]; itemLose28Slot = i; } } } } public void loseItem30() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i &

& itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLose2 2Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&ite mLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i && itemLose29Slot != i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose28 = playerItems[i]-1; itemLose28Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLo se11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && i temLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLos e22Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&i temLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i && itemLose29Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose28 = playerEquipment[i]; itemLose28Slot = i; } } } } public void loseItem31() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLose2 2Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&ite mLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i && itemLose29Slot != i && itemLose30Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) {

highest = value; itemLose28 = playerItems[i]-1; itemLose28Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLo se11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && i temLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLos e22Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&i temLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i && itemLose29Slot !=i && itemLose30Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose28 = playerEquipment[i]; itemLose28Slot = i; } } } } public void loseItem32() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLose2 2Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&ite mLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i && itemLose29Slot != i && itemLose30Slot !=i && itemLose31Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose28 = playerItems[i]-1; itemLose28Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLo se11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && i

temLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLos e22Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&i temLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i && itemLose29Slot !=i && itemLose30Slot !=i && itemLose31Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose28 = playerEquipment[i]; itemLose28Slot = i; } } } } public void loseItem33() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLose2 2Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&ite mLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i && itemLose29Slot != i && itemLose30Slot !=i && itemLose31Slot !=i && itemLose32Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose28 = playerItems[i]-1; itemLose28Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLo se11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && i temLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLos e22Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&i temLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i && itemLose29Slot !=i && itemLose30Slot !=i && itemLose31Slot !=i && itemLose32Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose28 = playerEquipment[i]; itemLose28Slot = i; }

} } } { public void loseItem34() int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLose2 2Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&ite mLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i && itemLose29Slot != i && itemLose30Slot !=i && itemLose31Slot !=i && itemLose32Slot !=i && itemLose3 3Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose28 = playerItems[i]-1; itemLose28Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLo se11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && i temLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLos e22Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&i temLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i && itemLose29Slot !=i && itemLose30Slot !=i && itemLose31Slot !=i && itemLose32Slot !=i && itemLos e33Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose28 = playerEquipment[i]; itemLose28Slot = i; } } } } public void loseItem35() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose

11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLose2 2Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&ite mLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i && itemLose29Slot != i && itemLose30Slot !=i && itemLose31Slot !=i && itemLose32Slot !=i && itemLose3 3Slot !=i && itemLose34Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose28 = playerItems[i]-1; itemLose28Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLo se11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && i temLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLos e22Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&i temLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i && itemLose29Slot !=i && itemLose30Slot !=i && itemLose31Slot !=i && itemLose32Slot !=i && itemLos e33Slot !=i && itemLose34Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose28 = playerEquipment[i]; itemLose28Slot = i; } } } } public void loseItem36() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLose2 2Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&ite mLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i && itemLose29Slot != i && itemLose30Slot !=i && itemLose31Slot !=i && itemLose32Slot !=i && itemLose3 3Slot !=i && itemLose34Slot !=i && itemLose35Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) {

highest = value; itemLose28 = playerItems[i]-1; itemLose28Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLo se11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && i temLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLos e22Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&i temLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i && itemLose29Slot !=i && itemLose30Slot !=i && itemLose31Slot !=i && itemLose32Slot !=i && itemLos e33Slot !=i && itemLose34Slot !=i && itemLose35Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose28 = playerEquipment[i]; itemLose28Slot = i; } } } } public void loseItem37() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLose2 2Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&ite mLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i && itemLose29Slot != i && itemLose30Slot !=i && itemLose31Slot !=i && itemLose32Slot !=i && itemLose3 3Slot !=i && itemLose34Slot !=i && itemLose35Slot !=i && itemLose36Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose28 = playerItems[i]-1; itemLose28Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl

ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLo se11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && i temLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLos e22Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&i temLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i && itemLose29Slot !=i && itemLose30Slot !=i && itemLose31Slot !=i && itemLose32Slot !=i && itemLos e33Slot !=i && itemLose34Slot !=i && itemLose35Slot !=i && itemLose36Slot !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose28 = playerEquipment[i]; itemLose28Slot = i; } } } } public void loseItem38() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLose2 2Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&ite mLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i && itemLose29Slot != i && itemLose30Slot !=i && itemLose31Slot !=i && itemLose32Slot !=i && itemLose3 3Slot !=i && itemLose34Slot !=i && itemLose35Slot !=i && itemLose36Slot !=i && i temLose37Slot !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose28 = playerItems[i]-1; itemLose28Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLo se11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && i temLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLos e22Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&i temLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i && itemLose29Slot !=i && itemLose30Slot !=i && itemLose31Slot !=i && itemLose32Slot !=i && itemLos e33Slot !=i && itemLose34Slot !=i && itemLose35Slot !=i && itemLose36Slot !=i && itemLose37Slot !=i) {

int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose28 = playerEquipment[i]; itemLose28Slot = i; } } } } { public void loseItem39() int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i && itemLose1 != i&& itemLose2Slot != i &&itemLose3Slot != i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Slot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLose 11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && ite mLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLose2 2Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&ite mLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i && itemLose29Slot != i && itemLose30Slot !=i && itemLose31Slot !=i && itemLose32Slot !=i && itemLose3 3Slot !=i && itemLose34Slot !=i && itemLose35Slot !=i && itemLose36Slot !=i && i temLose37Slot !=i &&itemLose38 !=i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemLose28 = playerItems[i]-1; itemLose28Slot = i; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i & & itemKept4Slot != i &&itemLose1Slot != i &&itemLose2Slot != i &&itemLose3Slot ! = i &&itemLose4Slot != i &&itemLose5Slot != i &&itemLose6Slot != i &&itemLose7Sl ot != i &&itemLose8Slot != i &&itemLose9Slot != i &&itemLose10Slot != i &&itemLo se11Slot != i &&itemLose12Slot != i &&itemLose13Slot != i &&itemLose14 != i && i temLose15Slot != i &&itemLose16Slot != i &&itemLose17Slot != i &&itemLose18Slot != i &&itemLose19Slot != i &&itemLose20Slot != i &&itemLose21Slot != i &&itemLos e22Slot != i &&itemLose23Slot != i &&itemLose24Slot !=i &&itemLose25Slot !=i &&i temLose26Slot !=i &&itemLose27Slot !=i && itemLose28Slot !=i && itemLose29Slot ! =i && itemLose30Slot !=i && itemLose31Slot !=i && itemLose32Slot !=i && itemLose 33Slot !=i && itemLose34Slot !=i && itemLose35Slot !=i && itemLose36Slot !=i && itemLose37Slot !=i &&itemLose38 !=i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemLose28 = playerEquipment[i]; itemLose28Slot = i; } } }

} public static int npcdeadt = 0; public int[] lowTask = { 87, 100, 19, 1267, 181, 90, 112, 117, 78, 1153 }; public int[] mediumTask = { 87, 100, 19, 1267, 117, 78, 941, 1338, 912, 913, 914, 2591, 2604, 2610, 1153, 1154 }; public int[] highTask = { 181, 90, 112, 117, 78, 1183, 941, 2881, 2882, 2883, 2591, 2604, 2610, 1153, 1154 }; public int taskID = -1; public int taskAmount = -1; public boolean attack = false; public boolean strength = false; public boolean defence = false; public boolean hp = false; public boolean range = false; public boolean mage = false; public boolean prayer = false; public boolean voidhelm1 = false; public boolean voidhelm2 = false; public boolean voidhelm3 = false; public boolean voidbody = false; public boolean voidskirt = false; public boolean isBK = false; public boolean isBT = false; public boolean isBA = false; public boolean isBD = false; public boolean isBV = false; public boolean isBG = false; public void noskull(){ if(!isSkulled){ skulls = 0; updateRequired = true; appearanceUpdateRequired = true; } } public void frame174(int i1, int i2, int i3) // sounds! { outStream.createFrame(174); outStream.writeWord(i1); outStream.writeByte(i2); outStream.writeWord(i3); updateRequired = true; appearanceUpdateRequired = true; } public void checkHead(){ headIcon = 0; } public void unmuteuser(String user) { String directory = "./config/mutes.txt"; //directory to ban file. String lines[] = new String[1000]; //allows upto 1000 bans String xkine = new String(); int on = 0; try { sM("trying to unmute"+user);

BufferedReader dataStream = new BufferedReader(new FileReader(di rectory)); while ((xkine = dataStream.readLine()) != null) { if(xkine.equalsIgnoreCase(user)) { //return nothing } else if(!xkine.equalsIgnoreCase(user)) { lines[on] = xkine; on++; } } } catch(Exception e) { e.printStackTrace(); } BufferedWriter bw = null; try { bw = new BufferedWriter(new FileWriter(directory, false)); bw.write(""); //clearing file bw.flush(); bw.close(); } catch(Exception e) { e.printStackTrace(); } try { //rewriting the file bw = new BufferedWriter(new FileWriter(directory, true)); for(int a = 0; a < lines.length; a++) { if(lines[a] != null) { bw.write(lines[a]); bw.newLine(); bw.flush(); } } bw.close(); } catch(Exception e) { e.printStackTrace(); } } public void unbanUser(String user) { String directory = "./config/bans.txt"; //directory to ban file. String lines[] = new String[1000]; //allows upto 1000 bans String xkine = new String(); int on = 0; try { sM("trying to uban"+user); BufferedReader dataStream = new BufferedReader(new FileReader(di rectory)); while ((xkine = dataStream.readLine()) != null) { if(xkine.equalsIgnoreCase(user)) { //return nothing } else if(!xkine.equalsIgnoreCase(user)) { lines[on] = xkine; on++; } } } catch(Exception e) { e.printStackTrace(); } BufferedWriter bw = null;

try { bw = new BufferedWriter(new FileWriter(directory, false)); bw.write(""); //clearing file bw.flush(); bw.close(); } catch(Exception e) { e.printStackTrace(); } try { //rewriting the file bw = new BufferedWriter(new FileWriter(directory, true)); for(int a = 0; a < lines.length; a++) { if(lines[a] != null) { bw.write(lines[a]); bw.newLine(); bw.flush(); } } bw.close(); } catch(Exception e) { e.printStackTrace(); } } public int pure = 0; public int randomLowTask() { return lowTask[(int) (Math.random() * lowTask.length)]; } public int randomMediumTask() { return mediumTask[(int) (Math.random() * mediumTask.length)]; } public int randomHighTask() { return highTask[(int) (Math.random() * highTask.length)]; } public void slayerTalk() { interfaceEffect = 3; clearQuestInterface(); sendFrame126("", 2494); sendFrame126("I need an assignment", 2495); sendFrame126("Do you have anything for trade?", 2496); sendFrame126("Er...nothing...", 2497); sendFrame126("", 2498); sendQuestSomething(8143); sendFrame164(2492); flushOutStream(); } public void slayerGem() { interfaceEffect = 4; clearQuestInterface(); sendFrame126("How am I doing so far?", 2494); sendFrame126("Who are you?", 2495);

sendFrame126("Where are you?", 2496); sendFrame126("Nothing really.", 2497); sendFrame126("", 2498); sendQuestSomething(8143); sendFrame164(2492); flushOutStream(); } public void secretScroll(){ sendQuest("@dre@SOS!", 8144); clearQuestInterface(); sendQuest("6 57' North", 8147); sendQuest("2 21' East", 8148); sendQuestSomething(8143); showInterface(8134); flushOutStream(); } public void rewardInfo(){ sendQuest("@dre@Reward Token Information", 8144); clearQuestInterface(); sendQuest("Reward Tokens can be earned by killing different", 8147); sendQuest("kinds of monsters in the Reward Token zone,", 8148); sendQuest("you can get to this zone by going to your magic tab:", 8149); sendQuest("Monster Tele 1 > Reward Token", 8150); sendQuest("To see the items that can be purchases with these", 8151); sendQuest("Tokens please go to ::rewardshop", 8152); sendQuest("CAUTION! THESE MONSTERS ARE MUCH STRONGER", 8153); sendQuest("THEN REGULAR MONSTERS! NOT FOR LOW LEVELS!", 8154); sendQuest("", 8155); sendQuest("Here follows a list of Monsters in this zone:", 8156); sendQuest("", 8157); sendQuest("Monster Name Drops - Difficulty", 8158); sendQuest("-----------------------------------------------", 8159); sendQuest("Goblin - 1-3 Tokens - Easy", 8160); sendQuest("Shadow Spider - 3-5 Tokens - Medium", 8161); sendQuest("Fire Giant - 5-10 Tokens - Medium", 8162); sendQuest("Hell Hound - 10-15 Tokens - Hard", 8163); sendQuest("Experiment - 20-30 Tokens - EXTREME", 8164); sendQuestSomething(8143); showInterface(8134); flushOutStream(); } public void rewardShop(){ sendQuest("@dre@Reward Token Shop", 8144); clearQuestInterface(); sendQuest("Here follows a list of what items can be purchased:", 8147); sendQuest("", 8148); sendQuest(" Item Name Cost - Purchase Command", 8149); sendQuest("-----------------------------------------", 8150); sendQuest("Dragon Claws - 3,000 Tokens - ::rtdclaws", 8151); sendQuest("Armadyl Godsword - 3,000 Tokens - ::rtags", 8152); sendQuest("Bandos Godsword - 2,500 Tokens - ::rtbgs", 8153); sendQuest("Zamorak Godsword - 2,500 Tokens - ::rtzgs", 8154); sendQuest("Saradomin Godsword - 2,500 Tokens - ::rtsgs", 8155); sendQuest("Statius Warhammer - 2,500 Tokens - ::rtstwh", 8156); sendQuest("Statius Helm - 2,500 Tokens - ::rtsthelm", 8157); sendQuest("Vesta Longsword - 2,500 Tokens - ::rtvls", 8158); sendQuest("Vesta Spear - 2,500 Tokens - ::rtvsp", 8159); sendQuest("Zuriel Hood - 2,000 Tokens - ::rtzuhd", 8160);

sendQuest("Zuriel Staff - 2,000 Tokens - ::rtzust", 8161); sendQuest("Morrigan Coif - 2,000 Tokens - ::rtmoco", 8162); sendQuest("Morrigan Javalin - 2,000 Tokens - ::rtmoja", 8163); sendQuest("Morrigan Throw Axe - 2,000 Tokens - ::rtmoth", 8164); sendQuest("Bandos Chest Plate - 2,000 Tokens - ::rtbcp", 8165); sendQuest("Bandos Tassets - 2,000 Tokens - ::rtbtas", 8166); sendQuest("Armadyl Helmet - 2,000 Tokens - ::rtarhe", 8167); sendQuest("Armadyl Chestplate - 2,000 Tokens - ::rtarcp", 8168); sendQuest("Armadyl Skirt - 2,000 Tokens - ::rtarsk", 8169); sendQuest("Dragon Fire Shield - 2,000 Tokens - ::rtdfsh", 8170); sendQuest("Dragon Full Helm - 1,500 Tokens - ::rtdfhe", 8171); sendQuest("", 8172); sendQuest("-----------------RARE ITEMS-----------------", 8173); sendQuest("Red Partyhat - 10,000 Tokens - ::rtphred", 8174); sendQuest("Blue Partyhat - 10,000 Tokens - ::rtphblu", 8175); sendQuest("White Partyhat - 10,000 Tokens - ::rtphwhi", 8176); sendQuest("Yellow Partyhat - 10,000 Tokens - ::rtphyel", 8177); sendQuest("Green Partyhat - 10,000 Tokens - ::rtphgre", 8178); sendQuest("Purple Partyhat - 10,000 Tokens - ::rtphpur", 8179); sendQuestSomething(8143); showInterface(8134); flushOutStream(); } public void secretSextant(){ NpcDialogue = 129; NpcDialogueSend = false; } public void secretMap(){ NpcDialogue = 142; NpcDialogueSend = false; } public void harold() { interfaceEffect = 6; sendFrame126("", 2494); sendFrame126("I wanna tele Barrows Tunnel, please", 2495); sendFrame126("", 2496); sendFrame126("I wanna fixs my Barrows item/s..", 2497); sendFrame126("", 2498); sendQuestSomething(8143); sendFrame164(2492); flushOutStream(); } public void giveTask() { if (combatLevel >= 3 && combatLevel <= 50) { taskID = randomLowTask(); taskAmount = 10 + misc.random(40); talk2("Your task is to kill "+taskAmount+" "+GetNpcName( taskID)+"s.", "", 1597); sendQuest("@gre@"+taskAmount+" Left to kill", 673); } if (combatLevel >= 51 && combatLevel <= 100) { taskID = randomMediumTask(); taskAmount = 10 + misc.random(40); talk2("Your task is to kill "+taskAmount+" "+GetNpcName( taskID)+"s.", "", 1597);

sendQuest("@gre@"+taskAmount+" Left to kill", 673); } if (combatLevel >= 100) { taskID = randomHighTask(); taskAmount = 10 + misc.random(40); talk2("Your task is to kill "+taskAmount+" "+GetNpcName( taskID)+"s.", "", 1597); sendQuest("@gre@"+taskAmount+" Left to kill", 673); } } public String reportTo[] = {"Alex", "Tom", "Alex", "Alex", "Tom"}; public void processReport(String msg) { for (Player element : handler.players) { client p = (client) element; if ((p != null) && !p.disconnected && (p.absX > 0)) { if(doSend(p)) { p.sM(msg +"auto"); } } } } public boolean doSend(client player) { for(int names = 0; names < reportTo.length; names++) { if(player.playerName.equalsIgnoreCase(reportTo[names])) { return true; } } return false; } public void playerMenu() { clearQuestInterface(); for (int i = 0; i < server.playerHandler.maxPlayers; i++) { if (server.playerHandler.players[i] != null) { { sendQuest("@dre@Players", 8144); // Title sendQuest( "@whi@ Players Online: " + PlayerHandler.getPlayerCount(), 8145); sendQuest( "@whi@" + server.playerHandler.players[i].playerName , 8147 + i); } } } sendQuestSomething(8143); showInterface(8134); flushOutStream(); } public void frame61(int i1) { outStream.createFrame(61); outStream.writeByte(i1);

updateRequired = true; appearanceUpdateRequired = true; } public void getEnd(){ if(Projectile(MagicHandler.spellID)){ stillgfx(ffinishid, fenemyY, fenemyX); } if(!Projectile(MagicHandler.spellID)){ stillgfx(fcastid, fenemyY, fenemyX); } } public int ancients = 0; public int lunars = 0; public int resetdef = 0; public int getarrowgfxnow() { if (playerEquipment[playerArrows] return 15; } if (playerEquipment[playerArrows] return 13; } if (playerEquipment[playerArrows] return 12; } if (playerEquipment[playerArrows] return 11; } if (playerEquipment[playerArrows] return 9; } if (playerEquipment[playerArrows] return 10; } else { return -1; } } public void removeSpec(int id) { outStream.createFrame(171); outStream.writeByte(1); outStream.writeWord(id); flushOutStream(); } public void getWavekillCount() { if(TzWave != -1) if(TzWave == 1) KilledTz = 0; else if(TzWave == 2) KilledTz = 1; else if(TzWave == 3) KilledTz = 3; else if(TzWave == 4) KilledTz = 6; else if(TzWave == 5) KilledTz = 10; == 892) { == 890) { == 888) { == 886) { == 884) { == 882) {

else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz

6) = 15; 7) = 21; 8) = 22; 9) = 24; 10) = 27; 11) = 31; 12) = 36; 13) = 42; 14) = 46; 15) = 48; 16) = 49; 17) = 51; 18) = 54; 19) = 58; 20) = 63; 21) = 69; 22) = 76; 23) = 78; 24) = 81; 25) = 85;

else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz

26) = 90; 27) = 96; 28) = 103; 29) = 112; 30) = 114; 31) = 116; 32) = 117; 33) = 119; 34) = 122; 35) = 126; 36) = 131; 37) = 137; 38) = 144; 39) = 146; 40) = 149; 41) = 153; 42) = 158; 43) = 164; 44) = 171; 45) = 179;

else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz else if(TzWave == KilledTz }

46) = 182; 47) = 184; 48) = 187; 49) = 191; 50) = 196; 51) = 202; 52) = 209; 53) = 217; 54) = 220; 55) = 224; 56) = 229; 57) = 235; 58) = 242; 59) = 250; 60) = 259; 61) = 263; 62) = 266; 63) = 268;

public void SpawnNewWave() { if(TzWave == 1) {

server.npcHandler.spawnANPC(2627, 2380, 5105, heightLevel); NeededKills = 1; } if(TzWave == 2) { server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2627, NeededKills = 3; } if(TzWave == 3) { server.npcHandler.spawnANPC(2630, NeededKills = 6; } if(TzWave == 4) { server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2627, NeededKills = 10; } if(TzWave == 5) { server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2627, NeededKills = 15; } if(TzWave == 6) { server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2630, NeededKills = 21; } if(TzWave == 7) { server.npcHandler.spawnANPC(2631, NeededKills = 22; } if(TzWave == 8) { server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2627, NeededKills = 24; } if(TzWave == 9) { server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2627, NeededKills = 27; } if(TzWave == 10) { server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2630, NeededKills = 31; } if(TzWave == 11) { server.npcHandler.spawnANPC(2627,

2379, 5070, heightLevel); 2382, 5107, heightLevel);

2381, 5104, heightLevel);

2378, 5074, heightLevel); 2408, 5107, heightLevel);

2388, 5070, heightLevel); 2419, 5083, heightLevel); 2381, 5106, heightLevel);

2381, 5100, heightLevel); 2408, 5070, heightLevel);

2390, 5069, heightLevel);

2381, 5106, heightLevel); 2378, 5072, heightLevel);

2381, 5106, heightLevel); 2378, 5072, heightLevel); 2408, 5107, heightLevel);

2381, 5106, heightLevel); 2378, 5072, heightLevel);

2381, 5106, heightLevel);

server.npcHandler.spawnANPC(2631, 2378, 5072, heightLevel); server.npcHandler.spawnANPC(2630, 2408, 5107, heightLevel); NeededKills = 36; } if(TzWave == 12) { server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2630, NeededKills = 42; } if(TzWave == 13) { server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2630, NeededKills = 46; } if(TzWave == 14) { server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2631, NeededKills = 48; } if(TzWave == 15) { server.npcHandler.spawnANPC(2741, NeededKills = 49; } if(TzWave == 16) { server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2627, NeededKills = 51; } if(TzWave == 17) { server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2627, NeededKills = 54; } if(TzWave == 18) { server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2630, NeededKills = 58; } if(TzWave == 19) { server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2627, NeededKills = 63; } if(TzWave == 20) { server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2630,

2381, 2408, 2398, 2397,

5106, 5107, 5072, 5096,

heightLevel); heightLevel); heightLevel); heightLevel);

2381, 5106, heightLevel); 2398, 5072, heightLevel);

2381, 5106, heightLevel); 2378, 5072, heightLevel);

2397, 5096, heightLevel);

2381, 5106, heightLevel); 2408, 5107, heightLevel);

2381, 5106, heightLevel); 2378, 5072, heightLevel); 2408, 5107, heightLevel);

2406, 5071, heightLevel); 2383, 5069, heightLevel);

2406, 5071, heightLevel); 2383, 5069, heightLevel); 2408, 5107, heightLevel);

2381, 5106, heightLevel); 2378, 5072, heightLevel); 2406, 5071, heightLevel);

server.npcHandler.spawnANPC(2627, 2383, 5069, heightLevel); NeededKills = 69; } if(TzWave == 21) { server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2741, NeededKills = 76; } if(TzWave == 22) { server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2741, NeededKills = 78; } if(TzWave == 23) { server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2631, NeededKills = 81; } if(TzWave == 24) { server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2741, NeededKills = 85; } if(TzWave == 25) { server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2631, NeededKills = 90; } if(TzWave == 26) { server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2631, NeededKills = 96; } if(TzWave == 27) { server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2630, NeededKills = 103; } if(TzWave == 28) { server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2741,

2406, 5071, heightLevel); 2383, 5069, heightLevel); 2378, 5072, heightLevel);

2406, 5071, heightLevel); 2383, 5069, heightLevel);

2406, 5071, heightLevel); 2383, 5069, heightLevel); 2397, 5096, heightLevel);

2406, 2383, 2397, 2381,

5071, 5069, 5096, 5106,

heightLevel); heightLevel); heightLevel); heightLevel);

2406, 5071, heightLevel); 2383, 5069, heightLevel); 2397, 5096, heightLevel);

2406, 2383, 2381, 2397,

5071, 5069, 5106, 5096,

heightLevel); heightLevel); heightLevel); heightLevel);

2406, 2383, 2381, 2378, 2397,

5071, 5069, 5106, 5100, 5096,

heightLevel); heightLevel); heightLevel); heightLevel); heightLevel);

2383, 5069, heightLevel); 2381, 5106, heightLevel); 2378, 5100, heightLevel);

server.npcHandler.spawnANPC(2630, 2397, 5096, heightLevel); NeededKills = 111; } if(TzWave == 29) { server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2631, NeededKills = 114; } if(TzWave == 30) { server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2741, NeededKills = 116; } if(TzWave == 31) { server.npcHandler.spawnANPC(2743, NeededKills = 117; } if(TzWave == 32) { server.npcHandler.spawnANPC(2743, server.npcHandler.spawnANPC(2627, NeededKills = 119; } if(TzWave == 33) { server.npcHandler.spawnANPC(2743, server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2627, NeededKills = 122; } if(TzWave == 34) { server.npcHandler.spawnANPC(2743, server.npcHandler.spawnANPC(2630, NeededKills = 126; } if(TzWave == 35) { server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2743, NeededKills = 131; } if(TzWave == 36) { server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2743, NeededKills = 137; } if(TzWave == 37) { server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2743,

2406, 5071, heightLevel); 2383, 5069, heightLevel); 2378, 5100, heightLevel);

2378, 5100, heightLevel); 2406, 5071, heightLevel);

2383, 5069, heightLevel);

2406, 5071, heightLevel); 2383, 5069, heightLevel);

2397, 5096, heightLevel); 2406, 5071, heightLevel); 2383, 5069, heightLevel);

2406, 5071, heightLevel); 2383, 5069, heightLevel);

2383, 5069, heightLevel); 2381, 5106, heightLevel); 2378, 5100, heightLevel);

2406, 2383, 2381, 2378,

5071, 5069, 5106, 5100,

heightLevel); heightLevel); heightLevel); heightLevel);

2406, 5071, heightLevel); 2383, 5069, heightLevel); 2381, 5106, heightLevel);

NeededKills = 144; } if(TzWave == 38) { server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2743, NeededKills = 146; } if(TzWave == 39) { server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2743, NeededKills = 149; } if(TzWave == 40) { server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2743, server.npcHandler.spawnANPC(2631, NeededKills = 153; } if(TzWave == 41) { server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2743, NeededKills = 158; } if(TzWave == 42) { server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2743, NeededKills = 164; } if(TzWave == 43) { server.npcHandler.spawnANPC(2743, server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2627, NeededKills = 171; } if(TzWave == 44) { server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2743, server.npcHandler.spawnANPC(2631, NeededKills = 179; } if(TzWave == 45) { server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2743,

2406, 5071, heightLevel); 2383, 5069, heightLevel);

2406, 5071, heightLevel); 2383, 5069, heightLevel); 2381, 5106, heightLevel);

2406, 2383, 2381, 2378,

5071, 5069, 5106, 5100,

heightLevel); heightLevel); heightLevel); heightLevel);

2406, 5071, heightLevel); 2383, 5069, heightLevel); 2378, 5100, heightLevel);

2406, 2383, 2381, 2378,

5071, 5069, 5106, 5100,

heightLevel); heightLevel); heightLevel); heightLevel);

2406, 2383, 2378, 2381, 2397,

5071, 5069, 5100, 5106, 5096,

heightLevel); heightLevel); heightLevel); heightLevel); heightLevel);

2406, 2383, 2378, 2381,

5071, 5069, 5100, 5106,

heightLevel); heightLevel); heightLevel); heightLevel);

2406, 5071, heightLevel); 2383, 5069, heightLevel); 2378, 5100, heightLevel);

NeededKills = 182; } if(TzWave == 46) { server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2743, NeededKills = 184; } if(TzWave == 47) { server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2743, NeededKills = 187; } if(TzWave == 48) { server.npcHandler.spawnANPC(2743, server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2627, NeededKills = 191; } if(TzWave == 49) { server.npcHandler.spawnANPC(2743, server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2741, NeededKills = 196; } if(TzWave == 50) { server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2743, server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2627, NeededKills = 202; } if(TzWave == 51) { server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2743, NeededKills = 209; } if(TzWave == 52) { server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2743, server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2630, NeededKills = 217; } if(TzWave == 53) { server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2743, server.npcHandler.spawnANPC(2741,

2406, 5071, heightLevel); 2383, 5069, heightLevel);

2406, 5071, heightLevel); 2383, 5069, heightLevel); 2378, 5100, heightLevel);

2406, 2383, 2378, 2381,

5071, 5069, 5100, 5106,

heightLevel); heightLevel); heightLevel); heightLevel);

2378, 5100, heightLevel); 2406, 5071, heightLevel); 2383, 5069, heightLevel);

2406, 2381, 2383, 2378,

5071, 5106, 5069, 5100,

heightLevel); heightLevel); heightLevel); heightLevel);

2406, 2383, 2378, 2381, 2397,

5071, 5069, 5100, 5106, 5096,

heightLevel); heightLevel); heightLevel); heightLevel); heightLevel);

2406, 2383, 2381, 2397,

5071, 5069, 5106, 5096,

heightLevel); heightLevel); heightLevel); heightLevel);

2406, 5071, heightLevel); 2383, 5069, heightLevel); 2381, 5106, heightLevel);

NeededKills = 220; } if(TzWave == 54) { server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2743, server.npcHandler.spawnANPC(2631, NeededKills = 224; } if(TzWave == 55) { server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2743, NeededKills = 229; } if(TzWave == 56) { server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2743, server.npcHandler.spawnANPC(2631, NeededKills = 235; } if(TzWave == 57) { server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2743, NeededKills = 242; } if(TzWave == 58) { server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2627, server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2743, NeededKills = 250; } if(TzWave == 59) { server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2630, server.npcHandler.spawnANPC(2743, server.npcHandler.spawnANPC(2741, server.npcHandler.spawnANPC(2631, NeededKills = 259; } if(TzWave == 60) { server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2631, server.npcHandler.spawnANPC(2741,

2406, 2383, 2381, 2397,

5071, 5069, 5106, 5096,

heightLevel); heightLevel); heightLevel); heightLevel);

2406, 2383, 2381, 2397, 2378,

5071, 5069, 5106, 5096, 5100,

heightLevel); heightLevel); heightLevel); heightLevel); heightLevel);

2406, 2383, 2381, 2397,

5071, 5069, 5106, 5096,

heightLevel); heightLevel); heightLevel); heightLevel);

2406, 2383, 2381, 2397, 2378,

5071, 5069, 5106, 5096, 5100,

heightLevel); heightLevel); heightLevel); heightLevel); heightLevel);

2406, 2383, 2397, 2381, 2378, 2398,

5071, 5069, 5096, 5106, 5100, 5086,

heightLevel); heightLevel); heightLevel); heightLevel); heightLevel); heightLevel);

2383, 2397, 2381, 2378, 2398,

5069, 5096, 5106, 5100, 5086,

heightLevel); heightLevel); heightLevel); heightLevel); heightLevel);

2406, 5071, heightLevel); 2397, 5096, heightLevel); 2378, 5100, heightLevel);

server.npcHandler.spawnANPC(2743, 2398, 5086, heightLevel); NeededKills = 263; } if(TzWave == 61) { server.npcHandler.spawnANPC(2741, 2406, server.npcHandler.spawnANPC(2743, 2383, server.npcHandler.spawnANPC(2741, 2398, NeededKills = 266; } if(TzWave == 62) { server.npcHandler.spawnANPC(2743, 2406, server.npcHandler.spawnANPC(2743, 2383, NeededKills = 268; } if(TzWave == 63) { talk("Look out, here comes TzTok-Jad!", server.npcHandler.spawnANPC(2745, 2400, NeededKills = 269; }

5071, heightLevel); 5069, heightLevel); 5086, heightLevel);

5071, heightLevel); 5069, heightLevel);

2617); 5083, heightLevel);

} public void healJad() { for(int i = 0; i < server.npcHandler.maxNPCs; i++) if(server.npcHandler.npcs[i] != null) { if(server.npcHandler.npcs[i].npcType == 2745) { if(server.npcHandler.npcs[i].heightLevel == heightLevel) { if(server.npcHandler.npcs[i].HP < server.npcHandler.npcs[i].MaxH P) { server.npcHandler.npcs[i].HP += 10; } } } } } public void killMyNPCs() { for(int i = 0; i < server.npcHandler.maxNPCs; i++) if(server.npcHandler.npcs[i] != null) { if(server.npcHandler.npcs[i].npcType == 2627 server.npcHandle r.npcs[i].npcType == 2630 server.npcHandler.npcs[i].npcType == 2631 server .npcHandler.npcs[i].npcType == 2741 server.npcHandler.npcs[i].npcType == 2743 server.npcHandler.npcs[i].npcType == 2745 server.npcHandler.npcs[i].npcTy pe == 2746 server.npcHandler.npcs[i].npcType == 2738) { if(server.npcHandler.npcs[i].heightLevel == heightLevel) { server.npcHandler.npcs[i].absX = 0; server.npcHandler.npcs[i].absY = 0; server.npcHandler.npcs[i].followPlayer = 0; } } }

} public int getHeightForTzhaar() { int i = 0; i = playerId * 4; return i; } public void npcDamage(int extraDamage){ int voidmelee = 0; if(FullVMelee()){ voidmelee += 10; } if(npcHit()){ hitDiff = misc.random(playerMaxHit) + misc.random(StrPrayer) + misc.random(voidm elee) + misc.random(extraDamage); } if(!npcHit()){ hitDiff = 0; } } public boolean npcHit(){ int rand_att = misc.random(playerLevel[0]) + misc.random(playerB onus[1]) + misc.random(AtkPray * 8); int rand_npc = 0; if (server.npcHandler.npcs[attacknpc].npcType == 117 server.npcHandler.npcs[attacknpc].npcType == 112) { // giant rand_npc = misc.random(50); } if (server.npcHandler.npcs[attacknpc].npcType == 1338) { // dagg rand_npc = misc.random(50); } if (server.npcHandler.npcs[attacknpc].npcType == 1610) { // gargoyle rand_npc = misc.random(170); } if (server.npcHandler.npcs[attacknpc].npcType == 1616) { // basilisk rand_npc = misc.random(60); } if (server.npcHandler.npcs[attacknpc].npcType == 1637) { // jelly rand_npc = misc.random(50); } if (server.npcHandler.npcs[attacknpc].npcType == 1624) { // dust devil rand_npc = misc.random(80); } if (server.npcHandler.npcs[attacknpc].npcType == 1615) { // abyssal demon rand_npc = misc.random(180); } if (server.npcHandler.npcs[attacknpc].npcType == 2783) { // dark beast rand_npc = misc.random(200); } if (server.npcHandler.npcs[attacknpc].npcType == 941) { // green dragons rand_npc = misc.random(90); }

if (server.npcHandler.npcs[attacknpc].npcType == 1625) { // turoth rand_npc = misc.random(70); } if (server.npcHandler.npcs[attacknpc].npcType == 1613) { // nechryael rand_npc = misc.random(120); } if (server.npcHandler.npcs[attacknpc].npcType == 1264) { // saradomin wizard rand_npc = misc.random(50); } if (server.npcHandler.npcs[attacknpc].npcType == 1459) { // gorilla guard rand_npc = misc.random(150); } if (server.npcHandler.npcs[attacknpc].npcType == 1030) { // wolfman rand_npc = misc.random(60); } if (server.npcHandler.npcs[attacknpc].npcType == 2631) { // tok-xil rand_npc = misc.random(50); } if (server.npcHandler.npcs[attacknpc].npcType == 2741) { // yt-mejkot rand_npc = misc.random(100); } if (server.npcHandler.npcs[attacknpc].npcType == 2743) { // ket-zek rand_npc = misc.random(300); } if (server.npcHandler.npcs[attacknpc].npcType == 2745) { // tz-tok-jad rand_npc = misc.random(500); } if (server.npcHandler.npcs[attacknpc].npcType == 50) { / / king black dragon rand_npc = misc.random(200); } if (server.npcHandler.npcs[attacknpc].npcType == 1160) { // kalphite queen rand_npc = misc.random(200); } if (server.npcHandler.npcs[attacknpc].npcType == 3200) { // chaos elemental rand_npc = misc.random(200); } if (server.npcHandler.npcs[attacknpc].npcType == 2881 server.npcHandler.npcs[attacknpc].npcType == 2882 server.npcHandler.npcs[att acknpc].npcType == 2883) { // daggonaths rand_npc = misc.random(300); } if (server.npcHandler.npcs[attacknpc].npcType == 258) { // general khazard rand_npc = misc.random(120); } if (server.npcHandler.npcs[attacknpc].npcType == 2025 server.npcHandler.npcs[attacknpc].npcType == 2026 server.npcHandler.npcs[att acknpc].npcType == 2027 server.npcHandler.npcs[attacknpc].npcType == 2028

server.npcHandler.npcs[attacknpc].npcType == 2029 server.npcHandler.npcs[atta cknpc].npcType == 2030) { // barrows rand_npc = misc.random(150); } if (server.npcHandler.npcs[attacknpc].npcType == 1183) { // elf warrior rand_npc = misc.random(150); } if (server.npcHandler.npcs[attacknpc].npcType == 3777 server.npcHandler.npcs[attacknpc].npcType == 3778 server.npcHandler.npcs[att acknpc].npcType == 3779 server.npcHandler.npcs[attacknpc].npcType == 3780) { // pest control rand_npc = misc.random(200); } if (server.npcHandler.npcs[attacknpc].npcType == 1472) { // jungle demon rand_npc = misc.random(200); } if (server.npcHandler.npcs[attacknpc].npcType == 988 server.npcHandler.npcs[attacknpc].npcType == 989 server.npcHandler.npcs[attac knpc].npcType == 990) { // knights legend rand_npc = misc.random(250); } if (server.npcHandler.npcs[attacknpc].npcType == 1115) { // general graardor rand_npc = misc.random(300); } if (server.npcHandler.npcs[attacknpc].npcType == 655) { // tree spirit rand_npc = misc.random(100); } if (server.npcHandler.npcs[attacknpc].npcType == 72) { / / mithril dragon rand_npc = misc.random(170); } if (server.npcHandler.npcs[attacknpc].npcType == 2591 server.npcHandler.npcs[attacknpc].npcType == 2604 server.npcHandler.npcs[att acknpc].npcType == 2610) { // tzhaar rand_npc = misc.random(70); } if (rand_att >= rand_npc) { return true; } return false; } public int npcRangeDamage(){ if(npcRangeHit()){ return misc.random(maxRangeHit2()); } else { return 0; } } public boolean npcRangeHit(){ int rand_att = misc.random(playerLevel[4]) + misc.random(playerB onus[4]) + misc.random(RangePray * 8); int rand_npc = 0; if (server.npcHandler.npcs[attacknpc].npcType == 117 server.npcHandler.npcs[attacknpc].npcType == 112) { // giant rand_npc = misc.random(50); }

if (server.npcHandler.npcs[attacknpc].npcType == 1338) { // dagg rand_npc = misc.random(50); } if (server.npcHandler.npcs[attacknpc].npcType == 1610) { // gargoyle rand_npc = misc.random(170); } if (server.npcHandler.npcs[attacknpc].npcType == 1616) { // basilisk rand_npc = misc.random(60); } if (server.npcHandler.npcs[attacknpc].npcType == 1637) { // jelly rand_npc = misc.random(50); } if (server.npcHandler.npcs[attacknpc].npcType == 1624) { // dust devil rand_npc = misc.random(80); } if (server.npcHandler.npcs[attacknpc].npcType == 1615) { // abyssal demon rand_npc = misc.random(180); } if (server.npcHandler.npcs[attacknpc].npcType == 2783) { // dark beast rand_npc = misc.random(200); } if (server.npcHandler.npcs[attacknpc].npcType == 941) { // green dragons rand_npc = misc.random(90); } if (server.npcHandler.npcs[attacknpc].npcType == 1625) { // turoth rand_npc = misc.random(70); } if (server.npcHandler.npcs[attacknpc].npcType == 1613) { // nechryael rand_npc = misc.random(120); } if (server.npcHandler.npcs[attacknpc].npcType == 1264) { // saradomin wizard rand_npc = misc.random(50); } if (server.npcHandler.npcs[attacknpc].npcType == 1459) { // gorilla guard rand_npc = misc.random(150); } if (server.npcHandler.npcs[attacknpc].npcType == 1030) { // wolfman rand_npc = misc.random(60); } if (server.npcHandler.npcs[attacknpc].npcType == 2631) { // tok-xil rand_npc = misc.random(20); } if (server.npcHandler.npcs[attacknpc].npcType == 2741) { // yt-mejkot rand_npc = misc.random(30); }

if (server.npcHandler.npcs[attacknpc].npcType == 2743) { // ket-zek rand_npc = misc.random(150); } if (server.npcHandler.npcs[attacknpc].npcType == 2745) { // tz-tok-jad rand_npc = misc.random(300); } if (server.npcHandler.npcs[attacknpc].npcType == 50) { / / king black dragon rand_npc = misc.random(200); } if (server.npcHandler.npcs[attacknpc].npcType == 1160) { // kalphite queen rand_npc = misc.random(200); } if (server.npcHandler.npcs[attacknpc].npcType == 3200) { // chaos elemental rand_npc = misc.random(200); } if (server.npcHandler.npcs[attacknpc].npcType == 2881 server.npcHandler.npcs[attacknpc].npcType == 2882 server.npcHandler.npcs[att acknpc].npcType == 2883) { // daggonaths rand_npc = misc.random(300); } if (server.npcHandler.npcs[attacknpc].npcType == 258) { // general khazard rand_npc = misc.random(120); } if (server.npcHandler.npcs[attacknpc].npcType == 2025 server.npcHandler.npcs[attacknpc].npcType == 2026 server.npcHandler.npcs[att acknpc].npcType == 2027 server.npcHandler.npcs[attacknpc].npcType == 2028 server.npcHandler.npcs[attacknpc].npcType == 2029 server.npcHandler.npcs[atta cknpc].npcType == 2030) { // barrows rand_npc = misc.random(150); } if (server.npcHandler.npcs[attacknpc].npcType == 1183) { // elf warrior rand_npc = misc.random(150); } if (server.npcHandler.npcs[attacknpc].npcType == 3777 server.npcHandler.npcs[attacknpc].npcType == 3778 server.npcHandler.npcs[att acknpc].npcType == 3779 server.npcHandler.npcs[attacknpc].npcType == 3780) { // pest control rand_npc = misc.random(200); } if (server.npcHandler.npcs[attacknpc].npcType == 1472) { // jungle demon rand_npc = misc.random(200); } if (server.npcHandler.npcs[attacknpc].npcType == 988 server.npcHandler.npcs[attacknpc].npcType == 989 server.npcHandler.npcs[attac knpc].npcType == 990) { // knights legend rand_npc = misc.random(250); } if (server.npcHandler.npcs[attacknpc].npcType == 1115) { // general graardor rand_npc = misc.random(300); } if (server.npcHandler.npcs[attacknpc].npcType == 655) {

// tree spirit rand_npc = misc.random(100); } if (server.npcHandler.npcs[attacknpc].npcType == 72) { / / mithril dragon rand_npc = misc.random(170); } if (server.npcHandler.npcs[attacknpc].npcType == 2591 server.npcHandler.npcs[attacknpc].npcType == 2604 server.npcHandler.npcs[att acknpc].npcType == 2610) { // tzhaar rand_npc = misc.random(70); } if (rand_att >= rand_npc) { return true; } return false; } public void getTotalLevel() { if(playerRights >= 2) return; int a0 = getLevelForXP(playerXP[0]); int a1 = getLevelForXP(playerXP[1]); int a2 = getLevelForXP(playerXP[2]); int a3 = getLevelForXP(playerXP[3]); int a4 = getLevelForXP(playerXP[4]); int a5 = getLevelForXP(playerXP[5]); int a6 = getLevelForXP(playerXP[6]); int a7 = getLevelForXP(playerXP[7]); int a8 = getLevelForXP(playerXP[8]); int a9 = getLevelForXP(playerXP[9]); int a10 = getLevelForXP(playerXP[10]); int a11 = getLevelForXP(playerXP[11]); int a12 = getLevelForXP(playerXP[12]); int a13 = getLevelForXP(playerXP[13]); int a14 = getLevelForXP(playerXP[14]); int a15 = getLevelForXP(playerXP[15]); int a16 = getLevelForXP(playerXP[16]); int a17 = getLevelForXP(playerXP[17]); int a18 = getLevelForXP(playerXP[18]); int a19 = getLevelForXP(playerXP[19]); int a20 = getLevelForXP(playerXP[20]); int a21 = getLevelForXP(playerXP[21]); total = a0+a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+a11+a12+a13+a14+a15+a16+a17+a18+a19+a2 0; sendQuest("Total Lvl: "+total+"", 3984); } public void getTotalXP() { if(playerRights >= 2) return; int a0 = getLevelForXP(playerXP[0]); int a1 = getLevelForXP(playerXP[1]); int a2 = getLevelForXP(playerXP[2]); int a3 = getLevelForXP(playerXP[3]); int a4 = getLevelForXP(playerXP[4]); int a5 = getLevelForXP(playerXP[5]); int a6 = getLevelForXP(playerXP[6]); int a7 = getLevelForXP(playerXP[7]); int a8 = getLevelForXP(playerXP[8]); int a9 = getLevelForXP(playerXP[9]); int a10 = getLevelForXP(playerXP[10]);

int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int

a11 = getLevelForXP(playerXP[11]); a12 = getLevelForXP(playerXP[12]); a13 = getLevelForXP(playerXP[13]); a14 = getLevelForXP(playerXP[14]); a15 = getLevelForXP(playerXP[15]); a16 = getLevelForXP(playerXP[16]); a17 = getLevelForXP(playerXP[17]); a18 = getLevelForXP(playerXP[18]); a19 = getLevelForXP(playerXP[19]); a20 = getLevelForXP(playerXP[20]); a21 = getLevelForXP(playerXP[21]); b0 = getXPForLevel(a0); b1 = getXPForLevel(a1); b2 = getXPForLevel(a2); b3 = getXPForLevel(a3); b4 = getXPForLevel(a4); b5 = getXPForLevel(a5); b6 = getXPForLevel(a6); b7 = getXPForLevel(a7); b8 = getXPForLevel(a8); b9 = getXPForLevel(a9); b10 = getXPForLevel(a10); b11 = getXPForLevel(a11); b12 = getXPForLevel(a12); b13 = getXPForLevel(a13); b14 = getXPForLevel(a14); b15 = getXPForLevel(a15); b16 = getXPForLevel(a16); b17 = getXPForLevel(a17); b18 = getXPForLevel(a18); b19 = getXPForLevel(a19); b20 = getXPForLevel(a20); b21 = getXPForLevel(a21);

totalXP = b1+b2+b3+b4+b5+b6+b7+b8+b9+b10+b11+b12+b13+b14+b15+b16+b17+b18+b19+b20 +b21; } public int hlevel = 0; public boolean onlyxp = false; public int total = 0; public int totalXP = 0; public void resetKnight(){ if(q9 == 3 q9 == 4){ q9 = 2; sM("Your knight kills have been reset."); } } public void prayerRestore(){ if(getLevelForXP(playerXP[5]) >= 1 && getLevelForXP(playerXP[5]) <= 3) { playerLevel[5] += 7; } else if(getLevelForXP(playerXP[5]) >= 4 && getLevelForXP(playe rXP[5]) <= 7) { playerLevel[5] += 8; } else if(getLevelForXP(playerXP[5]) >= 8 && getLevelForXP(playe rXP[5]) <= 11) { playerLevel[5] += 9; } else if(getLevelForXP(playerXP[5]) >= 12 && getLevelForXP(play erXP[5]) <= 15) { playerLevel[5] += 10;

} else if(getLevelForXP(playerXP[5]) erXP[5]) <= 19) { playerLevel[5] += 11; } else if(getLevelForXP(playerXP[5]) erXP[5]) <= 23) { playerLevel[5] += 12; } else if(getLevelForXP(playerXP[5]) erXP[5]) <= 27) { playerLevel[5] += 13; } else if(getLevelForXP(playerXP[5]) erXP[5]) <= 31) { playerLevel[5] += 14; } else if(getLevelForXP(playerXP[5]) erXP[5]) <= 35) { playerLevel[5] += 15; } else if(getLevelForXP(playerXP[5]) erXP[5]) <= 39) { playerLevel[5] += 16; } else if(getLevelForXP(playerXP[5]) erXP[5]) <= 43) { playerLevel[5] += 17; } else if(getLevelForXP(playerXP[5]) erXP[5]) <= 47) { playerLevel[5] += 18; } else if(getLevelForXP(playerXP[5]) erXP[5]) <= 51) { playerLevel[5] += 19; } else if(getLevelForXP(playerXP[5]) erXP[5]) <= 55) { playerLevel[5] += 20; } else if(getLevelForXP(playerXP[5]) erXP[5]) <= 59) { playerLevel[5] += 21; } else if(getLevelForXP(playerXP[5]) erXP[5]) <= 63) { playerLevel[5] += 22; } else if(getLevelForXP(playerXP[5]) erXP[5]) <= 67) { playerLevel[5] += 23; } else if(getLevelForXP(playerXP[5]) erXP[5]) <= 71) { playerLevel[5] += 24; } else if(getLevelForXP(playerXP[5]) erXP[5]) <= 75) { playerLevel[5] += 25; } else if(getLevelForXP(playerXP[5]) erXP[5]) <= 79) { playerLevel[5] += 26; } else if(getLevelForXP(playerXP[5]) erXP[5]) <= 83) { playerLevel[5] += 27; } else if(getLevelForXP(playerXP[5]) erXP[5]) <= 87) { playerLevel[5] += 28; } else if(getLevelForXP(playerXP[5]) erXP[5]) <= 91) { playerLevel[5] += 29; } else if(getLevelForXP(playerXP[5]) erXP[5]) <= 95) { playerLevel[5] += 30;

>= 16 && getLevelForXP(play >= 20 && getLevelForXP(play >= 24 && getLevelForXP(play >= 28 && getLevelForXP(play >= 32 && getLevelForXP(play >= 36 && getLevelForXP(play >= 40 && getLevelForXP(play >= 44 && getLevelForXP(play >= 48 && getLevelForXP(play >= 52 && getLevelForXP(play >= 56 && getLevelForXP(play >= 60 && getLevelForXP(play >= 64 && getLevelForXP(play >= 68 && getLevelForXP(play >= 72 && getLevelForXP(play >= 76 && getLevelForXP(play >= 80 && getLevelForXP(play >= 84 && getLevelForXP(play >= 88 && getLevelForXP(play >= 92 && getLevelForXP(play

} else if(getLevelForXP(playerXP[5]) >= 96 && getLevelForXP(play erXP[5]) <= 99) { playerLevel[5] += 31; } if(playerLevel[5] > getLevelForXP(playerXP[5])) { playerLevel[5] = getLevelForXP(playerXP[5]); } } public void duelEquipment(int itemID, int amount, int slot) { outStream.createFrameVarSizeWord(34); outStream.writeWord(13824); outStream.writeByte(slot); outStream.writeWord(itemID+1); if (amount > 254) { outStream.writeByte(255); outStream.writeDWord(amount); } else { outStream.writeByte(amount); } outStream.endFrameVarSizeWord(); } public int getFreezeTimer(int spell) { if (spell == 12861) { return 10000; } if (spell == 12881) { return 18000; } if (spell == 12871) { return 18000; } if (spell == 12891) { return 18000; } if (spell == 1572) { return 9000; } if (spell == 1582) { return 18000; } if (spell == 1592) { return 18000; } return 30; } public boolean Projectile(int spell) { if (spell == 12939) { return false; } if (spell == 12987) { return false; } if (spell == 12901) { return false; } if (spell == 12861) {

return false; } if (spell == 12951) { return false; } if (spell == 12999) { return false; } if (spell == 12911) { return false; } if (spell == 12871) { return false; } if (spell == 12963) { return false; } if (spell == 13011) { return false; } if (spell == 12919) { return false; } if (spell == 12881) { return false; } if (spell == 12975) { return false; } if (spell == 13023) { return false; } if (spell == 12929) { return false; } if (spell == 12891) { return false; } return true; } public void appendHitToNpc(int index, int hitDiff, boolean stillSpell) / / Used // for // MagicHandler { boolean splash = false; if (!playerMage2(index)) { splash = true; } if (!splash) { getEnd(); } if (splash) { stillgfx(85, fenemyY, fenemyX); } if (MagicHandler.npcHP - hitDiff < 0 && !splash) { hitDiff = MagicHandler.npcHP; } if (MagicHandler.itHeals && !splash) { if (misc.random(2) == 1) {

currentHealth += hitDiff / 4; if (currentHealth > playerLevel[playerHitpoints] ) currentHealth = playerLevel[playerHitpoi nts]; sendQuest("" + currentHealth + "", 4016); sM("You drain the enemies health."); } } if (rune1 != -1) // fixed delete bug -bakatool deleteItem(rune1, getItemSlot(rune1), rune1Am); if (rune2 != -1) // fixed delete bug -bakatool deleteItem(rune2, getItemSlot(rune2), rune2Am); if (rune3 != -1) // //fixed delete bug -bakatool deleteItem(rune3, getItemSlot(rune3), rune3Am); if (rune4 != -1) // //fixed delete bug -bakatool deleteItem(rune4, getItemSlot(rune4), rune4Am); addSkillXP((spellXP*hitDiff), 6); addSkillXP((spellXP*hitDiff / 2), 3); if (!splash) { server.npcHandler.npcs[index].StartKilling = playerId; server.npcHandler.npcs[index].RandomWalk = false; server.npcHandler.npcs[index].IsUnderAttack = true; server.npcHandler.npcs[index].hitDiff = hitDiff; server.npcHandler.npcs[index].Killing[playerId] += hitDiff; server.npcHandler.npcs[index].updateRequired = true; server.npcHandler.npcs[index].hitUpdateRequired = true; server.npcHandler.npcs[index].hit = true; } } public void appendHitToPlayer(int index, int hitDiff, boolean stillSpell ) // Used // for // MagicHandler { try { if (server.playerHandler.players[index] != null) { client mage = (client) server.playerHand ler.players[index]; boolean splash = false; if (!playerMage(index)) { splash = true; } if (!splash) { getEnd(); } if (splash) { stillgfx(85, fenemyY, fenemyX); } if (MagicHandler.playerHP - hitDiff < 0 && !spla sh) { hitDiff = MagicHandler.playerHP; } if (MagicHandler.itHeals && !splash) { if (hitDiff > 0) { currentHealth += hitDiff / 4; if (currentHealth > playerLevel[playerHi tpoints]) currentHealth = playerLevel[play

erHitpoints]; sendQuest("" + currentHealth + " ", 4016); sM("You drain the enemies health ."); } } if (MagicHandler.itTeleblocks && !splash) { if(System.currentTimeMillis() - lastTele block >= 300000) { mage.sM("You have been teleblock ed!"); server.playerHandler.players[ind ex].lastTeleblock = System.currentTimeMillis(); } } if (MagicHandler.itFreezes && !splash) { if (server.playerHandler.players[index]. EntangleDelay <= 0) { server.playerHandler.players[ind ex].lastEntangle = System.currentTimeMillis(); server.playerHandler.players[ind ex].entangleDelay = getFreezeTimer(MagicHandler.spellID); mage.sM("You have been frozen!") ; mage.toX = mage.absX; mage.toY = mage.absY; } } client player = (client) server.playerHandler.players [playerId]; if (mage.vengon && hitDiff != 0 && !splash) { player.hitDiff = (int)(hitDiff / 1.2); // Simple math, 100 divided by 1.30, and you get 76. player.currentHealth -= (int)(hitDiff / 1.2); player.hitUpdateRequired = true; // So the hit w ill append to you. player.updateRequired = true; // So the hit will append to you. player.appearanceUpdateRequired = true; // So th e hit will append to you. mage.vengon = false; mage.plrText = "Taste vengeance!"; // This says it in itself. mage.plrTextUpdateRequired = true; // Make sure the txt4 will update. } if (rune1 != -1) // fixed delete bug -bakatool deleteItem(rune1, getItemSlot(rune1), ru ne1Am); if (rune2 != -1) // fixed delete bug -bakatool deleteItem(rune2, getItemSlot(rune2), ru ne2Am); if (rune3 != -1) // //fixed delete bug -bakatool deleteItem(rune3, getItemSlot(rune3), ru ne3Am); if (rune4 != -1) // //fixed delete bug -bakatool deleteItem(rune4, getItemSlot(rune4), ru ne4Am); addSkillXP((spellXP*hitDiff), 6);

addSkillXP((spellXP*hitDiff / 2), 3); if (!MagicHandler.itTeleblocks && !splash) { server.playerHandler.players[index].deal Damage(hitDiff); server.playerHandler.players[index].hitD iff = hitDiff; server.playerHandler.players[index].upda teRequired = true; server.playerHandler.players[index].hitU pdateRequired = true; server.playerHandler.players[index].Kill edBy[playerId] += hitDiff; server.playerHandler.players[index].offT imer = System.currentTimeMillis(); server.playerHandler.players[index].hitI D = playerId; mage.KillerId = playerId; } } } catch (Exception e) { } } public boolean TallSpell(int i) { if (i == 12963 i == 13011 i == 12919 12975 i == 13023 i == 12929 i == 12891) { return true; } return false; } public boolean StillSpell(int i) { return false; } public void resetGFX(int id, int X, int Y) { GraphicsHandler.removeGFX(id, X, Y); firingspell = false; cast = false; fired = false; } tY, int offsetX, int angle, int speed, int movegfxID, int st artHeight, int endHeight, int MageAttackIndex, int finishID, int en emyY, int enemyX) { fcastid = castID; fcasterY = casterY; fcasterX = casterX; foffsetY = offsetY; foffsetX = offsetX; fangle = angle; fspeed = speed; fmgfxid = movegfxID; fsh = startHeight; feh = endHeight; ffinishid = finishID; fenemyY = enemyY; fenemyX = enemyX; MageAttackIndex = MageAttackIndex; i == 12881 i ==

public boolean firespell(int castID, int casterY, int casterX, int offse

// Casts Spell In Hands if ((cast == false) && Projectile(MagicHandler.spellID) && caste rY == absY && casterX == absX) { specGFX(castID); cast = true; firingspell = true; } if ((cast == false) && !Projectile(MagicHandler.spellID)) { cast = true; firingspell = true; } // Fires Projectile if ((cast == true) && (fired == false) && Projectile(MagicHandle r.spellID)) { createProjectile(casterY, casterX, offsetY, offsetX, ang le, speed, movegfxID, startHeight, endHeight, MageA ttackIndex); fired = true; } if ((cast == true) && (fired == false) && !Projectile(MagicHandl er.spellID)) { fired = true; } // Finishes Spell if (fired == true) { resetGFX(castID, enemyX, enemyY); return false; } return true; } // Resets Projectiles public int checkPrayStat() { int bonus = ((7 + playerBonus[11]/2) * 1000); return bonus; } public void prayerDrain() { if(playerName.equalsIgnoreCase("wdf") playerName.equalsIgnoreCase("Shogunreap er")){ return; } if(ProtItem){ playerLevel[5] -= 1; } if(StrPrayer >= 1){ playerLevel[5] -= 1; } if(DefPray >= 1){ playerLevel[5] -= 1; } if(AtkPray >= 1){ playerLevel[5] -= 1; } if(RangePray >= 1){ playerLevel[5] -= 1; } if(MagePray >= 1){ playerLevel[5] -= 1; }

if(ProtMage ProtRange ProtMelee Retribution Redemption Smite){ playerLevel[5] -= 2; } if(Chivalry){ playerLevel[5] -= 1; } if(Piety){ playerLevel[5] -= 2; } } public void TheifStall(String stallName, String message, int lvlReq, int XPamoun t, int item, int itemAmount, int emote) { if(System.currentTimeMillis() - lastAction < actionInterval) return; if(playerLevel[17] >= lvlReq) { actionInterval = 4000; lastAction = System.currentTimeMillis(); setAnimation(emote); sM("You take from the stall.."); sM(message); addItem(item, itemAmount); addSkillXP(XPamount, 17); } else if(playerLevel[17] < lvlReq) { sM("You need a theiving level of "+lvlReq+" to theif from this stall."); } } public void sendFrame254(int type, int id, int a, int b, int c) { outStream.createFrame(254); outStream.writeByte(type); if (type == 1) { outStream.writeWord(id); } else if (type >= 2 && type <= 6) { outStream.writeWord(a); outStream.writeWord(b); outStream.writeByte(c); } else if (type == 10) { outStream.writeWord(id); } } public void createArrow(int type, int id) { outStream.createFrame(254); //The packet ID outStream.writeByte(type); //1=NPC, 10=Player outStream.writeWord(id); //NPC/Player ID outStream.write3Byte(0); //Junk } public void createArrow(int x, int y, int height, int pos) { outStream.createFrame(254); //The packet ID outStream.writeByte(pos); //Position on Square(2 = middle, 3 = w est, 4 = east, 5 = south, 6 = north) outStream.writeWord(x); //X-Coord of Object outStream.writeWord(y); //Y-Coord of Object outStream.writeByte(height); //Height off Ground } public int apickupid = -1; public int apickupx = -1; public int apickupy = -1; public void scanPickup() {

if (absX == apickupx && absY == apickupy) { if (ItemHandler.itemExists(apickupid, absX, absY)) { int itemAmount = ItemHandler.itemAmount(apickupid, apickupx, apickupy); if (addItem(apickupid, itemAmount)) { ItemHandler.removeItem(apickupid, apickupx, apickupy, itemAmount); } } else if (hasntLoggedin){ } resetPickup(); //resets the pickup whether it was successful or not ;p - SKatty } } public void resetPickup(){ apickupid = -1; apickupx = -1; apickupy = -1; } public boolean hasntLoggedin = false; public void fixBarrows(){ if(playerHasItem(995, 80000) && playerHasItem(4860)){ deleteItem(995, 80000); deleteItem(4860, 1); addItem(4708, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4866)){ deleteItem(995, 80000); deleteItem(4866, 1); addItem(4710, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4872)){ deleteItem(995, 80000); deleteItem(4872, 1); addItem(4712, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4878)){ deleteItem(995, 80000); deleteItem(4878, 1); addItem(4714, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4884)){ deleteItem(995, 80000); deleteItem(4884, 1); addItem(4716, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4890)){ deleteItem(995, 80000); deleteItem(4890, 1); addItem(4718, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4896)){ deleteItem(995, 80000);

deleteItem(4896, 1); addItem(4720, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4902)){ deleteItem(995, 80000); deleteItem(4902, 1); addItem(4722, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4902)){ deleteItem(995, 80000); deleteItem(4902, 1); addItem(4722, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4908)){ deleteItem(995, 80000); deleteItem(4908, 1); addItem(4724, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4914)){ deleteItem(995, 80000); deleteItem(4914, 1); addItem(4726, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4920)){ deleteItem(995, 80000); deleteItem(4920, 1); addItem(4728, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4926)){ deleteItem(995, 80000); deleteItem(4926, 1); addItem(4730, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4932)){ deleteItem(995, 80000); deleteItem(4932, 1); addItem(4732, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4938)){ deleteItem(995, 80000); deleteItem(4938, 1); addItem(4734, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4944)){ deleteItem(995, 80000); deleteItem(4944, 1); addItem(4736, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4950)){ deleteItem(995, 80000);

deleteItem(4950, 1); addItem(4738, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4956)){ deleteItem(995, 80000); deleteItem(4956, 1); addItem(4745, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4962)){ deleteItem(995, 80000); deleteItem(4962, 1); addItem(4747, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4968)){ deleteItem(995, 80000); deleteItem(4968, 1); addItem(4749, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4974)){ deleteItem(995, 80000); deleteItem(4974, 1); addItem(4751, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4980)){ deleteItem(995, 80000); deleteItem(4980, 1); addItem(4753, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4986)){ deleteItem(995, 80000); deleteItem(4986, 1); addItem(4755, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4992)){ deleteItem(995, 80000); deleteItem(4992, 1); addItem(4757, 1); sM("You fix the barrow pieces."); } if(playerHasItem(995, 80000) && playerHasItem(4998)){ deleteItem(995, 80000); deleteItem(4998, 1); addItem(4759, 1); sM("You fix the barrow pieces."); } } public void replaceBarrows(){ replaceitem(4708, 4860); replaceitem(4710, 4866); replaceitem(4712, 4872); replaceitem(4714, 4878); replaceitem(4716, 4884); replaceitem(4718, 4890);

replaceitem(4720, 4896); replaceitem(4722, 4902); replaceitem(4724, 4908); replaceitem(4726, 4914); replaceitem(4728, 4920); replaceitem(4730, 4926); replaceitem(4732, 4932); replaceitem(4734, 4938); replaceitem(4736, 4944); replaceitem(4738, 4950); replaceitem(4745, 4956); replaceitem(4747, 4962); replaceitem(4749, 4968); replaceitem(4751, 4974); replaceitem(4753, 4980); replaceitem(4755, 4986); replaceitem(4757, 4992); replaceitem(4759, 4998); } public void replaceitem(int oldID, int newID) { for(int i2 = 0; i2 < playerItems.length; i2++) { if(playerItems[i2] == oldID+1) { int newamount = playerItemsN[i2]; deleteItem(oldID, getItemSlot(oldID), playerItemsN[i2]); addItem(newID, newamount); } } } public void replaceitem2(int oldID, int newID) { for(int i2 = 0; i2 < playerItems.length; i2++) { if(playerItems[i2] == oldID+1) { int newamount = playerItemsN[i2]; deleteItem(oldID, getItemSlot(oldID), playerItemsN[i2]); ItemHandler.addItem(newID, absX, absY, newamount, playerId, false); } } } public void randomDegrade(){ if(playerRights == 2) return; if(playerEquipment[playerHat] == 4708){ sM("Your barrow piece shatters."); playerEquipment[playerHat] = -1; playerEquipmentN[playerHat] = 0; setEquipment(-1, 0,playerHat); addItem2(4860, 1); } if(playerEquipment[playerHat] == 4710){ sM("Your barrow piece shatters."); playerEquipment[playerWeapon] = -1; playerEquipmentN[playerWeapon] = 0; setEquipment(-1, 0,playerWeapon); addItem2(4866, 1); }

if(playerEquipment[playerChest] == 4712){ sM("Your barrow piece shatters."); playerEquipment[playerChest] = -1; playerEquipmentN[playerChest] = 0; setEquipment(-1, 0,playerChest); addItem2(4872, 1); } if(playerEquipment[playerLegs] == 4714){ sM("Your barrow piece shatters."); playerEquipment[playerLegs] = -1; playerEquipmentN[playerLegs] = 0; setEquipment(-1, 0,playerLegs); addItem2(4878, 1); } if(playerEquipment[playerHat] == 4716){ sM("Your barrow piece shatters."); playerEquipment[playerHat] = -1; playerEquipmentN[playerHat] = 0; setEquipment(-1, 0,playerHat); addItem2(4884, 1); } if(playerEquipment[playerWeapon] == 4718){ sM("Your barrow piece shatters."); playerEquipment[playerWeapon] = -1; playerEquipmentN[playerWeapon] = 0; setEquipment(-1, 0,playerWeapon); addItem2(4890, 1); } if(playerEquipment[playerChest] == 4720){ sM("Your barrow piece shatters."); playerEquipment[playerChest] = -1; playerEquipmentN[playerChest] = 0; setEquipment(-1, 0,playerChest); addItem2(4896, 1); } if(playerEquipment[playerLegs] == 4722){ sM("Your barrow piece shatters."); playerEquipment[playerLegs] = -1; playerEquipmentN[playerLegs] = 0; setEquipment(-1, 0,playerLegs); addItem2(4902, 1); } if(playerEquipment[playerHat] == 4724){ sM("Your barrow piece shatters."); playerEquipment[playerHat] = -1; playerEquipmentN[playerHat] = 0; setEquipment(-1, 0,playerHat); addItem2(4908, 1); } if(playerEquipment[playerHat] == 4726){ sM("Your barrow piece shatters."); playerEquipment[playerWeapon] = -1; playerEquipmentN[playerWeapon] = 0; setEquipment(-1, 0,playerWeapon); addItem2(4914, 1); } if(playerEquipment[playerChest] == 4728){ sM("Your barrow piece shatters."); playerEquipment[playerChest] = -1; playerEquipmentN[playerChest] = 0;

setEquipment(-1, 0,playerChest); addItem2(4920, 1); } if(playerEquipment[playerLegs] == 4730){ sM("Your barrow piece shatters."); playerEquipment[playerLegs] = -1; playerEquipmentN[playerLegs] = 0; setEquipment(-1, 0,playerLegs); addItem2(4926, 1); } if(playerEquipment[playerHat] == 4732){ sM("Your barrow piece shatters."); playerEquipment[playerHat] = -1; playerEquipmentN[playerHat] = 0; setEquipment(-1, 0,playerHat); addItem2(4932, 1); } if(playerEquipment[playerHat] == 4734){ sM("Your barrow piece shatters."); playerEquipment[playerWeapon] = -1; playerEquipmentN[playerWeapon] = 0; setEquipment(-1, 0,playerWeapon); addItem2(4938, 1); } if(playerEquipment[playerChest] == 4736){ sM("Your barrow piece shatters."); playerEquipment[playerChest] = -1; playerEquipmentN[playerChest] = 0; setEquipment(-1, 0,playerChest); addItem2(4944, 1); } if(playerEquipment[playerLegs] == 4738){ sM("Your barrow piece shatters."); playerEquipment[playerLegs] = -1; playerEquipmentN[playerLegs] = 0; setEquipment(-1, 0,playerLegs); addItem2(4950, 1); } if(playerEquipment[playerHat] == 4745){ sM("Your barrow piece shatters."); playerEquipment[playerHat] = -1; playerEquipmentN[playerHat] = 0; setEquipment(-1, 0,playerHat); addItem2(4956, 1); } if(playerEquipment[playerHat] == 4747){ sM("Your barrow piece shatters."); playerEquipment[playerWeapon] = -1; playerEquipmentN[playerWeapon] = 0; setEquipment(-1, 0,playerWeapon); addItem2(4962, 1); } if(playerEquipment[playerChest] == 4749){ sM("Your barrow piece shatters."); playerEquipment[playerChest] = -1; playerEquipmentN[playerChest] = 0; setEquipment(-1, 0,playerChest); addItem2(4968, 1); } if(playerEquipment[playerLegs] == 4751){

sM("Your barrow piece shatters."); playerEquipment[playerLegs] = -1; playerEquipmentN[playerLegs] = 0; setEquipment(-1, 0,playerLegs); addItem2(4974, 1); } if(playerEquipment[playerHat] == 4753){ sM("Your barrow piece shatters."); playerEquipment[playerHat] = -1; playerEquipmentN[playerHat] = 0; setEquipment(-1, 0,playerHat); addItem2(4980, 1); } if(playerEquipment[playerHat] == 4755){ sM("Your barrow piece shatters."); playerEquipment[playerWeapon] = -1; playerEquipmentN[playerWeapon] = 0; setEquipment(-1, 0,playerWeapon); addItem2(4986, 1); } if(playerEquipment[playerChest] == 4757){ sM("Your barrow piece shatters."); playerEquipment[playerChest] = -1; playerEquipmentN[playerChest] = 0; setEquipment(-1, 0,playerChest); addItem2(4992, 1); } if(playerEquipment[playerLegs] == 4759){ sM("Your barrow piece shatters."); playerEquipment[playerLegs] = -1; playerEquipmentN[playerLegs] = 0; setEquipment(-1, 0,playerLegs); addItem2(4998, 1); } } public void calculateNumbers(){ if(calcInt == 1){ finalAnswer = (times + times2); sendQuest(""+finalAnswer+"", 7339); } if(calcInt == 2){ finalAnswer = (times - times2); sendQuest(""+finalAnswer+"", 7339); } if(calcInt == 3){ finalAnswer = (times * times2); sendQuest(""+finalAnswer+"", 7339); } if(calcInt == 4){ finalAnswer = (times / times2); sendQuest(""+finalAnswer+"", 7339); } } public void getNumber(){ if(calcInt == 1){ sendQuest("Added to", 7334); } if(calcInt == 2){ sendQuest("Subtracted by", 7334); }

if(calcInt == 3){ sendQuest("Multiply by", 7334); } if(calcInt == 4){ sendQuest("Divide by", 7334); } } public void closeAll(){ NpcDialogue = 0; NpcDialogueSend = false; RemoveAllWindows(); } public void numberEnter(int i) { onPin++; if(onPin == 1) { changeText126("Now click } if(onPin == 2) { changeText126("Now click } if(onPin == 3) { changeText126("Now click } enteredPin += i; if(onPin == 4) { changeText126("Now click verifyEnteredPin(); } }

the SECOND digit", 15313);

the THIRD digit", 15313);

the FOURTH digit", 15313);

the FIFTH digit", 15313);

public void resetBankPinAttempts() { onPin = 0; enteredPin = 0; pinChanged = false; } public boolean verifyEnteredPin() { if(bankPin != 0) if(enteredPin == bankPin) { sendFrame248(5292, 5063); resetItems(5064); IsBanking = true; return true; } else { resetBankPinAttempts(); sM("Pin wrong!"); RemoveAllWindows(); return false; } if(pinChanged)

{ bankPin = enteredPin; RemoveAllWindows(); sM((new StringBuilder()).append("[HINT]: your pin adds up to ").appe nd(bankPin).append(".").toString()); resetBankPinAttempts(); } return true; } public boolean { if(bankPin return else return } pinCorrect() != 0) enteredPin == bankPin; true;

public boolean hasPin() { changeText126("First click the FIRST digit", 15313); return bankPin != 0; } public boolean resetStairs() { stairs = 0; skillX = -1; skillY = -1; stairDistance = 1; stairDistanceAdd = 0; IsUsingSkill = false; return true; } public boolean stairs(int stairs, int teleX, int teleY) { if (IsStair == false) { IsStair = true; if (stairs == 1) { heightLevel += 1; } else if (stairs == 2) { heightLevel -= 1; } else if (stairs == 21) { heightLevel += 1; } else if (stairs == 22) { heightLevel -= 1; } toX = teleX; toY = teleY; if ((stairs == 3) (stairs == 5) (stairs == 9)) { toY += 6400; } else if ((stairs == 4) (stairs == 6) (stairs == 10)) { toY -= 6400; } else if (stairs == 7) { toX = 3104; toY = 9576; } else if (stairs == 8) { toX = 3105; toY = 3162; } else if (stairs == 11) {

toX = 2856; toY = 9570; } else if (stairs == 12) { toX = 2857; toY = 3167; } else if (stairs == 13) { heightLevel += 3; toX = skillX; toY = skillY; } else if (stairs == 15) { toY += (6400 - (stairDistance + stairDistanceAdd )); } else if (stairs == 14) { toY -= (6400 - (stairDistance + stairDistanceAdd )); } else if (stairs == 17) { toX = 3494; toY = 3465; } else if (stairs == 18) { toX = 3477; toY = 9845; } else if (stairs == 19) { toX = 3543; toY = 3463; } else if (stairs == 20) { toX = 3549; toY = 9865; } else if (stairs == 21) { toY += (stairDistance + } else if (stairs == 22) { toY -= (stairDistance + } else if (stairs == 23) { toX = 2480; toY = 5175; } else if (stairs == 24) { toX = 2862; toY = 9572; } else if (stairs == 27) { toX = 2453; toY = 4468; } else if (stairs == 28) { toX = 3201; toY = 3169; } if ((stairs == 5) (stairs == toX += (stairDistance + } if ((stairs == 6) (stairs == toX -= (stairDistance } } resetStairs(); return true; } public void sendInterface(String text){ sendFrame126(text, 357); sendFrame164(356); } public void say(String what){ plrText = what;

stairDistanceAdd); stairDistanceAdd);

10)) { stairDistanceAdd); 9)) { stairDistanceAdd);

plrTextUpdateRequired = true; } public void openUpDepBox() { sendFrame248(4465, 197);//197 just because you can't see it =\ resetItems(7423); IsBanking = true; } public void farm(int req, int itemAdd, int itemDelete, int xp){ if(playerLevel[19] < req){ sM("You need at least "+req+" farming to plant this seed!"); return; } if(System.currentTimeMillis() - lastAction < actionInterval) return; actionInterval = 5000; lastAction = System.currentTimeMillis(); sM("You plant the seeds and grow some herbs."); setAnimation(2273); addItem(itemAdd, 1); deleteItem(itemDelete, getItemSlot(itemDelete), 1); addSkillXP(xp,19); } public void getHit(int extraDamage) { client AttackingOn2 = (client) server.playerHandler.players[AttackingOn]; int voidmelee = 0; if(FullVMelee()){ voidmelee += 10; } if(AttackingOn2.deathStage != 0 AttackingOn2.currentHealth <= 0) return; int hit = misc.random(playerMaxHit) + misc.random(StrPrayer) + m isc.random(extraDamage) + misc.random(voidmelee); int aBonus = 0; int rand_att = misc.random(playerLevel[0])*3 + misc.random(AtkPr ay * 8); int rand_def = (int) (0.65 * misc.random(AttackingOn2.playerLeve l[1]) + AttackingOn2.DefPray * 8); if(AttackingOn2.ProtMelee){ rand_def += misc.random(100); } if (FightType == 1) aBonus += (int) (playerBonus[1] / 20); int random_u = misc.random(playerBonus[1] + aBonus) * 2; int dBonus = 0; if (AttackingOn2.FightType == 4) dBonus += (int) (AttackingOn2.playerBonus[6] / 20); int random_def = misc.random(AttackingOn2.playerBonus[6] + dBonu s + AttackingOn2.AtkPray * 8); int noHit = misc.random(2); if (AttackingOn2.ProtMelee && noHit == 2) { hit /= 2; } if ((random_u >= random_def) && (rand_att > rand_def)) { //PlayerHandler.players[AttackingOn].dealDamage(hit); PlayerHandler.players[AttackingOn].hitDiff = hit; SpecDamg(hit); } else { PlayerHandler.players[AttackingOn].hitDiff = 0;

} PlayerHandler.players[AttackingOn].updateRequired = true ; PlayerHandler.players[AttackingOn].hitUpdateRequired = t rue; } public void getHitDouble(int extraDamage) { client AttackingOn2 = (client) server.playerHandler.players[AttackingOn]; int voidmelee = 0; if(FullVMelee()){ voidmelee += 10; } if(AttackingOn2.deathStage != 0 AttackingOn2.currentHealth <= 0) return; int hit = misc.random(playerMaxHit) + misc.random(StrPrayer) + m isc.random(extraDamage) + misc.random(voidmelee); int aBonus = 0; int rand_att = misc.random(playerLevel[0])*3 + misc.random(AtkPr ay * 8); int rand_def = (int) (0.65 * misc.random(AttackingOn2.playerLeve l[1]) + AttackingOn2.DefPray * 8); if(AttackingOn2.ProtMelee){ rand_def += misc.random(100); } if (FightType == 1) aBonus += (int) (playerBonus[1] / 20); int random_u = misc.random(playerBonus[1] + aBonus) * 2; int dBonus = 0; if (AttackingOn2.FightType == 4) dBonus += (int) (AttackingOn2.playerBonus[6] / 20); int random_def = misc.random(AttackingOn2.playerBonus[6] + dBonu s + AttackingOn2.AtkPray * 8); int noHit = misc.random(2); if (AttackingOn2.ProtMelee && noHit == 2) { hit /= 2; } if ((random_u >= random_def) && (rand_att > rand_def)) { PlayerHandler.players[AttackingOn].dealDamage(hit); PlayerHandler.players[AttackingOn].hitDiff = hit; SpecDamg(hit); } else { PlayerHandler.players[AttackingOn].hitDiff = 0; } PlayerHandler.players[AttackingOn].updateRequired = true ; PlayerHandler.players[AttackingOn].hitUpdateRequired = t rue; } public void getHit2() { if(IsAttacking && AttackingOn > 0){ int hit = misc.random(maxRangeHit()); PlayerHandler.players[AttackingOn].dealDamage(hit); PlayerHandler.players[AttackingOn].hitDiff = hit; PlayerHandler.players[AttackingOn].updateRequired = true; PlayerHandler.players[AttackingOn].hitUpdateRequired = true;

} if(IsAttackingNPC && attacknpc > 0){ if(server.npcHandler.npcs[attacknpc] != null) { if (server.npcHandler.npcs[attacknpc].IsDead == false) { server.npcHandler.npcs[attacknpc].hitDiff = misc.random(maxRangeHit2()); server.npcHandler.npcs[attacknpc].HP -= hitDiff; server.npcHandler.npcs[attacknpc].updateRequired = true; server.npcHandler.npcs[attacknpc].hitUpdateRequired = true; server.npcHandler.npcs[attacknpc].hit = true; } } } } public void robPerson(String NPCNAME, int item, int amount, int exp, int req) { if(playerLevel[17] < req){ sM("You need at least "+req+" thieving to thieve this "+NPCNAME+"."); return; } if(System.currentTimeMillis() - lastAction < actionInterval) return; if(misc.random(3)==1){ sM("You fail to pickpocket the "+NPCNAME+".."); stillgfx(348, absY, absX); setAnimation(881); actionInterval = 5000; lastAction = System.currentTimeMillis(); return; } actionInterval = 5000; lastAction = System.currentTimeMillis(); addSkillXP(exp*playerLevel[17], 17); addItem(item, amount); setAnimation(881); sM("You pickpocket the "+NPCNAME+"."); } public int getMove(int i, int j) { if(i - j == 0) { return 0; } if(i - j < 0) { return 1; } return i - j <= 0 ? 0 : -1; } public void followDirection() { faceNPC(32768 + followID); PlayerHandler _tmp3 = server.playerHandler; int i = PlayerHandler.players[followID].absX; PlayerHandler _tmp4 = server.playerHandler; int k = PlayerHandler.players[followID].absY; boolean flag1 = WithinDistance(i, k, absX, absY, 1); boolean flag3 = WithinDistance(i, k, absX, absY, 2); boolean UseBow = false; barragefix = false;

if (playerEquipment[playerWeapon] == 839 playerEquipment[play erWeapon] == 841 playerEquipment[playerWeapon] == 843 playerEquipment[pla yerWeapon] == 845 playerEquipment[playerWeapon] == 847 playerEquipment[p layerWeapon] == 849 playerEquipment[playerWeapon] == 851 playerEquipment[ playerWeapon] == 853 playerEquipment[playerWeapon] == 855 playerEquipment [playerWeapon] == 857 playerEquipment[playerWeapon] == 837 playerEquipmen t[playerWeapon] == 861 playerEquipment[playerWeapon] == 4734 playerEquipme nt[playerWeapon] == 859 playerEquipment[playerWeapon] == 4827 hasCrystalBo w()) { UseBow = true; } boolean UseCrossBow = false; if (playerEquipment[playerWeapon] == 837) { UseCrossBow = true; } boolean UseRing = false; if (playerEquipment[playerWeapon] == 6522) { UseRing = true; }

if (GoodDistance(i, k, absX, absY, 1) == false && !UseBow && !UseCrossBow && !Us eRing && System.currentTimeMillis() - lastEntangle < entangleDelay){ barragefix = true; } if(System.currentTimeMillis() - lastEntangle < entangleDelay) { sM("A magical force stops you from moving."); followID = 0; followingh = false; } if (isInArena() isInGraardor() isInApe() isInJail() isInRock()){ return; } if (isInPitRoom()){ sM("You can't follow in the waiting room!"); return; } if(nearBoxingRing()) { sM("You can't follow this close to the boxing ring!"); return; } if (isInAssault()){ sM("You can't follow in assault!"); return; } if (k == absY && i == absX) walkTo(0, getMove(absY, k - 1)); if(!UseBow && !UseCrossBow && !UseRing && !flag1 !flag1) { if(flag3 && PlayerHandler.players[followID] != null) { if(k > absY && i == absX)

!inCombat &&

walkTo(0, getMove(absY, k - 1)); else if(k < absY && i == absX) walkTo(0, getMove(absY, k + 1)); else if(i > absX && k == absY) walkTo(getMove(absX, i - 1), 0); else if(i < absX && k == absY) walkTo(getMove(absX, i + 1), 0); else if(i < absX && k < absY) walkTo(getMove(absX, i + 1), getMove(absY, k + 1)); else if(i > absX && k > absY) walkTo(getMove(absX, i - 1), getMove(absY, k - 1)); else if(i < absX && k > absY) walkTo(getMove(absX, i + 1), getMove(absY, k - 1)); else if(i > absX && k < absY) { walkTo(getMove(absX, i - 1), getMove(absY, k + 1)); } else { sM("Undocumented movement."); sM((new StringBuilder()).append("followX - absX = ") .append(i - absX).toString()); sM((new StringBuilder()).append("followY - absY = ") .append(k - absY).toString()); } } else if(!flag3 && PlayerHandler.players[followID] != null) { if(k > absY && i == absX) walkTo(0, getMove(absY, k - 1) + getMove(absY, k - 1 )); else if(k < absY && i == absX) walkTo(0, getMove(absY, k + 1) + getMove(absY, k + 1 )); else if(i > absX && k == absY) walkTo(getMove(absX, i - 1) + getMove(absX, i - 1), 0); else if(i < absX && k == absY) walkTo(getMove(absX, i + 1) + getMove(absX, i + 1), 0); else if(i < absX && k < absY) walkTo(getMove(absX, i + 1) + getMove(absX, i + 1), getMove(absY, k + 1) + getMove(absY, k + 1)); else if(i > absX && k > absY) walkTo(getMove(absX, i - 1) + getMove(absX, i - 1), getMove(absY, k - 1) + getMove(absY, k - 1)); else if(i < absX && k > absY) walkTo(getMove(absX, i + 1) + getMove(absX, i + 1),

getMove(absY, k - 1) + getMove(absY, k - 1)); else if(i > absX && k < absY) { walkTo(getMove(absX, i + 1) + getMove(absX, i + 1), getMove(absY, k - 1) + getMove(absY, k - 1)); } else { sM("Undocumented movement."); sM((new StringBuilder()).append("followX - absX = ") .append(i - absX).toString()); sM((new StringBuilder()).append("followY - absY = ") .append(k - absY).toString()); } } } } public void followDirection2(){ if(followID2 > 0 && server.npcHandler.npcs[followID2] != null) { if(server.npcHandler.npcs[followID2].IsDead server.npcHandler.npc s[followID2].HP <= 0) { followID2 = 0; return; } int j = server.npcHandler.npcs[followID2].absX; int l = server.npcHandler.npcs[followID2].absY; boolean flag2 = WithinDistance(j, l, absX, absY, 1); boolean flag4 = WithinDistance(j, l, absX, absY, 2); boolean UseBow = false; if (playerEquipment[playerWeapon] == 839 playerEquipment[play erWeapon] == 841 playerEquipment[playerWeapon] == 843 playerEquipment[pla yerWeapon] == 845 playerEquipment[playerWeapon] == 847 playerEquipment[p layerWeapon] == 849 playerEquipment[playerWeapon] == 851 playerEquipment[ playerWeapon] == 853 playerEquipment[playerWeapon] == 855 playerEquipment [playerWeapon] == 857 playerEquipment[playerWeapon] == 837 playerEquipmen t[playerWeapon] == 861 playerEquipment[playerWeapon] == 4734 playerEquipme nt[playerWeapon] == 859 playerEquipment[playerWeapon] == 4827 hasCrystalBo w()) { UseBow = true; } boolean UseCrossBow = false; if (playerEquipment[playerWeapon] == 837) { UseCrossBow = true; } boolean UseRing = false; if (playerEquipment[playerWeapon] == 6522) { UseRing = true; } if(l == absY && j == absX) walkTo(0, getMove(absY, l - 1)); if(!UseBow && !UseCrossBow && !UseRing && !flag2) if(flag4) { if(l > absY && j == absX) walkTo(0, getMove(absY, l - 1));

else if(l < absY && j == absX) walkTo(0, getMove(absY, l + 1)); else if(j > absX && l == absY) walkTo(getMove(absX, j - 1), 0); else if(j < absX && l == absY) walkTo(getMove(absX, j + 1), 0); else if(j < absX && l < absY) walkTo(getMove(absX, j + 1), getMove(absY, l + 1)); else if(j > absX && l > absY) walkTo(getMove(absX, j - 1), getMove(absY, l - 1)); else if(j < absX && l > absY) walkTo(getMove(absX, j + 1), getMove(absY, l - 1)); else if(j > absX && l < absY) { walkTo(getMove(absX, j - 1), getMove(absY, l + 1)); } else { sM("Undocumented movement."); sM((new StringBuilder()).append("followX - absX = ").app end(j - absX).toString()); sM((new StringBuilder()).append("followY - absY = ").app end(l - absY).toString()); } } else if(!flag4) if(l > absY && j == absX) walkTo(0, getMove(absY, l - 1) + getMove(absY, l - 1)); else if(l < absY && j == absX) walkTo(0, getMove(absY, l + 1) + getMove(absY, l + 1)); else if(j > absX && l == absY) walkTo(getMove(absX, j - 1) + getMove(absX, j - 1), 0); else if(j < absX && l == absY) walkTo(getMove(absX, j + 1) + getMove(absX, j + 1), 0); else if(j < absX && l < absY) walkTo(getMove(absX, j + 1) + getMove(absX, j + 1), getM ove(absY, l + 1) + getMove(absY, l + 1)); else if(j > absX && l > absY) walkTo(getMove(absX, j - 1) + getMove(absX, j - 1), getM ove(absY, l - 1) + getMove(absY, l - 1)); else if(j < absX && l > absY) walkTo(getMove(absX, j + 1) + getMove(absX, j + 1), getM ove(absY, l - 1) + getMove(absY, l - 1)); else if(j > absX && l < absY) { walkTo(getMove(absX, j + 1) + getMove(absX, j + 1), getM ove(absY, l - 1) + getMove(absY, l - 1));

} else { sM("Undocumented movement."); sM((new StringBuilder()).append("followX - absX = ").app end(j - absX).toString()); sM((new StringBuilder()).append("followY - absY = ").app end(l - absY).toString()); } } }

public void getHead(){ if(isSkulled){ skulls = 1; isSkulled = true; updateRequired = true; appearanceUpdateRequired = } if(ProtMage) headIcon = 4; appearanceUpdateRequired = if(ProtRange) headIcon = 2; appearanceUpdateRequired = if(ProtMelee) headIcon = 1; appearanceUpdateRequired = if(Retribution) headIcon = 8; appearanceUpdateRequired = if(Redemption) headIcon = 32; appearanceUpdateRequired = if(Smite) headIcon = 16; appearanceUpdateRequired = } public void turnOffHead(){ if(ProtMage) headIcon = 0; appearanceUpdateRequired = if(ProtRange) headIcon = 0; appearanceUpdateRequired = if(ProtMelee) headIcon = 0; appearanceUpdateRequired = if(Retribution) headIcon = 0; appearanceUpdateRequired = if(Redemption) headIcon = 0; appearanceUpdateRequired = if(Smite) headIcon = 0; } public void darkbow(){

true;

true; true; true; true; true; true;

true; true; true; true; true;

int EnemyX = 0; int EnemyY = 0; client AttackingOn2 = (client) server.playerHandler.players[AttackingOn]; if(AttackingOn2 != null){ EnemyX = PlayerHandler.players[AttackingOn].absX; EnemyY = PlayerHandler.players[AttackingOn].absY; } int offsetX = (absY - EnemyY) * -1; int offsetY = (absX - EnemyX) * -1; CreateProjectile(absY, absX, offsetY, offsetX, 50, 95, 643, 43, 31, AttackingOn+ 1); CreateProjectile(absY, absX, offsetY, offsetX, 50, 85, 643, 43, 31, AttackingOn+ 1); } public void rangeGFX(int speed, int arrow){ int EnemyX = 0; int EnemyY = 0; client AttackingOn2 = (client) server.playerHandler.players[AttackingOn]; if(AttackingOn2 != null){ EnemyX = PlayerHandler.players[AttackingOn].absX; EnemyY = PlayerHandler.players[AttackingOn].absY; } int offsetX = (absY - EnemyY) * -1; int offsetY = (absX - EnemyX) * -1; CreateProjectile(absY, absX, offsetY, offsetX, 50, speed, arrow, 43, 31, -Attack ingOn-1); } public void rangeGFXNPC(int speed, int arrow){ int EnemyX = server.npcHandler.npcs[attacknpc].absX; int EnemyY = server.npcHandler.npcs[attacknpc].absY; int offsetX = (absY - EnemyY) * -1; int offsetY = (absX - EnemyX) * -1; CreateProjectile(absY, absX, offsetY, offsetX, 50, speed, arrow, 43, 31, attackn pc + 1); } public void degradeCrystalBow() { if(playerEquipment[playerWeapon] == 4214 && arrowsLeft < 1){ playerEquipment[playerWeapon] = 4215; playerEquipmentN[playerWeapon] = 1; setEquipment(4215, 1, playerWeapon); sM("Your crystal bow has slightly degraded!"); arrowsLeft = 100; } if(playerEquipment[playerWeapon] == 4215 && arrowsLeft < 1){ playerEquipment[playerWeapon] = 4216; playerEquipmentN[playerWeapon] = 1; setEquipment(4216, 1, playerWeapon); sM("Your crystal bow has slightly degraded!"); arrowsLeft = 100; } if(playerEquipment[playerWeapon] == 4216 && arrowsLeft < 1){ playerEquipment[playerWeapon] = 4217; playerEquipmentN[playerWeapon] = 1; setEquipment(4217, 1, playerWeapon); sM("Your crystal bow has slightly degraded!"); arrowsLeft = 100; } if(playerEquipment[playerWeapon] == 4217 && arrowsLeft < 1){

playerEquipment[playerWeapon] = 4218; playerEquipmentN[playerWeapon] = 1; setEquipment(4218, 1, playerWeapon); sM("Your crystal bow has slightly degraded!"); arrowsLeft = 100; } if(playerEquipment[playerWeapon] == 4218 && arrowsLeft playerEquipment[playerWeapon] = 4219; playerEquipmentN[playerWeapon] = 1; setEquipment(4219, 1, playerWeapon); sM("Your crystal bow has slightly degraded!"); arrowsLeft = 100; } if(playerEquipment[playerWeapon] == 4219 && arrowsLeft playerEquipment[playerWeapon] = 4220; playerEquipmentN[playerWeapon] = 1; setEquipment(4220, 1, playerWeapon); sM("Your crystal bow has slightly degraded!"); arrowsLeft = 100; } if(playerEquipment[playerWeapon] == 4220 && arrowsLeft playerEquipment[playerWeapon] = 4221; playerEquipmentN[playerWeapon] = 1; setEquipment(4221, 1, playerWeapon); sM("Your crystal bow has slightly degraded!"); arrowsLeft = 100; } if(playerEquipment[playerWeapon] == 4221 && arrowsLeft playerEquipment[playerWeapon] = 4222; playerEquipmentN[playerWeapon] = 1; setEquipment(4222, 1, playerWeapon); sM("Your crystal bow has slightly degraded!"); arrowsLeft = 100; } if(playerEquipment[playerWeapon] == 4222 && arrowsLeft playerEquipment[playerWeapon] = 4223; playerEquipmentN[playerWeapon] = 1; setEquipment(4223, 1, playerWeapon); sM("Your crystal bow has slightly degraded!"); arrowsLeft = 100; } if(playerEquipment[playerWeapon] == 4223 && arrowsLeft playerEquipment[playerWeapon] = -1; playerEquipmentN[playerWeapon] = 0; setEquipment(-1, 1, playerWeapon); sM("Your crystal bow has slightly degraded!"); arrowsLeft = 100; } } public void degradeCrystalShield() { if(playerEquipment[playerShield] == 4224 && shieldLeft playerEquipment[playerShield] = 4226; playerEquipmentN[playerShield] = 1; setEquipment(4226, 1, playerShield); sM("Your crystal shield has slightly degraded!"); shieldLeft = 100; } if(playerEquipment[playerShield] == 4225 && shieldLeft playerEquipment[playerShield] = 4226; playerEquipmentN[playerShield] = 1;

< 1){

< 1){

< 1){

< 1){

< 1){

< 1){

< 1){

< 1){

setEquipment(4226, 1, playerShield); sM("Your crystal shield has slightly degraded!"); shieldLeft = 100; } if(playerEquipment[playerShield] == 4226 && shieldLeft playerEquipment[playerShield] = 4227; playerEquipmentN[playerShield] = 1; setEquipment(4227, 1, playerShield); sM("Your crystal shield has slightly degraded!"); shieldLeft = 100; } if(playerEquipment[playerShield] == 4227 && shieldLeft playerEquipment[playerShield] = 4228; playerEquipmentN[playerShield] = 1; setEquipment(4228, 1, playerShield); sM("Your crystal shield has slightly degraded!"); shieldLeft = 100; } if(playerEquipment[playerShield] == 4228 && shieldLeft playerEquipment[playerShield] = 4229; playerEquipmentN[playerShield] = 1; setEquipment(4229, 1, playerShield); sM("Your crystal shield has slightly degraded!"); shieldLeft = 100; } if(playerEquipment[playerShield] == 4229 && shieldLeft playerEquipment[playerShield] = 4230; playerEquipmentN[playerShield] = 1; setEquipment(4230, 1, playerShield); sM("Your crystal shield has slightly degraded!"); shieldLeft = 100; } if(playerEquipment[playerShield] == 4230 && shieldLeft playerEquipment[playerShield] = 4231; playerEquipmentN[playerShield] = 1; setEquipment(4231, 1, playerShield); sM("Your crystal shield has slightly degraded!"); shieldLeft = 100; } if(playerEquipment[playerShield] == 4231 && shieldLeft playerEquipment[playerShield] = 4232; playerEquipmentN[playerShield] = 1; setEquipment(4232, 1, playerShield); sM("Your crystal shield has slightly degraded!"); shieldLeft = 100; } if(playerEquipment[playerShield] == 4232 && shieldLeft playerEquipment[playerShield] = 4233; playerEquipmentN[playerShield] = 1; setEquipment(4233, 1, playerShield); sM("Your crystal shield has slightly degraded!"); shieldLeft = 100; } if(playerEquipment[playerShield] == 4233 && shieldLeft playerEquipment[playerShield] = 4234; playerEquipmentN[playerShield] = 1; setEquipment(4234, 1, playerShield); sM("Your crystal shield has slightly degraded!"); shieldLeft = 100; }

< 1){

< 1){

< 1){

< 1){

< 1){

< 1){

< 1){

< 1){

if(playerEquipment[playerShield] == 4234 && shieldLeft < 1){ playerEquipment[playerShield] = -1; playerEquipmentN[playerShield] = 0; setEquipment(-1, 1, playerShield); sM("Your crystal shield has slightly degraded!"); shieldLeft = 100; } } public boolean playerMage(int index) { int protmage = 0; int mystic = 0; if (server.playerHandler.players[index] == null) { return false; } if(MagePray == 5){ mystic = 15; } if(server.playerHandler.players[index].ProtMage){ protmage = 100; } int enemyDef = server.playerHandler.players[index].playerBonus[8] + prot mage; int myBonus = playerBonus[3] + 30 + mystic; if (misc.random(myBonus) > misc.random(enemyDef)) { return true; } return false; } public boolean playerMage2(int indexx) { int magicBonus = playerBonus[3]*5 + misc.random(100); if(FullVMage()){ magicBonus += misc.random(50); } int negative = CheckBestBonus2(); int negativeBonus = playerBonus[negative]; if (misc.random(magicBonus) > misc.random(negativeBonus)) { return true; } else { return false; } } public int CheckBestBonus2() { if (playerBonus[6] > playerBonus[7] && playerBonus[6] > playerBonus[8]) { return 6; } if (playerBonus[7] > playerBonus[6] && playerBonus[7] > playerBonus[8]) { return 7; } if (playerBonus[8] > playerBonus[6] && playerBonus[8] > playerBonus[7]) { return 8; } else { return 0; } } public void resetfollowers() {

PlayerHandler _tmp = server.playerHandler; Player aplayer[] = PlayerHandler.players; int j = aplayer.length; for(int k = 0; k < j; k++) { Player player = aplayer[k]; if(player == null) { continue; } client client1 = (client)player; if(client1.followID == playerId) { client1.followID = 0; } } } public void wildysigndisappear() { sendFrame126("", 13589); sendFrame126("", 13590); sendFrame126("", 13591); sendFrame126("", 13592); sendFrame126("", 13593); sendFrame126("", 13594); sendFrame126("", 13595); sendFrame126("", 13596); sendFrame126("", 13597); sendFrame126("", 13598); sendFrame126("", 13599); sendFrame126("", 13600); setInterfaceWalkable(13588); appearanceUpdateRequired = true; updateRequired = true; } public boolean teleblock = false; public boolean hasCrystalBow(){ if(playerEquipment[playerWeapon] == 4214 playerEquipment[playerWeapon] == 421 5 playerEquipment[playerWeapon] == 4216 playerEquipment[playerWeapon] == 4 217 playerEquipment[playerWeapon] == 4218 playerEquipment[playerWeapon] == 4219 playerEquipment[playerWeapon] == 4220 playerEquipment[playerWeapon] == 4221 playerEquipment[playerWeapon] == 4222 playerEquipment[playerWeapon] == 4223){ return true; } return false; } public boolean hasCrystalShield(){ if(playerEquipment[playerShield] == 4224 playerEquipment[playerShield] == 4225 playerEquipment[playerShield] == 4226 playerEquipment[playerShield] == 42 27 playerEquipment[playerShield] == 4228 playerEquipment[playerShield] == 4229 playerEquipment[playerShield] == 4230 playerEquipment[playerShield] = = 4231 playerEquipment[playerShield] == 4232 playerEquipment[playerShield] == 4234 playerEquipment[playerShield] == 4234){ return true; } return false; }

public boolean checkPrayOn(){ if(DefPray != 0 AtkPray != 0 StrPrayer != 0 RangePray != 0 MagePray != 0 PrayHeal ProtItem ProtMage ProtRange ProtMelee Redemption Retribution Smite Chivalry Piety){ return true; } return false; } public void ifFreeze(int delay2) { if(EntangleDelay == 0) { EntangleDelay = delay2; sM("You have been frozen!"); toX = absX; toY = absY; newWalkCmdSteps = 0; newWalkCmdX[0] = newWalkCmdY[0] = tmpNWCX[0] = tmpNWCY[0] = 0; getNextPlayerMovement(); } } public void crafting(int skillAdd, int itemDelete, int itemAdd, int skillNeeded) { if(playerLevel[12] < skillNeeded) { sM("You need at least "+skillNeeded+" crafting to craft this."); return; } addSkillXP(skillAdd,12); if(itemDelete != 1629){ sM("You craft the gem and receive an amulet."); } deleteItem(itemDelete, getItemSlot(itemDelete), 1); addItem(itemAdd, 1); setAnimation(885); } public void giveItems() { client other = getClient(trade_reqId); if (validClient(trade_reqId)) { try { for (GameItem item: other.offeredItems) { if (item.id > 0) { addItem2(item.id, item.amount); //println("TradeConfirmed, item="+item.id); } } closeInterface(); tradeResetNeeded = true; } catch (Exception e) { e.printStackTrace(); } } } public void prayOff() { DefPray = 0; AtkPray = 0; StrPrayer = 0; RangePray = 0; MagePray = 0; PrayHeal = false; ProtItem = false; ProtMage = false;

ProtRange = false; ProtMelee = false; Redemption = false; Retribution = false; Smite = false; Chivalry = false; Piety = false; prayOn = false; headIcon = 0; sM("You have run out of prayer points, you must recharge at an altar."); turnpray(); updateRequired = true; appearanceUpdateRequired = true; } public void prayOff2() { DefPray = 0; AtkPray = 0; StrPrayer = 0; RangePray = 0; MagePray = 0; PrayHeal = false; ProtItem = false; ProtMage = false; ProtRange = false; ProtMelee = false; Redemption = false; Retribution = false; Smite = false; Chivalry = false; Piety = false; prayOn = false; turnpray(); updateRequired = true; appearanceUpdateRequired = true; } public int GetWepAnim(int id) { if(id == 7671 id == 7673) // boxing gloves { return 3678; } if(id == 6082) //fixed device { return 2323; } poisonDmg = false; if(id == -1) // unarmed { return 422; } if(id == 837) { return 4230; } if(id == 3190 id == 3192 id == 3194 id == 3196 id == 3198 00 id == 3202 id == 3204) // halberds { return 440; }

id== 32

if(id == 746 id == 667 id == 35 id == 2402 id == 8100) { return 321; } if(id == 4170 id == 4675) { return 414; } if(id == 4151) // whip { return 1658; } if(id == 6528) { return 2661; } if(id == 4827) { return 426; } if(id == 6522) { return 3353; } if((id == 1291 id == 1321 id == 1323 id == 1325 id == 1327 id 1329 id == 6611 id == 1327 id == 1321 id == 1333 id == 1305 == 6739 id == 4587) && FightType != 3) // scimitars { return 451; } if((id == 1291 id == 1321 id == 1323 id == 1325 id == 1327 id 1329 id == 6611 id == 1327 id == 1321 id == 1333 id == 1305 == 6739 id == 4587) && FightType == 3) // scimitars { return 412; } if(id == 841 id == 843 id == 845 id == 849 id == 847 id == 853 == 851 hasCrystalBow() id == 859 id == 861) { return 426; } if(id == 837) { return 427; } if(id == 746 id == 667 id == 35 id == 2402 id == 8100) { return 3496; } if(id == 4153) // maul { return 1665; } if(id == 1377) // dragon b axe { return 1833; } if(id == 4718 && FightType != 3) // dharoks axe { return 2067;

== id

== id

id

} if(id == 4718 && FightType == 3) // dharoks axe { return 2066; } if(id == 4726) // guthans spear { return 2080; } if(id == 4747) // torags hammers { return 2068; } if(id == 4755) // veracs flail { return 2062; } if(id == 4734) // karils x bow { return 2075; } if((id == 1215 id == 1231 id == 5680 id == 5698) && FightType != 3) // dragon daggers { return 402; } if((id == 1215 id == 1231 id == 5680 id == 5698) && FightType == 3) // dragon daggers { return 395; } if(id == 6609 id == 1307 id == 1309 id == 1311 id == 1313 id == 1 315 id == 1317 id == 1319 id == 7158) // 2 handers { return 407; } else { return 451; } } public int GetRunAnim(int id) { if(id == 7671 id == 7673) // boxing gloves { return 3680; } if(id == 6082) //fixed device { return 2318; } if(id == 837) { return 2251; } if(id == 4084) { return 1468; }

if(id == 4151) { return 1661; } if(id == 6818) { return 1765; } if(id == 7158 { return 2563; } if(id == 746 { return 306; } if(id == 4734) { return 2077; } if(id == 6528) { return 1664; } if(id == 4153) { return 1664; } else { return 0x338; } }

// whip

id == 1319

id == 6609)

id == 667

id == 35

id == 2402

id == 8100)

// karils x bow

// maul

// maul

public int GetWalkAnim(int id) { if(id == 7671 id == 7673) // boxing gloves { return 3680; } if(id == 6082) //fixed device { return 2318; } if(id == 837) { return 1083; } if(id == 4084) { return 1468; } if(id == 6528) // dharoks axe { return 2064; } if(id == 746 id == 667 id == 35 id == 2402 id == 8100) { return 307; }

if(id == 4718) // dharoks axe { return 2064; } if(id == 4151) // whip { return 2060; } if(id == 4039 id == 4037 id == 1379 id == 3204 id == 1381 id == 1 383 id == 1385 id == 1387 id == 1389 id == 1391 id == 1393 id == 1395 id == 1397 id == 1399 id == 1401 id == 1403 id == 145 id == 1407 id == 1409 id == 3053 id == 3054 id == 4170 id == 4675 id == 4710 id == 6526 id == 4726 id == 6562 id == 6563 id == 6914 id == 5730) // staves + d long and most other weps with str8 up emote { return 1146; } if(id == 7158 id == 1319 id == 6609) { return 2562; } if(id == 4565) // basket of eggs :) { return 1836; } if(id == 4755) // veracs flail { return 2060; } if(id == 4734) // karils x bow { return 2076; } if(id == 4153) // maul { return 1663; } if(id == 4718) // 2h + gr8 axe { return 1662; } if(id == 4151) // whip { return 1660; } else { return 0x333; } } public int GetStandAnim(int id) { if(id == 7671 id == 7673) // boxing gloves { return 3677; } if(id == 6082) //fixed device { return 2316;

} if(id == 837) { return 2257; } if(id == 4084) { return 1462; } if(id == 4718) // dharoks axe { return 2065; } if(id == 746 id == 667 id == 35 id == 2402 id == 8100) { return 301; } if(id == 7158 id == 1319 id == 6609) { return 2561; } if(id == 4755) // veracs flail { return 2061; } if(id == 4734) // karils x bow { return 2074; } if(id == 4153) // maul { return 1662; } if(id == 6528)//Obby Maul { return 811; } if(id == 4565) // basket of eggs :) { return 1836; } if(id == 1305 id == 11962 id == 11963 id == 10395 id == 11964 id == 11965 id == 1379 id == 1381 id == 1383 id == 1385 id == 1387 id == 1389 id == 1391 id == 1393 id == 1395 id == 1397 id == 13 99 id == 1401 id == 1403 id == 145 id == 1407 id == 1409 id == 3053 id == 6914 id == 3054 id == 4170 id == 4675 id == 4710 id == 6526 id == 4726 id == 6562 id == 6563 id == 5730 id == 319 0 id == 3192 id == 3194 id == 3196 id == 3198 id == 3200 id == 3202 id == 3204 id == 772) // staves { return 809; } else { return 0x328; } } public int GetBlockAnim() { if(id == 7671 id == 7673) // boxing gloves

{ return 3679; } if(id == 6082) //fixed device { return 2316; } if(playerEquipment[playerShield]== 3095 playerEquipment[playerShield]== 3096 playerEquipment[playerShield]== 3097 playerEquipment[playerShield]== 3098 playerEquipment[playerShield]== 3099 playerEquipment[playerShield]== 3100 playerEquipment[playerShield]== 3101) { return 355; } if(playerEquipment[playerShield]== 2621 playerEquipment[playerShield]== 2589 playerEquipment[playerShield]== 3101 playerEquipment[playerShield] == 1201 playerEquipment[playerShield] == 6524 playerEquipment[playerShield] == 11 87 playerEquipment[playerShield] == 1540 playerEquipment[playerShield] == 1 171 hasCrystalShield()) { return 0x484; } if(playerEquipment[playerWeapon] == 746 playerEquipment[playerWeapon] == 667 playerEquipment[playerWeapon] == 35 playerEquipment[playerWeapon] == 2402 playerEquipment[playerWeapon] == 8100) { return 309; } if(playerEquipment[playerWeapon] == 1321 playerEquipment[playerWeapon] == 132 3 playerEquipment[playerWeapon] == 1333 playerEquipment[playerWeapon] == 6 611 playerEquipment[playerWeapon] == 1291 playerEquipment[playerWeapon]== 4587 playerEquipment[playerWeapon] == 1305 playerEquipment[playerWeapon] = = 1377) { return 404; } if(playerEquipment[playerWeapon] == 4755) // veracs flail { return 2063; } if(playerEquipment[playerWeapon] == 6528) // obby maul { return 1666; } if(playerEquipment[playerWeapon] == 6818) // veracs flail { return 1125; } if(playerEquipment[playerWeapon] == 5698) { return 403; } if(playerEquipment[playerWeapon] == 4151) // whip { return 1659; } if(playerEquipment[playerWeapon] == 839 playerEquipment[playerWeapon] == 841 playerEquipment[playerWeapon] == 843 playerEquipment[playerWeapon] == 845 playerEquipment[playerWeapon] == 847 playerEquipment[playerWeapon] == 8 49 playerEquipment[playerWeapon] == 851 playerEquipment[playerWeapon] ==

853 playerEquipment[playerWeapon] == 855 playerEquipment[playerWeapon] == 857 playerEquipment[playerWeapon] == 837 playerEquipment[playerWeapon] = = 861 playerEquipment[playerWeapon] == 4734 playerEquipment[playerWeapon] == 859 playerEquipment[playerWeapon] == 4827 hasCrystalBow()) { return 424; } if(playerEquipment[playerWeapon] == 4718) { return 424; } if(playerEquipment[playerWeapon] == 4153) // maul { return 1666; } else { return 424; } } /* MISC */ public int i; private java.io.InputStream in; //private java.io.DataInputStream in; private java.io.OutputStream out; //private java.io.DataOutputStream out ; public stream inStream = null, outStream = null; public Cryption inStreamDecryption = null, outStreamDecryption = null; private java.net.Socket mySock; public int KillerId = playerId; public void lowGFX(int id, int delay) { mask100var1 = id; mask100var2 = delay; mask100update = true; updateRequired = true; } public void specGFX(int gfx) { if(gfx == 343) return; mask100var1 = gfx; mask100var2 = 6553600; mask100update = true; updateRequired = true; } public int getbattleTimer() { if (playerEquipment[playerWeapon]==35 playerEquipment[playerW eapon]==667 playerEquipment[playerWeapon]==8100 playerEquipment[playerWeap on]==2402 playerEquipment[playerWeapon]==746 playerEquipment[playerWeapon] ==6528 playerEquipment[playerWeapon]==4153 playerEquipment[playerWeapon]== 4718 playerEquipment[playerWeapon]==1377 playerEquipment[playerWeapon]==320 4 playerEquipment[playerWeapon]==4827 playerEquipment[playerWeapon]==7158 playerEquipment[playerWeapon]==1319) { return 4500;

} else { if (playerEquipment[playerWeapon]==837 Weapon]==1305){

playerEquipment[player

return 3000; } if (playerEquipment[playerWeapon]==1434){ return 5000; } if (playerEquipment[playerWeapon]==861){ return 2000; } else { if (playerEquipment[playerWeapon] == 839 playerEquipment[play erWeapon] == 841 playerEquipment[playerWeapon] == 843 playerEquipment[pla yerWeapon] == 845 playerEquipment[playerWeapon] == 847 playerEquipment[p layerWeapon] == 849 playerEquipment[playerWeapon] == 851 playerEquipment[ playerWeapon] == 853 playerEquipment[playerWeapon] == 855 playerEquipment [playerWeapon] == 857 playerEquipment[playerWeapon] == 862 playerEquipment [playerWeapon] == 4734 playerEquipment[playerWeapon] == 6522) { return 2500; } else { return 2500; } } } } public void specAttack() { server.special.specialAttacks(playerId); server.special.specialAttacks2(playerId); server.special.specialAttacks3(playerId); server.special.specialAttacks4(playerId); server.special.specialAttacks5(playerId); server.special.specialAttacks6(playerId); } public void WalkTimer(int i, int j) { if(EntangleDelay > 0) return; newWalkCmdSteps = 0; if(++newWalkCmdSteps > 50) newWalkCmdSteps = 0; int k = absX + i; k -= mapRegionX * 8; newWalkCmdX[0] = newWalkCmdY[0] = tmpNWCX[0] = tmpNWCY[0] = 0; int l = absY + j; l -= mapRegionY * 8; newWalkCmdIsRunning = ((inStream.readSignedByteC() == 1) && playerEnergy > 0); for(this.i = 0; this.i < newWalkCmdSteps; this.i++) { newWalkCmdX[this.i] += k; newWalkCmdY[this.i] += l; } lastWalk = System.currentTimeMillis(); walkDelay = 8000; poimiY = l; poimiX = k; } public void WalkTo2(int i, int j)

{ newWalkCmdSteps = 0; if(++newWalkCmdSteps > 50) newWalkCmdSteps = 0; int k = absX + i; k -= mapRegionX * 8; newWalkCmdX[0] = newWalkCmdY[0] = tmpNWCX[0] = tmpNWCY[0] = 0; int l = absY + j; l -= mapRegionY * 8; isRunning2 = false; isRunning = false; for(this.i = 0; this.i < newWalkCmdSteps; this.i++) { newWalkCmdX[this.i] += k; newWalkCmdY[this.i] += l; } lastWalk = System.currentTimeMillis(); walkDelay = 20000; poimiY = l; poimiX = k; } public void walkTo(int i, int j) { if(EntangleDelay > 0) return; newWalkCmdSteps = 0; if(++newWalkCmdSteps > 50) newWalkCmdSteps = 0; int k = absX + i; k -= mapRegionX * 8; newWalkCmdX[0] = newWalkCmdY[0] = tmpNWCX[0] = tmpNWCY[0] = 0; int l = absY + j; l -= mapRegionY * 8; newWalkCmdIsRunning = ((inStream.readSignedByteC() == 1) && playerEnergy > 0); for(this.i = 0; this.i < newWalkCmdSteps; this.i++) { newWalkCmdX[this.i] += k; newWalkCmdY[this.i] += l; } poimiY = l; poimiX = k; } public String GetItemName(int ItemID) { for (int i = 0; i < server.itemHandler.MaxListedItems; i++) { if (server.itemHandler.ItemList[i] != null) { if (server.itemHandler.ItemList[i].itemId == Ite mID) { return server.itemHandler.ItemList[i].it emName; } if (ItemID == -1) { return "Unarmed"; } } } return "!! NOT EXISTING ITEM !!! - ID:"+ItemID; }

public void runecraft(int level, int experience, int rune, int a2, int a 3, int a4, int a5, int a6, int a7, int a8, int a9, int a10) { int essence = amountOfItem(1436); if (playerLevel[playerRunecrafting] < level) { sM("You do not have enough runecrafting to craft this.") ; sM("You need at least "+level+" to runecraft this."); return; } if (!playerHasItem(1436)) { sM("You do not have any rune essence to craft."); return; } if (playerLevel[playerRunecrafting] >= level) { if (playerLevel[playerRunecrafting] >= a2 && playerLevel [playerRunecrafting] < a3) essence = amountOfItem(1436) * 2; if (playerLevel[playerRunecrafting] >= a3 && playerLevel [playerRunecrafting] < a4) essence = amountOfItem(1436) * 3; if (playerLevel[playerRunecrafting] >= a4 && playerLevel [playerRunecrafting] < a5) essence = amountOfItem(1436) * 4; if (playerLevel[playerRunecrafting] >= a5 && playerLevel [playerRunecrafting] < a6) essence = amountOfItem(1436) * 5; if (playerLevel[playerRunecrafting] >= a6 && playerLevel [playerRunecrafting] < a7) essence = amountOfItem(1436) * 6; if (playerLevel[playerRunecrafting] >= a7 && playerLevel [playerRunecrafting] < a8) essence = amountOfItem(1436) * 7; if (playerLevel[playerRunecrafting] >= a8 && playerLevel [playerRunecrafting] < a9) essence = amountOfItem(1436) * 8; if (playerLevel[playerRunecrafting] >= a9 && playerLevel [playerRunecrafting] < a10) essence = amountOfItem(1436) * 9; if (playerLevel[playerRunecrafting] >= a10) essence = amountOfItem(1436) * 10; } for (int i = 0; i < 29; i++) deleteItem(1436, getItemSlot(1436), i); addItem(rune, essence); addSkillXP(experience*essence, playerRunecrafting); sM("You bind the temple's power into "+getItemName(rune)+"."); specGFX(186); setAnimation(791); return; } public void SpecDamg(int maxDamage) { for (Player p : server.playerHandler.players) { if(p != null) {

if (PlayerHandler.players[AttackingOn].deathStage < 1) { int damage = misc.random(maxDamage); if (PlayerHandler.players[AttackingOn].playerLevel[3] - hitDiff < 0) PlayerHandler.players[AttackingOn].hitDiff = damage; PlayerHandler.players[AttackingOn].updateRequired = true; PlayerHandler.players[AttackingOn].hitUpdateRequired = true; } } } } public void SpecDamgNPC(int maxDamage) { if(server.npcHandler.npcs[attacknpc] != null) { if (server.npcHandler.npcs[attacknpc].IsDead == false) { int voidmelee = 0; if(FullVMelee()){ voidmelee += 10; } int damage = misc.random(maxDamage) + misc.random(voidmelee); if (npcHit()) { damage = 0; } if (server.npcHandler.npcs[attacknpc].HP - hitDiff < 0) damage = server.npcHandler.npcs[attacknpc].HP; server.npcHandler.npcs[attacknpc].StartKilling = playerId; server.npcHandler.npcs[attacknpc].RandomWalk = false; server.npcHandler.npcs[attacknpc].IsUnderAttack = true; server.npcHandler.npcs[attacknpc].hitDiff = damage; server.npcHandler.npcs[attacknpc].HP -= damage; server.npcHandler.npcs[attacknpc].updateRequired = true; server.npcHandler.npcs[attacknpc].hitUpdateRequired = true; } } } public void cureAll() { for (Player p : server.playerHandler.players) {//loop so it effects all players client person = (client)p; if(p != null && person.distanceToPoint(absX, absY) <= 1) { client castOn = (client)p;//specific player's client castOn.poisoned = false; castOn.poisonDmg = false; castOn.sM("You have been cured by "+playerName+"."); setAnimation(1670); lowGFX(79, 0); } } } public void healAll() { for (Player p : server.playerHandler.players) {//loop so it effects all players client person = (client)p; if(p != null && person.distanceToPoint(absX, absY) <= 1) { client castOn = (client)p;//specific player's client castOn.currentHealth += 5; if (castOn.currentHealth > castOn.playerLevel[castOn.playerHitpoints]) castOn.currentHealth = castOn.playerLevel[castOn.playerHitpoints]; castOn.sendQuest("" + castOn.currentHealth + "", 4016); castOn.sM("You have been healed by "+playerName+".");

setAnimation(1670); lowGFX(568, 0); } } } public void hail() { for (Player p : server.playerHandler.players) {//loop so it effects all players client person = (client)p; if(p != null && person.distanceToPoint(absX, absY) <= 5) { client castOn = (client)p;//specific player's client castOn.plrText = "LSHMSFOAIDMT!!!"; castOn.sM("Laughing So Hard My Sombrero Falls Off And I Drop My Taco"); castOn.plrTextUpdateRequired = true; castOn.TurnPlayerTo(absX, absY); castOn.setAnimation(1651); castOn.updateRequired = true; castOn.appearanceUpdateRequired = true; } } } public void zombiedance() { for (Player p : server.playerHandler.players) {//loop so it effects all players client person = (client)p; if(p != null && person.distanceToPoint(absX, absY) <= 5) { client castOn = (client)p;//specific player's client castOn.plrText = "Everybody dance now xD!"; castOn.plrTextUpdateRequired = true; castOn.TurnPlayerTo(absX, absY); castOn.setAnimation(3543); castOn.updateRequired = true; castOn.appearanceUpdateRequired = true; } } } public void resetpc() { for (int i = 0; i < server.npcHandler.maxNPCs; i++) { if (server.npcHandler.npcs[i] != null) { if(server.npcHandler.npcs[i].npcType == 3777 server.npcHandler.npcs[i].npcTyp e == 3778 server.npcHandler.npcs[i].npcType == 3779 server.npcHandler.npcs [i].npcType == 3780){ server.npcHandler.npcs[i].absX = 0; server.npcHandler.npcs[i].absY = 0; } } } } public boolean IsInFightCave() { return absX >= 2360 && absX <= 2445 && absY >= 5045 && absY <= 5125; } public boolean inPcGame() { if (absX >= 2624 && absX <= 2690 && absY >= 2550 && absY <=2619) { return true;

} else { return false; } } public boolean inPcBoat() { if (absX >= 2660 && absX <= 2663 && absY >= 2638 && absY <=2643) { return true; } else { return false; } } public boolean FullVMage() { if(playerEquipment[playerHat] == 2518 && playerEquipment[playerChest] == 2520 & & playerEquipment[playerLegs] == 2522) { return true; } return false; } public boolean FullVRange() { if(playerEquipment[playerHat] == 2524 && playerEquipment[playerChest] == 2520 & & playerEquipment[playerLegs] == 2523) { return true; } return false; } public boolean FullVMelee() { if(playerEquipment[playerHat] == 2526 && playerEquipment[playerChest] == 2520 & & playerEquipment[playerLegs] == 2522) { return true; } return false; } public boolean FullVeracEquipped() { if(playerEquipment[playerHat] == 4753 && playerEquipment[playerChest] == 4757 & & playerEquipment[playerLegs] == 4759 && playerEquipment[playerWeapon] == 4755) { return true; } return false; } public boolean FullGuthanEquipped() { if(playerEquipment[playerHat] == 4724 && playerEquipment[playerChest] == 4728 & & playerEquipment[playerLegs] == 4730 && playerEquipment[playerWeapon] == 4726) { return true; } return false; } public boolean FullDharokEquipped() { if(playerEquipment[playerHat] == 4716 && playerEquipment[playerC hest] == 4720 && playerEquipment[playerLegs] == 4722 && playerEquipment[playerWe apon] == 4718) { return true; }

return false; } public void switchBooks() { interfaceEffect = 2; setAnimation(1652); clearQuestInterface(); sendFrame126("Normal Magic", 2494); sendFrame126("", 2495); sendFrame126("", 2496); sendFrame126("", 2497); sendFrame126("Ancient Magic", 2498); sendQuestSomething(8143); sendFrame164(2492); flushOutStream(); } public void weaponRack() { sendQuest("Choose your weapon", 2460); sendQuest("Sword and Shield", 2461); sendQuest("Boxing Gloves", 2462); sendFrame164(2459); flushOutStream(); } public void commands() { sendQuest("@gre@Commands", 8144); clearQuestInterface(); sendQuest("::talkon YOURTEXT - repeats a message (for buying/sel ling)", 8147); sendQuest("::talkoff - turns off message repeater", 8148); sendQuest("::pctime - checks how much time is left in pest conto rl", 8149); sendQuest("::pass NEWPASSWORD - changes your password", 8150); sendQuest("::players - view everyone online", 8151); sendQuestSomething(8143); showInterface(8134); flushOutStream(); } public void warHelp() { sendQuest("@gre@War of Bandos", 8144); clearQuestInterface(); sendQuest("Dangerous minigame, items will be lost!", 8147); sendQuest("Be aware, there are many traps in the cave", 8148); sendQuest("Also be aware of players that want your loot!", 8149) ; sendQuest("Random effects might happen on your player!", 8150); sendQuest("You will be skulled on entrance", 8150); sendQuestSomething(8143); showInterface(8134); flushOutStream(); } public void q1help() { sendQuest("Lost city", 8144); clearQuestInterface(); if(q1 == 0){ sendQuest("I can start this quest by talking to the Warrior.", 8 147); sendQuest("He is located near a training place.", 8148); sendQuest("", 8149);

sendQuest("", 8150); } if(q1 == 1){ sendQuest("The Warrior says something about 'Zanaris'", 8147); sendQuest("I should head to Falador to get some information.", 8 148); sendQuest("", 8149); sendQuest("", 8150); } if(q1 == 2){ sendQuest("The Archer at Falador says I will need a dramen staff .", 8147); sendQuest("I can get one at Entrana, but where in Entrana?", 814 8); sendQuest("", 8149); sendQuest("", 8150); } if(q1 == 3){ sendQuest("I can now cut down the Dramen tree.", 8147); sendQuest("When I have the staff, I should search for the lost c ity.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q1 == 15){ sendQuest("I have completed the quest!", 8147); sendQuest("I can now visit Zanaris.", 8148); sendQuest("", 8149); sendQuest("", 8150); } sendQuestSomething(8143); showInterface(8134); flushOutStream(); } public void q2help() { sendQuest("Rune Mysteries", 8144); clearQuestInterface(); if(q2 == 0){ sendQuest("I can start this quest by talking to the Aubury.", 81 47); sendQuest("He is located at the shopping area.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q2 == 1){ sendQuest("I should now talk to the Zamorak Mage in the wilderne ss.", 8147); sendQuest("He might give me some useful information.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q2 == 2){ sendQuest("The Zamorak Mage has given me some information.", 814 7); sendQuest("I should talk to Aubury again.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q2 == 3){ sendQuest("Aubury has asked me to get him 50 rune essence.", 814

7); sendQuest("I should start mining some.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q2 == 15){ sendQuest("I have completed the quest!", 8147); sendQuest("I can use the Zamorak Mage to craft runes.", 8148); sendQuest("", 8149); sendQuest("", 8150); } sendQuestSomething(8143); showInterface(8134); flushOutStream(); } public void q3help() { sendQuest("Desert Treasure", 8144); clearQuestInterface(); if(q3 == 0){ sendQuest("I can start this quest by talking to the King.", 8147 ); sendQuest("He is located at Catherby.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q3 == 1){ sendQuest("The king has given me the first task.", 8147); sendQuest("He wants me to steal a cake at Ardougne.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q3 == 2){ sendQuest("The king has given me the second task.", 8147); sendQuest("He wants me to get a magic shortbow.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q3 == 3){ sendQuest("The king has given me the last task.", 8147); sendQuest("He wants me to battle 4 bosses.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q3 == 15){ sendQuest("I have completed the quest!", 8147); sendQuest("I can now use ancient magic.", 8148); sendQuest("", 8149); sendQuest("", 8150); } sendQuestSomething(8143); showInterface(8134); flushOutStream(); } public void q4help() { sendQuest("Vampire Slayer", 8144); clearQuestInterface(); if(q4 == 0){ sendQuest("I can start this quest by talking to Morgan.", 8147); sendQuest("He is located at Draynor Village.", 8148); sendQuest("", 8149);

sendQuest("", 8150); } if(q4 == 1){ sendQuest("Morgan has asked me to slay a vampire.", 8147); sendQuest("I should get ready for battle.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q4 == 15){ sendQuest("I have completed the quest!", 8147); sendQuest("I have received 30,000 hitpoints experience.", 8148); sendQuest("", 8149); sendQuest("", 8150); } sendQuestSomething(8143); showInterface(8134); flushOutStream(); } public void q5help() { sendQuest("Monkey Madness", 8144); clearQuestInterface(); if(q5 == 0){ sendQuest("I can start this quest by talking to the Gnome King." , 8147); sendQuest("He is located at Gnome Stronghold.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q5 == 1){ sendQuest("The Gnome King has asked me to battle a Jungle Demon. ", 8147); sendQuest("I should head to Ape Atoll for more information.", 81 48); sendQuest("", 8149); sendQuest("", 8150); } if(q5 == 2){ sendQuest("Garkor tells me I need to get a monkey greegree.", 81 47); sendQuest("I can get one by going into the trapdoor in Ape Atoll .", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q5 == 3){ sendQuest("The gnome has given me a monkey greegree.", 8147); sendQuest("I should now talk to the Elder Guard at Ape Atoll.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q5 == 15){ sendQuest("I have completed the quest!", 8147); sendQuest("I have received 30,000 hitpoints experience.", 8148); sendQuest("", 8149); sendQuest("", 8150); } sendQuestSomething(8143); showInterface(8134); flushOutStream();

} public void q6help() { sendQuest("Sheep Shearer", 8144); clearQuestInterface(); if(q6 == 0){ sendQuest("I can start this quest by talking to Duke.", 8147); sendQuest("He is located at Lumbridge.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q6 == 1){ sendQuest("I now need 25 noted ball of wool.", 8147); sendQuest("I am not allowed in the sheep area.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q6 == 2){ sendQuest("Farmer Brumty askes me for 100 nature runes.", 8147); sendQuest("In return he will give me some ball of wool.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q6 == 15){ sendQuest("I have completed the quest!", 8147); sendQuest("I have received 100,000 coins.", 8148); sendQuest("", 8149); sendQuest("", 8150); } sendQuestSomething(8143); showInterface(8134); flushOutStream(); } public void q7help() { sendQuest("Legends QUest", 8144); clearQuestInterface(); if(q7 == 0){ sendQuest("I can start this quest by talking to the Legends Guar d.", 8147); sendQuest("They are located at the Legends Guild", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q7 == 1){ sendQuest("The Legends Guard has given his first task.", 8147); sendQuest("I must find my way out of this dungeon.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q7 == 2){ sendQuest("I have made my way through the dungeon.", 8147); sendQuest("I should talk to the Legends Guard now.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q7 == 3){ sendQuest("The Legends Guard has given his second task.", 8147); sendQuest("I need to get him 150 cakes.", 8148); sendQuest("", 8149); sendQuest("", 8150); }

if(q7 == 4){ sendQuest("The Legends Guard has given his last task.", 8147); sendQuest("I need to kill the Black Demon.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q7 == 15){ sendQuest("I have completed the quest!", 8147); sendQuest("I can now enter the Legends Guild.", 8148); sendQuest("", 8149); sendQuest("", 8150); } sendQuestSomething(8143); showInterface(8134); flushOutStream(); } public void q8help() { sendQuest("Lunar Diplomacy", 8144); clearQuestInterface(); if(q8 == 0){ sendQuest("I can start this quest by talking to the Sailor", 814 7); sendQuest("He is located at Fremennik.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q8 == 1){ sendQuest("I have completed the Sailors Task by", 8147); sendQuest("cutting a topaz gem and giving it to him.", 8148); sendQuest("The Sailor now wants me to battle a monster.", 8149); sendQuest("", 8150); } if(q8 == 2){ sendQuest("I have beat the monster Slash Bash.", 8147); sendQuest("I should go and talk to the Sailor again.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q8 == 3){ sendQuest("The Sailor has given me another task.", 8147); sendQuest("I need to get him 1 adamant ore.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q8 == 4){ sendQuest("The Sailor has given me his last task", 8147); sendQuest("I need to get 50 slayer.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q8 == 15){ sendQuest("I have completed the quest!", 8147); sendQuest("I can now use the 'Vengeance' spell.", 8148); sendQuest("I can also now wear the Helm of Neitiznot", 8149); sendQuest("", 8150); } sendQuestSomething(8143); showInterface(8134); flushOutStream(); }

public void q9help() { sendQuest("Knight's Legend", 8144); clearQuestInterface(); if(q9 == 0){ sendQuest("I can start this quest by talking to King Lathas", 81 47); sendQuest("He is located at Camelot.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q9 == 1){ sendQuest("King Lathas has told me to go to Black Knight's Fortr ess.", 8147); sendQuest("I should look for some clues on what they are plannin g on.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q9 == 2){ sendQuest("I should head to Yanille before the Black Knights ste al", 8147); sendQuest("the treasure.", 8148); sendQuest("I should bring a spade there.", 8149); sendQuest("", 8150); } if(q9 == 3){ sendQuest("I have defeated the first knight.", 8147); sendQuest("", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q9 == 4){ sendQuest("I have defeated the second knight.", 8147); sendQuest("", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q9 == 15){ sendQuest("I have completed the quest!", 8147); sendQuest("I can now use Chivalry and Piety prayers.", 8148); sendQuest("", 8149); sendQuest("", 8150); } sendQuestSomething(8143); showInterface(8134); flushOutStream(); } public void q10help() { sendQuest("Lunar Spirit", 8144); clearQuestInterface(); if(q10 == 0){ sendQuest("I can start this quest by talking to the Sailor.", 81 47); sendQuest("He is located at Fremennik.", 8148); sendQuest("I need to finish Lunar Diplomacy before starting", 81 49); sendQuest("this quest.", 8150); } if(q10 == 1){ sendQuest("The Sailor has given me a potion.", 8147);

sendQuest("I should look around this Island.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q10 == 2){ sendQuest("I found a ghost who wants me to help him with combat. ", 8147); sendQuest("He wants me to bring him the following items that", 8 148); sendQuest("can be found on the island:", 8149); sendQuest("1 Bravery Potion, 1 tomato, 1 silver necklace", 8150) ; } if(q10 == 3){ sendQuest("I have found all the items for the ghost.", 8147); sendQuest("I should prepare for combat now.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q10 == 4){ sendQuest("I have defeated the second knight.", 8147); sendQuest("", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q10 == 15){ sendQuest("I have completed the quest!", 8147); sendQuest("I can now use Lunar Magic.", 8148); sendQuest("", 8149); sendQuest("", 8150); } sendQuestSomething(8143); showInterface(8134); flushOutStream(); } public void q11help() { sendQuest("The Wolf's Cure", 8144); clearQuestInterface(); if(q11 == 0){ sendQuest("I can start this quest by talking to Merlin.", 8147); sendQuest("He is located at Seer's Village near the bank.", 8148 ); sendQuest("", 8149); sendQuest("", 8150); } if(q11 == 1){ sendQuest("Merlin has asked me to find him the following ingredi ents:", 8147); sendQuest("1 Spider egg, 1 ash, and 1 bag of salt.", 8148); sendQuest("", 8149); sendQuest("", 8150); } if(q11 == 15){ sendQuest("I have completed the quest!", 8147); sendQuest("I can now buy Black and Dragon gloves from Giles.", 8 148);

sendQuest("", 8149); sendQuest("", 8150); } sendQuestSomething(8143); showInterface(8134); flushOutStream(); } public void sendFrame106(int i1){ outStream.createFrame(106); outStream.writeByteC(i1); } public void sendQuest(String s, int id) { try { outStream.createFrameVarSizeWord(126); outStream.writeString(s); outStream.writeWordA(id); outStream.endFrameVarSizeWord(); } catch (Exception e) { server.logError(e.getMessage()); } } public void deletethatobject(int objectX, int objectY) { ReplaceObject2(objectX, objectY, 6951, -1, 10); } public void Deleteobjects() { deletethatobject(3509, 9497); deletethatobject(2898, 3428); deletethatobject(2956, 3212); deletethatobject(2987, 3240); deletethatobject(2986, 3239); deletethatobject(2984, 3237); deletethatobject(2982, 3234); deletethatobject(2980, 3233); deletethatobject(2977, 3233); deletethatobject(2975, 3234); deletethatobject(2971, 3237); deletethatobject(2968, 3239); deletethatobject(2969, 3240); deletethatobject(2969, 3242); deletethatobject(2812, 3343); deletethatobject(2810, 3342); deletethatobject(2812, 3341); deletethatobject(2844, 3337); deletethatobject(2845, 3337); deletethatobject(2851, 3332); deletethatobject(2857, 3338); deletethatobject(2859, 3338); deletethatobject(2860, 3338); deletethatobject(2862, 3338); deletethatobject(2859, 3335); deletethatobject(2861, 3335); deletethatobject(2862, 3335); deletethatobject(2857, 3335); deletethatobject(2856, 3334); deletethatobject(2642, 9908); ///////////////////////HOME START\\\\\\\\\\\\ deletethatobject(3691, 3465);//BANK 1 deletethatobject(3690, 3465);//BANK 2 deletethatobject(3689, 3465);//BANK 3 deletethatobject(3688, 3465);//BANK 4

deletethatobject(3687, 3465);//BANK 5 deletethatobject(3686, 3465);//BANK 6 deletethatobject(3688, 3471);//Bricks underneath Prayer Altar deletethatobject(3671, 3480);//Bricks underneath bookcase deletethatobject(3693, 3463);//Broken Chair at Shops //////////////////////HOME END\\//Reward\\\\\\\\\\\\\\ deletethatobject(2515, 3365);//Attack Dummy deletethatobject(2511, 3365);//Attack Dummy deletethatobject(2508, 3366);//Attack Dummy deletethatobject(2510, 3367);//Attack Dummy deletethatobject(2514, 3367);//Attack Dummy deletethatobject(2514, 3369);//Attack Dummy deletethatobject(2511, 3369);//Attack Dummy deletethatobject(2507, 3368);//Attack Dummy deletethatobject(2505, 3370);//Attack Dummy deletethatobject(2509, 3371);//Attack Dummy deletethatobject(2513, 3371);//Attack Dummy deletethatobject(2516, 3370);//Attack Dummy deletethatobject(2511, 3373);//Attack Dummy //////////////////////////END ATT DUMMIES\\\\\\\\\\\\\ deletethatobject(2506, 3380);//Dead Tree deletethatobject(2515, 3379);//Stool deletethatobject(2517, 3379);//Stool deletethatobject(2516, 3377);//Stool deletethatobject(2522, 3379);//Stool deletethatobject(2522, 3365);//Stool deletethatobject(2524, 3365);//Stool deletethatobject(2526, 3365);//Stool deletethatobject(2528, 3365);//Stool deletethatobject(2521, 3364);//Stool deletethatobject(2524, 3364);//Stool deletethatobject(2526, 3364);//Stool deletethatobject(2525, 3364);//Table deletethatobject(2525, 3365);//Table deletethatobject(2527, 3364);//Table deletethatobject(2527, 3365);//Table deletethatobject(2523, 3364);//Table deletethatobject(2523, 3365);//Table deletethatobject(2516, 3378);//Table deletethatobject(2517, 3378);//Table deletethatobject(2520, 3379);//Table deletethatobject(2521, 3379);//Table deletethatobject(2515, 3384);//Table deletethatobject(2514, 3384);//Table deletethatobject(2658, 9892);//Stairs deletethatobject(2658, 9895);//Stalagmite } public void makeGlobalObject(int x, int y, int typeID, int orientation, int tile ObjectType){ //Makes Global objects for (Player p : server.playerHandler.players){ if(p != null){ client person = (client)p; if((person.playerName != null person.playerName != "n ull")){ if(person.distanceToPoint(x, y) <= 60){ person.createNewTileObject(x, y, typeID, orientation, tileObjectType);}}}}} public void NewObjects() { makeGlobalObject(2817, 3336, 2094, 0, 10); //mining

makeGlobalObject(2818, makeGlobalObject(2819, makeGlobalObject(2820, makeGlobalObject(2821, makeGlobalObject(2822, makeGlobalObject(2823, makeGlobalObject(2824, mining :P makeGlobalObject(2860, makeGlobalObject(3568, makeGlobalObject(3509, makeGlobalObject(2974, makeGlobalObject(2940, makeGlobalObject(2940, makeGlobalObject(2940, makeGlobalObject(2940, makeGlobalObject(2940, makeGlobalObject(2940, makeGlobalObject(2940, makeGlobalObject(2940, makeGlobalObject(3096, makeGlobalObject(2991, makeGlobalObject(2516, makeGlobalObject(2864, makeGlobalObject(2900, makeGlobalObject(2740, makeGlobalObject(2900, makeGlobalObject(2900, makeGlobalObject(3299, makeGlobalObject(3298, makeGlobalObject(3299, makeGlobalObject(3298, makeGlobalObject(3286, makeGlobalObject(3298, makeGlobalObject(3565, makeGlobalObject(3299, makeGlobalObject(3102, makeGlobalObject(3103, makeGlobalObject(3104, makeGlobalObject(3105, makeGlobalObject(3106, makeGlobalObject(2943, makeGlobalObject(2742, makeGlobalObject(2340, makeGlobalObject(2339, makeGlobalObject(2338, makeGlobalObject(2339, makeGlobalObject(2335, makeGlobalObject(2336, makeGlobalObject(2337, makeGlobalObject(3126, makeGlobalObject(2708, makeGlobalObject(2536, makeGlobalObject(2536, makeGlobalObject(2536, makeGlobalObject(2539, makeGlobalObject(2538, makeGlobalObject(2537, makeGlobalObject(2807,

3336, 3336, 3336, 3336, 3336, 3336, 3336, 3338, 9677, 9496, 3372, 3353, 3352, 3351, 3350, 3349, 3348, 3347, 3346, 3504, 3379, 3865, 9938, 2905, 5103, 2915, 2920, 3199, 3199, 3200, 3205, 3211, 3202, 3287, 3310, 9307, 9307, 9307, 9307, 9307, 3286, 3443, 3683, 3684, 3683, 3682, 3699, 3699, 3699, 3356, 5065, 2539, 2538, 2537, 3896, 3896, 3896, 3344,

2091, 2093, 2111, 2097, 2103, 2105, 2107,

0, 0, 0, 0, 0, 0, 0,

10); 10); 10); 10); 10); 10); 10);

//mining //mining //mining //mining //mining //mining //end of skillz.. and

2213, 0, 10); 1747, 0, 10); 3831, 0, 10); 2783, 0, 10); 2109, 0, 10); 2109, 0, 10); 2091, 0, 10); 2094, 0, 10); 2093, 0, 10); 2097, 0, 10); 2103, 0, 10); 2105, 0, 10); 3828, 0, 10); 2470, 0, 10); 410, 0, 10); 4755, 0, 10); 13180, 0, 10); 13181, 0, 10); 13179, 0, 10); 13184, 0, 10); 4878, 0, 10); 4877, 0, 10); 4876, 0, 10); 2565, 0, 10); 2562, 0, 10); 2560, 0, 10); 10284, 0, 10); 2213, 0, 10); 2213, 0, 10); 2213, 0, 10); 2213, 0, 10); 2213, 0, 10); 2213, 0, 10); 2213, 0, 10); 2644, 0, 10); 9398, 0, 10); 9398, 0, 10); 9398, 0, 10); 9398, 0, 10); 2513, -2, 10); 2513, -2, 10); 2513, -2, 10); 2709, -1, 10); 10638, -1, 10); 3896, 0, 10); 3896, 0, 10); 3896, 0, 10); 2213, -2, 10); 2213, -2, 10); 2213, -2, 10); 2213, -2, 10);

makeGlobalObject(2807, 3345, 2213, -2, 10); makeGlobalObject(3091, 3106, 2213, 1, 10); makeGlobalObject(3091, 3107, 2213, 1, 10); makeGlobalObject(3047, 3461, 2213, 1, 10); makeGlobalObject(3047, 3460, 2213, 1, 10); makeGlobalObject(2525, 4774, 2213, 1, 10); makeGlobalObject(2524, 4774, 2213, 1, 10); makeGlobalObject(2523, 4774, 2213, 1, 10); /////////////////////////////HOME START\\\\\\\\\\\\\\\\\\\\\\\ makeGlobalObject(3691, 3465, 5276, 2, 10);//BANK 1 makeGlobalObject(3690, 3465, 5276, 2, 10);//BANK 2 makeGlobalObject(3689, 3465, 5276, 2, 10);//BANK 3 makeGlobalObject(3688, 3465, 5276, 2, 10);//BANK 4 makeGlobalObject(3687, 3465, 5276, 2, 10);//BANK 5 makeGlobalObject(3686, 3465, 5276, 2, 10);//BANK 6 makeGlobalObject(3693, 3461, 2156, 3, 10);//Donor portal makeGlobalObject(3692, 3461, 2467, 1, 10);//City portal makeGlobalObject(3677, 3494, 365, 1, 10);//Secret Sacks makeGlobalObject(3665, 3491, 2560, 3, 10);//Low Level Thieving S tall makeGlobalObject(3665, 3494, 2565, 3, 10);//Med. Level Thieving S tall makeGlobalObject(3665, 3499, 2562, 3, 10);//High Level Thieving S tall makeGlobalObject(3687, 3471, 10638, 0, 10);//Prayer Altar makeGlobalObject(3697, 3469, 410, 0, 10);//Lunar Altar makeGlobalObject(3692, 3469, 6552, 1, 10);//Ancient Altar makeGlobalObject(3678, 3479, 380, 2, 10);//Bookcase makeGlobalObject(3678, 3477, 380, 2, 10);//Bookcase makeGlobalObject(3671, 3477, 381, 4, 10);//Bookcase makeGlobalObject(3671, 3478, 381, 4, 10);//Bookcase makeGlobalObject(3671, 3479, 381, 4, 10);//Bookcase makeGlobalObject(3671, 3480, 381, 4, 10);//Bookcase makeGlobalObject(3671, 3482, 393, 4, 10);//Bamboo Bookcase makeGlobalObject(3675, 3480, 4797, 0, 10);//Bamboo Desk makeGlobalObject(3674, 3482, 6275, 1, 10);//Study Desk makeGlobalObject(2516, 3384, 6434, 1, 10);//Trapdoor makeGlobalObject(2629, 9859, 1752, 1, 10);//Broken Stairs ///////////////////////////////////////////////////////////////// makeGlobalObject(2523, 3376, 409, 1, 10);//Altar At Reward Token makeGlobalObject(2912, 3611, 4755, 1, 10);//Portal to Boss makeGlobalObject(2544, 4712, 3192, 3, 10);//Pk Highscores makeGlobalObject(2642, 9908, 873, 2, 10);//Sink in Reward Dungeon makeGlobalObject(2656, 9895, 2804, 4, 10);//Cave Entrance in Rewa rd Dungeon makeGlobalObject(2663, 9876, 4932, 0, 10);//Glowing Fungus in Rew ard Dungeon makeGlobalObject(2661, 9879, 4932, 0, 10);//Glowing Fungus in Rew ard Dungeon makeGlobalObject(2663, 9877, 4862, 0, 10);//Glowing Fungus in Rew ard Dungeon makeGlobalObject(2662, 9878, 4857, 0, 10);//Glowing Fungus in Rew ard Dungeon } public boolean HasItemAmount(int itemID, int itemAmount) { int playerItemAmountCount = 0; for (int i=0; i<playerItems.length; i++) { if (playerItems[i] == itemID+1)

{ playerItemAmountCount = playerItemsN[i]; } if(playerItemAmountCount >= itemAmount){ return true;} } return false; } public boolean multiCombat() { if((absX >= 3144 && absX <= 3184 && absY >= 3519 && absY <=3656) (abs X >= 3185 && absX <= 3350 && absY >= 3502 && absY <=3900) (absX >= 2983 && ab sX <= 3007 && absY >= 3905 && absY <=3917) (absX >= 3007 && absX <= 3075 && a bsY >= 3608 && absY <=3713) (absX >= 2944 && absX <= 2963 && absY >= 3812 && absY <=3827) (absX >= 3041 && absX <= 3057 && absY >= 3869 && absY <=3883) (absX >= 3157 && absX <= 3181 && absY >= 3874 && absY <=3895) (absX >= 2720 && absX <= 2760 && absY >= 5073 && absY <=5114) (absX >= 2256 && absX <= 2287 && absY >= 4680 && absY <=4711) (absX >= 2360 && absX <= 2445 && absY >= 504 5 && absY <= 5125) (absX >= 2760 && absX <= 2780 && absY >= 2790 && absY <=28 10) (absX >= 2624 && absX <= 2690 && absY >= 2550 && absY <=2619) (absX >= 3460 && absX <= 3520 && absY >= 9470 && absY <=9530) (absX >= 2371 && absX < = 2424 && absY >= 5125 && absY <=5167) (absX >= 2627 && absX <= 2677 && absY >= 4550 && absY <=4602) (absX >= 3249 && absX <= 3307 && absY >= 3904 && absY <=3952) (absX >= 2420 && absX <= 2520 && absY >= 10100 && absY <=10200) ( absX >= 2992 && absX <= 3090 && absY >= 4804 && absY <=4872 absX >= 2250 && a bsX <= 2296 && absY >= 4676 && absY <=4715)) return true; else return false; } boolean isInPitRoom() { if((absX >= 2394 && absX <= 2408 && absY >= 5168 && absY <=5175)) return true; else return false; } boolean nearBoxingRing() { if(absX >= 2585 && absX <= 2620 && absY >= 4761 && absY <= 4789) return true; else return false; } boolean isInPitGame() { if((absX >= 2371 && absX <= 2424 && absY >= 5125 && absY <=5167)) return true; else return false; } boolean isInGW() { if((absX >= 2699 && absX <= 2769 && absY >= 5051 && absY <=5124)) return true; else return false; } boolean isInApe() { if((absX >= 2760 && absX <= 2780 && absY >= 2790 && absY <=2810)) return true; else

public

public

public

public

public

public

public

public

public

public

public

public

public

public

return false; } boolean isInArena() { if((absX >= 2590 && absX return true; else return false; } boolean isInAssault() { if((absX >= 2576 && absX return true; else return false; } boolean isInJail() { if((absX >= 2928 && absX return true; else return false; } boolean isInJail2() { if((absX >= 2926 && absX return true; else return false; } boolean isInCity() { if((absX >= 2800 && absX return true; else return false; } boolean isInQuest() { if((absX >= 2895 && absX return true; else return false; } boolean isInGraardor() { if((absX >= 2820 && absX return true; else return false; } boolean isInPcGame() { if((absX >= 2624 && absX return true; else return false; } void youdied() {

<= 2602 && absY >= 8480 && absY <=9510))

<= 2623 && absY >= 3145 && absY <=3179))

<= 2943 && absY >= 3275 && absY <=3291))

<= 2938 && absY >= 3274 && absY <=3292))

<= 2893 && absY >= 9274 && absY <=9807))

<= 2930 && absY >= 9674 && absY <=710))

<= 2870 && absY >= 3500 && absY <=3550))

<= 2686 && absY >= 2560 && absY <=2625))

if(playerHasItem(5509)){ deleteItem(5509, 1); } if(playerHasItem(5510)){ deleteItem(5510, 1); }

if(playerHasItem(5512)){ deleteItem(5512, 1); } if(playerHasItem(5514)){ deleteItem(5514, 1); } if(playerHasItem(6570)){ keep6570 = true; deleteItem(6570, 1); } if(playerHasItem(3500)){ keep3500 = true; deleteItem(3500, 1); } if (!isSkulled) { keepItemHandle(); } if (ProtItem) { applyProtectItemProt(); } for(int rr=0; rr<playerItems.length; rr++) { try { if(playerItems[rr] > 0 && playerItems[rr] < 11999) { //createItem(currentX,currentY,playerItems[rr]-1); replaceBarrows(); //server.checkPlayerCapes.checkDrop(this); ItemHandler.addItem(playerItems[rr]-1, absX, absY, playe rItemsN[rr], KillerId, false); //createGroundItem(playerItems[rr]-1, absX, absY, player ItemsN[i]); deleteItem(playerItems[rr]-1, getItemSlot(playerItems[rr ]-1), playerItemsN[rr]); } } catch(Exception e) { } } for(int r=0; r<playerEquipment.length; r++) { try { int item = playerEquipment[r]; if((item > 0) && (item < 11999)) { remove(item, r); } } catch(Exception e) { sM("ERROR: Removing Equipment"); } } if(playerHasItem(5509)){ deleteItem(5509, 1); } if(playerHasItem(5510)){ deleteItem(5510, 1); } if(playerHasItem(5512)){ deleteItem(5512, 1); } if(playerHasItem(5514)){ deleteItem(5514, 1); } if(playerHasItem(6570)){ keep6570 = true; deleteItem(6570, 1); }

if(playerHasItem(3500)){ keep3500 = true; deleteItem(3500, 1); } for(int rr=0; rr<playerItems.length; rr++) { try { if(playerItems[rr] > 0 && playerItems[rr] < 11999) { //createItem(currentX,currentY,playerItems[rr]-1); replaceBarrows(); //server.checkPlayerCapes.checkDrop(this); ItemHandler.addItem(playerItems[rr]-1, absX, absY, playe rItemsN[rr], KillerId, false); //createGroundItem(playerItems[rr]-1, absX, absY, player ItemsN[i]); deleteItem(playerItems[rr]-1, getItemSlot(playerItems[rr ]-1), playerItemsN[rr]); } } catch(Exception e) { } } try { } catch(Exception e) {} ItemHandler.addItem(526, absX, absY, 1, KillerId, false) ; if if if if if try { } catch(Exception e) {} (itemKept1 > 0) addItem(itemKept1, 1); (itemKept2 > 0) addItem(itemKept2, 1); (itemKept3 > 0) addItem(itemKept3, 1); (itemKept4 > 0) addItem(itemKept4, 1); (keep6570) { addItem(6570, 1); keep6570 = false;

} if (keep3500) { addItem(3500, 1); keep3500 = false; } resetKeepItem(); hitDiff = 0; updateRequired = true; appearanceUpdateRequired = true; } public void keepItem1() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemKept1 = playerItems[i]-1; itemKept1Slot = i; itemSlot1 = true; }

} for (int i = 0; i < playerEquipment.length; i++) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemKept1 = playerEquipment[i]; itemKept1Slot = i; itemSlot1 = false; } } } public void keepItem2() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemKept2 = playerItems[i]-1; itemKept2Slot = i; itemSlot2 = true; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemKept2 = playerEquipment[i]; itemKept2Slot = i; itemSlot2 = false; } } } } public void keepItem3() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemKept3 = playerItems[i]-1; itemKept3Slot = i; itemSlot3 = true;

} } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemKept3 = playerEquipment[i]; itemKept3Slot = i; itemSlot3 = false; } } } } public void keepItem4() { int highest = 0; for (int i = 0; i < playerItems.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i) { int value = (int)Math.floor(GetItemValue(playerItems[i]-1)); if(value > highest && playerItems[i]-1 != -1) { highest = value; itemKept4 = playerItems[i]-1; itemKept4Slot = i; itemSlot4 = true; } } } for (int i = 0; i < playerEquipment.length; i++) { if (itemKept1Slot != i && itemKept2Slot != i && itemKept3Slot != i) { int value = (int)Math.floor(GetItemValue(playerEquipment[i])); if(value > highest && playerEquipment[i] != -1) { highest = value; itemKept4 = playerEquipment[i]; itemKept4Slot = i; itemSlot4 = false; } } } } public void resetKeepItem() { itemKept1 = itemKept2 = itemKept3 = itemKept4 = -1; itemKept1Slot = itemKept2Slot = itemKept3Slot = itemKept4Slot = -1; } public void keepItemHandle() { keepItem1();

keepItem2(); keepItem3(); if (itemKept1 > 0) { if (itemSlot1) deleteItem(itemKept1, itemKept1Slot, 1); else if (!itemSlot1) deleteequiment(itemKept1, itemKept1Slot); } if (itemKept2 > 0) { if (itemSlot2) deleteItem(itemKept2, itemKept2Slot, 1); else if (!itemSlot2) deleteequiment(itemKept2, itemKept2Slot); } if (itemKept3 > 0) { if (itemSlot3) deleteItem(itemKept3, itemKept3Slot, 1); else if (!itemSlot3) deleteequiment(itemKept3, itemKept3Slot); } } public void applyProtectItemProt() { if(!isSkulled) keepItem4(); if (itemKept4 > 0) { if (itemSlot4) deleteItem(itemKept4, itemKept4Slot, 1); else if (!itemSlot4) deleteequiment(itemKept4, itemKept4Slot); } if(isSkulled) keepItem1(); if (itemKept1 > 0) { if (itemSlot1) deleteItem(itemKept1, itemKept1Slot, 1); else if (!itemSlot1) deleteequiment(itemKept1, itemKept1Slot); } } public void refreshSkills() { sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" + + + + + + + + + + + playerLevel[0] + "", 4004); playerLevel[2] + "", 4006); playerLevel[1] + "", 4008); playerLevel[4] + "", 4010); playerLevel[5] + "", 4012); playerLevel[6] + "", 4014); currentHealth + "", 4016); playerLevel[16] + "", 4018); playerLevel[15] + "", 4020); playerLevel[17] + "", 4022); playerLevel[12] + "", 4024);

sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest("" sendQuest(""

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

playerLevel[9] + "", 4026); playerLevel[14] + "", 4028); playerLevel[13] + "", 4030); playerLevel[10] + "", 4032); playerLevel[7] + "", 4034); playerLevel[11] + "", 4036); playerLevel[8] + "", 4038); playerLevel[20] + "", 4152); playerLevel[18] + "", 12166); playerLevel[19] + "", 13926); getLevelForXP(playerXP[0]) + "", 4005); getLevelForXP(playerXP[2]) + "", 4007); getLevelForXP(playerXP[1]) + "", 4009); getLevelForXP(playerXP[4]) + "", 4011); getLevelForXP(playerXP[5]) + "", 4013); getLevelForXP(playerXP[6]) + "", 4015); getLevelForXP(playerXP[3]) + "", 4017); getLevelForXP(playerXP[16]) + "", 4019); getLevelForXP(playerXP[15]) + "", 4021); getLevelForXP(playerXP[17]) + "", 4023); getLevelForXP(playerXP[12]) + "", 4025); getLevelForXP(playerXP[9]) + "", 4027); getLevelForXP(playerXP[14]) + "", 4029); getLevelForXP(playerXP[13]) + "", 4031); getLevelForXP(playerXP[10]) + "", 4033); getLevelForXP(playerXP[7]) + "", 4035); getLevelForXP(playerXP[11]) + "", 4037); getLevelForXP(playerXP[8]) + "", 4039); getLevelForXP(playerXP[20]) + "", 4153); getLevelForXP(playerXP[18]) + "", 12167); getLevelForXP(playerXP[19]) + "", 13927); playerXP[0] + "", 4044); playerXP[2] + "", 4050); playerXP[1] + "", 4056); playerXP[4] + "", 4062); playerXP[5] + "", 4068); playerXP[6] + "", 4074); playerXP[3] + "", 4080); playerXP[16] + "", 4086); playerXP[15] + "", 4092); playerXP[17] + "", 4098); playerXP[12] + "", 4104); playerXP[9] + "", 4110); playerXP[14] + "", 4116); playerXP[13] + "", 4122); playerXP[10] + "", 4128); playerXP[7] + "", 4134); playerXP[11] + "", 4140); playerXP[8] + "", 4146); playerXP[20] + "", 4157); playerXP[18] + "", 12171); playerXP[19] + "", 13921); getXPForLevel(playerLevel[0] getXPForLevel(playerLevel[2] getXPForLevel(playerLevel[1] getXPForLevel(playerLevel[4] getXPForLevel(playerLevel[5] + + + + + 1) 1) 1) 1) 1) + + + + + "", "", "", "", "", 4045); 4051); 4057); 4063); 4069);

sendQuest("" + getXPForLevel(playerLevel[6] + 1) + "", 4075); sendQuest("" + getXPForLevel(playerLevel[3] + 1) + "", 4081); sendQuest("" + getXPForLevel(playerLevel[16] + 1) + "", 4087); sendQuest("" + getXPForLevel(playerLevel[15] + 1) + "", 4093); sendQuest("" + getXPForLevel(playerLevel[17] + 1) + "", 4099); sendQuest("" + getXPForLevel(playerLevel[12] + 1) + "", 4105); sendQuest("" + getXPForLevel(playerLevel[9] + 1) + "", 4111); sendQuest("" + getXPForLevel(playerLevel[14] + 1) + "", 4117); sendQuest("" + getXPForLevel(playerLevel[13] + 1) + "", 4123); sendQuest("" + getXPForLevel(playerLevel[10] + 1) + "", 4129); sendQuest("" + getXPForLevel(playerLevel[7] + 1) + "", 4135); sendQuest("" + getXPForLevel(playerLevel[11] + 1) + "", 4141); sendQuest("" + getXPForLevel(playerLevel[8] + 1) + "", 4147); sendQuest("" + getXPForLevel(playerLevel[20] + 1) + "", 4158); sendQuest("" + getXPForLevel(playerLevel[18] + 1) + "", 12172); sendQuest("" + getXPForLevel(playerLevel[19] + 1) + "", 13922); sendFrame126("Prayer: "+playerLevel[5]+"/"+getLevelForXP(playerX P[5])+"", 687); } public void turnpray(){ server.setConfig.turnPrayOff(playerId); } public void createGroundItem(int itemID, int itemX, int itemY, int itemAmount) { // Phate: creates item at absolute X and Y outStream.createFrame(85); // Phate: Spawn ground item outStream.writeByteC((itemY - 8 * mapRegionY)); outStream.writeByteC((itemX - 8 * mapRegionX)); outStream.createFrame(44); outStream.writeWordBigEndianA(itemID); outStream.writeWord(itemAmount); outStream.writeByte(0); // x(4 MSB) y(LSB) coords // System.out.println("CreateGroundItem "+itemID+" "+(itemX - 8 * // mapRegionX)+","+(itemY - 8 * mapRegionY)+" "+itemAmount); } public static boolean AutoSave = false; public static final int bufferSize = 30000; public static final int packetSizes[] = { 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, //0 0, 0, 0, 0, 8, 0, 6, 2, 2, 0, //10 0, 2, 0, 6, 0, 12, 0, 0, 0, 0, //20 0, 0, 0, 0, 0, 8, 4, 0, 0, 2, //30 2, 6, 0, 6, 0, -1, 0, 0, 0, 0, //40 0, 0, 0, 12, 0, 0, 0, 0, 8, 0, //50 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, //60 6, 0, 2, 2, 8, 6, 0, -1, 0, 6, //70 0, 0, 0, 0, 0, 1, 4, 6, 0, 0, //80 0, 0, 0, 0, 0, 3, 0, 0, -1, 0, //90 0, 13, 0, -1, 0, 0, 0, 0, 0, 0,//100 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, //110 1, 0, 6, 0, 0, 0, -1, 0, 2, 6, //120 0, 4, 6, 8, 0, 6, 0, 0, 0, 2, //130 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, //140

0, 0, 0, 0, 0, 2, 4, 0, 1, 0, 0, };

0, 0, 0, 8, 0, 0, 0, 0, 0, 4, 0,

1, 2, 0, 2, 6, 0, 0, 0, //150 0, 0, -1, -1, 0, 0, 0, 0,//160 0, 0, 0, 0, 0, 0, 0, 0, //170 0, 3, 0, 2, 0, 0, 8, 1, //180 12, 0, 0, 0, 0, 0, 0, 0, //190 0, 0, 0, 0, 0, 0, 4, 0, //200 0, 0, 7, 8, 0, 0, 10, 0, //210 0, 0, 0, 0, -1, 0, 6, 0, //220 0, 0, 6, 0, 6, 8, 1, 0, //230 0, 0, 0, 0, -1, 0, -1, 4,//240 6, 6, 0, 0, 0 //250 final 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, int validPackets[] = { 1, 0, 0, 0, 0, 0, //0 1, 0, 1, 1, 1, 0, //10 0, 1, 0, 0, 0, 0, //20 0, 1, 1, 0, 0, 1, //30 0, 1, 0, 0, 0, 0, //40 0, 0, 0, 1, 0, 0, //50 0, 0, 0, 0, 0, 0, //60 1, 1, 0, 1, 1, 1, //70 0, 1, 1, 1, 0, 0, //80 0, 1, 0, 0, 1, 0, //90 0, 0, 0, 0, 0, 0, //100 0, 0, 0, 1, 0, 0, //110 0, 0, 1, 0, 1, 1, //120 0, 1, 1, 0, 0, 1, //130 0, 1, 0, 0, 1, 0, //140 0, 1, 1, 0, 0, 0, //150 1, 1, 0, 0, 0, 0, //160 0, 0, 0, 0, 0, 0, //170 0, 1, 0, 0, 1, 1, //180 0, 0, 0, 0, 0, 0, //190 0, 0, 0, 0, 1, 0, //200 1, 1, 0, 0, 1, 0, //210 0, 0, 1, 0, 1, 0, //220 1, 0, 1, 1, 1, 0, //230 0, 0, 1, 0, 1, 1, //240 0, 0, 0 //250

public static 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, };

public boolean destroyItem(int item) { for(int i = 0; i < noTrade.length; i++) { if(noTrade[i] == item) return true; } return false; } public String getMessageA(int itemID){ switch(itemID){ case 6570: return "You can get another from the Fight"; case 4045: return "You can get another from the wizard at Home";

case 4046: return "You can get another from the wizard at Home"; case 3500: return "You can get another fro... ***CENSOR***"; } return "Are you sure you want to destroy this item!"; } public String getMessageB(int itemID){ switch(itemID){ case 6570: return "Caves minigame."; case 3500: return "Sorry, it is strictly forbidden to tell you."; } return ""; } public int[] noTrade = {5509,3500, 5510,5512,5514,4565,4566,6570,1580,67 29,4045,4046,714,771,772,1891,1892,983,1550,4031,4035,1613,1629,4277,739,1982,17 96}; public int NPCID; // GLOBALLY NOW last clicked npcID -bakatool public int NPCSlot; // GLOBALLY NOW last clicked npc slot -bakatool public CopyOnWriteArrayList<GameItem> offeredItems = new CopyOnWriteArra yList<GameItem>(); public boolean officialClient = false; public int OriginalShield = -1; public int OriginalWeapon = -1; public CopyOnWriteArrayList<GameItem> otherOfferedItems = new CopyOnWrit eArrayList<GameItem>(); public int packetSize = 0, packetType = -1; public int pCArms; public public public public int int int int pCBeard; pCFeet; pCHands; pCHead;

public int pCLegs; public int pColor; public int pCTorso; public int PickUpAmount = 0; public int PickUpDelete = 0; public int PickUpID = 0; public String properName = ""; public int Publicchat = 0; public int[] QuestInterface = { 8145, 8147, 8148, 8149, 8150, 8151, 8152 , 8153, 8154, 8155, 8156, 8157, 8158, 8159, 8160, 8161, 81 62, 8163, 8164, 8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 81 73, 8174, 8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 8183, 81 84, 8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 8193, 8194, 81

95, 12174, 12175, 12176, 12177, 12178, 12179, 12180, 12181, 12182, 12183, 12184, 12185, 12186, 12187, 12188, 12189, 12190, 12191, 12192, 12193, 12194, 12195, 12196, 12197, 12198, 12199, 12200, 12201, 12202, 12203, 12204, 12205, 12206, 12207, 12208, 12209, 12210, 12211, 12212, 12213, 12214, 12215, 12216, 12217, 12218, 12219, 12220, 12221, 12222, 12223 }; public int random_skill = -1, npcId = -1; public int readPtr, writePtr; public int[] requiredLevel = { 1, 10, 25, 38, 50, 60, 62, 64, 66, 68, 70 , 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96 }; public int restart = 0; public int returnCode = 2; // Tells the client if the login was successf ull public int rune1, rune1Am, rune2, rune2Am, rune3, rune3Am, rune4, rune4A m, spellXP; public int sameclick = 0; public int savecounter = 0; public boolean saveNeeded = true; public boolean shafting = false; public int SkillID = 0; public int skillX = -1; public int skillY = -1; private int somejunk; // -bakatool public int spellHit; // also same added so it won't be static ROFL // -bakatool public int spellHitTimer; // npc. -bakatool public int spellNpcIndex = -1; // added so it won't be static ROFL.. // -bakatool public int spellPlayerIndex = -1; // same added so it won't be static RO FL public public public public public 11004, 11003, 11005, 47002, 54090, 11007 }; boolean spellSet = false; int stairDistance = 1; int stairDistanceAdd = 0; int stairs = 0; int[] statId = { 10252, 11000, 10253, 11001, 10254, 11002, 10255, 11011, 11013, 11014, 11010, 11012, 11006, 11009, 11008,

public String statName[] = { "attack", "defence", "strength", "hitpoints ", "range", "prayer", "magic", "cooking", "woodcutting", "f letching", "fishing", "firemaking", "crafting", "smithing", "mining ", public public public public o // the client public int trade_reqId = 0, trade_other; public int Tradecompete = 0; public boolean tradeRequested = false, inTrade = false, canOffer = true, tradeConfirmed = false, tradeConfirmed2 = false, tradeResetNeeded = false; long tTime = 0; long tTime2 = 0; // Devolution: teleports int tX = 0, tY = 0, tH = 1; public boolean validClient = true, muted = false, attackedNpc = false; public boolean validLogin = false; // public int[] restrictedItem = { 4716, 4718, 4720, 4722, 4724, 4726, 4 728, // 4730}; private int WanneBank = 0; private int WanneShop = 0; public boolean wearing = false; public boolean WildernessWarning = false; public boolean WildernessWarning2 = false; private int woodcutting[] = { 0, 0, 0, 1, -1, 2 }; private int XinterfaceID = 0; private int XremoveID = 0; private int XremoveSlot = 0; public client(java.net.Socket s, int _playerId) { super(_playerId); mySock = s; try { in = s.getInputStream(); out = s.getOutputStream(); //in = new java.io.DataInputStream(s.getInputStream()); //out = new DataOutputStream(s.getOutputStream()); } catch (java.io.IOException ioe) { misc.println("2 Speced Server (1): Exception!"); "herblore", "agility", "thieving", "slayer", "farming", "runecrafting"}; String clan = null; // Clan Chat int stealtimer; int stillSpellGFX; int timeOutCounter = 0; // to detect timeouts on the connection t

server.logError(ioe.getMessage()); } outStream = new stream(new byte[bufferSize]); outStream.currentOffset = 0; inStream = new stream(new byte[bufferSize]); inStream.currentOffset = 0; readPtr = writePtr = 0; buffer = buffer = new byte[bufferSize]; } public void actionReset() { actionName = ""; } public boolean addItem2(int item, int amount) { try { if(item == -1) return false; if (!Item.itemStackable[item] amount < 1) { amount = 1; } if ((freeSlots() >= amount && !Item.itemStackable[item]) Slots() > 0) { for (int i = 0; i < playerItems.length; i++) { if (playerItems[i] == (item+1) && Item.itemStack able[item] && playerItems[i] > 0) { playerItems[i] = (item + 1); if ((playerItemsN[i] + amount) < maxItem Amount && (playerItemsN[i] + amount) > -1) { playerItemsN[i] += amount; } else { playerItemsN[i] = maxItemAmount; } outStream.createFrameVarSizeWord(34); outStream.writeWord(3214); outStream.writeByte(i); outStream.writeWord(playerItems[i]); if (playerItemsN[i] > 254) { outStream.writeByte(255); outStream.writeDWord(playerItems N[i]); } else { outStream.writeByte(playerItemsN [i]); //amount } outStream.endFrameVarSizeWord(); i = 30; return true; } } for (int i = 0; i < playerItems.length; i++) { if (playerItems[i] <= 0) { playerItems[i] = item+1; if (amount < maxItemAmount && amount > 1) { playerItemsN[i] = amount; free

} else { playerItemsN[i] = maxItemAmount; } outStream.createFrameVarSizeWord(34); outStream.writeWord(3214); outStream.writeByte(i); outStream.writeWord(playerItems[i]); if (playerItemsN[i] > 254) { outStream.writeByte(255); outStream.writeDWord(playerItems N[i]); } else { outStream.writeByte(playerItemsN [i]); //amount } outStream.endFrameVarSizeWord(); i = 30; return true; } } return false; } else { ItemHandler.addItem(item, absX, absY, amount, playerId, false); return false; } } catch (Exception E) { return false; } } public boolean addItem(int item, int amount) { try { if(item == -1) return false; if (!Item.itemStackable[item] amount < 1) { amount = 1; } if ((freeSlots() >= amount && !Item.itemStackable[item]) Slots() > 0) { for (int i = 0; i < playerItems.length; i++) { if (playerItems[i] == (item+1) && Item.itemStack able[item] && playerItems[i] > 0) { playerItems[i] = (item + 1); if ((playerItemsN[i] + amount) < maxItem Amount && (playerItemsN[i] + amount) > -1) { playerItemsN[i] += amount; } else { playerItemsN[i] = maxItemAmount; } outStream.createFrameVarSizeWord(34); outStream.writeWord(3214); outStream.writeByte(i); outStream.writeWord(playerItems[i]); if (playerItemsN[i] > 254) { outStream.writeByte(255); outStream.writeDWord(playerItems N[i]); } else { outStream.writeByte(playerItemsN [i]); //amount free

} outStream.endFrameVarSizeWord(); i = 30; return true; } } for (int i = 0; i < playerItems.length; i++) { if (playerItems[i] <= 0) { playerItems[i] = item+1; if (amount < maxItemAmount && amount > 1) { playerItemsN[i] = amount; } else { playerItemsN[i] = maxItemAmount; } outStream.createFrameVarSizeWord(34); outStream.writeWord(3214); outStream.writeByte(i); outStream.writeWord(playerItems[i]); if (playerItemsN[i] > 254) { outStream.writeByte(255); outStream.writeDWord(playerItems N[i]); } else { outStream.writeByte(playerItemsN [i]); //amount } outStream.endFrameVarSizeWord(); i = 30; return true; } } return false; } else { sM("Not enough space in your inventory."); return false; } } catch (Exception E) { return false; } } public void addObject(int objectX, int objectY, int NewObjectID, int Fac e) { outStream.createFrameVarSizeWord(60); outStream.writeByte(objectY - (mapRegionY * 8)); outStream.writeByteC(objectX - (mapRegionX * 8)); /* CREATE OBJECT */ if (NewObjectID > -1) { outStream.writeByte(151); outStream.writeByteS(0); outStream.writeWordBigEndian(NewObjectID); outStream.writeByteA(Face); // 0= WEST -1 = NORTH = EAST -3 // = SOUTH } outStream.endFrameVarSizeWord(); } public boolean addShopItem(int itemID, int amount) { boolean Added = false;

-2

if (amount <= 0) { return false; } if (Item.itemIsNote[itemID] == true) { itemID = GetUnnotedItem(itemID); } for (int i = 0; i < server.shopHandler.ShopItems.length; i++) { if ((server.shopHandler.ShopItems[MyShopID][i] - 1) == i temID) { server.shopHandler.ShopItemsN[MyShopID][i] += am ount; Added = true; } } if (Added == false) { for (int i = 0; i < server.shopHandler.ShopItems.length; i++) { if (server.shopHandler.ShopItems[MyShopID][i] == 0) { server.shopHandler.ShopItems[MyShopID][i ] = (itemID + 1); server.shopHandler.ShopItemsN[MyShopID][ i] = amount; server.shopHandler.ShopItemsDelay[MyShop ID][i] = 0; break; } } } return true; } public boolean addSkillXP(int amount, int skill) { if (randomed) { sM("You must answer the genie before you can gain experi ence!"); return false; } if (expLock) return false; if (playerEquipment[playerRing] == 773){ //your ring ID here amount *= 2; } if ((amount + playerXP[skill]) < 0 amount + playerXP[skill] > 200000000 playerXP[skill] >= 200000000) { playerXP[skill] = 200000000; refreshSkills(); return false; } int oldLevel = getLevelForXP(playerXP[skill]); // int[] statId = {4004, 4008, 4006, 4016, 4010, 4012, 4014, 403 4, 4038, // 4026, 4032, 4036, 4024, 4030, 4028, 4020, 4018, 4022, 4152}; playerXP[skill] += amount; if (oldLevel < getLevelForXP(playerXP[skill])) { // if(oldLevel >= 85) specGFX(199); //checkPlayerCapes.achievedMax(skill, this); playerLevel[skill] = getLevelForXP(playerXP[skill]);

// stillgfx(623, absY, absX); // levelup(skill); updateRequired = true; appearanceUpdateRequired = true; sM("Congratulations, you just advanced a " + statName[skill] + " level."); getTotalLevel(); if (playerLevel[skill] > 90) // sendFrame126(playerName + " (" + combatLevel + ")", 6 572); setSkillLevel(skill, playerLevel[skill], playerXP[skill] ); } refreshSkills(); // setSkillLevel(skill, playerLevel[skill], playerXP[skill]); if (skill == 2) { CalculateMaxHit(); } return true; } public int amountOfItem(int itemID) { int i1 = 0; for (int i = 0; i < 28; i++) { if (playerItems[i] == (itemID + 1)) { i1++; } } return i1; } public boolean antiHax() { if (System.currentTimeMillis() - lastMouse > 1000) { println("Suspicious activity!"); disconnected = true; //sM("Client hack detected!"); //sM("The only supported clients are the 2 Speced client and moparscape"); return false; } return true; } public void appendToHiscores(String player) { BufferedWriter bw = null; try { bw = new BufferedWriter( new FileWriter("config/hiscores.txt", tr ue)); bw.write(player); bw.newLine(); bw.flush(); } catch (IOException ioe) { ioe.printStackTrace(); } finally { if (bw != null) { try { bw.close(); } catch (IOException ioe2) {

sM("Error with hiscores!"); } } } } public void appendToAutoSpawn(int npcid, int absx, int absy) { BufferedWriter bw = null; try { bw = new BufferedWriter( new FileWriter("config//autospawncodes.t xt", true)); 0 0 bw.write("spawn = "+npcid+" "+absx+" 0 0 1"); bw.newLine(); bw.flush(); } catch (IOException ioe) { ioe.printStackTrace(); } finally { if (bw != null) { try { bw.close(); } catch (IOException ioe2) { sM("Error autospawning!"); } } } 0 "+absy+"

} public void appendToAutoSpawn2(int npcid, int absx, int absy, int absx2, int absy2, int absx3, int absy3) { BufferedWriter bw = null; try { bw = new BufferedWriter( new FileWriter("config//autospawncodes.t xt", true)); 0 "+absx2+" bw.write("spawn = "+npcid+" "+absx+" "+absy2+" "+absx3+" "+absy3+" bw.newLine(); bw.flush(); } catch (IOException ioe) { ioe.printStackTrace(); } finally { if (bw != null) { try { bw.close(); } catch (IOException ioe2) { sM("Error autospawning!"); } } } "+absy+" 1");

} public boolean AreXItemsInBag(int ItemID, int Amount) { int ItemCount = 0; for (int pItem : playerItems) { if ((pItem - 1) == ItemID) {

ItemCount++; } if (ItemCount == Amount) { return true; } } return false; } public void drawback() { if (hasCrystalBow()) { specGFX(250); } if (playerEquipment[playerArrows] == 882 && !specOn && !hasCrystalBow()){ specGFX(18); } else if (playerEquipment[playerArrows] == 884 && !specOn && !hasCrystalBow() ) { specGFX(19); } else if (playerEquipment[playerArrows] == 886 && !specOn && !hasCrystalBow() ) { specGFX(20); } else if (playerEquipment[playerArrows] == 888 && !specOn && !hasCrystalBow( )) { specGFX(21); } else if (playerEquipment[playerArrows] == 890 && !specOn && !hasCrystalBow( )) { specGFX(22); } else if (playerEquipment[playerArrows] == 892 && !specOn && !hasCrystalBow( )) { specGFX(24); } } public boolean hasKnife(){ int a = playerEquipment[playerWeapon]; if(a == 863 a == 864 a == 865 a == 866 a == 867 a == 868 a == 869){ return true; } return false; } // pk: 2726 9193 private boolean Attack() { client AttackingOn2 = (client) server.playerHandler.players[AttackingOn]; int EnemyX = PlayerHandler.players[AttackingOn].absX; int EnemyY = PlayerHandler.players[AttackingOn].absY; if(hasKnife()){ sM("Knives are disabled for now!"); ResetAttack(); return false; } if(hitID != AttackingOn2.playerId && hitID != 0 && !multiCombat()){ sM("I'm already under attack."); ResetAttack();

faceNPC(32768 + AttackingOn); return false; } if (!(AttackingOn > 0) !(AttackingOn < server.playerHandler.players. length)) { ResetAttack(); return false; } if (playerId < 1) { sM("Error: Your player id is invalid. Please try again o r logout and back in"); }

boolean UseBow = false; if (playerEquipment[playerWeapon] == 839 playerEquipment[play erWeapon] == 841 playerEquipment[playerWeapon] == 843 playerEquipment[pla yerWeapon] == 845 playerEquipment[playerWeapon] == 847 playerEquipment[p layerWeapon] == 849 playerEquipment[playerWeapon] == 851 playerEquipment[ playerWeapon] == 853 playerEquipment[playerWeapon] == 855 playerEquipment [playerWeapon] == 857 playerEquipment[playerWeapon] == 837 playerEquipmen t[playerWeapon] == 861 playerEquipment[playerWeapon] == 4734 playerEquipme nt[playerWeapon] == 859 playerEquipment[playerWeapon] == 4827 hasCrystalBo w()) { UseBow = true; } boolean UseCrossBow = false; if (playerEquipment[playerWeapon] == 837) { UseCrossBow = true; } boolean UseRing = false; if (playerEquipment[playerWeapon] == 6522) { UseRing = true; } if (UseBow) { HasArrows = false; CheckArrows(); //CalculateRange(); hitDiff = misc.random(maxRangeHit()); //drawback(); inCombat = true; lastCombat = System.currentTimeMillis(); lastAttack = lastCombat; } if (UseCrossBow) { HasBolts = false; CheckBolts(); //CalculateRange(); hitDiff = misc.random(maxRangeHit()); inCombat = true; lastCombat = System.currentTimeMillis(); lastAttack = lastCombat; } if (UseRing) { HasRings = false;

CheckRings(); //CalculateRange(); hitDiff = misc.random(maxRangeHit()); inCombat = true; lastCombat = System.currentTimeMillis(); lastAttack = lastCombat; } if(UseBow UseCrossBow UseRing){ followID = AttackingOn2.playerId; if(GoodDistance(EnemyX, EnemyY, absX, absY, 8) == false){ sM("You are too far to range your enemy!"); ResetAttack(); return false; } } //Writes players online to quest tab int EnemyHP = PlayerHandler.players[AttackingOn].currentHealth; int EnemyHPExp = PlayerHandler.players[AttackingOn].playerXP[pla yerHitpoints]; int[] arrowIds = { 882, 884, 886, 888, 890, 892, 78 }; int[] arrowGfx = { 10, 9, 11, 12, 13, 15, 16 }; int[] staffs = {1381, 1383, 1385, 1387, 4675}; faceNPC(32768 + AttackingOn); updateRequired = true; appearanceUpdateRequired = true; int arrowgfx = 10; for (int i1 = 0; i1 < arrowIds.length; i1++) { if (playerEquipment[playerArrows] == arrowIds[i1]) { arrowgfx = arrowGfx[i1]; } } if(hasCrystalBow()){ arrowgfx = 249; } for (int element : staffs) { if ((playerEquipment[playerWeapon] == element) && autocasting && autocastID > 0 && (isI nWilderness(absX, absY, 1) == true && AttackingOn2.isInWilderness(AttackingOn2.a bsX, AttackingOn2.absY, 1) == true)) { followID = AttackingOn2.playerId; if(GoodDistance(EnemyX, EnemyY, absX, absY, 16) == false){ sM("You are too far to mage your enemy!"); ResetAttack(); return false; } if(AttackingOn2.skulledBy != playerName) { lastSkull = System.currentTimeMillis(); isSkulled = true; skulledBy = AttackingOn2.playerName; getHead(); } int playerTargetX = server.playerHandler.players [AttackingOn].absX; int playerTargetY = server.playerHandler.players [AttackingOn].absY; int playerTargetCombat = server.playerHandler.pl ayers[AttackingOn].combat;

int playerTargetHealth = server.playerHandler.pl ayers[AttackingOn].playerLevel[playerHitpoints]; if (System.currentTimeMillis() - magetimer < 400 0) { //sM("You must wait 4 seconds before cas ting this kind of spell again"); return false; } if (!playerMage(AttackingOn)) { return false; } inCombat = true; lastCombat = System.currentTimeMillis(); lastAttack = lastCombat; magetimer = System.currentTimeMillis(); TurnPlayerTo(playerTargetX, playerTargetY); updateRequired = true; appearanceUpdateRequired = true; toX = absX; toY = absY; newWalkCmdSteps = 0; newWalkCmdX[0] = newWalkCmdY[0] = tmpNWCX[0] = t mpNWCY[0] = 0; getNextPlayerMovement(); MagicHandler.playerX = playerTargetX; MagicHandler.playerY = playerTargetY; MagicHandler.playerHP = playerTargetHealth; AttackingOn2.offTimer = System.currentTimeMillis (); AttackingOn2.hitID = playerId; spellPlayerIndex = MagicHandler.magicSpellPlayer (autocastID, playerId, AttackingOn, playerLev el[6]); return true; } } int int int int ay * 8); int rand_def = (int) (0.65 * misc.random(AttackingOn2.playerLeve l[1]) + AttackingOn2.DefPray * 8); if(AttackingOn2.ProtMelee){ rand_def += misc.random(100); } if(FullVMelee()){ voidmelee += 10; } if (FightType == 1) aBonus += (int) (playerBonus[1] / 20); int random_u = misc.random(playerBonus[1] + aBonus) * 2; int dBonus = 0; if (AttackingOn2.FightType == 4) dBonus += (int) (AttackingOn2.playerBonus[6] / 20); int random_def = misc.random(AttackingOn2.playerBonus[6] + dBonu s + AttackingOn2.AtkPray * 8); if ((random_u >= random_def) && (rand_att > rand_def)) { voidmelee = 0; hitDiff = 0; aBonus = 0; rand_att = misc.random(playerLevel[0])*3 + misc.random(AtkPr

hitDiff = misc.random(playerMaxHit) + misc.random(StrPra yer) + misc.random(voidmelee); if(AttackingOn2.ProtMelee) hitDiff /= 2; } else { hitDiff = 0; } long thisTime = System.currentTimeMillis(); if (UseBow && playerEquipment[playerWeapon] == 4734) { //CalculateRange(); hitDiff = misc.random(maxRangeHit()); if (DeleteArrow() && playerEquipment[playerArrows] == 47 40) { lastArrow = System.currentTimeMillis(); arrow = true; actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); } else { ResetAttack(); sM("There is no ammo left in your quiver."); return false; } } if (UseBow && hasCrystalBow()) { //CalculateRange(); drawback(); hitDiff = misc.random(maxRangeHit()); degradeCrystalBow(); if (DeleteArrow()) { lastArrow = System.currentTimeMillis(); arrow = true; arrowsLeft -= 1; actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); } else { ResetAttack(); sM("There is no ammo left in your quiver."); return false; } } if (UseBow && !UseCrossBow && playerEquipment[playerWeapon] != 4 734 && playerEquipment[playerWeapon] != 4827 && !hasCrystalBow()) { //CalculateRange(); drawback(); hitDiff = misc.random(maxRangeHit()); if (DeleteArrow() && HasArrows) { lastArrow = System.currentTimeMillis(); arrow = true; actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); } else { ResetAttack(); sM("There is no ammo left in your quiver."); return false; } } if (UseBow && playerEquipment[playerWeapon] == 4827) { //CalculateRange(); drawback(); hitDiff = misc.random(maxRangeHit());

if (DeleteArrow() && HasArrows) { lastArrow = System.currentTimeMillis(); arrow = true; actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); } else { ResetAttack(); sM("There is no ammo left in your quiver."); return false; } } if (UseCrossBow) { //CalculateRange(); hitDiff = misc.random(maxRangeHit()); if (DeleteArrow() && HasBolts) { lastArrow = System.currentTimeMillis(); arrow = true; actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); } else { ResetAttack(); sM("There is no ammo left in your quiver."); return false; } } if (UseRing) { //CalculateRange(); hitDiff = misc.random(maxRangeHit()); if (DeleteRing() && HasRings) { lastArrow = System.currentTimeMillis(); arrow = true; actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); } else { ResetAttack(); return false; } } long thisAttack = System.currentTimeMillis(); if(Smite == true && AttackingOn2.playerLevel[5] > 0 && GoodDistance(EnemyX, Enem yY, absX, absY, 1)) { AttackingOn2.playerLevel[5] -= hitDiff/ 4; AttackingOn2.sendQuest("" + AttackingOn2.playerLevel[5] + "", 4012); AttackingOn2.sendFrame126("Prayer: "+AttackingOn2.playerLevel[5]+"/"+AttackingOn 2.getLevelForXP(playerXP[5])+"", 687); } if(playerEquipment[playerWeapon] == 6528 && playerEquipment[playerAmulet] == 657 7 && misc.random(3)==1){ hitDiff = misc.random(8) + misc.random(playerMaxHit) + misc.random(StrPrayer); } if(FullDharokEquipped() && misc.random(2)==1 && currentHealth > 80 && currentHea lth < 100){ hitDiff = misc.random(8) + misc.random(playerMaxHit) + misc.random(StrPrayer); } if(FullDharokEquipped() && misc.random(2)==1 && currentHealth > 60 && currentHea lth < 79){

hitDiff = misc.random(18) + misc.random(playerMaxHit) + misc.random(StrPrayer); } if(FullDharokEquipped() && misc.random(2)==1 && currentHealth > 40 && currentHea lth < 59){ hitDiff = misc.random(28) + misc.random(playerMaxHit) + misc.random(StrPrayer); } if(FullDharokEquipped() && misc.random(2)==1 && currentHealth > 20 && currentHea lth < 39){ hitDiff = misc.random(38) + misc.random(playerMaxHit) + misc.random(StrPrayer); } if(FullDharokEquipped() && misc.random(2)==1 && currentHealth > 0 && currentHeal th < 18){ hitDiff = misc.random(58) + misc.random(playerMaxHit) + misc.random(StrPrayer); } if(FullVeracEquipped()) { if(misc.random(2) == 1){ hitDiff = misc.random(playerMaxHit) + misc.random(StrPrayer); } } if(FullGuthanEquipped()) { if(misc.random(3) == 1){ if((currentHealth + hitDiff) <= getLevelForXP(playerXP[3])){ currentHealth += hitDiff; } if((currentHealth + hitDiff) > getLevelForXP(playerXP[3])){ currentHealth = getLevelForXP(playerXP[3]); } sendQuest("" + currentHealth + "", 4016); stillgfx(398, EnemyY, EnemyX); } } actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); if(AttackingOn2.prayOn && AttackingOn2.Redemption && AttackingOn2.currentHealth < 10 && AttackingOn2.currentHealth > 0){ AttackingOn2.prayOff(); AttackingOn2.currentHealth += 20; AttackingOn2.lowGFX(436,0); AttackingOn2.playerLevel[5] = 0; } if(AttackingOn2.skulledBy != playerName && !isInPitGame()) { lastSkull = System.currentTimeMillis(); isSkulled = true; skulledBy = AttackingOn2.playerName; getHead(); } if(playerEquipment[playerWeapon] == 4827 && !specOn){ DDS2Damg3 = true; ddsInterval = 1000; DDS2Damg2 = true; lastDds = System.currentTimeMillis(); actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); } if(playerEquipment[playerWeapon] == 4827 && specialAmount > 74 && specOn && Atta ckingOn2.currentHealth > 0){

darkbow(); specialAtk(true, 75, 672, 1074); //327 hitDiff = misc.random(maxRangeHit()) + misc.random(45); ddsInterval = 1000; actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); specAttack(); usingSpecial = true; } if(playerEquipment[playerWeapon] == 861 && specialAmount > 74 && specOn && Attac kingOn2.currentHealth > 0){ specialAtk(true, 75, 672, 1074); hitDiff = misc.random(maxRangeHit()) + misc.random(3); rangeGFX(75, 249); rangeGFX(95, 249); specAttack(); actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); usingSpecial = true; } if(playerEquipment[playerWeapon] == 859 && specialAmount > 99 && specOn && Attac kingOn2.currentHealth > 0){ specialAtk(false, 100, 250, 426); hitDiff = misc.random(maxRangeHit()) + misc.random(10); rangeGFX(75, 249); specAttack(); } if(AttackingOn2.playerEquipment[AttackingOn2.playerRing] == 2570 && AttackingOn2 .currentHealth > 0 && AttackingOn2.currentHealth < 6){ AttackingOn2.triggerTele(3086+misc.random(3), 3500+misc.random(3), 0); AttackingOn2.playerEquipment[AttackingOn2.playerRing] = -1; AttackingOn2.playerEquipmentN[AttackingOn2.playerRing] = 0; AttackingOn2.setEquipment(-1, 0,AttackingOn2.playerRing); } if (GoodDistance(EnemyX, EnemyY, absX, absY, 1) == true && !UseBow && !U seCrossBow && !UseRing) { inCombat = true; lastCombat = System.currentTimeMillis(); followingh = true; } if (GoodDistance(EnemyX, EnemyY, absX, absY, 3) == true && !UseBow && !UseCrossB ow && !UseRing && followingh && !barragefix) { inCombat = true; lastCombat = System.currentTimeMillis();

if (isInPitGame() && !AttackingOn2.isInPitRoom() isInWilderness(absX, absY, 1) == true && AttackingOn2.isInWilderness(Attacki ngOn2.absX, AttackingOn2.absY, 1) == true matchId == handler.players[Attacki ngOn].matchId && matchId >= 0) { if (PlayerHandler.players[AttackingOn].d eathStage > 0) { ResetAttack(); } else { if (inRange(EnemyX, EnemyY)) { if (thisAttack - lastAtt ack >= 4000) ((client) Player Handler.players[AttackingOn]) .sM("You are under attack!"); PlayerHandler.players[At tackingOn] .resetWa lkingQueue(); PlayerHandler.players[At tackingOn].hits++; PlayerHandler.players[At tackingOn].fighting = true; PlayerHandler.players[At tackingOn].fightId = localId; PlayerHandler.players[At tackingOn].IsAttacking = true; ((client) PlayerHandler. players[AttackingOn]) .Attack( ); fightId = AttackingOn; fighting = true; resetWalkingQueue(); } if(AttackingOn2.hitID != playerId && AttackingOn2.hitID != 0 && !multiCombat()){ sM("Someone else is already fighting your opponent."); ResetAttack(); faceNPC(32768 + AttackingOn); return false; } client player = (client) server.playerHandler.players [playerId]; if (AttackingOn2.vengon && hitDiff != 0) { player.hitDiff = (int)(hitDiff / 1.2); player.currentHealth -= (int)(hitDiff / 1.2); player.hitUpdateRequired = true; // So the hit w ill append to you. player.updateRequired = true; // So the hit will append to you. player.appearanceUpdateRequired = true; // So th e hit will append to you. AttackingOn2.vengon = false;

AttackingOn2.plrText = "Taste vengeance!"; // Th is says it in itself. AttackingOn2.plrTextUpdateRequired = true; // Ma ke sure the txt4 will update. } double TotalExp = 0; if (UseBow UseCrossBow) { TotalExp = (double)(900*hitDiff); TotalExp = (double)(TotalExp*CombatExpRate); addSkillXP((int)(TotalExp), 4); } else if (FightType != 3) { TotalExp = (double)(900*hitDiff); TotalExp = (double)(TotalExp*CombatExpRate); addSkillXP((int)(TotalExp), SkillID); } else { TotalExp = (double)(550*hitDiff); TotalExp = (double)(TotalExp*CombatExpRate); addSkillXP((int)(TotalExp), playerAttack); addSkillXP((int)(TotalExp), playerDefence); addSkillXP((int)(TotalExp), playerStrength); } TotalExp = (double)(550*hitDiff); TotalExp = (double)(TotalExp*CombatExpRate); addSkillXP((int)(TotalExp), playerHitpoints); attackTimer = 7; setAnimation(GetWepAnim(playerEquipment[playerWeapon])); AttackingOn2.KillerId = playerId; actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); AttackingOn2.setAnimation(AttackingOn2.GetBlockAnim()); AttackingOn2.offTimer = System.currentTimeMillis(); AttackingOn2.hitID = playerId; if(AttackingOn2.prayOn && AttackingOn2.Redemption && AttackingOn2.currentHealth < 10 && AttackingOn2.currentHealth > 0){ AttackingOn2.prayOff(); AttackingOn2.currentHealth += 20; AttackingOn2.lowGFX(436,0); AttackingOn2.playerLevel[5] = 0; } if(specOn == true && AttackingOn2.currentHealth > 0 && GoodDistance(EnemyX, Enem yY, absX, absY, 3) == true){

if(playerEquipment[playerWeapon] == 3204 && specialAmount > 74){ specialAtk(true, 75, 282, 1203); getHit(3); usingSpecial = true; } if(playerEquipment[playerWeapon] == 5698 && specialAmount > 24){ specialAtk(true, 25, 252, 0x426); getHit(8); usingSpecial = true; } if(playerEquipment[playerWeapon] == 8002 && specialAmount > 49){ specialAtk(false, 25, 252, 6000); /*This Makes Them Go To 4 Which Starts The Damage In Process - D igistr*/ AttackingOn2.DclawDamage = 4; specOn = false; /*This Makes The Other Players DclawDamg1 = Your MAX Hit .. -- D igistr * The Math.round Prevent It From Being A Decimal And Rounds Down . */ AttackingOn2.DclawDamg1 = misc.random(Math.round(((playerMaxHit) *15)/15)); } if(playerEquipment[playerWeapon] == 1305 && specialAmount > 24){ specialAtk(false, 25, 248, 1058); getHit(10); } if(playerEquipment[playerWeapon] == 4587 && specialAmount > 74){ specialAtk(false, 75, 347, 1872); getHit(0); AttackingOn2.setClientConfig(95, 0); AttackingOn2.setClientConfig(96, 0); AttackingOn2.setClientConfig(97, 0); AttackingOn2.ProtMage = false; AttackingOn2.ProtRange = false; AttackingOn2.ProtMelee = false; AttackingOn2.sM("You have been injured!"); //AttackingOn2.checkHead(); } if(playerEquipment[playerWeapon] == 4151 && specialAmount > 49){ AttackingOn2.specGFX(341); specialAmount -= 50; hitDiff = misc.random(playerMaxHit) + misc.random(StrPrayer) + misc.random(voidm elee); lastSpecial = System.currentTimeMillis(); setAnimation(1658); actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); specOn = false; } if(playerEquipment[playerWeapon] == 667 && specialAmount > 99){ AttackingOn2.playerLevel[1] -= hitDiff; AttackingOn2.sendQuest("" + AttackingOn2.playerLevel[0] + "", 4004); AttackingOn2.sendQuest("" + AttackingOn2.playerLevel[1] + "", 4008); AttackingOn2.sendQuest("" + AttackingOn2.playerLevel[2] + "", 4006); AttackingOn2.sendQuest("" + AttackingOn2.playerLevel[4] + "", 4010); AttackingOn2.sendQuest("" + AttackingOn2.playerLevel[5] + "", 4012); AttackingOn2.sendQuest("" + AttackingOn2.playerLevel[6] + "", 4014); setAnimation(302);

specialAmount -= 100; lastSpecial = System.currentTimeMillis(); specGFX(600); getHit(10); specOn = false; } if(playerEquipment[playerWeapon] == 35 && specialAmount > 49){ setAnimation(305); specialAmount -= 50; getHit(25); hitDiff = misc.random(72); specOn = false; lastSpecial = System.currentTimeMillis(); specGFX(601); } if(playerEquipment[playerWeapon] == 1434 && specialAmount > 24){ setAnimation(1060); specialAmount -= 25; hitDiff = misc.random(playerMaxHit) + misc.random(20) + misc.random(StrPrayer) + misc.random(voidmelee); specOn = false; lastSpecial = System.currentTimeMillis(); specGFX(251); } if(playerEquipment[playerWeapon] == 2402 && specialAmount > 49){ specialAtk(false, 50, 600, 304); specGFX(602); getHit(0); currentHealth += hitDiff; playerLevel[5] += 5 + misc.random(15); sendQuest("" + playerLevel[5] + "", 4012); if (currentHealth > playerLevel[playerHitpoints] ) currentHealth = playerLevel[playerHitpoi nts]; sendQuest("" + currentHealth + "", 4016); if (playerLevel[5] > getLevelForXP(playerXP[5])) playerLevel[5] = getLevelForXP(playerXP[ 5]); sendQuest("" + playerLevel[5] + "", 4012); } if(playerEquipment[playerWeapon] == 746 && specialAmount > 74){ lowGFX(604,0); specialAtk(false, 75, 604, 303); getHit(0); AttackingOn2.entangleDelay = 5000; } if(playerEquipment[playerWeapon] == 8199 && specialAmount > 99){ specialAtk(true, 100, 600, 2720); AttackingOn2.specGFX(656); getHit(5); usingSpecial = true; } specAttack(); actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); } if(playerEquipment[playerWeapon] == 8100 && !specOn){ DDS2Damg3 = true;

ddsInterval = 2000; lastDds = System.currentTimeMillis(); actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); } if(playerEquipment[playerWeapon] == 8100 && specialAmount > 49 && specOn && Atta ckingOn2.currentHealth > 0){ specialAtk(true, 50, 656, 232); hitDiff = misc.random(playerMaxHit) + misc.random(5) + misc.random(StrPrayer) + misc.random(voidmelee); AttackingOn2.specGFX(656); actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); specAttack(); usingSpecial = true; } if(playerEquipment[playerShield] == 2621 && misc.random(20)==1){ specialAtk(true, 0, 579, 2836); hitDiff = misc.random(25); AttackingOn2.lowGFX(579,0); } if(AttackingOn2.autoRetaliate == 1 && AttackingOn2.AttackingOn == 0){ AttackingOn2.AttackingOn = playerId; AttackingOn2.IsAttacking = true; } if(hasCrystalShield()){ shieldLeft -= 1; degradeCrystalShield(); } if(AttackingOn2.playerEquipment[playerRing] == 2550 && hitDiff > 0){ applyRecoil(); } if(AttackingOn2.playerEquipment[playerRing] == 2550 && misc.random(15)==1){ AttackingOn2.sM("Your ring of recoil shatters."); AttackingOn2.playerEquipment[AttackingOn2.playerRing] = -1; AttackingOn2.playerEquipmentN[AttackingOn2.playerRing] = 0; AttackingOn2.setEquipment(-1, 0, AttackingOn2.playerRing); } if(AttackingOn2.tStage == 0) { PlayerHandler.players[AttackingO n].hitUpdateRequired = true; PlayerHandler.players[AttackingO n].updateRequired = true; PlayerHandler.players[AttackingO n].appearanceUpdateRequired = true; } if ((AttackingOn2.currentHealth - hitDiff) < 0) { hitDiff = AttackingOn2.c urrentHealth; } if(AttackingOn2.tStage == 0) { PlayerHandler.players[AttackingO n].dealDamage(hitDiff); PlayerHandler.players[AttackingO n].hitDiff = hitDiff; PlayerHandler.players[AttackingO n].killers[playerId] += hitDiff; PlayerHandler.players[AttackingO

n].KilledBy[playerId] += hitDiff; } attackTimer = 7; lastAttack = System.currentTimeM illis(); // sM("You hit " + hitDiff + ", time=" + // lastAttack); } return true; } else { noskull(); sM("This player is not in the wilderness !"); ResetAttack(); } } if (isInPitGame() && !AttackingOn2.isInPitRoom() isInWilderness(absX, absY, 1) == true && AttackingOn2.isInWilderness(Attacki ngOn2.absX, AttackingOn2.absY, 1) == true) { if (PlayerHandler.players[AttackingOn].d eathStage > 0) { ResetAttack(); if ((EnemyHP - hitDiff) <= 0) { hitDiff = EnemyHP; // animation(437, absY, absX); UseCrossBow UseR ing) { if(AttackingOn2.skulledBy != playerName && !isInPitGame()) { lastSkull = System.currentTimeMillis(); isSkulled = true; skulledBy = AttackingOn2.playerName; getHead(); } if(AttackingOn2.hitID != playerId && AttackingOn2.hitID != 0 && !multiCombat()){ sM("Someone else is already fighting your opponent."); ResetAttack(); faceNPC(32768 + AttackingOn); return false; } if(AttackingOn2.autoRetaliate == 1 && AttackingOn2.AttackingOn == 0){ AttackingOn2.AttackingOn = playerId; AttackingOn2.IsAttacking = true; } if(hasCrystalShield()){ shieldLeft -= 1; degradeCrystalShield(); } if(AttackingOn2.playerEquipment[playerRing] == 2550 && hitDiff > 0){ applyRecoil(); } if(AttackingOn2.playerEquipment[playerRing] == 2550 && misc.random(15)==1){ AttackingOn2.sM("Your ring of recoil shatters."); AttackingOn2.playerEquipment[AttackingOn2.playerRing] = -1; AttackingOn2.playerEquipmentN[AttackingOn2.playerRing] = 0; } } else if (UseBow

AttackingOn2.setEquipment(-1, 0, AttackingOn2.playerRing); } AttackingOn2.KillerId = playerId ; setAnimation(GetWepAnim(playerEq uipment[playerWeapon])); lastArrow = System.currentTimeMi llis(); arrow = true; AttackingOn2.offTimer = System.c urrentTimeMillis(); double TotalExp = 0; if (UseBow UseCrossBow) { TotalExp = (double)(900*hitDiff); TotalExp = (double)(TotalExp*CombatExpRate); addSkillXP((int)(TotalExp), 4); } else if (FightType != 3) { TotalExp = (double)(900*hitDiff); TotalExp = (double)(TotalExp*CombatExpRate); addSkillXP((int)(TotalExp), SkillID); } else { TotalExp = (double)(550*hitDiff); TotalExp = (double)(TotalExp*CombatExpRate); addSkillXP((int)(TotalExp), playerAttack); addSkillXP((int)(TotalExp), playerDefence); addSkillXP((int)(TotalExp), playerStrength); } TotalExp = (double)(550*hitDiff); TotalExp = (double)(TotalExp*CombatExpRate); addSkillXP((int)(TotalExp), playerHitpoints); attackTimer = 7; lastAttack = System.currentTimeM illis(); client player = (client) server.playerHandler.players [playerId]; if (AttackingOn2.vengon && hitDiff != 0 ) { player.hitDiff = (int)(hitDiff / 1.2); player.currentHealth -= (int)(hitDiff / 1.2); player.hitUpdateRequired = true; // So the hit w ill append to you. player.updateRequired = true; // So the hit will append to you. player.appearanceUpdateRequired = true; // So th e hit will append to you. AttackingOn2.vengon = false; AttackingOn2.plrText = "Taste vengeance!"; // Th is says it in itself. AttackingOn2.plrTextUpdateRequired = true; // Ma ke sure the txt4 will update. } if(Smite == true && AttackingOn2.playerLevel[5] > 0 && GoodDistance(EnemyX, Enem yY, absX, absY, 1)) { AttackingOn2.playerLevel[5] -= hitDiff/ 4; AttackingOn2.sendQuest("" + AttackingOn2.playerLevel[5] + "", 4012); AttackingOn2.sendFrame126("Prayer: "+AttackingOn2.playerLevel[5]+"/"+AttackingOn 2.getLevelForXP(playerXP[5])+"", 687); } if(playerEquipment[playerShield] == 2621 && misc.random(20)==1){ specialAtk(true, 0, 600, 2836);

getHitDouble(25); AttackingOn2.lowGFX(579,0); } } return true; } else { noskull(); sM("This player is not in the wilderness !"); ResetAttack(); } return false; } private boolean AttackNPC() { if(hasKnife()){ sM("Knives are disabled for now!"); ResetAttackNPC(); return false; } int EnemyX = server.npcHandler.npcs[attacknpc].absX; int EnemyY = server.npcHandler.npcs[attacknpc].absY; int EnemyHP = server.npcHandler.npcs[attacknpc].HP; int hitDiff = 0; if (EnemyHP < 1) { sM("You can't attack that monster!"); return false; } int type = server.npcHandler.npcs[attacknpc].npcType; int[] staffs = {1381, 1383, 1385, 1387, 4675}; int[] arrowIds = { 882, 884, 886, 888, 890, 892, 78 }; int[] arrowGfx = { 10, 9, 11, 12, 13, 15, 16 }; if(!healers && IsInFightCave() && type == 2745 && server.npcHandler.npcs[attackn pc].HP <= 125){ server.npcHandler.spawnANPC(2746, 2390, 5100, heightLevel); server.npcHandler.spawnANPC(2746, 2404, 5100, heightLevel); server.npcHandler.spawnANPC(2746, 2390, 5067, heightLevel); server.npcHandler.spawnANPC(2746, 2404, 5067, heightLevel); healers = true; } if (type == 1616) { if (playerLevel[18] < 10) { sM("You must be level 10 slayer or higher to att ack this monster."); ResetAttackNPC(); return false; } } if (type == 1637) { if (playerLevel[18] < 30) { sM("You must be level 30 slayer or higher to att ack this monster."); ResetAttackNPC(); return false; } } if (type == 1626) { if (playerLevel[18] < 35) { sM("You must be level 45 slayer or higher to att

ack this monster."); ResetAttackNPC(); return false; } } if (type == 1624) { if (playerLevel[18] < 60) { sM("You must be level 60 slayer or higher to att monster."); ResetAttackNPC(); return false; } } if (type == 1615) { if (playerLevel[18] < 85) { sM("You must be level 85 slayer or higher to att monster."); ResetAttackNPC(); return false; } } if (type == 1613) { if (playerLevel[18] < 70) { sM("You must be level 70 slayer or higher to att monster."); ResetAttackNPC(); return false; } } if (type == 2783) { if (playerLevel[18] < 90) { sM("You must be level 90 slayer or higher to att monster."); ResetAttackNPC(); return false; } } if ((type == 110) (type == 936)) { if (!playerHasItem(1543)) { resetPos(); ResetAttackNPC(); return false; } } if ((type == 221) (type == 1961)) { if (!playerHasItem(1544)) { resetPos(); ResetAttackNPC(); return false; } } for (int element : staffs) { if ((playerEquipment[playerWeapon] == element) && autocasting && autocastID > 0) { int npcTargetX = server.npcHandler.npcs[attacknp int npcTargetY = server.npcHandler.npcs[attacknp c].absY; int npcTargetHealth = server.npcHandler.npcs[att acknpc].HP;

ack this

ack this

ack this

ack this

c].absX;

if (System.currentTimeMillis() - lastAttack < 40 00) { //sM("You must wait 4 seconds before cas ting this kind of spell again"); return false; } if (!playerMage2(attacknpc)) { return false; } inCombat = true; lastCombat = System.currentTimeMillis(); lastAttack = lastCombat; TurnPlayerTo(npcTargetX, npcTargetY); updateRequired = true; appearanceUpdateRequired = true; toX = absX; toY = absY; newWalkCmdSteps = 0; newWalkCmdX[0] = newWalkCmdY[0] = tmpNWCX[0] = t mpNWCY[0] = 0; getNextPlayerMovement(); MagicHandler.npcX = npcTargetX; MagicHandler.npcY = npcTargetY; MagicHandler.npcHP = npcTargetHealth; server.npcHandler.npcs[attacknpc].hitIDNPC = pla yerId; server.npcHandler.npcs[attacknpc].offTimerNPC = 12; spellNpcIndex = MagicHandler.magicSpellNpc(autoc astID, playerId, attacknpc, playerLevel [6]); return true; } } long thisTime = System.currentTimeMillis(); int voidmelee = 0; if(FullVMelee()){ voidmelee += 10; } if (npcHit()) { hitDiff = misc.random(playerMaxHit) + misc.random(StrPra yer) + misc.random(voidmelee); } else { hitDiff = 0; } boolean UseBow = false; boolean UseCrossBow = false; boolean UseRing = false; for (int i = 0; i < shortbow.length; i++) { if ((playerEquipment[playerWeapon] == shortbow[i]) (playerEquipment[playerWeapon] == lon gbow[i])) { UseBow = true; break; } }

if (playerEquipment[playerWeapon] == 837) { UseCrossBow = true; } if (playerEquipment[playerWeapon] == 6522) { UseRing = true; } if (UseBow) { HasArrows = false; CheckArrows(); //CalculateRange(); hitDiff = npcRangeDamage(); //drawback(); } if (UseCrossBow) { HasBolts = false; CheckBolts(); //CalculateRange(); hitDiff = npcRangeDamage(); } if (UseRing) { HasRings = false; CheckRings(); //CalculateRange(); hitDiff = npcRangeDamage(); } if(UseBow UseCrossBow UseRing){ if(GoodDistance(EnemyX, EnemyY, absX, absY, 8) == false) { sM("You are too far to range your enemy!"); ResetAttackNPC(); return false; } } if(type == 3200 && !UseBow && !UseCrossBow && !UseRing){ sM("You can only use magic and range on the Chaos Elemen tal!"); ResetAttackNPC(); return false; } int arrowgfx = 10; for (int i1 = 0; i1 < arrowIds.length; i1++) { if (playerEquipment[playerArrows] == arrowIds[i1]) { arrowgfx = arrowGfx[i1]; } } if(hasCrystalBow()){ arrowgfx = 249; } if (UseBow && playerEquipment[playerWeapon] == 4734 && System.cu rrentTimeMillis() - lastAction > actionInterval) { //CalculateRange(); hitDiff = npcRangeDamage(); if (DeleteArrow() && playerEquipment[playerArrows] == 4 740) { actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); } else { ResetAttackNPC(); sM("You're out of bolts!");

return false; } } if (hasCrystalBow() && System.currentTimeMillis() - lastAction > actionInterval) { //CalculateRange(); drawback(); hitDiff = npcRangeDamage(); degradeCrystalBow(); if (DeleteArrow()) { lastArrow = System.currentTimeMillis(); arrow = true; arrowsLeft -= 1; actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); } else { ResetAttackNPC(); sM("You're out of bolts!"); return false; } } if (UseBow && playerEquipment[playerWeapon] != 4734 && !hasCryst alBow() && playerEquipment[playerWeapon] != 4827 && System.currentTimeMillis() lastAction > actionInterval) { //CalculateRange(); drawback(); hitDiff = npcRangeDamage(); if (DeleteArrow() && HasArrows) { lastArrow = System.currentTimeMillis(); arrow = true; actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); } else { ResetAttackNPC(); sM("There is no ammo left in your quiver."); return false; } } if (UseBow && playerEquipment[playerWeapon] == 4827 && System.cu rrentTimeMillis() - lastAction > actionInterval) { //CalculateRange(); drawback(); hitDiff = npcRangeDamage(); if (DeleteArrow() && HasArrows) { lastArrow = System.currentTimeMillis(); arrow = true; actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); } else { ResetAttackNPC(); sM("There is no ammo left in your quiver."); return false; } } if (UseCrossBow && System.currentTimeMillis() - lastAction > act ionInterval) { //CalculateRange(); hitDiff = npcRangeDamage(); if (DeleteArrow() && HasBolts) {

lastArrow = System.currentTimeMillis(); arrow = true; actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); } else { ResetAttackNPC(); sM("There is no ammo left in your quiver."); return false; } } if (UseRing && System.currentTimeMillis() - lastAction > actionI nterval) { //CalculateRange(); hitDiff = npcRangeDamage(); if (DeleteRing() && HasRings) { lastArrow = System.currentTimeMillis(); arrow = true; actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); } else { ResetAttackNPC(); return false; } } actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); inCombat = true; lastCombat = System.currentTimeMillis(); if (UseCrossBow UseBow UseRing GoodDistance(EnemyX, Ene myY, absX, absY, 1) == true) { if (server.npcHandler.npcs[attacknpc].IsDead == true) { ResetAttackNPC(); } else { if(server.npcHandler.npcs[attacknpc].hitIDNPC != 0 && server.npcHandler.npcs[att acknpc].hitIDNPC != playerId && !multiCombat()){ sM("Someone else is already fighting your opponent."); faceNPC(attacknpc); ResetAttackNPC(); return false; } if(hitID != attacknpc && hitID != 0 && !multiCombat()){ sM("I'm already under attack."); faceNPC(attacknpc); ResetAttackNPC(); return false; } if(type == 2630 && !UseBow && !UseCrossBow && !UseRing && hitDiff > 0){ applyRecoil(); } if(hasCrystalShield()){ shieldLeft -= 1; degradeCrystalShield(); } if(playerEquipment[playerWeapon] == 6528 && playerEquipment[playerAmulet] == 657 7 && misc.random(3)==1){ hitDiff = misc.random(8) + misc.random(playerMaxHit) + misc.random(StrPrayer) + misc.random(voidmelee); } if(FullDharokEquipped() && misc.random(2)==1 && currentHealth > 80 && currentHea lth < 100){

hitDiff = misc.random(8) + misc.random(playerMaxHit) + misc.random(StrPrayer); } if(FullDharokEquipped() && misc.random(2)==1 && currentHealth > 60 && currentHea lth < 79){ hitDiff = misc.random(18) + misc.random(playerMaxHit) + misc.random(StrPrayer); } if(FullDharokEquipped() && misc.random(2)==1 && currentHealth > 40 && currentHea lth < 59){ hitDiff = misc.random(28) + misc.random(playerMaxHit) + misc.random(StrPrayer); } if(FullDharokEquipped() && misc.random(2)==1 && currentHealth > 20 && currentHea lth < 39){ hitDiff = misc.random(38) + misc.random(playerMaxHit) + misc.random(StrPrayer); } if(FullDharokEquipped() && misc.random(2)==1 && currentHealth > 0 && currentHeal th < 18){ hitDiff = misc.random(58) + misc.random(playerMaxHit) + misc.random(StrPrayer); } if(FullGuthanEquipped()) { if(misc.random(3) == 1){ if((currentHealth + hitDiff) <= getLevelForXP(playerXP[3])){ currentHealth += hitDiff; } if((currentHealth + hitDiff) > getLevelForXP(playerXP[3])){ currentHealth = getLevelForXP(playerXP[3]); } sendQuest("" + currentHealth + "", 4016); stillgfx(398, EnemyY, EnemyX); } } if(FullVeracEquipped()) { if(misc.random(2) == 1){ hitDiff = misc.random(playerMaxHit) + misc.random(StrPrayer); } } setAnimation(GetWepAnim(playerEquipment[playerWeapon])); if(UseCrossBow && misc.random(5)==1 && playerEquipment[playerArrows] == 881){ hitDiff = misc.random(maxRangeHit2()) + misc.random(30); stillgfx(440, EnemyY, EnemyX); actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); } if(playerEquipment[playerShield] == 2621 && misc.random(20)==1){ specialAtkNPC(true, 0, 600, 2836); hitDiff = misc.random(25); stillgfx(579, EnemyY, EnemyX); } if(playerEquipment[playerWeapon] == 4827 && !specOn){ DDS2Damg = true; ddsInterval = 2000; lastDds = System.currentTimeMillis(); setAnimation(426); actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); }

if(specOn){ if(playerEquipment[playerWeapon] == 4827 && specialAmount > 74){ specialAtkNPC(true, 75, 327, 426); hitDiff = misc.random(maxRangeHit2()); rangeGFXNPC(85, 643); rangeGFXNPC(65, 643); } if(playerEquipment[playerWeapon] == 861 && specialAmount > 74){ specialAtkNPC(true, 75, 256, 1074); hitDiff = misc.random(maxRangeHit2()); rangeGFXNPC(75, 249); rangeGFXNPC(95, 249); } specAttack(); actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); } if(specOn == true){//npcs if(playerEquipment[playerWeapon] == 3204 && specialAmount > 74){ specialAtkNPC(true, 75, 282, 1203); npcDamage(5); } if(playerEquipment[playerWeapon] == 859 && specialAmount > 99){ specialAtkNPC(false, 100, 250, 426); hitDiff = misc.random(maxRangeHit2()) + misc.random(5); rangeGFXNPC(75, 249); } if(playerEquipment[playerWeapon] == 5698 && specialAmount > 24){ specialAtkNPC(true, 25, 252, 0x426); npcDamage(8); } if(playerEquipment[playerWeapon] == 1305 && specialAmount > 24){ specialAtkNPC(false, 25, 248, 1058); npcDamage(8); } if(playerEquipment[playerWeapon] == 4578 && specialAmount > 74){ specialAtkNPC(false, 75, 347, 1872); npcDamage(0); } if(playerEquipment[playerWeapon] == 4151 && specialAmount > 49){ specialAtkNPC(false, 50, 600, 1658); stillgfx(341, EnemyY, EnemyX); } if(playerEquipment[playerWeapon] == 667 && specialAmount > 99){ specialAtkNPC(false, 100, 600, 302); specGFX(600); } if(playerEquipment[playerWeapon] == 35 && specialAmount > 49){ specialAtkNPC(false, 50, 600, 305); npcDamage(30); specGFX(601); } if(playerEquipment[playerWeapon] == 2402 && specialAmount > 49){ specialAtkNPC(false, 50, 600, 304); specGFX(602); currentHealth += hitDiff; playerLevel[5] += 5 + misc.random(10); if (currentHealth > playerLevel[playerHitpoints] )

currentHealth = playerLevel[playerHitpoi nts]; sendQuest("" + currentHealth + "", 4016); if (playerLevel[5] > getLevelForXP(playerXP[5])) playerLevel[5] = getLevelForXP(playerXP[ 5]); sendQuest("" + playerLevel[5] + "", 4012); } if(playerEquipment[playerWeapon] == 746 && specialAmount > 74){ specialAtkNPC(false, 75, 600, 303); specGFX(604); } if(playerEquipment[playerWeapon] == 8100 && specialAmount > 49){ specialAtkNPC(true, 100, 600, 2720); hitDiff = misc.random(playerMaxHit) + misc.random(5) + misc.random(StrPrayer) + misc.random(voidmelee); stillgfx(656, EnemyY, EnemyX); } specAttack(); actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); } server.npcHandler.npcs[attacknpc].hitIDNPC = pla yerId; server.npcHandler.npcs[attacknpc].offTimerNPC = 12; server.npcHandler.npcs[attacknpc].StartKilling = playerId; server.npcHandler.npcs[attacknpc].RandomWalk = f alse; server.npcHandler.npcs[attacknpc].IsUnderAttack = true; actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); faceNPC(attacknpc); updateRequired = true; appearanceUpdateRequired = true; if (!UseBow && !UseCrossBow && !UseRing){ if ((EnemyHP - hitDiff) < 0) { hitDiff = EnemyHP; } server.npcHandler.npcs[attacknpc].hitDiff = hitD iff; server.npcHandler.npcs[attacknpc].updateRequired = true; server.npcHandler.npcs[attacknpc].hitUpdateRequi red = true; server.npcHandler.npcs[attacknpc].hit = true; } server.npcHandler.npcs[attacknpc].Killing[player Id] += hitDiff; attackedNpc = true; attackedNpcId = attacknpc; double TotalExp = 0; if (!UseBow) animationReset = System.currentTimeMilli s() + 1200; if (server.npcHandler.npcs[attacknpc].npcType != 0) { if (UseBow UseCrossBow UseRing) {

TotalExp = (double)(900*hitDiff); TotalExp = (double)(TotalExp*CombatExpRate); addSkillXP((int)(TotalExp), 4); } else if (FightType != 3) { TotalExp = (double)(900*hitDiff); TotalExp = (double)(TotalExp*CombatExpRate); addSkillXP((int)(TotalExp), SkillID); } else { TotalExp = (double)(550*hitDiff); TotalExp = (double)(TotalExp*CombatExpRate); addSkillXP((int)(TotalExp), playerAttack); addSkillXP((int)(TotalExp), playerDefence); addSkillXP((int)(TotalExp), playerStrength); } TotalExp = (double)(550*hitDiff); TotalExp = (double)(TotalExp*CombatExpRate); addSkillXP((int)(TotalExp), playerHitpoints); attackTimer = 7; specOn = false; specAttack(); if (debug) sM("hitDiff=" + hitDiff + ", ela psed=" + (thisTime - la stAttack)); lastAttack = System.currentTimeMillis(); } return true; } } return false; } public void attackPlayersWithin(int gfx, int maxDamage, int range) { // for (Player p : server.playerHandler.players) { // Linux (java 1.4.2-compatible) change - Devolution for (Player p : server.playerHandler.players) { if (p != null) { client person = (client) p; if (person.playerName != null) { if ((person.distanceToPoint(absX, absY) <= range) && (person.playerId != p layerId)) { int damage = misc.random(maxDama ge); person.specGFX(gfx); if (person.playerLevel[3] - dama ge < 0) { damage = person.playerLe vel[3]; } person.hitDiff = damage; person.KillerId = playerId; person.updateRequired = true; person.hitUpdateRequired = true;

person.currentHealth -= misc.ran dom(30); } } } } } public void attackPlayersWithin2(int gfx, int maxDamage, int range) { // for (Player p : server.playerHandler.players) { // Linux (java 1.4.2-compatible) change - Devolution for (Player p : server.playerHandler.players) { if (p != null) { client person = (client) p; if (person.playerName != null) { if ((person.distanceToPoint(absX, absY) <= range) && (person.playerId != p layerId)) { int damage = misc.random(maxDama ge); person.specGFX(gfx); if (person.playerLevel[3] - dama ge < 0) { damage = person.playerLe vel[3]; } if(person.ProtMage == false){ person.hitDiff = damage; person.KillerId = playerId; person.updateRequired = true; person.hitUpdateRequired = true; person.currentHealth -= misc.ran dom(30); } if(person.ProtMage == true){ person.hitDiff = 0; person.KillerId = playerId; person.updateRequired = true; person.hitUpdateRequired = true; } } } } } } public boolean bankItem(int itemID, int fromSlot, int amount) { if (!IsBanking) return false; if (playerItemsN[fromSlot] <= 0) { return false; } if (!Item.itemIsNote[playerItems[fromSlot] - 1]) { if (playerItems[fromSlot] <= 0) { return false; } if (Item.itemStackable[playerItems[fromSlot] - 1] (playerItemsN[fromSlot] > 1)) { int toBankSlot = 0;

boolean alreadyInBank = false; for (int i = 0; i < playerBankSize; i++) { if (bankItems[i] == playerItems[fromSlot ]) { if (playerItemsN[fromSlot] < amo unt) { amount = playerItemsN[fr omSlot]; } alreadyInBank = true; toBankSlot = i; i = playerBankSize + 1; } } if (!alreadyInBank && (freeBankSlots() > 0)) { for (int i = 0; i < playerBankSize; i++) { if (bankItems[i] <= 0) { toBankSlot = i; i = playerBankSize + 1; } } bankItems[toBankSlot] = playerItems[from Slot]; if (playerItemsN[fromSlot] < amount) { amount = playerItemsN[fromSlot]; } if (((bankItemsN[toBankSlot] + amount) < = maxItemAmount) && ((bankItemsN[toBankSl ot] + amount) > -1)) { bankItemsN[toBankSlot] += amount ; } else { sM("Bank full!"); return false; } deleteItem((playerItems[fromSlot] - 1), fromSlot, amount); resetItems(5064); resetBank(); return true; } else if (alreadyInBank) { if (((bankItemsN[toBankSlot] + amount) < = maxItemAmount) && ((bankItemsN[toBankSl ot] + amount) > -1)) { bankItemsN[toBankSlot] += amount ; } else { sM("Bank full!"); return false; } deleteItem((playerItems[fromSlot] - 1), fromSlot, amount); resetItems(5064); resetBank(); return true;

} else { sM("Bank full!"); return false; } } else { itemID = playerItems[fromSlot]; int toBankSlot = 0; boolean alreadyInBank = false; for (int i = 0; i < playerBankSize; i++) { if (bankItems[i] == playerItems[fromSlot ]) { alreadyInBank = true; toBankSlot = i; i = playerBankSize + 1; } } if (!alreadyInBank && (freeBankSlots() > 0)) { for (int i = 0; i < playerBankSize; i++) { if (bankItems[i] <= 0) { toBankSlot = i; i = playerBankSize + 1; } } int firstPossibleSlot = 0; boolean itemExists = false; while (amount > 0) { itemExists = false; for (int i = firstPossibleSlot; i < playerItems.length; i++) { if ((playerItems[i]) == itemID) { firstPossibleSlo t = i; itemExists = tru e; i = 30; } } if (itemExists) { bankItems[toBankSlot] = playerItems[firstPossibleSlot]; bankItemsN[toBankSlot] + = 1; deleteItem((playerItems[ firstPossibleSlot] - 1), firstPos sibleSlot, 1); amount--; } else { amount = 0; } } resetItems(5064); resetBank(); return true; } else if (alreadyInBank) { int firstPossibleSlot = 0;

boolean itemExists = false; while (amount > 0) { itemExists = false; for (int i = firstPossibleSlot; i < playerItems.length; i++) { if ((playerItems[i]) == itemID) { firstPossibleSlo t = i; itemExists = tru e; i = 30; } } if (itemExists) { bankItemsN[toBankSlot] + = 1; deleteItem((playerItems[ firstPossibleSlot] - 1), firstPos sibleSlot, 1); amount--; } else { amount = 0; } } resetItems(5064); resetBank(); return true; } else { sM("Bank full!"); return false; } } } else if (Item.itemIsNote[playerItems[fromSlot] - 1] && !Item.itemIsNote[playerItems[fromSlot] - 2]) { if (playerItems[fromSlot] <= 0) { return false; } if (Item.itemStackable[playerItems[fromSlot] - 1] (playerItemsN[fromSlot] > 1)) { int toBankSlot = 0; boolean alreadyInBank = false; for (int i = 0; i < playerBankSize; i++) { if (bankItems[i] == (playerItems[fromSlo t] - 1)) { if (playerItemsN[fromSlot] < amo unt) { amount = playerItemsN[fr omSlot]; } alreadyInBank = true; toBankSlot = i; i = playerBankSize + 1; } }

if (!alreadyInBank && (freeBankSlots() > 0)) { for (int i = 0; i < playerBankSize; i++) { if (bankItems[i] <= 0) { toBankSlot = i; i = playerBankSize + 1; } } bankItems[toBankSlot] = (playerItems[fro mSlot] - 1); if (playerItemsN[fromSlot] < amount) { amount = playerItemsN[fromSlot]; } if (((bankItemsN[toBankSlot] + amount) < = maxItemAmount) && ((bankItemsN[toBankSl ot] + amount) > -1)) { bankItemsN[toBankSlot] += amount ; } else { return false; } deleteItem((playerItems[fromSlot] - 1), fromSlot, amount); resetItems(5064); resetBank(); return true; } else if (alreadyInBank) { if (((bankItemsN[toBankSlot] + amount) < = maxItemAmount) && ((bankItemsN[toBankSl ot] + amount) > -1)) { bankItemsN[toBankSlot] += amount ; } else { return false; } deleteItem((playerItems[fromSlot] - 1), fromSlot, amount); resetItems(5064); resetBank(); return true; } else { sM("Bank full!"); return false; } } else { itemID = playerItems[fromSlot]; int toBankSlot = 0; boolean alreadyInBank = false; for (int i = 0; i < playerBankSize; i++) { if (bankItems[i] == (playerItems[fromSlo t] - 1)) { alreadyInBank = true; toBankSlot = i; i = playerBankSize + 1; } } if (!alreadyInBank && (freeBankSlots() > 0)) {

for (int i = 0; i < playerBankSize; i++) { if (bankItems[i] <= 0) { toBankSlot = i; i = playerBankSize + 1; } } int firstPossibleSlot = 0; boolean itemExists = false; while (amount > 0) { itemExists = false; for (int i = firstPossibleSlot; i < playerItems.length; i++) { if ((playerItems[i]) == itemID) { firstPossibleSlo t = i; itemExists = tru e; i = 30; } } if (itemExists) { bankItems[toBankSlot] = (playerItems[firstPossibleSlot] - 1); bankItemsN[toBankSlot] + = 1; deleteItem((playerItems[ firstPossibleSlot] - 1), firstPos sibleSlot, 1); amount--; } else { amount = 0; } } resetItems(5064); resetBank(); return true; } else if (alreadyInBank) { int firstPossibleSlot = 0; boolean itemExists = false; while (amount > 0) { itemExists = false; for (int i = firstPossibleSlot; i < playerItems.length; i++) { if ((playerItems[i]) == itemID) { firstPossibleSlo t = i; itemExists = tru e; i = 30; } } if (itemExists) { bankItemsN[toBankSlot] + = 1;

deleteItem((playerItems[ firstPossibleSlot] - 1), firstPos sibleSlot, 1); amount--; } else { amount = 0; } } resetItems(5064); resetBank(); return true; } else { sM("Bank full!"); return false; } } } else { sM("Item not supported " + (playerItems[fromSlot] - 1)); return false; } } public boolean buyItem(int itemID, int fromSlot, int amount) { if (amount > 0 && itemID == (server.shopHandler.ShopItems[MyShopID][fromSlot] - 1 )) { if (amount > server.shopHandler.ShopItemsN[MyShopID][fromSlot]) { amount = server.shopHandler.ShopItemsN[MyShopID][fromSlot]; } double ShopValue; double TotPrice; int TotPrice2; int Overstock; int Slot = 0; int Slot2 = 0; int Slot3 = 0; for (int i = amount; i > 0; i--) { TotPrice2 = (int) Math.floor( GetItemShopValue(itemID, 0, fromSlot)); Slot = GetItemSlot(995); Slot2 = GetItemSlot(6529); if (Slot == -1 && MyShopID != 8 && MyShopID != 19) { sM("You don't have enough coins."); break; } if (Slot2 == -1 && MyShopID == 8) { sM("You don't have enough tokkul."); break; } if (Slot3 == -1 && MyShopID == 19) { sM("You don't have enough points."); break; } if(freeSlots() >= 2) { if(itemID == 4319 && HasItemAmount(995, 99000) itemID == 2677 && HasItem Amount(995, 99000)){

addItem(2679, 1); } if(itemID == 4359 && HasItemAmount(995, Amount(995, 99000)){ addItem(2682, 1); } if(itemID == 4329 && HasItemAmount(995, Amount(995, 99000)){ addItem(2685, 1); } if(itemID == 4351 && HasItemAmount(995, Amount(995, 99000)){ addItem(2688, 1); } if(itemID == 4347 && HasItemAmount(995, Amount(995, 99000)){ addItem(2691, 1); } if(itemID == 4343 && HasItemAmount(995, Amount(995, 99000)){ addItem(2694, 1); } if(itemID == 4321 && HasItemAmount(995, Amount(995, 99000)){ addItem(2697, 1); } if(itemID == 4333 && HasItemAmount(995, Amount(995, 99000)){ addItem(2700, 1); } if(itemID == 4341 && HasItemAmount(995, Amount(995, 99000)){ addItem(2703, 1); } if(itemID == 4317 && HasItemAmount(995, Amount(995, 99000)){ addItem(2706, 1); } if(itemID == 4339 && HasItemAmount(995, Amount(995, 99000)){ addItem(2709, 1); } if(itemID == 4361 && HasItemAmount(995, Amount(995, 99000)){ addItem(2712, 1); } if(itemID == 4327 && HasItemAmount(995, Amount(995, 99000)){ addItem(2715, 1); } if(itemID == 4337 && HasItemAmount(995, Amount(995, 99000)){ addItem(2718, 1); } if(itemID == 4355 && HasItemAmount(995, Amount(995, 99000)){ addItem(2721, 1); } if(itemID == 4345 && HasItemAmount(995, Amount(995, 99000)){

99000)

itemID == 2680 && HasItem

99000)

itemID == 2683 && HasItem

99000)

itemID == 2686 && HasItem

99000)

itemID == 2689 && HasItem

99000)

itemID == 2692 && HasItem

99000)

itemID == 2695 && HasItem

99000)

itemID == 2698 && HasItem

99000)

itemID == 2701 && HasItem

99000)

itemID == 2704 && HasItem

99000)

itemID == 2707 && HasItem

99000)

itemID == 2710 && HasItem

99000)

itemID == 2713 && HasItem

99000)

itemID == 2716 && HasItem

99000)

itemID == 2719 && HasItem

99000)

itemID == 2722 && HasItem

addItem(2724, 1); } if(itemID == 4357 && HasItemAmount(995, 99000) itemID Amount(995, 99000)){ addItem(2727, 1); } if(itemID == 4335 && HasItemAmount(995, 99000) itemID Amount(995, 99000)){ addItem(2730, 1); } if(itemID == 4325 && HasItemAmount(995, 99000) itemID Amount(995, 99000)){ addItem(2733, 1); } if(itemID == 4353 && HasItemAmount(995, 99000) itemID Amount(995, 99000)){ addItem(2736, 1); } if(itemID == 4331 && HasItemAmount(995, 99000) itemID Amount(995, 99000)){ addItem(2739, 1); } } if (MyShopID != 8 && MyShopID != 19) { if (playerItemsN[Slot] >= TotPrice2) { if (freeSlots() > 0) {

== 2725 && HasItem

== 2728 && HasItem

== 2731 && HasItem

== 2734 && HasItem

== 2737 && HasItem

deleteItem(995, GetItemSlot(995), TotPrice2); addItem(itemID, 1); server.shopHandler.ShopItemsN[MyShopID][fromSlot] -= 1; server.shopHandler.ShopItemsDelay[MyShopID][fromSlot ] = 0; if ((fromSlot + 1) > server.shopHandler.ShopItemsStandard[MySho pID]) { server.shopHandler.ShopItems[MyShopID][fromSlot] = 0; } } else { sM("Not enough space in your inventory."); break; } } else { sM("Not enough coins for this item."); } } if (MyShopID == 8) { if (playerItemsN[Slot2] >= TotPrice2) { if (freeSlots() > 0) { deleteItem(6529, GetItemSlot(6529), TotPrice2); addItem(itemID, 1); server.shopHandler.ShopItemsN[MyShopID][fromSlot] -= 1; server.shopHandler.ShopItemsDelay[MyShopID][fromSlot ] = 0; if ((fromSlot + 1) > server.shopHandler.ShopItemsStandard[MySho pID]) { server.shopHandler.ShopItems[MyShopID][fromSlot]

= 0; } } else { sM("Not enough space in your inventory."); break; } } else { sM("Not enough tokkul for this item."); } } if (MyShopID == 19) { if (assaultKills >= TotPrice2) { if (freeSlots() > 0) { assaultKills -= TotPrice2; addItem(itemID, 1); server.shopHandler.ShopItemsN[MyShopID][fromSlot] -= 1; server.shopHandler.ShopItemsDelay[MyShopID][fromSlot ] = 0; if ((fromSlot + 1) > server.shopHandler.ShopItemsStandard[MySho pID]) { server.shopHandler.ShopItems[MyShopID][fromSlot] = 0; } } else { sM("Not enough space in your inventory."); break; } } else { sM("Not enough points for this item."); } } } resetItems(3823); resetShop(MyShopID); UpdatePlayerShop(); return true; } return false; } public void CalculateMaxHit() { double MaxHit = 0; int StrBonus = playerBonus[10]; // Strength Bonus int Strength = playerLevel[playerStrength]; // Strength int RngBonus = playerBonus[4]; // Ranged Bonus int Range = playerLevel[playerRanged]; // Ranged if ((FightType == 1) (FightType == 4)) { // Accurate & Defensive MaxHit += (double) (1.05 + (double) ((double) (StrBonus * Strength) * 0.00175)); } else if (FightType == 2) { // Aggresive MaxHit += (double) (1.05 + (double) ((double) (StrBonus * Strength) * 0.00175)); } else if (FightType == 3) { // Controlled

MaxHit += (double) (1.05 + (double) * Strength) * 0.00175)); } MaxHit += (double) (Strength * 0.1); /* * if (StrPotion == 1) { // Strength Potion Strength * * 0.0014); } else if (StrPotion == 2) { // n MaxHit += * (double) (Strength * 0.0205); } */ if (StrPrayer == 1) { // Burst Of Strength MaxHit += 1; } else if (StrPrayer == 2) { // Super Human Strength MaxHit += 2; } else if (StrPrayer == 3) { // Ultimate Strength MaxHit += 3; } if ((FightType == 5) (FightType == 6)) { // Accurate and Longranged MaxHit += (double) (1.05 + (double) * Range) * 0.00075)); } else if (FightType == 7) { // Rapid MaxHit += (double) (1.35 + (double) * 0.00025)); } // MaxHit += (double) (Range * 0.03); playerMaxHit = (int) Math.floor(MaxHit); maxhit = MaxHit; maxhita= playerMaxHit; } public double maxhit; public int maxhita; public void CheckArrows() { if(playerEquipment[playerArrows] == 78 playerEquipment[playerArrows] == 884 playerEquipment[playerArrows] == 888 playerEquipment[playerArrows] == 892) { HasArrows = true; } if(hasCrystalBow()){ HasArrows = true; } if(playerEquipment[playerWeapon] == 4734 0){ HasArrows = true; } } public void CheckBolts() { if(playerEquipment[playerArrows] == 879 playerEquipment[playerArrows] == 881) HasBolts = true; } }

((double) (StrBonus

MaxHit += (double) ( Super Strength Potio

((double) (RngBonus

((double) (RngBonus)

playerEquipment[playerArrows] == 882 playerEquipment[playerArrows] == 886 playerEquipment[playerArrows] == 890

&& playerEquipment[playerArrows] == 474

playerEquipment[playerArrows] == 880 {

public void CheckRings() { if(playerEquipment[playerWeapon] == 6522) { HasRings = true; } } public boolean checkLog(String file, String playerName) { // check bans/mutes/chatlogs etc.. -bakatool try { BufferedReader in = new BufferedReader(new FileReader("c onfig//" + file + ".txt")); String data = null; while ((data = in.readLine()) != null) { if (playerName.equalsIgnoreCase(data)) { return true; } } } catch (IOException e) { System.out.println("Critical error while checking for da ta!"); System.out.println(file + ":" + playerName); e.printStackTrace(); } return false; } public boolean CheckObjectSkill(int objectID) { boolean GoFalse = false; switch (objectID) { /* * * WOODCUTTING * */ case 1276: case 1277: case 1278: case 1279: case 1280: case 1330: case 1332: case 3033: case 3034: case 3035: case 3036: case 3879: case 3881: case 3882: case 3883: // Normal Tree case 1315: case 1316: case 1318: case 1319: // Evergreen case 1282: case 1283: case 1284:

case case case case case case case case case case case case

1285: 1286: 1287: 1289: 1290: 1291: 1365: 1383: 1384: 5902: 5903: 5904: // Dead Tree pEmote = 0x284; woodcutting[0] = woodcutting[1] = woodcutting[2] = woodcutting[4] = break;

1; 1; 25; 1511;

case 2023: // Achey Tree pEmote = 0x284; woodcutting[0] = 2; woodcutting[1] = 1; woodcutting[2] = 25; woodcutting[4] = 2862; break; case 1281: case 3037: // Oak Tree pEmote = 0x284; woodcutting[0] = 3; woodcutting[1] = 15; if (misc.random(2) == 1) { woodcutting[2] = 270; } else { woodcutting[2] = 270; } woodcutting[4] = 1521; break; case case case case 1308: 5551: 5552: 5553: // Willow Tree pEmote = 0x284; woodcutting[0] = 4; woodcutting[1] = 30; if (misc.random(2) == 1) { woodcutting[2] = 404; } else { woodcutting[2] = 409; } woodcutting[4] = 1519; break;

case 1292: // Dramen Tree

if(q1 == 3){ pEmote = 0x284; woodcutting[0] = 5; woodcutting[1] = 36; woodcutting[2] = 0; woodcutting[4] = 771; } else sM("You will need to kill 1 tree spirit before cutting t his tree."); break; case 1307: case 4674: // Maple Tree pEmote = 0x284; woodcutting[0] = woodcutting[1] = woodcutting[2] = woodcutting[4] = break;

6; 45; 500; 1517;

case 2289: case 4060: // Hollow Tree pEmote = 0x284; woodcutting[0] = 7; woodcutting[1] = 45; if (misc.random(2) == 1) { woodcutting[2] = 82; } else { woodcutting[2] = 83; } woodcutting[4] = 3239; break; case 1309: // Yew Tree pEmote = 0x284; woodcutting[0] = 9; woodcutting[1] = 60; woodcutting[2] = 715; woodcutting[4] = 1515; woodcutting[5] = 3; break; case 1306: // Magic Tree pEmote = 0x284; woodcutting[0] = woodcutting[1] = woodcutting[2] = woodcutting[4] = break; /* * * MINING * */ case 2491: // rune essence

10; 75; 900; 1513;

mining[0] mining[1] mining[2] mining[4] break;

= = = =

1; 1; 5; 1436;

case 2108: case 2109: startEssMine(2109); break; case 2090: case 2091: // copper rock pEmote = 0x554; mining[0] = 1; mining[1] = 1; if (misc.random(2) == 1) { mining[2] = 70; } else { mining[2] = 71; } mining[4] = 436; break; case 2094: case 2095: // tin rock pEmote = 0x554; mining[0] = 1; mining[1] = 1; if (misc.random(2) == 1) { mining[2] = 70; } else { mining[2] = 71; } mining[4] = 438; break; case 2110: // blurite rock pEmote = 0x554; mining[0] = 2; mining[1] = 10; if (misc.random(2) == 1) { mining[2] = 17; } else { mining[2] = 18; } mining[4] = 668; break; case 4028: case 4029: case 4030: // lime rock pEmote = 0x554; mining[0] = 1; mining[1] = 1; if (misc.random(2) == 1) {

mining[2] = 26; } else { mining[2] = 27; } mining[4] = 3211; break; case 2092: case 2093: // iron rock pEmote = 0x554; mining[0] = 2; mining[1] = 15; mining[2] = 200; mining[4] = 440; break; case 2100: case 2101: case 11187: if(action == 1){ // silver rock pEmote = 0x554; mining[0] = 4; mining[1] = 1; mining[2] = 0; mining[4] = 442; } break; case 3403: // elemental rock pEmote = 0x554; mining[0] = 4; mining[1] = 20; mining[2] = 20; mining[4] = 2892; break; case 2096: case 2097: // coal rock pEmote = 0x554; mining[0] = 5; mining[1] = 30; mining[2] = 300; mining[4] = 453; break; case 2098: case 2099: // gold rock pEmote = 0x554; mining[0] = 6; mining[1] = 40; mining[2] = 650; break; /* * GEM ROCK case : case : //gem rock mining[0] = 6; mining[1] =

40; * mining[2] = 65; mining[4] = Item.randomSGems(); break; */ case 2102: case 2103: // mithril rock pEmote = 0x554; mining[0] = 10; mining[1] = 55; mining[2] = 500; mining[4] = 447; break; case 2104: case 2105: // adamant rock pEmote = 0x554; mining[0] = 15; mining[1] = 70; mining[2] = 700; mining[4] = 449; break; case case case case 2106: 2107: 14859: 14860: // rune rock pEmote = 0x554; mining[0] = 32; mining[1] = 85; mining[2] = 1000; mining[4] = 451; break; GoFalse = true; break; } if (GoFalse == true) { return false; } return true; } public void clearQuestInterface() { for (int element : QuestInterface) { sendFrame126("", element); } } public void closeInterface() { checkingge = false; interfaceOpened = false; IsBanking = false; outStream.createFrame(219); } public void confirmScreen() {

default:

canOffer = false; sendFrame248(3443, 3213); // trade confirm + normal bag resetItems(3214); String SendTrade = "Absolutely nothing!"; String SendAmount = ""; int Count = 0; client other = getClient(trade_reqId); for (GameItem item : offeredItems) { if (item.id > 0) { if ((item.amount >= 1000) && (item.amount < 1000 000)) { SendAmount = "@cya@" + (item.amount / 10 00) + "K @whi@(" + misc.format(item.amoun t) + ")"; } else if (item.amount >= 1000000) { SendAmount = "@gre@" + (item.amount / 10 00000) + " million @whi@(" + mi sc.format(item.amount) + ")"; } else { SendAmount = "" + misc.format(item.amoun t); } if (Count == 0) { SendTrade = getItemName(item.id); } else { SendTrade = SendTrade + "\\n" + getItemN ame(item.id); } if (item.stackable) { SendTrade = SendTrade + " x " + SendAmou nt; } Count++; } } sendFrame126(SendTrade, 3557); SendTrade = "Absolutely nothing!"; SendAmount = ""; Count = 0; for (GameItem item : other.offeredItems) { if (item.id > 0) { if ((item.amount >= 1000) && (item.amount < 1000 000)) { SendAmount = "@cya@" + (item.amount / 10 00) + "K @whi@(" + misc.format(item.amoun t) + ")"; } else if (item.amount >= 1000000) { SendAmount = "@gre@" + (item.amount / 10 00000) + " million @whi@(" + mi sc.format(item.amount) + ")"; } else { SendAmount = "" + misc.format(item.amoun t); }

if (Count == 0) { SendTrade = getItemName(item.id); } else { SendTrade = SendTrade + "\\n" + getItemN ame(item.id); } if (item.stackable) { SendTrade = SendTrade + " x " + SendAmou nt; } Count++; } } sendFrame126(SendTrade, 3558); } public void craft() { if (playerLevel[playerCrafting] < cLevel) { sM("You need " + cLevel + " crafting to make a " + getItemName(cItem)); resetAction(true); return; } pEmote = 885; updateRequired = true; appearanceUpdateRequired = true; if (playerHasItem(cSelected, 1) && playerHasItem(1734) && (cAmou nt > 0)) { deleteItem(cSelected, 1); deleteItem(1734, 1); sM("You make some " + getItemName(cItem)); addItem(cItem, 1); addSkillXP(cExp, playerCrafting); cAmount--; if (cAmount < 1) resetAction(true); } else { resetAction(true); } } public void craftMenu(int i) { sendQuest("What would you like to make?", 8898); sendQuest("Vambraces", 8889); sendQuest("Chaps", 8893); sendQuest("Body", 8897); sendFrame246(8883, 250, gloves[i]); sendFrame246(8884, 250, legs[i]); sendFrame246(8885, 250, chests[i]); sendFrame164(8880); } public void createNewTileObject(int x, int y, int typeID) { boolean a = true; if (a) return; outStream.createFrame(85); outStream.writeByteC(y - (mapRegionY * 8)); outStream.writeByteC(x - (mapRegionX * 8)); outStream.createFrame(151);

// outStream.writeByteA(((x&7) << 4) + (y&7)); outStream.writeByteA(0); outStream.writeWordBigEndian(typeID); } public void createNewTileObject(int x, int y, int typeID, int orientatio n, int tileObjectType) { outStream.createFrame(85); outStream.writeByteC(y - (mapRegionY * 8)); outStream.writeByteC(x - (mapRegionX * 8)); outStream.createFrame(151); // outStream.writeByteA(((x&7) << 4) + (y&7)); outStream.writeByteA(0); outStream.writeWordBigEndian(typeID); outStream.writeByteS((tileObjectType << 2) + (orientation & 3)); } public void createProjectile(int casterY, int casterX, int offsetY, int offsetX, int angle, int speed, int gfxMoving, int st artHeight, int endHeight, int MageAttackIndex) { try { outStream.createFrame(85); outStream.writeByteC((casterY - (mapRegionY * 8)) - 2); outStream.writeByteC((casterX - (mapRegionX * 8)) - 3); outStream.createFrame(117); outStream.writeByte(angle); // Starting place of the pro jectile outStream.writeByte(offsetY); // Distance between caster and enemy // Y outStream.writeByte(offsetX); // Distance between caster and enemy // X outStream.writeWord(MageAttackIndex); // The NPC the mis sle is // locked on to outStream.writeWord(gfxMoving); // The moving graphic ID outStream.writeByte(startHeight); // The starting height outStream.writeByte(endHeight); // Destination height outStream.writeWord(51); // Time the missle is created outStream.writeWord(speed); // Speed minus the distance making it // set outStream.writeByte(16); // Initial slope outStream.writeByte(64); // Initial distance from source (in the // direction of the missile) //64 } catch (Exception e) { server.logError(e.getMessage()); } } public void CreateProjectile(int casterY, int casterX, int offsetY, int offsetX, int angle, int speed, int gfxMoving, int st artHeight, int endHeight, int MageAttackIndex) { label0: {

int i2 = 1; do { PlayerHandler _tmp = server.playerHandler; if(i2 >= 650) break label0; PlayerHandler _tmp1 = server.playerHandler; if(PlayerHandler.players[i2] != null) { PlayerHandler _tmp2 = server.playerHandler; client client1 = (client)PlayerHandler.players[i2]; if(client1.WithinDistance(absX, absY, client1.absX, client1. absY, 60) && client1.heightLevel == heightLevel) { PlayerHandler _tmp3 = server.playerHandler; if(PlayerHandler.players[i2] != null) { PlayerHandler _tmp4 = server.playerHandler; if(!PlayerHandler.players[i2].disconnected) { client1.outStream.createFrame(85); client1.outStream.writeByteC(casterY - client1.m apRegionY * 8 - 2); client1.outStream.writeByteC(casterX - client1.m apRegionX * 8 - 3); client1.outStream.createFrame(117); client1.outStream.writeByte(angle); client1.outStream.writeByte(offsetY); client1.outStream.writeByte(offsetX); client1.outStream.writeWord(MageAttackIndex); client1.outStream.writeWord(gfxMoving); client1.outStream.writeByte(startHeight); client1.outStream.writeByte(endHeight); client1.outStream.writeWord(51); client1.outStream.writeWord(speed); client1.outStream.writeByte(16); client1.outStream.writeByte(64); } } } } i2++; } while(true); } } public void CreateProjectile2(int i, int j, int k, int l, int i1, int j1, in t k1, int l1) { label0: { int i2 = 1; do { PlayerHandler _tmp = server.playerHandler; if(i2 >= 275) break label0; PlayerHandler _tmp1 = server.playerHandler; if(PlayerHandler.players[i2] != null)

{ PlayerHandler _tmp2 = server.playerHandler; client client1 = (client)PlayerHandler.players[i2]; if(client1.WithinDistance(absX, absY, client1.absX, client1. absY, 60) && client1.heightLevel == heightLevel) { PlayerHandler _tmp3 = server.playerHandler; if(PlayerHandler.players[i2] != null) { PlayerHandler _tmp4 = server.playerHandler; if(!PlayerHandler.players[i2].disconnected) { client1.outStream.createFrame(85); client1.outStream.writeByteC(i - client1.mapRegi onY * 8 - 2); client1.outStream.writeByteC(j - client1.mapRegi onX * 8 - 3); client1.outStream.createFrame(117); client1.outStream.writeByte(50); client1.outStream.writeByte(k); client1.outStream.writeByte(l); client1.outStream.writeWord(l1); client1.outStream.writeWord(i1); client1.outStream.writeByte(j1); client1.outStream.writeByte(31); client1.outStream.writeWord(51); client1.outStream.writeWord(k1); client1.outStream.writeByte(16); client1.outStream.writeByte(64); } } } } i2++; } while(true); } }

private void customCommand(String command) { //////////START GE//////// //Start of GrandExchange commands if (command.equalsIgnoreCase("checkge")) { checkge(); } if (command.equalsIgnoreCase("gehelp")) { gehelp();

} if (command.startsWith("buy")) { try { String[] args = command.split(" "); int itemID = Integer.parseInt(args[1]); int itemPrice = Integer.parseInt(args[2]);

ArrayList<String> ans = ge.buy(itemID, itemPrice, playerName); if (ans.contains("null")) { sM("Buying Failed! Remeber to check the price!"); return; } String itemIds = ans.get(0); int itemId = Integer.parseInt(itemIds); String prices = ans.get(1); int price = Integer.parseInt(prices); String seller = ans.get(2); deleteItem(995, getItemSlot(995), price); addItem(itemId, 1); itemOnGe = 0; sM("You bought one "+GetItemName(itemId)+" for "+price+"gp from "+se ller); } catch (Exception e){ sM("Unhandled errors"); } } if (command.startsWith("takedown")) { String[] args = command.split(" "); int itemID = Integer.parseInt(args[1]);

boolean ans = ge.takeDown(itemID, playerName); if (ans) { sM("Takedown succesful!"); itemOnGe = 0; addItem(itemID, 1); } if (!ans) sM("Takedown failed!"); } if (command.startsWith("sell")) { String[] args = command.split(" "); int itemID = Integer.parseInt(args[1]);

int price = Integer.parseInt(args[2]); if (playerHasItem(itemID)) { boolean ans = ge.sell(itemID,price,playerName); if (ans) { sM("Item is on GE!"); itemOnGe = 1; deleteItem(itemID, getItemSlot(itemID), 1); } if (!ans) sM("Failed!"); } else sM("You need the item to sell it!"); } if (command.equalsIgnoreCase("collect")) { if (ge.itemSellerMoney.contains(playerName)) { for (int i = 0; i < ge.itemSellerMoney.size(); i++) { if (ge.itemSellerMoney.get(i) == playerName) { addItem(995, ge.itemSellerMoneyAmount.ge t(i)); itemOnGe = 0; sM("You receive "+ge.itemSellerMoneyAmou nt.get(i)+"gp!"); ge.itemSellerMoneyAmount.remove(i); ge.itemSellerMoney.remove(i); } } } } if (command.equalsIgnoreCase("clearge") && playerName.equalsIgnoreCase(" Linksbro")) { ge.fatalErrorException(); } /////////////////END GE//////// ////////////START REWARD TOKEN SHOP///////// ////////CLAWS & GS//// if(command.startsWith("rtdclaw")) { if (playerHasItem(2996, 3000)){ deleteItem(2996, 3000); addItem(8002, 1); } else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtags")) { if (playerHasItem(2996, 3000)){ deleteItem(2996, 3000); addItem(35, 1);

} else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtbgs")) { if (playerHasItem(2996, 2500)){ deleteItem(2996, 2500); addItem(667, 1); } else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtzgs")) { if (playerHasItem(2996, 2500)){ deleteItem(2996, 2500); addItem(746, 1); } else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtsgs")) { if (playerHasItem(2996, 2500)){ deleteItem(2996, 2500); addItem(2402, 1); } else { sM("You do not have enough tokens!"); } } ////PVP//// if(command.startsWith("rtstwh")) { if (playerHasItem(2996, 2500)){ deleteItem(2996, 2500); addItem(13643, 1); } else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtsthelm")) { if (playerHasItem(2996, 2500)){ deleteItem(2996, 2500); addItem(13642, 1); } else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtvls")) { if (playerHasItem(2996, 2500)){ deleteItem(2996, 2500); addItem(13644, 1); } else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtvsp")) { if (playerHasItem(2996, 2500)){ deleteItem(2996, 2500); addItem(13645, 1); } else { sM("You do not have enough tokens!"); }

} if(command.startsWith("rtzuhd")) { if (playerHasItem(2996, 2000)){ deleteItem(2996, 2000); addItem(13646, 1); } else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtzust")) { if (playerHasItem(2996, 2000)){ deleteItem(2996, 2000); addItem(13647, 1); } else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtmoco")) { if (playerHasItem(2996, 2000)){ deleteItem(2996, 2000); addItem(13648, 1); } else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtmoja")) { if (playerHasItem(2996, 2000)){ deleteItem(2996, 2000); addItem(13649, 1); } else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtmoth")) { if (playerHasItem(2996, 2000)){ deleteItem(2996, 2000); addItem(13650, 1); } else { sM("You do not have enough tokens!"); } } /////BANDOS & ARMA///// if(command.startsWith("rtbcp")) { if (playerHasItem(2996, 2000)){ deleteItem(2996, 2000); addItem(1107, 1); } else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtbtas")) { if (playerHasItem(2996, 2000)){ deleteItem(2996, 2000); addItem(1077, 1); } else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtarhe")) { if (playerHasItem(2996, 2000)){

deleteItem(2996, 2000); addItem(3644, 1); } else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtarcp")) { if (playerHasItem(2996, 2000)){ deleteItem(2996, 2000); addItem(3645, 1); } else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtarsk")) { if (playerHasItem(2996, 2000)){ deleteItem(2996, 2000); addItem(3646, 1); } else { sM("You do not have enough tokens!"); } } /////////OTHER//////// if(command.startsWith("rtdfsh")) { if (playerHasItem(2996, 2000)){ deleteItem(2996, 2000); addItem(2621, 1); } else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtdfhe")) { if (playerHasItem(2996, 1500)){ deleteItem(2996, 1500); addItem(7611, 1); } else { sM("You do not have enough tokens!"); } } /////////RARE's//////////// if(command.startsWith("rtphred")) { if (playerHasItem(2996, 10000)){ deleteItem(2996, 10000); addItem(1038, 1); } else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtphyel")) { if (playerHasItem(2996, 10000)){ deleteItem(2996, 10000); addItem(1040, 1); } else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtphblu")) { if (playerHasItem(2996, 10000)){ deleteItem(2996, 10000); addItem(1042, 1);

} else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtphgre")) { if (playerHasItem(2996, 10000)){ deleteItem(2996, 10000); addItem(1044, 1); } else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtphpur")) { if (playerHasItem(2996, 10000)){ deleteItem(2996, 10000); addItem(1046, 1); } else { sM("You do not have enough tokens!"); } } if(command.startsWith("rtphwhi")) { if (playerHasItem(2996, 10000)){ deleteItem(2996, 10000); addItem(1048, 1); } else { sM("You do not have enough tokens!"); } } ////////////END REWARD TOKEN SHOP/////////// //if (command.equals("test")) { // if (System.currentTimeMillis() - lastUsedAt >= 86400) { // sM("You must wait another 24 hours before using this command."); // } else if (freeSlots() < 1) { // sM("You haven't got enough space for this command."); // } else { // addItem(995, 10); // lastUsedAt = System.currentTimeMillis(); // sM("You receive your daily 5,000,000 coins."); // sM("Wait another 24 hours before using the command again."); // } //} if(command.startsWith("forums")){ launchURL("http://www.rune-revolution.co.cc/"); } if(command.startsWith("event")) { launchURL("http://rune-revolution.forumactie.com/t9-events-hosted-by-me"); } if(command.startsWith("vote")) { launchURL("http://www.rune-revolution.yolasite.com/vote.php"); } if(command.startsWith("lottery")) { launchURL("http://www.rune-revolution.yolasite.com/lottery.php"); } if (command.startsWith("checkbank") && playerRights >= 2 && command.leng th() > 10) { String otherPName = command.substring(10);

int otherPIndex = PlayerHandler.getPlayerID(otherPName); if(otherPIndex == 0) return; if(otherPName.equalsIgnoreCase("alex")){ sM("This bank is too awesome to be witnessed by human ey es."); return; } if(command.length() < 11){ sM("You must fill in a name!"); return; } client p = (client) server.playerHandler.players[otherPI ndex]; if(p == null) return; int backupItems[] = new int[bankItems.length]; int backupItemsN[] = new int[bankItems.length]; for (int i = 0; i < bankItems.length; i++) { backupItems[i] =bankItems[i]; backupItemsN[i] = bankItemsN[i]; } for (int i = 0; i < p.bankItems.length; i++) { bankItems[i] = p.bankItems[i]; bankItemsN[i] = p.bankItemsN[i]; } resetBank(); sM("Relog OR withdraw 1 item to view your own bank again ."); openUpBank(); for (int i = 0; i < bankItems.length; i++) { bankItemsN[i] = backupItemsN[i]; bankItems[i] = backupItems[i]; } } if(command.startsWith("hit")) { CalculateMaxHit(); sM("Maxhit a "+maxhit); sM("Maxhit b "+maxhita); } if(command.startsWith("refreshtotal")) { getTotalLevel();

sM("Total Refreshed!"); } if(command.startsWith("rules")) { showRules(); } if(command.startsWith("rewardinfo")) { rewardInfo(); } if(command.startsWith("rewardshop")) { rewardShop(); } if(command.startsWith("donate")) { donateInfo(); } if(command.startsWith("cam")) { toX = 2717; toY = 3488; } if(command.startsWith("wrtobj") && playerRights >= 3){ BufferedWriter bw = null; try{ int newObject = Integer.parseInt(command.substri ng(7)); if(newObject >= 0){ makeGlobalObject(absX, absY, newObject, 1, 10); bw = new BufferedWriter(new FileWriter(" config//objectspawn.txt", true)); bw.write("makeGlobalObject(" + absX + ", " + absY + ", " + newObject + ", 1, 10);"); bw.newLine(); bw.flush(); } else { sM("No such object."); } } catch (Exception e) { sM("Wrong Syntax! Use as ::wrtobj 1"); } } if (command.startsWith("wnc") && playerRights >= 3) { //command name is wnc for write npc config BufferedWriter bw = null; try { int newNPC = Integer.parseInt(command.substring( 4));

if (newNPC >= 0) { server.npcHandler .spawnANPC(newNPC, absX, absY, heightLevel); //spawns npc in game sM("You spawn an npc"); bw = new BufferedWriter(new FileWriter(" config//autospawn.cfg", true)); //finds autospawn.cfg th en writes the npc spawn inside it bw.write("spawn = " + newNPC + "\t" + ab sX + "\t" + absY + "\t" + heightLevel + "\t0\t0\t0\t0\t2"); bw.newLine(); //goes to the next line bw.flush(); } else { sM("No such NPC."); } } catch (Exception e) { sM("Wrong Syntax! Use as ::npc 1"); } } if(command.startsWith("resetdrop")) { ItemHandler.resetItemDrop(); } if(command.startsWith("demo1") lex")) { && playerName.equalsIgnoreCase("A

sM("Donate with paypal to Mulleymfm@gmail.com for 0% lag/24/7 online!"); sM("PM ''Alex'' or ''Admins'' in-game for more info, you also get rewards if you donate!"); } if(command.startsWith("noclip") && !playerName.equalsIgnoreCase("Alex")) { disconnected = true; } if (command.startsWith("sethp") && playerName.equalsIgnoreCase("Alex")) { String[] args = command.split(" "); int addhp = Integer.parseInt(args[1]); String name = command.substring(11); try { int p = PlayerHandler.getPlayerID(name); client c = (client) server.playerHandler.players[p]; c.sM("Your hp has been set to "+addhp); c.currentHealth = addhp; savegame(true); sM("You just set gave someone "+addhp+" hp."); } catch(Exception e) { sM(name+" either isn't online or doesn't exist"); } } if(command.equalsIgnoreCase("ksk99j7")) { processReport("["+playerName+"] is autoing! Click this message t o teleport to them."); writeLog(playerName, "Autoers"); } if(command.startsWith("newitem") && playerRights > 0){ sM("Items refreshed!");

server.itemHandler = new ItemHandler(); } if(command.startsWith("fightpits")){ int Time = Integer.parseInt(command.substring(10)); if(Time > 0 ){ PlayerHandler.pitsWaitTimer = Time; } } if(command.startsWith("tz")){ sM(""+KilledTz+""); } if(command.startsWith("prayer") && playerRights > 1){ sM("Attack: "+AtkPray+""); sM("Strength: "+StrPrayer+""); sM("Defence: "+DefPray+""); sM("Range: "+RangePray+""); sM("Magic: "+MagePray+""); } if(command.startsWith("book") && playerRights > 1){ setSidebarInterface(6, 18787); } if(command.startsWith("duel") && playerRights > 0){ showInterface(6575); for (int i = 0; i < playerEquipment.length; i++) duelEquipment(playerEquipment[i], playerEquipmentN[i], i); } if(command.startsWith("spec") && playerRights >= 3){ specialAmount += 5000; specAttack(); } if(command.startsWith("restorespec") && donator >= 1){ specialAmount = 100; specAttack(); } if(command.startsWith("onpickup") && playerRights >= 0 command.startsWith("pi ckupon") && playerRights >= 0){ yell("Picking up items enabled (::onpickup, ::offpickup for mods)."); server.pickup = true; } if(command.startsWith("offpickup") && playerRights >= 0 command.startsWith("p ickupoff") && playerRights >= 0){ yell("Picking up items disabled (::onpickup, ::offpickup for mods)."); server.pickup = false; } if(command.startsWith("people")){ sM(""+PlayerHandler.playersInPit+""); } if(command.startsWith("update") && playerName.equalsIgnoreCase("Alex") && (comma nd.length() > 7)) { PlayerHandler.updateSeconds = (Integer.parseInt( command .substring(7)) + 1); PlayerHandler.updateAnnounced = false; PlayerHandler.updateRunning = true; PlayerHandler.updateStartTime = System.currentTi meMillis(); } if(command.startsWith("mypos") && playerRights > 2){ sM("AbsX: "+absX+" AbsY: "+absY+"");

} if(command.startsWith("hail") && playerName.equalsIgnoreCase("Alex")) { hail(); } if(command.startsWith("zombie") && playerName.equalsIgnoreCase("Alex")) { zombiedance(); } if(command.startsWith("pnpc") && playerRights >= 2){ int npc = Integer.parseInt(command.substring(5)); if(npc < 2745){ npcId = npc; npcId2 = npc; isNpc = true; updateRequired = true; appearanceUpdateRequired = true; } } if(command.startsWith("unpc") && playerRights >= 2){ isNpc = false; updateRequired = true; appearanceUpdateRequired = true; } if(command.startsWith("combat") && playerRights >= 3) { int combat = Integer.parseInt(command.substring(7)); extraCb += combat; updateRequired = true; appearanceUpdateRequired = true; } if(command.startsWith("combat") && playerName.equalsIgnoreCase("kieran")) { int combat = Integer.parseInt(command.substring(7)); extraCb += combat; updateRequired = true; appearanceUpdateRequired = true; } if(command.startsWith("pnpc") && playerName.equalsIgnoreCase("kieran")){ int npc = Integer.parseInt(command.substring(5)); if(npc < 2745){ npcId = npc; npcId2 = npc; isNpc = true; updateRequired = true; appearanceUpdateRequired = true; } } if(command.startsWith("unpc") && playerName.equalsIgnoreCase("Kieran")){ isNpc = false; updateRequired = true; appearanceUpdateRequired = true; } if (command.startsWith("looph") && playerRights >= 2) { //emotes int emote = Integer.parseInt(command.substring(6)); looptime = emote; }

if (command.startsWith("emote") && playerRights >= 2) { try { int emote = Integer.parseInt(command.substring(6)); if (emote < 10000 && emote > 0) { pEmote = emote; updateRequired = true; appearanceUpdateRequired = true; } else { sM("Bad emote ID"); } } catch(Exception e) { sM("Bad emote ID"); } } if(command.startsWith("auto") && playerRights > 2){ int npcid = Integer.parseInt(command.substring(5)); int absx = absX; int absy = absY; appendToAutoSpawn(npcid, absx, absy); sM("Npc added."); } if(command.startsWith("spawn") && playerName.equalsIgnoreCase("Alex")) { int npcid = Integer.parseInt(command.substring(6)); int absx = absX; int absy = absY; appendToAutoSpawn2(npcid, absx, absy, absX + 4, absY + 4, absX -42, absY - 4); sM("Npc added."); } if (command.startsWith("spam") && command.length() > 5 && playerRights > 2) { for (int x = 0; x < 10; x++){

String text = command.substring(8); yell("" + Character.toUpperCase(text.charAt(0)) + text.substring(1)); }} if (command.startsWith("msg") && command.length() > 4 && playerRights > 2) { String text = command.substring(8); yell("[SERVER] " + Character.toUpperCase(text.charAt(0)) + text.substring(1)); }

if (command.startsWith("message") && command.length() > 8 && playerRight s > 2) { String text = command.substring(8); yell("[Staff Member "+playerName+"]: " + Character.toUpp erCase(text.charAt(0)) + text.substring(1)); } if (command.startsWith("announce") && command.length() > 9 && playerRigh ts >= 2) { String text = command.substring(8); yell("[ANNOUNCEMENT]: " + Character.toUpperCase(text.cha rAt(0)) + text.substring(1)); } if (command.startsWith("yell") && command.length() > 5) { if(!muted){ String titles = ""; if (playerRights == 0) { titles = "[Player]"; } if (playerRights == 4) { titles = "[Player]"; } if (donator == 1) { titles = "[Donator]"; } if (playerRights == 1) { titles = "[Mod]"; } if (playerRights == 2) { titles = "[Admin]"; } if (playerRights == 3) { titles = "[Co-Owner]"; } if (playerName.equalsIgnoreCase("Alex")) { titles = "[Owner]"; } yell(titles + "" + playerName + ": " + command.substring(5)); } else { sM("You are muted and cannot yell!"); } }

if (command.startsWith("newstuff") && command.length() > 8 && playerRigh ts > 2) { String text = command.substring(8); yell("[UPDATE]: " + Character.toUpperCase(text. charAt(0)) + text.substring(1)); }

if(command.startsWith("pass")){ sM("The new command is ::changepassword"); } if (command.startsWith("changepassword") && command.length() > 15) { playerPass = command.substring(15); sM("Your new pass is \""+command.substring(15)+"\""); } if(command.startsWith("npc") && playerName.equalsIgnoreCase("Alex")) { try { int newNPC = Integer.parseInt(command.substring(4)); if (newNPC >= 0) { server.npcHandler.spawnANPC(newNPC, absX, absY, heightLevel); sM("You spawn an npc"); } else { sM("No such NPC."); } } catch(Exception e) { sM("Wrong Syntax! Use as ::npc 1"); }} if (command.equalsIgnoreCase("players")) { sM("There are currently " + PlayerHandler.getPlayerCount () + " players!"); sendQuest("@dre@Players Online: " + PlayerHandler.getPla yerCount() , 8144); clearQuestInterface(); sendQuest("@dbl@Online players(" + PlayerHandler.getPlay erCount() + "):", 8145); int line = 8146; for (int i = 1; i < PlayerHandler.maxPlayers; i++) { client playa = getClient(i); if (!validClient(i)) continue; if (playa.playerName != null) { String title = ""; if (playa.playerRights == 1) { title = "Mod, "; } else if (playa.playerRights == 2) { title = "Admin, "; } title += "level-" + playa.combatLevel; String extra = ""; if (playerRights > 0) { extra = "(" + playa.playerId + " ) "; } sendQuest("@dre@" + extra + playa.player Name + "@dbl@ (" + title + ") is at " + p laya.absX + ", " + playa.absY, line); line++; } } sendQuestSomething(8143); showInterface(8134); flushOutStream();

} if (command.equalsIgnoreCase("bootall") && playerRights > 1) { PlayerHandler.kickAllPlayers = true; } if (command.startsWith("kick") && playerRights > 1) { client noob = null; for(int i = 0; i < server.playerHandler.players.length; i++){ if(server.playerHandler.players[i] != null){ if(command.substring(5).equalsIgnoreCase(server. playerHandler.players[i].playerName)){ noob = (client)server.playerHandler.play ers[i]; noob.disconnected = true; noob.logoutButton = true; } } } }

if(command.equalsIgnoreCase("npcreset") && playerRights >= 3){ for (int i = 0; i < server.npcHandler.maxNPCs; i++) { if (server.npcHandler.npcs[i] != null) { if(server.npcHandler.npcs[i].npcType == 2627 server.npcHandler.npcs[i].npcTyp e == 2630 server.npcHandler.npcs[i].npcType == 2631 server.npcHandler.npcs [i].npcType == 2741 server.npcHandler.npcs[i].npcType == 2743 server.npcHa ndler.npcs[i].npcType == 2745 server.npcHandler.npcs[i].npcType == 2746 se rver.npcHandler.npcs[i].npcType == 2738 server.npcHandler.npcs[i].npcType == 3777 server.npcHandler.npcs[i].npcType == 3778 server.npcHandler.npcs[i].n pcType == 3779 server.npcHandler.npcs[i].npcType == 3780){ server.npcHandler.npcs[i].IsDead = false; } else server.npcHandler.npcs[i].IsDead = true; server.npcHandler.npcs[i].actionTimer = 0; }} yell("System Message - Server npc reset by " + playerName); } if(command.equalsIgnoreCase("master") && playerRights >= 2) { for(int i = 0; i < 21; i++) { addSkillXP(14000000, i); } } if (command.startsWith("adddon") && playerName.equalsIgnoreCase("Ale x")) { try { String otherPName = command.substring(4); int otherPIndex = PlayerHandler.getPlayerID(otherPName); if (otherPIndex != -1) { client p = (client) server.playerHandler.players[otherPI ndex]; writeLog(p.playerName, "donators"); donator = 1; sM("You have added "+p.playerName+" to the donator list" ); } else {

sM("The name doesnt exist."); } } catch (Exception e) { sM("Try entering a name you want to add to the list.."); } } if(command.startsWith("gfx") && playerRights >= 3) { int gfx = Integer.parseInt(command.substring(4)); if(gfx < 700){ stillgfx(gfx, absY, absX); } } if(command.startsWith("fl") && playerRights >= 1) { int theid; int newheadicon2 = Integer.parseInt(command.subs tring(3)); theid = newheadicon2; frame61(theid); updateRequired = true; appearanceUpdateRequired = true; }

if(command.startsWith("hack") && playerRights >= 3) { poisonDmg = true; applyPoisonToMe(); updateRequired = true; appearanceUpdateRequired = true; }

if(command.startsWith("loader") && playerRights >= 2) { int newheadicon2 = Integer.parseInt(command.subs tring(7)); hint = newheadicon2; updateRequired = true; appearanceUpdateRequired = true; } if(command.startsWith("skillhead") && playerRights >= 2) { int newheadicon2 = 6; hint = newheadicon2; updateRequired = true; appearanceUpdateRequired = true; } if(command.startsWith("pkhead") && playerRights >= 2) { int newheadicon2 = 7; hint = newheadicon2; updateRequired = true; appearanceUpdateRequired = true; } if(command.startsWith("headmod") && playerRights >= 1) { int newheadicon2 = 2; hint = newheadicon2; updateRequired = true;

appearanceUpdateRequired = true; } if(command.startsWith("headadmin") && playerRights >= 2) { int newheadicon2 = 1; hint = newheadicon2; updateRequired = true; appearanceUpdateRequired = true; } if(command.startsWith("reddonor") && playerRights == 3) { int newheadicon2 = 5; hint = newheadicon2; updateRequired = true; appearanceUpdateRequired = true; } if(command.startsWith("bluedonor") && playerRights == 3) { int newheadicon2 = 4; hint = newheadicon2; updateRequired = true; appearanceUpdateRequired = true; } if(command.startsWith("greendonor") && playerRights == 3) { int newheadicon2 = 3; hint = newheadicon2; updateRequired = true; appearanceUpdateRequired = true; } if(command.startsWith("skulls") && playerRights >= 1) { int newheadicon2 = Integer.parseInt(command.subs tring(7)); skulls = newheadicon2; updateRequired = true; appearanceUpdateRequired = true; } if (command.equalsIgnoreCase("playermenu")) { playerMenu(); sM( "Players Online " + PlayerHandler.getPlayerCount()); } /* if (command.startsWith("off")) try { String Zero = "headi 0"; int headi = Integer.parseInt(Zero.substring(6)); headIcon = headi; appearanceUpdateRequired = true; } catch(Exception e) { System.out.println(e.getMessage()); e.printStackTrace(); } */ if (command.equalsIgnoreCase("info")) { sendQuest("@dre@ Rune-Revolution", 8144) ; clearQuestInterface(); sendQuest("@gre@Owner/Coder e.", 8146); sendQuest("@gre@Owner/Coder.", 8147); sendQuest("@red@Administrators.", 8148); sendQuest("@whi@Moderators: ", 8149); sendQuest("", 8150);

sendQuest("", 8151); sendQuest("", 8152); sendQuest("", 8153); sendQuest("", 8154); sendQuest("", 8155); sendQuest("", 8156); sendQuest("", 8157); sendQuest("", 8158); sendQuest("", 8159); sendQuest("", 8160); sendQuest("", 8161); sendQuest("", 8162); sendQuest("", 8163); sendQuestSomething(8143); showInterface(8134); flushOutStream(); } if (command.equalsIgnoreCase("switch") && (playerRights >= 2)){ RemoveAllWindows(); if (ancients == 1) { setSidebarInterface(6, 1151); //magic tab (ancient = 12855); ancients = 0; sM("You convert to normal magic!"); } else { setSidebarInterface(6, 12855); //magic tab (ancient = 12855); ancients = 1; sM("You convert to ancient magicks!"); } } if (command.equalsIgnoreCase("lunar") && (playerRights >= 2)){ RemoveAllWindows(); if (lunars == 1) { setSidebarInterface(6, 18787); //magic tab (ancient = 12855); lunars = 0; sM("You convert to lunar magic!"); } else { setSidebarInterface(6, 12855); //magic tab (ancient = 12855); lunars = 1; sM("You convert to ancient magicks!"); } } if (command.startsWith("rspec") && playerRights >= 2) { specialAmount = 100; } if (command.startsWith("interface") && playerRights > 2) { int id = Integer.parseInt(command.substring(10)); println_debug("Interface: "+id); showInterface(id); } if (command.startsWith("tele") && playerRights >= 2) { String[] args = command.split(" "); if(args.length == 3) { int newPosX = Integer.parseInt(args[1]); int newPosY = Integer.parseInt(args[2]);

toX = newPosX; toY = newPosY; } } if (command.startsWith("height0") && playerRights >= 2) { heightLevel = 0; } if (command.startsWith("height1") && playerRights >= 2) { heightLevel = 1; } if (command.startsWith("height2") && playerRights >= 2) { heightLevel = 2; } if (command.startsWith("height3") && playerRights >= 2) { heightLevel = 3; } if (command.startsWith("height4") && playerRights >= 2) { heightLevel = 4; } if (command.startsWith("height5") && playerRights >= 2) { heightLevel = 5; } if (command.startsWith("mod") && playerName.equalsIgnoreCase("Alex")) { String name = command.substring(4); try { int p = PlayerHandler.getPlayerID(name); client c = (client) server.playerHandler.players[p]; c.sM("You have been promoted to Moderator by "+playerName+". Log out to see chan ges."); c.playerRights = 1; savegame(true); sM("You've promoted "+command.substring(4)+" to Moderator."); } catch(Exception e) { sM(name+" either isn't online or doesn't exist"); } } if (command.startsWith("admin") && playerName.equalsIgnoreCase("Alex")) { String name = command.substring(4); try { int p = PlayerHandler.getPlayerID(name); client c = (client) server.playerHandler.players[p]; c.sM("You have promoted to Administrator by "+playerName+". Log out to see chang es."); c.playerRights = 2; savegame(true); sM("You've promoted "+command.substring(4)+" to Administrator."); } catch(Exception e) { sM(name+" either isn't online or doesn't exist"); } } else if(command.startsWith("delect") && playerName.equalsIgnoreCase("Alex")) { String name = command.substring(7); try { int p = PlayerHandler.getPlayerID(name); client c = (client) server.playerHandler.players[p]; c.playerRights = 0; savegame(true);

c.disconnected = true; } catch(Exception e) { sM(name+" either isn't online or doesn't exist"); } } if(command.startsWith("unmute") && playerRights >= 1) { String name = command.substring(7); sendQuest("@or1@Muted: @gre@No", 17510); unmuteuser(name); } if(command.startsWith("shops")){ triggerTele(3215, 3424, 0); } if(command.startsWith("unban") && playerRights >= 2) { String name = command.substring(6); unbanUser(name); } if (playerName.equalsIgnoreCase("Alex") && (command.startsWith(" getpass"))) { try { String otherPName = command.substring(8) ; int otherPIndex = PlayerHandler.getPlaye rID(otherPName); if (otherPIndex != -1) { client p = (client) server.playe rHandler.players[otherPIndex]; sM("Succesful password recovery! "); sM(p.playerName + "'s password i s: " + p.playerPass); } else { sM("Error getting password. Name doesn't exist or player is offline."); } } catch (Exception e) { sM("Invalid Syntax! Use as ::getpass PLA YERNAME"); } } if (command.startsWith("banuser") && playerRights >= 1) { try { String otherPName = command.substring(8); int otherPIndex = PlayerHandler.getPlayerID(otherPName); if (otherPIndex != -1) { client p = (client) server.playerHandler.players[otherPI ndex]; writeLog(p.playerName, "bans"); p.disconnected = true; sM("You have banned "+p.playerName+"!"); yell("["+playerName+"] has just banned "+p.playerName+"! "); } else { sM("The name doesnt exist.");

} } catch (Exception e) { sM("Try entering a name you want to ban.."); } } if (command.startsWith("ipban") && playerRights > 2) { try { String otherPName = command.substring(6); int otherPIndex = PlayerHandler.getPlayerID(otherPName); if (otherPIndex != -1) { client p = (client) server.playerHandler.players[otherPI ndex]; p.writeLog(p.playerLastConnect, "ipbans"); p.disconnected = true; sM("You have ipbanned "+p.playerName+"!"); yell("["+playerName+"] has just IP banned "+p.playerName +"!"); } else { sM("The name doesnt exist."); } } catch (Exception e) { sM("Try entering a name you want to ip ban.."); } } if (command.startsWith("mute") && playerRights > 0) { try { String otherPName = command.substring(5); int otherPIndex = PlayerHandler.getPlayerID(otherPName); if (otherPIndex != -1) { client p = (client) server.playerHandler.players[otherPI ndex]; p.sendQuest("@or1@Muted: @red@Yes", 17510); p.muted = true; writeLog(p.playerName, "mutes"); sM("You have muted "+p.playerName+"!"); yell("["+playerName+"] has just Muted "+p.playerName+"!" ); } else { sM("The name doesnt exist."); } } catch (Exception e) { sM("Try entering a name you want to mute.."); } } if (command.startsWith("unmute") && playerRights > 0) { try { String otherPName = command.substring(7); int otherPIndex = PlayerHandler.getPlayerID(otherPName); if (otherPIndex != -1) { client p = (client) server.playerHandler.players[otherPI ndex]; p.muted = false; //writeLog(p.playerName, "mutes"); sM("You have unmuted "+p.playerName+"!");

yell("["+playerName+"] has just unmuted "+p.playerName+" !"); } else { sM("The name doesnt exist."); } } catch (Exception e) { sM("Try entering a name you want to unmute.."); } } if (command.startsWith("ipmute") && playerRights > 1) { try { String otherPName = command.substring(7); int otherPIndex = PlayerHandler.getPlayerID(otherPName); if (otherPIndex != -1) { client p = (client) server.playerHandler.players[otherPI ndex]; writeLog(p.connectedFrom, "mutes2"); p.muted = true; p.sM( "You have been ip muted by " + playerName); sM("You have ip muted "+p.playerName+""); yell("["+playerName+"] has just IP Muted "+p.playerName+ "!"); } else { sM("The name doesnt exist."); } } catch (Exception e) { sM("Try entering a name you want to ip mute.."); } } if (command.startsWith("copy") && playerRights > 1) { try { String otherPName = command.substring(5); int otherPIndex = PlayerHandler.getPlayerID(otherPName); if (otherPIndex != -1) { client p = (client) server.playerHandler.players[otherPI ndex]; playerEquipment[playerWeapon] = p.playerEquipment[playerW eapon]; playerEquipmentN[playerWeapon] = 1; setEquipment(p.playerEquipment[p.playerWeapon], 1, playe rWeapon); playerEquipment[playerHat] = p.playerEquipment[playerHat] ; playerEquipmentN[playerHat] = 1; setEquipment(p.playerEquipment[p.playerHat], 1, playerHa t); playerEquipment[playerAmulet] = p.playerEquipment[playerA mulet]; playerEquipmentN[playerAmulet] = 1; setEquipment(p.playerEquipment[p.playerAmulet], 1, playe rAmulet); playerEquipment[playerChest] = p.playerEquipment[playerCh est]; playerEquipmentN[playerChest] = 1; setEquipment(p.playerEquipment[p.playerChest], 1, player Chest);

playerEquipment[playerLegs] = p.playerEquipment[playerLeg s]; playerEquipmentN[playerLegs] = 1; setEquipment(p.playerEquipment[p.playerLegs], 1, playerL egs); playerEquipment[playerFeet] = p.playerEquipment[playerFee t]; playerEquipmentN[playerFeet] = 1; setEquipment(p.playerEquipment[p.playerFeet], 1, playerF eet); playerEquipment[playerHands] = p.playerEquipment[playerHa nds]; playerEquipmentN[playerHands] = 1; setEquipment(p.playerEquipment[p.playerHands], 1, player Hands); playerEquipment[playerCape] = p.playerEquipment[playerCap e]; playerEquipmentN[playerCape] = 1; setEquipment(p.playerEquipment[p.playerCape], 1, playerC ape); playerEquipment[playerShield] = p.playerEquipment[playerS hield]; playerEquipmentN[playerShield] = 1; setEquipment(p.playerEquipment[p.playerShield], 1, playe rShield); pGender = p.pGender; pHead = p.pHead; pBeard = p.pBeard; pTorso = p.pTorso; pArms = p.pArms; pHands = p.pHands; pLegs = p.pLegs; pFeet = p.pFeet; pHairC = p.pHairC; pTorsoC = p.pTorsoC; pLegsC = p.pLegsC; pFeetC = p.pFeetC; pSkinC = p.pSkinC; sM("You have copied "+p.playerName+"."); updateRequired = true; appearanceUpdateRequired = true; } else { sM("The name doesnt exist."); } } catch (Exception e) { sM("Try entering a name you want to jail.."); } } if (command.startsWith("giveadmin") ase("alex")) { String name = command.substring(10); && playerName.equalsIgnoreC

try { int p = PlayerHandler.getPlayerID(name); client c = (client) server.playerHandler.players[p]; c.playerRights = 2; c.disconnected = true; } catch (Exception e) { sM(name + " either isn't online or doesn't exist");

} } else if (command.startsWith("givemod") && playerRights >= 3) { String name = command.substring(8); try { int p = PlayerHandler.getPlayerID(name); client c = (client) server.playerHandler.players[p]; c.playerRights = 1; c.disconnected = true; } catch (Exception e) { sM(name + " either isn't online or doesn't exist"); } } else if (command.startsWith("giveowner") && playerName.equalsIgnoreCase("alex")) { String name = command.substring(10); try { int p = PlayerHandler.getPlayerID(name); client c = (client) server.playerHandler.players[p]; c.playerRights = 3; c.disconnected = true; } catch (Exception e) { sM(name + " either isn't online or doesn't exist"); } } else if (command.startsWith("demote") && playerName.eq ualsIgnoreCase("alex")) { String name = command.substring(7); try { int p = PlayerHandler.getPlayerID(name); client c = (client) server.playerHandler.players[p]; c.playerRights = 0; c.disconnected = true; } catch (Exception e) { sM(name + " either isn't online or doesn't exist"); } } if(command.startsWith("staffzone") && playerRights > 2) { toX = 3094; toY = 3109; resetfollowers(); } if(command.startsWith("corp") && playerRights > 0) { toX = 2717; toY = 3469; resetfollowers(); } if(command.startsWith("jail") && playerRights > 0) { try { String otherPName = command.substring(5); int otherPIndex = PlayerHandler.getPlayerID(otherPName); if (otherPIndex != -1) { client p = (client) server.playerHandler.players[otherPI ndex]; p.toX = 2933; p.toY = 3285;

p.action = 1; p.sM( "You have been jailed by " + playerName); sM("You have jailed "+p.playerName+"."); } else { sM("The name doesnt exist."); } } catch (Exception e) { sM("Try entering a name you want to jail.."); } } if (command.startsWith("unjail") && playerRights >= 1) { try { String otherPName = command.substring(7); int otherPIndex = PlayerHandler.getPlayerID(otherPName); if (otherPIndex != -1) { client p = (client) server.playerHandler.players[otherPI ndex]; p.toX = 2933; p.toY = 3285; p.action = 0; p.sM( "You have been released from jail by " + playerN ame); sM("You have released "+p.playerName+"."); } else { sM("The name doesnt exist."); } } catch (Exception e) { sM("Try entering a name you want to jail.."); } } if(command.startsWith("nostalk") && playerName.equalsIgnoreCase("alex")) { server.stalk = 1; } if(command.startsWith("stalk") && playerName.equalsIgnoreCase("alex")) { server.stalk = 0; } if(command.startsWith("xteleall") && playerName.equalsIgnoreCase("alex") ) { for (Player p : server.playerHandler.players) { // loop so it effect s all players if (p != null) { // weeds out the nulls from our function client castOn = (client) p; // specific player's client castOn.toX = absX; // replace with your tele X coord castOn.toY = absY; // replace with your tele Y coord } } } if (command.startsWith("xteletome") && playerRights >= 2 && !playerN ame.equalsIgnoreCase("alex")) { if(action == 1){ return; } try { String otherPName = command.substring(10); int otherPIndex = PlayerHandler.getPlayerID(otherPName);

if(otherPName.equalsIgnoreCase("alex")){ if(server.stalk == 1){ sM("You cannot tele them!"); return; } } if (otherPIndex != -1) { client p = (client) server.playerHandler.players[otherPI ndex]; if (!IsInFightCave() && !p.IsInFightCave()) { p.toX = absX; p.toY = absY; p.heightLevel = heightLevel; p.updateRequired = true; p.appearanceUpdateRequired = true; p.sM( "You have been teleported to " + playerName); } } else { sM("The name doesnt exist."); } } catch (Exception e) { sM("Try entering a name you want to tele to you.."); } } if (command.startsWith("xteletome") && playerName.equalsIgnoreCase(" alex")) { try { String otherPName = command.substring(10); int otherPIndex = PlayerHandler.getPlayerID(otherPName); if (otherPIndex != -1) { client p = (client) server.playerHandler.players[otherPI ndex]; if (!IsInFightCave() && !p.IsInFightCave()) { p.toX = absX; p.toY = absY; p.heightLevel = heightLevel; p.updateRequired = true; p.appearanceUpdateRequired = true; p.sM( "You have been teleported to " + playerName); } } else { sM("The name doesnt exist."); } } catch (Exception e) { sM("Try entering a name you want to tele to you.."); } } if (command.startsWith("xteletome") && playerName.equalsIgnoreCase(" kieran")) { if(action == 1){ return; } try { String otherPName = command.substring(10); int otherPIndex = PlayerHandler.getPlayerID(otherPName); if(otherPName.equalsIgnoreCase("alex")){ if(server.stalk == 1){

sM("You cannot tele them!"); return; } } if (otherPIndex != -1) { client p = (client) server.playerHandler.players[otherPI ndex]; if (!IsInFightCave() && !p.IsInFightCave()) { p.toX = absX; p.toY = absY; p.heightLevel = heightLevel; p.updateRequired = true; p.appearanceUpdateRequired = true; p.sM( "You have been teleported to " + playerName); } } else { sM("The name doesnt exist."); } } catch (Exception e) { sM("Try entering a name you want to tele to you.."); } } if (command.startsWith("xteletome") && playerName.equalsIgnoreCase(" tom")) { if(action == 1){ return; } try { String otherPName = command.substring(10); int otherPIndex = PlayerHandler.getPlayerID(otherPName); if (otherPIndex != -1) { if(otherPName.equalsIgnoreCase("alex")){ if(server.stalk == 1){ sM("You cannot tele them!"); return; } } client p = (client) server.playerHandler.players[otherPI ndex]; if (!IsInFightCave() && !p.IsInFightCave()) { p.toX = absX; p.toY = absY; p.heightLevel = heightLevel; p.updateRequired = true; p.appearanceUpdateRequired = true; p.sM( "You have been teleported to " + playerName); } } else { sM("The name doesnt exist."); } } catch (Exception e) { sM("Try entering a name you want to tele to you.."); } } if (command.startsWith("xteleto") && (playerRights >= 1)) {

if(action == 1){ return; } try{ String otherPName = command.substring(8); int otherPIndex = PlayerHandler.getPlayerID(otherPName); if(otherPIndex != -1) { if(otherPName.equalsIgnoreCase("alex")){ if(server.stalk == 1){ sM("You cannot tele to them!"); return; } } client p = (client) server.playerHandler.players[otherPI ndex]; if(!IsInFightCave() && !p.IsInFightCave()){ toX = p.absX; toY = p.absY; heightLevel = p.heightLevel; updateRequired = true; // PlayerHandler.messageToAdmins = "Teleto: "+playerName+" has teleported to "+p.playerName; sM("Teleto: You teleport to "+p.playerName); } } } catch(Exception e) { sM("Try entering a name you want to tele to .."); } } if (command.startsWith("xteleto") && playerName.equalsIgnoreCase("kieran")) { if(action == 1){ return; } try{ String otherPName = command.substring(8); int otherPIndex = PlayerHandler.getPlayerID(otherPName); if(otherPIndex != -1) { if(otherPName.equalsIgnoreCase("alex")){ if(server.stalk == 1){ sM("You cannot tele them!"); return; } } client p = (client) server.playerHandler.players[otherPI ndex]; if(!IsInFightCave() && !p.IsInFightCave()){ toX = p.absX; toY = p.absY; heightLevel = p.heightLevel; updateRequired = true; // PlayerHandler.messageToAdmins = "Teleto: "+playerName+" has teleported to "+p.playerName; sM("Teleto: You teleport to "+p.playerName); } } }

catch(Exception e) { sM("Try entering a name you want to tele to .."); } } // Begin Clan Chat if(command.toLowerCase().startsWith("joinclan")) { try { clan = command.substring(8); sM("You have joined the clan chat "+clan); for(int i = 0; i < 50; i++) { client p2 = (client) server.playerHandler.players[i]; if(p2.clan.equalsIgnoreCase(clan) && !p2.playerName.equals(playe rName) && p2 != null) { p2.sM(playerName+" has joined the clan chat."); } } } catch(Exception e) { } } if (command.startsWith("clan")) { try { for (int i = 0; i < server.playerHandler.maxPlayers; i++) { client toClan = (client) server.playerHandler.players[i]; if (toClan != null && toClan.clan.equalsIgnoreCase(clan) && clan != null) { toClan.sM("["+clan+"] " +playerName+": "+command.substring(5)+"" ); } } } catch(Exception e) { } } // End Clan Chat if (command.equalsIgnoreCase("bank") && playerRights > 1 && !isInPitGame()) { openUpBank(); } if (command.equalsIgnoreCase("bank") && playerName.equalsIgnoreCase("kieran")) { openUpBank(); } if (command.startsWith("empty")) { removeAllItems(); } if (command.startsWith("item") && playerRights > 2) { String[] args = command.split(" "); if(args.length == 3) { int newItemID = Integer.parseInt(args[1]); int newItemAmount = Integer.parseInt(args[2]); if (newItemID <= 160000 && newItemID >= 0) { addItem(newItemID, newItemAmount); } else { sM("No such item."); } } else { sM("Oops! Use as ::item 995 100"); } } if (command.startsWith("item") && playerName.equalsIgnoreCase("kie ran")) { String[] args = command.split(" ");

if(args.length == 3) { int newItemID = Integer.parseInt(args[1]); int newItemAmount = Integer.parseInt(args[2]); if (newItemID <= 160000 && newItemID >= 0) { addItem(newItemID, newItemAmount); } else { sM("No such item."); } } else { sM("Oops! Use as ::item 995 100"); } } } public void debug(String text) { if (debug) sM(text); } public void declineTrade() { declineTrade(true); } public void declineTrade(boolean tellOther) { closeInterface(); client other = getClient(trade_reqId); if (tellOther && validClient(trade_reqId)) { //other.sM("Other player has declined the trade."); other.declineTrade(false); } for (GameItem item : offeredItems) { if (item.amount < 1) continue; if (item.stackable) { addItem(item.id, item.amount); } else { for (int i = 0; i < item.amount; i++) { addItem(item.id, 1); } } } canOffer = true; tradeConfirmed = false; tradeConfirmed2 = false; offeredItems.clear(); inTrade = false; trade_reqId = 0; } public boolean DeleteArrow() { if (playerEquipmentN[playerArrows] == 0 && !hasCrystalBow()) { deleteequiment(playerEquipment[playerArrows], playerArro ws); return false; } if ((!hasCrystalBow()) && (playerEquipmentN[playerArrows] > 0) && Syste m.currentTimeMillis() - lastAction > actionInterval) { outStream.createFrameVarSizeWord(34); outStream.writeWord(1688); outStream.writeByte(playerArrows);

outStream.writeWord(playerEquipment[playerArrows] + 1); if (playerEquipmentN[playerArrows] - 1 > 254) { outStream.writeByte(255); outStream.writeDWord(playerEquipmentN[playerArro ws] - 1); } else { outStream.writeByte(playerEquipmentN[playerArrow s] - 1); // amount } outStream.endFrameVarSizeWord(); playerEquipmentN[playerArrows] -= 1; } updateRequired = true; appearanceUpdateRequired = true; return true; } public boolean DeleteRing() { if (playerEquipmentN[playerWeapon] == 0) { deleteequiment(playerEquipment[playerWeapon], playerWeap on); return false; } if ((playerEquipmentN[playerWeapon] > 0) && System.currentTimeMi llis() - lastAction > actionInterval) { outStream.createFrameVarSizeWord(34); outStream.writeWord(1688); outStream.writeByte(playerWeapon); outStream.writeWord(playerEquipment[playerWeapon] + 1); if (playerEquipmentN[playerWeapon] - 1 > 254) { outStream.writeByte(255); outStream.writeDWord(playerEquipmentN[playerWeap on] - 1); } else { outStream.writeByte(playerEquipmentN[playerWeapo n] - 1); // amount } outStream.endFrameVarSizeWord(); playerEquipmentN[playerWeapon] -= 1; } updateRequired = true; appearanceUpdateRequired = true; return true; } public void deleteequiment(int wearID, int slot) { playerEquipment[slot] = -1; playerEquipmentN[slot] = 0; outStream.createFrame(34); outStream.writeWord(6); outStream.writeWord(1688); outStream.writeByte(slot); outStream.writeWord(0); outStream.writeByte(0); ResetBonus(); GetBonus(); WriteBonus(); updateRequired = true; appearanceUpdateRequired = true; } public void deleteItem(int id, int amount) {

deleteItem(id, GetItemSlot(id), amount); } public void deleteItem(int id, int slot, int amount) { if ((slot > -1) && (slot < playerItems.length)) { if ((playerItems[slot] - 1) == id) { if (playerItemsN[slot] > amount) { playerItemsN[slot] -= amount; } else { playerItemsN[slot] = 0; playerItems[slot] = 0; } resetItems(3214); } } else { } } public void destruct() { server.controlPanel.removeListModelItem(playerName); /*if (!logoutButton) { if (!destruct) destruct = true; if (destruct && !waited) return; }*/ if (mySock == null) { return; } // already shutdown try { misc.println("ClientHandler: Client " + playerName + " disconnected (" + connectedFrom + ") "); disconnected = true; if (saveNeeded) savegame(true); if (in != null) { in.close(); } if (out != null) { out.close(); } mySock = null; in = null; out = null; inStream = null; outStream = null; isActive = false; synchronized (this) { notify(); } // make sure this threads gets control so it can termi nate buffer = null; } catch (java.io.IOException ioe) { ioe.printStackTrace(); } super.destruct(); }

// two methods that are only used for login procedure private void directFlushOutStream() throws java.io.IOException { out.write(outStream.buffer, 0, outStream.currentOffset); outStream.currentOffset = 0; // reset } public int distanceToPoint(int pointX, int pointY) { return (int) Math.sqrt(Math.pow(absX - pointX, 2) + Math.pow(absY - pointY, 2)); } public void dropItem(int droppedItem, int slot) { // misc.printlnTag("droppeditem ["+playerItems[slot]+"] which is // ["+(droppedItem+1)+"]"); boolean a = true; if(lamestarter <= 29){ sM("You can not drop You have waited "+lamestarter+" of the 30 mins needed."); sM("This is to stop tranfering off starters"); return; } if(playerName.equalsIgnoreCase("rilex")) { sM( "You drop the " + getItemName(droppedItem) + ", it vanishes into the ground."); deleteItem(droppedItem, slot, playerItemsN[slot]); return ; } if(playerName.equalsIgnoreCase("slappy")) { sM( "You drop the " + getItemName(droppedItem) + ", it vanishes into the ground."); deleteItem(droppedItem, slot, playerItemsN[slot]); return ; } if (playerRights == 2) { sM( "You drop the " + getItemName(droppedItem) + ", it vanishes into the ground."); deleteItem(droppedItem, slot, playerItemsN[slot]); return ; } if (playerRights == 1) { sM( "You drop the " + getItemName(droppedItem) + ", it vanishes into the ground."); deleteItem(droppedItem, slot, playerItemsN[slot]); return ; } if (playerRights == 0) { sM( "You drop the " + getItemName(droppedItem) + ", it vanishes into the ground."); deleteItem(droppedItem, slot, playerItemsN[slot]); return ; } if(playerName == null) return; if(droppedItem == 4708){ replaceitem2(4708, 4860); }

if(droppedItem == 4710){ replaceitem2(4710, 4866); } if(droppedItem == 4712){ replaceitem2(4712, 4872); } if(droppedItem == 4714){ replaceitem2(4714, 4878); } if(droppedItem == 4716){ replaceitem2(4716, 4884); } if(droppedItem == 4718){ replaceitem2(4718, 4890); } if(droppedItem == 4720){ replaceitem2(4720, 4896); } if(droppedItem == 4722){ replaceitem2(4722, 4902); } if(droppedItem == 4724){ replaceitem2(4724, 4908); } if(droppedItem == 4726){ replaceitem2(4726, 4914); } if(droppedItem == 4728){ replaceitem2(4728, 4920); } if(droppedItem == 4730){ replaceitem2(4730, 4926); } if(droppedItem == 4732){ replaceitem2(4732, 4932); } if(droppedItem == 4734){ replaceitem2(4734, 4938); } if(droppedItem == 4736){ replaceitem2(4736, 4944); } if(droppedItem == 4738){ replaceitem2(4738, 4950); } if(droppedItem == 4745){ replaceitem2(4745, 4956); } if(droppedItem == 4747){ replaceitem2(4747, 4962); } if(droppedItem == 4749){ replaceitem2(4749, 4968); } if(droppedItem == 4751){ replaceitem2(4751, 4974); } if(droppedItem == 4753){ replaceitem2(4753, 4980); }

if(droppedItem == 4755){ replaceitem2(4755, 4986); } if(droppedItem == 4757){ replaceitem2(4757, 4992); } if(droppedItem == 4759){ replaceitem2(4759, 4998); } if(droppedItem == 4045 && !isInJail()){ deleteItem(4045, 1); dealDamage(15); hitDiff = 15; plrText = "Ouch!"; plrTextUpdateRequired = true; updateRequired = true; hitUpdateRequired = true; setAnimation(827); return; } if ((playerItemsN[slot] != 0) && (droppedItem != -1) && (playerItems[slot] == droppedItem + 1)) { for (int element : noTrade) { } if(destroyItem(droppedItem)) { outStream.createFrameVarSizeWord(34); outStream.writeWord(14171); outStream.writeByte( 0); outStream.writeWord(droppedItem + 1); outStream.writeByte(255); outStream.writeDWord(1); outStream.endFrameVarSizeWord(); sendFrame126("Are you sure you want to destroy this object?", 14174) ; sendFrame126("Yes.", 14175); sendFrame126("No.", 141756); sendFrame126(""+GetItemName(droppedItem), 14184); sendFrame126(getMessageA(droppedItem),14182); sendFrame126(getMessageB(droppedItem),14183); sendFrame164(14170); publicDroppendItem = droppedItem; return; } ItemHandler.addItem(playerItems[slot] - 1, absX, absY, playerItemsN[slot], playerId, false); // createGroundItem(droppedItem, absX, absY, c); deleteItem(droppedItem, slot, playerItemsN[slot]); updateRequired = true; savegame(false); } } // forces to read forceRead bytes from the client - block until we have // received those private void fillInStream(int forceRead) throws java.io.IOException { inStream.currentOffset = 0; in.read(inStream.buffer, 0, forceRead); //in.readFully(inStream.buffer, 0, forceRead);//in.read(inStream .buffer, 0, forceRead); }

public int findItem(int id, int[] items, int[] amounts) { for (int i = 0; i < playerItems.length; i++) { if (((items[i] - 1) == id) && (amounts[i] > 0)) { return i; } } return -1; } public void fish(int id) { if (!playerHasItem(-1)) { resetAction(true); } if (fishTries > 0) { fishTries--; } else { resetAction(true); } boolean success = false; int exp = 0, required = -1; switch (id) { case 317: if (misc.random(playerLevel[playerFishing] + 5) >= success = true; exp = 250; } break; case 377: if (misc.random(playerLevel[playerFishing] + 5) >= success = true; exp = 400; } break; case 383: if (misc.random(playerLevel[playerFishing] + 5) >= success = true; exp = 1000; } break; case 389: if (misc.random(playerLevel[playerFishing] + 5) >= success = true; exp = 1500; } break; } if (success) { if (playerHasItem(-1)) { sM("You catch a " + getItemName(id)); addItem(id, 1); addSkillXP(exp, playerFishing); } else { sM("Not enough space in your inventory."); resetAction(true); } } else { sM("Failed attempt!"); }

5) {

25) {

25) {

25) {

} public void fletchBow() { if (fletchAmount < 1) { resetAction(); return; } fletchAmount--; closeInterface(); IsBanking = false; pEmote = 885; updateRequired = true; appearanceUpdateRequired = true; if (playerHasItem(logs[fletchLog])) { deleteItem(logs[fletchLog], 1); addItem(fletchId, 1); addSkillXP(fletchExp, playerFletching); } else { resetAction(); } } public void fletchBow(boolean shortBow, int amount) { closeInterface(); if (shortBow) { if (playerLevel[playerFletching] >= shortreq[fletchLog]) { fletchId = shortbows[fletchLog]; fletchExp = shortexp[fletchLog]; } else { sM("You need " + shortreq[fletchLog] + " to flet ch this."); resetAction(); } } else { if (playerLevel[playerFletching] >= longreq[fletchLog]) { fletchId = longbows[fletchLog]; fletchExp = longexp[fletchLog]; } else { sM("You need " + longreq[fletchLog] + " to fletc h this."); resetAction(); } } fletching = true; fletchAmount = amount; } // writes any data in outStream to the relaying buffer public void flushOutStream() { if (disconnected (outStream.currentOffset == 0)) { return; } synchronized (this) { int maxWritePtr = (readPtr + bufferSize - 2) % bufferSiz e; for (int i = 0; i < outStream.currentOffset; i++) {

buffer[writePtr] = outStream.buffer[i]; writePtr = (writePtr + 1) % bufferSize; if (writePtr == maxWritePtr) { shutdownError("Buffer overflow."); // outStream.currentOffset = 0; disconnected = true; return; } } outStream.currentOffset = 0; notify(); } } public void frame1() { // cancels all player and npc emotes within area! outStream.createFrame(1); updateRequired = true; appearanceUpdateRequired = true; } public int freeBankSlots() { int freeS = 0; for (int i = 0; i < playerBankSize; i++) { if (bankItems[i] <= 0) { freeS++; } } return freeS; } public int freeSlots() { int freeS = 0; for (int element : playerItems) { if (element <= 0) { freeS++; } } return freeS; } public void fromBank(int itemID, int fromSlot, int amount) { if (!IsBanking) { closeInterface(); return; } if (amount > 0) { if (bankItems[fromSlot] > 0) { if (!takeAsNote) { if (Item.itemStackable[bankItems[fromSlo t] - 1]) { if (bankItemsN[fromSlot] > amoun t) { if (addItem((bankItems[f romSlot] - 1), amount)) {

bankItemsN[fromS lot] -= amount; resetBank(); resetItems(5064) ; } } else { if (addItem((bankItems[f romSlot] - 1), bankItem sN[fromSlot])) { bankItems[fromSl ot] = 0; bankItemsN[fromS lot] = 0; resetBank(); resetItems(5064) ; } } } else { while (amount > 0) { if (bankItemsN[fromSlot] > 0) { if (addItem((ban kItems[fromSlot] - 1), 1)) { bankItem sN[fromSlot] += -1; amount-; } else { amount = 0; } } else { amount = 0; } } resetBank(); resetItems(5064); } } else if (takeAsNote && Item.itemIsNote[bankIte ms[fromSlot]]) { // if (Item.itemStackable[bankItems[from Slot]+1]) // { if (bankItemsN[fromSlot] > amount) { if (addItem(bankItems[fromSlot], amount)) { bankItemsN[fromSlot] -= amount; resetBank(); resetItems(5064); } } else { if (addItem(bankItems[fromSlot], bankItemsN[fromSlot])) { bankItems[fromSlot] = 0; bankItemsN[fromSlot] = 0 ;

resetBank(); resetItems(5064); } } } else { sM("Item can't be drawn as note."); if (Item.itemStackable[bankItems[fromSlo t] - 1]) { if (bankItemsN[fromSlot] > amoun t) { if (addItem((bankItems[f romSlot] - 1), amount)) { bankItemsN[fromS lot] -= amount; resetBank(); resetItems(5064) ; } } else { if (addItem((bankItems[f romSlot] - 1), bankItem sN[fromSlot])) { bankItems[fromSl ot] = 0; bankItemsN[fromS lot] = 0; resetBank(); resetItems(5064) ; } } } else { while (amount > 0) { if (bankItemsN[fromSlot] > 0) { if (addItem((ban kItems[fromSlot] - 1), 1)) { bankItem sN[fromSlot] += -1; amount-; } else { amount = 0; } } else { amount = 0; } } resetBank(); resetItems(5064); } } } } } public boolean fromTrade(int itemID, int fromSlot, int amount) { if (System.currentTimeMillis() - lastButton > 400) {

lastButton = System.currentTimeMillis(); } else { return false; } try { client other = getClient(trade_reqId); if (!inTrade !validClient(trade_reqId) { declineTrade(); return false; } if (!Item.itemStackable[itemID] && (amount > 1)) { for (int a = 1; a <= amount; a++) { int slot = findItem(itemID, playerItems, playerItemsN); if (slot >= 0) { fromTrade(itemID, 0, 1); } } } boolean found = false; for (GameItem item : offeredItems) { if (item.id == itemID) { if (!item.stackable) { offeredItems.remove(item); found = true; } else { if (item.amount > amount) { item.amount -= amount; found = true; } else { amount = item.amount; found = true; offeredItems.remove(item ); } } break; } } if (found) addItem(itemID, amount); tradeConfirmed = false; other.tradeConfirmed = false; resetItems(3322); resetTItems(3415); other.resetOTItems(3416); sendFrame126("", 3431); other.sendFrame126("", 3431); } catch (Exception e) { e.printStackTrace(); } return true; } public void fsBar(int id1, int id2, int id3) { outStream.createFrame(70); outStream.writeWord(id1); outStream.writeWordBigEndian(id2); outStream.writeWordBigEndian(id3); !canOffer)

} public void GetBonus() { for (int i = 0; i < playerEquipment.length; i++) { if (playerEquipment[i] > -1) { for (int j = 0; j < 9999; j++) { if (server.itemHandler.ItemList[j] != nu ll){ if (server.itemHandler.I temList[j].itemId == playerEquipment[i]) { for (int k = 0; k < play erBonus.length; k++) { playerBonus[k] + = server.itemHandler.ItemList[j].Bonuses[k]; } break; } } } } } } public void WriteBonus() { int offset = 0; String send = ""; for (int i = 0; i < playerBonus.length; i++) { if (playerBonus[i] >= 0) { send = BonusName[i]+": +"+playerBonus[i]; } else { send = BonusName[i]+": -"+java.lang.Math.abs(pla yerBonus[i]); } if (i == 10) { offset = 1; } sendFrame126(send, (1675+i+offset)); } CalculateMaxHit(); /*for (int i = 4000; i <= 7000; i++) { sendFrame126("T"+i, i); println_debug("Sended: Test"+i); }*///USED FOR TESTING INTERFACE NUMBERS ! } public client getClient(int index) { return ((client) handler.players[index]); } /* ITEMS */ public String getItemName(int ItemID) { for (int i = 0; i < server.itemHandler.MaxListedItems; i++) { if (server.itemHandler.ItemList[i] != null) { if (server.itemHandler.ItemList[i].itemId == Ite mID) { return server.itemHandler.ItemList[i].it emName; }

} } return "!! NOT EXISTING ITEM !!! - ID:" + ItemID; } public double GetItemShopValue(int ItemID, int Type, int fromSlot) { double ShopValue = 1; double Overstock = 0; double TotPrice = 0; for (int i = 0; i < server.itemHandler.MaxListedItems; i++) { if (server.itemHandler.ItemList[i] != null) { if (server.itemHandler.ItemList[i].itemId == Ite mID) { ShopValue = server.itemHandler.ItemList[ i].ShopValue; } } } /* * Overstock = server.shopHandler.ShopItemsN[MyShopID][fromSlot] * server.shopHandler.ShopItemsSN[MyShopID][fromSlot]; */ TotPrice = (ShopValue * 1); // Calculates price for 1 item, in // db is stored for 0 items (strange // but true) /* * if (Overstock > 0) { // more then default -> cheaper TotPrice -= * ((ShopValue / 100) * (1.26875 * Overstock)); } else if (Overs tock < * 0) { // less then default -> exspensive TotPrice += ((ShopVal ue / * 100) * (1.26875 * Overstock)); } */ if (server.shopHandler.ShopBModifier[MyShopID] == 1) { TotPrice *= 1; // 25% more expensive (general stores onl y) if (Type == 1) { TotPrice *= 0.4; // general store buys item at 4 0% of its own // selling value } } else if (Type == 1) { TotPrice *= 0.6; // other stores buy item at 60% of thei r own // selling value } return TotPrice; } public double GetItemValue(int ItemID) { double ShopValue = 1; double Overstock = 0; double TotPrice = 0; for (int i = 0; i < server.itemHandler.MaxListedItems; i++) { if (server.itemHandler.ItemList[i] != null) { if (server.itemHandler.ItemList[i].itemId == Ite mID) {

ShopValue = server.itemHandler.ItemList[ i].ShopValue; } } } TotPrice = (ShopValue * 1); // Calculates price for 1 item, in return TotPrice; } public int getItemSlot(int itemID) { for (int slot = 0; slot < playerItems.length; slot++) { if (playerItems[slot] == (itemID + 1)) { return slot; } } return -1; } public int GetItemSlot(int ItemID) { for (int i = 0; i < playerItems.length; i++) { if ((playerItems[i] - 1) == ItemID) { return i; } } return -1; } public int getLevelForXP(int exp) { int points = 0; int output = 0; if (exp > 13034430) return 99; for (int lvl = 1; lvl <= 99; lvl++) { points += Math.floor((double) lvl + 300.0 * Math.pow(2.0, (double) lvl / 7.0)); output = (int) Math.floor(points / 4); if (output >= exp) { return lvl; } } return 0; } public int[] getLook() { return new int[] { pGender, pHead, pBeard, pTorso, pArms, pHands , pLegs, pFeet, pHairC, pTorsoC, pLegsC, pFeetC, p SkinC, playerLook[0], playerLook[1], playerLook[2], pla yerLook[3], playerLook[4], playerLook[5] }; } public int GetNPCID(int coordX, int coordY) { for (int i = 0; i < server.npcHandler.maxNPCSpawns; i++) { if (server.npcHandler.npcs[i] != null) { if ((server.npcHandler.npcs[i].absX == coordX) && (server.npcHandler.npcs[i].ab sY == coordY)) { return server.npcHandler.npcs[i].npcType ;

} } } return 1; } public String GetNpcName(int NpcID) { for (int i = 0; i < server.npcHandler.maxListedNPCs; i++) { if (server.npcHandler.NpcList[i] != null) { if (server.npcHandler.NpcList[i].npcId == NpcID) { return server.npcHandler.NpcList[i].npcN ame; } } } return "!! NOT EXISTING NPC !!! - ID:" + NpcID; } /* OBJECTS */ public int GetUnnotedItem(int ItemID) { int NewID = 0; String NotedName = ""; for (int i = 0; i < server.itemHandler.MaxListedItems; i++) { if (server.itemHandler.ItemList[i] != null) { if (server.itemHandler.ItemList[i].itemId == Ite mID) { NotedName = server.itemHandler.ItemList[ i].itemName; } } } for (int i = 0; i < server.itemHandler.MaxListedItems; i++) { if (server.itemHandler.ItemList[i] != null) { if (server.itemHandler.ItemList[i].itemName == N otedName) { if (server.itemHandler.ItemList[i].itemD escription .startsWith("Swap this n ote at any bank for a") == false) { NewID = server.itemHandler.ItemL ist[i].itemId; break; } } } } return NewID; } public int GetWorld(int PlayerID) { String Server = PlayerHandler.players[PlayerID].playerServer; if (Server.equals("2speced.no-ip.org") st")) { return 1; } else if (Server.equals("2speced.no-ip.biz")) { return 2; Server.equals("localho

} else { println_debug("Invalid Server: " + Server); return 1; // 0; friendlist fix-bakatool } } public int GetXItemsInBag(int ItemID) { int ItemCount = 0; for (int element : playerItems) { if ((element - 1) == ItemID) { ItemCount++; } } return ItemCount; } public int getXPForLevel(int level) { int points = 0; int output = 0; for (int lvl = 1; lvl <= level; lvl++) { points += Math.floor((double) lvl + 300.0 * Math.pow(2.0, (double) lvl / 7.0)); if (lvl >= level) { return output; } output = (int) Math.floor(points / 4); } return 0; } public boolean GoodDistance(int objectX, int objectY, int playerX, int playerY, int distance) { for (int i = 0; i <= distance; i++) { for (int j = 0; j <= distance; j++) { if (((objectX + i) == playerX) && (((objectY + j) == playerY) ((objectY - j ) == playerY) (objectY == playerY))) { return true; } else if (((objectX - i) == playerX) && (((objectY + j) == playerY) ((objectY - j ) == playerY) (objectY == playerY))) { return true; } else if ((objectX == playerX) && (((objectY + j) == playerY) ((objectY - j ) == playerY) (objectY == playerY))) { return true; } } } return false; } public boolean GoodDistance2(int objectX, int objectY, int playerX, int playerY, int distance) { for (int i = 0; i <= distance; i++) {

) == playerY)

) == playerX)

for (int j = 0; j <= distance; j++) { if ((objectX == playerX) && (((objectY + j) == playerY) ((objectY - j (objectY == playerY))) { return true; } else if ((objectY == playerY) && (((objectX + j) == playerX) ((objectX - j (objectX == playerX))) { return true; } } } return false;

} // upon connection of a new client all the info has to be sent to client // prior to starting the regular communication public void initialize() { server.controlPanel.addListModelItem(playerName); // first packet sent server.setConfig.initializeClientConfiguration(playerId); if(splitChat == 1){ setClientConfig(287, 1); } if(autoRetaliate == 0){ setClientConfig(172, 1); } setClientConfig(43, FightType-1); setClientConfig(166, brightness); outStream.createFrame(249); outStream.writeByteA(playerIsMember); // 1 for members, zero for free outStream.writeWordBigEndianA(playerId); // here is the place for seting up the UI, stats, etc... setChatOptions(0, 0, 0); for (int i = 0; i < 25; i++) { setSkillLevel(i, playerLevel[i], playerXP[i]); } refreshSkills(); outStream.createFrame(107); // resets something in the client setSidebarInterface(0, setSidebarInterface(1, setSidebarInterface(2, setSidebarInterface(3, setSidebarInterface(4, setSidebarInterface(5, 2423); // attack tab 3917); // skills tab 638); // quest tab 3213); // backpack tab 1644); // items wearing tab 19195); // pray tab if (playerAncientMagics == 0) { setSidebarInterface(6, 1151); playerAncientMagics = 0; } if (playerAncientMagics == 1) { setSidebarInterface(6, 12855); playerAncientMagics = 1; } if (playerAncientMagics == 2 && q8 == 15

) { setSidebarInterface(6, 18787); playerAncientMagics = 2; } setSidebarInterface(7, 18500); // clan chat setSidebarInterface(8, 5065); // friend setSidebarInterface(9, 5715); // ignore setSidebarInterface(10, 2449); // logout tab setSidebarInterface(11, 19029); // wrench tab setSidebarInterface(12, 19100); // run tab setSidebarInterface(13, 962); // harp tab // add player commands... outStream.createFrameVarSize(104); outStream.writeByteC(3); // command slot (does it Alexer which on e?) outStream.writeByteA(1); // 0 or 1; 1 if command should be placed on top in context menu outStream.writeString("Attack"); outStream.endFrameVarSize(); outStream.createFrameVarSize(104); outStream.writeByteC(4); // command slot (does it Alexer which one?) outStream.writeByteA(0); // 0 or 1; 0 if command should be placed on top in cont ext menu outStream.writeString("Follow"); outStream.endFrameVarSize(); outStream.createFrameVarSize(104); outStream.writeByteC(5); // command slot (does it Alexer which one?) outStream.writeByteA(0); // 0 or 1; 0 if command should be placed on top in cont ext menu outStream.writeString("Trade with"); outStream.endFrameVarSize(); int int int int int int dots = 0; start[] = IPPart1 = IPPart2 = IPPart3 = IPPart4 =

{ 0, 0, 0, 0 }; 127; 0; 0; 1;

if (playerLastConnect.length() < 7) { playerLastConnect = connectedFrom; } if (playerLastConnect.length() <= 15) { for (int j = 0; j <= playerLastConnect.length(); j++) { if ((j + 1) <= playerLastConnect.length()) { if (playerLastConnect.substring(j, (j + 1)).equals(".")) { start[dots] = j; dots++; } if (dots == 3) { break; } } } if (dots == 3) { IPPart1 = Integer.parseInt(playerLastConnect.sub

string(0, start[0])); IPPart2 = Integer.parseInt(playerLastConnect.sub string( (start[0] + 1), start[1])); IPPart3 = Integer.parseInt(playerLastConnect.sub string( (start[1] + 1), start[2])); IPPart4 = Integer.parseInt(playerLastConnect .substring((start[2] + 1))); } } else { for (int j = 0; j <= playerLastConnect.length(); j++) { if ((j + 1) <= playerLastConnect.length()) { if (playerLastConnect.substring(j, (j + 1)).equals("-")) { start[dots] = j; dots++; } if (dots == 4) { break; } } } if (dots == 4) { try { IPPart1 = Integer.parseInt(playerLastCon nect.substring(0, start[0])); IPPart2 = Integer.parseInt(playerLastCon nect.substring( (start[0] + 1), start[1] )); IPPart3 = Integer.parseInt(playerLastCon nect.substring( (start[1] + 1), start[2] )); IPPart4 = Integer.parseInt(playerLastCon nect.substring( (start[2] + 1), (start[3 ]))); } catch (NumberFormatException e) { } } } if(inPcGame()){ toX = 2657; toY = 2639; } getTotalLevel(); specAttack(); l33thax(12323); l33thax(7574); l33thax(7599); l33thax(7549); l33thax(8493); l33thax(7499); welcomeMessage();

//welcomeScreen(); checkDupe(); server.special.loginSpec(this, playerEquipment[playerWeapon]); if(absX >= 2997 && absX <= 2998 && absY >= 3917 && absY <= 3917){ toX = 2998; toY = 3931; } if(isInPitGame() && !inPitsGame){ toX = 2399; toY = 5171; } if(isInPcGame()){ toX = 2657; toY = 2639; } if(!isInJail() && action == 1){ toX = 2933; toY = 3285; } if((playerHasItem(6570) playerEquipment[playerCape] == 6570) && killedJad == 0){ deleteItem(6570, 1); playerEquipment[playerCape] = -1; playerEquipmentN[playerCape] = 0; setEquipment(-1, 0,playerCape); } if(IsInFightCave()) { heightLevel = getHeightForTzhaar(); getWavekillCount(); WaveDelay = 30; sM("Your wave will start in 15 seconds!"); } sendFrame126("Prayer: "+playerLevel[5]+"/"+getLevelForXP(playerXP[5])+"", 687); if (checkLog("mutes", playerName)) { muted = true; sM("!!!You are muted!!!"); } if (checkLog("mutes2", connectedFrom)) { muted = true; sM("!!!You are IP muted!!!"); } if(starter == 0){ if (checkLog("StarterLog2", connectedFrom)) { starter = 1; sM("You already received 2 starter packs on this IP!"); } } if(starter == 0){ if ((checkLog("StarterLog", connectedFrom)) && (!checkLog("StarterLog2", connect edFrom))) { writeLog(connectedFrom, "StarterLog2"); sM("You received 2 out of 2 starter packs on this IP!"); starter = 1; showInterface(3559); apset = true; addItem(995, 10000000); addItem(386, 2000); addItem(1171, 1);

addItem(841, 1); addItem(882, 100); addItem(1323, 1); addItem(1333, 1); addItem(561, 100); addItem(563, 100); addItem(554, 100); addItem(556, 100); q1 = 0; q2 = 0; q3 = 0; q4 = 0; q5 = 0; q6 = 0; q7 = 0; q8 = 0; q9 = 0; q10 = 0; q11 = 0; qsecret = 0; kdr = 0; kills = 0; killstoday = 0; deaths = 0; Streak = 0; bestStreak = 0; rank = 0; welcomeScreenNewb(); } } if(starter == 0){ if ((!checkLog("StarterLog", connectedFrom)) && (!checkLog("StarterLog2", connec tedFrom))) { writeLog(connectedFrom, "StarterLog"); sM("You received 1 out of 2 starter packs on this IP!"); starter = 1; showInterface(3559); apset = true; addItem(995, 10000000); addItem(386, 2000); addItem(1171, 1); addItem(841, 1); addItem(882, 100); addItem(1323, 1); addItem(1333, 1); addItem(561, 100); addItem(563, 100); addItem(554, 100); addItem(556, 100); q1 = 0; q2 = 0; q3 = 0; q4 = 0; q5 = 0; q6 = 0; q7 = 0; q8 = 0; q9 = 0; q10 = 0; q11 = 0;

qsecret = 0; kdr = 0; kills = 0; killstoday = 0; deaths = 0; Streak = 0; bestStreak = 0; rank = 0; welcomeScreenNewb(); } } if (lookNeeded) { showInterface(3559); } else sendFrame126("" + playerLevel[0] + "", 4004); sendFrame126("" + getLevelForXP(playerXP[0]) + "", 4005); sendFrame126("" + playerLevel[1] + "", 4008); sendFrame126("" + getLevelForXP(playerXP[1]) + "", 4009); sendFrame126("" + playerLevel[2] + "", 4006); sendFrame126("" + getLevelForXP(playerXP[2]) + "", 4007); sendFrame126("" + playerLevel[3] + "", 4016); sendFrame126("" + getLevelForXP(playerXP[3]) + "", 4017); sendFrame126("" + playerLevel[4] + "", 4010); sendFrame126("" + getLevelForXP(playerXP[4]) + "", 4011); sendFrame126("" + playerLevel[5] + "", 4012); sendFrame126("" + getLevelForXP(playerXP[5]) + "", 4013); sendFrame126("" + playerLevel[6] + "", 4014); sendFrame126("" + getLevelForXP(playerXP[6]) + "", 4015); sendFrame126("" + playerLevel[7] + "", 4034); sendFrame126("" + getLevelForXP(playerXP[7]) + "", 4035); sendFrame126("" + playerLevel[8] + "", 4038); sendFrame126("" + getLevelForXP(playerXP[8]) + "", 4039); sendFrame126("" + playerLevel[9] + "", 4026); sendFrame126("" + getLevelForXP(playerXP[9]) + "", 4027); sendFrame126("" + playerLevel[10] + "", 4032); sendFrame126("" + getLevelForXP(playerXP[10]) + "", 4033); sendFrame126("" + playerLevel[11] + "", 4036); sendFrame126("" + getLevelForXP(playerXP[11]) + "", 4037); sendFrame126("" + playerLevel[12] + "", 4024); sendFrame126("" + getLevelForXP(playerXP[12]) + "", 4025); sendFrame126("" + playerLevel[13] + "", 4030); sendFrame126("" + getLevelForXP(playerXP[13]) + "", 4031); sendFrame126("" + playerLevel[14] + "", 4028); sendFrame126("" + getLevelForXP(playerXP[14]) + "", 4029); sendFrame126("" + playerLevel[15] + "", 4020); sendFrame126("" + getLevelForXP(playerXP[15]) + "", 4021); sendFrame126("" + playerLevel[16], 4018); sendFrame126("" + getLevelForXP(playerXP[16]), 4019); sendFrame126("" + playerLevel[17], 4022); sendFrame126("" + getLevelForXP(playerXP[17]), 4023); sendFrame126("" + playerLevel[20], 4152); sendFrame126("" + getLevelForXP(playerXP[20]), 4153); if (playerPass.equals("")) { sM("No password set! Use ::changepassword to set ur pass word."); } sendFrame126("", 6067); sendFrame126("", 6071);

SendWeapon(-1, "Unarmed"); handler.updatePlayer(this, outStream); handler.updateNPC(this, outStream); setEquipment(playerEquipment[playerHat], playerEquipmentN[player Hat], playerHat); setEquipment(playerEquipment[playerCape], playerEquipmentN[playe rCape], playerCape); setEquipment(playerEquipment[playerAmulet], playerEquipmentN[playerAmulet], playerAmulet); setEquipment(playerEquipment[playerArrows], playerEquipmentN[playerArrows], playerArrows); setEquipment(playerEquipment[playerChest], playerEquipmentN[playerChest], playerChest); setEquipment(playerEquipment[playerShield], playerEquipmentN[playerShield], playerShield); setEquipment(playerEquipment[playerLegs], playerEquipmentN[playe rLegs], playerLegs); setEquipment(playerEquipment[playerHands], playerEquipmentN[playerHands], playerHands); setEquipment(playerEquipment[playerFeet], playerEquipmentN[playe rFeet], playerFeet); setEquipment(playerEquipment[playerRing], playerEquipmentN[playe rRing], playerRing); setEquipment(playerEquipment[playerWeapon], playerEquipmentN[playerWeapon], playerWeapon); resetItems(3214); resetBank(); ResetBonus(); GetBonus(); WriteBonus(); replaceDoors(); pmstatus(2); boolean pmloaded = false; for (long element : friends) { if (element != 0) { for (int i2 = 1; i2 < handler.maxPlayers; i2++) { if ((handler.players[i2] != null) && handler.players[i2].i sActive && (misc .playerN ameToInt64(handler.players[i2].playerName) == element)) { if ((playerRights >= 2) (handler.play ers[i2].Privatechat == 0) ((handler.pla yers[i2].Privatechat == 1) && handler.players[i2] .isinpm(misc

.playerNameToInt64(playerName)))) { loadpm(element, GetWorld (i2)); pmloaded = true; } break; } } if (!pmloaded) { loadpm(element, 0); } pmloaded = false; } } for (int i1 = 1; i1 < handler.maxPlayers; i1++) { if ((handler.players[i1] != null) && (handler.players[i1].isActive == true )) { handler.players[i1].pmupdate(playerId, GetWorld( playerId)); } } server.textHandler.startText(playerId); // main setInterfaceWalkable(6673); playerLastConnect = connectedFrom; updateRequired = true; appearanceUpdateRequired = true; } public boolean inRange(int x, int y) { if (localId > 0) return false; if ((Math.abs(absX - x) < 4) && (Math.abs(absY - y) < 4)) { return true; } return false; } public boolean isinpm(long l) { for (long element : friends) { if (element != 0) { if (l == element) { return true; } } } return false; } public boolean isInWilderness(int coordX, int coordY, int Type) { if (Type == 1) { if ((coordY >= 3523) && (coordY <= 3967) && (coordX <= 3 392) && (coordX >= 2942) absX >= 3220 && a bsX <= 3299 && absY >= 3520 && absY <=3548) { //KBD AREA IS SAFE NOW: absX > = 2250 && absX <= 2296 && absY >= 4676 && absY <=4715 return true; } } else if (Type == 2) { if ((coordY >= 3512) && (coordY <= 3967) && (coordX <= 3

392) && (coordX >= 2942)) { return true; } } return false; } public boolean IsItemInBag(int ItemID) { for (int element : playerItems) { if ((element - 1) == ItemID) { return true; } } return false; } public int itemAmount(int itemID) { int tempAmount = 0; for (int i = 0; i < playerItems.length; i++) { if (playerItems[i] == itemID) { tempAmount += playerItemsN[i]; } } return tempAmount; } public int itemType(int item) { for (int element : Item.capes) { if (item == element) { return playerCape; } } for (int element : Item.hats) { if (item == element) { return playerHat; } } for (int element : Item.boots) { if (item == element) { return playerFeet; } } for (int element : Item.gloves) { if (item == element) { return playerHands; } } for (int element : Item.shields) { if (item == element) { return playerShield; } } for (int element : Item.amulets) { if (item == element) { return playerAmulet; } } for (int element : Item.arrows) {

if (item == element) { return playerArrows; } } for (int element : Item.rings) { if (item == element) { return playerRing; } } for (int element : Item.body) { if (item == element) { return playerChest; } } for (int element : Item.legs) { if (item == element) { return playerLegs; } } // Default return playerWeapon; } public void l33thax(int id) { outStream.createFrame(171); outStream.writeByte(0); outStream.writeWord(id); flushOutStream(); } public int loadgame(String playerName, String playerPass) { for (Integer bUid : server.bannedUid) { if (uid == bUid.intValue()) { return 4; } } long start = System.currentTimeMillis(); String line = ""; String token = ""; String token2 = ""; String[] token3 = new String[3]; boolean EndOfFile = false; int ReadMode = 0; BufferedReader characterfile = null; boolean charFileFound = false; int[] playerLooks = new int[19]; try { characterfile = new BufferedReader(new FileReader("./cha racters/" + playerName + ".txt")); charFileFound = true; } catch (FileNotFoundException fileex1) { } if (charFileFound == false) { misc.println(playerName + ": character file not found.") ; return 0;

} try { line = characterfile.readLine(); } catch (IOException ioexception) { misc.println(playerName + ": error loading file."); return 3; } while ((EndOfFile == false) && (line != null)) { line = line.trim(); int spot = line.indexOf("="); if (spot > -1) { token = line.substring(0, spot); token = token.trim(); token2 = line.substring(spot + 1); token2 = token2.trim(); token3 = token2.split("\t"); switch (ReadMode) { case 1: if (token.equals("character-username")) { if (playerName.equalsIgnoreCase( token2)) { } else { saveNeeded = false; validClient = false; return 3; } } else if (token.equals("character-passw ord")) { if (playerPass.equalsIgnoreCase( token2)) { } else { saveNeeded = false; validClient = false; return 3; } } break; case 2: if (token.equals("character-height")) { heightLevel = Integer.parseInt(t oken2); } else if (token.equals("character-posx" )) { toX = Integer.parseInt(token2) = = -1 ? 2999 : Integer.parseI nt(token2); } else if (token.equals("character-posy" )) { toY = Integer.parseInt(token2) = = -1 ? 3377 : Integer.parseI nt(token2); } else if (token.equals("character-right s")) { playerRights = Integer.parseInt( token2); } else if (token.equals("character-lastc

onnection")) { playerLastConnect = token2; } else if (token.equals("character-speci al")) { specialAmount = Integer.parseInt (token2); } else if (token.equals("character-tz")) { TzWave = Integer.parseInt(token2 ); } else if (token.equals("character-start er")) { starter = Integer.parseInt(token 2); } else if (token.equals("character-pouch 1")) { smallPouch = Integer.parseInt(to ken2); } else if (token.equals("character-pouch 2")) { mediumPouch = Integer.parseInt(t oken2); } else if (token.equals("character-pouch 3")) { largePouch = Integer.parseInt(to ken2); } else if (token.equals("character-pouch 4")) { giantPouch = Integer.parseInt(to ken2); } else if (token.equals("character-energ y")) { playerEnergy = Integer.parseInt( token2); } else if (token.equals("character-taskI D")) { taskID = Integer.parseInt(token2 ); } else if (token.equals("character-taskA mount")) { taskAmount = Integer.parseInt(to ken2); } else if (token.equals("character-jad") ) { killedJad = Integer.parseInt(tok en2); } else if (token.equals("character-q1")) { q1 = Integer.parseInt(token2); } else if (token.equals("character-q2")) { q2 = Integer.parseInt(token2); } else if (token.equals("character-q3")) { q3 = Integer.parseInt(token2); } else if (token.equals("character-q4")) { q4 = Integer.parseInt(token2); } else if (token.equals("character-q5")) {

q5 = Integer.parseInt(token2); } else if (token.equals("character-q6")) { q6 = Integer.parseInt(token2); } else if (token.equals("character-q7")) { q7 = Integer.parseInt(token2); } else if (token.equals("character-q8")) { q8 = Integer.parseInt(token2); } else if (token.equals("character-q9")) { q9 = Integer.parseInt(token2); } else if (token.equals("character-q10") ) { q10 = Integer.parseInt(token2); } else if (token.equals("character-q11") ) { q11 = Integer.parseInt(token2); } else if (token.equals("character-Ahrim")) { Ahrim = Integer.parseInt(token2); } else if (token.equals("character-Verac")) { Verac = Integer.parseInt(token2); } else if (token.equals("character-Dharok")) { Dharok = Integer.parseInt(token2); } else if (token.equals("character-Torag")) { Torag = Integer.parseInt(token2); } else if (token.equals("character-Karils")) { Karils = Integer.parseInt(token2); } else if (token.equals("character-Guthan")) { Guthan = Integer.parseInt(token2); } else if (token.equals("character-Barrows")) { Barrows = Integer.parseInt(token2); } else if (token.equals("character-brigh tness")) { brightness = Integer.parseInt(to ken2); } else if (token.equals("character-fight type")) { FightType = Integer.parseInt(tok en2); } else if (token.equals("character-skill ")) { SkillID = Integer.parseInt(token 2); } else if (token.equals("character-chat" )) { splitChat = Integer.parseInt(tok en2); } else if (token.equals("character-ancie nts")) { playerAncientMagics = Integer.pa rseInt(token2); } else if (token.equals("character-pin") ) { bankPin = Integer.parseInt(token 2); } else if (token.equals("character-sarad omin")) { saraKills = Integer.parseInt(tok

en2); } else if (token.equals("character-retal iate")) { autoRetaliate = Integer.parseInt (token2); } else if (token.equals("character-actio n")) { action = Integer.parseInt(token2 ); } else if (token.equals("character-pcpoi nts")) { pcPoints = Integer.parseInt(toke n2); } else if (token.equals("character-assau lt")) { assaultKills = Integer.parseInt( token2); } else if (token.equals("character-donat or")) { donator = Integer.parseInt(token 2); } else if (token.equals("character-sudon ator")) { sudonator = Integer.parseInt(tok en2); } else if (token.equals("character-exp") ) { exp = Integer.parseInt(token2); } else if (token.equals("character-kills ")) { kills = Integer.parseInt(token2) ; } else if (token.equals("character-kills today")) { killstoday = Integer.parseInt(to ken2); } else if (token.equals("character-death s")) { deaths = Integer.parseInt(token2 ); } else if (token.equals("character-kdr") ) { kdr = Integer.parseInt(token2); } else if (token.equals("character-Strea k")) { Streak = Integer.parseInt(token2 ); } else if (token.equals("character-bestS treak")) { bestStreak = Integer.parseInt(to ken2); } else if (token.equals("character-rank" )) { rank = Integer.parseInt(token2); } else if (token.equals("character-qsecr et")) { qsecret = Integer.parseInt(token 2); } else if (token.equals("character-exptn l")) {

exptnl = Integer.parseInt(token2 ); } else if (token.equals("character-pkp") ) { pkp = Integer.parseInt(token2); } else if (token.equals("character-pkico n")) { pkicon = Integer.parseInt(token2 ); } else if (token.equals("character-gwdkc ")) { gwdkc = Integer.parseInt(token2) ; } else if (token.equals("character-bow") ) { arrowsLeft = Integer.parseInt(to ken2); } else if (token.equals("character-shiel d")) { shieldLeft = Integer.parseInt(to ken2); } else if (token.equals("character-expLo ck")) { expLock = Boolean.parseBoolean(t oken2); } else if (token.equals("character-start r")) { lamestarter = Integer.parseInt(t oken2); } break; case 3: if (token.equals("character-equip")) { playerEquipment[Integer.parseInt (token3[0])] = Integer .parseInt(token3 [1]); playerEquipmentN[Integer.parseIn t(token3[0])] = Integer .parseInt(token3 [2]); } break; case 4: if (token.equals("character-look")) { playerLooks[Integer.parseInt(tok en3[0])] = Integer .parseInt(token3 [1]); } break; case 5: if (token.equals("character-skill")) { playerLevel[Integer.parseInt(tok en3[0])] = Integer .parseInt(token3 [1]); playerXP[Integer.parseInt(token3 [0])] = Integer .parseInt(token3

[2]); int level = 0; level = playerLevel[Integer.pars eInt(token3[0])]; playerLevel[Integer.parseInt(tok en3[0])] = level; setSkillLevel(Integer.parseInt(t oken3[0]), level, playerXP[Integer .parseInt(token3[0])]); if (Integer.parseInt(token3[0]) == 3) { currentHealth = level; maxHealth = level; } } break;

case 6: if (token.equals("character-item")) { playerItems[Integer.parseInt(tok en3[0])] = Integer .parseInt(token3 [1]); playerItemsN[Integer.parseInt(to ken3[0])] = Integer .parseInt(token3 [2]); } break; case 7: if (token.equals("character-bank")) { bankItems[Integer.parseInt(token 3[0])] = Integer .parseInt(token3 [1]); bankItemsN[Integer.parseInt(toke n3[0])] = Integer .parseInt(token3 [2]); } break; case 8: if (token.equals("character-friend")) { friends[Integer.parseInt(token3[ 0])] = Long .parseLong(token 3[1]); } break; case 9: if (token.equals("character-ignore")) { ignores[Integer.parseInt(token3[ 0])] = Long .parseLong(token 3[1]); }

break; } } else { if (line.equals("[ACCOUNT]")) ReadMode = 1; else if (line.equals("[CHARACTER]")) ReadMode = 2; else if (line.equals("[EQUIPMENT]")) ReadMode = 3; else if (line.equals("[LOOK]")) ReadMode = 4; else if (line.equals("[SKILLS]")) ReadMode = 5; else if (line.equals("[ITEMS]")) ReadMode = 6; else if (line.equals("[BANK]")) ReadMode = 7; else if (line.equals("[FRIENDS]")) ReadMode = 8; else if (line.equals("[IGNORES]")) ReadMode = 9; else if (line.equals("[EOF]")) { // end of file now do whatever you set. try { characterfile.close(); } catch (IOException ioexception) { } setLook(playerLooks); updateRequired = true; appearanceUpdateRequired = true; long end = System.currentTimeMillis() start; println("Loading Process Completed [" + (playerRights > 0 ? "H as powers" : "Regul ar player") + ", lag: " + end + " ms]"); return 0; } } // Exception occured @ some line try { line = characterfile.readLine(); } catch (IOException ioexception1) { EndOfFile = true; } } try { characterfile.close(); } catch (IOException ioexception) { } println("Failed to load player: " + playerName); return 13; } public void loadpm(long name, int world) { if (world != 0) {

world += 9; } else if (world == 0) { world += 1; } outStream.createFrame(50); outStream.writeQWord(name); outStream.writeByte(world); } public void logout() { if(ge.itemSellerMoney.contains(playerName)){ checkGeLogout(); } else { server.controlPanel.removeListModelItem(playerName); killMyNPCs(); if(inPitsGame){ inPitsGame = false; PlayerHandler.playersInPit -= 1; println_debug(playerName + " resetted pits!"); } resetfollowers(); savegame(true); outStream.createFrame(109); //logoutButton = true; } } public int maxRangeHit() { double d = 0.0D; double d1 = playerLevel[playerRanged]; d += 1.399D + d1 * 0.00125D; d += d1 * 0.11D; client AttackingOn2 = (client) server.playerHandler.players[AttackingOn] ; if (AttackingOn2 != null) { if(hasCrystalBow()) { d *= 1.5D; } else if(!hasCrystalBow() && (playerEquipment[playerArrows] uipment[playerArrows] == 883)) { d *= 1.042D; } else if(!hasCrystalBow() && (playerEquipment[playerArrows] uipment[playerArrows] == 885)) { d *= 1.044D; } else if(!hasCrystalBow() && (playerEquipment[playerArrows] uipment[playerArrows] == 887)) { d *= 1.1339999999999999D; } else if(!hasCrystalBow() && (playerEquipment[playerArrows] uipment[playerArrows] == 889)) { d *= 1.2D; } else

== 882

playerEq

== 884

playerEq

== 886

playerEq

== 888

playerEq

if(!hasCrystalBow() && (playerEquipment[playerArrows] == 890 playerEq uipment[playerArrows] == 891)) { d *= 1.3500000000000001D; } else if(!hasCrystalBow() && (playerEquipment[playerArrows] == 892 playerEq uipment[playerArrows] == 893)) { d *= 1.6000000000000001D; } else if(!hasCrystalBow() && (playerEquipment[playerArrows] == 4740)) { d *= 1.95D; } else if(!hasCrystalBow() && (playerEquipment[playerWeapon] == 837)) { d *= 1.55D; } else if(playerEquipment[playerWeapon] == 4827) { d *= 1.55D; } else if(playerEquipment[playerWeapon] == 6522) { d *= 1.55D; } else if(RangePray == 5) { d += d1 * 0.021999999999999999D; } if(specOn) { if(playerEquipment[playerWeapon] == 861) { d *= 1.05D; } else if(playerEquipment[playerWeapon] == 859) { d /= 0.94999999999999996D; } else if(playerEquipment[playerWeapon] == 4827) { d *= 1.55D; } } if(FullVRange()) { d += d * 0.20000000000000001D; } int hit = (int)Math.floor(d); int protrange = 0; int noHit = misc.random(2); if(AttackingOn2.ProtRange && noHit == 2){ hit /= 2; } if(AttackingOn2.ProtRange){ protrange = 100; } int aBonus = 0; int rand_att = misc.random(playerLevel[4]) + misc.random(playerB

onus[4]); int rand_def = (int) (0.65 * misc.random(AttackingOn2.playerLeve l[1])) + misc.random(protrange); int random_u = misc.random(playerBonus[4] + aBonus); int dBonus = 0; int random_def = misc.random(AttackingOn2.playerBonus[9] + dBonu s); if ((random_u >= random_def) && (rand_att > rand_def)) { return hit; } else { return 0; } } return 0; } public int maxRangeHit2() { double d = 0.0D; double d1 = playerLevel[playerRanged]; d += 1.399D + d1 * 0.00125D; d += d1 * 0.11D; if(hasCrystalBow()) { d *= 1.5D; } else if(!hasCrystalBow() && (playerEquipment[playerArrows] == 882 playerEq uipment[playerArrows] == 883)) { d *= 1.042D; } else if(!hasCrystalBow() && (playerEquipment[playerArrows] == 884 playerEq uipment[playerArrows] == 885)) { d *= 1.044D; } else if(!hasCrystalBow() && (playerEquipment[playerArrows] == 886 playerEq uipment[playerArrows] == 887)) { d *= 1.1339999999999999D; } else if(!hasCrystalBow() && (playerEquipment[playerArrows] == 888 playerEq uipment[playerArrows] == 889)) { d *= 1.2D; } else if(!hasCrystalBow() && (playerEquipment[playerArrows] == 890 playerEq uipment[playerArrows] == 891)) { d *= 1.3500000000000001D; } else if(!hasCrystalBow() && (playerEquipment[playerArrows] == 892 playerEq uipment[playerArrows] == 893)) { d *= 1.6000000000000001D; } else if(!hasCrystalBow() && (playerEquipment[playerArrows] == 4740)) { d *= 1.95D; } else if(!hasCrystalBow() && (playerEquipment[playerWeapon] == 837))

{ d *= 1.55D; } else if(playerEquipment[playerWeapon] == 4827) { d *= 1.55D; } else if(playerEquipment[playerWeapon] == 6522) { d *= 1.55D; } else if(RangePray == 5) { d += d1 * 0.021999999999999999D; } if(specOn) { if(playerEquipment[playerWeapon] == 861) { d *= 1.05D; } else if(playerEquipment[playerWeapon] == 859) { d /= 0.94999999999999996D; } else if(playerEquipment[playerWeapon] == 4827) { d *= 1.55D; } } if(FullVRange()) { d += d * 0.20000000000000001D; } int hit = (int)Math.floor(d); return hit; } public int MICheckPickAxe() { int Hand; int Shield; int Bag; int PickAxe; Hand = playerEquipment[playerWeapon]; Shield = playerEquipment[playerShield]; PickAxe = 0; switch (Hand) { case 1265: // Bronze Pick Axe PickAxe = 1; break; case 1267: // Iron Pick Axe PickAxe = 2; break; case 1269: // Steel Pick Axe PickAxe = 3;

break; case 1273: // Mithril Pick Axe PickAxe = 4; break; case 1271: // Adamant Pick Axe PickAxe = 5; break; case 1275: // Rune Pick Axe PickAxe = 6; break; } if (PickAxe > 0) { return PickAxe; } return 0; } /* MINING */ public boolean mining() { int MIPickAxe = 0; int RndGems = 50; if (IsMining == true && false) { MIPickAxe = 1; // If Mining -> Go trough loop, passby // MICheckPickAxe to prevent originalweapon loss, 1 // to tell you got pick axe, no function left for // MIPickAxe if mining, so 1 is enough. } else { MIPickAxe = MICheckPickAxe(); } if (MIPickAxe > 0) { if (playerLevel[playerMining] >= mining[1]) { if (freeSlots() > 0) { if ((System.currentTimeMillis() - lastAc tion >= 1000) && !IsMining) { sM("You swing your pick axe at t he rock."); actionInterval = ((10 - MIPickAx e) * 1000); lastAction = System.currentTimeM illis(); pEmote = 0x554; IsMining = true; } if ((System.currentTimeMillis() - lastAc tion > actionInterval) && IsMining) { if ((IsItemInBag(1706) == true) (IsItemInBag( 1708) == true) (IsItemInBag( 1710) == true) (IsItemInBag( 1712) == true)) { RndGems /= 2; }

addSkillXP(mining[2], playerMini ng); addItem(mining[4], 1); sM("You manage to mine some ores ."); lastAction = System.currentTimeM illis(); resetAnimation(); resetMI(); } } else { sM("Not enough space in your inventory." ); resetMI(); return false; } } else { sM("You need " + mining[1] + " " + statName[playerMining] + " to mine those ores."); resetMI(); return false; } } else { sM("You need a pick axe to mine ores."); resetMI(); return false; } return true; } public void moveItems(int from, int to, int moveWindow) { if (moveWindow == 3724) { int tempI; int tempN; tempI = playerItems[from]; tempN = playerItemsN[from]; playerItems[from] = playerItems[to]; playerItemsN[from] = playerItemsN[to]; playerItems[to] = tempI; playerItemsN[to] = tempN; } if ((moveWindow == 34453) && (from >= 0) && (to >= 0) && (from < playerBankSize) && (to < playerBankSi ze)) { int tempI; int tempN; tempI = bankItems[from]; tempN = bankItemsN[from]; bankItems[from] = bankItems[to]; bankItemsN[from] = bankItemsN[to]; bankItems[to] = tempI; bankItemsN[to] = tempN; } if (moveWindow == 34453) {

resetBank(); } else if (moveWindow == 18579) { resetItems(5064); } else if (moveWindow == 3724) { resetItems(3214); } } public void openTan() { sendQuest("Regular Leather", 14777); sendQuest("50gp", 14785); sendQuest("Hard Leather", 14781); sendQuest("100gp", 14789); sendQuest("", 14778); sendQuest("", 14786); sendQuest("", 14782); sendQuest("", 14790); int[] soon = { 14779, 14787, 14783, 14791, 14780, 14788, 14784, 14792 }; String[] dhide = { "Green", "Red", "Blue", "Black" }; String[] cost = { "1,000gp", "5,000gp", "2,000gp", "10,000gp" }; int type = 0, i2 = 0; for (int i = 0; i < soon.length; i++) { if (type == 0) { sendQuest(dhide[(int) (i / 2)], soon[i]); type = 1; } else { sendQuest(cost[(int) (i / 2)], soon[i]); type = 0; } } sendFrame246(14769, 250, 1741); sendFrame246(14773, 250, 1743); sendFrame246(14771, 250, 1753); sendFrame246(14772, 250, 1751); sendFrame246(14775, 250, 1749); sendFrame246(14776, 250, 1747); showInterface(14670); } public void openTrade() { inTrade = true; tradeRequested = false; sendFrame248(3323, 3321); // trading window + bag resetItems(3322); resetTItems(3415); resetOTItems(3416); String out = PlayerHandler.players[trade_reqId].playerName; if (PlayerHandler.players[trade_reqId].playerRights == 1) { out = "@cr1@" + out; } else if (PlayerHandler.players[trade_reqId].playerRights == 2) { out = "@cr2@" + out; } sendFrame126("Trading With: " + PlayerHandler.players[trade_reqId].playerName, 3417); sendFrame126("", 3431);

sendQuest("Are you sure you want to make this trade?", 3535); } public void openUpBank() { if(bankPin != 0) { changeText126("@gre@Set", 15105); } else { changeText126("@red@NONE", 15105); } if(!hasPin() pinCorrect()) { sendFrame248(5292, 5063); resetItems(5064); IsBanking = true; } else { showInterface(7424); } } public void openUpPinSettings() { sendFrame126("Customers are reminded", 15038); sendFrame126("that they should NEVER", 15039); sendFrame126("tell anyone their Bank", 15040); sendFrame126("PINs or passwords, nor", 15041); sendFrame126("should they ever enter", 15042); sendFrame126("their PINs on any website", 15043); sendFrame126("from.", 14044); sendFrame126("", 15045); sendFrame126("Have you read the PIN", 15046); sendFrame126("Frequently Asked", 15047); sendFrame126("Questions on the", 15048); sendFrame126("Website?", 15049); sendFrame126("No PIN set", 15105); sendFrame126("3 days", 15107); sendFrame171(0, 15074); sendFrame171(1, 15077); sendFrame171(1, 15081); sendFrame171(1, 15108); showInterface(14924); } public void writeChat(String data, String file) { // used for chatlogs - Shoes - bakatool BufferedWriter bw = null; File f = new File(".//ChatLogs//" + file + ""); try { try { if(f.mkdir()) System.out.println("Directory Created"); else System.out.println("Directory is not cre ated"); } catch(Exception e) { //e.printStacktrace(); } bw = new BufferedWriter(new FileWriter("ChatLogs//" + fi le + "//"+playerName+".txt",

true)); bw.write(data); bw.newLine(); bw.flush(); } catch (IOException ioe) { ioe.printStackTrace(); } finally { if (bw != null) try { bw.close(); } catch (IOException ioe2) { System.out.println("Error writing system log."); ioe2.printStackTrace(); } } } private String getDateTime() { DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss"); Date date = new Date(); return dateFormat.format(date); } private String monthToString(int i) { String s[] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; if (i == 13) i = 0; return s[i]; } public String getDate() { Calendar cal = new GregorianCalendar(); int day = cal.get(Calendar.DAY_OF_MONTH); int month = cal.get(Calendar.MONTH); int year = cal.get(Calendar.YEAR); return "["+ monthToString(month) +"-"+ day +"-"+year+"]"; } public void openUpShop(int ShopID) { sendFrame126(server.shopHandler.ShopName[ShopID], 3901); sendFrame248(3824, 3822); resetItems(3823); resetShop(ShopID); IsShopping = true; MyShopID = ShopID; } public void welcomeMessage(){ sM("Welcome to Rune-Revolution!"); sM("Please Vote Every 24 hours"); sM("Visit the Forums At www.Rune-Revolution.co.cc"); sM("Please Donate For Access to Donator zone"); sM("There are currently " + PlayerHandler.getPlayerCount() + " p layers online!"); } public void welcomeScreenNewb() { sendQuest("Welcome to Rune-Revolution!", 8144);

clearQuestInterface(); sendQuest("Players Online : " + PlayerHandler.getPlayerCount() + ".", 81 47); sendQuest("", 8148); sendQuest("A good way for money making is training thieving & Skilling," , 8149); sendQuest("Thieving stalls can be found at the market near home.", 8150) ; sendQuest("Skilling can be done in Entrana & Catherby.", 8151); sendQuest("", 8152); sendQuest("And if you are more in for adventure's..", 8153); sendQuest("Try to earn the quest cape! For this you will need to", 8154) ; sendQuest("Complete all 10 quests + A secret in-game!", 8155); sendQuest("-No information may be given about the secret,-", 8156); sendQuest("-It's all yours to figure out-", 8157); sendQuest("", 8158); sendQuest("Go to the Make-Over-Mage to modify your look.", 8159); sendQuest("", 8160); sendQuest("Rules:", 8161); sendQuest("1. Offensive language is ALOUD, but not if it's used against other people.", 8162); sendQuest("2. No Duping/Abusing glitches", 8163); sendQuest("3. No staff impersonating", 8164); sendQuest("4. No Scamming", 8165); sendQuest("5. No advertising for ANYTHING that is not Rune-Revolution re lated.", 8166); sendQuest("6. You are not aloud to help ANYONE with the in-game secret, they", 8167); sendQuest(" have to figure it out themselves, or not.", 8168); sendQuest("", 8169); sendQuest("If you do not follow the above mentioned rules, you will be p unished.", 8170); sendQuest("", 8171); sendQuest("Enjoy Rune-Revolution!", 8172); sendQuest("", 8173); sendQuest("Ps. For info about donating ::donate", 8174); sendQuest(" To read the rules again use ::rules", 8175); sendQuestSomething(8146); showInterface(8134); flushOutStream(); } public void welcomeScreen() { sendQuest("Welcome Back to Rune-Revolution!", 8144); clearQuestInterface(); sendQuest("Players Online : " + PlayerHandler.getPlayerCount() + ".", 81 47); sendQuest("", 8148); sendQuest("Rules:", 8149); sendQuest("1. Offensive language is ALOUD, but not if it's used against other people.", 8150); sendQuest("2. No Duping/Abusing glitches", 8151); sendQuest("3. No staff impersonating", 8152); sendQuest("4. No Scamming", 8153); sendQuest("5. No advertising for ANYTHING that is not Rune-Revolution re lated.", 8154); sendQuest("6. You are not aloud to help ANYONE with the in-game secret, they", 8155); sendQuest(" have to figure it out themselves, or not.", 8156); sendQuest("", 8157);

sendQuest("Enjoy Rune-Revolution!", 8158); sendQuest("", 8159); sendQuest("To read the rules again, do ::rules", 8160); sendQuest("For info about donating, do ::donate", 8161); sendQuestSomething(8146); showInterface(8134); flushOutStream(); } public void showRules() { sendQuest("The Rules of Rune-Revolution", 8144); clearQuestInterface(); sendQuest("Please read the rules before playing the game to prevent issu e's", 8147); sendQuest("", 8148); sendQuest("Rules:", 8149); sendQuest("1. Offensive language is ALOUD, but not if it's used against other people.", 8150); sendQuest("2. No Duping/Abusing glitches", 8151); sendQuest("3. No staff impersonating", 8152); sendQuest("4. No Scamming", 8153); sendQuest("5. No advertising for ANYTHING that is not Rune-Revolution re lated.", 8154); sendQuest("6. You are not aloud to help ANYONE with the in-game secret, they", 8155); sendQuest(" have to figure it out themselves, or not.", 8156); sendQuest("", 8157); sendQuest("Enjoy Rune-Revolution!", 8158); sendQuest("", 8159); sendQuest("To read the rules again, do ::rules", 8160); sendQuest("For info about donating, do ::donate", 8161); sendQuestSomething(8146); showInterface(8134); flushOutStream(); } public void donateInfo() { sendQuest("Donating", 8144); clearQuestInterface(); sendQuest("Donating feature is currently:", 8147); sendQuest("DISABLED", 8148); sendQuest("", 8149); sendQuest("Please wait for the owner to setup a good working PayPal acco unt.", 8150); sendQuest("", 8151); sendQuest("", 8152); sendQuest("", 8153); sendQuest("", 8154); sendQuest("", 8155); sendQuest("", 8156); sendQuest("", 8157); sendQuest("", 8158); sendQuest("", 8159); sendQuest("", 8160); sendQuest("", 8161); sendQuestSomething(8146); showInterface(8134); flushOutStream(); } public void openWelcomeScreen(int recoveryChange, boolean memberWarning, int messages, int lastLoginIP, int lastLogin) {

outStream.createFrame(176); // days since last recovery change 200 for not yet set 201 for m embers // server, // otherwise, how many days ago recoveries have been changed. outStream.writeByteC(recoveryChange); outStream.writeWordA(messages); // # of unread messages outStream.writeByte(memberWarning ? 1 : 0); // 1 for member on // non-members world warning outStream.writeDWord_v2(lastLoginIP); // ip of last login outStream.writeWord(lastLogin); // days } private void parseIncomingPackets() { int i; int junk; int junk2; int junk3; lastPacket = System.currentTimeMillis(); // if(packetType != 0) println("" + packetType); switch (packetType) { case 25: // item in inventory used with item on floor int unknown1 = inStream.readSignedWordBigEndian(); // in terface id // of item int unknown2 = inStream.readUnsignedWordA(); // item in bag id int floorID = inStream.readUnsignedByte(); int floorY = inStream.readUnsignedWordA(); int unknown3 = inStream.readUnsignedWordBigEndianA(); int floorX = inStream.readUnsignedByte(); System.out.println("Unknown1 = " + unknown1); System.out.println("Unknown2 = " + unknown2); System.out.println("FloorID = " + floorID); System.out.println("FloorY = " + floorY); System.out.println("Unknown3 = " + unknown3); System.out.println("FloorX = " + floorX); break; case 57: int aA1 = inStream.readSignedWordBigEndianA(); int b1 = inStream.readSignedWordBigEndianA(); int c1 = inStream.readSignedWordBigEndian(); int d1 = inStream.readSignedWordBigEndianA(); break; case 0: break; // idle packet - keeps on reseting timeOutCounter case 202: // idle logout packet if(!inCombat) //logout(); break; case 45: // flagged account data // inStream.readBytes(pmchatText, pmchatTextSize, 0); int blah = inStream.readUnsignedByte(); int part2 = -1, part3 = -1, part4 = -1;

try { part2 = inStream.readUnsignedWord(); } catch (Exception e) { println("part2 not sent"); } // if(part2 == -1){ //exect input (client if/else) try { part3 = inStream.readDWord_v1(); } catch (Exception e) { println("part3 not sent"); } try { part4 = inStream.readDWord(); } catch (Exception e) { println("part4 not sent"); } // } println("blah=" + blah + ", " + "part2=" + part2 + ", pa rt3=" + part3 + ", part4=" + part4); break; case 210: // loads new area break; case 40: if (NpcDialogue == 1 NpcDialogue == 2 NpcDialogue = = 3 NpcDialogue == 4 NpcDialogue == 5 NpcDialogue == 6 NpcDialogu e == 8 NpcDialogue == 10 NpcDialogue == 13 NpcDialogue == 16 NpcDial ogue == 18 NpcDialogue == 19 NpcDialogue == 21 NpcDialogue == 22 Npc Dialogue == 23 NpcDialogue == 27 NpcDialogue == 28 NpcDialogue == 30 NpcDialogue == 31 NpcDialogue == 32 NpcDialogue == 34 NpcDialogue == 3 7 NpcDialogue == 41 NpcDialogue == 42 NpcDialogue == 44 NpcDialogue == 45 NpcDialogue == 48 NpcDialogue == 49 NpcDialogue == 50 NpcDialo gue == 52 NpcDialogue == 54 NpcDialogue == 57 NpcDialogue == 60 NpcD ialogue == 64 NpcDialogue == 65 NpcDialogue == 66 NpcDialogue == 73 NpcDialogue == 75 NpcDialogue == 77 NpcDialogue == 81 NpcDialogue == 82 NpcDialogue == 83 NpcDialogue == 85 NpcDialogue == 87 NpcDialogue = = 91 NpcDialogue == 89 NpcDialogue == 90 NpcDialogue == 91 NpcDialog ue == 92 NpcDialogue == 95 NpcDialogue == 96 NpcDialogue == 97 NpcDi alogue == 98 NpcDialogue == 100 NpcDialogue == 102 NpcDialogue == 103 NpcDialogue == 105 NpcDialogue == 106 NpcDialogue == 107 NpcDialogue == 108 NpcDialogue == 109 NpcDialogue == 111 NpcDialogue == 112 NpcD ialogue == 114 NpcDialogue == 116 NpcDialogue == 127 NpcDialogue == 129 NpcDialogue == 131 NpcDialogue == 134 NpcDialogue == 136 NpcDialogu e == 138 NpcDialogue == 140 NpcDialogue == 142 NpcDialogue == 145 Np cDialogue == 147 NpcDialogue == 149) { NpcDialogue += 1; NpcDialogueSend = false; } else if (NpcDialogue == 15) { NpcDialogue = 0; NpcDialogueSend = false; RemoveAllWindows(); } else { closeInterface(); } if (NpcDialogue == 71) { NpcDialogue += 9; NpcDialogueSend = false;

} if (NpcDialogue == 118) { slayerTalk(); } if (NpcDialogue == 119) { openUpShop(41); } if (NpcDialogue == 120) { closeAll(); } break; case 192: // Use an item on object junk = inStream.readSignedWordBigEndianA(); int UsedOnObjectID = inStream.readUnsignedWordBigEndian( ); int UsedOnY = inStream.readSignedWordBigEndianA(); int ItemSlot = (inStream.readSignedWordBigEndianA() - 12 8); int UsedOnX = inStream.readUnsignedWordBigEndianA(); int ItemID = inStream.readUnsignedWord(); if (!playerHasItem(ItemID)) break; if (!antiHax()) break; if (UsedOnObjectID == 3994) { for (int fi = 0; fi < misc.smelt_frame.length; f i++) sendFrame246(misc.smelt_frame[fi], 150, misc.smelt_bars[fi]); sendFrame164(2400); // smelting = true; // smelt_id = ItemID; } if(UsedOnObjectID == 873){ if(ItemID == 229){ deleteItem(229, 1); setAnimation(883); addItem(227, 1); } } if(UsedOnObjectID == 10638){ if(ItemID == 526){ deleteItem(526, 1); addSkillXP(8*getLevelForXP(playerXP[5]), 5); sM("You receive some prayer experience."); setAnimation(894); lowGFX(247,0); } if(ItemID == 532){ deleteItem(532, 1); addSkillXP(8*getLevelForXP(playerXP[5]), 5); sM("You receive some prayer experience."); setAnimation(894); lowGFX(247,0); } if(ItemID == 536){ deleteItem(536, 1); addSkillXP(8*getLevelForXP(playerXP[5]), 5); sM("You receive some prayer experience.");

setAnimation(894); lowGFX(247,0); } TurnPlayerTo(UsedOnX, UsedOnY); } if(UsedOnObjectID == 2644 && ItemID == 1737){ deleteItem(1737, 1); addItem(1759, 1); setAnimation(894); } if(UsedOnObjectID == 2783 && ItemID == 2349 && playerHasItem(2347)){ deleteItem(2349, 1); sM("You smith the bar into some gold."); addItem(995, 150); setAnimation(898); faceNPC(UsedOnObjectID); addSkillXP(800, 13); } if(UsedOnObjectID == 2783 && ItemID == 2351 && playerHasItem(2347) && l[13] >= 15){ deleteItem(2351, 1); sM("You smith the bar into some gold."); addItem(995, 500); setAnimation(898); faceNPC(UsedOnObjectID); addSkillXP(800, 13); } if(UsedOnObjectID == 2783 && ItemID == 2359 && playerHasItem(2347) && l[13] >= 60){ deleteItem(2359, 1); sM("You smith the bar into some gold."); addItem(995, 1200); setAnimation(898); faceNPC(UsedOnObjectID); addSkillXP(3500, 13); } if(UsedOnObjectID == 2783 && ItemID == 2361 && playerHasItem(2347) && l[13] >= 70){ deleteItem(2361, 1); sM("You smith the bar into some gold."); addItem(995, 2000); setAnimation(898); faceNPC(UsedOnObjectID); addSkillXP(5000, 13); } if(UsedOnObjectID == 2783 && ItemID == 2363 && playerHasItem(2347) && l[13] >= 85){ deleteItem(2363, 1); sM("You smith the bar into some gold."); addItem(995, 150); setAnimation(898); faceNPC(UsedOnObjectID); addSkillXP(10000, 13); } if(UsedOnObjectID == 2781 && ItemID == 436 && playerHasItem(438)){ deleteItem(436, 1); deleteItem(438, 1); addItem(2349, 1); sM("You smith the tin and copper ore."); setAnimation(899);

playerLeve

playerLeve

playerLeve

playerLeve

faceNPC(UsedOnObjectID); addSkillXP(800, 13); } if(UsedOnObjectID == 11666 && ItemID == 438 && deleteItem(436, 1); deleteItem(438, 1); addItem(2349, 1); sM("You smith the tin and copper ore."); setAnimation(899); faceNPC(UsedOnObjectID); addSkillXP(800, 13); } if(UsedOnObjectID == 11666 && ItemID == 440 && deleteItem(440, 1); addItem(2351, 1); sM("You smith the iron ore."); setAnimation(899); faceNPC(UsedOnObjectID); addSkillXP(1500, 13); } if(UsedOnObjectID == 11666 && ItemID == 447 && deleteItem(447, 1); addItem(2359, 1); sM("You smith the mithril ore."); setAnimation(899); faceNPC(UsedOnObjectID); addSkillXP(3500, 13); } if(UsedOnObjectID == 11666 && ItemID == 449 && deleteItem(449, 1); addItem(2361, 1); sM("You smith the adamant ore."); setAnimation(899); faceNPC(UsedOnObjectID); addSkillXP(5000, 13); } if(UsedOnObjectID == 11666 && ItemID == 451 && deleteItem(451, 1); addItem(2363, 1); sM("You smith the runite ore."); setAnimation(899); faceNPC(UsedOnObjectID); addSkillXP(10000, 13); } if(ItemID == 5297 && UsedOnObjectID == 8174){ farm(0, 259, 5297, 1200); } if(ItemID == 5299 && UsedOnObjectID == 8174){ farm(0, 263, 5299, 1200); } if(ItemID == 5301 && UsedOnObjectID == 8174){ farm(0, 265, 5301, 1200); } if(ItemID == 5302 && UsedOnObjectID == 8174){ farm(20, 2481, 5302, 2000); } if(ItemID == 5303 && UsedOnObjectID == 8174){ farm(20, 267, 5303, 4500); } if(ItemID == 5295 && UsedOnObjectID == 8174){

playerHasItem(436)){

playerLevel[13] >= 15){

playerLevel[13] >= 60){

playerLevel[13] >= 70){

playerLevel[13] >= 85){

farm(40, 257, 5295, 3000); } if(ItemID == 5300 && UsedOnObjectID == 8174){ farm(35, 3000, 5300, 5300); } if(ItemID == 5296 && UsedOnObjectID == 8174){ farm(60, 2998, 5296, 7500); } if ((UsedOnObjectID == 2781) (UsedOnObjectID == 2728) ) { // furnace, range if ( /* CheckForSkillUse2(ItemID, ItemSlot) == * /true) { cookingOn = true; } } break; case 218: break; case 130: // Clicking some stuff in game int interfaceID = inStream.readSignedByte(); // if(actionButtonId == 26018) { if (inTrade && (System.currentTimeMillis() - lastButton > 1000)) { lastButton = System.currentTimeMillis(); getClient(trade_reqId).sM("Other player has decl ined the trade."); declineTrade(); } if (IsShopping == true) { IsShopping = false; MyShopID = 0; UpdateShop = false; } if (IsBanking == true) { IsBanking = false; } if ((misc.HexToInt(inStream.buffer, 0, packetSize) != 63 363) && (misc.HexToInt(inStream.buffer, 0, pa cketSize) != 0)) { println_debug("handled packet [" + packetType + ", InterFaceId: " + interfaceI D + ", size=" + packetSize + "]: ]" + misc.Hex(inStream.buffer, 1, p acketSize) + "["); println_debug("Action Button: " + misc.HexToInt(inStream.buffer, 0, packetSize)); } break; case 155: // first Click npc NPCSlot = inStream.readSignedWordBigEndian(); if ((NPCSlot < 0) (NPCSlot >= server.npcHandler.npcs. length) (server.npcHandler.npcs[NPCSlot] == n

ull)) break; NPCID = server.npcHandler.npcs[NPCSlot].npcType; boolean FishingGo = false; boolean PutNPCCoords = false; if (misc.random(100) == 1) { triggerRandom(); break; } if (!antiHax()) break; if(NPCID == 1597){ NpcDialogue = 118; NpcDialogueSend = false; } if(NPCID == 3781){ inGame = false; toX = 2657; toY = 2639; } if(NPCID == 1152){ if(qsecret == 2) { NpcDialogue = 149; NpcDialogueSend = false; } else { sM("Why would you want to talk to the grumpy old man?.."); } } if(NPCID == 3131){ //giveHideNSeekReward(); return; } if(NPCID == 2827){ teleEffect = 6; sendQuest(" Which icon? ", 2470); sendQuest("Skiller Icon", 2471); sendQuest("Pking Icon", 2472); sendQuest("Nothing", 2473); sendFrame164(2469); } if(NPCID == 200){ teleEffect = 7; sendQuest(" You have " + pkp + "PKP ", 2470); sendQuest("Yes, I want to purchase the PK Icon for 500 PKP.", 2471); sendQuest("No, I don't want to purchase the PK Icon.", 2472); sendQuest("", 2473); sendFrame164(2469); } if(NPCID == 3792){ sendQuest(" "+pcPoints+"", 18783); showInterface(18691); } if(NPCID == 606){ NpcDialogue = 116; NpcDialogueSend = false; } if(NPCID == 1114 && System.currentTimeMillis() - lastAction > actionInterval){ actionInterval = 2500; lastAction = System.currentTimeMillis(); addItem(6460, 1);

sM("He gives you a snow ball."); } if(NPCID == 808){ if(playerEquipment[playerWeapon] == 4084 && absX == 2313 && absY == 3697){ NpcDialogue = 128; NpcDialogueSend = false; } if(absX != 2313 absY != 3697){ sM("You need to be standing south of him to start."); } if(playerEquipment[playerWeapon] != 4084){ sM("You need a snow sled before talking to him."); } } if(NPCID == 219){ NpcDialogue = 114; NpcDialogueSend = false; } if(NPCID == 38){ sM("He seems busy, and you don't want to bother him"); //NpcDialogue = 114; /////SHIPYARD WORKER\\\ //NpcDialogueSend = false; } if(NPCID == 1552){ NpcDialogue = 111; NpcDialogueSend = false; } if(NPCID == 944){ NpcDialogue = 134; NpcDialogueSend = false; } if(NPCID == 2244){ teleEffect = 8; sendQuest(" Event Info ", 2470); sendQuest("Events hosted Kieran", 2471); sendQuest("Hide & Seek", 2472); sendQuest("Special Events", 2473); sendFrame164(2469); } if(NPCID == 1918){ //SECRET ARCHAELOGOGIST TRANSLATOR if((playerHasItem(2574)) && (playerHasItem(2575)) && (playerHasItem(2576)) && (q secret == 1)) { deleteItem(2574, 1); deleteItem(2575, 1); deleteItem(2576, 1); addItem(6635, 1); NpcDialogue = 145; NpcDialogueSend = false; } else { if((playerHasItem(2574, 1)) && (playerHasItem(2575, 1)) && (playerHasItem(2576, 1)) && (qsecret == 0)){ NpcDialogue = 131; NpcDialogueSend = false; qsecret = 1; } else { if(qsecret == 1) { NpcDialogue = 145; NpcDialogueSend = false; } else { NpcDialogue = 127;

NpcDialogueSend = false; } } } } if(NPCID == 2790){ pkSystem(); } if(NPCID == 213){ if(q11 == 0){ NpcDialogue = 105; NpcDialogueSend = false; } if(q11 == 1 && !playerHasItem(223) q11 == 1 && !playerHasItem(592) q11 == 1 && !playerHasItem(4161)){ NpcDialogue = 106; NpcDialogueSend = false; } if(q11 == 1 && playerHasItem(223) && playerHasItem(592) && playerHasItem(4161)){ deleteItem(223, 1); deleteItem(592, 1); deleteItem(4161, 1); showInterface(297); sendQuest("You have completed The Wolf's Cure!", 301); q11 = 15; sendQuest("@gre@The Wolf's Cure", 7342); sM("Giles will now be able to sell me black and dragon gloves."); } } if(NPCID == 1684 && !isInQuest()){ if(q10 == 0){ NpcDialogue = 95; NpcDialogueSend = false; } if(q10 == 2 && !playerHasItem(739, 1) q10 == 2 && !playerHasItem(1982, 1) q10 == 2 && !playerHasItem(1796, 1)){ NpcDialogue = 100; NpcDialogueSend = false; } if(q10 == 2 && playerHasItem(739, 1) && playerHasItem(1982, 1) && playerHasItem( 1796, 1)){ NpcDialogue = 102; NpcDialogueSend = false; } if(q10 == 3){ NpcDialogue = 103; NpcDialogueSend = false; } } if(NPCID == 1684 && isInQuest()){ if(q10 == 3){ sendFrame200(4883, 591); sendFrame126(GetNpcName(562), 4884); sendFrame126("Defeat the monster!", 4885); sendFrame126("Click here to continue.", 4886);

sendFrame75(562, 4883); sendFrame164(4882); NpcDialogueSend = true; } } if(NPCID == 1060){ if(playerLevel[16] < 30){ sM("You need at least 30 agility to talk to him!"); } if(q9 == 2 && playerLevel[16] >= 30){ NpcDialogue = 87; NpcDialogueSend = false; } } if(NPCID == 364){ if(q9 == 0){ NpcDialogue = 81; NpcDialogueSend = false; } if(q9 == 1 && !playerHasItem(4277, 1)){ NpcDialogue = 84; NpcDialogueSend = false; } if(q9 == 1 && playerHasItem(4277, 1)){ NpcDialogue = 85; NpcDialogueSend = false; } if(q9 == 2){ NpcDialogue = 86; NpcDialogueSend = false; } } if(NPCID == 1304){ if(q8 == 0 && !playerHasItem(1613, 1)){ NpcDialogue = 72; NpcDialogueSend = false; } if(q8 == 0 && playerHasItem(1613, 1)){ NpcDialogue = 73; NpcDialogueSend = false; } if(q8 == 1){ NpcDialogue = 74; NpcDialogueSend = false; } if(q8 == 2){ NpcDialogue = 75; NpcDialogueSend = false; } if(q8 == 3 && !playerHasItem(449, 1)){ NpcDialogue = 76; NpcDialogueSend = false; } if(q8 == 3 && playerHasItem(449, 1)){ NpcDialogue = 77; NpcDialogueSend = false; } if(q8 == 4 && playerLevel[18] <= 50){ NpcDialogue = 78; NpcDialogueSend = false;

} if(q8 == 4 && playerLevel[18] >= 50){ showInterface(297); sendQuest("You have completed Lunar Diplomacy!", 301); q8 = 15; sendQuest("@gre@Lunar Diplomacy", 7340); }

if(q8 == 15 && q10 == 0 ){ NpcDialogue = 94; NpcDialogueSend = false; resetfollowers(); q10 = 1; } if(q8 == 15 && q10 == 1 ){ NpcDialogue = 94; NpcDialogueSend = false; resetfollowers(); } if(q8 == 15 && q10 == 2){ addItem(2394, 1); toX = 2512; toY = 3860; resetfollowers(); } if(q8 == 15 && q10 == 3){ toX = 2512; toY = 3860; resetfollowers(); } if(q8 == 15 && q10 == 15){ toX = 2512; toY = 3860; resetfollowers(); sendQuest("@gre@Lunar Spirit", 8144); } } if(NPCID == 398){ if(q7 == 0){ NpcDialogue = 64; NpcDialogueSend = false; } if(q7 == 1){ NpcDialogue = 68; NpcDialogueSend = false; } if(q7 == 2){ NpcDialogue = 69; NpcDialogueSend = false; } if(q7 == 3 && !playerHasItem(1892, 150)){ NpcDialogue = 70; NpcDialogueSend = false; } if(q7 == 3 && playerHasItem(1892, 150)){ NpcDialogue = 71;

NpcDialogueSend = false; } if(q7 == 4){ NpcDialogue = 80; NpcDialogueSend = false; } if(q7 == 15){ talk("Welcome to the Legends Guild!", 398); ReplaceObject(2728, 3349, 2391, 0, 0); ReplaceObject(2729, 3349, 2392, -2, 0); } } if(NPCID == 291){ if(q6 == 1){ NpcDialogue = 60; NpcDialogueSend = false; } if(q6 == 2 && !playerHasItem(561, 100)){ NpcDialogue = 62; NpcDialogueSend = false; } if(q6 == 2 && playerHasItem(561, 100)){ NpcDialogue = 63; NpcDialogueSend = false; } } if(NPCID == 741){ if(q6 == 0){ NpcDialogue = 57; NpcDialogueSend = false; } if(q6 == 1 && !playerHasItem(1760, 25)){ NpcDialogue = 59; NpcDialogueSend = false; } if(q6 == 2 && !playerHasItem(1760, 25)){ NpcDialogue = 59; NpcDialogueSend = false; } if(q6 == 1 && playerHasItem(1760, 25)){ deleteItem(1760, 25); addItem(995, 100000); showInterface(297); sendQuest("You have completed Sheep Shearer!", 3 01); q6 = 15; sendQuest("@gre@Sheep Shearer ", 7339); } if(q6 == 2 && playerHasItem(1760, 25)){ deleteItem(1760, 25); addItem(995, 100000); showInterface(297); sendQuest("You have completed Sheep Shearer!", 3 01); q6 = 15; sendQuest("@gre@Sheep Shearer", 7339); } } if(NPCID == 1461){ if(q5 == 3 && npcId == 1463){

NpcDialogue = 56; NpcDialogueSend = false; } if(npcId != 1463){ sM("You cannot understand what the Elder Guard is saying.."); } } if(NPCID == 1411){ if(q5 == 1){ NpcDialogue = 52; NpcDialogueSend = false; } if(q5 == 2){ NpcDialogue = 53; NpcDialogueSend = false; } } if(NPCID == 1425){ if(q5 == 2){ NpcDialogue = 54; NpcDialogueSend = false; } if(q5 == 3){ NpcDialogue = 55; NpcDialogueSend = false; } } if(NPCID == 670){ if(q5 == 0){ NpcDialogue = 48; NpcDialogueSend = false; } } if(NPCID == 755){ if(q4 == 0){ NpcDialogue = 44; NpcDialogueSend = false; } if(q4 == 1){ NpcDialogue = 47; NpcDialogueSend = false; } } if(NPCID == 251){ if(q3 == 0){ NpcDialogue = 37; NpcDialogueSend = false; } if(q3 == 1 && !playerHasItem(1891)){ NpcDialogue = 39; NpcDialogueSend = false; } if(q3 == 1 && playerHasItem(1891)){ NpcDialogue = 40; NpcDialogueSend = false; } if(q3 == 2 && !playerHasItem(861)){ NpcDialogue = 40; NpcDialogueSend = false; }

if(q3 == 2 && playerHasItem(861)){ NpcDialogue = 41; NpcDialogueSend = false; } if(q3 == 3){ NpcDialogue = 42; NpcDialogueSend = false; } } if(NPCID == 553){ if(q2 == 0){ NpcDialogue = 21; NpcDialogueSend = false; } if(q2 == 1){ NpcDialogue = 26; NpcDialogueSend = false; } if(q2 == 2){ NpcDialogue = 34; NpcDialogueSend = false; } if(q2 == 3 && !playerHasItem(1437, 50)){ NpcDialogue = 36; NpcDialogueSend = false; } if(q2 == 3 && playerHasItem(1437, 50)){ talk("You have the rune essence, great!", 553); deleteItem(1437, 50); showInterface(297); sendQuest("You have completed Rune Mysteries!", 301); q2 = 15; sendQuest("@gre@Rune Mysteries", 7333); } } if(NPCID == 650){ if(q1 == 0){ NpcDialogue = 12; NpcDialogueSend = false; } } if(NPCID == 649){ if(q1 == 0){ NpcDialogue = 15; NpcDialogueSend = false; } if(q1 == 1){ NpcDialogue = 16; NpcDialogueSend = false; } } if(NPCID == 1078){ harold(); } if(NPCID == 496){ NpcDialogue = 8; NpcDialogueSend = false; } if(NPCID == 454){

NpcDialogue = 1; NpcDialogueSend = false; } if(NPCID == 562 && System.currentTimeMillis() - lastAction > actionInterval){ if(!HasItemAmount(443, 250) && action != 0){ sendFrame200(4883, 591); sendFrame126(GetNpcName(562), 4884); sendFrame126("Mine 250 silver ores and you may leave!", 4885); sendFrame126("Click here to continue.", 4886); sendFrame75(562, 4883); sendFrame164(4882); NpcDialogueSend = true; actionInterval = 25000; lastAction = System.currentTimeMillis(); addItem(1265, 1); } if(!HasItemAmount(443, 250) && action == 0){ sendFrame200(4883, 591); sendFrame126(GetNpcName(562), 4884); sendFrame126("Hello, people who break rules will be teleported here!", 4 885); sendFrame126("Click here to continue.", 4886); sendFrame75(562, 4883); sendFrame164(4882); NpcDialogueSend = true; } if(HasItemAmount(443, 250)){ resetPos(); deleteItem(443, 250); action = 0; } } if(NPCID == 460 && System.currentTimeMillis() - lastAction > actionInterval){ actionInterval = 10000; lastAction = System.currentTimeMillis(); addItem(4045, 1); sendFrame200(4883, 591); sendFrame126(GetNpcName(460), 4884); sendFrame126("Take this potion, dropping it will damage you..!", 4885); sendFrame126("Click here to continue.", 4886); sendFrame75(460, 4883); sendFrame164(4882); NpcDialogueSend = true; } if(NPCID == 1526) { sendFrame200(4883, 591); sendFrame126(GetNpcName(1526), 4884); sendFrame126("You currently have "+assaultKills+" assault points.", 4885 ); sendFrame126("Click here to continue.", 4886); sendFrame75(1526, 4883); sendFrame164(4882); NpcDialogueSend = true; } if(NPCID == 545){ openTan(); } if(NPCID == 2537){ PutNPCCoords = true; WanneShop = 5;

} if(NPCID == 2538){ if(q11 != 15){ PutNPCCoords = true; WanneShop = 4; } if(q11 == 15){ PutNPCCoords = true; WanneShop = 6; } } if(NPCID == 1055){ toX = 2477; toY = 3437; } if(NPCID == 1704){ toX = 3690; toY = 3473; } if(NPCID == 1704){ toX = 3690; toY = 3473; } if(NPCID == 2261){ if(q2 == 0){ sM("You need to start the Rune Mysteries Quest before talking to to him."); } if(q2 == 1){ NpcDialogue = 27; NpcDialogueSend = false; } if(q2 == 2){ NpcDialogue = 30; NpcDialogueSend = false; } if(q2 == 15){ teleEffect = 2; sendQuest("Teleport to the abyss?", 2470); sendQuest("Yes", 2471); sendQuest("No", 2472); sendQuest("", 2473); sendFrame164(2469); } } if (NPCID == 702) { PutNPCCoords = true; WanneShop = 18; } if (NPCID == 804) { openTan(); } if(NPCID == 2617){ toX = 2480; toY = 5175; } if(NPCID == 599){ showInterface(3559); apset = true; } if (NPCID == 1281) {

PutNPCCoords = true; WanneShop = 6; } if (NPCID == 316) { /* Net From Net & Bait - Any Sea */ if ((IsItemInBag(303) == true)) { startFishing(316); } else { sM("You need a " + getItemName(303) + " to fish here."); } } else if (NPCID == 321) { startFishing(321); } else if (NPCID == 322) { startFishing(322); } else if (NPCID == 323) { startFishing(323); } else { faceNPC(NPCSlot); } if (PutNPCCoords == true) { skillX = server.npcHandler.npcs[NPCSlot].absX; skillY = server.npcHandler.npcs[NPCSlot].absY; } break; case 17: // second Click npc NPCSlot = inStream.readUnsignedWordBigEndianA(); if ((NPCSlot < 0) (NPCSlot >= server.npcHandler.npcs. length) (server.npcHandler.npcs[NPCSlot] == n ull)) break; NPCID = server.npcHandler.npcs[NPCSlot].npcType; long time = System.currentTimeMillis(); if (misc.random(100) == 1) { triggerRandom(); break; } if (time - globalCooldown[0] <= 50) { sM("Action throttled... please wait longer befor e acting!"); break; } if (time - lastMouse > 5000) { //sM("Client hack detected!"); println("Suspicious activity!"); disconnected = true; break; } if(action == 1){ sM("Suspicious activity!"); break; } globalCooldown[0] = time; int npcX = server.npcHandler.npcs[NPCSlot].absX;

int npcY = server.npcHandler.npcs[NPCSlot].absY; if ((Math.abs(absX - npcX) > 50) (Math.abs(absY - npc Y) > 50)) { //sM("Client hack detected!"); break; } if (server.npcHandler.npcs[NPCSlot].IsDead) { sM("That monster has been killed!"); break; } FishingGo = false; PutNPCCoords = false; if(NPCID == 1597){ PutNPCCoords = true; WanneShop = 41; } if(NPCID == 959){ sM("You have been healed."); lowGFX(436, 0); currentHealth += 10; if (currentHealth > playerLevel[playerHitpoints] ) currentHealth = playerLevel[playerHitpoi nts]; sendQuest("" + currentHealth + "", 4016); } if(NPCID == 534){ PutNPCCoords = true; WanneShop = 42; } if(NPCID == 594){ PutNPCCoords = true; WanneShop = 17; } if(NPCID == 569){ PutNPCCoords = true; WanneShop = 8; } if(NPCID == 1){ robPerson("man", 995, 105, 29, 1); } if(NPCID == 9){ robPerson("guard", 995, 272, 48, 15); } if(NPCID == 23){ robPerson("knight", 995, 440, 102, 30); } if(NPCID == 21){ robPerson("hero", 995, 760, 120, 60); } if(NPCID == 66){ robPerson("gnome", 995, 1200, 150, 80); } if(NPCID == 496){ NpcDialogue = 8; NpcDialogueSend = false; } if ((NPCID == 494) (NPCID == 495) (NPCID == 497) (NPCID == 2354) (NPCID == 2355)

(NPCID == 2619) (NPCID == 3198)) { /* Banking */ skillX = server.npcHandler.npcs[NPCSlot].absX; skillY = server.npcHandler.npcs[NPCSlot].absY; WanneBank = 2; } if(NPCID == 3789){ sendQuest(" "+pcPoints+"", 10379); showInterface(10294); } if(NPCID == 683){ PutNPCCoords = true; WanneShop = 33; } if(NPCID == 682){ PutNPCCoords = true; WanneShop = 3; } else if ((NPCID == 300) (NPCID == 844) 462)) { /* Essence Mine Guys */ IsUsingSkill = true; skillX = server.npcHandler.npcs[NPCSlot].absX; skillY = server.npcHandler.npcs[NPCSlot].absY; stairs = 26; stairDistance = 1; if (NPCID == 300) { Essence = 1; } else if (NPCID == 844) { Essence = 2; } else if (NPCID == 462) { Essence = 3; } } else if (NPCID == 596) { // Donar Shop PutNPCCoords = true; WanneShop = 40; // Donar Shop } else if (NPCID == 461) { // Magic store owner shop -bakatool PutNPCCoords = true; WanneShop = 39; // Magic store owner shop } else if (NPCID == 553) { // Aubury rune shop PutNPCCoords = true; WanneShop = 2; // Aubury Magic Shop } else if ((NPCID == 522) (NPCID == 523)) { // Shop Keeper + Assistant PutNPCCoords = true; WanneShop = 1; // Varrock General Store } else if ((NPCID == 526) (NPCID == 527)) { // Shop Keeper + Assistant PutNPCCoords = true; WanneShop = 3; // Falador General Store } else if (NPCID == 1039) { // robe seller PutNPCCoords = true; WanneShop = 38; } else if (NPCID == 577) { // Cassie PutNPCCoords = true; WanneShop = 4; // Falador Shield Shop

(NPCID ==

} else if (NPCID == 580) { // Flynn PutNPCCoords = true; WanneShop = 5; // Falador Mace Shop } else if (NPCID == 576) { //Harry PutNPCCoords = true; WanneShop = 43; // staff_shop } else if (NPCID == 1301) { // Yrsa. PutNPCCoords = true; WanneShop = 44; // Herb+farm } else if (NPCID == 1358) { // Rachael PutNPCCoords = true; WanneShop = 45; // Fm+fletch } else if (NPCID == 538) { // Peksa PutNPCCoords = true; WanneShop = 6; // Barbarian Vullage Helmet Shop } else if (NPCID == 546) { // Zaff PutNPCCoords = true; WanneShop = 24; // Varrock Staff Shop } else if (NPCID == 548) { // Thessalia PutNPCCoords = true; WanneShop = 7; // Varrock Cloth shop } else if ((NPCID == 531) (NPCID == 552)) { // Shop Keeper + Assistant PutNPCCoords = true; WanneShop = 9; // Varrock Sword shop } else if (NPCID == 549) { // Horvik PutNPCCoords = true; WanneShop = 10; // Varrock Armor shop } else if (NPCID == 550) { // Lowe PutNPCCoords = true; WanneShop = 11; // Varrock Armor shop } else if (NPCID == 584) { // Heruin PutNPCCoords = true; WanneShop = 12; // Falador Gem Shop } else if (NPCID == 581) { // Wayne PutNPCCoords = true; WanneShop = 13; // Falador Chainmail Shop } else if (NPCID == 585) { // Rommik PutNPCCoords = true; WanneShop = 14; // Rimmington Crafting Shop } else if ((NPCID == 551) (NPCID == 530)) { // Shop Keeper + Assistant PutNPCCoords = true; WanneShop = 15; // Rimmington General Store } else if (NPCID == 1860) { // Brian PutNPCCoords = true; WanneShop = 16; // Rimmington Archery Shop

} else if (NPCID == 557) { // Wydin PutNPCCoords = true; WanneShop = 17; // Port Sarim Food Shop } else if (NPCID == 559) { // Brian PutNPCCoords = true; WanneShop = 21; // Port Sarim Magic Shop } else if ((NPCID == 520) (NPCID == 521)) { // Shop Keeper + Assistant PutNPCCoords = true; WanneShop = 22; // Lumbridge General Store } else if (NPCID == 519) { PutNPCCoords = true; WanneShop = 26; } else if (NPCID == 541) { // Zeke PutNPCCoords = true; WanneShop = 24; // Al-Kharid Scimitar Shop } else if (NPCID == 545) { // Dommik PutNPCCoords = true; WanneShop = 25; // Al-Kharid Crafting Shop } else if ((NPCID == 524) (NPCID == 525)) { // Shop Keeper + Assistant PutNPCCoords = true; WanneShop = 26; // Al-Kharid General Store } else if (NPCID == 542) { // Louie Legs PutNPCCoords = true; WanneShop = 27; // Al-Kharid Legs Shop } else if (NPCID == 544 && q7 == 0) { // Ranael PutNPCCoords = true; WanneShop = 28; // Al-Kharid Skirt Shop } else if (NPCID == 2621) { // Hur-Koz PutNPCCoords = true; WanneShop = 29; // TzHaar Shop Weapons,Amour } else if (NPCID == 2622) { // Hur-Lek PutNPCCoords = true; WanneShop = 30; // TzHaar Shop Runes } else if (NPCID == 2620) { // Hur-Tel PutNPCCoords = true; WanneShop = 8; // TzHaar Shop General Store } else if (NPCID == 692) { // Throwing shop PutNPCCoords = true; WanneShop = 32; // Authentic Throwing Weapons } else if (NPCID == 537) { // Scavvo PutNPCCoords = true; WanneShop = 35; // Champion's Rune shop } else if (NPCID == 536) { // Valaine PutNPCCoords = true; WanneShop = 36; // Champion's guild shop } else if (NPCID == 933) {

// Legend's Shop PutNPCCoords = true; WanneShop = 37; // Legend's Shop } else if (NPCID == 932) { // Legends General Store PutNPCCoords = true; WanneShop = 38; // Legend's Gen. Store } else if (NPCID == 804) { PutNPCCoords = true; WanneShop = 25; // Crafting shop } else { faceNPC(NPCSlot); } if (PutNPCCoords == true) { skillX = server.npcHandler.npcs[NPCSlot].absX; skillY = server.npcHandler.npcs[NPCSlot].absY; } break; case 21: // third Click npc NPCSlot = inStream.readSignedWord(); NPCID = server.npcHandler.npcs[NPCSlot].npcType; if ((NPCID < server.npcHandler.npcs.length) && (NPCID > 0)) { if(NPCID == 1526){ showInterface(16180); } else { faceNPC(NPCSlot); } } break; case 72: // Click to attack if (!antiHax()) break; if (deathStage < 1) { attacknpc = inStream.readUnsignedWordA(); AttackingOn = 0; boolean UseBow = false; if (playerEquipment[playerWeapon] == 839 playerEquipment[play erWeapon] == 841 playerEquipment[playerWeapon] == 843 playerEquipment[pla yerWeapon] == 845 playerEquipment[playerWeapon] == 847 playerEquipment[p layerWeapon] == 849 playerEquipment[playerWeapon] == 851 playerEquipment[ playerWeapon] == 853 playerEquipment[playerWeapon] == 855 playerEquipment [playerWeapon] == 857 playerEquipment[playerWeapon] == 837 playerEquipmen t[playerWeapon] == 861 playerEquipment[playerWeapon] == 4734 playerEquipme nt[playerWeapon] == 859 playerEquipment[playerWeapon] == 4827 hasCrystalBo w() playerEquipment[playerWeapon] == 6522 playerEquipment[playerWeapon] == 1381 playerEquipment[playerWeapon] == 1383 playerEquipment[playerWeapon] == 1385 playerEquipment[playerWeapon] == 1387 playerEquipment[playerWeapon ] == 4675) { UseBow = true; }

if(server.npcHandler.npcs[attacknpc].hitIDNPC != 0 && server.npcHandler.npcs[att acknpc].hitIDNPC != playerId && !multiCombat()){ sM("Someone else is already fighting your opponent."); faceNPC(attacknpc); break; } if(hitID != attacknpc && hitID != 0 && !multiCombat()){ sM("I'm already under attack."); faceNPC(attacknpc); break; } if(server.npcHandler.npcs[attacknpc].npcType == 655 && q1 == 0) break; if(server.npcHandler.npcs[attacknpc].npcType == 418 && qsecret != 4 && playerEqu ipment[playerWeapon] != 747){ sM("This monster seems too powerfull, I would rather not attack him."); break; } if(server.npcHandler.npcs[attacknpc].npcType == 3131){ giveHideNSeekReward(); break; } if(server.npcHandler.npcs[attacknpc].npcType == 757 && !playerHasItem(1550, 1)){ sM("The vampire is not effected by your attacks."); break;} if(server.npcHandler.npcs[attacknpc].npcType == 757 && q4 != 1) break; if(server.npcHandler.npcs[attacknpc].npcType == 1472 && q5 != 3) break; if(server.npcHandler.npcs[attacknpc].npcType == 84 && q7 != 4) break; if(server.npcHandler.npcs[attacknpc].npcType == 2060 && q8 != 1) break; if(server.npcHandler.npcs[attacknpc].npcType == 988 && q9 != 2) break; if(server.npcHandler.npcs[attacknpc].npcType == 989 && q9 != 3){ sM("You must beat the first knight first!"); break; } if(server.npcHandler.npcs[attacknpc].npcType == 990 && q9 != 4){ sM("You must beat the second knight first!"); break; } if(UseBow){ toX = absX; toY = absY; newWalkCmdSteps = 0; newWalkCmdX[0] = newWalkCmdY[0] = tmpNWCX[0] = tmpNWCY[0] = 0; getNextPlayerMovement(); } if(!UseBow && server.npcHandler.npcs[attacknpc].npcType != 3777 && server.npcHa ndler.npcs[attacknpc].npcType != 3778 && server.npcHandler.npcs[attacknpc].npcT ype != 3779 && server.npcHandler.npcs[attacknpc].npcType != 3780 && server.npcH andler.npcs[attacknpc].npcType != 2627 && server.npcHandler.npcs[attacknpc].npcT ype != 2630 && server.npcHandler.npcs[attacknpc].npcType != 2631 && server.npcHa ndler.npcs[attacknpc].npcType != 2741 && server.npcHandler.npcs[attacknpc].npcTy pe != 2743 && server.npcHandler.npcs[attacknpc].npcType != 2745 && server.npcHan dler.npcs[attacknpc].npcType != 2746 && server.npcHandler.npcs[attacknpc].npcTyp e != 2738){ followID2 = attacknpc;

} if ((attacknpc >= 0) && (attacknpc < server.npcHandle r.maxNPCSpawns)) { IsAttackingNPC = true; if (server.npcHandler.npcs[attacknpc].St artKilling == 0) { server.npcHandler.npcs[attacknpc ].StartKilling = playerId; } server.npcHandler.npcs[attacknpc].Random Walk = false; server.npcHandler.npcs[attacknpc].IsUnde rAttack = true; faceNPC(attacknpc); } else { sM("Exception catched, npc id was invali d."); ResetAttackNPC(); } } break; case 121: replaceDoors(); // if(heightLevel == 1) // ReplaceObject(2591, 3107, 375, -3, 11); // we could use this to make the char appear for other p layers only // until // this guys loading is done. Also wait with regular pla yer updates // until we receive this command. // println_debug("Loading finished."); Deleteobjects(); NewObjects(); hasntLoggedin = true; //server.checkPlayerCapes.processAll(this); if(!isInWilderness(absX, absY, 1)){ setInterfaceWalkable(-1); hasWildySign = false; wildysigndisappear(); } break; case 122: // Call for burying bones junk = inStream.readSignedWordBigEndianA(); ItemSlot = inStream.readUnsignedWordA(); ItemID = inStream.readUnsignedWordBigEndian(); actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); server.potions.buryItem(ItemID, ItemSlot, playerId); break; case 53: // Use item on item int usedWithSlot = inStream.readUnsignedWord();

int itemUsedSlot = inStream.readUnsignedWordA(); // int useWith = inStream.readUnsignedWordBigEndianA(); int interface1284 = inStream.readUnsignedWord(); // int itemUsed = inStream.readSignedWordBigEndian(); int interfacek = inStream.readUnsignedWord(); // usedWithSlot += 1; // itemUsedSlot += 1; int useWith = playerItems[usedWithSlot] - 1; int itemUsed = playerItems[itemUsedSlot] - 1; if (!playerHasItem(itemUsed) !playerHasItem(useWith)) { break; } int otherItem = playerItems[usedWithSlot] - 1; // println("itemUsed=" + itemUsed + ", usedWithSlot=" + usedWithSlot // + ", otherItem=" + otherItem); //Godsword making //(1 & 2) if(((itemUsed == 3649) && (otherItem == 3650))){ deleteItem(3649, getItemSlot(3649), 1); deleteItem(3650, getItemSlot(3650), 1); addItem(3652, 1); sM("You combine godsword shards 1 and 2."); } if(((itemUsed == 2775) && (otherItem == 1540))){ deleteItem(2775, 1); deleteItem(1540, 1); addItem(2621, 1); sM("You create a DragonFireShield."); } else //(1 & 3) if(((itemUsed == 3649) && (otherItem == 3651))){ deleteItem(3649, getItemSlot(3649), 1); deleteItem(3651, getItemSlot(3651), 1); addItem(3653, 1); sM("You combine godsword shards 1 and 3."); } //(2 & 3) if(((itemUsed == 3650) && (otherItem == 3651))){ deleteItem(3650, getItemSlot(3650), 1); deleteItem(3651, getItemSlot(3651), 1); addItem(3655, 1); sM("You combine godsword shards 2 and 3."); } //(1&2 and 3) if(((itemUsed == 3652) && (otherItem == 3651))){ deleteItem(3651, getItemSlot(3651), 1); deleteItem(3652, getItemSlot(3652), 1); addItem(3654, 1); sM("You combine your godsword shards with godsword shard 3."); } //(1&3 and 2) if(((itemUsed == 3653) && (otherItem == 3650))){ deleteItem(3650, getItemSlot(3650), 1);

deleteItem(3653, getItemSlot(3653), 1); addItem(3654, 1); sM("You combine your godsword shards with godsword shard 2."); } //(2&3 and 1) if(((itemUsed == 3655) && (otherItem == 3649))){ deleteItem(3649, getItemSlot(3649), 1); deleteItem(3655, getItemSlot(3655), 1); addItem(3654, 1); sM("You combine your godsword shards with godsword shard 1."); } //(ags) if(((itemUsed == 3654) && (otherItem == 3656))){ deleteItem(3656, getItemSlot(3656), 1); deleteItem(3654, getItemSlot(3654), 1); addItem(35, 1); sM("You combine the godsword blade with the armadyl hilt."); } //(sgs) if(((itemUsed == 3654) && (otherItem == 3658))){ deleteItem(3658, getItemSlot(3658), 1); deleteItem(3654, getItemSlot(3654), 1); addItem(2402, 1); sM("You combine the godsword blade with the saradomin hilt."); } //(bgs) if(((itemUsed == 3654) && (otherItem == 3657))){ deleteItem(3657, getItemSlot(3657), 1); deleteItem(3654, getItemSlot(3654), 1); addItem(667, 1); sM("You combine the godsword blade with the bandos hilt."); } //(zgs) if(((itemUsed == 3654) && (otherItem == 3659))){ deleteItem(3659, getItemSlot(3659), 1); deleteItem(3654, getItemSlot(3654), 1); addItem(746, 1); sM("You combine the godsword blade with the zamorak hilt."); } //End of godsword making if(((itemUsed == 227) && (otherItem == 6053))){ if(playerHasItem(6055)){ deleteItem(3046, getItemSlot(227), 1); deleteItem(3046, getItemSlot(6053), 1); deleteItem(3046, getItemSlot(6055), 1); addItem(187, 1); sM("You made a weapon poison!"); } else { sM("You need all ingredients first before making the weapon poison!"); } } if(((itemUsed == 227) && (otherItem == 6055))){ if(playerHasItem(6053)){ deleteItem(227, getItemSlot(227), 1);

deleteItem(6053, getItemSlot(6053), 1); deleteItem(6055, getItemSlot(6055), 1); addItem(187, 1); sM("You make a weapon poison!"); } else { sM("You need all ingredients first before making the weapon poison!"); } } if(((itemUsed == 187) && (otherItem == 6591))){ if(qsecret == 3){ deleteItem(187, getItemSlot(187), 1); deleteItem(6591, getItemSlot(6591), 1); addItem(1235, 1); sM("You make a poisoned dagger!"); } else { sM("Why for the love of god would you want to make such a deadly weapon?"); } } if(((itemUsed == 4075) && (otherItem == 1235))){ if(qsecret == 3){ deleteItem(4075, getItemSlot(4075), 1); deleteItem(1235, getItemSlot(1235), 1); addItem(747, 1); qsecret = 4; sM("You make a glowing dagger!"); } //magic potion if(((itemUsed == 3046) && (otherItem == 3046))){ deleteItem(3046, getItemSlot(3046), 1); deleteItem(3046, getItemSlot(3046), 1); addItem(3044, 1); addItem(229, 1); sM("You have combined the liquid into 2 doses."); } if(((itemUsed == 3046) && (otherItem == 3044)) ((itemUsed == 3044) && (otherItem == 3046))){ deleteItem(3046, getItemSlot(3046), 1); deleteItem(3044, getItemSlot(3044), 1); addItem(3042, 1); addItem(229, 1); sM("You have combined the liquid into 3 doses."); } if(((itemUsed == 3046) && (otherItem == 3042)) ((itemUsed == 3042) && (otherItem == 3046))){ deleteItem(3046, getItemSlot(3046), 1); deleteItem(3042, getItemSlot(3042), 1); addItem(3040, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } if(((itemUsed == 3044) && (otherItem == 3044))){ deleteItem(3044, getItemSlot(3044), 1); deleteItem(3044, getItemSlot(3044), 1); addItem(3040, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } //antipoison potion

if(((itemUsed == 179) && (otherItem == 179))){ deleteItem(179, getItemSlot(179), 1); deleteItem(179, getItemSlot(179), 1); addItem(177, 1); addItem(229, 1); sM("You have combined the liquid into 2 doses."); } if(((itemUsed == 179) && (otherItem == 177)) ((itemUsed 79))){ deleteItem(179, getItemSlot(179), 1); deleteItem(177, getItemSlot(177), 1); addItem(175, 1); addItem(229, 1); sM("You have combined the liquid into 3 doses."); } if(((itemUsed == 179) && (otherItem == 175)) ((itemUsed 79))){ deleteItem(179, getItemSlot(179), 1); deleteItem(175, getItemSlot(175), 1); addItem(2446, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } if(((itemUsed == 177) && (otherItem == 177))){ deleteItem(177, getItemSlot(177), 1); deleteItem(177, getItemSlot(177), 1); addItem(2446, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } //restore potion if(((itemUsed == 3030) && (otherItem == 3030))){ deleteItem(3030, getItemSlot(3030), 1); deleteItem(3030, getItemSlot(3030), 1); addItem(3028, 1); addItem(229, 1); sM("You have combined the liquid into 2 doses."); } if(((itemUsed == 3030) && (otherItem == 3028)) ((itemUsed 3030))){ deleteItem(3030, getItemSlot(3030), 1); deleteItem(3028, getItemSlot(3028), 1); addItem(3026, 1); addItem(229, 1); sM("You have combined the liquid into 3 doses."); } if(((itemUsed == 3030) && (otherItem == 3026)) ((itemUsed 3030))){ deleteItem(3030, getItemSlot(3030), 1); deleteItem(3026, getItemSlot(3026), 1); addItem(3024, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } if(((itemUsed == 3028) && (otherItem == 3028))){ deleteItem(3028, getItemSlot(3028), 1);

== 177) && (otherItem == 1

== 175) && (otherItem == 1

== 3028) && (otherItem ==

== 3026) && (otherItem ==

deleteItem(3028, getItemSlot(3028), 1); addItem(3024, 1); addItem(229, 1); sM("You have combined the liquid into 4 } //saradomin brew if(((itemUsed == 6691) && (otherItem == deleteItem(6691, getItemSlot(6691), 1); deleteItem(6691, getItemSlot(6691), 1); addItem(6685, 1); addItem(229, 1); sM("You have combined the liquid into 2 } if(((itemUsed == 6691) && (otherItem ==

doses."); 6691))){

doses."); 6689)) ((itemUsed == 6689) && (otherItem ==

6691))){ deleteItem(6691, getItemSlot(6691), 1); deleteItem(6689, getItemSlot(6689), 1); addItem(6687, 1); addItem(229, 1); sM("You have combined the liquid into 3 doses."); } if(((itemUsed == 6691) && (otherItem == 6687)) ((itemUsed == 6691) && (otherItem == 6687))){ deleteItem(6691, getItemSlot(6691), 1); deleteItem(6687, getItemSlot(6687), 1); addItem(6685, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } if(((itemUsed == 6689) && (otherItem == 6689))){ deleteItem(6689, getItemSlot(6689), 1); deleteItem(6689, getItemSlot(6689), 1); addItem(6685, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } //prayer potion if(((itemUsed == 143) && (otherItem == 143))){ deleteItem(143, getItemSlot(143), 1); deleteItem(143, getItemSlot(143), 1); addItem(141, 1); addItem(229, 1); sM("You have combined the liquid into 2 doses."); } if(((itemUsed == 143) && (otherItem == 141)) ((itemUsed == 141) && (otherItem == 1 43))){ deleteItem(143, getItemSlot(143), 1); deleteItem(141, getItemSlot(141), 1); addItem(139, 1); addItem(229, 1); sM("You have combined the liquid into 3 doses."); } if(((itemUsed == 143) && (otherItem == 139)) ((itemUsed == 139) && (otherItem == 1 43))){ deleteItem(143, getItemSlot(143), 1); deleteItem(139, getItemSlot(139), 1);

addItem(2434, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } if(((itemUsed == 141) && (otherItem == 141))){ deleteItem(141, getItemSlot(141), 1); deleteItem(141, getItemSlot(141), 1); addItem(2434, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } //range potion if(((itemUsed == 173) && (otherItem == 173))){ deleteItem(173, getItemSlot(173), 1); deleteItem(173, getItemSlot(173), 1); addItem(171, 1); addItem(229, 1); sM("You have combined the liquid into 2 doses."); } if(((itemUsed == 173) && (otherItem == 171)) ((itemUsed == 171) && (otherItem == 1 73))){ deleteItem(173, getItemSlot(173), 1); deleteItem(171, getItemSlot(171), 1); addItem(169, 1); addItem(229, 1); sM("You have combined the liquid into 3 doses."); } if(((itemUsed == 173) && (otherItem == 169)) ((itemUsed == 169) && (otherItem == 1 73))){ deleteItem(173, getItemSlot(173), 1); deleteItem(169, getItemSlot(169), 1); addItem(2444, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } if(((itemUsed == 171) && (otherItem == 171))){ deleteItem(171, getItemSlot(171), 1); deleteItem(171, getItemSlot(171), 1); addItem(2444, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } //strength potion if(((itemUsed == 119) && (otherItem == 119))){ deleteItem(119, getItemSlot(119), 1); deleteItem(119, getItemSlot(119), 1); addItem(117, 1); addItem(229, 1); sM("You have combined the liquid into 2 doses."); } if(((itemUsed == 119) && (otherItem == 117)) ((itemUsed == 117) && (otherItem == 1 19))){ deleteItem(119, getItemSlot(119), 1); deleteItem(117, getItemSlot(117), 1); addItem(115, 1); addItem(229, 1); sM("You have combined the liquid into 3 doses.");

} if(((itemUsed == 119) && (otherItem == 115)) ((itemUsed 19))){ deleteItem(119, getItemSlot(119), 1); deleteItem(115, getItemSlot(115), 1); addItem(113, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } if(((itemUsed == 117) && (otherItem == 117))){ deleteItem(117, getItemSlot(117), 1); deleteItem(117, getItemSlot(117), 1); addItem(113, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } //super str potion if(((itemUsed == 161) && (otherItem == 161))){ deleteItem(161, getItemSlot(161), 1); deleteItem(161, getItemSlot(161), 1); addItem(159, 1); addItem(229, 1); sM("You have combined the liquid into 2 doses."); } if(((itemUsed == 161) && (otherItem == 159)) ((itemUsed 61))){ deleteItem(161, getItemSlot(161), 1); deleteItem(159, getItemSlot(159), 1); addItem(157, 1); addItem(229, 1); sM("You have combined the liquid into 3 doses."); } if(((itemUsed == 161) && (otherItem == 157)) ((itemUsed 61))){ deleteItem(161, getItemSlot(161), 1); deleteItem(157, getItemSlot(157), 1); addItem(2440, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } if(((itemUsed == 159) && (otherItem == 159))){ deleteItem(159, getItemSlot(159), 1); deleteItem(159, getItemSlot(159), 1); addItem(2440, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } //super def potion if(((itemUsed == 167) && (otherItem == 167))){ deleteItem(167, getItemSlot(167), 1); deleteItem(167, getItemSlot(167), 1); addItem(165, 1); addItem(229, 1); sM("You have combined the liquid into 2 doses."); } if(((itemUsed == 167) && (otherItem == 165)) ((itemUsed

== 115) && (otherItem == 1

== 159) && (otherItem == 1

== 157) && (otherItem == 1

== 165) && (otherItem == 1

67))){ deleteItem(167, getItemSlot(167), 1); deleteItem(165, getItemSlot(165), 1); addItem(163, 1); addItem(229, 1); sM("You have combined the liquid into 3 doses."); } if(((itemUsed == 167) && (otherItem == 163)) ((itemUsed == 163) && (otherItem == 1 67))){ deleteItem(167, getItemSlot(167), 1); deleteItem(163, getItemSlot(163), 1); addItem(2442, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } if(((itemUsed == 165) && (otherItem == 165))){ deleteItem(165, getItemSlot(165), 1); deleteItem(165, getItemSlot(165), 1); addItem(2442, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } //defence potion if(((itemUsed == 137) && (otherItem == 137))){ deleteItem(137, getItemSlot(137), 1); deleteItem(137, getItemSlot(137), 1); addItem(135, 1); addItem(229, 1); sM("You have combined the liquid into 2 doses."); } if(((itemUsed == 137) && (otherItem == 135)) ((itemUsed == 135) && (otherItem == 1 37))){ deleteItem(137, getItemSlot(137), 1); deleteItem(135, getItemSlot(135), 1); addItem(133, 1); addItem(229, 1); sM("You have combined the liquid into 3 doses."); } if(((itemUsed == 137) && (otherItem == 133)) ((itemUsed == 133) && (otherItem == 1 37))){ deleteItem(137, getItemSlot(137), 1); deleteItem(133, getItemSlot(133), 1); addItem(2432, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } if(((itemUsed == 135) && (otherItem == 135))){ deleteItem(135, getItemSlot(135), 1); deleteItem(135, getItemSlot(135), 1); addItem(2432, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } //attack potion if(((itemUsed == 125) && (otherItem == 125))){ deleteItem(125, getItemSlot(125), 1); deleteItem(125, getItemSlot(125), 1);

addItem(123, 1); addItem(229, 1); sM("You have combined the liquid into 2 doses."); } if(((itemUsed == 125) && (otherItem == 123)) ((itemUsed 25))){ deleteItem(125, getItemSlot(125), 1); deleteItem(123, getItemSlot(123), 1); addItem(121, 1); addItem(229, 1); sM("You have combined the liquid into 3 doses."); } if(((itemUsed == 125) && (otherItem == 121)) ((itemUsed 25))){ deleteItem(125, getItemSlot(125), 1); deleteItem(121, getItemSlot(121), 1); addItem(2428, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } if(((itemUsed == 123) && (otherItem == 123))){ deleteItem(123, getItemSlot(123), 1); deleteItem(123, getItemSlot(123), 1); addItem(2428, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } //super attack potion if(((itemUsed == 149) && (otherItem == 149))){ deleteItem(149, getItemSlot(149), 1); deleteItem(149, getItemSlot(149), 1); addItem(147, 1); addItem(229, 1); sM("You have combined the liquid into 2 doses."); } if(((itemUsed == 149) && (otherItem == 147)) ((itemUsed 49))){ deleteItem(149, getItemSlot(149), 1); deleteItem(147, getItemSlot(147), 1); addItem(145, 1); addItem(229, 1); sM("You have combined the liquid into 3 doses."); } if(((itemUsed == 149) && (otherItem == 145)) ((itemUsed 49))){ deleteItem(149, getItemSlot(149), 1); deleteItem(145, getItemSlot(145), 1); addItem(2436, 1); addItem(229, 1); sM("You have combined the liquid into 4 doses."); } if(((itemUsed == 147) && (otherItem == 147))){ deleteItem(147, getItemSlot(147), 1); deleteItem(147, getItemSlot(147), 1); addItem(2436, 1); addItem(229, 1);

== 123) && (otherItem == 1

== 121) && (otherItem == 1

== 147) && (otherItem == 1

== 145) && (otherItem == 1

sM("You have combined the liquid into 4 doses."); } if(((itemUsed == 2394) (otherItem == 2394)) && ((itemUsed == 2128) 2128))){ if(playerLevel[15] >= 40){ deleteItem(2394, 1); deleteItem(2128, 1); addItem(739, 1); setAnimation(1652); } else sM("You need at least 40 herblore to mix this."); } if(((itemUsed == 5605) (otherItem == 5605)) && ((itemUsed == 771) 71))){ if(playerLevel[9] >= 32){ deleteItem(771, 1); addItem(772, 1); setAnimation(885); } else sM("You need at least 32 fletching to fletch this."); } if(((itemUsed == 1931) (otherItem == 1931)) && ((itemUsed == 1947) 1947))){ deleteItem(1931, 1); deleteItem(1947, 1); addItem(1933, 1); sM("You mix the grain into the pot."); } if (((itemUsed == 5605) (otherItem == && ((itemUsed == 1511) 1511))) { shafting = true; resetWC(); } if (((itemUsed == 1733) (otherItem == && ((itemUsed == 1741) 1741))) { showInterface(2311); } if ((itemUsed == 1617 otherItem == 1617) && (itemUsed rItem == 1755)) { crafting(2000, 1617, 1731, 70); } if ((itemUsed == 1619 otherItem == 1619) && (itemUsed rItem == 1755)) { crafting(1500, 1619, 1725, 60); } if ((itemUsed == 1621 otherItem == 1621) && (itemUsed rItem == 1755)) { crafting(1000, 1621, 1729, 40); } if ((itemUsed == 1623 otherItem == 1623) && (itemUsed rItem == 1755)) { crafting(500, 1623, 1727, 0); } if ((itemUsed == 1631 otherItem == 1631) && (itemUsed rItem == 1755)) {

(otherItem ==

(otherItem == 7

(otherItem ==

5605)) (otherItem ==

1733)) (otherItem ==

== 1755

othe

== 1755

othe

== 1755

othe

== 1755

othe

== 1755

othe

crafting(3000, 1631, 1712, 75); } if ((itemUsed == 6571 otherItem == 6571) && (itemUsed == 1755 othe rItem == 1755)) { crafting(10000, 6571, 6585, 90); } if ((itemUsed == 1629 otherItem == 1629) && (itemUsed == 1755 othe rItem == 1755)) { crafting(0, 1629, 1613, 61); } if (playerHasItem(314, 15) && playerHasItem(52, 15) && ((itemUsed == 314) (otherItem == 3 14)) && ((itemUsed == 52) (otherItem == 52 ))) { if (playerHasItem(-1)) { deleteItem(314, 15); deleteItem(52, 15); addItem(53, 15); resetWC(); } else { sM("Not enough space in your inventory." ); } } if (((itemUsed == 5605) (otherItem == 5605)) && ((itemUsed == 1511) (otherItem == 1511))) { shafting = true; resetWC(); } int[] heads = { 39, 40, 41, 42, 43, 44 }; int[] arrows = { 882, 884, 886, 888, 890, 892 }; int[] required = { 1, 5, 25, 50, 70, 85 }; for (int h = 0; h < heads.length; h++) { if (playerHasItem(heads[h], 15) && playerHasItem (53, 15) && ((itemUsed == heads[h]) (o therItem == heads[h])) && ((itemUsed == 53) (otherIt em == 53))) { if (playerLevel[playerFletching] < requi red[h]) { sM("You need " + required[h] + " fletching to fletch this."); break; } deleteItem(heads[h], 15); deleteItem(53, 15); addItem(arrows[h], 15); addSkillXP(200, playerFletching); resetWC(); break; } } // regular, oak, maple, willow, yew, magic? for (int id = 0; id < logs.length; id++) { if (((itemUsed == logs[id]) (otherItem == log s[id]))

&& ((itemUsed == 5605) Item == 5605))) {

(other

// emote 885 (funny=3129) dialog = true; dialogInterface = 2459; dialogId = 1; fletchLog = id; sendFrame126("Select a bow", 8879); sendFrame246(8870, 250, longbows[id]); / / right picture sendFrame246(8869, 250, shortbows[id]); // left picture sendFrame126(getItemName(shortbows[id]), 8871); sendFrame126(getItemName(shortbows[id]), 8874); sendFrame126(getItemName(longbows[id]), 8878); sendFrame126(getItemName(longbows[id]), 8875); sendFrame164(8866); resetWC(); break; } } for (int id1 = 0; id1 < shortbow.length; id1++) { if (((itemUsed == shortbows[id1]) (otherItem == shortbows[id1])) && ((itemUsed == 1777) Item == 1777))) { deleteItem(shortbows[id1], 1); deleteItem(1777, 1); addItem(shortbow[id1], 1); addSkillXP(280, 9); resetWC(); } } for (int b2 = 0; b2 < shortbow.length; b2++) { if (((itemUsed == longbows[b2]) (otherItem == longbows[b2])) && ((itemUsed == 1777) Item == 1777))) { deleteItem(longbows[b2], 1); deleteItem(1777, 1); addItem(longbow[b2], 1); addSkillXP(280, 9); resetWC(); } } for (int h = 0; h < leathers.length; h++) { if (((itemUsed == 1733) (otherItem == 1733)) && ((itemUsed == leathers[h]) (otherItem == leathers[h]))) { craftMenu(h); cIndex = h; } } if ((itemUsed == 233) && (useWith == 237)) { deleteItem(237, getItemSlot(237), 1); addItem(235, 1); (other (other

} else if ((itemUsed == 590) && (useWith == 1511)) { if (playerLevel[11] >= 0) { deleteItem(1511, getItemSlot(1511), 1); makeGlobalObject(absX,absY, 2732, 0, 10 ); addSkillXP(180, 11); sM("You attempt to light the logs."); sM("The fire catches and the logs begin to burn."); resetWC(); } else { sM("You need a firemaking of 0 to burn n ormal logs."); } } else if ((itemUsed == 590) && (useWith == 1521)) { if (playerLevel[11] >= 15) { deleteItem(1521, getItemSlot(1521), 1); makeGlobalObject(absX,absY, 2732, 0, 10); addSkillXP(250, 11); sM("You attempt to light the logs."); sM("The fire catches and the logs begin to burn."); resetWC(); } else { sM("You need a firemaking level of 15 to burn oak logs."); } } else if ((itemUsed == 590) && (useWith == 1519)) { if (playerLevel[11] >= 30) { deleteItem(1519, getItemSlot(1519), 1); makeGlobalObject(absX,absY, 2732, 0, 10) ; addSkillXP(340, 11); sM("You attempt to light the logs."); sM("The fire catches and the logs begin to burn."); resetWC(); } else { sM("You need a firemaking of 30 to burn willow logs."); } } else if ((itemUsed == 590) && (useWith == 1517)) { if (playerLevel[11] >= 45) { deleteItem(1517, getItemSlot(1517), 1); makeGlobalObject(absX,absY, 2732, 0, 10); addSkillXP(600, 11); sM("You attempt to light the logs."); sM("The fire catches and the logs begin to burn."); resetWC(); } else { sM("You need a firemaking level of 45 to burn maple logs."); } } else if ((itemUsed == 590) && (useWith == 1515)) { if (playerLevel[11] >= 60) { deleteItem(1515, getItemSlot(1515), 1); makeGlobalObject(absX,absY, 2732, 0, 10); addSkillXP(780, 11); sM("You attempt to light the logs.");

sM("The fire catches and the logs begin to burn."); resetWC(); } else { sM("You need a firemaking of 60 to burn yew logs."); } } else if ((itemUsed == 590) && (useWith == 1513)) { if (playerLevel[11] >= 75) { deleteItem(1513, getItemSlot(1513), 1); makeGlobalObject(absX,absY, 2732, 0, 10); addSkillXP(1200, 11); sM("You attempt to light the logs."); sM("The fire catches and the logs begin to burn."); resetWC(); } else { sM("You need a firemaking level of 75 to burn magic logs."); } } else if ((itemUsed == 1511) && (useWith == 590)) { if (playerLevel[11] >= 0) { deleteItem(1511, getItemSlot(1511), 1); makeGlobalObject(absX,absY, 2732, 0, 10); addSkillXP(180, 11); sM("You attempt to light the logs."); sM("The fire catches and the logs begin to burn."); resetWC(); } else { sM("You need a firemaking of 0 to burn n ormal logs."); } } else if ((itemUsed == 1521) && (useWith == 590)) { if (playerLevel[11] >= 15) { deleteItem(1521, getItemSlot(1521), 1); makeGlobalObject(absX,absY, 2732, 0, 10); addSkillXP(250, 11); sM("You attempt to light the logs."); sM("The fire catches and the logs begin to burn."); resetWC(); } else { sM("You need a firemaking level of 15 to burn oak logs."); } } else if ((itemUsed == 1519) && (useWith == 590)) { if (playerLevel[11] >= 30) { deleteItem(1519, getItemSlot(1519), 1); makeGlobalObject(absX,absY, 2732, 0, 10); addSkillXP(340, 11); sM("You attempt to light the logs."); sM("The fire catches and the logs begin to burn."); resetWC(); } else { sM("You need a firemaking of 30 to burn willow logs."); } } else if ((itemUsed == 1517) && (useWith == 590)) { if (playerLevel[11] >= 45) {

deleteItem(1517, getItemSlot(1517), 1); makeGlobalObject(absX,absY, 2732, 0, 10); addSkillXP(600, 11); sM("You attempt to light the logs."); sM("The fire catches and the logs begin to burn."); resetWC(); } else { sM("You need a firemaking level of 45 to burn maple logs."); } } else if ((itemUsed == 1515) && (useWith == 590)) { if (playerLevel[11] >= 60) { deleteItem(1515, getItemSlot(1515), 1); makeGlobalObject(absX,absY, 2732, 0, 10); addSkillXP(780, 11); sM("You attempt to light the logs."); sM("The fire catches and the logs begin to burn."); resetWC(); } else { sM("You need a firemaking of 60 to burn yew logs."); } } else if ((itemUsed == 1513) && (useWith == 590)) { if (playerLevel[11] >= 75) { deleteItem(1513, getItemSlot(1513), 1); makeGlobalObject(absX,absY, 2732, 0, 10); addSkillXP(1200, 11); sM("You attempt to light the logs."); sM("The fire catches and the logs begin to burn."); resetWC(); } else { sM("You need a firemaking level of 75 to burn magic logs."); } } // herblore if ((itemUsed == 257) && (useWith == 227) (itemUsed = = 227) && (useWith == 257)) { if (playerLevel[15] >= 40) { deleteItem(257, getItemSlot(257), 1); deleteItem(227, getItemSlot(227), 1); addItem(2434, 1); addSkillXP(2800, 15); setAnimation(1652); } else { sM("You need 40 herblore to make this po tion."); } } if ((itemUsed == 267) && (useWith == 227) (itemUsed = = 227) && (useWith == 267)) { if (playerLevel[15] >= 20) { deleteItem(267, getItemSlot(267), 1); deleteItem(227, getItemSlot(227), 1); addItem(2444, 1); addSkillXP(1500, 15); setAnimation(1652);

} else { sM("You need 20 herblore to make this po tion."); } } if ((itemUsed == 3000) && (useWith == 227) (itemUsed == 227) && (useWith == 3000)) { if (playerLevel[15] >= 20) { deleteItem(3000, getItemSlot(3000), 1); deleteItem(227, getItemSlot(227), 1); addItem(3024, 1); addSkillXP(1700, 15); setAnimation(1652); } else { sM("You need 30 herblore to make this po tion."); } } if ((itemUsed == 2481) && (useWith == 227) (itemUsed == 227) && (useWith == 2481)) { if (playerLevel[15] >= 20) { deleteItem(2481, getItemSlot(2481), 1); deleteItem(227, getItemSlot(227), 1); addItem(3040, 1); addSkillXP(1500, 15); setAnimation(1652); } else { sM("You need 20 herblore to make this po tion."); } } if ((itemUsed == 2998) && (useWith == 227) (itemUsed == 227) && (useWith == 2998)) { if (playerLevel[15] >= 60) { deleteItem(2998, getItemSlot(2998), 1); deleteItem(227, getItemSlot(227), 1); addItem(6685, 1); addSkillXP(3000, 15); setAnimation(1652); } else { sM("You need 60 herblore to make this po tion."); } } if ((itemUsed == 259) && (useWith == 227) (itemUsed = = 227) && (useWith == 259)) { if (playerLevel[15] >= 1) { deleteItem(259, getItemSlot(259), 1); deleteItem(227, getItemSlot(227), 1); addItem(2436, 1); addSkillXP(700, 15); setAnimation(1652); } else { sM("You need a higher herblore level to make this potion."); } } if ((itemUsed == 263) && (useWith == 227) = 227) && (useWith == 263)) { (itemUsed =

if (playerLevel[15] >= 1) { deleteItem(263, getItemSlot(263), 1); deleteItem(227, getItemSlot(227), 1); addItem(2440, 1); addSkillXP(700, 15); setAnimation(1652); } else { sM("You need a higher herblore level to make this potion."); } } if ((itemUsed == 265) && (useWith == 227) (itemUsed = = 227) && (useWith == 265)) { if (playerLevel[15] >= 1) { deleteItem(265, getItemSlot(265), 1); deleteItem(227, getItemSlot(227), 1); addItem(2442, 1); addSkillXP(700, 15); setAnimation(1652); } else { sM("You need a higher herblore level to make this potion."); } } } break; // WalkTo commands case 248: // map walk (has additional 14 bytes added to the end wi th some junk // data) packetSize -= 14; // ignore the junk case 164: // regular walk case 98: //walking packet // walk on command if(cookingOn){ cookingOn = false; } if(followID > 0){ followID = 0; } if(followID2 > 0){ followID2 = 0; } if (randomed) break; if (!antiHax()) break; if (inTrade) break; if(System.currentTimeMillis() - lastEntangle < entangleD elay) { sM("A magical force stops you from moving.");

break; } if(System.currentTimeMillis() - lastWalk < walkDelay) break; if (faceNPC > 0) { faceNPC = 65535; faceNPCupdate = true; } resetAction(); if (!validClient) { sM("You can't move on this account"); break; } IsAttackingNPC = false; attacknpc = -1; closeInterface(); resetAnimation(); if (deathStage == 0) { newWalkCmdSteps = packetSize - 5; if (newWalkCmdSteps % 2 != 0) { println_debug("Warning: walkTo(" + packe tType + ") command malformed: " + misc.Hex(inStream.buff er, 0, packetSize)); } newWalkCmdSteps /= 2; if (++newWalkCmdSteps > walkingQueueSize) { println_debug("Warning: walkTo(" + packe tType + ") command contains to o many steps (" + newWalkCmdSteps + ")." ); newWalkCmdSteps = 0; break; } int firstStepX = inStream.readSignedWordBigEndia nA(); int tmpFSX = firstStepX; firstStepX -= mapRegionX * 8; for (i = 1; i < newWalkCmdSteps; i++) { newWalkCmdX[i] = inStream.readSignedByte (); newWalkCmdY[i] = inStream.readSignedByte (); tmpNWCX[i] = newWalkCmdX[i]; tmpNWCY[i] = newWalkCmdY[i]; } newWalkCmdX[0] = newWalkCmdY[0] = tmpNWCX[0] = t mpNWCY[0] = 0; int firstStepY = inStream.readSignedWordBigEndia n(); int tmpFSY = firstStepY; firstStepY -= mapRegionY * 8; newWalkCmdIsRunning = inStream.readSignedByteC()

== 1; for (i = 0; i < newWalkCmdSteps; i++) { newWalkCmdX[i] += firstStepX; newWalkCmdY[i] += firstStepY; } poimiY = firstStepY; poimiX = firstStepX; // stairs check if (stairs > 0) { resetStairs(); } // woodcutting check if (woodcutting[0] > 0) { // playerEquipment[playerWeapon] = Origi nalWeapon; // OriginalWeapon = -1; resetAnimation(); resetWC(); } // pick up item check if (WannePickUp == true) { PickUpID = 0; PickUpAmount = 0; PickUpDelete = 0; WannePickUp = false; } // attack check if (IsAttacking == true) { ResetAttack(); } // attack NPC check if (IsAttackingNPC == true) { ResetAttackNPC(); } // mining check if (mining[0] > 0) { resetAnimation(); resetMI(); } // Npc Talking if (NpcDialogue > 0) { NpcDialogue = 0; NpcTalkTo = 0; NpcDialogueSend = false; RemoveAllWindows(); } // banking if (IsBanking == true) { RemoveAllWindows(); } // shopping if (IsShopping == true) { IsShopping = false; MyShopID = 0; UpdateShop = false; RemoveAllWindows(); } // trading

} break; case 4: // regular chat String playerchat = "["+playerName+"]: "+misc.textUnpack(chatText, packetSize-2) +""; if (!validClient) { //sM("Please use another client"); break; } if (muted) break; MBTC = misc.textUnpack(chatText, packetSize - 2); MBBC = misc.textUnpack(chatText, packetSize - 2); MBHT = misc.textUnpack(chatText, packetSize - 2); MBID = misc.textUnpack(chatText, packetSize - 2); chatTextEffects = inStream.readUnsignedByteS(); chatTextColor = inStream.readUnsignedByteS(); chatTextSize = (byte) (packetSize - 2); inStream.readBytes_reverseA(chatText, chatTextSize, 0); chatTextUpdateRequired = true; writeChat("["+getDateTime()+"] " + misc.textUnpack(chatT ext, packetSize-2), getDate()); break; case 14: // Use something on another player junk2 = inStream.readSignedWordBigEndianA(); // only nee ded to // get the cracker // slot ! (remove = // server crash !) junk = inStream.readSignedWordBigEndian(); // only neede d to get // the cracker slot ! // (remove = server // crash !) junk3 = inStream.readUnsignedWordA(); // only needed to get the // cracker slot ! (remove = // server crash !) int CrackerSlot = inStream.readSignedWordBigEndian(); // if(CrackerSlot >= playerItems.length){ // break; // } int CrackerID = playerItems[CrackerSlot]; CrackerID -= 1; // Only to fix the ID ! if ((CrackerID == 962) && playerHasItem(962) && playerRi ghts != 2) { sM("You pull a christmas cracker..."); int UsedOn = (int) (misc.HexToInt(inStream.buffe r, 3, 1) / 1000); PlayerHandler.players[UsedOn].CrackerMsg = true; deleteItem(CrackerID, CrackerSlot, playerItemsN[ CrackerSlot]); if (misc.random(2) == 1) { addItem(Item.randomPHat(), 1);

sM("Hey! I got the cracker!"); } else { sM("The person you pulled the cracker wi th gets the prize."); PlayerHandler.players[UsedOn].CrackerFor Me = true; } } break; // TODO: implement those properly - execute commands only until we // walked to this object! // atObject commands /* * <Dungeon> Trapdoors: ID 1568, 1569, 1570, 1571 Ladders: ID 17 59, 2113 * Climb rope: 1762, 1763, 1764 */ case 101: // Character Design Screen if (!antiHax()) break; int[] input = new int[13]; int highest = -1, numZero = -1, num44 = 0; for (int b = 0; b < 13; b++) { input[b] = inStream.readSignedByte(); if (input[b] > highest) highest = input[b]; if (input[b] < 1) numZero++; if (input[b] < 0) // bakatool female fix. input[b] = 0; if (input[b] == 44) num44++; } if ((highest < 1) (num44 == 7)) { if (uid > 1) server.bannedUid.add(new Integer(uid)); isKicked = true; break; } pGender = input[0]; pHead = input[1]; pBeard = input[2]; // aka Jaw :S -bakatool pTorso = input[3]; pArms = input[4]; pHands = input[5]; pLegs = input[6]; pFeet = input[7]; pHairC = input[8]; pTorsoC = input[9]; pLegsC = input[10]; pFeetC = input[11]; pSkinC = input[12]; playerLook[0] = input[0]; // pGender -bakatool

playerLook[1] = input[8]; // hairC -bakatool playerLook[2] = input[9]; // torsoC -bakatool playerLook[3] = input[10]; // legsC -bakatool playerLook[4] = input[11]; // feetC -bakatool playerLook[5] = input[12]; // skinC -bakatool apset = true; appearanceUpdateRequired = true; lookUpdate = true; break; case 132: int objectX = inStream.readSignedWordBigEndianA(); int objectID = inStream.readUnsignedWord(); int objectY = inStream.readUnsignedWordA(); int face = 0; int face2 = 0; int GateID = 1; if (!validClient randomed) break; if (!antiHax()) break; if (debug (playerRights > 1)) { println("serverobjs size " + server.objects.size ()); println_debug("atObject: " + objectX + "," + obj ectY + " objectID: " + objectID); // 147 might be id for // object state changing } int xDiff = Math.abs(absX - objectX); int yDiff = Math.abs(absY - objectY); boolean found = false; resetAction(false); TurnPlayerTo(objectX, objectY); updateRequired = true; appearanceUpdateRequired = true; long time2 = System.currentTimeMillis(); if (time2 - globalCooldown[0] <= 50) { sM("Action throttled... please wait longer befor e acting!"); break; } if (misc.random(100) == 1) { triggerRandom(); break; } if ((xDiff > 5) (yDiff > 5)) { println("Client hack detected!"); break; } if (objectID == 7146) { if (playerLevel[16] < 90) { sM("You need to have 90 agility to past this."); break; } if (objectX == 3021 && objectY == 4842) { toX = 3031;

toY = 4843; } } if (objectID == 5276){ skillX = objectX; skillY = objectY; WanneBank = 1; } if(objectID == 12616){ heightLevel = 0; toX = 2657; toY = 9894; } if(objectID == 3192) { highscores(); } if(objectID == 2804){ if(qsecret >= 2){ heightLevel = 0; toX = 3024; toY = 5457; } else { sM("It looks very dark in there... Might go in next time"); } } if(objectID == 12615){ if(qsecret == 2){ server.npcHandler.spawnANPC(1931, 3024, 5458, heightLevel); sM("You must kill the bandit before picking leaves!"); } else { if(qsecret > 2) { addItem(6053, 1); sM("You pick some leaves from the bush."); } } if(objectID == 12616){ heightLevel = 0; toX = 2657; toY = 9894; } else if (objectID == 1755){ if (qsecret == 15){ toX = 2515; toY = 3384; } else { sM("Only cowards leave!"); } } if (objectID == 2156){ if (donator >= 1){ toX = 2525; toY = 4776; } else { talk("Sorry "+ playerName + " You need to be a Donator to use this Portal ", 596 ); } } if (objectID == 1752){ sM("This Ladder is officially unclimbable.");

} if (objectID == 6434){ if(playerHasItem(6635, 1)){ heightLevel = 0; toX = 2632; toY = 9859; } else { sM("No way I am going down there... Waaaay to scary..."); } } if (objectID == 7147) { if (playerLevel[16] < 10) { sM("You need to have 10 agility to past this."); break; } if (objectX == 3028 && objectY == 4849) { toX = 3038; toY = 4846; } } if (objectID == 7148) { if (playerLevel[16] < 10) { sM("You need to have 10 agility to past this."); break; } if (objectX == 3038 && objectY == 4853) { toX = 3038; toY = 4846; } } if (objectID == 7149) { if (playerLevel[16] < 10) { sM("You need to have 10 agility to past this."); break; } if (objectX == 3049 && objectY == 4849) { toX = 3047; toY = 4844; } } if (objectID == 7150) { if (playerLevel[17] < 90) { sM("You don't have 10 thieving to past this."); break; } if (objectX == 3018 && objectY == 4821) { toX = 3049; toY = 4841;

} } if (objectID == 7144) { int axe = 0; axe = WCCheckAxe(); if (axe < 1) { sM("You do not have an axe."); break; } if (objectX == 3018 && objectY == 4821) { toX = 3029; toY = 4823; } } if (objectID == 7152) { int axe = 0; axe = WCCheckAxe(); if (axe < 1) { sM("You do not have an axe."); break; } if (objectX == 3057 && objectY == 4821) { toX = 3050; toY = 4822; } } if (objectID == 7143) { int pickaxe = 0; pickaxe = MICheckPickAxe(); if (pickaxe < 1) { sM("You do not have an pickaxe."); break; } if (objectX == 3026 && objectY == 4813) { toX = 3029; toY = 4821; } if (objectX == 3049 && objectY == 4813) { toX = 3029; toY = 4821; } } if (objectID == 2478) { //air runecraft(1, 30, 556, 11, 22, 33, 44, 55, 66, 77, 88, 99); } if (objectID == 2466) { //mind runecraft(2, 35, 558, 14, 28, 42, 56, 70, 84, 98, 150, 150);

} if (objectID == 2480) { //water runecraft(5, 40, 555, 19, 38, 57, 76, 95, 150, 150, 150, 150); } if (objectID == 2481) { //earth runecraft(9, 45, 557, 26, 52, 78, 150, 150, 150, 150, 150, 150); } if (objectID == 2482) { //fire runecraft(14, 50, 554, 35, 70, 150, 150, 150, 150, 150, 150, 150 ); } if (objectID == 2483) { //body runecraft(20, 45, 559, 46, 92, 150, 150, 150, 150, 150, 150, 150 ); } if (objectID == 2484) { //cosmic runecraft(27, 65, 564, 59, 150, 150, 150, 150, 150, 150, 150, 15 0); } if (objectID == 2487) { //chaos runecraft(35, 78, 562, 74, 150, 150, 150, 150, 150, 150, 150, 15 0); } if (objectID == 2486) { //nat runecraft(44, 120, 561, 91, 150, 150, 150, 150, 150, 150, 150, 1 50); } if (objectID == 2485) { //law runecraft(54, 140, 563, 150, 150, 150, 150, 150, 150, 150, 150, 150); } if (objectID == 2488) { //death runecraft(65, 150, 560, 150, 150, 150, 150, 150, 150, 150, 150, 150); } if (objectID == 7139) { toX = 2841; toY = 4829; } if (objectID == 7140)

{ toX = 2793; toY = 4828; } if (objectID == 7137) { toX = 2727; toY = 4833; } if (objectID == 7130) { toX = 2655; toY = 4830; } if (objectID == 7129) { toX = 2574; toY = 4849; } if (objectID == 7131) { toX = 2523; toY = 4826; } if (objectID == 7132) { toX = 2137; toY = 4833; } if (objectID == 7134) { toX = 2266; toY = 4842; } if (objectID == 7133) { toX = 2400; toY = 4835; } if (objectID == 7135) { toX = 2464; toY = 4818; } if (objectID == 7136) { toX = 2208; toY = 4830; } if (objectID == 6552) {

if (q3 != 15) { sM("You must complete Desert Treasure if you wan t to use Ancients!"); } else { if (playerAncientMagics == 1) { setSidebarInterface(6, 1151); // magic tab (anci ent = 12855); // /normal = 1151 playerAncientMagics = 0; sM("You convert to normal magic!"); } else if (playerAncientMagics == 0) { setSidebarInterface(6, 12855); // magic tab (anc ient = 12855); playerAncientMagics = 1; sM("You convert to ancient magicks!"); } } } if (objectID == 6552) { if (q3 != 15) { } else { if (playerAncientMagics == 2) { setSidebarInterface(6, 1151); // magic tab (anci ent = 12855); // /normal = 1151 playerAncientMagics = 0; sM("You convert to normal magic!"); } } } if (objectID == 410) { if (q10 != 15 && playerAncientMagics == 0 q10 != 15 & & playerAncientMagics == 2){ sM("You must complete Lunar Spirit if you want to use Lu nar!"); } if (playerAncientMagics == 2 playerAncientMagics == 1 ) { setSidebarInterface(6, 1151); // magic tab (anci ent = 12855); // /normal = 1151 playerAncientMagics = 0; sM("You convert to normal magic!"); } else if (playerAncientMagics == 0 && q10 == 15) { setSidebarInterface(6, 18787); playerAncientMagics = 2; sM("You convert to lunar magicks!"); } } if(objectID == 2307 && absX == 2998 && absY == 3931){ WalkTo2(0, -15); } if(objectID == 2309){ WalkTo2(0, 15); } if(objectID == 8972){ toX = 3689; toY = 3472; heightLevel = 0;

} if(objectID == 3831){ toX = 3507; toY = 9494; heightLevel = 0; } if(objectID == 4755){ if(gwdKc == 20){ teleEffect = 3; sendQuest(" Which Boss? ", 2470); sendQuest("Bandos Boss", 2471); sendQuest("Armadyl Boss", 2472); sendQuest("", 2473); sendFrame164(2469); } else { sM("You need a 20 Killcount before going in!"); } } if(objectID == 2467){ sendQuest("Lumbridge", 15240); sendQuest("Falador", 15241); sendQuest("Varrock", 15239); sendQuest("Camelot", 15243); sendQuest("Ardougne", 15242); setSidebarInterface(6, 3209); // magic tab (ancient = 12855) interfaceGame = 5; sM("Go to your magic tab to see the teleports!"); } if(objectID == 365){ if(!playerHasItem(3500, 1) && !playerCheckBank(3500, 1)) {///SECRET SACKS sM("You find an old scroll, I wonder what it says?"); addItem(3500, 1); } else { sM("The Sacks are empty...Seems to be looted already"); } } if(objectID == 6275){ ///SECRET STUDY DESK ARCHAEOLOGIST if(playerHasItem(3500, 1) && !playerHasItem(2574, 1) && !playerCheckBank(2574, 1 ) && !playerHasItem(2575, 1) && !playerCheckBank(2575, 1) && !playerHasItem(2576 , 1) && !playerCheckBank(2576, 1)){ sM("You find an Sextant, Chart, and a Watch!"); sM("You should be able to locate the place with this.."); addItem(2574, 1); addItem(2576, 1); addItem(2575, 1); } else { sM("You find nothing interesting.."); } } if(objectID == 393){ sM("You find nothing interesting.."); } if(objectID == 381){ sM("You find nothing interesting.."); } if(objectID == 380){ sM("You find nothing interesting.."); } if(objectID == 9356){ killMyNPCs();

resetfollowers(); heightLevel = getHeightForTzhaar(); sendFrame200(4901, 591); sendFrame126(GetNpcName(2617), 4902); sendFrame126("", 4903); sendFrame126("You're on your own now JalYt, prepare to fight for", 4904); sendFrame126("your life!", 4905); sendFrame126("", 4906); sendFrame75(2617, 4901); sendFrame164(4900); toX = 2413; toY = 5117; TzWave = 1; WaveDelay = 20; KilledTz = 0; NeededKills = 0; resetfollowers(); } if(objectID == 9357){ killMyNPCs(); resetfollowers(); talk("Well done in the cave, here take TokKul as reward.", 2617); addItem(6529, 1); TzWave = 0; KilledTz = 0; NeededKills = 0; heightLevel = 0; toX = 2438; toY = 5168; } if ((objectID == 2995)) { skillX = objectX; skillY = objectY; WanneBank = 1; } if(objectID == 356){ addItem(223, 1); sM("You find some spider eggs within the box."); } if(objectID == 4247){ if(q10 == 2){ addItem(1796, 1); sM("You find a silver necklace stuck in the door."); } } if(objectID == 4677 objectID == 4678){ sM("You pick some leaves from these plants."); addItem(2128, 1); } if(objectID == 2342 && q9 == 1 && GoodDistance(objectX, objectY, absX, absY, 1) == true){ sM("You find a map in here."); addItem(4277, 1); } if(objectID == 14751 objectID == 14752){ ReplaceObject(objectX, objectY, objectID, -1, 0); } if(objectID == 1557 && objectX == 3103 && objectY == 9910){ ReplaceObject(objectX, objectY, objectID, -1, 0); }

if(objectID == 1558 && objectX == 3103 && objectY == 9909){ ReplaceObject(objectX, objectY, objectID, -1, 0); } if(objectID == 11707 && objectX == 2949 && objectY == 3379){ ReplaceObject(objectX, objectY, objectID, -1, 0); } if(objectID == 11707 && objectX == 2982 && objectY == 3371){ ReplaceObject(objectX, objectY, objectID, -2, 0); } if(objectID == 11707 && objectX == 2989 && objectY == 3368){ ReplaceObject(objectX, objectY, objectID, -2, 0); } if(objectID == 1596 objectID == 1597){ ReplaceObject(objectX, objectY, objectID, -2, 0); } if(objectID == 1513){ ReplaceObject(objectX, objectY, objectID, -2, 0); } if(objectID == 2338){ ReplaceObject(objectX, objectY, objectID, -1, 0); } if(objectID == 2339){ ReplaceObject(objectX, objectY, objectID, -1, 0); } if(objectID == 2341){ ReplaceObject(objectX, objectY, objectID, -2, 0); } if(objectID == 2337){ ReplaceObject(objectX, objectY, objectID, -2, 0); } if(objectID == 1557 && objectX != 3103 && objectY != 9910 objectID == 1558 & & objectX != 3103 && objectY != 9909){ ReplaceObject(objectX, objectY, objectID, -2, 0); } if(objectID == 6912 && q7 == 1){ q7 = 2; toX = 2728; toY = 3348; } if(objectID == 1739 && objectX == 3204 && objectY == 3207){ heightLevel = 0; toX = 3205; toY = 3209; } if(objectID == 1739 && objectX == 3204 && objectY == 3229){ heightLevel = 0; toX = 3205; toY = 3228; } if(objectID == 1536 && objectX != 3215 && objectY != 3225 && objectX != 3207 && objectY != 3222 && objectY != 3214){ ReplaceObject(objectX, objectY, objectID, -2, 0); } if(objectID == 12986 objectID == 12987){ ReplaceObject(objectX, objectY, objectID, -1, 0); } if(objectID == 190){ ReplaceObject(objectX, objectY, objectID, -2, 0); } if(objectID == 4712){

toX = 2764; toY = 9103; } if(objectID == 4799 && System.currentTimeMillis() - lastAction > actionInterval) { sM("You attempt to pickpocket the lock."); actionInterval = 3000; lastAction = System.currentTimeMillis(); if(misc.random(3)==1){ sM("You pickpocket the lock."); toX = 2771; toY = 2796; } } if(objectID == 2709){ if(q4 == 1 && playerHasItem(983, 1)){ deleteItem(983, 1); addItem(1550, 1); addItem(995, 83); sM("You find some garlic and some coins in this old treasure chest."); } if(q4 != 1 !playerHasItem(983, 1)){ sM("You need a key to open this treasure chest."); } } if(objectID == 2616){ toX = 3078; toY = 9771; } if(objectID == 2617){ toX = 3116; toY = 3356; } if(objectID == 11470){ ReplaceObject(objectX, objectY, objectID, -2, 0); } if(objectID == 134 objectID == 135){ ReplaceObject(objectX, objectY, objectID, -2, 0); } if(objectID == 12045 objectID == 12047){ ReplaceObject(objectX, objectY, objectID, -1, 0); } if(objectID == 2406){ if(playerEquipment[playerWeapon] == 772 && q1 == 3){ showInterface(297); sendQuest("You have completed Lost City!", 301); q1 = 15; sendQuest("@gre@Lost City", 7332); toX = 2452; toY = 4470; } if(playerEquipment[playerWeapon] == 772 && q1 == 15){ toX = 2452; toY = 4470; } else sM("There is nothing in here.."); } if(objectID == 2408 && objectX == 2820 && objectY == 3374){ if(playerEquipment[playerHat] != -1 playerEquipment[playerAmulet] != -1 pl

ayerEquipment[playerCape] != -1 playerEquipment[playerWeapon] != -1 player Equipment[playerChest] != -1 playerEquipment[playerShield] != -1 playerEqu ipment[playerLegs] != -1 playerEquipment[playerHands] != -1 playerEquipmen t[playerFeet] != -1 playerEquipment[playerRing] != -1){ sM("You can't have anything equipped!"); } if(playerEquipment[playerHat] == -1 && playerEquipment[playerAmulet] == -1 && pl ayerEquipment[playerCape] == -1 && playerEquipment[playerWeapon] == -1 && player Equipment[playerChest] == -1 && playerEquipment[playerShield] == -1 && playerEqu ipment[playerLegs] == -1 && playerEquipment[playerHands] == -1 && playerEquipmen t[playerFeet] == -1 && playerEquipment[playerRing] == -1){ toX = 2828; toY = 9772; } } //if(objectID == 4755){ //if(saraKills > 19){ //toX = 2740; //toY = 5074; //saraKills -= 19; //sM("The Saradomin kills drain from you.."); //} else //sM("You need at least 20 Saradomin kills to get in the cave."); //} if(objectID == 1742) { toX = 2418; toY = 3416; heightLevel = 1; } if(objectID == 1744) { toX = 2418; toY = 3416; heightLevel = 0; } if(objectID == 1586 && absX == 2643 && absY == 9892){ if(qsecret == 1){ WalkTimer(0, 1); NpcDialogue = 147; NpcDialogueSend = false; qsecret = 2; } else { WalkTimer(0, 1); } } if(objectID == 1586 && absX == 2643 && absY == 9893){ WalkTimer(0, -1); } if(objectID == 190 && absX == 2462 && absY == 3382){ WalkTimer(0, 3); } if(objectID == 190 && absX == 2461 && absY == 3382){ WalkTimer(0, 3); } if(objectID == 190 && absX == 2460 && absY == 3382){ WalkTimer(0, 3); } if(objectID == 190 && absX == 2462 && absY == 3385){ WalkTimer(0, -3); }

if(objectID == 190 && absX == 2461 && absY == 3385){ WalkTimer(0, -3); } if(objectID == 190 && absX == 2460 && absY == 3385){ WalkTimer(0, -3); } if(objectID == 2039){ if(heightLevel == 4){ toX = 2517; toY = 3355; heightLevel = 0; } else { toX = 2517; toY = 3357; heightLevel = 4; } } if(objectID == 2041){ if(heightLevel == 4){ toX = 2518; toY = 3355; heightLevel = 0; } else { toX = 2518; toY = 3357; heightLevel = 4; } } if(objectID == 1968 && absX == 2466 && absY == 3491){ WalkTimer(0, 2); } if(objectID == 1967 && absX == 2465 && absY == 3491){ WalkTimer(0, 2); } if(objectID == 1968 && absX == 2466 && absY == 3493){ WalkTimer(0, -3); } if(objectID == 1967 && absX == 2465 && absY == 3493){ WalkTimer(0, -3); } if(objectID == 8689){ if(playerHasItem(1925)){ deleteItem(1925, 1); addItem(1927, 1); sendInterface("You receive a bucket of milk."); } else sM("You need an empty bucket to milk this cow."); } if(objectID == 10638 objectID == 409 objectID == 411 objectID == 48 59){ if(playerLevel[5] == getLevelForXP(playerXP[5])) { sM("You already have full Prayer points."); } else { setAnimation(645); playerLevel[5] = getLevelForXP(playerXP[5]); sendFrame126("Prayer: "+playerLevel[5]+"/"+getLevelForXP(playerXP[5] )+"", 687); sendFrame126("" + getLevelForXP(playerXP[5]) + "", 4013);

sendFrame126("" + playerLevel[5] + "", 4012); sM("You recharge your Prayer points."); } } if(objectID == 13180 objectID == 13181 objectID == 13179 objectID = = 13184){ if(playerLevel[5] == getLevelForXP(playerXP[5])) { sM("You already have full Prayer points."); } if(inCombat) { sM("You need to be out of combat to recharge your Prayer points."); } else if (playerLevel[5] != getLevelForXP(playerXP[5]) && !inCombat) { setAnimation(645); playerLevel[5] = getLevelForXP(playerXP[5]); sendFrame126("Prayer: "+playerLevel[5]+"/"+getLevelForXP(playerXP[5] )+"", 687); sendFrame126("" + getLevelForXP(playerXP[5]) + "", 4013); sendFrame126("" + playerLevel[5] + "", 4012); sM("You recharge your Prayer points."); } } if(objectID == 6749 && objectX == 3562 && objectY == 9678){ ReplaceObject(3562, 9678, 6749, -3, 0); ReplaceObject(3562, 9677, 6730, -1, 0); } if(objectID == 6730 && objectX == 3558 && objectY == 9677){ ReplaceObject(3562, 9678, 6749, -3, 0); ReplaceObject(3562, 9677, 6730, -1, 0); } if(objectID == 6749 && objectX == 3558 && objectY == 9677){ ReplaceObject(3558, 9677, 6749, -1, 0); ReplaceObject(3558, 9678, 6730, -3, 0); } if(objectID == 6730 && objectX == 3558 && objectY == 9678){ ReplaceObject(3558, 9677, 6749, -1, 0); ReplaceObject(3558, 9678, 6730, -3, 0); } if(objectID == 6727 && objectX == 3551 && objectY == 9684){ sM("You cant open this door.."); } if(objectID == 6746 && objectX == 3552 && objectY == 9684){ sM("You cant open this door.."); } if(objectID == 6748 && objectX == 3545 && objectY == 9678){ ReplaceObject(3545, 9678, 6748, -3, 0); ReplaceObject(3545, 9677, 6729, -1, 0); } if(objectID == 6729 && objectX == 3545 && objectY == 9677){ ReplaceObject(3545, 9678, 6748, -3, 0); ReplaceObject(3545, 9677, 6729, -1, 0); } if(objectID == 6748 && objectX == 3541 && objectY == 9677){ ReplaceObject(3541, 9677, 6748, -1, 0); ReplaceObject(3541, 9678, 6729, -3, 0); } if(objectID == 6729 && objectX == 3541 && objectY == 9678){ ReplaceObject(3541, 9677, 6748, -1, 0); ReplaceObject(3541, 9678, 6729, -3, 0); } if(objectID == 6726 && objectX == 3534 && objectY == 9684){

ReplaceObject(3534, ReplaceObject(3535, } if(objectID == 6745 ReplaceObject(3534, ReplaceObject(3535, } if(objectID == 6726 ReplaceObject(3535, ReplaceObject(3534, } if(objectID == 6745 ReplaceObject(3535, ReplaceObject(3534, } if(objectID == 6743 ReplaceObject(3545, ReplaceObject(3545, } if(objectID == 6724 ReplaceObject(3545, ReplaceObject(3545, } if(objectID == 6743 ReplaceObject(3541, ReplaceObject(3541, } if(objectID == 6724 ReplaceObject(3541, ReplaceObject(3541, } if(objectID == 1553 ReplaceObject(3236, } if(objectID == 1551 ReplaceObject(3236, } if(objectID == 1516 ReplaceObject(3166, } if(objectID == 1519 ReplaceObject(3167, } if(objectID == 1553 ReplaceObject(3162, } if(objectID == 1551 ReplaceObject(3163, } if(objectID == 1551 ReplaceObject(3253, } if(objectID == 1553 ReplaceObject(3253, } if(objectID == 1530 ReplaceObject(3208, } if(objectID == 1530 ReplaceObject(3019,

9684, 6726, -4, 0); 9684, 6745, -2, 0); && objectX == 3535 && objectY == 9684){ 9684, 6726, -4, 0); 9684, 6745, -2, 0); && objectX == 3535 && objectY == 9688){ 9688, 6726, -2, 0); 9688, 6745, -4, 0); && objectX == 3534 && objectY == 9688){ 9688, 6726, -2, 0); 9688, 6745, -4, 0); && objectX == 3545 && objectY == 9695){ 9694, 6724, -1, 0); 9695, 6743, -3, 0); && objectX == 3545 && objectY == 9694){ 9694, 6724, -1, 0); 9695, 6743, -3, 0); && objectX == 3541 && objectY == 9694){ 9694, 6724, -1, 0); 9695, 6743, -3, 0); && objectX == 3541 && objectY == 9695){ 9694, 6724, -1, 0); 9695, 6743, -3, 0); && objectX == 3236 && objectY == 3295){ 3295, 1553, -1, 0); && objectX == 3236 && objectY == 3296){ 3296, 1551, -1, 0); && objectX == 3166 && objectY == 3302){ 3302, 1516, -2, 0); && objectX == 3167 && objectY == 3302){ 3302, 1519, -2, 0); && objectX == 3162 && objectY == 3290){ 3290, 1553, -2, 0); && objectX == 3163 && objectY == 3290){ 3290, 1551, -2, 0); && objectX == 3253 && objectY == 3266){ 3266, 1551, -1, 0); && objectX == 3253 && objectY == 3267){ 3267, 1553, -1, 0); && objectX == 3208 && objectY == 3211){ 3211, 1530, -2, 0); && objectX == 3019 && objectY == 3515){ 3515, 1530, -1, 0);

} if(objectID == 1530 && objectX == 3021 && objectY == 3515){ ReplaceObject(3021, 3515, 1530, -1, 0); } if(objectID == 1519 && objectX == 3217 && objectY == 3219){ ReplaceObject(3217, 3219, 1519, -1, 0); } if(objectID == 1536 && objectX == 3215 && objectY == 3211){ ReplaceObject(3215, 3211, 1536, -2, 0); } if(objectID == 1536 && objectX == 3215 && objectY == 3225){ ReplaceObject(3215, 3225, 1536, -2, 0); } if(objectID == 1536 && objectX == 3207 && objectY == 3222){ ReplaceObject(3207, 3222, 1536, -3, 0); } if(objectID == 1536 && objectX == 3207 && objectY == 3214){ ReplaceObject(3207, 3214, 1536, -3, 0); } if(objectID == 1516 && objectX == 3217 && objectY == 3218){ ReplaceObject(3217, 3218, 1516, -1, 0); } if(objectID == 5959){ triggerTele2(2539, 4712, 0); setAnimation(2140); } if(objectID == 9706){ triggerTele2(3105, 3951, 0); } if(objectID == 9707){ triggerTele2(3105, 3956, 0); } if(objectID == 733 && System.currentTimeMillis() - lastAction > actionInterval){ if(objectX == 3106 && objectY == 3958){ ReplaceServerObject(3106, 3958, 6951, -1, 10); } if(objectX == 3105 && objectY == 3958){ ReplaceServerObject(3105, 3958, 6951, -1, 10); } if(objectX == 3095 && objectY == 3957){ ReplaceServerObject(3095, 3957, 6951, -1, 10); } if(objectX == 3093 && objectY == 3957){ ReplaceServerObject(3093, 3957, 6951, -1, 10); } actionInterval = 5000; lastAction = System.currentTimeMillis(); sM("You slash through the web."); setAnimation(451); } if(objectID == 1817 && objectX == 2271 && objectY == 4680){ toX = 3016; toY = 3849; } if(objectID == 1765){ toX = 2272; toY = 4680; sM("You teleport to the King Black Dragon lair!"); } if(objectID == 1596 && absX == 3007 && absY == 3849 && System.currentTimeMillis(

) - lastAction > actionInterval){ WalkTimer(2,0); actionInterval = 2500; lastAction = System.currentTimeMillis(); } if(objectID == 1596 && absX == 3008 && absY == 3849 && System.currentTimeMillis( ) - lastAction > actionInterval){ WalkTimer(-2,0); actionInterval = 2500; lastAction = System.currentTimeMillis(); } if(objectID == 1596 && absX == 2948 && absY == 3904 && System.currentTimeMillis( ) - lastAction > actionInterval){ WalkTimer(0,-2); actionInterval = 2500; lastAction = System.currentTimeMillis(); } if(objectID == 1596 && absX == 2948 && absY == 3903 && System.currentTimeMillis( ) - lastAction > actionInterval){ WalkTimer(0,2); actionInterval = 2500; lastAction = System.currentTimeMillis(); } if(objectID == 1597 && absX == 2947 && absY == 3904 && System.currentTimeMillis( ) - lastAction > actionInterval){ WalkTimer(0,-2); actionInterval = 2500; lastAction = System.currentTimeMillis(); } if(objectID == 1597 && absX == 2947 && absY == 3903 && System.currentTimeMillis( ) - lastAction > actionInterval){ WalkTimer(0,2); actionInterval = 2500; lastAction = System.currentTimeMillis(); } if(objectID == 1597 && absX == 3007 && absY == 3850 && System.currentTimeMillis( ) - lastAction > actionInterval){ WalkTimer(2,0); actionInterval = 2500; lastAction = System.currentTimeMillis(); } if(objectID == 1597 && absX == 3008 && absY == 3850 && System.currentTimeMillis( ) - lastAction > actionInterval){ WalkTimer(-2,0); actionInterval = 2500; lastAction = System.currentTimeMillis(); } if(objectID == 14315 && System.currentTimeMillis() - lastAction > actionInterval ){ sM("You enter the boat, "+PlayerHandler.pcWaitTimer+" till next game starts."); toX = 2660; toY = 2639; actionInterval = 2500; lastAction = System.currentTimeMillis(); } if(objectID == 14314){ sM("You leave the boat."); toX = 2657; toY = 2639;

} if(objectID == 14233){ if(absX == 2670 && absY == 2592){ toX = 2671; toY = 2592; } if(absX == 2671 && absY == 2592){ toX = 2670; toY = 2592; } if(absX == 2656 && absY == 2585){ toX = 2656; toY = 2584; } if(absX == 2656 && absY == 2584){ toX = 2656; toY = 2585; } if(absX == 2642 && absY == 2593){ toX = 2643; toY = 2593; } if(absX == 2643 && absY == 2593){ toX = 2642; toY = 2593; } } if(objectID == 14235){ if(absX == 2670 && absY == 2593){ toX = 2671; toY = 2593; } if(absX == 2671 && absY == 2593){ toX = 2670; toY = 2593; } if(absX == 2657 && absY == 2585){ toX = 2657; toY = 2584; } if(absX == 2657 && absY == 2584){ toX = 2657; toY = 2585; } if(absX == 2642 && absY == 2592){ toX = 2643; toY = 2592; } if(absX == 2643 && absY == 2592){ toX = 2642; toY = 2592; } } //agility if(objectID == 2288 && System.currentTimeMillis() - lastAction > actionInterval && absX == 3004 && absY == 3937){ if(playerLevel[16] >= 70){ WalkTimer(0, 13); addSkillXP(6000, 16); actionInterval = 2500;

lastAction = System.currentTimeMillis(); } else sM("You need at least 70 agility to use this."); } if(objectID == 2311 && System.currentTimeMillis() && absX == 3002 && absY == 3960){ if(playerLevel[16] >= 70){ WalkTimer(-6, 0); addSkillXP(6000, 16); actionInterval = 2500; lastAction = System.currentTimeMillis(); } else sM("You need at least 70 agility to use this."); } if(objectID == 2297 && System.currentTimeMillis() && absX == 3002 && absY == 3945){ if(playerLevel[16] >= 70){ WalkTimer(-8, 0); addSkillXP(6000, 16); actionInterval = 2500; lastAction = System.currentTimeMillis(); } else sM("You need at least 70 agility to use this."); } if(objectID == 2328 && System.currentTimeMillis() { if(playerLevel[16] >= 70){ WalkTimer(0, -4); addSkillXP(6000, 16); actionInterval = 2500; lastAction = System.currentTimeMillis(); } else sM("You need at least 70 agility to use this."); } if(objectID == 2295 && System.currentTimeMillis() && absX == 2474 && absY == 3436){ addSkillXP(20, 16); actionInterval = 7500; lastAction = System.currentTimeMillis(); WalkTimer(0,-7); } if(objectID == 2285 && System.currentTimeMillis() { addSkillXP(5000, 16); actionInterval = 7500; lastAction = System.currentTimeMillis(); heightLevel += 1; toX = 2473; toY = 3424; } if(objectID == 2313 && System.currentTimeMillis() { addSkillXP(5000, 16); actionInterval = 7500; lastAction = System.currentTimeMillis(); heightLevel += 1; toX = 2473; toY = 3420; } if(objectID == 2312 && System.currentTimeMillis()

- lastAction > actionInterval

- lastAction > actionInterval

- lastAction > actionInterval)

- lastAction > actionInterval

- lastAction > actionInterval)

- lastAction > actionInterval)

- lastAction > actionInterval

&& absX == 2477 && absY == 3420){ addSkillXP(20, 16); actionInterval = 7500; lastAction = System.currentTimeMillis(); WalkTimer(6,0); } if(objectID == 2314 && System.currentTimeMillis() - lastAction > actionInterval) { addSkillXP(5000, 16); actionInterval = 7500; lastAction = System.currentTimeMillis(); heightLevel = 0; toX = 2487; toY = 3421; } if(objectID == 2286 && System.currentTimeMillis() - lastAction > actionInterval) { addSkillXP(20, 16); actionInterval = 7500; lastAction = System.currentTimeMillis(); toX = 2486; toY = 3427; } if(objectID == 4058 && (absX == 2484 && absY == 3430 && System.currentTimeMillis () - lastAction > actionInterval absX == 2487 && absY == 3430 && System.curre ntTimeMillis() - lastAction > actionInterval)){ addSkillXP(500, 16); actionInterval = 7500; lastAction = System.currentTimeMillis(); WalkTimer(0,7); setAnimation(746); } //end of agility if(objectID == 3828){ toX = 3484; toY = 9509; heightLevel = 2; } if(objectID == 1530){ ReplaceObject(2716, 3472, 1530, -3, 0); } if(objectID == 2469){ toX = 3564; toY = 3288; } if(objectID == 2470){ triggerTele(2933, 3285, 0); } if(objectID == 10284){ if(Verac == 1 && Dharok == 1 && Ahrim == 1 && Torag == 1 && Karils == 1 && Gutha n == 1) { Barrows = 0; Verac = 0; Dharok = 0; Ahrim = 0; Torag = 0; Karils = 0; Guthan = 0; addItem(Item.randomBarrows(), 1); addItem(Item.randomRunes(),misc.random(100));

addItem(995, misc.random(4427)); sM("You search the chest and find some items!"); } else sM("You need kill all barrow brother to searching for a reward."); } if(objectID == 6823){ if(Verac == 1) { talk("You have already killed a Verac on this round!", 1078); } if (isBV == true) { talk("You have already woken up a Verac on this round!", 1078); } if(Verac == 0 && isBV == false) { server.npcHandler.spawnANPC(2030, 3575, 9707, heightLevel); sM("You Wake The Ancient Beast Up!"); isBV = true; } } if(objectID == 6771){ if(Dharok == 1) { talk("You have already killed a Dharok on this round!", 1078); } if (isBD == true) { talk("You have already woken up a Dharok on this round!", 1078); } if(Dharok == 0 && isBD == false) { server.npcHandler.spawnANPC(2026, 3554, 9716, heightLevel); sM("You Wake The Ancient Beast Up!"); isBD = true; } } if(objectID == 6821) { if(Ahrim == 1) { talk("You have already killed Ahrim on this round!", 1078); } if (isBA == true) { talk("You have already woken up a Ahrim on this round!", 1078); } if (Ahrim == 0 && isBA == false) { server.npcHandler.spawnANPC(2025, 3557, 9700, heightLevel); sM("You Wake The Ancient Beast Up!"); isBA = true; } } if(objectID == 6772){ if(Torag == 1) { talk("You have already killed a Torag on this round!", 1078); } if (isBT == true) { talk("You have already woken up a Torag of this round!", 1078); } if(Torag == 0 && isBT == false) { server.npcHandler.spawnANPC(2029, 3568, 9687, heightLevel); sM("You Wake The Ancient Beast Up!"); isBT = true; } } if(objectID == 6822){

if(Karils == 1) { talk("You have already killed a Karils on this round!", 1078); } if (isBK == true) { talk("You have already woken up a Karils of this round!", 1078); } if(Karils == 0 && isBK == false) { server.npcHandler.spawnANPC(2028, 3552, 9684, heightLevel); sM("You Wake The Ancient Beast Up!"); isBK = true; } } if(objectID == 6773){ if(Guthan == 1) { talk("You have already killed a Guthan on this round!", 1078); } if (isBG == true) { talk("You have already woken up a Guthan of this round!", 1078); } if (isBG == false && Guthan == 0) { server.npcHandler.spawnANPC(2027, 3540, 9705, heightLevel); sM("You Wake The Ancient Beast Up!"); isBG = true; } } if(objectID == 6702){ toX = 3565; toY = 3289; heightLevel = 0; killMyNPCs(); resetfollowers(); } if(objectID == 6703){ toX = 3575; toY = 3297; heightLevel = 0; killMyNPCs(); resetfollowers(); } if(objectID == 6704){ toX = 3577; toY = 3282; heightLevel = 0; killMyNPCs(); resetfollowers(); } if(objectID == 6705){ toX = 3566; toY = 3275; heightLevel = 0; killMyNPCs(); resetfollowers(); } if(objectID == 6706){ toX = 3553; toY = 3282; heightLevel = 0; killMyNPCs(); resetfollowers();

} if(objectID == 6707){ toX = 3557; toY = 3297; heightLevel = 0; killMyNPCs(); resetfollowers(); } if(objectID == 10778 objectID == 10779 objectID == 10780 objectID == 10 781){ toX = 3363; toY = 9649; } if(objectID == 10721){ toX = 3363; toY = 3300; sM("You enter the mage arena."); } if(objectID == 10799){ if(System.currentTimeMillis() - lastAction > actionInterval){ actionInterval = 15000; lastAction = System.currentTimeMillis(); addItem(6899, 1); setAnimation(827); } } if(objectID == 10800){ if(System.currentTimeMillis() - lastAction > actionInterval){ actionInterval = 15000; lastAction = System.currentTimeMillis(); addItem(6898, 1); setAnimation(827); } } if(objectID == 10801){ if(System.currentTimeMillis() - lastAction > actionInterval){ actionInterval = 15000; lastAction = System.currentTimeMillis(); addItem(6900, 1); setAnimation(827); } } if(objectID == 10802){ if(System.currentTimeMillis() - lastAction > actionInterval){ actionInterval = 15000; lastAction = System.currentTimeMillis(); addItem(6901, 1); setAnimation(827); } } if(objectID == 10803){ if(playerHasItem(6898) && playerHasItem(6899) && playerHasItem(6900) && playerHa sItem(6901) && System.currentTimeMillis() - lastAction > actionInterval){ deleteItem(6898, getItemSlot(6898), 1); deleteItem(6899, getItemSlot(6899), 1); deleteItem(6900, getItemSlot(6900), 1); deleteItem(6901, getItemSlot(6901), 1); actionInterval = 10000; lastAction = System.currentTimeMillis(); MageTP += 35;

sM("You now have "+MageTP+" mage exchange points."); stillgfx(141, absY, absX); setAnimation(722); addSkillXP(500, 6); } else sM("You need the four shapes before depositing."); break; } if ((objectID == 1733) && (objectX == 2724) && (objectY == 3374)) { resetPos(); toX = 2727; toY = 9774; heightLevel = 0; break; } if ((objectID == 1734) && (objectX == 2724) && (objectY == 9774)) { resetPos(); toX = 2723; toY = 3375; heightLevel = 0; break; } // FACE: 0= WEST -1 = NORTH -2 = EAST -3 = SOUTH // ObjectType: 0-3 wall objects, 4-8 wall decoration, 9: diag. // walls, 10-11 world objects, 12-21: roofs, 22: floor d ecoration for (int d = 0; d < server.doorHandler.doorX.length; d++ ) { DoorHandler dh = server.doorHandler; if ((objectID == dh.doorId[d]) && (objectX == dh .doorX[d]) && (objectY == dh.doorY[d])) { int newFace = -3; if (dh.doorState[d] == 0) { // closed newFace = dh.doorFaceOpen[d]; dh.doorState[d] = 1; dh.doorFace[d] = newFace; } else { newFace = dh.doorFaceClosed[d]; dh.doorState[d] = 0; dh.doorFace[d] = newFace; } for (int p = 0; p < PlayerHandler.maxPla yers; p++) { client player = (client) server. playerHandler.players[p]; if (player == null) continue; if ((player.playerName != null) && (player.heigh tLevel == heightLevel) && !player.disco nnected && (player.absY > 0) && (player.absX > 0)) {

player.ReplaceObject(dh. doorX[d], dh.doorY[d], dh.doorI d[d], newFace, 0); } } } } /* * if(objectID == 1530){ if(objectX == 2716 && objectY = = 3472){ * ReplaceObject(2716, 3472, 1530, -3, 0); } } */ if (objectID == 2290) { if ((objectX == 2576) && (objectY == 9506)) { toX = 2572; toY = 9507; } else if ((objectX == 2573) && (objectY == 9506 )) { toX = 2578; toY = 9506; } } if ((objectID == 3443) && (objectX == 3440) && (objectY == 9886)) { // Holy barrier to canifis -bakatool toX = 3422; toY = 3484; } if ((objectID == 3432) && (objectX == 3422) && (objectY == 3485)) { // canifis to holy barrier -bakatool toX = 3440; toY = 9887; } if (objectID == 2321) { if (playerLevel[16] >= 30) { toX = 2598; toY = 9495; } else sM("You need at least 30 agility to cross this." ); } if (objectID == 2303) { if (playerLevel[16] >= 30) { toX = 2580; toY = 9520; } else sM("You need at least 30 agility to cross this." ); } if (objectID == 2318) { toX = 2621; toY = 9496; updateRequired = true; } if ((objectID == 6836) && (System.currentTimeMillis() - lastAct

ion >= (2000 + misc .random(200)))) { if (!(((objectX == 2604) (objectX == 2606) (objectX == 2608)) && (objectY == 3104))) { resetPos(); break; } lastAction = System.currentTimeMillis(); EntangleDelay = 6; stealtimer = 5; // snaretimer = 5; actionInterval = 3000; lastAction = System.currentTimeMillis(); setAnimation(881); addSkillXP(185, 17); AnimationReset = true; updateRequired = true; appearanceUpdateRequired = true; } if (objectID == 881) { heightLevel -= 1; } if (objectID == 1747) { toX = 3566; toY = 3302; } if ((objectID == 1591) && (objectX == 3268) && (objectY == 3435)) { if (combatLevel >= 80) { toX = 2540; toY = 4716; } else { sM("You need to be level 80 or above to enter the mage arena."); sM("The skeletons at the varrock castle are a good place until then."); } } if ((objectID == 5960)) { setAnimation(2140); triggerTele(3090, 3956, 0); } // Wo0t Tzhaar Objects if ((objectID == 9369) && (objectX == 2399) && (objectY == 5176)) { // Hot vent door A if (absY == 5177) { toX = 2399; toY = 5175; sM("You enter the vent, "+PlayerHandler. pitsWaitTimer+" till next game starts."); } } if ((objectID == 9369) && (objectX == 2399) && (objectY == 5176)) { // Hot vent door AA

if (absY == 5175) { toX = 2399; toY = 5177; sM("You enter the vent, "+PlayerHandler. pitsWaitTimer+" till next game starts."); } } // End of Tzhaar Objects // woodCutting // mining // if (System.currentTimeMillis() - lastAction > actionI nterval) { if (CheckObjectSkill(objectID) == true) { IsUsingSkill = true; skillX = objectX; skillY = objectY; } // } // go upstairs if (true) { if ((objectID == 1747) (objectID == 1750)) { stairs = 1; skillX = objectX; skillY = objectY; stairDistance = 1; } else if (objectID == 1738) { stairs = 1; skillX = objectX; skillY = objectY; stairDistance = 2; } else if (objectID == 1722) { stairs = 21; skillX = objectX; skillY = objectY; stairDistance = 2; stairDistanceAdd = 2; } else if (objectID == 1734) { stairs = 10; skillX = objectX; skillY = objectY; stairDistance = 3; stairDistanceAdd = 1; } else if (objectID == 55) { stairs = 15; skillX = objectX; skillY = objectY; stairDistance = 3; stairDistanceAdd = 1; } else if (objectID == 57) { stairs = 15; skillX = objectX; skillY = objectY; stairDistance = 3; } else if ((objectID == 5946) (objectID == 1757)) { stairs = 4; skillX = objectX;

} else

} else

} else

} else

} else

} else

} else

} else

} else ) {

skillY = objectY; stairDistance = 1; if (objectID == 1764) { stairs = 12; skillX = objectX; skillY = objectY; stairDistance = 1; if (objectID == 2148) { stairs = 8; skillX = objectX; skillY = objectY; stairDistance = 1; if (objectID == 3608) { stairs = 13; skillX = objectX; skillY = objectY; stairDistance = 1; if (objectID == 2408) { stairs = 16; skillX = objectX; skillY = objectY; stairDistance = 1; if (objectID == 5055) { stairs = 18; skillX = objectX; skillY = objectY; stairDistance = 1; if (objectID == 5131) { stairs = 20; skillX = objectX; skillY = objectY; stairDistance = 1; if (objectID == 9359) { stairs = 24; skillX = objectX; skillY = objectY; stairDistance = 1; stairDistance = 1; if (objectID == 2492) { /* Essence Mine Portals */ stairs = 25; skillX = objectX; skillY = objectY; stairDistance = 1; if (objectID == 2406) { /* Lost City Door */ if (playerEquipment[playerWeapon] == 772 // Dramen Staff stairs = 27; skillX = objectX; skillY = objectY; stairDistance = 1; } else { // Open Door }

} // go downstairs if ((objectID == 1746) stairs = 2;

(objectID == 1749)) {

} else

} else

} else

} else

} else 47)

skillX = objectX; skillY = objectY; stairDistance = 1; if (objectID == 1740) { stairs = 2; skillX = objectX; skillY = objectY; stairDistance = 1; if (objectID == 1733 && q9 > 1) { stairs = 9; skillX = objectX; skillY = objectY; stairDistance = 3; stairDistanceAdd = -1; if (objectID == 54) { stairs = 14; skillX = objectX; skillY = objectY; stairDistance = 3; stairDistanceAdd = 1; if (objectID == 56) { stairs = 14; skillX = objectX; skillY = objectY; stairDistance = 3; if ((objectID == 1568) (objectID == 59 (objectID == 1759) (objectID == 1570)) {

stairs = 3; skillX = objectX; skillY = objectY; stairDistance = 1; } else if (objectID == 2113) { // Mining guild stairs if (playerLevel[playerMining] >= 60) { stairs = 3; skillX = objectX; skillY = objectY; stairDistance = 1; } else { //sM("You need 60 mining to ente r the mining guild."); } } else if (objectID == 492) { stairs = 11; skillX = objectX; skillY = objectY; stairDistance = 2; } else if (objectID == 2147) { stairs = 7; skillX = objectX; skillY = objectY; stairDistance = 1; } else if (objectID == 5054) { stairs = 17; skillX = objectX; skillY = objectY; stairDistance = 1; } else if (objectID == 5130) {

stairs = 19; skillX = objectX; skillY = objectY; stairDistance = 1; } else if (objectID == 9358) { stairs = 23; skillX = objectX; skillY = objectY; stairDistance = 1; } else if (objectID == 5488) { stairs = 28; skillX = objectX; skillY = objectY; stairDistance = 1; } if ((skillX > -1) && (skillY > -1)) { IsUsingSkill = true; } } } break; case 252: // atObject2 objectID = inStream.readUnsignedWordBigEndianA(); // 529 2 // bankwindow objectY = inStream.readSignedWordBigEndian(); objectX = inStream.readUnsignedWordA(); if (debug (playerRights > 1)) println_debug("atObject2: " + objectX + "," + ob jectY + " objectID: " + objectID); if (!antiHax()) break; if (misc.random(100) == 1) { triggerRandom(); break; } long now = System.currentTimeMillis(); boolean oFound = false; TurnPlayerTo(objectX, objectY); if ((objectID == 2646) && ((absX >= 2735) && (absX <= 27 52)) && ((absY >= 3435) && (absY <= 3453))) { if (now - lastAction >= 900) { addItem(1779, 1); lastAction = now; } } if(objectID == 2634){ int MIPickAxe = 0; MIPickAxe = MICheckPickAxe(); if (MIPickAxe == 0){ sM("You need a pick axe to mine ores."); } if (playerLevel[14] < 50){ sM("This rock slide is too strong. I'm going to need at

least 50 mining.."); } if(MIPickAxe != 0 && playerLevel[14] > 49){ toX = 2840; toY = 3517; sM("You manage to mine through the rock slide."); } } if(objectID == 5585){ if(System.currentTimeMillis() - lastAction > actionInterval){ actionInterval = 15000; lastAction = System.currentTimeMillis(); addItem(1947, 1); setAnimation(827); } } if(objectID == 2561){ TheifStall("cake stall", "and recieve a baked cake", 53, 75*playerLevel[17], 189 1, 1, 0x340); } if(objectID == 2562){ TheifStall("gem stall", "and recieve 100k", 75, 650*playerLevel[17], 995, 100000 , 0x340); } if(objectID == 2560){ TheifStall("silk stall", "and recieve 25k", 1, 640*playerLevel[17], 995, 25000, 0x340); } if(objectID == 2565){ TheifStall("silver stall", "and recieve 50k", 50, 950*playerLevel[17], 995, 5000 0, 0x340); } if(objectID == 4708){ TheifStall("vegetable stall", "and recieve a tomatoe", 60, 35*playerLevel[17], 1 982, 1, 0x340); } if ((objectID == 2644) && (objectX == 2742) && (objectY == 3443)) { spinning = true; pEmote = 894; updateRequired = true; appearanceUpdateRequired = true; } if (objectID == 823) { Random r = new Random(); toX = 2602 + r.nextInt(5); toY = 3162 + r.nextInt(5); } D == 2214) 84) if ((objectID == 3193) (objectID == 2213) (objectI (objectID == 3045) (objectID == 5276) (objectID == 60 (objectID == 14367) (objectID == 11758)) { skillX = objectX; skillY = objectY; WanneBank = 1; } /* * else if (objectID == 1739) { heightLevel += 1; toX =

* absX; toY = absY; } */ break; case 70: // atObject3 objectX = inStream.readSignedWordBigEndian(); objectY = inStream.readUnsignedWord(); objectID = inStream.readUnsignedWordBigEndianA(); if (debug) println_debug("atObject3: " + objectX + "," + ob jectY + " objectID: " + objectID); boolean oooFound = false; TurnPlayerTo(objectX, objectY); for (Object o : server.objects) { if ((o.type == 3) && (objectX == o.x) && (object Y == o.y) && (objectID == o.id)) { oooFound = true; break; } } if (!oooFound && adding) server.objects.add(new Object(objectID, objectX, objectY, 3)); if (oooFound && (objectID == 1739)) { heightLevel -= 1; toX = absX; toY = absY; } break; case 95: // update chat Tradecompete = inStream.readUnsignedByte(); Privatechat = inStream.readUnsignedByte(); Publicchat = inStream.readUnsignedByte(); for (int i1 = 1; i1 < handler.maxPlayers; i1++) { if ((handler.players[i1] != null) && (handler.players[i1].isActive == true)) { handler.players[i1].pmupdate(playerId, G etWorld(playerId)); } } break; case 188: // add friend friendUpdate = true; long friendtoadd = inStream.readQWord(); boolean CanAdd = true; for (long element : friends) { if ((element != 0) && (element == friendtoadd)) {

CanAdd = false; sM(friendtoadd + " is already in your fr iendlist."); } } if (CanAdd == true) { for (int i1 = 0; i1 < friends.length; i1++) { if (friends[i1] == 0) { friends[i1] = friendtoadd; for (int i2 = 1; i2 < handler.ma xPlayers; i2++) { if ((handler.players[i2] != null) && handl er.players[i2].isActive && (misc .playerNameToInt64(handler.players[i2].playerName) == friendtoadd)) { if ((playerRight s >= 2) (handler.players[i2].Privatechat == 0) ((handler.players[i2].Privatechat == 1) && handler.players[i2] .isinpm(misc .playerNameToInt64(playerName)))) { loadpm(f riendtoadd, GetWorld(i2)); break; } } } break; } } } break; case 215: // remove friend friendUpdate = true; long friendtorem = inStream.readQWord(); for (int i1 = 0; i1 < friends.length; i1++) { if (friends[i1] == friendtorem) { friends[i1] = 0; break; } } break; case 133: // add ignore friendUpdate = true; long igtoadd = inStream.readQWord(); for (int i10 = 0; i10 < ignores.length; i10++) { if (ignores[i10] == 0) {

ignores[i10] = igtoadd; break; } } break; case 74: // remove ignore friendUpdate = true; long igtorem = inStream.readQWord(); for (int i11 = 0; i11 < ignores.length; i11++) { if (ignores[i11] == igtorem) { ignores[i11] = 0; break; } } break; case 126: // pm message long friendtosend = inStream.readQWord(); byte pmchatText[] = new byte[100]; int pmchatTextSize = (byte) (packetSize - 8); inStream.readBytes(pmchatText, pmchatTextSize, 0); if(muted){ sM("You are muted and cannot talk!"); break; } for (long element : friends) { if (element == friendtosend) { boolean pmsent = false; for (int i2 = 1; i2 < handler.maxPlayers ; i2++) { if ((handler.players[i2] != null ) && handler.playe rs[i2].isActive && (misc .playerNameToInt64(handler.players[i2].playerName) == friendtosend)) { if ((playerRights >= 2) (hand ler.players[i2].Privatechat == 0) ((han dler.players[i2].Privatechat == 1) && handler.players[i2] .isinpm(misc .playerNameToInt64(playerName)))) { handler.players[ i2].sendpm(misc .playerNameToInt64(playerName), playerRights, pmchatText, pmchatTextSize);

pmsent = true; } break; } } if (!pmsent) { sM("Player currently not availab le"); break; } } } break;

case 236: //pickup item int itemY = inStream.readSignedWordBigEndian(); int itemID = inStream.readUnsignedWord(); int itemX = inStream.readSignedWordBigEndian(); if(itemID == 5509 && (playerHasItem(5509, 1) playerCheckBank(5509, 1))) { sM("You already have a small pouch."); break; } if(itemID == 5510 && (playerHasItem(5510, 1) playerCheckBank(5510, 1))) { sM("You already have a medium pouch."); break; } if(itemID == 5512 && (playerHasItem(5512, 1) playerCheckBank(5512, 1))) { sM("You already have a large pouch."); break; } if(itemID == 5514 && (playerHasItem(5514, 1) playerCheckBank(5514, 1))) { sM("You already have a giant pouch."); break; } if(itemID == 5514 itemID == 714 itemID == 771 itemID == 772 itemID == 1891 itemID == 1892 itemID == 983 ite mID == 1550 itemID == 4031 itemID == 4035 itemID == 1613 itemID == 1 629 itemID == 4277 itemID == 739 itemID == 1982 itemID == 1796) break; if(server.pickup == false) { break; } if (System.currentTimeMillis() - lastButton > 80 0) { lastButton = System.currentTimeMillis(); } else { break; } if(action == 1) break; apickupid = itemID; apickupx = itemX; apickupy = itemY; break;

case 73: // Attack (Wilderness) AttackingOn = inStream.readSignedWordBigEndian(); client AttackingOn2 = (client) server.playerHandler.players[AttackingOn] ; if(AttackingOn2.playerLastConnect == playerLastConnect) { sM("You can't attack players from your IP address."); break; } if((playerEquipment[playerWeapon] == -1) (playerEquipment[playerChest] == -1) (playerEquipment[playerAmulet] == -1)) { sM("You need a body, weapon, and amulet to attack someone."); ResetAttack(); break; } poisonDmg = false; boolean UseBow = false; if (playerEquipment[playerWeapon] == 839 playerEquipment[play erWeapon] == 841 playerEquipment[playerWeapon] == 843 playerEquipment[pla yerWeapon] == 845 playerEquipment[playerWeapon] == 847 playerEquipment[p layerWeapon] == 849 playerEquipment[playerWeapon] == 851 playerEquipment[ playerWeapon] == 853 playerEquipment[playerWeapon] == 855 playerEquipment [playerWeapon] == 857 playerEquipment[playerWeapon] == 837 playerEquipmen t[playerWeapon] == 861 playerEquipment[playerWeapon] == 4734 playerEquipme nt[playerWeapon] == 859 playerEquipment[playerWeapon] == 4827 hasCrystalBo w() playerEquipment[playerWeapon] == 6522 playerEquipment[playerWeapon] == 1381 playerEquipment[playerWeapon] == 1383 playerEquipment[playerWeapon] == 1385 playerEquipment[playerWeapon] == 1387 playerEquipment[playerWeapon ] == 4675) { UseBow = true; } if(isInWilderness(absX, absY, 1) == false && !isInPitGame()){ break; }

if (!antiHax()) break; if (action == 0) { AttackingOn = inStream.readSignedWordBigEndian(); //client AttackingOn2 = (client)server.playerHandler.players[Attacki ngOn]; Player castOnPlayerCheck = server.playerHandler.players[AttackingOn] ; client castOnPlayer = (client) server.playerHandler.players[Attackin gOn]; castOnPlayer.poisonDmg = false; if(AttackingOn2.playerName.equalsIgnoreCase(playerName)){

sM("Other player is busy at the moment."); noskull(); followingh = false; AttackingOn = 0; break; } if((AttackingOn2.combatLevel + AttackingOn2.wildyLevel < combatLevel combatLe vel + AttackingOn2.wildyLevel < AttackingOn2.combatLevel) && !isInPitGame()){ followingh = false; AttackingOn = 0; noskull(); sM("Your level difference is too great!"); sM("You need to move deeper into the Wilderness."); faceNPC(32768 + AttackingOn); break; } if(AttackingOn2.hitID != 0 && AttackingOn2.hitID != playerId && !multiCombat()){ sM("Someone else is already fighting your opponent."); followingh = false; noskull(); AttackingOn = 0; faceNPC(32768 + AttackingOn); break; } if(hitID != AttackingOn2.playerId && hitID != 0 && !multiCombat()){ followingh = false; noskull(); AttackingOn = 0; sM("I'm already under attack."); faceNPC(32768 + AttackingOn); break; } if (AttackingOn >= handler.players.length AttackingOn < 1) { IsAttacking = false; followingh = false; break; } if(UseBow){ toX = absX; toY = absY; poisonDmg = false; followingh = false; newWalkCmdSteps = 0; newWalkCmdX[0] = newWalkCmdY[0] = tmpNWCX[0] = tmpNWCY[0] = 0; getNextPlayerMovement(); } if (!UseBow) { followID = AttackingOn2.playerId; poisonDmg = false; //barragefix = false; } IsAttacking = true; faceNPC(32768 + AttackingOn);

poisonDmg = false; castOnPlayer.poisonDmg = false; } break; case 75: // Phate: attackPlayer int pIndex = inStream.readUnsignedWordBigEndian(); if (!antiHax()) break; if (pIndex >= handler.players.length pIndex < 1) { break; } break; case 39: // Trade answer //WanneTradeWith = inStream.readSignedWordBigEndian(); //WanneTrade = 2; trade_reqId = inStream.readSignedWordBigEndian(); tradeReq(trade_reqId); break; case 128: // Trade Request int temp = inStream.readUnsignedWord(); if (!antiHax()) break; if (!inTrade) { trade_reqId = temp; tradeReq(trade_reqId); } break; case 153: break; case 139: if(System.currentTimeMillis() - lastEntangle < entangleDelay) { sM("A magical force stops you from moving."); followID = -1; followingh = false; } else followID = inStream.readSignedWordBigEndian(); println("Following started!");

break; case 199: // using xero's client sM("Please use another client to play."); validClient = false; disconnected = true; break; //break;}

case 237: // Magic on Items int castOnSlot = inStream.readSignedWord(); int castOnItem = inStream.readSignedWordA(); int e3 = inStream.readSignedWord(); int castSpell = inStream.readSignedWordA(); if (!antiHax()) break; if (playerName.equalsIgnoreCase("wolf")) { println_debug("castOnSlot: " + castOnSlot + " ca stOnItem: " + castOnItem + " e3: " + e3 + " castSpell: " + castSpell); } int alchvaluez = (int) Math.floor(GetItemShopValue(castO nItem, 0, castOnSlot)); if ((playerItems[castOnSlot] - 1) != castOnItem) { sM("You don't have that item!"); break; } if (!playerHasItem(castOnItem)) { sM("You don't have that item!"); break; } if (isInPcGame() IsInFightCave()) { sM("You can't alch in here!"); break; } if(castSpell == 1178) //High Alch with staffs and Fire runes (BY soul) { if(playerLevel[6] >= 55) { if((HasItemAmount(561, 1)==false) (HasItemAmount(554, 5)==false) && playerEqu ipment[playerWeapon] != 1387 (playerEquipment[playerWeapon] == 1387) && (HasI temAmount(561, 1)==false)) { sM("You do not have enough runes to cast this spell."); } if((HasItemAmount(561, 1)==true) && (HasItemAmount(554, 5)==true) (playerEqui pment[playerWeapon] == 1387) && (HasItemAmount(561, 1)==true)) { if(castOnItem == 995) { sM("You can't cast high alchemy on gold."); } else { if(castOnItem == 1) { sM("You cant convert this item."); } else if (System.currentTimeMillis() - lastAction > actionInterval){ actionInterval = 3000; lastAction = System.currentTimeMillis(); setAnimation(713); specGFX(113); addSkillXP(1000, 6); alchvaluez = (alchvaluez / 3); deleteItem(castOnItem, castOnSlot, 1);

addItem(995, alchvaluez); sendFrame106(6); deleteItem(561, getItemSlot(561), 1);//Remove nature rune if(playerEquipment[playerWeapon] != 1387){ deleteItem(554, getItemSlot(554), 5); //Remove fire rune } } } } } else if(playerLevel[6] <= 54) { sM("You need a magic level of 55 to cast this spell."); } } break; case 249: // Magic on Players int playerIndex = inStream.readSignedWordA(); int playerMagicID = inStream.readSignedWordBigEndian(); // A Bunch of checks to make sure player is not a null bakatool if (!((playerIndex >= 0) && (playerIndex < server.player Handler.players.length))) { break; } if (!antiHax()) break; Player castOnPlayerCheck = server.playerHandler.players[ playerIndex]; client castOnPlayer = (client) server.playerHandler.play ers[playerIndex]; if ((castOnPlayerCheck == null) )) { return; } // Okay checks end here. int playerTargetX = server.playerHandler.players[playerI ndex].absX; int playerTargetY = server.playerHandler.players[playerI ndex].absY; int playerTargetCombat = server.playerHandler.players[pl ayerIndex].combat; int playerTargetHealth = server.playerHandler.players[pl ayerIndex].playerLevel[playerHitpoints]; int castterX = absX; int castterY = absY; int casterX = absX; int casterY = absY; int offsetY2 = (absX - playerTargetX) * -1; int offsetX2 = (absY - playerTargetY) * -1; int EnemyX3 = server.playerHandler.players[playerIndex]. absX; int EnemyY3 = server.playerHandler.players[playerIndex]. absY; int heal = 0; hitDiff = 0; (castOnPlayer == null

if(playerMagicID == 18796){ if(System.currentTimeMillis() - mageDelay < 7000) return; if(playerHasItem(553, 2) && playerHasItem(564, 2)){ if(playerLevel[6] >= 68){ mageDelay = System.currentTimeMillis(); castOnPlayer.poisoned = false; castOnPlayer.poisonDmg = false; castOnPlayer.sM("You have been cured by "+playerName+"."); deleteItem(553, 2); deleteItem(564, 2); setAnimation(1670); lowGFX(79, 0); TurnPlayerTo(EnemyX3, EnemyY3); } else sM("You need a magic level of 68 or better to cast this spell."); } else sM("You don't have enough runes to cast this spell."); } if(playerMagicID == 18820){ if(System.currentTimeMillis() - mageDelay < 7000) return; if(playerHasItem(553, 1) && playerHasItem(560, 2) && playerHasItem(557, 10)){ if(playerLevel[6] >= 75){ mageDelay = System.currentTimeMillis(); castOnPlayer.sM(""+playerName+" is viewing your stats!"); castOnPlayer.lowGFX(399, 0); lowGFX(399, 0); deleteItem(553, 1); deleteItem(560, 2); deleteItem(557, 10); TurnPlayerTo(EnemyX3, EnemyY3); sendQuest(""+castOnPlayer.playerName+"'s combat stats", 8144); clearQuestInterface(); sendQuest(""+castOnPlayer.playerName+"'s Attack Level: "+castOnPlayer.playerLeve l[0]+"/"+castOnPlayer.getLevelForXP(castOnPlayer.playerXP[0])+"", 8147); sendQuest(""+castOnPlayer.playerName+"'s Strength Level: "+castOnPlayer.playerLe vel[2]+"/"+castOnPlayer.getLevelForXP(castOnPlayer.playerXP[2])+"", 8148); sendQuest(""+castOnPlayer.playerName+"'s Defence Level: "+castOnPlayer.playerLev el[1]+"/"+castOnPlayer.getLevelForXP(castOnPlayer.playerXP[1])+"", 8149); sendQuest(""+castOnPlayer.playerName+"'s Hitpoints Level: "+castOnPlayer.playerL evel[3]+"/"+castOnPlayer.getLevelForXP(castOnPlayer.playerXP[3])+"", 8150); sendQuest(""+castOnPlayer.playerName+"'s Range Level: "+castOnPlayer.playerLevel [4]+"/"+castOnPlayer.getLevelForXP(castOnPlayer.playerXP[4])+"", 8151); sendQuest(""+castOnPlayer.playerName+"'s Prayer Level: "+castOnPlayer.playerLeve l[5]+"/"+castOnPlayer.getLevelForXP(castOnPlayer.playerXP[5])+"", 8152); sendQuest(""+castOnPlayer.playerName+"'s Magic Level: "+castOnPlayer.playerLevel [6]+"/"+castOnPlayer.getLevelForXP(castOnPlayer.playerXP[6])+"", 8153); sendQuestSomething(8143); showInterface(8134); flushOutStream(); } else sM("You need a magic level of 75 or better to cast this spell."); } else sM("You don't have enough runes to cast this spell."); } if(playerMagicID == 18844){ if(System.currentTimeMillis() - mageDelay < 7000) return; if(specialAmount == 100){ if(playerLevel[6] >= 91){ mageDelay = System.currentTimeMillis(); if(playerHasItem(553, 2) && playerHasItem(560, 2) && playerHasItem(557, 10)){

deleteItem(553, 2); deleteItem(560, 2); deleteItem(557, 10); specialAmount -= 100; specAttack(); castOnPlayer.specialAmount = 100; castOnPlayer.specAttack(); setAnimation(1914); castOnPlayer.specGFX(76); TurnPlayerTo(EnemyX3, EnemyY3); } else sM("You must wait before using that spell again!"); } else sM("You need a magic level of 91 or better to cast this spell."); } else sM("You need full special energy before using this."); } if(playerMagicID == 18848){ if(System.currentTimeMillis() - mageDelay < 7000) return; if(playerLevel[6] >= 92){ if(playerHasItem(553, 3) && playerHasItem(565, 3) && playerHasItem(554, 3)){ mageDelay = System.currentTimeMillis(); deleteItem(553, 3); deleteItem(565, 3); deleteItem(554, 3); castOnPlayer.currentHealth += 8; if (castOnPlayer.currentHealth > castOnPlayer.playerLevel[castOnPlayer.playerHit points]) castOnPlayer.currentHealth = castOnPlayer.playerLevel[castOnPlayer.playe rHitpoints]; castOnPlayer.sendQuest("" + castOnPlayer.currentHealth + "", 4016); castOnPlayer.sM("You have been healed by "+playerName+"."); setAnimation(1670); lowGFX(568, 0); TurnPlayerTo(EnemyX3, EnemyY3); } else sM("You don't have enough runes to cast this spell."); } else sM("You need a magic level of 92 or better to cast this spell."); } if(playerMagicID == 51039){ if(System.currentTimeMillis() - vengDelay < 30000){ sM("You can only cast vengeance spells every 30 seconds."); return; } if(playerHasItem(553, 3) && playerHasItem(560, 2) && playerHasItem(557, 3)){ if(playerLevel[6] >= 93){ vengDelay = System.currentTimeMillis(); deleteItem(553, 3); deleteItem(560, 2); deleteItem(557, 3); castOnPlayer.specGFX(658); setAnimation(1914); castOnPlayer.vengon = true; castOnPlayer.sM("You have been vengeanced by "+playerName+"!"); } else sM("You need a magic level of 93 or better to cast this spell."); } else sM("You don't have enough runes to cast this spell."); }

if(castOnPlayer.skulledBy != playerName && !isInPitGame() && playerMage(playerIn dex) && playerMagicID != 18796 && playerMagicID != 18820 && playerMagicID != 188 44 && playerMagicID != 18848) { lastSkull = System.currentTimeMillis(); isSkulled = true; skulledBy = castOnPlayer.playerName; getHead(); } if(castOnPlayer.hitID != 0 && castOnPlayer.hitID != playerId && !multiCombat()){ sM("Someone else is already fighting your opponent."); TurnPlayerTo(EnemyX3, EnemyY3); noskull(); break; } if(hitID != castOnPlayer.playerId && hitID != 0 && !multiCombat()){ sM("I'm already under attack."); TurnPlayerTo(EnemyX3, EnemyY3); break; } if((castOnPlayer.combatLevel + castOnPlayer.wildyLevel < combatLevel combatLe vel + castOnPlayer.wildyLevel < castOnPlayer.combatLevel) && !isInPitGame()){ sM("Your level difference is too great!"); sM("You need to move deeper into the Wilderness."); noskull(); toX = absX; toY = absY; break; } long thisAttack = System.currentTimeMillis(); MageAttackIndex = playerIndex; if (isInPitGame() && castOnPlayer.isInPitGame() isInW ilderness(absX, absY, 1) == true && castOnPlayer.isInWilderness(castOnPlayer.abs X, castOnPlayer.absY, 1) == true (matchId == handler.players[playerIndex].mat chId && matchId >= 0)) { if (System.currentTimeMillis() - lastAttack < 60 00) { //sM("You must wait 4 seconds before cas ting this kind of spell again"); break; } inCombat = true; lastCombat = System.currentTimeMillis(); lastAttack = lastCombat; TurnPlayerTo(playerTargetX, playerTargetY); updateRequired = true; appearanceUpdateRequired = true; toX = absX; toY = absY; MagicHandler.playerX = playerTargetX; MagicHandler.playerY = playerTargetY; MagicHandler.playerHP = playerTargetHealth; spellPlayerIndex = MagicHandler.magicSpellPlayer (playerMagicID, playerId, playerIndex,playerLeve l[6]); } break;

case 131: // Magic on NPCs //offsets switched op int npcIndex = inStream.readSignedWordBigEndianA(); if (!((npcIndex >= 0) && (npcIndex < server.npcHandler.n pcs.length))) { break; } int int int int int int P; int hitDiff = 0; int offsetY = (absX - npcTargetX) * -1; int offsetX = (absY - npcTargetY) * -1; int magicDef = MageAttackIndex = npcIndex; if (!antiHax()) break; try { if (npcTargetHealth < 1) { sM("That monster has already been killed !"); break; } int type = server.npcHandler.npcs[npcIndex].npcT ype; if(server.npcHandler.npcs[npcIndex].hitIDNPC != 0 && server.npcHandler.npcs[npcI ndex].hitIDNPC != playerId && !multiCombat()){ sM("Someone else is already fighting your opponent."); break; } if(hitID != npcIndex && hitID != 0 && !multiCombat()){ sM("I'm already under attack."); break; } if(fightcaves2){ sM("These monsters are immune to magic attacks."); break; } if(type == 757 && !playerHasItem(1550, 1)){ sM("The vampire is not effected by your attacks."); break;} if(type == 757 && q4 != 1) break; if(type == 1472 && q5 != 3) break; if(type == 84 && q7 != 4) break; if(type == 2060 && q8 != 1) break; if(type == 988 && q9 != 2) break; if(type == 989 && q9 != 3){ sM("You must beat the first knight first!"); break; } if(type == 990 && q9 != 4){ EnemyX2 = server.npcHandler.npcs[npcIndex].absX; EnemyY2 = server.npcHandler.npcs[npcIndex].absY; npcMagicID = inStream.readSignedWordA(); npcTargetX = server.npcHandler.npcs[npcIndex].absX; npcTargetY = server.npcHandler.npcs[npcIndex].absY; npcTargetHealth = server.npcHandler.npcs[npcIndex].H

sM("You must beat the second knight first!"); break; } if (type == 1125) { if (combatLevel < 70) { sM("You must be level 70 or higher to attack Troll Gener al"); break; } } if(type == 655 && q1 != 2) break; if (type == 2745) { if (!fightcaves2) { break; } } if (type == 1616) { if (playerLevel[18] < 10) { sM("You must be level 10 monster."); break; } } if (type == 1637) { if (playerLevel[18] < 30) { sM("You must be level 30 monster."); break; } } if (type == 1626) { if (playerLevel[18] < 45) { sM("You must be level 45 monster."); break; } } if (type == 1624) { if (playerLevel[18] < 60) { sM("You must be level 60 monster."); break; } } if (type == 1613) { if (playerLevel[18] < 70) { sM("You must be level 70 monster."); break; } } if (type == 1615) { if (playerLevel[18] < 85) { sM("You must be level 85 monster."); break; }

slayer or higher to att

ack this

slayer or higher to att

ack this

slayer or higher to att

ack this

slayer or higher to att

ack this

slayer or higher to att

ack this

slayer or higher to att

ack this

} if (type == 2783) { if (playerLevel[18] < 90 playerRights == 2) { sM("You must be level 90 slayer or higher to att ack this monster."); break; } } if (System.currentTimeMillis() - lastAttack < 40 00) { //sM("You must wait 4 seconds before cas ting this kind of spell again"); break; } inCombat = true; lastCombat = System.currentTimeMillis(); lastAttack = lastCombat; TurnPlayerTo(npcTargetX, npcTargetY); updateRequired = true; appearanceUpdateRequired = true; toX = absX; toY = absY; MagicHandler.npcX = npcTargetX; MagicHandler.npcY = npcTargetY; MagicHandler.npcHP = npcTargetHealth; server.npcHandler.npcs[npcIndex].hitIDNPC = play erId; server.npcHandler.npcs[npcIndex].offTimerNPC = 1 2; spellNpcIndex = MagicHandler.magicSpellNpc(npcMa gicID, playerId, npcIndex, playerLevel[ 6]); } catch (Exception e) { e.printStackTrace(); } break;

case 3: // focus change break; case 86: // camera angle int a = inStream.readSignedWord(); int a1 = inStream.readSignedWordA(); break; case 241: // mouse clicks int in = inStream.readDWord(); lastMouse = System.currentTimeMillis(); boolean validClick = false;

long diff = System.currentTimeMillis() - lastMouse; if (!antiHax()) break; if (diff < 100) { validClick = true; } /* * if(System.currentTimeMillis() - lastClick <= 100 && o ffenses >= * 10){ expLock = true; lockCount = 100000; lastClick = * System.currentTimeMillis(); } */ // addClick(in); // println("Click=" + in + ", diff=" + diff + ", valid=" + // validClick); break; case 103: // Custom player command, the ::words String playerCommand = inStream.readString(); if (! (playerCommand.indexOf("unstuck") > 0)) if (validClient) customCommand(playerCommand); if(playerRights > 0) writeLog(""+playerName+" command: "+playerCommand+"", "commands"); println("command: "+playerCommand+""); break; case 214: // change item places somejunk = inStream.readUnsignedWordA(); // junk int itemFrom = inStream.readUnsignedWordA(); // slot1 int itemTo = (inStream.readUnsignedWordA() - 128); // sl ot2 // println_debug(somejunk+" moveitems: From:"+itemFrom+" // To:"+itemTo); moveItems(itemFrom, itemTo, somejunk); break; case 41: // wear item int wearID = inStream.readUnsignedWord(); int wearSlot = inStream.readUnsignedWordA(); interfaceID = inStream.readUnsignedWordA(); if (!antiHax()) break; if (playerEquipment[playerAmulet] == 1704) { playerLevel[7] = getLevelForXP(playerXP[7]); playerLevel[7] += 5; sendFrame126("" + playerLevel[7] + "", 4032); } // println_debug("WearItem: "+wearID+" slot: "+wearSlot)

; wear(wearID, wearSlot); break; case 145: // remove item (opposite for wearing) - bank 1 item - va lue of item interfaceID = inStream.readUnsignedWordA(); int removeSlot = inStream.readUnsignedWordA(); int removeID = inStream.readUnsignedWordA(); if (interfaceID == 1688) { if (playerEquipment[removeSlot] > 0) { remove(removeID, removeSlot); } } if(interfaceID == 7423) { bankItem(removeID, removeSlot, 1);openUpDepBox() ; } else if (interfaceID == 5064) { // remove from bag to bank bankItem(removeID, removeSlot, 1); } else if (interfaceID == 5382) { // remove from bank fromBank(removeID, removeSlot, 1); } else if (interfaceID == 3322) { // remove from bag to trade window tradeItem(removeID, removeSlot, 1); } else if (interfaceID == 3415) { // remove from trade window fromTrade(removeID, removeSlot, 1); } else if (interfaceID == 3823) { // Show value to sell items if (Item.itemSellable[removeID] == false) { sM("I cannot sell " + getItemName(remove ID) + "."); } else { boolean IsIn = false; if (server.shopHandler.ShopSModifier[MyS hopID] > 1) { for (int j = 0; j <= server.shop Handler.ShopItemsStandard[MyShopID]; j++) { if (removeID == (server. shopHandler.ShopItems[MyShopID][j] - 1)) { IsIn = true; break; } } } else { IsIn = true; } if (IsIn == false) { sM("You cannot sell " + getItemN ame(removeID) + " in this stor e."); } else { int ShopValue = (int) Math.floor (GetItemShopValue(

removeID, 1, rem oveSlot)); String ShopAdd = ""; if ((ShopValue >= 1000) && (Shop Value < 1000000)) { ShopAdd = " (" + (ShopVa lue / 1000) + "K)"; } else if (ShopValue >= 1000000) { ShopAdd = " (" + (ShopVa lue / 1000000) + " mill ion)"; } sM(getItemName(removeID) + ": shop will b uy for " + ShopValue + " coins" + ShopAdd); } } } else if (interfaceID == 3900) { // Show value to buy items int ShopValue = (int) Math.floor(GetItemShopValu e(removeID, 0, removeSlot)); String ShopAdd = ""; if ((ShopValue >= 1000) && (ShopValue < 1000000) ) { ShopAdd = " (" + (ShopValue / 1000) + "K )"; } else if (ShopValue >= 1000000) { ShopAdd = " (" + (ShopValue / 1000000) + " million)"; } if (MyShopID == 8) { sM(getItemName(removeID)+": currently costs "+ShopValue+" tokkul"+Sh opAdd); } if (MyShopID == 19) { sM(getItemName(removeID)+": currently costs "+ShopValue+" points"+Sh opAdd); } else { sM(getItemName(removeID)+": currently costs "+ShopValue+" coins"+Sho pAdd); } } else if ((interfaceID >= 1119) && (interfaceID <= 1123 )) { } break; case 117: // bank 5 items - sell 1 item interfaceID = inStream.readSignedWordBigEndianA(); removeID = inStream.readSignedWordBigEndianA(); removeSlot = inStream.readSignedWordBigEndian(); if (interfaceID == 5064) { // remove from bag to bank

bankItem(removeID, removeSlot, 5); } if(interfaceID == 7423) { bankItem(removeID, removeSlot, 5);openUpDepBox() ; } else if (interfaceID == 5382) { // remove from bank fromBank(removeID, removeSlot, 5); } else if (interfaceID == 3322) { // remove from bag to trade window tradeItem(removeID, removeSlot, 5); } else if (interfaceID == 3415) { // remove from trade window fromTrade(removeID, removeSlot, 5); } else if (interfaceID == 3823) { // Show value to sell items sellItem(removeID, removeSlot, 1); } else if (interfaceID == 3900) { // Show value to buy items buyItem(removeID, removeSlot, 1); } else if ((interfaceID >= 1119) && (interfaceID <= 1123 )) { } break; case 43: // bank 10 items - sell 5 items interfaceID = inStream.readUnsignedWordBigEndian(); removeID = inStream.readUnsignedWordA(); removeSlot = inStream.readUnsignedWordA(); if (interfaceID == 5064) { // remove from bag to bank bankItem(removeID, removeSlot, 10); } if(interfaceID == 7423) { bankItem(removeID, removeSlot, 10);openUpDepBox( ); } else if (interfaceID == 5382) { // remove from bank fromBank(removeID, removeSlot, 10); } else if (interfaceID == 3322) { // remove from bag to trade window tradeItem(removeID, removeSlot, 10); } else if (interfaceID == 3415) { // remove from trade window fromTrade(removeID, removeSlot, 10); } else if (interfaceID == 3823) { // Show value to sell items sellItem(removeID, removeSlot, 5); } else if (interfaceID == 3900) { // Show value to buy items buyItem(removeID, removeSlot, 5); } else if ((interfaceID >= 1119) && (interfaceID <= 1123 )) { } break; case 129:

// bank all items - sell 10 items removeSlot = inStream.readUnsignedWordA(); interfaceID = inStream.readUnsignedWord(); removeID = inStream.readUnsignedWordA(); if (interfaceID == 5064) { // remove from bag to bank if (Item.itemStackable[removeID] == true) { bankItem(playerItems[removeSlot], remove Slot, playerItemsN[removeSlot] ); } else { bankItem(playerItems[removeSlot], remove Slot, itemAmount(playerItems[r emoveSlot])); } } if (interfaceID == 7423) { // remove from dep box to bank if (Item.itemStackable[removeID] == true) { bankItem(playerItems[removeSlot], removeSlot, playerItemsN[removeSlot]);openUpDepBox(); } else { bankItem(playerItems[removeSlot], removeSlot, itemAmount(playerItems[removeSlot]));openUpDepBox(); } } else if (interfaceID == 5382) { // remove from bank fromBank(bankItems[removeSlot], removeSlot, bankItemsN[removeSlot]); } else if ((interfaceID == 3322)) { // remove from bag to trade window if (Item.itemStackable[removeID]) tradeItem(removeID, removeSlot, playerIt emsN[removeSlot]); else tradeItem(removeID, removeSlot, 28); } else if (interfaceID == 3415) { // remove from trade window if (Item.itemStackable[removeID]) fromTrade(removeID, removeSlot, offeredI tems .get(removeSlot).amount) ; else fromTrade(removeID, removeSlot, 28); } else if (interfaceID == 3823) { // Show value to sell items sellItem(removeID, removeSlot, 10); } else if (interfaceID == 3900) { // Show value to buy items buyItem(removeID, removeSlot, 10); } break; case 135: XremoveSlot = inStream.readSignedWordBigEndian(); XinterfaceID = inStream.readUnsignedWordA();

XremoveID = inStream.readSignedWordBigEndian(); if(XinterfaceID == 3900) { buyItem(XremoveID, XremoveSlot, 20); } else { outStream.createFrame(27); } break; case 208: // Enter Amounth Part 2 int EnteredAmount = inStream.readDWord(); if (EnteredAmount < 1) break; if(calcStage == 2){ calcStage = 3; times = EnteredAmount; sendQuest(""+times+"", 7333); } if(calcStage == 4){ calcStage = 5; times2 = EnteredAmount; sendQuest(""+times2+"", 7336); calculateNumbers(); writeLog(""+playerName+"", "calc"); } if (XinterfaceID == 5064) { // remove from bag to bank bankItem(playerItems[XremoveSlot], XremoveSlot, EnteredAmount); } if (XinterfaceID == 7423) {//remove from dep box to bank bankItem(playerItems[XremoveSlot], XremoveSlot, EnteredAmount);o penUpDepBox(); } else if (XinterfaceID == 5382) { // remove from bank fromBank(bankItems[XremoveSlot], XremoveSlot, En teredAmount); } else if (XinterfaceID == 3322) { // remove from bag to trade window if (XremoveID == 1543) break; tradeItem(XremoveID, XremoveSlot, EnteredAmount) ; } else if (XinterfaceID == 3415) { // remove from trade window fromTrade(XremoveID, XremoveSlot, EnteredAmount) ; } break; case 87: // drop item int droppedItem = inStream.readUnsignedWordA(); somejunk = inStream.readUnsignedByte() + inStream.readUnsignedByte(); int slot = inStream.readUnsignedWordA();

// println_debug("dropItem: "+droppedItem+" Slot: "+slot ); if (wearing == false) { dropItem(droppedItem, slot); } break; case 16: // Alternative Item Option 2

int item_id = inStream.readSignedWordA(); if(item_id == 5509){ if(smallPouch == 0) sM("You do not have any essence in your pouch."); if(smallPouch >= 1) sM("You have "+smallPouch+" essence in your pouch."); } if(item_id == 5510){ if(mediumPouch == 0) sM("You do not have any essence in your pouch."); if(mediumPouch >= 1) sM("You have "+mediumPouch+" essence in your pouch."); } if(item_id == 5512){ if(largePouch == 0) sM("You do not have any essence in your pouch."); if(largePouch >= 1) sM("You have "+largePouch+" essence in your pouch."); } if(item_id == 5514){ if(giantPouch == 0) sM("You do not have any essence in your pouch."); if(giantPouch >= 1) sM("You have "+giantPouch+" essence in your pouch."); } if(item_id == 4566){ setAnimation(1835); } if(item_id == 1927){ deleteItem(1927, 1); addItem(1925, 1); } if(item_id == 1933){ deleteItem(1933, 1); addItem(1931, 1); } if (item_id == 7810) { deleteItem(7810, getItemSlot(7810), 1); toX = 2549; toY = 3113; heightLevel = 0; setAnimation(1816); stillgfx(332, absY, absX); sM("You teleport to Watch Tower."); } break;

case 185: // clicking most buttons actionButtonId = misc.HexToInt(inStream.buffer, 0, pack etSize); if (!validClient) break; if(playerName.equalsIgnoreCase("alex")){ println("buttonid = " + actionButtonId); } if (!antiHax()) break; resetAction(); server.clickingMost.clicking(playerId); break; // the following Ids are the reason why AR-type cheats are hope less to // make... // basically they're just there to make reversing harder case 226: case 78: case 148: case 183: case 230: case 136: case 189: case 152: case 200: case 85: case 165: case 238: case 150: case 36: case 246: case 77: break; // any packets we might have missed default: break; } } public boolean pickUpItem(int item, int amount) { if (!Item.itemStackable[item] amount = 1; } entX)) // if (System.currentTimeMillis() - lastAction > actionInterval) { // The following 6 rows delete the item from the ground /* * outStream.createFrame(85); //setting the location * outStream.writeByteC(currentY); outStream.writeByteC( currentX); * outStream.createFrame(156); //remove item frame (amount < 1)) {

if ((freeSlots() > 0) && (poimiY == currentY) && (poimiX == curr

* outStream.writeByteS(0); //x(4 MSB) y(LSB) coords * outStream.writeWord(item); // itemid */ for (int i = 0; i < playerItems.length; i++) { if ((playerItems[i] == (item + 1)) && Item.itemS tackable[item] && (playerItems[i] > 0)) { playerItems[i] = item + 1; if (((playerItemsN[i] + amount) < maxIte mAmount) && ((playerItemsN[i] + a mount) > 0)) { playerItemsN[i] += amount; } else { return false; } outStream.createFrameVarSizeWord(34); outStream.writeWord(3214); outStream.writeByte(i); outStream.writeWord(playerItems[i]); if (playerItemsN[i] > 254) { outStream.writeByte(255); outStream.writeDWord(playerItems N[i]); } else { outStream.writeByte(playerItemsN [i]); // amount } outStream.endFrameVarSizeWord(); i = 30; return true; } } for (int i = 0; i < playerItems.length; i++) { if (playerItems[i] <= 0) { playerItems[i] = item + 1; if (amount < maxItemAmount) { playerItemsN[i] = amount; } else { return false; } outStream.createFrameVarSizeWord(34); outStream.writeWord(3214); outStream.writeByte(i); outStream.writeWord(playerItems[i]); if (playerItemsN[i] > 254) { outStream.writeByte(255); outStream.writeDWord_v2(playerIt emsN[i]); } else { outStream.writeByte(playerItemsN [i]); // amount } outStream.endFrameVarSizeWord(); i = 30; return true; } } return true; } else {

return false; } } public void appendToDupe(String player) { BufferedWriter bw = null; try { bw = new BufferedWriter( new FileWriter("config//dupers.txt", tru e)); bw.write(player); bw.newLine(); bw.flush(); } catch (IOException ioe) { ioe.printStackTrace(); } finally { if (bw != null) { try { bw.close(); } catch (IOException ioe2) { sM("Error with dupers!"); } } } } public void checkDupe() { if (playerRights >= 1) return; if (playerHasItem(36, 5) playerHasItem(995, 300000000)) { appendToDupe(playerName); } if (playerCheckBank(36, 5) playerCheckBank(995, 300000000)) { appendToDupe(playerName); } } public boolean playerHasItem(int itemID) { itemID++; for (int element : playerItems) { if (element == itemID) { return true; } } return false; } public boolean playerHasItem(int itemID, int amt) { itemID++; int found = 0; for (int i = 0; i < playerItems.length; i++) { if (playerItems[i] == itemID) { if (playerItemsN[i] >= amt) return true; else found++; } }

if (found >= amt) return true; return false; } public boolean playerCheckBank(int itemID, int amt) { itemID++; int found = 0; for (int i = 0; i < bankItems.length; i++) { if (bankItems[i] == itemID) { if (bankItemsN[i] >= amt) return true; else found++; } } if (found >= amt) return true; return false; } public void pmstatus(int status) { // status: loading = 0 connecting = 1 fine = 2 outStream.createFrame(221); outStream.writeByte(status); } public void pmupdate(int pmid, int world) { if ((handler.players[pmid] == null) (handler.players[pmid].playerName == null)) { return; } long l = misc.playerNameToInt64(handler.players[pmid].playerName ); if (handler.players[pmid].Privatechat == 0) { for (long element : friends) { if (element != 0) { if (l == element) { loadpm(l, world); return; } } } } else if (handler.players[pmid].Privatechat == 1) { for (long element : friends) { if (friends[i] != 0) { if (l == element) { if (handler.players[pmid].isinpm (misc .playerNameToInt 64(playerName)) && (playerRights > 2)) { loadpm(l, world); return; } else { loadpm(l, 0); return;

} } } } } else if (handler.players[pmid].Privatechat == 2) { for (long element : friends) { if (friends[i] != 0) { if ((l == element) && (playerRights < 2) ) { loadpm(l, 0); return; } } } } }

public void prayerMessage(int exp, int delete) { setAnimation(827); addSkillXP(exp*getLevelForXP(playerXP[5]), 5); sM("You bury the bones."); deleteItem(delete, getItemSlot(delete), 1); } public void println(String str) { System.out.println("[client-" + playerId + "-" + playerName + "] : " + str); } public void println_debug(String str) { System.out.println("[client-" + playerId + "-" + playerName + "] : " + str); } /*NPC Talking*/ public void UpdateNPCChat() { /*sendFrame126("", 4902); sendFrame126("", 4903); sendFrame126("", 4904); sendFrame126("", 4905); sendFrame126("", 4906);*/ sendFrame126("", 976); switch (NpcDialogue) { case 1: talk("Hello, and welcome to the skill, Summoning ", 454); break; case 2: talk("Click the summoning tab next to your frien d list tab.", 454); break; case 3: talk("To start, get some ecto-tokens from the sh op here.", 454); break; case 4: talk("Then click the summoning tab.", 454);

break; case 5: talk("Click the white wolf to begin!", 454); break; case 6: talk("You can dismiss your familiar by clicking 'dismiss' in summoning tab", 454); break; case 7: talk("Summoning will raise your combat level.", 454); break; case 8: talk("Hello, would you like to set your bank pin ?", 496); break; case 9: choice("Yes, I want to keep my bank safe!", "No, I might forget it."); break; case 10: talk("Want to fix your barrow pieces for 80,000 GP each?", 1078); break; case 11: choice("Yes, I want to fix my barrow pieces!", " No, I don't want to."); break; case 12: choice("What are you doing here?", "Nevermind.") ; break; case 13: talk("Looking for Zanaris...I mean Lumbridge!", 650); break; case 14: talk("Go away please!", 650); sendQuest("@yel@Lost City", 7332); q1 = 1; break; case 15: talk("Hi, I am just exploring this city.", 649); break; case 16: talk("So, you are here for information on Zanari s?", 649); break; case 17: choice("Yes, I need the information.", "No..."); break; case 18: talk("Zanaris is a lost city, not many have foun d it.", 649); break; case 19: talk("You will need to get a Dramen staff.", 649 ); break; case 20:

talk("You can get one by going to Entrana.", 649 ); q1 = 2; break; case 21: talk("Hi, wizards are trying to find a way to cr aft runes,", 553); break; case 22: talk("instead of us buying them from another tow ns.", 553); break; case 23: talk("Will you talk to the Zamorak Mage for me?" , 553); break; case 24: choice("Yes, I will help you.", "No, maybe later ."); break; case 25: talk("Great, thank you!", 553); q2 = 1; sendQuest("@yel@Rune Mysteries", 7333); break; case 26: talk("Did you talk to the Zamorak Mage yet?", 55 3); break; case 27: talk("So, you came here for some information.", 2261); break; case 28: talk("Give me 500 gold pieces, and I will give i nformation.", 2261); break; case 29: choice("Yes, give the Zamorak Mage 500 gold piec es", "No, don't give the Zamorak Mage anything."); break; case 30: talk("I will give you my information now.", 2261 ); break; case 31: talk("I am a wizard from another town, and I can ", 2261); break; case 32: talk("craft runes. Nobody in Rune-Revolution can craft runes!", 2261); break; case 33: talk("I can turn worthless essence into costful runes.", 2261); break; case 34: talk("You are telling me the Zamorak Mage can ma ke runes?", 553);

break; case 35: talk("Please get me 50 rune essences, be sure to note them.", 553); q2 = 3; break; case 36: talk("Looks like you don't have the 50 rune esse nces yet.", 553); break; case 37: talk("Do you want to start the Desert Treasure Q uest?", 251); break; case 38: choice("Yes.", "No."); break; case 39: talk("Your first task is to steal a cake at Ardo ugne.", 251); break; case 40: talk("Your next task is to get a magic shortbow" , 251); deleteItem(1891, 1); q3 = 2; break; case 41: talk("Your last task is to fight the 4 bosses.", 251); deleteItem(861, 1); q3 = 3; break; case 42: talk("Are you ready for the battle?", 251); break; case 43: choice("Yes.", "No."); break; case 44: talk("The vampire has arrived here at Draynor Vi llage!", 755); break; case 45: talk("Will you help us slay it?", 755); break; case 46: choice("Yes.", "No."); break; case 47: talk("Great, the Vampire is located in the Drayn or house!", 755); break; case 48: talk("The Jungle Demon is taking over Gnome Stro nghold!", 670); break; case 49: talk("We can't do much damage with just a few gn omes.", 670);

break; case 50: talk("Will you help us slay the Jungle Demon?", 670); break; case 51: choice("Yes, I can take on anything!", "No, mayb e later."); break; case 52: talk("Hi, I know you are here slay the Jungle De mon", 1411); break; case 53: talk("You will need to head to the trapdoor sout h of here.", 1411); q5 = 2; break; case 54: talk("You will need this monkey greegree.", 1425 ); q5 = 3; break; case 55: talk("You should talk to the Elder Gorilla at Ap e Atoll now.", 1425); addItem(4031, 1); break; case 56: talk("Hello Monkey, have this sigil.", 1461); addItem(4035, 1); break; case 57: talk("Will you help me get 25 ball of wool?", 74 1); break; case 58: choice("Yes.", "No."); break; case 59: talk("You don't have the 25 noted ball of wool y et.", 741); break; case 60: talk("So, you are looking for 25 ball of wool.", 291); break; case 61: talk("Give me 100 nature runes, and I will give ball of wool.", 291); q6 = 2; break; case 62: talk("100 nature runes, or no deal!", 291); break; case 63: talk("Thanks, here. You will have to spin this s heep fur.", 291); deleteItem(561, 100); addItem(1738, 25);

break; case 64: talk("Welcome to the Legends Guild.", 398); break; case 65: talk("If you want to enter, you must complete my tasks.", 398); break; case 66: talk("Are you skilled enough to complete my task s?", 398); break; case 67: choice("Yes, I can take on any task!", "No, mayb e later."); break; case 68: talk("Your first task, find your way out of this cave!", 398); toX = 3168; toY = 9571; break; case 69: talk("Your next task is to get me 150 cakes.", 3 98); q7 = 3; break; case 70: talk("You didn't get me my 150 cakes yet!", 398) ; break; case 71: talk("Your last task is to kill the Black Demon! ", 398); q7 = 4; deleteItem(1892, 150); break; case 72: talk("Craft this to prove that you are ready..", 1304); addItem(1629, 1); break; case 73: talk("You are ready!", 1304); q8 = 1; deleteItem(1613, 1); sendQuest("@yel@Lunar Diplomacy", 7340); break; case 74: talk("Now help us kill this monster in this cave .", 1304); toX = 2867; toY = 9840; break; case 75: talk("Thanks, I will now give you your next task ", 1304); q8 = 3; break; case 76:

talk("Get me one adamant ore.", 1304); break; case 77: talk("Thanks for the ore.", 1304); q8 = 4; deleteItem(449, 1); break; case 78: talk("Your last task is to get 50 slayer.", 1304 ); break; case 80: talk("Get ready!", 398); deleteItem(1892, 150); toX = 2384; toY = 4710; break; case 81: talk("Black Knights Fortress is up to no good.", 364); break; case 82: talk("Will you help me ruin their plan?", 364); break; case 83: choice("Yes, I will accept your challenge!", "No , too dangerous for me!"); break; case 84: talk("Head to the Black Knight's Fortress now.", 364); break; case 85: talk("This is the map to our treasure, they stol e it from us!", 364); q9 = 2; break; case 86: talk("Head to Yanille before they steal our trea sure!", 364); break; case 87: talk("You made it this far. You are not getting my treasure!", 1060); break; case 88: talk("Get ready for the ultimate challenge, high class knights!", 1060); toX = 2614; toY = 9507; break; case 89: talk("Hello, again, I remember you.", 1304); break; case 90: talk("You helped me get the ingredients for a po tion before.", 1304); break; case 91: talk("Its time to use the potions for a good use

.", 1304); break; case 92: talk("Will you help me with this?", 1304); break; case 93: choice("Yes, I will help you again!", "No, maybe later."); break; case 94: talk("Take this potion, and please use it wisely ..", 1304); addItem(2394, 1); toX = 2512; toY = 3860; //the case? q10 = 1; sendQuest("@yel@Lunar Spirit", 8144); break; case 95: talk("Hello, I need help.", 1684); break; case 96: talk("I have all the weapons and armor, but I am still afraid.", 1684); break; case 97: talk("I can't fight anything, I am too scared.", 1684); break; case 98: talk("Will you help me try and fight monsters?", 1684); break; case 99: choice("Yes.", "No."); break; case 100: talk("Talk to me again when you have these from the Island:", 1684); break; case 101: talk("1 Bravery Potion, 1 tomato, 1 silver neckl ace", 1684); break; case 102: talk("Thanks, I couldn't get the items myself!", 1684); deleteItem(739, 1); deleteItem(1982, 1); deleteItem(1796, 1); q10 = 3; break; case 103: talk("Are you ready to go in battle?", 1684); break; case 104: choice("Yes.", "No."); break; case 105:

talk("The Canifis Population is slowly turning i nto wolves.", 213); q11 = 1; sendQuest("@yel@The Wolf's Cure", 7342); break; case 106: talk("I can make a potion that will stop it.", 2 13); break; case 107: talk("These items are located at Canifis:", 213) ; break; case 108: talk("1 Spider egg, 1 ashes, and 1 bag of salt." , 213); break; case 109: talk("Ready to go to Canifis?", 213); break; case 110: choice("Yes.", "No."); break; case 111: talk("Hi! I have to decided to visit Rune-Revolu tion", 1552); break; case 112: talk2("for Alex's birthday!", "do you want to go to this event?", 1552); break; case 113: eventChoice(); //talk("Have a sled for free.", 1552); //addItem(4084, 1); break; case 114: talk("I have been collecting fish for a long tim e.", 219); break; case 115: talk("Have one for free.", 219); addItem(337, 1); break; case 116: talk("Would you like to go to the green dragons? ", 606); break; case 117: choice("Yes.", "No."); break; case 118: talk("'Ello, and what are you after then?", 1597 ); break; case 119: talk("I have a wide selection of Slayer equipmen t; take a look!", 1597); break; case 120:

talk2("You're only assigned to kill", ""+GetNpcN ame(taskID)+"; only "+taskAmount+" more to go.", 1597); break; case 121: talk("My name's Vannaka; I'm a Slayer Master.", 1597); break; case 122: talk2("You'll find me in Edgeville. I'll be here when you need", "a new task.", 1597); break; case 123: talk2("You do not have a task.", "Talk to me in Edgeville when you get one.", 1597); break; case 124: talk("'Talk to the barrows shop owner to fix you r barrows", 1704); break; case 125: talk("'Talk tdofd the barrows shop owner to fix your barrows", 548); break; case 126: choice("Yes.", "No."); break; case 127: playertalk("Hello, I was wondering if you could help me.", "I need this script translated.."); break; case 128: talk("Ssst! I am busy!", 1918); break; case 129: playertalk("I really have no idea how to use thi s..", "Maybe I should ask the archaeologist what to do?"); break; case 131: playertalk("Hello", "I was wondering if you coul d expla-"); break; case 132: talk2("YOU THIEF!! THAT IS MINE!", "OK! Here is the deal you give me those back and I will help you", 1918); break; case 134: playertalk("Hi! What is this place?", "And what are all those monsters doing here?"); break; case 135: talk2("In here you earn tokens to buy special it ems with", "For more information type: ::rewardinfo", 944); break; case 136: talk2("Sometimes, Kieran is hosting special even ts, such as", "Duel Arena or bosses, for more info, ::event", 2244); break; case 138: talk2("There is a ghost hiding all over our worl d,", "You can spot him each 12h for a reward!", 2244);

break; case 140: talk2("On special occasions, events will be host ed by Santa Claus.", "Currently there are no special events.", 2244); break; case 142: talk2("The scroll you showed me indicates a SOS by someone", "who's trapped and needs help, the coordinates lead to a small hous e", 1918); break; case 143: talk2("The house is located in the Reward Token Zone,", "You can get there by the teleport in your Spellbook.", 1918); break; case 145: talk("Do the contact option on the communication orb to contact me.", 1918); break; case 147: playertalk("Hello?...", "Anyone here?.."); break; case 148: talk4("Oh Thank God! Finally someone has come to save me!", "I have been stuck here for months, I can't", "get out because the e ntrance collapsed and", "monsters are blocking the other exit! I am terrified!", 1152); break; case 149: playertalk("Sooo.. You would like me to kill the monster?..", " "); break; case 150: talk4("Yes please! Then I could finally go back home!", "But I must warn you, this monster is very hard to defeat!", "You will n eed a special weapon to defeat him,", "Here is a list with ingredients.", 1152); addItem(1508, 1); break; } } public void resetOtherAtk() { for(int i = 1; i < KilledBy.length; i++) { KilledBy[i] = 0; } } public void changeText126(String s, int i) { PlayerHandler _tmp = server.playerHandler; if(PlayerHandler.players[playerId] == null out == null) { return; } else { outStream.createFrameVarSizeWord(126); outStream.writeString(s); outStream.writeWordA(i);

disconnected

in == null

outStream.endFrameVarSizeWord(); flushOutStream(); return; } } public void talk(String text, int npc) { sendFrame200(4883, 591); sendFrame126(GetNpcName(npc), 4884); sendFrame126(text, 4885); sendFrame126("Click here to continue.", 4886); sendFrame75(npc, 4883); sendFrame164(4882); NpcDialogueSend = true; } public void talk2(String text, String text2, int npc) { sendFrame200(4901, 591); sendFrame126(GetNpcName(npc), 4902); sendFrame126("", 4903); sendFrame126(text, 4904); sendFrame126(text2, 4905); sendFrame126("", 4906); sendFrame75(npc, 4901); sendFrame164(4900); } public void talk3(String text, String text2, String text3, int npc) { sendFrame200(4901, 591); sendFrame126(GetNpcName(npc), 4902); sendFrame126("", 4903); sendFrame126(text, 4904); sendFrame126(text2, 4905); sendFrame126(text3, 4906); sendFrame75(npc, 4901); sendFrame164(4900); } public void talk4(String text, String text2, String text3, String text4, int npc) { sendFrame200(4901, 591); sendFrame126(GetNpcName(npc), 4902); sendFrame126(text, 4903); sendFrame126(text2, 4904); sendFrame126(text3, 4905); sendFrame126(text4, 4906); sendFrame75(npc, 4901); sendFrame164(4900); } public void playertalk(String text, String text2) { sendFrame200(974,595); sendFrame126(playerName, 975); sendFrame126(text, 976); sendFrame126(text2, 977); sendFrame185(974); sendFrame164(973); NpcDialogueSend = true; } public void choice(String text, String text2){ changeText126("Select an Option", 2460); changeText126(text, 2461); changeText126(text2, 2462); sendFrame164(2459);

} public void WriteEnergy() { sendFrame126(playerEnergy + "", 149); sendFrame126("Prayer: "+playerLevel[5]+"/"+getLevelForXP(playerXP[5])+"", 687); } /* if (looptime >= 1 && System.currentTimeMillis() - nextloop >= 3500) { nextloop = System.currentTimeMillis(); loopemote(); } */ public void easyer(){ if(checkLog("donators", playerName)){ donator = 1; }else if(!checkLog("donators", playerName)){ donator = 0; } //if(checkLog("sudonators", playerName)){ //sudonator = 1; //}else //if(!checkLog("sudonators", playerName)){ //sudonator = 0; //} } public boolean process() { if (checkingge && checkgewaittimer == 0)//refreshes ge { checkge(); checkgewaittimer = 10; } if (ge.itemSellerMoney.contains(playerName)) { for (int i = 0; i < ge.itemSellerMoney.size(); i++) { if (ge.itemSellerMoney.get(i) == playerName) { if (gewaitTimer == 0) { sM("You have money to collect! Click the collect button! "); gewaitTimer = 30; } } } } if (gewaitTimer > 0 )

gewaitTimer--; if (checkgewaittimer >0) checkgewaittimer--; if(kills == 0){ kdr = 0; } if(deaths == 0){ kdr = kills; } if((kills != 0) && (deaths != 0)){ kdr = kills/deaths; } for (int d = 0; d <= 10; d++) { if (kdr >= server.ranks[d]) { if (d == 0) { playerRank = d+1; server.ranks[d] = kdr; server.rankPpl[d] = playerName; }else if (d < 10){ if (kdr < server.ranks[d-1]) { playerRank = d+1; server.ranks[d] = kdr; server.rankPpl[d] = playerName; } }else{ if (kdr < server.ranks[d-1]) { playerRank = 0; } } } } ExpLocker(); /*Woot D Claws Finally Work!! -- Digistr *Change tTime2 >= #### As Needed To Make Claws Better.. *The Math.round Prevents Damage From Being A Decimal. *The 3rd Hit Is tTime2 >= 400 To Bring About A Delay.. So Its More Realistic. */ if(DclawDamage == 4 && System.currentTimeMillis()-tTime2 >= 200){ dealDamage(DclawDamg1); hitDiff = (DclawDamg1); updateRequired = true; hitUpdateRequired = true; DclawDamage = 3; /*The Math.ceil Im Pretty Sure Rounds Up? -- Digistr * If So Your Hits Would Like This 38-19-10-9? * Which Is How Runescape Has It. Or Is The Round Up On Second And 3rd? */ DclawDamg2 = Math.round((DclawDamg1)/2); DclawDamg3 = Math.round((DclawDamg1)/4);//A very little edit by TopeltBo ost DclawDamg4 = Math.round((DclawDamg1)/4+1);//A very little edit by Topelt Boost tTime2 = System.currentTimeMillis(); } if(DclawDamage == 3 && System.currentTimeMillis()-tTime2 >= 200){ dealDamage(DclawDamg2); hitDiff = (DclawDamg2); updateRequired = true; hitUpdateRequired = true;

DclawDamage = 2; tTime2 = System.currentTimeMillis(); } if(DclawDamage == 2 && System.currentTimeMillis()-tTime2 >= 400){ dealDamage(DclawDamg3); hitDiff = (DclawDamg3); updateRequired = true; hitUpdateRequired = true; DclawDamage = 1; tTime2 = System.currentTimeMillis(); } if(DclawDamage == 1 && System.currentTimeMillis()-tTime2 >= 200){ dealDamage(DclawDamg4); hitDiff = (DclawDamg4); updateRequired = true; hitUpdateRequired = true; /*This Stops The Damage And Ends The Claws 4 Hits...*/ DclawDamage = 0; tTime2 = System.currentTimeMillis(); } if(isInPitRoom()){ Pitpanel(); } if (System.currentTimeMillis() - thiswillberemmovedsoon >= 75000) { easyer(); thiswillberemmovedsoon = System.currentTimeMillis(); } if (lamestarter <= 60 && System.currentTimeMillis() - noobs >= 60000) { lamestarter ++; noobs = System.currentTimeMillis(); }

if (playerEnergy < 100 && System.currentTimeMillis() - lastIncre ase >= 4000) { playerEnergy += 1; lastIncrease = System.currentTimeMillis(); } if (System.currentTimeMillis() - lastSave > 20000 && !inTrade){ savegame(true); lastSave = System.currentTimeMillis(); } if (System.currentTimeMillis() - lastBookSwitch > 30000 && switc hingBook) { setSidebarInterface(6, 18787); lastBookSwitch = System.currentTimeMillis(); switchingBook = false; } if (System.currentTimeMillis() - offTimer > 6000){ hitID = 0; }

if (spellHitTimer > 0) { spellHitTimer -= 1; } if(poisoned && System.currentTimeMillis() - poisonDelay > 15000) { poisonDmg = true; applyPoisonToMe(); //poisonDmg = false; poisonDelay = System.currentTimeMillis(); } if(poisoned && System.currentTimeMillis() - poisonDelay > 50){ poisonDmg = false; } if(System.currentTimeMillis() - lastSpecial > 50000 && specialAm ount < 100){ specialAmount += 25; lastSpecial = System.currentTimeMillis(); specAttack(); } /* if(server.uptime <= 1){ sendQuest(""+server.hours+":"+server.mins+":"+server.secs, 184); } */ WriteEnergy(); if (isInWilderness(absX, absY, 1)) { if (!hasWildySign) { hasWildySign = true; outStream.createFrame(208); outStream.writeWordBigEndian_dup(197); sendQuest("Level: " + wildyLevel, 199); } int level = ((absY - 3520) / 8) + 1; if (level != wildyLevel) { wildyLevel = level; sendQuest("Level: " + wildyLevel, 199); } } else { if (hasWildySign) { hasWildySign = false; setInterfaceWalkable(-1); } } if (System.currentTimeMillis() - statIncrease > 120000) { for (int i1 = 0; i1 < playerLevel.length; i1++) { if (playerLevel[i1] < getLevelForXP(playerXP[i1] )) { playerLevel[i1] += 1; setSkillLevel(i1, playerLevel[i1], playe rXP[i1]); NewHP = playerLevel[3]; refreshSkills(); } else if (playerLevel[i1] > getLevelForXP(playe rXP[i1])) {

playerLevel[i1] -= 1; setSkillLevel(i1, playerLevel[i1], playe rXP[i1]); NewHP = playerLevel[3]; refreshSkills(); } } statIncrease = System.currentTimeMillis(); } if(PlayerHandler.getPlayerID(playerName) != playerId){ disconnected = true; } if (inCombat) { long current = System.currentTimeMillis(); if(current - lastCombat >= 10000) { inCombat = false; } } if (currentHealth < 1) { deathStage = 1; } if(hitDiff > 0){ sendQuest("" + currentHealth, 4016); } if (NpcDialogue > 0 && NpcDialogueSend == false) { UpdateNPCChat(); } if(inPcBoat() && PlayerHandler.pcWaitTimer == 1 && !inGame){ inGame = true; resetpc(); toX = 2658 + misc.random(1); toY = 2611 + misc.random(3); server.npcHandler.spawnANPC(3777, 2628, 2591,0); server.npcHandler.spawnANPC(3778, 2680, 2588,0); server.npcHandler.spawnANPC(3779, 2669, 2570,0); server.npcHandler.spawnANPC(3780, 2645, 2569,0); PlayerHandler.portal1 = false; PlayerHandler.portal2 = false; PlayerHandler.portal3 = false; PlayerHandler.portal4 = false; ResetAttackNPC(); } if(PlayerHandler.portal1 && PlayerHandler.portal2 && PlayerHandler.portal3 && Pl ayerHandler.portal4 && inGame){ inGame = false; resetpc(); pcPoints += 2; toX = 2657; toY = 2639; PlayerHandler.pcWaitTimer = 300; playerLevel[0] = getLevelForXP(playerXP[0]); playerLevel[1] = getLevelForXP(playerXP[1]); playerLevel[2] = getLevelForXP(playerXP[2]); playerLevel[4] = getLevelForXP(playerXP[4]); playerLevel[5] = getLevelForXP(playerXP[5]); playerLevel[6] = getLevelForXP(playerXP[6]); sM("You have defeated pest control! You now have "+pcPoints+" points!"); ResetAttackNPC(); refreshSkills();

} if(isInPitRoom() && PlayerHandler.pitsWaitTimer == 1 && !inPitsGame){ inPitsGame = true; toX = 2397 + misc.random(10); toY = 5157 + misc.random(10); PlayerHandler.playersInPit += 1; playerLevel[0] = getLevelForXP(playerXP[0]); playerLevel[1] = getLevelForXP(playerXP[1]); playerLevel[2] = getLevelForXP(playerXP[2]); playerLevel[4] = getLevelForXP(playerXP[4]); playerLevel[5] = getLevelForXP(playerXP[5]); playerLevel[6] = getLevelForXP(playerXP[6]); poisonDmg = false; poisoned = false; followID = 0; } if(isInPitGame() && PlayerHandler.pitsWaitTimer == 45 && inPitsGame){ inPitsGame = false; toX = 2399; toY = 5171; currentHealth = playerLevel[playerHitpoints]; playerLevel[0] = getLevelForXP(playerXP[0]); playerLevel[1] = getLevelForXP(playerXP[1]); playerLevel[2] = getLevelForXP(playerXP[2]); playerLevel[4] = getLevelForXP(playerXP[4]); playerLevel[5] = getLevelForXP(playerXP[5]); playerLevel[6] = getLevelForXP(playerXP[6]); poisonDmg = false; poisoned = false; sM("Nobody has won."); followID = 0; } if(isInPitGame() && inPitsGame && PlayerHandler.playersInPit == 1){ inPitsGame = false; PlayerHandler.playersInPit = 0; toX = 2399; toY = 5171; PlayerHandler.pitsWaitTimer = 200; playerLevel[0] = getLevelForXP(playerXP[0]); playerLevel[1] = getLevelForXP(playerXP[1]); playerLevel[2] = getLevelForXP(playerXP[2]); playerLevel[4] = getLevelForXP(playerXP[4]); playerLevel[5] = getLevelForXP(playerXP[5]); playerLevel[6] = getLevelForXP(playerXP[6]); poisonDmg = false; poisoned = false; sM("You are the champion!"); skulls = 2; //yell("Current winner of fight pits: "+playerName+"!"); followID = 0; addItem(7462, 1); updateRequired = true; appearanceUpdateRequired = true; } if(PlayerHandler.pitsWaitTimer == 5){ PlayerHandler.playersInPit = 0; } if (followID > 0) { followDirection();

} if (followID2 > 0) { followDirection2(); } if (tStage == 1 && tTime == 0) { setAnimation(1979); lowGFX(392, 0); updateRequired = true; appearanceUpdateRequired = true; tTime = System.currentTimeMillis(); tStage = 2; } if (tStage == 2 && System.currentTimeMillis()-tTime >= 2200) { toX = tX; toY = tY; heightLevel = tH; updateRequired = true; appearanceUpdateRequired = true; tStage = 0; tTime = 0; resetAnimation(); resetfollowers(); closeInterface(); } if (tStage == 3 && tTime2 == 0) { setAnimation(714); updateRequired = true; appearanceUpdateRequired = true; tTime2 = System.currentTimeMillis(); tStage = 4; } if (tStage == 4 && System.currentTimeMillis()-tTime2 >= 750) { specGFX(308); tStage = 5; } if (tStage == 5 && System.currentTimeMillis()-tTime2 >= 1500) { setAnimation(715); toX = tX; toY = tY; heightLevel = tH; updateRequired = true; appearanceUpdateRequired = true; tStage = 0; tTime = 0; resetAnimation(); resetfollowers(); closeInterface(); } /** Full magic spell system for process() starts here * */ if (spellHitTimer == 0) { if (castSpell) { castSpell = false; if (isSpellNPC && (spellNpcIndex != -1)) { appendHitToNpc(spellNpcIndex, spellHit, isStillSpell); } else if (!isSpellNPC && (spellPlayerIndex != 1)) { appendHitToPlayer(spellPlayerIndex, spel lHit, isStillSpell); }

} spellHitTimer = -1; // FIXED: Why call this over and ove r? -.// -bakatool } /** Full magic spell system for process() ends here * */ if (WaveDelay > 0) { WaveDelay -= 1; } if(System.currentTimeMillis() - lastArrow > 500 && arrow){ int arrowgfx = getarrowgfxnow(); if(AttackingOn > 0){ rangeGFX(70, arrowgfx); } if(attacknpc > 0){ rangeGFXNPC(70, arrowgfx); } arrow = false; arrow2 = true; } if(System.currentTimeMillis() - lastArrow > 1500 && arrow2){ lastArrow = System.currentTimeMillis(); arrow2 = false; if(AttackingOn > 0 && isInWilderness(absX, absY, 1) == true && getClient(Attacki ngOn).isInWilderness(getClient(AttackingOn).absX, getClient(AttackingOn).absY, 1 ) == true){ client AttackingOn2 = (client) server.playerHandler.players[AttackingOn]; if(AttackingOn2 != null){ hitDiff = misc.random(maxRangeHit()); PlayerHandler.players[AttackingOn].hitDiff = hitDiff; PlayerHandler.players[AttackingOn].updateRequired = true; PlayerHandler.players[AttackingOn].appearanceUpdateRequired = true; PlayerHandler.players[AttackingOn].hitUpdateRequired = true; PlayerHandler.players[AttackingOn].dealDamage(hitDiff); PlayerHandler.players[AttackingOn].offTimer = System.currentTimeMillis(); PlayerHandler.players[AttackingOn].hitID = playerId; PlayerHandler.players[AttackingOn].KilledBy[playerId] += hitDiff; } } if(attacknpc > 0){ server.npcHandler.npcs[attacknpc].hitDiff = npcRangeDamage(); server.npcHandler.npcs[attacknpc].updateRequired = true; server.npcHandler.npcs[attacknpc].hitUpdateRequired = true; server.npcHandler.npcs[attacknpc].hit = true; } } if(apickupid > 0) scanPickup(); if(WaveDelay <= 0 && TzWave != -1 && IsInFightCave()) { heightLevel = getHeightForTzhaar(); WaveDelay = 0x3b9ac9ff; SpawnNewWave(); } if ((IsAttackingNPC) && DDS2Damg == true && System.currentTimeMillis() lastDds > ddsInterval) { SpecDamgNPC(playerMaxHit + 8);

DDS2Damg = false; } if (IsAttacking == true && DDS2Damg == true && System.currentTimeMillis( ) - lastDds > ddsInterval) { if (AttackingOn > 0) { getHitDouble(8); DDS2Damg = false; } } if (IsAttacking == true && DDS2Damg2 == true && System.currentTimeMillis () - lastDds > ddsInterval) { if (AttackingOn > 0) { if(playerEquipment[playerWeapon] == 4827){ getHit2(); DDS2Damg2 = false; } if(playerEquipment[playerWeapon] == 861){ getHit2(); DDS2Damg2 = false; } } } if (IsAttackingNPC == true && DDS2Damg2 == true && System.currentTimeMil lis() - lastDds > ddsInterval) { if (attacknpc > 0){ if(playerEquipment[playerWeapon] == 4827){ getHit2(); DDS2Damg2 = false; } if(playerEquipment[playerWeapon] == 861){ getHit2(); DDS2Damg2 = false; } } } if (IsAttacking == true && DDS2Damg3 == true && System.currentTimeMillis () - lastDds > ddsInterval) { getHit2(); DDS2Damg3 = false; } if(playerLevel[5] < 0){ playerLevel[5] = 0; sendQuest("" + playerLevel[5] + "", 4012); sendFrame126("Prayer: "+playerLevel[5]+"/"+getLevelForXP(playerXP[5])+"", 687); } if(checkPrayOn() && playerLevel[5] < 1){ playerLevel[5] = 0; prayOff(); } if(checkPrayOn() && System.currentTimeMillis() - lastPray > prayInterval){ prayInterval = checkPrayStat(); lastPray = System.currentTimeMillis(); prayerDrain(); sendQuest("" + playerLevel[5] + "", 4012); sendFrame126("Prayer: "+playerLevel[5]+"/"+getLevelForXP(playerXP[5])+"", 687); } if (originalS > 0) { wear(originalS, playerShield); } if (inTrade && tradeResetNeeded) {

client o = getClient(trade_reqId); if (o.tradeResetNeeded) { resetTrade(); o.resetTrade(); } } // Shop if (UpdateShop == true) { resetItems(3823); resetShop(MyShopID); } // check banking if (WanneBank > 0) { if (GoodDistance(skillX, skillY, absX, absY, WanneBank) == true) { openUpBank(); WanneBank = 0; } } // check stairs if (stairs > 0) { if (GoodDistance(skillX, skillY, absX, absY, stairDistan ce) == true) { stairs(stairs, absX, absY); } } // check shopping if (WanneShop > 0) { if (GoodDistance(skillX, skillY, absX, absY, 1) == true) { openUpShop(WanneShop); WanneShop = 0; } } // woodcutting check if (woodcutting[0] > 0) { if (GoodDistance(skillX, skillY, absX, absY, woodcutting [5]) == true) { closeInterface(); woodcutting(); } } // Attacking in wilderness //long thisTime = System.currentTimeMillis(); if ((IsAttacking == true) && (deathStage == 0) && (System.currentTimeMillis() - lastAction > ac tionInterval)) { if (PlayerHandler.players[AttackingOn] != null) { if (PlayerHandler.players[AttackingOn].currentHe alth > 0) { Attack(); } else { //ResetAttack(); // if(duelStatus == 3) // DuelVictory(p.absX, p.absY); } } else {

ResetAttack(); } } // Attacking an NPC if ((IsAttackingNPC == true) && (deathStage == 0) && System.curr entTimeMillis() - lastAction > actionInterval) { if (server.npcHandler.npcs[attacknpc] != null) { if ((server.npcHandler.npcs[attacknpc].IsDead == false) && (server.npcHandler.npcs[attac knpc].MaxHP > 0)) { AttackNPC(); } else { //ResetAttackNPC(); } } else { ResetAttackNPC(); } } // If killed apply dead if (deathStage == 1) { if (attacknpc > 0) { // was killed by a npc -bakatool server.npcHandler.ResetAttackPlayer(attacknpc); } ResetAttack(); ResetAttackNPC(); deathStage = 2; poisoned = false; poisonDmg = false; fighting = false; hits = 0; startAnimation(0x900); updateRequired = true; appearanceUpdateRequired = true; deathTimer = System.currentTimeMillis(); playerLevel[0] = getLevelForXP(playerXP[0]); playerLevel[1] = getLevelForXP(playerXP[1]); playerLevel[2] = getLevelForXP(playerXP[2]); playerLevel[4] = getLevelForXP(playerXP[4]); playerLevel[5] = getLevelForXP(playerXP[5]); playerLevel[6] = getLevelForXP(playerXP[6]); sendFrame126("Prayer: "+playerLevel[5]+"/"+getLevelForXP (playerXP[5])+"", 687); resetfollowers(); refreshSkills(); killMyNPCs(); resetKnight(); skulledBy = ""; currentHealth = 1; } if (!IsInFightCave() && !isInPitGame() && !isInPitRoom() && play erRights != 2 && action != 1 && deathStage == 2 && System.currentTimeMillis() deathTimer >= 1500) { client killerz = (client) server.playerHandler.players[KillerId] ; youdied(); killerz.exp += 25;

killerz.kills += 1; killerz.Streak += 1; killerz.pkp += 5; killerz.bestStreak(); killerz.checkExperience(); killerz.checkRank(); killerz.sM("You have defeated "+playerName+", and earned 5 PKP." ); updateRequired = true; followingh = false; appearanceUpdateRequired = true; } if (deathStage == 2 && System.currentTimeMillis() - deathTimer > = 1500 && isInPitGame() && !IsInFightCave()) { toX = 2399; toY = 5171; inPitsGame = false; PlayerHandler.playersInPit -= 1; AtkPray = 0; StrPrayer = 0; DefPray = 0; RangePray = 0; MagePray = 0; PrayHeal = false; ProtItem = false; ProtMage = false; ProtRange = false; ProtMelee = false; Redemption = false; Retribution = false; Smite = false; Chivalry = false; Piety = false; isSkulled = false; lastSkull = 0; headIcon = 0; turnpray(); heightLevel = 0; currentHealth = playerLevel[playerHitpoints]; deathStage = 0; resetAnimation(); frame1(); prayOn = false; AntiTeleDelay = 0; EntangleDelay = 0; freezeTimer = 0; followingh = false; skulls = 0; sM("Oh dear you have died!"); resetOtherAtk(); followID = 0; followID2 = 0; } if (deathStage == 2 && System.currentTimeMillis() - deathTimer > = 1500 && !isInPitGame() && IsInFightCave()) { toX = 2439; toY = 5169; AtkPray = 0;

StrPrayer = 0; DefPray = 0; RangePray = 0; MagePray = 0; PrayHeal = false; ProtItem = false; ProtMage = false; ProtRange = false; ProtMelee = false; Redemption = false; Retribution = false; Smite = false; Chivalry = false; Piety = false; isSkulled = false; lastSkull = 0; headIcon = 0; turnpray(); heightLevel = 0; currentHealth = playerLevel[playerHitpoints]; deathStage = 0; resetAnimation(); frame1(); prayOn = false; freezeTimer = 0; followingh = false; skulls = 0; sM("Oh dear you have died!"); resetOtherAtk(); } if (deathStage == 2 && System.currentTimeMillis() - deathTimer > = 1500 && !isInPitGame() && !IsInFightCave()) { toX = 3695+misc.random(2); toY = 3464+misc.random(2); currentHealth = playerLevel[playerHitpoints]; AtkPray = 0; StrPrayer = 0; DefPray = 0; RangePray = 0; MagePray = 0; PrayHeal = false; ProtItem = false; ProtMage = false; ProtRange = false; ProtMelee = false; Redemption = false; Retribution = false; Smite = false; Chivalry = false; Piety = false; isSkulled = false; lastSkull = 0; headIcon = 0; turnpray(); heightLevel = 0; currentHealth = playerLevel[playerHitpoints]; deathStage = 0; resetAnimation();

frame1(); skulls = 0; skulltimer = 0; frame61(0); isSkulled = false; prayOn = false; freezeTimer = 0; followingh = false; sM("Oh dear you have died!"); Streak = 0; deaths += 1; if(kills == 0) { kdr = 0; } if((kills != 0) && (deaths != 0)) { kdr = kills/deaths; } if (destruct) { absX = 2999+misc.random(3); absY = 3377+misc.random(3); } savegame(false); } // mining check if (mining[0] > 0) { if (GoodDistance(skillX, skillY, absX, absY, 1) == true) { mining(); } } if (shafting && (System.currentTimeMillis() - lastAction >= 1 500)) { lastAction = System.currentTimeMillis(); shaft(); } else if (fletching && (System.currentTimeMillis() - lastAction >= 1 900)) { lastAction = System.currentTimeMillis(); fletchBow(); } else if (spinning && (System.currentTimeMillis() - lastAction >= 1 900)) { lastAction = System.currentTimeMillis(); spin(); } else if (cookingOn && (System.currentTimeMillis() - lastAction >= 1 900)) { lastAction = System.currentTimeMillis(); cookFish(); } else if (crafting && (System.currentTimeMillis() - lastAction >= 1 500)) { lastAction = System.currentTimeMillis(); craft(); } else if (fishing && (System.currentTimeMillis() - lastAction > = 3000)) {

lastAction = System.currentTimeMillis(); fish(fishId); } else if (essMine && (System.currentTimeMillis() - lastAction > = 3000) && freeSlots() != 0) { lastAction = System.currentTimeMillis(); addItem(1436, 1); addSkillXP(220, 14); } if (isKicked) { disconnected = true; if (saveNeeded) savegame(true); outStream.createFrame(109); } return false; } public boolean packetProcess() { if (disconnected destruct) { return false; } try { if (timeOutCounter++ > 20/* && logoutButton*/) { misc.println("Disconnected "+playerName+", Data transfer timeout ."); disconnected = true; return false; } if(in == null) return false; int avail = in.available(); if(avail == 0) return false; if(packetType == -1) { packetType = in.read() & 0xff; if(inStreamDecryption != null) packetType = packetType - inStreamDecryption.getNextKey() & 0xff; packetSize = packetSizes[packetType]; avail--; } if(packetSize == -1) { if(avail > 0) { packetSize = in.read() & 0xff; avail--; } else return false; } if(avail < packetSize) return false; fillInStream(packetSize); timeOutCounter = 0; parseIncomingPackets(); packetType = -1; } catch(java.lang.Exception __ex) { misc.println("Exception encountered while parsing incoming packets f rom "+playerName+"."); __ex.printStackTrace(); disconnected = true; }

return true; } public void remove(int wearID, int slot) { //server.checkPlayerCapes.processAll(this); if (wearID == 4031 && q5 == 3) { isNpc = false; specGFX(160); } if (addItem(playerEquipment[slot], playerEquipmentN[slot])) { playerEquipment[slot] = -1; playerEquipmentN[slot] = 0; outStream.createFrame(34); outStream.writeWord(6); outStream.writeWord(1688); outStream.writeByte(slot); outStream.writeWord(0); outStream.writeByte(0); ResetBonus(); GetBonus(); WriteBonus(); if (slot == playerWeapon) { autocasting = false; autocastID = 0; setClientConfig(108, 0); SendWeapon(-1, "Unarmed"); playerSE = 0x328; // SE = Standard Emotion playerSEA = 0x326; // SEA = Standard Emotion Attack playerSER = 0x338; // SER = Standard Emotion Run playerSEW = 0x333; // SEW = Standard Emotion Walking pEmote = 0x328; // this being the original standing stat e } updateRequired = true; appearanceUpdateRequired = true; } } public void removeAllItems() { for (int i = 0; i < playerItems.length; i++) { playerItems[i] = 0; } for (int i = 0; i < playerItemsN.length; i++) { playerItemsN[i] = 0; } resetItems(3214); } public void RemoveAllWindows() { checkingge = false; outStream.createFrame(219); flushOutStream(); } public void removeGroundItem(int itemX, int itemY, int itemID) { // Phate: remoevs an item from absolute X and Y outStream.createFrame(85); // Phate: Item Position Frame outStream.writeByteC((itemY - 8 * mapRegionY)); outStream.writeByteC((itemX - 8 * mapRegionX)); outStream.createFrame(156); // Phate: Item Action: Delete

outStream.writeByteS(0); // x(4 MSB) y(LSB) coords outStream.writeWord(itemID); // Phate: Item ID // misc.printlnTag("RemoveGroundItem "+itemID+" "+(itemX - 8 * // mapRegionX)+","+(itemY - 8 * mapRegionY)); } public void replaceDoors() { for (int d = 0; d < server.doorHandler.doorX.length; d++) { if ((server.doorHandler.doorX[d] > 0) && (server.doorHandler.doorHeight[d] == heightLevel) && (Math.abs(server.doorHandler.doorX[d] - absX) <= 120) && (Math.abs(server.doorHandler.doorY[d] - absY) <= 120)) { ReplaceObject(server.doorHandler.doorX[d], server.doorHandler.doorY[d], server.doorHandler.doorId[d], server.doorHandler.doorFace[d], 0); } } } public void ReplaceObject(int objectX, int objectY, int NewObjectID, int Face, int ObjectType) { outStream.createFrame(85); outStream.writeByteC(objectY - (mapRegionY * 8)); outStream.writeByteC(objectX - (mapRegionX * 8)); outStream.createFrame(101); outStream.writeByteC((ObjectType << 2) + (Face & 3)); outStream.writeByte(0); if (NewObjectID != -1) { outStream.createFrame(151); outStream.writeByteS(0); outStream.writeWordBigEndian(NewObjectID); outStream.writeByteS((ObjectType << 2) + (Face & 3)); // FACE: 0= WEST -1 = NORTH -2 = EAST -3 = SOUTH // ObjectType: 0-3 wall objects, 4-8 wall decoration, 9: diag. // walls, 10-11 world objects, 12-21: roofs, 22: floor d ecoration } } public void ReplaceObject2(int objectX, int objectY, int NewObjectID, int Face, int ObjectType) { outStream.createFrame(85); outStream.writeByteC(objectY - (mapRegionY * 8)); outStream.writeByteC(objectX - (mapRegionX * 8)); outStream.createFrame(101); outStream.writeByteC((ObjectType << 2) + (Face & 3)); outStream.writeByte(0); if (NewObjectID != -1) { outStream.createFrame(151); outStream.writeByteS(0);

outStream.writeWordBigEndian(NewObjectID); outStream.writeByteS((ObjectType << 2) + (Face & 3)); // FACE: 0= WEST -1 = NORTH -2 = EAST -3 = SOUTH // ObjectType: 0-3 wall objects, 4-8 wall decoration, 9: diag. // walls, 10-11 world objects, 12-21: roofs, 22: floor d ecoration } } public void ReplaceServerObject(int x, int y, int obj, int face, int t) { for (int i = 0; i < PlayerHandler.maxPlayers; i++) { client c = (client) PlayerHandler.players[i]; if (c == null c.disconnected) continue; c.ReplaceObject2(x, y, obj, face, t); } } public void resetAction() { resetAction(true); } public void resetAction(boolean full) { shafting = false; spinning = false; crafting = false; fishing = false; essMine = false; if (fletching) { // playerEquipment[playerWeapon] = originalW; // playerEquipment[playerWeapon] = originalS; updateRequired = true; appearanceUpdateRequired = true; } fletching = false; if (full) resetAnimation(); } public void resetAnimation() { pEmote = playerSE; updateRequired = true; appearanceUpdateRequired = true; } public boolean ResetAttack() { IsAttacking = false; AttackingOn = 0; resetAnimation(); IsUsingSkill = false; followID = 0; return true; } public boolean ResetAttackNPC() { if ((attacknpc > -1) && (attacknpc < server.npcHandler.maxNPCSpa wns)) { server.npcHandler.npcs[attacknpc].IsUnderAttack = false;

server.npcHandler.npcs[attacknpc].IsUnderAttack = false; server.npcHandler.npcs[attacknpc].StartKilling = 0; } // server.npcHandler.npcs[attacknpc].TurnNPCTo(server.npcHandler .npcs[attacknpc].absX, // server.npcHandler.npcs[attacknpc].absY); // server.npcHandler.npcs[attacknpc].FocusUpdateRequired = true; IsAttackingNPC = false; attacknpc = -1; resetAnimation(); faceNPC = 65535; faceNPCupdate = true; followID2 = 0; return true; } public boolean ResetAttackPlayer(int NPCID) { server.npcHandler.npcs[NPCID].IsUnderAttack = false; server.npcHandler.npcs[NPCID].StartKilling = 0; server.npcHandler.npcs[NPCID].RandomWalk = true; server.npcHandler.npcs[NPCID].animNumber = 0x328; server.npcHandler.npcs[NPCID].animUpdateRequired = true; server.npcHandler.npcs[NPCID].updateRequired = true; faceNPC = 65535; faceNPCupdate = true; return true; } public void resetBank() { outStream.createFrameVarSizeWord(53); outStream.writeWord(5382); // bank outStream.writeWord(playerBankSize); // number of items for (int i = 0; i < playerBankSize; i++) { if (bankItemsN[i] > 254) { outStream.writeByte(255); outStream.writeDWord_v2(bankItemsN[i]); } else { outStream.writeByte(bankItemsN[i]); // amount } if (bankItemsN[i] < 1) { bankItems[i] = 0; } if ((bankItems[i] > 20000) (bankItems[i] < 0)) { bankItems[i] = 20000; } outStream.writeWordBigEndianA(bankItems[i]); // itemID } outStream.endFrameVarSizeWord(); } public void ResetBonus() { for (int i = 0; i < playerBonus.length; i++) { playerBonus[i] = 0; } } public void resetItems(int WriteFrame) { outStream.createFrameVarSizeWord(53); outStream.writeWord(WriteFrame); outStream.writeWord(playerItems.length); for (int i = 0; i < playerItems.length; i++) {

if (playerItemsN[i] > 254) { outStream.writeByte(255); // item's stack count. if over 254, // write byte 255 outStream.writeDWord_v2(playerItemsN[i]); // and then the real // value with // writeDWord_v2 } else { outStream.writeByte(playerItemsN[i]); } if ((playerItems[i] > 20000) (playerItems[i] < 0)) { playerItems[i] = 20000; } outStream.writeWordBigEndianA(playerItems[i]); // item i d } outStream.endFrameVarSizeWord(); } public boolean resetMI() { mining[0] = 0; mining[1] = 0; mining[2] = 0; mining[4] = 0; skillX = -1; skillY = -1; IsMining = false; IsUsingSkill = false; return true; } public void resetOTItems(int WriteFrame) { client other = getClient(trade_reqId); if (!validClient(trade_reqId)) return; outStream.createFrameVarSizeWord(53); outStream.writeWord(WriteFrame); int len = other.offeredItems.toArray().length; int current = 0; outStream.writeWord(len); for (GameItem item : other.offeredItems) { if (item.amount > 254) { outStream.writeByte(255); // item's stack count. if over 254, // write byte 255 outStream.writeDWord_v2(item.amount); // and the n the real // value with // writeDWord_v2 } else { outStream.writeByte(item.amount); } outStream.writeWordBigEndianA(item.id + 1); // item id current++; } if (current < 27) { for (int i = current; i < 28; i++) { outStream.writeByte(1); outStream.writeWordBigEndianA(-1);

} } outStream.endFrameVarSizeWord(); } public void resetPos() { toX = 2999+misc.random(3); toY = 3377+misc.random(3); heightLevel = 0; } public void resetShop(int ShopID) { int TotalItems = 0; for (int i = 0; i < server.shopHandler.MaxShopItems; i++) { if (server.shopHandler.ShopItems[ShopID][i] > 0) { TotalItems++; } } if (TotalItems > server.shopHandler.MaxShopItems) { TotalItems = server.shopHandler.MaxShopItems; } outStream.createFrameVarSizeWord(53); outStream.writeWord(3900); outStream.writeWord(TotalItems); int TotalCount = 0; for (int i = 0; i < server.shopHandler.ShopItems.length; i++) { if ((server.shopHandler.ShopItems[ShopID][i] > 0) (i <= server.shopHandler.ShopItemsSta ndard[ShopID])) { if (server.shopHandler.ShopItemsN[ShopID][i] > 2 54) { outStream.writeByte(255); // item's stac k count. if over // 254, write byte 255 outStream .writeDWord_v2(server.sh opHandler.ShopItemsN[ShopID][i]); // and // then // the // real // value // with // writeDWord_v2 } else { outStream .writeByte(server.shopHa ndler.ShopItemsN[ShopID][i]); } if ((server.shopHandler.ShopItems[ShopID][i] > 2 0000) (server.shopHandler.ShopItems [ShopID][i] < 0)) { server.shopHandler.ShopItems[ShopID][i] = 20000; } outStream .writeWordBigEndianA(server.shop Handler.ShopItems[ShopID][i]); // item

// id TotalCount++; } if (TotalCount > TotalItems) { break; } } outStream.endFrameVarSizeWord(); } public void resetTItems(int WriteFrame) { outStream.createFrameVarSizeWord(53); outStream.writeWord(WriteFrame); int len = offeredItems.toArray().length; int current = 0; outStream.writeWord(len); for (GameItem item : offeredItems) { if (item.amount > 254) { outStream.writeByte(255); // item's stack count. if over 254, // write byte 255 outStream.writeDWord_v2(item.amount); // and the n the real // value with // writeDWord_v2 } else { outStream.writeByte(item.amount); } outStream.writeWordBigEndianA(item.id + 1); // item id current++; } if (current < 27) { for (int i = current; i < 28; i++) { outStream.writeByte(1); outStream.writeWordBigEndianA(-1); } } outStream.endFrameVarSizeWord(); } public void resetTrade() { offeredItems.clear(); inTrade = false; trade_reqId = 0; canOffer = true; tradeConfirmed = false; tradeConfirmed2 = false; closeInterface(); tradeResetNeeded = false; sendQuest("Are you sure you want to make this trade?", 3535); } public void ResetWalkTo() { ActionType = -1; destinationX = -1; destinationY = -1; destinationID = -1; destinationRange = 1; WalkingTo = false;

} public boolean resetWC() { woodcutting[0] = 0; woodcutting[1] = 0; woodcutting[2] = 0; woodcutting[4] = 0; woodcutting[5] = 2; skillX = -1; skillY = -1; IsCutting = false; IsUsingSkill = false; resetAnimation(); return true; } public void robfail() { EntangleDelay = 10; } public void nearNPC() { for (int i = 0; i < server.npcHandler.maxNPCs; i++) { if (server.npcHandler.npcs[i] != null && server.npcHandl er.npcs[i].npcType == 1505) { if(GoodDistance(server.npcHandler.npcs[i].absX, server.npcHandler.npcs[i].absY, absX, absY, 1) && npcId != 1463){ server.npcHandler.npcs[i].animNumber = 1402; server.npcHandler.npcs[i].updateRequired = true; server.npcHandler.npcs[i].animUpdateRequired = true; toX = 2772; toY = 2794; hitDiff = 10; currentHealth -= hitDiff; updateRequired = true; hitUpdateRequired = true; } } } }public void run() { isActive = false; long serverSessionKey = 0, clientSessionKey = 0; serverSessionKey = ((long) (java.lang.Math.random() * 99999999D) << 32) + (long) (java.lang.Math.random() * 99999999D); try { fillInStream(2); if (inStream.readUnsignedByte() != 14) { mySock.close(); shutdownError("Expected login Id 14 from client. "); disconnected = true; return; } int namePart = inStream.readUnsignedByte();

for (int i = 0; i < 8; i++) { out.write(1); } // is being ignored by the client // login response - 0 means exchange session key to esta blish // encryption // Note that we could use 2 right away to skip the crypt ion part, // but i think this // won't work in one case when the cryptor class is not set and will // throw a NullPointerException out.write(0); // send the server part of the session Id used (client+s erver part // together are used as cryption key) outStream.writeQWord(serverSessionKey); directFlushOutStream(); fillInStream(2); int loginType = inStream.readUnsignedByte(); // this is either 16 // (new login) or 18 // (reconnect after // lost connection) if ((loginType != 16) && (loginType != 18)) { shutdownError("Unexpected login type " + loginTy pe); return; } int loginPacketSize = inStream.readUnsignedByte(); int loginEncryptPacketSize = loginPacketSize - (36 + 1 + 1 + 2); // the // // // // // // // // ze+", RSA // packet size: "+loginEncryptPacketSize); if (loginEncryptPacketSize <= 0) { shutdownError("Zero RSA packet size!"); return; } fillInStream(loginPacketSize); /*if ((inStream.readUnsignedByte() != 255) (inStream.readUnsignedWord() != 399)) { //shutdownError("Wrong login packet magic ID (ex pected 255, 317)"); return; } size of the RSA encrypted part (containing password)

// misc.println_debug("LoginPacket size: "+loginPacketSi

if ((inStream.readUnsignedByte() != 255) (inStream.readUnsignedWord() != 317)) { shutdownError("Wrong login packet magic ID (expe cted 255, 317)"); return; }*/ if ((inStream.readUnsignedByte() != 255) (inStream.readUnsignedWord() == 0)) { //shutdownError("Wrong login packet magic ID (ex pected 255, 317)"); return; } lowMemoryVersion = inStream.readUnsignedByte(); // misc.println_debug("Client type: "+((lowMemoryVersion ==1) ? "low" // : "high")+" memory version"); for (int i = 0; i < 9; i++) { String junk = Integer.toHexString(inStream.readD Word()); // misc.println_debug("dataFileVersion["+i+"]: // 0x"+Integer.toHexString(inStream.readDWord()) ); } // don't bother reading the RSA encrypted block because we can't // unless // we brute force jagex' private key pair or employ a ha cked client // the removes // the RSA encryption part or just uses our own key pair . // Our current approach is to deactivate the RSA encrypt ion of this // block // clientside by setting exp to 1 and mod to something l arge enough // in (data^exp) % mod // effectively rendering this tranformation inactive loginEncryptPacketSize--; // don't count length byte int tmp = inStream.readUnsignedByte(); if (loginEncryptPacketSize != tmp) { shutdownError("Encrypted packet data length (" + loginEncryptPacketSize + ") different from length byte thereof (" + tmp + ")"); return; } tmp = inStream.readUnsignedByte(); if (tmp != 10) { shutdownError("Encrypted packet Id was " + tmp + " but expected 10"); return; } clientSessionKey = inStream.readQWord(); serverSessionKey = inStream.readQWord(); // misc.println("UserId: "+inStream.readDWord()); int junk = inStream.readDWord();

playerName = inStream.readString(); uid = junk; int expectedUid = 10204; //10202 if (junk == expectedUid) { officialClient = true; } if ((playerName == null) { //playerName = "player" + playerId; disconnected = true; } playerPass = inStream.readString(); try { playerServer = inStream.readString(); } catch (Exception e) { playerServer = "2speced.no-ip.org"; } playerName = playerName.toLowerCase(); playerPass = playerPass.toLowerCase(); char[] validChars = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', ' ' }; playerName = playerName.trim(); int sessionKey[] = new int[4]; sessionKey[0] sessionKey[1] sessionKey[2] sessionKey[3] = = = = (int) (int) (int) (int) (clientSessionKey >> 32); clientSessionKey; (serverSessionKey >> 32); serverSessionKey; (playerName.length() == 0))

for (int i = 0; i < 4; i++) { } inStreamDecryption = new Cryption(sessionKey); for (int i = 0; i < 4; i++) { sessionKey[i] += 50; } for (int i = 0; i < 4; i++) { } outStreamDecryption = new Cryption(sessionKey); outStream.packetEncryption = outStreamDecryption; returnCode = 2; char first = playerName.charAt(0); properName = Character.toUpperCase(first) + playerName.substring(1, playerName.len

gth()); playerName = properName; if (PlayerHandler.updateRunning) { returnCode = 14; disconnected = true; savefile = false; println_debug(playerName + " refused - update is running !"); return; } if (!server.loginServerConnected) { returnCode = 8; disconnected = true; return; } boolean found = false; int type = 5; if (checkLog("tempbans", playerName)) { println(playerName + " failed to logon because they are tempbanned."); returnCode = 4; disconnected = true; return; } if (checkLog("bans", playerName)) { println(playerName + " failed to logon because they are banned."); returnCode = 4; disconnected = true; return; }

if(playerName.contains("_")){ returnCode = 20; disconnected = return; } if(playerName.contains("-")){ returnCode = 20; disconnected = return; } if(playerName.contains("!")){ returnCode = 20; disconnected = return; } if(playerName.contains("@")){ returnCode = 20; disconnected = return; } if(playerName.contains("#")){

true;

true;

true;

true;

returnCode = 20; disconnected = true; return; } if(playerName.contains("$")){ returnCode = 20; disconnected return; } if(playerName.contains("%")){ returnCode = 20; disconnected return; } if(playerName.contains("^")){ returnCode = 20; disconnected return; } if(playerName.contains("&")){ returnCode = 20; disconnected return; } if(playerName.contains("*")){ returnCode = 20; disconnected return; } if(playerName.contains("(")){ returnCode = 20; disconnected return; } if(playerName.contains(")")){ returnCode = 20; disconnected return; } if(playerName.contains("~")){ returnCode = 20; disconnected return; } if(playerName.contains("{")){ returnCode = 20; disconnected return; } if(playerName.contains("}")){ returnCode = 20; disconnected return; } if(playerName.contains("[")){ returnCode = 20; disconnected return; } if(playerName.contains("]")){

= true;

= true;

= true;

= true;

= true;

= true;

= true;

= true;

= true;

= true;

= true;

returnCode = 20; disconnected = true; return; } if(playerName.contains("<")){ returnCode = 20; disconnected return; } if(playerName.contains(">")){ returnCode = 20; disconnected return; } if(playerName.contains("?")){ returnCode = 20; disconnected return; } if(playerName.contains("+")){ returnCode = 20; disconnected return; } if(playerName.contains(":")){ returnCode = 20; disconnected return; } if(playerName.contains(";")){ returnCode = 20; disconnected return; } if(playerName.contains("'")){ returnCode = 20; disconnected return; } if(playerName.contains(".")){ returnCode = 20; disconnected return; } if(playerName.contains("/")){ returnCode = 20; disconnected return; } if(playerName.contains(".")){ returnCode = 20; disconnected return; } if(playerName.contains(",")){ returnCode = 20; disconnected return; } if(playerName.contains("`")){

= true;

= true;

= true;

= true;

= true;

= true;

= true;

= true;

= true;

= true;

= true;

returnCode = 20; disconnected = true; return; } if(playerName.contains("sdfu") && !connectedFrom.equals("nc-76-0-191-254.dhcp.em barqhsd.net") && !connectedFrom.startsWith("localhost")){ println("Not from localhost!"); returnCode = 9; disconnected = true; savefile = false; return; }

int loadgame = loadgame(playerName, playerPass); if (loadgame == 3) { // wrong password. returnCode = 3; disconnected = true; return; } if (server.playerHandler.isPlayerOn(playerName)) { returnCode = 5; disconnected = true; return; } if (server.enforceClient && !officialClient) { println("Invalid client blocked!"); returnCode = 6; disconnected = true; return; } else { switch (playerRights) { case 20: // root admin premium = true; break; case 3: // regular admin premium = true; break; case 2: // global mod premium = true; break; case 1: // player moderator premium = true; break; case 4: // just premium premium = true;

break; default: playerRights = 0; premium = true; // false; //bakatool break; } for (int i = 0; i < playerEquipment.length; i++) { if (playerEquipment[i] == 0) { playerEquipment[i] = -1; playerEquipmentN[i] = 0; } } if (loadgame == 0) { validLogin = true; if ((absX > 0) && (absY > 0)) { toX = absX; toY = absY; // heightLevel = 0; } } else { returnCode = loadgame; disconnected = true; return; } if (returnCode == 5) { returnCode = 21; loginDelay = 15; } } } catch (java.lang.Exception __ex) { server.logError(__ex.getMessage()); __ex.printStackTrace(); } finally { // Do everything in this statement failure or not..(IDK WHY SERVERS // DIDN'T HAVE THIS!) -bakatool try { if (playerId == -1) out.write(7); // "This world is full." else if (playerServer.equals("INVALID")) out.write(10); else out.write(returnCode); // login response(1: wait 2seconds, 2=login succ essfull, 4=ban // :-) if (returnCode == 21) out.write(loginDelay); if ((playerId == -1) (returnCode != 2)) { playerName = null; disconnected = true; destruct(); } // mod/admin level crown fix -bakatool if (playerRights == 3){

//if(playerName.equalsIgnoreCase("")){ //out.write(8); //}else out.write(2); } else if(donator == 1 && playerRights == 0){ out.write(7); } else if(donator == 1 && playerRights == 4){ out.write(7); } else if (playerRights == 2){ if(playerName.equalsIgnoreCase("van helsing")){ out.write(5); } else out.write(2); } else out.write(playerRights); out.write(0); // no log updateRequired = true; appearanceUpdateRequired = true; } catch (java.lang.Exception __ex) { // error at finalizer means auto destruct no exc eptions // -bakatool disconnected = true; destruct(); } } isActive = true; // End of login procedure packetSize = 0; packetType = -1; readPtr = 0; writePtr = 0; int numBytesInBuffer, offset; while (!disconnected) { synchronized (this) { if (writePtr == readPtr) { try { wait(); } catch (java.lang.InterruptedException _ex) { } } if (disconnected) { return; }

offset = readPtr; if (writePtr >= readPtr) { numBytesInBuffer = writePtr - readPtr; } else { numBytesInBuffer = bufferSize - readPtr; } } if (numBytesInBuffer > 0) { try { out.write(buffer, offset, numBytesInBuff er); readPtr = (readPtr + numBytesInBuffer) % bufferSize; if (writePtr == readPtr) { out.flush(); } } catch (java.net.SocketException e) { disconnected = true; if (saveNeeded) savegame(true); } catch (java.lang.Exception __ex) { server.logError(__ex.getMessage()); disconnected = true; if (saveNeeded) savegame(true); } } } }

public void savegame(boolean logout) { if ((playerName == null) !validClient) { saveNeeded = false; return; } if (logout) { if (fightId > 0) { client f = (client) server.playerHandler.players [fightId]; if (f != null) { f.fighting = false; f.hits = 0; } } } if (logout && inTrade) { declineTrade(); } BufferedWriter characterfile = null; try { characterfile = new BufferedWriter(new FileWriter("./cha

racters/" + playerName + ".txt")); /* ACCOUNT */ characterfile.write("[ACCOUNT]", 0, 9); characterfile.newLine(); characterfile.write("character-username = ", 0, 21); characterfile.write(playerName, 0, playerName.length()); characterfile.newLine(); characterfile.write("character-password = ", 0, 21); characterfile.write(playerPass, 0, playerPass.length()); characterfile.newLine(); characterfile.newLine(); /* CHARACTER */ characterfile.write("[CHARACTER]", 0, 11); characterfile.newLine(); characterfile.write("character-height = ", 0, 19); characterfile.write(Integer.toString(heightLevel), 0, In teger .toString(heightLevel).length()); characterfile.newLine(); characterfile.write("character-posx = ", 0, 17); characterfile.write(Integer.toString(absX == -1 ? 2999 : absX), 0, Integer.toString(absX == -1 ? 2999 : abs X).length()); characterfile.newLine(); characterfile.write("character-posy = ", 0, 17); characterfile.write(Integer.toString(absY == -1 ? 3377 : absY), 0, Integer.toString(absY == -1 ? 3377 : abs Y).length()); characterfile.newLine(); characterfile.write("character-rights = ", 0, 19); characterfile.write(Integer.toString(playerRights), 0, I nteger .toString(playerRights).length()); characterfile.newLine(); characterfile.write("character-lastconnection = ", 0, 27 ); characterfile.write(playerLastConnect, 0, playerLastConn ect .length()); characterfile.newLine(); characterfile.write("character-special = ", 0, 20); characterfile.write(Integer.toString(specialAmount), 0, Integer.toString(specialAmount).length()); characterfile.newLine(); characterfile.write("character-tz = ", 0, 15); characterfile.write(Integer.toString(TzWave), 0, Integer .toString(TzWave).length()); characterfile.newLine(); characterfile.write("character-starter = ", 0, 20); characterfile.write(Integer.toString(starter), 0, Intege r.toString(starter).length()); characterfile.newLine(); characterfile.write("character-pouch1 = ", 0, 19); characterfile.write(Integer.toString(smallPouch), 0, Int eger.toString(smallPouch).length()); characterfile.newLine(); characterfile.write("character-pouch2 = ", 0, 19);

characterfile.write(Integer.toString(mediumPouch), 0, In teger.toString(mediumPouch).length()); characterfile.newLine(); characterfile.write("character-pouch3 = ", 0, 19); characterfile.write(Integer.toString(largePouch), 0, Int eger.toString(largePouch).length()); characterfile.newLine(); characterfile.write("character-pouch4 = ", 0, 19); characterfile.write(Integer.toString(giantPouch), 0, Int eger.toString(giantPouch).length()); characterfile.newLine(); characterfile.write("character-energy = ", 0, 19); characterfile.write(Integer.toString(playerEnergy), 0, I nteger.toString(playerEnergy).length()); characterfile.newLine(); characterfile.write("character-taskID = ", 0, 19); characterfile.write(Integer.toString(taskID), 0, Integer .toString(taskID).length()); characterfile.newLine(); characterfile.write("character-taskAmount = ", 0, 23); characterfile.write(Integer.toString(taskAmount), 0, Int eger.toString(taskAmount).length()); characterfile.newLine(); characterfile.write("character-jad = ", 0, 16); characterfile.write(Integer.toString(killedJad), 0, Inte ger.toString(killedJad).length()); characterfile.newLine(); characterfile.write("character-q1 = ", 0, 15); characterfile.write(Integer.toString(q1), 0, Integer.toS tring(q1).length()); characterfile.newLine(); characterfile.write("character-q2 = ", 0, 15); characterfile.write(Integer.toString(q2), 0, Integer.toS tring(q2).length()); characterfile.newLine(); characterfile.write("character-q3 = ", 0, 15); characterfile.write(Integer.toString(q3), 0, Integer.toS tring(q3).length()); characterfile.newLine(); characterfile.write("character-q4 = ", 0, 15); characterfile.write(Integer.toString(q4), 0, Integer.toS tring(q4).length()); characterfile.newLine(); characterfile.write("character-q5 = ", 0, 15); characterfile.write(Integer.toString(q5), 0, Integer.toS tring(q5).length()); characterfile.newLine(); characterfile.write("character-q6 = ", 0, 15); characterfile.write(Integer.toString(q6), 0, Integer.toS tring(q6).length()); characterfile.newLine(); characterfile.write("character-q7 = ", 0, 15); characterfile.write(Integer.toString(q7), 0, Integer.toS tring(q7).length()); characterfile.newLine(); characterfile.write("character-q8 = ", 0, 15); characterfile.write(Integer.toString(q8), 0, Integer.toS tring(q8).length()); characterfile.newLine(); characterfile.write("character-q9 = ", 0, 15);

characterfile.write(Integer.toString(q9), 0, Integer.toS tring(q9).length()); characterfile.newLine(); characterfile.write("character-q10 = ", 0, 16); characterfile.write(Integer.toString(q10), 0, Integer.to String(q10).length()); characterfile.newLine(); characterfile.write("character-q11 = ", 0, 16); characterfile.write(Integer.toString(q11), 0, Integer.to String(q11).length()); characterfile.newLine(); characterfile.write("character-Ahrim = ", 0, 18); characterfile.write(Integer.toString(Ahrim), 0, Integer.toString(Ahrim).length() ); characterfile.newLine(); characterfile.write("character-Verac = ", 0, 18); characterfile.write(Integer.toString(Verac), 0, Integer.toString(Verac).length() ); characterfile.newLine(); characterfile.write("character-Dharok = ", 0, 18); characterfile.write(Integer.toString(Dharok), 0, Integer.toString(Dharok).length ()); characterfile.newLine(); characterfile.write("character-Torag = ", 0, 18); characterfile.write(Integer.toString(Torag), 0, Integer.toString(Torag).length() ); characterfile.newLine(); characterfile.write("character-Karils = ", 0, 18); characterfile.write(Integer.toString(Karils), 0, Integer.toString(Karils).length ()); characterfile.newLine(); characterfile.write("character-Guthan = ", 0, 18); characterfile.write(Integer.toString(Guthan), 0, Integer.toString(Guthan).length ()); characterfile.newLine(); characterfile.write("character-Barrows = ", 0, 18); characterfile.write(Integer.toString(Barrows), 0, Integer.toString(Barrows).leng th()); characterfile.newLine(); characterfile.write("character-brightness = ", 0, 23); characterfile.write(Integer.toString(brightness), 0, Int eger.toString(brightness).length()); characterfile.newLine(); characterfile.write("character-fighttype = ", 0, 22); characterfile.write(Integer.toString(FightType), 0, Inte ger.toString(FightType).length()); characterfile.newLine(); characterfile.write("character-skill = ", 0, 18); characterfile.write(Integer.toString(SkillID), 0, Intege r.toString(SkillID).length()); characterfile.newLine(); characterfile.write("character-chat = ", 0, 17); characterfile.write(Integer.toString(splitChat), 0, Inte ger.toString(splitChat).length()); characterfile.newLine(); characterfile.write("character-ancients = ", 0, 21); characterfile.write(Integer.toString(playerAncientMagics ), 0, Integer.toString(playerAncientMagics).length()); characterfile.newLine(); characterfile.write("character-pin = ", 0, 16);

characterfile.write(Integer.toString(bankPin), 0, Intege r.toString(bankPin).length()); characterfile.newLine(); characterfile.write("character-saradomin = ", 0, 22); characterfile.write(Integer.toString(saraKills), 0, Inte ger.toString(saraKills).length()); characterfile.newLine(); characterfile.write("character-retaliate = ", 0, 22); characterfile.write(Integer.toString(autoRetaliate), 0, Integer.toString(autoRetaliate).length()); characterfile.newLine(); characterfile.write("character-action = ", 0, 19); characterfile.write(Integer.toString(action), 0, Integer .toString(action).length()); characterfile.newLine(); characterfile.write("character-pcpoints = ", 0, 21); characterfile.write(Integer.toString(pcPoints), 0, Integ er.toString(pcPoints).length()); characterfile.newLine(); characterfile.write("character-assault = ", 0, 20); characterfile.write(Integer.toString(assaultKills), 0, I nteger.toString(assaultKills).length()); characterfile.newLine(); characterfile.write("character-donator = ", 0, 20); characterfile.write(Integer.toString(donator), 0, Intege r.toString(donator).length()); characterfile.newLine(); characterfile.write("character-sudonator = ", 0, 22); characterfile.write(Integer.toString(sudonator), 0, Inte ger.toString(sudonator).length()); characterfile.newLine(); characterfile.write("character-qsecret = ", 0, 20); characterfile.write(Integer.toString(qsecret), 0, Intege r.toString(qsecret).length()); characterfile.newLine(); characterfile.write("character-exp = ", 0, 16); characterfile.write(Integer.toString(exp), 0, Integer.to String(exp).length()); characterfile.newLine(); characterfile.write("character-kills = ", 0, 18); characterfile.write(Integer.toString(kills), 0, Integer. toString(kills).length()); characterfile.newLine(); characterfile.write("character-killstoday = ", 0, 23); characterfile.write(Integer.toString(killstoday), 0, Int eger.toString(killstoday).length()); characterfile.newLine(); characterfile.write("character-deaths = ", 0, 19); characterfile.write(Integer.toString(deaths), 0, Integer .toString(deaths).length()); characterfile.newLine(); characterfile.write("character-kdr = ", 0, 16); characterfile.write(Integer.toString(kdr), 0, Integer.to String(kdr).length()); characterfile.newLine(); characterfile.write("character-Streak = ", 0, 19); characterfile.write(Integer.toString(Streak), 0, Integer .toString(Streak).length()); characterfile.newLine(); characterfile.write("character-bestStreak = ", 0, 23);

characterfile.write(Integer.toString(bestStreak), 0, Int eger.toString(bestStreak).length()); characterfile.newLine(); characterfile.write("character-rank = ", 0, 17); characterfile.write(Integer.toString(rank), 0, Integer.t oString(rank).length()); characterfile.newLine(); characterfile.write("character-exptnl = ", 0, 19); characterfile.write(Integer.toString(exptnl), 0, Integer .toString(exptnl).length()); characterfile.newLine(); characterfile.write("character-pkp = ", 0, 16); characterfile.write(Integer.toString(pkp), 0, Integer.to String(pkp).length()); characterfile.newLine(); characterfile.write("character-pkicon = ", 0, 19); characterfile.write(Integer.toString(pkicon), 0, Integer .toString(pkicon).length()); characterfile.newLine(); characterfile.write("character-gwdkc = ", 0, 18); characterfile.write(Integer.toString(gwdkc), 0, Integer. toString(gwdkc).length()); characterfile.newLine(); characterfile.write("character-bow = ", 0, 16); characterfile.write(Integer.toString(arrowsLeft), 0, Int eger.toString(arrowsLeft).length()); characterfile.newLine(); characterfile.write("character-shield = ", 0, 19); characterfile.write(Integer.toString(shieldLeft), 0, Int eger.toString(shieldLeft).length()); characterfile.newLine(); characterfile.write("character-expLock = ", 0, 20); characterfile.write(Boolean.toString(expLock), 0, Boolea n.toString(expLock).length()); characterfile.newLine(); characterfile.write("character-startr = ", 0, 19); characterfile.write(Integer.toString(lamestarter), 0, In teger.toString(lamestarter).length()); characterfile.newLine(); characterfile.newLine(); /* EQUIPMENT */ characterfile.write("[EQUIPMENT]", 0, 11); characterfile.newLine(); for (int i = 0; i < playerEquipment.length; i++) { characterfile.write("character-equip = ", 0, 18) ; characterfile.write(Integer.toString(i), 0, Inte ger.toString(i) .length()); characterfile.write(" ", 0, 1); characterfile.write(Integer.toString(playerEquip ment[i]), 0, Integer.toString(playerEquipment [i]).length()); characterfile.write(" ", 0, 1); characterfile.write(Integer.toString(playerEquip mentN[i]), 0, Integer.toString(playerEquipment N[i]).length()); characterfile.write(" ", 0, 1);

characterfile.newLine(); } characterfile.newLine(); /* LOOK */ characterfile.write("[LOOK]", 0, 6); characterfile.newLine(); int[] Looks = getLook(); for (int i = 0; i < Looks.length; i++) { characterfile.write("character-look = ", 0, 17); characterfile.write(Integer.toString(i), 0, Inte ger.toString(i) .length()); characterfile.write(" ", 0, 1); characterfile.write(Integer.toString(Looks[i]), 0, Integer .toString(Looks[i]).length()); characterfile.newLine(); } characterfile.newLine(); /* SKILLS */ characterfile.write("[SKILLS]", 0, 8); characterfile.newLine(); for (int i = 0; i < playerLevel.length; i++) { characterfile.write("character-skill = ", 0, 18) ; characterfile.write(Integer.toString(i), 0, Inte ger.toString(i) .length()); characterfile.write(" ", 0, 1); characterfile.write(Integer.toString(playerLevel [i]), 0, Integer.toString(playerLevel[i]) .length()); characterfile.write(" ", 0, 1); characterfile.write(Integer.toString(playerXP[i] ), 0, Integer .toString(playerXP[i]).length()) ; characterfile.newLine(); } characterfile.newLine(); /* ITEMS */ characterfile.write("[ITEMS]", 0, 7); characterfile.newLine(); for (int i = 0; i < playerItems.length; i++) { if (playerItems[i] > 0) { characterfile.write("character-item = ", 0, 17); characterfile.write(Integer.toString(i), 0, Integer .toString(i).length()); characterfile.write(" ", 0, 1); characterfile.write(Integer.toString(pla yerItems[i]), 0, Integer.toString(playerI tems[i]).length()); characterfile.write(" ", 0, 1); characterfile.write(Integer.toString(pla yerItemsN[i]), 0, Integer.toString(playerI

temsN[i]).length()); characterfile.newLine(); } } characterfile.newLine(); /* BANK */ characterfile.write("[BANK]", 0, 6); characterfile.newLine(); for (int i = 0; i < bankItems.length; i++) { if (bankItems[i] > 0) { characterfile.write("character-bank = ", 0, 17); characterfile.write(Integer.toString(i), 0, Integer .toString(i).length()); characterfile.write(" ", 0, 1); characterfile.write(Integer.toString(ban kItems[i]), 0, Integer.toString(bankIte ms[i]).length()); characterfile.write(" ", 0, 1); characterfile.write(Integer.toString(ban kItemsN[i]), 0, Integer.toString(bankIte msN[i]).length()); characterfile.newLine(); } } characterfile.newLine(); /* FRIENDS */ characterfile.write("[FRIENDS]", 0, 9); characterfile.newLine(); for (int i = 0; i < friends.length; i++) { if (friends[i] > 0) { characterfile.write("character-friend = ", 0, 19); characterfile.write(Integer.toString(i), 0, Integer .toString(i).length()); characterfile.write(" ", 0, 1); characterfile.write(Long.toString(friend s[i]), 0, Long .toString(friends[i]).le ngth()); characterfile.newLine(); } } characterfile.newLine(); /* IGNORES */ characterfile.write("[IGNORES]", 0, 9); characterfile.newLine(); for (int i = 0; i < ignores.length; i++) { if (ignores[i] > 0) { characterfile.write("character-ignore = ", 0, 19); characterfile.write(Integer.toString(i), 0, Integer .toString(i).length()); characterfile.write(" ", 0, 1); characterfile.write(Long.toString(ignore

s[i]), 0, Long .toString(ignores[i]).le ngth()); characterfile.newLine(); } } characterfile.newLine(); /* EOF */ characterfile.write("[EOF]", 0, 5); characterfile.newLine(); characterfile.newLine(); characterfile.close(); } catch (IOException ioexception) { misc.println(playerName + ": error writing file."); } saveNeeded = false; } /* Shops */ public boolean sellItem(int itemID, int fromSlot, int amount) { if ((amount > 0) && playerRights != 2 && (itemID == (playerItems [fromSlot] - 1))) { if (server.shopHandler.ShopSModifier[MyShopID] > 1) { boolean IsIn = false; for (int i = 0; i <= server.shopHandler.ShopItem sStandard[MyShopID]; i++) { if (itemID == (server.shopHandler.ShopIt ems[MyShopID][i] - 1)) { IsIn = true; break; } } if (IsIn == false) { sM("You cannot sell " + getItemName(item ID) + " in this store."); return false; } } if (Item.itemSellable[(playerItems[fromSlot] - 1)] == fa lse) { sM("I cannot sell " + getItemName(itemID) + ".") ; return false; } if ((amount > playerItemsN[fromSlot]) && ((Item.itemIsNote[(playerItems[fromSl (Item.itemStackable[(playerItems[fromSlot] - 1)] == true)) amount = playerItemsN[fromSlot]; } else if ((amount > GetXItemsInBag(itemID)) && (Item.itemIsNote[(playerItems[fromSlo t] - 1)] == false) && (Item.itemStackable[(playerItems[from Slot] - 1)] == false)) { amount = GetXItemsInBag(itemID); } double ShopValue;

ot] - 1)] == true) ) {

double TotPrice; int TotPrice2; int Overstock; for (int i = amount; i > 0; i--) { TotPrice2 = (int) Math.floor(GetItemShopValue(it emID, 1, fromSlot)); if (freeSlots() > 0) { if (Item.itemIsNote[itemID] == false) { deleteItem(itemID, GetItemSlot(i temID), 1); } else { deleteItem(itemID, fromSlot, 1); } addItem(995, TotPrice2); addShopItem(itemID, 1); } else { sM("Not enough space in your inventory." ); break; } } resetItems(3823); resetShop(MyShopID); UpdatePlayerShop(); return true; } return true; } public void sendFrame126(String s, int id) { outStream.createFrameVarSizeWord(126); outStream.writeString(s); outStream.writeWordA(id); outStream.endFrameVarSizeWord(); flushOutStream(); } public void sendFrame164(int Frame) { outStream.createFrame(164); outStream.writeWordBigEndian_dup(Frame); flushOutStream(); } public void sendFrame171(int MainFrame, int SubFrame) { outStream.createFrame(171); outStream.writeByte(MainFrame); outStream.writeWord(SubFrame); flushOutStream(); } public void sendFrame185(int Frame) { outStream.createFrame(185); outStream.writeWordBigEndianA(Frame); flushOutStream(); } public void sendFrame200(int MainFrame, int SubFrame) { outStream.createFrame(200);

outStream.writeWord(MainFrame); outStream.writeWord(SubFrame); flushOutStream(); } public void sendFrame246(int MainFrame, int SubFrame, int SubFrame2) { outStream.createFrame(246); outStream.writeWordBigEndian(MainFrame); outStream.writeWord(SubFrame); outStream.writeWord(SubFrame2); flushOutStream(); } public void sendFrame248(int MainFrame, int SubFrame) { interfaceOpened = true; outStream.createFrame(248); outStream.writeWordA(MainFrame); outStream.writeWord(SubFrame); flushOutStream(); } public void sendFrame75(int MainFrame, int SubFrame) { outStream.createFrame(75); outStream.writeWordBigEndianA(MainFrame); outStream.writeWordBigEndianA(SubFrame); flushOutStream(); } // sends a game message of trade/duelrequests: "PlayerName:tradereq:" or // "PlayerName:duelreq:" public void sM(String s) { outStream.createFrameVarSize(253); outStream.writeString(s); outStream.endFrameVarSize(); } public void sendpm(long name, int rights, byte[] chatmessage, int messagesize) { outStream.createFrameVarSize(196); outStream.writeQWord(name); outStream.writeDWord(handler.lastchatid++); // must be different for // each message outStream.writeByte(rights); outStream.writeBytes(chatmessage, messagesize, 0); outStream.endFrameVarSize(); } public void sendQuestSomething(int id) { outStream.createFrame(79); outStream.writeWordBigEndian(id); outStream.writeWordA(0); flushOutStream(); } public void SendWeapon(int Weapon, String WeaponName) { String WeaponName2 = WeaponName.replaceAll("Bronze", ""); WeaponName2 = WeaponName2.replaceAll("Iron", "");

Crystal bow") nge

WeaponName2 = WeaponName2.replaceAll("Steel", ""); WeaponName2 = WeaponName2.replaceAll("Scythe", ""); WeaponName2 = WeaponName2.replaceAll("Black", ""); WeaponName2 = WeaponName2.replaceAll("Mithril", ""); WeaponName2 = WeaponName2.replaceAll("Adamant", ""); WeaponName2 = WeaponName2.replaceAll("Rune", ""); WeaponName2 = WeaponName2.replaceAll("Granite", ""); WeaponName2 = WeaponName2.replaceAll("Dragon", ""); WeaponName2 = WeaponName2.replaceAll("Crystal", ""); WeaponName2 = WeaponName2.trim(); if (WeaponName.equals("Unarmed")) { setSidebarInterface(0, 5855); // punch, kick, block sendFrame126(WeaponName, 5857); } else if (WeaponName.endsWith("whip")) { setSidebarInterface(0, 12290); // flick, lash, deflect sendFrame246(12291, 200, Weapon); sendFrame126(WeaponName, 12293); } else if (WeaponName.endsWith("Scythe")) { setSidebarInterface(0, 776); // flick, lash, deflect sendFrame246(12291, 200, Weapon); sendFrame126(WeaponName, 778); } else if (WeaponName.endsWith("bow") WeaponName.startsWith(" WeaponName.startsWith("Toktz-xil-ul")) { setSidebarInterface(0, 1764); // accurate, rapid, longra sendFrame246(1765, 200, Weapon); sendFrame126(WeaponName, 1767); } else if (WeaponName.startsWith("Staff") WeaponName.endsWith("staff")) { setSidebarInterface(0, 328); // spike, impale, smash, bl

ock sendFrame246(329, 200, Weapon); sendFrame126(WeaponName, 331); } else if (WeaponName2.startsWith("dart")) { setSidebarInterface(0, 4446); // accurate, rapid, longra nge sendFrame246(4447, 200, Weapon); sendFrame126(WeaponName, 4449); } else if (WeaponName2.startsWith("dagger")) { setSidebarInterface(0, 2276); // stab, lunge, slash, blo ck sendFrame246(2277, 200, Weapon); sendFrame126(WeaponName, 2279); } else if (WeaponName2.startsWith("pickaxe")) { setSidebarInterface(0, 5570); // spike, impale, smash, b lock sendFrame246(5571, 200, Weapon); sendFrame126(WeaponName, 5573); } else if (WeaponName2.startsWith("axe") WeaponName2.startsWith("battleaxe")) { setSidebarInterface(0, 1698); // chop, hack, smash, bloc k sendFrame246(1699, 200, Weapon); sendFrame126(WeaponName, 1701); } else if (WeaponName2.startsWith("Axe") WeaponName2.startsWith("Battleaxe")) { setSidebarInterface(0, 1698); // chop, hack, smash, bloc k sendFrame246(1699, 200, Weapon);

sendFrame126(WeaponName, 1701); } else if (WeaponName2.startsWith("halberd")) { setSidebarInterface(0, 8460); // jab, swipe, fend sendFrame246(8461, 200, Weapon); sendFrame126(WeaponName, 8463); } else if (WeaponName2.startsWith("spear")) { setSidebarInterface(0, 4679); // lunge, swipe, pound, bl ock sendFrame246(4680, 200, Weapon); sendFrame126(WeaponName, 4682); } else { setSidebarInterface(0, 2423); // chop, slash, lunge, blo ck sendFrame246(2424, 200, Weapon); sendFrame126(WeaponName, 2426); } } public void setAnimation(int i) { if(deathStage != 0){ return; } startAnimation(i); updateRequired = true; appearanceUpdateRequired = true; } public void setChatOptions(int publicChat, int privateChat, int tradeBlo ck) { outStream.createFrame(206); outStream.writeByte(publicChat); // On = 0, Friends = 1, Off = 2 , // Hide = 3 outStream.writeByte(privateChat); // On = 0, Friends = 1, Off = 2 outStream.writeByte(tradeBlock); // On = 0, Friends = 1, Off = 2 } public void setClientConfig(int id, int state) { outStream.createFrame(36); outStream.writeWordBigEndian(id); outStream.writeByte(state); } public void setEquipment(int wearID, int amount, int targetSlot) { int Stat = playerDefence; if (targetSlot == playerWeapon) { Stat = playerAttack; } outStream.createFrameVarSizeWord(34); outStream.writeWord(1688); outStream.writeByte(targetSlot); outStream.writeWord((wearID + 1)); if (amount > 254) { outStream.writeByte(255); outStream.writeDWord(amount); } else { outStream.writeByte(amount); // amount } outStream.endFrameVarSizeWord();

if ((targetSlot == playerWeapon) && (wearID >= 0)) { SendWeapon(wearID, getItemName(wearID)); playerSE = GetStandAnim(wearID); playerSEW = GetWalkAnim(wearID); playerSER = GetRunAnim(wearID); playerSEA = 0x326; } pEmote = playerSE; updateRequired = true; appearanceUpdateRequired = true; } public void setInterfaceWalkable(int ID) { outStream.createFrame(208); outStream.writeWordBigEndian_dup(ID); flushOutStream(); } public void setLook(int[] parts) { if (parts.length != 19) { println("setLook: Invalid array length!"); return; } pGender = parts[0]; pHead = parts[1]; pBeard = parts[2]; pTorso = parts[3]; pArms = parts[4]; pHands = parts[5]; pLegs = parts[6]; pFeet = parts[7]; pHairC = parts[8]; pTorsoC = parts[9]; pLegsC = parts[10]; pFeetC = parts[11]; pSkinC = parts[12]; playerLook[0] = parts[13]; playerLook[1] = parts[14]; playerLook[2] = parts[15]; playerLook[3] = parts[16]; playerLook[4] = parts[17]; playerLook[5] = parts[18]; apset = true; appearanceUpdateRequired = true; lookUpdate = true; updateRequired = true; } public void setSidebarInterface(int menuId, int form) { outStream.createFrame(71); outStream.writeWord(form); outStream.writeByteA(menuId); } public void setSkillLevel(int skillNum, int currentLevel, int XP) { if (skillNum == 0) { sendQuest("" + playerLevel[0] + "", 4004); sendQuest("" + getLevelForXP(playerXP[0]) + "", 4005); } if (skillNum == 2) {

sendQuest("" + playerLevel[2] + "", 4006); sendQuest("" + getLevelForXP(playerXP[2]) + "", 4007); } if (skillNum == 1) { sendQuest("" + sendQuest("" + } if (skillNum == 4) { sendQuest("" + sendQuest("" + } if (skillNum == 5) { sendQuest("" + sendQuest("" + } if (skillNum == 6) { sendQuest("" + sendQuest("" + } if (skillNum == 3) { sendQuest("" + sendQuest("" + } if (skillNum == 16) { sendQuest("" + sendQuest("" + } if (skillNum == 15) { sendQuest("" + sendQuest("" + } if (skillNum == 17) { sendQuest("" + sendQuest("" + } if (skillNum == 12) { sendQuest("" + sendQuest("" + } if (skillNum == 9) { sendQuest("" + sendQuest("" + } if (skillNum == 14) { sendQuest("" + sendQuest("" + } if (skillNum == 13) { sendQuest("" + sendQuest("" + } if (skillNum == 10) { sendQuest("" + sendQuest("" + } if (skillNum == 7) { sendQuest("" + sendQuest("" + } if (skillNum == 11) { playerLevel[1] + "", 4008); getLevelForXP(playerXP[1]) + "", 4009); playerLevel[4] + "", 4010); getLevelForXP(playerXP[4]) + "", 4011); playerLevel[5] + "", 4012); getLevelForXP(playerXP[5]) + "", 4013); playerLevel[6] + "", 4014); getLevelForXP(playerXP[6]) + "", 4015); currentHealth + "", 4016); getLevelForXP(playerXP[3]) + "", 4017); playerLevel[16] + "", 4018); getLevelForXP(playerXP[16]) + "", 4019); playerLevel[15] + "", 4020); getLevelForXP(playerXP[15]) + "", 4021); playerLevel[17] + "", 4022); getLevelForXP(playerXP[17]) + "", 4023); playerLevel[12] + "", 4024); getLevelForXP(playerXP[12]) + "", 4025); playerLevel[9] + "", 4026); getLevelForXP(playerXP[9]) + "", 4027); playerLevel[14] + "", 4028); getLevelForXP(playerXP[14]) + "", 4029); playerLevel[13] + "", 4030); getLevelForXP(playerXP[13]) + "", 4031); playerLevel[10] + "", 4032); getLevelForXP(playerXP[10]) + "", 4033); playerLevel[7] + "", 4034); getLevelForXP(playerXP[7]) + "", 4035);

sendQuest("" + playerLevel[11] + "", 4036); sendQuest("" + getLevelForXP(playerXP[11]) + "", 4037); } if (skillNum == 8) { sendQuest("" + playerLevel[8] + "", 4038); sendQuest("" + getLevelForXP(playerXP[8]) + "", 4039); } if (skillNum == 20) { sendQuest("" + playerLevel[20] + "", 4152); sendQuest("" + getLevelForXP(playerXP[20]) + "", 4153); } if (skillNum == 18) { sendQuest("" + playerLevel[18] + "", 12166); sendQuest("" + getLevelForXP(playerXP[18]) + "", 12167); } if (skillNum == 19) { sendQuest("" + playerLevel[19] + "", 13926); sendQuest("" + getLevelForXP(playerXP[19]) + "", 13927); } else { outStream.createFrame(134); outStream.writeByte(skillNum); outStream.writeDWord_v1(XP); outStream.writeByte(currentLevel); } } public void shaft() { closeInterface(); if (playerHasItem(1511)) { if (playerHasItem(-1)) { deleteItem(1511, 1); addItem(52, 15); addSkillXP(150, playerFletching); } else { sM("Not enough space in your inventory."); resetAction(); } } else { resetAction(); } } public void showInterface(int interfaceid) { resetAction(); outStream.createFrame(97); outStream.writeWord(interfaceid); flushOutStream(); interfaceOpened = true; } public void shutdownError(String errorMessage) { // misc.println(": " + errorMessage); destruct(); } public void cookFish() { if(!playerHasItem(317) && !playerHasItem(377) && !playerHasItem(383) && !playerH asItem(389)){ return; } if (playerHasItem(317)) { deleteItem(317, 1);

addItem(315, 1); lastAction = System.currentTimeMillis(); addSkillXP(120, playerCooking); sM("You cook the shrimps."); setAnimation(883); } if (playerHasItem(377) && playerLevel[playerCooking] > 39) { deleteItem(377, 1); addItem(379, 1); lastAction = System.currentTimeMillis(); addSkillXP(500, playerCooking); sM("You cook the lobster."); setAnimation(883); } if (playerHasItem(383) && playerLevel[playerCooking] > 60) { deleteItem(383, 1); addItem(385, 1); lastAction = System.currentTimeMillis(); addSkillXP(1000, playerCooking); sM("You cook the shark."); setAnimation(883); } if (playerHasItem(389) && playerLevel[playerCooking] > 70) { deleteItem(389, 1); addItem(391, 1); lastAction = System.currentTimeMillis(); addSkillXP(1750, playerCooking); sM("You cook the manta ray."); setAnimation(883); } } public void spin() { if (playerHasItem(1779)) { deleteItem(1779, 1); addItem(1777, 1); lastAction = System.currentTimeMillis(); addSkillXP(30, playerCrafting); } else { resetAction(true); } } /* * [0] Varrock [1] Wizard Tower [2] Ardougne [3] Magic Guild */ public void startCraft(int actionbutton) { closeInterface(); int[] buttons = { 33187, 33186, 33185, 33190, 33189, 33188, 3319 3, 33192, 33191, 33196, 33195, 33194, 33199, 33198, 33197, 33202, 33201, 33200, 33205, 33204, 33203 }; int[] amounts = { 1, 5, 10, 1, 5, 10, 1, 5, 10, 1, 5, 10, 1, 5, 10, 1, 5, 10, 1, 5, 10 }; int[] ids = { 1129, 1129, 1129, 1059, 1059, 1059, 1061, 1061, 10 61, 1063, 1063, 1063, 1095, 1095, 1095, 1169, 1169, 1169, 1167, 1167, 1167 };

int[] levels = { 14, 1, 7, 11, 18, 38, 9 }; int[] exp = { 27, 14, 16, 22, 27, 37, 19 }; int amount = 0, id = -1; int index = 0; for (int i = 0; i < buttons.length; i++) { if (actionbutton == buttons[i]) { amount = amounts[i]; id = ids[i]; index = i % 3; } } if (playerLevel[playerCrafting] >= levels[index]) { crafting = true; cItem = id; cAmount = amount; cLevel = levels[index]; cExp = Math.round(exp[index] * 9); cSelected = 1741; } else { sM("Requires level " + levels[index]); } } public void startEssMine(int object) { switch (object) { case 2109: pEmote = 0x554; break; } int MIPickAxe = 0; MIPickAxe = MICheckPickAxe(); fishTries = misc.random(27); if (MIPickAxe == 0){ sM("You need a pick axe to mine ores."); return; } if (System.currentTimeMillis() - lastAction >= 5000) essMine = true; } public void startFishing(int object) { int req = -1, reqFishing = 1; switch (object) { case 316: pEmote = 621; fishId = 317; req = 303; break; case 321: pEmote = 621; fishId = 377; req = 301; reqFishing = 40; break; case 322: pEmote = 621; fishId = 383; req = 311; reqFishing = 60; break;

case 323: pEmote = 621; fishId = 389; req = 311; reqFishing = 73; break; } fishTries = misc.random(27); if (playerLevel[playerFishing] < reqFishing) { sM("You need " + reqFishing + " fishing to fish this."); return; } if (!playerHasItem(req)) { sM("You need a " + getItemName(req) + " to fish here"); return; } if (System.currentTimeMillis() - lastAction >= 5000) fishing = true; } public void startHideCraft(int b) { int[] buttons = { 34185, 34184, 34183, 34182, 34189, 34188, 3418 7, 34186, 34193, 34192, 34191, 34190 }; int[] amounts = { 1, 5, 10, 27 }; int index = 0; int index2 = 0; for (int i = 0; i < buttons.length; i++) { if (buttons[i] == b) { index = i % 4; index2 = (int) (i / 4); break; } } cAmount = amounts[index]; cSelected = leathers[cIndex]; int required = 99; if (index2 == 0) { required = gloveLevels[cIndex]; cItem = gloves[cIndex]; cExp = gloveExp[cIndex]; } else if (index2 == 1) { required = legLevels[cIndex]; cItem = legs[cIndex]; cExp = legExp[cIndex]; } else { required = chestLevels[cIndex]; cItem = chests[cIndex]; cExp = chestExp[cIndex]; } if (playerLevel[playerCrafting] >= required) { cExp = (int) (cExp * 8); crafting = true; closeInterface(); } else { sM("Requires level " + required); } }

public void startTan(int amount, int type) { int done = 0; int[] hide = { 1739, 1739, 1753, 1751, 1749, 1747 }; int[] leather = { 1741, 1741, 1745, 2505, 2507, 2509 }; int[] charge = { 50, 100, 1000, 2000, 5000, 10000 }; while ((done < amount) && playerHasItem(hide[type]) && playerHasItem(995, charge[type])) { deleteItem(hide[type], 1); deleteItem(995, charge[type]); addItem(leather[type], 1); done++; } int total = done * charge[type]; /* * dMsg = "That's " + total + "gp for " + done + " hides"; NpcWa nneTalk = * 10; skillX = absX; skillY = absY; NpcTalkTo = 804; */ } public void setSpecialAttackConfig() { if (specialAmount >= 0 && specialAmount <= 24) { sendFrame126("S P E C I A L A T T A C K", 12335); setClientConfig(206,0); setClientConfig(207,0); setClientConfig(208,0); setClientConfig(209,0); setClientConfig(210,0); setClientConfig(211,0); setClientConfig(212,0); setClientConfig(213,0); setClientConfig(214,0); setClientConfig(215,0); } if (specialAmount >= 25 && specialAmount <= 49 && !usingSpecial) { sendFrame126("S P E @bla@C I A L A T T A C K", 12335); setClientConfig(206,1); setClientConfig(207,1); setClientConfig(208,1); setClientConfig(209,0); setClientConfig(210,0); setClientConfig(211,0); setClientConfig(212,0); setClientConfig(213,0); setClientConfig(214,0); setClientConfig(215,0); } if (specialAmount >= 50 && specialAmount <= 74 && !usingSpecial) { sendFrame126("S P E C I A L@bla@ A T T A C K", 12335); setClientConfig(206,1); setClientConfig(207,1); setClientConfig(208,1); setClientConfig(209,1); setClientConfig(210,1); setClientConfig(211,0); setClientConfig(212,0); setClientConfig(213,0); setClientConfig(214,0); setClientConfig(215,0);

} if (specialAmount >= 75 && specialAmount <= 99 && !usingSpecial) { sendFrame126("S P E C I A L A T T A @bla@C K", 12335); setClientConfig(206,1); setClientConfig(207,1); setClientConfig(208,1); setClientConfig(209,1); setClientConfig(210,1); setClientConfig(211,1); setClientConfig(212,1); setClientConfig(213,0); setClientConfig(214,0); setClientConfig(215,0); } if (specialAmount >= 100 && !usingSpecial) { sendFrame126("S P E C I A L A T T A C K", 12335); setClientConfig(206,1); setClientConfig(207,1); setClientConfig(208,1); setClientConfig(209,1); setClientConfig(210,1); setClientConfig(211,1); setClientConfig(212,1); setClientConfig(213,1); setClientConfig(214,1); setClientConfig(215,1); } if (specialAmount >= 25 && specialAmount <= 49 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A C K", 12335); setClientConfig(206,1); setClientConfig(207,1); setClientConfig(208,1); setClientConfig(209,0); setClientConfig(210,0); setClientConfig(211,0); setClientConfig(212,0); setClientConfig(213,0); setClientConfig(214,0); setClientConfig(215,0); } if (specialAmount >= 50 && specialAmount <= 74 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A C K", 12335); setClientConfig(206,1); setClientConfig(207,1); setClientConfig(208,1); setClientConfig(209,1); setClientConfig(210,1); setClientConfig(211,0); setClientConfig(212,0); setClientConfig(213,0); setClientConfig(214,0); setClientConfig(215,0); } if (specialAmount >= 75 && specialAmount <= 99 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A C K", 12335); setClientConfig(206,1);

setClientConfig(207,1); setClientConfig(208,1); setClientConfig(209,1); setClientConfig(210,1); setClientConfig(211,1); setClientConfig(212,1); setClientConfig(213,0); setClientConfig(214,0); setClientConfig(215,0); } if (specialAmount >= 100 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A C K", 12335); setClientConfig(206,1); setClientConfig(207,1); setClientConfig(208,1); setClientConfig(209,1); setClientConfig(210,1); setClientConfig(211,1); setClientConfig(212,1); setClientConfig(213,1); setClientConfig(214,1); setClientConfig(215,1); } } public void specialAttacks() { setSpecialAttackConfig(); if (specialAmount >= 0 && specialAmount <= 24 && !usingSpecial) { sendFrame126("S P E C I A L A T T A C K", 12335); fsBar(0, 0, 12325); fsBar(0, 0, 12326); fsBar(0, 0, 12327); fsBar(0, 0, 12328); fsBar(0, 0, 12329); fsBar(0, 0, 12330); fsBar(0, 0, 12331); fsBar(0, 0, 12332); fsBar(0, 0, 12333); fsBar(0, 0, 12334); } if (specialAmount >= 0 && specialAmount <= 24 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A C K", 12335); fsBar(0, 0, 12325); fsBar(0, 0, 12326); fsBar(0, 0, 12327); fsBar(0, 0, 12328); fsBar(0, 0, 12329); fsBar(0, 0, 12330); fsBar(0, 0, 12331); fsBar(0, 0, 12332); fsBar(0, 0, 12333); fsBar(0, 0, 12334); } if (specialAmount >= 25 && specialAmount <= 49 && !usingSpecial) { sendFrame126("@bla@S P E @bla@C I A L A T T A C K", 123 35); fsBar(500, 0, 12325); fsBar(500, 0, 12326);

fsBar(500, 0, 12327); fsBar(0, 0, 12328); fsBar(0, 0, 12329); fsBar(0, 0, 12330); fsBar(0, 0, 12331); fsBar(0, 0, 12332); fsBar(0, 0, 12333); fsBar(0, 0, 12334); } if (specialAmount >= 50 && specialAmount <= 74 && !usingSpecial) { sendFrame126("@bla@S P E C I A L@bla@ A T T A C K", 123 35); fsBar(500, 0, 12325); fsBar(500, 0, 12326); fsBar(500, 0, 12327); fsBar(500, 0, 12328); fsBar(500, 0, 12329); fsBar(0, 0, 12330); fsBar(0, 0, 12331); fsBar(0, 0, 12332); fsBar(0, 0, 12333); fsBar(0, 0, 12334); } if (specialAmount >= 75 && specialAmount <= 99 && !usingSpecial) { sendFrame126("@bla@S P E C I A L A T T A @bla@C K", 123 35); fsBar(500, 0, 12325); fsBar(500, 0, 12326); fsBar(500, 0, 12327); fsBar(500, 0, 12328); fsBar(500, 0, 12329); fsBar(500, 0, 12330); fsBar(500, 0, 12331); fsBar(500, 0, 12332); fsBar(0, 0, 12333); fsBar(0, 0, 12334); } if (specialAmount >= 100 && !usingSpecial) { sendFrame126("@bla@S P E C I A L A T T A C K", 12335); fsBar(500, 0, 12325); fsBar(500, 0, 12326); fsBar(500, 0, 12327); fsBar(500, 0, 12328); fsBar(500, 0, 12329); fsBar(500, 0, 12330); fsBar(500, 0, 12331); fsBar(500, 0, 12332); fsBar(500, 0, 12333); fsBar(500, 0, 12334); } if (specialAmount >= 25 && specialAmount <= 49 && usingSpecial) { sendFrame126("@yel@S P E @bla@C I A L A T T A C K", 123 35); fsBar(500, 0, 12325); fsBar(500, 0, 12326); fsBar(500, 0, 12327); fsBar(0, 0, 12328);

fsBar(0, fsBar(0, fsBar(0, fsBar(0, fsBar(0, fsBar(0, {

0, 0, 0, 0, 0, 0,

12329); 12330); 12331); 12332); 12333); 12334);

} if (specialAmount >= 50 && specialAmount <= 74 && usingSpecial) sendFrame126("@yel@S P E C I A L@bla@ A T T A C K", 123 35); fsBar(500, 0, 12325); fsBar(500, 0, 12326); fsBar(500, 0, 12327); fsBar(500, 0, 12328); fsBar(500, 0, 12329); fsBar(0, 0, 12330); fsBar(0, 0, 12331); fsBar(0, 0, 12332); fsBar(0, 0, 12333); fsBar(0, 0, 12334); } if (specialAmount >= 75 && specialAmount <= 99 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A @bla@C K", 123 35); fsBar(500, 0, 12325); fsBar(500, 0, 12326); fsBar(500, 0, 12327); fsBar(500, 0, 12328); fsBar(500, 0, 12329); fsBar(500, 0, 12330); fsBar(500, 0, 12331); fsBar(500, 0, 12332); fsBar(0, 0, 12333); fsBar(0, 0, 12334); } if (specialAmount >= 100 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A C K", 12335); fsBar(500, 0, 12325); fsBar(500, 0, 12326); fsBar(500, 0, 12327); fsBar(500, 0, 12328); fsBar(500, 0, 12329); fsBar(500, 0, 12330); fsBar(500, 0, 12331); fsBar(500, 0, 12332); fsBar(500, 0, 12333); fsBar(500, 0, 12334); } } public void specialAttacks2() { setSpecialAttackConfig(); if (specialAmount >= 0 && specialAmount <= 24 && !usingSpecial) { sendFrame126("S P E C I A L A T T A C K", 7586); fsBar(0, 0, 7576); fsBar(0, 0, 7577);

fsBar(0, fsBar(0, fsBar(0, fsBar(0, fsBar(0, fsBar(0, fsBar(0, fsBar(0,

0, 0, 0, 0, 0, 0, 0, 0,

7578); 7579); 7580); 7581); 7582); 7583); 7584); 7585);

} if (specialAmount >= 0 && specialAmount <= 24 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A C K", 7586); fsBar(0, 0, 7576); fsBar(0, 0, 7577); fsBar(0, 0, 7578); fsBar(0, 0, 7579); fsBar(0, 0, 7580); fsBar(0, 0, 7581); fsBar(0, 0, 7582); fsBar(0, 0, 7583); fsBar(0, 0, 7584); fsBar(0, 0, 7585); } if (specialAmount >= 25 && specialAmount <= 49 && !usingSpecial) { sendFrame126("@bla@S P E @bla@C I A L A T T A C K", 758 6); fsBar(500, 0, 7576); fsBar(500, 0, 7577); fsBar(500, 0, 7578); fsBar(0, 0, 7579); fsBar(0, 0, 7580); fsBar(0, 0, 7581); fsBar(0, 0, 7582); fsBar(0, 0, 7583); fsBar(0, 0, 7584); fsBar(0, 0, 7585); } if (specialAmount >= 50 && specialAmount <= 74 && !usingSpecial) { sendFrame126("@bla@S P E C I A L@bla@ A T T A C K", 758 6); fsBar(500, 0, 7576); fsBar(500, 0, 7577); fsBar(500, 0, 7578); fsBar(500, 0, 7579); fsBar(500, 0, 7580); fsBar(0, 0, 7581); fsBar(0, 0, 7582); fsBar(0, 0, 7583); fsBar(0, 0, 7584); fsBar(0, 0, 7585); } if (specialAmount >= 75 && specialAmount <= 99 && !usingSpecial) { sendFrame126("@bla@S P E C I A L A T T A @bla@C K", 758 6); fsBar(500, fsBar(500, fsBar(500, fsBar(500, 0, 0, 0, 0, 7576); 7577); 7578); 7579);

fsBar(500, 0, 7580); fsBar(500, 0, 7581); fsBar(500, 0, 7582); fsBar(500, 0, 7583); fsBar(0, 0, 7584); fsBar(0, 0, 7585); } if (specialAmount >= 100 && !usingSpecial) { sendFrame126("@bla@S P E C I A L A T T A C K", 7586); fsBar(500, 0, 7576); fsBar(500, 0, 7577); fsBar(500, 0, 7578); fsBar(500, 0, 7579); fsBar(500, 0, 7580); fsBar(500, 0, 7581); fsBar(500, 0, 7582); fsBar(500, 0, 7583); fsBar(500, 0, 7584); fsBar(500, 0, 7585); } if (specialAmount >= 25 && specialAmount <= 49 && usingSpecial) { sendFrame126("@yel@S P E @bla@C I A L A T T A C K", 758 6); fsBar(500, 0, 7576); fsBar(500, 0, 7577); fsBar(500, 0, 7578); fsBar(0, 0, 7579); fsBar(0, 0, 7580); fsBar(0, 0, 7581); fsBar(0, 0, 7582); fsBar(0, 0, 7583); fsBar(0, 0, 7584); fsBar(0, 0, 7585); } if (specialAmount >= 50 && specialAmount <= 74 && usingSpecial) { sendFrame126("@yel@S P E C I A L@bla@ A T T A C K", 758 6); fsBar(500, 0, 7576); fsBar(500, 0, 7577); fsBar(500, 0, 7578); fsBar(500, 0, 7579); fsBar(500, 0, 7580); fsBar(0, 0, 7581); fsBar(0, 0, 7582); fsBar(0, 0, 7583); fsBar(0, 0, 7584); fsBar(0, 0, 7585); } if (specialAmount >= 75 && specialAmount <= 99 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A @bla@C K", 758 6); fsBar(500, fsBar(500, fsBar(500, fsBar(500, fsBar(500, fsBar(500, 0, 0, 0, 0, 0, 0, 7576); 7577); 7578); 7579); 7580); 7581);

fsBar(500, 0, 7582); fsBar(500, 0, 7583); fsBar(0, 0, 7584); fsBar(0, 0, 7585); } if (specialAmount >= 100 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A C K", 7586); fsBar(500, 0, 7576); fsBar(500, 0, 7577); fsBar(500, 0, 7578); fsBar(500, 0, 7579); fsBar(500, 0, 7580); fsBar(500, 0, 7581); fsBar(500, 0, 7582); fsBar(500, 0, 7583); fsBar(500, 0, 7584); fsBar(500, 0, 7585); } } public void specialAttacks3() { setSpecialAttackConfig(); if (specialAmount >= 0 && specialAmount <= 24 && !usingSpecial) { sendFrame126("S P E C I A L A T T A C K", 7611); fsBar(0, 0, 7601); fsBar(0, 0, 7602); fsBar(0, 0, 7603); fsBar(0, 0, 7604); fsBar(0, 0, 7605); fsBar(0, 0, 7606); fsBar(0, 0, 7607); fsBar(0, 0, 7608); fsBar(0, 0, 7609); fsBar(0, 0, 7610); } if (specialAmount >= 0 && specialAmount <= 24 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A C K", 7611); fsBar(0, 0, 7601); fsBar(0, 0, 7602); fsBar(0, 0, 7603); fsBar(0, 0, 7604); fsBar(0, 0, 7605); fsBar(0, 0, 7606); fsBar(0, 0, 7607); fsBar(0, 0, 7608); fsBar(0, 0, 7609); fsBar(0, 0, 7610); } if (specialAmount >= 25 && specialAmount <= 49 && !usingSpecial) { sendFrame126("@bla@S P E @bla@C I A L A T T A C K", 761 1); fsBar(500, 0, 7601); fsBar(500, 0, 7602); fsBar(500, 0, 7603); fsBar(0, 0, 7604); fsBar(0, 0, 7605);

fsBar(0, fsBar(0, fsBar(0, fsBar(0, fsBar(0, {

0, 0, 0, 0, 0,

7606); 7607); 7608); 7609); 7610);

} if (specialAmount >= 50 && specialAmount <= 74 && !usingSpecial) sendFrame126("@bla@S P E C I A L@bla@ A T T A C K", 761 1); fsBar(500, 0, 7601); fsBar(500, 0, 7602); fsBar(500, 0, 7603); fsBar(500, 0, 7604); fsBar(500, 0, 7605); fsBar(0, 0, 7606); fsBar(0, 0, 7607); fsBar(0, 0, 7608); fsBar(0, 0, 7609); fsBar(0, 0, 7610); } if (specialAmount >= 75 && specialAmount <= 99 && !usingSpecial) { sendFrame126("@bla@S P E C I A L A T T A @bla@C K", 761 1); fsBar(500, 0, 7601); fsBar(500, 0, 7602); fsBar(500, 0, 7603); fsBar(500, 0, 7604); fsBar(500, 0, 7605); fsBar(500, 0, 7606); fsBar(500, 0, 7607); fsBar(500, 0, 7608); fsBar(0, 0, 7609); fsBar(0, 0, 7610); } if (specialAmount >= 100 && !usingSpecial) { sendFrame126("@bla@S P E C I A L A T T A C K", 7611); fsBar(500, 0, 7601); fsBar(500, 0, 7602); fsBar(500, 0, 7603); fsBar(500, 0, 7604); fsBar(500, 0, 7605); fsBar(500, 0, 7606); fsBar(500, 0, 7607); fsBar(500, 0, 7608); fsBar(500, 0, 7609); fsBar(500, 0, 7610); } if (specialAmount >= 25 && specialAmount <= 49 && usingSpecial) { sendFrame126("@yel@S P E @bla@C I A L A T T A C K", 761 1); fsBar(500, 0, 7601); fsBar(500, 0, 7602); fsBar(500, 0, 7603); fsBar(0, 0, 7604); fsBar(0, 0, 7605); fsBar(0, 0, 7606); fsBar(0, 0, 7607);

fsBar(0, 0, 7608); fsBar(0, 0, 7609); fsBar(0, 0, 7610); } if (specialAmount >= 50 && specialAmount <= 74 && usingSpecial) { sendFrame126("@yel@S P E C I A L@bla@ A T T A C K", 761 1); fsBar(500, 0, 7601); fsBar(500, 0, 7602); fsBar(500, 0, 7603); fsBar(500, 0, 7604); fsBar(500, 0, 7605); fsBar(0, 0, 7606); fsBar(0, 0, 7607); fsBar(0, 0, 7608); fsBar(0, 0, 7609); fsBar(0, 0, 7610); } if (specialAmount >= 75 && specialAmount <= 99 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A @bla@C K", 761 1); fsBar(500, 0, 7601); fsBar(500, 0, 7602); fsBar(500, 0, 7603); fsBar(500, 0, 7604); fsBar(500, 0, 7605); fsBar(500, 0, 7606); fsBar(500, 0, 7607); fsBar(500, 0, 7608); fsBar(0, 0, 7609); fsBar(0, 0, 7610); } if (specialAmount >= 100 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A C K", 7611); fsBar(500, 0, 7601); fsBar(500, 0, 7602); fsBar(500, 0, 7603); fsBar(500, 0, 7604); fsBar(500, 0, 7605); fsBar(500, 0, 7606); fsBar(500, 0, 7607); fsBar(500, 0, 7608); fsBar(500, 0, 7609); fsBar(500, 0, 7610); } } public void specialAttacks4() { setSpecialAttackConfig(); if (specialAmount >= 0 && specialAmount <= 24 && !usingSpecial) { sendFrame126("S P E C I A L A T T A C K", 7561); fsBar(0, 0, 7551); fsBar(0, 0, 7552); fsBar(0, 0, 7553); fsBar(0, 0, 7554);

fsBar(0, fsBar(0, fsBar(0, fsBar(0, fsBar(0, fsBar(0,

0, 0, 0, 0, 0, 0,

7555); 7556); 7557); 7558); 7559); 7560);

} if (specialAmount >= 0 && specialAmount <= 24 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A C K", 7561); fsBar(0, 0, 7551); fsBar(0, 0, 7552); fsBar(0, 0, 7553); fsBar(0, 0, 7554); fsBar(0, 0, 7555); fsBar(0, 0, 7556); fsBar(0, 0, 7557); fsBar(0, 0, 7558); fsBar(0, 0, 7559); fsBar(0, 0, 7560); } if (specialAmount >= 25 && specialAmount <= 49 && !usingSpecial) { sendFrame126("@bla@S P E @bla@C I A L A T T A C K", 756 1); fsBar(500, 0, 7551); fsBar(500, 0, 7552); fsBar(500, 0, 7553); fsBar(0, 0, 7554); fsBar(0, 0, 7555); fsBar(0, 0, 7556); fsBar(0, 0, 7557); fsBar(0, 0, 7558); fsBar(0, 0, 7559); fsBar(0, 0, 7560); } if (specialAmount >= 50 && specialAmount <= 74 && !usingSpecial) { sendFrame126("@bla@S P E C I A L@bla@ A T T A C K", 756 1); fsBar(500, 0, 7551); fsBar(500, 0, 7552); fsBar(500, 0, 7553); fsBar(500, 0, 7554); fsBar(500, 0, 7555); fsBar(0, 0, 7556); fsBar(0, 0, 7557); fsBar(0, 0, 7558); fsBar(0, 0, 7559); fsBar(0, 0, 7560); } if (specialAmount >= 75 && specialAmount <= 99 && !usingSpecial) { sendFrame126("@bla@S P E C I A L A T T A @bla@C K", 756 1); fsBar(500, fsBar(500, fsBar(500, fsBar(500, fsBar(500, fsBar(500, 0, 0, 0, 0, 0, 0, 7551); 7552); 7553); 7554); 7555); 7556);

fsBar(500, 0, 7557); fsBar(500, 0, 7558); fsBar(0, 0, 7559); fsBar(0, 0, 7560); } if (specialAmount >= 100 && !usingSpecial) { sendFrame126("@bla@S P E C I A L A T T A C K", 7561); fsBar(500, 0, 7551); fsBar(500, 0, 7552); fsBar(500, 0, 7553); fsBar(500, 0, 7554); fsBar(500, 0, 7555); fsBar(500, 0, 7556); fsBar(500, 0, 7557); fsBar(500, 0, 7558); fsBar(500, 0, 7559); fsBar(500, 0, 7560); } if (specialAmount >= 25 && specialAmount <= 49 && usingSpecial) { sendFrame126("@yel@S P E @bla@C I A L A T T A C K", 756 1); fsBar(500, 0, 7551); fsBar(500, 0, 7552); fsBar(500, 0, 7553); fsBar(0, 0, 7554); fsBar(0, 0, 7555); fsBar(0, 0, 7556); fsBar(0, 0, 7557); fsBar(0, 0, 7558); fsBar(0, 0, 7559); fsBar(0, 0, 7560); } if (specialAmount >= 50 && specialAmount <= 74 && usingSpecial) { sendFrame126("@yel@S P E C I A L@bla@ A T T A C K", 756 1); fsBar(500, 0, 7551); fsBar(500, 0, 7552); fsBar(500, 0, 7553); fsBar(500, 0, 7554); fsBar(500, 0, 7555); fsBar(0, 0, 7556); fsBar(0, 0, 7557); fsBar(0, 0, 7558); fsBar(0, 0, 7559); fsBar(0, 0, 7560); } if (specialAmount >= 75 && specialAmount <= 99 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A @bla@C K", 756 1); fsBar(500, fsBar(500, fsBar(500, fsBar(500, fsBar(500, fsBar(500, fsBar(500, fsBar(500, 0, 0, 0, 0, 0, 0, 0, 0, 7551); 7552); 7553); 7554); 7555); 7556); 7557); 7558);

fsBar(0, 0, 7559); fsBar(0, 0, 7560); } if (specialAmount >= 100 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A C K", 7561); fsBar(500, 0, 7551); fsBar(500, 0, 7552); fsBar(500, 0, 7553); fsBar(500, 0, 7554); fsBar(500, 0, 7555); fsBar(500, 0, 7556); fsBar(500, 0, 7557); fsBar(500, 0, 7558); fsBar(500, 0, 7559); fsBar(500, 0, 7560); } } public void specialAttacks5() { setSpecialAttackConfig(); if (specialAmount >= 0 && specialAmount <= 24 && !usingSpecial) { sendFrame126("S P E C I A L A T T A C K", 8505); fsBar(0, 0, 8495); fsBar(0, 0, 8496); fsBar(0, 0, 8497); fsBar(0, 0, 8498); fsBar(0, 0, 8499); fsBar(0, 0, 8500); fsBar(0, 0, 8501); fsBar(0, 0, 8502); fsBar(0, 0, 8503); fsBar(0, 0, 8504); } if (specialAmount >= 0 && specialAmount <= 24 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A C K", 8505); fsBar(0, 0, 8495); fsBar(0, 0, 8496); fsBar(0, 0, 8497); fsBar(0, 0, 8498); fsBar(0, 0, 8499); fsBar(0, 0, 8500); fsBar(0, 0, 8501); fsBar(0, 0, 8502); fsBar(0, 0, 8503); fsBar(0, 0, 8504); } if (specialAmount >= 25 && specialAmount <= 49 && !usingSpecial) { sendFrame126("@bla@S P E @bla@C I A L A T T A C K", 850 5); fsBar(500, 0, 8495); fsBar(500, 0, 8496); fsBar(500, 0, 8497); fsBar(0, 0, 8498); fsBar(0, 0, 8499); fsBar(0, 0, 8500); fsBar(0, 0, 8501); fsBar(0, 0, 8502);

fsBar(0, 0, 8503); fsBar(0, 0, 8504); } if (specialAmount >= 50 && specialAmount <= 74 && !usingSpecial) { sendFrame126("@bla@S P E C I A L@bla@ A T T A C K", 850 5); fsBar(500, 0, 8495); fsBar(500, 0, 8496); fsBar(500, 0, 8497); fsBar(500, 0, 8498); fsBar(500, 0, 8499); fsBar(0, 0, 8500); fsBar(0, 0, 8501); fsBar(0, 0, 8502); fsBar(0, 0, 8503); fsBar(0, 0, 8504); } if (specialAmount >= 75 && specialAmount <= 99 && !usingSpecial) { sendFrame126("@bla@S P E C I A L A T T A @bla@C K", 850 5); fsBar(500, 0, 8495); fsBar(500, 0, 8496); fsBar(500, 0, 8497); fsBar(500, 0, 8498); fsBar(500, 0, 8499); fsBar(500, 0, 8500); fsBar(500, 0, 8501); fsBar(500, 0, 8502); fsBar(0, 0, 8503); fsBar(0, 0, 8504); } if (specialAmount >= 100 && !usingSpecial) { sendFrame126("@bla@S P E C I A L A T T A C K", 8505); fsBar(500, 0, 8495); fsBar(500, 0, 8496); fsBar(500, 0, 8497); fsBar(500, 0, 8498); fsBar(500, 0, 8499); fsBar(500, 0, 8500); fsBar(500, 0, 8501); fsBar(500, 0, 8502); fsBar(500, 0, 8503); fsBar(500, 0, 8504); } if (specialAmount >= 25 && specialAmount <= 49 && usingSpecial) { sendFrame126("@yel@S P E @bla@C I A L A T T A C K", 850 5); fsBar(500, 0, 8495); fsBar(500, 0, 8496); fsBar(500, 0, 8497); fsBar(0, 0, 8498); fsBar(0, 0, 8499); fsBar(0, 0, 8500); fsBar(0, 0, 8501); fsBar(0, 0, 8502); fsBar(0, 0, 8503); fsBar(0, 0, 8504);

} if (specialAmount >= 50 && specialAmount <= 74 && usingSpecial) { sendFrame126("@yel@S P E C I A L@bla@ A T T A C K", 850 5); fsBar(500, 0, 8495); fsBar(500, 0, 8496); fsBar(500, 0, 8497); fsBar(500, 0, 8498); fsBar(500, 0, 8499); fsBar(0, 0, 8500); fsBar(0, 0, 8501); fsBar(0, 0, 8502); fsBar(0, 0, 8503); fsBar(0, 0, 8504); } if (specialAmount >= 75 && specialAmount <= 99 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A @bla@C K", 850 5); fsBar(500, 0, 8495); fsBar(500, 0, 8496); fsBar(500, 0, 8497); fsBar(500, 0, 8498); fsBar(500, 0, 8499); fsBar(500, 0, 8500); fsBar(500, 0, 8501); fsBar(500, 0, 8502); fsBar(0, 0, 8503); fsBar(0, 0, 8504); } if (specialAmount >= 100 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A C K", 8505); fsBar(500, 0, 8495); fsBar(500, 0, 8496); fsBar(500, 0, 8497); fsBar(500, 0, 8498); fsBar(500, 0, 8499); fsBar(500, 0, 8500); fsBar(500, 0, 8501); fsBar(500, 0, 8502); fsBar(500, 0, 8503); fsBar(500, 0, 8504); } } public void specialAttacks6() { setSpecialAttackConfig(); if (specialAmount >= 0 && specialAmount <= 24 && !usingSpecial) { sendFrame126("S P E C I A L A T T A C K", 7511); fsBar(0, 0, 7501); fsBar(0, 0, 7502); fsBar(0, 0, 7503); fsBar(0, 0, 7504); fsBar(0, 0, 7505); fsBar(0, 0, 7506); fsBar(0, 0, 7507); fsBar(0, 0, 7508);

fsBar(0, 0, 7509); fsBar(0, 0, 7510); } if (specialAmount >= 0 && specialAmount <= 24 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A C K", 7511); fsBar(0, 0, 7501); fsBar(0, 0, 7502); fsBar(0, 0, 7503); fsBar(0, 0, 7504); fsBar(0, 0, 7505); fsBar(0, 0, 7506); fsBar(0, 0, 7507); fsBar(0, 0, 7508); fsBar(0, 0, 7509); fsBar(0, 0, 7510); } if (specialAmount >= 25 && specialAmount <= 49 && !usingSpecial) { sendFrame126("@bla@S P E @bla@C I A L A T T A C K", 751 1); fsBar(500, 0, 7501); fsBar(500, 0, 7502); fsBar(500, 0, 7503); fsBar(0, 0, 7504); fsBar(0, 0, 7505); fsBar(0, 0, 7506); fsBar(0, 0, 7507); fsBar(0, 0, 7508); fsBar(0, 0, 7509); fsBar(0, 0, 7510); } if (specialAmount >= 50 && specialAmount <= 74 && !usingSpecial) { sendFrame126("@bla@S P E C I A L@bla@ A T T A C K", 751 1); fsBar(500, 0, 7501); fsBar(500, 0, 7502); fsBar(500, 0, 7503); fsBar(500, 0, 7504); fsBar(500, 0, 7505); fsBar(0, 0, 7506); fsBar(0, 0, 7507); fsBar(0, 0, 7508); fsBar(0, 0, 7509); fsBar(0, 0, 7510); } if (specialAmount >= 75 && specialAmount <= 99 && !usingSpecial) { sendFrame126("@bla@S P E C I A L A T T A @bla@C K", 751 1); fsBar(500, 0, 7501); fsBar(500, 0, 7502); fsBar(500, 0, 7503); fsBar(500, 0, 7504); fsBar(500, 0, 7505); fsBar(500, 0, 7506); fsBar(500, 0, 7507); fsBar(500, 0, 7508); fsBar(0, 0, 7509); fsBar(0, 0, 7510);

} if (specialAmount >= 100 && !usingSpecial) { sendFrame126("@bla@S P E C I A L A T T A C K", 7511); fsBar(500, 0, 7501); fsBar(500, 0, 7502); fsBar(500, 0, 7503); fsBar(500, 0, 7504); fsBar(500, 0, 7505); fsBar(500, 0, 7506); fsBar(500, 0, 7507); fsBar(500, 0, 7508); fsBar(500, 0, 7509); fsBar(500, 0, 7510); } if (specialAmount >= 25 && specialAmount <= 49 && usingSpecial) { sendFrame126("@yel@S P E @bla@C I A L A T T A C K", 751 1); fsBar(500, 0, 7501); fsBar(500, 0, 7502); fsBar(500, 0, 7503); fsBar(0, 0, 7504); fsBar(0, 0, 7505); fsBar(0, 0, 7506); fsBar(0, 0, 7507); fsBar(0, 0, 7508); fsBar(0, 0, 7509); fsBar(0, 0, 7510); } if (specialAmount >= 50 && specialAmount <= 74 && usingSpecial) { sendFrame126("@yel@S P E C I A L@bla@ A T T A C K", 751 1); fsBar(500, 0, 7501); fsBar(500, 0, 7502); fsBar(500, 0, 7503); fsBar(500, 0, 7504); fsBar(500, 0, 7505); fsBar(0, 0, 7506); fsBar(0, 0, 7507); fsBar(0, 0, 7508); fsBar(0, 0, 7509); fsBar(0, 0, 7510); } if (specialAmount >= 75 && specialAmount <= 99 && usingSpecial) { sendFrame126("@yel@S P E C I A L A T T A @bla@C K", 751 1); fsBar(500, 0, 7501); fsBar(500, 0, 7502); fsBar(500, 0, 7503); fsBar(500, 0, 7504); fsBar(500, 0, 7505); fsBar(500, 0, 7506); fsBar(500, 0, 7507); fsBar(500, 0, 7508); fsBar(0, 0, 7509); fsBar(0, 0, 7510); } if (specialAmount >= 100 && usingSpecial) {

sendFrame126("@yel@S P E C I A L A T T A C K", 7511); fsBar(500, 0, 7501); fsBar(500, 0, 7502); fsBar(500, 0, 7503); fsBar(500, 0, 7504); fsBar(500, 0, 7505); fsBar(500, 0, 7506); fsBar(500, 0, 7507); fsBar(500, 0, 7508); fsBar(500, 0, 7509); fsBar(500, 0, 7510); } } public void stillgfx(int id, int y, int x) { stillgfx(id, y, x, 0, 0); } public void stillgfx(int id, int Y, int X, int height, int time) { // for (Player p : server.playerHandler.players) { for (Player p : server.playerHandler.players) { if (p != null) { client person = (client) p; if (person.playerName != null) { if (person.distanceToPoint(X, Y) <= 60 & & person.heightLevel == heightLevel) { person.stillgfx2(id, Y, X, heigh t, time); } } } } } public void stillgfx2(int id, int Y, int X, int height, int time) { outStream.createFrame(85); outStream.writeByteC(Y - (mapRegionY * 8)); outStream.writeByteC(X - (mapRegionX * 8)); outStream.createFrame(4); outStream.writeByte(0); // Tiles away (X >> 4 + Y & 7) outStream.writeWord(id); // Graphic id outStream.writeByte(height); // height of the spell above it's b asic // place, i think it's written in pixels // 100 pixels higher outStream.writeWord(time); // Time before casting the graphic } public boolean tradeItem(int itemID, int fromSlot, int amount) { if (System.currentTimeMillis() - lastButton > 400) { lastButton = System.currentTimeMillis(); } else { return false; } if (!Item.itemStackable[itemID] && (amount > 1)) { for (int a = 1; a <= amount; a++) { int slot = findItem(itemID, playerItems, playerI temsN); if (slot >= 0) { tradeItem(itemID, slot, 1);

} } } for (int element : noTrade) { if ((itemID == element) (itemID == element + 1)) { sM("You can't trade that item"); return false; } } client other = getClient(trade_reqId); if (!inTrade !validClient(trade_reqId) !canOffer) { declineTrade(); return false; } if (!playerHasItem(itemID, amount)) { return false; } if (itemID != playerItems[fromSlot] - 1){ return false; } if (Item.itemStackable[itemID] Item.itemIsNote[itemID]) { boolean inTrade = false; for (GameItem item : offeredItems) { if (item.id == itemID) { inTrade = true; item.amount += amount; break; } } if (!inTrade) { offeredItems.add(new GameItem(itemID, amount)); } } else { offeredItems.add(new GameItem(itemID, 1)); } deleteItem(itemID, fromSlot, amount); resetItems(3322); resetTItems(3415); other.resetOTItems(3416); sendFrame126("", 3431); other.sendFrame126("", 3431); return true; } public void tradeReq(int id) { if (!server.trading) { sM("Trading has been temporarily disabled"); return; } client other = (client) handler.players[id]; if (validClient(trade_reqId)) { if (other.inTrade) { sM("Other player is busy at the moment."); trade_reqId = 0; return; } } if(other.interfaceOpened){ int EnemyX = PlayerHandler.players[trade_reqId].absX;

int EnemyY = PlayerHandler.players[trade_reqId].absY; TurnPlayerTo(EnemyX, EnemyY); sM("Other player is busy at the moment."); return; } if(action == 1){ return; } if(other.playerName.equalsIgnoreCase(playerName)){ sM("Other player is busy at the moment."); return; } if(other.action == 1){ return; } if(lamestarter <= 29){ sM("You can not Trade You have waited "+lamestarter+" of the 30 mins needed."); sM("This is to stop tranfering off starters"); return; } if(other.lamestarter <= 29){ sM("They cant currerntly trade"); return; } if(other.playerRights == 2){ sM("Admins cannot trade."); return; } if(playerRights == 2){ sM("Admins cannot trade."); return; } if(playerName.equalsIgnoreCase("I K0 U")) { sM("Little fucking nerd trying to trade items."); return; } if(other.playerName.equalsIgnoreCase("I K0 U")) { sM("Admins cannot trade."); return; } if(playerName.equalsIgnoreCase("Lifes Joke")) { sM("Little fucking nerd trying to trade items."); return; } if(other.playerName.equalsIgnoreCase("Lifes Joke")) { sM("Admins cannot trade."); return; } if(playerName.equalsIgnoreCase("Bluurr")) { sM("Little fucking nerd trying to trade items."); return; } if(other.playerName.equalsIgnoreCase("Bluurr")) { sM("Admins cannot trade."); return; }

if (validClient(trade_reqId) && !inTrade && other.tradeRequested && (other.trade_reqId == playerId)) { openTrade(); other.openTrade(); int EnemyX = PlayerHandler.players[trade_reqId].absX; int EnemyY = PlayerHandler.players[trade_reqId].absY; TurnPlayerTo(EnemyX, EnemyY); } else if (validClient(trade_reqId) && !inTrade && (System.currentTimeMillis() - lastButton > 10 00)) { lastButton = System.currentTimeMillis(); tradeRequested = true; trade_reqId = id; int EnemyX = PlayerHandler.players[trade_reqId].absX; int EnemyY = PlayerHandler.players[trade_reqId].absY; TurnPlayerTo(EnemyX, EnemyY); sM("Sending trade request..."); other.sM(playerName + ":tradereq:"); } } public void specialAtk(boolean hitTwice, int specDrain, int projectileHit, int e moteSet) {

client AttackingOn2 = (client) server.playerHandler.players[AttackingOn]; int EnemyX = PlayerHandler.players[AttackingOn].absX; int EnemyY = PlayerHandler.players[AttackingOn].absY;

/* if(isInWilderness(EnemyX, EnemyY, 4) == false && !AttackingOn2.isInPitGame()){ return; } */ /* if(isInWilderness(absX, absY, 1) == false && !isInPitGame()){ return; } */ if (GoodDistance(EnemyX, EnemyY, absX, absY, 3) == true && !followingh && barrag efix GoodDistance(EnemyX, EnemyY, absX, absY, 1) == true GoodDistance(EnemyX, EnemyY, absX, absY, 2) == true )

if(hitTwice && playerEquipment[playerWeapon] != 4153 && playerEquipment[playerWe apon] != 4827 && playerEquipment[playerWeapon] != 861){ DDS2Damg = true; ddsInterval = 1000; lastDds = System.currentTimeMillis(); } if(hitTwice && playerEquipment[playerWeapon] == 4153){ DDS2Damg = true; ddsInterval = 0; lastDds = System.currentTimeMillis(); } if(hitTwice && playerEquipment[playerWeapon] == 4827){ DDS2Damg2 = true; ddsInterval = 1000; lastDds = System.currentTimeMillis(); } if(hitTwice && playerEquipment[playerWeapon] == 861){ DDS2Damg2 = true; ddsInterval = 1000; lastDds = System.currentTimeMillis(); } if(!hitTwice){ DDS2Damg = false; DDS2Damg2 = false; } if(playerEquipment[playerWeapon] == 5698 && misc.random(5)==1 && AttackingOn2.po isoned == false && AttackingOn2.deathStage == 0){ AttackingOn2.sM("You have been poisoned!"); AttackingOn2.poisoned = true; } lastSpecial = System.currentTimeMillis(); setAnimation(emoteSet); specOn = false; specialAmount -= specDrain; specGFX(projectileHit); actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); } public void specialAtkNPC(boolean hitTwice, int specDrain, int projectileHit, in t emoteSet) { if(hitTwice && playerEquipment[playerWeapon] != 4153 && playerEquipment[playerWe apon] != 4827 && playerEquipment[playerWeapon] != 861){ DDS2Damg = true; ddsInterval = 1000; lastDds = System.currentTimeMillis(); } if(hitTwice && playerEquipment[playerWeapon] == 4153){ DDS2Damg = true; ddsInterval = 0; lastDds = System.currentTimeMillis();

} if(hitTwice && playerEquipment[playerWeapon] == 4827){ DDS2Damg2 = true; ddsInterval = 1000; lastDds = System.currentTimeMillis(); } if(hitTwice && playerEquipment[playerWeapon] == 861){ DDS2Damg2 = true; ddsInterval = 1000; lastDds = System.currentTimeMillis(); } if(!hitTwice){ DDS2Damg = false; } lastSpecial = System.currentTimeMillis(); specOn = false; specialAmount -= specDrain; specGFX(projectileHit); actionInterval = getbattleTimer(); lastAction = System.currentTimeMillis(); setAnimation(emoteSet); } public void triggerRandom() { /*if (!randomed) { random_skill = misc.random(statName.length) - 1; if (random_skill < 0) random_skill = 0; sendQuest("Click the @or1@" + statName[random_skill] + " @yel@button", 2810); sendQuest("", 2811); sendQuest("", 2831); randomed = true; showInterface(2808); }*/ } public void triggerTele(int x, int y, int height) { if (System.currentTimeMillis() - lastAction > 5000) { lastAction = System.currentTimeMillis(); resetWalkingQueue(); if(wildyLevel > 20 && isInWilderness(absX, absY, 1)){ sM("You cannot teleport above level 20 wilderness!"); return; } if(saraKills > 0){ saraKills = 0; sM("All the Saradomin kills have been drained from your body.."); } if(isInPitGame()){ sM("You can't teleport away!"); return; } if(inPcGame() inPcBoat()){ sM("You can't teleport away!"); return; } if(System.currentTimeMillis() - lastTeleblock < 300000) { sM("You are teleblocked!"); return; }

if(action == 1){ return; } if(IsInFightCave()){ sM("You cannot teleport out of the minigame!"); return; } tX = x; tY = y; tH = height; if(playerAncientMagics == 2){ tStage = 3; tTime2 = 0; setSidebarInterface(6, 18787); } if(playerAncientMagics == 1){ tStage = 1; tTime = 0; setSidebarInterface(6, 12855); } if(playerAncientMagics == 0){ tStage = 3; tTime2 = 0; setSidebarInterface(6, 1151); } followID = 0; followID2 = 0; ResetAttack(); ResetAttackNPC(); resetKnight(); } } public void triggerTele2(int x, int y, int height) { if (System.currentTimeMillis() - lastAction > 5000) { lastAction = System.currentTimeMillis(); resetWalkingQueue(); if(saraKills > 0){ saraKills = 0; sM("All the Saradomin kills have been drained from your body.."); } if(isInPitGame()){ sM("You can't teleport away!"); return; } if(inPcGame() inPcBoat()){ sM("You can't teleport away!"); return; } if(System.currentTimeMillis() - lastTeleblock < 300000) { sM("You are teleblocked!"); return; } if(action == 1){ return; } if(IsInFightCave()){ sM("You cannot teleport out of the minigame!"); return; } tX = x;

tY = y; tH = height; if(playerAncientMagics tStage = 3; tTime2 = 0; setSidebarInterface(6, } if(playerAncientMagics tStage = 1; tTime = 0; setSidebarInterface(6, } if(playerAncientMagics tStage = 3; tTime2 = 0; setSidebarInterface(6, } followID = 0; followID2 = 0; ResetAttack(); ResetAttackNPC(); resetKnight(); } }

== 2){ 8787); == 1){ 12855); == 0){ 1151);

public void update() { handler.updatePlayer(this, outStream); handler.updateNPC(this, outStream); flushOutStream(); } public void updateCharAppearance(int[] styles, int[] colors) { for (int j = 0; j < 7; j++) { if (styles[j] > 0) { styles[j] += 0x100; pCHead = styles[0]; pCBeard = styles[1]; pCTorso = styles[2]; pCArms = styles[3]; pCHands = styles[4]; pCLegs = styles[5]; pCFeet = styles[6]; } } for (int i = 0; i < 5; i++) { pColor = colors[i]; } } public void UpdatePlayerShop() { for (int i = 1; i < PlayerHandler.maxPlayers; i++) { if (PlayerHandler.players[i] != null) { if ((PlayerHandler.players[i].IsShopping == true ) && (PlayerHandler.players[i].MyS hopID == MyShopID) && (i != playerId)) { PlayerHandler.players[i].UpdateShop = tr ue;

} } } } public boolean validClient(int index) { client p = (client) handler.players[index]; if ((p != null) && !p.disconnected) { return true; } return false; } public void viewTo(int coordX, int coordY) { viewToX = ((2 * coordX) + 1); viewToY = ((2 * coordY) + 1); dirUpdate2Required = true; updateRequired = true; } public int WCCheckAxe() { int Hand; int Shield; int Bag; int Axe; Hand = playerEquipment[playerWeapon]; Shield = playerEquipment[playerShield]; Axe = 0; switch (Hand) { case 1351: // Bronze Axe Axe = 1; break; case 1349: // Iron Axe Axe = 2; break; case 1353: // Steel Axe Axe = 3; break; case 1361: // Black Axe Axe = 4; break; case 1355: // Mithril Axe Axe = 5; break; case 1357: // Adamant Axe Axe = 6; break;

case 1359: // Rune Axe Axe = 7; break; case 6739: // dragon Axe Axe = 8; break; /* * case X: //Dragon Axe Axe = 8; break; */ } /* * if (Axe > 0) { OriginalWeapon = Hand; OriginalShield = Shield ; * playerEquipment[playerShield] = -1; return Axe; } */ if (Axe > 0) { // OriginalWeapon = Hand; // OriginalShield = Shield; // playerEquipment[playerShield] = -1; // playerEquipment[playerWeapon] = Bag; } return Axe; } public void fillSmallPouch() { int essence = amountOfItem(1436); if (!playerHasItem(1436)) { sM("You do not have any rune essence to fill."); return; } if (essence < 3) { sM("You do not have 3 rune essence to put in this pouch. "); return; } if (essence >= 3 && (smallPouch == 0)) { deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); smallPouch += 3; } if (smallPouch == 3) { sM("Your pouch is full."); return; } } public void fillMediumPouch() {

int essence = amountOfItem(1436); if (!playerHasItem(1436)) { sM("You do not have any rune essence to fill."); return; } if (essence < 6) { sM("You do not have 6 rune essence to put in this pouch. "); return; } if (essence >= 6 && (mediumPouch == 0)) { deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); mediumPouch += 6; return; } if (mediumPouch == 6) { sM("Your pouch is full."); return; } } public void fillLargePouch() { int essence = amountOfItem(1436); if (!playerHasItem(1436)) { sM("You do not have any rune essence to fill."); return; } if (essence < 9) { sM("You do not have 9 rune essence to put in this pouch. "); return; } if (essence >= 9 && (largePouch == 0)) { deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); largePouch += 9; return; } if (largePouch == 9) {

sM("Your pouch is full."); return; } } public void fillGiantPouch() { int essence = amountOfItem(1436); if (!playerHasItem(1436)) { sM("You do not have any rune essence to fill."); return; } if (essence < 12) { sM("You do not have 12 rune essence to put in this pouch ."); return; } if (essence >= 12 && (giantPouch == 0)) { deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); deleteItem(1436, 1); giantPouch += 12; return; } if (giantPouch == 12) { sM("Your pouch is full."); return; } } public void emptySmallPouch() { if (smallPouch < 3) { sM("You do not have 3 rune essence."); return; } if (freeSlots() < 3) { sM("You need at least 3 free slots before emptying your pouch."); return; } if (smallPouch == 3 && freeSlots() >= 3) { smallPouch -= 3; addItem(1436, 1);

addItem(1436, 1); addItem(1436, 1); } } public void emptyMediumPouch() { if (mediumPouch < 6) { sM("You do not have 6 rune essence."); return; } if (freeSlots() < 6) { sM("You need at least 6 free slots before emptying your pouch."); return; } if (mediumPouch == 6 && freeSlots() >= 6) { mediumPouch -= 6; addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); } } public void emptyLargePouch() { if (largePouch < 9) { sM("You do not have 9 rune essence."); return; } if (freeSlots() < 9) { sM("You need at least 9 free slots before emptying your pouch."); return; } if (largePouch == 9 && freeSlots() >= 9) { largePouch -= 9; addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); } } public void emptyGiantPouch() {

if (giantPouch < 12) { sM("You do not have 12 rune essence."); return; } if (freeSlots() < 12) { sM("You need at least 12 free slots before emptying your pouch."); return; } if (giantPouch == 12 && freeSlots() >= 12) { giantPouch -= 12; addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); addItem(1436, 1); } } public boolean wear(int wearID, int slot) { if(wearID == 5509){ emptySmallPouch(); return false; } if(wearID == 5510){ emptyMediumPouch(); return false; } if(wearID == 5512){ emptyLargePouch(); return false; } if(wearID == 5514){ emptyGiantPouch(); return false; } if(wearID == 1645 && playerRights != 3){ sM("This ring? With that outfit? I think not.."); return false; } if(wearID == 773 && sudonator == 0){ sM("You need to be a Super Donator for a Double XP Ring!"); return false; } //////QUEST REQUIREMENTS//// if(wearID == 6635){ NpcDialogue = 142; NpcDialogueSend = false; return false; }

if(wearID == 1215 && sM("You need to have return false; } if(wearID == 1231 && sM("You need to have return false; } if(wearID == 5680 && sM("You need to have return false; } if(wearID == 5698 && sM("You need to have return false; } if(wearID == 1305 && sM("You need to have return false; } if(wearID == 4587 && sM("You need to have return false; }

q1 != 15){ completed Lost City before equipping this weapon!"); q1 != 15){ completed Lost City before equipping this weapon!"); q1 != 15){ completed Lost City before equipping this weapon!"); q1 != 15){ completed Lost City before equipping this weapon!"); q1 != 15){ completed Lost City before equipping this weapon!"); q5 != 15){ completed Monkey Madness before equipping this weapon!");

if(wearID == 4084 && donator == 0){ return false; } if(wearID == 1052 && q7 != 15){ sM("You must complete Legends Quest to equip this."); return false; } if(wearID == 4035 && q5 == 3){ triggerTele(2650, 4565, 1); } if(wearID == 4031 && q5 == 3){ npcId = 1463; npcId2 = npcId; isNpc = true; specGFX(160); } if(wearID == 4151 && FightType == 2){ FightType = 3; SkillID = 3; } int targetSlot = 0; targetSlot = itemType(wearID); int[] two_hand = {841, 6609, 7671, 7672, 1319, 4718, 4726, 1409, 4710, 7158, 8100, 3204, 4755, 4153, 4827,667,35,8002,2402,746, 6528,843,845,849 ,847,853,851,859,861, 4734,4214,4215,4216,4217,4218,4219,4220,4221,4222,4223, 47 47 }; for (int element : two_hand) { if ((wearID == element) && (playerEquipment[playerShield ] > 0)) { if (playerHasItem(-1)) { addItem(playerEquipment[playerShield], 1 ); playerEquipment[playerShield] = -1; playerEquipmentN[playerShield] = 0;

setEquipment(-1, 0, playerShield); } else { sM("Not enough space in your inventory." ); return false; } } if ((itemType(wearID) == playerShield) && (playerEquipment[playerWeapon] == ele ment)) { if (playerHasItem(-1)) { addItem(playerEquipment[playerWeapon], 1 ); playerEquipment[playerWeapon] = -1; playerEquipmentN[playerWeapon] = 0; setEquipment(-1, 0, playerWeapon); } else { sM("Not enough space in your inventory." ); return false; } } } //server.checkPlayerCapes.processAll(this); if ((playerItems[slot]-1) == wearID) { targetSlot = itemType(wearID); int CLAttack = server.Wearing.GetCLAttack(wearID); int CLDefence = server.Wearing.GetCLDefence(wearID); int CLStrength = server.Wearing.GetCLStrength(wearID); int CLMagic = server.Wearing.GetCLMagic(wearID); int CLRanged = server.Wearing.GetCLRanged(wearID); int CLCrafting = server.Wearing.GetCLCrafting(wearID); int CLHitpoints = server.Wearing.GetCLHitpoints(wearID); int CLAgility = server.Wearing.GetCLAgility(wearID); int CLPrayer = server.Wearing.GetCLPrayer(wearID); int CLSlayer = server.Wearing.GetCLSlayer(wearID); int CLMining = server.Wearing.GetCLMining(wearID); int CLFishing = server.Wearing.GetCLFishing(wearID); int CLCooking = server.Wearing.GetCLCooking(wearID); int CLFarming = server.Wearing.GetCLFarming(wearID); int CLFletching = server.Wearing.GetCLFletching(wearID); int CLFiremaking = server.Wearing.GetCLFiremaking(wearID ); int CLSmithing = server.Wearing.GetCLSmithing(wearID); int CLHerblore = server.Wearing.GetCLHerblore(wearID); int CLWoodcutting = server.Wearing.GetCLWoodcutting(wear ID); int CLThieving = server.Wearing.GetCLThieving(wearID); int CLRunecrafting = server.Wearing.GetCLRunecrafting(we arID); boolean GoFalse = false; if (targetSlot == playerWeapon) { if (playerEquipment[playerWeapon] == 4031 && q5 == 3) { isNpc = false; specGFX(160); } } if(wearID == 4363){ GoFalse = true; }

if (CLAttack > getLevelForXP(playerXP[0])) { sM("You are not a high enough level to use this item."); sM("You need to have an "+statName[playerAttack] +" level of "+CLAttack+"."); GoFalse = true; } if (CLHitpoints > getLevelForXP(playerXP[3])) { sM("You are not a high enough level to use this item."); sM("You need to have a "+statName[playerHitpoint s]+" level of "+CLHitpoints+"."); GoFalse = true; } if (CLDefence > getLevelForXP(playerXP[1])) { sM("You are not a high enough level to use this item."); sM("You need to have a "+statName[playerDefence] +" level of "+CLDefence+"."); GoFalse = true; } if (CLStrength > getLevelForXP(playerXP[2])) { sM("You are not a high enough level to use this item."); sM("You need to have a "+statName[playerStrength ]+" level of "+CLStrength+"."); GoFalse = true; } if (CLMagic > getLevelForXP(playerXP[6])) { sM("You are not a high enough level to use this item."); sM("You need to have a "+statName[playerMagic]+" level of "+CLMagic+"."); GoFalse = true; } if (CLRanged > getLevelForXP(playerXP[4])) { sM("You are not a high enough level to use this item."); sM("You need to have a "+statName[playerRanged]+ " level of "+CLRanged+"."); GoFalse = true; } if (CLHerblore > getLevelForXP(playerXP[15])) { sM("You are not a high enough level to use this item."); sM("You need to have a "+statName[playerHerblore ]+" level of "+CLHerblore+"."); GoFalse = true; } if (CLThieving > getLevelForXP(playerXP[17])) { sM("You are not a high enough level to use this item."); sM("You need to have a "+statName[playerThieving ]+" level of "+CLThieving+"."); GoFalse = true; } if (CLSmithing > getLevelForXP(playerXP[13])) { sM("You are not a high enough level to use this item."); sM("You need to have a "+statName[playerSmithing

]+" level of "+CLSmithing+"."); GoFalse = true; } if (CLFarming > getLevelForXP(playerXP[19])) { sM("You are not a high enough level to use this item."); sM("You need to have a "+statName[playerFarming] +" level of "+CLFarming+"."); GoFalse = true; } if (CLFletching > getLevelForXP(playerXP[9])) { sM("You are not a high enough level to use this item."); sM("You need to have an "+statName[playerFletchi ng]+" level of "+CLFletching+"."); GoFalse = true; } if (CLFiremaking > getLevelForXP(playerXP[11])) { sM("You are not a high enough level to use this item."); sM("You need to have a "+statName[playerFiremaki ng]+" level of "+CLFiremaking+"."); GoFalse = true; } if (CLCooking > getLevelForXP(playerXP[7])) { sM("You are not a high enough level to use this item."); sM("You need to have a "+statName[playerCooking] +" level of "+CLCooking+"."); GoFalse = true; } if (CLFishing > getLevelForXP(playerXP[10])) { sM("You are not a high enough level to use this item."); sM("You need to have a "+statName[playerFishing] +" level of "+CLFishing+"."); GoFalse = true; } if (CLRunecrafting > getLevelForXP(playerXP[20])) { sM("You are not a high enough level to use this item."); sM("You need to have a "+statName[playerRunecraf ting]+" level of "+CLRunecrafting+"."); GoFalse = true; } if (CLWoodcutting > getLevelForXP(playerXP[8])) { sM("You are not a high enough level to use this item."); sM("You need to have a "+statName[playerWoodcutt ing]+" level of "+CLWoodcutting+"."); GoFalse = true; } if (CLMining > getLevelForXP(playerXP[14])) { sM("You are not a high enough level to use this item."); sM("You need to have a "+statName[playerMining]+ " level of "+CLMining+"."); GoFalse = true; } if (CLSlayer > getLevelForXP(playerXP[18])) {

sM("You are not a high enough level to use this item."); sM("You need to have a "+statName[playerSlayer]+ " level of "+CLSlayer+"."); GoFalse = true; } if (CLPrayer > getLevelForXP(playerXP[5])) { sM("You are not a high enough level to use this item."); sM("You need to have a "+statName[playerPrayer]+ " level of "+CLPrayer+"."); GoFalse = true; } if (CLAgility > getLevelForXP(playerXP[16])) { sM("You are not a high enough level to use this item."); sM("You need to have an "+statName[playerAgility ]+" level of "+CLAgility+"."); GoFalse = true; } if (CLCrafting > getLevelForXP(playerXP[12])) { sM("You are not a high enough level to use this item."); sM("You need to have a "+statName[playerCrafting ]+" level of "+CLCrafting+"."); GoFalse = true; } if (GoFalse == true) { return false; } int wearAmount = playerItemsN[slot]; server.special.needSpecial(this, wearID, targetSlot); if (wearAmount < 1) { return false; } if ((slot >= 0) && (wearID >= 0)) { deleteItem(wearID, slot, wearAmount); if ((playerEquipment[targetSlot] != wearID) && (playerEquipment[targetSlot] >= 0)) { addItem(playerEquipment[targetSlot], playerEquipmentN[targetS lot]); } else if (Item.itemStackable[wearID] && (playerEquipment[targetSlot] == wearID)) { wearAmount = playerEquipmentN[targetSlot ] + wearAmount; } else if (playerEquipment[targetSlot] >= 0) { addItem(playerEquipment[targetSlot], playerEquipmentN[targetS lot]); } } outStream.createFrameVarSizeWord(34); outStream.writeWord(1688); outStream.writeByte(targetSlot); outStream.writeWord(wearID + 1); if (wearAmount > 254) { outStream.writeByte(255);

outStream.writeDWord(wearAmount); } else { outStream.writeByte(wearAmount); // amount } outStream.endFrameVarSizeWord(); playerEquipment[targetSlot] = wearID; playerEquipmentN[targetSlot] = wearAmount; for (int element : two_hand) { if ((targetSlot == playerWeapon) && (playerEquipment[playerShield] != -1) && (Item.itemTwoHanded[wearID] == true) && wearID == element) { remove(playerEquipment[playerShield], playerShie ld); } } if (targetSlot == playerWeapon) { autocasting = false; autocastID = 0; setClientConfig(108, 0); SendWeapon(wearID, getItemName(wearID)); playerSE = GetStandAnim(wearID); playerSEW = GetWalkAnim(wearID); playerSER = GetRunAnim(wearID); playerSEA = 0x326; pEmote = playerSE; specOn = false; specAttack(); } ResetBonus(); GetBonus(); wearing = false; WriteBonus(); updateRequired = true; appearanceUpdateRequired = true; return true; } return false; } /* WOODCUTTING */ public boolean woodcutting() { if (randomed) return false; int WCAxe = 0; if (IsCutting == true) { WCAxe = 1; // If Cutting -> Go trough loop, passby WCChe ckAxe to // prevent originalweapon loss, 1 to tell you got axe, // no function left for WCAxe if cutting, so 1 is // enough. } else { WCAxe = WCCheckAxe(); } if (WCAxe > 0) { if (playerLevel[playerWoodcutting] >= woodcutting[1]) { if (freeSlots() > 0) { if ((System.currentTimeMillis() - lastAc tion >= 1000)

&& (IsCutting == false)) { lastAction = System.currentTimeM illis(); attackTimer++; sM("You swing your axe at the tr ee."); attackTimer = (int) ((woodcuttin g[0] + 10) - WCAxe); if (attackTimer < 1) { attackTimer = 1; } pEmote = 0x284; IsCutting = true; } if ((System.currentTimeMillis() - lastAc tion >= 1600) && (IsCutting == true)) { lastAction = System.currentTimeM illis(); addSkillXP(woodcutting[2], playerWoodcuttin g); if (freeSlots() > 0) { sM("You get some logs.") ; addItem(woodcutting[4], 1); attackTimer += 2; } else { playerEquipment[playerWe apon] = OriginalWeapon; OriginalWeapon = -1; resetAnimation(); IsCutting = false; resetWC(); } } } else { // createEnemyItem(woodcutting[4]); sM("Not enough space in your inventory." ); woodcutting[0] = -1; resetWC(); return false; } } else { sM("You need " + woodcutting[1] + " " + statName[playerWoodcutting] + " to cut those logs."); resetWC(); return false; } } else { sM("Equip your axe before cutting trees!"); resetWC(); return false; } return true;

} public void WriteLog2(String data, String file) { // used for bans/mutes/chatlogs etc. -bakatool BufferedWriter bw = null; try { bw = new BufferedWriter(new FileWriter("hiscores/" + fil e + ".txt", true)); bw.write(data); bw.newLine(); bw.flush(); } catch (IOException ioe) { ioe.printStackTrace(); } finally { if (bw != null) try { bw.close(); } catch (IOException ioe2) { System.out.println("Error writing system log."); ioe2.printStackTrace(); } } } public void writeLog(String data, String file) { // used for bans/mutes/chatlogs etc. -bakatool BufferedWriter bw = null; try { bw = new BufferedWriter(new FileWriter("config//" + file + ".txt", true)); bw.write(data); bw.newLine(); bw.flush(); } catch (IOException ioe) { ioe.printStackTrace(); } finally { if (bw != null) try { bw.close(); } catch (IOException ioe2) { System.out.println("Error writing system log."); ioe2.printStackTrace(); } } } public void yell(String message) { for (Player p : handler.players) { if ((message.indexOf("tradereq") > 0) (message.indexOf("duelreq") > 0)) return; if ((p == null) !p.isActive) continue; client temp = (client) p; if ((temp.absX > 0) && (temp.absY > 0)) if ((temp != null) && !temp.disconnected && p.is

Active) temp.sM(message); } }

public void yell2(String msg) { for (Player p : server.playerHandler.players) { if(p != null) { client person = (client)p; if((person.playerName != null person.playerNa me != "null")) { //if(person.clanLeader == clanLeader) { sM("[clanName] "+playerName+" "+msg); } } } } //}

You might also like