enderalse/source/scripts/defaultsetstageonplayeracquireitem.psc

25 lines
976 B
Plaintext

Scriptname defaultSetStageOnPlayerAcquireItem extends ObjectReference
{Sets a quest stage when this item is put in the player's inventory.}
Quest Property myQST auto
{Quest upon which to set stage. Default is the Alias's owning quest.}
int Property preReqStage = -1 auto
{(Optional)Stage that must be set for this script to run. Default: NONE}
int Property StageToSet auto
{Set this stage when the player picks up this item.}
auto State waiting
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
if ((Game.GetForm(0x14) as Actor) == akNewContainer)
;USKP 2.0.5 - Added check to make sure quest is running if preReq is not -1. Best we can do here to reduce errors without breaking full functionality.
if ( (preReqStage == -1) || ( (myQST.IsStageDone(preReqStage) == True) && myQST.IsRunning() ) )
myQST.SetCurrentStageID(stageToSet)
GoToState("inactive")
endif
endif
EndEvent
EndState
State inactive
EndState