Scriptname aaUCSummonGhostlyMerchantScript extends activemagiceffect  
{Script for summoning the ghostly merchant}



ObjectReference Property aaUCSummonedMerchantRef  Auto
{The merch}

ObjectReference Property aaUCSummonMerchantMarkerREF  Auto 
{The marker}

ObjectReference property GhostiesContainer auto
{Ghosties chest}

EffectShader Property ConjureEffect  Auto
{Conjure effect shader}

ImageSpaceModifier property ConjureImageSpace Auto
{Conjure Imagespace}



Event OnEffectStart(actor akTarget, actor akCaster)

	(aaUCSummonedMerchantRef as actor).StopCombat()
	aaUCSummonedMerchantRef.Moveto(game.GetPlayer())
	ConjureImageSpace.Apply()
	ConjureEffect.Play(aaUCSummonedMerchantRef, 1)

EndEvent

Event OnEffectFinish(actor akTarget, actor akCaster)

	ConjureEffect.Play(aaUCSummonedMerchantRef, 1)
	aaUCSummonedMerchantRef.Disable(true)
	GhostiesContainer.Reset()
	utility.wait(1)	
	aaUCSummonedMerchantRef.MoveTo(aaUCSummonMerchantMarkerREF)
	(aaUCSummonedMerchantRef as actor).StopCombat()
	aaUCSummonedMerchantRef.Enable()

EndEvent