Hi, I need help figuring out the script for an actor in my game that gains mana when taking damage.
I need to check for that specific actor (not any actor) being attacked, and then gain mana if they take damage, gaining more if it was a critical hit.
I currently have this on a base troop event:
However, that doesn't seem to work very well, since apparently it can't trigger more than once per actor turn, and I also couldn't figure out how to use result.critical() and result().missed inside a troop event.
I'm using basically all of Yanfly's plugins, which I assume would let me add this functionality directly into the actor's notetags, but I'm not sure how to do that.
I need to check for that specific actor (not any actor) being attacked, and then gain mana if they take damage, gaining more if it was a critical hit.
I currently have this on a base troop event:
var actor = $gameActors.actor(4);if (b = actor) {b.gainMp(1);}However, that doesn't seem to work very well, since apparently it can't trigger more than once per actor turn, and I also couldn't figure out how to use result.critical() and result().missed inside a troop event.
I'm using basically all of Yanfly's plugins, which I assume would let me add this functionality directly into the actor's notetags, but I'm not sure how to do that.