Implemented Monk's Friend quest

This commit is contained in:
Harris Hackett
2022-02-23 13:08:01 +00:00
committed by Ryan
parent 8887915ef0
commit 49bf0d6ef5
8 changed files with 540 additions and 4 deletions
+29 -1
View File
@@ -14302,6 +14302,34 @@
}
]
},
{
"default": [
{
"minAmount": "1",
"weight": "100.0",
"id": "526",
"maxAmount": "1"
}
],
"charm": [],
"ids": "281",
"description": "",
"main": []
},
{
"default": [
{
"minAmount": "1",
"weight": "100.0",
"id": "526",
"maxAmount": "1"
}
],
"charm": [],
"ids": "283",
"description": "",
"main": []
},
{
"default": [
{
@@ -63870,4 +63898,4 @@
}
]
}
]
]
+4
View File
@@ -19,6 +19,10 @@
"item_id": "88",
"loc_data": "{1,2654,9767,0,4587583}"
},
{
"item_id": "90",
"loc_data": "{1,2570,9604,0,5898270}"
},
{
"item_id": "185",
"loc_data": "{1,2467,3176,0,7209050}"
+11 -3
View File
@@ -745,15 +745,23 @@
},
{
"npc_id": "279",
"loc_data": "{2604,3209,0,0,0}"
"loc_data": "{2604,3209,0,1,6}"
},
{
"npc_id": "280",
"loc_data": "{2615,3258,0,1,6}"
},
{
"npc_id": "281",
"loc_data": "{2604,3219,0,0,0}-{2609,3207,0,0,0}-{2618,3211,0,0,0}"
"loc_data": "{2604,3219,0,1,6}-{2609,3207,0,1,6}-{2618,3211,0,1,6}"
},
{
"npc_id": "282",
"loc_data": "{3280,3494,0,1,6}"
"loc_data": "{3280,3494,0,1,6}-{2562,9608,0,1,6}-{2564,9604,0,1,6}"
},
{
"npc_id": "283",
"loc_data": "{2569,9602,0,1,6}"
},
{
"npc_id": "284",
@@ -0,0 +1,119 @@
package rs09.game.content.quest.members.monksfriend
import api.sendItemDialogue
import core.game.content.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
import core.game.node.item.Item
import org.rs09.consts.Items
import org.rs09.consts.NPCs
import rs09.game.content.dialogue.DialogueFile
import rs09.game.interaction.InteractionListener
import rs09.tools.END_DIALOGUE
/**
* Handles BrotherCedricDialogue Dialogue
* @author Kya
*/
class BrotherCedricDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
val questStage = player!!.questRepository.getStage("Monk's Friend")
when {
questStage < 30 -> {
when(stage) {
0 -> playerl(FacialExpression.HAPPY, "Hello.").also{stage++}
1 -> npcl(FacialExpression.DRUNK, "Honey, money, woman and wine!").also{stage++}
2 -> playerl(FacialExpression.HALF_ASKING, "Are you ok?").also{stage++ }
3 -> npcl(FacialExpression.DRUNK, "Yesshh...hic up...beautiful!").also{stage++}
4 -> playerl(FacialExpression.NEUTRAL, "Take care old monk.").also{ stage++ }
5 -> npcl(FacialExpression.DRUNK, "La..di..da..hic..up!").also{stage = END_DIALOGUE}
}
}
questStage == 30 -> {
when(stage){
0 -> playerl(FacialExpression.HAPPY, "Brother Cedric are you okay?").also{stage++}
1 -> npcl(FacialExpression.DRUNK, "Yeesshhh, I'm very, very drunk..hic..up..").also{stage++}
2 -> playerl(FacialExpression.NEUTRAL, "Brother Omad needs the wine for the party.").also{stage++}
3 -> npcl(FacialExpression.SAD, "Oh dear, oh dear, I knew I had to do something!").also{stage = END_DIALOGUE}.also{setQuest(player!!, 40)}
}
}
questStage == 40 -> {
when(stage){
0 -> playerl(FacialExpression.HAPPY, "Are you okay?").also{stage++}
1 -> npcl(FacialExpression.DRUNK, "Hic up! Oh my head! I need a jug of water.").also{stage++}
2 -> if (player!!.inventory.containItems(Items.JUG_OF_WATER_1937)){
playerl(FacialExpression.FRIENDLY, "Cedric! Here, drink! I have some water.").also{stage=10}
} else {
playerl(FacialExpression.NEUTRAL, "I'll see if I can get some.").also{stage = 3}
}
3 -> npcl(FacialExpression.DRUNK, "Thanks! *hic*").also{stage = END_DIALOGUE}
10 -> npcl(FacialExpression.DRUNK, "Good stuff, my head's spinning!").also {stage++}
11 -> {
sendItemDialogue(player!!, Items.JUG_OF_WATER_1937, "You hand the monk a jug of water.")
stage=0
player!!.inventory.remove(Item(Items.JUG_OF_WATER_1937))
setQuest(player!!, 41)
}
}
}
questStage == 41 -> {
when(stage){
0 -> npcl(FacialExpression.HAPPY, "Aah! That's better!").also{stage++}
1 -> npcl(FacialExpression.HAPPY, "Now I just need to fix this cart and we can go party.").also {stage++}
2 -> npcl(FacialExpression.NEUTRAL, "Could you help?").also{stage++}
3 -> options(
"No, I've helped enough monks today!",
"Yes, I'd be happy to!").also{stage++}
4 -> when(buttonID){
1 -> playerl(FacialExpression.ANGRY, "No, I've helped enough monks today!").also{stage++}
2 -> playerl(FacialExpression.FRIENDLY, "Yes, I'd be happy to!").also{stage=10}
}
5 -> npcl(FacialExpression.HAPPY, "In that case I'd better drink more wine! It helps me think.").also {stage=END_DIALOGUE}
10 -> npcl(FacialExpression.HAPPY, "Excellent, I just need some wood.").also{stage++}
11 -> playerl(FacialExpression.NEUTRAL, "Ok, I'll see what I can find.").also{stage = END_DIALOGUE}.also{setQuest(player!!, 42)}
}
}
questStage == 42 -> {
when(stage){
0 -> npcl(FacialExpression.HALF_ASKING, "Did you manage to get some wood?").also{stage++}
1 -> if (player!!.inventory.containItems(Items.LOGS_1511)){
sendItemDialogue(player!!, Items.LOGS_1511, "You hand Cedric some logs.")
stage=2
} else {
playerl(FacialExpression.SAD, "Not yet, I'm afraid.").also{stage = END_DIALOGUE}
}
2 -> playerl(FacialExpression.HAPPY, "Here you go!").also{stage++}
3 -> npcl(FacialExpression.HAPPY, "Well done! Now I'll fix this cart. You head back to Brother Omad and tell him I'll be there soon.").also{stage++}
4 -> playerl(FacialExpression.HAPPY, "Ok! I'll see you later!").also{
stage=END_DIALOGUE
player!!.inventory.remove(Item(Items.LOGS_1511))
setQuest(player!!, 50)
}
}
}
questStage == 50 -> {
when(stage){
0 -> playerl(FacialExpression.HAPPY, "Hello Cedric.").also{stage++}
1 -> npcl(FacialExpression.NEUTRAL, "Hi, I'm almost done here. Could you tell Omad that I'll be back soon?").also{stage = END_DIALOGUE }
}
}
questStage == 100 -> {
when(stage){
0 -> npcl(FacialExpression.NEUTRAL, "Brother Omad sends you his thanks! He won't be in a fit state to thank you in person.").also{stage = END_DIALOGUE}
}
}
}
}
}
/**
* Handles BrotherCedricListener to launch the dialogue
* @author Kya
*/
class BrotherCedricListener : InteractionListener() {
override fun defineListeners() {
on(NPCs.BROTHER_CEDRIC_280, NPC, "talk-to"){ player, _ ->
player.dialogueInterpreter.open(BrotherCedricDialogue(), NPC(NPCs.BROTHER_CEDRIC_280))
return@on true
}
}
}
@@ -0,0 +1,215 @@
package rs09.game.content.quest.members.monksfriend
import api.*
import core.game.content.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
import core.game.node.item.Item
import core.game.system.task.Pulse
import core.game.world.map.Location
import core.game.world.map.RegionManager
import core.game.world.update.flag.context.Animation
import org.rs09.consts.Items
import org.rs09.consts.NPCs
import rs09.game.content.dialogue.DialogueFile
import rs09.game.interaction.InteractionListener
import rs09.game.world.GameWorld.Pulser
import rs09.tools.END_DIALOGUE
/**
* Handles BrotherOmadDialogue Dialogue
* @author Kya
*/
class BrotherOmadDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
val questStage = player!!.questRepository.getStage("Monk's Friend")
when (questStage) {
0 -> {
when(stage) {
0 -> playerl(FacialExpression.HAPPY, "Hello there. What's wrong?").also { stage++ }
1 -> npcl(FacialExpression.SAD, "*yawn*...oh, hello...*yawn* I'm sorry! I'm just so tired! I haven't slept in a week!").also { stage++ }
2 -> options(
"Why can't you sleep, what's wrong?",
"Sorry! I'm too busy to hear your problems!").also { stage++ }
3 -> when (buttonID) {
1 -> playerl(FacialExpression.HALF_ASKING, "Why can't you sleep, what's wrong?").also { stage++ }
2 -> playerl(FacialExpression.FRIENDLY, "Sorry! I'm too busy to hear your problems!").also { stage = END_DIALOGUE }
}
4 -> npcl(FacialExpression.SAD, "It's brother Androe's son! With his constant: Waaaaaah! Waaaaaaaaah! Androe said it's natural, but it's so annoying!").also { stage++ }
5 -> playerl(FacialExpression.NEUTRAL, "I suppose that's what kids do.").also { stage++ }
6 -> npcl(FacialExpression.SAD, "He was fine, up until last week! Thieves broke in! They stole his favourite sleeping blanket!").also { stage++ }
7 -> npcl(FacialExpression.SAD, "Now he won't rest until it's returned... ...and that, means neither can I!").also { stage++ }
8 -> options(
"Can I help at all?",
"I'm sorry to hear that! I hope you find his blanket.").also { stage++ }
9 -> when (buttonID) {
1 -> playerl(FacialExpression.HALF_ASKING, "Can I help at all?").also { stage++ }
2 -> playerl(FacialExpression.FRIENDLY, "I'm sorry to hear that! I hope you find his blanket.").also { stage = END_DIALOGUE }
}
10 -> npcl(FacialExpression.HALF_WORRIED, "Please do. We won't be able to help you as we are peaceful men but we would be grateful for your help!").also { stage++ }
11 -> playerl(FacialExpression.HALF_ASKING, "Where are they?").also { stage++ }
12 -> npcl(FacialExpression.SAD, "They hide in a secret cave in the forest. It's hidden under a ring of stones. Please, bring back the blanket!").also { stage = END_DIALOGUE }.also { player!!.questRepository.getQuest("Monk's Friend").start(player) }.also { player!!.questRepository.syncronizeTab(player) }
}
}
10 -> {
when(stage) {
0 -> playerl(FacialExpression.HAPPY, "Hello.").also{stage = 20 }
20 -> npcl(FacialExpression.SAD, "*yawn*...oh, hello again...*yawn*").also{stage++ }
21 -> npcl(FacialExpression.SAD, "Please tell me you have the blanket.").also{stage++}
22 -> if(player!!.inventory.containItems(Items.CHILDS_BLANKET_90)){
playerl(FacialExpression.HAPPY, "Yes! I've recovered it from the clutches of the evil thieves!").also{stage = 30}
} else {
playerl(FacialExpression.SAD, "I'm afraid not.").also{stage++}
}
23 -> npcl(FacialExpression.SAD, "I need some sleep!").also{stage = END_DIALOGUE}
30 -> {
sendItemDialogue(player!!, Items.CHILDS_BLANKET_90, "You hand the monk the childs blanket.")
stage=31
}
31 -> npcl(FacialExpression.HAPPY, "Really, that's excellent, well done! Maybe now I will be able to get some rest.").also{stage++}
32 -> npcl(FacialExpression.SAD, "*yawn*..I'm off to bed! Farewell brave traveller!").also{player!!.inventory.remove(Item(Items.CHILDS_BLANKET_90))
setQuest(player!!, 20); stage = END_DIALOGUE}
}
}
20 -> {
when(stage) {
0 -> playerl(FacialExpression.HAPPY, "Hello, how are you?").also{stage = 30 }
30 -> npcl(FacialExpression.HAPPY, "Much better now I'm sleeping well! Now I can organise the party.").also{stage++}
31 -> playerl(FacialExpression.HAPPY, "Ooh! What party?").also{stage++}
32 -> npcl(FacialExpression.HAPPY, "The son of Brother Androe's birthday party. He's going to be one year old!").also {stage++}
33 -> playerl(FacialExpression.HAPPY, "That's sweet!").also{stage++ }
34 -> npcl(FacialExpression.HAPPY, "It's also a great excuse for a drink!").also{stage++}
35 -> npcl(FacialExpression.NEUTRAL, "We just need Brother Cedric to return with the wine.").also{stage++}
36 -> options(
"Who's Brother Cedric?",
"Enjoy it! I'll see you soon!").also { stage++}
37 -> when(buttonID){
1 -> playerl(FacialExpression.HALF_ASKING, "Who's Brother Cedric?").also{stage++}
2 -> playerl(FacialExpression.FRIENDLY, "Enjoy it! I'll see you soon!").also{stage = 998}
}
998 -> npcl(FacialExpression.NEUTRAL, "Take care traveller.").also{stage = END_DIALOGUE}
38 -> npcl(FacialExpression.FRIENDLY, "Cedric is a member of the order too. We sent him out three days ago to collect wine. But he didn't return!").also{stage++}
39 -> npcl(FacialExpression.NEUTRAL, "He most probably got drunk and lost in the forest!").also{stage++}
40 -> options(
"I've no time for that, sorry.",
"Where should I look?",
"Can I come to the party?").also { stage++}
41 -> when(buttonID){
1 -> playerl(FacialExpression.NEUTRAL, "I've no time for that, sorry.").also {stage = 996}
2 -> playerl(FacialExpression.HALF_ASKING, "Where should I look?").also {stage++}
3 -> playerl(FacialExpression.HALF_ASKING, "Can I come to the party?").also{stage = 997}
}
996 -> npcl(FacialExpression.NEUTRAL, "Okay traveller, take care.").also{stage = END_DIALOGUE}
997 -> npcl(FacialExpression.NEUTRAL, "Of course, but we need the wine first.").also{stage = END_DIALOGUE}
42 -> npcl(FacialExpression.FRIENDLY, "Oh, he won't be far. Probably out in the forest.").also{stage++}
43 -> playerl(FacialExpression.FRIENDLY, "Ok, I'll go and find him.").also { stage = END_DIALOGUE}.also{ setQuest(player!!, 30);}
}
}
30 -> {
when(stage) {
0 -> playerl(FacialExpression.HAPPY, "Hello brother Omad.").also{stage = 50}
50 -> npcl(FacialExpression.NEUTRAL, "Hello adventurer, have you found Brother Cedric?").also{stage++}
51 -> playerl(FacialExpression.SAD, "Not yet.").also{stage++}
52 -> npcl(FacialExpression.FRIENDLY, "Well, keep looking, we need that wine!").also{stage = END_DIALOGUE}
}
}
40 -> {
when(stage) {
0 -> npcl(FacialExpression.HAPPY, "Hello adventurer, have you found Brother Cedric?").also{stage = 60}
60 -> playerl(FacialExpression.NEUTRAL, "Yes I've seen him, he's a bit drunk!").also{stage++}
61 -> npcl(FacialExpression.FRIENDLY, "Well, try your best to get him back here!").also{stage = END_DIALOGUE}
}
}
41, 42 -> {
when(stage) {
0 -> playerl(FacialExpression.HAPPY, "Hello again brother Omad.").also{stage = 70}
70 -> npcl(FacialExpression.NEUTRAL, "Hello adventurer, where's Brother Cedric?").also{stage++}
71 -> npcl(FacialExpression.NEUTRAL, "He's having a bit of trouble with his cart.").also{stage++}
72 -> npcl(FacialExpression.NEUTRAL, "Hmmm! Maybe you could help?").also{stage = END_DIALOGUE}
}
}
50 -> {
when(stage) {
0 -> playerl(FacialExpression.HAPPY, "Hi Omad, Brother Cedric is on his way!").also{stage = 80}
80 -> npcl(FacialExpression.HAPPY, "Good! Good! Now we can party!").also{stage++}
81 -> npcl(FacialExpression.HAPPY, "I have little to repay you with, but I'd like to offer you some rune stones. But first, let's party!").also{stage++}
82 -> sendDialogue(player!!, "Brother Omad gives you 8 Law Runes").also{stage++}
83 -> playerl(FacialExpression.HAPPY, "Thanks Brother Omad!").also{stage++}
84 -> {
commenceMonkParty(true)
end()
}
}
}
100 -> {
commenceMonkParty(false)
}
}
}
private fun commenceMonkParty(questComplete : Boolean) {
val brotherOmad: NPC? = RegionManager.getNpc(Location(2604, 3209, 0), 279, 6)
val monk: NPC? = RegionManager.getNpc(Location(2609, 3207, 0), 281, 6)
// Spawn balloons when PartyRoom code is fixed.
Pulser.submit(object : Pulse(1) {
var count = 0
override fun pulse(): Boolean {
when (count) {
1 -> {
brotherOmad!!.sendChat("Party!")
brotherOmad.animator.animate(Animation(866)) // Dance
}
3 -> {
player!!.sendChat("Woop!")
player!!.animator.animate(Animation(866)) // Dance
}
5 -> {
monk!!.sendChat("Yeah!")
monk.animator.animate(Animation(2106)) // Jig
}
7 -> brotherOmad!!.sendChat("Let's boogie!")
9 -> player!!.sendChat("Oh, baby!")
11 -> monk!!.sendChat("GO!")
13 -> {
brotherOmad!!.sendChat("Get down!")
brotherOmad.animator.animate(Animation(2108)) // Headbang
}
15 -> player!!.sendChat("Feel the rhythm!")
17 -> monk!!.sendChat("Dance!")
19 -> brotherOmad!!.sendChat("Oh my!")
21 -> {
player!!.sendChat("Watch me go!")
player!!.animator.animate(Animation(861)) // Laugh
}
23 -> {
monk!!.sendChat("You go!")
monk.animator.animate(Animation(2109)) // Jump for joy
}
25 -> if (questComplete) {
player!!.questRepository.getQuest("Monk's Friend").finish(player)
player!!.questRepository.getQuest("Monk's Friend").setStage(player, 100)
}
}
count++
return false
}
})
}
}
/**
* Handles BrotherCedricListener to launch the dialogue
* @author Kya
*/
class BrotherOmadListener : InteractionListener() {
override fun defineListeners() {
on(NPCs.BROTHER_OMAD_279, NPC, "talk-to"){ player, _ ->
player.dialogueInterpreter.open(BrotherOmadDialogue(), NPC(NPCs.BROTHER_OMAD_279))
return@on true
}
}
}
@@ -0,0 +1,44 @@
package rs09.game.content.quest.members.monksfriend
import core.game.content.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
import org.rs09.consts.NPCs
import rs09.game.content.dialogue.DialogueFile
import rs09.game.interaction.InteractionListener
import rs09.tools.END_DIALOGUE
/**
* Handles MonasteryMonkDialogue Dialogue
* @author Kya
*/
class MonasteryMonkDialogue : DialogueFile() {
override fun handle(interfaceId: Int, buttonId: Int) {
var questStage = player!!.questRepository.getStage("Monk's Friend")
if (questStage == 0){
when(stage) {
0 -> npcl(FacialExpression.NEUTRAL,"Peace brother.").also { stage = END_DIALOGUE }
}
} else if (questStage < 100) {
when(stage) {
0 -> npcl(FacialExpression.FRIENDLY,"*yawn*").also{stage = END_DIALOGUE}
}
} else {
when(stage) {
0 -> npcl(FacialExpression.HAPPY,"Can't wait for the party!").also{stage = END_DIALOGUE}
}
}
}
}
/**
* Handles BrotherCedricListener to launch the dialogue
* @author Kya
*/
class MonasteryMonkListener : InteractionListener() {
override fun defineListeners() {
on(NPCs.MONK_281, NPC, "talk-to"){ player, _ ->
player.dialogueInterpreter.open(MonasteryMonkDialogue(), NPC(NPCs.MONK_281))
return@on true
}
}
}
@@ -0,0 +1,71 @@
package rs09.game.content.quest.members.monksfriend
import api.*
import core.game.node.entity.player.Player
import core.game.node.entity.player.link.quest.Quest
import core.game.node.entity.skill.Skills
import core.game.node.item.Item
import core.plugin.Initializable
import org.rs09.consts.Items
/**
* Represents the "Monk's Friend" quest.
* @author Kya
*/
@Initializable
class MonksFriend: Quest("Monk's Friend", 89, 88, 1, 30, 0, 1, 80) {
override fun newInstance(`object`: Any?): Quest {
return this
}
override fun drawJournal(player: Player?, stage: Int) {
super.drawJournal(player, stage)
var line = 11
player?: return
if(stage == 0){
line(player, "I can start this quest by speaking to !!Brother Omad?? in the", line++)
line(player, "!!Monastery?? south of !!Ardougne??.", line++)
line++
}
if(stage == 10){
line(player, "Brother Omad asked me to recover a child's blanket.", line++)
}
if(stage >= 20){
line(player, "Brother Omad asked me to recover a child's blanket, I ", line++, true)
line(player, "found the secret cave and gave back the blanket.", line++, true)
}
if(stage ==30){
line(player, "I agreed to find !!Brother Cedric.?? he is somewhere in the", line++)
line(player, "!!forest?? south of !!Ardougne??", line++)
}
if(stage >= 50){
line(player, "I found Brother Cedric in the forest south of Ardougne.", line++, true)
line(player, "I sobered him up and I helped him fix his cart.", line++, true)
}
if(stage == 100){
line(player, "I had a party with the Monks. There were party balloons and we danced the night away!", line++, true)
}
}
override fun finish(player: Player?) {
super.finish(player)
player ?: return
var ln = 10
player.packetDispatch.sendItemZoomOnInterface(Items.LAW_RUNE_563, 230, 277, 5)
drawReward(player,"1 Quest Point", ln++)
drawReward(player,"8 Law Runes", ln++)
drawReward(player,"2000 Woodcutting XP", ln++)
rewardXP(player, Skills.WOODCUTTING, 2000.0)
player.inventory.add(Item(563, 8))
}
}
fun setQuest(player: Player, stage: Int){
player.questRepository.getQuest("Monk's Friend").setStage(player, stage)
}
@@ -0,0 +1,47 @@
package rs09.game.content.zone
import core.game.node.entity.Entity
import core.game.node.entity.player.Player
import core.game.world.map.zone.MapZone
import core.game.world.map.zone.ZoneBorders
import core.game.world.map.zone.ZoneBuilder
import core.plugin.Initializable
import core.plugin.Plugin
/**
* Handles the stone circle zone south of Ardougne.
* @author Kya
*/
@Initializable
class StoneCircleZone : MapZone("stone circle", true), Plugin<Any> {
/**
* Constructs a new `StoneCircleZone` `Object`.
*/
override fun configure() {
register(ZoneBorders(2558, 3219, 2559, 3225))
register(ZoneBorders(2560, 3219, 2564, 3225))
}
override fun fireEvent(identifier: String?, vararg args: Any?): Any? {
return null
}
override fun newInstance(arg: Any?): Plugin<Any> {
ZoneBuilder.configure(this)
return this
}
override fun enter(e: Entity): Boolean {
if (e is Player) {
e.varpManager.get(1184).setVarbit(28, 1).send(e)
}
return super.enter(e)
}
override fun leave(e: Entity, logout: Boolean): Boolean {
if (!logout && e is Player) {
e.varpManager.get(1184).setVarbit(28, 0).send(e)
}
return super.leave(e, logout)
}
}