# quest.txt format

quest.txt is a text data file residing in the NetHack source dat-directory. It contains text messages for the quest leaders, nemeses and guardians to say, and other texts related to the quests. It also contains angelic and demonic maledictions. 

List of quest messages

Number

In-code name

Description

00001

QT_FIRSTTIME

The message that is displayed the first time you pass through the magic portal to the quest branch.

00002

QT_NEXTTIME

The message that is subsequently displayed each time you reenter the quest branch, until you obtain the quest artifact, or are expelled.

00003

QT_OTHERTIME

The message that is displayed if you enter the quest after having failed the alignment test too many times.  This is an indication that the next time you meet your quest leader, you will be expelled from the quest and the portal to the branch will disappear.

00005 - 00009

QT_GUARDTALK

"5 random things guards say before quest".  The five messages that quest guardians can say if you #chat to them before you have retrieved the quest artifact.

00010 - 00014

QT_GUARDTALK2

"5 random things guards say after quest".  The five messages that quest guardians can say after you have obtained the quest artifact.

00015

QT_FIRSTLEADER

This message appears the first time you meet your quest leader.  It is followed by a second one indicating if you have permission to embark on the quest, and, if not, the reason for your rejection.

00016

QT_NEXTLEADER

Later greetings from your quest leader.  As with #00015, this is followed up by a second message indicating whether you are ready to go on the quest or not.

00017

QT_OTHERLEADER

This message is not used in the current version of NetHack.  It appears to be an alternative to #00016, perhaps used if the player has enough experience but has not passed the alignment test.  At present, #00016 is used regardless of the reason for not allowing the player to proceed.

00018

QT_LASTLEADER

This is what your quest leader says when you are permanently expelled from the quest for failing the alignment test too many times.  It is immediately followed by your expulsion to the Dungeons of Doom and the removal of the portal leading to the quest branch.

00019

QT_BADLEVEL

This is what your quest leader says when you are rejected due to inexperience.  The quest leader says that you are not experienced enough to face the nemesis, and sends you back to the Dungeons of Doom to continue your training.  In some quests the leader is helpful enough to tell you the name of the minimum rank you need (always corresponding to levels 14–17) to embark on the quest.

00020

QT_BADALIGN

This is what your quest leader says when you are rejected due to less than pious alignment.  Often includes a reference to your starting alignment to hint at what monsters you should kill or what actions you can take to reach an acceptable alignment.  Following this, you are sent back to the Dungeons of Doom, but the portal to the quest branch is not removed, so you can return and try again.

00021

QT_ASSIGNQUEST

This is what your leader says when finally assigning you the quest.  One of the longer pieces of text, this tends to provide some backstory to the quest and gives the names of the quest artifact, the quest nemesis, and often the nemesis's in-story place of residence.

00025 - 00034

QT_ENCOURAGE

Until you complete the quest, chatting with or standing beside your quest leader will return one of these ten messages.  Often these are just for flavor, but sometimes these include hints about how to find or defeat the quest nemesis.

00035

QT_FIRSTLOCATE

This message is displayed the first time you reach the intermediate or "locate" level of the quest.  Often it just provides flavor, but sometimes it hints at special dangers on the level.

00036

QT_NEXTLOCATE

This is the message that is displayed each time you return to the locate level, until the nemesis is killed.

00040

QT_FIRSTACQUIRE

This message is displayed the first time you reach the final level of the quest branch, the one on which you first meet the quest nemesis.

00041

QT_NEXTACQUIRE

This message is displayed each time you return to the goal level, until the nemesis is killed.

00050

QT_FIRSTNEMESIS

This message is displayed the first time you attract the nemesis's attention.

00051

QT_NEXTNEMESIS

This message is displayed on the second and third times you meet the nemesis.

00052

QT_OTHERNEMESIS

This message is displayed on subsequent encounters with the nemesis.

00053

QT_NEMWANTSIT

If you have somehow obtained the quest artifact without killing the nemesis, this is what the nemesis will say while the item is in your possession.

00060 - 00069

QT_DISCOURAGE

"1-10 random maledictive messages" from the quest nemesis.  Some of these messages may be displayed as the nemesis attacks you, similar to angelic and demonic maledictions.

00070

QT_GOTIT

This message is displayed the first time the artifact enters your possession, whether the nemesis has been destroyed or not.

00080

QT_KILLEDNEM

This message is displayed when the nemesis is destroyed.

00081

QT_OFFEREDIT

Your quest leader greets you with this message when #chatted to after you obtain the quest artifact.  Often this includes a statement that you are permitted to keep the artifact.

00082

QT_OFFEREDIT2

This message is displayed if you throw the quest artifact at your quest leader.  The artifact will immediately return to your inventory.

00090

QT_POSTHANKS

This is what your quest leader says if #chatted to after acknowledging that you have the artifact and before you have the Amulet.  Often this makes reference to your mission to get the Amulet.

00091

QT_HASAMULET

This is what your quest leader says if #chatted to while the Amulet is in your possession.  Often this includes instructions on how to reach the Astral Plane and offer the Amulet to your deity.

Text replacement formatting
The messages can contain special characters that will be replaced at run-time with some other data. For example in a string "Hello, %p" the "%p" would be replaced by the player's name.

Code

Explanation

%p

Player's name

%c

Player's role, e.g. "Archeologist"

%r

Player's current rank title, e.g. "Field Worker"

%R

Rank title required to get on the quest.

%s

"sister" or "brother"

%S

"daughter" or "son"

%l

Name of the quest leader

%i

Name of the intermediate level, e.g. "the Tomb of the Toltec Kings"

%o

Name of the quest artifact

%n

Name of the quest nemesis

%g

Name of the quest guardians

%G

"god" or "goddess", depending on player's original alignment

%H

Name of the quest home level

%a

Player's original alignment

%A

Player's current alignment

%d

Player's original god

%D

Name of the lawful god

%C

"chaotic"

%L

"lawful"

%N

"neutral"

%x

"see", or "sense" if player is blind

%Z

Name of the first dungeon ("Dungeons of Doom")

%%

"%"

The special replacement codes above can be immediately followed by some modifiers. For example "%NC" would show "Neutral" - %N shows normally "neutral", but the modifier C capitalizes the first letter. 

Formatting code modifiers

Code

Explanation

A

Prefix with "A " or "An "

a

Prefix with "a " or "an "

C

Capitalize the first letter

p

Pluralize

P

Pluralize and capitalize the first letter

s

Append possessive suffix

S

Append possessive suffix and capitalize the first letter

t

Remove "the " prefix

Source:NetHack_3.6.0/dat/quest.txt

This page may need to be updated for the current version of NetHack.
It may contain text specific to NetHack 3.4.3. Information on this page may be out of date.
Editors: After reviewing this page and making necessary edits, please change the {{nethack-343}} tag to the current version's tag or {{noversion}} as appropriate.