Script for Setting Stage on Item Dropped, with Prereq Stage?

Post » Thu Dec 13, 2012 1:07 pm

For one of the Quests I have, the PC must make their way to a gravesite, at the end of which they are expected to leave behind a flower. As I am not yet efficient enough in Scripting, I'm hoping someone could explain how it would be done. The current Script I have is an amalgamation of the OnItemRemoved event and the defaultsetstageonplayeracquireitem script; as follows:

Spoiler


Scriptname JFDFlowerScript extends ObjectReference

Ingredient Property Flower Auto
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 drops this item.}

auto State waiting
Event OnItemRemoved(Form Flower, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)
if ( (preReqStage == -1) || (myQST.GetStageDone(preReqStage) == True) )
myQST.SetStage(stageToSet)
GoToState("inactive")
endif
EndEvent
EndState

State inactive
EndState

Int Property ItemCount Auto


I did not expect this Script to work exactly, but as it didn't return any errors upon compiling I'm at a loss for how to proceed. Any help will be greatly appreciated. Thanks.
User avatar
Floor Punch
 
Posts: 3568
Joined: Tue May 29, 2007 7:18 am

Return to V - Skyrim