I'm attempting to make an aura that regenerates MP equal to 5 + 1/4 of the caster's level per turn to all party members. I can wrap my head around how to do this in the game, I just don't know the syntax I'd need to get it done
MV Mp regeneration.
JS Plugin Requestsit even shows an example with a.level
oh wait needed mp but only seeing hp regen/degen
this is probably still a buff/state core thing with custom regeneration effect.
im no good with code either.
dissecting part of code from state ive had help with i 'think' most of it will be
<Custom Regenerate Effect>
var heal = Math.floor(origin.level * 0.25 + 5);
target.gainMp(heal);
target.startDamagePopup();
target.clearResult();
</Custom Regenerate Effect>
(i 'think' the state tags here use origin. instead of user. ?
states people helped me with all use target.stats so im not sure)
the underlines are the only parts i changed from the dissected code.
sorry. hope at least helps get on track.
edit2: tested and it "mostly" works as intended.
when used as a skill that just gives the mp refresh state to all allies if gives them 1/4 caster's level +5.
(changing it to user. instead of origin. seems to change it to target's 1/4 level)
but when used this as aura state that applies ally aura mp refresh it seems to ONLY use the target's level. didnt matter if it was origin. or user. in the formula
(just the fact that i got it to half work is proof that i am slowly getting better at this... very slowly)
buff/state core
aura effects
With regular states with Yanfly's Buffs & States, origin points to the battler that created the state via a skill. user and target both refer to the battler that the state is on (except for inside the tags that respond to the various damage steps).
With passive states (including auras), there is no origin. So if you really wanted to have the aura effect reference something from the original actor, you'd have to code a loop through the party looking for the aura, or have it set a variable that the child states reference or something. (look at the Aura of Sacrifice Tip & Trick for an example of how to do this)
Original thread: https://forums.rpgmakerweb.com/threads/mp-regeneration.143195/