The (QST) Quest File

Quest File Format

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 quest is complete
S Signals end of that mob's quest file

Quest files MUST have a blank line at the bottom.

Note that the switches used in the SHOP file work here as well: $n, $N, $m, $s, $S, etc

Them Darn Tildes

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.

The Exchanged Items/Money:

One of the main things I was confused about at first was whether or not to give the quest items to the mobs in the ZON file. The answer is no. The QST file acts as a magical item/money generator, creating the appropriate thing whenever the quest is successfully completed. As you can imagine, this is a very good thing, otherwise everyone would go around killing off the quest mobs to get their items.

How to Keep the Mob from Repopping:

Sometimes you want your mob to disappear after the quest is successfully completed, in which case he'll reappear the next time your zone resets. If you do NOT want him to repop (meaning you only want him to load once per game reboot), this is what you have to do:

In your ZON file, load him directly after an object that only loads once and cannot be taken (for example a fountain or a counter), and instead of using M 0, use M 1 before the load. For example:

O 0 35000 1 35000 *fountain loads in gathering square
M 1 35220 1 35999 *huge orc loads only once per reboot

Then, if you want to equip your mob with non-quest items, follow that with the appropriate E lines (or F or G or whatever you want per the standard ZON format). The key is that you have to "link" him to a non-takable item, and use M 1 instead of M 0. What this does is make the mob only load whenever that item loads, which is only once per reboot. Neat trick, eh?

1. If there are more than one quest mobs in a room at one time, there is a good chance that neither of them will do what they're supposed to. Consider putting your more important quest mobs in separate rooms and making them sentinel

2. There is a problem with mobs that only request cash, because the mob converter assigns them money automatically, hence making the mobs willing to give out their quest items for free, so don't do this.

Load mobile

R M [mob vnum] [room vnum] - Room # will default to
questor's room if omitted.

Load object

R O [obj vnum] [room vnum] - Room # will default to
questor's room if omitted.

Attack questor

R A - nuff said.

Cast spell

R H [spell number] - mob must be able to see player and has to be of the correct class to cast the spell (ie. warrior mobs can't cast armor, for instance)

Grant Experience

R E [value granted]

Grant Prestige

R P [value granted]

Grant alignment change

R Z [any number between -1000 to 1000, align will shift]

Examples

Example 1: A simple conversation.
Example 2: Simple Item Exchange.
Example 3: Exchange of Items and Money.
Example 4: Complete Quest using example 1-3.
Example 5: Escort quest, reward at destination.