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
484
Reaction score
264
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,935
Reaction score
14,767
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 Profile Posts

Zombie status is now complete. I didn't have to do much in the way of changing how healing is applied to undead targets, was just a simple 3 line code. I thought I had to overhaul Game_Action lol. Everything else was doable by events. So.. Zombie: You turn undead. Your element changes to darkness. You're weak to light, you're strong to physical attacks and healing hurts you and revival items will kill you.
My Overworld might be a mix of inspiration from 2D Final Fantasy games, Breath of Fire, Battlechasers: Nightwar, Super Mario World, and Pillars of Eternity. If I can make it more in-depth than just walking from point A to point B, that might do a lot for the gameplay experience. Hmm...
Terribly depressed. Worst birthday I've had in years, no motivation to work on anything. Still no income. At least I've got my computer running again.
Doing RPG Maker News for 19th September 2021

Forum statistics

Threads
115,214
Messages
1,088,107
Members
149,796
Latest member
saraj176
Top