Jump to content

Need some help with a simple weapon script


Recommended Posts

Posted (edited)
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
Posted (edited)

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
Posted
Thank you very much ! I never got the hang of scripting in Oblivion, so its always frustrating for me. Gonna give this a try.
  • Recently Browsing   0 members

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