Thread: [317] Mystery Box [317]

Page 1 of 3 123 LastLast
Results 1 to 10 of 26
  1. #1 [317] Mystery Box [317] 
    Banned
    Join Date
    Mar 2010
    Posts
    55
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    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
    public static int crackers[] =
    You should then see something like this
    public static int crackers[] = { 1038, 1040, 1042, 1044, 1046, 1048 };
    Okay, underneath that static int lets add one of our own, and lets make it this.
    public static int mysteryb[] = {####, ####, ####, ####};
    Replace the #'s with Item ID's you would like to be able to obtained from your Mysterybox.

    Okay now lets search in item.java for
    public static int randomPHat()
    You should then see this:
    public static int randomPHat() {
    return crackers[(int) (Math.random() * crackers.length)];
    }
    Okay, now under this static int we are going to add one of our own, this is a keypoint in making the mysterybox work!

    Okay, put this underneath the randomPHat static int
    public static int randomMBox() {
    return mysteryb[(int) (Math.random() * mysteryb.length)];
    }
    Okay, that's all for item.java, now lets go to our friend Potions.java and search for
    case 2856:
    Okay, now above case 2856: lets add this
    case 6199:
    c.sM("You Open The Donator's Mystery Box");
    c.deleteItem(6199, 1);
    c.addItem(Item.randomMBox(), 1);
    break;
    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.

    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.
    Reply With Quote  
     

  2. #2  
    Donator
    DotEXE's Avatar
    Join Date
    Feb 2010
    Age
    18
    Posts
    783
    Thanks given
    291
    Thanks received
    164
    Discord
    View profile
    Rep Power
    212
    Naise thnx im use it mayb change it around

    1st post btw!
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    May 2008
    Age
    27
    Posts
    538
    Thanks given
    117
    Thanks received
    42
    Rep Power
    12
    Uhm i have this all made 10 times shorter most of it is useless code

    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Nov 2010
    Posts
    687
    Thanks given
    16
    Thanks received
    47
    Rep Power
    0
    Tyluur released this.
    Reply With Quote  
     

  5. #5  
    Banned
    Join Date
    Mar 2010
    Posts
    55
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by Sohail View Post
    Uhm i have this all made 10 times shorter most of it is useless code
    How could you have possibly released this 10time shorter? this is like the most simple way to code it

    and also, I Wasn't aware that Tyluur Released this, i failed to find any tutorials based on a mystery box other than PI tutorials.
    Reply With Quote  
     

  6. #6  
    Banned

    Join Date
    Nov 2010
    Posts
    687
    Thanks given
    16
    Thanks received
    47
    Rep Power
    0
    this would work for any base.
    Reply With Quote  
     

  7. #7  
    Banned
    Join Date
    Mar 2010
    Posts
    55
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    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
    Reply With Quote  
     

  8. #8  
    Donator
    DotEXE's Avatar
    Join Date
    Feb 2010
    Age
    18
    Posts
    783
    Thanks given
    291
    Thanks received
    164
    Discord
    View profile
    Rep Power
    212
    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||__|__|__|)|
    (@)@)"""""""**|(@)(@)**|(@)
    Reply With Quote  
     

  9. #9  
    Banned
    Join Date
    Mar 2010
    Posts
    55
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Bump
    Reply With Quote  
     

  10. #10  
    Registered Member

    Join Date
    May 2009
    Posts
    1,443
    Thanks given
    653
    Thanks received
    526
    Rep Power
    310
    Probably isn't the best way of doing it but a lot shorter.

    just have:
    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;
    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.

    I'm sure that there's a better way of doing this but I just haven't came across it.
    Retired from RSPS development 2008-2018
    Reply With Quote  
     

Page 1 of 3 123 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. Titania, "Explore the mystery inside"
    By *~Pwnt~* in forum Projects
    Replies: 10
    Last Post: 02-26-2011, 09:39 AM
  2. Project Mystery (first project)
    By pspdude in forum Projects
    Replies: 8
    Last Post: 06-19-2010, 12:02 AM
Tags for this Thread

View Tag Cloud

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •