# LUCK, and how state/buff/debuff application chance works.

#### Percarus

##### The Normal One
The Luck stat had always been vague- within the editor, it is described as "Affects the chance of things like status ailments occurring." All well and good, it can be assumed then that Luck applies to the application of Buffs, Debuffs, and Status Effects.

Here is my question: is there a definitive formula on how exactly it affects it? How does the probability in a skill's "Effects" tab interact with it?

#### ScorchedGround

##### Blizzards most disappointed fan (More than ever)
First off, I am not sure if luk affects buffs and debuffs. I think they are always 100%.

In rpg_objects there is a function called lukEffectRate which determines how luk changes the probability of inflicting states.

JavaScript:
``````Game_Action.prototype.lukEffectRate = function(target) {
return Math.max(1.0 + (this.subject().luk - target.luk) * 0.001, 0.0);
};``````

Translating this to "RPG Maker language", it would look something like this:

Math.max(1.0 + (a.luk - b.luk) * 0.001, 0.0)

Don't mind the Math.max, it just ensures that the %-Chance does not go below 0%.

1 + (a.luk - b.luk) * 0.001

The result of this formula is the modifyer for the state chance.

As an example:
You have a 40% chance of inflicting burn with a skill
You have 100 Luck
The enemy has 20 Luck.

0.4 * (1 + (100 - 20) * 0.001)
= 0.48
= 0.432

So the chance to ACTUALLY inflict burn is 48% 43.2%.

Last edited:

#### Percarus

##### The Normal One
First off, I am not sure if luk affects buffs and debuffs. I think they are always 100%.

In rpg_objects there is a function called lukEffectRate which determines how luk changes the probability of inflicting states.

JavaScript:
``````Game_Action.prototype.lukEffectRate = function(target) {
return Math.max(1.0 + (this.subject().luk - target.luk) * 0.001, 0.0);
};``````

Translating this to "RPG Maker language", it would look something like this:

Math.max(1.0 + (a.luk - b.luk) * 0.001, 0.0)

Don't mind the Math.max, it just ensures that the %-Chance does not go below 0%.

1 + (a.luk - b.luk) * 0.001

The result of this formula is the modifyer for the state chance.

As an example:
You have a 40% chance of inflicting burn with a skill
You have 100 Luck
The enemy has 20 Luck.

0.4 * 1 + (100 - 20) * 0.001
= 0.48

So the chance to ACTUALLY inflict burn is 48%.
This is amazing- really cleared up a lot of things. Thanks so much!

#### Wavelength

##### MSD Strong
First off, I am not sure if luk affects buffs and debuffs. I think they are always 100%.

In rpg_objects there is a function called lukEffectRate which determines how luk changes the probability of inflicting states.

JavaScript:
``````Game_Action.prototype.lukEffectRate = function(target) {
return Math.max(1.0 + (this.subject().luk - target.luk) * 0.001, 0.0);
};``````

Translating this to "RPG Maker language", it would look something like this:

Math.max(1.0 + (a.luk - b.luk) * 0.001, 0.0)

Don't mind the Math.max, it just ensures that the %-Chance does not go below 0%.

1 + (a.luk - b.luk) * 0.001

The result of this formula is the modifyer for the state chance.

As an example:
You have a 40% chance of inflicting burn with a skill
You have 100 Luck
The enemy has 20 Luck.

0.4 * 1 + (100 - 20) * 0.001
= 0.48

So the chance to ACTUALLY inflict burn is 48%.
Nicely presented, but not quite accurate. What you missed is that the lukEffectRate is a multiplier for the base chance - it is not added to the base chance. You can see this in the methods itemEffectAddAttackState and itemEffectAddNormalState (they may have different names in MV; I am looking at the MZ code but I am certain the mathematical mechanics are similar between MV and MZ).

In other words, if the skill normally has a 40% chance to inflict burn, the modified chance will be 40% * (1 + ((100 - 20) * 0.001)) = 40% * 1.08 = 43.2% chance to inflict burn. As you can see, the effect of LUK is very minimal, which is why you'd want to either use it on other places (eventing, skill formulas) or just leave it out of your game entirely.

Also, lukEffectRate is not applied on any skill designated as a "Certain Hit" skill (which makes sense, as you wouldn't want it to affect, for example, a healing state given to an ally).

It looks like itemEffectAddDebuff is affected by lukEffectRate too, meaning that Debuffs (but not buffs) are affected by LUK of the user and opponent target.

#### Percarus

##### The Normal One
Nicely presented, but not quite accurate. What you missed is that the lukEffectRate is a multiplier for the base chance - it is not added to the base chance. You can see this in the methods itemEffectAddAttackState and itemEffectAddNormalState (they may have different names in MV; I am looking at the MZ code but I am certain the mathematical mechanics are similar between MV and MZ).

In other words, if the skill normally has a 40% chance to inflict burn, the modified chance will be 40% * (1 + ((100 - 20) * 0.001)) = 40% * 1.08 = 43.2% chance to inflict burn. As you can see, the effect of LUK is very minimal, which is why you'd want to either use it on other places (eventing, skill formulas) or just leave it out of your game entirely.

Also, lukEffectRate is not applied on any skill designated as a "Certain Hit" skill (which makes sense, as you wouldn't want it to affect, for example, a healing state given to an ally).

It looks like itemEffectAddDebuff is affected by lukEffectRate too, meaning that Debuffs (but not buffs) are affected by LUK of the user and opponent target.
Ohhh I see. Thanks for the clarification! Is there a way to modify this lukEffectRate to make it more impactful status effects-wise?

#### ScorchedGround

##### Blizzards most disappointed fan (More than ever)
What you missed is that the lukEffectRate is a multiplier for the base chance - it is not added to the base chance

Ah, yes. I did miss that. I even had that in my formula, but for some reason I added it instead of multiplied it. Edit: No I did not add it, instead I forgot to put another () in the right place. I just punched the formula into a calculator and got a wrong result.

It should have been
0.4 * (1 + (100 - 20) * 0.001)
not
0.4 * 1 + (100 - 20) * 0.001

I was wondering why the increase was 8% considering luck was never that impactful to begin with.
I corrected my first post.

Last edited:

#### Tiamat-86

##### old jrpg gamer
Ohhh I see. Thanks for the clarification! Is there a way to modify this lukEffectRate to make it more impactful status effects-wise?
some plugins can allow you to change the formula used. would also be able to change the formula in the rpg_objects base code but im no good with that stuff, so i just use yanfly's baseparam control plugin to change it from the plugin parameters.
(i changed "luck effect" so it just says "1" making luck have no effect at all on state rates so i could rename luck and use it however i wanted without it effecting anything else and state rates became just flat database apply/resist rates.)

#### Percarus

##### The Normal One
some plugins can allow you to change the formula used. would also be able to change the formula in the rpg_objects base code but im no good with that stuff, so i just use yanfly's baseparam control plugin to change it from the plugin parameters.
(i changed "luck effect" so it just says "1" making luck have no effect at all on state rates so i could rename luck and use it however i wanted without it effecting anything else and state rates became just flat database apply/resist rates.)
Thank you for your responses friend, I appreciate it a lot
I'll make sure to take note of that.

#### bgillisp

##### Global Moderators
It would take a plugin to change it. I actually changed it in my last game to be (this is not in Javascript code, just psuedocode, FYI):

* 1.014^(your luck - enemy luck).

The ^ is raise to power. The result was that a difference of 50 LUK now returned about 2, which meant your chance had doubled.

#### Wavelength

##### MSD Strong
Ohhh I see. Thanks for the clarification! Is there a way to modify this lukEffectRate to make it more impactful status effects-wise?
You would need to either do it with a mini-plugin of your own, someone else's plugin, or by making a small change to the code in your project's js folder (I think you're looking for rpg_objects.js). Making that small code change is actually really easy - for example you could make Luck's effect on status application ten times as impactful by replacing 0.001 with 0.01 in the method that @ScorchedGround pasted earlier, and that's all you need to do. However, it is usually advised to use a plugin instead because if you update the core scripts, your changes may be reverted, and it can be a little wonky if other plugins that you use are also modifying the same method.

#### Percarus

##### The Normal One
Thanks so much for the replies, my curiosities have been satisfied and confusions have been erased

### Latest Profile Posts

Sneak peak of my upcoming update! Who's holding her, you may ask? Find out tonight!
Finished another GUI! Turn indicator wasn't made by me.

Added a small refining scene to my game.

It makes sense that you try to focus on the squishy mages at the back of the party first, right? If the mage can out-DPS the enemy DPS before the latter can kill the tank in front, the fight becomes boring.