Skills that have a chance on hit to apply states to the user

GolvaeGames

Veteran
Veteran
Joined
Dec 15, 2014
Messages
140
Reaction score
85
First Language
English
Primarily Uses
RMMV
I have been trying to find a way to adds this through notetags with yanfly's plugins. It would be like what the skill reward plugin does, but only a chance of adding the state. Skill procs/chance on hit seems like something that someone would have done before but I cant find anything
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,862
Reaction score
2,198
First Language
EN
Primarily Uses
RMMZ
Not sure if what you're seeking is offered as a core feature in any of Yanfly's plugins, but to implement a random chance with scripting, this is a typical approach:
Code:
if (Math.random() < 0.8) {
  // 80% chance to do this
}
This sort of thing can be used in any script context, including Yanfly's "Lunatic Mode" notetags. :)

Then you can do something like this, assuming the context supports a "user" variable:
Code:
user.addState(42);
Replace 42 with the ID of the state you want to add.

Note that you can also achieve all of this in the damage formula~

(Math.random returns a random number in the range [0, 1).)
 

GolvaeGames

Veteran
Veteran
Joined
Dec 15, 2014
Messages
140
Reaction score
85
First Language
English
Primarily Uses
RMMV
yes I have it working now thank you very much :biggrin:

although now Im having issues with the state itself I might have to make a new thread
 

Latest Threads

Latest Profile Posts

I'm gonna put my project on pause for a tiny bit so I can explore the engine outside of it... Winging it can only get you so far LMFAO
Have seen some of my favorite people here posting and helping others with questions today -- love to see it!
Haven't been on here actively in awhile, project is going strong my biggest issue is the STORY, i'm refining the plot and learning so much i decided to take a writers class to improve even more but the programming and functionality of the game is stepping up nicely!
Hi everyone! Here's what I'm working on today! It's one of the dorms on campus. I know I said I wouldn't use assets but I reused a few things from the cafeteria hehe.
FCuxBOMXMAICK5e
I added a little squish effect when characters change direction to try and make things a bit more lively. Though it's a bit hard to see on the fast moving guys.
2f4fiuy.gif

Forum statistics

Threads
116,125
Messages
1,095,972
Members
151,537
Latest member
Anrirck
Top