Thread: System for dropping clues

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 System for dropping clues 
    Registered Member
    Join Date
    May 2015
    Posts
    158
    Thanks given
    52
    Thanks received
    5
    Rep Power
    11
    Hi,

    I was wondering if anyone could get me started on some type of clue dropping system.

    I found a list of NPC's that drop clues; List of clue scroll dropping monsters - RuneScape Wiki - Wikia


    I'm not asking for someone to make this for me, just need an example of how I might be able to do this.


    Rep + Thanks
    Reply With Quote  
     

  2. #2  
    Banned
    Join Date
    Jun 2013
    Posts
    362
    Thanks given
    112
    Thanks received
    31
    Rep Power
    0
    Edit the drops so a specific monster drops the specific cluescroll haha?
    Reply With Quote  
     

  3. #3  
    Extreme Donator

    TaterMater's Avatar
    Join Date
    Aug 2011
    Posts
    1,511
    Thanks given
    218
    Thanks received
    375
    Rep Power
    121
    If you're wanting to integrate this into code instead of tediously changing every monsters drop table, here's a little way of doing it:

    In NPC.java add this static int array:
    Code:
    public static final int[][] MONSTERS_TO_DROP_CLUES = {{50, 70}, {1, 1}, {120, 19}};//Format example: {50, 70} = {npc_id, chance of receiving clue}
    Add this method:
    Code:
    public void checkClueScrollDrop(Player player) {
    		int size = getSize();
    		for(int i=0;i<MONSTERS_TO_DROP_CLUES.length;i++) {
    			if(MONSTERS_TO_DROP_CLUES[i][0] == this.getId()) {
    				int random = Misc.random(100);
    				if(random <= MONSTERS_TO_DROP_CLUES[i][1]) {
    					World.addGroundItem(new Item(CLUE_ID, 1), new WorldTile(getCoordFaceX(size), getCoordFaceY(size), getPlane()), player, false, 180, true);
    				}
    			}
    		}
    	}
    And finally, in your sendDrop() method, check your new method there:
    Code:
    checkClueScrollDrop(player);

    Reply With Quote  
     

  4. Thankful user:


  5. #4  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by TaterMater View Post
    If you're wanting to integrate this into code instead of tediously changing every monsters drop table, here's a little way of doing it:

    In NPC.java add this static int array:
    Code:
    public static final int[][] MONSTERS_TO_DROP_CLUES = {{50, 70}, {1, 1}, {120, 19}};//Format example: {50, 70} = {npc_id, chance of receiving clue}
    Add this method:
    Code:
    public void checkClueScrollDrop(Player player) {
    		int size = getSize();
    		for(int i=0;i<MONSTERS_TO_DROP_CLUES.length;i++) {
    			if(MONSTERS_TO_DROP_CLUES[i][0] == this.getId()) {
    				int random = Misc.random(100);
    				if(random <= MONSTERS_TO_DROP_CLUES[i][1]) {
    					World.addGroundItem(new Item(CLUE_ID, 1), new WorldTile(getCoordFaceX(size), getCoordFaceY(size), getPlane()), player, false, 180, true);
    				}
    			}
    		}
    	}
    And finally, in your sendDrop() method, check your new method there:
    Code:
    checkClueScrollDrop(player);
    Would take a long ass time. TBH, much rater put a 1/2/3/4 value that stands for EASY/MED/RARE/ELITE and it's going to drop a different clue with a different chance depending on that.
    Project thread
    Reply With Quote  
     

  6. #5  
    Extreme Donator

    TaterMater's Avatar
    Join Date
    Aug 2011
    Posts
    1,511
    Thanks given
    218
    Thanks received
    375
    Rep Power
    121
    Quote Originally Posted by clem585 View Post
    Would take a long ass time. TBH, much rater put a 1/2/3/4 value that stands for EASY/MED/RARE/ELITE and it's going to drop a different clue with a different chance depending on that.
    Well yeah, you can go about this way better, but I posted this to help him get started.

    Reply With Quote  
     

  7. #6  
    Banned
    Join Date
    Jan 2011
    Posts
    334
    Thanks given
    20
    Thanks received
    88
    Rep Power
    0
    Quote Originally Posted by TaterMater View Post
    Well yeah, you can go about this way better, but I posted this to help him get started.
    If you want to help him get started, don't post inefficient code.
    Reply With Quote  
     

  8. #7  
    Extreme Donator

    TaterMater's Avatar
    Join Date
    Aug 2011
    Posts
    1,511
    Thanks given
    218
    Thanks received
    375
    Rep Power
    121
    Quote Originally Posted by Wrecked... View Post
    If you want to help him get started, don't post inefficient code.
    Excuse me, who are you?

    1. I'm not getting paid to help him, I'm doing it off my own back
    2. It's not inefficient, it just could be more organized; personally I'd handle it in a txt file
    3. https://gyazo.com/38bad9d712a11e8678699c026def15c7

    Reply With Quote  
     

  9. #8  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by Wrecked... View Post
    If you want to help him get started, don't post inefficient code.
    He certainly did more than you.
    Project thread
    Reply With Quote  
     

  10. #9  
    Banned
    Join Date
    Jan 2011
    Posts
    334
    Thanks given
    20
    Thanks received
    88
    Rep Power
    0
    Quote Originally Posted by TaterMater View Post
    Excuse me, who are you?

    1. I'm not getting paid to help him, I'm doing it off my own back
    2. It's not inefficient, it just could be more organized; personally I'd handle it in a txt file
    3. https://gyazo.com/38bad9d712a11e8678699c026def15c7
    It is inefficient. You have to constantly iterate through your 2D array to find the specific value that you're looking for, that's ridiculous.
    Reply With Quote  
     

  11. #10  
    Extreme Donator

    TaterMater's Avatar
    Join Date
    Aug 2011
    Posts
    1,511
    Thanks given
    218
    Thanks received
    375
    Rep Power
    121
    Quote Originally Posted by Wrecked... View Post
    It is inefficient. You have to constantly iterate through your 2D array to find the specific value that you're looking for, that's ridiculous.
    I mean, you could get more efficient, but this isn't as inefficient to a point where it's a really big issue. If I was doing this for a customer I'd probably use a hashmap to store the data, but this guy was looking for a base starter example:

    I'm not asking for someone to make this for me, just need an example of how I might be able to do this.

    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. Buying decent drop system for Biohazard
    By AnonymousUser in forum Buying
    Replies: 1
    Last Post: 12-21-2014, 12:05 PM
  2. Random pvp drop system for dementhium
    By Ta1nt3d in forum Tutorials
    Replies: 20
    Last Post: 12-02-2012, 06:56 AM
  3. A new NPC drop system for PI and Emulous.
    By Rune Division in forum Tutorials
    Replies: 8
    Last Post: 01-04-2011, 07:04 PM
  4. Replies: 17
    Last Post: 06-21-2008, 06:38 PM
  5. Replies: 12
    Last Post: 04-22-2008, 03:18 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
  •