I'm trying to make a skill that gives you a specific item based on which enemy you use it against. To specify, you use the skill against different colored slime enemies and get slime of that color back. I have most the process figured out, but how do you get the ID of an enemy?
Once I get that, I'm going to set up a case statement that you give the enemy ID to and it returns the item ID to give to the player (this part works I know how to do that)
but if anyone has other ideas for how to pull this off, let me know.
I think I've found a way to do it...create a common event for each type of colored slime you want...like "red slime....blue slime...etc" then make the desired skill call this comon event...
Let's say: double slash causes blue slime to drop...so you put the "blue slime" common event in the double slash skill...
you want "super strike" to drop red slime...so you put the "red slime" common event on the "super strike" skill...and so on
on each of the comon events you create a conditional branch...if "slime drop" is on then drop "blue slime"....(the color is respective to the color you want to drop obviously)
Now create a switch called "slime drop"...and turn it on at the start of battle (on the troops menu)...put it at the start of every battle with a monster that will drop blue slime...at the start of every battle the event "slime drop" will be activated and when you use "double slash" you will get a blue slime...(just be sure to turn off the "slime drop" event at the end of battle otherwise this will happen in every battle)
The problem with this of course is that you can't have multicolored slimes in the same battle...unless you want the slimes drops to be only skill specific and not monster specific
Perhaps you could use this as a basis for what you want to do. As far as I can see, one of your problems is knowing which enemies are in the troop.
To find members of a troop which are of a particular type (slime/imp/whatever), with id being the number of the slot in the enemies tab with that particular enemy.
In this example, I am searching for enemies with the enemy id 1
$game_troop.members.select { |enemy| enemy.enemy_id == 1 }