Jump to content

homework9293

Member
  • Content count

    30
  • Joined

  • Last visited

About homework9293

  • Rank
    Bronze Member
  1. So my other buddy is on the server, but my one friend is having issues: [img]http://i.imgur.com/vwdtNtl.png[/img] Error: [code]Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated a nd will likely be removed in a future release C:\Users\Imperial\Guardian718\guardian\live File ID: 1, details: 45 / [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44] Error: sy.c() client.er() client.ae() mc.m() mc.e() | Class460.method5980:315 cl ient.method2806:2806 client.method2773:607 Class291.method2764:534 Class291.meth od2759:375 Class291.run:323 java.lang.Thread.run | java.lang.NullPointerExceptio n | 0,0,104,104 0,8,8 0 0 2 765,503 1 2 2 1 0 0 248 4 0 hAJWGrsaETglRjuwxMwnlA/ d5W6EgYWx java.net.ConnectException: Connection timed out: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) at java.net.AbstractPlainSocketImpl.connect(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at sun.net.NetworkClient.doConnect(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient.<init>(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Sou rce) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Sour ce) at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown S ource) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown So urce) at java.net.URL.openStream(Unknown Source) at IPAddress.method6062(IPAddress.java:127) at Class291.run(Class291.java:327) at java.lang.Thread.run(Unknown Source) error_game_crash[/code] Please help!
  2. [center]Welcome to Legion, Legion hasn't been around for that long at all, but the server has been reconstructed from other names before. You may remember, ColdBrainScape, ClashPkz, etc. They are all improvements and/or conversions. Legion tries their best to make sure everyone is satisfied with the server and all its features. If you every have a problem/feedback/ or suggestion, the staff are always welcome to hearing them. Features: Fully working combat (so that everyone can enjoy the pvp and boss fights) Over 20+ bosses so you can never run out of things to do! Improvements DAILY, to keep things active and updated. Friendly staff (but, behave because everyone has a structured side of them) Clean cache (for personal purposes) Donator system (with items!) Plenty of training locations (to make sure you have all the needs you need) Mini-games!! (once again, to keep you active) PK Ranking system Dicing (Only for donators) Castle Wars 99% working (Ice barrage gets multiple targets) PVP 100% Working! A beautiful, wonderful home! + MANY MORE! -- -being worked on- -- !More to come! -- Recent updates: 2014/07/09: Launch! Welcome to the official server! 2014/07/10: New source! 2014/07/10: Added Dicing 2014/07/10: Added PK System 2014/07/12: Fixed Duel Arena 2014/07/12: Fixed PVP/Pking 2014/07/12: Fixed Portal 2014/07/12: Changed home 2014/07/13: Added Portal to New Home 2014/07/13: Added Duel Arena Teleport in Quest tab 2014/07/13: Fixed Castle Wars 2014/07/13: Added Castle Wars teleport in Quest tab 2015/05/21: Launch of new source! 2015/05/22: New cache with fixes 2015/05/28: Paid for a good source! 2015/05/29: Fixed Combat 2015/05/29: Fixed Bosses --- Upcoming updates: Fixed Duel Arena N/A at the moment --- Download (Jar): [url]https://www.dropbox.com/s/ktgia8zqsf1q2rb/Legion.jar?dl=0[/url] Download (Client): (Coming soon!) ---------------------- Pictures: [img]http://gyazo.com/f85d87300b33b3640ee93b82e8e366c9.png[/img] [img]http://gyazo.com/6017d31a52280f27a4df5b0f53d1e71a.png[/img] [img]http://gyazo.com/8944dc5c3e53f7cceab6b61d84989ecf.png[/img] [img]http://gyazo.com/f460591779c1de2127d5fb377691b403.png[/img] [img]http://gyazo.com/349591ea80e6821064b405147964c0bd.png[/img] [img]http://gyazo.com/c6d42d6e2472e586abcc8a80c138c8c7.png[/img] [img]http://gyazo.com/2f135b7af54209f30a1a8b3b7585902d.png[/img] [img]http://gyazo.com/f666fb6cd77efa165d1264980aed03cf.jpg[/img] [img]http://gyazo.com/eea2b9145abfdd2d1a0ebdc9ecad7167.png[/img] [img]http://gyazo.com/11c512f84652e6e6f9a347e8a387a084.jpg[/img] [img]http://gyazo.com/2438aa37ed2e8c55c5019e9df10ee570.png[/img] More screenshots/pictures coming soon[/center]
  3. I'm having several problems. First of all my Magic only gives 1-10 xp as I mentioned before. Second of all my Squeal of Fortune is an issue. It puts the wrong items you win in your bank. For example if you win Bandos Chestplate, it will put a Iron ore sometimes. Squeal.java: [code]package com.rs.game.player.content; import java.util.concurrent.TimeUnit; import com.rs.Settings; import com.rs.cores.CoresManager; import com.rs.game.item.Item; import com.rs.game.item.ItemsContainer; import com.rs.game.player.Player; import com.rs.utils.Logger; import com.rs.utils.Utils; public class Squeal { public static void openWindow(Player player) { if (player.getRights() >= 2) { if (player.getAttackedByDelay() + 10000 > Utils.currentTimeMillis()) { player.getPackets() .sendGameMessage( "You cannot open Squeal of Fortune while in combat."); return; } if (player.getInterfaceManager().containsScreenInter()) { player.getPackets() .sendGameMessage( "Please finish what you're doing before opening Squeal of Fortune."); return; } player.isSpining = false; player.stopAll(); player.getPackets().sendRunScript(5879); player.getPackets().sendConfigByFile(11155, 3); player.getPackets().sendWindowsPane(1253, 0); sendItems(player); refresh(player); } else { player.sm("Not available."); } } public static void sendTicket(Player player) { player.sm("Congratulations! You have earned a spin on the Squeal of Fortune!"); player.squealSpins += 1; refresh(player); //TODO find config for this. } public static void sendRandomTicket(Player player, int chance) { if(Utils.random(chance) == 1) { if(player.squealSpins > 10) { player.sm("You must have no more than 10 spins to be eligible to recieve random activity spins."); return; } player.sm("Congratulations! You've earned a ticket for a free spin on the Squeal of Fortune!"); if(!player.getInventory().hasFreeSlots()) { player.squealSpins += 1; refresh(player); player.sm("Your inventory was full, so your spin ticket was automatically redeemed into spins.", true); } else player.getInventory().addItem(24154, 1); } } public static void sendButton(Player player) { if (player.getRights() >= 2) { if (player.squealSpins >= 1) { player.getInterfaceManager().sendOverlay(1252, true); refresh(player); } else { player.getInterfaceManager().closeOverlay(true); refresh(player); } } } public static void closeButton(Player player) { player.getInterfaceManager().closeOverlay(true); player.sm("You can access the Squeal of Fortune from the side panel, and you can show the button again by logging out and back in."); } public static void close(Player player) { player.getPackets().sendWindowsPane( player.getInterfaceManager().hasRezizableScreen() ? 746 : 548, 0); Squeal.sendButton(player); } public static void decreaseSpins(Player player) { player.squealSpins -= 1; refresh(player); } public static void increaseSpins(Player player, int i) { player.squealSpins += i; refresh(player); } public static void refresh(Player player) { player.getPackets().sendConfigByFile(11026, player.squealSpins + 1); } public static void sendDailySpins(Player player) { if (player.squealSpins >= 2) { //int hours = (int) ((player.getSqueal() / (1000*60*60)) % 24); if (player.getSqueal() < Utils.currentTimeMillis()) { player.setSqueal(Utils.currentTimeMillis() + (24 * 60 * 60 * 1000)); player.squealSpins += 2; refresh(player); player.sm("You have received your daily spins for Squeal of Fortune!", true); /*} else { player.sm("You will receive your daily spins for Squeal of Fortune in "+hours * 2+" hours.", true);TODO }*/ } } } public static void buySpins(final Player player) { close(player); sendDelayedLogout(player); } public static void spin(Player player) { if(player.squealSpins < 1) { close(player); player.getPackets().sendGameMessage("You do not have enough spins to continue."); return; } else { if(player.isSpining == true) return; player.isSpining = true; decreaseSpins(player); int reward = Utils.random(1, 1000); int slot = 0; int slotchange = Utils.getRandom(6); if (reward >= 1 && reward <= 920) { if (slotchange == 1) { slot = 1; } else if (slotchange == 2) { slot = 3; } else if (slotchange == 3) { slot = 5; } else if (slotchange == 4) { slot = 7; } else if (slotchange == 5) { slot = 10; } else if (slotchange == 6) { slot = 12; } } else if (reward >= 921 && reward <= 987) { if (slotchange >= 5) { slot = 6; } else if (slotchange <= 2) { slot = 9; } else if (slotchange >= 3 && slotchange < 5) { slot = 11; } } else if (reward >= 988 && reward <= 997) { if (slotchange >= 5) { slot = 0; } else if (slotchange <= 2) { slot = 4; } else if (slotchange >= 3 && slotchange < 5) { slot = 8; } } else if (reward >= 998) { slot = 2; } //Logger.log("Squeal", player.getDisplayName()+" has used a spin. Spins remaining: "+player.squealSpins); player.getPackets().sendConfigByFile(10860, slot); // Squeal Reward player.getPackets().sendGlobalConfig(1781, 0); player.getPackets().sendGlobalConfig(1781, 0); player.getPackets().sendGlobalConfig(1781, Utils.getRandom(13)); player.getPackets().sendConfigByFile(10860, itemWon); player.getPackets().sendGlobalConfig(1790, 1); player.getPackets().sendConfigByFile(10861, itemWon); itemWon = slotchange; } } public static void claimItem(Player player) { int amount = getBox().getAmount(); int id = getBox().getId(); player.isSpining = false; if (id == 995) { player.getMoneyPouch().addMoney(amount, amount, true, true); close(player); } else { player.getBank().addItem(id, amount, true); close(player); player.getPackets().sendGameMessage( ""+amount+" " + getBox().getName() +(amount == 1 ? " " : "s ")+(amount == 1 ? "has" : "have")+" been added to your bank."); } } public static void discardItem(Player player) { player.sm("You discard your prize."); close(player); } public static void sendDelayedLogout(final Player player) { int LOGOUT_ALERT = 1254; int LOGGING_OUT = 1255; [MENTION=19271]supp[/MENTION]ressWarnings("unused") int LOGOUT_REQUEST = 1256; if (player.getAttackedByDelay() + 10000 > Utils.currentTimeMillis()) { player.getInterfaceManager().sendInterface(LOGOUT_ALERT); return; } player.getInterfaceManager().sendInterface(LOGGING_OUT); CoresManager.slowExecutor.schedule(new Runnable() { [MENTION=15855]Over[/MENTION]ride public void run() { player.getPackets().sendOpenURL(Settings.PAYMENTS_LINK); player.forceLogout(); } }, 5, TimeUnit.SECONDS); } public static void sendItems(Player player) { items.clear(); items.add(getRare(1)); // Rare items.add(getCommon(1)); // Common items.add(getSRare()); // Super-Rare items.add(getCommon(2)); // Common items.add(getRare(2)); // Rare items.add(getCommon(3)); // Common items.add(getUnCommon(1)); // UnCommon items.add(getCommon(4)); // Common items.add(getRare(3)); // Rare items.add(getUnCommon(2)); // UnCommon items.add(getCommon(5)); // Com items.add(getUnCommon(3)); // UnCom items.add(getCommon(6)); // Common player.getPackets().sendItems(665, false, items); } public static Item getBox() { Item[] box = items.getItems(); return box[itemWon]; } private static int itemWon; static ItemsContainer<Item> items = new ItemsContainer<Item>(13, true); private static Item[] SUPER_RARE_ITEM = { new Item(995, 200000000), new Item(995, 10000000), new Item(989, 5), new Item(24440, 1), new Item(23716, 1), new Item(23671, 1), new Item(23674) }; private static Item[] RARE_SLOT1 = { new Item(23715), new Item(23679), new Item(23680), new Item(23681), new Item(23682), new Item(23683), new Item(23690) }, RARE_SLOT2 = { new Item(23684), new Item(23685), new Item(23686), new Item(23687), new Item(23688), new Item(23689) }, RARE_SLOT3 = { new Item(23691), new Item(23692), new Item(23693), new Item(23694), new Item(23695), new Item(23696), new Item(23697), new Item(23698), new Item(23699), new Item(23700) }; private static Item[] UNCOMMON_SLOT1 = { new Item(9181), new Item(9183), new Item(857) }, UNCOMMON_SLOT2 = { new Item(1119), new Item(1121), new Item(1123), new Item(1127) }, UNCOMMON_SLOT3 = { new Item(12976), new Item(1133), new Item(23714) }; private static Item[] COMMON_SLOT1 = { new Item(23713), new Item(9177), new Item(9179), new Item(9174) }, COMMON_SLOT2 = { new Item(2, 30), new Item(886, 300) }, COMMON_SLOT3 = { new Item(1515, 15), new Item(444, 20) }, COMMON_SLOT4 = { new Item(563, 40), new Item(843), new Item(1325), new Item(1313), new Item(1361) }, COMMON_SLOT5 = { new Item(1367), new Item(1297), new Item(1327), new Item(1205) }, COMMON_SLOT6 = { new Item(853), new Item(1311), new Item(1365), new Item(1353), new Item(1295), new Item(1325) }; public static Item getSRare() { return SUPER_RARE_ITEM[(int) (Math.random() * SUPER_RARE_ITEM.length)]; } public static Item getRare(int slot) { if (slot == 2) { return RARE_SLOT2[(int) (Math.random() * RARE_SLOT2.length)]; } else if (slot == 3) { return RARE_SLOT3[(int) (Math.random() * RARE_SLOT3.length)]; } else { //System.out.println("" //+ RARE_SLOT1[(int) (Math.random() * RARE_SLOT1.length)]); return RARE_SLOT1[(int) (Math.random() * RARE_SLOT1.length)]; } } public static Item getCommon(int slot) { if (slot == 2) { return COMMON_SLOT1[(int) (Math.random() * COMMON_SLOT1.length)]; } else if (slot == 3) { return COMMON_SLOT2[(int) (Math.random() * COMMON_SLOT2.length)]; } else if (slot == 4) { return COMMON_SLOT3[(int) (Math.random() * COMMON_SLOT3.length)]; } else if (slot == 5) { return COMMON_SLOT4[(int) (Math.random() * COMMON_SLOT4.length)]; } else if (slot == 6) { return COMMON_SLOT5[(int) (Math.random() * COMMON_SLOT5.length)]; } else { return COMMON_SLOT6[(int) (Math.random() * COMMON_SLOT6.length)]; } } public static Item getUnCommon(int slot) { if (slot == 2) { return UNCOMMON_SLOT1[(int) (Math.random() * UNCOMMON_SLOT1.length)]; } else if (slot == 3) { return UNCOMMON_SLOT2[(int) (Math.random() * UNCOMMON_SLOT2.length)]; } else { return UNCOMMON_SLOT3[(int) (Math.random() * UNCOMMON_SLOT3.length)]; } } }[/code] The last problem I have is every weapon says "kick, punch, and block" instead of the proper attacks. All I ask is someone to help please.
  4. Everytime I go to the godwars dungeon, or kbd my client crashes. Even when I spawn the kbd npc it black screens and crashes. This is what it says in the log: [code]Error: sb.q() sb.r() sb.d() rb.hk() fl.hn() aii.hj() fc.gu() client.er() | Class438.method5825 Class438.method5824 Class438.method5833 Class411.method5575 Class135.method1494 Class298_Sub19_Sub3.method3037 Class126.method1407 client.method2806 client.method2773 Class291.method2764 Class291.method2759 Class291.run java.lang.Thread.run | java.lang.NullPointerException | null 2792,5240,104,104 0,2841,5294 2 0 2 765,503 1 2 2 1 0 0 248 0 1535 hAJWGrsaETglRjuwxMwnlA/d5W6EgYWx 6e000000 Error: sb.j() tm.if() fl.hn() aii.hj() fc.gu() client.er() client.ae() mc.m() mc.e() | Class438.method5822 Class473.method6068 Class135.method1494 Class298_Sub19_Sub3.method3037 Class126.method1407 client.method2806 client.method2773 Class291.method2764 Class291.method2759 Class291.run java.lang.Thread.run | java.lang.NullPointerException | 2792,5240,104,104 0,2841,5294 0 0 2 765,503 1 2 2 1 0 0 248 0 1535 hAJWGrsaETglRjuwxMwnlA/d5W6EgYWx error_game_crash[/code] PLEASE HELP!
  5. [quote name='Envo']Ah yea, I see where it came from. I mean you can keep it but I'd personally recommend changing it. It's all up to you though man, good luck with your server make sure to add some images so people know what they're playing and your thread doesn't get deleted.[/QUOTE] I appreciate the thanks and especially how you mentioned the disease. Maybe I'll consider changing it. But for now I need to add some images so I don't end up losing this thread. Thanks a lot Envo.
  6. [quote name='Envo']Your favorite metal bands name came from this [url]http://en.wikipedia.org/wiki/Anthrax[/url] Maybe you should re-name your server as I'm not sure if people will actually like the name, then again most people won't know what it is unless they Google it. I see marketing issues though as when people Google Anthrax the wiki pages and stuff out the disease will show up and not your server.[/QUOTE] It came from this: [url]http://en.wikipedia.org/wiki/Anthrax_(American_band)[/url]
  7. [quote name='Ziek`'][INDENT][b]4.4 Media[/b] [INDENT]Some of the best advertisement comes from in-game images and videos! Unfortunately, due to some people's connection speeds, we must limit the amount of media per thread. Your thread must have: [INDENT]At [b]least[/b] 3 in-game images [b]outside[/b] of spoiler tags and [b]no more[/b] than 20 total images (not including animated GIFs). [b]No more[/b] than 5 animated GIFs. [b]No more[/b] than 2 embedded YouTube videos. All images and GIFs must be uploaded to an [b]external[/b] site, such as Imgur or Photobucket.[/INDENT] [COLOR=red]If this rule is broke, you will receive [b]one[/b] warning before your thread is deleted if the issue is not resolved within 48 hours (2 days).[/COLOR][/INDENT][/INDENT] Also, do you even know what anthrax is?[/QUOTE] Oh wait, so I need pictures? Sorry I didn't know! And of course, my favorite metal band :D
  8. [CENTER][B] [IMG]http://i958.photobucket.com/albums/ae65/Rigsy_2010/cooltext1659643624_zpse7f26623.png[/IMG] [IMG]http://i958.photobucket.com/albums/ae65/Rigsy_2010/cooltext1659644111_zps1eca76ed.png[/IMG] [url]https://www.dropbox.com/s/9nawkdlt9g6v5oc/Anthrax.jar[/url] Ever wanted one of those servers that you can just about do anything? Well you came to the right place! Anthrax RSPS, offers you almost everything. With a few exceptions, Anthrax has one of the most stable RSPS's considering of all its features. Here's a quick glimpse at] some of our features: [IMG]http://i958.photobucket.com/albums/ae65/Rigsy_2010/cooltext1659645960_zpsbd1bdcc9.png[/IMG] [code]- Over 60+ teleports (Bosses, Minigames, Skilling, MORE!) - - 718 loading 742 (ENABLES A LOT MORE THINGS TO DO) - - Dicing (Donators only) - - Plenty of shops (To supply you fully) - - Friendly staff (Always open to suggestions) - - *VPS HOSTED!!!!* (24/7)!!! - - DDoS Protected (Don't even waste your time) - - Posted on multiple status pages = more players - - Prestige System - - Gain points when you gain a skill level (Trade them in for items) - - SOF (Of course) - - Random Events (Such as a Falador battle) - - Trivia - - 100% Working Combat!! - - 3 Donator levels - - All minigames working! (Castle wars, PC, Duel-Arena..etc) - - Daily Updates (To keep you updated and active!) - - Great support! -[/code] [IMG]http://i958.photobucket.com/albums/ae65/Rigsy_2010/cooltext1659644111_zps1eca76ed.png[/IMG] [url]https://www.dropbox.com/s/9nawkdlt9g6v5oc/Anthrax.jar[/url] Upcoming Updates: - Dicing for regular players - - Better SOF Prizes - [IMG]http://i958.photobucket.com/albums/ae65/Rigsy_2010/cooltext1659643937_zps1d699032.png[/IMG] [IMG]http://i958.photobucket.com/albums/ae65/Rigsy_2010/Untitled2_zps5bf0cbb0.png[/IMG] [IMG]http://i958.photobucket.com/albums/ae65/Rigsy_2010/Untitled3_zps4d78c5e9.png[/IMG] [IMG]http://i958.photobucket.com/albums/ae65/Rigsy_2010/Untitled_zpscc7e357e.png[/IMG] [IMG]http://gyazo.com/a43c74a9021355dfe4784cdd56e593c3.png[/IMG] [IMG]http://gyazo.com/20c586b39a8f07f6f2502dfc1d1934d6.png[/IMG] [IMG]http://gyazo.com/0afb3066d217c64913e32e5f20059a26.png[/IMG] [IMG]http://gyazo.com/c1971f3995ac7f4d22c75b8c8dfc9ff1.png[/IMG] [IMG]http://gyazo.com/e2a37951133ebc9d5d12425a86160a93.png[/IMG] [IMG]http://gyazo.com/bb49ecef5d770538e5324458fc8da563.png[/IMG] [IMG]http://gyazo.com/2d8d751def3c5e053fce6f45d6d242f6.png[/IMG] [IMG]http://gyazo.com/ba344a0108b3b1cbc2820843067db1dd.png[/IMG] [IMG]http://gyazo.com/b71c184677f283ed8bc2e69c60c3f8ce.png[/IMG] [IMG]http://gyazo.com/f74de042d981be9d3f4a0edec01b1317.png[/IMG] [IMG]http://gyazo.com/7c51cbdee36f6e37173532bf46d59379.png[/IMG] [IMG]http://gyazo.com/8eabfc535a1428cdf50431a87599bc01.png[/IMG] [IMG]http://gyazo.com/b4c71a32473cfdbad670949c20a907cc.png[/IMG] [IMG]http://gyazo.com/7a793673607e56516ff81f588a81ccc9.png[/IMG] [IMG]http://gyazo.com/3c97ce1f49c07bae9a3daf11230e332e.png[/IMG] [IMG]http://gyazo.com/5b768c1ba41b95137b43f275a16da1cc.png[/IMG] [IMG]http://gyazo.com/82c51dc3760ca5c95c67970d0df2514e.png[/IMG] [IMG]http://gyazo.com/248097fb4d649444e2d7d99f9da7f8c0.png[/IMG] [IMG]http://gyazo.com/66a468ab940c6829b0ef70015ad1bfe0.png[/IMG][/B][/CENTER]
  9. I'm not sure how on earth this money pouch is giving people max cash, but they've told me it's giving them max cash and I have checked their bank and seen max cash. Other than that, the money pouch is defected and not working properly. And I can't figure out why. Here's my InventoryOptionsHandler.java: [code]package com.rs.net.decoders.handlers; //import com.rs.game.player.ClueScrolls; import java.util.List; import com.rs.game.player.content.TreasureTrails; import com.rs.Settings; import com.rs.cores.WorldThread; import com.rs.game.Animation; import com.rs.game.Graphics; import com.rs.game.World; import com.rs.game.WorldTile; import com.rs.game.item.Item; import com.rs.game.minigames.CrystalChest; import com.rs.game.minigames.RandomEventGift; import com.rs.game.npc.NPC; import com.rs.game.npc.familiar.Familiar.SpecialAttack; import com.rs.game.npc.pet.Pet; import com.rs.game.player.ClueScrolls; import com.rs.game.player.CoordsEvent; import com.rs.game.player.Equipment; import com.rs.game.player.Inventory; import com.rs.game.player.Player; import com.rs.game.player.Skills; import com.rs.game.player.content.LividFarm; import com.rs.game.player.actions.BoxAction; import com.rs.game.player.actions.BoxAction.HunterEquipment; import com.rs.game.player.actions.Firemaking; import com.rs.game.player.actions.Fletching; import com.rs.game.player.actions.Fletching.Fletch; import com.rs.game.player.actions.GemCutting; import com.rs.game.player.actions.GemCutting.Gem; import com.rs.game.player.actions.HerbCleaning; import com.rs.game.player.actions.Herblore; import com.rs.game.player.actions.LeatherCrafting; import com.rs.game.player.actions.Summoning; import com.rs.game.player.actions.Summoning.Pouches; import com.rs.game.player.content.AncientEffigies; import com.rs.game.player.content.ArmourSets; import com.rs.game.player.content.ArmourSets.Sets; import com.rs.game.player.content.Burying.Bone; import com.rs.game.player.content.Dicing; import com.rs.game.player.content.Foods; import com.rs.game.player.content.Magic; import com.rs.game.player.content.Pots; import com.rs.game.player.content.Runecrafting; import com.rs.game.player.content.SkillCapeCustomizer; import com.rs.game.player.controlers.Barrows; import com.rs.game.player.controlers.FightKiln; import com.rs.game.tasks.WorldTask; import com.rs.game.tasks.WorldTasksManager; import com.rs.io.InputStream; import com.rs.utils.Logger; import com.rs.utils.Utils; public class InventoryOptionsHandler { public static void handleItemOption2(final Player player, final int slotId, final int itemId, Item item) { if (Firemaking.isFiremaking(player, itemId)) return; if (itemId >= 5509 && itemId <= 5514) { int pouch = -1; if (itemId == 5509) pouch = 0; if (itemId == 5510) pouch = 1; if (itemId == 5512) pouch = 2; if (itemId == 5514) pouch = 3; Runecrafting.emptyPouch(player, pouch); player.stopAll(false); } else if (itemId >= 15086 && itemId <= 15100) { Dicing.handleRoll(player, itemId, true); return; } else { if (player.isEquipDisabled()) return; long passedTime = Utils.currentTimeMillis() - WorldThread.LAST_CYCLE_CTM; WorldTasksManager.schedule(new WorldTask() { [MENTION=15855]Over[/MENTION]ride public void run() { List<Integer> slots = player.getSwitchItemCache(); int[] slot = new int[slots.size()]; for (int i = 0; i < slot.length; i++) slot[i] = slots.get(i); player.getSwitchItemCache().clear(); ButtonHandler.sendWear(player, slot); player.stopAll(false, true, false); } }, passedTime >= 600 ? 0 : passedTime > 330 ? 1 : 0); if (player.getSwitchItemCache().contains(slotId)) return; player.getSwitchItemCache().add(slotId); } } public static void dig(final Player player) { player.resetWalkSteps(); player.setNextAnimation(new Animation(830)); player.lock(); WorldTasksManager.schedule(new WorldTask() { [MENTION=15855]Over[/MENTION]ride public void run() { player.unlock(); if (Barrows.digIntoGrave(player)) return; if(player.getX() == 3005 && player.getY() == 3376 || player.getX() == 2999 && player.getY() == 3375 || player.getX() == 2996 && player.getY() == 3377 || player.getX() == 2989 && player.getY() == 3378 || player.getX() == 2987 && player.getY() == 3387 || player.getX() == 2984 && player.getY() == 3387) { //mole player.setNextWorldTile(new WorldTile(1752, 5137, 0)); player.getPackets().sendGameMessage("You seem to have dropped down into a network of mole tunnels."); return; } if (ClueScrolls.digSpot(player)){ return; } player.getPackets().sendGameMessage("You find nothing."); } }); } public static void handleItemOption1(Player player, final int slotId, final int itemId, Item item) { long time = Utils.currentTimeMillis(); if (player.getLockDelay() >= time || player.getEmotesManager().getNextEmoteEnd() >= time) return; player.stopAll(false); if (Foods.eat(player, item, slotId)) return; if (itemId >= 15086 && itemId <= 15100) { Dicing.handleRoll(player, itemId, false); return; } if (itemId == 6) //Cannon player.getDwarfCannon().checkLocation(); if (itemId == 20494) {//Gold Cannon if (player.isDonator()) { player.getDwarfCannon().checkGoldLocation(); } else { player.sm("You must be an Extreme Donator to set up a Royal Cannon."); } } if (itemId == 20498) {//Royal Cannon if (player.isExtremeDonator()) { player.getDwarfCannon().checkRoyalLocation(); } else { player.sm("You must be an Extreme Donator to set up a Royal Cannon."); } } if (itemId == 20667) { Magic.VecnaSkull(player); } if (Pots.pot(player, item, slotId)) return; if (itemId == 2677) { TreasureTrails.handleClues(player); } if (itemId == 2678) { TreasureTrails.handleClues1(player); } if (itemId == 2679) { TreasureTrails.handleClues2(player); } if (itemId >= 5509 && itemId <= 5514) { int pouch = -1; if (itemId == 5509) pouch = 0; if (itemId == 5510) pouch = 1; if (itemId == 5512) pouch = 2; if (itemId == 5514) pouch = 3; Runecrafting.fillPouch(player, pouch); return; } if (itemId == 22370) { Summoning.openDreadnipInterface(player); } if (itemId == 6950) { player.getDialogueManager().startDialogue("LividOrb"); } if (itemId == 20704) { LividFarm.bunchPlants(player); } if (itemId == 10846) { player.getDialogueManager().startDialogue("PrizeOptions"); } if (itemId == 10847) { player.getDialogueManager().startDialogue("PrizeOptions"); } if (itemId == 10845) { player.getDialogueManager().startDialogue("PrizeOptions"); } if (itemId == 10844) { player.getDialogueManager().startDialogue("PrizeOptions"); } if (itemId == 2689) { player.getDialogueManager().startDialogue("ExtremeDonatorPanel"); } if (itemId == 952) {// spade dig(player); return; } for (int i: ClueScrolls.ScrollIds){ if (itemId == i){ if (ClueScrolls.Scrolls.getMap(itemId) != null){ ClueScrolls.showMap(player, ClueScrolls.Scrolls.getMap(itemId)); return; } if (ClueScrolls.Scrolls.getObjMap(itemId) != null){ ClueScrolls.showObjectMap(player, ClueScrolls.Scrolls.getObjMap(itemId)); return; } if (ClueScrolls.Scrolls.getRiddles(itemId) != null){ ClueScrolls.showRiddle(player, ClueScrolls.Scrolls.getRiddles(itemId)); return; } } } if (itemId == 2717){ ClueScrolls.giveReward(player); } if (HerbCleaning.clean(player, item, slotId)) return; Bone bone = Bone.forId(itemId); if (bone != null) { Bone.bury(player, slotId); return; } if (Magic.useTabTeleport(player, itemId)) return; if (itemId == AncientEffigies.SATED_ANCIENT_EFFIGY || itemId == AncientEffigies.GORGED_ANCIENT_EFFIGY || itemId == AncientEffigies.NOURISHED_ANCIENT_EFFIGY || itemId == AncientEffigies.STARVED_ANCIENT_EFFIGY) player.getDialogueManager().startDialogue("AncientEffigiesD", itemId); else if (itemId == 4155) player.getDialogueManager().startDialogue("EnchantedGemDialouge"); else if (itemId == 611) player.getLocationCrystal().handleClick(); else if (itemId == 6183) RandomEventGift.openGift(player); else if (itemId == 23749) { player.getSkills().addXp(Skills.DUNGEONEERING, 20); player.getInventory().deleteItem(23749, 1); } else if (itemId == 23750) { player.getSkills().addXp(Skills.DUNGEONEERING, 125); player.getInventory().deleteItem(23750, 1); } else if (itemId == 24155) { // Double Spin ticket player.getPackets().sendGameMessage("You opened your spin ticket and got two spins."); player.setSpins(player.getSpins() + 2); player.getPackets().sendIComponentText(1139, 10, " "+ player.getSpins() +" "); player.getInventory().deleteItem(24155, 1); } else if (itemId == 24154) { // Spin ticket player.getPackets().sendGameMessage("You opened your spin ticket and got one spin."); player.setSpins(player.getSpins() + 1); player.getPackets().sendIComponentText(1139, 10, " "+ player.getSpins() +" "); player.getInventory().deleteItem(24154, 1); } else if (itemId == 23717) { player.getSkills().addXp(Skills.ATTACK, 2500); player.getInventory().deleteItem(23717, 1); } else if (itemId == 23721) { player.getSkills().addXp(Skills.STRENGTH, 2500); player.getInventory().deleteItem(23721, 1); } else if (itemId == 23725) { player.getSkills().addXp(Skills.DEFENCE, 2500); player.getInventory().deleteItem(23725, 1); } else if (itemId == 23729) { player.getSkills().addXp(Skills.RANGE, 2500); player.getInventory().deleteItem(23729, 1); } else if (itemId == 23733) { player.getSkills().addXp(Skills.MAGIC, 2500); player.getInventory().deleteItem(23733, 1); } else if (itemId == 23737) { player.getSkills().addXp(Skills.PRAYER, 2500); player.getInventory().deleteItem(23737, 1); } else if (itemId == 23741) { player.getSkills().addXp(Skills.RUNECRAFTING, 2500); player.getInventory().deleteItem(23741, 1); } else if (itemId == 23745) { player.getSkills().addXp(Skills.CONSTRUCTION, 2500); player.getInventory().deleteItem(23745, 1); } else if (itemId == 23749) { player.getSkills().addXp(Skills.DUNGEONEERING, 2500); player.getInventory().deleteItem(23749, 1); } else if (itemId == 23753) { player.getSkills().addXp(Skills.HITPOINTS, 2500); player.getInventory().deleteItem(23753, 1); } else if (itemId == 23757) { player.getSkills().addXp(Skills.AGILITY, 2500); player.getInventory().deleteItem(23757, 1); } else if (itemId == 23761) { player.getSkills().addXp(Skills.HERBLORE, 2500); player.getInventory().deleteItem(23761, 1); } else if (itemId == 23765) { player.getSkills().addXp(Skills.THIEVING, 2500); player.getInventory().deleteItem(23765, 1); } else if (itemId == 23769) { player.getSkills().addXp(Skills.CRAFTING, 2500); player.getInventory().deleteItem(23769, 1); } else if (itemId == 23774) { player.getSkills().addXp(Skills.FLETCHING, 2500); player.getInventory().deleteItem(23774, 1); } else if (itemId == 23778) { player.getSkills().addXp(Skills.SLAYER, 2500); player.getInventory().deleteItem(23778, 1); } else if (itemId == 23782) { player.getSkills().addXp(Skills.HUNTER, 2500); player.getInventory().deleteItem(23782, 1); } else if (itemId == 23786) { player.getSkills().addXp(Skills.MINING, 2500); player.getInventory().deleteItem(23786, 1); } else if (itemId == 23790) { player.getSkills().addXp(Skills.SMITHING, 2500); player.getInventory().deleteItem(23790, 1); } else if (itemId == 23794) { player.getSkills().addXp(Skills.FISHING, 2500); player.getInventory().deleteItem(23794, 1); } else if (itemId == 23798) { player.getSkills().addXp(Skills.COOKING, 2500); player.getInventory().deleteItem(23798, 1); } else if (itemId == 23802) { player.getSkills().addXp(Skills.FIREMAKING, 2500); player.getInventory().deleteItem(23802, 1); } else if (itemId == 23806) { player.getSkills().addXp(Skills.WOODCUTTING, 2500); player.getInventory().deleteItem(23806, 1); } else if (itemId == 23810) { player.getSkills().addXp(Skills.FARMING, 2500); player.getInventory().deleteItem(23810, 1); } else if (itemId == 23814) { player.getSkills().addXp(Skills.SUMMONING, 2500); player.getInventory().deleteItem(23814, 1); } else if (itemId == 23718) { player.getSkills().addXp(Skills.ATTACK, 5000); player.getInventory().deleteItem(23718, 1); } else if (itemId == 23722) { player.getSkills().addXp(Skills.STRENGTH, 5000); player.getInventory().deleteItem(23722, 1); } else if (itemId == 23726) { player.getSkills().addXp(Skills.DEFENCE, 5000); player.getInventory().deleteItem(23726, 1); } else if (itemId == 23730) { player.getSkills().addXp(Skills.RANGE, 5000); player.getInventory().deleteItem(23730, 1); } else if (itemId == 23734) { player.getSkills().addXp(Skills.MAGIC, 5000); player.getInventory().deleteItem(23734, 1); } else if (itemId == 23738) { player.getSkills().addXp(Skills.PRAYER, 5000); player.getInventory().deleteItem(23738, 1); } else if (itemId == 23742) { player.getSkills().addXp(Skills.RUNECRAFTING, 5000); player.getInventory().deleteItem(23742, 1); } else if (itemId == 23746) { player.getSkills().addXp(Skills.CONSTRUCTION, 5000); player.getInventory().deleteItem(23746, 1); } else if (itemId == 23750) { player.getSkills().addXp(Skills.DUNGEONEERING, 5000); player.getInventory().deleteItem(23750, 1); } else if (itemId == 23754) { player.getSkills().addXp(Skills.HITPOINTS, 5000); player.getInventory().deleteItem(23754, 1); } else if (itemId == 23758) { player.getSkills().addXp(Skills.AGILITY, 5000); player.getInventory().deleteItem(23758, 1); } else if (itemId == 23762) { player.getSkills().addXp(Skills.HERBLORE, 5000); player.getInventory().deleteItem(23762, 1); } else if (itemId == 23766) { player.getSkills().addXp(Skills.THIEVING, 5000); player.getInventory().deleteItem(23766, 1); } else if (itemId == 23770) { player.getSkills().addXp(Skills.CRAFTING, 5000); player.getInventory().deleteItem(23770, 1); } else if (itemId == 23775) { player.getSkills().addXp(Skills.FLETCHING, 5000); player.getInventory().deleteItem(23775, 1); } else if (itemId == 23779) { player.getSkills().addXp(Skills.SLAYER, 5000); player.getInventory().deleteItem(23779, 1); } else if (itemId == 23783) { player.getSkills().addXp(Skills.HUNTER, 5000); player.getInventory().deleteItem(23783, 1); } else if (itemId == 23787) { player.getSkills().addXp(Skills.MINING, 5000); player.getInventory().deleteItem(23787, 1); } else if (itemId == 23791) { player.getSkills().addXp(Skills.SMITHING, 5000); player.getInventory().deleteItem(23791, 1); } else if (itemId == 23795) { player.getSkills().addXp(Skills.FISHING, 5000); player.getInventory().deleteItem(23795, 1); } else if (itemId == 23799) { player.getSkills().addXp(Skills.COOKING, 5000); player.getInventory().deleteItem(23799, 1); } else if (itemId == 23803) { player.getSkills().addXp(Skills.FIREMAKING, 5000); player.getInventory().deleteItem(23803, 1); } else if (itemId == 23807) { player.getSkills().addXp(Skills.WOODCUTTING, 5000); player.getInventory().deleteItem(23807, 1); } else if (itemId == 23811) { player.getSkills().addXp(Skills.FARMING, 5000); player.getInventory().deleteItem(23811, 1); } else if (itemId == 23815) { player.getSkills().addXp(Skills.SUMMONING, 5000); player.getInventory().deleteItem(23815, 1); } else if (itemId == 23719) { player.getSkills().addXp(Skills.ATTACK, 7500); player.getInventory().deleteItem(23719, 1); } else if (itemId == 23723) { player.getSkills().addXp(Skills.STRENGTH, 7500); player.getInventory().deleteItem(23723, 1); } else if (itemId == 23727) { player.getSkills().addXp(Skills.DEFENCE, 7500); player.getInventory().deleteItem(23727, 1); } else if (itemId == 23731) { player.getSkills().addXp(Skills.RANGE, 7500); player.getInventory().deleteItem(23731, 1); } else if (itemId == 23735) { player.getSkills().addXp(Skills.MAGIC, 7500); player.getInventory().deleteItem(23735, 1); } else if (itemId == 23739) { player.getSkills().addXp(Skills.PRAYER, 7500); player.getInventory().deleteItem(23739, 1); } else if (itemId == 23743) { player.getSkills().addXp(Skills.RUNECRAFTING, 7500); player.getInventory().deleteItem(23743, 1); } else if (itemId == 23747) { player.getSkills().addXp(Skills.CONSTRUCTION, 7500); player.getInventory().deleteItem(23747, 1); } else if (itemId == 23751) { player.getSkills().addXp(Skills.DUNGEONEERING, 7500); player.getInventory().deleteItem(23751, 1); } else if (itemId == 23755) { player.getSkills().addXp(Skills.HITPOINTS, 7500); player.getInventory().deleteItem(23755, 1); } else if (itemId == 23759) { player.getSkills().addXp(Skills.AGILITY, 7500); player.getInventory().deleteItem(23759, 1); } else if (itemId == 23763) { player.getSkills().addXp(Skills.HERBLORE, 7500); player.getInventory().deleteItem(23763, 1); } else if (itemId == 23767) { player.getSkills().addXp(Skills.THIEVING, 7500); player.getInventory().deleteItem(23767, 1); } else if (itemId == 23771) { player.getSkills().addXp(Skills.CRAFTING, 7500); player.getInventory().deleteItem(23771, 1); } else if (itemId == 23776) { player.getSkills().addXp(Skills.FLETCHING, 7500); player.getInventory().deleteItem(23776, 1); } else if (itemId == 23780) { player.getSkills().addXp(Skills.SLAYER, 7500); player.getInventory().deleteItem(23780, 1); } else if (itemId == 23784) { player.getSkills().addXp(Skills.HUNTER, 7500); player.getInventory().deleteItem(23784, 1); } else if (itemId == 23788) { player.getSkills().addXp(Skills.MINING, 7500); player.getInventory().deleteItem(23788, 1); } else if (itemId == 23792) { player.getSkills().addXp(Skills.SMITHING, 7500); player.getInventory().deleteItem(23792, 1); } else if (itemId == 23796) { player.getSkills().addXp(Skills.FISHING, 7500); player.getInventory().deleteItem(23796, 1); } else if (itemId == 23800) { player.getSkills().addXp(Skills.COOKING, 7500); player.getInventory().deleteItem(23800, 1); } else if (itemId == 23804) { player.getSkills().addXp(Skills.FIREMAKING, 7500); player.getInventory().deleteItem(23804, 1); } else if (itemId == 23808) { player.getSkills().addXp(Skills.WOODCUTTING, 7500); player.getInventory().deleteItem(23808, 1); } else if (itemId == 23812) { player.getSkills().addXp(Skills.FARMING, 7500); player.getInventory().deleteItem(23812, 1); } else if (itemId == 23816) { player.getSkills().addXp(Skills.SUMMONING, 7500); player.getInventory().deleteItem(23816, 1); } else if (itemId == 23720) { player.getSkills().addXp(Skills.ATTACK, 10000); player.getInventory().deleteItem(23720, 1); } else if (itemId == 23724) { player.getSkills().addXp(Skills.STRENGTH, 10000); player.getInventory().deleteItem(23724, 1); } else if (itemId == 23728) { player.getSkills().addXp(Skills.DEFENCE, 10000); player.getInventory().deleteItem(23728, 1); } else if (itemId == 23732) { player.getSkills().addXp(Skills.RANGE, 10000); player.getInventory().deleteItem(23732, 1); } else if (itemId == 23736) { player.getSkills().addXp(Skills.MAGIC, 10000); player.getInventory().deleteItem(23736, 1); } else if (itemId == 23740) { player.getSkills().addXp(Skills.PRAYER, 10000); player.getInventory().deleteItem(23740, 1); } else if (itemId == 23744) { player.getSkills().addXp(Skills.RUNECRAFTING, 10000); player.getInventory().deleteItem(23744, 1); } else if (itemId == 23748) { player.getSkills().addXp(Skills.CONSTRUCTION, 10000); player.getInventory().deleteItem(23748, 1); } else if (itemId == 23752) { player.getSkills().addXp(Skills.DUNGEONEERING, 10000); player.getInventory().deleteItem(23752, 1); } else if (itemId == 23756) { player.getSkills().addXp(Skills.HITPOINTS, 10000); player.getInventory().deleteItem(23756, 1); } else if (itemId == 23760) { player.getSkills().addXp(Skills.AGILITY, 10000); player.getInventory().deleteItem(23760, 1); } else if (itemId == 23764) { player.getSkills().addXp(Skills.HERBLORE, 10000); player.getInventory().deleteItem(23764, 1); } else if (itemId == 23768) { player.getSkills().addXp(Skills.THIEVING, 10000); player.getInventory().deleteItem(23768, 1); } else if (itemId == 23772) { player.getSkills().addXp(Skills.CRAFTING, 10000); player.getInventory().deleteItem(23772, 1); } else if (itemId == 23777) { player.getSkills().addXp(Skills.FLETCHING, 10000); player.getInventory().deleteItem(23777, 1); } else if (itemId == 23781) { player.getSkills().addXp(Skills.SLAYER, 10000); player.getInventory().deleteItem(23781, 1); } else if (itemId == 23785) { player.getSkills().addXp(Skills.HUNTER, 10000); player.getInventory().deleteItem(23785, 1); } else if (itemId == 23789) { player.getSkills().addXp(Skills.MINING, 10000); player.getInventory().deleteItem(23789, 1); } else if (itemId == 23793) { player.getSkills().addXp(Skills.SMITHING, 10000); player.getInventory().deleteItem(23793, 1); } else if (itemId == 23797) { player.getSkills().addXp(Skills.FISHING, 10000); player.getInventory().deleteItem(23797, 1); } else if (itemId == 23801) { player.getSkills().addXp(Skills.COOKING, 10000); player.getInventory().deleteItem(23801, 1); } else if (itemId == 23805) { player.getSkills().addXp(Skills.FIREMAKING, 10000); player.getInventory().deleteItem(23805, 1); } else if (itemId == 23809) { player.getSkills().addXp(Skills.WOODCUTTING, 10000); player.getInventory().deleteItem(23809, 1); } else if (itemId == 23813) { player.getSkills().addXp(Skills.FARMING, 10000); player.getInventory().deleteItem(23813, 1); } else if (itemId == 23817) { player.getSkills().addXp(Skills.SUMMONING, 10000); player.getInventory().deleteItem(23817, 1); } else if (itemId == 24300) { player.getSkills().addXp(Skills.ATTACK, 2000000); player.getSkills().addXp(Skills.STRENGTH, 2000000); player.getSkills().addXp(Skills.DEFENCE, 200000); player.getSkills().addXp(Skills.RANGE, 200000); player.getSkills().addXp(Skills.MAGIC, 200000); player.getSkills().addXp(Skills.PRAYER, 200000); player.getSkills().addXp(Skills.RUNECRAFTING, 200000); player.getSkills().addXp(Skills.CONSTRUCTION, 200000); player.getSkills().addXp(Skills.DUNGEONEERING, 200000); player.getSkills().addXp(Skills.HITPOINTS, 200000); player.getSkills().addXp(Skills.AGILITY, 200000); player.getSkills().addXp(Skills.HERBLORE, 200000); player.getSkills().addXp(Skills.THIEVING, 200000); player.getSkills().addXp(Skills.CRAFTING, 200000); player.getSkills().addXp(Skills.FLETCHING, 200000); player.getSkills().addXp(Skills.SLAYER, 200000); player.getSkills().addXp(Skills.HUNTER, 200000); player.getSkills().addXp(Skills.MINING, 200000); player.getSkills().addXp(Skills.SMITHING, 200000); player.getSkills().addXp(Skills.FISHING, 200000); player.getSkills().addXp(Skills.COOKING, 200000); player.getSkills().addXp(Skills.FIREMAKING, 200000); player.getSkills().addXp(Skills.WOODCUTTING, 200000); player.getSkills().addXp(Skills.FARMING, 200000); player.getSkills().addXp(Skills.SUMMONING, 200000); player.getInventory().deleteItem(24300, 1); } else if (itemId >= 23653 && itemId <= 23658) FightKiln.useCrystal(player, itemId); else if (itemId == 7681) {// Information Book player.getInterfaceManager().sendInterface(275); for (int i = 0; i < 100; i++) { player.getPackets().sendIComponentText(275, i, ""); }player.getPackets().sendIComponentText(275, 1, Settings.SERVER_NAME+" Quest Information!"); player.getPackets().sendIComponentText(275, 10, "What Are Quests?"); player.getPackets().sendIComponentText(275, 11, "___________"); player.getPackets().sendIComponentText(275, 12, "Quests are Adventures you can go on,"); player.getPackets().sendIComponentText(275, 13, "and when completed you can earn, special"); player.getPackets().sendIComponentText(275, 14, "items or even gold. Some are easy some are"); player.getPackets().sendIComponentText(275, 15, "hard. We want our players to always have fun, if"); player.getPackets().sendIComponentText(275, 16, "you need any help on a quest refer to the quest guide"); player.getPackets().sendIComponentText(275, 17, "for a book that will help you complete the quest available!"); player.getPackets().sendIComponentText(275, 18, "___________"); player.getPackets().sendIComponentText(275, 19, "Quests Available"); player.getPackets().sendIComponentText(275, 20, "___________"); player.getPackets().sendIComponentText(275, 21, "Meet me in the sky"); player.getPackets().sendIComponentText(275, 22, "-_-_-_-_-_-_-_-"); player.getPackets().sendIComponentText(275, 23, "Dragon Killer"); player.getPackets().sendIComponentText(275, 24, "-_-_-_-_-_-_-_-"); player.getPackets().sendIComponentText(275, 25, "Kill the Robber"); player.getPackets().sendIComponentText(275, 26, "-_-_-_-_-_-_-_-"); player.getPackets().sendIComponentText(275, 27, "Get the Meat Pie"); player.getPackets().sendIComponentText(275, 28, "-_-_-_-_-_-_-_-"); player.getPackets().sendIComponentText(275, 29, "Demons are here"); player.getPackets().sendIComponentText(275, 30, "-_-_-_-_-_-_-_-"); player.getPackets().sendIComponentText(275, 31, "Kalphite Gold"); player.getPackets().sendIComponentText(275, 32, "-_-_-_-_-_-_-_-"); player.getPackets().sendIComponentText(275, 33, "StarWars"); player.getPackets().sendIComponentText(275, 34, "-_-_-_-_-_-_-_-"); player.getPackets().sendIComponentText(275, 35, "Blood Trader"); player.getPackets().sendIComponentText(275, 36, "-_-_-_-_-_-_-_-"); player.getPackets().sendIComponentText(275, 37, "Dwarven Cake"); } else if (itemId == HunterEquipment.BOX.getId()) // almost done player.getActionManager().setAction(new BoxAction(HunterEquipment.BOX)); else if (itemId == HunterEquipment.BRID_SNARE.getId()) player.getActionManager().setAction( new BoxAction(HunterEquipment.BRID_SNARE)); else if (item.getDefinitions().getName().startsWith("Burnt")) player.getDialogueManager().startDialogue("SimplePlayerMessage", "Ugh, this is inedible."); if (Settings.DEBUG) Logger.log("ItemHandler", "Item Select:" + itemId + ", Slot Id:" + slotId); } /* * returns the other */ public static Item contains(int id1, Item item1, Item item2) { if (item1.getId() == id1) return item2; if (item2.getId() == id1) return item1; return null; } public static boolean contains(int id1, int id2, Item... items) { boolean containsId1 = false; boolean containsId2 = false; for (Item item : items) { if (item.getId() == id1) containsId1 = true; else if (item.getId() == id2) containsId2 = true; } return containsId1 && containsId2; } public static void handleItemOnItem(final Player player, InputStream stream) { int itemUsedWithId = stream.readShort(); int toSlot = stream.readShortLE128(); int interfaceId = stream.readInt() >> 16; int interfaceId2 = stream.readInt() >> 16; int fromSlot = stream.readShort(); int itemUsedId = stream.readShortLE128(); if ((interfaceId2 == 747 || interfaceId2 == 662) && interfaceId == Inventory.INVENTORY_INTERFACE) { if (player.getFamiliar() != null) { player.getFamiliar().setSpecial(true); if (player.getFamiliar().getSpecialAttack() == SpecialAttack.ITEM) { if (player.getFamiliar().hasSpecialOn()) player.getFamiliar().submitSpecial(toSlot); } } return; } if (interfaceId == Inventory.INVENTORY_INTERFACE && interfaceId == interfaceId2 && !player.getInterfaceManager().containsInventoryInter()) { if (toSlot >= 28 || fromSlot >= 28) return; Item usedWith = player.getInventory().getItem(toSlot); Item itemUsed = player.getInventory().getItem(fromSlot); if (itemUsed == null || usedWith == null || itemUsed.getId() != itemUsedId || usedWith.getId() != itemUsedWithId) return; player.stopAll(); if (itemUsed.getId() == CrystalChest.toothHalf() && usedWith.getId() == CrystalChest.loopHalf() || itemUsed.getId() == CrystalChest.loopHalf() && usedWith.getId() == CrystalChest.toothHalf()){ CrystalChest.makeKey(player); return; } if (!player.getControlerManager().canUseItemOnItem(itemUsed, usedWith)) return; Fletch fletch = Fletching.isFletching(usedWith, itemUsed); if (fletch != null) { player.getDialogueManager().startDialogue("FletchingD", fletch); return; } int herblore = Herblore.isHerbloreSkill(itemUsed, usedWith); if (herblore > -1) { player.getDialogueManager().startDialogue("HerbloreD", herblore, itemUsed, usedWith); return; } if (itemUsed.getId() == LeatherCrafting.NEEDLE.getId() || usedWith.getId() == LeatherCrafting.NEEDLE.getId()) { if (LeatherCrafting .handleItemOnItem(player, itemUsed, usedWith)) { return; } } Sets set = ArmourSets.getArmourSet(itemUsedId, itemUsedWithId); if (set != null) { ArmourSets.exchangeSets(player, set); return; } if (Firemaking.isFiremaking(player, itemUsed, usedWith)) return; else if (contains(1755, Gem.OPAL.getUncut(), itemUsed, usedWith)) GemCutting.cut(player, Gem.OPAL); else if (contains(1755, Gem.JADE.getUncut(), itemUsed, usedWith)) GemCutting.cut(player, Gem.JADE); else if (contains(1755, Gem.RED_TOPAZ.getUncut(), itemUsed, usedWith)) GemCutting.cut(player, Gem.RED_TOPAZ); else if (contains(1755, Gem.SAPPHIRE.getUncut(), itemUsed, usedWith)) GemCutting.cut(player, Gem.SAPPHIRE); else if (contains(1755, Gem.EMERALD.getUncut(), itemUsed, usedWith)) GemCutting.cut(player, Gem.EMERALD); else if (contains(1755, Gem.RUBY.getUncut(), itemUsed, usedWith)) GemCutting.cut(player, Gem.RUBY); else if (contains(1755, Gem.DIAMOND.getUncut(), itemUsed, usedWith)) GemCutting.cut(player, Gem.DIAMOND); else if (contains(1755, Gem.DRAGONSTONE.getUncut(), itemUsed, usedWith)) GemCutting.cut(player, Gem.DRAGONSTONE); else if (itemUsed.getId() == 13734 && usedWith.getId() == 13754){ player.getInventory().deleteItem(13734, 1); player.getInventory().deleteItem(13754, 1); player.getInventory().addItem(13736, 1); player.getPackets().sendGameMessage("You have poured the holy elixir on a spirit shield making it unleash Blessed powers."); } else if (itemUsed.getId() == 13754 && usedWith.getId() == 13734){ player.getInventory().deleteItem(13734, 1); player.getInventory().deleteItem(13754, 1); player.getInventory().addItem(13736, 1); player.getPackets().sendGameMessage("You have poured the holy elixir on a spirit shield making it unleash Blessed powers."); } else if (itemUsed.getId() == 13736 && usedWith.getId() == 13748){ player.getInventory().deleteItem(13736, 1); player.getInventory().deleteItem(13748, 1); player.getInventory().addItem(13740, 1); player.getPackets().sendGameMessage("You force the sigil upon the blessed spirit shield making it unleash Divine Powers."); } else if (itemUsed.getId() == 13736 && usedWith.getId() == 13750){ player.getInventory().deleteItem(13736, 1); player.getInventory().deleteItem(13750, 1); player.getInventory().addItem(13742, 1); player.getPackets().sendGameMessage("You force the sigil upon the blessed spirit shield making it unleash Elysian Powers."); } else if (itemUsed.getId() == 13736 && usedWith.getId() == 13746){ player.getInventory().deleteItem(13736, 1); player.getInventory().deleteItem(13746, 1); player.getInventory().addItem(13738, 1); player.getPackets().sendGameMessage("You force the sigil upon the blessed spirit shield making it unleash Arcane Powers."); } else if (itemUsed.getId() == 13746 && usedWith.getId() == 13736){ player.getInventory().deleteItem(13736, 1); player.getInventory().deleteItem(13746, 1); player.getInventory().addItem(13738, 1); player.getPackets().sendGameMessage("You force the sigil upon the blessed spirit shield making it unleash Arcane Powers."); } else if (itemUsed.getId() == 13736 && usedWith.getId() == 13752){ player.getInventory().deleteItem(13736, 1); player.getInventory().deleteItem(13752, 1); player.getInventory().addItem(13744, 1); player.getPackets().sendGameMessage("You force the sigil upon the blessed spirit shield making it unleash Spectral Powers."); } else if (itemUsed.getId() == 13752 && usedWith.getId() == 13736){ player.getInventory().deleteItem(13736, 1); player.getInventory().deleteItem(13752, 1); player.getInventory().addItem(13744, 1); player.getPackets().sendGameMessage("You force the sigil upon the blessed spirit shield making it unleash Spectral Powers."); } else if (itemUsed.getId() == 1540 && usedWith.getId() == 11286){ player.getInventory().deleteItem(1540, 1); player.getInventory().deleteItem(11286, 1); player.getInventory().addItem(11283, 1); player.getPackets().sendGameMessage("Congratulations You have made a Dragonfire Shield."); } else if (itemUsed.getId() == 11286 && usedWith.getId() == 1540){ player.getInventory().deleteItem(11286, 1); player.getInventory().deleteItem(1540, 1); player.getInventory().addItem(11283, 1); player.getPackets().sendGameMessage("Congratulations You have made a Dragonfire Shield."); } if (itemUsed.getId() == 11710 || usedWith.getId() == 11712 || usedWith.getId() == 11714) { if (player.getInventory().containsItem(11710, 1) && player.getInventory().containsItem(11712, 1) && player.getInventory().containsItem(11714, 1)) { player.getInventory().deleteItem(11710, 1); player.getInventory().deleteItem(11712, 1); player.getInventory().deleteItem(11714, 1); player.getInventory().addItem(11690, 1); player.getPackets().sendGameMessage("You made a godsword blade."); } } if (itemUsed.getId() == 11690 || usedWith.getId() == 11702) { if (player.getInventory().containsItem(11690, 1) && player.getInventory().containsItem(11702, 1)) { player.getInventory().deleteItem(11690, 1); player.getInventory().deleteItem(11702, 1); player.getInventory().addItem(11694, 1); player.getPackets().sendGameMessage("You attach the hilt to the blade and make an Armadyl godsword."); } } if (itemUsed.getId() == 11690 || usedWith.getId() == 11704) { if (player.getInventory().containsItem(11690, 1) && player.getInventory().containsItem(11704, 1)) { player.getInventory().deleteItem(11690, 1); player.getInventory().deleteItem(11704, 1); player.getInventory().addItem(11696, 1); player.getPackets().sendGameMessage("You attach the hilt to the blade and make an Bandos godsword."); } } if (itemUsed.getId() == 11690 || usedWith.getId() == 11706) { if (player.getInventory().containsItem(11690, 1) && player.getInventory().containsItem(11706, 1)) { player.getInventory().deleteItem(11690, 1); player.getInventory().deleteItem(11706, 1); player.getInventory().addItem(11698, 1); player.getPackets().sendGameMessage("You attach the hilt to the blade and make an Saradomin godsword."); } } if (itemUsed.getId() == 11690 || usedWith.getId() == 11708) { if (player.getInventory().containsItem(11690, 1) && player.getInventory().containsItem(11708, 1)) { player.getInventory().deleteItem(11690, 1); player.getInventory().deleteItem(11708, 1); player.getInventory().addItem(11700, 1); player.getPackets().sendGameMessage("You attach the hilt to the blade and make an Zamorak godsword."); } } else if (contains(1755, Gem.ONYX.getUncut(), itemUsed, usedWith)) GemCutting.cut(player, Gem.ONYX); else player.getPackets().sendGameMessage( "Nothing interesting happens."); if (Settings.DEBUG) Logger.log("ItemHandler", "Used:" + itemUsed.getId() + ", With:" + usedWith.getId()); } } public static void handleItemOption3(Player player, int slotId, int itemId, Item item) { long time = Utils.currentTimeMillis(); if (player.getLockDelay() >= time || player.getEmotesManager().getNextEmoteEnd() >= time) return; player.stopAll(false); if (itemId == 20767 || itemId == 20769 || itemId == 20771) SkillCapeCustomizer.startCustomizing(player, itemId); else if(itemId >= 15084 && itemId <= 15100) player.getDialogueManager().startDialogue("DiceBag", itemId); else if(itemId == 24437 || itemId == 24439 || itemId == 24440 || itemId == 24441) player.getDialogueManager().startDialogue("FlamingSkull", item, slotId); else if (Equipment.getItemSlot(itemId) == Equipment.SLOT_AURA) player.getAuraManager().sendTimeRemaining(itemId); } public static void handleItemOption4(Player player, int slotId, int itemId, Item item) { System.out.println("Option 4"); } public static void handleItemOption5(Player player, int slotId, int itemId, Item item) { System.out.println("Option 5"); } public static void handleItemOption6(Player player, int slotId, int itemId, Item item) { long time = Utils.currentTimeMillis(); if (player.getLockDelay() >= time || player.getEmotesManager().getNextEmoteEnd() >= time) return; player.stopAll(false); Pouches pouches = Pouches.forId(itemId); if (pouches != null) Summoning.spawnFamiliar(player, pouches); else if (itemId == 995) { int amount = player.getInventory().getItems().getNumberOf(995); if (player.money + amount > 0) { player.getInventory().deleteItem(995, amount); player.getPackets().sendRunScript(5561, 1, amount); player.money += amount; player.refreshMoneyPouch(); } else { player.getPackets().sendGameMessage("You can't have more then 2147483647 coins in your pouch.") } } if (itemId == 1438) Runecrafting.locate(player, 3127, 3405); else if (itemId == 1440) Runecrafting.locate(player, 3306, 3474); else if (itemId == 1442) Runecrafting.locate(player, 3313, 3255); else if (itemId == 1444) Runecrafting.locate(player, 3185, 3165); else if (itemId == 1446) Runecrafting.locate(player, 3053, 3445); else if (itemId == 1448) Runecrafting.locate(player, 2982, 3514); else if (itemId <= 1712 && itemId >= 1706 || itemId >= 10354 && itemId <= 10362) player.getDialogueManager().startDialogue("Transportation", "Edgeville", new WorldTile(3087, 3496, 0), "Karamja", new WorldTile(2918, 3176, 0), "Draynor Village", new WorldTile(3105, 3251, 0), "Al Kharid", new WorldTile(3293, 3163, 0), itemId); else if (itemId == 1704 || itemId == 10352) player.getPackets() .sendGameMessage( "The amulet has ran out of charges. You need to recharge it if you wish it use it once more."); else if (itemId >= 3853 && itemId <= 3867) player.getDialogueManager().startDialogue("Transportation", "Burthrope Games Room", new WorldTile(2880, 3559, 0), "Barbarian Outpost", new WorldTile(2519, 3571, 0), "Gamers' Grotto", new WorldTile(2970, 9679, 0), "Corporeal Beast", new WorldTile(2886, 4377, 0), itemId);} /* } public static void handleItemOption7(Player player, int slotId, int itemId, Item item) { long time = Utils.currentTimeMillis(); if (player.getLockDelay() >= time || player.getEmotesManager().getNextEmoteEnd() >= time) return; if (!player.getControlerManager().canDropItem(item)) return; player.stopAll(false); if (item.getDefinitions().isOverSized()) { player.getPackets().sendGameMessage("The item appears to be oversized."); player.getInventory().deleteItem(item); return; } if (item.getDefinitions().isDestroyItem()) { player.getDialogueManager().startDialogue("DestroyItemOption", slotId, item); return; } if (player.getPetManager().spawnPet(itemId, true)) { return; } player.getInventory().deleteItem(slotId, item); if (player.getCharges().degradeCompletly(item)) return; World.addGroundItem(item, new WorldTile(player), player, false, 180, true); player.getPackets().sendSound(2739, 0, 1); } */ } public static void handleItemOption7(Player player, int slotId, int itemId, Item item) { long time = Utils.currentTimeMillis(); if (player.getLockDelay() >= time || player.getEmotesManager().getNextEmoteEnd() >= time) return; if (!player.getControlerManager().canDropItem(item)) return; player.stopAll(false); if (item.getDefinitions().isOverSized()) { player.getPackets().sendGameMessage("The item appears to be oversized."); player.getInventory().deleteItem(item); return; } if (item.getDefinitions().isDestroyItem()) { player.getDialogueManager().startDialogue("DestroyItemOption", slotId, item); return; } if (player.getPetManager().spawnPet(itemId, true)) { return; } player.getInventory().deleteItem(slotId, item); if (player.getCharges().degradeCompletly(item)) return; World.addGroundItem(item, new WorldTile(player), player, false, 180, true); player.getPackets().sendSound(2739, 0, 1); } public static void handleItemOption8(Player player, int slotId, int itemId, Item item) { player.getInventory().sendExamine(slotId); } public static void handleItemOnNPC(final Player player, final NPC npc, final Item item) { if (item == null) { return; } player.setCoordsEvent(new CoordsEvent(npc, new Runnable() { [MENTION=15855]Over[/MENTION]ride public void run() { if (!player.getInventory().containsItem(item.getId(), item.getAmount())) { return; } if (npc instanceof Pet) { player.faceEntity(npc); player.getPetManager().eat(item.getId(), (Pet) npc); return; } } }, npc.getSize())); } }[/code] And here's my MoneyPouch.java: [code]package com.rs.game.player.content; import java.io.Serializable; import java.text.DecimalFormat; import com.rs.game.item.Item; import com.rs.game.player.Bank; import com.rs.game.player.Player; public class MoneyPouch implements Serializable { private static final long serialVersionUID = -3847090682601697992L; private transient Player player; public boolean usingPouch; public int amount; public MoneyPouch(Player player) { this.player = player; } public void switchPouch() { usingPouch = !usingPouch; refresh(true); } private void refresh(boolean swap) { if (swap) player.getPackets().sendRunScript(5557, 1); player.getPackets().sendRunScript(5560, getCoinAmount()); } public void sendDynamicInteraction(int amount, boolean remove) { int newAmount = remove ? amount - player.coinamount : amount + player.coinamount; if (usingPouch || !usingPouch) { Item item = new Item(995, amount - (remove ? 0 : Integer.MAX_VALUE)); if (remove) { if (newAmount < 0) { if (player.getInventory().containsItem(item.getId(), item.getAmount())) { player.getPackets().sendGameMessage("You dont have enough money in your pouch. Your coins will be taken from your inventory instead."); player.getInventory().deleteItem(item); } else player.getPackets().sendGameMessage("You don't have enough coins."); return; } else if (player.coinamount == 0){ player.getPackets().sendGameMessage("Your money-pouch is currently empty."); return; } else if (player.getInventory().getItems().getNumberOf(995) + player.coinamount > 2147483647 || player.getInventory().getItems().getNumberOf(995) + player.coinamount <= 0) { int dif = 2147483647 - player.getInventory().getItems().getNumberOf(995); if (dif > 0) player.getPackets().sendRunScript(5561, new Object[] {0, dif}); player.coinamount -= dif; player.getPackets().sendRunScript(5560, new Object[] {player.coinamount}); if (dif > 0) player.getInventory().addItem(995, dif); if (dif > 0) player.getPackets().sendGameMessage(getFormattedNumber(dif) +" coins have been removed from your money pouch."); return; } else player.getPackets().sendRunScript(5561, new Object[] {0, amount}); player.coinamount -= amount; player.getPackets().sendRunScript(5560, new Object[] {player.coinamount}); player.getInventory().addItem(995, amount); player.getPackets().sendGameMessage(getFormattedNumber(amount) +" coins have been removed from your money pouch."); } else { if (newAmount > 2147483647 || newAmount <= 0) { int dif = 2147483647 - player.coinamount; if (dif > 0) player.getPackets().sendRunScript(5561, new Object[] {1, dif}); player.coinamount += dif; player.getPackets().sendRunScript(5560, new Object[] {player.coinamount}); if (dif > 0) player.getInventory().deleteItem(995, dif); if (dif > 0) player.getPackets().sendGameMessage(getFormattedNumber(dif) +" coins have been added to your money pouch."); return; } else player.getPackets().sendRunScript(5561, new Object[] {1, amount}); player.coinamount += amount; player.getPackets().sendRunScript(5560, new Object[] {player.coinamount}); player.getInventory().deleteItem(995, amount); player.getPackets().sendGameMessage(getFormattedNumber(amount) +" coins have been added to your money pouch."); } setAmount(newAmount, amount, remove); } else { if (remove) player.getInventory().deleteItem(new Item(995, amount)); else player.getInventory().addItem(new Item(995, amount)); } } public String getFormattedNumber(int amount) { return new DecimalFormat("#,###,##0").format(amount).toString(); } public void sendExamine() { player.getPackets().sendGameMessage("Your money pouch current contains " + getFormattedNumber(getCoinAmount()) + " coins."); } private void setAmount(int coinAmount, int addedAmount, boolean remove) { this.setCoinAmount(coinAmount); player.getPackets().sendRunScript(5561 , remove ? 0 : 1, addedAmount); refresh(false); } public int getCoinAmount() { return player.coinamount; } public void setCoinAmount(int coinAmount) { this.player.coinamount = coinAmount; } }[/code] Any help would be appreciated as I cannot figure it out :(
  10. So I was able to upload a new cache to my site just fine with FTP. But now, it says for about 2 seconds: "Requesting Title Screen" And then: "Error Connecting - Retrying in..." (And of course there's a countdown...) Can someone help me please?
  11. everytime I try to run my client in Eclipse, I get this: [code]Uncaught error fetching image: java.lang.NullPointerException at sun.awt.image.URLImageSource.getConnection(Unknown Source) at sun.awt.image.URLImageSource.getDecoder(Unknown Source) at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source) at sun.awt.image.ImageFetcher.fetchloop(Unknown Source) at sun.awt.image.ImageFetcher.run(Unknown Source)[/code] What I have tried: - Switching compiler version to Java 6, 7, and 8. (Currently running on 7 as it should be) - Restarting Eclipse - Restarting server
  12. I got an opcode error(s) after replacing my cache: [code][Launcher] Initing Cache... Exception in thread "main" java.lang.RuntimeException: MISSING OPCODE 94 FOR ITE M 6 at com.rs.cache.loaders.ItemDefinitions.readValues(ItemDefinitions.java: 840) at com.rs.cache.loaders.ItemDefinitions.readOpcodeValues(ItemDefinitions .java:855) at com.rs.cache.loaders.ItemDefinitions.loadItemDefinitions(ItemDefiniti ons.java:353) at com.rs.cache.loaders.ItemDefinitions.<init>(ItemDefinitions.java:340) at com.rs.cache.loaders.ItemDefinitions.getItemDefinitions(ItemDefinitio ns.java:318) at com.rs.cache.loaders.ItemsEquipIds.init(ItemsEquipIds.java:14) at com.rs.Launcher.main(Launcher.java:74) Press any key to continue . . .[/code] Does anyone possibly know how to fix it? Itemdefinitions.java: [code]package com.rs.cache.loaders; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.nio.ByteBuffer; import java.util.HashMap; import java.util.LinkedList; import com.alex.utils.Constants; import com.rs.cache.Cache; import com.rs.game.player.Equipment; import com.rs.utils.GrandExchangePrices; import com.rs.game.player.Skills; import com.rs.io.InputStream; import com.rs.utils.Utils; @SuppressWarnings("unused") public final class ItemDefinitions { private static final ItemDefinitions[] itemsDefinitions; static { // that's why this is here itemsDefinitions = new ItemDefinitions[Utils.getItemDefinitionsSize()]; } private int id; private boolean loaded; public void setValue(int value) { this.value = value; } public int modelId; private String name; // model size information private int modelZoom; private int modelRotation1; private int modelRotation2; private int modelOffset1; private int modelOffset2; // extra information private int stackable; private int value; private boolean membersOnly; // wearing model information private int maleEquip1; private int femaleEquip1; private int maleEquip2; private int femaleEquip2; // 718/735 Opcodes private int opcode44; private int opcode144; private int opcode145; private int opcode150; private int opcode151; private int opcode152; private int opcode153; private int opcode146; private int opcode142; private int opcode154; private int opcode9; private int opcode117; private int opcode17; private int opcode99; private int opcode87; private int opcode55; private int opcode62; private int opcode118; private int opcode56; private int opcode46; private int opcode47; private int opcode83; // options private String[] groundOptions; public String[] inventoryOptions; // model information public int[] originalModelColors; public int[] modifiedModelColors; public short[] originalTextureColors; private short[] modifiedTextureColors; private byte[] unknownArray1; private int[] unknownArray2; // extra information, not used for newer items private boolean unnoted; private int maleEquipModelId3; private int femaleEquipModelId3; private int unknownInt1; private int unknownInt2; private int unknownInt3; private int unknownInt4; private int unknownInt5; private int unknownInt6; private int certId; private int certTemplateId; private int[] stackIds; private int[] stackAmounts; private int unknownInt7; private int unknownInt8; private int unknownInt9; private int unknownInt10; private int unknownInt11; public int teamId; private int lendId; private int lendTemplateId; private int unknownInt12; private int unknownInt13; private int unknownInt14; private int unknownInt15; private int unknownInt16; private int unknownInt17; private int unknownInt18; private int unknownInt19; private int unknownInt20; private int unknownInt21; private int unknownInt22; private int unknownInt23; private int equipSlot; private int equipType; private int unknownInt25; private int unknownInt26; private int unknownInt27; private int unknownInt28; private int unknownInt29; private int unknownInt30; private int unknownInt31; private int unknownInt32; private int opcode13; private int opcode52; private int opcode53; private int opcode82; private int opcode66; private int opcode116; private int opcode157; private int opcode68; private int opcode244; private int opcode170; private int opcode75; private int opcode14; private int opcode27; private int opcode232; private int opcode211; //more opcodes private int opcode254; private int opcode228; private int opcode226; private int opcode255; private int opcode253; private int opcode252; private int opcode156; private int opcode215; private int opcode171; private int opcode3; private int opcode199; private int opcode223; private int opcode198; private int opcode186; private int opcode29; private int opcode238; private int opcode155; private int opcode251; private int opcode22; private int opcode192; private int opcode245; private int opcode45; private int opcode248; private int opcode237; private int opcode243; private int opcode185; private int opcode221; private int opcode240; private int opcode158; private int opcode137; private int opcode143; private int opcode61; private int opcode80; private int opcode196; private int opcode85; private int opcode239; private int opcode177; private int opcode163; private int opcode135; private int opcode120; private int opcode204; private int opcode81; private int opcode208; private int opcode242; private int opcode15; private int opcode233; private int opcode213; private int opcode207; private int opcode216; private int opcode206; private int opcode50; private int opcode193; private int opcode71; private int opcode10; private int opcode235; private int opcode188; private int opcode241; private int opcode236; private int opcode182; private int opcode169; private int opcode190; private int opcode178; private int opcode88; private int opcode200; private int opcode184; private int opcode176; private int opcode197; private int opcode247; private int opcode218; private int opcode250; private int opcode174; private int opcode210; private int opcode164; private int opcode148; private int opcode133; private int opcode222; private int opcode138; private int opcode194; private int opcode119; private int opcode202; private int opcode149; private int opcode64; private int opcode147; private int opcode214; private int opcode74; private int opcode86; private int opcode167; private int opcode161; private int opcode58; private int opcode59; private int opcode187; private int opcode77; private int opcode229; private int opcode230; private int opcode67; private int opcode131; private int opcode225; private int opcode203; private int opcode19; private int opcode43; private int opcode168; private int opcode209; private int opcode166; private int opcode54; private int opcode21; private int opcode73; private int opcode159; private int opcode123; private int opcode180; private int opcode20; private int opcode165; private int opcode84; private int opcode28; private int opcode175; private int opcode141; private int opcode205; private int opcode220; private int opcode136; private int opcode212; private int opcode49; private int opcode69; private int opcode72; private int opcode60; private int opcode219; private int opcode227; private int opcode76; private int opcode234; private int opcode57; private int opcode51; private int opcode124; private int opcode70; private int opcode231; private int opcode162; private int opcode160; private int opcode181; private int opcode183; private int opcode191; private int opcode189; private int opcode179; private int opcode173; private int opcode48; private int opcode172; private int opcode42; private int opcode246; private int opcode89; private int opcode195; private int opcode224; private int opcode63; private int opcode94; private int opcode201; private int opcode217; // extra added private boolean noted; private boolean lended; private HashMap<Integer, Object> clientScriptData; private HashMap<Integer, Integer> itemRequiriments; private int unknownInt24; public static final ItemDefinitions getItemDefinitions(int itemId) { if (itemId < 0 || itemId >= itemsDefinitions.length) itemId = 0; ItemDefinitions def = itemsDefinitions[itemId]; if (def == null) itemsDefinitions[itemId] = def = new ItemDefinitions(itemId); return def; } public static final void clearItemsDefinitions() { for (int i = 0; i < itemsDefinitions.length; i++) itemsDefinitions[i] = null; } public static ItemDefinitions forName(String name) { for (ItemDefinitions definition : itemsDefinitions) { if (definition.name.equalsIgnoreCase(name)) { return definition; } } return null; } public ItemDefinitions(int id) { this.id = id; setDefaultsVariableValues(); setDefaultOptions(); loadItemDefinitions(); } public boolean isLoaded() { return loaded; } private final void loadItemDefinitions() { byte[] data = Cache.STORE.getIndexes()[Constants.ITEM_DEFINITIONS_INDEX].getFile(getArchiveId(), getFileId()); if (data == null) { // System.out.println("Failed loading Item " + id+"."); return; } readOpcodeValues(new InputStream(data)); if (certTemplateId != -1) toNote(); if (lendTemplateId != -1) toLend(); if (unknownValue1 != -1) toBind(); loaded = true; } private void toNote() { // ItemDefinitions noteItem; //certTemplateId ItemDefinitions realItem = getItemDefinitions(certId); membersOnly = realItem.membersOnly; value = realItem.value; name = realItem.name; stackable = 1; noted = true; } private void toBind() { // ItemDefinitions lendItem; //lendTemplateId ItemDefinitions realItem = getItemDefinitions(unknownValue2); originalModelColors = realItem.originalModelColors; maleEquipModelId3 = realItem.maleEquipModelId3; femaleEquipModelId3 = realItem.femaleEquipModelId3; teamId = realItem.teamId; value = 0; membersOnly = realItem.membersOnly; name = realItem.name; inventoryOptions = new String[5]; groundOptions = realItem.groundOptions; if (realItem.inventoryOptions != null) for (int optionIndex = 0; optionIndex < 4; optionIndex++) inventoryOptions[optionIndex] = realItem.inventoryOptions[optionIndex]; inventoryOptions[4] = "Discard"; maleEquip1 = realItem.maleEquip1; maleEquip2 = realItem.maleEquip2; femaleEquip1 = realItem.femaleEquip1; femaleEquip2 = realItem.femaleEquip2; clientScriptData = realItem.clientScriptData; equipSlot = realItem.equipSlot; equipType = realItem.equipType; } private void toLend() { // ItemDefinitions lendItem; //lendTemplateId ItemDefinitions realItem = getItemDefinitions(lendId); originalModelColors = realItem.originalModelColors; maleEquipModelId3 = realItem.maleEquipModelId3; femaleEquipModelId3 = realItem.femaleEquipModelId3; teamId = realItem.teamId; value = 0; membersOnly = realItem.membersOnly; name = realItem.name; inventoryOptions = new String[5]; groundOptions = realItem.groundOptions; if (realItem.inventoryOptions != null) for (int optionIndex = 0; optionIndex < 4; optionIndex++) inventoryOptions[optionIndex] = realItem.inventoryOptions[optionIndex]; inventoryOptions[4] = "Discard"; maleEquip1 = realItem.maleEquip1; maleEquip2 = realItem.maleEquip2; femaleEquip1 = realItem.femaleEquip1; femaleEquip2 = realItem.femaleEquip2; clientScriptData = realItem.clientScriptData; equipSlot = realItem.equipSlot; equipType = realItem.equipType; lended = true; } public int getArchiveId() { return getId() >>> 8; } public int getFileId() { return 0xff & getId(); } public boolean isDestroyItem() { if (inventoryOptions == null) return false; for (String option : inventoryOptions) { if (option == null) continue; if (option.equalsIgnoreCase("destroy")) return true; } return false; } public boolean containsOption(int i, String option) { if (inventoryOptions == null || inventoryOptions[i] == null || inventoryOptions.length <= i) return false; return inventoryOptions[i].equals(option); } public boolean containsOption(String option) { if (inventoryOptions == null) return false; for (String o : inventoryOptions) { if (o == null || !o.equals(option)) continue; return true; } return false; } public boolean isWearItem() { return equipSlot != -1; } public boolean isWearItem(boolean male) { if (equipSlot < Equipment.SLOT_RING && (male ? getMaleWornModelId1() == -1 : getFemaleWornModelId1() == -1)) return false; return equipSlot != -1; } public boolean hasSpecialBar() { if (clientScriptData == null) return false; Object specialBar = clientScriptData.get(686); if (specialBar != null && specialBar instanceof Integer) return (Integer) specialBar == 1; return false; } public int getRenderAnimId() { if (clientScriptData == null) return 1426; Object animId = clientScriptData.get(644); if (animId != null && animId instanceof Integer) return (Integer) animId; return 1426; } public int getModelZoom() { return modelZoom; } public int getModelOffset1() { return modelOffset1; } public int getModelOffset2() { return modelOffset2; } public int getQuestId() { if (clientScriptData == null) return -1; Object questId = clientScriptData.get(861); if (questId != null && questId instanceof Integer) return (Integer) questId; return -1; } public HashMap<Integer, Integer> getCreateItemRequirements() { if (clientScriptData == null) return null; HashMap<Integer, Integer> items = new HashMap<Integer, Integer>(); int requiredId = -1; int requiredAmount = -1; for (int key : clientScriptData.keySet()) { Object value = clientScriptData.get(key); if (value instanceof String) continue; if (key >= 538 && key <= 770) { if (key % 2 == 0) requiredId = (Integer) value; else requiredAmount = (Integer) value; if (requiredId != -1 && requiredAmount != -1) { items.put(requiredAmount, requiredId); requiredId = -1; requiredAmount = -1; } } } return items; } public HashMap<Integer, Object> getClientScriptData() { return clientScriptData; } public HashMap<Integer, Integer> getWearingSkillRequiriments() { if (clientScriptData == null) return null; if (itemRequiriments == null) { HashMap<Integer, Integer> skills = new HashMap<Integer, Integer>(); for (int i = 0; i < 10; i++) { Integer skill = (Integer) clientScriptData.get(749 + (i * 2)); if (skill != null) { Integer level = (Integer) clientScriptData .get(750 + (i * 2)); if (level != null) skills.put(skill, level); } } Integer maxedSkill = (Integer) clientScriptData.get(277); if (maxedSkill != null) skills.put(maxedSkill, getId() == 19709 ? 120 : 99); itemRequiriments = skills; if (getId() == 7462) itemRequiriments.put(Skills.DEFENCE, 40); else if (name.equals("Dragon defender")) { itemRequiriments.put(Skills.ATTACK, 60); itemRequiriments.put(Skills.DEFENCE, 60); }else if (getId() == 19784 || getId() == 22401 || getId() == 19780) { // Korasi itemRequiriments.put(Skills.ATTACK, 78); itemRequiriments.put(Skills.STRENGTH, 78); }else if (getId() == 1127 || getId() == 1079 || getId() == 1147 || getId() == 1163 || getId() == 4131 || getId() == 1185 || getId() == 1201) { // rune itemRequiriments.put(Skills.DEFENCE, 40); }else if (getId() == 1067 || getId() == 1115 || getId() == 1175 || getId() == 1153 || getId() == 1137 || getId() == 1191) { // iron itemRequiriments.put(Skills.DEFENCE, 1); }else if (getId() == 1303 || getId() == 1333 || getId() == 1289 || getId() == 1319) { // rune weapons itemRequiriments.put(Skills.ATTACK, 40); }else if (getId() == 1323 || getId() == 1309 || getId() == 1293 || getId() == 1279) { // iron weapons itemRequiriments.put(Skills.ATTACK, 1); }else if (getId() == 2497) { // black dhide chaps itemRequiriments.put(Skills.RANGE, 70); itemRequiriments.put(Skills.DEFENCE, 1); if (getId() == 20822 || getId() == 20823 || getId() == 20824 || getId() == 20825 || getId() == 20826) itemRequiriments.put(Skills.DEFENCE, 99); }else if (name.equals("Dragon defender")) { itemRequiriments.put(Skills.ATTACK, 60); itemRequiriments.put(Skills.DEFENCE, 60); }else if (name.equals("rune arrow")) { itemRequiriments.put(Skills.RANGE, 40); }else if (name.equals("iron arrow")) { itemRequiriments.put(Skills.RANGE, 1); } } return itemRequiriments; } /* * public HashMap<Integer, Integer> getWearingSkillRequiriments() { if * (clientScriptData == null) return null; HashMap<Integer, Integer> skills * = new HashMap<Integer, Integer>(); int nextLevel = -1; int nextSkill = * -1; for (int key : clientScriptData.keySet()) { Object value = * clientScriptData.get(key); if (value instanceof String) continue; if(key * == 277) { skills.put((Integer) value, id == 19709 ? 120 : 99); }else if * (key == 23 && id == 15241) { skills.put(4, (Integer) value); * skills.put(11, 61); } else if (key >= 749 && key < 797) { if (key % 2 == * 0) nextLevel = (Integer) value; else nextSkill = (Integer) value; if * (nextLevel != -1 && nextSkill != -1) { skills.put(nextSkill, nextLevel); * nextLevel = -1; nextSkill = -1; } } * * } return skills; } */ private void setDefaultOptions() { groundOptions = new String[] { null, null, "take", null, null }; inventoryOptions = new String[] { null, null, null, null, "drop" }; } private void setDefaultsVariableValues() { name = "null"; maleEquip1 = -1; maleEquip2 = -1; femaleEquip1 = -1; femaleEquip2 = -1; modelZoom = 2000; lendId = -1; lendTemplateId = -1; certId = -1; certTemplateId = -1; unknownInt9 = 128; value = 1; maleEquipModelId3 = -1; femaleEquipModelId3 = -1; unknownValue1 = -1; unknownValue2 = -1; teamId = -1; equipSlot = -1; equipType = -1; } private final void readValues(InputStream stream, int opcode) { if (opcode == 1) modelId = stream.readBigSmart(); else if (opcode == 2) name = stream.readString(); else if (opcode == 4) modelZoom = stream.readUnsignedShort(); else if (opcode == 5) modelRotation1 = stream.readUnsignedShort(); else if (opcode == 6) modelRotation2 = stream.readUnsignedShort(); else if (opcode == 7) { modelOffset1 = stream.readUnsignedShort(); if (modelOffset1 > 32767) modelOffset1 -= 65536; modelOffset1 <<= 0; } else if (opcode == 8) { modelOffset2 = stream.readUnsignedShort(); if (modelOffset2 > 32767) modelOffset2 -= 65536; modelOffset2 <<= 0; } else if (opcode == 11) stackable = 1; else if (opcode == 12) value = stream.readInt(); else if (opcode == 13) { equipSlot = stream.readUnsignedByte(); }else if (opcode == 14) { equipType = stream.readUnsignedByte(); }else if (opcode == 16) membersOnly = true; else if (opcode == 18) stream.readUnsignedShortLE(); else if (opcode == 23) maleEquip1 = stream.readBigSmart(); else if (opcode == 24) maleEquip2 = stream.readBigSmart(); else if (opcode == 25) femaleEquip1 = stream.readBigSmart(); else if (opcode == 26) femaleEquip2 = stream.readBigSmart(); else if (opcode == 27) stream.readUnsignedByte(); else if (opcode >= 30 && opcode < 35) groundOptions[opcode - 30] = stream.readString(); else if (opcode >= 35 && opcode < 40) inventoryOptions[opcode - 35] = stream.readString(); else if (opcode == 40) { int length = stream.readUnsignedByte(); originalModelColors = new int[length]; modifiedModelColors = new int[length]; for (int index = 0; index < length; index++) { originalModelColors[index] = stream.readUnsignedShort(); modifiedModelColors[index] = stream.readUnsignedShort(); } } else if (opcode == 41) { int length = stream.readUnsignedByte(); originalTextureColors = new short[length]; modifiedTextureColors = new short[length]; for (int index = 0; index < length; index++) { originalTextureColors[index] = (short) stream .readUnsignedShort(); modifiedTextureColors[index] = (short) stream .readUnsignedShort(); } } else if (opcode == 42) { int length = stream.readUnsignedByte(); unknownArray1 = new byte[length]; for (int index = 0; index < length; index++) unknownArray1[index] = (byte) stream.readByte(); } else if (opcode == 65) unnoted = true; else if (opcode == 78) maleEquipModelId3 = stream.readBigSmart(); else if (opcode == 79) femaleEquipModelId3 = stream.readBigSmart(); else if (opcode == 90) unknownInt1 = stream.readBigSmart(); else if (opcode == 91) unknownInt2 = stream.readBigSmart(); else if (opcode == 92) unknownInt3 = stream.readBigSmart(); else if (opcode == 93) unknownInt4 = stream.readBigSmart(); else if (opcode == 95) unknownInt5 = stream.readUnsignedShort(); else if (opcode == 96) unknownInt6 = stream.readUnsignedByte(); else if (opcode == 97) certId = stream.readUnsignedShort(); else if (opcode == 98) certTemplateId = stream.readUnsignedShort(); else if (opcode >= 100 && opcode < 110) { if (stackIds == null) { stackIds = new int[10]; stackAmounts = new int[10]; } stackIds[opcode - 100] = stream.readUnsignedShort(); stackAmounts[opcode - 100] = stream.readUnsignedShort(); } else if (opcode == 110) unknownInt7 = stream.readUnsignedShort(); else if (opcode == 111) unknownInt8 = stream.readUnsignedShort(); else if (opcode == 112) unknownInt9 = stream.readUnsignedShort(); else if (opcode == 113) unknownInt10 = stream.readByte(); else if (opcode == 114) unknownInt11 = stream.readByte() * 5; else if (opcode == 115) teamId = stream.readUnsignedByte(); else if (opcode == 121) lendId = stream.readUnsignedShort(); else if (opcode == 122) lendTemplateId = stream.readUnsignedShort(); else if (opcode == 125) { unknownInt12 = stream.readByte() << 0; unknownInt13 = stream.readByte() << 0; unknownInt14 = stream.readByte() << 0; } else if (opcode == 126) { unknownInt15 = stream.readByte() << 0; unknownInt16 = stream.readByte() << 0; unknownInt17 = stream.readByte() << 0; } else if (opcode == 127) { unknownInt18 = stream.readUnsignedByte(); unknownInt19 = stream.readUnsignedShort(); } else if (opcode == 128) { unknownInt20 = stream.readUnsignedByte(); unknownInt21 = stream.readUnsignedShort(); } else if (opcode == 129) { unknownInt20 = stream.readUnsignedByte(); unknownInt21 = stream.readUnsignedShort(); } else if (opcode == 130) { unknownInt22 = stream.readUnsignedByte(); unknownInt23 = stream.readUnsignedShort(); } else if (opcode == 132) { int length = stream.readUnsignedByte(); unknownArray2 = new int[length]; for (int index = 0; index < length; index++) unknownArray2[index] = stream.readUnsignedShort(); } else if (opcode == 134) { int unknownValue = stream.readUnsignedByte(); } else if (opcode == 139) { unknownValue2 = stream.readUnsignedShort(); } else if (opcode == 140) { unknownValue1 = stream.readUnsignedShort(); } else if (opcode == 249) { int length = stream.readUnsignedByte(); if (clientScriptData == null) clientScriptData = new HashMap<Integer, Object>(length); for (int index = 0; index < length; index++) { boolean stringInstance = stream.readUnsignedByte() == 1; int key = stream.read24BitInt(); Object value = stringInstance ? stream.readString() : stream .readInt(); clientScriptData.put(key, value); } } else if (opcode == 44) opcode44 = stream.readUnsignedShort(); else if (opcode == 55) opcode55 = stream.readUnsignedShort(); else if (opcode == 62) opcode62 = stream.readUnsignedShort(); else if (opcode == 144) opcode144 = stream.readUnsignedShort(); else if (opcode == 118) opcode118 = stream.readUnsignedShort(); else if (opcode == 46) opcode46 = stream.readUnsignedShort(); else if (opcode == 56) opcode56 = stream.readUnsignedShort(); else if (opcode == 47) opcode47 = stream.readUnsignedShort(); else if (opcode == 83) opcode83 = stream.readUnsignedShort(); else if (opcode == 146) opcode146 = stream.readUnsignedShort(); else if (opcode == 87) opcode87 = stream.readUnsignedShort(); else if (opcode == 99) opcode99 = stream.readUnsignedShort(); else if (opcode == 94) opcode94 = stream.readUnsignedShort(); else if (opcode == 17) opcode17 = stream.readUnsignedShort(); else if (opcode == 117) opcode117 = stream.readUnsignedShort(); else if (opcode == 9) opcode9 = stream.readUnsignedShort(); else if (opcode == 142) opcode142 = stream.readUnsignedShort(); else if (opcode == 145) opcode145 = stream.readUnsignedShort(); else if (opcode == 150) opcode150 = stream.readUnsignedShort(); else if (opcode == 151) opcode151 = stream.readUnsignedShort(); else if (opcode == 152) opcode152 = stream.readUnsignedShort(); else if (opcode == 153) opcode153 = stream.readUnsignedShort(); else if (opcode == 154) opcode154 = stream.readUnsignedShort(); else throw new RuntimeException("MISSING OPCODE " + opcode + " FOR ITEM " + getId()); } private int unknownValue1; private int unknownValue2; private final void readOpcodeValues(InputStream stream) { while (true) { int opcode = stream.readUnsignedByte(); if (id == 9977) { stackable = 1; } if (opcode == 0) break; readValues(stream, opcode); } } public String getName() { return name; } public int getFemaleWornModelId1() { return femaleEquip1; } public int getFemaleWornModelId2() { return femaleEquip2; } public int getMaleWornModelId1() { return maleEquip1; } public int getMaleWornModelId2() { return maleEquip2; } public boolean isOverSized() { return modelZoom > 25000; } public boolean isLended() { return lended; } public boolean isMembersOnly() { return membersOnly; } public boolean isStackable() { return stackable == 1; } public boolean isNoted() { return noted; } public int getLendId() { return lendId; } public int getCertId() { return certId; } public int getValue() { return value; } public int getId() { return id; } public int getEquipSlot() { return equipSlot; } public int getEquipType() { return equipType; } public static ItemDefinitions forId(int id2) { return ItemDefinitions.getItemDefinitions(id2); } public int getGEPrice() { return GrandExchangePrices.getPrice(id); } public static class FileUtilities { public static final int BUFFER = 1024; public static boolean exists(String name) { File file = new File(name); return file.exists(); } public static ByteBuffer fileBuffer(String name) throws IOException { File file = new File(name); if(!file.exists()) return null; FileInputStream in = new FileInputStream(name); byte[] data = new byte[BUFFER]; int read; try { ByteBuffer buffer = ByteBuffer.allocate(in.available() + 1); while ((read = in.read(data, 0, BUFFER)) != -1) { buffer.put(data, 0, read); } buffer.flip(); return buffer; } finally { if (in != null) in.close(); in = null; } } public static void writeBufferToFile(String name, ByteBuffer buffer) throws IOException { File file = new File(name); if(!file.exists()) file.createNewFile(); FileOutputStream out = new FileOutputStream(name); out.write(buffer.array(), 0, buffer.remaining()); out.flush(); out.close(); } public static LinkedList<String> readFile(String directory) throws IOException { LinkedList<String> fileLines = new LinkedList<String>(); BufferedReader reader = null; try { reader = new BufferedReader(new FileReader(directory)); String string; while ((string = reader.readLine()) != null) { fileLines.add(string); } } finally { if (reader != null) { reader.close(); reader = null; } } return fileLines; } } }[/code]
  13. I used to remember this. But now I forget. I just need to know how to start off using a RSPs through netbeans. Where do I first click and what do I go through? (eg: new project, open project)
×