OnHit detecting enchantments?

Post » Tue Jun 19, 2012 8:39 pm

Is there a way to determine if the striking weapon (sword, dagger, etc) is enchanted through a script?

Basically... if akSource is enchanted or not.

Thank you :-)
User avatar
Rachael
 
Posts: 3412
Joined: Sat Feb 17, 2007 2:10 pm

Post » Wed Jun 20, 2012 2:23 am

iirc, all enchanted items apply magic effects to whoever they hit.

So you would need to; I am thinking maybe having a play around with onmagiceffectapply (that isnt the right name but its something like that. Then do a check to see if a weapon is involved: but the problem with this is that the check occurs after the effect is applied,so if you wanted to block enchanted item effects: this would be useless.

:(
User avatar
Devin Sluis
 
Posts: 3389
Joined: Wed Oct 24, 2007 4:22 am

Post » Wed Jun 20, 2012 7:26 am

Each enchantment will trigger a seperate OnHit event at the same time. I've noticed that when striking with a weapon with frost damage enchantment, it'll actually trigger 3 OnHit events at the same time (once for melee hit, once for frost damage, once for stamina damage). You should be able to check if the OnHit event was triggered by an enchantment by using

If(akSource As Enchantment)

However, I've noticed this to be bugged. It detected enchantments from a bow correctly, but the sword I described above didn't get detected correctly and it just registered it as 3 different melee hits at the same time.
User avatar
Marcia Renton
 
Posts: 3563
Joined: Fri Jan 26, 2007 5:15 am


Return to V - Skyrim