"Instant Kill" Script Question

Post » Wed Jun 20, 2012 7:04 am

This is my first attempt to create a script ( or more accurately ) 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 ActiveMagicEffectFaction Property pDA07MehrunesRazorImmuneFaction autoWeapon Property DA07MehrunesRazor AutoEvent 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	EndIfEndEvent


And here's my version:

ScriptName FuryOfAkatoshMagicEffectScript extends ActiveMagicEffectWeapon Property FuryofAkatosh AutoEvent 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	EndIfEndEvent


I just need to know if my version of the script will work properly, and if not, how to correct it. Many thanks in advance.
User avatar
Sandeep Khatkar
 
Posts: 3364
Joined: Wed Jul 18, 2007 11:02 am

Return to V - Skyrim