A skill that has a chance to self inflict status

Ticektvenn

Villager
Member
Joined
Apr 1, 2022
Messages
5
Reaction score
2
First Language
English
Primarily Uses
RMMV
I wanted to make a skill that damages the opponent. and then has a chance to give the user a status effect. How do you do that?
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,576
Reaction score
11,044
First Language
English
Primarily Uses
RMMV
It is possible to do this in the damage formula. However, if your game ever uses the autobattle Trait or if this skill can go on an enemy, you shouldn't do it that way. For information on that, see:

The better way to implement this is with Yanfly's Skill Core. Give the skill the notetag:
Code:
<Post-Damage Eval>
if (Math.random()<.83)
    user.addState(X);
</Post-Damage Eval>

where X is the ID of your state (no leading zeros), and you supply whatever number you want on the line above. So this one has an 83% chance.
 

Ticektvenn

Villager
Member
Joined
Apr 1, 2022
Messages
5
Reaction score
2
First Language
English
Primarily Uses
RMMV
It is possible to do this in the damage formula. However, if your game ever uses the autobattle Trait or if this skill can go on an enemy, you shouldn't do it that way. For information on that, see:

The better way to implement this is with Yanfly's Skill Core. Give the skill the notetag:
Code:
<Post-Damage Eval>
if (Math.random()<.83)
    user.addState(X);
</Post-Damage Eval>

where X is the ID of your state (no leading zeros), and you supply whatever number you want on the line above. So this one has an 83% chance.
Thank you. I just tested it and it worked. Literally was looking at your posts for advice before you messaged me.
 

Latest Threads

Latest Profile Posts

In twitter, square phoenix had successfully prompted chatgpt to make the mini game watermelon pangpang.

drew some stuff to see how frontview might look. not entirely sold on or off of it yet. "could" work, but something feels missing.
Shower Thoughts: ". . . Scammers would be OP in the Elder Scrolls. They could just get speech 100 and blatantly ask everyone for all of their money, and everyone would think it's a great investment. And then after being robbed blind, they'd say, with a smile on their face, 'need something?' "
Day #2 for advent is compiled. Please, go to their threads to share love! But, if you wanna talk to me…what’s your favorite Christmas carol or holiday song?

Forum statistics

Threads
136,694
Messages
1,268,829
Members
180,406
Latest member
General_Melt
Top