(Little Add-on) Lucky Bags Script Request

Started by Rolandojis, February 18, 2012, 05:28:42 pm

Previous topic - Next topic

Rolandojis

I don't know if this already exists but I looked for it and couldn't find it.
I want a script that lets me put items like lucky bags, that when you open them you get a ramdom item from a set of items that are already defined
I want it the script to be able to put diferent probability rates for each item you can get from the "lucky bag" item

Example of what Im looking for:
Rainbow Axeman Bag
When opening it:
50%chance of getting blue axe
15%chance of getting red axe
10%chance of getting yellow axe
7%chance of getting orange axe
5%chance of getting purple axe
5%chance of getting green axe
5%chance of getting pink axe
3%chance of getting rainbow axe

KK20

Is there any reason why you need this as a script? You do know you can just use eventing to do this, calling a Common Event when the item bag is used.

Set a variable to a random number 1-100, then use a series of conditional branches. Granted, scripting it would probably be faster and easier on the eyes to set up.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Rolandojis

Yeah it could be with events but that would be a hell lot of time making 100 conditional branches, plus I wouldnt be able to put item probabilities with decimals

ForeverZer0

It only takes as many branches as possible items. You will still need to create the branches if its a script, the only difference is it will be typed out in code instead of on an event page.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Lanzer

February 19, 2012, 05:56:44 pm #4 Last Edit: February 19, 2012, 06:00:47 pm by Lanzer
Yeah they are right it can be done by common events plus I use it for "Epic loot" for dungeons.
and for the other enemies already exist a script to do that , i think it was in blizz tons of addons
Yep the multi_drop script is in blizz tons opf addons.





Zexion

February 19, 2012, 09:19:41 pm #6 Last Edit: February 19, 2012, 09:21:23 pm by Zexion
Also if u want to use less than 100 conditional branches just use 5, 10, 20, 50.
Depending on the amount of items. For example you could do 5 if u have 2 items 10 if u have like 5 items, 20 if you have around 10 items.
It would still be the same as 100 because of the odds

1 of 5 is = 20% of 100
1 of 10 is = 10% of 100
1 of 20 is = 5% of 100
etc.

It helps reduce the amount of conditions , just sayin :p