Mod:Creation Kit/Quest Script

Extends: Mod:Creation Kit/Form Script  Editor: Mod:Creation Kit/Quest

Script for the manipulation of quests.

Definition
ScriptName Quest extends Form Native Hidden

Properties
None

Structs

 * Simple struct that holds a quest and a stage number

Global Functions

 * Function SetQuestStage(QuestStage questStageToSet)
 * Sets a quest stage on the specified quest.
 * bool Function GetQuestStageDone(QuestStage questStageToCheck)
 * Checks to see if the specified stage is done.

Member Functions

 * Function CompleteAllObjectives
 * Completes all a quests objectives.
 * Function CompleteQuest
 * Flags this quest as completed.
 * Function FailAllObjectives
 * Flags all quest objects as failed.
 * Alias Function GetAlias(int aiAliasID)
 * Obtains the Alias attached to this quest associated with the specified ID.
 * int Function GetCurrentStageID
 * Obtains the highest completed stage on this quest.
 * int Function GetStage
 * Alias for GetCurrentStageID.
 * bool Function HasObjective(int aiObjective)
 * Returns whether or not this quest has the given objective.
 * bool Function GetStageDone(int aiStage)
 * Alias for IsStageDone.
 * bool Function IsActive
 * Is this quest "active"? (Tracked by the player).
 * bool Function IsCompleted
 * Returns whether this quest is completed or not.
 * bool Function IsObjectiveCompleted(int aiObjective)
 * Obtains whether the specified objective is completed or not.
 * bool Function IsObjectiveDisplayed(int aiObjective)
 * Obtains whether the specified objective is displayed or not.
 * bool Function IsObjectiveFailed(int aiObjective)
 * Obtains whether the specified objective is failed or not.
 * bool Function IsRunning
 * Returns whether this quest is currently running or not.
 * bool Function IsStageDone(int aiStage)
 * Checks to see if the specified stage is done or not.
 * bool Function IsStarting
 * Returns whether this quest is currently enabled but not running yet.
 * bool Function IsStopping
 * Returns whether this quest is currently not enabled anymore but still shutting down.
 * bool Function IsStopped
 * Returns whether this quest is currently fully stopped.
 * bool Function ModObjectiveGlobal(float afModValue, GlobalVariable aModGlobal, int aiObjectiveID, float afTargetValue, bool abCountingUp, bool abCompleteObjective, bool abRedisplayObjective, bool abAllowRollbackObjective)
 * 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.
 * Function Reset
 * Resets this quest.
 * Function ResetSpeechChallenges
 * Resets all speech challenges in player dialogue scenes for this quest.
 * Function SetActive(bool abActive)
 * Sets or clears this quest as "active". (Tracked by the player)
 * bool Function SetCurrentStageID(int aiStageID)
 * Sets the quest to the requested stage, returning true if it succeeded.
 * Function SetObjectiveCompleted(int aiObjective, bool abCompleted)
 * Sets whether the specified objective is completed or not.
 * Function SetObjectiveDisplayed(int aiObjective, bool abDisplayed)
 * Sets whether the specified objective is displayed or not.
 * Function SetObjectiveFailed(int aiObjective, bool abFailed)
 * Sets whether the specified objective is failed or not.
 * Function SetObjectiveSkipped(int aiObjective)
 * Flags the objective as skipped
 * bool Function SetStage(int aiStage)
 * Alias of SetCurrentStageID.
 * bool Function Start
 * Starts this quest.
 * Function Stop
 * Stops the quest.
 * bool Function UpdateCurrentInstanceGlobal(GlobalVariable aUpdateGlobal)
 * Updates the value for the given global for the quest's current instance.

Events

 * Event OnQuestInit
 * Event received when this quest has just started up - after aliases are filled, and at the same time as the quest startup stage is run.
 * Event OnQuestShutdown
 * Event received when this quest has shut down (aliases are cleared at this time).
 * Event 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!).
 * Event OnStageSet(int auiStageID, int auiItemID)
 * Event received when a quest stage is set (runs in parallel with the fragment).

These events are fired in parallel with the quest's startup stage, and are only fired if this quest is started by a story manager event.
 * Event OnStoryActivateActor]Location akLocation, ObjectReference akActor)
 * Sent when this quest is started by an activate actor story manager event.
 * Event OnStoryActorAttach(ObjectReference akActor, Location akLocation)
 * Sent when this quest is started by an actor attach story manager event.
 * 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.
 * Event OnStoryArrest(ObjectReference akArrestingGuard, ObjectReference akCriminal, Location akLocation, int aiCrime)
 * Sent when this quest is started by an arrest story manager event.
 * Event OnStoryAssaultActor(ObjectReference akVictim, ObjectReference akAttacker, Location akLocation, int aiCrime)
 * Sent when this quest is started by an assault actor story manager event.
 * Event OnStoryAttractionObject(ObjectReference akActor, ObjectReference akObject, Location akLocation, bool abCommanded)
 * Sent when the quest is started by an actor detecting an attraction object
 * Event OnStoryBribeNPC(ObjectReference akActor)
 * Sent when this quest is started by a bribe NPC story manager event.
 * Event OnStoryCastMagic(ObjectReference akCastingActor, ObjectReference akSpellTarget, Location akLocation, Form akSpell)
 * Sent when this quest is started by a cast magic story manager event.
 * Event OnStoryChangeLocation(ObjectReference akActor, Location akOldLocation, Location akNewLocation)
 * Sent when this quest is started by a change location story manager event.
 * Event OnStoryClearLocation(Location akLocation)
 * Sent when this quest is started by a clear location story manager event.
 * Event OnStoryCraftItem(ObjectReference akBench, Location akLocation, Form akCreatedItem)
 * Sent when this quest is started by a craft item story manager event.
 * 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.
 * Event OnStoryCure(Form akInfection)
 * Sent when this quest is started by a cure story manager event.
 * Event OnStoryDialogue(Location akLocation, ObjectReference akActor1, ObjectReference akActor2)
 * Sent when this quest is started by a dialogue story manager event.
 * Event OnStoryDiscoverDeadBody(ObjectReference akActor, ObjectReference akDeadActor, Location akLocation)
 * Sent when this quest is started by a discover dead body story manager event.
 * Event OnStoryEscapeJail(Location akLocation, Form akCrimeGroup)
 * Sent when this quest is started by an escape jail story manager event.
 * Event OnStoryFlatterNPC(ObjectReference akActor)
 * Sent when this quest is started by a flatter NPC story manager event.
 * Event OnStoryHackTerminal(ObjectReference akComputer, bool abSucceeded)
 * Sent when this quest is started by a hack terminal story manager event.
 * Event OnStoryHello(Location akLocation, ObjectReference akActor1, ObjectReference akActor2)
 * Sent when this quest is started by a hello story manager event.
 * Event OnStoryIncreaseLevel(int aiNewLevel)
 * Sent when this quest is started by an increase level story manager event.
 * Event OnStoryInfection(ObjectReference akTransmittingActor, Form akInfection)
 * Sent when this quest is started by an infection story manager event.
 * Event OnStoryIntimidateNPC(ObjectReference akActor)
 * Sent when this quest is started by an intimidate NPC story manager event.
 * Event OnStoryIronSights(ObjectReference akActor, Form akWeapon)
 * Sent when this quest is started by an iron sights story manager event.
 * Event OnStoryJail(ObjectReference akGuard, Form akCrimeGroup, Location akLocation, int aiCrimeGold)
 * Sent when this quest is started by a jail story manager event.
 * 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.
 * Event OnStoryLocationLoaded(Location akLocation)
 * Sent when this quest is started by a Location Loaded story manager event.
 * Event OnStoryMineExplosion(ObjectReference akVictim, ObjectReference akAttacker)
 * Sent when this quest is started by a mine explosion.
 * Event OnStoryNewVoicePower(ObjectReference akActor, Form akVoicePower)
 * Sent when this quest is started by a new voice power story manager event.
 * Event OnStoryPickLock(ObjectReference akActor, ObjectReference akLock)
 * Sent when this quest is started by a pick lock story manager event.
 * Event OnStoryPickPocket(ObjectReference akVictim, bool abSuccess)
 * Sent when this quest is started by a pickpocket story manager event.
 * Event OnStoryPayFine(ObjectReference akCriminal, ObjectReference akGuard, Form akCrimeGroup, int aiCrimeGold)
 * Sent when this quest is started by a pay fine story manager event.
 * Event OnStoryPlayerGetsFavor(ObjectReference akActor)
 * Sent when this quest is started by a player gets favor story manager event.
 * Event OnStoryRelationshipChange(ObjectReference akActor1, ObjectReference akActor2, int aiOldRelationship, int aiNewRelationship)
 * Sent when this quest is started by a relationship change story manager event.
 * 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.
 * 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.
 * Event OnStoryServedTime(Location akLocation, Form akCrimeGroup, int aiCrimeGold, int aiDaysJail)
 * Sent when this quest is started by a served time story manager event.
 * Event OnStoryTrespass(ObjectReference akVictim, ObjectReference akTrespasser, Location akLocation, int aiCrime)
 * Sent when this quest is started by a trespass story manager event.

Related Fragments

 * Mod:Creation Kit/Quest Stage Fragments