And I've been counting -- this is the tenth "Morrowind-style" mod I've released! :celebration:
http://tesnexus.com/downloads/file.php?id=31120
This is the first version that works flawlessly and just like it's supposed to. Even though I didn't experience any effect on FPS, I'll try to optimize the script for the next version, but maybe that's not possible. At least for me, this script was annoying enough as it is.
Readme:
Attack Failure Chance v2.0
=============================
by Fearabbit
requires OBSE 0017 or higher.
Installation:
Extract archive to Oblivion/Data folder and active the plugin.
Description:
This mod introduces a Morrowind-style Chance-to-hit calculation when you attack someone to Oblivion. It is based on the assumption that you don't always deal the same amount of damage when you hit someone repeatedly; if you are not skilled with your weapon, you might fully hit your opponent maybe one out of ten times, the other times you might not put enough strength into the blow, or you hit an area where he's better protected, or something like that. Hence, we need a system to represent these inaccuracies of yours!
This is what this mod does by calculating whether your attack fails, or succeeds.
Now, Morrowind's Chance-to-hit calculation had one severe flaw: If you failed in hitting your opponent with all your force, then you *didn't* hit him at all. Your sword would go right through his body, which was pretty ridiculous and is to this day the number one flaw any Morrowind player will mention about the game.
This doesn't happen in this mod. Even when the calculation says that you failed to hit your opponent with all your force, you will still hurt him a little bit. The Chance-to-hit calculation also takes this into account, which means that if you, say, wrote down how much damage your last 100 attacks made, and then created an average, this average will be exactly like the damage you do in Oblivion with one hit.
(Well, apart from the fact that your Agility and your Luck have a bit of an influence in the calculation - see below.)
Inner workings:
Your Chance to hit your opponent is calculated for every strike you make. The formula is:
ChanceToHit = WeaponSkill + ( Agility - 50 ) * 0,25 + ( Luck - 50 ) * 0,125
The mod takes a random number between 0 and 100 and compares it to that value. If it is lower, you succeed, if it is higher, you fail.
If you succeed, your Weapon skill (HandToHand, Blade, Blunt or Marksman) is increased to 100. If you fail, it is decreased to 0. That means that your damage will be calculated as if you had either a skill of 100, or a skill of 0. The remaining three skills will be increased or decreased by the same value for the sake of simplicity in the script; it won't have any side-effects.
The calculation only applies if you are NOT sneak attacking - if you are sneaking and undetected, your damage will be the same as in vanilla Oblivion. There are two reasons for this: First, if you're undetected it's more likely that you take your time to look where to hit your opponent hardest. It wouldn't make much sense to fail in such a situation. Second, the successful sneak attack is already represented by the sneak attack multiplier.
The skills will revert to their normal value if you don't keep attacking.
Every time a random number is calculated, the script will print a message to the console that tells you what your chance to hit was, and the value of the random number. That way you can check if a strike was successful or not. However, the script does not make the calculation only once for each strike - it will make a calculation every .3 seconds that you hold your attack button. The last message will usually show the final calculation.
You can also simply check if your skills are increased or decreased.
If your skill is bigger than 100, the calculation will not be done. This is because you'll succeed anyway, and because the script would always decrease your skill to 100 before every strike, which doesn't make a lot of sense.
Also, this way it's compatible with Elys Uncapper.
Credits:
Thanks to all those people who helped me getting the last flaws out of my script, especially Low Post, TheNiceOne and showler.
Thanks to the authors of all those excellent entries in the CS Wiki.
Thanks to the OBSE team.
Without all of you, I wouldn't have been able to finish this.
Changelog:
v2.0 - Instead of simply raising/lowering the skills by 100, the script now calculates the difference to 100 or 0 and modifies them by that value. This means the mod should now be fully compatible with mods like Elys Uncapper. Additionally, the script has been improved greatly in other aspects as well.
=============================
by Fearabbit
requires OBSE 0017 or higher.
Installation:
Extract archive to Oblivion/Data folder and active the plugin.
Description:
This mod introduces a Morrowind-style Chance-to-hit calculation when you attack someone to Oblivion. It is based on the assumption that you don't always deal the same amount of damage when you hit someone repeatedly; if you are not skilled with your weapon, you might fully hit your opponent maybe one out of ten times, the other times you might not put enough strength into the blow, or you hit an area where he's better protected, or something like that. Hence, we need a system to represent these inaccuracies of yours!
This is what this mod does by calculating whether your attack fails, or succeeds.
Now, Morrowind's Chance-to-hit calculation had one severe flaw: If you failed in hitting your opponent with all your force, then you *didn't* hit him at all. Your sword would go right through his body, which was pretty ridiculous and is to this day the number one flaw any Morrowind player will mention about the game.
This doesn't happen in this mod. Even when the calculation says that you failed to hit your opponent with all your force, you will still hurt him a little bit. The Chance-to-hit calculation also takes this into account, which means that if you, say, wrote down how much damage your last 100 attacks made, and then created an average, this average will be exactly like the damage you do in Oblivion with one hit.
(Well, apart from the fact that your Agility and your Luck have a bit of an influence in the calculation - see below.)
Inner workings:
Your Chance to hit your opponent is calculated for every strike you make. The formula is:
ChanceToHit = WeaponSkill + ( Agility - 50 ) * 0,25 + ( Luck - 50 ) * 0,125
The mod takes a random number between 0 and 100 and compares it to that value. If it is lower, you succeed, if it is higher, you fail.
If you succeed, your Weapon skill (HandToHand, Blade, Blunt or Marksman) is increased to 100. If you fail, it is decreased to 0. That means that your damage will be calculated as if you had either a skill of 100, or a skill of 0. The remaining three skills will be increased or decreased by the same value for the sake of simplicity in the script; it won't have any side-effects.
The calculation only applies if you are NOT sneak attacking - if you are sneaking and undetected, your damage will be the same as in vanilla Oblivion. There are two reasons for this: First, if you're undetected it's more likely that you take your time to look where to hit your opponent hardest. It wouldn't make much sense to fail in such a situation. Second, the successful sneak attack is already represented by the sneak attack multiplier.
The skills will revert to their normal value if you don't keep attacking.
Every time a random number is calculated, the script will print a message to the console that tells you what your chance to hit was, and the value of the random number. That way you can check if a strike was successful or not. However, the script does not make the calculation only once for each strike - it will make a calculation every .3 seconds that you hold your attack button. The last message will usually show the final calculation.
You can also simply check if your skills are increased or decreased.
If your skill is bigger than 100, the calculation will not be done. This is because you'll succeed anyway, and because the script would always decrease your skill to 100 before every strike, which doesn't make a lot of sense.
Also, this way it's compatible with Elys Uncapper.
Credits:
Thanks to all those people who helped me getting the last flaws out of my script, especially Low Post, TheNiceOne and showler.
Thanks to the authors of all those excellent entries in the CS Wiki.
Thanks to the OBSE team.
Without all of you, I wouldn't have been able to finish this.
Changelog:
v2.0 - Instead of simply raising/lowering the skills by 100, the script now calculates the difference to 100 or 0 and modifies them by that value. This means the mod should now be fully compatible with mods like Elys Uncapper. Additionally, the script has been improved greatly in other aspects as well.