A paralysis script.

Post » Thu Dec 08, 2011 12:20 pm

I don't know where to begin with this.

The idea is to have a constant effect on my armor, where if the mobs touch/hit me, they get paralyzed.
User avatar
Dalley hussain
 
Posts: 3480
Joined: Sun Jun 18, 2006 2:45 am

Post » Wed Dec 07, 2011 10:31 pm

Hard to do without OBSE, here is my idea:
Instead of having the script on the enchantment of the armor, consider placing the script on the armor itself. Magic effect scripts don't run well on constant effect enchantments.

The script on the armor would look like this
scn armorScriptBegin OnEquip PlayerSetEventHandler "OnHit" myFunctionScript ref::PlayerRefEndBegin OnUnequip PlayerRemoveEventHandler "OnHit" myFunctionScript ref::PlayerRefEndBegin OnDrop PlayerRemoveEventHandler "OnHit" myFunctionScript ref::PlayerRefEnd


myFunctionScript can be called however you like, it has to be an object-type script that will be called whenever someone hits you, the PlayerRef
Paralyzing them could be tricky, you need some way to control how long they remain paralyzed. Consider using a token (myToken), a non playable piece of clothing with no attributes like weight, cost, etc with a script for that.

scn myFunctionScriptref targetref attackerBegin Function{target, attacker}attacker.AddItemNS myToken 1End


And the script on the token would be like:
scn myTokenScriptref selffloat timerBegin GameModeIf self != GetContainerLet self := GetContainerReturnElseIf timer == 0let timer := 0.1self.ModAVMod Paralysis max 1EndIfIf timer < 3    ;change 3 to the amount of time you want them paralyzedlet timer += GetSecondsPassedelseself.ModAVMod Paralysis max -1RemoveMeEndIfEnd

User avatar
MarilĂș
 
Posts: 3449
Joined: Sat Oct 07, 2006 7:17 am

Post » Thu Dec 08, 2011 3:07 am

I almost forgot about this. Thanks for taking the time to post that. I'll be trying it out.
User avatar
suzan
 
Posts: 3329
Joined: Mon Jul 17, 2006 5:32 pm


Return to IV - Oblivion