Jump to content

Need some help with a simple weapon script


onson

Recommended Posts

I'm trying to make a shiv that deals x6 sneak attack damage. I've created the shiv, and found how to add a script, but I'm having trouble figuring out how to add my desired effect. Basically I need a script effect on the weapon that does what the Assassins Blade or Backstab perk does. I can achieve this with an enchantment but would rather have it scripted to the weapon. The weapon is designed to do little damage in 1 on 1 combat, but major damage to unsuspecting enemies who are standing in the lunchline. One thing is I think when I attack someone , the perk is being applied to them, not me. So I guess I need the effect to apply to my character when he draws the weapon instead of using it? Edited by onson
Link to comment
Share on other sites

You could make a new perk hidden from the player that copies exactly what the BackStab perk does. Then you script the dagger to add the new perk to the player whenever it's equipped:

 

Perk property BackStab auto
Perk property CustomPerk auto

Event OnEquipped(Actor akActor)

if (akActor.HasPerk(BackStab))
	;do nothing, unless you want the dagger's effect to be added to the regular perk, for x12 damage!
else
	akActor.AddPerk(CustomPerk)
endif

EndEvent

Event OnUnequipped(Actor akActor)

akActor.RemovePerk(CustomPerk)

EndEvent

Edited by fg109
Link to comment
Share on other sites

  • Recently Browsing   0 members

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