Scriptname ZazReffect1Script extends activemagiceffect  

ZazRquestScript Property FNISquest Auto
Message property SelectionMSG Auto
Message property Group1MSG Auto
Message property Group2MSG Auto
Message property Group3MSG Auto
Message property Group4MSG Auto

Bool OneMoreDisplay

EVENT OnEffectStart(Actor akTarget, Actor akCaster)
	Utility.Wait(1)

	OneMoreDisplay = True
	While OneMoreDisplay
		OneMoreDisplay = DisplayMessage()
	EndWhile
ENDEVENT

Bool Function DisplayMessage()
Int i
Bool OneMore
	OneMore = false 
	if ( FNISquest.CurrentGroup == 1 )
		i = Group1MSG.Show()
		if ( i <= 8 )
			FNISquest.NextIdle = i
		else
			FNISquest.CurrentGroup = 0
			OneMore = true
		endif
	elseif ( FNISquest.CurrentGroup == 2 )
		i = Group2MSG.Show()
		if ( i <= 8 )
			FNISquest.NextIdle = i + 9
		else
			FNISquest.CurrentGroup = 0
			OneMore = true
		endif
	elseif ( FNISquest.CurrentGroup == 3 )
		i = Group3MSG.Show()
		if ( i <= 8 )
			FNISquest.NextIdle = i + 18
		else
			FNISquest.CurrentGroup = 0
			OneMore = true
		endif
	elseif ( FNISquest.CurrentGroup == 4 )
		i = Group4MSG.Show()
		if ( i <= 8 )
			FNISquest.NextIdle = i + 27
		else
			FNISquest.CurrentGroup = 0
			OneMore = true
		endif
	elseif ( FNISquest.CurrentGroup == 0 )
		i = SelectionMSG.Show()
		if ( i <= 3 )
			FNISquest.CurrentGroup = i + 1
			OneMore = true
		else
			FNISquest.CurrentGroup = 0
		endif
	endif

	return OneMore

Endfunction

