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

Need more resources!
Veteran
Joined
Jul 31, 2012
Messages
492
Reaction score
276
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
13,956
Reaction score
14,802
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,682
Reaction score
3,006
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

You look like you had a rough day...Here, have a Baby Panda!

A certain person better sell his stock while he still can, because it looks like it's going to take an unrecoverable nose dive.
7 years of trying to plan this project... and it got an official plotline today. 7 years. I really just have no concept of order huh GHJGSJHGVGHASFH.
Doing RPG Maker News for 24th October 2021

I'm not sure how to do this so I'll just ask here, Wheres a good place to post your game (for free) once its done?

Forum statistics

Threads
116,064
Messages
1,095,456
Members
151,429
Latest member
Happyface3864
Top