Thread: [484] Ground items

Results 1 to 3 of 3
  1. #1 [484] Ground items 
    Donator


    Join Date
    Feb 2007
    Posts
    1,578
    Thanks given
    0
    Thanks received
    0
    Rep Power
    473
    I'm using Browns RS2HD that he released and i'm using h9s sendCreateGroundItem method which is

    Code:
    	public void sendCreateGroundItem(FloorItem item) {
    		sendCoords(item.getLocation());
    		StaticPacketBuilder spb = new StaticPacketBuilder().setId(232);
    		spb.addLEShort(item.getAmount());
    		spb.addByteA(0);
    		spb.addLEShortA(item.getId());
    		player.getSession().write(spb.toPacket());
    		
    	}
    and in my drop item packet i'm using

    Code:
    	private void drop(Player player, IoSession session, Packet packet) {
    		int slot = packet.readShort();
    		packet.readShort();
    		int interfaceId = packet.readShort();
    		int id = packet.readLEShortA() & 0xFFFF;
    		switch (interfaceId) {
    			case 149:
    				if (slot < 0 || slot >= Inventory.SIZE || player.getInventory().getContainer().get(slot) == null) {
    					return;
    				}
    				Item item = player.getInventory().getContainer().get(slot);
    				player.getInventory().getContainer().set(slot, null);
    				player.getInventory().refresh();
    				World.getInstance().getItemManager().createGroundItem(player, item);
    				World.getInstance().getItemManager().refresh(player);
    				break;
    		}
    	}
    Yeah it is calling the method but the item does not get shown on the floor.


    Also added some debugging to make sure the ground item was registered, but still didn't show.:
    Code:
    Item Position = X =  3225,Y =3219
    Player Position = X =  3225,Y =3219
    Size = 2//Total Drops
    Reply With Quote  
     

  2. #2  
    Registered Member hybrent's Avatar
    Join Date
    Nov 2007
    Posts
    566
    Thanks given
    73
    Thanks received
    90
    Rep Power
    28
    Quote Originally Posted by Requa View Post
    I'm using Browns RS2HD that he released and i'm using h9s sendCreateGroundItem method which is

    Code:
    	public void sendCreateGroundItem(FloorItem item) {
    		sendCoords(item.getLocation());
    		StaticPacketBuilder spb = new StaticPacketBuilder().setId(232);
    		spb.addLEShort(item.getAmount());
    		spb.addByteA(0);
    		spb.addLEShortA(item.getId());
    		player.getSession().write(spb.toPacket());
    		
    	}
    and in my drop item packet i'm using

    Code:
    	private void drop(Player player, IoSession session, Packet packet) {
    		int slot = packet.readShort();
    		packet.readShort();
    		int interfaceId = packet.readShort();
    		int id = packet.readLEShortA() & 0xFFFF;
    		switch (interfaceId) {
    			case 149:
    				if (slot < 0 || slot >= Inventory.SIZE || player.getInventory().getContainer().get(slot) == null) {
    					return;
    				}
    				Item item = player.getInventory().getContainer().get(slot);
    				player.getInventory().getContainer().set(slot, null);
    				player.getInventory().refresh();
    				World.getInstance().getItemManager().createGroundItem(player, item);
    				World.getInstance().getItemManager().refresh(player);
    				break;
    		}
    	}
    Yeah it is calling the method but the item does not get shown on the floor.


    Also added some debugging to make sure the ground item was registered, but still didn't show.:
    Code:
    Item Position = X =  3225,Y =3219
    Player Position = X =  3225,Y =3219
    Size = 2//Total Drops
    My only guess is that the packet itself is wrong.

    Open up your PacketHandler class in the client and search for "= 232" or "= -233". (These are both opcode 232)

    Look at the streams that are being sent and compare them with what you have serversided for that packet.



    EDIT: And then try testing JUST the packet.

    Make a command and use:
    player.getActionSender().sendCreateGroundItem(Item .valueOf(1050, 1)); //Should spawn a santa hat on the floor.

    That way you aren't going through your ground item system which may be messing with your results.

    EDIT2: And finally if the above ^ doesn't work, check your sendCoords packet. If it is sending the wrong position, it either won't send at all, or the item may be appearing in some random area that you can't see.
    Amused as I am not, I must continue to try. -Keith Charles
    Quote Originally Posted by Ayton View Post
    I'm sorry, but I have to agree with Hybrent.
    Reply With Quote  
     

  3. #3  
    Donator


    Join Date
    Feb 2007
    Posts
    1,578
    Thanks given
    0
    Thanks received
    0
    Rep Power
    473
    Ive checked the packet already, i have done all of what you have said :\
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •