Jump to content

"Instant Kill" Script Question


Lazarus187

Recommended Posts

This is my first attempt to modify an existing script for a custom sword. Basically, I'm simply trying to duplicate the "instant kill" effect of Mehrunes' Razor, minus the faction immunity ( e.g. works on everything ). Here's the original script:

 

ScriptName DA07MehrunesRazorMagicEffectScript extends ActiveMagicEffect

Faction Property pDA07MehrunesRazorImmuneFaction auto
Weapon Property DA07MehrunesRazor Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)

;Apply this effect if the target is not in the excluded faction
If akTarget.IsInFaction(pDA07MehrunesRazorImmuneFaction) == 1
	Return
Else
	; 1 percent chance to kill target
;		 debug.trace(self + " hitting " + akTarget + " with Mehrunes' Razor")
	If (Utility.RandomInt() <= 1)
;			 debug.trace(self + "Instant Kill effect applied on" + akTarget)
		If Game.GetPlayer().GetItemCount(DA07MehrunesRazor) >= 1
			akTarget.Kill(Game.GetPlayer())
		Else
			akTarget.Kill()
		EndIf
	EndIf
EndIf

EndEvent

 

And here's my version:

 

ScriptName FuryOfAkatoshMagicEffectScript extends ActiveMagicEffect

Weapon Property FuryofAkatosh Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
 
	; 4 percent chance to kill target
;		 debug.trace(self + " hitting " + akTarget + " with Fury' of Akatosh")
	If (Utility.RandomInt() <= 4)
;			 debug.trace(self + "Instant Kill effect applied on" + akTarget)
		If Game.GetPlayer().GetItemCount(FuryofAkatosh) >= 4
			akTarget.Kill(Game.GetPlayer())
		Else
			akTarget.Kill()
		EndIf
	EndIf
EndEvent

 

My script compiles without any issues, but when I use the sword in game, there dosen't seem to be any discernable effect, even if I change the % chance to kill the target to 100%. Anyone know where I went wrong?

Edited by Lazarus187
Link to comment
Share on other sites

  • 4 weeks later...
  • Recently Browsing   0 members

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