I'm having some trouble trying to create a skill that Damges HP but also has a small percent chance to Drain MP -- I've looked at calling a state to do it and a common event, but can't quite figure out how to get it done with those. Any ideas?
Thanks.
(sorry, I bet this has already been addressed somewhere in the forums but I can't seem to find it)
when you say drain mp do you mean drain it from the enemy to you, heal a portion of the damage done as mp, instead of dealing hp damage deal mp damage and drain?
use this in your damage formula
x = [y, b.mp].min;(b.mp -= x;a.mp += x) if rand(100) <= z;damage formula here
breakdown:
x, leave it alone
y, the amount of mp you want to drain
z, the % chance to drain mp - 1
damage formula here, your damage formula goes here.
example:
x = [10, b.mp].min; (b.mp -= x;a.mp += x) if rand(100) <= 9; 4 * a.mat - 2.b.mdf
this would have a 10% chance to drain 10 mp(or the remaining mp if the enemy has less than 10 left) from the enemy and restores it to the user of the skill
edit: havent tested this because i need to go out real soon so if it doesnt work reply and i'll get back to you.
what doesnt work about it?
it doesn't drain MP from the enemy (I tried it at 99%)
this is what i used:
x = [10, b.mp].min; (b.mp -= x;a.mp += x) if rand(100) <= 99; 4 * a.mat - 2.b.mdf
do your enemies have mp
Edit: also i noticed i made a mistake in the example formula
it would be 4 * a.mat - 2 * b.mdf for the last section of the formula
Yes they do ( already made that mistake once before )
Ok sorry, I see what's happeing now!.
It is working! but it's not displaying the drain pop up (yanfly battle engine) that I've gotten use to seeing.