Qst File - torilmud/docs GitHub Wiki

Qst File

The *.qst file, or the quest file, contains the dialogue and item transactions for all the creatures in your zone. It has a very different format than any of the other files and it will be explained in detail here.

Entry Letter Entry Type
M Precedes a verbal exchange only
Q Precedes an exchange of items or coins (coins are always in # of copper)
A Precedes the arrival in a destination room. This is a reward type, just like Q.
G What the player gives the NPC (I for item, C for coins)
R What the player receives from the NPC (once ALL G's are satisfied)
D Command used to make the mob disappear after that quest entry (step) is complete
S Signals end of that mob's quest file

Take some time to familiarize yourself with the types of entries above, and click on them for an in depth look.

Don't worry if you are still confused, that is why we added a whole section with complete examples of each here.

  • NOTE: You can use some variables in the .qst file to save you some time. Check them out!
  • The QST file MUST have a blank line at the bottom.

Quest File Entries

VNUM

Format:

#[mobnumber]

The mob's vnum entry should be the very first thing you add to the file. Each mob's complete quest entry will be preceded by their own Vnum, and finalized with S.

Example:

#1000
M
hi hello~
The enslaved areas staffer looks at you and says "Learning how to use the quest file huh? Better grab a beer."
~
S

M

Format:

M
keywords~
The mob's response to the keywords above.
~

When a player encounters your creatures, they have the option to talk to them by asking the mob a single word. This entry allows you to design the responses to such actions.

Basic dialogue for all mobs starts with an entry for "hi hello". Whether the creature talks or not, a small message for each mob should be included in response to the player asking the mob "hi hello".

Example:

M
hi hello~
The enslaved areas staffer looks at you and says "Help! I'm being oppressed! Buy me a beer?"
~

Q

Format:

Q
Text shown after turning in what the mob asked for in previous entries.
~
G [give type] [vnum of the item you want players to turn in or amount of coins in copper]
(optional) R [reward type] [reward options]

The Q entry signals an exchange, which might not necessarily result in a resulting Reward entry as you may want mobs to just trade information for coins or items. What is essential is the Give entry as there can be no Q without turning in something to the quest mob. The R command in the above example is optional. Refer to the Reward Section for more information on how to use it.

Example:

Q
The enslaved areas staffer says "Thanks for the beer. Here's some money. Now, bring me more beers."
~
G I 1001
R C 15

A

Format:

A [Destination Room's Vnum]
The quest mob's text upon arrival in the destination room.
~
(optional) R [reward type] [reward options]

Precedes the arrival in a destination room. This is a reward type, just like Q, and just like Q the reward entry is optional as you may just wish to make it an exchange of information. This quest entry will only be successful if the mob follows the player, so you must either precede it with a Q entry and a Reward Follow or create a follow trigger with the mob's social entries. The R command in the above example is optional. Refer to the Reward Section for more information on how to use it.

Example:

A 1006
The enslaved areas staffer follows you outside and takes a breath of fresh air. "Thanks for releasing me mortal, now here's some artifacts and phat lootz... oops, they're no-rent!"
~
R I 1005
R I 1006
R I 1007

G

Format:

G I [vnum of the item to be turned in]

OR

G C [amount in copper coins]

Give lines are inserted into Q entries, and can refer to two types, either for an item or for coins, which will always be in copper.

Remember, 1 platinum = 10 gold = 100 silver = 1000 copper coins.

R

Format:

R [reward type] [reward value]

This entry signals something that the player receives from the exchange, be it an actual item, or some kind of action.

There are many different types of Rewards:

  • Attack the Questor : R A
  • Give Coins to the Questor : R C [amount in copper]
  • Open a Door : R D [exit direction number] [room vnum] - Exit Numbers for reference
  • Grant Experience : R E [Exp Value Granted] - Refer to the experience tables for an idea.
  • Follow the Questor : R F - Will merely follow the questor. The mob will take no commands and perform actions in the questor's favor... at least not unless you social them. ;)
  • Cast a Spell : R H [Spell Number] - mob must be able to see player and has to be of the correct class to cast the spell (i.e. warrior mobs can't cast armor, for instance).
  • Give an Item to the Questor : R I [obj vnum] [Optional obj vnum] - If the second optional vnum is set, it will turn this into a range and will reward a random item from within that range.
  • Load a Mobile : R M [mob vnum] [room vnum] - Room # will default to questor's room if omitted.
  • Load an Object : R O [obj vnum] [room vnum] - Room # will default to questor's room if omitted.
  • Grant Prestige : R P [Prestige Value Granted] - Doesn't do anything at the moment, but still check with an areas staff member for approval.
  • Grant Alignment Shift Towards Lawful : R L
  • Grant Alignment Shift Towards Good : R G
  • Grant Alignment Shift Towards Evil : R X
  • Grant Alignment Shift Towards Chaotic : R Q

Do not use these alignment changes without approval from an appropriate areas staff member.

D

Format:

D
The text the mob will say as it disappears.
~

This command used to make the mob disappear after that quest entry's requirements have been met. It is placed following the Give or if there is one, the Reward line after a Q or an A type entry.

Example:

Q
The enslaved areas staffer says "Was that all the beer you could afford? What a loser, here have some change."
~
G I 1001
R C 500
D
Chugging the beer can, the areas staffer belches loudly and walks away, yelling "Well then, see ya chump!'
~

S

Format:

S

This is one of the most important entries in your quest file. It marks the end of a mob's quest entries and must always be present.

Example:

#1000
M
hi hello~
The enslaved areas staffer looks at you and says "Learn this yet? No? Then watch me do it in the examples page!"
~
S

~ Tildes ~

While not quite a quest entry, they are important (and some would say annoying) enough to be included here. The biggest problem when doing QST files is tilde (~) mistakes. As you'll see from the examples below, there are tildes flying all over the place, and the misplacement of just one will keep your zone from loading at all. There's a simple formula you can use after you've done your QST file to check it over and make sure you have the right number of tildes:

For each M, there should be 2 tildes per vnum. For each Q or A, there should be 1 tilde per vnum. For each D, there should be 1 tilde per vnum.

Instead of telling you where to put the tildes, I'll let the examples below illustrate that, as monkey see/monkey do is by far the best way to learn how to operate the quest file.

Examples

Still having trouble understanding the quest file? Not to worry, these examples will clear everything up, but before we can get to the examples, we have to have some mobs and objects to do stuff with. Let's pretend that you have an area called "Village", and you've already completed village.zon, village.mob, village.obj, and village.wld. Some of the mobs and objects with their vnums are listed below:

VNUM MOB VNUM OBJ VNUM ROOM
1000 the little boy 1000 the ball 1000 the dining room
1001 the salt merchant 1001 the lollipop
1002 the dog 1002 the potato
1003 the farmer 1003 the bone
1004 the mother 1004 the paddle
1005 the father 1005 a bowl of stew
1006 the sister 1006 a hunk of salt

Example 1: How to do a simple conversation--

#1000
M
hi hello~
The little boy looks at you and says "Can you help me?"
~
M
help~
The little boy nods and says "My little dog is lost! He's my best friend!"
~
M
dog lost friend~
The little boy starts to cry and says "Yeah, no one else loves me...I'm such a pitiful little brat!"
~
S

Example 2: How to do a simple conversation ending with an exchange of items--

(This assumes that you already have the item called "lollipop".)

#1000
M
hi hello~
The little boy glares at you and says "No! You can't have my ball!"
~
M
ball~
The little boy clutches the ball to his chest and says "MINE! My two
favoritest things in the world are my ball and lollipops!"
~
M
lollipop lollipops~
The little boy starts to drool and says "Lollipop? You have a lollipop?
Um...well...I'd be willing to trade my ball for a lollipop!"
~
Q
The boy smiles happily, stuffs the lollipop in his mouth and mumbles
"fank you" as he hands you his snot covered ball.
~
G I 1001
R I 1000
S

Example 3: An example of an exchange of items and money and a mob that disappears at the end--

This assumes that you have the item "paddle".

#1005
M
hi hello~
The father looks at you absently and says "not now...I have to find that snotnosed kid!"
~
M
kid snotnosed~
The father grins at you and says "yep, that brat is gonna get a royal
woopin'! Too bad I don't have a paddle to wallop him with. All I got is
my bare hands.
~
M
paddle~
The father sighs and says "if I just had me a paddle....say, you wouldn't
happen to have one, would you? I'd pay ya handsomely..."
~
Q
The father grins wickedly, hefts the paddle, and takes a few practice swipes. Digging deeply into his pockets, he hands you some coins.
~
G I 1004
R C 500
D
With a last wicked grin, the father rushes off, calling out "I have a surprise for you boy!"
~
S

Example 4: Putting it all together--

Note that I've used a couple of tricks in this one to avoid having to put together a shop file for just one or two items. Since these are arranged by the mob's vnum, sometimes it can get confusing especially since you'll have to go from one mob to another as a player to gather up the items. I make up a list with three headings: mob, wants, and gives. That way I have everything diagrammed out in advance.

#1001
M
hi hello~
The salt merchant looks at you and says "get yer salt here! Salt...get yer salt here"
~
M
salt~
The merchant sighs and says "yes, that's what I said...SALT...are you hard of hearing? Sheesh...you wanna buy some or not?"
~
M
buy~
The merchant nods and says "That's more like it...you can have this nice block of salt for just 1 silver piece..."
~
Q
The merchant counts the coins carefully, then hands you a large block of salt as big as your head.
~
G C 10
R I 1006
D
The merchant says "a pleasure doing business with ya", then moves along looking for more suckers.
~
S
#1002
M
hi hello~
The dog looks at you and gives a muffled growl, clenching the bone tight in his mouth.
~
M
ball~
The dog starts to wag his tail furiously, almost dropping his bone.
~
Q
The dog grabs the ball from your hand, dropping the bone in its place.
~
G I 1000
R I 1003
D
Overjoyed, the dog runs off to look for someone to play fetch with.
~
S
#1003
M
hi hello~
The farmer smiles in greeting, asking you "be ye in need of any vegetables today? Farm fresh!"
~
M
vegetables fresh~
The farmer nods and opens his basket of veggies, saying "I've got all the best here...I've got carrots, beans, beets, and just LOOK at this huge potato!"
~
M
potato~
The farmer says "Yep, this is a beauty, ain't it? It can be yours for just 15 silvers!"
~
Q
The farmer says "Thanks friend...enjoy! I've heard it's great in stews", then he hands you the tuber and smiles happily.
~
G C 150
R I 1002
S
#1004
M
hi hello~
The mother looks up from her cooking and says "don't bother me now, I'm very busy!"
~
M
busy~
The mother brushes the hair from her face and says "Yup! I'm making me some homemade stew!"
~
M
stew homemade~
The mother pulls out a recipe card and says "the heartiest stew in the world. Guaranteed to fill ya for a week per bowl!" Looking over the list, the mother snaps her fingers and says "Darn! Wouldn't ya know it! I'm missing a key ingredient! I don't have no potatoes!"
~
Q
The mother thanks you heartily, plunks the potato whole into the bubbling pot, then slaps her forehead saying "SALT! I'm missing salt...how could I be SO stupid...you wouldn't happen to have any salt on ya, would ya?"
~
G I 1002
Q
The mother grabs the salt from your hands saying "I hope it isn't too late!", then drops the entire block of salt into the bubbling pot. She stirs the revolting mixture for a while, then stops and says "needs calcium....you wouldn't happen to have a bone, would ya? If ya did, I'd be able to finish the stew, and I'd even pay ya for yer trouble with some coins and a portion."
~
G I 1006
Q
The mother smiles in satisfaction, and drops the whole bone into the pot. After stirring it for an hour or so, she hands you a few coins and a steaming bowl of fresh bone/salt/potato stew.
~
G I 1003
R I 1005
R C 10
D
Humming a happy song, the mother rushes off to feed her family.
~
S

Example 5: Getting a mob to follow and then reward at the destination

In this example, note that the player engages the mob in conversation, performs a basic task of retrieving an item, and then when it is brough to the mob, she follows the player. When he arrives in room 1006, it triggers the reward portion via the A command. Using this technique, you can create escort quests designed to bring mobs to different locations.

#1006
M
hi hello~
The sister looks up from the ground and digs her toe in the dirt sheepishly. "Hi there, is it time for dinner?"
~
M
dinner~
"Ok good, I'm so hungry. But before we go, can you get me a potato to bring in? Thank you!"
~
Q
The sister beams a smile at you. "Wonderful, can you bring me there so we can eat? Thank you!"
~
G I 1001
R F
A 1006
The sister bounces over to the table and grabs up a bowl of stew. "Here you go, now you can have some dinner too. Thanks so much for bringing me inside!"
~
R I 1005
D
Suddenly she blushes and scampers away, saying something about needing to wash up first.
~
S