Controls advanced player interaction with quests in ways that the QuestDef information does not. This file contains all scripting to all quests, if applicable. This system was implemented before Extended Quest Actions and is fairly crude.
Each player in the server will independently run their own instructions from this script.
Quest Scripts augment the base Script Core system. Refer there for basic understanding of labels, conditionals, calls, variables, strings, etc. This document will describe new commands and other things specific to the AI Script subsystem.
Script file. Uses simple commands. Each line may have one command.
Comment character: semicolon (;)
Labels begin with a colon (:) and are required for jumps.
Command parameters must be separated by a space.
Strings for particular commands must be enclosed in quotation marks (Ex: "This is a string").
Command Argument Types
||Is ignored or unused.
||A target for jumps and calls. A label must begin with a colon (:). Example:
||A string constant. Must be enclosed in quotation marks. Example:
"This is a string"
||A plain 4 byte signed integer.
Additional functions available to Quest Scripts.
Display an info message to the player.
info "You found the thing!"
When interacting with an object, this perform a visual ability effect on the object. Must be a valid effect name. Effects are packaged within EarthEternal.car, in the Effects folder.
When interacting with an object, halts execution of the script until the interaction has finished.
; ... other stuff
A somewhat obsolete command. Not recommended for use. When interacting with an object, makes it unusable to further interactions. If the argument is nonzero, it specifies the millisecond delay before the object is considered dead, and will soon be removed from the game and require a respawn.
Remove the interacted NPC object from the server. If attached to a spawner, it will respawn if the SpawnPoint allows it.
End the script if the interacted object's CreatureDef ID does not match this.
Force a SpawnPoint to generate a spawn. Must match the Scenery Object ID of the SpawnPoint.
spawn_at [int:CDefID] [int:PropID]
Force a specific creature to spawn at the location of a Scenery Object ID. The first parameter is the CreatureDef ID to spawn, the second is the Scenery ID. Note that this will use additional parameters of the most recently used setvar
setvar 0 120000 ; Spawn property: duration (milliseconds)
setvar 1 16 ; Spawn property: elevation modifier (for brazier prop)
spawn_at 1144 151056221
Immediately warp the player to the specified Zone ID. The player will appear in the zone's default entrance location.
warp_zone 58 ;warp to Corsica
jmp_cdef [int:CDefID] [label]
Check if the player is interacting with a particular CreatureDef ID. If so, jump to a label in the script. Operates like a goto
jmp_cdef 456 sub_406_456
setvar [int:index] [int:value]
Set an internal variable for use by specific commands. The first integer is an index of the variable. The index must be either 0 or 1. The second integer is the value to give it.
Only used by the spawn_at command.
Technical note: this is part of the old system before Script Core was implemented, but was retained to allow the script file to function as it was without rewriting anything.
Refer to the example provided for the spawn_at command.
Force the player to perform an emote effect. For a list of possible emotes, use the /pose
command in the client.
When the player performs an interaction with a quest object (activate or gather objective) then a specific label string is generated. If the exact label is present in the script, execution will immediately jump to that point.
%1 is the QuestDef ID
%2 is The quest act index (The first act has an index of 0).
Each player runs their own script. Scripts can only perform one command at a time. If a player interrupts an interaction with a new script call, execution will immediately jump to the new call and the old one will not finish.
This script system is admittedly very limited, but manages to fulfill its purpose for the required actions. Some of the commands were hacky solutions to emulate particular requirements of the official quest gameplay.