Scriptname aaaTKCPushawayscript extends activemagiceffect  

Activator Property FXEmptyActivator Auto
Spell Property ThunderBolt Auto
Spell Property PushResistSpell Auto
MagicEffect Property MarkPushResist Auto

Sound Property ThunderSound Auto
ObjectReference StartBox
float Height
bool property bThunder auto

Event OnEffectStart (Actor akTarget, Actor akCaster)

	if akTarget.IsInInterior()
		Height = 250
	else
		Height = 500
	endif

	StartBox = akTarget.placeAtMe(FXEmptyActivator)

 	if !akTarget.HasMagicEffect(MarkPushResist)
		StartBox.PushActorAway(akTarget, 15)
		PushResistSpell.Cast(akTarget,akTarget)
	endif
	if bThunder
		Utility.Wait(0.6)
		StartBox.moveto(akTarget,0,0, Height)	
		Utility.Wait(0.01)
		ThunderBolt.RemoteCast(StartBox,akCaster,akTarget)
		ThunderSound.Play(akTarget)
	endif
	StartBox.Delete()

EndEvent