Thread: Drop Table

Results 1 to 3 of 3
  1. #1 Drop Table 
    Donator

    Join Date
    Feb 2017
    Posts
    24
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Code:
    			/** Add all selected drops. */
    			if ((res <= drop.getChance())) {
    				items[i++] = new Item(drop.getItem().getId(), Misc.randomNoZero(drop.getItem().getCount()));
    			}
    		}
    So this code makes the NPCS drop multiple items, that is shown in Npc_drops.json - How do i make it so only the Chance: 1 in the NPC Drops are dropped consistently everytime. And not everything else drops everytime?
    Reply With Quote  
     

  2. #2  
    Software Developer

    Tyrant's Avatar
    Join Date
    Jul 2013
    Age
    24
    Posts
    1,562
    Thanks given
    678
    Thanks received
    423
    Rep Power
    1060
    Imagine having an array consist of possible drops.
    Then you iterate through the drop table of that npc and for each drop that its chance is a guaranteed one (100%)
    it wont be passed into the array but directly called to be dropped.
    And the rest of the drops whom not guaranteed will be added to the array of the rest of possible drops.
    Reply With Quote  
     

  3. #3  
    Donator

    Join Date
    Feb 2017
    Posts
    24
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Tyrant View Post
    Imagine having an array consist of possible drops.
    Then you iterate through the drop table of that npc and for each drop that its chance is a guaranteed one (100%)
    it wont be passed into the array but directly called to be dropped.
    And the rest of the drops whom not guaranteed will be added to the array of the rest of possible drops.
    Solved it, But none solution from what you wrote. Thanks anyways
    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: 23
    Last Post: 01-17-2014, 05:30 AM
  2. PI Drop Tables
    By Notgower in forum Help
    Replies: 7
    Last Post: 04-27-2013, 10:25 PM
  3. [PI] Underingstanding The Rare Drop Table
    By Merrow in forum Snippets
    Replies: 4
    Last Post: 04-06-2013, 04:59 AM
  4. perfect tormented demon drop table
    By Teemuzz in forum Configuration
    Replies: 21
    Last Post: 03-30-2010, 05:17 PM
  5. Drop Tables.
    By Bando in forum RS2 Server
    Replies: 21
    Last Post: 02-13-2010, 10:12 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
  •