Formulae

From OpenMW Wiki
Revision as of 18:00, 7 August 2011 by Lgromanowski (talk | contribs) (Created page with "==Combat Formulae== ===Melee=== ====Hit Chance==== hit chance = Attackers weapon skill * 1.25 + Attackers Attack - Defenders Sanctuary + (Attackers Agility - Defenders Agilit...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Combat Formulae

Melee

Hit Chance

 hit chance = Attackers weapon skill * 1.25 + Attackers Attack - Defenders Sanctuary + (Attackers Agility - Defenders Agility) * 0.25 + (Attackers Luck - Defenders Luck) * 0.125

Example:

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

Bodypart Hit Chance

Damage

 Damages dealt = (Damage * Damage) / (Damage + Opponent Armor Rating)

Melee Mitigation

Magic

Chance of Successful Spell Cast

 chance = (Spells Skill * 2 + Willpower / 5 + Luck / 10 - SpellCost + CastPenalty) * (CurrentFatigue + MaximumFatigue * 1.5) / (MaximumFatigue * 2)

The value for CastPenalty can be accessed with the function GetCastPenalty.

Cast cost

 cost = 0.1 + ((min effect value / 20) + (max effect value / 20)) * ((duration - 1) / 2) + (range / 40).

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

  • Touch/Self
 cost = base cost * ((max + min) * duration * 0.025 + area * 0.0125)
  • Target
 cost = base cost * ((max + min) * duration * 0.3125 + area * 0.0125)
  • Constant effect
 cost = base cost * ((max + min) * 2.5 + area * 0.025)

The base cost are here

Comments

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

Magic Mitigation

Magic Damage

Ranged

Item Values

Spell cost in gold

 cost of puchasing existing spell. = spell cost in magicka * fSpellValueMult
 cost of spellmaking = spell cost in magicka * fSpellMakingValueMult
 cost of enchanting service = Enchantment points * fEnchantmentValueMult

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.

Item costs in Gold

Travel Costs in Gold

Item Durability, Item Charge

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.

Charge

Armor Rating and Armor Class

Determining armor class

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


 if ( iHelmWeight * fLightMaxMod <= helm. weight):
   return LIGHT
 elif (iHelmWeight * fMedMaxMod <= helm. weight):
    return MEDIUM
 else:
    return HEAVY

For other armor types another variable should be used:

  • iHelmWeight
  • iPauldronWeight
  • iGauntletWeight
  • iCuirassWeight
  • iGreavesWeight
  • iBootsWeight

Armor rating

 rating = armor. rating * ArmorSkill / iBaseArmorSkill

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

 rating = UnarmoredSkill * UnarmoredSkill * 0.0065

Total armor rating determined by these formula:

 totalRating = Cuirass * 0.3 + (Shield + Helm + Greaves + Boots + RPauldron + LPauldron) * 0.1 + (RGauntlet + LGauntlet) * 0.05

How Unarmored Works

Persuasion Formulae

Persuasion options in the NPC dialogue menu.

Shared terms

 persTerm = personality / fPersonalityMod
 luckTerm = luck / fLuckMod
 repTerm = reputation * fReputationMod
 levelTerm = level * fLevelMod
 fatigueTerm = fFatigueBase - fFatigueMult * (1 - normalisedFatigue)

where normalisedFatigue is a function of fatigue: empty fatigue bar -> 0.0, full fatigue bar -> 1.0

 #using player stats
 playerRating1 = (repTerm + luckTerm + persTerm + speechcraft) * fatigueTerm
 playerRating2 = playerRating1 + levelTerm
 playerRating3 = (mercantile + luckTerm + persTerm) * fatigueTerm

 #using NPC stats (note differences)
 npcRating1 = (repTerm + luckTerm + persTerm + speechcraft) * fatigueTerm
 npcRating2 = (levelTerm + repTerm + luckTerm + persTerm + npcSpeechcraft) * fatigueTerm
 npcRating3 = (mercantile + repTerm + luckTerm + persTerm) * fatigueTerm

 d = 1 - 0.02 * abs(npcDisposition - 50)
 target1 = d * (playerRating1 - npcRating1 + 50)
 target2 = d * (playerRating2 - npcRating2 + 50)
 target3 = d * (playerRating3 - npcRating3 + 50) + bribeMod

where bribeMod is fBribe10Mod, fBribe100Mod or fBribe1000Mod


Admire

 target1 = max(iPerMinChance, target1)
 roll 100, win if roll <= target1
 c = int(fPerDieRollMult * (target1 - roll))
 x = max(iPerMinChange, c) on success, c on fail