The RPG Maker reference manual contains the following note:
The change in states and debuff effectiveness due to luck is as shown below. Note, however, that 0 is the lower limit.
Chance (%) = 100 + (user's luck - target's luck) ÷ 10
I would like to know how I can change this formula. I want to retain LUK's purpose of altering the chance of states working / not working, but I just want to alter the formula a bit.
I *think* you can do this by altering the formula in the script editor.
Try
(1.0 + user.luk * 0.01, 0.0).maxIt's probably unnecessary to leave the minimum of 0 in there with no subtraction, but I prefer to leave safeguards in place unless given a good reason to remove them.
My ruby isn't great yet, but I'll do my best to break the original formula down for you, in case you want to make more changes.
1.0 is the base chance of 100%. The chance entered in the database will effectively modify this value.
user.luk is the luck of the character who is using the skill, weapon, or whatever.
luk is the luck of the creature being targeted. The defender.
0.001 divides the luck by 1000, so that each luck point gives a one-tenth of one percent change to the overall success rate.
, 0.0).max specifies a minimum of 0. If the first option before the comma (the formula) is less than the second option after the comma (the 0.0), the game will use the 0.0 instead, as it is higher (the maximim value). This stops the game from ending up with a negative value where it could lead to an error.
Unless I'm missing something, which I may be. Like I said, I'm fairly new to ruby.
Aye, * means multiply, as you should be able to confirm in the default damage formulas. It's how I learned it.
No problem. And certainly, just put the subtraction from the original version back in, like so:
(0.0 + (user.luk - luk) * 0.01, 0.0).maxEdit: However, this will not allow a target with very high luck to reduce the success rate below the database default. To do that, you'd need to remove the safeguard on the formula and modify the calls again instead, to make sure it can't drop anything below zero.