Okay, I'm writing a really basic sample quest that assigns one of several tasks to a player using the glassmaking skill. Which isn't active, but the idea just popped into my head and I'm going with it. This should show you how a basic quest works, so that you don't have to poke around in other files.
The first section is the header that appears at the top of all quests.The '#' means the line is commented out, so it has no effect on what the player sees or what the server does. It's just to help people reading the raw quest file.
# Quest name: Glassblowing Training Quest.
# Quest Description: Repeatable quest to train glassblowing.
# Quest Category: Repeatables ???
# ----------------------
# Quest Items: Item name/Item description
# Item name - Description here.
# ----------------------
# Author(s): Uadjet
# Current Version: 0.1 Alpha
# Player lockout: -1 ???
# Quest lockout: 0 ???
# Prerequisites: <pre><completed quest="???"/></pre>
#----------------------
# Version history and change log
# Last edited by: Nobody, as should be obvious
# Version 0.1: Never checked, Venaland and Mordaan will likely laugh when they see it
# ---------------------
That's mostly self-explanatory, I think, and I've filled most of it out as I would for a quest I was writing. The
mark lines I don't really understand, but again they're all commented out so the server ignores them.
This step isn't really necessary, but you can have NPCs say things to players as they walk past. You can also check various traits about the player, so that the NPC will only say things for a specific skill level or if a quest is completed. I think. I'm mainly including it because it's a very simple introduction to one aspect of quest writing.
P: !shortrange
Glassblower McUnimplemented:
Okay, that has two lines to it. The line starting with "P:" and the line starting with the NPCs name. The P: line includes what the player says to the NPC. The trigger text. It can also read "Player gives Glassblower McUnimplemented Glass Mug" if the player walks up to the NPC in question and trades him/her/kra a glass mug. In this case, the trigger is being at short range.
The line of dialogue includes the full NPC full name (always the full name) and whatever that NPC says when the player triggers that step of a quest.
So let's try making something quest-specific.
P: !shortrange
Glassblower McUnimplemented: Damnation! I've broken another glass mug. I'm going to have to buy some more soon.
That's simple enough. If a player walks by at short range, Glassblower McUnimplemented (which seemed much cleverer when I first used it) will say that line. Easy. Now, what if we only wanted people who can actually work with glass items to get that prompt? We can add a restriction to that step. The documentation I linked to has far more examples of that kind of thing, but we'll assume the NPC knows the player has some training in glassblowing because the player has done a quest before. That line goes before the P: line. Like this:
Require completion of Introduction to Glassblowing
P: !shortrange
Glassblower McUnimplemented: Ah, $playername! I remember you. Could you give me a moment of your time?
So the first line checks to see if the player nearby (at !shortrange) has completed the quest "Introduction to Glassblowing" and if he/she/kra has it will display the dialog line. The dialog line contains "$playername", which is one of the wildcards you can use when writing quests. Enter that, and the NPC will say the player's name.
So that actually gives us examples of three different types of lines in a quest step. There's a lot more you can do with them, but they aren't too complex so far, are they?
So the player hears this and decides to see what the NPC wants. We'll now have the second step in the quest.
... NoRepeat
#Step 2.
P: give quest. quest. glass mug. glassblowing.
Menu: Did you need something?
Glassblower McUnimplemented: Yes, I'm badly in need of some new glass mugs and I was hoping you could help me.
Assign Quest
That's a nice, simple first step. First, note the '...' on the top there. That tells the server you're starting a new step in the quest. The "#Step 2." bit doesn't do that, as the '#' means that line isn't read by the server, remember? The "NoRepeat" bit means that after this step is run that particular dialog option doesn't show again. Most steps will have this, as if they didn't each dialog bubble would keep repeating. Remember what popups were like before adblocking was available? Yeah...
So the P:... part lists the various things the player could say to trigger this if they weren't using the dialog bubbles, as usual. Nothing exciting or new there.
Now the "Menu" line is new. That's what the player actually sees in the dialog bubble that they click on. That's the player's 'voice', so to speak. Here there's only one option, but we'll change that shortly. After clicking on that, the NPC responds with the line listed just under the Menu line.
Next is the line that actually starts the quest: "Assign Quest" Pretty simple, right? Well, it's simple but maybe not the best way to do it. The player actually hasn't agreed to help yet, so setting the quest as accepted is a bit premature. Let's give the player the option to say Yes or No. There are a couple ways to do that.
... NoRepeat
#Step 2.
P: give quest. quest. glass mug. glassblowing.
Menu: Did you need something?
Glassblower McUnimplemented: Yes, I'm badly in need of some new glass mugs and I was hoping you could help me.
Complete Glassblowing Training Quest step 2
... NoRepeat
#Step 3
Require completion of Glassblowing Training Quest step 2. Require no completion of Glassblowing Training Quest step 4.
... NoRepeat
#Step 4
Require completion of Glassblowing Training Quest step 2. Require no completion of Glassblowing Training Quest step 3.
I'll stop here for a moment to explain. Note that completing step 2 is a requirement for completing both step 3 and step 4, so both of those will pop up after completing step 2. You'll also see that steps 3 and 4 both require that the player not have completed the other step, so if a player does step 3, step 4 will not show up as an option. Otherwise the player could, in this case, both accept and decline the quest. I'll fill it in a bit more now:
... NoRepeat
#Step 2.
P: give quest. quest. glass mug. glassblowing.
Menu: Did you need something?
Glassblower McUnimplemented: Yes, I'm badly in need of some new glass mugs and I was hoping you could help me.
Complete Glassblowing Training Quest step 2
... NoRepeat
#Step 3
Require completion of Glassblowing Training Quest step 2. Require no completion of Glassblowing Training Quest step 4.
P: Decline. No. Nohelp.
Menu: No, I'm too busy right now.
Glassblower McUnimplemented: Oh, that's a shame. Come back later if you change your mind.
Complete Glassblowing Training Quest step 3
... NoRepeat
#Step 4
Require completion of Glassblowing Training Quest step 2. Require no completion of Glassblowing Training Quest step 3.
P: Accept. Yes. Yeshelp.
Menu: Yes, I can help you.
Glassblower McUnimplemented: Wonderful! I'll need six glass mugs as quickly as you can make them.
Complete Glassblowing Training Quest step 4. Assign Quest.
If the player chooses to help, they can continue on. If they say no, the quest is over before it began and cannot be restarted again. Not too much fun, I suppose. Perhaps if the player says "no' the NPC can give them another chance?
... NoRepeat
#Step 2.
P: give quest. quest. glass mug. glassblowing.
Menu: Did you need something?
Glassblower McUnimplemented: Yes, I'm badly in need of some new glass mugs and I was hoping you could help me.
Complete Glassblowing Training Quest step 2
... NoRepeat
#Step 3
Require completion of Glassblowing Training Quest step 2. Require no completion of Glassblowing Training Quest step 4.
P: Decline. No. Nohelp.
Menu: No, I'm too busy right now.
Glassblower McUnimplemented: Oh, that's a shame. Come back later if you change your mind.
Complete Glassblowing Training Quest step 3
... NoRepeat
#Step 4
Require completion of Glassblowing Training Quest step 2.
P: Accept. Yes. Yeshelp.
Menu: Yes, I can help you.
Glassblower McUnimplemented: Wonderful! I'll need six glass mugs as quickly as you can make them.
Complete Glassblowing Training Quest step 4. Assign Quest.
That's better. I removed the requirement that step 3 NOT be completed off step 4, so if you decline the quest once you can still go back later and say Yes. Still, there's a better way. You know how sometimes an NPC will give you a choice in conversation and no dialog bubbles from other quests will pop up? It shows only the options for that one quest. Here's how that works.
... NoRepeat
#Step 2.
P: give quest. quest. glass mug. glassblowing.
Menu: Did you need something?
Glassblower McUnimplemented: Yes, I'm badly in need of some new glass mugs and I was hoping you could help me.
P:nohelp. P: yeshelp
Menu: No, I'm too busy right now. Menu: Yes, I can help you.
Glassblower McUnimplemented: Oh, that's a shame. Come back later if you change your mind.
Glassblower McUnimplemented: Wonderful! I was worried I'd come up short during the rush.
Assign Quest
That's a little more complex to write, but in the end I think it makes things easier. You write the P: , Menu: , and NPC: lines as normal, but after them you add an additional P: line with one entry per option the player is to be given. In this case you have only yes and no options, so the line is: "P:nohelp. P: yeshelp"
After that is a Menu: line where you enter the Dialog options that will fill the bubbles defined by the line above. In this case: "Menu: No, I'm too busy right now. Menu: Yes, I can help you."
Note that in both cases you need the "P:" and "Menu:" component for each option. You can't simply say "Menu: No, I'm too busy right now. Yes, I can help you." That's only one entry. You need this: ""
Menu: No, I'm too busy right now.
Menu: Yes, I can help you.""
The lines of NPC dialog are given their own lines, but the order must match the order given in the P: and Menu: lines.
I don't know why the quest doesn't complete step 2. I'll have to ask about that.
Assuming the player chooses to continue the quest, we move on to actually giving the task required. For that we need a new step, which will be step 3 if we use the last example for step 2.
... NoRepeat
#Step 3
P: Task
Menu: What did you need me to make?
Glassblower McUnimplemented: Six glass mugs, please. As quickly as you can make them!
Complete Glassblowing Training Quest step 3
That's it. Pretty simple, right? Now you'll need a step where you hand in the items, but what if the player forgets what they were supposed to make? They could take a break from the game or just have a lot of open quests. We should add in a reminder step that will tell them what to do.
...
#Step 4
Require completion of Glassbowing Training Quest step 3.
Require no completion of Glassblowing Training Quest step 5
Require no possessed amount 6 item Glass Mug
P: Iforgot
Menu: What did you need me to make again?
Glassblower McUnimplemented: Glass mugs. Six of them. Please try to hurry.
Complete Glassblowing Training Quest step 4.
That should do it. Left out the NoRepeat bit at the top so the player can get as many reminders as necessary and put in a "require no completion" so that this option won't show up after the step where you hand in the items is completed.
Now we can add the step where we hand in the items.
... NoRepeat
#Step 5
Require completion of Glassbowing Training Quest step 3.
Require possessed amount 6 Glass Mug.
Player gives Glassblower McUnimplemented 6 Glass Mug.
Menu: Here they are.
Glassblower McUnimplemented: Thank you! Just in time for the after work rush.
So as usual we require the completion of the previous step to start this one to keep the quest nice and clean. We also require that the player actually have the required items to see this option. That's the "Require possessed amount 6 Glass Mug." bit. You'll probably notice that instead of "P: something" we have a "Player gives..." line. That's so that the player actually hands over the items needed, and is used in place of the triggering text format. Other than that, it's pretty normal. Would be nice to complete the quest, though, right?
... NoRepeat
#Step 5
Require completion of Glassbowing Training Quest step 3.
Require possessed amount 6 Glass Mug.
Player gives Glassblower McUnimplemented 6 Glass Mug.
Menu: Here they are.
Glassblower McUnimplemented: Thank you! Just in time for the after work rush.
Complete Glassblowing Training Quest step 5. Complete Glassblowing Training Quest.
There we go. Completed the step and then the quest. No rewards, though. Kinda cheap of me.
... NoRepeat
#Step 5
Require completion of Glassbowing Training Quest step 3.
Require possessed amount 6 Glass Mug.
Player gives Glassblower McUnimplemented 6 Glass Mug.
Menu: Here they are.
Glassblower McUnimplemented: Thank you! Just in time for the after work rush.
Run script give_quest_exp <<1>>.
Run script give_quest_money <<1>>.
Run script give_quest_skill <<'Glassblowing',1>>.
Complete Glassblowing Training Quest step 5. Complete Glassblowing Training Quest.
Better! Now we've added the rewards of exp, tria, and a skill point. The tria and exp rewards work with a multiplier based on character skill, stats, nostril size, and probably other things as well, so even though it says "1" you aren't giving 1 tria and 1 exp point. It's just the base reward, and entering a value of 2 would give double that.
So, putting that all together gives us:
# Quest name: Glassblowing Training Quest.
# Quest Description: Repeatable quest to train glassblowing.
# Quest Category: Repeatables ???
# ----------------------
# Quest Items: Item name/Item description
# Item name - Description here.
# ----------------------
# Author(s): Uadjet
# Current Version: 0.1 Alpha
# Player lockout: -1 ???
# Quest lockout: 0 ???
# Prerequisites: <pre><completed quest="???"/></pre>
#----------------------
# Version history and change log
# Last edited by: Nobody, as should be obvious
# Version 0.1: Never checked, Venaland and Mordaan will likely laugh when they see it
# ---------------------
Require completion of Introduction to Glassblowing
P: !shortrange
Glassblower McUnimplemented: Ah, $playername! I remember you. Could you give me a moment of your time?
... NoRepeat
#Step 2.
P: give quest. quest. glass mug. glassblowing.
Menu: Did you need something?
Glassblower McUnimplemented: Yes, I'm badly in need of some new glass mugs and I was hoping you could help me.
P:nohelp. P: yeshelp
Menu: No, I'm too busy right now. Menu: Yes, I can help you.
Glassblower McUnimplemented: Oh, that's a shame. Come back later if you change your mind.
Glassblower McUnimplemented: Wonderful! I was worried I'd come up short during the rush.
Assign Quest
... NoRepeat
#Step 3
P: Task
Menu: What did you need me to make?
Glassblower McUnimplemented: Six glass mugs, please. As quickly as you can make them!
Complete Glassblowing Training Quest step 3
...
#Step 4
Require completion of Glassbowing Training Quest step 3.
Require no completion of Glassblowing Training Quest step 5
Require no possessed amount 6 item Glass Mug
P: Iforgot
Menu: What did you need me to make again?
Glassblower McUnimplemented: Glass mugs. Six of them. Please try to hurry.
Complete Glassblowing Training Quest step 4.
... NoRepeat
#Step 5
Require completion of Glassbowing Training Quest step 3.
Require possessed amount 6 Glass Mug.
Player gives Glassblower McUnimplemented 6 Glass Mug.
Menu: Here they are.
Glassblower McUnimplemented: Thank you! Just in time for the after work rush.
Run script give_quest_exp <<1>>.
Run script give_quest_money <<1>>.
Run script give_quest_skill <<'Glassblowing',1>>.
Complete Glassblowing Training Quest step 5. Complete Glassblowing Training Quest.
Okay, that's the basic format as I understand it. I'll expand on that below by showing how to add Quest notes and how to give variable tasks as the skill quests in game already do. I might have figured out how to do the timer, but I'm not sure...