Jump to content

Recommended Posts

Posted

So long story short, I play Guild Wars 2 every so often, and think adding scepters to Skyrim would be fun. Unfortunately I can't seem to get a script down for doing it. All I would need is for a spell to cast once the player swings their weapon, but I don't know if I need to attach the script to the weapon itself, create an enchantment on the weapon, or create an Alias linked to the weapon. If anyone can help I'd appreciate it. Here's what I've go so far:

 

 

 

Spell Property Scepter01 Auto

Event OnInit()
RegisterForAnimationEvent(Game.GetPlayer(), "weaponSwing")
RegisterForAnimationEvent(Game.GetPlayer(), "WeaponLeftSwing")
endEvent

Event OnAnimationEvent(ObjectReference akSource, string asEventName)
if (akSource == Game.GetPlayer()) && (asEventName == "weaponSwing")
Debug.Trace("Cast Spell!") ;This is just so I can see if the script is triggering correctly; hasn't triggered so far
Scepter01.Cast(akSource, self)
endIf
if (akSource == Game.GetPlayer()) && (asEventName == "weaponLeftSwing")
Debug.Trace("Cast Spell!") ;This is just so I can see if the script is triggering correctly; hasn't triggered so far
Scepter01.Cast(akSource, self)
endIf
endEvent

 

 

Posted
It should be working properly. I assume your property is filled and it is a spell that SHOULD be cast on the weapon itself? Because if you attach this script to your weapon (should extend Weapon), you'll be casting the spell on the weapon.
Posted

Attach the script to a quest. Doesn't need any aliases. Make it start game enabled, make a single quest stage and check the "Start Up Stage" box.

 

That's all there is too it.

 

Note you will have to do additional coding if you only want the event to fire if the weapon is currently equipped. Otherwise it's going to fire every time the player swings any weapon.

  • Recently Browsing   0 members

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