Thread: [Elvarg] How to add weighted mystery boxes?

Results 1 to 2 of 2
  1. #1 [Elvarg] How to add weighted mystery boxes? 
    Registered Member
    Join Date
    Feb 2019
    Posts
    8
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Im wanting to have mystery boxes with various items in such as godswords, spirt shields party hats ect but i want some items to be super rare such as the party hats? how would i add this please?

    as an example

    godswords - 1/50
    Spirit Shields - 1/75
    Party Hats - 1/500

    then I would add random items in too at a common rate such as barrows etc
    Reply With Quote  
     

  2. #2  
    Extreme Donator

    Patrity's Avatar
    Join Date
    Jul 2008
    Age
    27
    Posts
    771
    Thanks given
    59
    Thanks received
    134
    Discord
    Patrity#0001
    Rep Power
    185
    Code:
    int roll = Misc.random(1,100);
    if (roll <= 70)
          commonDropStuff(); //70% drop
    else if (roll > 70 && roll < 96)
          rareDropStuff(); // 25% drop
    else if (roll >= 96)
          veryRareDropStuff(); //5% drop
    You would just tie this into your boxes inventory click option.

    sorry for the BS Spacing, typed it up right here, lol.
    Free map releases: [Only registered and activated users can see links. ]


    [Only registered and activated users can see links. ]
    Reply With Quote  
     


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. how to add reward box?
    By Dome in forum Help
    Replies: 1
    Last Post: 07-20-2015, 06:35 PM
  2. [PI] How to make a mystery box give you Donator [PI]
    By ConnerTheCoder in forum Snippets
    Replies: 8
    Last Post: 09-02-2014, 08:05 PM
  3. [PI] How to make a mystery box give you Donator [PI]
    By ConnerTheCoder in forum Tutorials
    Replies: 6
    Last Post: 09-02-2014, 05:02 AM
  4. Replies: 2
    Last Post: 04-12-2010, 01:51 AM
  5. How to add colours in chat box???
    By Xaves in forum Help
    Replies: 8
    Last Post: 09-06-2009, 06:03 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •