Not luck persay, but there is sort of a random factor in combat. Being cursed for example will cripple your ability to hit anything. So having a weapon/artifact that has an opposite effect wouldn't be so out of place.
This wouldn't really feel like luck though, rather lack of skill. Luck is what was described in the first post but in that case it was actually luck.
So if luck was to be featured in the game, it'd have to be the same as it exists in other games like critical hits and stuff like that. DF seems to have plenty of that already, we've all seen situations where an unarmed and apparently helpless creature manages to one-hit a dwarf.
"Luck" would enter into the die-roll part of a skill check. Internally, computers use a uniform distribution from 0 to 1 for random numbers (so it could be 0.006 or 0.8711247 or 0.9987163 or whatever) and the programmer manipulates that into the range of random numbers actually desired.
So, suppose the chance to hit was something exceedingly simple like:
if attacker_skill + weapon_quality - defender_skill - armor_quality - shield_bonus + random_number() > 0 then
hit
else
miss
end ifAn easy way to incorporate "luck" would be to change the random_number() function to something that is still 0-to-1 but can be skewed high or low. The beta distribution has that property, and a beta with the right parameters can even recreate a uniform random number.
The cost is that evaluating a beta is necessarily slower (under the hood, it still uses a uniform random number then transforms it), and DF seems to involve a
lot of random numbers. Fortunately, the current bottleneck in DF performance seems to be memory bandwidth rather than processor speed, so this might not make a big difference.