Help with HP Damage and Chance to Drain MP Skill

djm3

Villager
Member
Joined
Sep 16, 2013
Messages
22
Reaction score
0
First Language
English
Primarily Uses
I'm having some trouble trying to create a skill that Damges HP but also has a small percent chance to Drain MP -- I've looked at calling a state to do it and a common event, but can't quite figure out how to get it done with those. Any ideas?

Thanks.

(sorry, I bet this has already been addressed somewhere in the forums but I can't seem to find it)
 

Xypher

Veteran
Veteran
Joined
Apr 1, 2012
Messages
148
Reaction score
26
Primarily Uses
when you say drain mp do you mean drain it from the enemy to you, heal a portion of the damage done as mp, instead of dealing hp damage deal mp damage and drain?
 

djm3

Villager
Member
Joined
Sep 16, 2013
Messages
22
Reaction score
0
First Language
English
Primarily Uses
Sorry for the double post but I think found something that works for me:

I used Tsukihime's script Effect: State Action (it requires the Effects Manager script to work):

"This script allows you to force an action with your skill, depending on whether the enemy has a specific state applied or not."

First I applied an Add State (set it to x%) to my Damage HP skill and when that state is applied the script will force another skill which is the Drain MP skill.
 

djm3

Villager
Member
Joined
Sep 16, 2013
Messages
22
Reaction score
0
First Language
English
Primarily Uses
when you say drain mp do you mean drain it from the enemy to you, heal a portion of the damage done as mp, instead of dealing hp damage deal mp damage and drain?
I would like to Damage the enemy's HP and have a % chance to Drain the enemy's MP to the player who delt the HP damage.

...I think that makes sense :dizzy:
 

Xypher

Veteran
Veteran
Joined
Apr 1, 2012
Messages
148
Reaction score
26
Primarily Uses
use this in your damage formula

x = [y, b.mp].min;(b.mp -= x;a.mp += x) if rand(100) <= z;damage formula here

breakdown:

x, leave it alone

y, the amount of mp you want to drain

z, the % chance to drain mp - 1

damage formula here, your damage formula goes here.

example:

x = [10, b.mp].min; (b.mp -= x;a.mp += x) if rand(100) <= 9; 4 * a.mat - 2.b.mdf

this would have a 10% chance to drain 10 mp(or the remaining mp if the enemy has less than 10 left) from the enemy and restores it to the user of the skill

edit: havent tested this because i need to go out real soon so if it doesnt work reply and i'll get back to you.
 
Last edited by a moderator:

djm3

Villager
Member
Joined
Sep 16, 2013
Messages
22
Reaction score
0
First Language
English
Primarily Uses
use this in your damage formula

x = [y, b.mp].min;(b.mp -= x;a.mp += x) if rand(100) <= z;damage formula here

breakdown:

x, leave it alone

y, the amount of mp you want to drain

z, the % chance to drain mp - 1

damage formula here, your damage formula goes here.

example:

x = [10, b.mp].min; (b.mp -= x;a.mp += x) if rand(100) <= 9; 4 * a.mat - 2.b.mdf

this would have a 10% chance to drain 10 mp(or the remaining mp if the enemy has less than 10 left) from the enemy and restores it to the user of the skill

edit: havent tested this because i need to go out real soon so if it doesnt work reply and i'll get back to you.
Well, it doesn't seem to be working, but I do like the idea of having it in a formula rather than the script -- no rush if you're going out. Thanks for the help Xypher.
 

djm3

Villager
Member
Joined
Sep 16, 2013
Messages
22
Reaction score
0
First Language
English
Primarily Uses
it doesn't drain MP from the enemy (I tried it at 99%)

this is what i used:

x = [10, b.mp].min; (b.mp -= x;a.mp += x) if rand(100) <= 99; 4 * a.mat - 2.b.mdf
 

Xypher

Veteran
Veteran
Joined
Apr 1, 2012
Messages
148
Reaction score
26
Primarily Uses
do your enemies have mp

Edit: also i noticed i made a mistake in the example formula

it would be 4 * a.mat - 2 * b.mdf for the last section of the formula
 
Last edited by a moderator:

djm3

Villager
Member
Joined
Sep 16, 2013
Messages
22
Reaction score
0
First Language
English
Primarily Uses
Yes they do ( already made that mistake once before )
 

djm3

Villager
Member
Joined
Sep 16, 2013
Messages
22
Reaction score
0
First Language
English
Primarily Uses
Ok sorry, I see what's happeing now!.

It is working! but it's not displaying the drain pop up (yanfly battle engine) that I've gotten use to seeing.
 
Last edited by a moderator:

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,592
First Language
Dutch
Primarily Uses
RMMV
djm3, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,074
Members
137,578
Latest member
JamesLightning
Top