Jump to content
  • 0
Sign in to follow this  
Boydie

Help please

Question

package com.ImmortalX.rs2.entity.mob;

import com.ImmortalX.core.util.Utility;
import com.ImmortalX.rs2.entity.item.Item;

public class RareDropTable {
	public static final int[][] RARE_DROP_TABLE = { { 995, 10000, 30000 },
			{ 1623, 1, 1 }, { 1631, 1, 1 }, { 1621, 1, 1 }, { 1619, 1, 1 },
			{ 1617, 1, 1 }, { 1247, 1, 1 }, { 1201, 1, 1 }, { 1249, 1, 1 },
			{ 1149, 1, 1 }, { 1147, 1, 1 }, { 1215, 1, 1 }, { 454, 10, 100 },
			{ 7937, 100, 700 }, { 2358, 5, 45 }, { 384, 25, 100 },
			{ 452, 4, 15 }, { 1516, 62, 124 }, { 9245, 22, 66 },
			{ 9244, 36, 78 }, { 9243, 36, 78 }, { 9242, 78, 340 },
			{ 9241, 100, 450 }, { 2441, 7, 22 }, { 2437, 7, 22 },
			{ 2442, 7, 22 }, { 2445, 22, 34 }, { 3041, 22, 34 },
			{ 565, 450, 1250 }, { 562, 780, 1250 }, { 561, 750, 1250 },
			{ 560, 650, 1250 }, { 533, 45, 125 }, { 537, 5, 25 },
			{ 1127, 1, 1 }, { 2615, 1, 1 }, { 2617, 1, 1 }, { 2619, 1, 1 },
			{ 2621, 1, 1 }, { 2623, 1, 1 }, { 2625, 1, 1 }, { 2627, 1, 1 },
			{ 2629, 1, 1 }, { 2631, 1, 1 }, { 2633, 1, 1 }, { 2635, 1, 1 },
			{ 2637, 1, 1 }, { 6335, 1, 1 }, { 2653, 1, 1 }, { 2653, 1, 1 },
			{ 2655, 1, 1 }, { 2657, 1, 1 }, { 2659, 1, 1 }, { 2661, 1, 1 },
			{ 2663, 1, 1 }, { 2665, 1, 1 }, { 2667, 1, 1 }, { 2669, 1, 1 },
			{ 2671, 1, 1 }, { 2673, 1, 1 }, { 2675, 1, 1 }, { 1187, 1, 1 },
			{ 1185, 1, 1 }, { 1333, 1, 1 }, { 4587, 1, 1 }, { 1434, 1, 1 },
			{ 1432, 1, 1 }, { 893, 300, 1250 }, { 892, 500, 1240 },
			{ 9185, 1, 1 }, { 443, 500, 1250 }, { 2358, 150, 350 } };

	public static Item getDrop() {
		int[] d = RARE_DROP_TABLE[Utility.randomNumber(RARE_DROP_TABLE.length)];

		return new Item(d[0], d[1] < d[2] ? d[1]
				+ Utility.randomNumber(d[2] - d[1]) : d[1]);
	}
}

Alright so, I'm trying to figure out how I would make a table like this, but for seeds, I'm completely re-writing npc drops & would find it much simpler to add a generic list of common/uncommon drops for every monster & then add extras for certain ones, how would I re-write this?

Obviously change RARE_DROP_TABLE to Seed_Drop_Table, but like what else? It's not that easy it gives me errors, I've tried for hours to add common/uncommon & rare tables, but so far the only way is to write them singularly for every npc & it gets so repetetive & it will be very time consuming.

Edited by Boydie

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Basically, you would need to make another class called SeedDropTable, and then in that class you would recreate said table. Look at how RareDropTable is implemented and how they made certain NPCs use this system. I assume the first ID in this table is the item ID, followed by minimum value and maximum value, or it gets a random number in between the two. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×