Quest Builder
Jump to navigation
Jump to search
This is a draft of a new quest builder system. At this point it is only a first idea that needs further refinement.
Example for Kill Creatures Quest
<source lang="java"> /**
* QUEST: CleanStorageSpace
*
* PARTICIPANTS: *
* STEPS: *
* REWARD: *
* REPETITIONS: *
Example for Request Item Quest
<source lang="java"> /**
* QUEST: Armor for Dagobert * * PARTICIPANTS:*
-
*
- Dagobert, the consultant at the bank of Semos *
* * STEPS:*
-
*
- Dagobert asks you to find a leather cuirass. *
- You get a leather cuirass, e.g. by killing a cyclops. *
- Dagobert sees your leather cuirass and asks for it and then thanks you. *
* * REWARD:*
-
*
- 50 XP *
- 80 gold *
- Karma: 10 *
- Access to vault *
* * REPETITIONS:*
-
*
- None *
*/
ProvideItemQuestBuilder quest = new ProvideItemQuestBuilder();
quest.info()
.name("Armor for Dagobert")
.description("Dagobert, the consultant at the bank of Semos, needs protection.")
.internalName("ArmorForDagobert")
.repeatable(false);
.minLevel(0)
.region(Region.SEMOS_CITY)
.questGiverNpc("Dagobert")
quest.history()
.whenNpcWasMet("I have met Dagobert. He is the consultant at the bank in Semos.")
.whenQuestWasRejected("He asked me to find a leather cuirass but I rejected his request.")
.whenQuestWasAccepted("I promised to find a leather cuirass for him because he has been robbed.")
.whenTaskWasDone("I found a leather cuirass and will take it to Dagobert.")
.whenQuestWasCompleted("I took the leather cuirass to Dagobert. As a little thank you, he will allow me to use a private vault.");
quest.offer()
.respondToRequest("I'm so afraid of being robbed. I don't have any protection. Do you think you can help me?")
.respondToRepeatedRequest("Thank you very much for the armor, but I don't have any other task for you.")
.respondToAccept("Once I had a nice #'leather cuirass', but it was destroyed during the last robbery. If you find a new one, I'll give you a reward.")
.respondToReject("Well, then I guess I'll just duck and cover.")
.remind("Luckily I haven't been robbed while you were away. I would be glad to receive a leather cuirass. Anyway, how can I #help you?")
npc.addReply(Arrays.toList("leather cuirass", "leather", "cuirass"), "A leather cuirass is the traditional cyclops armor. Some cyclopes are living in the dungeon deep under the city.");
quest.task()
.requestItem(1, "leather cuirass") .alternativeItem(1, "pauldroned leather cuirass")
quest.complete()
.greet("Excuse me, please! I have noticed the leather cuirass you're carrying. Is it for me?")
.respondToReject("Well then, I hope you find another one which you can give to me before I get robbed again.")
.respondToAccept("Oh, I am so thankful! Here is some gold I found ... ehm ... somewhere. Now that you have proven yourself a trusted customer, you may have access to your own private banking #vault any time you like.")
.rewardWith(new EquipItemAction("money", 80));
.rewardWith(new IncreaseXPAction(50));
.rewardWith(new IncreaseKarmaAction(10));
</source>