MAKE AN ENEMY THAT DROPS RANDOM LOOT!!!

This is will show you how, step by step

Hey folks! I'm not sure if anyone something similar to this or not, but here goes anyway.

Have you ever wanted to make an enemy drop random items after you beat them WITHOUT;

A. Looking for a script?

B. Requesting a script?

C. Learning to script?

This is how! It's so easy, you wonder why no one thought of this first!

Step 1. Creating an Item Giver(IG) (monster that will be giving the random item).

Go through the standard steps used to make your other enemies. Choose the battler, set the stats, etc. But don't, DO NOT, give it an item. (This will be cover later). make sure to remember the IG's ID

Step 2. The Setup.

Here's where things get interesting. Go to the Monster Group(Troops) tab in the editor, expand the array by one and create a new Troop containing you IG (call it whatever you want). Next, in the Battle Event editor, click the "Trigger" menu. Select where is says "turn" and leave it as is(which is 0 x 0) and set the frequency to "Battle Turn"

Step 3. The System.

Now the easy part. First set up a variable(we'll call it 'treasure') and set it to a random number between 0 and 3. Make four Conditional Branches, one for each number(0-3). The first one you leave blank, you get nothing. The second one is where you'll need to do a bit of light scripting.

Select the Call Script function in your event editor(its the last item on the Page 3) and type in this little code snippet
$data_enemies[enemy id].item_id =

Where it says enemy id, put in the IG's ID and at the right of the equal sign, put in the ID number of the item you want to give(we'll make it '1' for a potion). Repeat this step for the other number branches while changing the item ID's to whatever you choose. Try it out.

And VIOLA! Congratulations, you've just made yourself a monster that gives different items when you beat it.

NOTE: THIS WILL ONLY WORK ONCE PER BATTLE!!! IF YOU HAVE TWO OR MORE OF THE SAME MONSTER IN THE TROOP, YOU WILL ONLY GET TWO OF THE SAME ITEM!!!


The good news is, you can set another monster to give away random items as well. So you can two different monsters give in two different items.

I'll see if I can come up with a way for two of the same monster to give different random items. Unless someone beats me to it.

I have a link to the demo showing how it works. If used, credit would be nice. Any questions feel free to hit me up. Any critiques welcome.

http://www.4shared.com/file/Wc1aBM0H/Random_Item_Drop.html

TTFN

Posts

Pages: 1
rabitZ
amusing tassadar, your taste in companionship grows ever more inexplicable
1296
cool tutorial!
always wondered how to do something of this sort...
In rm2k3 you can make a monster drop a "gift box" item to drop random loot.
kitten2021
Returning from RMVX Death
1093
Would this work mostly the same for VX?
JayjeAthravein
Old-School GAM-MAKster DOUBLE DONATOR SUPREME!
1945
wow thanks for the compliments and folks. i think there might be a way to do this in vx. i'd have to actually fool with it to see.
kitten2021
Returning from RMVX Death
1093
Cool... Please let me know what you come up with. :)
wouldn't be possible to make it change the Treasure variable every turn or such like
JayjeAthravein
Old-School GAM-MAKster DOUBLE DONATOR SUPREME!
1945
@dnz: you can by having the event run once ever turn
then the big red NOTE in the original post is wrong, as it says it will only work once per battle.
Pages: 1