Naise thnx im use it mayb change it around
1st post btw!
|
|
400 VIEWS And only 18 Posts, IF YOUR GOING TO JUST TAKE THIS, PLEASE ATLEAST POST!
Hello, I know that a tutorial based on the 'Mystery Box' has been released for PI however I Have failed to find a working one for deltascape and other source users.
Get ready for some spoon-feeding!
Okay, firstly lets open up Item.java and search for
You should then see something like thispublic static int crackers[] =
Okay, underneath that static int lets add one of our own, and lets make it this.public static int crackers[] = { 1038, 1040, 1042, 1044, 1046, 1048 };
Replace the #'s with Item ID's you would like to be able to obtained from your Mysterybox.public static int mysteryb[] = {####, ####, ####, ####};
Okay now lets search in item.java for
You should then see this:public static int randomPHat()
Okay, now under this static int we are going to add one of our own, this is a keypoint in making the mysterybox work!public static int randomPHat() {
return crackers[(int) (Math.random() * crackers.length)];
}
Okay, put this underneath the randomPHat static int
Okay, that's all for item.java, now lets go to our friend Potions.java and search forpublic static int randomMBox() {
return mysteryb[(int) (Math.random() * mysteryb.length)];
}Okay, now above case 2856: lets add thiscase 2856:
Now what this case means is, that the mystery box will open and be deleted and you will receive one of the multiple items you have put in your RandomMBox Int.case 6199:
c.sM("You Open The Donator's Mystery Box");
c.deleteItem(6199, 1);
c.addItem(Item.randomMBox(), 1);
break;
You Are Now going to save, compile then spawn a mysterybox [CODE = 6199]
If you do not receive an Item from your mystery box, you have obviously not replaced the # Symbols in item.java with real Items, or if you are given a null in exchange for your box, the ItemID that you changed the #'s too, is an Invalid item.
Final Results:
Thank you,
Please post if this helped you.

Naise thnx im use it mayb change it around
1st post btw!
Uhm i have this all made 10 times shorter most of it is useless code

Tyluur released this.

this would work for any base.
I Know this one would, which is why I made it, however the PI Ones that I Have seen are based on client.java and Actionbuttons.java and are therefore rendered useless to other bases because of Actionbuttons.java

oi guys just give him a break he tried 2 do somthing good for the community so sftu?
take a ride on
_________________
|^\||____
| The STFU Truck |||""'|""\__,_
| _____________ l||__|__|__|)|
(@)@)"""""""**|(@)(@)**|(@)
Bump

Probably isn't the best way of doing it but a lot shorter.
just have:
Pretty straight forward, it's not tested but common sence, 519 is 1038\2, the reason why I did this so that I could add the random number to it and then multiply it by two to avoid uneven numbers resulting in a noted phat.Code:case 6199: int randomMBox = 519 += Misc.random(5); c.sM("You Open The Donator's Mystery Box"); c.deleteItem(6199, 1); c.addItem(Item.randomMBox * 2, 1); break;
I'm sure that there's a better way of doing this but I just haven't came across it.
| « [PI]Ultimate Runecrafting Base | Running server on different OS » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |
| Tags for this Thread |