Thread: Npc drops unlootable by other players

Results 1 to 5 of 5
  1. #1 Npc drops unlootable by other players 
    Registered Member Im That Dude's Avatar
    Join Date
    Dec 2014
    Posts
    126
    Thanks given
    11
    Thanks received
    5
    Rep Power
    13
    Want to make groundItems unlootable, Only by the person that killed the npc can loot the item.

    I am doing this for IronMan mode, This is the last step i'm stuck on could anyone help me with this ?

    My sendDrop Method
    Code:
    public void sendDrop(Player player, Drop drop) {
    		int size = getSize();
    		String dropName = ItemDefinitions.getItemDefinitions(drop.getItemId())
    				.getName().toLowerCase();
    		sendCharms(player);
    		sendClues(player);
    		sendSpin(player);
    		Item item = ItemDefinitions.getItemDefinitions(drop.getItemId())
    				.isStackable() ? new Item(drop.getItemId(),
    				(drop.getMinAmount() * Settings.DROP_RATE)
    						+ Utils.getRandom(drop.getExtraAmount()
    								* Settings.DROP_RATE)) : new Item(
    				drop.getItemId(), drop.getMinAmount()
    						+ Utils.getRandom(drop.getExtraAmount()));
    		World.addGroundItem(item, new WorldTile(getCoordFaceX(size),
    				getCoordFaceY(size), getPlane()), player, false, 180, true);
    		if (player.getRights() == 9) {
    			World.addGroundItem();
    		for (String strings : Settings.RARE_DROPS) {
    			if (dropName.contains(strings)) {
    				World.sendWorldMessage(
    						("<img=7><col=ff8c38>News: " +player.getUsername())
    								+ " <col=ff8c38>Has Received A " + dropName
    								+ "", false);
    				return;
    			}
    			
    		}
    	}

    If i have helped you in any way, I would appreciate if you click that "Thanks" button means alot!
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jan 2015
    Posts
    195
    Thanks given
    137
    Thanks received
    28
    Rep Power
    27
    Store a player variable on your GroundItem which stores the player who got the kill and on your picking up method make a condition to be the same player who got the drop
    Spoiler for Careful seizure:
    penis
    Reply With Quote  
     

  3. #3  
    Registered Member Im That Dude's Avatar
    Join Date
    Dec 2014
    Posts
    126
    Thanks given
    11
    Thanks received
    5
    Rep Power
    13
    Quote Originally Posted by pvm chapi View Post
    Store a player variable on your GroundItem which stores the player who got the kill and on your picking up method make a condition to be the same player who got the drop
    Could you give me an example ?

    If i have helped you in any way, I would appreciate if you click that "Thanks" button means alot!
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jan 2015
    Posts
    195
    Thanks given
    137
    Thanks received
    28
    Rep Power
    27
    Quote Originally Posted by Im That Dude View Post
    Could you give me an example ?
    If you're asking me to write the code for you, nah man you'll have to figure that out yourself. If you don't know the method used for anything in particular you can ask me I'll try to get it for you.
    Spoiler for Careful seizure:
    penis
    Reply With Quote  
     

  5. #5  
    Registered Member Im That Dude's Avatar
    Join Date
    Dec 2014
    Posts
    126
    Thanks given
    11
    Thanks received
    5
    Rep Power
    13
    Quote Originally Posted by pvm chapi View Post
    If you're asking me to write the code for you, nah man you'll have to figure that out yourself. If you don't know the method used for anything in particular you can ask me I'll try to get it for you.
    No i'm not asking you to write everything for me... Just an example of what i'm doing.

    If i have helped you in any way, I would appreciate if you click that "Thanks" button means alot!
    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. Replies: 14
    Last Post: 11-01-2014, 08:43 AM
  2. Ridiculously Simple NPC Drops by XML Loader
    By Mister Maggot in forum Snippets
    Replies: 15
    Last Post: 10-18-2010, 06:59 PM
  3. Replies: 2
    Last Post: 02-12-2010, 09:42 PM
  4. If killed by Npc Drop items
    By Delifed in forum Requests
    Replies: 0
    Last Post: 07-16-2009, 08:57 PM
  5. Replies: 13
    Last Post: 11-06-2008, 01:36 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
  •