Skip to content

calcEnchantingSpellPointCost⚓︎

This event is raised when the enchanting menu determines the spell point cost of the current enchantment. Modifying this value affects the displayed enchantment cost, the derived cast/charge use values, the self-enchant success chance, and the base value used for enchanting service pricing.

--- @param e calcEnchantingSpellPointCostEventData
local function calcEnchantingSpellPointCostCallback(e)
end
event.register(tes3.event.calcEnchantingSpellPointCost, calcEnchantingSpellPointCostCallback)

Tip

This event can be filtered based on the reference event data.

Tip

An event can be claimed by setting e.claim to true, or by returning false from the callback. Claiming the event prevents any lower priority callbacks from being called.

Event Data⚓︎

  • castType (tes3.enchantmentType): Read-only. The enchantment cast type. Maps to tes3.enchantmentType.*.
  • effects (table[]): Read-only. An array of the effects being enchanted onto the item. This includes the effect object, magnitudeLow/magnitudeHigh values, the area, duration, and range. The attribute and skill values are available as appropriate.
  • item (tes3item): Read-only. The item, if any, that is being enchanted.
  • itemData (tes3itemData): Read-only. The item data for the enchanted item.
  • mobile (tes3mobileActor): Read-only. The mobile actor offering enchanting services. May not always be available.
  • reference (tes3reference): Read-only. A shortcut to the mobile's reference. May not always be available.
  • soul (tes3actor): Read-only. The soul contained in the soul gem.
  • soulGem (tes3misc): Read-only. The soul gem being used to make the enchantment.
  • soulGemData (tes3itemData): Read-only. The soul gem's associated item data.
  • spellPointCost (number): The total spell point cost of the enchantment. This can be modified.

Examples⚓︎

Example: Adjust the enchanting spell point cost

local function onCalcEnchantingSpellPointCost(e)
    if e.castType == tes3.enchantmentType.constantEffect then
        e.spellPointCost = e.spellPointCost * 0.9
    end
end

event.register(tes3.event.calcEnchantingSpellPointCost, onCalcEnchantingSpellPointCost)

calcEnchantmentPricecalcSpellmakingSpellPointCost