Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/doc/lua/quest.md
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 14:33:09 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 14:33:09 +1000
commit6352e8e3196f78388b6c771073f9e03eaa612673 (patch)
treee23772f79a7fbc41bc9108951e9e136857484bf4 /doc/lua/quest.md
parent6741a057e5639280d85d0f88ba26f000baa58f61 (diff)
everything everywhere
all at once
Diffstat (limited to 'doc/lua/quest.md')
-rw-r--r--doc/lua/quest.md203
1 files changed, 203 insertions, 0 deletions
diff --git a/doc/lua/quest.md b/doc/lua/quest.md
new file mode 100644
index 0000000..68010c0
--- /dev/null
+++ b/doc/lua/quest.md
@@ -0,0 +1,203 @@
+# quest
+
+The `quest` table contains functions relating directly to the quest whose script its run in.
+
+---
+
+#### `String` quest.state()
+
+Returns the current state of the quest.
+
+Possible states:
+* "New"
+* "Offer"
+* "Active"
+* "Complete"
+* "Failed"
+
+---
+
+#### `void` quest.complete()
+
+Immediately completes the quest.
+
+---
+
+#### `void` quest.fail()
+
+Immediately fails the quest.
+
+---
+
+#### `void` quest.setCanTurnIn(`bool` turnIn)
+
+Sets whether the quest can be turned in.
+
+---
+
+#### `String` quest.questId()
+
+Returns the quest id.
+
+---
+
+#### `String` quest.templateId()
+
+Returns the ID of the template used to make this quest.
+
+---
+
+#### `uint64_t` quest.seed()
+
+Returns the seed used to generate the quest.
+
+---
+
+#### `Json` quest.questDescriptor()
+
+Returns the quest descriptor including parameters.
+
+---
+
+#### `Json` quest.questArcDescriptor()
+
+Returns the quest arc descriptor.
+
+---
+
+#### `Vec2F` quest.questArcPosition()
+
+Returns the quest arc position. (?)
+
+---
+
+#### `String` quest.worldId()
+
+Returns the world id for the quest arc.
+
+---
+
+#### `String` quest.serverUuid()
+
+Returns the server uuid for the quest.
+
+---
+
+#### `QuestParameters` quest.parameters()
+
+Returns all quest parameters.
+
+---
+
+#### `void` quest.setParameter(`String` name, `Json` value)
+
+Sets a quest parameter.
+
+---
+
+#### `void` quest.setIndicators(`List<String>` indicators)
+
+Set a list of quest parameters to use as custom indicators.
+
+Example:
+```
+-- define indicators
+local entityIndicator = {
+ type = "entity",
+ uniqueId = "techscientist"
+}
+local itemIndicator = {
+ type = "item",
+ item = "perfectlygenericitem"
+}
+local itemTagIndicator = {
+ type = "itemTag",
+ tag = "weapon"
+}
+local itemListIndicator = {
+ type = "itemList",
+ items = [ "perfectlygenericitem", "standingturret" ]
+}
+local monsterTypeIndicator = {
+ type = "monsterType",
+ typeName = "peblit"
+}
+
+-- set quest parameters for the indicators
+quest.setParameter("entity", entityIndicator)
+quest.setParameter("item", itemIndicator)
+quest.setParameter("itemTag", itemTagIndicator)
+quest.setParameter("itemList", itemListIndicator)
+quest.setParameter("monsterType", monsterTypeIndicator)
+
+-- add the set quest parameters to the indicators list
+quest.setIndicators({"entity", "item", "itemTag", "itemList", "monsterType"})
+```
+
+---
+
+#### `void` quest.setObjectiveList(`JsonArray` objectives)
+
+Set the objectives for the quest tracker. Objectives are in the format {text, completed}
+
+Example:
+```lua
+quest.setObjectiveList({
+ {"Gather 4 cotton", true},
+ {"Eat 2 cotton", false}
+})
+```
+
+---
+
+#### `void` quest.setProgress(`float` progress)
+
+Sets the progress amount of the quest tracker progress bar. Set nil to hide. Progress is from 0.0 to 1.0.
+
+---
+
+#### `void` quest.setCompassDirection(`float` angle)
+
+Set the angle of the quest tracker compass. Setting nil hides the compass.
+
+---
+
+#### `void` quest.setTitle(`String` title)
+
+Sets the title of the quest in the quest log.
+
+---
+
+#### `void` quest.setText(`String` text)
+
+Set the text for the quest in the quest log.
+
+---
+
+#### `void` quest.setCompletionText(`String` completionText)
+
+Sets the text shown in the completion window when the quest is completed.
+
+---
+
+#### `void` quest.setFailureText(`String` failureText)
+
+Sets the text shown in the completion window when the quest is failed.
+
+---
+
+#### `void` quest.setPortrait(`String` portraitName, `JsonArray` portrait)
+
+Sets a portrait to a list of drawables.
+
+---
+
+#### `void` quest.setPortraitTitle(`String` portraitName, `String` title)
+
+Sets a portrait title.
+
+---
+
+#### `void` quest.addReward(`ItemDescriptor` reward)
+
+Add an item to the reward pool. \ No newline at end of file