4
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

34 lines
1003 B

Scriptname defaultSetStageOnCloseBook extends ReferenceAlias
{SCRIPT NAME NO LONGER ACCURATE. This previously waited until the book was closed to set its stage, but was changed to match expected behavior of OnRead event.}
;==============================================
int Property preReqStage = -1 Auto
{OPTIONAL: If set, this stage must have been done to set the StageToSet}
int Property StageToSet Auto
{The stage to set the quest to when I've been read}
;==============================================
auto STATE ready
Event OnActivate(ObjectReference akActionRef)
stageHandling()
EndEvent
Event OnEquipped(Actor akActor)
stageHandling()
endEvent
Event OnRead()
stageHandling()
EndEvent
endSTATE
STATE Done
endSTATE
;==============================================
FUNCTION stageHandling()
If GetOwningQuest().GetCurrentStageID() == preReqStage || preReqStage == -1
; utility.wait(0.1)
GetOwningQuest().SetCurrentStageID(StageToSet)
gotoState("Done")
Endif
endFUNCTION