Thread: [718] [HELP] Disabling picking up items dropped by other players.

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1 [718] [HELP] Disabling picking up items dropped by other players. 
    Registered Member
    Join Date
    Oct 2014
    Age
    27
    Posts
    8
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Hey!

    I am working on some sort of Iron Man rank and I got everything ready. There's only one thing left and that's stopping Iron Man players picking up items that other players are dropping.
    Iron Man players should be able to still drop and still be able to pick up drops from monsters,
    I've looked everywhere on the internet but wasn't able to find anything about this. Does someone have an idea?

    Thanks
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Aug 2007
    Posts
    248
    Thanks given
    28
    Thanks received
    25
    Rep Power
    5
    Possibly this, I have not tested nor will I but the npc drops is handled the same way with some servers who have the pker mode.

    Go to InventoryOptionsHandler, and search for "handleoption7". If you scroll down you will see "World.addGroundItem(item, new WorldTile(player), player, true, 60);". Try changing it to something like:

    Code:
    if (player.isIronMan) {
                 World.addGroundItem(item, new WorldTile(player), player, true, 6000000);
                 player.getPackets().sendSound(2739, 0, 1);
             } else {
             	World.addGroundItem(item, new WorldTile(player), player, true, 60);
    		player.getPackets().sendSound(2739, 0, 1);
    	    }
    	}
    This could definitely be done better, but seeing as how I am the only reply hopefully this helps.
    Elite Lurker
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    May 2011
    Age
    29
    Posts
    2,246
    Thanks given
    2,469
    Thanks received
    1,120
    Rep Power
    943
    Just make drops bound to ironman accounts not appear public to other players.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Oct 2014
    Age
    27
    Posts
    8
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by Tylurr View Post
    Just make drops bound to ironman accounts not appear public to other players.
    Yeh, that's what I was trying to do, but I have no idea to do it haha.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    May 2011
    Age
    29
    Posts
    2,246
    Thanks given
    2,469
    Thanks received
    1,120
    Rep Power
    943
    Quote Originally Posted by frisidan View Post
    Yeh, that's what I was trying to do, but I have no idea to do it haha.
    Code:
    public final void turnPublic(FloorItem floorItem, int publicTime) {
    		if (!floorItem.isInvisible())
    			return;
    		int regionId = floorItem.getTile().getRegionId();
    		final Region region = getRegion(regionId);
    		if (!region.getGroundItemsSafe().contains(floorItem))
    			return;
    		Player realOwner = floorItem.hasOwner() ? getPlayer(floorItem.getOwner()) : null;
    //Ironman check would go here...
    		if (!ItemConstants.isTradeable(floorItem)) {
    			region.getGroundItemsSafe().remove(floorItem);
    			if (realOwner != null) {
    				if (realOwner.getMapRegionsIds().contains(regionId)
    						&& realOwner.getPlane() == floorItem.getTile().getPlane())
    					realOwner.getPackets().sendRemoveGroundItem(floorItem);
    
    			}
    			return;
    		}
    		floorItem.setInvisible(false);
    		for (Player player : players) {
    			if (player == null || player == realOwner || !player.hasStarted() || player.hasFinished()
    					|| player.getPlane() != floorItem.getTile().getPlane()
    					|| !player.getMapRegionsIds().contains(regionId))
    				continue;
    			player.getPackets().sendGroundItem(floorItem);
    		}
    		if (publicTime != -1)
    			removeGroundItem(floorItem, publicTime);
    	}
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Oct 2014
    Age
    27
    Posts
    8
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by Tylurr View Post
    Code:
    public final void turnPublic(FloorItem floorItem, int publicTime) {
    		if (!floorItem.isInvisible())
    			return;
    		int regionId = floorItem.getTile().getRegionId();
    		final Region region = getRegion(regionId);
    		if (!region.getGroundItemsSafe().contains(floorItem))
    			return;
    		Player realOwner = floorItem.hasOwner() ? getPlayer(floorItem.getOwner()) : null;
    //Ironman check would go here...
    		if (!ItemConstants.isTradeable(floorItem)) {
    			region.getGroundItemsSafe().remove(floorItem);
    			if (realOwner != null) {
    				if (realOwner.getMapRegionsIds().contains(regionId)
    						&& realOwner.getPlane() == floorItem.getTile().getPlane())
    					realOwner.getPackets().sendRemoveGroundItem(floorItem);
    
    			}
    			return;
    		}
    		floorItem.setInvisible(false);
    		for (Player player : players) {
    			if (player == null || player == realOwner || !player.hasStarted() || player.hasFinished()
    					|| player.getPlane() != floorItem.getTile().getPlane()
    					|| !player.getMapRegionsIds().contains(regionId))
    				continue;
    			player.getPackets().sendGroundItem(floorItem);
    		}
    		if (publicTime != -1)
    			removeGroundItem(floorItem, publicTime);
    	}
    This should be in World.java I assume?
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Aug 2007
    Posts
    248
    Thanks given
    28
    Thanks received
    25
    Rep Power
    5
    Quote Originally Posted by frisidan View Post
    This should be in World.java I assume?
    You are correct.
    Elite Lurker
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Oct 2014
    Age
    27
    Posts
    8
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by Tylurr View Post
    Code:
    public final void turnPublic(FloorItem floorItem, int publicTime) {
    		if (!floorItem.isInvisible())
    			return;
    		int regionId = floorItem.getTile().getRegionId();
    		final Region region = getRegion(regionId);
    		if (!region.getGroundItemsSafe().contains(floorItem))
    			return;
    		Player realOwner = floorItem.hasOwner() ? getPlayer(floorItem.getOwner()) : null;
    //Ironman check would go here...
    		if (!ItemConstants.isTradeable(floorItem)) {
    			region.getGroundItemsSafe().remove(floorItem);
    			if (realOwner != null) {
    				if (realOwner.getMapRegionsIds().contains(regionId)
    						&& realOwner.getPlane() == floorItem.getTile().getPlane())
    					realOwner.getPackets().sendRemoveGroundItem(floorItem);
    
    			}
    			return;
    		}
    		floorItem.setInvisible(false);
    		for (Player player : players) {
    			if (player == null || player == realOwner || !player.hasStarted() || player.hasFinished()
    					|| player.getPlane() != floorItem.getTile().getPlane()
    					|| !player.getMapRegionsIds().contains(regionId))
    				continue;
    			player.getPackets().sendGroundItem(floorItem);
    		}
    		if (publicTime != -1)
    			removeGroundItem(floorItem, publicTime);
    	}
    Do you mind giving me the getGroundItemsSafe method in Region.java?
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Aug 2007
    Posts
    248
    Thanks given
    28
    Thanks received
    25
    Rep Power
    5
    Quote Originally Posted by frisidan View Post
    Do you mind giving me the getGroundItemsSafe method in Region.java?
    Code:
        public List<FloorItem> getGroundItemsSafe() {
    		if (floorItems == null)
    			floorItems = new CopyOnWriteArrayList<FloorItem>();
    		return floorItems;
        }
    Btw, I recommend using another source as a reference if you need to rip things from it. That's what I do to avoid hunting down methods etc..
    Elite Lurker
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Oct 2014
    Age
    27
    Posts
    8
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by leggomyeggo View Post
    Code:
        public List<FloorItem> getGroundItemsSafe() {
    		if (floorItems == null)
    			floorItems = new CopyOnWriteArrayList<FloorItem>();
    		return floorItems;
        }
    Btw, I recommend using another source as a reference if you need to rip things from it. That's what I do to avoid hunting down methods etc..
    Ah, great idea! Thanks a lot
    Reply With Quote  
     

Page 1 of 2 12 LastLast

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. [718] Cant pick up items on ground
    By Mvrcus in forum Help
    Replies: 1
    Last Post: 07-11-2014, 10:31 PM
  2. Picking up items while frozen [PI] [HELP]
    By Greens Pride in forum Help
    Replies: 2
    Last Post: 10-01-2013, 08:22 PM
  3. [PI] Can't pick up items?
    By Thani in forum Help
    Replies: 0
    Last Post: 11-14-2010, 04:43 AM
  4. Picking up items
    By 420weed420 in forum Help
    Replies: 1
    Last Post: 11-27-2009, 12:00 AM
  5. Picking up items.
    By Stanyer in forum RS 503+ Client & Server
    Replies: 6
    Last Post: 08-15-2008, 09:13 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •