MV Skill with random Effect & Animation

Hey!

I'd like to create a skill with three diffferent effects, elements and animations from which it randomly choses one. So basically all the skill has to do is triggering one of three other premade skills. It's a bit like Metronome from Pokémon, but with only three possible outcomes.

Example:

I use Metronome on a single target. It gets either hit by:
Fire Ball, element fire, may inflict burn
Ice Beam, element ice, may inflict freeze
Light Ray, element light, may inflict blindness
Each one has a 33% chance.

I use a few skill related plugins including Yanflys Skill Core, Weapon Unleash and the Action Sequence Packs, as well as Irinas Extension to them. I'm also aware that SumRndmDde made a Metronome-Plugin, but I would rather not add new Plugins to my project at this points.

I am pretty unexperienced when it comes to JS, so I first tried to pull this off without coding, but the only idea I had was the following: Metronome inflicts a state on the user, which via Weapon Unleash changes the Basic Attack to one of these three skills with 33% chance. Than there is a condition in every troop event which triggers, when the actor has this state and forces them to use basic attack on the last target. However this seems rather clunky to me and I did not try it yet, so any other ideas are welcome!

Thanks in advance!
Strictly speaking, you dont need a plugin to do it. it can be done with a common event, but i think you'd need to use a script call to both make the initial skill select a target, get the correct user for the resultant skill, and make them target the same target as the first.

you can use action sequences and the element core together to have it be a single skill. you'd make a sequence that chooses a random number and then play a corresponding animation, force a corresponding element and inflict a corresponding state using the action sequence commands. It wouldnt need any script to pull off

normally id suggest the following method with the skill core, but its a bit rougher visually since the actor visibly executes 2 skills (funny enough, more faithful to how metronome appears ingame).
the suggestion would have been using a tiny bit of JS inside an <After Eval> notetag to generate a random number and use BattleManager.queueForceAction() to force the user to execute the corresponding skill, but as i think about it, you might be able do that inside the setup action of the base skill and have it fire off the random skill the same way as an action sequence to make it look like a single skill. youd have to test it to make sure it works as intended, but it'd look like this

Code:
<setup>
eval: $gameVariables.setValue(x, y + Math.randomInt(3))
eval: BattleManager.queueForceAction(user, $gameVariables.value(x), target)
</setup>
First, youd make sure that your resultant skills are consecutive in the database. then you'd replace the x's with the id of some variable and youd replace the y with the id of the first resultant skill. it should fire off one of them at random at the same target.
Wow, that was fast! I will try as soon as possible 😀

Original thread: https://forums.rpgmakerweb.com/threads/skill-with-random-effect-animation.172672/