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

Posted some halloween freebies! Grab them while on season :kaopride:
hallow_cat.png
So my birthday was about a week ago! Just forgot to post it. I went to a Golden Corral, and it was soooooo good! :kaojoy: I also got some Animal Crossing in my life! Yay, Animal Crossing!
At this point, "unique and diverse cast of characters" might as well be slang for Every Character is a Human-Sue.
I found an absolutely brilliant lifehack on the internet today.

Screenshot_760.jpg

Forum statistics

Threads
116,143
Messages
1,096,135
Members
151,570
Latest member
grungewitch
Top