Formulae

Hit Chance
Example:


 * Warrior's Attack = 10
 * Thief's Sanctuary = 10

Blocking melee attacks with an equipped shield.
On enemy hit The enemySwing variable is effectively how much the enemy has charged their attack. It seems to be uniform random and is not based on weapon damage. The other thing of note is the playerTerm bonus. The fBlockStillBonus GMST is not used at all; the multiplier is hard-coded. Unexpectedly, this bonus is still given if the player is moving backwards or strafing, only moving forward will negate it.

Chance of Successful Spell Cast
The value for CastPenalty can be accessed with the function GetCastPenalty.

Cast cost
x1.5 for ranged spell. Constant effect enchantments use fEnchantmentConstantDurationMult as their duration values (default 100).

The base cost are here
 * Touch/Self
 * Target
 * Constant effect

Comments
They are more than one formulae on internet, witch one is the real?

Spell cost in gold
This is adjusted as follows: 0.5% per point of disposition (base 50). 0.5% per point of mercantile skill difference. 0.05% per point of personality value difference. 0.05% per point of luck value difference.

Damages
With every successful hit a weapon takes fWeaponDamageMult: (default 0.1) percentage of damage rounded down. Minimum damage to weapon = 1 With weapon health going down, its damage is also going down, thus in turn slowing the rate of damaging weapon. Armor takes an amount of damage that it stopped. Only armor part that took a hit takes any damage, while each armor part equipped contributes to the armor rating.

Determining armor class
Armor class (in case of helm) is determined by these code:

For other armor types another variable should be used:


 * iHelmWeight
 * iPauldronWeight
 * iGauntletWeight
 * iCuirassWeight
 * iGreavesWeight
 * iBootsWeight

Armor rating
if player don't have armor piece unarmored skill is used instead:

Total armor rating determined by these formula:

Persuasion Formulae
Persuasion options in the NPC dialogue menu.

Shared terms
Using player stats: Using NPC stats (note differences): Summary: where bribeMod is fBribe10Mod, fBribe100Mod or fBribe1000Mod

Disposition
For all persuasion actions there is a temporary and a permanent disposition change. The temporary one applies to the disposition meter you see in the dialogue window. The permanent one is applied when you say goodbye to the NPC; the NPC's disposition is reset to the disposition they had when you initiated the conversation, then the permanent disposition change is applied. You can see these values in the console by using ToggleDialogStats before persuading.

For all methods:

except for Intimidate:

This may attempt to change actual disposition below/above 0/100. Disposition changes are clamped so as not to go past the caps, and the actual amount the disposition moved is used in the next function.

except for Intimidate

There may also be modifications to the NPC's flee and fight ratings. The flee and fight variables hold the amount those ratings are changed. They are also capped at 0 and 100.

Comments
The function is long and highly redundant, much of the same formulas are repeatedly calculated many times for no reason. It's just another poorly coded part of Morrowind. There is at least one bug with Intimidate where you can see if the calculated change is under iPerMinChange, it fails to set x correctly (it should have the value y does). This is responsible for the disposition meter not moving on some Intimidate Success results.

NPC Awareness Check
This check runs every 5 seconds for each NPC. It occurs whether you are sneaking or not, but isn't the same as the combat distance check.

Comments
Appears straightforward and bug-free. NPCs can take up to five seconds to notice you even if you are not sneaking. This function precedes the combat distance check. I have not identified if there is a line of sight check occuring before or after.

Pickpocketing
Pickpocketing is a multi-stage process. Not all items in the NPC's inventory are available, depending on the initial rolls. There are checks on a steal attempt, and when the window is closed.

On closing the pickpocket window
Same calculation as taking an item, but with valueTerm = 0

Comments
The stealing process is highly broken for most items; any item or stack of items worth over 100 septims has such a negative result that it is picked at minimum chance, and this is at maximum all stats. A player with stats around 50 is picking at minimum for anything valuable. The available items window is not reset after every successful steal, only when you close the window and retry the pickpocket.

PC's leveling
How to achieve new level and what happens then

Achieving
When player receive point in the skill:

On level-up PC get 3 points to redistribute, bonus will be this:

where $$ is value of attribute counter

Skill increases
Based on research on leveling of the Alchemy skill (ref: http://openmw.org/forum/viewtopic.php?f=2&t=853)

level_progress = the progress factor through a level (from 0 to 1).

level = current level of the skill.

skill_gain_factor = skill gain factor(s) that come from the skill records.
 * For alchemy only "Potion creation" (default value: 2.00) is used.
 * For other skills, please add alphabetically.

skill_type_GMST = value of the GMST corresponding skill type:
 * Major skill: GMST fMajorSkillBonus (default: 0.75)
 * Minor skill: GMST fMinorSkillBonus (default: 1.00)
 * Misc skill: GMST fMiscSkillBonus (default: 1.25)

specialisation_bonus = value of fSpecialSkillBonus (default: 0.80) when the Player has the same specialization as the skill or 1.00 if not.

On using player->setSkill

 * Experiments on Alchemy showed that using player->setAlchemy did change the alchemy level, but not the skill progress. Therefore, when lowering the alchemy level, the skill progress will be recalculated for that level en give a higher progress. When increasing the alchemy level, the reverse will happen, resulting in a lower skill progress.
 * To reset the progress, level first to the next level and then use player->setSkill to the target level.

PC's dynamic stats
Health point's, magic, stamina...

HP
Initial HP

Every level add

Magic points
M = magic bonus from race, item or sign.

NPC Auto-calculate stats
NPCs' auto-calculated stats. Affected by race, class, faction and rank.

Attributes
round attribute to nearest, half to nearest even (standard IEEE 754 rounding mode)

Skills
Round skill to nearest, half to nearest even (standard IEEE 754 rounding mode)

Reputation
where the entry level rank in the faction means rank = 1

Enchanting

 * Percent chance to self-enchant a Constant Effect item


 * Enchanted item recharge

Armorer
Chance to repair item:

Restored health of item:

Alchemy
Creating potions

Positive attributes:

The cost is related to basic cost of effect.

Negative attributes:


 * Alembic reduces the time of negative effects:


 * Power of negative effects:

The image of a created potion is picked at random among the available.

It stays the same until one of the following things occur:

1. Change of quality or amount of any/all apparatus.

2. Adding or removing ingredients.

3. Any skill gain.

4. Loading a save.

Eating ingredients

Simply eating ingredients raw will improve your alchemy skill. (Though at 1/4 the rate of mixing potions.)

Eating has a chance to apply the first effect of an ingredient onto the player.

Magnitude is a random value between 1 and max_magnitude.

The chance to fail is based on alchemy, intelligence and luck. The exact formula is to be determined.

Acrobatics
This formula is for the basic jump height:

- if ( Skill < 50 ) Velocity = 210.43 + AcrobaticsBase/1.6 + (Skill/16.22) ^ AcrobaticsMult else Velocity = 210.43 + AcrobaticsBase/1.6 + (50.2/16.22) ^ AcrobaticsMult + 1.88 * Skill * AcrobaticsMult - 97.38*AcrobaticsMult -

Should be accurate to within +/- 20 velocity or +/- .33 MW units.

Modifier for encumbrance:

Modifier for fatigue: