Quest Script

From the CreationKit Wiki
Revision as of 21:13, 25 October 2013 by imported>CraftySentinel (Added SKSE Global/Local Functions.)
Jump to navigation Jump to search


Extends: Form Script

Script for the manipulation of quests.

Definition

ScriptName Quest extends Form

Member Functions

Function Description
CompleteAllObjectives() Completes all a quests objectives.
CompleteQuest() Flags this quest as completed.
FailAllObjectives() Flags all quest objects as failed.
Alias GetAlias(Int aiAliasID) Obtains the Alias attached to this quest associated with the specified ID.
Int GetCurrentStageID() Obtains the highest completed stage on this quest.
Int GetCurrentStageID() Alias for GetCurrentStageID().
Bool IsStageDone(Int aiStage) Alias for IsStageDone().
Bool IsActive() Is this quest "active"? (Tracked by the player).
Bool IsCompleted() Returns whether this quest is completed or not.
Bool IsObjectiveCompleted(Int aiObjective) Obtains whether the specified objective is completed or not.
Bool IsObjectiveDisplayed(Int aiObjective) Obtains whether the specified objective is displayed or not.
Bool IsObjectiveFailed(Int aiObjective) Obtains whether the specified objective is failed or not.
Bool IsRunning() Returns whether this quest is currently running or not.
Bool IsStageDone(Int aiStage) Checks to see if the specified stage is done or not.
Bool IsStarting() Returns whether this quest is currently enabled but not running yet.
Bool IsStopping-() Returns whether this quest is currently not enabled anymore but still shutting down.
Bool IsStopped-() Returns whether this quest is currently fully stopped.
Bool ModObjectiveGlobal(Float afModValue, GlobalVariable aModGlobal, Int aiObjectiveID, Float afTargetValue, Bool abCountingUp, Bool abCompleteObjective, Bool abRedisplayObjective) Mods a global variable in a threadsafe way. Optional parameters allow automatic redisplay and completion (or failure) of a quest objective using this global variable.
Reset() Resets this quest.
SetActive(Bool abActive) Sets or clears this quest as "active". (Tracked by the player)
Bool SetCurrentStageID(Int aiStageID) Sets the quest to the requested stage, returning true if it succeeded.
SetObjectiveCompleted(Int aiObjective, Bool abCompleted) Sets whether the specified objective is completed or not.
SetObjectiveDisplayed(Int aiObjective, Bool abDisplayed) Sets whether the specified objective is displayed or not.
SetObjectiveFailed(Int aiObjective, Bool abFailed) Sets whether the specified objective is failed or not.
Bool SetCurrentStageID(Int aiStage) Alias of SetCurrentStageID().
Bool Start() Starts this quest.
Stop() Stops the quest.
Bool UpdateCurrentInstanceGlobal(GlobalVariable aUpdateGlobal) Updates the value for the given global for the quest's current instance.

SKSE Global Functions

Function Description
Quest GetQuest(String editorID) Returns the Quest with the specified editor id.

SKSE Functions

Function Description
String GetID() Returns the editor ID of the Quest.
Int GetPriority() Returns the priority of the Quest.
Int GetNumAliases() Returns the number of aliases associated with the Quest.
Alias 'GetNthAlias(Int index) Returns the specified alias associated with the Quest.
Alias 'GetAliasByName(String name) Returns the editor ID of the quest.

Events

Function Description
OnReset() Event received when this quest is started up (either the first time or subsequent times - this will fire in parallel with your startup stage!).
OnStoryActivateActor(Location akLocation, ObjectReference akActor) Sent when this quest is started by an activate actor story manager event.
OnStoryAddToPlayer(ObjectReference akOwner, ObjectReference akContainer, Location akLocation, Form akItemBase, Int aiAcquireType) Sent when this quest is started by an add to player story manager event.
OnStoryArrest(ObjectReference akArrestingGuard, ObjectReference akCriminal, Location akLocation, Int aiCrime) Sent when this quest is started by an arrest story manager event.
OnStoryAssaultActor(ObjectReference akVictim, ObjectReference akAttacker, Location akLocation, Int aiCrime) Sent when this quest is started by an assault actor story manager event.
OnStoryBribeNPC(ObjectReference akActor) Sent when this quest is started by a bribe NPC story manager event.
OnStoryCastMagic(ObjectReference akCastingActor, ObjectReference akSpellTarget, Location akLocation, Form akSpell) Sent when this quest is started by a cast magic story manager event.
OnStoryChangeLocation(ObjectReference akActor, Location akOldLocation, Location akNewLocation) Sent when this quest is started by a change location story manager event.
OnStoryCraftItem(ObjectReference akBench, Location akLocation, Form akCreatedItem) Sent when this quest is started by a craft item story manager event.
OnStoryCrimeGold(ObjectReference akVictim, ObjectReference akCriminal, Faction akFaction, Int aiGoldAmount, Int aiCrime) Sent when this quest is started by a crime gold story manager event.
OnStoryCure(Form akInfection) Sent when this quest is started by a cure story manager event.
OnStoryDialogue(Location akLocation, ObjectReference akActor1, ObjectReference akActor2) Sent when this quest is started by a dialogue story manager event.
OnStoryDiscoverDeadBody(ObjectReference akActor, ObjectReference akDeadActor, Location akLocation) Sent when this quest is started by a discover dead body story manager event.
OnStoryEscapeJail(Location akLocation, Form akCrimeGroup) Sent when this quest is started by an escape jail story manager event.
OnStoryFlatterNPC(ObjectReference akActor) Sent when this quest is started by a flatter NPC story manager event.
OnStoryHello(Location akLocation, ObjectReference akActor1, ObjectReference akActor2) Sent when this quest is started by a hello story manager event.
OnStoryIncreaseLevel(Int aiNewLevel) Sent when this quest is started by an increase level story manager event.
OnStoryIncreaseSkill(String asSkill) Sent when this quest is started by an increase skill story manager event.
OnStoryInfection(ObjectReference akTransmittingActor, Form akInfection) Sent when this quest is started by an infection story manager event.
OnStoryIntimidateNPC(ObjectReference akActor) Sent when this quest is started by an intimidate NPC story manager event.
OnStoryJail(ObjectReference akGuard, Form akCrimeGroup, Location akLocation, Int aiCrimeGold) Sent when this quest is started by a jail story manager event.
OnStoryKillActor(ObjectReference akVictim, ObjectReference akKiller, Location akLocation, Int aiCrimeStatus, Int aiRelationshipRank) Sent when this quest is started by a kill actor story manager event.
OnStoryNewVoicePower(ObjectReference akActor, Form akVoicePower) Sent when this quest is started by a new voice power story manager event.
OnStoryPickLock(ObjectReference akActor, ObjectReference akLock) Sent when this quest is started by a pick lock story manager event.
OnStoryPayFine(ObjectReference akCriminal, ObjectReference akGuard, Form akCrimeGroup, Int aiCrimeGold) Sent when this quest is started by a pay fine story manager event.
OnStoryPlayerGetsFavor(ObjectReference akActor) Sent when this quest is started by a player gets favor story manager event.
OnStoryRelationshipChange(ObjectReference akActor1, ObjectReference akActor2, Int aiOldRelationship, Int aiNewRelationship) Sent when this quest is started by a relationship change story manager event.
OnStoryRemoveFromPlayer(ObjectReference akOwner, ObjectReference akItem, Location akLocation, Form akItembase, Int aiRemoveType) Sent when this quest is started by a remove from player story manager event.
OnStoryScript(Keyword akKeyword, Location akLocation, ObjectReference akRef1, ObjectReference akRef2, Int aiValue1, Int aiValue2) Sent when this quest is started by a script story manager event.
OnStoryServedTime(Location akLocation, Form akCrimeGroup, Int aiCrimeGold, Int aiDaysJail) Sent when this quest is started by a served time story manager event.
OnStoryTrespass(ObjectReference akVictim, ObjectReference akTrespasser, Location akLocation, Int aiCrime) Sent when this quest is started by a trespass story manager event.

Related Fragments