Page is updated to match version 0.6.3. More sample quests to come. (when I feel like it)(YOU may contribute as well)
This page shows how to create quests using some major features of quester.
Quest one: Twon patrol
Let's say we have someone on the server who is the Best griefer of the week. Banning him would be too easy, so we create a quest for the entire server to hunt him down. Lets start by creating the quest.
/q create Twon patrol
Now that the quest is created and selected, (it selects automatically upon creation) we want to add a brief description. F*ck ! Mistake has been made, but worry not ! Selected quests can be renamed easily.
/q name Town patrol
Description is long enough to not fit into chat, so we are going to need to split it into three parts. Adding description also adds space before it, so we do not have to care about this.
/q desc set Hello folks ! \n There have been some major troubles recently caused by ProGriefer999,
/q desc add so town council decided to put a reward on his head. If you want to sign for a hunt,
/q desc add visit town hall to help us get rid of that guy 'the hard way'.
Now we realized we want everyone to be able to complete this quest only once, because otherwise killing our poor lad would become national sport. To achieve this, condition needs to be set. We need to tell quester that everyone trying to start this quest must not have done the same quest before, so we do:
/q condition add questnot Town patrol
Once we have skeleton of our quest set up, couple of objectives would be nice. First, player needs to sign for a hunt, so we want them to click appropriate sign at town hall. This can be achieved by ACTION objective. Let's follow action adding template. We have wall sign saying "Sign for The Hunt here." in town hall. Exact sign location is x113 y66 and z220 in 'world'.
/q objective add action any wall_sign any 113;66;220;world
We now have first objective set up, but its description looks rather non-roleplay-ish. We don't want our player to see this one, do we ? Let's write more pleasant one. Objective ID can be found in /q info.
/q objective desc add 0 Sign for The Hunt at town hall.
Beautiful description is set, let's go for the main objective. After signing at town hall, we want them to kill ProGriefer999, so we add objective to have them do that. And immediately after that we add more pleasant description once again. Quest ID we want to change now is 1.
/q objective add kill 1 ProGriefer999
/q objective desc add 1 Find and destroy that griefer ProGriefer999 !
Okay, most important objective is set, but how do we make people sign in before killing the man ? Order of objectives just does not count, so we need to use objective prerequisites. We want obejctive 1 to be completed after 0, so 0 is it's prerequisite.
/q objective prereq add 1 0
Now that we have given objective 1 its prerequisites, we probably want player to visit town hall again to claim their reward. (a stack of diamonds !) We could let them click sign again to get it, but imagine sign handing you diamonds, it's just messed up, because signs do not have hands. As we have that awesome Citizens 2 plugin installed, we want our Secretary to hand player the reward. First, we need to find out what ID our secretary has. (it's 6) After that, we have everything we need to make another objective. We also set objective's description and prerequisites again.
/q obejctive add npc 6 true
/q objective desc add 2 Go back to town hall to claim your reward.
/q objective prereq add 2 1
Why we added that 'true' in NPC objective ? Well, we had our town hall secretary say things on right click, like "Stay away !" or "I have no business with you !". But when we right click during quest objective, she actually has some business with us, so we don't want her to hurt us deeply. 'True' cancels any other right-click scripted events on that NPC, when part of the objective. In this case, it would save us from hearing the unpleasant stuff just this one time.
But raGan, this way she would just silently hand you the reward, we want her to be nice. No problem ! We will just set message event for her to be nice when you come for the reward. So, we want her to say it when objective 2 is completed. (right click on her) Message event fits this case well.
/q event add 2:0 msg &cSecretary: &fHere are you diamonds, Sir.
We just removed boredom and dullness from our second objective ! What a fun ! We don't want our quests to be boring at all, so we can add message event to each objective, just to make player feel more "in game". Let's add non-boring messages to remaining two objectives.
/q event add 0:0 msg You signed for The Hunt. You already smell griefer blood.
/q event add 1:0 msg You defeated the main town enemy ! God bless you !
Wild awesome idea for this quest has just appeared ! Player should complete this quest without dying, which makes perfect sense and also makes preparations for the hunt more important and attention-worthy. Let's cancel this quest if player dies. Deathcancel flag serves this purpose. Adding it is simple as well.
/q flag add deathcancel
Only one thing is left to do. (almost) Reward ! We already know it will be stack'o'diamonds. Item event on quest complete will serve us well. 'On complete' occasion is coded as -3.
/q event add -3 item diamond 64
Easy as that ! Now we have our glorious vengeful quest complete. To display it in it's full awesomess, use /q info as before. We are sure we haven't forgot anything, so it's ready to be released to and done by public. Last thing we must do before it appears in players' quest lists, is to activate it. Activated quests cannot be modified and deactivated quests cannot be started. Choose one !
It is done. Now whole server can start pissing off our greatest enemy - griefer. Enjoy.
Side note: Player does not start the quest by clicking the sign. Clicking the sign is the first thing he must do once the quest is started. Using signs to start quests is explained here.
Quest two: Oenophile (this quest uses some features only present in 0.7alpha)
Disclaimer: This quest requires you to know thing or two about quest making. It describes one of many creative uses of quester mechanics to create something that is not obviously present in the plugin. Little more advanced stuff here. I did not even bother to test this one, so report any malfunctions in this quest.
What do we have now ? We have a wine cellar that has two entrances and some wine in it. We also have old sailor Doug, that is very interested in getting some of the wine bottles stored in that cellar. What should we do ? We should make quest, of course. Doug is very helpful, because he happens to be NPC from Citizens 2, which luckily happens to work with Quester.
First thing to do is to make sure that Doug is capable of giving us the quest. This can be done by giving him trait quester. I will not tell you how to do that, you will have to figure it out for your self with the help of citizens wiki. Now that he has the trait, we can give him quest holder to hold some quests for us. Let's create one:
/q holder create "Doug's holder"
We have our holder, but it's empty. To further manipulate with the holder, it needs to be selected. Holder can be selected using command /q holder select <holder ID>, but holder is automatically selected when created, so we can skip this step. Let's create a quest to be held it the holder.
/q create Oenophile
Plus some basic functionality, because there isn't an infinite amount of wine in that cellar:
/q condition add questnot Oenophile
Now, adding quest to the selected holder is as simple as
/q holder add 1
Oenophile is the second quest we created, so its ID is 1. Ids can be checked in quest list. It's that number in square brackets next to the quest name.
Alright, we have our holder and it holds one quest, called Oenophile, now we need to give that holder to the Doug. It is done by having the holder selected and right-clicking Doug with a blaze rod. Success message should be displayed. We can make sure the quest is there by left-clicking Doug with anything other than blaze rod. (preferably not with sword, as that would hurt him)
But back to the quest, let's create questline. Quest should have about 3 main objectives, first is to find and entrance to the cellar, second is to find right wine cabinet and third is to bring the wine back to Doug. But wine cellar has two entrances, one of which is locked. We want to create two objectives, one for each entrance. If a player finds locked one, it will tell him to keep looking for another one, but if he finds it straight away, we want to progress with the quest without the need to find locked one as well. To sum up, we want objective to find locked entrance to be only optional, but still want to use prerequisites, because we don't want to show player the description of the second objective straight away, which would tell him to look for secret entrance. There is a way of creating optional objective by using one extra hidden objective. Let's stand near the locked entrance and create first one:
/q desc set "Could you please steal 3 finest wines from that cellar ? Yes ? Allright, I'm waiting."
/q objective add location here
/q objective desc add 0 "Find entrance to the cellar."
Now stand near the secret entrance and create the second objective:
/q objective add location here
/q objective desc add 1 "Find another entrance to the cellar."
/q objective prereq add 1 0
We have both objectives set up, it's time for some magic. Now objective 1 requires objective 0 to be completed first, effectively forcing player to find locked entrance. And since we do not want this, we have to make workarounds. We will add another hidden objective, same as the second one, but with no rerequisites and events that will manually force completion of the first two objectives.But what if player finds the locked entrance first, wouldn't that render our special objective useless ? Yes, we will add event to the first objective to silently complete our special objective, because it's not needed anymore. To add our special silent objective, add the second objective second time, but now with flag "-h" that will make it hidden. Hidden objectives are not shown to player and "objective completed" message is muted for them.
/q objective add location here -h
/q event add 2 objcom 0 -e - 2 is ID of our special objective
/q event add 2 objcom 1 -e - flag -e (run events) completes objective like it would normally be
Now to add silent completion of our special objective if it's not needed:
/q event add 0 objcom 2 - silently complete objective 2
Now that the magic is set up, we can continue with the quest normally. Let's add objective to "steal wine" by punching (grabbing it from) proper wine cabinet, represented by brewing stand. Look at the stand and write:
/q objective add action left brewing_stand air block
/q objective prereq add 3 1
/q objective desc add 3 "Steal the wine."
/q event add 3 item potion 3
We have successfully stolen the wine, all we need is to return to Doug.
/q objective add item potion 3
/q objective prereq add 4 3
/q objective desc add 3 "Return to Doug. (with the wine)"
That's how we like it. Last thing to add are some rewards.
/q event -3 add msg "I'm starting to like you, take this."
/q event -3 add point 5
/q event -3 add exp 10 -l - 10 experience levels for being ultimate thief
/q event -3 add item potion_of_epicness:1337 1 - fictional, but cool item
And maybe cancel message:
/q event add -2 msg "You decided to not do Doug's bidding."
This is it. Player needs to right-click Doug, go find the entrance, punch the wine and then right click Doug again to hand him the wine. We should definitely not forget last thing to do with every successfully written quest:
Server burglars can now enjoy what they enjoy most.