Edit the drops so a specific monster drops the specific cluescroll haha?
|
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
Edit the drops so a specific monster drops the specific cluescroll haha?
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:
Add this method: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}
And finally, in your sendDrop() method, check your new method there: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); } } } }
Code:checkClueScrollDrop(player);
Excuse me, who are you?
- I'm not getting paid to help him, I'm doing it off my own back
- It's not inefficient, it just could be more organized; personally I'd handle it in a txt file
- https://gyazo.com/38bad9d712a11e8678699c026def15c7
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.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |