Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: Rolandojis on February 18, 2012, 05:28:42 pm

Title: (Little Add-on) Lucky Bags Script Request
Post by: Rolandojis on February 18, 2012, 05:28:42 pm
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
Title: Re: (Little Add-on) Lucky Bags Script Request
Post by: KK20 on February 18, 2012, 05:32:29 pm
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.
Title: Re: (Little Add-on) Lucky Bags Script Request
Post by: Rolandojis on February 18, 2012, 11:17:40 pm
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
Title: Re: (Little Add-on) Lucky Bags Script Request
Post by: ForeverZer0 on February 19, 2012, 02:05:49 am
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.
Title: Re: (Little Add-on) Lucky Bags Script Request
Post by: Lanzer on February 19, 2012, 05:56:44 pm
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.
Title: Re: (Little Add-on) Lucky Bags Script Request
Post by: Rolandojis on February 19, 2012, 07:43:23 pm
Kay thnx :)
Title: Re: (Little Add-on) Lucky Bags Script Request
Post by: Zexion on February 19, 2012, 09:19:41 pm
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