Lazarus187 Posted May 28, 2012 Share Posted May 28, 2012 (edited) 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 May 28, 2012 by Lazarus187 Link to comment Share on other sites More sharing options...
hfyvhtbg Posted June 20, 2012 Share Posted June 20, 2012 I copied yours and did almost the same thing except i left " If Game.GetPlayer().GetItemCount(FuryofAkatosh) >= 4" at 1 instead of 4 but that left me with 100% chance to kill instead of my desired 10%. thought it might help. Link to comment Share on other sites More sharing options...
Recommended Posts