Scriptname __LALLSetStageOnItemXferScript extends ReferenceAlias
{Attach to an item in a reference alias. Changes stage when player picks up item}

Actor Property PlayerRef Auto
Quest Property QuestToCheck Auto
Quest Property QuestToSet Auto
Int Property StageMin Auto
Int Property StageMax Auto
Int Property StageToSet Auto




Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
if akNewContainer == PlayerRef
SetQuestStage()
endif
EndEvent


Function SetQuestStage()
int stage = QuestToCheck.GetStage()
if stage >= StageMin && stage <= StageMax
QuestToSet.SetStage(StageToSet)
endif
EndFunction