Jump to content

Need help with createenchantment script.


jereome

Recommended Posts

I have been working on a script using the following SKSE script, to enchant the staff in your right hand with the spell in your left.

 

CreateEnchantment(Actor akActor, Int handSlot, Int slotMask, Float maxCharge, MagicEffect[] effects, Float[] magnitudes, Int[] areas, Int[] durations)

 

I finally managed to get the spell to work. For example I had flames equipped in my left hand, then triggered to power to initiate the script and I looked on the staff and there was the flames enchantment. I then switched my spell to healing and pressed the powers button and it switched the enchantment on the staff to healing.

 

Now here is the problem... Doh the Enchantment on the Staff is a standard enchantment and not a staff enchanment... Doh.. So I can click on my mouse button all I want to cast the spell on the staff and the staff will do nothing.

 

Now if I say put a sword in my hand and enchant it with the spell, the sword will proc the enchantment just fine except if the enchantment is a self only enchantment it will cast it on your target.

 

So do any of you have any idea on how I can fix this issue or at least a work around? Thanks.

 

Here is the script in question:

 

While Counter < NumberEffects

SpellEffects[Counter] = SpellEquipped.GetNthEffectMagicEffect(Counter)
SpellMagnitudes[Counter] = SpellEquipped.GetNthEffectMagnitude(Counter)
EffectAreas[Counter] = SpellEquipped.GetNthEffectArea(Counter)
EffectDuration[counter] = SpellEquipped.GetNthEffectDuration(Counter)
Counter += 1
EndWhile
WornObject.CreateEnchantment(PlayerRef, 1, 0, MaxCharge, SpellEffects, SpellMagnitudes, EffectAreas, EffectDuration)
EndFunction
Edited by jereome
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...