Show / Hide Table of Contents

Class FormulaHelper

Common formulas used throughout game. Where the exact formula is unknown, a "best effort" approximation will be used. Most formula can be overridden by registering a new method matching the appropriate delegate signature. Other signatures can be added upon demand.

Inheritance
Object
FormulaHelper
Namespace: DaggerfallWorkshop.Game.Formulas
Assembly: Assembly-CSharp.dll
Syntax
public static class FormulaHelper

Fields

| Improve this Doc View Source

classicFrameUpdate

Declaration
public const int classicFrameUpdate = 980
Field Value
Type Description
Int32
| Improve this Doc View Source

specialInfectionChance

Declaration
public static float specialInfectionChance
Field Value
Type Description
Single

Methods

| Improve this Doc View Source

AdjustWeaponAttackDamage(DaggerfallEntity, DaggerfallEntity, Int32, Int32, DaggerfallUnityItem)

Declaration
public static int AdjustWeaponAttackDamage(DaggerfallEntity attacker, DaggerfallEntity target, int damage, int weaponAnimTime, DaggerfallUnityItem weapon)
Parameters
Type Name Description
DaggerfallEntity attacker
DaggerfallEntity target
Int32 damage
Int32 weaponAnimTime
DaggerfallUnityItem weapon
Returns
Type Description
Int32
| Improve this Doc View Source

AdjustWeaponHitChanceMod(DaggerfallEntity, DaggerfallEntity, Int32, Int32, DaggerfallUnityItem)

Declaration
public static int AdjustWeaponHitChanceMod(DaggerfallEntity attacker, DaggerfallEntity target, int hitChanceMod, int weaponAnimTime, DaggerfallUnityItem weapon)
Parameters
Type Name Description
DaggerfallEntity attacker
DaggerfallEntity target
Int32 hitChanceMod
Int32 weaponAnimTime
DaggerfallUnityItem weapon
Returns
Type Description
Int32
| Improve this Doc View Source

ApplyConditionDamageThroughPhysicalHit(DaggerfallUnityItem, DaggerfallEntity, Int32)

Applies condition damage to an item based on physical hit damage.

Declaration
public static void ApplyConditionDamageThroughPhysicalHit(DaggerfallUnityItem item, DaggerfallEntity owner, int damage)
Parameters
Type Name Description
DaggerfallUnityItem item
DaggerfallEntity owner
Int32 damage
| Improve this Doc View Source

ApplyRegionalPriceAdjustment(Int32)

Declaration
public static int ApplyRegionalPriceAdjustment(int cost)
Parameters
Type Name Description
Int32 cost
Returns
Type Description
Int32
| Improve this Doc View Source

ApplyTargetCostMultiplier(Int32, TargetTypes)

Declaration
public static int ApplyTargetCostMultiplier(int cost, TargetTypes targetType)
Parameters
Type Name Description
Int32 cost
TargetTypes targetType
Returns
Type Description
Int32
| Improve this Doc View Source

BonusPool()

Declaration
public static int BonusPool()
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateAdjustmentsToHit(DaggerfallEntity, DaggerfallEntity)

Declaration
public static int CalculateAdjustmentsToHit(DaggerfallEntity attacker, DaggerfallEntity target)
Parameters
Type Name Description
DaggerfallEntity attacker
DaggerfallEntity target
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateAdrenalineRushToHit(DaggerfallEntity, DaggerfallEntity)

Declaration
public static int CalculateAdrenalineRushToHit(DaggerfallEntity attacker, DaggerfallEntity target)
Parameters
Type Name Description
DaggerfallEntity attacker
DaggerfallEntity target
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateArmorToHit(DaggerfallEntity, Int32)

Declaration
public static int CalculateArmorToHit(DaggerfallEntity target, int struckBodyPart)
Parameters
Type Name Description
DaggerfallEntity target
Int32 struckBodyPart
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateAttackDamage(DaggerfallEntity, DaggerfallEntity, Boolean, Int32, DaggerfallUnityItem)

Calculate the damage caused by an attack.

Declaration
public static int CalculateAttackDamage(DaggerfallEntity attacker, DaggerfallEntity target, bool isEnemyFacingAwayFromPlayer, int weaponAnimTime, DaggerfallUnityItem weapon)
Parameters
Type Name Description
DaggerfallEntity attacker

Attacking entity

DaggerfallEntity target

Target entity

Boolean isEnemyFacingAwayFromPlayer

Whether enemy is facing away from player, used for backstabbing

Int32 weaponAnimTime

Time the weapon animation lasted before the attack in ms, used for bow drawing

DaggerfallUnityItem weapon

The weapon item being used

Returns
Type Description
Int32

Damage inflicted to target, can be 0 for a miss or ineffective hit

| Improve this Doc View Source

CalculateBackstabChance(PlayerEntity, DaggerfallEntity, Boolean)

Declaration
public static int CalculateBackstabChance(PlayerEntity player, DaggerfallEntity target, bool isEnemyFacingAwayFromPlayer)
Parameters
Type Name Description
PlayerEntity player
DaggerfallEntity target
Boolean isEnemyFacingAwayFromPlayer
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateBackstabDamage(Int32, Int32)

Declaration
public static int CalculateBackstabDamage(int damage, int backstabbingLevel)
Parameters
Type Name Description
Int32 damage
Int32 backstabbingLevel
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateBankLoanRepayment(Int32, Int32)

Declaration
public static int CalculateBankLoanRepayment(int amount, int regionIndex)
Parameters
Type Name Description
Int32 amount
Int32 regionIndex
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateCasterLevel(DaggerfallEntity, IEntityEffect)

Declaration
public static int CalculateCasterLevel(DaggerfallEntity caster, IEntityEffect effect)
Parameters
Type Name Description
DaggerfallEntity caster
IEntityEffect effect
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateCastingCost(SpellRecord.SpellRecordData, Boolean)

Reversed from classic. Calculates cost of casting a spell. This cost is also used to lower item condition when equipping an item whith a "Cast when held" effect. For now this is only being used for enchanted items, because there is other code for entity-cast spells.

Declaration
public static int CalculateCastingCost(SpellRecord.SpellRecordData spell, bool enchantingItem = true)
Parameters
Type Name Description
SpellRecord.SpellRecordData spell

Spell record read from SPELLS.STD.

Boolean enchantingItem

True if the method is used from the magic item maker.

Returns
Type Description
Int32
| Improve this Doc View Source

CalculateClimbingChance(PlayerEntity, Int32)

Declaration
public static int CalculateClimbingChance(PlayerEntity player, int basePercentSuccess)
Parameters
Type Name Description
PlayerEntity player
Int32 basePercentSuccess
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateCost(Int32, Int32, Int32)

Calculate the cost of something in a given shop.

Declaration
public static int CalculateCost(int baseValue, int shopQuality, int conditionPercentage = -1)
Parameters
Type Name Description
Int32 baseValue

Base value

Int32 shopQuality

Shop quality 0-20

Int32 conditionPercentage

Condition of item as a percentage, -1 indicates condition not applicable

Returns
Type Description
Int32

Shop specific cost

| Improve this Doc View Source

CalculateDaedraSummoningChance(Int32, Int32)

Declaration
public static int CalculateDaedraSummoningChance(int daedraRep, int bonus)
Parameters
Type Name Description
Int32 daedraRep
Int32 bonus
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateDaedraSummoningCost(Int32)

Declaration
public static int CalculateDaedraSummoningCost(int npcRep)
Parameters
Type Name Description
Int32 npcRep
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateEffectCosts(EffectEntry, DaggerfallEntity)

Calculate effect costs from an EffectEntry.

Declaration
public static FormulaHelper.SpellCost CalculateEffectCosts(EffectEntry effectEntry, DaggerfallEntity casterEntity = null)
Parameters
Type Name Description
EffectEntry effectEntry
DaggerfallEntity casterEntity
Returns
Type Description
FormulaHelper.SpellCost
| Improve this Doc View Source

CalculateEffectCosts(IEntityEffect, EffectSettings, DaggerfallEntity)

Calculates effect costs from an IEntityEffect and custom settings.

Declaration
public static FormulaHelper.SpellCost CalculateEffectCosts(IEntityEffect effect, EffectSettings settings, DaggerfallEntity casterEntity = null)
Parameters
Type Name Description
IEntityEffect effect
EffectSettings settings
DaggerfallEntity casterEntity
Returns
Type Description
FormulaHelper.SpellCost
| Improve this Doc View Source

CalculateEnemyPacification(PlayerEntity, DFCareer.Skills)

Declaration
public static bool CalculateEnemyPacification(PlayerEntity player, DFCareer.Skills languageSkill)
Parameters
Type Name Description
PlayerEntity player
DFCareer.Skills languageSkill
Returns
Type Description
Boolean
| Improve this Doc View Source

CalculateExteriorLockpickingChance(Int32, Int32)

Declaration
public static int CalculateExteriorLockpickingChance(int lockvalue, int lockpickingSkill)
Parameters
Type Name Description
Int32 lockvalue
Int32 lockpickingSkill
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateFatigueRecoveryRate(Int32)

Declaration
public static int CalculateFatigueRecoveryRate(int maxFatigue)
Parameters
Type Name Description
Int32 maxFatigue
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateHandToHandAttackDamage(DaggerfallEntity, DaggerfallEntity, Int32, Boolean)

Declaration
public static int CalculateHandToHandAttackDamage(DaggerfallEntity attacker, DaggerfallEntity target, int damageModifier, bool player)
Parameters
Type Name Description
DaggerfallEntity attacker
DaggerfallEntity target
Int32 damageModifier
Boolean player
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateHandToHandMaxDamage(Int32)

Declaration
public static int CalculateHandToHandMaxDamage(int handToHandSkill)
Parameters
Type Name Description
Int32 handToHandSkill
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateHandToHandMinDamage(Int32)

Declaration
public static int CalculateHandToHandMinDamage(int handToHandSkill)
Parameters
Type Name Description
Int32 handToHandSkill
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateHealthRecoveryRate(PlayerEntity)

Declaration
public static int CalculateHealthRecoveryRate(PlayerEntity player)
Parameters
Type Name Description
PlayerEntity player
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateHitPointsPerLevelUp(PlayerEntity)

Declaration
public static int CalculateHitPointsPerLevelUp(PlayerEntity player)
Parameters
Type Name Description
PlayerEntity player
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateInteriorLockpickingChance(Int32, Int32, Int32)

Declaration
public static int CalculateInteriorLockpickingChance(int level, int lockvalue, int lockpickingSkill)
Parameters
Type Name Description
Int32 level
Int32 lockvalue
Int32 lockpickingSkill
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateItemIdentifyCost(Int32, IGuild)

Declaration
public static int CalculateItemIdentifyCost(int baseItemValue, IGuild guild)
Parameters
Type Name Description
Int32 baseItemValue
IGuild guild
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateItemRepairCost(Int32, Int32, Int32, Int32, IGuild)

Declaration
public static int CalculateItemRepairCost(int baseItemValue, int shopQuality, int condition, int max, IGuild guild)
Parameters
Type Name Description
Int32 baseItemValue
Int32 shopQuality
Int32 condition
Int32 max
IGuild guild
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateItemRepairTime(Int32, Int32)

Declaration
public static int CalculateItemRepairTime(int condition, int max)
Parameters
Type Name Description
Int32 condition
Int32 max
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateMaxBankLoan()

Declaration
public static int CalculateMaxBankLoan()
Returns
Type Description
Int32
| Improve this Doc View Source

CalculatePickpocketingChance(PlayerEntity, EnemyEntity)

Declaration
public static int CalculatePickpocketingChance(PlayerEntity player, EnemyEntity target)
Parameters
Type Name Description
PlayerEntity player
EnemyEntity target
Returns
Type Description
Int32
| Improve this Doc View Source

CalculatePlayerLevel(Int32, Int32)

Declaration
public static int CalculatePlayerLevel(int startingLevelUpSkillsSum, int currentLevelUpSkillsSum)
Parameters
Type Name Description
Int32 startingLevelUpSkillsSum
Int32 currentLevelUpSkillsSum
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateProficiencyModifiers(DaggerfallEntity, DaggerfallUnityItem)

Declaration
public static FormulaHelper.ToHitAndDamageMods CalculateProficiencyModifiers(DaggerfallEntity attacker, DaggerfallUnityItem weapon)
Parameters
Type Name Description
DaggerfallEntity attacker
DaggerfallUnityItem weapon
Returns
Type Description
FormulaHelper.ToHitAndDamageMods
| Improve this Doc View Source

CalculateRacialModifiers(DaggerfallEntity, DaggerfallUnityItem, PlayerEntity)

Declaration
public static FormulaHelper.ToHitAndDamageMods CalculateRacialModifiers(DaggerfallEntity attacker, DaggerfallUnityItem weapon, PlayerEntity player)
Parameters
Type Name Description
DaggerfallEntity attacker
DaggerfallUnityItem weapon
PlayerEntity player
Returns
Type Description
FormulaHelper.ToHitAndDamageMods
| Improve this Doc View Source

CalculateRoomCost(Int32)

Declaration
public static int CalculateRoomCost(int daysToRent)
Parameters
Type Name Description
Int32 daysToRent
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateShopliftingChance(PlayerEntity, Int32, Int32)

Declaration
public static int CalculateShopliftingChance(PlayerEntity player, int shopQuality, int weightAndNumItems)
Parameters
Type Name Description
PlayerEntity player
Int32 shopQuality
Int32 weightAndNumItems
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateSkillsToHit(DaggerfallEntity, DaggerfallEntity)

Declaration
public static int CalculateSkillsToHit(DaggerfallEntity attacker, DaggerfallEntity target)
Parameters
Type Name Description
DaggerfallEntity attacker
DaggerfallEntity target
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateSkillUsesForAdvancement(Int32, Int32, Single, Int32)

Declaration
public static int CalculateSkillUsesForAdvancement(int skillValue, int skillAdvancementMultiplier, float careerAdvancementMultiplier, int level)
Parameters
Type Name Description
Int32 skillValue
Int32 skillAdvancementMultiplier
Single careerAdvancementMultiplier
Int32 level
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateSpellPointRecoveryRate(PlayerEntity)

Declaration
public static int CalculateSpellPointRecoveryRate(PlayerEntity player)
Parameters
Type Name Description
PlayerEntity player
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateStatsToHit(DaggerfallEntity, DaggerfallEntity)

Declaration
public static int CalculateStatsToHit(DaggerfallEntity attacker, DaggerfallEntity target)
Parameters
Type Name Description
DaggerfallEntity attacker
DaggerfallEntity target
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateStealthChance(Single, DaggerfallEntityBehaviour)

Declaration
public static int CalculateStealthChance(float distanceToTarget, DaggerfallEntityBehaviour target)
Parameters
Type Name Description
Single distanceToTarget
DaggerfallEntityBehaviour target
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateStruckBodyPart()

Declaration
public static int CalculateStruckBodyPart()
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateSuccessfulHit(DaggerfallEntity, DaggerfallEntity, Int32, Int32)

Calculates whether an attack on a target is successful or not.

Declaration
public static bool CalculateSuccessfulHit(DaggerfallEntity attacker, DaggerfallEntity target, int chanceToHitMod, int struckBodyPart)
Parameters
Type Name Description
DaggerfallEntity attacker
DaggerfallEntity target
Int32 chanceToHitMod
Int32 struckBodyPart
Returns
Type Description
Boolean
| Improve this Doc View Source

CalculateSwingModifiers(FPSWeapon)

Declaration
public static FormulaHelper.ToHitAndDamageMods CalculateSwingModifiers(FPSWeapon onscreenWeapon)
Parameters
Type Name Description
FPSWeapon onscreenWeapon
Returns
Type Description
FormulaHelper.ToHitAndDamageMods
| Improve this Doc View Source

CalculateTempleBlessing(Int32, Int32)

Declaration
public static int CalculateTempleBlessing(int donationAmount, int deityRep)
Parameters
Type Name Description
Int32 donationAmount
Int32 deityRep
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateTotalEffectCosts(EffectEntry[], TargetTypes, DaggerfallEntity, Boolean)

Performs complete gold and spellpoint costs for an array of effects. Also calculates multipliers for target type.

Declaration
public static FormulaHelper.SpellCost CalculateTotalEffectCosts(EffectEntry[] effectEntries, TargetTypes targetType, DaggerfallEntity casterEntity = null, bool minimumCastingCost = false)
Parameters
Type Name Description
EffectEntry[] effectEntries

EffectEntry array for spell.

TargetTypes targetType

Target type of spell.

DaggerfallEntity casterEntity

Caster entity. Assumed to be player if null.

Boolean minimumCastingCost

Spell point always costs minimum (e.g. from vampirism). Do not set true for reflection/absorption cost calculations.

Returns
Type Description
FormulaHelper.SpellCost
| Improve this Doc View Source

CalculateTradePrice(Int32, Int32, Boolean)

Declaration
public static int CalculateTradePrice(int cost, int shopQuality, bool selling)
Parameters
Type Name Description
Int32 cost
Int32 shopQuality
Boolean selling
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateWeaponAttackDamage(DaggerfallEntity, DaggerfallEntity, Int32, Int32, DaggerfallUnityItem)

Declaration
public static int CalculateWeaponAttackDamage(DaggerfallEntity attacker, DaggerfallEntity target, int damageModifier, int weaponAnimTime, DaggerfallUnityItem weapon)
Parameters
Type Name Description
DaggerfallEntity attacker
DaggerfallEntity target
Int32 damageModifier
Int32 weaponAnimTime
DaggerfallUnityItem weapon
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateWeaponMaxDamage(Weapons)

Declaration
public static int CalculateWeaponMaxDamage(Weapons weapon)
Parameters
Type Name Description
Weapons weapon
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateWeaponMinDamage(Weapons)

Declaration
public static int CalculateWeaponMinDamage(Weapons weapon)
Parameters
Type Name Description
Weapons weapon
Returns
Type Description
Int32
| Improve this Doc View Source

CalculateWeaponToHit(DaggerfallUnityItem)

Declaration
public static int CalculateWeaponToHit(DaggerfallUnityItem weapon)
Parameters
Type Name Description
DaggerfallUnityItem weapon
Returns
Type Description
Int32
| Improve this Doc View Source

DamageEquipment(DaggerfallEntity, DaggerfallEntity, Int32, DaggerfallUnityItem, Int32)

Allocate any equipment damage from a strike, and reduce item condition.

Declaration
public static void DamageEquipment(DaggerfallEntity attacker, DaggerfallEntity target, int damage, DaggerfallUnityItem weapon, int struckBodyPart)
Parameters
Type Name Description
DaggerfallEntity attacker
DaggerfallEntity target
Int32 damage
DaggerfallUnityItem weapon
Int32 struckBodyPart
| Improve this Doc View Source

DamageModifier(Int32)

Declaration
public static int DamageModifier(int strength)
Parameters
Type Name Description
Int32 strength
Returns
Type Description
Int32
| Improve this Doc View Source

FatigueDamage(EnemyEntity, DaggerfallEntity, Int32)

Declaration
public static void FatigueDamage(EnemyEntity attacker, DaggerfallEntity target, int damage)
Parameters
Type Name Description
EnemyEntity attacker
DaggerfallEntity target
Int32 damage
| Improve this Doc View Source

GetArmorEnchantmentMultiplier(ArmorMaterialTypes)

Declaration
public static float GetArmorEnchantmentMultiplier(ArmorMaterialTypes armorMaterial)
Parameters
Type Name Description
ArmorMaterialTypes armorMaterial
Returns
Type Description
Single
| Improve this Doc View Source

GetBonusOrPenaltyByEnemyType(DaggerfallEntity, DaggerfallEntity)

Declaration
public static int GetBonusOrPenaltyByEnemyType(DaggerfallEntity attacker, DaggerfallEntity target)
Parameters
Type Name Description
DaggerfallEntity attacker
DaggerfallEntity target
Returns
Type Description
Int32
| Improve this Doc View Source

GetBowCooldownTime(PlayerEntity)

Declaration
public static float GetBowCooldownTime(PlayerEntity player)
Parameters
Type Name Description
PlayerEntity player
Returns
Type Description
Single
| Improve this Doc View Source

getCostFromSettings(Int32, Int32, SpellRecord.SpellRecordData, UInt16[])

Reversed from classic. Used wih calculating cost of casting a spell. This uses the spell's settings for chance, duration and magnitude together with coefficients for that effect to get the cost of the effect, before the range type modifier is applied.

Declaration
public static int getCostFromSettings(int settingsType, int effectNumber, SpellRecord.SpellRecordData spellData, ushort[] coefficients)
Parameters
Type Name Description
Int32 settingsType
Int32 effectNumber
SpellRecord.SpellRecordData spellData
UInt16[] coefficients
Returns
Type Description
Int32
| Improve this Doc View Source

GetEffectFlags(IEntityEffect)

Gets DFCareer.EffectFlags from an effect. Note: If effect is not instanced by a bundle then it will not have an element type.

Declaration
public static DFCareer.EffectFlags GetEffectFlags(IEntityEffect effect)
Parameters
Type Name Description
IEntityEffect effect

Source effect.

Returns
Type Description
DFCareer.EffectFlags

DFCareer.EffectFlags.

| Improve this Doc View Source

GetElementType(IEntityEffect)

Gets a resistance element based on effect element.

Declaration
public static DFCareer.Elements GetElementType(IEntityEffect effect)
Parameters
Type Name Description
IEntityEffect effect

Source effect.

Returns
Type Description
DFCareer.Elements

DFCareer.Elements

| Improve this Doc View Source

GetHolidayId(UInt32, Int32)

Declaration
public static int GetHolidayId(uint gameMinutes, int regionIndex)
Parameters
Type Name Description
UInt32 gameMinutes
Int32 regionIndex
Returns
Type Description
Int32
| Improve this Doc View Source

GetItemEnchantmentPower(DaggerfallUnityItem)

Gets the maximum enchantment capacity for any item.

Declaration
public static int GetItemEnchantmentPower(DaggerfallUnityItem item)
Parameters
Type Name Description
DaggerfallUnityItem item

Source item.

Returns
Type Description
Int32

Item max enchantment power.

| Improve this Doc View Source

GetMeleeWeaponAnimTime(PlayerEntity, WeaponTypes, ItemHands)

Declaration
public static float GetMeleeWeaponAnimTime(PlayerEntity player, WeaponTypes weaponType, ItemHands weaponHands)
Parameters
Type Name Description
PlayerEntity player
WeaponTypes weaponType
ItemHands weaponHands
Returns
Type Description
Single
| Improve this Doc View Source

GetResistanceModifier(DFCareer.EffectFlags, DaggerfallEntity)

Declaration
public static int GetResistanceModifier(DFCareer.EffectFlags effectFlags, DaggerfallEntity target)
Parameters
Type Name Description
DFCareer.EffectFlags effectFlags
DaggerfallEntity target
Returns
Type Description
Int32
| Improve this Doc View Source

GetSpellEnchantPtCost(Int32)

Reversed from classic. Calculates enchantment point/gold value for a spell being attached to an item.

Declaration
public static int GetSpellEnchantPtCost(int spellIndex)
Parameters
Type Name Description
Int32 spellIndex

Index of spell in SPELLS.STD.

Returns
Type Description
Int32
| Improve this Doc View Source

GetToleranceFlag(DFCareer.Tolerance)

Declaration
public static DFCareer.ToleranceFlags GetToleranceFlag(DFCareer.Tolerance tolerance)
Parameters
Type Name Description
DFCareer.Tolerance tolerance
Returns
Type Description
DFCareer.ToleranceFlags
| Improve this Doc View Source

GetVampireClan(Int32)

Declaration
public static VampireClans GetVampireClan(int regionIndex)
Parameters
Type Name Description
Int32 regionIndex
Returns
Type Description
VampireClans
| Improve this Doc View Source

GetWeaponEnchantmentMultiplier(WeaponMaterialTypes)

Declaration
public static float GetWeaponEnchantmentMultiplier(WeaponMaterialTypes weaponMaterial)
Parameters
Type Name Description
WeaponMaterialTypes weaponMaterial
Returns
Type Description
Single
| Improve this Doc View Source

HealingRateModifier(Int32)

Declaration
public static int HealingRateModifier(int endurance)
Parameters
Type Name Description
Int32 endurance
Returns
Type Description
Int32
| Improve this Doc View Source

HitPointsModifier(Int32)

Declaration
public static int HitPointsModifier(int endurance)
Parameters
Type Name Description
Int32 endurance
Returns
Type Description
Int32
| Improve this Doc View Source

InflictDisease(DaggerfallEntity, DaggerfallEntity, Diseases[])

Inflict a classic disease onto player.

Declaration
public static void InflictDisease(DaggerfallEntity attacker, DaggerfallEntity target, Diseases[] diseaseList)
Parameters
Type Name Description
DaggerfallEntity attacker

Source entity. Can be the same as target

DaggerfallEntity target

Target entity - must be player.

Diseases[] diseaseList

Array of disease indices matching Diseases enum.

| Improve this Doc View Source

InflictPoison(DaggerfallEntity, DaggerfallEntity, Poisons, Boolean)

Inflict a classic poison onto entity.

Declaration
public static void InflictPoison(DaggerfallEntity attacker, DaggerfallEntity target, Poisons poisonType, bool bypassResistance)
Parameters
Type Name Description
DaggerfallEntity attacker

Source entity. Can be the same as target

DaggerfallEntity target

Target entity

Poisons poisonType

Classic poison type

Boolean bypassResistance

Whether it should bypass resistances

| Improve this Doc View Source

IsItemStackable(DaggerfallUnityItem)

Declaration
public static bool IsItemStackable(DaggerfallUnityItem item)
Parameters
Type Name Description
DaggerfallUnityItem item
Returns
Type Description
Boolean
| Improve this Doc View Source

MagicResist(Int32)

Declaration
public static int MagicResist(int willpower)
Parameters
Type Name Description
Int32 willpower
Returns
Type Description
Int32
| Improve this Doc View Source

MaxEncumbrance(Int32)

Declaration
public static int MaxEncumbrance(int strength)
Parameters
Type Name Description
Int32 strength
Returns
Type Description
Int32
| Improve this Doc View Source

MaxStatValue()

Declaration
public static int MaxStatValue()
Returns
Type Description
Int32
| Improve this Doc View Source

ModifyEffectAmount(IEntityEffect, DaggerfallEntity, Int32)

Declaration
public static int ModifyEffectAmount(IEntityEffect sourceEffect, DaggerfallEntity target, int amount)
Parameters
Type Name Description
IEntityEffect sourceEffect
DaggerfallEntity target
Int32 amount
Returns
Type Description
Int32
| Improve this Doc View Source

OnMonsterHit(EnemyEntity, DaggerfallEntity, Int32)

Execute special monster attack effects.

Declaration
public static void OnMonsterHit(EnemyEntity attacker, DaggerfallEntity target, int damage)
Parameters
Type Name Description
EnemyEntity attacker

Attacking entity

DaggerfallEntity target

Target entity

Int32 damage

Damage done by the hit

| Improve this Doc View Source

RandomArmorMaterial(Int32)

Gets a random armor material based on player level.

Declaration
public static ArmorMaterialTypes RandomArmorMaterial(int playerLevel)
Parameters
Type Name Description
Int32 playerLevel

Player level, possibly adjusted.

Returns
Type Description
ArmorMaterialTypes

ArmorMaterialTypes value of material selected.

| Improve this Doc View Source

RandomizeInitialRegionalPrices(ref PlayerEntity.RegionDataRecord[])

Declaration
public static void RandomizeInitialRegionalPrices(ref PlayerEntity.RegionDataRecord[] regionData)
Parameters
Type Name Description
PlayerEntity.RegionDataRecord[] regionData
| Improve this Doc View Source

RandomMaterial(Int32)

Gets a random material based on player level. Note, this is called by default RandomArmorMaterial function.

Declaration
public static WeaponMaterialTypes RandomMaterial(int playerLevel)
Parameters
Type Name Description
Int32 playerLevel

Player level, possibly adjusted.

Returns
Type Description
WeaponMaterialTypes

WeaponMaterialTypes value of material selected.

| Improve this Doc View Source

RegisterOverride<TDelegate>(Mod, String, TDelegate)

Registers an override for a formula using a generic System.Func{T} callback with the same signature as the method it overrides (i.e. RegisterOverride{Func{int, int, float}}(&quot;FormulaName&quot;, (a, b) => (float)a / b);). The invocation will fail if signature is not correct, meaning if the delegate is not one of the variation of Func with the expected arguments.

Declaration
public static void RegisterOverride<TDelegate>(Mod provider, string formulaName, TDelegate formula)
    where TDelegate : class
Parameters
Type Name Description
Mod provider

The mod that provides this override; used to enforce load order.

String formulaName

The name of the method that provides the formula.

TDelegate formula

A callback that implements the formula.

Type Parameters
Name Description
TDelegate

One of the available generic Func delegates.

Exceptions
Type Condition
ArgumentNullException

formulaName or formula is null.

InvalidCastException

Type is not a delegate.

| Improve this Doc View Source

RollEnemyClassMaxHealth(Int32, Int32)

Declaration
public static int RollEnemyClassMaxHealth(int level, int hitPointsPerLevel)
Parameters
Type Name Description
Int32 level
Int32 hitPointsPerLevel
Returns
Type Description
Int32
| Improve this Doc View Source

RollMaxHealth(PlayerEntity)

Declaration
public static int RollMaxHealth(PlayerEntity player)
Parameters
Type Name Description
PlayerEntity player
Returns
Type Description
Int32
| Improve this Doc View Source

RollRandomSpawn_Dungeon()

Roll for random spawn in dungeons.

Declaration
public static int RollRandomSpawn_Dungeon()
Returns
Type Description
Int32

0 to generate a spawn. >0 to not generate a spawn.

| Improve this Doc View Source

RollRandomSpawn_LocationNight()

Roll for random spawn in location area at night.

Declaration
public static int RollRandomSpawn_LocationNight()
Returns
Type Description
Int32

0 to generate a spawn. >0 to not generate a spawn.

| Improve this Doc View Source

RollRandomSpawn_WildernessDay()

Roll for random spawn in wilderness during daylight hours.

Declaration
public static int RollRandomSpawn_WildernessDay()
Returns
Type Description
Int32

0 to generate a spawn. >0 to not generate a spawn.

| Improve this Doc View Source

RollRandomSpawn_WildernessNight()

Roll for random spawn in wilderness at night.

Declaration
public static int RollRandomSpawn_WildernessNight()
Returns
Type Description
Int32

0 to generate a spawn. >0 to not generate a spawn.

| Improve this Doc View Source

SavingThrow(DFCareer.Elements, DFCareer.EffectFlags, DaggerfallEntity, Int32)

Declaration
public static int SavingThrow(DFCareer.Elements elementType, DFCareer.EffectFlags effectFlags, DaggerfallEntity target, int modifier)
Parameters
Type Name Description
DFCareer.Elements elementType
DFCareer.EffectFlags effectFlags
DaggerfallEntity target
Int32 modifier
Returns
Type Description
Int32
| Improve this Doc View Source

SavingThrow(IEntityEffect, DaggerfallEntity)

Declaration
public static int SavingThrow(IEntityEffect sourceEffect, DaggerfallEntity target)
Parameters
Type Name Description
IEntityEffect sourceEffect
DaggerfallEntity target
Returns
Type Description
Int32
| Improve this Doc View Source

SpellPoints(Int32, Single)

Declaration
public static int SpellPoints(int intelligence, float multiplier)
Parameters
Type Name Description
Int32 intelligence
Single multiplier
Returns
Type Description
Int32
| Improve this Doc View Source

ToHitModifier(Int32)

Declaration
public static int ToHitModifier(int agility)
Parameters
Type Name Description
Int32 agility
Returns
Type Description
Int32
| Improve this Doc View Source

UpdateRegionalPrices(ref PlayerEntity.RegionDataRecord[], Int32)

Declaration
public static void UpdateRegionalPrices(ref PlayerEntity.RegionDataRecord[] regionData, int times)
Parameters
Type Name Description
PlayerEntity.RegionDataRecord[] regionData
Int32 times
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX