Jump to content
Dally

100% Mystery Box & Caskets (Like RuneScape using Common, Uncommon, Rare, Very Rare)

Recommended Posts

I've seen other releases, but not one's that work just like RuneScape. I used the items and descriptions from

Please login or register to see this link.

and

Please login or register to see this link.

to complete these classes. Hope these can be useful for some of you. Good luck

Please login or register to see this code.

Please login or register to see this code.

 

Share this post


Link to post
Share on other sites
Looks good, one suggestion is just to add a check to make sure the player has the item in the inventory before they are given a prize.

Share this post


Link to post
Share on other sites
If you wanted to put a percentage on each individual item, you could load them as a map, or make it into an enumeration. That would be pretty nifty.





Or just an annotation.

Share this post


Link to post
Share on other sites
[quote name='Game Master']If you wanted to put a percentage on each individual item, you could load them as a map, or make it into an enumeration. That would be pretty nifty.





Or just an annotation.[/QUOTE]NO. Reloadable files all the way.

Share this post


Link to post
Share on other sites
Well if you use an annotation and save the properties in, say, an XML file - that would be quite efficient. This could also allow you to make changes to it without having to restart your server. Edited by Game Master

Share this post


Link to post
Share on other sites

Mystery boxes are one of the utmost basics of a RSPS server they have been around forever.

Their simplicity and wonder is a thing of beauty I think it's about time I 1up the typical mystery box design though... 

Share this post


Link to post
Share on other sites

Why not use chance?

Please login or register to see this code.

Share this post


Link to post
Share on other sites
7 hours ago, Teek said:

Why not use chance?

 

Please login or register to see this code.

 

There's hardly a difference between Misc.random(int); and Math.getRandom(); You're correct by saying Math.getRandom() is a chance, however Misc.random(int) does the very same thing basically, slightly pro-longed though as it'll do a few more steps. Barely a difference between the two.

 

On-topic though. I really can't see the point in posting the same thing twice here, the only thing that changed are the sent strings and ids within the arrays.

Another thing I'm struggling to find here is the check for mystery box and the removal of mystery box.

PS: Since these two are almost identical, you could've just made them both in one class, through different arrays. Could've saved an entire class. Nonetheless though, thank you for contributing. Minor improvements could be done as you can tell but it's nothing bad, good job.

Share this post


Link to post
Share on other sites
Just now, Eldritch said:

There's hardly a difference between Misc.random(int); and Math.getRandom(); You're correct by saying Math.getRandom() is a chance, however Misc.random(int) does the very same thing basically, slightly pro-longed though as it'll do a few more steps. Barely a difference between the two.

 

On-topic though. I really can't see the point in posting the same thing twice here, the only thing that changed are the sent strings and ids within the arrays.

Another thing I'm struggling to find here is the check for mystery box and the removal of mystery box.

PS: Since these two are almost identical, you could've just made them both in one class, through different arrays. Could've saved an entire class. Nonetheless though, thank you for contributing. Minor improvements could be done as you can tell but it's nothing bad, good job.

 

It's 1000000000000000x better than having if statements everyone, math.random is simple..

Please login or register to see this code.

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

×