Jump to content

Photo

Script Question - Get Adjusted Cost of Cast Spell?

scripting

  • Please log in to reply
1 reply to this topic

#1
jamesthornbury

jamesthornbury

    Journeyman

  • Supporter
  • Pip
  • 26 posts

Hello all,

I've modded in the past a long time ago, but I'm not familiar with modern papyrus or SKSE's extensions.

 

Is there a way to get the real-time modified cost of a spell (i.e. its actual cost when cast by a player) when that spell is cast?

 

For why:

 

I'm thinking of making a mod that converts magicka cost to health cost, but rather than using fixed health costs (like Path of Sorcery does with its Blood Mage perk) I'm looking to scale it based on what the adjusted cost would be in magicka.

 

My thinking is if the cost can be grabbed on spell cast then an equivalent health value can be calculated and subtracted while the magicka value is refunded. This would maximise compatibility with other magic mods.

 

This would also pair nicely with a script effect to set maximum magicka to maximum health (with appropriate balancing adjustments), which would allow me to script a toggle for lethal casting on/off. My guess is that the way existing alternative casting mods handle this is by discounting magicka costs to zero, hence Path of Sorcery's fixed costs, and I'd like to avoid that if possible so that cost-adjusting enchantments can still be worthwhile.

 

Many thanks!



#2
IsharaMeradin

IsharaMeradin

    The Pale Redguard

  • Members
  • PipPipPipPipPip
  • 10,571 posts

I have never used it.  But SKSE provides GetEffectiveMagickaCost on the Spell script.  It may or may not be useful to you.







Also tagged with one or more of these keywords: scripting

IPB skins by Skinbox
Page loaded in: 0.965 seconds