Jump to content

Search the Community

Showing results for tags 'weird'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • RuneLocus
    • News & Announcements
    • Information Booth
    • Website Support
    • Introductions
    • Chat
    • Forum Games
  • RuneScape Development
    • RSPS General
    • RuneScape Private Server (RS2)
    • RuneScape Private Server (503+)
    • RuneScape Private Server (EoC 742+)
  • Other
    • Digital Art
    • Gaming
    • Webdevelopment
    • Computers
  • Marketplace
    • RuneScape Market
    • RSPS Market
    • Others Market
    • Freelance Middleman Services
  • Super Secret Club's Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 47 results

  1. Vici

    A weird problem.

    I'm using the Rune-evo v3 source and i've some how got a problem with NPC's, after a compile i noticed that some NPC's such as Glacors and Rock crabs even General Graardor don't respawn when killed by anybody (player/admin) I was wondering f anyone had an idea? me and my dev are stumped on this one.
  2. Hello everybody, I've added auto-vote to do some testing, but I've got an extremely strange outcome from this... Below are a few tests I conducted, "Succeed" states that I was able to get to the second stage of voting (meaning that voting was a success) and I'm now inputting my name to receive a reward. "Fail" states that I got the "Please vote on all sites" error, when I have voted on all sites. I am using the GTL Vote system. So here is my very weird problem: Test 1: Sites: Gaming-toplist - SUCCESS Test 2: Sites: Gaming-topist + Rune-locus - SUCCESS Test 3: Sites: Gaming-toplist + Rune-locus + R0ne-Server - SUCCESS Test 4: Sites: Gaming-toplist + Rune-locus + Rune-toplist - FAIL Test 5: Sites: Gaming-toplist + R0ne-server + Rune-toplist SUCCESS Test 6: Sites: Gaming-toplist + Rune-toplist SUCCESS Test 7: Sites: Gaming-toplist + R0ne-server SUCCESS It seems that for some reason test 4 fails, but when I test the sites separately they succeed? Any ideas..? I've never encountered this before, and I've set up auto-vote numerous times. I've double checked the callback links, and everything works perfectly, so long that Gaming-toplist + Rune-locus + R0ne-server aren't all together. Any help is appreciated.
  3. So i've been using Alhassa (rs2hd) for the longest time now and just noticed that with a lot of the animations, a weird sound is played that does not match the nature of the animation at all. Does anyone know what might be causing this? My guess is it's in the cache because the cache seems to have some other problems as well but please let me know if you have any idea.
  4. Currently i am working on opening a few doors here and there, however upon writing in my first door, I get an error when i try to run my server: [CODE]Exception in thread "main" java.lang.ExceptionInInitializerError Caused by: java.lang.ArrayIndexOutOfBoundsException: 30 at server.world.ObjectHandler.loadDoorConfig(ObjectHandler.java:285) at server.world.ObjectHandler.<init>(ObjectHandler.java:29) at server.Server.<clinit>(Server.java:50) Press any key to continue . . .[/CODE] I'm fair sure the problem is the Object Handler reading in 30 instead of what i actually want it to read. The data i entered into my doors.cfg is this: [CODE] door = 3098 3107 0 -3 0 //Runescape Guides house door(tutorial island)[/CODE] I have used the tab key in between each value(as the spacebar is known to cause this issue),so I was wondering how to go about fixing this problem. :/ Code in objectHandler: [CODE] if (token.equals("door")) { doors[door][0] = Integer.parseInt(token3[0]); //line 285 doors[door][1] = Integer.parseInt(token3[1]); doors[door][2] = Integer.parseInt(token3[2]); doors[door][3] = Integer.parseInt(token3[3]); doors[door][4] = Integer.parseInt(token3[4]); door++; }[/CODE] EDIT: RESOLVED. Feel like such a nub for missing such an obvious error. So to anyone else who encounters this problem, search for: public static final int MAX_DOORS in ObjectHandler and change the max to however many doors you are adding.
  5. [ATTACH=CONFIG]10054[/ATTACH] i tried replacing the files with orig ones from the source and no dice... Help?
  6. Hello guys, Me and some friends did set-up a RSPS for our own pleasure to re-live the good old days. I have been coding RSPS's before I did quit when 508 was like the main revision and I noticed that a lot has changed. I now experience a issue that I have nave encounterd before the server allows 1 player online if someone else try's to login both users get Disconnected I am rather clueless what is causing this issue at the source settings it allows 100 players, We use a dedicated host that we have used before and worked perfectly fine, And I'am not sure if a client could cause this. So my question is, Has anyone ever experienced this before and if so how did they manage to solve this :)? once more the issue: If 1 player is online, and another one attempts to log online both users get DC'd (So its impossible to play with friends). Runelocus status checker tells me that the IP we use to connect is Online and Playable. Also note: The server does NOT get knocked offline when both users DC, and other users are able to play if they are the online once online. So yea hopefully someone is able to help me out on this one. Thanks in the advance! PS: If you need any part of the code feel free to ask me I just want to get over with this as fast as possible.
  7. Okay guys, I first off I am using "[url=http://www.moparscape.org/smf/index.php?topic=563888.0]Nexon-World 639[/url]", and I have a weird glitch/problem. When I use the "View Equipment" interface to see what all I am wearing and all of the bonuses it opens and works as should (after updating). But, when I close out of it and open up the bank for any reason, then exit it, and try to re-open the Equipment Interface, I believe it is going back to the "Banking Inventory Interface." (Just a thought, by observation... May be completely wrong). This works vise-versa too, I don't know why it is doing this or how to fix this. Any ideas on where to look, or any suggestions to fix this error? [CENTER][video=youtube;AFzirqJ7ppU]http://www.youtube.com/watch?v=AFzirqJ7ppU[/video][/CENTER]
  8. [video=youtube;H7OImF7AasM]http://www.youtube.com/watch?v=H7OImF7AasM[/video] This dupe all you got to do is have two of the same item i.e two different hats, capes, armour etc. then the one you want to dupe is in inventory while the one that will be getting deleted you are wearing. Then rapid click on the one you want to dupe as you are in the Equipment Tab. :/ Are their any ideas how to fix?
  9. IvanAteyea

    Weird Error

    Well, I've gotten this error for 2 sources now, and it's pretty much identical. It is as follows: [url]http://gyazo.com/7eb97a6cb8e59be8d58d48e99fec5082[/url] Any tips for what I can do to fix it? I can also use Skype and TV. Thanks in advance.
  10. Okay so after port forwarding correctly and you try and connect to your no-ip isn't it supposed to say error connecting for you but for others let them login? Well for me it doesn't it lets me login with localhost, 127.0.0.1, and my no-ip but doesn't let anyone else login? I am beginning to get more and more confused I have changed all the ip's in client.java and I don't have a gui.java or egui.java and since there are no ips to change server sided (client.java,server.java) I don't know what to do. I am able to connect perfectly but others can't? Any ideas guys? Also i read that if i try and connect to my own no-ip people wont be able to login so that option can be ruled out (learned after I tried):confused::confused::o
  11. okay so basically no matter what source i download it'll give me this error. WITHOUT me even changing anything. here's a pic of the error. Please comment on this post If you have a solution, do not PM me please. [CENTER][IMG]http://i40.tinypic.com/2d1u79g.jpg[/IMG][/CENTER] the part I don't understand is the <access is denied>
  12. K so, I'm gonna start by saying I'm basically an atheist. But a few years ago some weird shit happened that almost turned me. I went with a friend to his pentecostal church a few years back, and pentecostals are into some weird shit. Tongue speaking, prophets, prophecy, healing, etc. So basically the service went on, was the most epic church service I've ever been to, niggas shouting and demons and omg. Then the preacher[supposedly a prophet type thing] said something along the lines of, "Everyone I point to does no accept the Grace of God" or some shit like that. Pointed to a few people, me included. That was creep tip off 1. Then, after a lot more crazy pentecostal shit, the service ended. Some bald kid with a big ass blue ring thing came over to me and mah friend and his parents, shook my hand and looked at me, and walked off. Like seirously what the fuck is that about. Almost got me. Btw just sharing this story cus I'm bored, talking to that friend about it, and this was one of the most interesting religious occurances that've ever happened to me.
  13. okay so i add this code my spawn = 8349 2837 9583 0 3194 3662 3172 3643 tds spawn = 8349 2835 9563 0 3194 3662 3172 3643 tds spawn = 8349 2844 9554 0 3194 3662 3172 3643 tds spawn = 8349 2864 9565 0 3226 3107 3172 3643 tds i add this to spawnconfig nothing happens but i get hte error with other sources ive done this 1000x + but this one no (the error) Exception in thread "main" java.lang.ExceptionInInitializerError Caused by: java.lang.NumberFormatException: For input string: "8349 2837 9 583 0 3194" at java.lang.NumberFormatException.forInputString(NumberFormatException. java:65) at java.lang.Integer.parseInt(Integer.java:492) at java.lang.Integer.parseInt(Integer.java:527) at server.model.npcs.NPCHandler.loadAutoSpawn(NPCHandler.java:2334) at server.model.npcs.NPCHandler.<init>(NPCHandler.java:34) at server.Server.<clinit>(Server.java:70) Press any key to continue . . .
  14. [COLOR=#800080][SIZE=4][FONT=georgia]Well, I am getting an odd error when I try to log in on my server. I can launch it, and load the client and everything... but after I type a username and password in, my client freezes, and my Command Console is spammed with this weird error: [/FONT][/SIZE][/COLOR] [SPOILER="Weird Error"][CODE]Loaded 2124 npc drops successfully.Loaded 5308 npc examines. Jul 12, 2013 7:55:50 AM com.rs.game.World loadConfiguration INFO: Connected to www.sevador.com:3306 in 17 ms. Jul 12, 2013 7:55:53 AM com.rs.utility.Logger log INFO: Server took 14042 milli seconds to launch on VPS. New player #1 since server reboot, name: lue Jul 12, 2013 7:57:03 AM com.rs.utility.Logger log INFO: World registered player lue successfully. [1,1] java.sql.SQLException: Access denied for user 'lue'@'71-214-113-137.ptld .qwest.net' (using password: YES) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4074) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4006) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:919) at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(My sqlIO.java:1694) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1244) at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2397) at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2 430) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2215) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:813) at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct orAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC onstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java :334) at java.sql.DriverManager.getConnection(DriverManager.java:571) at java.sql.DriverManager.getConnection(DriverManager.java:215) at com.rs.database.mysql.MySQLDatabaseConnection.connect(MySQLDatabaseCo nnection.java:44) at com.rs.database.ConnectionPool.nextFree(ConnectionPool.java:81) at com.rs.game.player.Player.getForumTable(Player.java:3156) at com.rs.game.player.Player.run(Player.java:760) at com.rs.game.player.Player.start(Player.java:510) at com.rs.networking.decoders.LoginPacketsDecoder.decodeWorldLogin(Login PacketsDecoder.java:228) at com.rs.networking.decoders.LoginPacketsDecoder.decode(LoginPacketsDec oder.java:44) at com.rs.networking.ServerChannelHandler.messageReceived(ServerChannelH andler.java:98) at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleCha nnelHandler.java:95) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultCh annelPipeline.java:563) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultCh annelPipeline.java:558) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:26 8) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:25 5) at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:91) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processSelectedK eys(AbstractNioWorker.java:373) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioW orker.java:247) at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:35) at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnabl e.java:102) at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProof Worker.java:42) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor. java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor .java:615) at java.lang.Thread.run(Thread.java:724) java.lang.RuntimeException: Connection was unable to connect! at com.rs.database.ConnectionPool.nextFree(ConnectionPool.java:82) at com.rs.game.player.Player.getForumTable(Player.java:3156) at com.rs.game.player.Player.run(Player.java:760) at com.rs.game.player.Player.start(Player.java:510) at com.rs.networking.decoders.LoginPacketsDecoder.decodeWorldLogin(Login PacketsDecoder.java:228) at com.rs.networking.decoders.LoginPacketsDecoder.decode(LoginPacketsDec oder.java:44) at com.rs.networking.ServerChannelHandler.messageReceived(ServerChannelH andler.java:98) at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleCha nnelHandler.java:95) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultCh annelPipeline.java:563) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultCh annelPipeline.java:558) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:26 8) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:25 5) at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:91) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processSelectedK eys(AbstractNioWorker.java:373) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioW orker.java:247) at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:35) at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnabl e.java:102) at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProof Worker.java:42) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor. java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor .java:615) at java.lang.Thread.run(Thread.java:724) java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Stri ng at com.rs.game.player.Player.run(Player.java:760) at com.rs.game.player.Player.start(Player.java:510) at com.rs.networking.decoders.LoginPacketsDecoder.decodeWorldLogin(Login PacketsDecoder.java:228) at com.rs.networking.decoders.LoginPacketsDecoder.decode(LoginPacketsDec oder.java:44) at com.rs.networking.ServerChannelHandler.messageReceived(ServerChannelH andler.java:98) at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleCha nnelHandler.java:95) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultCh annelPipeline.java:563) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultCh annelPipeline.java:558) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:26 8) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:25 5) at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:91) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processSelectedK eys(AbstractNioWorker.java:373) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioW orker.java:247) at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:35) at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnabl e.java:102) at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProof Worker.java:42) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor. java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor .java:615) at java.lang.Thread.run(Thread.java:724) java.lang.ClassCastException: com.rs.networking.encoders.WorldPacketsEncoder can not be cast to com.rs.networking.encoders.LoginPacketsEncoder at com.rs.networking.Session.getLoginPackets(Session.java:123) at com.rs.networking.decoders.LoginPacketsDecoder.decodeWorldLogin(Login PacketsDecoder.java:231) at com.rs.networking.decoders.LoginPacketsDecoder.decode(LoginPacketsDec oder.java:44) at com.rs.networking.ServerChannelHandler.messageReceived(ServerChannelH andler.java:98) at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleCha nnelHandler.java:95) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultCh annelPipeline.java:563) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultCh annelPipeline.java:558) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:26 8) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:25 5) at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:91) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processSelectedK eys(AbstractNioWorker.java:373) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioW orker.java:247) at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:35) at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnabl e.java:102) at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProof Worker.java:42) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor. java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor .java:615) at java.lang.Thread.run(Thread.java:724) [/CODE][/SPOILER] [COLOR=#800080][FONT=georgia]The only thing I noticed that might be of any importance was this: [/FONT][/COLOR][CODE]java.sql.SQLException: Access denied for user 'lue'@'71-214-113-137.ptld.qwest.net' (using password: YES)[/CODE] [COLOR=#800080][SIZE=4][FONT=georgia]Can anyone tell me what on earth this is..? I've spent close to ten hours searching through my source files, and googling for an answer. I've yet to come up with one. I have no clue how to solve this... =( I would appreciate any help I can get.. thank you. **Edit** I forgot to mention, it is a 718, loading 718. Its the old Sevador Source.[/FONT][/SIZE][/COLOR]
  15. So I was just going into a new source I got to change some drop rates and noticed that there is no NPCDrops.TSM file or .CFG ...? I went in and I was getting some drops from KBD and Metal Drags and other NPC's but no drop file? ?????? THANKS!
  16. Alright, so i'm getting these weird errors when i try to compile my source... I'm not sure why, and i've been searching for hours, hopefully somebody can help me. [IMG]http://i41.tinypic.com/2w1yt75.jpg[/IMG] [IMG]http://i39.tinypic.com/mcvpxf.jpg[/IMG] My Dexter File [CODE] import java.io.File; import java.io.FileWriter; import java.util.Scanner; public class Dexter { public static void main(String[] args) { Dexter dexter = new Dexter(); //dexter.checkForFlag(); dexter.checkBanks(); } public void checkBanks() { try { File dir = new File("characters"); if(dir.exists()) { String read; File files[] = dir.listFiles(); for (int j = 0; j < files.length; j++) { File loaded = files[j]; if (loaded.getName().endsWith(".txt")) { Scanner s = new Scanner (loaded); int cash = 0; while (s.hasNextLine()) { read = s.nextLine(); if (read.startsWith("character-item") || read.startsWith("character-bank")) { String[] temp = read.split("\t"); int token1 = Integer.parseInt(temp[1]); int token2 = Integer.parseInt(temp[2]); if (token1 == 996) { cash += token2; if (cash > 12500000) { System.out.println("name: " + loaded.getName()); } } } } } } } else { System.out.println("FAIL"); } } catch (Exception e) { e.printStackTrace(); } } public void checkForFlag() { try { File dir = new File("characters"); if(dir.exists()) { String read; File files[] = dir.listFiles(); for (int j = 0; j < files.length; j++) { File loaded = files[j]; if (loaded.getName().endsWith(".txt")) { Scanner s = new Scanner (loaded); while (s.hasNextLine()) { read = s.nextLine(); if (read.equalsIgnoreCase("flagged = true")) { System.out.println(loaded.getName()); break; } } } } } } catch (Exception e) { } } public void logFile(String name ) { try { FileWriter fw = new FileWriter("dupers.txt"); fw.write(name + "\r\n"); fw.close(); } catch (Exception e){ } } }[/CODE] My Event File [CODE]package server.event; /** * A simple interface for an event. * * @author Graham * */ public interface Event { /** * Called when the event is executed. * * @param container * The event container, so the event can dynamically change the * tick time etc. */ public void execute(EventContainer container); } [/CODE]
  17. If someone were to log in with the name "Billionaire" and log out, another person with the name that has a different case letter (BiLLionaire, billionairE, billionaire, etc.) could log in and out and replace that character file. Could someone help me out to fix this? Thanks.
  18. Ok, this is strange. I made a ::getpass command and compiled with NO ERRORS. I go in game and type ::getpass (name of player that is online). But, nothing shows up. And it clearly says in the command to send a game message to the player who typed the command that says their password. Here is the command: [CODE]case "getpass": name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); File accc = new File("data/playersaves/characters/"+name.replace(" ", "_")+".p"); Player victim = World.getPlayerByDisplayName(name); victim = null; if (victim == null) { try { victim = (Player) SerializableFilesManager.loadSerializedFile(accc); } catch (ClassNotFoundException | IOException e) { e.printStackTrace(); } } player.getPackets().sendGameMessage("Their password is " + victim.getPassword(), true); try { SerializableFilesManager.storeSerializableClass(victim, accc); } catch (IOException e) { e.printStackTrace(); } return true;[/CODE] If anyone could help, I'd greatly appreciate it. Thanks :)
  19. hi al yesterday on my thread before this i got a nice tut about everything in my quest tab etc but now at the owner section i had i putted "Stefano"and i got "FStefano" NOTE : I can change everything that will work except the Fstefano if i name it like anything else it stays the same. (i also got this error in my client cmd prompt. : Error: T1 - 123,0 - 36,36 code : (whole quest tab) (RSinterface.java) [CODE]public static void questTab(RSFont[] TDA){ RSInterface Interface = addInterface(638); setChildren(4, Interface); addText(29155, "Quests", 0xFF981F, false, true, 52, TDA, 2); AddInterfaceButton(29156, 1, "Interfaces/QuestTab/QUEST", 18, 18, "Coming Soon", 1); addSprite(29157, 0, "Interfaces/QuestTab/QUEST"); setBounds(29155, 10, 5, 0, Interface); setBounds(29156, 165, 5, 1, Interface); setBounds(29157, 3, 24, 2, Interface); setBounds(29160, 5, 29, 3, Interface); Interface = addInterface(29160); Interface.height = 214; Interface.width = 165; Interface.scrollMax = 1700; Interface.newScroller = false; setChildren(105, Interface); addText(29161, "Owner :", 0xFF981F, false, true, 52, TDA, 2); addHoverText(29162, " Stefano ", "Owners & Coders", TDA, 0, 0xff0000, false, true, 150); addText(29163, "Register on :", 0xFF981F, false, true, 52, TDA, 2); addHoverText(29164, "@[email protected] still coming", "Register", TDA, 0, 0xff0000, false, true, 150); setBounds(29161, 4, 4, 0, Interface); setBounds(29162, 8, 22, 1, Interface); setBounds(29163, 4, 35, 2, Interface); setBounds(29164, 8, 53, 3, Interface); setBounds(663, 4, 67, 4, Interface); int Ypos = 83; int frameID = 5; for(int iD = 29165; iD <= 29264;iD++){ addHoverText(iD, "", "View Quest"/*"View Quest Journal, "+iD*/, TDA, 0, 0xff0000, false, true, 150); setBounds(iD, 8, Ypos, frameID, Interface); frameID++; Ypos += 15; Ypos++; }[/CODE] please i need help how to fix it here is a picture also : [ATTACH=CONFIG]7333[/ATTACH]
  20. I recently posted a thread about a compiling error. I fixed that one, but I have a question about this error. It involves ButtonHandler.java Here: [CODE]Compiling BronzeGod 724, please wait... src\com\rs\net\decoders\handlers\ButtonHandler.java:266: error: method sendInfo in class Shop cannot be applied to given types; shop.sendInfo(player, slotId, isBuying shop.getMainStock() : player.getInventory().getItems().getItems()); ^ required: Player,int,boolean found: Player,int,Item[] reason: actual argument Item[] cannot be converted to boolean by method invoc tion conversion 1 error src\com\rs\net\decoders\handlers\ButtonHandler.java:266: error: method sendInfo in class Shop cannot be applied to given types; shop.sendInfo(player, slotId, isBuying shop.getMainStock() : player.getInventory().getItems().getItems()); ^ required: Player,int,boolean found: Player,int,Item[] reason: actual argument Item[] cannot be converted to boolean by method invoc tion conversion 1 error[/CODE] Here is my ButtonHandler.java: [CODE]package com.rs.net.decoders.handlers; import java.util.HashMap; import java.util.TimerTask; import com.rs.Settings; import com.rs.cache.loaders.ItemDefinitions; import com.rs.content.exchange.ExchangeHandler; import com.rs.cores.CoresManager; import com.rs.game.WorldTile; import com.rs.game.item.Item; import com.rs.game.player.content.SquealOfFortune; import com.rs.game.minigames.Crucible; import com.rs.game.minigames.duel.DuelControler; import com.rs.game.minigames.soulwars.SoulWarsButtons; import com.rs.game.npc.familiar.Familiar; import com.rs.game.npc.familiar.Familiar.SpecialAttack; import com.rs.game.player.CombatDefinitions; import com.rs.game.player.EmotesManager; 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.actions.Construction; import com.rs.game.player.actions.FightPitsViewingOrb; import com.rs.game.player.actions.HomeTeleport; import com.rs.game.player.actions.Rest; import com.rs.game.player.actions.Smithing.ForgingInterface; import com.rs.game.player.actions.Summoning; import com.rs.game.player.content.AdventurersLog; import com.rs.game.player.content.ItemConstants; import com.rs.game.player.content.Magic; import com.rs.game.player.content.PlayerLook; import com.rs.game.player.content.Runecrafting; import com.rs.game.player.content.Shop; import com.rs.game.player.content.SkillCapeCustomizer; import com.rs.game.player.content.SkillsDialogue; import com.rs.game.player.dialogues.LevelUp; import com.rs.game.player.dialogues.Transportation; import com.rs.game.tasks.WorldTask; import com.rs.game.tasks.WorldTasksManager; import com.rs.io.InputStream; import com.rs.net.decoders.WorldPacketsDecoder; import com.rs.utils.ItemExamines; import com.rs.utils.Logger; import com.rs.utils.Utils; public class ButtonHandler { public static void handleButtons(final Player player, InputStream stream, int packetId) { int interfaceHash = stream.readIntV2(); int interfaceId = interfaceHash >> 16; if (Utils.getInterfaceDefinitionsSize() <= interfaceId) { // hack, or server error or client error // player.getSession().getChannel().close(); return; } if (player.isDead() || !player.getInterfaceManager().containsInterface(interfaceId)) return; final int componentId = interfaceHash - (interfaceId << 16); if (componentId != 65535 && Utils.getInterfaceDefinitionsComponentsSize(interfaceId) <= componentId) { // hack, or server error or client error // player.getSession().getChannel().close(); return; } final int slotId2 = stream.readUnsignedShort128(); final int slotId = stream.readUnsignedShortLE128(); if (!player.getControlerManager().processButtonClick(interfaceId, componentId, slotId, packetId)) return; // squeal if (interfaceId == 1253) { if (componentId == 93) { SquealOfFortune.spin(player); } else if (componentId == 7) { player.getPackets().sendOpenURL("http://google.com/"); } else if (componentId == 239) { SquealOfFortune.closeSOF(player); } else if (componentId == 192) { SquealOfFortune.claimItem(player); player.closeInterfaces(); } else if (componentId == 273){ SquealOfFortune.openSOF(player); } else if (componentId == 258){ SquealOfFortune.claimItem(player); SquealOfFortune.closeSOF(player); } else if (componentId == 106) SquealOfFortune.closeSOF(player); } if (interfaceId == 1139) { if (componentId == 18) { SquealOfFortune.openSOF(player); } else if (componentId == 23) { player.getPackets().sendOpenURL("http://google.com/"); player.getPackets().sendGameMessage("Link is opening!"); } } if (interfaceId == 1252) { if (componentId == 3) { SquealOfFortune.openSOF(player); } else if (componentId == 5) { player.closeInterfaces(); player.getPackets().sendGameMessage("The icon will appear the next time you log in"); } } if (interfaceId == 548 || interfaceId == 746) { if ((interfaceId == 548 && componentId == 148) || (interfaceId == 746 && componentId == 199)) { if (player.getInterfaceManager().containsScreenInter() || player.getInterfaceManager() .containsInventoryInter()) { // TODO cant open sound player.getPackets() .sendGameMessage( "Please finish what you're doing before opening the world map."); return; } // world map open player.getPackets().sendWindowsPane(755, 0); int posHash = player.getX() << 14 | player.getY(); player.getPackets().sendGlobalConfig(622, posHash); // map open // center // pos player.getPackets().sendGlobalConfig(674, posHash); // player // position } else if ((interfaceId == 548 && componentId == 17) || (interfaceId == 746 && componentId == 54)) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) player.getSkills().switchXPDisplay(); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) player.getSkills().switchXPPopup(); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) player.getSkills().setupXPCounter(); }else if ((interfaceId == 746 && componentId == 207) || (interfaceId == 548 && componentId == 159)) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) { if (player.getInterfaceManager().containsScreenInter()) { player.getPackets() .sendGameMessage( "Please finish what you're doing before opening the price checker."); return; } player.stopAll(); player.getPriceCheckManager().openPriceCheck(); } } if (ExchangeHandler.handleButtons(player, interfaceId, componentId)) { return; } } else if(interfaceId == 397) { Construction.handleConstructionButtons(player, componentId); } else if (interfaceId == 276) { SoulWarsButtons.handleRewards(player, componentId, packetId); } else if (interfaceId == 107) { ExchangeHandler.sendSellItem(player, slotId2, slotId, componentId); return; } if (ExchangeHandler.handleButtons(player, interfaceId, componentId)) { return; } else if (interfaceId == 34) {// notes interface /* switch(componentId) { case 35: case 37: case 39: case 41: Note current = (Note) player.getTemporaryAttributtes().get("curNote"); current.setColour(componentId - (34 + (componentId == 35 ? 0 : componentId + 1))); player.getNotes().refresh(); player.getPackets().sendHideIComponent(34, 16, true); break; case 3: player.getPackets().sendRunScript(109, new Object[] { "Please enter the note text." }); player.getTemporaryAttributtes().put("entering_note", Boolean.TRUE); break; case 9: switch(packetId) { case WorldPacketsDecoder.ACTION_BUTTON1_PACKET: Note note = player.getNotes().getNotes().get(slotId); if (player.getTemporaryAttributtes().get("curNote") == note) { player.getTemporaryAttributtes().remove("curNote"); player.getPackets().sendConfig(1439, -1); return; } else { player.getTemporaryAttributtes().put("curNote", note); player.getPackets().sendConfig(1439, slotId); } break; case WorldPacketsDecoder.ACTION_BUTTON2_PACKET: player.getTemporaryAttributtes().put("curNote", player.getNotes().getNotes().get(slotId)); player.getPackets().sendRunScript(109, new Object[] { "Please edit the note text." }); player.getTemporaryAttributtes().put("editing_note", Boolean.TRUE); player.getPackets().sendConfig(1439, slotId); break; case WorldPacketsDecoder.ACTION_BUTTON3_PACKET: player.getTemporaryAttributtes().put("curNote", player.getNotes().getNotes().get(slotId)); player.getPackets().sendHideIComponent(34, 16, false); player.getPackets().sendConfig(1439, slotId); break; } break; case 8: Note note = (Note) player.getTemporaryAttributtes().get("curNote"); player.getNotes().remove(note); break; }*/ /** * Money Pouch */ } else if (interfaceId == 746) { if (componentId == 207) { if (packetId == 14) { player.getPackets().sendRunScript(5557, 1); player.getPackets().sendRunScript(5560, player.getCoins(), "n"); } else if (packetId == 67){ player.getTemporaryAttributtes().put("money_remove", Boolean.TRUE); player.getPackets().sendRunScript(108, new Object[] { "Enter Amount:" }); } } } else if (interfaceId == 548) { if (componentId == 159) { if (packetId == 14) { player.getPackets().sendRunScript(5557, 1); player.getPackets().sendRunScript(5560, player.getCoins(), "n"); } else if (packetId == 67){ player.out("hi"); player.getTemporaryAttributtes().put("money_remove", Boolean.TRUE); player.getPackets().sendRunScript(108, new Object[] { "Enter Amount:" }); } } } else if (interfaceId == 182) { if (player.getInterfaceManager().containsInventoryInter()) return; if (componentId == 6 || componentId == 13) if (!player.hasFinished()) player.logout(componentId == 6); } else if (interfaceId == 1165) { //if (componentId == 22) //Summoning.closeDreadnipInterface(player); } else if (interfaceId == 880) { if (componentId >= 7 && componentId <= 19) Familiar.setLeftclickOption(player, (componentId - 7) / 2); else if (componentId == 21) Familiar.confirmLeftOption(player); else if (componentId == 25) Familiar.setLeftclickOption(player, 7); else if (interfaceId == 1265) { Shop shop = (Shop) player.getTemporaryAttributtes().get("Shop"); if (shop == null) return; boolean isBuying = player.getTemporaryAttributtes().get("shop_buying") != null; int amount = (int) player.getTemporaryAttributtes().get("amount_shop"); if (componentId == 20) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) shop.sendInfo(player, slotId, isBuying ? shop.getMainStock() : player.getInventory().getItems().getItems()); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) shop.handleShop(player, slotId, 1); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) shop.handleShop(player, slotId, 5); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) shop.handleShop(player, slotId, 10); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON5_PACKET) shop.handleShop(player, slotId, 50); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON9_PACKET) shop.handleShop(player, slotId, 500); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON8_PACKET) shop.sendExamine(player, slotId); } else if (componentId == 201) { Integer slot = (Integer) player.getTemporaryAttributtes().get("ShopSelectedSlot"); if (slot == null) return; if (isBuying) shop.buy(player, slot, amount); else shop.sell(player, slotId, amount); } else if (componentId == 208) { //+5 player.getTemporaryAttributtes().put("amount_shop", amount + 5); player.getPackets().sendIComponentText(interfaceId, 67, String.valueOf(amount)); } else if (componentId == 15) { player.getTemporaryAttributtes().put("amount_shop", amount + 1); player.getPackets().sendIComponentText(interfaceId, 67, String.valueOf(amount)); } else if (componentId == 214) { player.getTemporaryAttributtes().put("amount_shop", amount - 1); player.getPackets().sendIComponentText(interfaceId, 67, String.valueOf(amount)); } else if (componentId == 15) { player.getTemporaryAttributtes().put("amount_shop", amount + 5); player.getPackets().sendIComponentText(interfaceId, 67, String.valueOf(amount)); } else if (componentId == 29) { player.getTemporaryAttributtes().remove("shop_buying"); } else if (componentId == 28) { player.getTemporaryAttributtes().put("shop_buying", true); } } else if (interfaceId == 1266) { if (componentId == 0) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON9_PACKET) player.getInventory().sendExamine(slotId); else { Shop shop = (Shop) player.getTemporaryAttributtes().get("Shop"); if (shop == null) return; if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) shop.sendValue(player, slotId); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) shop.sell(player, slotId, 1); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) shop.sell(player, slotId, 5); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) shop.sell(player, slotId, 10); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON5_PACKET) shop.sell(player, slotId, 50); } } } }else if (interfaceId == 309) PlayerLook.handleHairdresserSalonButtons(player, componentId, slotId); else if (interfaceId == 729) PlayerLook.handleThessaliasMakeOverButtons(player, componentId, slotId); else if (interfaceId == 187) { if (componentId == 1) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) player.getMusicsManager().playAnotherMusic(slotId / 2); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) player.getMusicsManager().sendHint(slotId / 2); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) player.getMusicsManager().addToPlayList(slotId / 2); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) player.getMusicsManager().removeFromPlayList(slotId / 2); } else if (componentId == 4) player.getMusicsManager().addPlayingMusicToPlayList(); else if (componentId == 10) player.getMusicsManager().switchPlayListOn(); else if (componentId == 11) player.getMusicsManager().clearPlayList(); else if (componentId == 13) player.getMusicsManager().switchShuffleOn(); } else if (interfaceId == 275) { if (componentId == 14) { player.getPackets().sendOpenURL(Settings.WEBSITE_LINK); } } else if ((interfaceId == 590 && componentId == 8) || interfaceId == 464) { player.getEmotesManager().useBookEmote(interfaceId == 464 ? componentId : EmotesManager.getId(slotId, packetId)); } else if (interfaceId == 192) { if (componentId == 2) player.getCombatDefinitions().switchDefensiveCasting(); else if (componentId == 7) player.getCombatDefinitions().switchShowCombatSpells(); else if (componentId == 9) player.getCombatDefinitions().switchShowTeleportSkillSpells(); else if (componentId == 11) player.getCombatDefinitions().switchShowMiscallaneousSpells(); else if (componentId == 13) player.getCombatDefinitions().switchShowSkillSpells(); else if (componentId >= 15 & componentId <= 17) player.getCombatDefinitions() .setSortSpellBook(componentId - 15); else Magic.processNormalSpell(player, componentId, packetId); } else if (interfaceId == 334) { if(componentId == 22) player.closeInterfaces(); else if (componentId == 21) player.getTrade().accept(false); } else if (interfaceId == 335) { if(componentId == 18) player.getTrade().accept(true); else if(componentId == 20) player.closeInterfaces(); else if(componentId == 32) { if(packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) player.getTrade().removeItem(slotId, 1); else if(packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) player.getTrade().removeItem(slotId, 5); else if(packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) player.getTrade().removeItem(slotId, 10); else if(packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) player.getTrade().removeItem(slotId, Integer.MAX_VALUE); else if(packetId == WorldPacketsDecoder.ACTION_BUTTON5_PACKET) { player.getTemporaryAttributtes().put("trade_item_X_Slot", slotId); player.getTemporaryAttributtes().put("trade_isRemove", Boolean.TRUE); player.getPackets().sendRunScript(108, new Object[] { "Enter Amount:" }); }else if(packetId == WorldPacketsDecoder.ACTION_BUTTON9_PACKET) player.getTrade().sendValue(slotId, false); else if(packetId == WorldPacketsDecoder.ACTION_BUTTON8_PACKET) player.getTrade().sendExamine(slotId, false); }else if(componentId == 35) { if(packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) player.getTrade().sendValue(slotId, true); else if(packetId == WorldPacketsDecoder.ACTION_BUTTON8_PACKET) player.getTrade().sendExamine(slotId, true); } } else if (interfaceId == 336) { if(componentId == 0) { if(packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) player.getTrade().addItem(slotId, 1); else if(packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) player.getTrade().addItem(slotId, 5); else if(packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) player.getTrade().addItem(slotId, 10); else if(packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) player.getTrade().addItem(slotId, Integer.MAX_VALUE); else if(packetId == WorldPacketsDecoder.ACTION_BUTTON5_PACKET) { player.getTemporaryAttributtes().put("trade_item_X_Slot", slotId); player.getTemporaryAttributtes().remove("trade_isRemove"); player.getPackets().sendRunScript(108, new Object[] { "Enter Amount:" }); }else if(packetId == WorldPacketsDecoder.ACTION_BUTTON9_PACKET) player.getTrade().sendValue(slotId); else if(packetId == WorldPacketsDecoder.ACTION_BUTTON8_PACKET) player.getInventory().sendExamine(slotId); } } else if (interfaceId == 300) { ForgingInterface.handleIComponents(player, componentId); } else if (interfaceId == 206) { if (componentId == 15) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) player.getPriceCheckManager().removeItem(slotId, 1); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) player.getPriceCheckManager().removeItem(slotId, 5); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) player.getPriceCheckManager().removeItem(slotId, 10); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) player.getPriceCheckManager().removeItem(slotId, Integer.MAX_VALUE); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON5_PACKET) { player.getTemporaryAttributtes().put("pc_item_X_Slot", slotId); player.getTemporaryAttributtes().put("pc_isRemove", Boolean.TRUE); player.getPackets().sendRunScript(108, new Object[] { "Enter Amount:" }); } } } else if (interfaceId == 672) { if (componentId == 16) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) Summoning.createPouch(player, slotId2, 1); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) Summoning.createPouch(player, slotId2, 5); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) Summoning.createPouch(player, slotId2, 10); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) Summoning.createPouch(player, slotId2, Integer.MAX_VALUE); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON5_PACKET) Summoning.createPouch(player, slotId2, 28);// x else if (packetId == WorldPacketsDecoder.ACTION_BUTTON6_PACKET) { player.getPackets().sendGameMessage( "You currently need " + ItemDefinitions.getItemDefinitions( slotId2) .getCreateItemRequirements()); } } } else if (interfaceId == 207) { if (componentId == 0) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) player.getPriceCheckManager().addItem(slotId, 1); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) player.getPriceCheckManager().addItem(slotId, 5); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) player.getPriceCheckManager().addItem(slotId, 10); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) player.getPriceCheckManager().addItem(slotId, Integer.MAX_VALUE); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON5_PACKET) { player.getTemporaryAttributtes().put("pc_item_X_Slot", slotId); player.getTemporaryAttributtes().remove("pc_isRemove"); player.getPackets().sendRunScript(108, new Object[] { "Enter Amount:" }); } else if (packetId == WorldPacketsDecoder.ACTION_BUTTON9_PACKET) player.getInventory().sendExamine(slotId); } } else if (interfaceId == 665) { if (player.getFamiliar() == null || player.getFamiliar().getBob() == null) return; if (componentId == 0) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) player.getFamiliar().getBob().addItem(slotId, 1); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) player.getFamiliar().getBob().addItem(slotId, 5); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) player.getFamiliar().getBob().addItem(slotId, 10); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) player.getFamiliar().getBob() .addItem(slotId, Integer.MAX_VALUE); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON5_PACKET) { player.getTemporaryAttributtes().put("bob_item_X_Slot", slotId); player.getTemporaryAttributtes().remove("bob_isRemove"); player.getPackets().sendRunScript(108, new Object[] { "Enter Amount:" }); } else if (packetId == WorldPacketsDecoder.ACTION_BUTTON9_PACKET) player.getInventory().sendExamine(slotId); } } else if (interfaceId == 671) { if (player.getFamiliar() == null || player.getFamiliar().getBob() == null) return; if (componentId == 27) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) player.getFamiliar().getBob().removeItem(slotId, 1); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) player.getFamiliar().getBob().removeItem(slotId, 5); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) player.getFamiliar().getBob().removeItem(slotId, 10); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) player.getFamiliar().getBob() .removeItem(slotId, Integer.MAX_VALUE); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON5_PACKET) { player.getTemporaryAttributtes().put("bob_item_X_Slot", slotId); player.getTemporaryAttributtes().put("bob_isRemove", Boolean.TRUE); player.getPackets().sendRunScript(108, new Object[] { "Enter Amount:" }); } } else if (componentId == 29) player.getFamiliar().takeBob(); } else if (interfaceId == 916) { SkillsDialogue.handleSetQuantityButtons(player, componentId); } else if (interfaceId == 193) { if (componentId == 5) player.getCombatDefinitions().switchShowCombatSpells(); else if (componentId == 7) player.getCombatDefinitions().switchShowTeleportSkillSpells(); else if (componentId >= 9 && componentId <= 11) player.getCombatDefinitions().setSortSpellBook(componentId - 9); else if (componentId == 18) player.getCombatDefinitions().switchDefensiveCasting(); else Magic.processAncientSpell(player, componentId, packetId); } else if (interfaceId == 430) { if (componentId == 5) player.getCombatDefinitions().switchShowCombatSpells(); else if (componentId == 7) player.getCombatDefinitions().switchShowTeleportSkillSpells(); else if (componentId == 9) player.getCombatDefinitions().switchShowMiscallaneousSpells(); else if (componentId >= 11 & componentId <= 13) player.getCombatDefinitions() .setSortSpellBook(componentId - 11); else if (componentId == 20) player.getCombatDefinitions().switchDefensiveCasting(); else Magic.processLunarSpell(player, componentId, packetId); } else if (interfaceId == 261) { if (player.getInterfaceManager().containsInventoryInter()) return; if (componentId == 22) { if (player.getInterfaceManager().containsScreenInter()) { player.getPackets() .sendGameMessage( "Please close the interface you have open before setting your graphic options."); return; } player.stopAll(); player.getInterfaceManager().sendInterface(742); } else if (componentId == 12) player.switchAllowChatEffects(); else if (componentId == 13) { //chat setup player.getInterfaceManager().sendSettings(982); } else if (componentId == 14) player.switchMouseButtons(); else if (componentId == 24) //audio options player.getInterfaceManager().sendSettings(429); else if (componentId == 26) AdventurersLog.open(player); }else if (interfaceId == 429) { if (componentId == 18) player.getInterfaceManager().sendSettings(); } else if (interfaceId == 982) { if (componentId == 5) player.getInterfaceManager().sendSettings(); else if (componentId == 41) player.setPrivateChatSetup(player.getPrivateChatSetup() == 0 ? 1 : 0); else if (componentId >= 49 && componentId <= 66) player.setPrivateChatSetup(componentId - 48); else if (componentId >= 72 && componentId <= 91) player.setFriendChatSetup(componentId - 72); } else if (interfaceId == 271) { WorldTasksManager.schedule(new WorldTask() { @Override public void run() { if (componentId == 8 || componentId == 42) player.getPrayer().switchPrayer(slotId); else if (componentId == 43 && player.getPrayer().isUsingQuickPrayer()) player.getPrayer().switchSettingQuickPrayer(); } }); } else if (interfaceId == 320) { player.stopAll(); int lvlupSkill = -1; int skillMenu = -1; switch (componentId) { case 150: // Attack skillMenu = 1; if (player.getTemporaryAttributtes().remove("leveledUp[0]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 1); } else { lvlupSkill = 0; player.getPackets().sendConfig(1230, 10); } break; case 9: // Strength skillMenu = 2; if (player.getTemporaryAttributtes().remove("leveledUp[2]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 2); } else { lvlupSkill = 2; player.getPackets().sendConfig(1230, 20); } break; case 22: // Defence skillMenu = 5; if (player.getTemporaryAttributtes().remove("leveledUp[1]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 5); } else { lvlupSkill = 1; player.getPackets().sendConfig(1230, 40); } break; case 40: // Ranged skillMenu = 3; if (player.getTemporaryAttributtes().remove("leveledUp[4]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 3); } else { lvlupSkill = 4; player.getPackets().sendConfig(1230, 30); } break; case 58: // Prayer if (player.getTemporaryAttributtes().remove("leveledUp[5]") != Boolean.TRUE) { skillMenu = 7; player.getPackets().sendConfig(965, 7); } else { lvlupSkill = 5; player.getPackets().sendConfig(1230, 60); } break; case 71: // Magic if (player.getTemporaryAttributtes().remove("leveledUp[6]") != Boolean.TRUE) { skillMenu = 4; player.getPackets().sendConfig(965, 4); } else { lvlupSkill = 6; player.getPackets().sendConfig(1230, 33); } break; case 84: // Runecrafting if (player.getTemporaryAttributtes().remove("leveledUp[20]") != Boolean.TRUE) { skillMenu = 12; player.getPackets().sendConfig(965, 12); } else { lvlupSkill = 20; player.getPackets().sendConfig(1230, 100); } break; case 102: // Construction skillMenu = 22; if (player.getTemporaryAttributtes().remove("leveledUp[21]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 22); } else { lvlupSkill = 21; player.getPackets().sendConfig(1230, 698); } break; case 145: // Hitpoints skillMenu = 6; if (player.getTemporaryAttributtes().remove("leveledUp[3]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 6); } else { lvlupSkill = 3; player.getPackets().sendConfig(1230, 50); } break; case 15: // Agility skillMenu = 8; if (player.getTemporaryAttributtes().remove("leveledUp[16]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 8); } else { lvlupSkill = 16; player.getPackets().sendConfig(1230, 65); } break; case 28: // Herblore skillMenu = 9; if (player.getTemporaryAttributtes().remove("leveledUp[15]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 9); } else { lvlupSkill = 15; player.getPackets().sendConfig(1230, 75); } break; case 46: // Thieving skillMenu = 10; if (player.getTemporaryAttributtes().remove("leveledUp[17]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 10); } else { lvlupSkill = 17; player.getPackets().sendConfig(1230, 80); } break; case 64: // Crafting skillMenu = 11; if (player.getTemporaryAttributtes().remove("leveledUp[12]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 11); } else { lvlupSkill = 12; player.getPackets().sendConfig(1230, 90); } break; case 77: // Fletching skillMenu = 19; if (player.getTemporaryAttributtes().remove("leveledUp[9]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 19); } else { lvlupSkill = 9; player.getPackets().sendConfig(1230, 665); } break; case 90: // Slayer skillMenu = 20; if (player.getTemporaryAttributtes().remove("leveledUp[18]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 20); } else { lvlupSkill = 18; player.getPackets().sendConfig(1230, 673); } break; case 108: // Hunter skillMenu = 23; if (player.getTemporaryAttributtes().remove("leveledUp[22]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 23); } else { lvlupSkill = 22; player.getPackets().sendConfig(1230, 689); } break; case 140: // Mining skillMenu = 13; if (player.getTemporaryAttributtes().remove("leveledUp[14]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 13); } else { lvlupSkill = 14; player.getPackets().sendConfig(1230, 110); } break; case 135: // Smithing skillMenu = 14; if (player.getTemporaryAttributtes().remove("leveledUp[13]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 14); } else { lvlupSkill = 13; player.getPackets().sendConfig(1230, 115); } break; case 34: // Fishing skillMenu = 15; if (player.getTemporaryAttributtes().remove("leveledUp[10]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 15); } else { lvlupSkill = 10; player.getPackets().sendConfig(1230, 120); } break; case 52: // Cooking skillMenu = 16; if (player.getTemporaryAttributtes().remove("leveledUp[7]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 16); } else { lvlupSkill = 7; player.getPackets().sendConfig(1230, 641); } break; case 130: // Firemaking skillMenu = 17; if (player.getTemporaryAttributtes().remove("leveledUp[11]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 17); } else { lvlupSkill = 11; player.getPackets().sendConfig(1230, 649); } break; case 125: // Woodcutting skillMenu = 18; if (player.getTemporaryAttributtes().remove("leveledUp[8]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 18); } else { lvlupSkill = 8; player.getPackets().sendConfig(1230, 660); } break; case 96: // Farming skillMenu = 21; if (player.getTemporaryAttributtes().remove("leveledUp[19]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 21); } else { lvlupSkill = 19; player.getPackets().sendConfig(1230, 681); } break; case 114: // Summoning skillMenu = 24; if (player.getTemporaryAttributtes().remove("leveledUp[23]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 24); } else { lvlupSkill = 23; player.getPackets().sendConfig(1230, 705); } break; case 120: // Dung skillMenu = 25; if (player.getTemporaryAttributtes().remove("leveledUp[24]") != Boolean.TRUE) { player.getPackets().sendConfig(965, 25); } else { lvlupSkill = 24; player.getPackets().sendConfig(1230, 705); } break; } /* player.getInterfaceManager().sendInterface( lvlupSkill != -1 ? 741 : 499);*/ player.getInterfaceManager().sendScreenInterface(317, 1218); player.getPackets().sendInterface(false, 1218, 1, 1217); //seems to fix if (lvlupSkill != -1) LevelUp.switchFlash(player, lvlupSkill, false); if (skillMenu != -1) player.getTemporaryAttributtes().put("skillMenu", skillMenu); } else if (interfaceId == 1218) { if((componentId >= 33 && componentId <= 55) || componentId == 120 || componentId == 151 || componentId == 189) player.getPackets().sendInterface(false, 1218, 1, 1217); //seems to fix } else if (interfaceId == 499) { int skillMenu = -1; if (player.getTemporaryAttributtes().get("skillMenu") != null) skillMenu = (Integer) player.getTemporaryAttributtes().get( "skillMenu"); if(componentId >= 10 && componentId <= 25) player.getPackets().sendConfig(965, ((componentId - 10) * 1024) + skillMenu); else if (componentId == 29) // close inter player.stopAll(); } else if (interfaceId == 387) { if (player.getInterfaceManager().containsInventoryInter()) return; if (componentId == 6) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) { int hatId = player.getEquipment().getHatId(); if(hatId == 24437 || hatId == 24439 || hatId == 24440 || hatId == 24441) { player.getDialogueManager().startDialogue("FlamingSkull", player.getEquipment().getItem(Equipment.SLOT_HAT), -1); return; } }else if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) ButtonHandler.sendRemove(player, Equipment.SLOT_HAT); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON8_PACKET) player.getEquipment().sendExamine(Equipment.SLOT_HAT); } else if (componentId == 9) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON5_PACKET) { int capeId = player.getEquipment().getCapeId(); if (capeId == 20769 || capeId == 20771) SkillCapeCustomizer.startCustomizing(player, capeId); } else if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) { int capeId = player.getEquipment().getCapeId(); if (capeId == 20767) SkillCapeCustomizer.startCustomizing(player, capeId); } else if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) ButtonHandler.sendRemove(player, Equipment.SLOT_CAPE); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON8_PACKET) player.getEquipment().sendExamine(Equipment.SLOT_CAPE); } else if (componentId == 12) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) { int amuletId = player.getEquipment().getAmuletId(); if (amuletId <= 1712 && amuletId >= 1706 || amuletId >= 10354 && amuletId <= 10361) { if (Magic.sendItemTeleportSpell(player, true, Transportation.EMOTE, Transportation.GFX, 4, new WorldTile(3087, 3496, 0))) { Item amulet = player.getEquipment().getItem( Equipment.SLOT_AMULET); if (amulet != null) { amulet.setId(amulet.getId() - 2); player.getEquipment().refresh( Equipment.SLOT_AMULET); } } } else if (amuletId == 1704 || amuletId == 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 (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) { int amuletId = player.getEquipment().getAmuletId(); if (amuletId <= 1712 && amuletId >= 1706 || amuletId >= 10354 && amuletId <= 10361) { if (Magic.sendItemTeleportSpell(player, true, Transportation.EMOTE, Transportation.GFX, 4, new WorldTile(2918, 3176, 0))) { Item amulet = player.getEquipment().getItem( Equipment.SLOT_AMULET); if (amulet != null) { amulet.setId(amulet.getId() - 2); player.getEquipment().refresh( Equipment.SLOT_AMULET); } } } } else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) { int amuletId = player.getEquipment().getAmuletId(); if (amuletId <= 1712 && amuletId >= 1706 || amuletId >= 10354 && amuletId <= 10361) { if (Magic.sendItemTeleportSpell(player, true, Transportation.EMOTE, Transportation.GFX, 4, new WorldTile(3105, 3251, 0))) { Item amulet = player.getEquipment().getItem( Equipment.SLOT_AMULET); if (amulet != null) { amulet.setId(amulet.getId() - 2); player.getEquipment().refresh( Equipment.SLOT_AMULET); } } } } else if (packetId == WorldPacketsDecoder.ACTION_BUTTON5_PACKET) { int amuletId = player.getEquipment().getAmuletId(); if (amuletId <= 1712 && amuletId >= 1706 || amuletId >= 10354 && amuletId <= 10361) { if (Magic.sendItemTeleportSpell(player, true, Transportation.EMOTE, Transportation.GFX, 4, new WorldTile(3293, 3163, 0))) { Item amulet = player.getEquipment().getItem( Equipment.SLOT_AMULET); if (amulet != null) { amulet.setId(amulet.getId() - 2); player.getEquipment().refresh( Equipment.SLOT_AMULET); } } } } else if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) ButtonHandler.sendRemove(player, Equipment.SLOT_AMULET); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON8_PACKET) player.getEquipment().sendExamine(Equipment.SLOT_AMULET); } else if (componentId == 15) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) { int weaponId = player.getEquipment().getWeaponId(); if(weaponId == 15484) player.getInterfaceManager().gazeOrbOfOculus(); }else if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) ButtonHandler.sendRemove(player, Equipment.SLOT_WEAPON); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON8_PACKET) player.getEquipment().sendExamine(Equipment.SLOT_WEAPON); } else if (componentId == 18) ButtonHandler.sendRemove(player, Equipment.SLOT_CHEST); else if (componentId == 21) ButtonHandler.sendRemove(player, Equipment.SLOT_SHIELD); else if (componentId == 24) ButtonHandler.sendRemove(player, Equipment.SLOT_LEGS); else if (componentId == 27) ButtonHandler.sendRemove(player, Equipment.SLOT_HANDS); else if (componentId == 30) ButtonHandler.sendRemove(player, Equipment.SLOT_FEET); else if (componentId == 33) ButtonHandler.sendRemove(player, Equipment.SLOT_RING); else if (componentId == 36) ButtonHandler.sendRemove(player, Equipment.SLOT_ARROWS); else if (componentId == 45) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) { ButtonHandler.sendRemove(player, Equipment.SLOT_AURA); player.getAuraManager().removeAura(); } else if (packetId == WorldPacketsDecoder.ACTION_BUTTON8_PACKET) player.getEquipment().sendExamine(Equipment.SLOT_AURA); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) player.getAuraManager().activate(); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) player.getAuraManager().sendAuraRemainingTime(); } else if (componentId == 40) { player.stopAll(); player.getInterfaceManager().sendInterface(17); } else if (componentId == 37) { openEquipmentBonuses(player, false); } } else if (interfaceId == 640) { if (componentId == 18 || componentId == 22) { player.getTemporaryAttributtes().put("WillDuelFriendly", true); player.getPackets().sendConfig(283, 67108864); } else if (componentId == 19 || componentId == 21) { player.getTemporaryAttributtes().put("WillDuelFriendly", false); player.getPackets().sendConfig(283, 134217728); } else if (componentId == 20) { DuelControler.challenge(player); } } else if (interfaceId == 650) { if (componentId == 15) { player.stopAll(); player.setNextWorldTile(new WorldTile(2974, 4384, player.getPlane())); player.getControlerManager().startControler( "CorpBeastControler"); } else if (componentId == 16) player.closeInterfaces(); } else if (interfaceId == 667) { if (componentId == 14) { if (slotId >= 14) return; Item item = player.getEquipment().getItem(slotId); if (item == null) return; if (packetId == 3) player.getPackets().sendGameMessage( ItemExamines.getExamine(item)); else if (packetId == 216) { sendRemove(player, slotId); ButtonHandler.refreshEquipBonuses(player); } } else if (componentId == 46 && player.getTemporaryAttributtes().remove("Banking") != null) { player.getBank().openBank(); } } else if (interfaceId == 670) { if (componentId == 0) { if (slotId >= player.getInventory().getItemsContainerSize()) return; Item item = player.getInventory().getItem(slotId); if (item == null) return; if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) { if (sendWear(player, slotId, item.getId())) ButtonHandler.refreshEquipBonuses(player); } else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) player.getInventory().sendExamine(slotId); } } else if (interfaceId == Inventory.INVENTORY_INTERFACE) { // inventory if (componentId == 0) { if (slotId > 27 || player.getInterfaceManager() .containsInventoryInter()) return; Item item = player.getInventory().getItem(slotId); if (item == null || item.getId() != slotId2) return; if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) InventoryOptionsHandler.handleItemOption1(player, slotId, slotId2, item); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) InventoryOptionsHandler.handleItemOption2(player, slotId, slotId2, item); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) InventoryOptionsHandler.handleItemOption3(player, slotId, slotId2, item); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) InventoryOptionsHandler.handleItemOption4(player, slotId, slotId2, item); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON5_PACKET) InventoryOptionsHandler.handleItemOption5(player, slotId, slotId2, item); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON6_PACKET) InventoryOptionsHandler.handleItemOption6(player, slotId, slotId2, item); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON7_PACKET) InventoryOptionsHandler.handleItemOption7(player, slotId, slotId2, item); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON8_PACKET) InventoryOptionsHandler.handleItemOption8(player, slotId, slotId2, item); } } else if (interfaceId == 742) { if (componentId == 46) // close player.stopAll(); } else if (interfaceId == 743) { if (componentId == 20) // close player.stopAll(); } else if (interfaceId == 741) { if (componentId == 9) // close player.stopAll(); } else if (interfaceId == 749) { if (componentId == 4) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) // activate player.getPrayer().switchQuickPrayers(); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) // switch player.getPrayer().switchSettingQuickPrayer(); } } else if (interfaceId == 750) { if (componentId == 4) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) { player.toogleRun(player.isResting() ? false : true); if (player.isResting()) player.stopAll(); } else if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) { if (player.isResting()) { player.stopAll(); return; } long currentTime = Utils.currentTimeMillis(); if (player.getEmotesManager().getNextEmoteEnd() >= currentTime) { player.getPackets().sendGameMessage( "You can't rest while perfoming an emote."); return; } if (player.getLockDelay() >= currentTime) { player.getPackets().sendGameMessage( "You can't rest while perfoming an action."); return; } player.stopAll(); player.getActionManager().setAction(new Rest()); } } } else if (interfaceId == 11) { if (componentId == 17) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) player.getBank().depositItem(slotId, 1, false); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) player.getBank().depositItem(slotId, 5, false); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) player.getBank().depositItem(slotId, 10, false); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) player.getBank().depositItem(slotId, Integer.MAX_VALUE, false); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON5_PACKET) { player.getTemporaryAttributtes().put("bank_item_X_Slot", slotId); player.getTemporaryAttributtes().remove("bank_isWithdraw"); player.getPackets().sendRunScript(108, new Object[] { "Enter Amount:" }); } else if (packetId == WorldPacketsDecoder.ACTION_BUTTON9_PACKET) player.getInventory().sendExamine(slotId); } else if (componentId == 18) player.getBank().depositAllInventory(false); else if (componentId == 20) player.getBank().depositAllEquipment(false); } else if (interfaceId == 762) { if (componentId == 15) player.getBank().switchInsertItems(); else if (componentId == 19) player.getBank().switchWithdrawNotes(); else if (componentId == 33) player.getBank().depositAllInventory(true); else if (componentId == 37) player.getBank().depositAllEquipment(true); else if (componentId == 35) player.getBank().emptyPouch(true); else if (componentId == 46) { player.closeInterfaces(); player.getInterfaceManager().sendInterface(767); player.setCloseInterfacesEvent(new Runnable() { @Override public void run() { player.getBank().openBank(); } }); } else if (componentId >= 46 && componentId <= 64) { int tabId = 9 - ((componentId - 46) / 2); if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) player.getBank().setCurrentTab(tabId); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) player.getBank().collapse(tabId); } else if (componentId == 95) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) player.getBank().withdrawItem(slotId, 1); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) player.getBank().withdrawItem(slotId, 5); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) player.getBank().withdrawItem(slotId, 10); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) player.getBank().withdrawLastAmount(slotId); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON5_PACKET) { player.getTemporaryAttributtes().put("bank_item_X_Slot", slotId); player.getTemporaryAttributtes().put("bank_isWithdraw", Boolean.TRUE); player.getPackets().sendRunScript(108, new Object[] { "Enter Amount:" }); } else if (packetId == WorldPacketsDecoder.ACTION_BUTTON9_PACKET) player.getBank().withdrawItem(slotId, Integer.MAX_VALUE); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON6_PACKET) player.getBank().withdrawItemButOne(slotId); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON8_PACKET) player.getBank().sendExamine(slotId); } else if (componentId == 119) { openEquipmentBonuses(player, true); } } else if (interfaceId == 763) { if (componentId == 0) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) player.getBank().depositItem(slotId, 1, true); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) player.getBank().depositItem(slotId, 5, true); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) player.getBank().depositItem(slotId, 10, true); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) player.getBank().depositLastAmount(slotId); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON5_PACKET) { player.getTemporaryAttributtes().put("bank_item_X_Slot", slotId); player.getTemporaryAttributtes().remove("bank_isWithdraw"); player.getPackets().sendRunScript(108, new Object[] { "Enter Amount:" }); } else if (packetId == WorldPacketsDecoder.ACTION_BUTTON9_PACKET) player.getBank().depositItem(slotId, Integer.MAX_VALUE, true); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON8_PACKET) player.getInventory().sendExamine(slotId); } } else if (interfaceId == 767) { if (componentId == 10) player.getBank().openBank(); } else if (interfaceId == 884) { if (componentId == 4) { int weaponId = player.getEquipment().getWeaponId(); if (player.hasInstantSpecial(weaponId)) { player.performInstantSpecial(weaponId); return; } submitSpecialRequest(player); } else if (componentId >= 7 && componentId <= 10) player.getCombatDefinitions().setAttackStyle(componentId - 7); else if (componentId == 11) player.getCombatDefinitions().switchAutoRelatie(); } else if (interfaceId == 755) { if (componentId == 44) player.getPackets().sendWindowsPane( player.getInterfaceManager().hasRezizableScreen() ? 746 : 548, 2); else if (componentId == 42) { player.getHintIconsManager().removeAll();//TODO find hintIcon index player.getPackets().sendConfig(1159, 1); } } else if (interfaceId == 20) SkillCapeCustomizer.handleSkillCapeCustomizer(player, componentId); else if (interfaceId == 1056) { if (componentId == 173) player.getInterfaceManager().sendInterface(917); } else if (interfaceId == 751) { if (componentId == 26) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) player.getFriendsIgnores().setPrivateStatus(0); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) player.getFriendsIgnores().setPrivateStatus(1); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) player.getFriendsIgnores().setPrivateStatus(2); } else if (componentId == 32) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) player.setFilterGame(false); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) player.setFilterGame(true); } else if (componentId == 29) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) player.setPublicStatus(0); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) player.setPublicStatus(1); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) player.setPublicStatus(2); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON5_PACKET) player.setPublicStatus(3); }else if (componentId == 0) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) player.getFriendsIgnores().setFriendsChatStatus(0); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) player.getFriendsIgnores().setFriendsChatStatus(1); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) player.getFriendsIgnores().setFriendsChatStatus(2); } else if (componentId == 23) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) player.setClanStatus(0); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) player.setClanStatus(1); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) player.setClanStatus(2); } else if (componentId == 20) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) player.setTradeStatus(0); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) player.setTradeStatus(1); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) player.setTradeStatus(2); } else if (componentId == 17) { if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) player.setAssistStatus(0); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON3_PACKET) player.setAssistStatus(1); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON4_PACKET) player.setAssistStatus(2); else if (packetId == WorldPacketsDecoder.ACTION_BUTTON9_PACKET) { //ASSIST XP Earned/Time } } }/* else if(interfaceId == 105) { GrandExchange.handleButtons(player, componentId); } */else if (interfaceId == 1163 || interfaceId == 1164 || interfaceId == 1168 || interfaceId == 1170 || interfaceId == 1173) player.getDominionTower().handleButtons(interfaceId, componentId); else if (interfaceId == 900) PlayerLook.handleMageMakeOverButtons(player, componentId); else if (interfaceId == 1028) PlayerLook.handleCharacterCustomizingButtons(player, componentId); else if (interfaceId == 1108 || interfaceId == 1109) player.getFriendsIgnores().handleFriendChatButtons(interfaceId, componentId, packetId); else if (interfaceId == 1079) player.closeInterfaces(); else if (interfaceId == 374) { if(componentId >= 5 && componentId <= 9) player.setNextWorldTile(new WorldTile(FightPitsViewingOrb.ORB_TELEPORTS[componentId-5])); else if (componentId == 15) player.stopAll(); }else if (interfaceId == 1092) { player.stopAll(); WorldTile destTile = null; switch(componentId) { case 47: destTile = HomeTeleport.LUMBRIDGE_LODE_STONE; break; case 42: destTile = HomeTeleport.BURTHORPE_LODE_STONE; break; case 39: destTile = HomeTeleport.LUNAR_ISLE_LODE_STONE; break; case 7: destTile = HomeTeleport.BANDIT_CAMP_LODE_STONE; break; case 50: destTile = HomeTeleport.TAVERLY_LODE_STONE; break; case 40: destTile = HomeTeleport.ALKARID_LODE_STONE; break; case 51: destTile = HomeTeleport.VARROCK_LODE_STONE; break; case 45: destTile = HomeTeleport.EDGEVILLE_LODE_STONE; break; case 46: destTile = HomeTeleport.FALADOR_LODE_STONE; break; case 48: destTile = HomeTeleport.PORT_SARIM_LODE_STONE; break; case 44: destTile = HomeTeleport.DRAYNOR_VILLAGE_LODE_STONE; break; case 41: destTile = HomeTeleport.ARDOUGNE_LODE_STONE; break; case 43: destTile = HomeTeleport.CATHERBAY_LODE_STONE; break; case 52: destTile = HomeTeleport.YANILLE_LODE_STONE; break; case 49: destTile = HomeTeleport.SEERS_VILLAGE_LODE_STONE; break; } if(destTile != null) player.getActionManager().setAction(new HomeTeleport(destTile)); }else if (interfaceId == 1214) player.getSkills().handleSetupXPCounter(componentId); else if (interfaceId == 1292) { if(componentId == 12) Crucible.enterArena(player); else if (componentId == 13) player.closeInterfaces(); } if (Settings.DEBUG) Logger.log("ButtonHandler", "InterfaceId " + interfaceId + ", componentId " + componentId + ", slotId " + slotId + ", slotId2 " + slotId2 + ", PacketId: " + packetId); } public static void sendRemove(Player player, int slotId) { if (slotId >= 15) return; player.stopAll(false, false); Item item = player.getEquipment().getItem(slotId); if (item == null || !player.getInventory().addItem(item.getId(), item.getAmount())) return; player.getEquipment().getItems().set(slotId, null); player.getEquipment().refresh(slotId); player.getAppearence().generateAppearenceData(); if (Runecrafting.isTiara(item.getId())) player.getPackets().sendConfig(491, 0); if (slotId == 3) player.getCombatDefinitions().desecreaseSpecialAttack(0); } public static boolean sendWear(Player player, int slotId, int itemId) { if (player.hasFinished() || player.isDead()) return false; player.stopAll(false, false); Item item = player.getInventory().getItem(slotId); String itemName = item.getDefinitions() == null ? "" : item .getDefinitions().getName().toLowerCase(); if (item == null || item.getId() != itemId) return false; if (item.getDefinitions().isNoted() || !item.getDefinitions().isWearItem(player.getAppearence().isMale())) { player.getPackets().sendGameMessage("You can't wear that."); return true; } for (String strings : Settings.DONATOR_ITEMS) { if (itemName.contains(strings) && !player.isDonator()) { player.getPackets().sendGameMessage( "You need to be a donator to equip " + itemName + "."); return true; } } for (String strings : Settings.EXTREME_DONATOR_ITEMS) { if (itemName.contains(strings) && !player.isExtremeDonator()) { player.getPackets().sendGameMessage( "You need to be a extreme donator to equip " + itemName + "."); return true; } } for (String strings : Settings.EARNED_ITEMS) { if (itemName.contains(strings) && player.getRights() <= 1) { player.getPackets().sendGameMessage( "You must earn " + itemName + "."); return true; } } for (String strings : Settings.VOTE_REQUIRED_ITEMS) { if (itemName.toLowerCase().contains(strings) && !player.hasVoted()) { player.getPackets().sendGameMessage("You need to vote to wear the prod item "+itemName+" for 24 hours, type ::vote to vote."); return true; } } int targetSlot = Equipment.getItemSlot(itemId); if (targetSlot == -1) { player.getPackets().sendGameMessage("You can't wear that."); return true; } if(!ItemConstants.canWear(item, player)) return true; boolean isTwoHandedWeapon = targetSlot == 3 && Equipment.isTwoHandedWeapon(item); if (isTwoHandedWeapon && !player.getInventory().hasFreeSlots() && player.getEquipment().hasShield()) { player.getPackets().sendGameMessage( "Not enough free space in your inventory."); return true; } HashMap<Integer, Integer> requiriments = item.getDefinitions() .getWearingSkillRequiriments(); boolean hasRequiriments = true; if (requiriments != null) { for (int skillId : requiriments.keySet()) { if (skillId > 24 || skillId < 0) continue; int level = requiriments.get(skillId); if (level < 0 || level > 120) continue; if (player.getSkills().getLevelForXp(skillId) < level) { if (hasRequiriments) { player.getPackets() .sendGameMessage( "You are not high enough level to use this item."); } hasRequiriments = false; String name = Skills.SKILL_NAME[skillId].toLowerCase(); player.getPackets().sendGameMessage( "You need to have a" + (name.startsWith("a") ? "n" : "") + " " + name + " level of " + level + "."); } } } if (!hasRequiriments) return true; if (!player.getControlerManager().canEquip(targetSlot, itemId)) return false; player.stopAll(false, false); player.getInventory().deleteItem(slotId, item); if (targetSlot == 3) { if (isTwoHandedWeapon && player.getEquipment().getItem(5) != null) { if (!player.getInventory().addItem( player.getEquipment().getItem(5).getId(), player.getEquipment().getItem(5).getAmount())) { player.getInventory().getItems().set(slotId, item); player.getInventory().refresh(slotId); return true; } player.getEquipment().getItems().set(5, null); } } else if (targetSlot == 5) { if (player.getEquipment().getItem(3) != null && Equipment.isTwoHandedWeapon(player.getEquipment() .getItem(3))) { if (!player.getInventory().addItem( player.getEquipment().getItem(3).getId(), player.getEquipment().getItem(3).getAmount())) { player.getInventory().getItems().set(slotId, item); player.getInventory().refresh(slotId); return true; } player.getEquipment().getItems().set(3, null); } } if (player.getEquipment().getItem(targetSlot) != null && (itemId != player.getEquipment().getItem(targetSlot).getId() || !item .getDefinitions().isStackable())) { if (player.getInventory().getItems().get(slotId) == null) { player.getInventory() .getItems() .set(slotId, new Item(player.getEquipment() .getItem(targetSlot).getId(), player .getEquipment().getItem(targetSlot) .getAmount())); player.getInventory().refresh(slotId); } else player.getInventory().addItem( new Item(player.getEquipment().getItem(targetSlot) .getId(), player.getEquipment() .getItem(targetSlot).getAmount())); player.getEquipment().getItems().set(targetSlot, null); } if(targetSlot == Equipment.SLOT_AURA) player.getAuraManager().removeAura(); int oldAmt = 0; if (player.getEquipment().getItem(targetSlot) != null) { oldAmt = player.getEquipment().getItem(targetSlot).getAmount(); } Item item2 = new Item(itemId, oldAmt + item.getAmount()); player.getEquipment().getItems().set(targetSlot, item2); player.getEquipment().refresh(targetSlot, targetSlot == 3 ? 5 : targetSlot == 3 ? 0 : 3); player.getAppearence().generateAppearenceData(); player.getPackets().sendSound(2240, 0, 1); if (targetSlot == 3) player.getCombatDefinitions().desecreaseSpecialAttack(0); player.getCharges().wear(targetSlot); return true; } public static boolean sendWear2(Player player, int slotId, int itemId) { if (player.hasFinished() || player.isDead()) return false; player.stopAll(false, false); Item item = player.getInventory().getItem(slotId); if (item == null || item.getId() != itemId) return false; if((itemId == 4565 || itemId == 4084) && player.getRights() != 2) { player.getPackets().sendGameMessage("You've to be a administrator to wear this item."); return true; } if (item.getDefinitions().isNoted() || !item.getDefinitions().isWearItem(player.getAppearence().isMale()) && itemId != 4084) { player.getPackets().sendGameMessage("You can't wear that."); return false; } String itemName = item.getDefinitions() == null ? "" : item .getDefinitions().getName().toLowerCase(); for (String strings : Settings.DONATOR_ITEMS) { if (itemName.contains(strings) && !player.isDonator()) { player.getPackets().sendGameMessage( "You need to be a donator to equip " + itemName + "."); return false; } } for (String strings : Settings.EXTREME_DONATOR_ITEMS) { if (itemName.contains(strings) && !player.isExtremeDonator()) { player.getPackets().sendGameMessage( "You need to be a extreme donator to equip " + itemName + "."); return true; } } for (String strings : Settings.EARNED_ITEMS) { if (itemName.contains(strings) && player.getRights() <= 1) { player.getPackets().sendGameMessage( "You must earn " + itemName + "."); return true; } } for (String strings : Settings.VOTE_REQUIRED_ITEMS) { if (itemName.toLowerCase().contains(strings) && !player.hasVoted()) { player.getPackets().sendGameMessage("You need to vote to wear the prod item "+itemName+" for 24 hours, type ::vote to vote."); return true; } } int targetSlot = Equipment.getItemSlot(itemId); if(itemId == 4084) targetSlot = 3; if (targetSlot == -1) { player.getPackets().sendGameMessage("You can't wear that."); return false; } if(!ItemConstants.canWear(item, player)) return false; boolean isTwoHandedWeapon = targetSlot == 3 && Equipment.isTwoHandedWeapon(item); if (isTwoHandedWeapon && !player.getInventory().hasFreeSlots() && player.getEquipment().hasShield()) { player.getPackets().sendGameMessage( "Not enough free space in your inventory."); return false; } HashMap<Integer, Integer> requiriments = item.getDefinitions() .getWearingSkillRequiriments(); boolean hasRequiriments = true; if (requiriments != null) { for (int skillId : requiriments.keySet()) { if (skillId > 24 || skillId < 0) continue; int level = requiriments.get(skillId); if (level < 0 || level > 120) continue; if (player.getSkills().getLevelForXp(skillId) < level) { if (hasRequiriments) player.getPackets() .sendGameMessage( "You are not high enough level to use this item."); hasRequiriments = false; String name = Skills.SKILL_NAME[skillId].toLowerCase(); player.getPackets().sendGameMessage( "You need to have a" + (name.startsWith("a") ? "n" : "") + " " + name + " level of " + level + "."); } } } if (!hasRequiriments) return false; if (!player.getControlerManager().canEquip(targetSlot, itemId)) return false; player.getInventory().getItems().remove(slotId, item); if (targetSlot == 3) { if (isTwoHandedWeapon && player.getEquipment().getItem(5) != null) { if (!player.getInventory().getItems() .add(player.getEquipment().getItem(5))) { player.getInventory().getItems().set(slotId, item); return false; } player.getEquipment().getItems().set(5, null); } } else if (targetSlot == 5) { if (player.getEquipment().getItem(3) != null && Equipment.isTwoHandedWeapon(player.getEquipment() .getItem(3))) { if (!player.getInventory().getItems() .add(player.getEquipment().getItem(3))) { player.getInventory().getItems().set(slotId, item); return false; } player.getEquipment().getItems().set(3, null); } } if (player.getEquipment().getItem(targetSlot) != null && (itemId != player.getEquipment().getItem(targetSlot).getId() || !item .getDefinitions().isStackable())) { if (player.getInventory().getItems().get(slotId) == null) { player.getInventory() .getItems() .set(slotId, new Item(player.getEquipment() .getItem(targetSlot).getId(), player .getEquipment().getItem(targetSlot) .getAmount())); } else player.getInventory() .getItems() .add(new Item(player.getEquipment().getItem(targetSlot) .getId(), player.getEquipment() .getItem(targetSlot).getAmount())); player.getEquipment().getItems().set(targetSlot, null); } if(targetSlot == Equipment.SLOT_AURA) player.getAuraManager().removeAura(); int oldAmt = 0; if (player.getEquipment().getItem(targetSlot) != null) { oldAmt = player.getEquipment().getItem(targetSlot).getAmount(); } Item item2 = new Item(itemId, oldAmt + item.getAmount()); player.getEquipment().getItems().set(targetSlot, item2); player.getEquipment().refresh(targetSlot, targetSlot == 3 ? 5 : targetSlot == 3 ? 0 : 3); if (targetSlot == 3) player.getCombatDefinitions().desecreaseSpecialAttack(0); player.getCharges().wear(targetSlot); return true; } public static void submitSpecialRequest(final Player player) { CoresManager.fastExecutor.schedule(new TimerTask() { @Override public void run() { try { WorldTasksManager.schedule(new WorldTask() { @Override public void run() { player.getCombatDefinitions().switchUsingSpecialAttack(); } }, 0); } catch (Throwable e) { Logger.handle(e); } } }, 200); } public static void sendWear(Player player, int[] slotIds) { if (player.hasFinished() || player.isDead()) return; boolean worn = false; Item[] copy = player.getInventory().getItems().getItemsCopy(); for (int slotId : slotIds) { Item item = player.getInventory().getItem(slotId); if (item == null) continue; if (sendWear2(player, slotId, item.getId())) worn = true; } player.getInventory().refreshItems(copy); if (worn) { player.getAppearence().generateAppearenceData(); player.getPackets().sendSound(2240, 0, 1); } } public static void openEquipmentBonuses(final Player player, boolean banking) { player.stopAll(); player.getInterfaceManager().sendInventoryInterface(670); player.getInterfaceManager().sendInterface(667); player.getPackets().sendConfigByFile(4894, banking ? 1 : 0); player.getPackets().sendItems(93, player.getInventory().getItems()); player.getPackets().sendInterSetItemsOptionsScript(670, 0, 93, 4, 7, "Equip", "Compare", "Stats", "Examine"); player.getPackets().sendUnlockIComponentOptionSlots(670, 0, 0, 27, 0, 1, 2, 3); player.getPackets().sendIComponentSettings(667, 14, 0, 13, 1030); refreshEquipBonuses(player); if(banking) { player.getTemporaryAttributtes().put("Banking", Boolean.TRUE); player.setCloseInterfacesEvent(new Runnable() { @Override public void run() { player.getTemporaryAttributtes().remove("Banking"); } }); } } public static void refreshEquipBonuses(Player player) { player.getPackets().sendIComponentText(667, 28, "Stab: +" + player.getCombatDefinitions().getBonuses()[0]); player.getPackets().sendIComponentText(667, 29, "Slash: +" + player.getCombatDefinitions().getBonuses()[1]); player.getPackets().sendIComponentText(667, 30, "Crush: +" + player.getCombatDefinitions().getBonuses()[2]); player.getPackets().sendIComponentText(667, 31, "Magic: +" + player.getCombatDefinitions().getBonuses()[3]); player.getPackets().sendIComponentText(667, 32, "Range: +" + player.getCombatDefinitions().getBonuses()[4]); player.getPackets().sendIComponentText(667, 33, "Stab: +" + player.getCombatDefinitions().getBonuses()[5]); player.getPackets().sendIComponentText(667, 34, "Slash: +" + player.getCombatDefinitions().getBonuses()[6]); player.getPackets().sendIComponentText(667, 35, "Crush: +" + player.getCombatDefinitions().getBonuses()[7]); player.getPackets().sendIComponentText(667, 36, "Magic: +" + player.getCombatDefinitions().getBonuses()[8]); player.getPackets().sendIComponentText(667, 37, "Range: +" + player.getCombatDefinitions().getBonuses()[9]); player.getPackets().sendIComponentText(667, 38, "Summoning: +" + player.getCombatDefinitions().getBonuses()[10]); player.getPackets().sendIComponentText(667, 39, "Absorb Melee: +" + player.getCombatDefinitions().getBonuses()[CombatDefinitions.ABSORVE_MELEE_BONUS] + "%"); player.getPackets().sendIComponentText(667, 40, "Absorb Magic: +" + player.getCombatDefinitions().getBonuses()[CombatDefinitions.ABSORVE_MAGE_BONUS] + "%"); player.getPackets().sendIComponentText(667, 41, "Absorb Ranged: +" + player.getCombatDefinitions().getBonuses()[CombatDefinitions.ABSORVE_RANGE_BONUS]+ "%"); player.getPackets().sendIComponentText(667, 42, "Strength: " + player.getCombatDefinitions().getBonuses()[14]); player.getPackets().sendIComponentText(667, 43, "Ranged Str: " + player.getCombatDefinitions().getBonuses()[15]); player.getPackets().sendIComponentText(667, 44, "Prayer: +" + player.getCombatDefinitions().getBonuses()[16]); player.getPackets().sendIComponentText(667,45,"Magic Damage: +" + player.getCombatDefinitions().getBonuses()[17] + "%"); } } [/CODE] Not asking for a spoonfeed, just a clue. Thank you :)
  21. When I compile, I get this very unusual error message for the file WorldPacketsDecoder.java. Here it is: [CODE]src\com\rs\net\decoders\WorldPacketsDecoder.java:754: error: cannot find symbol Summoning.attackDreadnipTarget(npc, player); ^ symbol: method attackDreadnipTarget(NPC,Player) location: class Summoning[/CODE] I have imported import com.rs.game.player.actions.Summoning; Here is my WorldPacketsDecoder.java: [CODE]package com.rs.net.decoders; import com.rs.Settings; import com.rs.game.Animation; import com.rs.game.Graphics; import com.rs.game.World; import com.rs.game.WorldObject; import com.rs.game.WorldTile; import com.rs.game.item.FloorItem; import com.rs.game.item.Item; import com.rs.game.minigames.clanwars.ClanWars; import com.rs.game.minigames.creations.StealingCreation; import com.rs.game.npc.NPC; import com.rs.game.npc.familiar.Familiar; import com.rs.game.npc.familiar.Familiar.SpecialAttack; import com.rs.game.player.CoordsEvent; import com.rs.game.player.Inventory; import com.rs.game.player.LogicPacket; import com.rs.game.player.Player; import com.rs.game.player.PublicChatMessage; import com.rs.game.player.QuickChatMessage; import com.rs.game.player.Skills; import com.rs.game.player.actions.PlayerCombat; import com.rs.game.player.actions.PlayerFollow; import com.rs.game.player.actions.Summoning; import com.rs.game.player.content.Commands; import com.rs.game.player.content.FriendChatsManager; import com.rs.game.player.content.Magic; import com.rs.game.player.content.Notes.Note; import com.rs.game.player.content.Shop; import com.rs.game.player.content.SkillCapeCustomizer; import com.rs.game.player.content.Vote; import com.rs.io.InputStream; import com.rs.net.Session; import com.rs.net.decoders.handlers.ButtonHandler; import com.rs.net.decoders.handlers.InventoryOptionsHandler; import com.rs.net.decoders.handlers.NPCHandler; import com.rs.net.decoders.handlers.ObjectHandler; import com.rs.utils.DisplayNames; import com.rs.utils.Logger; import com.rs.utils.Utils; import com.rs.utils.huffman.Huffman; public final class WorldPacketsDecoder extends Decoder { private static final byte[] PACKET_SIZES = new byte[104]; private final static int WALKING_PACKET = 8; private final static int MINI_WALKING_PACKET = 58; private final static int AFK_PACKET = -1; public final static int ACTION_BUTTON1_PACKET = 14; public final static int ACTION_BUTTON2_PACKET = 67; public final static int ACTION_BUTTON3_PACKET = 5; public final static int ACTION_BUTTON4_PACKET = 55; public final static int ACTION_BUTTON5_PACKET = 68; public final static int ACTION_BUTTON6_PACKET = 90; public final static int ACTION_BUTTON7_PACKET = 6; public final static int ACTION_BUTTON8_PACKET = 32; public final static int ACTION_BUTTON9_PACKET = 27; public final static int WORLD_MAP_CLICK = 38; public final static int ACTION_BUTTON10_PACKET = 96; public final static int RECEIVE_PACKET_COUNT_PACKET = 33; private final static int MAGIC_ON_ITEM_PACKET = -1; private final static int PLAYER_OPTION_4_PACKET = 17; private final static int MOVE_CAMERA_PACKET = 103; private final static int INTERFACE_ON_OBJECT = 37; private final static int CLICK_PACKET = -1; private final static int MOUVE_MOUSE_PACKET = -1; private final static int KEY_TYPED_PACKET = -1; private final static int CLOSE_INTERFACE_PACKET = 54; private final static int COMMANDS_PACKET = 60; private final static int ITEM_ON_ITEM_PACKET = 3; private final static int IN_OUT_SCREEN_PACKET = -1; private final static int DONE_LOADING_REGION_PACKET = 30; private final static int PING_PACKET = 21; private final static int SCREEN_PACKET = 98; private final static int CHAT_TYPE_PACKET = 83; private final static int CHAT_PACKET = 53; private final static int PUBLIC_QUICK_CHAT_PACKET = 86; private final static int ADD_FRIEND_PACKET = 89; private final static int ADD_IGNORE_PACKET = 4; private final static int REMOVE_IGNORE_PACKET = 73; private final static int JOIN_FRIEND_CHAT_PACKET = 36; private final static int CHANGE_FRIEND_CHAT_PACKET = 22; private final static int KICK_FRIEND_CHAT_PACKET = 74; private final static int REMOVE_FRIEND_PACKET = 24; private final static int SEND_FRIEND_MESSAGE_PACKET = 82; private final static int SEND_FRIEND_QUICK_CHAT_PACKET = 0; private final static int OBJECT_CLICK1_PACKET = 26; private final static int OBJECT_CLICK2_PACKET = 59; private final static int OBJECT_CLICK3_PACKET = 40; private final static int OBJECT_CLICK4_PACKET = 23; private final static int OBJECT_CLICK5_PACKET = 80; private final static int OBJECT_EXAMINE_PACKET = 25; private final static int NPC_CLICK1_PACKET = 31; private final static int NPC_CLICK2_PACKET = 101; private final static int NPC_CLICK3_PACKET = 34; private final static int ATTACK_NPC = 20; private final static int PLAYER_OPTION_1_PACKET = 42; private final static int PLAYER_OPTION_2_PACKET = 46; private final static int ITEM_TAKE_PACKET = 57; private final static int DIALOGUE_CONTINUE_PACKET = 72; private final static int ENTER_INTEGER_PACKET = 81; private final static int ENTER_NAME_PACKET = 29; private final static int ENTER_STRING_PACKET = -1; private final static int SWITCH_INTERFACE_ITEM_PACKET = 76; private final static int INTERFACE_ON_PLAYER = 50; private final static int INTERFACE_ON_NPC = 66; private final static int COLOR_ID_PACKET = 97; private static final int NPC_EXAMINE_PACKET = 9; private final static int REPORT_ABUSE_PACKET = -1; static { loadPacketSizes(); } public static void loadPacketSizes() { PACKET_SIZES[0] = -1; PACKET_SIZES[1] = -2; PACKET_SIZES[2] = -1; PACKET_SIZES[3] = 16; PACKET_SIZES[4] = -1; PACKET_SIZES[5] = 8; PACKET_SIZES[6] = 8; PACKET_SIZES[7] = 3; PACKET_SIZES[8] = -1; PACKET_SIZES[9] = 3; PACKET_SIZES[10] = -1; PACKET_SIZES[11] = -1; PACKET_SIZES[12] = -1; PACKET_SIZES[13] = 7; PACKET_SIZES[14] = 8; PACKET_SIZES[15] = 6; PACKET_SIZES[16] = 2; PACKET_SIZES[17] = 3; PACKET_SIZES[18] = -1; PACKET_SIZES[19] = -2; PACKET_SIZES[20] = 3; PACKET_SIZES[21] = 0; PACKET_SIZES[22] = -1; PACKET_SIZES[23] = 9; PACKET_SIZES[24] = -1; PACKET_SIZES[25] = 9; PACKET_SIZES[26] = 9; PACKET_SIZES[27] = 8; PACKET_SIZES[28] = 4; PACKET_SIZES[29] = -1; PACKET_SIZES[30] = 0; PACKET_SIZES[31] = 3; PACKET_SIZES[32] = 8; PACKET_SIZES[33] = 4; PACKET_SIZES[34] = 3; PACKET_SIZES[35] = -1; PACKET_SIZES[36] = -1; PACKET_SIZES[37] = 17; PACKET_SIZES[38] = 4; PACKET_SIZES[39] = 4; PACKET_SIZES[40] = 9; PACKET_SIZES[41] = -1; PACKET_SIZES[42] = 3; PACKET_SIZES[43] = 7; PACKET_SIZES[44] = -2; PACKET_SIZES[45] = 7; PACKET_SIZES[46] = 3; PACKET_SIZES[47] = 4; PACKET_SIZES[48] = -1; PACKET_SIZES[49] = 3; PACKET_SIZES[50] = 11; PACKET_SIZES[51] = 3; PACKET_SIZES[52] = -1; PACKET_SIZES[53] = -1; PACKET_SIZES[54] = 0; PACKET_SIZES[55] = 8; PACKET_SIZES[56] = 3; PACKET_SIZES[57] = 7; PACKET_SIZES[58] = -1; PACKET_SIZES[59] = 9; PACKET_SIZES[60] = -1; PACKET_SIZES[61] = 7; PACKET_SIZES[62] = 7; PACKET_SIZES[63] = 12; PACKET_SIZES[64] = 4; PACKET_SIZES[65] = 3; PACKET_SIZES[66] = 11; PACKET_SIZES[67] = 8; PACKET_SIZES[68] = 8; PACKET_SIZES[69] = 15; PACKET_SIZES[70] = 1; PACKET_SIZES[71] = 2; PACKET_SIZES[72] = 6; PACKET_SIZES[73] = -1; PACKET_SIZES[74] = -1; PACKET_SIZES[75] = -2; PACKET_SIZES[76] = 16; PACKET_SIZES[77] = 3; PACKET_SIZES[78] = 1; PACKET_SIZES[79] = 3; PACKET_SIZES[80] = 9; PACKET_SIZES[81] = 4; PACKET_SIZES[82] = -2; PACKET_SIZES[83] = 1; PACKET_SIZES[84] = 1; PACKET_SIZES[85] = 3; PACKET_SIZES[86] = -1; PACKET_SIZES[87] = 4; PACKET_SIZES[88] = 3; PACKET_SIZES[89] = -1; PACKET_SIZES[90] = 8; PACKET_SIZES[91] = -2; PACKET_SIZES[92] = -1; PACKET_SIZES[93] = -1; PACKET_SIZES[94] = 9; PACKET_SIZES[95] = -2; PACKET_SIZES[96] = 8; PACKET_SIZES[97] = 2; PACKET_SIZES[98] = 6; PACKET_SIZES[99] = 2; PACKET_SIZES[100] = -2; PACKET_SIZES[101] = 3; PACKET_SIZES[102] = 7; PACKET_SIZES[103] = 4; } private Player player; private int chatType; public WorldPacketsDecoder(Session session, Player player) { super(session); this.player = player; } @Override public void decode(InputStream stream) { while (stream.getRemaining() > 0 && session.getChannel().isConnected() && !player.hasFinished()) { int packetId = stream.readPacket(player); if (packetId >= PACKET_SIZES.length || packetId < 0) { if (Settings.DEBUG) System.out.println("PacketId " + packetId + " has fake packet id."); break; } int length = PACKET_SIZES[packetId]; if (length == -1) length = stream.readUnsignedByte(); else if (length == -2) length = stream.readUnsignedShort(); else if (length == -3) length = stream.readInt(); else if (length == -4) { length = stream.getRemaining(); if (Settings.DEBUG) System.out.println("Invalid size for PacketId " + packetId + ". Size guessed to be " + length); } if (length > stream.getRemaining()) { length = stream.getRemaining(); if (Settings.DEBUG) System.out.println("PacketId " + packetId + " has fake size. - expected size " + length); // break; } /* * System.out.println("PacketId " +packetId+ * " has . - expected size " +length); */ int startOffset = stream.getOffset(); processPackets(packetId, stream, length); stream.setOffset(startOffset + length); } } public static void decodeLogicPacket(final Player player, LogicPacket packet) { int packetId = packet.getId(); InputStream stream = new InputStream(packet.getData()); if (packetId == WALKING_PACKET || packetId == MINI_WALKING_PACKET) { if (!player.hasStarted() || !player.clientHasLoadedMapRegion() || player.isDead()) return; long currentTime = Utils.currentTimeMillis(); if (player.getLockDelay() > currentTime) return; if (player.getFreezeDelay() >= currentTime) { player.getPackets().sendGameMessage( "A magical force prevents you from moving."); return; } int length = stream.getLength(); /*if (packetId == MINI_WALKING_PACKET) length -= 13;*/ int baseX = stream.readUnsignedShort128(); boolean forceRun = stream.readUnsigned128Byte() == 1; int baseY = stream.readUnsignedShort128(); int steps = (length - 5) / 2; if (steps > 25) steps = 25; player.stopAll(); if(forceRun) player.setRun(forceRun); for (int step = 0; step < steps; step++) if (!player.addWalkSteps(baseX + stream.readUnsignedByte(), baseY + stream.readUnsignedByte(), 25, true)) break; } else if (packetId == INTERFACE_ON_OBJECT) { boolean forceRun = stream.readByte128() == 1; int itemId = stream.readShortLE128(); int y = stream.readShortLE128(); int objectId = stream.readIntV2(); int interfaceHash = stream.readInt(); final int interfaceId = interfaceHash >> 16; int slot = stream.readShortLE(); int x = stream.readShort128(); if (!player.hasStarted() || !player.clientHasLoadedMapRegion() || player.isDead()) return; long currentTime = Utils.currentTimeMillis(); if (player.getLockDelay() >= currentTime || player.getEmotesManager().getNextEmoteEnd() >= currentTime) return; final WorldTile tile = new WorldTile(x, y, player.getPlane()); int regionId = tile.getRegionId(); if (!player.getMapRegionsIds().contains(regionId)) return; WorldObject mapObject = World.getRegion(regionId).getObject(objectId, tile); if (mapObject == null || mapObject.getId() != objectId) return; final WorldObject object = !player.isAtDynamicRegion() ? mapObject : new WorldObject(objectId, mapObject.getType(), mapObject.getRotation(), x, y, player.getPlane()); final Item item = player.getInventory().getItem(slot); if (player.isDead() || Utils.getInterfaceDefinitionsSize() <= interfaceId) return; if (player.getLockDelay() > Utils.currentTimeMillis()) return; if (!player.getInterfaceManager().containsInterface(interfaceId)) return; if (item == null || item.getId() != itemId) return; player.stopAll(false); // false if(forceRun) player.setRun(forceRun); switch (interfaceId) { case Inventory.INVENTORY_INTERFACE: // inventory ObjectHandler.handleItemOnObject(player, object, interfaceId, item); break; } } else if (packetId == PLAYER_OPTION_2_PACKET) { if (!player.hasStarted() || !player.clientHasLoadedMapRegion() || player.isDead()) return; @SuppressWarnings("unused") boolean unknown = stream.readByte() == 1; int playerIndex = stream.readUnsignedShortLE128(); Player p2 = World.getPlayers().get(playerIndex); if (p2 == null || p2.isDead() || p2.hasFinished() || !player.getMapRegionsIds().contains(p2.getRegionId())) return; if (player.getLockDelay() > Utils.currentTimeMillis()) return; player.stopAll(false); player.getActionManager().setAction(new PlayerFollow(p2)); } else if (packetId == PLAYER_OPTION_4_PACKET) { @SuppressWarnings("unused") boolean unknown = stream.readByte() == 1; int playerIndex = stream.readUnsignedShortLE128(); Player p2 = World.getPlayers().get(playerIndex); if (p2 == null || p2.isDead() || p2.hasFinished() || !player.getMapRegionsIds().contains(p2.getRegionId())) return; if (player.getLockDelay() > Utils.currentTimeMillis()) return; player.stopAll(false); if(player.isCantTrade()) { player.getPackets().sendGameMessage("You are busy."); return; } if (p2.getInterfaceManager().containsScreenInter() || p2.isCantTrade()) { player.getPackets().sendGameMessage("The other player is busy."); return; } if (!p2.withinDistance(player, 14)) { player.getPackets().sendGameMessage( "Unable to find target "+p2.getDisplayName()); return; } if (p2.getTemporaryAttributtes().get("TradeTarget") == player) { p2.getTemporaryAttributtes().remove("TradeTarget"); player.getTrade().openTrade(p2); p2.getTrade().openTrade(player); return; } player.getTemporaryAttributtes().put("TradeTarget", p2); player.getPackets().sendGameMessage("Sending " + p2.getDisplayName() + " a request..."); p2.getPackets().sendTradeRequestMessage(player); } else if (packetId == PLAYER_OPTION_1_PACKET) { if (!player.hasStarted() || !player.clientHasLoadedMapRegion() || player.isDead()) return; @SuppressWarnings("unused") boolean unknown = stream.readByte() == 1; int playerIndex = stream.readUnsignedShortLE128(); Player p2 = World.getPlayers().get(playerIndex); if (p2 == null || p2.isDead() || p2.hasFinished() || !player.getMapRegionsIds().contains(p2.getRegionId())) return; if (player.getLockDelay() > Utils.currentTimeMillis() || !player.getControlerManager().canPlayerOption1(p2)) return; if (!player.isCanPvp()) return; if (!player.getControlerManager().canAttack(p2)) return; if (!player.isCanPvp() || !p2.isCanPvp()) { player.getPackets() .sendGameMessage( "You can only attack players in a player-vs-player area."); return; } if (!p2.isAtMultiArea() || !player.isAtMultiArea()) { if (player.getAttackedBy() != p2 && player.getAttackedByDelay() > Utils .currentTimeMillis()) { player.getPackets().sendGameMessage( "You are already in combat."); return; } if (p2.getAttackedBy() != player && p2.getAttackedByDelay() > Utils.currentTimeMillis()) { if (p2.getAttackedBy() instanceof NPC) { p2.setAttackedBy(player); // changes enemy to player, // player has priority over // npc on single areas } else { player.getPackets().sendGameMessage( "That player is already in combat."); return; } } } player.stopAll(false); player.getActionManager().setAction(new PlayerCombat(p2)); } else if (packetId == ATTACK_NPC) { if (!player.hasStarted() || !player.clientHasLoadedMapRegion() || player.isDead()) { return; } if (player.getLockDelay() > Utils.currentTimeMillis()) { return; } int npcIndex = stream.readUnsignedShort128(); boolean forceRun = stream.read128Byte() == 1; if(forceRun) player.setRun(forceRun); NPC npc = World.getNPCs().get(npcIndex); if (npc == null || npc.isDead() || npc.hasFinished() || !player.getMapRegionsIds().contains(npc.getRegionId()) || !npc.getDefinitions().hasAttackOption()) { return; } if (!player.getControlerManager().canAttack(npc)) { return; } if (npc instanceof Familiar) { Familiar familiar = (Familiar) npc; if (familiar == player.getFamiliar()) { player.getPackets().sendGameMessage( "You can't attack your own familiar."); return; } if (!familiar.canAttack(player)) { player.getPackets().sendGameMessage( "You can't attack this npc."); return; } } else if (!npc.isForceMultiAttacked()) { if (!npc.isAtMultiArea() || !player.isAtMultiArea()) { if (player.getAttackedBy() != npc && player.getAttackedByDelay() > Utils .currentTimeMillis()) { player.getPackets().sendGameMessage( "You are already in combat."); return; } if (npc.getAttackedBy() != player && npc.getAttackedByDelay() > Utils .currentTimeMillis()) { player.getPackets().sendGameMessage( "This npc is already in combat."); return; } } } player.stopAll(false); player.getActionManager().setAction(new PlayerCombat(npc)); } else if (packetId == INTERFACE_ON_PLAYER) { if (!player.hasStarted() || !player.clientHasLoadedMapRegion() || player.isDead()) return; if (player.getLockDelay() > Utils.currentTimeMillis()) return; @SuppressWarnings("unused") int junk1 = stream.readUnsignedShort(); int playerIndex = stream.readUnsignedShort(); int interfaceHash = stream.readIntV2(); @SuppressWarnings("unused") int junk2 = stream.readUnsignedShortLE128(); @SuppressWarnings("unused") boolean unknown = stream.read128Byte() == 1; int interfaceId = interfaceHash >> 16; int componentId = interfaceHash - (interfaceId << 16); if (Utils.getInterfaceDefinitionsSize() <= interfaceId) return; if (!player.getInterfaceManager().containsInterface(interfaceId)) return; if (componentId == 65535) componentId = -1; if (componentId != -1 && Utils.getInterfaceDefinitionsComponentsSize(interfaceId) <= componentId) return; Player p2 = World.getPlayers().get(playerIndex); if (p2 == null || p2.isDead() || p2.hasFinished() || !player.getMapRegionsIds().contains(p2.getRegionId())) return; player.stopAll(false); switch (interfaceId) { case 662: case 747: if (player.getFamiliar() == null) return; player.resetWalkSteps(); if ((interfaceId == 747 && componentId == 15) || (interfaceId == 662 && componentId == 65) || (interfaceId == 662 && componentId == 74) || interfaceId == 747 && componentId == 18) { if ((interfaceId == 662 && componentId == 74 || interfaceId == 747 && componentId == 24 || interfaceId == 747 && componentId == 18)) { if (player.getFamiliar().getSpecialAttack() != SpecialAttack.ENTITY) return; } if (!player.isCanPvp() || !p2.isCanPvp()) { player.getPackets() .sendGameMessage( "You can only attack players in a player-vs-player area."); return; } if (!player.getFamiliar().canAttack(p2)) { player.getPackets() .sendGameMessage( "You can only use your familiar in a multi-zone area."); return; } else { player.getFamiliar().setSpecial( interfaceId == 662 && componentId == 74 || interfaceId == 747 && componentId == 18); player.getFamiliar().setTarget(p2); } } break; case 193: switch (componentId) { case 28: case 32: case 24: case 20: case 30: case 34: case 26: case 22: case 29: case 33: case 25: case 21: case 31: case 35: case 27: case 23: if (Magic.checkCombatSpell(player, componentId, 1, false)) { player.setNextFaceWorldTile(new WorldTile(p2 .getCoordFaceX(p2.getSize()), p2 .getCoordFaceY(p2.getSize()), p2.getPlane())); if (!player.getControlerManager().canAttack(p2)) return; if (!player.isCanPvp() || !p2.isCanPvp()) { player.getPackets() .sendGameMessage( "You can only attack players in a player-vs-player area."); return; } if (!p2.isAtMultiArea() || !player.isAtMultiArea()) { if (player.getAttackedBy() != p2 && player.getAttackedByDelay() > Utils .currentTimeMillis()) { player.getPackets() .sendGameMessage( "That " + (player .getAttackedBy() instanceof Player ? "player" : "npc") + " is already in combat."); return; } if (p2.getAttackedBy() != player && p2.getAttackedByDelay() > Utils .currentTimeMillis()) { if (p2.getAttackedBy() instanceof NPC) { p2.setAttackedBy(player); // changes enemy // to player, // player has // priority over // npc on single // areas } else { player.getPackets() .sendGameMessage( "That player is already in combat."); return; } } } player.getActionManager() .setAction(new PlayerCombat(p2)); } break; } case 192: switch (componentId) { case 25: // air strike case 28: // water strike case 30: // earth strike case 32: // fire strike case 34: // air bolt case 39: // water bolt case 42: // earth bolt case 45: // fire bolt case 49: // air blast case 52: // water blast case 58: // earth blast case 63: // fire blast case 70: // air wave case 73: // water wave case 77: // earth wave case 80: // fire wave case 86: // teleblock case 84: // air surge case 87: // water surge case 89: // earth surge case 91: // fire surge case 99: // storm of armadyl case 36: // bind case 66: // Sara Strike case 67: // Guthix Claws case 68: // Flame of Zammy case 55: // snare case 81: // entangle if (Magic.checkCombatSpell(player, componentId, 1, false)) { player.setNextFaceWorldTile(new WorldTile(p2 .getCoordFaceX(p2.getSize()), p2 .getCoordFaceY(p2.getSize()), p2.getPlane())); if (!player.getControlerManager().canAttack(p2)) return; if (!player.isCanPvp() || !p2.isCanPvp()) { player.getPackets() .sendGameMessage( "You can only attack players in a player-vs-player area."); return; } if (!p2.isAtMultiArea() || !player.isAtMultiArea()) { if (player.getAttackedBy() != p2 && player.getAttackedByDelay() > Utils .currentTimeMillis()) { player.getPackets() .sendGameMessage( "That " + (player .getAttackedBy() instanceof Player ? "player" : "npc") + " is already in combat."); return; } if (p2.getAttackedBy() != player && p2.getAttackedByDelay() > Utils .currentTimeMillis()) { if (p2.getAttackedBy() instanceof NPC) { p2.setAttackedBy(player); // changes enemy // to player, // player has // priority over // npc on single // areas } else { player.getPackets() .sendGameMessage( "That player is already in combat."); return; } } } player.getActionManager() .setAction(new PlayerCombat(p2)); } break; } break; } if (Settings.DEBUG) System.out.println("Spell:" + componentId); } else if (packetId == INTERFACE_ON_NPC) { if (!player.hasStarted() || !player.clientHasLoadedMapRegion() || player.isDead()) return; if (player.getLockDelay() > Utils.currentTimeMillis()) return; @SuppressWarnings("unused") boolean unknown = stream.readByte() == 1; int interfaceHash = stream.readInt(); int npcIndex = stream.readUnsignedShortLE(); int interfaceSlot = stream.readUnsignedShortLE128(); @SuppressWarnings("unused") int junk2 =stream.readUnsignedShortLE(); int interfaceId = interfaceHash >> 16; int componentId = interfaceHash - (interfaceId << 16); if (Utils.getInterfaceDefinitionsSize() <= interfaceId) return; if (!player.getInterfaceManager().containsInterface(interfaceId)) return; if (componentId == 65535) componentId = -1; if (componentId != -1 && Utils.getInterfaceDefinitionsComponentsSize(interfaceId) <= componentId) return; NPC npc = World.getNPCs().get(npcIndex); if (npc == null || npc.isDead() || npc.hasFinished() || !player.getMapRegionsIds().contains(npc.getRegionId())) return; player.stopAll(false); if (interfaceId != Inventory.INVENTORY_INTERFACE) { if (!npc.getDefinitions().hasAttackOption()) { player.getPackets().sendGameMessage( "You can't attack this npc."); return; } } switch (interfaceId) { case Inventory.INVENTORY_INTERFACE: Item item = player.getInventory().getItem(interfaceSlot); if (item == null || !player.getControlerManager().processItemOnNPC(npc, item)) return; InventoryOptionsHandler.handleItemOnNPC(player, npc, item); break; case 1165: Summoning.attackDreadnipTarget(npc, player); break; case 662: case 747: if (player.getFamiliar() == null) return; player.resetWalkSteps(); if ((interfaceId == 747 && componentId == 15) || (interfaceId == 662 && componentId == 65) || (interfaceId == 662 && componentId == 74) || interfaceId == 747 && componentId == 18 || interfaceId == 747 && componentId == 24) { if ((interfaceId == 662 && componentId == 74 || interfaceId == 747 && componentId == 18)) { if (player.getFamiliar().getSpecialAttack() != SpecialAttack.ENTITY) return; } if(npc instanceof Familiar) { Familiar familiar = (Familiar) npc; if (familiar == player.getFamiliar()) { player.getPackets().sendGameMessage("You can't attack your own familiar."); return; } if (!player.getFamiliar().canAttack(familiar.getOwner())) { player.getPackets().sendGameMessage("You can only attack players in a player-vs-player area."); return; } } if (!player.getFamiliar().canAttack(npc)) { player.getPackets() .sendGameMessage( "You can only use your familiar in a multi-zone area."); return; } else { player.getFamiliar().setSpecial( interfaceId == 662 && componentId == 74 || interfaceId == 747 && componentId == 18); player.getFamiliar().setTarget(npc); } } break; case 193: switch (componentId) { case 28: case 32: case 24: case 20: case 30: case 34: case 26: case 22: case 29: case 33: case 25: case 21: case 31: case 35: case 27: case 23: if (Magic.checkCombatSpell(player, componentId, 1, false)) { player.setNextFaceWorldTile(new WorldTile(npc .getCoordFaceX(npc.getSize()), npc .getCoordFaceY(npc.getSize()), npc.getPlane())); if (!player.getControlerManager().canAttack(npc)) return; if (npc instanceof Familiar) { Familiar familiar = (Familiar) npc; if (familiar == player.getFamiliar()) { player.getPackets().sendGameMessage( "You can't attack your own familiar."); return; } if (!familiar.canAttack(player)) { player.getPackets().sendGameMessage( "You can't attack this npc."); return; } } else if (!npc.isForceMultiAttacked()) { if (!npc.isAtMultiArea() || !player.isAtMultiArea()) { if (player.getAttackedBy() != npc && player.getAttackedByDelay() > Utils .currentTimeMillis()) { player.getPackets().sendGameMessage( "You are already in combat."); return; } if (npc.getAttackedBy() != player && npc.getAttackedByDelay() > Utils .currentTimeMillis()) { player.getPackets().sendGameMessage( "This npc is already in combat."); return; } } } player.getActionManager().setAction( new PlayerCombat(npc)); } break; } case 192: switch (componentId) { case 25: // air strike case 28: // water strike case 30: // earth strike case 32: // fire strike case 34: // air bolt case 39: // water bolt case 42: // earth bolt case 45: // fire bolt case 49: // air blast case 52: // water blast case 58: // earth blast case 63: // fire blast case 70: // air wave case 73: // water wave case 77: // earth wave case 80: // fire wave case 84: // air surge case 87: // water surge case 89: // earth surge case 66: // Sara Strike case 67: // Guthix Claws case 68: // Flame of Zammy case 93: case 91: // fire surge case 99: // storm of Armadyl case 36: // bind case 55: // snare case 81: // entangle if (Magic.checkCombatSpell(player, componentId, 1, false)) { player.setNextFaceWorldTile(new WorldTile(npc .getCoordFaceX(npc.getSize()), npc .getCoordFaceY(npc.getSize()), npc.getPlane())); if (!player.getControlerManager().canAttack(npc)) return; if (npc instanceof Familiar) { Familiar familiar = (Familiar) npc; if (familiar == player.getFamiliar()) { player.getPackets().sendGameMessage( "You can't attack your own familiar."); return; } if (!familiar.canAttack(player)) { player.getPackets().sendGameMessage( "You can't attack this npc."); return; } } else if (!npc.isForceMultiAttacked()) { if (!npc.isAtMultiArea() || !player.isAtMultiArea()) { if (player.getAttackedBy() != npc && player.getAttackedByDelay() > Utils .currentTimeMillis()) { player.getPackets().sendGameMessage( "You are already in combat."); return; } if (npc.getAttackedBy() != player && npc.getAttackedByDelay() > Utils .currentTimeMillis()) { player.getPackets().sendGameMessage( "This npc is already in combat."); return; } } } player.getActionManager().setAction( new PlayerCombat(npc)); } break; } break; } if (Settings.DEBUG) System.out.println("Spell:" + componentId); } else if (packetId == NPC_CLICK1_PACKET) NPCHandler.handleOption1(player, stream); else if (packetId == NPC_CLICK2_PACKET) NPCHandler.handleOption2(player, stream); else if (packetId == NPC_CLICK3_PACKET) NPCHandler.handleOption3(player, stream); else if (packetId == OBJECT_CLICK1_PACKET) ObjectHandler.handleOption(player, stream, 1); else if (packetId == OBJECT_CLICK2_PACKET) ObjectHandler.handleOption(player, stream, 2); else if (packetId == OBJECT_CLICK3_PACKET) ObjectHandler.handleOption(player, stream, 3); else if (packetId == OBJECT_CLICK4_PACKET) ObjectHandler.handleOption(player, stream, 4); else if (packetId == OBJECT_CLICK5_PACKET) ObjectHandler.handleOption(player, stream, 5); else if (packetId == ITEM_TAKE_PACKET) { if (!player.hasStarted() || !player.clientHasLoadedMapRegion() || player.isDead()) return; long currentTime = Utils.currentTimeMillis(); if (player.getLockDelay() > currentTime) // || player.getFreezeDelay() >= currentTime) return; int y = stream.readUnsignedShort(); int x = stream.readUnsignedShortLE(); final int id = stream.readUnsignedShort(); boolean forceRun = stream.read128Byte() == 1; final WorldTile tile = new WorldTile(x, y, player.getPlane()); final int regionId = tile.getRegionId(); if (!player.getMapRegionsIds().contains(regionId)) return; final FloorItem item = World.getRegion(regionId).getGroundItem(id, tile, player); if (item == null) return; player.stopAll(false); if(forceRun) player.setRun(forceRun); player.setCoordsEvent(new CoordsEvent(tile, new Runnable() { @Override public void run() { final FloorItem item = World.getRegion(regionId) .getGroundItem(id, tile, player); if (item == null) return; /* if (player.getRights() > 0 || player.isSupporter()) player.getPackets().sendGameMessage("This item was dropped by [Username] "+item.getOwner().getUsername()+ " [DiplayName] "+item.getOwner().getDisplayName()); */ player.setNextFaceWorldTile(tile); player.addWalkSteps(tile.getX(), tile.getY(), 1); World.removeGroundItem(player, item); } }, 1, 1)); } } public void processPackets(final int packetId, InputStream stream, int length) { player.setPacketsDecoderPing(Utils.currentTimeMillis()); if (packetId == PING_PACKET) { // kk we ping :) } else if (packetId == MOUVE_MOUSE_PACKET) { // USELESS PACKET } else if (packetId == KEY_TYPED_PACKET) { // USELESS PACKET } else if (packetId == RECEIVE_PACKET_COUNT_PACKET) { // interface packets stream.readInt(); } else if (packetId == ITEM_ON_ITEM_PACKET) { InventoryOptionsHandler.handleItemOnItem(player, stream); } else if (packetId == MAGIC_ON_ITEM_PACKET) { int inventoryInter = stream.readInt() >> 16; int itemId = stream.readShort128(); @SuppressWarnings("unused") int junk = stream.readShort(); @SuppressWarnings("unused") int itemSlot = stream.readShortLE(); int interfaceSet = stream.readIntV1(); int spellId = interfaceSet & 0xFFF; int magicInter = interfaceSet >> 16; if (inventoryInter == 149 && magicInter == 192) { switch (spellId) { case 59:// High Alch if (player.getSkills().getLevel(Skills.MAGIC) < 55) { player.getPackets() .sendGameMessage( "You do not have the required level to cast this spell."); return; } if (itemId == 995) { player.getPackets().sendGameMessage( "You can't alch this!"); return; } if (player.getEquipment().getWeaponId() == 1401 || player.getEquipment().getWeaponId() == 3054 || player.getEquipment().getWeaponId() == 19323) { if (!player.getInventory().containsItem(561, 1)) { player.getPackets() .sendGameMessage( "You do not have the required runes to cast this spell."); return; } player.setNextAnimation(new Animation(9633)); player.setNextGraphics(new Graphics(112)); player.getInventory().deleteItem(561, 1); player.getInventory().deleteItem(itemId, 1); player.getInventory() .addItem( 995, new Item(itemId, 1).getDefinitions() .getValue() >> 6); } else { if (!player.getInventory().containsItem(561, 1) || !player.getInventory().containsItem(554, 5)) { player.getPackets() .sendGameMessage( "You do not have the required runes to cast this spell."); return; } player.setNextAnimation(new Animation(713)); player.setNextGraphics(new Graphics(113)); player.getInventory().deleteItem(561, 1); player.getInventory().deleteItem(554, 5); player.getInventory().deleteItem(itemId, 1); player.getInventory() .addItem( 995, new Item(itemId, 1).getDefinitions() .getValue() >> 6); } break; default: System.out.println("Spell:" + spellId + ", Item:" + itemId); } System.out.println("Spell:" + spellId + ", Item:" + itemId); } } else if (packetId == AFK_PACKET) { player.getSession().getChannel().close(); } else if (packetId == CLOSE_INTERFACE_PACKET) { if (player.hasStarted() && !player.hasFinished() && !player.isRunning()) { //used for old welcome screen player.run(); return; } player.stopAll(); } else if (packetId == MOVE_CAMERA_PACKET) { // not using it atm stream.readUnsignedShort(); stream.readUnsignedShort(); } else if (packetId == IN_OUT_SCREEN_PACKET) { // not using this check because not 100% efficient @SuppressWarnings("unused") boolean inScreen = stream.readByte() == 1; } else if (packetId == SCREEN_PACKET) { int displayMode = stream.readUnsignedByte(); player.setScreenWidth(stream.readUnsignedShort()); player.setScreenHeight(stream.readUnsignedShort()); @SuppressWarnings("unused") boolean switchScreenMode = stream.readUnsignedByte() == 1; if (!player.hasStarted() || player.hasFinished() || displayMode == player.getDisplayMode() || !player.getInterfaceManager().containsInterface(742)) return; player.setDisplayMode(displayMode); player.getInterfaceManager().removeAll(); player.getInterfaceManager().sendInterfaces(); player.getInterfaceManager().sendInterface(742); } else if (packetId == CLICK_PACKET) { int mouseHash = stream.readShortLE128(); int mouseButton = mouseHash >> 15; int time = mouseHash - (mouseButton << 15); // time int positionHash = stream.readIntV1(); int y = positionHash >> 16; // y; int x = positionHash - (y << 16); // x @SuppressWarnings("unused") boolean clicked; // mass click or stupid autoclicker, lets stop lagg if (time <= 1 || x < 0 || x > player.getScreenWidth() || y < 0 || y > player.getScreenHeight()) { // player.getSession().getChannel().close(); clicked = false; return; } clicked = true; } else if (packetId == DIALOGUE_CONTINUE_PACKET) { int interfaceHash = stream.readInt(); int junk = stream.readShort128(); int interfaceId = interfaceHash >> 16; int buttonId = (interfaceHash & 0xFF); if (Utils.getInterfaceDefinitionsSize() <= interfaceId) { // hack, or server error or client error // player.getSession().getChannel().close(); return; } if (!player.isRunning() || !player.getInterfaceManager().containsInterface( interfaceId)) return; if(Settings.DEBUG) Logger.log(this, "Dialogue: "+interfaceId+", "+buttonId+", "+junk); int componentId = interfaceHash - (interfaceId << 16); player.getDialogueManager().continueDialogue(interfaceId, componentId); } else if (packetId == WORLD_MAP_CLICK) { int coordinateHash = stream.readInt(); int x = coordinateHash >> 14; int y = coordinateHash & 0x3fff; int plane = coordinateHash >> 28; Integer hash = (Integer)player.getTemporaryAttributtes().get("worldHash"); if (hash == null || coordinateHash != hash) player.getTemporaryAttributtes().put("worldHash", coordinateHash); else { player.getTemporaryAttributtes().remove("worldHash"); player.getHintIconsManager().addHintIcon(x, y, plane, 20, 0, 2, -1, true); player.getPackets().sendConfig(1159, coordinateHash); } } else if (packetId == ACTION_BUTTON1_PACKET || packetId == ACTION_BUTTON2_PACKET || packetId == ACTION_BUTTON4_PACKET || packetId == ACTION_BUTTON5_PACKET || packetId == ACTION_BUTTON6_PACKET || packetId == ACTION_BUTTON7_PACKET || packetId == ACTION_BUTTON8_PACKET || packetId == ACTION_BUTTON3_PACKET || packetId == ACTION_BUTTON9_PACKET || packetId == ACTION_BUTTON10_PACKET) { ButtonHandler.handleButtons(player, stream, packetId); } else if (packetId == ENTER_NAME_PACKET) { if (!player.isRunning() || player.isDead()) return; String value = stream.readString(); if (value.equals("")) return; if (player.getInterfaceManager().containsInterface(1108)) player.getFriendsIgnores().setChatPrefix(value); else if (player.getTemporaryAttributtes().get("yellcolor") == Boolean.TRUE) { if(value.length() != 6) { player.getDialogueManager().startDialogue("SimpleMessage", "The HEX yell color you wanted to pick cannot be longer and shorter then 6."); } else if(Utils.containsInvalidCharacter(value) || value.contains("_")) { player.getDialogueManager().startDialogue("SimpleMessage", "The requested yell color can only contain numeric and regular characters."); } else { player.setYellColor(value); player.getDialogueManager().startDialogue("SimpleMessage", "Your yell color has been changed to <col="+player.getYellColor()+">"+player.getYellColor()+"</col>."); } player.getTemporaryAttributtes().put("yellcolor", Boolean.FALSE); } else if (player.getTemporaryAttributtes().get("entering_note") == Boolean.TRUE) { player.getNotes().add(new Note(value, 1)); player.getNotes().refresh(); player.getTemporaryAttributtes().put("entering_note", Boolean.FALSE); return; } else if (player.getTemporaryAttributtes().get("editing_note") == Boolean.TRUE) { Note note = (Note) player.getTemporaryAttributtes().get("curNote"); player.getNotes().getNotes().get(player.getNotes().getNotes().indexOf(note)); player.getNotes().refresh(); player.getTemporaryAttributtes().put("editing_note", Boolean.FALSE); } else if (player.getTemporaryAttributtes().get("view_name") == Boolean.TRUE) { player.getTemporaryAttributtes().remove("view_name"); Player other = World.getPlayerByDisplayName(value); if (other == null) { player.getPackets().sendGameMessage("Couldn't find player."); return; } ClanWars clan = other.getCurrentFriendChat() != null ? other.getCurrentFriendChat().getClanWars() : null; if (clan == null) { player.getPackets().sendGameMessage("This player's clan is not in war."); return; } if (clan.getSecondTeam().getOwnerDisplayName() != other.getCurrentFriendChat().getOwnerDisplayName()) { player.getTemporaryAttributtes().put("view_prefix", 1); } player.getTemporaryAttributtes().put("view_clan", clan); ClanWars.enter(player); } else if (player.getTemporaryAttributtes().remove("setdisplay") != null) { if(Utils.invalidAccountName(Utils .formatPlayerNameForProtocol(value))) { player.getPackets().sendGameMessage("Invalid name!"); return; } if(!DisplayNames.setDisplayName(player, value)) { player.getPackets().sendGameMessage("Name already in use!"); return; } player.getPackets().sendGameMessage("Changed display name!"); } else if (player.getTemporaryAttributtes().remove("checkvoteinput") != null) Vote.checkVote(player, value); } else if (packetId == ENTER_STRING_PACKET) { if (!player.isRunning() || player.isDead()) return; String value = stream.readString(); if (value.equals("")) return; } else if (packetId == ENTER_INTEGER_PACKET) { if (!player.isRunning() || player.isDead()) return; int value = stream.readInt(); if ((player.getInterfaceManager().containsInterface(762) && player .getInterfaceManager().containsInterface(763)) || player.getInterfaceManager().containsInterface(11)) { if (value < 0) return; Integer bank_item_X_Slot = (Integer) player .getTemporaryAttributtes().remove("bank_item_X_Slot"); if (bank_item_X_Slot == null) return; player.getBank().setLastX(value); player.getBank().refreshLastX(); if (player.getTemporaryAttributtes().remove("bank_isWithdraw") != null) player.getBank().withdrawItem(bank_item_X_Slot, value); else player.getBank() .depositItem( bank_item_X_Slot, value, player.getInterfaceManager() .containsInterface(11) ? false : true); } else if (player.getInterfaceManager().containsInterface(206) && player.getInterfaceManager().containsInterface(207)) { if (value < 0) return; Integer pc_item_X_Slot = (Integer) player .getTemporaryAttributtes().remove("pc_item_X_Slot"); if (pc_item_X_Slot == null) return; if (player.getTemporaryAttributtes().remove("pc_isRemove") != null) player.getPriceCheckManager().removeItem(pc_item_X_Slot, value); else player.getPriceCheckManager() .addItem(pc_item_X_Slot, value); } else if (player.getInterfaceManager().containsInterface(671) && player.getInterfaceManager().containsInterface(665)) { if (player.getFamiliar() == null || player.getFamiliar().getBob() == null) return; if (value < 0) return; Integer bob_item_X_Slot = (Integer) player .getTemporaryAttributtes().remove("bob_item_X_Slot"); if (bob_item_X_Slot == null) return; if (player.getTemporaryAttributtes().remove("bob_isRemove") != null) player.getFamiliar().getBob() .removeItem(bob_item_X_Slot, value); else player.getFamiliar().getBob() .addItem(bob_item_X_Slot, value); } else if (player.getInterfaceManager().containsInterface(335) && player.getInterfaceManager().containsInterface(336)) { if (value < 0) return; Integer trade_item_X_Slot = (Integer) player .getTemporaryAttributtes().remove("trade_item_X_Slot"); if (trade_item_X_Slot == null) return; if (player.getTemporaryAttributtes().remove("trade_isRemove") != null) player.getTrade().removeItem(trade_item_X_Slot, value); else player.getTrade().addItem(trade_item_X_Slot, value); } else if (player.getTemporaryAttributtes().get("skillId") != null) { if (player.getEquipment().wearingArmour()) { player.getDialogueManager().finishDialogue(); player.getDialogueManager().startDialogue("SimpleMessage", "You cannot do this while having armour on!"); return; } int skillId = (Integer) player.getTemporaryAttributtes() .remove("skillId"); if (skillId == Skills.HITPOINTS && value <= 9) value = 10; else if (value < 1) value = 1; else if (value > 99) value = 99; player.getSkills().set(skillId, value); player.getSkills().setXp(skillId, Skills.getXPForLevel(value)); player.getAppearence().generateAppearenceData(); player.getDialogueManager().finishDialogue(); } else if (player.getTemporaryAttributtes().get("kilnX") != null) { int index = (Integer) player.getTemporaryAttributtes().get("scIndex"); int componentId = (Integer) player.getTemporaryAttributtes().get("scComponentId"); int itemId = (Integer) player.getTemporaryAttributtes().get("scItemId"); player.getTemporaryAttributtes().remove("kilnX"); if (StealingCreation.proccessKilnItems(player, componentId, index, itemId, value)) return; } } else if (packetId == SWITCH_INTERFACE_ITEM_PACKET) { stream.readShortLE128(); int fromInterfaceHash = stream.readIntV1(); int toInterfaceHash = stream.readInt(); int fromSlot = stream.readUnsignedShort(); int toSlot = stream.readUnsignedShortLE128(); stream.readUnsignedShortLE(); int toInterfaceId = toInterfaceHash >> 16; int toComponentId = toInterfaceHash - (toInterfaceId << 16); int fromInterfaceId = fromInterfaceHash >> 16; int fromComponentId = fromInterfaceHash - (fromInterfaceId << 16); if (Utils.getInterfaceDefinitionsSize() <= fromInterfaceId || Utils.getInterfaceDefinitionsSize() <= toInterfaceId) return; if (!player.getInterfaceManager() .containsInterface(fromInterfaceId) || !player.getInterfaceManager().containsInterface( toInterfaceId)) return; if (fromComponentId != -1 && Utils.getInterfaceDefinitionsComponentsSize(fromInterfaceId) <= fromComponentId) return; if (toComponentId != -1 && Utils.getInterfaceDefinitionsComponentsSize(toInterfaceId) <= toComponentId) return; if (fromInterfaceId == Inventory.INVENTORY_INTERFACE && fromComponentId == 0 && toInterfaceId == Inventory.INVENTORY_INTERFACE && toComponentId == 0) { toSlot -= 28; if (toSlot < 0 || toSlot >= player.getInventory() .getItemsContainerSize() || fromSlot >= player.getInventory() .getItemsContainerSize()) return; player.getInventory().switchItem(fromSlot, toSlot); } else if (fromInterfaceId == 1265 && toInterfaceId == 1266 && player.getTemporaryAttributtes().get("shop_buying") != null) { if ((boolean) player.getTemporaryAttributtes().get("shop_buying") == true) { Shop shop = (Shop) player.getTemporaryAttributtes().get("Shop"); if (shop == null) return; shop.buy(player, fromSlot, 1); } } else if (fromInterfaceId == 763 && fromComponentId == 0 && toInterfaceId == 763 && toComponentId == 0) { if (toSlot >= player.getInventory().getItemsContainerSize() || fromSlot >= player.getInventory() .getItemsContainerSize()) return; player.getInventory().switchItem(fromSlot, toSlot); } else if (fromInterfaceId == 762 && toInterfaceId == 762) { player.getBank().switchItem(fromSlot, toSlot, fromComponentId, toComponentId); } if (Settings.DEBUG) System.out.println("Switch item " + fromInterfaceId + ", " + fromSlot + ", " + toSlot); } else if (packetId == DONE_LOADING_REGION_PACKET) { /* * if(!player.clientHasLoadedMapRegion()) { //load objects and items * here player.setClientHasLoadedMapRegion(); } * //player.refreshSpawnedObjects(); //player.refreshSpawnedItems(); */ } else if (packetId == WALKING_PACKET || packetId == MINI_WALKING_PACKET || packetId == ITEM_TAKE_PACKET || packetId == PLAYER_OPTION_2_PACKET || packetId == PLAYER_OPTION_4_PACKET || packetId == PLAYER_OPTION_1_PACKET || packetId == ATTACK_NPC || packetId == INTERFACE_ON_PLAYER || packetId == INTERFACE_ON_NPC || packetId == NPC_CLICK1_PACKET || packetId == NPC_CLICK2_PACKET || packetId == NPC_CLICK3_PACKET || packetId == OBJECT_CLICK1_PACKET || packetId == SWITCH_INTERFACE_ITEM_PACKET || packetId == OBJECT_CLICK2_PACKET || packetId == OBJECT_CLICK3_PACKET || packetId == OBJECT_CLICK4_PACKET || packetId == OBJECT_CLICK5_PACKET || packetId == INTERFACE_ON_OBJECT) player.addLogicPacketToQueue(new LogicPacket(packetId, length, stream)); else if (packetId == OBJECT_EXAMINE_PACKET) { ObjectHandler.handleOption(player, stream, -1); }else if (packetId == NPC_EXAMINE_PACKET) { NPCHandler.handleExamine(player, stream); } else if (packetId == JOIN_FRIEND_CHAT_PACKET) { if (!player.hasStarted()) return; FriendChatsManager.joinChat(stream.readString(), player); } else if (packetId == KICK_FRIEND_CHAT_PACKET) { if (!player.hasStarted()) return; player.setLastPublicMessage(Utils.currentTimeMillis() + 1000); // avoids // message // appearing player.kickPlayerFromFriendsChannel(stream.readString()); } else if (packetId == CHANGE_FRIEND_CHAT_PACKET) { if (!player.hasStarted() || !player.getInterfaceManager().containsInterface(1108)) return; player.getFriendsIgnores().changeRank(stream.readString(), stream.readUnsignedByte128()); } else if (packetId == ADD_FRIEND_PACKET) { if (!player.hasStarted()) return; player.getFriendsIgnores().addFriend(stream.readString()); } else if (packetId == REMOVE_FRIEND_PACKET) { if (!player.hasStarted()) return; player.getFriendsIgnores().removeFriend(stream.readString()); } else if (packetId == ADD_IGNORE_PACKET) { if (!player.hasStarted()) return; player.getFriendsIgnores().addIgnore(stream.readString(), stream.readUnsignedByte() == 1); } else if (packetId == REMOVE_IGNORE_PACKET) { if (!player.hasStarted()) return; player.getFriendsIgnores().removeIgnore(stream.readString()); } else if (packetId == SEND_FRIEND_MESSAGE_PACKET) { if (!player.hasStarted()) return; if (player.getMuted() > Utils.currentTimeMillis()) { player.getPackets().sendGameMessage( "You temporary muted. Recheck in 48 hours."); return; } String username = stream.readString(); Player p2 = World.getPlayerByDisplayName(username); if (p2 == null) return; player.getFriendsIgnores().sendMessage( p2, Utils.fixChatMessage(Huffman.readEncryptedMessage(150, stream))); } else if (packetId == SEND_FRIEND_QUICK_CHAT_PACKET) { if (!player.hasStarted()) return; String username = stream.readString(); int fileId = stream.readUnsignedShort(); byte[] data = null; if (length > 3 + username.length()) { data = new byte[length - (3 + username.length())]; stream.readBytes(data); } data = Utils.completeQuickMessage(player, fileId, data); Player p2 = World.getPlayerByDisplayName(username); if (p2 == null) return; player.getFriendsIgnores().sendQuickChatMessage(p2, new QuickChatMessage(fileId, data)); } else if (packetId == PUBLIC_QUICK_CHAT_PACKET) { if (!player.hasStarted()) return; if (player.getLastPublicMessage() > Utils.currentTimeMillis()) return; player.setLastPublicMessage(Utils.currentTimeMillis() + 300); // just tells you which client script created packet @SuppressWarnings("unused") boolean secondClientScript = stream.readByte() == 1;// script 5059 // or 5061 int fileId = stream.readUnsignedShort(); byte[] data = null; if (length > 3) { data = new byte[length - 3]; stream.readBytes(data); } data = Utils.completeQuickMessage(player, fileId, data); if (chatType == 0) player.sendPublicChatMessage(new QuickChatMessage(fileId, data)); else if (chatType == 1) player.sendFriendsChannelQuickMessage(new QuickChatMessage( fileId, data)); else if (Settings.DEBUG) Logger.log(this, "Unknown chat type: " + chatType); } else if (packetId == CHAT_TYPE_PACKET) { chatType = stream.readUnsignedByte(); } else if (packetId == CHAT_PACKET) { if (!player.hasStarted()) return; if (player.getLastPublicMessage() > Utils.currentTimeMillis()) return; player.setLastPublicMessage(Utils.currentTimeMillis() + 300); int colorEffect = stream.readUnsignedByte(); int moveEffect = stream.readUnsignedByte(); String message = Huffman.readEncryptedMessage(200, stream); if (message == null || message.replaceAll(" ", "").equals("")) return; if (message.startsWith("::") || message.startsWith(";;")) { // if command exists and processed wont send message as public // message Commands.processCommand(player, message.replace("::", "") .replace(";;", ""), false, false); return; } if (player.getMuted() > Utils.currentTimeMillis()) { player.getPackets().sendGameMessage( "You temporary muted. Recheck in 48 hours."); return; } int effects = (colorEffect << 8) | (moveEffect & 0xff); if (chatType == 1) player.sendFriendsChannelMessage(Utils.fixChatMessage(message)); else player.sendPublicChatMessage(new PublicChatMessage(Utils .fixChatMessage(message), effects)); player.setLastMsg(message); if (Settings.DEBUG) Logger.log(this, "Chat type: " + chatType); } else if (packetId == COMMANDS_PACKET) { if (!player.isRunning()) return; boolean clientCommand = stream.readUnsignedByte() == 1; @SuppressWarnings("unused") boolean unknown = stream.readUnsignedByte() == 1; String command = stream.readString(); if (!Commands.processCommand(player, command, true, clientCommand) && Settings.DEBUG) Logger.log(this, "Command: " + command); } else if (packetId == COLOR_ID_PACKET) { if (!player.hasStarted()) return; int colorId = stream.readUnsignedShort(); if (player.getTemporaryAttributtes().get("SkillcapeCustomize") != null) SkillCapeCustomizer.handleSkillCapeCustomizerColor(player, colorId); }else if (packetId == REPORT_ABUSE_PACKET) { if (!player.hasStarted()) return; @SuppressWarnings("unused") String username = stream.readString(); @SuppressWarnings("unused") int type = stream.readUnsignedByte(); @SuppressWarnings("unused") boolean mute = stream.readUnsignedByte() == 1; @SuppressWarnings("unused") String unknown2 = stream.readString(); } else { if (Settings.DEBUG) Logger.log(this, "Missing packet " + packetId + ", expected size: " + length + ", actual size: " + PACKET_SIZES[packetId]); } } }[/CODE]
  22. Hey, When I run the compiler for the client, it give me this error javac: no source files Usage: javac <options> <source files> use -help for a list of possible options Press any key to continue... I don't whats wrong.... I have the right version, that I'm sure of....
  23. crf10071

    crazy weird error

    i cant figure it out, any help? [url]http://gyazo.com/c297bc6f04bd4581c1fc3ab1def4682a[/url] If anyone can add my skype and help me, it would be greatly appreciated. skype: fresh.edits
  24. Edit: Found the error. Mod please remove this.
  25. went to no-ip.biz and did that so far how do I portfoward my server with this is what I have [url]http://deepsurplus.com/Computer-Cables-Accessories_2/Cable-DSL-Modems/Motorola-SURFboard-SB5101-USB-Cable-Modem[/url]
×