Scriptname nDragonMechElectroScript extends activemagiceffect  

import utility

actor me
bool isready=true
float fBase=15.0

Event OnEffectStart(Actor akTarget, Actor akCaster)
	me = akCaster
Endevent

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \
  bool abBashAttack, bool abHitBlocked)
	if isready
		If RandomFloat(0.0, 100.0) <= fBase
			isready = false
			xHarm.cast(me)
			RegisterForSingleUpdate(1.0)
		Endif
	Endif
Endevent

Event OnUpdate()
	isready = true
Endevent

Spell Property xHarm  Auto  