Thread: Need help with a packet! [RS377D]

Results 1 to 5 of 5
  1. #1 Need help with a packet! [RS377D] 
    Banned

    Join Date
    May 2008
    Posts
    823
    Thanks given
    16
    Thanks received
    31
    Rep Power
    0
    I'm trying to add magic on items, and whenever I do it, I can't seem to get the right magic spell ID.



    My packet class:

    Code:
    package org.rs377d.net.event.impl;
    
    import org.apache.mina.core.session.IoSession;
    import org.rs377d.model.player.Player;
    import org.rs377d.model.util.InterfaceDefinition;
    import org.rs377d.net.Rs2Packet;
    import org.rs377d.net.event.EventListener;
    import org.rs377d.net.event.EventListenerChain;
    
    public class MagicOnItemEventListener implements EventListener {
    
    	@Override
    	public void handle(IoSession session, Rs2Packet packet,
    			EventListenerChain chain) throws Exception {
    		final Player player = (Player) session.getAttribute("player");
    		int itemSlot = packet.getShortA();
    		int spellId = packet.getShort();
    		int itemId = packet.getLEShortA();
    		player.getActionSender().sendMessage(
    				"Spell id: " + spellId + " itemId " + itemId + " itemSlot "
    						+ itemSlot);
    	}
    }
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    May 2008
    Posts
    823
    Thanks given
    16
    Thanks received
    31
    Rep Power
    0
    C'mon someone help. D:
    Reply With Quote  
     

  3. #3  
    Registered Member
    Chachi's Avatar
    Join Date
    Sep 2008
    Posts
    1,536
    Thanks given
    49
    Thanks received
    103
    Rep Power
    602
    Well for a 317 client the spell ID would be read as readSignedWordA(). So converting that to what Blake used would be getShortA()
    [/CENTER]
    Reply With Quote  
     

  4. #4  
    Valar Morghulis

    Laxika's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    2,813
    Thanks given
    1,804
    Thanks received
    274
    Rep Power
    2128
    Can u post the packet from the client? If you can't, when I went home I will get it to you. (If I forgot it, send a PM pls. )
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    May 2008
    Posts
    823
    Thanks given
    16
    Thanks received
    31
    Rep Power
    0
    I got it, don't worry about it
    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
  •