Thread: [pi] Dropping items does not work

Results 1 to 8 of 8
  1. #1 [pi] Dropping items does not work 
    AleroBio Owner

    Join Date
    Feb 2011
    Posts
    362
    Thanks given
    26
    Thanks received
    13
    Rep Power
    0
    Okay so when i try to drop items it wont delete them from the players inventory nor will they appear on the ground, how can i fix


    Code:
     package server.model.players.packets;
    
    import server.Config;
    import server.Server;
    import server.model.players.Client;
    import server.model.players.PacketType;
    
    /**
     * Drop Item
     **/
    public class DropItem implements PacketType {
    
    	@Override
    	public void processPacket(Client c, int packetType, int packetSize) {
    		int itemId = c.getInStream().readUnsignedWordA();
    		c.getInStream().readUnsignedByte();
    		c.getInStream().readUnsignedByte();
    		int slot = c.getInStream().readUnsignedWordA();
    		if (System.currentTimeMillis() - c.alchDelay < 1800) {
    			return;
    		}
    		if(c.arenas()) {
    			c.sendMessage("You can't drop items inside the arena!");
    			return;
    		}
    		if(c.inTrade) {
    			c.sendMessage("You can't drop items while trading!");
    			return;
    			}
    
    		boolean droppable = true;
    		for (int i : Config.UNDROPPABLE_ITEMS) {
    			if (i == itemId) {
    				droppable = false;
    				break;
    			}
    		}
    		
    		if(itemId == 4045) {
    		int explosiveHit = 15;
    		c.startAnimation(827);
    		c.getItems().deleteItem(itemId, slot, c.playerItemsN[slot]);
    		c.handleHitMask(explosiveHit);
    		c.dealDamage(explosiveHit);
    		c.getPA().refreshSkill(3);
    		c.forcedText = "Ow! That really hurt!";
    		c.forcedChatUpdateRequired = true;
    		c.updateRequired = true;
    		
    			if(itemId == 2379) {
    		int rockCakeDamage = 50;
    		c.startAnimation(827);
    		c.getItems().deleteItem(itemId, slot, c.playerItemsN[slot]);
    		c.handleHitMask(rockCakeDamage);
    		c.dealDamage(rockCakeDamage);
    		c.getPA().refreshSkill(3);
    		c.forcedText = "Ow! What the ****?";
    		c.forcedChatUpdateRequired = true;
    		c.updateRequired = true;
    		
    
    }
    		if(c.playerItemsN[slot] != 0 && itemId != -1 && c.playerItems[slot] == itemId + 1) {
    			if(droppable) {
    				if (c.underAttackBy > 0) {
    					if (c.getShops().getItemShopValue(itemId) > 1000) {
    						c.sendMessage("You may not drop items worth more than 1000 while in combat.");
    						return;
    					}
    				}
    				Server.itemHandler.createGroundItem(c, itemId, c.getX(), c.getY(), c.playerItemsN[slot], c.getId());
    				c.getItems().deleteItem(itemId, slot, c.playerItemsN[slot]);
    			} else {
    				c.sendMessage("This items cannot be dropped.");
    			}
    		}
    
    	}
    }
    }


    Here is also the Drop items method in playerassistant

    Code:
    	public void dropitems() {
    		if (c.lastsummon > 0) {
    			if (c.totalstored > 0) {
    				c.firstslot();
    				for (int i = 0; i < 29; i += 1) {
    					Server.itemHandler.createGroundItem(c, c.storeditems[i],
    							NPCHandler.npcs[c.summoningnpcid].absX,
    							NPCHandler.npcs[c.summoningnpcid].absY, 1,
    							c.playerId);
    					c.storeditems[i] = -1;
    					c.occupied[i] = false;
    				}
    			}
    			c.lastsummon = -1;
    			c.totalstored = 0;
    			c.summoningnpcid = 0;
    			c.summoningslot = 0;
    			c.sendMessage("Your BoB items have drop on the floor");
    		}
    
    	}
    Reply With Quote  
     

  2. #2  
    SMD!

    Broadwell's Avatar
    Join Date
    Mar 2013
    Posts
    58
    Thanks given
    48
    Thanks received
    7
    Rep Power
    89
    This might be an easy fix. I dunno. I looked trough your code and there isn't any errors that i think of.

    Maybe try fixing this trough somewhere else.

    Don't know what base your using, but this is worth a try....

    Go into client.java

    Search for
    Code:
    private void processMinimapActions() {

    then look for these and delete them:
    Code:
    if (super.mouseY >= 233 && super.mouseY <= 242) {
    			if(super.mouseX >= 550 && super.mouseX <= 563){
    			if(!praySelected) {
    					menuActionName[2] = "Select";
    			} else if(praySelected){
    					menuActionName[2] = "Unselect";
    			}
    					menuActionID[2] = 18026;
    					menuActionRow = 2;
    			}
    		if(super.mouseX >= 590 && super.mouseX <= 600){
    			if(!praySelected) {
    					menuActionName[2] = "Select";
    			} else if(praySelected){
    					menuActionName[2] = "Unselect";
    			}
    					menuActionID[2] = 18027;
    					menuActionRow = 2;
    			}
    		if(super.mouseX >= 630 && super.mouseX <= 637){
    			if(!praySelected) {
    					menuActionName[2] = "Select";
    			} else if(praySelected){
    					menuActionName[2] = "Unselect";
    			}
    					menuActionID[2] = 18028;
    					menuActionRow = 2;
    			}
    		}

    That might be the problem. Who knows.....
    Reply With Quote  
     

  3. #3  
    AleroBio Owner

    Join Date
    Feb 2011
    Posts
    362
    Thanks given
    26
    Thanks received
    13
    Rep Power
    0
    I really dont see how minimap options have anything to do with this lol


    but other than that i dont think that would help one bit , and i tried it ... didn't help
    Reply With Quote  
     

  4. #4  
    Registered Member
    Karma_K's Avatar
    Join Date
    Nov 2012
    Posts
    4,283
    Thanks given
    152
    Thanks received
    610
    Rep Power
    108
    Quote Originally Posted by xToxic View Post
    This might be an easy fix. I dunno. I looked trough your code and there isn't any errors that i think of.

    Maybe try fixing this trough somewhere else.

    Don't know what base your using, but this is worth a try....

    Go into client.java

    Search for
    Code:
    private void processMinimapActions() {

    then look for these and delete them:
    Code:
    if (super.mouseY >= 233 && super.mouseY <= 242) {
    			if(super.mouseX >= 550 && super.mouseX <= 563){
    			if(!praySelected) {
    					menuActionName[2] = "Select";
    			} else if(praySelected){
    					menuActionName[2] = "Unselect";
    			}
    					menuActionID[2] = 18026;
    					menuActionRow = 2;
    			}
    		if(super.mouseX >= 590 && super.mouseX <= 600){
    			if(!praySelected) {
    					menuActionName[2] = "Select";
    			} else if(praySelected){
    					menuActionName[2] = "Unselect";
    			}
    					menuActionID[2] = 18027;
    					menuActionRow = 2;
    			}
    		if(super.mouseX >= 630 && super.mouseX <= 637){
    			if(!praySelected) {
    					menuActionName[2] = "Select";
    			} else if(praySelected){
    					menuActionName[2] = "Unselect";
    			}
    					menuActionID[2] = 18028;
    					menuActionRow = 2;
    			}
    		}

    That might be the problem. Who knows.....
    Dafuq? You on the crack?

    And I see the problem. Your brackets are placed "wrongly" read your dropItem packet
    Reply With Quote  
     

  5. #5  
    SMD!

    Broadwell's Avatar
    Join Date
    Mar 2013
    Posts
    58
    Thanks given
    48
    Thanks received
    7
    Rep Power
    89
    Quote Originally Posted by Karma_K View Post
    Dafuq? You on the crack?

    And I see the problem. Your brackets are placed "wrongly" read your dropItem packet

    Nah, but i was a little bit high.....

    Nonetheless, haven't coded for ages. I remember just a lil bit about this relating to a problem i had, so i gave my opinion on the matter for a fix.....

    And yeah, his brackets are placed wrongly. Didn't even notice that lol.
    Reply With Quote  
     

  6. #6  
    AleroBio Owner

    Join Date
    Feb 2011
    Posts
    362
    Thanks given
    26
    Thanks received
    13
    Rep Power
    0
    Still dont see the problem mate be a bit more specific please.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Karma_K's Avatar
    Join Date
    Nov 2012
    Posts
    4,283
    Thanks given
    152
    Thanks received
    610
    Rep Power
    108
    Quote Originally Posted by *Rawbie View Post
    Still dont see the problem mate be a bit more specific please.
    If you can't figure this out yourself.. Maybe go read the basic points of java as I'm not sure if this even should befall as a basic thing as its too basic
    Reply With Quote  
     

  8. #8  
    AleroBio Owner

    Join Date
    Feb 2011
    Posts
    362
    Thanks given
    26
    Thanks received
    13
    Rep Power
    0
    I figured it out, and i know the basics... lol its the fact that i cant see somethings sometimes
    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

Similar Threads

  1. [PI] Farming Does not work?
    By Skarlett in forum Help
    Replies: 0
    Last Post: 06-22-2013, 02:16 AM
  2. [PI] Prayer does not work.
    By t1a2m3o in forum Help
    Replies: 0
    Last Post: 10-23-2012, 04:52 PM
  3. Replies: 0
    Last Post: 07-13-2012, 05:18 AM
  4. [PI] Player drops via pvp not working..
    By Aexious in forum Help
    Replies: 13
    Last Post: 12-16-2011, 11:46 PM
  5. Replies: 6
    Last Post: 07-27-2010, 02:27 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •