JRand

Veteran
Veteran
Joined
Sep 15, 2018
Messages
61
Reaction score
4
First Language
English
Primarily Uses
RMMV
I'm using Yanfly's Skill Core plugin to do % and flat number costs on skills. However, I have some skills that need to apply to or target the enemy that cost MP or TP that I also want to restore MP or TP to the player.

The plugin doesn't appear to be able to do this, so I assume a formula is necessary.

How do I set this up, if anyone doesn't mind helping me?

(Hopefully this isn't the wrong area for this question.)

Thank you!
 

Animebryan

And like a Phoenix, I raise from my ashes!
Veteran
Joined
Jul 31, 2012
Messages
542
Reaction score
347
First Language
English
Primarily Uses
RMMZ
Setting up a magic drain skill is easy:
Magic Drain Skill.png

Just change the MP/TP costs to what you want & change the damage formula number to the amount you want.

As for draining TP, that's the hard part. It can't be done by default but it might be possible through the damage formula. I've actually got a topic ongoing right now to make a TP draining skill that doesn't take more than what the target actually has.
https://forums.rpgmakerweb.com/index.php?threads/need-help-with-an-error.109328/
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
14,316
Reaction score
15,461
First Language
English
Primarily Uses
RMVXA
MP drain is part of the default code. Now if you want it to do damage and MP drain, that's tougher. I did it by adding the MP drain as a feature instead.

TP drain though will probably require JavaScript code to do. I'll move this to JavaScript Support for that.
 

JRand

Veteran
Veteran
Joined
Sep 15, 2018
Messages
61
Reaction score
4
First Language
English
Primarily Uses
RMMV
Thank you for replying, @Animebryan and @bgillisp!

I think TP Gain serves the purpose I was looking for.

The skills aren't necessarily meant to drain MP or TP from the enemy, but simply to replenish the user's MP or TP when they use the skill while subtracting another resource from the user of the skill, as I described above (which I do via notetags and a plugin).

However, if a simple gain of MP is not possible, I may have to use MP Drain.
 

JRand

Veteran
Veteran
Joined
Sep 15, 2018
Messages
61
Reaction score
4
First Language
English
Primarily Uses
RMMV
So, is MP Drain the only solution?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,693
Reaction score
3,027
First Language
Tagalog
Primarily Uses
RMVXA
You can add these code in the damage formula, before the actual damage to recover MP/TP to the caster

Code:
a.gainTp(value)
a.gainMp(value)

//so like
a.gainTp(100);a.atk*4-b.def*2
//this will recover the user's TP by 100 and deal damage to the enemy
 

Latest Threads

Latest Posts

Latest Profile Posts

If you are not part of the solution, you are insoluble sediment.
ScreenShot_9_28_2022_4_34_59.png
New enemy... Off Model Kevin. A drawing that's mad they the artist consistently drew them off model with no frame of reference in mind.
Would anyone be interested in me putting devlogs on my Itch?
Join Kytt and I for The Wifestream at 7pm (10 minutes from now) where Kytt will be trying out The Secret of Monkey Island for the first time! We'd love to have you with us for banter and shenanigans! Twitch

Forum statistics

Threads
125,639
Messages
1,172,470
Members
164,754
Latest member
Pancakecomputer
Top